From 3e1a9463cab958708e6816bb2c355058b2317730 Mon Sep 17 00:00:00 2001 From: sunhao Date: Fri, 2 Aug 2024 09:00:23 +0800 Subject: [PATCH] * [misc] update zui lib. --- www/js/zui3/zui.zentao.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index d3ee49a36d..59aaae909c 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -2,6 +2,6 @@ var $h=(D,Xt,ve)=>{if(!Xt.has(D))throw TypeError("Cannot "+ve)};var _e=(D,Xt,ve) `))}`}const vm=/file|reset|submit|button|image/i,Zh=/radio|checkbox/i;it.serialize=function(){let s="";return this.each((t,e)=>{se(e.elements||[e],(n,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||vm.test(i.type)||Zh.test(i.type)&&!i.checked)return;const r=Bh(i);if(!we(r)){const o=ur(r)?r:[r];se(o,(a,l)=>{s+=_m(i.name,l)})}})}),s.slice(1)},window.$=m;function Jh(s,t){if(s==null)return[s,void 0];typeof t=="string"&&(t=t.split("."));const e=t.join(".");let n=s;const i=[n];for(;typeof n=="object"&&n!==null&&t.length;){let r=t.shift(),o;const a=r.indexOf("[");if(a>0&&a{const i=e[n]??"";s=s.replace(new RegExp(`\\{${n}\\}`,"g"),`${i}`)}),s}for(let e=0;e(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))(Ea||{});function me(s,t=2,e){return Number.isNaN(s)?"?KB":(e||(s<1024?e="B":s<1048576?e="KB":s<1073741824?e="MB":s<1099511627776?e="GB":e="TB"),(s/Ea[e]).toFixed(t)+e)}const Cs=s=>{const t=/^[0-9]*(B|KB|MB|GB|TB)$/;s=s.toUpperCase();const e=s.match(t);if(!e)return 0;const n=e[1];return s=s.replace(n,""),Number.parseInt(s,10)*Ea[n]};let Ma=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),rn;function wm(){return Ma}function Cm(s){Ma=s.toLowerCase().replace("-","_")}function tu(s,t){rn||(rn={}),typeof s=="string"&&(s={[s]:t??{}}),m.extend(!0,rn,s)}function Et(s,t,e,n,i,r){Array.isArray(s)?rn&&s.unshift(rn):s=rn?[rn,s]:[s],typeof e=="string"&&(r=i,i=n,n=e,e=void 0);const o=i||Ma;let a;for(const l of s){if(!l)continue;const h=l[o]||l.default;if(!h)continue;const f=r&&l===rn?`${r}.${t}`:t;if(a=Na(h,f),a!==void 0)break}return a===void 0?n:e?Nt(a,...Array.isArray(e)?e:[e]):a}function km(s,t,e,n){return Et(void 0,s,t,e,n)}Et.addLang=tu,Et.getLang=km,Et.getCode=wm,Et.setCode=Cm,Et.map=rn,tu({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 eu(s,t,e){s instanceof Headers?s.set(t,e):Array.isArray(s)?s.push([t,e]):s[t]=e}function ks(s,t,e){e!=null&&(Array.isArray(e)?e.forEach(n=>ks(s,t,n)):!(e instanceof Blob)&&m.isPlainObject(e)?Object.entries(e).forEach(([n,i])=>{ks(s,`${t}[${n}]`,i)}):s.append(t,e instanceof Blob?e:String(e)))}function xm(s,t){if(s){const e={text:"text/plain",html:"text/html",json:"application/json",...t};for(const[n,i]of Object.entries(e))if(i.split(",").map(r=>r.trim()).includes(s))return n}return"text"}function yr(s,t){const e=t||new FormData;return s&&(typeof s=="string"&&(s=new URLSearchParams(s)),s instanceof URLSearchParams?s.forEach((n,i)=>{ks(e,i,n)}):Array.isArray(s)?s.forEach(([n,i])=>{ks(e,n,i)}):s instanceof FormData?s.forEach((n,i)=>{ks(e,i,n)}):m.isPlainObject(s)&&Object.entries(s).forEach(([n,i])=>{ks(e,n,i)})),e}class br{get completed(){return this.data!==void 0||this.error!==void 0}get[Symbol.toStringTag](){return"Ajax"}constructor(t){this.setting=t,this._controller=new AbortController,this._callbacks={success:[],error:[],complete:[]}}on(t,e){return this._callbacks[t].push(e),this}success(t){return this.on("success",t)}done(t){return this.success(t)}fail(t){return this.on("error",t)}complete(t){return this.on("complete",t)}always(t){return this.complete(t)}then(t,e){return this.completed?e&&this.error?e(this.error):t(this.data):(this.success(n=>t(n)),e&&this.fail(e)),this}catch(t){return this.error?(t(this.error),this):this.on("error",e=>t(e))}finally(t){return this.completed?(t(),this):this.complete(()=>t())}abort(t){return this.completed?!1:(this._abortError=t,this._controller.abort(),!0)}getResponseHeader(t){var e;return(e=this.response)==null?void 0:e.headers.get(t)}_init(){if(this.completed)return;const{url:t,type:e,data:n,processData:i=!0,contentType:r,crossDomain:o,accepts:a,dataType:l,timeout:h,dataFilter:f,beforeSend:d,success:g,error:b,complete:w,...x}=this.setting;if((d==null?void 0:d(x))===!1)return;e&&(x.method=e);let k=n;k&&(i&&(k=yr(k)),x.body=k),o&&(x.mode="cors");const S=x.headers||{};eu(S,"X-Requested-With","XMLHttpRequest"),r&&eu(S,"Content-Type",r),x.headers=S,x.signal&&x.signal.addEventListener("abort",()=>{this.abort()}),g&&this.success(g),b&&this.fail(b),w&&this.complete(w),x.signal=this._controller.signal,this.url=t,this.request=x}_emit(t,...e){this._callbacks[t].forEach(n=>{n.call(this,...e)})}async send(){var f;if(this.completed)return[];this._init();const{timeout:t,dataType:e,accepts:n,dataFilter:i,throws:r,jsonParser:o}=this.setting;t&&(this._timeoutID=window.setTimeout(()=>{this.abort(new Error("timeout"))},t));let a,l,h;try{a=await fetch(this.url,this.request),this.response=a;const{statusText:d}=a;if(a.ok){const g=(f=a.headers.get("Content-Disposition"))==null?void 0:f.startsWith("attachment"),b=g?"blob":e||xm(a.headers.get("Content-Type"),n);g||b==="blob"||b==="file"?h=await a.blob():b==="json"?typeof o=="function"?(h=await a.text(),h=o(h)):h=await a.json():h=await a.text(),this.data=h;const w=(i==null?void 0:i(h,b))??h;this._emit("success",w,d,a)}else throw this.data=await a.text(),new Error(d)}catch(d){l=d;let g=!1;l.name==="AbortError"&&(this._abortError?l=this._abortError:g=!0),this.error=l,g||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[h,l,a]}}m.ajax=(s,t)=>{t=t||{},typeof s=="string"?t.url=s:m.extend(t,s);const e=new br(t);return e.send(),e},m.getJSON=(s,t,e)=>(typeof t=="function"&&(e=t,t=void 0),m.ajax({url:s,data:t,success:e,dataType:"json"})),m.get=(s,t,e,n,i="GET")=>{let r,o;return typeof t=="function"?(r=t,o=void 0):o=t,typeof e=="function"?(r=e,n=void 0):n=e,m.ajax({method:i,url:s,data:o,success:r,dataType:n})},m.post=(s,t,e,n)=>m.get(s,t,e,n,"POST"),m.fn.load=function(s,t,e){typeof t=="function"&&(e=t,t=void 0);const[n,i]=s.split(" ");return m.get(n,t,(r,o,a)=>{i&&(r=m(r).find(i).html()),m(this).html(r).zuiInit(),e==null||e.call(this,r,o,a)},"html"),this};async function Qn(s,t=[],e){const n={throws:!0,dataType:"json"};if(typeof s=="string")n.url=s;else if(typeof s=="object")m.extend(n,s);else if(typeof s=="function"){const o=s(...t);return o instanceof Promise?await o:o}e&&m.extend(n,typeof e=="function"?e(n):e);const i=new br(n),[r]=await i.send();return r}function Aa(s){return!!(s&&(typeof s=="string"||typeof s=="object"&&s.url||typeof s=="function"))}m.fetch=Qn;function ge(){return m.guid++}function _r(s,t){if(s===t)return!1;if(s&&t){const e=typeof s,n=typeof t;if(e!==n)return!0;if(e==="object"&&n==="object"){const i=Array.isArray(s),r=Array.isArray(t);if(i!==r)return!0;if(i&&r){if(s.length!==t.length)return!0;for(let l=0;l_r(n instanceof Xn?n.value:n,e[i])))&&(this._value=this._compute(),this._lastDependencies=t.map(n=>n instanceof Xn?n.cache:n)),this._value}}function Pa(...s){const t=[],e=new Map,n=(i,r)=>{if(Array.isArray(i)&&(r=i[1],i=i[0]),!i.length)return;const o=e.get(i);typeof o=="number"?t[o][1]=!!r:(e.set(i,t.length),t.push([i,!!r]))};return s.forEach(i=>{typeof i=="function"&&(i=i()),Array.isArray(i)?Pa(...i).forEach(n):i&&typeof i=="object"?Object.entries(i).forEach(n):typeof i=="string"&&i.split(" ").forEach(r=>n(r,!0))}),t.sort((i,r)=>(e.get(i[0])||0)-(e.get(r[0])||0))}const Y=(...s)=>Pa(...s).reduce((t,[e,n])=>(n&&t.push(e),t),[]).join(" ");m.classes=Y,m.fn.setClass=function(s,...t){return this.each((e,n)=>{const i=m(n);s===!0?i.attr("class",Y(i.attr("class"),...t)):i.addClass(Y(s,...t))})};const xs=new WeakMap;function vr(s,t,e){const n=xs.has(s),i=n?xs.get(s):{};typeof t=="string"?i[t]=e:t===null?Object.keys(i).forEach(r=>{delete i[r]}):Object.assign(i,t),Object.keys(i).forEach(r=>{i[r]===void 0&&delete i[r]}),Object.keys(i).length?(!n&&s instanceof Element&&Object.assign(i,m(s).dataset(),i),xs.set(s,i)):xs.delete(s)}function ri(s,t,e){let n=xs.get(s)||{};return e&&s instanceof Element&&(n=Object.assign({},m(s).dataset(),n)),t===void 0?n:n[t]}function Sm(s){xs.delete(s)}m.fn.dataset=m.fn.data,m.fn.data=function(...s){const[t,e]=s;return!s.length||s.length===1&&typeof t=="string"?this.length?ri(this[0],t,!0):void 0:this.each((n,i)=>vr(i,t,e))},m.fn.removeData=function(s=null){return this.each((t,e)=>vr(e,s))};function Ss(s,...t){return s.includes("RAWJS")&&(s=s.split('"RAWJS<').join("").split('>RAWJS"').join("").split("").join('"').split("").join(` `)),new Function(`return ${s}`)(...t)}function Ia(s,...t){return s.includes("RAWJS")?Ss(s,...t):JSON.parse(s)}function $s(s,t){const e=m(s)[0];if(!e)return;const{prefix:n,getter:i,evalValue:r,json:o=!0,evalArgs:a=[]}={prefix:"z-",...typeof t=="string"?{prefix:t}:t},l=Array.isArray(r)?new Set(r):void 0;return Array.from(e.attributes).reduce((h,f)=>{let{name:d}=f;const{value:g}=f;let b=g;if(d.startsWith(n)){if(d=d.slice(n.length).replace(/-([a-z])/g,w=>w[1].toUpperCase()),i)b=i(d,g);else try{r&&(!l||l.has(d))||r===void 0&&g.includes("RAWJS")?b=Ss(g,...a):o&&(b=JSON.parse(g))}catch{}h[d]=b}return h},{})}function Da(s,t,e="z-"){const n=m(s);Object.keys(t).forEach(i=>{let r=t[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(`${e}${i}`,r)})}function $m(...s){var e;const t=s.length;if(!t)return $s(this);if(t===1){const[n]=s;return typeof n=="string"?(e=$s(this))==null?void 0:e[n]:(m.isPlainObject(n)&&Da(this,n),this)}return Da(this,{[s[0]]:s[1]}),this}m.fn.z=$m,m.fn._attr=m.fn.attr,m.fn.extend({attr(...s){const[t,e]=s;return!s.length||s.length===1&&typeof t=="string"?this._attr.apply(this,s):typeof t=="object"?(t&&Object.keys(t).forEach(n=>{const i=t[n];i===null?this.removeAttr(n):this._attr(n,i)}),this):e===null?this.removeAttr(t):this._attr(t,e)}}),m.Event||(m.Event=(s,t)=>{const[e,...n]=s.split("."),i=new Event(e,{bubbles:!0,cancelable:!0});return i.namespace=n.join("."),i.___ot=e,i.___td=t,i});const oi=(s,t)=>new Promise(e=>{const n=window.setTimeout(e,s);t&&t(n)}),nu={};m.share=nu;var wr,Bt,su;D.isValidElement=void 0;var Zn,iu,ru,Ra,La,Oa,za,ai={},ou=[],Tm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Cr=Array.isArray;function vn(s,t){for(var e in t)s[e]=t[e];return s}function au(s){var t=s.parentNode;t&&t.removeChild(s)}function E(s,t,e){var n,i,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?i=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?wr.call(arguments,2):e),typeof s=="function"&&s.defaultProps!=null)for(r in s.defaultProps)o[r]===void 0&&(o[r]=s.defaultProps[r]);return kr(s,o,n,i,null)}function kr(s,t,e,n,i){var r={type:s,props:t,key:e,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:i??++su,__i:-1,__u:0};return i==null&&Bt.vnode!=null&&Bt.vnode(r),r}function $t(){return{current:null}}function wn(s){return s.children}function Tt(s,t){this.props=s,this.context=t}function Jn(s,t){if(t==null)return s.__?Jn(s.__,s.__i+1):null;for(var e;tt&&Zn.sort(Ra));xr.__r=0}function hu(s,t,e,n,i,r,o,a,l,h,f){var d,g,b,w,x,k=n&&n.__k||ou,S=t.length;for(e.__d=l,Nm(e,t,k),l=e.__d,d=0;d0?kr(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=s,i.__b=s.__b+1,a=Em(i,e,o,f),i.__i=a,r=null,a!==-1&&(f--,(r=e[a])&&(r.__u|=131072)),r==null||r.__v===null?(a==-1&&d--,typeof i.type!="function"&&(i.__u|=65536)):a!==o&&(a==o-1?d=a-o:a==o+1?d++:a>o?f>l-o?d+=a-o:d--:a(l!=null&&!(131072&l.__u)?1:0))for(;o>=0||a=0){if((l=t[o])&&!(131072&l.__u)&&i==l.key&&r===l.type)return o;o--}if(a{!e||typeof e!="object"||Object.keys(e).forEach(n=>{let i=e[n];const r=s[n];i!==r&&(r!==void 0&&(n==="className"||n.endsWith("Class")?i=[r,i]:n==="children"?i=[...Sr(r),...Sr(i)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(i=m.extend(r,i))),s[n]=i)})}),s}function Wa(s){return Object.keys(s).forEach(t=>{s[t]===void 0&&delete s[t]}),s}function mu(s,t=!0){const e=m(s),n=e[0],i="zui-disable-scroll";if(t){if(e.data(i))return;if((e.css("scrollbar-gutter")||"").includes("stable")){e.data(i,{overflow:e.css("overflow")}).css("overflow","hidden");return}const r=n===document.body||e.is("html")?window.innerWidth-document.body.clientWidth:n.offsetWidth-n.clientWidth;if(!r)return;const o=e.css("paddingRight")||"0";e.data(i,{paddingRight:o,overflow:e.css("overflow")}).css({paddingRight:`${r+Number.parseInt(o,10)}px`,overflow:"hidden"})}else{const r=e.data(i);if(!r)return;e.css(r).removeData(i)}}m.fn.disableScroll=function(s=!0){return this.each((t,e)=>{mu(e,s)})},m.fn.enableScroll=function(s=!0){return this.disableScroll(!s)};function Ha(s,t,e){if(!(e.on||"click").split(" ").includes(t.type))return;const n=e.selector?m(t.target).closest(e.selector):s;if(!n.length)return;const i=h=>h===""?!0:h,r=h=>{if(typeof h=="string")try{h=JSON.parse(h)}catch{}return h};if(i(e.once)){if(e.onceCalled)return;s.dataset("once-called",!0)}if(i(e.prevent)&&t.preventDefault(),i(e.stop)&&t.stopPropagation(),i(e.self)&&t.currentTarget!==t.target)return;const o=[["$element",s],["event",t],["options",e],["$target",n]],a=h=>typeof h=="function"?h(...o):m.runJS(h,...o);if(e.if!==void 0&&!a(e.if))return;const l=e.call;if(l){let h;if(typeof l=="string"?h=/^[$A-Z_][0-9A-Z_$.]*$/i.test(l)?Na(window,l):a(l):h=l,typeof h=="function"){const f=[],d=e.params;e.params=f,typeof d=="string"&&d.length?d[0]==="["?f.push(...r(d)):f.push(...d.split(", ").map(g=>(g=g.trim(),g==="$element"?s:g==="event"?t:g==="options"?e:g.startsWith("$element.")||g.startsWith("event.")||g.startsWith("options.")?a(g):r(g)))):Array.isArray(d)?f.push(...d):f.push(d),h(...f)}}e.do&&a(e.do)}function Pm(s){const t=m(this),e=s.type,n=t.attr("zui-on");if(n){const[o,a]=n.split("~").map(l=>l.trim());o&&Ha(t,s,m.extend({on:o},a?a.startsWith("{")?Ss(a):{do:a}:$s(t,{prefix:"data-",evalValue:["call","if","do"]})))}const i=t.attr(`zui-on-${e}`);i&&Ha(t,s,m.extend({on:e},i.startsWith("{")?Ss(i):{do:i})),t.attr("data-on")&&Ha(t,s,$s(t,{prefix:"data-",evalValue:["call","if","do"]}))}function gu(s){m(document).off(".zui.global").on(s.map(t=>`${t}.zui.global`).join(" "),`[zui-on],${s.map(t=>`[zui-on-${t}]`)},[data-on]`,Pm)}gu(["click","change","inited"]);function es(s){if(typeof s=="function")return es(s());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 Yt(s){if(s==null)return null;const[t,e="px"]=es(s);return Number.isNaN(t)?typeof s=="string"?s:null:`${t}${e}`}async function Tr(s,t){var n,i,r;if(s instanceof Blob){const o=document.createElement("a");return o.href=window.URL.createObjectURL(s),t&&(o.download=decodeURIComponent(t)),o.click(),o.remove(),s}if(s instanceof Response){const o=await s.blob();return t=t||((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,"")),Tr(o,t)}const e=await fetch(s);return Tr(e)}class yu{constructor(t){this._$target=m(t)}on(...t){return this._$target.on(...t),this}one(...t){return this._$target.one(...t),this}off(...t){return this._$target.off(...t),this}trigger(...t){return this._$target.trigger(...t),this}}const Ke=new yu(document);m.bus=Ke,m.on=Ke.on.bind(Ke),m.one=Ke.one.bind(Ke),m.off=Ke.off.bind(Ke),m.trigger=Ke.trigger.bind(Ke);var Im=["Shift","Meta","Alt","Control"],bu=typeof navigator=="object"?navigator.platform:"",_u=/Mac|iPod|iPhone|iPad/.test(bu),Dm=_u?"Meta":"Control",Rm=bu==="Win32"?["Control","Alt"]:_u?["Alt"]:[];function Ka(s,t){return typeof s.getModifierState=="function"&&(s.getModifierState(t)||Rm.includes(t)&&s.getModifierState("AltGraph"))}function Lm(s){return s.trim().split(" ").map(function(t){var e=t.split(/\b\+/),n=e.pop();return[e=e.map(function(i){return i==="$mod"?Dm:i}),n]})}function vu(s,t){var e;t===void 0&&(t={});var n=(e=t.timeout)!=null?e:1e3,i=Object.keys(s).map(function(a){return[Lm(a),s[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(i.forEach(function(l){var h=l[0],f=l[1],d=r.get(h)||h;(function(g,b){return!(b[1].toUpperCase()!==g.key.toUpperCase()&&b[1]!==g.code||b[0].find(function(w){return!Ka(g,w)})||Im.find(function(w){return!b[0].includes(w)&&b[1]!==w&&Ka(g,w)}))})(a,d[0])?d.length>1?r.set(h,d.slice(1)):(r.delete(h),f(a)):Ka(a,a.key)||r.delete(h)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function Om(s,t,e){var n;e===void 0&&(e={});var i=(n=e.event)!=null?n:"keydown",r=vu(t,e);return s.addEventListener(i,r),function(){s.removeEventListener(i,r)}}function Va(s,t={}){if(!s)return;const e=Object.keys(t).reduce((n,i)=>(t[i].optional||(n[i]={...t[i]}),n),{});return Object.keys(s).forEach(n=>{const i=s[n];i?i===!0?t[n]&&(e[n]={...t[n]}):e[n]=i:delete e[n]}),Object.keys(e).reduce((n,i)=>{const{keys:r,handler:o}=e[i];return typeof r=="string"?n[r]=o:r.forEach(a=>{n[a]=o}),n},{})}function Ua(s,t,e){const{timeout:n,event:i="keydown",scope:r,when:o}=e||{},a=vu(t,{timeout:n}),l=`.zui.hotkeys${r?`.${r}`:""}`,h="zui-hotkeys-composing";return m(s).on(`${i}${l}`,function(f){o&&o(f)===!1||m(f.target).data(h)||a(f)}).on(`compositionstart${l}`,f=>{m(f.target).data(h,!0)}).on(`compositionend${l}`,f=>{m(f.target).removeData(h)})}function qa(s,t){return m(s).off(`.zui.hotkeys${t?`.${t}`:""}`)}const zm=Om;m.fn.hotkeys=function(s,t){return Ua(this,s,t)},m.fn.unbindHotkeys=function(s){return qa(this,s)},m.hotkeys=function(s,t){Ua(window,s,t)},m.unbindHotkeys=function(s){qa(window,s)};function Nr(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function wu(s){(typeof s=="string"||s instanceof Element||s instanceof m)&&(s={target:s});const{target:t,onError:e,onSuccess:n,afterExit:i,afterEnter:r}=s,o=m(t),a=o[0];if(!a)return;const l=a.requestFullscreen||a.webkitRequestFullscreen||a.mozRequestFullScreen;if(!l){e==null||e.call(a,new Error("[ZUI] The browser does not support full screen feature."));return}try{await l.call(a),n==null||n.call(a),m(a).off(".zui.fullscreen"),i&&o.on("exitFullscreen.zui.fullscreen",i),r&&o.on("enterFullscreen.zui.fullscreen",r)}catch(h){e==null||e.call(a,h)}document.zuiBindFullscreenChange||(document.zuiBindFullscreenChange=!0,m(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui",h=>{const f=Nr();let d=f;f?m(f).addClass("is-in-fullscreen"):(d=m(document).find(".is-in-fullscreen")[0]||document,m(d).removeClass("is-in-fullscreen")),m("body").toggleClass("has-in-fullscreen",!!f);const g={event:h,target:d,fullscreenElement:f};m(d).trigger(f?"enterFullscreen":"exitFullscreen",g).trigger("toggleFullscreen",g)}))}async function Ga(s){const t=Nr();return s===!1&&!!t===s?s:t?(document.exitFullscreen(),!1):(await wu(s),!0)}m.fn.fullscreen=function(s){return Ga({target:this,...s})},m.getFullscreenElement=Nr,m.toggleFullscreen=Ga;function ns(s){return s.parentNode===document?!1:s.parentNode?ns(s.parentNode):!0}m.isDetached=ns,m.fn.isDetached=function(){const s=this[0];return!s||ns(s)};const ss=class kp{constructor(t,e){this._inited=!1,this._autoDestory=0,this._destroyed=!1;const{KEY:n,DATA_KEY:i,DEFAULT:r,MULTI_INSTANCE:o,NAME:a,ATTR_KEY:l,ALL:h,TYPED_ALL:f}=this.constructor;if(!a)throw new Error('[ZUI] The component must have a "NAME" static property.');const d=m(t);if(d.data(n)&&!o)throw new Error(`[ZUI] The component "${a}" has been initialized on element.`);const g=d[0],b=ge();if(this._gid=b,this._element=g,this._options={...r,...(e==null?void 0:e.$optionsFromDataset)!==!1?d.dataset():{}},this.setOptions(e),this._key=this.options.key??`__${b}`,h.has(g)?h.get(g).add(this):h.set(g,new Set([this])),f.has(a)?f.get(a).add(this):f.set(a,new Set([this])),d.data(n,this).attr(l,"").attr(i,`${b}`),o){const w=`${n}:ALL`;let x=d.data(w);x||(x=new Map,d.data(w,x)),x.set(this._key,this)}this.init(),requestAnimationFrame(async()=>{this._inited=!0,await this.afterInit(),this.emit("inited",this.options)})}static get ZUI(){return this.NAME.replace(/(^[A-Z]+)/,t=>t.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 m(this.element)}get $emitter(){return this.$element}get i18nData(){return[this.options.i18n,this.constructor.i18n]}init(){}afterInit(){}render(t,e){this.setOptions(t,e)}destroy(){const{KEY:t,DATA_KEY:e,ALL:n,TYPED_ALL:i,NAME:r,MULTI_INSTANCE:o,ATTR_KEY:a}=this.constructor,{$element:l,element:h}=this;if(this.emit("destroyed"),this._destroyed=!0,l.off(this.namespace).removeData(t).removeAttr(a).removeAttr(e),o){const g=this.$element.data(`${t}:ALL`);if(g)if(g.delete(this._key),g.size===0)this.$element.removeData(`${t}:ALL`);else{const b=g.values().next().value;l.data(t,b).attr(e,b.gid)}}const f=n.get(h);f&&(f.delete(this),f.size===0&&n.delete(h));const d=i.get(r);d&&(d.delete(this),d.size===0&&i.delete(r))}autoDestroy(t=100){this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,ns(this.element)&&this.destroy()},t)}setOptions(t,e){return e?this._options={...this.constructor.DEFAULT,...(t==null?void 0:t.$optionsFromDataset)!==!1?this.$element.dataset():{},...t}:t&&m.extend(this._options,t),this._options}emit(t,...e){const n=m.Event(t);return n.__src=this,this.$emitter.trigger(n,[this,...e]),n}on(t,e,n){const i=this;this.$element[n!=null&&n.once?"one":"on"](this._wrapEvent(t),function(r,o){(!r.__src||r.__src===i)&&e.call(this,r,o)})}one(t,e){this.on(t,e,{once:!0})}off(t){this.$element.off(this._wrapEvent(t))}i18n(t,e,n){const{i18nData:i}=this;return Et(i,t,e,n,this.options.lang,this.constructor.NAME)??Et(i,t,e,n,this.options.lang)??`{i18n:${t}}`}get namespace(){return`${this.constructor.NAMESPACE}.${this._key}`}_wrapEvent(t){return t.split(" ").map(e=>e.includes(".")?e:`${e}${this.namespace}`).join(" ")}static get(t,e){const n=m(t);if(this.MULTI_INSTANCE&&e!==void 0){const i=n.data(`${this.KEY}:ALL`);return i?i.get(e):void 0}return n.data(this.KEY)}static isValid(t){return!0}static ensure(t,e){const n=this.get(t,e==null?void 0:e.key);if(n){if(this.isValid(n))return e&&n.setOptions(e),n;n.destroy()}return new this(t,e)}static getAll(t,e){var l;const{SELECTOR:n,ALL:i,TYPED_ALL:r}=this,o=[],a=h=>{h instanceof this&&(!e||e(h)!==!1)&&o.push(h)};return t?m(t).find(n).each((h,f)=>{var d;(d=i.get(f))==null||d.forEach(a)}):this!==kp?(l=r.get(this.NAME))==null||l.forEach(a):i.forEach(h=>{h.forEach(a)}),o.sort((h,f)=>h.gid-f.gid)}static query(t,e,n){return t===void 0?this.getAll(void 0,n).pop():this.get(m(t).closest(this.SELECTOR),e)}static defineFn(t){let e=t||this.ZUI;m.fn[e]&&(e=`zui${this.NAME}`);const n=this;m.fn.extend({[e](i,...r){const o=typeof i=="object"?i:void 0,a=typeof i=="string"?i:void 0;let l;return this.each((h,f)=>{let d=n.get(f);if(d?o&&d.render(o):d=new n(f,o),a){let g=d[a],b=d;g===void 0&&(b=d.$,g=b[a]),typeof g=="function"?l=g.call(b,...r):l=g}}),l!==void 0?l:this}})}static register(t,e){var i,r;t=t||this,e=(e??t.NAME).toLowerCase(),this.map.set(e,t);const n=(r=(i=t.toggle)==null?void 0:i.name)==null?void 0:r.toLowerCase();n&&n!==e&&this.toggleMap.set(n,t)}};ss.DEFAULT={},ss.MULTI_INSTANCE=!1,ss.ALL=new Map,ss.TYPED_ALL=new Map,ss.map=new Map,ss.toggleMap=new Map;let zt=ss;function li(s){return zt.map.get(s.toLowerCase())}function Ya(s,t,e={}){let n=li(s);if(n||(n=Qa(s)),!n)return null;const{$update:i,...r}=e;if(!n.MULTI_INSTANCE){const o=n.get(t);if(o)return i&&o.render(r,i==="reset"),o}return new n(t,r)}function Fm(s,t,e={}){requestAnimationFrame(()=>Ya(s,t,e))}function Cu(s,t){zt.register(s,t)}function Qa(s){const{zui:t}=window;if(t){s=s==null?void 0:s.toLowerCase();for(const e in t){const n=e.toLowerCase()===s;if(s&&!n)continue;const i=t[e];if(!(typeof i!="function"||!i.NAME||!i.ZUI)&&(zt.map.has(e.toLowerCase())||Cu(i),n))return i}}}function jm(s){var t;s?(t=li(s))==null||t.defineFn():window._zuiDefined||(Qa(),zt.map.forEach(e=>{e.defineFn()}),Object.assign(window,{_zuiDefined:!0}))}function Bm(s,t={}){const e=m(s);let n=e.attr("zui-create");const{update:i,onCreate:r}=t,o=(a,l)=>{if(l={$update:i,$optionsFromDataset:!1,...l},r){const f=r(a,l);if(f===!1)return;f&&(l=f)}const h=l.$lib;if(h){delete l.$lib,m.getLib(h).then(()=>Ya(a,s,l));return}Fm(a,s,l)};if(typeof n=="string"){n=n.trim();const a=n.length?n.split(",").map(f=>f.trim()):[],l=$s(s,{prefix:"zui-create-",evalValue:!0}),h=Object.keys(l);if(!h.length&&a.length===1)o(a[0],e.dataset());else{const f=new Set;[...a,...h].forEach(d=>{if(f.has(d))return;const g=l[d];o(d,g),delete l[d],f.add(d)})}}else{const a=e.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:t}),delete a.zui,o(l,a)}}function Wm(){m(document).on("click.zui.toggle mouseenter.zui.toggle","[data-toggle],[zui-toggle]",function(s){const t=m(this),e=t.dataset("toggle")||t.attr("zui-toggle");if(!e)return;const n=zt.toggleMap.get(e)||li(e),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&&t.is(o))return;const{onGet:h,onCreate:f,setOptions:d=!0,getOptions:g,prevent:b=!0,handler:w,onToggle:x,convertHref:k}=i;let S=t.dataset();const M=t.attr(`zui-toggle-${e}`);if(M&&(S=m.extend(S,Ss(M))),k&&t.is("a")){const j=t.attr("href");if(j){const K=k===!0?{selector:"target",url:"url"}:k;"#.".includes(j[0])?K.selector&&S[K.selector]===void 0&&(S[K.selector]=j):K.url&&S[K.url]===void 0&&(S[K.url]=j)}}if(g&&(S=g.call(n,this,S,s)),w){w.call(n,this,S,l,s),b&&s.preventDefault();return}let W=h?h.call(n,this):n.get(this);if(W)d&&W.setOptions(S);else{const j=f?f.call(n,this,s,S):new n(this,S);if(!j)return;W=j}if(x){if(x.call(n,W,this,s)===!1)return}else{const{shown:j,show:K,hide:G,toggle:Q}=W;let Z;if(Q?Z=Q:K&&G?j?Z=G:Z=K:K&&(Z=K),Z)Z.call(W);else return}b&&s.preventDefault()})}function Hm(s,t){const e=ri(s),n=[];return Object.keys(e).forEach(i=>{if(!i.startsWith("zui."))return;const r=e[i];(t==null?void 0:t(r,i))!==!1&&n.push(e[i])}),n}let Er=0;function ku(s=100){if(Er&&clearTimeout(Er),s){Er=window.setTimeout(()=>ku(0),s);return}Er=0,zt.ALL.forEach(t=>{t.forEach(e=>e.autoDestroy())})}function Km(){if(ri(document.body,"_autoDestoryMob"))return;const s=new MutationObserver(t=>{let e=!1;for(const n of t)if(n.removedNodes.length){e=!0;break}e&&ku()});s.observe(document.body,{childList:!0,subtree:!0}),vr(document.body,"_autoDestoryMob",s)}m.fn.zuiInit=function(s){return this.find("[zui-create],[data-zui]").each(function(){var t;((t=s==null?void 0:s.beforeCreate)==null?void 0:t.call(s,this))!==!1&&Bm(this,s)}),this.find("[zui-init]").each(function(){this.hasAttribute("z-zui-inited")||(this.setAttribute("z-zui-inited",""),m.runJS(this.getAttribute("zui-init"),["$element",m(this)]))}),this.find(".hide-before-init").removeClass("invisible hidden opacity-0"),this.find(".scroll-into-view").scrollIntoView(),this.find('[data-on="inited"],[zui-on-inited]').each((t,e)=>{const n=m(e);n.zui()||n.trigger("inited")}),this},m.fn.zui=function(s,t){const e=this[0];if(!e)return;if(typeof s!="string"){const i={};let r;return Hm(e,(o,a)=>{i[a]=o,(!r||r.gid1?e[0]:void 0,i=e[e.length>1?1:0],r=m(this).zui(n),o=r==null?void 0:r[i];typeof o=="function"&&o.apply(r,t)}),this},m(()=>{m("body").zuiInit({update:!0}),Wm(),Km()});class Xa extends zt{init(){const{offset:t=1,side:e,zIndex:n,pinnedClass:i="is-pinned",targets:r,scrollContainer:o}=this.options,{$element:a}=this,l=r?a.find(r):a;if(l.css({position:"sticky",zIndex:n}),e&&l.css(e,-t),o){const h=a.closest(o)[0];if(h){const f=()=>{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{if(this._raf=0,h.scrollTop===0&&(!e||e==="top")){l.toggleClass(i,!1);return}const d=h.getBoundingClientRect();l.each((g,b)=>{const x=b.getBoundingClientRect()[e||"top"]===d[e||"top"];b.classList.toggle(i,x)})})};this._scrollListener=f,h.addEventListener("scroll",f)}this._container=h}else this._ob=new IntersectionObserver(h=>{h.forEach(f=>{f.target.classList.toggle(i,f.intersectionRatiothis._ob.observe(f))}destroy(){var t;(t=this._ob)==null||t.disconnect(),this._container&&(this._container.removeEventListener("scroll",this._scrollListener),this._raf&&cancelAnimationFrame(this._raf))}}Xa.NAME="Sticky";function ci(s,t={}){const e=m(s)[0];if(!e)return!1;let{viewport:n}=t;const{left:i,top:r,width:o,height:a}=e.getBoundingClientRect();if(t.checkZeroSize&&!(o*a))return!1;if(!n)if(t.container)n=m(e).closest(t.container)[0].getBoundingClientRect();else{const{innerHeight:w,innerWidth:x}=window,{clientHeight:k,clientWidth:S}=document.documentElement;n={left:0,top:0,width:x||S,height:w||k}}const{left:l,top:h,width:f,height:d}=n;if(t.fullyCheck)return i>=l&&r>=h&&i+o<=f+l&&r+a<=d+h;const g=i<=l+f&&i+o>=l;return r<=h+d&&r+a>=h&&g}m.fn.isVisible=function(s){return ci(this,s)};function Mr(s,t,e=!1){var i;const n=m(s);if(t!==void 0){if(typeof t=="string"&&t.length){const r=`zui-runjs-${ge()}`;n.append(`