mirror of
https://github.com/flarum/framework.git
synced 2025-02-24 16:03:26 +08:00
3 lines
354 KiB
JavaScript
Generated
3 lines
354 KiB
JavaScript
Generated
/*! For license information please see forum.js.LICENSE.txt */
|
|
(()=>{var t={423:()=>{!function(t){"use strict";var e=function e(n,i){this.options=t.extend({},e.DEFAULTS,i);var r=this.options.target===e.DEFAULTS.target?t(this.options.target):t(document).find(this.options.target);this.$target=r.on("scroll.bs.affix.data-api",t.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",t.proxy(this.checkPositionWithEventLoop,this)),this.$element=t(n),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function n(n){return this.each((function(){var i=t(this),r=i.data("bs.affix"),o="object"==typeof n&&n;r||i.data("bs.affix",r=new e(this,o)),"string"==typeof n&&r[n]()}))}e.VERSION="3.4.1",e.RESET="affix affix-top affix-bottom",e.DEFAULTS={offset:0,target:window},e.prototype.getState=function(t,e,n,i){var r=this.$target.scrollTop(),o=this.$element.offset(),s=this.$target.height();if(null!=n&&"top"==this.affixed)return r<n&&"top";if("bottom"==this.affixed)return null!=n?!(r+this.unpin<=o.top)&&"bottom":!(r+s<=t-i)&&"bottom";var a=null==this.affixed,u=a?r:o.top;return null!=n&&r<=n?"top":null!=i&&u+(a?s:e)>=t-i&&"bottom"},e.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(e.RESET).addClass("affix");var t=this.$target.scrollTop(),n=this.$element.offset();return this.pinnedOffset=n.top-t},e.prototype.checkPositionWithEventLoop=function(){setTimeout(t.proxy(this.checkPosition,this),1)},e.prototype.checkPosition=function(){if(this.$element.is(":visible")){var n=this.$element.height(),i=this.options.offset,r=i.top,o=i.bottom,s=Math.max(t(document).height(),t(document.body).height());"object"!=typeof i&&(o=r=i),"function"==typeof r&&(r=i.top(this.$element)),"function"==typeof o&&(o=i.bottom(this.$element));var a=this.getState(s,n,r,o);if(this.affixed!=a){null!=this.unpin&&this.$element.css("top","");var u="affix"+(a?"-"+a:""),l=t.Event(u+".bs.affix");if(this.$element.trigger(l),l.isDefaultPrevented())return;this.affixed=a,this.unpin="bottom"==a?this.getPinnedOffset():null,this.$element.removeClass(e.RESET).addClass(u).trigger(u.replace("affix","affixed")+".bs.affix")}"bottom"==a&&this.$element.offset({top:s-n-o})}};var i=t.fn.affix;t.fn.affix=n,t.fn.affix.Constructor=e,t.fn.affix.noConflict=function(){return t.fn.affix=i,this},t(window).on("load",(function(){t('[data-spy="affix"]').each((function(){var e=t(this),i=e.data();i.offset=i.offset||{},null!=i.offsetBottom&&(i.offset.bottom=i.offsetBottom),null!=i.offsetTop&&(i.offset.top=i.offsetTop),n.call(e,i)}))}))}(jQuery)},298:()=>{!function(t){"use strict";var e='[data-toggle="dropdown"]',n=function(e){t(e).on("click.bs.dropdown",this.toggle)};function i(e){var n=e.attr("data-target");n||(n=(n=e.attr("href"))&&/#[A-Za-z]/.test(n)&&n.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==n?t(document).find(n):null;return i&&i.length?i:e.parent()}function r(n){n&&3===n.which||(t(".dropdown-backdrop").remove(),t(e).each((function(){var e=t(this),r=i(e),o={relatedTarget:this};r.hasClass("open")&&(n&&"click"==n.type&&/input|textarea/i.test(n.target.tagName)&&t.contains(r[0],n.target)||(r.trigger(n=t.Event("hide.bs.dropdown",o)),n.isDefaultPrevented()||(e.attr("aria-expanded","false"),r.removeClass("open").trigger(t.Event("hidden.bs.dropdown",o)))))})))}n.VERSION="3.4.1",n.prototype.toggle=function(e){var n=t(this);if(!n.is(".disabled, :disabled")){var o=i(n),s=o.hasClass("open");if(r(),!s){"ontouchstart"in document.documentElement&&!o.closest(".navbar-nav").length&&t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click",r);var a={relatedTarget:this};if(o.trigger(e=t.Event("show.bs.dropdown",a)),e.isDefaultPrevented())return;n.trigger("focus").attr("aria-expanded","true"),o.toggleClass("open").trigger(t.Event("shown.bs.dropdown",a))}return!1}},n.prototype.keydown=function(n){if(/(38|40|27|32)/.test(n.which)&&!/input|textarea/i.test(n.target.tagName)){var r=t(this);if(n.preventDefault(),n.stopPropagation(),!r.is(".disabled, :disabled")){var o=i(r),s=o.hasClass("open");if(!s&&27!=n.which||s&&27==n.which)return 27==n.which&&o.find(e).trigger("focus"),r.trigger("click");var a=o.find(".dropdown-menu li:not(.disabled):visible a");if(a.length){var u=a.index(n.target);38==n.which&&u>0&&u--,40==n.which&&u<a.length-1&&u++,~u||(u=0),a.eq(u).trigger("focus")}}}};var o=t.fn.dropdown;t.fn.dropdown=function(e){return this.each((function(){var i=t(this),r=i.data("bs.dropdown");r||i.data("bs.dropdown",r=new n(this)),"string"==typeof e&&r[e].call(i)}))},t.fn.dropdown.Constructor=n,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=o,this},t(document).on("click.bs.dropdown.data-api",r).on("click.bs.dropdown.data-api",".dropdown form",(function(t){t.stopPropagation()})).on("click.bs.dropdown.data-api",e,n.prototype.toggle).on("keydown.bs.dropdown.data-api",e,n.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",n.prototype.keydown)}(jQuery)},892:()=>{!function(t){"use strict";var e=function(e,n){this.options=n,this.$body=t(document.body),this.$element=t(e),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy((function(){this.$element.trigger("loaded.bs.modal")}),this))};function n(n,i){return this.each((function(){var r=t(this),o=r.data("bs.modal"),s=t.extend({},e.DEFAULTS,r.data(),"object"==typeof n&&n);o||r.data("bs.modal",o=new e(this,s)),"string"==typeof n?o[n](i):s.show&&o.show(i)}))}e.VERSION="3.4.1",e.TRANSITION_DURATION=300,e.BACKDROP_TRANSITION_DURATION=150,e.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},e.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},e.prototype.show=function(n){var i=this,r=t.Event("show.bs.modal",{relatedTarget:n});this.$element.trigger(r),this.isShown||r.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',t.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",(function(){i.$element.one("mouseup.dismiss.bs.modal",(function(e){t(e.target).is(i.$element)&&(i.ignoreBackdropClick=!0)}))})),this.backdrop((function(){var r=t.support.transition&&i.$element.hasClass("fade");i.$element.parent().length||i.$element.appendTo(i.$body),i.$element.show().scrollTop(0),i.adjustDialog(),r&&i.$element[0].offsetWidth,i.$element.addClass("in"),i.enforceFocus();var o=t.Event("shown.bs.modal",{relatedTarget:n});r?i.$dialog.one("bsTransitionEnd",(function(){i.$element.trigger("focus").trigger(o)})).emulateTransitionEnd(e.TRANSITION_DURATION):i.$element.trigger("focus").trigger(o)})))},e.prototype.hide=function(n){n&&n.preventDefault(),n=t.Event("hide.bs.modal"),this.$element.trigger(n),this.isShown&&!n.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),t(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(e.TRANSITION_DURATION):this.hideModal())},e.prototype.enforceFocus=function(){t(document).off("focusin.bs.modal").on("focusin.bs.modal",t.proxy((function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")}),this))},e.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",t.proxy((function(t){27==t.which&&this.hide()}),this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},e.prototype.resize=function(){this.isShown?t(window).on("resize.bs.modal",t.proxy(this.handleUpdate,this)):t(window).off("resize.bs.modal")},e.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop((function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")}))},e.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},e.prototype.backdrop=function(n){var i=this,r=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=t.support.transition&&r;if(this.$backdrop=t(document.createElement("div")).addClass("modal-backdrop "+r).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",t.proxy((function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())}),this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!n)return;o?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):n()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var s=function(){i.removeBackdrop(),n&&n()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",s).emulateTransitionEnd(e.BACKDROP_TRANSITION_DURATION):s()}else n&&n()},e.prototype.handleUpdate=function(){this.adjustDialog()},e.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},e.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},e.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},e.prototype.setScrollbar=function(){var e=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",e+n),t(this.fixedContent).each((function(e,i){var r=i.style.paddingRight,o=t(i).css("padding-right");t(i).data("padding-right",r).css("padding-right",parseFloat(o)+n+"px")})))},e.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),t(this.fixedContent).each((function(e,n){var i=t(n).data("padding-right");t(n).removeData("padding-right"),n.style.paddingRight=i||""}))},e.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var i=t.fn.modal;t.fn.modal=n,t.fn.modal.Constructor=e,t.fn.modal.noConflict=function(){return t.fn.modal=i,this},t(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',(function(e){var i=t(this),r=i.attr("href"),o=i.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,""),s=t(document).find(o),a=s.data("bs.modal")?"toggle":t.extend({remote:!/#/.test(r)&&r},s.data(),i.data());i.is("a")&&e.preventDefault(),s.one("show.bs.modal",(function(t){t.isDefaultPrevented()||s.one("hidden.bs.modal",(function(){i.is(":visible")&&i.trigger("focus")}))})),n.call(s,a,this)}))}(jQuery)},478:()=>{!function(t){"use strict";var e=["sanitize","whiteList","sanitizeFn"],n=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],i=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,r=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function o(e,o){var s=e.nodeName.toLowerCase();if(-1!==t.inArray(s,o))return-1===t.inArray(s,n)||Boolean(e.nodeValue.match(i)||e.nodeValue.match(r));for(var a=t(o).filter((function(t,e){return e instanceof RegExp})),u=0,l=a.length;u<l;u++)if(s.match(a[u]))return!0;return!1}function s(e,n,i){if(0===e.length)return e;if(i&&"function"==typeof i)return i(e);if(!document.implementation||!document.implementation.createHTMLDocument)return e;var r=document.implementation.createHTMLDocument("sanitization");r.body.innerHTML=e;for(var s=t.map(n,(function(t,e){return e})),a=t(r.body).find("*"),u=0,l=a.length;u<l;u++){var c=a[u],d=c.nodeName.toLowerCase();if(-1!==t.inArray(d,s))for(var h=t.map(c.attributes,(function(t){return t})),f=[].concat(n["*"]||[],n[d]||[]),p=0,m=h.length;p<m;p++)o(h[p],f)||c.removeAttribute(h[p].nodeName);else c.parentNode.removeChild(c)}return r.body.innerHTML}var a=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:{"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]}},a.prototype.init=function(e,n,i){if(this.enabled=!0,this.type=e,this.$element=t(n),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&t(document).find(t.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var r=this.options.trigger.split(" "),o=r.length;o--;){var s=r[o];if("click"==s)this.$element.on("click."+this.type,this.options.selector,t.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",u="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,t.proxy(this.enter,this)),this.$element.on(u+"."+this.type,this.options.selector,t.proxy(this.leave,this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},a.prototype.getDefaults=function(){return a.DEFAULTS},a.prototype.getOptions=function(n){var i=this.$element.data();for(var r in i)i.hasOwnProperty(r)&&-1!==t.inArray(r,e)&&delete i[r];return(n=t.extend({},this.getDefaults(),i,n)).delay&&"number"==typeof n.delay&&(n.delay={show:n.delay,hide:n.delay}),n.sanitize&&(n.template=s(n.template,n.whiteList,n.sanitizeFn)),n},a.prototype.getDelegateOptions=function(){var e={},n=this.getDefaults();return this._options&&t.each(this._options,(function(t,i){n[t]!=i&&(e[t]=i)})),e},a.prototype.enter=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusin"==e.type?"focus":"hover"]=!0),n.tip().hasClass("in")||"in"==n.hoverState)n.hoverState="in";else{if(clearTimeout(n.timeout),n.hoverState="in",!n.options.delay||!n.options.delay.show)return n.show();n.timeout=setTimeout((function(){"in"==n.hoverState&&n.show()}),n.options.delay.show)}},a.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},a.prototype.leave=function(e){var n=e instanceof this.constructor?e:t(e.currentTarget).data("bs."+this.type);if(n||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n)),e instanceof t.Event&&(n.inState["focusout"==e.type?"focus":"hover"]=!1),!n.isInStateTrue()){if(clearTimeout(n.timeout),n.hoverState="out",!n.options.delay||!n.options.delay.hide)return n.hide();n.timeout=setTimeout((function(){"out"==n.hoverState&&n.hide()}),n.options.delay.hide)}},a.prototype.show=function(){var e=t.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(e);var n=t.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(e.isDefaultPrevented()||!n)return;var i=this,r=this.tip(),o=this.getUID(this.type);this.setContent(),r.attr("id",o),this.$element.attr("aria-describedby",o),this.options.animation&&r.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,u=/\s?auto?\s?/i,l=u.test(s);l&&(s=s.replace(u,"")||"top"),r.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?r.appendTo(t(document).find(this.options.container)):r.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var c=this.getPosition(),d=r[0].offsetWidth,h=r[0].offsetHeight;if(l){var f=s,p=this.getPosition(this.$viewport);s="bottom"==s&&c.bottom+h>p.bottom?"top":"top"==s&&c.top-h<p.top?"bottom":"right"==s&&c.right+d>p.width?"left":"left"==s&&c.left-d<p.left?"right":s,r.removeClass(f).addClass(s)}var m=this.getCalculatedOffset(s,c,d,h);this.applyPlacement(m,s);var v=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};t.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",v).emulateTransitionEnd(a.TRANSITION_DURATION):v()}},a.prototype.applyPlacement=function(e,n){var i=this.tip(),r=i[0].offsetWidth,o=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),e.top+=s,e.left+=a,t.offset.setOffset(i[0],t.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},e),0),i.addClass("in");var u=i[0].offsetWidth,l=i[0].offsetHeight;"top"==n&&l!=o&&(e.top=e.top+o-l);var c=this.getViewportAdjustedDelta(n,e,u,l);c.left?e.left+=c.left:e.top+=c.top;var d=/top|bottom/.test(n),h=d?2*c.left-r+u:2*c.top-o+l,f=d?"offsetWidth":"offsetHeight";i.offset(e),this.replaceArrow(h,i[0][f],d)},a.prototype.replaceArrow=function(t,e,n){this.arrow().css(n?"left":"top",50*(1-t/e)+"%").css(n?"top":"left","")},a.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=s(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},a.prototype.hide=function(e){var n=this,i=t(this.$tip),r=t.Event("hide.bs."+this.type);function o(){"in"!=n.hoverState&&i.detach(),n.$element&&n.$element.removeAttr("aria-describedby").trigger("hidden.bs."+n.type),e&&e()}if(this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),t.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",o).emulateTransitionEnd(a.TRANSITION_DURATION):o(),this.hoverState=null,this},a.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},a.prototype.hasContent=function(){return this.getTitle()},a.prototype.getPosition=function(e){var n=(e=e||this.$element)[0],i="BODY"==n.tagName,r=n.getBoundingClientRect();null==r.width&&(r=t.extend({},r,{width:r.right-r.left,height:r.bottom-r.top}));var o=window.SVGElement&&n instanceof window.SVGElement,s=i?{top:0,left:0}:o?null:e.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:e.scrollTop()},u=i?{width:t(window).width(),height:t(window).height()}:null;return t.extend({},r,a,u,s)},a.prototype.getCalculatedOffset=function(t,e,n,i){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-n/2}:"top"==t?{top:e.top-i,left:e.left+e.width/2-n/2}:"left"==t?{top:e.top+e.height/2-i/2,left:e.left-n}:{top:e.top+e.height/2-i/2,left:e.left+e.width}},a.prototype.getViewportAdjustedDelta=function(t,e,n,i){var r={top:0,left:0};if(!this.$viewport)return r;var o=this.options.viewport&&this.options.viewport.padding||0,s=this.getPosition(this.$viewport);if(/right|left/.test(t)){var a=e.top-o-s.scroll,u=e.top+o-s.scroll+i;a<s.top?r.top=s.top-a:u>s.top+s.height&&(r.top=s.top+s.height-u)}else{var l=e.left-o,c=e.left+o+n;l<s.left?r.left=s.left-l:c>s.right&&(r.left=s.left+s.width-c)}return r},a.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},a.prototype.getUID=function(t){do{t+=~~(1e6*Math.random())}while(document.getElementById(t));return t},a.prototype.tip=function(){if(!this.$tip&&(this.$tip=t(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},a.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},a.prototype.enable=function(){this.enabled=!0},a.prototype.disable=function(){this.enabled=!1},a.prototype.toggleEnabled=function(){this.enabled=!this.enabled},a.prototype.toggle=function(e){var n=this;e&&((n=t(e.currentTarget).data("bs."+this.type))||(n=new this.constructor(e.currentTarget,this.getDelegateOptions()),t(e.currentTarget).data("bs."+this.type,n))),e?(n.inState.click=!n.inState.click,n.isInStateTrue()?n.enter(n):n.leave(n)):n.tip().hasClass("in")?n.leave(n):n.enter(n)},a.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide((function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null}))},a.prototype.sanitizeHtml=function(t){return s(t,this.options.whiteList,this.options.sanitizeFn)};var u=t.fn.tooltip;t.fn.tooltip=function(e){return this.each((function(){var n=t(this),i=n.data("bs.tooltip"),r="object"==typeof e&&e;!i&&/destroy|hide/.test(e)||(i||n.data("bs.tooltip",i=new a(this,r)),"string"==typeof e&&i[e]())}))},t.fn.tooltip.Constructor=a,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=u,this}}(jQuery)},646:()=>{!function(t){"use strict";t.fn.emulateTransitionEnd=function(e){var n=!1,i=this;return t(this).one("bsTransitionEnd",(function(){n=!0})),setTimeout((function(){n||t(i).trigger(t.support.transition.end)}),e),this},t((function(){t.support.transition=function(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var n in e)if(void 0!==t.style[n])return{end:e[n]};return!1}(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})}))}(jQuery)},28:t=>{var e=function(t){this.canvas=document.createElement("canvas"),this.context=this.canvas.getContext("2d"),document.body.appendChild(this.canvas),this.width=this.canvas.width=t.width,this.height=this.canvas.height=t.height,this.context.drawImage(t,0,0,this.width,this.height)};e.prototype.clear=function(){this.context.clearRect(0,0,this.width,this.height)},e.prototype.update=function(t){this.context.putImageData(t,0,0)},e.prototype.getPixelCount=function(){return this.width*this.height},e.prototype.getImageData=function(){return this.context.getImageData(0,0,this.width,this.height)},e.prototype.removeCanvas=function(){this.canvas.parentNode.removeChild(this.canvas)};var n=function(){};if(n.prototype.getColor=function(t,e){return this.getPalette(t,5,e)[0]},n.prototype.getPalette=function(t,n,i){void 0===n&&(n=10),(void 0===i||1>i)&&(i=10);for(var o,s,a,u,l=new e(t),c=l.getImageData().data,d=l.getPixelCount(),h=[],f=0;d>f;f+=i)s=c[0+(o=4*f)],a=c[o+1],u=c[o+2],c[o+3]>=125&&(s>250&&a>250&&u>250||h.push([s,a,u]));var p=r.quantize(h,n),m=p?p.palette():null;return l.removeCanvas(),m},!i)var i={map:function(t,e){var n={};return e?t.map((function(t,i){return n.index=i,e.call(n,t)})):t.slice()},naturalOrder:function(t,e){return e>t?-1:t>e?1:0},sum:function(t,e){var n={};return t.reduce(e?function(t,i,r){return n.index=r,t+e.call(n,i)}:function(t,e){return t+e},0)},max:function(t,e){return Math.max.apply(null,e?i.map(t,e):t)}};var r=function(){function t(t,e,n){return(t<<2*u)+(e<<u)+n}function e(t){function e(){n.sort(t),i=!0}var n=[],i=!1;return{push:function(t){n.push(t),i=!1},peek:function(t){return i||e(),void 0===t&&(t=n.length-1),n[t]},pop:function(){return i||e(),n.pop()},size:function(){return n.length},map:function(t){return n.map(t)},debug:function(){return i||e(),n}}}function n(t,e,n,i,r,o,s){var a=this;a.r1=t,a.r2=e,a.g1=n,a.g2=i,a.b1=r,a.b2=o,a.histo=s}function r(){this.vboxes=new e((function(t,e){return i.naturalOrder(t.vbox.count()*t.vbox.volume(),e.vbox.count()*e.vbox.volume())}))}function o(e){var n,i,r,o,s=new Array(1<<3*u);return e.forEach((function(e){i=e[0]>>l,r=e[1]>>l,o=e[2]>>l,n=t(i,r,o),s[n]=(s[n]||0)+1})),s}function s(t,e){var i,r,o,s=1e6,a=0,u=1e6,c=0,d=1e6,h=0;return t.forEach((function(t){i=t[0]>>l,r=t[1]>>l,o=t[2]>>l,s>i?s=i:i>a&&(a=i),u>r?u=r:r>c&&(c=r),d>o?d=o:o>h&&(h=o)})),new n(s,a,u,c,d,h,e)}function a(e,n){if(n.count()){var r=n.r2-n.r1+1,o=n.g2-n.g1+1,s=n.b2-n.b1+1,a=i.max([r,o,s]);if(1==n.count())return[n.copy()];var u,l,c,d,h=0,f=[],p=[];if(a==r)for(u=n.r1;u<=n.r2;u++){for(d=0,l=n.g1;l<=n.g2;l++)for(c=n.b1;c<=n.b2;c++)d+=e[t(u,l,c)]||0;h+=d,f[u]=h}else if(a==o)for(u=n.g1;u<=n.g2;u++){for(d=0,l=n.r1;l<=n.r2;l++)for(c=n.b1;c<=n.b2;c++)d+=e[t(l,u,c)]||0;h+=d,f[u]=h}else for(u=n.b1;u<=n.b2;u++){for(d=0,l=n.r1;l<=n.r2;l++)for(c=n.g1;c<=n.g2;c++)d+=e[t(l,c,u)]||0;h+=d,f[u]=h}return f.forEach((function(t,e){p[e]=h-t})),function(t){var e,i,r,o,s,a=t+"1",l=t+"2",c=0;for(u=n[a];u<=n[l];u++)if(f[u]>h/2){for(r=n.copy(),o=n.copy(),e=u-n[a],s=(i=n[l]-u)>=e?Math.min(n[l]-1,~~(u+i/2)):Math.max(n[a],~~(u-1-e/2));!f[s];)s++;for(c=p[s];!c&&f[s-1];)c=p[--s];return r[l]=s,o[a]=r[l]+1,[r,o]}}(a==r?"r":a==o?"g":"b")}}var u=5,l=8-u;return n.prototype={volume:function(t){var e=this;return(!e._volume||t)&&(e._volume=(e.r2-e.r1+1)*(e.g2-e.g1+1)*(e.b2-e.b1+1)),e._volume},count:function(e){var n=this,i=n.histo;if(!n._count_set||e){var r,o,s,a=0;for(r=n.r1;r<=n.r2;r++)for(o=n.g1;o<=n.g2;o++)for(s=n.b1;s<=n.b2;s++)index=t(r,o,s),a+=i[index]||0;n._count=a,n._count_set=!0}return n._count},copy:function(){var t=this;return new n(t.r1,t.r2,t.g1,t.g2,t.b1,t.b2,t.histo)},avg:function(e){var n=this,i=n.histo;if(!n._avg||e){var r,o,s,a,l=0,c=1<<8-u,d=0,h=0,f=0;for(o=n.r1;o<=n.r2;o++)for(s=n.g1;s<=n.g2;s++)for(a=n.b1;a<=n.b2;a++)l+=r=i[t(o,s,a)]||0,d+=r*(o+.5)*c,h+=r*(s+.5)*c,f+=r*(a+.5)*c;n._avg=l?[~~(d/l),~~(h/l),~~(f/l)]:[~~(c*(n.r1+n.r2+1)/2),~~(c*(n.g1+n.g2+1)/2),~~(c*(n.b1+n.b2+1)/2)]}return n._avg},contains:function(t){var e=this,n=t[0]>>l;return gval=t[1]>>l,bval=t[2]>>l,n>=e.r1&&n<=e.r2&&gval>=e.g1&&gval<=e.g2&&bval>=e.b1&&bval<=e.b2}},r.prototype={push:function(t){this.vboxes.push({vbox:t,color:t.avg()})},palette:function(){return this.vboxes.map((function(t){return t.color}))},size:function(){return this.vboxes.size()},map:function(t){for(var e=this.vboxes,n=0;n<e.size();n++)if(e.peek(n).vbox.contains(t))return e.peek(n).color;return this.nearest(t)},nearest:function(t){for(var e,n,i,r=this.vboxes,o=0;o<r.size();o++)(e>(n=Math.sqrt(Math.pow(t[0]-r.peek(o).color[0],2)+Math.pow(t[1]-r.peek(o).color[1],2)+Math.pow(t[2]-r.peek(o).color[2],2)))||void 0===e)&&(e=n,i=r.peek(o).color);return i},forcebw:function(){var t=this.vboxes;t.sort((function(t,e){return i.naturalOrder(i.sum(t.color),i.sum(e.color))}));var e=t[0].color;e[0]<5&&e[1]<5&&e[2]<5&&(t[0].color=[0,0,0]);var n=t.length-1,r=t[n].color;r[0]>251&&r[1]>251&&r[2]>251&&(t[n].color=[255,255,255])}},{quantize:function(t,n){function u(t,e){for(var n,i=1,r=0;1e3>r;)if((n=t.pop()).count()){var o=a(l,n),s=o[0],u=o[1];if(!s)return;if(t.push(s),u&&(t.push(u),i++),i>=e)return;if(r++>1e3)return}else t.push(n),r++}if(!t.length||2>n||n>256)return!1;var l=o(t);l.forEach((function(){}));var c=s(t,l),d=new e((function(t,e){return i.naturalOrder(t.count(),e.count())}));d.push(c),u(d,.75*n);for(var h=new e((function(t,e){return i.naturalOrder(t.count()*t.volume(),e.count()*e.volume())}));d.size();)h.push(d.pop());u(h,n-h.size());for(var f=new r;h.size();)f.push(h.pop());return f}}}();t.exports=n},555:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",i="second",r="minute",o="hour",s="day",a="week",u="month",l="quarter",c="year",d="date",h="Invalid Date",f=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,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,m={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("_")},v=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},g={s:v,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+v(i,2,"0")+":"+v(r,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var i=12*(n.year()-e.year())+(n.month()-e.month()),r=e.clone().add(i,u),o=n-r<0,s=e.clone().add(i+(o?-1:1),u);return+(-(i+(n-r)/(o?r-s:s-r))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:c,w:a,d:s,D:d,h:o,m:r,s:i,ms:n,Q:l}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",b={};b[y]=m;var w=function(t){return t instanceof S},x=function(t,e,n){var i;if(!t)return y;if("string"==typeof t)b[t]&&(i=t),e&&(b[t]=e,i=t);else{var r=t.name;b[r]=t,i=r}return!n&&i&&(y=i),i||!n&&y},N=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new S(n)},C=g;C.l=x,C.i=w,C.w=function(t,e){return N(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var S=function(){function m(t){this.$L=x(t.locale,null,!0),this.parse(t)}var v=m.prototype;return v.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(C.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var i=e.match(f);if(i){var r=i[2]-1||0,o=(i[7]||"0").substring(0,3);return n?new Date(Date.UTC(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)):new Date(i[1],r,i[3]||1,i[4]||0,i[5]||0,i[6]||0,o)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},v.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},v.$utils=function(){return C},v.isValid=function(){return!(this.$d.toString()===h)},v.isSame=function(t,e){var n=N(t);return this.startOf(e)<=n&&n<=this.endOf(e)},v.isAfter=function(t,e){return N(t)<this.startOf(e)},v.isBefore=function(t,e){return this.endOf(e)<N(t)},v.$g=function(t,e,n){return C.u(t)?this[e]:this.set(n,t)},v.unix=function(){return Math.floor(this.valueOf()/1e3)},v.valueOf=function(){return this.$d.getTime()},v.startOf=function(t,e){var n=this,l=!!C.u(e)||e,h=C.p(t),f=function(t,e){var i=C.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return l?i:i.endOf(s)},p=function(t,e){return C.w(n.toDate()[t].apply(n.toDate("s"),(l?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},m=this.$W,v=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(h){case c:return l?f(1,0):f(31,11);case u:return l?f(1,v):f(0,v+1);case a:var b=this.$locale().weekStart||0,w=(m<b?m+7:m)-b;return f(l?g-w:g+(6-w),v);case s:case d:return p(y+"Hours",0);case o:return p(y+"Minutes",1);case r:return p(y+"Seconds",2);case i:return p(y+"Milliseconds",3);default:return this.clone()}},v.endOf=function(t){return this.startOf(t,!1)},v.$set=function(t,e){var a,l=C.p(t),h="set"+(this.$u?"UTC":""),f=(a={},a[s]=h+"Date",a[d]=h+"Date",a[u]=h+"Month",a[c]=h+"FullYear",a[o]=h+"Hours",a[r]=h+"Minutes",a[i]=h+"Seconds",a[n]=h+"Milliseconds",a)[l],p=l===s?this.$D+(e-this.$W):e;if(l===u||l===c){var m=this.clone().set(d,1);m.$d[f](p),m.init(),this.$d=m.set(d,Math.min(this.$D,m.daysInMonth())).$d}else f&&this.$d[f](p);return this.init(),this},v.set=function(t,e){return this.clone().$set(t,e)},v.get=function(t){return this[C.p(t)]()},v.add=function(n,l){var d,h=this;n=Number(n);var f=C.p(l),p=function(t){var e=N(h);return C.w(e.date(e.date()+Math.round(t*n)),h)};if(f===u)return this.set(u,this.$M+n);if(f===c)return this.set(c,this.$y+n);if(f===s)return p(1);if(f===a)return p(7);var m=(d={},d[r]=t,d[o]=e,d[i]=1e3,d)[f]||1,v=this.$d.getTime()+n*m;return C.w(v,this)},v.subtract=function(t,e){return this.add(-1*t,e)},v.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||h;var i=t||"YYYY-MM-DDTHH:mm:ssZ",r=C.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,l=n.months,c=function(t,n,r,o){return t&&(t[n]||t(e,i))||r[n].substr(0,o)},d=function(t){return C.s(o%12||12,t,"0")},f=n.meridiem||function(t,e,n){var i=t<12?"AM":"PM";return n?i.toLowerCase():i},m={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:C.s(a+1,2,"0"),MMM:c(n.monthsShort,a,l,3),MMMM:c(l,a),D:this.$D,DD:C.s(this.$D,2,"0"),d:String(this.$W),dd:c(n.weekdaysMin,this.$W,u,2),ddd:c(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:C.s(o,2,"0"),h:d(1),hh:d(2),a:f(o,s,!0),A:f(o,s,!1),m:String(s),mm:C.s(s,2,"0"),s:String(this.$s),ss:C.s(this.$s,2,"0"),SSS:C.s(this.$ms,3,"0"),Z:r};return i.replace(p,(function(t,e){return e||m[t]||r.replace(":","")}))},v.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},v.diff=function(n,d,h){var f,p=C.p(d),m=N(n),v=(m.utcOffset()-this.utcOffset())*t,g=this-m,y=C.m(this,m);return y=(f={},f[c]=y/12,f[u]=y,f[l]=y/3,f[a]=(g-v)/6048e5,f[s]=(g-v)/864e5,f[o]=g/e,f[r]=g/t,f[i]=g/1e3,f)[p]||g,h?y:C.a(y)},v.daysInMonth=function(){return this.endOf(u).$D},v.$locale=function(){return b[this.$L]},v.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),i=x(t,e,!0);return i&&(n.$L=i),n},v.clone=function(){return C.w(this.$d,this)},v.toDate=function(){return new Date(this.valueOf())},v.toJSON=function(){return this.isValid()?this.toISOString():null},v.toISOString=function(){return this.$d.toISOString()},v.toString=function(){return this.$d.toUTCString()},m}(),T=S.prototype;return N.prototype=T,[["$ms",n],["$s",i],["$m",r],["$H",o],["$W",s],["$M",u],["$y",c],["$D",d]].forEach((function(t){T[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),N.extend=function(t,e){return t.$i||(t(e,S,N),t.$i=!0),N},N.locale=x,N.isDayjs=w,N.unix=function(t){return N(1e3*t)},N.en=b[y],N.Ls=b,N.p={},N}()},428:function(t){t.exports=function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,n,i){var r=n.prototype,o=r.format;i.en.formats=t,r.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,i=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,i,r){var o=r&&r.toUpperCase();return i||n[r]||t[r]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))}(e,void 0===n?{}:n);return o.call(this,i)}}}()},23:function(t){t.exports=function(){"use strict";return function(t,e,n){t=t||{};var i=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(t,e,n,r){return i.fromToBase(t,e,n,r)}n.en.relativeTime=r,i.fromToBase=function(e,i,o,s,a){for(var u,l,c,d=o.$locale().relativeTime||r,h=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=h.length,p=0;p<f;p+=1){var m=h[p];m.d&&(u=s?n(e).diff(o,m.d,!0):o.diff(e,m.d,!0));var v=(t.rounding||Math.round)(Math.abs(u));if(c=u>0,v<=m.r||!m.r){v<=1&&p>0&&(m=h[p-1]);var g=d[m.l];a&&(v=a(""+v)),l="string"==typeof g?g.replace("%d",v):g(v,i,m.l,c);break}}if(i)return l;var y=c?d.future:d.past;return"function"==typeof y?y(l):y.replace("%s",l)},i.to=function(t,e){return o(t,e,this,!0)},i.from=function(t,e){return o(t,e,this)};var s=function(t){return t.$u?n.utc():n()};i.toNow=function(t){return this.to(s(this),t)},i.fromNow=function(t){return this.from(s(this),t)}}}()},648:(t,e,n)=>{"use strict";t.exports=function(){if("object"==typeof globalThis)return globalThis;var t;try{t=this||new Function("return this")()}catch(t){if("object"==typeof window)return window;if("object"==typeof self)return self;if(void 0!==n.g)return n.g}return t}()},426:function(){!function(t){function e(e){if("string"==typeof e.data&&(e.data={keys:e.data}),e.data&&e.data.keys&&"string"==typeof e.data.keys){var n=e.handler,i=e.data.keys.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!(t.hotkeys.options.filterInputAcceptingElements&&t.hotkeys.textInputTypes.test(e.target.nodeName)||t.hotkeys.options.filterContentEditable&&t(e.target).attr("contenteditable")||t.hotkeys.options.filterTextInputs&&t.inArray(e.target.type,t.hotkeys.textAcceptingInputTypes)>-1)){var r="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],o=String.fromCharCode(e.which).toLowerCase(),s="",a={};t.each(["alt","ctrl","shift"],(function(t,n){e[n+"Key"]&&r!==n&&(s+=n+"+")})),e.metaKey&&!e.ctrlKey&&"meta"!==r&&(s+="meta+"),e.metaKey&&"meta"!==r&&s.indexOf("alt+ctrl+shift+")>-1&&(s=s.replace("alt+ctrl+shift+","hyper+")),r?a[s+r]=!0:(a[s+o]=!0,a[s+t.hotkeys.shiftNums[o]]=!0,"shift+"===s&&(a[t.hotkeys.shiftNums[o]]=!0));for(var u=0,l=i.length;u<l;u++)if(a[i[u]])return n.apply(this,arguments)}}}}t.hotkeys={version:"0.2.0",specialKeys:{8:"backspace",9:"tab",10:"return",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",59:";",61:"=",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"},textAcceptingInputTypes:["text","password","number","email","url","range","date","month","week","time","datetime","datetime-local","search","color","tel"],textInputTypes:/textarea|input|select/i,options:{filterInputAcceptingElements:!0,filterTextInputs:!0,filterContentEditable:!0}},t.each(["keydown","keyup","keypress"],(function(){t.event.special[this]={add:e}}))}(jQuery||this.jQuery||window.jQuery)},663:function(t,e){var n;!function(e,n){"use strict";"object"==typeof t.exports?t.exports=e.document?n(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return n(t)}:n(e)}("undefined"!=typeof window?window:this,(function(i,r){"use strict";var o=[],s=Object.getPrototypeOf,a=o.slice,u=o.flat?function(t){return o.flat.call(t)}:function(t){return o.concat.apply([],t)},l=o.push,c=o.indexOf,d={},h=d.toString,f=d.hasOwnProperty,p=f.toString,m=p.call(Object),v={},g=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},y=function(t){return null!=t&&t===t.window},b=i.document,w={type:!0,src:!0,nonce:!0,noModule:!0};function x(t,e,n){var i,r,o=(n=n||b).createElement("script");if(o.text=t,e)for(i in w)(r=e[i]||e.getAttribute&&e.getAttribute(i))&&o.setAttribute(i,r);n.head.appendChild(o).parentNode.removeChild(o)}function N(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?d[h.call(t)]||"object":typeof t}var C="3.6.0",S=function t(e,n){return new t.fn.init(e,n)};function T(t){var e=!!t&&"length"in t&&t.length,n=N(t);return!g(t)&&!y(t)&&("array"===n||0===e||"number"==typeof e&&e>0&&e-1 in t)}S.fn=S.prototype={jquery:C,constructor:S,length:0,toArray:function(){return a.call(this)},get:function(t){return null==t?a.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=S.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return S.each(this,t)},map:function(t){return this.pushStack(S.map(this,(function(e,n){return t.call(e,n,e)})))},slice:function(){return this.pushStack(a.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(S.grep(this,(function(t,e){return(e+1)%2})))},odd:function(){return this.pushStack(S.grep(this,(function(t,e){return e%2})))},eq:function(t){var e=this.length,n=+t+(t<0?e:0);return this.pushStack(n>=0&&n<e?[this[n]]:[])},end:function(){return this.prevObject||this.constructor()},push:l,sort:o.sort,splice:o.splice},S.extend=S.fn.extend=function(){var t,e,n,i,r,o,s=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof s&&(l=s,s=arguments[a]||{},a++),"object"==typeof s||g(s)||(s={}),a===u&&(s=this,a--);a<u;a++)if(null!=(t=arguments[a]))for(e in t)i=t[e],"__proto__"!==e&&s!==i&&(l&&i&&(S.isPlainObject(i)||(r=Array.isArray(i)))?(n=s[e],o=r&&!Array.isArray(n)?[]:r||S.isPlainObject(n)?n:{},r=!1,s[e]=S.extend(l,o,i)):void 0!==i&&(s[e]=i));return s},S.extend({expando:"jQuery"+(C+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,n;return!(!t||"[object Object]"!==h.call(t)||(e=s(t))&&("function"!=typeof(n=f.call(e,"constructor")&&e.constructor)||p.call(n)!==m))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){x(t,{nonce:e&&e.nonce},n)},each:function(t,e){var n,i=0;if(T(t))for(n=t.length;i<n&&!1!==e.call(t[i],i,t[i]);i++);else for(i in t)if(!1===e.call(t[i],i,t[i]))break;return t},makeArray:function(t,e){var n=e||[];return null!=t&&(T(Object(t))?S.merge(n,"string"==typeof t?[t]:t):l.call(n,t)),n},inArray:function(t,e,n){return null==e?-1:c.call(e,t,n)},merge:function(t,e){for(var n=+e.length,i=0,r=t.length;i<n;i++)t[r++]=e[i];return t.length=r,t},grep:function(t,e,n){for(var i=[],r=0,o=t.length,s=!n;r<o;r++)!e(t[r],r)!==s&&i.push(t[r]);return i},map:function(t,e,n){var i,r,o=0,s=[];if(T(t))for(i=t.length;o<i;o++)null!=(r=e(t[o],o,n))&&s.push(r);else for(o in t)null!=(r=e(t[o],o,n))&&s.push(r);return u(s)},guid:1,support:v}),"function"==typeof Symbol&&(S.fn[Symbol.iterator]=o[Symbol.iterator]),S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),(function(t,e){d["[object "+e+"]"]=e.toLowerCase()}));var k=function(t){var e,n,i,r,o,s,a,u,l,c,d,h,f,p,m,v,g,y,b,w="sizzle"+1*new Date,x=t.document,N=0,C=0,S=ut(),T=ut(),k=ut(),A=ut(),E=function(t,e){return t===e&&(d=!0),0},P={}.hasOwnProperty,_=[],D=_.pop,$=_.push,I=_.push,O=_.slice,M=function(t,e){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},j="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",L="[\\x20\\t\\r\\n\\f]",R="(?:\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",H="\\[[\\x20\\t\\r\\n\\f]*("+R+")(?:"+L+"*([*^$|!~]?=)"+L+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+R+"))|)"+L+"*\\]",B=":("+R+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+H+")*)|.*)\\)|)",F=new RegExp(L+"+","g"),U=new RegExp("^[\\x20\\t\\r\\n\\f]+|((?:^|[^\\\\])(?:\\\\.)*)[\\x20\\t\\r\\n\\f]+$","g"),q=new RegExp("^[\\x20\\t\\r\\n\\f]*,[\\x20\\t\\r\\n\\f]*"),z=new RegExp("^[\\x20\\t\\r\\n\\f]*([>+~]|[\\x20\\t\\r\\n\\f])[\\x20\\t\\r\\n\\f]*"),W=new RegExp(L+"|>"),V=new RegExp(B),Y=new RegExp("^"+R+"$"),G={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+B),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\([\\x20\\t\\r\\n\\f]*(even|odd|(([+-]|)(\\d*)n|)[\\x20\\t\\r\\n\\f]*(?:([+-]|)[\\x20\\t\\r\\n\\f]*(\\d+)|))[\\x20\\t\\r\\n\\f]*\\)|)","i"),bool:new RegExp("^(?:"+j+")$","i"),needsContext:new RegExp("^[\\x20\\t\\r\\n\\f]*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\([\\x20\\t\\r\\n\\f]*((?:-\\d)?\\d*)[\\x20\\t\\r\\n\\f]*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}[\\x20\\t\\r\\n\\f]?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){h()},st=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{I.apply(_=O.call(x.childNodes),x.childNodes),_[x.childNodes.length].nodeType}catch(t){I={apply:_.length?function(t,e){$.apply(t,O.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,r){var o,a,l,c,d,p,g,y=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!r&&(h(e),e=e||f,m)){if(11!==x&&(d=Z.exec(t)))if(o=d[1]){if(9===x){if(!(l=e.getElementById(o)))return i;if(l.id===o)return i.push(l),i}else if(y&&(l=y.getElementById(o))&&b(e,l)&&l.id===o)return i.push(l),i}else{if(d[2])return I.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return I.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!A[t+" "]&&(!v||!v.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(g=t,y=e,1===x&&(W.test(t)||z.test(t))){for((y=tt.test(t)&>(e.parentNode)||e)===e&&n.scope||((c=e.getAttribute("id"))?c=c.replace(it,rt):e.setAttribute("id",c=w)),a=(p=s(t)).length;a--;)p[a]=(c?"#"+c:":scope")+" "+bt(p[a]);g=p.join(",")}try{return I.apply(i,y.querySelectorAll(g)),i}catch(e){A(t,!0)}finally{c===w&&e.removeAttribute("id")}}}return u(t.replace(U,"$1"),e,i,r)}function ut(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function lt(t){return t[w]=!0,t}function ct(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ht(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function vt(t){return lt((function(e){return e=+e,lt((function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function gt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},h=at.setDocument=function(t){var e,r,s=t?t.ownerDocument||t:x;return s!=f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),x!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ot,!1):r.attachEvent&&r.attachEvent("onunload",ot)),n.scope=ct((function(t){return p.appendChild(t).appendChild(f.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=ct((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=ct((function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=ct((function(t){return p.appendChild(t).id=w,!f.getElementsByName||!f.getElementsByName(w).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},g=[],v=[],(n.qsa=Q.test(f.querySelectorAll))&&(ct((function(t){var e;p.appendChild(t).innerHTML="<a id='"+w+"'></a><select id='"+w+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll("[selected]").length||v.push("\\[[\\x20\\t\\r\\n\\f]*(?:value|"+j+")"),t.querySelectorAll("[id~="+w+"-]").length||v.push("~="),(e=f.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||v.push("\\[[\\x20\\t\\r\\n\\f]*name[\\x20\\t\\r\\n\\f]*=[\\x20\\t\\r\\n\\f]*(?:''|\"\")"),t.querySelectorAll(":checked").length||v.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||v.push(".#.+[+~]"),t.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")})),ct((function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&v.push("name[\\x20\\t\\r\\n\\f]*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),v.push(",.*:")}))),(n.matchesSelector=Q.test(y=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&&ct((function(t){n.disconnectedMatch=y.call(t,"*"),y.call(t,"[s!='']:x"),g.push("!=",B)})),v=v.length&&new RegExp(v.join("|")),g=g.length&&new RegExp(g.join("|")),e=Q.test(p.compareDocumentPosition),b=e||Q.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},E=e?function(t,e){if(t===e)return d=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==f||t.ownerDocument==x&&b(x,t)?-1:e==f||e.ownerDocument==x&&b(x,e)?1:c?M(c,t)-M(c,e):0:4&i?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!r||!o)return t==f?-1:e==f?1:r?-1:o?1:c?M(c,t)-M(c,e):0;if(r===o)return ht(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?ht(s[i],a[i]):s[i]==x?-1:a[i]==x?1:0},f):f},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&m&&!A[e+" "]&&(!g||!g.test(e))&&(!v||!v.test(e)))try{var i=y.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){A(e,!0)}return at(e,f,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=f&&h(t),b(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=f&&h(t);var r=i.attrHandle[e.toLowerCase()],o=r&&P.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(it,rt)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],r=0,o=0;if(d=!n.detectDuplicates,c=!n.sortStable&&t.slice(0),t.sort(E),d){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return c=null,t},r=at.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},i=at.selectors={cacheLength:50,createPseudo:lt,match:G,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return G.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&V.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=S[t+" "];return e||(e=new RegExp("(^|[\\x20\\t\\r\\n\\f])"+t+"("+L+"|$)"))&&S(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=at.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(F," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,u){var l,c,d,h,f,p,m=o!==s?"nextSibling":"previousSibling",v=e.parentNode,g=a&&e.nodeName.toLowerCase(),y=!u&&!a,b=!1;if(v){if(o){for(;m;){for(h=e;h=h[m];)if(a?h.nodeName.toLowerCase()===g:1===h.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?v.firstChild:v.lastChild],s&&y){for(b=(f=(l=(c=(d=(h=v)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===N&&l[1])&&l[2],h=f&&v.childNodes[f];h=++f&&h&&h[m]||(b=f=0)||p.pop();)if(1===h.nodeType&&++b&&h===e){c[t]=[N,f,b];break}}else if(y&&(b=f=(l=(c=(d=(h=e)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===N&&l[1]),!1===b)for(;(h=++f&&h&&h[m]||(b=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==g:1!==h.nodeType)||!++b||(y&&((c=(d=h[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[N,b]),h!==e)););return(b-=r)===i||b%i==0&&b/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?lt((function(t,n){for(var i,o=r(t,e),s=o.length;s--;)t[i=M(t,o[s])]=!(n[i]=o[s])})):function(t){return r(t,0,n)}):r}},pseudos:{not:lt((function(t){var e=[],n=[],i=a(t.replace(U,"$1"));return i[w]?lt((function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:lt((function(t){return function(e){return at(t,e).length>0}})),contains:lt((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:lt((function(t){return Y.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:vt((function(){return[0]})),last:vt((function(t,e){return[e-1]})),eq:vt((function(t,e,n){return[n<0?n+e:n]})),even:vt((function(t,e){for(var n=0;n<e;n+=2)t.push(n);return t})),odd:vt((function(t,e){for(var n=1;n<e;n+=2)t.push(n);return t})),lt:vt((function(t,e,n){for(var i=n<0?n+e:n>e?e:n;--i>=0;)t.push(i);return t})),gt:vt((function(t,e,n){for(var i=n<0?n+e:n;++i<e;)t.push(i);return t}))}},i.pseudos.nth=i.pseudos.eq,{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[e]=ft(e);for(e in{submit:!0,reset:!0})i.pseudos[e]=pt(e);function yt(){}function bt(t){for(var e=0,n=t.length,i="";e<n;e++)i+=t[e].value;return i}function wt(t,e,n){var i=e.dir,r=e.next,o=r||i,s=n&&"parentNode"===o,a=C++;return e.first?function(e,n,r){for(;e=e[i];)if(1===e.nodeType||s)return t(e,n,r);return!1}:function(e,n,u){var l,c,d,h=[N,a];if(u){for(;e=e[i];)if((1===e.nodeType||s)&&t(e,n,u))return!0}else for(;e=e[i];)if(1===e.nodeType||s)if(c=(d=e[w]||(e[w]={}))[e.uniqueID]||(d[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[i]||e;else{if((l=c[o])&&l[0]===N&&l[1]===a)return h[2]=l[2];if(c[o]=h,h[2]=t(e,n,u))return!0}return!1}}function xt(t){return t.length>1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function Nt(t,e,n,i,r){for(var o,s=[],a=0,u=t.length,l=null!=e;a<u;a++)(o=t[a])&&(n&&!n(o,i,r)||(s.push(o),l&&e.push(a)));return s}function Ct(t,e,n,i,r,o){return i&&!i[w]&&(i=Ct(i)),r&&!r[w]&&(r=Ct(r,o)),lt((function(o,s,a,u){var l,c,d,h=[],f=[],p=s.length,m=o||function(t,e,n){for(var i=0,r=e.length;i<r;i++)at(t,e[i],n);return n}(e||"*",a.nodeType?[a]:a,[]),v=!t||!o&&e?m:Nt(m,h,t,a,u),g=n?r||(o?t:p||i)?[]:s:v;if(n&&n(v,g,a,u),i)for(l=Nt(g,f),i(l,[],a,u),c=l.length;c--;)(d=l[c])&&(g[f[c]]=!(v[f[c]]=d));if(o){if(r||t){if(r){for(l=[],c=g.length;c--;)(d=g[c])&&l.push(v[c]=d);r(null,g=[],l,u)}for(c=g.length;c--;)(d=g[c])&&(l=r?M(o,d):h[c])>-1&&(o[l]=!(s[l]=d))}}else g=Nt(g===s?g.splice(p,g.length):g),r?r(null,s,g,u):I.apply(s,g)}))}function St(t){for(var e,n,r,o=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],u=s?1:0,c=wt((function(t){return t===e}),a,!0),d=wt((function(t){return M(e,t)>-1}),a,!0),h=[function(t,n,i){var r=!s&&(i||n!==l)||((e=n).nodeType?c(t,n,i):d(t,n,i));return e=null,r}];u<o;u++)if(n=i.relative[t[u].type])h=[wt(xt(h),n)];else{if((n=i.filter[t[u].type].apply(null,t[u].matches))[w]){for(r=++u;r<o&&!i.relative[t[r].type];r++);return Ct(u>1&&xt(h),u>1&&bt(t.slice(0,u-1).concat({value:" "===t[u-2].type?"*":""})).replace(U,"$1"),n,u<r&&St(t.slice(u,r)),r<o&&St(t=t.slice(r)),r<o&&bt(t))}h.push(n)}return xt(h)}return yt.prototype=i.filters=i.pseudos,i.setFilters=new yt,s=at.tokenize=function(t,e){var n,r,o,s,a,u,l,c=T[t+" "];if(c)return e?0:c.slice(0);for(a=t,u=[],l=i.preFilter;a;){for(s in n&&!(r=q.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(o=[])),n=!1,(r=z.exec(a))&&(n=r.shift(),o.push({value:n,type:r[0].replace(U," ")}),a=a.slice(n.length)),i.filter)!(r=G[s].exec(a))||l[s]&&!(r=l[s](r))||(n=r.shift(),o.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return e?a.length:a?at.error(t):T(t,u).slice(0)},a=at.compile=function(t,e){var n,r=[],o=[],a=k[t+" "];if(!a){for(e||(e=s(t)),n=e.length;n--;)(a=St(e[n]))[w]?r.push(a):o.push(a);a=k(t,function(t,e){var n=e.length>0,r=t.length>0,o=function(o,s,a,u,c){var d,p,v,g=0,y="0",b=o&&[],w=[],x=l,C=o||r&&i.find.TAG("*",c),S=N+=null==x?1:Math.random()||.1,T=C.length;for(c&&(l=s==f||s||c);y!==T&&null!=(d=C[y]);y++){if(r&&d){for(p=0,s||d.ownerDocument==f||(h(d),a=!m);v=t[p++];)if(v(d,s||f,a)){u.push(d);break}c&&(N=S)}n&&((d=!v&&d)&&g--,o&&b.push(d))}if(g+=y,n&&y!==g){for(p=0;v=e[p++];)v(b,w,s,a);if(o){if(g>0)for(;y--;)b[y]||w[y]||(w[y]=D.call(u));w=Nt(w)}I.apply(u,w),c&&!o&&w.length>0&&g+e.length>1&&at.uniqueSort(u)}return c&&(N=S,l=x),b};return n?lt(o):o}(o,r)),a.selector=t}return a},u=at.select=function(t,e,n,r){var o,u,l,c,d,h="function"==typeof t&&t,f=!r&&s(t=h.selector||t);if(n=n||[],1===f.length){if((u=f[0]=f[0].slice(0)).length>2&&"ID"===(l=u[0]).type&&9===e.nodeType&&m&&i.relative[u[1].type]){if(!(e=(i.find.ID(l.matches[0].replace(et,nt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(u.shift().value.length)}for(o=G.needsContext.test(t)?0:u.length;o--&&(l=u[o],!i.relative[c=l.type]);)if((d=i.find[c])&&(r=d(l.matches[0].replace(et,nt),tt.test(u[0].type)&>(e.parentNode)||e))){if(u.splice(o,1),!(t=r.length&&bt(u)))return I.apply(n,r),n;break}}return(h||a(t,f))(r,e,!m,n,!e||tt.test(t)&>(e.parentNode)||e),n},n.sortStable=w.split("").sort(E).join("")===w,n.detectDuplicates=!!d,h(),n.sortDetached=ct((function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))})),ct((function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&&ct((function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),ct((function(t){return null==t.getAttribute("disabled")}))||dt(j,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(i);S.find=k,(S.expr=k.selectors)[":"]=S.expr.pseudos,S.uniqueSort=S.unique=k.uniqueSort,S.text=k.getText,S.isXMLDoc=k.isXML,S.contains=k.contains,S.escapeSelector=k.escape;var A=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&S(t).is(n))break;i.push(t)}return i},E=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},P=S.expr.match.needsContext;function _(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var D=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function $(t,e,n){return g(e)?S.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?S.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?S.grep(t,(function(t){return c.call(e,t)>-1!==n})):S.filter(e,t,n)}S.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?S.find.matchesSelector(i,t)?[i]:[]:S.find.matches(t,S.grep(e,(function(t){return 1===t.nodeType})))},S.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(S(t).filter((function(){for(e=0;e<i;e++)if(S.contains(r[e],this))return!0})));for(n=this.pushStack([]),e=0;e<i;e++)S.find(t,r[e],n);return i>1?S.uniqueSort(n):n},filter:function(t){return this.pushStack($(this,t||[],!1))},not:function(t){return this.pushStack($(this,t||[],!0))},is:function(t){return!!$(this,"string"==typeof t&&P.test(t)?S(t):t||[],!1).length}});var I,O=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(S.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||I,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:O.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof S?e[0]:e,S.merge(this,S.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:b,!0)),D.test(i[1])&&S.isPlainObject(e))for(i in e)g(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=b.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):g(t)?void 0!==n.ready?n.ready(t):t(S):S.makeArray(t,this)}).prototype=S.fn,I=S(b);var M=/^(?:parents|prev(?:Until|All))/,j={children:!0,contents:!0,next:!0,prev:!0};function L(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}S.fn.extend({has:function(t){var e=S(t,this),n=e.length;return this.filter((function(){for(var t=0;t<n;t++)if(S.contains(this,e[t]))return!0}))},closest:function(t,e){var n,i=0,r=this.length,o=[],s="string"!=typeof t&&S(t);if(!P.test(t))for(;i<r;i++)for(n=this[i];n&&n!==e;n=n.parentNode)if(n.nodeType<11&&(s?s.index(n)>-1:1===n.nodeType&&S.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?S.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?c.call(S(t),this[0]):c.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(S.uniqueSort(S.merge(this.get(),S(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),S.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return A(t,"parentNode")},parentsUntil:function(t,e,n){return A(t,"parentNode",n)},next:function(t){return L(t,"nextSibling")},prev:function(t){return L(t,"previousSibling")},nextAll:function(t){return A(t,"nextSibling")},prevAll:function(t){return A(t,"previousSibling")},nextUntil:function(t,e,n){return A(t,"nextSibling",n)},prevUntil:function(t,e,n){return A(t,"previousSibling",n)},siblings:function(t){return E((t.parentNode||{}).firstChild,t)},children:function(t){return E(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(_(t,"template")&&(t=t.content||t),S.merge([],t.childNodes))}},(function(t,e){S.fn[t]=function(n,i){var r=S.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=S.filter(i,r)),this.length>1&&(j[t]||S.uniqueSort(r),M.test(t)&&r.reverse()),this.pushStack(r)}}));var R=/[^\x20\t\r\n\f]+/g;function H(t){return t}function B(t){throw t}function F(t,e,n,i){var r;try{t&&g(r=t.promise)?r.call(t).done(e).fail(n):t&&g(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}S.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return S.each(t.match(R)||[],(function(t,n){e[n]=!0})),e}(t):S.extend({},t);var e,n,i,r,o=[],s=[],a=-1,u=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a<o.length;)!1===o[a].apply(n[0],n[1])&&t.stopOnFalse&&(a=o.length,n=!1);t.memory||(n=!1),e=!1,r&&(o=n?[]:"")},l={add:function(){return o&&(n&&!e&&(a=o.length-1,s.push(n)),function e(n){S.each(n,(function(n,i){g(i)?t.unique&&l.has(i)||o.push(i):i&&i.length&&"string"!==N(i)&&e(i)}))}(arguments),n&&!e&&u()),this},remove:function(){return S.each(arguments,(function(t,e){for(var n;(n=S.inArray(e,o,n))>-1;)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?S.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||u()),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!i}};return l},S.extend({Deferred:function(t){var e=[["notify","progress",S.Callbacks("memory"),S.Callbacks("memory"),2],["resolve","done",S.Callbacks("once memory"),S.Callbacks("once memory"),0,"resolved"],["reject","fail",S.Callbacks("once memory"),S.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return S.Deferred((function(n){S.each(e,(function(e,i){var r=g(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&g(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,n,r){var o=0;function s(t,e,n,r){return function(){var a=this,u=arguments,l=function(){var i,l;if(!(t<o)){if((i=n.apply(a,u))===e.promise())throw new TypeError("Thenable self-resolution");l=i&&("object"==typeof i||"function"==typeof i)&&i.then,g(l)?r?l.call(i,s(o,e,H,r),s(o,e,B,r)):(o++,l.call(i,s(o,e,H,r),s(o,e,B,r),s(o,e,H,e.notifyWith))):(n!==H&&(a=void 0,u=[i]),(r||e.resolveWith)(a,u))}},c=r?l:function(){try{l()}catch(i){S.Deferred.exceptionHook&&S.Deferred.exceptionHook(i,c.stackTrace),t+1>=o&&(n!==B&&(a=void 0,u=[i]),e.rejectWith(a,u))}};t?c():(S.Deferred.getStackHook&&(c.stackTrace=S.Deferred.getStackHook()),i.setTimeout(c))}}return S.Deferred((function(i){e[0][3].add(s(0,i,g(r)?r:H,i.notifyWith)),e[1][3].add(s(0,i,g(t)?t:H)),e[2][3].add(s(0,i,g(n)?n:B))})).promise()},promise:function(t){return null!=t?S.extend(t,r):r}},o={};return S.each(e,(function(t,i){var s=i[2],a=i[5];r[i[1]]=s.add,a&&s.add((function(){n=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(i[3].fire),o[i[0]]=function(){return o[i[0]+"With"](this===o?void 0:this,arguments),this},o[i[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=a.call(arguments),o=S.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(F(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||g(r[n]&&r[n].then)))return o.then();for(;n--;)F(r[n],s(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;S.Deferred.exceptionHook=function(t,e){i.console&&i.console.warn&&t&&U.test(t.name)&&i.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},S.readyException=function(t){i.setTimeout((function(){throw t}))};var q=S.Deferred();function z(){b.removeEventListener("DOMContentLoaded",z),i.removeEventListener("load",z),S.ready()}S.fn.ready=function(t){return q.then(t).catch((function(t){S.readyException(t)})),this},S.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--S.readyWait:S.isReady)||(S.isReady=!0,!0!==t&&--S.readyWait>0||q.resolveWith(b,[S]))}}),S.ready.then=q.then,"complete"===b.readyState||"loading"!==b.readyState&&!b.documentElement.doScroll?i.setTimeout(S.ready):(b.addEventListener("DOMContentLoaded",z),i.addEventListener("load",z));var W=function t(e,n,i,r,o,s,a){var u=0,l=e.length,c=null==i;if("object"===N(i))for(u in o=!0,i)t(e,n,u,i[u],!0,s,a);else if(void 0!==r&&(o=!0,g(r)||(a=!0),c&&(a?(n.call(e,r),n=null):(c=n,n=function(t,e,n){return c.call(S(t),n)})),n))for(;u<l;u++)n(e[u],i,a?r:r.call(e[u],u,n(e[u],i)));return o?e:c?n.call(e):l?n(e[0],i):s},V=/^-ms-/,Y=/-([a-z])/g;function G(t,e){return e.toUpperCase()}function K(t){return t.replace(V,"ms-").replace(Y,G)}var X=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};function J(){this.expando=S.expando+J.uid++}J.uid=1,J.prototype={cache:function(t){var e=t[this.expando];return e||(e={},X(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,n){var i,r=this.cache(t);if("string"==typeof e)r[K(e)]=n;else for(i in e)r[K(i)]=e[i];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][K(e)]},access:function(t,e,n){return void 0===e||e&&"string"==typeof e&&void 0===n?this.get(t,e):(this.set(t,e,n),void 0!==n?n:e)},remove:function(t,e){var n,i=t[this.expando];if(void 0!==i){if(void 0!==e){n=(e=Array.isArray(e)?e.map(K):(e=K(e))in i?[e]:e.match(R)||[]).length;for(;n--;)delete i[e[n]]}(void 0===e||S.isEmptyObject(i))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!S.isEmptyObject(e)}};var Q=new J,Z=new J,tt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,et=/[A-Z]/g;function nt(t,e,n){var i;if(void 0===n&&1===t.nodeType)if(i="data-"+e.replace(et,"-$&").toLowerCase(),"string"==typeof(n=t.getAttribute(i))){try{n=function(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:tt.test(t)?JSON.parse(t):t)}(n)}catch(t){}Z.set(t,e,n)}else n=void 0;return n}S.extend({hasData:function(t){return Z.hasData(t)||Q.hasData(t)},data:function(t,e,n){return Z.access(t,e,n)},removeData:function(t,e){Z.remove(t,e)},_data:function(t,e,n){return Q.access(t,e,n)},_removeData:function(t,e){Q.remove(t,e)}}),S.fn.extend({data:function(t,e){var n,i,r,o=this[0],s=o&&o.attributes;if(void 0===t){if(this.length&&(r=Z.get(o),1===o.nodeType&&!Q.get(o,"hasDataAttrs"))){for(n=s.length;n--;)s[n]&&0===(i=s[n].name).indexOf("data-")&&(i=K(i.slice(5)),nt(o,i,r[i]));Q.set(o,"hasDataAttrs",!0)}return r}return"object"==typeof t?this.each((function(){Z.set(this,t)})):W(this,(function(e){var n;if(o&&void 0===e)return void 0!==(n=Z.get(o,t))||void 0!==(n=nt(o,t))?n:void 0;this.each((function(){Z.set(this,t,e)}))}),null,e,arguments.length>1,null,!0)},removeData:function(t){return this.each((function(){Z.remove(this,t)}))}}),S.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=Q.get(t,e),n&&(!i||Array.isArray(n)?i=Q.access(t,e,S.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){var n=S.queue(t,e=e||"fx"),i=n.length,r=n.shift(),o=S._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){S.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return Q.get(t,n)||Q.access(t,n,{empty:S.Callbacks("once memory").add((function(){Q.remove(t,[e+"queue",n])}))})}}),S.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length<n?S.queue(this[0],t):void 0===e?this:this.each((function(){var n=S.queue(this,t,e);S._queueHooks(this,t),"fx"===t&&"inprogress"!==n[0]&&S.dequeue(this,t)}))},dequeue:function(t){return this.each((function(){S.dequeue(this,t)}))},clearQueue:function(t){return this.queue(t||"fx",[])},promise:function(t,e){var n,i=1,r=S.Deferred(),o=this,s=this.length,a=function(){--i||r.resolveWith(o,[o])};for("string"!=typeof t&&(e=t,t=void 0),t=t||"fx";s--;)(n=Q.get(o[s],t+"queueHooks"))&&n.empty&&(i++,n.empty.add(a));return a(),r.promise(e)}});var it=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,rt=new RegExp("^(?:([+-])=|)("+it+")([a-z%]*)$","i"),ot=["Top","Right","Bottom","Left"],st=b.documentElement,at=function(t){return S.contains(t.ownerDocument,t)},ut={composed:!0};st.getRootNode&&(at=function(t){return S.contains(t.ownerDocument,t)||t.getRootNode(ut)===t.ownerDocument});var lt=function(t,e){return"none"===(t=e||t).style.display||""===t.style.display&&at(t)&&"none"===S.css(t,"display")};function ct(t,e,n,i){var r,o,s=20,a=i?function(){return i.cur()}:function(){return S.css(t,e,"")},u=a(),l=n&&n[3]||(S.cssNumber[e]?"":"px"),c=t.nodeType&&(S.cssNumber[e]||"px"!==l&&+u)&&rt.exec(S.css(t,e));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;s--;)S.style(t,e,c+l),(1-o)*(1-(o=a()/u||.5))<=0&&(s=0),c/=o;S.style(t,e,(c*=2)+l),n=n||[]}return n&&(c=+c||+u||0,r=n[1]?c+(n[1]+1)*n[2]:+n[2],i&&(i.unit=l,i.start=c,i.end=r)),r}var dt={};function ht(t){var e,n=t.ownerDocument,i=t.nodeName,r=dt[i];return r||(e=n.body.appendChild(n.createElement(i)),r=S.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),dt[i]=r,r)}function ft(t,e){for(var n,i,r=[],o=0,s=t.length;o<s;o++)(i=t[o]).style&&(n=i.style.display,e?("none"===n&&(r[o]=Q.get(i,"display")||null,r[o]||(i.style.display="")),""===i.style.display&<(i)&&(r[o]=ht(i))):"none"!==n&&(r[o]="none",Q.set(i,"display",n)));for(o=0;o<s;o++)null!=r[o]&&(t[o].style.display=r[o]);return t}S.fn.extend({show:function(){return ft(this,!0)},hide:function(){return ft(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each((function(){lt(this)?S(this).show():S(this).hide()}))}});var pt,mt,vt=/^(?:checkbox|radio)$/i,gt=/<([a-z][^\/\0>\x20\t\r\n\f]*)/i,yt=/^$|^module$|\/(?:java|ecma)script/i;pt=b.createDocumentFragment().appendChild(b.createElement("div")),(mt=b.createElement("input")).setAttribute("type","radio"),mt.setAttribute("checked","checked"),mt.setAttribute("name","t"),pt.appendChild(mt),v.checkClone=pt.cloneNode(!0).cloneNode(!0).lastChild.checked,pt.innerHTML="<textarea>x</textarea>",v.noCloneChecked=!!pt.cloneNode(!0).lastChild.defaultValue,pt.innerHTML="<option></option>",v.option=!!pt.lastChild;var bt={thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};function wt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&_(t,e)?S.merge([t],n):n}function xt(t,e){for(var n=0,i=t.length;n<i;n++)Q.set(t[n],"globalEval",!e||Q.get(e[n],"globalEval"))}bt.tbody=bt.tfoot=bt.colgroup=bt.caption=bt.thead,bt.th=bt.td,v.option||(bt.optgroup=bt.option=[1,"<select multiple='multiple'>","</select>"]);var Nt=/<|&#?\w+;/;function Ct(t,e,n,i,r){for(var o,s,a,u,l,c,d=e.createDocumentFragment(),h=[],f=0,p=t.length;f<p;f++)if((o=t[f])||0===o)if("object"===N(o))S.merge(h,o.nodeType?[o]:o);else if(Nt.test(o)){for(s=s||d.appendChild(e.createElement("div")),a=(gt.exec(o)||["",""])[1].toLowerCase(),u=bt[a]||bt._default,s.innerHTML=u[1]+S.htmlPrefilter(o)+u[2],c=u[0];c--;)s=s.lastChild;S.merge(h,s.childNodes),(s=d.firstChild).textContent=""}else h.push(e.createTextNode(o));for(d.textContent="",f=0;o=h[f++];)if(i&&S.inArray(o,i)>-1)r&&r.push(o);else if(l=at(o),s=wt(d.appendChild(o),"script"),l&&xt(s),n)for(c=0;o=s[c++];)yt.test(o.type||"")&&n.push(o);return d}var St=/^([^.]*)(?:\.(.+)|)/;function Tt(){return!0}function kt(){return!1}function At(t,e){return t===function(){try{return b.activeElement}catch(t){}}()==("focus"===e)}function Et(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)Et(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=kt;else if(!r)return t;return 1===o&&(s=r,r=function(t){return S().off(t),s.apply(this,arguments)},r.guid=s.guid||(s.guid=S.guid++)),t.each((function(){S.event.add(this,e,r,i,n)}))}function Pt(t,e,n){n?(Q.set(t,e,!1),S.event.add(t,e,{namespace:!1,handler:function(t){var i,r,o=Q.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(S.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=a.call(arguments),Q.set(this,e,o),i=n(this,e),this[e](),o!==(r=Q.get(this,e))||i?Q.set(this,e,!1):r={},o!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else o.length&&(Q.set(this,e,{value:S.event.trigger(S.extend(o[0],S.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===Q.get(t,e)&&S.event.add(t,e,Tt)}S.event={global:{},add:function(t,e,n,i,r){var o,s,a,u,l,c,d,h,f,p,m,v=Q.get(t);if(X(t))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&S.find.matchesSelector(st,r),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events=Object.create(null)),(s=v.handle)||(s=v.handle=function(e){return S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(R)||[""]).length;l--;)f=m=(a=St.exec(e[l])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=S.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=S.event.special[f]||{},c=S.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&S.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=u[f])||((h=u[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(f,s)),d.add&&(d.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,c):h.push(c),S.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,s,a,u,l,c,d,h,f,p,m,v=Q.hasData(t)&&Q.get(t);if(v&&(u=v.events)){for(l=(e=(e||"").match(R)||[""]).length;l--;)if(f=m=(a=St.exec(e[l])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=S.event.special[f]||{},h=u[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)c=h[o],!r&&m!==c.origType||n&&n.guid!==c.guid||a&&!a.test(c.namespace)||i&&i!==c.selector&&("**"!==i||!c.selector)||(h.splice(o,1),c.selector&&h.delegateCount--,d.remove&&d.remove.call(t,c));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,v.handle)||S.removeEvent(t,f,v.handle),delete u[f])}else for(f in u)S.event.remove(t,f+e[l],n,i,!0);S.isEmptyObject(u)&&Q.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=new Array(arguments.length),u=S.event.fix(t),l=(Q.get(this,"events")||Object.create(null))[u.type]||[],c=S.event.special[u.type]||{};for(a[0]=u,e=1;e<arguments.length;e++)a[e]=arguments[e];if(u.delegateTarget=this,!c.preDispatch||!1!==c.preDispatch.call(this,u)){for(s=S.event.handlers.call(this,u,l),e=0;(r=s[e++])&&!u.isPropagationStopped();)for(u.currentTarget=r.elem,n=0;(o=r.handlers[n++])&&!u.isImmediatePropagationStopped();)u.rnamespace&&!1!==o.namespace&&!u.rnamespace.test(o.namespace)||(u.handleObj=o,u.data=o.data,void 0!==(i=((S.event.special[o.origType]||{}).handle||o.handler).apply(r.elem,a))&&!1===(u.result=i)&&(u.preventDefault(),u.stopPropagation()));return c.postDispatch&&c.postDispatch.call(this,u),u.result}},handlers:function(t,e){var n,i,r,o,s,a=[],u=e.delegateCount,l=t.target;if(u&&l.nodeType&&!("click"===t.type&&t.button>=1))for(;l!==this;l=l.parentNode||this)if(1===l.nodeType&&("click"!==t.type||!0!==l.disabled)){for(o=[],s={},n=0;n<u;n++)void 0===s[r=(i=e[n]).selector+" "]&&(s[r]=i.needsContext?S(r,this).index(l)>-1:S.find(r,this,null,[l]).length),s[r]&&o.push(i);o.length&&a.push({elem:l,handlers:o})}return l=this,u<e.length&&a.push({elem:l,handlers:e.slice(u)}),a},addProp:function(t,e){Object.defineProperty(S.Event.prototype,t,{enumerable:!0,configurable:!0,get:g(e)?function(){if(this.originalEvent)return e(this.originalEvent)}:function(){if(this.originalEvent)return this.originalEvent[t]},set:function(e){Object.defineProperty(this,t,{enumerable:!0,configurable:!0,writable:!0,value:e})}})},fix:function(t){return t[S.expando]?t:new S.Event(t)},special:{load:{noBubble:!0},click:{setup:function(t){var e=this||t;return vt.test(e.type)&&e.click&&_(e,"input")&&Pt(e,"click",Tt),!1},trigger:function(t){var e=this||t;return vt.test(e.type)&&e.click&&_(e,"input")&&Pt(e,"click"),!0},_default:function(t){var e=t.target;return vt.test(e.type)&&e.click&&_(e,"input")&&Q.get(e,"click")||_(e,"a")}},beforeunload:{postDispatch:function(t){void 0!==t.result&&t.originalEvent&&(t.originalEvent.returnValue=t.result)}}}},S.removeEvent=function(t,e,n){t.removeEventListener&&t.removeEventListener(e,n)},(S.Event=function(t,e){if(!(this instanceof S.Event))return new S.Event(t,e);t&&t.type?(this.originalEvent=t,this.type=t.type,this.isDefaultPrevented=t.defaultPrevented||void 0===t.defaultPrevented&&!1===t.returnValue?Tt:kt,this.target=t.target&&3===t.target.nodeType?t.target.parentNode:t.target,this.currentTarget=t.currentTarget,this.relatedTarget=t.relatedTarget):this.type=t,e&&S.extend(this,e),this.timeStamp=t&&t.timeStamp||Date.now(),this[S.expando]=!0}).prototype={constructor:S.Event,isDefaultPrevented:kt,isPropagationStopped:kt,isImmediatePropagationStopped:kt,isSimulated:!1,preventDefault:function(){var t=this.originalEvent;this.isDefaultPrevented=Tt,t&&!this.isSimulated&&t.preventDefault()},stopPropagation:function(){var t=this.originalEvent;this.isPropagationStopped=Tt,t&&!this.isSimulated&&t.stopPropagation()},stopImmediatePropagation:function(){var t=this.originalEvent;this.isImmediatePropagationStopped=Tt,t&&!this.isSimulated&&t.stopImmediatePropagation(),this.stopPropagation()}},S.each({altKey:!0,bubbles:!0,cancelable:!0,changedTouches:!0,ctrlKey:!0,detail:!0,eventPhase:!0,metaKey:!0,pageX:!0,pageY:!0,shiftKey:!0,view:!0,char:!0,code:!0,charCode:!0,key:!0,keyCode:!0,button:!0,buttons:!0,clientX:!0,clientY:!0,offsetX:!0,offsetY:!0,pointerId:!0,pointerType:!0,screenX:!0,screenY:!0,targetTouches:!0,toElement:!0,touches:!0,which:!0},S.event.addProp),S.each({focus:"focusin",blur:"focusout"},(function(t,e){S.event.special[t]={setup:function(){return Pt(this,t,At),!1},trigger:function(){return Pt(this,t),!0},_default:function(){return!0},delegateType:e}})),S.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},(function(t,e){S.event.special[t]={delegateType:e,bindType:e,handle:function(t){var n,i=this,r=t.relatedTarget,o=t.handleObj;return r&&(r===i||S.contains(i,r))||(t.type=o.origType,n=o.handler.apply(this,arguments),t.type=e),n}}})),S.fn.extend({on:function(t,e,n,i){return Et(this,t,e,n,i)},one:function(t,e,n,i){return Et(this,t,e,n,i,1)},off:function(t,e,n){var i,r;if(t&&t.preventDefault&&t.handleObj)return i=t.handleObj,S(t.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof t){for(r in t)this.off(r,e,t[r]);return this}return!1!==e&&"function"!=typeof e||(n=e,e=void 0),!1===n&&(n=kt),this.each((function(){S.event.remove(this,t,n,e)}))}});var _t=/<script|<style|<link/i,Dt=/checked\s*(?:[^=]|=\s*.checked.)/i,$t=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g;function It(t,e){return _(t,"table")&&_(11!==e.nodeType?e:e.firstChild,"tr")&&S(t).children("tbody")[0]||t}function Ot(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function Mt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function jt(t,e){var n,i,r,o,s,a;if(1===e.nodeType){if(Q.hasData(t)&&(a=Q.get(t).events))for(r in Q.remove(e,"handle events"),a)for(n=0,i=a[r].length;n<i;n++)S.event.add(e,r,a[r][n]);Z.hasData(t)&&(o=Z.access(t),s=S.extend({},o),Z.set(e,s))}}function Lt(t,e){var n=e.nodeName.toLowerCase();"input"===n&&vt.test(t.type)?e.checked=t.checked:"input"!==n&&"textarea"!==n||(e.defaultValue=t.defaultValue)}function Rt(t,e,n,i){e=u(e);var r,o,s,a,l,c,d=0,h=t.length,f=h-1,p=e[0],m=g(p);if(m||h>1&&"string"==typeof p&&!v.checkClone&&Dt.test(p))return t.each((function(r){var o=t.eq(r);m&&(e[0]=p.call(this,r,o.html())),Rt(o,e,n,i)}));if(h&&(o=(r=Ct(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=S.map(wt(r,"script"),Ot)).length;d<h;d++)l=r,d!==f&&(l=S.clone(l,!0,!0),a&&S.merge(s,wt(l,"script"))),n.call(t[d],l,d);if(a)for(c=s[s.length-1].ownerDocument,S.map(s,Mt),d=0;d<a;d++)l=s[d],yt.test(l.type||"")&&!Q.access(l,"globalEval")&&S.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?S._evalUrl&&!l.noModule&&S._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):x(l.textContent.replace($t,""),l,c))}return t}function Ht(t,e,n){for(var i,r=e?S.filter(e,t):t,o=0;null!=(i=r[o]);o++)n||1!==i.nodeType||S.cleanData(wt(i)),i.parentNode&&(n&&at(i)&&xt(wt(i,"script")),i.parentNode.removeChild(i));return t}S.extend({htmlPrefilter:function(t){return t},clone:function(t,e,n){var i,r,o,s,a=t.cloneNode(!0),u=at(t);if(!(v.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||S.isXMLDoc(t)))for(s=wt(a),i=0,r=(o=wt(t)).length;i<r;i++)Lt(o[i],s[i]);if(e)if(n)for(o=o||wt(t),s=s||wt(a),i=0,r=o.length;i<r;i++)jt(o[i],s[i]);else jt(t,a);return(s=wt(a,"script")).length>0&&xt(s,!u&&wt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=S.event.special,o=0;void 0!==(n=t[o]);o++)if(X(n)){if(e=n[Q.expando]){if(e.events)for(i in e.events)r[i]?S.event.remove(n,i):S.removeEvent(n,i,e.handle);n[Q.expando]=void 0}n[Z.expando]&&(n[Z.expando]=void 0)}}}),S.fn.extend({detach:function(t){return Ht(this,t,!0)},remove:function(t){return Ht(this,t)},text:function(t){return W(this,(function(t){return void 0===t?S.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Rt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||It(this,t).appendChild(t)}))},prepend:function(){return Rt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=It(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Rt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(S.cleanData(wt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return S.clone(this,t,e)}))},html:function(t){return W(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!_t.test(t)&&!bt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=S.htmlPrefilter(t);try{for(;n<i;n++)1===(e=this[n]||{}).nodeType&&(S.cleanData(wt(e,!1)),e.innerHTML=t);e=0}catch(t){}}e&&this.empty().append(t)}),null,t,arguments.length)},replaceWith:function(){var t=[];return Rt(this,arguments,(function(e){var n=this.parentNode;S.inArray(this,t)<0&&(S.cleanData(wt(this)),n&&n.replaceChild(e,this))}),t)}}),S.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},(function(t,e){S.fn[t]=function(t){for(var n,i=[],r=S(t),o=r.length-1,s=0;s<=o;s++)n=s===o?this:this.clone(!0),S(r[s])[e](n),l.apply(i,n.get());return this.pushStack(i)}}));var Bt=new RegExp("^("+it+")(?!px)[a-z%]+$","i"),Ft=function(t){var e=t.ownerDocument.defaultView;return e&&e.opener||(e=i),e.getComputedStyle(t)},Ut=function(t,e,n){var i,r,o={};for(r in e)o[r]=t.style[r],t.style[r]=e[r];for(r in i=n.call(t),e)t.style[r]=o[r];return i},qt=new RegExp(ot.join("|"),"i");function zt(t,e,n){var i,r,o,s,a=t.style;return(n=n||Ft(t))&&(""!==(s=n.getPropertyValue(e)||n[e])||at(t)||(s=S.style(t,e)),!v.pixelBoxStyles()&&Bt.test(s)&&qt.test(e)&&(i=a.width,r=a.minWidth,o=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=n.width,a.width=i,a.minWidth=r,a.maxWidth=o)),void 0!==s?s+"":s}function Wt(t,e){return{get:function(){if(!t())return(this.get=e).apply(this,arguments);delete this.get}}}!function(){function t(){if(c){l.style.cssText="position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0",c.style.cssText="position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%",st.appendChild(l).appendChild(c);var t=i.getComputedStyle(c);n="1%"!==t.top,u=12===e(t.marginLeft),c.style.right="60%",s=36===e(t.right),r=36===e(t.width),c.style.position="absolute",o=12===e(c.offsetWidth/3),st.removeChild(l),c=null}}function e(t){return Math.round(parseFloat(t))}var n,r,o,s,a,u,l=b.createElement("div"),c=b.createElement("div");c.style&&(c.style.backgroundClip="content-box",c.cloneNode(!0).style.backgroundClip="",v.clearCloneStyle="content-box"===c.style.backgroundClip,S.extend(v,{boxSizingReliable:function(){return t(),r},pixelBoxStyles:function(){return t(),s},pixelPosition:function(){return t(),n},reliableMarginLeft:function(){return t(),u},scrollboxSize:function(){return t(),o},reliableTrDimensions:function(){var t,e,n,r;return null==a&&(t=b.createElement("table"),e=b.createElement("tr"),n=b.createElement("div"),t.style.cssText="position:absolute;left:-11111px;border-collapse:separate",e.style.cssText="border:1px solid",e.style.height="1px",n.style.height="9px",n.style.display="block",st.appendChild(t).appendChild(e).appendChild(n),r=i.getComputedStyle(e),a=parseInt(r.height,10)+parseInt(r.borderTopWidth,10)+parseInt(r.borderBottomWidth,10)===e.offsetHeight,st.removeChild(t)),a}}))}();var Vt=["Webkit","Moz","ms"],Yt=b.createElement("div").style,Gt={};function Kt(t){return S.cssProps[t]||Gt[t]||(t in Yt?t:Gt[t]=function(t){for(var e=t[0].toUpperCase()+t.slice(1),n=Vt.length;n--;)if((t=Vt[n]+e)in Yt)return t}(t)||t)}var Xt=/^(none|table(?!-c[ea]).+)/,Jt=/^--/,Qt={position:"absolute",visibility:"hidden",display:"block"},Zt={letterSpacing:"0",fontWeight:"400"};function te(t,e,n){var i=rt.exec(e);return i?Math.max(0,i[2]-(n||0))+(i[3]||"px"):e}function ee(t,e,n,i,r,o){var s="width"===e?1:0,a=0,u=0;if(n===(i?"border":"content"))return 0;for(;s<4;s+=2)"margin"===n&&(u+=S.css(t,n+ot[s],!0,r)),i?("content"===n&&(u-=S.css(t,"padding"+ot[s],!0,r)),"margin"!==n&&(u-=S.css(t,"border"+ot[s]+"Width",!0,r))):(u+=S.css(t,"padding"+ot[s],!0,r),"padding"!==n?u+=S.css(t,"border"+ot[s]+"Width",!0,r):a+=S.css(t,"border"+ot[s]+"Width",!0,r));return!i&&o>=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-u-a-.5))||0),u}function ne(t,e,n){var i=Ft(t),r=(!v.boxSizingReliable()||n)&&"border-box"===S.css(t,"boxSizing",!1,i),o=r,s=zt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Bt.test(s)){if(!n)return s;s="auto"}return(!v.boxSizingReliable()&&r||!v.reliableTrDimensions()&&_(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===S.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===S.css(t,"boxSizing",!1,i),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+ee(t,e,n||(r?"border":"content"),o,i,s)+"px"}function ie(t,e,n,i,r){return new ie.prototype.init(t,e,n,i,r)}S.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=zt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=K(e),u=Jt.test(e),l=t.style;if(u||(e=Kt(a)),s=S.cssHooks[e]||S.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:l[e];"string"==(o=typeof n)&&(r=rt.exec(n))&&r[1]&&(n=ct(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||u||(n+=r&&r[3]||(S.cssNumber[a]?"":"px")),v.clearCloneStyle||""!==n||0!==e.indexOf("background")||(l[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(u?l.setProperty(e,n):l[e]=n))}},css:function(t,e,n,i){var r,o,s,a=K(e);return Jt.test(e)||(e=Kt(a)),(s=S.cssHooks[e]||S.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=zt(t,e,i)),"normal"===r&&e in Zt&&(r=Zt[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),S.each(["height","width"],(function(t,e){S.cssHooks[e]={get:function(t,n,i){if(n)return!Xt.test(S.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ne(t,e,i):Ut(t,Qt,(function(){return ne(t,e,i)}))},set:function(t,n,i){var r,o=Ft(t),s=!v.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===S.css(t,"boxSizing",!1,o),u=i?ee(t,e,i,a,o):0;return a&&s&&(u-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-ee(t,e,"border",!1,o)-.5)),u&&(r=rt.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=S.css(t,e)),te(0,n,u)}}})),S.cssHooks.marginLeft=Wt(v.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(zt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),S.each({margin:"",padding:"",border:"Width"},(function(t,e){S.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+ot[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(S.cssHooks[t+e].set=te)})),S.fn.extend({css:function(t,e){return W(this,(function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Ft(t),r=e.length;s<r;s++)o[e[s]]=S.css(t,e[s],!1,i);return o}return void 0!==n?S.style(t,e,n):S.css(t,e)}),t,e,arguments.length>1)}}),S.Tween=ie,ie.prototype={constructor:ie,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||S.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(S.cssNumber[n]?"":"px")},cur:function(){var t=ie.propHooks[this.prop];return t&&t.get?t.get(this):ie.propHooks._default.get(this)},run:function(t){var e,n=ie.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):ie.propHooks._default.set(this),this}},ie.prototype.init.prototype=ie.prototype,ie.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[Kt(t.prop)]?t.elem[t.prop]=t.now:S.style(t.elem,t.prop,t.now+t.unit)}}},ie.propHooks.scrollTop=ie.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=ie.prototype.init).step={};var re,oe,se=/^(?:toggle|show|hide)$/,ae=/queueHooks$/;function ue(){oe&&(!1===b.hidden&&i.requestAnimationFrame?i.requestAnimationFrame(ue):i.setTimeout(ue,S.fx.interval),S.fx.tick())}function le(){return i.setTimeout((function(){re=void 0})),re=Date.now()}function ce(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=ot[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function de(t,e,n){for(var i,r=(he.tweeners[e]||[]).concat(he.tweeners["*"]),o=0,s=r.length;o<s;o++)if(i=r[o].call(n,e,t))return i}function he(t,e,n){var i,r,o=0,s=he.prefilters.length,a=S.Deferred().always((function(){delete u.elem})),u=function(){if(r)return!1;for(var e=re||le(),n=Math.max(0,l.startTime+l.duration-e),i=1-(n/l.duration||0),o=0,s=l.tweens.length;o<s;o++)l.tweens[o].run(i);return a.notifyWith(t,[l,i,n]),i<1&&s?n:(s||a.notifyWith(t,[l,1,0]),a.resolveWith(t,[l]),!1)},l=a.promise({elem:t,props:S.extend({},e),opts:S.extend(!0,{specialEasing:{},easing:S.easing._default},n),originalProperties:e,originalOptions:n,startTime:re||le(),duration:n.duration,tweens:[],createTween:function(e,n){var i=S.Tween(t,l.opts,e,n,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(i),i},stop:function(e){var n=0,i=e?l.tweens.length:0;if(r)return this;for(r=!0;n<i;n++)l.tweens[n].run(1);return e?(a.notifyWith(t,[l,1,0]),a.resolveWith(t,[l,e])):a.rejectWith(t,[l,e]),this}}),c=l.props;for(function(t,e){var n,i,r,o,s;for(n in t)if(r=e[i=K(n)],o=t[n],Array.isArray(o)&&(r=o[1],o=t[n]=o[0]),n!==i&&(t[i]=o,delete t[n]),(s=S.cssHooks[i])&&"expand"in s)for(n in o=s.expand(o),delete t[i],o)n in t||(t[n]=o[n],e[n]=r);else e[i]=r}(c,l.opts.specialEasing);o<s;o++)if(i=he.prefilters[o].call(l,t,c,l.opts))return g(i.stop)&&(S._queueHooks(l.elem,l.opts.queue).stop=i.stop.bind(i)),i;return S.map(c,de,l),g(l.opts.start)&&l.opts.start.call(t,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),S.fx.timer(S.extend(u,{elem:t,anim:l,queue:l.opts.queue})),l}S.Animation=S.extend(he,{tweeners:{"*":[function(t,e){var n=this.createTween(t,e);return ct(n.elem,t,rt.exec(e),n),n}]},tweener:function(t,e){g(t)?(e=t,t=["*"]):t=t.match(R);for(var n,i=0,r=t.length;i<r;i++)n=t[i],he.tweeners[n]=he.tweeners[n]||[],he.tweeners[n].unshift(e)},prefilters:[function(t,e,n){var i,r,o,s,a,u,l,c,d="width"in e||"height"in e,h=this,f={},p=t.style,m=t.nodeType&<(t),v=Q.get(t,"fxshow");for(i in n.queue||(null==(s=S._queueHooks(t,"fx")).unqueued&&(s.unqueued=0,a=s.empty.fire,s.empty.fire=function(){s.unqueued||a()}),s.unqueued++,h.always((function(){h.always((function(){s.unqueued--,S.queue(t,"fx").length||s.empty.fire()}))}))),e)if(r=e[i],se.test(r)){if(delete e[i],o=o||"toggle"===r,r===(m?"hide":"show")){if("show"!==r||!v||void 0===v[i])continue;m=!0}f[i]=v&&v[i]||S.style(t,i)}if((u=!S.isEmptyObject(e))||!S.isEmptyObject(f))for(i in d&&1===t.nodeType&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],null==(l=v&&v.display)&&(l=Q.get(t,"display")),"none"===(c=S.css(t,"display"))&&(l?c=l:(ft([t],!0),l=t.style.display||l,c=S.css(t,"display"),ft([t]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===S.css(t,"float")&&(u||(h.done((function(){p.display=l})),null==l&&(c=p.display,l="none"===c?"":c)),p.display="inline-block")),n.overflow&&(p.overflow="hidden",h.always((function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}))),u=!1,f)u||(v?"hidden"in v&&(m=v.hidden):v=Q.access(t,"fxshow",{display:l}),o&&(v.hidden=!m),m&&ft([t],!0),h.done((function(){for(i in m||ft([t]),Q.remove(t,"fxshow"),f)S.style(t,i,f[i])}))),u=de(m?v[i]:0,i,h),i in v||(v[i]=u.start,m&&(u.end=u.start,u.start=0))}],prefilter:function(t,e){e?he.prefilters.unshift(t):he.prefilters.push(t)}}),S.speed=function(t,e,n){var i=t&&"object"==typeof t?S.extend({},t):{complete:n||!n&&e||g(t)&&t,duration:t,easing:n&&e||e&&!g(e)&&e};return S.fx.off?i.duration=0:"number"!=typeof i.duration&&(i.duration in S.fx.speeds?i.duration=S.fx.speeds[i.duration]:i.duration=S.fx.speeds._default),null!=i.queue&&!0!==i.queue||(i.queue="fx"),i.old=i.complete,i.complete=function(){g(i.old)&&i.old.call(this),i.queue&&S.dequeue(this,i.queue)},i},S.fn.extend({fadeTo:function(t,e,n,i){return this.filter(lt).css("opacity",0).show().end().animate({opacity:e},t,n,i)},animate:function(t,e,n,i){var r=S.isEmptyObject(t),o=S.speed(e,n,i),s=function(){var e=he(this,S.extend({},t),o);(r||Q.get(this,"finish"))&&e.stop(!0)};return s.finish=s,r||!1===o.queue?this.each(s):this.queue(o.queue,s)},stop:function(t,e,n){var i=function(t){var e=t.stop;delete t.stop,e(n)};return"string"!=typeof t&&(n=e,e=t,t=void 0),e&&this.queue(t||"fx",[]),this.each((function(){var e=!0,r=null!=t&&t+"queueHooks",o=S.timers,s=Q.get(this);if(r)s[r]&&s[r].stop&&i(s[r]);else for(r in s)s[r]&&s[r].stop&&ae.test(r)&&i(s[r]);for(r=o.length;r--;)o[r].elem!==this||null!=t&&o[r].queue!==t||(o[r].anim.stop(n),e=!1,o.splice(r,1));!e&&n||S.dequeue(this,t)}))},finish:function(t){return!1!==t&&(t=t||"fx"),this.each((function(){var e,n=Q.get(this),i=n[t+"queue"],r=n[t+"queueHooks"],o=S.timers,s=i?i.length:0;for(n.finish=!0,S.queue(this,t,[]),r&&r.stop&&r.stop.call(this,!0),e=o.length;e--;)o[e].elem===this&&o[e].queue===t&&(o[e].anim.stop(!0),o.splice(e,1));for(e=0;e<s;e++)i[e]&&i[e].finish&&i[e].finish.call(this);delete n.finish}))}}),S.each(["toggle","show","hide"],(function(t,e){var n=S.fn[e];S.fn[e]=function(t,i,r){return null==t||"boolean"==typeof t?n.apply(this,arguments):this.animate(ce(e,!0),t,i,r)}})),S.each({slideDown:ce("show"),slideUp:ce("hide"),slideToggle:ce("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},(function(t,e){S.fn[t]=function(t,n,i){return this.animate(e,t,n,i)}})),S.timers=[],S.fx.tick=function(){var t,e=0,n=S.timers;for(re=Date.now();e<n.length;e++)(t=n[e])()||n[e]!==t||n.splice(e--,1);n.length||S.fx.stop(),re=void 0},S.fx.timer=function(t){S.timers.push(t),S.fx.start()},S.fx.interval=13,S.fx.start=function(){oe||(oe=!0,ue())},S.fx.stop=function(){oe=null},S.fx.speeds={slow:600,fast:200,_default:400},S.fn.delay=function(t,e){return t=S.fx&&S.fx.speeds[t]||t,e=e||"fx",this.queue(e,(function(e,n){var r=i.setTimeout(e,t);n.stop=function(){i.clearTimeout(r)}}))},function(){var t=b.createElement("input"),e=b.createElement("select").appendChild(b.createElement("option"));t.type="checkbox",v.checkOn=""!==t.value,v.optSelected=e.selected,(t=b.createElement("input")).value="t",t.type="radio",v.radioValue="t"===t.value}();var fe,pe=S.expr.attrHandle;S.fn.extend({attr:function(t,e){return W(this,S.attr,t,e,arguments.length>1)},removeAttr:function(t){return this.each((function(){S.removeAttr(this,t)}))}}),S.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?S.prop(t,e,n):(1===o&&S.isXMLDoc(t)||(r=S.attrHooks[e.toLowerCase()]||(S.expr.match.bool.test(e)?fe:void 0)),void 0!==n?null===n?void S.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=S.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!v.radioValue&&"radio"===e&&_(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(R);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),fe={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=pe[e]||S.find.attr;pe[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=pe[s],pe[s]=r,r=null!=n(t,e,i)?s:null,pe[s]=o),r}}));var me=/^(?:input|select|textarea|button)$/i,ve=/^(?:a|area)$/i;function ge(t){return(t.match(R)||[]).join(" ")}function ye(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(R)||[]}S.fn.extend({prop:function(t,e){return W(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 i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&S.isXMLDoc(t)||(e=S.propFix[e]||e,r=S.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=S.find.attr(t,"tabindex");return e?parseInt(e,10):me.test(t.nodeName)||ve.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),v.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,i,r,o,s,a,u=0;if(g(t))return this.each((function(e){S(this).addClass(t.call(this,e,ye(this)))}));if((e=be(t)).length)for(;n=this[u++];)if(r=ye(n),i=1===n.nodeType&&" "+ge(r)+" "){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(a=ge(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,u=0;if(g(t))return this.each((function(e){S(this).removeClass(t.call(this,e,ye(this)))}));if(!arguments.length)return this.attr("class","");if((e=be(t)).length)for(;n=this[u++];)if(r=ye(n),i=1===n.nodeType&&" "+ge(r)+" "){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(a=ge(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):g(t)?this.each((function(n){S(this).toggleClass(t.call(this,n,ye(this),e),e)})):this.each((function(){var e,r,o,s;if(i)for(r=0,o=S(this),s=be(t);e=s[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ye(this))&&Q.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":Q.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+ge(ye(n))+" ").indexOf(e)>-1)return!0;return!1}});var we=/\r/g;S.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=g(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,S(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=S.map(r,(function(t){return null==t?"":t+""}))),(e=S.valHooks[this.type]||S.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=S.valHooks[r.type]||S.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(we,""):null==n?"":n:void 0}}),S.extend({valHooks:{option:{get:function(t){var e=S.find.attr(t,"value");return null!=e?e:ge(S.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],u=s?o+1:r.length;for(i=o<0?u:s?o:0;i<u;i++)if(((n=r[i]).selected||i===o)&&!n.disabled&&(!n.parentNode.disabled||!_(n.parentNode,"optgroup"))){if(e=S(n).val(),s)return e;a.push(e)}return a},set:function(t,e){for(var n,i,r=t.options,o=S.makeArray(e),s=r.length;s--;)((i=r[s]).selected=S.inArray(S.valHooks.option.get(i),o)>-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),S.each(["radio","checkbox"],(function(){S.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=S.inArray(S(t).val(),e)>-1}},v.checkOn||(S.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),v.focusin="onfocusin"in i;var xe=/^(?:focusinfocus|focusoutblur)$/,Ne=function(t){t.stopPropagation()};S.extend(S.event,{trigger:function(t,e,n,r){var o,s,a,u,l,c,d,h,p=[n||b],m=f.call(t,"type")?t.type:t,v=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=a=n=n||b,3!==n.nodeType&&8!==n.nodeType&&!xe.test(m+S.event.triggered)&&(m.indexOf(".")>-1&&(v=m.split("."),m=v.shift(),v.sort()),l=m.indexOf(":")<0&&"on"+m,(t=t[S.expando]?t:new S.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=v.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+v.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:S.makeArray(e,[t]),d=S.event.special[m]||{},r||!d.trigger||!1!==d.trigger.apply(n,e))){if(!r&&!d.noBubble&&!y(n)){for(u=d.delegateType||m,xe.test(u+m)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(n.ownerDocument||b)&&p.push(a.defaultView||a.parentWindow||i)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)h=s,t.type=o>1?u:d.bindType||m,(c=(Q.get(s,"events")||Object.create(null))[t.type]&&Q.get(s,"handle"))&&c.apply(s,e),(c=l&&s[l])&&c.apply&&X(s)&&(t.result=c.apply(s,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!X(n)||l&&g(n[m])&&!y(n)&&((a=n[l])&&(n[l]=null),S.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,Ne),n[m](),t.isPropagationStopped()&&h.removeEventListener(m,Ne),S.event.triggered=void 0,a&&(n[l]=a)),t.result}},simulate:function(t,e,n){var i=S.extend(new S.Event,n,{type:t,isSimulated:!0});S.event.trigger(i,null,e)}}),S.fn.extend({trigger:function(t,e){return this.each((function(){S.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return S.event.trigger(t,e,n,!0)}}),v.focusin||S.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){S.event.simulate(e,t.target,S.event.fix(t))};S.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=Q.access(i,e);r||i.addEventListener(t,n,!0),Q.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=Q.access(i,e)-1;r?Q.access(i,e,r):(i.removeEventListener(t,n,!0),Q.remove(i,e))}}}));var Ce=i.location,Se={guid:Date.now()},Te=/\?/;S.parseXML=function(t){var e,n;if(!t||"string"!=typeof t)return null;try{e=(new i.DOMParser).parseFromString(t,"text/xml")}catch(t){}return n=e&&e.getElementsByTagName("parsererror")[0],e&&!n||S.error("Invalid XML: "+(n?S.map(n.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var ke=/\[\]$/,Ae=/\r?\n/g,Ee=/^(?:submit|button|image|reset|file)$/i,Pe=/^(?:input|select|textarea|keygen)/i;function _e(t,e,n,i){var r;if(Array.isArray(e))S.each(e,(function(e,r){n||ke.test(t)?i(t,r):_e(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==N(e))i(t,e);else for(r in e)_e(t+"["+r+"]",e[r],n,i)}S.param=function(t,e){var n,i=[],r=function(t,e){var n=g(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!S.isPlainObject(t))S.each(t,(function(){r(this.name,this.value)}));else for(n in t)_e(n,t[n],e,r);return i.join("&")},S.fn.extend({serialize:function(){return S.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=S.prop(this,"elements");return t?S.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!S(this).is(":disabled")&&Pe.test(this.nodeName)&&!Ee.test(t)&&(this.checked||!vt.test(t))})).map((function(t,e){var n=S(this).val();return null==n?null:Array.isArray(n)?S.map(n,(function(t){return{name:e.name,value:t.replace(Ae,"\r\n")}})):{name:e.name,value:n.replace(Ae,"\r\n")}})).get()}});var De=/%20/g,$e=/#.*$/,Ie=/([?&])_=[^&]*/,Oe=/^(.*?):[ \t]*([^\r\n]*)$/gm,Me=/^(?:GET|HEAD)$/,je=/^\/\//,Le={},Re={},He="*/".concat("*"),Be=b.createElement("a");function Fe(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(R)||[];if(g(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ue(t,e,n,i){var r={},o=t===Re;function s(a){var u;return r[a]=!0,S.each(t[a]||[],(function(t,a){var l=a(e,n,i);return"string"!=typeof l||o||r[l]?o?!(u=l):void 0:(e.dataTypes.unshift(l),s(l),!1)})),u}return s(e.dataTypes[0])||!r["*"]&&s("*")}function qe(t,e){var n,i,r=S.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&S.extend(!0,t,i),t}Be.href=Ce.href,S.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ce.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ce.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":He,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":S.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?qe(qe(t,S.ajaxSettings),e):qe(S.ajaxSettings,t)},ajaxPrefilter:Fe(Le),ajaxTransport:Fe(Re),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0);var n,r,o,s,a,u,l,c,d,h,f=S.ajaxSetup({},e=e||{}),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?S(p):S.event,v=S.Deferred(),g=S.Callbacks("once memory"),y=f.statusCode||{},w={},x={},N="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(l){if(!s)for(s={};e=Oe.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return l?o:null},setRequestHeader:function(t,e){return null==l&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==l&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(l)C.always(t[C.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||N;return n&&n.abort(e),T(0,e),this}};if(v.promise(C),f.url=((t||f.url||Ce.href)+"").replace(je,Ce.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(R)||[""],null==f.crossDomain){u=b.createElement("a");try{u.href=f.url,u.href=u.href,f.crossDomain=Be.protocol+"//"+Be.host!=u.protocol+"//"+u.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=S.param(f.data,f.traditional)),Ue(Le,f,e,C),l)return C;for(d in(c=S.event&&f.global)&&0==S.active++&&S.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Me.test(f.type),r=f.url.replace($e,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(De,"+")):(h=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(Te.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Ie,"$1"),h=(Te.test(r)?"&":"?")+"_="+Se.guid+++h),f.url=r+h),f.ifModified&&(S.lastModified[r]&&C.setRequestHeader("If-Modified-Since",S.lastModified[r]),S.etag[r]&&C.setRequestHeader("If-None-Match",S.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&C.setRequestHeader("Content-Type",f.contentType),C.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+He+"; q=0.01":""):f.accepts["*"]),f.headers)C.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,C,f)||l))return C.abort();if(N="abort",g.add(f.complete),C.done(f.success),C.fail(f.error),n=Ue(Re,f,e,C)){if(C.readyState=1,c&&m.trigger("ajaxSend",[C,f]),l)return C;f.async&&f.timeout>0&&(a=i.setTimeout((function(){C.abort("timeout")}),f.timeout));try{l=!1,n.send(w,T)}catch(t){if(l)throw t;T(-1,t)}}else T(-1,"No Transport");function T(t,e,s,u){var d,h,b,w,x,N=e;l||(l=!0,a&&i.clearTimeout(a),n=void 0,o=u||"",C.readyState=t>0?4:0,d=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var i,r,o,s,a=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){u.unshift(r);break}if(u[0]in n)o=u[0];else{for(r in n){if(!u[0]||t.converters[r+" "+u[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==u[0]&&u.unshift(o),n[o]}(f,C,s)),!d&&S.inArray("script",f.dataTypes)>-1&&S.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,n,i){var r,o,s,a,u,l={},c=t.dataTypes.slice();if(c[1])for(s in t.converters)l[s.toLowerCase()]=t.converters[s];for(o=c.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!u&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=o,o=c.shift())if("*"===o)o=u;else if("*"!==u&&u!==o){if(!(s=l[u+" "+o]||l["* "+o]))for(r in l)if((a=r.split(" "))[1]===o&&(s=l[u+" "+a[0]]||l["* "+a[0]])){!0===s?s=l[r]:!0!==l[r]&&(o=a[0],c.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+u+" to "+o}}}return{state:"success",data:e}}(f,w,C,d),d?(f.ifModified&&((x=C.getResponseHeader("Last-Modified"))&&(S.lastModified[r]=x),(x=C.getResponseHeader("etag"))&&(S.etag[r]=x)),204===t||"HEAD"===f.type?N="nocontent":304===t?N="notmodified":(N=w.state,h=w.data,d=!(b=w.error))):(b=N,!t&&N||(N="error",t<0&&(t=0))),C.status=t,C.statusText=(e||N)+"",d?v.resolveWith(p,[h,N,C]):v.rejectWith(p,[C,N,b]),C.statusCode(y),y=void 0,c&&m.trigger(d?"ajaxSuccess":"ajaxError",[C,f,d?h:b]),g.fireWith(p,[C,N]),c&&(m.trigger("ajaxComplete",[C,f]),--S.active||S.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,n){return S.get(t,e,n,"json")},getScript:function(t,e){return S.get(t,void 0,e,"script")}}),S.each(["get","post"],(function(t,e){S[e]=function(t,n,i,r){return g(n)&&(r=r||i,i=n,n=void 0),S.ajax(S.extend({url:t,type:e,dataType:r,data:n,success:i},S.isPlainObject(t)&&t))}})),S.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),S._evalUrl=function(t,e,n){return S.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){S.globalEval(t,e,n)}})},S.fn.extend({wrapAll:function(t){var e;return this[0]&&(g(t)&&(t=t.call(this[0])),e=S(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return g(t)?this.each((function(e){S(this).wrapInner(t.call(this,e))})):this.each((function(){var e=S(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=g(t);return this.each((function(n){S(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){S(this).replaceWith(this.childNodes)})),this}}),S.expr.pseudos.hidden=function(t){return!S.expr.pseudos.visible(t)},S.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},S.ajaxSettings.xhr=function(){try{return new i.XMLHttpRequest}catch(t){}};var ze={0:200,1223:204},We=S.ajaxSettings.xhr();v.cors=!!We&&"withCredentials"in We,v.ajax=We=!!We,S.ajaxTransport((function(t){var e,n;if(v.cors||We&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(ze[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),n=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&i.setTimeout((function(){e&&n()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),S.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),S.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return S.globalEval(t),t}}}),S.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),S.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=S("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",n=function(t){e.remove(),n=null,t&&r("error"===t.type?404:200,t.type)}),b.head.appendChild(e[0])},abort:function(){n&&n()}}}));var Ve,Ye=[],Ge=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=Ye.pop()||S.expando+"_"+Se.guid++;return this[t]=!0,t}}),S.ajaxPrefilter("json jsonp",(function(t,e,n){var r,o,s,a=!1!==t.jsonp&&(Ge.test(t.url)?"url":"string"==typeof t.data&&0===(t.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(t.data)&&"data");if(a||"jsonp"===t.dataTypes[0])return r=t.jsonpCallback=g(t.jsonpCallback)?t.jsonpCallback():t.jsonpCallback,a?t[a]=t[a].replace(Ge,"$1"+r):!1!==t.jsonp&&(t.url+=(Te.test(t.url)?"&":"?")+t.jsonp+"="+r),t.converters["script json"]=function(){return s||S.error(r+" was not called"),s[0]},t.dataTypes[0]="json",o=i[r],i[r]=function(){s=arguments},n.always((function(){void 0===o?S(i).removeProp(r):i[r]=o,t[r]&&(t.jsonpCallback=e.jsonpCallback,Ye.push(r)),s&&g(o)&&o(s[0]),s=o=void 0})),"script"})),v.createHTMLDocument=((Ve=b.implementation.createHTMLDocument("").body).innerHTML="<form></form><form></form>",2===Ve.childNodes.length),S.parseHTML=function(t,e,n){return"string"!=typeof t?[]:("boolean"==typeof e&&(n=e,e=!1),e||(v.createHTMLDocument?((i=(e=b.implementation.createHTMLDocument("")).createElement("base")).href=b.location.href,e.head.appendChild(i)):e=b),o=!n&&[],(r=D.exec(t))?[e.createElement(r[1])]:(r=Ct([t],e,o),o&&o.length&&S(o).remove(),S.merge([],r.childNodes)));var i,r,o},S.fn.load=function(t,e,n){var i,r,o,s=this,a=t.indexOf(" ");return a>-1&&(i=ge(t.slice(a)),t=t.slice(0,a)),g(e)?(n=e,e=void 0):e&&"object"==typeof e&&(r="POST"),s.length>0&&S.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done((function(t){o=arguments,s.html(i?S("<div>").append(S.parseHTML(t)).find(i):t)})).always(n&&function(t,e){s.each((function(){n.apply(this,o||[t.responseText,e,t])}))}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,(function(e){return t===e.elem})).length},S.offset={setOffset:function(t,e,n){var i,r,o,s,a,u,l=S.css(t,"position"),c=S(t),d={};"static"===l&&(t.style.position="relative"),a=c.offset(),o=S.css(t,"top"),u=S.css(t,"left"),("absolute"===l||"fixed"===l)&&(o+u).indexOf("auto")>-1?(s=(i=c.position()).top,r=i.left):(s=parseFloat(o)||0,r=parseFloat(u)||0),g(e)&&(e=e.call(t,n,S.extend({},a))),null!=e.top&&(d.top=e.top-a.top+s),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):c.css(d)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each((function(e){S.offset.setOffset(this,t,e)}));var e,n,i=this[0];return i?i.getClientRects().length?(e=i.getBoundingClientRect(),n=i.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var t,e,n,i=this[0],r={top:0,left:0};if("fixed"===S.css(i,"position"))e=i.getBoundingClientRect();else{for(e=this.offset(),n=i.ownerDocument,t=i.offsetParent||n.documentElement;t&&(t===n.body||t===n.documentElement)&&"static"===S.css(t,"position");)t=t.parentNode;t&&t!==i&&1===t.nodeType&&((r=S(t).offset()).top+=S.css(t,"borderTopWidth",!0),r.left+=S.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-S.css(i,"marginTop",!0),left:e.left-r.left-S.css(i,"marginLeft",!0)}}},offsetParent:function(){return this.map((function(){for(var t=this.offsetParent;t&&"static"===S.css(t,"position");)t=t.offsetParent;return t||st}))}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},(function(t,e){var n="pageYOffset"===e;S.fn[t]=function(i){return W(this,(function(t,i,r){var o;if(y(t)?o=t:9===t.nodeType&&(o=t.defaultView),void 0===r)return o?o[e]:t[i];o?o.scrollTo(n?o.pageXOffset:r,n?r:o.pageYOffset):t[i]=r}),t,i,arguments.length)}})),S.each(["top","left"],(function(t,e){S.cssHooks[e]=Wt(v.pixelPosition,(function(t,n){if(n)return n=zt(t,e),Bt.test(n)?S(t).position()[e]+"px":n}))})),S.each({Height:"height",Width:"width"},(function(t,e){S.each({padding:"inner"+t,content:e,"":"outer"+t},(function(n,i){S.fn[i]=function(r,o){var s=arguments.length&&(n||"boolean"!=typeof r),a=n||(!0===r||!0===o?"margin":"border");return W(this,(function(e,n,r){var o;return y(e)?0===i.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(o=e.documentElement,Math.max(e.body["scroll"+t],o["scroll"+t],e.body["offset"+t],o["offset"+t],o["client"+t])):void 0===r?S.css(e,n,a):S.style(e,n,r,a)}),e,s?r:void 0,s)}}))})),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],(function(t,e){S.fn[e]=function(t){return this.on(e,t)}})),S.fn.extend({bind:function(t,e,n){return this.on(t,null,e,n)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,n,i){return this.on(e,t,n,i)},undelegate:function(t,e,n){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",n)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),(function(t,e){S.fn[e]=function(t,n){return arguments.length>0?this.on(e,null,t,n):this.trigger(e)}}));var Ke=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;S.proxy=function(t,e){var n,i,r;if("string"==typeof e&&(n=t[e],e=t,t=n),g(t))return i=a.call(arguments,2),r=function(){return t.apply(e||this,i.concat(a.call(arguments)))},r.guid=t.guid=t.guid||S.guid++,r},S.holdReady=function(t){t?S.readyWait++:S.ready(!0)},S.isArray=Array.isArray,S.parseJSON=JSON.parse,S.nodeName=_,S.isFunction=g,S.isWindow=y,S.camelCase=K,S.type=N,S.now=Date.now,S.isNumeric=function(t){var e=S.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},S.trim=function(t){return null==t?"":(t+"").replace(Ke,"")},void 0===(n=function(){return S}.apply(e,[]))||(t.exports=n);var Xe=i.jQuery,Je=i.$;return S.noConflict=function(t){return i.$===S&&(i.$=Je),t&&i.jQuery===S&&(i.jQuery=Xe),S},void 0===r&&(i.jQuery=i.$=S),S}))},92:(t,e,n)=>{"use strict";var i=n(640);t.exports=function(t,e,n){var r=[],o=!1,s=!1;function a(){if(o)throw new Error("Nested m.redraw.sync() call");o=!0;for(var e=0;e<r.length;e+=2)try{t(r[e],i(r[e+1]),u)}catch(t){n.error(t)}o=!1}function u(){s||(s=!0,e((function(){s=!1,a()})))}return u.sync=a,{mount:function(e,n){if(null!=n&&null==n.view&&"function"!=typeof n)throw new TypeError("m.mount(element, component) expects a component, not a vnode");var o=r.indexOf(e);o>=0&&(r.splice(o,2),t(e,[],u)),null!=n&&(r.push(e,n),t(e,i(n),u))},redraw:u}}},4:(t,e,n)=>{"use strict";var i=n(640),r=n(922),o=n(363),s=n(822),a=n(56),u=n(757),l=n(202),c={};t.exports=function(t,e){var n;function d(e,i,r){if(e=s(e,i),null!=n){n();var o=r?r.state:null,a=r?r.title:null;r&&r.replace?t.history.replaceState(o,a,y.prefix+e):t.history.pushState(o,a,y.prefix+e)}else t.location.href=y.prefix+e}var h,f,p,m,v=c,g=y.SKIP={};function y(r,s,b){if(null==r)throw new Error("Ensure the DOM element that was passed to `m.route` is not undefined");var w,x=0,N=Object.keys(b).map((function(t){if("/"!==t[0])throw new SyntaxError("Routes must start with a `/`");if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Route parameter names must be separated with either `/`, `.`, or `-`");return{route:t,component:b[t],check:u(t)}})),C="function"==typeof setImmediate?setImmediate:setTimeout,S=o.resolve(),T=!1;if(n=null,null!=s){var k=a(s);if(!N.some((function(t){return t.check(k)})))throw new ReferenceError("Default route doesn't match any known routes")}function A(){T=!1;var n=t.location.hash;"#"!==y.prefix[0]&&(n=t.location.search+n,"?"!==y.prefix[0]&&"/"!==(n=t.location.pathname+n)[0]&&(n="/"+n));var i=n.concat().replace(/(?:%[a-f89][a-f0-9])+/gim,decodeURIComponent).slice(y.prefix.length),r=a(i);function o(){if(i===s)throw new Error("Could not resolve default route "+s);d(s,null,{replace:!0})}l(r.params,t.history.state),function t(n){for(;n<N.length;n++)if(N[n].check(r)){var s=N[n].component,a=N[n].route,u=s,l=m=function(o){if(l===m){if(o===g)return t(n+1);h=null==o||"function"!=typeof o.view&&"function"!=typeof o?"div":o,f=r.params,p=i,m=null,v=s.render?s:null,2===x?e.redraw():(x=2,e.redraw.sync())}};return void(s.view||"function"==typeof s?(s={},l(u)):s.onmatch?S.then((function(){return s.onmatch(r.params,i,a)})).then(l,o):l("div"))}o()}(0)}return n=function(){T||(T=!0,C(A))},"function"==typeof t.history.pushState?(w=function(){t.removeEventListener("popstate",n,!1)},t.addEventListener("popstate",n,!1)):"#"===y.prefix[0]&&(n=null,w=function(){t.removeEventListener("hashchange",A,!1)},t.addEventListener("hashchange",A,!1)),e.mount(r,{onbeforeupdate:function(){return!(!(x=x?2:1)||c===v)},oncreate:A,onremove:w,view:function(){if(x&&c!==v){var t=[i(h,f.key,f)];return v&&(t=v.render(t[0])),t}}})}return y.set=function(t,e,n){null!=m&&((n=n||{}).replace=!0),m=null,d(t,e,n)},y.get=function(){return p},y.prefix="#!",y.Link={view:function(t){var e,n,i=t.attrs.options,o={};l(o,t.attrs),o.selector=o.options=o.key=o.oninit=o.oncreate=o.onbeforeupdate=o.onupdate=o.onbeforeremove=o.onremove=null;var s=r(t.attrs.selector||"a",o,t.children);return(s.attrs.disabled=Boolean(s.attrs.disabled))?(s.attrs.href=null,s.attrs["aria-disabled"]="true",s.attrs.onclick=null):(e=s.attrs.onclick,n=s.attrs.href,s.attrs.href=y.prefix+n,s.attrs.onclick=function(t){var r;"function"==typeof e?r=e.call(t.currentTarget,t):null==e||"object"!=typeof e||"function"==typeof e.handleEvent&&e.handleEvent(t),!1===r||t.defaultPrevented||0!==t.button&&0!==t.which&&1!==t.which||t.currentTarget.target&&"_self"!==t.currentTarget.target||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey||(t.preventDefault(),t.redraw=!1,y.set(n,null,i))}),s}},y.param=function(t){return f&&null!=t?f[t]:f},y}},479:(t,e,n)=>{"use strict";var i=n(922);i.trust=n(396),i.fragment=n(209),t.exports=i},872:(t,e,n)=>{"use strict";var i=n(479),r=n(105),o=n(49),s=function(){return i.apply(this,arguments)};s.m=i,s.trust=i.trust,s.fragment=i.fragment,s.mount=o.mount,s.route=n(438),s.render=n(534),s.redraw=o.redraw,s.request=r.request,s.jsonp=r.jsonp,s.parseQueryString=n(402),s.buildQueryString=n(266),s.parsePathname=n(56),s.buildPathname=n(822),s.vnode=n(640),s.PromisePolyfill=n(529),t.exports=s},49:(t,e,n)=>{"use strict";var i=n(534);t.exports=n(92)(i,requestAnimationFrame,console)},202:t=>{"use strict";t.exports=Object.assign||function(t,e){e&&Object.keys(e).forEach((function(n){t[n]=e[n]}))}},822:(t,e,n)=>{"use strict";var i=n(266),r=n(202);t.exports=function(t,e){if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Template parameter names *must* be separated");if(null==e)return t;var n=t.indexOf("?"),o=t.indexOf("#"),s=o<0?t.length:o,a=n<0?s:n,u=t.slice(0,a),l={};r(l,e);var c=u.replace(/:([^\/\.-]+)(\.{3})?/g,(function(t,n,i){return delete l[n],null==e[n]?t:i?e[n]:encodeURIComponent(String(e[n]))})),d=c.indexOf("?"),h=c.indexOf("#"),f=h<0?c.length:h,p=d<0?f:d,m=c.slice(0,p);n>=0&&(m+=t.slice(n,s)),d>=0&&(m+=(n<0?"?":"&")+c.slice(d,f));var v=i(l);return v&&(m+=(n<0&&d<0?"?":"&")+v),o>=0&&(m+=t.slice(o)),h>=0&&(m+=(o<0?"":"&")+c.slice(h)),m}},757:(t,e,n)=>{"use strict";var i=n(56);t.exports=function(t){var e=i(t),n=Object.keys(e.params),r=[],o=new RegExp("^"+e.path.replace(/:([^\/.-]+)(\.{3}|\.(?!\.)|-)?|[\\^$*+.()|\[\]{}]/g,(function(t,e,n){return null==e?"\\"+t:(r.push({k:e,r:"..."===n}),"..."===n?"(.*)":"."===n?"([^/]+)\\.":"([^/]+)"+(n||""))}))+"$");return function(t){for(var i=0;i<n.length;i++)if(e.params[n[i]]!==t.params[n[i]])return!1;if(!r.length)return o.test(t.path);var s=o.exec(t.path);if(null==s)return!1;for(i=0;i<r.length;i++)t.params[r[i].k]=r[i].r?s[i+1]:decodeURIComponent(s[i+1]);return!0}}},56:(t,e,n)=>{"use strict";var i=n(402);t.exports=function(t){var e=t.indexOf("?"),n=t.indexOf("#"),r=n<0?t.length:n,o=e<0?r:e,s=t.slice(0,o).replace(/\/{2,}/g,"/");return s?("/"!==s[0]&&(s="/"+s),s.length>1&&"/"===s[s.length-1]&&(s=s.slice(0,-1))):s="/",{path:s,params:e<0?{}:i(t.slice(e+1,r))}}},529:t=>{"use strict";var e=function t(e){if(!(this instanceof t))throw new Error("Promise must be called with `new`");if("function"!=typeof e)throw new TypeError("executor must be a function");var n=this,i=[],r=[],o=l(i,!0),s=l(r,!1),a=n._instance={resolvers:i,rejectors:r},u="function"==typeof setImmediate?setImmediate:setTimeout;function l(t,e){return function o(l){var d;try{if(!e||null==l||"object"!=typeof l&&"function"!=typeof l||"function"!=typeof(d=l.then))u((function(){e||0!==t.length||console.error("Possible unhandled promise rejection:",l);for(var n=0;n<t.length;n++)t[n](l);i.length=0,r.length=0,a.state=e,a.retry=function(){o(l)}}));else{if(l===n)throw new TypeError("Promise can't be resolved w/ itself");c(d.bind(l))}}catch(t){s(t)}}}function c(t){var e=0;function n(t){return function(n){e++>0||t(n)}}var i=n(s);try{t(n(o),i)}catch(t){i(t)}}c(e)};e.prototype.then=function(t,n){var i,r,o=this._instance;function s(t,e,n,s){e.push((function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(t){r&&r(t)}})),"function"==typeof o.retry&&s===o.state&&o.retry()}var a=new e((function(t,e){i=t,r=e}));return s(t,o.resolvers,i,!0),s(n,o.rejectors,r,!1),a},e.prototype.catch=function(t){return this.then(null,t)},e.prototype.finally=function(t){return this.then((function(n){return e.resolve(t()).then((function(){return n}))}),(function(n){return e.resolve(t()).then((function(){return e.reject(n)}))}))},e.resolve=function(t){return t instanceof e?t:new e((function(e){e(t)}))},e.reject=function(t){return new e((function(e,n){n(t)}))},e.all=function(t){return new e((function(e,n){var i=t.length,r=0,o=[];if(0===t.length)e([]);else for(var s=0;s<t.length;s++)!function(s){function a(t){r++,o[s]=t,r===i&&e(o)}null==t[s]||"object"!=typeof t[s]&&"function"!=typeof t[s]||"function"!=typeof t[s].then?a(t[s]):t[s].then(a,n)}(s)}))},e.race=function(t){return new e((function(e,n){for(var i=0;i<t.length;i++)t[i].then(e,n)}))},t.exports=e},363:(t,e,n)=>{"use strict";var i=n(529);"undefined"!=typeof window?(void 0===window.Promise?window.Promise=i:window.Promise.prototype.finally||(window.Promise.prototype.finally=i.prototype.finally),t.exports=window.Promise):void 0!==n.g?(void 0===n.g.Promise?n.g.Promise=i:n.g.Promise.prototype.finally||(n.g.Promise.prototype.finally=i.prototype.finally),t.exports=n.g.Promise):t.exports=i},266:t=>{"use strict";t.exports=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return"";var e=[];for(var n in t)i(n,t[n]);return e.join("&");function i(t,n){if(Array.isArray(n))for(var r=0;r<n.length;r++)i(t+"["+r+"]",n[r]);else if("[object Object]"===Object.prototype.toString.call(n))for(var r in n)i(t+"["+r+"]",n[r]);else e.push(encodeURIComponent(t)+(null!=n&&""!==n?"="+encodeURIComponent(n):""))}}},402:t=>{"use strict";t.exports=function(t){if(""===t||null==t)return{};"?"===t.charAt(0)&&(t=t.slice(1));for(var e=t.split("&"),n={},i={},r=0;r<e.length;r++){var o=e[r].split("="),s=decodeURIComponent(o[0]),a=2===o.length?decodeURIComponent(o[1]):"";"true"===a?a=!0:"false"===a&&(a=!1);var u=s.split(/\]\[?|\[/),l=i;s.indexOf("[")>-1&&u.pop();for(var c=0;c<u.length;c++){var d=u[c],h=u[c+1],f=""==h||!isNaN(parseInt(h,10));if(""===d)null==n[s=u.slice(0,c).join()]&&(n[s]=Array.isArray(l)?l.length:0),d=n[s]++;else if("__proto__"===d)break;if(c===u.length-1)l[d]=a;else{var p=Object.getOwnPropertyDescriptor(l,d);null!=p&&(p=p.value),null==p&&(l[d]=p=f?[]:{}),l=p}}}return i}},534:(t,e,n)=>{"use strict";t.exports=n(324)(window)},209:(t,e,n)=>{"use strict";var i=n(640),r=n(69);t.exports=function(){var t=r.apply(0,arguments);return t.tag="[",t.children=i.normalizeChildren(t.children),t}},922:(t,e,n)=>{"use strict";var i=n(640),r=n(69),o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},a={}.hasOwnProperty;function u(t){for(var e in t)if(a.call(t,e))return!1;return!0}function l(t){for(var e,n="div",i=[],r={};e=o.exec(t);){var a=e[1],u=e[2];if(""===a&&""!==u)n=u;else if("#"===a)r.id=u;else if("."===a)i.push(u);else if("["===e[3][0]){var l=e[6];l&&(l=l.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?i.push(l):r[e[4]]=""===l?l:l||!0}}return i.length>0&&(r.className=i.join(" ")),s[t]={tag:n,attrs:r}}function c(t,e){var n=e.attrs,r=i.normalizeChildren(e.children),o=a.call(n,"class"),s=o?n.class:n.className;if(e.tag=t.tag,e.attrs=null,e.children=void 0,!u(t.attrs)&&!u(n)){var l={};for(var c in n)a.call(n,c)&&(l[c]=n[c]);n=l}for(var c in t.attrs)a.call(t.attrs,c)&&"className"!==c&&!a.call(n,c)&&(n[c]=t.attrs[c]);for(var c in null==s&&null==t.attrs.className||(n.className=null!=s?null!=t.attrs.className?String(t.attrs.className)+" "+String(s):s:null!=t.attrs.className?t.attrs.className:null),o&&(n.class=null),n)if(a.call(n,c)&&"key"!==c){e.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?e.text=r[0].children:e.children=r,e}t.exports=function(t){if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");var e=r.apply(1,arguments);return"string"==typeof t&&(e.children=i.normalizeChildren(e.children),"["!==t)?c(s[t]||l(t),e):(e.tag=t,e)}},69:(t,e,n)=>{"use strict";var i=n(640);t.exports=function(){var t,e=arguments[this],n=this+1;if(null==e?e={}:("object"!=typeof e||null!=e.tag||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)t=arguments[n],Array.isArray(t)||(t=[t]);else for(t=[];n<arguments.length;)t.push(arguments[n++]);return i("",e.key,e,t)}},324:(t,e,n)=>{"use strict";var i=n(640);t.exports=function(t){var e,n=t&&t.document,r={svg:"http://www.w3.org/2000/svg",math:"http://www.w3.org/1998/Math/MathML"};function o(t){return t.attrs&&t.attrs.xmlns||r[t.tag]}function s(t,e){if(t.state!==e)throw new Error("`vnode.state` must not be modified")}function a(t){var e=t.state;try{return this.apply(e,arguments)}finally{s(t,e)}}function u(){try{return n.activeElement}catch(t){return null}}function l(t,e,n,i,r,o,s){for(var a=n;a<i;a++){var u=e[a];null!=u&&c(t,u,r,s,o)}}function c(t,e,r,s,u){var d=e.tag;if("string"==typeof d)switch(e.state={},null!=e.attrs&&L(e.attrs,e,r),d){case"#":!function(t,e,i){e.dom=n.createTextNode(e.children),w(t,e.dom,i)}(t,e,u);break;case"<":h(t,e,s,u);break;case"[":!function(t,e,i,r,o){var s=n.createDocumentFragment();if(null!=e.children){var a=e.children;l(s,a,0,a.length,i,null,r)}e.dom=s.firstChild,e.domSize=s.childNodes.length,w(t,s,o)}(t,e,r,s,u);break;default:!function(t,e,r,s,a){var u=e.tag,c=e.attrs,d=c&&c.is,h=(s=o(e)||s)?d?n.createElementNS(s,u,{is:d}):n.createElementNS(s,u):d?n.createElement(u,{is:d}):n.createElement(u);if(e.dom=h,null!=c&&function(t,e,n){for(var i in e)A(t,i,null,e[i],n)}(e,c,s),w(t,h,a),!x(e)&&(null!=e.text&&(""!==e.text?h.textContent=e.text:e.children=[i("#",void 0,void 0,e.text,void 0,void 0)]),null!=e.children)){var f=e.children;l(h,f,0,f.length,r,null,s),"select"===e.tag&&null!=c&&function(t,e){if("value"in e)if(null===e.value)-1!==t.dom.selectedIndex&&(t.dom.value=null);else{var n=""+e.value;t.dom.value===n&&-1!==t.dom.selectedIndex||(t.dom.value=n)}"selectedIndex"in e&&A(t,"selectedIndex",null,e.selectedIndex,void 0)}(e,c)}}(t,e,r,s,u)}else!function(t,e,n,r,o){(function(t,e){var n;if("function"==typeof t.tag.view){if(t.state=Object.create(t.tag),null!=(n=t.state.view).$$reentrantLock$$)return;n.$$reentrantLock$$=!0}else{if(t.state=void 0,null!=(n=t.tag).$$reentrantLock$$)return;n.$$reentrantLock$$=!0,t.state=null!=t.tag.prototype&&"function"==typeof t.tag.prototype.view?new t.tag(t):t.tag(t)}if(L(t.state,t,e),null!=t.attrs&&L(t.attrs,t,e),t.instance=i.normalize(a.call(t.state.view,t)),t.instance===t)throw Error("A view cannot return the vnode it received as argument");n.$$reentrantLock$$=null})(e,n),null!=e.instance?(c(t,e.instance,n,r,o),e.dom=e.instance.dom,e.domSize=null!=e.dom?e.instance.domSize:0):e.domSize=0}(t,e,r,s,u)}var d={caption:"table",thead:"table",tbody:"table",tfoot:"table",tr:"tbody",th:"tr",td:"tr",colgroup:"table",col:"colgroup"};function h(t,e,i,r){var o=e.children.match(/^\s*?<(\w+)/im)||[],s=n.createElement(d[o[1]]||"div");"http://www.w3.org/2000/svg"===i?(s.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e.children+"</svg>",s=s.firstChild):s.innerHTML=e.children,e.dom=s.firstChild,e.domSize=s.childNodes.length,e.instance=[];for(var a,u=n.createDocumentFragment();a=s.firstChild;)e.instance.push(a),u.appendChild(a);w(t,u,r)}function f(t,e,n,i,r,o){if(e!==n&&(null!=e||null!=n))if(null==e||0===e.length)l(t,n,0,n.length,i,r,o);else if(null==n||0===n.length)N(t,e,0,e.length);else{var s=null!=e[0]&&null!=e[0].key,a=null!=n[0]&&null!=n[0].key,u=0,d=0;if(!s)for(;d<e.length&&null==e[d];)d++;if(!a)for(;u<n.length&&null==n[u];)u++;if(null===a&&null==s)return;if(s!==a)N(t,e,d,e.length),l(t,n,u,n.length,i,r,o);else if(a){for(var h,f,b,w,x,S=e.length-1,T=n.length-1;S>=d&&T>=u&&(b=e[S],w=n[T],b.key===w.key);)b!==w&&p(t,b,w,i,r,o),null!=w.dom&&(r=w.dom),S--,T--;for(;S>=d&&T>=u&&(h=e[d],f=n[u],h.key===f.key);)d++,u++,h!==f&&p(t,h,f,i,g(e,d,r),o);for(;S>=d&&T>=u&&u!==T&&h.key===w.key&&b.key===f.key;)y(t,b,x=g(e,d,r)),b!==f&&p(t,b,f,i,x,o),++u<=--T&&y(t,h,r),h!==w&&p(t,h,w,i,r,o),null!=w.dom&&(r=w.dom),d++,b=e[--S],w=n[T],h=e[d],f=n[u];for(;S>=d&&T>=u&&b.key===w.key;)b!==w&&p(t,b,w,i,r,o),null!=w.dom&&(r=w.dom),T--,b=e[--S],w=n[T];if(u>T)N(t,e,d,S+1);else if(d>S)l(t,n,u,T+1,i,r,o);else{var k,A,E=r,P=T-u+1,_=new Array(P),D=0,$=0,I=2147483647,O=0;for($=0;$<P;$++)_[$]=-1;for($=T;$>=u;$--){null==k&&(k=m(e,d,S+1));var M=k[(w=n[$]).key];null!=M&&(I=M<I?M:-1,_[$-u]=M,b=e[M],e[M]=null,b!==w&&p(t,b,w,i,r,o),null!=w.dom&&(r=w.dom),O++)}if(r=E,O!==S-d+1&&N(t,e,d,S+1),0===O)l(t,n,u,T+1,i,r,o);else if(-1===I)for(A=function(t){var e=[0],n=0,i=0,r=0,o=v.length=t.length;for(r=0;r<o;r++)v[r]=t[r];for(r=0;r<o;++r)if(-1!==t[r]){var s=e[e.length-1];if(t[s]<t[r])v[r]=s,e.push(r);else{for(n=0,i=e.length-1;n<i;){var a=(n>>>1)+(i>>>1)+(n&i&1);t[e[a]]<t[r]?n=a+1:i=a}t[r]<t[e[n]]&&(n>0&&(v[r]=e[n-1]),e[n]=r)}}for(i=e[(n=e.length)-1];n-- >0;)e[n]=i,i=v[i];return v.length=0,e}(_),D=A.length-1,$=T;$>=u;$--)f=n[$],-1===_[$-u]?c(t,f,i,o,r):A[D]===$-u?D--:y(t,f,r),null!=f.dom&&(r=n[$].dom);else for($=T;$>=u;$--)f=n[$],-1===_[$-u]&&c(t,f,i,o,r),null!=f.dom&&(r=n[$].dom)}}else{var j=e.length<n.length?e.length:n.length;for(u=u<d?u:d;u<j;u++)(h=e[u])===(f=n[u])||null==h&&null==f||(null==h?c(t,f,i,o,g(e,u+1,r)):null==f?C(t,h):p(t,h,f,i,g(e,u+1,r),o));e.length>j&&N(t,e,u,e.length),n.length>j&&l(t,n,u,n.length,i,r,o)}}}function p(t,e,n,r,s,u){var l=e.tag;if(l===n.tag){if(n.state=e.state,n.events=e.events,function(t,e){do{var n;if(null!=t.attrs&&"function"==typeof t.attrs.onbeforeupdate&&void 0!==(n=a.call(t.attrs.onbeforeupdate,t,e))&&!n)break;if("string"!=typeof t.tag&&"function"==typeof t.state.onbeforeupdate&&void 0!==(n=a.call(t.state.onbeforeupdate,t,e))&&!n)break;return!1}while(0);return t.dom=e.dom,t.domSize=e.domSize,t.instance=e.instance,t.attrs=e.attrs,t.children=e.children,t.text=e.text,!0}(n,e))return;if("string"==typeof l)switch(null!=n.attrs&&R(n.attrs,n,r),l){case"#":!function(t,e){t.children.toString()!==e.children.toString()&&(t.dom.nodeValue=e.children),e.dom=t.dom}(e,n);break;case"<":!function(t,e,n,i,r){e.children!==n.children?(S(t,e),h(t,n,i,r)):(n.dom=e.dom,n.domSize=e.domSize,n.instance=e.instance)}(t,e,n,u,s);break;case"[":!function(t,e,n,i,r,o){f(t,e.children,n.children,i,r,o);var s=0,a=n.children;if(n.dom=null,null!=a){for(var u=0;u<a.length;u++){var l=a[u];null!=l&&null!=l.dom&&(null==n.dom&&(n.dom=l.dom),s+=l.domSize||1)}1!==s&&(n.domSize=s)}}(t,e,n,r,s,u);break;default:!function(t,e,n,r){var s=e.dom=t.dom;r=o(e)||r,"textarea"===e.tag&&(null==e.attrs&&(e.attrs={}),null!=e.text&&(e.attrs.value=e.text,e.text=void 0)),function(t,e,n,i){if(null!=n)for(var r in n)A(t,r,e&&e[r],n[r],i);var o;if(null!=e)for(var r in e)null==(o=e[r])||null!=n&&null!=n[r]||E(t,r,o,i)}(e,t.attrs,e.attrs,r),x(e)||(null!=t.text&&null!=e.text&&""!==e.text?t.text.toString()!==e.text.toString()&&(t.dom.firstChild.nodeValue=e.text):(null!=t.text&&(t.children=[i("#",void 0,void 0,t.text,void 0,t.dom.firstChild)]),null!=e.text&&(e.children=[i("#",void 0,void 0,e.text,void 0,void 0)]),f(s,t.children,e.children,n,null,r)))}(e,n,r,u)}else!function(t,e,n,r,o,s){if(n.instance=i.normalize(a.call(n.state.view,n)),n.instance===n)throw Error("A view cannot return the vnode it received as argument");R(n.state,n,r),null!=n.attrs&&R(n.attrs,n,r),null!=n.instance?(null==e.instance?c(t,n.instance,r,s,o):p(t,e.instance,n.instance,r,o,s),n.dom=n.instance.dom,n.domSize=n.instance.domSize):null!=e.instance?(C(t,e.instance),n.dom=void 0,n.domSize=0):(n.dom=e.dom,n.domSize=e.domSize)}(t,e,n,r,s,u)}else C(t,e),c(t,n,r,u,s)}function m(t,e,n){for(var i=Object.create(null);e<n;e++){var r=t[e];if(null!=r){var o=r.key;null!=o&&(i[o]=e)}}return i}var v=[];function g(t,e,n){for(;e<t.length;e++)if(null!=t[e]&&null!=t[e].dom)return t[e].dom;return n}function y(t,e,i){var r=n.createDocumentFragment();b(t,r,e),w(t,r,i)}function b(t,e,n){for(;null!=n.dom&&n.dom.parentNode===t;){if("string"!=typeof n.tag){if(null!=(n=n.instance))continue}else if("<"===n.tag)for(var i=0;i<n.instance.length;i++)e.appendChild(n.instance[i]);else if("["!==n.tag)e.appendChild(n.dom);else if(1===n.children.length){if(null!=(n=n.children[0]))continue}else for(i=0;i<n.children.length;i++){var r=n.children[i];null!=r&&b(t,e,r)}break}}function w(t,e,n){null!=n?t.insertBefore(e,n):t.appendChild(e)}function x(t){if(null==t.attrs||null==t.attrs.contenteditable&&null==t.attrs.contentEditable)return!1;var e=t.children;if(null!=e&&1===e.length&&"<"===e[0].tag){var n=e[0].children;t.dom.innerHTML!==n&&(t.dom.innerHTML=n)}else if(null!=t.text||null!=e&&0!==e.length)throw new Error("Child node of a contenteditable must be trusted");return!0}function N(t,e,n,i){for(var r=n;r<i;r++){var o=e[r];null!=o&&C(t,o)}}function C(t,e){var n,i,r,o=0,u=e.state;if("string"!=typeof e.tag&&"function"==typeof e.state.onbeforeremove&&null!=(r=a.call(e.state.onbeforeremove,e))&&"function"==typeof r.then&&(o=1,n=r),e.attrs&&"function"==typeof e.attrs.onbeforeremove&&null!=(r=a.call(e.attrs.onbeforeremove,e))&&"function"==typeof r.then&&(o|=2,i=r),s(e,u),o){if(null!=n){var l=function(){1&o&&((o&=2)||c())};n.then(l,l)}null!=i&&(l=function(){2&o&&((o&=1)||c())},i.then(l,l))}else k(e),T(t,e);function c(){s(e,u),k(e),T(t,e)}}function S(t,e){for(var n=0;n<e.instance.length;n++)t.removeChild(e.instance[n])}function T(t,e){for(;null!=e.dom&&e.dom.parentNode===t;){if("string"!=typeof e.tag){if(null!=(e=e.instance))continue}else if("<"===e.tag)S(t,e);else{if("["!==e.tag&&(t.removeChild(e.dom),!Array.isArray(e.children)))break;if(1===e.children.length){if(null!=(e=e.children[0]))continue}else for(var n=0;n<e.children.length;n++){var i=e.children[n];null!=i&&T(t,i)}}break}}function k(t){if("string"!=typeof t.tag&&"function"==typeof t.state.onremove&&a.call(t.state.onremove,t),t.attrs&&"function"==typeof t.attrs.onremove&&a.call(t.attrs.onremove,t),"string"!=typeof t.tag)null!=t.instance&&k(t.instance);else{var e=t.children;if(Array.isArray(e))for(var n=0;n<e.length;n++){var i=e[n];null!=i&&k(i)}}}function A(t,e,i,r,o){if("key"!==e&&"is"!==e&&null!=r&&!P(e)&&(i!==r||function(t,e){return"value"===e||"checked"===e||"selectedIndex"===e||"selected"===e&&t.dom===u()||"option"===t.tag&&t.dom.parentNode===n.activeElement}(t,e)||"object"==typeof r)){if("o"===e[0]&&"n"===e[1])return j(t,e,r);if("xlink:"===e.slice(0,6))t.dom.setAttributeNS("http://www.w3.org/1999/xlink",e.slice(6),r);else if("style"===e)O(t.dom,i,r);else if(_(t,e,o)){if("value"===e){if(("input"===t.tag||"textarea"===t.tag)&&t.dom.value===""+r&&t.dom===u())return;if("select"===t.tag&&null!==i&&t.dom.value===""+r)return;if("option"===t.tag&&null!==i&&t.dom.value===""+r)return}"input"===t.tag&&"type"===e?t.dom.setAttribute(e,r):t.dom[e]=r}else"boolean"==typeof r?r?t.dom.setAttribute(e,""):t.dom.removeAttribute(e):t.dom.setAttribute("className"===e?"class":e,r)}}function E(t,e,n,i){if("key"!==e&&"is"!==e&&null!=n&&!P(e))if("o"!==e[0]||"n"!==e[1]||P(e))if("style"===e)O(t.dom,n,null);else if(!_(t,e,i)||"className"===e||"value"===e&&("option"===t.tag||"select"===t.tag&&-1===t.dom.selectedIndex&&t.dom===u())||"input"===t.tag&&"type"===e){var r=e.indexOf(":");-1!==r&&(e=e.slice(r+1)),!1!==n&&t.dom.removeAttribute("className"===e?"class":e)}else t.dom[e]=null;else j(t,e,void 0)}function P(t){return"oninit"===t||"oncreate"===t||"onupdate"===t||"onremove"===t||"onbeforeremove"===t||"onbeforeupdate"===t}function _(t,e,n){return void 0===n&&(t.tag.indexOf("-")>-1||null!=t.attrs&&t.attrs.is||"href"!==e&&"list"!==e&&"form"!==e&&"width"!==e&&"height"!==e)&&e in t.dom}var D=/[A-Z]/g;function $(t){return"-"+t.toLowerCase()}function I(t){return"-"===t[0]&&"-"===t[1]?t:"cssFloat"===t?"float":t.replace(D,$)}function O(t,e,n){if(e===n);else if(null==n)t.style.cssText="";else if("object"!=typeof n)t.style.cssText=n;else if(null==e||"object"!=typeof e)for(var i in t.style.cssText="",n)null!=(r=n[i])&&t.style.setProperty(I(i),String(r));else{for(var i in n){var r;null!=(r=n[i])&&(r=String(r))!==String(e[i])&&t.style.setProperty(I(i),r)}for(var i in e)null!=e[i]&&null==n[i]&&t.style.removeProperty(I(i))}}function M(){this._=e}function j(t,e,n){if(null!=t.events){if(t.events[e]===n)return;null==n||"function"!=typeof n&&"object"!=typeof n?(null!=t.events[e]&&t.dom.removeEventListener(e.slice(2),t.events,!1),t.events[e]=void 0):(null==t.events[e]&&t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n)}else null==n||"function"!=typeof n&&"object"!=typeof n||(t.events=new M,t.dom.addEventListener(e.slice(2),t.events,!1),t.events[e]=n)}function L(t,e,n){"function"==typeof t.oninit&&a.call(t.oninit,e),"function"==typeof t.oncreate&&n.push(a.bind(t.oncreate,e))}function R(t,e,n){"function"==typeof t.onupdate&&n.push(a.bind(t.onupdate,e))}return M.prototype=Object.create(null),M.prototype.handleEvent=function(t){var e,n=this["on"+t.type];"function"==typeof n?e=n.call(t.currentTarget,t):"function"==typeof n.handleEvent&&n.handleEvent(t),this._&&!1!==t.redraw&&(0,this._)(),!1===e&&(t.preventDefault(),t.stopPropagation())},function(t,n,r){if(!t)throw new TypeError("Ensure the DOM element being passed to m.route/m.mount/m.render is not undefined.");var o=[],s=u(),a=t.namespaceURI;null==t.vnodes&&(t.textContent=""),n=i.normalizeChildren(Array.isArray(n)?n:[n]);var l=e;try{e="function"==typeof r?r:void 0,f(t,t.vnodes,n,o,null,"http://www.w3.org/1999/xhtml"===a?void 0:a)}finally{e=l}t.vnodes=n,null!=s&&u()!==s&&"function"==typeof s.focus&&s.focus();for(var c=0;c<o.length;c++)o[c]()}}},396:(t,e,n)=>{"use strict";var i=n(640);t.exports=function(t){return null==t&&(t=""),i("<",void 0,void 0,t,void 0,void 0)}},640:t=>{"use strict";function e(t,e,n,i,r,o){return{tag:t,key:e,attrs:n,children:i,text:r,dom:o,domSize:void 0,state:void 0,events:void 0,instance:void 0}}e.normalize=function(t){return Array.isArray(t)?e("[",void 0,void 0,e.normalizeChildren(t),void 0,void 0):null==t||"boolean"==typeof t?null:"object"==typeof t?t:e("#",void 0,void 0,String(t),void 0,void 0)},e.normalizeChildren=function(t){var n=[];if(t.length){for(var i=null!=t[0]&&null!=t[0].key,r=1;r<t.length;r++)if((null!=t[r]&&null!=t[r].key)!==i)throw new TypeError("Vnodes must either always have keys or never have keys!");for(r=0;r<t.length;r++)n[r]=e.normalize(t[r])}return n},t.exports=e},105:(t,e,n)=>{"use strict";var i=n(363),r=n(49);t.exports=n(858)(window,i,r.redraw)},858:(t,e,n)=>{"use strict";var i=n(822);t.exports=function(t,e,n){var r=0;function o(t){return new e(t)}function s(t){return function(r,s){"string"!=typeof r?(s=r,r=r.url):null==s&&(s={});var a=new e((function(e,n){t(i(r,s.params),s,(function(t){if("function"==typeof s.type)if(Array.isArray(t))for(var n=0;n<t.length;n++)t[n]=new s.type(t[n]);else t=new s.type(t);e(t)}),n)}));if(!0===s.background)return a;var u=0;function l(){0==--u&&"function"==typeof n&&n()}return function t(e){var n=e.then;return e.constructor=o,e.then=function(){u++;var i=n.apply(e,arguments);return i.then(l,(function(t){if(l(),0===u)throw t})),t(i)},e}(a)}}function a(t,e){for(var n in t.headers)if({}.hasOwnProperty.call(t.headers,n)&&e.test(n))return!0;return!1}return o.prototype=e.prototype,o.__proto__=e,{request:s((function(e,n,i,r){var o,s=null!=n.method?n.method.toUpperCase():"GET",u=n.body,l=!(null!=n.serialize&&n.serialize!==JSON.serialize||u instanceof t.FormData),c=n.responseType||("function"==typeof n.extract?"":"json"),d=new t.XMLHttpRequest,h=!1,f=d,p=d.abort;for(var m in d.abort=function(){h=!0,p.call(this)},d.open(s,e,!1!==n.async,"string"==typeof n.user?n.user:void 0,"string"==typeof n.password?n.password:void 0),l&&null!=u&&!a(n,/^content-type$/i)&&d.setRequestHeader("Content-Type","application/json; charset=utf-8"),"function"==typeof n.deserialize||a(n,/^accept$/i)||d.setRequestHeader("Accept","application/json, text/*"),n.withCredentials&&(d.withCredentials=n.withCredentials),n.timeout&&(d.timeout=n.timeout),d.responseType=c,n.headers)({}).hasOwnProperty.call(n.headers,m)&&d.setRequestHeader(m,n.headers[m]);d.onreadystatechange=function(t){if(!h&&4===t.target.readyState)try{var o,s=t.target.status>=200&&t.target.status<300||304===t.target.status||/^file:\/\//i.test(e),a=t.target.response;if("json"===c?t.target.responseType||"function"==typeof n.extract||(a=JSON.parse(t.target.responseText)):c&&"text"!==c||null==a&&(a=t.target.responseText),"function"==typeof n.extract?(a=n.extract(t.target,n),s=!0):"function"==typeof n.deserialize&&(a=n.deserialize(a)),s)i(a);else{try{o=t.target.responseText}catch(t){o=a}var u=new Error(o);u.code=t.target.status,u.response=a,r(u)}}catch(t){r(t)}},"function"==typeof n.config&&(d=n.config(d,n,e)||d)!==f&&(o=d.abort,d.abort=function(){h=!0,o.call(this)}),null==u?d.send():"function"==typeof n.serialize?d.send(n.serialize(u)):u instanceof t.FormData?d.send(u):d.send(JSON.stringify(u))})),jsonp:s((function(e,n,i,o){var s=n.callbackName||"_mithril_"+Math.round(1e16*Math.random())+"_"+r++,a=t.document.createElement("script");t[s]=function(e){delete t[s],a.parentNode.removeChild(a),i(e)},a.onerror=function(){delete t[s],a.parentNode.removeChild(a),o(new Error("JSONP request failed"))},a.src=e+(e.indexOf("?")<0?"?":"&")+encodeURIComponent(n.callbackKey||"callback")+"="+encodeURIComponent(s),t.document.documentElement.appendChild(a)}))}}},438:(t,e,n)=>{"use strict";var i=n(49);t.exports=n(4)(window,i)},362:(t,e,n)=>{"use strict";t.exports=n(131)},131:t=>{!function(){"use strict";n.SKIP={},n.lift=function(){var t=arguments[0],e=Array.prototype.slice.call(arguments,1);return r(e).map((function(e){return t.apply(void 0,e)}))},n.scan=function(t,e,i){var r=i.map((function(i){var r=t(e,i);return r!==n.SKIP&&(e=r),r}));return r(e),r},n.merge=r,n.combine=i,n.scanMerge=function(t,e){var n=t.map((function(t){return t[0]})),r=i((function(){var i=arguments[arguments.length-1];return n.forEach((function(n,r){i.indexOf(n)>-1&&(e=t[r][1](e,n()))})),e}),n);return r(e),r},n["fantasy-land/of"]=n;var e=!1;function n(t){var e,r=[],s=[];function a(e){return arguments.length&&e!==n.SKIP&&(t=e,o(a)&&(a._changing(),a._state="active",r.forEach((function(e,n){e(s[n](t))})))),t}function u(){return(e=n()).map((function(t){return!0===t&&(a._parents.forEach((function(t){t._unregisterChild(a)})),a._state="ended",a._parents.length=r.length=s.length=0),t})),e}return a.constructor=n,a._state=arguments.length&&t!==n.SKIP?"active":"pending",a._parents=[],a._changing=function(){o(a)&&(a._state="changing"),r.forEach((function(t){t._changing()}))},a._map=function(e,i){var o=i?n():n(e(t));return o._parents.push(a),r.push(o),s.push(e),o},a.map=function(t){return a._map(t,"active"!==a._state)},a.toJSON=function(){return null!=t&&"function"==typeof t.toJSON?t.toJSON():t},a["fantasy-land/map"]=a.map,a["fantasy-land/ap"]=function(t){return i((function(t,e){return t()(e())}),[t,a])},a._unregisterChild=function(t){var e=r.indexOf(t);-1!==e&&(r.splice(e,1),s.splice(e,1))},Object.defineProperty(a,"end",{get:function(){return e||u()}}),a}function i(t,e){var i=e.every((function(t){if(t.constructor!==n)throw new Error("Ensure that each item passed to stream.combine/stream.merge/lift is a stream");return"active"===t._state})),r=i?n(t.apply(null,e.concat([e]))):n(),o=[],s=e.map((function(n){return n._map((function(s){return o.push(n),(i||e.every((function(t){return"pending"!==t._state})))&&(i=!0,r(t.apply(null,e.concat([o]))),o=[]),s}),!0)})),a=r.end.map((function(t){!0===t&&(s.forEach((function(t){t.end(!0)})),a.end(!0))}));return r}function r(t){return i((function(){return t.map((function(t){return t()}))}),t)}function o(t){return"pending"===t._state||"active"===t._state||"changing"===t._state}Object.defineProperty(n,"HALT",{get:function(){return e||console.log("HALT is deprecated and has been renamed to SKIP"),e=!0,n.SKIP}}),t.exports=n}()},231:(t,e,n)=>{"use strict";function i(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}n.r(e),n.d(e,{ucs2decode:()=>m,ucs2encode:()=>v,decode:()=>b,encode:()=>w,toASCII:()=>N,toUnicode:()=>x,default:()=>C});var o=2147483647,s=36,a=/^xn--/,u=/[^\0-\x7E]/,l=/[\x2E\u3002\uFF0E\uFF61]/g,c={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},d=Math.floor,h=String.fromCharCode;function f(t){throw new RangeError(c[t])}function p(t,e){var n=t.split("@"),i="";n.length>1&&(i=n[0]+"@",t=n[1]);var r=function(t,e){for(var n=[],i=t.length;i--;)n[i]=e(t[i]);return n}((t=t.replace(l,".")).split("."),e).join(".");return i+r}function m(t){for(var e=[],n=0,i=t.length;n<i;){var r=t.charCodeAt(n++);if(r>=55296&&r<=56319&&n<i){var o=t.charCodeAt(n++);56320==(64512&o)?e.push(((1023&r)<<10)+(1023&o)+65536):(e.push(r),n--)}else e.push(r)}return e}var v=function(t){return String.fromCodePoint.apply(String,t)},g=function(t,e){return t+22+75*(t<26)-((0!=e)<<5)},y=function(t,e,n){var i=0;for(t=n?d(t/700):t>>1,t+=d(t/e);t>455;i+=s)t=d(t/35);return d(i+36*t/(t+38))},b=function(t){var e,n=[],i=t.length,r=0,a=128,u=72,l=t.lastIndexOf("-");l<0&&(l=0);for(var c=0;c<l;++c)t.charCodeAt(c)>=128&&f("not-basic"),n.push(t.charCodeAt(c));for(var h=l>0?l+1:0;h<i;){for(var p=r,m=1,v=s;;v+=s){h>=i&&f("invalid-input");var g=(e=t.charCodeAt(h++))-48<10?e-22:e-65<26?e-65:e-97<26?e-97:s;(g>=s||g>d((o-r)/m))&&f("overflow"),r+=g*m;var b=v<=u?1:v>=u+26?26:v-u;if(g<b)break;var w=s-b;m>d(o/w)&&f("overflow"),m*=w}var x=n.length+1;u=y(r-p,x,0==p),d(r/x)>o-a&&f("overflow"),a+=d(r/x),r%=x,n.splice(r++,0,a)}return String.fromCodePoint.apply(String,n)},w=function(t){for(var e,n=[],r=(t=m(t)).length,a=128,u=0,l=72,c=i(t);!(e=c()).done;){var p=e.value;p<128&&n.push(h(p))}var v=n.length,b=v;for(v&&n.push("-");b<r;){for(var w,x=o,N=i(t);!(w=N()).done;){var C=w.value;C>=a&&C<x&&(x=C)}var S=b+1;x-a>d((o-u)/S)&&f("overflow"),u+=(x-a)*S,a=x;for(var T,k=i(t);!(T=k()).done;){var A=T.value;if(A<a&&++u>o&&f("overflow"),A==a){for(var E=u,P=s;;P+=s){var _=P<=l?1:P>=l+26?26:P-l;if(E<_)break;var D=E-_,$=s-_;n.push(h(g(_+D%$,0))),E=d(D/$)}n.push(h(g(E,0))),l=y(u,S,b==v),u=0,++b}}++u,++a}return n.join("")},x=function(t){return p(t,(function(t){return a.test(t)?b(t.slice(4).toLowerCase()):t}))},N=function(t){return p(t,(function(t){return u.test(t)?"xn--"+w(t):t}))};const C={version:"2.1.0",ucs2:{decode:m,encode:v},decode:b,encode:w,toASCII:N,toUnicode:x}},887:t=>{!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,i=n&&null!=window.mozInnerScreenX;function r(t,r,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=o&&o.debug||!1;if(s){var a=document.querySelector("#input-textarea-caret-position-mirror-div");a&&a.parentNode.removeChild(a)}var u=document.createElement("div");u.id="input-textarea-caret-position-mirror-div",document.body.appendChild(u);var l=u.style,c=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,d="INPUT"===t.nodeName;l.whiteSpace="pre-wrap",d||(l.wordWrap="break-word"),l.position="absolute",s||(l.visibility="hidden"),e.forEach((function(t){d&&"lineHeight"===t?l.lineHeight=c.height:l[t]=c[t]})),i?t.scrollHeight>parseInt(c.height)&&(l.overflowY="scroll"):l.overflow="hidden",u.textContent=t.value.substring(0,r),d&&(u.textContent=u.textContent.replace(/\s/g," "));var h=document.createElement("span");h.textContent=t.value.substring(r)||".",u.appendChild(h);var f={top:h.offsetTop+parseInt(c.borderTopWidth),left:h.offsetLeft+parseInt(c.borderLeftWidth),height:parseInt(c.lineHeight)};return s?h.style.backgroundColor="#aaa":document.body.removeChild(u),f}void 0!==t.exports?t.exports=r:n&&(window.getCaretCoordinates=r)}()},420:()=>{Array.prototype.flat||(Array.prototype.flat=function t(e){return void 0===e&&(e=1),e>0?Array.prototype.reduce.call(this,(function(n,i){return n.concat(Array.isArray(i)?t.call(i,e-1):i)}),[]):[].concat(this)})},183:(t,e,n)=>{var i=n(663),r=n(648);void 0===r.$&&(r.$=i),void 0===r.jQuery&&(r.jQuery=i),t.exports=i},449:(t,e,n)=>{var i=n(28),r=n(648);void 0===r.ColorThief&&(r.ColorThief=i),t.exports=i},471:(t,e,n)=>{var i=n(555),r=n(648);void 0===r.dayjs&&(r.dayjs=i),t.exports=i},928:(t,e,n)=>{var i=n(872),r=n(648);void 0===r.m&&(r.m=i),t.exports=i},296:(t,e,n)=>{var i=n(231),r=n(648);void 0===r.punycode&&(r.punycode=i),t.exports=i}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var o=e[i]={exports:{}};return t[i].call(o.exports,o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var i in e)n.o(e,i)&&!n.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:e[i]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var i={};(()=>{"use strict";n.r(i),n.d(i,{Extend:()=>t,app:()=>y,compat:()=>Fi});var t={};n.r(t),n.d(t,{Model:()=>f,PostTypes:()=>p,Routes:()=>v});var e={};n.r(e),n.d(e,{getPlainContent:()=>G,slug:()=>Y,truncate:()=>V,ucfirst:()=>K});var r={};n.r(r),n.d(r,{extend:()=>si,override:()=>ai});var o={};n.r(o),n.d(o,{debounce:()=>Zt,throttle:()=>Qt}),n(183),n(928),n(471),n(423),n(298),n(892),n(478),n(646),n(426);var s=n(23),a=n.n(s),u=n(428),l=n.n(u);function c(t,e){var n="select"===t.tag?t.attrs.multi?"multi":"select":t.attrs.type;return t.attrs.onchange="multi"===n?function(){e([].slice.call(this.selectedOptions,(function(t){return t.value})))}:"select"===n?function(t){e(this.selectedOptions[0].value)}:"checkbox"===n?function(t){e(this.checked)}:t.attrs.oninput=function(t){e(this.value)},"select"===t.tag?t.children.forEach((function(t){t.attrs.value!==e()&&t.children[0]!==e()||(t.attrs.selected=!0)})):"checkbox"===n?t.attrs.checked=e():"radio"===n?t.attrs.checked=e()===t.attrs.value:t.attrs.value=e(),t.attrs.bidi=null,t}c.view=function(t,e,n){return c(e,e.attrs.bidi)};const d=c;function h(t){var e=t.m,n=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];var o=e.apply(this,arguments);return o.attrs||(o.attrs={}),o.attrs.bidi&&d(o,o.attrs.bidi),o};Object.keys(e).forEach((function(t){return n[t]=e[t]})),t.m=n}var f=function(){function t(t,e){void 0===e&&(e=null),this.type=void 0,this.attributes=[],this.hasOnes=[],this.hasManys=[],this.type=t,this.model=e}var e=t.prototype;return e.attribute=function(t){return this.attributes.push(t),this},e.hasOne=function(t){return this.hasOnes.push(t),this},e.hasMany=function(t){return this.hasManys.push(t),this},e.extend=function(t,e){this.model&&(t.store.models[this.type]=this.model);var n=t.store.models[this.type];this.attributes.forEach((function(t){return n.prototype[t]=n.attribute(t)})),this.hasOnes.forEach((function(t){return n.prototype[t]=n.hasOne(t)})),this.hasManys.forEach((function(t){return n.prototype[t]=n.hasMany(t)}))},t}(),p=function(){function t(){this.postComponents={}}var e=t.prototype;return e.add=function(t,e){return this.postComponents[t]=e,this},e.extend=function(t,e){Object.assign(t.postComponents,this.postComponents)},t}(),v=function(){function t(){this.routes={}}var e=t.prototype;return e.add=function(t,e,n){return this.routes[t]={path:e,component:n},this},e.extend=function(t,e){Object.assign(t.routes,this.routes)},t}(),g=window;const y=new Proxy({},{get:function(t,e){return Reflect.get(g.app,e,g.app)},set:function(t,e,n){return Reflect.set(g.app,e,n,g.app)}});n(420),dayjs.extend(a()),dayjs.extend(l()),h(window);var b=$.fn.tooltip;function w(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t,e){return x=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},x(t,e)}function N(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,x(t,e)}function C(){return C=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},C.apply(this,arguments)}function S(t,e,n){void 0===e&&(e=null),void 0===n&&(n={});var i=C({},n);i.state=i.state||{},i.state.key=Date.now(),m.route.set(t,e,i)}$.fn.tooltip=function(t,e){["DANGEROUS_tooltip_jquery_fn_deprecation_exempt"].includes(e)||console.warn("Calling `$.tooltip` is now deprecated. Please use the `<Tooltip>` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"),b.bind(this)(t)},n(296),n(449);var T=function(){function t(t){this.stack=[]}var e=t.prototype;return e.getCurrent=function(){return this.stack[this.stack.length-1]},e.getPrevious=function(){return this.stack[this.stack.length-2]},e.push=function(t,e,n){void 0===n&&(n=m.route.get());var i=this.stack[this.stack.length-2];i&&i.name===t&&this.stack.pop();var r=this.getCurrent();r&&r.name===t?Object.assign(r,{url:n,title:e}):this.stack.push({name:t,url:n,title:e})},e.canGoBack=function(){return this.stack.length>1},e.back=function(){if(!this.canGoBack())return this.home();this.stack.pop(),m.route.set(this.getCurrent().url)},e.backUrl=function(){return this.stack[this.stack.length-2].url},e.home=function(){this.stack.splice(0),S("/")},t}(),k=function(){function t(t){this.pinnedKey="panePinned",this.$element=$(t),this.pinned="true"===localStorage.getItem(this.pinnedKey),this.active=!1,this.showing=!1,this.render()}var e=t.prototype;return e.enable=function(){this.active=!0,this.render()},e.disable=function(){this.active=!1,this.showing=!1,this.render()},e.show=function(){clearTimeout(this.hideTimeout),this.showing=!0,this.render()},e.hide=function(){this.showing=!1,this.render()},e.onmouseleave=function(){this.hideTimeout=setTimeout(this.hide.bind(this),250)},e.togglePinned=function(){this.pinned=!this.pinned,localStorage.setItem(this.pinnedKey,this.pinned?"true":"false"),this.render()},e.render=function(){this.$element.toggleClass("panePinned",this.pinned).toggleClass("hasPane",this.active).toggleClass("paneShowing",this.showing)},t}(),A=function(){function t(){this.element=void 0,this.attrs=void 0,this.state=void 0}var e=t.prototype;return e.oninit=function(t){this.setAttrs(t.attrs)},e.oncreate=function(t){this.element=t.dom},e.onbeforeupdate=function(t){this.setAttrs(t.attrs)},e.onupdate=function(t){},e.onbeforeremove=function(t){},e.onremove=function(t){},e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),t.component=function(t,e){void 0===t&&(t={}),void 0===e&&(e=null);var n=C({},t);return m(this,n,e)},e.setAttrs=function(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},t.initAttrs=function(t){},t}();function E(t,e){return t&&(t===e||t.prototype instanceof e)}var P=function(){function t(t,e){void 0===e&&(e={}),this.type=t,this.data=e}var e=t.prototype;return e.matches=function(t,e){var n=this;return void 0===e&&(e={}),!!E(this.type,t)&&Object.keys(e).every((function(t){return n.data[t]===e[t]}))},e.get=function(t){return this.data[t]},e.set=function(t,e){this.data[t]=e},t}(),_=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),y.previous=y.current,y.current=new P(this.constructor,{routeName:this.attrs.routeName}),y.drawer.hide(),y.modal.close(),this.bodyClass="",this.scrollTopOnCreate=!0,this.useBrowserScrollRestoration=!0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")},n.onremove=function(e){t.prototype.onremove.call(this,e),this.bodyClass&&$("#app").removeClass(this.bodyClass)},e}(A),D=function(t,e){this.content=void 0,this.priority=void 0,this.key=void 0,this.content=t,this.priority=e},I=function(){function t(){this.items={}}var e=t.prototype;return e.isEmpty=function(){for(var t in this.items)if(this.items.hasOwnProperty(t))return!1;return!0},e.has=function(t){return!!this.items[t]},e.get=function(t){return this.items[t].content},e.add=function(t,e,n){return void 0===n&&(n=0),this.items[t]=new D(e,n),this},e.replace=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this.items[t]&&(null!==e&&(this.items[t].content=e),null!==n&&(this.items[t].priority=n)),this},e.remove=function(t){return delete this.items[t],this},e.merge=function(t){for(var e in t.items)t.items.hasOwnProperty(e)&&t.items[e]instanceof D&&(this.items[e]=t.items[e]);return this},e.toArray=function(){var t=[];for(var e in this.items)this.items.hasOwnProperty(e)&&this.items[e]instanceof D&&(this.items[e].content=Object(this.items[e].content),this.items[e].content.itemName=e,t.push(this.items[e]),this.items[e].key=t.length);return t.sort((function(t,e){return t.priority===e.priority?t.key-e.key:t.priority>e.priority?-1:1})).map((function(t){return t.content}))},t}(),O=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){return m("li",{className:"Dropdown-separator"})},e}(A);O.isListItem=!0;const M=O;function j(t){var e,n,i="";if("string"==typeof t||"number"==typeof t)i+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=j(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}const L=function(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=j(t))&&(i&&(i+=" "),i+=e);return i};function R(t){return t.tag===M}function H(t){return t instanceof Array||(t=[t]),function(t){var e,n=[];return t.filter(Boolean).forEach((function(i,r){(!R(i)||e&&!R(e)&&r!==t.length-1)&&(e=i,n.push(i))})),n}(t).map((function(t){var e=t.tag&&t.tag.isListItem,n=t.tag&&t.tag.isActive&&t.tag.isActive(t.attrs),i=t.attrs&&t.attrs.itemClassName||t.itemClassName;return e&&(t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key),e?t:m("li",{className:L([i,t.itemName&&"item-"+t.itemName,n&&"active"]),key:t.attrs&&t.attrs.key||t.itemName},t)}))}var B=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){return m("header",{className:"Hero DiscussionHero"},m("div",{className:"container"},m("ul",{className:"DiscussionHero-items"},H(this.items().toArray()))))},n.items=function(){var t=new I,e=this.attrs.discussion,n=e.badges().toArray();return n.length&&t.add("badges",m("ul",{className:"DiscussionHero-badges badges"},H(n)),10),t.add("title",m("h2",{className:"DiscussionHero-title"},e.title())),t},e}(A);function F(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||(r[n]=t[n]);return r}function U(t,e){var n=t[e];return delete t[e],n}var q=["options"],z=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(t){var e=t.attrs,n=e.options,i=void 0===n?{}:n,r=F(e,q);r.href=r.href||"";var o=t.children||{tag:"#",children:t.text};return r.external?m("a",r,o):(r.href===m.route.get()&&("replace"in i||(i.replace=!0)),U(r,"force")&&("state"in i||(i.state={}),"key"in i.state||(i.state.key=Date.now())),r.options=i,m(m.route.Link,r,o))},e}(A);function W(t,e){void 0===e&&(e={}),e.className="Avatar "+(e.className||"");var n="",i="undefined"===e.title||e.title;if(i||delete e.title,t){var r=t.displayName()||"?",o=t.avatarUrl();if(i&&(e.title=e.title||r),o)return m("img",Object.assign({},e,{src:o,alt:""}));n=r.charAt(0).toUpperCase(),e.style={"--avatar-bg":t.color()}}return m("span",e,n)}function V(t,e,n){return void 0===n&&(n=0),(n>0?"...":"")+t.substring(n,n+e)+(t.length>n+e?"...":"")}function Y(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")}function G(t){var e=t.replace(/(<\/p>|<br>)/g,"$1 ").replace(/<img\b[^>]*>/gi," "),n=$("<div/>").html(e);return n.find(G.removeSelectors.join(",")).remove(),n.text().replace(/\s+/g," ").trim()}function K(t){return t.substr(0,1).toUpperCase()+t.substr(1)}function X(t,e,n){if(!e&&!n)return t;var i=e instanceof RegExp?e:new RegExp(e,"gi"),r=t,o=0;return n&&(e&&(o=Math.max(0,t.search(i)-n/2)),r=V(r,n,o)),r=$("<div/>").text(r).html(),e&&(r=r.replace(i,"<mark>$&</mark>")),m.trust(r)}function J(t,e){return void 0===e&&(e={}),e.className="icon "+t+" "+(e.className||""),m("i",Object.assign({"aria-hidden":"true"},e))}G.removeSelectors=["blockquote","script"];var Q=n(555),Z=n.n(Q);function tt(t){var e=Z()(t),n=Z()();return e.isAfter(n)&&(e=n),e.diff(Z()())<-2592e6?e.year()===Z()().year()?e.format("D MMM"):e.format("ll"):e.fromNow()}function et(t){return t>=1e6?Math.floor(t/1e6)+y.translator.trans("core.lib.number_suffix.mega_text"):t>=1e3?(t/1e3).toFixed(1)+y.translator.trans("core.lib.number_suffix.kilo_text"):t.toString()}var nt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(t){t.className=t.className||"",t.buttonClassName=t.buttonClassName||"",t.menuClassName=t.menuClassName||"",t.label=t.label||"",t.caretIcon=void 0!==t.caretIcon?t.caretIcon:"fas fa-caret-down",t.accessibleToggleLabel=t.accessibleToggleLabel||y.translator.trans("core.lib.dropdown.toggle_dropdown_accessible_label")};var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.showing=!1},n.view=function(t){var e=t.children?H(t.children):[],n=!this.attrs.lazyDraw||this.showing;return m("div",{className:"ButtonGroup Dropdown dropdown "+this.attrs.className+" itemCount"+e.length+(this.showing?" open":"")},this.getButton(t.children),n&&this.getMenu(e))},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.$().on("shown.bs.dropdown",(function(){var t=n.attrs,e=t.lazyDraw,i=t.onshow;n.showing=!0,e&&m.redraw.sync(),"function"==typeof i&&i(),e||m.redraw();var r=n.$(".Dropdown-menu"),o=r.hasClass("Dropdown-menu--right");r.removeClass("Dropdown-menu--top Dropdown-menu--right"),r.toggleClass("Dropdown-menu--top",r.offset().top+r.height()>$(window).scrollTop()+$(window).height()),r.offset().top<0&&r.removeClass("Dropdown-menu--top"),r.toggleClass("Dropdown-menu--right",o||r.offset().left+r.width()>$(window).scrollLeft()+$(window).width())})),this.$().on("hidden.bs.dropdown",(function(){n.showing=!1,n.attrs.onhide&&n.attrs.onhide(),m.redraw()}))},n.getButton=function(t){return m("button",{className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.getButtonContent(t))},n.getButtonContent=function(t){return[this.attrs.icon?J(this.attrs.icon,{className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?J(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.getMenu=function(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)},e}(A);function it(t){var e=Z()(t),n=e.format(),i=e.format("LLLL"),r=tt(t);return m("time",{pubdate:!0,datetime:n,title:i,"data-humantime":!0},r)}var rt=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t=this.attrs.discussion,e=this.attrs.lastPost&&t.replyCount(),n=t[e?"lastPostedUser":"user"](),i=t[e?"lastPostedAt":"createdAt"]();return m("span",null,e?J("fas fa-reply"):""," ",Si.translator.trans("core.forum.discussion_list."+(e?"replied":"started")+"_text",{user:n,ago:it(i)}))},e}(A),ot=function(){function t(){this.callbacks=void 0,this.data=void 0;for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks=e,this.data={},this.needsRebuild()}var e=t.prototype;return e.needsRebuild=function(){var t=this,e=!1;return this.callbacks.forEach((function(n,i){var r=n();r!==t.data[i]&&(t.data[i]=r,e=!0)})),e},e.check=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];this.callbacks=this.callbacks.concat(e),this.needsRebuild()},e.invalidate=function(){this.data={}},t}(),st=["display","size","containerClassName","className"],at=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t=this.attrs,e=t.display,n=void 0===e?"block":e,i=t.size,r=void 0===i?"medium":i,o=t.containerClassName,s=t.className,a=F(t,st),u=L("LoadingIndicator",s),l=L("LoadingIndicator-container","unset"!==n&&"LoadingIndicator-container--"+n,r&&"LoadingIndicator-container--"+r,o);return m("div",Object.assign({"aria-label":y.translator.trans("core.lib.loading_indicator.accessible_label"),role:"status"},a.containerAttrs,{"data-size":r,className:l}),m("div",Object.assign({"aria-hidden":"true",className:u},a)))},e}(A),ut=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.handler=function(){return this.attrs.when()||void 0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("beforeunload",this.boundHandler)},n.view=function(t){return t.children[0]},e}(A);function lt(){var t;y.forum.attribute("debug")&&(t=console).warn.apply(t,arguments)}function ct(t){return t instanceof Array?t.map((function(t){return ct(t)})).join(""):"object"==typeof t&&null!==t?t.children?ct(t.children):t.text:t}var dt=["type","title","aria-label","icon","disabled","loading","className","class"],ht=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(t){var e=this.attrs,n=e.type,i=e.title,r=e["aria-label"],o=e.icon,s=e.disabled,a=e.loading,u=e.className,l=e.class,c=F(e,dt);n||(n="button"),r||(r=i),"object"==typeof r&&(r=ct(r)),(s||a)&&delete c.onclick;var d=C({disabled:s,className:u=L(l,u,{hasIcon:o,disabled:s||a,loading:a}),type:n,"aria-label":r},c);return m("button",d,this.getButtonContent(t.children))},n.oncreate=function(e){var n;t.prototype.oncreate.call(this,e),this.attrs["aria-label"]||ct(e.children)||null!=(n=this.element)&&null!=n.getAttribute&&n.getAttribute("aria-label")||lt('[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)},n.getButtonContent=function(t){var e=this.attrs.icon;return[e&&J(e,{className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(at,{size:"small",display:"inline"})]},e}(A),ft=n(887),pt=n.n(ft),mt=null;function vt(t,e){var n=e.text,i=e.selectionStart,r=e.selectionEnd,o=t.selectionStart,s=t.value.slice(0,o),a=t.value.slice(t.selectionEnd);if(null===mt||!0===mt){t.contentEditable="true";try{mt=document.execCommand("insertText",!1,n)}catch(t){mt=!1}t.contentEditable="false"}mt&&!t.value.slice(0,t.selectionStart).endsWith(n)&&(mt=!1),mt||(t.value=s+n+a,t.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))),null!=i&&null!=r?t.setSelectionRange(i,r):t.setSelectionRange(o,t.selectionEnd)}var gt=function(){function t(t,e){this.el=void 0,this.el=document.createElement("textarea"),this.build(t,e)}var e=t.prototype;return e.build=function(t,e){var n=this;this.el.className=e.classNames.join(" "),this.el.disabled=e.disabled,this.el.placeholder=e.placeholder,this.el.value=e.value;var i=function(t){e.inputListeners.forEach((function(t){t()})),t.redraw=!1};this.el.oninput=function(t){e.oninput(n.el.value),i(t)},this.el.onclick=i,this.el.onkeyup=i,this.el.addEventListener("keydown",(function(t){n.keyHandlers(e).toArray().forEach((function(e){return e(t)}))})),t.append(this.el)},e.keyHandlers=function(t){var e=new I;return e.add("submit",(function(e){(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&t.onsubmit()})),e},e.moveCursorTo=function(t){this.setSelectionRange(t,t)},e.getSelectionRange=function(){return[this.el.selectionStart,this.el.selectionEnd]},e.getLastNChars=function(t){return this.el.value.slice(Math.max(0,this.el.selectionStart-t),this.el.selectionStart)},e.insertAtCursor=function(t){this.insertAt(this.el.selectionStart,t)},e.insertAt=function(t,e){this.insertBetween(t,t,e)},e.insertBetween=function(t,e,n){this.setSelectionRange(t,e);var i=t+n.length;vt(this.el,{text:n,selectionStart:i,selectionEnd:i})},e.replaceBeforeCursor=function(t,e){this.insertBetween(t,this.el.selectionStart,e)},e.setSelectionRange=function(t,e){this.el.setSelectionRange(t,e),this.focus()},e.getCaretCoordinates=function(t){var e=pt()(this.el,t);return{top:e.top-this.el.scrollTop,left:e.left}},e.disabled=function(t){this.el.disabled=t},e.focus=function(){this.el.focus()},e.destroy=function(){this.el.remove()},t}(),yt=["text","tooltipVisible","showOnFocus","position","ignoreTitleWarning","html","delay"],bt=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).firstChild=null,e.childDomNode=null,e.oldText="",e.oldVisibility=void 0,e.shouldRecreateTooltip=!1,e.shouldChangeTooltipVisibility=!1,e}N(e,t);var n=e.prototype;return n.view=function(t){var e=t.children,n=this.attrs,i=(n.text,n.tooltipVisible),r=(n.showOnFocus,n.position,n.ignoreTitleWarning),o=void 0!==r&&r;n.html,n.delay,F(n,yt),this.attrs.title&&!o&&console.warn("`title` attribute was passed to Tooltip component. Was this intentional? Tooltip content should be passed to the `text` attr instead.");var s=this.getRealText();if(s!==this.oldText&&(this.oldText=s,this.shouldRecreateTooltip=!0),i!==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 <div> or <span>.");var a=e[0];if("object"!=typeof a||Array.isArray(a)||null===a)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("string"==typeof a.tag&&["#","[","<"].includes(a.tag))throw new Error('Tooltip component with provided with a vnode with tag "'+a.tag+'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a <div> or <span>.');return this.firstChild=a,e},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.recreateTooltip=function(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())},n.updateVisibility=function(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))},n.createTooltip=function(){if(null!==this.childDomNode){var t=this.attrs,e=t.showOnFocus,n=void 0===e||e,i=t.position,r=void 0===i?"top":i,o=t.delay,s=t.html,a=void 0!==s&&s,u=t.tooltipVisible,l=(t.text,"boolean"==typeof u?"manual":L("hover",[n&&"focus"])),c=this.getRealText();this.childDomNode.setAttribute("title",c),this.childDomNode.setAttribute("aria-label",c),$(this.childDomNode).tooltip({html:a,delay:o,placement:r,trigger:l},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}},n.getRealText=function(){var t=this.attrs.text;return Array.isArray(t)?ct(t):t},n.checkDomNodeChanged=function(){var t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)},e}(A),wt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.value=this.attrs.value||"",this.disabled=!!this.attrs.disabled},n.view=function(){return m("div",{className:"TextEditor"},m("div",{className:"TextEditor-editorContainer"}),m("ul",{className:"TextEditor-controls Composer-footer"},H(this.controlItems().toArray()),m("li",{className:"TextEditor-toolbar"},this.toolbarItems().toArray())))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.attrs.composer.editor=this.buildEditor(this.$(".TextEditor-editorContainer")[0])},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=!!this.attrs.disabled;this.disabled!==n&&(this.disabled=n,this.attrs.composer.editor.disabled(n))},n.buildEditorParams=function(){var t=this;return{classNames:["FormControl","Composer-flexible","TextEditor-editor"],disabled:this.disabled,placeholder:this.attrs.placeholder||"",value:this.value,oninput:this.oninput.bind(this),inputListeners:[],onsubmit:function(){t.onsubmit(),m.redraw()}}},n.buildEditor=function(t){return new gt(t,this.buildEditorParams())},n.controlItems=function(){var t=new I;return t.add("submit",ht.component({icon:"fas fa-paper-plane",className:"Button Button--primary",itemClassName:"App-primaryControl",onclick:this.onsubmit.bind(this)},this.attrs.submitLabel)),this.attrs.preview&&t.add("preview",m(bt,{text:y.translator.trans("core.forum.composer.preview_tooltip")},m(ht,{icon:"far fa-eye",className:"Button Button--icon",onclick:this.attrs.preview}))),t},n.toolbarItems=function(){return new I},n.oninput=function(t){this.value=t,this.attrs.onchange(this.value)},n.onsubmit=function(){this.attrs.onsubmit(this.value)},e}(A),xt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.composer=this.attrs.composer,this.loading=!1,this.attrs.confirmExit&&this.composer.preventClosingWhen((function(){return n.hasChanges()}),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")},n.view=function(){return m(ut,{when:this.hasChanges.bind(this)},m("div",{className:"ComposerBody "+(this.attrs.className||"")},W(this.attrs.user,{className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},H(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},wt.component({submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview&&this.jumpToPreview.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(at,{display:"unset",containerClassName:L("ComposerBody-loading",this.loading&&"active"),size:"large"})))},n.hasChanges=function(){var t=this.composer.fields.content();return t&&t!==this.attrs.originalContent},n.headerItems=function(){return new I},n.onsubmit=function(){},n.loaded=function(){this.loading=!1,m.redraw()},e}(A);function Nt(t){Si.composer.isFullScreen()&&(Si.composer.minimize(),t.stopPropagation())}var Ct=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||ct(Si.translator.trans("core.forum.composer_reply.body_placeholder")),e.submitLabel=e.submitLabel||Si.translator.trans("core.forum.composer_reply.submit_button"),e.confirmExit=e.confirmExit||ct(Si.translator.trans("core.forum.composer_reply.discard_confirmation"))};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.discussion;return e.add("title",m("h3",null,J("fas fa-reply")," ",m(z,{href:Si.route.discussion(n),onclick:Nt},n.title()))),e},n.jumpToPreview=function(t){Nt(t),m.route.set(Si.route.discussion(this.attrs.discussion,"reply"))},n.data=function(){return{content:this.composer.fields.content(),relationships:{discussion:this.attrs.discussion}}},n.onsubmit=function(){var t=this,e=this.attrs.discussion;this.loading=!0,m.redraw();var n=this.data();Si.store.createRecord("posts").save(n).then((function(n){if(Si.viewingDiscussion(e)){var i=Si.current.get("stream");i.update().then((function(){return i.goToNumber(n.number())}))}else{var r,o=ht.component({className:"Button Button--link",onclick:function(){m.route.set(Si.route.post(n)),Si.alerts.dismiss(r)}},Si.translator.trans("core.forum.composer_reply.view_button"));r=Si.alerts.show({type:"success",controls:[o]},Si.translator.trans("core.forum.composer_reply.posted_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(xt),St=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(t){var e=Object.assign({},this.attrs),n=U(e,"type");e.className="Alert Alert--"+n+" "+(e.className||"");var i=U(e,"content")||t.children,r=U(e,"controls")||[],o=U(e,"dismissible"),s=U(e,"ondismiss"),a=[];return(o||void 0===o)&&a.push(m(ht,{icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:s})),m("div",e,m("span",{className:"Alert-body"},i),m("ul",{className:"Alert-controls"},H(r.concat(a))))},e}(A),Tt=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).loading=!1,e.alertAttrs=void 0,e}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e);var i=[];["className","title","content","onsubmit"].forEach((function(t){n[t]||(n[t]=function(){},i.push(t))})),i.length>0&<("Modal `"+this.constructor.name+"` does not implement all abstract methods of the Modal super class. Missing methods: "+i.join(", ")+".")},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.attrs.animateShow((function(){return n.onready()}))},n.onbeforeremove=function(e){if(t.prototype.onbeforeremove.call(this,e),!this.attrs.state.modal)return this.attrs.animateHide(),new Promise((function(t){return setTimeout(t,300)}))},n.view=function(){return this.alertAttrs&&(this.alertAttrs.dismissible=!1),m("div",{className:"Modal modal-dialog "+this.className()},m("div",{className:"Modal-content"},this.constructor.isDismissible&&m("div",{className:"Modal-close App-backControl"},ht.component({icon:"fas fa-times",onclick:this.hide.bind(this),className:"Button Button--icon Button--link"})),m("form",{onsubmit:this.onsubmit.bind(this)},m("div",{className:"Modal-header"},m("h3",{className:"App-titleControl App-titleControl--text"},this.title())),this.alertAttrs?m("div",{className:"Modal-alert"},St.component(this.alertAttrs)):"",this.content())))},n.onready=function(){this.$().find("input, select, textarea").first().trigger("focus").trigger("select")},n.hide=function(){this.attrs.state.close()},n.loaded=function(){this.loading=!1,m.redraw()},n.onerror=function(t){var e;this.alertAttrs=t.alert,m.redraw(),422===t.status&&null!=(e=t.response)&&e.errors?this.$("form [name="+t.response.errors[0].source.pointer.replace("/data/attributes/","")+"]").trigger("select"):this.onready()},e}(A);Tt.isDismissible=!0;var kt=n(362);const At=n.n(kt)();var Et=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.email=At(this.attrs.email||""),this.success=!1},n.className=function(){return"ForgotPasswordModal Modal--small"},n.title=function(){return Si.translator.trans("core.forum.forgot_password.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},Si.translator.trans("core.forum.forgot_password.email_sent_message")),m("div",{className:"Form-group"},m(ht,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},Si.translator.trans("core.forum.forgot_password.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},Si.translator.trans("core.forum.forgot_password.text")),m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:ct(Si.translator.trans("core.forum.forgot_password.email_placeholder")),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},ht.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.forgot_password.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,Si.request({method:"POST",url:Si.forum.attribute("apiUrl")+"/forgot",body:{email:this.email()},errorHandler:this.onerror.bind(this)}).then((function(){e.success=!0,e.alert=null})).catch((function(){})).then(this.loaded.bind(this))},n.onerror=function(e){404===e.status&&(e.alert.content=Si.translator.trans("core.forum.forgot_password.not_found_message")),t.prototype.onerror.call(this,e)},e}(Tt),Pt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){return m("div",{className:"LogInButtons"},this.items().toArray())},n.items=function(){return new I},e}(A),_t=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.username=At(this.attrs.username||""),this.email=At(this.attrs.email||""),this.password=At(this.attrs.password||"")},n.className=function(){return"Modal--small SignUpModal"},n.title=function(){return Si.translator.trans("core.forum.sign_up.title")},n.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},n.isProvided=function(t){return this.attrs.provided&&-1!==this.attrs.provided.indexOf(t)},n.body=function(){return[this.attrs.token?"":m(Pt,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]},n.fields=function(){var t=new I;return t.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:ct(Si.translator.trans("core.forum.sign_up.username_placeholder")),bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),t.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:ct(Si.translator.trans("core.forum.sign_up.email_placeholder")),bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:ct(Si.translator.trans("core.forum.sign_up.password_placeholder")),bidi:this.password,disabled:this.loading})),10),t.add("submit",m("div",{className:"Form-group"},m(ht,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.sign_up.submit_button"))),-10),t},n.footer=function(){return[m("p",{className:"SignUpModal-logIn"},Si.translator.trans("core.forum.sign_up.log_in_text",{a:m("a",{onclick:this.logIn.bind(this)})}))]},n.logIn=function(){var t={identification:this.email()||this.username(),password:this.password()};Si.modal.show(Dt,t)},n.onready=function(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()},n.onsubmit=function(t){t.preventDefault(),this.loading=!0;var e=this.submitData();Si.request({url:Si.forum.attribute("baseUrl")+"/register",method:"POST",body:e,errorHandler:this.onerror.bind(this)}).then((function(){return window.location.reload()}),this.loaded.bind(this))},n.submitData=function(){var t={username:this.username(),email:this.email()};return this.attrs.token?t.token=this.attrs.token:t.password=this.password(),t},e}(Tt),Dt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.identification=At(this.attrs.identification||""),this.password=At(this.attrs.password||""),this.remember=At(!!this.attrs.remember)},n.className=function(){return"LogInModal Modal--small"},n.title=function(){return Si.translator.trans("core.forum.log_in.title")},n.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},n.body=function(){return[m(Pt,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]},n.fields=function(){var t=new I;return t.add("identification",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"identification",type:"text",placeholder:ct(Si.translator.trans("core.forum.log_in.username_or_email_placeholder")),bidi:this.identification,disabled:this.loading})),30),t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"current-password",placeholder:ct(Si.translator.trans("core.forum.log_in.password_placeholder")),bidi:this.password,disabled:this.loading})),20),t.add("remember",m("div",{className:"Form-group"},m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:this.remember,disabled:this.loading}),Si.translator.trans("core.forum.log_in.remember_me_label")))),10),t.add("submit",m("div",{className:"Form-group"},ht.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.log_in.submit_button"))),-10),t},n.footer=function(){return[m("p",{className:"LogInModal-forgotPassword"},m("a",{onclick:this.forgotPassword.bind(this)},Si.translator.trans("core.forum.log_in.forgot_password_link"))),Si.forum.attribute("allowSignUp")?m("p",{className:"LogInModal-signUp"},Si.translator.trans("core.forum.log_in.sign_up_text",{a:m("a",{onclick:this.signUp.bind(this)})})):""]},n.forgotPassword=function(){var t=this.identification(),e=-1!==t.indexOf("@")?{email:t}:void 0;Si.modal.show(Et,e)},n.signUp=function(){var t={password:this.password()},e=this.identification();t[-1!==e.indexOf("@")?"email":"username"]=e,Si.modal.show(_t,t)},n.onready=function(){this.$("[name="+(this.identification()?"password":"identification")+"]").select()},n.onsubmit=function(t){t.preventDefault(),this.loading=!0;var e=this.identification(),n=this.password(),i=this.remember();Si.session.login({identification:e,password:n,remember:i},{errorHandler:this.onerror.bind(this)}).then((function(){return window.location.reload()}),this.loaded.bind(this))},n.onerror=function(e){401===e.status&&(e.alert.content=Si.translator.trans("core.forum.log_in.invalid_login_message")),t.prototype.onerror.call(this,e)},e}(Tt),$t=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.currentTitle=this.attrs.currentTitle,this.newTitle=At(this.currentTitle)},n.className=function(){return"RenameDiscussionModal Modal--small"},n.title=function(){return Si.translator.trans("core.forum.rename_discussion.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{className:"FormControl",bidi:this.newTitle,type:"text"})),m("div",{className:"Form-group"},ht.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.rename_discussion.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=this.newTitle(),i=this.currentTitle;if(n&&n!==i)return this.discussion.save({title:n}).then((function(){Si.viewingDiscussion(e.discussion)&&Si.current.get("stream").update(),m.redraw(),e.hide()})).catch((function(){e.loading=!1,m.redraw()}));this.hide()},e}(Tt);const It={controls:function(t,e){var n=this,i=new I;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",M.component()))})),i},userControls:function(t,e){var n=this,i=new I;return e instanceof ie&&i.add("reply",!Si.session.user||t.canReply()?ht.component({icon:"fas fa-reply",onclick:function(){return n.replyAction.bind(t)(!0,!1).catch((function(){}))}},Si.translator.trans(Si.session.user?"core.forum.discussion_controls.reply_button":"core.forum.discussion_controls.log_in_to_reply_button")):ht.component({icon:"fas fa-reply",className:"disabled",title:Si.translator.trans("core.forum.discussion_controls.cannot_reply_text")},Si.translator.trans("core.forum.discussion_controls.cannot_reply_button"))),i},moderationControls:function(t){var e=new I;return t.canRename()&&e.add("rename",ht.component({icon:"fas fa-pencil-alt",onclick:this.renameAction.bind(t)},Si.translator.trans("core.forum.discussion_controls.rename_button"))),e},destructiveControls:function(t){var e=new I;return t.isHidden()?(t.canHide()&&e.add("restore",ht.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},Si.translator.trans("core.forum.discussion_controls.restore_button"))),t.canDelete()&&e.add("delete",ht.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t)},Si.translator.trans("core.forum.discussion_controls.delete_forever_button")))):t.canHide()&&e.add("hide",ht.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},Si.translator.trans("core.forum.discussion_controls.delete_button"))),e},replyAction:function(t,e){var n=this;return new Promise((function(i,r){return Si.session.user?n.canReply()?(Si.composer.composingReplyTo(n)&&!e||Si.composer.load(Ct,{user:Si.session.user,discussion:n}),Si.composer.show(),t&&Si.viewingDiscussion(n)&&!Si.composer.isFullScreen()&&Si.current.get("stream").goToNumber("reply"),i(Si.composer)):r():(Si.modal.show(Dt),r())}))},hideAction:function(){return this.pushAttributes({hiddenAt:new Date,hiddenUser:Si.session.user}),this.save({isHidden:!0})},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1})},deleteAction:function(){var t=this;if(confirm(ct(Si.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return Si.viewingDiscussion(this)&&Si.history.back(),this.delete().then((function(){return Si.discussions.removeDiscussion(t)}))},renameAction:function(){return Si.modal.show($t,{currentTitle:this.title(),discussion:this})}};function Ot(t){var e,n,i,r,o=$(t),s=!1,a=!1,u=0,l=function(t,e){void 0===e&&(e={}),e.duration=e.duration||"fast",e.step=function(t){$(this).css("transform","translate("+t+"px, 0)")},o.find(".Slidable-content").animate({"background-position-x":t},e)},c=function(){l(0,{complete:function(){o.removeClass("sliding"),e.hide(),n.hide(),a=!1}})};return o.find(".Slidable-content").on("touchstart",(function(t){e=o.find(".Slidable-underneath--left:not(.disabled)"),n=o.find(".Slidable-underneath--right:not(.disabled)"),i=t.originalEvent.targetTouches[0].clientX,r=t.originalEvent.targetTouches[0].clientY,s=!0,u=0})).on("touchmove",(function(t){var l=t.originalEvent.targetTouches[0].clientX,c=t.originalEvent.targetTouches[0].clientY;if(s&&Math.abs(l-i)>Math.abs(c-r)&&(a=!0),s=!1,a){u=l-i;var d=function(t,e){if(t.length){var n="left"===e?u>0:u<0;n&&t.hasClass("Slidable-underneath--elastic")&&(u-=.5*u),t.toggle(n);var i=Math.max(0,Math.min(1,(Math.abs(u)-25)/50));t.find(".icon").css("transform","scale("+i+")")}else u=Math["left"===e?"min":"max"](0,u)};d(e,"left"),d(n,"right"),$(this).css("transform","translate("+u+"px, 0)"),$(this).css("background-position-x",u+"px"),o.toggleClass("sliding",!!u),t.preventDefault()}})).on("touchend",(function(){var t=function(t){t.click(),t.hasClass("Slidable-underneath--elastic")?c():l((u>0?1:-1)*o.width())};n.length&&u<-50?t(n):e.length&&u>50?t(e):c(),s=!1,a=!1})),{reset:c}}var Mt=/[.*+?^${}()|[\]\\]/g;function jt(t){return t.replace(Mt,"\\$&")}var Lt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.subtree=new ot((function(){return n.attrs.discussion.freshness}),(function(){var t=Si.session.user&&Si.session.user.markedAllAsReadAt();return t&&t.getTime()}),(function(){return n.active()}))},n.elementAttrs=function(){return{className:L("DiscussionListItem",{active:this.active(),"DiscussionListItem--hidden":this.attrs.discussion.isHidden(),Slidable:"ontouchstart"in window})}},n.view=function(){var t=this.attrs.discussion,e=t.user(),n=t.isUnread(),i=t.isRead(),r=0,o=It.controls(t,this).toArray(),s=this.elementAttrs();if(this.attrs.params.q){var a=t.mostRelevantPost();a&&(r=a.number());var u=jt(this.attrs.params.q);this.highlightRegExp=new RegExp(u+"|"+u.trim().replace(/\s+/g,"|"),"gi")}else r=Math.min(t.lastPostNumber(),(t.lastReadPostNumber()||0)+1);return m("div",s,o.length>0&&nt.component({icon:"fas fa-ellipsis-v",className:"DiscussionListItem-controls",buttonClassName:"Button Button--icon Button--flat Slidable-underneath Slidable-underneath--right",accessibleToggleLabel:Si.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},o),m("span",{className:"Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic"+(n?"":" disabled"),onclick:this.markAsRead.bind(this)},J("fas fa-check")),m("div",{className:L("DiscussionListItem-content","Slidable-content",{unread:n,read:i})},m(bt,{text:Si.translator.trans("core.forum.discussion_list.started_text",{user:e,ago:tt(t.createdAt())}),position:"right"},m(z,{className:"DiscussionListItem-author",href:e?Si.route.user(e):"#"},W(e,{title:""}))),m("ul",{className:"DiscussionListItem-badges badges"},H(t.badges().toArray())),m(z,{href:Si.route.discussion(t,r),className:"DiscussionListItem-main"},m("h3",{className:"DiscussionListItem-title"},X(t.title(),this.highlightRegExp)),m("ul",{className:"DiscussionListItem-info"},H(this.infoItems().toArray()))),this.replyCountItem()))},n.oncreate=function(e){if(t.prototype.oncreate.call(this,e),"ontouchstart"in window){var n=Ot(this.$());this.$(".DiscussionListItem-controls").on("hidden.bs.dropdown",(function(){return n.reset()}))}},n.onbeforeupdate=function(e,n){return t.prototype.onbeforeupdate.call(this,e,n),this.subtree.needsRebuild()},n.active=function(){return Si.current.matches(ie,{discussion:this.attrs.discussion})},n.showFirstPost=function(){return-1!==["newest","oldest"].indexOf(this.attrs.params.sort)},n.showRepliesCount=function(){return"replies"===this.attrs.params.sort},n.markAsRead=function(){var t=this.attrs.discussion;t.isUnread()&&(t.save({lastReadPostNumber:t.lastPostNumber()}),m.redraw())},n.infoItems=function(){var t=new I;if(this.attrs.params.q){var e=this.attrs.discussion.mostRelevantPost()||this.attrs.discussion.firstPost();if(e&&"comment"===e.contentType()){var n=X(e.contentPlain(),this.highlightRegExp,175);t.add("excerpt",n,-100)}}else t.add("terminalPost",rt.component({discussion:this.attrs.discussion,lastPost:!this.showFirstPost()}));return t},n.replyCountItem=function(){var t=this.attrs.discussion;return!this.showRepliesCount()&&t.isUnread()?m("button",{className:"Button--ua-reset DiscussionListItem-count",onclick:this.markAsRead.bind(this)},m("span",{"aria-hidden":"true"},et(t.unreadCount())),m("span",{class:"visually-hidden"},Si.translator.trans("core.forum.discussion_list.unread_replies_a11y_label",{count:t.replyCount()}))):m("span",{className:"DiscussionListItem-count"},m("span",{"aria-hidden":"true"},et(t.replyCount())),m("span",{class:"visually-hidden"},Si.translator.trans("core.forum.discussion_list.total_replies_a11y_label",{count:t.replyCount()})))},e}(A),Rt=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){return m("div",{className:"Placeholder"},m("p",null,this.attrs.text))},e}(A),Ht=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t,e=this.attrs.state,n=e.getParams();if(e.isInitialLoading()||e.isLoadingNext()?t=m(at,null):e.hasNext()&&(t=ht.component({className:"Button",onclick:e.loadNext.bind(e)},Si.translator.trans("core.forum.discussion_list.load_more_button"))),e.isEmpty()){var i=Si.translator.trans("core.forum.discussion_list.empty_text");return m("div",{className:"DiscussionList"},Rt.component({text:i}))}return m("div",{className:"DiscussionList"+(e.isSearchResults()?" DiscussionList--searchResults":"")},m("ul",{className:"DiscussionList-discussions"},e.getPages().map((function(t){return t.items.map((function(t){return m("li",{key:t.id(),"data-id":t.id()},Lt.component({discussion:t,params:n}))}))}))),m("div",{className:"DiscussionList-loadMore"},t))},e}(A),Bt=function(t){t.pageX<10&&Si.pane.show()},Ft=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){if(this.attrs.state.hasItems())return m("div",{className:"DiscussionPage-list"},this.enoughSpace()&&m(Ht,{state:this.attrs.state}))},n.oncreate=function(e){t.prototype.oncreate.call(this,e);var n=$(e.dom),i=Si.pane;if(n.hover(i.show.bind(i),i.onmouseleave.bind(i)),$(document).on("mousemove",Bt),Si.previous.matches(ie)){var r=Si.cache.discussionListPaneScrollTop||0;n.scrollTop(r)}else{var o=n.find(".DiscussionListItem.active");if(o.length){var s=n.offset().top,a=s+n.outerHeight(),u=o.offset().top,l=u+o.outerHeight();(u<s||l>a)&&n.scrollTop(n.scrollTop()-s+u)}}},n.onremove=function(t){Si.cache.discussionListPaneScrollTop=$(t.dom).scrollTop(),$(document).off("mousemove",Bt)},n.enoughSpace=function(){return!$(".App-navigation").is(":visible")},e}(A),Ut=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},qt=function(){function t(t){this.callback=t,this.ticking=!1}var e=t.prototype;return e.loop=function(){var t=this;this.ticking||(Ut((function(){t.update(),t.ticking=!1})),this.ticking=!0)},e.update=function(){this.callback(window.pageYOffset)},e.start=function(){this.active||window.addEventListener("scroll",this.active=this.loop.bind(this),{passive:!0})},e.stop=function(){window.removeEventListener("scroll",this.active),this.active=null},t}(),zt=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){return m("div",{className:"Post CommentPost LoadingPost"},m("header",{className:"Post-header"},W(null,{className:"PostUser-avatar"}),m("div",{className:"fakeText"})),m("div",{className:"Post-body"},m("div",{className:"fakeText"}),m("div",{className:"fakeText"}),m("div",{className:"fakeText"})))},e}(A);function Wt(t){var e=t&&t.displayName()||y.translator.trans("core.lib.username.deleted_text");return m("span",{className:"username"},e)}var Vt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(t){t.className=t.className||"",t.surround=t.surround||function(t){return t()}};var n=e.prototype;return n.view=function(){return m("div",{className:this.attrs.className})},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e);var r=function(){if(i.attrs.composer.isVisible()){var t=i.attrs.composer.fields.content();n!==t&&(n=t,i.attrs.surround((function(){return s9e.TextFormatter.preview(n||"",e.dom)})))}};r(),this.updateInterval=setInterval(r,50)},n.onremove=function(e){t.prototype.onremove.call(this,e),clearInterval(this.updateInterval)},e}(A),Yt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this;return Si.composer.composingReplyTo(this.attrs.discussion)?m("article",{className:"Post CommentPost editing"},m("header",{className:"Post-header"},m("div",{className:"PostUser"},m("h3",null,W(Si.session.user,{className:"PostUser-avatar"}),Wt(Si.session.user)),m("ul",{className:"PostUser-badges badges"},H(Si.session.user.badges().toArray())))),m(Vt,{className:"Post-body",composer:Si.composer,surround:this.anchorPreview.bind(this)})):m("article",{className:"Post ReplyPlaceholder",onclick:function(){It.replyAction.call(t.attrs.discussion,!0).catch((function(){}))}},m("header",{className:"Post-header"},W(Si.session.user,{className:"PostUser-avatar"})," ",Si.translator.trans("core.forum.post_stream.reply_placeholder")))},n.anchorPreview=function(t){var e=$(window).scrollTop()+$(window).height()>=$(document).height();t(),e&&$(window).scrollTop($(document).height())},e}(A),Gt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.stream=this.attrs.stream,this.scrollListener=new qt(this.onscroll.bind(this))},n.view=function(){var t,e=this,n=this.stream.viewingEnd(),i=this.stream.posts(),r=this.discussion.postIds(),o=function(t){$(t.dom).addClass("fadeIn"),setTimeout((function(){return $(t.dom).removeClass("fadeIn")}),500)},s=i.map((function(n,i){var s,a={"data-index":e.stream.visibleStart+i};if(n){var u=n.createdAt(),l=Si.postComponents[n.contentType()];s=l?l.component({post:n}):"",a.key="post"+n.id(),a.oncreate=o,a["data-time"]=u.toISOString(),a["data-number"]=n.number(),a["data-id"]=n.id(),a["data-type"]=n.contentType();var c=u-t;c>3456e5&&(s=[m("div",{className:"PostStream-timeGap"},m("span",null,Si.translator.trans("core.forum.post_stream.time_lapsed_text",{period:dayjs().add(c,"ms").fromNow(!0)}))),s]),t=u}else a.key="post"+r[e.stream.visibleStart+i],s=zt.component();return m("div",Object.assign({className:"PostStream-item"},a),s)}));return!n&&i[this.stream.visibleEnd-this.stream.visibleStart-1]&&s.push(m("div",{className:"PostStream-loadMore",key:"loadMore"},m(ht,{className:"Button",onclick:this.stream.loadNext.bind(this.stream)},Si.translator.trans("core.forum.post_stream.load_more_button")))),!n||Si.session.user&&!this.discussion.canReply()||s.push(m("div",{className:"PostStream-item",key:"reply","data-index":this.stream.count(),oncreate:o},Yt.component({discussion:this.discussion}))),m("div",{className:"PostStream"},s)},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.triggerScroll()},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.triggerScroll(),setTimeout((function(){return n.scrollListener.start()}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),clearTimeout(this.calculatePositionTimeout)},n.triggerScroll=function(){if(this.stream.needsScroll){var t=this.stream.targetPost;this.stream.needsScroll=!1,"number"in t?this.scrollToNumber(t.number,this.stream.animateScroll):"index"in t&&this.scrollToIndex(t.index,this.stream.animateScroll,t.reply)}},n.onscroll=function(t){void 0===t&&(t=window.pageYOffset),this.stream.paused||this.stream.pagesLoading||(this.updateScrubber(t),this.loadPostsIfNeeded(t),clearTimeout(this.calculatePositionTimeout),this.calculatePositionTimeout=setTimeout(this.calculatePosition.bind(this,t),100))},n.loadPostsIfNeeded=function(t){void 0===t&&(t=window.pageYOffset);var e=this.getMarginTop(),n=$(window).height()-e,i=t+e;if(this.stream.visibleStart>0){var r=this.$(".PostStream-item[data-index="+this.stream.visibleStart+"]");r.length&&r.offset().top>i-300&&this.stream.loadPrevious()}if(this.stream.visibleEnd<this.stream.count()){var o=this.$(".PostStream-item[data-index="+(this.stream.visibleEnd-1)+"]");o.length&&o.offset().top+o.outerHeight(!0)<i+n+300&&this.stream.loadNext()}},n.updateScrubber=function(t){void 0===t&&(t=window.pageYOffset);var e=this.getMarginTop(),n=$(window).height()-e,i=t+e,r=this.$(".PostStream-item[data-index]"),o=0,s="",a=null;r.each((function(){var t=$(this),e=t.offset().top,r=t.outerHeight(!0);if(e+r<i)return!0;if(e>i+n)return!1;var u=Math.max(0,i-e),l=Math.min(r,i+n-e)-u;null===a&&(a=parseFloat(t.data("index"))+u/r),l>0&&(o+=l/r);var c=t.data("time");c&&(s=c)})),this.stream.index=null!==a?a+1:this.stream.count(),this.stream.visible=o,s&&(this.stream.description=dayjs(s).format("MMMM YYYY"))},n.calculatePosition=function(t){void 0===t&&(t=window.pageYOffset);var e,n,i=this.getMarginTop(),r=$(window),o=r.height()-i,s=r.scrollTop()+i,a=t+i;this.$(".PostStream-item").each((function(){var t=$(this),i=t.offset().top,r=t.outerHeight(!0),u=Math.max(0,a-i);if(void 0===e&&(u/r<.75||(r-u)/o>.25)&&(e=t.data("number")),i+r>s){if(!(i+r<s+o))return!1;t.data("number")&&(n=t.data("number"))}})),e&&this.attrs.onPositionChange(e||1,n,e)},n.getMarginTop=function(){var t="phone"===Si.screen()?"#app-navigation":"#header";return this.$()&&$(t).outerHeight()+parseInt(this.$().css("margin-top"),10)},n.scrollToNumber=function(t,e){var n=this.$(".PostStream-item[data-number="+t+"]");return this.scrollToItem(n,e).then(this.flashItem.bind(this,n))},n.scrollToIndex=function(t,e,n){var i=n?$(".PostStream-item:last-child"):this.$(".PostStream-item[data-index="+t+"]");this.scrollToItem(i,e,!0,n),n&&this.flashItem(i)},n.scrollToItem=function(t,e,n,i){var r=this,o=$("html, body").stop(!0),s=t.data("index");if(t.length){var a=t.offset().top-this.getMarginTop(),u=t.offset().top+t.height(),l=$(document).scrollTop(),c=l+$(window).height();if(n||a<l||u>c){var d=i?u-$(window).height()+Si.composer.computedHeight():t.is(":first-child")?0:a;e?d!==l&&o.animate({scrollTop:d},"fast"):o.scrollTop(d)}}var h=function(){r.updateScrubber(),void 0!==s&&(r.stream.index=s+1)};return h(),this.stream.forceUpdateScrubber=!0,Promise.all([o.promise(),this.stream.loadPromise]).then((function(){var t;if(m.redraw.sync(),i){var e=$(".PostStream-item:last-child");$(window).scrollTop(e.offset().top+e.height()-$(window).height()+Si.composer.computedHeight())}else 0===s?$(window).scrollTop(0):(t=$(".PostStream-item[data-index="+s+"]").offset())&&$(window).scrollTop(t.top-r.getMarginTop());h(),r.calculatePosition(),r.stream.paused=!1,r.loadPostsIfNeeded()}))},n.flashItem=function(t){t.removeClass("fadeIn"),t.addClass("flash").on("animationend webkitAnimationEnd",(function(e){t.removeClass("flash")}))},e}(A);function Kt(t,e){return void 0===e&&(e=y.data.locale),new Intl.NumberFormat(e).format(t)}var Xt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.stream=this.attrs.stream,this.handlers={},this.scrollListener=new qt(this.updateScrubberValues.bind(this,{fromScroll:!0,forceHeightChange:!0}))},n.view=function(){var t=this.stream.count(),e=Si.translator.trans("core.forum.post_scrubber.viewing_text",{count:t,index:m("span",{className:"Scrubber-index"}),formattedCount:m("span",{className:"Scrubber-count"},Kt(t))}),n=this.stream.discussion.unreadCount(),i=t?Math.min(t-this.stream.index,n)/t:0;function r(t){var e=$(t.dom),n={top:100-100*i+"%",height:100*i+"%"};t.state.oldStyle?e.stop(!0).css(t.state.oldStyle).animate(n):e.css(n),t.state.oldStyle=n}var o=["PostStreamScrubber","Dropdown"];return this.attrs.className&&o.push(this.attrs.className),m("div",{className:o.join(" ")},m("button",{className:"Button Dropdown-toggle","data-toggle":"dropdown"},e," ",J("fas fa-sort")),m("div",{className:"Dropdown-menu dropdown-menu"},m("div",{className:"Scrubber"},m("a",{className:"Scrubber-first",onclick:this.goToFirst.bind(this)},J("fas fa-angle-double-up")," ",Si.translator.trans("core.forum.post_scrubber.original_post_link")),m("div",{className:"Scrubber-scrollbar"},m("div",{className:"Scrubber-before"}),m("div",{className:"Scrubber-handle"},m("div",{className:"Scrubber-bar"}),m("div",{className:"Scrubber-info"},m("strong",null,e),m("span",{className:"Scrubber-description"}))),m("div",{className:"Scrubber-after"}),m("div",{className:"Scrubber-unread",oncreate:r,onupdate:r},Si.translator.trans("core.forum.post_scrubber.unread_text",{count:n}))),m("a",{className:"Scrubber-last",onclick:this.goToLast.bind(this)},J("fas fa-angle-double-down")," ",Si.translator.trans("core.forum.post_scrubber.now_link")))))},n.onupdate=function(e){var n=this;t.prototype.onupdate.call(this,e),this.stream.forceUpdateScrubber&&(this.stream.forceUpdateScrubber=!1,this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!0,forceHeightChange:!0})})))},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),$(window).on("resize",this.handlers.onresize=this.onresize.bind(this)).resize(),this.$(".Scrubber-scrollbar").bind("click",this.onclick.bind(this)).bind("dragstart mousedown touchstart",(function(t){return t.preventDefault()})),this.dragging=!1,this.mouseStart=0,this.indexStart=0,this.$(".Scrubber-handle").bind("mousedown touchstart",this.onmousedown.bind(this)).click((function(t){return t.stopPropagation()})),$(document).on("mousemove touchmove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup touchend",this.handlers.onmouseup=this.onmouseup.bind(this)),setTimeout((function(){return n.scrollListener.start()})),this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!1,forceHeightChange:!0})}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove touchmove",this.handlers.onmousemove).off("mouseup touchend",this.handlers.onmouseup)},n.updateScrubberValues=function(t){var e=this;void 0===t&&(t={});var n=this.stream.index,i=this.stream.count(),r=this.stream.visible||1,o=this.percentPerPost(),s=this.$();s.find(".Scrubber-index").text(Kt(this.stream.sanitizeIndex(Math.max(1,n)))),s.find(".Scrubber-description").text(this.stream.description),s.toggleClass("disabled",this.stream.disabled());var a={};if(a.before=Math.max(0,o.index*Math.min(n-1,i-r)),a.handle=Math.min(100-a.before,o.visible*r),a.after=100-a.before-a.handle,!(t.fromScroll&&this.stream.paused||this.adjustingHeight&&!t.forceHeightChange)){var u=t.animate?"animate":"css";this.adjustingHeight=!0;var l=[];for(var c in a){var d=s.find(".Scrubber-"+c);l.push(d.stop(!0,!0)[u]({height:a[c]+"%"},"fast").promise()),"animate"===u&&d.css("overflow","visible")}Promise.all(l).then((function(){return e.adjustingHeight=!1}))}},n.goToFirst=function(){this.stream.goToFirst(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.goToLast=function(){this.stream.goToLast(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.onresize=function(){var t=this.$(),e=this.$(".Scrubber-scrollbar");e.css("max-height",$(window).height()-t.offset().top+$(window).scrollTop()-parseInt($("#app").css("padding-bottom"),10)-(t.outerHeight()-e.outerHeight()))},n.onmousedown=function(t){t.redraw=!1,this.mouseStart=t.clientY||t.originalEvent.touches[0].clientY,this.indexStart=this.stream.index,this.dragging=!0,$("body").css("cursor","move"),this.$().toggleClass("dragging",this.dragging)},n.onmousemove=function(t){if(this.dragging){var e=((t.clientY||t.originalEvent.touches[0].clientY)-this.mouseStart)/this.$(".Scrubber-scrollbar").outerHeight()*100/this.percentPerPost().index||0,n=Math.min(this.indexStart+e,this.stream.count()-1);this.stream.index=Math.max(0,n),this.updateScrubberValues()}},n.onmouseup=function(){if(this.$().toggleClass("dragging",this.dragging),this.dragging){this.mouseStart=0,this.indexStart=0,this.dragging=!1,$("body").css("cursor",""),this.$().removeClass("open");var t=Math.floor(this.stream.index);this.stream.goToIndex(t)}},n.onclick=function(t){var e=this.$(".Scrubber-scrollbar"),n=((t.pageY||t.originalEvent.touches[0].pageY)-e.offset().top+$("body").scrollTop())/e.outerHeight()*100,i=(n-=parseFloat(e.find(".Scrubber-handle")[0].style.height)/2)/this.percentPerPost().index;i=Math.max(0,Math.min(this.stream.count()-1,i)),this.stream.goToIndex(Math.floor(i)),this.updateScrubberValues({animate:!0,forceHeightChange:!0}),this.$().removeClass("open")},n.percentPerPost=function(){var t=this.stream.count()||1,e=this.stream.visible||1,n=50/this.$(".Scrubber-scrollbar").outerHeight()*100,i=Math.max(100/t,n/e);return{index:t===e?0:(100-i*e)/(t-e),visible:i}},e}(A),Jt=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className+=" Dropdown--split",e.menuClassName+=" Dropdown-menu--right"};var n=e.prototype;return n.getButton=function(t){var e=this.getFirstChild(t),n=Object.assign({},e.attrs);return n.className=(n.className||"")+" SplitDropdown-button Button "+this.attrs.buttonClassName,[ht.component(n,e.children),m("button",{className:"Dropdown-toggle Button Button--icon "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown"},J(this.attrs.icon,{className:"Button-icon"}),J("fas fa-caret-down",{className:"Button-caret"}))]},n.getFirstChild=function(t){for(var e=t;e instanceof Array;)e=e[0];return e},e}(nt);function Qt(t,e,n,i){var r,o=!1,s=0;function a(){r&&clearTimeout(r)}function u(){for(var u=arguments.length,l=new Array(u),c=0;c<u;c++)l[c]=arguments[c];var d=this,h=Date.now()-s;function f(){s=Date.now(),n.apply(d,l)}function p(){r=void 0}o||(i&&!r&&f(),a(),void 0===i&&h>t?f():!0!==e&&(r=setTimeout(i?p:f,void 0===i?t-h:t)))}return"boolean"!=typeof e&&(i=n,n=e,e=void 0),u.cancel=function(){a(),o=!0},u}function Zt(t,e,n){return void 0===n?Qt(t,e,!1):Qt(t,n,!1!==e)}function te(t,e){var n=$(window),i=$(t).offset().top-n.scrollTop();e(),n.scrollTop($(t).offset().top-i)}var ee=function(){function t(t,e){void 0===e&&(e=[]),this.discussion=t,this.paused=!1,this.loadPageTimeouts={},this.pagesLoading=0,this.index=0,this.number=1,this.visible=1,this.description="",this.forceUpdateScrubber=!1,this.loadNext=Qt(300,this._loadNext),this.loadPrevious=Qt(300,this._loadPrevious),this.show(e)}var e=t.prototype;return e.update=function(){return this.viewingEnd()?(this.visibleEnd=this.count(),this.loadRange(this.visibleStart,this.visibleEnd)):Promise.resolve()},e.goToFirst=function(){return this.goToIndex(0)},e.goToLast=function(){return this.goToIndex(this.count()-1,!0)},e.goToNumber=function(t,e){if(void 0===e&&(e=!1),"reply"===t){var n=this.goToLast();return this.targetPost.reply=!0,n}return this.paused=!0,this.loadPromise=this.loadNearNumber(t),this.needsScroll=!0,this.targetPost={number:t},this.animateScroll=!e,this.number=t,this.loadPromise.then((function(){return m.redraw()}))},e.goToIndex=function(t,e){return void 0===e&&(e=!1),this.paused=!0,this.loadPromise=this.loadNearIndex(t),this.needsScroll=!0,this.targetPost={index:t},this.animateScroll=!e,this.index=t,m.redraw(),this.loadPromise},e.loadNearNumber=function(t){return this.posts().some((function(e){return e&&Number(e.number())===Number(t)}))?Promise.resolve():(this.reset(),Si.store.find("posts",{filter:{discussion:this.discussion.id()},page:{near:t}}).then(this.show.bind(this)))},e.loadNearIndex=function(t){if(t>=this.visibleStart&&t<this.visibleEnd)return Promise.resolve();var e=this.sanitizeIndex(t-this.constructor.loadCount/2),n=e+this.constructor.loadCount;return this.reset(e,n),this.loadRange(e,n).then(this.show.bind(this))},e._loadNext=function(){var t=this.visibleEnd,e=this.visibleEnd=this.sanitizeIndex(this.visibleEnd+this.constructor.loadCount),n=t-2*this.constructor.loadCount;n>this.visibleStart&&n>=0&&(this.visibleStart=n+this.constructor.loadCount+1,this.loadPageTimeouts[n]&&(clearTimeout(this.loadPageTimeouts[n]),this.loadPageTimeouts[n]=null,this.pagesLoading--)),this.loadPage(t,e)},e._loadPrevious=function(){var t=this.visibleStart,e=this.visibleStart=this.sanitizeIndex(this.visibleStart-this.constructor.loadCount),n=e+2*this.constructor.loadCount;n<this.visibleEnd&&n<=this.count()&&(this.visibleEnd=n,this.loadPageTimeouts[n]&&(clearTimeout(this.loadPageTimeouts[n]),this.loadPageTimeouts[n]=null,this.pagesLoading--)),this.loadPage(e,t,!0)},e.loadPage=function(t,e,n){var i=this;void 0===n&&(n=!1),this.pagesLoading++;var r=function(){t<i.visibleStart||e>i.visibleEnd||te('.PostStream-item[data-index="'+(n?i.visibleEnd-1:i.visibleStart)+'"]',m.redraw.sync)};r(),this.loadPageTimeouts[t]=setTimeout((function(){i.loadRange(t,e).then((function(){r(),i.pagesLoading--})),i.loadPageTimeouts[t]=null}),this.pagesLoading-1?1e3:0)},e.loadRange=function(t,e){var n=[],i=[];return this.discussion.postIds().slice(t,e).forEach((function(t){var e=Si.store.getById("posts",t);e&&e.discussion()&&void 0!==e.canEdit()?i.push(e):n.push(t)})),n.length?Si.store.find("posts",n).then((function(t){return i.concat(t).sort((function(t,e){return t.createdAt()-e.createdAt()}))})):Promise.resolve(i)},e.show=function(t){this.visibleStart=t.length?this.discussion.postIds().indexOf(t[0].id()):0,this.visibleEnd=this.sanitizeIndex(this.visibleStart+t.length)},e.reset=function(t,e){this.visibleStart=t||0,this.visibleEnd=this.sanitizeIndex(e||this.constructor.loadCount)},e.posts=function(){return this.discussion.postIds().slice(this.visibleStart,this.visibleEnd).map((function(t){var e=Si.store.getById("posts",t);return e&&e.discussion()&&void 0!==e.canEdit()?e:null}))},e.count=function(){return this.discussion.postIds().length},e.disabled=function(){return this.visible>=this.count()},e.viewingEnd=function(){return Math.abs(this.count()-this.visibleEnd)<=1},e.sanitizeIndex=function(t){return Math.max(0,Math.min(this.count(),Math.floor(t)))},t}();ee.loadCount=20;const ne=ee;var ie=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.useBrowserScrollRestoration=!1,this.discussion=null,this.near=m.route.param("near")||0,this.load(),Si.discussions.hasItems()&&(Si.pane.enable(),Si.pane.hide()),Si.history.push("discussion"),this.bodyClass="App--discussion"},n.onremove=function(e){t.prototype.onremove.call(this,e),Si.pane.disable(),Si.composer.composingReplyTo(this.discussion)&&!Si.composer.fields.content()?Si.composer.hide():Si.composer.minimize()},n.view=function(){return m("div",{className:"DiscussionPage"},m(Ft,{state:Si.discussions}),m("div",{className:"DiscussionPage-discussion"},this.discussion?this.pageContent().toArray():this.loadingItems().toArray()))},n.loadingItems=function(){var t=new I;return t.add("spinner",m(at,null),100),t},n.sidebar=function(){return m("nav",{className:"DiscussionPage-nav"},m("ul",null,H(this.sidebarItems().toArray())))},n.hero=function(){return m(B,{discussion:this.discussion})},n.pageContent=function(){var t=new I;return t.add("hero",this.hero(),100),t.add("main",m("div",{className:"container"},this.mainContent().toArray()),10),t},n.mainContent=function(){var t=new I;return t.add("sidebar",this.sidebar(),100),t.add("poststream",m("div",{className:"DiscussionPage-stream"},Gt.component({discussion:this.discussion,stream:this.stream,onPositionChange:this.positionChanged.bind(this)})),10),t},n.load=function(){var t=Si.preloadedApiDocument();if(t)setTimeout(this.show.bind(this,t),0);else{var e=this.requestParams();Si.store.find("discussions",m.route.param("id"),e).then(this.show.bind(this))}m.redraw()},n.requestParams=function(){return{bySlug:!0,page:{near:this.near}}},n.show=function(t){var e=this;Si.history.push("discussion",t.title()),Si.setTitle(t.title()),Si.setTitleCount(0);var n=[];if(t.payload&&t.payload.included){var i=t.id();n=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===i})).map((function(t){return Si.store.getById("posts",t.id)})).sort((function(t,e){return t.createdAt()-e.createdAt()})).slice(0,20)}this.stream=new ne(t,n),this.stream.goToNumber(m.route.param("near")||n[0]&&n[0].number(),!0).then((function(){e.discussion=t,Si.current.set("discussion",t),Si.current.set("stream",e.stream)}))},n.sidebarItems=function(){var t=new I;return t.add("controls",Jt.component({icon:"fas fa-ellipsis-v",className:"App-primaryControl",buttonClassName:"Button--primary",accessibleToggleLabel:Si.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},It.controls(this.discussion,this).toArray())),t.add("scrubber",Xt.component({stream:this.stream,className:"App-titleControl"}),-100),t},n.positionChanged=function(t,e){var n=this.discussion,i=Si.route.discussion(n,this.near=t);window.history.replaceState(null,document.title,i),Si.history.push("discussion",n.title()),Si.session.user&&e>(n.lastReadPostNumber()||0)&&(n.save({lastReadPostNumber:e}),m.redraw())},e}(_),re=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},H(this.items().toArray()))},n.items=function(){return new I},e}(A),oe=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.active=this.isActive(e),void 0===e.force&&(e.force=!0)},e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return n.tag=z,n.attrs.active=String(n.attrs.active),delete n.attrs.type,n},e.isActive=function(t){return void 0!==t.active?t.active:m.route.get()===t.href},e}(ht),se=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className="SessionDropdown",e.buttonClassName="Button Button--user Button--flat",e.menuClassName="Dropdown-menu--right",e.accessibleToggleLabel=Si.translator.trans("core.forum.header.session_dropdown_accessible_label")};var n=e.prototype;return n.view=function(e){return t.prototype.view.call(this,C({},e,{children:this.items().toArray()}))},n.getButtonContent=function(){var t=Si.session.user;return[W(t)," ",m("span",{className:"Button-label"},Wt(t))]},n.items=function(){var t=new I,e=Si.session.user;return t.add("profile",oe.component({icon:"fas fa-user",href:Si.route.user(e)},Si.translator.trans("core.forum.header.profile_button")),100),t.add("settings",oe.component({icon:"fas fa-cog",href:Si.route("settings")},Si.translator.trans("core.forum.header.settings_button")),50),Si.forum.attribute("adminUrl")&&t.add("administration",oe.component({icon:"fas fa-wrench",href:Si.forum.attribute("adminUrl"),target:"_blank"},Si.translator.trans("core.forum.header.admin_button")),0),t.add("separator",M.component(),-90),t.add("logOut",ht.component({icon:"fas fa-sign-out-alt",onclick:Si.session.logout.bind(Si.session)},Si.translator.trans("core.forum.header.log_out_button")),-100),t},e}(nt);function ae(t){var e=t.tag;return("string"!=typeof e||"a"===e||"button"===e)&&("initAttrs"in e&&e.initAttrs(t.attrs),"isActive"in e?e.isActive(t.attrs):t.attrs.active)}var ue=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){e.caretIcon=void 0!==e.caretIcon?e.caretIcon:"fas fa-sort",t.initAttrs.call(this,e),e.className+=" Dropdown--select"},e.prototype.getButtonContent=function(t){var e=t.find(ae),n=e&&e.children||this.attrs.defaultLabel;return n instanceof Array&&(n=n[0]),[m("span",{className:"Button-label"},n),J(this.attrs.caretIcon,{className:"Button-caret"})]},e}(nt),le=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=null),this.data=t,this.freshness=new Date,this.exists=!1,this.store=e}var e=t.prototype;return e.id=function(){return this.data.id},e.attribute=function(t){return this.data.attributes[t]},e.pushData=function(e){for(var n in e)if("object"==typeof e[n])for(var i in this.data[n]=this.data[n]||{},e[n])e[n][i]instanceof t&&(e[n][i]={data:t.getIdentifier(e[n][i])}),this.data[n][i]=e[n][i];else this.data[n]=e[n];this.freshness=new Date},e.pushAttributes=function(t){this.pushData({attributes:t})},e.save=function(e,n){var i=this;void 0===n&&(n={});var r={type:this.data.type,id:this.data.id,attributes:e};if(e.relationships){for(var o in r.relationships={},e.relationships){var s=e.relationships[o];r.relationships[o]={data:s instanceof Array?s.map(t.getIdentifier):t.getIdentifier(s)}}delete e.relationships}var a=this.copyData();this.pushData(r);var u={data:r};return n.meta&&(u.meta=n.meta),y.request(Object.assign({method:this.exists?"PATCH":"POST",url:y.forum.attribute("apiUrl")+this.apiEndpoint(),body:u},n)).then((function(t){return i.store.data[t.data.type]=i.store.data[t.data.type]||{},i.store.data[t.data.type][t.data.id]=i,i.store.pushPayload(t)}),(function(t){throw i.pushData(a),m.redraw(),t}))},e.delete=function(t,e){var n=this;return void 0===e&&(e={}),this.exists?y.request(Object.assign({method:"DELETE",url:y.forum.attribute("apiUrl")+this.apiEndpoint(),body:t},e)).then((function(){n.exists=!1,n.store.remove(n)})):Promise.resolve()},e.apiEndpoint=function(){return"/"+this.data.type+(this.exists?"/"+this.data.id:"")},e.copyData=function(){return JSON.parse(JSON.stringify(this.data))},t.attribute=function(t,e){return function(){var n=this.data.attributes&&this.data.attributes[t];return e?e(n):n}},t.hasOne=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return y.store.getById(e.data.type,e.data.id)}return!1}},t.hasMany=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return e.data.map((function(t){return y.store.getById(t.type,t.id)}))}return!1}},t.transformDate=function(t){return t?new Date(t):null},t.getIdentifier=function(t){return t?{type:t.data.type,id:t.data.id}:t},t}();function ce(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];var i,r=e.slice(0,-1),o=e.slice(-1)[0],s={};return function(){var t=this,e=!1;return r.forEach((function(n){var i="function"==typeof t[n]?t[n]():t[n];s[n]!==i&&(e=!0,s[n]=i)})),e&&(i=o.apply(this,r.map((function(t){return s[t]})))),i}}var de=["type","icon","label","color","style"],he=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t=this.attrs,e=t.type,n=t.icon,i=t.label,r=t.color,o=t.style,s=void 0===o?{}:o,a=F(t,de),u=L("Badge",[e&&"Badge--"+e],a.className),l=n?J(n,{className:"Badge-icon"}):m.trust(" "),c=C({},s,{"--badge-bg":r}),d=C({},a,{className:u,style:c}),h=m("div",d,l);return i?m(bt,{text:i},h):h},e}(A),fe=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(le);Object.assign(fe.prototype,{title:le.attribute("title"),slug:le.attribute("slug"),createdAt:le.attribute("createdAt",le.transformDate),user:le.hasOne("user"),firstPost:le.hasOne("firstPost"),lastPostedAt:le.attribute("lastPostedAt",le.transformDate),lastPostedUser:le.hasOne("lastPostedUser"),lastPost:le.hasOne("lastPost"),lastPostNumber:le.attribute("lastPostNumber"),commentCount:le.attribute("commentCount"),replyCount:ce("commentCount",(function(t){return Math.max(0,t-1)})),posts:le.hasMany("posts"),mostRelevantPost:le.hasOne("mostRelevantPost"),lastReadAt:le.attribute("lastReadAt",le.transformDate),lastReadPostNumber:le.attribute("lastReadPostNumber"),isUnread:ce("unreadCount",(function(t){return!!t})),isRead:ce("unreadCount",(function(t){return y.session.user&&!t})),hiddenAt:le.attribute("hiddenAt",le.transformDate),hiddenUser:le.hasOne("hiddenUser"),isHidden:ce("hiddenAt",(function(t){return!!t})),canReply:le.attribute("canReply"),canRename:le.attribute("canRename"),canHide:le.attribute("canHide"),canDelete:le.attribute("canDelete"),removePost:function(t){var e=this.data.relationships,n=e&&e.posts;n&&n.data.some((function(e,i){if(t===e.id)return n.data.splice(i,1),!0}))},unreadCount:function(){var t=y.session.user;if(t&&t.markedAllAsReadAt()<this.lastPostedAt()){var e=Math.max(0,this.lastPostNumber()-(this.lastReadPostNumber()||0));return Math.min(e,this.commentCount())}return 0},badges:function(){var t=new I;return this.isHidden()&&t.add("hidden",m(he,{type:"hidden",icon:"fas fa-trash",label:y.translator.trans("core.lib.badge.hidden_tooltip")})),t},postIds:function(){var t=this.data.relationships.posts;return t?t.data.map((function(t){return t.id})):[]}});var pe=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state;return m("div",{className:"NotificationList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},Si.translator.trans("core.forum.notifications.title")),m("div",{className:"App-primaryControl"},m(ht,{className:"Button Button--link",icon:"fas fa-check",title:Si.translator.trans("core.forum.notifications.mark_all_as_read_tooltip"),onclick:t.markAllAsRead.bind(t)}))),m("div",{className:"NotificationList-content"},this.content(t)))},n.content=function(t){return t.isLoading()?m(at,{className:"LoadingIndicator--block"}):t.hasItems()?t.getPages().map((function(t){var e=[],n={};return t.items.forEach((function(t){var i=t.subject();if(void 0!==i){var r=null;i instanceof fe?r=i:i&&i.discussion&&(r=i.discussion());var o=r?r.id():0;n[o]=n[o]||{discussion:r,notifications:[]},n[o].notifications.push(t),-1===e.indexOf(n[o])&&e.push(n[o])}})),e.map((function(t){var e=t.discussion&&t.discussion.badges().toArray();return m("div",{className:"NotificationGroup"},t.discussion?m(z,{className:"NotificationGroup-header",href:Si.route.discussion(t.discussion)},e&&!!e.length&&m("ul",{className:"NotificationGroup-badges badges"},H(e)),m("span",null,t.discussion.title())):m("div",{className:"NotificationGroup-header"},Si.forum.attribute("title")),m("ul",{className:"NotificationGroup-content"},t.notifications.map((function(t){var e=Si.notificationComponents[t.contentType()];return e?m("li",null,e.component({notification:t})):""}))))}))})):m("div",{className:"NotificationList-empty"},Si.translator.trans("core.forum.notifications.empty_text"))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$notifications=this.$(".NotificationList-content"),this.$scrollParent=this.inPanel()?this.$notifications:$(window),this.boundScrollHandler=this.scrollHandler.bind(this),this.$scrollParent.on("scroll",this.boundScrollHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),this.$scrollParent.off("scroll",this.boundScrollHandler)},n.scrollHandler=function(){var t=this.attrs.state,e=this.inPanel()?this.$scrollParent[0]:document.documentElement,n=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<=1;t.hasNext()&&!t.isLoadingNext()&&n&&t.loadNext()},n.inPanel=function(){return"auto"===this.$notifications.css("overflow")},e}(A),me=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){e.className=e.className||"NotificationsDropdown",e.buttonClassName=e.buttonClassName||"Button Button--flat",e.menuClassName=e.menuClassName||"Dropdown-menu--right",e.label=e.label||Si.translator.trans("core.forum.notifications.tooltip"),e.icon=e.icon||"fas fa-bell",e.accessibleToggleLabel=e.accessibleToggleLabel||Si.translator.trans("core.forum.notifications.toggle_dropdown_accessible_label"),t.initAttrs.call(this,e)};var n=e.prototype;return n.getButton=function(){var e=this.getNewCount(),n=t.prototype.getButton.call(this);return n.attrs.title=this.attrs.label,n.attrs.className=L(n.attrs.className,[e&&"new"]),n.attrs.onclick=this.onclick.bind(this),n},n.getButtonContent=function(){var t=this.getUnreadCount();return[J(this.attrs.icon,{className:"Button-icon"}),0!==t&&m("span",{className:"NotificationsDropdown-unread"},t),m("span",{className:"Button-label"},this.attrs.label)]},n.getMenu=function(){return m("div",{className:L("Dropdown-menu",this.attrs.menuClassName),onclick:this.menuClick.bind(this)},this.showing&&pe.component({state:this.attrs.state}))},n.onclick=function(){Si.drawer.isOpen()?this.goToRoute():this.attrs.state.load()},n.goToRoute=function(){m.route.set(Si.route("notifications"))},n.getUnreadCount=function(){return Si.session.user.unreadNotificationCount()},n.getNewCount=function(){return Si.session.user.newNotificationCount()},n.menuClick=function(t){(t.shiftKey||t.metaKey||t.ctrlKey||2===t.which)&&t.stopPropagation()},e}(nt),ve=function(){function t(){this.callbacks=new Map,this.whenCallback=function(t){return!0}}var e=t.prototype;return e.onUp=function(t){return this.callbacks.set(38,(function(e){e.preventDefault(),t(e)})),this},e.onDown=function(t){return this.callbacks.set(40,(function(e){e.preventDefault(),t(e)})),this},e.onSelect=function(t){var e=function(e){e.preventDefault(),t(e)};return this.callbacks.set(9,e),this.callbacks.set(13,e),this},e.onCancel=function(t){return this.callbacks.set(27,(function(e){e.stopPropagation(),e.preventDefault(),t(e)})),this},e.onRemove=function(t){return this.callbacks.set(8,(function(e){0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this},e.when=function(t){return this.whenCallback=t,this},e.bindTo=function(t){t.on("keydown",this.navigate.bind(this))},e.navigate=function(t){if(this.whenCallback(t)){var e=this.callbacks.get(t.which);e&&e(t)}},t}(),ge=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;t=t.toLowerCase(),this.results.set(t,[]);var n={filter:{q:t},page:{limit:3},include:"mostRelevantPost"};return Si.store.find("discussions",n).then((function(n){return e.results.set(t,n)}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).map((function(e){var n=e.mostRelevantPost();return m("li",{className:"DiscussionSearchResult","data-index":"discussions"+e.id()},m(z,{href:Si.route.discussion(e,n&&n.number())},m("div",{className:"DiscussionSearchResult-title"},X(e.title(),t)),n?m("div",{className:"DiscussionSearchResult-excerpt"},X(n.contentPlain(),t,100)):""))}));return[m("li",{className:"Dropdown-header"},Si.translator.trans("core.forum.search.discussions_heading")),m("li",null,m(oe,{icon:"fas fa-search",href:Si.route("index",{q:t})},Si.translator.trans("core.forum.search.all_discussions_button",{query:t})))].concat(e)},t}(),ye=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;return Si.store.find("users",{filter:{q:t},page:{limit:5}}).then((function(n){e.results.set(t,n),m.redraw()}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).concat(Si.store.all("users").filter((function(e){return[e.username(),e.displayName()].some((function(e){return e.toLowerCase().substr(0,t.length)===t}))}))).filter((function(t,e,n){return n.lastIndexOf(t)===e})).sort((function(t,e){return t.displayName().localeCompare(e.displayName())}));return e.length?[m("li",{className:"Dropdown-header"},Si.translator.trans("core.forum.search.users_heading"))].concat(e.map((function(e){var n=Wt(e),i=[X(n.text,t)];return m("li",{className:"UserSearchResult","data-index":"users"+e.id()},m(z,{href:Si.route.user(e)},W(e),C({},n,{text:void 0,children:i})))}))):[]},t}(),be=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).state=void 0,e.hasFocus=!1,e.sources=void 0,e.loadingSources=0,e.index=0,e.navigator=void 0,e.searchTimeout=void 0,e.updateMaxHeightHandler=void 0,e}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state},n.view=function(){var t=this,e=this.state.getInitialSearch();if(this.sources||(this.sources=this.sourceItems().toArray()),!this.sources.length)return m("div",null);var n=ct(Si.translator.trans("core.forum.header.search_placeholder")),i=!!e,r=!(this.loadingSources||!this.state.getValue()||!this.hasFocus),o=!(this.loadingSources||!this.state.getValue());return m("div",{role:"search","aria-label":Si.translator.trans("core.forum.header.search_role_label"),className:L("Search",{open:this.state.getValue()&&this.hasFocus,focused:this.hasFocus,active:i,loading:!!this.loadingSources})},m("div",{className:"Search-input"},m("input",{"aria-label":n,className:"FormControl",type:"search",placeholder:n,value:this.state.getValue(),oninput:function(e){return t.state.setValue(e.target.value)},onfocus:function(){return t.hasFocus=!0},onblur:function(){return t.hasFocus=!1}}),!!this.loadingSources&&m(at,{size:"small",display:"inline",containerClassName:"Button Button--icon Button--link"}),o&&m("button",{className:"Search-clear Button Button--icon Button--link",onclick:this.clear.bind(this),"aria-label":Si.translator.trans("core.forum.header.search_clear_button_accessible_label")},J("fas fa-times-circle"))),m("ul",{className:"Dropdown-menu Search-results","aria-hidden":!r||void 0,"aria-live":r?"polite":void 0},r&&this.sources.map((function(e){return e.view(t.state.getValue())}))))},n.updateMaxHeight=function(){var t=window.innerHeight-this.element.querySelector(".Search-input>.FormControl").getBoundingClientRect().bottom-14;this.element.querySelector(".Search-results").style["max-height"]=t+"px"},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.setIndex(this.getCurrentNumericIndex()),this.sources.length&&this.updateMaxHeight()},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e);var i=this,r=this.state;this.setIndex(this.getCurrentNumericIndex()),this.$(".Search-results").on("mousedown",(function(t){return t.preventDefault()})).on("click",(function(){return n.$("input").trigger("blur")})).on("mouseenter","> li:not(.Dropdown-header)",(function(){i.setIndex(i.selectableItems().index(this))}));var o=this.$("input");this.navigator=new ve,this.navigator.onUp((function(){return n.setIndex(n.getCurrentNumericIndex()-1,!0)})).onDown((function(){return n.setIndex(n.getCurrentNumericIndex()+1,!0)})).onSelect(this.selectResult.bind(this)).onCancel(this.clear.bind(this)).bindTo(o),o.on("input focus",(function(){var t=this.value.toLowerCase();t&&(clearTimeout(i.searchTimeout),i.searchTimeout=setTimeout((function(){r.isCached(t)||(t.length>=i.constructor.MIN_SEARCH_LEN&&i.sources.map((function(e){e.search&&(i.loadingSources++,e.search(t).then((function(){i.loadingSources=Math.max(0,i.loadingSources-1),m.redraw()})))})),r.cache(t),m.redraw())}),250))})).on("focus",(function(){$(this).one("mouseup",(function(t){return t.preventDefault()})).trigger("select")})),this.updateMaxHeightHandler=this.updateMaxHeight.bind(this),window.addEventListener("resize",this.updateMaxHeightHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),window.removeEventListener("resize",this.updateMaxHeightHandler)},n.selectResult=function(){clearTimeout(this.searchTimeout),this.loadingSources=0,this.state.getValue()?m.route.set(this.getItem(this.index).find("a").attr("href")):this.clear(),this.$("input").blur()},n.clear=function(){this.state.clear()},n.sourceItems=function(){var t=new I;return Si.forum.attribute("canViewForum")&&t.add("discussions",new ge),Si.forum.attribute("canSearchUsers")&&t.add("users",new ye),t},n.selectableItems=function(){return this.$(".Search-results > li:not(.Dropdown-header)")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){var e=this.selectableItems(),n=e.filter('[data-index="'+t+'"]');return n.length||(n=e.eq(t)),n},n.setIndex=function(t,e){void 0===e&&(e=!1);var n=this.selectableItems(),i=n.parent(),r=t;t<0?r=n.length-1:t>=n.length&&(r=0);var o=n.removeClass("active").eq(r).addClass("active");if(this.index=parseInt(o.attr("data-index"))||r,e){var s,a=i.scrollTop(),u=i.offset().top,l=u+i.outerHeight(),c=o.offset().top,d=c+o.outerHeight();c<u?s=a-u+c-parseInt(i.css("padding-top"),10):d>l&&(s=a-l+d+parseInt(i.css("padding-bottom"),10)),void 0!==s&&i.stop(!0).animate({scrollTop:s},100)}},e}(A);be.MIN_SEARCH_LEN=3;var we=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},H(this.items().toArray()))},n.items=function(){var t=new I;if(t.add("search",be.component({state:Si.search}),30),Si.forum.attribute("showLanguageSelector")&&Object.keys(Si.data.locales).length>1){var e=[],n=function(t){e.push(ht.component({active:Si.data.locale===t,icon:Si.data.locale!==t||"fas fa-check",onclick:function(){Si.session.user?Si.session.user.savePreferences({locale:t}).then((function(){return window.location.reload()})):(document.cookie="locale="+t+"; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT",window.location.reload())}},Si.data.locales[t]))};for(var i in Si.data.locales)n(i);t.add("locale",ue.component({buttonClassName:"Button Button--link",accessibleToggleLabel:Si.translator.trans("core.forum.header.locale_dropdown_accessible_label")},e),20)}return Si.session.user?(t.add("notifications",me.component({state:Si.notifications}),10),t.add("session",se.component(),0)):(Si.forum.attribute("allowSignUp")&&t.add("signUp",ht.component({className:"Button Button--link",onclick:function(){return Si.modal.show(_t)}},Si.translator.trans("core.forum.header.sign_up_link")),10),t.add("logIn",ht.component({className:"Button Button--link",onclick:function(){return Si.modal.show(Dt)}},Si.translator.trans("core.forum.header.log_in_link")),0)),t},e}(A),xe=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link"},e}(ht),Ne=function(){function t(){this.position=t.Position.HIDDEN,this.height=null,this.body={attrs:{}},this.editor=null,this.clear()}var e=t.prototype;return e.load=function(t,e){var n={componentClass:t,attrs:e};this.preventExit()||(this.isVisible()&&(this.clear(),m.redraw.sync()),this.body=n)},e.clear=function(){this.position=t.Position.HIDDEN,this.body={attrs:{}},this.onExit=null,this.fields={content:At("")},this.editor&&this.editor.destroy(),this.editor=null},e.show=function(){this.position!==t.Position.NORMAL&&this.position!==t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw.sync())},e.hide=function(){this.clear(),m.redraw()},e.close=function(){this.preventExit()||this.hide()},e.minimize=function(){this.isVisible()&&(this.position=t.Position.MINIMIZED,m.redraw())},e.fullScreen=function(){this.isVisible()&&(this.position=t.Position.FULLSCREEN,m.redraw())},e.exitFullScreen=function(){this.position===t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw())},e.bodyMatches=function(t,e){var n=this;return void 0===e&&(e={}),!!E(this.body.componentClass,t)&&Object.keys(e).every((function(t){return n.body.attrs[t]===e[t]}))},e.isVisible=function(){return this.position!==t.Position.HIDDEN},e.isFullScreen=function(){return this.position===t.Position.FULLSCREEN||"phone"===Si.screen()},e.composingReplyTo=function(t){return this.isVisible()&&this.bodyMatches(Ct,{discussion:t})},e.preventExit=function(){if(this.isVisible()&&this.onExit)return this.onExit.callback()?!confirm(this.onExit.message):void 0},e.preventClosingWhen=function(t,e){this.onExit={callback:t,message:e}},e.minimumHeight=function(){return 200},e.maximumHeight=function(){return $(window).height()-$("#header").outerHeight()},e.computedHeight=function(){return this.position===t.Position.MINIMIZED?"":this.position===t.Position.FULLSCREEN?$(window).height():Math.max(this.minimumHeight(),Math.min(this.height,this.maximumHeight()))},t}();Ne.Position={HIDDEN:"hidden",NORMAL:"normal",MINIMIZED:"minimized",FULLSCREEN:"fullScreen"};const Ce=Ne;var Se=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state,this.active=!1,this.prevPosition=this.state.position},n.view=function(){var t=this.state.body,e={normal:this.state.position===Ce.Position.NORMAL,minimized:this.state.position===Ce.Position.MINIMIZED,fullScreen:this.state.position===Ce.Position.FULLSCREEN,active:this.active,visible:this.state.isVisible()},n=this.state.position===Ce.Position.MINIMIZED?this.state.show.bind(this.state):void 0;return m("div",{className:"Composer "+L(e)},m("div",{className:"Composer-handle",oncreate:this.configHandle.bind(this)}),m("ul",{className:"Composer-controls"},H(this.controlItems().toArray())),m("div",{className:"Composer-content",onclick:n},t.componentClass?t.componentClass.component(C({},t.attrs,{composer:this.state,disabled:e.minimized})):""))},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.state.position===this.prevPosition?this.updateHeight():(this.animatePositionChange(),this.prevPosition=this.state.position)},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.initializeHeight(),this.$().hide().css("bottom",-this.state.computedHeight()),this.$().on("focus blur",":input,.TextEditor-editorContainer",(function(t){n.active="focusin"===t.type,m.redraw()})),this.$().on("keydown",":input,.TextEditor-editorContainer","esc",(function(){return n.state.close()})),this.handlers={},$(window).on("resize",this.handlers.onresize=this.updateHeight.bind(this)).resize(),$(document).on("mousemove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup",this.handlers.onmouseup=this.onmouseup.bind(this))},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove",this.handlers.onmousemove).off("mouseup",this.handlers.onmouseup)},n.configHandle=function(t){var e=this;$(t.dom).css("cursor","row-resize").bind("dragstart mousedown",(function(t){return t.preventDefault()})).mousedown((function(t){e.mouseStart=t.clientY,e.heightStart=e.$().height(),e.handle=$(this),$("body").css("cursor","row-resize")}))},n.onmousemove=function(t){if(this.handle){var e=this.mouseStart-t.clientY;this.changeHeight(this.heightStart+e);var n=$(window).scrollTop(),i=n>0&&n+$(window).height()>=$(document).height();this.updateBodyPadding(i)}},n.onmouseup=function(){this.handle&&(this.handle=null,$("body").css("cursor",""))},n.focus=function(){this.$(".Composer-content :input:enabled:visible, .TextEditor-editor").first().focus()},n.updateHeight=function(){var t=this.state.computedHeight(),e=this.$(".Composer-flexible");if(this.$().height(t),e.length){var n=e.offset().top-this.$().offset().top,i=parseInt(e.css("padding-bottom"),10),r=this.$(".Composer-footer").outerHeight(!0);e.height(this.$().outerHeight()-n-i-r)}},n.updateBodyPadding=function(){var t=this.state.position!==Ce.Position.HIDDEN&&this.state.position!==Ce.Position.MINIMIZED&&"phone"!==Si.screen()?this.state.computedHeight()-parseInt($("#app").css("padding-bottom"),10):0;$("#content").css({paddingBottom:t})},n.animatePositionChange=function(){if(this.prevPosition!==Ce.Position.FULLSCREEN||this.state.position!==Ce.Position.NORMAL)switch(this.state.position){case Ce.Position.HIDDEN:return this.hide();case Ce.Position.MINIMIZED:return this.minimize();case Ce.Position.FULLSCREEN:return this.focus();case Ce.Position.NORMAL:return this.show()}else this.focus()},n.animateHeightChange=function(){var t=this.$().stop(!0),e=t.outerHeight(),n=$(window).scrollTop();t.show(),this.updateHeight();var i=t.outerHeight();this.prevPosition===Ce.Position.HIDDEN?t.css({bottom:-i,height:i}):t.css({height:e});var r=t.animate({bottom:0,height:i},"fast").promise();return this.updateBodyPadding(),$(window).scrollTop(n),r},n.showBackdrop=function(){this.$backdrop=$("<div/>").addClass("composer-backdrop").appendTo("body")},n.hideBackdrop=function(){this.$backdrop&&this.$backdrop.remove()},n.show=function(){var t=this;if(this.animateHeightChange().then((function(){return t.focus()})),"phone"===Si.screen()){var e=document.documentElement,n=Math.min(e.scrollTop,e.scrollHeight-e.clientHeight);this.$().css("top",$(".App").is(".mobile-safari")?n:0),this.showBackdrop()}},n.hide=function(){var t=this,e=this.$();e.stop(!0).animate({bottom:-e.height()},"fast",(function(){e.hide(),t.hideBackdrop(),t.updateBodyPadding()}))},n.minimize=function(){this.animateHeightChange(),this.$().css("top","auto"),this.hideBackdrop()},n.controlItems=function(){var t=new I;return this.state.position===Ce.Position.FULLSCREEN?t.add("exitFullScreen",xe.component({icon:"fas fa-compress",title:Si.translator.trans("core.forum.composer.exit_full_screen_tooltip"),onclick:this.state.exitFullScreen.bind(this.state)})):(this.state.position!==Ce.Position.MINIMIZED&&(t.add("minimize",xe.component({icon:"fas fa-minus minimize",title:Si.translator.trans("core.forum.composer.minimize_tooltip"),onclick:this.state.minimize.bind(this.state),itemClassName:"App-backControl"})),t.add("fullScreen",xe.component({icon:"fas fa-expand",title:Si.translator.trans("core.forum.composer.full_screen_tooltip"),onclick:this.state.fullScreen.bind(this.state)}))),t.add("close",xe.component({icon:"fas fa-times",title:Si.translator.trans("core.forum.composer.close_tooltip"),onclick:this.state.close.bind(this.state)}))),t},n.initializeHeight=function(){this.state.height=localStorage.getItem("composerHeight"),this.state.height||(this.state.height=this.defaultHeight())},n.defaultHeight=function(){return this.$().height()},n.changeHeight=function(t){this.state.height=t,this.updateHeight(),localStorage.setItem("composerHeight",this.state.height)},e}(A),Te=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.notification,n=this.href();return m(z,{className:L("Notification","Notification--"+e.contentType(),[!e.isRead()&&"unread"]),href:n,external:n.includes("://"),onclick:this.markAsRead.bind(this)},W(e.fromUser()),J(this.icon(),{className:"Notification-icon"}),m("span",{className:"Notification-title"},m("span",{className:"Notification-content"},this.content()),m("span",{className:"Notification-title-spring"}),it(e.createdAt())),!e.isRead()&&m(ht,{className:"Notification-action Button Button--link",icon:"fas fa-check",title:Si.translator.trans("core.forum.notifications.mark_as_read_tooltip"),onclick:function(e){e.preventDefault(),e.stopPropagation(),t.markAsRead()}}),m("div",{className:"Notification-excerpt"},this.excerpt()))},n.icon=function(){},n.href=function(){},n.content=function(){},n.excerpt=function(){},n.markAsRead=function(){this.attrs.notification.isRead()||(Si.session.user.pushAttributes({unreadNotificationCount:Si.session.user.unreadNotificationCount()-1}),this.attrs.notification.save({isRead:!0}))},e}(A),ke=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.href=function(){var t=this.attrs.notification;return Si.route.discussion(t.subject(),t.content().postNumber)},n.content=function(){return Si.translator.trans("core.forum.notifications.discussion_renamed_text",{user:this.attrs.notification.fromUser()})},e}(Te);function Ae(t){Si.composer.isFullScreen()&&(Si.composer.minimize(),t.stopPropagation())}var Ee=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.submitLabel=e.submitLabel||Si.translator.trans("core.forum.composer_edit.submit_button"),e.confirmExit=e.confirmExit||Si.translator.trans("core.forum.composer_edit.discard_confirmation"),e.originalContent=e.originalContent||e.post.content(),e.user=e.user||e.post.user(),e.post.editedContent=e.originalContent};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.post;return e.add("title",m("h3",null,J("fas fa-pencil-alt")," ",m(z,{href:Si.route.discussion(n.discussion(),n.number()),onclick:Ae},Si.translator.trans("core.forum.composer_edit.post_link",{number:n.number(),discussion:n.discussion().title()})))),e},n.jumpToPreview=function(t){Ae(t),m.route.set(Si.route.post(this.attrs.post))},n.data=function(){return{content:this.composer.fields.content()}},n.onsubmit=function(){var t=this,e=this.attrs.post.discussion();this.loading=!0;var n=this.data();this.attrs.post.save(n).then((function(n){if(Si.viewingDiscussion(e))Si.current.get("stream").goToNumber(n.number());else{var i,r=ht.component({className:"Button Button--link",onclick:function(){m.route.set(Si.route.post(n)),Si.alerts.dismiss(i)}},Si.translator.trans("core.forum.composer_edit.view_button"));i=Si.alerts.show({type:"success",controls:[r]},Si.translator.trans("core.forum.composer_edit.edited_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(xt);const Pe={controls:function(t,e){var n=this,i=new I;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",M.component()))})),i},userControls:function(t,e){return new I},moderationControls:function(t,e){var n=new I;return"comment"===t.contentType()&&t.canEdit()&&(t.isHidden()||n.add("edit",ht.component({icon:"fas fa-pencil-alt",onclick:this.editAction.bind(t)},Si.translator.trans("core.forum.post_controls.edit_button")))),n},destructiveControls:function(t,e){var n=new I;return"comment"!==t.contentType()||t.isHidden()?("comment"===t.contentType()&&t.canHide()&&n.add("restore",ht.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},Si.translator.trans("core.forum.post_controls.restore_button"))),t.canDelete()&&n.add("delete",ht.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t,e)},Si.translator.trans("core.forum.post_controls.delete_forever_button")))):t.canHide()&&n.add("hide",ht.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},Si.translator.trans("core.forum.post_controls.delete_button"))),n},editAction:function(){var t=this;return new Promise((function(e){return Si.composer.load(Ee,{post:t}),Si.composer.show(),e()}))},hideAction:function(){if(confirm(ct(Si.translator.trans("core.forum.post_controls.hide_confirmation"))))return this.pushAttributes({hiddenAt:new Date,hiddenUser:Si.session.user}),this.save({isHidden:!0}).then((function(){return m.redraw()}))},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1}).then((function(){return m.redraw()}))},deleteAction:function(t){var e=this;if(confirm(ct(Si.translator.trans("core.forum.post_controls.delete_confirmation"))))return t&&(t.loading=!0),this.delete().then((function(){var t=e.discussion();t.removePost(e.id()),t.postIds().length||(Si.discussions.removeDiscussion(t),Si.viewingDiscussion(t)&&Si.history.back())})).catch((function(){})).then((function(){t&&(t.loading=!1),m.redraw()}))}};var _e=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.loading=!1,this.subtree=new ot((function(){return n.loading}),(function(){return n.attrs.post.freshness}),(function(){var t=n.attrs.post.user();return t&&t.freshness}),(function(){return n.controlsOpen}))},n.view=function(){var t=this,e=this.elementAttrs();e.className=this.classes(e.className).join(" ");var n=Pe.controls(this.attrs.post,this).toArray(),i=this.footerItems().toArray();return m("article",e,m("div",null,this.loading?m(at,null):this.content(),m("aside",{className:"Post-actions"},m("ul",null,H(this.actionItems().toArray()),n.length?m("li",null,m(nt,{className:"Post-controls",buttonClassName:"Button Button--icon Button--flat",menuClassName:"Dropdown-menu--right",icon:"fas fa-ellipsis-h",onshow:function(){return t.$(".Post-actions").addClass("open")},onhide:function(){return t.$(".Post-actions").removeClass("open")},accessibleToggleLabel:Si.translator.trans("core.forum.post_controls.toggle_dropdown_accessible_label")},n)):"")),m("footer",{className:"Post-footer"},i.length?m("ul",null,H(i)):null)))},n.onbeforeupdate=function(e){return t.prototype.onbeforeupdate.call(this,e),this.subtree.needsRebuild()},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=this.$(".Post-actions"),i=this.$(".Post-controls");n.toggleClass("open",i.hasClass("open"))},n.elementAttrs=function(){return{}},n.content=function(){return[]},n.classes=function(t){var e=(t||"").split(" ").concat(["Post"]),n=this.attrs.post.user(),i=this.attrs.post.discussion();return this.loading&&e.push("Post--loading"),n&&n===Si.session.user&&e.push("Post--by-actor"),n&&n===i.user()&&e.push("Post--by-start-user"),e},n.actionItems=function(){return new I},n.footerItems=function(){return new I},e}(A),De=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.group&&(e.icon=e.group.icon(),e.color=e.group.color(),e.label=void 0===e.label?e.group.nameSingular():e.label,e.type="group--"+e.group.id(),delete e.group)},e}(he),$e=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(le);Object.assign($e.prototype,{nameSingular:le.attribute("nameSingular"),namePlural:le.attribute("namePlural"),color:le.attribute("color"),icon:le.attribute("icon"),isHidden:le.attribute("isHidden")}),$e.ADMINISTRATOR_ID="1",$e.GUEST_ID="2",$e.MEMBER_ID="3";const Ie=$e;var Oe=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e);var i=this.attrs.user;this.username=At(i.username()||""),this.email=At(i.email()||""),this.isEmailConfirmed=At(i.isEmailConfirmed()||!1),this.setPassword=At(!1),this.password=At(i.password()||""),this.groups={},y.store.all("groups").filter((function(t){return-1===[Ie.GUEST_ID,Ie.MEMBER_ID].indexOf(t.id())})).forEach((function(t){return n.groups[t.id()]=At(-1!==i.groups().indexOf(t))}))},n.className=function(){return"EditUserModal Modal--small"},n.title=function(){return y.translator.trans("core.lib.edit_user.title")},n.content=function(){var t=this.fields().toArray();return m("div",{className:"Modal-body"},t.length>1?m("div",{className:"Form"},this.fields().toArray()):y.translator.trans("core.lib.edit_user.nothing_available"))},n.fields=function(){var t=this,e=new I;return y.session.user.canEditCredentials()&&(e.add("username",m("div",{className:"Form-group"},m("label",null,y.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:ct(y.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),y.session.user!==this.attrs.user&&(e.add("email",m("div",{className:"Form-group"},m("label",null,y.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:ct(y.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(y.session.user)?m("div",null,ht.component({className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},y.translator.trans("core.lib.edit_user.activate_button"))):""),30),e.add("password",m("div",{className:"Form-group"},m("label",null,y.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:function(e){t.setPassword(e.target.checked),m.redraw.sync(),e.target.checked&&t.$("[name=password]").select(),e.redraw=!1},disabled:this.nonAdminEditingAdmin()}),y.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()?m("input",{className:"FormControl",type:"password",name:"password",placeholder:ct(y.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}):"")),20))),y.session.user.canEditGroups()&&e.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,y.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((function(t){return y.store.getById("groups",t)})).map((function(e){return m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:t.groups[e.id()],disabled:e.id()===Ie.ADMINISTRATOR_ID&&(t.attrs.user===y.session.user||!t.userIsAdmin(y.session.user))}),De.component({group:e,label:""})," ",e.nameSingular())})))),10),e.add("submit",m("div",{className:"Form-group"},ht.component({className:"Button Button--primary",type:"submit",loading:this.loading},y.translator.trans("core.lib.edit_user.submit_button"))),-10),e},n.activate=function(){var t=this;this.loading=!0;var e={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(e,{errorHandler:this.onerror.bind(this)}).then((function(){t.isEmailConfirmed(!0),t.loading=!1,m.redraw()})).catch((function(){t.loading=!1,m.redraw()}))},n.data=function(){var t=this,e={relationships:{}};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(e.username=this.username(),y.session.user!==this.attrs.user&&(e.email=this.email()),this.setPassword()&&(e.password=this.password())),this.attrs.user.canEditGroups()&&(e.relationships.groups=Object.keys(this.groups).filter((function(e){return t.groups[e]()})).map((function(t){return y.store.getById("groups",t)}))),e},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))},n.nonAdminEditingAdmin=function(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(y.session.user)},n.userIsAdmin=function(t){return t.groups().some((function(t){return t.id()===Ie.ADMINISTRATOR_ID}))},e}(Tt),Me=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(t){return t.children[0]},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundOnresize=this.onresize.bind(this),$(window).on("resize",this.boundOnresize).resize()},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.boundOnresize)},n.onresize=function(){var t=this,e=this.$(),n=$("#header"),i=$("#footer"),r=e.find("> ul");$(window).off(".affix"),r.removeClass("affix affix-top affix-bottom").removeData("bs.affix"),e.outerHeight(!0)>$(window).height()-n.outerHeight(!0)||r.affix({offset:{top:function(){return e.offset().top-n.outerHeight(!0)-parseInt(e.css("margin-top"),10)},bottom:function(){return t.bottom=i.outerHeight(!0)}}})},e}(A),je=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.user=null,this.bodyClass="App--user"},n.view=function(){return m("div",{className:"UserPage"},this.user?[m(He,{user:this.user,className:"Hero UserHero",editable:this.user.canEdit()||this.user===Si.session.user,controlsButtonClassName:"Button"}),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m(Me,null,m("nav",{className:"sideNav UserPage-nav"},m("ul",null,H(this.sidebarItems().toArray())))),m("div",{className:"sideNavOffset UserPage-content"},this.content())))]:[m(at,{display:"block"})])},n.content=function(){},n.show=function(t){this.user=t,Si.current.set("user",t),Si.setTitle(t.displayName()),m.redraw()},n.loadUser=function(t){var e=this,n=t.toLowerCase();Si.preloadedApiDocument(),Si.store.all("users").some((function(i){if((i.username().toLowerCase()===n||i.id()===t)&&i.joinTime())return e.show(i),!0})),this.user||Si.store.find("users",t,{bySlug:!0}).then(this.show.bind(this))},n.sidebarItems=function(){var t=new I;return t.add("nav",m(ue,{className:"App-titleControl",buttonClassName:"Button"},this.navItems().toArray())),t},n.navItems=function(){var t=new I,e=this.user;return t.add("posts",m(oe,{href:Si.route("user.posts",{username:e.slug()}),icon:"far fa-comment"},Si.translator.trans("core.forum.user.posts_link")," ",m("span",{className:"Button-badge"},e.commentCount())),100),t.add("discussions",m(oe,{href:Si.route("user.discussions",{username:e.slug()}),icon:"fas fa-bars"},Si.translator.trans("core.forum.user.discussions_link")," ",m("span",{className:"Button-badge"},e.discussionCount())),90),Si.session.user===e&&(t.add("separator",m(M,null),-90),t.add("settings",m(oe,{href:Si.route("settings"),icon:"fas fa-cog"},Si.translator.trans("core.forum.user.settings_link")),-100)),t},e}(_);const Le={controls:function(t,e){var n=this,i=new I;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",m(M,null)))})),i},userControls:function(){return new I},moderationControls:function(t){var e=new I;return(t.canEdit()||t.canEditCredentials()||t.canEditGroups())&&e.add("edit",m(ht,{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},Si.translator.trans("core.forum.user_controls.edit_button"))),e},destructiveControls:function(t){var e=new I;return"1"!==t.id()&&t.canDelete()&&e.add("delete",m(ht,{icon:"fas fa-times",onclick:this.deleteAction.bind(this,t)},Si.translator.trans("core.forum.user_controls.delete_button"))),e},deleteAction:function(t){var e=this;confirm(Si.translator.trans("core.forum.user_controls.delete_confirmation"))&&t.delete().then((function(){e.showDeletionAlert(t,"success"),Si.current.matches(je,{user:t})?Si.history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")}))},showDeletionAlert:function(t,e){var n={success:"core.forum.user_controls.delete_success_message",error:"core.forum.user_controls.delete_error_message"}[e];Si.alerts.show({type:e},Si.translator.trans(n,{user:t,email:t.email()}))},editAction:function(t){Si.modal.show(Oe,{user:t})}};var Re=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!1,this.isDraggedOver=!1},n.view=function(){var t=this.attrs.user;return m("div",{className:L(["AvatarEditor","Dropdown",this.attrs.className,this.loading&&"loading",this.isDraggedOver&&"dragover"])},W(t),m("a",{className:t.avatarUrl()?"Dropdown-toggle":"Dropdown-toggle AvatarEditor--noAvatar",title:Si.translator.trans("core.forum.user.avatar_upload_tooltip"),"data-toggle":"dropdown",onclick:this.quickUpload.bind(this),ondragover:this.enableDragover.bind(this),ondragenter:this.enableDragover.bind(this),ondragleave:this.disableDragover.bind(this),ondragend:this.disableDragover.bind(this),ondrop:this.dropUpload.bind(this)},this.loading?m(at,{display:"unset",size:"large"}):t.avatarUrl()?J("fas fa-pencil-alt"):J("fas fa-plus-circle")),m("ul",{className:"Dropdown-menu Menu"},H(this.controlItems().toArray())))},n.controlItems=function(){var t=new I;return t.add("upload",m(ht,{icon:"fas fa-upload",onclick:this.openPicker.bind(this)},Si.translator.trans("core.forum.user.avatar_upload_button"))),t.add("remove",m(ht,{icon:"fas fa-times",onclick:this.remove.bind(this)},Si.translator.trans("core.forum.user.avatar_remove_button"))),t},n.enableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!0},n.disableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1},n.dropUpload=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1,this.upload(t.dataTransfer.files[0])},n.quickUpload=function(t){this.attrs.user.avatarUrl()||(t.preventDefault(),t.stopPropagation(),this.openPicker())},n.openPicker=function(){var t=this;this.loading||$('<input type="file">').appendTo("body").hide().click().on("input",(function(e){t.upload($(e.target)[0].files[0])}))},n.upload=function(t){if(!this.loading){var e=this.attrs.user,n=new FormData;n.append("avatar",t),this.loading=!0,m.redraw(),Si.request({method:"POST",url:Si.forum.attribute("apiUrl")+"/users/"+e.id()+"/avatar",serialize:function(t){return t},body:n}).then(this.success.bind(this),this.failure.bind(this))}},n.remove=function(){var t=this.attrs.user;this.loading=!0,m.redraw(),Si.request({method:"DELETE",url:Si.forum.attribute("apiUrl")+"/users/"+t.id()+"/avatar"}).then(this.success.bind(this),this.failure.bind(this))},n.success=function(t){Si.store.pushPayload(t),delete this.attrs.user.avatarColor,this.loading=!1,m.redraw()},n.failure=function(t){this.loading=!1,m.redraw()},e}(A),He=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.user,e=Le.controls(t,this).toArray(),n=t.color(),i=t.badges().toArray();return m("div",{className:"UserCard "+(this.attrs.className||""),style:n&&{"--usercard-bg":n}},m("div",{className:"darkenBackground"},m("div",{className:"container"},e.length?nt.component({className:"UserCard-controls App-primaryControl",menuClassName:"Dropdown-menu--right",buttonClassName:this.attrs.controlsButtonClassName,label:Si.translator.trans("core.forum.user_controls.button"),accessibleToggleLabel:Si.translator.trans("core.forum.user_controls.toggle_dropdown_accessible_label"),icon:"fas fa-ellipsis-v"},e):"",m("div",{className:"UserCard-profile"},m("h2",{className:"UserCard-identity"},this.attrs.editable?[Re.component({user:t,className:"UserCard-avatar"}),Wt(t)]:m(z,{href:Si.route.user(t)},m("div",{className:"UserCard-avatar"},W(t)),Wt(t))),i.length?m("ul",{className:"UserCard-badges badges"},H(i)):"",m("ul",{className:"UserCard-info"},H(this.infoItems().toArray()))))))},n.infoItems=function(){var t=new I,e=this.attrs.user,n=e.lastSeenAt();if(n){var i=e.isOnline();t.add("lastSeen",m("span",{className:"UserCard-lastSeen"+(i?" online":"")},i?[J("fas fa-circle")," ",Si.translator.trans("core.forum.user.online_text")]:[J("far fa-clock")," ",tt(n)]))}return t.add("joined",Si.translator.trans("core.forum.user.joined_date_text",{ago:tt(e.joinTime())})),t},e}(A);function Be(t){if(t.lastSeenAt()&&t.isOnline())return m("span",{className:"UserOnline"},J("fas fa-circle"))}var Fe=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.user();if(!e)return m("div",{className:"PostUser"},m("h3",null,W(e,{className:"PostUser-avatar"})," ",Wt(e)));var n="";return!t.isHidden()&&this.attrs.cardVisible&&(n=He.component({user:e,className:"UserCard--popover",controlsButtonClassName:"Button Button--icon Button--flat"})),m("div",{className:"PostUser"},m("h3",null,m(z,{href:Si.route.user(e)},W(e,{className:"PostUser-avatar"}),Be(e),Wt(e))),m("ul",{className:"PostUser-badges badges"},H(e.badges().toArray())),n)},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e),this.$().on("mouseover","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.showCard.bind(i),500)})).on("mouseout","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.hideCard.bind(i),250)}))},n.showCard=function(){var t=this;this.attrs.oncardshow(),setTimeout((function(){return t.$(".UserCard").addClass("in")}))},n.hideCard=function(){var t=this;this.$(".UserCard").removeClass("in").one("transitionend webkitTransitionEnd oTransitionEnd",(function(){t.attrs.oncardhide()}))},e}(A);function Ue(t){var e=Z()(t),n=e.format(),i=e.format("LLLL");return m("time",{pubdate:!0,datetime:n},i)}var qe=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.createdAt(),n=this.getPermalink(t),i="ontouchstart"in document.documentElement;return m("div",{className:"Dropdown PostMeta"},m("a",{className:"Dropdown-toggle",onclick:function(t){var e=this;setTimeout((function(){return $(e).parent().find(".PostMeta-permalink").select()})),t.redraw=!1},"data-toggle":"dropdown"},it(e)),m("div",{className:"Dropdown-menu dropdown-menu"},m("span",{className:"PostMeta-number"},Si.translator.trans("core.forum.post.number_tooltip",{number:t.number()}))," ",m("span",{className:"PostMeta-time"},Ue(e))," ",m("span",{className:"PostMeta-ip"},t.data.attributes.ipAddress),i?m("a",{className:"Button PostMeta-permalink",href:n},n):m("input",{className:"FormControl PostMeta-permalink",value:n,onclick:function(t){return t.stopPropagation()}})))},n.getPermalink=function(t){return window.location.origin+Si.route.post(t)},e}(A),ze=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e)},n.view=function(){var t=this.attrs.post,e=t.editedUser(),n=Si.translator.trans("core.forum.post.edited_tooltip",{user:e,ago:tt(t.editedAt())});return m(bt,{text:n},m("span",{class:"PostEdited"},Si.translator.trans("core.forum.post.edited_text")))},n.oncreate=function(e){t.prototype.oncreate.call(this,e)},e}(A),We=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.revealContent=!1,this.cardVisible=!1,this.subtree.check((function(){return n.cardVisible}),(function(){return n.isEditing()}),(function(){return n.revealContent}))},n.content=function(){return t.prototype.content.call(this).concat([m("header",{className:"Post-header"},m("ul",null,H(this.headerItems().toArray()))),m("div",{className:"Post-body"},this.isEditing()?m(Vt,{className:"Post-preview",composer:Si.composer}):m.trust(this.attrs.post.contentHtml()))])},n.refreshContent=function(){var t=this.isEditing()?"":this.attrs.post.contentHtml();this.contentHtml!==t&&this.$(".Post-body script").each((function(){var t=document.createElement("script");t.textContent=this.textContent,Array.from(this.attributes).forEach((function(e){return t.setAttribute(e.name,e.value)})),this.parentNode.replaceChild(t,this)})),this.contentHtml=t},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.refreshContent()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.refreshContent()},n.isEditing=function(){return Si.composer.bodyMatches(Ee,{post:this.attrs.post})},n.elementAttrs=function(){var e=this.attrs.post,n=t.prototype.elementAttrs.call(this);return n.className=(n.className||"")+" "+L({CommentPost:!0,"Post--renderFailed":e.renderFailed(),"Post--hidden":e.isHidden(),"Post--edited":e.isEdited(),revealContent:this.revealContent,editing:this.isEditing()}),n},n.toggleContent=function(){this.revealContent=!this.revealContent},n.headerItems=function(){var t=this,e=new I,n=this.attrs.post;return e.add("user",Fe.component({post:n,cardVisible:this.cardVisible,oncardshow:function(){t.cardVisible=!0,m.redraw()},oncardhide:function(){t.cardVisible=!1,m.redraw()}}),100),e.add("meta",qe.component({post:n})),n.isEdited()&&!n.isHidden()&&e.add("edited",ze.component({post:n})),n.isHidden()&&e.add("toggle",ht.component({className:"Button Button--default Button--more",icon:"fas fa-ellipsis-h",onclick:this.toggleContent.bind(this)})),e},e}(_e),Ve=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.elementAttrs=function(){var e=t.prototype.elementAttrs.call(this);return e.className=(e.className||"")+" EventPost "+K(this.attrs.post.contentType())+"Post",e},n.content=function(){var e=this.attrs.post.user(),n=Wt(e),i=Object.assign(this.descriptionData(),{user:e,username:e?m(z,{className:"EventPost-user",href:Si.route.user(e)},n):n});return t.prototype.content.call(this).concat([J(this.icon(),{className:"EventPost-icon"}),m("div",{class:"EventPost-info"},this.description(i))])},n.icon=function(){return""},n.description=function(t){return Si.translator.trans(this.descriptionKey(),t)},n.descriptionKey=function(){return""},n.descriptionData=function(){return{}},e}(_e),Ye=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.description=function(t){var e=Si.translator.trans("core.forum.post_stream.discussion_renamed_text",t),n=Si.translator.trans("core.forum.post_stream.discussion_renamed_old_tooltip",t);return m("span",{title:ct(n)},e)},n.descriptionData=function(){var t=this.attrs.post,e=t.content()[0],n=t.content()[1];return{old:e,new:m("strong",{className:"DiscussionRenamedPost-new"},n)}},e}(Ve),Ge=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.hidden=localStorage.getItem("welcomeHidden")},n.view=function(){var t=this;return this.hidden?m("div",null):m("header",{className:"Hero WelcomeHero"},m("div",{class:"container"},ht.component({icon:"fas fa-times",onclick:function(){t.$().slideUp(t.hide.bind(t))},className:"Hero-close Button Button--icon Button--link"}),m("div",{className:"containerNarrow"},m("h2",{className:"Hero-title"},Si.forum.attribute("welcomeTitle")),m("div",{className:"Hero-subtitle"},m.trust(Si.forum.attribute("welcomeMessage"))))))},n.hide=function(){localStorage.setItem("welcomeHidden","true"),this.hidden=!0},e}(A),Ke=function(t){function e(){return t.apply(this,arguments)||this}N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||ct(Si.translator.trans("core.forum.composer_discussion.body_placeholder")),e.submitLabel=e.submitLabel||Si.translator.trans("core.forum.composer_discussion.submit_button"),e.confirmExit=e.confirmExit||ct(Si.translator.trans("core.forum.composer_discussion.discard_confirmation")),e.titlePlaceholder=e.titlePlaceholder||ct(Si.translator.trans("core.forum.composer_discussion.title_placeholder")),e.className="ComposerBody--discussion"};var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.composer.fields.title=this.composer.fields.title||At(""),this.title=this.composer.fields.title},n.headerItems=function(){var e=t.prototype.headerItems.call(this);return e.add("title",m("h3",null,Si.translator.trans("core.forum.composer_discussion.title")),100),e.add("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))),e},n.onkeydown=function(t){13===t.which&&(t.preventDefault(),this.composer.editor.moveCursorTo(0)),t.redraw=!1},n.hasChanges=function(){return this.title()||this.composer.fields.content()},n.data=function(){return{title:this.title(),content:this.composer.fields.content()}},n.onsubmit=function(){var t=this;this.loading=!0;var e=this.data();Si.store.createRecord("discussions").save(e).then((function(e){t.composer.hide(),Si.discussions.refresh({deferClear:!0}),m.route.set(Si.route.discussion(e))}),this.loaded.bind(this))},e}(xt),Xe=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(n){t.prototype.oninit.call(this,n),Si.previous.matches(ie)&&(this.lastDiscussion=Si.previous.get("discussion")),Si.previous.matches(e)&&Si.discussions.clear(),Si.discussions.refreshParams(Si.search.params(),m.route.param("page")),Si.history.push("index",Si.translator.trans("core.forum.header.back_to_index_tooltip")),this.bodyClass="App--index",this.scrollTopOnCreate=!1},n.view=function(){return m("div",{className:"IndexPage"},this.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,H(this.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},H(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},H(this.actionItems().toArray()))),m(Ht,{state:Si.discussions})))))},n.setTitle=function(){Si.setTitle(Si.translator.trans("core.forum.index.meta_title_text")),Si.setTitleCount(0)},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.setTitle();var n=Si.cache.heroHeight,i=Si.cache.heroHeight=this.$(".Hero").outerHeight()||0,r=Si.cache.scrollTop;if($("#app").css("min-height",$(window).height()+i),null!=Si.previous.type&&("desktop"==Si.screen()||"desktop-hd"==Si.screen()||this.lastDiscussion?$(window).scrollTop(r-n+i):$(window).scrollTop(0),this.lastDiscussion)){var o=this.$('li[data-id="'+this.lastDiscussion.id()+'"] .DiscussionListItem');if(o.length){var s=$("#header").outerHeight(),a=$(window).height(),u=o.offset().top,l=u+o.outerHeight();(u<r+s||l>r+a)&&$(window).scrollTop(u-s)}}},n.onbeforeremove=function(e){t.prototype.onbeforeremove.call(this,e),Si.cache.scrollTop=$(window).scrollTop()},n.onremove=function(e){t.prototype.onremove.call(this,e),$("#app").css("min-height","")},n.hero=function(){return Ge.component()},n.sidebarItems=function(){var t=this,e=new I,n=Si.forum.attribute("canStartDiscussion")||!Si.session.user;return e.add("newDiscussion",ht.component({icon:"fas fa-edit",className:"Button Button--primary IndexPage-newDiscussion",itemClassName:"App-primaryControl",onclick:function(){return t.newDiscussionAction().catch((function(){}))},disabled:!n},Si.translator.trans(n?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button"))),e.add("nav",ue.component({buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:Si.translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems(this).toArray())),e},n.navItems=function(){var t=new I,e=Si.search.stickyParams();return t.add("allDiscussions",oe.component({href:Si.route("index",e),icon:"far fa-comments"},Si.translator.trans("core.forum.index.all_discussions_link")),100),t},n.viewItems=function(){var t=new I,e=Si.discussions.sortMap(),n=Object.keys(e).reduce((function(t,e){return t[e]=Si.translator.trans("core.forum.index_sort."+e+"_button"),t}),{});return t.add("sort",nt.component({buttonClassName:"Button",label:n[Si.search.params().sort]||Object.keys(e).map((function(t){return n[t]}))[0],accessibleToggleLabel:Si.translator.trans("core.forum.index_sort.toggle_dropdown_accessible_label")},Object.keys(n).map((function(t){var i=n[t],r=(Si.search.params().sort||Object.keys(e)[0])===t;return ht.component({icon:!r||"fas fa-check",onclick:Si.search.changeSort.bind(Si.search,t),active:r},i)})))),t},n.actionItems=function(){var t=new I;return t.add("refresh",ht.component({title:Si.translator.trans("core.forum.index.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){Si.discussions.refresh(),Si.session.user&&(Si.store.find("users",Si.session.user.id()),m.redraw())}})),Si.session.user&&t.add("markAllAsRead",ht.component({title:Si.translator.trans("core.forum.index.mark_all_as_read_tooltip"),icon:"fas fa-check",className:"Button Button--icon",onclick:this.markAllAsRead.bind(this)})),t},n.newDiscussionAction=function(){return new Promise((function(t,e){return Si.session.user?(Si.composer.load(Ke,{user:Si.session.user}),Si.composer.show(),t(Si.composer)):(Si.modal.show(Dt),e())}))},n.markAllAsRead=function(){confirm(Si.translator.trans("core.forum.index.mark_all_as_read_confirmation"))&&Si.session.user.save({markedAllAsReadAt:new Date})},e}(_);Xe.providesInitialSearch=!0;var Je=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!0,this.moreResults=!1,this.posts=[],this.loadLimit=20,this.loadUser(m.route.param("username"))},n.content=function(){return 0!==this.posts.length||this.loading?(this.loading?t=m(at,null):this.moreResults&&(t=m("div",{className:"PostsUserPage-loadMore"},m(ht,{className:"Button",onclick:this.loadMore.bind(this)},Si.translator.trans("core.forum.user.posts_load_more_button")))),m("div",{className:"PostsUserPage"},m("ul",{className:"PostsUserPage-list"},this.posts.map((function(t){return m("li",null,m("div",{className:"PostsUserPage-discussion"},Si.translator.trans("core.forum.user.in_discussion_text",{discussion:m(z,{href:Si.route.post(t)},t.discussion().title())})),m(We,{post:t}))}))),m("div",{className:"PostsUserPage-loadMore"},t))):m("div",{className:"PostsUserPage"},m(Rt,{text:Si.translator.trans("core.forum.user.posts_empty_text")}));var t},n.show=function(e){t.prototype.show.call(this,e),this.refresh()},n.refresh=function(){this.loading=!0,this.posts=[],m.redraw(),this.loadResults().then(this.parseResults.bind(this))},n.loadResults=function(t){return Si.store.find("posts",{filter:{author:this.user.username(),type:"comment"},page:{offset:t,limit:this.loadLimit},sort:"-createdAt"})},n.loadMore=function(){this.loading=!0,this.loadResults(this.posts.length).then(this.parseResults.bind(this))},n.parseResults=function(t){return this.loading=!1,[].push.apply(this.posts,t),this.moreResults=t.length>=this.loadLimit,m.redraw(),t},e}(je);function Qe(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}function Ze(t,e,n){return e&&Qe(t.prototype,e),n&&Qe(t,n),t}var tn=function(){function t(t,e,n){void 0===t&&(t={}),void 0===e&&(e=1),void 0===n&&(n=20),this.location=void 0,this.pageSize=void 0,this.pages=[],this.params={},this.initialLoading=!1,this.loadingPrev=!1,this.loadingNext=!1,this.params=t,this.location={page:e},this.pageSize=n}var e=t.prototype;return e.clear=function(){this.pages=[],m.redraw()},e.loadPrev=function(){var t=this;if(this.loadingPrev||1===this.getLocation().page)return Promise.resolve();this.loadingPrev=!0;var e=this.getPrevPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingPrev=!1}))},e.loadNext=function(){var t=this;if(this.loadingNext)return Promise.resolve();this.loadingNext=!0;var e=this.getNextPageNumber();return this.loadPage(e).then(this.parseResults.bind(this,e)).finally((function(){return t.loadingNext=!1}))},e.parseResults=function(t,e){var n,i=Number(t),r=(null==(n=e.payload)?void 0:n.links)||{},o={number:i,items:e,hasNext:!!r.next,hasPrev:!!r.prev};this.isEmpty()||i>this.getNextPageNumber()-1?this.pages.push(o):this.pages.unshift(o),this.location={page:i},m.redraw()},e.loadPage=function(t){void 0===t&&(t=1);var e=this.requestParams();return e.page=C({},e.page,{offset:this.pageSize*(t-1)}),Array.isArray(e.include)&&(e.include=e.include.join(",")),y.store.find(this.type,e)},e.requestParams=function(){return this.params},e.refreshParams=function(t,e){if(this.isEmpty()||this.paramsChanged(t))return this.params=t,this.refresh(e)},e.refresh=function(t){var e=this;return void 0===t&&(t=1),this.initialLoading=!0,this.loadingPrev=!1,this.loadingNext=!1,this.clear(),this.location={page:t},this.loadPage().then((function(t){e.pages=[],e.parseResults(e.location.page,t)})).finally((function(){return e.initialLoading=!1}))},e.getPages=function(){return this.pages},e.getLocation=function(){return this.location},e.isLoading=function(){return this.initialLoading||this.loadingNext||this.loadingPrev},e.isInitialLoading=function(){return this.initialLoading},e.isLoadingPrev=function(){return this.loadingPrev},e.isLoadingNext=function(){return this.loadingNext},e.hasItems=function(){return!!this.getAllItems().length},e.isEmpty=function(){return!this.isInitialLoading()&&!this.hasItems()},e.hasPrev=function(){var t;return!(null==(t=this.pages[0])||!t.hasPrev)},e.hasNext=function(){var t;return!(null==(t=this.pages[this.pages.length-1])||!t.hasNext)},e.getParams=function(){return this.params},e.getNextPageNumber=function(){var t,e=null==(t=this.pages[this.pages.length-1])?void 0:t.number;return e&&!isNaN(e)?e+1:this.location.page},e.getPrevPageNumber=function(){var t,e=null==(t=this.pages[0])?void 0:t.number;return e&&!isNaN(e)?Math.max(e-1,1):this.location.page},e.paramsChanged=function(t){var e=this;return Object.keys(t).some((function(n){return e.getParams()[n]!==t[n]}))},e.getAllItems=function(){return this.getPages().map((function(t){return t.items})).flat()},t}();function en(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var nn=function(t){function e(e,n){var i;return void 0===n&&(n=1),(i=t.call(this,e,n,20)||this).extraDiscussions=[],i}N(e,t);var n=e.prototype;return n.requestParams=function(){var t={include:["user","lastPostedUser"],filter:this.params.filter||{}};return t.sort=this.sortMap()[this.params.sort],this.params.q&&(t.filter.q=this.params.q,t.include.push("mostRelevantPost","mostRelevantPost.user")),t},n.loadPage=function(e){void 0===e&&(e=1);var n=Si.preloadedApiDocument();return n?(this.initialLoading=!1,Promise.resolve(n)):t.prototype.loadPage.call(this,e)},n.clear=function(){t.prototype.clear.call(this),this.extraDiscussions=[]},n.sortMap=function(){var t={};return this.params.q&&(t.relevance=""),t.latest="-lastPostedAt",t.top="-commentCount",t.newest="-createdAt",t.oldest="createdAt",t},n.isSearchResults=function(){return!!this.params.q},n.removeDiscussion=function(t){for(var e,n=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return en(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?en(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(this.pages);!(e=n()).done;){var i=e.value,r=i.items.indexOf(t);if(-1!==r){i.items.splice(r,1);break}}var o=this.extraDiscussions.indexOf(t);-1!==o&&this.extraDiscussions.splice(o),m.redraw()},n.addDiscussion=function(t){this.removeDiscussion(t),this.extraDiscussions.unshift(t),m.redraw()},n.getAllItems=function(){return this.extraDiscussions.concat(t.prototype.getAllItems.call(this))},n.getPages=function(){var e=t.prototype.getPages.call(this);return this.extraDiscussions.length?[{number:-1,items:this.extraDiscussions}].concat(e):e},Ze(e,[{key:"type",get:function(){return"discussions"}}]),e}(tn),rn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loadUser(m.route.param("username"))},n.show=function(e){t.prototype.show.call(this,e),this.state=new nn({filter:{author:e.username()},sort:"newest"}),this.state.refresh()},n.content=function(){return m("div",{className:"DiscussionsUserPage"},Ht.component({state:this.state}))},e}(je);const on=function(t,e){return function(){e(this.getAttribute(t)||this[t])}};var sn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(t){"0"===this.attrs.state&&(this.attrs.state=!1);var e=L(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:on("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)},n.getDisplay=function(){return this.attrs.loading?m(at,{display:"unset",size:"small"}):J(this.attrs.state?"fas fa-check":"fas fa-times")},n.onchange=function(t){this.attrs.onchange&&this.attrs.onchange(t,this)},e}(A),an=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=(e.className||"")+" Checkbox--switch"},e.prototype.getDisplay=function(){return this.attrs.loading?t.prototype.getDisplay.call(this):""},e}(sn),un=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(t){return m("fieldset",{className:this.attrs.className},m("legend",null,this.attrs.label),m("ul",null,H(t.children)))},e}(A),ln=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.methods=this.notificationMethods().toArray(),this.loading={},this.types=this.notificationTypes().toArray()},n.view=function(){var t=this,e=this.attrs.user.preferences();return m("table",{className:"NotificationGrid"},m("thead",null,m("tr",null,m("td",null),this.methods.map((function(e){return m("th",{className:"NotificationGrid-groupToggle",onclick:t.toggleMethod.bind(t,e.name)},J(e.icon)," ",e.label)})))),m("tbody",null,this.types.map((function(n){return m("tr",null,m("td",{className:"NotificationGrid-groupToggle",onclick:t.toggleType.bind(t,n.name)},J(n.icon)," ",n.label),t.methods.map((function(i){var r=t.preferenceKey(n.name,i.name);return m("td",{className:"NotificationGrid-checkbox"},m(sn,{state:!!e[r],loading:t.loading[r],disabled:!(r in e),onchange:t.toggle.bind(t,[r])}))})))}))))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$("thead .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){var e=parseInt($(this).index(),10)+1;$(this).parents("table").find("td:nth-child("+e+")").toggleClass("highlighted","mouseenter"===t.type)})),this.$("tbody .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){$(this).parent().find("td").toggleClass("highlighted","mouseenter"===t.type)}))},n.toggle=function(t){var e=this,n=this.attrs.user,i=n.preferences(),r=!i[t[0]];t.forEach((function(t){e.loading[t]=!0,i[t]=r})),m.redraw(),n.save({preferences:i}).then((function(){t.forEach((function(t){return e.loading[t]=!1})),m.redraw()}))},n.toggleMethod=function(t){var e=this,n=this.types.map((function(n){return e.preferenceKey(n.name,t)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.toggleType=function(t){var e=this,n=this.methods.map((function(n){return e.preferenceKey(t,n.name)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.preferenceKey=function(t,e){return"notify_"+t+"_"+e},n.notificationMethods=function(){var t=new I;return t.add("alert",{name:"alert",icon:"fas fa-bell",label:Si.translator.trans("core.forum.settings.notify_by_web_heading")}),t.add("email",{name:"email",icon:"far fa-envelope",label:Si.translator.trans("core.forum.settings.notify_by_email_heading")}),t},n.notificationTypes=function(){var t=new I;return t.add("discussionRenamed",{name:"discussionRenamed",icon:"fas fa-pencil-alt",label:Si.translator.trans("core.forum.settings.notify_discussion_renamed_label")}),t},e}(A),cn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.className=function(){return"ChangePasswordModal Modal--small"},n.title=function(){return Si.translator.trans("core.forum.change_password.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},Si.translator.trans("core.forum.change_password.text")),m("div",{className:"Form-group"},ht.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.change_password.send_button")))))},n.onsubmit=function(t){t.preventDefault(),this.loading=!0,Si.request({method:"POST",url:Si.forum.attribute("apiUrl")+"/forgot",body:{email:Si.session.user.email()}}).then(this.hide.bind(this),this.loaded.bind(this))},e}(Tt),dn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.success=!1,this.email=At(Si.session.user.email()),this.password=At("")},n.className=function(){return"ChangeEmailModal Modal--small"},n.title=function(){return Si.translator.trans("core.forum.change_email.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},Si.translator.trans("core.forum.change_email.confirmation_message",{email:m("strong",null,this.email())})),m("div",{className:"Form-group"},m(ht,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},Si.translator.trans("core.forum.change_email.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{type:"email",name:"email",className:"FormControl",placeholder:Si.session.user.email(),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},m("input",{type:"password",name:"password",className:"FormControl",autocomplete:"current-password",placeholder:Si.translator.trans("core.forum.change_email.confirm_password_placeholder"),bidi:this.password,disabled:this.loading})),m("div",{className:"Form-group"},ht.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},Si.translator.trans("core.forum.change_email.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.email()!==Si.session.user.email()?(this.loading=!0,this.alertAttrs=null,Si.session.user.save({email:this.email()},{errorHandler:this.onerror.bind(this),meta:{password:this.password()}}).then((function(){e.success=!0})).catch((function(){})).then(this.loaded.bind(this))):this.hide()},n.onerror=function(e){401===e.status&&(e.alert.content=Si.translator.trans("core.forum.change_email.incorrect_password_message")),t.prototype.onerror.call(this,e)},e}(Tt),hn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.show(Si.session.user),Si.setTitle(Si.translator.trans("core.forum.settings.title"))},n.content=function(){return m("div",{className:"SettingsPage"},m("ul",null,H(this.settingsItems().toArray())))},n.settingsItems=function(){var t=this,e=new I;return["account","notifications","privacy"].forEach((function(n){e.add(n,m(un,{className:"Settings-"+n,label:Si.translator.trans("core.forum.settings."+n+"_heading")},t[n+"Items"]().toArray()))})),e},n.accountItems=function(){var t=new I;return t.add("changePassword",m(ht,{className:"Button",onclick:function(){return Si.modal.show(cn)}},Si.translator.trans("core.forum.settings.change_password_button"))),t.add("changeEmail",m(ht,{className:"Button",onclick:function(){return Si.modal.show(dn)}},Si.translator.trans("core.forum.settings.change_email_button"))),t},n.notificationsItems=function(){var t=new I;return t.add("notificationGrid",m(ln,{user:this.user})),t},n.privacyItems=function(){var t=this,e=new I;return e.add("discloseOnline",m(an,{state:this.user.preferences().discloseOnline,onchange:function(e){t.discloseOnlineLoading=!0,t.user.savePreferences({discloseOnline:e}).then((function(){t.discloseOnlineLoading=!1,m.redraw()}))},loading:this.discloseOnlineLoading},Si.translator.trans("core.forum.settings.privacy_disclose_online_label"))),e},e}(je),fn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),Si.history.push("notifications"),Si.notifications.load(),this.bodyClass="App--notifications"},n.view=function(){return m("div",{className:"NotificationsPage"},m(pe,{state:Si.notifications}))},e}(_),pn=function(){function t(t,e){this.component=void 0,this.routeName=void 0,this.component=t,this.routeName=e}var e=t.prototype;return e.makeKey=function(){return this.routeName+JSON.stringify(m.route.param())},e.makeAttrs=function(t){return C({},t.attrs,{routeName:this.routeName})},e.onmatch=function(t,e,n){return this.component},e.render=function(t){return[C({},t,{attrs:this.makeAttrs(t),key:this.makeKey()})]},t}(),mn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.canonicalizeDiscussionSlug=function(t){if(t)return t.split("-")[0]},n.makeKey=function(){var t=C({},m.route.param());return"near"in t&&delete t.near,t.id=this.canonicalizeDiscussionSlug(t.id),this.routeName.replace(".near","")+JSON.stringify(t)},n.onmatch=function(n,i,r){return Si.current.matches(ie)&&this.canonicalizeDiscussionSlug(n.id)===this.canonicalizeDiscussionSlug(m.route.param("id"))&&(e.scrollToPostNumber=n.near||"1"),t.prototype.onmatch.call(this,n,i,r)},n.render=function(n){if(null!==e.scrollToPostNumber){var i=e.scrollToPostNumber;setTimeout((function(){return Si.current.get("stream").goToNumber(i)})),e.scrollToPostNumber=null}return t.prototype.render.call(this,n)},e}(pn);function vn(t){t.routes={index:{path:"/all",component:Xe},discussion:{path:"/d/:id",component:ie,resolverClass:mn},"discussion.near":{path:"/d/:id/:near",component:ie,resolverClass:mn},user:{path:"/u/:username",component:Je},"user.posts":{path:"/u/:username",component:Je},"user.discussions":{path:"/u/:username/discussions",component:rn},settings:{path:"/settings",component:hn},notifications:{path:"/notifications",component:fn}},t.route.discussion=function(e,n){return t.route(n&&1!==n?"discussion.near":"discussion",{id:e.slug(),near:n&&1!==n?n:void 0})},t.route.post=function(e){return t.route.discussion(e.discussion(),e.number())},t.route.user=function(e){return t.route("user",{username:e.slug()})}}function gn(t){var e=t.session.user;if(e&&!e.isEmailConfirmed()){var n=function(n){function i(){return n.apply(this,arguments)||this}N(i,n);var r=i.prototype;return r.oninit=function(t){n.prototype.oninit.call(this,t),this.loading=!1,this.sent=!1},r.view=function(){return m(ht,{class:"Button Button--link",onclick:this.onclick.bind(this),loading:this.loading,disabled:this.sent},this.sent?[J("fas fa-check")," ",t.translator.trans("core.forum.user_email_confirmation.sent_message")]:t.translator.trans("core.forum.user_email_confirmation.resend_button"))},r.onclick=function(){var n=this;this.loading=!0,m.redraw(),t.request({method:"POST",url:t.forum.attribute("apiUrl")+"/users/"+e.id()+"/send-confirmation"}).then((function(){n.loading=!1,n.sent=!0,m.redraw()})).catch((function(){n.loading=!1,m.redraw()}))},i}(A),i=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return C({},n,{children:[m("div",{className:"container"},n.children)]})},e}(St);m.mount($("<div/>").insertBefore("#content")[0],{view:function(){return m(i,{dismissible:!1,controls:[m(n,null)]},t.translator.trans("core.forum.user_email_confirmation.alert_message",{email:m("strong",null,e.email())}))}})}}mn.scrollToPostNumber=null;var yn,bn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state.modal;return m("div",{className:"ModalManager modal fade"},!!t&&t.componentClass.component(C({},t.attrs,{animateShow:this.animateShow.bind(this),animateHide:this.animateHide.bind(this),state:this.attrs.state})))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$().on("hidden.bs.modal",this.attrs.state.close.bind(this.attrs.state))},n.animateShow=function(t){if(this.attrs.state.modal){var e=!!this.attrs.state.modal.componentClass.isDismissible;this.$().hasClass("in")?t():this.$().one("shown.bs.modal",t).modal({backdrop:e||"static",keyboard:e}).modal("show")}},n.animateHide=function(){this.$().modal("hide")},e}(A),wn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state},n.view=function(){var t=this;return m("div",{className:"AlertManager"},Object.entries(this.state.getActiveAlerts()).map((function(e){var n=e[0],i=e[1];return m("div",{className:"AlertManager-alert"},m(i.componentClass,Object.assign({},i.attrs,{ondismiss:t.state.dismiss.bind(t.state,n)}),i.children))})))},e}(A),xn=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.className=function(){return"RequestErrorModal Modal--large"},n.title=function(){return this.attrs.error.xhr?this.attrs.error.xhr.status+" "+this.attrs.error.xhr.statusText:""},n.content=function(){var t,e=this.attrs,n=e.error,i=e.formattedError;if(i)t=i.join("\n\n");else try{var r=n.response||JSON.parse(n.responseText);t=JSON.stringify(r,null,2)}catch(e){t=n.responseText}return m("div",{className:"Modal-body"},m("pre",null,this.attrs.error.options.method," ",this.attrs.error.options.url,m("br",null),m("br",null),t))},e}(Tt);function Nn(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cn(t){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Cn(t)}function Sn(t,e){if(e&&("object"===Cn(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return w(t)}function Tn(t){return Tn=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},Tn(t)}function kn(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}function An(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var i,r,o=[],s=!0,a=!1;try{for(n=n.call(t);!(s=(i=n.next()).done)&&(o.push(i.value),!e||o.length!==e);s=!0);}catch(t){a=!0,r=t}finally{try{s||null==n.return||n.return()}finally{if(a)throw r}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return kn(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?kn(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function En(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Pn(t){return t.reduce((function(t,e){return t.concat(Array.isArray(e)?Pn(e):e)}),[])}function _n(t){var e={};return function(){for(var n=arguments.length,i=new Array(n),r=0;r<n;r++)i[r]=arguments[r];var o=i.length?i.map((function(t){return null===t?"null":void 0===t?"undefined":"function"==typeof t?t.toString():t instanceof Date?t.toISOString():JSON.stringify(t)})).join("|"):"_(no-args)_";if(Object.prototype.hasOwnProperty.call(e,o))return e[o];var s=t.apply(void 0,i);return e[o]=s,s}}function Dn(t){for(var e=function(t){return/\s/.test(t)},n=[],i={},r=0,o=null,s=!1,a=0;a<t.length;){if(s&&(e(t[a])||"{"===t[a]))s=!1,o=t.slice(r,a),"{"===t[a]&&a--;else if(!s&&!e(t[a])){var u="{"===t[a];if(o&&u){var l=$n(t,a);if(-1===l)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));i[o]=t.slice(a+1,l),a=l,o=null}else o&&(n.push(o),o=null),s=!0,r=a}a++}return s&&(o=t.slice(r)),o&&n.push(o),{args:n,cases:i}}function $n(t,e){for(var n=0,i=e+1;i<t.length;i++){var r=t.charAt(i);if("}"===r){if(0===n)return i;n--}else"{"===r&&n++}return-1}function In(t){return On(t.slice(1,-1),",",3)}function On(t,e,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];if(!t)return i;if(1===n)return i.push(t),i;var r=t.indexOf(e);if(-1===r)return i.push(t),i;var o=t.substring(0,r).trim(),s=t.substring(r+e.length+1).trim();return i.push(o),On(s,e,n-1,i)}function Mn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function jn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Mn(Object(n),!0).forEach((function(e){En(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Mn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}var Ln=0,Rn="other";function Hn(t,e){for(var n=0,i="",r=0,o={};n<t.length;){if("#"!==t[n]||r)i+=t[n];else{var s="__hashToken".concat(Ln++);i+="{".concat(s,", number}"),o[s]=e}"{"===t[n]?r++:"}"===t[n]&&r--,n++}return{caseBody:i,numberValues:o}}function Bn(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=Dn(e),s=o.args,a=o.cases,u=parseInt(t);s.forEach((function(t){t.startsWith("offset:")&&(u-=parseInt(t.slice("offset:".length)))}));var l=[];if("PluralRules"in Intl){void 0!==yn&&yn.resolvedOptions().locale===n||(yn=new Intl.PluralRules(n));var c=yn.select(u);c!==Rn&&l.push(c)}1===u&&l.push("one"),l.push("=".concat(u),Rn);for(var d=0;d<l.length;d++){var h=l[d];if(h in a){var f=Hn(a[h],u),p=f.caseBody,m=f.numberValues;return r(p,jn(jn({},i),m))}}return t}var Fn="other";function Un(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=Dn(e),o=r.cases;return t in o?i(o[t],n):Fn in o?i(o.other,n):t}function qn(t,e,n){return"<".concat(t,">").concat(n,"</").concat(t,">")}function zn(t,e,n){var i=[];return Wn(t,0,0,i,(function(r,o,s,a,u,l){if(o)return{break:!0};var c=function(t,e,n,i){var r,o=1;return Wn(t,n,i,[],(function(t,n,i,s,a,u){return i===e&&(n?o--:o++,0===o)?(r={segmentIndex:s,segmentStart:u,segmentEnd:a},{exit:!0}):{exit:!1}})),r}(t,s,a,u);if(!c)throw new Error("Unbalanced tags: no closing tag found for <".concat(s,">"));var d=c.segmentIndex===a,h=t[c.segmentIndex],f=[];if(d)f.push(r.slice(u+1,c.segmentStart));else{f.push(r.slice(u+1));for(var p=a+1;p<c.segmentIndex;p++)f.push(t[p]);f.push(h.slice(0,c.segmentStart))}return i.push(r.slice(0,l)),i.push(n(s,e,zn(f.filter((function(t){return""!==t})),e,n))),t.splice(c.segmentIndex+1,0,h.slice(c.segmentEnd+1)),{processedSegment:!0,newSegmentIndex:c.segmentIndex,break:!0}})),i.filter((function(t){return""!==t}))}function Wn(t,e,n,i,r){for(var o,s=e;s<t.length;s++){var a=t[s];if("string"==typeof a){for(var u=!1,l=null,c=!1,d=!1,h=s===e?n:0;h<a.length;h++)if(c||"<"!==a[h])if(c&&">"===a[h]){var f=a.slice(l+1+u,h),p=r(a,u,f,s,h,l);if(p.exit)return;if(p.newSegmentIndex&&(s=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;u=!1,l=null,c=!1}else c&&(o=a[h],!/[a-zA-Z-_]/.test(o))&&(u=!1,l=null,c=!1);else l=h,c=!0,"/"===a[h+1]&&(u=!0,h++);d||i.push(a)}else i.push(a)}}function Vn(t){return Object.keys(t).reduce((function(e,n){return e[n]=Yn(t[n]),e}),{})}function Yn(t){return"string"==typeof t||t instanceof String?t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'"):Array.isArray(t)?t.map(Yn):t}var Gn=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&x(t,e)}(r,t);var e,n,i=(e=r,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,i=Tn(e);if(n){var r=Tn(this).constructor;t=Reflect.construct(i,arguments,r)}else t=i.apply(this,arguments);return Sn(this,t)});function r(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Nn(this,r),(e=i.call(this,t,n)).richHandler=o||qn,e}return Ze(r,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Vn(e),i=Pn(this.process(t,n));return zn(i,n,this.richHandler)}}]),r}(function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Nn(this,t),En(this,"format",_n((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Pn(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=i}return Ze(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var i=$n(t,n);if(-1===i)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var r=t.substring(n,i+1);if(r){var o=[],s=t.substring(0,n);s&&o.push(s);var a=In(r),u=An(a,3),l=u[0],c=u[1],d=u[2],h=e[l];null==h&&(h="");var f=c&&this.typeHandlers[c];o.push(f?f(h,d,this.locale,e,this.process.bind(this)):h);var p=t.substring(i+1);return p&&o.push(this.process(p,e)),o}}return[t]}}]),t}());function Kn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function Xn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Kn(Object(n),!0).forEach((function(e){En(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Kn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Jn(t,e,n){var i=e[t]||m(t),r=m.fragment(n).children;return Xn(Xn({},i),{},{children:r})}var Qn=function(){function t(){this.translations={},this.formatter=new Gn(null,this.formatterTypeHandlers(),Jn)}var e=t.prototype;return e.setLocale=function(t){this.formatter.locale=t},e.addTranslations=function(t){Object.assign(this.translations,t)},e.formatterTypeHandlers=function(){return{plural:Bn,select:Un}},e.preprocessParameters=function(t){if("user"in t){var e=U(t,"user");t.username||(t.username=Wt(e))}return t},e.trans=function(t,e){void 0===e&&(e={});var n=this.translations[t];return n?(e=this.preprocessParameters(e),this.formatter.rich(n,e)):t},t}(),Zn=function(){function t(t){this.data={},this.models=t}var e=t.prototype;return e.pushPayload=function(t){t.included&&t.included.map(this.pushObject.bind(this));var e=t.data instanceof Array?t.data.map(this.pushObject.bind(this)):this.pushObject(t.data);return e.payload=t,e},e.pushObject=function(t){if(!this.models[t.type])return null;var e=this.data[t.type]=this.data[t.type]||{};return e[t.id]?e[t.id].pushData(t):e[t.id]=this.createRecord(t.type,t),e[t.id].exists=!0,e[t.id]},e.find=function(t,e,n,i){void 0===n&&(n={}),void 0===i&&(i={});var r=n,o=y.forum.attribute("apiUrl")+"/"+t;return e instanceof Array?o+="?filter[id]="+e.join(","):"object"==typeof e?r=e:e&&(o+="/"+e),y.request(Object.assign({method:"GET",url:o,params:r},i)).then(this.pushPayload.bind(this))},e.getById=function(t,e){return this.data[t]&&this.data[t][e]},e.getBy=function(t,e,n){return this.all(t).filter((function(t){return t[e]()===n}))[0]},e.all=function(t){var e=this.data[t];return e?Object.keys(e).map((function(t){return e[t]})):[]},e.remove=function(t){delete this.data[t.data.type][t.id()]},e.createRecord=function(t,e){return void 0===e&&(e={}),e.type=e.type||t,new this.models[t](e,this)},t}(),ti=function(){function t(t,e){this.user=t,this.csrfToken=e}var e=t.prototype;return e.login=function(t,e){return void 0===e&&(e={}),y.request(Object.assign({method:"POST",url:y.forum.attribute("baseUrl")+"/login",body:t},e))},e.logout=function(){window.location=y.forum.attribute("baseUrl")+"/logout?token="+this.csrfToken},t}(),ei=function(){function t(){var t=this;$("#content").click((function(e){t.isOpen()&&(e.preventDefault(),t.hide())}))}var e=t.prototype;return e.isOpen=function(){return $("#app").hasClass("drawerOpen")},e.hide=function(){var t=$("#app");if(t.hasClass("drawerOpen")){var e=$("#drawer");e.css("visibility","visible").one("transitionend",(function(){return e.css("visibility","")})),t.removeClass("drawerOpen"),this.$backdrop&&this.$backdrop.remove()}},e.show=function(){var t=this;$("#app").addClass("drawerOpen"),this.$backdrop=$("<div/>").addClass("drawer-backdrop fade").appendTo("body").click((function(){return t.hide()})),setTimeout((function(){return t.$backdrop.addClass("in")}))},t}();function ni(t,e){void 0===e&&(e="");var n={};for(var i in t){var r=t[i];if("resolver"in r)n[e+r.path]=r.resolver;else{if(!("component"in r))throw new Error("Either a resolver or a component must be provided for the route ["+i+"]");var o="resolverClass"in r?r.resolverClass:pn;n[e+r.path]=new o(r.component,i)}}return n}var ii=function(t,e,n,i){this.status=void 0,this.options=void 0,this.xhr=void 0,this.responseText=void 0,this.response=void 0,this.alert=void 0,this.status=t,this.responseText=e,this.options=n,this.xhr=i;try{this.response=JSON.parse(null!=e?e:"null")}catch(t){this.response=null}this.alert=null};function ri(){$("[data-humantime]").each((function(){var t=$(this),e=tt(t.attr("datetime"));t.html(e)}))}function oi(){setInterval(ri,1e4)}function si(t,e,n){(Array.isArray(e)?e:[e]).forEach((function(e){var i=t[e];t[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var o=i?i.apply(this,e):void 0;return n.apply(this,[o].concat(e)),o},Object.assign(t[e],i)}))}function ai(t,e,n){(Array.isArray(e)?e:[e]).forEach((function(e){var i=t[e];t[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return n.apply(this,[i.bind(this)].concat(e))},Object.assign(t[e],i)}))}var ui=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.apiEndpoint=function(){return"/"},e}(le);function li(t){for(var e=0,n=0;n<t.length;n++)e+=t.charCodeAt(n);var i=function(t,e,n){var i,r,o,s=Math.floor(6*t),a=6*t-s,u=.63,l=n*(1-.3*a),c=n*(1-.3*(1-a));switch(s%6){case 0:i=n,r=c,o=u;break;case 1:i=l,r=n,o=u;break;case 2:i=u,r=n,o=c;break;case 3:i=u,r=l,o=n;break;case 4:i=c,r=u,o=n;break;case 5:i=n,r=u,o=l}return{r:Math.floor(255*i),g:Math.floor(255*r),b:Math.floor(255*o)}}(e%360/360,0,.9);return""+i.r.toString(16)+i.g.toString(16)+i.b.toString(16)}var ci=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(le);Object.assign(ci.prototype,{username:le.attribute("username"),slug:le.attribute("slug"),displayName:le.attribute("displayName"),email:le.attribute("email"),isEmailConfirmed:le.attribute("isEmailConfirmed"),password:le.attribute("password"),avatarUrl:le.attribute("avatarUrl"),preferences:le.attribute("preferences"),groups:le.hasMany("groups"),joinTime:le.attribute("joinTime",le.transformDate),lastSeenAt:le.attribute("lastSeenAt",le.transformDate),markedAllAsReadAt:le.attribute("markedAllAsReadAt",le.transformDate),unreadNotificationCount:le.attribute("unreadNotificationCount"),newNotificationCount:le.attribute("newNotificationCount"),discussionCount:le.attribute("discussionCount"),commentCount:le.attribute("commentCount"),canEdit:le.attribute("canEdit"),canEditCredentials:le.attribute("canEditCredentials"),canEditGroups:le.attribute("canEditGroups"),canDelete:le.attribute("canDelete"),avatarColor:null,color:ce("displayName","avatarUrl","avatarColor",(function(t,e,n){return n?"rgb("+n.join(", ")+")":e?(this.calculateAvatarColor(),""):"#"+li(t)})),isOnline:function(){return dayjs().subtract(5,"minutes").isBefore(this.lastSeenAt())},badges:function(){var t=new I,e=this.groups();return e&&e.forEach((function(e){t.add("group"+e.id(),De.component({group:e}))})),t},calculateAvatarColor:function(){var t=new Image,e=this;t.onload=function(){try{var t=new ColorThief;e.avatarColor=t.getColor(this)}catch(t){if(!(t instanceof TypeError))throw t;e.avatarColor=[255,255,255]}e.freshness=new Date,m.redraw()},t.crossOrigin="anonymous",t.src=this.avatarUrl()},savePreferences:function(t){var e=this.preferences();return Object.assign(e,t),this.save({preferences:e})}});var di=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(le);Object.assign(di.prototype,{number:le.attribute("number"),discussion:le.hasOne("discussion"),createdAt:le.attribute("createdAt",le.transformDate),user:le.hasOne("user"),contentType:le.attribute("contentType"),content:le.attribute("content"),contentHtml:le.attribute("contentHtml"),renderFailed:le.attribute("renderFailed"),contentPlain:ce("contentHtml",G),editedAt:le.attribute("editedAt",le.transformDate),editedUser:le.hasOne("editedUser"),isEdited:ce("editedAt",(function(t){return!!t})),hiddenAt:le.attribute("hiddenAt",le.transformDate),hiddenUser:le.hasOne("hiddenUser"),isHidden:ce("hiddenAt",(function(t){return!!t})),canEdit:le.attribute("canEdit"),canHide:le.attribute("canHide"),canDelete:le.attribute("canDelete")});var hi=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(le);Object.assign(hi.prototype,{contentType:le.attribute("contentType"),content:le.attribute("content"),createdAt:le.attribute("createdAt",le.transformDate),isRead:le.attribute("isRead"),user:le.hasOne("user"),fromUser:le.hasOne("fromUser"),subject:le.hasOne("subject")});var fi=function(){function t(){this.modal=null,this.closeTimeout=void 0}var e=t.prototype;return e.show=function(t,e){if(void 0===e&&(e={}),!(t.prototype instanceof Tt)){var n="The ModalManager can only show Modals.";throw console.error(n),new Error(n)}clearTimeout(this.closeTimeout),this.modal={componentClass:t,attrs:e},m.redraw.sync()},e.close=function(){var t=this;this.modal&&(this.closeTimeout=setTimeout((function(){t.modal=null,m.redraw()})))},e.isModalOpen=function(){return!!this.modal},t}(),pi=function(){function t(){this.activeAlerts={},this.alertId=0}var e=t.prototype;return e.getActiveAlerts=function(){return this.activeAlerts},e.show=function(t,e,n){var i,r=St,o={};return 1==arguments.length?i=t:2==arguments.length?(o=t,i=e):3==arguments.length&&(r=t,o=e,i=n),this.activeAlerts[++this.alertId]={children:i,attrs:o,componentClass:r},m.redraw(),this.alertId},e.dismiss=function(t){t&&t in this.activeAlerts&&(delete this.activeAlerts[t],m.redraw())},e.clear=function(){this.activeAlerts={},m.redraw()},t}();function mi(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n<e;n++)i[n]=t[n];return i}var vi=function(){function t(){this.forum=void 0,this.routes={},this.initializers=new I,this.session=void 0,this.translator=new Qn,this.store=new Zn({forums:ui,users:ci,discussions:fe,posts:di,groups:Ie,notifications:hi}),this.cache={},this.booted=!1,this.current=new P(null),this.previous=new P(null),this.modal=new fi,this.alerts=new pi,this.drawer=void 0,this.data=void 0,this._title="",this._titleCount=0,this.requestErrorAlert=null,this.initialRoute=void 0}var e=t.prototype;return e.load=function(t){this.data=t,this.translator.setLocale(t.locale)},e.boot=function(){var t=this;this.initializers.toArray().forEach((function(e){return e(t)})),this.store.pushPayload({data:this.data.resources}),this.forum=this.store.getById("forums",1),this.session=new ti(this.store.getById("users",this.data.session.userId),this.data.session.csrfToken),this.mount(),this.initialRoute=window.location.href},e.bootExtensions=function(t){var e=this;Object.keys(t).forEach((function(n){var i=t[n];if(i.extend)for(var r,o=function(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(t){if("string"==typeof t)return mi(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?mi(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(i.extend.flat(1/0));!(r=o()).done;)r.value.extend(e,{name:n,exports:i})}))},e.mount=function(t){var e=this;void 0===t&&(t=""),m.mount(document.getElementById("modal"),{view:function(){return bn.component({state:e.modal})}}),m.mount(document.getElementById("alerts"),{view:function(){return wn.component({state:e.alerts})}}),this.drawer=new ei,m.route(document.getElementById("content"),t+"/",ni(this.routes,t));var n=document.getElementById("app"),i=document.querySelector(".App-header"),r=new qt((function(t){var e=n.getBoundingClientRect().top+document.body.scrollTop;n.classList.toggle("affix",t>=e),n.classList.toggle("scrolled",t>e),i.classList.toggle("navbar-fixed-top",t>=e)}));r.start(),r.update(),document.body.classList.add("ontouchstart"in window?"touch":"no-touch"),oi()},e.preloadedApiDocument=function(){if(this.data.apiDocument&&window.location.href===this.initialRoute){var t=this.store.pushPayload(this.data.apiDocument);return this.data.apiDocument=null,t}return null},e.screen=function(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")},e.setTitle=function(t){this.title=t,this.updateTitle()},e.setTitleCount=function(t){this.titleCount=t,this.updateTitle()},e.updateTitle=function(){var t=this.titleCount?"("+this.titleCount+") ":"",e=this.title&&m.route.get()!==this.forum.attribute("basePath")+"/"?this.title+" - ":"",n=this.forum.attribute("title");document.title=t+e+n},e.request=function(t){var e=this,n=C({},t);if(n.background||(n.background=!0),si(n,"config",(function(t,n){n.setRequestHeader("X-CSRF-Token",e.session.csrfToken)})),n.method&&!["GET","POST"].includes(n.method)){var i=n.method;si(n,"config",(function(t,e){e.setRequestHeader("X-HTTP-Method-Override",i)})),n.method="POST"}n.deserialize||(n.deserialize=function(t){return t}),n.errorHandler||(n.errorHandler=function(t){throw t});var r=n.modifyText||n.extract;return n.extract=function(t){var e;e=r?r(t.responseText):t.responseText||null;var i=t.status;if(i<200||i>299)throw new ii(""+i,""+e,n,t);if(t.getResponseHeader){var o=t.getResponseHeader("X-CSRF-Token");o&&(y.session.csrfToken=o)}try{return JSON.parse(e)}catch(i){throw new ii("500",""+e,n,t)}},this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(n).then((function(t){return t}),(function(t){var i;switch(t.status){case 422:i=t.response.errors.map((function(t){return[t.detail,m("br",null)]})).flat().slice(0,-1);break;case 401:case 403:i=y.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:i=y.translator.trans("core.lib.error.not_found_message");break;case 413:i=y.translator.trans("core.lib.error.payload_too_large_message");break;case 429:i=y.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:i=y.translator.trans("core.lib.error.generic_message")}var r=y.forum.attribute("debug"),o=t.response&&t.response.errors,s=Array.isArray(o)&&o[0]&&o[0].detail&&o.map((function(t){return decodeURI(t.detail)}));t.alert={type:"error",content:i,controls:r&&[m(ht,{className:"Button Button--link",onclick:e.showDebug.bind(e,t,s)},y.translator.trans("core.lib.debug_button"))]};try{n.errorHandler(t)}catch(t){if(r&&t.xhr){var a,u=t.options,l=u.method,c=u.url,d=t.xhr.status,h=void 0===d?"":d;console.group(l+" "+c+" "+h),(a=console).error.apply(a,s||[t]),console.groupEnd()}e.requestErrorAlert=e.alerts.show(t.alert,t.alert.content)}return Promise.reject(t)}))},e.showDebug=function(t,e){null!==this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),this.modal.show(xn,{error:t,formattedError:e})},e.route=function(t,e){void 0===e&&(e={});var n=this.routes[t];if(!n)throw new Error("Route '"+t+"' does not exist");var i=n.path.replace(/:([^\/]+)/g,(function(t,n){return""+U(e,n)}));for(var r in e)e.hasOwnProperty(r)&&!e[r]&&delete e[r];var o=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+i+(o?"?"+o:"")},Ze(t,[{key:"title",get:function(){return this._title},set:function(t){this._title=t}},{key:"titleCount",get:function(){return this._titleCount},set:function(t){this._titleCount=t}}]),t}(),gi=function(t){function e(){return t.apply(this,arguments)||this}N(e,t);var n=e.prototype;return n.view=function(){var t=y.history,e=y.pane;return m("div",{className:"Navigation ButtonGroup "+(this.attrs.className||""),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())},n.getBackButton=function(){var t=y.history,e=t.getPrevious()||{};return oe.component({className:"Button Navigation-back Button--icon",href:t.backUrl(),icon:"fas fa-chevron-left",title:e.title,onclick:function(e){e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),t.back())}})},n.getPaneButton=function(){var t=y.pane;return t&&t.active?ht.component({className:"Button Button--icon Navigation-pin"+(t.pinned?" active":""),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):""},n.getDrawerButton=function(){if(!this.attrs.drawer)return"";var t=y.drawer,e=y.session.user;return ht.component({className:"Button Button--icon Navigation-drawer"+(e&&e.newNotificationCount()?" new":""),onclick:function(e){e.stopPropagation(),t.show()},icon:"fas fa-bars","aria-label":y.translator.trans("core.lib.nav.drawer_button")})},e}(A),yi=function(t){function e(){return t.call(this,{},1,10)||this}N(e,t);var n=e.prototype;return n.load=function(){return Si.session.user.newNotificationCount()&&(this.pages=[],this.location={page:1}),this.pages.length>0?Promise.resolve():(Si.session.user.pushAttributes({newNotificationCount:0}),t.prototype.loadNext.call(this))},n.markAllAsRead=function(){if(0!==this.pages.length)return Si.session.user.pushAttributes({unreadNotificationCount:0}),this.pages.forEach((function(t){t.items.forEach((function(t){return t.pushAttributes({isRead:!0})}))})),Si.request({url:Si.forum.attribute("apiUrl")+"/notifications/read",method:"POST"})},Ze(e,[{key:"type",get:function(){return"notifications"}}]),e}(tn),bi=function(){function t(t){void 0===t&&(t=[]),this.cachedSearches=void 0,this.value="",this.cachedSearches=new Set(t)}var e=t.prototype;return e.getInitialSearch=function(){return""},e.getValue=function(){return this.value},e.setValue=function(t){this.value=t},e.clear=function(){this.setValue("")},e.cache=function(t){this.cachedSearches.add(t)},e.isCached=function(t){return this.cachedSearches.has(t)},t}(),wi=["q"],xi=function(t){function e(e){var n;return void 0===e&&(e=[]),(n=t.call(this,e)||this).initialValueSet=!1,n}N(e,t);var n=e.prototype;return n.getValue=function(){return!this.initialValueSet&&this.currPageProvidesSearch()&&this.intializeValue(),t.prototype.getValue.call(this)},n.intializeValue=function(){this.setValue(this.getInitialSearch()),this.initialValueSet=!0},n.currPageProvidesSearch=function(){return Si.current.type&&Si.current.type.providesInitialSearch},n.getInitialSearch=function(){return this.currPageProvidesSearch()?this.params().q:""},n.clear=function(){t.prototype.clear.call(this),this.getInitialSearch()?this.clearInitialSearch():m.redraw()},n.clearInitialSearch=function(){var t=this.params(),e=(t.q,F(t,wi));S(Si.route(Si.current.get("routeName"),e))},n.stickyParams=function(){return{sort:m.route.param("sort"),q:m.route.param("q")}},n.params=function(){var t=this.stickyParams();return t.filter=m.route.param("filter"),t},n.changeSort=function(t){var e=this.params();t===Object.keys(Si.discussions.sortMap())[0]?delete e.sort:e.sort=t,S(Si.route(Si.current.get("routeName"),e))},e}(bi),Ni=function(t){function e(){var e;return(e=t.call(this)||this).notificationComponents={discussionRenamed:ke},e.postComponents={comment:We,discussionRenamed:Ye},e.pane=null,e.history=new T,e.notifications=new yi,e.search=new xi,e.composer=new Ce,e.discussions=new nn({}),vn(w(e)),e}N(e,t);var n=e.prototype;return n.mount=function(){var e=this,n=this.forum.attribute("defaultRoute"),i="index";for(var r in this.routes)this.routes[r].path===n&&(i=r);this.routes[i].path="/",this.history.push(i,this.translator.trans("core.forum.header.back_to_index_tooltip"),"/"),this.pane=new k(document.getElementById("app")),m.route.prefix="",t.prototype.mount.call(this,this.forum.attribute("basePath")),m.mount(document.getElementById("app-navigation"),{view:function(){return gi.component({className:"App-backControl",drawer:!0})}}),m.mount(document.getElementById("header-navigation"),gi),m.mount(document.getElementById("header-primary"),re),m.mount(document.getElementById("header-secondary"),we),m.mount(document.getElementById("composer"),{view:function(){return Se.component({state:e.composer})}}),gn(this),document.getElementById("home-link").addEventListener("click",(function(t){t.ctrlKey||t.metaKey||2===t.which||(t.preventDefault(),Si.history.home(),Si.session.user&&(Si.store.find("users",Si.session.user.id()),m.redraw()))})),"ontouchstart"in window&&navigator.vendor&&navigator.vendor.includes("Apple")&&navigator.userAgent&&!navigator.userAgent.includes("CriOS")&&!navigator.userAgent.includes("FxiOS")&&$((function(){$(".App").addClass("mobile-safari")}))},n.viewingDiscussion=function(t){return this.current.matches(ie,{discussion:t})},n.authenticationComplete=function(t){t.loggedIn?window.location.reload():this.modal.show(_t,t)},e}(vi),Ci=new Ni;window.app=Ci;const Si=Ci;var Ti="The `evented` util is deprecated and will be removed in Flarum 2.0. For more info, please see https://github.com/flarum/core/issues/2547";const ki={handlers:null,getHandlers:function(t){return lt(Ti),this.handlers=this.handlers||{},this.handlers[t]=this.handlers[t]||[],this.handlers[t]},trigger:function(t){for(var e=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];lt(Ti),this.getHandlers(t).forEach((function(t){return t.apply(e,i)}))},on:function(t,e){lt(Ti),this.getHandlers(t).push(e)},one:function(t,e){lt(Ti),this.getHandlers(t).push((function n(){e.apply(this,arguments),this.off(t,n)}))},off:function(t,e){lt(Ti);var n=this.getHandlers(t),i=n.indexOf(e);-1!==i&&n.splice(i,1)}};var Ai={prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,trimFirst:!1};function Ei(t){return t.trim().split("\n").length>1}function Pi(t,e){return Array(e+1).join(t)}function _i(t,e,n){for(var i=e,r=n?/\n/:/\s/;t[i]&&!t[i].match(r);)i++;return i}function Di(t){var e,n,i=t.value.slice(0,t.selectionStart),r=t.value.slice(t.selectionEnd),o=i.match(/\n*$/),s=r.match(/^\n*/),a=o?o[0].length:0,u=s?s[0].length:0;return i.match(/\S/)&&a<2&&(e=Pi("\n",2-a)),r.match(/\S/)&&u<2&&(n=Pi("\n",2-u)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}const $i=function(t,e){var n=new RegExp("(\\w+\\/)?("+e+"|common)\\/");return new Proxy(t,{get:function(t,e){return t[e]||t[e.replace(n,"$1")]}})};var Ii=["className","class"],Oi=["options","onchange","value","disabled","className","class","wrapperAttrs"],Mi=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t=this.attrs,e=t.options,n=t.onchange,i=t.value,r=t.disabled,o=t.className,s=t.class,a=t.wrapperAttrs,u=(a=void 0===a?{}:a).className,l=a.class,c=F(a,Ii),d=F(t,Oi);return m("span",Object.assign({className:L("Select",u,l)},c),m("select",Object.assign({className:L("Select-input FormControl",o,s),onchange:n?on("value",n.bind(this)):void 0,value:i,disabled:r},d),Object.keys(e).map((function(t){return m("option",{value:t},e[t])}))),J("fas fa-sort",{className:"Select-caret"}))},e}(A),ji=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return m(bt,{text:this.attrs.tooltipText||ct(e.children)},n)},e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link",e.tooltipText=e.title},e}(ht);const Li={extend:r,Session:ti,Store:Zn,"utils/BasicEditorDriver":gt,"utils/evented":ki,"utils/liveHumanTimes":oi,"utils/ItemList":I,"utils/mixin":function(t){for(var e=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e}(t),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return i.forEach((function(t){Object.assign(e.prototype,t)})),e},"utils/humanTime":tt,"utils/computed":ce,"utils/insertText":vt,"utils/styleSelectedText":function(t,e){t.focus(),e=Object.assign({},Ai,e);var n,i=t.value.slice(t.selectionStart,t.selectionEnd);n=e.orderedList?function(t){var e,n,i,r,o=/^\d+\.\s+/,s=t.selectionStart===t.selectionEnd,a=t.value.slice(t.selectionStart,t.selectionEnd),u=a,l=a.split("\n");if(s){var c=t.value.slice(0,t.selectionStart).split(/\n/);i=t.selectionStart-c[c.length-1].length,r=_i(t.value,t.selectionStart,!0),u=t.value.slice(i,r)}var d=u.split("\n");if(d.every((function(t){return o.test(t)}))){if(a=(l=d.map((function(t){return t.replace(o,"")}))).join("\n"),s&&i&&r){var h=d[0].length-l[0].length;n=e=t.selectionStart-h,t.selectionStart=i,t.selectionEnd=r}}else{a=(l=function(t){var e,n,i,r=[];for(i=e=0,n=t.length;e<n;i=++e){var o=t[i];r.push(i+1+". "+o)}return r}(l)).join("\n");var f=Di(t),p=f.newlinesToAppend,m=f.newlinesToPrepend;e=(n=t.selectionStart+p.length)+a.length,s&&(n=e),a=p+a+m}return{text:a,selectionStart:n,selectionEnd:e}}(t):e.multiline&&Ei(i)?function(t,e){var n=e.prefix,i=e.suffix,r=e.surroundWithNewlines,o=t.value.slice(t.selectionStart,t.selectionEnd),s=t.selectionStart,a=t.selectionEnd,u=o.split("\n");if(u.every((function(t){return t.startsWith(n)&&t.endsWith(i)})))a=s+(o=u.map((function(t){return t.slice(n.length,t.length-i.length)})).join("\n")).length;else if(o=u.map((function(t){return n+t+i})).join("\n"),r){var l=Di(t),c=l.newlinesToAppend,d=l.newlinesToPrepend;a=(s+=c.length)+o.length,o=c+o+d}return{text:o,selectionStart:s,selectionEnd:a}}(t,e):function(t,e){var n=e.prefix,i=e.suffix,r=e.blockPrefix,o=e.blockSuffix,s=e.replaceNext,a=e.prefixSpace,u=e.scanFor,l=e.surroundWithNewlines,c=t.selectionStart,d=t.selectionEnd,h=t.value.slice(t.selectionStart,t.selectionEnd),f=Ei(h)&&r.length>0?r+"\n":n,p=Ei(h)&&o.length>0?"\n"+o:i;if(a){var m=t.value[t.selectionStart-1];0===t.selectionStart||null==m||m.match(/\s/)||(f=" "+f)}h=function(t,e,n,i){if(void 0===i&&(i=!1),t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){for(var n=e;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=_i(t.value,t.selectionEnd,i);else{var r=t.selectionStart-e.length,o=t.selectionEnd+n.length,s=t.value.slice(r,t.selectionStart)===e,a=t.value.slice(t.selectionEnd,o)===n;s&&a&&(t.selectionStart=r,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,f,p,e.multiline);var v=t.selectionStart,g=t.selectionEnd,y=s.length>0&&p.indexOf(s)>-1&&h.length>0;if(l){var b=Di(t);f=b.newlinesToAppend+n,p+=b.newlinesToPrepend}if(h.startsWith(f)&&h.endsWith(p)){var w=h.slice(f.length,h.length-p.length);if(c===d){var x=c-f.length;x=Math.max(x,v),v=g=x=Math.min(x,v+w.length)}else g=v+w.length;return{text:w,selectionStart:v,selectionEnd:g}}if(y)return u.length>0&&h.match(u)?{text:f+(p=p.replace(s,h)),selectionStart:v=g=v+f.length,selectionEnd:g}:{text:f+h+p,selectionStart:v=v+f.length+h.length+p.indexOf(s),selectionEnd:g=v+s.length};var N=f+h+p;v=c+f.length,g=d+f.length;var C=h.match(/^\s*|\s*$/g);if(e.trimFirst&&C){var S=C[0]||"",T=C[1]||"";N=S+f+h.trim()+p+T,v+=S.length,g-=T.length}return{text:N,selectionStart:v,selectionEnd:g}}(t,e),vt(t,n)},"utils/Drawer":ei,"utils/anchorScroll":te,"utils/RequestError":ii,"utils/abbreviateNumber":et,"utils/string":e,"utils/SubtreeRetainer":ot,"utils/escapeRegExp":jt,"utils/extract":U,"utils/ScrollListener":qt,"utils/stringToColor":li,"utils/Stream":At,"utils/subclassOf":E,"utils/setRouteWithForcedRefresh":S,"utils/patchMithril":h,"utils/proxifyCompat":$i,"utils/classList":L,"utils/extractText":ct,"utils/formatNumber":Kt,"utils/mapRoutes":ni,"utils/withAttr":on,"utils/throttleDebounce":o,"models/Notification":hi,"models/User":ci,"models/Post":di,"models/Discussion":fe,"models/Group":Ie,"models/Forum":ui,Component:A,Fragment:function(){function t(){this.element=void 0}var e=t.prototype;return e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),e.render=function(){var t=this,e=this.view();e.attrs=e.attrs||{};var n=e.attrs.oncreate;return e.attrs.oncreate=function(e){t.element=e.dom,n&&n.apply(t,[e])},e},t}(),Translator:Qn,"components/AlertManager":wn,"components/Page":_,"components/Switch":an,"components/Badge":he,"components/LoadingIndicator":at,"components/Placeholder":Rt,"components/Separator":M,"components/Dropdown":nt,"components/SplitDropdown":Jt,"components/RequestErrorModal":xn,"components/FieldSet":un,"components/Select":Mi,"components/Navigation":gi,"components/Alert":St,"components/Link":z,"components/LinkButton":oe,"components/Checkbox":sn,"components/SelectDropdown":ue,"components/ModalManager":bn,"components/Button":ht,"components/Modal":Tt,"components/GroupBadge":De,"components/TextEditor":wt,"components/TextEditorButton":ji,"components/Tooltip":bt,"components/EditUserModal":Oe,Model:le,Application:vi,"helpers/fullTime":Ue,"helpers/avatar":W,"helpers/icon":J,"helpers/humanTime":it,"helpers/punctuateSeries":function(t){if(2===t.length)return y.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var e=t.slice(1,t.length-1).reduce((function(t,e){return t.concat([e,y.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return y.translator.trans("core.lib.series.three_text",{first:t[0],second:e,third:t[t.length-1]})}return t},"helpers/highlight":X,"helpers/username":Wt,"helpers/userOnline":Be,"helpers/listItems":H,"resolvers/DefaultResolver":pn,"states/PaginatedListState":tn};var Ri=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.initAttrs=function(e){e.className=(e.className||"")+" LogInButton",e.onclick=function(){var t=$(window);window.open(Si.forum.attribute("baseUrl")+e.path,"logInPopup","width=580,height=400,top="+(t.height()/2-200)+",left="+(t.width()/2-290)+",status=no,scrollbars=yes,resizable=no")},t.initAttrs.call(this,e)},e}(ht),Hi=function(t){function e(){return t.apply(this,arguments)||this}return N(e,t),e.prototype.view=function(){var t=this.attrs.post,e=t.user(),n="comment"===t.contentType()&&t.contentPlain(),i=n?X(n,this.attrs.highlight,300):"";return m(z,{className:"PostPreview",href:Si.route.post(t),onclick:this.attrs.onclick},m("span",{className:"PostPreview-content"},W(e),Wt(e)," ",m("span",{className:"PostPreview-excerpt"},i)))},e}(A);const Bi=Object.assign(Li,{"utils/PostControls":Pe,"utils/KeyboardNavigatable":ve,"utils/slidable":Ot,"utils/History":T,"utils/DiscussionControls":It,"utils/alertEmailConfirmation":gn,"utils/UserControls":Le,"utils/Pane":k,"utils/BasicEditorDriver":gt,"states/ComposerState":Ce,"states/DiscussionListState":nn,"states/GlobalSearchState":xi,"states/NotificationListState":yi,"states/PostStreamState":ne,"states/SearchState":bi,"components/AffixedSidebar":Me,"components/DiscussionPage":ie,"components/DiscussionListPane":Ft,"components/LogInModal":Dt,"components/ComposerBody":xt,"components/ForgotPasswordModal":Et,"components/Notification":Te,"components/LogInButton":Ri,"components/DiscussionsUserPage":rn,"components/Composer":Se,"components/SessionDropdown":se,"components/HeaderPrimary":re,"components/PostEdited":ze,"components/PostStream":Gt,"components/ChangePasswordModal":cn,"components/IndexPage":Xe,"components/DiscussionRenamedNotification":ke,"components/DiscussionsSearchSource":ge,"components/HeaderSecondary":we,"components/ComposerButton":xe,"components/DiscussionList":Ht,"components/ReplyPlaceholder":Yt,"components/AvatarEditor":Re,"components/Post":_e,"components/SettingsPage":hn,"components/TerminalPost":rt,"components/ChangeEmailModal":dn,"components/NotificationsDropdown":me,"components/UserPage":je,"components/PostUser":Fe,"components/UserCard":He,"components/UsersSearchSource":ye,"components/NotificationGrid":ln,"components/PostPreview":Hi,"components/EventPost":Ve,"components/DiscussionHero":B,"components/PostMeta":qe,"components/DiscussionRenamedPost":Ye,"components/DiscussionComposer":Ke,"components/LogInButtons":Pt,"components/NotificationList":pe,"components/WelcomeHero":Ge,"components/SignUpModal":_t,"components/CommentPost":We,"components/ComposerPostPreview":Vt,"components/ReplyComposer":Ct,"components/NotificationsPage":fn,"components/PostStreamScrubber":Xt,"components/EditPostComposer":Ee,"components/RenameDiscussionModal":$t,"components/Search":be,"components/DiscussionListItem":Lt,"components/LoadingPost":zt,"components/PostsUserPage":Je,"resolvers/DiscussionPageResolver":mn,routes:vn,ForumApplication:Ni});Bi.app=Si;var Fi=$i(Bi,"forum")})(),flarum.core=i})();
|
|
//# sourceMappingURL=forum.js.map
|