next-element-vue 0.6.12 → 0.6.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.js CHANGED
@@ -1,10 +1,10 @@
1
1
 
2
2
  /**
3
3
  * 作  者:huangteng
4
- * 邮  箱:htengweb@163.com
5
- * 当前版本:0.6.12 v
6
- * 发布日期:2025-12-17
4
+ * 邮  箱:junehunter@163.com
5
+ * 当前版本:0.6.14 v
6
+ * 发布日期:2025-12-19
7
7
  * 地  址:https://www.npmjs.com/package/next-element-vue
8
8
  */
9
9
 
10
- import{getCurrentInstance as e,inject as t,ref as a,computed as l,unref as n,isRef as s,defineComponent as o,createVNode as r,Fragment as i,createElementBlock as c,openBlock as u,createElementVNode as d,onUnmounted as h,reactive as p,resolveComponent as v,isVNode as f,Teleport as m,provide as g,watch as b,nextTick as y,markRaw as x,watchEffect as w,h as C,onMounted as M,toRaw as S,createTextVNode as E,render as D,toRef as k}from"vue";import{localeContextKey as O,ElMessage as L,ElTooltip as T,ElScrollbar as P,ElDivider as A,ElColorPicker as _,ElSwitch as j,ElDropdown as z,ElDropdownMenu as H,ElDropdownItem as V,ElIcon as R,ElDrawer as I,ElMenuItem as N,ElSubMenu as B,ElMenu as F,ElContainer as Y,ElCol as W,ElFormItem as U,ElInput as $,ElSelect as K,ElRadioGroup as X,ElRadio as q,ElDatePicker as G,ElInputNumber as Z,ElOption as J,ElForm as Q,ElRow as ee,ElButton as te,ElTable as ae,ElTableColumn as le,ElCheckbox as ne,ElMessageBox as se,ElPagination as oe,ElDialog as re,ElTag as ie,ElCheckboxGroup as ce,ElUpload as ue,ElImageViewer as de,ElImage as he,ElTreeSelect as pe,ElCascader as ve,ElTimeSelect as fe,ElEmpty as me,ElPopover as ge,ElPopconfirm as be}from"element-plus";import{useDateFormat as ye,useNow as xe,useFullscreen as we}from"@vueuse/core";import Ce from"video.js";import"video.js/dist/video-js.css";import Me from"video.js/dist/lang/zh-CN.json";import Se from"video.js/dist/lang/en.json";import Ee from"video.js/dist/lang/zh-TW.json";const De="next",ke=(e,t,a,l,n)=>{let s=`${e}-${t}`;return a&&(s+=`-${a}`),l&&(s+=`__${l}`),n&&(s+=`--${n}`),s},Oe=Symbol("namespaceContextKey"),Le=s=>{const o=s||(e()?t(Oe,a(De)):a(De));return l(()=>n(o)||De)},Te=(e,t)=>{const a=Le(t);return{namespace:a,b:(t="")=>ke(a.value,e,t,"",""),e:t=>t?ke(a.value,e,"",t,""):"",m:t=>t?ke(a.value,e,"","",t):"",be:(t,l)=>t&&l?ke(a.value,e,t,l,""):"",em:(t,l)=>t&&l?ke(a.value,e,"",t,l):"",bm:(t,l)=>t&&l?ke(a.value,e,t,"",l):"",bem:(t,l,n)=>t&&l&&n?ke(a.value,e,t,l,n):"",bf:(...t)=>{let l=`${a.value}-${e}`;for(const e in t){const a=t[e];a&&(l+="-"+a)}return l},is:(e,...t)=>{const a=!(t.length>=1)||t[0];return e&&a?`is-${e}`:""},cssVar:e=>{const t={};for(const l in e)e[l]&&(t[`--${a.value}-${l}`]=e[l]);return t},cssVarName:e=>`--${a.value}-${e}`,cssVarBlock:t=>{const l={};for(const n in t)t[n]&&(l[`--${a.value}-${e}-${n}`]=t[n]);return l},cssVarBlockName:t=>`--${a.value}-${e}-${t}`}};var Pe="object"==typeof global&&global&&global.Object===Object&&global,Ae="object"==typeof self&&self&&self.Object===Object&&self,_e=Pe||Ae||Function("return this")(),je=_e.Symbol,ze=Object.prototype,He=ze.hasOwnProperty,Ve=ze.toString,Re=je?je.toStringTag:void 0,Ie=Object.prototype.toString,Ne=je?je.toStringTag:void 0;function Be(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ne&&Ne in Object(e)?function(e){var t=He.call(e,Re),a=e[Re];try{e[Re]=void 0;var l=!0}catch(e){}var n=Ve.call(e);return l&&(t?e[Re]=a:delete e[Re]),n}(e):function(e){return Ie.call(e)}(e)}function Fe(e){return null!=e&&"object"==typeof e}function Ye(e){return"symbol"==typeof e||Fe(e)&&"[object Symbol]"==Be(e)}var We=Array.isArray,Ue=je?je.prototype:void 0,$e=Ue?Ue.toString:void 0;function Ke(e){if("string"==typeof e)return e;if(We(e))return function(e,t){for(var a=-1,l=null==e?0:e.length,n=Array(l);++a<l;)n[a]=t(e[a],a,e);return n}(e,Ke)+"";if(Ye(e))return $e?$e.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qe(e){return e}function Ge(e){if(!Xe(e))return!1;var t=Be(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Ze,Je=_e["__core-js_shared__"],Qe=(Ze=/[^.]+$/.exec(Je&&Je.keys&&Je.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",et=Function.prototype.toString;function tt(e){if(null!=e){try{return et.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var at=/^\[object .+?Constructor\]$/,lt=Function.prototype,nt=Object.prototype,st=lt.toString,ot=nt.hasOwnProperty,rt=RegExp("^"+st.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function it(e,t){var a=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Xe(e)||(t=e,Qe&&Qe in t))&&(Ge(e)?rt:at).test(tt(e));var t}(a)?a:void 0}var ct,ut,dt,ht=it(_e,"WeakMap"),pt=Object.create,vt=function(){function e(){}return function(t){if(!Xe(t))return{};if(pt)return pt(t);e.prototype=t;var a=new e;return e.prototype=void 0,a}}(),ft=Date.now,mt=function(){try{var e=it(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),gt=mt?function(e,t){return mt(e,"toString",{configurable:!0,enumerable:!1,value:(a=t,function(){return a}),writable:!0});var a}:qe,bt=(ct=gt,ut=0,dt=0,function(){var e=ft(),t=16-(e-dt);if(dt=e,t>0){if(++ut>=800)return arguments[0]}else ut=0;return ct.apply(void 0,arguments)}),yt=/^(?:0|[1-9]\d*)$/;function xt(e,t){var a=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==a||"symbol"!=a&&yt.test(e))&&e>-1&&e%1==0&&e<t}function wt(e,t,a){"__proto__"==t&&mt?mt(e,t,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[t]=a}function Ct(e,t){return e===t||e!=e&&t!=t}var Mt=Object.prototype.hasOwnProperty;function St(e,t,a){var l=e[t];Mt.call(e,t)&&Ct(l,a)&&(void 0!==a||t in e)||wt(e,t,a)}var Et=Math.max;function Dt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function kt(e){return null!=e&&Dt(e.length)&&!Ge(e)}function Ot(e){return function(e,t){return bt(function(e,t,a){return t=Et(void 0===t?e.length-1:t,0),function(){for(var l=arguments,n=-1,s=Et(l.length-t,0),o=Array(s);++n<s;)o[n]=l[t+n];n=-1;for(var r=Array(t+1);++n<t;)r[n]=l[n];return r[t]=a(o),function(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}(e,this,r)}}(e,t,qe),e+"")}(function(t,a){var l=-1,n=a.length,s=n>1?a[n-1]:void 0,o=n>2?a[2]:void 0;for(s=e.length>3&&"function"==typeof s?(n--,s):void 0,o&&function(e,t,a){if(!Xe(a))return!1;var l=typeof t;return!!("number"==l?kt(a)&&xt(t,a.length):"string"==l&&t in a)&&Ct(a[t],e)}(a[0],a[1],o)&&(s=n<3?void 0:s,n=1),t=Object(t);++l<n;){var r=a[l];r&&e(t,r,l,s)}return t})}var Lt=Object.prototype;function Tt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Lt)}function Pt(e){return Fe(e)&&"[object Arguments]"==Be(e)}var At=Object.prototype,_t=At.hasOwnProperty,jt=At.propertyIsEnumerable,zt=Pt(function(){return arguments}())?Pt:function(e){return Fe(e)&&_t.call(e,"callee")&&!jt.call(e,"callee")},Ht="object"==typeof exports&&exports&&!exports.nodeType&&exports,Vt=Ht&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Vt&&Vt.exports===Ht?_e.Buffer:void 0,It=(Rt?Rt.isBuffer:void 0)||function(){return!1},Nt={};function Bt(e){return function(t){return e(t)}}Nt["[object Float32Array]"]=Nt["[object Float64Array]"]=Nt["[object Int8Array]"]=Nt["[object Int16Array]"]=Nt["[object Int32Array]"]=Nt["[object Uint8Array]"]=Nt["[object Uint8ClampedArray]"]=Nt["[object Uint16Array]"]=Nt["[object Uint32Array]"]=!0,Nt["[object Arguments]"]=Nt["[object Array]"]=Nt["[object ArrayBuffer]"]=Nt["[object Boolean]"]=Nt["[object DataView]"]=Nt["[object Date]"]=Nt["[object Error]"]=Nt["[object Function]"]=Nt["[object Map]"]=Nt["[object Number]"]=Nt["[object Object]"]=Nt["[object RegExp]"]=Nt["[object Set]"]=Nt["[object String]"]=Nt["[object WeakMap]"]=!1;var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yt=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Yt&&Yt.exports===Ft&&Pe.process,Ut=function(){try{return Yt&&Yt.require&&Yt.require("util").types||Wt&&Wt.binding&&Wt.binding("util")}catch(e){}}(),$t=Ut&&Ut.isTypedArray,Kt=$t?Bt($t):function(e){return Fe(e)&&Dt(e.length)&&!!Nt[Be(e)]},Xt=Object.prototype.hasOwnProperty;function qt(e,t){var a=We(e),l=!a&&zt(e),n=!a&&!l&&It(e),s=!a&&!l&&!n&&Kt(e),o=a||l||n||s,r=o?function(e,t){for(var a=-1,l=Array(e);++a<e;)l[a]=t(a);return l}(e.length,String):[],i=r.length;for(var c in e)!t&&!Xt.call(e,c)||o&&("length"==c||n&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xt(c,i))||r.push(c);return r}function Gt(e,t){return function(a){return e(t(a))}}var Zt=Gt(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;function Qt(e){return kt(e)?qt(e):function(e){if(!Tt(e))return Zt(e);var t=[];for(var a in Object(e))Jt.call(e,a)&&"constructor"!=a&&t.push(a);return t}(e)}var ea=Object.prototype.hasOwnProperty;function ta(e){return kt(e)?qt(e,!0):function(e){if(!Xe(e))return function(e){var t=[];if(null!=e)for(var a in Object(e))t.push(a);return t}(e);var t=Tt(e),a=[];for(var l in e)("constructor"!=l||!t&&ea.call(e,l))&&a.push(l);return a}(e)}var aa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,la=/^\w*$/,na=it(Object,"create"),sa=Object.prototype.hasOwnProperty,oa=Object.prototype.hasOwnProperty;function ra(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}function ia(e,t){for(var a=e.length;a--;)if(Ct(e[a][0],t))return a;return-1}ra.prototype.clear=function(){this.__data__=na?na(null):{},this.size=0},ra.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ra.prototype.get=function(e){var t=this.__data__;if(na){var a=t[e];return"__lodash_hash_undefined__"===a?void 0:a}return sa.call(t,e)?t[e]:void 0},ra.prototype.has=function(e){var t=this.__data__;return na?void 0!==t[e]:oa.call(t,e)},ra.prototype.set=function(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=na&&void 0===t?"__lodash_hash_undefined__":t,this};var ca=Array.prototype.splice;function ua(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}ua.prototype.clear=function(){this.__data__=[],this.size=0},ua.prototype.delete=function(e){var t=this.__data__,a=ia(t,e);return!(a<0||(a==t.length-1?t.pop():ca.call(t,a,1),--this.size,0))},ua.prototype.get=function(e){var t=this.__data__,a=ia(t,e);return a<0?void 0:t[a][1]},ua.prototype.has=function(e){return ia(this.__data__,e)>-1},ua.prototype.set=function(e,t){var a=this.__data__,l=ia(a,e);return l<0?(++this.size,a.push([e,t])):a[l][1]=t,this};var da=it(_e,"Map");function ha(e,t){var a,l,n=e.__data__;return("string"==(l=typeof(a=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==a:null===a)?n["string"==typeof t?"string":"hash"]:n.map}function pa(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}function va(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var a=function(){var l=arguments,n=t?t.apply(this,l):l[0],s=a.cache;if(s.has(n))return s.get(n);var o=e.apply(this,l);return a.cache=s.set(n,o)||s,o};return a.cache=new(va.Cache||pa),a}pa.prototype.clear=function(){this.size=0,this.__data__={hash:new ra,map:new(da||ua),string:new ra}},pa.prototype.delete=function(e){var t=ha(this,e).delete(e);return this.size-=t?1:0,t},pa.prototype.get=function(e){return ha(this,e).get(e)},pa.prototype.has=function(e){return ha(this,e).has(e)},pa.prototype.set=function(e,t){var a=ha(this,e),l=a.size;return a.set(e,t),this.size+=a.size==l?0:1,this},va.Cache=pa;var fa,ma,ga=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ba=/\\(\\)?/g,ya=(fa=va(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ga,function(e,a,l,n){t.push(l?n.replace(ba,"$1"):a||e)}),t},function(e){return 500===ma.size&&ma.clear(),e}),ma=fa.cache,fa);function xa(e){if("string"==typeof e||Ye(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function wa(e,t,a){var l=null==e?void 0:function(e,t){for(var a=0,l=(t=function(e,t){return We(e)?e:function(e,t){if(We(e))return!1;var a=typeof e;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=e&&!Ye(e))||la.test(e)||!aa.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:ya(function(e){return null==e?"":Ke(e)}(e))}(t,e)).length;null!=e&&a<l;)e=e[xa(t[a++])];return a&&a==l?e:void 0}(e,t);return void 0===l?a:l}var Ca=Gt(Object.getPrototypeOf,Object),Ma=Function.prototype,Sa=Object.prototype,Ea=Ma.toString,Da=Sa.hasOwnProperty,ka=Ea.call(Object);function Oa(e){var t=this.__data__=new ua(e);this.size=t.size}Oa.prototype.clear=function(){this.__data__=new ua,this.size=0},Oa.prototype.delete=function(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a},Oa.prototype.get=function(e){return this.__data__.get(e)},Oa.prototype.has=function(e){return this.__data__.has(e)},Oa.prototype.set=function(e,t){var a=this.__data__;if(a instanceof ua){var l=a.__data__;if(!da||l.length<199)return l.push([e,t]),this.size=++a.size,this;a=this.__data__=new pa(l)}return a.set(e,t),this.size=a.size,this};var La="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ta=La&&"object"==typeof module&&module&&!module.nodeType&&module,Pa=Ta&&Ta.exports===La?_e.Buffer:void 0,Aa=Pa?Pa.allocUnsafe:void 0;function _a(e,t){if(t)return e.slice();var a=e.length,l=Aa?Aa(a):new e.constructor(a);return e.copy(l),l}var ja=Object.prototype.propertyIsEnumerable,za=Object.getOwnPropertySymbols,Ha=za?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var a=-1,l=null==e?0:e.length,n=0,s=[];++a<l;){var o=e[a];t(o)&&(s[n++]=o)}return s}(za(e),function(t){return ja.call(e,t)}))}:function(){return[]};function Va(e){return function(e,t,a){var l=Qt(e);return We(e)?l:function(e,t){for(var a=-1,l=t.length,n=e.length;++a<l;)e[n+a]=t[a];return e}(l,a(e))}(e,0,Ha)}var Ra=it(_e,"DataView"),Ia=it(_e,"Promise"),Na=it(_e,"Set"),Ba="[object Map]",Fa="[object Promise]",Ya="[object Set]",Wa="[object WeakMap]",Ua="[object DataView]",$a=tt(Ra),Ka=tt(da),Xa=tt(Ia),qa=tt(Na),Ga=tt(ht),Za=Be;(Ra&&Za(new Ra(new ArrayBuffer(1)))!=Ua||da&&Za(new da)!=Ba||Ia&&Za(Ia.resolve())!=Fa||Na&&Za(new Na)!=Ya||ht&&Za(new ht)!=Wa)&&(Za=function(e){var t=Be(e),a="[object Object]"==t?e.constructor:void 0,l=a?tt(a):"";if(l)switch(l){case $a:return Ua;case Ka:return Ba;case Xa:return Fa;case qa:return Ya;case Ga:return Wa}return t});var Ja=Object.prototype.hasOwnProperty,Qa=_e.Uint8Array;function el(e){var t=new e.constructor(e.byteLength);return new Qa(t).set(new Qa(e)),t}var tl=/\w*$/,al=je?je.prototype:void 0,ll=al?al.valueOf:void 0;function nl(e,t){var a=t?el(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}function sl(e){return"function"!=typeof e.constructor||Tt(e)?{}:vt(Ca(e))}var ol=Ut&&Ut.isMap,rl=ol?Bt(ol):function(e){return Fe(e)&&"[object Map]"==Za(e)},il=Ut&&Ut.isSet,cl=il?Bt(il):function(e){return Fe(e)&&"[object Set]"==Za(e)},ul="[object Arguments]",dl="[object Function]",hl="[object Object]",pl={};function vl(e,t,a,l,n,s){var o,r=1&t;if(void 0!==o)return o;if(!Xe(e))return e;var i=We(e);if(i)o=function(e){var t=e.length,a=new e.constructor(t);return t&&"string"==typeof e[0]&&Ja.call(e,"index")&&(a.index=e.index,a.input=e.input),a}(e);else{var c=Za(e),u=c==dl||"[object GeneratorFunction]"==c;if(It(e))return _a(e,r);if(c==hl||c==ul||u&&!n)o=u?{}:sl(e);else{if(!pl[c])return n?e:{};o=function(e,t,a){var l,n,s,o,r,i=e.constructor;switch(t){case"[object ArrayBuffer]":return el(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return r=el((o=e).buffer),new o.constructor(r,o.byteOffset,o.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return nl(e,a);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(s=new(n=e).constructor(n.source,tl.exec(n))).lastIndex=n.lastIndex,s;case"[object Symbol]":return l=e,ll?Object(ll.call(l)):{}}}(e,c,r)}}s||(s=new Oa);var d=s.get(e);if(d)return d;s.set(e,o),cl(e)?e.forEach(function(l){o.add(vl(l,t,a,0,e,s))}):rl(e)&&e.forEach(function(l,n){o.set(n,vl(l,t,a,0,e,s))});var h=i?void 0:Va(e);return function(e,t){for(var a=-1,l=null==e?0:e.length;++a<l&&!1!==t(e[a],a););}(h||e,function(l,n){h&&(l=e[n=l]),St(o,n,vl(l,t,a,0,e,s))}),o}function fl(e){return vl(e,5)}function ml(e){var t=-1,a=null==e?0:e.length;for(this.__data__=new pa;++t<a;)this.add(e[t])}function gl(e,t){for(var a=-1,l=null==e?0:e.length;++a<l;)if(t(e[a],a,e))return!0;return!1}function bl(e,t,a,l,n,s){var o=1&a,r=e.length,i=t.length;if(r!=i&&!(o&&i>r))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=2&a?new ml:void 0;for(s.set(e,t),s.set(t,e);++d<r;){var v=e[d],f=t[d];if(l)var m=o?l(f,v,d,t,e,s):l(v,f,d,e,t,s);if(void 0!==m){if(m)continue;h=!1;break}if(p){if(!gl(t,function(e,t){if(o=t,!p.has(o)&&(v===e||n(v,e,a,l,s)))return p.push(t);var o})){h=!1;break}}else if(v!==f&&!n(v,f,a,l,s)){h=!1;break}}return s.delete(e),s.delete(t),h}function yl(e){var t=-1,a=Array(e.size);return e.forEach(function(e,l){a[++t]=[l,e]}),a}function xl(e){var t=-1,a=Array(e.size);return e.forEach(function(e){a[++t]=e}),a}pl[ul]=pl["[object Array]"]=pl["[object ArrayBuffer]"]=pl["[object DataView]"]=pl["[object Boolean]"]=pl["[object Date]"]=pl["[object Float32Array]"]=pl["[object Float64Array]"]=pl["[object Int8Array]"]=pl["[object Int16Array]"]=pl["[object Int32Array]"]=pl["[object Map]"]=pl["[object Number]"]=pl[hl]=pl["[object RegExp]"]=pl["[object Set]"]=pl["[object String]"]=pl["[object Symbol]"]=pl["[object Uint8Array]"]=pl["[object Uint8ClampedArray]"]=pl["[object Uint16Array]"]=pl["[object Uint32Array]"]=!0,pl["[object Error]"]=pl[dl]=pl["[object WeakMap]"]=!1,ml.prototype.add=ml.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ml.prototype.has=function(e){return this.__data__.has(e)};var wl=je?je.prototype:void 0,Cl=wl?wl.valueOf:void 0,Ml=Object.prototype.hasOwnProperty,Sl="[object Arguments]",El="[object Array]",Dl="[object Object]",kl=Object.prototype.hasOwnProperty;function Ol(e,t,a,l,n){return e===t||(null==e||null==t||!Fe(e)&&!Fe(t)?e!=e&&t!=t:function(e,t,a,l,n,s){var o=We(e),r=We(t),i=o?El:Za(e),c=r?El:Za(t),u=(i=i==Sl?Dl:i)==Dl,d=(c=c==Sl?Dl:c)==Dl,h=i==c;if(h&&It(e)){if(!It(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new Oa),o||Kt(e)?bl(e,t,a,l,n,s):function(e,t,a,l,n,s,o){switch(a){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Qa(e),new Qa(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ct(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=yl;case"[object Set]":var i=1&l;if(r||(r=xl),e.size!=t.size&&!i)return!1;var c=o.get(e);if(c)return c==t;l|=2,o.set(e,t);var u=bl(r(e),r(t),l,n,s,o);return o.delete(e),u;case"[object Symbol]":if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,i,a,l,n,s);if(!(1&a)){var p=u&&kl.call(e,"__wrapped__"),v=d&&kl.call(t,"__wrapped__");if(p||v){var f=p?e.value():e,m=v?t.value():t;return s||(s=new Oa),n(f,m,a,l,s)}}return!!h&&(s||(s=new Oa),function(e,t,a,l,n,s){var o=1&a,r=Va(e),i=r.length;if(i!=Va(t).length&&!o)return!1;for(var c=i;c--;){var u=r[c];if(!(o?u in t:Ml.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=o;++c<i;){var f=e[u=r[c]],m=t[u];if(l)var g=o?l(m,f,u,t,e,s):l(f,m,u,e,t,s);if(!(void 0===g?f===m||n(f,m,a,l,s):g)){p=!1;break}v||(v="constructor"==u)}if(p&&!v){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,a,l,n,s))}(e,t,a,l,Ol,n))}function Ll(e,t,a){(void 0!==a&&!Ct(e[t],a)||void 0===a&&!(t in e))&&wt(e,t,a)}function Tl(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Pl(e,t,a,l,n,s,o){var r=Tl(e,a),i=Tl(t,a),c=o.get(i);if(c)Ll(e,a,c);else{var u,d=s?s(r,i,a+"",e,t,o):void 0,h=void 0===d;if(h){var p=We(i),v=!p&&It(i),f=!p&&!v&&Kt(i);d=i,p||v||f?We(r)?d=r:Fe(u=r)&&kt(u)?d=function(e,t){var a=-1,l=e.length;for(t||(t=Array(l));++a<l;)t[a]=e[a];return t}(r):v?(h=!1,d=_a(i,!0)):f?(h=!1,d=nl(i,!0)):d=[]:function(e){if(!Fe(e)||"[object Object]"!=Be(e))return!1;var t=Ca(e);if(null===t)return!0;var a=Da.call(t,"constructor")&&t.constructor;return"function"==typeof a&&a instanceof a&&Ea.call(a)==ka}(i)||zt(i)?(d=r,zt(r)?d=function(e){return function(e,t,a){var l=!a;a||(a={});for(var n=-1,s=t.length;++n<s;){var o=t[n],r=void 0;void 0===r&&(r=e[o]),l?wt(a,o,r):St(a,o,r)}return a}(e,ta(e))}(r):Xe(r)&&!Ge(r)||(d=sl(i))):h=!1}h&&(o.set(i,d),n(d,i,l,s,o),o.delete(i)),Ll(e,a,d)}}function Al(e,t,a,l,n){e!==t&&function(e,t,a){for(var l=-1,n=Object(e),s=a(e),o=s.length;o--;){var r=s[++l];if(!1===t(n[r],r,n))break}}(t,function(s,o){if(n||(n=new Oa),Xe(s))Pl(e,t,o,a,Al,l,n);else{var r=l?l(Tl(e,o),s,o+"",e,t,n):void 0;void 0===r&&(r=s),Ll(e,o,r)}},ta)}var _l=Ot(function(e,t,a,l){Al(e,t,a,l)});function jl(e,t){return Ol(e,t)}var zl=Ot(function(e,t,a){Al(e,t,a)}),Hl={name:"zh-cn",next:{loading:"加载中...",table:{search:"查询",clear:"清空",add:"新增",delete:"删除",batchDelete:"批量删除",export:"导出",edit:"编辑",view:"查看",unfoldSearch:"展开搜索",foldSearch:"收起搜索",notData:"暂无数据",operation:"操作",selection:"选择",selectionAll:"全选",setting:{title:"设置列",label:"列名",hide:"隐藏",filter:"筛选",sort:"排序"},message:{tip:"提示",batchDeleteTip:"您确定要批量删除吗?",cancelBatchDelete:"取消批量删除操作",deleteTip:"您确定要删除该数据吗?",cancelDelete:"取消删除操作",confirmButtonText:"确 定",cancelButtonText:"取 消"},uploadfileExceed:"上传文件数量超出限制范围"},form:{input:"请输入",select:"请选择",requiredInput:" 必填",requiredSelect:" 必选",submit:"提 交",cancel:"取 消",reset:"重 置",confirm:"确 定",tableSelect:" 选择",selectFile:"选择文件"},date:{oneWeekAge:"一周以前",oneMonthAge:"一个月以前",threeMonthsAge:"三个月以前",oneYearAge:"一年以前",threeYearsAge:"三年以前",rangeSeparator:"至",startPlaceholder:"开始时间",endPlaceholder:"结束时间"},layout:{home:"首页",personal:"个人中心",logOut:"退出登录",tabsOther:"关闭其他",tabsLeft:"关闭左侧",tabsRight:"关闭右侧",tabsAll:"关闭全部",setting:{systemSetting:"系统配置",globalTheme:"全局主题",themeColor:"主题颜色",darkMode:"暗黑模式",headerBackground:"顶栏背景",headerTextColor:"顶栏文本颜色",headerActiveTextColor:"顶栏活动文本颜色",headerGradient:"顶栏渐变",layoutMode:"布局模式",isShowTab:"显示标签",saveSetting:"保存设置",resetSetting:"重置设置"}},labelimg:{saveTxt:"保存中...",emptyLabelText:"暂无标签数据",confirmDeleteLabel:"确定要删除该标注吗?",saveLabel:"保存当前标注",instructions:"使用说明",labelNoUpdate:"暂无标签数据更新",zoomRestore:"还原"},labelme:{saveLabel:"保存",confirmDeleteLabel:"确定要删除该标注吗?",emptyLabelText:"暂无标签数据",createPolygon:"创建多边形(P)",editPolygon:"编辑图形(E)",deletePolyton:"删除多边形",createRectangle:"创建矩形(R)",createCircle:"创建圆形(C)",createKeypoint:"创建关键点(K)",selectClasses:"选择标签",emptyClassesText:"暂无标注",deleteClasses:"删除标注",labelGroupId:"分组ID",labelDescription:"标注描述"}}},Vl={name:"en",next:{loading:"loading...",table:{search:"search",clear:"clear",add:"add",delete:"del",batchDelete:"batch delete",export:"export",edit:"edit",view:"view",unfoldSearch:"unfold search",foldSearch:"fold search",notData:"not data",operation:"operations",selection:"selection",selectionAll:"select all",setting:{title:"column setting",label:"column name",hide:"hide",filter:"filter",sort:"srot"},message:{tip:"tip",batchDeleteTip:"Are you sure you want to delete them in bulk ?",cancelBatchDelete:"Cancel batch deletion",deleteTip:"Are you sure you want to delete this data ?",cancelDelete:"Cancel delete",confirmButtonText:"OK",cancelButtonText:"Cancel"},uploadfileExceed:"The number of uploaded files exceeds the limit"},form:{input:"please input ",select:"please select ",requiredInput:" required",requiredSelect:" required",submit:"Submit",cancel:"Cancel",reset:"reset",confirm:"confirm",tableSelect:" select",selectFile:"select file"},date:{oneWeekAge:"one week age",oneMonthAge:"one month age",threeMonthsAge:"three months age",oneYearAge:"one year age",threeYearsAge:"three years age",rangeSeparator:"to",startPlaceholder:"start time",endPlaceholder:"end time"},layout:{home:"Home",personal:"Personal",logOut:"LogOut",tabsOther:"close other",tabsLeft:"close left",tabsRight:"close right",tabsAll:"close all",setting:{systemSetting:"system setting",globalTheme:"global theme",themeColor:"theme color",darkMode:"dark mode",headerBackground:"header background",headerTextColor:"header text color",headerActiveTextColor:"header active text color",headerGradient:"header gradient",layoutMode:"layout mode",isShowTab:"show tab",saveSetting:"save setting",resetSetting:"reset setting"}},labelimg:{saveTxt:"saving...",emptyLabelText:"No label data",confirmDeleteLabel:"Are you sure you want to delete this annotation?",saveLabel:"save label",instructions:"instructions",labelNoUpdate:"No label data update",zoomRestore:"restore zoom"},labelme:{saveLabel:"saving...",confirmDeleteLabel:"Are you sure you want to delete this annotation?",emptyLabelText:"No label data",createPolygon:"create polygon (P)",editPolygon:"edit polygon (E)",deletePolygon:"delete polygon",createRectangle:"create rectangle (R)",createCircle:"create circle (C)",createKeypoint:"create keypoint (K)",selectClasses:"select classes",emptyClassesText:"No label classes",deleteClasses:"delete classes",labelGroupId:"Group ID",labelDescription:"label description"}}},Rl={name:"zh-tw",next:{loading:"加載中...",table:{search:"查詢",clear:"清空",add:"新增",delete:"刪除",batchDelete:"批量刪除",export:"導出",edit:"編輯",view:"查看",unfoldSearch:"展開搜索",foldSearch:"收起搜索",notData:"暫無數據",operation:"操作",selection:"选择",selectionAll:"全选",setting:{title:"設置列",label:"列名",hide:"隱藏",filter:"篩選",sort:"排序"},message:{tip:"提示",batchDeleteTip:"您確定要批量刪除嗎?",cancelBatchDelete:"取消批量刪除操作",deleteTip:"您确定要删除该数据吗?",cancelDelete:"取消删除操作",confirmButtonText:"確 定",cancelButtonText:"取 消"},uploadfileExceed:"上传文件数量超出限制范围"},form:{input:"請輸入",select:"請選擇",requiredInput:" 必填",requiredSelect:" 必選",submit:"提 交",cancel:"取 消",reset:"重 置",confirm:"确 定",tableSelect:" 選擇",selectFile:"選擇文件"},date:{oneWeekAge:"一周以前",oneMonthAge:"一个月以前",threeMonthsAge:"三个月以前",oneYearAge:"一年以前",threeYearsAge:"三年以前",rangeSeparator:"至",startPlaceholder:"開始時間",endPlaceholder:"結束時間"},layout:{home:"首頁",personal:"個人中心",logOut:"退出登錄",tabsOther:"關閉其他",tabsLeft:"關閉左側",tabsRight:"關閉右側",tabsAll:"關閉全部",setting:{systemSetting:"系統配置",globalTheme:"全局主題",themeColor:"主題顏色",darkMode:"暗黑模式",headerBackground:"頂欄背景",headerTextColor:"頂欄文本顏色",headerActiveTextColor:"頂欄活動文本顏色",headerGradient:"頂欄渐变",layoutMode:"布局模式",isShowTab:"是否顯示標籤",saveSetting:"保存設置",resetSetting:"重置設置"}},labelimg:{saveTxt:"保存中...",emptyLabelText:"暂暫無標註數據",confirmDeleteLabel:"確定要刪除該標註嗎?",saveLabel:"保存當前標註",instructions:"使用說明",labelNoUpdate:"暫無標籤數據更新",zoomRestore:"還原"},labelme:{saveLabel:"保存",confirmDeleteLabel:"確定要刪除該標註嗎?",emptyLabelText:"暫無標註數據",createPolygon:"創建多邊形(P)",editPolygon:"編輯圖形(E)",deletePolygon:"刪除多邊形",createRectangle:"創建矩形(R)",createCircle:"創建圓形(C)",createKeypoint:"創建關鍵點(K)",selectClasses:"選擇標籤",emptyClassesText:"咱無標註",deleteClasses:"刪除標註",labelGroupId:"分組ID",labelDescription:"標註描述"}}};const Il={[Hl.name]:{...Hl},[Vl.name]:{...Vl},[Rl.name]:{...Rl}},Nl=(e,t,a)=>wa(a,e,e)?.replace(/\{(\w+)\}/g,(e,a)=>`${t?.[a]??`{${a}}`}`),Bl=e=>(t,a)=>Nl(t,a,n(e)),Fl=e=>{const t=l(()=>n(e).name),o=s(e)?e:a(e),r=Il[t.value]||Il["zh-cn"];return o.value.next=r.next,{lang:t,locale:o,t:Bl(e)}},Yl=O,Wl=e=>{const n=e||t(Yl,a());return Fl(l(()=>n?.value||Hl))},Ul=(e,t)=>{const l=s(e)?e:a(e),n=Il[t]||Il["zh-cn"];l.value.name=t,l.value.next=n.next},$l=/^#([0-9A-F]{3}|[0-9A-F]{6}|[0-9A-F]{8})$/i,Kl=/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*(0|1|0?\.\d+)\s*\)$/i,Xl=/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i;function ql(){const e=e=>{const t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",").map(e=>parseFloat(e)),[a,l,n]=t;return`#${[a,l,n].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`.toUpperCase()};return{hexToRgb:e=>{let t="";if(!/^\#?[0-9A-Fa-f]{6}$/.test(e))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";t=(e=e.replace("#","")).match(/../g);for(let e=0;e<3;e++)t[e]=parseInt(t[e],16);return t},hexToRgba:(e,t=1)=>{let a="";if(!/^\#?[0-9A-Fa-f]{6}$/.test(e))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";a=(e=e.replace("#","")).match(/../g);for(let e=0;e<3;e++)a[e]=parseInt(a[e],16);return`rgba(${a.join(",")},${t})`},rgbToHex:(e,t,a)=>{let l=/^\d{1,3}$/;if(!l.test(e)||!l.test(t)||!l.test(a))return L({type:"warning",message:"rgb颜色值格式错误",grouping:!0}),"";let n=[e.toString(16),t.toString(16),a.toString(16)];for(let e=0;e<3;e++)1==n[e].length&&(n[e]=`0${n[e]}`);return`#${n.join("")}`},rgbaToHex:e,rgbaToHexAlpha:e=>{const t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",").map(e=>parseFloat(e)),[a,l,n,s]=t,o=Math.round(255*s).toString(16).padStart(2,"0");return`#${[a,l,n].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}${o}`.toUpperCase()},getDarkColor:(t,a)=>{let l=t;if(Kl.test(l)&&(l=e(l)),Xl.test(l)&&(l=e(l)),!$l.test(l))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";let n=ql().hexToRgb(l);for(let e=0;e<3;e++)n[e]=Math.floor(n[e]*(1-a));return ql().rgbToHex(n[0],n[1],n[2])},getLightColor:(t,a)=>{let l=t;if(Kl.test(l)&&(l=e(l)),Xl.test(l)&&(l=e(l)),!$l.test(l))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";let n=ql().hexToRgb(l);for(let e=0;e<3;e++)n[e]=Math.floor((255-n[e])*a+n[e]);return ql().rgbToHex(n[0],n[1],n[2])}}}function Gl(){return`#${(1<<24|Math.floor(256*Math.random())<<16|Math.floor(256*Math.random())<<8|Math.floor(256*Math.random())).toString(16).slice(1)}`}const{getLightColor:Zl}=ql(),Jl=(e,t)=>{document.documentElement.style.setProperty(e,t)},Ql=(e,t)=>{Jl(e,t);for(let a=1;a<10;a++)Jl(e+"-light-"+a,Zl(t,a/10));Jl(`${e}-dark-2`,t)},en=e=>{e&&Ql("--el-color-primary",e)},tn={themeColor:"--el-color-primary",headerBarColor:"--next-layout-bg-color",headerBarFontColor:"--next-layout-font-color"},an=e=>{for(const t in tn){const a=tn[t];e[t]&&Ql(a,e[t])}const t=document.documentElement;e.isDark?t.setAttribute("data-theme","dark"):t.setAttribute("data-theme","")},ln=async(e,t,a,l,n,s=[],o,r)=>{const{videoWidth:i,videoHeight:c}=e;if(!i||!c)return;let[u,d]=t.inputs[0].shape.slice(1,3),h=l.tidy(()=>l.image.resizeBilinear(l.browser.fromPixels(e),[u,d]).div(255).expandDims(0));a.clearRect(0,0,i,c),o.clearRect(0,0,i,c),await(t?.executeAsync(h).then(async t=>{let[u,d,p,v]=t;for(let t=0;t<v.dataSync()[0];++t){let[l,h,v,f]=u.dataSync().slice(4*t,4*(t+1));l=l<0||l>1?parseInt(l):l,v=v<0||v>1?parseInt(v):v,h=h<0||h>1?parseInt(h):h,f=f<0||f>1?parseInt(f):f,l=Math.round(Math.abs(l)*i),v=Math.round(Math.abs(v)*i),h=Math.round(Math.abs(h)*c),f=Math.round(Math.abs(f)*c);const m=v-l,g=f-h,b=l,y=h;let x=p.dataSync()[t],w=d.dataSync()[t].toFixed(2);const C=(e,t,a)=>{const l=Gl();a.strokeStyle=l,a.lineWidth=2,a.beginPath(),a.rect(b,y,m,g),a.stroke(),a.font="bold 16px Arial",a.fillStyle=l,a.fillText(`${e} ${t}`,b+10,y<20?20:y-10)};if(s?.length)for(let t=0;t<s.length;t++){const l=s[t];if(l.cls==x&&Number(w)>l.score){const t=n.find(e=>e.value==x);if(t){const l=t.label;C(l,w,await nn(e,o)),C(l,w,a),r&&r(l,w)}}}else if(w>.5){const e=n.find(e=>e.value==x);e&&C(e.label||"",w,a)}}h.dispose(),l.dispose(t)}))},nn=(e,t)=>{const a=e.videoWidth,l=e.videoHeight,n=a/l,s=a/l,o=a,r=l;let i,c,u,d;return n>s?(u=a,d=a/n,i=0,c=Math.round((l-d)/2)):n===s?(u=a,d=l,i=0,c=0):n<s&&(u=l*n,d=l,i=Math.round((a-u)/2),c=0),t.drawImage(e,0,0,o,r,i,c,u,d),t},sn=e=>({detectVideoFrameImage:({container:t,video:a,modelUrl:l,classNames:n,classInput:s=[]},o,r)=>l?n?void e.loadGraphModel(l).then(l=>{const r=document.createElement("canvas"),i=r.getContext("2d");r.style.position="absolute",r.style.zIndex="99",r.style.pointerEvents="none",t&&t.appendChild(r);const c=document.createElement("canvas"),u=c.getContext("2d");a.ontimeupdate=t=>{const{clientWidth:d,clientHeight:h}=t.target,{videoWidth:p,videoHeight:v,offsetTop:f,offsetLeft:m}=a;r.width=p,r.height=v,r.style.top=f+"px",r.style.left=m+"px",r.style.width=d+"px",r.style.height=h+"px",c.width=p,c.height=v,c.style.width=d+"px",c.style.height=h+"px",ln(a,l,i,e,n,s,u,(e,t)=>{const a="image/png";let l=r.toDataURL(a,.92).replace(a,"image/octet-stream");l=l.replace(/^data:image\/[^;]+/,"data:application/octet-stream");const n=c.toDataURL(a,.92);o&&o({name:e,score:t,detectImage:n,detectCanvas:c},{canvas:r,imageDataURL:l})})}}):(r&&r("模型类别不能未空"),!1):(r&&r("模型文件地址不能为空"),!1)}),on=(e,t)=>(e.install=t=>{for(const a of[e,...Object.values({})])t.component(a.name,a)},e),rn="header-menu",cn="header-tools-prefix",un="header-tools-suffix",dn="sidebar-menu";var hn={logo:"",title:"Next Element Vue",userName:"Admin",language:"zh-cn",languageDropdown:[{value:"zh-cn",label:"简体中文"},{value:"en",label:"English"},{value:"zh-tw",label:"繁體中文"}],userDropdown:[{value:"/",label:"next.layout.home",svg:'<svg t="1718695810903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11410" width="16" height="16"><path d="M988.672 502.272l-476.16-476.16-476.16 476.16c-8.704 8.704-8.704 22.528 0 31.232l1.536 1.536c8.704 8.704 22.528 8.704 31.232 0l443.392-443.392 443.392 443.392c8.704 8.704 22.528 8.704 31.232 0l1.536-1.536c8.704-8.704 8.704-22.528 0-31.232z" fill="" p-id="11411"></path><path d="M860.16 534.016c-12.288 0-22.016 9.728-22.016 22.016v333.312c0 54.272-27.648 64-47.104 64h-152.064v-227.84c0-25.088 0-59.392-44.544-59.392H418.816c-44.032 0-44.032 33.28-44.032 59.392v227.84h-153.6c-44.032 0-45.056-64-45.056-64v-333.312c0.512-12.288-8.704-22.528-20.992-23.04-12.288-0.512-22.528 8.704-23.04 20.992v368.64c0 65.536 70.144 75.264 70.144 75.264h217.088v-287.232h176.64v287.232H824.32c39.424 0 57.856-44.032 57.856-75.264v-366.592c0-12.288-9.728-22.016-22.016-22.016z" fill="" p-id="11412"></path></svg>'},{value:"/personal",label:"next.layout.personal",svg:'<svg t="1718695007028" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2161" width="16" height="16"><path d="M512 87.04c-136.704 0-247.808 111.104-247.808 247.808 0 98.816 58.368 184.32 142.336 223.744-155.136 45.568-268.8 188.928-268.8 358.912 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0-184.832 150.528-335.36 335.36-335.36 136.704 0 247.808-111.104 247.808-247.808S648.704 87.04 512 87.04z m0 456.192c-115.2 0-208.384-93.696-208.384-208.384 0-115.2 93.696-208.384 208.384-208.384 115.2 0 208.384 93.696 208.384 208.384 0 114.688-93.184 208.384-208.384 208.384z m226.816 76.8c-8.704-6.656-20.992-5.12-27.648 3.584-6.656 8.704-5.12 20.992 3.584 27.648 83.968 64 132.096 161.28 132.096 266.752 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0.512-118.272-53.248-226.816-146.944-297.984z" fill="" p-id="2162"></path></svg>'},{value:"logOut",label:"next.layout.logOut",svg:'<svg t="1718695049981" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2313" width="16" height="16"><path d="M896 928H384a32 32 0 0 1-32-32v-128a32 32 0 0 1 64 0v96h448v-704h-448V256a32 32 0 1 1-64 0V128a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32z" fill="" p-id="2314"></path><path d="M608 544H192a32 32 0 0 1 0-64h416a32 32 0 0 1 0 64z" fill="" p-id="2315"></path><path d="M256 672a30.08 30.08 0 0 1-22.4-9.6l-128-128a30.72 30.72 0 0 1 0-44.8l128-128a31.36 31.36 0 1 1 44.8 44.8L173.44 512l104.96 105.6a30.72 30.72 0 0 1 0 44.8 30.08 30.08 0 0 1-22.4 9.6z" fill="" p-id="2316"></path></svg>',divided:!0}],showTabs:!0,activeTab:"/",tabs:[],menuTree:[],menuRouter:!0,menuMode:"horizontal",setting:{layout:"transverse",themeColor:"#c71585",headerBarColor:"#282c34",headerBarFontColor:"#FFFFFF",headerBarFontActiveColor:"",isHeaderBarColorGradual:!1,asidebarColor:"#282c34",asidebarFontColor:"#ffffff",isAsidebarColorGradual:!1,isDark:!1}};const pn=Te("text-ellipsis"),vn=on(o({name:"NextTextEllipsis",props:{className:{type:String,default:""},content:{type:String,default:""},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},placement:{type:String,default:"top"},textAlign:{type:String,default:"left"}},setup(e,{slots:t}){const n=a(!1),s=l(()=>{const t=e.width;let a={textAlign:e.textAlign};return t&&("string"==typeof t?a.width=t:"number"==typeof t&&(a.width=t+"px")),a}),o=a(),c=()=>{try{const e=o.value;e&&e.scrollWidth&&e.scrollWidth>e.offsetWidth?n.value=!0:n.value=!1}catch(e){n.value=!1}};return()=>r(i,null,[r("div",{class:[pn.b(),e.className],style:s.value,onMouseenter:c},[n.value?r(T,{effect:"dark",content:e.content,placement:e.placement,disabled:e.disabled},{default:()=>[r("span",{class:pn.e("text"),ref:o},[t.default?t.default():e.content])]}):r("span",{class:pn.e("text"),ref:o},[t.default?t.default():e.content])])])}}));var fn=o({setup(){const e=t("__ns__",{}),a=t("options",{}),{t:l}=Wl(),n=()=>{a.onClickLogo?.(a)},s=()=>{a.onClickTitle?.(a)};return()=>r(i,null,[r("div",{class:e.bf("header","logo")},[a.logo&&r("img",{class:e.be("header-logo","img"),src:a.logo,alt:"logo",onClick:n},null),a.title&&r("p",{class:e.be("header-logo","title"),onClick:s},[r(vn,{content:l(a.title)},null)])])])}}),mn=o({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),gn=o({name:"ArrowLeft",__name:"arrow-left",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}),bn=o({name:"ArrowRight",__name:"arrow-right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}),yn=o({name:"ArrowUp",__name:"arrow-up",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}),xn=o({name:"Back",__name:"back",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"}),d("path",{fill:"currentColor",d:"m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"})]))}),wn=o({name:"Camera",__name:"camera",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"})]))}),Cn=o({name:"Close",__name:"close",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),Mn=o({name:"DArrowLeft",__name:"d-arrow-left",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z"})]))}),Sn=o({name:"DArrowRight",__name:"d-arrow-right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"})]))}),En=o({name:"Delete",__name:"delete",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}),Dn=o({name:"EditPen",__name:"edit-pen",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}),kn=o({name:"Edit",__name:"edit",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),d("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}),On=o({name:"FullScreen",__name:"full-screen",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}),Ln=o({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),Tn=o({name:"MoonNight",__name:"moon-night",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M384 512a448 448 0 0 1 215.872-383.296A384 384 0 0 0 213.76 640h188.8A448.3 448.3 0 0 1 384 512M171.136 704a448 448 0 0 1 636.992-575.296A384 384 0 0 0 499.328 704h-328.32z"}),d("path",{fill:"currentColor",d:"M32 640h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m128 128h384a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m160 127.68 224 .256a32 32 0 0 1 32 32V928a32 32 0 0 1-32 32l-224-.384a32 32 0 0 1-32-32v-.064a32 32 0 0 1 32-32z"})]))}),Pn=o({name:"Picture",__name:"picture",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"}),d("path",{fill:"currentColor",d:"M384 288q64 0 64 64t-64 64-64-64 64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z"})]))}),An=o({name:"Plus",__name:"plus",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}),_n=o({name:"Refresh",__name:"refresh",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}),jn=o({name:"Right",__name:"right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M754.752 480H160a32 32 0 1 0 0 64h594.752L521.344 777.344a32 32 0 0 0 45.312 45.312l288-288a32 32 0 0 0 0-45.312l-288-288a32 32 0 1 0-45.312 45.312z"})]))}),zn=o({name:"Search",__name:"search",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}),Hn=o({name:"Setting",__name:"setting",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}),Vn=o({name:"Sunny",__name:"sunny",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 704a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m0-704a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 768a32 32 0 0 1 32 32v64a32 32 0 1 1-64 0v-64a32 32 0 0 1 32-32M195.2 195.2a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 1 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m543.104 543.104a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 0-45.248M64 512a32 32 0 0 1 32-32h64a32 32 0 0 1 0 64H96a32 32 0 0 1-32-32m768 0a32 32 0 0 1 32-32h64a32 32 0 1 1 0 64h-64a32 32 0 0 1-32-32M195.2 828.8a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248L240.448 828.8a32 32 0 0 1-45.248 0m543.104-543.104a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248l-45.248 45.248a32 32 0 0 1-45.248 0"})]))}),Rn=o({name:"Tools",__name:"tools",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M764.416 254.72a351.7 351.7 0 0 1 86.336 149.184H960v192.064H850.752a351.7 351.7 0 0 1-86.336 149.312l54.72 94.72-166.272 96-54.592-94.72a352.64 352.64 0 0 1-172.48 0L371.136 936l-166.272-96 54.72-94.72a351.7 351.7 0 0 1-86.336-149.312H64v-192h109.248a351.7 351.7 0 0 1 86.336-149.312L204.8 160l166.208-96h.192l54.656 94.592a352.64 352.64 0 0 1 172.48 0L652.8 64h.128L819.2 160l-54.72 94.72zM704 499.968a192 192 0 1 0-384 0 192 192 0 0 0 384 0"})]))}),In=o({name:"View",__name:"view",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),Nn=o({name:"Warning",__name:"warning",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))});function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fn={exports:{}};(Fn.exports={}).forEach=function(e,t){for(var a=0;a<e.length;a++){var l=t(e[a]);if(l)return l}};var Yn=Fn.exports,Wn={exports:{}},Un=Wn.exports={};Un.isIE=function(e){return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==function(){var e=3,t=document.createElement("div"),a=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(a[0]);return e>4?e:void 0}());var t},Un.isLegacyOpera=function(){return!!window.opera};var $n=Wn.exports,Kn={exports:{}};(Kn.exports={}).getOption=function(e,t,a){var l=e[t];return null==l&&void 0!==a?a:l};var Xn=Kn.exports;function qn(){var e={},t=0,a=0,l=0;return{add:function(n,s){s||(s=n,n=0),n>a?a=n:n<l&&(l=n),e[n]||(e[n]=[]),e[n].push(s),t++},process:function(){for(var t=l;t<=a;t++)for(var n=e[t],s=0;s<n.length;s++)(0,n[s])()},size:function(){return t}}}var Gn="_erd";function Zn(e){return e[Gn]}var Jn={initState:function(e){return e[Gn]={},Zn(e)},getState:Zn,cleanState:function(e){delete e[Gn]}},Qn=$n,es=Yn.forEach,ts=Yn.forEach,as=$n,ls=Jn;function ns(e){return Array.isArray(e)||void 0!==e.length}function ss(e){if(Array.isArray(e))return e;var t=[];return ts(e,function(e){t.push(e)}),t}function os(e){return e&&1===e.nodeType}var rs=function(e){var t,a;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var l=function(e){var t=e.idGenerator,a=e.stateHandler.getState;return{get:function(e){var t=a(e);return t&&void 0!==t.id?t.id:null},set:function(e){var l=a(e);if(!l)throw new Error("setId required the element to have a resize detection state.");var n=t.generate();return l.id=n,n}}}({idGenerator:(a=1,{generate:function(){return a++}}),stateHandler:ls});t=l}var n=e.reporter;n||(n=function(e){function t(){}var a={log:t,warn:t,error:t};if(!e&&window.console){var l=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var a=0;a<arguments.length;a++)e(arguments[a])}};l(a,"log"),l(a,"warn"),l(a,"error")}return a}(!1===n));var s=is(e,"batchProcessor",function(e){var t=(e=e||{}).reporter,a=Xn.getOption(e,"async",!0),l=Xn.getOption(e,"auto",!0);l&&!a&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),a=!0);var n,s=qn(),o=!1;function r(){for(o=!0;s.size();){var e=s;s=qn(),e.process()}o=!1}function i(){n=setTimeout(r,0)}return{add:function(e,t){!o&&l&&a&&0===s.size()&&i(),s.add(e,t)},force:function(e){o||(void 0===e&&(e=a),n&&(clearTimeout(n),n=null),e?i():r())}}}({reporter:n})),o={};o.callOnAdd=!!is(e,"callOnAdd",!0),o.debug=!!is(e,"debug",!1);var r,i=function(e){var t={};function a(a){var l=e.get(a);return void 0===l?[]:t[l]||[]}return{get:a,add:function(a,l){var n=e.get(a);t[n]||(t[n]=[]),t[n].push(l)},removeListener:function(e,t){for(var l=a(e),n=0,s=l.length;n<s;++n)if(l[n]===t){l.splice(n,1);break}},removeAllListeners:function(e){var t=a(e);t&&(t.length=0)}}}(t),c=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var a=t(e);return a&&!!a.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,a){t(e).busy=!!a}}}({stateHandler:ls}),u=is(e,"strategy","object"),d=is(e,"important",!1),h={reporter:n,batchProcessor:s,stateHandler:ls,idHandler:t,important:d};if("scroll"===u&&(as.isLegacyOpera()?(n.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),u="object"):as.isIE(9)&&(n.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),u="object")),"scroll"===u)r=function(e){var t=(e=e||{}).reporter,a=e.batchProcessor,l=e.stateHandler.getState;e.stateHandler.hasState;var n=e.idHandler;if(!a)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var s=function(){var e=document.createElement("div");e.style.cssText=i(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=i(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var a=500-t.clientWidth,l=500-t.clientHeight;return document.body.removeChild(t),{width:a,height:l}}(),o="erd_scroll_detection_container";function r(e){!function(e,t,a){if(!e.getElementById(t)){var l=a+"_animation",n=a+"_animation_active",s="/* Created by the element-resize-detector library. */\n";s+="."+a+" > div::-webkit-scrollbar { "+i(["display: none"])+" }\n\n",s+="."+n+" { "+i(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+l,"animation-name: "+l])+" }\n",s+="@-webkit-keyframes "+l+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(a,l){l=l||function(t){e.head.appendChild(t)};var n=e.createElement("style");n.innerHTML=a,n.id=t,l(n)}(s+="@keyframes "+l+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",o)}function i(t){var a=e.important?" !important; ":"; ";return(t.join(a)+a).trim()}function c(e,a,l){if(e.addEventListener)e.addEventListener(a,l);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+a,l)}}function u(e,a,l){if(e.removeEventListener)e.removeEventListener(a,l);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+a,l)}}function d(e){return l(e).container.childNodes[0].childNodes[0].childNodes[0]}function h(e){return l(e).container.childNodes[0].childNodes[0].childNodes[1]}return r(window.document),{makeDetectable:function(e,r,u){function p(){if(e.debug){var a=Array.prototype.slice.call(arguments);if(a.unshift(n.get(r),"Scroll: "),t.log.apply)t.log.apply(null,a);else for(var l=0;l<a.length;l++)t.log(a[l])}}function v(e){var t=l(e).container.childNodes[0],a=window.getComputedStyle(t);return!a.width||-1===a.width.indexOf("px")}function f(){var e=window.getComputedStyle(r),t={};return t.position=e.position,t.width=r.offsetWidth,t.height=r.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function m(){if(p("storeStyle invoked."),l(r)){var e=f();l(r).style=e}else p("Aborting because element has been uninstalled")}function g(e,t,a){l(e).lastWidth=t,l(e).lastHeight=a}function b(){return 2*s.width+1}function y(){return 2*s.height+1}function x(e){return e+10+b()}function w(e){return e+10+y()}function C(e,t,a){var l=d(e),n=h(e),s=x(t),o=w(a),r=function(e){return 2*e+b()}(t),i=function(e){return 2*e+y()}(a);l.scrollLeft=s,l.scrollTop=o,n.scrollLeft=r,n.scrollTop=i}function M(){var e=l(r).container;if(!e){(e=document.createElement("div")).className=o,e.style.cssText=i(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),l(r).container=e,function(e){e.className+=" "+o+"_animation_active"}(e),r.appendChild(e);var t=function(){l(r).onRendered&&l(r).onRendered()};c(e,"animationstart",t),l(r).onAnimationStart=t}return e}function S(){if(p("Injecting elements"),l(r)){!function(){var a=l(r).style;if("static"===a.position){r.style.setProperty("position","relative",e.important?"important":"");var n=function(e,t,a,l){var n=a[l];"auto"!==n&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(n)&&(e.warn("An element that is positioned static has style."+l+"="+n+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+l+" will be set to 0. Element: ",t),t.style[l]=0)};n(t,r,a,"top"),n(t,r,a,"right"),n(t,r,a,"bottom"),n(t,r,a,"left")}}();var a=l(r).container;a||(a=M());var n,u,d,h,v=s.width,f=s.height,m=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),g=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(n=(n=-(1+v))?n+"px":"0"),"top: "+(u=(u=-(1+f))?u+"px":"0"),"right: "+(h=(h=-v)?h+"px":"0"),"bottom: "+(d=(d=-f)?d+"px":"0")])),b=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),y=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),x=i(["position: absolute","left: 0","top: 0"]),w=i(["position: absolute","width: 200%","height: 200%"]),C=document.createElement("div"),S=document.createElement("div"),E=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),O=document.createElement("div");C.dir="ltr",C.style.cssText=m,C.className=o,S.className=o,S.style.cssText=g,E.style.cssText=b,D.style.cssText=x,k.style.cssText=y,O.style.cssText=w,E.appendChild(D),k.appendChild(O),S.appendChild(E),S.appendChild(k),C.appendChild(S),a.appendChild(C),c(E,"scroll",L),c(k,"scroll",T),l(r).onExpandScroll=L,l(r).onShrinkScroll=T}else p("Aborting because element has been uninstalled");function L(){var e=l(r);e&&e.onExpand?e.onExpand():p("Aborting expand scroll handler: element has been uninstalled")}function T(){var e=l(r);e&&e.onShrink?e.onShrink():p("Aborting shrink scroll handler: element has been uninstalled")}}function E(){function s(t,a,l){var n=function(e){return d(e).childNodes[0]}(t),s=x(a),o=w(l);n.style.setProperty("width",s+"px",e.important?"important":""),n.style.setProperty("height",o+"px",e.important?"important":"")}function o(o){var c=r.offsetWidth,u=r.offsetHeight,d=c!==l(r).lastWidth||u!==l(r).lastHeight;p("Storing current size",c,u),g(r,c,u),a.add(0,function(){if(d)if(l(r))if(i()){if(e.debug){var a=r.offsetWidth,o=r.offsetHeight;a===c&&o===u||t.warn(n.get(r),"Scroll: Size changed before updating detector elements.")}s(r,c,u)}else p("Aborting because element container has not been initialized");else p("Aborting because element has been uninstalled")}),a.add(1,function(){l(r)?i()?C(r,c,u):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}),d&&o&&a.add(2,function(){l(r)?i()?o():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})}function i(){return!!l(r).container}function c(){p("notifyListenersIfNeeded invoked");var e=l(r);return void 0===l(r).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void es(l(r).listeners,function(e){e(r)}))}function u(){p("Scroll detected."),v(r)?p("Scroll event fired while unrendered. Ignoring..."):o(c)}if(p("registerListenersAndPositionElements invoked."),l(r)){l(r).onRendered=function(){if(p("startanimation triggered."),v(r))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=d(r),t=h(r);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),o(c))}},l(r).onExpand=u,l(r).onShrink=u;var f=l(r).style;s(r,f.width,f.height)}else p("Aborting because element has been uninstalled")}function D(){if(p("finalizeDomMutation invoked."),l(r)){var e=l(r).style;g(r,e.width,e.height),C(r,e.width,e.height)}else p("Aborting because element has been uninstalled")}function k(){u(r)}function O(){var e;p("Installing..."),l(r).listeners=[],e=f(),l(r).startSize={width:e.width,height:e.height},p("Element start size",l(r).startSize),a.add(0,m),a.add(1,S),a.add(2,E),a.add(3,D),a.add(4,k)}u||(u=r,r=e,e=null),e=e||{},p("Making detectable..."),function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(r)?(p("Element is detached"),M(),p("Waiting until element is attached..."),l(r).onRendered=function(){p("Element is now attached"),O()}):O()},addListener:function(e,t){if(!l(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");l(e).listeners.push(t)},uninstall:function(e){var t=l(e);t&&(t.onExpandScroll&&u(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&u(h(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&u(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:r}}(h);else{if("object"!==u)throw new Error("Invalid strategy name: "+u);r=function(e){var t=(e=e||{}).reporter,a=e.batchProcessor,l=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function n(t){var a=e.important?" !important; ":"; ";return(t.join(a)+a).trim()}function s(e){return l(e).object}return{makeDetectable:function(e,s,o){o||(o=s,s=e,e=null),(e=e||{}).debug,Qn.isIE(8)?o(s):function(s,o){var r=n(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),i=!1,c=window.getComputedStyle(s),u=s.offsetWidth,d=s.offsetHeight;function h(){function a(){if("static"===c.position){s.style.setProperty("position","relative",e.important?"important":"");var a=function(t,a,l,n){var s=l[n];"auto"!==s&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(s)&&(t.warn("An element that is positioned static has style."+n+"="+s+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+n+" will be set to 0. Element: ",a),a.style.setProperty(n,"0",e.important?"important":""))};a(t,s,c,"top"),a(t,s,c,"right"),a(t,s,c,"bottom"),a(t,s,c,"left")}}""!==c.position&&(a(),i=!0);var n=document.createElement("object");n.style.cssText=r,n.tabIndex=-1,n.type="text/html",n.setAttribute("aria-hidden","true"),n.onload=function(){i||a(),function e(t,a){if(!t.contentDocument){var n=l(t);return n.checkForObjectDocumentTimeoutId&&window.clearTimeout(n.checkForObjectDocumentTimeoutId),void(n.checkForObjectDocumentTimeoutId=setTimeout(function(){n.checkForObjectDocumentTimeoutId=0,e(t,a)},100))}a(t.contentDocument)}(this,function(e){o(s)})},Qn.isIE()||(n.data="about:blank"),l(s)&&(s.appendChild(n),l(s).object=n,Qn.isIE()&&(n.data="about:blank"))}l(s).startSize={width:u,height:d},a?a.add(h):h()}(s,o)},addListener:function(e,t){function a(){t(e)}if(Qn.isIE(8))l(e).object={proxy:a},e.attachEvent("onresize",a);else{var n=s(e);if(!n)throw new Error("Element is not detectable by this strategy.");n.contentDocument.defaultView.addEventListener("resize",a)}},uninstall:function(e){if(l(e)){var t=s(e);t&&(Qn.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),l(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(l(e).checkForObjectDocumentTimeoutId),delete l(e).object)}}}}(h)}var p={};return{listenTo:function(e,a,l){function s(e){var t=i.get(e);ts(t,function(t){t(e)})}function u(e,t,a){i.add(t,a),e&&a(t)}if(l||(l=a,a=e,e={}),!a)throw new Error("At least one element required.");if(!l)throw new Error("Listener required.");if(os(a))a=[a];else{if(!ns(a))return n.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");a=ss(a)}var h=0,v=is(e,"callOnAdd",o.callOnAdd),f=is(e,"onReady",function(){}),m=is(e,"debug",o.debug);ts(a,function(e){ls.getState(e)||(ls.initState(e),t.set(e));var o=t.get(e);if(m&&n.log("Attaching listener to element",o,e),!c.isDetectable(e))return m&&n.log(o,"Not detectable."),c.isBusy(e)?(m&&n.log(o,"System busy making it detectable"),u(v,e,l),p[o]=p[o]||[],void p[o].push(function(){++h===a.length&&f()})):(m&&n.log(o,"Making detectable..."),c.markBusy(e,!0),r.makeDetectable({debug:m,important:d},e,function(e){if(m&&n.log(o,"onElementDetectable"),ls.getState(e)){c.markAsDetectable(e),c.markBusy(e,!1),r.addListener(e,s),u(v,e,l);var t=ls.getState(e);if(t&&t.startSize){var i=e.offsetWidth,d=e.offsetHeight;t.startSize.width===i&&t.startSize.height===d||s(e)}p[o]&&ts(p[o],function(e){e()})}else m&&n.log(o,"Element uninstalled before being detectable.");delete p[o],++h===a.length&&f()}));m&&n.log(o,"Already detecable, adding listener."),u(v,e,l),h++}),h===a.length&&f()},removeListener:i.removeListener,removeAllListeners:i.removeAllListeners,uninstall:function(e){if(!e)return n.error("At least one element is required.");if(os(e))e=[e];else{if(!ns(e))return n.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=ss(e)}ts(e,function(e){i.removeAllListeners(e),r.uninstall(e),ls.cleanState(e)})},initDocument:function(e){r.initDocument&&r.initDocument(e)}}};function is(e,t,a){var l=e[t];return null==l&&void 0!==a?a:l}var cs=Bn(rs);const us=(e,t)=>{const a=cs();let l=null;a.listenTo(e,()=>{null!==l&&clearTimeout(l),l=setTimeout(()=>{t&&t(e),clearTimeout(l)},200)}),h(()=>{a.removeListener(e,()=>{})})},ds=e=>{if(null==e)return e;let t;if("object"==typeof e){t=Array.isArray(e)?[]:{};for(let a in e)"object"==typeof e[a]?t[a]=ds(e[a]):t[a]=e[a]}else t=e;return t},hs=(e,t)=>{const a=[],l=new Map;for(const n of e){const e=n[t];l.has(e)||(l.set(e,!0),a.push(n))}return a},ps=e=>null!=e&&("string"==typeof e?""!==e.trim():!1!==e),vs=(...e)=>{let t=null;for(let a=0;a<e.length;a++){const l=e[a];if(null!=l){t=l;break}}return t},fs=(e,t,a)=>(Object.defineProperty(e,a,{get:()=>t[a]}),{target:e,source:t}),ms=()=>{const e=((e,t="yyyy-MM-dd")=>{if("Invalid Date"!=e){const a={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substring(4-RegExp.$1.length)));for(const e in a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substring((""+a[e]).length)));return t}return""})(new Date,"yyyyMMddhhmmsss")+Math.random().toString(10).substring(2,8);return String(e)};function gs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}var bs=o({setup(){const e=t("options",{}),{t:a}=Wl();return ps(e.setting.headerBarFontActiveColor)||(e.setting.headerBarFontActiveColor=e.setting.themeColor),{config:e,t:a}},render(){let e,a;const l=t("__slots__",{}),n=t("__ns__",{}),s=this.t,o=this.config,i=t("updateOptions",null),c=p({...o.setting}),u=()=>{const e={...o,setting:{...c}};i(e)},d=e=>{if(!e)return L({type:"warning",message:"主题颜色不能为空"}),!1;c.themeColor=e,Ql("--el-color-primary",e),u()},h=()=>{const e=document.documentElement;c.isDark?e.setAttribute("data-theme","dark"):e.setAttribute("data-theme",""),u()},f=(e,t,a)=>{c[t]=e,Jl(a,e),u()},m=[{type:"defaults",text:"默认"},{type:"classic",text:"经典"},{type:"transverse",text:"横向"},{type:"columns",text:"分栏"},{type:"composite",text:"综合"}];return r(P,null,{default:()=>[r(A,{"border-style":"dashed"},gs(e=s("next.layout.setting.globalTheme"))?e:{default:()=>[e]}),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.themeColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.themeColor,"onUpdate:modelValue":e=>c.themeColor=e,predefine:["#409eff","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:d},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.darkMode")]),r("div",{class:n.be("config-bar-item","value")},[r(j,{modelValue:c.isDark,"onUpdate:modelValue":e=>c.isDark=e,"inline-prompt":!0,size:"large","active-icon":Tn,"inactive-icon":Vn,"active-color":"#1f1f1f","inactive-color":"#dcdfe6",onChange:h},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerBackground")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarColor,"onUpdate:modelValue":e=>c.headerBarColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarColor","--next-layout-bg-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerTextColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarFontColor,"onUpdate:modelValue":e=>c.headerBarFontColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarFontColor","--next-layout-font-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerActiveTextColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarFontActiveColor,"onUpdate:modelValue":e=>c.headerBarFontActiveColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarFontActiveColor","--next-layout-active-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerGradient")]),r("div",{class:n.be("config-bar-item","value")},[r(v("el-switch"),{modelValue:c.isHeaderBarColorGradual,"onUpdate:modelValue":e=>c.isHeaderBarColorGradual=e,onChange:u},null)])]),r(A,{"border-style":"dashed"},gs(a=s("next.layout.setting.layoutMode"))?a:{default:()=>[a]}),r("ul",{class:n.b("config-bar-layout")},[m.map(e=>r("li",{class:[n.be("config-bar-layout",e.type),n.is("active",c.layout===e.type)],onClick:t=>((e,t)=>{e.stopPropagation(),c.layout=t.type,u()})(t,e)},[r("div",{class:"layout-wrap"},[r("div",{class:"layout-box"},[r("p",{class:"layout-text"},[e.text])])]),r("aside",null,null)]))]),r("div",{class:n.b("config-bar-item"),style:{"margin-top":"20px"}},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.isShowTab")]),r("div",{class:n.be("config-bar-item","value")},[r(j,{modelValue:o.showTabs,"onUpdate:modelValue":e=>o.showTabs=e},null)])]),l.setting?.({config:c})]})}}),ys=o({setup(){const e=t(Yl,a()),n=t("options",{}),{t:s}=Wl(),{toggle:o,isFullscreen:r}=we(),i=a(l(()=>n.language).value),c=a(!1);return{locale:e,config:n,t:s,toggle:o,isFullscreen:r,language:i,settingDrawer:c,openSettingDrawer:()=>{c.value=!0},closeSettingDrawer:()=>{c.value=!1}}},render(){const e=t("__ns__",{}),a=this.config,l=t("__emit__",{}),n=this.$slots,s=this.t,o=this.isFullscreen,c=a.profile,u=a.userDropdown,d=a.languageDropdown;return r(i,null,[r("ul",{class:e.b("header-tools")},[n[cn]?.(),r("li",null,[r(z,{"show-timeout":70,"hide-timeout":50,trigger:"click",onCommand:e=>{this.language=e,l("changeLanguage",e),a.onChangeLanguage&&a.onChangeLanguage(e)}},{default:()=>r("div",null,[r(R,{size:16},{default:()=>[r("svg",{class:"icon",viewBox:"0 0 1070 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1855",width:"128",height:"128"},[r("path",{d:"M232.58156522 358.13286957C244.86956522 394.4626087 265.17147826 425.984 293.48730435 453.76556522c24.04173913-26.17878261 42.2066087-58.23443478 53.96034782-95.63269565H232.58156522z","p-id":"1856"},null),r("path",{d:"M981.61530435 143.36h-448.77913044L507.19165217 6.05495652h-416.72347826c-45.94643478 0-83.34469565 37.39826087-83.34469565 83.34469565v708.42991305c0 45.94643478 37.39826087 83.34469565 83.34469565 83.34469565h379.85947826l-30.45286956 137.30504348h541.74052174c45.94643478 0 83.34469565-37.39826087 83.34469565-83.34469565V226.70469565c0-45.94643478-37.39826087-83.34469565-83.34469565-83.34469565zM415.83304348 564.35756522c-49.152-18.16486957-89.75582609-41.13808696-122.34573913-67.85113044-34.19269565 30.45286957-76.93356522 52.89182609-126.61982609 66.7826087l-17.09634783-28.31582609c48.61773913-12.82226087 89.22156522-32.05565217 121.2772174-59.30295652-33.12417391-33.65843478-56.0973913-72.65947826-68.91965218-117.00313044h-46.48069565v-32.05565217H276.92521739c-7.47965217-13.89078261-17.09634783-27.24730435-28.31582609-40.06956522l32.05565218-11.75373913c11.21947826 14.42504348 21.37043478 31.5213913 30.45286956 51.28904348h115.9346087v32.05565218h-46.48069565c-14.95930435 45.94643478-36.32973913 84.41321739-64.64556522 115.40034782 31.5213913 25.11026087 71.05669565 45.94643478 117.5373913 63.04278261l-17.63060869 27.78156522z m607.45460869 370.24278261c0 22.97321739-18.69913043 41.67234783-41.67234782 41.67234782H492.23234783l20.83617391-95.63269565h156.53843478l-89.22156522-497.39686957-0.53426087 2.67130435-3.73982608-19.76765217 1.06852174 0.53426087-32.58991305-181.64869565H982.14956522c22.97321739 0 41.67234783 18.69913043 41.67234782 41.67234782v707.89565218z","p-id":"1857"},null),r("path",{d:"M684.56626087 541.38434783h114.86608696v-30.45286957h-114.86608696V450.02573913h122.34573913v-30.45286956h-158.14121739v219.04695652h162.94956522V608.16695652h-127.15408696v-66.78260869z m239.88313043-65.71408696c-9.61669565 0-18.16486957 1.60278261-26.1787826 5.87686956-7.47965217 3.73982609-14.95930435 9.61669565-20.83617392 17.09634783V479.94434783h-34.72695652v158.67547826h34.72695652v-95.63269566c1.06852174-12.82226087 5.3426087-22.43895652 12.82226087-29.38434782 6.41113043-5.87686957 13.89078261-9.08243478 22.43895652-9.08243478 24.04173913 0 35.79547826 12.82226087 35.79547826 39.00104347v94.56417392h34.72695653v-97.76973913c1.06852174-43.27513043-19.2333913-64.64556522-58.76869566-64.64556522z","p-id":"1858"},null)])]})]),dropdown:()=>{let e;return r(H,null,"function"==typeof(t=e=d.map(e=>r(V,{command:e.value,disabled:this.language===e.value},{default:()=>[e.label]})))||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?e:{default:()=>[e]});var t}})]),r("li",null,[r("span",{style:{display:"inline-block",lineHeight:1},onClick:this.toggle},[r(R,{size:16},{default:()=>[o?r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2676",width:"128",height:"128"},[r("path",{d:"M749.248 704H864a32 32 0 1 0 0-64H672a32 32 0 0 0-32 32v192a32 32 0 1 0 64 0v-114.752l137.36 137.36a32 32 0 1 0 45.232-45.264L749.248 704zM320 749.248V864a32 32 0 1 0 64 0V672a32 32 0 0 0-32-32H160a32 32 0 1 0 0 64h114.752l-137.36 137.36a32 32 0 1 0 45.264 45.232L320 749.248zM749.248 320H864a32 32 0 1 1 0 64H672a32 32 0 0 1-32-32V160a32 32 0 1 1 64 0v114.752l137.36-137.36a32 32 0 1 1 45.232 45.264L749.248 320zM320 274.752V160a32 32 0 1 1 64 0v192a32 32 0 0 1-32 32H160a32 32 0 1 1 0-64h114.752l-137.36-137.36a32 32 0 1 1 45.264-45.232L320 274.752z","p-id":"2677"},null)]):r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2522",width:"128",height:"128"},[r("path",{d:"M237.248 192H352a32 32 0 1 0 0-64H160a32 32 0 0 0-32 32v192a32 32 0 1 0 64 0v-114.752l137.36 137.36a32 32 0 1 0 45.232-45.264L237.248 192zM832 237.248V352a32 32 0 1 0 64 0V160a32 32 0 0 0-32-32H672a32 32 0 1 0 0 64h114.752l-137.36 137.36a32 32 0 1 0 45.264 45.232L832 237.248zM237.248 832H352a32 32 0 1 1 0 64H160a32 32 0 0 1-32-32V672a32 32 0 1 1 64 0v114.752l137.36-137.36a32 32 0 1 1 45.232 45.264L237.248 832zM832 786.752V672a32 32 0 1 1 64 0v192a32 32 0 0 1-32 32H672a32 32 0 1 1 0-64h114.752l-137.36-137.36a32 32 0 1 1 45.264-45.232L832 786.752z","p-id":"2523"},null)])]})])]),n[un]?.(),r("li",null,[r(z,{"show-timeout":70,"hide-timeout":80,"popper-class":e.be("header-tools","userDropdown"),onCommand:e=>{l("changeUserDropdown",e),a.onChangeUserDropdown&&a.onChangeUserDropdown(e)}},{default:()=>r("span",{class:e.be("header-tools","user")},[c?r("img",{class:"user-photo",src:c},null):null,r("span",null,[a.userName]),r(R,{class:"el-icon--right"},{default:()=>[r(mn,null,null)]})]),dropdown:()=>r(H,null,{default:()=>[u?.map(e=>r(V,{command:e.value,divided:!!e.divided},{default:()=>[e.svg?r("span",{innerHTML:e.svg,class:"item-svg"},null):null,e.iconfont?r("i",{class:e.iconfont},null):null,s(e.label)]}))]})})]),r("li",null,[r("span",{style:{display:"inline-block",lineHeight:1},onClick:this.openSettingDrawer},[r(R,{size:16},{default:()=>[r(Hn,null,null)]})])])]),r(m,{to:"body"},{default:()=>[r(I,{modelValue:this.settingDrawer,"onUpdate:modelValue":e=>this.settingDrawer=e,title:this.t("next.layout.setting.systemSetting"),direction:"rtl",size:"380px",class:e.be("drawer","setting"),"destroy-on-close":!0,beforeClose:this.closeSettingDrawer},{default:()=>[r(bs,null,null)]})]})])}});const{getLightColor:xs}=ql();var ws=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,n=t("options",{}),s=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=n.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${xs(t,.5)})`}:""}),o={};return e[cn]&&(o[cn]=()=>e[cn]()),e[un]&&(o[un]=()=>e[un]()),r("header",{class:a.b("header"),style:s.value},[r(fn,null,null),r("div",{class:a.bf("header","right")},[r(ys,null,(i=o,"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!f(i)?o:{default:()=>[o]}))])]);var i}}),Cs=o({props:{meta:{type:Object,default:()=>({})}},setup(e){const a=t("ns",{}),{t:l}=Wl(),n=e.meta;return()=>r(i,null,[r("strong",{class:a.be("item","icon")},[n.icon?r("i",{class:n.icon},null):r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"19771",width:"32",height:"32"},[r("path",{d:"M512 958.8C265.6 958.8 65.2 758.4 65.2 512S265.6 65.2 512 65.2 958.8 265.6 958.8 512 758.4 958.8 512 958.8z m0-832c-212.4 0-385.2 172.8-385.2 385.2S299.6 897.2 512 897.2 897.2 724.4 897.2 512 724.4 126.8 512 126.8z","p-id":"19772"},null),r("path",{d:"M512 512m-169.5 0a169.5 169.5 0 1 0 339 0 169.5 169.5 0 1 0-339 0Z","p-id":"19773"},null)])]),r("span",{class:a.be("item","title")},[l(n.title)])])}});const Ms=o({name:"NextMenuItem",props:{menuData:{type:Array,required:!0}},setup(e){const a=t("ns",{}),n=l(()=>e.menuData).value;return()=>r(i,null,[r(i,null,[n.map(e=>e.children?.length?vs(e.meta?.isHide,!1)?null:r(B,{"popper-class":a.b("popper"),index:e.path||e.id,teleported:!0},{title:()=>r(Cs,{meta:e.meta},null),default:()=>r(Ms,{menuData:e.children},null)}):vs(e.meta?.isHide,!1)?null:r(N,{index:e.path},{default:()=>[r(Cs,{meta:e.meta},null)]}))])])}}),Ss=Te("menu"),Es=on(o({name:"NextMenu",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},router:{type:Boolean,default:!0},mode:{type:String,values:["horizontal","vertical"],default:"horizontal"},menuTree:{type:Array,default:()=>[]},collapse:{type:Boolean,default:!1}},setup(t){g("ns",Ss);const l=e().appContext.config.globalProperties.$router,n=l.currentRoute?.value.fullPath,s=a(n);b(()=>l.currentRoute?.value,e=>{s.value=e.fullPath});const o=a(0);return b(()=>t.menuTree,()=>{o.value++},{deep:!0}),()=>r(i,null,[r(F,{key:o.value,class:[Ss.b(),t.className],style:t.style,"popper-class":Ss.b("popper"),defaultActive:s.value,router:t.router,mode:t.mode,collapse:t.collapse,ellipsis:!0},{default:()=>[r(i,null,[t.menuTree.map(e=>e.children?.length?vs(e.meta?.isHide,!1)?null:r(B,{"popper-class":Ss.b("popper"),index:e.path||e.id,teleported:!0},{title:()=>r(Cs,{meta:e.meta},null),default:()=>r(Ms,{menuData:e.children},null)}):vs(e.meta?.isHide,!1)?null:r(N,{"popper-class":Ss.b("popper"),index:e.path},{default:()=>[r(Cs,{meta:e.meta},null)]}))])]})])}}));var Ds=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,l=t("options",{});return r("aside",{class:a.b("sidebar")},[r(P,null,{default:()=>[e[rn]?e[rn]():r(Es,{mode:"vertical",menuTree:l.menuTree},null)]})])}});const ks=Te("layout-defaults");var Os=o({props:{},setup:()=>(g("ns",ks),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(Y,{class:ks.b()},{default:()=>{return[r(Ds,null,null),r("div",{class:[ks.b("content")]},[r(ws,null,(t=s,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[ks.bf("main"),ks.is("layout-tabs",o.value)]},[e.default?.()])])];var t}})}});const{getLightColor:Ls}=ql();var Ts=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Ls(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?a[rn]():r(Es,{menuTree:s.menuTree,router:s.menuRouter,mode:s.menuMode},null)]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}});const Ps=Te("layout-transverse");var As=o({props:{},setup:()=>(g("ns",Ps),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{}),s={};e[rn]&&(s[rn]=()=>e[rn]()),e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Ts,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Ps.b("main"),Ps.is("layout-tabs",o.value)]},[e.default?.()])]);var c}});const{getLightColor:_s}=ql();var js=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${_s(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},null),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),zs=o({setup(){const l=e().appContext.config.globalProperties.$router,n=t("options",{}),s=t("ns",{}),{t:o}=Wl(),c=a(!0),u=()=>{c.value=!c.value},d=a([]),h=e=>{let t={path:e.path,query:e.query||{}};!e.path&&e.name&&(t={name:e.name,params:e.params||{}}),l.push(t)};return()=>r(i,null,[r(i,null,[r("div",{class:s.be("sidebar","content")},[c.value?r(Es,{mode:"vertical",collapse:!0,menuTree:n.menuTree},null):r("ul",{class:s.be("sidebar","menu")},[n.menuTree.map(e=>r("li",{key:e.path,class:s.be("sidebar","menu-item"),onClick:()=>(e=>{if(e.children?.length){d.value=e.children;const t=e.children[0];h(t)}else d.value=[],h(e)})(e)},[r("strong",{class:e.meta?.icon},null),r("span",{class:[s.be("sidebar","menu-text"),"text-ellipsis"]},[r(vn,{content:o(e.meta?.title)},null)])]))]),r("div",{class:[s.be("sidebar","footer")]},[r("svg",{class:c.value?"collapsed-svg":"",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",onClick:u},[r("path",{d:"m11 17-5-5 5-5"},null),r("path",{d:"m18 17-5-5 5-5"},null)])])]),!c.value&&d.value.length>0?r("div",{class:s.be("sidebar","subcontent")},[r(Es,{mode:"vertical",collapse:!1,menuTree:d.value},null)]):null])])}}),Hs=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,t=this.ns;return r("aside",{class:t.b("sidebar")},[e[dn]?e[dn]():r(zs,null,null)])}});const Vs=Te("layout-columns");var Rs=o({props:{},setup:()=>(g("ns",Vs),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{}),s={};e[rn]&&(s[rn]=()=>e[rn]()),e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(Y,{class:Vs.b()},{default:()=>{return[r(Hs,null,null),r("div",{class:[Vs.b("content")]},[r(js,null,(t=s,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Vs.bf("main"),Vs.is("layout-tabs",o.value)]},[e.default?.()])])];var t}})}});const{getLightColor:Is}=ql();var Ns=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Is(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?.()]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),Bs=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,l=t("options",{});return r("aside",{class:a.b("sidebar")},[r(P,null,{default:()=>[e[rn]?e[rn]():r(Es,{mode:"vertical",menuTree:l.menuTree},null)]})])}});const Fs=Te("layout-classic");var Ys=o({props:{},setup:()=>(g("ns",Fs),{ns:Fs}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Ns,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),r("div",{class:[Fs.b("content"),Fs.is("layout-tabs",o.value)]},[r(Bs,null,null),r("div",{class:Fs.b("container")},[l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Fs.b("main")]},[e.default?.()])])])]);var c}});const Ws=(e,t)=>{let a=null;const l=(t,n)=>{for(const s of t){if(s.path===e)return a=n,!0;if(s.children&&l(s.children,n??s))return!0}return!1};return l(t,null),a},Us=Te("menu");var $s=o({props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},menuTree:{type:Array,default:()=>[]}},setup(l){g("ns",Us);const n=t("updateSubmentTree"),s=e().appContext.config.globalProperties.$router,o=s.currentRoute?.value.fullPath,c=Ws(o,l.menuTree),u=a(c?.id);c?.id&&1===c.meta?.level&&n(c.children),b(()=>s.currentRoute?.value,e=>{const t=Ws(e.fullPath,l.menuTree);if(u.value=t?.id,!t)return n([]);t?.id&&1===t.meta?.level&&n(t.children)});const d=e=>{let t=e[0];for(let a=0;a<e.length;a++){const l=e[a];if(l.children?.length&&(t=d(l.children),t))break}return t};return()=>r(i,null,[r(F,{class:[Us.b(),l.className],style:l.style,"popper-class":Us.b("popper"),defaultActive:u.value,mode:"horizontal",ellipsis:!0},{default:()=>[r(i,null,[l.menuTree.map(e=>vs(e.meta?.isHide,!1)?null:r(N,{index:e.id,onClick:t=>((e,t)=>{if(n(t.children),t.children?.length){const e=d(t.children);return void s.push(e.path)}s.push(t.path)})(0,e)},{default:()=>[r(Cs,{meta:e.meta},null)]}))])]})])}});const{getLightColor:Ks}=ql();var Xs=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Ks(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?a[rn]():r($s,{menuTree:s.menuTree},null)]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),qs=o({setup(e,{slots:a}){const l=t("ns",{}),n=t("submenuTree",[]);return()=>r(i,null,[0===n.value.length?null:r("aside",{class:l.b("sidebar")},[a[rn]?a[rn]():r(Es,{mode:"vertical",menuTree:n.value},null)])])}});const Gs=Te("layout-composite");var Zs=o({props:{},setup(){g("ns",Gs);const e=a([]);return g("submenuTree",e),g("updateSubmentTree",t=>{e.value=[],y(()=>{e.value=t})}),{ns:Gs,submenuTree:e}},render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Xs,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),r("div",{class:[Gs.b("content"),Gs.is("layout-tabs",o.value)]},[r(qs,null,null),r("div",{class:Gs.b("container")},[l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Gs.b("main")]},[e.default?.()])])])]);var c}});const Js=Te("layout"),Qs={defaults:x(Os),transverse:x(As),columns:x(Rs),classic:x(Ys),composite:x(Zs)},eo=(e,t)=>{if(Array.isArray(e))return t},to=on(o({name:"NextLayout",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["changeLanguage","changeUserDropdown","changeOptions","tabsChange","tabsSelect","tabsClose"],setup(e,{slots:t,emit:l}){const n=a(_l(hn,e.options,eo));g("options",n.value),g("__ns__",Js),g("__emit__",l),g("__slots__",t);const s=e=>{n.value=_l(n.value,e,eo),an(n.value?.setting),l("changeOptions",n.value)};return g("updateOptions",s),b(()=>e.options,e=>{s(e)},{deep:!0,immediate:!0}),{options:n.value,updateOptions:s}},render(){const e=this.$props,t=this.$slots,l=this.options.setting?.layout||"transverse",n=a(Qs[l]);w(()=>{n.value=Qs[l],n.value||(n.value=Qs.transverse)});const s={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=()=>t[e]?.());return r("div",{class:[Js.b(),e.className],style:e.style},[C(n.value,{},{...s})])}})),ao=Te("tabs");var lo=o({name:"NextTabs",props:{activeTab:{type:[String,Number],default:"/"},tabs:{type:Array,default:()=>[]}},emits:["change","select","close"],setup(t,{emit:n}){const{t:s}=Wl(),o=e().appContext.config.globalProperties.$router,c=l(()=>o.currentRoute.value.path),u=l(()=>t.tabs),d=u.value?.findIndex(e=>e.path===c.value);if(d<0){const e=u.value[0];e&&e.path&&o.replace({path:e.path})}const h=a(d),p=a(u.value),v=e=>{const t=c.value,a=p.value.length,l=p.value.findIndex(e=>e.path===t);switch(e){case"other":l>-1&&(h.value=1,p.value=[p.value[0],p.value[l]]);break;case"left":if(l>-1){const e=p.value.slice(l);e.unshift(p.value[0]),p.value=e,h.value=1}break;case"right":if(l>-1&&l<a-1){const e=p.value.slice(0,l+1);p.value=e}break;case"all":const e=p.value[0];h.value=0,p.value=[e],f(null,e,h.value)}n("change",h.value,p.value,e)},f=(e,t,a)=>{e?.stopPropagation(),h.value=a;let l={path:t.path,query:t.query||{}};!t.path&&t.name&&(l={name:t.name,params:t.params||{}}),o.push(l),n("select",t,a)};b(()=>o.currentRoute?.value,e=>{const{tagTitle:t}=e.query,a={name:e.name,title:t||e.meta?.title,path:e.path,meta:e.meta,params:e.params,query:e.query},l=p.value.findIndex(t=>t.path===e.path);l>-1?(h.value=l,p.value[l]=a):(h.value=p.value.length,p.value.push(a)),n("change",h.value,p.value,"add")});return()=>r(i,null,[r("nav",{class:ao.b()},[r(P,null,{default:()=>[r("ul",{class:ao.b("list")},[p.value.map((e,t)=>e?r("li",{class:["tab-item",ao.is("active",h.value===t)],onClick:a=>f(a,e,t)},[r("i",{class:["tab-icon",e.meta?.icon]},null),r("span",null,[s(e.title)]),e.meta?.isAffix||"/"===e.path?null:r("span",{onClick:a=>((e,t,a)=>{e.stopPropagation();const l=c.value;if(l===t.path){const e=p.value[a-1];let t={path:e.path,query:e.query||{}};!e.path&&e.name&&(t={name:e.name,params:e.params||{}}),o.push(t),n("close",e,p.value)}p.value.splice(a,1);const s=p.value.findIndex(e=>e.path===l)||0;h.value=s>-1?s:0,n("change",h.value,p.value,"close")})(a,e,t)},[r(R,{class:"tab-close"},{default:()=>[r(Cn,null,null)]})])]):null)])]}),r(z,{"show-timeout":80,"hide-timeout":80,onCommand:v},{default:()=>r("span",{class:ao.b("tab-more")},[r("i",{class:[ao.be("tab-more","box"),ao.be("tab-more","top")]},null),r("i",{class:[ao.be("tab-more","box"),ao.be("tab-more","bottom")]},null)]),dropdown:()=>r(H,null,{default:()=>[r(V,{command:"other"},{default:()=>[r(R,null,{default:()=>[r(Cn,null,null)]}),r("span",null,[s("next.layout.tabsOther")])]}),r(V,{command:"left"},{default:()=>[r(R,null,{default:()=>[r(xn,null,null)]}),r("span",null,[s("next.layout.tabsLeft")])]}),r(V,{command:"right"},{default:()=>[r(R,null,{default:()=>[r(jn,null,null)]}),r("span",null,[s("next.layout.tabsRight")])]}),r(V,{command:"all"},{default:()=>[r(R,null,{default:()=>[r(Cn,null,null)]}),r("span",null,[s("next.layout.tabsAll")])]})]})})])])}});const no=on(lo),so=Te("container"),oo=on(o({name:"NextContainer",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},scrollbar:{type:Boolean,default:!1},padding:{type:[Boolean,String,Number],default:!0},card:{type:Boolean,default:!1}},setup(e,{slots:t}){const a=l(()=>{let t={};const a=e.padding;return"boolean"==typeof a?t=a?{padding:"15px"}:{}:"string"==typeof a?t={padding:a}:"number"==typeof a&&(t={padding:a+"px"}),t});return()=>(()=>{if(e.scrollbar){const l={"--next-container-padding":a.value.padding};return r(P,{class:[so.b(),e.className],style:{...l,...e.style}},{default:()=>[t.default?.()]})}return r("div",{class:[so.b(),e.className],style:{...a.value,...e.style}},[e.card?r("div",{class:so.b("card")},[t.default?.()]):t.default?.()])})()}}));var ro={className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},page:{type:Object,default:()=>({pageIndex:1,pageSize:10,total:0})},rowStyle:{type:Function,default:void 0},rowClassName:{type:Function,default:void 0},cellStyle:{type:Function,default:void 0},cellClassName:{type:Function,default:void 0},headerRowStyle:{type:Function,default:void 0},headerRowClassName:{type:Function,default:void 0},headerCellStyle:{type:Function,default:void 0},headerCellClassName:{type:Function,default:void 0},spanMethod:{type:Function,default:void 0}};const io=["menu-left-prefix","menu-left-suffix","menu-right-prefix","menu-right-suffix"],co=["operation-column-prefix","operation-column-suffix"];var uo={initLoadData:!0,defaultContentHeight:300,fullscreenchangeContentHeight:!1,rowKey:"id",size:"default",fit:!0,stripe:!0,border:!0,index:!0,selection:!0,headerAlign:"center",cellAlign:"center",columnMinWidth:"100px",columns:[],showSearchForm:!0,showHeaderMenu:!0,showSearchLabel:!1,searchSpan:4,searchGutter:20,searchLabelWidth:"5em",searchColumnMinWidth:300,searchColumns:[],addBtn:!0,viewBtn:!0,delBtn:!0,editBtn:!0,batchDelBtn:!1,refreshBtn:!0,settingBtn:!0,operations:!0,operationsWidth:260,operationsHeaderAlign:"center",operationsColumnAlign:"center",operationsBtnPlain:!1,operationsBtnText:!0,operationsBtnSize:"small",addBtnText:"",isPagination:!0,dialogTitle:"",dialogWidth:"60%",dialogFullscreen:!1,dialogFullscreenBtn:!0,dialogDraggable:!0,dialogFormParamsDefault:{},closeOnClickModal:!1,formColumns:[],formLabelWidth:"5em",formSpan:12,formColumnMinWidth:350};const ho="column-",po=e=>ho+e,vo="search-",fo=e=>vo+e,mo="form-",go=e=>mo+e,bo=Te("spin-loading");var yo=o({name:"NextSpinLoading",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},tip:{type:String,default:""}},setup(e,{expose:t}){const{t:l}=Wl(),n=a();return t({elementInstance:n}),{t:l,elementInstance:n}},render(){const e=this.t,t=this.$slots,a=this.$props,l=a.tip||e("next.loading");return r("div",{ref:"elementInstance",class:[bo.b(),a.className],style:a.style},[t.default?.(),a.loading?r("div",{class:bo.b("mask")},[r("span",{class:bo.b("mask-dot")},[r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null)]),r("span",{class:bo.be("mask","text")},[l])]):null])}}),xo=o({name:"SearchColumn",props:{searchSpan:{type:Number,default:4},columns:{type:Array,default:()=>[]},formParams:{type:Object,default:()=>{}}},setup(l,{slots:o}){const c=t("options",{}),u=s(c)?n(c):c,{t:d}=Wl(),h=t("ns",{}),v=a(l.columns);b(()=>l.columns,()=>{v.value=l.columns},{deep:!0});const f=p(l.formParams),m=e=>e.getTime()>Date.now(),g=[{text:d("next.date.oneWeekAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-6048e5),[t,e]}},{text:d("next.date.oneMonthAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-2592e6),[t,e]}},{text:d("next.date.threeMonthsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-7776e6),[t,e]}},{text:d("next.date.oneYearAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-31536e6),[t,e]}},{text:d("next.date.threeYearsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-94608e6),[t,e]}}],y=(e,t)=>{f[t]=e};return()=>r(i,null,[r(i,null,[v.value.map(t=>!t.hide&&r(W,{span:l.searchSpan,class:h.b("header-search-item")},{default:()=>[r(U,null,{label:()=>t.label&&vs(u.showSearchLabel,!1)?r(vn,{width:u.searchLabelWidth,content:t.label,textAlign:"right"},null):null,default:()=>(t=>{const l=vs(t.searchDisabled,t.disabled,!1);if(o[fo(t.prop)])return o[fo(t.prop)]({column:t});if("input"===t.type||!t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("inputInteger"===t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e,onInput:e=>((e,t)=>{const a=e.replace(/\D/g,"");f[t]=a})(e,t.prop)},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("inputNumber"===t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e,onInput:e=>((e,t)=>{let a=e;a=a.replace(/[^0-9\.]/g,""),a=a.replace(/^\./,"0."),a=a.replace(/\.{2,}/g,"."),a=a.replace(".","DUMMY"),a=a.replace(/\./g,""),a=a.replace("DUMMY","."),f[t]=a})(e,t.prop)},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("select"===t.type){const a=d("next.form.select")+(t.searchPlaceholder||t.searchLabel||t.label);!f[t.prop]&&t.multiple&&(f[t.prop]=[]);const n=e(),s=n?.appContext.config.warnHandler;n.appContext.config.warnHandler=(e,...t)=>{e.includes('Slot "default" invoked outside of the render function')||s?.(e,...t)};const o=()=>t.dicData.map(e=>r(J,{value:e.value,label:e.label},null));return r(K,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:a,multiple:t.multiple||!1,"collapse-tags":!0,"collapse-tags-tooltip":!0,persistent:!0},{default:t.dicData?.length?o:null})}if("radio"===t.type)return r(X,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,f)},{default:()=>[t.dicData&&t.dicData.map(e=>r(q,{key:e.value,value:e.value,disabled:vs(e.disabled,!1)},{default:()=>[e.label]}))]});if("date"===t.type){const e=d("next.form.select")+(t.searchPlaceholder||t.searchLabel||t.label);return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"date","value-format":t.searchFormat||"YYYY-MM-DD",format:t.searchFormat||"YYYY-MM-DD",clearable:!0,disabledDate:t.searchDisabledDate||m,disabled:l,placeholder:e,editable:t.searchEditable||!1},null)}if("daterange"===t.type)return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"daterange","value-format":t.searchFormat||"YYYY-MM-DD",format:t.searchFormat||"YYYY-MM-DD",clearable:!0,"range-separator":d("next.date.rangeSeparator"),"start-placeholder":d("next.date.startPlaceholder"),"end-placeholder":d("next.date.endPlaceholder"),"disabled-date":t.searchDisabledDate||m,disabled:l,editable:t.searchEditable||!1,shortcuts:t.searchShortcuts||g},null);if("datetimerange"===t.type)return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"datetimerange","value-format":t.searchFormat||"YYYY-MM-DD HH:mm:ss",format:t.searchFormat||"YYYY-MM-DD HH:mm:ss",clearable:!0,"range-separator":d("next.date.rangeSeparator"),"start-placeholder":d("next.date.startPlaceholder"),"end-placeholder":d("next.date.endPlaceholder"),"disabled-date":t.searchDisabledDate||m,disabled:l,editable:t.searchEditable||!1,shortcuts:t.searchShortcuts||g},null);if("numberRange"===t.type){const e=f[t.prop],l=a(e[0]),n=a(e[1]),s=a(t.searchMin),o=a(t.searchMax),i=a(!0),c=e=>{l.value=e,y([l.value,n.value],t.prop)},u=e=>{n.value=e,y([l.value,n.value],t.prop)};return r("div",{class:h.b("header-search-item-number-range")},[r(Z,{modelValue:l.value,"onUpdate:modelValue":e=>l.value=e,min:s.value,max:o.value,controls:i.value,onChange:c},null),r("span",{class:"number-range-division"},[d("next.date.rangeSeparator")]),r(Z,{modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,min:s.value,max:o.value,controls:i.value,onChange:u},null)])}return"treeSelect"===t.type?r(Uo,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:t.disabled,column:t,formParams:f,onChange:(...e)=>t.onChange?.(...e,t,f)},null):"cascader"===t.type?r($o,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:t.disabled,column:t,formParams:f,onChange:(...e)=>t.onChange?.(...e,t,f)},null):void 0})(t)})]}))])])}});function wo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}var Co=o({name:"HeaderSearch",props:{columns:{type:Array,default:()=>[]}},emits:["confirmSearch","clearSearch","zoomResize"],setup(l,{emit:o,slots:c}){const u=t("options",{}),d=s(u)?n(u):u,h=t("ns",{}),{t:v}=Wl(),f=t("searchFormSlots"),m={};f.value.forEach(e=>{m[e]=(...t)=>c[e]&&c[e](...t)});const g=p({}),b=a(l.columns),y=()=>{b.value.forEach(e=>{g[e.prop]="",ps(e.defaultValue)&&(g[e.prop]=e.defaultValue)})};y();const x=()=>{o("confirmSearch",g)},w=()=>{y(),x(),o("clearSearch")},C=a(d.searchSpan),S=b.value.length,E=a(S),D=a(b.value),k=a([]),O=a(!1),{proxy:L}=e();M(()=>{const e=L.$refs.tableSearchForm?.$el;e&&us(e,e=>{(e=>{const t=e.clientWidth,a=d.searchColumnMinWidth;let l=Math.floor(t/a);C.value=Math.ceil(24/l);const n=24%C.value;if(n&&(C.value=n,l=24/C.value),E.value=l,S>=E.value){const e=E.value-1;D.value=b.value.slice(0,e),k.value=b.value.slice(e)}else D.value=b.value,k.value=[];const s=Math.floor(t/l);O.value=s<a})(e),o("zoomResize")})});const T=a(!1),P=()=>{T.value=!T.value};return()=>r(i,null,[b.value.length?r(Q,{ref:"tableSearchForm",inline:!0,size:d.size,model:g,class:h.b("header")},{default:()=>[r(ee,{gutter:d.searchGutter,class:h.b("header-search")},{default:()=>[r(xo,{searchSpan:C.value,columns:D.value,formParams:g},wo(m)?m:{default:()=>[m]}),T.value?r(xo,{searchSpan:C.value,columns:k.value,formParams:g},wo(m)?m:{default:()=>[m]}):null,r(W,{span:C.value,class:h.b("header-search-btns")},{default:()=>[r(U,null,{default:()=>[r(te,{type:"primary",onClick:x},{icon:()=>r(R,null,{default:()=>[r(zn,null,null)]}),default:()=>v("next.table.search")}),r(te,{onClick:w},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>v("next.table.clear")}),k.value.length?O.value?r(te,{type:"primary",text:!0,bg:!0,circle:!0,class:h.b("header-search-expandBtn"),onClick:P},{icon:()=>T.value?r(Mn,null,null):r(Sn,null,null)}):r(te,{type:"primary",text:!0,bg:!0,class:h.b("header-search-expandBtn"),onClick:P},{icon:()=>T.value?r(R,null,{default:()=>[r(yn,null,null)]}):r(R,null,{default:()=>[r(mn,null,null)]}),default:()=>T.value?v("next.table.foldSearch"):v("next.table.unfoldSearch")}):null]})]})]})]}):null])}}),Mo=o({name:"DrawerSetting",setup:()=>({visible:a(!1)}),render(){const e=t("options",{}),l=s(e)?n(e):e,o=a(l.columns),{t:i}=Wl(),c=t("ns",{});return r(I,{modelValue:this.visible,"onUpdate:modelValue":e=>this.visible=e,title:i("next.table.setting.title"),"append-to-body":!0,size:"450px",class:c.b("setting-drawer")},{default:()=>[r(P,{class:c.be("setting-drawer","container")},{default:()=>[r(ae,{data:o.value,border:!0,style:{width:"100%"}},{default:()=>[r(le,{prop:"label",label:i("next.table.setting.label"),align:"center"},{default:({row:e})=>r(vn,{content:i(e.label)},null)}),r(le,{prop:"hide",label:i("next.table.setting.hide"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.hide,"onUpdate:modelValue":t=>e.hide=t},null)}),r(le,{prop:"filter",label:i("next.table.setting.filter"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.filter,"onUpdate:modelValue":t=>e.filter=t},null)}),r(le,{prop:"sort",label:i("next.table.setting.sort"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.sortable,"onUpdate:modelValue":t=>e.sortable=t},null)})]})]})]})}}),So=o({name:"HeaderMenu",setup:()=>({}),emits:["clickAdd","clickRefresh","deleteRows"],render(){const e=t("options",{}),o=s(e)?n(e):e,{t:i}=Wl(),c=t("ns",{}),u=t("multipleSelection"),d=l(()=>u.value.length),h=()=>{this.$emit("clickRefresh")},p=a(),v={size:o.size,refresh:h};return r("div",{class:c.b("header-menu")},[r("div",{class:c.b("header-menu-left")},[this.$slots["menu-left-prefix"]?.(v),o.addBtn&&r(te,{type:"primary",size:o.size,onClick:()=>{this.$emit("clickAdd")}},{icon:()=>r(R,null,{default:()=>[r(An,null,null)]}),default:()=>o.addBtnText||i("next.table.add")}),o.batchDelBtn&&r(te,{type:"danger",size:o.size,disabled:!d.value,onClick:()=>{const e=n(S(u.value.map(e=>S(e))));se.confirm(i("next.table.message.batchDeleteTip"),i("next.table.message.tip"),{type:"warning",showClose:!1,center:!1,confirmButtonText:i("next.table.message.confirmButtonText"),cancelButtonText:i("next.table.message.cancelButtonText")}).then(()=>{this.$emit("deleteRows",e)}).catch(()=>{L({type:"info",message:i("next.table.message.cancelBatchDelete")})})}},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>o.batchDelBtnText||i("next.table.batchDelete")}),this.$slots["menu-left-suffix"]?.(v)]),r("div",{class:c.b("header-menu-right")},[this.$slots["menu-right-prefix"]?.(v),o.refreshBtn&&r(te,{circle:!0,size:o.size,onClick:h},{icon:()=>r(R,null,{default:()=>[r(_n,null,null)]})}),o.settingBtn&&r(te,{circle:!0,size:o.size,onClick:()=>{p.value.visible=!0}},{icon:()=>r(R,null,{default:()=>[r(Rn,null,null)]})}),this.$slots["menu-right-suffix"]?.(v)]),r(Mo,{ref:p},null)])}});const Eo=o({name:"TableColumnDynamic",props:{columnOption:{type:Object,default:()=>({})}},setup(e,{slots:a}){const l=t("columnSlots"),o={};l.value.forEach(e=>{o[e]=(...t)=>a[e]&&a[e](...t)});const c=t("options",{}),u=s(c)?n(c):c,d=e.columnOption,h=vs(d.dicKey,"value"),p=vs(d.dicLabel,d.treeSelectProps?.label,"label"),v=vs(d.treeSelectProps?.separator,","),m=(e,t)=>{if(Array.isArray(e)){const a=[];return e.forEach(e=>{a.push(m(e,t))}),a.join(v)}const a=t.find(t=>t[h]==e);return a?a[p]:e};return()=>r(i,null,[!d.hide&&r(le,{prop:d.prop,label:d.label,headerAlign:d.headerAlign||u.headerAlign,align:d.align||u.cellAlign,minWidth:d.minWidth||u.columnMinWidth||"auto",width:d.width||"auto",fixed:d.fixed,sortable:d.sortable||!1,formatter:d.formatter||null,showOverflowTooltip:vs(d.showOverflowTooltip,!0)},{default:({row:e,$index:t})=>((e,t)=>{const l=d.prop,n=l?.replace(/\./g,"-");if(d.children?.length>0)return r(i,null,[d.children.map(e=>{return r(Eo,{columnOption:e},"function"==typeof(t=o)||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?o:{default:()=>[o]});var t})]);if(a[po(n)]){const l={text:u.operationsBtnText,plain:u.operationsBtnPlain,size:u.operationsBtnSize};return a[po(n)]({row:e,index:t,column:d,btn:l})}if(d.dicData?.length>0){const t=e=>{const a=[];return e.forEach(e=>{const l={...e};if(l.children){const e=t(l.children);a.push(...e),delete l.children}a.push(l)}),a},a=t(d.dicData);return r("span",null,[m(e[l],a)])}return d.cellUnit?r(i,null,[r("span",null,[e[l]]),r("em",{class:"cell-unit"},[d.cellUnit])]):d.renderColumnCell?d.renderColumnCell({row:e,index:t,column:d}):null})(e,t)})])}});var Do=o({name:"TableColumnOperations",emits:["editRow","viewRow","deleteRow"],setup(e,{emit:a,slots:o}){const c=t("options"),u=s(c)?n(c):c,{t:d}=Wl(),h=l(()=>{const{operationsBtnPlain:e,operationsBtnText:t}=u;return t||e}),p=()=>{const e=u.operationsBtnText,t=u.operationsBtnPlain,l=u.operationsBtnSize,n={text:e,plain:t,size:l};return r(le,{fixed:"right",label:d("next.table.operation"),width:u.operationsWidth,headerAlign:vs(u.operationsHeaderAlign,u.headerAlign),align:vs(u.operationsColumnAlign,u.cellAlign)},{default:s=>r(i,null,[o["operation-column-prefix"]?.({scoped:s,btn:n}),u.editBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.edit"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"primary",onClick:()=>(e=>{a("editRow",e)})(s)},{icon:()=>r(R,null,{default:()=>[r(Dn,null,null)]}),default:()=>d("next.table.edit")})]}):null,u.viewBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.view"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"primary",onClick:()=>(e=>{a("viewRow",e)})(s)},{icon:()=>r(R,null,{default:()=>[r(In,null,null)]}),default:()=>d("next.table.view")})]}):null,u.delBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.delete"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"danger",onClick:()=>(e=>{se.confirm(d("next.table.message.deleteTip"),d("next.table.message.tip"),{type:"warning",showClose:!1,center:!1,confirmButtonText:d("next.table.message.confirmButtonText"),cancelButtonText:d("next.table.message.cancelButtonText")}).then(()=>{a("deleteRow",e)}).catch(()=>{L({type:"info",message:d("next.table.message.cancelDelete")})})})(s)},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>d("next.table.delete")})]}):null,o["operation-column-suffix"]?.({scoped:s,btn:n})])})};return()=>r(i,null,[p()])}}),ko=o({name:"FooterPagination",props:{page:{type:Object,default:()=>{}}},emits:["change"],setup(e,{emit:a}){const l=t("options",{}),o=s(l)?n(l):l,c=e.page,u=e=>{c.pageIndex=e,a("change",c)},d=e=>{c.pageSize=e,a("change",c)};return()=>r(i,null,[r(oe,{currentPage:c.pageIndex,"onUpdate:currentPage":e=>c.pageIndex=e,pageSize:c.pageSize,"onUpdate:pageSize":e=>c.pageSize=e,total:c.total,small:"small"===o.size,layout:"total, sizes, prev, pager, next, jumper","page-sizes":vs(c.pageSizes,[10,20,30,40,50,100]),"onCurrent-change":u,"onSize-change":d},null)])}});const Oo=Te("dialog");var Lo=o({name:"NextDialog",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},modelValue:{type:Boolean,default:!1},title:{type:String,default:""},fullscreen:{type:Boolean,default:!1},fullscreenBtn:{type:Boolean,default:!0},width:{type:[String,Number],default:"50%"},closeOnClickModal:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},zoomSize:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},top:{type:String,default:"15vh"},nofill:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t,slots:l}){const n=a(e.modelValue);b(()=>e.modelValue,e=>{n.value=e});const s=()=>{n.value=!1,t("close")},o=a(e.fullscreen);return()=>r(i,null,[r(re,{modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,class:[Oo.b(),e.className,e.nofill&&Oo.b("nofill")],style:e.style,title:e.title,appendToBody:e.appendToBody,"destroy-on-close":!0,fullscreen:o.value,"lock-scroll":!0,modal:e.modal,"show-close":!1,closeOnClickModal:e.closeOnClickModal,width:e.width,top:e.top,draggable:e.draggable,destroyOnClose:e.destroyOnClose,onClose:s},{default:()=>[l.default?.()],header:({close:t,titleId:a,titleClass:l})=>r("div",{class:Oo.b("header")},[r("h4",{id:a,class:l},[e.title]),r("div",{class:Oo.e("header-right")},[e.fullscreenBtn&&r("span",{class:"icon-fullscreen",onClick:()=>o.value=!o.value},[r(R,null,{default:()=>[r(On,null,null)]})]),e.showClose&&r("span",{class:"icon-close",onClick:t},[r(R,{size:"18"},{default:()=>[r(Cn,null,null)]})])])])})])}});const To={selection:!1,selectType:"radio",addBtn:!1,viewBtn:!1,delBtn:!1,editBtn:!1,batchDelBtn:!1,dialogWidth:"60%",dialogFullscreen:!1,closeOnClickModal:!1,refreshBtn:!0,settingBtn:!0,operations:!1};var Po={size:"default",colSpan:12,labelWidth:"6em",columnMinWidth:350,columns:[],formDatum:{},tableSelectConfig:To,isEditing:!0,showResetBtn:!0,showFooter:!0,submitText:null,resetText:null};const Ao=Te("form");var _o=o({name:"NumberRangePicker",props:{modelValue:{type:[Array,String,Number,Boolean,Object],default:function(){return[null,null]}},min:{type:Number,default:0},max:{type:Number,default:100},disabled:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const l=e.disabled,{t:n}=Wl(),s=a(Array.isArray(e.modelValue)&&e.modelValue[0]||0),o=a(Array.isArray(e.modelValue)&&e.modelValue[1]||0),c=a(e.min),u=a(e.max),d=e=>{s.value=e,t("change",[s.value,o.value])},h=e=>{o.value=e,t("change",[s.value,o.value])},p=a(!0),v=a();return M(()=>{const e=v.value;us(e,e=>{const t=e.clientWidth;p.value=t>200})}),()=>r(i,null,[r("div",{ref:v,class:Ao.e("number-range")},[r(Z,{modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,min:c.value,max:u.value,controls:p.value,disabled:l,onChange:d},null),r("span",{class:Ao.em("number-range","division")},[n("next.date.rangeSeparator")]),r(Z,{modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,min:c.value,max:u.value,controls:p.value,disabled:l,onChange:h},null)])])}});const jo=on(Lo);function zo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Ho=Te("form"),Vo=o({name:"NextInputTableSelect",props:{modelValue:{type:[Array,String,Number,Boolean,Object],default:function(){return[]}},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["select"],setup(e,{emit:t,slots:n}){const{t:s}=Wl(),o=e.disabled,c=e.closable,u=e.column,d=u.placeholder||s("next.form.select")+u.label,h=ds(uo),v=ds(To),f=zl(h,v,u.tableSelect),{value:m,label:g}=u.tableSelectProps||{value:"id",label:"name"},y=p({visible:!1,title:u.label+s("next.form.tableSelect"),dialogWidth:f.dialogWidth}),x=()=>{y.visible=!0},w=()=>{y.visible=!1},C=p({loading:!1,page:{pageIndex:1,pageSize:20,total:0},data:[]}),M=e=>{C.loading=!0,f.loadData?.(e,C.page,e=>{C.data=e.data||[],C.page.total=e.total||0,C.loading=!1})},D=a([]),k=a("");u.tableSelectDefaultValue?.(e.formParams,u,e=>{e?.length&&(u.tableSelectRows=e,D.value=e,k.value=e[0][m])});const O=l(()=>"radio"===f.selectType?!k.value:0===D.value.length),L=()=>{D.value=[],k.value=""},P=()=>{const e=S(D.value),a=hs(e,m);w(),t("select",a)},A=(e,t)=>{u.addEditData?.(e,t)},_=e=>{const t=f.rowKey,a=vs(e[t],null);return"checkbox"===f.selectType?r(ne,{value:a,onChange:t=>((e,t)=>{if(e)D.value.push(t);else{const e=D.value.findIndex(e=>e[m]===t[m]);-1!==e&&D.value.splice(e,1)}})(t,S(e))},null):r(q,{value:a,onChange:()=>{k.value=a,D.value=[e]}},null)},j=a([]),z=a([]),H=()=>{const e=hs(D.value,m).map(e=>({value:e[m],label:e[g]}));e.length>1?(j.value=e.splice(0,1),z.value=e):(j.value=e,z.value=[])};b(()=>u.tableSelectRows,()=>{H()},{deep:!0,immediate:!0});const V=a([]);b(()=>[e.formParams[u.prop],D.value],()=>{V.value=D.value.map(e=>e[m]),H()},{deep:!0,immediate:!0});const R=a(null);b(()=>[e.formParams[u.prop],k.value],()=>{R.value=k.value,H()},{deep:!0,immediate:!0});const I=(e,a)=>{const l=S(D.value);l.splice(a,1),D.value=l,"radio"===f.selectType&&(k.value=null),H(),t("select",l)},N=()=>{let e,t;return r(i,null,[r("div",{class:["el-input",Ho.e("input-table"),Ho.is("disabled",o)]},[r("div",{class:"el-input__wrapper"},[j?.value.length?r("span",{class:Ho.em("input-table","value")},[j.value.map((e,t)=>r(ie,{closable:c,onClose:()=>I(0,t)},{default:()=>[e.label]})),z?.value?.length?r(T,{"popper-class":Ho.e("tooltip-tags"),placement:"bottom",effect:"light"},{default:()=>r(ie,null,{default:()=>[E("+ "),z.value.length]}),content:()=>z.value.map((e,t)=>r(ie,{closable:c,onClose:()=>I(0,t+1)},{default:()=>[e.label]}))}):null]):r("span",{class:Ho.em("input-table","placeholder")},[d])]),r(te,{type:"primary",class:Ho.em("input-table","append"),disabled:o,icon:zn,onClick:x},null)]),r(jo,{modelValue:y.visible,"onUpdate:modelValue":e=>y.visible=e,title:y.title,closeOnClickModal:f.closeOnClickModal,width:f.dialogWidth,appendToBody:vs(f.dialogAppendToBody,!0),modal:vs(f.dialogModal,!1),onClose:w},{default:()=>[r("div",{class:Ho.em("input-table","content")},["checkbox"===f.selectType?r(ce,{modelValue:V.value},{default:()=>[r(Qo,{options:f,loading:C.loading,data:C.data,page:C.page,"onConfirm-search":M,"onClick-add-edit":A},{default:()=>[r(le,{fixed:"left",label:s("next.table.selection"),width:55,headerAlign:f.headerAlign,align:f.cellAlign},{default:({row:e})=>_(e)})],...n})]}):r(X,{modelValue:R.value},{default:()=>[r(Qo,{options:f,loading:C.loading,data:C.data,page:C.page,"onConfirm-search":M,"onClick-add-edit":A},{default:()=>[r(le,{fixed:"left",label:s("next.table.selection"),width:55,headerAlign:f.headerAlign,align:f.cellAlign},{default:({row:e})=>_(e)})],...n})]})]),r("div",{class:Ho.em("input-table","footer")},[r(te,{onClick:L},zo(e=s("next.form.reset"))?e:{default:()=>[e]}),r(te,{type:"primary",disabled:O.value,onClick:P},zo(t=s("next.form.confirm"))?t:{default:()=>[t]})])]})])};return()=>r(i,null,[N()])}}),Ro=Te("form");var Io=o({name:"UploadImage",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},listType:{type:String,values:["text","picture","picture-card"],default:"picture-card"},multiple:{type:Boolean,default:!1},limit:{type:Number,default:1},accept:{type:String,default:"image/*"}},emits:["change","exceed"],setup(t){const{appContext:l}=e(),{t:n}=Wl();return{t:n,appContext:l,defaultPreviewSrcList:ds(t.modelValue),uploadfilesPreview:a([])}},render(){const e=this.$slots,t=this.$props,a=this.$emit,l=this.t,n=t.disabled,s=this.uploadfilesPreview;let o=null;return r(i,null,[(()=>{const e=this.defaultPreviewSrcList;let t=[];return"string"==typeof e?t=[e]:"[object Array]"===Object.prototype.toString.call(e)&&(t=e),t=t.filter(e=>!!e),t.length?r(he,{class:Ro.e("preview-image"),src:t[0],previewSrcList:t,"preview-teleported":!0,fit:"cover",style:{width:"146px",height:"146px"}},{default:()=>r(R,null,{default:()=>[r(Pn,null,null)]})}):null})(),n?null:r(ue,{class:[Ro.b("upload-image"),t.className],style:t.style,"list-type":t.listType,multiple:t.multiple,limit:t.limit,accept:t.accept,"auto-upload":!1,"on-preview":e=>{const t=document.getElementsByTagName("body")[0],a=s.value.findIndex(t=>t.url===e.url)||0;o&&(D(null,o),t.removeChild(o)),o=document.createElement("div"),t.appendChild(o);const l=r({render:()=>C(m,{to:"body"},[C(de,{initialIndex:a,"url-list":s.value.map(e=>e.url),onClose:()=>{D(null,o)}})])});o.appContext=this.appContext,D(l,o)},"on-change":(e,t)=>{s.value=t,a("change",e,t)},"on-exceed":(e,t)=>{L({type:"info",message:l("next.table.uploadfileExceed")}),a("exceed",e,t)}},{trigger:()=>e.default?e.default():"picture-card"===t.listType?r(R,null,{default:()=>[r(An,null,null)]}):r(te,{link:!0,text:!0,type:"primary"},{default:()=>[r(R,null,{default:()=>[r(An,null,null)]}),r("em",null,[l("next.form.selectFile")])]})})])}}),No=o({name:"NextTreeSelect",props:{modelValue:{type:[Number,String,Boolean,Object,Array],default:""},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})}},emits:["change","node-click","node-contextmenu","check","check-change","node-expand","node-collapse","current-change"],setup(e,{emit:t,expose:l}){const{t:n}=Wl(),s=a(e.modelValue);b(()=>e.modelValue,e=>{s.value=e});const o=e.column,c=vs(o.treeSelectProps?.value,o.nodeKey,"id"),u=e.formParams,d={label:"label",children:"children"},h=o.placeholder||n("next.form.select")+o.label,p=a=>{e.formParams[o.prop]=a,s.value=a,t("change",a)},v=()=>{e.formParams[o.prop]="",s.value=""},f=(e,a)=>{t("node-click",e,a,u);const l=e[c];o.treeSelectNodeClick?.(e,a,u),p(l)},m=(...e)=>{t("node-contextmenu",...e),o.treeSelectNodeContextmenu?.(...e)},g=(e,a)=>{t("check",e,a,u),o.treeSelectCheck?.(e,a,u);const{checkedKeys:l}=a;p(l)},y=(...e)=>{t("check-change",...e),o.treeSelecCheckChange?.(...e,u)},x=(...e)=>{t("node-expand",...e),o.treeSelecNodeExpand?.(...e)},w=(...e)=>{t("node-collapse",...e),o.treeSelecNodeCollapse?.(...e)},C=(...e)=>{t("current-change",...e),o.treeSelecCurrentChange?.(...e)},M=a(),S=()=>M.value;return o.loadInstance&&o.loadInstance(S()),l({getInstance:S,onClearValue:v}),()=>r(i,null,[r(pe,{ref:M,modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,placeholder:h,data:vs(o.dicData,[]),"node-key":vs(o.nodeKey,"id"),filterable:vs(o.filterable,!0),"show-checkbox":vs(o.showCheckbox,!1),"leaf-only":vs(o.leafOnly,!1),"render-after-expand":vs(o.renderAfterExpand,!0),"check-strictly":vs(o.checkStrictly,!1),disabled:vs(e.disabled,!1),clearable:vs(o.clearable,!0),accordion:vs(o.accordion,!1),multiple:vs(o.multiple,!1),"collapse-tags":!0,"collapse-tags-tooltip":!0,props:vs(o.treeSelectProps,d),"value-key":c,"onNode-click":f,"onNode-contextmenu":m,onCheck:g,"onCheck-change":y,"onNode-expand":x,"onNode-collapse":w,"onCurrent-change":C,onClear:v},null)])}}),Bo=o({name:"NextTreeCascader",props:{modelValue:{type:[Number,String,Boolean,Object,Array],default:""},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})}},emits:["change","clear","expand-change","visible-change","remove-tag","blur","focus"],setup(e,{emit:t,expose:l}){const{t:n}=Wl(),s=a(e.modelValue);b(()=>e.modelValue,e=>{s.value=e});const o=e.column,c=o.placeholder||n("next.form.select")+o.label,u={label:"label",children:"children"},d=a=>{const l=h.value.getCheckedNodes().map(e=>e.data);e.formParams[o.prop]=a,s.value=a,t("change",a,l)},h=a(),p=()=>h.value;return o.loadInstance&&o.loadInstance(p()),l({getInstance:p,onClearValue:()=>{e.formParams[o.prop]="",s.value=""}}),()=>r(i,null,[r(ve,{ref:h,modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,placeholder:c,options:vs(o.dicData,[]),props:vs(o.treeSelectProps,u),disabled:vs(e.disabled,!1),clearable:vs(o.clearable,!0),filterable:vs(o.filterable,!1),"collapse-tags":!0,"collapse-tags-tooltip":!0,onChange:d},null)])}});function Fo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Yo=Te("form");var Wo=o({name:"NextForm",props:{options:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},formDatum:{type:Object,default:()=>({})}},emits:["submit","close","reset"],setup(t,{slots:n,emit:s,expose:o}){const c=ds(Po),u=p(zl(c,t.options)),d=l(()=>"boolean"!=typeof u.isEditing||u.isEditing),{t:h}=Wl(),v=a(u.colSpan),f=p(t.formDatum)||{},m=p(zl({},f)),g=a([]),y=p(new Map),x=p({});b(()=>[t.columns,t.formDatum],()=>{(()=>{const e=t.columns;g.value=e;for(let t=0;t<e.length;t++){const a=e[t],l=f[a.prop];ps(l)?m[a.prop]=l:m[a.prop]=ps(a.defaultValue)?a.defaultValue:"";const n=[],{label:s}=a;a.required&&n.push({required:!0,message:s+h("next.form.requiredInput"),trigger:["blur","change"]}),a.rules?.length&&n.push(...a.rules),x[a.prop]=n,!a.dicData?.length&&a.loadDicData&&a.loadDicData(a,e=>{e?.length&&(a.dicData=e)},m),"boolean"==typeof a.disabled&&a.disabled||(a.disabled=!d.value),a.editDisabled&&m[a.prop]&&(a.disabled=a.editDisabled),y.set(a.prop,a)}})()},{deep:!0,immediate:!0});const w=hs(g.value,"prop"),C=a(!1);M(()=>{const e=E.value?.$el;let t=null;us(e,e=>{null!==t?clearTimeout(t):C.value=!0,t=setTimeout(()=>{v.value=((e,t=350)=>{const a=e.clientWidth;let l=Math.floor(a/t);return l>4&&(l=4),Math.ceil(24/l)})(e,u.columnMinWidth),C.value=!1,clearTimeout(t)},10)})});const E=a(),D=a(!1),k=async()=>{const e=E.value;e&&await e.validate((e,t)=>{if(e){const e=S(m);D.value=!0,s("submit",e,()=>{D.value=!1,s("close")},()=>{D.value=!1})}})},O=()=>{const e=E.value;e&&(e.resetFields(),D.value=!1,s("reset",m))},L=e=>e.getTime()>Date.now(),P=[{text:h("next.date.oneWeekAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-6048e5),[t,e]}},{text:h("next.date.oneMonthAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-2592e6),[t,e]}},{text:h("next.date.threeMonthsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-7776e6),[t,e]}},{text:h("next.date.oneYearAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-31536e6),[t,e]}},{text:h("next.date.threeYearsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-94608e6),[t,e]}}];return o({formParams:S(m),ruleFormRef:E,formColumns:w,formColumnsMap:y,getFormInstance:()=>E.value,getFormParams:()=>S(m)}),()=>{let t;return r(nr,{loading:C.value},Fo(t=(()=>{let t;return r(Q,{ref:E,class:Yo.b(),inline:!1,model:m,size:u.size,"label-position":vs(u.labelPosition,"right")},{default:()=>[r(ee,{gutter:20},Fo(t=w.map(t=>!t.hide&&r(W,{span:vs(u.colSpanFixed,t.span,v.value)},{default:()=>[r(U,{prop:t.prop,required:t.required,rules:x[t.prop],style:{"--form-label-width":vs(u.formLabelWidth,u.labelWidth)}},{label:()=>t.label?r(i,null,[r(vn,{content:h(t.label),className:Yo.e("item-label")},null),t.tip?r(T,{effect:"dark",content:t.tip,placement:"top"},{default:()=>[r(R,{class:Yo.e("item-tip"),color:"#f3d19e"},{default:()=>[r(Ln,null,null)]})]}):null]):null,default:()=>(t=>{if(n[go(t.prop)])return n[go(t.prop)]({column:t,formParams:m});if("input"===t.type||!t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:vs(t.disabled,!1),placeholder:e,onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:t.prefix?()=>t.prefix(m,t):null,suffix:t.suffix?()=>t.suffix(m,t):null,prepend:t.prepend?()=>t.prepend(m,t):null,append:t.append?()=>t.append(m,t):null})}if("password"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,type:"password",clearable:vs(t.clearable,!0),"show-password":!0,readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:t.prefix?()=>t.prefix(m,t):null,suffix:t.suffix?()=>t.suffix(m,t):null,prepend:t.prepend?()=>t.prepend(m,t):null,append:t.append?()=>t.append(m,t):null})}if("inputInteger"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onInput:e=>((e,t)=>{const a=e.replace(/\D/g,"");m[t]=a?Number(a):""})(e,t.prop),onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:t.prefix?()=>t.prefix(m,t):null,suffix:t.suffix?()=>t.suffix(m,t):null,prepend:t.prepend?()=>t.prepend(m,t):null,append:t.append?()=>t.append(m,t):null})}if("inputNumber"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onInput:e=>((e,t)=>{let a=e.toString();a=a.replace(/[^0-9.]/g,""),a.startsWith(".")&&(a="0"+a),a=a.replace(/^(\d*\.\d*)\./g,"$1"),m[t]=a})(e,t.prop),onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:t.prefix?()=>t.prefix(m,t):null,suffix:t.suffix?()=>t.suffix(m,t):null,prepend:t.prepend?()=>t.prepend(m,t):null,append:t.append?()=>t.append(m,t):null})}if("textarea"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,type:"textarea",clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:t.prefix?()=>t.prefix(m,t):null,suffix:t.suffix?()=>t.suffix(m,t):null,prepend:t.prepend?()=>t.prepend(m,t):null,append:t.append?()=>t.append(m,t):null})}if("select"===t.type){const a=t.placeholder||h("next.form.select")+t.label,l=e(),n=l?.appContext.config.warnHandler;l.appContext.config.warnHandler=(e,...t)=>{e.includes('Slot "default" invoked outside of the render function')||n?.(e,...t)};const s=()=>t.dicData.map(e=>r(J,{key:e.value,value:e.value,label:e.label,disabled:vs(e.disabled,!1)},null));return r(K,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,placeholder:a,clearable:vs(t.clearable,!0),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),multiple:vs(t.multiple,!1),filterable:vs(t.filterable,!1),"allow-create":vs(t.allowCreate,!1),"collapse-tags-tooltip":!0,onChange:e=>t.onChange?.(e,t,m,w,y)},{default:t.dicData?.length?s:null})}if("time"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(fe,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,start:"00:00",step:"00:30",end:"23:59",clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),placeholder:e,onChange:e=>t.onChange?.(e,t,m,w,y)},{prefix:()=>t.prefix?t.prefix(m,t):null,suffix:()=>t.suffix?t.suffix(m,t):null})}if("radio"===t.type)return r(X,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,m,w,y)},{default:()=>[t.dicData&&t.dicData.map(e=>r(q,{key:e.value,value:e.value,disabled:vs(e.disabled,t.disabled,!1)},{default:()=>[e.label]}))]});if("checkbox"===t.type)return ps(m[t.prop])||(m[t.prop]=[]),r(ce,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,m,w,y)},{default:()=>[t.dicData&&t.dicData.map(e=>r(ne,{key:e.value,label:e.value,disabled:vs(e.disabled,!1)},{default:()=>[e.label]}))]});if("date"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:m[t.prop],"onUpdate:modelValue":[e=>m[t.prop]=e,e=>t.onChange?.(e,t,m,w,y)],placeholder:e,type:"date",valueFormat:t.format||"YYYY-MM-DD",format:t.format||"YYYY-MM-DD",clearable:vs(t.clearable,!0),disabledDate:e=>t.disabledDate?t.disabledDate(e,m):L(e),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1)},null)}if("datetime"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:m[t.prop],"onUpdate:modelValue":[e=>m[t.prop]=e,e=>t.onChange?.(e,t,m,w,y)],placeholder:e,type:"datetime",valueFormat:t.format||"YYYY-MM-DD HH:mm:ss",format:t.format||"YYYY-MM-DD HH:mm:ss",clearable:vs(t.clearable,!0),disabledDate:e=>t.disabledDate?t.disabledDate(e,m):L(e),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1)},null)}if("daterange"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:m[t.prop],"onUpdate:modelValue":[e=>m[t.prop]=e,e=>t.onChange?.(e,t,m,w,y)],placeholder:e,type:"daterange",valueFormat:vs(t.format,"YYYY-MM-DD "),format:vs(t.format,"YYYY-MM-DD"),"range-separator":h("next.date.rangeSeparator"),"start-placeholder":h("next.date.startPlaceholder"),"end-placeholder":h("next.date.endPlaceholder"),disabledDate:e=>t.disabledDate?t.disabledDate(e,m):L(e),clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),shortcuts:t.shortcuts||P},null)}if("datetimerange"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:m[t.prop],"onUpdate:modelValue":[e=>m[t.prop]=e,e=>t.onChange?.(e,t,m,w,y)],placeholder:e,type:"datetimerange",valueFormat:vs(t.format,"YYYY-MM-DD HH:mm:ss"),format:vs(t.format,"YYYY-MM-DD HH:mm:ss"),"range-separator":h("next.date.rangeSeparator"),"start-placeholder":h("next.date.startPlaceholder"),"end-placeholder":h("next.date.endPlaceholder"),disabledDate:e=>t.disabledDate?t.disabledDate(e,m):L(e),clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),shortcuts:t.shortcuts||P},null)}if("numberRange"===t.type)return r(_o,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:t.disabled,onChange:e=>{return a=e,l=t.prop,Array.isArray(m[l])||(m[l]=[]),void(m[l]=Number(a));var a,l}},null);if("inputTableSelect"===t.type){const e={};for(const a in t.tableSelect.slots)e[a]=(...e)=>t.tableSelect.slots[a]?.({column:t,formParams:m},...e);return r(Vo,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,formParams:m,column:t,disabled:vs(t.disabled,!1),onSelect:e=>((e,t)=>{e&&(t.tableSelectRows=e);const{value:a}=t.tableSelectProps||{};m[t.prop]=e.map(e=>e[a||"value"]),t.onTableSelect?.(m,e,t),E.value?.validateField(t.prop)})(e,t)},Fo(e)?e:{default:()=>[e]})}return"uploadImage"===t.type?r(Io,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:vs(t.disabled,!1),multiple:vs(t.multiple,!1),limit:t.limit,onChange:(...e)=>t.onChange?.(...e,t,m,w,y),onExceed:(...e)=>t.onExceed?.(...e,t,m,w,y)},null):"treeSelect"===t.type?r(No,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:vs(t.disabled,!1),column:t,formParams:m,onChange:(...e)=>t.onChange?.(...e,t,m,w,y)},null):"cascader"===t.type?r(Bo,{modelValue:m[t.prop],"onUpdate:modelValue":e=>m[t.prop]=e,disabled:vs(t.disabled,!1),column:t,formParams:m,onChange:(...e)=>t.onChange?.(...e,t,m,w,y)},null):void 0})(t)})]})))?t:{default:()=>[t]}),d.value&&u.showFooter?r("div",{class:Yo.e("footer")},[r(te,{type:"primary",loading:D.value,onClick:k},{default:()=>[h(u.submitText)||h("next.form.submit")]}),u.showResetBtn?r(te,{onClick:O},{default:()=>[h(u.resetText)||h("next.form.reset")]}):null]):null]})})())?t:{default:()=>[t]})}}});const Uo=on(No),$o=on(Bo),Ko=on(Vo),Xo=on(Wo);var qo=o({name:"AddEditForm",props:{formDatum:{type:Object,default:()=>({})},isEditing:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]}},emits:["close","submit"],setup(e,{slots:l,emit:o,expose:c}){const u=t("addEditFormSlots"),d={};u.value.forEach(e=>{d[e]=(...t)=>l[e]&&l[e](...t)});const h=t("options",{}),p=ds(s(h)?n(h):h);p.columnMinWidth=p.formColumnMinWidth,p.isEditing=e.isEditing;const v=a(),m=ds(s(e.formDatum)?n(e.formDatum):e.formDatum),g=ds(e.columns).map(e=>(e.hide=vs(e.formHide,e.hide,!1),e)),b=(...e)=>{o("submit",...e)};c({getFormExpose:()=>({formParams:v.value?.formParams,formColumns:v.value?.formColumns,formColumnsMap:v.value?.formColumnsMap})});return()=>{return r(i,null,[r(Xo,{ref:v,options:p,columns:g,formDatum:m,onClose:()=>o("close"),onSubmit:b},"function"==typeof(e=d)||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?d:{default:()=>[d]})]);var e}}});function Go(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Zo=Te("crud-table");var Jo=o({name:"NextCrudTable",props:ro,emits:["confirm-search","clear-search","change-pagination","selection-change","row-click","row-contextmenu","row-dblclick","cell-click","cell-dblclick","cell-contextmenu","cell-mouse-enter","cell-mouse-leave","expand-change","click-add-edit","close-add-edit","view-add-edit","delete-rows","delete-row","submit-form"],setup(e,{emit:t,slots:s,expose:o}){const c=ds(uo),u=l(()=>{const t=n(e.options);return zl(c,t)}),d=n(u);g("options",l(()=>u.value)),g("ns",Zo);const{t:v}=Wl(),f=a(d.columns),m=a([]),x=a([]),w=e=>{((e,t)=>{const a=p(e.columns),l=e=>{!e.dicData?.length&&e.loadDicData&&e.loadDicData(e,t=>{t?.length&&(e.dicData=t)})},n=e=>{let t=[];return e.forEach(e=>{l(e),t.push(e),e.children?.length&&(t.push(...n(e.children)),e.children&&delete e.children)}),t},s=n(a),o=e.formColumns.map(e=>(l(e),e)),r=s.concat(o).map(e=>{const t={prop:e.prop,label:vs(e.formLabel,e.label,""),type:vs(e.formType,e.type,""),defaultValue:vs(e.formDefaultValue,e.defaultValue,""),placeholder:vs(e.formPlaceholder,""),required:vs(e.formRequired,e.required,!1),sort:vs(e.formSort,e.sort,null),prefix:vs(e.formPrefix,e.prefix,null),suffix:vs(e.formSuffix,e.suffix,null),prepend:vs(e.formPrepend,e.prepend,null),append:vs(e.formAppend,e.append,null),hide:vs(e.formHide,e.hide,!1),disabled:vs(e.formDisabled,e.disabled,!1),editDisabled:vs(e.formEditDisabled,e.editDisabled,!1),clearable:vs(e.formClearable,e.clearable,!0),readonly:vs(e.formReadonly,e.readonly,!1),disabledDate:vs(e.formDisabledDate,e.disabledDate,!1),shortcuts:vs(e.formShortcuts,e.shortcuts,null),format:vs(e.formFormat,e.format,null),tip:vs(e.formTip,e.tip,null),rules:vs(e.formRules,e.rules,null),span:vs(e.formSpan,e.span,null),multiple:vs(e.formMultiple,e.multiple,!1),limit:vs(e.formLimit,e.limit,1),accept:vs(e.formAccept,e.accept,null),dicData:vs(e.formDicData,e.dicData,[]),loadDicData:vs(e.formLoadDicData,e.loadDicData,null),onChange:vs(e.onChangeForm,e.onChange,null),tableSelect:vs(e.tableSelect,{}),tableSelectRows:vs(e.tableSelectRows,[]),tableSelectProps:vs(e.tableSelectProps,null),tableSelectDefaultValue:vs(e.tableSelectDefaultValue,null),onTableSelect:vs(e.onTableSelect,null),filterable:vs(e.formFilterable,e.filterable,!1),allowCreate:vs(e.formAllowCreate,e.allowCreate,!1),nodeKey:vs(e.formNodeKey,e.nodeKey),accordion:vs(e.formAccordion,e.accordion,!1),leafOnly:vs(e.formLeafOnly,e.leafOnly,!1),showCheckbox:vs(e.formShowCheckboxn,e.showCheckbox,!1),checkStrictly:vs(e.formCheckStrictly,e.checkStrictly,!1),renderAfterExpand:vs(e.formRenderAfterExpand,e.renderAfterExpand,!1),treeSelectProps:vs(e.formTreeSelectProps,e.treeSelectProps,null),treeSelectNodeClick:vs(e.treeSelectNodeClickForm,e.treeSelectNodeClick,null),treeSelectNodeContextmenu:vs(e.treeSelectNodeContextmenuForm,e.treeSelectNodeContextmenu,null),treeSelectCheck:vs(e.treeSelectCheckForm,e.treeSelectCheck,null),treeSelecCheckChange:vs(e.treeSelecCheckChangeForm,e.treeSelecCheckChange,null),treeSelecNodeExpand:vs(e.treeSelecNodeExpandForm,e.treeSelecNodeExpand,null),treeSelecNodeCollapse:vs(e.treeSelecNodeCollapseForm,e.treeSelecNodeCollapse,null),treeSelecCurrentChange:vs(e.treeSelecCurrentChangeForm,e.treeSelecCurrentChange,null)};return!e.dicData?.length&&e.loadDicData&&fs(t,e,"dicData"),t}).filter(e=>e.sort&&e.prop).sort((e,t)=>e.sort-t.sort),i=(e,t)=>{const a={prop:e.prop,type:vs(e.searchType,e.type),multiple:vs(e.searchMultiple,e.multiple),searchDisabledDate:vs(e.searchDisabledDate,null),searchFormat:vs(e.searchFormat,null),label:vs(e.searchLabel,e.label),defaultValue:vs(e.searchDefaultValue,e.defaultValue,null),placeholder:vs(e.searchPlaceholder,e.placeholder,null),dicData:vs(e.searchDicData,e.dicData,[]),loadDicData:vs(e.searchLoadDicData,e.loadDicData,null),disabled:vs(e.searchDisabled,e.disabled,!1),readonly:vs(e.searchReadonly,e.readonly,!1),prefix:vs(e.searchPrefix,e.prefix,null),suffix:vs(e.searchSuffix,e.suffix,null),prepend:vs(e.searchPrepend,e.prepend,null),append:vs(e.searchAppend,e.append,null),hide:vs(e.searchHide,!1),showSearchLabel:vs(e.showSearchLabel,!0),sort:vs(e.searchSort,e.sort,t),nodeKey:vs(e.searchNodeKey,e.nodeKey),accordion:vs(e.searchAccordion,e.accordion,!1),leafOnly:vs(e.searchLeafOnly,e.leafOnly,!1),showCheckbox:vs(e.searchShowCheckboxn,e.showCheckbox,!1),checkStrictly:vs(e.searchCheckStrictly,e.checkStrictly,!1),renderAfterExpand:vs(e.searchRenderAfterExpand,e.renderAfterExpand,!1),treeSelectProps:vs(e.searchTreeSelectProps,e.treeSelectProps,null),treeSelectNodeClick:vs(e.treeSelectNodeClickSearch,e.treeSelectNodeClick,null),treeSelectNodeContextmenu:vs(e.treeSelectNodeContextmenuSearch,e.treeSelectNodeContextmenu,null),treeSelectCheck:vs(e.treeSelectCheckSearch,e.treeSelectCheck,null),treeSelecCheckChange:vs(e.treeSelecCheckChangeSearch,e.treeSelecCheckChange,null),treeSelecNodeExpand:vs(e.treeSelecNodeExpandSearch,e.treeSelecNodeExpand,null),treeSelecNodeCollapse:vs(e.treeSelecNodeCollapseSearch,e.treeSelecNodeCollapse,null),treeSelecCurrentChange:vs(e.treeSelecCurrentChangeSearch,e.treeSelecCurrentChange,null),onChange:vs(e.onChangeSearch,e.onChange,null)};return!e.dicData?.length&&e.loadDicData&&fs(a,e,"dicData"),a},c=e.searchColumns.map((e,t)=>(l(e),i(e,t))),u=c.length,d=c.concat((e=>{let t=[];return e.forEach((e,a)=>{e.searchType&&t.push(i(e,a+u))}),t})(s)),h=hs(d.sort((e,t)=>e.sort-t.sort),"prop");t&&t({formColumns:r,searchColumns:h,columns:a})})(e,({formColumns:e,searchColumns:t,columns:a})=>{m.value=t,x.value=e,f.value=a})},C=a(e.data),E=a((()=>{const e=m.value;let t={};for(let a=0;a<e.length;a++){const l=e[a];ps(l.defaultValue)&&(t[l.prop]=l.defaultValue)}return t})()),D=a=>{const l=ds(S(a));jl(E.value,l)||(e.page.pageIndex=1,E.value=l),t("confirm-search",l)},k=()=>{t("clear-search")},O=()=>{D(E.value)};b(()=>e.data,e=>{C.value=e},{immediate:!0}),b(()=>u,e=>{w(e.value)},{deep:!0,immediate:!0});const L=a(d.defaultContentHeight),T=a(),P=a(),A=a(),_=a(),j=a(null),z=()=>{y(()=>{const e=(T.value?.clientHeight||0)-((P.value?.clientHeight||0)+(_.value?.clientHeight||0));L.value=e})},H=e=>{"F11"!==e.key&&"fullscreenchange"!==e.type||z()};M(()=>{us(T.value,()=>{z()}),d.initLoadData&&D(E.value),d.fullscreenchangeContentHeight&&(document.addEventListener("fullscreenchange",H),document.addEventListener("keydown",H))}),h(()=>{d.fullscreenchangeContentHeight&&(document.removeEventListener("fullscreenchange",H),document.removeEventListener("keydown",H))});const V=a=>{e.page.pageIndex=a.pageIndex,e.page.pageSize=a.pageSize,t("change-pagination",a),D(E.value)},R=a([]),I=e=>{R.value=e,t("selection-change",R.value)};g("multipleSelection",R);const N=p({visible:!1,title:v("next.table.add"),rowInfo:{},isEditing:!0}),B=(e={})=>{const{dialogTitle:a,dialogFormParamsDefault:l}=d;N.isEditing=!0,N.title=a+" "+v("next.table.add"),N.rowInfo={...l,...e},t("click-add-edit",e,d),y(()=>{N.visible=!0})},F=e=>{t("delete-rows",e,()=>{O()})},Y=e=>{t("delete-row",e,()=>{O()})},W=e=>{const{dialogTitle:a}=d;N.isEditing=!0,N.title=a+" "+v("next.table.edit"),N.rowInfo=e.row,t("click-add-edit",e.row,d),y(()=>{N.visible=!0})},U=e=>{const{dialogTitle:a}=d;N.isEditing=!1,N.title=a+" "+v("next.table.view"),N.rowInfo=e.row,t("view-add-edit",e.row),y(()=>{N.visible=!0})},$=()=>{N.visible=!1,N.title="",N.rowInfo={},t("close-add-edit")},K=(...e)=>{t("submit-form",...e)},X=a([]),q=a([]),G=a([]);for(const e in s)e.includes(ho)?X.value.push(e):e.includes(vo)?q.value.push(e):e.includes(mo)&&G.value.push(e);g("columnSlots",X),g("searchFormSlots",q),g("addEditFormSlots",G);const Z=t=>{const{pageIndex:a,pageSize:l}=e.page;return(a-1)*l+(t+1)},J=l(()=>{const{total:t}=e.page,a=document.createElement("span");a.innerText=t,a.style.visibility="hidden",document.body.appendChild(a);const l=a.getBoundingClientRect().width,n=Math.ceil(l)+25;return document.body.removeChild(a),n>50?n:50}),Q={};q.value.forEach(e=>{Q[e]=(...t)=>s[e]&&s[e](...t)});const ee={};X.value.forEach(e=>{ee[e]=(...t)=>s[e]&&s[e](...t)});const te={};G.value.forEach(e=>{te[e]=(...t)=>s[e]&&s[e](...t)});const ne={};io.forEach(e=>{ne[e]=(...t)=>s[e]&&s[e](...t)});const se={};return co.forEach(e=>{se[e]=(...t)=>s[e]&&s[e](...t)}),o({onClickRowAdd:B,columns:f.value,getFormExpose:()=>j.value?.getFormExpose(),updateColumns:e=>{w(e)},getSearchFormParams:()=>E.value,reloadData:()=>{O()},onRefresh:()=>{w(u.value)}}),()=>r(i,null,[r(i,null,[r("div",{ref:T,class:[Zo.b(),e.className],style:e.style},[d.showSearchForm||d.showHeaderMenu?r("header",{ref:P,class:Zo.b("header")},[d.showSearchForm&&r(Co,{columns:m.value,onZoomResize:z,onConfirmSearch:D,onClearSearch:k},Go(Q)?Q:{default:()=>[Q]}),d.showHeaderMenu&&r(So,{onClickAdd:B,onDeleteRows:F,onClickRefresh:O},Go(ne)?ne:{default:()=>[ne]}),s["table-head-tip"]?.()]):null,r(yo,{loading:e.loading},{default:()=>[r("div",{ref:A,class:Zo.b("content")},[r(ae,{data:C.value,height:L.value,rowKey:d.rowKey,border:d.border,stripe:d.stripe,fit:d.fit,size:d.size,"row-style":d.rowStyle,"row-class-name":d.rowClassName,"cell-style":d.cellStyle,"cell-class-name":d.cellClassName,"header-row-style":d.headerRowStyle,"header-row-class-name":d.headerRowClassName,"header-cell-style":d.headerCellStyle,"header-cell-class-name":d.headerCellClassName,"span-method":e.spanMethod,"onSelection-change":I,"onRow-click":(...e)=>t("row-click",...e),"onRow-contextmenu":(...e)=>t("row-contextmenu",...e),"onRow-dblclick":(...e)=>t("row-dblclick",...e),"onCell-click":(...e)=>t("cell-click",...e),"onCell-dblclick":(...e)=>t("cell-dblclick",...e),"onCell-contextmenu":(...e)=>t("cell-contextmenu",...e),"onCell-mouse-enter":(...e)=>t("cell-mouse-enter",...e),"onCell-mouse-leave":(...e)=>t("cell-mouse-leave",...e),"onExpand-change":(...e)=>t("expand-change",...e)},{default:()=>[d.selection?r(le,{type:"selection",fixed:"left",label:v("next.table.selectionAll"),width:55,headerAlign:d.headerAlign,align:d.cellAlign},null):null,d.index?r(le,{type:"index",label:"#",width:J.value,index:Z,fixed:"left",headerAlign:d.headerAlign,align:d.cellAlign},null):null,s.default?.(),f.value.map(e=>r(Eo,{columnOption:e,key:e.prop},Go(ee)?ee:{default:()=>[ee]})),d.operations?r(Do,{onEditRow:W,onViewRow:U,onDeleteRow:Y},Go(se)?se:{default:()=>[se]}):null],empty:()=>r(me,{imageSize:L.value>220?100:50,description:v("next.table.notData")},null)})])]}),d.isPagination?r("div",{ref:_,class:Zo.b("footer")},[r(ko,{page:e.page,onChange:V},null),s["table-footer-tip"]?.()]):null,r(Lo,{modelValue:N.visible,"onUpdate:modelValue":e=>N.visible=e,title:N.title,width:d.dialogWidth,fullscreen:d.dialogFullscreen,fullscreenBtn:d.dialogFullscreenBtn,draggable:d.dialogDraggable,closeOnClickModal:d.closeOnClickModal,onClose:$},{default:()=>r(qo,{ref:j,formDatum:N.rowInfo,columns:x.value,isEditing:N.isEditing,onClose:$,onSubmit:K},Go(te)?te:{default:()=>[te]})})])])])}});const Qo=on(Jo);var er={className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},page:{type:Object,default:()=>({pageIndex:1,pageSize:10,total:0})}},tr={};const ar=Te("crud-table-virtualized"),lr=on(o({name:"NextCrudTableVirtualized",props:er,setup(e,{emit:t}){const a=ds(tr),s=l(()=>{const t=n(e.options);return zl(a,t)}),o=n(s);g("options",l(()=>s.value));const{t:c}=Wl(),u=p({visible:!1,title:c("next.table.add"),rowInfo:{},isEditing:!0}),d=()=>{u.visible=!1,u.title="",u.rowInfo={},t("close-add-edit")};return()=>r(i,null,[r("div",{class:[ar.b(),e.className]},[r(nr,null,null),r(jo,{modelValue:u.visible,"onUpdate:modelValue":e=>u.visible=e,title:u.title,width:o.dialogWidth,fullscreen:o.dialogFullscreen,closeOnClickModal:o.closeOnClickModal,onClose:d},null)])])}})),nr=on(yo),sr=Te("upload"),or=on(o({name:"NextUpload",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},listType:{type:String,values:["text","picture","picture-card"],default:"picture-card"},accept:{type:String,default:"image/*"}},emits:["change","remove","preview"],setup(){const{appContext:t}=e(),{t:a}=Wl();return{t:a,appContext:t}},render(){const e=this.$slots,t=this.$props,l=this.$emit,n=this.t,s=a([]),o=document.getElementsByTagName("body")[0];let i=null;return r(ue,{class:[sr.b(),t.className],style:t.style,"list-type":t.listType,"auto-upload":!1,"on-preview":e=>{const t=s.value.findIndex(t=>t.url===e.url)||0;i&&(D(null,i),o.removeChild(i)),i=document.createElement("div"),o.appendChild(i);const a=r({render:()=>C(m,{to:"body"},[C(de,{initialIndex:t,"url-list":s.value.map(e=>e.url),onClose:()=>{D(null,i)}})])});i.appContext=this.appContext,D(a,i),l("preview",e)},onChange:(e,t)=>{s.value=t,l("change",e,t)},onRemove:(e,t)=>{s.value=t,l("remove",e,t)}},{trigger:()=>e.default?e.default():"picture-card"===t.listType?r(R,null,{default:()=>[r(An,null,null)]}):r(te,{link:!0,text:!0,type:"primary"},{default:()=>[r(R,null,{default:()=>[r(An,null,null)]}),r("em",null,[n("next.form.selectFile")])]})})}})),rr=Te("video-player");var ir=o({name:"NextVideoPlayer",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},type:{type:String,default:"mp4",values:["mp4","m3u8","flv","mpegts"]},src:{type:String,default:""},autoplay:{type:Boolean,default:!0},tf:{type:Object,default:null},tensorflow:{type:Object}},emits:["loaded","play","error","detector"],setup(e,{emit:t,expose:l}){const n=e.tf||window.tf,{lang:s}=Wl(),o={"zh-cn":Me,en:Se,"zh-tw":Ee};o[s.value]?Ce.addLanguage("zh-CN",o[s.value]):Ce.addLanguage("zh-CN",Me);const c=S(e.src),u=a(),d=a(),p=a(),v=a(),f=a(),m=a(null),g=a(null),b=e=>{const t=r({render:()=>C("span",{class:"screemshot-btn",onClick:()=>((e,t)=>{const a=ye(xe(),"YYYY-MM-DD_HH-mm-ss").value,l=e.el().getElementsByTagName("video")[0],n=document.createElement("canvas"),s=l.videoWidth,o=l.videoHeight;n.width=s,n.height=o;const r=n.getContext("2d"),i=s/o,c=n.width/n.height,u=s,d=o;let h,p,v,f;i>c?(v=n.width,f=n.width/i,h=0,p=Math.round((n.height-f)/2)):i===c?(v=n.width,f=n.height,h=0,p=0):i<c&&(v=n.height*i,f=n.height,h=Math.round((n.width-v)/2),p=0),r.drawImage(l,0,0,u,d,h,p,v,f),t&&r.drawImage(t,0,0);const m="image/png";let g=n.toDataURL(m,.92).replace(m,"image/octet-stream");g=g.replace(/^data:image\/[^;]+/,"data:application/octet-stream");const b=document.createElement("a");b.href=g,b.download=a+"_screenshot.png",b.click()})(p.value,g.value)},[C(R,{color:"#FFFFFF",size:"22px"},{default:()=>C(wn)})])});p.value.on("loadedmetadata",()=>{D(t,e)})},x=(t,a)=>{if(!e.tensorflow)return;if(!n)throw new Error("请先引入 @tensorflow/tfjs 模块!");const{modelUrl:l,classNames:s}=e.tensorflow;if(!l)throw new Error("模型文件地址不能未空!");if(!s||!s.length)throw new Error("模型类别不能未空!");t.innerHTML="",n?.loadGraphModel(l).then(e=>{const l=document.createElement("canvas");l.className=rr.b("recongition"),t.appendChild(l);const o=l.getContext("2d"),r=document.createElement("canvas").getContext("2d");a.ontimeupdate=()=>{const{videoWidth:t,videoHeight:i,offsetTop:c,offsetLeft:u}=a;l.width=t,l.height=i,l.style.top=c+"px",l.style.left=u+"px",ln(a,e,o,n,s,[],r)},m.value=e,g.value=l})};h(()=>{m.value&&(n?.dispose(),m.value.dispose(),m.value=null),p.value&&(p.value.mse&&(p.value.mse.endOfStream(),p.value.mse.unload(),p.value.mse=null),p.value.pause(),p.value.dispose(),p.value=null),v.value&&(v.value.pause(),v.value.unload(),v.value.detachMediaElement(),v.value.destroy(),v.value=null),f.value&&(f.value.pause(),f.value.unload(),f.value.detachMediaElement(),f.value.destroy(),f.value=null),u.value&&D(null,u.value)});return M(()=>{y(()=>{(a=>{if(!a)return(()=>{const a=u.value,l=document.createElement("video");l.className="video-js vjs-default-skin",e.autoplay&&l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),d.value=l,a.appendChild(l),p.value=Ce(l,{techOrder:["html5"],controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[]});const n=document.createElement("div");a.children[0].appendChild(n),p.value.on("play",()=>{t("play",l,a),x(n,l)}),b(a),t("loaded",{player:p.value,video:l})})(),!1;const l=e.type;"m3u8"===l?(a=>{const l=u.value,n=document.createElement("video");n.className="video-js vjs-default-skin",e.autoplay&&n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),d.value=n,l.appendChild(n);const s={techOrder:["html5"],flvjs:{mediaDataSource:{cors:!0,withCredentials:!1}},controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[{src:a,type:"application/x-mpegURL"}]};p.value=Ce(n,s);const o=document.createElement("div");l.children[0].appendChild(o),p.value.on("play",()=>{t("play",n,l),x(o,n)}),b(l),t("loaded",{player:p.value,video:n})})(a):"mp4"===l?(a=>{const l=u.value,n=document.createElement("video");n.className="video-js vjs-default-skin",e.autoplay&&n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),d.value=n,l.appendChild(n);const s={techOrder:["html5"],controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[{src:a,type:"video/mp4"}]};p.value=Ce(n,s);const o=document.createElement("div");l.children[0].appendChild(o),p.value.on("play",()=>{t("play",n,l),x(o,n)}),b(l),t("loaded",{player:p.value,video:n})})(a):"mpegts"===l?(async a=>{let l=window.mpegts;if(l||(l=await import("mpegts.js")),l&&l.getFeatureList().mseLivePlayback){const n=u.value,s=document.createElement("video");s.className="video-js vjs-default-skin",e.autoplay&&s.setAttribute("autoplay","true"),s.setAttribute("muted","true"),d.value=s,n.appendChild(s);const o={controls:!0,autoplay:!1,fluid:!0,muted:!0,liveui:!0,preload:"auto",language:"zh-CN"};p.value=Ce(s,o),f.value=l.createPlayer({enableWorker:!0,type:"flv",isLive:!0,url:a}),f.value.attachMediaElement(s),f.value.load(),f.value.on("error",()=>{t("error",s)}),b(n);const r=document.createElement("div");n.children[0].appendChild(r),f.value.on("metadata_arrived",()=>{t("play",s,n),x(r,s)}),t("loaded",{player:p.value,video:s})}})(a):"flv"===l&&(async a=>{let l=window.flvjs;l||(l=await import("flv.js"));const n=u.value,s=document.createElement("video");s.className="video-js vjs-default-skin",e.autoplay&&s.setAttribute("autoplay","true"),s.setAttribute("muted","true"),d.value=s,n.appendChild(s),p.value=Ce(s,{techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{cors:!0,withCredentials:!1}},controls:!0,fluid:!0,preload:"auto",language:"zh-CN"}),l.isSupported()&&(v.value=l.createPlayer({type:"flv",url:a,cors:!0,isLive:!0}),v.value.attachMediaElement(s),v.value.load(),e.autoplay&&v.value.play());const o=document.createElement("div");n.children[0].appendChild(o),p.value.on("play",()=>{t("play",s,n),x(o,s)}),b(n),t("loaded",{player:p.value,video:s})})(a)})(c)})}),l({getElement:()=>{const e=u.value,t=e.children[0];return{videoElement:d.value,container:e,palyerContainer:t}}}),()=>r(i,null,[r("div",{ref:u,class:[rr.b(),e.className],style:e.style},null)])}});const cr=on(ir),ur=on(o({name:"NextDragResize",props:{},setup:()=>()=>r(i,null,[r(i,null,null)])})),dr=Te("container"),hr=on(o({name:"NextCarousel",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("div",{class:[dr.b(),e.className],style:{...e.style}},[t.default?.()])}));var pr=o({props:{isFullscreen:{type:Boolean,default:!1},imageIndex:{type:Number,default:0},imageLength:{type:Number,default:0}},emits:["fullscreen","save"],setup(e,{emit:a}){const l=t("ns",{}),n=t("scaleTranslateManager",{}),s=n.scaleTranslate,{t:o}=Wl(),c=e=>{a("fullscreen",e),document.body.style.overflow=e?"hidden":"auto"};return()=>r(i,null,[r(i,null,[r("ul",{class:[l.be("header","tool")]},[r("li",{class:"hover",onClick:()=>a("save")},[r("svg",{t:"1719034799379",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4272",width:"18",height:"18"},[r("path",{d:"M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z","p-id":"4273"},null),r("path",{d:"M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z","p-id":"4274"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.saveLabel")])])]),r("ul",{class:[l.be("header","tool")]},[r("li",{class:"hover",onClick:()=>n.onResetScaleTranslate()},[r("svg",{t:"1725840994827",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6051",width:"18",height:"18"},[r("path",{d:"M322.794667 445.205333a34.133333 34.133333 0 0 1 2.218666 45.824l-2.218666 2.432a34.133333 34.133333 0 0 1-45.824 2.218667l-2.432-2.218667-149.333334-149.333333a34.133333 34.133333 0 0 1-2.218666-45.824l2.218666-2.432 149.333334-149.333333a34.133333 34.133333 0 0 1 50.474666 45.824l-2.218666 2.432-91.050667 91.050666L640 285.866667c160.234667 0 290.133333 129.898667 290.133333 290.133333 0 158.016-126.314667 286.506667-283.477333 290.048L640 866.133333H234.666667a34.133333 34.133333 0 0 1-3.114667-68.117333L234.666667 797.866667h405.333333c122.538667 0 221.866667-99.328 221.866667-221.866667 0-120.533333-96.106667-218.602667-215.850667-221.781333L640 354.133333l-408.256-0.021333 91.050667 91.093333z","p-id":"6052"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.zoomRestore")])]),r("li",null,[r("span",null,[E("缩放比例")]),r("span",null,[parseInt((100*s.value.scale).toString()),E("%")]),r("span",{style:"padding: 0 10px;"},[E("偏移量")]),r("span",{style:"min-width: 120px; text-align: left;"},[E("X: "),s.value.x,E(", Y: "),s.value.y])]),e.imageLength?r("li",null,[r("span",null,[E("第 "),e.imageIndex+1,E(" 张")]),r("em",{style:"padding: 0 5px;"},[E("/")]),r("span",null,[E("共 "),e.imageLength,E(" 张")])]):null,r("li",{style:"margin-right: 30px;",class:"hover"},[r(ge,{trigger:"hover",placement:"bottom",width:"none"},{reference:()=>r("div",{class:"flex-center"},[r("span",{style:"padding-right: 3px"},[o("next.labelimg.instructions")]),r(R,{size:14},{default:()=>[r(Nn,null,null)]})]),default:()=>r("ul",{style:"font-size: 12px;white-space: nowrap;"},[r("li",null,[r("span",null,[E("W:")]),r("span",null,[E("鼠标移入图片中,长按W键,鼠标按下左键,移动鼠标开始绘制,鼠标抬起结束绘制")])]),r("li",null,[r("span",null,[E("A:")]),r("span",null,[E("A键进入上一张图片进行标注")])]),r("li",null,[r("span",null,[E("D:")]),r("span",null,[E("D键进入下一张图片进行标注")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标滚轮:")]),r("span",null,[E("长按Ctrl+鼠标滚轮对图片进行缩放")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标左键:")]),r("span",null,[E("长按Ctrl+鼠标左键对图片进行拖拽移动")])])])})]),e.isFullscreen?r("li",{class:"hover",onClick:()=>c(!1)},[r(T,{placement:"top",content:"取消全屏"},{default:()=>[r("svg",{t:"1719035442027",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5388",width:"18",height:"18"},[r("path",{d:"M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z","p-id":"5389"},null)])]})]):r("li",{class:"hover",onClick:()=>c(!0)},[r(T,{placement:"top",content:"全屏"},{default:()=>[r("svg",{t:"1719035375323",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5241",width:"18",height:"18"},[r("path",{d:"M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z","p-id":"5242"},null)])]})])])])])}});const vr=["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],fr=e=>{const t=e.type,a=e.startX+e.rectWidth/2,l=e.startY+e.rectHeight/2;return[t,parseFloat((a/e.canvasWidth).toFixed(6)),parseFloat((l/e.canvasHeight).toFixed(6)),parseFloat((e.rectWidth/e.canvasWidth).toFixed(6)),parseFloat((e.rectHeight/e.canvasHeight).toFixed(6))]},mr=(e,t,a)=>{const[l,n,s,o,r]=e,i=o*t,c=r*a,u=n*t-i/2,d=s*a-c/2;return{type:l,startX:Math.ceil(u),startY:Math.ceil(d),rectWidth:Math.ceil(i),rectHeight:Math.ceil(c),canvasWidth:t,canvasHeight:a}};var gr=o({props:{labelRect:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},activateRect:{type:Object,default:null}},emits:["close","select","delete"],setup(e,{emit:n}){const s=t("ns",{}),o=()=>{n("close")},c=()=>{n("delete",e.activateRect)},u=a();b(()=>e.activateRect,()=>{const{type:t}=e.activateRect;u.value=ps(t)?t:null},{deep:!0,immediate:!0});const d=a({width:0,height:0});M(()=>{const{clientWidth:e,clientHeight:t}=h.value;d.value.width=e,d.value.height=t});const h=a(),p=l(()=>{const{left:t,top:a}=e.labelRect,l=a+d.value.height-window.innerHeight;let n=a;return l>0&&(n-=l),{top:n+"px",left:t+"px"}});return()=>r(i,null,[r("div",{ref:h,class:[s.b("contextmenu-label")],style:p.value},[r("div",{class:"label-head"},[r("span",{style:"padding-right: 30px"},[E("标签选择")]),r(R,{size:16,onClick:o},{default:()=>[r(Cn,null,null)]})]),r("ul",{class:"label-main"},[e.classes.map((e,t)=>r("li",{key:t,onClick:()=>(e=>{u.value=e,n("select",e)})(t),class:{"activate-label":u.value===t}},[r("span",{style:{"background-color":vr[t%vr.length]},class:"label-line"},null),r("span",null,[e])]))]),ps(u.value)?r("div",{style:"margin: 10px auto 0"},[r(te,{icon:En,plain:!0,size:"small",type:"danger",onClick:c},{default:()=>[E("删除标注框")]})]):null])])}});class br{canvas;canvasWidth;canvasHeight;ctx;scaleFactor=1;preScaleFactor=1;offset={x:0,y:0};preOffset={x:0,y:0};mousePositioin={x:0,y:0};maxScale=8;minScale=.5;scaleStep=.1;clickX=0;clickY=0;observers=[];constructor(e){this.canvas=e,this.canvasWidth=e.width,this.canvasHeight=e.height,this.ctx=e.getContext("2d"),this.canvasMousedown=this.canvasMousedown.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this),this.canvasMouseup=this.canvasMouseup.bind(this),this.canvas.addEventListener("mousedown",this.canvasMousedown),this.canvas.addEventListener("wheel",this.canvasMousewheel,{passive:!1}),window.addEventListener("wheel",this.onWindowWheel,{passive:!1})}notifyObservers(e,t){this.observers.forEach(a=>{a({scale:e,...t})})}changeZoom(e){this.observers.push(e)}reset(){this.scaleFactor=1,this.preScaleFactor=1,this.offset={x:0,y:0},this.preOffset={x:0,y:0},this.mousePositioin={x:0,y:0},this.zoom()}render(){this.canvas.width=this.canvasWidth,this.notifyObservers(this.scaleFactor,this.offset)}zoom(){const e=this.mousePositioin.x-(this.mousePositioin.x-this.offset.x)*this.scaleFactor/this.preScaleFactor,t=this.mousePositioin.y-(this.mousePositioin.y-this.offset.y)*this.scaleFactor/this.preScaleFactor;this.offset.x=Math.ceil(e),this.offset.y=Math.ceil(t),this.render(),this.preScaleFactor=this.scaleFactor,this.preOffset.x=this.offset.x,this.preOffset.y=this.offset.y}onWindowWheel=e=>{e.ctrlKey&&e.preventDefault()};canvasMousewheel=e=>{e.preventDefault(),e.ctrlKey&&(this.mousePositioin.x=e.offsetX,this.mousePositioin.y=e.offsetY,e.deltaY>0?(this.scaleFactor=parseFloat((this.scaleFactor+this.scaleStep).toFixed(1)),this.scaleFactor>this.maxScale&&(this.scaleFactor=this.maxScale)):(this.scaleFactor=parseFloat((this.scaleFactor-this.scaleStep).toFixed(1)),this.scaleFactor<this.minScale&&(this.scaleFactor=this.minScale)),this.zoom())};canvasMousedown(e){e.preventDefault(),0===e.button&&e.ctrlKey&&(this.clickX=e.offsetX,this.clickY=e.offsetY,this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("mouseup",this.canvasMouseup))}canvasMousemove(e){e.preventDefault(),e.ctrlKey&&(this.offset.x=Math.ceil(this.preOffset.x+(e.offsetX-this.clickX)),this.offset.y=Math.ceil(this.preOffset.y+(e.offsetY-this.clickY)),this.render())}canvasMouseup(e){e.preventDefault(),e.ctrlKey&&(this.preOffset.x=this.offset.x,this.preOffset.y=this.offset.y,this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("mouseup",this.canvasMouseup))}destroy(){this.canvas.removeEventListener("mousedown",this.canvasMousedown),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("mouseup",this.canvasMouseup),this.canvas.removeEventListener("wheel",this.canvasMousewheel),window.removeEventListener("wheel",this.onWindowWheel)}}const{hexToRgb:yr}=ql();var xr=o({props:{parentEl:{type:Object,default:null},rect:{type:Object,default:()=>({})},color:{type:String,default:null}},emits:["draggle-resize","contextmenu"],setup(e,{emit:l}){const n=t("scaleTranslateManager",{}).scaleTranslate,s=a(!1),o=a({topLeft:!1,topCenter:!1,topRight:!1,leftCenter:!1,rightCenter:!1,bottomLeft:!1,bottomCenter:!1,bottomRight:!1}),r=a({diff_x:null,diff_y:null});let i={};const c=k(e.rect),u=e=>{e.preventDefault(),e.stopPropagation(),s.value=!1,o.value.topLeft=!1,o.value.topCenter=!1,o.value.topRight=!1,o.value.leftCenter=!1,o.value.rightCenter=!1,o.value.bottomLeft=!1,o.value.bottomCenter=!1,o.value.bottomRight=!1,l("draggle-resize",c.value)},d=e=>{const{scale:t,x:a,y:l}=n.value,u=30/t,d=Math.ceil(c.value.startX*t+a),h=Math.ceil(c.value.startY*t+l);if(s.value){const n=e.clientX-i.left-r.value.diff_x,s=e.clientY-i.top-r.value.diff_y,o=Math.ceil((n-a)/t),u=Math.ceil((s-l)/t);c.value.startX=Math.max(0,Math.min(o,i.width-c.value.rectWidth)),c.value.startY=Math.max(0,Math.min(u,i.height-c.value.rectHeight))}if(o.value.bottomCenter){let a=Math.floor((e.clientY-i.top-h)/t);a<u&&(a=u),a+c.value.startY>i.height&&(a=i.height-c.value.startY),c.value.rectHeight=a}if(o.value.topCenter){let a=Math.floor((e.clientY-i.top-l)/t),n=c.value.startY-a+c.value.rectHeight;if(a<0)return;if(n<u)return;c.value.rectHeight=n,c.value.startY=Math.max(0,Math.min(a,i.height-c.value.rectHeight))}if(o.value.leftCenter){let l=Math.floor((e.clientX-i.left-a)/t),n=c.value.startX-l+c.value.rectWidth;if(l<0)return;if(n<u)return;c.value.startX=Math.max(0,Math.min(l,i.width-c.value.rectWidth)),c.value.rectWidth=n}if(o.value.rightCenter){let a=Math.floor((e.clientX-i.left-d)/t);a<u&&(a=u),a+c.value.startX>i.width&&(a=i.width-c.value.startX),c.value.rectWidth=a}if(o.value.bottomRight){let a=Math.floor((e.clientX-i.left-d)/t),l=Math.floor((e.clientY-i.top-h)/t);a<u&&(a=u),l<u&&(l=u),a+c.value.startX>i.width&&(a=i.width-c.value.startX),l+c.value.startY>i.height&&(l=i.height-c.value.startY),c.value.rectWidth=a,c.value.rectHeight=l}if(o.value.bottomLeft){let l=Math.floor((e.clientX-i.left-a)/t),n=c.value.startX-l+c.value.rectWidth,s=Math.floor((e.clientY-i.top-h)/t);if(l<0)return;if(n<u)return;s<u&&(s=u),s+c.value.startY>i.height&&(s=i.height-c.value.startY),c.value.startX=Math.max(0,Math.min(l,i.width-c.value.rectWidth)),c.value.rectWidth=n,c.value.rectHeight=s}if(o.value.topLeft){let n=Math.floor((e.clientY-i.top-l)/t),s=c.value.startY-n+c.value.rectHeight;if(n<0)return;if(s<u)return;c.value.rectHeight=s,c.value.startY=Math.max(0,Math.min(n,i.height-c.value.rectHeight));let o=Math.floor((e.clientX-i.left-a)/t),r=c.value.startX-o+c.value.rectWidth;if(o<0)return;if(r<u)return;c.value.startX=Math.max(0,Math.min(o,i.width-c.value.rectWidth)),c.value.rectWidth=r}if(o.value.topRight){let a=Math.floor((e.clientY-i.top-l)/t),n=c.value.startY-a+c.value.rectHeight;if(a<0)return;if(n<u)return;c.value.rectHeight=n,c.value.startY=Math.max(0,Math.min(a,i.height-c.value.rectHeight));let s=Math.floor((e.clientX-i.left-d)/t);s<u&&(s=u),s+c.value.startX>i.width&&(s=i.width-c.value.startX),c.value.rectWidth=s}};return M(()=>{i=e.parentEl.getBoundingClientRect(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),h(()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)}),{onMousedown:e=>{e.preventDefault(),s.value=!0,r.value.diff_x=e.offsetX,r.value.diff_y=e.offsetY},onMouseup:u,onContextmenu:e=>{e.preventDefault(),e.preventDefault(),l("contextmenu",e,c.value)},rect:c,onMousedownDot:(e,t)=>{e.preventDefault(),e.stopPropagation(),o.value[t]=!0}}},render(){const e=t("ns",{}),a=t("scaleTranslateManager",{}).scaleTranslate,l=this.$props;return r("div",{class:[e.b("draggable-rect")],style:(()=>{const{startX:e,startY:t,rectWidth:n,rectHeight:s}=((e,t)=>{const{startX:a,startY:l,rectWidth:n,rectHeight:s}=e,{scale:o,x:r,y:i}=t;return{startX:Math.ceil(a*o+r),startY:Math.ceil(l*o+i),rectWidth:Math.ceil(n*o),rectHeight:Math.ceil(s*o),canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,originWidth:e.originWidth,originHeight:e.originHeight}})(this.rect,a.value),o={top:t+"px",left:e+"px",width:n+"px",height:s+"px"},r=l.color;if(r){const e=yr(r);e&&(o.backgroundColor=`rgba(${e[0]},${e[1]},${e[2]}, 0.5)`)}return o})(),onMousedown:this.onMousedown,onMouseup:this.onMouseup,onContextmenu:this.onContextmenu},[r("ul",{class:[e.be("draggable-rect","resize")]},[r("li",{class:"top-left",onMousedown:e=>this.onMousedownDot(e,"topLeft")},null),r("li",{class:"top-center",onMousedown:e=>this.onMousedownDot(e,"topCenter")},null),r("li",{class:"top-right",onMousedown:e=>this.onMousedownDot(e,"topRight")},null),r("li",{class:"left-center",onMousedown:e=>this.onMousedownDot(e,"leftCenter")},null),r("li",{class:"right-center",onMousedown:e=>this.onMousedownDot(e,"rightCenter")},null),r("li",{class:"bottom-left",onMousedown:e=>this.onMousedownDot(e,"bottomLeft")},null),r("li",{class:"bottom-center",onMousedown:e=>this.onMousedownDot(e,"bottomCenter")},null),r("li",{class:"bottom-right",onMousedown:e=>this.onMousedownDot(e,"bottomRight")},null)])])}}),wr=o({name:"NextCanvasContext",props:{classes:{type:Array,default:()=>[]},contextClientHeight:{type:Number,default:null},rowInfo:{type:Object,default:()=>({})}},emits:["change"],setup(e,{emit:n,expose:s}){const o=t("ns",{}),c=t("_emit",null),u=t("scaleTranslateManager",{}),d=a(),p=a(),v=a(),f=a(),m=a([]),g=a({}),x=a(),w=()=>{const e=ds(m.value);let t=[];return{rects:e.map(e=>{delete e.typeName;const a=fr(e);return t.push(a.join(" ")),S(e)}),label_txt:t.join("\n")}},C=(e,t)=>{p.value.style.width=e+"px",p.value.style.height=t+"px",v.value.width=e,v.value.height=t,v.value.style.width=e+"px",v.value.style.height=t+"px",f.value.width=e,f.value.height=t,f.value.style.width=e+"px",f.value.style.height=t+"px"},E=a(!1),D=t=>{const a=v.value?.getContext("2d");if(t?.imageSrc){const l=new Image;l.src=t.imageSrc,E.value=!0,l.onload=()=>{E.value=!1;const{canvasWidth:n,canvasHeight:s,originWidth:o,originHeight:r}=(e=>{const t=d.value?.elementInstance.clientWidth,a=d.value?.elementInstance.clientHeight;let{width:l,height:n}=e,s=1;const o=l/n;if(o>1?(l=t,n=t/o):(l=a*o,n=a),n>a){const e=n/a;n=a,l/=e}else if(l>t){const e=l/t;l=t,n/=e}const r=parseInt(l.toString()),i=parseInt(n.toString());return s=Number((r/i).toFixed(2)),{canvasWidth:r,canvasHeight:i,scaleFactor:s,originWidth:e.width,originHeight:e.height}})(l);m.value=((t,a,l)=>t.labels?t.labels.map(t=>{const n=e.classes[t.type];return n&&(t.typeName=n),t.originWidth||(t.originWidth=a),t.originHeight||(t.originHeight=l),t}):[])(t,o,r),l.style.width=n+"px",l.style.height=s+"px",C(n,s),m.value=((e,t)=>{let a=[];for(let l=0;l<e.length;l++){const n=e[l],s=parseFloat((t/n.canvasHeight).toFixed(3));s&&(n.startX=Math.ceil(n.startX*s),n.startY=Math.ceil(n.startY*s),n.rectWidth=Math.ceil(n.rectWidth*s),n.rectHeight=Math.ceil(n.rectHeight*s),n.canvasWidth=Math.ceil(n.canvasWidth*s),n.canvasHeight=t),a.push(n)}return a})(m.value,s);const{updateLabels:i,addDrawRect:c,hitCanvasLabel:h}=(e=>{const{canvas:t,ctx:a,labels:l,image:n,canvasWidth:s,canvasHeight:o,scaleOffset:r}=e,i=()=>{t.width=s,r.value&&(a.save(),a.translate(r.value.x,r.value.y),a.scale(r.value.scale,r.value.scale)),a.clearRect(0,0,s,o),a.drawImage(n,0,0,s,o);const e=r.value?.scale||1,i=14/e,c=6/e,u=2/e;for(let e=0;e<l.length;e++){const t=l[e],{startX:n,startY:s,rectWidth:o,rectHeight:r,type:d}=t,h=vr[d%vr.length];if(a.font=`bold ${i}px serif`,a.textBaseline="top",a.save(),a.strokeStyle=h,a.lineWidth=u,a.strokeRect(n,s,o,r),ps(t.typeName)||ps(t.type)){const e=t.typeName||t.type;a.fillStyle=h,a.fillText(e,n+c,s+c)}a.restore()}};return i(),{updateLabels:i,addDrawRect:(e,t="#f30635")=>{const l=r.value?.scale||1,{startX:n,startY:s,rectWidth:o,rectHeight:i}=e;a.save();const c=2/l;a.lineWidth=c,a.strokeStyle=t,a.strokeRect(n,s,o,i),a.restore()},hitCanvasLabel:(e,t)=>{let a=null,n=null,s=null;for(let o=0;o<l.length;o++){const r=l[o],{type:i,startX:c,startY:u,rectWidth:d,rectHeight:h}=r;e>=c&&e<=c+d&&t>=u&&t<=u+h&&(a=r,n=o,s=vr[i])}return{hit_rect:a,hit_index:n,color:s}}}})({canvas:v.value,ctx:a,image:l,canvasWidth:n,canvasHeight:s,labels:m.value,scaleOffset:u.scaleTranslate});g.value.updateLabels=i,g.value.addDrawRect=c,g.value.hitCanvasLabel=h;const{clearCanvas:p,removeEventAll:b}=(({canvas:e,originWidth:t,originHeight:a},l,n)=>{const s=e.width,o=e.height,r=e?.getContext("2d"),i=()=>{r.clearRect(0,0,s,o)};i();let c,u,d,h,p=!1,v=!1,f=!1;const m=()=>{const e=Math.abs(d-c),n=Math.abs(h-u);c>d&&(c=d),u>h&&(u=h),l&&l({startX:c,startY:u,rectWidth:e,rectHeight:n,canvasWidth:s,canvasHeight:o,originWidth:t,originHeight:a},{endX:d,endY:h})},g=t=>{f||"KeyW"===t.code&&(t.preventDefault(),f=!0,e.style.cursor="crosshair",e.style.zIndex="11",n&&n())},b=t=>{p||"KeyW"===t.code&&(f=!1,e.style.cursor="unset",e.style.zIndex="0")},y=()=>{v&&(p=!1,f=!1,e.style.cursor="unset",e.style.zIndex="0",m(),v=!1)};document.addEventListener("keydown",g),document.addEventListener("keyup",b),document.addEventListener("mouseup",y);const x=e=>{f&&(p=!0,c=e.offsetX,u=e.offsetY)},w=e=>{p&&f&&(v=!0,d=e.offsetX,h=e.offsetY,M())},C=t=>{t.stopPropagation(),v&&(p=!1,f=!1,e.style.cursor="unset",e.style.zIndex="0",m(),v=!1)};e.addEventListener("mousedown",x),e.addEventListener("mousemove",w),e.addEventListener("mouseup",C);const M=(e="#f30635")=>{i(),r.strokeStyle=e,r.strokeRect(c,u,d-c,h-u)};return{canvas:e,ctx:r,clearCanvas:i,drawRect:M,removeEventAll:()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",b),document.removeEventListener("mouseup",y),e.removeEventListener("mousedown",x),e.removeEventListener("mousemove",w),e.removeEventListener("mouseup",C)}}})({canvas:f.value,originWidth:o,originHeight:r},(e,{endX:t,endY:a})=>{H.value=e;const l=((e,t)=>{const{startX:a,startY:l,rectWidth:n,rectHeight:s}=e,{scale:o,x:r,y:i}=t;return{startX:Math.ceil((a-r)/o),startY:Math.ceil((l-i)/o),rectWidth:Math.ceil(n/o),rectHeight:Math.ceil(s/o),canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,originWidth:e.originWidth,originHeight:e.originHeight}})(e,u.scaleTranslate.value);g.value.addDrawRect(l),O(t,a,l)},()=>{_()});g.value.clearCanvasRect=p,g.value.removeEventAll=b,x.value=new br(v.value),x.value.changeZoom(e=>{u.onChangeScaleTranslate(e),g.value.updateLabels()})},l.onerror=()=>{E.value=!1}}v.value.addEventListener("contextmenu",e=>{e.preventDefault();const t=e.offsetX,a=e.offsetY,{scale:l,x:n,y:s}=u.scaleTranslate.value,o=Math.floor((t-n)/l),r=Math.floor((a-s)/l),{hit_rect:i}=g.value.hitCanvasLabel(o,r);L(),_(),i&&y(()=>{O(t,a,i)})}),v.value.addEventListener("click",e=>{if(e.ctrlKey)return;const t=e.offsetX,a=e.offsetY,{scale:l,x:n,y:s}=u.scaleTranslate.value,o=Math.floor((t-n)/l),r=Math.floor((a-s)/l),{hit_rect:i,hit_index:c,color:d}=g.value.hitCanvasLabel(o,r);_(),L(),i&&y(()=>{A(t,a,i,c,d)})})};M(()=>{b(()=>e.rowInfo,e=>{const t=S(e);D(t)},{deep:!0,immediate:!0}),b(()=>e.classes,()=>{const t=S(e.rowInfo);D(t)}),b(()=>e.contextClientHeight,t=>{if(vs(t)){p.value.style.height=t+"px";const a=S(e.rowInfo);D(a)}})}),h(()=>{g.value.removeEventAll?.(),x.value.destroy()});const k=a({show:!1,top:0,left:0,activateRect:null}),O=(e,t,a)=>{const l=v.value.getBoundingClientRect();k.value.show=!0,k.value.left=e+l.x,k.value.top=t+l.y,k.value.canvasWidth=v.value.width,k.value.canvasHeight=v.value.height,k.value.activateRect=a,H.value=a},L=()=>{k.value.show=!1,k.value.top=0,k.value.left=0,k.value.activateRect=null,H.value=null,g.value.updateLabels(),g.value.clearCanvasRect()},T=l(()=>{const{top:e,left:t,canvasWidth:a,canvasHeight:l}=k.value;return{top:e,left:t,canvasWidth:a,canvasHeight:l}}),P=a({show:!1,top:0,left:0,width:0,height:0,activateRect:null,activateIndex:null,color:null}),A=(e,t,a,l,n)=>{P.value.show=!0,P.value.top=t,P.value.left=e,P.value.width=a.rectWidth,P.value.height=a.rectHeight,P.value.activateRect=a,P.value.activateIndex=l,P.value.color=n},_=()=>{P.value.show=!1,P.value.top=0,P.value.left=0,P.value.width=0,P.value.height=0,P.value.activateRect=null,P.value.activateIndex=null,P.value.color=null},j=e=>{P.value.activateRect=e;const t=m.value.findIndex(t=>jl(t,e));t>-1&&m.value.splice(t,1,e),g.value.updateLabels();const{rects:a,label_txt:l}=w();c("change",a,l),n("change",a,l)},z=(e,t)=>{e.preventDefault();const a=e.offsetX,l=e.offsetY,n=a+t.startX,s=l+t.startY;L(),y(()=>{O(n,s,t)})},H=a(),V=t=>{H.value.type=t;const a=e.classes[t];a&&(H.value.typeName=a);const l=m.value.findIndex(e=>jl(e,H.value));l>-1?m.value.splice(l,1,H.value):m.value.push(H.value),L();const{rects:s,label_txt:o}=w();c("change",s,o),n("change",s,o)},R=e=>{const t=m.value.findIndex(t=>jl(t,e));m.value.splice(t,1),L(),_(),g.value.updateLabels();const{rects:a,label_txt:l}=w();c("change",a,l),n("change",a,l)};return s({onCloseDraggableRectFixed:_,onCloseContentmenuLabel:L,onSelectedLabel:(e,t)=>{_(),y(()=>{const{startX:a,startY:l,type:n}=e,s=vr[n];A(a,l,m.value[t],t,s)})},onDeleteLabel:R,rerenderImage:()=>{C(0,0),L(),_(),y(()=>{const t=S(e.rowInfo);D(t)})},resetScaleOffset:()=>{x.value.reset()}}),()=>r(i,null,[r(nr,{ref:d,loading:E.value,class:[o.b("loading")]},{default:()=>[r("div",{ref:p,class:[o.b("canvas")]},[r("canvas",{ref:v,class:[o.be("canvas","context")]},null),r("canvas",{ref:f,class:[o.be("canvas","rect")]},null),k.value.show?r(gr,{labelRect:T.value,classes:e.classes,activateRect:k.value.activateRect,onClose:L,onSelect:V,onDelete:R},null):null,P.value.show?r(xr,{parentEl:p.value,rect:P.value.activateRect,color:P.value.color,onDraggleResize:j,onContextmenu:z},null):null])]})])}}),Cr=o({props:{contentHeight:{type:Number},classes:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]}},emits:["delete","select"],setup(e,{emit:l}){const{t:n}=Wl(),s=t("ns",{}),o=a([]),c=t=>t.length?t.map(t=>{const a=e.classes[t.type];return a&&(t.typeName=a),t}):[];b(()=>e.classes,()=>{o.value=c(o.value)}),b(()=>e.labels,e=>{const t=S(e);o.value=c(t)},{deep:!0,immediate:!0});return()=>r(i,null,[r("div",{class:[s.b("right")],style:{height:e.contentHeight+"px"}},[o.value.length?r("ul",null,[o.value.map((e,t)=>r("li",{key:t,onClick:()=>((e,t)=>{l("select",e,t)})(e,t)},[r("div",null,[r("span",{style:{"background-color":vr[e.type]},class:"label-line"},null),r("span",null,[e.typeName])]),r(be,{title:n("next.labelimg.confirmDeleteLabel"),width:200,onConfirm:()=>(e=>{l("delete",e)})(e)},{reference:()=>r(R,{size:16,color:"#ff0000",onClick:e=>{e.preventDefault(),e.stopPropagation()}},{default:()=>[r(En,null,null)]})})]))]):r(me,{"image-size":100,description:n("next.labelimg.emptyLabelText")},null)])])}}),Mr={minContentHeight:500};const Sr=Te("labelimg");var Er=o({name:"NextLabelimg",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["change","save","prev-click","next-click"],setup(e,{emit:t,slots:s,expose:o}){const{t:c}=Wl(),u=ds(Mr),d=l(()=>{const t=n(e.options);return zl(u,t)}),p=n(d);g("ns",Sr),g("_emit",t);const v=a(0),f=a(e.classes),m=a(ds(e.data));b(()=>e.data,e=>{m.value=ds(e)},{deep:!0}),b(()=>e.data.length,()=>{v.value=0}),b(()=>e.classes,e=>{f.value=e},{deep:!0});const x=l(()=>{if(!m.value)return{};const e=m.value[v.value]||{};return ds(e)}),w=a(x.value.labels||[]);b(()=>x.value,()=>{w.value=x.value.labels||[]});const C=e=>{x.value.labels=e,w.value=e},E=a(!1),D=()=>{const e=x.value;let t=[];return e.labels.forEach(e=>{delete e.typeName;const a=fr(e);t.push(a.join(" "))}),{node:e,label_txt:t.join("\n")}},k=()=>{const e=m.value[v.value];return jl(S(e.labels).map(e=>fr(e)),x.value.labels.map(e=>fr(e)))},O=e=>{const t=m.value.length;"KeyD"===e.code?(v.value++,v.value>=t&&(v.value=0)):"KeyA"===e.code&&(v.value--,v.value<0&&(v.value=t-1))},T=e=>{if(E.value)return;if(!["KeyA","KeyD"].includes(e.code))return;E.value=!0;const{node:a,label_txt:l}=D();if(z.value.onCloseDraggableRectFixed(),k())return O(e),void(E.value=!1);t("save",{node:a,label_txt:l},t=>{m.value[v.value]=t||a,O(e),E.value=!1},()=>{E.value=!1})},A=e=>{if(E.value)return;E.value=!0;const{node:a,label_txt:l}=D();return z.value.onCloseDraggableRectFixed(),k()?(v.value=e,E.value=!1,!1):(t("save",{node:a,label_txt:l},t=>{m.value[v.value]=t||a,v.value=e,E.value=!1,K.value={scale:1,x:0,y:0}},()=>{E.value=!1}),!0)},_=()=>{const e=m.value.length;let a=v.value-1;a<0&&(a=e-1),A(a),t("prev-click")},j=()=>{const e=m.value.length;let a=v.value+1;a>=e&&(a=0),A(a),t("next-click")},z=a(),H=a(),V=a(),I=a(),N=a(),B=a(p.minContentHeight),F=()=>{y(()=>{const e=(H.value?.clientHeight||0)-((V.value?.clientHeight||0)+(N.value?.clientHeight||0));B.value=e})};M(()=>{document.addEventListener("keydown",T),us(H.value.parentElement,()=>{F()}),window.addEventListener("resize",F)}),h(()=>{document.removeEventListener("keydown",T),window.removeEventListener("resize",F)});const Y=(e,t)=>{z.value.onSelectedLabel(e,t)},W=e=>{z.value.onDeleteLabel(e)},U=a(!1),$=e=>{U.value=e,F(),y(()=>{z.value.rerenderImage()})},K=a({scale:1,x:0,y:0});g("scaleTranslateManager",{scaleTranslate:K,onChangeScaleTranslate:e=>{K.value=e},onResetScaleTranslate:()=>{z.value.resetScaleOffset()}}),o({convertToLabel:fr,canvertToCanvas:mr});return()=>r(i,null,[r("div",{ref:H,class:[Sr.b(),e.className,U.value?Sr.b("fullscreen"):""],style:{...e.style}},[r(yo,{loading:E.value,tip:c("next.labelimg.saveTxt"),class:[Sr.b("loading")]},{default:()=>[r(P,null,{default:()=>[r("header",{ref:V,class:[Sr.b("header")]},[s.header?s.header():r(pr,{isFullscreen:U.value,imageIndex:v.value,imageLength:m.value.length,onFullscreen:$,onSave:()=>{A(v.value)||L({type:"info",message:c("next.labelimg.labelNoUpdate")})}},null)]),r("div",{ref:I,class:[Sr.b("main")]},[r(P,{class:[Sr.be("main","content")]},{default:()=>[r("div",{class:[Sr.be("main","content")],style:{height:B.value+"px"}},[r(wr,{ref:z,contextClientHeight:B.value,classes:f.value,rowInfo:x.value,onChange:C},null)])]}),r(Cr,{contentHeight:B.value,classes:f.value,labels:w.value,onDelete:W,onSelect:Y},null)]),r("footer",{ref:N,class:[Sr.b("footer")]},[r("div",{class:[Sr.be("footer","left")]},[r(R,{size:24,color:"#797979",onClick:_},{default:()=>[r(gn,null,null)]})]),r("div",{class:[Sr.be("footer","center")]},[r(P,null,{default:()=>[r("ul",{class:[Sr.bem("footer","center","list")]},[m.value.map((e,t)=>r("li",{key:t,onClick:()=>A(t),class:{"is-activate":v.value===t}},[r(he,{style:"height: 100%",src:e.imageSrc,"zoom-rate":1.2,"max-scale":2,"min-scale":.2,fit:"cover"},null)]))])]})]),r("div",{class:[Sr.be("footer","right")]},[r(R,{size:24,color:"#797979",onClick:j},{default:()=>[r(bn,null,null)]})])])]})]})])])}});const Dr=Te("labelimg-preview");var kr=o({name:"NextLabelimgPreview",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},src:{type:String,default:""},classes:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]}},setup(e){const t=a(),l=a(ds(e.classes)),n=a(ds(e.labels));return M(()=>{b(()=>e.src,()=>{(()=>{if(e.src){const a=t.value?.getContext("2d"),s=new Image;s.src=e.src,s.onload=()=>{const{width:e,height:o}=s,r=o,i=r/o,c=Math.ceil(e*i);((e,a)=>{t.value.width=e,t.value.height=a,t.value.style.width=e+"px",t.value.style.height=a+"px"})(c,r),a.clearRect(0,0,c,r),a.drawImage(s,0,0,c,r);for(let e=0;e<n.value.length;e++){const t=n.value[e],{startX:s,startY:o,rectWidth:r,rectHeight:i,type:c}=t,u=vr[c%vr.length];if(a.font="bold 14px serif",a.textBaseline="top",a.save(),a.strokeStyle=u,a.strokeRect(s,o,r,i),!ps(t.typeName)){const e=l.value[t.type];e&&(t.typeName=e)}if(ps(t.typeName)||ps(t.type)){const e=t.typeName||t.type;a.fillStyle=u,a.fillText(e,s+6,o+6)}a.restore()}}}})()},{immediate:!0})}),()=>r(i,null,[r("div",{class:[Dr.b(),e.className],style:{...e.style}},[r("canvas",{ref:t},null)])])}});const Or=on(Er),Lr=on(kr);var Tr,Pr;!function(e){e.Polygon="polygon",e.Rectangle="rectangle",e.Circle="circle",e.Keypoint="keypoint"}(Tr||(Tr={})),function(e){e.CREATE_POLYGON="createPolygon",e.EDIT_SHAPE="editShape",e.CREATE_RECTANGLE="createRectangle",e.CREATE_CIRCLE="createCircle",e.CREATE_KEYPOINT="createKeypoint"}(Pr||(Pr={}));const Ar="#5470c6",_r=["#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"];var jr={minContentHeight:500},zr=o({props:{fixed:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},activateShape:{type:Object,default:null}},emits:["close","select","delete"],setup(e,{emit:n}){const{t:s}=Wl(),o=t("ns",{}),c=a(e.activateShape.group_id||""),u=a(e.activateShape.description||""),d=()=>{n("close")},h=()=>{n("delete",e.activateShape)},p=a();b(()=>e.activateShape,()=>{const{label:t}=e.activateShape;p.value=ps(t)?t:null},{deep:!0,immediate:!0});const v=a({width:0,height:0});M(()=>{const{clientWidth:e,clientHeight:t}=g.value;v.value.width=e,v.value.height=t});const g=a(),y=l(()=>{const{left:t,top:a}=e.fixed,l=a+v.value.height-window.innerHeight;let n=a;return l>0&&(n-=l),{top:n+"px",left:t+"px"}}),x=()=>{let t;return r(m,{to:"body"},{default:()=>{return[r("div",{ref:g,class:[o.b("contextmenu-label")],style:y.value},[r("div",{class:"label-head"},[r("span",{style:"padding-right: 30px"},[s("next.labelme.selectClasses")]),r(R,{size:16,onClick:d},{default:()=>[r(Cn,null,null)]})]),e.classes.length?r(i,null,[r($,{modelValue:c.value,"onUpdate:modelValue":e=>c.value=e,placeholder:s("next.labelme.labelGroupId"),size:"small",maxLength:30},null),r("ul",{class:"label-main"},[e.classes.map((t,a)=>r("li",{key:a,onClick:()=>(t=>{p.value=t;const a={...e.activateShape,label:t,description:u.value,group_id:c.value};n("select",t,a)})(t),class:{"activate-label":p.value===t}},[r("span",{style:{"background-color":_r[a%_r.length]},class:"label-line"},null),r("span",null,[t])]))]),r($,{modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,placeholder:s("next.labelme.labelDescription"),size:"small",type:"textarea",rows:2,resize:"none",maxLength:100},null)]):r(me,{"image-size":50,description:s("next.labelme.emptyClassesText"),style:{padding:0}},null),ps(p.value)?r("div",{style:"margin: 10px auto 0"},[r(te,{icon:En,plain:!0,size:"small",type:"danger",onClick:h},(a=t=s("next.labelme.deleteClasses"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!f(a)?t:{default:()=>[t]}))]):null])];var a}})};return()=>r(i,null,[x()])}});const Hr=e=>{const t=new Path2D;if(e.length){t.moveTo(e[0][0],e[0][1]);for(let a=1;a<e.length;a++){const[l,n]=e[a];t.lineTo(l,n)}}return t},Vr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=Hr(a);return n.closePath(),l.isPointInPath(n,e,t)},Rr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i],[c,u]]=a;return s>=r&&s<=c&&o>=i&&o<=u},Ir=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i],[c,u]]=a,d=Math.sqrt(Math.pow(c-r,2)+Math.pow(u-i,2));return Br(s,o,r,i,d)},Nr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;if(0===a.length)return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i]]=a;return Br(s,o,r,i,5)},Br=(e,t,a,l,n)=>Math.sqrt(Math.pow(e-a,2)+Math.pow(t-l,2))<n,Fr=e=>Array.from(new Set(e.map(e=>JSON.stringify(e)))).map(e=>JSON.parse(e)),Yr=e=>{const t=e.getTransform(),{a:a,b:l,e:n,f:s}=t;return{scale:Math.hypot(a,l),translateX:n,translateY:s}},Wr=(e,t,a,l=!0)=>e?.length?e.map(e=>((e,t,a,l=!0)=>{const[n,s]=e;return l?[n*t,s*a]:[n/t,s/a]})(e,t,a,l)):[],Ur=(e,t)=>{const{scale:a,x:l,y:n}=t,[s,o]=e;return[(s-l)/a,(o-n)/a]},$r=(e,t)=>{const{scale:a,x:l,y:n}=t,[s,o]=e;return[s*a+l,o*a+n]},{hexToRgba:Kr}=ql();class Xr{canvas;ctx;vertexes;isDrawing;mouseOffset;vertexesObservers=[];destroyedObservers=[];constructor(e,t){this.canvas=e,this.ctx=t,this.isDrawing=!1,this.vertexes=[],this.mouseOffset={x:0,y:0},this.vertexes=new Proxy(this.vertexes,{set:(e,t,a)=>(e[t]=a,this.notifyVertexChangeListeners(),!0)}),this.mouseOffset=new Proxy(this.mouseOffset,{set:(e,t,a)=>(e[t]=a,this.notifyVertexChangeListeners(),!0)}),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseDblclick=this.canvasMouseDblclick.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this)}notifyVertexChangeListeners(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}vertexesChangeEventListener(e){this.vertexesObservers.push(e)}notifyAddCompletedListener(){this.destroyedObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}addCompleted(e){this.destroyedObservers.push(e)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}triggerCreatePolygon(){this.isDrawing=!0,this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("dblclick",this.canvasMouseDblclick)}canvasMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a;let l=!0;for(let e=0;e<this.vertexes.length;e++){const n=this.vertexes[e];if(Math.sqrt((t-n[0])**2+(a-n[1])**2)<8){l=!1;break}}l&&this.vertexes.push([t,a]),this.vertexes=Fr(this.vertexes)}canvasMousemove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&this.isDrawing){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.canvas.style.cursor="crosshair"}}canvasMouseDblclick(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes.push([t,a]),this.vertexes=Fr(this.vertexes)}this.notifyAddCompletedListener(),this.isDrawing=!1}}drawPolygon(e){const t=this.ctx;if(!e.length)return;const{scale:a}=Yr(this.ctx);t.save();const{x:l,y:n}=this.mouseOffset,s=Hr([...e,[l,n]]);s.closePath();const o=Ar;t.beginPath(),t.lineWidth=2/a,t.setLineDash([5,5]),t.strokeStyle=o,t.fillStyle=Kr(o,.2),t.stroke(s),t.fill(s),t.fillStyle=o;for(let l=0;l<e.length;l++){const[n,s]=e[l];t.beginPath(),t.arc(n,s,5/a,0,2*Math.PI),t.fill()}t.restore()}reset(){this.isDrawing=!0,this.vertexes.length=0,this.mouseOffset.x=0,this.mouseOffset.y=0}destroy(){this.isDrawing=!1,this.vertexes.length=0,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.style.cursor="unset",this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("dblclick",this.canvasMouseDblclick)}}const{hexToRgba:qr}=ql();class Gr{canvas;ctx;imageScaleX=1;imageScaleY=1;vertexes;mouseMoveOffset;isEditing;isMoveEditing;canClickEvent;pointVertexIndex;pointCentreIndex;vertexRadius;edgeCentreRadius;pointRecover;observers=[];editPolygonObserver;contextmenuObserver;constructor(e,t,a,l){this.canvas=e,this.ctx=t,this.imageScaleX=a,this.imageScaleY=l,this.vertexes=[],this.isEditing=!1,this.canClickEvent=!0,this.isMoveEditing=!1,this.pointVertexIndex=-1,this.pointCentreIndex=-1,this.vertexRadius=8,this.edgeCentreRadius=5,this.pointRecover=[],this.canvasMousedown=this.canvasMousedown.bind(this),this.canvasMouseup=this.canvasMouseup.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}notifyEditPolygonObserver(){this.editPolygonObserver?.(this.vertexes)}onEditPolygon(e){this.editPolygonObserver=e}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawPolygonPath(e,t,a){const l=this.ctx;if(!e.length)return;const{scale:n}=Yr(this.ctx),s=Ar;l.save(),l.beginPath(),l.lineWidth=2/n,l.strokeStyle=s,l.fillStyle=qr(s,.2),l.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++){const[a,n]=e[t];l.lineTo(a,n)}isNaN(t)||isNaN(a)||l.lineTo(t,a),l.closePath(),l.stroke(),l.fill(),l.restore()}drawPolygonEdgeCentre(e){const t=this.ctx,{scale:a}=Yr(this.ctx),l=this.vertexRadius/a,n=this.edgeCentreRadius/a,s=Math.max(1,l-n),o=Ar;t.save();for(let a=0;a<e.length;a++){const[n,r]=e[a];t.beginPath(),t.fillStyle=o,t.arc(n,r,l,0,2*Math.PI),t.closePath(),t.fill(),t.beginPath(),t.fillStyle="#FFFFFF",t.arc(n,r,s,0,2*Math.PI),t.closePath(),t.fill()}for(let a=0;a<e.length;a++){const l=e[a%e.length],s=e[(a+1)%e.length],r=l[0]+(s[0]-l[0])/2,i=l[1]+(s[1]-l[1])/2;t.beginPath(),t.fillStyle=o,t.arc(r,i,n,0,2*Math.PI),t.closePath(),t.fill()}t.restore()}render(){this.drawPolygonPath(this.vertexes),this.drawPolygonEdgeCentre(this.vertexes)}drawPolygon(e,t){this.vertexes=e,t?this.drawPolygonPath(e,t.x,t.y):(this.drawPolygonPath(e),this.drawPolygonEdgeCentre(e))}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}pointInVertexes(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.vertexRadius/n,o=this.vertexes;let r=null;for(let e=0;e<o.length;e++){const[t,n]=o[e];if(Br(a,l,t,n,s)){r=e;break}}return this.updateCanvasCursor(null!==r),r}pointInEdgeCentre(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.edgeCentreRadius/n,o=this.vertexes;let r=null;for(let e=0;e<o.length;e++){const t=o[e%o.length],n=o[(e+1)%o.length],i=t[0]+(n[0]-t[0])/2,c=t[1]+(n[1]-t[1])/2;if(Br(a,l,i,c,s)){r=e;break}}return this.updateCanvasCursor(null!==r),r}pointInVertexesOrEdgeCentre(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.vertexRadius/n,o=this.edgeCentreRadius/n,r=this.vertexes;let i=null;for(let e=0;e<r.length;e++){const[t,n]=r[e],c=Br(a,l,t,n,s),u=r[e%r.length],d=r[(e+1)%r.length],h=u[0]+(d[0]-u[0])/2,p=u[1]+(d[1]-u[1])/2,v=Br(a,l,h,p,o);if(c||v){i=e;break}}return this.updateCanvasCursor(null!==i),i}notifyObservers(){this.observers.forEach(e=>{e(this.vertexes)})}updatePolygon(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMousedown),this.canvas.addEventListener("mouseup",this.canvasMouseup),this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.observers.push(e))}canvasMousedown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.canClickEvent=!0;const{offsetX:t,offsetY:a}=e;this.pointRecover=[t,a];const l=this.pointInVertexes(t,a);ps(l)&&(this.isMoveEditing=!0,this.pointVertexIndex=l,this.vertexes.splice(this.pointVertexIndex,1,[t,a]));const n=this.pointInEdgeCentre(t,a);ps(n)&&(this.isMoveEditing=!0,this.pointCentreIndex=n+1,this.vertexes.splice(this.pointCentreIndex,0,[t,a])),setTimeout(()=>{this.canClickEvent=!1},200),Vr(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset=[t,a])}canvasMousemove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexesOrEdgeCentre(t,a),[n,s]=this.getTransformPoint(t,a);if(this.isMoveEditing)return this.pointVertexIndex>-1&&this.vertexes.splice(this.pointVertexIndex,1,[n,s]),this.pointCentreIndex>-1&&this.vertexes.splice(this.pointCentreIndex,1,[n,s]),void this.notifyObservers();if(!ps(l)&&(Vr(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset[0],this.mouseMoveOffset[1]),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.notifyObservers(),this.mouseMoveOffset=[t,a]}}canvasMouseup(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;let{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);this.vertexes=Fr(this.vertexes);for(let e=0;e<this.vertexes.length;e++){const t=this.vertexes[e],a=Math.sqrt((l-t[0])**2+(n-t[1])**2);if(a<8&&a>0&&this.pointRecover.length){l=this.pointRecover[0],n=this.pointRecover[1],this.pointRecover=[];break}}this.pointVertexIndex>-1&&this.vertexes.splice(this.pointVertexIndex,1,[l,n]),this.pointCentreIndex>-1&&this.vertexes.splice(this.pointCentreIndex,1,[l,n]),this.isMoveEditing=!1,this.mouseMoveOffset=null,this.pointVertexIndex=-1,this.pointCentreIndex=-1,this.notifyEditPolygonObserver()}canvasMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;if(this.canClickEvent){const e=this.pointInVertexes(t,a);if(ps(e)){if(this.vertexes.length<=3)return;this.vertexes.splice(e,1),this.drawPolygon(this.vertexes),this.notifyObservers(),this.notifyEditPolygonObserver()}}}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Vr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}destroy(){this.vertexes=[],this.observers=[],this.isEditing=!1,this.canClickEvent=!1,this.canvas.removeEventListener("mousedown",this.canvasMousedown),this.canvas.removeEventListener("mouseup",this.canvasMouseup),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:Zr}=ql();class Jr{canvas;ctx;vertexes;isDrawing;mouseOffset;vertexesObservers=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.isDrawing=!1,this.vertexes=[],this.mouseOffset={x:0,y:0},this.vertexes=new Proxy(this.vertexes,{set:(e,t,a)=>(e[t]=a,this.notifyVertexesChange(),!0)}),this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this)}subscribeVertexesChange(e){this.vertexesObservers.push(e)}notifyVertexesChange(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp)}reset(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0}stop(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp)}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]]}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&(this.canvas.style.cursor="crosshair",this.isDrawing)){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.notifyVertexesChange()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.vertexes.push([t,a]),2===Fr(this.vertexes).length&&this.notifyDrawComplete()}this.isDrawing=!1}}drawRectangle(e){if(e.length<1)return;const t=this.ctx,{scale:a}=Yr(t),{x:l,y:n}=this.mouseOffset,s=e[0][0],o=e[0][1],r=e[1]?.[0]??l,i=e[1]?.[1]??n,c=Ar;t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=c,t.fillStyle=Zr(c,.2),t.strokeRect(s,o,r-s,i-o),t.fillRect(s,o,r-s,i-o),t.restore()}destroy(){this.stop()}}const{hexToRgba:Qr}=ql();class ei{canvas;ctx;shape;anchorRadius=4;anchorVertexIndex=null;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}offEditing(e){this.editingObservers=this.editingObservers.filter(t=>t!==e)}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawRectangle(e){if(!e?.length)return;this.vertexes=e;const[t,a]=e[0],[l,n]=e[1],s=this.ctx,{scale:o}=Yr(s),r=Ar;s.save(),s.beginPath(),s.lineWidth=2/o,s.strokeStyle=r,s.fillStyle=Qr(r,.2),s.strokeRect(t,a,l-t,n-a),s.fillRect(t,a,l-t,n-a),s.restore()}drawVertexAnchors(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=Ar,n=this.anchorRadius/a;t.save(),t.lineWidth=2/a,t.strokeStyle=l,t.fillStyle="#ffffff";for(const a of e){const[e,l]=a;t.beginPath(),t.rect(e-n,l-n,2*n,2*n),t.fill(),t.stroke(),t.closePath()}t.restore()}pointInVertexAnchors(e,t){const a=this.vertexes;if(!a?.length)return null;const l=this.ctx,{scale:n}=Yr(l),s=this.anchorRadius/n;let o=null;for(let n=0;n<a.length;n++){const[r,i]=a[n];if(Rr(e,t,[[r-s,i-s],[r+s,i+s]],l)){o=n;break}}return this.updateCanvasCursor(null!==o),o}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);ps(l)&&(this.isMoveEditing=!0,this.vertexes[l]=[t,a],this.anchorVertexIndex=l),Rr(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset={x:t,y:a})}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);if(this.isMoveEditing){const[e,l]=this.getTransformPoint(t,a),n=fl(this.vertexes);n[this.anchorVertexIndex]=[e,l];const s=Math.abs(n[0][0]-n[1][0]),o=Math.abs(n[0][1]-n[1][1]);return s>20&&o>20&&(this.vertexes[this.anchorVertexIndex]=[e,l]),void this.notifyEditing()}if(!ps(l)&&(Rr(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(ps(this.anchorVertexIndex)){const e=fl(this.vertexes);e[this.anchorVertexIndex]=[l,n];const t=Math.abs(e[0][0]-e[1][0]),a=Math.abs(e[0][1]-e[1][1]);t>20&&a>20&&(this.vertexes[this.anchorVertexIndex]=[l,n])}this.isMoveEditing=!1,this.anchorVertexIndex=null,this.mouseMoveOffset=null,this.notifyEditCompleted()}canvasMouseClick(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Rr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}render(){this.drawRectangle(this.vertexes),this.drawVertexAnchors(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.editingObservers=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:ti}=ql();class ai{canvas;ctx;isDrawing=!1;mouseOffset;vertexes=[];vertexesObservers=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.mouseOffset={x:0,y:0},this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this)}subscribeVertexesChange(e){this.vertexesObservers.push(e)}notifyVertexesChange(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp)}reset(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0}stop(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp)}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]]}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&(this.canvas.style.cursor="crosshair",this.isDrawing)){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.notifyVertexesChange()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.vertexes.push([t,a]),2===Fr(this.vertexes).length&&this.notifyDrawComplete()}this.isDrawing=!1}}drawCircle(e){if(e.length<1)return;const t=this.ctx,{scale:a}=Yr(t),{x:l,y:n}=this.mouseOffset,s=e[0][0],o=e[0][1],r=e[1]?.[0]??l,i=e[1]?.[1]??n,c=Ar;t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=c,t.fillStyle=ti(c,.2),t.arc(s,o,Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2)),0,2*Math.PI),t.stroke(),t.fill()}destroy(){this.stop()}}const{hexToRgba:li}=ql();class ni{canvas;ctx;shape;anchorRadius=4;anchorVertexIndex=null;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}offEditing(e){this.editingObservers=this.editingObservers.filter(t=>t!==e)}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawCircle(e){if(!e?.length)return;this.vertexes=e;const[[t,a],[l,n]]=e,s=Math.sqrt(Math.pow(l-t,2)+Math.pow(n-a,2)),o=this.ctx,r=Ar;o.save(),o.beginPath(),o.strokeStyle=r,o.fillStyle=li(r,.2),o.arc(t,a,s,0,2*Math.PI),o.stroke(),o.fill(),o.restore()}drawVertexAnchors(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=Ar,n=this.anchorRadius/a;t.save(),t.lineWidth=2/a,t.strokeStyle=l,t.fillStyle="#ffffff";for(const a of e){const[e,l]=a;t.beginPath(),t.rect(e-n,l-n,2*n,2*n),t.fill(),t.stroke(),t.closePath()}t.restore()}pointInVertexAnchors(e,t){const a=this.vertexes;if(!a?.length)return null;const l=this.ctx,{scale:n}=Yr(l),s=this.anchorRadius/n;let o=null;for(let n=0;n<a.length;n++){const[r,i]=a[n];if(Rr(e,t,[[r-s,i-s],[r+s,i+s]],l)){o=n;break}}return this.updateCanvasCursor(null!==o),o}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);ps(l)&&(this.isMoveEditing=!0,this.vertexes[l]=[t,a],this.anchorVertexIndex=l),Ir(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset={x:t,y:a})}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);if(this.isMoveEditing){const[e,l]=this.getTransformPoint(t,a),n=fl(this.vertexes);n[this.anchorVertexIndex]=[e,l];const[[s,o],[r,i]]=n;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2))>20&&(this.vertexes[this.anchorVertexIndex]=[e,l]),void this.notifyEditing()}if(!ps(l)&&(Ir(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(ps(this.anchorVertexIndex)){const e=fl(this.vertexes);e[this.anchorVertexIndex]=[l,n];const[[t,a],[s,o]]=e;Math.sqrt(Math.pow(s-t,2)+Math.pow(o-a,2))>20&&(this.vertexes[this.anchorVertexIndex]=[l,n])}this.isMoveEditing=!1,this.anchorVertexIndex=null,this.mouseMoveOffset=null,this.notifyEditCompleted()}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Ir(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}render(){this.drawCircle(this.vertexes),this.drawVertexAnchors(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.editingObservers=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:si}=ql();class oi{canvas;ctx;mouseOffset;vertexes=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.mouseOffset={x:0,y:0},this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this)}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("mousemove",this.canvasMouseMove)}stop(){this.reset(),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("mousemove",this.canvasMouseMove)}reset(){this.vertexes=[],this.mouseOffset.x=0,this.mouseOffset.y=0}canvasMouseClick=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]],this.render(),this.notifyDrawComplete()};canvasMouseMove=e=>{e.stopPropagation(),e.preventDefault(),e.ctrlKey||(this.canvas.style.cursor="crosshair")};draw(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=5/a;t.save(),t.fillStyle=si(Ar,1),t.beginPath(),t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.fill(),t.restore()}render(){this.draw(this.vertexes)}destroy(){this.stop()}}class ri{canvas;ctx;shape;radius=5;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvas.addEventListener("mousedown",this.canvasMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.canvasMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.canvasMouseUp.bind(this)),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu.bind(this))}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}canvasMouseDown=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);Nr(l,n,this.vertexes,this.ctx)&&(this.isMoveEditing=!0,this.mouseMoveOffset={x:t,y:a})};canvasMouseMove=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;if(!this.isMoveEditing)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(this.mouseMoveOffset){const[e,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=l-e,r=n-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}};canvasMouseUp=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;if(!this.isMoveEditing)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);this.vertexes=[[l,n]],this.isEditing=!1,this.isMoveEditing=!1,this.mouseMoveOffset=null,this.notifyEditCompleted()};canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Nr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}draw(e){if(!e?.length)return;this.vertexes=e;const t=this.ctx,{scale:a}=Yr(t),l=this.radius/a;t.save(),t.fillStyle=Ar,t.beginPath(),t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.fill(),t.restore(),t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle="#ffffff",t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.stroke(),t.restore()}render(){this.draw(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:ii}=ql();class ci{canvas;ctx;image;canvasWidth;canvasHeight;imageScaleX;imageScaleY;labels;createPolygon;editDrawPolygon;createRectangle;editDrawRectangle;createCircle;editDrawCircle;createKeypoint;editDrawKeypoint;addVertexes=[];createCompleteSubscribers=new Set;editingShape;editVertexes=[];editingSubscribers=new Set;activeShapeObserver;contextmenuShapeObserver;constructor(e){const{canvas:t,ctx:a,image:l,canvasWidth:n,canvasHeight:s,imageScaleX:o,imageScaleY:r,labels:i}=e;this.canvas=t,this.ctx=a,this.image=l,this.canvasWidth=n,this.canvasHeight=s,this.imageScaleX=o,this.imageScaleY=r,this.labels=i||{},this.createPolygon=new Xr(t,a),this.editDrawPolygon=new Gr(t,a,o,r),this.createRectangle=new Jr(t,a),this.editDrawRectangle=new ei(t,a),this.createCircle=new ai(t,a),this.editDrawCircle=new ni(t,a),this.createKeypoint=new oi(t,a),this.editDrawKeypoint=new ri(t,a),this.createPolygon.vertexesChangeEventListener(e=>{this.render(),this.createPolygon.drawPolygon(e),this.addVertexes=e}),this.createPolygon.addCompleted((e,t)=>{this.addVertexes=e;const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.notifyCreateComplete({x:s,y:o},Tr.Polygon)}),this.createRectangle.subscribeVertexesChange(e=>{this.render(),this.createRectangle.drawRectangle(e)}),this.createRectangle.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Rectangle)}),this.createCircle.subscribeVertexesChange(e=>{this.render(),this.createCircle.drawCircle(e)}),this.createCircle.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Circle)}),this.createKeypoint.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Keypoint)}),this.render(),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseClick=this.onMouseClick.bind(this),this.onMouseDoubleClick=this.onMouseDoubleClick.bind(this)}subscribeCreateComplete(e){this.createCompleteSubscribers.add(e)}unsubscribeCreateComplete(e){this.createCompleteSubscribers.delete(e)}notifyCreateComplete(e,t){this.createCompleteSubscribers.forEach(a=>{a(this.addVertexes,e,t??Tr.Polygon)})}onStartCreatePolygon(){this.createPolygon.triggerCreatePolygon()}subscribeEditing(e){this.editingSubscribers.add(e)}unsubscribeEditing(e){this.editingSubscribers.delete(e)}notifyEditing(){this.editingSubscribers.forEach(e=>{e(this.editVertexes,this.editingShape)})}subscribeActiveShape(e){this.activeShapeObserver=e}unsubscribeActiveShape(){this.activeShapeObserver=null}notifyActiveShape(e){this.activeShapeObserver?.(e)}subscribeContextmenuShape(e){this.contextmenuShapeObserver=e}notifyContextmenuShape(e,t){this.contextmenuShapeObserver?.(e,t)}onStartCreateRectangle(){this.createRectangle.start()}onStartCreateCircle(){this.createCircle.start()}onStartCreateKeypoint(){this.createKeypoint.start()}resetAllInstance(){this.onCreateEnd(),this.onEditorEnd(),this.render()}closeCreateOrEditor(){this.createPolygon.reset(),this.createRectangle.reset(),this.createCircle.reset(),this.createKeypoint.reset()}drawShapes(e){const t=this.ctx,{scale:a}=Yr(t),l=12/a,n=6/a;t.font=`bold ${l}px serif`,t.textBaseline="top";for(let l=0;l<e.length;l++){const s=e[l];if(s.id===this.editingShape?.id){this.editingShape=s;continue}const o=Wr(s.points,this.imageScaleX,this.imageScaleY);if(!o.length)continue;const r=_r[l%_r.length];if(s.shape_type===Tr.Polygon){const e=Hr(o);e.closePath(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.stroke(e),t.fill(e),t.fillStyle=r,t.fillText(s.label,o[0][0]+n,o[0][1]+n)}else if(s.shape_type===Tr.Rectangle){const[[e,l],[i,c]]=o;t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.strokeRect(e,l,i-e,c-l),t.fillRect(e,l,i-e,c-l),t.fillStyle=r,t.fillText(s.label,o[0][0]+n,o[0][1]+n)}else if(s.shape_type===Tr.Circle){const[[e,l],[n,i]]=o;t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.arc(e,l,Math.sqrt(Math.pow(n-e,2)+Math.pow(i-l,2)),0,2*Math.PI),t.stroke(),t.fill(),t.fillStyle=r,t.textBaseline="middle",t.textAlign="center",t.fillText(s.label,o[0][0],o[0][1])}else if(s.shape_type===Tr.Keypoint){const[[e,l]]=o,i=5/a;t.beginPath(),t.arc(e,l,i,0,2*Math.PI),t.fillStyle=r,t.fill(),t.fillStyle=r,t.textBaseline="middle",t.textAlign="center",t.fillText(s.label,e,l+n+i)}}}updateTransform(e){const t=this.ctx,{scale:a,x:l,y:n}=e;t.translate(l,n),t.scale(a,a)}updateLabelInfo(e){this.labels=e,this.onResetHitShape()}render=()=>{const e=this.ctx;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvasWidth,this.canvasHeight),e.restore(),e.drawImage(this.image,0,0,this.canvasWidth,this.canvasHeight),e.save();const t=this.labels.shapes;t?.length&&this.drawShapes(t),this.editDrawPolygon.render(),this.editDrawRectangle.render(),this.editDrawCircle.render(),this.editDrawKeypoint.render(),e.restore()};mouseHitShape(e){const{offsetX:t,offsetY:a}=e,l=this.labels.shapes;let n=!1,s=null;for(let e=0;e<l.length;e++){const o=l[e],r=Wr(o.points,this.imageScaleX,this.imageScaleY);if(r.length)if(o.shape_type===Tr.Polygon){if(Vr(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Rectangle){if(Rr(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Circle){if(Ir(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Keypoint&&Nr(t,a,r,this.ctx)){n=!0,s=o;break}}return this.canvas.style.cursor=n?"pointer":"default",s}triggerShapeEdit(e){this.editingShape=e,this.notifyActiveShape(e);const t=Wr(e.points,this.imageScaleX,this.imageScaleY);e.shape_type===Tr.Polygon?(this.editDrawPolygon.drawPolygon(t),this.editDrawPolygon.updatePolygon(e=>{this.editVertexes=e,this.render()}),this.editDrawPolygon.onEditPolygon(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawPolygon.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Rectangle?(this.editDrawRectangle.drawRectangle(t),this.editDrawRectangle.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawRectangle.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawRectangle.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Circle?(this.editDrawCircle.drawCircle(t),this.editDrawCircle.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawCircle.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawCircle.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Keypoint&&(this.editDrawKeypoint.draw(t),this.editDrawKeypoint.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawKeypoint.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()})),this.render()}onSelectShape(e){this.editingShape?.id&&this.editingShape.id===e?.id||(this.onResetHitShape(),e&&this.triggerShapeEdit(e))}onResetHitShape(){this.editingShape=null,this.editVertexes=[],this.editDrawPolygon.destroy(),this.editDrawRectangle.destroy(),this.editDrawCircle.destroy(),this.editDrawKeypoint.destroy(),this.render()}onMouseDoubleClick(e){e.stopPropagation(),e.preventDefault(),this.mouseHitShape(e)||this.onResetHitShape()}onMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const t=this.mouseHitShape(e);this.editVertexes.length&&!t||this.onSelectShape(t)}onMouseDown(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape}onMouseMove(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape||this.mouseHitShape(e)}onMouseUp(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape}onEditorStart(){this.canvas.addEventListener("mousedown",this.onMouseDown),this.canvas.addEventListener("mousemove",this.onMouseMove),this.canvas.addEventListener("mouseup",this.onMouseUp),this.canvas.addEventListener("click",this.onMouseClick),this.canvas.addEventListener("dblclick",this.onMouseDoubleClick)}onEditorEnd(){this.editVertexes=[],this.editingShape=null,this.editDrawPolygon.destroy(),this.editDrawRectangle.destroy(),this.editDrawCircle.destroy(),this.canvas.removeEventListener("mousedown",this.onMouseDown),this.canvas.removeEventListener("mousemove",this.onMouseMove),this.canvas.removeEventListener("mouseup",this.onMouseUp),this.canvas.removeEventListener("click",this.onMouseClick),this.canvas.removeEventListener("dblclick",this.onMouseDoubleClick)}onCreateEnd(){this.createCircle.destroy(),this.createRectangle.destroy(),this.createPolygon.destroy(),this.createKeypoint.destroy()}destroy(){this.labels={},this.onCreateEnd(),this.onEditorEnd()}}var ui=o({props:{contextClientHeight:{type:Number,default:null},labelInfo:{type:Object,default:()=>({})}},emits:["editPolygon","changePolygon","updateLabelInfo","selectShape"],setup(e,{emit:n,expose:s}){const o=t("ns",{}),c=t("classes",a([])),u=t("toolsActive",{}),d=t("changeToolsActive"),p=t("scaleTranslateManager",{}),v=a(),f=a(),m=a(),g=a(),x=a(),w=a(e.labelInfo),C=a(!1),E=e=>{const t=m.value?.getContext("2d");if(e?.imageSrc){const a=new Image;a.src=e.imageSrc,C.value=!0,a.onload=()=>{C.value=!1;const{canvasWidth:l,canvasHeight:s,scaleX:o,scaleY:r,originWidth:i,originHeight:c}=(e=>{const t=v.value?.elementInstance.clientWidth,a=v.value?.elementInstance.clientHeight;let{width:l,height:n}=e,s=1;const o=l/n;if(o>1?(l=t,n=t/o):(l=a*o,n=a),n>a){const e=n/a;n=a,l/=e}else if(l>t){const e=l/t;l=t,n/=e}const r=parseInt(l.toString()),i=parseInt(n.toString());s=Number((r/i).toFixed(2));const c=(r/e.width).toFixed(8),u=(i/e.height).toFixed(8);return{canvasWidth:r,canvasHeight:i,scaleFactor:s,scaleX:Number(c),scaleY:Number(u),originWidth:e.width,originHeight:e.height}})(a);a.style.width=l+"px",a.style.height=s+"px",((e,t)=>{f.value.style.width=e+"px",f.value.style.height=t+"px",m.value.width=e,m.value.height=t,m.value.style.width=e+"px",m.value.style.height=t+"px"})(l,s),g.value=new ci({canvas:m.value,ctx:t,image:a,canvasWidth:l,canvasHeight:s,labels:e.labels,imageScaleX:o,imageScaleY:r}),x.value=new br(m.value),x.value.changeZoom(e=>{p.onChangeScaleTranslate(e),g.value.updateTransform(e),g.value.render()}),g.value.subscribeCreateComplete((e,t,a)=>{const l=Wr(e,o,r,!1),n={id:ms(),shape_type:a,points:l};L(t.x,t.y,n)}),g.value.subscribeContextmenuShape((e,t)=>{const{offsetX:a,offsetY:l}=e;L(a,l,t)}),g.value.subscribeEditing((e,t)=>{const a=Wr(e,o,r,!1),l=w.value.labels.shapes?.findIndex(e=>e.id===t.id);-1!==l&&(w.value.labels.shapes[l]={...t,points:a}),w.value.labels.imageWidth=i,w.value.labels.imageHeight=c,n("editPolygon",w.value)}),g.value.subscribeActiveShape(e=>{O(),n("selectShape",e)}),b(()=>u.value,()=>{g.value.resetAllInstance(),O(),u.value===Pr.CREATE_POLYGON?g.value.onStartCreatePolygon():u.value===Pr.EDIT_SHAPE?g.value.onEditorStart():u.value===Pr.CREATE_RECTANGLE?g.value.onStartCreateRectangle():u.value===Pr.CREATE_CIRCLE?g.value.onStartCreateCircle():u.value===Pr.CREATE_KEYPOINT&&g.value.onStartCreateKeypoint()},{immediate:!0})},a.onerror=()=>{C.value=!1}}};M(()=>{E(w.value),b(()=>e.contextClientHeight,e=>{vs(e)&&(f.value.style.height=e+"px",y(()=>{D()}))})}),h(()=>{g.value.destroy(),x.value.destroy()});const D=()=>{O(),y(()=>{g.value.resetAllInstance(),E(w.value)})},k=a({show:!1,top:0,left:0,activateShape:null}),O=()=>{k.value.show=!1,k.value.top=0,k.value.left=0,k.value.activateShape=null,g.value.closeCreateOrEditor()},L=(e,t,a)=>{const l=m.value.getBoundingClientRect();k.value.show=!0,k.value.left=e+l.x,k.value.top=t+l.y,k.value.canvasWidth=m.value.width,k.value.canvasHeight=m.value.height,k.value.activateShape=a},T=l(()=>{const{top:e,left:t,canvasWidth:a,canvasHeight:l}=k.value;return{top:e,left:t,canvasWidth:a,canvasHeight:l}}),P=(e,t)=>{const a=w.value.labels.shapes?.findIndex(e=>e.id===t.id);-1===a?w.value.labels.shapes.push(S(t)):w.value.labels.shapes[a]=S(t),n("updateLabelInfo",w.value),O(),g.value.updateLabelInfo(w.value.labels)},A=e=>{const t=w.value.labels.shapes?.findIndex(t=>t.id===e.id);-1!==t&&w.value.labels.shapes.splice(t,1),n("updateLabelInfo",w.value),O(),g.value.updateLabelInfo(w.value.labels)};return s({updateLabelInfo:e=>{e&&(w.value=e)},rerenderImage:e=>{e&&(w.value=e),(w.value.labels??={shapes:[]}).shapes??=[],y(()=>{d(u.value),D()})},resetScaleOffset:()=>{x.value.reset()},onSelectShape:e=>{u.value===Pr.EDIT_SHAPE&&g.value?.onSelectShape(e)}}),()=>r(i,null,[r(nr,{ref:v,loading:C.value,class:[o.b("loading")],style:{height:"100%"}},{default:()=>[r("div",{ref:f,class:[o.b("canvas")]},[r("canvas",{ref:m,class:[o.be("canvas","context")]},null),k.value.show?r(zr,{fixed:T.value,classes:c.value,activateShape:k.value.activateShape,onClose:O,onSelect:P,onDelete:A},null):null])]})])}}),di=o({props:{isFullscreen:{type:Boolean,default:!1},imageIndex:{type:Number,default:0},imageLength:{type:Number,default:0}},emits:["fullscreen","save"],setup(e,{emit:a}){const l=t("ns",{}),n=t("scaleTranslateManager",{}),s=n.scaleTranslate,{t:o}=Wl(),c=e=>{a("fullscreen",e),document.body.style.overflow=e?"hidden":"auto"};return()=>r(i,null,[r(i,null,[r("ul",{class:[l.be("header","tool")]},[r("li",{class:"tool-item",onClick:()=>a("save")},[r("svg",{t:"1719034799379",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4272",width:"18",height:"18"},[r("path",{d:"M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z","p-id":"4273"},null),r("path",{d:"M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z","p-id":"4274"},null)]),r("p",{class:"label-text"},[o("next.labelme.saveLabel")])])]),r("ul",{class:[l.be("header","tool")]},[r("li",{class:"tool-item",onClick:()=>n.onResetScaleTranslate()},[r("svg",{t:"1725840994827",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6051",width:"18",height:"18"},[r("path",{d:"M322.794667 445.205333a34.133333 34.133333 0 0 1 2.218666 45.824l-2.218666 2.432a34.133333 34.133333 0 0 1-45.824 2.218667l-2.432-2.218667-149.333334-149.333333a34.133333 34.133333 0 0 1-2.218666-45.824l2.218666-2.432 149.333334-149.333333a34.133333 34.133333 0 0 1 50.474666 45.824l-2.218666 2.432-91.050667 91.050666L640 285.866667c160.234667 0 290.133333 129.898667 290.133333 290.133333 0 158.016-126.314667 286.506667-283.477333 290.048L640 866.133333H234.666667a34.133333 34.133333 0 0 1-3.114667-68.117333L234.666667 797.866667h405.333333c122.538667 0 221.866667-99.328 221.866667-221.866667 0-120.533333-96.106667-218.602667-215.850667-221.781333L640 354.133333l-408.256-0.021333 91.050667 91.093333z","p-id":"6052"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.zoomRestore")])]),r("li",{style:"color: #999; user-select: none; cursor: default;"},[r("span",null,[E("缩放比例")]),r("span",null,[parseInt((100*s.value.scale).toString()),E("%")]),r("span",{style:"padding: 0 10px;"},[E("偏移量")]),r("span",{style:"min-width: 120px; text-align: left;"},[E("X: "),s.value.x,E(", Y: "),s.value.y])]),e.imageLength?r("li",null,[r("span",null,[E("第 "),e.imageIndex+1,E(" 张")]),r("em",{style:"padding: 0 5px;"},[E("/")]),r("span",null,[E("共 "),e.imageLength,E(" 张")])]):null,r("li",{style:"margin-right: 30px;",class:"tool-item"},[r(ge,{trigger:"hover",placement:"bottom",width:"none"},{reference:()=>r("div",{class:"flex-center"},[r("span",{style:"padding-right: 3px"},[o("next.labelimg.instructions")]),r(R,{size:14},{default:()=>[r(Nn,null,null)]})]),default:()=>r("ul",{style:"font-size: 12px;white-space: nowrap;"},[r("li",null,[r("span",null,[E("A:")]),r("span",null,[E("A键进入上一张图片进行标注")])]),r("li",null,[r("span",null,[E("D:")]),r("span",null,[E("D键进入下一张图片进行标注")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标:")]),r("span",null,[E("按住Ctrl键+鼠标滚动可以缩放图片,按住Ctrl+左键拖动可以移动图片")])]),r("li",null,[r("span",null,[E("P:")]),r("span",null,[E("创建多边形")])]),r("li",null,[r("span",null,[E("E:")]),r("span",null,[E("编辑形状")])]),r("li",null,[r("span",null,[E("R:")]),r("span",null,[E("创建矩形")])]),r("li",null,[r("span",null,[E("C:")]),r("span",null,[E("创建圆形")])]),r("li",null,[r("span",null,[E("K:")]),r("span",null,[E("创建关键点")])])])})]),e.isFullscreen?r("li",{class:"tool-item",onClick:()=>c(!1)},[r(T,{placement:"top",content:"取消全屏"},{default:()=>[r("svg",{t:"1719035442027",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5388",width:"18",height:"18"},[r("path",{d:"M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z","p-id":"5389"},null)])]})]):r("li",{class:"tool-item",onClick:()=>c(!0)},[r(T,{placement:"top",content:"全屏"},{default:()=>[r("svg",{t:"1719035375323",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5241",width:"18",height:"18"},[r("path",{d:"M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z","p-id":"5242"},null)])]})])])])])}}),hi=o({props:{},emits:["change"],setup(e,{emit:a}){const{t:l}=Wl(),n=t("ns",{}),s=t("toolsActive",{}),o=t("changeToolsActive"),c=e=>{o(e),a("change",e)},u=e=>{let t=s.value;switch(e.code){case"KeyP":t=Pr.CREATE_POLYGON;break;case"KeyE":t=Pr.EDIT_SHAPE;break;case"KeyR":t=Pr.CREATE_RECTANGLE;break;case"KeyC":t=Pr.CREATE_CIRCLE;break;case"KeyK":t=Pr.CREATE_KEYPOINT}c(t)};return M(()=>{document.addEventListener("keydown",u)}),h(()=>{document.removeEventListener("keydown",u)}),()=>r(i,null,[r("ul",{class:[n.be("main","left-tools")]},[r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_POLYGON}],onClick:()=>c(Pr.CREATE_POLYGON)},[r("svg",{t:"1757513720352",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4548",width:"18",height:"18"},[r("path",{d:"M938.456035 455.122739a85.314185 85.314185 0 0 1-85.371061-85.314185c0-12.342119 2.900682-23.944848 7.678277-34.523807l-5.630736-3.241939 28.89307-48.970342 17.972855 10.351454c11.14772-5.346356 23.262334-8.872675 36.457595-8.872675a85.314185 85.314185 0 1 1 0 170.571494z m-56.648618 172.050273l33.898169-166.760793 56.307362 11.204596-33.898169 166.760794-56.307362-11.204597z m39.415153 94.528117l-5.403232 26.333645v0.170629l-0.056876 0.227504-0.056876 0.227505v0.170628l-0.056876 0.056876-0.056876 0.341257-13.138385 64.725028c21.27167 15.527182 36.002586 39.415153 36.002586 67.796339a85.314185 85.314185 0 0 1-85.371061 85.257309c-26.618026 0-49.425351-12.91088-65.066285-32.078133l-17.574722 1.933788-0.73939 0.056876-0.113752 0.056876-0.682513 0.056876h-0.170629l-0.113752 0.056876-108.007758 11.716482-6.31325-56.307362 113.809123-12.398995a84.631672 84.631672 0 0 1 79.114688-82.527255l17.688474-87.077345 56.307362 11.204596z m-289.328839-518.141483l28.89307-49.027219 148.844815 85.712318-28.893071 48.970342-148.844814-85.655441z m-74.39397-42.827721l-19.394758-11.147721c-14.844668 12.683376-33.556913 21.157918-54.657954 21.157918a84.745424 84.745424 0 0 1-30.940612-6.199497l-51.984776 47.605315-39.073897-41.576446 48.458457-44.363376A82.697883 82.697883 0 0 1 398.132864 85.427937a85.314185 85.314185 0 1 1 170.62837 0c0 5.118851-2.04754 9.612065-2.957559 14.446536l20.589157 11.830233-28.893071 49.027219zM172.050273 343.986794l126.264994-115.629159 39.073897 41.576446-126.264994 115.629159-39.073897-41.576446z m-23.489839 173.358424l-16.323447 7.166392a82.982264 82.982264 0 0 1-27.300539 12.000862l-8.8158 3.867576-0.853141-1.933788c-3.412567 0.398133-6.427002 1.990664-9.953322 1.990664a85.314185 85.314185 0 1 1 85.314185-85.314185c0 22.750449-9.213932 43.168978-23.717343 58.468655l1.649407 3.753824z m105.107076 233.13523l-52.439786 23.03483-53.804812-119.269231v-0.170628a8.531419 8.531419 0 0 1-0.682514-1.47878l-0.056876-0.056876-0.455009-1.137522H146.171637l-0.113752-0.284381-0.056876-0.113752-0.625638-1.478779-0.341256-0.682514-0.056877-0.113752-0.113752-0.284381-0.398133-0.796265v-0.113753l-0.227504-0.455009-0.056876-0.113752-0.056876-0.170628-0.056877-0.056876-0.056876-0.113753-0.056876-0.113752-0.056876-0.28438-0.398133-0.796266-12.342119-27.357415 52.439786-23.03483 70.071384 155.442445z m-17.404094 100.727614l52.439786-23.03483 12.342119 27.471168c4.038205-0.568761 7.564524-2.388797 11.773357-2.388797A85.314185 85.314185 0 1 1 227.447617 938.626664c0-22.067936 8.929551-41.690198 22.636697-56.819247l-13.820898-30.599355z m332.440941 50.562874l6.31325 56.364238-171.197131 18.655369-6.31325-56.364239 171.197131-18.655368z","p-id":"4549"},null)]),r("p",{class:"label-text"},[l("next.labelme.createPolygon")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.EDIT_SHAPE}],onClick:()=>c(Pr.EDIT_SHAPE)},[r("svg",{t:"1757513760776",class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4712",width:"18",height:"18"},[r("path",{d:"M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z","p-id":"4713"},null),r("path",{d:"M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z","p-id":"4714"},null)]),r("p",{class:"label-text"},[l("next.labelme.editPolygon")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_RECTANGLE}],onClick:()=>c(Pr.CREATE_RECTANGLE)},[r("svg",{t:"1757513985670",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7834",width:"18",height:"18"},[r("path",{d:"M273.9 168.3H739v37.1H273.9zM273.9 819.6H739v37.1H273.9zM165.812 740.898v-465.1h37.1v465.1zM821.11 740.896v-465.1h37.1v465.1z","p-id":"7835"},null),r("path",{d:"M184.7 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7zM184.7 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7z","p-id":"7836"},null)]),r("p",{class:"label-text"},[l("next.labelme.createRectangle")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_KEYPOINT}],onClick:()=>c(Pr.CREATE_KEYPOINT)},[r("svg",{t:"1758547108531",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9598",width:"18",height:"18"},[r("path",{d:"M205.6 554.6h-58.3c-16.7 0-31.3-14.6-31.3-31.3 0-16.7 14.6-31.3 31.3-31.3h56.3c6.2-75 35.4-145.9 87.5-195.9s122.9-81.3 200.1-85.4v-62.5c0-16.7 14.6-31.3 31.3-31.3 16.7 0 31.3 14.6 31.3 31.3v62.5c66.7 8.3 129.2 37.5 175 83.4 50 50 81.3 120.9 87.5 195.9h60.4c16.7 0 31.3 14.6 31.3 31.3 0 16.7-14.6 33.3-31.3 33.3h-62.5c-8.3 68.8-37.5 131.3-85.4 177.1-45.8 45.8-104.2 75-175.1 83.4v60.4c0 16.7-14.6 31.3-31.3 31.3-16.7 0-31.3-12.5-31.3-29.2v-58.4H489c-77.1-4.2-148-35.4-200.1-85.4-45.8-47.9-75-106.2-83.3-179.2zM612 406.7c25 25 41.7 60.4 41.7 102.1 0 41.7-14.6 77.1-41.7 102.1-25 25-60.4 41.7-102.1 41.7-41.7 0-77.1-14.6-102.1-41.7C378.6 588 362 552.5 362 515c0-39.6 14.6-77.1 41.7-102.1 31.3-25 66.7-45.8 106.3-45.8 41.5 0 77 14.6 102 39.6zM509.9 271.2c-66.7 0-127.1 25-173 70.9C295.2 387.9 266 448.3 266 515s25 127.1 70.9 173c45.8 45.9 102.1 70.9 173 70.9 64.6 0 127.1-25 173-70.9 45.8-45.8 70.9-106.3 70.9-173s-31.3-127.1-70.9-173c-45.9-41.6-106.3-70.8-173-70.8z m0 0","p-id":"9599"},null)]),r("p",{class:"label-text"},[l("next.labelme.createKeypoint")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_CIRCLE}],onClick:()=>c(Pr.CREATE_CIRCLE)},[r("svg",{t:"1757514108844",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8822",width:"18",height:"18"},[r("path",{d:"M512 39.613153A472.386847 472.386847 0 1 1 39.613153 512 472.386847 472.386847 0 0 1 512 39.613153m0-39.613153a512 512 0 1 0 512 512A512 512 0 0 0 512 0z","p-id":"8823"},null)]),r("p",{class:"label-text"},[l("next.labelme.createCircle")])])])])}}),pi=o({props:{shapes:{type:Array,default:()=>[]}},emits:["delete","update","select"],setup(e,{emit:l}){const{t:s}=Wl(),o=t("ns",{}),c=t("classes",a([])),u=n(c),d=t("toolsActive",{}),h=t("activeShape",a(null)),v=e=>{const t=u.findIndex(t=>t===e);return-1===t?Ar:_r[t]},f=k(e,"shapes"),m=[{prop:"group_id",label:s("next.labelme.labelGroupId"),type:"input"},{prop:"description",label:s("next.labelme.labelDescription"),type:"textarea"}],g=p({visible:!1,title:"",shapeInfo:{}}),b=()=>{g.visible=!1,g.title="",g.shapeInfo={}},y=(e,t)=>{l("update",ds(e)),t(),b()};return()=>r(i,null,[r("div",{class:[o.be("main","right-label")]},[f.value.length?r("ul",null,[f.value.map((e,t)=>r("li",{class:[o.be("right-label","label-item"),h.value?.id===e.id?o.be("label-item","active"):""],key:t,onClick:()=>(e=>{d.value===Pr.EDIT_SHAPE&&l("select",e)})(e)},[r("div",{class:[o.be("right-label","label-content")]},[r("span",{class:"label-line",style:{backgroundColor:v(e.label)}},null),r("span",null,[e.label,e.group_id?` ( ${e.group_id} )`:null])]),r("div",{class:[o.be("right-label","label-btns")]},[r(R,{size:16,style:{marginRight:"6px"},color:"#303133",onClick:t=>{t.preventDefault(),t.stopPropagation(),(e=>{g.visible=!0,g.title=e.label,g.shapeInfo=e})(e)}},{default:()=>[r(kn,null,null)]}),r(be,{title:s("next.labelme.confirmDeleteLabel"),width:200,onConfirm:()=>(e=>{l("delete",e)})(e)},{reference:()=>r(R,{size:16,color:"#ff0000",onClick:e=>{e.preventDefault(),e.stopPropagation()}},{default:()=>[r(En,null,null)]})})])]))]):r(me,{"image-size":100,description:s("next.labelme.emptyLabelText")},null),r(jo,{modelValue:g.visible,"onUpdate:modelValue":e=>g.visible=e,title:g.title,width:350,fullscreen:!1,fullscreenBtn:!1,closeOnClickModal:!0,onClose:b},{default:()=>[r(Xo,{options:{labelPosition:"top",colSpanFixed:24},columns:m,formDatum:g.shapeInfo,onSubmit:y},null)]})])])}});const vi=Te("labelme");var fi=o({name:"NextLabelme",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["change","save","edit-polygon","change-polygon","prev-click","next-click"],setup(e,{emit:t,slots:s,expose:o}){const c=ds(jr),u=l(()=>{const t=n(e.options);return zl(c,t)}),d=n(u);g("ns",vi);const{t:p}=Wl(),v=a(0),f=a(e.classes);g("classes",f);const m=a("");g("toolsActive",m),g("changeToolsActive",e=>{m.value=e,x.value=null});const x=a(null);g("activeShape",x);const w=a(ds(e.data));b(()=>e.data,e=>{w.value=ds(e)},{deep:!0}),b(()=>e.data.length,()=>{v.value=0});const C=l(()=>{if(!w.value)return{};const e=w.value[v.value]||{};return ds(e)}),S=e=>{w.value[v.value]=e},E=e=>{const t=C.value,a=t.labels?.shapes?.findIndex(t=>t.id===e.id);-1!==a&&t.labels.shapes.splice(a,1),w.value[v.value]=t,A.value.rerenderImage(t),x.value=null},D=e=>{const t=C.value,a=t.labels?.shapes?.findIndex(t=>t.id===e.id);-1!==a&&(t.labels.shapes[a]=e),w.value[v.value]=t},k=e=>{A.value.onSelectShape(e),x.value=e},O=a(!1),T=a(d.minContentHeight),A=a(),_=a(),j=a(),z=a(),H=a(),V=()=>{y(()=>{const e=(_.value?.clientHeight||0)-((j.value?.clientHeight||0)+(H.value?.clientHeight||0));T.value=e})};M(()=>{document.addEventListener("keydown",I),us(_.value.parentElement,()=>{V()}),window.addEventListener("resize",V)}),h(()=>{document.removeEventListener("keydown",I),window.removeEventListener("resize",V)});const I=e=>{O.value||("KeyA"===e.code||"ArrowLeft"===e.key?N():"KeyD"!==e.code&&"ArrowRight"!==e.key||B())},N=()=>{const e=w.value.length;let a=v.value-1;a<0&&(a=e-1),F(a),t("prev-click")},B=()=>{const e=w.value.length;let a=v.value+1;a>=e&&(a=0),F(a),t("next-click")},F=e=>{if(O.value)return;O.value=!0;const a=C.value;return t("save",{node:a},t=>{w.value[v.value]=t||a,v.value=e,O.value=!1,A.value.rerenderImage(C.value)},()=>{O.value=!1}),!0},Y=a(!1),W=e=>{Y.value=e,V(),y(()=>{A.value.rerenderImage(C.value)})},U=e=>{C.value.labels=e,t("change-polygon",e)},$=e=>{t("edit-polygon",e)},K=()=>{F(v.value)||L({type:"info",message:p("next.labelimg.labelNoUpdate")})},X=a({scale:1,x:0,y:0});return g("scaleTranslateManager",{scaleTranslate:X,onChangeScaleTranslate:e=>{X.value=e},onResetScaleTranslate:()=>{A.value.resetScaleOffset()}}),o({onSave:e=>{F(v.value),e&&e(C.value)},getCurrentNode:()=>C.value}),()=>r(i,null,[r("div",{ref:_,class:[vi.b(),e.className,Y.value?vi.b("fullscreen"):""],style:{...e.style}},[r(nr,{loading:O.value,tip:p("next.labelimg.saveTxt"),class:[vi.b("loading")]},{default:()=>[r(P,null,{default:()=>[r("header",{ref:j,class:[vi.b("header")]},[s.header?s.header():r(di,{isFullscreen:Y.value,imageIndex:v.value,imageLength:w.value.length,onFullscreen:W,onSave:K},null)]),r("div",{ref:z,class:[vi.b("main")]},[r(hi,null,null),r("div",{class:[vi.be("main","content")],style:{height:T.value+"px"}},[r(ui,{ref:A,labelInfo:C.value,contextClientHeight:T.value,onEditPolygon:$,onChangePolygon:U,onUpdateLabelInfo:S,onSelectShape:k},null)]),r(pi,{shapes:C.value.labels?.shapes,onUpdate:D,onDelete:E,onSelect:k},null)]),r("footer",{ref:H,class:[vi.b("footer")]},[r("div",{class:[vi.be("footer","left")]},[r(R,{size:24,color:"#797979",onClick:N},{default:()=>[r(gn,null,null)]})]),r("div",{class:[vi.be("footer","center")]},[r(P,null,{default:()=>[r("ul",{class:[vi.bem("footer","center","list")]},[w.value.map((e,t)=>r("li",{key:t,onClick:()=>F(t),class:{"is-activate":v.value===t}},[r(he,{style:"height: 100%",src:e.imageSrc,"zoom-rate":1.2,"max-scale":2,"min-scale":.2,fit:"cover"},null)]))])]})]),r("div",{class:[vi.be("footer","right")]},[r(R,{size:24,color:"#797979",onClick:B},{default:()=>[r(bn,null,null)]})])])]})]})])])}});const mi=on(fi);var gi=Object.freeze({__proto__:null,NextCarousel:hr,NextContainer:oo,NextCrudTable:Qo,NextCrudTableVirtualized:lr,NextDialog:jo,NextDragResize:ur,NextForm:Xo,NextInputTableSelect:Ko,NextLabelimg:Or,NextLabelimgPreview:Lr,NextLabelme:mi,NextLayout:to,NextMenu:Es,NextSpinLoading:nr,NextTabs:no,NextTextEllipsis:vn,NextTreeCascader:$o,NextTreeSelect:Uo,NextUpload:or,NextVideoPlayer:cr});const bi=Symbol("configProviderContextKey"),yi="0.6.12",xi=function(t,a){if(Object.keys(gi).forEach(e=>{const a=gi[e];t.component(a.name,a)}),(e=>{(e=>{e.directive("zoom",{mounted(e,t){if(!t.value)return!1;const a="string"==typeof(l=t.value)||!We(l)&&Fe(l)&&"[object String]"==Be(l)?[t.value,".el-dialog__body",!1,!0]:t.value;var l;a[1]=a[1]?a[1]:".el-dialog__body",a[2]=void 0!==a[2]&&a[2],a[3]=void 0===a[3]||a[3],y(()=>{const e=document.querySelector(a[1]),t=document.querySelector(a[0]),l=document.createElement("div");l.className="dialog-zoom",l.onmouseenter=()=>{l.onmousedown=l=>{const n=l.clientX,s=l.clientY,o=e.offsetWidth,r=e.offsetHeight,i=t.offsetWidth,c=t.offsetHeight;document.onmousemove=l=>{l.preventDefault();const u=o+2*(l.clientX-n),d=r+(l.clientY-s);if(e.style.width=`${u}px`,e.style.height=`${d}px`,a[2]){const e=c+(l.clientY-s);t.style.height=`${e}px`}if(a[3]){const e=i+2*(l.clientX-n);t.style.width=`${e}px`}},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}},t.appendChild(l)})}})})(e)})(t),a){const n=!!e();(t?.provide??(n?g:void 0))(bi,l(()=>a))}};var wi={version:yi,install:xi};export{hr as NextCarousel,oo as NextContainer,Qo as NextCrudTable,lr as NextCrudTableVirtualized,jo as NextDialog,ur as NextDragResize,Xo as NextForm,Ko as NextInputTableSelect,Or as NextLabelimg,Lr as NextLabelimgPreview,mi as NextLabelme,to as NextLayout,Es as NextMenu,nr as NextSpinLoading,no as NextTabs,vn as NextTextEllipsis,$o as NextTreeCascader,Uo as NextTreeSelect,or as NextUpload,cr as NextVideoPlayer,Fl as buildLocaleContext,Bl as buildTranslator,wi as default,De as defaultNamespace,xi as install,Yl as localeContextKey,Il as localeLang,Oe as namespaceContextKey,Ql as nextUseCssTheme,Jl as nextUseCssVar,Gl as randomColor16,Nl as translate,en as updateThemeColor,an as updateThemeColorCssVar,ql as useChangeColor,sn as useDetectVideo,Le as useGetDerivedNamespace,Ul as useLanguage,Wl as useLocale,Te as useNamespace,yi as version};
10
+ import{getCurrentInstance as e,inject as t,ref as a,computed as l,unref as n,isRef as s,defineComponent as o,createVNode as r,Fragment as i,createElementBlock as c,openBlock as u,createElementVNode as d,onUnmounted as h,reactive as p,resolveComponent as v,isVNode as f,Teleport as m,provide as g,watch as b,nextTick as y,markRaw as x,watchEffect as w,h as C,onMounted as M,toRaw as S,createTextVNode as E,render as D,toRef as k}from"vue";import{localeContextKey as O,ElMessage as L,ElTooltip as T,ElScrollbar as P,ElDivider as A,ElColorPicker as _,ElSwitch as j,ElDropdown as z,ElDropdownMenu as H,ElDropdownItem as V,ElIcon as R,ElDrawer as I,ElMenuItem as N,ElSubMenu as B,ElMenu as F,ElContainer as Y,ElCol as W,ElFormItem as U,ElInput as $,ElSelect as K,ElRadioGroup as X,ElRadio as q,ElDatePicker as G,ElInputNumber as Z,ElOption as J,ElForm as Q,ElRow as ee,ElButton as te,ElTable as ae,ElTableColumn as le,ElCheckbox as ne,ElMessageBox as se,ElPagination as oe,ElDialog as re,ElTag as ie,ElCheckboxGroup as ce,ElUpload as ue,ElImageViewer as de,ElImage as he,ElTreeSelect as pe,ElCascader as ve,ElTimeSelect as fe,ElEmpty as me,ElPopover as ge,ElPopconfirm as be}from"element-plus";import{useDateFormat as ye,useNow as xe,useFullscreen as we}from"@vueuse/core";import Ce from"video.js";import"video.js/dist/video-js.css";import Me from"video.js/dist/lang/zh-CN.json";import Se from"video.js/dist/lang/en.json";import Ee from"video.js/dist/lang/zh-TW.json";const De="next",ke=(e,t,a,l,n)=>{let s=`${e}-${t}`;return a&&(s+=`-${a}`),l&&(s+=`__${l}`),n&&(s+=`--${n}`),s},Oe=Symbol("namespaceContextKey"),Le=s=>{const o=s||(e()?t(Oe,a(De)):a(De));return l(()=>n(o)||De)},Te=(e,t)=>{const a=Le(t);return{namespace:a,b:(t="")=>ke(a.value,e,t,"",""),e:t=>t?ke(a.value,e,"",t,""):"",m:t=>t?ke(a.value,e,"","",t):"",be:(t,l)=>t&&l?ke(a.value,e,t,l,""):"",em:(t,l)=>t&&l?ke(a.value,e,"",t,l):"",bm:(t,l)=>t&&l?ke(a.value,e,t,"",l):"",bem:(t,l,n)=>t&&l&&n?ke(a.value,e,t,l,n):"",bf:(...t)=>{let l=`${a.value}-${e}`;for(const e in t){const a=t[e];a&&(l+="-"+a)}return l},is:(e,...t)=>{const a=!(t.length>=1)||t[0];return e&&a?`is-${e}`:""},cssVar:e=>{const t={};for(const l in e)e[l]&&(t[`--${a.value}-${l}`]=e[l]);return t},cssVarName:e=>`--${a.value}-${e}`,cssVarBlock:t=>{const l={};for(const n in t)t[n]&&(l[`--${a.value}-${e}-${n}`]=t[n]);return l},cssVarBlockName:t=>`--${a.value}-${e}-${t}`}};var Pe="object"==typeof global&&global&&global.Object===Object&&global,Ae="object"==typeof self&&self&&self.Object===Object&&self,_e=Pe||Ae||Function("return this")(),je=_e.Symbol,ze=Object.prototype,He=ze.hasOwnProperty,Ve=ze.toString,Re=je?je.toStringTag:void 0,Ie=Object.prototype.toString,Ne=je?je.toStringTag:void 0;function Be(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Ne&&Ne in Object(e)?function(e){var t=He.call(e,Re),a=e[Re];try{e[Re]=void 0;var l=!0}catch(e){}var n=Ve.call(e);return l&&(t?e[Re]=a:delete e[Re]),n}(e):function(e){return Ie.call(e)}(e)}function Fe(e){return null!=e&&"object"==typeof e}function Ye(e){return"symbol"==typeof e||Fe(e)&&"[object Symbol]"==Be(e)}var We=Array.isArray,Ue=je?je.prototype:void 0,$e=Ue?Ue.toString:void 0;function Ke(e){if("string"==typeof e)return e;if(We(e))return function(e,t){for(var a=-1,l=null==e?0:e.length,n=Array(l);++a<l;)n[a]=t(e[a],a,e);return n}(e,Ke)+"";if(Ye(e))return $e?$e.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Xe(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function qe(e){return e}function Ge(e){if(!Xe(e))return!1;var t=Be(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}var Ze,Je=_e["__core-js_shared__"],Qe=(Ze=/[^.]+$/.exec(Je&&Je.keys&&Je.keys.IE_PROTO||""))?"Symbol(src)_1."+Ze:"",et=Function.prototype.toString;function tt(e){if(null!=e){try{return et.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var at=/^\[object .+?Constructor\]$/,lt=Function.prototype,nt=Object.prototype,st=lt.toString,ot=nt.hasOwnProperty,rt=RegExp("^"+st.call(ot).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function it(e,t){var a=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Xe(e)||(t=e,Qe&&Qe in t))&&(Ge(e)?rt:at).test(tt(e));var t}(a)?a:void 0}var ct,ut,dt,ht=it(_e,"WeakMap"),pt=Object.create,vt=function(){function e(){}return function(t){if(!Xe(t))return{};if(pt)return pt(t);e.prototype=t;var a=new e;return e.prototype=void 0,a}}(),ft=Date.now,mt=function(){try{var e=it(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),gt=mt?function(e,t){return mt(e,"toString",{configurable:!0,enumerable:!1,value:(a=t,function(){return a}),writable:!0});var a}:qe,bt=(ct=gt,ut=0,dt=0,function(){var e=ft(),t=16-(e-dt);if(dt=e,t>0){if(++ut>=800)return arguments[0]}else ut=0;return ct.apply(void 0,arguments)}),yt=/^(?:0|[1-9]\d*)$/;function xt(e,t){var a=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==a||"symbol"!=a&&yt.test(e))&&e>-1&&e%1==0&&e<t}function wt(e,t,a){"__proto__"==t&&mt?mt(e,t,{configurable:!0,enumerable:!0,value:a,writable:!0}):e[t]=a}function Ct(e,t){return e===t||e!=e&&t!=t}var Mt=Object.prototype.hasOwnProperty;function St(e,t,a){var l=e[t];Mt.call(e,t)&&Ct(l,a)&&(void 0!==a||t in e)||wt(e,t,a)}var Et=Math.max;function Dt(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function kt(e){return null!=e&&Dt(e.length)&&!Ge(e)}function Ot(e){return function(e,t){return bt(function(e,t,a){return t=Et(void 0===t?e.length-1:t,0),function(){for(var l=arguments,n=-1,s=Et(l.length-t,0),o=Array(s);++n<s;)o[n]=l[t+n];n=-1;for(var r=Array(t+1);++n<t;)r[n]=l[n];return r[t]=a(o),function(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}(e,this,r)}}(e,t,qe),e+"")}(function(t,a){var l=-1,n=a.length,s=n>1?a[n-1]:void 0,o=n>2?a[2]:void 0;for(s=e.length>3&&"function"==typeof s?(n--,s):void 0,o&&function(e,t,a){if(!Xe(a))return!1;var l=typeof t;return!!("number"==l?kt(a)&&xt(t,a.length):"string"==l&&t in a)&&Ct(a[t],e)}(a[0],a[1],o)&&(s=n<3?void 0:s,n=1),t=Object(t);++l<n;){var r=a[l];r&&e(t,r,l,s)}return t})}var Lt=Object.prototype;function Tt(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Lt)}function Pt(e){return Fe(e)&&"[object Arguments]"==Be(e)}var At=Object.prototype,_t=At.hasOwnProperty,jt=At.propertyIsEnumerable,zt=Pt(function(){return arguments}())?Pt:function(e){return Fe(e)&&_t.call(e,"callee")&&!jt.call(e,"callee")},Ht="object"==typeof exports&&exports&&!exports.nodeType&&exports,Vt=Ht&&"object"==typeof module&&module&&!module.nodeType&&module,Rt=Vt&&Vt.exports===Ht?_e.Buffer:void 0,It=(Rt?Rt.isBuffer:void 0)||function(){return!1},Nt={};function Bt(e){return function(t){return e(t)}}Nt["[object Float32Array]"]=Nt["[object Float64Array]"]=Nt["[object Int8Array]"]=Nt["[object Int16Array]"]=Nt["[object Int32Array]"]=Nt["[object Uint8Array]"]=Nt["[object Uint8ClampedArray]"]=Nt["[object Uint16Array]"]=Nt["[object Uint32Array]"]=!0,Nt["[object Arguments]"]=Nt["[object Array]"]=Nt["[object ArrayBuffer]"]=Nt["[object Boolean]"]=Nt["[object DataView]"]=Nt["[object Date]"]=Nt["[object Error]"]=Nt["[object Function]"]=Nt["[object Map]"]=Nt["[object Number]"]=Nt["[object Object]"]=Nt["[object RegExp]"]=Nt["[object Set]"]=Nt["[object String]"]=Nt["[object WeakMap]"]=!1;var Ft="object"==typeof exports&&exports&&!exports.nodeType&&exports,Yt=Ft&&"object"==typeof module&&module&&!module.nodeType&&module,Wt=Yt&&Yt.exports===Ft&&Pe.process,Ut=function(){try{return Yt&&Yt.require&&Yt.require("util").types||Wt&&Wt.binding&&Wt.binding("util")}catch(e){}}(),$t=Ut&&Ut.isTypedArray,Kt=$t?Bt($t):function(e){return Fe(e)&&Dt(e.length)&&!!Nt[Be(e)]},Xt=Object.prototype.hasOwnProperty;function qt(e,t){var a=We(e),l=!a&&zt(e),n=!a&&!l&&It(e),s=!a&&!l&&!n&&Kt(e),o=a||l||n||s,r=o?function(e,t){for(var a=-1,l=Array(e);++a<e;)l[a]=t(a);return l}(e.length,String):[],i=r.length;for(var c in e)!t&&!Xt.call(e,c)||o&&("length"==c||n&&("offset"==c||"parent"==c)||s&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||xt(c,i))||r.push(c);return r}function Gt(e,t){return function(a){return e(t(a))}}var Zt=Gt(Object.keys,Object),Jt=Object.prototype.hasOwnProperty;function Qt(e){return kt(e)?qt(e):function(e){if(!Tt(e))return Zt(e);var t=[];for(var a in Object(e))Jt.call(e,a)&&"constructor"!=a&&t.push(a);return t}(e)}var ea=Object.prototype.hasOwnProperty;function ta(e){return kt(e)?qt(e,!0):function(e){if(!Xe(e))return function(e){var t=[];if(null!=e)for(var a in Object(e))t.push(a);return t}(e);var t=Tt(e),a=[];for(var l in e)("constructor"!=l||!t&&ea.call(e,l))&&a.push(l);return a}(e)}var aa=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,la=/^\w*$/,na=it(Object,"create"),sa=Object.prototype.hasOwnProperty,oa=Object.prototype.hasOwnProperty;function ra(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}function ia(e,t){for(var a=e.length;a--;)if(Ct(e[a][0],t))return a;return-1}ra.prototype.clear=function(){this.__data__=na?na(null):{},this.size=0},ra.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},ra.prototype.get=function(e){var t=this.__data__;if(na){var a=t[e];return"__lodash_hash_undefined__"===a?void 0:a}return sa.call(t,e)?t[e]:void 0},ra.prototype.has=function(e){var t=this.__data__;return na?void 0!==t[e]:oa.call(t,e)},ra.prototype.set=function(e,t){var a=this.__data__;return this.size+=this.has(e)?0:1,a[e]=na&&void 0===t?"__lodash_hash_undefined__":t,this};var ca=Array.prototype.splice;function ua(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}ua.prototype.clear=function(){this.__data__=[],this.size=0},ua.prototype.delete=function(e){var t=this.__data__,a=ia(t,e);return!(a<0||(a==t.length-1?t.pop():ca.call(t,a,1),--this.size,0))},ua.prototype.get=function(e){var t=this.__data__,a=ia(t,e);return a<0?void 0:t[a][1]},ua.prototype.has=function(e){return ia(this.__data__,e)>-1},ua.prototype.set=function(e,t){var a=this.__data__,l=ia(a,e);return l<0?(++this.size,a.push([e,t])):a[l][1]=t,this};var da=it(_e,"Map");function ha(e,t){var a,l,n=e.__data__;return("string"==(l=typeof(a=t))||"number"==l||"symbol"==l||"boolean"==l?"__proto__"!==a:null===a)?n["string"==typeof t?"string":"hash"]:n.map}function pa(e){var t=-1,a=null==e?0:e.length;for(this.clear();++t<a;){var l=e[t];this.set(l[0],l[1])}}function va(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError("Expected a function");var a=function(){var l=arguments,n=t?t.apply(this,l):l[0],s=a.cache;if(s.has(n))return s.get(n);var o=e.apply(this,l);return a.cache=s.set(n,o)||s,o};return a.cache=new(va.Cache||pa),a}pa.prototype.clear=function(){this.size=0,this.__data__={hash:new ra,map:new(da||ua),string:new ra}},pa.prototype.delete=function(e){var t=ha(this,e).delete(e);return this.size-=t?1:0,t},pa.prototype.get=function(e){return ha(this,e).get(e)},pa.prototype.has=function(e){return ha(this,e).has(e)},pa.prototype.set=function(e,t){var a=ha(this,e),l=a.size;return a.set(e,t),this.size+=a.size==l?0:1,this},va.Cache=pa;var fa,ma,ga=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ba=/\\(\\)?/g,ya=(fa=va(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ga,function(e,a,l,n){t.push(l?n.replace(ba,"$1"):a||e)}),t},function(e){return 500===ma.size&&ma.clear(),e}),ma=fa.cache,fa);function xa(e){if("string"==typeof e||Ye(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function wa(e,t,a){var l=null==e?void 0:function(e,t){for(var a=0,l=(t=function(e,t){return We(e)?e:function(e,t){if(We(e))return!1;var a=typeof e;return!("number"!=a&&"symbol"!=a&&"boolean"!=a&&null!=e&&!Ye(e))||la.test(e)||!aa.test(e)||null!=t&&e in Object(t)}(e,t)?[e]:ya(function(e){return null==e?"":Ke(e)}(e))}(t,e)).length;null!=e&&a<l;)e=e[xa(t[a++])];return a&&a==l?e:void 0}(e,t);return void 0===l?a:l}var Ca=Gt(Object.getPrototypeOf,Object),Ma=Function.prototype,Sa=Object.prototype,Ea=Ma.toString,Da=Sa.hasOwnProperty,ka=Ea.call(Object);function Oa(e){var t=this.__data__=new ua(e);this.size=t.size}Oa.prototype.clear=function(){this.__data__=new ua,this.size=0},Oa.prototype.delete=function(e){var t=this.__data__,a=t.delete(e);return this.size=t.size,a},Oa.prototype.get=function(e){return this.__data__.get(e)},Oa.prototype.has=function(e){return this.__data__.has(e)},Oa.prototype.set=function(e,t){var a=this.__data__;if(a instanceof ua){var l=a.__data__;if(!da||l.length<199)return l.push([e,t]),this.size=++a.size,this;a=this.__data__=new pa(l)}return a.set(e,t),this.size=a.size,this};var La="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ta=La&&"object"==typeof module&&module&&!module.nodeType&&module,Pa=Ta&&Ta.exports===La?_e.Buffer:void 0,Aa=Pa?Pa.allocUnsafe:void 0;function _a(e,t){if(t)return e.slice();var a=e.length,l=Aa?Aa(a):new e.constructor(a);return e.copy(l),l}var ja=Object.prototype.propertyIsEnumerable,za=Object.getOwnPropertySymbols,Ha=za?function(e){return null==e?[]:(e=Object(e),function(e,t){for(var a=-1,l=null==e?0:e.length,n=0,s=[];++a<l;){var o=e[a];t(o)&&(s[n++]=o)}return s}(za(e),function(t){return ja.call(e,t)}))}:function(){return[]};function Va(e){return function(e,t,a){var l=Qt(e);return We(e)?l:function(e,t){for(var a=-1,l=t.length,n=e.length;++a<l;)e[n+a]=t[a];return e}(l,a(e))}(e,0,Ha)}var Ra=it(_e,"DataView"),Ia=it(_e,"Promise"),Na=it(_e,"Set"),Ba="[object Map]",Fa="[object Promise]",Ya="[object Set]",Wa="[object WeakMap]",Ua="[object DataView]",$a=tt(Ra),Ka=tt(da),Xa=tt(Ia),qa=tt(Na),Ga=tt(ht),Za=Be;(Ra&&Za(new Ra(new ArrayBuffer(1)))!=Ua||da&&Za(new da)!=Ba||Ia&&Za(Ia.resolve())!=Fa||Na&&Za(new Na)!=Ya||ht&&Za(new ht)!=Wa)&&(Za=function(e){var t=Be(e),a="[object Object]"==t?e.constructor:void 0,l=a?tt(a):"";if(l)switch(l){case $a:return Ua;case Ka:return Ba;case Xa:return Fa;case qa:return Ya;case Ga:return Wa}return t});var Ja=Object.prototype.hasOwnProperty,Qa=_e.Uint8Array;function el(e){var t=new e.constructor(e.byteLength);return new Qa(t).set(new Qa(e)),t}var tl=/\w*$/,al=je?je.prototype:void 0,ll=al?al.valueOf:void 0;function nl(e,t){var a=t?el(e.buffer):e.buffer;return new e.constructor(a,e.byteOffset,e.length)}function sl(e){return"function"!=typeof e.constructor||Tt(e)?{}:vt(Ca(e))}var ol=Ut&&Ut.isMap,rl=ol?Bt(ol):function(e){return Fe(e)&&"[object Map]"==Za(e)},il=Ut&&Ut.isSet,cl=il?Bt(il):function(e){return Fe(e)&&"[object Set]"==Za(e)},ul="[object Arguments]",dl="[object Function]",hl="[object Object]",pl={};function vl(e,t,a,l,n,s){var o,r=1&t;if(void 0!==o)return o;if(!Xe(e))return e;var i=We(e);if(i)o=function(e){var t=e.length,a=new e.constructor(t);return t&&"string"==typeof e[0]&&Ja.call(e,"index")&&(a.index=e.index,a.input=e.input),a}(e);else{var c=Za(e),u=c==dl||"[object GeneratorFunction]"==c;if(It(e))return _a(e,r);if(c==hl||c==ul||u&&!n)o=u?{}:sl(e);else{if(!pl[c])return n?e:{};o=function(e,t,a){var l,n,s,o,r,i=e.constructor;switch(t){case"[object ArrayBuffer]":return el(e);case"[object Boolean]":case"[object Date]":return new i(+e);case"[object DataView]":return r=el((o=e).buffer),new o.constructor(r,o.byteOffset,o.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return nl(e,a);case"[object Map]":case"[object Set]":return new i;case"[object Number]":case"[object String]":return new i(e);case"[object RegExp]":return(s=new(n=e).constructor(n.source,tl.exec(n))).lastIndex=n.lastIndex,s;case"[object Symbol]":return l=e,ll?Object(ll.call(l)):{}}}(e,c,r)}}s||(s=new Oa);var d=s.get(e);if(d)return d;s.set(e,o),cl(e)?e.forEach(function(l){o.add(vl(l,t,a,0,e,s))}):rl(e)&&e.forEach(function(l,n){o.set(n,vl(l,t,a,0,e,s))});var h=i?void 0:Va(e);return function(e,t){for(var a=-1,l=null==e?0:e.length;++a<l&&!1!==t(e[a],a););}(h||e,function(l,n){h&&(l=e[n=l]),St(o,n,vl(l,t,a,0,e,s))}),o}function fl(e){return vl(e,5)}function ml(e){var t=-1,a=null==e?0:e.length;for(this.__data__=new pa;++t<a;)this.add(e[t])}function gl(e,t){for(var a=-1,l=null==e?0:e.length;++a<l;)if(t(e[a],a,e))return!0;return!1}function bl(e,t,a,l,n,s){var o=1&a,r=e.length,i=t.length;if(r!=i&&!(o&&i>r))return!1;var c=s.get(e),u=s.get(t);if(c&&u)return c==t&&u==e;var d=-1,h=!0,p=2&a?new ml:void 0;for(s.set(e,t),s.set(t,e);++d<r;){var v=e[d],f=t[d];if(l)var m=o?l(f,v,d,t,e,s):l(v,f,d,e,t,s);if(void 0!==m){if(m)continue;h=!1;break}if(p){if(!gl(t,function(e,t){if(o=t,!p.has(o)&&(v===e||n(v,e,a,l,s)))return p.push(t);var o})){h=!1;break}}else if(v!==f&&!n(v,f,a,l,s)){h=!1;break}}return s.delete(e),s.delete(t),h}function yl(e){var t=-1,a=Array(e.size);return e.forEach(function(e,l){a[++t]=[l,e]}),a}function xl(e){var t=-1,a=Array(e.size);return e.forEach(function(e){a[++t]=e}),a}pl[ul]=pl["[object Array]"]=pl["[object ArrayBuffer]"]=pl["[object DataView]"]=pl["[object Boolean]"]=pl["[object Date]"]=pl["[object Float32Array]"]=pl["[object Float64Array]"]=pl["[object Int8Array]"]=pl["[object Int16Array]"]=pl["[object Int32Array]"]=pl["[object Map]"]=pl["[object Number]"]=pl[hl]=pl["[object RegExp]"]=pl["[object Set]"]=pl["[object String]"]=pl["[object Symbol]"]=pl["[object Uint8Array]"]=pl["[object Uint8ClampedArray]"]=pl["[object Uint16Array]"]=pl["[object Uint32Array]"]=!0,pl["[object Error]"]=pl[dl]=pl["[object WeakMap]"]=!1,ml.prototype.add=ml.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ml.prototype.has=function(e){return this.__data__.has(e)};var wl=je?je.prototype:void 0,Cl=wl?wl.valueOf:void 0,Ml=Object.prototype.hasOwnProperty,Sl="[object Arguments]",El="[object Array]",Dl="[object Object]",kl=Object.prototype.hasOwnProperty;function Ol(e,t,a,l,n){return e===t||(null==e||null==t||!Fe(e)&&!Fe(t)?e!=e&&t!=t:function(e,t,a,l,n,s){var o=We(e),r=We(t),i=o?El:Za(e),c=r?El:Za(t),u=(i=i==Sl?Dl:i)==Dl,d=(c=c==Sl?Dl:c)==Dl,h=i==c;if(h&&It(e)){if(!It(t))return!1;o=!0,u=!1}if(h&&!u)return s||(s=new Oa),o||Kt(e)?bl(e,t,a,l,n,s):function(e,t,a,l,n,s,o){switch(a){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!s(new Qa(e),new Qa(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return Ct(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var r=yl;case"[object Set]":var i=1&l;if(r||(r=xl),e.size!=t.size&&!i)return!1;var c=o.get(e);if(c)return c==t;l|=2,o.set(e,t);var u=bl(r(e),r(t),l,n,s,o);return o.delete(e),u;case"[object Symbol]":if(Cl)return Cl.call(e)==Cl.call(t)}return!1}(e,t,i,a,l,n,s);if(!(1&a)){var p=u&&kl.call(e,"__wrapped__"),v=d&&kl.call(t,"__wrapped__");if(p||v){var f=p?e.value():e,m=v?t.value():t;return s||(s=new Oa),n(f,m,a,l,s)}}return!!h&&(s||(s=new Oa),function(e,t,a,l,n,s){var o=1&a,r=Va(e),i=r.length;if(i!=Va(t).length&&!o)return!1;for(var c=i;c--;){var u=r[c];if(!(o?u in t:Ml.call(t,u)))return!1}var d=s.get(e),h=s.get(t);if(d&&h)return d==t&&h==e;var p=!0;s.set(e,t),s.set(t,e);for(var v=o;++c<i;){var f=e[u=r[c]],m=t[u];if(l)var g=o?l(m,f,u,t,e,s):l(f,m,u,e,t,s);if(!(void 0===g?f===m||n(f,m,a,l,s):g)){p=!1;break}v||(v="constructor"==u)}if(p&&!v){var b=e.constructor,y=t.constructor;b==y||!("constructor"in e)||!("constructor"in t)||"function"==typeof b&&b instanceof b&&"function"==typeof y&&y instanceof y||(p=!1)}return s.delete(e),s.delete(t),p}(e,t,a,l,n,s))}(e,t,a,l,Ol,n))}function Ll(e,t,a){(void 0!==a&&!Ct(e[t],a)||void 0===a&&!(t in e))&&wt(e,t,a)}function Tl(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}function Pl(e,t,a,l,n,s,o){var r=Tl(e,a),i=Tl(t,a),c=o.get(i);if(c)Ll(e,a,c);else{var u,d=s?s(r,i,a+"",e,t,o):void 0,h=void 0===d;if(h){var p=We(i),v=!p&&It(i),f=!p&&!v&&Kt(i);d=i,p||v||f?We(r)?d=r:Fe(u=r)&&kt(u)?d=function(e,t){var a=-1,l=e.length;for(t||(t=Array(l));++a<l;)t[a]=e[a];return t}(r):v?(h=!1,d=_a(i,!0)):f?(h=!1,d=nl(i,!0)):d=[]:function(e){if(!Fe(e)||"[object Object]"!=Be(e))return!1;var t=Ca(e);if(null===t)return!0;var a=Da.call(t,"constructor")&&t.constructor;return"function"==typeof a&&a instanceof a&&Ea.call(a)==ka}(i)||zt(i)?(d=r,zt(r)?d=function(e){return function(e,t,a){var l=!a;a||(a={});for(var n=-1,s=t.length;++n<s;){var o=t[n],r=void 0;void 0===r&&(r=e[o]),l?wt(a,o,r):St(a,o,r)}return a}(e,ta(e))}(r):Xe(r)&&!Ge(r)||(d=sl(i))):h=!1}h&&(o.set(i,d),n(d,i,l,s,o),o.delete(i)),Ll(e,a,d)}}function Al(e,t,a,l,n){e!==t&&function(e,t,a){for(var l=-1,n=Object(e),s=a(e),o=s.length;o--;){var r=s[++l];if(!1===t(n[r],r,n))break}}(t,function(s,o){if(n||(n=new Oa),Xe(s))Pl(e,t,o,a,Al,l,n);else{var r=l?l(Tl(e,o),s,o+"",e,t,n):void 0;void 0===r&&(r=s),Ll(e,o,r)}},ta)}var _l=Ot(function(e,t,a,l){Al(e,t,a,l)});function jl(e,t){return Ol(e,t)}var zl=Ot(function(e,t,a){Al(e,t,a)}),Hl={name:"zh-cn",next:{loading:"加载中...",table:{search:"查询",clear:"清空",add:"新增",delete:"删除",batchDelete:"批量删除",export:"导出",edit:"编辑",view:"查看",unfoldSearch:"展开搜索",foldSearch:"收起搜索",notData:"暂无数据",operation:"操作",selection:"选择",selectionAll:"全选",setting:{title:"设置列",label:"列名",hide:"隐藏",filter:"筛选",sort:"排序"},message:{tip:"提示",batchDeleteTip:"您确定要批量删除吗?",cancelBatchDelete:"取消批量删除操作",deleteTip:"您确定要删除该数据吗?",cancelDelete:"取消删除操作",confirmButtonText:"确 定",cancelButtonText:"取 消"},uploadfileExceed:"上传文件数量超出限制范围"},form:{input:"请输入",select:"请选择",requiredInput:" 必填",requiredSelect:" 必选",submit:"提 交",cancel:"取 消",reset:"重 置",confirm:"确 定",tableSelect:" 选择",selectFile:"选择文件"},date:{oneWeekAge:"一周以前",oneMonthAge:"一个月以前",threeMonthsAge:"三个月以前",oneYearAge:"一年以前",threeYearsAge:"三年以前",rangeSeparator:"至",startPlaceholder:"开始时间",endPlaceholder:"结束时间"},layout:{home:"首页",personal:"个人中心",logOut:"退出登录",tabsOther:"关闭其他",tabsLeft:"关闭左侧",tabsRight:"关闭右侧",tabsAll:"关闭全部",setting:{systemSetting:"系统配置",globalTheme:"全局主题",themeColor:"主题颜色",darkMode:"暗黑模式",headerBackground:"顶栏背景",headerTextColor:"顶栏文本颜色",headerActiveTextColor:"顶栏活动文本颜色",headerGradient:"顶栏渐变",layoutMode:"布局模式",isShowTab:"显示标签",saveSetting:"保存设置",resetSetting:"重置设置"}},labelimg:{saveTxt:"保存中...",emptyLabelText:"暂无标签数据",confirmDeleteLabel:"确定要删除该标注吗?",saveLabel:"保存当前标注",instructions:"使用说明",labelNoUpdate:"暂无标签数据更新",zoomRestore:"还原"},labelme:{saveLabel:"保存",confirmDeleteLabel:"确定要删除该标注吗?",emptyLabelText:"暂无标签数据",createPolygon:"创建多边形(P)",editPolygon:"编辑图形(E)",deletePolyton:"删除多边形",createRectangle:"创建矩形(R)",createCircle:"创建圆形(C)",createKeypoint:"创建关键点(K)",selectClasses:"选择标签",emptyClassesText:"暂无标注",deleteClasses:"删除标注",labelGroupId:"分组ID",labelDescription:"标注描述"}}},Vl={name:"en",next:{loading:"loading...",table:{search:"search",clear:"clear",add:"add",delete:"del",batchDelete:"batch delete",export:"export",edit:"edit",view:"view",unfoldSearch:"unfold search",foldSearch:"fold search",notData:"not data",operation:"operations",selection:"selection",selectionAll:"select all",setting:{title:"column setting",label:"column name",hide:"hide",filter:"filter",sort:"srot"},message:{tip:"tip",batchDeleteTip:"Are you sure you want to delete them in bulk ?",cancelBatchDelete:"Cancel batch deletion",deleteTip:"Are you sure you want to delete this data ?",cancelDelete:"Cancel delete",confirmButtonText:"OK",cancelButtonText:"Cancel"},uploadfileExceed:"The number of uploaded files exceeds the limit"},form:{input:"please input ",select:"please select ",requiredInput:" required",requiredSelect:" required",submit:"Submit",cancel:"Cancel",reset:"reset",confirm:"confirm",tableSelect:" select",selectFile:"select file"},date:{oneWeekAge:"one week age",oneMonthAge:"one month age",threeMonthsAge:"three months age",oneYearAge:"one year age",threeYearsAge:"three years age",rangeSeparator:"to",startPlaceholder:"start time",endPlaceholder:"end time"},layout:{home:"Home",personal:"Personal",logOut:"LogOut",tabsOther:"close other",tabsLeft:"close left",tabsRight:"close right",tabsAll:"close all",setting:{systemSetting:"system setting",globalTheme:"global theme",themeColor:"theme color",darkMode:"dark mode",headerBackground:"header background",headerTextColor:"header text color",headerActiveTextColor:"header active text color",headerGradient:"header gradient",layoutMode:"layout mode",isShowTab:"show tab",saveSetting:"save setting",resetSetting:"reset setting"}},labelimg:{saveTxt:"saving...",emptyLabelText:"No label data",confirmDeleteLabel:"Are you sure you want to delete this annotation?",saveLabel:"save label",instructions:"instructions",labelNoUpdate:"No label data update",zoomRestore:"restore zoom"},labelme:{saveLabel:"saving...",confirmDeleteLabel:"Are you sure you want to delete this annotation?",emptyLabelText:"No label data",createPolygon:"create polygon (P)",editPolygon:"edit polygon (E)",deletePolygon:"delete polygon",createRectangle:"create rectangle (R)",createCircle:"create circle (C)",createKeypoint:"create keypoint (K)",selectClasses:"select classes",emptyClassesText:"No label classes",deleteClasses:"delete classes",labelGroupId:"Group ID",labelDescription:"label description"}}},Rl={name:"zh-tw",next:{loading:"加載中...",table:{search:"查詢",clear:"清空",add:"新增",delete:"刪除",batchDelete:"批量刪除",export:"導出",edit:"編輯",view:"查看",unfoldSearch:"展開搜索",foldSearch:"收起搜索",notData:"暫無數據",operation:"操作",selection:"选择",selectionAll:"全选",setting:{title:"設置列",label:"列名",hide:"隱藏",filter:"篩選",sort:"排序"},message:{tip:"提示",batchDeleteTip:"您確定要批量刪除嗎?",cancelBatchDelete:"取消批量刪除操作",deleteTip:"您确定要删除该数据吗?",cancelDelete:"取消删除操作",confirmButtonText:"確 定",cancelButtonText:"取 消"},uploadfileExceed:"上传文件数量超出限制范围"},form:{input:"請輸入",select:"請選擇",requiredInput:" 必填",requiredSelect:" 必選",submit:"提 交",cancel:"取 消",reset:"重 置",confirm:"确 定",tableSelect:" 選擇",selectFile:"選擇文件"},date:{oneWeekAge:"一周以前",oneMonthAge:"一个月以前",threeMonthsAge:"三个月以前",oneYearAge:"一年以前",threeYearsAge:"三年以前",rangeSeparator:"至",startPlaceholder:"開始時間",endPlaceholder:"結束時間"},layout:{home:"首頁",personal:"個人中心",logOut:"退出登錄",tabsOther:"關閉其他",tabsLeft:"關閉左側",tabsRight:"關閉右側",tabsAll:"關閉全部",setting:{systemSetting:"系統配置",globalTheme:"全局主題",themeColor:"主題顏色",darkMode:"暗黑模式",headerBackground:"頂欄背景",headerTextColor:"頂欄文本顏色",headerActiveTextColor:"頂欄活動文本顏色",headerGradient:"頂欄渐变",layoutMode:"布局模式",isShowTab:"是否顯示標籤",saveSetting:"保存設置",resetSetting:"重置設置"}},labelimg:{saveTxt:"保存中...",emptyLabelText:"暂暫無標註數據",confirmDeleteLabel:"確定要刪除該標註嗎?",saveLabel:"保存當前標註",instructions:"使用說明",labelNoUpdate:"暫無標籤數據更新",zoomRestore:"還原"},labelme:{saveLabel:"保存",confirmDeleteLabel:"確定要刪除該標註嗎?",emptyLabelText:"暫無標註數據",createPolygon:"創建多邊形(P)",editPolygon:"編輯圖形(E)",deletePolygon:"刪除多邊形",createRectangle:"創建矩形(R)",createCircle:"創建圓形(C)",createKeypoint:"創建關鍵點(K)",selectClasses:"選擇標籤",emptyClassesText:"咱無標註",deleteClasses:"刪除標註",labelGroupId:"分組ID",labelDescription:"標註描述"}}};const Il={[Hl.name]:{...Hl},[Vl.name]:{...Vl},[Rl.name]:{...Rl}},Nl=(e,t,a)=>wa(a,e,e)?.replace(/\{(\w+)\}/g,(e,a)=>`${t?.[a]??`{${a}}`}`),Bl=e=>(t,a)=>Nl(t,a,n(e)),Fl=e=>{const t=l(()=>n(e).name),o=s(e)?e:a(e),r=Il[t.value]||Il["zh-cn"];return o.value.next=r.next,{lang:t,locale:o,t:Bl(e)}},Yl=O,Wl=e=>{const n=e||t(Yl,a());return Fl(l(()=>n?.value||Hl))},Ul=(e,t)=>{const l=s(e)?e:a(e),n=Il[t]||Il["zh-cn"];l.value.name=t,l.value.next=n.next},$l=/^#([0-9A-F]{3}|[0-9A-F]{6}|[0-9A-F]{8})$/i,Kl=/^rgba\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*,\s*(0|1|0?\.\d+)\s*\)$/i,Xl=/^rgb\(\s*\d+\s*,\s*\d+\s*,\s*\d+\s*\)$/i;function ql(){const e=e=>{const t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",").map(e=>parseFloat(e)),[a,l,n]=t;return`#${[a,l,n].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}`.toUpperCase()};return{hexToRgb:e=>{let t="";if(!/^\#?[0-9A-Fa-f]{6}$/.test(e))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";t=(e=e.replace("#","")).match(/../g);for(let e=0;e<3;e++)t[e]=parseInt(t[e],16);return t},hexToRgba:(e,t=1)=>{let a="";if(!/^\#?[0-9A-Fa-f]{6}$/.test(e))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";a=(e=e.replace("#","")).match(/../g);for(let e=0;e<3;e++)a[e]=parseInt(a[e],16);return`rgba(${a.join(",")},${t})`},rgbToHex:(e,t,a)=>{let l=/^\d{1,3}$/;if(!l.test(e)||!l.test(t)||!l.test(a))return L({type:"warning",message:"rgb颜色值格式错误",grouping:!0}),"";let n=[e.toString(16),t.toString(16),a.toString(16)];for(let e=0;e<3;e++)1==n[e].length&&(n[e]=`0${n[e]}`);return`#${n.join("")}`},rgbaToHex:e,rgbaToHexAlpha:e=>{const t=e.replace(/^rgba?\(|\s+|\)$/g,"").split(",").map(e=>parseFloat(e)),[a,l,n,s]=t,o=Math.round(255*s).toString(16).padStart(2,"0");return`#${[a,l,n].map(e=>Math.round(e).toString(16).padStart(2,"0")).join("")}${o}`.toUpperCase()},getDarkColor:(t,a)=>{let l=t;if(Kl.test(l)&&(l=e(l)),Xl.test(l)&&(l=e(l)),!$l.test(l))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";let n=ql().hexToRgb(l);for(let e=0;e<3;e++)n[e]=Math.floor(n[e]*(1-a));return ql().rgbToHex(n[0],n[1],n[2])},getLightColor:(t,a)=>{let l=t;if(Kl.test(l)&&(l=e(l)),Xl.test(l)&&(l=e(l)),!$l.test(l))return L({type:"warning",message:"hex颜色值格式错误",grouping:!0}),"";let n=ql().hexToRgb(l);for(let e=0;e<3;e++)n[e]=Math.floor((255-n[e])*a+n[e]);return ql().rgbToHex(n[0],n[1],n[2])}}}function Gl(){return`#${(1<<24|Math.floor(256*Math.random())<<16|Math.floor(256*Math.random())<<8|Math.floor(256*Math.random())).toString(16).slice(1)}`}const{getLightColor:Zl}=ql(),Jl=(e,t)=>{document.documentElement.style.setProperty(e,t)},Ql=(e,t)=>{Jl(e,t);for(let a=1;a<10;a++)Jl(e+"-light-"+a,Zl(t,a/10));Jl(`${e}-dark-2`,t)},en=e=>{e&&Ql("--el-color-primary",e)},tn={themeColor:"--el-color-primary",headerBarColor:"--next-layout-bg-color",headerBarFontColor:"--next-layout-font-color"},an=e=>{for(const t in tn){const a=tn[t];e[t]&&Ql(a,e[t])}const t=document.documentElement;e.isDark?t.setAttribute("data-theme","dark"):t.setAttribute("data-theme","")},ln=async(e,t,a,l,n,s=[],o,r)=>{const{videoWidth:i,videoHeight:c}=e;if(!i||!c)return;let[u,d]=t.inputs[0].shape.slice(1,3),h=l.tidy(()=>l.image.resizeBilinear(l.browser.fromPixels(e),[u,d]).div(255).expandDims(0));a.clearRect(0,0,i,c),o.clearRect(0,0,i,c),await(t?.executeAsync(h).then(async t=>{let[u,d,p,v]=t;for(let t=0;t<v.dataSync()[0];++t){let[l,h,v,f]=u.dataSync().slice(4*t,4*(t+1));l=l<0||l>1?parseInt(l):l,v=v<0||v>1?parseInt(v):v,h=h<0||h>1?parseInt(h):h,f=f<0||f>1?parseInt(f):f,l=Math.round(Math.abs(l)*i),v=Math.round(Math.abs(v)*i),h=Math.round(Math.abs(h)*c),f=Math.round(Math.abs(f)*c);const m=v-l,g=f-h,b=l,y=h;let x=p.dataSync()[t],w=d.dataSync()[t].toFixed(2);const C=(e,t,a)=>{const l=Gl();a.strokeStyle=l,a.lineWidth=2,a.beginPath(),a.rect(b,y,m,g),a.stroke(),a.font="bold 16px Arial",a.fillStyle=l,a.fillText(`${e} ${t}`,b+10,y<20?20:y-10)};if(s?.length)for(let t=0;t<s.length;t++){const l=s[t];if(l.cls==x&&Number(w)>l.score){const t=n.find(e=>e.value==x);if(t){const l=t.label;C(l,w,await nn(e,o)),C(l,w,a),r&&r(l,w)}}}else if(w>.5){const e=n.find(e=>e.value==x);e&&C(e.label||"",w,a)}}h.dispose(),l.dispose(t)}))},nn=(e,t)=>{const a=e.videoWidth,l=e.videoHeight,n=a/l,s=a/l,o=a,r=l;let i,c,u,d;return n>s?(u=a,d=a/n,i=0,c=Math.round((l-d)/2)):n===s?(u=a,d=l,i=0,c=0):n<s&&(u=l*n,d=l,i=Math.round((a-u)/2),c=0),t.drawImage(e,0,0,o,r,i,c,u,d),t},sn=e=>({detectVideoFrameImage:({container:t,video:a,modelUrl:l,classNames:n,classInput:s=[]},o,r)=>l?n?void e.loadGraphModel(l).then(l=>{const r=document.createElement("canvas"),i=r.getContext("2d");r.style.position="absolute",r.style.zIndex="99",r.style.pointerEvents="none",t&&t.appendChild(r);const c=document.createElement("canvas"),u=c.getContext("2d");a.ontimeupdate=t=>{const{clientWidth:d,clientHeight:h}=t.target,{videoWidth:p,videoHeight:v,offsetTop:f,offsetLeft:m}=a;r.width=p,r.height=v,r.style.top=f+"px",r.style.left=m+"px",r.style.width=d+"px",r.style.height=h+"px",c.width=p,c.height=v,c.style.width=d+"px",c.style.height=h+"px",ln(a,l,i,e,n,s,u,(e,t)=>{const a="image/png";let l=r.toDataURL(a,.92).replace(a,"image/octet-stream");l=l.replace(/^data:image\/[^;]+/,"data:application/octet-stream");const n=c.toDataURL(a,.92);o&&o({name:e,score:t,detectImage:n,detectCanvas:c},{canvas:r,imageDataURL:l})})}}):(r&&r("模型类别不能未空"),!1):(r&&r("模型文件地址不能为空"),!1)}),on=(e,t)=>(e.install=t=>{for(const a of[e,...Object.values({})])t.component(a.name,a)},e),rn="header-menu",cn="header-tools-prefix",un="header-tools-suffix",dn="sidebar-menu";var hn={logo:"",title:"Next Element Vue",userName:"Admin",language:"zh-cn",languageDropdown:[{value:"zh-cn",label:"简体中文"},{value:"en",label:"English"},{value:"zh-tw",label:"繁體中文"}],userDropdown:[{value:"/",label:"next.layout.home",svg:'<svg t="1718695810903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11410" width="16" height="16"><path d="M988.672 502.272l-476.16-476.16-476.16 476.16c-8.704 8.704-8.704 22.528 0 31.232l1.536 1.536c8.704 8.704 22.528 8.704 31.232 0l443.392-443.392 443.392 443.392c8.704 8.704 22.528 8.704 31.232 0l1.536-1.536c8.704-8.704 8.704-22.528 0-31.232z" fill="" p-id="11411"></path><path d="M860.16 534.016c-12.288 0-22.016 9.728-22.016 22.016v333.312c0 54.272-27.648 64-47.104 64h-152.064v-227.84c0-25.088 0-59.392-44.544-59.392H418.816c-44.032 0-44.032 33.28-44.032 59.392v227.84h-153.6c-44.032 0-45.056-64-45.056-64v-333.312c0.512-12.288-8.704-22.528-20.992-23.04-12.288-0.512-22.528 8.704-23.04 20.992v368.64c0 65.536 70.144 75.264 70.144 75.264h217.088v-287.232h176.64v287.232H824.32c39.424 0 57.856-44.032 57.856-75.264v-366.592c0-12.288-9.728-22.016-22.016-22.016z" fill="" p-id="11412"></path></svg>'},{value:"/personal",label:"next.layout.personal",svg:'<svg t="1718695007028" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2161" width="16" height="16"><path d="M512 87.04c-136.704 0-247.808 111.104-247.808 247.808 0 98.816 58.368 184.32 142.336 223.744-155.136 45.568-268.8 188.928-268.8 358.912 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0-184.832 150.528-335.36 335.36-335.36 136.704 0 247.808-111.104 247.808-247.808S648.704 87.04 512 87.04z m0 456.192c-115.2 0-208.384-93.696-208.384-208.384 0-115.2 93.696-208.384 208.384-208.384 115.2 0 208.384 93.696 208.384 208.384 0 114.688-93.184 208.384-208.384 208.384z m226.816 76.8c-8.704-6.656-20.992-5.12-27.648 3.584-6.656 8.704-5.12 20.992 3.584 27.648 83.968 64 132.096 161.28 132.096 266.752 0 10.752 8.704 19.456 19.456 19.456 10.752 0 19.456-8.704 19.456-19.456 0.512-118.272-53.248-226.816-146.944-297.984z" fill="" p-id="2162"></path></svg>'},{value:"logOut",label:"next.layout.logOut",svg:'<svg t="1718695049981" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2313" width="16" height="16"><path d="M896 928H384a32 32 0 0 1-32-32v-128a32 32 0 0 1 64 0v96h448v-704h-448V256a32 32 0 1 1-64 0V128a32 32 0 0 1 32-32h512a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32z" fill="" p-id="2314"></path><path d="M608 544H192a32 32 0 0 1 0-64h416a32 32 0 0 1 0 64z" fill="" p-id="2315"></path><path d="M256 672a30.08 30.08 0 0 1-22.4-9.6l-128-128a30.72 30.72 0 0 1 0-44.8l128-128a31.36 31.36 0 1 1 44.8 44.8L173.44 512l104.96 105.6a30.72 30.72 0 0 1 0 44.8 30.08 30.08 0 0 1-22.4 9.6z" fill="" p-id="2316"></path></svg>',divided:!0}],showTabs:!0,activeTab:"/",tabs:[],menuTree:[],menuRouter:!0,menuMode:"horizontal",setting:{layout:"transverse",themeColor:"#c71585",headerBarColor:"#282c34",headerBarFontColor:"#FFFFFF",headerBarFontActiveColor:"",isHeaderBarColorGradual:!1,asidebarColor:"#282c34",asidebarFontColor:"#ffffff",isAsidebarColorGradual:!1,isDark:!1}};const pn=Te("text-ellipsis"),vn=on(o({name:"NextTextEllipsis",props:{className:{type:String,default:""},content:{type:String,default:""},disabled:{type:Boolean,default:!1},width:{type:[String,Number],default:""},placement:{type:String,default:"top"},textAlign:{type:String,default:"left"}},setup(e,{slots:t}){const n=a(!1),s=l(()=>{const t=e.width;let a={textAlign:e.textAlign};return t&&("string"==typeof t?a.width=t:"number"==typeof t&&(a.width=t+"px")),a}),o=a(),c=()=>{try{const e=o.value;e&&e.scrollWidth&&e.scrollWidth>e.offsetWidth?n.value=!0:n.value=!1}catch(e){n.value=!1}};return()=>r(i,null,[r("div",{class:[pn.b(),e.className],style:s.value,onMouseenter:c},[n.value?r(T,{effect:"dark",content:e.content,placement:e.placement,disabled:e.disabled},{default:()=>[r("span",{class:pn.e("text"),ref:o},[t.default?t.default():e.content])]}):r("span",{class:pn.e("text"),ref:o},[t.default?t.default():e.content])])])}}));var fn=o({setup(){const e=t("__ns__",{}),a=t("options",{}),{t:l}=Wl(),n=()=>{a.onClickLogo?.(a)},s=()=>{a.onClickTitle?.(a)};return()=>r(i,null,[r("div",{class:e.bf("header","logo")},[a.logo&&r("img",{class:e.be("header-logo","img"),src:a.logo,alt:"logo",onClick:n},null),a.title&&r("p",{class:e.be("header-logo","title"),onClick:s},[r(vn,{content:l(a.title)},null)])])])}}),mn=o({name:"ArrowDown",__name:"arrow-down",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}),gn=o({name:"ArrowLeft",__name:"arrow-left",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M609.408 149.376 277.76 489.6a32 32 0 0 0 0 44.672l331.648 340.352a29.12 29.12 0 0 0 41.728 0 30.59 30.59 0 0 0 0-42.752L339.264 511.936l311.872-319.872a30.59 30.59 0 0 0 0-42.688 29.12 29.12 0 0 0-41.728 0"})]))}),bn=o({name:"ArrowRight",__name:"arrow-right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M340.864 149.312a30.59 30.59 0 0 0 0 42.752L652.736 512 340.864 831.872a30.59 30.59 0 0 0 0 42.752 29.12 29.12 0 0 0 41.728 0L714.24 534.336a32 32 0 0 0 0-44.672L382.592 149.376a29.12 29.12 0 0 0-41.728 0z"})]))}),yn=o({name:"ArrowUp",__name:"arrow-up",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}),xn=o({name:"Back",__name:"back",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M224 480h640a32 32 0 1 1 0 64H224a32 32 0 0 1 0-64"}),d("path",{fill:"currentColor",d:"m237.248 512 265.408 265.344a32 32 0 0 1-45.312 45.312l-288-288a32 32 0 0 1 0-45.312l288-288a32 32 0 1 1 45.312 45.312z"})]))}),wn=o({name:"Camera",__name:"camera",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M896 256H128v576h768zm-199.424-64-32.064-64h-304.96l-32 64zM96 192h160l46.336-92.608A64 64 0 0 1 359.552 64h304.96a64 64 0 0 1 57.216 35.328L768.192 192H928a32 32 0 0 1 32 32v640a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32m416 512a160 160 0 1 0 0-320 160 160 0 0 0 0 320m0 64a224 224 0 1 1 0-448 224 224 0 0 1 0 448"})]))}),Cn=o({name:"Close",__name:"close",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}),Mn=o({name:"DArrowLeft",__name:"d-arrow-left",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M529.408 149.376a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L259.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L197.76 534.272a32 32 0 0 1 0-44.672zm256 0a29.12 29.12 0 0 1 41.728 0 30.59 30.59 0 0 1 0 42.688L515.264 511.936l311.872 319.936a30.59 30.59 0 0 1-.512 43.264 29.12 29.12 0 0 1-41.216-.512L453.76 534.272a32 32 0 0 1 0-44.672z"})]))}),Sn=o({name:"DArrowRight",__name:"d-arrow-right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M452.864 149.312a29.12 29.12 0 0 1 41.728.064L826.24 489.664a32 32 0 0 1 0 44.672L494.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L764.736 512 452.864 192a30.59 30.59 0 0 1 0-42.688m-256 0a29.12 29.12 0 0 1 41.728.064L570.24 489.664a32 32 0 0 1 0 44.672L238.592 874.624a29.12 29.12 0 0 1-41.728 0 30.59 30.59 0 0 1 0-42.752L508.736 512 196.864 192a30.59 30.59 0 0 1 0-42.688"})]))}),En=o({name:"Delete",__name:"delete",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M160 256H96a32 32 0 0 1 0-64h256V95.936a32 32 0 0 1 32-32h256a32 32 0 0 1 32 32V192h256a32 32 0 1 1 0 64h-64v672a32 32 0 0 1-32 32H192a32 32 0 0 1-32-32zm448-64v-64H416v64zM224 896h576V256H224zm192-128a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32m192 0a32 32 0 0 1-32-32V416a32 32 0 0 1 64 0v320a32 32 0 0 1-32 32"})]))}),Dn=o({name:"EditPen",__name:"edit-pen",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m199.04 672.64 193.984 112 224-387.968-193.92-112-224 388.032zm-23.872 60.16 32.896 148.288 144.896-45.696zM455.04 229.248l193.92 112 56.704-98.112-193.984-112zM104.32 708.8l384-665.024 304.768 175.936L409.152 884.8h.064l-248.448 78.336zm384 254.272v-64h448v64z"})]))}),kn=o({name:"Edit",__name:"edit",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M832 512a32 32 0 1 1 64 0v352a32 32 0 0 1-32 32H160a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32h352a32 32 0 0 1 0 64H192v640h640z"}),d("path",{fill:"currentColor",d:"m469.952 554.24 52.8-7.552L847.104 222.4a32 32 0 1 0-45.248-45.248L477.44 501.44l-7.552 52.8zm422.4-422.4a96 96 0 0 1 0 135.808l-331.84 331.84a32 32 0 0 1-18.112 9.088L436.8 623.68a32 32 0 0 1-36.224-36.224l15.104-105.6a32 32 0 0 1 9.024-18.112l331.904-331.84a96 96 0 0 1 135.744 0z"})]))}),On=o({name:"FullScreen",__name:"full-screen",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m160 96.064 192 .192a32 32 0 0 1 0 64l-192-.192V352a32 32 0 0 1-64 0V96h64zm0 831.872V928H96V672a32 32 0 1 1 64 0v191.936l192-.192a32 32 0 1 1 0 64zM864 96.064V96h64v256a32 32 0 1 1-64 0V160.064l-192 .192a32 32 0 1 1 0-64zm0 831.872-192-.192a32 32 0 0 1 0-64l192 .192V672a32 32 0 1 1 64 0v256h-64z"})]))}),Ln=o({name:"InfoFilled",__name:"info-filled",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896.064A448 448 0 0 1 512 64m67.2 275.072c33.28 0 60.288-23.104 60.288-57.344s-27.072-57.344-60.288-57.344c-33.28 0-60.16 23.104-60.16 57.344s26.88 57.344 60.16 57.344M590.912 699.2c0-6.848 2.368-24.64 1.024-34.752l-52.608 60.544c-10.88 11.456-24.512 19.392-30.912 17.28a12.99 12.99 0 0 1-8.256-14.72l87.68-276.992c7.168-35.136-12.544-67.2-54.336-71.296-44.096 0-108.992 44.736-148.48 101.504 0 6.784-1.28 23.68.064 33.792l52.544-60.608c10.88-11.328 23.552-19.328 29.952-17.152a12.8 12.8 0 0 1 7.808 16.128L388.48 728.576c-10.048 32.256 8.96 63.872 55.04 71.04 67.84 0 107.904-43.648 147.456-100.416z"})]))}),Tn=o({name:"MoonNight",__name:"moon-night",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M384 512a448 448 0 0 1 215.872-383.296A384 384 0 0 0 213.76 640h188.8A448.3 448.3 0 0 1 384 512M171.136 704a448 448 0 0 1 636.992-575.296A384 384 0 0 0 499.328 704h-328.32z"}),d("path",{fill:"currentColor",d:"M32 640h960q32 0 32 32t-32 32H32q-32 0-32-32t32-32m128 128h384a32 32 0 1 1 0 64H160a32 32 0 1 1 0-64m160 127.68 224 .256a32 32 0 0 1 32 32V928a32 32 0 0 1-32 32l-224-.384a32 32 0 0 1-32-32v-.064a32 32 0 0 1 32-32z"})]))}),Pn=o({name:"Picture",__name:"picture",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M160 160v704h704V160zm-32-64h768a32 32 0 0 1 32 32v768a32 32 0 0 1-32 32H128a32 32 0 0 1-32-32V128a32 32 0 0 1 32-32"}),d("path",{fill:"currentColor",d:"M384 288q64 0 64 64t-64 64-64-64 64-64M185.408 876.992l-50.816-38.912L350.72 556.032a96 96 0 0 1 134.592-17.856l1.856 1.472 122.88 99.136a32 32 0 0 0 44.992-4.864l216-269.888 49.92 39.936-215.808 269.824-.256.32a96 96 0 0 1-135.04 14.464l-122.88-99.072-.64-.512a32 32 0 0 0-44.8 5.952z"})]))}),An=o({name:"Plus",__name:"plus",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}),_n=o({name:"Refresh",__name:"refresh",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M771.776 794.88A384 384 0 0 1 128 512h64a320 320 0 0 0 555.712 216.448H654.72a32 32 0 1 1 0-64h149.056a32 32 0 0 1 32 32v148.928a32 32 0 1 1-64 0v-50.56zM276.288 295.616h92.992a32 32 0 0 1 0 64H220.16a32 32 0 0 1-32-32V178.56a32 32 0 0 1 64 0v50.56A384 384 0 0 1 896.128 512h-64a320 320 0 0 0-555.776-216.384z"})]))}),jn=o({name:"Right",__name:"right",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M754.752 480H160a32 32 0 1 0 0 64h594.752L521.344 777.344a32 32 0 0 0 45.312 45.312l288-288a32 32 0 0 0 0-45.312l-288-288a32 32 0 1 0-45.312 45.312z"})]))}),zn=o({name:"Search",__name:"search",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"m795.904 750.72 124.992 124.928a32 32 0 0 1-45.248 45.248L750.656 795.904a416 416 0 1 1 45.248-45.248zM480 832a352 352 0 1 0 0-704 352 352 0 0 0 0 704"})]))}),Hn=o({name:"Setting",__name:"setting",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M600.704 64a32 32 0 0 1 30.464 22.208l35.2 109.376c14.784 7.232 28.928 15.36 42.432 24.512l112.384-24.192a32 32 0 0 1 34.432 15.36L944.32 364.8a32 32 0 0 1-4.032 37.504l-77.12 85.12a357 357 0 0 1 0 49.024l77.12 85.248a32 32 0 0 1 4.032 37.504l-88.704 153.6a32 32 0 0 1-34.432 15.296L708.8 803.904c-13.44 9.088-27.648 17.28-42.368 24.512l-35.264 109.376A32 32 0 0 1 600.704 960H423.296a32 32 0 0 1-30.464-22.208L357.696 828.48a352 352 0 0 1-42.56-24.64l-112.32 24.256a32 32 0 0 1-34.432-15.36L79.68 659.2a32 32 0 0 1 4.032-37.504l77.12-85.248a357 357 0 0 1 0-48.896l-77.12-85.248A32 32 0 0 1 79.68 364.8l88.704-153.6a32 32 0 0 1 34.432-15.296l112.32 24.256c13.568-9.152 27.776-17.408 42.56-24.64l35.2-109.312A32 32 0 0 1 423.232 64H600.64zm-23.424 64H446.72l-36.352 113.088-24.512 11.968a294 294 0 0 0-34.816 20.096l-22.656 15.36-116.224-25.088-65.28 113.152 79.68 88.192-1.92 27.136a293 293 0 0 0 0 40.192l1.92 27.136-79.808 88.192 65.344 113.152 116.224-25.024 22.656 15.296a294 294 0 0 0 34.816 20.096l24.512 11.968L446.72 896h130.688l36.48-113.152 24.448-11.904a288 288 0 0 0 34.752-20.096l22.592-15.296 116.288 25.024 65.28-113.152-79.744-88.192 1.92-27.136a293 293 0 0 0 0-40.256l-1.92-27.136 79.808-88.128-65.344-113.152-116.288 24.96-22.592-15.232a288 288 0 0 0-34.752-20.096l-24.448-11.904L577.344 128zM512 320a192 192 0 1 1 0 384 192 192 0 0 1 0-384m0 64a128 128 0 1 0 0 256 128 128 0 0 0 0-256"})]))}),Vn=o({name:"Sunny",__name:"sunny",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 704a192 192 0 1 0 0-384 192 192 0 0 0 0 384m0 64a256 256 0 1 1 0-512 256 256 0 0 1 0 512m0-704a32 32 0 0 1 32 32v64a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 768a32 32 0 0 1 32 32v64a32 32 0 1 1-64 0v-64a32 32 0 0 1 32-32M195.2 195.2a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 1 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m543.104 543.104a32 32 0 0 1 45.248 0l45.248 45.248a32 32 0 0 1-45.248 45.248l-45.248-45.248a32 32 0 0 1 0-45.248M64 512a32 32 0 0 1 32-32h64a32 32 0 0 1 0 64H96a32 32 0 0 1-32-32m768 0a32 32 0 0 1 32-32h64a32 32 0 1 1 0 64h-64a32 32 0 0 1-32-32M195.2 828.8a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248L240.448 828.8a32 32 0 0 1-45.248 0m543.104-543.104a32 32 0 0 1 0-45.248l45.248-45.248a32 32 0 0 1 45.248 45.248l-45.248 45.248a32 32 0 0 1-45.248 0"})]))}),Rn=o({name:"Tools",__name:"tools",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M764.416 254.72a351.7 351.7 0 0 1 86.336 149.184H960v192.064H850.752a351.7 351.7 0 0 1-86.336 149.312l54.72 94.72-166.272 96-54.592-94.72a352.64 352.64 0 0 1-172.48 0L371.136 936l-166.272-96 54.72-94.72a351.7 351.7 0 0 1-86.336-149.312H64v-192h109.248a351.7 351.7 0 0 1 86.336-149.312L204.8 160l166.208-96h.192l54.656 94.592a352.64 352.64 0 0 1 172.48 0L652.8 64h.128L819.2 160l-54.72 94.72zM704 499.968a192 192 0 1 0-384 0 192 192 0 0 0 384 0"})]))}),In=o({name:"View",__name:"view",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}),Nn=o({name:"Warning",__name:"warning",setup:e=>(e,t)=>(u(),c("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d("path",{fill:"currentColor",d:"M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896m0 832a384 384 0 0 0 0-768 384 384 0 0 0 0 768m48-176a48 48 0 1 1-96 0 48 48 0 0 1 96 0m-48-464a32 32 0 0 1 32 32v288a32 32 0 0 1-64 0V288a32 32 0 0 1 32-32"})]))});function Bn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Fn={exports:{}};(Fn.exports={}).forEach=function(e,t){for(var a=0;a<e.length;a++){var l=t(e[a]);if(l)return l}};var Yn=Fn.exports,Wn={exports:{}},Un=Wn.exports={};Un.isIE=function(e){return!(-1===(t=navigator.userAgent.toLowerCase()).indexOf("msie")&&-1===t.indexOf("trident")&&-1===t.indexOf(" edge/")||e&&e!==function(){var e=3,t=document.createElement("div"),a=t.getElementsByTagName("i");do{t.innerHTML="\x3c!--[if gt IE "+ ++e+"]><i></i><![endif]--\x3e"}while(a[0]);return e>4?e:void 0}());var t},Un.isLegacyOpera=function(){return!!window.opera};var $n=Wn.exports,Kn={exports:{}};(Kn.exports={}).getOption=function(e,t,a){var l=e[t];return null==l&&void 0!==a?a:l};var Xn=Kn.exports;function qn(){var e={},t=0,a=0,l=0;return{add:function(n,s){s||(s=n,n=0),n>a?a=n:n<l&&(l=n),e[n]||(e[n]=[]),e[n].push(s),t++},process:function(){for(var t=l;t<=a;t++)for(var n=e[t],s=0;s<n.length;s++)(0,n[s])()},size:function(){return t}}}var Gn="_erd";function Zn(e){return e[Gn]}var Jn={initState:function(e){return e[Gn]={},Zn(e)},getState:Zn,cleanState:function(e){delete e[Gn]}},Qn=$n,es=Yn.forEach,ts=Yn.forEach,as=$n,ls=Jn;function ns(e){return Array.isArray(e)||void 0!==e.length}function ss(e){if(Array.isArray(e))return e;var t=[];return ts(e,function(e){t.push(e)}),t}function os(e){return e&&1===e.nodeType}var rs=function(e){var t,a;if((e=e||{}).idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var l=function(e){var t=e.idGenerator,a=e.stateHandler.getState;return{get:function(e){var t=a(e);return t&&void 0!==t.id?t.id:null},set:function(e){var l=a(e);if(!l)throw new Error("setId required the element to have a resize detection state.");var n=t.generate();return l.id=n,n}}}({idGenerator:(a=1,{generate:function(){return a++}}),stateHandler:ls});t=l}var n=e.reporter;n||(n=function(e){function t(){}var a={log:t,warn:t,error:t};if(!e&&window.console){var l=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var a=0;a<arguments.length;a++)e(arguments[a])}};l(a,"log"),l(a,"warn"),l(a,"error")}return a}(!1===n));var s=is(e,"batchProcessor",function(e){var t=(e=e||{}).reporter,a=Xn.getOption(e,"async",!0),l=Xn.getOption(e,"auto",!0);l&&!a&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),a=!0);var n,s=qn(),o=!1;function r(){for(o=!0;s.size();){var e=s;s=qn(),e.process()}o=!1}function i(){n=setTimeout(r,0)}return{add:function(e,t){!o&&l&&a&&0===s.size()&&i(),s.add(e,t)},force:function(e){o||(void 0===e&&(e=a),n&&(clearTimeout(n),n=null),e?i():r())}}}({reporter:n})),o={};o.callOnAdd=!!is(e,"callOnAdd",!0),o.debug=!!is(e,"debug",!1);var r,i=function(e){var t={};function a(a){var l=e.get(a);return void 0===l?[]:t[l]||[]}return{get:a,add:function(a,l){var n=e.get(a);t[n]||(t[n]=[]),t[n].push(l)},removeListener:function(e,t){for(var l=a(e),n=0,s=l.length;n<s;++n)if(l[n]===t){l.splice(n,1);break}},removeAllListeners:function(e){var t=a(e);t&&(t.length=0)}}}(t),c=function(e){var t=e.stateHandler.getState;return{isDetectable:function(e){var a=t(e);return a&&!!a.isDetectable},markAsDetectable:function(e){t(e).isDetectable=!0},isBusy:function(e){return!!t(e).busy},markBusy:function(e,a){t(e).busy=!!a}}}({stateHandler:ls}),u=is(e,"strategy","object"),d=is(e,"important",!1),h={reporter:n,batchProcessor:s,stateHandler:ls,idHandler:t,important:d};if("scroll"===u&&(as.isLegacyOpera()?(n.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),u="object"):as.isIE(9)&&(n.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),u="object")),"scroll"===u)r=function(e){var t=(e=e||{}).reporter,a=e.batchProcessor,l=e.stateHandler.getState;e.stateHandler.hasState;var n=e.idHandler;if(!a)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var s=function(){var e=document.createElement("div");e.style.cssText=i(["position: absolute","width: 1000px","height: 1000px","visibility: hidden","margin: 0","padding: 0"]);var t=document.createElement("div");t.style.cssText=i(["position: absolute","width: 500px","height: 500px","overflow: scroll","visibility: none","top: -1500px","left: -1500px","visibility: hidden","margin: 0","padding: 0"]),t.appendChild(e),document.body.insertBefore(t,document.body.firstChild);var a=500-t.clientWidth,l=500-t.clientHeight;return document.body.removeChild(t),{width:a,height:l}}(),o="erd_scroll_detection_container";function r(e){!function(e,t,a){if(!e.getElementById(t)){var l=a+"_animation",n=a+"_animation_active",s="/* Created by the element-resize-detector library. */\n";s+="."+a+" > div::-webkit-scrollbar { "+i(["display: none"])+" }\n\n",s+="."+n+" { "+i(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+l,"animation-name: "+l])+" }\n",s+="@-webkit-keyframes "+l+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",function(a,l){l=l||function(t){e.head.appendChild(t)};var n=e.createElement("style");n.innerHTML=a,n.id=t,l(n)}(s+="@keyframes "+l+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }")}}(e,"erd_scroll_detection_scrollbar_style",o)}function i(t){var a=e.important?" !important; ":"; ";return(t.join(a)+a).trim()}function c(e,a,l){if(e.addEventListener)e.addEventListener(a,l);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+a,l)}}function u(e,a,l){if(e.removeEventListener)e.removeEventListener(a,l);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+a,l)}}function d(e){return l(e).container.childNodes[0].childNodes[0].childNodes[0]}function h(e){return l(e).container.childNodes[0].childNodes[0].childNodes[1]}return r(window.document),{makeDetectable:function(e,r,u){function p(){if(e.debug){var a=Array.prototype.slice.call(arguments);if(a.unshift(n.get(r),"Scroll: "),t.log.apply)t.log.apply(null,a);else for(var l=0;l<a.length;l++)t.log(a[l])}}function v(e){var t=l(e).container.childNodes[0],a=window.getComputedStyle(t);return!a.width||-1===a.width.indexOf("px")}function f(){var e=window.getComputedStyle(r),t={};return t.position=e.position,t.width=r.offsetWidth,t.height=r.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function m(){if(p("storeStyle invoked."),l(r)){var e=f();l(r).style=e}else p("Aborting because element has been uninstalled")}function g(e,t,a){l(e).lastWidth=t,l(e).lastHeight=a}function b(){return 2*s.width+1}function y(){return 2*s.height+1}function x(e){return e+10+b()}function w(e){return e+10+y()}function C(e,t,a){var l=d(e),n=h(e),s=x(t),o=w(a),r=function(e){return 2*e+b()}(t),i=function(e){return 2*e+y()}(a);l.scrollLeft=s,l.scrollTop=o,n.scrollLeft=r,n.scrollTop=i}function M(){var e=l(r).container;if(!e){(e=document.createElement("div")).className=o,e.style.cssText=i(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),l(r).container=e,function(e){e.className+=" "+o+"_animation_active"}(e),r.appendChild(e);var t=function(){l(r).onRendered&&l(r).onRendered()};c(e,"animationstart",t),l(r).onAnimationStart=t}return e}function S(){if(p("Injecting elements"),l(r)){!function(){var a=l(r).style;if("static"===a.position){r.style.setProperty("position","relative",e.important?"important":"");var n=function(e,t,a,l){var n=a[l];"auto"!==n&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(n)&&(e.warn("An element that is positioned static has style."+l+"="+n+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+l+" will be set to 0. Element: ",t),t.style[l]=0)};n(t,r,a,"top"),n(t,r,a,"right"),n(t,r,a,"bottom"),n(t,r,a,"left")}}();var a=l(r).container;a||(a=M());var n,u,d,h,v=s.width,f=s.height,m=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),g=i(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(["left: "+(n=(n=-(1+v))?n+"px":"0"),"top: "+(u=(u=-(1+f))?u+"px":"0"),"right: "+(h=(h=-v)?h+"px":"0"),"bottom: "+(d=(d=-f)?d+"px":"0")])),b=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),y=i(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),x=i(["position: absolute","left: 0","top: 0"]),w=i(["position: absolute","width: 200%","height: 200%"]),C=document.createElement("div"),S=document.createElement("div"),E=document.createElement("div"),D=document.createElement("div"),k=document.createElement("div"),O=document.createElement("div");C.dir="ltr",C.style.cssText=m,C.className=o,S.className=o,S.style.cssText=g,E.style.cssText=b,D.style.cssText=x,k.style.cssText=y,O.style.cssText=w,E.appendChild(D),k.appendChild(O),S.appendChild(E),S.appendChild(k),C.appendChild(S),a.appendChild(C),c(E,"scroll",L),c(k,"scroll",T),l(r).onExpandScroll=L,l(r).onShrinkScroll=T}else p("Aborting because element has been uninstalled");function L(){var e=l(r);e&&e.onExpand?e.onExpand():p("Aborting expand scroll handler: element has been uninstalled")}function T(){var e=l(r);e&&e.onShrink?e.onShrink():p("Aborting shrink scroll handler: element has been uninstalled")}}function E(){function s(t,a,l){var n=function(e){return d(e).childNodes[0]}(t),s=x(a),o=w(l);n.style.setProperty("width",s+"px",e.important?"important":""),n.style.setProperty("height",o+"px",e.important?"important":"")}function o(o){var c=r.offsetWidth,u=r.offsetHeight,d=c!==l(r).lastWidth||u!==l(r).lastHeight;p("Storing current size",c,u),g(r,c,u),a.add(0,function(){if(d)if(l(r))if(i()){if(e.debug){var a=r.offsetWidth,o=r.offsetHeight;a===c&&o===u||t.warn(n.get(r),"Scroll: Size changed before updating detector elements.")}s(r,c,u)}else p("Aborting because element container has not been initialized");else p("Aborting because element has been uninstalled")}),a.add(1,function(){l(r)?i()?C(r,c,u):p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")}),d&&o&&a.add(2,function(){l(r)?i()?o():p("Aborting because element container has not been initialized"):p("Aborting because element has been uninstalled")})}function i(){return!!l(r).container}function c(){p("notifyListenersIfNeeded invoked");var e=l(r);return void 0===l(r).lastNotifiedWidth&&e.lastWidth===e.startSize.width&&e.lastHeight===e.startSize.height?p("Not notifying: Size is the same as the start size, and there has been no notification yet."):e.lastWidth===e.lastNotifiedWidth&&e.lastHeight===e.lastNotifiedHeight?p("Not notifying: Size already notified"):(p("Current size not notified, notifying..."),e.lastNotifiedWidth=e.lastWidth,e.lastNotifiedHeight=e.lastHeight,void es(l(r).listeners,function(e){e(r)}))}function u(){p("Scroll detected."),v(r)?p("Scroll event fired while unrendered. Ignoring..."):o(c)}if(p("registerListenersAndPositionElements invoked."),l(r)){l(r).onRendered=function(){if(p("startanimation triggered."),v(r))p("Ignoring since element is still unrendered...");else{p("Element rendered.");var e=d(r),t=h(r);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(p("Scrollbars out of sync. Updating detector elements..."),o(c))}},l(r).onExpand=u,l(r).onShrink=u;var f=l(r).style;s(r,f.width,f.height)}else p("Aborting because element has been uninstalled")}function D(){if(p("finalizeDomMutation invoked."),l(r)){var e=l(r).style;g(r,e.width,e.height),C(r,e.width,e.height)}else p("Aborting because element has been uninstalled")}function k(){u(r)}function O(){var e;p("Installing..."),l(r).listeners=[],e=f(),l(r).startSize={width:e.width,height:e.height},p("Element start size",l(r).startSize),a.add(0,m),a.add(1,S),a.add(2,E),a.add(3,D),a.add(4,k)}u||(u=r,r=e,e=null),e=e||{},p("Making detectable..."),function(e){return!function(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}(e)||null===window.getComputedStyle(e)}(r)?(p("Element is detached"),M(),p("Waiting until element is attached..."),l(r).onRendered=function(){p("Element is now attached"),O()}):O()},addListener:function(e,t){if(!l(e).listeners.push)throw new Error("Cannot add listener to an element that is not detectable.");l(e).listeners.push(t)},uninstall:function(e){var t=l(e);t&&(t.onExpandScroll&&u(d(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&u(h(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&u(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))},initDocument:r}}(h);else{if("object"!==u)throw new Error("Invalid strategy name: "+u);r=function(e){var t=(e=e||{}).reporter,a=e.batchProcessor,l=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function n(t){var a=e.important?" !important; ":"; ";return(t.join(a)+a).trim()}function s(e){return l(e).object}return{makeDetectable:function(e,s,o){o||(o=s,s=e,e=null),(e=e||{}).debug,Qn.isIE(8)?o(s):function(s,o){var r=n(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),i=!1,c=window.getComputedStyle(s),u=s.offsetWidth,d=s.offsetHeight;function h(){function a(){if("static"===c.position){s.style.setProperty("position","relative",e.important?"important":"");var a=function(t,a,l,n){var s=l[n];"auto"!==s&&"0"!==function(e){return e.replace(/[^-\d\.]/g,"")}(s)&&(t.warn("An element that is positioned static has style."+n+"="+s+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+n+" will be set to 0. Element: ",a),a.style.setProperty(n,"0",e.important?"important":""))};a(t,s,c,"top"),a(t,s,c,"right"),a(t,s,c,"bottom"),a(t,s,c,"left")}}""!==c.position&&(a(),i=!0);var n=document.createElement("object");n.style.cssText=r,n.tabIndex=-1,n.type="text/html",n.setAttribute("aria-hidden","true"),n.onload=function(){i||a(),function e(t,a){if(!t.contentDocument){var n=l(t);return n.checkForObjectDocumentTimeoutId&&window.clearTimeout(n.checkForObjectDocumentTimeoutId),void(n.checkForObjectDocumentTimeoutId=setTimeout(function(){n.checkForObjectDocumentTimeoutId=0,e(t,a)},100))}a(t.contentDocument)}(this,function(e){o(s)})},Qn.isIE()||(n.data="about:blank"),l(s)&&(s.appendChild(n),l(s).object=n,Qn.isIE()&&(n.data="about:blank"))}l(s).startSize={width:u,height:d},a?a.add(h):h()}(s,o)},addListener:function(e,t){function a(){t(e)}if(Qn.isIE(8))l(e).object={proxy:a},e.attachEvent("onresize",a);else{var n=s(e);if(!n)throw new Error("Element is not detectable by this strategy.");n.contentDocument.defaultView.addEventListener("resize",a)}},uninstall:function(e){if(l(e)){var t=s(e);t&&(Qn.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),l(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(l(e).checkForObjectDocumentTimeoutId),delete l(e).object)}}}}(h)}var p={};return{listenTo:function(e,a,l){function s(e){var t=i.get(e);ts(t,function(t){t(e)})}function u(e,t,a){i.add(t,a),e&&a(t)}if(l||(l=a,a=e,e={}),!a)throw new Error("At least one element required.");if(!l)throw new Error("Listener required.");if(os(a))a=[a];else{if(!ns(a))return n.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");a=ss(a)}var h=0,v=is(e,"callOnAdd",o.callOnAdd),f=is(e,"onReady",function(){}),m=is(e,"debug",o.debug);ts(a,function(e){ls.getState(e)||(ls.initState(e),t.set(e));var o=t.get(e);if(m&&n.log("Attaching listener to element",o,e),!c.isDetectable(e))return m&&n.log(o,"Not detectable."),c.isBusy(e)?(m&&n.log(o,"System busy making it detectable"),u(v,e,l),p[o]=p[o]||[],void p[o].push(function(){++h===a.length&&f()})):(m&&n.log(o,"Making detectable..."),c.markBusy(e,!0),r.makeDetectable({debug:m,important:d},e,function(e){if(m&&n.log(o,"onElementDetectable"),ls.getState(e)){c.markAsDetectable(e),c.markBusy(e,!1),r.addListener(e,s),u(v,e,l);var t=ls.getState(e);if(t&&t.startSize){var i=e.offsetWidth,d=e.offsetHeight;t.startSize.width===i&&t.startSize.height===d||s(e)}p[o]&&ts(p[o],function(e){e()})}else m&&n.log(o,"Element uninstalled before being detectable.");delete p[o],++h===a.length&&f()}));m&&n.log(o,"Already detecable, adding listener."),u(v,e,l),h++}),h===a.length&&f()},removeListener:i.removeListener,removeAllListeners:i.removeAllListeners,uninstall:function(e){if(!e)return n.error("At least one element is required.");if(os(e))e=[e];else{if(!ns(e))return n.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=ss(e)}ts(e,function(e){i.removeAllListeners(e),r.uninstall(e),ls.cleanState(e)})},initDocument:function(e){r.initDocument&&r.initDocument(e)}}};function is(e,t,a){var l=e[t];return null==l&&void 0!==a?a:l}var cs=Bn(rs);const us=(e,t)=>{const a=cs();let l=null;a.listenTo(e,()=>{null!==l&&clearTimeout(l),l=setTimeout(()=>{t&&t(e),clearTimeout(l)},200)}),h(()=>{a.removeListener(e,()=>{})})},ds=e=>{if(null==e)return e;let t;if("object"==typeof e){t=Array.isArray(e)?[]:{};for(let a in e)"object"==typeof e[a]?t[a]=ds(e[a]):t[a]=e[a]}else t=e;return t},hs=(e,t)=>{const a=[],l=new Map;for(const n of e){const e=n[t];l.has(e)||(l.set(e,!0),a.push(n))}return a},ps=e=>null!=e&&("string"==typeof e?""!==e.trim():!1!==e),vs=(...e)=>{let t=null;for(let a=0;a<e.length;a++){const l=e[a];if(null!=l){t=l;break}}return t},fs=(e,t,a)=>(Object.defineProperty(e,a,{get:()=>t[a]}),{target:e,source:t}),ms=()=>{const e=((e,t="yyyy-MM-dd")=>{if("Invalid Date"!=e){const a={"M+":e.getMonth()+1,"d+":e.getDate(),"h+":e.getHours(),"m+":e.getMinutes(),"s+":e.getSeconds(),"q+":Math.floor((e.getMonth()+3)/3),S:e.getMilliseconds()};/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(e.getFullYear()+"").substring(4-RegExp.$1.length)));for(const e in a)new RegExp("("+e+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?a[e]:("00"+a[e]).substring((""+a[e]).length)));return t}return""})(new Date,"yyyyMMddhhmmsss")+Math.random().toString(10).substring(2,8);return String(e)};function gs(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}var bs=o({setup(){const e=t("options",{}),{t:a}=Wl();return ps(e.setting.headerBarFontActiveColor)||(e.setting.headerBarFontActiveColor=e.setting.themeColor),{config:e,t:a}},render(){let e,a;const l=t("__slots__",{}),n=t("__ns__",{}),s=this.t,o=this.config,i=t("updateOptions",null),c=p({...o.setting}),u=()=>{const e={...o,setting:{...c}};i(e)},d=e=>{if(!e)return L({type:"warning",message:"主题颜色不能为空"}),!1;c.themeColor=e,Ql("--el-color-primary",e),u()},h=()=>{const e=document.documentElement;c.isDark?(e.setAttribute("data-theme","dark"),e.classList.add("dark")):(e.setAttribute("data-theme",""),e.classList.remove("dark")),u()},f=(e,t,a)=>{c[t]=e,Jl(a,e),u()},m=[{type:"defaults",text:"默认"},{type:"classic",text:"经典"},{type:"transverse",text:"横向"},{type:"columns",text:"分栏"},{type:"composite",text:"综合"}];return r(P,null,{default:()=>[r(A,{"border-style":"dashed"},gs(e=s("next.layout.setting.globalTheme"))?e:{default:()=>[e]}),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.themeColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.themeColor,"onUpdate:modelValue":e=>c.themeColor=e,predefine:["#409eff","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:d},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.darkMode")]),r("div",{class:n.be("config-bar-item","value")},[r(j,{modelValue:c.isDark,"onUpdate:modelValue":e=>c.isDark=e,"inline-prompt":!0,size:"large","active-icon":Tn,"inactive-icon":Vn,"active-color":"#1f1f1f","inactive-color":"#dcdfe6",onChange:h},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerBackground")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarColor,"onUpdate:modelValue":e=>c.headerBarColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarColor","--next-layout-bg-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerTextColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarFontColor,"onUpdate:modelValue":e=>c.headerBarFontColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarFontColor","--next-layout-font-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerActiveTextColor")]),r("div",{class:n.be("config-bar-item","value")},[r(_,{modelValue:c.headerBarFontActiveColor,"onUpdate:modelValue":e=>c.headerBarFontActiveColor=e,predefine:["#282c34","#ff4500","#ff8c00","#ffd700","#90ee90","#00ced1","#1e90ff","#c71585","#FB07A0"],"show-alpha":!0,onChange:e=>f(e,"headerBarFontActiveColor","--next-layout-active-color")},null)])]),r("div",{class:n.b("config-bar-item")},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.headerGradient")]),r("div",{class:n.be("config-bar-item","value")},[r(v("el-switch"),{modelValue:c.isHeaderBarColorGradual,"onUpdate:modelValue":e=>c.isHeaderBarColorGradual=e,onChange:u},null)])]),r(A,{"border-style":"dashed"},gs(a=s("next.layout.setting.layoutMode"))?a:{default:()=>[a]}),r("ul",{class:n.b("config-bar-layout")},[m.map(e=>r("li",{class:[n.be("config-bar-layout",e.type),n.is("active",c.layout===e.type)],onClick:t=>((e,t)=>{e.stopPropagation(),c.layout=t.type,u()})(t,e)},[r("div",{class:"layout-wrap"},[r("div",{class:"layout-box"},[r("p",{class:"layout-text"},[e.text])])]),r("aside",null,null)]))]),r("div",{class:n.b("config-bar-item"),style:{"margin-top":"20px"}},[r("span",{class:n.be("config-bar-item","label")},[s("next.layout.setting.isShowTab")]),r("div",{class:n.be("config-bar-item","value")},[r(j,{modelValue:o.showTabs,"onUpdate:modelValue":e=>o.showTabs=e},null)])]),l.setting?.({config:c})]})}}),ys=o({setup(){const e=t(Yl,a()),n=t("options",{}),{t:s}=Wl(),{toggle:o,isFullscreen:r}=we(),i=a(l(()=>n.language).value),c=a(!1);return{locale:e,config:n,t:s,toggle:o,isFullscreen:r,language:i,settingDrawer:c,openSettingDrawer:()=>{c.value=!0},closeSettingDrawer:()=>{c.value=!1}}},render(){const e=t("__ns__",{}),a=this.config,l=t("__emit__",{}),n=this.$slots,s=this.t,o=this.isFullscreen,c=a.profile,u=a.userDropdown,d=a.languageDropdown;return r(i,null,[r("ul",{class:e.b("header-tools")},[n[cn]?.(),r("li",null,[r(z,{"show-timeout":70,"hide-timeout":50,trigger:"click",onCommand:e=>{this.language=e,l("changeLanguage",e),a.onChangeLanguage&&a.onChangeLanguage(e)}},{default:()=>r("div",null,[r(R,{size:16},{default:()=>[r("svg",{class:"icon",viewBox:"0 0 1070 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"1855",width:"128",height:"128"},[r("path",{d:"M232.58156522 358.13286957C244.86956522 394.4626087 265.17147826 425.984 293.48730435 453.76556522c24.04173913-26.17878261 42.2066087-58.23443478 53.96034782-95.63269565H232.58156522z","p-id":"1856"},null),r("path",{d:"M981.61530435 143.36h-448.77913044L507.19165217 6.05495652h-416.72347826c-45.94643478 0-83.34469565 37.39826087-83.34469565 83.34469565v708.42991305c0 45.94643478 37.39826087 83.34469565 83.34469565 83.34469565h379.85947826l-30.45286956 137.30504348h541.74052174c45.94643478 0 83.34469565-37.39826087 83.34469565-83.34469565V226.70469565c0-45.94643478-37.39826087-83.34469565-83.34469565-83.34469565zM415.83304348 564.35756522c-49.152-18.16486957-89.75582609-41.13808696-122.34573913-67.85113044-34.19269565 30.45286957-76.93356522 52.89182609-126.61982609 66.7826087l-17.09634783-28.31582609c48.61773913-12.82226087 89.22156522-32.05565217 121.2772174-59.30295652-33.12417391-33.65843478-56.0973913-72.65947826-68.91965218-117.00313044h-46.48069565v-32.05565217H276.92521739c-7.47965217-13.89078261-17.09634783-27.24730435-28.31582609-40.06956522l32.05565218-11.75373913c11.21947826 14.42504348 21.37043478 31.5213913 30.45286956 51.28904348h115.9346087v32.05565218h-46.48069565c-14.95930435 45.94643478-36.32973913 84.41321739-64.64556522 115.40034782 31.5213913 25.11026087 71.05669565 45.94643478 117.5373913 63.04278261l-17.63060869 27.78156522z m607.45460869 370.24278261c0 22.97321739-18.69913043 41.67234783-41.67234782 41.67234782H492.23234783l20.83617391-95.63269565h156.53843478l-89.22156522-497.39686957-0.53426087 2.67130435-3.73982608-19.76765217 1.06852174 0.53426087-32.58991305-181.64869565H982.14956522c22.97321739 0 41.67234783 18.69913043 41.67234782 41.67234782v707.89565218z","p-id":"1857"},null),r("path",{d:"M684.56626087 541.38434783h114.86608696v-30.45286957h-114.86608696V450.02573913h122.34573913v-30.45286956h-158.14121739v219.04695652h162.94956522V608.16695652h-127.15408696v-66.78260869z m239.88313043-65.71408696c-9.61669565 0-18.16486957 1.60278261-26.1787826 5.87686956-7.47965217 3.73982609-14.95930435 9.61669565-20.83617392 17.09634783V479.94434783h-34.72695652v158.67547826h34.72695652v-95.63269566c1.06852174-12.82226087 5.3426087-22.43895652 12.82226087-29.38434782 6.41113043-5.87686957 13.89078261-9.08243478 22.43895652-9.08243478 24.04173913 0 35.79547826 12.82226087 35.79547826 39.00104347v94.56417392h34.72695653v-97.76973913c1.06852174-43.27513043-19.2333913-64.64556522-58.76869566-64.64556522z","p-id":"1858"},null)])]})]),dropdown:()=>{let e;return r(H,null,"function"==typeof(t=e=d.map(e=>r(V,{command:e.value,disabled:this.language===e.value},{default:()=>[e.label]})))||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?e:{default:()=>[e]});var t}})]),r("li",null,[r("span",{style:{display:"inline-block",lineHeight:1},onClick:this.toggle},[r(R,{size:16},{default:()=>[o?r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2676",width:"128",height:"128"},[r("path",{d:"M749.248 704H864a32 32 0 1 0 0-64H672a32 32 0 0 0-32 32v192a32 32 0 1 0 64 0v-114.752l137.36 137.36a32 32 0 1 0 45.232-45.264L749.248 704zM320 749.248V864a32 32 0 1 0 64 0V672a32 32 0 0 0-32-32H160a32 32 0 1 0 0 64h114.752l-137.36 137.36a32 32 0 1 0 45.264 45.232L320 749.248zM749.248 320H864a32 32 0 1 1 0 64H672a32 32 0 0 1-32-32V160a32 32 0 1 1 64 0v114.752l137.36-137.36a32 32 0 1 1 45.232 45.264L749.248 320zM320 274.752V160a32 32 0 1 1 64 0v192a32 32 0 0 1-32 32H160a32 32 0 1 1 0-64h114.752l-137.36-137.36a32 32 0 1 1 45.264-45.232L320 274.752z","p-id":"2677"},null)]):r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2522",width:"128",height:"128"},[r("path",{d:"M237.248 192H352a32 32 0 1 0 0-64H160a32 32 0 0 0-32 32v192a32 32 0 1 0 64 0v-114.752l137.36 137.36a32 32 0 1 0 45.232-45.264L237.248 192zM832 237.248V352a32 32 0 1 0 64 0V160a32 32 0 0 0-32-32H672a32 32 0 1 0 0 64h114.752l-137.36 137.36a32 32 0 1 0 45.264 45.232L832 237.248zM237.248 832H352a32 32 0 1 1 0 64H160a32 32 0 0 1-32-32V672a32 32 0 1 1 64 0v114.752l137.36-137.36a32 32 0 1 1 45.232 45.264L237.248 832zM832 786.752V672a32 32 0 1 1 64 0v192a32 32 0 0 1-32 32H672a32 32 0 1 1 0-64h114.752l-137.36-137.36a32 32 0 1 1 45.264-45.232L832 786.752z","p-id":"2523"},null)])]})])]),n[un]?.(),r("li",null,[r(z,{"show-timeout":70,"hide-timeout":80,"popper-class":e.be("header-tools","userDropdown"),onCommand:e=>{l("changeUserDropdown",e),a.onChangeUserDropdown&&a.onChangeUserDropdown(e)}},{default:()=>r("span",{class:e.be("header-tools","user")},[c?r("img",{class:"user-photo",src:c},null):null,r("span",null,[a.userName]),r(R,{class:"el-icon--right"},{default:()=>[r(mn,null,null)]})]),dropdown:()=>r(H,null,{default:()=>[u?.map(e=>r(V,{command:e.value,divided:!!e.divided},{default:()=>[e.svg?r("span",{innerHTML:e.svg,class:"item-svg"},null):null,e.iconfont?r("i",{class:e.iconfont},null):null,s(e.label)]}))]})})]),r("li",null,[r("span",{style:{display:"inline-block",lineHeight:1},onClick:this.openSettingDrawer},[r(R,{size:16},{default:()=>[r(Hn,null,null)]})])])]),r(m,{to:"body"},{default:()=>[r(I,{modelValue:this.settingDrawer,"onUpdate:modelValue":e=>this.settingDrawer=e,title:this.t("next.layout.setting.systemSetting"),direction:"rtl",size:"380px",class:e.be("drawer","setting"),"destroy-on-close":!0,beforeClose:this.closeSettingDrawer},{default:()=>[r(bs,null,null)]})]})])}});const{getLightColor:xs}=ql();var ws=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,n=t("options",{}),s=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=n.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${xs(t,.5)})`}:""}),o={};return e[cn]&&(o[cn]=()=>e[cn]()),e[un]&&(o[un]=()=>e[un]()),r("header",{class:a.b("header"),style:s.value},[r(fn,null,null),r("div",{class:a.bf("header","right")},[r(ys,null,(i=o,"function"==typeof i||"[object Object]"===Object.prototype.toString.call(i)&&!f(i)?o:{default:()=>[o]}))])]);var i}}),Cs=o({props:{meta:{type:Object,default:()=>({})}},setup(e){const a=t("ns",{}),{t:l}=Wl(),n=e.meta;return()=>r(i,null,[r("strong",{class:a.be("item","icon")},[n.icon?r("i",{class:n.icon},null):r("svg",{class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"19771",width:"32",height:"32"},[r("path",{d:"M512 958.8C265.6 958.8 65.2 758.4 65.2 512S265.6 65.2 512 65.2 958.8 265.6 958.8 512 758.4 958.8 512 958.8z m0-832c-212.4 0-385.2 172.8-385.2 385.2S299.6 897.2 512 897.2 897.2 724.4 897.2 512 724.4 126.8 512 126.8z","p-id":"19772"},null),r("path",{d:"M512 512m-169.5 0a169.5 169.5 0 1 0 339 0 169.5 169.5 0 1 0-339 0Z","p-id":"19773"},null)])]),r("span",{class:a.be("item","title")},[l(n.title)])])}});const Ms=o({name:"NextMenuItem",props:{menuData:{type:Array,required:!0}},setup(e){const a=t("ns",{}),n=l(()=>e.menuData).value;return()=>r(i,null,[r(i,null,[n.map(e=>e.children?.length?vs(e.meta?.isHide,!1)?null:r(B,{"popper-class":a.b("popper"),index:e.path||e.id,teleported:!0},{title:()=>r(Cs,{meta:e.meta},null),default:()=>r(Ms,{menuData:e.children},null)}):vs(e.meta?.isHide,!1)?null:r(N,{index:e.path},{default:()=>[r(Cs,{meta:e.meta},null)]}))])])}}),Ss=Te("menu"),Es=on(o({name:"NextMenu",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},router:{type:Boolean,default:!0},mode:{type:String,values:["horizontal","vertical"],default:"horizontal"},menuTree:{type:Array,default:()=>[]},collapse:{type:Boolean,default:!1}},setup(t){g("ns",Ss);const l=e().appContext.config.globalProperties.$router,n=l.currentRoute?.value.fullPath,s=a(n);b(()=>l.currentRoute?.value,e=>{s.value=e.fullPath});const o=a(0);return b(()=>t.menuTree,()=>{o.value++},{deep:!0}),()=>r(i,null,[r(F,{key:o.value,class:[Ss.b(),t.className],style:t.style,"popper-class":Ss.b("popper"),defaultActive:s.value,router:t.router,mode:t.mode,collapse:t.collapse,ellipsis:!0},{default:()=>[r(i,null,[t.menuTree.map(e=>e.children?.length?vs(e.meta?.isHide,!1)?null:r(B,{"popper-class":Ss.b("popper"),index:e.path||e.id,teleported:!0},{title:()=>r(Cs,{meta:e.meta},null),default:()=>r(Ms,{menuData:e.children},null)}):vs(e.meta?.isHide,!1)?null:r(N,{"popper-class":Ss.b("popper"),index:e.path},{default:()=>[r(Cs,{meta:e.meta},null)]}))])]})])}}));var Ds=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,l=t("options",{});return r("aside",{class:a.b("sidebar")},[r(P,null,{default:()=>[e[rn]?e[rn]():r(Es,{mode:"vertical",menuTree:l.menuTree},null)]})])}});const ks=Te("layout-defaults");var Os=o({props:{},setup:()=>(g("ns",ks),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(Y,{class:ks.b()},{default:()=>{return[r(Ds,null,null),r("div",{class:[ks.b("content")]},[r(ws,null,(t=s,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[ks.bf("main"),ks.is("layout-tabs",o.value)]},[e.default?.()])])];var t}})}});const{getLightColor:Ls}=ql();var Ts=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Ls(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?a[rn]():r(Es,{menuTree:s.menuTree,router:s.menuRouter,mode:s.menuMode},null)]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}});const Ps=Te("layout-transverse");var As=o({props:{},setup:()=>(g("ns",Ps),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{}),s={};e[rn]&&(s[rn]=()=>e[rn]()),e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Ts,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Ps.b("main"),Ps.is("layout-tabs",o.value)]},[e.default?.()])]);var c}});const{getLightColor:_s}=ql();var js=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${_s(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},null),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),zs=o({setup(){const l=e().appContext.config.globalProperties.$router,n=t("options",{}),s=t("ns",{}),{t:o}=Wl(),c=a(!0),u=()=>{c.value=!c.value},d=a([]),h=e=>{let t={path:e.path,query:e.query||{}};!e.path&&e.name&&(t={name:e.name,params:e.params||{}}),l.push(t)};return()=>r(i,null,[r(i,null,[r("div",{class:s.be("sidebar","content")},[c.value?r(Es,{mode:"vertical",collapse:!0,menuTree:n.menuTree},null):r("ul",{class:s.be("sidebar","menu")},[n.menuTree.map(e=>r("li",{key:e.path,class:s.be("sidebar","menu-item"),onClick:()=>(e=>{if(e.children?.length){d.value=e.children;const t=e.children[0];h(t)}else d.value=[],h(e)})(e)},[r("strong",{class:e.meta?.icon},null),r("span",{class:[s.be("sidebar","menu-text"),"text-ellipsis"]},[r(vn,{content:o(e.meta?.title)},null)])]))]),r("div",{class:[s.be("sidebar","footer")]},[r("svg",{class:c.value?"collapsed-svg":"",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1","stroke-linecap":"round","stroke-linejoin":"round",onClick:u},[r("path",{d:"m11 17-5-5 5-5"},null),r("path",{d:"m18 17-5-5 5-5"},null)])])]),!c.value&&d.value.length>0?r("div",{class:s.be("sidebar","subcontent")},[r(Es,{mode:"vertical",collapse:!1,menuTree:d.value},null)]):null])])}}),Hs=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,t=this.ns;return r("aside",{class:t.b("sidebar")},[e[dn]?e[dn]():r(zs,null,null)])}});const Vs=Te("layout-columns");var Rs=o({props:{},setup:()=>(g("ns",Vs),{}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{}),s={};e[rn]&&(s[rn]=()=>e[rn]()),e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(Y,{class:Vs.b()},{default:()=>{return[r(Hs,null,null),r("div",{class:[Vs.b("content")]},[r(js,null,(t=s,"function"==typeof t||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?s:{default:()=>[s]})),l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Vs.bf("main"),Vs.is("layout-tabs",o.value)]},[e.default?.()])])];var t}})}});const{getLightColor:Is}=ql();var Ns=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Is(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?.()]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),Bs=o({setup:()=>({ns:t("ns",{})}),render(){const e=this.$slots,a=this.ns,l=t("options",{});return r("aside",{class:a.b("sidebar")},[r(P,null,{default:()=>[e[rn]?e[rn]():r(Es,{mode:"vertical",menuTree:l.menuTree},null)]})])}});const Fs=Te("layout-classic");var Ys=o({props:{},setup:()=>(g("ns",Fs),{ns:Fs}),render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Ns,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),r("div",{class:[Fs.b("content"),Fs.is("layout-tabs",o.value)]},[r(Bs,null,null),r("div",{class:Fs.b("container")},[l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Fs.b("main")]},[e.default?.()])])])]);var c}});const Ws=(e,t)=>{let a=null;const l=(t,n)=>{for(const s of t){if(s.path===e)return a=n,!0;if(s.children&&l(s.children,n??s))return!0}return!1};return l(t,null),a},Us=Te("menu");var $s=o({props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},menuTree:{type:Array,default:()=>[]}},setup(l){g("ns",Us);const n=t("updateSubmentTree"),s=e().appContext.config.globalProperties.$router,o=s.currentRoute?.value.fullPath,c=Ws(o,l.menuTree),u=a(c?.id);c?.id&&1===c.meta?.level&&n(c.children),b(()=>s.currentRoute?.value,e=>{const t=Ws(e.fullPath,l.menuTree);if(u.value=t?.id,!t)return n([]);t?.id&&1===t.meta?.level&&n(t.children)});const d=e=>{let t=e[0];for(let a=0;a<e.length;a++){const l=e[a];if(l.children?.length&&(t=d(l.children),t))break}return t};return()=>r(i,null,[r(F,{class:[Us.b(),l.className],style:l.style,"popper-class":Us.b("popper"),defaultActive:u.value,mode:"horizontal",ellipsis:!0},{default:()=>[r(i,null,[l.menuTree.map(e=>vs(e.meta?.isHide,!1)?null:r(N,{index:e.id,onClick:t=>((e,t)=>{if(n(t.children),t.children?.length){const e=d(t.children);return void s.push(e.path)}s.push(t.path)})(0,e)},{default:()=>[r(Cs,{meta:e.meta},null)]}))])]})])}});const{getLightColor:Ks}=ql();var Xs=o({setup(e,{slots:a}){const n=t("ns",{}),s=t("options",{}),o=l(()=>{const{isHeaderBarColorGradual:e,headerBarColor:t}=s.setting;return e?{background:`linear-gradient(to bottom , ${t}, ${Ks(t,.5)})`}:""}),c={};return a[cn]&&(c[cn]=()=>a[cn]()),a[un]&&(c[un]=()=>a[un]()),()=>{return r(i,null,[r("header",{class:n.b("header"),style:o.value},[r(fn,null,null),r("div",{class:n.bf("header","menu")},[a[rn]?a[rn]():r($s,{menuTree:s.menuTree},null)]),r("div",{class:n.bf("header","right")},[r(ys,null,(e=c,"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?c:{default:()=>[c]}))])])]);var e}}}),qs=o({setup(e,{slots:a}){const l=t("ns",{}),n=t("submenuTree",[]);return()=>r(i,null,[0===n.value.length?null:r("aside",{class:l.b("sidebar")},[a[rn]?a[rn]():r(Es,{mode:"vertical",menuTree:n.value},null)])])}});const Gs=Te("layout-composite");var Zs=o({props:{},setup(){g("ns",Gs);const e=a([]);return g("submenuTree",e),g("updateSubmentTree",t=>{e.value=[],y(()=>{e.value=t})}),{ns:Gs,submenuTree:e}},render(){const e=this.$slots,l=t("options",{}),n=t("__emit__",{});e.menu;const s={};e[cn]&&(s[cn]=()=>e[cn]()),e[un]&&(s[un]=()=>e[un]());const o=a(!!e.tabs);return void 0===e.tabs&&l.showTabs&&(o.value=!0),r(i,null,[r(Xs,null,(c=s,"function"==typeof c||"[object Object]"===Object.prototype.toString.call(c)&&!f(c)?s:{default:()=>[s]})),r("div",{class:[Gs.b("content"),Gs.is("layout-tabs",o.value)]},[r(qs,null,null),r("div",{class:Gs.b("container")},[l.showTabs?e.tabs?e.tabs?.():r(no,{tabs:l.tabs,activeTab:l.activeTab,onChange:(...e)=>n("tabsChange",...e),onSelect:(...e)=>n("tabsSelect",...e),onClose:(...e)=>n("tabsClose",...e)},null):null,r("main",{class:[Gs.b("main")]},[e.default?.()])])])]);var c}});const Js=Te("layout"),Qs={defaults:x(Os),transverse:x(As),columns:x(Rs),classic:x(Ys),composite:x(Zs)},eo=(e,t)=>{if(Array.isArray(e))return t},to=on(o({name:"NextLayout",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["changeLanguage","changeUserDropdown","changeOptions","tabsChange","tabsSelect","tabsClose"],setup(e,{slots:t,emit:l}){const n=a(_l(hn,e.options,eo));g("options",n.value),g("__ns__",Js),g("__emit__",l),g("__slots__",t);const s=e=>{n.value=_l(n.value,e,eo),an(n.value?.setting),l("changeOptions",n.value)};return g("updateOptions",s),b(()=>e.options,e=>{s(e)},{deep:!0,immediate:!0}),{options:n.value,updateOptions:s}},render(){const e=this.$props,t=this.$slots,l=this.options.setting?.layout||"transverse",n=a(Qs[l]);w(()=>{n.value=Qs[l],n.value||(n.value=Qs.transverse)});const s={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(s[e]=()=>t[e]?.());return r("div",{class:[Js.b(),e.className],style:e.style},[C(n.value,{},{...s})])}})),ao=Te("tabs");var lo=o({name:"NextTabs",props:{activeTab:{type:[String,Number],default:"/"},tabs:{type:Array,default:()=>[]}},emits:["change","select","close"],setup(t,{emit:n}){const{t:s}=Wl(),o=e().appContext.config.globalProperties.$router,c=l(()=>o.currentRoute.value.path),u=l(()=>t.tabs),d=u.value?.findIndex(e=>e.path===c.value);if(d<0){const e=u.value[0];e&&e.path&&o.replace({path:e.path})}const h=a(d),p=a(u.value),v=e=>{const t=c.value,a=p.value.length,l=p.value.findIndex(e=>e.path===t);switch(e){case"other":l>-1&&(h.value=1,p.value=[p.value[0],p.value[l]]);break;case"left":if(l>-1){const e=p.value.slice(l);e.unshift(p.value[0]),p.value=e,h.value=1}break;case"right":if(l>-1&&l<a-1){const e=p.value.slice(0,l+1);p.value=e}break;case"all":const e=p.value[0];h.value=0,p.value=[e],f(null,e,h.value)}n("change",h.value,p.value,e)},f=(e,t,a)=>{e?.stopPropagation(),h.value=a;let l={path:t.path,query:t.query||{}};!t.path&&t.name&&(l={name:t.name,params:t.params||{}}),o.push(l),n("select",t,a)};b(()=>o.currentRoute?.value,e=>{const{tagTitle:t}=e.query,a={name:e.name,title:t||e.meta?.title,path:e.path,meta:e.meta,params:e.params,query:e.query},l=p.value.findIndex(t=>t.path===e.path);l>-1?(h.value=l,p.value[l]=a):(h.value=p.value.length,p.value.push(a)),n("change",h.value,p.value,"add")});return()=>r(i,null,[r("nav",{class:ao.b()},[r(P,null,{default:()=>[r("ul",{class:ao.b("list")},[p.value.map((e,t)=>e?r("li",{class:["tab-item",ao.is("active",h.value===t)],onClick:a=>f(a,e,t)},[r("i",{class:["tab-icon",e.meta?.icon]},null),r("span",null,[s(e.title)]),e.meta?.isAffix||"/"===e.path?null:r("span",{onClick:a=>((e,t,a)=>{e.stopPropagation();const l=c.value;if(l===t.path){const e=p.value[a-1];let t={path:e.path,query:e.query||{}};!e.path&&e.name&&(t={name:e.name,params:e.params||{}}),o.push(t),n("close",e,p.value)}p.value.splice(a,1);const s=p.value.findIndex(e=>e.path===l)||0;h.value=s>-1?s:0,n("change",h.value,p.value,"close")})(a,e,t)},[r(R,{class:"tab-close"},{default:()=>[r(Cn,null,null)]})])]):null)])]}),r(z,{"show-timeout":80,"hide-timeout":80,onCommand:v},{default:()=>r("span",{class:ao.b("tab-more")},[r("i",{class:[ao.be("tab-more","box"),ao.be("tab-more","top")]},null),r("i",{class:[ao.be("tab-more","box"),ao.be("tab-more","bottom")]},null)]),dropdown:()=>r(H,null,{default:()=>[r(V,{command:"other"},{default:()=>[r(R,null,{default:()=>[r(Cn,null,null)]}),r("span",null,[s("next.layout.tabsOther")])]}),r(V,{command:"left"},{default:()=>[r(R,null,{default:()=>[r(xn,null,null)]}),r("span",null,[s("next.layout.tabsLeft")])]}),r(V,{command:"right"},{default:()=>[r(R,null,{default:()=>[r(jn,null,null)]}),r("span",null,[s("next.layout.tabsRight")])]}),r(V,{command:"all"},{default:()=>[r(R,null,{default:()=>[r(Cn,null,null)]}),r("span",null,[s("next.layout.tabsAll")])]})]})})])])}});const no=on(lo),so=Te("container"),oo=on(o({name:"NextContainer",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},scrollbar:{type:Boolean,default:!1},padding:{type:[Boolean,String,Number],default:!0},card:{type:Boolean,default:!1}},setup(e,{slots:t}){const a=l(()=>{let t={};const a=e.padding;return"boolean"==typeof a?t=a?{padding:"15px"}:{}:"string"==typeof a?t={padding:a}:"number"==typeof a&&(t={padding:a+"px"}),t});return()=>(()=>{if(e.scrollbar){const l={"--next-container-padding":a.value.padding};return r(P,{class:[so.b(),e.className],style:{...l,...e.style}},{default:()=>[t.default?.()]})}return r("div",{class:[so.b(),e.className],style:{...a.value,...e.style}},[e.card?r("div",{class:so.b("card")},[t.default?.()]):t.default?.()])})()}}));var ro={className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},page:{type:Object,default:()=>({pageIndex:1,pageSize:10,total:0})},rowStyle:{type:Function,default:void 0},rowClassName:{type:Function,default:void 0},cellStyle:{type:Function,default:void 0},cellClassName:{type:Function,default:void 0},headerRowStyle:{type:Function,default:void 0},headerRowClassName:{type:Function,default:void 0},headerCellStyle:{type:Function,default:void 0},headerCellClassName:{type:Function,default:void 0},spanMethod:{type:Function,default:void 0}};const io=["menu-left-prefix","menu-left-suffix","menu-right-prefix","menu-right-suffix"],co=["operation-column-prefix","operation-column-suffix"];var uo={initLoadData:!0,defaultContentHeight:300,fullscreenchangeContentHeight:!1,rowKey:"id",size:"default",fit:!0,stripe:!0,border:!0,index:!0,selection:!0,headerAlign:"center",cellAlign:"center",columnMinWidth:"100px",columns:[],showSearchForm:!0,showHeaderMenu:!0,showSearchLabel:!1,searchSpan:4,searchGutter:20,searchLabelWidth:"5em",searchColumnMinWidth:300,searchColumns:[],addBtn:!0,viewBtn:!0,delBtn:!0,editBtn:!0,batchDelBtn:!1,refreshBtn:!0,settingBtn:!0,operations:!0,operationsWidth:260,operationsHeaderAlign:"center",operationsColumnAlign:"center",operationsBtnPlain:!1,operationsBtnText:!0,operationsBtnSize:"small",addBtnText:"",isPagination:!0,dialogTitle:"",dialogWidth:"60%",dialogFullscreen:!1,dialogFullscreenBtn:!0,dialogDraggable:!0,dialogFormParamsDefault:{},closeOnClickModal:!1,formColumns:[],formLabelWidth:"5em",formSpan:12,formSpanFixed:null,formColumnMinWidth:350};const ho="column-",po=e=>ho+e,vo="search-",fo=e=>vo+e,mo="form-",go=e=>mo+e,bo=Te("spin-loading");var yo=o({name:"NextSpinLoading",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},tip:{type:String,default:""}},setup(e,{expose:t}){const{t:l}=Wl(),n=a();return t({elementInstance:n}),{t:l,elementInstance:n}},render(){const e=this.t,t=this.$slots,a=this.$props,l=a.tip||e("next.loading");return r("div",{ref:"elementInstance",class:[bo.b(),a.className],style:a.style},[t.default?.(),a.loading?r("div",{class:bo.b("mask")},[r("span",{class:bo.b("mask-dot")},[r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null),r("i",{class:bo.be("mask","dot-item")},null)]),r("span",{class:bo.be("mask","text")},[l])]):null])}}),xo=o({name:"SearchColumn",props:{searchSpan:{type:Number,default:4},columns:{type:Array,default:()=>[]},formParams:{type:Object,default:()=>{}}},setup(l,{slots:o}){const c=t("options",{}),u=s(c)?n(c):c,{t:d}=Wl(),h=t("ns",{}),v=a(l.columns);b(()=>l.columns,()=>{v.value=l.columns},{deep:!0});const f=p(l.formParams),m=e=>e.getTime()>Date.now(),g=[{text:d("next.date.oneWeekAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-6048e5),[t,e]}},{text:d("next.date.oneMonthAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-2592e6),[t,e]}},{text:d("next.date.threeMonthsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-7776e6),[t,e]}},{text:d("next.date.oneYearAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-31536e6),[t,e]}},{text:d("next.date.threeYearsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-94608e6),[t,e]}}],y=(e,t)=>{f[t]=e};return()=>r(i,null,[r(i,null,[v.value.map(t=>!t.hide&&r(W,{span:l.searchSpan,class:h.b("header-search-item")},{default:()=>[r(U,null,{label:()=>t.label&&vs(u.showSearchLabel,!1)?r(vn,{width:u.searchLabelWidth,content:t.label,textAlign:"right"},null):null,default:()=>(t=>{const l=vs(t.searchDisabled,t.disabled,!1);if(o[fo(t.prop)])return o[fo(t.prop)]({column:t});if("input"===t.type||!t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("inputInteger"===t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e,onInput:e=>((e,t)=>{const a=e.replace(/\D/g,"");f[t]=a})(e,t.prop)},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("inputNumber"===t.type){const e=d("next.form.input")+(t.searchPlaceholder||t.searchLabel||t.label);return r($,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:e,onInput:e=>((e,t)=>{let a=e;a=a.replace(/[^0-9\.]/g,""),a=a.replace(/^\./,"0."),a=a.replace(/\.{2,}/g,"."),a=a.replace(".","DUMMY"),a=a.replace(/\./g,""),a=a.replace("DUMMY","."),f[t]=a})(e,t.prop)},{prefix:t.prefix?()=>t.prefix(f,t):null,suffix:t.suffix?()=>t.suffix(f,t):null,prepend:t.prepend?()=>t.prepend(f,t):null,append:t.append?()=>t.append(f,t):null})}if("select"===t.type){const a=d("next.form.select")+(t.searchPlaceholder||t.searchLabel||t.label);!f[t.prop]&&t.multiple&&(f[t.prop]=[]);const n=e(),s=n?.appContext.config.warnHandler;n.appContext.config.warnHandler=(e,...t)=>{e.includes('Slot "default" invoked outside of the render function')||s?.(e,...t)};const o=()=>t.dicData.map(e=>r(J,{value:e.value,label:e.label},null));return r(K,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,clearable:!0,disabled:l,placeholder:a,multiple:t.multiple||!1,"collapse-tags":!0,"collapse-tags-tooltip":!0,persistent:!0},{default:t.dicData?.length?o:null})}if("radio"===t.type)return r(X,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,f)},{default:()=>[t.dicData&&t.dicData.map(e=>r(q,{key:e.value,value:e.value,disabled:vs(e.disabled,!1)},{default:()=>[e.label]}))]});if("date"===t.type){const e=d("next.form.select")+(t.searchPlaceholder||t.searchLabel||t.label);return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"date","value-format":t.searchFormat||"YYYY-MM-DD",format:t.searchFormat||"YYYY-MM-DD",clearable:!0,disabledDate:t.searchDisabledDate||m,disabled:l,placeholder:e,editable:t.searchEditable||!1},null)}if("daterange"===t.type)return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"daterange","value-format":t.searchFormat||"YYYY-MM-DD",format:t.searchFormat||"YYYY-MM-DD",clearable:!0,"range-separator":d("next.date.rangeSeparator"),"start-placeholder":d("next.date.startPlaceholder"),"end-placeholder":d("next.date.endPlaceholder"),"disabled-date":t.searchDisabledDate||m,disabled:l,editable:t.searchEditable||!1,shortcuts:t.searchShortcuts||g},null);if("datetimerange"===t.type)return r(G,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,type:"datetimerange","value-format":t.searchFormat||"YYYY-MM-DD HH:mm:ss",format:t.searchFormat||"YYYY-MM-DD HH:mm:ss",clearable:!0,"range-separator":d("next.date.rangeSeparator"),"start-placeholder":d("next.date.startPlaceholder"),"end-placeholder":d("next.date.endPlaceholder"),"disabled-date":t.searchDisabledDate||m,disabled:l,editable:t.searchEditable||!1,shortcuts:t.searchShortcuts||g},null);if("numberRange"===t.type){const e=f[t.prop],l=a(e[0]),n=a(e[1]),s=a(t.searchMin),o=a(t.searchMax),i=a(!0),c=e=>{l.value=e,y([l.value,n.value],t.prop)},u=e=>{n.value=e,y([l.value,n.value],t.prop)};return r("div",{class:h.b("header-search-item-number-range")},[r(Z,{modelValue:l.value,"onUpdate:modelValue":e=>l.value=e,min:s.value,max:o.value,controls:i.value,onChange:c},null),r("span",{class:"number-range-division"},[d("next.date.rangeSeparator")]),r(Z,{modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,min:s.value,max:o.value,controls:i.value,onChange:u},null)])}return"treeSelect"===t.type?r(Uo,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:t.disabled,column:t,formParams:f,onChange:(...e)=>t.onChange?.(...e,t,f)},null):"cascader"===t.type?r($o,{modelValue:f[t.prop],"onUpdate:modelValue":e=>f[t.prop]=e,disabled:t.disabled,column:t,formParams:f,onChange:(...e)=>t.onChange?.(...e,t,f)},null):void 0})(t)})]}))])])}});function wo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}var Co=o({name:"HeaderSearch",props:{columns:{type:Array,default:()=>[]}},emits:["confirmSearch","clearSearch","zoomResize"],setup(l,{emit:o,slots:c}){const u=t("options",{}),d=s(u)?n(u):u,h=t("ns",{}),{t:v}=Wl(),f=t("searchFormSlots"),m={};f.value.forEach(e=>{m[e]=(...t)=>c[e]&&c[e](...t)});const g=p({}),b=a(l.columns),y=()=>{b.value.forEach(e=>{g[e.prop]="",ps(e.defaultValue)&&(g[e.prop]=e.defaultValue)})};y();const x=()=>{o("confirmSearch",g)},w=()=>{y(),x(),o("clearSearch")},C=a(d.searchSpan),S=b.value.length,E=a(S),D=a(b.value),k=a([]),O=a(!1),{proxy:L}=e();M(()=>{const e=L.$refs.tableSearchForm?.$el;e&&us(e,e=>{(e=>{const t=e.clientWidth,a=d.searchColumnMinWidth;let l=Math.floor(t/a);C.value=Math.ceil(24/l);const n=24%C.value;if(n&&(C.value=n,l=24/C.value),E.value=l,S>=E.value){const e=E.value-1;D.value=b.value.slice(0,e),k.value=b.value.slice(e)}else D.value=b.value,k.value=[];const s=Math.floor(t/l);O.value=s<a})(e),o("zoomResize")})});const T=a(!1),P=()=>{T.value=!T.value};return()=>r(i,null,[b.value.length?r(Q,{ref:"tableSearchForm",inline:!0,size:d.size,model:g,class:h.b("header")},{default:()=>[r(ee,{gutter:d.searchGutter,class:h.b("header-search")},{default:()=>[r(xo,{searchSpan:C.value,columns:D.value,formParams:g},wo(m)?m:{default:()=>[m]}),T.value?r(xo,{searchSpan:C.value,columns:k.value,formParams:g},wo(m)?m:{default:()=>[m]}):null,r(W,{span:C.value,class:h.b("header-search-btns")},{default:()=>[r(U,null,{default:()=>[r(te,{type:"primary",onClick:x},{icon:()=>r(R,null,{default:()=>[r(zn,null,null)]}),default:()=>v("next.table.search")}),r(te,{onClick:w},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>v("next.table.clear")}),k.value.length?O.value?r(te,{type:"primary",text:!0,bg:!0,circle:!0,class:h.b("header-search-expandBtn"),onClick:P},{icon:()=>T.value?r(Mn,null,null):r(Sn,null,null)}):r(te,{type:"primary",text:!0,bg:!0,class:h.b("header-search-expandBtn"),onClick:P},{icon:()=>T.value?r(R,null,{default:()=>[r(yn,null,null)]}):r(R,null,{default:()=>[r(mn,null,null)]}),default:()=>T.value?v("next.table.foldSearch"):v("next.table.unfoldSearch")}):null]})]})]})]}):null])}}),Mo=o({name:"DrawerSetting",setup:()=>({visible:a(!1)}),render(){const e=t("options",{}),l=s(e)?n(e):e,o=a(l.columns),{t:i}=Wl(),c=t("ns",{});return r(I,{modelValue:this.visible,"onUpdate:modelValue":e=>this.visible=e,title:i("next.table.setting.title"),"append-to-body":!0,size:"450px",class:c.b("setting-drawer")},{default:()=>[r(P,{class:c.be("setting-drawer","container")},{default:()=>[r(ae,{data:o.value,border:!0,style:{width:"100%"}},{default:()=>[r(le,{prop:"label",label:i("next.table.setting.label"),align:"center"},{default:({row:e})=>r(vn,{content:i(e.label)},null)}),r(le,{prop:"hide",label:i("next.table.setting.hide"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.hide,"onUpdate:modelValue":t=>e.hide=t},null)}),r(le,{prop:"filter",label:i("next.table.setting.filter"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.filter,"onUpdate:modelValue":t=>e.filter=t},null)}),r(le,{prop:"sort",label:i("next.table.setting.sort"),align:"center",width:"70px"},{default:({row:e})=>r(ne,{modelValue:e.sortable,"onUpdate:modelValue":t=>e.sortable=t},null)})]})]})]})}}),So=o({name:"HeaderMenu",setup:()=>({}),emits:["clickAdd","clickRefresh","deleteRows"],render(){const e=t("options",{}),o=s(e)?n(e):e,{t:i}=Wl(),c=t("ns",{}),u=t("multipleSelection"),d=l(()=>u.value.length),h=()=>{this.$emit("clickRefresh")},p=a(),v={size:o.size,refresh:h};return r("div",{class:c.b("header-menu")},[r("div",{class:c.b("header-menu-left")},[this.$slots["menu-left-prefix"]?.(v),o.addBtn&&r(te,{type:"primary",size:o.size,onClick:()=>{this.$emit("clickAdd")}},{icon:()=>r(R,null,{default:()=>[r(An,null,null)]}),default:()=>o.addBtnText||i("next.table.add")}),o.batchDelBtn&&r(te,{type:"danger",size:o.size,disabled:!d.value,onClick:()=>{const e=n(S(u.value.map(e=>S(e))));se.confirm(i("next.table.message.batchDeleteTip"),i("next.table.message.tip"),{type:"warning",showClose:!1,center:!1,confirmButtonText:i("next.table.message.confirmButtonText"),cancelButtonText:i("next.table.message.cancelButtonText")}).then(()=>{this.$emit("deleteRows",e)}).catch(()=>{L({type:"info",message:i("next.table.message.cancelBatchDelete")})})}},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>o.batchDelBtnText||i("next.table.batchDelete")}),this.$slots["menu-left-suffix"]?.(v)]),r("div",{class:c.b("header-menu-right")},[this.$slots["menu-right-prefix"]?.(v),o.refreshBtn&&r(te,{circle:!0,size:o.size,onClick:h},{icon:()=>r(R,null,{default:()=>[r(_n,null,null)]})}),o.settingBtn&&r(te,{circle:!0,size:o.size,onClick:()=>{p.value.visible=!0}},{icon:()=>r(R,null,{default:()=>[r(Rn,null,null)]})}),this.$slots["menu-right-suffix"]?.(v)]),r(Mo,{ref:p},null)])}});const Eo=o({name:"TableColumnDynamic",props:{columnOption:{type:Object,default:()=>({})}},setup(e,{slots:a}){const l=t("columnSlots"),o={};l.value.forEach(e=>{o[e]=(...t)=>a[e]&&a[e](...t)});const c=t("options",{}),u=s(c)?n(c):c,d=e.columnOption,h=vs(d.dicKey,"value"),p=vs(d.dicLabel,d.treeSelectProps?.label,"label"),v=vs(d.treeSelectProps?.separator,","),m=(e,t)=>{if(Array.isArray(e)){const a=[];return e.forEach(e=>{a.push(m(e,t))}),a.join(v)}const a=t.find(t=>t[h]==e);return a?a[p]:e};return()=>r(i,null,[!d.hide&&r(le,{prop:d.prop,label:d.label,headerAlign:d.headerAlign||u.headerAlign,align:d.align||u.cellAlign,minWidth:d.minWidth||u.columnMinWidth||"auto",width:d.width||"auto",fixed:d.fixed,sortable:d.sortable||!1,formatter:d.formatter||null,showOverflowTooltip:vs(d.showOverflowTooltip,!0)},{default:({row:e,$index:t})=>((e,t)=>{const l=d.prop,n=l?.replace(/\./g,"-");if(d.children?.length>0)return r(i,null,[d.children.map(e=>{return r(Eo,{columnOption:e},"function"==typeof(t=o)||"[object Object]"===Object.prototype.toString.call(t)&&!f(t)?o:{default:()=>[o]});var t})]);if(a[po(n)]){const l={text:u.operationsBtnText,plain:u.operationsBtnPlain,size:u.operationsBtnSize};return a[po(n)]({row:e,index:t,column:d,btn:l})}if(d.dicData?.length>0){const t=e=>{const a=[];return e.forEach(e=>{const l={...e};if(l.children){const e=t(l.children);a.push(...e),delete l.children}a.push(l)}),a},a=t(d.dicData);return r("span",null,[m(e[l],a)])}return d.cellUnit?r(i,null,[r("span",null,[e[l]]),r("em",{class:"cell-unit"},[d.cellUnit])]):d.renderColumnCell?d.renderColumnCell({row:e,index:t,column:d}):null})(e,t)})])}});var Do=o({name:"TableColumnOperations",emits:["editRow","viewRow","deleteRow"],setup(e,{emit:a,slots:o}){const c=t("options"),u=s(c)?n(c):c,{t:d}=Wl(),h=l(()=>{const{operationsBtnPlain:e,operationsBtnText:t}=u;return t||e}),p=()=>{const e=u.operationsBtnText,t=u.operationsBtnPlain,l=u.operationsBtnSize,n={text:e,plain:t,size:l};return r(le,{fixed:"right",label:d("next.table.operation"),width:u.operationsWidth,headerAlign:vs(u.operationsHeaderAlign,u.headerAlign),align:vs(u.operationsColumnAlign,u.cellAlign)},{default:s=>r(i,null,[o["operation-column-prefix"]?.({scoped:s,btn:n}),u.editBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.edit"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"primary",onClick:()=>(e=>{a("editRow",e)})(s)},{icon:()=>r(R,null,{default:()=>[r(Dn,null,null)]}),default:()=>d("next.table.edit")})]}):null,u.viewBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.view"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"primary",onClick:()=>(e=>{a("viewRow",e)})(s)},{icon:()=>r(R,null,{default:()=>[r(In,null,null)]}),default:()=>d("next.table.view")})]}):null,u.delBtn?r(T,{enterable:!1,effect:"dark",content:d("next.table.delete"),placement:"top",disabled:h.value},{default:()=>[r(te,{text:e,plain:t,class:h.value?"":"operations-btn",size:l,type:"danger",onClick:()=>(e=>{se.confirm(d("next.table.message.deleteTip"),d("next.table.message.tip"),{type:"warning",showClose:!1,center:!1,confirmButtonText:d("next.table.message.confirmButtonText"),cancelButtonText:d("next.table.message.cancelButtonText")}).then(()=>{a("deleteRow",e)}).catch(()=>{L({type:"info",message:d("next.table.message.cancelDelete")})})})(s)},{icon:()=>r(R,null,{default:()=>[r(En,null,null)]}),default:()=>d("next.table.delete")})]}):null,o["operation-column-suffix"]?.({scoped:s,btn:n})])})};return()=>r(i,null,[p()])}}),ko=o({name:"FooterPagination",props:{page:{type:Object,default:()=>{}}},emits:["change"],setup(e,{emit:a}){const l=t("options",{}),o=s(l)?n(l):l,c=e.page,u=e=>{c.pageIndex=e,a("change",c)},d=e=>{c.pageSize=e,a("change",c)};return()=>r(i,null,[r(oe,{currentPage:c.pageIndex,"onUpdate:currentPage":e=>c.pageIndex=e,pageSize:c.pageSize,"onUpdate:pageSize":e=>c.pageSize=e,total:c.total,small:"small"===o.size,layout:"total, sizes, prev, pager, next, jumper","page-sizes":vs(c.pageSizes,[10,20,30,40,50,100]),"onCurrent-change":u,"onSize-change":d},null)])}});const Oo=Te("dialog");var Lo=o({name:"NextDialog",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},modelValue:{type:Boolean,default:!1},title:{type:String,default:""},fullscreen:{type:Boolean,default:!1},fullscreenBtn:{type:Boolean,default:!0},width:{type:[String,Number],default:"50%"},closeOnClickModal:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},draggable:{type:Boolean,default:!0},zoomSize:{type:Boolean,default:!0},destroyOnClose:{type:Boolean,default:!0},modal:{type:Boolean,default:!0},top:{type:String,default:"15vh"},nofill:{type:Boolean,default:!1}},emits:["close"],setup(e,{emit:t,slots:l}){const n=a(e.modelValue);b(()=>e.modelValue,e=>{n.value=e});const s=()=>{n.value=!1,t("close")},o=a(e.fullscreen);return()=>r(i,null,[r(re,{modelValue:n.value,"onUpdate:modelValue":e=>n.value=e,class:[Oo.b(),e.className,e.nofill&&Oo.b("nofill")],style:e.style,title:e.title,appendToBody:e.appendToBody,"destroy-on-close":!0,fullscreen:o.value,"lock-scroll":!0,modal:e.modal,"show-close":!1,closeOnClickModal:e.closeOnClickModal,width:e.width,top:e.top,draggable:e.draggable,destroyOnClose:e.destroyOnClose,onClose:s},{default:()=>[l.default?.()],header:({close:t,titleId:a,titleClass:l})=>r("div",{class:Oo.b("header")},[r("h4",{id:a,class:l},[e.title]),r("div",{class:Oo.e("header-right")},[e.fullscreenBtn&&r("span",{class:"icon-fullscreen",onClick:()=>o.value=!o.value},[r(R,null,{default:()=>[r(On,null,null)]})]),e.showClose&&r("span",{class:"icon-close",onClick:t},[r(R,{size:"18"},{default:()=>[r(Cn,null,null)]})])])])})])}});const To={selection:!1,selectType:"radio",addBtn:!1,viewBtn:!1,delBtn:!1,editBtn:!1,batchDelBtn:!1,dialogWidth:"60%",dialogFullscreen:!1,closeOnClickModal:!1,refreshBtn:!0,settingBtn:!0,operations:!1};var Po={size:"default",colSpan:12,labelWidth:"6em",columnMinWidth:350,columns:[],formDatum:{},tableSelectConfig:To,isEditing:!0,showResetBtn:!0,showFooter:!0,submitText:null,resetText:null};const Ao=Te("form");var _o=o({name:"NumberRangePicker",props:{modelValue:{type:[Array,String,Number,Boolean,Object],default:function(){return[null,null]}},min:{type:Number,default:0},max:{type:Number,default:100},disabled:{type:Boolean,default:!1}},emits:["change"],setup(e,{emit:t}){const l=e.disabled,{t:n}=Wl(),s=a(Array.isArray(e.modelValue)&&e.modelValue[0]||0),o=a(Array.isArray(e.modelValue)&&e.modelValue[1]||0),c=a(e.min),u=a(e.max),d=e=>{s.value=e,t("change",[s.value,o.value])},h=e=>{o.value=e,t("change",[s.value,o.value])},p=a(!0),v=a();return M(()=>{const e=v.value;us(e,e=>{const t=e.clientWidth;p.value=t>200})}),()=>r(i,null,[r("div",{ref:v,class:Ao.e("number-range")},[r(Z,{modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,min:c.value,max:u.value,controls:p.value,disabled:l,onChange:d},null),r("span",{class:Ao.em("number-range","division")},[n("next.date.rangeSeparator")]),r(Z,{modelValue:o.value,"onUpdate:modelValue":e=>o.value=e,min:c.value,max:u.value,controls:p.value,disabled:l,onChange:h},null)])])}});const jo=on(Lo);function zo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Ho=Te("form"),Vo=o({name:"NextInputTableSelect",props:{modelValue:{type:[Array,String,Number,Boolean,Object],default:function(){return[]}},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},closable:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})},placeholder:{type:String,default:""}},emits:["select"],setup(e,{emit:t,slots:n}){const{t:s}=Wl(),o=e.disabled,c=e.closable,u=e.column,d=u.placeholder||s("next.form.select")+u.label,h=ds(uo),v=ds(To),f=zl(h,v,u.tableSelect),{value:m,label:g}=u.tableSelectProps||{value:"id",label:"name"},y=p({visible:!1,title:u.label+s("next.form.tableSelect"),dialogWidth:f.dialogWidth}),x=()=>{y.visible=!0},w=()=>{y.visible=!1},C=p({loading:!1,page:{pageIndex:1,pageSize:20,total:0},data:[]}),M=e=>{C.loading=!0,f.loadData?.(e,C.page,e=>{C.data=e.data||[],C.page.total=e.total||0,C.loading=!1})},D=a([]),k=a("");u.tableSelectDefaultValue?.(e.formParams,u,e=>{e?.length&&(u.tableSelectRows=e,D.value=e,k.value=e[0][m])});const O=l(()=>"radio"===f.selectType?!k.value:0===D.value.length),L=()=>{D.value=[],k.value=""},P=()=>{const e=S(D.value),a=hs(e,m);w(),t("select",a)},A=(e,t)=>{u.addEditData?.(e,t)},_=e=>{const t=f.rowKey,a=vs(e[t],null);return"checkbox"===f.selectType?r(ne,{value:a,onChange:t=>((e,t)=>{if(e)D.value.push(t);else{const e=D.value.findIndex(e=>e[m]===t[m]);-1!==e&&D.value.splice(e,1)}})(t,S(e))},null):r(q,{value:a,onChange:()=>{k.value=a,D.value=[e]}},null)},j=a([]),z=a([]),H=()=>{const e=hs(D.value,m).map(e=>({value:e[m],label:e[g]}));e.length>1?(j.value=e.splice(0,1),z.value=e):(j.value=e,z.value=[])};b(()=>u.tableSelectRows,()=>{H()},{deep:!0,immediate:!0});const V=a([]);b(()=>[e.formParams[u.prop],D.value],()=>{V.value=D.value.map(e=>e[m]),H()},{deep:!0,immediate:!0});const R=a(null);b(()=>[e.formParams[u.prop],k.value],()=>{R.value=k.value,H()},{deep:!0,immediate:!0});const I=(e,a)=>{const l=S(D.value);l.splice(a,1),D.value=l,"radio"===f.selectType&&(k.value=null),H(),t("select",l)},N=()=>{let e,t;return r(i,null,[r("div",{class:["el-input",Ho.e("input-table"),Ho.is("disabled",o)]},[r("div",{class:"el-input__wrapper"},[j?.value.length?r("span",{class:Ho.em("input-table","value")},[j.value.map((e,t)=>r(ie,{closable:c,onClose:()=>I(0,t)},{default:()=>[e.label]})),z?.value?.length?r(T,{"popper-class":Ho.e("tooltip-tags"),placement:"bottom",effect:"light"},{default:()=>r(ie,null,{default:()=>[E("+ "),z.value.length]}),content:()=>z.value.map((e,t)=>r(ie,{closable:c,onClose:()=>I(0,t+1)},{default:()=>[e.label]}))}):null]):r("span",{class:Ho.em("input-table","placeholder")},[d])]),r(te,{type:"primary",class:Ho.em("input-table","append"),disabled:o,icon:zn,onClick:x},null)]),r(jo,{modelValue:y.visible,"onUpdate:modelValue":e=>y.visible=e,title:y.title,closeOnClickModal:f.closeOnClickModal,width:f.dialogWidth,appendToBody:vs(f.dialogAppendToBody,!0),modal:vs(f.dialogModal,!1),onClose:w},{default:()=>[r("div",{class:Ho.em("input-table","content")},["checkbox"===f.selectType?r(ce,{modelValue:V.value},{default:()=>[r(Qo,{options:f,loading:C.loading,data:C.data,page:C.page,"onConfirm-search":M,"onClick-add-edit":A},{default:()=>[r(le,{fixed:"left",label:s("next.table.selection"),width:55,headerAlign:f.headerAlign,align:f.cellAlign},{default:({row:e})=>_(e)})],...n})]}):r(X,{modelValue:R.value},{default:()=>[r(Qo,{options:f,loading:C.loading,data:C.data,page:C.page,"onConfirm-search":M,"onClick-add-edit":A},{default:()=>[r(le,{fixed:"left",label:s("next.table.selection"),width:55,headerAlign:f.headerAlign,align:f.cellAlign},{default:({row:e})=>_(e)})],...n})]})]),r("div",{class:Ho.em("input-table","footer")},[r(te,{onClick:L},zo(e=s("next.form.reset"))?e:{default:()=>[e]}),r(te,{type:"primary",disabled:O.value,onClick:P},zo(t=s("next.form.confirm"))?t:{default:()=>[t]})])]})])};return()=>r(i,null,[N()])}}),Ro=Te("form");var Io=o({name:"UploadImage",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},modelValue:{type:String,default:""},disabled:{type:Boolean,default:!1},listType:{type:String,values:["text","picture","picture-card"],default:"picture-card"},multiple:{type:Boolean,default:!1},limit:{type:Number,default:1},accept:{type:String,default:"image/*"}},emits:["change","exceed"],setup(t){const{appContext:l}=e(),{t:n}=Wl();return{t:n,appContext:l,defaultPreviewSrcList:ds(t.modelValue),uploadfilesPreview:a([])}},render(){const e=this.$slots,t=this.$props,a=this.$emit,l=this.t,n=t.disabled,s=this.uploadfilesPreview;let o=null;return r(i,null,[(()=>{const e=this.defaultPreviewSrcList;let t=[];return"string"==typeof e?t=[e]:"[object Array]"===Object.prototype.toString.call(e)&&(t=e),t=t.filter(e=>!!e),t.length?r(he,{class:Ro.e("preview-image"),src:t[0],previewSrcList:t,"preview-teleported":!0,fit:"cover",style:{width:"146px",height:"146px"}},{default:()=>r(R,null,{default:()=>[r(Pn,null,null)]})}):null})(),n?null:r(ue,{class:[Ro.b("upload-image"),t.className],style:t.style,"list-type":t.listType,multiple:t.multiple,limit:t.limit,accept:t.accept,"auto-upload":!1,"on-preview":e=>{const t=document.getElementsByTagName("body")[0],a=s.value.findIndex(t=>t.url===e.url)||0;o&&(D(null,o),t.removeChild(o)),o=document.createElement("div"),t.appendChild(o);const l=r({render:()=>C(m,{to:"body"},[C(de,{initialIndex:a,"url-list":s.value.map(e=>e.url),onClose:()=>{D(null,o)}})])});o.appContext=this.appContext,D(l,o)},"on-change":(e,t)=>{s.value=t,a("change",e,t)},"on-exceed":(e,t)=>{L({type:"info",message:l("next.table.uploadfileExceed")}),a("exceed",e,t)}},{trigger:()=>e.default?e.default():"picture-card"===t.listType?r(R,null,{default:()=>[r(An,null,null)]}):r(te,{link:!0,text:!0,type:"primary"},{default:()=>[r(R,null,{default:()=>[r(An,null,null)]}),r("em",null,[l("next.form.selectFile")])]})})])}}),No=o({name:"NextTreeSelect",props:{modelValue:{type:[Number,String,Boolean,Object,Array],default:""},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})}},emits:["change","node-click","node-contextmenu","check","check-change","node-expand","node-collapse","current-change"],setup(e,{emit:t,expose:l}){const{t:n}=Wl(),s=a(e.modelValue);b(()=>e.modelValue,e=>{s.value=e});const o=e.column,c=vs(o.treeSelectProps?.value,o.nodeKey,"id"),u=e.formParams,d={label:"label",children:"children"},h=o.placeholder||n("next.form.select")+o.label,p=a=>{e.formParams[o.prop]=a,s.value=a,t("change",a)},v=()=>{e.formParams[o.prop]="",s.value=""},f=(e,a)=>{t("node-click",e,a,u);const l=e[c];o.treeSelectNodeClick?.(e,a,u),p(l)},m=(...e)=>{t("node-contextmenu",...e),o.treeSelectNodeContextmenu?.(...e)},g=(e,a)=>{t("check",e,a,u),o.treeSelectCheck?.(e,a,u);const{checkedKeys:l}=a;p(l)},y=(...e)=>{t("check-change",...e),o.treeSelecCheckChange?.(...e,u)},x=(...e)=>{t("node-expand",...e),o.treeSelecNodeExpand?.(...e)},w=(...e)=>{t("node-collapse",...e),o.treeSelecNodeCollapse?.(...e)},C=(...e)=>{t("current-change",...e),o.treeSelecCurrentChange?.(...e)},M=a(),S=()=>M.value;return o.loadInstance&&o.loadInstance(S()),l({getInstance:S,onClearValue:v}),()=>r(i,null,[r(pe,{ref:M,modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,placeholder:h,data:vs(o.dicData,[]),"node-key":vs(o.nodeKey,"id"),filterable:vs(o.filterable,!0),"show-checkbox":vs(o.showCheckbox,!1),"leaf-only":vs(o.leafOnly,!1),"render-after-expand":vs(o.renderAfterExpand,!0),"check-strictly":vs(o.checkStrictly,!1),disabled:vs(e.disabled,!1),clearable:vs(o.clearable,!0),accordion:vs(o.accordion,!1),multiple:vs(o.multiple,!1),"collapse-tags":!0,"collapse-tags-tooltip":!0,props:vs(o.treeSelectProps,d),"value-key":c,"onNode-click":f,"onNode-contextmenu":m,onCheck:g,"onCheck-change":y,"onNode-expand":x,"onNode-collapse":w,"onCurrent-change":C,onClear:v},null)])}}),Bo=o({name:"NextTreeCascader",props:{modelValue:{type:[Number,String,Boolean,Object,Array],default:""},column:{type:Object,default:()=>({})},disabled:{type:Boolean,default:!1},formParams:{type:Object,default:()=>({})}},emits:["change","clear","expand-change","visible-change","remove-tag","blur","focus"],setup(e,{emit:t,expose:l}){const{t:n}=Wl(),s=a(e.modelValue);b(()=>e.modelValue,e=>{s.value=e});const o=e.column,c=o.placeholder||n("next.form.select")+o.label,u={label:"label",children:"children"},d=a=>{const l=h.value.getCheckedNodes().map(e=>e.data);e.formParams[o.prop]=a,s.value=a,t("change",a,l)},h=a(),p=()=>h.value;return o.loadInstance&&o.loadInstance(p()),l({getInstance:p,onClearValue:()=>{e.formParams[o.prop]="",s.value=""}}),()=>r(i,null,[r(ve,{ref:h,modelValue:s.value,"onUpdate:modelValue":e=>s.value=e,placeholder:c,options:vs(o.dicData,[]),props:vs(o.treeSelectProps,u),disabled:vs(e.disabled,!1),clearable:vs(o.clearable,!0),filterable:vs(o.filterable,!1),"collapse-tags":!0,"collapse-tags-tooltip":!0,onChange:d},null)])}});function Fo(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Yo=Te("form");var Wo=o({name:"NextForm",props:{options:{type:Object,default:()=>({})},columns:{type:Array,default:()=>[]},formDatum:{type:Object,default:()=>({})}},emits:["submit","close","reset"],setup(t,{slots:n,emit:s,expose:o}){const c=ds(Po),u=p(zl(c,t.options)),d=l(()=>"boolean"!=typeof u.isEditing||u.isEditing),{t:h}=Wl(),v=a(u.colSpan),f=a(u.colSpanFixed),m=p(t.formDatum)||{},g=p(zl({},m)),y=a([]),x=p(new Map),w=p({});b(()=>[t.columns,t.formDatum],()=>{(()=>{const e=t.columns;y.value=e;for(let t=0;t<e.length;t++){const a=e[t],l=m[a.prop];ps(l)?g[a.prop]=l:g[a.prop]=ps(a.defaultValue)?a.defaultValue:"";const n=[],{label:s}=a;a.required&&n.push({required:!0,message:s+h("next.form.requiredInput"),trigger:["blur","change"]}),a.rules?.length&&n.push(...a.rules),w[a.prop]=n,!a.dicData?.length&&a.loadDicData&&a.loadDicData(a,e=>{e?.length&&(a.dicData=e)},g),"boolean"==typeof a.disabled&&a.disabled||(a.disabled=!d.value),a.editDisabled&&g[a.prop]&&(a.disabled=a.editDisabled),x.set(a.prop,a)}})()},{deep:!0,immediate:!0});const C=hs(y.value,"prop"),E=a(!1);M(()=>{if(f.value&&"number"==typeof f.value&&24%f.value==0)return void(v.value=f.value);const e=D.value?.$el;let t=null;us(e,e=>{null!==t?clearTimeout(t):E.value=!0,t=setTimeout(()=>{v.value=((e,t=350)=>{const a=e.clientWidth;let l=Math.floor(a/t);return l>4&&(l=4),Math.ceil(24/l)})(e,u.columnMinWidth),E.value=!1,clearTimeout(t)},10)})});const D=a(),k=a(!1),O=async()=>{const e=D.value;e&&await e.validate((e,t)=>{if(e){const e=S(g);k.value=!0,s("submit",e,()=>{k.value=!1,s("close")},()=>{k.value=!1})}})},L=()=>{const e=D.value;e&&(e.resetFields(),k.value=!1,s("reset",g))},P=e=>e.getTime()>Date.now(),A=[{text:h("next.date.oneWeekAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-6048e5),[t,e]}},{text:h("next.date.oneMonthAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-2592e6),[t,e]}},{text:h("next.date.threeMonthsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-7776e6),[t,e]}},{text:h("next.date.oneYearAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-31536e6),[t,e]}},{text:h("next.date.threeYearsAge"),value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-94608e6),[t,e]}}];return o({formParams:S(g),ruleFormRef:D,formColumns:C,formColumnsMap:x,getFormInstance:()=>D.value,getFormParams:()=>S(g)}),()=>{let t;return r(nr,{loading:E.value},Fo(t=(()=>{let t;return r(Q,{ref:D,class:Yo.b(),inline:!1,model:g,size:u.size,"label-position":vs(u.labelPosition,"right")},{default:()=>[r(ee,{gutter:20},Fo(t=C.map(t=>!t.hide&&r(W,{span:vs(u.colSpanFixed,t.span,v.value)},{default:()=>[r(U,{prop:t.prop,required:t.required,rules:w[t.prop],style:{"--form-label-width":vs(u.formLabelWidth,u.labelWidth)}},{label:()=>t.label?r(i,null,[r(vn,{content:h(t.label),className:Yo.e("item-label")},null),t.tip?r(T,{effect:"dark",content:t.tip,placement:"top"},{default:()=>[r(R,{class:Yo.e("item-tip"),color:"#f3d19e"},{default:()=>[r(Ln,null,null)]})]}):null]):null,default:()=>(t=>{if(n[go(t.prop)])return n[go(t.prop)]({column:t,formParams:g});if("input"===t.type||!t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:vs(t.disabled,!1),placeholder:e,onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:t.prefix?()=>t.prefix(g,t):null,suffix:t.suffix?()=>t.suffix(g,t):null,prepend:t.prepend?()=>t.prepend(g,t):null,append:t.append?()=>t.append(g,t):null})}if("password"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,type:"password",clearable:vs(t.clearable,!0),"show-password":!0,readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:t.prefix?()=>t.prefix(g,t):null,suffix:t.suffix?()=>t.suffix(g,t):null,prepend:t.prepend?()=>t.prepend(g,t):null,append:t.append?()=>t.append(g,t):null})}if("inputInteger"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onInput:e=>((e,t)=>{const a=e.replace(/\D/g,"");g[t]=a?Number(a):""})(e,t.prop),onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:t.prefix?()=>t.prefix(g,t):null,suffix:t.suffix?()=>t.suffix(g,t):null,prepend:t.prepend?()=>t.prepend(g,t):null,append:t.append?()=>t.append(g,t):null})}if("inputNumber"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onInput:e=>((e,t)=>{let a=e.toString();a=a.replace(/[^0-9.]/g,""),a.startsWith(".")&&(a="0"+a),a=a.replace(/^(\d*\.\d*)\./g,"$1"),g[t]=a})(e,t.prop),onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:t.prefix?()=>t.prefix(g,t):null,suffix:t.suffix?()=>t.suffix(g,t):null,prepend:t.prepend?()=>t.prepend(g,t):null,append:t.append?()=>t.append(g,t):null})}if("textarea"===t.type){const e=t.placeholder||h("next.form.input")+t.label;return r($,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,type:"textarea",clearable:vs(t.clearable,!0),readonly:vs(t.readonly,!1),disabled:t.disabled,placeholder:e,onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:t.prefix?()=>t.prefix(g,t):null,suffix:t.suffix?()=>t.suffix(g,t):null,prepend:t.prepend?()=>t.prepend(g,t):null,append:t.append?()=>t.append(g,t):null})}if("select"===t.type){const a=t.placeholder||h("next.form.select")+t.label,l=e(),n=l?.appContext.config.warnHandler;l.appContext.config.warnHandler=(e,...t)=>{e.includes('Slot "default" invoked outside of the render function')||n?.(e,...t)};const s=()=>t.dicData.map(e=>r(J,{key:e.value,value:e.value,label:e.label,disabled:vs(e.disabled,!1)},null));return r(K,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,placeholder:a,clearable:vs(t.clearable,!0),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),multiple:vs(t.multiple,!1),filterable:vs(t.filterable,!1),"allow-create":vs(t.allowCreate,!1),"collapse-tags-tooltip":!0,onChange:e=>t.onChange?.(e,t,g,C,x)},{default:t.dicData?.length?s:null})}if("time"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(fe,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,start:"00:00",step:"00:30",end:"23:59",clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),placeholder:e,onChange:e=>t.onChange?.(e,t,g,C,x)},{prefix:()=>t.prefix?t.prefix(g,t):null,suffix:()=>t.suffix?t.suffix(g,t):null})}if("radio"===t.type)return r(X,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,g,C,x)},{default:()=>[t.dicData&&t.dicData.map(e=>r(q,{key:e.value,value:e.value,disabled:vs(e.disabled,t.disabled,!1)},{default:()=>[e.label]}))]});if("checkbox"===t.type)return ps(g[t.prop])||(g[t.prop]=[]),r(ce,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),onChange:e=>t.onChange?.(e,t,g,C,x)},{default:()=>[t.dicData&&t.dicData.map(e=>r(ne,{key:e.value,label:e.value,disabled:vs(e.disabled,!1)},{default:()=>[e.label]}))]});if("date"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:g[t.prop],"onUpdate:modelValue":[e=>g[t.prop]=e,e=>t.onChange?.(e,t,g,C,x)],placeholder:e,type:"date",valueFormat:t.format||"YYYY-MM-DD",format:t.format||"YYYY-MM-DD",clearable:vs(t.clearable,!0),disabledDate:e=>t.disabledDate?t.disabledDate(e,g):P(e),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1)},null)}if("datetime"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:g[t.prop],"onUpdate:modelValue":[e=>g[t.prop]=e,e=>t.onChange?.(e,t,g,C,x)],placeholder:e,type:"datetime",valueFormat:t.format||"YYYY-MM-DD HH:mm:ss",format:t.format||"YYYY-MM-DD HH:mm:ss",clearable:vs(t.clearable,!0),disabledDate:e=>t.disabledDate?t.disabledDate(e,g):P(e),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1)},null)}if("daterange"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:g[t.prop],"onUpdate:modelValue":[e=>g[t.prop]=e,e=>t.onChange?.(e,t,g,C,x)],placeholder:e,type:"daterange",valueFormat:vs(t.format,"YYYY-MM-DD "),format:vs(t.format,"YYYY-MM-DD"),"range-separator":h("next.date.rangeSeparator"),"start-placeholder":h("next.date.startPlaceholder"),"end-placeholder":h("next.date.endPlaceholder"),disabledDate:e=>t.disabledDate?t.disabledDate(e,g):P(e),clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),shortcuts:t.shortcuts||A},null)}if("datetimerange"===t.type){const e=t.placeholder||h("next.form.select")+t.label;return r(G,{modelValue:g[t.prop],"onUpdate:modelValue":[e=>g[t.prop]=e,e=>t.onChange?.(e,t,g,C,x)],placeholder:e,type:"datetimerange",valueFormat:vs(t.format,"YYYY-MM-DD HH:mm:ss"),format:vs(t.format,"YYYY-MM-DD HH:mm:ss"),"range-separator":h("next.date.rangeSeparator"),"start-placeholder":h("next.date.startPlaceholder"),"end-placeholder":h("next.date.endPlaceholder"),disabledDate:e=>t.disabledDate?t.disabledDate(e,g):P(e),clearable:vs(t.clearable,!0),editable:vs(t.editable,!1),disabled:vs(t.disabled,!1),readonly:vs(t.readonly,!1),shortcuts:t.shortcuts||A},null)}if("numberRange"===t.type)return r(_o,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:t.disabled,onChange:e=>{return a=e,l=t.prop,Array.isArray(g[l])||(g[l]=[]),void(g[l]=Number(a));var a,l}},null);if("inputTableSelect"===t.type){const e={};for(const a in t.tableSelect.slots)e[a]=(...e)=>t.tableSelect.slots[a]?.({column:t,formParams:g},...e);return r(Vo,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,formParams:g,column:t,disabled:vs(t.disabled,!1),onSelect:e=>((e,t)=>{e&&(t.tableSelectRows=e);const{value:a}=t.tableSelectProps||{};g[t.prop]=e.map(e=>e[a||"value"]),t.onTableSelect?.(g,e,t),D.value?.validateField(t.prop)})(e,t)},Fo(e)?e:{default:()=>[e]})}return"uploadImage"===t.type?r(Io,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:vs(t.disabled,!1),multiple:vs(t.multiple,!1),limit:t.limit,onChange:(...e)=>t.onChange?.(...e,t,g,C,x),onExceed:(...e)=>t.onExceed?.(...e,t,g,C,x)},null):"treeSelect"===t.type?r(No,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:vs(t.disabled,!1),column:t,formParams:g,onChange:(...e)=>t.onChange?.(...e,t,g,C,x)},null):"cascader"===t.type?r(Bo,{modelValue:g[t.prop],"onUpdate:modelValue":e=>g[t.prop]=e,disabled:vs(t.disabled,!1),column:t,formParams:g,onChange:(...e)=>t.onChange?.(...e,t,g,C,x)},null):void 0})(t)})]})))?t:{default:()=>[t]}),d.value&&u.showFooter?r("div",{class:Yo.e("footer")},[r(te,{type:"primary",loading:k.value,onClick:O},{default:()=>[h(u.submitText)||h("next.form.submit")]}),u.showResetBtn?r(te,{onClick:L},{default:()=>[h(u.resetText)||h("next.form.reset")]}):null]):null]})})())?t:{default:()=>[t]})}}});const Uo=on(No),$o=on(Bo),Ko=on(Vo),Xo=on(Wo);var qo=o({name:"AddEditForm",props:{formDatum:{type:Object,default:()=>({})},isEditing:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]}},emits:["close","submit"],setup(e,{slots:l,emit:o,expose:c}){const u=t("addEditFormSlots"),d={};u.value.forEach(e=>{d[e]=(...t)=>l[e]&&l[e](...t)});const h=t("options",{}),p=ds(s(h)?n(h):h);p.columnMinWidth=p.formColumnMinWidth,p.isEditing=e.isEditing,p.colSpan=p.formSpan,p.colSpanFixed=p.formSpanFixed;const v=a(),m=ds(s(e.formDatum)?n(e.formDatum):e.formDatum),g=ds(e.columns).map(e=>(e.hide=vs(e.formHide,e.hide,!1),e)),b=(...e)=>{o("submit",...e)};c({getFormExpose:()=>({formParams:v.value?.formParams,formColumns:v.value?.formColumns,formColumnsMap:v.value?.formColumnsMap})});return()=>{return r(i,null,[r(Xo,{ref:v,options:p,columns:g,formDatum:m,onClose:()=>o("close"),onSubmit:b},"function"==typeof(e=d)||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)?d:{default:()=>[d]})]);var e}}});function Go(e){return"function"==typeof e||"[object Object]"===Object.prototype.toString.call(e)&&!f(e)}const Zo=Te("crud-table");var Jo=o({name:"NextCrudTable",props:ro,emits:["confirm-search","clear-search","change-pagination","selection-change","row-click","row-contextmenu","row-dblclick","cell-click","cell-dblclick","cell-contextmenu","cell-mouse-enter","cell-mouse-leave","expand-change","click-add-edit","close-add-edit","view-add-edit","delete-rows","delete-row","submit-form"],setup(e,{emit:t,slots:s,expose:o}){const c=ds(uo),u=l(()=>{const t=n(e.options);return zl(c,t)}),d=n(u);g("options",l(()=>u.value)),g("ns",Zo);const{t:v}=Wl(),f=a(d.columns),m=a([]),x=a([]),w=e=>{((e,t)=>{const a=p(e.columns),l=e=>{!e.dicData?.length&&e.loadDicData&&e.loadDicData(e,t=>{t?.length&&(e.dicData=t)})},n=e=>{let t=[];return e.forEach(e=>{l(e),t.push(e),e.children?.length&&(t.push(...n(e.children)),e.children&&delete e.children)}),t},s=n(a),o=e.formColumns.map(e=>(l(e),e)),r=s.concat(o).map(e=>{const t={prop:e.prop,label:vs(e.formLabel,e.label,""),type:vs(e.formType,e.type,""),defaultValue:vs(e.formDefaultValue,e.defaultValue,""),placeholder:vs(e.formPlaceholder,""),required:vs(e.formRequired,e.required,!1),sort:vs(e.formSort,e.sort,null),prefix:vs(e.formPrefix,e.prefix,null),suffix:vs(e.formSuffix,e.suffix,null),prepend:vs(e.formPrepend,e.prepend,null),append:vs(e.formAppend,e.append,null),hide:vs(e.formHide,e.hide,!1),disabled:vs(e.formDisabled,e.disabled,!1),editDisabled:vs(e.formEditDisabled,e.editDisabled,!1),clearable:vs(e.formClearable,e.clearable,!0),readonly:vs(e.formReadonly,e.readonly,!1),disabledDate:vs(e.formDisabledDate,e.disabledDate,!1),shortcuts:vs(e.formShortcuts,e.shortcuts,null),format:vs(e.formFormat,e.format,null),tip:vs(e.formTip,e.tip,null),rules:vs(e.formRules,e.rules,null),span:vs(e.formSpan,e.span,null),multiple:vs(e.formMultiple,e.multiple,!1),limit:vs(e.formLimit,e.limit,1),accept:vs(e.formAccept,e.accept,null),dicData:vs(e.formDicData,e.dicData,[]),loadDicData:vs(e.formLoadDicData,e.loadDicData,null),onChange:vs(e.onChangeForm,e.onChange,null),tableSelect:vs(e.tableSelect,{}),tableSelectRows:vs(e.tableSelectRows,[]),tableSelectProps:vs(e.tableSelectProps,null),tableSelectDefaultValue:vs(e.tableSelectDefaultValue,null),onTableSelect:vs(e.onTableSelect,null),filterable:vs(e.formFilterable,e.filterable,!1),allowCreate:vs(e.formAllowCreate,e.allowCreate,!1),nodeKey:vs(e.formNodeKey,e.nodeKey),accordion:vs(e.formAccordion,e.accordion,!1),leafOnly:vs(e.formLeafOnly,e.leafOnly,!1),showCheckbox:vs(e.formShowCheckboxn,e.showCheckbox,!1),checkStrictly:vs(e.formCheckStrictly,e.checkStrictly,!1),renderAfterExpand:vs(e.formRenderAfterExpand,e.renderAfterExpand,!1),treeSelectProps:vs(e.formTreeSelectProps,e.treeSelectProps,null),treeSelectNodeClick:vs(e.treeSelectNodeClickForm,e.treeSelectNodeClick,null),treeSelectNodeContextmenu:vs(e.treeSelectNodeContextmenuForm,e.treeSelectNodeContextmenu,null),treeSelectCheck:vs(e.treeSelectCheckForm,e.treeSelectCheck,null),treeSelecCheckChange:vs(e.treeSelecCheckChangeForm,e.treeSelecCheckChange,null),treeSelecNodeExpand:vs(e.treeSelecNodeExpandForm,e.treeSelecNodeExpand,null),treeSelecNodeCollapse:vs(e.treeSelecNodeCollapseForm,e.treeSelecNodeCollapse,null),treeSelecCurrentChange:vs(e.treeSelecCurrentChangeForm,e.treeSelecCurrentChange,null)};return!e.dicData?.length&&e.loadDicData&&fs(t,e,"dicData"),t}).filter(e=>e.sort&&e.prop).sort((e,t)=>e.sort-t.sort),i=(e,t)=>{const a={prop:e.prop,type:vs(e.searchType,e.type),multiple:vs(e.searchMultiple,e.multiple),searchDisabledDate:vs(e.searchDisabledDate,null),searchFormat:vs(e.searchFormat,null),label:vs(e.searchLabel,e.label),defaultValue:vs(e.searchDefaultValue,e.defaultValue,null),placeholder:vs(e.searchPlaceholder,e.placeholder,null),dicData:vs(e.searchDicData,e.dicData,[]),loadDicData:vs(e.searchLoadDicData,e.loadDicData,null),disabled:vs(e.searchDisabled,e.disabled,!1),readonly:vs(e.searchReadonly,e.readonly,!1),prefix:vs(e.searchPrefix,e.prefix,null),suffix:vs(e.searchSuffix,e.suffix,null),prepend:vs(e.searchPrepend,e.prepend,null),append:vs(e.searchAppend,e.append,null),hide:vs(e.searchHide,!1),showSearchLabel:vs(e.showSearchLabel,!0),sort:vs(e.searchSort,e.sort,t),nodeKey:vs(e.searchNodeKey,e.nodeKey),accordion:vs(e.searchAccordion,e.accordion,!1),leafOnly:vs(e.searchLeafOnly,e.leafOnly,!1),showCheckbox:vs(e.searchShowCheckboxn,e.showCheckbox,!1),checkStrictly:vs(e.searchCheckStrictly,e.checkStrictly,!1),renderAfterExpand:vs(e.searchRenderAfterExpand,e.renderAfterExpand,!1),treeSelectProps:vs(e.searchTreeSelectProps,e.treeSelectProps,null),treeSelectNodeClick:vs(e.treeSelectNodeClickSearch,e.treeSelectNodeClick,null),treeSelectNodeContextmenu:vs(e.treeSelectNodeContextmenuSearch,e.treeSelectNodeContextmenu,null),treeSelectCheck:vs(e.treeSelectCheckSearch,e.treeSelectCheck,null),treeSelecCheckChange:vs(e.treeSelecCheckChangeSearch,e.treeSelecCheckChange,null),treeSelecNodeExpand:vs(e.treeSelecNodeExpandSearch,e.treeSelecNodeExpand,null),treeSelecNodeCollapse:vs(e.treeSelecNodeCollapseSearch,e.treeSelecNodeCollapse,null),treeSelecCurrentChange:vs(e.treeSelecCurrentChangeSearch,e.treeSelecCurrentChange,null),onChange:vs(e.onChangeSearch,e.onChange,null)};return!e.dicData?.length&&e.loadDicData&&fs(a,e,"dicData"),a},c=e.searchColumns.map((e,t)=>(l(e),i(e,t))),u=c.length,d=c.concat((e=>{let t=[];return e.forEach((e,a)=>{e.searchType&&t.push(i(e,a+u))}),t})(s)),h=hs(d.sort((e,t)=>e.sort-t.sort),"prop");t&&t({formColumns:r,searchColumns:h,columns:a})})(e,({formColumns:e,searchColumns:t,columns:a})=>{m.value=t,x.value=e,f.value=a})},C=a(e.data),E=a((()=>{const e=m.value;let t={};for(let a=0;a<e.length;a++){const l=e[a];ps(l.defaultValue)&&(t[l.prop]=l.defaultValue)}return t})()),D=a=>{const l=ds(S(a));jl(E.value,l)||(e.page.pageIndex=1,E.value=l),t("confirm-search",l)},k=()=>{t("clear-search")},O=()=>{D(E.value)};b(()=>e.data,e=>{C.value=e},{immediate:!0}),b(()=>u,e=>{w(e.value)},{deep:!0,immediate:!0});const L=a(d.defaultContentHeight),T=a(),P=a(),A=a(),_=a(),j=a(null),z=()=>{y(()=>{const e=(T.value?.clientHeight||0)-((P.value?.clientHeight||0)+(_.value?.clientHeight||0));L.value=e})},H=e=>{"F11"!==e.key&&"fullscreenchange"!==e.type||z()};M(()=>{us(T.value,()=>{z()}),d.initLoadData&&D(E.value),d.fullscreenchangeContentHeight&&(document.addEventListener("fullscreenchange",H),document.addEventListener("keydown",H))}),h(()=>{d.fullscreenchangeContentHeight&&(document.removeEventListener("fullscreenchange",H),document.removeEventListener("keydown",H))});const V=a=>{e.page.pageIndex=a.pageIndex,e.page.pageSize=a.pageSize,t("change-pagination",a),D(E.value)},R=a([]),I=e=>{R.value=e,t("selection-change",R.value)};g("multipleSelection",R);const N=p({visible:!1,title:v("next.table.add"),rowInfo:{},isEditing:!0}),B=(e={})=>{const{dialogTitle:a,dialogFormParamsDefault:l}=d;N.isEditing=!0,N.title=a+" "+v("next.table.add"),N.rowInfo={...l,...e},t("click-add-edit",e,d),y(()=>{N.visible=!0})},F=e=>{t("delete-rows",e,()=>{O()})},Y=e=>{t("delete-row",e,()=>{O()})},W=e=>{const{dialogTitle:a}=d;N.isEditing=!0,N.title=a+" "+v("next.table.edit"),N.rowInfo=e.row,t("click-add-edit",e.row,d),y(()=>{N.visible=!0})},U=e=>{const{dialogTitle:a}=d;N.isEditing=!1,N.title=a+" "+v("next.table.view"),N.rowInfo=e.row,t("view-add-edit",e.row),y(()=>{N.visible=!0})},$=()=>{N.visible=!1,N.title="",N.rowInfo={},t("close-add-edit")},K=(...e)=>{t("submit-form",...e)},X=a([]),q=a([]),G=a([]);for(const e in s)e.includes(ho)?X.value.push(e):e.includes(vo)?q.value.push(e):e.includes(mo)&&G.value.push(e);g("columnSlots",X),g("searchFormSlots",q),g("addEditFormSlots",G);const Z=t=>{const{pageIndex:a,pageSize:l}=e.page;return(a-1)*l+(t+1)},J=l(()=>{const{total:t}=e.page,a=document.createElement("span");a.innerText=t,a.style.visibility="hidden",document.body.appendChild(a);const l=a.getBoundingClientRect().width,n=Math.ceil(l)+25;return document.body.removeChild(a),n>50?n:50}),Q={};q.value.forEach(e=>{Q[e]=(...t)=>s[e]&&s[e](...t)});const ee={};X.value.forEach(e=>{ee[e]=(...t)=>s[e]&&s[e](...t)});const te={};G.value.forEach(e=>{te[e]=(...t)=>s[e]&&s[e](...t)});const ne={};io.forEach(e=>{ne[e]=(...t)=>s[e]&&s[e](...t)});const se={};return co.forEach(e=>{se[e]=(...t)=>s[e]&&s[e](...t)}),o({onClickRowAdd:B,columns:f.value,getFormExpose:()=>j.value?.getFormExpose(),updateColumns:e=>{w(e)},getSearchFormParams:()=>E.value,reloadData:()=>{O()},onRefresh:()=>{w(u.value)}}),()=>r(i,null,[r(i,null,[r("div",{ref:T,class:[Zo.b(),e.className],style:e.style},[d.showSearchForm||d.showHeaderMenu?r("header",{ref:P,class:Zo.b("header")},[d.showSearchForm&&r(Co,{columns:m.value,onZoomResize:z,onConfirmSearch:D,onClearSearch:k},Go(Q)?Q:{default:()=>[Q]}),d.showHeaderMenu&&r(So,{onClickAdd:B,onDeleteRows:F,onClickRefresh:O},Go(ne)?ne:{default:()=>[ne]}),s["table-head-tip"]?.()]):null,r(yo,{loading:e.loading},{default:()=>[r("div",{ref:A,class:Zo.b("content")},[r(ae,{data:C.value,height:L.value,rowKey:d.rowKey,border:d.border,stripe:d.stripe,fit:d.fit,size:d.size,"row-style":d.rowStyle,"row-class-name":d.rowClassName,"cell-style":d.cellStyle,"cell-class-name":d.cellClassName,"header-row-style":d.headerRowStyle,"header-row-class-name":d.headerRowClassName,"header-cell-style":d.headerCellStyle,"header-cell-class-name":d.headerCellClassName,"span-method":e.spanMethod,"onSelection-change":I,"onRow-click":(...e)=>t("row-click",...e),"onRow-contextmenu":(...e)=>t("row-contextmenu",...e),"onRow-dblclick":(...e)=>t("row-dblclick",...e),"onCell-click":(...e)=>t("cell-click",...e),"onCell-dblclick":(...e)=>t("cell-dblclick",...e),"onCell-contextmenu":(...e)=>t("cell-contextmenu",...e),"onCell-mouse-enter":(...e)=>t("cell-mouse-enter",...e),"onCell-mouse-leave":(...e)=>t("cell-mouse-leave",...e),"onExpand-change":(...e)=>t("expand-change",...e)},{default:()=>[d.selection?r(le,{type:"selection",fixed:"left",label:v("next.table.selectionAll"),width:55,headerAlign:d.headerAlign,align:d.cellAlign},null):null,d.index?r(le,{type:"index",label:"#",width:J.value,index:Z,fixed:"left",headerAlign:d.headerAlign,align:d.cellAlign},null):null,s.default?.(),f.value.map(e=>r(Eo,{columnOption:e,key:e.prop},Go(ee)?ee:{default:()=>[ee]})),d.operations?r(Do,{onEditRow:W,onViewRow:U,onDeleteRow:Y},Go(se)?se:{default:()=>[se]}):null],empty:()=>r(me,{imageSize:L.value>220?100:50,description:v("next.table.notData")},null)})])]}),d.isPagination?r("div",{ref:_,class:Zo.b("footer")},[r(ko,{page:e.page,onChange:V},null),s["table-footer-tip"]?.()]):null,r(Lo,{modelValue:N.visible,"onUpdate:modelValue":e=>N.visible=e,title:N.title,width:d.dialogWidth,fullscreen:d.dialogFullscreen,fullscreenBtn:d.dialogFullscreenBtn,draggable:d.dialogDraggable,closeOnClickModal:d.closeOnClickModal,onClose:$},{default:()=>r(qo,{ref:j,formDatum:N.rowInfo,columns:x.value,isEditing:N.isEditing,onClose:$,onSubmit:K},Go(te)?te:{default:()=>[te]})})])])])}});const Qo=on(Jo);var er={className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},loading:{type:Boolean,default:!1},data:{type:Array,default:()=>[]},page:{type:Object,default:()=>({pageIndex:1,pageSize:10,total:0})}},tr={};const ar=Te("crud-table-virtualized"),lr=on(o({name:"NextCrudTableVirtualized",props:er,setup(e,{emit:t}){const a=ds(tr),s=l(()=>{const t=n(e.options);return zl(a,t)}),o=n(s);g("options",l(()=>s.value));const{t:c}=Wl(),u=p({visible:!1,title:c("next.table.add"),rowInfo:{},isEditing:!0}),d=()=>{u.visible=!1,u.title="",u.rowInfo={},t("close-add-edit")};return()=>r(i,null,[r("div",{class:[ar.b(),e.className]},[r(nr,null,null),r(jo,{modelValue:u.visible,"onUpdate:modelValue":e=>u.visible=e,title:u.title,width:o.dialogWidth,fullscreen:o.dialogFullscreen,closeOnClickModal:o.closeOnClickModal,onClose:d},null)])])}})),nr=on(yo),sr=Te("upload"),or=on(o({name:"NextUpload",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},listType:{type:String,values:["text","picture","picture-card"],default:"picture-card"},accept:{type:String,default:"image/*"}},emits:["change","remove","preview"],setup(){const{appContext:t}=e(),{t:a}=Wl();return{t:a,appContext:t}},render(){const e=this.$slots,t=this.$props,l=this.$emit,n=this.t,s=a([]),o=document.getElementsByTagName("body")[0];let i=null;return r(ue,{class:[sr.b(),t.className],style:t.style,"list-type":t.listType,"auto-upload":!1,"on-preview":e=>{const t=s.value.findIndex(t=>t.url===e.url)||0;i&&(D(null,i),o.removeChild(i)),i=document.createElement("div"),o.appendChild(i);const a=r({render:()=>C(m,{to:"body"},[C(de,{initialIndex:t,"url-list":s.value.map(e=>e.url),onClose:()=>{D(null,i)}})])});i.appContext=this.appContext,D(a,i),l("preview",e)},onChange:(e,t)=>{s.value=t,l("change",e,t)},onRemove:(e,t)=>{s.value=t,l("remove",e,t)}},{trigger:()=>e.default?e.default():"picture-card"===t.listType?r(R,null,{default:()=>[r(An,null,null)]}):r(te,{link:!0,text:!0,type:"primary"},{default:()=>[r(R,null,{default:()=>[r(An,null,null)]}),r("em",null,[n("next.form.selectFile")])]})})}})),rr=Te("video-player");var ir=o({name:"NextVideoPlayer",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},type:{type:String,default:"mp4",values:["mp4","m3u8","flv","mpegts"]},src:{type:String,default:""},autoplay:{type:Boolean,default:!0},tf:{type:Object,default:null},tensorflow:{type:Object}},emits:["loaded","play","error","detector"],setup(e,{emit:t,expose:l}){const n=e.tf||window.tf,{lang:s}=Wl(),o={"zh-cn":Me,en:Se,"zh-tw":Ee};o[s.value]?Ce.addLanguage("zh-CN",o[s.value]):Ce.addLanguage("zh-CN",Me);const c=S(e.src),u=a(),d=a(),p=a(),v=a(),f=a(),m=a(null),g=a(null),b=e=>{const t=r({render:()=>C("span",{class:"screemshot-btn",onClick:()=>((e,t)=>{const a=ye(xe(),"YYYY-MM-DD_HH-mm-ss").value,l=e.el().getElementsByTagName("video")[0],n=document.createElement("canvas"),s=l.videoWidth,o=l.videoHeight;n.width=s,n.height=o;const r=n.getContext("2d"),i=s/o,c=n.width/n.height,u=s,d=o;let h,p,v,f;i>c?(v=n.width,f=n.width/i,h=0,p=Math.round((n.height-f)/2)):i===c?(v=n.width,f=n.height,h=0,p=0):i<c&&(v=n.height*i,f=n.height,h=Math.round((n.width-v)/2),p=0),r.drawImage(l,0,0,u,d,h,p,v,f),t&&r.drawImage(t,0,0);const m="image/png";let g=n.toDataURL(m,.92).replace(m,"image/octet-stream");g=g.replace(/^data:image\/[^;]+/,"data:application/octet-stream");const b=document.createElement("a");b.href=g,b.download=a+"_screenshot.png",b.click()})(p.value,g.value)},[C(R,{color:"#FFFFFF",size:"22px"},{default:()=>C(wn)})])});p.value.on("loadedmetadata",()=>{D(t,e)})},x=(t,a)=>{if(!e.tensorflow)return;if(!n)throw new Error("请先引入 @tensorflow/tfjs 模块!");const{modelUrl:l,classNames:s}=e.tensorflow;if(!l)throw new Error("模型文件地址不能未空!");if(!s||!s.length)throw new Error("模型类别不能未空!");t.innerHTML="",n?.loadGraphModel(l).then(e=>{const l=document.createElement("canvas");l.className=rr.b("recongition"),t.appendChild(l);const o=l.getContext("2d"),r=document.createElement("canvas").getContext("2d");a.ontimeupdate=()=>{const{videoWidth:t,videoHeight:i,offsetTop:c,offsetLeft:u}=a;l.width=t,l.height=i,l.style.top=c+"px",l.style.left=u+"px",ln(a,e,o,n,s,[],r)},m.value=e,g.value=l})};h(()=>{m.value&&(n?.dispose(),m.value.dispose(),m.value=null),p.value&&(p.value.mse&&(p.value.mse.endOfStream(),p.value.mse.unload(),p.value.mse=null),p.value.pause(),p.value.dispose(),p.value=null),v.value&&(v.value.pause(),v.value.unload(),v.value.detachMediaElement(),v.value.destroy(),v.value=null),f.value&&(f.value.pause(),f.value.unload(),f.value.detachMediaElement(),f.value.destroy(),f.value=null),u.value&&D(null,u.value)});return M(()=>{y(()=>{(a=>{if(!a)return(()=>{const a=u.value,l=document.createElement("video");l.className="video-js vjs-default-skin",e.autoplay&&l.setAttribute("autoplay","true"),l.setAttribute("muted","true"),d.value=l,a.appendChild(l),p.value=Ce(l,{techOrder:["html5"],controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[]});const n=document.createElement("div");a.children[0].appendChild(n),p.value.on("play",()=>{t("play",l,a),x(n,l)}),b(a),t("loaded",{player:p.value,video:l})})(),!1;const l=e.type;"m3u8"===l?(a=>{const l=u.value,n=document.createElement("video");n.className="video-js vjs-default-skin",e.autoplay&&n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),d.value=n,l.appendChild(n);const s={techOrder:["html5"],flvjs:{mediaDataSource:{cors:!0,withCredentials:!1}},controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[{src:a,type:"application/x-mpegURL"}]};p.value=Ce(n,s);const o=document.createElement("div");l.children[0].appendChild(o),p.value.on("play",()=>{t("play",n,l),x(o,n)}),b(l),t("loaded",{player:p.value,video:n})})(a):"mp4"===l?(a=>{const l=u.value,n=document.createElement("video");n.className="video-js vjs-default-skin",e.autoplay&&n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),d.value=n,l.appendChild(n);const s={techOrder:["html5"],controls:!0,fluid:!0,preload:"auto",language:"zh-CN",sources:[{src:a,type:"video/mp4"}]};p.value=Ce(n,s);const o=document.createElement("div");l.children[0].appendChild(o),p.value.on("play",()=>{t("play",n,l),x(o,n)}),b(l),t("loaded",{player:p.value,video:n})})(a):"mpegts"===l?(async a=>{let l=window.mpegts;if(l||(l=await import("mpegts.js")),l&&l.getFeatureList().mseLivePlayback){const n=u.value,s=document.createElement("video");s.className="video-js vjs-default-skin",e.autoplay&&s.setAttribute("autoplay","true"),s.setAttribute("muted","true"),d.value=s,n.appendChild(s);const o={controls:!0,autoplay:!1,fluid:!0,muted:!0,liveui:!0,preload:"auto",language:"zh-CN"};p.value=Ce(s,o),f.value=l.createPlayer({enableWorker:!0,type:"flv",isLive:!0,url:a}),f.value.attachMediaElement(s),f.value.load(),f.value.on("error",()=>{t("error",s)}),b(n);const r=document.createElement("div");n.children[0].appendChild(r),f.value.on("metadata_arrived",()=>{t("play",s,n),x(r,s)}),t("loaded",{player:p.value,video:s})}})(a):"flv"===l&&(async a=>{let l=window.flvjs;l||(l=await import("flv.js"));const n=u.value,s=document.createElement("video");s.className="video-js vjs-default-skin",e.autoplay&&s.setAttribute("autoplay","true"),s.setAttribute("muted","true"),d.value=s,n.appendChild(s),p.value=Ce(s,{techOrder:["html5","flvjs"],flvjs:{mediaDataSource:{cors:!0,withCredentials:!1}},controls:!0,fluid:!0,preload:"auto",language:"zh-CN"}),l.isSupported()&&(v.value=l.createPlayer({type:"flv",url:a,cors:!0,isLive:!0}),v.value.attachMediaElement(s),v.value.load(),e.autoplay&&v.value.play());const o=document.createElement("div");n.children[0].appendChild(o),p.value.on("play",()=>{t("play",s,n),x(o,s)}),b(n),t("loaded",{player:p.value,video:s})})(a)})(c)})}),l({getElement:()=>{const e=u.value,t=e.children[0];return{videoElement:d.value,container:e,palyerContainer:t}}}),()=>r(i,null,[r("div",{ref:u,class:[rr.b(),e.className],style:e.style},null)])}});const cr=on(ir),ur=on(o({name:"NextDragResize",props:{},setup:()=>()=>r(i,null,[r(i,null,null)])})),dr=Te("container"),hr=on(o({name:"NextCarousel",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})}},setup:(e,{slots:t})=>()=>r("div",{class:[dr.b(),e.className],style:{...e.style}},[t.default?.()])}));var pr=o({props:{isFullscreen:{type:Boolean,default:!1},imageIndex:{type:Number,default:0},imageLength:{type:Number,default:0}},emits:["fullscreen","save"],setup(e,{emit:a}){const l=t("ns",{}),n=t("scaleTranslateManager",{}),s=n.scaleTranslate,{t:o}=Wl(),c=e=>{a("fullscreen",e),document.body.style.overflow=e?"hidden":"auto"};return()=>r(i,null,[r(i,null,[r("ul",{class:[l.be("header","tool")]},[r("li",{class:"hover",onClick:()=>a("save")},[r("svg",{t:"1719034799379",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4272",width:"18",height:"18"},[r("path",{d:"M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z","p-id":"4273"},null),r("path",{d:"M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z","p-id":"4274"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.saveLabel")])])]),r("ul",{class:[l.be("header","tool")]},[r("li",{class:"hover",onClick:()=>n.onResetScaleTranslate()},[r("svg",{t:"1725840994827",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6051",width:"18",height:"18"},[r("path",{d:"M322.794667 445.205333a34.133333 34.133333 0 0 1 2.218666 45.824l-2.218666 2.432a34.133333 34.133333 0 0 1-45.824 2.218667l-2.432-2.218667-149.333334-149.333333a34.133333 34.133333 0 0 1-2.218666-45.824l2.218666-2.432 149.333334-149.333333a34.133333 34.133333 0 0 1 50.474666 45.824l-2.218666 2.432-91.050667 91.050666L640 285.866667c160.234667 0 290.133333 129.898667 290.133333 290.133333 0 158.016-126.314667 286.506667-283.477333 290.048L640 866.133333H234.666667a34.133333 34.133333 0 0 1-3.114667-68.117333L234.666667 797.866667h405.333333c122.538667 0 221.866667-99.328 221.866667-221.866667 0-120.533333-96.106667-218.602667-215.850667-221.781333L640 354.133333l-408.256-0.021333 91.050667 91.093333z","p-id":"6052"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.zoomRestore")])]),r("li",null,[r("span",null,[E("缩放比例")]),r("span",null,[parseInt((100*s.value.scale).toString()),E("%")]),r("span",{style:"padding: 0 10px;"},[E("偏移量")]),r("span",{style:"min-width: 120px; text-align: left;"},[E("X: "),s.value.x,E(", Y: "),s.value.y])]),e.imageLength?r("li",null,[r("span",null,[E("第 "),e.imageIndex+1,E(" 张")]),r("em",{style:"padding: 0 5px;"},[E("/")]),r("span",null,[E("共 "),e.imageLength,E(" 张")])]):null,r("li",{style:"margin-right: 30px;",class:"hover"},[r(ge,{trigger:"hover",placement:"bottom",width:"none"},{reference:()=>r("div",{class:"flex-center"},[r("span",{style:"padding-right: 3px"},[o("next.labelimg.instructions")]),r(R,{size:14},{default:()=>[r(Nn,null,null)]})]),default:()=>r("ul",{style:"font-size: 12px;white-space: nowrap;"},[r("li",null,[r("span",null,[E("W:")]),r("span",null,[E("鼠标移入图片中,长按W键,鼠标按下左键,移动鼠标开始绘制,鼠标抬起结束绘制")])]),r("li",null,[r("span",null,[E("A:")]),r("span",null,[E("A键进入上一张图片进行标注")])]),r("li",null,[r("span",null,[E("D:")]),r("span",null,[E("D键进入下一张图片进行标注")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标滚轮:")]),r("span",null,[E("长按Ctrl+鼠标滚轮对图片进行缩放")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标左键:")]),r("span",null,[E("长按Ctrl+鼠标左键对图片进行拖拽移动")])])])})]),e.isFullscreen?r("li",{class:"hover",onClick:()=>c(!1)},[r(T,{placement:"top",content:"取消全屏"},{default:()=>[r("svg",{t:"1719035442027",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5388",width:"18",height:"18"},[r("path",{d:"M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z","p-id":"5389"},null)])]})]):r("li",{class:"hover",onClick:()=>c(!0)},[r(T,{placement:"top",content:"全屏"},{default:()=>[r("svg",{t:"1719035375323",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5241",width:"18",height:"18"},[r("path",{d:"M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z","p-id":"5242"},null)])]})])])])])}});const vr=["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],fr=e=>{const t=e.type,a=e.startX+e.rectWidth/2,l=e.startY+e.rectHeight/2;return[t,parseFloat((a/e.canvasWidth).toFixed(6)),parseFloat((l/e.canvasHeight).toFixed(6)),parseFloat((e.rectWidth/e.canvasWidth).toFixed(6)),parseFloat((e.rectHeight/e.canvasHeight).toFixed(6))]},mr=(e,t,a)=>{const[l,n,s,o,r]=e,i=o*t,c=r*a,u=n*t-i/2,d=s*a-c/2;return{type:l,startX:Math.ceil(u),startY:Math.ceil(d),rectWidth:Math.ceil(i),rectHeight:Math.ceil(c),canvasWidth:t,canvasHeight:a}};var gr=o({props:{labelRect:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},activateRect:{type:Object,default:null}},emits:["close","select","delete"],setup(e,{emit:n}){const s=t("ns",{}),o=()=>{n("close")},c=()=>{n("delete",e.activateRect)},u=a();b(()=>e.activateRect,()=>{const{type:t}=e.activateRect;u.value=ps(t)?t:null},{deep:!0,immediate:!0});const d=a({width:0,height:0});M(()=>{const{clientWidth:e,clientHeight:t}=h.value;d.value.width=e,d.value.height=t});const h=a(),p=l(()=>{const{left:t,top:a}=e.labelRect,l=a+d.value.height-window.innerHeight;let n=a;return l>0&&(n-=l),{top:n+"px",left:t+"px"}});return()=>r(i,null,[r("div",{ref:h,class:[s.b("contextmenu-label")],style:p.value},[r("div",{class:"label-head"},[r("span",{style:"padding-right: 30px"},[E("标签选择")]),r(R,{size:16,onClick:o},{default:()=>[r(Cn,null,null)]})]),r("ul",{class:"label-main"},[e.classes.map((e,t)=>r("li",{key:t,onClick:()=>(e=>{u.value=e,n("select",e)})(t),class:{"activate-label":u.value===t}},[r("span",{style:{"background-color":vr[t%vr.length]},class:"label-line"},null),r("span",null,[e])]))]),ps(u.value)?r("div",{style:"margin: 10px auto 0"},[r(te,{icon:En,plain:!0,size:"small",type:"danger",onClick:c},{default:()=>[E("删除标注框")]})]):null])])}});class br{canvas;canvasWidth;canvasHeight;ctx;scaleFactor=1;preScaleFactor=1;offset={x:0,y:0};preOffset={x:0,y:0};mousePositioin={x:0,y:0};maxScale=8;minScale=.5;scaleStep=.1;clickX=0;clickY=0;observers=[];constructor(e){this.canvas=e,this.canvasWidth=e.width,this.canvasHeight=e.height,this.ctx=e.getContext("2d"),this.canvasMousedown=this.canvasMousedown.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this),this.canvasMouseup=this.canvasMouseup.bind(this),this.canvas.addEventListener("mousedown",this.canvasMousedown),this.canvas.addEventListener("wheel",this.canvasMousewheel,{passive:!1}),window.addEventListener("wheel",this.onWindowWheel,{passive:!1})}notifyObservers(e,t){this.observers.forEach(a=>{a({scale:e,...t})})}changeZoom(e){this.observers.push(e)}reset(){this.scaleFactor=1,this.preScaleFactor=1,this.offset={x:0,y:0},this.preOffset={x:0,y:0},this.mousePositioin={x:0,y:0},this.zoom()}render(){this.canvas.width=this.canvasWidth,this.notifyObservers(this.scaleFactor,this.offset)}zoom(){const e=this.mousePositioin.x-(this.mousePositioin.x-this.offset.x)*this.scaleFactor/this.preScaleFactor,t=this.mousePositioin.y-(this.mousePositioin.y-this.offset.y)*this.scaleFactor/this.preScaleFactor;this.offset.x=Math.ceil(e),this.offset.y=Math.ceil(t),this.render(),this.preScaleFactor=this.scaleFactor,this.preOffset.x=this.offset.x,this.preOffset.y=this.offset.y}onWindowWheel=e=>{e.ctrlKey&&e.preventDefault()};canvasMousewheel=e=>{e.preventDefault(),e.ctrlKey&&(this.mousePositioin.x=e.offsetX,this.mousePositioin.y=e.offsetY,e.deltaY>0?(this.scaleFactor=parseFloat((this.scaleFactor+this.scaleStep).toFixed(1)),this.scaleFactor>this.maxScale&&(this.scaleFactor=this.maxScale)):(this.scaleFactor=parseFloat((this.scaleFactor-this.scaleStep).toFixed(1)),this.scaleFactor<this.minScale&&(this.scaleFactor=this.minScale)),this.zoom())};canvasMousedown(e){e.preventDefault(),0===e.button&&e.ctrlKey&&(this.clickX=e.offsetX,this.clickY=e.offsetY,this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("mouseup",this.canvasMouseup))}canvasMousemove(e){e.preventDefault(),e.ctrlKey&&(this.offset.x=Math.ceil(this.preOffset.x+(e.offsetX-this.clickX)),this.offset.y=Math.ceil(this.preOffset.y+(e.offsetY-this.clickY)),this.render())}canvasMouseup(e){e.preventDefault(),e.ctrlKey&&(this.preOffset.x=this.offset.x,this.preOffset.y=this.offset.y,this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("mouseup",this.canvasMouseup))}destroy(){this.canvas.removeEventListener("mousedown",this.canvasMousedown),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("mouseup",this.canvasMouseup),this.canvas.removeEventListener("wheel",this.canvasMousewheel),window.removeEventListener("wheel",this.onWindowWheel)}}const{hexToRgb:yr}=ql();var xr=o({props:{parentEl:{type:Object,default:null},rect:{type:Object,default:()=>({})},color:{type:String,default:null}},emits:["draggle-resize","contextmenu"],setup(e,{emit:l}){const n=t("scaleTranslateManager",{}).scaleTranslate,s=a(!1),o=a({topLeft:!1,topCenter:!1,topRight:!1,leftCenter:!1,rightCenter:!1,bottomLeft:!1,bottomCenter:!1,bottomRight:!1}),r=a({diff_x:null,diff_y:null});let i={};const c=k(e.rect),u=e=>{e.preventDefault(),e.stopPropagation(),s.value=!1,o.value.topLeft=!1,o.value.topCenter=!1,o.value.topRight=!1,o.value.leftCenter=!1,o.value.rightCenter=!1,o.value.bottomLeft=!1,o.value.bottomCenter=!1,o.value.bottomRight=!1,l("draggle-resize",c.value)},d=e=>{const{scale:t,x:a,y:l}=n.value,u=30/t,d=Math.ceil(c.value.startX*t+a),h=Math.ceil(c.value.startY*t+l);if(s.value){const n=e.clientX-i.left-r.value.diff_x,s=e.clientY-i.top-r.value.diff_y,o=Math.ceil((n-a)/t),u=Math.ceil((s-l)/t);c.value.startX=Math.max(0,Math.min(o,i.width-c.value.rectWidth)),c.value.startY=Math.max(0,Math.min(u,i.height-c.value.rectHeight))}if(o.value.bottomCenter){let a=Math.floor((e.clientY-i.top-h)/t);a<u&&(a=u),a+c.value.startY>i.height&&(a=i.height-c.value.startY),c.value.rectHeight=a}if(o.value.topCenter){let a=Math.floor((e.clientY-i.top-l)/t),n=c.value.startY-a+c.value.rectHeight;if(a<0)return;if(n<u)return;c.value.rectHeight=n,c.value.startY=Math.max(0,Math.min(a,i.height-c.value.rectHeight))}if(o.value.leftCenter){let l=Math.floor((e.clientX-i.left-a)/t),n=c.value.startX-l+c.value.rectWidth;if(l<0)return;if(n<u)return;c.value.startX=Math.max(0,Math.min(l,i.width-c.value.rectWidth)),c.value.rectWidth=n}if(o.value.rightCenter){let a=Math.floor((e.clientX-i.left-d)/t);a<u&&(a=u),a+c.value.startX>i.width&&(a=i.width-c.value.startX),c.value.rectWidth=a}if(o.value.bottomRight){let a=Math.floor((e.clientX-i.left-d)/t),l=Math.floor((e.clientY-i.top-h)/t);a<u&&(a=u),l<u&&(l=u),a+c.value.startX>i.width&&(a=i.width-c.value.startX),l+c.value.startY>i.height&&(l=i.height-c.value.startY),c.value.rectWidth=a,c.value.rectHeight=l}if(o.value.bottomLeft){let l=Math.floor((e.clientX-i.left-a)/t),n=c.value.startX-l+c.value.rectWidth,s=Math.floor((e.clientY-i.top-h)/t);if(l<0)return;if(n<u)return;s<u&&(s=u),s+c.value.startY>i.height&&(s=i.height-c.value.startY),c.value.startX=Math.max(0,Math.min(l,i.width-c.value.rectWidth)),c.value.rectWidth=n,c.value.rectHeight=s}if(o.value.topLeft){let n=Math.floor((e.clientY-i.top-l)/t),s=c.value.startY-n+c.value.rectHeight;if(n<0)return;if(s<u)return;c.value.rectHeight=s,c.value.startY=Math.max(0,Math.min(n,i.height-c.value.rectHeight));let o=Math.floor((e.clientX-i.left-a)/t),r=c.value.startX-o+c.value.rectWidth;if(o<0)return;if(r<u)return;c.value.startX=Math.max(0,Math.min(o,i.width-c.value.rectWidth)),c.value.rectWidth=r}if(o.value.topRight){let a=Math.floor((e.clientY-i.top-l)/t),n=c.value.startY-a+c.value.rectHeight;if(a<0)return;if(n<u)return;c.value.rectHeight=n,c.value.startY=Math.max(0,Math.min(a,i.height-c.value.rectHeight));let s=Math.floor((e.clientX-i.left-d)/t);s<u&&(s=u),s+c.value.startX>i.width&&(s=i.width-c.value.startX),c.value.rectWidth=s}};return M(()=>{i=e.parentEl.getBoundingClientRect(),document.addEventListener("mousemove",d),document.addEventListener("mouseup",u)}),h(()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",u)}),{onMousedown:e=>{e.preventDefault(),s.value=!0,r.value.diff_x=e.offsetX,r.value.diff_y=e.offsetY},onMouseup:u,onContextmenu:e=>{e.preventDefault(),e.preventDefault(),l("contextmenu",e,c.value)},rect:c,onMousedownDot:(e,t)=>{e.preventDefault(),e.stopPropagation(),o.value[t]=!0}}},render(){const e=t("ns",{}),a=t("scaleTranslateManager",{}).scaleTranslate,l=this.$props;return r("div",{class:[e.b("draggable-rect")],style:(()=>{const{startX:e,startY:t,rectWidth:n,rectHeight:s}=((e,t)=>{const{startX:a,startY:l,rectWidth:n,rectHeight:s}=e,{scale:o,x:r,y:i}=t;return{startX:Math.ceil(a*o+r),startY:Math.ceil(l*o+i),rectWidth:Math.ceil(n*o),rectHeight:Math.ceil(s*o),canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,originWidth:e.originWidth,originHeight:e.originHeight}})(this.rect,a.value),o={top:t+"px",left:e+"px",width:n+"px",height:s+"px"},r=l.color;if(r){const e=yr(r);e&&(o.backgroundColor=`rgba(${e[0]},${e[1]},${e[2]}, 0.5)`)}return o})(),onMousedown:this.onMousedown,onMouseup:this.onMouseup,onContextmenu:this.onContextmenu},[r("ul",{class:[e.be("draggable-rect","resize")]},[r("li",{class:"top-left",onMousedown:e=>this.onMousedownDot(e,"topLeft")},null),r("li",{class:"top-center",onMousedown:e=>this.onMousedownDot(e,"topCenter")},null),r("li",{class:"top-right",onMousedown:e=>this.onMousedownDot(e,"topRight")},null),r("li",{class:"left-center",onMousedown:e=>this.onMousedownDot(e,"leftCenter")},null),r("li",{class:"right-center",onMousedown:e=>this.onMousedownDot(e,"rightCenter")},null),r("li",{class:"bottom-left",onMousedown:e=>this.onMousedownDot(e,"bottomLeft")},null),r("li",{class:"bottom-center",onMousedown:e=>this.onMousedownDot(e,"bottomCenter")},null),r("li",{class:"bottom-right",onMousedown:e=>this.onMousedownDot(e,"bottomRight")},null)])])}}),wr=o({name:"NextCanvasContext",props:{classes:{type:Array,default:()=>[]},contextClientHeight:{type:Number,default:null},rowInfo:{type:Object,default:()=>({})}},emits:["change"],setup(e,{emit:n,expose:s}){const o=t("ns",{}),c=t("_emit",null),u=t("scaleTranslateManager",{}),d=a(),p=a(),v=a(),f=a(),m=a([]),g=a({}),x=a(),w=()=>{const e=ds(m.value);let t=[];return{rects:e.map(e=>{delete e.typeName;const a=fr(e);return t.push(a.join(" ")),S(e)}),label_txt:t.join("\n")}},C=(e,t)=>{p.value.style.width=e+"px",p.value.style.height=t+"px",v.value.width=e,v.value.height=t,v.value.style.width=e+"px",v.value.style.height=t+"px",f.value.width=e,f.value.height=t,f.value.style.width=e+"px",f.value.style.height=t+"px"},E=a(!1),D=t=>{const a=v.value?.getContext("2d");if(t?.imageSrc){const l=new Image;l.src=t.imageSrc,E.value=!0,l.onload=()=>{E.value=!1;const{canvasWidth:n,canvasHeight:s,originWidth:o,originHeight:r}=(e=>{const t=d.value?.elementInstance.clientWidth,a=d.value?.elementInstance.clientHeight;let{width:l,height:n}=e,s=1;const o=l/n;if(o>1?(l=t,n=t/o):(l=a*o,n=a),n>a){const e=n/a;n=a,l/=e}else if(l>t){const e=l/t;l=t,n/=e}const r=parseInt(l.toString()),i=parseInt(n.toString());return s=Number((r/i).toFixed(2)),{canvasWidth:r,canvasHeight:i,scaleFactor:s,originWidth:e.width,originHeight:e.height}})(l);m.value=((t,a,l)=>t.labels?t.labels.map(t=>{const n=e.classes[t.type];return n&&(t.typeName=n),t.originWidth||(t.originWidth=a),t.originHeight||(t.originHeight=l),t}):[])(t,o,r),l.style.width=n+"px",l.style.height=s+"px",C(n,s),m.value=((e,t)=>{let a=[];for(let l=0;l<e.length;l++){const n=e[l],s=parseFloat((t/n.canvasHeight).toFixed(3));s&&(n.startX=Math.ceil(n.startX*s),n.startY=Math.ceil(n.startY*s),n.rectWidth=Math.ceil(n.rectWidth*s),n.rectHeight=Math.ceil(n.rectHeight*s),n.canvasWidth=Math.ceil(n.canvasWidth*s),n.canvasHeight=t),a.push(n)}return a})(m.value,s);const{updateLabels:i,addDrawRect:c,hitCanvasLabel:h}=(e=>{const{canvas:t,ctx:a,labels:l,image:n,canvasWidth:s,canvasHeight:o,scaleOffset:r}=e,i=()=>{t.width=s,r.value&&(a.save(),a.translate(r.value.x,r.value.y),a.scale(r.value.scale,r.value.scale)),a.clearRect(0,0,s,o),a.drawImage(n,0,0,s,o);const e=r.value?.scale||1,i=14/e,c=6/e,u=2/e;for(let e=0;e<l.length;e++){const t=l[e],{startX:n,startY:s,rectWidth:o,rectHeight:r,type:d}=t,h=vr[d%vr.length];if(a.font=`bold ${i}px serif`,a.textBaseline="top",a.save(),a.strokeStyle=h,a.lineWidth=u,a.strokeRect(n,s,o,r),ps(t.typeName)||ps(t.type)){const e=t.typeName||t.type;a.fillStyle=h,a.fillText(e,n+c,s+c)}a.restore()}};return i(),{updateLabels:i,addDrawRect:(e,t="#f30635")=>{const l=r.value?.scale||1,{startX:n,startY:s,rectWidth:o,rectHeight:i}=e;a.save();const c=2/l;a.lineWidth=c,a.strokeStyle=t,a.strokeRect(n,s,o,i),a.restore()},hitCanvasLabel:(e,t)=>{let a=null,n=null,s=null;for(let o=0;o<l.length;o++){const r=l[o],{type:i,startX:c,startY:u,rectWidth:d,rectHeight:h}=r;e>=c&&e<=c+d&&t>=u&&t<=u+h&&(a=r,n=o,s=vr[i])}return{hit_rect:a,hit_index:n,color:s}}}})({canvas:v.value,ctx:a,image:l,canvasWidth:n,canvasHeight:s,labels:m.value,scaleOffset:u.scaleTranslate});g.value.updateLabels=i,g.value.addDrawRect=c,g.value.hitCanvasLabel=h;const{clearCanvas:p,removeEventAll:b}=(({canvas:e,originWidth:t,originHeight:a},l,n)=>{const s=e.width,o=e.height,r=e?.getContext("2d"),i=()=>{r.clearRect(0,0,s,o)};i();let c,u,d,h,p=!1,v=!1,f=!1;const m=()=>{const e=Math.abs(d-c),n=Math.abs(h-u);c>d&&(c=d),u>h&&(u=h),l&&l({startX:c,startY:u,rectWidth:e,rectHeight:n,canvasWidth:s,canvasHeight:o,originWidth:t,originHeight:a},{endX:d,endY:h})},g=t=>{f||"KeyW"===t.code&&(t.preventDefault(),f=!0,e.style.cursor="crosshair",e.style.zIndex="11",n&&n())},b=t=>{p||"KeyW"===t.code&&(f=!1,e.style.cursor="unset",e.style.zIndex="0")},y=()=>{v&&(p=!1,f=!1,e.style.cursor="unset",e.style.zIndex="0",m(),v=!1)};document.addEventListener("keydown",g),document.addEventListener("keyup",b),document.addEventListener("mouseup",y);const x=e=>{f&&(p=!0,c=e.offsetX,u=e.offsetY)},w=e=>{p&&f&&(v=!0,d=e.offsetX,h=e.offsetY,M())},C=t=>{t.stopPropagation(),v&&(p=!1,f=!1,e.style.cursor="unset",e.style.zIndex="0",m(),v=!1)};e.addEventListener("mousedown",x),e.addEventListener("mousemove",w),e.addEventListener("mouseup",C);const M=(e="#f30635")=>{i(),r.strokeStyle=e,r.strokeRect(c,u,d-c,h-u)};return{canvas:e,ctx:r,clearCanvas:i,drawRect:M,removeEventAll:()=>{document.removeEventListener("keydown",g),document.removeEventListener("keyup",b),document.removeEventListener("mouseup",y),e.removeEventListener("mousedown",x),e.removeEventListener("mousemove",w),e.removeEventListener("mouseup",C)}}})({canvas:f.value,originWidth:o,originHeight:r},(e,{endX:t,endY:a})=>{H.value=e;const l=((e,t)=>{const{startX:a,startY:l,rectWidth:n,rectHeight:s}=e,{scale:o,x:r,y:i}=t;return{startX:Math.ceil((a-r)/o),startY:Math.ceil((l-i)/o),rectWidth:Math.ceil(n/o),rectHeight:Math.ceil(s/o),canvasWidth:e.canvasWidth,canvasHeight:e.canvasHeight,originWidth:e.originWidth,originHeight:e.originHeight}})(e,u.scaleTranslate.value);g.value.addDrawRect(l),O(t,a,l)},()=>{_()});g.value.clearCanvasRect=p,g.value.removeEventAll=b,x.value=new br(v.value),x.value.changeZoom(e=>{u.onChangeScaleTranslate(e),g.value.updateLabels()})},l.onerror=()=>{E.value=!1}}v.value.addEventListener("contextmenu",e=>{e.preventDefault();const t=e.offsetX,a=e.offsetY,{scale:l,x:n,y:s}=u.scaleTranslate.value,o=Math.floor((t-n)/l),r=Math.floor((a-s)/l),{hit_rect:i}=g.value.hitCanvasLabel(o,r);L(),_(),i&&y(()=>{O(t,a,i)})}),v.value.addEventListener("click",e=>{if(e.ctrlKey)return;const t=e.offsetX,a=e.offsetY,{scale:l,x:n,y:s}=u.scaleTranslate.value,o=Math.floor((t-n)/l),r=Math.floor((a-s)/l),{hit_rect:i,hit_index:c,color:d}=g.value.hitCanvasLabel(o,r);_(),L(),i&&y(()=>{A(t,a,i,c,d)})})};M(()=>{b(()=>e.rowInfo,e=>{const t=S(e);D(t)},{deep:!0,immediate:!0}),b(()=>e.classes,()=>{const t=S(e.rowInfo);D(t)}),b(()=>e.contextClientHeight,t=>{if(vs(t)){p.value.style.height=t+"px";const a=S(e.rowInfo);D(a)}})}),h(()=>{g.value.removeEventAll?.(),x.value.destroy()});const k=a({show:!1,top:0,left:0,activateRect:null}),O=(e,t,a)=>{const l=v.value.getBoundingClientRect();k.value.show=!0,k.value.left=e+l.x,k.value.top=t+l.y,k.value.canvasWidth=v.value.width,k.value.canvasHeight=v.value.height,k.value.activateRect=a,H.value=a},L=()=>{k.value.show=!1,k.value.top=0,k.value.left=0,k.value.activateRect=null,H.value=null,g.value.updateLabels(),g.value.clearCanvasRect()},T=l(()=>{const{top:e,left:t,canvasWidth:a,canvasHeight:l}=k.value;return{top:e,left:t,canvasWidth:a,canvasHeight:l}}),P=a({show:!1,top:0,left:0,width:0,height:0,activateRect:null,activateIndex:null,color:null}),A=(e,t,a,l,n)=>{P.value.show=!0,P.value.top=t,P.value.left=e,P.value.width=a.rectWidth,P.value.height=a.rectHeight,P.value.activateRect=a,P.value.activateIndex=l,P.value.color=n},_=()=>{P.value.show=!1,P.value.top=0,P.value.left=0,P.value.width=0,P.value.height=0,P.value.activateRect=null,P.value.activateIndex=null,P.value.color=null},j=e=>{P.value.activateRect=e;const t=m.value.findIndex(t=>jl(t,e));t>-1&&m.value.splice(t,1,e),g.value.updateLabels();const{rects:a,label_txt:l}=w();c("change",a,l),n("change",a,l)},z=(e,t)=>{e.preventDefault();const a=e.offsetX,l=e.offsetY,n=a+t.startX,s=l+t.startY;L(),y(()=>{O(n,s,t)})},H=a(),V=t=>{H.value.type=t;const a=e.classes[t];a&&(H.value.typeName=a);const l=m.value.findIndex(e=>jl(e,H.value));l>-1?m.value.splice(l,1,H.value):m.value.push(H.value),L();const{rects:s,label_txt:o}=w();c("change",s,o),n("change",s,o)},R=e=>{const t=m.value.findIndex(t=>jl(t,e));m.value.splice(t,1),L(),_(),g.value.updateLabels();const{rects:a,label_txt:l}=w();c("change",a,l),n("change",a,l)};return s({onCloseDraggableRectFixed:_,onCloseContentmenuLabel:L,onSelectedLabel:(e,t)=>{_(),y(()=>{const{startX:a,startY:l,type:n}=e,s=vr[n];A(a,l,m.value[t],t,s)})},onDeleteLabel:R,rerenderImage:()=>{C(0,0),L(),_(),y(()=>{const t=S(e.rowInfo);D(t)})},resetScaleOffset:()=>{x.value.reset()}}),()=>r(i,null,[r(nr,{ref:d,loading:E.value,class:[o.b("loading")]},{default:()=>[r("div",{ref:p,class:[o.b("canvas")]},[r("canvas",{ref:v,class:[o.be("canvas","context")]},null),r("canvas",{ref:f,class:[o.be("canvas","rect")]},null),k.value.show?r(gr,{labelRect:T.value,classes:e.classes,activateRect:k.value.activateRect,onClose:L,onSelect:V,onDelete:R},null):null,P.value.show?r(xr,{parentEl:p.value,rect:P.value.activateRect,color:P.value.color,onDraggleResize:j,onContextmenu:z},null):null])]})])}}),Cr=o({props:{contentHeight:{type:Number},classes:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]}},emits:["delete","select"],setup(e,{emit:l}){const{t:n}=Wl(),s=t("ns",{}),o=a([]),c=t=>t.length?t.map(t=>{const a=e.classes[t.type];return a&&(t.typeName=a),t}):[];b(()=>e.classes,()=>{o.value=c(o.value)}),b(()=>e.labels,e=>{const t=S(e);o.value=c(t)},{deep:!0,immediate:!0});return()=>r(i,null,[r("div",{class:[s.b("right")],style:{height:e.contentHeight+"px"}},[o.value.length?r("ul",null,[o.value.map((e,t)=>r("li",{key:t,onClick:()=>((e,t)=>{l("select",e,t)})(e,t)},[r("div",null,[r("span",{style:{"background-color":vr[e.type]},class:"label-line"},null),r("span",null,[e.typeName])]),r(be,{title:n("next.labelimg.confirmDeleteLabel"),width:200,onConfirm:()=>(e=>{l("delete",e)})(e)},{reference:()=>r(R,{size:16,color:"#ff0000",onClick:e=>{e.preventDefault(),e.stopPropagation()}},{default:()=>[r(En,null,null)]})})]))]):r(me,{"image-size":100,description:n("next.labelimg.emptyLabelText")},null)])])}}),Mr={minContentHeight:500};const Sr=Te("labelimg");var Er=o({name:"NextLabelimg",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["change","save","prev-click","next-click"],setup(e,{emit:t,slots:s,expose:o}){const{t:c}=Wl(),u=ds(Mr),d=l(()=>{const t=n(e.options);return zl(u,t)}),p=n(d);g("ns",Sr),g("_emit",t);const v=a(0),f=a(e.classes),m=a(ds(e.data));b(()=>e.data,e=>{m.value=ds(e)},{deep:!0}),b(()=>e.data.length,()=>{v.value=0}),b(()=>e.classes,e=>{f.value=e},{deep:!0});const x=l(()=>{if(!m.value)return{};const e=m.value[v.value]||{};return ds(e)}),w=a(x.value.labels||[]);b(()=>x.value,()=>{w.value=x.value.labels||[]});const C=e=>{x.value.labels=e,w.value=e},E=a(!1),D=()=>{const e=x.value;let t=[];return e.labels.forEach(e=>{delete e.typeName;const a=fr(e);t.push(a.join(" "))}),{node:e,label_txt:t.join("\n")}},k=()=>{const e=m.value[v.value];return jl(S(e.labels).map(e=>fr(e)),x.value.labels.map(e=>fr(e)))},O=e=>{const t=m.value.length;"KeyD"===e.code?(v.value++,v.value>=t&&(v.value=0)):"KeyA"===e.code&&(v.value--,v.value<0&&(v.value=t-1))},T=e=>{if(E.value)return;if(!["KeyA","KeyD"].includes(e.code))return;E.value=!0;const{node:a,label_txt:l}=D();if(z.value.onCloseDraggableRectFixed(),k())return O(e),void(E.value=!1);t("save",{node:a,label_txt:l},t=>{m.value[v.value]=t||a,O(e),E.value=!1},()=>{E.value=!1})},A=e=>{if(E.value)return;E.value=!0;const{node:a,label_txt:l}=D();return z.value.onCloseDraggableRectFixed(),k()?(v.value=e,E.value=!1,!1):(t("save",{node:a,label_txt:l},t=>{m.value[v.value]=t||a,v.value=e,E.value=!1,K.value={scale:1,x:0,y:0}},()=>{E.value=!1}),!0)},_=()=>{const e=m.value.length;let a=v.value-1;a<0&&(a=e-1),A(a),t("prev-click")},j=()=>{const e=m.value.length;let a=v.value+1;a>=e&&(a=0),A(a),t("next-click")},z=a(),H=a(),V=a(),I=a(),N=a(),B=a(p.minContentHeight),F=()=>{y(()=>{const e=(H.value?.clientHeight||0)-((V.value?.clientHeight||0)+(N.value?.clientHeight||0));B.value=e})};M(()=>{document.addEventListener("keydown",T),us(H.value.parentElement,()=>{F()}),window.addEventListener("resize",F)}),h(()=>{document.removeEventListener("keydown",T),window.removeEventListener("resize",F)});const Y=(e,t)=>{z.value.onSelectedLabel(e,t)},W=e=>{z.value.onDeleteLabel(e)},U=a(!1),$=e=>{U.value=e,F(),y(()=>{z.value.rerenderImage()})},K=a({scale:1,x:0,y:0});g("scaleTranslateManager",{scaleTranslate:K,onChangeScaleTranslate:e=>{K.value=e},onResetScaleTranslate:()=>{z.value.resetScaleOffset()}}),o({convertToLabel:fr,canvertToCanvas:mr});return()=>r(i,null,[r("div",{ref:H,class:[Sr.b(),e.className,U.value?Sr.b("fullscreen"):""],style:{...e.style}},[r(yo,{loading:E.value,tip:c("next.labelimg.saveTxt"),class:[Sr.b("loading")]},{default:()=>[r(P,null,{default:()=>[r("header",{ref:V,class:[Sr.b("header")]},[s.header?s.header():r(pr,{isFullscreen:U.value,imageIndex:v.value,imageLength:m.value.length,onFullscreen:$,onSave:()=>{A(v.value)||L({type:"info",message:c("next.labelimg.labelNoUpdate")})}},null)]),r("div",{ref:I,class:[Sr.b("main")]},[r(P,{class:[Sr.be("main","content")]},{default:()=>[r("div",{class:[Sr.be("main","content")],style:{height:B.value+"px"}},[r(wr,{ref:z,contextClientHeight:B.value,classes:f.value,rowInfo:x.value,onChange:C},null)])]}),r(Cr,{contentHeight:B.value,classes:f.value,labels:w.value,onDelete:W,onSelect:Y},null)]),r("footer",{ref:N,class:[Sr.b("footer")]},[r("div",{class:[Sr.be("footer","left")]},[r(R,{size:24,color:"#797979",onClick:_},{default:()=>[r(gn,null,null)]})]),r("div",{class:[Sr.be("footer","center")]},[r(P,null,{default:()=>[r("ul",{class:[Sr.bem("footer","center","list")]},[m.value.map((e,t)=>r("li",{key:t,onClick:()=>A(t),class:{"is-activate":v.value===t}},[r(he,{style:"height: 100%",src:e.imageSrc,"zoom-rate":1.2,"max-scale":2,"min-scale":.2,fit:"cover"},null)]))])]})]),r("div",{class:[Sr.be("footer","right")]},[r(R,{size:24,color:"#797979",onClick:j},{default:()=>[r(bn,null,null)]})])])]})]})])])}});const Dr=Te("labelimg-preview");var kr=o({name:"NextLabelimgPreview",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},src:{type:String,default:""},classes:{type:Array,default:()=>[]},labels:{type:Array,default:()=>[]}},setup(e){const t=a(),l=a(ds(e.classes)),n=a(ds(e.labels));return M(()=>{b(()=>e.src,()=>{(()=>{if(e.src){const a=t.value?.getContext("2d"),s=new Image;s.src=e.src,s.onload=()=>{const{width:e,height:o}=s,r=o,i=r/o,c=Math.ceil(e*i);((e,a)=>{t.value.width=e,t.value.height=a,t.value.style.width=e+"px",t.value.style.height=a+"px"})(c,r),a.clearRect(0,0,c,r),a.drawImage(s,0,0,c,r);for(let e=0;e<n.value.length;e++){const t=n.value[e],{startX:s,startY:o,rectWidth:r,rectHeight:i,type:c}=t,u=vr[c%vr.length];if(a.font="bold 14px serif",a.textBaseline="top",a.save(),a.strokeStyle=u,a.strokeRect(s,o,r,i),!ps(t.typeName)){const e=l.value[t.type];e&&(t.typeName=e)}if(ps(t.typeName)||ps(t.type)){const e=t.typeName||t.type;a.fillStyle=u,a.fillText(e,s+6,o+6)}a.restore()}}}})()},{immediate:!0})}),()=>r(i,null,[r("div",{class:[Dr.b(),e.className],style:{...e.style}},[r("canvas",{ref:t},null)])])}});const Or=on(Er),Lr=on(kr);var Tr,Pr;!function(e){e.Polygon="polygon",e.Rectangle="rectangle",e.Circle="circle",e.Keypoint="keypoint"}(Tr||(Tr={})),function(e){e.CREATE_POLYGON="createPolygon",e.EDIT_SHAPE="editShape",e.CREATE_RECTANGLE="createRectangle",e.CREATE_CIRCLE="createCircle",e.CREATE_KEYPOINT="createKeypoint"}(Pr||(Pr={}));const Ar="#5470c6",_r=["#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"];var jr={minContentHeight:500},zr=o({props:{fixed:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},activateShape:{type:Object,default:null}},emits:["close","select","delete"],setup(e,{emit:n}){const{t:s}=Wl(),o=t("ns",{}),c=a(e.activateShape.group_id||""),u=a(e.activateShape.description||""),d=()=>{n("close")},h=()=>{n("delete",e.activateShape)},p=a();b(()=>e.activateShape,()=>{const{label:t}=e.activateShape;p.value=ps(t)?t:null},{deep:!0,immediate:!0});const v=a({width:0,height:0});M(()=>{const{clientWidth:e,clientHeight:t}=g.value;v.value.width=e,v.value.height=t});const g=a(),y=l(()=>{const{left:t,top:a}=e.fixed,l=a+v.value.height-window.innerHeight;let n=a;return l>0&&(n-=l),{top:n+"px",left:t+"px"}}),x=()=>{let t;return r(m,{to:"body"},{default:()=>{return[r("div",{ref:g,class:[o.b("contextmenu-label")],style:y.value},[r("div",{class:"label-head"},[r("span",{style:"padding-right: 30px"},[s("next.labelme.selectClasses")]),r(R,{size:16,onClick:d},{default:()=>[r(Cn,null,null)]})]),e.classes.length?r(i,null,[r($,{modelValue:c.value,"onUpdate:modelValue":e=>c.value=e,placeholder:s("next.labelme.labelGroupId"),size:"small",maxLength:30},null),r("ul",{class:"label-main"},[e.classes.map((t,a)=>r("li",{key:a,onClick:()=>(t=>{p.value=t;const a={...e.activateShape,label:t,description:u.value,group_id:c.value};n("select",t,a)})(t),class:{"activate-label":p.value===t}},[r("span",{style:{"background-color":_r[a%_r.length]},class:"label-line"},null),r("span",null,[t])]))]),r($,{modelValue:u.value,"onUpdate:modelValue":e=>u.value=e,placeholder:s("next.labelme.labelDescription"),size:"small",type:"textarea",rows:2,resize:"none",maxLength:100},null)]):r(me,{"image-size":50,description:s("next.labelme.emptyClassesText"),style:{padding:0}},null),ps(p.value)?r("div",{style:"margin: 10px auto 0"},[r(te,{icon:En,plain:!0,size:"small",type:"danger",onClick:h},(a=t=s("next.labelme.deleteClasses"),"function"==typeof a||"[object Object]"===Object.prototype.toString.call(a)&&!f(a)?t:{default:()=>[t]}))]):null])];var a}})};return()=>r(i,null,[x()])}});const Hr=e=>{const t=new Path2D;if(e.length){t.moveTo(e[0][0],e[0][1]);for(let a=1;a<e.length;a++){const[l,n]=e[a];t.lineTo(l,n)}}return t},Vr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=Hr(a);return n.closePath(),l.isPointInPath(n,e,t)},Rr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i],[c,u]]=a;return s>=r&&s<=c&&o>=i&&o<=u},Ir=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i],[c,u]]=a,d=Math.sqrt(Math.pow(c-r,2)+Math.pow(u-i,2));return Br(s,o,r,i,d)},Nr=(e,t,a,l)=>{if(!(e&&t&&a&&l))return!1;if(0===a.length)return!1;const n=l.getTransform().inverse(),{x:s,y:o}=new DOMPoint(e,t).matrixTransform(n),[[r,i]]=a;return Br(s,o,r,i,5)},Br=(e,t,a,l,n)=>Math.sqrt(Math.pow(e-a,2)+Math.pow(t-l,2))<n,Fr=e=>Array.from(new Set(e.map(e=>JSON.stringify(e)))).map(e=>JSON.parse(e)),Yr=e=>{const t=e.getTransform(),{a:a,b:l,e:n,f:s}=t;return{scale:Math.hypot(a,l),translateX:n,translateY:s}},Wr=(e,t,a,l=!0)=>e?.length?e.map(e=>((e,t,a,l=!0)=>{const[n,s]=e;return l?[n*t,s*a]:[n/t,s/a]})(e,t,a,l)):[],Ur=(e,t)=>{const{scale:a,x:l,y:n}=t,[s,o]=e;return[(s-l)/a,(o-n)/a]},$r=(e,t)=>{const{scale:a,x:l,y:n}=t,[s,o]=e;return[s*a+l,o*a+n]},{hexToRgba:Kr}=ql();class Xr{canvas;ctx;vertexes;isDrawing;mouseOffset;vertexesObservers=[];destroyedObservers=[];constructor(e,t){this.canvas=e,this.ctx=t,this.isDrawing=!1,this.vertexes=[],this.mouseOffset={x:0,y:0},this.vertexes=new Proxy(this.vertexes,{set:(e,t,a)=>(e[t]=a,this.notifyVertexChangeListeners(),!0)}),this.mouseOffset=new Proxy(this.mouseOffset,{set:(e,t,a)=>(e[t]=a,this.notifyVertexChangeListeners(),!0)}),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseDblclick=this.canvasMouseDblclick.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this)}notifyVertexChangeListeners(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}vertexesChangeEventListener(e){this.vertexesObservers.push(e)}notifyAddCompletedListener(){this.destroyedObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}addCompleted(e){this.destroyedObservers.push(e)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}triggerCreatePolygon(){this.isDrawing=!0,this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("dblclick",this.canvasMouseDblclick)}canvasMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a;let l=!0;for(let e=0;e<this.vertexes.length;e++){const n=this.vertexes[e];if(Math.sqrt((t-n[0])**2+(a-n[1])**2)<8){l=!1;break}}l&&this.vertexes.push([t,a]),this.vertexes=Fr(this.vertexes)}canvasMousemove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&this.isDrawing){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.canvas.style.cursor="crosshair"}}canvasMouseDblclick(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes.push([t,a]),this.vertexes=Fr(this.vertexes)}this.notifyAddCompletedListener(),this.isDrawing=!1}}drawPolygon(e){const t=this.ctx;if(!e.length)return;const{scale:a}=Yr(this.ctx);t.save();const{x:l,y:n}=this.mouseOffset,s=Hr([...e,[l,n]]);s.closePath();const o=Ar;t.beginPath(),t.lineWidth=2/a,t.setLineDash([5,5]),t.strokeStyle=o,t.fillStyle=Kr(o,.2),t.stroke(s),t.fill(s),t.fillStyle=o;for(let l=0;l<e.length;l++){const[n,s]=e[l];t.beginPath(),t.arc(n,s,5/a,0,2*Math.PI),t.fill()}t.restore()}reset(){this.isDrawing=!0,this.vertexes.length=0,this.mouseOffset.x=0,this.mouseOffset.y=0}destroy(){this.isDrawing=!1,this.vertexes.length=0,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.style.cursor="unset",this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("dblclick",this.canvasMouseDblclick)}}const{hexToRgba:qr}=ql();class Gr{canvas;ctx;imageScaleX=1;imageScaleY=1;vertexes;mouseMoveOffset;isEditing;isMoveEditing;canClickEvent;pointVertexIndex;pointCentreIndex;vertexRadius;edgeCentreRadius;pointRecover;observers=[];editPolygonObserver;contextmenuObserver;constructor(e,t,a,l){this.canvas=e,this.ctx=t,this.imageScaleX=a,this.imageScaleY=l,this.vertexes=[],this.isEditing=!1,this.canClickEvent=!0,this.isMoveEditing=!1,this.pointVertexIndex=-1,this.pointCentreIndex=-1,this.vertexRadius=8,this.edgeCentreRadius=5,this.pointRecover=[],this.canvasMousedown=this.canvasMousedown.bind(this),this.canvasMouseup=this.canvasMouseup.bind(this),this.canvasMousemove=this.canvasMousemove.bind(this),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}notifyEditPolygonObserver(){this.editPolygonObserver?.(this.vertexes)}onEditPolygon(e){this.editPolygonObserver=e}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawPolygonPath(e,t,a){const l=this.ctx;if(!e.length)return;const{scale:n}=Yr(this.ctx),s=Ar;l.save(),l.beginPath(),l.lineWidth=2/n,l.strokeStyle=s,l.fillStyle=qr(s,.2),l.moveTo(e[0][0],e[0][1]);for(let t=1;t<e.length;t++){const[a,n]=e[t];l.lineTo(a,n)}isNaN(t)||isNaN(a)||l.lineTo(t,a),l.closePath(),l.stroke(),l.fill(),l.restore()}drawPolygonEdgeCentre(e){const t=this.ctx,{scale:a}=Yr(this.ctx),l=this.vertexRadius/a,n=this.edgeCentreRadius/a,s=Math.max(1,l-n),o=Ar;t.save();for(let a=0;a<e.length;a++){const[n,r]=e[a];t.beginPath(),t.fillStyle=o,t.arc(n,r,l,0,2*Math.PI),t.closePath(),t.fill(),t.beginPath(),t.fillStyle="#FFFFFF",t.arc(n,r,s,0,2*Math.PI),t.closePath(),t.fill()}for(let a=0;a<e.length;a++){const l=e[a%e.length],s=e[(a+1)%e.length],r=l[0]+(s[0]-l[0])/2,i=l[1]+(s[1]-l[1])/2;t.beginPath(),t.fillStyle=o,t.arc(r,i,n,0,2*Math.PI),t.closePath(),t.fill()}t.restore()}render(){this.drawPolygonPath(this.vertexes),this.drawPolygonEdgeCentre(this.vertexes)}drawPolygon(e,t){this.vertexes=e,t?this.drawPolygonPath(e,t.x,t.y):(this.drawPolygonPath(e),this.drawPolygonEdgeCentre(e))}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}pointInVertexes(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.vertexRadius/n,o=this.vertexes;let r=null;for(let e=0;e<o.length;e++){const[t,n]=o[e];if(Br(a,l,t,n,s)){r=e;break}}return this.updateCanvasCursor(null!==r),r}pointInEdgeCentre(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.edgeCentreRadius/n,o=this.vertexes;let r=null;for(let e=0;e<o.length;e++){const t=o[e%o.length],n=o[(e+1)%o.length],i=t[0]+(n[0]-t[0])/2,c=t[1]+(n[1]-t[1])/2;if(Br(a,l,i,c,s)){r=e;break}}return this.updateCanvasCursor(null!==r),r}pointInVertexesOrEdgeCentre(e,t){const[a,l]=this.getTransformPoint(e,t),{scale:n}=Yr(this.ctx),s=this.vertexRadius/n,o=this.edgeCentreRadius/n,r=this.vertexes;let i=null;for(let e=0;e<r.length;e++){const[t,n]=r[e],c=Br(a,l,t,n,s),u=r[e%r.length],d=r[(e+1)%r.length],h=u[0]+(d[0]-u[0])/2,p=u[1]+(d[1]-u[1])/2,v=Br(a,l,h,p,o);if(c||v){i=e;break}}return this.updateCanvasCursor(null!==i),i}notifyObservers(){this.observers.forEach(e=>{e(this.vertexes)})}updatePolygon(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMousedown),this.canvas.addEventListener("mouseup",this.canvasMouseup),this.canvas.addEventListener("mousemove",this.canvasMousemove),this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.observers.push(e))}canvasMousedown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.canClickEvent=!0;const{offsetX:t,offsetY:a}=e;this.pointRecover=[t,a];const l=this.pointInVertexes(t,a);ps(l)&&(this.isMoveEditing=!0,this.pointVertexIndex=l,this.vertexes.splice(this.pointVertexIndex,1,[t,a]));const n=this.pointInEdgeCentre(t,a);ps(n)&&(this.isMoveEditing=!0,this.pointCentreIndex=n+1,this.vertexes.splice(this.pointCentreIndex,0,[t,a])),setTimeout(()=>{this.canClickEvent=!1},200),Vr(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset=[t,a])}canvasMousemove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexesOrEdgeCentre(t,a),[n,s]=this.getTransformPoint(t,a);if(this.isMoveEditing)return this.pointVertexIndex>-1&&this.vertexes.splice(this.pointVertexIndex,1,[n,s]),this.pointCentreIndex>-1&&this.vertexes.splice(this.pointCentreIndex,1,[n,s]),void this.notifyObservers();if(!ps(l)&&(Vr(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset[0],this.mouseMoveOffset[1]),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.notifyObservers(),this.mouseMoveOffset=[t,a]}}canvasMouseup(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;let{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);this.vertexes=Fr(this.vertexes);for(let e=0;e<this.vertexes.length;e++){const t=this.vertexes[e],a=Math.sqrt((l-t[0])**2+(n-t[1])**2);if(a<8&&a>0&&this.pointRecover.length){l=this.pointRecover[0],n=this.pointRecover[1],this.pointRecover=[];break}}this.pointVertexIndex>-1&&this.vertexes.splice(this.pointVertexIndex,1,[l,n]),this.pointCentreIndex>-1&&this.vertexes.splice(this.pointCentreIndex,1,[l,n]),this.isMoveEditing=!1,this.mouseMoveOffset=null,this.pointVertexIndex=-1,this.pointCentreIndex=-1,this.notifyEditPolygonObserver()}canvasMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;if(this.canClickEvent){const e=this.pointInVertexes(t,a);if(ps(e)){if(this.vertexes.length<=3)return;this.vertexes.splice(e,1),this.drawPolygon(this.vertexes),this.notifyObservers(),this.notifyEditPolygonObserver()}}}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Vr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}destroy(){this.vertexes=[],this.observers=[],this.isEditing=!1,this.canClickEvent=!1,this.canvas.removeEventListener("mousedown",this.canvasMousedown),this.canvas.removeEventListener("mouseup",this.canvasMouseup),this.canvas.removeEventListener("mousemove",this.canvasMousemove),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:Zr}=ql();class Jr{canvas;ctx;vertexes;isDrawing;mouseOffset;vertexesObservers=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.isDrawing=!1,this.vertexes=[],this.mouseOffset={x:0,y:0},this.vertexes=new Proxy(this.vertexes,{set:(e,t,a)=>(e[t]=a,this.notifyVertexesChange(),!0)}),this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this)}subscribeVertexesChange(e){this.vertexesObservers.push(e)}notifyVertexesChange(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp)}reset(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0}stop(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp)}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]]}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&(this.canvas.style.cursor="crosshair",this.isDrawing)){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.notifyVertexesChange()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.vertexes.push([t,a]),2===Fr(this.vertexes).length&&this.notifyDrawComplete()}this.isDrawing=!1}}drawRectangle(e){if(e.length<1)return;const t=this.ctx,{scale:a}=Yr(t),{x:l,y:n}=this.mouseOffset,s=e[0][0],o=e[0][1],r=e[1]?.[0]??l,i=e[1]?.[1]??n,c=Ar;t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=c,t.fillStyle=Zr(c,.2),t.strokeRect(s,o,r-s,i-o),t.fillRect(s,o,r-s,i-o),t.restore()}destroy(){this.stop()}}const{hexToRgba:Qr}=ql();class ei{canvas;ctx;shape;anchorRadius=4;anchorVertexIndex=null;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this),this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}offEditing(e){this.editingObservers=this.editingObservers.filter(t=>t!==e)}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawRectangle(e){if(!e?.length)return;this.vertexes=e;const[t,a]=e[0],[l,n]=e[1],s=this.ctx,{scale:o}=Yr(s),r=Ar;s.save(),s.beginPath(),s.lineWidth=2/o,s.strokeStyle=r,s.fillStyle=Qr(r,.2),s.strokeRect(t,a,l-t,n-a),s.fillRect(t,a,l-t,n-a),s.restore()}drawVertexAnchors(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=Ar,n=this.anchorRadius/a;t.save(),t.lineWidth=2/a,t.strokeStyle=l,t.fillStyle="#ffffff";for(const a of e){const[e,l]=a;t.beginPath(),t.rect(e-n,l-n,2*n,2*n),t.fill(),t.stroke(),t.closePath()}t.restore()}pointInVertexAnchors(e,t){const a=this.vertexes;if(!a?.length)return null;const l=this.ctx,{scale:n}=Yr(l),s=this.anchorRadius/n;let o=null;for(let n=0;n<a.length;n++){const[r,i]=a[n];if(Rr(e,t,[[r-s,i-s],[r+s,i+s]],l)){o=n;break}}return this.updateCanvasCursor(null!==o),o}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);ps(l)&&(this.isMoveEditing=!0,this.vertexes[l]=[t,a],this.anchorVertexIndex=l),Rr(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset={x:t,y:a})}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);if(this.isMoveEditing){const[e,l]=this.getTransformPoint(t,a),n=fl(this.vertexes);n[this.anchorVertexIndex]=[e,l];const s=Math.abs(n[0][0]-n[1][0]),o=Math.abs(n[0][1]-n[1][1]);return s>20&&o>20&&(this.vertexes[this.anchorVertexIndex]=[e,l]),void this.notifyEditing()}if(!ps(l)&&(Rr(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(ps(this.anchorVertexIndex)){const e=fl(this.vertexes);e[this.anchorVertexIndex]=[l,n];const t=Math.abs(e[0][0]-e[1][0]),a=Math.abs(e[0][1]-e[1][1]);t>20&&a>20&&(this.vertexes[this.anchorVertexIndex]=[l,n])}this.isMoveEditing=!1,this.anchorVertexIndex=null,this.mouseMoveOffset=null,this.notifyEditCompleted()}canvasMouseClick(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Rr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}render(){this.drawRectangle(this.vertexes),this.drawVertexAnchors(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.editingObservers=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:ti}=ql();class ai{canvas;ctx;isDrawing=!1;mouseOffset;vertexes=[];vertexesObservers=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.mouseOffset={x:0,y:0},this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this)}subscribeVertexesChange(e){this.vertexesObservers.push(e)}notifyVertexesChange(){this.vertexesObservers.forEach(e=>{e(this.vertexes,this.mouseOffset)})}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp)}reset(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0}stop(){this.vertexes=[],this.isDrawing=!1,this.mouseOffset.x=0,this.mouseOffset.y=0,this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp)}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;this.isDrawing=!0;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]]}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey&&(this.canvas.style.cursor="crosshair",this.isDrawing)){const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.notifyVertexesChange()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),!e.ctrlKey){if(this.isDrawing){this.canvas.style.cursor="unset";const[t,a]=this.transformMousePoint(e);this.vertexes.push([t,a]),2===Fr(this.vertexes).length&&this.notifyDrawComplete()}this.isDrawing=!1}}drawCircle(e){if(e.length<1)return;const t=this.ctx,{scale:a}=Yr(t),{x:l,y:n}=this.mouseOffset,s=e[0][0],o=e[0][1],r=e[1]?.[0]??l,i=e[1]?.[1]??n,c=Ar;t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=c,t.fillStyle=ti(c,.2),t.arc(s,o,Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2)),0,2*Math.PI),t.stroke(),t.fill()}destroy(){this.stop()}}const{hexToRgba:li}=ql();class ni{canvas;ctx;shape;anchorRadius=4;anchorVertexIndex=null;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvasMouseDown=this.canvasMouseDown.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this),this.canvasMouseUp=this.canvasMouseUp.bind(this),this.canvasMouseContextmenu=this.canvasMouseContextmenu.bind(this)}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}offEditing(e){this.editingObservers=this.editingObservers.filter(t=>t!==e)}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}drawCircle(e){if(!e?.length)return;this.vertexes=e;const[[t,a],[l,n]]=e,s=Math.sqrt(Math.pow(l-t,2)+Math.pow(n-a,2)),o=this.ctx,r=Ar;o.save(),o.beginPath(),o.strokeStyle=r,o.fillStyle=li(r,.2),o.arc(t,a,s,0,2*Math.PI),o.stroke(),o.fill(),o.restore()}drawVertexAnchors(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=Ar,n=this.anchorRadius/a;t.save(),t.lineWidth=2/a,t.strokeStyle=l,t.fillStyle="#ffffff";for(const a of e){const[e,l]=a;t.beginPath(),t.rect(e-n,l-n,2*n,2*n),t.fill(),t.stroke(),t.closePath()}t.restore()}pointInVertexAnchors(e,t){const a=this.vertexes;if(!a?.length)return null;const l=this.ctx,{scale:n}=Yr(l),s=this.anchorRadius/n;let o=null;for(let n=0;n<a.length;n++){const[r,i]=a[n];if(Rr(e,t,[[r-s,i-s],[r+s,i+s]],l)){o=n;break}}return this.updateCanvasCursor(null!==o),o}updateCanvasCursor(e){e?this.canvas.style.cursor="pointer":"pointer"!==this.canvas.style.cursor&&(this.canvas.style.cursor="unset")}canvasMouseDown(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);ps(l)&&(this.isMoveEditing=!0,this.vertexes[l]=[t,a],this.anchorVertexIndex=l),Ir(t,a,this.vertexes,this.ctx)&&(this.mouseMoveOffset={x:t,y:a})}canvasMouseMove(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,l=this.pointInVertexAnchors(t,a);if(this.isMoveEditing){const[e,l]=this.getTransformPoint(t,a),n=fl(this.vertexes);n[this.anchorVertexIndex]=[e,l];const[[s,o],[r,i]]=n;return Math.sqrt(Math.pow(r-s,2)+Math.pow(i-o,2))>20&&(this.vertexes[this.anchorVertexIndex]=[e,l]),void this.notifyEditing()}if(!ps(l)&&(Ir(t,a,this.vertexes,this.ctx)&&(this.canvas.style.cursor="move"),this.mouseMoveOffset)){const[e,l]=this.getTransformPoint(t,a),[n,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=e-n,r=l-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}}canvasMouseUp(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(ps(this.anchorVertexIndex)){const e=fl(this.vertexes);e[this.anchorVertexIndex]=[l,n];const[[t,a],[s,o]]=e;Math.sqrt(Math.pow(s-t,2)+Math.pow(o-a,2))>20&&(this.vertexes[this.anchorVertexIndex]=[l,n])}this.isMoveEditing=!1,this.anchorVertexIndex=null,this.mouseMoveOffset=null,this.notifyEditCompleted()}canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Ir(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}render(){this.drawCircle(this.vertexes),this.drawVertexAnchors(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.editingObservers=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:si}=ql();class oi{canvas;ctx;mouseOffset;vertexes=[];drawCompleteCallback;constructor(e,t){this.canvas=e,this.ctx=t,this.mouseOffset={x:0,y:0},this.canvasMouseClick=this.canvasMouseClick.bind(this),this.canvasMouseMove=this.canvasMouseMove.bind(this)}subscribeDrawComplete(e){this.drawCompleteCallback=e}notifyDrawComplete(){this.drawCompleteCallback?.(this.vertexes,this.mouseOffset)}transformMousePoint(e){const{scale:t,translateX:a,translateY:l}=Yr(this.ctx);return Ur([e.offsetX,e.offsetY],{scale:t,x:a,y:l})}start(){this.canvas.addEventListener("click",this.canvasMouseClick),this.canvas.addEventListener("mousemove",this.canvasMouseMove)}stop(){this.reset(),this.canvas.removeEventListener("click",this.canvasMouseClick),this.canvas.removeEventListener("mousemove",this.canvasMouseMove)}reset(){this.vertexes=[],this.mouseOffset.x=0,this.mouseOffset.y=0}canvasMouseClick=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const[t,a]=this.transformMousePoint(e);this.mouseOffset.x=t,this.mouseOffset.y=a,this.vertexes=[[t,a]],this.render(),this.notifyDrawComplete()};canvasMouseMove=e=>{e.stopPropagation(),e.preventDefault(),e.ctrlKey||(this.canvas.style.cursor="crosshair")};draw(e){if(!e?.length)return;const t=this.ctx,{scale:a}=Yr(t),l=5/a;t.save(),t.fillStyle=si(Ar,1),t.beginPath(),t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.fill(),t.restore()}render(){this.draw(this.vertexes)}destroy(){this.stop()}}class ri{canvas;ctx;shape;radius=5;isMoveEditing=!1;mouseMoveOffset;isEditing=!1;vertexes;editingObservers=[];editedObserver;contextmenuObserver;constructor(e,t){this.canvas=e,this.ctx=t,this.canvas.addEventListener("mousedown",this.canvasMouseDown.bind(this)),this.canvas.addEventListener("mousemove",this.canvasMouseMove.bind(this)),this.canvas.addEventListener("mouseup",this.canvasMouseUp.bind(this)),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu.bind(this))}onEditing(e){this.isEditing||(this.isEditing=!0,this.canvas.addEventListener("mousedown",this.canvasMouseDown),this.canvas.addEventListener("mousemove",this.canvasMouseMove),this.canvas.addEventListener("mouseup",this.canvasMouseUp),this.canvas.addEventListener("contextmenu",this.canvasMouseContextmenu),this.editingObservers.push(e))}notifyEditing(){this.editingObservers.forEach(e=>e(this.vertexes))}onEditCompleted(e){this.editedObserver=e}notifyEditCompleted(){this.editedObserver?.(this.vertexes)}onContextmenu(e){this.contextmenuObserver=e}notifyContextmenuObserver(e){this.contextmenuObserver?.(e)}getTransformPoint(e,t){const{scale:a,translateX:l,translateY:n}=Yr(this.ctx);return Ur([e,t],{scale:a,x:l,y:n})}canvasMouseDown=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);Nr(l,n,this.vertexes,this.ctx)&&(this.isMoveEditing=!0,this.mouseMoveOffset={x:t,y:a})};canvasMouseMove=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;if(!this.isMoveEditing)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);if(this.mouseMoveOffset){const[e,s]=this.getTransformPoint(this.mouseMoveOffset.x,this.mouseMoveOffset.y),o=l-e,r=n-s;this.vertexes=this.vertexes.map(e=>[e[0]+o,e[1]+r]),this.mouseMoveOffset={x:t,y:a},this.notifyEditing()}};canvasMouseUp=e=>{if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;if(!this.isMoveEditing)return;const{offsetX:t,offsetY:a}=e,[l,n]=this.getTransformPoint(t,a);this.vertexes=[[l,n]],this.isEditing=!1,this.isMoveEditing=!1,this.mouseMoveOffset=null,this.notifyEditCompleted()};canvasMouseContextmenu(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const{offsetX:t,offsetY:a}=e;Nr(t,a,this.vertexes,this.ctx)&&this.notifyContextmenuObserver(e)}draw(e){if(!e?.length)return;this.vertexes=e;const t=this.ctx,{scale:a}=Yr(t),l=this.radius/a;t.save(),t.fillStyle=Ar,t.beginPath(),t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.fill(),t.restore(),t.save(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle="#ffffff",t.arc(e[0][0],e[0][1],l,0,2*Math.PI),t.stroke(),t.restore()}render(){this.draw(this.vertexes)}destroy(){this.isEditing=!1,this.vertexes=[],this.canvas.removeEventListener("mousedown",this.canvasMouseDown),this.canvas.removeEventListener("mousemove",this.canvasMouseMove),this.canvas.removeEventListener("mouseup",this.canvasMouseUp),this.canvas.removeEventListener("contextmenu",this.canvasMouseContextmenu)}}const{hexToRgba:ii}=ql();class ci{canvas;ctx;image;canvasWidth;canvasHeight;imageScaleX;imageScaleY;labels;createPolygon;editDrawPolygon;createRectangle;editDrawRectangle;createCircle;editDrawCircle;createKeypoint;editDrawKeypoint;addVertexes=[];createCompleteSubscribers=new Set;editingShape;editVertexes=[];editingSubscribers=new Set;activeShapeObserver;contextmenuShapeObserver;constructor(e){const{canvas:t,ctx:a,image:l,canvasWidth:n,canvasHeight:s,imageScaleX:o,imageScaleY:r,labels:i}=e;this.canvas=t,this.ctx=a,this.image=l,this.canvasWidth=n,this.canvasHeight=s,this.imageScaleX=o,this.imageScaleY=r,this.labels=i||{},this.createPolygon=new Xr(t,a),this.editDrawPolygon=new Gr(t,a,o,r),this.createRectangle=new Jr(t,a),this.editDrawRectangle=new ei(t,a),this.createCircle=new ai(t,a),this.editDrawCircle=new ni(t,a),this.createKeypoint=new oi(t,a),this.editDrawKeypoint=new ri(t,a),this.createPolygon.vertexesChangeEventListener(e=>{this.render(),this.createPolygon.drawPolygon(e),this.addVertexes=e}),this.createPolygon.addCompleted((e,t)=>{this.addVertexes=e;const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.notifyCreateComplete({x:s,y:o},Tr.Polygon)}),this.createRectangle.subscribeVertexesChange(e=>{this.render(),this.createRectangle.drawRectangle(e)}),this.createRectangle.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Rectangle)}),this.createCircle.subscribeVertexesChange(e=>{this.render(),this.createCircle.drawCircle(e)}),this.createCircle.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Circle)}),this.createKeypoint.subscribeDrawComplete((e,t)=>{const{scale:a,translateX:l,translateY:n}=Yr(this.ctx),[s,o]=$r([t.x,t.y],{scale:a,x:l,y:n});this.addVertexes=e,this.notifyCreateComplete({x:s,y:o},Tr.Keypoint)}),this.render(),this.onMouseDown=this.onMouseDown.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.onMouseUp=this.onMouseUp.bind(this),this.onMouseClick=this.onMouseClick.bind(this),this.onMouseDoubleClick=this.onMouseDoubleClick.bind(this)}subscribeCreateComplete(e){this.createCompleteSubscribers.add(e)}unsubscribeCreateComplete(e){this.createCompleteSubscribers.delete(e)}notifyCreateComplete(e,t){this.createCompleteSubscribers.forEach(a=>{a(this.addVertexes,e,t??Tr.Polygon)})}onStartCreatePolygon(){this.createPolygon.triggerCreatePolygon()}subscribeEditing(e){this.editingSubscribers.add(e)}unsubscribeEditing(e){this.editingSubscribers.delete(e)}notifyEditing(){this.editingSubscribers.forEach(e=>{e(this.editVertexes,this.editingShape)})}subscribeActiveShape(e){this.activeShapeObserver=e}unsubscribeActiveShape(){this.activeShapeObserver=null}notifyActiveShape(e){this.activeShapeObserver?.(e)}subscribeContextmenuShape(e){this.contextmenuShapeObserver=e}notifyContextmenuShape(e,t){this.contextmenuShapeObserver?.(e,t)}onStartCreateRectangle(){this.createRectangle.start()}onStartCreateCircle(){this.createCircle.start()}onStartCreateKeypoint(){this.createKeypoint.start()}resetAllInstance(){this.onCreateEnd(),this.onEditorEnd(),this.render()}closeCreateOrEditor(){this.createPolygon.reset(),this.createRectangle.reset(),this.createCircle.reset(),this.createKeypoint.reset()}drawShapes(e){const t=this.ctx,{scale:a}=Yr(t),l=12/a,n=6/a;t.font=`bold ${l}px serif`,t.textBaseline="top";for(let l=0;l<e.length;l++){const s=e[l];if(s.id===this.editingShape?.id){this.editingShape=s;continue}const o=Wr(s.points,this.imageScaleX,this.imageScaleY);if(!o.length)continue;const r=_r[l%_r.length];if(s.shape_type===Tr.Polygon){const e=Hr(o);e.closePath(),t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.stroke(e),t.fill(e),t.fillStyle=r,t.fillText(s.label,o[0][0]+n,o[0][1]+n)}else if(s.shape_type===Tr.Rectangle){const[[e,l],[i,c]]=o;t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.strokeRect(e,l,i-e,c-l),t.fillRect(e,l,i-e,c-l),t.fillStyle=r,t.fillText(s.label,o[0][0]+n,o[0][1]+n)}else if(s.shape_type===Tr.Circle){const[[e,l],[n,i]]=o;t.beginPath(),t.lineWidth=2/a,t.strokeStyle=r,t.fillStyle=ii(r,.2),t.arc(e,l,Math.sqrt(Math.pow(n-e,2)+Math.pow(i-l,2)),0,2*Math.PI),t.stroke(),t.fill(),t.fillStyle=r,t.textBaseline="middle",t.textAlign="center",t.fillText(s.label,o[0][0],o[0][1])}else if(s.shape_type===Tr.Keypoint){const[[e,l]]=o,i=5/a;t.beginPath(),t.arc(e,l,i,0,2*Math.PI),t.fillStyle=r,t.fill(),t.fillStyle=r,t.textBaseline="middle",t.textAlign="center",t.fillText(s.label,e,l+n+i)}}}updateTransform(e){const t=this.ctx,{scale:a,x:l,y:n}=e;t.translate(l,n),t.scale(a,a)}updateLabelInfo(e){this.labels=e,this.onResetHitShape()}render=()=>{const e=this.ctx;e.save(),e.setTransform(1,0,0,1,0,0),e.clearRect(0,0,this.canvasWidth,this.canvasHeight),e.restore(),e.drawImage(this.image,0,0,this.canvasWidth,this.canvasHeight),e.save();const t=this.labels.shapes;t?.length&&this.drawShapes(t),this.editDrawPolygon.render(),this.editDrawRectangle.render(),this.editDrawCircle.render(),this.editDrawKeypoint.render(),e.restore()};mouseHitShape(e){const{offsetX:t,offsetY:a}=e,l=this.labels.shapes;let n=!1,s=null;for(let e=0;e<l.length;e++){const o=l[e],r=Wr(o.points,this.imageScaleX,this.imageScaleY);if(r.length)if(o.shape_type===Tr.Polygon){if(Vr(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Rectangle){if(Rr(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Circle){if(Ir(t,a,r,this.ctx)){n=!0,s=o;break}}else if(o.shape_type===Tr.Keypoint&&Nr(t,a,r,this.ctx)){n=!0,s=o;break}}return this.canvas.style.cursor=n?"pointer":"default",s}triggerShapeEdit(e){this.editingShape=e,this.notifyActiveShape(e);const t=Wr(e.points,this.imageScaleX,this.imageScaleY);e.shape_type===Tr.Polygon?(this.editDrawPolygon.drawPolygon(t),this.editDrawPolygon.updatePolygon(e=>{this.editVertexes=e,this.render()}),this.editDrawPolygon.onEditPolygon(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawPolygon.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Rectangle?(this.editDrawRectangle.drawRectangle(t),this.editDrawRectangle.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawRectangle.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawRectangle.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Circle?(this.editDrawCircle.drawCircle(t),this.editDrawCircle.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawCircle.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()}),this.editDrawCircle.onContextmenu(t=>{this.notifyContextmenuShape(t,e)})):e.shape_type===Tr.Keypoint&&(this.editDrawKeypoint.draw(t),this.editDrawKeypoint.onEditing(e=>{this.editVertexes=e,this.render()}),this.editDrawKeypoint.onEditCompleted(e=>{this.render(),this.editVertexes=e,this.notifyEditing()})),this.render()}onSelectShape(e){this.editingShape?.id&&this.editingShape.id===e?.id||(this.onResetHitShape(),e&&this.triggerShapeEdit(e))}onResetHitShape(){this.editingShape=null,this.editVertexes=[],this.editDrawPolygon.destroy(),this.editDrawRectangle.destroy(),this.editDrawCircle.destroy(),this.editDrawKeypoint.destroy(),this.render()}onMouseDoubleClick(e){e.stopPropagation(),e.preventDefault(),this.mouseHitShape(e)||this.onResetHitShape()}onMouseClick(e){if(e.stopPropagation(),e.preventDefault(),e.ctrlKey)return;const t=this.mouseHitShape(e);this.editVertexes.length&&!t||this.onSelectShape(t)}onMouseDown(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape}onMouseMove(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape||this.mouseHitShape(e)}onMouseUp(e){e.stopPropagation(),e.preventDefault(),e.ctrlKey||this.editingShape}onEditorStart(){this.canvas.addEventListener("mousedown",this.onMouseDown),this.canvas.addEventListener("mousemove",this.onMouseMove),this.canvas.addEventListener("mouseup",this.onMouseUp),this.canvas.addEventListener("click",this.onMouseClick),this.canvas.addEventListener("dblclick",this.onMouseDoubleClick)}onEditorEnd(){this.editVertexes=[],this.editingShape=null,this.editDrawPolygon.destroy(),this.editDrawRectangle.destroy(),this.editDrawCircle.destroy(),this.canvas.removeEventListener("mousedown",this.onMouseDown),this.canvas.removeEventListener("mousemove",this.onMouseMove),this.canvas.removeEventListener("mouseup",this.onMouseUp),this.canvas.removeEventListener("click",this.onMouseClick),this.canvas.removeEventListener("dblclick",this.onMouseDoubleClick)}onCreateEnd(){this.createCircle.destroy(),this.createRectangle.destroy(),this.createPolygon.destroy(),this.createKeypoint.destroy()}destroy(){this.labels={},this.onCreateEnd(),this.onEditorEnd()}}var ui=o({props:{contextClientHeight:{type:Number,default:null},labelInfo:{type:Object,default:()=>({})}},emits:["editPolygon","changePolygon","updateLabelInfo","selectShape"],setup(e,{emit:n,expose:s}){const o=t("ns",{}),c=t("classes",a([])),u=t("toolsActive",{}),d=t("changeToolsActive"),p=t("scaleTranslateManager",{}),v=a(),f=a(),m=a(),g=a(),x=a(),w=a(e.labelInfo),C=a(!1),E=e=>{const t=m.value?.getContext("2d");if(e?.imageSrc){const a=new Image;a.src=e.imageSrc,C.value=!0,a.onload=()=>{C.value=!1;const{canvasWidth:l,canvasHeight:s,scaleX:o,scaleY:r,originWidth:i,originHeight:c}=(e=>{const t=v.value?.elementInstance.clientWidth,a=v.value?.elementInstance.clientHeight;let{width:l,height:n}=e,s=1;const o=l/n;if(o>1?(l=t,n=t/o):(l=a*o,n=a),n>a){const e=n/a;n=a,l/=e}else if(l>t){const e=l/t;l=t,n/=e}const r=parseInt(l.toString()),i=parseInt(n.toString());s=Number((r/i).toFixed(2));const c=(r/e.width).toFixed(8),u=(i/e.height).toFixed(8);return{canvasWidth:r,canvasHeight:i,scaleFactor:s,scaleX:Number(c),scaleY:Number(u),originWidth:e.width,originHeight:e.height}})(a);a.style.width=l+"px",a.style.height=s+"px",((e,t)=>{f.value.style.width=e+"px",f.value.style.height=t+"px",m.value.width=e,m.value.height=t,m.value.style.width=e+"px",m.value.style.height=t+"px"})(l,s),g.value=new ci({canvas:m.value,ctx:t,image:a,canvasWidth:l,canvasHeight:s,labels:e.labels,imageScaleX:o,imageScaleY:r}),x.value=new br(m.value),x.value.changeZoom(e=>{p.onChangeScaleTranslate(e),g.value.updateTransform(e),g.value.render()}),g.value.subscribeCreateComplete((e,t,a)=>{const l=Wr(e,o,r,!1),n={id:ms(),shape_type:a,points:l};L(t.x,t.y,n)}),g.value.subscribeContextmenuShape((e,t)=>{const{offsetX:a,offsetY:l}=e;L(a,l,t)}),g.value.subscribeEditing((e,t)=>{const a=Wr(e,o,r,!1),l=w.value.labels.shapes?.findIndex(e=>e.id===t.id);-1!==l&&(w.value.labels.shapes[l]={...t,points:a}),w.value.labels.imageWidth=i,w.value.labels.imageHeight=c,n("editPolygon",w.value)}),g.value.subscribeActiveShape(e=>{O(),n("selectShape",e)}),b(()=>u.value,()=>{g.value.resetAllInstance(),O(),u.value===Pr.CREATE_POLYGON?g.value.onStartCreatePolygon():u.value===Pr.EDIT_SHAPE?g.value.onEditorStart():u.value===Pr.CREATE_RECTANGLE?g.value.onStartCreateRectangle():u.value===Pr.CREATE_CIRCLE?g.value.onStartCreateCircle():u.value===Pr.CREATE_KEYPOINT&&g.value.onStartCreateKeypoint()},{immediate:!0})},a.onerror=()=>{C.value=!1}}};M(()=>{E(w.value),b(()=>e.contextClientHeight,e=>{vs(e)&&(f.value.style.height=e+"px",y(()=>{D()}))})}),h(()=>{g.value.destroy(),x.value.destroy()});const D=()=>{O(),y(()=>{g.value.resetAllInstance(),E(w.value)})},k=a({show:!1,top:0,left:0,activateShape:null}),O=()=>{k.value.show=!1,k.value.top=0,k.value.left=0,k.value.activateShape=null,g.value.closeCreateOrEditor()},L=(e,t,a)=>{const l=m.value.getBoundingClientRect();k.value.show=!0,k.value.left=e+l.x,k.value.top=t+l.y,k.value.canvasWidth=m.value.width,k.value.canvasHeight=m.value.height,k.value.activateShape=a},T=l(()=>{const{top:e,left:t,canvasWidth:a,canvasHeight:l}=k.value;return{top:e,left:t,canvasWidth:a,canvasHeight:l}}),P=(e,t)=>{const a=w.value.labels.shapes?.findIndex(e=>e.id===t.id);-1===a?w.value.labels.shapes.push(S(t)):w.value.labels.shapes[a]=S(t),n("updateLabelInfo",w.value),O(),g.value.updateLabelInfo(w.value.labels)},A=e=>{const t=w.value.labels.shapes?.findIndex(t=>t.id===e.id);-1!==t&&w.value.labels.shapes.splice(t,1),n("updateLabelInfo",w.value),O(),g.value.updateLabelInfo(w.value.labels)};return s({updateLabelInfo:e=>{e&&(w.value=e)},rerenderImage:e=>{e&&(w.value=e),(w.value.labels??={shapes:[]}).shapes??=[],y(()=>{d(u.value),D()})},resetScaleOffset:()=>{x.value.reset()},onSelectShape:e=>{u.value===Pr.EDIT_SHAPE&&g.value?.onSelectShape(e)}}),()=>r(i,null,[r(nr,{ref:v,loading:C.value,class:[o.b("loading")],style:{height:"100%"}},{default:()=>[r("div",{ref:f,class:[o.b("canvas")]},[r("canvas",{ref:m,class:[o.be("canvas","context")]},null),k.value.show?r(zr,{fixed:T.value,classes:c.value,activateShape:k.value.activateShape,onClose:O,onSelect:P,onDelete:A},null):null])]})])}}),di=o({props:{isFullscreen:{type:Boolean,default:!1},imageIndex:{type:Number,default:0},imageLength:{type:Number,default:0}},emits:["fullscreen","save"],setup(e,{emit:a}){const l=t("ns",{}),n=t("scaleTranslateManager",{}),s=n.scaleTranslate,{t:o}=Wl(),c=e=>{a("fullscreen",e),document.body.style.overflow=e?"hidden":"auto"};return()=>r(i,null,[r(i,null,[r("ul",{class:[l.be("header","tool")]},[r("li",{class:"tool-item",onClick:()=>a("save")},[r("svg",{t:"1719034799379",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4272",width:"18",height:"18"},[r("path",{d:"M831.4 252.2L711.5 132.4c-10.3-10.3-24.2-16.1-38.8-16.1h-450c-23.3 0-42.2 18.9-42.2 42.2v709.4c0 23.3 18.9 42.2 42.2 42.2h582.6c23.3 0 42.2-18.9 42.2-42.2V291c-0.1-14.5-5.8-28.5-16.1-38.8zM619.6 159v159.8c0 4-3.3 7.3-7.3 7.3H387.2c-4 0-7.3-3.3-7.3-7.3V159h239.7z m67.7 708.4H340.8v-292c0-3.9 3.2-7.1 7.1-7.1h332.4c3.9 0 7.1 3.2 7.1 7.1v292z m117.4 0H730v-292c0-27.5-22.3-49.8-49.8-49.8H347.8c-27.5 0-49.8 22.3-49.8 49.8v292h-74.7V159.1h113.9v159.8c0 27.6 22.4 50.1 50.1 50.1h225.1c27.6 0 50.1-22.4 50.1-50.1V159h10.4c3.2 0 6.3 1.3 8.6 3.6l119.9 119.9c2.3 2.3 3.6 5.3 3.6 8.6l-0.3 576.3z","p-id":"4273"},null),r("path",{d:"M536 196.3h42.7v87.2H536zM368.7 641.2h220.7v42.7H368.7zM368.7 744h170.9v42.7H368.7z","p-id":"4274"},null)]),r("p",{class:"label-text"},[o("next.labelme.saveLabel")])])]),r("ul",{class:[l.be("header","tool")]},[r("li",{class:"tool-item",onClick:()=>n.onResetScaleTranslate()},[r("svg",{t:"1725840994827",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6051",width:"18",height:"18"},[r("path",{d:"M322.794667 445.205333a34.133333 34.133333 0 0 1 2.218666 45.824l-2.218666 2.432a34.133333 34.133333 0 0 1-45.824 2.218667l-2.432-2.218667-149.333334-149.333333a34.133333 34.133333 0 0 1-2.218666-45.824l2.218666-2.432 149.333334-149.333333a34.133333 34.133333 0 0 1 50.474666 45.824l-2.218666 2.432-91.050667 91.050666L640 285.866667c160.234667 0 290.133333 129.898667 290.133333 290.133333 0 158.016-126.314667 286.506667-283.477333 290.048L640 866.133333H234.666667a34.133333 34.133333 0 0 1-3.114667-68.117333L234.666667 797.866667h405.333333c122.538667 0 221.866667-99.328 221.866667-221.866667 0-120.533333-96.106667-218.602667-215.850667-221.781333L640 354.133333l-408.256-0.021333 91.050667 91.093333z","p-id":"6052"},null)]),r("span",{style:"padding-left: 3px"},[o("next.labelimg.zoomRestore")])]),r("li",{style:"color: #999; user-select: none; cursor: default;"},[r("span",null,[E("缩放比例")]),r("span",null,[parseInt((100*s.value.scale).toString()),E("%")]),r("span",{style:"padding: 0 10px;"},[E("偏移量")]),r("span",{style:"min-width: 120px; text-align: left;"},[E("X: "),s.value.x,E(", Y: "),s.value.y])]),e.imageLength?r("li",null,[r("span",null,[E("第 "),e.imageIndex+1,E(" 张")]),r("em",{style:"padding: 0 5px;"},[E("/")]),r("span",null,[E("共 "),e.imageLength,E(" 张")])]):null,r("li",{style:"margin-right: 30px;",class:"tool-item"},[r(ge,{trigger:"hover",placement:"bottom",width:"none"},{reference:()=>r("div",{class:"flex-center"},[r("span",{style:"padding-right: 3px"},[o("next.labelimg.instructions")]),r(R,{size:14},{default:()=>[r(Nn,null,null)]})]),default:()=>r("ul",{style:"font-size: 12px;white-space: nowrap;"},[r("li",null,[r("span",null,[E("A:")]),r("span",null,[E("A键进入上一张图片进行标注")])]),r("li",null,[r("span",null,[E("D:")]),r("span",null,[E("D键进入下一张图片进行标注")])]),r("li",null,[r("span",null,[E("Ctrl+鼠标:")]),r("span",null,[E("按住Ctrl键+鼠标滚动可以缩放图片,按住Ctrl+左键拖动可以移动图片")])]),r("li",null,[r("span",null,[E("P:")]),r("span",null,[E("创建多边形")])]),r("li",null,[r("span",null,[E("E:")]),r("span",null,[E("编辑形状")])]),r("li",null,[r("span",null,[E("R:")]),r("span",null,[E("创建矩形")])]),r("li",null,[r("span",null,[E("C:")]),r("span",null,[E("创建圆形")])]),r("li",null,[r("span",null,[E("K:")]),r("span",null,[E("创建关键点")])])])})]),e.isFullscreen?r("li",{class:"tool-item",onClick:()=>c(!1)},[r(T,{placement:"top",content:"取消全屏"},{default:()=>[r("svg",{t:"1719035442027",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5388",width:"18",height:"18"},[r("path",{d:"M354.133333 682.666667H256v-42.666667h170.666667v170.666667H384v-98.133334L243.2 853.333333l-29.866667-29.866666L354.133333 682.666667z m358.4 0l140.8 140.8-29.866666 29.866666-140.8-140.8V810.666667h-42.666667v-170.666667h170.666667v42.666667h-98.133334zM354.133333 384L213.333333 243.2l29.866667-29.866667L384 354.133333V256h42.666667v170.666667H256V384h98.133333z m358.4 0H810.666667v42.666667h-170.666667V256h42.666667v98.133333L823.466667 213.333333l29.866666 29.866667L712.533333 384z","p-id":"5389"},null)])]})]):r("li",{class:"tool-item",onClick:()=>c(!0)},[r(T,{placement:"top",content:"全屏"},{default:()=>[r("svg",{t:"1719035375323",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"5241",width:"18",height:"18"},[r("path",{d:"M285.866667 810.666667H384v42.666666H213.333333v-170.666666h42.666667v98.133333l128-128 29.866667 29.866667-128 128z m494.933333 0l-128-128 29.866667-29.866667 128 128V682.666667h42.666666v170.666666h-170.666666v-42.666666h98.133333zM285.866667 256l128 128-29.866667 29.866667-128-128V384H213.333333V213.333333h170.666667v42.666667H285.866667z m494.933333 0H682.666667V213.333333h170.666666v170.666667h-42.666666V285.866667l-128 128-29.866667-29.866667 128-128z","p-id":"5242"},null)])]})])])])])}}),hi=o({props:{},emits:["change"],setup(e,{emit:a}){const{t:l}=Wl(),n=t("ns",{}),s=t("toolsActive",{}),o=t("changeToolsActive"),c=e=>{o(e),a("change",e)},u=e=>{let t=s.value;switch(e.code){case"KeyP":t=Pr.CREATE_POLYGON;break;case"KeyE":t=Pr.EDIT_SHAPE;break;case"KeyR":t=Pr.CREATE_RECTANGLE;break;case"KeyC":t=Pr.CREATE_CIRCLE;break;case"KeyK":t=Pr.CREATE_KEYPOINT}c(t)};return M(()=>{document.addEventListener("keydown",u)}),h(()=>{document.removeEventListener("keydown",u)}),()=>r(i,null,[r("ul",{class:[n.be("main","left-tools")]},[r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_POLYGON}],onClick:()=>c(Pr.CREATE_POLYGON)},[r("svg",{t:"1757513720352",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4548",width:"18",height:"18"},[r("path",{d:"M938.456035 455.122739a85.314185 85.314185 0 0 1-85.371061-85.314185c0-12.342119 2.900682-23.944848 7.678277-34.523807l-5.630736-3.241939 28.89307-48.970342 17.972855 10.351454c11.14772-5.346356 23.262334-8.872675 36.457595-8.872675a85.314185 85.314185 0 1 1 0 170.571494z m-56.648618 172.050273l33.898169-166.760793 56.307362 11.204596-33.898169 166.760794-56.307362-11.204597z m39.415153 94.528117l-5.403232 26.333645v0.170629l-0.056876 0.227504-0.056876 0.227505v0.170628l-0.056876 0.056876-0.056876 0.341257-13.138385 64.725028c21.27167 15.527182 36.002586 39.415153 36.002586 67.796339a85.314185 85.314185 0 0 1-85.371061 85.257309c-26.618026 0-49.425351-12.91088-65.066285-32.078133l-17.574722 1.933788-0.73939 0.056876-0.113752 0.056876-0.682513 0.056876h-0.170629l-0.113752 0.056876-108.007758 11.716482-6.31325-56.307362 113.809123-12.398995a84.631672 84.631672 0 0 1 79.114688-82.527255l17.688474-87.077345 56.307362 11.204596z m-289.328839-518.141483l28.89307-49.027219 148.844815 85.712318-28.893071 48.970342-148.844814-85.655441z m-74.39397-42.827721l-19.394758-11.147721c-14.844668 12.683376-33.556913 21.157918-54.657954 21.157918a84.745424 84.745424 0 0 1-30.940612-6.199497l-51.984776 47.605315-39.073897-41.576446 48.458457-44.363376A82.697883 82.697883 0 0 1 398.132864 85.427937a85.314185 85.314185 0 1 1 170.62837 0c0 5.118851-2.04754 9.612065-2.957559 14.446536l20.589157 11.830233-28.893071 49.027219zM172.050273 343.986794l126.264994-115.629159 39.073897 41.576446-126.264994 115.629159-39.073897-41.576446z m-23.489839 173.358424l-16.323447 7.166392a82.982264 82.982264 0 0 1-27.300539 12.000862l-8.8158 3.867576-0.853141-1.933788c-3.412567 0.398133-6.427002 1.990664-9.953322 1.990664a85.314185 85.314185 0 1 1 85.314185-85.314185c0 22.750449-9.213932 43.168978-23.717343 58.468655l1.649407 3.753824z m105.107076 233.13523l-52.439786 23.03483-53.804812-119.269231v-0.170628a8.531419 8.531419 0 0 1-0.682514-1.47878l-0.056876-0.056876-0.455009-1.137522H146.171637l-0.113752-0.284381-0.056876-0.113752-0.625638-1.478779-0.341256-0.682514-0.056877-0.113752-0.113752-0.284381-0.398133-0.796265v-0.113753l-0.227504-0.455009-0.056876-0.113752-0.056876-0.170628-0.056877-0.056876-0.056876-0.113753-0.056876-0.113752-0.056876-0.28438-0.398133-0.796266-12.342119-27.357415 52.439786-23.03483 70.071384 155.442445z m-17.404094 100.727614l52.439786-23.03483 12.342119 27.471168c4.038205-0.568761 7.564524-2.388797 11.773357-2.388797A85.314185 85.314185 0 1 1 227.447617 938.626664c0-22.067936 8.929551-41.690198 22.636697-56.819247l-13.820898-30.599355z m332.440941 50.562874l6.31325 56.364238-171.197131 18.655369-6.31325-56.364239 171.197131-18.655368z","p-id":"4549"},null)]),r("p",{class:"label-text"},[l("next.labelme.createPolygon")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.EDIT_SHAPE}],onClick:()=>c(Pr.EDIT_SHAPE)},[r("svg",{t:"1757513760776",class:"icon",viewBox:"0 0 1025 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4712",width:"18",height:"18"},[r("path",{d:"M358.5 1021.5c-52.93 0-96-43.07-96-96 0-13.12 2.6-25.84 7.74-37.81l0.12-0.27-141.99-184.66-0.34 0.11a95.806 95.806 0 0 1-29.53 4.64c-52.93 0-96-43.07-96-96s43.07-96 96-96c7.56 0 15.09 0.89 22.41 2.64l0.36 0.09 213.67-370.08-0.16-0.25c-9.34-15.12-14.28-32.54-14.28-50.39 0-52.93 43.07-96 96-96 40.36 0 76.66 25.5 90.34 63.46l0.09 0.26 300.27 61.72 0.19-0.26c18.01-25.16 47.21-40.18 78.11-40.18 52.93 0 96 43.07 96 96 0 36.49-20.26 69.36-52.88 85.79l-0.31 0.16 41.76 393.5 0.25 0.12a96.184 96.184 0 0 1 39.11 34.79c9.85 15.41 15.06 33.27 15.06 51.65 0 52.93-43.07 96-96 96-31.18 0-60.53-15.24-78.52-40.76l-0.22-0.31-396.7 138.78-0.05 0.29c-8.2 45.76-47.94 78.97-94.5 78.97z m0-192c34.03 0 64.82 17.44 82.36 46.66l0.21 0.35L832.93 739.4l0.03-0.32c3.81-39.11 31.82-72.49 69.7-83.05l0.41-0.11-40.34-380.14-0.34-0.08c-39.73-9.82-68.86-43.81-72.49-84.56l-0.03-0.37-283.9-58.36-0.15 0.39c-7 17.7-19.01 32.81-34.72 43.69-16.08 11.13-34.96 17.02-54.59 17.02-9.75 0-19.37-1.46-28.59-4.33l-0.38-0.12L176.19 555.1l0.19 0.26c11.86 16.42 18.12 35.83 18.12 56.14 0 17.74-4.88 35.06-14.11 50.11l-0.18 0.29 136.28 177.25 0.37-0.18c13.04-6.28 27.05-9.47 41.64-9.47z","p-id":"4713"},null),r("path",{d:"M416.5 2c40.15 0 76.26 25.37 89.87 63.13l0.19 0.53 0.55 0.11 299.68 61.6 0.64 0.13 0.38-0.53c8.66-12.1 20.19-22.15 33.34-29.06C854.71 90.77 870.06 87 885.5 87c52.66 0 95.5 42.84 95.5 95.5 0 18.03-5.05 35.58-14.6 50.77a95.81 95.81 0 0 1-38 34.57l-0.62 0.31 0.07 0.69 41.7 392.88 0.06 0.55 0.5 0.24c15.91 7.71 29.36 19.68 38.91 34.61 9.8 15.33 14.98 33.09 14.98 51.38 0 52.66-42.84 95.5-95.5 95.5-31.02 0-60.22-15.16-78.11-40.55l-0.43-0.62-0.71 0.25-396.09 138.59-0.55 0.19-0.1 0.57c-3.9 21.77-15.4 41.67-32.39 56.03-17.2 14.54-39.08 22.54-61.62 22.54-52.66 0-95.5-42.84-95.5-95.5 0-13.05 2.59-25.71 7.7-37.61l0.23-0.54-0.36-0.46-141.59-184.16-0.43-0.56-0.67 0.22A95.43 95.43 0 0 1 98.5 707C45.84 707 3 664.16 3 611.5S45.84 516 98.5 516c7.52 0 15.01 0.88 22.29 2.62l0.73 0.17 0.37-0.65 213.33-369.5 0.3-0.52-0.31-0.51c-9.29-15.04-14.2-32.37-14.2-50.12C321 44.84 363.84 2 416.5 2m0 191c-9.7 0-19.27-1.45-28.44-4.31l-0.76-0.24-0.4 0.69-210.98 365.43-0.32 0.56 0.38 0.52C187.77 571.99 194 591.3 194 611.5c0 17.64-4.85 34.88-14.03 49.85l-0.36 0.59 0.42 0.55 135.82 176.65 0.5 0.64 0.73-0.35c12.97-6.26 26.91-9.43 41.42-9.43 16.79 0 33.3 4.42 47.75 12.78a96.095 96.095 0 0 1 34.18 33.63l0.42 0.7 0.77-0.27 391.17-136.87 0.6-0.21 0.06-0.64c1.88-19.33 9.53-37.41 22.11-52.28 12.44-14.71 28.77-25.2 47.22-30.35l0.82-0.23-0.09-0.84-40.26-379.37-0.07-0.7-0.68-0.17c-39.52-9.77-68.5-43.58-72.11-84.12l-0.07-0.74-0.73-0.15-283.12-58.2-0.82-0.17-0.31 0.78c-6.96 17.61-18.91 32.64-34.54 43.46-15.99 11.11-34.77 16.96-54.3 16.96m0-192C363.2 1 320 44.2 320 97.5c0 18.58 5.26 35.93 14.35 50.65l-213.33 369.5A96.669 96.669 0 0 0 98.5 515C45.2 515 2 558.2 2 611.5S45.2 708 98.5 708a96.5 96.5 0 0 0 29.69-4.66l141.59 184.15c-5 11.66-7.78 24.51-7.78 38.01 0 53.3 43.2 96.5 96.5 96.5 47.46 0 86.91-34.25 94.99-79.39l396.08-138.59C867.04 828.81 895.88 845 928.5 845c53.3 0 96.5-43.2 96.5-96.5 0-38.22-22.23-71.26-54.46-86.88l-41.7-392.88C960.37 252.86 982 220.21 982 182.5c0-53.3-43.2-96.5-96.5-96.5-32.37 0-61.01 15.94-78.51 40.39l-299.68-61.6C493.91 27.59 458.31 1 416.5 1z m0 193c40.77 0 75.63-25.28 89.77-61.03l283.12 58.2c3.69 41.4 33.52 75.27 72.87 85l40.26 379.37c-37.74 10.53-66.15 43.41-70.06 83.49L441.29 875.9c-16.87-28.1-47.63-46.9-82.79-46.9-15 0-29.2 3.42-41.86 9.53L180.82 661.88c8.99-14.66 14.18-31.91 14.18-50.38 0-21.07-6.76-40.56-18.22-56.43l210.98-365.42c9.08 2.83 18.73 4.35 28.74 4.35z","p-id":"4714"},null)]),r("p",{class:"label-text"},[l("next.labelme.editPolygon")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_RECTANGLE}],onClick:()=>c(Pr.CREATE_RECTANGLE)},[r("svg",{t:"1757513985670",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7834",width:"18",height:"18"},[r("path",{d:"M273.9 168.3H739v37.1H273.9zM273.9 819.6H739v37.1H273.9zM165.812 740.898v-465.1h37.1v465.1zM821.11 740.896v-465.1h37.1v465.1z","p-id":"7835"},null),r("path",{d:"M184.7 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7zM184.7 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 717.5c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.6c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.6-37 82.7-82.7 82.7zM840 66.2c-66.8 0-121 54.2-121 121s54.2 121 121 121 121-54.2 121-121-54.1-121-121-121z m-0.1 203.5c-45.7 0-82.7-37-82.7-82.7s37-82.7 82.7-82.7 82.7 37 82.7 82.7c0.1 45.7-37 82.7-82.7 82.7z","p-id":"7836"},null)]),r("p",{class:"label-text"},[l("next.labelme.createRectangle")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_KEYPOINT}],onClick:()=>c(Pr.CREATE_KEYPOINT)},[r("svg",{t:"1758547108531",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"9598",width:"18",height:"18"},[r("path",{d:"M205.6 554.6h-58.3c-16.7 0-31.3-14.6-31.3-31.3 0-16.7 14.6-31.3 31.3-31.3h56.3c6.2-75 35.4-145.9 87.5-195.9s122.9-81.3 200.1-85.4v-62.5c0-16.7 14.6-31.3 31.3-31.3 16.7 0 31.3 14.6 31.3 31.3v62.5c66.7 8.3 129.2 37.5 175 83.4 50 50 81.3 120.9 87.5 195.9h60.4c16.7 0 31.3 14.6 31.3 31.3 0 16.7-14.6 33.3-31.3 33.3h-62.5c-8.3 68.8-37.5 131.3-85.4 177.1-45.8 45.8-104.2 75-175.1 83.4v60.4c0 16.7-14.6 31.3-31.3 31.3-16.7 0-31.3-12.5-31.3-29.2v-58.4H489c-77.1-4.2-148-35.4-200.1-85.4-45.8-47.9-75-106.2-83.3-179.2zM612 406.7c25 25 41.7 60.4 41.7 102.1 0 41.7-14.6 77.1-41.7 102.1-25 25-60.4 41.7-102.1 41.7-41.7 0-77.1-14.6-102.1-41.7C378.6 588 362 552.5 362 515c0-39.6 14.6-77.1 41.7-102.1 31.3-25 66.7-45.8 106.3-45.8 41.5 0 77 14.6 102 39.6zM509.9 271.2c-66.7 0-127.1 25-173 70.9C295.2 387.9 266 448.3 266 515s25 127.1 70.9 173c45.8 45.9 102.1 70.9 173 70.9 64.6 0 127.1-25 173-70.9 45.8-45.8 70.9-106.3 70.9-173s-31.3-127.1-70.9-173c-45.9-41.6-106.3-70.8-173-70.8z m0 0","p-id":"9599"},null)]),r("p",{class:"label-text"},[l("next.labelme.createKeypoint")])]),r("li",{class:["tool-item",{"active-tool":s.value===Pr.CREATE_CIRCLE}],onClick:()=>c(Pr.CREATE_CIRCLE)},[r("svg",{t:"1757514108844",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8822",width:"18",height:"18"},[r("path",{d:"M512 39.613153A472.386847 472.386847 0 1 1 39.613153 512 472.386847 472.386847 0 0 1 512 39.613153m0-39.613153a512 512 0 1 0 512 512A512 512 0 0 0 512 0z","p-id":"8823"},null)]),r("p",{class:"label-text"},[l("next.labelme.createCircle")])])])])}}),pi=o({props:{shapes:{type:Array,default:()=>[]}},emits:["delete","update","select"],setup(e,{emit:l}){const{t:s}=Wl(),o=t("ns",{}),c=t("classes",a([])),u=n(c),d=t("toolsActive",{}),h=t("activeShape",a(null)),v=e=>{const t=u.findIndex(t=>t===e);return-1===t?Ar:_r[t]},f=k(e,"shapes"),m=[{prop:"group_id",label:s("next.labelme.labelGroupId"),type:"input"},{prop:"description",label:s("next.labelme.labelDescription"),type:"textarea"}],g=p({visible:!1,title:"",shapeInfo:{}}),b=()=>{g.visible=!1,g.title="",g.shapeInfo={}},y=(e,t)=>{l("update",ds(e)),t(),b()};return()=>r(i,null,[r("div",{class:[o.be("main","right-label")]},[f.value.length?r("ul",null,[f.value.map((e,t)=>r("li",{class:[o.be("right-label","label-item"),h.value?.id===e.id?o.be("label-item","active"):""],key:t,onClick:()=>(e=>{d.value===Pr.EDIT_SHAPE&&l("select",e)})(e)},[r("div",{class:[o.be("right-label","label-content")]},[r("span",{class:"label-line",style:{backgroundColor:v(e.label)}},null),r("span",null,[e.label,e.group_id?` ( ${e.group_id} )`:null])]),r("div",{class:[o.be("right-label","label-btns")]},[r(R,{size:16,style:{marginRight:"6px"},color:"#303133",onClick:t=>{t.preventDefault(),t.stopPropagation(),(e=>{g.visible=!0,g.title=e.label,g.shapeInfo=e})(e)}},{default:()=>[r(kn,null,null)]}),r(be,{title:s("next.labelme.confirmDeleteLabel"),width:200,onConfirm:()=>(e=>{l("delete",e)})(e)},{reference:()=>r(R,{size:16,color:"#ff0000",onClick:e=>{e.preventDefault(),e.stopPropagation()}},{default:()=>[r(En,null,null)]})})])]))]):r(me,{"image-size":100,description:s("next.labelme.emptyLabelText")},null),r(jo,{modelValue:g.visible,"onUpdate:modelValue":e=>g.visible=e,title:g.title,width:350,fullscreen:!1,fullscreenBtn:!1,closeOnClickModal:!0,onClose:b},{default:()=>[r(Xo,{options:{labelPosition:"top",colSpanFixed:24},columns:m,formDatum:g.shapeInfo,onSubmit:y},null)]})])])}});const vi=Te("labelme");var fi=o({name:"NextLabelme",props:{className:{type:String,default:""},style:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})},classes:{type:Array,default:()=>[]},data:{type:Array,default:()=>[]}},emits:["change","save","edit-polygon","change-polygon","prev-click","next-click"],setup(e,{emit:t,slots:s,expose:o}){const c=ds(jr),u=l(()=>{const t=n(e.options);return zl(c,t)}),d=n(u);g("ns",vi);const{t:p}=Wl(),v=a(0),f=a(e.classes);g("classes",f);const m=a("");g("toolsActive",m),g("changeToolsActive",e=>{m.value=e,x.value=null});const x=a(null);g("activeShape",x);const w=a(ds(e.data));b(()=>e.data,e=>{w.value=ds(e)},{deep:!0}),b(()=>e.data.length,()=>{v.value=0});const C=l(()=>{if(!w.value)return{};const e=w.value[v.value]||{};return ds(e)}),S=e=>{w.value[v.value]=e},E=e=>{const t=C.value,a=t.labels?.shapes?.findIndex(t=>t.id===e.id);-1!==a&&t.labels.shapes.splice(a,1),w.value[v.value]=t,A.value.rerenderImage(t),x.value=null},D=e=>{const t=C.value,a=t.labels?.shapes?.findIndex(t=>t.id===e.id);-1!==a&&(t.labels.shapes[a]=e),w.value[v.value]=t},k=e=>{A.value.onSelectShape(e),x.value=e},O=a(!1),T=a(d.minContentHeight),A=a(),_=a(),j=a(),z=a(),H=a(),V=()=>{y(()=>{const e=(_.value?.clientHeight||0)-((j.value?.clientHeight||0)+(H.value?.clientHeight||0));T.value=e})};M(()=>{document.addEventListener("keydown",I),us(_.value.parentElement,()=>{V()}),window.addEventListener("resize",V)}),h(()=>{document.removeEventListener("keydown",I),window.removeEventListener("resize",V)});const I=e=>{O.value||("KeyA"===e.code||"ArrowLeft"===e.key?N():"KeyD"!==e.code&&"ArrowRight"!==e.key||B())},N=()=>{const e=w.value.length;let a=v.value-1;a<0&&(a=e-1),F(a),t("prev-click")},B=()=>{const e=w.value.length;let a=v.value+1;a>=e&&(a=0),F(a),t("next-click")},F=e=>{if(O.value)return;O.value=!0;const a=C.value;return t("save",{node:a},t=>{w.value[v.value]=t||a,v.value=e,O.value=!1,A.value.rerenderImage(C.value)},()=>{O.value=!1}),!0},Y=a(!1),W=e=>{Y.value=e,V(),y(()=>{A.value.rerenderImage(C.value)})},U=e=>{C.value.labels=e,t("change-polygon",e)},$=e=>{t("edit-polygon",e)},K=()=>{F(v.value)||L({type:"info",message:p("next.labelimg.labelNoUpdate")})},X=a({scale:1,x:0,y:0});return g("scaleTranslateManager",{scaleTranslate:X,onChangeScaleTranslate:e=>{X.value=e},onResetScaleTranslate:()=>{A.value.resetScaleOffset()}}),o({onSave:e=>{F(v.value),e&&e(C.value)},getCurrentNode:()=>C.value}),()=>r(i,null,[r("div",{ref:_,class:[vi.b(),e.className,Y.value?vi.b("fullscreen"):""],style:{...e.style}},[r(nr,{loading:O.value,tip:p("next.labelimg.saveTxt"),class:[vi.b("loading")]},{default:()=>[r(P,null,{default:()=>[r("header",{ref:j,class:[vi.b("header")]},[s.header?s.header():r(di,{isFullscreen:Y.value,imageIndex:v.value,imageLength:w.value.length,onFullscreen:W,onSave:K},null)]),r("div",{ref:z,class:[vi.b("main")]},[r(hi,null,null),r("div",{class:[vi.be("main","content")],style:{height:T.value+"px"}},[r(ui,{ref:A,labelInfo:C.value,contextClientHeight:T.value,onEditPolygon:$,onChangePolygon:U,onUpdateLabelInfo:S,onSelectShape:k},null)]),r(pi,{shapes:C.value.labels?.shapes,onUpdate:D,onDelete:E,onSelect:k},null)]),r("footer",{ref:H,class:[vi.b("footer")]},[r("div",{class:[vi.be("footer","left")]},[r(R,{size:24,color:"#797979",onClick:N},{default:()=>[r(gn,null,null)]})]),r("div",{class:[vi.be("footer","center")]},[r(P,null,{default:()=>[r("ul",{class:[vi.bem("footer","center","list")]},[w.value.map((e,t)=>r("li",{key:t,onClick:()=>F(t),class:{"is-activate":v.value===t}},[r(he,{style:"height: 100%",src:e.imageSrc,"zoom-rate":1.2,"max-scale":2,"min-scale":.2,fit:"cover"},null)]))])]})]),r("div",{class:[vi.be("footer","right")]},[r(R,{size:24,color:"#797979",onClick:B},{default:()=>[r(bn,null,null)]})])])]})]})])])}});const mi=on(fi);var gi=Object.freeze({__proto__:null,NextCarousel:hr,NextContainer:oo,NextCrudTable:Qo,NextCrudTableVirtualized:lr,NextDialog:jo,NextDragResize:ur,NextForm:Xo,NextInputTableSelect:Ko,NextLabelimg:Or,NextLabelimgPreview:Lr,NextLabelme:mi,NextLayout:to,NextMenu:Es,NextSpinLoading:nr,NextTabs:no,NextTextEllipsis:vn,NextTreeCascader:$o,NextTreeSelect:Uo,NextUpload:or,NextVideoPlayer:cr});const bi=Symbol("configProviderContextKey"),yi="0.6.14",xi=function(t,a){if(Object.keys(gi).forEach(e=>{const a=gi[e];t.component(a.name,a)}),(e=>{(e=>{e.directive("zoom",{mounted(e,t){if(!t.value)return!1;const a="string"==typeof(l=t.value)||!We(l)&&Fe(l)&&"[object String]"==Be(l)?[t.value,".el-dialog__body",!1,!0]:t.value;var l;a[1]=a[1]?a[1]:".el-dialog__body",a[2]=void 0!==a[2]&&a[2],a[3]=void 0===a[3]||a[3],y(()=>{const e=document.querySelector(a[1]),t=document.querySelector(a[0]),l=document.createElement("div");l.className="dialog-zoom",l.onmouseenter=()=>{l.onmousedown=l=>{const n=l.clientX,s=l.clientY,o=e.offsetWidth,r=e.offsetHeight,i=t.offsetWidth,c=t.offsetHeight;document.onmousemove=l=>{l.preventDefault();const u=o+2*(l.clientX-n),d=r+(l.clientY-s);if(e.style.width=`${u}px`,e.style.height=`${d}px`,a[2]){const e=c+(l.clientY-s);t.style.height=`${e}px`}if(a[3]){const e=i+2*(l.clientX-n);t.style.width=`${e}px`}},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null}}},t.appendChild(l)})}})})(e)})(t),a){const n=!!e();(t?.provide??(n?g:void 0))(bi,l(()=>a))}};var wi={version:yi,install:xi};export{hr as NextCarousel,oo as NextContainer,Qo as NextCrudTable,lr as NextCrudTableVirtualized,jo as NextDialog,ur as NextDragResize,Xo as NextForm,Ko as NextInputTableSelect,Or as NextLabelimg,Lr as NextLabelimgPreview,mi as NextLabelme,to as NextLayout,Es as NextMenu,nr as NextSpinLoading,no as NextTabs,vn as NextTextEllipsis,$o as NextTreeCascader,Uo as NextTreeSelect,or as NextUpload,cr as NextVideoPlayer,Fl as buildLocaleContext,Bl as buildTranslator,wi as default,De as defaultNamespace,xi as install,Yl as localeContextKey,Il as localeLang,Oe as namespaceContextKey,Ql as nextUseCssTheme,Jl as nextUseCssVar,Gl as randomColor16,Nl as translate,en as updateThemeColor,an as updateThemeColorCssVar,ql as useChangeColor,sn as useDetectVideo,Le as useGetDerivedNamespace,Ul as useLanguage,Wl as useLocale,Te as useNamespace,yi as version};