From 4e20649aecb91bb2734a7ba354ca518b1889f83a Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 21 May 2024 11:12:20 +0800 Subject: [PATCH] * zui: update zui3 lib. --- www/js/zui3/zui.zentao.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/js/zui3/zui.zentao.js b/www/js/zui3/zui.zentao.js index 1c9475eaf8..4ede61ccc2 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -2,4 +2,4 @@ var qc=(R,Wt,me)=>{if(!Wt.has(R))throw TypeError("Cannot "+me)};var pe=(R,Wt,me) `))}`}const Ip=/file|reset|submit|button|image/i,_h=/radio|checkbox/i;et.serialize=function(){let s="";return this.each((t,e)=>{Jt(e.elements||[e],(n,i)=>{if(i.disabled||!i.name||i.tagName==="FIELDSET"||Ip.test(i.type)||_h.test(i.type)&&!i.checked)return;const r=lh(i);if(!ge(r)){const o=Li(r)?r:[r];Jt(o,(a,c)=>{s+=Mp(i.name,c)})}})}),s.slice(1)},window.$=g;function vh(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))(Xo||{});function le(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/Xo[e]).toFixed(t)+e)}const ls=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)*Xo[n]};let Zo=(document.documentElement.getAttribute("lang")||"zh_cn").toLowerCase().replace("-","_"),Ye;function Ap(){return Zo}function Dp(s){Zo=s.toLowerCase().replace("-","_")}function Ch(s,t){Ye||(Ye={}),typeof s=="string"&&(s={[s]:t??{}}),g.extend(!0,Ye,s)}function Mt(s,t,e,n,i,r){Array.isArray(s)?Ye&&s.unshift(Ye):s=Ye?[Ye,s]:[s],typeof e=="string"&&(r=i,i=n,n=e,e=void 0);const o=i||Zo;let a;for(const c of s){if(!c)continue;const h=c[o]||c.default;if(!h)continue;const f=r&&c===Ye?`${r}.${t}`:t;if(a=wh(h,f),a!==void 0)break}return a===void 0?n:e?$t(a,...Array.isArray(e)?e:[e]):a}function Rp(s,t,e,n){return Mt(void 0,s,t,e,n)}Mt.addLang=Ch,Mt.getLang=Rp,Mt.getCode=Ap,Mt.setCode=Dp,Mt.map=Ye,Ch({zh_cn:{confirm:"确定",save:"保存",cancel:"取消",delete:"删除",reset:"重置",add:"添加"},zh_tw:{confirm:"確定",save:"儲存",cancel:"取消",delete:"刪除",reset:"重置",add:"添加"},en:{confirm:"Confirm",save:"Save",cancel:"Cancel",delete:"Delete",reset:"Reset",add:"Add"}});function kh(s,t,e){s instanceof Headers?s.set(t,e):Array.isArray(s)?s.push([t,e]):s[t]=e}function Ws(s,t,e){e!=null&&(Array.isArray(e)?e.forEach(n=>Ws(s,t,n)):s.append(t,e instanceof Blob?e:String(e)))}function Lp(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 Wi(s,t){const e=t||new FormData;return s&&(typeof s=="string"&&(s=new URLSearchParams(s)),s instanceof URLSearchParams?s.forEach((n,i)=>{Ws(e,i,n)}):Array.isArray(s)?s.forEach(([n,i])=>{Ws(e,n,i)}):s instanceof FormData?s.forEach((n,i)=>{Ws(e,i,n)}):g.isPlainObject(s)&&Object.entries(s).forEach(([n,i])=>{Ws(e,n,i)})),e}class Hi{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:c,timeout:h,dataFilter:f,beforeSend:d,success:_,error:y,complete:w,...k}=this.setting;if((d==null?void 0:d(k))===!1)return;e&&(k.method=e);let x=n;x&&(i&&(x=Wi(x)),k.body=x),o&&(k.mode="cors");const $=k.headers||{};kh($,"X-Requested-With","XMLHttpRequest"),r&&kh($,"Content-Type",r),k.headers=$,k.signal&&k.signal.addEventListener("abort",()=>{this.abort()}),_&&this.success(_),y&&this.fail(y),w&&this.complete(w),k.signal=this._controller.signal,this.url=t,this.request=k}_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,c,h;try{a=await fetch(this.url,this.request),this.response=a;const{statusText:d}=a;if(a.ok){const _=(f=a.headers.get("Content-Disposition"))==null?void 0:f.startsWith("attachment"),y=_?"blob":e||Lp(a.headers.get("Content-Type"),n);_||y==="blob"||y==="file"?h=await a.blob():y==="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,y))??h;this._emit("success",w,d,a)}else throw new Error(d)}catch(d){c=d;let _=!1;c.name==="AbortError"&&(this._abortError?c=this._abortError:_=!0),this.error=c,_||this._emit("error",c,a==null?void 0:a.statusText,c.message)}if(this._timeoutID&&clearTimeout(this._timeoutID),this._emit("complete",a,a==null?void 0:a.statusText),c&&r)throw c;return[h,c,a]}}g.ajax=(s,t)=>{t=t||{},typeof s=="string"?t.url=s:g.extend(t,s);const e=new Hi(t);return e.send(),e},g.getJSON=(s,t,e)=>(typeof t=="function"&&(e=t,t=void 0),g.ajax({url:s,data:t,success:e,dataType:"json"})),g.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,g.ajax({method:i,url:s,data:o,success:r,dataType:n})},g.post=(s,t,e,n)=>g.get(s,t,e,n,"POST"),g.fn.load=function(s,t,e){typeof t=="function"&&(e=t,t=void 0);const[n,i]=s.split(" ");return g.get(n,t,(r,o,a)=>{i&&(r=g(r).find(i).html()),g(this).html(r),e==null||e.call(this,r,o,a)},"html"),this};async function On(s,t=[],e){const n={throws:!0,dataType:"json"};if(typeof s=="string")n.url=s;else if(typeof s=="object")g.extend(n,s);else if(typeof s=="function"){const o=s(...t);return o instanceof Promise?await o:o}e&&g.extend(n,typeof e=="function"?e(n):e);const i=new Hi(n),[r]=await i.send();return r}function Jo(s){return!!(s&&(typeof s=="string"||typeof s=="object"&&s.url||typeof s=="function"))}g.fetch=On;function ce(){return g.guid++}function Ki(s,t){if(s===t)return!1;if(s&&t&&typeof s=="object"&&typeof t=="object"){const e=Array.isArray(s),n=Array.isArray(t);if(e!==n)return!0;if(e&&n){if(s.length!==t.length)return!0;for(let o=0;oKi(n instanceof Fn?n.value:n,e[i])))&&(this._value=this._compute(),this._lastDependencies=t.map(n=>n instanceof Fn?n.cache:n)),this._value}}function ta(...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)?ta(...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 q=(...s)=>ta(...s).reduce((t,[e,n])=>(n&&t.push(e),t),[]).join(" ");g.classes=q,g.fn.setClass=function(s,...t){return this.each((e,n)=>{const i=g(n);s===!0?i.attr("class",q(i.attr("class"),...t)):i.addClass(q(s,...t))})};const Hs=new WeakMap;function ea(s,t,e){const n=Hs.has(s),i=n?Hs.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,g(s).dataset(),i),Hs.set(s,i)):Hs.delete(s)}function na(s,t,e){let n=Hs.get(s)||{};return!e&&s instanceof Element&&(n=Object.assign({},g(s).dataset(),n)),t===void 0?n:n[t]}g.fn.dataset=g.fn.data,g.fn.data=function(...s){const[t,e]=s;return!s.length||s.length===1&&typeof t=="string"?this.length?na(this[0],t):void 0:this.each((n,i)=>ea(i,t,e))},g.fn.removeData=function(s=null){return this.each((t,e)=>ea(e,s))};function Ui(s,t="z-"){const e=g(s)[0];if(e)return Array.from(e.attributes).reduce((n,i)=>{let{name:r,value:o}=i;if(r.startsWith(t)){r=r.slice(t.length).replace(/-([a-z])/g,a=>a[1].toUpperCase());try{o.startsWith("RAWJS<")&&o.endsWith(">RAWJS")?o=new Function(`return ${o.substring(6,o.length-6)}`)():o=JSON.parse(o)}catch{}n[r]=o}return n},{})}function sa(s,t,e="z-"){const n=g(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 Op(...s){var e;const t=s.length;if(!t)return Ui(this);if(t===1){const[n]=s;return typeof n=="string"?(e=Ui(this))==null?void 0:e[n]:(g.isPlainObject(n)&&sa(this,n),this)}return sa(this,{[s[0]]:s[1]}),this}g.fn.z=Op,g.fn._attr=g.fn.attr,g.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)}}),g.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 Ks=(s,t)=>new Promise(e=>{const n=window.setTimeout(e,s);t&&t(n)}),xh={};g.share=xh;var Vi,Rt,Sh;R.isValidElement=void 0;var zn,$h,Th,ia,ra,oa,aa,Us={},Eh=[],Fp=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qi=Array.isArray;function un(s,t){for(var e in t)s[e]=t[e];return s}function Nh(s){var t=s.parentNode;t&&t.removeChild(s)}function N(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?Vi.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 Gi(s,o,n,i,null)}function Gi(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??++Sh,__i:-1,__u:0};return i==null&&Rt.vnode!=null&&Rt.vnode(r),r}function Ct(){return{current:null}}function dn(s){return s.children}function kt(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(ia));Yi.__r=0}function Ih(s,t,e,n,i,r,o,a,c,h,f){var d,_,y,w,k,x=n&&n.__k||Eh,$=t.length;for(e.__d=c,zp(e,t,x),c=e.__d,d=0;d<$;d++)(y=e.__k[d])!=null&&typeof y!="boolean"&&typeof y!="function"&&(_=y.__i===-1?Us:x[y.__i]||Us,y.__i=d,la(s,y,_,i,r,o,a,c,h,f),w=y.__e,y.ref&&_.ref!=y.ref&&(_.ref&&ca(_.ref,null,y),f.push(y.ref,y.__c||w,y)),k==null&&w!=null&&(k=w),65536&y.__u||_.__k===y.__k?(c&&!c.isConnected&&(c=jn(_)),c=Ah(y,c,s)):typeof y.type=="function"&&y.__d!==void 0?c=y.__d:w&&(c=w.nextSibling),y.__d=void 0,y.__u&=-196609);e.__d=c,e.__e=k}function zp(s,t,e){var n,i,r,o,a,c=t.length,h=e.length,f=h,d=0;for(s.__k=[],n=0;n0?Gi(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)!=null?(i.__=s,i.__b=s.__b+1,a=jp(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?f>c-o?d+=a-o:d--:a(c!=null&&!(131072&c.__u)?1:0))for(;o>=0||a=0){if((c=t[o])&&!(131072&c.__u)&&i==c.key&&r===c.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=[...Qi(r),...Qi(i)]:typeof r=="object"&&(n==="style"||n.endsWith("Style")||n==="attrs"||n.endsWith("Attrs")||n==="props")&&(i=g.extend(r,i))),s[n]=i)})}),s}function ua(s){return Object.keys(s).forEach(t=>{s[t]===void 0&&delete s[t]}),s}const cs=new Map;function Vs(s){const{zui:t}=window;return(!cs.size||s&&!cs.has(s.toUpperCase()))&&Object.keys(t).forEach(e=>{const n=t[e];!n.NAME||!n.ZUI||cs.set(e.toLowerCase(),n)}),s?cs.get(s.toLowerCase()):void 0}function Oh(s,t,e){const n=Vs(s);return n?!n.MULTI_INSTANCE&&n.get(t)?(console.error(`[ZUI] cannot create component "${s}" on element which already has a component instance.`,{element:t,options:e}),null):new n(t,e):null}function Hp(s){if(s){const t=Vs(s);t&&t.defineFn()}else Vs(),cs.forEach(t=>{t.defineFn()})}g.fn.zuiInit=function(){return this.find("[zui-create],[data-zui]").each(function(){const s=g(this);let t=Ui(s,"data-");const[e,n]=(t.zui||s.attr("zui-create")).split(":");s.zui(e)||(n?t=g.share[n]:delete t.zui,requestAnimationFrame(()=>Oh(e,this,t)))}),this.find("[zui-init]").each(function(){const s=g(this);s.z("zuiInited")||g.runJS(s.z("zuiInited",!0).attr("zui-init"),["$element",s])}),this.find(".hide-before-init").removeClass("invisible hidden opacity-0"),this.find(".scroll-into-view").scrollIntoView(),this.find('[data-on="inited"]').each((s,t)=>{const e=g(t);e.zui()||e.trigger("inited")}),this},g.fn.zui=function(s,t){const e=this[0];if(!e)return;if(typeof s!="string"){const i=na(e,void 0,!0),r={};let o;return Object.keys(i).forEach(a=>{if(a.startsWith("zui.")){const c=i[a];r[a]=c,(!o||o.gid{g("body").zuiInit()});function Fh(s,t=!0){const e=g(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)}}g.fn.disableScroll=function(s=!0){return this.each((t,e)=>{Fh(e,s)})},g.fn.enableScroll=function(s=!0){return this.disableScroll(!s)};function Kp(s){const t=g(this),e=t.dataset();if(!(e.on||"click").split(" ").includes(s.type))return;const n=e.selector?g(s.target).closest(e.selector):t;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(e.once)){if(e.onceCalled)return;t.dataset("once-called",!0)}if(i(e.prevent)&&s.preventDefault(),i(e.stop)&&s.stopPropagation(),i(e.self)&&s.currentTarget!==s.target)return;const o=[["$element",t],["event",s],["options",e],["$target",n]];if(e.if&&!g.runJS(e.if,...o))return;const a=e.call;if(a){let c=window[a];const h=/^[$A-Z_][0-9A-Z_$.]*$/i.test(a);if(c||(c=g.runJS(a,...o)),!h||!g.isFunction(c))return;const f=[],d=e.params;e.params=f,typeof d=="string"&&d.length?d[0]==="["?f.push(...r(d)):f.push(...d.split(", ").map(_=>(_=_.trim(),_==="$element"?t:_==="event"?s:_==="options"?e:_.startsWith("$element.")||_.startsWith("event.")||_.startsWith("options.")?g.runJS(_,...o):r(_)))):f.push(d),c(...f)}e.do&&g.runJS(e.do,...o)}g(document).on("click.zui.global change.zui.global inited.zui.global","[data-on]",Kp);function hs(s){if(typeof s=="function")return hs(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 Gt(s){if(s==null)return null;const[t,e="px"]=hs(s);return Number.isNaN(t)?typeof s=="string"?s:null:`${t}${e}`}async function Zi(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,"")),Zi(o,t)}const e=await fetch(s);return Zi(e)}class zh{constructor(t){this._$target=g(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 ze=new zh(document);g.bus=ze,g.on=ze.on.bind(ze),g.one=ze.one.bind(ze),g.off=ze.off.bind(ze),g.trigger=ze.trigger.bind(ze);var Up=["Shift","Meta","Alt","Control"],jh=typeof navigator=="object"?navigator.platform:"",Bh=/Mac|iPod|iPhone|iPad/.test(jh),Vp=Bh?"Meta":"Control",qp=jh==="Win32"?["Control","Alt"]:Bh?["Alt"]:[];function da(s,t){return typeof s.getModifierState=="function"&&(s.getModifierState(t)||qp.includes(t)&&s.getModifierState("AltGraph"))}function Gp(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"?Vp:i}),n]})}function Wh(s,t){var e;t===void 0&&(t={});var n=(e=t.timeout)!=null?e:1e3,i=Object.keys(s).map(function(a){return[Gp(a),s[a]]}),r=new Map,o=null;return function(a){a instanceof KeyboardEvent&&(i.forEach(function(c){var h=c[0],f=c[1],d=r.get(h)||h;(function(_,y){return!(y[1].toUpperCase()!==_.key.toUpperCase()&&y[1]!==_.code||y[0].find(function(w){return!da(_,w)})||Up.find(function(w){return!y[0].includes(w)&&y[1]!==w&&da(_,w)}))})(a,d[0])?d.length>1?r.set(h,d.slice(1)):(r.delete(h),f(a)):da(a,a.key)||r.delete(h)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function Yp(s,t,e){var n;e===void 0&&(e={});var i=(n=e.event)!=null?n:"keydown",r=Wh(t,e);return s.addEventListener(i,r),function(){s.removeEventListener(i,r)}}function fa(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 pa(s,t,e){const{timeout:n,event:i="keydown",scope:r,when:o}=e||{},a=Wh(t,{timeout:n}),c=`.zui.hotkeys${r?`.${r}`:""}`,h="zui-hotkeys-composing";return g(s).on(`${i}${c}`,function(f){o&&o(f)===!1||g(f.target).data(h)||a(f)}).on(`compositionstart${c}`,f=>{g(f.target).data(h,!0)}).on(`compositionend${c}`,f=>{g(f.target).removeData(h)})}function ma(s,t){return g(s).off(`.zui.hotkeys${t?`.${t}`:""}`)}const Qp=Yp;g.fn.hotkeys=function(s,t){return pa(this,s,t)},g.fn.unbindHotkeys=function(s){return ma(this,s)},g.hotkeys=function(s,t){pa(window,s,t)},g.unbindHotkeys=function(s){ma(window,s)};function Ji(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function Hh(s){(typeof s=="string"||s instanceof Element||s instanceof g)&&(s={target:s});const{target:t,onError:e,onSuccess:n,afterExit:i,afterEnter:r}=s,o=g(t),a=o[0];if(!a)return;const c=a.requestFullscreen||a.webkitRequestFullscreen||a.mozRequestFullScreen;if(!c){e==null||e.call(a,new Error("[ZUI] The browser does not support full screen feature."));return}try{await c.call(a),n==null||n.call(a),g(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,g(document).on("fullscreenchange.zui webkitfullscreenchange.zui mozfullscreenchange.zui",h=>{const f=Ji();let d=f;f?g(f).addClass("is-in-fullscreen"):(d=g(document).find(".is-in-fullscreen")[0]||document,g(d).removeClass("is-in-fullscreen")),g("body").toggleClass("has-in-fullscreen",!!f);const _={event:h,target:d,fullscreenElement:f};g(d).trigger(f?"enterFullscreen":"exitFullscreen",_).trigger("toggleFullscreen",_)}))}async function ga(s){const t=Ji();return s===!1&&!!t===s?s:t?(document.exitFullscreen(),!1):(await Hh(s),!0)}g.fn.fullscreen=function(s){return ga({target:this,...s})},g.getFullscreenElement=Ji,g.toggleFullscreen=ga;function Wn(s){return s.parentNode===document?!1:s.parentNode?Wn(s.parentNode):!0}g.isDetached=Wn,g.fn.isDetached=function(){const s=this[0];return!s||Wn(s)};class Ft{constructor(t,e){this._inited=!1,this._autoDestory=0;const{KEY:n,DATA_KEY:i,DEFAULT:r,MULTI_INSTANCE:o,NAME:a}=this.constructor;if(!a)throw new Error('[ZUI] The component must have a "NAME" static property.');const c=g(t);if(c.data(n)&&!o)throw new Error("[ZUI] The component has been initialized on element.");const h=c[0],f=ce();this._gid=f,this._element=h;const d=c.parent();if(d.length&&(this._mobs=new MutationObserver(_=>{_.forEach(y=>{y.removedNodes.forEach(w=>{w===h&&(this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,Wn(h)&&this.destroy()},100))})})}),this._mobs.observe(d[0],{childList:!0,subtree:!1})),this._options={...r,...c.dataset()},this.setOptions(e),this._key=this.options.key??`__${f}`,c.data(n,this).attr(i,`${f}`),o){const _=`${n}:ALL`;let y=c.data(_);y||(y=new Map,c.data(_,y)),y.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 SELECTOR(){return`[${this.DATA_KEY}]`}get inited(){return this._inited}get element(){return this._element}get key(){return this._key}get options(){return this._options}get gid(){return this._gid}get $element(){return g(this.element)}get $emitter(){return this.$element}get i18nData(){return[this.options.i18n,this.constructor.i18n]}init(){}afterInit(){}render(t){this.setOptions(t)}destroy(){var r;const{KEY:t,DATA_KEY:e,MULTI_INSTANCE:n}=this.constructor,{$element:i}=this;if(this.emit("destroyed"),(r=this._mobs)==null||r.disconnect(),i.off(this.namespace).removeData(t).attr(e,null),n){const o=this.$element.data(`${t}:ALL`);if(o)if(o.delete(this._key),o.size===0)this.$element.removeData(`${t}:ALL`);else{const a=o.values().next().value;i.data(t,a).attr(e,a.gid)}}}setOptions(t){return t&&g.extend(this._options,t),this._options}emit(t,...e){const n=g.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 Mt(i,t,e,n,this.options.lang,this.constructor.NAME)??Mt(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=g(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 ensure(t,e){const n=this.get(t,e==null?void 0:e.key);return n?(e&&n.setOptions(e),n):new this(t,e)}static getAll(t){const{MULTI_INSTANCE:e,SELECTOR:n}=this,i=[];return g(t||document).find(n).each((r,o)=>{if(e){const c=g(o).data(`${this.KEY}:ALL`);if(c){i.push(...c.values());return}}const a=g(o).data(this.KEY);a&&i.push(a)}),i.sort((r,o)=>r.gid-o.gid)}static query(t,e,n){if(t===void 0){let i=this.getAll();return n&&(i=i.filter(n)),i.pop()}return this.get(g(t).closest(this.SELECTOR),e)}static defineFn(t){let e=t||this.ZUI;g.fn[e]&&(e=`zui${this.NAME}`);const n=this;g.fn.extend({[e](i,...r){const o=typeof i=="object"?i:void 0,a=typeof i=="string"?i:void 0;let c;return this.each((h,f)=>{let d=n.get(f);if(d?o&&d.render(o):d=new n(f,o),a){let _=d[a],y=d;_===void 0&&(y=d.$,_=y[a]),typeof _=="function"?c=_.call(y,...r):c=_}}),c!==void 0?c:this}})}}Ft.DEFAULT={},Ft.MULTI_INSTANCE=!1;class Kh extends Ft{init(){const{offset:t=1,side:e,zIndex:n,pinnedClass:i="is-pinned"}=this.options,{$element:r}=this;r.css({position:"sticky",zIndex:n}),e&&r.css(e,-t),this._ob=new IntersectionObserver(([o])=>o.target.classList.toggle(i,o.intersectionRatio=c&&r>=h&&i+o<=f&&r+a<=d;const _=i<=f&&i+o>=c;return r<=d&&r+a>=h&&_}g.fn.isVisible=function(s){return tr(this,s)};function ya(s,t,e=!1){const n=g(s);if(t!==void 0){if(t.length){const i=`zui-runjs-${ce()}`;n.append(`