diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 484388d1f9..9c51bff8be 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,3 +1,3 @@ /*! For license information please see admin.js.LICENSE.txt */ -(()=>{var t,e,n={5710:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(8805);class s{constructor(){(0,r.A)(this,"element",void 0),(0,r.A)(this,"attrs",void 0),(0,r.A)(this,"state",void 0)}oninit(t){this.setAttrs(t.attrs)}oncreate(t){this.element=t.dom}onbeforeupdate(t){this.setAttrs(t.attrs)}onupdate(t){}onbeforeremove(t){}onremove(t){}$(t){const e=$(this.element);return t?e.find(t):e}static component(t,e){void 0===t&&(t={}),void 0===e&&(e=null);const n={...t};return m(this,n,e)}setAttrs(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error(`[${this.constructor.name}] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute`);if("tag"in t)throw new Error(`[${this.constructor.name}] You cannot use the "tag" attribute name with Mithril 2.`)}this.attrs=t}static initAttrs(t){}}flarum.reg.add("core","common/Component",s)},5420:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(8805),s=n(5114);class a{constructor(t,e){void 0===t&&(t={}),void 0===e&&(e=s.A.store),(0,r.A)(this,"data",{}),(0,r.A)(this,"freshness",new Date),(0,r.A)(this,"exists",!1),(0,r.A)(this,"store",void 0),this.data=t,this.store=e}id(){return"id"in this.data?this.data.id:void 0}attribute(t){return this.data?.attributes?.[t]}pushData(t){if("id"in t&&(this.data.id=t.id),"type"in t&&(this.data.type=t.type),"attributes"in t){this.data.attributes||={};for(const e in t.attributes){const n=t.attributes[e];n&&n instanceof a&&delete t.attributes[e]}Object.assign(this.data.attributes,t.attributes)}if("relationships"in t){const e=this.data.relationships??{};for(const n in t.relationships){const r=t.relationships[n];if(null===r){delete e[n],delete t.relationships[n];continue}let s;s=r instanceof a?{data:a.getIdentifier(r)}:r instanceof Array?{data:r.map(a.getIdentifier)}:r,t.relationships[n]=s,e[n]=s}this.data.relationships=e}return this.freshness=new Date,this}pushAttributes(t){this.pushData({attributes:t})}save(t,e){void 0===e&&(e={});const n={type:this.data.type,attributes:t};if("id"in this.data&&(n.id=this.data.id),t.relationships){n.relationships={};for(const e in t.relationships){const r=t.relationships[e];null!==r&&(n.relationships[e]={data:r instanceof Array?r.map(a.getIdentifier):a.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const i={data:n,meta:e.meta||void 0};return s.A.request({method:this.exists?"PATCH":"POST",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:i,...e}).then((t=>this.store.pushPayload(t)),(t=>{throw this.pushData(r),m.redraw(),t}))}delete(t,e){return void 0===t&&(t={}),void 0===e&&(e={}),this.exists?s.A.request({method:"DELETE",url:s.A.forum.attribute("apiUrl")+this.apiEndpoint(),body:t,...e}).then((()=>{this.exists=!1,this.store.remove(this)})):Promise.resolve()}apiEndpoint(){return"/"+this.data.type+("id"in this.data?"/"+this.data.id:"")}copyData(){return JSON.parse(JSON.stringify(this.data))}rawRelationship(t){return this.data.relationships?.[t]?.data}static attribute(t,e){return function(){return e?e(this.attribute(t)):this.attribute(t)}}static hasOne(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&e instanceof Array)throw new Error(`Relationship ${t} on model ${this.data.type} is plural, so the hasOne method cannot be used to access it.`);return!!e&&this.store.getById(e.type,e.id)}}static hasMany(t){return function(){const e=this.data.relationships?.[t]?.data;if(e&&!(e instanceof Array))throw new Error(`Relationship ${t} on model ${this.data.type} is singular, so the hasMany method cannot be used to access it.`);return!!e&&e.map((t=>this.store.getById(t.type,t.id)))}}static transformDate(t){return null!=t?new Date(t):t}static getIdentifier(t){return t&&t.data&&"id"in t.data?{type:t.data.type,id:t.data.id}:null}}flarum.reg.add("core","common/Model",a)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),a=n(8631);class i extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.author.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.author.hint",{},!0)}filterKey(){return"author"}}flarum.reg.add("core","common/query/discussions/AuthorGambit",i);class o extends a.px{key(){return s.A.translator.trans("core.lib.gambits.discussions.created.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.discussions.created.hint",{},!0)}valuePattern(){return"(\\d{4}\\-\\d\\d\\-\\d\\d(?:\\.\\.(\\d{4}\\-\\d\\d\\-\\d\\d))?)"}filterKey(){return"created"}}flarum.reg.add("core","common/query/discussions/CreatedGambit",o);class l extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.hidden.key",{},!0)}filterKey(){return"hidden"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/HiddenGambit",l);class c extends a.pm{key(){return s.A.translator.trans("core.lib.gambits.discussions.unread.key",{},!0)}filterKey(){return"unread"}enabled(){return!!s.A.session.user}}flarum.reg.add("core","common/query/discussions/UnreadGambit",c);class u extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.email.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.email.hint",{},!0)}filterKey(){return"email"}enabled(){return!(!s.A.session.user||!s.A.forum.attribute("canEditUserCredentials"))}}flarum.reg.add("core","common/query/users/EmailGambit",u);class d extends a.px{key(){return s.A.translator.trans("core.lib.gambits.users.group.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.users.group.hint",{},!0)}filterKey(){return"group"}}flarum.reg.add("core","common/query/users/GroupGambit",d);class m extends a.px{key(){return s.A.translator.trans("core.lib.gambits.posts.discussion.key",{},!0)}hint(){return s.A.translator.trans("core.lib.gambits.posts.discussion.hint",{},!0)}filterKey(){return"discussion"}}flarum.reg.add("core","common/query/discussions/DiscussionGambit",m);class h{constructor(){(0,r.A)(this,"gambits",{discussions:[i,o,l,c],posts:[i,m],users:[u,d]})}apply(t,e){return e.q=this.match(t,e.q,((t,n,r)=>{const s=t.toFilter(n,r);Object.keys(s).forEach((n=>{n in e&&t.predicates&&Array.isArray(s[n])?e[n]=e[n].concat(s[n]):e[n]=s[n]}))})),e}match(t,e,n){const r=this.for(t).filter((t=>t.enabled()));if(0===r.length)return e;const s=e.split(" ");for(const t of r)for(const r of s){const s=new RegExp(`^(-?)${t.pattern()}$`,"i");let a=r.match(s);if(a){const s="-"===a[1];a.splice(1,1),n(t,a,s,r),e=e.replace(r,"")}}return e.trim().replace(/\s+/g," ")}from(t,e,n){const r=this.for(t);return 0===r.length||Object.keys(n).forEach((t=>{for(const s of r){const r="-"===t[0];r&&(t=t.substring(1)),s.filterKey()===t&&(e+=` ${s.fromFilter(n[t],r)}`)}})),e}for(t){return(this.gambits[t]||[]).map((t=>new t))}}flarum.reg.add("core","common/GambitManager",h);class p{constructor(t){(0,r.A)(this,"state",void 0),(0,r.A)(this,"gambits",new h),this.state=t}}(0,r.A)(p,"MIN_SEARCH_LEN",3),flarum.reg.add("core","common/SearchManager",p)},5114:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});const r=window,s=new Proxy({},{get:(t,e)=>Reflect.get(r.app,e,r.app),set:(t,e,n)=>Reflect.set(r.app,e,n,r.app)}),a=s;flarum.reg.add("core","common/app",s)},9924:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(3092),a=n(5673),i=n(4586),o=n(4268),l=n(5114),c=n(7479);class u extends r.A{view(t){const e=Object.assign({},this.attrs),n=(0,i.A)(e,"type");e.className=(0,o.A)("Alert",`Alert--${n}`,e.className);const r=(0,i.A)(e,"title"),u=(0,i.A)(e,"icon"),d=(0,i.A)(e,"content")||t.children,h=(0,i.A)(e,"controls")||[],p=(0,i.A)(e,"dismissible"),f=(0,i.A)(e,"ondismiss"),g=[];return(p||void 0===p)&&g.push(m(s.A,{"aria-label":l.A.translator.trans("core.lib.alert.dismiss_a11y_label"),icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:f})),m("div",e,m("div",{className:(0,o.A)("Alert-container",e.containerClassName)},m("div",{className:"Alert-content"},!!r&&m("div",{className:"Alert-title"},!!u&&m("span",{className:"Alert-title-icon"},m(c.A,{name:u})),m("span",{className:"Alert-title-text"},r)),m("span",{className:"Alert-body"},d)),m("ul",{className:"Alert-controls"},(0,a.A)(h.concat(g)))))}}flarum.reg.add("core","common/components/Alert",u)},367:(t,e,n)=>{"use strict";n.d(e,{A:()=>l});var r=n(4391),s=n(5710),a=n(4268),i=n(3288),o=n(7479);class l extends s.A{view(){const{type:t,icon:e,label:n,color:s,style:l={},...c}=this.attrs,u=(0,a.A)("Badge",[t&&`Badge--${t}`],c.className,(0,i.A)(s)),d=e?m(o.A,{name:e,className:"Badge-icon"}):m.trust(" "),h={...l};window.testing||(h["--badge-bg"]=s);const p={...c,className:u,style:h},f=m("div",p,d);return n?m(r.A,{text:n},f):f}}flarum.reg.add("core","common/components/Badge",l)},3092:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5710),s=n(4434),a=n(4268),i=n(117),o=n(43),l=n(7479);class c extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:o,className:l,class:c,...u}=this.attrs;e||="button","object"==typeof n&&(n=(0,i.A)(n)),(s||o)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||o,loading:o});const d={disabled:s,className:l,type:e,"aria-label":n,...u};return m("button",d,this.getButtonContent(t.children))}oncreate(t){super.oncreate(t);const{"aria-label":e}=this.attrs;this.view!==c.prototype.view||e||(0,i.A)(t.children)||this.element?.getAttribute?.("aria-label")||(0,s.A)('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)}getButtonContent(t){const e=this.attrs.icon;return[e&&m(l.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(o.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",c)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(4268);class a extends r.A{view(t){const{label:e,description:n,className:r,...a}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},a),(e||n)&&m("div",{className:"Form-header"},e&&m("label",null,e),n&&m("p",{className:"helpText"},n)),m("div",{className:"Form-body"},t.children))}}flarum.reg.add("core","common/components/Form",a)},2855:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(2849);class s extends r.A{wrapper(t){return m("form",{onsubmit:this.onsubmit.bind(this)},t)}onsubmit(t){}onready(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")}onerror(t){this.alertAttrs=t.alert,m.redraw(),422===t.status&&t.response?.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()}}flarum.reg.add("core","common/components/FormModal",s)},3550:(t,e,n)=>{"use strict";n.d(e,{A:()=>s});var r=n(367);class s extends r.A{static initAttrs(t){super.initAttrs(t),t.group&&(t.icon=t.group.icon()||"",t.color=t.group.color()||"",t.label=void 0===t.label?t.group.nameSingular():t.label,t.type="group--"+t.group.id(),delete t.group)}}flarum.reg.add("core","common/components/GroupBadge",s)},7479:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(4268),s=n(5710);class a extends s.A{view(t){const{name:e,...n}=t.attrs;return n.className=(0,r.A)("icon",e,n.className),m("i",Object.assign({"aria-hidden":"true"},n))}}flarum.reg.add("core","common/components/Icon",a)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(7479),a=n(4268);class i extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,a.A)("InfoTile",n)},r),this.icon(),m("div",{className:"InfoTile-text"},t.children))}icon(){return this.attrs.iconElement?this.attrs.iconElement:this.attrs.icon?m(s.A,{name:(0,a.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",i)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),a=n(7479),i=n(43),o=n(4268),l=n(3092);class c extends s.A{oninit(t){super.oninit(t)}view(t){const{className:e,...n}=this.attrs.inputAttrs||{},s=this.attrs.value||this.attrs.stream?.()||"";return m("div",{className:(0,o.A)("Input",this.attrs.className,{"Input--withPrefix":this.attrs.prefixIcon,"Input--withClear":this.attrs.clearable})},this.attrs.prefixIcon&&m(a.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:e,value:s,inputAttrs:n}),this.attrs.loading&&m(i.A,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),this.attrs.clearable&&s&&!this.attrs.loading&&m(l.A,{className:"Input-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":this.attrs.clearLabel||r.A.translator.trans("core.lib.input.clear_button"),type:"button",icon:"fas fa-times-circle"}))}input(t){let{inputClassName:e,value:n,inputAttrs:r}=t;const s={className:(0,o.A)("FormControl",e),type:this.attrs.type||"text",value:n,oninput:t=>this.onchange?.(t.target.value),"aria-label":this.attrs.ariaLabel,placeholder:this.attrs.placeholder,readonly:this.attrs.readonly||void 0,disabled:this.attrs.disabled||void 0,...r};return this.attrs.renderInput?this.attrs.renderInput(s):m("input",s)}onchange(t){this.attrs.stream?this.attrs.stream(t):this.attrs.onchange?.(t)}clear(){this.onchange("")}}flarum.reg.add("core","common/components/Input",c)},43:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5114),s=n(5710),a=n(4268);class i extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...i}=this.attrs,o=(0,a.A)("LoadingIndicator",s),l=(0,a.A)("LoadingIndicator-container","unset"!==t&&`LoadingIndicator-container--${t}`,e&&`LoadingIndicator-container--${e}`,n);return m("div",Object.assign({"aria-label":r.A.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},i.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},i)))}}flarum.reg.add("core","common/components/LoadingIndicator",i)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),a=n(5710),i=n(9924),o=n(3092),l=n(4268);class c extends a.A{constructor(){super(...arguments),(0,r.A)(this,"loading",!1),(0,r.A)(this,"alertAttrs",null)}static get dismissibleOptions(){return{viaCloseButton:this.isDismissibleViaCloseButton,viaEscKey:this.isDismissibleViaEscKey,viaBackdropClick:this.isDismissibleViaBackdropClick}}oncreate(t){super.oncreate(t),this.attrs.animateShow((()=>this.onready()))}onbeforeremove(t){if(super.onbeforeremove(t),!this.attrs.state.modal)return new Promise((t=>setTimeout(t,300)))}view(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:(0,l.A)("Modal modal-dialog fade",this.className())},m("div",{className:"Modal-content"},this.dismissibleOptions.viaCloseButton&&m("div",{className:"Modal-close App-backControl"},m(o.A,{icon:"fas fa-times",onclick:()=>this.hide(),className:"Button Button--icon Button--link","aria-label":s.A.translator.trans("core.lib.modal.close")})),this.wrapper(this.inner())))}wrapper(t){return m("[",null,t)}inner(){return m("[",null,m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),!!this.alertAttrs&&m("div",{className:"Modal-alert"},m(i.A,this.alertAttrs)),this.content())}onready(){}hide(){this.attrs.animateHide()}loaded(){this.loading=!1,m.redraw()}get dismissibleOptions(){return this.constructor.dismissibleOptions}}(0,r.A)(c,"isDismissibleViaCloseButton",!0),(0,r.A)(c,"isDismissibleViaEscKey",!0),(0,r.A)(c,"isDismissibleViaBackdropClick",!0),flarum.reg.add("core","common/components/Modal",c)},4391:(t,e,n)=>{"use strict";n.d(e,{A:()=>o});var r=n(8805),s=n(5710),a=n(4268),i=n(117);class o extends s.A{constructor(){super(...arguments),(0,r.A)(this,"firstChild",null),(0,r.A)(this,"childDomNode",null),(0,r.A)(this,"oldText",""),(0,r.A)(this,"oldVisibility",void 0),(0,r.A)(this,"shouldRecreateTooltip",!1),(0,r.A)(this,"shouldChangeTooltipVisibility",!1)}view(t){const e=t.children,{text:n,tooltipVisible:r,showOnFocus:s=!0,position:a="top",ignoreTitleWarning:i=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!i&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");const u=this.getRealText();if(u!==this.oldText&&(this.oldText=u,this.shouldRecreateTooltip=!0),r!==this.oldVisibility&&(this.oldVisibility=this.attrs.tooltipVisible,this.shouldChangeTooltipVisibility=!0),void 0===e)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if(1!==e.length)throw new Error("Tooltip component was either passed more than one or no child node.\n\nPlease wrap multiple children in another element, such as a
-1)s&&s.push(a);else if(c=gt(a),i=Ct(d.appendChild(a),"script"),c&&Dt(i),n)for(u=0;a=i[u++];)Et.test(a.type||"")&&n.push(a);return d}var It=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Lt(){return!1}function jt(t,e,n,r,s,a){var i,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)jt(t,o,n,r,e[o],a);return t}if(null==r&&null==s?(s=n,r=n=void 0):null==s&&("string"==typeof n?(s=r,r=void 0):(s=r,r=n,n=void 0)),!1===s)s=Lt;else if(!s)return t;return 1===a&&(i=s,s=function(t){return _().off(t),i.apply(this,arguments)},s.guid=i.guid||(i.guid=_.guid++)),t.each((function(){_.event.add(this,e,s,r,n)}))}function $t(t,e,n){n?(ot.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(r=o.call(arguments),ot.set(this,e,r),this[e](),n=ot.get(this,e),ot.set(this,e,!1),r!==n)return t.stopImmediatePropagation(),t.preventDefault(),n}else r&&(ot.set(this,e,_.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Ot)}})):void 0===ot.get(t,e)&&_.event.add(t,e,Ot)}_.event={global:{},add:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.get(t);if(at(t))for(n.handler&&(n=(a=n).handler,s=a.selector),s&&_.find.matchesSelector(ft,s),n.guid||(n.guid=_.guid++),(l=g.events)||(l=g.events=Object.create(null)),(i=g.handle)||(i=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=_.event.special[h]||{},h=(s?d.delegateType:d.bindType)||h,d=_.event.special[h]||{},u=_.extend({type:h,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&_.expr.match.needsContext.test(s),namespace:p.join(".")},a),(m=l[h])||((m=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,i)||t.addEventListener&&t.addEventListener(h,i)),d.add&&(d.add.call(t,u),u.handler.guid||(u.handler.guid=n.guid)),s?m.splice(m.delegateCount++,0,u):m.push(u),_.event.global[h]=!0)},remove:function(t,e,n,r,s){var a,i,o,l,c,u,d,m,h,p,f,g=ot.hasData(t)&&ot.get(t);if(g&&(l=g.events)){for(c=(e=(e||"").match(V)||[""]).length;c--;)if(h=f=(o=It.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=_.event.special[h]||{},m=l[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=a=m.length;a--;)u=m[a],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(m.splice(a,1),u.selector&&m.delegateCount--,d.remove&&d.remove.call(t,u));i&&!m.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,h,g.handle),delete l[h])}else for(h in l)_.event.remove(t,h+e[c],n,r,!0);_.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,a,i,o=new Array(arguments.length),l=_.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=_.event.special[l.type]||{};for(o[0]=l,e=1;e1)}}),_.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,a){this.elem=t,this.prop=n,this.easing=s||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=a||(_.cssNumber[n]?"":"px")},cur:function(){var t=de.propHooks[this.prop];return t&&t.get?t.get(this):de.propHooks._default.get(this)},run:function(t){var e,n=de.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):de.propHooks._default.set(this),this}},de.prototype.init.prototype=de.prototype,de.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},de.propHooks.scrollTop=de.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},_.fx=de.prototype.init,_.fx.step={};var me,he,pe=/^(?:toggle|show|hide)$/,fe=/queueHooks$/;function ge(){he&&(!1===y.hidden&&r.requestAnimationFrame?r.requestAnimationFrame(ge):r.setTimeout(ge,_.fx.interval),_.fx.tick())}function ve(){return r.setTimeout((function(){me=void 0})),me=Date.now()}function be(t,e){var n,r=0,s={height:t};for(e=e?1:0;r<4;r+=2-e)s["margin"+(n=pt[r])]=s["padding"+n]=t;return e&&(s.opacity=s.width=t),s}function ye(t,e,n){for(var r,s=(we.tweeners[e]||[]).concat(we.tweeners["*"]),a=0,i=s.length;a1)},removeAttr:function(t){return this.each((function(){_.removeAttr(this,t)}))}}),_.extend({attr:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return void 0===t.getAttribute?_.prop(t,e,n):(1===a&&_.isXMLDoc(t)||(s=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:(t.setAttribute(e,n+""),n):s&&"get"in s&&null!==(r=s.get(t,e))?r:null==(r=_.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&E(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,r=0,s=e&&e.match(V);if(s&&1===t.nodeType)for(;n=s[r++];)t.removeAttribute(n)}}),Ae={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||_.find.attr;xe[e]=function(t,e,r){var s,a,i=e.toLowerCase();return r||(a=xe[i],xe[i]=s,s=null!=n(t,e,r)?i:null,xe[i]=a),s}}));var Ne=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function _e(t){return(t.match(V)||[]).join(" ")}function Se(t){return t.getAttribute&&t.getAttribute("class")||""}function Ee(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}_.fn.extend({prop:function(t,e){return tt(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[_.propFix[t]||t]}))}}),_.extend({prop:function(t,e,n){var r,s,a=t.nodeType;if(3!==a&&8!==a&&2!==a)return 1===a&&_.isXMLDoc(t)||(e=_.propFix[e]||e,s=_.propHooks[e]),void 0!==n?s&&"set"in s&&void 0!==(r=s.set(t,n,e))?r:t[e]=n:s&&"get"in s&&null!==(r=s.get(t,e))?r:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):Ne.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this})),_.fn.extend({addClass:function(t){var e,n,r,s,a,i;return v(t)?this.each((function(e){_(this).addClass(t.call(this,e,Se(this)))})):(e=Ee(t)).length?this.each((function(){if(r=Se(this),n=1===this.nodeType&&" "+_e(r)+" "){for(a=0;a