UNPKG

@moomfe/zenjs

Version:

ZenJS 是一个高性能的 JavaScript 工具库。

10 lines (8 loc) 37.2 kB
/*! * Zen.js v5.0.0-beta.5 * https://github.com/MoomFE/ZenJS * * (c) 2018 Wei Zhang * Released under the MIT License. */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.ZenJS=e()}(this,function(){"use strict";var u=Object.defineProperty,p=Object.keys;function $(t){for(var e,n,r=p(t),i=Array(e=r.length);e--;)i[e]=[n=r[e],t[n]];return i}var t=Object.prototype,o=t.toString,r=Object.getPrototypeOf,g=Object.hasOwnProperty;function d(t){return"function"==typeof t}var a=g.toString,f=a.call(Object);function m(t){if(!t||"[object Object]"!==o.call(t))return!1;var e=r(t);if(!e)return!0;var n=g.call(e,"constructor")&&e.constructor;return d(n)&&a.call(n)===f}var y=Object.create,s=String.prototype,e=Boolean.prototype,l=Array.prototype,n=Function.prototype;[["String",s],["Boolean",e],["Array",l],["Function",n]].forEach(function(t){u(t[1],"__is"+t[0]+"__",{value:!0,configurable:!1,enumerable:!1,writable:!1})});var c="__isString__",h="__isBoolean__",b="__isArray__",v="__isFunction__",S=l.slice;function w(t,e,n,r){for(var i,u,o,a,f,s,c,l,h,d=e.length,p=1,v=e[0]||(null!==e[0]?{}:(r=!0,y(null)));p<d;p++)if(null!=(i=e[p]))for(o=(u=$(i)).length,a=0;a<o;a++)if(s=(f=u[a])[0],c=f[1],!t&&c&&(m(c)||c[b])){if(c===v)continue;if(n&&n===c){if(1===o)return;continue}l=v[s],void 0!==w(!1,[h=c[b]?[]:l&&m(l)?l:r?y(null):{},c],i,r)&&(v[s]=h)}else void 0===c&&!1!==g.call(v,s)||(v[s]=c);return v}var E=Object.assign||function(){return w(!0,arguments)},M=Array.isArray;function D(e,n,r,i){null!=e&&(M(e)&&e instanceof Array?e.forEach(function(t){return D(t,n,r,i)}):n.split(" ").forEach(function(t){u(e,t,E({},r,i))}))}var _={configurable:!0,enumerable:!1,writable:!0},O={configurable:!0,enumerable:!1};function x(t,e,n,r){return D(t,e,{value:n},r||_),n}function A(t){return"string"==typeof t}function C(t){return"number"==typeof t&&t==t}function j(t){var e=t;return!(!(C(t)||A(t)&&!isNaN(t-(e=parseFloat(t))))||!isFinite(e))}function N(t,e,n){if(!C(t)||t<1)return[];var r=0,i=Array(t);if(!n&&d(e))for(;r<t;r++)i[r]=e(r);else for(;r<t;r++)i[r]=e;return i}var T=Math.ceil;function k(n,r){var t;return!n||r<1||!(t=n.length)?[]:N(T(t/r),function(t){var e=t*r;return n.slice(e,e+r)})}function L(t,e){if(!t||!t.length||!d(e))return t;for(var n,r=t.length,i=0;i<r&&(n=t[i],!1!==e.call(n,n,i,t));i++);return t}x(Array,"$chunk",k),x(l,"$chunk",function(t){return k(this,t)}),x(Array,"$copy",function(t,e){return t&&t.length?M(e)?e.concat(t):S.call(t):[]}),x(Array,"$create",N),x(Array,"$each",L),x(l,"$each",function(t){return L(this,t)});var H=9007199254740991;function I(t){if(null==t||t[v])return!1;if(t[b])return!0;var e=t.length;return!!(C(e)&&-1<e&&e%1==0&&e<=H)}function R(t,e,n){var r;return t.length>e&&void 0!==(r=t[e])?r:n}function B(t,e){return t==e}function P(t,e){return t===e}function F(t){return d(t)?t:t?P:B}function U(t,e,n,r){return 1<t.length?r=F(R(t,n,!0)):d(e)?(r=e,e=void 0):r=P,[e,r]}function Y(t,e){if(!I(t)||!I(e))return!1;var n=t.length;if(n!==e.length)return!1;for(var r=F(R(arguments,2,!0)),i=0;i<n;i++)if(!r(t[i],e[i]))return!1;return!0}x(Array,"$equals",Y),x(l,"$equals",function(t,e){return Y(this,t,e)}),x(Array,"$isArrayLike",I);var W=/[\u200d\ud800-\udfff\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff\ufe0e\ufe0f]/,V=/\ud83c[\udffb-\udfff](?=\ud83c[\udffb-\udfff])|(?:[^\ud800-\udfff][\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]?|[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g;function q(t){return d(Map)&&t instanceof Map}function J(t){return d(Set)&&t instanceof Set}function Z(t){var n=[];return t instanceof Map?t.forEach(function(t,e){return n.push([e,t])}):t.forEach(function(t){return n.push(t)}),n}function z(e){return p(e).map(function(t){return e[t]})}function G(t,e){return!t||t[h]?[]:t[c]?W.test(t)?t.match(V)||[]:t.split(""):I(t)?S.call(t):q(t)||J(t)?Z(t):m(t)?e?p(t):z(t):[]}function K(t,e){return S.call(t,e||0)}function Q(t,e,n){return(!j(e)||e<0&&(e=t.length+Number(e)+(n||0))<0)&&(e=0),e}function X(t,e,n){var r=n.length;if(!r)return t;e=Q(t,e,1);for(var i=0;i<r;i++)t.splice(e++,0,n[i]);return t}function tt(t){return"boolean"==typeof t}function et(t){for(var e in t)return!1;return!0}function nt(e,n){var r=e[b];return function(t){return null!=e&&!et(t)&&(r?function(t,e,n){for(var r,i,u=t.length,o=0;o<u;o++)if(r=t[o],!((i=r[0])in e)||1!==r.length&&!n(r[1],e[i]))return!1;return!0}:function(t,e,n){for(var r,i=p(t),u=i.length,o=0;o<u;o++)if(!((r=i[o])in e&&n(t[r],e[r])))return!1;return!0})(e,t,n)}}function rt(t,e){if(null==t)return t;for(var n,r,i=p(t),u=i.length,o=0;o<u&&(r=t[n=i[o]],!1!==e.call(r,n,r,t));o++);return t}function it(t){return null!==t&&"object"==typeof t}function ut(t,e,n){t[e=Q(t,e)]=void 0,t.splice(e,1,n)}function ot(t,e,n){var r=t.length;(e=Q(t,e))>=r&&(e=r-1),t.splice(e,1,n)}x(Array,"$toArray",G),x(l,"$add",function(t){return X(this,t,K(arguments,1))}),x(l,"$delete $remove",function(t,e,n){var r=this.length;(t=Q(this,t))>=r&&(t=r-1);var i=R(arguments,1,1),u=this.splice(t,i);return n?u:this}),x(l,"$deleteValue $removeValue",function(t){var e,n=this.length;if(!n)return this;var r=U(arguments,t,1),i=r[0],u=r[1];for(e=0;e<n;)u(this[e],i)?(this.$delete(e),n--):e++;return this}),x(l,"$concat",function(){var e=this;return S.call(arguments).forEach(function(t){X(e,-1,M(t)?t:[t])}),this}),x(l,"$concatTo",function(e){var n=this,t=K(arguments,1);if(!t.length)return this;var r=this.length,i=0;return e=Q(this,e,1),t.forEach(function(t){X(n,i+e,M(t)?t:[t]),i=n.length-r}),this}),x(Object,"$each",rt),x(t,"$each",function(t){return rt(this,t)}),rt({$find:[!1,1],$findLast:[!0,1],$findAll:[!1,1/0],$findSome:[!1],$findLastSome:[!0]},function(r,t){var f=t[0],s=t[1],c=-1<r.indexOf("All")||!s;["","Index","Chunk"].forEach(function(n,t){var o=1===t?0:1,a=2===t;["","Not"].forEach(function(t,e){var u=!!e;x(l,r+t+n,function(t,e,n){var r;s||(C(t)?(r=t,t=e,e=n,n=arguments[3]):r=1/0);var i=function(t,e,n,r,i,u,o){var a,f,s=[];if(null==i||!(a=t.length)||n<1)return s;d(i)?(f=i,o=u):C(u)?(o=u,u=P):d(u)||(u=tt(u)?u?P:B:P),f||(I(i)&&(i=k(i,2)),f=nt(i,u));for(var c,l=C(o=o||(e?-1:0))?Q(t,o):e?a-1:0,h=e?-1:1;0<=l&&l<=a-1;l+=h)if((f(c=t[l])?!r:r)&&s.$push([l,c]).length>=n)return s;return s}(this,f,s||r,u,t,e,n);return c?a?i:i.map(function(t){return t[o]}):i.length?a?i[0]:i[0][o]:o||a?void 0:-1})})})}),x(l,"$get",function(){var t=arguments,e=Q(this,R(t,0,0));if(t.length<=1)return this[e];var n=R(t,1,1);return this.slice(e,n+e)}),["$set","$edit"].forEach(function(t,e){var r=e?ot:ut;x(l,t,function(t,e){var n=this;return it(t)?$(t).forEach(function(t){r(n,t[0],t[1])}):r(this,t,e),this})}),x(l,"$inArray",function(t){var e,n=this.length;if(!n)return!1;var r=U(arguments,t,1),i=r[0],u=r[1];for(e=0;e<n;e++)if(u(this[e],i))return!0;return!1}),x(l,"$move",function(t,e){return this.splice(Q(this,e),0,this.splice(t,1)[0]),this}),x(l,"$moveRange",function(t,e,n){return X(this,Q(this,n),this.splice(t,e))}),["push","pop","unshift","shift","splice"].forEach(function(t){x(l,"$"+t,function(){return this[t].apply(this,arguments),this})}),x(Object,"$assign",function(t){return tt(t)?w(t,K(arguments,1)):w(!1,arguments)}),x(t,"$assign",function(t){return tt(t)?w(t,[this].concat(K(arguments,1))):w(!1,[this].concat(S.call(arguments)))});var at="undefined"!=typeof window,ft=at?window.Element:void 0,st=/^\[object\s([^\]]+)]$/;function ct(t){var e=typeof t;return"object"===e||"function"===e}function lt(t,e,n,r){if(t===e)return!0;if(!t||!e)return t!=t&&e!=e;var i=o.call(t);if(i!==o.call(e))return!1;if(!ct(t))return!1;if(t.constructor!==e.constructor)return!1;if(I(t))return ht.array(t,e,n,r);if(m(t))return ht.object(t,e,n,r);var u=i.match(st)[1].toLowerCase();return u in ht?ht[u](t,e,n,r):ft&&t instanceof ft?ht.element(t,e):q(t)||J(t)?lt(Z(t),Z(e)):ht.object(t,e,n,r)}var ht={array:function(t,e,n,r){var i,u=t.length;if(u!==e.length)return!1;for(i=0;i<u;i++)switch(dt(t[i],e[i],n,r,t,e)){case 0:return!1;case 1:continue}return!0},object:function(t,e,n,r){var i,u,o=p(t),a=o.length;if(a!==p(e).length)return!1;for(i=0;i<a;i++)switch(dt(t[u=o[i]],e[u],n,r,t,e)){case 0:return!1;case 1:continue}return!0},element:function(t,e){return t.outerHTML===e.outerHTML},regexp:function(t,e){return t.toString()===e.toString()},date:function(t,e){return+t==+e},function:function(t,e){return t.toString()===e.toString()}};function dt(t,e,n,r,i,u){return!n||n!==t&&r!==e?lt(t,e,i,u)?void 0:0:n===t?r===e?1:0:n===t?1:0}x(Object,"$equals",function(t,e){return lt(t,e)}),x(t,"$equals",function(t){return lt(this,t)}),x(Object,"$isEmptyObject",et),x(Object,"$isPlainObject",m),x(t,"$get",function(t){var e=this;if(arguments.length<2)return this[t];var n={};return S.call(arguments).forEach(function(t){n[t]=e[t]}),n}),x(t,"$set $edit",function(t,e){var n=this;return it(t)?rt(t,function(t,e){n[t]=e}):this[t]=e,this});var pt=l.concat;x(t,"$delete $remove",function(){var e=this;return pt.apply([],arguments).forEach(function(t){delete e[t]}),this}),x(t,"$deleteValue $removeValue",function(t){var e=this,n=U(arguments,t,1),r=n[0],i=n[1];return $(this).forEach(function(t){i(t[1],r)&&delete e[t[0]]}),this}),x(t,"$self",function(){return this}),x(Number,"$isNumber",j);var vt=Math.floor,$t=Math.random;function gt(t,e){return vt($t()*(e-t+1)+t)}var mt=Math.abs;function yt(t){return((""+t).split(".")[1]||"").length}x(Math,"$random",function(){var t=arguments,e=R(t,0,0),n=1!==t.length?R(t,1,9):0;if(n<e){var r=[n,e];e=r[0],n=r[1]}if(0<e)return gt(e,n);var i=gt(0,n+mt(e));return n<i?n-i:i});var bt=Math.max,St=Math.pow;function wt(t,e){for(var n="";e--;)n+=t;return n}var Et=Number.prototype;function Mt(t,e){x(Math,t,e),x(Et,t,function(t){return e(this,t)})}function Dt(t,e,n,r){var i=yt(t=t||0),u=yt(e=e||0),o=bt(i,u),a=o?St(10,o):1;o&&(t=_t(t,i,o),e=_t(e,u,o));var f=n(t,e);return r?r(f,a):f/a}function _t(t,e,n){return t=(""+t).replace(".",""),e!==n&&(t+=wt("0",n-e)),Number(t)}function Ot(t,e){return Dt(t,e,function(t,e){return t+e})}function xt(t,e){return Dt(t,e,function(t,e){return t/e},function(t){return t})}Mt("$jia $add",Ot),Mt("$jian $subtract",function(t,e){return Dt(t,e,function(t,e){return t-e})}),Mt("$cheng $multiply",function(t,e){return Dt(t,e,function(t,e){return t*e},function(t,e){return t/St(e,2)})}),Mt("$chu $divide",xt),x(Math,"$mean",function(){return xt(S.call(arguments).reduce(function(t,e){return Ot(t,e)}),arguments.length)});var At=String.fromCharCode;function Ct(){var t=R(arguments,0,!1);return At(t?gt(65,90):gt(97,122))}x(String,"$random",Ct),x(String,"$someRandom",function(){for(var t=arguments,e=R(t,1,!1),n=R(t,2,!1),r="",i=R(t,0,12);0<i--;)n&&0===gt(0,e?2:1)?r+=gt(0,9):r+=Ct(e&&0===gt(0,1));return r});var jt=/([\.\*\+\?\|\(\)\[\]\{\}\^\$\\])/g;function Nt(t){return"[object RegExp]"===o.call(t)}var Tt=RegExp.prototype;function kt(t,e,n,r){return D(t,e,{get:n},r||O),n}var Lt=/[gimsuy]*$/;void 0===Tt.flags&&kt(Tt,"flags",function(){return this.toString().match(Lt)[0]}),x(s,"$replaceAll",function(t,e){var n="g";return null==t?this:(t[c]?t=t.replace(jt,"\\$1"):Nt(t)&&(t.global?n=t.flags:n+=t.flags,t=t.source),this.replace(new RegExp(t,n),e||""))}),["$toCapitalize",""].forEach(function(t,e){var n=["toUpperCase","toLowerCase"][e?"reverse":"$self"](),r=n[0],i=n[1];x(s,t+" $"+r.replace("C","FirstC"),function(t){return this.substr(0,1)[r]()+this.substr(1)[t?"$self":i]()})});var Ht="millisecond",It="second",Rt="minute",Bt="hour",Pt="day",Ft="week",Ut="month",Yt="year",Wt="date",Vt=/^(\d{4})-?(\d{1,2})-?(\d{0,2})(.*?(\d{1,2}):(\d{1,2}):(\d{1,2}))?.?(\d{1,3})?$/,qt=/\[.*?\]|Y{2,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,Jt={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},Zt=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},zt={padStart:Zt,padZoneStr:function(t){var e=Math.abs(t),n=Math.floor(e/60),r=e%60;return(t<=0?"+":"-")+Zt(n,2,"0")+":"+Zt(r,2,"0")},monthDiff:function(t,e){var n=12*(e.year()-t.year())+(e.month()-t.month()),r=t.clone().add(n,"months"),i=e-r<0,u=t.clone().add(n+(i?-1:1),"months");return Number(-(n+(e-r)/(i?r-u:u-r)))},absFloor:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},prettyUnit:function(t){return{M:Ut,y:Yt,w:Ft,d:Pt,h:Bt,m:Rt,s:It,ms:Ht}[t]||String(t||"").toLowerCase().replace(/s$/,"")},isUndefined:function(t){return void 0===t}},Gt="en",Kt={};Kt[Gt]=Jt;var Qt=function(t){return t instanceof re},Xt=function(t,e,n){var r;if(!t)return null;if("string"==typeof t)Kt[t]&&(r=t),e&&(Kt[t]=e,r=t);else{var i=t.name;Kt[i]=t,r=i}return n||(Gt=r),r},te=function(t,e){if(Qt(t))return t.clone();var n=e||{};return n.date=t,new re(n)},ee=function(t,e){return te(t,{locale:e.$L})},ne=zt;ne.parseLocale=Xt,ne.isDayjs=Qt,ne.wrapper=ee;var re=function(){function t(t){this.parse(t)}var e=t.prototype;return e.parse=function(t){var e,n;this.$d=null===(e=t.date)?new Date(NaN):ne.isUndefined(e)?new Date:e instanceof Date?e:"string"==typeof e&&/.*[^Z]$/i.test(e)&&(n=e.match(Vt))?new Date(n[1],n[2]-1,n[3]||1,n[5]||0,n[6]||0,n[7]||0,n[8]||0):new Date(e),this.init(t)},e.init=function(t){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds(),this.$L=this.$L||Xt(t.locale,null,!0)||Gt},e.$utils=function(){return ne},e.isValid=function(){return!("Invalid Date"===this.$d.toString())},e.isSame=function(t,e){var n=te(t);return this.startOf(e)<=n&&n<=this.endOf(e)},e.isAfter=function(t,e){return te(t)<this.startOf(e)},e.isBefore=function(t,e){return this.endOf(e)<te(t)},e.year=function(){return this.$y},e.month=function(){return this.$M},e.day=function(){return this.$W},e.date=function(){return this.$D},e.hour=function(){return this.$H},e.minute=function(){return this.$m},e.second=function(){return this.$s},e.millisecond=function(){return this.$ms},e.unix=function(){return Math.floor(this.valueOf()/1e3)},e.valueOf=function(){return this.$d.getTime()},e.startOf=function(t,e){var r=this,i=!!ne.isUndefined(e)||e,n=function(t,e){var n=ee(new Date(r.$y,e,t),r);return i?n:n.endOf(Pt)},u=function(t,e){return ee(r.toDate()[t].apply(r.toDate(),(i?[0,0,0,0]:[23,59,59,999]).slice(e)),r)};switch(ne.prettyUnit(t)){case Yt:return i?n(1,0):n(31,11);case Ut:return i?n(1,this.$M):n(0,this.$M+1);case Ft:return n(i?this.$D-this.$W:this.$D+(6-this.$W),this.$M);case Pt:case Wt:return u("setHours",0);case Bt:return u("setMinutes",1);case Rt:return u("setSeconds",2);case It:return u("setMilliseconds",3);default:return this.clone()}},e.endOf=function(t){return this.startOf(t,!1)},e.$set=function(t,e){var n,r=ne.prettyUnit(t),i=(n={},n.day="setDate",n[Wt]="setDate",n[Ut]="setMonth",n[Yt]="setFullYear",n[Bt]="setHours",n[Rt]="setMinutes",n[It]="setSeconds",n[Ht]="setMilliseconds",n)[r],u=r===Pt?this.$D+(e-this.$W):e;return this.$d[i]&&this.$d[i](u),this.init(),this},e.set=function(t,e){return this.clone().$set(t,e)},e.add=function(r,t){var e,i=this;r=Number(r);var n=ne.prettyUnit(t),u=function(t,e){var n=i.set(Wt,1).set(t,e+r);return n.set(Wt,Math.min(i.$D,n.daysInMonth()))},o=function(t){var e=new Date(i.$d);return e.setDate(e.getDate()+t*r),ee(e,i)};if(n===Ut)return u(Ut,this.$M);if(n===Yt)return u(Yt,this.$y);if(n===Pt)return o(1);if(n===Ft)return o(7);var a=(e={},e[Rt]=6e4,e[Bt]=36e5,e[It]=1e3,e)[n]||1,f=this.valueOf()+r*a;return ee(f,this)},e.subtract=function(t,e){return this.add(-1*t,e)},e.format=function(t){var e=this,n=t||"YYYY-MM-DDTHH:mm:ssZ",r=ne.padZoneStr(this.$d.getTimezoneOffset()),i=this.$locale(),u=i.weekdays,o=i.months,a=function(t,e,n,r){return t&&t[e]||n[e].substr(0,r)},f=function(t){return 0===e.$H?12:ne.padStart(e.$H<13?e.$H:e.$H-12,"hh"===t?2:1,"0")};return n.replace(qt,function(t){return-1<t.indexOf("[")?t.replace(/\[|\]/g,""):{YY:String(e.$y).slice(-2),YYYY:String(e.$y),M:String(e.$M+1),MM:ne.padStart(e.$M+1,2,"0"),MMM:a(i.monthsShort,e.$M,o,3),MMMM:o[e.$M],D:String(e.$D),DD:ne.padStart(e.$D,2,"0"),d:String(e.$W),dd:a(i.weekdaysMin,e.$W,u,2),ddd:a(i.weekdaysShort,e.$W,u,3),dddd:u[e.$W],H:String(e.$H),HH:ne.padStart(e.$H,2,"0"),h:f(t),hh:f(t),a:e.$H<12?"am":"pm",A:e.$H<12?"AM":"PM",m:String(e.$m),mm:ne.padStart(e.$m,2,"0"),s:String(e.$s),ss:ne.padStart(e.$s,2,"0"),SSS:ne.padStart(e.$ms,3,"0"),Z:r}[t]||r.replace(":","")})},e.diff=function(t,e,n){var r,i=ne.prettyUnit(e),u=te(t),o=this-u,a=ne.monthDiff(this,u);return a=(r={},r[Yt]=a/12,r[Ut]=a,r.quarter=a/3,r[Ft]=o/6048e5,r.day=o/864e5,r[Bt]=o/36e5,r[Rt]=o/6e4,r[It]=o/1e3,r)[i]||o,n?a:ne.absFloor(a)},e.daysInMonth=function(){return this.endOf(Ut).$D},e.$locale=function(){return Kt[this.$L]},e.locale=function(t,e){var n=this.clone();return n.$L=Xt(t,e,!0),n},e.clone=function(){return ee(this.toDate(),this)},e.toDate=function(){return new Date(this.$d)},e.toArray=function(){return[this.$y,this.$M,this.$D,this.$H,this.$m,this.$s,this.$ms]},e.toJSON=function(){return this.toISOString()},e.toISOString=function(){return this.$d.toISOString()},e.toObject=function(){return{years:this.$y,months:this.$M,date:this.$D,hours:this.$H,minutes:this.$m,seconds:this.$s,milliseconds:this.$ms}},e.toString=function(){return this.$d.toUTCString()},t}();te.extend=function(t,e){return t(e,re,te),te},te.locale=Xt,te.isDayjs=Qt,te.unix=function(t){return te(1e3*t)},te.en=Kt[Gt];var ie=Date.prototype,ue="__ZENJS_DAYJS__";x(ie,"$dayjs",function(){var t=this[ue];return t&&t.valueOf()===+this?t:this[ue]=te(this)}),x(Date,"$parse",function(t){var e=te(t);return e.toDate().$set(ue,e)}),x(Date,"$format",function(t,e){return te(t).format(e)});var oe="undefined"!=typeof global,ae=at?window:oe?global:{};x(ae,"dayjs",te);[function(t,e,u){e.prototype.isBetween=function(t,e,n){var r=u(t),i=u(e);return this.isAfter(r,n)&&this.isBefore(i,n)||this.isBefore(r,n)&&this.isAfter(i,n)}},function(t,e){e.prototype.isSameOrBefore=function(t,e){return this.isSame(t,e)||this.isBefore(t,e)}},function(t,e){e.prototype.isSameOrAfter=function(t,e){return this.isSame(t,e)||this.isAfter(t,e)}},function(t,e){e.prototype.isLeapYear=function(){return this.$y%4==0&&this.$y%100!=0||this.$y%400==0}}].forEach(te.extend);var fe="clone_init_parse_toDate_toISOString_toJSON_toString_locale".split("_"),se=te.isDayjs;te.extend(function(t,e){$(e.prototype).forEach(function(t){var e,n;0===t[0].indexOf("$")||-1<fe.indexOf(t[0])||(e=t[0],n=t[1],x(ie,"$"+e,function(){var t=n.apply(this.$dayjs(),arguments);return se(t)?(this.setTime(t.valueOf()),this[ue]=t,this):t}),["isValid","format"].$inArray(e)||x(Date,"$"+e,function(){var t=n.apply(te(),arguments);return se(t)?t.$d.$set(ue,t):t}))})}),x(n,"$after",function(){var t=this,e=R(arguments,0,1);return function(){e--<1&&t.apply(this,arguments)}}),x(n,"$args",function(o){var a=this;return function(){for(var e=[],t=arguments,n=p(o),r=n.length+t.length,i=0,u=0;u<r;u++)e[u]=u in o?o[u]:t[i++];return n.forEach(function(t){t in e||e.$set(t,o[t])}),a.apply(this,e)}}),x(n,"$one $once",function(){var t=this,e=R(arguments,0,1),n=1;return function(){n++===e&&t.apply(this,arguments)}}),x(RegExp,"$parse",function(t,e){return new RegExp(t.replace(jt,"\\$1"),e)}),x(ae,"$typeof",function(t){return null==t?t+"":t[b]?"array":typeof t});var ce=/\+/g;function le(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}}function he(e){var t=arguments,n=R(t,1,"&"),r=R(t,2,"=");return it(e)?p(e).map(function(t){return encodeURIComponent(le(t))+r+encodeURIComponent(le(e[t]))}).join(n):""}function de(t){var u={};if(!t||!A(t))return u;var e=arguments,n=R(e,1,"&"),o=R(e,2,"=");return t.split(n).forEach(function(t){var e,n=t.replace(ce,"%20"),r=n.indexOf(o),i="";-1<r?(e=n.substr(0,r),i=n.substr(r+1)):e=n,u[decodeURIComponent(e)]=decodeURIComponent(i)}),u}function pe(){return!0}function ve(){return!1}x(ae,"$querystring",w(!1,[null,{stringify:he,parse:de}]));var $e=ae.ZenJS=w(!1,[null,{assign:E,repeat:wt,keys:p,values:z,entries:$,fromEntries:function(t){for(var e,n={},r=G(t),i=r.length;i--;)(e=r[i])&&e.length&&(n[e[0]]=e[1]);return n},congruence:P,equals:B,define:D,defineValue:x,defineGet:kt,intRandom:gt,returnArg:function(t){return t},returnTrue:pe,returnFalse:ve,noop:function(){},parametersDefault:R,parametersRest:K,isString:A,isBoolean:tt,isArray:M,isNumber:C,isRegExp:Nt,isSet:J,isMap:q,isFunction:d,isObject:it,isReferenceType:ct,mapSetToArray:Z,config:{event:{modifiers:!0,returnFalse:!0}}}]),ge=1;u($e,"guid",{get:function(){return ge++}}),at&&x(document,"$id",document.getElementById);var me="addEventListener",ye="removeEventListener",be="DOMContentLoaded";at&&x(document,"$ready",function(e,n){"complete"===document.readyState||"loading"!==document.readyState&&!document.documentElement.doScroll?e.apply(window,n):document[me](be,function t(){document[ye](be,t),e.apply(window,n)})}),at&&x(window,"$ready",function(e,n){"complete"===document.readyState?e.apply(window,n):window[me]("load",function t(){window[ye]("load",t),e.apply(window,n)})});var Se=at?ft.prototype:void 0,we=/[^\x20\t\r\n\f]+/g;function Ee(t,e,n){var r=t.classList,i=(e||"").match(we)||[];if("has"!==n)return null===n?i.forEach(function(t){r[r.contains(t)?"remove":"add"](t)}):i.forEach(function(t){return r[n](t)}),t;for(var u=i.length,o=0;o<u;o++)if(!1===r.contains(i[o]))return!1;return 0!==u}function Me(t,e,n,r){if(null==t||0===t.length)return t;if(null==e)return t.nodeType?r?t:t[n]:t;var i=e[v];if(t.nodeType){if(r&&(i?e(t):t.$is(e)))return t;if(i)for(;(t=t[n])&&!e(t););else for(;(t=t[n])&&!t.$is(e););return t}return t.filter(i?e:function(t){return t.$is(e)})}at&&(x(Se,"$addClass",function(t){return Ee(this,t,"add")}),x(Se,"$removeClass $deleteClass",function(t){return t||""===t?Ee(this,t,"remove"):(this.className="",this)}),x(Se,"$hasClass",function(t){return Ee(this,t,"has")}),x(Se,"$toggleClass",function(t,e){return Ee(this,t,1<arguments.length?e?"add":"remove":null)})),at&&!Se.matches&&["webkit","o","ms","moz"].$each(function(t){var e=Se[t+"MatchesSelector"];if(e)return Se.matches=e,!1}),at&&(x(Se,"$is",function(t){return t.nodeType?this===t:A(t)?this.matches(t):!!d(t)&&!!t(this)}),x(Se,"$not",function(t){return!this.$is(t)})),at&&(x(Se,"$first $firstChild",function(t){return Me(this.firstElementChild,t,"nextElementSibling",!0)}),x(Se,"$last $lastChild",function(t){return Me(this.lastElementChild,t,"previousElementSibling",!0)})),at&&[["$next","nextElementSibling"],["$prev","previousElementSibling"]].forEach(function(t){var e=t[0],n=t[1];x(Se,e,function(t){return Me(this,t,n)}),x(Se,e+"All",function(t){return Me(function(t,e){for(var n=[],r=0;t=t[e];)n[r++]=t;return n}(this,n),t)})}),at&&x(Se,"$child $children",function(t){return Me(S.call(this.children),t)}),at&&(x(Se,"$parent",function(t){return Me(this.parentElement,t,null,!0)}),x(Se,"$parents",function(t,e){return Me(this,t,"parentElement",e)})),at&&x(Se,"$siblings",function(t){var e=this.parentElement;if(e){var n=S.call(e.children);return Me(n.$splice(n.indexOf(this),1),t)}return[]}),at&&(x(Se,"$append",function(t){return this.appendChild(t),this}),x(Se,"$prepend",function(t){return this.insertBefore(t,this.firstElementChild),this}),x(Se,"$appendTo",function(t){return t.appendChild(this),this}),x(Se,"$prependTo",function(t){return t.insertBefore(this,t.firstElementChild),this})),at&&(x(Se,"$before",function(t,e){return(e=this.parentNode)&&e.insertBefore(t,this),this}),x(Se,"$after",function(t,e){return(e=this.parentNode)&&e.insertBefore(t,this.nextElementSibling),this})),at&&x(Se,"$delete $remove",function(t){(t=this.parentNode)&&t.removeChild(this)}),at&&[document,Se].forEach(function(t){var e=t.querySelectorAll;x(t,"$query $find",function(){return S.call(e.apply(this,arguments))}),x(t,"$queryFirst $findFirst",t.querySelector)}),at&&x(Se,"$replaceWith $replace",function(t,e){(e=this.parentNode)&&e.replaceChild(t,this)});var De={for:"htmlFor",class:"className"};["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"].forEach(function(t){De[t.toLowerCase()]=t});var _e=/^(?:input|select|textarea|button)$/i,Oe=/^(?:a|area)$/i,xe=!0;if(at){var Ae=document.createElement("select");xe=document.createElement("option").$appendTo(Ae).selected}var Ce={tabIndex:{get:function(t,e){var n=t.getAttribute(e);return n?parseInt(n,10):_e.test(t.nodeName)||Oe.test(t.nodeName)&&t.href?0:-1}}};if(!xe){var je=function(t){var e=t.parentNode;e&&e.selectedIndex};Ce.selected={get:je,set:je}}function Ne(t,e,n,r){var i;if(!it(e))return r.apply(t,n);for(i in n=S.call(n).splice(0,1),e)r.apply(t,[i,e[i]].concat(n));return t}at&&(x(Se,"$prop",function(t,e){return Ne(this,t,arguments,function(t,e){var n,r=De[t]||t,i=Ce[r];return 1<arguments.length?(i&&"set"in i&&i.set(this),this[r]=e,this):i&&"get"in i&&void 0!==(n=i.get(this,r))?n:this[r]})}),x(Se,"$hasProp",function(t){return g.call(this,De[t]||t)}),x(Se,"$removeProp $deleteProp",function(t){if(t=t&&t.match(we))for(var e,n=0;e=t[n++];)this[e=De[e]||e]="",delete this[e];return this}));var Te=!0;if(at){var ke=document.createElement("input");ke.value="t",ke.type="radio",Te="t"===ke.value}var Le=Te,He={type:function(t,e){if(!Le&&"radio"===e&&"input"===t._nodeName){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),!0}}};function Ie(t,e,n){return!1===e?t.$removeAttr(n):t.setAttribute(n,n),!0}var Re=/^(?:checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped)$/i;at&&(x(Se,"$attr",function(t,e){return Ne(this,t,arguments,function(t,e){var n;if(void 0===e)return null==(n=this.getAttribute(t))?void 0:n;if(null===e)return this.$removeAttr(t);var r=He[t.toLowerCase()]||(Re.test(t)?Ie:void 0);return r&&r(this,e,t)||this.setAttribute(t,e+""),this})}),x(Se,"$hasAttr",Se.hasAttribute),x(Se,"$removeAttr $deleteAttr",function(t){if(t=t&&t.match(we))for(var e,n=0;e=t[n++];)this.removeAttribute(e);return this}));var Be=/-([a-z])/g;function Pe(t,e){return e.toUpperCase()}function Fe(t){return t.replace(Be,Pe)}function Ue(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=window),e.getComputedStyle(t)}var Ye=!0;if(at){var We=document.createElement("div").$appendTo(document.documentElement);We.style.margin="10px",Ye=""!==Ue(We).getPropertyValue("margin"),We.$remove()}var Ve={};if(!Ye){var qe=function(t,s){rt(t,function(a,f){Ve[a+f]=function(t){for(var e=Ue(t),n=[],r=0;r<4;r++)n[r]=e[a+s[r]+f]||"0px";var i=n[0],u=n[1],o=n[2];return u===n[3]?i===o?i===u?i:i+" "+u:i+" "+u+" "+o:n.join(" ")}})};qe({margin:"",padding:"",border:"Width"},["Top","Right","Bottom","Left"]),qe({border:"Radius"},["TopLeft","TopRight","BottomRight","BottomLeft"])}var Je=/^--/,Ze=["Webkit","Moz","ms"],ze=document.createElement("div").style;function Ge(t){return t in ze?t:function(t){for(var e=t.$toCapitalize(!0),n=Ze.length;n--;)if((t=Ze[i]+e)in ze)return t}(t)||t}var Ke={animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},Qe=!1;if(at){var Xe=document.createElement("div");Xe.style.backgroundClip="content-box",Xe.cloneNode(!0).style.backgroundClip="",Qe="content-box"===Xe.style.backgroundClip}var tn=Qe;function en(t,e,n){var r=Fe(e),i=Je.test(e),u=t.style;if(i||(e=Ge(r)),void 0===n)return u[e];null!=n&&n==n&&(C(n)&&(n+=Ke[r]?"":"px"),tn&&""===n&&0===e.indexOf("background")&&(u[e]="inherit"),i?u.setProperty(e,n):u[e]=n)}var nn={opacity:"1"};if(at){var rn=function(t,e){var n=Fe(e);Je.test(e)||(e=Ge(n));var r,i,u,o,a,f=Ve[e]||Ve[n];return f&&(r=f(t)),void 0===r&&(u=e,o=Ue(i=t),""!==(a=o.getPropertyValue(u)||o[u])&&"auto"!==a||i.$parents(document.documentElement)||(a=en(i,u)),r=void 0!==a?a+"":a),""===r&&e in nn&&(r=nn[e]),"normal"===r&&e in cssNormalDefault&&(val=cssNormalDefault[e]),r};x(Se,"$css",function(t){return Ne(this,t,arguments,function(t,e){return void 0===e?rn(this,t):en(this,t,e)})})}var un=Math.min;at&&x(Se,"$index",function(t){if(arguments.length){var e=this.parentElement;if(e){var n=e.children,r=this.$prevAll().length,i=un(n.length-1,t);if(r!==i){var u=n[i];e.insertBefore(this,r<i?u.nextElementSibling:u)}}return this}return this.parentElement?this.$prevAll().length:-1}),at&&x(Se,"$html",function(t){return arguments.length?(this.innerHTML=t,this):this.innerHTML});var on={option:{get:function(t){var e=t.getAttribute("value");return null==e?(t.textContent.match(we)||[]).join(" "):e}},select:{get:function(t){var e,n,r,i=t.options,u=t.selectedIndex,o="select-one"===t.type,a=o?u+1:i.length,f=o?null:[];for(r=u<0?a:o?u:0;r<a;r++)if(((n=i[r]).selected||r===u)&&!n.disabled&&(!n.parentNode.disabled||"optgroup"!==n.parentNode._nodeName)){if(e=on.option.get(n),o)return e;f.push(e)}return f},set:function(t,e){for(var n,r,i=t.options,u=G(e),o=i.length;o--;)((r=i[o]).selected=u.$inArray(on.option.get(r)))&&(n=!0);n||(t.selectedIndex=-1)}}},an=/\r/g;at&&x(Se,"$val $value",function(t){if(arguments.length){null==t?t="":C(t)?t+="":t[b]&&(t=t.map(function(t){return null==t?"":t+""}));var e=on[this.type]||on[this._nodeName];return e&&"set"in e?e.set(this,t):this.value=t,this}var n,r=on[this.type]||on[this._nodeName];return r&&"get"in r&&void 0!==(n=r.get(this))?n:A(n=this.value)?n.replace(an,""):null==n?"":n}),at&&["width","height"].forEach(function(e){x(Se,"$"+e,function(t){if(arguments.length)return this.style.setProperty(e,j(t)?t+"px":t),this;try{return this.getBoundingClientRect()[e]}catch(t){return 0}})}),at&&kt(Se,"_nodeName",function(){return this.nodeName.toLowerCase()}),at&&x(Se,"$clone",Se.cloneNode);var fn=at?"EventTarget"in window?EventTarget.prototype:[window,document,Se]:void 0,sn="__ZENJS_DATA__";function cn(t){return t[sn]||(x(t,sn,{}),t[sn])}at&&(x(fn,"$data",function(t){var r=this||window,i=cn(r);return Ne(r,t,arguments,function(t,e,n){return n||arguments.length<2?null==t?i:!n||t in i?i[t]:i[t]=e:(i[t]=e,r)})}),x(fn,"$hasData",function(t){var e=cn(this||window);return!et(e)&&(null==t||t in e)}),x(fn,"$deleteData $removeData",function(t){var e=this||window;if(null==t)return e[sn]={},e;var n=cn(e);return(t.match(we)||[]).forEach(function(t){delete n[t]}),e}));var ln=!1;try{var hn=u({},"passive",{get:function(){ln=!0}});window[me]("test",null,hn)}catch(t){}var dn=/^([^.]*)(?:\.(.+)|)/;function pn(t,e,n,r,i){if(0!==e.length)return function t(e,n,r,i,u,o){var a;r.filter(function(t){return t in e}).$each(function(t){return a=e[t](i,u,o,r)});if(!1!==a&&e._next)return t(e._next,n,r,i,u,o);return a}(vn[t],t,e,n,r,i)}var vn={add:{},dispatch:{self:function(t,e,n){return n.target===n.currentTarget}},dispatched:{stop:function(t,e,n){n.stopPropagation()},prevent:function(t,e,n){n.preventDefault()}}},$n=vn.add,gn=vn.dispatch;function mn(t,e,n,r){for(var i,u,o,a,f,s,c=t.$data("events",{},!0),l=e.length;l--;)if((u=(i=dn.exec(e[l])||[])[1])&&(s=(f=c[u]||[]).length)){for(o=(i[2]||"").split(".").sort().join("."),a=i[2]&&new RegExp("^"+o+"$");s--;)n(f[s],a,u,f,s);r&&r(f,c,u)}}gn._next=vn.dispatched,$n.once=$n.one=function(t,e,n,r){return-1===(n=n[e]||[]).$findIndex({namespace:r},Y)},["ctrlKey","shiftKey","altKey","metaKey"].forEach(function(r){gn[r]=function(t,e,n){return!!n[r]}}),["left","middle","right"].forEach(function(t,r){gn[t]=function(t,e,n){return"button"in n&&n.button===r}}),rt({keyEsc:27,keyTab:9,keyEnter:13,keySpace:32,keyUp:38,keyLeft:37,keyRight:39,keyDown:40,keyDelete:[8,46]},function(t,r){gn[t]=function(t,e,n){return r[b]?-1===r.indexOf(n.keyCode):n.keyCode===r}});var yn={},bn={};var Sn=$e.EventListener=w(!1,[null,{add:function(t,e,n,r,i,u,o,a){var f=t.$data("events",{},!0),s=r.guid||(r.guid=$e.guid),c=dn.exec(e)||[],l=c[1];if(l){var h=(c[2]||"").split(".").sort();if(!$e.config.event.modifiers||!1!==pn("add",h,t,l,f)){var d={elem:t,selector:n,type:l,namespace:h,listener:r,guid:s,options:i,mainGroup:u,group:o,data:a,namespaceStr:h.join("."),handler:function(){return $e.EventListener.dispatch(this,arguments,d)}};(f[l]||(f[l]=[])).push(d),o&&((yn[o]||(yn[o]=[])).push(d),u&&(bn[u]||(bn[u]=[])).push(d)),i.passive?t[me](l,d.handler,{passive:!0,capture:i.capture||!1}):t[me](l,d.handler,i.capture||!1)}}},dispatch:function(t,e,n){var r=new $e.Event(e[0]),i=S.call(e).$splice(0,1,r),u=n.selector,o=r.target,a=r.type,f=n.elem;if(r.delegateTarget=f,r.handleOptions=n,u&&!("click"===a&&1<=r.button)){for(;o!==f;o=o.parentNode||f)if(1===o.nodeType&&("click"!==a||!0!==o.disabled)&&o.matches(u)){f=r.currentTarget=o;break}if(r.delegateTarget===f)return}if(r.currentTarget||(r.currentTarget=f),o||(r.target=f),!$e.config.event.modifiers||!1!==pn("dispatch",n.namespace,f,a,r)){var s=n.listener.apply(t,i);return!1===s&&$e.config.event.returnFalse&&(r.preventDefault(),r.stopPropagation()),s}},modifiers:pn,remove:function(a,t,f,s){mn(a,t,function(t,e,n,r,i){if((!f||f.guid===t.guid)&&(!e||e.test(t.namespaceStr))&&(s?"**"===s||"*"===s&&t.selector||s===t.selector:!t.selector)){a[ye](n,t.handler),r.splice(i,1);var u=t.group,o=t.mainGroup;u&&(u=yn[u])&&!u.$deleteValue(t).length&&delete yn[t.group],o&&(o=bn[o])&&!o.$deleteValue(t).length&&delete bn[t.mainGroup]}},function(t,e,n){t.length||delete e[n]})},emit:function(t,e,r){mn(t,e,function(t,e,n){e&&!e.test(t.namespaceStr)||t.selector||t.handler.apply(t.elem,[n].concat(r))})}}]);function wn(e,t,n,r,i,u){var o,a,f,s;if(it(t)?(o=t,A(n)?i=r:(i=n,n=r)):it(n)&&(o=n,n=t,i=r),o){for(var c in o)wn(e,c,o[c],n,i);return e}if(!t)return e;if(null==(t=t.match(we))||0===t.length)return e;if(!A(n)){var l=[r,n];if(r=l[1],!A(n=l[0])&&(void 0===i||A(i))){var h=[n,i];i=h[0],n=h[1]}}if(tt(r)&&(r=r?pe:ve),!r)return e;if("group"in(i=tt(i)?{capture:i}:i?E({},i):{})&&((f=i.group)[b]&&(a=f[0],f=f[1]),delete i.group),"data"in i&&(s=i.data,delete i.data),p(i).forEach(function(t){i[t]?i[t]=!0:delete i[t]}),u||i.one||i.once){var d=r;(r=function(t){return e.$off(t),d.apply(this,arguments)}).guid=d.guid||(d.guid=$e.guid),delete i.one,delete i.once}return i.passive&&!ln&&delete i.passive,t.forEach(function(t){Sn.add(e,t,n,r,i,a,f,s)}),e}function En(t,e,n,r){if(e instanceof ZenJS.Event)return Mn(e.handleOptions);if(it(e)){if("group"in e){var i,u=e.group;if(u[b]){var o=u[0];o&&(o=bn[o])&&(i=o.slice())}else u&&(u=yn[u])&&(i=u.slice());i&&i.forEach(function(t){Mn(t)})}else for(var a in e)En(t,a,n,e[a]);return t}if(!e)return t;if(null==(e=e.match(we))||0===e.length)return t;if(void 0!==n&&!A(n)){var f=[r,n];n=f[0],r=f[1]}return tt(r)&&(r=r?pe:ve),Sn.remove(t,e,r,n),t}function Mn(t){var e=t.namespaceStr,n=e?t.type+"."+e:t.type;return En(t.elem,n,t.selector,t.listener)}at&&(x(fn,"$on",function(t,e,n,r){return wn(this||window,t,e,n,r)}),x(fn,"$one $once",function(t,e,n,r){return wn(this||window,t,e,n,r,!0)})),at&&x(fn,"$off",function(t,e,n){return En(this||window,t,e,n)}),at&&x(fn,"$emit",function(t){var e,n,r,i=this||window;return e=i,r=arguments,(n=t)&&(null==(n=n.match(we))||0===n.length||Sn.emit(e,n,K(r,1))),e});var Dn=/\?.*?(?=#|$)/;if(at){var _n=function(t,e,n){null==n?delete t[e]:t[e]=n},On=function(t,e,n,r,i,u){var o=de(t);return u?o:r?(i?rt(e,function(t,e){_n(o,t,e)}):_n(o,e,n),he(o)):o[e]};location.$search=function(t,e){var n,r,i;(i=arguments.length<1)||(r=1<arguments.length||(n=it(t)));var u=On(location.search.substr(1),t,e,r,n,i);if(!r)return u;location.search=u},location.$urlSearch=function(t,e,n){if(A(t)){var r,i,u,o=((t.match(Dn)||[])[0]||"").substr(1);if((u=arguments.length<2)||(i=2<arguments.length||(r=it(e))),!i)return o?On(o,e,n,i,r,u):u?{}:"";var a="?"+On(o,e,n,i,r);return o||-1<t.indexOf("?")?t=t.replace(Dn,a):-1<t.indexOf("#")?t=t.replace("#",a+"#"):t+=a,t}}}var xn=$e.Event=function(t,e){if(this instanceof xn==!1)return new $e.Event(t,e);if(t instanceof xn)return t;if(t&&t.type)for(var n in this.originalEvent=t,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?pe:ve,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,t)n in this||(this[n]=t[n]);else this.type=t;e&&E(this,e),this.timeStamp=t&&t.timeStamp||Date.now()},An=xn.prototype={constructor:xn};["preventDefault","stopPropagation","stopImmediatePropagation"].forEach(function(t){An[t]=function(){this.originalEvent&&this.originalEvent[t]()}});var Cn=xn.addProp=function(e,t){u(An,e,{enumerable:!0,configurable:!0,get:d(t)?function(){if(this.originalEvent)return t(this.originalEvent)}:function(){return this[e]},set:function(t){this[e]=t}})},jn=/^key/,Nn=/^(?:mouse|pointer|contextmenu|drag|drop)|click/;return Cn("which",function(t){var e;return null==t.which&&jn.test(t.type)?null!=t.charCode?t.charCode:t.keyCode:!t.which&&void 0!==(e=t.button)&&Nn.test(t.type)?1&e?1:2&e?3:4&e?2:0:t.which}),Cn("wheelDelta",function(t,e){return(e=t.wheelDelta)?e:(e=t.detail)?0<e?-120:120:void 0}),Cn("detail",function(t,e){return(e=t.detail)?e:(e=t.wheelDelta)?0<e?-3:3:void 0}),$e});