diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index 5bf441eb46..f63d5be09b 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -2,11 +2,11 @@ var bu=(I,tt,It)=>{if(!tt.has(I))throw TypeError("Cannot "+It)};var Dt=(I,tt,It) `))}`}const fy=/file|reset|submit|button|image/i,Gu=/radio|checkbox/i;ie.serialize=function(){let i="";return this.each((e,t)=>{dt(t.elements||[t],(n,s)=>{if(s.disabled||!s.name||s.tagName==="FIELDSET"||fy.test(s.type)||Gu.test(s.type)&&!s.checked)return;const r=Ou(s);if(!Nt(r)){const o=zr(r)?r:[r];dt(o,(a,l)=>{i+=dy(s.name,l)})}})}),i.slice(1)},window.$=y;function Yu(i,e){if(i==null)return[i,void 0];typeof e=="string"&&(e=e.split("."));const t=e.join(".");let n=i;const s=[n];for(;typeof n=="object"&&n!==null&&e.length;){let r=e.shift(),o;const a=r.indexOf("[");if(a>0&&a{const s=t[n]??"";i=i.replace(new RegExp(`\\{${n}\\}`,"g"),`${s}`)}),i}for(let t=0;t(i[i.B=1]="B",i[i.KB=1024]="KB",i[i.MB=1048576]="MB",i[i.GB=1073741824]="GB",i[i.TB=1099511627776]="TB",i))(fl||{});function pt(i,e=2,t){return Number.isNaN(i)?"?KB":(t||(i<1024?t="B":i<1048576?t="KB":i<1073741824?t="MB":i<1099511627776?t="GB":t="TB"),(i/fl[t]).toFixed(e)+t)}const mn=i=>{const e=/^[0-9]*(B|KB|MB|GB|TB)$/;i=i.toUpperCase(),i.endsWith("B")||(i+="B");const t=i.match(e);if(!t)return 0;const n=t[1];return i=i.replace(n,""),Number.parseInt(i,10)*fl[n]};let pl=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),gn;function Qu(){return pl}function py(i){pl=i.toLowerCase().replace("-","_")}function Ju(i,e){gn||(gn={}),typeof i=="string"&&(i={[i]:e??{}}),y.extend(!0,gn,i)}function Ne(i,e,t,n,s,r){Array.isArray(i)?gn&&i.unshift(gn):i=gn?[gn,i]:[i],typeof t=="string"&&(r=s,s=n,n=t,t=void 0);const o=s||pl;let a;for(const l of i){if(!l)continue;const c=l[o]||l.default;if(!c)continue;const d=r&&l===gn?`${r}.${e}`:e;if(a=Cs(c,d),a!==void 0)break}return a===void 0?n:t?be(a,...Array.isArray(t)?t:[t]):a}function my(i,e,t,n){return Ne(void 0,i,e,t,n)}Ne.addLang=Ju,Ne.getLang=my,Ne.getCode=Qu,Ne.setCode=py,Ne.map=gn,Ju({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 Xu(i,e,t){i instanceof Headers?i.set(e,t):Array.isArray(i)?i.push([e,t]):i[e]=t}function Ei(i,e,t){t!=null&&(Array.isArray(t)?t.forEach(n=>Ei(i,e,n)):!(t instanceof Blob)&&y.isPlainObject(t)?Object.entries(t).forEach(([n,s])=>{Ei(i,`${e}[${n}]`,s)}):i.append(e,t instanceof Blob?t:String(t)))}function gy(i,e){if(i){const t={text:"text/plain",html:"text/html",json:"application/json",...e};for(const[n,s]of Object.entries(t))if(s.split(",").map(r=>r.trim()).includes(i))return n}return"text"}function Ur(i,e){const t=e||new FormData;return i&&(typeof i=="string"&&(i=new URLSearchParams(i)),i instanceof URLSearchParams?i.forEach((n,s)=>{Ei(t,s,n)}):Array.isArray(i)?i.forEach(([n,s])=>{Ei(t,n,s)}):i instanceof FormData?i.forEach((n,s)=>{Ei(t,s,n)}):y.isPlainObject(i)&&Object.entries(i).forEach(([n,s])=>{Ei(t,n,s)})),t}class xs{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:s=!0,contentType:r,crossDomain:o,accepts:a,dataType:l,timeout:c,dataFilter:d,beforeSend:u,success:p,error:g,complete:_,...C}=this.setting;t&&(C.method=t);let x=n;x&&(s&&(x=Ur(x)),C.body=x),o&&(C.mode="cors");const k=C.headers||{};Xu(k,"X-Requested-With","XMLHttpRequest"),r&&Xu(k,"Content-Type",r),C.headers=k,C.signal&&C.signal.addEventListener("abort",()=>{this.abort()});const $=[...this.constructor.globalBeforeSends,u];for(const E of $){if(!E)continue;const z=E.call(this,C);if(z===!1)return;z&&Object.assign(C,z)}p&&this.success(p),g&&this.fail(g),_&&this.complete(_),C.signal=this._controller.signal,this.url=e,this.request=C}_emit(e,...t){this._callbacks[e].forEach(n=>{n.call(this,...t)})}async send(){var d;if(this.completed)return[];this._init();const{timeout:e,dataType:t,accepts:n,dataFilter:s,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:u}=a;if(a.ok){const p=(d=a.headers.get("Content-Disposition"))==null?void 0:d.startsWith("attachment"),g=p?"blob":t||gy(a.headers.get("Content-Type"),n);p||g==="blob"||g==="file"?c=await a.blob():g==="json"?typeof o=="function"?(c=await a.text(),c=o(c)):c=await a.json():c=await a.text(),this.data=c;const _=(s==null?void 0:s(c,g))??c;this._emit("success",_,u,a)}else throw this.data=await a.text(),new Error(u)}catch(u){this.data===void 0&&c!==void 0&&(this.data=c),l=u;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]}}xs.globalBeforeSends=[],y.ajax=(i,e)=>{e=e||{},typeof i=="string"?e.url=i:y.extend(e,i);const t=new xs(e);return t.send(),t},y.getJSON=(i,e,t)=>(typeof e=="function"&&(t=e,e=void 0),y.ajax({url:i,data:e,success:t,dataType:"json"})),y.get=(i,e,t,n,s="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:s,url:i,data:o,success:r,dataType:n})},y.post=(i,e,t,n)=>y.get(i,e,t,n,"POST"),y.fn.load=function(i,e,t){typeof e=="function"&&(t=e,e=void 0);const[n,s]=i.split(" ");return y.get(n,e,(r,o,a)=>{s&&(r=y(r).find(s).html()),y(this).html(r).zuiInit(),t==null||t.call(this,r,o,a)},"html"),this};async function mt(i,e=[],t,n,s){const r={throws:!0,dataType:"json"};if(typeof i=="string")r.url=i;else if(typeof i=="object")y.extend(r,i);else if(typeof i=="function"){const l=i.call(n,...e);return l instanceof Promise?await l:l}t&&y.extend(r,typeof t=="function"?t(r):t),r.url&&(r.url=be(r.url,...e));const o=new xs(r);s==null||s(o);const[a]=await o.send();return a}function ml(i){return!!(i&&(typeof i=="string"||typeof i=="object"&&i.url||typeof i=="function"))}y.fetch=mt;function wt(){return y.guid++}function Vr(i,e){if(i===e)return!1;if(i&&e){const t=typeof i,n=typeof e;if(t!==n)return!0;if(t==="object"&&n==="object"){const s=Array.isArray(i),r=Array.isArray(e);if(s!==r)return!0;if(s&&r){if(i.length!==e.length)return!0;for(let l=0;ln instanceof ri?n.value!==t[s]:Vr(n,t[s])))&&(this._value=this._compute(),this._lastDependencies=e.map(n=>n instanceof ri?n.cache:n)),this._value}}function gl(...i){const e=[],t=new Map,n=(s,r)=>{if(Array.isArray(s)&&(r=s[1],s=s[0]),!s.length)return;const o=t.get(s);typeof o=="number"?e[o][1]=!!r:(t.set(s,e.length),e.push([s,!!r]))};return i.forEach(s=>{typeof s=="function"&&(s=s()),Array.isArray(s)?gl(...s).forEach(n):s&&typeof s=="object"?Object.entries(s).forEach(n):typeof s=="string"&&s.split(" ").forEach(r=>n(r,!0))}),e.sort((s,r)=>(t.get(s[0])||0)-(t.get(r[0])||0))}const V=(...i)=>gl(...i).reduce((e,[t,n])=>(n&&e.push(t),e),[]).join(" ");y.classes=V,y.fn.setClass=function(i,...e){return this.each((t,n)=>{const s=y(n);i===!0?s.attr("class",V(s.attr("class"),...e)):s.addClass(V(i,...e))})};const Ai=new WeakMap;function Kr(i,e,t){const n=Ai.has(i),s=n?Ai.get(i):{};typeof e=="string"?s[e]=t:e===null?Object.keys(s).forEach(r=>{delete s[r]}):Object.assign(s,e),Object.keys(s).forEach(r=>{s[r]===void 0&&delete s[r]}),Object.keys(s).length?(!n&&i instanceof Element&&Object.assign(s,y(i).dataset(),s),Ai.set(i,s)):Ai.delete(i)}function ks(i,e,t){let n=Ai.get(i)||{};return t&&i instanceof Element&&(n=Object.assign({},y(i).dataset(),n)),e===void 0?n:n[e]}function yy(i){Ai.delete(i)}y.fn.dataset=y.fn.data,y.fn.data=function(...i){const[e,t]=i;return!i.length||i.length===1&&typeof e=="string"?this.length?ks(this[0],e,!0):void 0:this.each((n,s)=>Kr(s,e,t))},y.fn.removeData=function(i=null){return this.each((e,t)=>Kr(t,i))};function oi(i,...e){return i.includes("RAWJS")&&(i=i.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` `)),new Function(`return ${i}`)(...e)}function yl(i,...e){return i.includes("RAWJS")?oi(i,...e):JSON.parse(i)}function vy(i){return JSON.stringify(i,(e,t)=>{if(typeof t=="function")return`RAWJS<${t.toString().split('"').join("").split(` `).join("")}>RAWJS`})}function Pi(i,e){const t=y(i)[0];if(!t)return;const{prefix:n,getter:s,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,d)=>{let{name:u}=d;const{value:p}=d;let g=p;if(u.startsWith(n)){if(u=u.slice(n.length).replace(/-([a-z])/g,_=>_[1].toUpperCase()),s)g=s(u,p);else try{r&&(!l||l.has(u))||r===void 0&&p.includes("RAWJS")?g=oi(p,...a):o&&(g=JSON.parse(p))}catch{}c[u]=g}return c},{})}function vl(i,e,t="z-"){const n=y(i);Object.keys(e).forEach(s=>{let r=e[s];typeof r=="function"&&(r=`RAWJS<${r}>RAWJS`),typeof r!="string"&&(r=JSON.stringify(r)),s=s.replace(/[A-Z]/g,o=>`-${o.toLowerCase()}`),n.attr(`${t}${s}`,r)})}function _y(...i){var t;const e=i.length;if(!e)return Pi(this);if(e===1){const[n]=i;return typeof n=="string"?(t=Pi(this))==null?void 0:t[n]:(y.isPlainObject(n)&&vl(this,n),this)}return vl(this,{[i[0]]:i[1]}),this}y.fn.z=_y,y.fn._attr=y.fn.attr,y.fn.extend({attr(...i){const[e,t]=i;return!i.length||i.length===1&&typeof e=="string"?this._attr.apply(this,i):typeof e=="object"?(e&&Object.keys(e).forEach(n=>{const s=e[n];s===null?this.removeAttr(n):this._attr(n,s)}),this):t===null?this.removeAttr(e):this._attr(e,t)}}),y.Event||(y.Event=(i,e)=>{const[t,...n]=i.split("."),s=new Event(t,{bubbles:!0,cancelable:!0});return s.namespace=n.join("."),s.___ot=t,s.___td=e,s});const ai=(i,e)=>new Promise(t=>{const n=window.setTimeout(t,i);e&&e(n)}),Zu={};y.share=Zu;var qr,ze,ed;I.isValidElement=void 0;var li,td,nd,_l,bl,wl,Cl,Ss={},id=[],by=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Gr=Array.isArray;function En(i,e){for(var t in e)i[t]=e[t];return i}function sd(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function b(i,e,t){var n,s,r,o={};for(r in e)r=="key"?n=e[r]:r=="ref"?s=e[r]:o[r]=e[r];if(arguments.length>2&&(o.children=arguments.length>3?qr.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)o[r]===void 0&&(o[r]=i.defaultProps[r]);return Yr(i,o,n,s,null)}function Yr(i,e,t,n,s){var r={type:i,props:e,key:t,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:s??++ed,__i:-1,__u:0};return s==null&&ze.vnode!=null&&ze.vnode(r),r}function de(){return{current:null}}function yn(i){return i.children}function pe(i,e){this.props=i,this.context=e}function Li(i,e){if(e==null)return i.__?Li(i.__,i.__i+1):null;for(var t;ee&&li.sort(_l));Qr.__r=0}function ad(i,e,t,n,s,r,o,a,l,c,d){var u,p,g,_,C,x=n&&n.__k||id,k=e.length;for(t.__d=l,wy(t,e,x),l=t.__d,u=0;u0?Yr(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=i,s.__b=i.__b+1,r=null,(a=s.__i=Cy(s,t,o,d))!==-1&&(d--,(r=t[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&u--,typeof s.type!="function"&&(s.__u|=65536)):a!==o&&(a==o-1?u--:a==o+1?u++:(a>o?u--:u++,s.__u|=65536))):s=i.__k[n]=null;if(d)for(n=0;n(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a=0){if((l=e[o])&&!(131072&l.__u)&&s==l.key&&r===l.type)return o;o--}if(a{!t||typeof t!="object"||Object.keys(t).forEach(n=>{let s=t[n];const r=i[n];s!==r&&(r!==void 0&&(n==="className"||n.endsWith("Class")?s=[r,s]:n==="children"?s=[...Jr(r),...Jr(s)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(s=y.extend(r,s))),i[n]=s)})}),i}function Sl(i){return Object.keys(i).forEach(e=>{i[e]===void 0&&delete i[e]}),i}function fd(i,e=!0){const t=y(i),n=t[0],s="zui-disable-scroll";if(e){if(t.data(s))return;if((t.css("scrollbar-gutter")||"").includes("stable")){t.data(s,{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(s,{paddingRight:o,overflow:t.css("overflow")}).css({paddingRight:`${r+Number.parseInt(o,10)}px`,overflow:"hidden"})}else{const r=t.data(s);if(!r)return;t.css(r).removeData(s)}}y.fn.disableScroll=function(i=!0){return this.each((e,t)=>{fd(t,i)})},y.fn.enableScroll=function(i=!0){return this.disableScroll(!i)};function Tl(i,e,t){if(!(t.on||"click").split(" ").includes(e.type))return;const n=t.selector?y(e.target).closest(t.selector):i;if(!n.length)return;const s=c=>c===""?!0:c,r=c=>{if(typeof c=="string")try{c=JSON.parse(c)}catch{}return c};if(s(t.once)){if(t.onceCalled)return;i.dataset("once-called",!0)}if(s(t.prevent)&&e.preventDefault(),s(t.stop)&&e.stopPropagation(),s(t.self)&&e.currentTarget!==e.target)return;const o=[["$element",i],["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)?Cs(window,l):a(l):c=l,typeof c=="function"){const d=[],u=t.params;t.params=d,typeof u=="string"&&u.length?u[0]==="["?d.push(...r(u)):d.push(...u.split(", ").map(p=>(p=p.trim(),p==="$element"?i:p==="event"?e:p==="options"?t:p.startsWith("$element.")||p.startsWith("event.")||p.startsWith("options.")?a(p):r(p)))):Array.isArray(u)?d.push(...u):d.push(u),c(...d)}}t.do&&a(t.do)}function Sy(i){const e=y(this),t=i.type,n=e.attr("zui-on");if(n){const[o,a]=n.split("~").map(l=>l.trim());o&&o.split(" ").includes(t)&&Tl(e,i,y.extend({on:o},a?a.startsWith("{")?oi(a):{do:a}:Pi(e,{prefix:"data-",evalValue:["call","if","do"]})))}const s=e.attr(`zui-on-${t}`);s&&Tl(e,i,y.extend({on:t},s.startsWith("{")?oi(s):{do:s}));const r=e.attr("data-on");r&&r.split(" ").includes(t)&&Tl(e,i,Pi(e,{prefix:"data-",evalValue:["call","if","do"]}))}function pd(i){y(document).off(".zui.global").on(i.map(e=>`${e}.zui.global`).join(" "),`[zui-on],${i.map(e=>`[zui-on-${e}]`)},[data-on]`,Sy)}y(()=>{pd(["click","change","inited"])});function hi(i,e){if(typeof i=="function")return hi(i(...e||[]));if(typeof i=="number")return[i];let t=i.match(/(\d+)(%|px)?/);return t?[parseInt(t[1]),t[2]]:(t=i.match(/(\d+)\/(\d+)/),t?[100*parseInt(t[1])/parseInt(t[2]),"%"]:[NaN])}function Ve(i,e){if(i==null)return null;const[t,n="px"]=hi(i,e);return Number.isNaN(t)?typeof i=="string"?i:null:`${t}${n}`}async function Ts(i,e){var n,s,r;if(i instanceof Blob){const o=document.createElement("a");return o.href=window.URL.createObjectURL(i),e&&(o.download=decodeURIComponent(e)),o.click(),o.remove(),i}if(i instanceof Response){const o=await i.blob();return e=e||((r=(s=(n=i.headers.get("Content-Disposition"))==null?void 0:n.split(";")[1])==null?void 0:s.split("=")[1])==null?void 0:r.replace(/"/g,"")),Ts(o,e)}const t=await fetch(i);return Ts(t)}class md{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 Zt=new md(document);y.bus=Zt,y.on=Zt.on.bind(Zt),y.one=Zt.one.bind(Zt),y.off=Zt.off.bind(Zt),y.trigger=Zt.trigger.bind(Zt);var Ty=["Shift","Meta","Alt","Control"],gd=typeof navigator=="object"?navigator.platform:"",yd=/Mac|iPod|iPhone|iPad/.test(gd),$y=yd?"Meta":"Control",Dy=gd==="Win32"?["Control","Alt"]:yd?["Alt"]:[];function $l(i,e){return typeof i.getModifierState=="function"&&(i.getModifierState(e)||Dy.includes(e)&&i.getModifierState("AltGraph"))}function Iy(i){return i.trim().split(" ").map(function(e){var t=e.split(/\b\+/),n=t.pop();return[t=t.map(function(s){return s==="$mod"?$y:s}),n]})}function vd(i,e){var t;e===void 0&&(e={});var n=(t=e.timeout)!=null?t:1e3,s=Object.keys(i).map(function(a){return[Iy(a),i[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(s.forEach(function(l){var c=l[0],d=l[1],u=r.get(c)||c;(function(p,g){return!(g[1].toUpperCase()!==p.key.toUpperCase()&&g[1]!==p.code||g[0].find(function(_){return!$l(p,_)})||Ty.find(function(_){return!g[0].includes(_)&&g[1]!==_&&$l(p,_)}))})(a,u[0])?u.length>1?r.set(c,u.slice(1)):(r.delete(c),d(a)):$l(a,a.key)||r.delete(c)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function Ny(i,e,t){var n;t===void 0&&(t={});var s=(n=t.event)!=null?n:"keydown",r=vd(e,t);return i.addEventListener(s,r),function(){i.removeEventListener(s,r)}}function Dl(i,e={}){if(!i)return;const t=Object.keys(e).reduce((n,s)=>(e[s].optional||(n[s]={...e[s]}),n),{});return Object.keys(i).forEach(n=>{const s=i[n];s?s===!0?e[n]&&(t[n]={...e[n]}):t[n]=s:delete t[n]}),Object.keys(t).reduce((n,s)=>{const{keys:r,handler:o}=t[s];return typeof r=="string"?n[r]=o:r.forEach(a=>{n[a]=o}),n},{})}function Il(i,e,t){const{timeout:n,event:s="keydown",scope:r,when:o}=t||{},a=vd(e,{timeout:n}),l=`.zui.hotkeys${r?`.${r}`:""}`,c="zui-hotkeys-composing";return y(i).on(`${s}${l}`,function(d){o&&o(d)===!1||y(d.target).data(c)||a(d)}).on(`compositionstart${l}`,d=>{y(d.target).data(c,!0)}).on(`compositionend${l}`,d=>{y(d.target).removeData(c)})}function Nl(i,e){return y(i).off(`.zui.hotkeys${e?`.${e}`:""}`)}const My=Ny;y.fn.hotkeys=function(i,e){return Il(this,i,e)},y.fn.unbindHotkeys=function(i){return Nl(this,i)},y.hotkeys=function(i,e){Il(window,i,e)},y.unbindHotkeys=function(i){Nl(window,i)};function Zr(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function _d(i){(typeof i=="string"||i instanceof Element||i instanceof y)&&(i={target:i});const{target:e,onError:t,onSuccess:n,afterExit:s,afterEnter:r}=i,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"),s&&o.on("exitFullscreen.zui.fullscreen",s),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 d=Zr();let u=d;d?y(d).addClass("is-in-fullscreen"):(u=y(document).find(".is-in-fullscreen")[0]||document,y(u).removeClass("is-in-fullscreen")),y("body").toggleClass("has-in-fullscreen",!!d);const p={event:c,target:u,fullscreenElement:d};y(u).trigger(d?"enterFullscreen":"exitFullscreen",p).trigger("toggleFullscreen",p)}))}async function Ml(i){const e=Zr();return i===!1&&!!e===i?i:e?(document.exitFullscreen(),!1):(await _d(i),!0)}y.fn.fullscreen=function(i){return Ml({target:this,...i})},y.getFullscreenElement=Zr,y.toggleFullscreen=Ml;function An(i){return!i||i.parentNode===document?!1:i.parentNode?An(i.parentNode):!0}y.isDetached=An,y.fn.isDetached=function(){const i=this[0];return!i||An(i)};const ui=class fg{constructor(e,t){var _;this._inited=!1,this._autoDestory=0,this._destroyed=!1;const{KEY:n,DATA_KEY:s,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 d=y(e);if(d.data(n)&&!r)throw new Error(`[ZUI] The component "${o}" has been initialized on element.`);const u=d[0],p=wt();this._gid=p,this._element=u,this.resetOptions(t),this._key=this.options.key??`__${p}`;let g=l.get(u);if(g?g.add(this):(g=new Set([this]),l.set(u,g)),c.has(o)?c.get(o).add(this):c.set(o,new Set([this])),d.data(n,this).attr(a,"").attr(s,`${p}`).attr("z-use",[...new Set([...g].map(C=>C.constructor.NAME))].join(",")),r){const C=`${n}:ALL`;let x=d.data(C);x||(x=new Map,d.data(C,x)),x.set(this._key,this)}this.init(),(_=this.options.$onCreate)==null||_.call(this),requestAnimationFrame(async()=>{var C;this._inited=!0,await this.afterInit(),this.emit("inited",this.options),(C=this.options.$onInited)==null||C.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 g;const{KEY:e,DATA_KEY:t,ALL:n,TYPED_ALL:s,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 _=this.$element.data(`${e}:ALL`);if(_)if(_.delete(this._key),_.size===0)this.$element.removeData(`${e}:ALL`);else{const C=_.values().next().value;l.data(e,C).attr(t,String(C==null?void 0:C.gid))}}const d=n.get(c);d&&(d.delete(this),d.size===0&&n.delete(c));const u=s.get(r);u&&(u.delete(this),u.size===0&&s.delete(r));const p=n.get(c);p!=null&&p.size?l.attr("z-use",[...new Set([...p].map(_=>_.constructor.NAME))].join(",")):l.removeAttr("z-use"),(g=this.options.$onDestroy)==null||g.call(this)}autoDestroy(e=100){this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,An(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:s}=n;if(s){const r=typeof s=="function"?s.call(this,this.element,n):s;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 s=this;this.$element[n!=null&&n.once?"one":"on"](this._wrapEvent(e),function(r,o){(!r.__src||r.__src===s)&&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:s}=this;return Ne(s,e,t,n,this.options.lang,this.constructor.NAME)??Ne(s,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 s=n.data(`${this.KEY}:ALL`);return s?s.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:s,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,d)=>{var u;(u=s.get(d))==null||u.forEach(a)}):this!==fg?(l=r.get(this.NAME))==null||l.forEach(a):s.forEach(c=>{c.forEach(a)}),o.sort((c,d)=>c.gid-d.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](s,...r){const o=typeof s=="object"?s:void 0,a=typeof s=="string"?s:void 0;let l;return this.each((c,d)=>{let u=n.get(d);if(u)o&&u.render(o);else{if(a)return;u=new n(d,o)}if(a){let p=u[a],g=u;p===void 0&&(g=u.$,p=g[a]),typeof p=="function"?l=p.call(g,...r):l=p}}),l!==void 0?l:this}})}static register(e,t){var s,r;e=e||this,t=(t??e.NAME).toLowerCase(),this.map.set(t,e);const n=(r=(s=e.toggle)==null?void 0:s.name)==null?void 0:r.toLowerCase();n&&n!==t&&this.toggleMap.set(n,e)}};ui.DEFAULT={},ui.MULTI_INSTANCE=!1,ui.ALL=new Map,ui.TYPED_ALL=new Map,ui.map=new Map,ui.toggleMap=new Map;let Fe=ui;function $s(i){return Fe.map.get(i.toLowerCase())}function eo(i,e,t={}){let n=$s(i);if(n||(n=El(i)),!n)return null;const{$update:s,...r}=t;if(!n.MULTI_INSTANCE){const o=n.get(e);if(o)return s&&o.render(r,s==="reset"),o}return new n(e,r)}function Ey(i,e,t={}){requestAnimationFrame(()=>eo(i,e,t))}function bd(i,e){Fe.register(i,e)}function El(i){const{zui:e}=window;if(e){i=i==null?void 0:i.toLowerCase();for(const t in e){const n=t.toLowerCase()===i;if(i&&!n)continue;const s=e[t];if(!(typeof s!="function"||!s.NAME||!s.ZUI)&&(Fe.map.has(t.toLowerCase())||bd(s),n))return s}}}function Ay(i){var e;i?(e=$s(i))==null||e.defineFn():window._zuiDefined||(El(),Fe.map.forEach(t=>{t.defineFn()}),Object.assign(window,{_zuiDefined:!0}))}function Py(i,e={}){const t=y(i);let n=t.attr("zui-create");const{update:s,onCreate:r}=e,o=(a,l)=>{if(l={$update:s,$optionsFromDataset:!1,...l},r){const d=r(a,l);if(d===!1)return;d&&(l=d)}const c=l.$lib;if(c){delete l.$lib,y.getLib(c).then(()=>eo(a,i,l));return}Ey(a,i,l)};if(typeof n=="string"){n=n.trim();const a=n.length?n.split(",").map(d=>d.trim()):[],l=Pi(i,{prefix:"zui-create-",evalValue:!0}),c=Object.keys(l);if(!c.length&&a.length===1)o(a[0],t.dataset());else{const d=new Set;[...a,...c].forEach(u=>{if(d.has(u))return;const p=l[u];o(u,p),delete l[u],d.add(u)})}}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:i,options:e}),delete a.zui,o(l,a)}}function Ly(){y(document).on("click.zui.toggle mouseenter.zui.toggle","[data-toggle],[zui-toggle]",function(i){const e=y(this),t=e.dataset("toggle")||e.attr("zui-toggle");if(!t)return;const n=Fe.toggleMap.get(t)||$s(t),s=n==null?void 0:n.toggle;if(!s)return;const{trigger:r="click",skip:o="[disabled],.disabled",check:a}=s,l=i.type==="mouseover"?"hover":"click";if(!r.includes(l)||a&&!a.call(n,this,l,i)||o&&e.is(o))return;const{onGet:c,onCreate:d,setOptions:u=!0,getOptions:p,prevent:g=!0,handler:_,onToggle:C,convertHref:x}=s;let k=e.dataset();const $=e.attr(`zui-toggle-${t}`);if($&&(k=y.extend(k,oi($))),x&&e.is("a")){const z=e.attr("href");if(z){const H=x===!0?{selector:"target",url:"url"}:x;"#.".includes(z[0])?H.selector&&k[H.selector]===void 0&&(k[H.selector]=z):H.url&&k[H.url]===void 0&&(k[H.url]=z)}}if(p&&(k=p.call(n,this,k,i)),_){_.call(n,this,k,l,i),g&&i.preventDefault();return}let E=c?c.call(n,this):n.get(this);if(E)u&&E.setOptions(k);else{const z=d?d.call(n,this,i,k):new n(this,k);if(!z)return;E=z}if(C){if(C.call(n,E,this,i)===!1)return}else{const{shown:z,show:H,hide:Y,toggle:G}=E;let X;if(G?X=G:H&&Y?z?X=Y:X=H:H&&(X=H),X)X.call(E);else return}g&&i.preventDefault()})}function Ry(i,e){const t=ks(i),n=[];return Object.keys(t).forEach(s=>{if(!s.startsWith("zui."))return;const r=t[s];(e==null?void 0:e(r,s))!==!1&&n.push(t[s])}),n}let to=0;function wd(i=100){if(to&&clearTimeout(to),i){to=window.setTimeout(()=>wd(0),i);return}to=0,Fe.ALL.forEach(e=>{e.forEach(t=>t.autoDestroy())})}function Oy(){if(!document.body||ks(document.body,"_autoDestoryMob"))return;const i=new MutationObserver(e=>{let t=!1;for(const n of e)if(n.removedNodes.length){t=!0;break}t&&wd()});i.observe(document.body,{childList:!0,subtree:!0}),Kr(document.body,"_autoDestoryMob",i)}function Al(i,e){const t=y(i);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&&Py(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,s)=>{const r=y(s);r.zui()||r.trigger("inited")}),e!=null&&e.runJS&&t.runJS()}y.fn.zuiInit=function(i){return Al(this,i),this},y.fn.zui=function(i,e){const t=this[0];if(!t)return;if(typeof i!="string"){const s={};let r;return Ry(t,(o,a)=>{s[a]=o,(!r||r.gid1?t[0]:void 0,s=t[t.length>1?1:0],r=y(this).zui(n),o=r==null?void 0:r[s];typeof o=="function"&&o.apply(r,e)}),this},y(()=>{y("body").zuiInit({update:!0}),Ly(),Oy()});class no extends Fe{get $targets(){const{$element:e}=this,{targets:t}=this.options;return t?e.find(t):e}_handleScroll(e,t,n){const{offset:s=1}=this.options,r=this.$targets,o=e.getBoundingClientRect(),{scrollTop:a,scrollLeft:l}=e;r.each((c,d)=>{const u=d.getBoundingClientRect(),p=t==="top"&&a>0&&u.top<=o.top+s||t==="bottom"&&u.bottom>=o.bottom-s||t==="left"&&l>0&&u.left<=o.left+s||t==="right"&&l{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{this._raf=0,this._handleScroll(l,t,s)})};this._scrollListener=c,l.addEventListener("scroll",c)}this._container=l,requestAnimationFrame(()=>{this._handleScroll(l,t,s)})}else this._ob=new IntersectionObserver(l=>{l.forEach(c=>{c.target.classList.toggle(s,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))}}no.NAME="Sticky";const Ri=24*60*60*1e3,je=i=>i===void 0?new Date:(i instanceof Date||(typeof i=="string"&&(i=i.trim(),/^\d+$/.test(i)&&(i=Number.parseInt(i,10))),typeof i=="number"&&i<1e10&&(i*=1e3),i=new Date(i)),i),Cd=(i,e,t="day")=>{if(typeof e=="string"){const n=Number.parseInt(e,10);t=e.replace(n.toString(),""),e=n}return i=new Date(je(i).getTime()),t==="month"?i.setMonth(i.getMonth()+e):t==="year"?i.setFullYear(i.getFullYear()+e):t==="week"?i.setDate(i.getDate()+e*7):t==="hour"?i.setHours(i.getHours()+e):t==="minute"?i.setMinutes(i.getMinutes()+e):t==="second"?i.setSeconds(i.getSeconds()+e):i.setDate(i.getDate()+e),i},Pn=(i,e=new Date)=>je(i).toDateString()===je(e).toDateString(),Ds=(i,e=new Date)=>je(i).getFullYear()===je(e).getFullYear(),Pl=(i,e=new Date)=>(i=je(i),e=je(e),i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()),zy=(i,e=new Date)=>{i=je(i),e=je(e);const t=1e3*60*60*24,n=Math.floor(i.getTime()/t),s=Math.floor(e.getTime()/t);return Math.floor((n+4)/7)===Math.floor((s+4)/7)},Fy=(i,e)=>Pn(je(e),i),jy=(i,e)=>Pn(je(e).getTime()-Ri,i),By=(i,e)=>Pn(je(e).getTime()+Ri,i),Ll=i=>i!=null&&!isNaN(je(i).getTime()),rt=(i,e="yyyy-MM-dd hh:mm",t="")=>{if(i=je(i),!Ll(i))return t;if(typeof e=="function")return e(i);const n={"M+":i.getMonth()+1,"d+":i.getDate(),"h+":i.getHours(),"H+":i.getHours()%12,"m+":i.getMinutes(),"s+":i.getSeconds(),"S+":i.getMilliseconds()};return/(y+)/i.test(e)&&(e.includes("[yyyy-]")&&(e=e.replace("[yyyy-]",Ds(i)?"":"yyyy-")),e=e.replace(RegExp.$1,`${i.getFullYear()}`.substring(4-RegExp.$1.length))),Object.keys(n).forEach(s=>{if(new RegExp(`(${s})`).test(e)){const r=`${n[s]}`;e=e.replace(RegExp.$1,RegExp.$1.length===1?r:`00${r}`.substring(r.length))}}),e},Hy=(i,e,t)=>{const n={full:"yyyy-M-d",month:"M-d",day:"d",str:"{0} ~ {1}",...t},s=rt(i,Ds(i)?n.month:n.full);if(Pn(i,e))return s;const r=rt(e,Ds(i,e)?Pl(i,e)?n.day:n.month:n.full);return n.str.replace("{0}",s).replace("{1}",r)};function Rl(i){let e=0;if(typeof i!="string"&&(i=String(i)),i&&i.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 xd(i){if(Array.isArray(i))return{commands:i.map(io).filter(Boolean)};if(typeof i=="object")return i;i=i.replace(/^#!?/,"");const e=i.includes(">"),t=i.split(e?">":"|").map(io);return{async:e,commands:t.filter(Boolean)}}function Ol(i,e,t){if(typeof i=="string"&&(i=io(i)),!i)return;const{execute:n,event:s,scope:r}=e;if(!(r&&i.scope&&i.scope!==r))return n({name:i.name,options:{...e.options,...i.options},event:s,scope:i.scope,prevResult:t},i.params)}async function kd(i,e){const{async:t,commands:n}=xd(i);if(!n.length)return[];const{signal:s}=e;if(t){const o=[];let a;for(const l of n){if(!(s!=null&&s.aborted))break;a=await Ol(l,e,a),s!=null&&s.aborted&&(a=void 0),o.push(a)}return o}return await Promise.all(n.map(o=>{if(!(s!=null&&s.aborted))return Ol(o,e)}))}const Oi="zui.commands",zi="z-commands",Wy="zui-commands-proxy",Sd="zui-command";function so(i,e){typeof e=="string"?e={scope:e}:typeof e=="function"&&(e={onCommand:e});const{scope:t="",events:n="click"}=e??{},s=y(i),r=(s.attr(zi)||"").split(",");t&&!r.includes(t)&&r.push(t),s.attr(zi,r.join(",")).data(Oi,{[t]:{...e,scope:t,events:n,gid:wt()},...s.data(Oi)})}function ro(i,e=!0){const t=y(i);if(e===!0)t.removeAttr(zi),t.removeData(Oi);else if(e.length){const n=t.data(Oi)||{};e.split(",").forEach(r=>{delete n[r]});const s=Object.keys(n);s.length?t.attr(zi,s.join(",")).data(Oi,so):ro(t,!0)}}function Td(i,e){let t=i.closest(`[${zi}]`);if(!t.length){const o=i.closest(`[${Wy}]`);o.length&&(t=y(o.data("zui.commandProxy")||o.attr("COMMAND_PROXY_ATTR")).closest(`[${zi}]`))}if(!t.length)return;const n=t.data(Oi)||{},s=Object.values(n).sort((o,a)=>a.gid-o.gid);let r;return e!=null&&e.length?(r=s.find(o=>o.scope===e),r||(r=s.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped})),r):(r=s.find(o=>{var a;return!((a=o.scope)!=null&&a.length)&&!o.scoped}),r||(r=s.find(o=>!o.scoped)),r?r.element=t[0]:r=Td(i.parent(),e),r)}function Uy(i){if(!i.currentTarget)return;const e=y(i.currentTarget);if(e.closest(".disabled,[disabled]").length)return;const t=e.attr(Sd)||(e.is('a[href^="#!"]')?e.attr("href"):"");if(!t)return;const n=new AbortController,s=()=>n.abort();kd(t,{signal:n.signal,execute:(r,o)=>{const{scope:a,name:l}=r,c={...r,abort:s};let d;const u=Td(e,a);if(u){c.element=u.element;const g=(u.commands?u.commands[`${a}~${l}`]||u.commands[l]:null)||u.onCommand;if(g&&(d=g(c,o),i.commandHandled))return d}const p=[c,o];if(e.trigger("command",p).trigger(`command:${a?`${l}.${a}`:l}`,p),a&&e.trigger(`command:.${a}`,p),i.commandHandled)return d;if(a==="event"){l==="stop"?i.stopPropagation():l==="prevent"?i.preventDefault():Mn(i,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):d},event:i})}y.fn.command=function(i,e){return this.on(`command:${i}`,e)},y.fn.offCommand=function(i,e){return this.off(`command:${i}`,e)},y.fn.commands=function(i){return this.each((e,t)=>so(t,i)),this},y.fn.unbindCommands=function(i){return this.each((e,t)=>ro(t,i)),this},y(()=>{y(document).on("click.zui.command",`[${Sd}],a[href^="#!"]`,Uy)});function Is(i,e,t=!1){var s;const n=y(i);if(e!==void 0){if(typeof e=="string"&&e.length){const r=`zui-runjs-${wt()}`;n.append(`