From fa2d3373d3dc967ea5702a032fc8a9f96c3de75a Mon Sep 17 00:00:00 2001 From: wangzemei Date: Fri, 16 May 2025 17:12:00 +0800 Subject: [PATCH] * [stroy#73010] update zui lib. --- www/js/zui3/zui.zentao.js | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index ebcf7c301c..21d174ede0 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -1,18 +1,17 @@ -var Ou=(I,st,Nt)=>{if(!st.has(I))throw TypeError("Cannot "+Nt)};var It=(I,st,Nt)=>(Ou(I,st,"read from private field"),Nt?Nt.call(I):st.get(I)),jt=(I,st,Nt)=>{if(st.has(I))throw TypeError("Cannot add the same private member more than once");st instanceof WeakSet?st.add(I):st.set(I,Nt)},Ut=(I,st,Nt,sl)=>(Ou(I,st,"write to private field"),sl?sl.call(I,Nt):st.set(I,Nt),Nt);var zu=(I,st,Nt)=>(Ou(I,st,"access private method"),Nt);(function(I,st){typeof exports=="object"&&typeof module<"u"?st(exports):typeof define=="function"&&define.amd?define(["exports"],st):(I=typeof globalThis<"u"?globalThis:I||self,st(I.zui={}))})(this,function(I){var Ta,Da,Cr,xr,Sr,kr,Tr,Dr,$a,qg,Ia,Gg,qn,Gn;"use strict";const st="",Nt="",sl="",uC="",dC="",fC="",pC="",mC="",gC="",yC="",vC="",bC="",il="3.0.0",Qg="production",fn=document,Ur=window,Hu=fn.documentElement,is=fn.createElement.bind(fn),Uu=is("div"),rl=is("table"),ey=is("tbody"),Wu=is("tr"),{isArray:Wr,prototype:Vu}=Array,{concat:ty,filter:ol,indexOf:Ku,map:qu,push:ny,slice:Gu,some:al,splice:sy}=Vu,iy=/^#(?:[\w-]|\\.|[^\x00-\xa0])*$/,ry=/^\.(?:[\w-]|\\.|[^\x00-\xa0])*$/,oy=/<.+>/,ay=/^\w+$/;function ll(s,e){const t=ly(e);return!s||!t&&!rs(e)&&!rt(e)?[]:!t&&ry.test(s)?e.getElementsByClassName(s.slice(1).replace(/\\/g,"")):!t&&ay.test(s)?e.getElementsByTagName(s):e.querySelectorAll(s)}class Vr{constructor(e,t){if(!e)return;if(cl(e))return e;let n=e;if(_t(e)){const i=t||fn;if(n=iy.test(e)&&rs(i)?i.getElementById(e.slice(1).replace(/\\/g,"")):oy.test(e)?ed(e):cl(i)?i.find(e):_t(i)?y(i).find(e):ll(e,i),!n)return}else if(os(e))return this.ready(e);(n.nodeType||n===Ur)&&(n=[n]),this.length=n.length;for(let i=0,r=this.length;i{for(;e.firstChild;)e.removeChild(e.firstChild)})};function Kr(...s){const e=hy(s[0])?s.shift():!1,t=s.shift(),n=s.length;if(!t)return{};if(!n)return Kr(e,y,t);for(let i=0;i{rt(r)&&dt(t,(o,a)=>{n?e?r.classList.add(a):r.classList.remove(a):r.classList.toggle(a)})})},se.addClass=function(s){return this.toggleClass(s,!0)},se.removeAttr=function(s){const e=qr(s);return this.each((t,n)=>{rt(n)&&dt(e,(i,r)=>{n.removeAttribute(r)})})};function dy(s,e){if(s){if(_t(s)){if(arguments.length<2){if(!this[0]||!rt(this[0]))return;const t=this[0].getAttribute(s);return Si(t)?void 0:t}return Et(e)?this:Si(e)?this.removeAttr(s):this.each((t,n)=>{rt(n)&&n.setAttribute(s,e)})}for(const t in s)this.attr(t,s[t]);return this}}se.attr=dy,se.removeClass=function(s){return arguments.length?this.toggleClass(s,!1):this.attr("class","")},se.hasClass=function(s){return!!s&&al.call(this,e=>rt(e)&&e.classList.contains(s))},se.get=function(s){return Et(s)?Gu.call(this):(s=Number(s),this[s<0?s+this.length:s])},se.eq=function(s){return y(this.get(s))},se.first=function(){return this.eq(0)},se.last=function(){return this.eq(-1)};function fy(s){return Et(s)?this.get().map(e=>rt(e)||cy(e)?e.textContent:"").join(""):this.each((e,t)=>{rt(t)&&(t.textContent=s)})}se.text=fy;function pn(s,e,t){if(!rt(s))return;const n=Ur.getComputedStyle(s,null);return t?n.getPropertyValue(e)||void 0:n[e]||s.style[e]}function en(s,e){return parseInt(pn(s,e),10)||0}function Xu(s,e){return en(s,`border${e?"Left":"Top"}Width`)+en(s,`padding${e?"Left":"Top"}`)+en(s,`padding${e?"Right":"Bottom"}`)+en(s,`border${e?"Right":"Bottom"}Width`)}const ul={};function py(s){if(ul[s])return ul[s];const e=is(s);fn.body.insertBefore(e,null);const t=pn(e,"display");return fn.body.removeChild(e),ul[s]=t!=="none"?t:"block"}function Zu(s){return pn(s,"display")==="none"}function Ju(s,e){const t=s&&(s.matches||s.webkitMatchesSelector||s.msMatchesSelector);return!!t&&!!e&&t.call(s,e)}function Gr(s){return _t(s)?(e,t)=>Ju(t,s):os(s)?s:cl(s)?(e,t)=>s.is(t):s?(e,t)=>t===s:()=>!1}se.filter=function(s){const e=Gr(s);return y(ol.call(this,(t,n)=>e.call(t,n,t)))};function Nn(s,e){return e?s.filter(e):s}se.detach=function(s){return Nn(this,s).each((e,t)=>{t.parentNode&&t.parentNode.removeChild(t)}),this};const my=/^\s*<(\w+)[^>]*>/,gy=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,Qu={"*":Uu,tr:ey,td:Wu,th:Wu,thead:rl,tbody:rl,tfoot:rl};function ed(s){if(!_t(s))return[];if(gy.test(s))return[is(RegExp.$1)];const e=my.test(s)&&RegExp.$1,t=Qu[e]||Qu["*"];return t.innerHTML=s,y(t.childNodes).detach().get()}y.parseHTML=ed,se.has=function(s){const e=_t(s)?(t,n)=>ll(s,n).length:(t,n)=>n.contains(s);return this.filter(e)},se.not=function(s){const e=Gr(s);return this.filter((t,n)=>(!_t(s)||rt(n))&&!e.call(n,t,n))};function mn(s,e,t,n){const i=[],r=os(e),o=n&&Gr(n);for(let a=0,l=s.length;ae.selected&&!e.disabled&&!e.parentNode.disabled),"value"):s.value||""}function yy(s){return arguments.length?this.each((e,t)=>{const n=t.multiple&&t.options;if(n||dd.test(t.type)){const i=Wr(s)?qu.call(s,String):Si(s)?[]:[String(s)];n?dt(t.options,(r,o)=>{o.selected=i.indexOf(o.value)>=0},!0):t.checked=i.indexOf(t.value)>=0}else t.value=Et(s)||Si(s)?"":s}):this[0]&&td(this[0])}se.val=yy,se.is=function(s){const e=Gr(s);return al.call(this,(t,n)=>e.call(t,n,t))},y.guid=1;function tn(s){return s.length>1?ol.call(s,(e,t,n)=>Ku.call(n,e)===t):s}y.unique=tn,se.add=function(s,e){return y(tn(this.get().concat(y(s,e).get())))},se.children=function(s){return Nn(y(tn(mn(this,e=>e.children))),s)},se.parent=function(s){return Nn(y(tn(mn(this,"parentNode"))),s)},se.index=function(s){const e=s?y(s)[0]:this[0],t=s?this:y(e).parent().children();return Ku.call(t,e)},se.closest=function(s){const e=this.filter(s);if(e.length)return e;const t=this.parent();return t.length?t.closest(s):e},se.siblings=function(s){return Nn(y(tn(mn(this,e=>y(e).parent().children().not(e)))),s)},se.find=function(s){return y(tn(mn(this,e=>ll(s,e))))};const vy=/^\s*\s*$/g,by=/^$|^module$|\/(java|ecma)script/i,_y=["type","src","nonce","noModule"];function wy(s,e){const t=y(s);t.filter("script").add(t.find("script")).each((n,i)=>{if(by.test(i.type)&&Hu.contains(i)){const r=is("script");r.text=i.textContent.replace(vy,""),dt(_y,(o,a)=>{i[a]&&(r[a]=i[a])}),e.head.insertBefore(r,null),e.head.removeChild(r)}})}function Cy(s,e,t,n,i){n?s.insertBefore(e,t?s.firstChild:null):s.nodeName==="HTML"?s.parentNode.replaceChild(e,s):s.parentNode.insertBefore(e,t?s:s.nextSibling),i&&wy(e,s.ownerDocument)}function En(s,e,t,n,i,r,o,a){return dt(s,(l,c)=>{dt(y(c),(u,h)=>{dt(y(e),(p,m)=>{const v=t?h:m,w=t?m:h,x=t?u:p;Cy(v,x?w.cloneNode(!0):w,n,i,!x)},a)},o)},r),e}se.after=function(){return En(arguments,this,!1,!1,!1,!0,!0)},se.append=function(){return En(arguments,this,!1,!1,!0)};function xy(s){if(!arguments.length)return this[0]&&this[0].innerHTML;if(Et(s))return this;const e=/]/.test(s);return this.each((t,n)=>{rt(n)&&(e?y(n).empty().append(s):n.innerHTML=s)})}se.html=xy,se.appendTo=function(s){return En(arguments,this,!0,!1,!0)},se.wrapInner=function(s){return this.each((e,t)=>{const n=y(t),i=n.contents();i.length?i.wrapAll(s):n.append(s)})},se.before=function(){return En(arguments,this,!1,!0)},se.wrapAll=function(s){let e=y(s),t=e[0];for(;t.children.length;)t=t.firstElementChild;return this.first().before(e),this.appendTo(t)},se.wrap=function(s){return this.each((e,t)=>{const n=y(s)[0];y(t).wrapAll(e?n.cloneNode(!0):n)})},se.insertAfter=function(s){return En(arguments,this,!0,!1,!1,!1,!1,!0)},se.insertBefore=function(s){return En(arguments,this,!0,!0)},se.prepend=function(){return En(arguments,this,!1,!0,!0,!0,!0)},se.prependTo=function(s){return En(arguments,this,!0,!0,!0,!1,!1,!0)},se.contents=function(){return y(tn(mn(this,s=>s.tagName==="IFRAME"?[s.contentDocument]:s.tagName==="TEMPLATE"?s.content.childNodes:s.childNodes)))},se.next=function(s,e,t){return Nn(y(tn(mn(this,"nextElementSibling",e,t))),s)},se.nextAll=function(s){return this.next(s,!0)},se.nextUntil=function(s,e){return this.next(e,!0,s)},se.parents=function(s,e){return Nn(y(tn(mn(this,"parentElement",!0,e))),s)},se.parentsUntil=function(s,e){return this.parents(e,s)},se.prev=function(s,e,t){return Nn(y(tn(mn(this,"previousElementSibling",e,t))),s)},se.prevAll=function(s){return this.prev(s,!0)},se.prevUntil=function(s,e){return this.prev(e,!0,s)},se.map=function(s){return y(ty.apply([],qu.call(this,(e,t)=>s.call(e,t,e))))},se.clone=function(){return this.map((s,e)=>e.cloneNode(!0))},se.offsetParent=function(){return this.map((s,e)=>{let t=e.offsetParent;for(;t&&pn(t,"position")==="static";)t=t.offsetParent;return t||Hu})},se.slice=function(s,e){return y(Gu.call(this,s,e))};const Sy=/-([a-z])/g;function dl(s){return s.replace(Sy,(e,t)=>t.toUpperCase())}se.ready=function(s){const e=()=>setTimeout(s,0,y);return fn.readyState!=="loading"?e():fn.addEventListener("DOMContentLoaded",e),this},se.unwrap=function(){return this.parent().each((s,e)=>{if(e.tagName==="BODY")return;const t=y(e);t.replaceWith(t.children())}),this},se.offset=function(){const s=this[0];if(!s)return;const e=s.getBoundingClientRect();return{top:e.top+Ur.pageYOffset,left:e.left+Ur.pageXOffset}},se.position=function(){const s=this[0];if(!s)return;const e=pn(s,"position")==="fixed",t=e?s.getBoundingClientRect():this.offset();if(!e){const n=s.ownerDocument;let i=s.offsetParent||n.documentElement;for(;(i===n.body||i===n.documentElement)&&pn(i,"position")==="static";)i=i.parentNode;if(i!==s&&rt(i)){const r=y(i).offset();t.top-=r.top+en(i,"borderTopWidth"),t.left-=r.left+en(i,"borderLeftWidth")}}return{top:t.top-en(s,"marginTop"),left:t.left-en(s,"marginLeft")}};const nd={class:"className",contenteditable:"contentEditable",for:"htmlFor",readonly:"readOnly",maxlength:"maxLength",tabindex:"tabIndex",colspan:"colSpan",rowspan:"rowSpan",usemap:"useMap"};se.prop=function(s,e){if(s){if(_t(s))return s=nd[s]||s,arguments.length<2?this[0]&&this[0][s]:this.each((t,n)=>{n[s]=e});for(const t in s)this.prop(t,s[t]);return this}},se.removeProp=function(s){return this.each((e,t)=>{delete t[nd[s]||s]})};const ky=/^--/;function fl(s){return ky.test(s)}const pl={},{style:Ty}=Uu,Dy=["webkit","moz","ms"];function $y(s,e=fl(s)){if(e)return s;if(!pl[s]){const t=dl(s),n=`${t[0].toUpperCase()}${t.slice(1)}`,i=`${t} ${Dy.join(`${n} `)}${n}`.split(" ");dt(i,(r,o)=>{if(o in Ty)return pl[s]=o,!1})}return pl[s]}const Iy={animationIterationCount:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0};function sd(s,e,t=fl(s)){return!t&&!Iy[s]&&Yu(e)?`${e}px`:e}function Ny(s,e){if(_t(s)){const t=fl(s);return s=$y(s,t),arguments.length<2?this[0]&&pn(this[0],s,t):s?(e=sd(s,e,t),this.each((n,i)=>{rt(i)&&(t?i.style.setProperty(s,e):i.style[s]=e)})):this}for(const t in s)this.css(t,s[t]);return this}se.css=Ny;function id(s,e){try{return s(e)}catch{return e}}const Ey=/^\s+|\s+$/;function rd(s,e){const t=s.dataset[e]||s.dataset[dl(e)];return Ey.test(t)?t:id(JSON.parse,t)}function My(s,e,t){t=id(JSON.stringify,t),s.dataset[dl(e)]=t}function Ay(s,e){if(!s){if(!this[0])return;const t={};for(const n in this[0].dataset)t[n]=rd(this[0],n);return t}if(_t(s))return arguments.length<2?this[0]&&rd(this[0],s):Et(e)?this:this.each((t,n)=>{My(n,s,e)});for(const t in s)this.data(t,s[t]);return this}se.data=Ay;function od(s,e){const t=s.documentElement;return Math.max(s.body[`scroll${e}`],t[`scroll${e}`],s.body[`offset${e}`],t[`offset${e}`],t[`client${e}`])}dt([!0,!1],(s,e)=>{dt(["Width","Height"],(t,n)=>{const i=`${e?"outer":"inner"}${n}`;se[i]=function(r){if(this[0])return Os(this[0])?e?this[0][`inner${n}`]:this[0].document.documentElement[`client${n}`]:rs(this[0])?od(this[0],n):this[0][`${e?"offset":"client"}${n}`]+(r&&e?en(this[0],`margin${t?"Top":"Left"}`)+en(this[0],`margin${t?"Bottom":"Right"}`):0)}})}),dt(["Width","Height"],(s,e)=>{const t=e.toLowerCase();se[t]=function(n){if(!this[0])return Et(n)?void 0:this;if(!arguments.length)return Os(this[0])?this[0].document.documentElement[`client${e}`]:rs(this[0])?od(this[0],e):this[0].getBoundingClientRect()[t]-Xu(this[0],!s);const i=parseInt(n,10);return this.each((r,o)=>{if(!rt(o))return;const a=pn(o,"boxSizing");o.style[t]=sd(t,i+(a==="border-box"?Xu(o,!s):0))})}});const ad="___cd";se.toggle=function(s){return this.each((e,t)=>{if(!rt(t))return;const n=Zu(t);(Et(s)?n:s)?(t.style.display=t[ad]||"",Zu(t)&&(t.style.display=py(t.tagName))):n||(t[ad]=pn(t,"display"),t.style.display="none")})},se.hide=function(){return this.toggle(!1)},se.show=function(){return this.toggle(!0)};const ld="___ce",ml=".",gl={focus:"focusin",blur:"focusout"},cd={mouseenter:"mouseover",mouseleave:"mouseout"},Py=/^(mouse|pointer|contextmenu|drag|drop|click|dblclick)/i;function yl(s){return cd[s]||gl[s]||s}function vl(s){const e=s.split(ml);return[e[0],e.slice(1).sort()]}se.trigger=function(s,e){if(_t(s)){const[n,i]=vl(s),r=yl(n);if(!r)return this;const o=Py.test(r)?"MouseEvents":"HTMLEvents";s=fn.createEvent(o),s.initEvent(r,!0,!0),s.namespace=i.join(ml),s.___ot=n}s.___td=e;const t=s.___ot in gl;return this.each((n,i)=>{t&&os(i[s.___ot])&&(i[`___i${s.type}`]=!0,i[s.___ot](),i[`___i${s.type}`]=!1),i.dispatchEvent(s)})};function hd(s){return s[ld]=s[ld]||{}}function Ly(s,e,t,n,i){const r=hd(s);r[e]=r[e]||[],r[e].push([t,n,i]),s.addEventListener(e,i)}function ud(s,e){return!e||!al.call(e,t=>s.indexOf(t)<0)}function Yr(s,e,t,n,i){const r=hd(s);if(e)r[e]&&(r[e]=r[e].filter(([o,a,l])=>{if(i&&l.guid!==i.guid||!ud(o,t)||n&&n!==a)return!0;s.removeEventListener(e,l)}));else for(e in r)Yr(s,e,t,n,i)}se.off=function(s,e,t){if(Et(s))this.each((n,i)=>{!rt(i)&&!rs(i)&&!Os(i)||Yr(i)});else if(_t(s))os(e)&&(t=e,e=""),dt(qr(s),(n,i)=>{const[r,o]=vl(i),a=yl(r);this.each((l,c)=>{!rt(c)&&!rs(c)&&!Os(c)||Yr(c,a,o,e,t)})});else for(const n in s)this.off(n,s[n]);return this},se.remove=function(s){return Nn(this,s).detach().off(),this},se.replaceWith=function(s){return this.before(s).remove()},se.replaceAll=function(s){return y(s).replaceWith(this),this};function Ry(s,e,t,n,i){if(!_t(s)){for(const r in s)this.on(r,e,t,s[r],i);return this}return _t(e)||(Et(e)||Si(e)?e="":Et(t)?(t=e,e=""):(n=t,t=e,e="")),os(n)||(n=t,t=void 0),n?(dt(qr(s),(r,o)=>{const[a,l]=vl(o),c=yl(a),u=a in cd,h=a in gl;c&&this.each((p,m)=>{if(!rt(m)&&!rs(m)&&!Os(m))return;const v=function(w){if(w.target[`___i${w.type}`])return w.stopImmediatePropagation();if(w.namespace&&!ud(l,w.namespace.split(ml))||!e&&(h&&(w.target!==m||w.___ot===c)||u&&w.relatedTarget&&m.contains(w.relatedTarget)))return;let x=m;if(e){let D=w.target;for(;!Ju(D,e);)if(D===m||(D=D.parentNode,!D))return;x=D}Object.defineProperty(w,"currentTarget",{configurable:!0,get(){return x}}),Object.defineProperty(w,"delegateTarget",{configurable:!0,get(){return m}}),Object.defineProperty(w,"data",{configurable:!0,get(){return t}});const S=n.call(x,w,w.___td);i&&Yr(m,c,l,e,v),S===!1&&(w.preventDefault(),w.stopPropagation())};v.guid=n.guid=n.guid||y.guid++,Ly(m,c,l,e,v)})}),this):this}se.on=Ry;function Oy(s,e,t,n){return this.on(s,e,t,n,!0)}se.one=Oy;const zy=/\r?\n/g;function Fy(s,e){return`&${encodeURIComponent(s)}=${encodeURIComponent(e.replace(zy,`\r -`))}`}const jy=/file|reset|submit|button|image/i,dd=/radio|checkbox/i;se.serialize=function(){let s="";return this.each((e,t)=>{dt(t.elements||[t],(n,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||jy.test(i.type)||dd.test(i.type)&&!i.checked)return;const r=td(i);if(!Et(r)){const o=Wr(r)?r:[r];dt(o,(a,l)=>{s+=Fy(i.name,l)})}})}),s.slice(1)},window.$=y;function fd(s,e){if(s==null)return[s,void 0];typeof e=="string"&&(e=e.split("."));const t=e.join(".");let n=s;const i=[n];for(;typeof n=="object"&&n!==null&&e.length;){let r=e.shift(),o;const a=r.indexOf("[");if(a>0&&a{const i=t[n]??"";s=s.replace(new RegExp(`\\{${n}\\}`,"g"),`${i}`)}),s}for(let t=0;t(s[s.B=1]="B",s[s.KB=1024]="KB",s[s.MB=1048576]="MB",s[s.GB=1073741824]="GB",s[s.TB=1099511627776]="TB",s))(bl||{});function pt(s,e=2,t){return Number.isNaN(s)?"?KB":(t||(s<1024?t="B":s<1048576?t="KB":s<1073741824?t="MB":s<1099511627776?t="GB":t="TB"),(s/bl[t]).toFixed(e)+t)}const gn=s=>{const e=/^[0-9]*(B|KB|MB|GB|TB)$/;s=s.toUpperCase(),s.endsWith("B")||(s+="B");const t=s.match(e);if(!t)return 0;const n=t[1];return s=s.replace(n,""),Number.parseInt(s,10)*bl[n]};let _l=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),yn;function pd(){return _l}function Hy(s){_l=s.toLowerCase().replace("-","_")}function md(s,e){yn||(yn={}),typeof s=="string"&&(s={[s]:e??{}}),y.extend(!0,yn,s)}function Ee(s,e,t,n,i,r){Array.isArray(s)?yn&&s.unshift(yn):s=yn?[yn,s]:[s],typeof t=="string"&&(r=i,i=n,n=t,t=void 0);const o=i||_l;let a;for(const l of s){if(!l)continue;const c=l[o]||l.default;if(!c)continue;const u=r&&l===yn?`${r}.${e}`:e;if(a=ki(c,u),a!==void 0)break}return a===void 0?n:t?_e(a,...Array.isArray(t)?t:[t]):a}function Uy(s,e,t,n){return Ee(void 0,s,e,t,n)}Ee.addLang=md,Ee.getLang=Uy,Ee.getCode=pd,Ee.setCode=Hy,Ee.map=yn,md({zh_cn:{confirm:"确定",save:"保存",cancel:"取消",delete:"删除",reset:"重置",add:"添加",copy:"复制",close:"关闭"},zh_tw:{confirm:"確定",save:"儲存",cancel:"取消",delete:"刪除",reset:"重置",add:"添加",Copy:"複製",close:"關閉"},en:{confirm:"Confirm",save:"Save",cancel:"Cancel",delete:"Delete",reset:"Reset",add:"Add",copy:"Copy",close:"Close"}});function as(s,e,t){t!=null&&(Array.isArray(t)?t.forEach(n=>as(s,e,n)):!(t instanceof Blob)&&y.isPlainObject(t)?Object.entries(t).forEach(([n,i])=>{as(s,`${e}[${n}]`,i)}):s.append(e,t instanceof Blob?t:String(t)))}function Xr(s,e){const t=e||new FormData;return s&&(typeof s=="string"&&(s=new URLSearchParams(s)),s instanceof URLSearchParams?s.forEach((n,i)=>{as(t,i,n)}):Array.isArray(s)?s.forEach(([n,i])=>{as(t,n,i)}):s instanceof FormData?s.forEach((n,i)=>{as(t,i,n)}):typeof s=="object"&&s&&Object.entries(s).forEach(([n,i])=>{as(t,n,i)})),t}function gd(s,e,t){s instanceof Headers?s.set(e,t):Array.isArray(s)?s.push([e,t]):s[e]=t}function Wy(s,e){if(s){const t={text:"text/plain",html:"text/html",json:"application/json",...e};for(const[n,i]of Object.entries(t))if(i.split(",").map(r=>r.trim()).includes(s))return n}return"text"}class Ti{get completed(){return this.data!==void 0||this.error!==void 0}get[Symbol.toStringTag](){return"Ajax"}constructor(e){this.setting=e,this._controller=new AbortController,this._callbacks={success:[],error:[],complete:[]}}on(e,t){return this._callbacks[e].push(t),this}success(e){return this.on("success",e)}done(e){return this.success(e)}fail(e){return this.on("error",e)}complete(e){return this.on("complete",e)}always(e){return this.complete(e)}then(e,t){return this.completed?t&&this.error?t(this.error):e(this.data):(this.success(n=>e(n)),t&&this.fail(t)),this}catch(e){return this.error?(e(this.error),this):this.on("error",t=>e(t))}finally(e){return this.completed?(e(),this):this.complete(()=>e())}abort(e){return this.completed?!1:(this._abortError=e,this._controller.abort(),!0)}getResponseHeader(e){var t;return(t=this.response)==null?void 0:t.headers.get(e)}_init(){if(this.completed)return;const{url:e,type:t,data:n,processData:i=!0,contentType:r,crossDomain:o,accepts:a,dataType:l,timeout:c,dataFilter:u,beforeSend:h,success:p,error:m,complete:v,...w}=this.setting;t&&(w.method=t);let x=n;x&&(i&&(x=Xr(x)),w.body=x),o&&(w.mode="cors");const S=w.headers||{};gd(S,"X-Requested-With","XMLHttpRequest"),r&&gd(S,"Content-Type",r),w.headers=S,w.signal&&w.signal.addEventListener("abort",()=>{this.abort()});const D=[...this.constructor.globalBeforeSends,h];for(const M of D){if(!M)continue;const P=M.call(this,w);if(P===!1)return;P&&Object.assign(w,P)}p&&this.success(p),m&&this.fail(m),v&&this.complete(v),w.signal=this._controller.signal,this.url=e,this.request=w}_emit(e,...t){this._callbacks[e].forEach(n=>{n.call(this,...t)})}async send(){var u;if(this.completed)return[];this._init();const{timeout:e,dataType:t,accepts:n,dataFilter:i,throws:r,jsonParser:o}=this.setting;e&&(this._timeoutID=window.setTimeout(()=>{this.abort(new Error("timeout"))},e));let a,l,c;try{a=await fetch(this.url,this.request),this.response=a;const{statusText:h}=a;if(a.ok){const p=(u=a.headers.get("Content-Disposition"))==null?void 0:u.startsWith("attachment"),m=p?"blob":t||Wy(a.headers.get("Content-Type"),n);p||m==="blob"||m==="file"?c=await a.blob():m==="json"?typeof o=="function"?(c=await a.text(),c=o(c)):c=await a.json():c=await a.text(),this.data=c;const v=(i==null?void 0:i(c,m))??c;this._emit("success",v,h,a)}else throw this.data=await a.text(),new Error(h)}catch(h){this.data===void 0&&c!==void 0&&(this.data=c),l=h;let p=!1;l.name==="AbortError"&&(this._abortError?l=this._abortError:p=!0),this.error=l,p||this._emit("error",l,a==null?void 0:a.statusText,l.message)}if(this._timeoutID&&clearTimeout(this._timeoutID),this._emit("complete",a,a==null?void 0:a.statusText),l&&r)throw l;return[c,l,a]}}Ti.globalBeforeSends=[],y.ajax=(s,e)=>{e=e||{},typeof s=="string"?e.url=s:y.extend(e,s);const t=new Ti(e);return t.send(),t},y.getJSON=(s,e,t)=>(typeof e=="function"&&(t=e,e=void 0),y.ajax({url:s,data:e,success:t,dataType:"json"})),y.get=(s,e,t,n,i="GET")=>{let r,o;return typeof e=="function"?(r=e,o=void 0):o=e,typeof t=="function"?(r=t,n=void 0):n=t,y.ajax({method:i,url:s,data:o,success:r,dataType:n})},y.post=(s,e,t,n)=>y.get(s,e,t,n,"POST"),y.fn.load=function(s,e,t){typeof e=="function"&&(t=e,e=void 0);const[n,i]=s.split(" ");return y.get(n,e,(r,o,a)=>{i&&(r=y(r).find(i).html()),y(this).html(r).zuiInit(),t==null||t.call(this,r,o,a)},"html"),this};async function mt(s,e=[],t,n,i){const r={throws:!0,dataType:"json"};if(typeof s=="string")r.url=s;else if(typeof s=="object")y.extend(r,s);else if(typeof s=="function"){const l=s.call(n,...e);return l instanceof Promise?await l:l}t&&y.extend(r,typeof t=="function"?t(r):t),r.url&&(r.url=_e(r.url,...e));const o=new Ti(r);i==null||i(o);const[a]=await o.send();return a}function wl(s){return!!(s&&(typeof s=="string"||typeof s=="object"&&s.url||typeof s=="function"))}y.fetch=mt;function wt(){return y.guid++}function Zr(s,e){if(s===e)return!1;if(s&&e){const t=typeof s,n=typeof e;if(t!==n)return!0;if(t==="object"&&n==="object"){const i=Array.isArray(s),r=Array.isArray(e);if(i!==r)return!0;if(i&&r){if(s.length!==e.length)return!0;for(let l=0;ln instanceof ls?n.value!==t[i]:Zr(n,t[i])))&&(this._value=this._compute(),this._lastDependencies=e.map(n=>n instanceof ls?n.cache:n)),this._value}}function Cl(...s){const e=[],t=new Map,n=(i,r)=>{if(Array.isArray(i)&&(r=i[1],i=i[0]),!i.length)return;const o=t.get(i);typeof o=="number"?e[o][1]=!!r:(t.set(i,e.length),e.push([i,!!r]))};return s.forEach(i=>{typeof i=="function"&&(i=i()),Array.isArray(i)?Cl(...i).forEach(n):i&&typeof i=="object"?Object.entries(i).forEach(n):typeof i=="string"&&i.split(" ").forEach(r=>n(r,!0))}),e.sort((i,r)=>(t.get(i[0])||0)-(t.get(r[0])||0))}const V=(...s)=>Cl(...s).reduce((e,[t,n])=>(n&&e.push(t),e),[]).join(" ");y.classes=V,y.fn.setClass=function(s,...e){return this.each((t,n)=>{const i=y(n);s===!0?i.attr("class",V(i.attr("class"),...e)):i.addClass(V(s,...e))})};const zs=new WeakMap;function Jr(s,e,t){const n=zs.has(s),i=n?zs.get(s):{};typeof e=="string"?i[e]=t:e===null?Object.keys(i).forEach(r=>{delete i[r]}):Object.assign(i,e),Object.keys(i).forEach(r=>{i[r]===void 0&&delete i[r]}),Object.keys(i).length?(!n&&s instanceof Element&&Object.assign(i,y(s).dataset(),i),zs.set(s,i)):zs.delete(s)}function Di(s,e,t){let n=zs.get(s)||{};return t&&s instanceof Element&&(n=Object.assign({},y(s).dataset(),n)),e===void 0?n:n[e]}function Vy(s){zs.delete(s)}y.fn.dataset=y.fn.data,y.fn.data=function(...s){const[e,t]=s;return!s.length||s.length===1&&typeof e=="string"?this.length?Di(this[0],e,!0):void 0:this.each((n,i)=>Jr(i,e,t))},y.fn.removeData=function(s=null){return this.each((e,t)=>Jr(t,s))};function cs(s,...e){return s.includes("RAWJS")&&(s=s.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` -`)),new Function(`return ${s}`)(...e)}function xl(s,...e){return s.includes("RAWJS")?cs(s,...e):JSON.parse(s)}function Ky(s){return JSON.stringify(s,(e,t)=>{if(typeof t=="function")return`RAWJS<${t.toString().split('"').join("").split(` -`).join("")}>RAWJS`})}function Fs(s,e){const t=y(s)[0];if(!t)return;const{prefix:n,getter:i,evalValue:r,json:o=!0,evalArgs:a=[]}={prefix:"z-",...typeof e=="string"?{prefix:e}:e},l=Array.isArray(r)?new Set(r):void 0;return Array.from(t.attributes).reduce((c,u)=>{let{name:h}=u;const{value:p}=u;let m=p;if(h.startsWith(n)){if(h=h.slice(n.length).replace(/-([a-z])/g,v=>v[1].toUpperCase()),i)m=i(h,p);else try{r&&(!l||l.has(h))||r===void 0&&p.includes("RAWJS")?m=cs(p,...a):o&&(m=JSON.parse(p))}catch{}c[h]=m}return c},{})}function Sl(s,e,t="z-"){const n=y(s);Object.keys(e).forEach(i=>{let r=e[i];typeof r=="function"&&(r=`RAWJS<${r}>RAWJS`),typeof r!="string"&&(r=JSON.stringify(r)),i=i.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),n.attr(`${t}${i}`,r)})}function qy(...s){var t;const e=s.length;if(!e)return Fs(this);if(e===1){const[n]=s;return typeof n=="string"?(t=Fs(this))==null?void 0:t[n]:(y.isPlainObject(n)&&Sl(this,n),this)}return Sl(this,{[s[0]]:s[1]}),this}y.fn.z=qy,y.fn._attr=y.fn.attr,y.fn.extend({attr(...s){const[e,t]=s;return!s.length||s.length===1&&typeof e=="string"?this._attr.apply(this,s):typeof e=="object"?(e&&Object.keys(e).forEach(n=>{const i=e[n];i===null?this.removeAttr(n):this._attr(n,i)}),this):t===null?this.removeAttr(e):this._attr(e,t)}}),y.Event||(y.Event=(s,e)=>{const[t,...n]=s.split("."),i=new Event(t,{bubbles:!0,cancelable:!0});return i.namespace=n.join("."),i.___ot=t,i.___td=e,i});const hs=(s,e)=>new Promise(t=>{const n=window.setTimeout(t,s);e&&e(n)}),yd={};y.share=yd;var Qr,He,vd;I.isValidElement=void 0;var us,bd,_d,kl,Tl,Dl,$l,$i={},wd=[],Gy=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eo=Array.isArray;function An(s,e){for(var t in e)s[t]=e[t];return s}function Cd(s){s&&s.parentNode&&s.parentNode.removeChild(s)}function _(s,e,t){var n,i,r,o={};for(r in e)r=="key"?n=e[r]:r=="ref"?i=e[r]:o[r]=e[r];if(arguments.length>2&&(o.children=arguments.length>3?Qr.call(arguments,2):t),typeof s=="function"&&s.defaultProps!=null)for(r in s.defaultProps)o[r]===void 0&&(o[r]=s.defaultProps[r]);return to(s,o,n,i,null)}function to(s,e,t,n,i){var r={type:s,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++vd,__i:-1,__u:0};return i==null&&He.vnode!=null&&He.vnode(r),r}function ue(){return{current:null}}function vn(s){return s.children}function pe(s,e){this.props=s,this.context=e}function js(s,e){if(e==null)return s.__?js(s.__,s.__i+1):null;for(var t;ee&&us.sort(kl));no.__r=0}function kd(s,e,t,n,i,r,o,a,l,c,u){var h,p,m,v,w,x=n&&n.__k||wd,S=e.length;for(t.__d=l,Yy(t,e,x),l=t.__d,h=0;h0?to(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i).__=s,i.__b=s.__b+1,r=null,(a=i.__i=Xy(i,t,o,u))!==-1&&(u--,(r=t[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&h--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a==o-1?h--:a==o+1?h++:(a>o?h--:h++,i.__u|=65536))):i=s.__k[n]=null;if(u)for(n=0;n(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a=0){if((l=e[o])&&!(131072&l.__u)&&i==l.key&&r===l.type)return o;o--}if(a{!t||typeof t!="object"||Object.keys(t).forEach(n=>{let i=t[n];const r=s[n];i!==r&&(r!==void 0&&(n==="className"||n.endsWith("Class")?i=[r,i]:n==="children"?i=[...so(r),...so(i)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(i=y.extend(r,i))),s[n]=i)})}),s}function El(s){return Object.keys(s).forEach(e=>{s[e]===void 0&&delete s[e]}),s}function Ed(s,e=!0){const t=y(s),n=t[0],i="zui-disable-scroll";if(e){if(t.data(i))return;if((t.css("scrollbar-gutter")||"").includes("stable")){t.data(i,{overflow:t.css("overflow")}).css("overflow","hidden");return}const r=n===document.body||t.is("html")?window.innerWidth-document.body.clientWidth:n.offsetWidth-n.clientWidth;if(!r)return;const o=t.css("paddingRight")||"0";t.data(i,{paddingRight:o,overflow:t.css("overflow")}).css({paddingRight:`${r+Number.parseInt(o,10)}px`,overflow:"hidden"})}else{const r=t.data(i);if(!r)return;t.css(r).removeData(i)}}y.fn.disableScroll=function(s=!0){return this.each((e,t)=>{Ed(t,s)})},y.fn.enableScroll=function(s=!0){return this.disableScroll(!s)};function Ml(s,e,t){if(!(t.on||"click").split(" ").includes(e.type))return;const n=t.selector?y(e.target).closest(t.selector):s;if(!n.length)return;const i=c=>c===""?!0:c,r=c=>{if(typeof c=="string")try{c=JSON.parse(c)}catch{}return c};if(i(t.once)){if(t.onceCalled)return;s.dataset("once-called",!0)}if(i(t.prevent)&&e.preventDefault(),i(t.stop)&&e.stopPropagation(),i(t.self)&&e.currentTarget!==e.target)return;const o=[["$element",s],["event",e],["options",t],["$target",n]],a=c=>typeof c=="function"?c(...o):y.runJS(c,...o);if(t.if!==void 0&&!a(t.if))return;const l=t.call;if(l){let c;if(typeof l=="string"?c=/^[$A-Z_][0-9A-Z_$.]*$/i.test(l)?ki(window,l):a(l):c=l,typeof c=="function"){const u=[],h=t.params;t.params=u,typeof h=="string"&&h.length?h[0]==="["?u.push(...r(h)):u.push(...h.split(", ").map(p=>(p=p.trim(),p==="$element"?s:p==="event"?e:p==="options"?t:p.startsWith("$element.")||p.startsWith("event.")||p.startsWith("options.")?a(p):r(p)))):Array.isArray(h)?u.push(...h):u.push(h),c(...u)}}t.do&&a(t.do)}function Qy(s){const e=y(this),t=s.type,n=e.attr("zui-on");if(n){const[o,a]=n.split("~").map(l=>l.trim());o&&o.split(" ").includes(t)&&Ml(e,s,y.extend({on:o},a?a.startsWith("{")?cs(a):{do:a}:Fs(e,{prefix:"data-",evalValue:["call","if","do"]})))}const i=e.attr(`zui-on-${t}`);i&&Ml(e,s,y.extend({on:t},i.startsWith("{")?cs(i):{do:i}));const r=e.attr("data-on");r&&r.split(" ").includes(t)&&Ml(e,s,Fs(e,{prefix:"data-",evalValue:["call","if","do"]}))}function Md(s){y(document).off(".zui.global").on(s.map(e=>`${e}.zui.global`).join(" "),`[zui-on],${s.map(e=>`[zui-on-${e}]`)},[data-on]`,Qy)}y(()=>{Md(["click","change","inited"])});function fs(s,e){if(typeof s=="function")return fs(s(...e||[]));if(typeof s=="number")return[s];let t=s.match(/(\d+)(%|px)?/);return t?[parseInt(t[1]),t[2]]:(t=s.match(/(\d+)\/(\d+)/),t?[100*parseInt(t[1])/parseInt(t[2]),"%"]:[NaN])}function qe(s,e){if(s==null)return null;const[t,n="px"]=fs(s,e);return Number.isNaN(t)?typeof s=="string"?s:null:`${t}${n}`}async function Bs(s,e){var n,i,r;if(s instanceof Blob){const o=document.createElement("a");return o.href=window.URL.createObjectURL(s),e&&(o.download=decodeURIComponent(e)),o.click(),o.remove(),s}if(s instanceof Response){const o=await s.blob();return e=e||((r=(i=(n=s.headers.get("Content-Disposition"))==null?void 0:n.split(";")[1])==null?void 0:i.split("=")[1])==null?void 0:r.replace(/"/g,"")),Bs(o,e)}const t=await fetch(s);return Bs(t)}class Ad{constructor(e){this._$target=y(e)}on(...e){return this._$target.on(...e),this}one(...e){return this._$target.one(...e),this}off(...e){return this._$target.off(...e),this}trigger(...e){return this._$target.trigger(...e),this}}const nn=new Ad(document);y.bus=nn,y.on=nn.on.bind(nn),y.one=nn.one.bind(nn),y.off=nn.off.bind(nn),y.trigger=nn.trigger.bind(nn);var ev=["Shift","Meta","Alt","Control"],Pd=typeof navigator=="object"?navigator.platform:"",Ld=/Mac|iPod|iPhone|iPad/.test(Pd),tv=Ld?"Meta":"Control",nv=Pd==="Win32"?["Control","Alt"]:Ld?["Alt"]:[];function Al(s,e){return typeof s.getModifierState=="function"&&(s.getModifierState(e)||nv.includes(e)&&s.getModifierState("AltGraph"))}function sv(s){return s.trim().split(" ").map(function(e){var t=e.split(/\b\+/),n=t.pop();return[t=t.map(function(i){return i==="$mod"?tv:i}),n]})}function Rd(s,e){var t;e===void 0&&(e={});var n=(t=e.timeout)!=null?t:1e3,i=Object.keys(s).map(function(a){return[sv(a),s[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(i.forEach(function(l){var c=l[0],u=l[1],h=r.get(c)||c;(function(p,m){return!(m[1].toUpperCase()!==p.key.toUpperCase()&&m[1]!==p.code||m[0].find(function(v){return!Al(p,v)})||ev.find(function(v){return!m[0].includes(v)&&m[1]!==v&&Al(p,v)}))})(a,h[0])?h.length>1?r.set(c,h.slice(1)):(r.delete(c),u(a)):Al(a,a.key)||r.delete(c)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function iv(s,e,t){var n;t===void 0&&(t={});var i=(n=t.event)!=null?n:"keydown",r=Rd(e,t);return s.addEventListener(i,r),function(){s.removeEventListener(i,r)}}function Pl(s,e={}){if(!s)return;const t=Object.keys(e).reduce((n,i)=>(e[i].optional||(n[i]={...e[i]}),n),{});return Object.keys(s).forEach(n=>{const i=s[n];i?i===!0?e[n]&&(t[n]={...e[n]}):t[n]=i:delete t[n]}),Object.keys(t).reduce((n,i)=>{const{keys:r,handler:o}=t[i];return typeof r=="string"?n[r]=o:r.forEach(a=>{n[a]=o}),n},{})}function Ll(s,e,t){const{timeout:n,event:i="keydown",scope:r,when:o}=t||{},a=Rd(e,{timeout:n}),l=`.zui.hotkeys${r?`.${r}`:""}`,c="zui-hotkeys-composing";return y(s).on(`${i}${l}`,function(u){o&&o(u)===!1||y(u.target).data(c)||a(u)}).on(`compositionstart${l}`,u=>{y(u.target).data(c,!0)}).on(`compositionend${l}`,u=>{y(u.target).removeData(c)})}function Rl(s,e){return y(s).off(`.zui.hotkeys${e?`.${e}`:""}`)}const rv=iv;y.fn.hotkeys=function(s,e){return Ll(this,s,e)},y.fn.unbindHotkeys=function(s){return Rl(this,s)},y.hotkeys=function(s,e){Ll(window,s,e)},y.unbindHotkeys=function(s){Rl(window,s)};function ro(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function Od(s){(typeof s=="string"||s instanceof Element||s instanceof y)&&(s={target:s});const{target:e,onError:t,onSuccess:n,afterExit:i,afterEnter:r}=s,o=y(e),a=o[0];if(!a)return;const l=a.requestFullscreen||a.webkitRequestFullscreen||a.mozRequestFullScreen;if(!l){t==null||t.call(a,new Error("[ZUI] The browser does not support full screen feature."));return}try{await l.call(a),n==null||n.call(a),y(a).off(".zui.fullscreen"),i&&o.on("exitFullscreen.zui.fullscreen",i),r&&o.on("enterFullscreen.zui.fullscreen",r)}catch(c){t==null||t.call(a,c)}document.zuiBindFullscreenChange||(document.zuiBindFullscreenChange=!0,y(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui",c=>{const u=ro();let h=u;u?y(u).addClass("is-in-fullscreen"):(h=y(document).find(".is-in-fullscreen")[0]||document,y(h).removeClass("is-in-fullscreen")),y("body").toggleClass("has-in-fullscreen",!!u);const p={event:c,target:h,fullscreenElement:u};y(h).trigger(u?"enterFullscreen":"exitFullscreen",p).trigger("toggleFullscreen",p)}))}async function Ol(s){const e=ro();return s===!1&&!!e===s?s:e?(document.exitFullscreen(),!1):(await Od(s),!0)}y.fn.fullscreen=function(s){return Ol({target:this,...s})},y.getFullscreenElement=ro,y.toggleFullscreen=Ol;function Pn(s){return!s||s.parentNode===document?!1:s.parentNode?Pn(s.parentNode):!0}y.isDetached=Pn,y.fn.isDetached=function(){const s=this[0];return!s||Pn(s)};const ps=class Bg{constructor(e,t){var v;this._inited=!1,this._autoDestory=0,this._destroyed=!1;const{KEY:n,DATA_KEY:i,MULTI_INSTANCE:r,NAME:o,ATTR_KEY:a,ALL:l,TYPED_ALL:c}=this.constructor;if(!o)throw new Error('[ZUI] The component must have a "NAME" static property.');const u=y(e);if(u.data(n)&&!r)throw new Error(`[ZUI] The component "${o}" has been initialized on element.`);const h=u[0];if(!h)throw new Error(`[ZUI] Invalid selector "${e}" for component "${o}", can not find the element matched.`);const p=wt();this._gid=p,this._element=h,this.resetOptions(t),this._key=this.options.key??`__${p}`;let m=l.get(h);if(m?m.add(this):(m=new Set([this]),l.set(h,m)),c.has(o)?c.get(o).add(this):c.set(o,new Set([this])),u.data(n,this).attr(a,"").attr(i,`${p}`).attr("z-use",[...new Set([...m].map(w=>w.constructor.NAME))].join(",")),r){const w=`${n}:ALL`;let x=u.data(w);x||(x=new Map,u.data(w,x)),x.set(this._key,this)}this.init(),(v=this.options.$onCreate)==null||v.call(this),requestAnimationFrame(async()=>{var w;this._inited=!0,await this.afterInit(),this.emit("inited",this.options),(w=this.options.$onInited)==null||w.call(this)})}static get ZUI(){return this.NAME.replace(/(^[A-Z]+)/,e=>e.toLowerCase())}static get KEY(){return`zui.${this.NAME}`}static get NAMESPACE(){return`.zui.${this.ZUI}`}static get DATA_KEY(){return`data-zui-${this.NAME}`}static get ATTR_KEY(){return`z-use-${this.NAME}`}static get SELECTOR(){return`[${this.DATA_KEY}]`}get inited(){return this._inited}get destroyed(){return this._destroyed}get element(){return this._element}get key(){return this._key}get options(){return this._options}get gid(){return this._gid}get $element(){return y(this.element)}get $emitter(){return this.$element}get i18nData(){return[this.options.i18n,this.constructor.i18n]}init(){}afterInit(){}render(e,t){this.setOptions(e,t)}destroy(){var m;const{KEY:e,DATA_KEY:t,ALL:n,TYPED_ALL:i,NAME:r,MULTI_INSTANCE:o,ATTR_KEY:a}=this.constructor,{$element:l,element:c}=this;if(this.emit("destroyed"),this._destroyed=!0,l.off(this.namespace).removeData(e).removeAttr(a).removeAttr(t),o){const v=this.$element.data(`${e}:ALL`);if(v)if(v.delete(this._key),v.size===0)this.$element.removeData(`${e}:ALL`);else{const w=v.values().next().value;l.data(e,w).attr(t,String(w==null?void 0:w.gid))}}const u=n.get(c);u&&(u.delete(this),u.size===0&&n.delete(c));const h=i.get(r);h&&(h.delete(this),h.size===0&&i.delete(r));const p=n.get(c);p!=null&&p.size?l.attr("z-use",[...new Set([...p].map(v=>v.constructor.NAME))].join(",")):l.removeAttr("z-use"),(m=this.options.$onDestroy)==null||m.call(this)}autoDestroy(e=100){this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,Pn(this.element)&&this.destroy()},e)}setOptions(e,t){if(t){const n={...this.constructor.DEFAULT,...(e==null?void 0:e.$optionsFromDataset)!==!1?this.$element.dataset():{},...e},{$options:i}=n;if(i){const r=typeof i=="function"?i.call(this,this.element,n):i;r&&y.extend(n,r),delete n.$options}this._options=n}else e&&y.extend(this._options,e);return this._options}resetOptions(e){return this.setOptions(e,!0)}emit(e,...t){const n=y.Event(e);return n.__src=this,this.$emitter.trigger(n,[this,...t]),n}on(e,t,n){const i=this;this.$element[n!=null&&n.once?"one":"on"](this._wrapEvent(e),function(r,o){(!r.__src||r.__src===i)&&t.call(this,r,o)})}one(e,t){this.on(e,t,{once:!0})}off(e){this.$element.off(this._wrapEvent(e))}i18n(e,t,n){const{i18nData:i}=this;return Ee(i,e,t,n,this.options.lang,this.constructor.NAME)??Ee(i,e,t,n,this.options.lang)??`{i18n:${e}}`}get namespace(){return`${this.constructor.NAMESPACE}.${this._key}`}_wrapEvent(e){return e.split(" ").map(t=>t.includes(".")?t:`${t}${this.namespace}`).join(" ")}static get(e,t){const n=y(e);if(this.MULTI_INSTANCE&&t!==void 0){const i=n.data(`${this.KEY}:ALL`);return i?i.get(t):void 0}return n.data(this.KEY)}static isValid(e){return!0}static ensure(e,t){const n=this.get(e,t==null?void 0:t.key);if(n){if(this.isValid(n))return t&&n.setOptions(t),n;n.destroy()}return new this(e,t)}static getAll(e,t){var l;const{SELECTOR:n,ALL:i,TYPED_ALL:r}=this,o=[],a=c=>{c instanceof this&&(!t||t(c)!==!1)&&o.push(c)};return e?y(e).find(n).each((c,u)=>{var h;(h=i.get(u))==null||h.forEach(a)}):this!==Bg?(l=r.get(this.NAME))==null||l.forEach(a):i.forEach(c=>{c.forEach(a)}),o.sort((c,u)=>c.gid-u.gid)}static query(e,t,n){return e===void 0?this.getAll(void 0,n).pop():this.get(y(e).closest(this.SELECTOR),t)}static defineFn(e){let t=e||this.ZUI;y.fn[t]&&(t=`zui${this.NAME}`);const n=this;y.fn.extend({[t](i,...r){const o=typeof i=="object"?i:void 0,a=typeof i=="string"?i:void 0;let l;return this.each((c,u)=>{let h=n.get(u);if(h)o&&h.render(o);else{if(a)return;h=new n(u,o)}if(a){let p=h[a],m=h;p===void 0&&(m=h.$,p=m[a]),typeof p=="function"?l=p.call(m,...r):l=p}}),l!==void 0?l:this}})}static register(e,t){var i,r;e=e||this,t=(t??e.NAME).toLowerCase(),this.map.set(t,e);const n=(r=(i=e.toggle)==null?void 0:i.name)==null?void 0:r.toLowerCase();n&&n!==t&&this.toggleMap.set(n,e)}};ps.DEFAULT={},ps.MULTI_INSTANCE=!1,ps.ALL=new Map,ps.TYPED_ALL=new Map,ps.map=new Map,ps.toggleMap=new Map;let Ue=ps;function Ii(s){return Ue.map.get(s.toLowerCase())}function oo(s,e,t={}){let n=Ii(s);if(n||(n=zl(s)),!n)return null;const{$update:i,...r}=t;if(!n.MULTI_INSTANCE){const o=n.get(e);if(o)return i&&o.render(r,i==="reset"),o}return new n(e,r)}function ov(s,e,t={}){requestAnimationFrame(()=>oo(s,e,t))}function zd(s,e){Ue.register(s,e)}function zl(s){const{zui:e}=window;if(e){s=s==null?void 0:s.toLowerCase();for(const t in e){const n=t.toLowerCase()===s;if(s&&!n)continue;const i=e[t];if(!(typeof i!="function"||!i.NAME||!i.ZUI)&&(Ue.map.has(t.toLowerCase())||zd(i),n))return i}}}function av(s){var e;s?(e=Ii(s))==null||e.defineFn():window._zuiDefined||(zl(),Ue.map.forEach(t=>{t.defineFn()}),Object.assign(window,{_zuiDefined:!0}))}function lv(s,e={}){const t=y(s);let n=t.attr("zui-create");const{update:i,onCreate:r}=e,o=(a,l)=>{if(l={$update:i,$optionsFromDataset:!1,...l},r){const u=r(a,l);if(u===!1)return;u&&(l=u)}const c=l.$lib;if(c){delete l.$lib,y.getLib(c).then(()=>oo(a,s,l));return}ov(a,s,l)};if(typeof n=="string"){n=n.trim();const a=n.length?n.split(",").map(u=>u.trim()):[],l=Fs(s,{prefix:"zui-create-",evalValue:!0}),c=Object.keys(l);if(!c.length&&a.length===1)o(a[0],t.dataset());else{const u=new Set;[...a,...c].forEach(h=>{if(u.has(h))return;const p=l[h];o(h,p),delete l[h],u.add(h)})}}else{const a=t.dataset(),l=a==null?void 0:a.zui;if(!l)return;console.warn("[ZUI] create component instance with [data-zui] is deprecated, use [zui-create] instead.",{element:s,options:e}),delete a.zui,o(l,a)}}function cv(){y(document).on("click.zui.toggle mouseenter.zui.toggle","[data-toggle],[zui-toggle]",function(s){const e=y(this),t=e.dataset("toggle")||e.attr("zui-toggle");if(!t)return;const n=Ue.toggleMap.get(t)||Ii(t),i=n==null?void 0:n.toggle;if(!i)return;const{trigger:r="click",skip:o="[disabled],.disabled",check:a}=i,l=s.type==="mouseover"?"hover":"click";if(!r.includes(l)||a&&!a.call(n,this,l,s)||o&&e.is(o))return;const{onGet:c,onCreate:u,setOptions:h=!0,getOptions:p,prevent:m=!0,handler:v,onToggle:w,convertHref:x}=i;let S=e.dataset();const D=e.attr(`zui-toggle-${t}`);if(D&&(S=y.extend(S,cs(D))),x&&e.is("a")){const P=e.attr("href");if(P){const H=x===!0?{selector:"target",url:"url"}:x;"#.".includes(P[0])?H.selector&&S[H.selector]===void 0&&(S[H.selector]=P):H.url&&S[H.url]===void 0&&(S[H.url]=P)}}if(p&&(S=p.call(n,this,S,s)),v){v.call(n,this,S,l,s),m&&s.preventDefault();return}let M=c?c.call(n,this):n.get(this);if(M)h&&M.setOptions(S);else{const P=u?u.call(n,this,s,S):new n(this,S);if(!P)return;M=P}if(w){if(w.call(n,M,this,s)===!1)return}else{const{shown:P,show:H,hide:q,toggle:Y}=M;let Z;if(Y?Z=Y:H&&q?P?Z=q:Z=H:H&&(Z=H),Z)Z.call(M);else return}m&&s.preventDefault()})}function hv(s,e){const t=Di(s),n=[];return Object.keys(t).forEach(i=>{if(!i.startsWith("zui."))return;const r=t[i];(e==null?void 0:e(r,i))!==!1&&n.push(t[i])}),n}let ao=0;function Fd(s=100){if(ao&&clearTimeout(ao),s){ao=window.setTimeout(()=>Fd(0),s);return}ao=0,Ue.ALL.forEach(e=>{e.forEach(t=>t.autoDestroy())})}function uv(){if(!document.body||Di(document.body,"_autoDestoryMob"))return;const s=new MutationObserver(e=>{let t=!1;for(const n of e)if(n.removedNodes.length){t=!0;break}t&&Fd()});s.observe(document.body,{childList:!0,subtree:!0}),Jr(document.body,"_autoDestoryMob",s)}function Fl(s,e){const t=y(s);t.find("[zui-create],[data-zui]").each(function(){var n;((n=e==null?void 0:e.beforeCreate)==null?void 0:n.call(e,this))!==!1&&lv(this,e)}),t.find("[zui-init]").each(function(){this.hasAttribute("z-zui-inited")||(this.setAttribute("z-zui-inited",""),y.runJS(this.getAttribute("zui-init"),["$element",y(this)]))}),t.find(".hide-before-init").removeClass("invisible hidden opacity-0"),t.find(".scroll-into-view").scrollIntoView(),t.find('[data-on="inited"],[zui-on-inited]').each((n,i)=>{const r=y(i);r.zui()||r.trigger("inited")}),e!=null&&e.runJS&&t.runJS()}y.fn.zuiInit=function(s){return Fl(this,s),this},y.fn.zui=function(s,e){const t=this[0];if(!t)return;if(typeof s!="string"){const i={};let r;return hv(t,(o,a)=>{i[a]=o,(!r||r.gid1?t[0]:void 0,i=t[t.length>1?1:0],r=y(this).zui(n),o=r==null?void 0:r[i];typeof o=="function"&&o.apply(r,e)}),this},y(()=>{y("body").zuiInit({update:!0}),cv(),uv()});class lo extends Ue{get $targets(){const{$element:e}=this,{targets:t}=this.options;return t?e.find(t):e}_handleScroll(e,t,n){const{offset:i=1}=this.options,r=this.$targets,o=e.getBoundingClientRect(),{scrollTop:a,scrollLeft:l}=e;r.each((c,u)=>{const h=u.getBoundingClientRect(),p=t==="top"&&a>0&&h.top<=o.top+i||t==="bottom"&&h.bottom>=o.bottom-i||t==="left"&&l>0&&h.left<=o.left+i||t==="right"&&l{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{this._raf=0,this._handleScroll(l,t,i)})};this._scrollListener=c,l.addEventListener("scroll",c)}this._container=l,requestAnimationFrame(()=>{this._handleScroll(l,t,i)})}else this._ob=new IntersectionObserver(l=>{l.forEach(c=>{c.target.classList.toggle(i,c.intersectionRatiothis._ob.observe(c))}destroy(){var e;(e=this._ob)==null||e.disconnect(),this._container&&(this._container.removeEventListener("scroll",this._scrollListener),this._raf&&cancelAnimationFrame(this._raf))}}lo.NAME="Sticky";const Hs=24*60*60*1e3,We=s=>s===void 0?new Date:(s instanceof Date||(typeof s=="string"&&(s=s.trim(),/^\d+$/.test(s)&&(s=Number.parseInt(s,10))),typeof s=="number"&&s<1e10&&(s*=1e3),s=new Date(s)),s),jd=(s,e,t="day")=>{if(typeof e=="string"){const n=Number.parseInt(e,10);t=e.replace(n.toString(),""),e=n}return s=new Date(We(s).getTime()),t==="month"?s.setMonth(s.getMonth()+e):t==="year"?s.setFullYear(s.getFullYear()+e):t==="week"?s.setDate(s.getDate()+e*7):t==="hour"?s.setHours(s.getHours()+e):t==="minute"?s.setMinutes(s.getMinutes()+e):t==="second"?s.setSeconds(s.getSeconds()+e):s.setDate(s.getDate()+e),s},Ln=(s,e=new Date)=>We(s).toDateString()===We(e).toDateString(),Ni=(s,e=new Date)=>We(s).getFullYear()===We(e).getFullYear(),jl=(s,e=new Date)=>(s=We(s),e=We(e),s.getFullYear()===e.getFullYear()&&s.getMonth()===e.getMonth()),dv=(s,e=new Date)=>{s=We(s),e=We(e);const t=1e3*60*60*24,n=Math.floor(s.getTime()/t),i=Math.floor(e.getTime()/t);return Math.floor((n+4)/7)===Math.floor((i+4)/7)},fv=(s,e)=>Ln(We(e),s),pv=(s,e)=>Ln(We(e).getTime()-Hs,s),mv=(s,e)=>Ln(We(e).getTime()+Hs,s),Bl=s=>s!=null&&!isNaN(We(s).getTime()),Je=(s,e="yyyy-MM-dd hh:mm",t="")=>{if(s=We(s),!Bl(s))return t;if(typeof e=="function")return e(s);const n={"M+":s.getMonth()+1,"d+":s.getDate(),"h+":s.getHours(),"H+":s.getHours()%12,"m+":s.getMinutes(),"s+":s.getSeconds(),"S+":s.getMilliseconds()};return/(y+)/i.test(e)&&(e.includes("[yyyy-]")&&(e=e.replace("[yyyy-]",Ni(s)?"":"yyyy-")),e=e.replace(RegExp.$1,`${s.getFullYear()}`.substring(4-RegExp.$1.length))),Object.keys(n).forEach(i=>{if(new RegExp(`(${i})`).test(e)){const r=`${n[i]}`;e=e.replace(RegExp.$1,RegExp.$1.length===1?r:`00${r}`.substring(r.length))}}),e},gv=(s,e,t)=>{const n={full:"yyyy-M-d",month:"M-d",day:"d",str:"{0} ~ {1}",...t},i=Je(s,Ni(s)?n.month:n.full);if(Ln(s,e))return i;const r=Je(e,Ni(s,e)?jl(s,e)?n.day:n.month:n.full);return n.str.replace("{0}",i).replace("{1}",r)};function Hl(s){let e=0;if(typeof s!="string"&&(s=String(s)),s&&s.length)for(let t=0;t{try{a.includes("%")&&(a=decodeURIComponent(a)),a=JSON.parse(a)}catch{}return[o,a]})),params:n.map(o=>{if(o!=="undefined"){if(o==="null")return null;try{return o.includes("%")&&(o=decodeURIComponent(o)),JSON.parse(o)}catch{return o}}})}}function Bd(s){if(Array.isArray(s))return{commands:s.map(co).filter(Boolean)};if(typeof s=="object")return s;s=s.replace(/^#!?/,"");const e=s.includes(">"),t=s.split(e?">":"|").map(co);return{async:e,commands:t.filter(Boolean)}}function Ul(s,e,t){if(typeof s=="string"&&(s=co(s)),!s)return;const{execute:n,event:i,scope:r}=e;if(!(r&&s.scope&&s.scope!==r))return n({name:s.name,options:{...e.options,...s.options},event:i,scope:s.scope,prevResult:t},s.params)}async function Hd(s,e){const{async:t,commands:n}=Bd(s);if(!n.length)return[];const{signal:i}=e;if(t){const o=[];let a;for(const l of n){if(!(i!=null&&i.aborted))break;a=await Ul(l,e,a),i!=null&&i.aborted&&(a=void 0),o.push(a)}return o}return await Promise.all(n.map(o=>{if(!(i!=null&&i.aborted))return Ul(o,e)}))}const Us="zui.commands",Ws="z-commands",Wl="zui-commands-proxy",Ud="zui-command",ho={};function Wd(s,e){typeof s=="string"&&e?ho[s]=e:typeof s=="object"&&Object.assign(ho,s)}function uo(s,e){typeof e=="string"?e={scope:e}:typeof e=="function"&&(e={onCommand:e});const{scope:t="",events:n="click"}=e??{},i=y(s),r=(i.attr(Ws)||"").split(",");t&&!r.includes(t)&&r.push(t),i.attr(Ws,r.join(",")).data(Us,{[t]:{...e,scope:t,events:n,gid:wt()},...i.data(Us)})}function fo(s,e=!0){const t=y(s);if(e===!0)t.removeAttr(Ws),t.removeData(Us);else if(e.length){const n=t.data(Us)||{};e.split(",").forEach(r=>{delete n[r]});const i=Object.keys(n);i.length?t.attr(Ws,i.join(",")).data(Us,uo):fo(t,!0)}}function Vd(s,e){let t=s.closest(`[${Ws}],[${Wl}]`).first();if(t.attr(Wl)!==void 0&&(t=y(t.data("zui.commandProxy")||t.attr(Wl)).closest(`[${Ws}]`)),!t.length)return;const n=t.data(Us)||{},i=Object.values(n).sort((o,a)=>a.gid-o.gid);let r;return e!=null&&e.length?(r=i.find(o=>o.scope===e),r||(r=i.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped})),r):(r=i.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped}),r||(r=i.find(o=>!o.scoped)),r?r.element=t[0]:r=Vd(s.parent(),e),r)}function yv(s){if(!s.currentTarget)return;const e=y(s.currentTarget);if(e.closest(".disabled,[disabled]").length)return;const t=e.attr(Ud)||(e.is('a[href^="#!"]')?e.attr("href"):"");if(!t)return;const n=new AbortController,i=()=>n.abort();Hd(t,{signal:n.signal,execute:(r,o)=>{const{scope:a,name:l}=r,c={...r,abort:i};let u;const h=Vd(e,a);if(h){c.element=h.element;const m=(h.commands?h.commands[`${a}~${l}`]||h.commands[l]:null)||h.onCommand;if(m&&(u=m(c,o),s.commandHandled))return u}const p=[c,o];if(e.trigger("command",p).trigger(`command:${a?`${l}.${a}`:l}`,p),a&&e.trigger(`command:.${a}`,p),s.commandHandled)return u;if(a==="event"){l==="stop"?s.stopPropagation():l==="prevent"?s.preventDefault():Mn(s,l,o);return}return a==="window"?Mn(window,l,o):a==="zui"?Mn(window.zui,l,o):a==="target"?Mn(e[0],l,o):a==="$target"?Mn(e,l,o):a==="$"?Mn(y,l,o):a===""&&ho[l]!==void 0?ho[l](c,o):u},event:s})}y.fn.command=function(s,e){return this.on(`command:${s}`,e)},y.fn.offCommand=function(s,e){return this.off(`command:${s}`,e)},y.fn.commands=function(s){return this.each((e,t)=>uo(t,s)),this},y.fn.unbindCommands=function(s){return this.each((e,t)=>fo(t,s)),this},y(()=>{y(document).on("click.zui.command",`[${Ud}],a[href^="#!"]`,yv)});function Ei(s,e,t=!1){var i;const n=y(s);if(e!==void 0){if(typeof e=="string"&&e.length){const r=`zui-runjs-${wt()}`;n.append(`