diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index e023ee857..2603e880b 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:()=>i});var r=n(8805),s=n(5114);class i{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 i&&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 i?{data:i.getIdentifier(r)}:r instanceof Array?{data:r.map(i.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(i.getIdentifier):i.getIdentifier(r)})}delete t.relationships}const r=this.copyData();this.pushData(n);const a={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:a,...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",i)},3920:(t,e,n)=>{"use strict";n.d(e,{A:()=>p});var r=n(8805),s=n(5114),i=n(8631);class a extends i.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",a);class o extends i.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 i.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 i.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 i.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 i.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 i.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:[a,o,l,c],posts:[a,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 i=r.match(s);if(i){const s="-"===i[1];i.splice(1,1),n(t,i,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:()=>i});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)}),i=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(7880),i=n(5673),a=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,a.A)(e,"type");e.className=(0,o.A)("Alert",`Alert--${n}`,e.className);const r=(0,a.A)(e,"title"),u=(0,a.A)(e,"icon"),d=(0,a.A)(e,"content")||t.children,h=(0,a.A)(e,"controls")||[],p=(0,a.A)(e,"dismissible"),f=(0,a.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,i.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),i=n(4268),a=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,i.A)("Badge",[t&&`Badge--${t}`],c.className,(0,a.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)},7880:(t,e,n)=>{"use strict";n.d(e,{A:()=>u});var r=n(5710),s=n(5114);function i(){s.A.forum.attribute("debug")&&console.warn(...arguments)}flarum.reg.add("core","common/helpers/fireDebugWarning",i);var a=n(4268),o=n(117),l=n(43),c=n(7479);class u extends r.A{view(t){let{type:e,"aria-label":n,icon:r,disabled:s,loading:i,className:l,class:c,...u}=this.attrs;e||="button","object"==typeof n&&(n=(0,o.A)(n)),(s||i)&&delete u.onclick,l=(0,a.A)(c,l,{hasIcon:r,disabled:s||i,loading:i});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!==u.prototype.view||e||(0,o.A)(t.children)||this.element?.getAttribute?.("aria-label")||i('[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(c.A,{name:e,className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.A,{size:"small",display:"inline"})]}}flarum.reg.add("core","common/components/Button",u)},374:(t,e,n)=>{"use strict";n.d(e,{A:()=>i});var r=n(5710),s=n(4268);class i extends r.A{view(t){const{label:e,description:n,className:r,...i}=t.attrs;return m("div",Object.assign({className:(0,s.A)("Form",r)},i),(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",i)},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:()=>i});var r=n(4268),s=n(5710);class i 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",i)},4164:(t,e,n)=>{"use strict";n.d(e,{A:()=>a});var r=n(5710),s=n(7479),i=n(4268);class a extends r.A{view(t){const{icon:e,className:n,...r}=t.attrs;return m("div",Object.assign({className:(0,i.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,i.A)(this.attrs.icon,"InfoTile-icon")}):null}}flarum.reg.add("core","common/components/InfoTile",a)},7882:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(5114),s=n(5710),i=n(7479),a=n(43),o=n(4268),l=n(7880);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(i.A,{name:(0,o.A)(this.attrs.prefixIcon,"Input-prefix-icon")}),this.input({inputClassName:e,value:s,inputAttrs:n}),this.attrs.loading&&m(a.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:()=>a});var r=n(5114),s=n(5710),i=n(4268);class a extends s.A{view(){const{display:t="block",size:e="medium",containerClassName:n,className:s,...a}=this.attrs,o=(0,i.A)("LoadingIndicator",s),l=(0,i.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"},a.containerAttrs,{"data-size":e,className:l}),m("div",Object.assign({"aria-hidden":"true",className:o},a)))}}flarum.reg.add("core","common/components/LoadingIndicator",a)},2849:(t,e,n)=>{"use strict";n.d(e,{A:()=>c});var r=n(8805),s=n(5114),i=n(5710),a=n(9924),o=n(7880),l=n(4268);class c extends i.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(a.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),i=n(4268),a=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:i="top",ignoreTitleWarning:a=!1,html:o=!1,delay:l=0,...c}=this.attrs;this.attrs.title&&!a&&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(i);else if(c=gt(i),a=Ct(d.appendChild(i),"script"),c&&Dt(a),n)for(u=0;i=a[u++];)kt.test(i.type||"")&&n.push(i);return d}var Ot=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function jt(){return!1}function Lt(t,e,n,r,s,i){var a,o;if("object"==typeof e){for(o in"string"!=typeof n&&(r=r||n,n=void 0),e)Lt(t,o,n,r,e[o],i);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=jt;else if(!s)return t;return 1===i&&(a=s,s=function(t){return S().off(t),a.apply(this,arguments)},s.guid=a.guid||(a.guid=S.guid++)),t.each((function(){S.event.add(this,e,s,r,n)}))}function $t(t,e,n){n?(ot.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var n,r=ot.get(this,e);if(1&t.isTrigger&&this[e]){if(r)(S.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,S.event.trigger(r[0],r.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Mt)}})):void 0===ot.get(t,e)&&S.event.add(t,e,Mt)}S.event={global:{},add:function(t,e,n,r,s){var i,a,o,l,c,u,d,m,h,p,f,g=ot.get(t);if(it(t))for(n.handler&&(n=(i=n).handler,s=i.selector),s&&S.find.matchesSelector(ft,s),n.guid||(n.guid=S.guid++),(l=g.events)||(l=g.events=Object.create(null)),(a=g.handle)||(a=g.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),c=(e=(e||"").match(V)||[""]).length;c--;)h=f=(o=Ot.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h&&(d=S.event.special[h]||{},h=(s?d.delegateType:d.bindType)||h,d=S.event.special[h]||{},u=S.extend({type:h,origType:f,data:r,handler:n,guid:n.guid,selector:s,needsContext:s&&S.expr.match.needsContext.test(s),namespace:p.join(".")},i),(m=l[h])||((m=l[h]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,r,p,a)||t.addEventListener&&t.addEventListener(h,a)),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),S.event.global[h]=!0)},remove:function(t,e,n,r,s){var i,a,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=Ot.exec(e[c])||[])[1],p=(o[2]||"").split(".").sort(),h){for(d=S.event.special[h]||{},m=l[h=(r?d.delegateType:d.bindType)||h]||[],o=o[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=i=m.length;i--;)u=m[i],!s&&f!==u.origType||n&&n.guid!==u.guid||o&&!o.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(m.splice(i,1),u.selector&&m.delegateCount--,d.remove&&d.remove.call(t,u));a&&!m.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||S.removeEvent(t,h,g.handle),delete l[h])}else for(h in l)S.event.remove(t,h+e[c],n,r,!0);S.isEmptyObject(l)&&ot.remove(t,"handle events")}},dispatch:function(t){var e,n,r,s,i,a,o=new Array(arguments.length),l=S.event.fix(t),c=(ot.get(this,"events")||Object.create(null))[l.type]||[],u=S.event.special[l.type]||{};for(o[0]=l,e=1;e1)}}),S.Tween=de,de.prototype={constructor:de,init:function(t,e,n,r,s,i){this.elem=t,this.prop=n,this.easing=s||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=r,this.unit=i||(S.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=S.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=S.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){S.fx.step[t.prop]?S.fx.step[t.prop](t):1!==t.elem.nodeType||!S.cssHooks[t.prop]&&null==t.elem.style[se(t.prop)]?t.elem[t.prop]=t.now:S.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)}},S.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},S.fx=de.prototype.init,S.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,S.fx.interval),S.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["*"]),i=0,a=s.length;i1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return void 0===t.getAttribute?S.prop(t,e,n):(1===i&&S.isXMLDoc(t)||(s=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?Ae:void 0)),void 0!==n?null===n?void S.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=S.find.attr(t,e))?void 0:r)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&k(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?S.removeAttr(t,n):t.setAttribute(n,n),n}},S.each(S.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=xe[e]||S.find.attr;xe[e]=function(t,e,r){var s,i,a=e.toLowerCase();return r||(i=xe[a],xe[a]=s,s=null!=n(t,e,r)?a:null,xe[a]=i),s}}));var _e=/^(?:input|select|textarea|button)$/i,Ne=/^(?:a|area)$/i;function Se(t){return(t.match(V)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function ke(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}S.fn.extend({prop:function(t,e){return tt(this,S.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[S.propFix[t]||t]}))}}),S.extend({prop:function(t,e,n){var r,s,i=t.nodeType;if(3!==i&&8!==i&&2!==i)return 1===i&&S.isXMLDoc(t)||(e=S.propFix[e]||e,s=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=S.find.attr(t,"tabindex");return e?parseInt(e,10):_e.test(t.nodeName)||Ne.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(S.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)}}),S.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){S.propFix[this.toLowerCase()]=this})),S.fn.extend({addClass:function(t){var e,n,r,s,i,a;return v(t)?this.each((function(e){S(this).addClass(t.call(this,e,Ee(this)))})):(e=ke(t)).length?this.each((function(){if(r=Ee(this),n=1===this.nodeType&&" "+Se(r)+" "){for(i=0;i