From a734bc78cee11731ff1313da0b7c712afdec3fd1 Mon Sep 17 00:00:00 2001 From: sunhao Date: Tue, 5 Nov 2024 11:23:00 +0800 Subject: [PATCH] * [misc] update zui3 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 80cc326e2b..0241bd5d92 100644 --- a/www/js/zui3/zui.zentao.js +++ b/www/js/zui3/zui.zentao.js @@ -3,8 +3,8 @@ var au=(N,et,Tt)=>{if(!et.has(N))throw TypeError("Cannot "+Tt)};var St=(N,et,Tt) `)),new Function(`return ${i}`)(...e)}function al(i,...e){return i.includes("RAWJS")?ii(i,...e):JSON.parse(i)}function Ni(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,b=>b[1].toUpperCase()),s)g=s(u,p);else try{r&&(!l||l.has(u))||r===void 0&&p.includes("RAWJS")?g=ii(p,...a):o&&(g=JSON.parse(p))}catch{}c[u]=g}return c},{})}function ll(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 Zg(...i){var t;const e=i.length;if(!e)return Ni(this);if(e===1){const[n]=i;return typeof n=="string"?(t=Ni(this))==null?void 0:t[n]:(y.isPlainObject(n)&&ll(this,n),this)}return ll(this,{[i[0]]:i[1]}),this}y.fn.z=Zg,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 gs=(i,e)=>new Promise(t=>{const n=window.setTimeout(t,i);e&&e(n)}),Fu={};y.share=Fu;var Pr,Oe,ju;N.isValidElement=void 0;var si,Bu,Hu,cl,hl,ul,dl,ys={},Wu=[],Jg=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Lr=Array.isArray;function $n(i,e){for(var t in e)i[t]=e[t];return i}function Uu(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function w(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?Pr.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 Rr(i,o,n,s,null)}function Rr(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??++ju,__i:-1,__u:0};return s==null&&Oe.vnode!=null&&Oe.vnode(r),r}function fe(){return{current:null}}function Dn(i){return i.children}function pe(i,e){this.props=i,this.context=e}function Mi(i,e){if(e==null)return i.__?Mi(i.__,i.__i+1):null;for(var t;ee&&si.sort(cl));Or.__r=0}function qu(i,e,t,n,s,r,o,a,l,c,d){var u,p,g,b,C,T=n&&n.__k||Wu,x=e.length;for(t.__d=l,ey(t,e,T),l=t.__d,u=0;u0?Rr(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=ty(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=[...zr(r),...zr(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 ml(i){return Object.keys(i).forEach(e=>{i[e]===void 0&&delete i[e]}),i}function Ju(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)=>{Ju(t,i)})},y.fn.enableScroll=function(i=!0){return this.disableScroll(!i)};function gl(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)?fs(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)&&gl(e,i,y.extend({on:o},a?a.startsWith("{")?ii(a):{do:a}:Ni(e,{prefix:"data-",evalValue:["call","if","do"]})))}const s=e.attr(`zui-on-${t}`);s&&gl(e,i,y.extend({on:t},s.startsWith("{")?ii(s):{do:s}));const r=e.attr("data-on");r&&r.split(" ").includes(t)&&gl(e,i,Ni(e,{prefix:"data-",evalValue:["call","if","do"]}))}function ed(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(()=>{ed(["click","change","inited"])});function oi(i,e){if(typeof i=="function")return oi(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 Be(i,e){if(i==null)return null;const[t,n="px"]=oi(i,e);return Number.isNaN(t)?typeof i=="string"?i:null:`${t}${n}`}async function jr(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,"")),jr(o,e)}const t=await fetch(i);return jr(t)}class td{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 Qt=new td(document);y.bus=Qt,y.on=Qt.on.bind(Qt),y.one=Qt.one.bind(Qt),y.off=Qt.off.bind(Qt),y.trigger=Qt.trigger.bind(Qt);var ry=["Shift","Meta","Alt","Control"],nd=typeof navigator=="object"?navigator.platform:"",id=/Mac|iPod|iPhone|iPad/.test(nd),oy=id?"Meta":"Control",ay=nd==="Win32"?["Control","Alt"]:id?["Alt"]:[];function yl(i,e){return typeof i.getModifierState=="function"&&(i.getModifierState(e)||ay.includes(e)&&i.getModifierState("AltGraph"))}function ly(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"?oy:s}),n]})}function sd(i,e){var t;e===void 0&&(e={});var n=(t=e.timeout)!=null?t:1e3,s=Object.keys(i).map(function(a){return[ly(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(b){return!yl(p,b)})||ry.find(function(b){return!g[0].includes(b)&&g[1]!==b&&yl(p,b)}))})(a,u[0])?u.length>1?r.set(c,u.slice(1)):(r.delete(c),d(a)):yl(a,a.key)||r.delete(c)}),o&&clearTimeout(o),o=setTimeout(r.clear.bind(r),n))}}function cy(i,e,t){var n;t===void 0&&(t={});var s=(n=t.event)!=null?n:"keydown",r=sd(e,t);return i.addEventListener(s,r),function(){i.removeEventListener(s,r)}}function _l(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 vl(i,e,t){const{timeout:n,event:s="keydown",scope:r,when:o}=t||{},a=sd(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 bl(i,e){return y(i).off(`.zui.hotkeys${e?`.${e}`:""}`)}const hy=cy;y.fn.hotkeys=function(i,e){return vl(this,i,e)},y.fn.unbindHotkeys=function(i){return bl(this,i)},y.hotkeys=function(i,e){vl(window,i,e)},y.unbindHotkeys=function(i){bl(window,i)};function Br(){return document.fullscreenElement||document.webkitFullscreenElement||document.mozFullScreenElement}async function rd(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=Br();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 wl(i){const e=Br();return i===!1&&!!e===i?i:e?(document.exitFullscreen(),!1):(await rd(i),!0)}y.fn.fullscreen=function(i){return wl({target:this,...i})},y.getFullscreenElement=Br,y.toggleFullscreen=wl;function In(i){return!i||i.parentNode===document?!1:i.parentNode?In(i.parentNode):!0}y.isDetached=In,y.fn.isDetached=function(){const i=this[0];return!i||In(i)};const ai=class Km{constructor(e,t){var g;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=ft();if(this._gid=p,this._element=u,this.resetOptions(t),this._key=this.options.key??`__${p}`,l.has(u)?l.get(u).add(this):l.set(u,new Set([this])),c.has(o)?c.get(o).add(this):c.set(o,new Set([this])),d.data(n,this).attr(a,"").attr(s,`${p}`),r){const b=`${n}:ALL`;let C=d.data(b);C||(C=new Map,d.data(b,C)),C.set(this._key,this)}this.init(),(g=this.options.$onCreate)==null||g.call(this),requestAnimationFrame(async()=>{var b;this._inited=!0,await this.afterInit(),this.emit("inited",this.options),(b=this.options.$onInited)==null||b.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 p;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 g=this.$element.data(`${e}:ALL`);if(g)if(g.delete(this._key),g.size===0)this.$element.removeData(`${e}:ALL`);else{const b=g.values().next().value;l.data(e,b).attr(t,String(b==null?void 0:b.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)),(p=this.options.$onDestroy)==null||p.call(this)}autoDestroy(e=100){this._autoDestory&&clearTimeout(this._autoDestory),this._autoDestory=window.setTimeout(()=>{this._autoDestory=0,In(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!==Km?(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)}};ai.DEFAULT={},ai.MULTI_INSTANCE=!1,ai.ALL=new Map,ai.TYPED_ALL=new Map,ai.map=new Map,ai.toggleMap=new Map;let ze=ai;function _s(i){return ze.map.get(i.toLowerCase())}function Cl(i,e,t={}){let n=_s(i);if(n||(n=xl(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 uy(i,e,t={}){requestAnimationFrame(()=>Cl(i,e,t))}function od(i,e){ze.register(i,e)}function xl(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)&&(ze.map.has(t.toLowerCase())||od(s),n))return s}}}function dy(i){var e;i?(e=_s(i))==null||e.defineFn():window._zuiDefined||(xl(),ze.map.forEach(t=>{t.defineFn()}),Object.assign(window,{_zuiDefined:!0}))}function fy(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(()=>Cl(a,i,l));return}uy(a,i,l)};if(typeof n=="string"){n=n.trim();const a=n.length?n.split(",").map(d=>d.trim()):[],l=Ni(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 py(){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=ze.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:b,onToggle:C,convertHref:T}=s;let x=e.dataset();const D=e.attr(`zui-toggle-${t}`);if(D&&(x=y.extend(x,ii(D))),T&&e.is("a")){const F=e.attr("href");if(F){const H=T===!0?{selector:"target",url:"url"}:T;"#.".includes(F[0])?H.selector&&x[H.selector]===void 0&&(x[H.selector]=F):H.url&&x[H.url]===void 0&&(x[H.url]=F)}}if(p&&(x=p.call(n,this,x,i)),b){b.call(n,this,x,l,i),g&&i.preventDefault();return}let A=c?c.call(n,this):n.get(this);if(A)u&&A.setOptions(x);else{const F=d?d.call(n,this,i,x):new n(this,x);if(!F)return;A=F}if(C){if(C.call(n,A,this,i)===!1)return}else{const{shown:F,show:H,hide:G,toggle:Y}=A;let Z;if(Y?Z=Y:H&&G?F?Z=G:Z=H:H&&(Z=H),Z)Z.call(A);else return}g&&i.preventDefault()})}function my(i,e){const t=ms(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 Hr=0;function ad(i=100){if(Hr&&clearTimeout(Hr),i){Hr=window.setTimeout(()=>ad(0),i);return}Hr=0,ze.ALL.forEach(e=>{e.forEach(t=>t.autoDestroy())})}function gy(){if(!document.body||ms(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&&ad()});i.observe(document.body,{childList:!0,subtree:!0}),Ar(document.body,"_autoDestoryMob",i)}y.fn.zuiInit=function(i){return this.find("[zui-create],[data-zui]").each(function(){var e;((e=i==null?void 0:i.beforeCreate)==null?void 0:e.call(i,this))!==!1&&fy(this,i)}),this.find("[zui-init]").each(function(){this.hasAttribute("z-zui-inited")||(this.setAttribute("z-zui-inited",""),y.runJS(this.getAttribute("zui-init"),["$element",y(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((e,t)=>{const n=y(t);n.zui()||n.trigger("inited")}),this},y.fn.zui=function(i,e){const t=this[0];if(!t)return;if(typeof i!="string"){const s={};let r;return my(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}),py(),gy()});class kl extends ze{init(){const{offset:e=1,side:t,zIndex:n,pinnedClass:s="is-pinned",targets:r,scrollContainer:o}=this.options,{$element:a}=this,l=r?a.find(r):a;if(l.css({position:"sticky",zIndex:n}),t&&l.css(t,-e),o){const c=a.closest(o)[0];if(c){const d=()=>{this._raf&&cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{if(this._raf=0,c.scrollTop===0&&(!t||t==="top")){l.toggleClass(s,!1);return}const u=c.getBoundingClientRect();l.each((p,g)=>{const C=g.getBoundingClientRect()[t||"top"]===u[t||"top"];g.classList.toggle(s,C)})})};this._scrollListener=d,c.addEventListener("scroll",d)}this._container=c}else this._ob=new IntersectionObserver(c=>{c.forEach(d=>{d.target.classList.toggle(s,d.intersectionRatiothis._ob.observe(d))}destroy(){var e;(e=this._ob)==null||e.disconnect(),this._container&&(this._container.removeEventListener("scroll",this._scrollListener),this._raf&&cancelAnimationFrame(this._raf))}}kl.NAME="Sticky";const Ei=24*60*60*1e3,We=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),ld=(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(We(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},Nn=(i,e=new Date)=>We(i).toDateString()===We(e).toDateString(),vs=(i,e=new Date)=>We(i).getFullYear()===We(e).getFullYear(),Sl=(i,e=new Date)=>(i=We(i),e=We(e),i.getFullYear()===e.getFullYear()&&i.getMonth()===e.getMonth()),yy=(i,e=new Date)=>{i=We(i),e=We(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)},_y=(i,e)=>Nn(We(e),i),vy=(i,e)=>Nn(We(e).getTime()-Ei,i),by=(i,e)=>Nn(We(e).getTime()+Ei,i),Tl=i=>i!=null&&!isNaN(We(i).getTime()),ht=(i,e="yyyy-MM-dd hh:mm",t="")=>{if(i=We(i),!Tl(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-]",vs(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},wy=(i,e,t)=>{const n={full:"yyyy-M-d",month:"M-d",day:"d",str:"{0} ~ {1}",...t},s=ht(i,vs(i)?n.month:n.full);if(Nn(i,e))return s;const r=ht(e,vs(i,e)?Sl(i,e)?n.day:n.month:n.full);return n.str.replace("{0}",s).replace("{1}",r)};function $l(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 cd(i){if(Array.isArray(i))return{commands:i.map(Wr).filter(Boolean)};if(typeof i=="object")return i;i=i.replace(/^#!?/,"");const e=i.includes(">"),t=i.split(e?">":"|").map(Wr);return{async:e,commands:t.filter(Boolean)}}function Dl(i,e,t){if(typeof i=="string"&&(i=Wr(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 hd(i,e){const{async:t,commands:n}=cd(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 Dl(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 Dl(o,e)}))}const Ai="zui.commands",Pi="z-commands",Cy="zui-commands-proxy",ud="zui-command";function Ur(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(Pi)||"").split(",");t&&!r.includes(t)&&r.push(t),s.attr(Pi,r.join(",")).data(Ai,{[t]:{...e,scope:t,events:n,gid:ft()},...s.data(Ai)})}function Vr(i,e=!0){const t=y(i);if(e===!0)t.removeAttr(Pi),t.removeData(Ai);else if(e.length){const n=t.data(Ai)||{};e.split(",").forEach(r=>{delete n[r]});const s=Object.keys(n);s.length?t.attr(Pi,s.join(",")).data(Ai,Ur):Vr(t,!0)}}function dd(i,e){let t=i.closest(`[${Pi}]`);if(!t.length){const o=i.closest(`[${Cy}]`);o.length&&(t=y(o.data("zui.commandProxy")||o.attr("COMMAND_PROXY_ATTR")).closest(`[${Pi}]`))}if(!t.length)return;const n=t.data(Ai)||{},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=dd(i.parent(),e),r)}function xy(i){if(!i.currentTarget)return;const e=y(i.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,s=()=>n.abort();hd(t,{signal:n.signal,execute:(r,o)=>{const{scope:a,name:l}=r,c={...r,abort:s};let d;const u=dd(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():Tn(i,l,o);return}return a==="window"?Tn(window,l,o):a==="zui"?Tn(window.zui,l,o):a==="target"?Tn(e[0],l,o):a==="$target"?Tn(e,l,o):a==="$"?Tn(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)=>Ur(t,i)),this},y.fn.unbindCommands=function(i){return this.each((e,t)=>Vr(t,i)),this},y(()=>{y(document).on("click.zui.command",`[${ud}],a[href^="#!"]`,xy)});function bs(i,e={}){const t=y(i)[0];if(!t)return!1;let{viewport:n}=e;const{left:s,top:r,width:o,height:a}=t.getBoundingClientRect();if(e.checkZeroSize&&!(o*a))return!1;if(!n)if(e.container)n=y(t).closest(e.container)[0].getBoundingClientRect();else{const{innerHeight:b,innerWidth:C}=window,{clientHeight:T,clientWidth:x}=document.documentElement;n={left:0,top:0,width:C||x,height:b||T}}const{left:l,top:c,width:d,height:u}=n;if(e.fullyCheck)return s>=l&&r>=c&&s+o<=d+l&&r+a<=u+c;const p=s<=l+d&&s+o>=l;return r<=c+u&&r+a>=c&&p}y.fn.isVisible=function(i){return bs(this,i)};function Kr(i,e,t=!1){var s;const n=y(i);if(e!==void 0){if(typeof e=="string"&&e.length){const r=`zui-runjs-${ft()}`;n.append(`