Browse Source

Fix mentions (#1483)

Rafał Pitoń 2 years ago
parent
commit
d27f056f9f

+ 11 - 1
frontend/src/components/MarkupEditor/MarkupEditor.jsx

@@ -170,8 +170,18 @@ function setMentions(props, element) {
     },
   })
 
-  $(element).on("inserted.atwho", (event, flag, query) => {
+  $(element).on("inserted.atwho", (event, _storage, source, controller) => {
+    const { query } = controller
+    const username = source.target.innerText.trim()
+    const prefix = event.target.value.substr(0, query.headPos)
+    const suffix = event.target.value.substr(query.endPos)
+
+    event.target.value = prefix + username + suffix
     props.onChange(event)
+
+    const caret = query.headPos + username.length
+    event.target.setSelectionRange(caret, caret)
+    event.target.focus()
   })
 }
 

+ 1 - 1
misago/static/misago/js/misago.js

@@ -1,2 +1,2 @@
-!function(){var e,t,n,a={98936:function(e,t,n){"use strict";n.d(t,{gq:function(){return o},Z6:function(){return r},kw:function(){return l}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("div",{className:s()("flex-row",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("flex-row-col",n,{"flex-row-col-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("flex-row-section",{"flex-row-section-auto":t},i)},void 0,n)}},59131:function(e,t,n){"use strict";var a=n(22928);n(57588),t.Z=function(e){var t=e.children;return(0,a.Z)("div",{className:"container page-container"},void 0,t)}},99755:function(e,t,n){"use strict";n.d(t,{mr:function(){return r},gC:function(){return l},sP:function(){return c},eA:function(){return u},Ql:function(){return d},bM:function(){return p},Iv:function(){return h}});var a,i=n(22928),s=n(94184),o=n.n(s),r=(n(57588),function(e){var t=e.children,n=e.className,s=e.styleName;return(0,i.Z)("div",{className:o()("page-header",n,s&&"page-header-"+s)},void 0,(0,i.Z)("div",{className:"page-header-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-bg-overlay"},void 0,a||(a=(0,i.Z)("div",{className:"page-header-image"})),t)))}),l=function(e){var t=e.children,n=e.className,a=e.styleName;return(0,i.Z)("div",{className:o()("page-header-banner",n,a&&"page-header-banner-"+a)},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-overlay"},void 0,t)))},c=function(e){var t=e.children;return(0,i.Z)("div",{className:"container page-header-container"},void 0,t)},u=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-details",n)},void 0,t)},d=function(e){var t=e.className,n=e.message;return(0,i.Z)("div",{className:o()("page-header-message",t),dangerouslySetInnerHTML:{__html:n}})},p=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-message",n)},void 0,t)},h=function(e){var t=e.styleName,n=e.header,a=e.message;return(0,i.Z)(c,{},void 0,(0,i.Z)(r,{styleName:t},void 0,(0,i.Z)(l,{styleName:t},void 0,(0,i.Z)("h1",{},void 0,n)),a&&(0,i.Z)(u,{styleName:t},void 0,a)))}},26106:function(e,t,n){"use strict";var a=n(22928),i=(n(57588),n(32233)),s=n(89627),o=function(e){var t=e.agreement,n=e.checked,i=e.errors,o=e.url,r=e.value,l=e.onChange;if(!o)return null;var c=interpolate('<a href="%(url)s" target="_blank">%(agreement)s</a>',{agreement:(0,s.Z)(t),url:(0,s.Z)(o)},!0),u=interpolate(gettext("I have read and accept %(agreement)s."),{agreement:c},!0);return(0,a.Z)("div",{className:"checkbox legal-footnote"},void 0,(0,a.Z)("label",{},void 0,(0,a.Z)("input",{checked:n,type:"checkbox",value:r,onChange:l}),(0,a.Z)("span",{dangerouslySetInnerHTML:{__html:u}})),i&&i.map((function(e,t){return(0,a.Z)("div",{className:"help-block errors"},t,e)})))};t.Z=function(e){var t=e.errors,n=e.privacyPolicy,s=e.termsOfService,r=e.onPrivacyPolicyChange,l=e.onTermsOfServiceChange,c=i.Z.get("TERMS_OF_SERVICE_ID"),u=i.Z.get("TERMS_OF_SERVICE_URL"),d=i.Z.get("PRIVACY_POLICY_ID"),p=i.Z.get("PRIVACY_POLICY_URL");return c||d?(0,a.Z)("div",{},void 0,(0,a.Z)(o,{agreement:gettext("the terms of service"),checked:null!==s,errors:t.termsOfService,url:u,value:c,onChange:l}),(0,a.Z)(o,{agreement:gettext("the privacy policy"),checked:null!==n,errors:t.privacyPolicy,url:p,value:d,onChange:r})):null}},47235:function(e,t,n){"use strict";var a,i=n(22928),s=(n(57588),n(32233)),o=function(e){var t=e.className,n=e.text;return n?(0,i.Z)("h5",{className:t||""},void 0,n):null};t.Z=function(e){var t=e.buttonClassName,n=e.buttonLabel,r=e.formLabel,l=e.header,c=e.labelClassName,u=s.Z.get("SOCIAL_AUTH");return 0===u.length?null:(0,i.Z)("div",{className:"form-group form-social-auth"},void 0,(0,i.Z)(o,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(e){var a=e.id,s=e.name,o=e.button_text,r=e.button_color,l=e.url,c="btn btn-block btn-default btn-social-"+a,u=r?{color:r}:null,d=o||interpolate(n,{site:s},!0);return(0,i.Z)("div",{className:t||"col-xs-12"},a,(0,i.Z)("a",{className:c,style:u,href:l},void 0,d))}))),a||(a=(0,i.Z)("hr",{})),(0,i.Z)(o,{className:c,text:r}))}},50366:function(e,t,n){"use strict";var a,i,s,o,r,l,c,u=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,u.Z)("ul",{className:"thread-flags"},void 0,2==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-globally",title:gettext("Pinned globally")},void 0,a||(a=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark"))),1==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-locally",title:gettext("Pinned in category")},void 0,i||(i=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark_outline"))),t.best_answer&&(0,u.Z)("li",{className:"thread-flag-answered",title:gettext("Answered")},void 0,s||(s=(0,u.Z)("span",{className:"material-icon"},void 0,"check_circle"))),t.has_poll&&(0,u.Z)("li",{className:"thread-flag-poll",title:gettext("Poll")},void 0,o||(o=(0,u.Z)("span",{className:"material-icon"},void 0,"poll"))),(t.is_unapproved||t.has_unapproved_posts)&&(0,u.Z)("li",{className:"thread-flag-unapproved",title:t.is_unapproved?gettext("Awaiting approval"):gettext("Has unapproved posts")},void 0,r||(r=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility"))),t.is_closed&&(0,u.Z)("li",{className:"thread-flag-closed",title:gettext("Closed")},void 0,l||(l=(0,u.Z)("span",{className:"material-icon"},void 0,"lock"))),t.is_hidden&&(0,u.Z)("li",{className:"thread-flag-hidden",title:gettext("Hidden")},void 0,c||(c=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility_off"))))}},16768:function(e,t,n){"use strict";var a,i=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,i.Z)("span",{className:"threads-replies",title:interpolate(ngettext("%(replies)s reply","%(replies)s replies",t.replies),{replies:t.replies},!0)},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"chat_bubble_outline")),t.replies>980?Math.round(t.replies/1e3)+"K":t.replies)}},92490:function(e,t,n){"use strict";n.d(t,{o8:function(){return o},Eg:function(){return r},Z2:function(){return l},tw:function(){return c}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("nav",{className:s()("toolbar",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("toolbar-item",n,{"toolbar-item-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("toolbar-section",{"toolbar-section-auto":t},i)},void 0,n)},c=function(e){var t=e.className;return(0,a.Z)("div",{className:s()("toolbar-spacer",t)})}},19605:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var a=n(22928),i=(n(57588),n(32233));function s(e){var t=e.size||100,n=e.size2x||t;return(0,a.Z)("img",{alt:"",className:e.className||"user-avatar",src:o(e.user,t),srcSet:o(e.user,n),width:t,height:t})}function o(e,t){return e&&e.id?function(e,t){var n=e[0];return e.forEach((function(e){e.size>=t&&(n=e)})),n}(e.avatars,t).url:i.Z.get("BLANK_AVATAR_URL")}},82211:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){var e="btn "+this.props.className,t=this.props.disabled;return this.props.loading&&(e+=" btn-loading",t=!0),(0,i.Z)("button",{className:e,disabled:t,onClick:this.props.onClick,type:this.props.onClick?"button":"submit"},void 0,this.props.children,this.props.loading?a||(a=(0,i.Z)(p.Z,{})):null)}}]),d}(d().Component);h.defaultProps={className:"btn-default",type:"submit",loading:!1,disabled:!1,onClick:null}},57026:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(22928);function i(e){return(0,a.Z)("select",{className:e.className||"form-control",disabled:e.disabled||!1,id:e.id||null,onChange:e.onChange,value:e.value},void 0,e.choices.map((function(e){return(0,a.Z)("option",{disabled:e.disabled||!1,value:e.value},e.value,"- - ".repeat(e.level)+e.label)})))}n(57588)},21688:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(33556);function p(e){return e.display?(0,a.Z)(d.Z,{helpText:gettext("No profile details are editable at this time."),message:gettext("This option is currently unavailable.")}):null}var h,v=n(37848);function f(e){return e.display?h||(h=(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(v.Z,{}))):null}var m=n(97326),Z=n(4942),g=n(60471);var y=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=c.call.apply(c,[this].concat(n)),(0,Z.Z)((0,m.Z)(e),"onChange",(function(t){var n=e.props,a=n.field;(0,n.onChange)(a.fieldname,t.target.value)})),e}return(0,s.Z)(u,[{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.field,i=e.value,s=n.input;return"select"===s.type?(0,a.Z)(g.Z,{choices:s.choices,disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,value:i}):"textarea"===s.type?(0,a.Z)("textarea",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,rows:"4",type:"text",value:i}):"text"===s.type?(0,a.Z)("input",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,type:"text",value:i}):null}}]),u}(u().Component),b=n(96359);function _(e){var t=e.disabled,n=e.errors,i=e.fields,s=e.name,o=e.onChange,r=e.value;return(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,s),i.map((function(e){return(0,a.Z)(b.Z,{for:"id_"+e.fieldname,helpText:e.help_text,label:e.label,validation:n[e.fieldname]},e.fieldname,(0,a.Z)(y,{disabled:t,field:e,onChange:o,value:r[e.fieldname]}))})))}var N=n(82211),k=n(43345),x=n(78657),w=n(53904);var R=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;(0,i.Z)(this,u),t=c.call(this,e),(0,Z.Z)((0,m.Z)(t),"onChange",(function(e,n){t.setState((0,Z.Z)({},e,n))})),t.state={isLoading:!1,errors:{}};for(var n=e.groups.length,a=0;a<n;a++)for(var s=e.groups[a],o=s.fields.length,r=0;r<o;r++){var l=s.fields[r].fieldname,d=s.fields[r].initial;t.state[l]=d}return t}return(0,s.Z)(u,[{key:"send",value:function(){var e=Object.assign({},this.state,{errors:null,isLoading:null});return x.Z.post(this.props.api,e)}},{key:"handleSuccess",value:function(e){this.props.onSuccess(e)}},{key:"handleError",value:function(e){400===e.status?(w.Z.error(gettext("Form contains errors.")),this.setState({errors:e})):w.Z.apiError(e)}},{key:"render",value:function(){var e=this;return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,this.props.groups.map((function(t,n){return(0,a.Z)(_,{disabled:e.state.isLoading,errors:e.state.errors,fields:t.fields,name:t.name,onChange:e.onChange,value:e.state},n)}))),(0,a.Z)("div",{className:"panel-footer text-right"},void 0,(0,a.Z)(C,{disabled:this.state.isLoading,onCancel:this.props.onCancel})," ",(0,a.Z)(N.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes"))))}}]),u}(k.Z);function C(e){var t=e.onCancel,n=e.disabled;return t?(0,a.Z)("button",{className:"btn btn-default",disabled:n,onClick:t,type:"button"},void 0,gettext("Cancel")):null}var S=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={loading:!0,groups:null},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){var e=this;x.Z.get(this.props.api).then((function(t){e.setState({loading:!1,groups:t})}),(function(t){w.Z.apiError(t),e.props.cancel&&e.props.cancel()}))}},{key:"render",value:function(){var e=this.state,t=e.groups,n=e.loading;return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Edit details"))),(0,a.Z)(f,{display:n}),(0,a.Z)(p,{display:!n&&!t.length}),(0,a.Z)(E,{api:this.props.api,display:!n&&t.length,groups:t,onCancel:this.props.onCancel,onSuccess:this.props.onSuccess}))}}]),u}(u().Component);function E(e){var t=e.api,n=e.display,i=e.groups,s=e.onCancel,o=e.onSuccess;return n?(0,a.Z)(R,{api:t,groups:i,onCancel:s,onSuccess:o}):null}},96359:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"isValidated",value:function(){return void 0!==this.props.validation}},{key:"getClassName",value:function(){var e="form-group";return this.isValidated()&&(e+=" has-feedback",null===this.props.validation?e+=" has-success":e+=" has-error"),e}},{key:"getFeedback",value:function(){var e=this;return this.props.validation?(0,a.Z)("div",{className:"help-block errors"},void 0,this.props.validation.map((function(t,n){return(0,a.Z)("p",{},e.props.for+"FeedbackItem"+n,t)}))):null}},{key:"getFeedbackDescription",value:function(){return this.isValidated()?(0,a.Z)("span",{id:this.props.for+"_status",className:"sr-only"},void 0,this.props.validation?gettext("(error)"):gettext("(success)")):null}},{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:this.getClassName()},void 0,(0,a.Z)("label",{className:"control-label "+(this.props.labelClass||""),htmlFor:this.props.for||""},void 0,this.props.label+":"),(0,a.Z)("div",{className:this.props.controlClass||""},void 0,this.props.children,this.getFeedbackDescription(),this.getFeedback(),this.getHelpText(),this.props.extra||null))}}]),u}(n.n(c)().Component)},43345:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var a=n(15671),i=n(43144),s=n(97326),o=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588),d=n.n(u),p=n(55210),h=n(53904);var v=(0,p.C1)(),f=function(e){(0,o.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function d(){var e;(0,a.Z)(this,d);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=u.call.apply(u,[this].concat(n)),(0,c.Z)((0,s.Z)(e),"bindInput",(function(t){return function(n){e.changeValue(t,n.target.value)}})),(0,c.Z)((0,s.Z)(e),"changeValue",(function(t,n){var a=(0,c.Z)({},t,n),i=e.state.errors||{};i[t]=e.validateField(t,a[t]),a.errors=i,e.setState(a)})),(0,c.Z)((0,s.Z)(e),"handleSubmit",(function(t){if(t&&t.preventDefault(),!e.state.isLoading&&e.clean()){e.setState({isLoading:!0});var n=e.send();n?n.then((function(t){e.setState({isLoading:!1}),e.handleSuccess(t)}),(function(t){e.setState({isLoading:!1}),e.handleError(t)})):e.setState({isLoading:!1})}})),e}return(0,i.Z)(d,[{key:"validate",value:function(){var e={};if(!this.state.validators)return e;var t={required:this.state.validators.required||this.state.validators,optional:this.state.validators.optional||{}},n=[];for(var a in t.required)t.required.hasOwnProperty(a)&&t.required[a]&&n.push(a);for(var i in t.optional)t.optional.hasOwnProperty(i)&&t.optional[i]&&n.push(i);for(var s in n){var o=n[s],r=this.validateField(o,this.state[o]);null===r?e[o]=null:r&&(e[o]=r)}return e}},{key:"isValid",value:function(){var e=this.validate();for(var t in e)if(e.hasOwnProperty(t)&&null!==e[t])return!1;return!0}},{key:"validateField",value:function(e,t){var n=[];if(!this.state.validators)return n;var a={required:(this.state.validators.required||this.state.validators)[e],optional:(this.state.validators.optional||{})[e]},i=v(t)||!1;if(a.required){if(i)n=[i];else for(var s in a.required){var o=a.required[s](t);o&&n.push(o)}return n.length?n:null}if(!1===i&&a.optional){for(var r in a.optional){var l=a.optional[r](t);l&&n.push(l)}return n.length?n:null}return!1}},{key:"clean",value:function(){return!0}},{key:"send",value:function(){return null}},{key:"handleSuccess",value:function(e){}},{key:"handleError",value:function(e){h.Z.apiError(e)}}]),d}(d().Component)},94417:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"isActive",value:function(){return this.props.isControlled?this.props.isActive:!!this.props.path&&0===document.location.pathname.indexOf(this.props.path)}},{key:"getClassName",value:function(){return this.isActive()?(this.props.className||"")+" "+(this.props.activeClassName||"active"):this.props.className||""}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,this.props.children)}}]),u}(n.n(c)().Component)},37848:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a,i=n(22928);function s(e){return(0,i.Z)("div",{className:e.className||"loader"},void 0,a||(a=(0,i.Z)("div",{className:"loader-spinning-wheel"})))}n(57588)},52753:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Z}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=(n(57588),n(82211)),h=n(43345),v=n(96359),f=n(78657),m=n(59801);var Z=function(e){(0,l.Z)(v,e);var t,n,h=(t=v,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function v(e){var t;return(0,s.Z)(this,v),t=h.call(this,e),(0,d.Z)((0,r.Z)(t),"handleSuccess",(function(e){t.props.onSuccess(e),m.Z.hide()})),(0,d.Z)((0,r.Z)(t),"handleError",(function(e){t.props.onError(e)})),(0,d.Z)((0,r.Z)(t),"onBestAnswerChange",(function(e){t.changeValue("bestAnswer",e.target.value)})),(0,d.Z)((0,r.Z)(t),"onPollChange",(function(e){t.changeValue("poll",e.target.value)})),t.state={isLoading:!1,bestAnswer:"0",poll:"0"},t}return(0,o.Z)(v,[{key:"clean",value:function(){return!this.props.polls||"0"!==this.state.poll||window.confirm(gettext("Are you sure you want to delete all polls?"))}},{key:"send",value:function(){var e=Object.assign({},this.props.data,{best_answer:this.state.bestAnswer,poll:this.state.poll});return f.Z.post(this.props.api,e)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Merge threads"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(g,{choices:this.props.bestAnswers,onChange:this.onBestAnswerChange,value:this.state.bestAnswer}),(0,i.Z)(y,{choices:this.props.polls,onChange:this.onPollChange,value:this.state.poll})),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)(p.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Merge threads"))))))}}]),v}(h.Z);function g(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,i.Z)(v.Z,{label:gettext("Best answer"),helpText:gettext("Please select the best answer for your newly merged thread. No posts will be deleted during the merge."),for:"id_best_answer"},void 0,(0,i.Z)("select",{className:"form-control",id:"id_best_answer",onChange:n,value:a},void 0,t.map((function(e){return(0,i.Z)("option",{value:e[0]},e[0],e[1])})))):null}function y(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,i.Z)(v.Z,{label:gettext("Poll"),helpText:gettext("Please select the poll for your newly merged thread. Rejected polls will be permanently deleted and cannot be recovered."),for:"id_poll"},void 0,(0,i.Z)("select",{className:"form-control",id:"id_poll",onChange:n,value:a},void 0,t.map((function(e){return(0,i.Z)("option",{value:e[0]},e[0],e[1])})))):null}},69092:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=n(15671),i=n(43144),s=n(79340),o=n(6215),r=n(61120),l=n(57588),c=n.n(l),u=n(4942),d=n(19755),p=new RegExp("^.*(?:(?:youtu.be/|v/|vi/|u/w/|embed/)|(?:(?:watch)??v(?:i)?=|&v(?:i)?=))([^#&?]*).*"),h=new(function(){function e(){var t=this;(0,a.Z)(this,e),(0,u.Z)(this,"render",(function(e){e&&(t.highlightCode(e),t.embedYoutubePlayers(e))})),this._youtube={}}return(0,i.Z)(e,[{key:"highlightCode",value:function(e){n.e(417).then(n.bind(n,15739)).then((function(t){for(var n=t.default,a=e.querySelectorAll("pre>code"),i=0;i<a.length;i++)n.highlightElement(a[i])}))}},{key:"embedYoutubePlayers",value:function(e){for(var t=e.querySelectorAll("p>a"),n=0;n<t.length;n++){var a=t[n],i=1===a.parentNode.childNodes.length;this._youtube[a.href]||(this._youtube[a.href]=v(a.href));var s=this._youtube[a.href];i&&s&&!1!==s.data&&this.swapYoutubePlayer(a,s)}}},{key:"swapYoutubePlayer",value:function(e,t){var n="https://www.youtube.com/embed/";n+=t.video,n+="?feature=oembed",t.start&&(n+="&start="+t.start);var a=d('<iframe class="embed-responsive-item" frameborder="0" src="'+n+'" allow="encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');d(e).replaceWith(a),a.wrap('<div class="embed-responsive embed-responsive-16by9"></div>')}}]),e}());function v(e){var t=function(e){var t=e;return"https://"===e.substr(0,8)?t=t.substr(8):"http://"===e.substr(0,7)&&(t=t.substr(7)),"www."===t.substr(0,4)&&(t=t.substr(4)),t}(e),n=function(e){if(-1===e.indexOf("youtu"))return null;var t=e.match(p);return t?t[1]:null}(t);if(!n)return null;var a=0;if(t.indexOf("?")>0){var i=t.substr(t.indexOf("?")+1).split("&").filter((function(e){return"t="===e.substr(0,2)}))[0];if(i){var s=i.substr(2).split("m");"s"===s[0].substr(-1)?a+=parseInt(s[0].substr(0,s[0].length-1)):(a+=60*parseInt(s[0]),s[1]&&"s"===s[1].substr(-1)&&(a+=parseInt(s[1].substr(0,s[1].length-1))))}}return{start:a,video:n}}var f=n(19755);var m=function(e){(0,s.Z)(u,e);var t,n,l=(t=u,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(e){return!1}}(),function(){var e,a=(0,r.Z)(t);if(n){var i=(0,r.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,o.Z)(this,e)});function u(){return(0,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"componentDidUpdate",value:function(e,t){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"shouldComponentUpdate",value:function(e,t){return e.markup!==this.props.markup}},{key:"render",value:function(){var e=this;return c().createElement("article",{className:"misago-markup",dangerouslySetInnerHTML:{__html:this.props.markup},"data-author":this.props.author||void 0,ref:function(t){e.documentNode=t}})}}]),u}(c().Component);function Z(e){var t=e.target;f(t).parent().parent().addClass("revealed")}},3784:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"modal-body modal-loader"},void 0,(0,i.Z)(p.Z,{})))}}]),d}(d().Component)},30337:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120);n(57588);var c=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText(),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}}]),u}(n(33556).Z)},95187:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"panel-body panel-body-loading"},void 0,(0,i.Z)(p.Z,{className:"loader loader-spaced"})))}}]),d}(d().Component)},33556:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText()))}}]),u}(n.n(c)().Component)},11005:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var a=n(22928),i=n(57588),s=n.n(i),o=n(69092);function r(e){return e.post.content?s().createElement(l,e):s().createElement(c,e)}function l(e){return(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)(o.Z,{markup:e.post.content}))}function c(e){return(0,a.Z)("div",{className:"post-body post-body-invalid"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("This post's contents cannot be displayed.")),(0,a.Z)("p",{className:"text-muted"},void 0,gettext("This error is caused by invalid post content manipulation.")))}function u(e){var t=e.post,n=t.category,i=t.thread,s=interpolate(gettext("posted %(posted_on)s"),{posted_on:t.posted_on.format("LL, LT")},!0);return(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("a",{className:"btn btn-link item-title",href:i.url},void 0,i.title),(0,a.Z)("a",{className:"btn btn-link post-category",href:n.url.index},void 0,n.name),(0,a.Z)("a",{href:t.url.index,className:"btn btn-link posted-on",title:s},void 0,t.posted_on.fromNow()))}var d,p,h=n(19605);function v(e){var t=e.post;return(0,a.Z)("a",{className:"btn btn-default btn-icon pull-right",href:t.url.index},void 0,(0,a.Z)("span",{className:"btn-text-left hidden-xs"},void 0,gettext("See post")),d||(d=(0,a.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function f(e){var t=e.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,p||(p=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,t.poster_name)),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,gettext("Removed user")))))}function m(e){var t=e.rank,n=e.title||t.title||t.name,i="user-title";return t.css_class&&(i+=" user-title-"+t.css_class),t.is_tab?(0,a.Z)("a",{className:i,href:t.url},void 0,n):(0,a.Z)("span",{className:i},void 0,n)}function Z(e){var t=e.post,n=e.poster;return(0,a.Z)("div",{className:"post-side post-side-registered"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("a",{href:n.url},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50,user:n}))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("a",{className:"item-title",href:n.url},void 0,n.username)),(0,a.Z)(m,{title:n.title,rank:n.rank}))))}function g(e){var t=e.post,n=e.poster;return n&&n.id?(0,a.Z)(Z,{post:t,poster:n}):(0,a.Z)(f,{post:t})}function y(e){var t=e.post,n=e.poster||t.poster,i="post";return n&&n.rank.css_class&&(i+=" post-"+n.rank.css_class),(0,a.Z)("li",{className:i,id:"post-"+t.id},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)(g,{post:t,poster:n}),(0,a.Z)(u,{post:t}),(0,a.Z)(r,{post:t})))))}var b,_,N=n(44039);function k(){return(0,a.Z)("ul",{className:"posts-list post-feed ui-preview"},void 0,(0,a.Z)("li",{className:"post"},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)("div",{className:"media"},void 0,b||(b=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))))),(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")),(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)("article",{className:"misago-markup"},void 0,(0,a.Z)("p",{},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")))))))))}function x(e){var t=e.isReady,n=e.posts,i=e.poster;return t?(0,a.Z)("ul",{className:"posts-list post-feed ui-ready"},void 0,n.map((function(e){return(0,a.Z)(y,{post:e,poster:i},e.id)}))):_||(_=(0,a.Z)(k,{}))}},78107:function(e,t,n){"use strict";n.d(t,{mv:function(){return f},ZP:function(){return pn},MO:function(){return A},Fi:function(){return k}});var a,i=n(57588),s=n.n(i),o=n(22928),r=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(64646);var f=function(e){(0,u.Z)(f,e);var t,n,i=(t=f,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function f(e){var t;return(0,l.Z)(this,f),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"selected",(function(){if(t.element){var e=Z(t.element)||null,n=e?e.getBoundingClientRect():null;t.setState({range:e,rect:n})}})),(0,h.Z)((0,c.Z)(t),"reply",(function(){if(v.Z.isOpen()){var e=A();e&&!e.disabled&&(e.quote(k(t.state.range)),t.setState({range:null,rect:null}),m())}else{var n=k(t.state.range);v.Z.open(Object.assign({},t.props.posting,{default:n})),t.setState({range:null,rect:null}),window.setTimeout(m,1e3)}})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,o.Z)("div",{},void 0,s().createElement("div",{ref:function(e){e&&(t.element=e)},onMouseUp:t.selected,onTouchEnd:t.selected},t.props.children),!!t.state.rect&&(0,o.Z)("div",{className:"quote-control",style:{position:"absolute",left:t.state.rect.left+window.scrollX,top:t.state.rect.bottom+window.scrollY}},void 0,a||(a=(0,o.Z)("div",{className:"quote-control-arrow"})),(0,o.Z)("div",{className:"quote-control-inner"},void 0,(0,o.Z)("button",{className:"btn quote-control-btn",type:"button",onClick:t.reply},void 0,pgettext("post reply","Quote")))))})),t.state={range:null,rect:null},t.element=null,t}return(0,r.Z)(f)}(s().Component);function m(){var e=document.querySelector("#posting-mount textarea");e.focus(),e.selectionStart=e.selectionEnd=e.value.length}var Z=function(e){if(void 0!==window.getSelection){var t=window.getSelection();if(t&&"Range"===t.type&&1===t.rangeCount){var n=t.getRangeAt(0);if(g(n,e)&&y(n)&&b(n.cloneContents()))return n}}},g=function(e,t){var n=e.commonAncestorContainer;if(n===t)return!0;for(var a=n.parentNode;a;){if(a===t)return!0;a=a.parentNode}return!1},y=function(e){var t=e.commonAncestorContainer;if("ARTICLE"===t.nodeName)return!0;if(t.dataset&&"1"===t.dataset.noquote)return!1;for(var n=t.parentNode;n;){if(n.dataset&&"1"===n.dataset.noquote)return!1;if("ARTICLE"===n.nodeName)return!0;n=n.parentNode}return!1},b=function e(t){for(var n=0;n<t.childNodes.length;n++){var a=t.childNodes[n];if(a.nodeType===Node.TEXT_NODE&&a.textContent&&a.textContent.trim().length>0)return!0;if("IMG"===a.nodeName)return!0;if(e(a))return!0}return!1},_=n(42982),N=n(70885),k=function(e){var t=x(e),n=L(e.cloneContents().childNodes,[]),a=t?'[quote="'.concat(t,'"]\n'):"[quote]\n",i="\n[/quote]\n\n",s=C(e);return s?(a+=s.syntax?"[code=".concat(s.syntax,"]\n"):"[code]\n",i="\n[/code]"+i):E(e)?(n=n.trim(),a+="`",i="`"+i):n=n.trim(),a+n+i},x=function(e){var t=e.commonAncestorContainer;if(w(t))return R(t);for(var n=t.parentNode;n;){if(w(n))return R(n);n=n.parentNode}return""},w=function(e){return e.nodeType===Node.ELEMENT_NODE&&("ARTICLE"===e.nodeName||"BLOCKQUOTE"===e.nodeName&&e.dataset&&"quote"===e.dataset.block)},R=function(e){return e.dataset&&e.dataset.author||null},C=function(e){var t=e.commonAncestorContainer;if(S(t))return P(t);for(var n=t.parentNode;n;){if(S(n))return P(n);n=n.parentNode}return null},S=function(e){return"PRE"===e.nodeName},E=function(e){var t=e.commonAncestorContainer;if("CODE"===t.nodeName)return!0;for(var n=t.parentNode;n;){if(w(n))return!1;if("CODE"===n.nodeName)return!0;n=n.parentNode}return!1},P=function(e){return e.dataset?{syntax:e.dataset.syntax||null}:{syntax:null}},L=function(e,t){for(var n="",a=0;a<e.length;a++){var i=e[a];n+=O(i,t)}return n},T={H1:["\n\n# ",""],H2:["\n\n## ",""],H3:["\n\n### ",""],H4:["\n\n#### ",""],H5:["\n\n##### ",""],H6:["\n\n###### ",""],STRONG:["**","**"],EM:["*","*"],DEL:["~~","~~"],B:["[b]","[/b]"],U:["[u]","[/u]"],I:["[i]","[/i]"],SUB:["[sub]","[/sub]"],SUP:["[sup]","[/sup]"]},O=function(e,t){var n=e.dataset||{};if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e.nodeType===Node.ELEMENT_NODE){if(n.quote)return n.quote||"";if("1"===n.noquote)return""}if(e.nodeType===Node.ELEMENT_NODE&&n.quote&&n.quote.trim())return"";if("HR"===e.nodeName)return"\n\n- - -";if(T[e.nodeName]){var a=(0,N.Z)(T[e.nodeName],2),i=a[0],s=a[1];return i+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]))+s}if("A"===e.nodeName){var o=e.href,r=L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));return r?"[".concat(r,"](").concat(o,")"):"!(".concat(o,")")}if("IMG"===e.nodeName){var l=e.src,c=e.alt;return c?"![".concat(c,"](").concat(l,")"):"!(".concat(l,")")}if("DIV"===e.nodeName||"ASIDE"===e.nodeName){var u=n.block&&n.block.toUpperCase();if(u&&T[u]){var d=(0,N.Z)(T[u],2),p=d[0],h=d[1];return p+L(e.childNodes,[].concat((0,_.Z)(t),[u]))+h}return L(e.childNodes,t)}if("BLOCKQUOTE"===e.nodeName){if("spoiler"===n.block){var v=L(e.childNodes,[].concat((0,_.Z)(t),["SPOILER"])).trim();if(!v)return"";var f="\n[spoiler]\n";return(f+=v)+"\n[/spoiler]"}var m=L(e.childNodes,[].concat((0,_.Z)(t),["QUOTE"])).trim();if(!m)return"";var Z=R(e),g=Z?"\n[quote=".concat(Z,"]\n"):"\n\n[quote]\n";return(g+=m)+"\n[/quote]"}if("PRE"===e.nodeName){var y=n.syntax||null,b=e.querySelector("code"),k=b&&b.innerText||"";return k.trim()?"\n[code"+(y?"="+y:"")+"]"+k+"[/code]":""}if("CODE"===e.nodeName)return"`"+e.innerText+"`";if("P"===e.nodeName)return"\n"+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));if("UL"===e.nodeName||"OL"===e.nodeName)return(0===t.filter((function(e){return"OL"===e||"UL"===e})).length?"\n":"")+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));if("LI"===e.nodeName){for(var x="",w=t.filter((function(e){return"OL"===e||"UL"===e})).length,C=1;C<w;C++)x+="    ";x+="OL"===t[t.length-1]?n.index?n.index+". ":"1. ":"- ";var S=L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));return S.trim()?"\n"+x+S:""}return"SPAN"===e.nodeName?L(e.childNodes,t):""};function A(){return window.misagoReply}function B(e,t){window.misagoReply={disabled:e,quote:t}}function I(){window.misagoReply=null}var D=n(57026),j=n(43345),z=n(30381),U=n.n(z);function M(e){return e.filter((function(e){return e.id&&!e.isRemoved})).map((function(e){return e.id}))}var q,H=n(12891),F=n(78657),Y=n(53904),V=n(94184),G=n.n(V),$=n(32233),W=n(69092),Q=n(59801),K=n(48772);function J(e){var t=e.attachment;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,q||(q=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Attachment details"))),(0,o.Z)("div",{className:"modal-body"},void 0,!!t.is_image&&(0,o.Z)("div",{className:"markup-editor-attachment-modal-preview"},void 0,(0,o.Z)("a",{href:t.url.index+"?shva=1",target:"_blank"},void 0,(0,o.Z)("img",{src:t.url.index+"?shva=1",alt:""}))),(0,o.Z)("div",{className:"markup-editor-attachment-modal-filename"},void 0,t.filename),(0,o.Z)("div",{className:"row markup-editor-attachment-modal-details"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-md-3"},void 0,(0,o.Z)("strong",{},void 0,t.filetype+", "+(0,K.Z)(t.size)),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Type and size")))),(0,o.Z)("div",{className:"col-xs-12 col-md-4"},void 0,(0,o.Z)("strong",{},void 0,(0,o.Z)("abbr",{title:t.uploaded_on.format("LLL")},void 0,t.uploaded_on.fromNow())),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Uploaded at")))),(0,o.Z)("div",{className:"col-xs-12 col-md-3"},void 0,t.url.uploader?(0,o.Z)("a",{href:t.url.uploader,target:"_blank",className:"item-title"},void 0,t.uploader_name):(0,o.Z)("span",{className:"item-title"},void 0,t.uploader_name),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Uploader")))))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}var X,ee,te,ne,ae,ie,se=function(e,t,n,a,i){var s=e.text||i||"",o=e.prefix;o+=n+s+a,t(o+=e.suffix),window.setTimeout((function(){var t=e.start+n.length;e.textarea.focus(),e.textarea.setSelectionRange(t,t+s.length)}),250)},oe=function(e,t,n){var a=e.prefix;a+=n,t(a+=e.suffix),window.setTimeout((function(){var t=e.end+n.length;e.textarea.focus(),e.textarea.setSelectionRange(t,t)}),250)},re=function(e){if(document.selection){e.focus();var t=document.selection.createRange(),n=t.text.length;return t.moveStart("character",-e.value.length),le(e,t.text.length-n,t.text.length)}if(e.selectionStart||"0"==e.selectionStart)return le(e,e.selectionStart,e.selectionEnd)},le=function(e,t,n){return{textarea:e,start:t,end:n,text:e.value.substring(t,n),prefix:e.value.substring(0,t),suffix:e.value.substring(n)}},ce=function(e){var t,n=e.attachment,a=e.disabled,i=e.element,s=e.setState,r=e.update;return(0,o.Z)("div",{className:"markup-editor-attachments-item"},void 0,(0,o.Z)("div",{className:"markup-editor-attachment"},void 0,(0,o.Z)("div",{className:"markup-editor-attachment-details"},void 0,n.id?(0,o.Z)("a",{className:"item-title",href:n.url.index+"?shva=1",target:"_blank",onClick:function(e){e.preventDefault(),Q.Z.show(t||(t=(0,o.Z)(J,{attachment:n})))}},void 0,n.filename):(0,o.Z)("strong",{className:"item-title"},void 0,n.filename),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("ul",{className:"list-unstyled list-inline"},void 0,!n.id&&(0,o.Z)("li",{},void 0,n.progress+"%"),!!n.filetype&&(0,o.Z)("li",{},void 0,n.filetype),n.size>0&&(0,o.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Insert into message"),type:"button",disabled:a,onClick:function(){var e=function(e){var t="[";return e.is_image?(t+="!["+e.filename+"]",t+="("+(e.url.thumb||e.url.index)+"?shva=1)"):t+=e.filename,t+"]("+e.url.index+"?shva=1)"}(n),t=re(i);oe(t,r,e)}},void 0,X||(X=(0,o.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){var t=e.attachments;if(window.confirm(pgettext("markup editor","Remove this attachment?")))return{attachments:t.filter((function(e){return e.id!==n.id}))}}))}},void 0,ee||(ee=(0,o.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","See error"),type:"button",onClick:function(){Y.Z.error(interpolate(pgettext("markup editor","%(filename)s: %(error)s"),{filename:n.filename,error:n.error},!0))}},void 0,te||(te=(0,o.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){return{attachments:e.attachments.filter((function(e){return e.key!==n.key}))}}))}},void 0,ne||(ne=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))))},ue=function(e){var t=e.attachments,n=e.disabled,a=e.element,i=e.setState,s=e.update;return(0,o.Z)("div",{className:"markup-editor-attachments"},void 0,(0,o.Z)("div",{className:"markup-editor-attachments-container"},void 0,t.map((function(e){return(0,o.Z)(ce,{attachment:e,disabled:n,element:a,setState:i,update:s},e.key||e.id)}))))},de=n(82211),pe=function(e){var t=e.canProtect,n=e.disabled,a=e.empty,i=e.preview,s=e.isProtected,r=e.submitText,l=e.showPreview,c=e.closePreview,u=e.enableProtection,d=e.disableProtection;return(0,o.Z)("div",{className:"markup-editor-footer"},void 0,!!t&&(0,o.Z)(de.Z,{className:"btn-default btn-icon hidden-sm hidden-md hidden-lg",title:s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"),type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open")),!!t&&(0,o.Z)("div",{},void 0,(0,o.Z)(de.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open"),s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ae||(ae=(0,o.Z)("div",{className:"markup-editor-spacer"})),i?(0,o.Z)(de.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,o.Z)(de.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,o.Z)(de.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,r||gettext("Post")))},he=n(96359);var ve,fe,me,Ze,ge,ye,be,_e,Ne,ke,xe,we,Re,Ce,Se,Ee,Pe,Le,Te,Oe,Ae,Be,Ie,De,je,ze,Ue,Me,qe,He,Fe,Ye,Ve,Ge,$e,We,Qe,Ke,Je,Xe,et,tt,nt,at,it,st=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.syntax.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(Object.assign({},a,{text:o}),i,r+"```"+s+"\n"+o+"\n```\n\n"),Q.Z.hide(),!1})),t.state={error:null,syntax:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ie||(ie=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,o.Z)("select",{id:"markup_code_syntax",className:"form-control",value:this.state.syntax,onChange:function(t){return e.setState({syntax:t.target.value})}},void 0,(0,o.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),ot.map((function(e){var t=e.value,n=e.name;return(0,o.Z)("option",{value:t},t,n)})))),(0,o.Z)(he.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_code_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert code"))))))}}]),i}(s().Component),ot=[{value:"bash",name:"Bash"},{value:"c",name:"C"},{value:"c#",name:"C#"},{value:"c++",name:"C++"},{value:"css",name:"CSS"},{value:"diff",name:"Diff"},{value:"go",name:"Go"},{value:"graphql",name:"GraphQL"},{value:"html,",name:"HTML"},{value:"xml",name:"XML"},{value:"json",name:"JSON"},{value:"java",name:"Java"},{value:"javascript",name:"JavaScript"},{value:"kotlin",name:"Kotlin"},{value:"less",name:"Less"},{value:"lua",name:"Lua"},{value:"makefile",name:"Makefile"},{value:"markdown",name:"Markdown"},{value:"objective-C",name:"Objective-C"},{value:"php",name:"PHP"},{value:"perl",name:"Perl"},{value:"plain",name:"Plain"},{value:"text",name:"text"},{value:"python",name:"Python"},{value:"repl",name:"REPL"},{value:"r",name:"R"},{value:"ruby",name:"Ruby"},{value:"rust",name:"Rust"},{value:"scss",name:"SCSS"},{value:"sql",name:"SQL"},{value:"shell",name:"Shell Session"},{value:"swift",name:"Swift"},{value:"toml",name:"TOML"},{value:"ini",name:"INI"},{value:"typescript",name:"TypeScript"},{value:"visualbasic",name:"Visual Basic .NET"},{value:"webassembly",name:"WebAssembly"},{value:"yaml",name:"YAML"}],rt=st;function lt(){return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ve||(ve=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,o.Z)("div",{className:"modal-body formatting-help"},void 0,(0,o.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,o.Z)(ct,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),fe||(fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,o.Z)(ct,{markup:pgettext("markup help","**This text will be bold**"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),me||(me=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,o.Z)(ct,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),Ze||(Ze=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),ge||(ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),ye||(ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),be||(be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link")),_e||(_e=(0,o.Z)(ct,{markup:"<http://example.com>",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),Ne||(Ne=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,o.Z)(ct,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),ke||(ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),xe||(xe=(0,o.Z)(ct,{markup:"[url]http://example.com[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),we||(we=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,o.Z)(ct,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Re||(Re=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image")),Ce||(Ce=(0,o.Z)(ct,{markup:"!(http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Se||(Se=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,o.Z)(ct,{markup:"!["+pgettext("markup help","Image text")+"](http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://placekitten.com/38/38"}))}),Ee||(Ee=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Pe||(Pe=(0,o.Z)(ct,{markup:"[img]http://placekitten.com/38/38[/img]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Le||(Le=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Te||(Te=(0,o.Z)(ct,{markup:"@username",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"@username"))})),Oe||(Oe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,o.Z)(ct,{markup:pgettext("markup help","# First level heading"),result:(0,o.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),Ae||(Ae=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,o.Z)(ct,{markup:pgettext("markup help","## Second level heading"),result:(0,o.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),Be||(Be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,o.Z)(ct,{markup:pgettext("markup help","### Third level heading"),result:(0,o.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),Ie||(Ie=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,o.Z)(ct,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,o.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),De||(De=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,o.Z)(ct,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,o.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),je||(je=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),ze||(ze=(0,o.Z)(ct,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,o.Z)("ul",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),Ue||(Ue=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Me||(Me=(0,o.Z)(ct,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,o.Z)("ol",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),qe||(qe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,o.Z)(ct,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,o.Z)("blockquote",{},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),He||(He=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,o.Z)(ct,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Fe||(Fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text with title (BBCode)")),(0,o.Z)(ct,{markup:'[quote="'+pgettext("markup help","Quote title")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quote title has written:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Ye||(Ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,o.Z)(ct,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,o.Z)(dt,{},void 0,pgettext("markup help","Secret text"))}),Ve||(Ve=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,o.Z)(ct,{markup:pgettext("markup help","`Inline code`"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Ge||(Ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block")),$e||($e=(0,o.Z)(ct,{markup:'```\nalert("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),We||(We=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),Qe||(Qe=(0,o.Z)(ct,{markup:'```python\nprint("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),Ke||(Ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),Je||(Je=(0,o.Z)(ct,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Xe||(Xe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),et||(et=(0,o.Z)(ct,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),tt||(tt=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),nt||(nt=(0,o.Z)(ct,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))})),at||(at=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),it||(it=(0,o.Z)(ct,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}function ct(e){var t=e.markup,n=e.result;return(0,o.Z)("div",{className:"formatting-help-item"},void 0,(0,o.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{},void 0,t))),(0,o.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,o.Z)("article",{className:"misago-markup"},void 0,n)))}var ut,dt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),(t=a.call(this,e)).state={reveal:!1},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,o.Z)("blockquote",{className:"spoiler-body"},void 0,(0,o.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,o.Z)("div",{className:"spoiler-overlay"},void 0,(0,o.Z)("button",{className:"spoiler-reveal",type:"button",onClick:function(){e.setState({reveal:!0})}},void 0,gettext("Reveal spoiler"))))}}]),i}(s().Component),pt=n(19755),ht=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function vt(e){return ht.test(pt.trim(e))}var ft,mt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"!["+s+"]("+o+")"):oe(a,i,"!("+o+")"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ut||(ut=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image description"),helpText:pgettext("markup editor","Optional but recommended . Will be displayed instead of image when it fails to load.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert image"))))))}}]),i}(s().Component);var Zt,gt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"["+s+"]("+o+")"):oe(a,i,"<"+o+">"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ft||(ft=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link text"),helpText:pgettext("markup editor","Optional. Will be displayed instead of link's address.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(s().Component);var yt,bt,_t=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.author.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(a,i,s?r+'[quote="'+s+'"]\n'+o+"\n[/quote]\n\n":r+"[quote]\n"+o+"\n[/quote]\n\n"),Q.Z.hide(),!1})),t.state={error:null,author:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Zt||(Zt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_quote_author",label:pgettext("markup editor","Quote's author or source"),helpText:pgettext("markup editor",'Optional. If it\'s username, put "@" before it ("@JohnDoe").')},void 0,(0,o.Z)("input",{id:"markup_quote_author",className:"form-control",type:"text",value:this.state.author,onChange:function(t){return e.setState({author:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_quote_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(s().Component),Nt=function(e){var t=e.disabled,n=e.icon,a=e.title,i=e.onClick;return(0,o.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:t,onClick:i},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,n))},kt="12345678990abcdefghijklmnopqrstuvwxyz",xt=kt.length,wt=function(e){for(var t=[],n=0;n<e;n++){var a=Math.floor(Math.random()*xt);t.push(kt[a])}return t.join("")},Rt=function(e,t){var n=1024*$.Z.get("user").acl.max_attachment_size;if(e.size>n)Y.Z.error(interpolate(pgettext("markup editor","File %(filename)s is bigger than %(limit)s."),{filename:e.name,limit:(0,K.Z)(n)},!0));else{var a={id:null,key:wt(32),error:null,uploaded_on:null,progress:0,filename:e.name,filetype:null,is_image:!1,size:e.size,url:null,uploader_name:null};t((function(e){var t=e.attachments;return{attachments:[a].concat(t)}}));var i=function(){t((function(e){return{attachments:e.attachments.concat()}}))},s=new FormData;s.append("upload",e),F.Z.upload($.Z.get("ATTACHMENTS_API"),s,(function(e){a.progress=e,i()})).then((function(e){Object.assign(a,e,{uploaded_on:U()(e.uploaded_on)}),i()}),(function(e){400===e.status||413===e.status?(a.error=e.detail,Y.Z.error(e.detail),i()):Y.Z.apiError(e)}))}},Ct=function(e){var t=e.disabled,n=e.element,a=e.update,i=e.updateAttachments,s=[{name:pgettext("markup editor","Strong"),icon:"format_bold",onClick:function(){se(re(n),a,"**","**",pgettext("example markup","Strong text"))}},{name:pgettext("markup editor","Emphasis"),icon:"format_italic",onClick:function(){se(re(n),a,"*","*",pgettext("example markup","Text with emphasis"))}},{name:pgettext("markup editor","Strikethrough"),icon:"format_strikethrough",onClick:function(){se(re(n),a,"~~","~~",pgettext("example markup","Text with strikethrough"))}},{name:pgettext("markup editor","Horizontal ruler"),icon:"remove",onClick:function(){oe(re(n),a,"\n\n- - -\n\n")}},{name:pgettext("markup editor","Link"),icon:"insert_link",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(gt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Image"),icon:"insert_photo",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(mt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(_t,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Spoiler"),icon:"visibility_off",onClick:function(){!function(e,t){var n=re(e),a=n.prefix.trim().length?"\n\n":"";se(n,t,a+"[spoiler]\n","\n[/spoiler]\n\n",pgettext("markup editor","Spoiler text"))}(n,a)}},{name:pgettext("markup editor","Code"),icon:"code",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(rt,{selection:e,element:n,update:a}))}}];return $.Z.get("user").acl.max_attachment_size&&s.push({name:pgettext("markup editor","Upload file"),icon:"file_upload",onClick:function(){return e=i,(t=document.createElement("input")).type="file",t.multiple="multiple",t.addEventListener("change",(function(){for(var n=0;n<t.files.length;n++)Rt(t.files[n],e)})),void t.click();var e,t}}),(0,o.Z)("div",{className:"markup-editor-toolbar"},void 0,(0,o.Z)("div",{className:"markup-editor-toolbar-left"},void 0,s.map((function(e){var a=e.name,i=e.icon,s=e.onClick;return(0,o.Z)(Nt,{title:a,icon:i,disabled:t||!n,onClick:s},i)}))),(0,o.Z)("div",{className:"markup-editor-toolbar-right"},void 0,(0,o.Z)("div",{className:"markup-editor-controls-dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-markup-editor dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t||!n},void 0,yt||(yt=(0,o.Z)("span",{className:"material-icon"},void 0,"more_vert"))),(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,s.map((function(e){var a=e.name,i=e.icon,s=e.onClick;return(0,o.Z)("li",{},i,(0,o.Z)("button",{type:"button",className:"btn-link",disabled:t||!n,onClick:s},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,i),a))})))),(0,o.Z)(Nt,{title:pgettext("markup editor","Formatting help"),icon:"help_outline",onClick:function(){Q.Z.show(bt||(bt=(0,o.Z)(lt,{})))}})))},St=n(19755);var Et=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showPreview",(function(){t.state.loading||(t.setState({loading:!0,preview:!0,element:null}),F.Z.post($.Z.get("PARSE_MARKUP_API"),{post:t.props.value}).then((function(e){t.setState({loading:!1,parsed:e.parsed})}),(function(e){400===e.status?Y.Z.error(e.detail):Y.Z.apiError(e),t.setState({loading:!1,preview:!1})})))})),(0,h.Z)((0,c.Z)(t),"closePreview",(function(){t.setState({loading:!1,preview:!1})})),(0,h.Z)((0,c.Z)(t),"onDrop",(function(e){if(e.preventDefault(),e.stopPropagation(),e.dataTransfer.files){var n=t.props.onAttachmentsChange;if($.Z.get("user").acl.max_attachment_size)for(var a=0;a<e.dataTransfer.files.length;a++){var i=e.dataTransfer.files[a];Rt(i,n)}}})),(0,h.Z)((0,c.Z)(t),"onPaste",(function(e){for(var n=t.props.onAttachmentsChange,a=[],i=0;i<e.clipboardData.items.length;i++){var s=e.clipboardData.items[i];"file"===s.kind&&a.push(s.getAsFile())}if(a.length&&(e.preventDefault(),e.stopPropagation(),$.Z.get("user").acl.max_attachment_size))for(var o=0;o<a.length;o++)Rt(a[o],n)})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,o.Z)("div",{className:G()("markup-editor",{"markup-editor-focused":t.state.focused&&!t.state.preview})},void 0,(0,o.Z)(Ct,{disabled:t.props.disabled||t.state.preview,element:t.state.element,update:function(e){return t.props.onChange({target:{value:e}})},updateAttachments:t.props.onAttachmentsChange}),t.state.preview?(0,o.Z)("div",{className:"markup-editor-preview"},void 0,t.state.loading?(0,o.Z)("div",{className:"ui-preview"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"240px"}})):(0,o.Z)(W.Z,{markup:t.state.parsed})):s().createElement("textarea",{className:"markup-editor-textarea form-control",placeholder:t.props.placeholder,value:t.props.value,disabled:t.props.disabled||t.state.loading,rows:6,ref:function(e){e&&t.state.element!==e&&(t.setState({element:e}),function(e,t){St(t).atwho({at:"@",displayTpl:'<li><img src="${avatar}" alt="">${username}</li>',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(e,t){St.getJSON($.Z.get("MENTION_API"),{q:e},t)}}}),St(t).on("inserted.atwho",(function(t,n,a){e.onChange(t)}))}(t.props,e))},onChange:t.props.onChange,onDrop:t.onDrop,onFocus:function(){return t.setState({focused:!0})},onPaste:t.onPaste,onBlur:function(){return t.setState({focused:!1})}}),t.props.attachments.length>0&&(0,o.Z)(ue,{attachments:t.props.attachments,disabled:t.props.disabled||t.state.preview,element:t.state.element,setState:t.props.onAttachmentsChange,update:function(e){return t.props.onChange({target:{value:e}})}}),(0,o.Z)(pe,{preview:t.state.preview,canProtect:t.props.canProtect,isProtected:t.props.isProtected,disabled:t.props.disabled,empty:t.props.value.trim().length<$.Z.get("SETTINGS").post_length_min||t.state.loading,enableProtection:t.props.enableProtection,disableProtection:t.props.disableProtection,showPreview:t.showPreview,closePreview:t.closePreview,submitText:t.props.submitText}))})),t.state={element:null,focused:!1,loading:!1,preview:!1,parsed:null},t}return(0,r.Z)(i)}(s().Component),Pt=n(92490);var Lt,Tt,Ot,At,Bt,It,Dt,jt,zt,Ut,Mt,qt,Ht,Ft,Yt,Vt="posting-active",Gt="posting-default",$t="posting-minimized",Wt="posting-fullscreen",Qt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,l.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(Vt,Gt)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(Vt,Gt,$t,Wt)}},{key:"componentWillReceiveProps",value:function(e){var t=e.fullscreen;e.minimized?(document.body.classList.remove(Gt,Wt),document.body.classList.add($t)):t?(document.body.classList.remove(Gt,$t),document.body.classList.add(Wt)):(document.body.classList.remove(Wt,$t),document.body.classList.add(Gt))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fullscreen,a=e.minimized;return(0,o.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,o.Z)("div",{className:"posting-dialog-container"},void 0,t))}}]),i}(s().Component),Kt=Qt,Jt=function(e){var t=e.children;return(0,o.Z)("div",{className:"posting-dialog-body"},void 0,t)},Xt=function(e){var t=e.close,n=e.message;return(0,o.Z)("div",{className:"posting-dialog-error"},void 0,Lt||(Lt=(0,o.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,o.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,o.Z)("p",{},void 0,n),(0,o.Z)("button",{type:"button",className:"btn btn-default",onClick:t},void 0,pgettext("modal","Close"))))},en=function(e){var t=e.children,n=e.close,a=e.fullscreen,i=e.minimize,s=e.minimized,r=e.fullscreenEnter,l=e.fullscreenExit,c=e.open;return(0,o.Z)("div",{className:"posting-dialog-header"},void 0,(0,o.Z)("div",{className:"posting-dialog-caption"},void 0,t),s?(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,Tt||(Tt=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,Ot||(Ot=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,At||(At=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:r},void 0,Bt||(Bt=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,It||(It=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))};function tn(e){var t=e.isClosed,n=e.isHidden,a=e.isPinned,i=e.disabled,s=e.options,r=e.close,l=e.open,c=e.hide,u=e.unhide,d=e.pinGlobally,p=e.pinLocally,h=e.unpin,v=function(e,t,n){var a=[];return 2===n&&a.push("bookmark"),1===n&&a.push("bookmark_outline"),e&&a.push("lock"),t&&a.push("visibility_off"),a}(t,n,a);return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("post thread","Options"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button",disabled:i},void 0,v.length>0?(0,o.Z)("span",{className:"btn-icons-family"},void 0,v.map((function(e){return(0,o.Z)("span",{className:"material-icon"},e,e)}))):Dt||(Dt=(0,o.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===s.pin&&2!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,jt||(jt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),s.pin>=a&&1!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,zt||(zt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned locally"))),s.pin>=a&&0!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Ut||(Ut=(0,o.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),s.close&&!!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Mt||(Mt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),s.close&&!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:r,type:"button",disabled:i},void 0,qt||(qt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),s.hide&&!!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,Ht||(Ht=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),s.hide&&!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Ft||(Ft=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post thread","Hidden")))))}var nn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n=null,a=null,i=e.map((function(e){return!1===e.post||n&&e.id!=t.state.category||(n=e.id,a=e.post),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));t.setState({isReady:!0,options:a,categories:i,category:n})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(t.minimize(),v.Z.close())})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){var n=t.state.categories.find((function(t){return e.target.value==t.value})),a=t.state.pin;n.post.pin&&n.post.pin<a&&(a=n.post.pin),t.setState({category:n.id,categoryOptions:n.post,pin:a})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onClose",(function(){t.changeValue("close",!0)})),(0,h.Z)((0,c.Z)(t),"onOpen",(function(){t.changeValue("close",!1)})),(0,h.Z)((0,c.Z)(t),"onPinGlobally",(function(){t.changeValue("pin",2)})),(0,h.Z)((0,c.Z)(t),"onPinLocally",(function(){t.changeValue("pin",1)})),(0,h.Z)((0,c.Z)(t),"onUnpin",(function(){t.changeValue("pin",0)})),(0,h.Z)((0,c.Z)(t),"onHide",(function(){t.changeValue("hide",!0)})),(0,h.Z)((0,c.Z)(t),"onUnhide",(function(){t.changeValue("hide",!1)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,options:null,title:"",category:e.category||null,categories:[],post:"",attachments:[],close:!1,hide:!1,pin:0,validators:{title:(0,H.jn)(),post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config).then(this.loadSuccess,this.loadError)}},{key:"clean",value:function(){if(!this.state.title.trim().length)return Y.Z.error(gettext("You have to enter thread title.")),!1;if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return e.title?(Y.Z.error(e.title[0]),!1):!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return F.Z.post(this.props.submit,{title:this.state.title,category:this.state.category,post:this.state.post,attachments:M(this.state.attachments),close:this.state.close,hide:this.state.hide,pin:this.state.pin})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url,this.setState({isLoading:!0})}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};if(this.state.error)return s().createElement(an,e,(0,o.Z)(Xt,{message:this.state.error,close:this.close}));if(!this.state.isReady)return s().createElement(an,e,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,Yt||(Yt=(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:!0,type:"text"}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,o.Z)(Pt.Eg,{},void 0,(0,o.Z)("input",{className:"form-control",disabled:!0,type:"text"}))))),(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("post thread submit","Post thread"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})));var t=!!(this.state.options.close||this.state.options.hide||this.state.options.pin);return s().createElement(an,e,(0,o.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,o.Z)(Pt.Eg,{},void 0,(0,o.Z)(D.Z,{choices:this.state.categories,disabled:this.state.isLoading,onChange:this.onCategoryChange,value:this.state.category})),t&&(0,o.Z)(Pt.Eg,{shrink:!0},void 0,(0,o.Z)(tn,{isClosed:this.state.close,isHidden:this.state.hide,isPinned:this.state.pin,disabled:this.state.isLoading,options:this.state.options,close:this.onClose,open:this.onOpen,hide:this.onHide,unhide:this.onUnhide,pinGlobally:this.onPinGlobally,pinLocally:this.onPinLocally,unpin:this.onUnpin})))),(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(j.Z),an=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,pgettext("post thread","Start new thread")),(0,o.Z)(Jt,{},void 0,t))};function sn(e){var t=e.split(",").map((function(e){return e.trim().toLowerCase()})).filter((function(e){return e.length>0}));return t.filter((function(e,n){return t.indexOf(e)==n}))}var on=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard private thread?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onToChange",(function(e){t.changeValue("to",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})}));var n=(e.to||[]).map((function(e){return e.username})).join(", ");return t.state={isLoading:!1,error:null,minimized:!1,fullscreen:!1,to:n,title:"",post:"",attachments:[],validators:{title:(0,H.jn)(),post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"clean",value:function(){if(!sn(this.state.to).length)return Y.Z.error(gettext("You have to enter at least one recipient.")),!1;if(!this.state.title.trim().length)return Y.Z.error(gettext("You have to enter thread title.")),!1;if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return e.title?(Y.Z.error(e.title[0]),!1):!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return F.Z.post(this.props.submit,{to:sn(this.state.to),title:this.state.title,post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url,this.setState({isLoading:!0})}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.to||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return s().createElement(rn,e,(0,o.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onToChange,placeholder:pgettext("post thread","Recipients, eg.: Danny, Lisa, Alice"),type:"text",value:this.state.to}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title})))),(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(j.Z),rn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,pgettext("post thread","Start private thread")),(0,o.Z)(Jt,{},void 0,t))};var ln=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){t.setState({isReady:!0,post:e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]":t.state.post})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post reply","Are you sure you want to discard your reply?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,post:t.props.default||"",attachments:[],validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.post(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post reply","Your reply has been posted.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e={thread:this.props.thread,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(cn,e,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(cn,e,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post reply submit","Post reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(cn,e,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),cn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.thread;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("post reply","Reply to: %(thread)s"),{thread:u.title},!0)),(0,o.Z)(Jt,{},void 0,t))};var un=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n;t.setState({isReady:!0,post:e.post,attachments:(n=e.attachments,n.map((function(e){return Object.assign({},e,{uploaded_on:U()(e.uploaded_on)})}))),protect:e.is_protected,canProtect:e.can_protect})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(gettext("Are you sure you want to discard changes?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onProtect",(function(){t.setState({protect:!0})})),(0,h.Z)((0,c.Z)(t),"onUnprotect",(function(){t.setState({protect:!1})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:!1,minimized:!1,fullscreen:!1,post:"",attachments:[],protect:!1,canProtect:!1,validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.put(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments),protect:this.state.protect})}},{key:"handleSuccess",value:function(e){Y.Z.success(gettext("Reply has been edited.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e=this,t={post:this.props.post,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(dn,t,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(dn,t,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,canProtect:this.state.canProtect,isProtected:this.state.protect,enableProtection:function(){return e.setState({protect:!0})},disableProtection:function(){return e.setState({protect:!1})},value:this.state.post,submitText:pgettext("edit reply submit","Edit reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(dn,t,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("edit reply submit","Edit reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),dn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.post;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("edit reply","Edit reply by %(poster)s from %(date)s"),{poster:u.poster?u.poster.username:u.poster_name,date:u.posted_on.fromNow()},!0)),(0,o.Z)(Jt,{},void 0,t))};function pn(e){switch(e.mode){case"START":return s().createElement(nn,e);case"START_PRIVATE":return s().createElement(on,e);case"REPLY":return s().createElement(ln,e);case"EDIT":return s().createElement(un,e);default:return null}}},12891:function(e,t,n){"use strict";n.d(t,{Jh:function(){return o},jn:function(){return s}});var a=n(55210),i=n(32233);function s(){return[(0,a.Ei)(i.Z.get("SETTINGS").thread_title_length_min,(function(e,t){var n=ngettext("Thread title should be at least %(limit_value)s character long (it has %(show_value)s).","Thread title should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)})),(0,a.BS)(i.Z.get("SETTINGS").thread_title_length_max,(function(e,t){var n=ngettext("Thread title cannot be longer than %(limit_value)s character (it has %(show_value)s).","Thread title cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]}function o(){return i.Z.get("SETTINGS").post_length_max?[r(),(0,a.BS)(i.Z.get("SETTINGS").post_length_max||1e6,(function(e,t){var n=ngettext("Posted message cannot be longer than %(limit_value)s character (it has %(show_value)s).","Posted message cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]:[r()]}function r(){return(0,a.Ei)(i.Z.get("SETTINGS").post_length_min,(function(e,t){var n=ngettext("Posted message should be at least %(limit_value)s character long (it has %(show_value)s).","Posted message should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))}},60471:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,o.Z)(e),"change",(function(t){return function(){e.props.onChange({target:{value:t}})}})),e}return(0,s.Z)(p,[{key:"getChoice",value:function(){var e=this,t=null;return this.props.choices.map((function(n){n.value===e.props.value&&(t=n)})),t}},{key:"getIcon",value:function(){return this.getChoice().icon}},{key:"getLabel",value:function(){return this.getChoice().label}},{key:"render",value:function(){var e=this;return(0,a.Z)("div",{className:"btn-group btn-select-group"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-select dropdown-toggle",id:this.props.id||null,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)(h,{icon:this.getIcon()}),this.getLabel()),(0,a.Z)("ul",{className:"dropdown-menu"},void 0,this.props.choices.map((function(t,n){return(0,a.Z)("li",{},n,(0,a.Z)("button",{type:"button",className:"btn-link",onClick:e.change(t.value)},void 0,(0,a.Z)(h,{icon:t.icon}),t.label))}))))}}]),p}(n.n(d)().Component);function h(e){var t=e.icon;return t?(0,a.Z)("span",{className:"material-icon"},void 0,t):null}},14467:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=(n(57588),n(32233)),d=n(82211),p=n(43345),h=n(47235),v=n(78657),f=n(59801),m=n(53904),Z=n(93051),g=n(19755);var y=function(e){(0,r.Z)(y,e);var t,n,p=(t=y,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function y(e){var t;return(0,s.Z)(this,y),(t=p.call(this,e)).state={isLoading:!1,showActivation:!1,username:"",password:"",validators:{username:[],password:[]}},t}return(0,o.Z)(y,[{key:"clean",value:function(){return!!this.isValid()||(m.Z.error(gettext("Fill out both fields.")),!1)}},{key:"send",value:function(){return v.Z.post(u.Z.get("AUTH_API"),{username:this.state.username,password:this.state.password})}},{key:"handleSuccess",value:function(){var e=g("#hidden-login-form");e.append('<input type="text" name="username" />'),e.append('<input type="password" name="password" />'),e.find('input[type="hidden"]').val(v.Z.getCsrfToken()),e.find('input[name="redirect_to"]').val(window.location.pathname),e.find('input[name="username"]').val(this.state.username),e.find('input[name="password"]').val(this.state.password),e.submit(),this.setState({isLoading:!0})}},{key:"handleError",value:function(e){400===e.status?"inactive_admin"===e.code?m.Z.info(e.detail):"inactive_user"===e.code?(m.Z.info(e.detail),this.setState({showActivation:!0})):"banned"===e.code?((0,Z.Z)(e.detail),f.Z.hide()):m.Z.error(e.detail):403===e.status&&e.ban?((0,Z.Z)(e.ban),f.Z.hide()):m.Z.apiError(e)}},{key:"getActivationButton",value:function(){return this.state.showActivation?(0,i.Z)("a",{className:"btn btn-success btn-block",href:u.Z.get("REQUEST_ACTIVATION_URL")},void 0,gettext("Activate account")):null}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog modal-sm modal-sign-in",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Sign in"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(h.Z,{buttonLabel:gettext("Sign in with %(site)s"),formLabel:gettext("Or use your forum account:"),labelClassName:"text-center"}),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_username",onChange:this.bindInput("username"),placeholder:gettext("Username or e-mail"),type:"text",value:this.state.username}))),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_password",onChange:this.bindInput("password"),placeholder:gettext("Password"),type:"password",value:this.state.password})))),(0,i.Z)("div",{className:"modal-footer"},void 0,this.getActivationButton(),(0,i.Z)(d.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Sign in")),(0,i.Z)("a",{className:"btn btn-default btn-block",href:u.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Forgot password?"))))))}}]),y}(p.Z)},24678:function(e,t,n){"use strict";n.d(t,{Jj:function(){return h},ZP:function(){return p},pg:function(){return v}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);function d(e){var t=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(e){return!1}}();return function(){var n,a=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r.Z)(this,n)}}var p=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getClass",value:function(){return e=this.props.status,t="",e.is_banned?t="banned":e.is_hidden?t="offline":e.is_online_hidden?t="online":e.is_offline_hidden?t="offline":e.is_online?t="online":e.is_offline&&(t="offline"),"user-status user-"+t;var e,t}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.getClass()},void 0,this.props.children)}}]),n}(u().Component),h=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getIcon",value:function(){return this.props.status.is_banned?"remove_circle_outline":this.props.status.is_hidden?"help_outline":this.props.status.is_online_hidden?"label":this.props.status.is_offline_hidden?"label_outline":this.props.status.is_online?"lens":this.props.status.is_offline?"panorama_fish_eye":void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:"material-icon status-icon"},void 0,this.getIcon())}}]),n}(u().Component),v=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getHelp",value:function(){return e=this.props.user,(t=this.props.status).is_banned?t.banned_until?interpolate(gettext("%(username)s is banned until %(ban_expires)s"),{username:e.username,ban_expires:t.banned_until.format("LL, LT")},!0):interpolate(gettext("%(username)s is banned"),{username:e.username},!0):t.is_hidden?interpolate(gettext("%(username)s is hiding presence"),{username:e.username},!0):t.is_online_hidden?interpolate(gettext("%(username)s is online (hidden)"),{username:e.username},!0):t.is_offline_hidden?interpolate(gettext("%(username)s was last seen %(last_click)s (hidden)"),{username:e.username,last_click:t.last_click.fromNow()},!0):t.is_online?interpolate(gettext("%(username)s is online"),{username:e.username},!0):t.is_offline?interpolate(gettext("%(username)s was last seen %(last_click)s"),{username:e.username,last_click:t.last_click.fromNow()},!0):void 0;var e,t}},{key:"getLabel",value:function(){return this.props.status.is_banned?gettext("Banned"):this.props.status.is_hidden?gettext("Hidden"):this.props.status.is_online_hidden?gettext("Online (hidden)"):this.props.status.is_offline_hidden?gettext("Offline (hidden)"):this.props.status.is_online?gettext("Online"):this.props.status.is_offline?gettext("Offline"):void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.props.className||"status-label",title:this.getHelp()},void 0,this.getLabel())}}]),n}(u().Component)},7850:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);var d,p,h=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getEmptyMessage",value:function(){return this.props.emptyMessage?this.props.emptyMessage:gettext("No name changes have been recorded for your account.")}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,(0,a.Z)("li",{className:"list-group-item empty-message"},void 0,this.getEmptyMessage())))}}]),u}(u().Component),v=n(19605);var f=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"renderUserAvatar",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{user:this.props.change.changed_by,size:"100"})):d||(d=(0,a.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{size:"100"})))}},{key:"renderUsername",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"item-title"},void 0,this.props.change.changed_by.username):(0,a.Z)("span",{className:"item-title"},void 0,this.props.change.changed_by_username)}},{key:"render",value:function(){return(0,a.Z)("li",{className:"list-group-item"},this.props.change.id,(0,a.Z)("div",{className:"change-avatar"},void 0,this.renderUserAvatar()),(0,a.Z)("div",{className:"change-author"},void 0,this.renderUsername()),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"old-username"},void 0,this.props.change.old_username),p||(p=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"new-username"},void 0,this.props.change.new_username)),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("abbr",{title:this.props.change.changed_on.format("LLL")},void 0,this.props.change.changed_on.fromNow())))}}]),u}(u().Component);var m,Z,g=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,this.props.changes.map((function(e){return(0,a.Z)(f,{change:e},e.id)}))))}}]),u}(u().Component),y=n(44039);var b=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,m||(m=(0,a.Z)("div",{className:"change-avatar"},void 0,(0,a.Z)("span",{className:"user-avatar"},void 0,(0,a.Z)(v.ZP,{size:"100"})))),(0,a.Z)("div",{className:"change-author"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,100)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," "),Z||(Z=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(80,140)+"px"}},void 0," ")))}}]),u}(u().Component);var _,N=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-preview"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,a.Z)(b,{hiddenOnMobile:e>0},e)}))))}}]),u}(u().Component);var k=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,a.Z)(g,{changes:this.props.changes}):(0,a.Z)(h,{emptyMessage:this.props.emptyMessage}):_||(_=(0,a.Z)(N,{}))}}]),u}(u().Component)},40429:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var a,i=n(22928),s=n(57588),o=n.n(s),r=n(19605),l=n(24678);function c(e){var t=e.showStatus,n=e.user;return(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)(u,{showStatus:t,user:n}),(0,i.Z)(d,{user:n}),a||(a=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)(p,{user:n}),(0,i.Z)(h,{user:n}),(0,i.Z)(v,{user:n}))}function u(e){var t=e.showStatus,n=e.user;return t?(0,i.Z)("li",{className:"user-stat-status"},void 0,(0,i.Z)(l.ZP,{status:n.status},void 0,(0,i.Z)(l.pg,{status:n.status,user:n}))):null}function d(e){var t=e.user.joined_on,n=interpolate(gettext("Joined on %(joined_on)s"),{joined_on:t.format("LL, LT")},!0),a=interpolate(gettext("Joined %(joined_on)s"),{joined_on:t.fromNow()},!0);return(0,i.Z)("li",{className:"user-stat-join-date"},void 0,(0,i.Z)("abbr",{title:n},void 0,a))}function p(e){var t=e.user,n=f("user-stat-posts",t.posts),a=ngettext("%(posts)s post","%(posts)s posts",t.posts);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{posts:t.posts},!0))}function h(e){var t=e.user,n=f("user-stat-threads",t.threads),a=ngettext("%(threads)s thread","%(threads)s threads",t.threads);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{threads:t.threads},!0))}function v(e){var t=e.user,n=f("user-stat-followers",t.followers),a=ngettext("%(followers)s follower","%(followers)s followers",t.followers);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{followers:t.followers},!0))}function f(e,t){return 0===t?e+" user-stat-empty":e}function m(e){var t=e.rank,n=e.title||t.title||t.name,a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,i.Z)("a",{className:a,href:t.url},void 0,n):(0,i.Z)("span",{className:a},void 0,n)}function Z(e){var t=e.showStatus,n=e.user,a=n.rank,s="panel user-card";return a.css_class&&(s+=" user-card-"+a.css_class),(0,i.Z)("div",{className:s},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80",user:n})))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200",user:n}))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("a",{href:n.url},void 0,n.username)),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)(m,{rank:a,title:n.title})),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)(c,{showStatus:t,user:n}))))))}var g,y,b,_=n(15671),N=n(43144),k=n(79340),x=n(6215),w=n(61120),R=n(44039);var C,S=function(e){(0,k.Z)(s,e);var t,n,a=(t=s,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(e){return!1}}(),function(){var e,a=(0,w.Z)(t);if(n){var i=(0,w.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,x.Z)(this,e)});function s(){return(0,_.Z)(this,s),a.apply(this,arguments)}return(0,N.Z)(s,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"panel user-card user-card-preview"},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,g||(g=(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,y||(y=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200"})))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),b||(b=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," "))))))))}}]),s}(o().Component);function E(e){var t=e.colClassName,n=e.cols,a=Array.apply(null,{length:n}).map(Number.call,Number);return(0,i.Z)("div",{className:"users-cards-list ui-preview"},void 0,(0,i.Z)("div",{className:"row"},void 0,a.map((function(e){var n=t;return 0!==e&&(n+=" hidden-xs"),3===e&&(n+=" hidden-sm"),(0,i.Z)("div",{className:n},e,C||(C=(0,i.Z)(S,{})))}))))}function P(e){var t=e.cols,n=e.isReady,a=e.showStatus,s=e.users,o="col-xs-12 col-sm-4";return 4===t&&(o+=" col-md-3"),n?(0,i.Z)("div",{className:"users-cards-list ui-ready"},void 0,(0,i.Z)("div",{className:"row"},void 0,s.map((function(e){return(0,i.Z)("div",{className:o},e.id,(0,i.Z)(Z,{showStatus:a,user:e}))})))):(0,i.Z)(E,{colClassName:o,cols:t})}},82125:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var a=n(15671),i=n(43144),s=n(97326),o=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=function(e){(0,o.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function d(e){var t;return(0,a.Z)(this,d),t=u.call(this,e),(0,c.Z)((0,s.Z)(t),"toggleNav",(function(){t.setState({dropdown:!t.state.dropdown})})),(0,c.Z)((0,s.Z)(t),"hideNav",(function(){t.setState({dropdown:!1})})),t.state={dropdown:!1},t}return(0,i.Z)(d,[{key:"getCompactNavClassName",value:function(){return this.state.dropdown?"compact-nav open":"compact-nav"}}]),d}(n.n(u)().Component)},7227:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,o.Z)(e),"toggle",(function(){e.props.onChange({target:{value:!e.props.value}})})),e}return(0,s.Z)(p,[{key:"getClassName",value:function(){return this.props.value?"btn btn-yes-no btn-yes-no-on":"btn btn-yes-no btn-yes-no-off"}},{key:"getIcon",value:function(){return this.props.value?this.props.iconOn||"check_box":this.props.iconOff||"check_box_outline_blank"}},{key:"getLabel",value:function(){return this.props.value?this.props.labelOn||gettext("yes"):this.props.labelOff||gettext("no")}},{key:"render",value:function(){return(0,a.Z)("button",{type:"button",onClick:this.toggle,className:this.getClassName(),id:this.props.id||null,"aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.getIcon()),(0,a.Z)("span",{className:"btn-text"},void 0,this.getLabel()))}}]),p}(n.n(d)().Component)},32233:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var a=n(15671),i=n(43144),s=(n(58294),n(95377),n(68852),n(39737),n(14316),n(43204),n(43511),n(7023),function(){function e(t){(0,a.Z)(this,e),this.isOrdered=!1,this._items=t||[]}return(0,i.Z)(e,[{key:"add",value:function(e,t,n){this._items.push({key:e,item:t,after:n&&n.after||null,before:n&&n.before||null})}},{key:"get",value:function(e,t){for(var n=0;n<this._items.length;n++)if(this._items[n].key===e)return this._items[n].item;return t}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"values",value:function(){for(var e=[],t=0;t<this._items.length;t++)e.push(this._items[t].item);return e}},{key:"order",value:function(e){return this.isOrdered||(this._items=this._order(this._items),this.isOrdered=!0),e||void 0===e?this.values():this._items}},{key:"orderedValues",value:function(){return this.order(!0)}},{key:"_order",value:function(e){var t=[];e.forEach((function(e){t.push(e.key)}));var n=[],a=[];function i(e){var t=-1;-1===a.indexOf(e.key)&&(e.after?-1!==(t=a.indexOf(e.after))&&(t+=1):e.before&&(t=a.indexOf(e.before)),-1!==t&&(n.splice(t,0,e),a.splice(t,0,e.key)))}e.forEach((function(e){e.after||e.before||(n.push(e),a.push(e.key))})),e.forEach((function(e){"_end"===e.before&&(n.push(e),a.push(e.key))}));for(var s=200;s>0&&t.length!==a.length;)s-=1,e.forEach(i);return n}}]),e}()),o=new(function(){function e(){(0,a.Z)(this,e),this._initializers=[],this._context={}}return(0,i.Z)(e,[{key:"addInitializer",value:function(e){this._initializers.push({key:e.name,item:e.initializer,after:e.after,before:e.before})}},{key:"init",value:function(e){var t=this;this._context=e,new s(this._initializers).orderedValues().forEach((function(e){e(t)}))}},{key:"has",value:function(e){return!!this._context[e]}},{key:"get",value:function(e,t){return this.has(e)?this._context[e]:t||void 0}},{key:"pop",value:function(e){if(this.has(e)){var t=this._context[e];return this._context[e]=null,t}}}]),e}());window.misago=o;var r=o},58339:function(e,t,n){"use strict";var a=n(32233),i=n(78657);a.Z.addInitializer({name:"ajax",initializer:function(){i.Z.init(a.Z.get("CSRF_COOKIE_NAME"))}})},64109:function(e,t,n){"use strict";var a=n(32233),i=n(35486),s=n(78657),o=n(53904),r=n(90287);a.Z.addInitializer({name:"auth-sync",initializer:function(e){e.get("isAuthenticated")&&window.setInterval((function(){s.Z.get(e.get("AUTH_API")).then((function(e){r.Z.dispatch((0,i.r$)(e))}),(function(e){o.Z.apiError(e)}))}),45e3)},after:"auth"})},46226:function(e,t,n){"use strict";var a=n(32233),i=n(98274),s=n(59801),o=n(90287),r=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(o.Z,r.Z,s.Z)},after:"store"})},93240:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(93825),o=n(96142),r=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(e){s.ZP.init(e,i.Z,o.Z,r.Z)}})},75147:function(e,t,n){"use strict";var a=n(22928),i=n(57588),s=n.n(i),o=n(32233),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(78657);var f=function(e){(0,u.Z)(s,e);var t,n,i=(t=s,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function s(e){var t;return(0,r.Z)(this,s),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"handleDecline",(function(){t.state.submiting||window.confirm(gettext("Declining will result in immediate deactivation and deletion of your account. This action is not reversible."))&&(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!1}).then((function(){window.location.reload(!0)})))})),(0,h.Z)((0,c.Z)(t),"handleAccept",(function(){t.state.submiting||(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!0}).then((function(){window.location.reload(!0)})))})),t.state={submiting:!1},t}return(0,l.Z)(s,[{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("button",{className:"btn btn-default",disabled:this.state.submiting,type:"buton",onClick:this.handleDecline},void 0,gettext("Decline")),(0,a.Z)("button",{className:"btn btn-primary",disabled:this.state.submiting,type:"buton",onClick:this.handleAccept},void 0,gettext("Accept and continue")))}}]),s}(s().Component),m=n(4869);o.Z.addInitializer({name:"component:accept-agreement",initializer:function(e){document.getElementById("required-agreement-mount")&&(0,m.Z)((0,a.Z)(f,{api:e.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"refresh",value:function(){window.location.reload()}},{key:"getMessage",value:function(){return this.props.signedIn?interpolate(gettext("You have signed in as %(username)s. Please refresh the page before continuing."),{username:this.props.signedIn.username},!0):this.props.signedOut?interpolate(gettext("%(username)s, you have been signed out. Please refresh the page before continuing."),{username:this.props.user.username},!0):void 0}},{key:"render",value:function(){var e="auth-message";return(this.props.signedIn||this.props.signedOut)&&(e+=" show"),(0,s.Z)("div",{className:e},void 0,(0,s.Z)("div",{className:"container"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,s.Z)("p",{},void 0,(0,s.Z)("button",{className:"btn btn-default",type:"button",onClick:this.refresh},void 0,gettext("Reload page")),(0,s.Z)("span",{className:"hidden-xs hidden-sm"},void 0," "+gettext("or press F5 key.")))))}}]),i}(n.n(d)().Component);function h(e){return{user:e.auth.user,signedIn:e.auth.signedIn,signedOut:e.auth.signedOut}}var v=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,v.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:function(e,t,n){"use strict";var a=n(32233),i=n(93051);a.Z.addInitializer({name:"component:banmed-page",initializer:function(e){e.has("BAN_MESSAGE")&&(0,i.Z)(e.get("BAN_MESSAGE"),!1)},after:"store"})},3026:function(e,t,n){"use strict";var a=n(37424),i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=n(30381),h=n.n(p),v=n(57588),f=n.n(v);function m(e){return(0,i.Z)("div",{className:"categories-list"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("No categories exist or you don't have permission to see them.")))))}function Z(e){var t=e.category;return t.description?(0,i.Z)("div",{className:"category-description",dangerouslySetInnerHTML:{__html:t.description.html}}):null}function g(e){var t=e.category;return(0,i.Z)("div",{className:y(t),title:b(t)},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)))}function y(e){return e.is_read?"read-status item-read":"read-status item-new"}function b(e){return e.is_closed?e.is_read?gettext("This category has no new posts. (closed)"):gettext("This category has new posts. (closed)"):e.is_read?gettext("This category has no new posts."):gettext("This category has new posts.")}function _(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-6 category-main"},void 0,(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)(g,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("h4",{className:"media-heading"},void 0,(0,i.Z)("a",{href:t.url.index},void 0,t.name)),(0,i.Z)(Z,{category:t}))))}var N,k,x,w=n(19605);function R(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-4 category-last-thread"},void 0,(0,i.Z)(C,{category:t}),(0,i.Z)(P,{category:t}),(0,i.Z)(L,{category:t}),(0,i.Z)(T,{category:t}))}function C(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads&&t.last_thread_title?(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left hidden-xs"},void 0,(0,i.Z)(S,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("div",{className:"media-heading"},void 0,(0,i.Z)("a",{className:"item-title thread-title",href:t.url.last_thread_new,title:t.last_thread_title},void 0,t.last_thread_title)),(0,i.Z)("ul",{className:"list-inline"},void 0,(0,i.Z)("li",{className:"category-last-thread-poster"},void 0,(0,i.Z)(E,{category:t})),N||(N=(0,i.Z)("li",{className:"divider"},void 0,"—")),(0,i.Z)("li",{className:"category-last-thread-date"},void 0,(0,i.Z)("a",{href:t.url.last_post},void 0,t.last_post_on.fromNow()))))):null}function S(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"last-poster-avatar",href:t.last_poster.url,title:t.last_poster_name},void 0,(0,i.Z)(w.ZP,{className:"media-object",size:40,user:t.last_poster})):(0,i.Z)("span",{className:"last-poster-avatar",title:t.last_poster_name},void 0,k||(k=(0,i.Z)(w.ZP,{className:"media-object",size:40})))}function E(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"item-title",href:t.last_poster.url},void 0,t.last_poster_name):(0,i.Z)("span",{className:"item-title"},void 0,t.last_poster_name)}function P(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads?t.last_thread_title?null:(0,i.Z)(O,{message:gettext("This category is empty. No threads were posted within it so far.")}):null}function L(e){var t=e.category;return t.acl.can_browse?t.acl.can_see_all_threads?null:(0,i.Z)(O,{message:gettext("This category is private. You can see only your own threads within it.")}):null}function T(e){return e.category.acl.can_browse?null:(0,i.Z)(O,{message:gettext("This category is protected. You can't browse its contents.")})}function O(e){var t=e.message;return(0,i.Z)("div",{className:"media category-thread-message"},void 0,x||(x=(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("p",{},void 0,t)))}function A(e){var t=e.category;return(0,i.Z)("div",{className:"col-md-2 hidden-xs hidden-sm"},void 0,(0,i.Z)("ul",{className:"list-unstyled category-stats"},void 0,(0,i.Z)(B,{threads:t.threads}),(0,i.Z)(I,{posts:t.posts})))}function B(e){var t=e.threads,n=ngettext("%(threads)s thread","%(threads)s threads",t);return(0,i.Z)("li",{className:"category-stat-threads"},void 0,interpolate(n,{threads:t},!0))}function I(e){var t=e.posts,n=ngettext("%(posts)s post","%(posts)s posts",t);return(0,i.Z)("li",{className:"category-stat-posts"},void 0,interpolate(n,{posts:t},!0))}function D(e){var t=e.category,n="btn btn-default btn-block btn-sm btn-subcategory";return t.is_read||(n+=" btn-subcategory-new"),(0,i.Z)("div",{className:"col-xs-12 col-sm-4 col-md-3"},void 0,(0,i.Z)("a",{className:n,href:t.url.index},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)),(0,i.Z)("span",{className:"icon-text"},void 0,t.name)))}function j(e){var t=e.category;return e.isFirst||0===t.subcategories.length?null:(0,i.Z)("div",{className:"row subcategories-list"},void 0,t.subcategories.map((function(e){return(0,i.Z)(D,{category:e},e.id)})))}function z(e){var t=e.category,n=e.isFirst,a="list-group-item";return t.description?a+=" list-group-category-has-description":a+=" list-group-category-no-description",n&&(a+=" list-group-item-first"),t.css_class&&(a+=" list-group-category-has-flavor",a+=" list-group-item-category-"+t.css_class),(0,i.Z)("li",{className:a},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)(_,{category:t}),(0,i.Z)(A,{category:t}),(0,i.Z)(R,{category:t})),(0,i.Z)(j,{category:t,isFirst:n}))}function U(e){var t=e.category,n="list-group list-group-category";return t.css_class&&(n+=" list-group-category-has-flavor",n+=" list-group-category-"+t.css_class),(0,i.Z)("ul",{className:n},void 0,(0,i.Z)(z,{category:t,isFirst:!0}),t.subcategories.map((function(e){return(0,i.Z)(z,{category:e,isFirst:!1},e.id)})))}function M(e){var t=e.categories;return(0,i.Z)("div",{className:"categories-list"},void 0,t.map((function(e){return(0,i.Z)(U,{category:e},e.id)})))}var q,H=n(32233),F=n(55547);var Y=function e(t){return Object.assign({},t,{last_post_on:t.last_post_on?h()(t.last_post_on):null,subcategories:t.subcategories.map(e)})},V=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;return(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"update",(function(e){t.setState({categories:e.map(Y)})})),t.state={categories:H.Z.get("CATEGORIES").map(Y)},t.startPolling(H.Z.get("CATEGORIES_API")),t}return(0,o.Z)(p,[{key:"startPolling",value:function(e){F.Z.start({poll:"categories",url:e,frequency:18e4,update:this.update})}},{key:"render",value:function(){var e=this.state.categories;return 0===e.length?q||(q=(0,i.Z)(m,{})):(0,i.Z)(M,{categories:e})}}]),p}(f().Component);function G(e){return{tick:e.tick.tick}}var $=n(4869);H.Z.addInitializer({name:"component:categories",initializer:function(){document.getElementById("categories-mount")&&(0,$.Z)((0,a.$j)(G)(V),"categories-mount")},after:"store"})},94795:function(e,t,n){"use strict";var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(37424),p=n(69987),h=n(94417);function v(e){return(0,a.Z)("div",{className:"list-group nav-side"},void 0,e.options.map((function(t){return(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",className:"list-group-item",activeClassName:"active"},t.component,(0,a.Z)("span",{className:"material-icon"},void 0,t.icon),t.name)})))}function f(e){return(0,a.Z)("ul",{className:e.className||"dropdown-menu",role:"menu"},void 0,e.options.map((function(t){return(0,a.Z)(h.Z,{path:e.baseUrl+t.component+"/"},t.component,(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",onClick:e.hideNav},void 0,(0,a.Z)("span",{className:"material-icon hidden-sm"},void 0,t.icon),t.name))})))}var m,Z=n(97326),g=n(4942),y=n(82211),b=n(78657),_=n(53328),N=n(53904),k=n(90287),x=n(32233);var w=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"onPasswordChange",(function(e){t.setState({password:e.target.value})})),(0,g.Z)((0,Z.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.state,a=n.isLoading,i=n.password,s=t.props.user;return 0==i.length?(N.Z.error(gettext("Enter your password to confirm account deletion.")),!1):!a&&(t.setState({isLoading:!0}),void b.Z.post(s.api.delete,{password:i}).then((function(e){window.location.href=x.Z.get("MISAGO_PATH")}),(function(e){t.setState({isLoading:!1}),e.password?N.Z.error(e.password[0]):N.Z.apiError(e)})))})),t.state={isLoading:!1,password:""},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Delete account"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-danger panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Delete account"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("You are going to delete your account. This action is nonreversible, and will result in following data being deleted:")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Stored IP addresses associated with content that you have posted will be deleted.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your username will become available for other user to rename to or for new user to register their account with.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your e-mail will become available for use in new account registration.")),m||(m=(0,a.Z)("hr",{})),(0,a.Z)("p",{},void 0,gettext("All your posted content will NOT be deleted, but username associated with it will be changed to one shared by all deleted accounts."))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)("div",{className:"input-group"},void 0,(0,a.Z)("input",{className:"form-control",disabled:this.state.isLoading,name:"password-confirmation",type:"password",placeholder:gettext("Enter your password to confirm account deletion."),value:this.state.password,onChange:this.onPasswordChange}),(0,a.Z)("span",{className:"input-group-btn"},void 0,(0,a.Z)(y.Z,{className:"btn-danger",loading:this.state.isLoading},void 0,gettext("Delete my account")))))))}}]),u}(u().Component),R=n(21688);var C=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=c.call.apply(c,[this].concat(n)),(0,g.Z)((0,Z.Z)(e),"onSuccess",(function(){N.Z.info(gettext("Your details have been updated."))})),e}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Edit details"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)(R.Z,{api:this.props.user.api.edit_details,onSuccess:this.onSuccess})}}]),u}(u().Component),S=n(30381),E=n.n(S);var P=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"handleLoadDownloads",(function(){b.Z.get(t.props.user.api.data_downloads).then((function(e){t.setState({isLoading:!1,downloads:e})}),(function(e){N.Z.apiError(e)}))})),(0,g.Z)((0,Z.Z)(t),"handleRequestDataDownload",(function(){t.setState({isSubmiting:!0}),b.Z.post(t.props.user.api.request_data_download).then((function(){t.handleLoadDownloads(),N.Z.success(gettext("Your request for data download has been registered.")),t.setState({isSubmiting:!1})}),(function(e){N.Z.apiError(e),t.setState({isSubmiting:!1})}))})),t.state={isLoading:!1,isSubmiting:!1,downloads:[]},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Download your data"),parent:gettext("Change your options")}),this.handleLoadDownloads()}},{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Download your data"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("p",{},void 0,gettext('To download your data from the site, click the "Request data download" button. Depending on amount of data to be archived and number of users wanting to download their data at same time it may take up to few days for your download to be prepared. An e-mail with notification will be sent to you when your data is ready to be downloaded.')),(0,a.Z)("p",{},void 0,gettext("The download will only be available for limited amount of time, after which it will be deleted from the site and marked as expired."))),(0,a.Z)("table",{className:"table"},void 0,(0,a.Z)("thead",{},void 0,(0,a.Z)("tr",{},void 0,(0,a.Z)("th",{},void 0,gettext("Requested on")),(0,a.Z)("th",{className:"col-md-4"},void 0,gettext("Download")))),(0,a.Z)("tbody",{},void 0,this.state.downloads.map((function(e){return(0,a.Z)("tr",{},e.id,(0,a.Z)("td",{style:L},void 0,E()(e.requested_on).fromNow()),(0,a.Z)("td",{},void 0,(0,a.Z)(T,{exportFile:e.file,status:e.status})))})),0==this.state.downloads.length?(0,a.Z)("tr",{},void 0,(0,a.Z)("td",{colSpan:"2"},void 0,gettext("You have no data downloads."))):null)),(0,a.Z)("div",{className:"panel-footer text-right"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isSubmiting,type:"button",onClick:this.handleRequestDataDownload},void 0,gettext("Request data download")))))}}]),u}(u().Component),L={verticalAlign:"middle"},T=function(e){var t=e.exportFile,n=e.status;return 0===n||1===n?(0,a.Z)(y.Z,{className:"btn-info btn-sm btn-block",disabled:!0,type:"button"},void 0,gettext("Download is being prepared")):t?(0,a.Z)("a",{className:"btn btn-success btn-sm btn-block",href:t},void 0,gettext("Download your data")):(0,a.Z)(y.Z,{className:"btn-default btn-sm btn-block",disabled:!0,type:"button"},void 0,gettext("Download is expired"))},O=n(43345),A=n(96359),B=n(60471),I=n(7227),D=n(35486);var j,z=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={isLoading:!1,is_hiding_presence:e.user.is_hiding_presence,limits_private_thread_invites_to:e.user.limits_private_thread_invites_to,subscribe_to_started_threads:e.user.subscribe_to_started_threads,subscribe_to_replied_threads:e.user.subscribe_to_replied_threads,errors:{}},t.privateThreadInvitesChoices=[{value:0,icon:"help_outline",label:gettext("Everybody")},{value:1,icon:"done_all",label:gettext("Users I follow")},{value:2,icon:"highlight_off",label:gettext("Nobody")}],t.subscribeToChoices=[{value:0,icon:"star_border",label:gettext("No")},{value:1,icon:"star_half",label:gettext("Notify")},{value:2,icon:"star",label:gettext("Notify with e-mail")}],t}return(0,s.Z)(u,[{key:"send",value:function(){return b.Z.post(this.props.user.api.options,{is_hiding_presence:this.state.is_hiding_presence,limits_private_thread_invites_to:this.state.limits_private_thread_invites_to,subscribe_to_started_threads:this.state.subscribe_to_started_threads,subscribe_to_replied_threads:this.state.subscribe_to_replied_threads})}},{key:"handleSuccess",value:function(){k.Z.dispatch((0,D.r$)({is_hiding_presence:this.state.is_hiding_presence,limits_private_thread_invites_to:this.state.limits_private_thread_invites_to,subscribe_to_started_threads:this.state.subscribe_to_started_threads,subscribe_to_replied_threads:this.state.subscribe_to_replied_threads})),N.Z.success(gettext("Your forum options have been changed."))}},{key:"handleError",value:function(e){400===e.status?N.Z.error(gettext("Please reload page and try again.")):N.Z.apiError(e)}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Forum options"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change forum options"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,gettext("Privacy settings")),(0,a.Z)(A.Z,{label:gettext("Hide my presence"),helpText:gettext("If you hide your presence, only members with permission to see hidden users will see when you are online."),for:"id_is_hiding_presence"},void 0,(0,a.Z)(I.Z,{id:"id_is_hiding_presence",disabled:this.state.isLoading,iconOn:"visibility_off",iconOff:"visibility",labelOn:gettext("Hide my presence from other users"),labelOff:gettext("Show my presence to other users"),onChange:this.bindInput("is_hiding_presence"),value:this.state.is_hiding_presence})),(0,a.Z)(A.Z,{label:gettext("Private thread invitations"),for:"id_limits_private_thread_invites_to"},void 0,(0,a.Z)(B.Z,{id:"id_limits_private_thread_invites_to",disabled:this.state.isLoading,onChange:this.bindInput("limits_private_thread_invites_to"),value:this.state.limits_private_thread_invites_to,choices:this.privateThreadInvitesChoices}))),(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,gettext("Automatic subscriptions")),(0,a.Z)(A.Z,{label:gettext("Threads I start"),for:"id_subscribe_to_started_threads"},void 0,(0,a.Z)(B.Z,{id:"id_subscribe_to_started_threads",disabled:this.state.isLoading,onChange:this.bindInput("subscribe_to_started_threads"),value:this.state.subscribe_to_started_threads,choices:this.subscribeToChoices})),(0,a.Z)(A.Z,{label:gettext("Threads I reply to"),for:"id_subscribe_to_replied_threads"},void 0,(0,a.Z)(B.Z,{id:"id_subscribe_to_replied_threads",disabled:this.state.isLoading,onChange:this.bindInput("subscribe_to_replied_threads"),value:this.state.subscribe_to_replied_threads,choices:this.subscribeToChoices})))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes")))))}}]),u}(O.Z),U=n(95187);function M(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),j||(j=(0,a.Z)(U.Z,{})))}var q=n(33556);var H=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.options.next_on?interpolate(gettext("You will be able to change your username %(next_change)s."),{next_change:this.props.options.next_on.fromNow()},!0):gettext("You have used up available name changes.")}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),(0,a.Z)(q.Z,{helpText:this.getHelpText(),message:gettext("You can't change your username at the moment.")}))}}]),u}(u().Component),F=n(55210);var Y,V=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={username:"",validators:{username:[F.lG(),F.HR(e.options.length_min),F.gS(e.options.length_max)]},isLoading:!1},t}return(0,s.Z)(u,[{key:"getHelpText",value:function(){var e=[];if(this.props.options.changes_left>0){var t=ngettext("You can change your username %(changes_left)s more time.","You can change your username %(changes_left)s more times.",this.props.options.changes_left);e.push(interpolate(t,{changes_left:this.props.options.changes_left},!0))}if(this.props.user.acl.name_changes_expire>0){var n=ngettext("Used changes become available again after %(name_changes_expire)s day.","Used changes become available again after %(name_changes_expire)s days.",this.props.user.acl.name_changes_expire);e.push(interpolate(n,{name_changes_expire:this.props.user.acl.name_changes_expire},!0))}return e.length?e.join(" "):null}},{key:"clean",value:function(){var e=this.validate();return e.username?(N.Z.error(e.username[0]),!1):this.state.username.trim()!==this.props.user.username||(N.Z.info(gettext("Your new username is same as current one.")),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.username,{username:this.state.username})}},{key:"handleSuccess",value:function(e){this.setState({username:""}),this.props.complete(e.username,e.slug,e.options)}},{key:"handleError",value:function(e){N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New username"),for:"id_username",helpText:this.getHelpText()},void 0,(0,a.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change username")))))}}]),u}(O.Z),G=n(7850),$=n(48927),W=n(6935);var Q,K=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"onComplete",(function(e,n,a){t.setState({options:a}),k.Z.dispatch((0,$.KP)({username:e,slug:n},t.props.user,t.props.user)),k.Z.dispatch((0,W._S)(t.props.user,e,n)),N.Z.success(gettext("Your username has been changed successfully."))})),t.state={isLoaded:!1,options:null},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){var e=this;_.Z.set({title:gettext("Change username"),parent:gettext("Change your options")}),Promise.all([b.Z.get(this.props.user.api.username),b.Z.get(x.Z.get("USERNAME_CHANGES_API"),{user:this.props.user.id})]).then((function(t){k.Z.dispatch((0,$.ZB)(t[1].results)),e.setState({isLoaded:!0,options:{changes_left:t[0].changes_left,length_min:t[0].length_min,length_max:t[0].length_max,next_on:t[0].next_on?E()(t[0].next_on):null}})}))}},{key:"getChangeForm",value:function(){return this.state.isLoaded?0===this.state.options.changes_left?(0,a.Z)(H,{options:this.state.options}):(0,a.Z)(V,{complete:this.onComplete,options:this.state.options,user:this.props.user}):Y||(Y=(0,a.Z)(M,{}))}},{key:"render",value:function(){return(0,a.Z)("div",{},void 0,this.getChangeForm(),(0,a.Z)(G.Z,{changes:this.props["username-history"],isLoaded:this.state.isLoaded}))}}]),u}(u().Component);var J,X=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={new_email:"",password:"",validators:{new_email:[F.Do()],password:[]},isLoading:!1},t}return(0,s.Z)(u,[{key:"clean",value:function(){var e=this.validate();return-1!==[this.state.new_email.trim().length,this.state.password.trim().length].indexOf(0)?(N.Z.error(gettext("Fill out all fields.")),!1):!e.new_email||(N.Z.error(e.new_email[0]),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.change_email,{new_email:this.state.new_email,password:this.state.password})}},{key:"handleSuccess",value:function(e){this.setState({new_email:"",password:""}),N.Z.success(e.detail)}},{key:"handleError",value:function(e){400===e.status?e.new_email?N.Z.error(e.new_email):N.Z.error(e.password):N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change e-mail address"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New e-mail"),for:"id_new_email"},void 0,(0,a.Z)("input",{type:"text",id:"id_new_email",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("new_email"),value:this.state.new_email})),Q||(Q=(0,a.Z)("hr",{})),(0,a.Z)(A.Z,{label:gettext("Your current password"),for:"id_confirm_email"},void 0,(0,a.Z)("input",{type:"password",id:"id_confirm_email",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change e-mail")))))}}]),u}(O.Z);var ee,te,ne,ae=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={new_password:"",repeat_password:"",password:"",validators:{new_password:[],repeat_password:[],password:[]},isLoading:!1},t}return(0,s.Z)(u,[{key:"clean",value:function(){var e=this.validate();return-1!==[this.state.new_password.trim().length,this.state.repeat_password.trim().length,this.state.password.trim().length].indexOf(0)?(N.Z.error(gettext("Fill out all fields.")),!1):e.new_password?(N.Z.error(e.new_password[0]),!1):this.state.new_password===this.state.repeat_password||(N.Z.error(gettext("New passwords are different.")),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.change_password,{new_password:this.state.new_password,password:this.state.password})}},{key:"handleSuccess",value:function(e){this.setState({new_password:"",repeat_password:"",password:""}),N.Z.success(e.detail)}},{key:"handleError",value:function(e){400===e.status?e.new_password?N.Z.error(e.new_password):N.Z.error(e.password):N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change password"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New password"),for:"id_new_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_new_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("new_password"),value:this.state.new_password})),(0,a.Z)(A.Z,{label:gettext("Repeat password"),for:"id_repeat_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_repeat_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("repeat_password"),value:this.state.repeat_password})),J||(J=(0,a.Z)("hr",{})),(0,a.Z)(A.Z,{label:gettext("Your current password"),for:"id_confirm_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_confirm_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change password")))))}}]),u}(O.Z),ie=function(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change email or password"))),(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,ee||(ee=(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("You need to set a password for your account to be able to change your username or email.")),(0,a.Z)("p",{className:"help-block"},void 0,(0,a.Z)("a",{className:"btn btn-primary",href:x.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Set password"))))))};var se,oe=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Change email or password"),parent:gettext("Change your options")})}},{key:"render",value:function(){return this.props.user.has_usable_password?(0,a.Z)("div",{},void 0,(0,a.Z)(X,{user:this.props.user}),(0,a.Z)(ae,{user:this.props.user}),(0,a.Z)("p",{className:"message-line"},void 0,ne||(ne=(0,a.Z)("span",{className:"material-icon"},void 0,"warning")),(0,a.Z)("a",{href:x.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Change forgotten password")))):te||(te=(0,a.Z)(ie,{}))}}]),u}(u().Component),re=n(82125),le=n(98936),ce=n(59131),ue=n(99755);var de=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){var e=this,t=x.Z.get("USER_OPTIONS").filter((function(t){var n=x.Z.get("USERCP_URL")+t.component+"/";return e.props.location.pathname.substr(0,n.length)===n}))[0];return(0,a.Z)("div",{className:"page page-options"},void 0,(0,a.Z)(ue.sP,{},void 0,(0,a.Z)(ue.mr,{styleName:"options"},void 0,(0,a.Z)(ue.gC,{styleName:"options"},void 0,(0,a.Z)(le.gq,{},void 0,(0,a.Z)(le.kw,{auto:!0},void 0,(0,a.Z)(le.Z6,{auto:!0},void 0,(0,a.Z)("h1",{},void 0,gettext("Change your options"))),(0,a.Z)(le.Z6,{className:"hidden-xs hidden-md hidden-lg",shrink:!0},void 0,(0,a.Z)("div",{className:"dropdown"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Menu"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,se||(se=(0,a.Z)("span",{className:"material-icon"},void 0,"menu"))),(0,a.Z)(f,{className:"dropdown-menu dropdown-menu-right",baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})))),(0,a.Z)(le.kw,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,a.Z)(le.Z6,{},void 0,(0,a.Z)("div",{className:"dropdown"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-block dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,t.icon),t.name),(0,a.Z)(f,{className:"dropdown-menu",baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})))))))),(0,a.Z)(ce.Z,{},void 0,(0,a.Z)("div",{className:"row"},void 0,(0,a.Z)("div",{className:"col-md-3 hidden-xs hidden-sm"},void 0,(0,a.Z)(v,{baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})),(0,a.Z)("div",{className:"col-md-9"},void 0,this.props.children))))}}]),u}(re.Z);function pe(e){return{tick:e.tick.tick,user:e.auth.user,"username-history":e["username-history"]}}function he(){var e=[{path:x.Z.get("USERCP_URL")+"forum-options/",component:(0,d.$j)(pe)(z)},{path:x.Z.get("USERCP_URL")+"edit-details/",component:(0,d.$j)(pe)(C)}],t=x.Z.get("SETTINGS").DELEGATE_AUTH;return t||(e.push({path:x.Z.get("USERCP_URL")+"change-username/",component:(0,d.$j)(pe)(K)}),e.push({path:x.Z.get("USERCP_URL")+"sign-in-credentials/",component:(0,d.$j)(pe)(oe)})),x.Z.get("ENABLE_DOWNLOAD_OWN_DATA")&&e.push({path:x.Z.get("USERCP_URL")+"download-data/",component:(0,d.$j)(pe)(P)}),!t&&x.Z.get("ENABLE_DELETE_OWN_ACCOUNT")&&e.push({path:x.Z.get("USERCP_URL")+"delete-account/",component:(0,d.$j)(pe)(w)}),e}var ve=n(39633);x.Z.addInitializer({name:"component:options",initializer:function(e){e.has("USER_OPTIONS")&&(0,ve.Z)({root:x.Z.get("USERCP_URL"),component:de,paths:he()})},after:"store"})},95563:function(e,t,n){"use strict";var a,i=n(37424),s=n(22928),o=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(57588),v=n.n(h),f=n(30381),m=n.n(f),Z=n(95187),g=n(33556),y=n(32233),b=n(55547),_=n(53328);var N=function(e){(0,c.Z)(h,e);var t,n,i=(t=h,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(e){var t;return(0,o.Z)(this,h),t=i.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){e.expires_on&&(e.expires_on=m()(e.expires_on)),t.setState({isLoaded:!0,error:null,ban:e})})),(0,p.Z)((0,l.Z)(t),"error",(function(e){t.setState({isLoaded:!0,error:e.detail,ban:null})})),y.Z.has("PROFILE_BAN")?t.initWithPreloadedData(y.Z.pop("PROFILE_BAN")):t.initWithoutPreloadedData(),t.startPolling(e.profile.api.ban),t}return(0,r.Z)(h,[{key:"initWithPreloadedData",value:function(e){e.expires_on&&(e.expires_on=m()(e.expires_on)),this.state={isLoaded:!0,ban:e}}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){b.Z.start({poll:"ban-details",url:e,frequency:9e4,update:this.update,error:this.error})}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Ban details"),parent:this.props.profile.username})}},{key:"componentWillUnmount",value:function(){b.Z.stop("ban-details")}},{key:"getUserMessage",value:function(){return this.state.ban.user_message?(0,s.Z)("div",{className:"panel-body ban-message ban-user-message"},void 0,(0,s.Z)("h4",{},void 0,gettext("User-shown ban message")),(0,s.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.user_message.html}})):null}},{key:"getStaffMessage",value:function(){return this.state.ban.staff_message?(0,s.Z)("div",{className:"panel-body ban-message ban-staff-message"},void 0,(0,s.Z)("h4",{},void 0,gettext("Team-shown ban message")),(0,s.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.staff_message.html}})):null}},{key:"getExpirationMessage",value:function(){if(this.state.ban.expires_on){if(this.state.ban.expires_on.isAfter(m()())){var e=interpolate(gettext("This ban expires on %(expires_on)s."),{expires_on:this.state.ban.expires_on.format("LL, LT")},!0),t=interpolate(gettext("This ban expires %(expires_on)s."),{expires_on:this.state.ban.expires_on.fromNow()},!0);return(0,s.Z)("abbr",{title:e},void 0,t)}return gettext("This ban has expired.")}return interpolate(gettext("%(username)s's ban is permanent."),{username:this.props.profile.username},!0)}},{key:"getPanelBody",value:function(){return this.state.ban?Object.keys(this.state.ban).length?(0,s.Z)("div",{},void 0,this.getUserMessage(),this.getStaffMessage(),(0,s.Z)("div",{className:"panel-body ban-expires"},void 0,(0,s.Z)("h4",{},void 0,gettext("Ban expiration")),(0,s.Z)("p",{className:"lead"},void 0,this.getExpirationMessage()))):(0,s.Z)("div",{},void 0,(0,s.Z)(g.Z,{message:gettext("No ban is active at the moment.")})):this.state.error?(0,s.Z)("div",{},void 0,(0,s.Z)(g.Z,{icon:"error_outline",message:this.state.error})):a||(a=(0,s.Z)("div",{},void 0,(0,s.Z)(Z.Z,{})))}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-ban-details"},void 0,(0,s.Z)("div",{className:"panel panel-default"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Ban details"))),this.getPanelBody()))}}]),h}(v().Component),k=n(21688);function x(e){var t=e.api,n=e.display,a=e.onCancel,i=e.onSuccess;return n?(0,s.Z)(k.Z,{api:t,onCancel:a,onSuccess:i}):null}function w(e){var t,n=e.isAuthenticated,a=e.profile;return t=n?gettext("You are not sharing any details with others."):interpolate(gettext("%(username)s is not sharing any details with others."),{username:a.username},!0),(0,s.Z)("div",{className:"panel panel-default"},void 0,(0,s.Z)("div",{className:"panel-body text-center lead"},void 0,t))}function R(e){var t=e.html,n=e.text,a=e.url;return t?(0,s.Z)("div",{className:"form-control-static col-md-9",dangerouslySetInnerHTML:{__html:t}}):(0,s.Z)("div",{className:"form-control-static col-md-9"},void 0,(0,s.Z)(C,{text:n,url:a}))}function C(e){var t=e.text,n=e.url;return n?(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:n,target:"_blank",rel:"nofollow"},void 0,t||n)):t?(0,s.Z)("p",{},void 0,t):null}function S(e){return(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("strong",{className:"control-label col-md-3"},void 0,e.name,":"),v().createElement(R,e))}function E(e){var t=e.fields,n=e.name;return(0,s.Z)("div",{className:"panel panel-default panel-profile-details-group"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,n)),(0,s.Z)("div",{className:"panel-body"},void 0,(0,s.Z)("div",{className:"form-horizontal"},void 0,t.map((function(e){var t=e.fieldname,n=e.html,a=e.name,i=e.text,o=e.url;return(0,s.Z)(S,{name:a,html:n,text:i,url:o},t)})))))}var P,L=n(37848);function T(e){var t=e.display,n=e.groups,a=e.isAuthenticated,i=e.loading,o=e.profile;return t?i?P||(P=(0,s.Z)(L.Z,{})):n.length?(0,s.Z)("div",{},void 0,n.map((function(e,t){return(0,s.Z)(E,{fields:e.fields,name:e.name},t)}))):(0,s.Z)(w,{isAuthenticated:a,profile:o}):null}var O=n(92490),A=function(e){var t=e.onEdit,n=e.showEditButton;return(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,gettext("Details")))),n&&(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)("button",{className:"btn btn-default btn-outline btn-block",onClick:t,type:"button"},void 0,gettext("Edit")))))},B=n(58598),I=n(78657),D=n(53904);var j=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,n=e.dispatch,a=e.user;t&&t.id===a.id||I.Z.get(this.props.user.api.details).then((function(e){n((0,B.zD)(e))}),(function(e){D.Z.apiError(e)}))}},{key:"render",value:function(){return this.props.children}}]),i}(v().Component);var z=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"onCancel",(function(){t.setState({editing:!1})})),(0,p.Z)((0,l.Z)(t),"onEdit",(function(){t.setState({editing:!0})})),(0,p.Z)((0,l.Z)(t),"onSuccess",(function(e){var n,a=t.props,i=a.dispatch,s=a.isAuthenticated,o=a.profile;n=s?gettext("Your details have been updated."):interpolate(gettext("%(username)s's details have been updated."),{username:o.username},!0),D.Z.info(n),i((0,B.zD)(e)),t.setState({editing:!1})})),t.state={editing:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Details"),parent:this.props.profile.username})}},{key:"render",value:function(){var e=this.props,t=e.dispatch,n=e.isAuthenticated,a=e.profile,i=e.profileDetails,o=i.id!==a.id;return(0,s.Z)(j,{data:i,dispatch:t,user:a},void 0,(0,s.Z)("div",{className:"profile-details"},void 0,(0,s.Z)(A,{onEdit:this.onEdit,showEditButton:!!i.edit&&!this.state.editing}),(0,s.Z)(T,{display:!this.state.editing,groups:i.groups,isAuthenticated:n,loading:o,profile:a}),(0,s.Z)(x,{api:a.api.edit_details,dispatch:t,display:this.state.editing,onCancel:this.onCancel,onSuccess:this.onSuccess})))}}]),i}(v().Component),U=n(87462),M=n(11005),q=n(82211),H=n(21981),F=n(90287);var Y,V=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isLoading:!0}),t.loadItems(t.props.posts.next)})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"loadItems",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;I.Z.get(this.props.api,{start:t||0}).then((function(n){0===t?F.Z.dispatch(H.zD(n)):F.Z.dispatch(H.R3(n)),e.setState({isLoading:!1})}),(function(t){e.setState({isLoading:!1}),D.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:this.props.title,parent:this.props.profile.username}),this.loadItems()}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-feed"},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.props.header)))),v().createElement(G,(0,U.Z)({isLoading:this.state.isLoading,loadMore:this.loadMore},this.props)))}}]),i}(v().Component);function G(e){return e.posts.isLoaded&&!e.posts.results.length?(0,s.Z)("p",{className:"lead"},void 0,e.emptyMessage):(0,s.Z)("div",{},void 0,(0,s.Z)(M.Z,{isReady:e.posts.isLoaded,posts:e.posts.results,poster:e.profile}),(0,s.Z)($,{isLoading:e.isLoading,loadMore:e.loadMore,next:e.posts.next}))}function $(e){return e.next?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:e.isLoading,onClick:e.loadMore},void 0,gettext("Show older activity"))):null}var W=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.className?"form-search "+this.props.className:"form-search"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName()},void 0,(0,s.Z)("input",{type:"text",className:"form-control",value:this.props.value,onChange:this.props.onChange,placeholder:this.props.placeholder||gettext("Search...")}),Y||(Y=(0,s.Z)("span",{className:"material-icon"},void 0,"search")))}}]),i}(v().Component),Q=n(40429),K=n(6935);var J=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadUsers(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadUsers(1,e.target.value)})),t.setSpecialProps(),y.Z.has(t.PRELOADED_DATA_KEY)?t.initWithPreloadedData(y.Z.pop(t.PRELOADED_DATA_KEY)):t.initWithoutPreloadedData(),t}return(0,r.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWERS",this.TITLE=gettext("Followers"),this.API_FILTER="followers"}},{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},F.Z.dispatch((0,K.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadUsers()}},{key:"loadUsers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.props.profile.api[this.API_FILTER];I.Z.get(a,{search:n,page:t||1},"user-"+this.API_FILTER).then((function(n){1===t?F.Z.dispatch((0,K.ZB)(n.results)):F.Z.dispatch((0,K.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){D.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:this.TITLE,parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("You have %(users)s follower.","You have %(users)s followers.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=ngettext("%(username)s has %(users)s follower.","%(username)s has %(users)s followers.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("You have no followers."):interpolate(gettext("%(username)s has no followers."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(gettext("Show more (%(more)s)"),{more:this.state.more},!0))):null}},{key:"getListBody",value:function(){return this.state.isLoaded&&0===this.state.count?(0,s.Z)("p",{className:"lead"},void 0,this.getEmptyMessage()):(0,s.Z)("div",{},void 0,(0,s.Z)(Q.Z,{cols:3,isReady:this.state.isLoaded,users:this.props.users}),this.getMoreButton())}},{key:"getClassName",value:function(){return"profile-"+this.API_FILTER}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName()},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.getLabel()))),(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)(W,{value:this.state.search,onChange:this.search,placeholder:gettext("Search users...")})))),this.getListBody())}}]),i}(v().Component);var X=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWS",this.TITLE=gettext("Follows"),this.API_FILTER="follows"}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("You are following %(users)s user.","You are following %(users)s users.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=ngettext("%(username)s is following %(users)s user.","%(username)s is following %(users)s users.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("You are not following any users."):interpolate(gettext("%(username)s is not following any users."),{username:this.props.profile.username},!0)}}]),i}(J),ee=n(7850),te=n(48927);var ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadChanges(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadChanges(1,e.target.value)})),y.Z.has("PROFILE_NAME_HISTORY")?t.initWithPreloadedData(y.Z.pop("PROFILE_NAME_HISTORY")):t.initWithoutPreloadedData(),t}return(0,r.Z)(i,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},F.Z.dispatch((0,te.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadChanges()}},{key:"loadChanges",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;I.Z.get(y.Z.get("USERNAME_CHANGES_API"),{user:this.props.profile.id,search:n,page:t||1},"search-username-history").then((function(n){1===t?F.Z.dispatch((0,te.ZB)(n.results)):F.Z.dispatch((0,te.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){D.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Username history"),parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(changes)s username change.","Found %(changes)s username changes.",this.state.count);return interpolate(e,{changes:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("Your username was changed %(changes)s time.","Your username was changed %(changes)s times.",this.state.count);return interpolate(t,{changes:this.state.count},!0)}var n=ngettext("%(username)s's username was changed %(changes)s time.","%(username)s's username was changed %(changes)s times.",this.state.count);return interpolate(n,{username:this.props.profile.username,changes:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no username changes matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("No name changes have been recorded for your account."):interpolate(gettext("%(username)s's username was never changed."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(gettext("Show older (%(more)s)"),{more:this.state.more},!0))):null}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-username-history"},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.getLabel()))),(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)(W,{value:this.state.search,onChange:this.search,placeholder:gettext("Search history...")})))),(0,s.Z)(ee.Z,{isLoaded:this.state.isLoaded,emptyMessage:this.getEmptyMessage(),changes:this.props["username-history"]}),this.getMoreButton())}}]),i}(v().Component),ae=n(82125),ie=n(27519),se=n(59131),oe=n(19605),re=n(98936),le=n(99755);var ce,ue=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"action",(function(){t.setState({isLoading:!0}),t.props.profile.is_followed?F.Z.dispatch((0,ie.r$)({is_followed:!1,followers:t.props.profile.followers-1})):F.Z.dispatch((0,ie.r$)({is_followed:!0,followers:t.props.profile.followers+1})),I.Z.post(t.props.profile.api.follow).then((function(e){t.setState({isLoading:!1}),F.Z.dispatch((0,ie.r$)(e))}),(function(e){t.setState({isLoading:!1}),D.Z.apiError(e)}))})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.profile.is_followed?this.props.className+" btn-default btn-following":this.props.className+" btn-default btn-follow"}},{key:"getIcon",value:function(){return this.props.profile.is_followed?"favorite":"favorite_border"}},{key:"getLabel",value:function(){return this.props.profile.is_followed?gettext("Following"):gettext("Follow")}},{key:"render",value:function(){return(0,s.Z)(q.Z,{className:this.getClassName(),disabled:this.state.isLoading,onClick:this.action},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,this.getIcon()),this.getLabel())}}]),i}(v().Component),de=n(64646);var pe,he,ve=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){var e;(0,o.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"onClick",(function(){de.Z.open({mode:"START_PRIVATE",submit:y.Z.get("PRIVATE_THREADS_API"),to:[e.props.profile]})})),e}return(0,r.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_start_private_threads,t=this.props.user.id===this.props.profile.id;return!e||t?null:(0,s.Z)("button",{className:this.props.className,onClick:this.onClick,type:"button"},void 0,ce||(ce=(0,s.Z)("span",{className:"material-icon"},void 0,"comment")),gettext("Message"))}}]),i}(v().Component),fe=n(43345),me=n(96359),Ze=n(3784),ge=n(7227),ye=n(30337);var be,_e,Ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,is_avatar_locked:"",avatar_lock_user_message:"",avatar_lock_staff_message:""},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.moderate_avatar).then((function(t){e.setState({isLoaded:!0,is_avatar_locked:t.is_avatar_locked,avatar_lock_user_message:t.avatar_lock_user_message||"",avatar_lock_staff_message:t.avatar_lock_staff_message||""})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(D.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.moderate_avatar,{is_avatar_locked:this.state.is_avatar_locked,avatar_lock_user_message:this.state.avatar_lock_user_message,avatar_lock_staff_message:this.state.avatar_lock_staff_message})}},{key:"handleSuccess",value:function(e){F.Z.dispatch((0,K.n1)(this.props.profile,e.avatar_hash)),D.Z.success(gettext("Avatar controls have been changed."))}},{key:"getFormBody",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("Lock avatar"),helpText:gettext("Locking user avatar will prohibit user from changing his avatar and will reset his/her avatar to default one."),for:"id_is_avatar_locked"},void 0,(0,s.Z)(ge.Z,{id:"id_is_avatar_locked",disabled:this.state.isLoading,iconOn:"lock_outline",iconOff:"lock_open",labelOn:gettext("Disallow user from changing avatar"),labelOff:gettext("Allow user to change avatar"),onChange:this.bindInput("is_avatar_locked"),value:this.state.is_avatar_locked})),(0,s.Z)(me.Z,{label:gettext("User message"),helpText:gettext("Optional message for user explaining why he/she is prohibited form changing avatar."),for:"id_avatar_lock_user_message"},void 0,(0,s.Z)("textarea",{id:"id_avatar_lock_user_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_user_message"),value:this.state.avatar_lock_user_message})),(0,s.Z)(me.Z,{label:gettext("Staff message"),helpText:gettext("Optional message for forum team members explaining why user is prohibited form changing avatar."),for:"id_avatar_lock_staff_message"},void 0,(0,s.Z)("textarea",{id:"id_avatar_lock_staff_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_staff_message"),value:this.state.avatar_lock_staff_message}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,gettext("Close")),(0,s.Z)(q.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():pe||(pe=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-avatar-controls":"modal-dialog modal-avatar-controls"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,he||(he=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Avatar controls"))),this.getModalBody()))}}]),i}(fe.Z),ke=n(55210);var xe,we,Re,Ce=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,username:"",validators:{username:[ke.lG()]}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.moderate_username).then((function(){e.setState({isLoaded:!0})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(D.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.moderate_username,{username:this.state.username})}},{key:"handleSuccess",value:function(e){this.setState({username:""}),F.Z.dispatch((0,te.KP)(e,this.props.profile,this.props.user)),F.Z.dispatch((0,K._S)(this.props.profile,e.username,e.slug)),D.Z.success(gettext("Username has been changed."))}},{key:"getFormBody",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("New username"),for:"id_username"},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,s.Z)(q.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change username"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():be||(be=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-rename-user":"modal-dialog modal-rename-user"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,_e||(_e=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Change username"))),this.getModalBody()))}}]),i}(fe.Z);var Se,Ee,Pe,Le=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"countdown",(function(){window.setTimeout((function(){t.state.countdown>1?(t.setState({countdown:t.state.countdown-1}),t.countdown()):t.state.confirm||t.setState({confirm:!0})}),1e3)})),t.state={isLoaded:!1,isLoading:!1,isDeleted:!1,error:null,countdown:5,confirm:!1,with_content:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.delete).then((function(){e.setState({isLoaded:!0}),e.countdown()}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.delete,{with_content:this.state.with_content})}},{key:"handleSuccess",value:function(){b.Z.stop("user-profile"),this.state.with_content?this.setState({isDeleted:interpolate(gettext("%(username)s's account, threads, posts and other content has been deleted."),{username:this.props.profile.username},!0)}):this.setState({isDeleted:interpolate(gettext("%(username)s's account has been deleted and other content has been hidden."),{username:this.props.profile.username},!0)})}},{key:"getButtonLabel",value:function(){return this.state.confirm?interpolate(gettext("Delete %(username)s"),{username:this.props.profile.username},!0):interpolate(gettext("Please wait... (%(countdown)ss)"),{countdown:this.state.countdown},!0)}},{key:"getForm",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("User content"),for:"id_with_content"},void 0,(0,s.Z)(ge.Z,{id:"id_with_content",disabled:this.state.isLoading,labelOn:gettext("Delete together with user's account"),labelOff:gettext("Hide after deleting user's account"),onChange:this.bindInput("with_content"),value:this.state.with_content}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,gettext("Cancel")),(0,s.Z)(q.Z,{className:"btn-danger",loading:this.state.isLoading,disabled:!this.state.confirm},void 0,this.getButtonLabel())))}},{key:"getDeletedBody",value:function(){return(0,s.Z)("div",{className:"modal-body"},void 0,xe||(xe=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.state.isDeleted),(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:y.Z.get("USERS_LIST_URL")},void 0,gettext("Return to users list")))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.state.isDeleted?this.getDeletedBody():this.getForm():we||(we=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error||this.state.isDeleted?"modal-dialog modal-message modal-delete-account":"modal-dialog modal-delete-account"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Re||(Re=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Delete user account"))),this.getModalBody()))}}]),i}(fe.Z),Te=n(59801);var Oe,Ae,Be,Ie,De,je=function(e){return{tick:e.tick,user:e.auth,profile:e.profile}},ze=function(e){(0,c.Z)(h,e);var t,n,a=(t=h,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(){var e;(0,o.Z)(this,h);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"showAvatarDialog",(function(){Te.Z.show((0,i.$j)(je)(Ne))})),(0,p.Z)((0,l.Z)(e),"showRenameDialog",(function(){Te.Z.show((0,i.$j)(je)(Ce))})),(0,p.Z)((0,l.Z)(e),"showDeleteDialog",(function(){Te.Z.show((0,i.$j)(je)(Le))})),e}return(0,r.Z)(h,[{key:"render",value:function(){var e=this.props.moderation;return(0,s.Z)("ul",{className:"dropdown-menu dropdown-menu-right",role:"menu"},void 0,!!e.avatar&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showAvatarDialog},void 0,Se||(Se=(0,s.Z)("span",{className:"material-icon"},void 0,"portrait")),gettext("Avatar controls"))),!!e.rename&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showRenameDialog},void 0,Ee||(Ee=(0,s.Z)("span",{className:"material-icon"},void 0,"credit_card")),gettext("Change username"))),!!e.delete&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showDeleteDialog},void 0,Pe||(Pe=(0,s.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete account"))))}}]),h}(v().Component),Ue=n(24678),Me=function(e){var t=e.profile;return(0,s.Z)("ul",{className:"profile-data-list"},void 0,!1===t.is_active&&(0,s.Z)("li",{className:"user-account-disabled"},void 0,(0,s.Z)("abbr",{title:gettext("This user's account has been disabled by administrator.")},void 0,gettext("Account disabled"))),(0,s.Z)("li",{className:"user-status-display"},void 0,(0,s.Z)(Ue.ZP,{user:t,status:t.status},void 0,(0,s.Z)(Ue.Jj,{user:t,status:t.status}),(0,s.Z)(Ue.pg,{user:t,status:t.status,className:"status-label"}))),t.rank.is_tab?(0,s.Z)("li",{className:"user-rank"},void 0,(0,s.Z)("a",{href:t.rank.url,className:"item-title"},void 0,t.rank.name)):(0,s.Z)("li",{className:"user-rank"},void 0,(0,s.Z)("span",{className:"item-title"},void 0,t.rank.name)),(t.title||t.rank.title)&&(0,s.Z)("li",{className:"user-title"},void 0,t.title||t.rank.title),(0,s.Z)("li",{className:"user-joined-on"},void 0,(0,s.Z)("abbr",{title:interpolate(gettext("Joined on %(joined_on)s"),{joined_on:t.joined_on.format("LL, LT")},!0)},void 0,interpolate(gettext("Joined %(joined_on)s"),{joined_on:t.joined_on.fromNow()},!0))),t.email&&(0,s.Z)("li",{className:"user-email"},void 0,(0,s.Z)("a",{href:"mailto:"+t.email,className:"item-title"},void 0,t.email)))},qe=function(){return(0,s.Z)("button",{className:"btn btn-default btn-icon btn-outline dropdown-toggle",type:"button",title:gettext("Options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,De||(De=(0,s.Z)("span",{className:"material-icon"},void 0,"settings")))},He=function(e){var t=e.profile,n=e.user,a=e.moderation,i=e.message,o=e.follow;return(0,s.Z)(le.sP,{},void 0,(0,s.Z)(le.mr,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,s.Z)(le.gC,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,s.Z)("div",{className:"profile-page-header"},void 0,(0,s.Z)("div",{className:"profile-page-header-avatar"},void 0,(0,s.Z)(oe.ZP,{className:"user-avatar hidden-sm hidden-md hidden-lg",user:t,size:200,size2x:400}),(0,s.Z)(oe.ZP,{className:"user-avatar hidden-xs hidden-md hidden-lg",user:t,size:64,size2x:128}),(0,s.Z)(oe.ZP,{className:"user-avatar hidden-xs hidden-sm",user:t,size:128,size2x:256})),(0,s.Z)("h1",{},void 0,t.username))),(0,s.Z)(le.eA,{className:"profile-page-header-details"},void 0,(0,s.Z)(re.gq,{},void 0,(0,s.Z)(re.kw,{auto:!0},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(Me,{profile:t}))),i&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(ve,{className:"btn btn-default btn-block btn-outline",profile:t,user:n})),a.available&&!o&&(0,s.Z)(re.Z6,{shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Oe||(Oe=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a})))),o&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(ue,{className:"btn btn-block btn-outline",profile:t})),a.available&&(0,s.Z)(re.Z6,{shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Ae||(Ae=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a})))),a.available&&!o&&!i&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{className:"hidden-xs",shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Be||(Be=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a}))),(0,s.Z)(re.Z6,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,Ie||(Ie=(0,s.Z)("span",{className:"material-icon"},void 0,"settings")),gettext("Options")),(0,s.Z)(ze,{profile:t,moderation:a}))))))))},Fe=n(69987),Ye=n(94417),Ve=function(e){var t=e.baseUrl,n=e.page,a=e.pages;return(0,s.Z)("div",{className:"nav-container"},void 0,(0,s.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,n.icon),n.name),(0,s.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(e){return(0,s.Z)("li",{},e.component,(0,s.Z)(Fe.rU,{to:t+e.component+"/"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))})))),(0,s.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,a.map((function(e){return(0,s.Z)(Ye.Z,{path:t+e.component+"/"},e.component,(0,s.Z)(Fe.rU,{to:t+e.component+"/"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))}))))};var Ge=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){F.Z.dispatch((0,ie.ZB)(e))})),t.startPolling(e.profile.api.index),t}return(0,r.Z)(i,[{key:"startPolling",value:function(e){b.Z.start({poll:"user-profile",url:e,frequency:9e4,update:this.update})}},{key:"render",value:function(){var e=this,t=y.Z.get("PROFILE").url,n=y.Z.get("PROFILE_PAGES"),a=n.filter((function(n){var a=t+n.component+"/";return e.props.location.pathname===a}))[0],i=this.props,o=i.profile,r=i.user,l=$e(o,r),c=!!r.acl.can_start_private_threads&&o.id!==r.id,u=!!o.acl.can_follow&&o.id!==r.id;return(0,s.Z)("div",{className:"page page-user-profile"},void 0,(0,s.Z)(He,{profile:this.props.profile,user:this.props.user,moderation:l,message:c,follow:u}),(0,s.Z)(se.Z,{},void 0,(0,s.Z)(Ve,{baseUrl:t,page:a,pages:n}),this.props.children))}}]),i}(ae.Z),$e=function(e,t){var n={available:!1,rename:!1,avatar:!1,delete:!1};return t.is_anonymous||(n.rename=e.acl.can_rename,n.avatar=e.acl.can_moderate_avatar,n.delete=e.acl.can_delete,n.available=!!(n.rename||n.avatar||n.delete)),n};function We(e){return{isAuthenticated:e.auth.user.id===e.profile.id,tick:e.tick.tick,user:e.auth.user,users:e.users,posts:e.posts,profile:e.profile,profileDetails:e["profile-details"],"username-history":e["username-history"]}}var Qe={posts:function(e){var t;t=e.user.id===e.profile.id?gettext("You have posted no messages."):interpolate(gettext("%(username)s posted no messages."),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=ngettext("You have posted %(posts)s message.","You have posted %(posts)s messages.",e.profile.posts);n=interpolate(a,{posts:e.profile.posts},!0)}else{var i=ngettext("%(username)s has posted %(posts)s message.","%(username)s has posted %(posts)s messages.",e.profile.posts);n=interpolate(i,{username:e.profile.username,posts:e.profile.posts},!0)}else n=gettext("Loading...");return v().createElement(V,(0,U.Z)({api:e.profile.api.posts,emptyMessage:t,header:n,title:gettext("Posts")},e))},threads:function(e){var t;t=e.user.id===e.profile.id?gettext("You have no started threads."):interpolate(gettext("%(username)s started no threads."),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=ngettext("You have started %(threads)s thread.","You have started %(threads)s threads.",e.profile.threads);n=interpolate(a,{threads:e.profile.threads},!0)}else{var i=ngettext("%(username)s has started %(threads)s thread.","%(username)s has started %(threads)s threads.",e.profile.threads);n=interpolate(i,{username:e.profile.username,threads:e.profile.threads},!0)}else n=gettext("Loading...");return v().createElement(V,(0,U.Z)({api:e.profile.api.threads,emptyMessage:t,header:n,title:gettext("Threads")},e))},followers:J,follows:X,details:z,"username-history":ne,"ban-details":N};function Ke(){var e=[];return y.Z.get("PROFILE_PAGES").forEach((function(t){e.push(Object.assign({},t,{path:y.Z.get("PROFILE").url+t.component+"/",component:(0,i.$j)(We)(Qe[t.component])}))})),e}var Je=n(39633);y.Z.addInitializer({name:"component:profile",initializer:function(e){e.has("PROFILE")&&e.has("PROFILE_PAGES")&&(0,Je.Z)({root:y.Z.get("PROFILE").url,component:(0,i.$j)(We)(Ge),paths:Ke()})},after:"reducer:profile-hydrate"})},32488:function(e,t,n){"use strict";var a,i=n(32233),s=n(97326),o=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),f=n(82211),m=n(43345),Z=n(78657),g=n(53904),y=n(55210),b=n(93051);function _(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var N=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[y.Do()]}},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(gettext("Enter a valid email address.")),!1)}},{key:"send",value:function(){return Z.Z.post(i.Z.get("SEND_ACTIVATION_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["already_active","inactive_admin"].indexOf(e.code)>-1?g.Z.info(e.detail):403===e.status&&e.ban?(0,b.Z)(e.ban):g.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-request-activation-link"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.Z)("input",{type:"text",className:"form-control",placeholder:gettext("Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,r.Z)(f.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Send link"))))}}]),n}(m.Z),k=function(e){(0,u.Z)(n,e);var t=_(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("Activation link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-request-activation-link well-done"},void 0,(0,r.Z)("div",{className:"done-message"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{},void 0,this.getMessage())),(0,r.Z)("button",{className:"btn btn-primary btn-block",type:"button",onClick:this.props.callback},void 0,gettext("Request another link"))))}}]),n}(v().Component),x=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),a=t.call(this,e),(0,o.Z)((0,s.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,o.Z)((0,s.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,c.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,r.Z)(k,{user:this.state.complete,callback:this.reset}):(0,r.Z)(N,{callback:this.complete})}}]),n}(v().Component),w=n(4869);i.Z.addInitializer({name:"component:request-activation-link",initializer:function(){document.getElementById("request-activation-link-mount")&&(0,w.Z)(x,"request-activation-link-mount",!1)},after:"store"})},11768:function(e,t,n){"use strict";var a,i,s=n(32233),o=n(97326),r=n(4942),l=n(22928),c=n(15671),u=n(43144),d=n(79340),p=n(6215),h=n(61120),v=n(57588),f=n.n(v),m=n(73935),Z=n.n(m),g=n(82211),y=n(43345),b=n(78657),_=n(53904),N=n(55210),k=n(93051);function x(e){var t=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(e){return!1}}();return function(){var n,a=(0,h.Z)(e);if(t){var i=(0,h.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,p.Z)(this,n)}}var w=function(e){(0,d.Z)(n,e);var t=x(n);function n(e){var a;return(0,c.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[N.Do()]}},a}return(0,u.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(_.Z.error(gettext("Enter a valid email address.")),!1)}},{key:"send",value:function(){return b.Z.post(s.Z.get("SEND_PASSWORD_RESET_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["inactive_user","inactive_admin"].indexOf(e.code)>-1?this.props.showInactivePage(e):403===e.status&&e.ban?(0,k.Z)(e.ban):_.Z.apiError(e)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset"},void 0,(0,l.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,l.Z)("div",{className:"form-group"},void 0,(0,l.Z)("div",{className:"control-input"},void 0,(0,l.Z)("input",{type:"text",className:"form-control",placeholder:gettext("Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,l.Z)(g.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Send link"))))}}]),n}(y.Z),R=function(e){(0,d.Z)(n,e);var t=x(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("Reset password link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset well-done"},void 0,(0,l.Z)("div",{className:"done-message"},void 0,a||(a=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"check"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{},void 0,this.getMessage())),(0,l.Z)("button",{type:"button",className:"btn btn-primary btn-block",onClick:this.props.callback},void 0,gettext("Request another link"))))}}]),n}(f().Component),C=function(e){(0,d.Z)(n,e);var t=x(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getActivateButton",value:function(){return"inactive_user"===this.props.activation?(0,l.Z)("p",{},void 0,(0,l.Z)("a",{href:s.Z.get("REQUEST_ACTIVATION_URL")},void 0,gettext("Activate your account."))):null}},{key:"render",value:function(){return(0,l.Z)("div",{className:"page page-message page-message-info page-forgotten-password-inactive"},void 0,(0,l.Z)("div",{className:"container"},void 0,(0,l.Z)("div",{className:"message-panel"},void 0,i||(i=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{className:"lead"},void 0,gettext("Your account is inactive.")),(0,l.Z)("p",{},void 0,this.props.message),this.getActivateButton()))))}}]),n}(f().Component),S=function(e){(0,d.Z)(n,e);var t=x(n);function n(e){var a;return(0,c.Z)(this,n),a=t.call(this,e),(0,r.Z)((0,o.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,r.Z)((0,o.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,u.Z)(n,[{key:"showInactivePage",value:function(e){Z().render((0,l.Z)(C,{activation:e.code,message:e.detail}),document.getElementById("page-mount"))}},{key:"render",value:function(){return this.state.complete?(0,l.Z)(R,{callback:this.reset,user:this.state.complete}):(0,l.Z)(w,{callback:this.complete,showInactivePage:this.showInactivePage})}}]),n}(f().Component),E=n(4869);s.Z.addInitializer({name:"component:request-password-reset",initializer:function(){document.getElementById("request-password-reset-mount")&&(0,E.Z)(S,"request-password-reset-mount",!1)},after:"store"})},61323:function(e,t,n){"use strict";var a,i=n(32233),s=n(97326),o=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),f=n(73935),m=n.n(f),Z=n(82211),g=n(43345),y=n(14467),b=n(78657),_=n(98274),N=n(59801),k=n(53904),x=n(93051),w=n(19755);function R(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var C=function(e){(0,u.Z)(n,e);var t=R(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,password:""},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.state.password.trim().length||(k.Z.error(gettext("Enter new password.")),!1)}},{key:"send",value:function(){return b.Z.post(i.Z.get("CHANGE_PASSWORD_API"),{password:this.state.password})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){403===e.status&&e.ban?(0,x.Z)(e.ban):k.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-reset-password"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.Z)("input",{type:"password",className:"form-control",placeholder:gettext("Enter new password"),disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,r.Z)(Z.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Change password"))))}}]),n}(g.Z),S=function(e){(0,u.Z)(n,e);var t=R(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("%(username)s, your password has been changed successfully."),{username:this.props.user.username},!0)}},{key:"showSignIn",value:function(){N.Z.show(y.Z)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"page page-message page-message-success page-forgotten-password-changed"},void 0,(0,r.Z)("div",{className:"container"},void 0,(0,r.Z)("div",{className:"message-panel"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,r.Z)("p",{},void 0,gettext("You will have to sign in using new password before continuing.")),(0,r.Z)("p",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-primary",onClick:this.showSignIn},void 0,gettext("Sign in")))))))}}]),n}(v().Component),E=function(e){(0,u.Z)(n,e);var t=R(n);function n(){var e;(0,l.Z)(this,n);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return e=t.call.apply(t,[this].concat(i)),(0,o.Z)((0,s.Z)(e),"complete",(function(e){_.Z.softSignOut(),w('#hidden-login-form input[name="redirect_to"]').remove(),m().render((0,r.Z)(S,{user:e}),document.getElementById("page-mount"))})),e}return(0,c.Z)(n,[{key:"render",value:function(){return(0,r.Z)(C,{callback:this.complete})}}]),n}(v().Component),P=n(4869);i.Z.addInitializer({name:"component:reset-password-form",initializer:function(){document.getElementById("reset-password-form-mount")&&(0,P.Z)(E,"reset-password-form-mount",!1)},after:"store"})},15049:function(e,t,n){"use strict";var a,i=n(37424),s=n(22928),o=n(87462),r=n(57588),l=n.n(r),c=n(59131),u=n(15671),d=n(43144),p=n(97326),h=n(79340),v=n(6215),f=n(61120),m=n(4942),Z=n(32233),g=n(43345),y=n(21981),b=n(16427),_=n(6935),N=n(78657),k=n(53904),x=n(90287),w=n(98936),R=n(99755);var C=function(e){(0,h.Z)(o,e);var t,n,i=(t=o,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(e){return!1}}(),function(){var e,a=(0,f.Z)(t);if(n){var i=(0,f.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function o(e){var t;return(0,u.Z)(this,o),t=i.call(this,e),(0,m.Z)((0,p.Z)(t),"onQueryChange",(function(e){t.changeValue("query",e.target.value)})),t.state={isLoading:!1,query:e.search.query},t}return(0,d.Z)(o,[{key:"componentDidMount",value:function(){this.state.query.length&&this.handleSubmit()}},{key:"clean",value:function(){return!!this.state.query.trim().length||(k.Z.error(gettext("You have to enter search query.")),!1)}},{key:"send",value:function(){x.Z.dispatch((0,b.Vx)({isLoading:!0}));var e=this.state.query.trim(),t=window.location.href,n=t.indexOf("?q=");return n>0&&(t=t.substring(0,n+3)),window.history.pushState({},"",t+encodeURIComponent(e)),N.Z.get(Z.Z.get("SEARCH_API"),{q:e})}},{key:"handleSuccess",value:function(e){x.Z.dispatch((0,b.Vx)({query:this.state.query.trim(),isLoading:!1,providers:e})),e.forEach((function(e){"users"===e.id?x.Z.dispatch((0,_.ZB)(e.results.results)):"threads"===e.id&&x.Z.dispatch((0,y.zD)(e.results))}))}},{key:"handleError",value:function(e){k.Z.apiError(e),x.Z.dispatch((0,b.Vx)({isLoading:!1}))}},{key:"render",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)(R.sP,{},void 0,(0,s.Z)(R.mr,{styleName:"site-search"},void 0,(0,s.Z)(R.gC,{styleName:"site-search"},void 0,(0,s.Z)("h1",{},void 0,gettext("Search"))),(0,s.Z)(R.eA,{className:"page-header-search-form"},void 0,(0,s.Z)(w.gq,{},void 0,(0,s.Z)(w.kw,{auto:!0},void 0,(0,s.Z)(w.Z6,{},void 0,(0,s.Z)("input",{className:"form-control",disabled:this.state.isLoading,type:"text",value:this.state.query,placeholder:gettext("Search"),onChange:this.onQueryChange})),(0,s.Z)(w.Z6,{shrink:!0},void 0,(0,s.Z)("button",{className:"btn btn-secondary btn-icon btn-outline",disabled:this.state.isLoading},void 0,a||(a=(0,s.Z)("span",{className:"material-icon"},void 0,"search"))))))))))}}]),o}(g.Z),S=n(69987);function E(e){return(0,s.Z)("div",{className:"list-group nav-side"},void 0,e.providers.map((function(e){return(0,s.Z)(S.rU,{activeClassName:"active",className:"list-group-item",to:e.url},e.id,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name,(0,s.Z)(P,{results:e.results}))})))}function P(e){if(!e.results)return null;var t=e.results.count;return t>1e6?t=Math.ceil(t/1e6)+"KK":t>1e3&&(t=Math.ceil(t/1e3)+"K"),(0,s.Z)("span",{className:"badge"},void 0,t)}function L(e){return(0,s.Z)("div",{className:"page page-search"},void 0,(0,s.Z)(C,{provider:e.provider,search:e.search}),(0,s.Z)(c.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-3"},void 0,(0,s.Z)(E,{providers:e.search.providers})),(0,s.Z)("div",{className:"col-md-9"},void 0,e.children,(0,s.Z)(T,{provider:e.provider,search:e.search})))))}function T(e){var t=null;if(e.search.providers.forEach((function(n){n.id===e.provider.id&&(t=n.time)})),null===t)return null;var n=gettext("Search took %(time)s s to complete");return(0,s.Z)("footer",{className:"search-footer"},void 0,(0,s.Z)("p",{},void 0,interpolate(n,{time:t},!0)))}var O=n(11005),A=n(82211);function B(e){return(0,s.Z)("div",{},void 0,(0,s.Z)(O.Z,{isReady:!0,posts:e.results}),l().createElement(I,e))}n(69092);var I=function(e){(0,h.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,f.Z)(t);if(n){var i=(0,f.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function i(){var e;(0,u.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,m.Z)((0,p.Z)(e),"onClick",(function(){x.Z.dispatch((0,y.Vx)({isBusy:!0})),N.Z.get(e.props.provider.api,{q:e.props.query,page:e.props.next}).then((function(e){e.forEach((function(e){"threads"===e.id&&(x.Z.dispatch((0,y.R3)(e.results)),x.Z.dispatch((0,b.P0)(e)))})),x.Z.dispatch((0,y.Vx)({isBusy:!1}))}),(function(e){k.Z.apiError(e),x.Z.dispatch((0,y.Vx)({isBusy:!1}))}))})),e}return(0,d.Z)(i,[{key:"render",value:function(){return this.props.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(A.Z,{className:"btn btn-default btn-outline",loading:this.props.isBusy,onClick:this.onClick},void 0,gettext("Show more"))):null}}]),i}(l().Component);function D(e){var t=e.children,n=e.loading,a=e.posts,i=e.query;return a&&a.count?t:i.length?(0,s.Z)("p",{className:"lead"},void 0,n?gettext("Loading results..."):gettext("No threads matching search query have been found.")):(0,s.Z)("p",{className:"lead"},void 0,gettext("Enter at least two characters to search threads."))}var j=n(40429);function z(e){var t=e.children,n=e.loading,a=e.query;return e.users.length?t:a.length?(0,s.Z)("p",{className:"lead"},void 0,n?gettext("Loading results..."):gettext("No users matching search query have been found.")):(0,s.Z)("p",{className:"lead"},void 0,gettext("Enter at least two characters to search users."))}var U={threads:function(e){return(0,s.Z)(L,{provider:e.route.provider,search:e.search},void 0,(0,s.Z)(D,{loading:e.search.isLoading,query:e.search.query,posts:e.posts},void 0,l().createElement(B,(0,o.Z)({provider:e.route.provider,query:e.search.query},e.posts))))},users:function(e){return(0,s.Z)(L,{provider:e.route.provider,search:e.search},void 0,(0,s.Z)(z,{loading:e.search.isLoading,query:e.search.query,users:e.users},void 0,(0,s.Z)(j.Z,{cols:3,isReady:!e.search.isLoading,users:e.users})))}};function M(e){return{posts:e.posts,search:e.search,tick:e.tick.tick,user:e.auth.user,users:e.users}}var q=n(39633);Z.Z.addInitializer({name:"component:search",initializer:function(e){var t;"misago:search"===e.get("CURRENT_LINK")&&(0,q.Z)({paths:(t=Z.Z.get("SEARCH_PROVIDERS"),t.map((function(e){return{path:e.url,component:(0,i.$j)(M)(U[e.id]),provider:e}})))})},after:"store"})},61814:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p={info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-danger"},h=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"getSnackbarClass",value:function(){var e="alerts-snackbar";return this.props.isVisible?e+=" in":e+=" out",e}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getSnackbarClass()},void 0,(0,s.Z)("p",{className:"alert "+p[this.props.type]},void 0,this.props.message))}}]),i}(n.n(d)().Component);function v(e){return e.snackbar}var f=n(4869);i.Z.addInitializer({name:"component:snackbar",initializer:function(){(0,f.Z)((0,a.$j)(v)(h),"snackbar-mount")},after:"snackbar"})},95920:function(e,t,n){"use strict";var a=n(57588),i=n.n(a),s=n(22928),o=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(32233),v=n(26106),f=n(82211),m=n(43345),Z=n(96359),g=n(78657),y=n(53904),b=n(55210),_=n(59131),N=n(99755),k=function(e){var t=e.backendName,n=gettext("Sign in with %(backend)s"),a=interpolate(n,{backend:t},!0);return(0,s.Z)(N.sP,{},void 0,(0,s.Z)(N.mr,{styleName:"social-auth"},void 0,(0,s.Z)(N.gC,{styleName:"social-auth"},void 0,(0,s.Z)("h1",{},void 0,a))))};function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,p.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handlePrivacyPolicyChange",(function(e){var n=e.target.value;t.handleToggleAgreement("privacyPolicy",n)})),(0,p.Z)((0,l.Z)(t),"handleTermsOfServiceChange",(function(e){var n=e.target.value;t.handleToggleAgreement("termsOfService",n)})),(0,p.Z)((0,l.Z)(t),"handleToggleAgreement",(function(e,n){t.setState((function(a,i){if(null===a[e]){var s=w(w({},a.errors),{},(0,p.Z)({},e,null));return(0,p.Z)({errors:s},e,n)}var o=t.state.validators[e][0],r=w(w({},a.errors),{},(0,p.Z)({},e,[o(null)]));return(0,p.Z)({errors:r},e,null)}))}));var n={email:[b.Do()],username:[b.lG()]};return h.Z.get("TERMS_OF_SERVICE_ID")&&(n.termsOfService=[b.fT()]),h.Z.get("PRIVACY_POLICY_ID")&&(n.privacyPolicy=[b.jA()]),t.state={email:e.email||"",emailProtected:!!e.email,username:e.username||"",termsOfService:null,privacyPolicy:null,validators:n,errors:{},isLoading:!1},t}return(0,r.Z)(i,[{key:"clean",value:function(){if(this.validate(),-1!==[this.state.email.trim().length,this.state.username.trim().length].indexOf(0))return y.Z.error(gettext("Fill out all fields.")),!1;var e=this.state.validators;return h.Z.get("TERMS_OF_SERVICE_ID")&&null===this.state.termsOfService?(y.Z.error(e.termsOfService[0](null)),!1):!h.Z.get("PRIVACY_POLICY_ID")||null!==this.state.privacyPolicy||(y.Z.error(e.privacyPolicy[0](null)),y.Z.error(gettext("You need to accept the privacy policy.")),!1)}},{key:"send",value:function(){return g.Z.post(this.props.url,{email:this.state.email,username:this.state.username,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){(0,this.props.onRegistrationComplete)(e)}},{key:"handleError",value:function(e){if(200===e.status)(0,this.props.onRegistrationComplete)({activation:"active",step:"done",username:this.state.username});else if(400===e.status){var t={errors:e};e.email&&(t.emailProtected=!1),this.setState(t)}else y.Z.apiError(e)}},{key:"render",value:function(){var e=this.props.backend_name,t=this.state,n=t.email,a=t.emailProtected,i=t.username,o=t.isLoading,r=null;if(a){var l=gettext("Your e-mail address has been verified by %(backend)s.");r=interpolate(l,{backend:e},!0)}return(0,s.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,s.Z)(k,{backendName:e}),(0,s.Z)(_.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Complete your details"))),(0,s.Z)("div",{className:"panel-body"},void 0,(0,s.Z)(Z.Z,{for:"id_username",label:gettext("Username"),validation:this.state.errors.username},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:o,onChange:this.bindInput("username"),value:i})),(0,s.Z)(Z.Z,{for:"id_email",label:gettext("E-mail address"),helpText:r,validation:a?null:this.state.errors.email},void 0,(0,s.Z)("input",{type:"email",id:"id_email",className:"form-control",disabled:o||a,onChange:this.bindInput("email"),value:n})),(0,s.Z)(v.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,s.Z)("div",{className:"panel-footer"},void 0,(0,s.Z)(f.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Sign in")))))))))}}]),i}(m.Z),C=function(e){var t,n,a=e.activation,i=e.backend_name,o=e.username;return n="user"===a?gettext("%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===a?gettext("%(username)s, your account has been created but board administrator will have to activate it before you will be able to sign in."):gettext("%(username)s, your account has been created and you have been signed in to it."),t="active"===a?"check":"info_outline",(0,s.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,s.Z)(k,{backendName:i}),(0,s.Z)(_.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Registration completed!"))),(0,s.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,t)),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,interpolate(n,{username:o},!0)),(0,s.Z)("p",{className:"help-block"},void 0,(0,s.Z)("a",{className:"btn btn-default",href:h.Z.get("MISAGO_PATH")},void 0,gettext("Return to forum index"))))))))))};var S=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handleRegistrationComplete",(function(e){var n=e.activation,a=e.email,i=e.step,s=e.username;t.setState({activation:n,email:a,step:i,username:s})})),t.state={step:e.step,activation:e.activation||"",email:e.email||"",username:e.username||""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this.props,t=e.backend_name,n=e.url,a=this.state,i=a.activation,o=a.email,r=a.step,l=a.username;return"register"===r?(0,s.Z)(R,{backend_name:t,email:o,url:n,username:l,onRegistrationComplete:this.handleRegistrationComplete}):(0,s.Z)(C,{activation:i,backend_name:t,email:o,url:n,username:l})}}]),i}(i().Component),E=n(4869);h.Z.addInitializer({name:"component:social-auth",initializer:function(e){if("misago:social-complete"===e.get("CURRENT_LINK")){var t=e.get("SOCIAL_AUTH_FORM");(0,E.Z)(i().createElement(S,t),"page-mount")}},after:"store"})},60630:function(e,t,n){"use strict";var a,i,s=n(37424),o=n(22928),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(57588),f=n.n(v),m=n(87462),Z=n(43345),g=n(96359),y=n(8154),b=n(7738),_=n(78657),N=n(59801),k=n(53904),x=n(90287);var w,R=function(e){(0,u.Z)(s,e);var t,n,i=(t=s,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function s(e){var t;return(0,r.Z)(this,s),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"onUsernameChange",(function(e){t.changeValue("username",e.target.value)})),t.state={isLoading:!1,username:""},t}return(0,l.Z)(s,[{key:"clean",value:function(){return!!this.state.username.trim().length||(k.Z.error(gettext("You have to enter user name.")),!1)}},{key:"send",value:function(){return _.Z.patch(this.props.thread.api.index,[{op:"add",path:"participants",value:this.state.username},{op:"add",path:"acl",value:1}])}},{key:"handleSuccess",value:function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants)),k.Z.success(gettext("New participant has been added to thread.")),N.Z.hide()}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog modal-sm",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,a||(a=(0,o.Z)(C,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_username",label:gettext("User to add")},void 0,(0,o.Z)("input",{id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.onUsernameChange,type:"text",value:this.state.username}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-block btn-primary",disabled:this.state.isLoading},void 0,gettext("Add participant")),(0,o.Z)("button",{className:"btn btn-block btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel"))))))}}]),s}(Z.Z);function C(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,i||(i=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Add participant")))}var S=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(R,{thread:e.props.thread}))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_add_participants?(0,o.Z)("div",{className:"col-xs-12 col-sm-3"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:this.onClick,type:"button"},void 0,w||(w=(0,o.Z)("span",{className:"material-icon"},void 0,"person_add")),gettext("Add participant"))):null}}]),i}(f().Component),E=n(32233);var P=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(gettext("Are you sure you want to take over this thread?"));else{var i=gettext("Are you sure you want to change thread owner to %(user)s?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(e=t.props.thread,n=t.props.participant,_.Z.patch(e.api.index,[{op:"replace",path:"owner",value:n.id},{op:"add",path:"acl",value:1}]).then((function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants));var t=gettext("%(user)s has been made new thread owner.");k.Z.success(interpolate(t,{user:n.username},!0))}),(function(e){k.Z.apiError(e)})))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.participant.is_owner?null:this.props.thread.acl.can_change_owner?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,gettext("Make owner"))):null}}]),i}(f().Component);var L,T,O,A=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(gettext("Are you sure you want to leave this thread?"));else{var i=gettext("Are you sure you want to remove %(user)s from this thread?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(t.isUser?(e=t.props.thread,n=t.props.participant,_.Z.patch(e.api.index,[{op:"remove",path:"participants",value:n.id}]).then((function(){k.Z.success(gettext("You have left this thread.")),window.setTimeout((function(){window.location=E.Z.get("PRIVATE_THREADS_URL")}),3e3)}),(function(e){k.Z.apiError(e)}))):function(e,t){_.Z.patch(e.api.index,[{op:"remove",path:"participants",value:t.id},{op:"add",path:"acl",value:1}]).then((function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants));var n=gettext("%(user)s has been removed from this thread.");k.Z.success(interpolate(n,{user:t.username},!0))}),(function(e){k.Z.apiError(e)}))}(t.props.thread,t.props.participant))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_moderate_private_threads;return this.props.userIsOwner||this.isUser||e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,this.isUser?gettext("Leave thread"):gettext("Remove"))):null}}]),i}(f().Component),B=n(19605);function I(e){var t=e.participant,n="btn btn-default";return t.is_owner&&(n="btn btn-primary"),n+=" btn-user btn-block",(0,o.Z)("div",{className:"col-xs-12 col-sm-3 col-md-2 participant-card"},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{"aria-haspopup":"true","aria-expanded":"false",className:n,"data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)(B.ZP,{size:"34",user:t}),(0,o.Z)("span",{className:"btn-text"},void 0,t.username)),(0,o.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,(0,o.Z)(D,{isOwner:t.is_owner}),L||(L=(0,o.Z)("li",{className:"dropdown-header"})),(0,o.Z)("li",{},void 0,(0,o.Z)("a",{href:t.url},void 0,gettext("See profile"))),T||(T=(0,o.Z)("li",{role:"separator",className:"divider"})),f().createElement(P,e),f().createElement(A,e))))}function D(e){return e.isOwner?(0,o.Z)("li",{className:"dropdown-header dropdown-header-owner"},void 0,O||(O=(0,o.Z)("span",{className:"material-icon"},void 0,"start")),(0,o.Z)("span",{className:"icon-text"},void 0,gettext("Thread owner"))):null}function j(e){var t=e.participants,n=e.thread,a=e.user,i=e.userIsOwner;return(0,o.Z)("div",{className:"participants-cards"},void 0,(0,o.Z)("div",{className:"row"},void 0,t.map((function(e){return(0,o.Z)(I,{participant:e,thread:n,user:a,userIsOwner:i},e.id)}))))}function z(e){return e.participants.length?(0,o.Z)("div",{className:"panel panel-default panel-participants"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,f().createElement(j,(0,m.Z)({userIsOwner:U(e.user,e.participants)},e)),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)(S,{thread:e.thread}),(0,o.Z)("div",{className:"col-xs-12 col-sm-9"},void 0,(0,o.Z)("p",{},void 0,function(e){var t=e.length,n=ngettext("This thread has %(users)s participant.","This thread has %(users)s participants.",t);return interpolate(n,{users:t},!0)}(e.participants)))))):null}function U(e,t){return t[0].id===e.id}var M,q=n(30381),H=n.n(q);function F(e){return(0,o.Z)("div",{className:"poll-choices-bars"},void 0,e.poll.choices.map((function(t){return(0,o.Z)(Y,{choice:t,poll:e.poll},t.hash)})))}function Y(e){var t=0;return e.choice.votes&&e.poll.votes&&(t=Math.ceil(100*e.choice.votes/e.poll.votes)),(0,o.Z)("dl",{className:"dl-horizontal"},void 0,(0,o.Z)("dt",{},void 0,e.choice.label),(0,o.Z)("dd",{},void 0,(0,o.Z)("div",{className:"progress"},void 0,(0,o.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":t,"aria-valuemin":"0","aria-valuemax":"100",style:{width:t+"%"}},void 0,(0,o.Z)("span",{className:"sr-only"},void 0,G(e.votes,e.proc)))),(0,o.Z)("ul",{className:"list-unstyled list-inline poll-chart"},void 0,(0,o.Z)(V,{proc:t,votes:e.choice.votes}),(0,o.Z)($,{selected:e.choice.selected}))))}function V(e){return(0,o.Z)("li",{className:"poll-chart-votes"},void 0,G(e.votes,e.proc))}function G(e,t){var n=npgettext("thread poll","%(votes)s vote, %(proc)s% of total.","%(votes)s votes, %(proc)s% of total.",e);return interpolate(n,{votes:e,proc:t},!0)}function $(e){return e.selected?(0,o.Z)("li",{className:"poll-chart-selected"},void 0,M||(M=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("thread poll","You've voted on this choice.")):null}var W,Q,K,J=n(30337),X=n(3784);var ee=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isLoading:!0,error:null,data:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(this.props.poll.api.votes).then((function(t){var n=t.map((function(e){return Object.assign({},e,{voters:e.voters.map((function(e){return Object.assign({},e,{voted_on:H()(e.voted_on)})}))})}));e.setState({isLoading:!1,data:n})}),(function(t){e.setState({isLoading:!1,error:t.detail})}))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog"+(this.state.error?" modal-message":" modal-sm"),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,W||(W=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("thread poll","Poll votes"))),(0,o.Z)(te,{data:this.state.data,error:this.state.error,isLoading:this.state.isLoading})))}}]),i}(f().Component);function te(e){return e.isLoading?Q||(Q=(0,o.Z)(X.Z,{})):e.error?(0,o.Z)(J.Z,{icon:"error_outline",message:e.error}):(0,o.Z)(ne,{data:e.data})}function ne(e){return(0,o.Z)("div",{className:"modal-body modal-poll-votes"},void 0,(0,o.Z)("ul",{className:"list-unstyled votes-details"},void 0,e.data.map((function(e){return f().createElement(ae,(0,m.Z)({key:e.hash},e))}))))}function ae(e){return(0,o.Z)("li",{},void 0,(0,o.Z)("h4",{},void 0,e.label),(0,o.Z)(ie,{votes:e.votes}),(0,o.Z)(se,{voters:e.voters}),K||(K=(0,o.Z)("hr",{})))}function ie(e){var t=npgettext("thread poll","%(votes)s user has voted for this choice.","%(votes)s users have voted for this choice.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,o.Z)("p",{},void 0,n)}function se(e){return e.voters.length?(0,o.Z)("ul",{className:"list-unstyled"},void 0,e.voters.map((function(e){return f().createElement(oe,(0,m.Z)({key:e.username},e))}))):null}function oe(e){return e.url?(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,o.Z)(re,{voted_on:e.voted_on})):(0,o.Z)("li",{},void 0,(0,o.Z)("strong",{},void 0,e.username)," ",(0,o.Z)(re,{voted_on:e.voted_on}))}function re(e){return(0,o.Z)("abbr",{className:"text-muted",title:e.voted_on.format("LLL")},void 0,e.voted_on.fromNow())}var le=n(59752),ce=n(64646);function ue(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function de(e){var t=e.isPollOver,n=e.poll,a=e.showVoting,i=e.thread;if(!function(e,t,n){return n.is_public||t.can_delete||t.can_edit||t.can_see_votes||t.can_vote&&!e&&(!n.hasSelectedChoices||n.allow_revotes)}(t,n.acl,n))return null;var s=[],r=n.acl.can_vote,l=!n.hasSelectedChoices||n.allow_revotes;return r&&l&&s.push(0),(n.is_public||n.acl.can_see_votes)&&s.push(1),n.acl.can_edit&&s.push(2),n.acl.can_delete&&s.push(3),(0,o.Z)("div",{className:"row poll-options"},void 0,(0,o.Z)(he,{controls:s,isPollOver:t,poll:n,showVoting:a}),(0,o.Z)(ve,{controls:s,poll:n}),(0,o.Z)(fe,{controls:s,poll:n,thread:i,onClick:e.edit}),(0,o.Z)(me,{controls:s,poll:n}))}function pe(e,t){var n="col-xs-6";return 1===e.length&&(n="col-xs-12"),3===e.length&&e[0]===t&&(n="col-xs-12"),n+" col-sm-3 col-md-2"}function he(e){var t=e.poll.acl.can_vote,n=!e.poll.hasSelectedChoices||e.poll.allow_revotes;return t&&n?(0,o.Z)("div",{className:pe(e.controls,0)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.showVoting,type:"button"},void 0,pgettext("thread poll","Vote"))):null}var ve=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(ee,{poll:e.props.poll}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.is_public||this.props.poll.acl.can_see_votes?(0,o.Z)("div",{className:pe(this.props.controls,1)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","See votes"))):null}}]),n}(f().Component);function fe(e){return e.poll.acl.can_edit?(0,o.Z)("div",{className:pe(e.controls,2)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.onClick,type:"button"},void 0,pgettext("thread poll","Edit"))):null}var me=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){if(!window.confirm(pgettext("thread poll","Are you sure you want to delete this poll? This action is not reversible.")))return!1;x.Z.dispatch(le.n6()),_.Z.delete(e.props.poll.api.index).then(e.handleSuccess,e.handleError)})),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(e){k.Z.success(pgettext("thread poll","Poll has been deleted")),x.Z.dispatch(le.Od()),x.Z.dispatch(b.y8(e))})),(0,h.Z)((0,c.Z)(e),"handleError",(function(e){k.Z.apiError(e),x.Z.dispatch(le.Ar())})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.acl.can_delete?(0,o.Z)("div",{className:pe(this.props.controls,3)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","Delete"))):null}}]),n}(f().Component),Ze=n(89627),ge='<abbr title="%(absolute)s">%(relative)s</abbr>';function ye(e){return(0,o.Z)("ul",{className:"list-unstyled list-inline poll-details"},void 0,(0,o.Z)(we,{votes:e.poll.votes}),(0,o.Z)(ke,{poll:e.poll}),(0,o.Z)(Re,{poll:e.poll}),(0,o.Z)(be,{poll:e.poll}))}function be(e){var t=interpolate((0,Ze.Z)(pgettext("thread poll","Started by %(poster)s %(posted_on)s.")),{poster:_e(e.poll),posted_on:Ne(e.poll)},!0);return(0,o.Z)("li",{className:"poll-info-creation",dangerouslySetInnerHTML:{__html:t}})}function _e(e){return e.url.poster?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.url.poster),user:(0,Ze.Z)(e.poster_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.poster_name)},!0)}function Ne(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.posted_on.format("LLL")),relative:(0,Ze.Z)(e.posted_on.fromNow())},!0)}function ke(e){if(!e.poll.length)return null;var t=interpolate((0,Ze.Z)(pgettext("thread poll","Voting ends %(ends_on)s.")),{ends_on:xe(e.poll)},!0);return(0,o.Z)("li",{className:"poll-info-ends-on",dangerouslySetInnerHTML:{__html:t}})}function xe(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.endsOn.format("LLL")),relative:(0,Ze.Z)(e.endsOn.fromNow())},!0)}function we(e){var t=npgettext("thread poll","%(votes)s vote.","%(votes)s votes.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,o.Z)("li",{className:"poll-info-votes"},void 0,n)}function Re(e){return e.poll.is_public?(0,o.Z)("li",{className:"poll-info-public"},void 0,pgettext("thread poll","Voting is public.")):null}function Ce(e){return(0,o.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("h2",{},void 0,e.poll.question),(0,o.Z)(ye,{poll:e.poll}),(0,o.Z)(F,{poll:e.poll}),(0,o.Z)(de,{isPollOver:e.isPollOver,poll:e.poll,showVoting:e.showVoting,thread:e.thread})))}function Se(e){return(0,o.Z)("ul",{className:"list-unstyled list-inline poll-help"},void 0,(0,o.Z)(Ee,{choicesLeft:e.choicesLeft}),(0,o.Z)(Pe,{poll:e.poll}))}function Ee(e){var t=e.choicesLeft;if(0===t)return(0,o.Z)("li",{className:"poll-help-choices-left"},void 0,pgettext("thread poll","You can't select any more choices."));var n=npgettext("thread poll","You can select %(choices)s more choice.","You can select %(choices)s more choices.",t),a=interpolate(n,{choices:t},!0);return(0,o.Z)("li",{className:"poll-help-choices-left"},void 0,a)}function Pe(e){return e.poll.allow_revotes?(0,o.Z)("li",{className:"poll-help-allow-revotes"},void 0,pgettext("thread poll","You can change your vote later.")):(0,o.Z)("li",{className:"poll-help-no-revotes"},void 0,pgettext("thread poll","Votes are final."))}function Le(e){return(0,o.Z)("ul",{className:"list-unstyled poll-select-choices"},void 0,e.choices.map((function(t){return(0,o.Z)(Te,{choice:t,toggleChoice:e.toggleChoice},t.hash)})))}var Te=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.toggleChoice(e.props.choice.hash)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,o.Z)("li",{className:"poll-select-choice"},void 0,(0,o.Z)("button",{className:this.props.choice.selected?"btn btn-selected":"btn",onClick:this.onClick,type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.props.choice.selected?"check_box":"check_box_outline_blank"),(0,o.Z)("strong",{},void 0,this.props.choice.label)))}}]),i}(f().Component);function Oe(e,t){var n=[];for(var a in t){var i=t[a];i.selected&&n.push(i)}return e.allowed_choices-n.length}var Ae=n(82211);var Be=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"toggleChoice",(function(e){var n,a=function(e,t){for(var n in e){var a=e[n];if(a.hash===t)return a}return null}(t.state.choices,e);n=a.selected?t.deselectChoice(a,e):t.selectChoice(a,e),t.setState({choices:n,choicesLeft:Oe(t.props.poll,n)})})),(0,h.Z)((0,c.Z)(t),"selectChoice",(function(e,n){if(!Oe(t.props.poll,t.state.choices))for(var a in t.state.choices.slice()){var i=t.state.choices[a];if(i.selected&&i.hash!=n){i.selected=!1;break}}return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash==n||e.selected})}))})),(0,h.Z)((0,c.Z)(t),"deselectChoice",(function(e,n){return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash!=n&&e.selected})}))})),t.state={isLoading:!1,choices:e.poll.choices,choicesLeft:Oe(e.poll,e.poll.choices)},t}return(0,l.Z)(i,[{key:"clean",value:function(){return this.state.choicesLeft!==this.props.poll.allowed_choices||(k.Z.error(gettext("You need to select at least one choice")),!1)}},{key:"send",value:function(){var e=[];for(var t in this.state.choices.slice()){var n=this.state.choices[t];n.selected&&e.push(n.hash)}return _.Z.post(this.props.poll.api.votes,e)}},{key:"handleSuccess",value:function(e){x.Z.dispatch(le.gx(e)),k.Z.success(gettext("Your vote has been saved.")),this.props.showResults()}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){var e=[];return this.props.poll.acl.can_vote&&e.push(0),(this.props.poll.is_public||this.props.poll.acl.can_see_votes)&&e.push(1),this.props.poll.acl.can_edit&&e.push(2),this.props.poll.acl.can_delete&&e.push(3),(0,o.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("h2",{},void 0,this.props.poll.question),(0,o.Z)(ye,{poll:this.props.poll}),(0,o.Z)(Le,{choices:this.state.choices,toggleChoice:this.toggleChoice}),(0,o.Z)(Se,{choicesLeft:this.state.choicesLeft,poll:this.props.poll})),(0,o.Z)("div",{className:"panel-footer"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:pe(e,0)},void 0,(0,o.Z)(Ae.Z,{className:"btn-primary btn-block btn-sm",loading:this.state.isLoading},void 0,gettext("Save your vote"))),(0,o.Z)("div",{className:pe(e,1)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.state.isLoading,onClick:this.props.showResults,type:"button"},void 0,gettext("See results"))),(0,o.Z)(fe,{controls:e,poll:this.props.poll,thread:this.props.thread,onClick:this.props.edit}),(0,o.Z)(me,{controls:e,poll:this.props.poll})))))}}]),i}(Z.Z);var Ie,De=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showResults",(function(){t.setState({showResults:!0})})),(0,h.Z)((0,c.Z)(t),"showVoting",(function(){t.setState({showResults:!1})}));var n=!0;return e.user.id&&!e.poll.hasSelectedChoices&&(n=!1),t.state={showResults:n},t}return(0,l.Z)(i,[{key:"render",value:function(){if(!this.props.thread.poll)return null;var e=function(e){return!!e.length&&H()().isAfter(e.endsOn)}(this.props.poll);return e||!this.props.poll.acl.can_vote||this.state.showResults?f().createElement(Ce,(0,m.Z)({isPollOver:e,showVoting:this.showVoting},this.props)):f().createElement(Be,(0,m.Z)({showResults:this.showResults},this.props))}}]),i}(f().Component);function je(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var ze=function(e){(0,u.Z)(n,e);var t=je(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onAdd",(function(){var t=e.props.choices.slice();t.push({hash:Me(),label:""}),e.props.setChoices(t)})),(0,h.Z)((0,c.Z)(e),"onChange",(function(t,n){var a=e.props.choices.map((function(e){return e.hash===t&&(e.label=n),e}));e.props.setChoices(a)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(t){var n=e.props.choices.filter((function(e){return e.hash!==t}));e.props.setChoices(n)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"poll-choices-control"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,this.props.choices.map((function(t){return(0,o.Z)(Ue,{canDelete:e.props.choices.length>2,choice:t,disabled:e.props.disabled,onChange:e.onChange,onDelete:e.onDelete},t.hash)}))),(0,o.Z)("button",{className:"btn btn-default btn-sm",disabled:this.props.disabled,onClick:this.onAdd,type:"button"},void 0,pgettext("thread poll","Add choice")))}}]),n}(f().Component),Ue=function(e){(0,u.Z)(n,e);var t=je(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onChange",(function(t){e.props.onChange(e.props.choice.hash,t.target.value)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(){window.confirm(pgettext("thread poll","Are you sure you want to remove this choice?"))&&e.props.onDelete(e.props.choice.hash)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("li",{className:"list-group-item"},void 0,(0,o.Z)("button",{className:"btn",disabled:!this.props.canDelete||this.props.disabled,onClick:this.onDelete,title:pgettext("thread poll","Remove this choice"),type:"button"},void 0,Ie||(Ie=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))),(0,o.Z)("input",{disabled:this.props.disabled,maxLength:"255",placeholder:pgettext("thread poll","Poll choice"),type:"text",onChange:this.onChange,value:this.props.choice.label}))}}]),n}(f().Component);function Me(){for(var e="";12!=e.length;)e=Math.random().toString(36).replace(/[^a-zA-Z0-9]+/g,"").substr(1,12);return e}var qe=n(7227);var He=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"setChoices",(function(e){var n=Object.assign({},n,{choices:null});t.setState({choices:e,errors:n})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){(t.props.poll?window.confirm(pgettext("thread poll","Are you sure you want to discard changes?")):window.confirm(pgettext("thread poll","Are you sure you want to discard new poll?")))&&t.props.close()}));var n=e.poll.id?e.poll:{question:"",choices:[{hash:"choice-10000",label:""},{hash:"choice-20000",label:""}],length:0,allowed_choices:1,allow_revotes:0,is_public:0};return t.state={isLoading:!1,isEdit:!!n.id,question:n.question,choices:n.choices,length:n.length,allowed_choices:n.allowed_choices,allow_revotes:n.allow_revotes,is_public:n.is_public,validators:{question:[],choices:[],length:[],allowed_choices:[]},errors:{}},t}return(0,l.Z)(i,[{key:"send",value:function(){var e={question:this.state.question,choices:this.state.choices,length:this.state.length,allowed_choices:this.state.allowed_choices,allow_revotes:this.state.allow_revotes,is_public:this.state.is_public};return this.state.isEdit?_.Z.put(this.props.poll.api.index,e):_.Z.post(this.props.thread.api.poll,e)}},{key:"handleSuccess",value:function(e){x.Z.dispatch(le.gx(e)),this.state.isEdit?k.Z.success(pgettext("thread poll","Poll has been edited.")):k.Z.success(pgettext("thread poll","Poll has been posted.")),this.props.close()}},{key:"handleError",value:function(e){400===e.status?(e.non_field_errors&&(e.allowed_choices=e.non_field_errors),this.setState({errors:Object.assign({},e)}),k.Z.error(gettext("Form contains errors."))):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"poll-form"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,this.state.isEdit?pgettext("thread poll","Edit poll"):pgettext("thread poll","Add poll"))),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,pgettext("thread poll","Question and choices")),(0,o.Z)(g.Z,{label:pgettext("thread poll","Poll question"),for:"id_questions",validation:this.state.errors.question},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_questions",onChange:this.bindInput("question"),type:"text",maxLength:"255",value:this.state.question})),(0,o.Z)(g.Z,{label:pgettext("thread poll","Available choices"),validation:this.state.errors.choices},void 0,(0,o.Z)(ze,{choices:this.state.choices,disabled:this.state.isLoading,setChoices:this.setChoices}))),(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,pgettext("thread poll","Voting")),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Poll length"),helpText:pgettext("thread poll","Enter number of days for which voting in this poll should be possible or zero to run this poll indefinitely."),for:"id_length",validation:this.state.errors.length},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_length",onChange:this.bindInput("length"),type:"text",value:this.state.length}))),(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Allowed choices"),for:"id_allowed_choices",validation:this.state.errors.allowed_choices},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_allowed_choices",onChange:this.bindInput("allowed_choices"),type:"text",maxLength:"255",value:this.state.allowed_choices})))),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)(Fe,{bindInput:this.bindInput,disabled:this.state.isLoading,isEdit:this.state.isEdit,value:this.state.is_public}),(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Allow vote changes"),for:"id_allow_revotes"},void 0,(0,o.Z)(qe.Z,{id:"id_allow_revotes",disabled:this.state.isLoading,iconOn:"check",iconOff:"close",labelOn:pgettext("thread poll","Allow participants to change their vote"),labelOff:pgettext("thread poll","Don't allow participants to change their vote"),onChange:this.bindInput("allow_revotes"),value:this.state.allow_revotes})))))),(0,o.Z)("div",{className:"panel-footer text-right"},void 0,(0,o.Z)("button",{className:"btn btn-default",disabled:this.state.isLoading,onClick:this.onCancel,type:"button"},void 0,pgettext("thread poll","Cancel"))," ",(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,this.state.isEdit?pgettext("thread poll","Save changes"):pgettext("thread poll","Post poll"))))))}}]),i}(Z.Z);function Fe(e){return e.isEdit?null:(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Make voting public"),helpText:pgettext("thread poll","Making voting public will allow everyone to access detailed list of votes, showing which users voted for which choices and at which times. This option can't be changed after poll's creation. Moderators may see voting details for all polls."),for:"id_is_public"},void 0,(0,o.Z)(qe.Z,{id:"id_is_public",disabled:e.disabled,iconOn:"visibility",iconOff:"visibility_off",labelOn:pgettext("thread poll","Votes are public"),labelOff:pgettext("thread poll","Votes are hidden"),onChange:e.bindInput("is_public"),value:e.value})))}var Ye={changed_title:"edit",pinned_globally:"bookmark",pinned_locally:"bookmark_border",unpinned:"panorama_fish_eye",moved:"arrow_forward",merged:"call_merge",approved:"done",opened:"lock_open",closed:"lock_outline",unhid:"visibility",hid:"visibility_off",changed_owner:"grade",tookover:"grade",added_participant:"person_add",owner_left:"person_outline",participant_left:"person_outline",removed_participant:"remove_circle_outline"},Ve=function(e){return(0,o.Z)("span",{className:"event-icon-bg"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,Ye[e.post.event_type]))},Ge=n(92747);function $e(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function We(e){return e.post.acl.can_hide?(0,o.Z)("li",{className:"event-controls"},void 0,f().createElement(Qe,e),f().createElement(Ke,e),f().createElement(Je,e)):null}var Qe=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0,hidden_on:H()(),hidden_by_name:e.props.user.username,url:Object.assign(e.props.post.url,{hidden_by:e.props.user.url})})),_.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!0}]).then((function(t){x.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?null:(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Hide"))}}]),n}(f().Component),Ke=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1})),_.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!1}]).then((function(t){x.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Unhide")):null}}]),n}(f().Component),Je=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){window.confirm(gettext("Are you sure you wish to delete this event? This action is not reversible!"))&&e.delete()})),(0,h.Z)((0,c.Z)(e),"delete",(function(){x.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!0})),_.Z.delete(e.props.post.api.index).then((function(){k.Z.success(gettext("Event has been deleted."))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Delete"))}}]),n}(f().Component),Xe='<span class="item-title">%(user)s</span>',et='<a href="%(url)s" class="item-title">%(user)s</a>';function tt(e){return(0,o.Z)("ul",{className:"list-inline event-info"},void 0,f().createElement(nt,e),f().createElement(at,e),f().createElement(We,e))}function nt(e){if(e.post.is_hidden){var t;t=e.post.url.hidden_by?interpolate(et,{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate(Xe,{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("Hidden by %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,o.Z)("li",{className:"event-hidden-message",dangerouslySetInnerHTML:{__html:a}})}return null}function at(e){var t;t=e.post.poster?interpolate(et,{url:(0,Ze.Z)(e.post.poster.url),user:(0,Ze.Z)(e.post.poster_name)},!0):interpolate(Xe,{user:(0,Ze.Z)(e.post.poster_name)},!0);var n=interpolate('<a href="%(url)s" title="%(absolute)s">%(relative)s</a>',{url:(0,Ze.Z)(e.post.url.index),absolute:(0,Ze.Z)(e.post.posted_on.format("LLL")),relative:(0,Ze.Z)(e.post.posted_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("By %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,o.Z)("li",{className:"event-posters",dangerouslySetInnerHTML:{__html:a}})}var it={pinned_globally:gettext("Thread has been pinned globally."),pinned_locally:gettext("Thread has been pinned locally."),unpinned:gettext("Thread has been unpinned."),approved:gettext("Thread has been approved."),opened:gettext("Thread has been opened."),closed:gettext("Thread has been closed."),unhid:gettext("Thread has been revealed."),hid:gettext("Thread has been made hidden."),tookover:gettext("Took thread over."),owner_left:gettext("Owner has left thread. This thread is now closed."),participant_left:gettext("Participant has left thread.")},st='<a href="%(url)s" class="item-title">%(name)s</a>',ot='<span class="item-title">%(name)s</span>';function rt(e){return it[e.post.event_type]?(0,o.Z)("p",{className:"event-message"},void 0,it[e.post.event_type]):"changed_title"===e.post.event_type?f().createElement(lt,e):"moved"===e.post.event_type?f().createElement(ct,e):"merged"===e.post.event_type?f().createElement(ut,e):"changed_owner"===e.post.event_type?f().createElement(dt,e):"added_participant"===e.post.event_type?f().createElement(pt,e):"removed_participant"===e.post.event_type?f().createElement(ht,e):null}function lt(e){var t=(0,Ze.Z)(gettext("Thread title has been changed from %(old_title)s.")),n=interpolate(ot,{name:(0,Ze.Z)(e.post.event_context.old_title)},!0),a=interpolate(t,{old_title:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ct(e){var t=(0,Ze.Z)(gettext("Thread has been moved from %(from_category)s.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.from_category.url),name:(0,Ze.Z)(e.post.event_context.from_category.name)},!0),a=interpolate(t,{from_category:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ut(e){var t=(0,Ze.Z)(gettext("The %(merged_thread)s thread has been merged into this thread.")),n=interpolate(ot,{name:(0,Ze.Z)(e.post.event_context.merged_thread)},!0),a=interpolate(t,{merged_thread:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function dt(e){var t=(0,Ze.Z)(gettext("Changed thread owner to %(user)s.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function pt(e){var t=(0,Ze.Z)(gettext("Added %(user)s to thread.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ht(e){var t=(0,Ze.Z)(gettext("Removed %(user)s from thread.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function vt(e){return e.post.is_read?null:(0,o.Z)("div",{className:"event-label"},void 0,(0,o.Z)("span",{className:"label label-unread"},void 0,gettext("New event")))}var ft=n(19755);var mt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;this.props.post.is_read||ft(this.element).waypoint({handler:function(t){"down"!==t||e.props.post.is_read||window.setTimeout((function(){var t=e.element.getBoundingClientRect(),n=t.height+t.top,a=document.documentElement.clientHeight;n<5||n>a||(x.Z.dispatch(Ge.r$(e.props.post,{is_read:!0})),_.Z.post(e.props.post.api.read).then((function(t){x.Z.dispatch(b.Vx(e.props.thread,{is_read:t.thread_is_read}))}),(function(e){k.Z.apiError(e)})))}),1e3)},offset:"bottom-in-view"})}},{key:"render",value:function(){var e=this;return f().createElement("div",{className:this.props.className,ref:function(t){t&&(e.element=t)}},this.props.children)}}]),i}(f().Component);function Zt(e){var t="event";return e.post.isDeleted?t="hide":e.post.is_hidden&&(t="event post-hidden"),(0,o.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,o.Z)(vt,{post:e.post}),(0,o.Z)("div",{className:"event-body"},void 0,(0,o.Z)("div",{className:"event-icon"},void 0,f().createElement(Ve,e)),(0,o.Z)(mt,{className:"event-content",post:e.post},void 0,f().createElement(rt,e),f().createElement(tt,e))))}var gt=n(69130),yt=n(48772);function bt(e){return(0,o.Z)("div",{className:"col-xs-12 col-md-6"},void 0,f().createElement(_t,e),(0,o.Z)("div",{className:"post-attachment"},void 0,(0,o.Z)("a",{href:e.attachment.url.index,className:"attachment-name item-title"},void 0,e.attachment.filename),f().createElement(xt,e)))}function _t(e){return e.attachment.is_image?(0,o.Z)("div",{className:"post-attachment-preview"},void 0,f().createElement(kt,e)):(0,o.Z)("div",{className:"post-attachment-preview"},void 0,f().createElement(Nt,e))}function Nt(e){return(0,o.Z)("a",{href:e.attachment.url.index,className:"material-icon"},void 0,"insert_drive_file")}function kt(e){var t=e.attachment.url.thumb||e.attachment.url.index;return(0,o.Z)("a",{className:"post-thumbnail",href:e.attachment.url.index,style:{backgroundImage:'url("'+(0,Ze.Z)(t)+'")'}})}function xt(e){var t;t=e.attachment.url.uploader?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.attachment.url.uploader),user:(0,Ze.Z)(e.attachment.uploader_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.attachment.uploader_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.attachment.uploaded_on.format("LLL")),relative:(0,Ze.Z)(e.attachment.uploaded_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("%(filetype)s, %(size)s, uploaded by %(uploader)s %(uploaded_on)s.")),{filetype:e.attachment.filetype,size:(0,yt.Z)(e.attachment.size),uploader:t,uploaded_on:n},!0);return(0,o.Z)("p",{className:"post-attachment-description",dangerouslySetInnerHTML:{__html:a}})}function wt(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&e.attachments}(e.post)?(0,o.Z)("div",{className:"post-attachments"},void 0,(0,gt.Z)(e.post.attachments,2).map((function(e){var t=e.map((function(e){return e?e.id:0})).join("_");return(0,o.Z)(Rt,{row:e},t)}))):null}function Rt(e){return(0,o.Z)("div",{className:"row"},void 0,e.row.map((function(e){return(0,o.Z)(bt,{attachment:e},e?e.id:0)})))}var Ct,St,Et,Pt,Lt,Tt,Ot,At=n(69092);function Bt(e){return e.post.is_hidden&&!e.post.acl.can_see_hidden?f().createElement(Dt,e):e.post.content?f().createElement(It,e):f().createElement(jt,e)}function It(e){var t=e.post,n="@"+(t.poster?t.poster.username:t.poster_name);return(0,o.Z)(mt,{className:"post-body",post:t},void 0,(0,o.Z)(At.Z,{author:n,markup:t.content}))}function Dt(e){var t;t=e.post.hidden_by?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr class="last-title" title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("Hidden by %(hidden_by)s %(hidden_on)s.")),{hidden_by:t,hidden_on:n},!0);return(0,o.Z)(mt,{className:"post-body post-body-hidden",post:e.post},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("This post is hidden. You cannot see its contents.")),(0,o.Z)("p",{className:"text-muted",dangerouslySetInnerHTML:{__html:a}}))}function jt(e){return(0,o.Z)(mt,{className:"post-body post-body-invalid",post:e.post},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("This post's contents cannot be displayed.")),(0,o.Z)("p",{className:"text-muted"},void 0,gettext("This error is caused by invalid post content manipulation.")))}function zt(e){var t=e.post,n=e.thread,a=e.user;if(!Ht(t)||t.id!==n.best_answer)return null;var i;return i=a.id&&n.best_answer_marked_by===a.id?interpolate(gettext("Marked as best answer by you %(marked_on)s."),{marked_on:n.best_answer_marked_on.fromNow()},!0):interpolate(gettext("Marked as best answer by %(marked_by)s %(marked_on)s."),{marked_by:n.best_answer_marked_by_name,marked_on:n.best_answer_marked_on.fromNow()},!0),(0,o.Z)("div",{className:"post-status-message post-status-best-answer"},void 0,Ct||(Ct=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),(0,o.Z)("p",{},void 0,i))}function Ut(e){return Ht(e.post)&&e.post.is_hidden?(0,o.Z)("div",{className:"post-status-message post-status-hidden"},void 0,St||(St=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),(0,o.Z)("p",{},void 0,gettext("This post is hidden. Only users with permission may see its contents."))):null}function Mt(e){return Ht(e.post)&&e.post.is_unapproved?(0,o.Z)("div",{className:"post-status-message post-status-unapproved"},void 0,Et||(Et=(0,o.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline")),(0,o.Z)("p",{},void 0,gettext("This post is unapproved. Only users with permission to approve posts and its author may see its contents."))):null}function qt(e){return Ht(e.post)&&e.post.is_protected?(0,o.Z)("div",{className:"post-status-message post-status-protected visible-xs-block"},void 0,Pt||(Pt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),(0,o.Z)("p",{},void 0,gettext("This post is protected. Only moderators may change it."))):null}function Ht(e){return!e.is_hidden||e.acl.can_see_hidden}function Ft(e){x.Z.dispatch(Ge.r$(e.post,{is_unapproved:!1})),Kt(e,[{op:"replace",path:"is-unapproved",value:!1}],{is_unapproved:e.post.is_unapproved})}function Yt(e){x.Z.dispatch(Ge.r$(e.post,{is_protected:!0})),Kt(e,[{op:"replace",path:"is-protected",value:!0}],{is_protected:e.post.is_protected})}function Vt(e){x.Z.dispatch(Ge.r$(e.post,{is_protected:!1})),Kt(e,[{op:"replace",path:"is-protected",value:!1}],{is_protected:e.post.is_protected})}function Gt(e){x.Z.dispatch(Ge.r$(e.post,{is_hidden:!0,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(e.post.url,{hidden_by:e.user.url})})),Kt(e,[{op:"replace",path:"is-hidden",value:!0}],{is_hidden:e.post.is_hidden,hidden_on:e.post.hidden_on,hidden_by_name:e.post.hidden_by_name,url:e.post.url})}function $t(e){x.Z.dispatch(Ge.r$(e.post,{is_hidden:!1})),Kt(e,[{op:"replace",path:"is-hidden",value:!1}],{is_hidden:e.post.is_hidden})}function Wt(e){var t=e.post.last_likes||[],n=[e.user].concat(t),a=n.length>3?n.slice(0,-1):n;x.Z.dispatch(Ge.r$(e.post,{is_liked:!0,likes:e.post.likes+1,last_likes:a})),Kt(e,[{op:"replace",path:"is-liked",value:!0}],{is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes})}function Qt(e){x.Z.dispatch(Ge.r$(e.post,{is_liked:!1,likes:e.post.likes-1,last_likes:e.post.last_likes.filter((function(t){return!t.id||t.id!==e.user.id}))}));var t={is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes};Kt(e,[{op:"replace",path:"is-liked",value:!1}],t)}function Kt(e,t,n){_.Z.patch(e.post.api.index,t).then((function(t){x.Z.dispatch(Ge.r$(e.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.post,n))}))}function Jt(e){window.confirm(gettext("Are you sure you want to delete this post? This action is not reversible!"))&&(x.Z.dispatch(Ge.r$(e.post,{isDeleted:!0})),_.Z.delete(e.post.api.index).then((function(){k.Z.success(gettext("Post has been deleted."))}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.post,{isDeleted:!1}))})))}function Xt(e){var t=e.post,n=e.user;x.Z.dispatch(b.Vx({best_answer:t.id,best_answer_is_protected:t.is_protected,best_answer_marked_on:H()(),best_answer_marked_by:n.id,best_answer_marked_by_name:n.username,best_answer_marked_by_slug:n.slug})),tn(e,[{op:"replace",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function en(e){var t=e.post;x.Z.dispatch(b.Vx({best_answer:null,best_answer_is_protected:!1,best_answer_marked_on:null,best_answer_marked_by:null,best_answer_marked_by_name:null,best_answer_marked_by_slug:null})),tn(e,[{op:"remove",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function tn(e,t,n){_.Z.patch(e.thread.api.index,t).then((function(e){e.best_answer_marked_on&&(e.best_answer_marked_on=H()(e.best_answer_marked_on)),x.Z.dispatch(b.Vx(e))}),(function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e),x.Z.dispatch(b.Vx(n))}))}var nn,an,sn,on,rn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isReady:!1,error:null,likes:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(this.props.post.api.likes).then((function(t){e.setState({isReady:!0,likes:t.map(ln)})}),(function(t){e.setState({isReady:!0,error:t.detail})}))}},{key:"render",value:function(){return this.state.error?(0,o.Z)(cn,{className:"modal-message"},void 0,(0,o.Z)(J.Z,{message:this.state.error})):this.state.isReady?this.state.likes.length?(0,o.Z)(cn,{className:"modal-sm",likes:this.state.likes},void 0,(0,o.Z)(un,{likes:this.state.likes})):(0,o.Z)(cn,{className:"modal-message"},void 0,(0,o.Z)(J.Z,{message:gettext("No users have liked this post.")})):Lt||(Lt=(0,o.Z)(cn,{className:"modal-sm"},void 0,(0,o.Z)(X.Z,{})))}}]),i}(f().Component);function ln(e){return Object.assign({},e,{liked_on:H()(e.liked_on)})}function cn(e){var t=e.className,n=e.children,a=e.likes,i=gettext("Post Likes");if(a){var s=a.length,r=ngettext("%(likes)s like","%(likes)s likes",s);i=interpolate(r,{likes:s},!0)}return(0,o.Z)("div",{className:"modal-dialog "+(t||""),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Tt||(Tt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,i)),n))}function un(e){return(0,o.Z)("div",{className:"modal-body modal-post-likers"},void 0,(0,o.Z)("ul",{className:"media-list"},void 0,e.likes.map((function(e){return f().createElement(dn,(0,m.Z)({key:e.id},e))}))))}function dn(e){if(e.url){var t={id:e.liker_id,avatars:e.avatars};return(0,o.Z)("li",{className:"media"},void 0,(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("a",{className:"user-avatar",href:e.url},void 0,(0,o.Z)(B.ZP,{size:"50",user:t}))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,o.Z)(pn,{likedOn:e.liked_on})))}return(0,o.Z)("li",{className:"media"},void 0,Ot||(Ot=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{className:"user-avatar"},void 0,(0,o.Z)(B.ZP,{size:"50"})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("strong",{},void 0,e.username)," ",(0,o.Z)(pn,{likedOn:e.liked_on})))}function pn(e){return(0,o.Z)("span",{className:"text-muted",title:e.likedOn.format("LLL")},void 0,e.likedOn.fromNow())}function hn(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function vn(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&(e.acl.can_reply||e.acl.can_edit||e.acl.can_see_likes&&(e.last_likes||[]).length||e.acl.can_like)}(e.post)?(0,o.Z)("div",{className:"post-footer"},void 0,f().createElement(fn,e),f().createElement(mn,e),f().createElement(Zn,e),f().createElement(gn,(0,m.Z)({lastLikes:e.post.last_likes,likes:e.post.likes},e)),f().createElement(yn,(0,m.Z)({likes:e.post.likes},e)),f().createElement(kn,e),f().createElement(xn,e)):null}var fn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,nn||(nn=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Best answer")):null}}]),n}(f().Component),mn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("button",{className:"visible-xs-inline-block btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,an||(an=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box"))):null}}]),n}(f().Component),Zn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.is_liked?Qt(e.props):Wt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){if(!this.props.post.acl.can_like)return null;var e="btn btn-default btn-sm pull-left";return this.props.post.is_liked&&(e="btn btn-success btn-sm pull-left"),(0,o.Z)("button",{className:e,disabled:this.props.post.isBusy,onClick:this.onClick,type:"button"},void 0,this.props.post.is_liked?gettext("Liked"):gettext("Like"))}}]),n}(f().Component),gn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(rn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,o.Z)("button",{className:"btn btn-link btn-sm pull-left hidden-xs",onClick:this.onClick,type:"button"},void 0,bn(this.props.likes,this.props.lastLikes)):(0,o.Z)("p",{className:"pull-left hidden-xs"},void 0,bn(this.props.likes,this.props.lastLikes)):null}}]),n}(f().Component),yn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,o.Z)("button",{className:"btn btn-link btn-sm likes-compact pull-left visible-xs-block",onClick:this.onClick,type:"button"},void 0,sn||(sn=(0,o.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):(0,o.Z)("p",{className:"likes-compact pull-left visible-xs-block"},void 0,on||(on=(0,o.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):null}}]),n}(gn);function bn(e,t){var n=t.slice(0,3).map((function(e){return e.username}));if(1==n.length)return interpolate(gettext("%(user)s likes this."),{user:n[0]},!0);var a=e-n.length,i=n.slice(0,-1).join(", "),s=n.slice(-1)[0],o=interpolate(gettext("%(users)s and %(last_user)s"),{users:i,last_user:s},!0);if(0===a)return interpolate(gettext("%(users)s like this."),{users:o},!0);var r=ngettext("%(users)s and %(likes)s other user like this.","%(users)s and %(likes)s other users like this.",a);return interpolate(r,{users:n.join(", "),likes:a},!0)}var _n,Nn,kn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"REPLY",thread:e.props.thread,config:e.props.thread.api.editor,submit:e.props.thread.api.posts.index,context:{reply:e.props.post.id}})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,o.Z)("button",{className:"btn btn-primary btn-sm pull-right",type:"button",onClick:this.onClick},void 0,gettext("Reply")):null}}]),n}(f().Component),xn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,o.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,gettext("Edit")):null}}]),n}(f().Component);var wn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){x.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),N.Z.hide(),k.Z.success(gettext("Selected post was moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,_n||(_n=(0,o.Z)(Rn,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to move post to")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,gettext("Move post"))))))}}]),i}(Z.Z);function Rn(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Nn||(Nn=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move post")))}function Cn(e){return(0,o.Z)("div",{className:"modal-body post-changelog-diff"},void 0,(0,o.Z)("ul",{className:"list-unstyled"},void 0,e.diff.map((function(e,t){return(0,o.Z)(Sn,{item:e},t)}))))}function Sn(e){return"?"===e.item[0]?null:(0,o.Z)("li",{className:(t=e.item,n="diff-item","-"===t[0]?n+=" diff-item-sub":"+"===t[0]&&(n+=" diff-item-add"),n)},void 0,e.item.substr(2));var t,n}var En,Pn,Ln,Tn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.canRevert?(0,o.Z)("div",{className:"modal-footer visible-xs-block"},void 0,(0,o.Z)(Ae.Z,{className:"btn-default btn-sm btn-block",disabled:this.props.disabled,onClick:this.onClick,title:gettext("Revert post to state from before this edit.")},void 0,gettext("Revert"))):null}}]),i}(f().Component);var On,An,Bn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"goLast",(function(){e.props.goToEdit()})),(0,h.Z)((0,c.Z)(e),"goForward",(function(){e.props.goToEdit(e.props.edit.next)})),(0,h.Z)((0,c.Z)(e),"goBack",(function(){e.props.goToEdit(e.props.edit.previous)})),(0,h.Z)((0,c.Z)(e),"revertEdit",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-toolbar post-changelog-toolbar"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-sm-4"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(In,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goBack})),(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(Dn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goForward})),(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(jn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goLast})))),(0,o.Z)("div",{className:"col-xs-12 col-sm-5 xs-margin-top-half post-change-label"},void 0,(0,o.Z)(Un,{edit:this.props.edit})),(0,o.Z)(zn,{canRevert:this.props.canRevert,disabled:this.props.disabled,onClick:this.revertEdit})))}}]),i}(f().Component);function In(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.previous,onClick:e.onClick,title:gettext("See previous change")},void 0,En||(En=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left")))}function Dn(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:gettext("See next change")},void 0,Pn||(Pn=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function jn(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:gettext("See previous change")},void 0,Ln||(Ln=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page")))}function zn(e){return e.canRevert?(0,o.Z)("div",{className:"col-sm-3 hidden-xs"},void 0,(0,o.Z)(Ae.Z,{className:"btn-default btn-sm btn-block",disabled:e.disabled,onClick:e.onClick,title:gettext("Revert post to state from before this edit.")},void 0,gettext("Revert"))):null}function Un(e){var t;t=e.edit.url.editor?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.edit.url.editor),user:(0,Ze.Z)(e.edit.editor_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.edit.editor_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.edit.edited_on.format("LLL")),relative:(0,Ze.Z)(e.edit.edited_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("By %(edited_by)s %(edited_on)s.")),{edited_by:t,edited_on:n},!0);return(0,o.Z)("p",{dangerouslySetInnerHTML:{__html:a}})}function Mn(e){return Object.assign({},e,{edited_on:H()(e.edited_on)})}var qn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"goToEdit",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.setState({isBusy:!0});var n=t.props.post.api.edits;null!==e&&(n+="?edit="+e),_.Z.get(n).then((function(e){t.setState({isReady:!0,isBusy:!1,edit:Mn(e)})}),(function(e){t.setState({isReady:!0,isBusy:!1,error:e.detail})}))})),(0,h.Z)((0,c.Z)(t),"revertEdit",(function(e){if(!t.state.isBusy&&window.confirm(gettext("Are you sure you with to revert this post to the state from before this edit?"))){t.setState({isBusy:!0});var n=t.props.post.api.edits+"?edit="+e;_.Z.post(n).then((function(e){var t=Ge.ZB(e);x.Z.dispatch(Ge.r$(e,t)),k.Z.success(gettext("Post has been reverted to previous state.")),N.Z.hide()}),(function(e){k.Z.apiError(e),t.setState({isBusy:!1})}))}})),t.state={isReady:!1,isBusy:!0,canRevert:e.post.acl.can_edit,error:null,edit:null},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.goToEdit()}},{key:"render",value:function(){return this.state.error?(0,o.Z)(Hn,{className:"modal-dialog modal-message"},void 0,(0,o.Z)(J.Z,{message:this.state.error})):this.state.isReady?(0,o.Z)(Hn,{},void 0,(0,o.Z)(Bn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,goToEdit:this.goToEdit,revertEdit:this.revertEdit}),(0,o.Z)(Cn,{diff:this.state.edit.diff}),(0,o.Z)(Tn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,revertEdit:this.revertEdit})):On||(On=(0,o.Z)(Hn,{},void 0,(0,o.Z)(X.Z,{})))}}]),i}(f().Component);function Hn(e){return(0,o.Z)("div",{className:e.className||"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,An||(An=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Post edits history"))),e.children))}var Fn,Yn,Vn,Gn,$n,Wn,Qn=n(57026),Kn=n(60471),Jn=n(55210);function Xn(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ea(e){return f().createElement(va,(0,m.Z)({},e,{Form:fa}))}var ta,na,aa,ia,sa,oa,ra,la,ca,ua,da,pa,ha,va=function(e){(0,u.Z)(n,e);var t=Xn(n);function n(e){var a;return(0,r.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,o.Z)(Za,{message:this.state.isError}):this.state.isLoaded?f().createElement(fa,(0,m.Z)({},this.props,{categories:this.state.categories})):Fn||(Fn=(0,o.Z)(ma,{}))}}]),n}(f().Component),fa=function(e){(0,u.Z)(n,e);var t=Xn(n);function n(e){var a;return(0,r.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Jn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){x.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),N.Z.hide(),k.Z.success(gettext("Selected post was split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),k.Z.error(gettext("Form contains errors."))):k.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,o.Z)(g.Z,{label:gettext("Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,o.Z)(g.Z,{label:gettext("Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,o.Z)(g.Z,{label:gettext("Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,o.Z)(ga,{className:"modal-dialog"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{label:gettext("Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,o.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Yn||(Yn=(0,o.Z)("div",{className:"clearfix"})),(0,o.Z)(g.Z,{label:gettext("Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,o.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),Vn||(Vn=(0,o.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Split post")))))}}]),n}(Z.Z);function ma(){return Gn||(Gn=(0,o.Z)(ga,{className:"modal-dialog"},void 0,(0,o.Z)(X.Z,{})))}function Za(e){return(0,o.Z)(ga,{className:"modal-dialog modal-message"},void 0,$n||($n=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move this post at the moment.")),(0,o.Z)("p",{},void 0,e.message)))}function ga(e){return(0,o.Z)("div",{className:e.className,role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Wn||(Wn=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Split post into new thread"))),e.children))}function ya(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ba(e){return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,f().createElement(Na,e),f().createElement(ka,e),f().createElement(xa,e),f().createElement(wa,e),f().createElement(Ra,e),f().createElement(Ca,e),f().createElement(Sa,e),f().createElement(Ea,e),f().createElement(Pa,e),f().createElement(La,e),f().createElement(Ta,e),f().createElement(Oa,e),f().createElement(Aa,e))}var _a,Na=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){var t=window.location.protocol+"//";t+=window.location.host,t+=e.props.post.url.index,prompt(gettext("Permament link to this post:"),t)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ta||(ta=(0,o.Z)("span",{className:"material-icon"},void 0,"link")),gettext("Permament link")))}}]),n}(f().Component),ka=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,na||(na=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Edit"))):null}}]),n}(f().Component),xa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?t.id===n.best_answer||n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,aa||(aa=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Mark as best answer"))):null}}]),n}(f().Component),wa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){en(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id!==n.best_answer?null:n.acl.can_unmark_best_answer?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ia||(ia=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),gettext("Unmark best answer"))):null}}]),n}(f().Component),Ra=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(qn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits);return interpolate(n,{edits:this.props.post.edits},!0),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,sa||(sa=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Changes history")))}}]),n}(f().Component),Ca=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ft(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_approve&&this.props.post.is_unapproved?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,oa||(oa=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))):null}}]),n}(f().Component),Sa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(wn,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ra||(ra=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))):null}}]),n}(f().Component),Ea=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(ea,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,la||(la=(0,o.Z)("span",{className:"material-icon"},void 0,"call_split")),gettext("Split"))):null}}]),n}(f().Component),Pa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Yt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect?this.props.post.is_protected?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ca||(ca=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Protect"))):null}}]),n}(f().Component),La=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Vt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect&&this.props.post.is_protected?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ua||(ua=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Remove protection"))):null}}]),n}(f().Component),Ta=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Gt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_hide?t.is_hidden?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,da||(da=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))):null}}]),n}(f().Component),Oa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){$t(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_unhide&&this.props.post.is_hidden?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pa||(pa=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))):null}}]),n}(f().Component),Aa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Jt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_delete?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ha||(ha=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))):null}}]),n}(f().Component);function Ba(e){return(0,o.Z)("div",{className:"pull-right dropdown"},void 0,_a||(_a=(0,o.Z)("button",{"aria-expanded":"true","aria-haspopup":"true",className:"btn btn-default btn-icon dropdown-toggle","data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"expand_more"))),f().createElement(ba,e))}var Ia=n(21981);var Da,ja=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.isSelected?x.Z.dispatch(Ia._H(e.props.post)):x.Z.dispatch(Ia.Ys(e.props.post))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_merge_posts||(e=this.props.post.acl).can_approve||e.can_hide||e.can_protect||e.can_unhide||e.can_delete||e.can_move?(0,o.Z)("div",{className:"pull-right"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-icon",onClick:this.onClick,type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.props.post.isSelected?"check_box":"check_box_outline_blank"))):null;var e}}]),i}(f().Component),za=n(24678);function Ua(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ma(e){return(0,o.Z)("div",{className:"post-heading"},void 0,f().createElement(qa,e),f().createElement(Ha,e),f().createElement(Fa,e),f().createElement(Ya,e),f().createElement($a,e),f().createElement(Wa,e),f().createElement(Qa,e),f().createElement(ja,e),f().createElement(Ba,e))}function qa(e){return e.post.is_read?null:(0,o.Z)("span",{className:"label label-unread hidden-xs"},void 0,gettext("New post"))}function Ha(e){return e.post.is_read?null:(0,o.Z)("span",{className:"label label-unread visible-xs-inline-block"},void 0,gettext("New"))}function Fa(e){var t=interpolate(gettext("posted %(posted_on)s"),{posted_on:e.post.posted_on.format("LL, LT")},!0);return(0,o.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on hidden-xs",title:t},void 0,e.post.posted_on.fromNow())}function Ya(e){return(0,o.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on visible-xs-inline-block"},void 0,e.post.posted_on.fromNow())}var Va,Ga,$a=function(e){(0,u.Z)(n,e);var t=Ua(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(qn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits),a=interpolate(n,{edits:this.props.post.edits},!0),i=ngettext("edited %(edits)s time","edited %(edits)s times",this.props.post.edits);return(0,o.Z)("button",{className:"btn btn-link btn-see-edits hidden-xs",onClick:this.onClick,title:a,type:"button"},void 0,interpolate(i,{edits:this.props.post.edits},!0))}}]),n}(f().Component),Wa=function(e){(0,u.Z)(n,e);var t=Ua(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("%(edits)s edit","%(edits)s edits",this.props.post.edits);return(0,o.Z)("button",{className:"btn btn-link btn-see-edits visible-xs-inline-block",onClick:this.onClick,type:"button"},void 0,interpolate(n,{edits:this.props.post.edits},!0))}}]),n}($a);function Qa(e){var t=e.post.poster&&e.post.poster.id===e.user.id,n=e.post.acl.can_protect;return e.user.id&&e.post.is_protected&&(t||n)?(0,o.Z)("span",{className:"label label-protected hidden-xs",title:gettext("This post is protected and may not be edited.")},void 0,Da||(Da=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("protected")):null}function Ka(e){var t=e.post,n=e.thread;return(0,o.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,o.Z)(ja,{post:t,thread:n}),(0,o.Z)(Ba,{post:t,thread:n}),(0,o.Z)("div",{className:"media"},void 0,Va||(Va=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:100})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("span",{className:"media-heading item-title"},void 0,t.poster_name),(0,o.Z)("span",{className:"user-title user-title-anonymous"},void 0,gettext("Removed user")))))}function Ja(e){var t=e.title,n=e.rank;return n.is_tab||!!t||!!n.title}function Xa(e){var t=e.poster,n=ngettext("%(posts)s post","%(posts)s posts",t.posts),a="user-postcount";return Ja(t)&&(a+=" hidden-xs hidden-sm"),(0,o.Z)("span",{className:a},void 0,interpolate(n,{posts:t.posts},!0))}function ei(e){var t=e.poster,n="hidden-xs";return Ja(t)&&(n+=" hidden-sm"),(0,o.Z)("span",{className:n},void 0,(0,o.Z)(za.ZP,{status:t.status},void 0,(0,o.Z)(za.pg,{status:t.status,user:t})))}function ti(e){var t=e.rank,n=e.title||t.title;if(!n&&t.is_tab&&(n=t.name),!n)return null;var a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,o.Z)("div",{className:a},void 0,(0,o.Z)("a",{href:t.url},void 0,n)):(0,o.Z)("div",{className:a},void 0,n)}function ni(e){var t=e.post,n=e.thread,a=t.poster;return(0,o.Z)("div",{className:"post-side post-side-registered"},void 0,(0,o.Z)(ja,{post:t,thread:n}),(0,o.Z)(Ba,{post:t,thread:n}),(0,o.Z)("div",{className:"media"},void 0,(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("a",{href:a.url},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:100,user:a}))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("div",{className:"media-heading"},void 0,(0,o.Z)("a",{className:"item-title",href:a.url},void 0,a.username),(0,o.Z)(za.ZP,{status:a.status},void 0,(0,o.Z)(za.Jj,{status:a.status}))),(0,o.Z)(ti,{rank:a.rank,title:a.title}),(0,o.Z)(ei,{poster:a}),(0,o.Z)(Xa,{poster:a}))))}function ai(e){return e.post.poster?f().createElement(ni,e):f().createElement(Ka,e)}function ii(e){var t="post";return e.post.isDeleted?t="hide":e.post.is_hidden&&!e.post.acl.can_see_hidden&&(t="post post-hidden"),e.post.poster&&e.post.poster.rank.css_class&&(t+=" post-"+e.post.poster.rank.css_class),e.post.is_read||(t+=" post-new"),(0,o.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,o.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,f().createElement(ai,e),(0,o.Z)("div",{className:"panel-content"},void 0,f().createElement(Ma,e),f().createElement(zt,e),f().createElement(Mt,e),f().createElement(qt,e),f().createElement(Ut,e),f().createElement(Bt,e),f().createElement(wt,e),f().createElement(vn,e)))))}var si,oi=function(){return(0,o.Z)("li",{className:"post"},void 0,(0,o.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("div",{className:"post-side post-side-registered"},void 0,(0,o.Z)("div",{className:"media"},void 0,Ga||(Ga=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:"100"})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("span",{className:"media-heading item-title"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"80px"}},void 0," ")),(0,o.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"60px"}},void 0," "))))),(0,o.Z)("div",{className:"panel-content"},void 0,(0,o.Z)("div",{className:"post-body"},void 0,(0,o.Z)("article",{className:"misago-markup"},void 0,(0,o.Z)("p",{className:"ui-preview-text",style:{width:"100%"}},void 0," "),(0,o.Z)("p",{className:"ui-preview-text",style:{width:"70%"}},void 0," "),(0,o.Z)("p",{className:"ui-preview-text hidden-xs hidden-sm",style:{width:"85%"}},void 0," ")))))))};function ri(e){return e.posts.isLoaded?(0,o.Z)("ul",{className:"posts-list ui-ready"},void 0,e.posts.results.map((function(t){return f().createElement(li,(0,m.Z)({key:t.id,post:t},e))}))):si||(si=(0,o.Z)("ul",{className:"posts-list ui-preview"},void 0,(0,o.Z)(oi,{})))}function li(e){return e.post.is_event?f().createElement(Zt,e):f().createElement(ii,e)}var ci,ui,di,pi=n(55547),hi=n(53328),vi=n(78107),fi=n(59131),mi=n(98936),Zi=n(50366),gi=n(16768),yi=function(e){var t=e.thread;return(0,o.Z)("div",{className:"thread-user-card"},void 0,(0,o.Z)("div",{className:"thread-user-card-media"},void 0,t.starter?(0,o.Z)("a",{href:t.url.starter},void 0,(0,o.Z)(B.ZP,{size:40,user:t.starter})):ci||(ci=(0,o.Z)(B.ZP,{size:40}))),(0,o.Z)("div",{className:"thread-user-card-body"},void 0,(0,o.Z)("div",{className:"thread-user-card-header"},void 0,t.starter?(0,o.Z)("a",{className:"item-title",href:t.url.starter,title:gettext("Thread author")},void 0,t.starter.username):(0,o.Z)("span",{className:"item-title",title:gettext("Thread author")},void 0,t.starter_name)),(0,o.Z)("div",{},void 0,(0,o.Z)("span",{className:"text-muted",title:interpolate(gettext("Started on: %(timestamp)s"),{timestamp:t.started_on.format("LLL")},!0)},void 0,t.started_on.fromNow()))))},bi=n(99755),_i=n(12891);var Ni=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0}),N.Z.hide()})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){x.Z.dispatch(b.Ar()),x.Z.dispatch(b.Vx(e))})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){x.Z.dispatch(b.Ar()),400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onChange",(function(e){t.changeValue("title",e.target.value)})),t.state={isLoading:!1,title:e.thread.title,validators:{title:(0,_i.jn)()},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){if(!this.state.title.trim().length)return k.Z.error(gettext("You have to enter thread title.")),!1;var e=this.validate();return!e.title||(k.Z.error(e.title[0]),!1)}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.patch(this.props.thread.api.index,[{op:"replace",path:"title",value:this.state.title}])}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,ui||(ui=(0,o.Z)(ki,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_modal_title",label:gettext("Thread title")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_modal_title",onChange:this.onChange,value:this.state.title}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Change title"))))))}}]),i}(Z.Z);function ki(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,di||(di=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Change title")))}var xi,wi,Ri=n(52753);var Ci,Si,Ei,Pi,Li,Ti,Oi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0})})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){k.Z.success(gettext("Thread has been merged with other one.")),window.location=e.url})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){x.Z.dispatch(b.Ar()),400===e.status?e.best_answers||e.polls?N.Z.show((0,o.Z)(Ri.ZP,{api:t.props.thread.api.merge,bestAnswers:e.best_answers,data:{other_thread:t.state.url},polls:e.polls,onError:t.handleError,onSuccess:t.handleSuccessUnmounted})):e.best_answer?k.Z.error(e.best_answer[0]):e.poll?k.Z.error(e.poll[0]):k.Z.error(e.detail):k.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.post(this.props.thread.api.merge,{other_thread:this.state.url})}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,xi||(xi=(0,o.Z)(Ai,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to merge with"),help_text:gettext("Merge will delete current thread and move its contents to the thread specified here.")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Merge thread"))))))}}]),i}(Z.Z);function Ai(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,wi||(wi=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Merge thread")))}var Bi,Ii,Di,ji,zi,Ui,Mi,qi,Hi,Fi,Yi,Vi,Gi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){t.changeValue("category",e.target.value)})),t.state={isReady:!1,isLoading:!1,isError:!1,category:null,categories:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(E.Z.get("THREAD_EDITOR_API")).then((function(t){var n=null,a=t.map((function(e){return!1===e.post||n||(n=e.id),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));e.setState({isReady:!0,category:n,categories:a})}),(function(t){e.setState({isError:t.detail})}))}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.patch(this.props.thread.api.index,[{op:"replace",path:"category",value:this.state.category}])}},{key:"handleSuccess",value:function(){_.Z.get(this.props.thread.api.posts.index,{page:this.props.posts.page}).then((function(e){x.Z.dispatch(b.gx(e)),x.Z.dispatch(Ia.zD(e.post_set)),x.Z.dispatch(b.Ar()),k.Z.success(gettext("Thread has been moved.")),N.Z.hide()}),(function(e){x.Z.dispatch(b.Ar()),k.Z.apiError(e)}))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)}},{key:"render",value:function(){return this.state.isReady?(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,Ci||(Ci=(0,o.Z)($i,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_category",label:gettext("New category")},void 0,(0,o.Z)(Qn.Z,{choices:this.state.categories,disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_category",onChange:this.onCategoryChange,value:this.state.category}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Move thread")))))):this.state.isError?(0,o.Z)(Qi,{message:this.state.isError}):Si||(Si=(0,o.Z)(Wi,{}))}}]),i}(Z.Z);function $i(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ei||(Ei=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move thread")))}function Wi(e){return Pi||(Pi=(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)($i,{}),(0,o.Z)(X.Z,{}))))}function Qi(e){return(0,o.Z)("div",{className:"modal-dialog modal-message",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,Li||(Li=(0,o.Z)($i,{})),Ti||(Ti=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move this thread at the moment.")),(0,o.Z)("p",{},void 0,e.message),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok")))))}var Ki,Ji,Xi,es,ts=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"callApi",(function(t,n){x.Z.dispatch(b.n6()),t.push({op:"add",path:"acl",value:!0}),_.Z.patch(e.props.thread.api.index,t).then((function(e){x.Z.dispatch(b.Vx(e)),x.Z.dispatch(b.Ar()),k.Z.success(n)}),(function(e){x.Z.dispatch(b.Ar()),400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)}))})),(0,h.Z)((0,c.Z)(e),"changeTitle",(function(){N.Z.show((0,o.Z)(Ni,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"pinGlobally",(function(){e.callApi([{op:"replace",path:"weight",value:2}],gettext("Thread has been pinned globally."))})),(0,h.Z)((0,c.Z)(e),"pinLocally",(function(){e.callApi([{op:"replace",path:"weight",value:1}],gettext("Thread has been pinned locally."))})),(0,h.Z)((0,c.Z)(e),"unpin",(function(){e.callApi([{op:"replace",path:"weight",value:0}],gettext("Thread has been unpinned."))})),(0,h.Z)((0,c.Z)(e),"approve",(function(){e.callApi([{op:"replace",path:"is-unapproved",value:!1}],gettext("Thread has been approved."))})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Thread has been opened."))})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.callApi([{op:"replace",path:"is-closed",value:!0}],gettext("Thread has been closed."))})),(0,h.Z)((0,c.Z)(e),"unhide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!1}],gettext("Thread has been made visible."))})),(0,h.Z)((0,c.Z)(e),"hide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!0}],gettext("Thread has been made hidden."))})),(0,h.Z)((0,c.Z)(e),"move",(function(){N.Z.show((0,o.Z)(Gi,{posts:e.props.posts,thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"merge",(function(){N.Z.show((0,o.Z)(Oi,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"delete",(function(){window.confirm(gettext("Are you sure you want to delete this thread?"))&&(x.Z.dispatch(b.n6()),_.Z.delete(e.props.thread.api.index).then((function(t){k.Z.success(gettext("Thread has been deleted.")),window.location=e.props.thread.category.url.index}),(function(e){x.Z.dispatch(b.Ar()),k.Z.apiError(e)})))})),e}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.moderation;return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,!!e.edit&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.changeTitle,type:"button"},void 0,Bi||(Bi=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Change title"))),!!e.pinGlobally&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.pinGlobally,type:"button"},void 0,Ii||(Ii=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark")),gettext("Pin globally"))),!!e.pinLocally&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.pinLocally,type:"button"},void 0,Di||(Di=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),gettext("Pin locally"))),!!e.unpin&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.unpin,type:"button"},void 0,ji||(ji=(0,o.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),gettext("Unpin"))),!!e.move&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.move,type:"button"},void 0,zi||(zi=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))),!!e.merge&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.merge,type:"button"},void 0,Ui||(Ui=(0,o.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge"))),!!e.approve&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.approve,type:"button"},void 0,Mi||(Mi=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))),!!e.open&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.open,type:"button"},void 0,qi||(qi=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Open"))),!!e.close&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.close,type:"button"},void 0,Hi||(Hi=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Close"))),!!e.unhide&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.unhide,type:"button"},void 0,Fi||(Fi=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))),!!e.hide&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.hide,type:"button"},void 0,Yi||(Yi=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))),!!e.delete&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.delete,type:"button"},void 0,Vi||(Vi=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))))}}]),i}(f().Component),ns=ts,as=function(e){var t=e.thread,n=e.posts,a=e.moderation;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Thread options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t.isBusy},void 0,Ki||(Ki=(0,o.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,o.Z)(ns,{thread:t,posts:n,moderation:a}))},is=n(94184),ss=n.n(is);function os(e,t,n){var a={subscription:e.subscription};x.Z.dispatch(b.Vx({subscription:t})),_.Z.patch(e.api.index,[{op:"replace",path:"subscription",value:n}]).then((function(e){x.Z.dispatch(b.Vx(e))}),(function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e),x.Z.dispatch(b.Vx(a))}))}var rs,ls,cs,us,ds,ps,hs,vs,fs,ms,Zs,gs,ys,bs=function(e){var t,n=e.stickToBottom,a=e.thread;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-block","aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,!0===(t=a.subscription)?"star":!1===t?"star_half":"star_border"),function(e){return!0===e?gettext("E-mail"):!1===e?gettext("Enabled"):gettext("Disabled")}(a.subscription)),(0,o.Z)("ul",{className:ss()("dropdown-menu dropdown-menu-right",{"stick-to-bottom":n})},void 0,(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){null!==e.subscription&&os(e,null,"unsubscribe")}(a)}},void 0,Ji||(Ji=(0,o.Z)("span",{className:"material-icon"},void 0,"star_border")),gettext("Unsubscribe"))),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){!1!==e.subscription&&os(e,!1,"notify")}(a)}},void 0,Xi||(Xi=(0,o.Z)("span",{className:"material-icon"},void 0,"star_half")),gettext("Subscribe"))),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){!0!==e.subscription&&os(e,!0,"email")}(a)}},void 0,es||(es=(0,o.Z)("span",{className:"material-icon"},void 0,"star")),gettext("Subscribe with e-mail")))))},_s=function(e){var t=e.children,n=e.className;return(0,o.Z)("ul",{className:ss()("breadcrumbs",n)},void 0,t)},Ns=function(e){var t=e.category,n=e.className;return(0,o.Z)("li",{className:ss()("breadcrumbs-item",n)},void 0,(0,o.Z)("a",{href:t.url.index},void 0,(0,o.Z)("span",{className:"material-icon",style:{color:t.color||"inherit"}},void 0,"label"),!!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name hidden-sm hidden-md hidden-lg",title:t.name},void 0,t.short_name),!!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name hidden-xs"},void 0,t.name),!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name"},void 0,t.name)))},ks=function(e){var t=e.category,n=e.className;return(0,o.Z)("li",{className:ss()("breadcrumbs-item",n)},void 0,(0,o.Z)("a",{href:t.url.index},void 0,rs||(rs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right")),(0,o.Z)("span",{className:"breadcrumbs-item-name"},void 0,"root_category"===t.special_role?gettext("Threads"):gettext("Private threads"))))},xs=function(e){var t=e.breadcrumbs;return(0,o.Z)(_s,{},void 0,t.map((function(e){return e.special_role?(0,o.Z)(ks,{category:e},e.id):(0,o.Z)(Ns,{category:e},e.id)})))},ws=function(e){var t=e.styleName,n=e.thread,a=e.posts,i=e.user,s=e.moderation;return(0,o.Z)(bi.sP,{},void 0,(0,o.Z)(bi.mr,{styleName:t},void 0,(0,o.Z)(bi.gC,{styleName:t},void 0,(0,o.Z)(xs,{breadcrumbs:n.path}),(0,o.Z)("h1",{},void 0,n.title)),(0,o.Z)(bi.eA,{className:"page-header-thread-details"},void 0,(0,o.Z)(mi.gq,{},void 0,(0,o.Z)(mi.kw,{auto:!0},void 0,(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(yi,{thread:n})),ls||(ls=(0,o.Z)(mi.Z6,{auto:!0})),n.replies>0&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(gi.Z,{thread:n})),function(e){return e.is_closed||e.is_hidden||e.is_unapproved||e.weight>0||e.best_answer||e.has_poll||e.has_unapproved_posts}(n)&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(Zi.Z,{thread:n}))),i.is_authenticated&&(0,o.Z)(mi.kw,{},void 0,(0,o.Z)(mi.Z6,{},void 0,(0,o.Z)(bs,{thread:n})),s.enabled&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(as,{thread:n,posts:a,moderation:s})))))))},Rs=n(92490),Cs=n(69987),Ss=function(e){var t=e.baseUrl,n=e.posts;return(0,o.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t,title:gettext("Go to first page")},void 0,cs||(cs=(0,o.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to first page"),type:"button",disabled:!0},void 0,us||(us=(0,o.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+(n.previous>1?n.previous+"/":""),title:gettext("Go to previous page")},void 0,ds||(ds=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to previous page"),type:"button",disabled:!0},void 0,ps||(ps=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.next+"/",title:gettext("Go to next page")},void 0,hs||(hs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to next page"),type:"button",disabled:!0},void 0,vs||(vs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.last+"/",title:gettext("Go to last page")},void 0,fs||(fs=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to last page"),type:"button",disabled:!0},void 0,ms||(ms=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page"))))},Es=function(e){var t=e.posts;return t.more?(0,o.Z)("p",{},void 0,interpolate(ngettext("There is %(more)s more post in this thread.","There are %(more)s more posts in this thread.",t.more),{more:t.more},!0)):(0,o.Z)("p",{},void 0,gettext("There are no more posts in this thread."))};function Ps(e){var t=e.errors,n=e.posts;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Zs||(Zs=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Moderation"))),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("One or more posts could not be changed:")),(0,o.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,t.map((function(e){return(0,o.Z)(Ls,{errors:e.detail,post:n[e.id]},e.id)}))))))}function Ls(e){var t=e.errors,n=e.post,a=interpolate(gettext("%(username)s on %(posted_on)s"),{posted_on:n.posted_on.format("LL, LT"),username:n.poster_name},!0);return(0,o.Z)("li",{},void 0,(0,o.Z)("h5",{},void 0,a,":"),t.map((function(e,t){return(0,o.Z)("p",{},t,e)})))}function Ts(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_unapproved:!1}})),a=t.map((function(e){return{id:e.id,is_unapproved:e.is_unapproved}}));Ds(e,[{op:"replace",path:"is-unapproved",value:!1}],n,a)}function Os(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!0}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Ds(e,[{op:"replace",path:"is-protected",value:!0}],n,a)}function As(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!1}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Ds(e,[{op:"replace",path:"is-protected",value:!1}],n,a)}function Bs(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!0,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Ds(e,[{op:"replace",path:"is-hidden",value:!0}],n,a)}function Is(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!1,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Ds(e,[{op:"replace",path:"is-hidden",value:!1}],n,a)}function Ds(e,t,n,a){var i=e.selection,s=e.thread;n.forEach((function(e){Ge.r$(e,e)})),x.Z.dispatch(Ia.kR());var r={ops:t,ids:i.map((function(e){return e.id}))};_.Z.patch(s.api.posts.index,r).then((function(e){e.forEach((function(e){x.Z.dispatch(Ge.r$(e,e))}))}),(function(e){if(400!==e.status)return a.forEach((function(e){x.Z.dispatch(Ge.r$(e,e))})),k.Z.apiError(e);var t=[],n=[];e.forEach((function(e){e.detail?(t.push(e),n.push(e.id)):x.Z.dispatch(Ge.r$(e,e)),a.forEach((function(e){-1!==n.indexOf(e)&&x.Z.dispatch(Ge.r$(e,e))}))}));var s={};i.forEach((function(e){s[e.id]=e})),N.Z.show((0,o.Z)(Ps,{errors:t,posts:s}))}))}function js(e){window.confirm(gettext("Are you sure you want to merge selected posts? This action is not reversible!"))&&(e.selection.slice(1).map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),_.Z.post(e.thread.api.posts.merge,{posts:e.selection.map((function(e){return e.id}))}).then((function(e){x.Z.dispatch(Ge.r$(e,Ge.ZB(e)))}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),e.selection.slice(1).map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),x.Z.dispatch(Ia.kR()))}function zs(e){if(window.confirm(gettext("Are you sure you want to delete selected posts? This action is not reversible!"))){e.selection.map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))}));var t=e.selection.map((function(e){return e.id}));_.Z.delete(e.thread.api.posts.index,t).then((function(){}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),e.selection.map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),x.Z.dispatch(Ia.kR())}}var Us,Ms,qs,Hs,Fs,Ys,Vs=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),N.Z.hide(),k.Z.success(gettext("Selected posts were moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,gs||(gs=(0,o.Z)(Gs,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to move posts to")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,gettext("Move posts"))))))}}]),i}(Z.Z);function Gs(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ys||(ys=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move posts")))}function $s(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ws(e){return f().createElement(so,(0,m.Z)({},e,{Form:oo}))}var Qs,Ks,Js,Xs,eo,to,no,ao,io,so=function(e){(0,u.Z)(n,e);var t=$s(n);function n(e){var a;return(0,r.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,o.Z)(lo,{message:this.state.isError}):this.state.isLoaded?f().createElement(oo,(0,m.Z)({},this.props,{categories:this.state.categories})):Us||(Us=(0,o.Z)(ro,{}))}}]),n}(f().Component),oo=function(e){(0,u.Z)(n,e);var t=$s(n);function n(e){var a;return(0,r.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Jn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),N.Z.hide(),k.Z.success(gettext("Selected posts were split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),k.Z.error(gettext("Form contains errors."))):403===e.status&&Array.isArray(e)?N.Z.show((0,o.Z)(Ps,{errors:e})):k.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,o.Z)(g.Z,{label:gettext("Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,o.Z)(g.Z,{label:gettext("Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,o.Z)(g.Z,{label:gettext("Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,o.Z)(co,{className:"modal-dialog"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{label:gettext("Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,o.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Ms||(Ms=(0,o.Z)("div",{className:"clearfix"})),(0,o.Z)(g.Z,{label:gettext("Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,o.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),qs||(qs=(0,o.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Split posts")))))}}]),n}(Z.Z);function ro(){return Hs||(Hs=(0,o.Z)(co,{className:"modal-dialog"},void 0,(0,o.Z)(X.Z,{})))}function lo(e){return(0,o.Z)(co,{className:"modal-dialog modal-message"},void 0,Fs||(Fs=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move selected posts at the moment.")),(0,o.Z)("p",{},void 0,e.message),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}function co(e){return(0,o.Z)("div",{className:e.className,role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ys||(Ys=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Split posts into new thread"))),e.children))}function uo(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function po(e){return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,f().createElement(ko,e),f().createElement(xo,e),f().createElement(wo,e),f().createElement(Ro,e),f().createElement(Co,e),f().createElement(So,e),f().createElement(Po,e),f().createElement(Eo,e),f().createElement(Lo,e))}var ho,vo,fo,mo,Zo,go,yo,bo,_o,No,ko=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ts(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_approve&&e.is_unapproved}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Qs||(Qs=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))):null}}]),n}(f().Component),xo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){js(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.length>1&&this.props.selection.find((function(e){return e.acl.can_merge}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Ks||(Ks=(0,o.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge"))):null}}]),n}(f().Component),wo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(Vs,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Js||(Js=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))):null}}]),n}(f().Component),Ro=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(Ws,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Xs||(Xs=(0,o.Z)("span",{className:"material-icon"},void 0,"call_split")),gettext("Split"))):null}}]),n}(f().Component),Co=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Os(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return!e.is_protected&&e.acl.can_protect}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,eo||(eo=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Protect"))):null}}]),n}(f().Component),So=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){As(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.is_protected&&e.acl.can_protect}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,to||(to=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Unprotect"))):null}}]),n}(f().Component),Eo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Bs(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_hide&&!e.is_hidden}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,no||(no=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))):null}}]),n}(f().Component),Po=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Is(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_unhide&&e.is_hidden}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,ao||(ao=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))):null}}]),n}(f().Component),Lo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){zs(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_delete}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,io||(io=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))):null}}]),n}(f().Component),To=function(e){var t=e.thread,n=e.user,a=e.selection,i=e.dropup;return(0,o.Z)("div",{className:i?"dropup":"dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Posts options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:0===a.length},void 0,ho||(ho=(0,o.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,o.Z)(po,{thread:t,user:n,selection:a}))},Oo=function(e){var t=e.onClick;return(0,o.Z)("button",{className:"btn btn-primary btn-outline btn-block",type:"button",onClick:t},void 0,vo||(vo=(0,o.Z)("span",{className:"material-icon"},void 0,"chat")),gettext("Reply"))},Ao=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.selection,s=e.moderation,r=e.onReply;return(0,o.Z)(Rs.o8,{},void 0,(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Ss,{baseUrl:t.url.index,posts:n})),s.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:i,dropup:!0}))),(0,o.Z)(Rs.Z2,{className:"hidden-xs hidden-sm",auto:!0},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Es,{posts:n}))),fo||(fo=(0,o.Z)(Rs.tw,{className:"hidden-md hidden-lg"})),a.is_authenticated&&(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(bs,{thread:t})),t.acl.can_reply&&(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Oo,{onClick:r})),s.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:i,dropup:!0}))))},Bo=function(e){var t=e.compact,n=e.disabled,a=e.onClick;return(0,o.Z)("button",{className:ss()("btn btn-default btn-outline",{"btn-block":!t,"btn-icon":t}),type:"button",title:t?gettext("Add poll"):null,disabled:n,onClick:a},void 0,mo||(mo=(0,o.Z)("span",{className:"material-icon"},void 0,"poll")),!t&&gettext("Add poll"))},Io=function(e){var t=e.user,n=e.thread;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Shortcuts"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,Zo||(Zo=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark"))),(0,o.Z)("ul",{className:"dropdown-menu"},void 0,t.is_authenticated&&n.is_new&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.new_post},void 0,go||(go=(0,o.Z)("span",{className:"material-icon"},void 0,"comment")),gettext("Go to new post"))),n.best_answer&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.best_answer},void 0,yo||(yo=(0,o.Z)("span",{className:"material-icon"},void 0,"check_circle")),gettext("Go to best answer"))),n.has_unapproved_posts&&n.acl.can_approve&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.unapproved_post},void 0,bo||(bo=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Go to unapproved post"))),(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.last_post},void 0,_o||(_o=(0,o.Z)("span",{className:"material-icon"},void 0,"reply")),gettext("Go to last post")))))},Do=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.pollDisabled,s=e.selection,r=e.moderation,l=e.onPoll,c=e.onReply;return(0,o.Z)(Rs.o8,{},void 0,(0,o.Z)(Rs.Z2,{className:"hidden-xs"},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Io,{thread:t,user:a})),(0,o.Z)(Rs.Eg,{className:"hidden-xs hidden-sm"},void 0,(0,o.Z)(Ss,{baseUrl:t.url.index,posts:n}))),No||(No=(0,o.Z)(Rs.tw,{})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Z2,{className:"hidden-xs"},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l}))),t.acl.can_reply?(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Io,{thread:t,user:a})),(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Oo,{onClick:c})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l,compact:!0})),r.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:s}))):(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Io,{thread:t,user:a})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l})),r.enabled&&(0,o.Z)(Rs.Eg,{shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:s}))))};var jo=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"update",(function(e){x.Z.dispatch(b.gx(e)),x.Z.dispatch(Ia.zD(e.post_set)),e.participants&&x.Z.dispatch(y.gx(e.participants)),e.poll&&x.Z.dispatch(le.gx(e.poll)),t.setPageTitle()})),(0,h.Z)((0,c.Z)(t),"openPollForm",(function(){t.setState({editPoll:!0})})),(0,h.Z)((0,c.Z)(t),"closePollForm",(function(){t.setState({editPoll:!1})})),(0,h.Z)((0,c.Z)(t),"openReplyForm",(function(){ce.Z.open({mode:"REPLY",thread:t.props.thread,config:t.props.thread.api.editor,submit:t.props.thread.api.posts.index})})),t.state={editPoll:!1},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.shouldFetchData()&&(this.fetchData(),this.setPageTitle()),this.startPollingApi()}},{key:"componentDidUpdate",value:function(){this.shouldFetchData()&&(this.fetchData(),this.startPollingApi(),this.setPageTitle())}},{key:"componentWillUnmount",value:function(){this.stopPollingApi()}},{key:"shouldFetchData",value:function(){return!!this.props.posts.isLoaded&&1*(this.props.params.page||1)!=this.props.posts.page}},{key:"fetchData",value:function(){var e=this;x.Z.dispatch(Ia.Rz()),_.Z.get(this.props.thread.api.posts.index,{page:this.props.params.page||1},"posts").then((function(t){e.update(t)}),(function(e){k.Z.apiError(e)}))}},{key:"startPollingApi",value:function(){pi.Z.start({poll:"thread-posts",url:this.props.thread.api.posts.index,data:{page:this.props.params.page||1},update:this.update,frequency:12e4,delayed:!0})}},{key:"stopPollingApi",value:function(){pi.Z.stop("thread-posts")}},{key:"setPageTitle",value:function(){hi.Z.set({title:this.props.thread.title,parent:this.props.thread.category.name,page:1*(this.props.params.page||1)})}},{key:"render",value:function(){var e=this.props.thread.category,t="page page-thread";e.css_class&&(t+=" page-thread-"+e.css_class);var n="private_threads"===e.special_role?"private-threads":e.css_class||"category-threads",a=zo(this.props.thread,this.props.user),i=Uo(this.props.posts.results,this.props.user),s=this.props.posts.results.filter((function(e){return e.isSelected}));return(0,o.Z)("div",{className:t},void 0,(0,o.Z)(ws,{styleName:n,thread:this.props.thread,posts:this.props.posts,user:this.props.user,moderation:a}),(0,o.Z)(fi.Z,{},void 0,(0,o.Z)(z,{participants:this.props.participants,thread:this.props.thread,user:this.props.user}),(0,o.Z)(Do,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:s,moderation:i,pollDisabled:this.state.editPoll,onPoll:this.openPollForm,onReply:this.openReplyForm}),this.state.editPoll?(0,o.Z)(He,{poll:this.props.poll,thread:this.props.thread,close:this.closePollForm}):(0,o.Z)(De,{poll:this.props.poll,thread:this.props.thread,user:this.props.user,edit:this.openPollForm}),this.props.thread.acl.can_reply?(0,o.Z)(vi.mv,{posting:{mode:"REPLY",thread:this.props.thread,config:this.props.thread.api.editor,submit:this.props.thread.api.posts.index}},void 0,f().createElement(ri,this.props)):f().createElement(ri,this.props),(0,o.Z)(Ao,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:s,moderation:i,onReply:this.openReplyForm})))}}]),i}(f().Component),zo=function(e,t){var n={enabled:!1,edit:!1,approve:!1,close:!1,open:!1,hide:!1,unhide:!1,move:!1,merge:!1,pinGlobally:!1,pinLocally:!1,unpin:!1,delete:!1};return t.is_authenticated?(n.edit=e.acl.can_edit,n.approve=e.acl.can_approve&&e.is_unapproved,n.close=e.acl.can_close&&!e.is_closed,n.open=e.acl.can_close&&e.is_closed,n.hide=e.acl.can_hide&&!e.is_hidden,n.unhide=e.acl.can_unhide&&e.is_hidden,n.move=e.acl.can_move,n.merge=e.acl.can_merge,n.pinGlobally=e.acl.can_pin_globally&&e.weight<2,n.pinLocally=e.acl.can_pin&&1!==e.weight,n.unpin=e.acl.can_pin&&1===e.weight||e.acl.can_pin_globally&&2===e.weight,n.delete=e.acl.can_delete,n.enabled=n.edit||n.approve||n.close||n.open||n.hide||n.unhide||n.move||n.merge||n.pinGlobally||n.pinLocally||n.unpin||n.delete,n):n},Uo=function(e,t){var n={enabled:!1,approve:!1,move:!1,merge:!1,protect:!1,hide:!1,delete:!1};return t.is_authenticated?(e.forEach((function(e){e.is_event||(e.acl.can_approve&&e.is_unapproved&&(n.approve=!0),e.acl.can_move&&(n.move=!0),e.acl.can_merge&&(n.merge=!0),(e.acl.can_protect||e.acl.can_unprotect)&&(n.protect=!0),(e.acl.can_hide||e.acl.can_unhide)&&(n.hide=!0),e.acl.can_delete&&(n.delete=!0),(n.approve||n.move||n.merge||n.protect||n.hide||n.delete)&&(n.enabled=!0))})),n):n};function Mo(e){return{participants:e.participants,poll:e.poll,posts:e.posts,thread:e.thread,tick:e.tick.tick,user:e.auth.user}}var qo=n(39633);E.Z.addInitializer({name:"component:thread",initializer:function(e){var t,n;e.has("THREAD")&&e.has("POSTS")&&(0,qo.Z)({paths:(t=E.Z.get("THREAD"),n=t.url.index.replace(t.slug+"-"+t.pk,":slug"),[{path:n,component:(0,s.$j)(Mo)(jo)},{path:n+":page/",component:(0,s.$j)(Mo)(jo)}])})},after:"store"})},72168:function(e,t,n){"use strict";var a=n(37424),i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=n(57588),h=n.n(p),v=n(82211);function f(e,t){return e.last_post>t.last_post?-1:e.last_post<t.last_post?1:0}function m(e,t){return 2===e.weight&&e.weight>t.weight?-1:2===t.weight&&e.weight<t.weight?1:f(e,t)}function Z(e,t){return e.weight>t.weight?-1:e.weight<t.weight?1:f(e,t)}var g,y,b=n(59131),_=n(64646),N=n(92490),k=n(69987),x=function(e){var t=e.allItems,n=e.parentUrl,a=e.category,s=e.categories,o=e.list;return(0,i.Z)("div",{className:"dropdown threads-category-picker"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline dropdown-toggle btn-block text-ellipsis","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a&&(0,i.Z)("span",{className:"material-icon",style:{color:a.color||"inherit"}},void 0,"label"),a&&a.short_name&&(0,i.Z)("span",{className:a.short_name&&"hidden-md hidden-lg"},void 0,a.short_name),a?(0,i.Z)("span",{className:a.short_name&&"hidden-xs hidden-sm"},void 0,a.name):t),(0,i.Z)("ul",{className:"dropdown-menu"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)(k.rU,{to:n+o.path},void 0,t)),g||(g=(0,i.Z)("li",{role:"separator",className:"divider"})),s.map((function(e){return(0,i.Z)("li",{},e.id,(0,i.Z)(k.rU,{to:e.url.index+o.path},void 0,(0,i.Z)("span",{className:"material-icon",style:{color:e.color||"inherit"}},void 0,"label"),e.name))}))))},w=function(e){var t=e.baseUrl,n=e.list,a=e.lists;return(0,i.Z)("div",{className:"dropdown threads-list-picker"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline dropdown-toggle btn-block","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,n.longName),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(e){return(0,i.Z)("li",{},e.type,(0,i.Z)(k.rU,{to:t+e.path},void 0,e.longName))}))))};var R=function(e){(0,l.Z)(r,e);var t,n,a=(t=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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function r(){return(0,s.Z)(this,r),a.apply(this,arguments)}return(0,o.Z)(r,[{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,y||(y=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Threads moderation"))),(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("One or more threads could not be deleted:")),(0,i.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,this.props.errors.map((function(e){return(0,i.Z)(C,{errors:e.errors,thread:e.thread},e.thread.id)}))))))}}]),r}(h().Component);function C(e){var t=e.errors,n=e.thread;return(0,i.Z)("li",{},void 0,(0,i.Z)("h5",{},void 0,n.title),t.map((function(e,t){return(0,i.Z)("p",{},void 0,e)})))}var S,E,P,L,T=n(43345),O=n(96359),A=n(57026),B=n(60471),I=n(32233),D=n(61340),j=n(77751),z=n(52753),U=n(78657),M=n(59801),q=n(53904),H=n(90287),F=n(55210);var Y,V,G=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;for(var n in(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"getFormdata",(function(){return{threads:t.props.threads.map((function(e){return e.id})),title:t.state.title,category:t.state.category,weight:t.state.weight,is_hidden:t.state.is_hidden,is_closed:t.state.is_closed}})),(0,d.Z)((0,r.Z)(t),"handleSuccess",(function(e){t.props.threads.forEach((function(e){t.props.freezeThread(e.id),t.props.deleteThread(e)})),H.Z.dispatch(j.YP()),t.props.addThreads([e]),H.Z.dispatch((0,D.V8)(t.props.route.category,t.props.categoriesMap)),M.Z.hide()})),(0,d.Z)((0,r.Z)(t),"handleError",(function(e){400===e.status?e.best_answers||e.polls?M.Z.show((0,i.Z)(z.ZP,{api:I.Z.get("MERGE_THREADS_API"),bestAnswers:e.best_answers,data:t.getFormdata(),polls:e.polls,onError:t.handleError,onSuccess:t.handleSuccess})):(t.setState({errors:Object.assign({},t.state.errors,e)}),q.Z.error(gettext("Form contains errors."))):403===e.status&&Array.isArray(e)?M.Z.show((0,i.Z)(R,{errors:e})):e.best_answer?q.Z.error(e.best_answer[0]):e.poll?q.Z.error(e.poll[0]):q.Z.apiError(e)})),(0,d.Z)((0,r.Z)(t),"onCategoryChange",(function(e){var n=e.target.value,a={category:n};t.acl[n].can_pin_threads<a.weight&&(a.weight=0),t.acl[n].can_hide_threads||(a.is_hidden=0),t.acl[n].can_close_threads||(a.is_closed=!1),t.setState(a)})),t.state={isLoading:!1,title:"",category:null,weight:0,is_hidden:0,is_closed:!1,validators:{title:[F.C1()]},errors:{}},t.acl={},e.user.acl.categories)if(e.user.acl.categories.hasOwnProperty(n)){var o=e.user.acl.categories[n];t.acl[o.id]=o}return t.categoryChoices=[],e.categories.forEach((function(e){if(e.level>0){var n=t.acl[e.id],a=!n.can_start_threads||e.is_closed&&!n.can_close_threads;t.categoryChoices.push({value:e.id,disabled:a,level:e.level-1,label:e.name}),a||t.state.category||(t.state.category=e.id)}})),t.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],t.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],t}return(0,o.Z)(p,[{key:"clean",value:function(){return!!this.isValid()||(q.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return U.Z.post(I.Z.get("MERGE_THREADS_API"),this.getFormdata())}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,i.Z)(O.Z,{label:gettext("Thread weight"),for:"id_weight"},void 0,(0,i.Z)(B.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,i.Z)(O.Z,{label:gettext("Hide thread"),for:"id_is_hidden"},void 0,(0,i.Z)(B.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,i.Z)(O.Z,{label:gettext("Close thread"),for:"id_is_closed"},void 0,(0,i.Z)(B.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"renderForm",value:function(){return(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(O.Z,{label:gettext("Thread title"),for:"id_title",validation:this.state.errors.title},void 0,(0,i.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),S||(S=(0,i.Z)("div",{className:"clearfix"})),(0,i.Z)(O.Z,{label:gettext("Category"),for:"id_category",validation:this.state.errors.category},void 0,(0,i.Z)(A.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.categoryChoices})),E||(E=(0,i.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)(v.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Merge threads"))))}},{key:"renderCantMergeMessage",value:function(){return(0,i.Z)("div",{className:"modal-body"},void 0,P||(P=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"message-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("You can't move threads because there are no categories you are allowed to move them to.")),(0,i.Z)("p",{},void 0,gettext("You need permission to start threads in category to be able to merge threads to it.")),(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}},{key:"getClassName",value:function(){return this.state.category?"modal-dialog":"modal-dialog modal-message"}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,L||(L=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Merge threads"))),this.state.category?this.renderForm():this.renderCantMergeMessage()))}}]),p}(T.Z);var $,W,Q,K,J,X,ee,te,ne,ae,ie,se,oe,re,le=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"handleSubmit",(function(e){e.preventDefault(),M.Z.hide(),t.props.callApi([{op:"replace",path:"category",value:t.state.category},{op:"replace",path:"flatten-categories",value:null},{op:"add",path:"acl",value:!0}],gettext("Selected threads were moved."),(function(){H.Z.dispatch((0,D.V8)(t.props.route.category,t.props.categoriesMap));var e=H.Z.getState(),n=e.threads.map((function(e){return e.id}));H.Z.dispatch(j.$6(e.selection.filter((function(e){return-1!==n.indexOf(e)}))))}))})),t.state={category:null};var n={};for(var i in e.user.acl.categories)if(e.user.acl.categories.hasOwnProperty(i)){var o=e.user.acl.categories[i];n[o.id]=o}return t.categoryChoices=[],e.categories.forEach((function(e){if(e.level>0){var a=n[e.id],i=!a.can_start_threads||e.is_closed&&!a.can_close_threads;t.categoryChoices.push({value:e.id,disabled:i,level:e.level-1,label:e.name}),i||t.state.category||(t.state.category=e.id)}})),t}return(0,o.Z)(p,[{key:"getClassName",value:function(){return this.state.category?"modal-dialog":"modal-dialog modal-message"}},{key:"renderForm",value:function(){return(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(O.Z,{label:gettext("New category"),for:"id_new_category"},void 0,(0,i.Z)(A.Z,{id:"id_new_category",onChange:this.bindInput("category"),value:this.state.category,choices:this.categoryChoices}))),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)("button",{className:"btn btn-primary"},void 0,gettext("Move threads"))))}},{key:"renderCantMoveMessage",value:function(){return(0,i.Z)("div",{className:"modal-body"},void 0,Y||(Y=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"message-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("You can't move threads because there are no categories you are allowed to move them to.")),(0,i.Z)("p",{},void 0,gettext("You need permission to start threads in category to be able to move threads to it.")),(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,V||(V=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Move threads"))),this.state.category?this.renderForm():this.renderCantMoveMessage()))}}]),p}(T.Z);var ce,ue,de,pe=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(){var e;(0,s.Z)(this,p);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,d.Z)((0,r.Z)(e),"callApi",(function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.props.threads.forEach((function(t){e.props.freezeThread(t.id)}));var s=e.props.threads.map((function(e){return e.id}));t.push({op:"add",path:"acl",value:!0}),U.Z.patch(e.props.api,{ids:s,ops:t}).then((function(t){e.props.threads.forEach((function(t){e.props.freezeThread(t.id)})),t.forEach((function(t){e.props.updateThread(t)})),q.Z.success(n),a&&a()}),(function(t){if(e.props.threads.forEach((function(t){e.props.freezeThread(t.id)})),400!==t.status)return q.Z.apiError(t);var n=[],a={};e.props.threads.forEach((function(e){a[e.id]=e})),t.forEach((function(e){var t=e.id,i=e.detail;void 0!==a[t]&&n.push({errors:i,thread:a[t]})})),M.Z.show((0,i.Z)(R,{errors:n}))}))})),(0,d.Z)((0,r.Z)(e),"pinGlobally",(function(){e.callApi([{op:"replace",path:"weight",value:2}],gettext("Selected threads were pinned globally."))})),(0,d.Z)((0,r.Z)(e),"pinLocally",(function(){e.callApi([{op:"replace",path:"weight",value:1}],gettext("Selected threads were pinned locally."))})),(0,d.Z)((0,r.Z)(e),"unpin",(function(){e.callApi([{op:"replace",path:"weight",value:0}],gettext("Selected threads were unpinned."))})),(0,d.Z)((0,r.Z)(e),"approve",(function(){e.callApi([{op:"replace",path:"is-unapproved",value:!1}],gettext("Selected threads were approved."))})),(0,d.Z)((0,r.Z)(e),"open",(function(){e.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Selected threads were opened."))})),(0,d.Z)((0,r.Z)(e),"close",(function(){e.callApi([{op:"replace",path:"is-closed",value:!0}],gettext("Selected threads were closed."))})),(0,d.Z)((0,r.Z)(e),"unhide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!1}],gettext("Selected threads were unhidden."))})),(0,d.Z)((0,r.Z)(e),"hide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!0}],gettext("Selected threads were hidden."))})),(0,d.Z)((0,r.Z)(e),"move",(function(){M.Z.show((0,i.Z)(le,{callApi:e.callApi,categories:e.props.categories,categoriesMap:e.props.categoriesMap,route:e.props.route,user:e.props.user}))})),(0,d.Z)((0,r.Z)(e),"merge",(function(){var t=[];if(e.props.threads.forEach((function(e){e.acl.can_merge||t.append({id:e.id,title:e.title,errors:[gettext("You don't have permission to merge this thread with others.")]})})),e.props.threads.length<2)q.Z.info(gettext("You have to select at least two threads to merge."));else{if(t.length)return void M.Z.show((0,i.Z)(R,{errors:t}));M.Z.show(h().createElement(G,e.props))}})),(0,d.Z)((0,r.Z)(e),"delete",(function(){if(window.confirm(gettext("Are you sure you want to delete selected threads?"))){e.props.threads.map((function(t){e.props.freezeThread(t.id)}));var t=e.props.threads.map((function(e){return e.id}));U.Z.delete(e.props.api,t).then((function(){e.props.threads.map((function(t){e.props.freezeThread(t.id),e.props.deleteThread(t)})),q.Z.success(gettext("Selected threads were deleted."))}),(function(t){if(400===t.status){var n=t.map((function(e){return e.id}));e.props.threads.map((function(t){e.props.freezeThread(t.id),-1===n.indexOf(t.id)&&e.props.deleteThread(t)})),M.Z.show((0,i.Z)(R,{errors:t}))}else q.Z.apiError(t)}))}})),e}return(0,o.Z)(p,[{key:"render",value:function(){var e=this.props,t=e.moderation,n=e.threads,a=0==this.props.selection.length;return(0,i.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",onClick:function(){return H.Z.dispatch(j.$6(n.map((function(e){return e.id}))))}},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Select all"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:function(){return H.Z.dispatch(j.YP())}},void 0,W||(W=(0,i.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),gettext("Select none"))),Q||(Q=(0,i.Z)("li",{role:"separator",className:"divider"})),!!t.can_pin_globally&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.pinGlobally},void 0,K||(K=(0,i.Z)("span",{className:"material-icon"},void 0,"bookmark")),gettext("Pin threads globally"))),!!t.can_pin&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.pinLocally},void 0,J||(J=(0,i.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),gettext("Pin threads locally"))),!!t.can_pin&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.unpin},void 0,X||(X=(0,i.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),gettext("Unpin threads"))),!!t.can_move&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.move},void 0,ee||(ee=(0,i.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move threads"))),!!t.can_merge&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.merge},void 0,te||(te=(0,i.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge threads"))),!!t.can_approve&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.approve},void 0,ne||(ne=(0,i.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve threads"))),!!t.can_close&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.open},void 0,ae||(ae=(0,i.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Open threads"))),!!t.can_close&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.close},void 0,ie||(ie=(0,i.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Close threads"))),!!t.can_unhide&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.unhide},void 0,se||(se=(0,i.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide threads"))),!!t.can_hide&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.hide},void 0,oe||(oe=(0,i.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide threads"))),!!t.can_delete&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.delete},void 0,re||(re=(0,i.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete threads"))))}}]),p}(h().Component),he=function(e){var t=e.api,n=e.categoriesMap,a=e.categories,s=e.threads,o=e.addThreads,r=e.freezeThread,l=e.updateThread,c=e.deleteThread,u=e.selection,d=e.moderation,p=e.route,h=e.user,v=e.disabled;return(0,i.Z)("div",{className:"dropdown threads-moderation"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Moderation"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:v},void 0,ce||(ce=(0,i.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,i.Z)(pe,{api:t,categories:a,categoriesMap:n,threads:s,addThreads:o,freezeThread:r,updateThread:l,deleteThread:c,selection:u,moderation:d,route:p,user:h,disabled:v}))},ve=function(e){var t=e.api,n=e.baseUrl,a=e.category,s=e.categories,o=e.categoriesMap,r=e.topCategory,l=e.topCategories,c=e.subCategory,u=e.subCategories,d=e.list,p=e.lists,h=e.threads,f=e.addThreads,m=e.startThread,Z=e.freezeThread,g=e.updateThread,y=e.deleteThread,b=e.selection,k=e.moderation,R=e.route,C=e.user,S=e.disabled;return(0,i.Z)(N.o8,{},void 0,l.length>0&&(0,i.Z)(N.Z2,{},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(x,{allItems:gettext("All categories"),parentUrl:d.path,category:r,categories:l,list:d})),r&&u.length>0&&(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(x,{allItems:gettext("All subcategories"),parentUrl:r.url.index,category:c,categories:u,list:d}))),p.length>1&&(0,i.Z)(N.Z2,{className:"hidden-xs"},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(w,{baseUrl:n,list:d,lists:p}))),ue||(ue=(0,i.Z)(N.tw,{})),!!C.id&&(0,i.Z)(N.Z2,{},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(v.Z,{className:"btn-primary btn-outline btn-block",disabled:S,onClick:function(){_.Z.open(m||{mode:"START",config:misago.get("THREAD_EDITOR_API"),submit:misago.get("THREADS_API"),category:a.id})}},void 0,de||(de=(0,i.Z)("span",{className:"material-icon"},void 0,"chat")),gettext("Start thread"))),!!k.allow&&(0,i.Z)(N.Eg,{shrink:!0},void 0,(0,i.Z)(he,{api:t,categories:s,categoriesMap:o,threads:h.filter((function(e){return-1!==b.indexOf(e.id)})),addThreads:f,freezeThread:Z,updateThread:g,deleteThread:y,selection:b,moderation:k,route:R,user:C,disabled:S}))))};var fe=function(e){(0,l.Z)(r,e);var t,n,a=(t=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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function r(){return(0,s.Z)(this,r),a.apply(this,arguments)}return(0,o.Z)(r,[{key:"render",value:function(){var e=this.props.root,t=this.props.route,n=t.category,a=t.categories,s=t.categoriesMap,o=me(e,n,s);return(0,i.Z)(b.Z,{},void 0,(0,i.Z)(ve,{api:this.props.api,baseUrl:n.url.index,category:n,categories:a,categoriesMap:s,topCategory:o,topCategories:a.filter((function(t){return t.parent===e.id})),subCategories:o?a.filter((function(e){return e.parent===o.id})):[],subCategory:2===n.level?n:null,subcategories:this.props.subcategories,list:this.props.route.list,lists:this.props.route.lists,threads:this.props.threads,addThreads:this.props.addThreads,startThread:this.props.startThread,freezeThread:this.props.freezeThread,deleteThread:this.props.deleteThread,updateThread:this.props.updateThread,selection:this.props.selection,moderation:this.props.moderation,route:this.props.route,user:this.props.user,disabled:!this.props.isLoaded||this.props.isBusy||this.props.busyThreads.length}),this.props.children)}}]),r}(h().Component),me=function(e,t,n){return t.parent?t.parent===e.id?t:n[t.parent]:null};function Ze(e){var t={allow:!1,can_approve:0,can_close:0,can_delete:0,can_hide:0,can_merge:0,can_move:0,can_pin:0,can_pin_globally:0,can_unhide:0};return e.forEach((function(e){e.is_unapproved&&e.acl.can_approve>t.can_approve&&(t.can_approve=e.acl.can_approve),e.acl.can_close>t.can_close&&(t.can_close=e.acl.can_close),e.acl.can_delete>t.can_delete&&(t.can_delete=e.acl.can_delete),e.acl.can_hide>t.can_hide&&(t.can_hide=e.acl.can_hide),e.acl.can_merge>t.can_merge&&(t.can_merge=e.acl.can_merge),e.acl.can_move>t.can_move&&(t.can_move=e.acl.can_move),e.acl.can_pin>t.can_pin&&(t.can_pin=e.acl.can_pin),e.acl.can_pin_globally>t.can_pin_globally&&(t.can_pin_globally=e.acl.can_pin_globally),e.is_hidden&&e.acl.can_unhide>t.can_unhide&&(t.can_unhide=e.acl.can_unhide),t.allow=t.can_approve||t.can_close||t.can_delete||t.can_hide||t.can_merge||t.can_move||t.can_pin||t.can_pin_globally||t.can_unhide})),t}var ge,ye,be,_e,Ne=function(e){var t=e.category,n=e.list,a=e.message;return"all"===n.type?a?(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,a),(0,i.Z)("p",{},void 0,gettext("Why not start one yourself?"))):(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,t.special_role?gettext("There are no threads on this forum... yet!"):gettext("There are no threads in this category.")),(0,i.Z)("p",{},void 0,gettext("Why not start one yourself?"))):(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("No threads matching specified criteria were found.")))},ke=n(50366),xe=n(16768),we=function(e){var t=e.thread;return(0,i.Z)("a",{href:t.url.last_post,className:"threads-list-item-last-activity",title:interpolate(gettext("Last activity: %(timestamp)s"),{timestamp:t.last_post_on.format("LLL")},!0)},void 0,t.last_post_on.fromNow(!0))},Re=function(e){var t="threads-list-item-category threads-list-category-label";return e.color&&(t+=" threads-list-category-label-color"),t},Ce=function(e){var t=e.parent,n=e.category;return(0,i.Z)("span",{},void 0,t&&(0,i.Z)("a",{href:t.url.index,className:Re(t)+" threads-list-item-parent-category",style:t.color?{"--label-color":t.color}:null,title:t.short_name?t.name:null},void 0,t.short_name||t.name),(0,i.Z)("a",{href:n.url.index,className:Re(n),style:n.color?{"--label-color":n.color}:null,title:n.short_name?n.name:null},void 0,n.short_name||n.name))},Se=function(e){var t=e.checked,n=e.disabled,a=e.thread;return(0,i.Z)("button",{className:"btn btn-default btn-icon",type:"button",disabled:n,onClick:function(){return H.Z.dispatch(j.wc(a.id))}},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,t?"check_box":"check_box_outline_blank"))},Ee=function(e){var t=e.thread,n="threads-list-icon";return t.is_read||(n+=" threads-list-icon-new"),(0,i.Z)("a",{title:t.is_read?gettext("No new posts"):gettext("New posts"),href:t.is_read?t.url.last_post:t.url.new_post,className:n},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,t.is_read?"chat_bubble_outline":"chat_bubble"))},Pe=n(19605),Le=function(e){var t=e.thread;return t.last_poster?(0,i.Z)("a",{href:t.url.last_poster,className:"threads-list-item-last-poster",title:interpolate(gettext("Last post by: %(poster)s"),{poster:t.last_poster.username},!0)},void 0,(0,i.Z)(Pe.ZP,{size:32,user:t.last_poster})):(0,i.Z)("span",{className:"threads-list-item-last-poster",title:interpolate(gettext("Last post by: %(poster)s"),{poster:t.last_poster_name},!0)},void 0,ge||(ge=(0,i.Z)(Pe.ZP,{size:32})))};var Te,Oe,Ae,Be,Ie,De,je,ze,Ue,Me,qe,He={unsubscribe:null,notify:!1,email:!0},Fe=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;return(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"update",(function(e){var n=t.props.thread;t.setState({loading:!0}),H.Z.dispatch((0,D.r$)(n,{subscription:He[e]})),U.Z.patch(n.api.index,[{op:"replace",path:"subscription",value:e}]).then((function(){}),(function(e){H.Z.dispatch((0,D.r$)(n,{subscription:He[n.subscription]})),q.Z.apiError(e)})).then((function(){return t.setState({loading:!1})}))})),(0,d.Z)((0,r.Z)(t),"render",(function(){var e=t.state.loading,n=t.props,a=n.disabled,s=n.thread;return(0,i.Z)("ul",{className:"dropdown-menu dropdown-menu-right"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||null===s.subscription,onClick:function(){return t.update("unsubscribe")}},void 0,ye||(ye=(0,i.Z)("span",{className:"material-icon"},void 0,"star_border")),gettext("Unsubscribe"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||!1===s.subscription,onClick:function(){return t.update("notify")}},void 0,be||(be=(0,i.Z)("span",{className:"material-icon"},void 0,"star_half")),gettext("Subscribe with alert"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||!0===s.subscription,onClick:function(){return t.update("email")}},void 0,_e||(_e=(0,i.Z)("span",{className:"material-icon"},void 0,"star")),gettext("Subscribe with e-mail"))))})),t.state={loading:!1},t}return(0,o.Z)(p)}(h().Component),Ye=function(e){var t,n=e.disabled,a=e.thread;return(0,i.Z)("div",{className:"dropdown"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-icon",type:"button",title:(t=a.subscription,!0===t?gettext("Subscribed to e-mails"):!1===t?gettext("Subscribed to alerts"):gettext("Not subscribed")),disabled:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return!0===e?"star":!1===e?"star_half":"star_border"}(a.subscription))),(0,i.Z)(Fe,{disabled:n,thread:a}))},Ve=function(e){var t=e.activeCategory,n=e.categories,a=e.showOptions,s=e.showSubscription,o=e.thread,r=e.isBusy,l=e.isSelected,c=null,u=null;t.id!==o.category&&(u=n[o.category]).parent&&u.parent!==t.id&&n[u.parent]&&!n[u.parent].special_role&&(c=n[u.parent]);var d=o.is_closed||o.is_hidden||o.is_unapproved||o.weight>0||o.best_answer||o.has_poll||o.has_unapproved_posts,p=!!a&&o.is_new;return(0,i.Z)("li",{className:"list-group-item threads-list-item"+(r?" threads-list-item-is-busy":"")},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,a&&(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)(Ee,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("a",{href:o.url.index,className:"threads-list-item-title"},void 0,o.title),(0,i.Z)("a",{href:p?o.url.new_post:o.url.index,className:"threads-list-item-title-sm"+(p?" threads-list-item-title-new":"")},void 0,o.title)),a&&o.moderation.length>0&&(0,i.Z)("div",{className:"threads-list-item-col-checkbox-sm"},void 0,(0,i.Z)(Se,{checked:l,disabled:r,thread:o}))),(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,d&&(0,i.Z)("div",{className:"threads-list-item-col-flags"},void 0,(0,i.Z)(ke.Z,{thread:o})),!!u&&(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ce,{parent:c,category:u})),Te||(Te=(0,i.Z)("div",{className:"threads-list-item-col-spacer-xs"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(xe.Z,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)(Le,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)(we,{thread:o})),a&&s&&(0,i.Z)("div",{className:"threads-list-item-col-subscription"},void 0,(0,i.Z)(Ye,{disabled:r,thread:o})),a&&o.moderation.length>0&&(0,i.Z)("div",{className:"threads-list-item-col-checkbox"},void 0,(0,i.Z)(Se,{checked:l,disabled:r,thread:o}))))},Ge=function(e){var t=e.width;return(0,i.Z)("span",{className:"ui-preview-text",style:{width:t+"px"}},void 0," ")},$e=function(e){var t=e.showOptions;return(0,i.Z)("div",{className:"threads-list threads-list-loader"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(Oe||(Oe=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),Ae||(Ae=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"90"})," ",(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"90"})," ",(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"}))))),Be||(Be=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"70"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"50"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"50"})))))),(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(Ie||(Ie=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),De||(De=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"30"})," ",(0,i.Z)(Ge,{width:"60"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"30"})," ",(0,i.Z)(Ge,{width:"60"}))))),je||(je=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"55"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"60"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"70"})))))),(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(ze||(ze=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),Ue||(Ue=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"80"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"80"}))))),Me||(Me=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"75"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"40"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"60"}))))))))},We=function(e){var t=e.threads,n=e.onClick;return(0,i.Z)("li",{className:"list-group-item threads-list-update-prompt"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-block threads-list-update-prompt-btn",onClick:n},void 0,qe||(qe=(0,i.Z)("span",{className:"material-icon"},void 0,"cached")),(0,i.Z)("span",{className:"threads-list-update-prompt-message"},void 0,interpolate(ngettext("There is %(threads)s new or updated thread. Click here to show it.","There are %(threads)s new or updated threads. Click here to show them.",t),{threads:t},!0))))},Qe=function(e){var t=e.list,n=e.categories,a=e.category,s=e.threads,o=e.busyThreads,r=e.selection,l=e.isLoaded,c=e.showOptions,u=e.updatedThreads,d=e.applyUpdate,p=e.emptyMessage;return l?(0,i.Z)("div",{className:"threads-list"},void 0,s.length>0?(0,i.Z)("ul",{className:"list-group"},void 0,u>0&&(0,i.Z)(We,{threads:u,onClick:d}),s.map((function(e){return(0,i.Z)(Ve,{activeCategory:a,categories:n,thread:e,showOptions:c,showSubscription:c&&"subscribed"===t.type,isBusy:o.indexOf(e.id)>=0,isSelected:r.indexOf(e.id)>=0},e.id)}))):(0,i.Z)("ul",{className:"list-group"},void 0,u>0&&(0,i.Z)(We,{threads:u,onClick:d}),(0,i.Z)(Ne,{category:a,list:t,message:p}))):(0,i.Z)($e,{showOptions:c})},Ke=n(82125),Je=n(55547),Xe=n(53328),et=n(20370),tt=n(99755);var nt=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadThreads(t.getCategory(),t.state.next)})),(0,d.Z)((0,r.Z)(t),"pollResponse",(function(e){var n,a,i;t.setState({diff:Object.assign({},e,{results:(n=t.props.threads,a=e.results,i={},n.forEach((function(e){i[e.id]=e})),a.filter((function(e){return!i[e.id]||function(e,t){return[e.title===t.title,e.weight===t.weight,e.category===t.category,e.last_post===t.last_post,e.last_poster_name===t.last_poster_name].indexOf(!1)>=0}(i[e.id],e)})))})})})),(0,d.Z)((0,r.Z)(t),"addThreads",(function(e){H.Z.dispatch((0,D.R3)(e,t.getSorting()))})),(0,d.Z)((0,r.Z)(t),"applyDiff",(function(){t.addThreads(t.state.diff.results),t.setState(Object.assign({},t.state.diff,{moderation:Ze(H.Z.getState().threads),diff:{results:[]}}))})),(0,d.Z)((0,r.Z)(t),"freezeThread",(function(e){t.setState((function(t){return{busyThreads:et.ZN(t.busyThreads,e)}}))})),(0,d.Z)((0,r.Z)(t),"updateThread",(function(e){H.Z.dispatch((0,D.r$)(e,e,t.getSorting()))})),(0,d.Z)((0,r.Z)(t),"deleteThread",(function(e){H.Z.dispatch((0,D.l8)(e))})),t.state={isMounted:!0,isLoaded:!1,isBusy:!1,diff:{results:[]},moderation:[],busyThreads:[],dropdown:!1,subcategories:[],next:0};var n=t.getCategory();return I.Z.has("THREADS")?t.initWithPreloadedData(n,I.Z.get("THREADS")):t.initWithoutPreloadedData(n),t}return(0,o.Z)(p,[{key:"getCategory",value:function(){return this.props.route.category.special_role?null:this.props.route.category.id}},{key:"initWithPreloadedData",value:function(e,t){this.state=Object.assign(this.state,{moderation:Ze(t.results),subcategories:t.subcategories,next:t.next}),this.startPolling(e)}},{key:"initWithoutPreloadedData",value:function(e){this.loadThreads(e)}},{key:"loadThreads",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;U.Z.get(this.props.options.api,{category:e,list:this.props.route.list.type,start:n||0},"threads").then((function(a){t.state.isMounted&&(0===n?H.Z.dispatch((0,D.ZB)(a.results)):H.Z.dispatch((0,D.R3)(a.results,t.getSorting())),t.setState({isLoaded:!0,isBusy:!1,moderation:Ze(H.Z.getState().threads),subcategories:a.subcategories,next:a.next}),t.startPolling(e))}),(function(e){q.Z.apiError(e)}))}},{key:"startPolling",value:function(e){Je.Z.start({poll:"threads",url:this.props.options.api,data:{category:e,list:this.props.route.list.type},frequency:12e4,update:this.pollResponse})}},{key:"componentDidMount",value:function(){this.setPageTitle(),I.Z.has("THREADS")&&(H.Z.dispatch((0,D.ZB)(I.Z.pop("THREADS").results)),this.setState({isLoaded:!0})),H.Z.dispatch(j.YP())}},{key:"componentWillUnmount",value:function(){this.state.isMounted=!1,Je.Z.stop("threads")}},{key:"getTitle",value:function(){return this.props.options.title?this.props.options.title:(e=this.props.route).category.level?e.category.name:I.Z.get("THREADS_ON_INDEX")?I.Z.get("SETTINGS").index_header?I.Z.get("SETTINGS").index_header:I.Z.get("SETTINGS").forum_name:gettext("Threads");var e}},{key:"setPageTitle",value:function(){var e;this.props.route.category.level||!I.Z.get("THREADS_ON_INDEX")?Xe.Z.set((e=this.props.route).category.level?e.list.path?{title:e.list.longName,parent:e.category.name}:{title:e.category.name}:I.Z.get("THREADS_ON_INDEX")?e.list.path?{title:e.list.longName}:null:e.list.path?{title:e.list.longName,parent:gettext("Threads")}:{title:gettext("Threads")}):this.props.options.title?Xe.Z.set(this.props.options.title):I.Z.get("SETTINGS").index_title?document.title=I.Z.get("SETTINGS").index_title:document.title=I.Z.get("SETTINGS").forum_name}},{key:"getSorting",value:function(){return this.props.route.category.level?Z:m}},{key:"getMoreButton",value:function(){return this.state.next?(0,i.Z)("div",{className:"pager-more"},void 0,(0,i.Z)(v.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy||this.state.busyThreads.length,onClick:this.loadMore},void 0,gettext("Show more"))):null}},{key:"getClassName",value:function(){var e,t="page page-threads";return t+=" page-threads-"+this.props.route.list.type,(e=this.props).route.category.level||!I.Z.get("THREADS_ON_INDEX")||e.options.title||(t+=" page-threads-index"),this.props.route.category.css_class&&(t+=" page-threads-"+this.props.route.category.css_class),t}},{key:"render",value:function(){var e=this.props.route.categories[0],t=this.props.route,n=t.category,a=t.list,s=n.special_role;return(0,i.Z)("div",{className:this.getClassName()},void 0,"root_category"==s&&I.Z.get("THREADS_ON_INDEX")&&I.Z.get("SETTINGS").index_header&&(0,i.Z)(tt.Iv,{header:I.Z.get("SETTINGS").index_header,message:n.description&&(0,i.Z)(tt.Ql,{message:n.description.html}),styleName:"forum-index"}),"root_category"==s&&!I.Z.get("THREADS_ON_INDEX")&&(0,i.Z)(tt.Iv,{header:gettext("Threads"),styleName:"threads"}),"private_threads"==s&&(0,i.Z)(tt.Iv,{header:this.props.options.title,message:this.props.options.pageLead&&(0,i.Z)(tt.bM,{},void 0,(0,i.Z)("p",{},void 0,this.props.options.pageLead)),styleName:"private-threads"}),!s&&(0,i.Z)(tt.Iv,{header:n.name,message:n.description&&(0,i.Z)(tt.Ql,{message:n.description.html}),styleName:n.css_class||"category-threads"}),(0,i.Z)(fe,{api:this.props.options.api,root:e,route:this.props.route,user:this.props.user,pageLead:this.props.options.pageLead,threads:this.props.threads,threadsCount:this.state.count,moderation:this.state.moderation,selection:this.props.selection,busyThreads:this.state.busyThreads,addThreads:this.addThreads,startThread:this.props.options.startThread,freezeThread:this.freezeThread,deleteThread:this.deleteThread,updateThread:this.updateThread,isLoaded:this.state.isLoaded,isBusy:this.state.isBusy},void 0,(0,i.Z)(Qe,{category:n,categories:this.props.route.categoriesMap,list:a,selection:this.props.selection,threads:this.props.threads,updatedThreads:this.state.diff.results.length,applyUpdate:this.applyDiff,showOptions:!!this.props.user.id,isLoaded:this.state.isLoaded,busyThreads:this.state.busyThreads,emptyMessage:this.props.options.emptyMessage}),this.getMoreButton()))}}]),p}(Ke.Z);var at=n(39633),it="misago:private-threads";function st(e){return e.get("CURRENT_LINK").substr(0,it.length)===it?{api:e.get("PRIVATE_THREADS_API"),startThread:{mode:"START_PRIVATE",submit:I.Z.get("PRIVATE_THREADS_API")},title:gettext("Private threads"),pageLead:gettext("Private threads are threads which only those that started them and those they have invited may see and participate in."),emptyMessage:gettext("You aren't participating in any private threads.")}:{api:e.get("THREADS_API")}}I.Z.addInitializer({name:"component:threads",initializer:function(e){var t,n,i,s,o;e.has("THREADS")&&e.has("CATEGORIES")&&(0,at.Z)({paths:(t=e.get("user"),n=st(e),i=function(e){var t=[{type:"all",path:"",name:gettext("All"),longName:gettext("All threads")}];return e.id&&(t.push({type:"my",path:"my/",name:gettext("My"),longName:gettext("My threads")}),t.push({type:"new",path:"new/",name:gettext("New"),longName:gettext("New threads")}),t.push({type:"unread",path:"unread/",name:gettext("Unread"),longName:gettext("Unread threads")}),t.push({type:"subscribed",path:"subscribed/",name:gettext("Subscribed"),longName:gettext("Subscribed threads")}),e.acl.can_see_unapproved_content_lists&&t.push({type:"unapproved",path:"unapproved/",name:gettext("Unapproved"),longName:gettext("Unapproved content")})),t}(t),s=[],o={},I.Z.get("CATEGORIES").forEach((function(e){i.forEach((function(t){var r;o[e.id]=e,s.push({path:e.url.index+t.path,component:(0,a.$j)((r=n,function(e){return{options:r,selection:e.selection,threads:e.threads,tick:e.tick.tick,user:e.auth.user}}))(nt),categories:I.Z.get("CATEGORIES"),categoriesMap:o,category:e,lists:i,list:t})}))})),s)})},after:"store"})},47806:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588),p=n.n(d),h=n(19605),v=n(97326),f=n(4942),m=n(78657),Z=n(53904);function g(e){return e.filter((function(e){return e.results.count>0})).map((function(e){return Object.assign({},e,{count:e.results.count,results:e.results.results.slice(0,5)})}))}var y=n(87462),b="HEADER",_="RESULT",N="FOOTER";function k(e){var t=e.value,n=e.onChange;return(0,s.Z)("input",{"aria-haspopup":"true","aria-expanded":"false","aria-controls":"dropdown-menu dropdown-search-results",autoComplete:"off",className:"form-control",value:t,onChange:n,placeholder:gettext("Search"),role:"combobox",type:"text"})}function x(e){var t=e.children,n=e.onChange,a=e.query;return(0,s.Z)("ul",{className:"dropdown-menu dropdown-search-results",role:"menu"},void 0,(0,s.Z)("li",{className:"form-group"},void 0,(0,s.Z)(k,{value:a,onChange:n})),t)}function w(){return(0,s.Z)("li",{className:"dropdown-search-message"},void 0,gettext("Search returned no results."))}var R,C=n(37848);function S(e){return e.message,R||(R=(0,s.Z)("li",{className:"dropdown-search-loader"},void 0,(0,s.Z)(C.Z,{})))}function E(e){var t=e.provider,n=e.query,a=t.url+"?q="+encodeURI(n),i=ngettext('See full "%(provider)s" results page with %(count)s result.','See full "%(provider)s" results page with %(count)s results.',t.count);return(0,s.Z)("li",{className:"dropdown-search-footer"},void 0,(0,s.Z)("a",{href:a},void 0,interpolate(i,{count:t.count,provider:t.name},!0)))}function P(e){var t=e.provider;return(0,s.Z)("li",{className:"dropdown-search-header"},void 0,t.name)}var L,T,O,A=n(30381),B=n.n(A),I=n(19755);function D(e){var t=e.result,n=(t.poster,t.thread),a=gettext("Posted by %(poster)s on %(posted_on)s in %(category)s.");return(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:t.url.index,className:"dropdown-search-thread"},void 0,(0,s.Z)("h5",{},void 0,n.title),(0,s.Z)("small",{className:"dropdown-search-post-content"},void 0,I(t.content).text()),(0,s.Z)("small",{className:"dropdown-search-post-footer"},void 0,interpolate(a,{category:t.category.name,posted_on:B()(t.posted_on).format("LL"),poster:t.poster_name},!0))))}function j(e){var t=e.result,n=t.rank,a=gettext("%(title)s, joined on %(joined_on)s"),i=t.title||n.title||n.name;return(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:t.url,className:"dropdown-search-user"},void 0,(0,s.Z)("div",{className:"media"},void 0,(0,s.Z)("div",{className:"media-left"},void 0,(0,s.Z)(h.ZP,{size:38,user:t})),(0,s.Z)("div",{className:"media-body"},void 0,(0,s.Z)("h5",{className:"media-heading"},void 0,t.username),(0,s.Z)("small",{},void 0,interpolate(a,{title:i,joined_on:B()(t.joined_on).format("LL")},!0))))))}function z(e){var t=e.provider,n=e.result;return"threads"===t.id?(0,s.Z)(D,{result:n}):(0,s.Z)(j,{result:n})}function U(e){var t=e.provider,n=e.result,a=e.type,i=e.query;return a===b?(0,s.Z)(P,{provider:t}):a===N?(0,s.Z)(E,{provider:t,query:i}):(0,s.Z)(z,{provider:t,result:n})}function M(e,t){for(var n=e.results.length,a=0;a<n;a++){var i=e.results[a];t.push({provider:e,result:i,type:_})}t.push({provider:e,type:N})}function q(e){var t=e.isLoading,n=e.onChange,a=e.results,i=e.query;if(!i.trim().length)return(0,s.Z)(x,{onChange:n,query:i});if(a.length){var o=function(e){var t=[];return function(e,t){for(var n=e.length,a=0;a<n;a++){var i=e[a];t.push({provider:i,type:b}),M(i,t)}}(e,t),t}(a);return(0,s.Z)(x,{onChange:n,query:i},void 0,o.map((function(e){var t=e.type,n=e.provider,a=e.result;return t===_?p().createElement(U,(0,y.Z)({key:[n.id,t,a.id].join("_")},e)):p().createElement(U,(0,y.Z)({key:[n.id,t].join("_"),query:i},e))})))}return t?(0,s.Z)(x,{onChange:n,query:i},void 0,L||(L=(0,s.Z)(S,{}))):(0,s.Z)(x,{onChange:n,query:i},void 0,T||(T=(0,s.Z)(w,{})))}var H=function(e){(0,l.Z)(d,e);var t,n,a=(t=d,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function d(){var e;return(0,o.Z)(this,d),e=a.call(this),(0,f.Z)((0,v.Z)(e),"onToggle",(function(t){e.setState((function(t,n){return t.isOpen||window.setTimeout((function(){e.container.querySelector("input").focus()}),100),{isOpen:!t.isOpen}}))})),(0,f.Z)((0,v.Z)(e),"onDocumentMouseDown",(function(t){for(var n=!0,a=t.target;null!==a&&a!==document;){if(a===e.container)return void(n=!1);a=a.parentNode}n&&e.setState({isOpen:!1})})),(0,f.Z)((0,v.Z)(e),"onEscape",(function(t){"Escape"===t.key&&e.setState({isOpen:!1})})),(0,f.Z)((0,v.Z)(e),"onChange",(function(t){var n=t.target.value;e.setState({query:n}),e.loadResults(n.trim())})),e.state={isLoading:!1,isOpen:!1,query:"",results:[]},e.intervalId=null,e}return(0,r.Z)(d,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("keydown",this.onEscape)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("keydown",this.onEscape)}},{key:"loadResults",value:function(e){var t=this;if(e.length){var n=300+300*Math.random();this.intervalId&&window.clearTimeout(this.intervalId),this.setState({isLoading:!0}),this.intervalId=window.setTimeout((function(){m.Z.get(i.Z.get("SEARCH_API"),{q:e}).then((function(e){t.setState({intervalId:null,isLoading:!1,results:g(e)})}),(function(e){Z.Z.apiError(e),t.setState({intervalId:null,isLoading:!1,results:[]})}))}),n)}}},{key:"render",value:function(){var e=this,t="navbar-search dropdown";return this.state.isOpen&&(t+=" open"),p().createElement("div",{className:t,ref:function(t){return e.container=t}},(0,s.Z)("a",{"aria-haspopup":"true","aria-expanded":"false",className:"navbar-icon","data-toggle":"dropdown",href:i.Z.get("SEARCH_URL"),onClick:this.onToggle},void 0,O||(O=(0,s.Z)("i",{className:"material-icon"},void 0,"search"))),(0,s.Z)(q,{isLoading:this.state.isLoading,onChange:this.onChange,results:this.state.results,query:this.state.query}))}}]),d}(p().Component),F=n(82211),Y=n(43345),V=n(96359),G=n(59940);var $,W,Q,K=["progress-bar-danger","progress-bar-warning","progress-bar-warning","progress-bar-primary","progress-bar-success"],J=[gettext("Entered password is very weak."),gettext("Entered password is weak."),gettext("Entered password is average."),gettext("Entered password is strong."),gettext("Entered password is very strong.")],X=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e))._score=0,t._password=null,t._inputs=[],t.state={loaded:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;G.Z.load().then((function(){e.setState({loaded:!0})}))}},{key:"getScore",value:function(e,t){var n=this,a=!1;return e!==this._password&&(a=!0),t.length!==this._inputs.length?a=!0:t.map((function(e,t){e.trim()!==n._inputs[t]&&(a=!0)})),a&&(this._score=G.Z.scorePassword(e,t),this._password=e,this._inputs=t.map((function(e){return e.trim()}))),this._score}},{key:"render",value:function(){if(!this.state.loaded)return null;var e=this.getScore(this.props.password,this.props.inputs);return(0,s.Z)("div",{className:"help-block password-strength"},void 0,(0,s.Z)("div",{className:"progress"},void 0,(0,s.Z)("div",{className:"progress-bar "+K[e],style:{width:20+20*e+"%"},role:"progress-bar","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"4"},void 0,(0,s.Z)("span",{className:"sr-only"},void 0,J[e]))),(0,s.Z)("p",{className:"text-small"},void 0,J[e]))}}]),i}(p().Component),ee=n(26106),te=n(47235),ne=n(98274),ae=n(93825),ie=n(59801),se=n(93051),oe=n(55210);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){(0,f.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var ue,de=function(e){(0,l.Z)(n,e);var t=ce(n);function n(e){var a;(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"handlePrivacyPolicyChange",(function(e){var t=e.target.value;a.handleToggleAgreement("privacyPolicy",t)})),(0,f.Z)((0,v.Z)(a),"handleTermsOfServiceChange",(function(e){var t=e.target.value;a.handleToggleAgreement("termsOfService",t)})),(0,f.Z)((0,v.Z)(a),"handleToggleAgreement",(function(e,t){a.setState((function(n,i){if(null===n[e]){var s=le(le({},n.errors),{},(0,f.Z)({},e,null));return(0,f.Z)({errors:s},e,t)}var o=a.state.validators[e][0],r=le(le({},n.errors),{},(0,f.Z)({},e,[o(null)]));return(0,f.Z)({errors:r},e,null)}))}));var s=a.props.criteria,r=s.username,l=s.password,c=0;l.forEach((function(e){"MinimumLengthValidator"===e.name&&(c=e.min_length)}));var u={username:[oe.lG(),oe.HR(r.min_length),oe.gS(r.max_length)],email:[oe.Do()],password:[oe.Vb(c)],captcha:ae.ZP.validator()};return i.Z.get("TERMS_OF_SERVICE_ID")&&(u.termsOfService=[oe.fT()]),i.Z.get("PRIVACY_POLICY_ID")&&(u.privacyPolicy=[oe.jA()]),a.state={isLoading:!1,username:"",email:"",password:"",captcha:"",termsOfService:null,privacyPolicy:null,validators:u,errors:{}},a}return(0,r.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(Z.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return m.Z.post(i.Z.get("USERS_API"),{username:this.state.username,email:this.state.email,password:this.state.password,captcha:this.state.captcha,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),e.__all__&&e.__all__.length>0?Z.Z.error(e.__all__[0]):Z.Z.error(gettext("Form contains errors."))):403===e.status&&e.ban?((0,se.Z)(e.ban),ie.Z.hide()):Z.Z.apiError(e)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-dialog modal-register",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,$||($=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Register"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("input",{type:"type",style:{display:"none"}}),(0,s.Z)("input",{type:"password",style:{display:"none"}}),(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(te.Z,{buttonClassName:"col-xs-12 col-sm-6",buttonLabel:gettext("Join with %(site)s"),formLabel:gettext("Or create forum account:")}),(0,s.Z)(V.Z,{label:gettext("Username"),for:"id_username",validation:this.state.errors.username},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control","aria-describedby":"id_username_status",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username})),(0,s.Z)(V.Z,{label:gettext("E-mail"),for:"id_email",validation:this.state.errors.email},void 0,(0,s.Z)("input",{type:"text",id:"id_email",className:"form-control","aria-describedby":"id_email_status",disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email})),(0,s.Z)(V.Z,{label:gettext("Password"),for:"id_password",validation:this.state.errors.password,extra:(0,s.Z)(X,{password:this.state.password,inputs:[this.state.username,this.state.email]})},void 0,(0,s.Z)("input",{type:"password",id:"id_password",className:"form-control","aria-describedby":"id_password_status",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password})),ae.ZP.component({form:this}),(0,s.Z)(ee.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,s.Z)(F.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Register account"))))))}}]),n}(Y.Z),pe=function(e){(0,l.Z)(n,e);var t=ce(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"getLead",value:function(){return"user"===this.props.activation?gettext("%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===this.props.activation?gettext("%(username)s, your account has been created but board administrator will have to activate it before you will be able to sign in."):void 0}},{key:"getSubscript",value:function(){return"user"===this.props.activation?gettext("We have sent an e-mail to %(email)s with link that you have to click to activate your account."):"admin"===this.props.activation?gettext("We will send an e-mail to %(email)s when this takes place."):void 0}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-dialog modal-message modal-register",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,W||(W=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Registration complete"))),(0,s.Z)("div",{className:"modal-body"},void 0,Q||(Q=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,interpolate(this.getLead(),{username:this.props.username},!0)),(0,s.Z)("p",{},void 0,interpolate(this.getSubscript(),{email:this.props.email},!0)),(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))))}}]),n}(p().Component),he=function(e){(0,l.Z)(n,e);var t=ce(n);function n(e){var a;return(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"completeRegistration",(function(e){"active"===e.activation?(ie.Z.hide(),ne.Z.signIn(e)):a.setState({complete:e})})),a.state={complete:!1},a}return(0,r.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,s.Z)(pe,{activation:this.state.complete.activation,email:this.state.complete.email,username:this.state.complete.username}):p().createElement(de,(0,y.Z)({callback:this.completeRegistration},this.props))}}]),n}(p().Component);var ve,fe,me,Ze=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"showRegisterForm",(function(){"closed"===misago.get("SETTINGS").account_activation?Z.Z.info(gettext("New registrations are currently disabled.")):t.state.isLoaded?ie.Z.show((0,s.Z)(he,{criteria:t.state.criteria})):(t.setState({isLoading:!0}),Promise.all([ae.ZP.load(),m.Z.get(misago.get("AUTH_CRITERIA_API"))]).then((function(e){t.setState({isLoading:!1,isLoaded:!0,criteria:e[1]}),ie.Z.show((0,s.Z)(he,{criteria:e[1]}))}),(function(){t.setState({isLoading:!1}),Z.Z.error(gettext("Registration is currently unavailable due to an error."))})))})),t.state={isLoading:!1,isLoaded:!1,criteria:null},t}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.className+(this.state.isLoading?" btn-loading":"")}},{key:"render",value:function(){return(0,s.Z)("button",{className:"btn "+this.getClassName(),disabled:this.state.isLoading,onClick:this.showRegisterForm,type:"button"},void 0,gettext("Register"),this.state.isLoading?ue||(ue=(0,s.Z)(C.Z,{})):null)}}]),i}(p().Component),ge=n(14467),ye=n(8621);function be(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var _e,Ne=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showSignInModal",value:function(){ie.Z.show(ge.Z)}},{key:"render",value:function(){var e=i.Z.get("SETTINGS").DELEGATE_AUTH;return(0,s.Z)("ul",{className:"dropdown-menu user-dropdown dropdown-menu-right",role:"menu"},void 0,(0,s.Z)("li",{className:"guest-preview"},void 0,(0,s.Z)("h4",{},void 0,gettext("You are browsing as guest.")),(0,s.Z)("p",{},void 0,gettext("Sign in or register to start and participate in discussions.")),e?(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-xs-12"},void 0,(0,s.Z)("a",{className:"btn btn-default btn-sign-in btn-block",href:i.Z.get("SETTINGS").LOGIN_URL},void 0,gettext("Sign in")))):(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-xs-6"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-sign-in btn-block",onClick:this.showSignInModal,type:"button"},void 0,gettext("Sign in"))),(0,s.Z)("div",{className:"col-xs-6"},void 0,(0,s.Z)(Ze,{className:"btn-primary btn-register btn-block"},void 0,gettext("Register"))))))}}]),n}(p().Component),ke=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return i.Z.get("SETTINGS").DELEGATE_AUTH?(0,s.Z)("div",{className:"nav nav-guest"},void 0,(0,s.Z)("a",{className:"btn navbar-btn btn-default btn-sign-in",href:i.Z.get("SETTINGS").LOGIN_URL},void 0,gettext("Sign in")),ve||(ve=(0,s.Z)("div",{className:"navbar-left"},void 0,(0,s.Z)(H,{})))):(0,s.Z)("div",{className:"nav nav-guest"},void 0,(0,s.Z)("button",{className:"btn navbar-btn btn-default btn-sign-in",onClick:this.showSignInModal,type:"button"},void 0,gettext("Sign in")),(0,s.Z)(Ze,{className:"navbar-btn btn-primary btn-register"},void 0,gettext("Register")),fe||(fe=(0,s.Z)("div",{className:"navbar-left"},void 0,(0,s.Z)(H,{}))))}}]),n}(Ne),xe=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showGuestMenu",value:function(){ye.Z.show(Ne)}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",onClick:this.showGuestMenu},void 0,me||(me=(0,s.Z)(h.ZP,{size:"64"})))}}]),n}(p().Component);var we,Re=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"setGravatar",(function(){t.callApi("gravatar")})),(0,f.Z)((0,v.Z)(t),"setGenerated",(function(){t.callApi("generated")})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"callApi",value:function(e){var t=this;if(this.state.isLoading)return!1;this.setState({isLoading:!0}),m.Z.post(this.props.user.api.avatar,{avatar:e}).then((function(e){t.setState({isLoading:!1}),Z.Z.success(e.detail),t.props.onComplete(e)}),(function(e){400===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))}},{key:"getGravatarButton",value:function(){return this.props.options.gravatar?(0,s.Z)(F.Z,{onClick:this.setGravatar,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-gravatar"},void 0,gettext("Download my Gravatar")):null}},{key:"getCropButton",value:function(){return this.props.options.crop_src?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-crop",disabled:this.state.isLoading,onClick:this.props.showCrop},void 0,gettext("Re-crop uploaded image")):null}},{key:"getUploadButton",value:function(){return this.props.options.upload?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-upload",disabled:this.state.isLoading,onClick:this.props.showUpload},void 0,gettext("Upload new image")):null}},{key:"getGalleryButton",value:function(){return this.props.options.galleries?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-gallery",disabled:this.state.isLoading,onClick:this.props.showGallery},void 0,gettext("Pick avatar from gallery")):null}},{key:"getAvatarPreview",value:function(){var e={id:this.props.user.id,avatars:this.props.options.avatars};return this.state.isLoading?(0,s.Z)("div",{className:"avatar-preview preview-loading"},void 0,(0,s.Z)(h.ZP,{size:"200",user:e}),_e||(_e=(0,s.Z)(C.Z,{}))):(0,s.Z)("div",{className:"avatar-preview"},void 0,(0,s.Z)(h.ZP,{size:"200",user:e}))}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-index"},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-5"},void 0,this.getAvatarPreview()),(0,s.Z)("div",{className:"col-md-7"},void 0,this.getGravatarButton(),(0,s.Z)(F.Z,{onClick:this.setGenerated,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-generate"},void 0,gettext("Generate my individual avatar")),this.getCropButton(),this.getUploadButton(),this.getGalleryButton())))}}]),i}(p().Component),Ce=n(19755);var Se,Ee=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"cropAvatar",(function(){if(t.state.isLoading)return!1;t.setState({isLoading:!0});var e=t.props.upload?"crop_tmp":"crop_src",n=Ce(".crop-form"),a=n.cropit("exportZoom"),i=n.cropit("offset");m.Z.post(t.props.user.api.avatar,{avatar:e,crop:{offset:{x:i.x*a,y:i.y*a},zoom:n.cropit("zoom")*a}}).then((function(e){t.props.onComplete(e),Z.Z.success(e.detail)}),(function(e){400===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))})),t.state={isLoading:!1,deviceRatio:1},t}return(0,r.Z)(i,[{key:"getAvatarSize",value:function(){return this.props.upload?this.props.options.crop_tmp.size:this.props.options.crop_src.size}},{key:"getImagePath",value:function(){return this.props.upload?this.props.dataUrl:this.props.options.crop_src.url}},{key:"componentDidMount",value:function(){for(var e=this,t=Ce(".crop-form"),n=this.getAvatarSize(),a=t.width();a<n;)n/=2;var i=this.getAvatarSize()/n;t.width(n),t.cropit({width:n,height:n,exportZoom:i,imageState:{src:this.getImagePath()},onImageLoaded:function(){if(e.props.upload){var n=t.cropit("zoom"),a=t.cropit("imageSize");if(a.width>a.height){var i=(a.width*n-e.getAvatarSize())/-2;t.cropit("offset",{x:i,y:0})}else if(a.width<a.height){var s=(a.height*n-e.getAvatarSize())/-2;t.cropit("offset",{x:0,y:s})}else t.cropit("offset",{x:0,y:0})}else{var o=e.props.options.crop_src.crop;o&&(t.cropit("zoom",o.zoom),t.cropit("offset",{x:o.x,y:o.y}))}}})}},{key:"componentWillUnmount",value:function(){Ce(".crop-form").cropit("disable")}},{key:"render",value:function(){return(0,s.Z)("div",{},void 0,we||(we=(0,s.Z)("div",{className:"modal-body modal-avatar-crop"},void 0,(0,s.Z)("div",{className:"crop-form"},void 0,(0,s.Z)("div",{className:"cropit-preview"}),(0,s.Z)("input",{type:"range",className:"cropit-image-zoom-input"})))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.cropAvatar,loading:this.state.isLoading,className:"btn-primary btn-block"},void 0,this.props.upload?gettext("Set avatar"):gettext("Crop image")),(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,gettext("Cancel")))))}}]),i}(p().Component),Pe=n(48772);var Le,Te=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"pickFile",(function(){document.getElementById("avatar-hidden-upload").click()})),(0,f.Z)((0,v.Z)(t),"uploadFile",(function(){var e=document.getElementById("avatar-hidden-upload").files[0];if(e){var n=t.validateFile(e);if(n)Z.Z.error(n);else{t.setState({image:e,preview:URL.createObjectURL(e),progress:0});var a=new FormData;a.append("avatar","upload"),a.append("image",e),m.Z.upload(t.props.user.api.avatar,a,(function(e){t.setState({progress:e})})).then((function(e){t.setState({options:e,uploaded:e.detail}),Z.Z.info(gettext("Your image has been uploaded and you may now crop it."))}),(function(e){400===e.status||413===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1,image:null,progress:0})):t.props.showError(e)}))}}})),t.state={image:null,preview:null,progress:0,uploaded:null,dataUrl:null},t}return(0,r.Z)(i,[{key:"validateFile",value:function(e){if(e.size>this.props.options.upload.limit)return interpolate(gettext("Selected file is too big. (%(filesize)s)"),{filesize:(0,Pe.Z)(e.size)},!0);var t=gettext("Selected file type is not supported.");if(-1===this.props.options.upload.allowed_mime_types.indexOf(e.type))return t;var n=!1,a=e.name.toLowerCase();return this.props.options.upload.allowed_extensions.map((function(e){a.substr(-1*e.length)===e&&(n=!0)})),!n&&t}},{key:"getUploadRequirements",value:function(e){var t=e.allowed_extensions.map((function(e){return e.substr(1)}));return interpolate(gettext("%(files)s files smaller than %(limit)s"),{files:t.join(", "),limit:(0,Pe.Z)(e.limit)},!0)}},{key:"getUploadButton",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,s.Z)(F.Z,{className:"btn-pick-file",onClick:this.pickFile},void 0,Se||(Se=(0,s.Z)("div",{className:"material-icon"},void 0,"input")),gettext("Select file")),(0,s.Z)("p",{className:"text-muted"},void 0,this.getUploadRequirements(this.props.options.upload)))}},{key:"getUploadProgressLabel",value:function(){return interpolate(gettext("%(progress)s % complete"),{progress:this.state.progress},!0)}},{key:"getUploadProgress",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,s.Z)("div",{className:"upload-progress"},void 0,(0,s.Z)("img",{src:this.state.preview}),(0,s.Z)("div",{className:"progress"},void 0,(0,s.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":"{this.state.progress}","aria-valuemin":"0","aria-valuemax":"100",style:{width:this.state.progress+"%"}},void 0,(0,s.Z)("span",{className:"sr-only"},void 0,this.getUploadProgressLabel())))))}},{key:"renderUpload",value:function(){return(0,s.Z)("div",{},void 0,(0,s.Z)("input",{type:"file",id:"avatar-hidden-upload",className:"hidden-file-upload",onChange:this.uploadFile}),this.state.image?this.getUploadProgress():this.getUploadButton(),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:!!this.state.image,className:"btn-default btn-block"},void 0,gettext("Cancel")))))}},{key:"renderCrop",value:function(){return(0,s.Z)(Ee,{options:this.state.options,user:this.props.user,upload:this.state.uploaded,dataUrl:this.state.preview,onComplete:this.props.onComplete,showError:this.props.showError,showIndex:this.props.showIndex})}},{key:"render",value:function(){return this.state.uploaded?this.renderCrop():this.renderUpload()}}]),i}(p().Component),Oe=n(69130);function Ae(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var Be,Ie,De,je=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(){var e;(0,o.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,f.Z)((0,v.Z)(e),"select",(function(){e.props.select(e.props.id)})),e}return(0,r.Z)(n,[{key:"getClassName",value:function(){return this.props.selection===this.props.id?this.props.disabled?"btn btn-avatar btn-disabled avatar-selected":"btn btn-avatar avatar-selected":this.props.disabled?"btn btn-avatar btn-disabled":"btn btn-avatar"}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",className:this.getClassName(),disabled:this.props.disabled,onClick:this.select},void 0,(0,s.Z)("img",{src:this.props.url}))}}]),n}(p().Component),ze=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"avatars-gallery"},void 0,(0,s.Z)("h3",{},void 0,this.props.name),(0,s.Z)("div",{className:"avatars-gallery-images"},void 0,(0,Oe.Z)(this.props.images,4,null).map((function(t,n){return(0,s.Z)("div",{className:"row"},n,t.map((function(t,n){return(0,s.Z)("div",{className:"col-xs-3"},n,t?p().createElement(je,(0,y.Z)({disabled:e.props.disabled,select:e.props.select,selection:e.props.selection},t)):Le||(Le=(0,s.Z)("div",{className:"blank-avatar"})))})))}))))}}]),n}(p().Component),Ue=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(e){var a;return(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"select",(function(e){a.setState({selection:e})})),(0,f.Z)((0,v.Z)(a),"save",(function(){if(a.state.isLoading)return!1;a.setState({isLoading:!0}),m.Z.post(a.props.user.api.avatar,{avatar:"galleries",image:a.state.selection}).then((function(e){a.setState({isLoading:!1}),Z.Z.success(e.detail),a.props.onComplete(e),a.props.showIndex()}),(function(e){400===e.status?(Z.Z.error(e.detail),a.setState({isLoading:!1})):a.props.showError(e)}))})),a.state={selection:null,isLoading:!1},a}return(0,r.Z)(n,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{},void 0,(0,s.Z)("div",{className:"modal-body modal-avatar-gallery"},void 0,this.props.options.galleries.map((function(t,n){return(0,s.Z)(ze,{name:t.name,images:t.images,selection:e.state.selection,disabled:e.state.isLoading,select:e.select},n)}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.save,loading:this.state.isLoading,disabled:!this.state.selection,className:"btn-primary btn-block"},void 0,this.state.selection?gettext("Save choice"):gettext("Select avatar")),(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,gettext("Cancel"))))))}}]),n}(p().Component),Me=n(3784),qe=n(6935),He=n(90287);function Fe(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var Ye,Ve,Ge,$e,We,Qe,Ke,Je,Xe,et,tt,nt,at=function(e){(0,l.Z)(n,e);var t=Fe(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"getErrorReason",value:function(){return this.props.reason?(0,s.Z)("p",{dangerouslySetInnerHTML:{__html:this.props.reason}}):null}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-body"},void 0,Be||(Be=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.props.message),this.getErrorReason(),(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}}]),n}(p().Component),it=function(e){(0,l.Z)(n,e);var t=Fe(n);function n(){var e;(0,o.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,f.Z)((0,v.Z)(e),"showError",(function(t){e.setState({error:t})})),(0,f.Z)((0,v.Z)(e),"showIndex",(function(){e.setState({component:Re})})),(0,f.Z)((0,v.Z)(e),"showUpload",(function(){e.setState({component:Te})})),(0,f.Z)((0,v.Z)(e),"showCrop",(function(){e.setState({component:Ee})})),(0,f.Z)((0,v.Z)(e),"showGallery",(function(){e.setState({component:Ue})})),(0,f.Z)((0,v.Z)(e),"completeFlow",(function(t){He.Z.dispatch((0,qe.n1)(e.props.user,t.avatars)),e.setState({component:Re,options:t})})),e}return(0,r.Z)(n,[{key:"componentDidMount",value:function(){var e=this;m.Z.get(this.props.user.api.avatar).then((function(t){e.setState({component:Re,options:t,error:null})}),(function(t){e.showError(t)}))}},{key:"getBody",value:function(){return this.state?this.state.error?(0,s.Z)(at,{message:this.state.error.detail,reason:this.state.error.reason}):(0,s.Z)(this.state.component,{options:this.state.options,user:this.props.user,onComplete:this.completeFlow,showError:this.showError,showIndex:this.showIndex,showCrop:this.showCrop,showUpload:this.showUpload,showGallery:this.showGallery}):Ie||(Ie=(0,s.Z)(Me.Z,{}))}},{key:"getClassName",value:function(){return this.state&&this.state.error?"modal-dialog modal-message modal-change-avatar":"modal-dialog modal-change-avatar"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,De||(De=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Change your avatar"))),this.getBody()))}}]),n}(p().Component);function st(e){return{user:e.auth.user}}function ot(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var rt=function(e){(0,l.Z)(n,e);var t=ot(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"changeAvatar",value:function(){ie.Z.show((0,a.$j)(st)(it))}},{key:"render",value:function(){var e=this.props.user;return(0,s.Z)("ul",{className:"dropdown-menu user-dropdown dropdown-menu-right",role:"menu"},void 0,(0,s.Z)("li",{className:"dropdown-header"},void 0,(0,s.Z)("strong",{},void 0,e.username),(0,s.Z)("div",{className:"row user-stats"},void 0,(0,s.Z)("div",{className:"col-sm-3"},void 0,Ye||(Ye=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),e.posts),(0,s.Z)("div",{className:"col-sm-3"},void 0,Ve||(Ve=(0,s.Z)("span",{className:"material-icon"},void 0,"forum")),e.threads),(0,s.Z)("div",{className:"col-sm-3"},void 0,Ge||(Ge=(0,s.Z)("span",{className:"material-icon"},void 0,"favorite")),e.followers),(0,s.Z)("div",{className:"col-sm-3"},void 0,$e||($e=(0,s.Z)("span",{className:"material-icon"},void 0,"favorite_outline")),e.following))),We||(We=(0,s.Z)("li",{className:"divider"})),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:e.url},void 0,Qe||(Qe=(0,s.Z)("span",{className:"material-icon"},void 0,"account_circle")),gettext("See your profile"))),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:i.Z.get("USERCP_URL")},void 0,Ke||(Ke=(0,s.Z)("span",{className:"material-icon"},void 0,"done_all")),gettext("Change options"))),(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn-link",onClick:this.changeAvatar,type:"button"},void 0,Je||(Je=(0,s.Z)("span",{className:"material-icon"},void 0,"portrait")),gettext("Change avatar"))),!!e.acl.can_use_private_threads&&(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:i.Z.get("PRIVATE_THREADS_URL")},void 0,Xe||(Xe=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),gettext("Private threads"),(0,s.Z)(lt,{user:e}))),et||(et=(0,s.Z)("li",{className:"divider"})),(0,s.Z)("li",{className:"dropdown-buttons"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block",onClick:function(){return document.getElementById("hidden-logout-form").submit()},type:"button"},void 0,gettext("Log out"))))}}]),n}(p().Component);function lt(e){var t=e.user;return t.unread_private_threads?(0,s.Z)("span",{className:"badge"},void 0,t.unread_private_threads):null}function ct(e){var t=e.user;return(0,s.Z)("ul",{className:"ul nav navbar-nav nav-user"},void 0,tt||(tt=(0,s.Z)("li",{},void 0,(0,s.Z)(H,{}))),(0,s.Z)(ut,{user:t}),(0,s.Z)("li",{className:"dropdown"},void 0,(0,s.Z)("a",{"aria-haspopup":"true","aria-expanded":"false",className:"dropdown-toggle","data-toggle":"dropdown",href:t.url,role:"button"},void 0,(0,s.Z)(h.ZP,{user:t,size:"64"})),(0,s.Z)(rt,{user:t})))}function ut(e){var t=e.user;if(!t.acl.can_use_private_threads)return null;var n;return n=t.unread_private_threads?gettext("You have unread private threads!"):gettext("Private threads"),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{className:"navbar-icon",href:i.Z.get("PRIVATE_THREADS_URL"),title:n},void 0,nt||(nt=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),t.unread_private_threads>0&&(0,s.Z)("span",{className:"badge"},void 0,t.unread_private_threads)))}function dt(e){return{user:e.auth.user}}var pt,ht,vt=function(e){(0,l.Z)(n,e);var t=ot(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showUserMenu",value:function(){ye.Z.showConnected("user-menu",(0,a.$j)(dt)(rt))}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",onClick:this.showUserMenu},void 0,(0,s.Z)(h.ZP,{user:this.props.user,size:"50"}))}}]),n}(p().Component);function ft(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var mt=function(e){(0,l.Z)(n,e);var t=ft(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return this.props.isAuthenticated?(0,s.Z)(ct,{user:this.props.user}):pt||(pt=(0,s.Z)(ke,{}))}}]),n}(p().Component),Zt=function(e){(0,l.Z)(n,e);var t=ft(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return this.props.isAuthenticated?(0,s.Z)(vt,{user:this.props.user}):ht||(ht=(0,s.Z)(xe,{}))}}]),n}(p().Component);function gt(e){return e.auth}var yt=n(4869);i.Z.addInitializer({name:"component:user-menu",initializer:function(){(0,yt.Z)((0,a.$j)(gt)(mt),"user-menu-mount"),(0,yt.Z)((0,a.$j)(gt)(Zt),"user-menu-compact-mount")},after:"store"})},77031:function(e,t,n){"use strict";var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37424),h=n(97326),v=n(4942),f=n(59131),m=n(69987),Z=n(94417),g=function(e,t){var n=e;return"rank"===t.component?n+=t.slug:n+=t.component,n+"/"},y=function(e){var t=e.baseUrl,n=e.page,s=e.pages;return(0,i.Z)("div",{className:"nav-container"},void 0,(0,i.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")),n.name),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,s.map((function(e){var n=g(t,e);return(0,i.Z)("li",{},n,(0,i.Z)(m.rU,{to:n},void 0,e.name))})))),(0,i.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,s.map((function(e){var n=g(t,e);return(0,i.Z)(Z.Z,{path:n},n,(0,i.Z)(m.rU,{to:n},void 0,e.name))}))))};var b,_,N=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getEmptyMessage",value:function(){return interpolate(gettext("No users have posted any new messages during last %(days)s days."),{days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getEmptyMessage())))}}]),u}(d().Component),k=n(19605),x=n(44039);var w=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,b||(b=(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(k.ZP,{size:"50"})))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("span",{className:"item-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,80)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-details"},void 0,(0,i.Z)("span",{className:"user-status"},void 0,_||(_=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:x.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"rank-name"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,50)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Total posts"))))}}]),u}(d().Component);var R,C=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead ui-preview"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(50,220)+"px"}},void 0," ")),(0,i.Z)("div",{className:"active-posters ui-preview"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,i.Z)(w,{hiddenOnMobile:e>0},e)}))))))}}]),u}(d().Component),S=n(24678),E=n(32233);var P=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getClassName",value:function(){return this.props.rank.css_class?"list-group-item list-group-rank-"+this.props.rank.css_class:"list-group-item"}},{key:"getUserStatus",value:function(){return this.props.user.status?(0,i.Z)(S.ZP,{user:this.props.user,status:this.props.user.status},void 0,(0,i.Z)(S.Jj,{user:this.props.user,status:this.props.user.status}),(0,i.Z)(S.pg,{user:this.props.user,status:this.props.user.status,className:"status-label hidden-xs hidden-sm"})):(0,i.Z)("span",{className:"user-status"},void 0,R||(R=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:x.e(30,50)+"px"}},void 0," "))}},{key:"getRankName",value:function(){if(!this.props.rank.is_tab)return(0,i.Z)("span",{className:"rank-name item-title"},void 0,this.props.rank.name);var e=E.Z.get("USERS_LIST_URL")+this.props.rank.slug+"/";return(0,i.Z)(m.rU,{to:e,className:"rank-name item-title"},void 0,this.props.rank.name)}},{key:"getUserTitle",value:function(){return this.props.user.title?(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,this.props.user.title):null}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("a",{href:this.props.user.url},void 0,(0,i.Z)(k.ZP,{user:this.props.user,size:50,size2x:64}))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("a",{href:this.props.user.url,className:"item-title"},void 0,this.props.user.username)),(0,i.Z)("div",{className:"user-details"},void 0,this.getUserStatus(),this.getRankName(),this.getUserTitle()),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.posts),(0,i.Z)("small",{},void 0,gettext("Total posts"))))}}]),u}(d().Component);var L=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getLeadMessage",value:function(){var e=ngettext("%(posters)s top poster from last %(days)s days.","%(posters)s top posters from last %(days)s days.",this.props.count);return interpolate(e,{posters:this.props.count,days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getLeadMessage()),(0,i.Z)("div",{className:"active-posters ui-ready"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,this.props.users.map((function(e,t){return(0,i.Z)(P,{user:e,rank:e.rank,counter:t+1},e.id)}))))))}}]),u}(d().Component),T=n(6935),O=n(55547),A=n(90287),B=n(53328);var I=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,s.Z)(this,u),t=a.call(this,e),(0,v.Z)((0,h.Z)(t),"update",(function(e){A.Z.dispatch((0,T.ZB)(e.results)),t.setState({isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count})})),E.Z.has("USERS")?t.initWithPreloadedData(E.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(),t}return(0,o.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count},A.Z.dispatch((0,T.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(){O.Z.start({poll:"active-posters",url:E.Z.get("USERS_API"),data:{list:"active"},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){B.Z.set({title:this.props.route.extra.name,parent:gettext("Users")})}},{key:"componentWillUnmount",value:function(){O.Z.stop("active-posters")}},{key:"render",value:function(){var e={name:this.props.route.extra.name};return this.state.isLoaded?this.state.count>0?(0,i.Z)(L,{page:e,users:this.props.users,trackedPeriod:this.state.trackedPeriod,count:this.state.count}):(0,i.Z)(N,{page:e,trackedPeriod:this.state.trackedPeriod}):(0,i.Z)(C,{page:e})}}]),u}(d().Component);var D,j=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getClassName",value:function(){return this.props.copy&&this.props.copy.length&&1===function(e,t){if(e=(e+"").toLowerCase(),(t=(t+"").toLowerCase()).length<=0)return 0;for(var n=0,a=0,i=t.length;(a=e.indexOf(t,a))>=0;)n+=1,a+=i;return n}(this.props.copy,"<p")&&-1===this.props.copy.indexOf("<br")?"page-lead lead":"page-lead"}},{key:"render",value:function(){return this.props.copy&&this.props.copy.length?(0,i.Z)("div",{className:this.getClassName(),dangerouslySetInnerHTML:{__html:this.props.copy}}):null}}]),u}(d().Component),z=n(40429),U=function(e){var t=e.users;return(0,i.Z)(z.Z,{cols:4,isReady:!0,showStatus:!0,users:t})};var M,q,H,F,Y,V,G,$,W,Q=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){var e;(0,s.Z)(this,u);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,v.Z)((0,h.Z)(e),"render",(function(){return D||(D=(0,i.Z)(z.Z,{cols:4,isReady:!1}))})),e}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}}]),u}(d().Component),K=Q,J=n(92490),X=function(e){var t=e.users;return t.more?(0,i.Z)("p",{},void 0,interpolate(ngettext("There is %(more)s more member with this role.","There are %(more)s more members with this role.",t.more),{more:t.more},!0)):(0,i.Z)("p",{},void 0,gettext("There are no more members with this role."))},ee=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t,title:gettext("Go to first page")},void 0,M||(M=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to first page"),type:"button",disabled:!0},void 0,q||(q=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+(n.previous>1?n.previous+"/":""),title:gettext("Go to previous page")},void 0,H||(H=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to previous page"),type:"button",disabled:!0},void 0,F||(F=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.next+"/",title:gettext("Go to next page")},void 0,Y||(Y=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to next page"),type:"button",disabled:!0},void 0,V||(V=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.last+"/",title:gettext("Go to last page")},void 0,G||(G=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to last page"),type:"button",disabled:!0},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))))},te=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)(J.o8,{},void 0,(0,i.Z)(J.Z2,{},void 0,(0,i.Z)(J.Eg,{},void 0,(0,i.Z)(ee,{baseUrl:t,users:n}))),(0,i.Z)(J.Z2,{auto:!0},void 0,(0,i.Z)(J.Eg,{},void 0,(0,i.Z)(X,{users:n}))))};var ne=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,s.Z)(this,u),t=a.call(this,e),(0,v.Z)((0,h.Z)(t),"update",(function(e){A.Z.dispatch((0,T.ZB)(e.results)),e.isLoaded=!0,t.setState(e)})),E.Z.has("USERS")?t.initWithPreloadedData(E.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(e.params.page||1),t}return(0,o.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state=Object.assign(e,{isLoaded:!0}),A.Z.dispatch((0,T.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){O.Z.start({poll:"rank-users",url:E.Z.get("USERS_API"),data:{rank:this.props.route.rank.id,page:e},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){B.Z.set({title:this.props.route.rank.name,page:this.props.params.page||null,parent:gettext("Users")})}},{key:"componentWillUnmount",value:function(){O.Z.stop("rank-users")}},{key:"componentWillReceiveProps",value:function(e){this.props.params.page!==e.params.page&&(B.Z.set({title:this.props.route.rank.name,page:e.params.page||null,parent:gettext("Users")}),this.setState({isLoaded:!1}),O.Z.stop("rank-users"),this.startPolling(e.params.page))}},{key:"getClassName",value:function(){return this.props.route.rank.css_class?"rank-users-list rank-users-"+this.props.route.rank.css_class:"rank-users-list"}},{key:"getRankDescription",value:function(){return this.props.route.rank.description?(0,i.Z)("div",{className:"rank-description"},void 0,(0,i.Z)(j,{copy:this.props.route.rank.description.html})):null}},{key:"getComponent",value:function(){return this.state.isLoaded?this.state.count>0?(0,i.Z)(U,{users:this.props.users}):(0,i.Z)("p",{className:"lead"},void 0,gettext("There are no users with this rank at the moment.")):W||(W=(0,i.Z)(K,{}))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName()},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:E.Z.get("USERS_LIST_URL"),page:{name:this.props.route.rank.name},pages:E.Z.get("USERS_LISTS")}),this.getRankDescription(),this.getComponent(),(0,i.Z)(te,{baseUrl:E.Z.get("USERS_LIST_URL")+this.props.route.rank.slug+"/",users:this.state})))}}]),u}(d().Component),ae=n(82125),ie=n(99755);var se=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-users-lists"},void 0,(0,i.Z)(ie.sP,{},void 0,(0,i.Z)(ie.mr,{styleName:"users-lists"},void 0,(0,i.Z)(ie.gC,{styleName:"users-lists"},void 0,(0,i.Z)("h1",{},void 0,gettext("Users"))))),this.props.children)}}]),u}(ae.Z);function oe(e){return{tick:e.tick.tick,user:e.auth.user,users:e.users}}function re(){var e=[];return E.Z.get("USERS_LISTS").forEach((function(t){"rank"===t.component?(e.push({path:E.Z.get("USERS_LIST_URL")+t.slug+"/:page/",component:(0,p.$j)(oe)(ne),rank:t}),e.push({path:E.Z.get("USERS_LIST_URL")+t.slug+"/",component:(0,p.$j)(oe)(ne),rank:t})):"active-posters"===t.component&&e.push({path:E.Z.get("USERS_LIST_URL")+t.component+"/",component:(0,p.$j)(oe)(I),extra:{name:t.name}})})),e}var le=n(39633);E.Z.addInitializer({name:"component:users",initializer:function(e){e.has("USERS_LISTS")&&(0,le.Z)({root:E.Z.get("USERS_LIST_URL"),component:se,paths:re()})},after:"store"})},97751:function(e,t,n){"use strict";var a=n(32233),i=n(96142);a.Z.addInitializer({name:"include",initializer:function(e){i.Z.init(e.get("STATIC_URL"))}})},76093:function(e,t,n){"use strict";var a=n(32233),i=n(62833);a.Z.addInitializer({name:"local-storage",initializer:function(){i.Z.init("misago_")}})},19764:function(e,t,n){"use strict";var a=n(32233),i=n(8621);a.Z.addInitializer({name:"dropdown",initializer:function(){var e=document.getElementById("mobile-navbar-dropdown-mount");e&&i.Z.init(e)},before:"store"})},47549:function(e,t,n){"use strict";var a=n(32233),i=n(59801);a.Z.addInitializer({name:"modal",initializer:function(){var e=document.getElementById("modal-mount");e&&i.Z.init(e)},before:"store"})},22331:function(e,t,n){"use strict";var a=n(30381),i=n.n(a),s=n(32233),o=n(19755);s.Z.addInitializer({name:"moment",initializer:function(){i().locale(o("html").attr("lang"))}})},21513:function(e,t,n){"use strict";var a=n(32233),i=n(53328);a.Z.addInitializer({name:"page-title",initializer:function(e){i.Z.init(e.get("SETTINGS").forum_index_title,e.get("SETTINGS").forum_name)}})},98749:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(53904),o=n(55547);a.Z.addInitializer({name:"polls",initializer:function(){o.Z.init(i.Z,s.Z)}})},98251:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(64646),o=n(53904);a.Z.addInitializer({name:"posting",initializer:function(){s.Z.init(i.Z,o.Z,document.getElementById("posting-mount"))}})},6720:function(e,t,n){"use strict";var a=n(32233),i=n(35486),s=n(90287);a.Z.addInitializer({name:"reducer:auth",initializer:function(e){s.Z.addReducer("auth",i.ZP,Object.assign({isAuthenticated:e.get("isAuthenticated"),isAnonymous:!e.get("isAuthenticated"),user:e.get("user")},i.E3))},before:"store"})},10846:function(e,t,n){"use strict";var a=n(32233),i=n(8154),s=n(90287);a.Z.addInitializer({name:"reducer:participants",initializer:function(){var e=null;a.Z.has("THREAD")&&(e=a.Z.get("THREAD").participants),s.Z.addReducer("participants",i.ZP,e||[])},before:"store"})},18255:function(e,t,n){"use strict";var a=n(32233),i=n(59752),s=n(90287);a.Z.addInitializer({name:"reducer:poll",initializer:function(){var e;e=a.Z.has("THREAD")&&a.Z.get("THREAD").poll?(0,i.ZB)(a.Z.get("THREAD").poll):{},s.Z.addReducer("poll",i.ZP,e)},before:"store"})},14113:function(e,t,n){"use strict";var a=n(32233),i=n(21981),s=n(90287);a.Z.addInitializer({name:"reducer:posts",initializer:function(){var e;e=a.Z.has("POSTS")?(0,i.ZB)(a.Z.get("POSTS")):{isLoaded:!1,isBusy:!1},s.Z.addReducer("posts",i.ZP,e)},before:"store"})},24444:function(e,t,n){"use strict";var a=n(32233),i=n(58598),s=n(90287);a.Z.addInitializer({name:"reducer:profile-details",initializer:function(){var e=null;a.Z.has("PROFILE_DETAILS")&&(e=a.Z.get("PROFILE_DETAILS")),s.Z.addReducer("profile-details",i.ZP,e||{})},before:"store"})},1764:function(e,t,n){"use strict";var a=n(32233),i=n(27519),s=n(90287);a.Z.addInitializer({name:"reducer:profile-hydrate",initializer:function(){a.Z.has("PROFILE")&&s.Z.dispatch((0,i.ZB)(a.Z.get("PROFILE")))},after:"store"})},68351:function(e,t,n){"use strict";var a=n(32233),i=n(27519),s=n(90287);a.Z.addInitializer({name:"reducer:profile",initializer:function(){s.Z.addReducer("profile",i.ZP,{})},before:"store"})},81521:function(e,t,n){"use strict";var a=n(32233),i=n(16427),s=n(90287);a.Z.addInitializer({name:"reducer:search",initializer:function(){s.Z.addReducer("search",i.ZP,Object.assign({},i.E3,{providers:a.Z.get("SEARCH_PROVIDERS")||[],query:a.Z.get("SEARCH_QUERY")||""}))},before:"store"})},19984:function(e,t,n){"use strict";var a=n(32233),i=n(77751),s=n(90287);a.Z.addInitializer({name:"reducer:selection",initializer:function(){s.Z.addReducer("selection",i.ZP,[])},before:"store"})},41229:function(e,t,n){"use strict";var a=n(32233),i=n(27346),s=n(90287);a.Z.addInitializer({name:"reducer:snackbar",initializer:function(){s.Z.addReducer("snackbar",i.ZP,i.E3)},before:"store"})},43589:function(e,t,n){"use strict";var a=n(32233),i=n(7738),s=n(90287);a.Z.addInitializer({name:"reducer:thread",initializer:function(){var e;e=a.Z.has("THREAD")?(0,i.ZB)(a.Z.get("THREAD")):{isBusy:!1},s.Z.addReducer("thread",i.ZP,e)},before:"store"})},24108:function(e,t,n){"use strict";var a=n(32233),i=n(61340),s=n(90287);a.Z.addInitializer({name:"reducer:threads",initializer:function(){s.Z.addReducer("threads",i.ZP,[])},before:"store"})},33934:function(e,t,n){"use strict";var a=n(32233),i=n(85586),s=n(90287);a.Z.addInitializer({name:"reducer:tick",initializer:function(){s.Z.addReducer("tick",i.ZP,i.E3)},before:"store"})},85577:function(e,t,n){"use strict";var a=n(32233),i=n(48927),s=n(90287);a.Z.addInitializer({name:"reducer:username-history",initializer:function(){s.Z.addReducer("username-history",i.ZP,[])},before:"store"})},83526:function(e,t,n){"use strict";var a=n(32233),i=n(6935),s=n(90287);a.Z.addInitializer({name:"reducer:users",initializer:function(){s.Z.addReducer("users",i.ZP,[])},before:"store"})},43060:function(e,t,n){"use strict";var a=n(32233),i=n(53904),s=n(90287);a.Z.addInitializer({name:"snackbar",initializer:function(){i.Z.init(s.Z)},after:"store"})},92292:function(e,t,n){"use strict";var a=n(32233),i=n(90287);a.Z.addInitializer({name:"store",initializer:function(){i.Z.init()},before:"_end"})},33409:function(e,t,n){"use strict";var a=n(32233),i=n(85586),s=n(90287);a.Z.addInitializer({name:"tick-start",initializer:function(){window.setInterval((function(){s.Z.dispatch((0,i.bq)())}),5e4)},after:"store"})},31341:function(e,t,n){"use strict";var a=n(32233),i=n(96142),s=n(59940);a.Z.addInitializer({name:"zxcvbn",initializer:function(){s.Z.init(i.Z)}})},35486:function(e,t,n){"use strict";n.d(t,{E3:function(){return i},ZP:function(){return d},r$:function(){return l},w7:function(){return u},zB:function(){return c}});var a=n(6935),i={signedIn:!1,signedOut:!1},s="PATCH_USER",o="SIGN_IN",r="SIGN_OUT";function l(e){return{type:s,patch:e}}function c(e){return{type:o,user:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:r,soft:e}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:var n=Object.assign({},e);return n.user=Object.assign({},e.user,t.patch),n;case o:return Object.assign({},e,{signedIn:t.user});case r:return Object.assign({},e,{isAuthenticated:!1,isAnonymous:!0,signedOut:!t.soft});case a.oB:if(e.isAuthenticated&&e.user.id===t.userId){var l=Object.assign({},e);return l.user=Object.assign({},e.user,{avatars:t.avatars}),l}return e;case a.D9:if(e.isAuthenticated&&e.user.id===t.userId){var c=Object.assign({},e);return c.user=Object.assign({},e.user,{username:t.username,slug:t.slug}),c}return e;default:return e}}},8154:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s},gx:function(){return i}});var a="REPLACE_PARTICIPANTS";function i(e){return{type:a,state:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.state:e}},59752:function(e,t,n){"use strict";n.d(t,{Ar:function(){return p},Od:function(){return v},ZB:function(){return u},ZH:function(){return r},ZP:function(){return f},b9:function(){return l},gx:function(){return h},n6:function(){return d}});var a=n(30381),i=n.n(a),s="BUSY_POLL",o="RELEASE_POLL",r="REMOVE_POLL",l="REPLACE_POLL",c="UPDATE_POLL";function u(e){var t=!1;for(var n in e.choices)if(e.choices[n].selected){t=!0;break}return Object.assign({},e,{posted_on:i()(e.posted_on),hasSelectedChoices:t,endsOn:e.length?i()(e.posted_on).add(e.length,"days"):null,isBusy:!1})}function d(){return{type:s}}function p(){return{type:o}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:u(e)}}function v(){return{type:r}}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:return Object.assign({},e,{isBusy:!0});case o:return Object.assign({},e,{isBusy:!1});case r:return{isBusy:!1};case l:return t.state;case c:return Object.assign({},e,t.data);default:return e}}},92747:function(e,t,n){"use strict";n.d(t,{Qu:function(){return o},ZB:function(){return r},ZP:function(){return u},r$:function(){return c}});var a=n(30381),i=n.n(a),s=n(6935),o="PATCH_POST";function r(e){return Object.assign({},e,{posted_on:i()(e.posted_on),updated_on:i()(e.updated_on),hidden_on:i()(e.hidden_on),attachments:e.attachments?e.attachments.map(l):null,poster:e.poster?(0,s.Ru)(e.poster):null,isSelected:!1,isBusy:!1,isDeleted:!1})}function l(e){return Object.assign({},e,{uploaded_on:i()(e.uploaded_on)})}function c(e,t){return{type:o,post:e,patch:t}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===o&&e.id==t.post.id?Object.assign({},e,t.patch):e}},21981:function(e,t,n){"use strict";n.d(t,{R3:function(){return m},Rz:function(){return Z},Vx:function(){return g},Ys:function(){return d},ZB:function(){return v},ZP:function(){return y},_H:function(){return p},kR:function(){return h},zD:function(){return f}});var a=n(92747),i="APPEND_POSTS",s="SELECT_POST",o="DESELECT_POST",r="DESELECT_POSTS",l="LOAD_POSTS",c="UNLOAD_POSTS",u="UPDATE_POSTS";function d(e){return{type:s,post:e}}function p(e){return{type:o,post:e}}function h(){return{type:r}}function v(e){return Object.assign({},e,{results:e.results.map(a.ZB),isLoaded:!0,isBusy:!1,isSelected:!1})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:v(e)}}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:i,state:t?e:v(e)}}function Z(){return{type:c}}function g(e){return{type:u,update:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:var n=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!0}):e}));return Object.assign({},e,{results:n});case o:var d=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!1}):e}));return Object.assign({},e,{results:d});case r:var p=e.results.map((function(e){return Object.assign({},e,{isSelected:!1})}));return Object.assign({},e,{results:p});case i:var h=e.results.slice(),v=e.results.map((function(e){return e.id}));return t.state.results.map((function(e){-1===v.indexOf(e.id)&&h.push(e)})),Object.assign({},t.state,{results:h});case l:return t.state;case c:return Object.assign({},e,{isLoaded:!1});case u:return Object.assign({},e,t.update);case a.Qu:var f=e.results.map((function(e){return(0,a.ZP)(e,t)}));return Object.assign({},e,{results:f});default:return e}}},58598:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s},zD:function(){return i}});var a="LOAD_DETAILS";function i(e){return{type:a,newState:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.newState:e}},27519:function(e,t,n){"use strict";n.d(t,{ZB:function(){return l},ZP:function(){return u},r$:function(){return c}});var a=n(30381),i=n.n(a),s=n(6935),o="HYDRATE_PROFILE",r="PATCH_PROFILE";function l(e){return{type:o,profile:e}}function c(e){return{type:r,patch:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return Object.assign({},t.profile,{joined_on:i()(t.profile.joined_on),status:(0,s.$q)(t.profile.status)});case r:return Object.assign({},e,t.patch);case s.oB:return e.id===t.userId?Object.assign({},e,{avatars:t.avatars}):e;case s.D9:return e.id===t.userId?Object.assign({},e,{username:t.username,slug:t.slug}):e;default:return e}}},16427:function(e,t,n){"use strict";n.d(t,{E3:function(){return o},P0:function(){return l},Vx:function(){return r},ZP:function(){return c}});var a="REPLACE_SEARCH",i="UPDATE_SEARCH",s="UPDATE_SEARCH_PROVIDER",o={isLoading:!1,query:"",providers:[]};function r(e){return{type:i,update:e}}function l(e){return{type:s,provider:e}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case a:return t.state;case i:return Object.assign({},e,t.update);case s:return Object.assign({},e,{providers:e.providers.map((function(e){return e.id===t.provider.id?t.provider:e}))});default:return e}}},77751:function(e,t,n){"use strict";n.d(t,{$6:function(){return r},YP:function(){return l},ZP:function(){return u},wc:function(){return c}});var a=n(20370),i="SELECT_ALL",s="SELECT_NONE",o="SELECT_ITEM";function r(e){return{type:i,items:e}}function l(){return{type:s}}function c(e){return{type:o,item:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case i:return t.items;case s:return[];case o:return(0,a.ZN)(e,t.item);default:return e}}},27346:function(e,t,n){"use strict";n.d(t,{E3:function(){return a},OV:function(){return o},ZP:function(){return l},p2:function(){return r}});var a={type:"info",message:"",isVisible:!1},i="SHOW_SNACKBAR",s="HIDE_SNACKBAR";function o(e,t){return{type:i,message:e,messageType:t}}function r(){return{type:s}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?{type:t.messageType,message:t.message,isVisible:!0}:t.type===s?Object.assign({},e,{isVisible:!1}):e}},7738:function(e,t,n){"use strict";n.d(t,{Ar:function(){return h},Vx:function(){return f},ZB:function(){return d},ZP:function(){return Z},gx:function(){return v},n6:function(){return p},y8:function(){return m}});var a=n(30381),i=n.n(a),s=n(59752),o="BUSY_THREAD",r="RELEASE_THREAD",l="REPLACE_THREAD",c="UPDATE_THREAD",u="UPDATE_THREAD_ACL";function d(e){return Object.assign({},e,{started_on:i()(e.started_on),last_post_on:i()(e.last_post_on),best_answer_marked_on:e.best_answer_marked_on?i()(e.best_answer_marked_on):null,isBusy:!1})}function p(){return{type:o}}function h(){return{type:r}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:d(e)}}function f(e){return{type:c,data:e}}function m(e){return{type:u,data:e}}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return Object.assign({},e,{isBusy:!0});case r:return Object.assign({},e,{isBusy:!1});case s.ZH:return Object.assign({},e,{poll:null});case s.b9:return Object.assign({},e,{poll:t.state});case l:return t.state;case c:return Object.assign({},e,t.data);case u:var n=Object.assign({},e.acl,t.data);return Object.assign({},e,{acl:n});default:return e}}},61340:function(e,t,n){"use strict";n.d(t,{R3:function(){return h},V8:function(){return f},ZB:function(){return m},ZP:function(){return y},l8:function(){return v},r$:function(){return Z}});var a=n(30381),i=n.n(a),s=n(89759),o="APPEND_THREADS",r="DELETE_THREAD",l="FILTER_THREADS",c="HYDRATE_THREADS",u="PATCH_THREAD",d="SORT_THREADS",p=["can_announce","can_approve","can_close","can_hide","can_move","can_merge","can_pin","can_review"];function h(e,t){return{type:o,items:e,sorting:t}}function v(e){return{type:r,thread:e}}function f(e,t){return{type:l,category:e,categoriesMap:t}}function m(e){return{type:c,items:e}}function Z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:u,thread:e,patch:t,sorting:n}}function g(e){return Object.assign({},e,{started_on:i()(e.started_on),last_post_on:i()(e.last_post_on),moderation:(t=e.acl,n=[],p.forEach((function(e){t[e]&&n.push(e)})),n)});var t,n}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:var n=(0,s.Z)(t.items.map(g),e);return n.sort(t.sorting);case r:return e.filter((function(e){return e.id!==t.thread.id}));case l:return e.filter((function(e){var n=t.categoriesMap[e.category];return n.lft>=t.category.lft&&n.rght<=t.category.rght||2==e.weight}));case c:return t.items.map(g);case u:var a=e.map((function(e){return e.id===t.thread.id?Object.assign({},e,t.patch):e}));return t.sorting?a.sort(t.sorting):a;case d:return e.sort(t.sorting);default:return e}}},85586:function(e,t,n){"use strict";n.d(t,{E3:function(){return a},ZP:function(){return o},bq:function(){return s}});var a={tick:0},i="TICK";function s(){return{type:i}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?Object.assign({},e,{tick:e.tick+1}):e}},48927:function(e,t,n){"use strict";n.d(t,{KP:function(){return u},R3:function(){return d},ZB:function(){return p},ZP:function(){return v}});var a=n(30381),i=n.n(a),s=n(6935),o=n(89759),r="ADD_NAME_CHANGE",l="APPEND_HISTORY",c="HYDRATE_HISTORY";function u(e,t,n){return{type:r,change:e,user:t,changedBy:n}}function d(e){return{type:l,items:e}}function p(e){return{type:c,items:e}}function h(e){return Object.assign({},e,{changed_on:i()(e.changed_on)})}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:var n=e.slice();return n.unshift({id:Math.floor(Date.now()/1e3),changed_by:t.changedBy,changed_by_username:t.changedBy.username,changed_on:i()(),new_username:t.change.username,old_username:t.user.username}),n;case l:return(0,o.Z)(e,t.items.map(h));case c:return t.items.map(h);case s.oB:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{avatars:t.avatars})),e}));case s.D9:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{username:t.username,slug:t.slug})),Object.assign({},e)}));default:return e}}},6935:function(e,t,n){"use strict";n.d(t,{$q:function(){return p},D9:function(){return c},R3:function(){return u},Ru:function(){return h},ZB:function(){return d},ZP:function(){return m},_S:function(){return f},n1:function(){return v},oB:function(){return l}});var a=n(30381),i=n.n(a),s=n(89759),o="APPEND_USERS",r="HYDRATE_USERS",l="UPDATE_AVATAR",c="UPDATE_USERNAME";function u(e){return{type:o,items:e}}function d(e){return{type:r,items:e}}function p(e){return e?Object.assign({},e,{last_click:e.last_click?i()(e.last_click):null,banned_until:e.banned_until?i()(e.banned_until):null}):null}function h(e){return Object.assign({},e,{joined_on:i()(e.joined_on),status:p(e.status)})}function v(e,t){return{type:l,userId:e.id,avatars:t}}function f(e,t,n){return{type:c,userId:e.id,username:t,slug:n}}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return(0,s.Z)(e,t.items.map(h));case r:return t.items.map(h);case l:return e.map((function(e){return(e=Object.assign({},e)).id===t.userId&&(e.avatars=t.avatars),e}));default:return e}}},78657:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(19755),o=function(){function e(){(0,a.Z)(this,e),this._cookieName=null,this._csrfToken=null,this._locks={}}return(0,i.Z)(e,[{key:"init",value:function(e){this._cookieName=e}},{key:"getCsrfToken",value:function(){if(-1!==document.cookie.indexOf(this._cookieName)){var e=new RegExp(this._cookieName+"=([^;]*)"),t=document.cookie.match(e)[0];return t?t.split("=")[1]:null}return null}},{key:"request",value:function(e,t,n){var a=this;return new Promise((function(i,o){var r={url:t,method:e,headers:{"X-CSRFToken":a.getCsrfToken()},data:n?JSON.stringify(n):null,contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=gettext("Lost connection with application.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=gettext("Action link is invalid."))),500!==t.status||t.detail||(t.detail=gettext("Unknown error has occured.")),t.statusText=e.statusText,o(t)}};s.ajax(r)}))}},{key:"get",value:function(e,t,n){if(t&&(e+="?"+s.param(t)),n){var a=this;return this._locks[n]&&(this._locks[n].url=e),this._locks[n]&&this._locks[n].waiter?{then:function(){}}:this._locks[n]&&this._locks[n].wait?(this._locks[n].waiter=!0,new Promise((function(t,i){var s=function e(s){a._locks[n].wait?window.setTimeout((function(){e(s)}),300):a._locks[n].url!==s?e(a._locks[n].url):(a._locks[n].waiter=!1,a.request("GET",a._locks[n].url).then((function(i){a._locks[n].url===s?t(i):(a._locks[n].waiter=!0,e(a._locks[n].url))}),(function(t){a._locks[n].url===s?i(t):(a._locks[n].waiter=!0,e(a._locks[n].url))})))};window.setTimeout((function(){s(e)}),300)}))):(this._locks[n]={url:e,wait:!0,waiter:!1},new Promise((function(t,i){a.request("GET",e).then((function(i){a._locks[n].wait=!1,a._locks[n].url===e&&t(i)}),(function(t){a._locks[n].wait=!1,a._locks[n].url===e&&i(t)}))})))}return this.request("GET",e)}},{key:"post",value:function(e,t){return this.request("POST",e,t)}},{key:"patch",value:function(e,t){return this.request("PATCH",e,t)}},{key:"put",value:function(e,t){return this.request("PUT",e,t)}},{key:"delete",value:function(e,t){return this.request("DELETE",e,t)}},{key:"upload",value:function(e,t,n){var a=this;return new Promise((function(i,o){var r={url:e,method:"POST",headers:{"X-CSRFToken":a.getCsrfToken()},data:t,contentType:!1,processData:!1,xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",(function(e){e.lengthComputable&&n(Math.round(e.loaded/e.total*100))}),!1),e},success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=gettext("Lost connection with application.")),413!==t.status||t.detail||(t.detail=gettext("Upload was rejected by server as too large.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=gettext("Action link is invalid."))),500!==t.status||t.detail||(t.detail=gettext("Unknown error has occured.")),t.statusText=e.statusText,o(t)}};s.ajax(r)}))}}]),e}();t.Z=new o},98274:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(35486),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){this._store=e,this._local=t,this._modal=n,this.syncSession(),this.watchState()}},{key:"syncSession",value:function(){var e=this._store.getState().auth;e.isAuthenticated?this._local.set("auth",{isAuthenticated:!0,username:e.user.username}):this._local.set("auth",{isAuthenticated:!1})}},{key:"watchState",value:function(){var e=this,t=this._store.getState().auth;this._local.watch("auth",(function(n){n.isAuthenticated?e._store.dispatch((0,s.zB)({username:n.username})):t.isAuthenticated&&e._store.dispatch((0,s.w7)())})),this._modal.hide()}},{key:"signIn",value:function(e){this._store.dispatch((0,s.zB)(e)),this._local.set("auth",{isAuthenticated:!0,username:e.username}),this._modal.hide()}},{key:"signOut",value:function(){this._store.dispatch((0,s.w7)()),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}},{key:"softSignOut",value:function(){this._store.dispatch((0,s.w7)(!0)),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}}]),e}();t.Z=new o},93825:function(e,t,n){"use strict";var a,i=n(22928),s=n(79340),o=n(6215),r=n(61120),l=n(15671),c=n(43144),u=n(57588),d=n.n(u),p=n(96359);function h(e){var t=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(e){return!1}}();return function(){var n,a=(0,r.Z)(e);if(t){var i=(0,r.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,o.Z)(this,n)}}var v=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){this._context=e,this._ajax=t,this._include=n,this._snackbar=a}}]),e}(),f=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return new Promise((function(e){e()}))}},{key:"validator",value:function(){return null}},{key:"component",value:function(){return null}}]),n}(v),m=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){var e=this;return new Promise((function(t,n){e._ajax.get(e._context.get("CAPTCHA_API")).then((function(n){e.question=n.question,e.helpText=n.help_text,t()}),(function(){e._snackbar.error(gettext("Failed to load CAPTCHA.")),n()}))}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:this.question,for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:this.helpText||null},void 0,(0,i.Z)("input",{"aria-describedby":"id_captcha_status",className:"form-control",disabled:e.form.state.isLoading,id:"id_captcha",onChange:e.form.bindInput("captcha"),type:"text",value:e.form.state.captcha}))}}]),n}(v),Z=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e=this;grecaptcha.render("recaptcha",{sitekey:this.props.siteKey,callback:function(t){e.props.binding({target:{value:t}})}})}},{key:"render",value:function(){return a||(a=(0,i.Z)("div",{id:"recaptcha"}))}}]),n}(d().Component),g=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return this._include.include("https://www.google.com/recaptcha/api.js",!0),new Promise((function(e){!function t(){"undefined"==typeof grecaptcha?window.setTimeout((function(){t()}),200):e()}()}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:gettext("Please solve the quick test"),for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:gettext("This test helps us prevent automated spam registrations on our site.")},void 0,(0,i.Z)(Z,{binding:e.form.bindInput("captcha"),siteKey:this._context.get("SETTINGS").recaptcha_site_key}))}}]),n}(v),y=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){switch(e.get("SETTINGS").captcha_type){case"no":this._captcha=new f;break;case"qa":this._captcha=new m;break;case"re":this._captcha=new g}this._captcha.init(e,t,n,a)}},{key:"load",value:function(){return this._captcha.load()}},{key:"validator",value:function(){return this._captcha.validator()}},{key:"component",value:function(e){return this._captcha.component(e)}}]),e}();t.ZP=new y},96142:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(19755),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._staticUrl=e,this._included=[]}},{key:"include",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];-1===this._included.indexOf(e)&&(this._included.push(e),this._include(e,t))}},{key:"_include",value:function(e,t){s.ajax({url:(t?"":this._staticUrl)+e,cache:!0,dataType:"script"})}}]),e}();t.Z=new o},62833:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=window.localStorage,o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._prefix=e,this._watchers=[],window.addEventListener("storage",(function(e){var n=JSON.parse(e.newValue);t._watchers.forEach((function(t){t.key===e.key&&e.oldValue!==e.newValue&&t.callback(n)}))}))}},{key:"set",value:function(e,t){s.setItem(this._prefix+e,JSON.stringify(t))}},{key:"get",value:function(e){var t=s.getItem(this._prefix+e);return t?JSON.parse(t):null}},{key:"watch",value:function(e,t){this._watchers.push({key:this._prefix+e,callback:t})}}]),e}();t.Z=new o},8621:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(4869),o=n(19755),r=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._element=e,this._component=null}},{key:"show",value:function(e){this._component===e?this.hide():(this._component=e,(0,s.Z)(e,this._element.id),o(this._element).addClass("open"))}},{key:"showConnected",value:function(e,t){this._component===e?this.hide():(this._component=e,(0,s.Z)(t,this._element.id,!0),o(this._element).addClass("open"))}},{key:"hide",value:function(){o(this._element).removeClass("open"),this._component=null}}]),e}();t.Z=new r},59801:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(73935),o=n.n(s),r=n(4869),l=n(19755),c=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._element=e,this._modal=l(e).modal({show:!1}),this._modal.on("hidden.bs.modal",(function(){o().unmountComponentAtNode(t._element)}))}},{key:"show",value:function(e){(0,r.Z)(e,this._element.id),this._modal.modal("show")}},{key:"hide",value:function(){this._modal.modal("hide")}}]),e}();t.Z=new c},53328:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._indexTitle=e,this._forumName=t}},{key:"set",value:function(e){if(e){"string"==typeof e&&(e={title:e});var t=e.title;e.page>1&&(t+=" ("+interpolate(gettext("page: %(page)s"),{page:e.page},!0)+")"),e.parent&&(t+=" | "+e.parent),document.title=t+" | "+this._forumName}else document.title=this._indexTitle||this._forumName}}]),e}();t.Z=new s},55547:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._ajax=e,this._snackbar=t,this._polls={}}},{key:"start",value:function(e){var t=this;this.stop(e.poll);var n=function n(){t._polls[e.poll]=e,t._ajax.get(e.url,e.data||null).then((function(a){t._polls[e.poll]._stopped||(e.update(a),t._polls[e.poll].timeout=window.setTimeout(n,e.frequency))}),(function(n){t._polls[e.poll]._stopped||(e.error?e.error(n):t._snackbar.apiError(n))}))};e.delayed?this._polls[e.poll]={timeout:window.setTimeout(n,e.frequency)}:n()}},{key:"stop",value:function(e){this._polls[e]&&(window.clearTimeout(this._polls[e].timeout),this._polls[e]._stopped=!0)}}]),e}();t.Z=new s},64646:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(4942),o=n(57588),r=n.n(o),l=n(73935),c=n.n(l),u=n(78107),d=n(4869),p=function(){function e(){var t=this;(0,a.Z)(this,e),(0,s.Z)(this,"close",(function(){t._isOpen&&!t._isClosing&&(t._isClosing=!0,t._mount.classList.remove("show"),window.setTimeout((function(){c().unmountComponentAtNode(t._mount),t._observer.unobserve(t._mount),t._spacer.style.height="0px;",t._isClosing=!1,t._isOpen=!1,t._mode=null}),300))}))}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){var a=this;this._ajax=e,this._snackbar=t,this._mount=n,this._mode=null,this._spacer=document.getElementById("posting-spacer"),this._observer=new ResizeObserver((function(e){a._spacer.style.height=e[0].contentRect.height+"px"})),this._isOpen=!1,this._isClosing=!1}},{key:"isOpen",value:function(){return this._isOpen}},{key:"open",value:function(e){if(!1===this._isOpen)this._mode=e.mode,this._isOpen=e.submit,this._realOpen(e);else if(this._isOpen!==e.submit){var t=gettext("You are already working on other message. Do you want to discard it?");window.confirm(t)&&(this._mode=e.mode,this._isOpen=e.submit,this._realOpen(e))}else"REPLY"==this._mode&&"REPLY"==e.mode&&this._realOpen(e)}},{key:"_realOpen",value:function(e){(0,d.Z)(r().createElement(u.ZP,e),this._mount.id),this._mount.classList.add("show"),this._observer.observe(this._mount)}}]),e}();t.Z=new p},53904:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(27346),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._store=e,this._timeout=null}},{key:"alert",value:function(e,t){var n=this;this._timeout?(window.clearTimeout(this._timeout),this._store.dispatch((0,s.p2)()),this._timeout=window.setTimeout((function(){n._timeout=null,n.alert(e,t)}),300)):(this._store.dispatch((0,s.OV)(e,t)),this._timeout=window.setTimeout((function(){n._store.dispatch((0,s.p2)()),n._timeout=null}),5e3))}},{key:"info",value:function(e){this.alert(e,"info")}},{key:"success",value:function(e){this.alert(e,"success")}},{key:"warning",value:function(e){this.alert(e,"warning")}},{key:"error",value:function(e){this.alert(e,"error")}},{key:"apiError",value:function(e){var t=e.detail;t||(t=404===e.status?gettext("Action link is invalid."):gettext("Unknown error has occured.")),403===e.status&&"Permission denied"===t&&(t=gettext("You don't have permission to perform this action.")),this.error(t)}}]),e}();t.Z=new o},90287:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(41438),o=function(){function e(){(0,a.Z)(this,e),this._store=null,this._reducers={},this._initialState={}}return(0,i.Z)(e,[{key:"addReducer",value:function(e,t,n){this._reducers[e]=t,this._initialState[e]=n}},{key:"init",value:function(){this._store=(0,s.createStore)((0,s.combineReducers)(this._reducers),this._initialState)}},{key:"getStore",value:function(){return this._store}},{key:"getState",value:function(){return this._store.getState()}},{key:"dispatch",value:function(e){return this._store.dispatch(e)}}]),e}();t.Z=new o},59940:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._include=e,this._isLoaded=!1}},{key:"scorePassword",value:function(e,t){return this._isLoaded?zxcvbn(e,t).score:0}},{key:"load",value:function(){return this._isLoaded?this._loadedPromise():(this._include.include("misago/js/zxcvbn.js"),this._loadingPromise())}},{key:"_loadingPromise",value:function(){var e=this;return new Promise((function(t,n){!function a(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(i+=1)>200?n():"undefined"==typeof zxcvbn?window.setTimeout((function(){a(i)}),200):(e._isLoaded=!0,t())}()}))}},{key:"_loadedPromise",value:function(){return new Promise((function(e){e()}))}}]),e}();t.Z=new s},93051:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var a,i=n(22928),s=n(30381),o=n.n(s),r=n(57588),l=n.n(r),c=n(73935),u=n.n(c),d=n(37424),p=n(15671),h=n(43144),v=n(79340),f=n(6215),m=n(61120);var Z=function(e){(0,v.Z)(r,e);var t,n,s=(t=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(e){return!1}}(),function(){var e,a=(0,m.Z)(t);if(n){var i=(0,m.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,f.Z)(this,e)});function r(){return(0,p.Z)(this,r),s.apply(this,arguments)}return(0,h.Z)(r,[{key:"getReasonMessage",value:function(){return this.props.message.html?(0,i.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.props.message.html}}):(0,i.Z)("p",{className:"lead"},void 0,this.props.message.plain)}},{key:"getExpirationMessage",value:function(){if(this.props.expires){if(this.props.expires.isAfter(o()())){var e=interpolate(gettext("This ban expires on %(expires_on)s."),{expires_on:this.props.expires.format("LL, LT")},!0),t=interpolate(gettext("This ban expires %(expires_on)s."),{expires_on:this.props.expires.fromNow()},!0);return(0,i.Z)("abbr",{title:e},void 0,t)}return gettext("This ban has expired.")}return gettext("This ban is permanent.")}},{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-error page-error-banned"},void 0,(0,i.Z)("div",{className:"container"},void 0,(0,i.Z)("div",{className:"message-panel"},void 0,a||(a=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"highlight_off"))),(0,i.Z)("div",{className:"message-body"},void 0,this.getReasonMessage(),(0,i.Z)("p",{className:"message-footnote"},void 0,this.getExpirationMessage())))))}}]),r}(l().Component),g=n(32233),y=n(90287),b=(0,d.$j)((function(e){return e.tick}))(Z);function _(e,t){if(u().render((0,i.Z)(d.zt,{store:y.Z.getStore()},void 0,(0,i.Z)(b,{message:e.message,expires:e.expires_on?o()(e.expires_on):null})),document.getElementById("page-mount")),void 0===t||t){var n=g.Z.get("SETTINGS").forum_name;document.title=gettext("You are banned")+" | "+n,window.history.pushState({},"",g.Z.get("BANNED_URL"))}}},69130:function(e,t,n){"use strict";function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],i=[];if(e.forEach((function(e){i.push(e),i.length===t&&(a.push(i),i=[])})),!1!==n&&i.length>0&&i.length<t)for(var s=i.length;s<t;s++)i.push(n);return i.length&&a.push(i),a}n.d(t,{Z:function(){return a}})},89759:function(e,t,n){"use strict";function a(e,t){var n=[];return e.concat(t).filter((function(e){return-1===n.indexOf(e.id)&&(n.push(e.id),!0)}))}n.d(t,{Z:function(){return a}})},89627:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function i(e){return e.replace(/[&<>"']/g,(function(e){return a[e]}))}},48772:function(e,t,n){"use strict";function a(e){return e>1073741824?i(e/1073741824)+" GB":e>1048576?i(e/1048576)+" MB":e>1024?i(e/1024)+" KB":i(e)+" B"}function i(e){return e.toFixed(1)}n.d(t,{Z:function(){return a}})},4869:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(22928),i=(n(57588),n(73935)),s=n.n(i),o=n(37424),r=n(90287);function l(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=document.getElementById(t),l=e.props?e:(0,a.Z)(e,{});i&&(n?s().render((0,a.Z)(o.zt,{store:r.Z.getStore()},void 0,l),i):s().render(l,i))}},44039:function(e,t,n){"use strict";function a(e,t){return Math.floor(Math.random()*(t-e+1))+e}n.d(t,{e:function(){return a}})},39633:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=(n(57588),n(73935)),s=n.n(i),o=n(37424),r=n(69987),l=n(90287),c=document.getElementById("page-mount");function u(e){var t={component:e.component||null,childRoutes:[]};e.root?t.childRoutes=[{path:e.root,onEnter:function(t,n){n(null,e.paths[0].path)}}].concat(e.paths):t.childRoutes=e.paths,s().render((0,a.Z)(o.zt,{store:l.Z.getStore()},void 0,(0,a.Z)(r.F0,{routes:t,history:r.mW})),c)}},20370:function(e,t,n){"use strict";function a(e,t){if(-1===e.indexOf(t)){var n=e.slice();return n.push(t),n}return e.filter((function(e){return e!==t}))}n.d(t,{ZN:function(){return a}})},55210:function(e,t,n){"use strict";n.d(t,{BS:function(){return d},C1:function(){return o},Do:function(){return c},Ei:function(){return u},HR:function(){return p},Vb:function(){return f},fT:function(){return r},gS:function(){return h},jA:function(){return l},lG:function(){return v}});var a=n(19755),i=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,s=new RegExp("^[0-9a-z]+$","i");function o(e){return function(t){if(!1===t||null===t||0===a.trim(t).length)return e||gettext("This field is required.")}}function r(e){var t=gettext("You have to accept the terms of service.");return o(e||t)}function l(e){var t=gettext("You have to accept the privacy policy.");return o(e||t)}function c(e){return function(t){if(!i.test(t))return e||gettext("Enter a valid email address.")}}function u(e,t){return function(n){var i="",s=a.trim(n).length;if(s<e)return i=t?t(e,s):ngettext("Ensure this value has at least %(limit_value)s character (it has %(show_value)s).","Ensure this value has at least %(limit_value)s characters (it has %(show_value)s).",e),interpolate(i,{limit_value:e,show_value:s},!0)}}function d(e,t){return function(n){var i="",s=a.trim(n).length;if(s>e)return i=t?t(e,s):ngettext("Ensure this value has at most %(limit_value)s character (it has %(show_value)s).","Ensure this value has at most %(limit_value)s characters (it has %(show_value)s).",e),interpolate(i,{limit_value:e,show_value:s},!0)}}function p(e){return u(e,(function(e){return ngettext("Username must be at least %(limit_value)s character long.","Username must be at least %(limit_value)s characters long.",e)}))}function h(e){return d(e,(function(e){return ngettext("Username cannot be longer than %(limit_value)s character.","Username cannot be longer than %(limit_value)s characters.",e)}))}function v(){return function(e){if(!s.test(a.trim(e)))return gettext("Username can only contain latin alphabet letters and digits.")}}function f(e){return function(t){var n=t.length;if(n<e){var a=ngettext("Valid password must be at least %(limit_value)s character long.","Valid password must be at least %(limit_value)s characters long.",e);return interpolate(a,{limit_value:e,show_value:n},!0)}}}},46700:function(e,t,n){var a={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=s,e.exports=i,i.id=46700}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=a,e=[],s.O=function(t,n,a,i){if(!n){var o=1/0;for(u=0;u<e.length;u++){n=e[u][0],a=e[u][1],i=e[u][2];for(var r=!0,l=0;l<n.length;l++)(!1&i||o>=i)&&Object.keys(s.O).every((function(e){return s.O[e](n[l])}))?n.splice(l--,1):(r=!1,i<o&&(o=i));if(r){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,a,i]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,n){return s.f[n](e,t),t}),[]))},s.u=function(e){return"hljs.js"},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t={},n="misago:",s.l=function(e,a,i,o){if(t[e])t[e].push(a);else{var r,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+i){r=d;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack",n+i),r.src=e),t[e]=[a];var p=function(n,a){r.onerror=r.onload=null,clearTimeout(h);var i=t[e];if(delete t[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((function(e){return e(a)})),n)return n(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e}(),function(){var e={174:0};s.f.j=function(t,n){var a=s.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise((function(n,i){a=e[t]=[n,i]}));n.push(a[2]=i);var o=s.p+s.u(t),r=new Error;s.l(o,(function(n){if(s.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",r.name="ChunkLoadError",r.type=i,r.request=o,a[1](r)}}),"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,i,o=n[0],r=n[1],l=n[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(a in r)s.o(r,a)&&(s.m[a]=r[a]);if(l)var u=l(s)}for(t&&t(n);c<o.length;c++)i=o[c],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return s.O(u)},n=self.webpackChunkmisago=self.webpackChunkmisago||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),s.O(void 0,[736],(function(){return s(32233)})),s.O(void 0,[736],(function(){return s(58339)})),s.O(void 0,[736],(function(){return s(64109)})),s.O(void 0,[736],(function(){return s(46226)})),s.O(void 0,[736],(function(){return s(93240)})),s.O(void 0,[736],(function(){return s(75147)})),s.O(void 0,[736],(function(){return s(4894)})),s.O(void 0,[736],(function(){return s(29223)})),s.O(void 0,[736],(function(){return s(3026)})),s.O(void 0,[736],(function(){return s(94795)})),s.O(void 0,[736],(function(){return s(95563)})),s.O(void 0,[736],(function(){return s(32488)})),s.O(void 0,[736],(function(){return s(11768)})),s.O(void 0,[736],(function(){return s(61323)})),s.O(void 0,[736],(function(){return s(15049)})),s.O(void 0,[736],(function(){return s(61814)})),s.O(void 0,[736],(function(){return s(95920)})),s.O(void 0,[736],(function(){return s(60630)})),s.O(void 0,[736],(function(){return s(72168)})),s.O(void 0,[736],(function(){return s(47806)})),s.O(void 0,[736],(function(){return s(77031)})),s.O(void 0,[736],(function(){return s(97751)})),s.O(void 0,[736],(function(){return s(76093)})),s.O(void 0,[736],(function(){return s(19764)})),s.O(void 0,[736],(function(){return s(47549)})),s.O(void 0,[736],(function(){return s(22331)})),s.O(void 0,[736],(function(){return s(21513)})),s.O(void 0,[736],(function(){return s(98749)})),s.O(void 0,[736],(function(){return s(98251)})),s.O(void 0,[736],(function(){return s(6720)})),s.O(void 0,[736],(function(){return s(10846)})),s.O(void 0,[736],(function(){return s(18255)})),s.O(void 0,[736],(function(){return s(14113)})),s.O(void 0,[736],(function(){return s(24444)})),s.O(void 0,[736],(function(){return s(1764)})),s.O(void 0,[736],(function(){return s(68351)})),s.O(void 0,[736],(function(){return s(81521)})),s.O(void 0,[736],(function(){return s(19984)})),s.O(void 0,[736],(function(){return s(41229)})),s.O(void 0,[736],(function(){return s(43589)})),s.O(void 0,[736],(function(){return s(24108)})),s.O(void 0,[736],(function(){return s(33934)})),s.O(void 0,[736],(function(){return s(85577)})),s.O(void 0,[736],(function(){return s(83526)})),s.O(void 0,[736],(function(){return s(43060)})),s.O(void 0,[736],(function(){return s(92292)})),s.O(void 0,[736],(function(){return s(33409)}));var o=s.O(void 0,[736],(function(){return s(31341)}));o=s.O(o)}();
+!function(){var e,t,n,a={98936:function(e,t,n){"use strict";n.d(t,{gq:function(){return o},Z6:function(){return r},kw:function(){return l}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("div",{className:s()("flex-row",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("flex-row-col",n,{"flex-row-col-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("flex-row-section",{"flex-row-section-auto":t},i)},void 0,n)}},59131:function(e,t,n){"use strict";var a=n(22928);n(57588),t.Z=function(e){var t=e.children;return(0,a.Z)("div",{className:"container page-container"},void 0,t)}},99755:function(e,t,n){"use strict";n.d(t,{mr:function(){return r},gC:function(){return l},sP:function(){return c},eA:function(){return u},Ql:function(){return d},bM:function(){return p},Iv:function(){return h}});var a,i=n(22928),s=n(94184),o=n.n(s),r=(n(57588),function(e){var t=e.children,n=e.className,s=e.styleName;return(0,i.Z)("div",{className:o()("page-header",n,s&&"page-header-"+s)},void 0,(0,i.Z)("div",{className:"page-header-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-bg-overlay"},void 0,a||(a=(0,i.Z)("div",{className:"page-header-image"})),t)))}),l=function(e){var t=e.children,n=e.className,a=e.styleName;return(0,i.Z)("div",{className:o()("page-header-banner",n,a&&"page-header-banner-"+a)},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-overlay"},void 0,t)))},c=function(e){var t=e.children;return(0,i.Z)("div",{className:"container page-header-container"},void 0,t)},u=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-details",n)},void 0,t)},d=function(e){var t=e.className,n=e.message;return(0,i.Z)("div",{className:o()("page-header-message",t),dangerouslySetInnerHTML:{__html:n}})},p=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-message",n)},void 0,t)},h=function(e){var t=e.styleName,n=e.header,a=e.message;return(0,i.Z)(c,{},void 0,(0,i.Z)(r,{styleName:t},void 0,(0,i.Z)(l,{styleName:t},void 0,(0,i.Z)("h1",{},void 0,n)),a&&(0,i.Z)(u,{styleName:t},void 0,a)))}},26106:function(e,t,n){"use strict";var a=n(22928),i=(n(57588),n(32233)),s=n(89627),o=function(e){var t=e.agreement,n=e.checked,i=e.errors,o=e.url,r=e.value,l=e.onChange;if(!o)return null;var c=interpolate('<a href="%(url)s" target="_blank">%(agreement)s</a>',{agreement:(0,s.Z)(t),url:(0,s.Z)(o)},!0),u=interpolate(gettext("I have read and accept %(agreement)s."),{agreement:c},!0);return(0,a.Z)("div",{className:"checkbox legal-footnote"},void 0,(0,a.Z)("label",{},void 0,(0,a.Z)("input",{checked:n,type:"checkbox",value:r,onChange:l}),(0,a.Z)("span",{dangerouslySetInnerHTML:{__html:u}})),i&&i.map((function(e,t){return(0,a.Z)("div",{className:"help-block errors"},t,e)})))};t.Z=function(e){var t=e.errors,n=e.privacyPolicy,s=e.termsOfService,r=e.onPrivacyPolicyChange,l=e.onTermsOfServiceChange,c=i.Z.get("TERMS_OF_SERVICE_ID"),u=i.Z.get("TERMS_OF_SERVICE_URL"),d=i.Z.get("PRIVACY_POLICY_ID"),p=i.Z.get("PRIVACY_POLICY_URL");return c||d?(0,a.Z)("div",{},void 0,(0,a.Z)(o,{agreement:gettext("the terms of service"),checked:null!==s,errors:t.termsOfService,url:u,value:c,onChange:l}),(0,a.Z)(o,{agreement:gettext("the privacy policy"),checked:null!==n,errors:t.privacyPolicy,url:p,value:d,onChange:r})):null}},47235:function(e,t,n){"use strict";var a,i=n(22928),s=(n(57588),n(32233)),o=function(e){var t=e.className,n=e.text;return n?(0,i.Z)("h5",{className:t||""},void 0,n):null};t.Z=function(e){var t=e.buttonClassName,n=e.buttonLabel,r=e.formLabel,l=e.header,c=e.labelClassName,u=s.Z.get("SOCIAL_AUTH");return 0===u.length?null:(0,i.Z)("div",{className:"form-group form-social-auth"},void 0,(0,i.Z)(o,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(e){var a=e.id,s=e.name,o=e.button_text,r=e.button_color,l=e.url,c="btn btn-block btn-default btn-social-"+a,u=r?{color:r}:null,d=o||interpolate(n,{site:s},!0);return(0,i.Z)("div",{className:t||"col-xs-12"},a,(0,i.Z)("a",{className:c,style:u,href:l},void 0,d))}))),a||(a=(0,i.Z)("hr",{})),(0,i.Z)(o,{className:c,text:r}))}},50366:function(e,t,n){"use strict";var a,i,s,o,r,l,c,u=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,u.Z)("ul",{className:"thread-flags"},void 0,2==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-globally",title:gettext("Pinned globally")},void 0,a||(a=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark"))),1==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-locally",title:gettext("Pinned in category")},void 0,i||(i=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark_outline"))),t.best_answer&&(0,u.Z)("li",{className:"thread-flag-answered",title:gettext("Answered")},void 0,s||(s=(0,u.Z)("span",{className:"material-icon"},void 0,"check_circle"))),t.has_poll&&(0,u.Z)("li",{className:"thread-flag-poll",title:gettext("Poll")},void 0,o||(o=(0,u.Z)("span",{className:"material-icon"},void 0,"poll"))),(t.is_unapproved||t.has_unapproved_posts)&&(0,u.Z)("li",{className:"thread-flag-unapproved",title:t.is_unapproved?gettext("Awaiting approval"):gettext("Has unapproved posts")},void 0,r||(r=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility"))),t.is_closed&&(0,u.Z)("li",{className:"thread-flag-closed",title:gettext("Closed")},void 0,l||(l=(0,u.Z)("span",{className:"material-icon"},void 0,"lock"))),t.is_hidden&&(0,u.Z)("li",{className:"thread-flag-hidden",title:gettext("Hidden")},void 0,c||(c=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility_off"))))}},16768:function(e,t,n){"use strict";var a,i=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,i.Z)("span",{className:"threads-replies",title:interpolate(ngettext("%(replies)s reply","%(replies)s replies",t.replies),{replies:t.replies},!0)},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"chat_bubble_outline")),t.replies>980?Math.round(t.replies/1e3)+"K":t.replies)}},92490:function(e,t,n){"use strict";n.d(t,{o8:function(){return o},Eg:function(){return r},Z2:function(){return l},tw:function(){return c}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("nav",{className:s()("toolbar",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("toolbar-item",n,{"toolbar-item-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("toolbar-section",{"toolbar-section-auto":t},i)},void 0,n)},c=function(e){var t=e.className;return(0,a.Z)("div",{className:s()("toolbar-spacer",t)})}},19605:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var a=n(22928),i=(n(57588),n(32233));function s(e){var t=e.size||100,n=e.size2x||t;return(0,a.Z)("img",{alt:"",className:e.className||"user-avatar",src:o(e.user,t),srcSet:o(e.user,n),width:t,height:t})}function o(e,t){return e&&e.id?function(e,t){var n=e[0];return e.forEach((function(e){e.size>=t&&(n=e)})),n}(e.avatars,t).url:i.Z.get("BLANK_AVATAR_URL")}},82211:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){var e="btn "+this.props.className,t=this.props.disabled;return this.props.loading&&(e+=" btn-loading",t=!0),(0,i.Z)("button",{className:e,disabled:t,onClick:this.props.onClick,type:this.props.onClick?"button":"submit"},void 0,this.props.children,this.props.loading?a||(a=(0,i.Z)(p.Z,{})):null)}}]),d}(d().Component);h.defaultProps={className:"btn-default",type:"submit",loading:!1,disabled:!1,onClick:null}},57026:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(22928);function i(e){return(0,a.Z)("select",{className:e.className||"form-control",disabled:e.disabled||!1,id:e.id||null,onChange:e.onChange,value:e.value},void 0,e.choices.map((function(e){return(0,a.Z)("option",{disabled:e.disabled||!1,value:e.value},e.value,"- - ".repeat(e.level)+e.label)})))}n(57588)},21688:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(33556);function p(e){return e.display?(0,a.Z)(d.Z,{helpText:gettext("No profile details are editable at this time."),message:gettext("This option is currently unavailable.")}):null}var h,v=n(37848);function f(e){return e.display?h||(h=(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(v.Z,{}))):null}var m=n(97326),Z=n(4942),g=n(60471);var y=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=c.call.apply(c,[this].concat(n)),(0,Z.Z)((0,m.Z)(e),"onChange",(function(t){var n=e.props,a=n.field;(0,n.onChange)(a.fieldname,t.target.value)})),e}return(0,s.Z)(u,[{key:"render",value:function(){var e=this.props,t=e.disabled,n=e.field,i=e.value,s=n.input;return"select"===s.type?(0,a.Z)(g.Z,{choices:s.choices,disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,value:i}):"textarea"===s.type?(0,a.Z)("textarea",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,rows:"4",type:"text",value:i}):"text"===s.type?(0,a.Z)("input",{className:"form-control",disabled:t,id:"id_"+n.fieldname,onChange:this.onChange,type:"text",value:i}):null}}]),u}(u().Component),b=n(96359);function _(e){var t=e.disabled,n=e.errors,i=e.fields,s=e.name,o=e.onChange,r=e.value;return(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,s),i.map((function(e){return(0,a.Z)(b.Z,{for:"id_"+e.fieldname,helpText:e.help_text,label:e.label,validation:n[e.fieldname]},e.fieldname,(0,a.Z)(y,{disabled:t,field:e,onChange:o,value:r[e.fieldname]}))})))}var N=n(82211),k=n(43345),x=n(78657),w=n(53904);var R=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;(0,i.Z)(this,u),t=c.call(this,e),(0,Z.Z)((0,m.Z)(t),"onChange",(function(e,n){t.setState((0,Z.Z)({},e,n))})),t.state={isLoading:!1,errors:{}};for(var n=e.groups.length,a=0;a<n;a++)for(var s=e.groups[a],o=s.fields.length,r=0;r<o;r++){var l=s.fields[r].fieldname,d=s.fields[r].initial;t.state[l]=d}return t}return(0,s.Z)(u,[{key:"send",value:function(){var e=Object.assign({},this.state,{errors:null,isLoading:null});return x.Z.post(this.props.api,e)}},{key:"handleSuccess",value:function(e){this.props.onSuccess(e)}},{key:"handleError",value:function(e){400===e.status?(w.Z.error(gettext("Form contains errors.")),this.setState({errors:e})):w.Z.apiError(e)}},{key:"render",value:function(){var e=this;return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,this.props.groups.map((function(t,n){return(0,a.Z)(_,{disabled:e.state.isLoading,errors:e.state.errors,fields:t.fields,name:t.name,onChange:e.onChange,value:e.state},n)}))),(0,a.Z)("div",{className:"panel-footer text-right"},void 0,(0,a.Z)(C,{disabled:this.state.isLoading,onCancel:this.props.onCancel})," ",(0,a.Z)(N.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes"))))}}]),u}(k.Z);function C(e){var t=e.onCancel,n=e.disabled;return t?(0,a.Z)("button",{className:"btn btn-default",disabled:n,onClick:t,type:"button"},void 0,gettext("Cancel")):null}var S=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={loading:!0,groups:null},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){var e=this;x.Z.get(this.props.api).then((function(t){e.setState({loading:!1,groups:t})}),(function(t){w.Z.apiError(t),e.props.cancel&&e.props.cancel()}))}},{key:"render",value:function(){var e=this.state,t=e.groups,n=e.loading;return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Edit details"))),(0,a.Z)(f,{display:n}),(0,a.Z)(p,{display:!n&&!t.length}),(0,a.Z)(E,{api:this.props.api,display:!n&&t.length,groups:t,onCancel:this.props.onCancel,onSuccess:this.props.onSuccess}))}}]),u}(u().Component);function E(e){var t=e.api,n=e.display,i=e.groups,s=e.onCancel,o=e.onSuccess;return n?(0,a.Z)(R,{api:t,groups:i,onCancel:s,onSuccess:o}):null}},96359:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"isValidated",value:function(){return void 0!==this.props.validation}},{key:"getClassName",value:function(){var e="form-group";return this.isValidated()&&(e+=" has-feedback",null===this.props.validation?e+=" has-success":e+=" has-error"),e}},{key:"getFeedback",value:function(){var e=this;return this.props.validation?(0,a.Z)("div",{className:"help-block errors"},void 0,this.props.validation.map((function(t,n){return(0,a.Z)("p",{},e.props.for+"FeedbackItem"+n,t)}))):null}},{key:"getFeedbackDescription",value:function(){return this.isValidated()?(0,a.Z)("span",{id:this.props.for+"_status",className:"sr-only"},void 0,this.props.validation?gettext("(error)"):gettext("(success)")):null}},{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:this.getClassName()},void 0,(0,a.Z)("label",{className:"control-label "+(this.props.labelClass||""),htmlFor:this.props.for||""},void 0,this.props.label+":"),(0,a.Z)("div",{className:this.props.controlClass||""},void 0,this.props.children,this.getFeedbackDescription(),this.getFeedback(),this.getHelpText(),this.props.extra||null))}}]),u}(n.n(c)().Component)},43345:function(e,t,n){"use strict";n.d(t,{Z:function(){return f}});var a=n(15671),i=n(43144),s=n(97326),o=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588),d=n.n(u),p=n(55210),h=n(53904);var v=(0,p.C1)(),f=function(e){(0,o.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function d(){var e;(0,a.Z)(this,d);for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return e=u.call.apply(u,[this].concat(n)),(0,c.Z)((0,s.Z)(e),"bindInput",(function(t){return function(n){e.changeValue(t,n.target.value)}})),(0,c.Z)((0,s.Z)(e),"changeValue",(function(t,n){var a=(0,c.Z)({},t,n),i=e.state.errors||{};i[t]=e.validateField(t,a[t]),a.errors=i,e.setState(a)})),(0,c.Z)((0,s.Z)(e),"handleSubmit",(function(t){if(t&&t.preventDefault(),!e.state.isLoading&&e.clean()){e.setState({isLoading:!0});var n=e.send();n?n.then((function(t){e.setState({isLoading:!1}),e.handleSuccess(t)}),(function(t){e.setState({isLoading:!1}),e.handleError(t)})):e.setState({isLoading:!1})}})),e}return(0,i.Z)(d,[{key:"validate",value:function(){var e={};if(!this.state.validators)return e;var t={required:this.state.validators.required||this.state.validators,optional:this.state.validators.optional||{}},n=[];for(var a in t.required)t.required.hasOwnProperty(a)&&t.required[a]&&n.push(a);for(var i in t.optional)t.optional.hasOwnProperty(i)&&t.optional[i]&&n.push(i);for(var s in n){var o=n[s],r=this.validateField(o,this.state[o]);null===r?e[o]=null:r&&(e[o]=r)}return e}},{key:"isValid",value:function(){var e=this.validate();for(var t in e)if(e.hasOwnProperty(t)&&null!==e[t])return!1;return!0}},{key:"validateField",value:function(e,t){var n=[];if(!this.state.validators)return n;var a={required:(this.state.validators.required||this.state.validators)[e],optional:(this.state.validators.optional||{})[e]},i=v(t)||!1;if(a.required){if(i)n=[i];else for(var s in a.required){var o=a.required[s](t);o&&n.push(o)}return n.length?n:null}if(!1===i&&a.optional){for(var r in a.optional){var l=a.optional[r](t);l&&n.push(l)}return n.length?n:null}return!1}},{key:"clean",value:function(){return!0}},{key:"send",value:function(){return null}},{key:"handleSuccess",value:function(e){}},{key:"handleError",value:function(e){h.Z.apiError(e)}}]),d}(d().Component)},94417:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"isActive",value:function(){return this.props.isControlled?this.props.isActive:!!this.props.path&&0===document.location.pathname.indexOf(this.props.path)}},{key:"getClassName",value:function(){return this.isActive()?(this.props.className||"")+" "+(this.props.activeClassName||"active"):this.props.className||""}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,this.props.children)}}]),u}(n.n(c)().Component)},37848:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var a,i=n(22928);function s(e){return(0,i.Z)("div",{className:e.className||"loader"},void 0,a||(a=(0,i.Z)("div",{className:"loader-spinning-wheel"})))}n(57588)},52753:function(e,t,n){"use strict";n.d(t,{ZP:function(){return Z}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=(n(57588),n(82211)),h=n(43345),v=n(96359),f=n(78657),m=n(59801);var Z=function(e){(0,l.Z)(v,e);var t,n,h=(t=v,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function v(e){var t;return(0,s.Z)(this,v),t=h.call(this,e),(0,d.Z)((0,r.Z)(t),"handleSuccess",(function(e){t.props.onSuccess(e),m.Z.hide()})),(0,d.Z)((0,r.Z)(t),"handleError",(function(e){t.props.onError(e)})),(0,d.Z)((0,r.Z)(t),"onBestAnswerChange",(function(e){t.changeValue("bestAnswer",e.target.value)})),(0,d.Z)((0,r.Z)(t),"onPollChange",(function(e){t.changeValue("poll",e.target.value)})),t.state={isLoading:!1,bestAnswer:"0",poll:"0"},t}return(0,o.Z)(v,[{key:"clean",value:function(){return!this.props.polls||"0"!==this.state.poll||window.confirm(gettext("Are you sure you want to delete all polls?"))}},{key:"send",value:function(){var e=Object.assign({},this.props.data,{best_answer:this.state.bestAnswer,poll:this.state.poll});return f.Z.post(this.props.api,e)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Merge threads"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(g,{choices:this.props.bestAnswers,onChange:this.onBestAnswerChange,value:this.state.bestAnswer}),(0,i.Z)(y,{choices:this.props.polls,onChange:this.onPollChange,value:this.state.poll})),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)(p.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Merge threads"))))))}}]),v}(h.Z);function g(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,i.Z)(v.Z,{label:gettext("Best answer"),helpText:gettext("Please select the best answer for your newly merged thread. No posts will be deleted during the merge."),for:"id_best_answer"},void 0,(0,i.Z)("select",{className:"form-control",id:"id_best_answer",onChange:n,value:a},void 0,t.map((function(e){return(0,i.Z)("option",{value:e[0]},e[0],e[1])})))):null}function y(e){var t=e.choices,n=e.onChange,a=e.value;return t?(0,i.Z)(v.Z,{label:gettext("Poll"),helpText:gettext("Please select the poll for your newly merged thread. Rejected polls will be permanently deleted and cannot be recovered."),for:"id_poll"},void 0,(0,i.Z)("select",{className:"form-control",id:"id_poll",onChange:n,value:a},void 0,t.map((function(e){return(0,i.Z)("option",{value:e[0]},e[0],e[1])})))):null}},69092:function(e,t,n){"use strict";n.d(t,{Z:function(){return m}});var a=n(15671),i=n(43144),s=n(79340),o=n(6215),r=n(61120),l=n(57588),c=n.n(l),u=n(4942),d=n(19755),p=new RegExp("^.*(?:(?:youtu.be/|v/|vi/|u/w/|embed/)|(?:(?:watch)??v(?:i)?=|&v(?:i)?=))([^#&?]*).*"),h=new(function(){function e(){var t=this;(0,a.Z)(this,e),(0,u.Z)(this,"render",(function(e){e&&(t.highlightCode(e),t.embedYoutubePlayers(e))})),this._youtube={}}return(0,i.Z)(e,[{key:"highlightCode",value:function(e){n.e(417).then(n.bind(n,15739)).then((function(t){for(var n=t.default,a=e.querySelectorAll("pre>code"),i=0;i<a.length;i++)n.highlightElement(a[i])}))}},{key:"embedYoutubePlayers",value:function(e){for(var t=e.querySelectorAll("p>a"),n=0;n<t.length;n++){var a=t[n],i=1===a.parentNode.childNodes.length;this._youtube[a.href]||(this._youtube[a.href]=v(a.href));var s=this._youtube[a.href];i&&s&&!1!==s.data&&this.swapYoutubePlayer(a,s)}}},{key:"swapYoutubePlayer",value:function(e,t){var n="https://www.youtube.com/embed/";n+=t.video,n+="?feature=oembed",t.start&&(n+="&start="+t.start);var a=d('<iframe class="embed-responsive-item" frameborder="0" src="'+n+'" allow="encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>');d(e).replaceWith(a),a.wrap('<div class="embed-responsive embed-responsive-16by9"></div>')}}]),e}());function v(e){var t=function(e){var t=e;return"https://"===e.substr(0,8)?t=t.substr(8):"http://"===e.substr(0,7)&&(t=t.substr(7)),"www."===t.substr(0,4)&&(t=t.substr(4)),t}(e),n=function(e){if(-1===e.indexOf("youtu"))return null;var t=e.match(p);return t?t[1]:null}(t);if(!n)return null;var a=0;if(t.indexOf("?")>0){var i=t.substr(t.indexOf("?")+1).split("&").filter((function(e){return"t="===e.substr(0,2)}))[0];if(i){var s=i.substr(2).split("m");"s"===s[0].substr(-1)?a+=parseInt(s[0].substr(0,s[0].length-1)):(a+=60*parseInt(s[0]),s[1]&&"s"===s[1].substr(-1)&&(a+=parseInt(s[1].substr(0,s[1].length-1))))}}return{start:a,video:n}}var f=n(19755);var m=function(e){(0,s.Z)(u,e);var t,n,l=(t=u,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(e){return!1}}(),function(){var e,a=(0,r.Z)(t);if(n){var i=(0,r.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,o.Z)(this,e)});function u(){return(0,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"componentDidUpdate",value:function(e,t){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"shouldComponentUpdate",value:function(e,t){return e.markup!==this.props.markup}},{key:"render",value:function(){var e=this;return c().createElement("article",{className:"misago-markup",dangerouslySetInnerHTML:{__html:this.props.markup},"data-author":this.props.author||void 0,ref:function(t){e.documentNode=t}})}}]),u}(c().Component);function Z(e){var t=e.target;f(t).parent().parent().addClass("revealed")}},3784:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"modal-body modal-loader"},void 0,(0,i.Z)(p.Z,{})))}}]),d}(d().Component)},30337:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120);n(57588);var c=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText(),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}}]),u}(n(33556).Z)},95187:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"panel-body panel-body-loading"},void 0,(0,i.Z)(p.Z,{className:"loader loader-spaced"})))}}]),d}(d().Component)},33556:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText()))}}]),u}(n.n(c)().Component)},11005:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var a=n(22928),i=n(57588),s=n.n(i),o=n(69092);function r(e){return e.post.content?s().createElement(l,e):s().createElement(c,e)}function l(e){return(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)(o.Z,{markup:e.post.content}))}function c(e){return(0,a.Z)("div",{className:"post-body post-body-invalid"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("This post's contents cannot be displayed.")),(0,a.Z)("p",{className:"text-muted"},void 0,gettext("This error is caused by invalid post content manipulation.")))}function u(e){var t=e.post,n=t.category,i=t.thread,s=interpolate(gettext("posted %(posted_on)s"),{posted_on:t.posted_on.format("LL, LT")},!0);return(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("a",{className:"btn btn-link item-title",href:i.url},void 0,i.title),(0,a.Z)("a",{className:"btn btn-link post-category",href:n.url.index},void 0,n.name),(0,a.Z)("a",{href:t.url.index,className:"btn btn-link posted-on",title:s},void 0,t.posted_on.fromNow()))}var d,p,h=n(19605);function v(e){var t=e.post;return(0,a.Z)("a",{className:"btn btn-default btn-icon pull-right",href:t.url.index},void 0,(0,a.Z)("span",{className:"btn-text-left hidden-xs"},void 0,gettext("See post")),d||(d=(0,a.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function f(e){var t=e.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,p||(p=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,t.poster_name)),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,gettext("Removed user")))))}function m(e){var t=e.rank,n=e.title||t.title||t.name,i="user-title";return t.css_class&&(i+=" user-title-"+t.css_class),t.is_tab?(0,a.Z)("a",{className:i,href:t.url},void 0,n):(0,a.Z)("span",{className:i},void 0,n)}function Z(e){var t=e.post,n=e.poster;return(0,a.Z)("div",{className:"post-side post-side-registered"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("a",{href:n.url},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50,user:n}))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("a",{className:"item-title",href:n.url},void 0,n.username)),(0,a.Z)(m,{title:n.title,rank:n.rank}))))}function g(e){var t=e.post,n=e.poster;return n&&n.id?(0,a.Z)(Z,{post:t,poster:n}):(0,a.Z)(f,{post:t})}function y(e){var t=e.post,n=e.poster||t.poster,i="post";return n&&n.rank.css_class&&(i+=" post-"+n.rank.css_class),(0,a.Z)("li",{className:i,id:"post-"+t.id},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)(g,{post:t,poster:n}),(0,a.Z)(u,{post:t}),(0,a.Z)(r,{post:t})))))}var b,_,N=n(44039);function k(){return(0,a.Z)("ul",{className:"posts-list post-feed ui-preview"},void 0,(0,a.Z)("li",{className:"post"},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)("div",{className:"media"},void 0,b||(b=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))))),(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")),(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)("article",{className:"misago-markup"},void 0,(0,a.Z)("p",{},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")))))))))}function x(e){var t=e.isReady,n=e.posts,i=e.poster;return t?(0,a.Z)("ul",{className:"posts-list post-feed ui-ready"},void 0,n.map((function(e){return(0,a.Z)(y,{post:e,poster:i},e.id)}))):_||(_=(0,a.Z)(k,{}))}},78107:function(e,t,n){"use strict";n.d(t,{mv:function(){return f},ZP:function(){return pn},MO:function(){return A},Fi:function(){return k}});var a,i=n(57588),s=n.n(i),o=n(22928),r=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(64646);var f=function(e){(0,u.Z)(f,e);var t,n,i=(t=f,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function f(e){var t;return(0,l.Z)(this,f),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"selected",(function(){if(t.element){var e=Z(t.element)||null,n=e?e.getBoundingClientRect():null;t.setState({range:e,rect:n})}})),(0,h.Z)((0,c.Z)(t),"reply",(function(){if(v.Z.isOpen()){var e=A();e&&!e.disabled&&(e.quote(k(t.state.range)),t.setState({range:null,rect:null}),m())}else{var n=k(t.state.range);v.Z.open(Object.assign({},t.props.posting,{default:n})),t.setState({range:null,rect:null}),window.setTimeout(m,1e3)}})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,o.Z)("div",{},void 0,s().createElement("div",{ref:function(e){e&&(t.element=e)},onMouseUp:t.selected,onTouchEnd:t.selected},t.props.children),!!t.state.rect&&(0,o.Z)("div",{className:"quote-control",style:{position:"absolute",left:t.state.rect.left+window.scrollX,top:t.state.rect.bottom+window.scrollY}},void 0,a||(a=(0,o.Z)("div",{className:"quote-control-arrow"})),(0,o.Z)("div",{className:"quote-control-inner"},void 0,(0,o.Z)("button",{className:"btn quote-control-btn",type:"button",onClick:t.reply},void 0,pgettext("post reply","Quote")))))})),t.state={range:null,rect:null},t.element=null,t}return(0,r.Z)(f)}(s().Component);function m(){var e=document.querySelector("#posting-mount textarea");e.focus(),e.selectionStart=e.selectionEnd=e.value.length}var Z=function(e){if(void 0!==window.getSelection){var t=window.getSelection();if(t&&"Range"===t.type&&1===t.rangeCount){var n=t.getRangeAt(0);if(g(n,e)&&y(n)&&b(n.cloneContents()))return n}}},g=function(e,t){var n=e.commonAncestorContainer;if(n===t)return!0;for(var a=n.parentNode;a;){if(a===t)return!0;a=a.parentNode}return!1},y=function(e){var t=e.commonAncestorContainer;if("ARTICLE"===t.nodeName)return!0;if(t.dataset&&"1"===t.dataset.noquote)return!1;for(var n=t.parentNode;n;){if(n.dataset&&"1"===n.dataset.noquote)return!1;if("ARTICLE"===n.nodeName)return!0;n=n.parentNode}return!1},b=function e(t){for(var n=0;n<t.childNodes.length;n++){var a=t.childNodes[n];if(a.nodeType===Node.TEXT_NODE&&a.textContent&&a.textContent.trim().length>0)return!0;if("IMG"===a.nodeName)return!0;if(e(a))return!0}return!1},_=n(42982),N=n(70885),k=function(e){var t=x(e),n=L(e.cloneContents().childNodes,[]),a=t?'[quote="'.concat(t,'"]\n'):"[quote]\n",i="\n[/quote]\n\n",s=C(e);return s?(a+=s.syntax?"[code=".concat(s.syntax,"]\n"):"[code]\n",i="\n[/code]"+i):E(e)?(n=n.trim(),a+="`",i="`"+i):n=n.trim(),a+n+i},x=function(e){var t=e.commonAncestorContainer;if(w(t))return R(t);for(var n=t.parentNode;n;){if(w(n))return R(n);n=n.parentNode}return""},w=function(e){return e.nodeType===Node.ELEMENT_NODE&&("ARTICLE"===e.nodeName||"BLOCKQUOTE"===e.nodeName&&e.dataset&&"quote"===e.dataset.block)},R=function(e){return e.dataset&&e.dataset.author||null},C=function(e){var t=e.commonAncestorContainer;if(S(t))return P(t);for(var n=t.parentNode;n;){if(S(n))return P(n);n=n.parentNode}return null},S=function(e){return"PRE"===e.nodeName},E=function(e){var t=e.commonAncestorContainer;if("CODE"===t.nodeName)return!0;for(var n=t.parentNode;n;){if(w(n))return!1;if("CODE"===n.nodeName)return!0;n=n.parentNode}return!1},P=function(e){return e.dataset?{syntax:e.dataset.syntax||null}:{syntax:null}},L=function(e,t){for(var n="",a=0;a<e.length;a++){var i=e[a];n+=O(i,t)}return n},T={H1:["\n\n# ",""],H2:["\n\n## ",""],H3:["\n\n### ",""],H4:["\n\n#### ",""],H5:["\n\n##### ",""],H6:["\n\n###### ",""],STRONG:["**","**"],EM:["*","*"],DEL:["~~","~~"],B:["[b]","[/b]"],U:["[u]","[/u]"],I:["[i]","[/i]"],SUB:["[sub]","[/sub]"],SUP:["[sup]","[/sup]"]},O=function(e,t){var n=e.dataset||{};if(e.nodeType===Node.TEXT_NODE)return e.textContent||"";if(e.nodeType===Node.ELEMENT_NODE){if(n.quote)return n.quote||"";if("1"===n.noquote)return""}if(e.nodeType===Node.ELEMENT_NODE&&n.quote&&n.quote.trim())return"";if("HR"===e.nodeName)return"\n\n- - -";if(T[e.nodeName]){var a=(0,N.Z)(T[e.nodeName],2),i=a[0],s=a[1];return i+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]))+s}if("A"===e.nodeName){var o=e.href,r=L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));return r?"[".concat(r,"](").concat(o,")"):"!(".concat(o,")")}if("IMG"===e.nodeName){var l=e.src,c=e.alt;return c?"![".concat(c,"](").concat(l,")"):"!(".concat(l,")")}if("DIV"===e.nodeName||"ASIDE"===e.nodeName){var u=n.block&&n.block.toUpperCase();if(u&&T[u]){var d=(0,N.Z)(T[u],2),p=d[0],h=d[1];return p+L(e.childNodes,[].concat((0,_.Z)(t),[u]))+h}return L(e.childNodes,t)}if("BLOCKQUOTE"===e.nodeName){if("spoiler"===n.block){var v=L(e.childNodes,[].concat((0,_.Z)(t),["SPOILER"])).trim();if(!v)return"";var f="\n[spoiler]\n";return(f+=v)+"\n[/spoiler]"}var m=L(e.childNodes,[].concat((0,_.Z)(t),["QUOTE"])).trim();if(!m)return"";var Z=R(e),g=Z?"\n[quote=".concat(Z,"]\n"):"\n\n[quote]\n";return(g+=m)+"\n[/quote]"}if("PRE"===e.nodeName){var y=n.syntax||null,b=e.querySelector("code"),k=b&&b.innerText||"";return k.trim()?"\n[code"+(y?"="+y:"")+"]"+k+"[/code]":""}if("CODE"===e.nodeName)return"`"+e.innerText+"`";if("P"===e.nodeName)return"\n"+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));if("UL"===e.nodeName||"OL"===e.nodeName)return(0===t.filter((function(e){return"OL"===e||"UL"===e})).length?"\n":"")+L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));if("LI"===e.nodeName){for(var x="",w=t.filter((function(e){return"OL"===e||"UL"===e})).length,C=1;C<w;C++)x+="    ";x+="OL"===t[t.length-1]?n.index?n.index+". ":"1. ":"- ";var S=L(e.childNodes,[].concat((0,_.Z)(t),[e.nodeName]));return S.trim()?"\n"+x+S:""}return"SPAN"===e.nodeName?L(e.childNodes,t):""};function A(){return window.misagoReply}function B(e,t){window.misagoReply={disabled:e,quote:t}}function I(){window.misagoReply=null}var D=n(57026),j=n(43345),z=n(30381),U=n.n(z);function M(e){return e.filter((function(e){return e.id&&!e.isRemoved})).map((function(e){return e.id}))}var q,H=n(12891),F=n(78657),Y=n(53904),V=n(94184),G=n.n(V),$=n(32233),W=n(69092),Q=n(59801),K=n(48772);function J(e){var t=e.attachment;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,q||(q=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Attachment details"))),(0,o.Z)("div",{className:"modal-body"},void 0,!!t.is_image&&(0,o.Z)("div",{className:"markup-editor-attachment-modal-preview"},void 0,(0,o.Z)("a",{href:t.url.index+"?shva=1",target:"_blank"},void 0,(0,o.Z)("img",{src:t.url.index+"?shva=1",alt:""}))),(0,o.Z)("div",{className:"markup-editor-attachment-modal-filename"},void 0,t.filename),(0,o.Z)("div",{className:"row markup-editor-attachment-modal-details"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-md-3"},void 0,(0,o.Z)("strong",{},void 0,t.filetype+", "+(0,K.Z)(t.size)),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Type and size")))),(0,o.Z)("div",{className:"col-xs-12 col-md-4"},void 0,(0,o.Z)("strong",{},void 0,(0,o.Z)("abbr",{title:t.uploaded_on.format("LLL")},void 0,t.uploaded_on.fromNow())),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Uploaded at")))),(0,o.Z)("div",{className:"col-xs-12 col-md-3"},void 0,t.url.uploader?(0,o.Z)("a",{href:t.url.uploader,target:"_blank",className:"item-title"},void 0,t.uploader_name):(0,o.Z)("span",{className:"item-title"},void 0,t.uploader_name),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("small",{},void 0,pgettext("markup editor","Uploader")))))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}var X,ee,te,ne,ae,ie,se=function(e,t,n,a,i){var s=e.text||i||"",o=e.prefix;o+=n+s+a,t(o+=e.suffix),window.setTimeout((function(){var t=e.start+n.length;e.textarea.focus(),e.textarea.setSelectionRange(t,t+s.length)}),250)},oe=function(e,t,n){var a=e.prefix;a+=n,t(a+=e.suffix),window.setTimeout((function(){var t=e.end+n.length;e.textarea.focus(),e.textarea.setSelectionRange(t,t)}),250)},re=function(e){if(document.selection){e.focus();var t=document.selection.createRange(),n=t.text.length;return t.moveStart("character",-e.value.length),le(e,t.text.length-n,t.text.length)}if(e.selectionStart||"0"==e.selectionStart)return le(e,e.selectionStart,e.selectionEnd)},le=function(e,t,n){return{textarea:e,start:t,end:n,text:e.value.substring(t,n),prefix:e.value.substring(0,t),suffix:e.value.substring(n)}},ce=function(e){var t,n=e.attachment,a=e.disabled,i=e.element,s=e.setState,r=e.update;return(0,o.Z)("div",{className:"markup-editor-attachments-item"},void 0,(0,o.Z)("div",{className:"markup-editor-attachment"},void 0,(0,o.Z)("div",{className:"markup-editor-attachment-details"},void 0,n.id?(0,o.Z)("a",{className:"item-title",href:n.url.index+"?shva=1",target:"_blank",onClick:function(e){e.preventDefault(),Q.Z.show(t||(t=(0,o.Z)(J,{attachment:n})))}},void 0,n.filename):(0,o.Z)("strong",{className:"item-title"},void 0,n.filename),(0,o.Z)("div",{className:"text-muted"},void 0,(0,o.Z)("ul",{className:"list-unstyled list-inline"},void 0,!n.id&&(0,o.Z)("li",{},void 0,n.progress+"%"),!!n.filetype&&(0,o.Z)("li",{},void 0,n.filetype),n.size>0&&(0,o.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Insert into message"),type:"button",disabled:a,onClick:function(){var e=function(e){var t="[";return e.is_image?(t+="!["+e.filename+"]",t+="("+(e.url.thumb||e.url.index)+"?shva=1)"):t+=e.filename,t+"]("+e.url.index+"?shva=1)"}(n),t=re(i);oe(t,r,e)}},void 0,X||(X=(0,o.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){var t=e.attachments;if(window.confirm(pgettext("markup editor","Remove this attachment?")))return{attachments:t.filter((function(e){return e.id!==n.id}))}}))}},void 0,ee||(ee=(0,o.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","See error"),type:"button",onClick:function(){Y.Z.error(interpolate(pgettext("markup editor","%(filename)s: %(error)s"),{filename:n.filename,error:n.error},!0))}},void 0,te||(te=(0,o.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){return{attachments:e.attachments.filter((function(e){return e.key!==n.key}))}}))}},void 0,ne||(ne=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))))},ue=function(e){var t=e.attachments,n=e.disabled,a=e.element,i=e.setState,s=e.update;return(0,o.Z)("div",{className:"markup-editor-attachments"},void 0,(0,o.Z)("div",{className:"markup-editor-attachments-container"},void 0,t.map((function(e){return(0,o.Z)(ce,{attachment:e,disabled:n,element:a,setState:i,update:s},e.key||e.id)}))))},de=n(82211),pe=function(e){var t=e.canProtect,n=e.disabled,a=e.empty,i=e.preview,s=e.isProtected,r=e.submitText,l=e.showPreview,c=e.closePreview,u=e.enableProtection,d=e.disableProtection;return(0,o.Z)("div",{className:"markup-editor-footer"},void 0,!!t&&(0,o.Z)(de.Z,{className:"btn-default btn-icon hidden-sm hidden-md hidden-lg",title:s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"),type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open")),!!t&&(0,o.Z)("div",{},void 0,(0,o.Z)(de.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open"),s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ae||(ae=(0,o.Z)("div",{className:"markup-editor-spacer"})),i?(0,o.Z)(de.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,o.Z)(de.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,o.Z)(de.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,r||gettext("Post")))},he=n(96359);var ve,fe,me,Ze,ge,ye,be,_e,Ne,ke,xe,we,Re,Ce,Se,Ee,Pe,Le,Te,Oe,Ae,Be,Ie,De,je,ze,Ue,Me,qe,He,Fe,Ye,Ve,Ge,$e,We,Qe,Ke,Je,Xe,et,tt,nt,at,it,st=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.syntax.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(Object.assign({},a,{text:o}),i,r+"```"+s+"\n"+o+"\n```\n\n"),Q.Z.hide(),!1})),t.state={error:null,syntax:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ie||(ie=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,o.Z)("select",{id:"markup_code_syntax",className:"form-control",value:this.state.syntax,onChange:function(t){return e.setState({syntax:t.target.value})}},void 0,(0,o.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),ot.map((function(e){var t=e.value,n=e.name;return(0,o.Z)("option",{value:t},t,n)})))),(0,o.Z)(he.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_code_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert code"))))))}}]),i}(s().Component),ot=[{value:"bash",name:"Bash"},{value:"c",name:"C"},{value:"c#",name:"C#"},{value:"c++",name:"C++"},{value:"css",name:"CSS"},{value:"diff",name:"Diff"},{value:"go",name:"Go"},{value:"graphql",name:"GraphQL"},{value:"html,",name:"HTML"},{value:"xml",name:"XML"},{value:"json",name:"JSON"},{value:"java",name:"Java"},{value:"javascript",name:"JavaScript"},{value:"kotlin",name:"Kotlin"},{value:"less",name:"Less"},{value:"lua",name:"Lua"},{value:"makefile",name:"Makefile"},{value:"markdown",name:"Markdown"},{value:"objective-C",name:"Objective-C"},{value:"php",name:"PHP"},{value:"perl",name:"Perl"},{value:"plain",name:"Plain"},{value:"text",name:"text"},{value:"python",name:"Python"},{value:"repl",name:"REPL"},{value:"r",name:"R"},{value:"ruby",name:"Ruby"},{value:"rust",name:"Rust"},{value:"scss",name:"SCSS"},{value:"sql",name:"SQL"},{value:"shell",name:"Shell Session"},{value:"swift",name:"Swift"},{value:"toml",name:"TOML"},{value:"ini",name:"INI"},{value:"typescript",name:"TypeScript"},{value:"visualbasic",name:"Visual Basic .NET"},{value:"webassembly",name:"WebAssembly"},{value:"yaml",name:"YAML"}],rt=st;function lt(){return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ve||(ve=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,o.Z)("div",{className:"modal-body formatting-help"},void 0,(0,o.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,o.Z)(ct,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),fe||(fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,o.Z)(ct,{markup:pgettext("markup help","**This text will be bold**"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),me||(me=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,o.Z)(ct,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),Ze||(Ze=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),ge||(ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),ye||(ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),be||(be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link")),_e||(_e=(0,o.Z)(ct,{markup:"<http://example.com>",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),Ne||(Ne=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,o.Z)(ct,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),ke||(ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),xe||(xe=(0,o.Z)(ct,{markup:"[url]http://example.com[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),we||(we=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,o.Z)(ct,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Re||(Re=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image")),Ce||(Ce=(0,o.Z)(ct,{markup:"!(http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Se||(Se=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,o.Z)(ct,{markup:"!["+pgettext("markup help","Image text")+"](http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://placekitten.com/38/38"}))}),Ee||(Ee=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Pe||(Pe=(0,o.Z)(ct,{markup:"[img]http://placekitten.com/38/38[/img]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Le||(Le=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Te||(Te=(0,o.Z)(ct,{markup:"@username",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"@username"))})),Oe||(Oe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,o.Z)(ct,{markup:pgettext("markup help","# First level heading"),result:(0,o.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),Ae||(Ae=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,o.Z)(ct,{markup:pgettext("markup help","## Second level heading"),result:(0,o.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),Be||(Be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,o.Z)(ct,{markup:pgettext("markup help","### Third level heading"),result:(0,o.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),Ie||(Ie=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,o.Z)(ct,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,o.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),De||(De=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,o.Z)(ct,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,o.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),je||(je=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),ze||(ze=(0,o.Z)(ct,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,o.Z)("ul",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),Ue||(Ue=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Me||(Me=(0,o.Z)(ct,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,o.Z)("ol",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),qe||(qe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,o.Z)(ct,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,o.Z)("blockquote",{},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),He||(He=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,o.Z)(ct,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Fe||(Fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text with title (BBCode)")),(0,o.Z)(ct,{markup:'[quote="'+pgettext("markup help","Quote title")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quote title has written:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Ye||(Ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,o.Z)(ct,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,o.Z)(dt,{},void 0,pgettext("markup help","Secret text"))}),Ve||(Ve=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,o.Z)(ct,{markup:pgettext("markup help","`Inline code`"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Ge||(Ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block")),$e||($e=(0,o.Z)(ct,{markup:'```\nalert("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),We||(We=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),Qe||(Qe=(0,o.Z)(ct,{markup:'```python\nprint("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),Ke||(Ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),Je||(Je=(0,o.Z)(ct,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Xe||(Xe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),et||(et=(0,o.Z)(ct,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),tt||(tt=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),nt||(nt=(0,o.Z)(ct,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))})),at||(at=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),it||(it=(0,o.Z)(ct,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}function ct(e){var t=e.markup,n=e.result;return(0,o.Z)("div",{className:"formatting-help-item"},void 0,(0,o.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{},void 0,t))),(0,o.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,o.Z)("article",{className:"misago-markup"},void 0,n)))}var ut,dt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),(t=a.call(this,e)).state={reveal:!1},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,o.Z)("blockquote",{className:"spoiler-body"},void 0,(0,o.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,o.Z)("div",{className:"spoiler-overlay"},void 0,(0,o.Z)("button",{className:"spoiler-reveal",type:"button",onClick:function(){e.setState({reveal:!0})}},void 0,gettext("Reveal spoiler"))))}}]),i}(s().Component),pt=n(19755),ht=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function vt(e){return ht.test(pt.trim(e))}var ft,mt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"!["+s+"]("+o+")"):oe(a,i,"!("+o+")"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ut||(ut=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image description"),helpText:pgettext("markup editor","Optional but recommended . Will be displayed instead of image when it fails to load.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert image"))))))}}]),i}(s().Component);var Zt,gt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"["+s+"]("+o+")"):oe(a,i,"<"+o+">"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ft||(ft=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link text"),helpText:pgettext("markup editor","Optional. Will be displayed instead of link's address.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(s().Component);var yt,bt,_t=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.author.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(a,i,s?r+'[quote="'+s+'"]\n'+o+"\n[/quote]\n\n":r+"[quote]\n"+o+"\n[/quote]\n\n"),Q.Z.hide(),!1})),t.state={error:null,author:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Zt||(Zt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_quote_author",label:pgettext("markup editor","Quote's author or source"),helpText:pgettext("markup editor",'Optional. If it\'s username, put "@" before it ("@JohnDoe").')},void 0,(0,o.Z)("input",{id:"markup_quote_author",className:"form-control",type:"text",value:this.state.author,onChange:function(t){return e.setState({author:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_quote_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(s().Component),Nt=function(e){var t=e.disabled,n=e.icon,a=e.title,i=e.onClick;return(0,o.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:t,onClick:i},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,n))},kt="12345678990abcdefghijklmnopqrstuvwxyz",xt=kt.length,wt=function(e){for(var t=[],n=0;n<e;n++){var a=Math.floor(Math.random()*xt);t.push(kt[a])}return t.join("")},Rt=function(e,t){var n=1024*$.Z.get("user").acl.max_attachment_size;if(e.size>n)Y.Z.error(interpolate(pgettext("markup editor","File %(filename)s is bigger than %(limit)s."),{filename:e.name,limit:(0,K.Z)(n)},!0));else{var a={id:null,key:wt(32),error:null,uploaded_on:null,progress:0,filename:e.name,filetype:null,is_image:!1,size:e.size,url:null,uploader_name:null};t((function(e){var t=e.attachments;return{attachments:[a].concat(t)}}));var i=function(){t((function(e){return{attachments:e.attachments.concat()}}))},s=new FormData;s.append("upload",e),F.Z.upload($.Z.get("ATTACHMENTS_API"),s,(function(e){a.progress=e,i()})).then((function(e){Object.assign(a,e,{uploaded_on:U()(e.uploaded_on)}),i()}),(function(e){400===e.status||413===e.status?(a.error=e.detail,Y.Z.error(e.detail),i()):Y.Z.apiError(e)}))}},Ct=function(e){var t=e.disabled,n=e.element,a=e.update,i=e.updateAttachments,s=[{name:pgettext("markup editor","Strong"),icon:"format_bold",onClick:function(){se(re(n),a,"**","**",pgettext("example markup","Strong text"))}},{name:pgettext("markup editor","Emphasis"),icon:"format_italic",onClick:function(){se(re(n),a,"*","*",pgettext("example markup","Text with emphasis"))}},{name:pgettext("markup editor","Strikethrough"),icon:"format_strikethrough",onClick:function(){se(re(n),a,"~~","~~",pgettext("example markup","Text with strikethrough"))}},{name:pgettext("markup editor","Horizontal ruler"),icon:"remove",onClick:function(){oe(re(n),a,"\n\n- - -\n\n")}},{name:pgettext("markup editor","Link"),icon:"insert_link",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(gt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Image"),icon:"insert_photo",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(mt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(_t,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Spoiler"),icon:"visibility_off",onClick:function(){!function(e,t){var n=re(e),a=n.prefix.trim().length?"\n\n":"";se(n,t,a+"[spoiler]\n","\n[/spoiler]\n\n",pgettext("markup editor","Spoiler text"))}(n,a)}},{name:pgettext("markup editor","Code"),icon:"code",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(rt,{selection:e,element:n,update:a}))}}];return $.Z.get("user").acl.max_attachment_size&&s.push({name:pgettext("markup editor","Upload file"),icon:"file_upload",onClick:function(){return e=i,(t=document.createElement("input")).type="file",t.multiple="multiple",t.addEventListener("change",(function(){for(var n=0;n<t.files.length;n++)Rt(t.files[n],e)})),void t.click();var e,t}}),(0,o.Z)("div",{className:"markup-editor-toolbar"},void 0,(0,o.Z)("div",{className:"markup-editor-toolbar-left"},void 0,s.map((function(e){var a=e.name,i=e.icon,s=e.onClick;return(0,o.Z)(Nt,{title:a,icon:i,disabled:t||!n,onClick:s},i)}))),(0,o.Z)("div",{className:"markup-editor-toolbar-right"},void 0,(0,o.Z)("div",{className:"markup-editor-controls-dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-markup-editor dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t||!n},void 0,yt||(yt=(0,o.Z)("span",{className:"material-icon"},void 0,"more_vert"))),(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,s.map((function(e){var a=e.name,i=e.icon,s=e.onClick;return(0,o.Z)("li",{},i,(0,o.Z)("button",{type:"button",className:"btn-link",disabled:t||!n,onClick:s},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,i),a))})))),(0,o.Z)(Nt,{title:pgettext("markup editor","Formatting help"),icon:"help_outline",onClick:function(){Q.Z.show(bt||(bt=(0,o.Z)(lt,{})))}})))},St=n(19755);var Et=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showPreview",(function(){t.state.loading||(t.setState({loading:!0,preview:!0,element:null}),F.Z.post($.Z.get("PARSE_MARKUP_API"),{post:t.props.value}).then((function(e){t.setState({loading:!1,parsed:e.parsed})}),(function(e){400===e.status?Y.Z.error(e.detail):Y.Z.apiError(e),t.setState({loading:!1,preview:!1})})))})),(0,h.Z)((0,c.Z)(t),"closePreview",(function(){t.setState({loading:!1,preview:!1})})),(0,h.Z)((0,c.Z)(t),"onDrop",(function(e){if(e.preventDefault(),e.stopPropagation(),e.dataTransfer.files){var n=t.props.onAttachmentsChange;if($.Z.get("user").acl.max_attachment_size)for(var a=0;a<e.dataTransfer.files.length;a++){var i=e.dataTransfer.files[a];Rt(i,n)}}})),(0,h.Z)((0,c.Z)(t),"onPaste",(function(e){for(var n=t.props.onAttachmentsChange,a=[],i=0;i<e.clipboardData.items.length;i++){var s=e.clipboardData.items[i];"file"===s.kind&&a.push(s.getAsFile())}if(a.length&&(e.preventDefault(),e.stopPropagation(),$.Z.get("user").acl.max_attachment_size))for(var o=0;o<a.length;o++)Rt(a[o],n)})),(0,h.Z)((0,c.Z)(t),"render",(function(){return(0,o.Z)("div",{className:G()("markup-editor",{"markup-editor-focused":t.state.focused&&!t.state.preview})},void 0,(0,o.Z)(Ct,{disabled:t.props.disabled||t.state.preview,element:t.state.element,update:function(e){return t.props.onChange({target:{value:e}})},updateAttachments:t.props.onAttachmentsChange}),t.state.preview?(0,o.Z)("div",{className:"markup-editor-preview"},void 0,t.state.loading?(0,o.Z)("div",{className:"ui-preview"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"240px"}})):(0,o.Z)(W.Z,{markup:t.state.parsed})):s().createElement("textarea",{className:"markup-editor-textarea form-control",placeholder:t.props.placeholder,value:t.props.value,disabled:t.props.disabled||t.state.loading,rows:6,ref:function(e){e&&t.state.element!==e&&(t.setState({element:e}),function(e,t){St(t).atwho({at:"@",displayTpl:'<li><img src="${avatar}" alt="">${username}</li>',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(e,t){St.getJSON($.Z.get("MENTION_API"),{q:e},t)}}}),St(t).on("inserted.atwho",(function(t,n,a,i){var s=i.query,o=a.target.innerText.trim(),r=t.target.value.substr(0,s.headPos),l=t.target.value.substr(s.endPos);t.target.value=r+o+l,e.onChange(t);var c=s.headPos+o.length;t.target.setSelectionRange(c,c),t.target.focus()}))}(t.props,e))},onChange:t.props.onChange,onDrop:t.onDrop,onFocus:function(){return t.setState({focused:!0})},onPaste:t.onPaste,onBlur:function(){return t.setState({focused:!1})}}),t.props.attachments.length>0&&(0,o.Z)(ue,{attachments:t.props.attachments,disabled:t.props.disabled||t.state.preview,element:t.state.element,setState:t.props.onAttachmentsChange,update:function(e){return t.props.onChange({target:{value:e}})}}),(0,o.Z)(pe,{preview:t.state.preview,canProtect:t.props.canProtect,isProtected:t.props.isProtected,disabled:t.props.disabled,empty:t.props.value.trim().length<$.Z.get("SETTINGS").post_length_min||t.state.loading,enableProtection:t.props.enableProtection,disableProtection:t.props.disableProtection,showPreview:t.showPreview,closePreview:t.closePreview,submitText:t.props.submitText}))})),t.state={element:null,focused:!1,loading:!1,preview:!1,parsed:null},t}return(0,r.Z)(i)}(s().Component),Pt=n(92490);var Lt,Tt,Ot,At,Bt,It,Dt,jt,zt,Ut,Mt,qt,Ht,Ft,Yt,Vt="posting-active",Gt="posting-default",$t="posting-minimized",Wt="posting-fullscreen",Qt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,l.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(Vt,Gt)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(Vt,Gt,$t,Wt)}},{key:"componentWillReceiveProps",value:function(e){var t=e.fullscreen;e.minimized?(document.body.classList.remove(Gt,Wt),document.body.classList.add($t)):t?(document.body.classList.remove(Gt,$t),document.body.classList.add(Wt)):(document.body.classList.remove(Wt,$t),document.body.classList.add(Gt))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fullscreen,a=e.minimized;return(0,o.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,o.Z)("div",{className:"posting-dialog-container"},void 0,t))}}]),i}(s().Component),Kt=Qt,Jt=function(e){var t=e.children;return(0,o.Z)("div",{className:"posting-dialog-body"},void 0,t)},Xt=function(e){var t=e.close,n=e.message;return(0,o.Z)("div",{className:"posting-dialog-error"},void 0,Lt||(Lt=(0,o.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,o.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,o.Z)("p",{},void 0,n),(0,o.Z)("button",{type:"button",className:"btn btn-default",onClick:t},void 0,pgettext("modal","Close"))))},en=function(e){var t=e.children,n=e.close,a=e.fullscreen,i=e.minimize,s=e.minimized,r=e.fullscreenEnter,l=e.fullscreenExit,c=e.open;return(0,o.Z)("div",{className:"posting-dialog-header"},void 0,(0,o.Z)("div",{className:"posting-dialog-caption"},void 0,t),s?(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,Tt||(Tt=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,Ot||(Ot=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,At||(At=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:r},void 0,Bt||(Bt=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,It||(It=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))};function tn(e){var t=e.isClosed,n=e.isHidden,a=e.isPinned,i=e.disabled,s=e.options,r=e.close,l=e.open,c=e.hide,u=e.unhide,d=e.pinGlobally,p=e.pinLocally,h=e.unpin,v=function(e,t,n){var a=[];return 2===n&&a.push("bookmark"),1===n&&a.push("bookmark_outline"),e&&a.push("lock"),t&&a.push("visibility_off"),a}(t,n,a);return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("post thread","Options"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button",disabled:i},void 0,v.length>0?(0,o.Z)("span",{className:"btn-icons-family"},void 0,v.map((function(e){return(0,o.Z)("span",{className:"material-icon"},e,e)}))):Dt||(Dt=(0,o.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===s.pin&&2!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,jt||(jt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),s.pin>=a&&1!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,zt||(zt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned locally"))),s.pin>=a&&0!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Ut||(Ut=(0,o.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),s.close&&!!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Mt||(Mt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),s.close&&!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:r,type:"button",disabled:i},void 0,qt||(qt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),s.hide&&!!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,Ht||(Ht=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),s.hide&&!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Ft||(Ft=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post thread","Hidden")))))}var nn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n=null,a=null,i=e.map((function(e){return!1===e.post||n&&e.id!=t.state.category||(n=e.id,a=e.post),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));t.setState({isReady:!0,options:a,categories:i,category:n})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(t.minimize(),v.Z.close())})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){var n=t.state.categories.find((function(t){return e.target.value==t.value})),a=t.state.pin;n.post.pin&&n.post.pin<a&&(a=n.post.pin),t.setState({category:n.id,categoryOptions:n.post,pin:a})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onClose",(function(){t.changeValue("close",!0)})),(0,h.Z)((0,c.Z)(t),"onOpen",(function(){t.changeValue("close",!1)})),(0,h.Z)((0,c.Z)(t),"onPinGlobally",(function(){t.changeValue("pin",2)})),(0,h.Z)((0,c.Z)(t),"onPinLocally",(function(){t.changeValue("pin",1)})),(0,h.Z)((0,c.Z)(t),"onUnpin",(function(){t.changeValue("pin",0)})),(0,h.Z)((0,c.Z)(t),"onHide",(function(){t.changeValue("hide",!0)})),(0,h.Z)((0,c.Z)(t),"onUnhide",(function(){t.changeValue("hide",!1)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,options:null,title:"",category:e.category||null,categories:[],post:"",attachments:[],close:!1,hide:!1,pin:0,validators:{title:(0,H.jn)(),post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config).then(this.loadSuccess,this.loadError)}},{key:"clean",value:function(){if(!this.state.title.trim().length)return Y.Z.error(gettext("You have to enter thread title.")),!1;if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return e.title?(Y.Z.error(e.title[0]),!1):!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return F.Z.post(this.props.submit,{title:this.state.title,category:this.state.category,post:this.state.post,attachments:M(this.state.attachments),close:this.state.close,hide:this.state.hide,pin:this.state.pin})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url,this.setState({isLoading:!0})}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};if(this.state.error)return s().createElement(an,e,(0,o.Z)(Xt,{message:this.state.error,close:this.close}));if(!this.state.isReady)return s().createElement(an,e,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,Yt||(Yt=(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:!0,type:"text"}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,o.Z)(Pt.Eg,{},void 0,(0,o.Z)("input",{className:"form-control",disabled:!0,type:"text"}))))),(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("post thread submit","Post thread"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})));var t=!!(this.state.options.close||this.state.options.hide||this.state.options.pin);return s().createElement(an,e,(0,o.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-category-select",auto:!0},void 0,(0,o.Z)(Pt.Eg,{},void 0,(0,o.Z)(D.Z,{choices:this.state.categories,disabled:this.state.isLoading,onChange:this.onCategoryChange,value:this.state.category})),t&&(0,o.Z)(Pt.Eg,{shrink:!0},void 0,(0,o.Z)(tn,{isClosed:this.state.close,isHidden:this.state.hide,isPinned:this.state.pin,disabled:this.state.isLoading,options:this.state.options,close:this.onClose,open:this.onOpen,hide:this.onHide,unhide:this.onUnhide,pinGlobally:this.onPinGlobally,pinLocally:this.onPinLocally,unpin:this.onUnpin})))),(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(j.Z),an=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,pgettext("post thread","Start new thread")),(0,o.Z)(Jt,{},void 0,t))};function sn(e){var t=e.split(",").map((function(e){return e.trim().toLowerCase()})).filter((function(e){return e.length>0}));return t.filter((function(e,n){return t.indexOf(e)==n}))}var on=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard private thread?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onToChange",(function(e){t.changeValue("to",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})}));var n=(e.to||[]).map((function(e){return e.username})).join(", ");return t.state={isLoading:!1,error:null,minimized:!1,fullscreen:!1,to:n,title:"",post:"",attachments:[],validators:{title:(0,H.jn)(),post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"clean",value:function(){if(!sn(this.state.to).length)return Y.Z.error(gettext("You have to enter at least one recipient.")),!1;if(!this.state.title.trim().length)return Y.Z.error(gettext("You have to enter thread title.")),!1;if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return e.title?(Y.Z.error(e.title[0]),!1):!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return F.Z.post(this.props.submit,{to:sn(this.state.to),title:this.state.title,post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url,this.setState({isLoading:!0})}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.to||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return s().createElement(rn,e,(0,o.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onToChange,placeholder:pgettext("post thread","Recipients, eg.: Danny, Lisa, Alice"),type:"text",value:this.state.to}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title})))),(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(j.Z),rn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,pgettext("post thread","Start private thread")),(0,o.Z)(Jt,{},void 0,t))};var ln=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){t.setState({isReady:!0,post:e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]":t.state.post})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post reply","Are you sure you want to discard your reply?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,post:t.props.default||"",attachments:[],validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.post(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post reply","Your reply has been posted.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e={thread:this.props.thread,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(cn,e,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(cn,e,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post reply submit","Post reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(cn,e,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),cn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.thread;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("post reply","Reply to: %(thread)s"),{thread:u.title},!0)),(0,o.Z)(Jt,{},void 0,t))};var un=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n;t.setState({isReady:!0,post:e.post,attachments:(n=e.attachments,n.map((function(e){return Object.assign({},e,{uploaded_on:U()(e.uploaded_on)})}))),protect:e.is_protected,canProtect:e.can_protect})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(gettext("Are you sure you want to discard changes?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onProtect",(function(){t.setState({protect:!0})})),(0,h.Z)((0,c.Z)(t),"onUnprotect",(function(){t.setState({protect:!1})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:!1,minimized:!1,fullscreen:!1,post:"",attachments:[],protect:!1,canProtect:!1,validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.put(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments),protect:this.state.protect})}},{key:"handleSuccess",value:function(e){Y.Z.success(gettext("Reply has been edited.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e=this,t={post:this.props.post,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(dn,t,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(dn,t,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,canProtect:this.state.canProtect,isProtected:this.state.protect,enableProtection:function(){return e.setState({protect:!0})},disableProtection:function(){return e.setState({protect:!1})},value:this.state.post,submitText:pgettext("edit reply submit","Edit reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(dn,t,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("edit reply submit","Edit reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),dn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.post;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("edit reply","Edit reply by %(poster)s from %(date)s"),{poster:u.poster?u.poster.username:u.poster_name,date:u.posted_on.fromNow()},!0)),(0,o.Z)(Jt,{},void 0,t))};function pn(e){switch(e.mode){case"START":return s().createElement(nn,e);case"START_PRIVATE":return s().createElement(on,e);case"REPLY":return s().createElement(ln,e);case"EDIT":return s().createElement(un,e);default:return null}}},12891:function(e,t,n){"use strict";n.d(t,{Jh:function(){return o},jn:function(){return s}});var a=n(55210),i=n(32233);function s(){return[(0,a.Ei)(i.Z.get("SETTINGS").thread_title_length_min,(function(e,t){var n=ngettext("Thread title should be at least %(limit_value)s character long (it has %(show_value)s).","Thread title should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)})),(0,a.BS)(i.Z.get("SETTINGS").thread_title_length_max,(function(e,t){var n=ngettext("Thread title cannot be longer than %(limit_value)s character (it has %(show_value)s).","Thread title cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]}function o(){return i.Z.get("SETTINGS").post_length_max?[r(),(0,a.BS)(i.Z.get("SETTINGS").post_length_max||1e6,(function(e,t){var n=ngettext("Posted message cannot be longer than %(limit_value)s character (it has %(show_value)s).","Posted message cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]:[r()]}function r(){return(0,a.Ei)(i.Z.get("SETTINGS").post_length_min,(function(e,t){var n=ngettext("Posted message should be at least %(limit_value)s character long (it has %(show_value)s).","Posted message should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))}},60471:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,o.Z)(e),"change",(function(t){return function(){e.props.onChange({target:{value:t}})}})),e}return(0,s.Z)(p,[{key:"getChoice",value:function(){var e=this,t=null;return this.props.choices.map((function(n){n.value===e.props.value&&(t=n)})),t}},{key:"getIcon",value:function(){return this.getChoice().icon}},{key:"getLabel",value:function(){return this.getChoice().label}},{key:"render",value:function(){var e=this;return(0,a.Z)("div",{className:"btn-group btn-select-group"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-select dropdown-toggle",id:this.props.id||null,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false","aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)(h,{icon:this.getIcon()}),this.getLabel()),(0,a.Z)("ul",{className:"dropdown-menu"},void 0,this.props.choices.map((function(t,n){return(0,a.Z)("li",{},n,(0,a.Z)("button",{type:"button",className:"btn-link",onClick:e.change(t.value)},void 0,(0,a.Z)(h,{icon:t.icon}),t.label))}))))}}]),p}(n.n(d)().Component);function h(e){var t=e.icon;return t?(0,a.Z)("span",{className:"material-icon"},void 0,t):null}},14467:function(e,t,n){"use strict";n.d(t,{Z:function(){return y}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=(n(57588),n(32233)),d=n(82211),p=n(43345),h=n(47235),v=n(78657),f=n(59801),m=n(53904),Z=n(93051),g=n(19755);var y=function(e){(0,r.Z)(y,e);var t,n,p=(t=y,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function y(e){var t;return(0,s.Z)(this,y),(t=p.call(this,e)).state={isLoading:!1,showActivation:!1,username:"",password:"",validators:{username:[],password:[]}},t}return(0,o.Z)(y,[{key:"clean",value:function(){return!!this.isValid()||(m.Z.error(gettext("Fill out both fields.")),!1)}},{key:"send",value:function(){return v.Z.post(u.Z.get("AUTH_API"),{username:this.state.username,password:this.state.password})}},{key:"handleSuccess",value:function(){var e=g("#hidden-login-form");e.append('<input type="text" name="username" />'),e.append('<input type="password" name="password" />'),e.find('input[type="hidden"]').val(v.Z.getCsrfToken()),e.find('input[name="redirect_to"]').val(window.location.pathname),e.find('input[name="username"]').val(this.state.username),e.find('input[name="password"]').val(this.state.password),e.submit(),this.setState({isLoading:!0})}},{key:"handleError",value:function(e){400===e.status?"inactive_admin"===e.code?m.Z.info(e.detail):"inactive_user"===e.code?(m.Z.info(e.detail),this.setState({showActivation:!0})):"banned"===e.code?((0,Z.Z)(e.detail),f.Z.hide()):m.Z.error(e.detail):403===e.status&&e.ban?((0,Z.Z)(e.ban),f.Z.hide()):m.Z.apiError(e)}},{key:"getActivationButton",value:function(){return this.state.showActivation?(0,i.Z)("a",{className:"btn btn-success btn-block",href:u.Z.get("REQUEST_ACTIVATION_URL")},void 0,gettext("Activate account")):null}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog modal-sm modal-sign-in",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Sign in"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(h.Z,{buttonLabel:gettext("Sign in with %(site)s"),formLabel:gettext("Or use your forum account:"),labelClassName:"text-center"}),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_username",onChange:this.bindInput("username"),placeholder:gettext("Username or e-mail"),type:"text",value:this.state.username}))),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_password",onChange:this.bindInput("password"),placeholder:gettext("Password"),type:"password",value:this.state.password})))),(0,i.Z)("div",{className:"modal-footer"},void 0,this.getActivationButton(),(0,i.Z)(d.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Sign in")),(0,i.Z)("a",{className:"btn btn-default btn-block",href:u.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Forgot password?"))))))}}]),y}(p.Z)},24678:function(e,t,n){"use strict";n.d(t,{Jj:function(){return h},ZP:function(){return p},pg:function(){return v}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);function d(e){var t=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(e){return!1}}();return function(){var n,a=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r.Z)(this,n)}}var p=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getClass",value:function(){return e=this.props.status,t="",e.is_banned?t="banned":e.is_hidden?t="offline":e.is_online_hidden?t="online":e.is_offline_hidden?t="offline":e.is_online?t="online":e.is_offline&&(t="offline"),"user-status user-"+t;var e,t}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.getClass()},void 0,this.props.children)}}]),n}(u().Component),h=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getIcon",value:function(){return this.props.status.is_banned?"remove_circle_outline":this.props.status.is_hidden?"help_outline":this.props.status.is_online_hidden?"label":this.props.status.is_offline_hidden?"label_outline":this.props.status.is_online?"lens":this.props.status.is_offline?"panorama_fish_eye":void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:"material-icon status-icon"},void 0,this.getIcon())}}]),n}(u().Component),v=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getHelp",value:function(){return e=this.props.user,(t=this.props.status).is_banned?t.banned_until?interpolate(gettext("%(username)s is banned until %(ban_expires)s"),{username:e.username,ban_expires:t.banned_until.format("LL, LT")},!0):interpolate(gettext("%(username)s is banned"),{username:e.username},!0):t.is_hidden?interpolate(gettext("%(username)s is hiding presence"),{username:e.username},!0):t.is_online_hidden?interpolate(gettext("%(username)s is online (hidden)"),{username:e.username},!0):t.is_offline_hidden?interpolate(gettext("%(username)s was last seen %(last_click)s (hidden)"),{username:e.username,last_click:t.last_click.fromNow()},!0):t.is_online?interpolate(gettext("%(username)s is online"),{username:e.username},!0):t.is_offline?interpolate(gettext("%(username)s was last seen %(last_click)s"),{username:e.username,last_click:t.last_click.fromNow()},!0):void 0;var e,t}},{key:"getLabel",value:function(){return this.props.status.is_banned?gettext("Banned"):this.props.status.is_hidden?gettext("Hidden"):this.props.status.is_online_hidden?gettext("Online (hidden)"):this.props.status.is_offline_hidden?gettext("Offline (hidden)"):this.props.status.is_online?gettext("Online"):this.props.status.is_offline?gettext("Offline"):void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.props.className||"status-label",title:this.getHelp()},void 0,this.getLabel())}}]),n}(u().Component)},7850:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);var d,p,h=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getEmptyMessage",value:function(){return this.props.emptyMessage?this.props.emptyMessage:gettext("No name changes have been recorded for your account.")}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,(0,a.Z)("li",{className:"list-group-item empty-message"},void 0,this.getEmptyMessage())))}}]),u}(u().Component),v=n(19605);var f=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"renderUserAvatar",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{user:this.props.change.changed_by,size:"100"})):d||(d=(0,a.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{size:"100"})))}},{key:"renderUsername",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"item-title"},void 0,this.props.change.changed_by.username):(0,a.Z)("span",{className:"item-title"},void 0,this.props.change.changed_by_username)}},{key:"render",value:function(){return(0,a.Z)("li",{className:"list-group-item"},this.props.change.id,(0,a.Z)("div",{className:"change-avatar"},void 0,this.renderUserAvatar()),(0,a.Z)("div",{className:"change-author"},void 0,this.renderUsername()),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"old-username"},void 0,this.props.change.old_username),p||(p=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"new-username"},void 0,this.props.change.new_username)),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("abbr",{title:this.props.change.changed_on.format("LLL")},void 0,this.props.change.changed_on.fromNow())))}}]),u}(u().Component);var m,Z,g=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,this.props.changes.map((function(e){return(0,a.Z)(f,{change:e},e.id)}))))}}]),u}(u().Component),y=n(44039);var b=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,m||(m=(0,a.Z)("div",{className:"change-avatar"},void 0,(0,a.Z)("span",{className:"user-avatar"},void 0,(0,a.Z)(v.ZP,{size:"100"})))),(0,a.Z)("div",{className:"change-author"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,100)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," "),Z||(Z=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(80,140)+"px"}},void 0," ")))}}]),u}(u().Component);var _,N=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-preview"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,a.Z)(b,{hiddenOnMobile:e>0},e)}))))}}]),u}(u().Component);var k=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,a.Z)(g,{changes:this.props.changes}):(0,a.Z)(h,{emptyMessage:this.props.emptyMessage}):_||(_=(0,a.Z)(N,{}))}}]),u}(u().Component)},40429:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var a,i=n(22928),s=n(57588),o=n.n(s),r=n(19605),l=n(24678);function c(e){var t=e.showStatus,n=e.user;return(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)(u,{showStatus:t,user:n}),(0,i.Z)(d,{user:n}),a||(a=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)(p,{user:n}),(0,i.Z)(h,{user:n}),(0,i.Z)(v,{user:n}))}function u(e){var t=e.showStatus,n=e.user;return t?(0,i.Z)("li",{className:"user-stat-status"},void 0,(0,i.Z)(l.ZP,{status:n.status},void 0,(0,i.Z)(l.pg,{status:n.status,user:n}))):null}function d(e){var t=e.user.joined_on,n=interpolate(gettext("Joined on %(joined_on)s"),{joined_on:t.format("LL, LT")},!0),a=interpolate(gettext("Joined %(joined_on)s"),{joined_on:t.fromNow()},!0);return(0,i.Z)("li",{className:"user-stat-join-date"},void 0,(0,i.Z)("abbr",{title:n},void 0,a))}function p(e){var t=e.user,n=f("user-stat-posts",t.posts),a=ngettext("%(posts)s post","%(posts)s posts",t.posts);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{posts:t.posts},!0))}function h(e){var t=e.user,n=f("user-stat-threads",t.threads),a=ngettext("%(threads)s thread","%(threads)s threads",t.threads);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{threads:t.threads},!0))}function v(e){var t=e.user,n=f("user-stat-followers",t.followers),a=ngettext("%(followers)s follower","%(followers)s followers",t.followers);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{followers:t.followers},!0))}function f(e,t){return 0===t?e+" user-stat-empty":e}function m(e){var t=e.rank,n=e.title||t.title||t.name,a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,i.Z)("a",{className:a,href:t.url},void 0,n):(0,i.Z)("span",{className:a},void 0,n)}function Z(e){var t=e.showStatus,n=e.user,a=n.rank,s="panel user-card";return a.css_class&&(s+=" user-card-"+a.css_class),(0,i.Z)("div",{className:s},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80",user:n})))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200",user:n}))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("a",{href:n.url},void 0,n.username)),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)(m,{rank:a,title:n.title})),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)(c,{showStatus:t,user:n}))))))}var g,y,b,_=n(15671),N=n(43144),k=n(79340),x=n(6215),w=n(61120),R=n(44039);var C,S=function(e){(0,k.Z)(s,e);var t,n,a=(t=s,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(e){return!1}}(),function(){var e,a=(0,w.Z)(t);if(n){var i=(0,w.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,x.Z)(this,e)});function s(){return(0,_.Z)(this,s),a.apply(this,arguments)}return(0,N.Z)(s,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"panel user-card user-card-preview"},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,g||(g=(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,y||(y=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200"})))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),b||(b=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," "))))))))}}]),s}(o().Component);function E(e){var t=e.colClassName,n=e.cols,a=Array.apply(null,{length:n}).map(Number.call,Number);return(0,i.Z)("div",{className:"users-cards-list ui-preview"},void 0,(0,i.Z)("div",{className:"row"},void 0,a.map((function(e){var n=t;return 0!==e&&(n+=" hidden-xs"),3===e&&(n+=" hidden-sm"),(0,i.Z)("div",{className:n},e,C||(C=(0,i.Z)(S,{})))}))))}function P(e){var t=e.cols,n=e.isReady,a=e.showStatus,s=e.users,o="col-xs-12 col-sm-4";return 4===t&&(o+=" col-md-3"),n?(0,i.Z)("div",{className:"users-cards-list ui-ready"},void 0,(0,i.Z)("div",{className:"row"},void 0,s.map((function(e){return(0,i.Z)("div",{className:o},e.id,(0,i.Z)(Z,{showStatus:a,user:e}))})))):(0,i.Z)(E,{colClassName:o,cols:t})}},82125:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var a=n(15671),i=n(43144),s=n(97326),o=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=function(e){(0,o.Z)(d,e);var t,n,u=(t=d,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function d(e){var t;return(0,a.Z)(this,d),t=u.call(this,e),(0,c.Z)((0,s.Z)(t),"toggleNav",(function(){t.setState({dropdown:!t.state.dropdown})})),(0,c.Z)((0,s.Z)(t),"hideNav",(function(){t.setState({dropdown:!1})})),t.state={dropdown:!1},t}return(0,i.Z)(d,[{key:"getCompactNavClassName",value:function(){return this.state.dropdown?"compact-nav open":"compact-nav"}}]),d}(n.n(u)().Component)},7227:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=d.call.apply(d,[this].concat(n)),(0,u.Z)((0,o.Z)(e),"toggle",(function(){e.props.onChange({target:{value:!e.props.value}})})),e}return(0,s.Z)(p,[{key:"getClassName",value:function(){return this.props.value?"btn btn-yes-no btn-yes-no-on":"btn btn-yes-no btn-yes-no-off"}},{key:"getIcon",value:function(){return this.props.value?this.props.iconOn||"check_box":this.props.iconOff||"check_box_outline_blank"}},{key:"getLabel",value:function(){return this.props.value?this.props.labelOn||gettext("yes"):this.props.labelOff||gettext("no")}},{key:"render",value:function(){return(0,a.Z)("button",{type:"button",onClick:this.toggle,className:this.getClassName(),id:this.props.id||null,"aria-describedby":this.props["aria-describedby"]||null,disabled:this.props.disabled||!1},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.getIcon()),(0,a.Z)("span",{className:"btn-text"},void 0,this.getLabel()))}}]),p}(n.n(d)().Component)},32233:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});var a=n(15671),i=n(43144),s=(n(58294),n(95377),n(68852),n(39737),n(14316),n(43204),n(43511),n(7023),function(){function e(t){(0,a.Z)(this,e),this.isOrdered=!1,this._items=t||[]}return(0,i.Z)(e,[{key:"add",value:function(e,t,n){this._items.push({key:e,item:t,after:n&&n.after||null,before:n&&n.before||null})}},{key:"get",value:function(e,t){for(var n=0;n<this._items.length;n++)if(this._items[n].key===e)return this._items[n].item;return t}},{key:"has",value:function(e){return void 0!==this.get(e)}},{key:"values",value:function(){for(var e=[],t=0;t<this._items.length;t++)e.push(this._items[t].item);return e}},{key:"order",value:function(e){return this.isOrdered||(this._items=this._order(this._items),this.isOrdered=!0),e||void 0===e?this.values():this._items}},{key:"orderedValues",value:function(){return this.order(!0)}},{key:"_order",value:function(e){var t=[];e.forEach((function(e){t.push(e.key)}));var n=[],a=[];function i(e){var t=-1;-1===a.indexOf(e.key)&&(e.after?-1!==(t=a.indexOf(e.after))&&(t+=1):e.before&&(t=a.indexOf(e.before)),-1!==t&&(n.splice(t,0,e),a.splice(t,0,e.key)))}e.forEach((function(e){e.after||e.before||(n.push(e),a.push(e.key))})),e.forEach((function(e){"_end"===e.before&&(n.push(e),a.push(e.key))}));for(var s=200;s>0&&t.length!==a.length;)s-=1,e.forEach(i);return n}}]),e}()),o=new(function(){function e(){(0,a.Z)(this,e),this._initializers=[],this._context={}}return(0,i.Z)(e,[{key:"addInitializer",value:function(e){this._initializers.push({key:e.name,item:e.initializer,after:e.after,before:e.before})}},{key:"init",value:function(e){var t=this;this._context=e,new s(this._initializers).orderedValues().forEach((function(e){e(t)}))}},{key:"has",value:function(e){return!!this._context[e]}},{key:"get",value:function(e,t){return this.has(e)?this._context[e]:t||void 0}},{key:"pop",value:function(e){if(this.has(e)){var t=this._context[e];return this._context[e]=null,t}}}]),e}());window.misago=o;var r=o},58339:function(e,t,n){"use strict";var a=n(32233),i=n(78657);a.Z.addInitializer({name:"ajax",initializer:function(){i.Z.init(a.Z.get("CSRF_COOKIE_NAME"))}})},64109:function(e,t,n){"use strict";var a=n(32233),i=n(35486),s=n(78657),o=n(53904),r=n(90287);a.Z.addInitializer({name:"auth-sync",initializer:function(e){e.get("isAuthenticated")&&window.setInterval((function(){s.Z.get(e.get("AUTH_API")).then((function(e){r.Z.dispatch((0,i.r$)(e))}),(function(e){o.Z.apiError(e)}))}),45e3)},after:"auth"})},46226:function(e,t,n){"use strict";var a=n(32233),i=n(98274),s=n(59801),o=n(90287),r=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(o.Z,r.Z,s.Z)},after:"store"})},93240:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(93825),o=n(96142),r=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(e){s.ZP.init(e,i.Z,o.Z,r.Z)}})},75147:function(e,t,n){"use strict";var a=n(22928),i=n(57588),s=n.n(i),o=n(32233),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(78657);var f=function(e){(0,u.Z)(s,e);var t,n,i=(t=s,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function s(e){var t;return(0,r.Z)(this,s),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"handleDecline",(function(){t.state.submiting||window.confirm(gettext("Declining will result in immediate deactivation and deletion of your account. This action is not reversible."))&&(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!1}).then((function(){window.location.reload(!0)})))})),(0,h.Z)((0,c.Z)(t),"handleAccept",(function(){t.state.submiting||(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!0}).then((function(){window.location.reload(!0)})))})),t.state={submiting:!1},t}return(0,l.Z)(s,[{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("button",{className:"btn btn-default",disabled:this.state.submiting,type:"buton",onClick:this.handleDecline},void 0,gettext("Decline")),(0,a.Z)("button",{className:"btn btn-primary",disabled:this.state.submiting,type:"buton",onClick:this.handleAccept},void 0,gettext("Accept and continue")))}}]),s}(s().Component),m=n(4869);o.Z.addInitializer({name:"component:accept-agreement",initializer:function(e){document.getElementById("required-agreement-mount")&&(0,m.Z)((0,a.Z)(f,{api:e.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"refresh",value:function(){window.location.reload()}},{key:"getMessage",value:function(){return this.props.signedIn?interpolate(gettext("You have signed in as %(username)s. Please refresh the page before continuing."),{username:this.props.signedIn.username},!0):this.props.signedOut?interpolate(gettext("%(username)s, you have been signed out. Please refresh the page before continuing."),{username:this.props.user.username},!0):void 0}},{key:"render",value:function(){var e="auth-message";return(this.props.signedIn||this.props.signedOut)&&(e+=" show"),(0,s.Z)("div",{className:e},void 0,(0,s.Z)("div",{className:"container"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,s.Z)("p",{},void 0,(0,s.Z)("button",{className:"btn btn-default",type:"button",onClick:this.refresh},void 0,gettext("Reload page")),(0,s.Z)("span",{className:"hidden-xs hidden-sm"},void 0," "+gettext("or press F5 key.")))))}}]),i}(n.n(d)().Component);function h(e){return{user:e.auth.user,signedIn:e.auth.signedIn,signedOut:e.auth.signedOut}}var v=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,v.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:function(e,t,n){"use strict";var a=n(32233),i=n(93051);a.Z.addInitializer({name:"component:banmed-page",initializer:function(e){e.has("BAN_MESSAGE")&&(0,i.Z)(e.get("BAN_MESSAGE"),!1)},after:"store"})},3026:function(e,t,n){"use strict";var a=n(37424),i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=n(30381),h=n.n(p),v=n(57588),f=n.n(v);function m(e){return(0,i.Z)("div",{className:"categories-list"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("No categories exist or you don't have permission to see them.")))))}function Z(e){var t=e.category;return t.description?(0,i.Z)("div",{className:"category-description",dangerouslySetInnerHTML:{__html:t.description.html}}):null}function g(e){var t=e.category;return(0,i.Z)("div",{className:y(t),title:b(t)},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)))}function y(e){return e.is_read?"read-status item-read":"read-status item-new"}function b(e){return e.is_closed?e.is_read?gettext("This category has no new posts. (closed)"):gettext("This category has new posts. (closed)"):e.is_read?gettext("This category has no new posts."):gettext("This category has new posts.")}function _(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-6 category-main"},void 0,(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)(g,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("h4",{className:"media-heading"},void 0,(0,i.Z)("a",{href:t.url.index},void 0,t.name)),(0,i.Z)(Z,{category:t}))))}var N,k,x,w=n(19605);function R(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-4 category-last-thread"},void 0,(0,i.Z)(C,{category:t}),(0,i.Z)(P,{category:t}),(0,i.Z)(L,{category:t}),(0,i.Z)(T,{category:t}))}function C(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads&&t.last_thread_title?(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left hidden-xs"},void 0,(0,i.Z)(S,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("div",{className:"media-heading"},void 0,(0,i.Z)("a",{className:"item-title thread-title",href:t.url.last_thread_new,title:t.last_thread_title},void 0,t.last_thread_title)),(0,i.Z)("ul",{className:"list-inline"},void 0,(0,i.Z)("li",{className:"category-last-thread-poster"},void 0,(0,i.Z)(E,{category:t})),N||(N=(0,i.Z)("li",{className:"divider"},void 0,"—")),(0,i.Z)("li",{className:"category-last-thread-date"},void 0,(0,i.Z)("a",{href:t.url.last_post},void 0,t.last_post_on.fromNow()))))):null}function S(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"last-poster-avatar",href:t.last_poster.url,title:t.last_poster_name},void 0,(0,i.Z)(w.ZP,{className:"media-object",size:40,user:t.last_poster})):(0,i.Z)("span",{className:"last-poster-avatar",title:t.last_poster_name},void 0,k||(k=(0,i.Z)(w.ZP,{className:"media-object",size:40})))}function E(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"item-title",href:t.last_poster.url},void 0,t.last_poster_name):(0,i.Z)("span",{className:"item-title"},void 0,t.last_poster_name)}function P(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads?t.last_thread_title?null:(0,i.Z)(O,{message:gettext("This category is empty. No threads were posted within it so far.")}):null}function L(e){var t=e.category;return t.acl.can_browse?t.acl.can_see_all_threads?null:(0,i.Z)(O,{message:gettext("This category is private. You can see only your own threads within it.")}):null}function T(e){return e.category.acl.can_browse?null:(0,i.Z)(O,{message:gettext("This category is protected. You can't browse its contents.")})}function O(e){var t=e.message;return(0,i.Z)("div",{className:"media category-thread-message"},void 0,x||(x=(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("p",{},void 0,t)))}function A(e){var t=e.category;return(0,i.Z)("div",{className:"col-md-2 hidden-xs hidden-sm"},void 0,(0,i.Z)("ul",{className:"list-unstyled category-stats"},void 0,(0,i.Z)(B,{threads:t.threads}),(0,i.Z)(I,{posts:t.posts})))}function B(e){var t=e.threads,n=ngettext("%(threads)s thread","%(threads)s threads",t);return(0,i.Z)("li",{className:"category-stat-threads"},void 0,interpolate(n,{threads:t},!0))}function I(e){var t=e.posts,n=ngettext("%(posts)s post","%(posts)s posts",t);return(0,i.Z)("li",{className:"category-stat-posts"},void 0,interpolate(n,{posts:t},!0))}function D(e){var t=e.category,n="btn btn-default btn-block btn-sm btn-subcategory";return t.is_read||(n+=" btn-subcategory-new"),(0,i.Z)("div",{className:"col-xs-12 col-sm-4 col-md-3"},void 0,(0,i.Z)("a",{className:n,href:t.url.index},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)),(0,i.Z)("span",{className:"icon-text"},void 0,t.name)))}function j(e){var t=e.category;return e.isFirst||0===t.subcategories.length?null:(0,i.Z)("div",{className:"row subcategories-list"},void 0,t.subcategories.map((function(e){return(0,i.Z)(D,{category:e},e.id)})))}function z(e){var t=e.category,n=e.isFirst,a="list-group-item";return t.description?a+=" list-group-category-has-description":a+=" list-group-category-no-description",n&&(a+=" list-group-item-first"),t.css_class&&(a+=" list-group-category-has-flavor",a+=" list-group-item-category-"+t.css_class),(0,i.Z)("li",{className:a},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)(_,{category:t}),(0,i.Z)(A,{category:t}),(0,i.Z)(R,{category:t})),(0,i.Z)(j,{category:t,isFirst:n}))}function U(e){var t=e.category,n="list-group list-group-category";return t.css_class&&(n+=" list-group-category-has-flavor",n+=" list-group-category-"+t.css_class),(0,i.Z)("ul",{className:n},void 0,(0,i.Z)(z,{category:t,isFirst:!0}),t.subcategories.map((function(e){return(0,i.Z)(z,{category:e,isFirst:!1},e.id)})))}function M(e){var t=e.categories;return(0,i.Z)("div",{className:"categories-list"},void 0,t.map((function(e){return(0,i.Z)(U,{category:e},e.id)})))}var q,H=n(32233),F=n(55547);var Y=function e(t){return Object.assign({},t,{last_post_on:t.last_post_on?h()(t.last_post_on):null,subcategories:t.subcategories.map(e)})},V=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;return(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"update",(function(e){t.setState({categories:e.map(Y)})})),t.state={categories:H.Z.get("CATEGORIES").map(Y)},t.startPolling(H.Z.get("CATEGORIES_API")),t}return(0,o.Z)(p,[{key:"startPolling",value:function(e){F.Z.start({poll:"categories",url:e,frequency:18e4,update:this.update})}},{key:"render",value:function(){var e=this.state.categories;return 0===e.length?q||(q=(0,i.Z)(m,{})):(0,i.Z)(M,{categories:e})}}]),p}(f().Component);function G(e){return{tick:e.tick.tick}}var $=n(4869);H.Z.addInitializer({name:"component:categories",initializer:function(){document.getElementById("categories-mount")&&(0,$.Z)((0,a.$j)(G)(V),"categories-mount")},after:"store"})},94795:function(e,t,n){"use strict";var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(37424),p=n(69987),h=n(94417);function v(e){return(0,a.Z)("div",{className:"list-group nav-side"},void 0,e.options.map((function(t){return(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",className:"list-group-item",activeClassName:"active"},t.component,(0,a.Z)("span",{className:"material-icon"},void 0,t.icon),t.name)})))}function f(e){return(0,a.Z)("ul",{className:e.className||"dropdown-menu",role:"menu"},void 0,e.options.map((function(t){return(0,a.Z)(h.Z,{path:e.baseUrl+t.component+"/"},t.component,(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",onClick:e.hideNav},void 0,(0,a.Z)("span",{className:"material-icon hidden-sm"},void 0,t.icon),t.name))})))}var m,Z=n(97326),g=n(4942),y=n(82211),b=n(78657),_=n(53328),N=n(53904),k=n(90287),x=n(32233);var w=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"onPasswordChange",(function(e){t.setState({password:e.target.value})})),(0,g.Z)((0,Z.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.state,a=n.isLoading,i=n.password,s=t.props.user;return 0==i.length?(N.Z.error(gettext("Enter your password to confirm account deletion.")),!1):!a&&(t.setState({isLoading:!0}),void b.Z.post(s.api.delete,{password:i}).then((function(e){window.location.href=x.Z.get("MISAGO_PATH")}),(function(e){t.setState({isLoading:!1}),e.password?N.Z.error(e.password[0]):N.Z.apiError(e)})))})),t.state={isLoading:!1,password:""},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Delete account"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-danger panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Delete account"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("You are going to delete your account. This action is nonreversible, and will result in following data being deleted:")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Stored IP addresses associated with content that you have posted will be deleted.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your username will become available for other user to rename to or for new user to register their account with.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your e-mail will become available for use in new account registration.")),m||(m=(0,a.Z)("hr",{})),(0,a.Z)("p",{},void 0,gettext("All your posted content will NOT be deleted, but username associated with it will be changed to one shared by all deleted accounts."))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)("div",{className:"input-group"},void 0,(0,a.Z)("input",{className:"form-control",disabled:this.state.isLoading,name:"password-confirmation",type:"password",placeholder:gettext("Enter your password to confirm account deletion."),value:this.state.password,onChange:this.onPasswordChange}),(0,a.Z)("span",{className:"input-group-btn"},void 0,(0,a.Z)(y.Z,{className:"btn-danger",loading:this.state.isLoading},void 0,gettext("Delete my account")))))))}}]),u}(u().Component),R=n(21688);var C=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;a<t;a++)n[a]=arguments[a];return e=c.call.apply(c,[this].concat(n)),(0,g.Z)((0,Z.Z)(e),"onSuccess",(function(){N.Z.info(gettext("Your details have been updated."))})),e}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Edit details"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)(R.Z,{api:this.props.user.api.edit_details,onSuccess:this.onSuccess})}}]),u}(u().Component),S=n(30381),E=n.n(S);var P=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"handleLoadDownloads",(function(){b.Z.get(t.props.user.api.data_downloads).then((function(e){t.setState({isLoading:!1,downloads:e})}),(function(e){N.Z.apiError(e)}))})),(0,g.Z)((0,Z.Z)(t),"handleRequestDataDownload",(function(){t.setState({isSubmiting:!0}),b.Z.post(t.props.user.api.request_data_download).then((function(){t.handleLoadDownloads(),N.Z.success(gettext("Your request for data download has been registered.")),t.setState({isSubmiting:!1})}),(function(e){N.Z.apiError(e),t.setState({isSubmiting:!1})}))})),t.state={isLoading:!1,isSubmiting:!1,downloads:[]},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Download your data"),parent:gettext("Change your options")}),this.handleLoadDownloads()}},{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Download your data"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("p",{},void 0,gettext('To download your data from the site, click the "Request data download" button. Depending on amount of data to be archived and number of users wanting to download their data at same time it may take up to few days for your download to be prepared. An e-mail with notification will be sent to you when your data is ready to be downloaded.')),(0,a.Z)("p",{},void 0,gettext("The download will only be available for limited amount of time, after which it will be deleted from the site and marked as expired."))),(0,a.Z)("table",{className:"table"},void 0,(0,a.Z)("thead",{},void 0,(0,a.Z)("tr",{},void 0,(0,a.Z)("th",{},void 0,gettext("Requested on")),(0,a.Z)("th",{className:"col-md-4"},void 0,gettext("Download")))),(0,a.Z)("tbody",{},void 0,this.state.downloads.map((function(e){return(0,a.Z)("tr",{},e.id,(0,a.Z)("td",{style:L},void 0,E()(e.requested_on).fromNow()),(0,a.Z)("td",{},void 0,(0,a.Z)(T,{exportFile:e.file,status:e.status})))})),0==this.state.downloads.length?(0,a.Z)("tr",{},void 0,(0,a.Z)("td",{colSpan:"2"},void 0,gettext("You have no data downloads."))):null)),(0,a.Z)("div",{className:"panel-footer text-right"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isSubmiting,type:"button",onClick:this.handleRequestDataDownload},void 0,gettext("Request data download")))))}}]),u}(u().Component),L={verticalAlign:"middle"},T=function(e){var t=e.exportFile,n=e.status;return 0===n||1===n?(0,a.Z)(y.Z,{className:"btn-info btn-sm btn-block",disabled:!0,type:"button"},void 0,gettext("Download is being prepared")):t?(0,a.Z)("a",{className:"btn btn-success btn-sm btn-block",href:t},void 0,gettext("Download your data")):(0,a.Z)(y.Z,{className:"btn-default btn-sm btn-block",disabled:!0,type:"button"},void 0,gettext("Download is expired"))},O=n(43345),A=n(96359),B=n(60471),I=n(7227),D=n(35486);var j,z=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={isLoading:!1,is_hiding_presence:e.user.is_hiding_presence,limits_private_thread_invites_to:e.user.limits_private_thread_invites_to,subscribe_to_started_threads:e.user.subscribe_to_started_threads,subscribe_to_replied_threads:e.user.subscribe_to_replied_threads,errors:{}},t.privateThreadInvitesChoices=[{value:0,icon:"help_outline",label:gettext("Everybody")},{value:1,icon:"done_all",label:gettext("Users I follow")},{value:2,icon:"highlight_off",label:gettext("Nobody")}],t.subscribeToChoices=[{value:0,icon:"star_border",label:gettext("No")},{value:1,icon:"star_half",label:gettext("Notify")},{value:2,icon:"star",label:gettext("Notify with e-mail")}],t}return(0,s.Z)(u,[{key:"send",value:function(){return b.Z.post(this.props.user.api.options,{is_hiding_presence:this.state.is_hiding_presence,limits_private_thread_invites_to:this.state.limits_private_thread_invites_to,subscribe_to_started_threads:this.state.subscribe_to_started_threads,subscribe_to_replied_threads:this.state.subscribe_to_replied_threads})}},{key:"handleSuccess",value:function(){k.Z.dispatch((0,D.r$)({is_hiding_presence:this.state.is_hiding_presence,limits_private_thread_invites_to:this.state.limits_private_thread_invites_to,subscribe_to_started_threads:this.state.subscribe_to_started_threads,subscribe_to_replied_threads:this.state.subscribe_to_replied_threads})),N.Z.success(gettext("Your forum options have been changed."))}},{key:"handleError",value:function(e){400===e.status?N.Z.error(gettext("Please reload page and try again.")):N.Z.apiError(e)}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Forum options"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change forum options"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,gettext("Privacy settings")),(0,a.Z)(A.Z,{label:gettext("Hide my presence"),helpText:gettext("If you hide your presence, only members with permission to see hidden users will see when you are online."),for:"id_is_hiding_presence"},void 0,(0,a.Z)(I.Z,{id:"id_is_hiding_presence",disabled:this.state.isLoading,iconOn:"visibility_off",iconOff:"visibility",labelOn:gettext("Hide my presence from other users"),labelOff:gettext("Show my presence to other users"),onChange:this.bindInput("is_hiding_presence"),value:this.state.is_hiding_presence})),(0,a.Z)(A.Z,{label:gettext("Private thread invitations"),for:"id_limits_private_thread_invites_to"},void 0,(0,a.Z)(B.Z,{id:"id_limits_private_thread_invites_to",disabled:this.state.isLoading,onChange:this.bindInput("limits_private_thread_invites_to"),value:this.state.limits_private_thread_invites_to,choices:this.privateThreadInvitesChoices}))),(0,a.Z)("fieldset",{},void 0,(0,a.Z)("legend",{},void 0,gettext("Automatic subscriptions")),(0,a.Z)(A.Z,{label:gettext("Threads I start"),for:"id_subscribe_to_started_threads"},void 0,(0,a.Z)(B.Z,{id:"id_subscribe_to_started_threads",disabled:this.state.isLoading,onChange:this.bindInput("subscribe_to_started_threads"),value:this.state.subscribe_to_started_threads,choices:this.subscribeToChoices})),(0,a.Z)(A.Z,{label:gettext("Threads I reply to"),for:"id_subscribe_to_replied_threads"},void 0,(0,a.Z)(B.Z,{id:"id_subscribe_to_replied_threads",disabled:this.state.isLoading,onChange:this.bindInput("subscribe_to_replied_threads"),value:this.state.subscribe_to_replied_threads,choices:this.subscribeToChoices})))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes")))))}}]),u}(O.Z),U=n(95187);function M(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),j||(j=(0,a.Z)(U.Z,{})))}var q=n(33556);var H=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.options.next_on?interpolate(gettext("You will be able to change your username %(next_change)s."),{next_change:this.props.options.next_on.fromNow()},!0):gettext("You have used up available name changes.")}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),(0,a.Z)(q.Z,{helpText:this.getHelpText(),message:gettext("You can't change your username at the moment.")}))}}]),u}(u().Component),F=n(55210);var Y,V=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={username:"",validators:{username:[F.lG(),F.HR(e.options.length_min),F.gS(e.options.length_max)]},isLoading:!1},t}return(0,s.Z)(u,[{key:"getHelpText",value:function(){var e=[];if(this.props.options.changes_left>0){var t=ngettext("You can change your username %(changes_left)s more time.","You can change your username %(changes_left)s more times.",this.props.options.changes_left);e.push(interpolate(t,{changes_left:this.props.options.changes_left},!0))}if(this.props.user.acl.name_changes_expire>0){var n=ngettext("Used changes become available again after %(name_changes_expire)s day.","Used changes become available again after %(name_changes_expire)s days.",this.props.user.acl.name_changes_expire);e.push(interpolate(n,{name_changes_expire:this.props.user.acl.name_changes_expire},!0))}return e.length?e.join(" "):null}},{key:"clean",value:function(){var e=this.validate();return e.username?(N.Z.error(e.username[0]),!1):this.state.username.trim()!==this.props.user.username||(N.Z.info(gettext("Your new username is same as current one.")),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.username,{username:this.state.username})}},{key:"handleSuccess",value:function(e){this.setState({username:""}),this.props.complete(e.username,e.slug,e.options)}},{key:"handleError",value:function(e){N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change username"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New username"),for:"id_username",helpText:this.getHelpText()},void 0,(0,a.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change username")))))}}]),u}(O.Z),G=n(7850),$=n(48927),W=n(6935);var Q,K=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"onComplete",(function(e,n,a){t.setState({options:a}),k.Z.dispatch((0,$.KP)({username:e,slug:n},t.props.user,t.props.user)),k.Z.dispatch((0,W._S)(t.props.user,e,n)),N.Z.success(gettext("Your username has been changed successfully."))})),t.state={isLoaded:!1,options:null},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){var e=this;_.Z.set({title:gettext("Change username"),parent:gettext("Change your options")}),Promise.all([b.Z.get(this.props.user.api.username),b.Z.get(x.Z.get("USERNAME_CHANGES_API"),{user:this.props.user.id})]).then((function(t){k.Z.dispatch((0,$.ZB)(t[1].results)),e.setState({isLoaded:!0,options:{changes_left:t[0].changes_left,length_min:t[0].length_min,length_max:t[0].length_max,next_on:t[0].next_on?E()(t[0].next_on):null}})}))}},{key:"getChangeForm",value:function(){return this.state.isLoaded?0===this.state.options.changes_left?(0,a.Z)(H,{options:this.state.options}):(0,a.Z)(V,{complete:this.onComplete,options:this.state.options,user:this.props.user}):Y||(Y=(0,a.Z)(M,{}))}},{key:"render",value:function(){return(0,a.Z)("div",{},void 0,this.getChangeForm(),(0,a.Z)(G.Z,{changes:this.props["username-history"],isLoaded:this.state.isLoaded}))}}]),u}(u().Component);var J,X=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={new_email:"",password:"",validators:{new_email:[F.Do()],password:[]},isLoading:!1},t}return(0,s.Z)(u,[{key:"clean",value:function(){var e=this.validate();return-1!==[this.state.new_email.trim().length,this.state.password.trim().length].indexOf(0)?(N.Z.error(gettext("Fill out all fields.")),!1):!e.new_email||(N.Z.error(e.new_email[0]),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.change_email,{new_email:this.state.new_email,password:this.state.password})}},{key:"handleSuccess",value:function(e){this.setState({new_email:"",password:""}),N.Z.success(e.detail)}},{key:"handleError",value:function(e){400===e.status?e.new_email?N.Z.error(e.new_email):N.Z.error(e.password):N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change e-mail address"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New e-mail"),for:"id_new_email"},void 0,(0,a.Z)("input",{type:"text",id:"id_new_email",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("new_email"),value:this.state.new_email})),Q||(Q=(0,a.Z)("hr",{})),(0,a.Z)(A.Z,{label:gettext("Your current password"),for:"id_confirm_email"},void 0,(0,a.Z)("input",{type:"password",id:"id_confirm_email",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change e-mail")))))}}]),u}(O.Z);var ee,te,ne,ae=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),(t=c.call(this,e)).state={new_password:"",repeat_password:"",password:"",validators:{new_password:[],repeat_password:[],password:[]},isLoading:!1},t}return(0,s.Z)(u,[{key:"clean",value:function(){var e=this.validate();return-1!==[this.state.new_password.trim().length,this.state.repeat_password.trim().length,this.state.password.trim().length].indexOf(0)?(N.Z.error(gettext("Fill out all fields.")),!1):e.new_password?(N.Z.error(e.new_password[0]),!1):this.state.new_password===this.state.repeat_password||(N.Z.error(gettext("New passwords are different.")),!1)}},{key:"send",value:function(){return b.Z.post(this.props.user.api.change_password,{new_password:this.state.new_password,password:this.state.password})}},{key:"handleSuccess",value:function(e){this.setState({new_password:"",repeat_password:"",password:""}),N.Z.success(e.detail)}},{key:"handleError",value:function(e){400===e.status?e.new_password?N.Z.error(e.new_password):N.Z.error(e.password):N.Z.apiError(e)}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("input",{type:"type",style:{display:"none"}}),(0,a.Z)("input",{type:"password",style:{display:"none"}}),(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change password"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(A.Z,{label:gettext("New password"),for:"id_new_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_new_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("new_password"),value:this.state.new_password})),(0,a.Z)(A.Z,{label:gettext("Repeat password"),for:"id_repeat_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_repeat_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("repeat_password"),value:this.state.repeat_password})),J||(J=(0,a.Z)("hr",{})),(0,a.Z)(A.Z,{label:gettext("Your current password"),for:"id_confirm_password"},void 0,(0,a.Z)("input",{type:"password",id:"id_confirm_password",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)(y.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change password")))))}}]),u}(O.Z),ie=function(){return(0,a.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Change email or password"))),(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,ee||(ee=(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("You need to set a password for your account to be able to change your username or email.")),(0,a.Z)("p",{className:"help-block"},void 0,(0,a.Z)("a",{className:"btn btn-primary",href:x.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Set password"))))))};var se,oe=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Change email or password"),parent:gettext("Change your options")})}},{key:"render",value:function(){return this.props.user.has_usable_password?(0,a.Z)("div",{},void 0,(0,a.Z)(X,{user:this.props.user}),(0,a.Z)(ae,{user:this.props.user}),(0,a.Z)("p",{className:"message-line"},void 0,ne||(ne=(0,a.Z)("span",{className:"material-icon"},void 0,"warning")),(0,a.Z)("a",{href:x.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Change forgotten password")))):te||(te=(0,a.Z)(ie,{}))}}]),u}(u().Component),re=n(82125),le=n(98936),ce=n(59131),ue=n(99755);var de=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,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(e){return!1}}(),function(){var e,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){var e=this,t=x.Z.get("USER_OPTIONS").filter((function(t){var n=x.Z.get("USERCP_URL")+t.component+"/";return e.props.location.pathname.substr(0,n.length)===n}))[0];return(0,a.Z)("div",{className:"page page-options"},void 0,(0,a.Z)(ue.sP,{},void 0,(0,a.Z)(ue.mr,{styleName:"options"},void 0,(0,a.Z)(ue.gC,{styleName:"options"},void 0,(0,a.Z)(le.gq,{},void 0,(0,a.Z)(le.kw,{auto:!0},void 0,(0,a.Z)(le.Z6,{auto:!0},void 0,(0,a.Z)("h1",{},void 0,gettext("Change your options"))),(0,a.Z)(le.Z6,{className:"hidden-xs hidden-md hidden-lg",shrink:!0},void 0,(0,a.Z)("div",{className:"dropdown"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Menu"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,se||(se=(0,a.Z)("span",{className:"material-icon"},void 0,"menu"))),(0,a.Z)(f,{className:"dropdown-menu dropdown-menu-right",baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})))),(0,a.Z)(le.kw,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,a.Z)(le.Z6,{},void 0,(0,a.Z)("div",{className:"dropdown"},void 0,(0,a.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-block dropdown-toggle","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,t.icon),t.name),(0,a.Z)(f,{className:"dropdown-menu",baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})))))))),(0,a.Z)(ce.Z,{},void 0,(0,a.Z)("div",{className:"row"},void 0,(0,a.Z)("div",{className:"col-md-3 hidden-xs hidden-sm"},void 0,(0,a.Z)(v,{baseUrl:x.Z.get("USERCP_URL"),options:x.Z.get("USER_OPTIONS")})),(0,a.Z)("div",{className:"col-md-9"},void 0,this.props.children))))}}]),u}(re.Z);function pe(e){return{tick:e.tick.tick,user:e.auth.user,"username-history":e["username-history"]}}function he(){var e=[{path:x.Z.get("USERCP_URL")+"forum-options/",component:(0,d.$j)(pe)(z)},{path:x.Z.get("USERCP_URL")+"edit-details/",component:(0,d.$j)(pe)(C)}],t=x.Z.get("SETTINGS").DELEGATE_AUTH;return t||(e.push({path:x.Z.get("USERCP_URL")+"change-username/",component:(0,d.$j)(pe)(K)}),e.push({path:x.Z.get("USERCP_URL")+"sign-in-credentials/",component:(0,d.$j)(pe)(oe)})),x.Z.get("ENABLE_DOWNLOAD_OWN_DATA")&&e.push({path:x.Z.get("USERCP_URL")+"download-data/",component:(0,d.$j)(pe)(P)}),!t&&x.Z.get("ENABLE_DELETE_OWN_ACCOUNT")&&e.push({path:x.Z.get("USERCP_URL")+"delete-account/",component:(0,d.$j)(pe)(w)}),e}var ve=n(39633);x.Z.addInitializer({name:"component:options",initializer:function(e){e.has("USER_OPTIONS")&&(0,ve.Z)({root:x.Z.get("USERCP_URL"),component:de,paths:he()})},after:"store"})},95563:function(e,t,n){"use strict";var a,i=n(37424),s=n(22928),o=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(57588),v=n.n(h),f=n(30381),m=n.n(f),Z=n(95187),g=n(33556),y=n(32233),b=n(55547),_=n(53328);var N=function(e){(0,c.Z)(h,e);var t,n,i=(t=h,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(e){var t;return(0,o.Z)(this,h),t=i.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){e.expires_on&&(e.expires_on=m()(e.expires_on)),t.setState({isLoaded:!0,error:null,ban:e})})),(0,p.Z)((0,l.Z)(t),"error",(function(e){t.setState({isLoaded:!0,error:e.detail,ban:null})})),y.Z.has("PROFILE_BAN")?t.initWithPreloadedData(y.Z.pop("PROFILE_BAN")):t.initWithoutPreloadedData(),t.startPolling(e.profile.api.ban),t}return(0,r.Z)(h,[{key:"initWithPreloadedData",value:function(e){e.expires_on&&(e.expires_on=m()(e.expires_on)),this.state={isLoaded:!0,ban:e}}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){b.Z.start({poll:"ban-details",url:e,frequency:9e4,update:this.update,error:this.error})}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Ban details"),parent:this.props.profile.username})}},{key:"componentWillUnmount",value:function(){b.Z.stop("ban-details")}},{key:"getUserMessage",value:function(){return this.state.ban.user_message?(0,s.Z)("div",{className:"panel-body ban-message ban-user-message"},void 0,(0,s.Z)("h4",{},void 0,gettext("User-shown ban message")),(0,s.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.user_message.html}})):null}},{key:"getStaffMessage",value:function(){return this.state.ban.staff_message?(0,s.Z)("div",{className:"panel-body ban-message ban-staff-message"},void 0,(0,s.Z)("h4",{},void 0,gettext("Team-shown ban message")),(0,s.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.state.ban.staff_message.html}})):null}},{key:"getExpirationMessage",value:function(){if(this.state.ban.expires_on){if(this.state.ban.expires_on.isAfter(m()())){var e=interpolate(gettext("This ban expires on %(expires_on)s."),{expires_on:this.state.ban.expires_on.format("LL, LT")},!0),t=interpolate(gettext("This ban expires %(expires_on)s."),{expires_on:this.state.ban.expires_on.fromNow()},!0);return(0,s.Z)("abbr",{title:e},void 0,t)}return gettext("This ban has expired.")}return interpolate(gettext("%(username)s's ban is permanent."),{username:this.props.profile.username},!0)}},{key:"getPanelBody",value:function(){return this.state.ban?Object.keys(this.state.ban).length?(0,s.Z)("div",{},void 0,this.getUserMessage(),this.getStaffMessage(),(0,s.Z)("div",{className:"panel-body ban-expires"},void 0,(0,s.Z)("h4",{},void 0,gettext("Ban expiration")),(0,s.Z)("p",{className:"lead"},void 0,this.getExpirationMessage()))):(0,s.Z)("div",{},void 0,(0,s.Z)(g.Z,{message:gettext("No ban is active at the moment.")})):this.state.error?(0,s.Z)("div",{},void 0,(0,s.Z)(g.Z,{icon:"error_outline",message:this.state.error})):a||(a=(0,s.Z)("div",{},void 0,(0,s.Z)(Z.Z,{})))}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-ban-details"},void 0,(0,s.Z)("div",{className:"panel panel-default"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Ban details"))),this.getPanelBody()))}}]),h}(v().Component),k=n(21688);function x(e){var t=e.api,n=e.display,a=e.onCancel,i=e.onSuccess;return n?(0,s.Z)(k.Z,{api:t,onCancel:a,onSuccess:i}):null}function w(e){var t,n=e.isAuthenticated,a=e.profile;return t=n?gettext("You are not sharing any details with others."):interpolate(gettext("%(username)s is not sharing any details with others."),{username:a.username},!0),(0,s.Z)("div",{className:"panel panel-default"},void 0,(0,s.Z)("div",{className:"panel-body text-center lead"},void 0,t))}function R(e){var t=e.html,n=e.text,a=e.url;return t?(0,s.Z)("div",{className:"form-control-static col-md-9",dangerouslySetInnerHTML:{__html:t}}):(0,s.Z)("div",{className:"form-control-static col-md-9"},void 0,(0,s.Z)(C,{text:n,url:a}))}function C(e){var t=e.text,n=e.url;return n?(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:n,target:"_blank",rel:"nofollow"},void 0,t||n)):t?(0,s.Z)("p",{},void 0,t):null}function S(e){return(0,s.Z)("div",{className:"form-group"},void 0,(0,s.Z)("strong",{className:"control-label col-md-3"},void 0,e.name,":"),v().createElement(R,e))}function E(e){var t=e.fields,n=e.name;return(0,s.Z)("div",{className:"panel panel-default panel-profile-details-group"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,n)),(0,s.Z)("div",{className:"panel-body"},void 0,(0,s.Z)("div",{className:"form-horizontal"},void 0,t.map((function(e){var t=e.fieldname,n=e.html,a=e.name,i=e.text,o=e.url;return(0,s.Z)(S,{name:a,html:n,text:i,url:o},t)})))))}var P,L=n(37848);function T(e){var t=e.display,n=e.groups,a=e.isAuthenticated,i=e.loading,o=e.profile;return t?i?P||(P=(0,s.Z)(L.Z,{})):n.length?(0,s.Z)("div",{},void 0,n.map((function(e,t){return(0,s.Z)(E,{fields:e.fields,name:e.name},t)}))):(0,s.Z)(w,{isAuthenticated:a,profile:o}):null}var O=n(92490),A=function(e){var t=e.onEdit,n=e.showEditButton;return(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,gettext("Details")))),n&&(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)("button",{className:"btn btn-default btn-outline btn-block",onClick:t,type:"button"},void 0,gettext("Edit")))))},B=n(58598),I=n(78657),D=n(53904);var j=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,n=e.dispatch,a=e.user;t&&t.id===a.id||I.Z.get(this.props.user.api.details).then((function(e){n((0,B.zD)(e))}),(function(e){D.Z.apiError(e)}))}},{key:"render",value:function(){return this.props.children}}]),i}(v().Component);var z=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"onCancel",(function(){t.setState({editing:!1})})),(0,p.Z)((0,l.Z)(t),"onEdit",(function(){t.setState({editing:!0})})),(0,p.Z)((0,l.Z)(t),"onSuccess",(function(e){var n,a=t.props,i=a.dispatch,s=a.isAuthenticated,o=a.profile;n=s?gettext("Your details have been updated."):interpolate(gettext("%(username)s's details have been updated."),{username:o.username},!0),D.Z.info(n),i((0,B.zD)(e)),t.setState({editing:!1})})),t.state={editing:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Details"),parent:this.props.profile.username})}},{key:"render",value:function(){var e=this.props,t=e.dispatch,n=e.isAuthenticated,a=e.profile,i=e.profileDetails,o=i.id!==a.id;return(0,s.Z)(j,{data:i,dispatch:t,user:a},void 0,(0,s.Z)("div",{className:"profile-details"},void 0,(0,s.Z)(A,{onEdit:this.onEdit,showEditButton:!!i.edit&&!this.state.editing}),(0,s.Z)(T,{display:!this.state.editing,groups:i.groups,isAuthenticated:n,loading:o,profile:a}),(0,s.Z)(x,{api:a.api.edit_details,dispatch:t,display:this.state.editing,onCancel:this.onCancel,onSuccess:this.onSuccess})))}}]),i}(v().Component),U=n(87462),M=n(11005),q=n(82211),H=n(21981),F=n(90287);var Y,V=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isLoading:!0}),t.loadItems(t.props.posts.next)})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"loadItems",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;I.Z.get(this.props.api,{start:t||0}).then((function(n){0===t?F.Z.dispatch(H.zD(n)):F.Z.dispatch(H.R3(n)),e.setState({isLoading:!1})}),(function(t){e.setState({isLoading:!1}),D.Z.apiError(t)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:this.props.title,parent:this.props.profile.username}),this.loadItems()}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-feed"},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.props.header)))),v().createElement(G,(0,U.Z)({isLoading:this.state.isLoading,loadMore:this.loadMore},this.props)))}}]),i}(v().Component);function G(e){return e.posts.isLoaded&&!e.posts.results.length?(0,s.Z)("p",{className:"lead"},void 0,e.emptyMessage):(0,s.Z)("div",{},void 0,(0,s.Z)(M.Z,{isReady:e.posts.isLoaded,posts:e.posts.results,poster:e.profile}),(0,s.Z)($,{isLoading:e.isLoading,loadMore:e.loadMore,next:e.posts.next}))}function $(e){return e.next?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:e.isLoading,onClick:e.loadMore},void 0,gettext("Show older activity"))):null}var W=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.className?"form-search "+this.props.className:"form-search"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName()},void 0,(0,s.Z)("input",{type:"text",className:"form-control",value:this.props.value,onChange:this.props.onChange,placeholder:this.props.placeholder||gettext("Search...")}),Y||(Y=(0,s.Z)("span",{className:"material-icon"},void 0,"search")))}}]),i}(v().Component),Q=n(40429),K=n(6935);var J=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadUsers(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadUsers(1,e.target.value)})),t.setSpecialProps(),y.Z.has(t.PRELOADED_DATA_KEY)?t.initWithPreloadedData(y.Z.pop(t.PRELOADED_DATA_KEY)):t.initWithoutPreloadedData(),t}return(0,r.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWERS",this.TITLE=gettext("Followers"),this.API_FILTER="followers"}},{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},F.Z.dispatch((0,K.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadUsers()}},{key:"loadUsers",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=this.props.profile.api[this.API_FILTER];I.Z.get(a,{search:n,page:t||1},"user-"+this.API_FILTER).then((function(n){1===t?F.Z.dispatch((0,K.ZB)(n.results)):F.Z.dispatch((0,K.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){D.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:this.TITLE,parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("You have %(users)s follower.","You have %(users)s followers.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=ngettext("%(username)s has %(users)s follower.","%(username)s has %(users)s followers.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("You have no followers."):interpolate(gettext("%(username)s has no followers."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(gettext("Show more (%(more)s)"),{more:this.state.more},!0))):null}},{key:"getListBody",value:function(){return this.state.isLoaded&&0===this.state.count?(0,s.Z)("p",{className:"lead"},void 0,this.getEmptyMessage()):(0,s.Z)("div",{},void 0,(0,s.Z)(Q.Z,{cols:3,isReady:this.state.isLoaded,users:this.props.users}),this.getMoreButton())}},{key:"getClassName",value:function(){return"profile-"+this.API_FILTER}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName()},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.getLabel()))),(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)(W,{value:this.state.search,onChange:this.search,placeholder:gettext("Search users...")})))),this.getListBody())}}]),i}(v().Component);var X=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"setSpecialProps",value:function(){this.PRELOADED_DATA_KEY="PROFILE_FOLLOWS",this.TITLE=gettext("Follows"),this.API_FILTER="follows"}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(users)s user.","Found %(users)s users.",this.state.count);return interpolate(e,{users:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("You are following %(users)s user.","You are following %(users)s users.",this.state.count);return interpolate(t,{users:this.state.count},!0)}var n=ngettext("%(username)s is following %(users)s user.","%(username)s is following %(users)s users.",this.state.count);return interpolate(n,{username:this.props.profile.username,users:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no users matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("You are not following any users."):interpolate(gettext("%(username)s is not following any users."),{username:this.props.profile.username},!0)}}]),i}(J),ee=n(7850),te=n(48927);var ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadChanges(t.state.page+1,t.state.search)})),(0,p.Z)((0,l.Z)(t),"search",(function(e){t.setState({isLoaded:!1,isBusy:!0,search:e.target.value,count:0,more:0,page:1,pages:1}),t.loadChanges(1,e.target.value)})),y.Z.has("PROFILE_NAME_HISTORY")?t.initWithPreloadedData(y.Z.pop("PROFILE_NAME_HISTORY")):t.initWithoutPreloadedData(),t}return(0,r.Z)(i,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,isBusy:!1,search:"",count:e.count,more:e.more,page:e.page,pages:e.pages},F.Z.dispatch((0,te.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1,isBusy:!1,search:"",count:0,more:0,page:1,pages:1},this.loadChanges()}},{key:"loadChanges",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;I.Z.get(y.Z.get("USERNAME_CHANGES_API"),{user:this.props.profile.id,search:n,page:t||1},"search-username-history").then((function(n){1===t?F.Z.dispatch((0,te.ZB)(n.results)):F.Z.dispatch((0,te.R3)(n.results)),e.setState({isLoaded:!0,isBusy:!1,count:n.count,more:n.more,page:n.page,pages:n.pages})}),(function(e){D.Z.apiError(e)}))}},{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Username history"),parent:this.props.profile.username})}},{key:"getLabel",value:function(){if(this.state.isLoaded){if(this.state.search){var e=ngettext("Found %(changes)s username change.","Found %(changes)s username changes.",this.state.count);return interpolate(e,{changes:this.state.count},!0)}if(this.props.profile.id===this.props.user.id){var t=ngettext("Your username was changed %(changes)s time.","Your username was changed %(changes)s times.",this.state.count);return interpolate(t,{changes:this.state.count},!0)}var n=ngettext("%(username)s's username was changed %(changes)s time.","%(username)s's username was changed %(changes)s times.",this.state.count);return interpolate(n,{username:this.props.profile.username,changes:this.state.count},!0)}return gettext("Loading...")}},{key:"getEmptyMessage",value:function(){return this.state.search?gettext("Search returned no username changes matching specified criteria."):this.props.user.id===this.props.profile.id?gettext("No name changes have been recorded for your account."):interpolate(gettext("%(username)s's username was never changed."),{username:this.props.profile.username},!0)}},{key:"getMoreButton",value:function(){return this.state.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(q.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy,onClick:this.loadMore},void 0,interpolate(gettext("Show older (%(more)s)"),{more:this.state.more},!0))):null}},{key:"render",value:function(){return(0,s.Z)("div",{className:"profile-username-history"},void 0,(0,s.Z)(O.o8,{},void 0,(0,s.Z)(O.Z2,{auto:!0},void 0,(0,s.Z)(O.Eg,{auto:!0},void 0,(0,s.Z)("h3",{},void 0,this.getLabel()))),(0,s.Z)(O.Z2,{},void 0,(0,s.Z)(O.Eg,{},void 0,(0,s.Z)(W,{value:this.state.search,onChange:this.search,placeholder:gettext("Search history...")})))),(0,s.Z)(ee.Z,{isLoaded:this.state.isLoaded,emptyMessage:this.getEmptyMessage(),changes:this.props["username-history"]}),this.getMoreButton())}}]),i}(v().Component),ae=n(82125),ie=n(27519),se=n(59131),oe=n(19605),re=n(98936),le=n(99755);var ce,ue=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"action",(function(){t.setState({isLoading:!0}),t.props.profile.is_followed?F.Z.dispatch((0,ie.r$)({is_followed:!1,followers:t.props.profile.followers-1})):F.Z.dispatch((0,ie.r$)({is_followed:!0,followers:t.props.profile.followers+1})),I.Z.post(t.props.profile.api.follow).then((function(e){t.setState({isLoading:!1}),F.Z.dispatch((0,ie.r$)(e))}),(function(e){t.setState({isLoading:!1}),D.Z.apiError(e)}))})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.profile.is_followed?this.props.className+" btn-default btn-following":this.props.className+" btn-default btn-follow"}},{key:"getIcon",value:function(){return this.props.profile.is_followed?"favorite":"favorite_border"}},{key:"getLabel",value:function(){return this.props.profile.is_followed?gettext("Following"):gettext("Follow")}},{key:"render",value:function(){return(0,s.Z)(q.Z,{className:this.getClassName(),disabled:this.state.isLoading,onClick:this.action},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,this.getIcon()),this.getLabel())}}]),i}(v().Component),de=n(64646);var pe,he,ve=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(){var e;(0,o.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"onClick",(function(){de.Z.open({mode:"START_PRIVATE",submit:y.Z.get("PRIVATE_THREADS_API"),to:[e.props.profile]})})),e}return(0,r.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_start_private_threads,t=this.props.user.id===this.props.profile.id;return!e||t?null:(0,s.Z)("button",{className:this.props.className,onClick:this.onClick,type:"button"},void 0,ce||(ce=(0,s.Z)("span",{className:"material-icon"},void 0,"comment")),gettext("Message"))}}]),i}(v().Component),fe=n(43345),me=n(96359),Ze=n(3784),ge=n(7227),ye=n(30337);var be,_e,Ne=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,is_avatar_locked:"",avatar_lock_user_message:"",avatar_lock_staff_message:""},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.moderate_avatar).then((function(t){e.setState({isLoaded:!0,is_avatar_locked:t.is_avatar_locked,avatar_lock_user_message:t.avatar_lock_user_message||"",avatar_lock_staff_message:t.avatar_lock_staff_message||""})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(D.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.moderate_avatar,{is_avatar_locked:this.state.is_avatar_locked,avatar_lock_user_message:this.state.avatar_lock_user_message,avatar_lock_staff_message:this.state.avatar_lock_staff_message})}},{key:"handleSuccess",value:function(e){F.Z.dispatch((0,K.n1)(this.props.profile,e.avatar_hash)),D.Z.success(gettext("Avatar controls have been changed."))}},{key:"getFormBody",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("Lock avatar"),helpText:gettext("Locking user avatar will prohibit user from changing his avatar and will reset his/her avatar to default one."),for:"id_is_avatar_locked"},void 0,(0,s.Z)(ge.Z,{id:"id_is_avatar_locked",disabled:this.state.isLoading,iconOn:"lock_outline",iconOff:"lock_open",labelOn:gettext("Disallow user from changing avatar"),labelOff:gettext("Allow user to change avatar"),onChange:this.bindInput("is_avatar_locked"),value:this.state.is_avatar_locked})),(0,s.Z)(me.Z,{label:gettext("User message"),helpText:gettext("Optional message for user explaining why he/she is prohibited form changing avatar."),for:"id_avatar_lock_user_message"},void 0,(0,s.Z)("textarea",{id:"id_avatar_lock_user_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_user_message"),value:this.state.avatar_lock_user_message})),(0,s.Z)(me.Z,{label:gettext("Staff message"),helpText:gettext("Optional message for forum team members explaining why user is prohibited form changing avatar."),for:"id_avatar_lock_staff_message"},void 0,(0,s.Z)("textarea",{id:"id_avatar_lock_staff_message",className:"form-control",rows:"4",disabled:this.state.isLoading,onChange:this.bindInput("avatar_lock_staff_message"),value:this.state.avatar_lock_staff_message}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,gettext("Close")),(0,s.Z)(q.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Save changes"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():pe||(pe=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-avatar-controls":"modal-dialog modal-avatar-controls"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,he||(he=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Avatar controls"))),this.getModalBody()))}}]),i}(fe.Z),ke=n(55210);var xe,we,Re,Ce=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e)).state={isLoaded:!1,isLoading:!1,error:null,username:"",validators:{username:[ke.lG()]}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.moderate_username).then((function(){e.setState({isLoaded:!0})}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"clean",value:function(){return!!this.isValid()||(D.Z.error(this.validate().username[0]),!1)}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.moderate_username,{username:this.state.username})}},{key:"handleSuccess",value:function(e){this.setState({username:""}),F.Z.dispatch((0,te.KP)(e,this.props.profile,this.props.user)),F.Z.dispatch((0,K._S)(this.props.profile,e.username,e.slug)),D.Z.success(gettext("Username has been changed."))}},{key:"getFormBody",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("New username"),for:"id_username"},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,s.Z)(q.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Change username"))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.getFormBody():be||(be=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error?"modal-dialog modal-message modal-rename-user":"modal-dialog modal-rename-user"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,_e||(_e=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Change username"))),this.getModalBody()))}}]),i}(fe.Z);var Se,Ee,Pe,Le=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"countdown",(function(){window.setTimeout((function(){t.state.countdown>1?(t.setState({countdown:t.state.countdown-1}),t.countdown()):t.state.confirm||t.setState({confirm:!0})}),1e3)})),t.state={isLoaded:!1,isLoading:!1,isDeleted:!1,error:null,countdown:5,confirm:!1,with_content:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;I.Z.get(this.props.profile.api.delete).then((function(){e.setState({isLoaded:!0}),e.countdown()}),(function(t){e.setState({isLoaded:!0,error:t.detail})}))}},{key:"send",value:function(){return I.Z.post(this.props.profile.api.delete,{with_content:this.state.with_content})}},{key:"handleSuccess",value:function(){b.Z.stop("user-profile"),this.state.with_content?this.setState({isDeleted:interpolate(gettext("%(username)s's account, threads, posts and other content has been deleted."),{username:this.props.profile.username},!0)}):this.setState({isDeleted:interpolate(gettext("%(username)s's account has been deleted and other content has been hidden."),{username:this.props.profile.username},!0)})}},{key:"getButtonLabel",value:function(){return this.state.confirm?interpolate(gettext("Delete %(username)s"),{username:this.props.profile.username},!0):interpolate(gettext("Please wait... (%(countdown)ss)"),{countdown:this.state.countdown},!0)}},{key:"getForm",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(me.Z,{label:gettext("User content"),for:"id_with_content"},void 0,(0,s.Z)(ge.Z,{id:"id_with_content",disabled:this.state.isLoading,labelOn:gettext("Delete together with user's account"),labelOff:gettext("Hide after deleting user's account"),onChange:this.bindInput("with_content"),value:this.state.with_content}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-default","data-dismiss":"modal"},void 0,gettext("Cancel")),(0,s.Z)(q.Z,{className:"btn-danger",loading:this.state.isLoading,disabled:!this.state.confirm},void 0,this.getButtonLabel())))}},{key:"getDeletedBody",value:function(){return(0,s.Z)("div",{className:"modal-body"},void 0,xe||(xe=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.state.isDeleted),(0,s.Z)("p",{},void 0,(0,s.Z)("a",{href:y.Z.get("USERS_LIST_URL")},void 0,gettext("Return to users list")))))}},{key:"getModalBody",value:function(){return this.state.error?(0,s.Z)(ye.Z,{icon:"remove_circle_outline",message:this.state.error}):this.state.isLoaded?this.state.isDeleted?this.getDeletedBody():this.getForm():we||(we=(0,s.Z)(Ze.Z,{}))}},{key:"getClassName",value:function(){return this.state.error||this.state.isDeleted?"modal-dialog modal-message modal-delete-account":"modal-dialog modal-delete-account"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,Re||(Re=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Delete user account"))),this.getModalBody()))}}]),i}(fe.Z),Te=n(59801);var Oe,Ae,Be,Ie,De,je=function(e){return{tick:e.tick,user:e.auth,profile:e.profile}},ze=function(e){(0,c.Z)(h,e);var t,n,a=(t=h,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function h(){var e;(0,o.Z)(this,h);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,p.Z)((0,l.Z)(e),"showAvatarDialog",(function(){Te.Z.show((0,i.$j)(je)(Ne))})),(0,p.Z)((0,l.Z)(e),"showRenameDialog",(function(){Te.Z.show((0,i.$j)(je)(Ce))})),(0,p.Z)((0,l.Z)(e),"showDeleteDialog",(function(){Te.Z.show((0,i.$j)(je)(Le))})),e}return(0,r.Z)(h,[{key:"render",value:function(){var e=this.props.moderation;return(0,s.Z)("ul",{className:"dropdown-menu dropdown-menu-right",role:"menu"},void 0,!!e.avatar&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showAvatarDialog},void 0,Se||(Se=(0,s.Z)("span",{className:"material-icon"},void 0,"portrait")),gettext("Avatar controls"))),!!e.rename&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showRenameDialog},void 0,Ee||(Ee=(0,s.Z)("span",{className:"material-icon"},void 0,"credit_card")),gettext("Change username"))),!!e.delete&&(0,s.Z)("li",{},void 0,(0,s.Z)("button",{type:"button",className:"btn btn-link",onClick:this.showDeleteDialog},void 0,Pe||(Pe=(0,s.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete account"))))}}]),h}(v().Component),Ue=n(24678),Me=function(e){var t=e.profile;return(0,s.Z)("ul",{className:"profile-data-list"},void 0,!1===t.is_active&&(0,s.Z)("li",{className:"user-account-disabled"},void 0,(0,s.Z)("abbr",{title:gettext("This user's account has been disabled by administrator.")},void 0,gettext("Account disabled"))),(0,s.Z)("li",{className:"user-status-display"},void 0,(0,s.Z)(Ue.ZP,{user:t,status:t.status},void 0,(0,s.Z)(Ue.Jj,{user:t,status:t.status}),(0,s.Z)(Ue.pg,{user:t,status:t.status,className:"status-label"}))),t.rank.is_tab?(0,s.Z)("li",{className:"user-rank"},void 0,(0,s.Z)("a",{href:t.rank.url,className:"item-title"},void 0,t.rank.name)):(0,s.Z)("li",{className:"user-rank"},void 0,(0,s.Z)("span",{className:"item-title"},void 0,t.rank.name)),(t.title||t.rank.title)&&(0,s.Z)("li",{className:"user-title"},void 0,t.title||t.rank.title),(0,s.Z)("li",{className:"user-joined-on"},void 0,(0,s.Z)("abbr",{title:interpolate(gettext("Joined on %(joined_on)s"),{joined_on:t.joined_on.format("LL, LT")},!0)},void 0,interpolate(gettext("Joined %(joined_on)s"),{joined_on:t.joined_on.fromNow()},!0))),t.email&&(0,s.Z)("li",{className:"user-email"},void 0,(0,s.Z)("a",{href:"mailto:"+t.email,className:"item-title"},void 0,t.email)))},qe=function(){return(0,s.Z)("button",{className:"btn btn-default btn-icon btn-outline dropdown-toggle",type:"button",title:gettext("Options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,De||(De=(0,s.Z)("span",{className:"material-icon"},void 0,"settings")))},He=function(e){var t=e.profile,n=e.user,a=e.moderation,i=e.message,o=e.follow;return(0,s.Z)(le.sP,{},void 0,(0,s.Z)(le.mr,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,s.Z)(le.gC,{styleName:t.rank.css_class?"rank-"+t.rank.css_class:"profile"},void 0,(0,s.Z)("div",{className:"profile-page-header"},void 0,(0,s.Z)("div",{className:"profile-page-header-avatar"},void 0,(0,s.Z)(oe.ZP,{className:"user-avatar hidden-sm hidden-md hidden-lg",user:t,size:200,size2x:400}),(0,s.Z)(oe.ZP,{className:"user-avatar hidden-xs hidden-md hidden-lg",user:t,size:64,size2x:128}),(0,s.Z)(oe.ZP,{className:"user-avatar hidden-xs hidden-sm",user:t,size:128,size2x:256})),(0,s.Z)("h1",{},void 0,t.username))),(0,s.Z)(le.eA,{className:"profile-page-header-details"},void 0,(0,s.Z)(re.gq,{},void 0,(0,s.Z)(re.kw,{auto:!0},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(Me,{profile:t}))),i&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(ve,{className:"btn btn-default btn-block btn-outline",profile:t,user:n})),a.available&&!o&&(0,s.Z)(re.Z6,{shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Oe||(Oe=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a})))),o&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{},void 0,(0,s.Z)(ue,{className:"btn btn-block btn-outline",profile:t})),a.available&&(0,s.Z)(re.Z6,{shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Ae||(Ae=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a})))),a.available&&!o&&!i&&(0,s.Z)(re.kw,{},void 0,(0,s.Z)(re.Z6,{className:"hidden-xs",shrink:!0},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,Be||(Be=(0,s.Z)(qe,{})),(0,s.Z)(ze,{profile:t,moderation:a}))),(0,s.Z)(re.Z6,{className:"hidden-sm hidden-md hidden-lg"},void 0,(0,s.Z)("div",{className:"dropdown"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,Ie||(Ie=(0,s.Z)("span",{className:"material-icon"},void 0,"settings")),gettext("Options")),(0,s.Z)(ze,{profile:t,moderation:a}))))))))},Fe=n(69987),Ye=n(94417),Ve=function(e){var t=e.baseUrl,n=e.page,a=e.pages;return(0,s.Z)("div",{className:"nav-container"},void 0,(0,s.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,n.icon),n.name),(0,s.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(e){return(0,s.Z)("li",{},e.component,(0,s.Z)(Fe.rU,{to:t+e.component+"/"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))})))),(0,s.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,a.map((function(e){return(0,s.Z)(Ye.Z,{path:t+e.component+"/"},e.component,(0,s.Z)(Fe.rU,{to:t+e.component+"/"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name))}))))};var Ge=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"update",(function(e){F.Z.dispatch((0,ie.ZB)(e))})),t.startPolling(e.profile.api.index),t}return(0,r.Z)(i,[{key:"startPolling",value:function(e){b.Z.start({poll:"user-profile",url:e,frequency:9e4,update:this.update})}},{key:"render",value:function(){var e=this,t=y.Z.get("PROFILE").url,n=y.Z.get("PROFILE_PAGES"),a=n.filter((function(n){var a=t+n.component+"/";return e.props.location.pathname===a}))[0],i=this.props,o=i.profile,r=i.user,l=$e(o,r),c=!!r.acl.can_start_private_threads&&o.id!==r.id,u=!!o.acl.can_follow&&o.id!==r.id;return(0,s.Z)("div",{className:"page page-user-profile"},void 0,(0,s.Z)(He,{profile:this.props.profile,user:this.props.user,moderation:l,message:c,follow:u}),(0,s.Z)(se.Z,{},void 0,(0,s.Z)(Ve,{baseUrl:t,page:a,pages:n}),this.props.children))}}]),i}(ae.Z),$e=function(e,t){var n={available:!1,rename:!1,avatar:!1,delete:!1};return t.is_anonymous||(n.rename=e.acl.can_rename,n.avatar=e.acl.can_moderate_avatar,n.delete=e.acl.can_delete,n.available=!!(n.rename||n.avatar||n.delete)),n};function We(e){return{isAuthenticated:e.auth.user.id===e.profile.id,tick:e.tick.tick,user:e.auth.user,users:e.users,posts:e.posts,profile:e.profile,profileDetails:e["profile-details"],"username-history":e["username-history"]}}var Qe={posts:function(e){var t;t=e.user.id===e.profile.id?gettext("You have posted no messages."):interpolate(gettext("%(username)s posted no messages."),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=ngettext("You have posted %(posts)s message.","You have posted %(posts)s messages.",e.profile.posts);n=interpolate(a,{posts:e.profile.posts},!0)}else{var i=ngettext("%(username)s has posted %(posts)s message.","%(username)s has posted %(posts)s messages.",e.profile.posts);n=interpolate(i,{username:e.profile.username,posts:e.profile.posts},!0)}else n=gettext("Loading...");return v().createElement(V,(0,U.Z)({api:e.profile.api.posts,emptyMessage:t,header:n,title:gettext("Posts")},e))},threads:function(e){var t;t=e.user.id===e.profile.id?gettext("You have no started threads."):interpolate(gettext("%(username)s started no threads."),{username:e.profile.username},!0);var n=null;if(e.posts.isLoaded)if(e.profile.id===e.user.id){var a=ngettext("You have started %(threads)s thread.","You have started %(threads)s threads.",e.profile.threads);n=interpolate(a,{threads:e.profile.threads},!0)}else{var i=ngettext("%(username)s has started %(threads)s thread.","%(username)s has started %(threads)s threads.",e.profile.threads);n=interpolate(i,{username:e.profile.username,threads:e.profile.threads},!0)}else n=gettext("Loading...");return v().createElement(V,(0,U.Z)({api:e.profile.api.threads,emptyMessage:t,header:n,title:gettext("Threads")},e))},followers:J,follows:X,details:z,"username-history":ne,"ban-details":N};function Ke(){var e=[];return y.Z.get("PROFILE_PAGES").forEach((function(t){e.push(Object.assign({},t,{path:y.Z.get("PROFILE").url+t.component+"/",component:(0,i.$j)(We)(Qe[t.component])}))})),e}var Je=n(39633);y.Z.addInitializer({name:"component:profile",initializer:function(e){e.has("PROFILE")&&e.has("PROFILE_PAGES")&&(0,Je.Z)({root:y.Z.get("PROFILE").url,component:(0,i.$j)(We)(Ge),paths:Ke()})},after:"reducer:profile-hydrate"})},32488:function(e,t,n){"use strict";var a,i=n(32233),s=n(97326),o=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),f=n(82211),m=n(43345),Z=n(78657),g=n(53904),y=n(55210),b=n(93051);function _(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var N=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[y.Do()]}},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(g.Z.error(gettext("Enter a valid email address.")),!1)}},{key:"send",value:function(){return Z.Z.post(i.Z.get("SEND_ACTIVATION_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["already_active","inactive_admin"].indexOf(e.code)>-1?g.Z.info(e.detail):403===e.status&&e.ban?(0,b.Z)(e.ban):g.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-request-activation-link"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.Z)("input",{type:"text",className:"form-control",placeholder:gettext("Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,r.Z)(f.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Send link"))))}}]),n}(m.Z),k=function(e){(0,u.Z)(n,e);var t=_(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("Activation link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-request-activation-link well-done"},void 0,(0,r.Z)("div",{className:"done-message"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{},void 0,this.getMessage())),(0,r.Z)("button",{className:"btn btn-primary btn-block",type:"button",onClick:this.props.callback},void 0,gettext("Request another link"))))}}]),n}(v().Component),x=function(e){(0,u.Z)(n,e);var t=_(n);function n(e){var a;return(0,l.Z)(this,n),a=t.call(this,e),(0,o.Z)((0,s.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,o.Z)((0,s.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,c.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,r.Z)(k,{user:this.state.complete,callback:this.reset}):(0,r.Z)(N,{callback:this.complete})}}]),n}(v().Component),w=n(4869);i.Z.addInitializer({name:"component:request-activation-link",initializer:function(){document.getElementById("request-activation-link-mount")&&(0,w.Z)(x,"request-activation-link-mount",!1)},after:"store"})},11768:function(e,t,n){"use strict";var a,i,s=n(32233),o=n(97326),r=n(4942),l=n(22928),c=n(15671),u=n(43144),d=n(79340),p=n(6215),h=n(61120),v=n(57588),f=n.n(v),m=n(73935),Z=n.n(m),g=n(82211),y=n(43345),b=n(78657),_=n(53904),N=n(55210),k=n(93051);function x(e){var t=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(e){return!1}}();return function(){var n,a=(0,h.Z)(e);if(t){var i=(0,h.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,p.Z)(this,n)}}var w=function(e){(0,d.Z)(n,e);var t=x(n);function n(e){var a;return(0,c.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,email:"",validators:{email:[N.Do()]}},a}return(0,u.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(_.Z.error(gettext("Enter a valid email address.")),!1)}},{key:"send",value:function(){return b.Z.post(s.Z.get("SEND_PASSWORD_RESET_API"),{email:this.state.email})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){["inactive_user","inactive_admin"].indexOf(e.code)>-1?this.props.showInactivePage(e):403===e.status&&e.ban?(0,k.Z)(e.ban):_.Z.apiError(e)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset"},void 0,(0,l.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,l.Z)("div",{className:"form-group"},void 0,(0,l.Z)("div",{className:"control-input"},void 0,(0,l.Z)("input",{type:"text",className:"form-control",placeholder:gettext("Your e-mail address"),disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email}))),(0,l.Z)(g.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Send link"))))}}]),n}(y.Z),R=function(e){(0,d.Z)(n,e);var t=x(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("Reset password link was sent to %(email)s"),{email:this.props.user.email},!0)}},{key:"render",value:function(){return(0,l.Z)("div",{className:"well well-form well-form-request-password-reset well-done"},void 0,(0,l.Z)("div",{className:"done-message"},void 0,a||(a=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"check"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{},void 0,this.getMessage())),(0,l.Z)("button",{type:"button",className:"btn btn-primary btn-block",onClick:this.props.callback},void 0,gettext("Request another link"))))}}]),n}(f().Component),C=function(e){(0,d.Z)(n,e);var t=x(n);function n(){return(0,c.Z)(this,n),t.apply(this,arguments)}return(0,u.Z)(n,[{key:"getActivateButton",value:function(){return"inactive_user"===this.props.activation?(0,l.Z)("p",{},void 0,(0,l.Z)("a",{href:s.Z.get("REQUEST_ACTIVATION_URL")},void 0,gettext("Activate your account."))):null}},{key:"render",value:function(){return(0,l.Z)("div",{className:"page page-message page-message-info page-forgotten-password-inactive"},void 0,(0,l.Z)("div",{className:"container"},void 0,(0,l.Z)("div",{className:"message-panel"},void 0,i||(i=(0,l.Z)("div",{className:"message-icon"},void 0,(0,l.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,l.Z)("div",{className:"message-body"},void 0,(0,l.Z)("p",{className:"lead"},void 0,gettext("Your account is inactive.")),(0,l.Z)("p",{},void 0,this.props.message),this.getActivateButton()))))}}]),n}(f().Component),S=function(e){(0,d.Z)(n,e);var t=x(n);function n(e){var a;return(0,c.Z)(this,n),a=t.call(this,e),(0,r.Z)((0,o.Z)(a),"complete",(function(e){a.setState({complete:e})})),(0,r.Z)((0,o.Z)(a),"reset",(function(){a.setState({complete:!1})})),a.state={complete:!1},a}return(0,u.Z)(n,[{key:"showInactivePage",value:function(e){Z().render((0,l.Z)(C,{activation:e.code,message:e.detail}),document.getElementById("page-mount"))}},{key:"render",value:function(){return this.state.complete?(0,l.Z)(R,{callback:this.reset,user:this.state.complete}):(0,l.Z)(w,{callback:this.complete,showInactivePage:this.showInactivePage})}}]),n}(f().Component),E=n(4869);s.Z.addInitializer({name:"component:request-password-reset",initializer:function(){document.getElementById("request-password-reset-mount")&&(0,E.Z)(S,"request-password-reset-mount",!1)},after:"store"})},61323:function(e,t,n){"use strict";var a,i=n(32233),s=n(97326),o=n(4942),r=n(22928),l=n(15671),c=n(43144),u=n(79340),d=n(6215),p=n(61120),h=n(57588),v=n.n(h),f=n(73935),m=n.n(f),Z=n(82211),g=n(43345),y=n(14467),b=n(78657),_=n(98274),N=n(59801),k=n(53904),x=n(93051),w=n(19755);function R(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var C=function(e){(0,u.Z)(n,e);var t=R(n);function n(e){var a;return(0,l.Z)(this,n),(a=t.call(this,e)).state={isLoading:!1,password:""},a}return(0,c.Z)(n,[{key:"clean",value:function(){return!!this.state.password.trim().length||(k.Z.error(gettext("Enter new password.")),!1)}},{key:"send",value:function(){return b.Z.post(i.Z.get("CHANGE_PASSWORD_API"),{password:this.state.password})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){403===e.status&&e.ban?(0,x.Z)(e.ban):k.Z.apiError(e)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"well well-form well-form-reset-password"},void 0,(0,r.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,r.Z)("div",{className:"form-group"},void 0,(0,r.Z)("div",{className:"control-input"},void 0,(0,r.Z)("input",{type:"password",className:"form-control",placeholder:gettext("Enter new password"),disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password}))),(0,r.Z)(Z.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Change password"))))}}]),n}(g.Z),S=function(e){(0,u.Z)(n,e);var t=R(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"getMessage",value:function(){return interpolate(gettext("%(username)s, your password has been changed successfully."),{username:this.props.user.username},!0)}},{key:"showSignIn",value:function(){N.Z.show(y.Z)}},{key:"render",value:function(){return(0,r.Z)("div",{className:"page page-message page-message-success page-forgotten-password-changed"},void 0,(0,r.Z)("div",{className:"container"},void 0,(0,r.Z)("div",{className:"message-panel"},void 0,a||(a=(0,r.Z)("div",{className:"message-icon"},void 0,(0,r.Z)("span",{className:"material-icon"},void 0,"check"))),(0,r.Z)("div",{className:"message-body"},void 0,(0,r.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,r.Z)("p",{},void 0,gettext("You will have to sign in using new password before continuing.")),(0,r.Z)("p",{},void 0,(0,r.Z)("button",{type:"button",className:"btn btn-primary",onClick:this.showSignIn},void 0,gettext("Sign in")))))))}}]),n}(v().Component),E=function(e){(0,u.Z)(n,e);var t=R(n);function n(){var e;(0,l.Z)(this,n);for(var a=arguments.length,i=new Array(a),c=0;c<a;c++)i[c]=arguments[c];return e=t.call.apply(t,[this].concat(i)),(0,o.Z)((0,s.Z)(e),"complete",(function(e){_.Z.softSignOut(),w('#hidden-login-form input[name="redirect_to"]').remove(),m().render((0,r.Z)(S,{user:e}),document.getElementById("page-mount"))})),e}return(0,c.Z)(n,[{key:"render",value:function(){return(0,r.Z)(C,{callback:this.complete})}}]),n}(v().Component),P=n(4869);i.Z.addInitializer({name:"component:reset-password-form",initializer:function(){document.getElementById("reset-password-form-mount")&&(0,P.Z)(E,"reset-password-form-mount",!1)},after:"store"})},15049:function(e,t,n){"use strict";var a,i=n(37424),s=n(22928),o=n(87462),r=n(57588),l=n.n(r),c=n(59131),u=n(15671),d=n(43144),p=n(97326),h=n(79340),v=n(6215),f=n(61120),m=n(4942),Z=n(32233),g=n(43345),y=n(21981),b=n(16427),_=n(6935),N=n(78657),k=n(53904),x=n(90287),w=n(98936),R=n(99755);var C=function(e){(0,h.Z)(o,e);var t,n,i=(t=o,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(e){return!1}}(),function(){var e,a=(0,f.Z)(t);if(n){var i=(0,f.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function o(e){var t;return(0,u.Z)(this,o),t=i.call(this,e),(0,m.Z)((0,p.Z)(t),"onQueryChange",(function(e){t.changeValue("query",e.target.value)})),t.state={isLoading:!1,query:e.search.query},t}return(0,d.Z)(o,[{key:"componentDidMount",value:function(){this.state.query.length&&this.handleSubmit()}},{key:"clean",value:function(){return!!this.state.query.trim().length||(k.Z.error(gettext("You have to enter search query.")),!1)}},{key:"send",value:function(){x.Z.dispatch((0,b.Vx)({isLoading:!0}));var e=this.state.query.trim(),t=window.location.href,n=t.indexOf("?q=");return n>0&&(t=t.substring(0,n+3)),window.history.pushState({},"",t+encodeURIComponent(e)),N.Z.get(Z.Z.get("SEARCH_API"),{q:e})}},{key:"handleSuccess",value:function(e){x.Z.dispatch((0,b.Vx)({query:this.state.query.trim(),isLoading:!1,providers:e})),e.forEach((function(e){"users"===e.id?x.Z.dispatch((0,_.ZB)(e.results.results)):"threads"===e.id&&x.Z.dispatch((0,y.zD)(e.results))}))}},{key:"handleError",value:function(e){k.Z.apiError(e),x.Z.dispatch((0,b.Vx)({isLoading:!1}))}},{key:"render",value:function(){return(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)(R.sP,{},void 0,(0,s.Z)(R.mr,{styleName:"site-search"},void 0,(0,s.Z)(R.gC,{styleName:"site-search"},void 0,(0,s.Z)("h1",{},void 0,gettext("Search"))),(0,s.Z)(R.eA,{className:"page-header-search-form"},void 0,(0,s.Z)(w.gq,{},void 0,(0,s.Z)(w.kw,{auto:!0},void 0,(0,s.Z)(w.Z6,{},void 0,(0,s.Z)("input",{className:"form-control",disabled:this.state.isLoading,type:"text",value:this.state.query,placeholder:gettext("Search"),onChange:this.onQueryChange})),(0,s.Z)(w.Z6,{shrink:!0},void 0,(0,s.Z)("button",{className:"btn btn-secondary btn-icon btn-outline",disabled:this.state.isLoading},void 0,a||(a=(0,s.Z)("span",{className:"material-icon"},void 0,"search"))))))))))}}]),o}(g.Z),S=n(69987);function E(e){return(0,s.Z)("div",{className:"list-group nav-side"},void 0,e.providers.map((function(e){return(0,s.Z)(S.rU,{activeClassName:"active",className:"list-group-item",to:e.url},e.id,(0,s.Z)("span",{className:"material-icon"},void 0,e.icon),e.name,(0,s.Z)(P,{results:e.results}))})))}function P(e){if(!e.results)return null;var t=e.results.count;return t>1e6?t=Math.ceil(t/1e6)+"KK":t>1e3&&(t=Math.ceil(t/1e3)+"K"),(0,s.Z)("span",{className:"badge"},void 0,t)}function L(e){return(0,s.Z)("div",{className:"page page-search"},void 0,(0,s.Z)(C,{provider:e.provider,search:e.search}),(0,s.Z)(c.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-3"},void 0,(0,s.Z)(E,{providers:e.search.providers})),(0,s.Z)("div",{className:"col-md-9"},void 0,e.children,(0,s.Z)(T,{provider:e.provider,search:e.search})))))}function T(e){var t=null;if(e.search.providers.forEach((function(n){n.id===e.provider.id&&(t=n.time)})),null===t)return null;var n=gettext("Search took %(time)s s to complete");return(0,s.Z)("footer",{className:"search-footer"},void 0,(0,s.Z)("p",{},void 0,interpolate(n,{time:t},!0)))}var O=n(11005),A=n(82211);function B(e){return(0,s.Z)("div",{},void 0,(0,s.Z)(O.Z,{isReady:!0,posts:e.results}),l().createElement(I,e))}n(69092);var I=function(e){(0,h.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,f.Z)(t);if(n){var i=(0,f.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,v.Z)(this,e)});function i(){var e;(0,u.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,m.Z)((0,p.Z)(e),"onClick",(function(){x.Z.dispatch((0,y.Vx)({isBusy:!0})),N.Z.get(e.props.provider.api,{q:e.props.query,page:e.props.next}).then((function(e){e.forEach((function(e){"threads"===e.id&&(x.Z.dispatch((0,y.R3)(e.results)),x.Z.dispatch((0,b.P0)(e)))})),x.Z.dispatch((0,y.Vx)({isBusy:!1}))}),(function(e){k.Z.apiError(e),x.Z.dispatch((0,y.Vx)({isBusy:!1}))}))})),e}return(0,d.Z)(i,[{key:"render",value:function(){return this.props.more?(0,s.Z)("div",{className:"pager-more"},void 0,(0,s.Z)(A.Z,{className:"btn btn-default btn-outline",loading:this.props.isBusy,onClick:this.onClick},void 0,gettext("Show more"))):null}}]),i}(l().Component);function D(e){var t=e.children,n=e.loading,a=e.posts,i=e.query;return a&&a.count?t:i.length?(0,s.Z)("p",{className:"lead"},void 0,n?gettext("Loading results..."):gettext("No threads matching search query have been found.")):(0,s.Z)("p",{className:"lead"},void 0,gettext("Enter at least two characters to search threads."))}var j=n(40429);function z(e){var t=e.children,n=e.loading,a=e.query;return e.users.length?t:a.length?(0,s.Z)("p",{className:"lead"},void 0,n?gettext("Loading results..."):gettext("No users matching search query have been found.")):(0,s.Z)("p",{className:"lead"},void 0,gettext("Enter at least two characters to search users."))}var U={threads:function(e){return(0,s.Z)(L,{provider:e.route.provider,search:e.search},void 0,(0,s.Z)(D,{loading:e.search.isLoading,query:e.search.query,posts:e.posts},void 0,l().createElement(B,(0,o.Z)({provider:e.route.provider,query:e.search.query},e.posts))))},users:function(e){return(0,s.Z)(L,{provider:e.route.provider,search:e.search},void 0,(0,s.Z)(z,{loading:e.search.isLoading,query:e.search.query,users:e.users},void 0,(0,s.Z)(j.Z,{cols:3,isReady:!e.search.isLoading,users:e.users})))}};function M(e){return{posts:e.posts,search:e.search,tick:e.tick.tick,user:e.auth.user,users:e.users}}var q=n(39633);Z.Z.addInitializer({name:"component:search",initializer:function(e){var t;"misago:search"===e.get("CURRENT_LINK")&&(0,q.Z)({paths:(t=Z.Z.get("SEARCH_PROVIDERS"),t.map((function(e){return{path:e.url,component:(0,i.$j)(M)(U[e.id]),provider:e}})))})},after:"store"})},61814:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p={info:"alert-info",success:"alert-success",warning:"alert-warning",error:"alert-danger"},h=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"getSnackbarClass",value:function(){var e="alerts-snackbar";return this.props.isVisible?e+=" in":e+=" out",e}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getSnackbarClass()},void 0,(0,s.Z)("p",{className:"alert "+p[this.props.type]},void 0,this.props.message))}}]),i}(n.n(d)().Component);function v(e){return e.snackbar}var f=n(4869);i.Z.addInitializer({name:"component:snackbar",initializer:function(){(0,f.Z)((0,a.$j)(v)(h),"snackbar-mount")},after:"snackbar"})},95920:function(e,t,n){"use strict";var a=n(57588),i=n.n(a),s=n(22928),o=n(15671),r=n(43144),l=n(97326),c=n(79340),u=n(6215),d=n(61120),p=n(4942),h=n(32233),v=n(26106),f=n(82211),m=n(43345),Z=n(96359),g=n(78657),y=n(53904),b=n(55210),_=n(59131),N=n(99755),k=function(e){var t=e.backendName,n=gettext("Sign in with %(backend)s"),a=interpolate(n,{backend:t},!0);return(0,s.Z)(N.sP,{},void 0,(0,s.Z)(N.mr,{styleName:"social-auth"},void 0,(0,s.Z)(N.gC,{styleName:"social-auth"},void 0,(0,s.Z)("h1",{},void 0,a))))};function x(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?x(Object(n),!0).forEach((function(t){(0,p.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):x(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var R=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handlePrivacyPolicyChange",(function(e){var n=e.target.value;t.handleToggleAgreement("privacyPolicy",n)})),(0,p.Z)((0,l.Z)(t),"handleTermsOfServiceChange",(function(e){var n=e.target.value;t.handleToggleAgreement("termsOfService",n)})),(0,p.Z)((0,l.Z)(t),"handleToggleAgreement",(function(e,n){t.setState((function(a,i){if(null===a[e]){var s=w(w({},a.errors),{},(0,p.Z)({},e,null));return(0,p.Z)({errors:s},e,n)}var o=t.state.validators[e][0],r=w(w({},a.errors),{},(0,p.Z)({},e,[o(null)]));return(0,p.Z)({errors:r},e,null)}))}));var n={email:[b.Do()],username:[b.lG()]};return h.Z.get("TERMS_OF_SERVICE_ID")&&(n.termsOfService=[b.fT()]),h.Z.get("PRIVACY_POLICY_ID")&&(n.privacyPolicy=[b.jA()]),t.state={email:e.email||"",emailProtected:!!e.email,username:e.username||"",termsOfService:null,privacyPolicy:null,validators:n,errors:{},isLoading:!1},t}return(0,r.Z)(i,[{key:"clean",value:function(){if(this.validate(),-1!==[this.state.email.trim().length,this.state.username.trim().length].indexOf(0))return y.Z.error(gettext("Fill out all fields.")),!1;var e=this.state.validators;return h.Z.get("TERMS_OF_SERVICE_ID")&&null===this.state.termsOfService?(y.Z.error(e.termsOfService[0](null)),!1):!h.Z.get("PRIVACY_POLICY_ID")||null!==this.state.privacyPolicy||(y.Z.error(e.privacyPolicy[0](null)),y.Z.error(gettext("You need to accept the privacy policy.")),!1)}},{key:"send",value:function(){return g.Z.post(this.props.url,{email:this.state.email,username:this.state.username,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){(0,this.props.onRegistrationComplete)(e)}},{key:"handleError",value:function(e){if(200===e.status)(0,this.props.onRegistrationComplete)({activation:"active",step:"done",username:this.state.username});else if(400===e.status){var t={errors:e};e.email&&(t.emailProtected=!1),this.setState(t)}else y.Z.apiError(e)}},{key:"render",value:function(){var e=this.props.backend_name,t=this.state,n=t.email,a=t.emailProtected,i=t.username,o=t.isLoading,r=null;if(a){var l=gettext("Your e-mail address has been verified by %(backend)s.");r=interpolate(l,{backend:e},!0)}return(0,s.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,s.Z)(k,{backendName:e}),(0,s.Z)(_.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Complete your details"))),(0,s.Z)("div",{className:"panel-body"},void 0,(0,s.Z)(Z.Z,{for:"id_username",label:gettext("Username"),validation:this.state.errors.username},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control",disabled:o,onChange:this.bindInput("username"),value:i})),(0,s.Z)(Z.Z,{for:"id_email",label:gettext("E-mail address"),helpText:r,validation:a?null:this.state.errors.email},void 0,(0,s.Z)("input",{type:"email",id:"id_email",className:"form-control",disabled:o||a,onChange:this.bindInput("email"),value:n})),(0,s.Z)(v.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,s.Z)("div",{className:"panel-footer"},void 0,(0,s.Z)(f.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Sign in")))))))))}}]),i}(m.Z),C=function(e){var t,n,a=e.activation,i=e.backend_name,o=e.username;return n="user"===a?gettext("%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===a?gettext("%(username)s, your account has been created but board administrator will have to activate it before you will be able to sign in."):gettext("%(username)s, your account has been created and you have been signed in to it."),t="active"===a?"check":"info_outline",(0,s.Z)("div",{className:"page page-social-auth page-social-auth-register"},void 0,(0,s.Z)(k,{backendName:i}),(0,s.Z)(_.Z,{},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,s.Z)("div",{className:"panel-heading"},void 0,(0,s.Z)("h3",{className:"panel-title"},void 0,gettext("Registration completed!"))),(0,s.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,t)),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,interpolate(n,{username:o},!0)),(0,s.Z)("p",{className:"help-block"},void 0,(0,s.Z)("a",{className:"btn btn-default",href:h.Z.get("MISAGO_PATH")},void 0,gettext("Return to forum index"))))))))))};var S=function(e){(0,c.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,d.Z)(t);if(n){var i=(0,d.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,u.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,p.Z)((0,l.Z)(t),"handleRegistrationComplete",(function(e){var n=e.activation,a=e.email,i=e.step,s=e.username;t.setState({activation:n,email:a,step:i,username:s})})),t.state={step:e.step,activation:e.activation||"",email:e.email||"",username:e.username||""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this.props,t=e.backend_name,n=e.url,a=this.state,i=a.activation,o=a.email,r=a.step,l=a.username;return"register"===r?(0,s.Z)(R,{backend_name:t,email:o,url:n,username:l,onRegistrationComplete:this.handleRegistrationComplete}):(0,s.Z)(C,{activation:i,backend_name:t,email:o,url:n,username:l})}}]),i}(i().Component),E=n(4869);h.Z.addInitializer({name:"component:social-auth",initializer:function(e){if("misago:social-complete"===e.get("CURRENT_LINK")){var t=e.get("SOCIAL_AUTH_FORM");(0,E.Z)(i().createElement(S,t),"page-mount")}},after:"store"})},60630:function(e,t,n){"use strict";var a,i,s=n(37424),o=n(22928),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(57588),f=n.n(v),m=n(87462),Z=n(43345),g=n(96359),y=n(8154),b=n(7738),_=n(78657),N=n(59801),k=n(53904),x=n(90287);var w,R=function(e){(0,u.Z)(s,e);var t,n,i=(t=s,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function s(e){var t;return(0,r.Z)(this,s),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"onUsernameChange",(function(e){t.changeValue("username",e.target.value)})),t.state={isLoading:!1,username:""},t}return(0,l.Z)(s,[{key:"clean",value:function(){return!!this.state.username.trim().length||(k.Z.error(gettext("You have to enter user name.")),!1)}},{key:"send",value:function(){return _.Z.patch(this.props.thread.api.index,[{op:"add",path:"participants",value:this.state.username},{op:"add",path:"acl",value:1}])}},{key:"handleSuccess",value:function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants)),k.Z.success(gettext("New participant has been added to thread.")),N.Z.hide()}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog modal-sm",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,a||(a=(0,o.Z)(C,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_username",label:gettext("User to add")},void 0,(0,o.Z)("input",{id:"id_username",className:"form-control",disabled:this.state.isLoading,onChange:this.onUsernameChange,type:"text",value:this.state.username}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-block btn-primary",disabled:this.state.isLoading},void 0,gettext("Add participant")),(0,o.Z)("button",{className:"btn btn-block btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel"))))))}}]),s}(Z.Z);function C(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,i||(i=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Add participant")))}var S=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(R,{thread:e.props.thread}))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_add_participants?(0,o.Z)("div",{className:"col-xs-12 col-sm-3"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block",onClick:this.onClick,type:"button"},void 0,w||(w=(0,o.Z)("span",{className:"material-icon"},void 0,"person_add")),gettext("Add participant"))):null}}]),i}(f().Component),E=n(32233);var P=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(gettext("Are you sure you want to take over this thread?"));else{var i=gettext("Are you sure you want to change thread owner to %(user)s?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(e=t.props.thread,n=t.props.participant,_.Z.patch(e.api.index,[{op:"replace",path:"owner",value:n.id},{op:"add",path:"acl",value:1}]).then((function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants));var t=gettext("%(user)s has been made new thread owner.");k.Z.success(interpolate(t,{user:n.username},!0))}),(function(e){k.Z.apiError(e)})))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.participant.is_owner?null:this.props.thread.acl.can_change_owner?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,gettext("Make owner"))):null}}]),i}(f().Component);var L,T,O,A=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onClick",(function(){var e,n,a=!1;if(t.isUser)a=window.confirm(gettext("Are you sure you want to leave this thread?"));else{var i=gettext("Are you sure you want to remove %(user)s from this thread?");a=window.confirm(interpolate(i,{user:t.props.participant.username},!0))}a&&(t.isUser?(e=t.props.thread,n=t.props.participant,_.Z.patch(e.api.index,[{op:"remove",path:"participants",value:n.id}]).then((function(){k.Z.success(gettext("You have left this thread.")),window.setTimeout((function(){window.location=E.Z.get("PRIVATE_THREADS_URL")}),3e3)}),(function(e){k.Z.apiError(e)}))):function(e,t){_.Z.patch(e.api.index,[{op:"remove",path:"participants",value:t.id},{op:"add",path:"acl",value:1}]).then((function(e){x.Z.dispatch((0,b.y8)(e)),x.Z.dispatch(y.gx(e.participants));var n=gettext("%(user)s has been removed from this thread.");k.Z.success(interpolate(n,{user:t.username},!0))}),(function(e){k.Z.apiError(e)}))}(t.props.thread,t.props.participant))})),t.isUser=e.participant.id===e.user.id,t}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.user.acl.can_moderate_private_threads;return this.props.userIsOwner||this.isUser||e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,this.isUser?gettext("Leave thread"):gettext("Remove"))):null}}]),i}(f().Component),B=n(19605);function I(e){var t=e.participant,n="btn btn-default";return t.is_owner&&(n="btn btn-primary"),n+=" btn-user btn-block",(0,o.Z)("div",{className:"col-xs-12 col-sm-3 col-md-2 participant-card"},void 0,(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{"aria-haspopup":"true","aria-expanded":"false",className:n,"data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)(B.ZP,{size:"34",user:t}),(0,o.Z)("span",{className:"btn-text"},void 0,t.username)),(0,o.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,(0,o.Z)(D,{isOwner:t.is_owner}),L||(L=(0,o.Z)("li",{className:"dropdown-header"})),(0,o.Z)("li",{},void 0,(0,o.Z)("a",{href:t.url},void 0,gettext("See profile"))),T||(T=(0,o.Z)("li",{role:"separator",className:"divider"})),f().createElement(P,e),f().createElement(A,e))))}function D(e){return e.isOwner?(0,o.Z)("li",{className:"dropdown-header dropdown-header-owner"},void 0,O||(O=(0,o.Z)("span",{className:"material-icon"},void 0,"start")),(0,o.Z)("span",{className:"icon-text"},void 0,gettext("Thread owner"))):null}function j(e){var t=e.participants,n=e.thread,a=e.user,i=e.userIsOwner;return(0,o.Z)("div",{className:"participants-cards"},void 0,(0,o.Z)("div",{className:"row"},void 0,t.map((function(e){return(0,o.Z)(I,{participant:e,thread:n,user:a,userIsOwner:i},e.id)}))))}function z(e){return e.participants.length?(0,o.Z)("div",{className:"panel panel-default panel-participants"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,f().createElement(j,(0,m.Z)({userIsOwner:U(e.user,e.participants)},e)),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)(S,{thread:e.thread}),(0,o.Z)("div",{className:"col-xs-12 col-sm-9"},void 0,(0,o.Z)("p",{},void 0,function(e){var t=e.length,n=ngettext("This thread has %(users)s participant.","This thread has %(users)s participants.",t);return interpolate(n,{users:t},!0)}(e.participants)))))):null}function U(e,t){return t[0].id===e.id}var M,q=n(30381),H=n.n(q);function F(e){return(0,o.Z)("div",{className:"poll-choices-bars"},void 0,e.poll.choices.map((function(t){return(0,o.Z)(Y,{choice:t,poll:e.poll},t.hash)})))}function Y(e){var t=0;return e.choice.votes&&e.poll.votes&&(t=Math.ceil(100*e.choice.votes/e.poll.votes)),(0,o.Z)("dl",{className:"dl-horizontal"},void 0,(0,o.Z)("dt",{},void 0,e.choice.label),(0,o.Z)("dd",{},void 0,(0,o.Z)("div",{className:"progress"},void 0,(0,o.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":t,"aria-valuemin":"0","aria-valuemax":"100",style:{width:t+"%"}},void 0,(0,o.Z)("span",{className:"sr-only"},void 0,G(e.votes,e.proc)))),(0,o.Z)("ul",{className:"list-unstyled list-inline poll-chart"},void 0,(0,o.Z)(V,{proc:t,votes:e.choice.votes}),(0,o.Z)($,{selected:e.choice.selected}))))}function V(e){return(0,o.Z)("li",{className:"poll-chart-votes"},void 0,G(e.votes,e.proc))}function G(e,t){var n=npgettext("thread poll","%(votes)s vote, %(proc)s% of total.","%(votes)s votes, %(proc)s% of total.",e);return interpolate(n,{votes:e,proc:t},!0)}function $(e){return e.selected?(0,o.Z)("li",{className:"poll-chart-selected"},void 0,M||(M=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),pgettext("thread poll","You've voted on this choice.")):null}var W,Q,K,J=n(30337),X=n(3784);var ee=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isLoading:!0,error:null,data:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(this.props.poll.api.votes).then((function(t){var n=t.map((function(e){return Object.assign({},e,{voters:e.voters.map((function(e){return Object.assign({},e,{voted_on:H()(e.voted_on)})}))})}));e.setState({isLoading:!1,data:n})}),(function(t){e.setState({isLoading:!1,error:t.detail})}))}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog"+(this.state.error?" modal-message":" modal-sm"),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,W||(W=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("thread poll","Poll votes"))),(0,o.Z)(te,{data:this.state.data,error:this.state.error,isLoading:this.state.isLoading})))}}]),i}(f().Component);function te(e){return e.isLoading?Q||(Q=(0,o.Z)(X.Z,{})):e.error?(0,o.Z)(J.Z,{icon:"error_outline",message:e.error}):(0,o.Z)(ne,{data:e.data})}function ne(e){return(0,o.Z)("div",{className:"modal-body modal-poll-votes"},void 0,(0,o.Z)("ul",{className:"list-unstyled votes-details"},void 0,e.data.map((function(e){return f().createElement(ae,(0,m.Z)({key:e.hash},e))}))))}function ae(e){return(0,o.Z)("li",{},void 0,(0,o.Z)("h4",{},void 0,e.label),(0,o.Z)(ie,{votes:e.votes}),(0,o.Z)(se,{voters:e.voters}),K||(K=(0,o.Z)("hr",{})))}function ie(e){var t=npgettext("thread poll","%(votes)s user has voted for this choice.","%(votes)s users have voted for this choice.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,o.Z)("p",{},void 0,n)}function se(e){return e.voters.length?(0,o.Z)("ul",{className:"list-unstyled"},void 0,e.voters.map((function(e){return f().createElement(oe,(0,m.Z)({key:e.username},e))}))):null}function oe(e){return e.url?(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,o.Z)(re,{voted_on:e.voted_on})):(0,o.Z)("li",{},void 0,(0,o.Z)("strong",{},void 0,e.username)," ",(0,o.Z)(re,{voted_on:e.voted_on}))}function re(e){return(0,o.Z)("abbr",{className:"text-muted",title:e.voted_on.format("LLL")},void 0,e.voted_on.fromNow())}var le=n(59752),ce=n(64646);function ue(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function de(e){var t=e.isPollOver,n=e.poll,a=e.showVoting,i=e.thread;if(!function(e,t,n){return n.is_public||t.can_delete||t.can_edit||t.can_see_votes||t.can_vote&&!e&&(!n.hasSelectedChoices||n.allow_revotes)}(t,n.acl,n))return null;var s=[],r=n.acl.can_vote,l=!n.hasSelectedChoices||n.allow_revotes;return r&&l&&s.push(0),(n.is_public||n.acl.can_see_votes)&&s.push(1),n.acl.can_edit&&s.push(2),n.acl.can_delete&&s.push(3),(0,o.Z)("div",{className:"row poll-options"},void 0,(0,o.Z)(he,{controls:s,isPollOver:t,poll:n,showVoting:a}),(0,o.Z)(ve,{controls:s,poll:n}),(0,o.Z)(fe,{controls:s,poll:n,thread:i,onClick:e.edit}),(0,o.Z)(me,{controls:s,poll:n}))}function pe(e,t){var n="col-xs-6";return 1===e.length&&(n="col-xs-12"),3===e.length&&e[0]===t&&(n="col-xs-12"),n+" col-sm-3 col-md-2"}function he(e){var t=e.poll.acl.can_vote,n=!e.poll.hasSelectedChoices||e.poll.allow_revotes;return t&&n?(0,o.Z)("div",{className:pe(e.controls,0)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.showVoting,type:"button"},void 0,pgettext("thread poll","Vote"))):null}var ve=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(ee,{poll:e.props.poll}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.is_public||this.props.poll.acl.can_see_votes?(0,o.Z)("div",{className:pe(this.props.controls,1)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","See votes"))):null}}]),n}(f().Component);function fe(e){return e.poll.acl.can_edit?(0,o.Z)("div",{className:pe(e.controls,2)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:e.poll.isBusy,onClick:e.onClick,type:"button"},void 0,pgettext("thread poll","Edit"))):null}var me=function(e){(0,u.Z)(n,e);var t=ue(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){if(!window.confirm(pgettext("thread poll","Are you sure you want to delete this poll? This action is not reversible.")))return!1;x.Z.dispatch(le.n6()),_.Z.delete(e.props.poll.api.index).then(e.handleSuccess,e.handleError)})),(0,h.Z)((0,c.Z)(e),"handleSuccess",(function(e){k.Z.success(pgettext("thread poll","Poll has been deleted")),x.Z.dispatch(le.Od()),x.Z.dispatch(b.y8(e))})),(0,h.Z)((0,c.Z)(e),"handleError",(function(e){k.Z.apiError(e),x.Z.dispatch(le.Ar())})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.poll.acl.can_delete?(0,o.Z)("div",{className:pe(this.props.controls,3)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.props.poll.isBusy,onClick:this.onClick,type:"button"},void 0,pgettext("thread poll","Delete"))):null}}]),n}(f().Component),Ze=n(89627),ge='<abbr title="%(absolute)s">%(relative)s</abbr>';function ye(e){return(0,o.Z)("ul",{className:"list-unstyled list-inline poll-details"},void 0,(0,o.Z)(we,{votes:e.poll.votes}),(0,o.Z)(ke,{poll:e.poll}),(0,o.Z)(Re,{poll:e.poll}),(0,o.Z)(be,{poll:e.poll}))}function be(e){var t=interpolate((0,Ze.Z)(pgettext("thread poll","Started by %(poster)s %(posted_on)s.")),{poster:_e(e.poll),posted_on:Ne(e.poll)},!0);return(0,o.Z)("li",{className:"poll-info-creation",dangerouslySetInnerHTML:{__html:t}})}function _e(e){return e.url.poster?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.url.poster),user:(0,Ze.Z)(e.poster_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.poster_name)},!0)}function Ne(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.posted_on.format("LLL")),relative:(0,Ze.Z)(e.posted_on.fromNow())},!0)}function ke(e){if(!e.poll.length)return null;var t=interpolate((0,Ze.Z)(pgettext("thread poll","Voting ends %(ends_on)s.")),{ends_on:xe(e.poll)},!0);return(0,o.Z)("li",{className:"poll-info-ends-on",dangerouslySetInnerHTML:{__html:t}})}function xe(e){return interpolate(ge,{absolute:(0,Ze.Z)(e.endsOn.format("LLL")),relative:(0,Ze.Z)(e.endsOn.fromNow())},!0)}function we(e){var t=npgettext("thread poll","%(votes)s vote.","%(votes)s votes.",e.votes),n=interpolate(t,{votes:e.votes},!0);return(0,o.Z)("li",{className:"poll-info-votes"},void 0,n)}function Re(e){return e.poll.is_public?(0,o.Z)("li",{className:"poll-info-public"},void 0,pgettext("thread poll","Voting is public.")):null}function Ce(e){return(0,o.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("h2",{},void 0,e.poll.question),(0,o.Z)(ye,{poll:e.poll}),(0,o.Z)(F,{poll:e.poll}),(0,o.Z)(de,{isPollOver:e.isPollOver,poll:e.poll,showVoting:e.showVoting,thread:e.thread})))}function Se(e){return(0,o.Z)("ul",{className:"list-unstyled list-inline poll-help"},void 0,(0,o.Z)(Ee,{choicesLeft:e.choicesLeft}),(0,o.Z)(Pe,{poll:e.poll}))}function Ee(e){var t=e.choicesLeft;if(0===t)return(0,o.Z)("li",{className:"poll-help-choices-left"},void 0,pgettext("thread poll","You can't select any more choices."));var n=npgettext("thread poll","You can select %(choices)s more choice.","You can select %(choices)s more choices.",t),a=interpolate(n,{choices:t},!0);return(0,o.Z)("li",{className:"poll-help-choices-left"},void 0,a)}function Pe(e){return e.poll.allow_revotes?(0,o.Z)("li",{className:"poll-help-allow-revotes"},void 0,pgettext("thread poll","You can change your vote later.")):(0,o.Z)("li",{className:"poll-help-no-revotes"},void 0,pgettext("thread poll","Votes are final."))}function Le(e){return(0,o.Z)("ul",{className:"list-unstyled poll-select-choices"},void 0,e.choices.map((function(t){return(0,o.Z)(Te,{choice:t,toggleChoice:e.toggleChoice},t.hash)})))}var Te=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.toggleChoice(e.props.choice.hash)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,o.Z)("li",{className:"poll-select-choice"},void 0,(0,o.Z)("button",{className:this.props.choice.selected?"btn btn-selected":"btn",onClick:this.onClick,type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.props.choice.selected?"check_box":"check_box_outline_blank"),(0,o.Z)("strong",{},void 0,this.props.choice.label)))}}]),i}(f().Component);function Oe(e,t){var n=[];for(var a in t){var i=t[a];i.selected&&n.push(i)}return e.allowed_choices-n.length}var Ae=n(82211);var Be=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"toggleChoice",(function(e){var n,a=function(e,t){for(var n in e){var a=e[n];if(a.hash===t)return a}return null}(t.state.choices,e);n=a.selected?t.deselectChoice(a,e):t.selectChoice(a,e),t.setState({choices:n,choicesLeft:Oe(t.props.poll,n)})})),(0,h.Z)((0,c.Z)(t),"selectChoice",(function(e,n){if(!Oe(t.props.poll,t.state.choices))for(var a in t.state.choices.slice()){var i=t.state.choices[a];if(i.selected&&i.hash!=n){i.selected=!1;break}}return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash==n||e.selected})}))})),(0,h.Z)((0,c.Z)(t),"deselectChoice",(function(e,n){return t.state.choices.map((function(e){return Object.assign({},e,{selected:e.hash!=n&&e.selected})}))})),t.state={isLoading:!1,choices:e.poll.choices,choicesLeft:Oe(e.poll,e.poll.choices)},t}return(0,l.Z)(i,[{key:"clean",value:function(){return this.state.choicesLeft!==this.props.poll.allowed_choices||(k.Z.error(gettext("You need to select at least one choice")),!1)}},{key:"send",value:function(){var e=[];for(var t in this.state.choices.slice()){var n=this.state.choices[t];n.selected&&e.push(n.hash)}return _.Z.post(this.props.poll.api.votes,e)}},{key:"handleSuccess",value:function(e){x.Z.dispatch(le.gx(e)),k.Z.success(gettext("Your vote has been saved.")),this.props.showResults()}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){var e=[];return this.props.poll.acl.can_vote&&e.push(0),(this.props.poll.is_public||this.props.poll.acl.can_see_votes)&&e.push(1),this.props.poll.acl.can_edit&&e.push(2),this.props.poll.acl.can_delete&&e.push(3),(0,o.Z)("div",{className:"panel panel-default panel-poll"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("h2",{},void 0,this.props.poll.question),(0,o.Z)(ye,{poll:this.props.poll}),(0,o.Z)(Le,{choices:this.state.choices,toggleChoice:this.toggleChoice}),(0,o.Z)(Se,{choicesLeft:this.state.choicesLeft,poll:this.props.poll})),(0,o.Z)("div",{className:"panel-footer"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:pe(e,0)},void 0,(0,o.Z)(Ae.Z,{className:"btn-primary btn-block btn-sm",loading:this.state.isLoading},void 0,gettext("Save your vote"))),(0,o.Z)("div",{className:pe(e,1)},void 0,(0,o.Z)("button",{className:"btn btn-default btn-block btn-sm",disabled:this.state.isLoading,onClick:this.props.showResults,type:"button"},void 0,gettext("See results"))),(0,o.Z)(fe,{controls:e,poll:this.props.poll,thread:this.props.thread,onClick:this.props.edit}),(0,o.Z)(me,{controls:e,poll:this.props.poll})))))}}]),i}(Z.Z);var Ie,De=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"showResults",(function(){t.setState({showResults:!0})})),(0,h.Z)((0,c.Z)(t),"showVoting",(function(){t.setState({showResults:!1})}));var n=!0;return e.user.id&&!e.poll.hasSelectedChoices&&(n=!1),t.state={showResults:n},t}return(0,l.Z)(i,[{key:"render",value:function(){if(!this.props.thread.poll)return null;var e=function(e){return!!e.length&&H()().isAfter(e.endsOn)}(this.props.poll);return e||!this.props.poll.acl.can_vote||this.state.showResults?f().createElement(Ce,(0,m.Z)({isPollOver:e,showVoting:this.showVoting},this.props)):f().createElement(Be,(0,m.Z)({showResults:this.showResults},this.props))}}]),i}(f().Component);function je(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}var ze=function(e){(0,u.Z)(n,e);var t=je(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onAdd",(function(){var t=e.props.choices.slice();t.push({hash:Me(),label:""}),e.props.setChoices(t)})),(0,h.Z)((0,c.Z)(e),"onChange",(function(t,n){var a=e.props.choices.map((function(e){return e.hash===t&&(e.label=n),e}));e.props.setChoices(a)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(t){var n=e.props.choices.filter((function(e){return e.hash!==t}));e.props.setChoices(n)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"poll-choices-control"},void 0,(0,o.Z)("ul",{className:"list-group"},void 0,this.props.choices.map((function(t){return(0,o.Z)(Ue,{canDelete:e.props.choices.length>2,choice:t,disabled:e.props.disabled,onChange:e.onChange,onDelete:e.onDelete},t.hash)}))),(0,o.Z)("button",{className:"btn btn-default btn-sm",disabled:this.props.disabled,onClick:this.onAdd,type:"button"},void 0,pgettext("thread poll","Add choice")))}}]),n}(f().Component),Ue=function(e){(0,u.Z)(n,e);var t=je(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onChange",(function(t){e.props.onChange(e.props.choice.hash,t.target.value)})),(0,h.Z)((0,c.Z)(e),"onDelete",(function(){window.confirm(pgettext("thread poll","Are you sure you want to remove this choice?"))&&e.props.onDelete(e.props.choice.hash)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("li",{className:"list-group-item"},void 0,(0,o.Z)("button",{className:"btn",disabled:!this.props.canDelete||this.props.disabled,onClick:this.onDelete,title:pgettext("thread poll","Remove this choice"),type:"button"},void 0,Ie||(Ie=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))),(0,o.Z)("input",{disabled:this.props.disabled,maxLength:"255",placeholder:pgettext("thread poll","Poll choice"),type:"text",onChange:this.onChange,value:this.props.choice.label}))}}]),n}(f().Component);function Me(){for(var e="";12!=e.length;)e=Math.random().toString(36).replace(/[^a-zA-Z0-9]+/g,"").substr(1,12);return e}var qe=n(7227);var He=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"setChoices",(function(e){var n=Object.assign({},n,{choices:null});t.setState({choices:e,errors:n})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){(t.props.poll?window.confirm(pgettext("thread poll","Are you sure you want to discard changes?")):window.confirm(pgettext("thread poll","Are you sure you want to discard new poll?")))&&t.props.close()}));var n=e.poll.id?e.poll:{question:"",choices:[{hash:"choice-10000",label:""},{hash:"choice-20000",label:""}],length:0,allowed_choices:1,allow_revotes:0,is_public:0};return t.state={isLoading:!1,isEdit:!!n.id,question:n.question,choices:n.choices,length:n.length,allowed_choices:n.allowed_choices,allow_revotes:n.allow_revotes,is_public:n.is_public,validators:{question:[],choices:[],length:[],allowed_choices:[]},errors:{}},t}return(0,l.Z)(i,[{key:"send",value:function(){var e={question:this.state.question,choices:this.state.choices,length:this.state.length,allowed_choices:this.state.allowed_choices,allow_revotes:this.state.allow_revotes,is_public:this.state.is_public};return this.state.isEdit?_.Z.put(this.props.poll.api.index,e):_.Z.post(this.props.thread.api.poll,e)}},{key:"handleSuccess",value:function(e){x.Z.dispatch(le.gx(e)),this.state.isEdit?k.Z.success(pgettext("thread poll","Poll has been edited.")):k.Z.success(pgettext("thread poll","Poll has been posted.")),this.props.close()}},{key:"handleError",value:function(e){400===e.status?(e.non_field_errors&&(e.allowed_choices=e.non_field_errors),this.setState({errors:Object.assign({},e)}),k.Z.error(gettext("Form contains errors."))):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"poll-form"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"panel panel-default panel-form"},void 0,(0,o.Z)("div",{className:"panel-heading"},void 0,(0,o.Z)("h3",{className:"panel-title"},void 0,this.state.isEdit?pgettext("thread poll","Edit poll"):pgettext("thread poll","Add poll"))),(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,pgettext("thread poll","Question and choices")),(0,o.Z)(g.Z,{label:pgettext("thread poll","Poll question"),for:"id_questions",validation:this.state.errors.question},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_questions",onChange:this.bindInput("question"),type:"text",maxLength:"255",value:this.state.question})),(0,o.Z)(g.Z,{label:pgettext("thread poll","Available choices"),validation:this.state.errors.choices},void 0,(0,o.Z)(ze,{choices:this.state.choices,disabled:this.state.isLoading,setChoices:this.setChoices}))),(0,o.Z)("fieldset",{},void 0,(0,o.Z)("legend",{},void 0,pgettext("thread poll","Voting")),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Poll length"),helpText:pgettext("thread poll","Enter number of days for which voting in this poll should be possible or zero to run this poll indefinitely."),for:"id_length",validation:this.state.errors.length},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_length",onChange:this.bindInput("length"),type:"text",value:this.state.length}))),(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Allowed choices"),for:"id_allowed_choices",validation:this.state.errors.allowed_choices},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_allowed_choices",onChange:this.bindInput("allowed_choices"),type:"text",maxLength:"255",value:this.state.allowed_choices})))),(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)(Fe,{bindInput:this.bindInput,disabled:this.state.isLoading,isEdit:this.state.isEdit,value:this.state.is_public}),(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Allow vote changes"),for:"id_allow_revotes"},void 0,(0,o.Z)(qe.Z,{id:"id_allow_revotes",disabled:this.state.isLoading,iconOn:"check",iconOff:"close",labelOn:pgettext("thread poll","Allow participants to change their vote"),labelOff:pgettext("thread poll","Don't allow participants to change their vote"),onChange:this.bindInput("allow_revotes"),value:this.state.allow_revotes})))))),(0,o.Z)("div",{className:"panel-footer text-right"},void 0,(0,o.Z)("button",{className:"btn btn-default",disabled:this.state.isLoading,onClick:this.onCancel,type:"button"},void 0,pgettext("thread poll","Cancel"))," ",(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,this.state.isEdit?pgettext("thread poll","Save changes"):pgettext("thread poll","Post poll"))))))}}]),i}(Z.Z);function Fe(e){return e.isEdit?null:(0,o.Z)("div",{className:"col-xs-12 col-sm-6"},void 0,(0,o.Z)(g.Z,{label:pgettext("thread poll","Make voting public"),helpText:pgettext("thread poll","Making voting public will allow everyone to access detailed list of votes, showing which users voted for which choices and at which times. This option can't be changed after poll's creation. Moderators may see voting details for all polls."),for:"id_is_public"},void 0,(0,o.Z)(qe.Z,{id:"id_is_public",disabled:e.disabled,iconOn:"visibility",iconOff:"visibility_off",labelOn:pgettext("thread poll","Votes are public"),labelOff:pgettext("thread poll","Votes are hidden"),onChange:e.bindInput("is_public"),value:e.value})))}var Ye={changed_title:"edit",pinned_globally:"bookmark",pinned_locally:"bookmark_border",unpinned:"panorama_fish_eye",moved:"arrow_forward",merged:"call_merge",approved:"done",opened:"lock_open",closed:"lock_outline",unhid:"visibility",hid:"visibility_off",changed_owner:"grade",tookover:"grade",added_participant:"person_add",owner_left:"person_outline",participant_left:"person_outline",removed_participant:"remove_circle_outline"},Ve=function(e){return(0,o.Z)("span",{className:"event-icon-bg"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,Ye[e.post.event_type]))},Ge=n(92747);function $e(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function We(e){return e.post.acl.can_hide?(0,o.Z)("li",{className:"event-controls"},void 0,f().createElement(Qe,e),f().createElement(Ke,e),f().createElement(Je,e)):null}var Qe=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0,hidden_on:H()(),hidden_by_name:e.props.user.username,url:Object.assign(e.props.post.url,{hidden_by:e.props.user.url})})),_.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!0}]).then((function(t){x.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?null:(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Hide"))}}]),n}(f().Component),Ke=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!1})),_.Z.patch(e.props.post.api.index,[{op:"replace",path:"is-hidden",value:!1}]).then((function(t){x.Z.dispatch(Ge.r$(e.props.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{is_hidden:!0}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.is_hidden?(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Unhide")):null}}]),n}(f().Component),Je=function(e){(0,u.Z)(n,e);var t=$e(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){window.confirm(gettext("Are you sure you wish to delete this event? This action is not reversible!"))&&e.delete()})),(0,h.Z)((0,c.Z)(e),"delete",(function(){x.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!0})),_.Z.delete(e.props.post.api.index).then((function(){k.Z.success(gettext("Event has been deleted."))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.props.post,{isDeleted:!1}))}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,gettext("Delete"))}}]),n}(f().Component),Xe='<span class="item-title">%(user)s</span>',et='<a href="%(url)s" class="item-title">%(user)s</a>';function tt(e){return(0,o.Z)("ul",{className:"list-inline event-info"},void 0,f().createElement(nt,e),f().createElement(at,e),f().createElement(We,e))}function nt(e){if(e.post.is_hidden){var t;t=e.post.url.hidden_by?interpolate(et,{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate(Xe,{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("Hidden by %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,o.Z)("li",{className:"event-hidden-message",dangerouslySetInnerHTML:{__html:a}})}return null}function at(e){var t;t=e.post.poster?interpolate(et,{url:(0,Ze.Z)(e.post.poster.url),user:(0,Ze.Z)(e.post.poster_name)},!0):interpolate(Xe,{user:(0,Ze.Z)(e.post.poster_name)},!0);var n=interpolate('<a href="%(url)s" title="%(absolute)s">%(relative)s</a>',{url:(0,Ze.Z)(e.post.url.index),absolute:(0,Ze.Z)(e.post.posted_on.format("LLL")),relative:(0,Ze.Z)(e.post.posted_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("By %(event_by)s %(event_on)s.")),{event_by:t,event_on:n},!0);return(0,o.Z)("li",{className:"event-posters",dangerouslySetInnerHTML:{__html:a}})}var it={pinned_globally:gettext("Thread has been pinned globally."),pinned_locally:gettext("Thread has been pinned locally."),unpinned:gettext("Thread has been unpinned."),approved:gettext("Thread has been approved."),opened:gettext("Thread has been opened."),closed:gettext("Thread has been closed."),unhid:gettext("Thread has been revealed."),hid:gettext("Thread has been made hidden."),tookover:gettext("Took thread over."),owner_left:gettext("Owner has left thread. This thread is now closed."),participant_left:gettext("Participant has left thread.")},st='<a href="%(url)s" class="item-title">%(name)s</a>',ot='<span class="item-title">%(name)s</span>';function rt(e){return it[e.post.event_type]?(0,o.Z)("p",{className:"event-message"},void 0,it[e.post.event_type]):"changed_title"===e.post.event_type?f().createElement(lt,e):"moved"===e.post.event_type?f().createElement(ct,e):"merged"===e.post.event_type?f().createElement(ut,e):"changed_owner"===e.post.event_type?f().createElement(dt,e):"added_participant"===e.post.event_type?f().createElement(pt,e):"removed_participant"===e.post.event_type?f().createElement(ht,e):null}function lt(e){var t=(0,Ze.Z)(gettext("Thread title has been changed from %(old_title)s.")),n=interpolate(ot,{name:(0,Ze.Z)(e.post.event_context.old_title)},!0),a=interpolate(t,{old_title:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ct(e){var t=(0,Ze.Z)(gettext("Thread has been moved from %(from_category)s.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.from_category.url),name:(0,Ze.Z)(e.post.event_context.from_category.name)},!0),a=interpolate(t,{from_category:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ut(e){var t=(0,Ze.Z)(gettext("The %(merged_thread)s thread has been merged into this thread.")),n=interpolate(ot,{name:(0,Ze.Z)(e.post.event_context.merged_thread)},!0),a=interpolate(t,{merged_thread:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function dt(e){var t=(0,Ze.Z)(gettext("Changed thread owner to %(user)s.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function pt(e){var t=(0,Ze.Z)(gettext("Added %(user)s to thread.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function ht(e){var t=(0,Ze.Z)(gettext("Removed %(user)s from thread.")),n=interpolate(st,{url:(0,Ze.Z)(e.post.event_context.user.url),name:(0,Ze.Z)(e.post.event_context.user.username)},!0),a=interpolate(t,{user:n},!0);return(0,o.Z)("p",{className:"event-message",dangerouslySetInnerHTML:{__html:a}})}function vt(e){return e.post.is_read?null:(0,o.Z)("div",{className:"event-label"},void 0,(0,o.Z)("span",{className:"label label-unread"},void 0,gettext("New event")))}var ft=n(19755);var mt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,r.Z)(this,i),a.apply(this,arguments)}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;this.props.post.is_read||ft(this.element).waypoint({handler:function(t){"down"!==t||e.props.post.is_read||window.setTimeout((function(){var t=e.element.getBoundingClientRect(),n=t.height+t.top,a=document.documentElement.clientHeight;n<5||n>a||(x.Z.dispatch(Ge.r$(e.props.post,{is_read:!0})),_.Z.post(e.props.post.api.read).then((function(t){x.Z.dispatch(b.Vx(e.props.thread,{is_read:t.thread_is_read}))}),(function(e){k.Z.apiError(e)})))}),1e3)},offset:"bottom-in-view"})}},{key:"render",value:function(){var e=this;return f().createElement("div",{className:this.props.className,ref:function(t){t&&(e.element=t)}},this.props.children)}}]),i}(f().Component);function Zt(e){var t="event";return e.post.isDeleted?t="hide":e.post.is_hidden&&(t="event post-hidden"),(0,o.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,o.Z)(vt,{post:e.post}),(0,o.Z)("div",{className:"event-body"},void 0,(0,o.Z)("div",{className:"event-icon"},void 0,f().createElement(Ve,e)),(0,o.Z)(mt,{className:"event-content",post:e.post},void 0,f().createElement(rt,e),f().createElement(tt,e))))}var gt=n(69130),yt=n(48772);function bt(e){return(0,o.Z)("div",{className:"col-xs-12 col-md-6"},void 0,f().createElement(_t,e),(0,o.Z)("div",{className:"post-attachment"},void 0,(0,o.Z)("a",{href:e.attachment.url.index,className:"attachment-name item-title"},void 0,e.attachment.filename),f().createElement(xt,e)))}function _t(e){return e.attachment.is_image?(0,o.Z)("div",{className:"post-attachment-preview"},void 0,f().createElement(kt,e)):(0,o.Z)("div",{className:"post-attachment-preview"},void 0,f().createElement(Nt,e))}function Nt(e){return(0,o.Z)("a",{href:e.attachment.url.index,className:"material-icon"},void 0,"insert_drive_file")}function kt(e){var t=e.attachment.url.thumb||e.attachment.url.index;return(0,o.Z)("a",{className:"post-thumbnail",href:e.attachment.url.index,style:{backgroundImage:'url("'+(0,Ze.Z)(t)+'")'}})}function xt(e){var t;t=e.attachment.url.uploader?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.attachment.url.uploader),user:(0,Ze.Z)(e.attachment.uploader_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.attachment.uploader_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.attachment.uploaded_on.format("LLL")),relative:(0,Ze.Z)(e.attachment.uploaded_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("%(filetype)s, %(size)s, uploaded by %(uploader)s %(uploaded_on)s.")),{filetype:e.attachment.filetype,size:(0,yt.Z)(e.attachment.size),uploader:t,uploaded_on:n},!0);return(0,o.Z)("p",{className:"post-attachment-description",dangerouslySetInnerHTML:{__html:a}})}function wt(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&e.attachments}(e.post)?(0,o.Z)("div",{className:"post-attachments"},void 0,(0,gt.Z)(e.post.attachments,2).map((function(e){var t=e.map((function(e){return e?e.id:0})).join("_");return(0,o.Z)(Rt,{row:e},t)}))):null}function Rt(e){return(0,o.Z)("div",{className:"row"},void 0,e.row.map((function(e){return(0,o.Z)(bt,{attachment:e},e?e.id:0)})))}var Ct,St,Et,Pt,Lt,Tt,Ot,At=n(69092);function Bt(e){return e.post.is_hidden&&!e.post.acl.can_see_hidden?f().createElement(Dt,e):e.post.content?f().createElement(It,e):f().createElement(jt,e)}function It(e){var t=e.post,n="@"+(t.poster?t.poster.username:t.poster_name);return(0,o.Z)(mt,{className:"post-body",post:t},void 0,(0,o.Z)(At.Z,{author:n,markup:t.content}))}function Dt(e){var t;t=e.post.hidden_by?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.post.url.hidden_by),user:(0,Ze.Z)(e.post.hidden_by_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.post.hidden_by_name)},!0);var n=interpolate('<abbr class="last-title" title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.post.hidden_on.format("LLL")),relative:(0,Ze.Z)(e.post.hidden_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("Hidden by %(hidden_by)s %(hidden_on)s.")),{hidden_by:t,hidden_on:n},!0);return(0,o.Z)(mt,{className:"post-body post-body-hidden",post:e.post},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("This post is hidden. You cannot see its contents.")),(0,o.Z)("p",{className:"text-muted",dangerouslySetInnerHTML:{__html:a}}))}function jt(e){return(0,o.Z)(mt,{className:"post-body post-body-invalid",post:e.post},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("This post's contents cannot be displayed.")),(0,o.Z)("p",{className:"text-muted"},void 0,gettext("This error is caused by invalid post content manipulation.")))}function zt(e){var t=e.post,n=e.thread,a=e.user;if(!Ht(t)||t.id!==n.best_answer)return null;var i;return i=a.id&&n.best_answer_marked_by===a.id?interpolate(gettext("Marked as best answer by you %(marked_on)s."),{marked_on:n.best_answer_marked_on.fromNow()},!0):interpolate(gettext("Marked as best answer by %(marked_by)s %(marked_on)s."),{marked_by:n.best_answer_marked_by_name,marked_on:n.best_answer_marked_on.fromNow()},!0),(0,o.Z)("div",{className:"post-status-message post-status-best-answer"},void 0,Ct||(Ct=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),(0,o.Z)("p",{},void 0,i))}function Ut(e){return Ht(e.post)&&e.post.is_hidden?(0,o.Z)("div",{className:"post-status-message post-status-hidden"},void 0,St||(St=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),(0,o.Z)("p",{},void 0,gettext("This post is hidden. Only users with permission may see its contents."))):null}function Mt(e){return Ht(e.post)&&e.post.is_unapproved?(0,o.Z)("div",{className:"post-status-message post-status-unapproved"},void 0,Et||(Et=(0,o.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline")),(0,o.Z)("p",{},void 0,gettext("This post is unapproved. Only users with permission to approve posts and its author may see its contents."))):null}function qt(e){return Ht(e.post)&&e.post.is_protected?(0,o.Z)("div",{className:"post-status-message post-status-protected visible-xs-block"},void 0,Pt||(Pt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),(0,o.Z)("p",{},void 0,gettext("This post is protected. Only moderators may change it."))):null}function Ht(e){return!e.is_hidden||e.acl.can_see_hidden}function Ft(e){x.Z.dispatch(Ge.r$(e.post,{is_unapproved:!1})),Kt(e,[{op:"replace",path:"is-unapproved",value:!1}],{is_unapproved:e.post.is_unapproved})}function Yt(e){x.Z.dispatch(Ge.r$(e.post,{is_protected:!0})),Kt(e,[{op:"replace",path:"is-protected",value:!0}],{is_protected:e.post.is_protected})}function Vt(e){x.Z.dispatch(Ge.r$(e.post,{is_protected:!1})),Kt(e,[{op:"replace",path:"is-protected",value:!1}],{is_protected:e.post.is_protected})}function Gt(e){x.Z.dispatch(Ge.r$(e.post,{is_hidden:!0,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(e.post.url,{hidden_by:e.user.url})})),Kt(e,[{op:"replace",path:"is-hidden",value:!0}],{is_hidden:e.post.is_hidden,hidden_on:e.post.hidden_on,hidden_by_name:e.post.hidden_by_name,url:e.post.url})}function $t(e){x.Z.dispatch(Ge.r$(e.post,{is_hidden:!1})),Kt(e,[{op:"replace",path:"is-hidden",value:!1}],{is_hidden:e.post.is_hidden})}function Wt(e){var t=e.post.last_likes||[],n=[e.user].concat(t),a=n.length>3?n.slice(0,-1):n;x.Z.dispatch(Ge.r$(e.post,{is_liked:!0,likes:e.post.likes+1,last_likes:a})),Kt(e,[{op:"replace",path:"is-liked",value:!0}],{is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes})}function Qt(e){x.Z.dispatch(Ge.r$(e.post,{is_liked:!1,likes:e.post.likes-1,last_likes:e.post.last_likes.filter((function(t){return!t.id||t.id!==e.user.id}))}));var t={is_liked:e.post.is_liked,likes:e.post.likes,last_likes:e.post.last_likes};Kt(e,[{op:"replace",path:"is-liked",value:!1}],t)}function Kt(e,t,n){_.Z.patch(e.post.api.index,t).then((function(t){x.Z.dispatch(Ge.r$(e.post,t))}),(function(t){400===t.status?k.Z.error(t.detail[0]):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.post,n))}))}function Jt(e){window.confirm(gettext("Are you sure you want to delete this post? This action is not reversible!"))&&(x.Z.dispatch(Ge.r$(e.post,{isDeleted:!0})),_.Z.delete(e.post.api.index).then((function(){k.Z.success(gettext("Post has been deleted."))}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),x.Z.dispatch(Ge.r$(e.post,{isDeleted:!1}))})))}function Xt(e){var t=e.post,n=e.user;x.Z.dispatch(b.Vx({best_answer:t.id,best_answer_is_protected:t.is_protected,best_answer_marked_on:H()(),best_answer_marked_by:n.id,best_answer_marked_by_name:n.username,best_answer_marked_by_slug:n.slug})),tn(e,[{op:"replace",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function en(e){var t=e.post;x.Z.dispatch(b.Vx({best_answer:null,best_answer_is_protected:!1,best_answer_marked_on:null,best_answer_marked_by:null,best_answer_marked_by_name:null,best_answer_marked_by_slug:null})),tn(e,[{op:"remove",path:"best-answer",value:t.id},{op:"add",path:"acl",value:!0}],{best_answer:e.thread.best_answer,best_answer_is_protected:e.thread.best_answer_is_protected,best_answer_marked_on:e.thread.best_answer_marked_on,best_answer_marked_by:e.thread.best_answer_marked_by,best_answer_marked_by_name:e.thread.best_answer_marked_by_name,best_answer_marked_by_slug:e.thread.best_answer_marked_by_slug})}function tn(e,t,n){_.Z.patch(e.thread.api.index,t).then((function(e){e.best_answer_marked_on&&(e.best_answer_marked_on=H()(e.best_answer_marked_on)),x.Z.dispatch(b.Vx(e))}),(function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e),x.Z.dispatch(b.Vx(n))}))}var nn,an,sn,on,rn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),(t=a.call(this,e)).state={isReady:!1,error:null,likes:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(this.props.post.api.likes).then((function(t){e.setState({isReady:!0,likes:t.map(ln)})}),(function(t){e.setState({isReady:!0,error:t.detail})}))}},{key:"render",value:function(){return this.state.error?(0,o.Z)(cn,{className:"modal-message"},void 0,(0,o.Z)(J.Z,{message:this.state.error})):this.state.isReady?this.state.likes.length?(0,o.Z)(cn,{className:"modal-sm",likes:this.state.likes},void 0,(0,o.Z)(un,{likes:this.state.likes})):(0,o.Z)(cn,{className:"modal-message"},void 0,(0,o.Z)(J.Z,{message:gettext("No users have liked this post.")})):Lt||(Lt=(0,o.Z)(cn,{className:"modal-sm"},void 0,(0,o.Z)(X.Z,{})))}}]),i}(f().Component);function ln(e){return Object.assign({},e,{liked_on:H()(e.liked_on)})}function cn(e){var t=e.className,n=e.children,a=e.likes,i=gettext("Post Likes");if(a){var s=a.length,r=ngettext("%(likes)s like","%(likes)s likes",s);i=interpolate(r,{likes:s},!0)}return(0,o.Z)("div",{className:"modal-dialog "+(t||""),role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Tt||(Tt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,i)),n))}function un(e){return(0,o.Z)("div",{className:"modal-body modal-post-likers"},void 0,(0,o.Z)("ul",{className:"media-list"},void 0,e.likes.map((function(e){return f().createElement(dn,(0,m.Z)({key:e.id},e))}))))}function dn(e){if(e.url){var t={id:e.liker_id,avatars:e.avatars};return(0,o.Z)("li",{className:"media"},void 0,(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("a",{className:"user-avatar",href:e.url},void 0,(0,o.Z)(B.ZP,{size:"50",user:t}))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("a",{className:"item-title",href:e.url},void 0,e.username)," ",(0,o.Z)(pn,{likedOn:e.liked_on})))}return(0,o.Z)("li",{className:"media"},void 0,Ot||(Ot=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{className:"user-avatar"},void 0,(0,o.Z)(B.ZP,{size:"50"})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("strong",{},void 0,e.username)," ",(0,o.Z)(pn,{likedOn:e.liked_on})))}function pn(e){return(0,o.Z)("span",{className:"text-muted",title:e.likedOn.format("LLL")},void 0,e.likedOn.fromNow())}function hn(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function vn(e){return function(e){return(!e.is_hidden||e.acl.can_see_hidden)&&(e.acl.can_reply||e.acl.can_edit||e.acl.can_see_likes&&(e.last_likes||[]).length||e.acl.can_like)}(e.post)?(0,o.Z)("div",{className:"post-footer"},void 0,f().createElement(fn,e),f().createElement(mn,e),f().createElement(Zn,e),f().createElement(gn,(0,m.Z)({lastLikes:e.post.last_likes,likes:e.post.likes},e)),f().createElement(yn,(0,m.Z)({likes:e.post.likes},e)),f().createElement(kn,e),f().createElement(xn,e)):null}var fn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,nn||(nn=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Best answer")):null}}]),n}(f().Component),mn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("button",{className:"visible-xs-inline-block btn btn-default btn-sm pull-left",disabled:this.props.post.isBusy||t.id===n.best_answer,onClick:this.onClick,type:"button"},void 0,an||(an=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box"))):null}}]),n}(f().Component),Zn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.is_liked?Qt(e.props):Wt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){if(!this.props.post.acl.can_like)return null;var e="btn btn-default btn-sm pull-left";return this.props.post.is_liked&&(e="btn btn-success btn-sm pull-left"),(0,o.Z)("button",{className:e,disabled:this.props.post.isBusy,onClick:this.onClick,type:"button"},void 0,this.props.post.is_liked?gettext("Liked"):gettext("Like"))}}]),n}(f().Component),gn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(rn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,o.Z)("button",{className:"btn btn-link btn-sm pull-left hidden-xs",onClick:this.onClick,type:"button"},void 0,bn(this.props.likes,this.props.lastLikes)):(0,o.Z)("p",{className:"pull-left hidden-xs"},void 0,bn(this.props.likes,this.props.lastLikes)):null}}]),n}(f().Component),yn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=(this.props.post.last_likes||[]).length>0;return this.props.post.acl.can_see_likes&&e?2===this.props.post.acl.can_see_likes?(0,o.Z)("button",{className:"btn btn-link btn-sm likes-compact pull-left visible-xs-block",onClick:this.onClick,type:"button"},void 0,sn||(sn=(0,o.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):(0,o.Z)("p",{className:"likes-compact pull-left visible-xs-block"},void 0,on||(on=(0,o.Z)("span",{className:"material-icon"},void 0,"favorite")),this.props.likes):null}}]),n}(gn);function bn(e,t){var n=t.slice(0,3).map((function(e){return e.username}));if(1==n.length)return interpolate(gettext("%(user)s likes this."),{user:n[0]},!0);var a=e-n.length,i=n.slice(0,-1).join(", "),s=n.slice(-1)[0],o=interpolate(gettext("%(users)s and %(last_user)s"),{users:i,last_user:s},!0);if(0===a)return interpolate(gettext("%(users)s like this."),{users:o},!0);var r=ngettext("%(users)s and %(likes)s other user like this.","%(users)s and %(likes)s other users like this.",a);return interpolate(r,{users:n.join(", "),likes:a},!0)}var _n,Nn,kn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"REPLY",thread:e.props.thread,config:e.props.thread.api.editor,submit:e.props.thread.api.posts.index,context:{reply:e.props.post.id}})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_reply?(0,o.Z)("button",{className:"btn btn-primary btn-sm pull-right",type:"button",onClick:this.onClick},void 0,gettext("Reply")):null}}]),n}(f().Component),xn=function(e){(0,u.Z)(n,e);var t=hn(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,o.Z)("button",{className:"hidden-xs btn btn-default btn-sm pull-right",type:"button",onClick:this.onClick},void 0,gettext("Edit")):null}}]),n}(f().Component);var wn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){x.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),N.Z.hide(),k.Z.success(gettext("Selected post was moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,_n||(_n=(0,o.Z)(Rn,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to move post to")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,gettext("Move post"))))))}}]),i}(Z.Z);function Rn(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Nn||(Nn=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move post")))}function Cn(e){return(0,o.Z)("div",{className:"modal-body post-changelog-diff"},void 0,(0,o.Z)("ul",{className:"list-unstyled"},void 0,e.diff.map((function(e,t){return(0,o.Z)(Sn,{item:e},t)}))))}function Sn(e){return"?"===e.item[0]?null:(0,o.Z)("li",{className:(t=e.item,n="diff-item","-"===t[0]?n+=" diff-item-sub":"+"===t[0]&&(n+=" diff-item-add"),n)},void 0,e.item.substr(2));var t,n}var En,Pn,Ln,Tn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.canRevert?(0,o.Z)("div",{className:"modal-footer visible-xs-block"},void 0,(0,o.Z)(Ae.Z,{className:"btn-default btn-sm btn-block",disabled:this.props.disabled,onClick:this.onClick,title:gettext("Revert post to state from before this edit.")},void 0,gettext("Revert"))):null}}]),i}(f().Component);var On,An,Bn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"goLast",(function(){e.props.goToEdit()})),(0,h.Z)((0,c.Z)(e),"goForward",(function(){e.props.goToEdit(e.props.edit.next)})),(0,h.Z)((0,c.Z)(e),"goBack",(function(){e.props.goToEdit(e.props.edit.previous)})),(0,h.Z)((0,c.Z)(e),"revertEdit",(function(){e.props.revertEdit(e.props.edit.id)})),e}return(0,l.Z)(i,[{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-toolbar post-changelog-toolbar"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-12 col-sm-4"},void 0,(0,o.Z)("div",{className:"row"},void 0,(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(In,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goBack})),(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(Dn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goForward})),(0,o.Z)("div",{className:"col-xs-4"},void 0,(0,o.Z)(jn,{disabled:this.props.disabled,edit:this.props.edit,onClick:this.goLast})))),(0,o.Z)("div",{className:"col-xs-12 col-sm-5 xs-margin-top-half post-change-label"},void 0,(0,o.Z)(Un,{edit:this.props.edit})),(0,o.Z)(zn,{canRevert:this.props.canRevert,disabled:this.props.disabled,onClick:this.revertEdit})))}}]),i}(f().Component);function In(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.previous,onClick:e.onClick,title:gettext("See previous change")},void 0,En||(En=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left")))}function Dn(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:gettext("See next change")},void 0,Pn||(Pn=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function jn(e){return(0,o.Z)(Ae.Z,{className:"btn-default btn-block btn-icon btn-sm",disabled:e.disabled||!e.edit.next,onClick:e.onClick,title:gettext("See previous change")},void 0,Ln||(Ln=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page")))}function zn(e){return e.canRevert?(0,o.Z)("div",{className:"col-sm-3 hidden-xs"},void 0,(0,o.Z)(Ae.Z,{className:"btn-default btn-sm btn-block",disabled:e.disabled,onClick:e.onClick,title:gettext("Revert post to state from before this edit.")},void 0,gettext("Revert"))):null}function Un(e){var t;t=e.edit.url.editor?interpolate('<a href="%(url)s" class="item-title">%(user)s</a>',{url:(0,Ze.Z)(e.edit.url.editor),user:(0,Ze.Z)(e.edit.editor_name)},!0):interpolate('<span class="item-title">%(user)s</span>',{user:(0,Ze.Z)(e.edit.editor_name)},!0);var n=interpolate('<abbr title="%(absolute)s">%(relative)s</abbr>',{absolute:(0,Ze.Z)(e.edit.edited_on.format("LLL")),relative:(0,Ze.Z)(e.edit.edited_on.fromNow())},!0),a=interpolate((0,Ze.Z)(gettext("By %(edited_by)s %(edited_on)s.")),{edited_by:t,edited_on:n},!0);return(0,o.Z)("p",{dangerouslySetInnerHTML:{__html:a}})}function Mn(e){return Object.assign({},e,{edited_on:H()(e.edited_on)})}var qn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"goToEdit",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;t.setState({isBusy:!0});var n=t.props.post.api.edits;null!==e&&(n+="?edit="+e),_.Z.get(n).then((function(e){t.setState({isReady:!0,isBusy:!1,edit:Mn(e)})}),(function(e){t.setState({isReady:!0,isBusy:!1,error:e.detail})}))})),(0,h.Z)((0,c.Z)(t),"revertEdit",(function(e){if(!t.state.isBusy&&window.confirm(gettext("Are you sure you with to revert this post to the state from before this edit?"))){t.setState({isBusy:!0});var n=t.props.post.api.edits+"?edit="+e;_.Z.post(n).then((function(e){var t=Ge.ZB(e);x.Z.dispatch(Ge.r$(e,t)),k.Z.success(gettext("Post has been reverted to previous state.")),N.Z.hide()}),(function(e){k.Z.apiError(e),t.setState({isBusy:!1})}))}})),t.state={isReady:!1,isBusy:!0,canRevert:e.post.acl.can_edit,error:null,edit:null},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.goToEdit()}},{key:"render",value:function(){return this.state.error?(0,o.Z)(Hn,{className:"modal-dialog modal-message"},void 0,(0,o.Z)(J.Z,{message:this.state.error})):this.state.isReady?(0,o.Z)(Hn,{},void 0,(0,o.Z)(Bn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,goToEdit:this.goToEdit,revertEdit:this.revertEdit}),(0,o.Z)(Cn,{diff:this.state.edit.diff}),(0,o.Z)(Tn,{canRevert:this.state.canRevert,disabled:this.state.isBusy,edit:this.state.edit,revertEdit:this.revertEdit})):On||(On=(0,o.Z)(Hn,{},void 0,(0,o.Z)(X.Z,{})))}}]),i}(f().Component);function Hn(e){return(0,o.Z)("div",{className:e.className||"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,An||(An=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Post edits history"))),e.children))}var Fn,Yn,Vn,Gn,$n,Wn,Qn=n(57026),Kn=n(60471),Jn=n(55210);function Xn(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ea(e){return f().createElement(va,(0,m.Z)({},e,{Form:fa}))}var ta,na,aa,ia,sa,oa,ra,la,ca,ua,da,pa,ha,va=function(e){(0,u.Z)(n,e);var t=Xn(n);function n(e){var a;return(0,r.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,o.Z)(Za,{message:this.state.isError}):this.state.isLoaded?f().createElement(fa,(0,m.Z)({},this.props,{categories:this.state.categories})):Fn||(Fn=(0,o.Z)(ma,{}))}}]),n}(f().Component),fa=function(e){(0,u.Z)(n,e);var t=Xn(n);function n(e){var a;return(0,r.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Jn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:[this.props.post.id]})}},{key:"handleSuccess",value:function(e){x.Z.dispatch(Ge.r$(this.props.post,{isDeleted:!0})),N.Z.hide(),k.Z.success(gettext("Selected post was split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),k.Z.error(gettext("Form contains errors."))):k.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,o.Z)(g.Z,{label:gettext("Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,o.Z)(g.Z,{label:gettext("Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,o.Z)(g.Z,{label:gettext("Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,o.Z)(ga,{className:"modal-dialog"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{label:gettext("Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,o.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Yn||(Yn=(0,o.Z)("div",{className:"clearfix"})),(0,o.Z)(g.Z,{label:gettext("Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,o.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),Vn||(Vn=(0,o.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Split post")))))}}]),n}(Z.Z);function ma(){return Gn||(Gn=(0,o.Z)(ga,{className:"modal-dialog"},void 0,(0,o.Z)(X.Z,{})))}function Za(e){return(0,o.Z)(ga,{className:"modal-dialog modal-message"},void 0,$n||($n=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move this post at the moment.")),(0,o.Z)("p",{},void 0,e.message)))}function ga(e){return(0,o.Z)("div",{className:e.className,role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Wn||(Wn=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Split post into new thread"))),e.children))}function ya(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function ba(e){return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,f().createElement(Na,e),f().createElement(ka,e),f().createElement(xa,e),f().createElement(wa,e),f().createElement(Ra,e),f().createElement(Ca,e),f().createElement(Sa,e),f().createElement(Ea,e),f().createElement(Pa,e),f().createElement(La,e),f().createElement(Ta,e),f().createElement(Oa,e),f().createElement(Aa,e))}var _a,Na=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){var t=window.location.protocol+"//";t+=window.location.host,t+=e.props.post.url.index,prompt(gettext("Permament link to this post:"),t)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ta||(ta=(0,o.Z)("span",{className:"material-icon"},void 0,"link")),gettext("Permament link")))}}]),n}(f().Component),ka=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){ce.Z.open({mode:"EDIT",thread:e.props.thread,post:e.props.post,config:e.props.post.api.editor,submit:e.props.post.api.index})})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_edit?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,na||(na=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Edit"))):null}}]),n}(f().Component),xa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Xt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return n.acl.can_mark_best_answer&&t.acl.can_mark_as_best_answer?t.id===n.best_answer||n.best_answer&&!n.acl.can_change_best_answer?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,aa||(aa=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Mark as best answer"))):null}}]),n}(f().Component),wa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){en(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id!==n.best_answer?null:n.acl.can_unmark_best_answer?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ia||(ia=(0,o.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),gettext("Unmark best answer"))):null}}]),n}(f().Component),Ra=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(qn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits);return interpolate(n,{edits:this.props.post.edits},!0),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,sa||(sa=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Changes history")))}}]),n}(f().Component),Ca=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ft(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_approve&&this.props.post.is_unapproved?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,oa||(oa=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))):null}}]),n}(f().Component),Sa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(wn,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ra||(ra=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))):null}}]),n}(f().Component),Ea=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(ea,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_move?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,la||(la=(0,o.Z)("span",{className:"material-icon"},void 0,"call_split")),gettext("Split"))):null}}]),n}(f().Component),Pa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Yt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect?this.props.post.is_protected?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ca||(ca=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Protect"))):null}}]),n}(f().Component),La=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Vt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_protect&&this.props.post.is_protected?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ua||(ua=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Remove protection"))):null}}]),n}(f().Component),Ta=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Gt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_hide?t.is_hidden?null:(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,da||(da=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))):null}}]),n}(f().Component),Oa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){$t(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){return this.props.post.acl.can_unhide&&this.props.post.is_hidden?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,pa||(pa=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))):null}}]),n}(f().Component),Aa=function(e){(0,u.Z)(n,e);var t=ya(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Jt(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props,t=e.post,n=e.thread;return t.id===n.best_answer?null:t.acl.can_delete?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.onClick,type:"button"},void 0,ha||(ha=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))):null}}]),n}(f().Component);function Ba(e){return(0,o.Z)("div",{className:"pull-right dropdown"},void 0,_a||(_a=(0,o.Z)("button",{"aria-expanded":"true","aria-haspopup":"true",className:"btn btn-default btn-icon dropdown-toggle","data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"expand_more"))),f().createElement(ba,e))}var Ia=n(21981);var Da,ja=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){e.props.post.isSelected?x.Z.dispatch(Ia._H(e.props.post)):x.Z.dispatch(Ia.Ys(e.props.post))})),e}return(0,l.Z)(i,[{key:"render",value:function(){return this.props.thread.acl.can_merge_posts||(e=this.props.post.acl).can_approve||e.can_hide||e.can_protect||e.can_unhide||e.can_delete||e.can_move?(0,o.Z)("div",{className:"pull-right"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-icon",onClick:this.onClick,type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,this.props.post.isSelected?"check_box":"check_box_outline_blank"))):null;var e}}]),i}(f().Component),za=n(24678);function Ua(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ma(e){return(0,o.Z)("div",{className:"post-heading"},void 0,f().createElement(qa,e),f().createElement(Ha,e),f().createElement(Fa,e),f().createElement(Ya,e),f().createElement($a,e),f().createElement(Wa,e),f().createElement(Qa,e),f().createElement(ja,e),f().createElement(Ba,e))}function qa(e){return e.post.is_read?null:(0,o.Z)("span",{className:"label label-unread hidden-xs"},void 0,gettext("New post"))}function Ha(e){return e.post.is_read?null:(0,o.Z)("span",{className:"label label-unread visible-xs-inline-block"},void 0,gettext("New"))}function Fa(e){var t=interpolate(gettext("posted %(posted_on)s"),{posted_on:e.post.posted_on.format("LL, LT")},!0);return(0,o.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on hidden-xs",title:t},void 0,e.post.posted_on.fromNow())}function Ya(e){return(0,o.Z)("a",{href:e.post.url.index,className:"btn btn-link posted-on visible-xs-inline-block"},void 0,e.post.posted_on.fromNow())}var Va,Ga,$a=function(e){(0,u.Z)(n,e);var t=Ua(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show((0,o.Z)(qn,{post:e.props.post}))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("This post was edited %(edits)s time.","This post was edited %(edits)s times.",this.props.post.edits),a=interpolate(n,{edits:this.props.post.edits},!0),i=ngettext("edited %(edits)s time","edited %(edits)s times",this.props.post.edits);return(0,o.Z)("button",{className:"btn btn-link btn-see-edits hidden-xs",onClick:this.onClick,title:a,type:"button"},void 0,interpolate(i,{edits:this.props.post.edits},!0))}}]),n}(f().Component),Wa=function(e){(0,u.Z)(n,e);var t=Ua(n);function n(){return(0,r.Z)(this,n),t.apply(this,arguments)}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.post.is_hidden&&!this.props.post.acl.can_see_hidden,t=0===this.props.post.edits;if(e||t)return null;var n=ngettext("%(edits)s edit","%(edits)s edits",this.props.post.edits);return(0,o.Z)("button",{className:"btn btn-link btn-see-edits visible-xs-inline-block",onClick:this.onClick,type:"button"},void 0,interpolate(n,{edits:this.props.post.edits},!0))}}]),n}($a);function Qa(e){var t=e.post.poster&&e.post.poster.id===e.user.id,n=e.post.acl.can_protect;return e.user.id&&e.post.is_protected&&(t||n)?(0,o.Z)("span",{className:"label label-protected hidden-xs",title:gettext("This post is protected and may not be edited.")},void 0,Da||(Da=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("protected")):null}function Ka(e){var t=e.post,n=e.thread;return(0,o.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,o.Z)(ja,{post:t,thread:n}),(0,o.Z)(Ba,{post:t,thread:n}),(0,o.Z)("div",{className:"media"},void 0,Va||(Va=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:100})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("span",{className:"media-heading item-title"},void 0,t.poster_name),(0,o.Z)("span",{className:"user-title user-title-anonymous"},void 0,gettext("Removed user")))))}function Ja(e){var t=e.title,n=e.rank;return n.is_tab||!!t||!!n.title}function Xa(e){var t=e.poster,n=ngettext("%(posts)s post","%(posts)s posts",t.posts),a="user-postcount";return Ja(t)&&(a+=" hidden-xs hidden-sm"),(0,o.Z)("span",{className:a},void 0,interpolate(n,{posts:t.posts},!0))}function ei(e){var t=e.poster,n="hidden-xs";return Ja(t)&&(n+=" hidden-sm"),(0,o.Z)("span",{className:n},void 0,(0,o.Z)(za.ZP,{status:t.status},void 0,(0,o.Z)(za.pg,{status:t.status,user:t})))}function ti(e){var t=e.rank,n=e.title||t.title;if(!n&&t.is_tab&&(n=t.name),!n)return null;var a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,o.Z)("div",{className:a},void 0,(0,o.Z)("a",{href:t.url},void 0,n)):(0,o.Z)("div",{className:a},void 0,n)}function ni(e){var t=e.post,n=e.thread,a=t.poster;return(0,o.Z)("div",{className:"post-side post-side-registered"},void 0,(0,o.Z)(ja,{post:t,thread:n}),(0,o.Z)(Ba,{post:t,thread:n}),(0,o.Z)("div",{className:"media"},void 0,(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("a",{href:a.url},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:100,user:a}))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("div",{className:"media-heading"},void 0,(0,o.Z)("a",{className:"item-title",href:a.url},void 0,a.username),(0,o.Z)(za.ZP,{status:a.status},void 0,(0,o.Z)(za.Jj,{status:a.status}))),(0,o.Z)(ti,{rank:a.rank,title:a.title}),(0,o.Z)(ei,{poster:a}),(0,o.Z)(Xa,{poster:a}))))}function ai(e){return e.post.poster?f().createElement(ni,e):f().createElement(Ka,e)}function ii(e){var t="post";return e.post.isDeleted?t="hide":e.post.is_hidden&&!e.post.acl.can_see_hidden&&(t="post post-hidden"),e.post.poster&&e.post.poster.rank.css_class&&(t+=" post-"+e.post.poster.rank.css_class),e.post.is_read||(t+=" post-new"),(0,o.Z)("li",{id:"post-"+e.post.id,className:t},void 0,(0,o.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,f().createElement(ai,e),(0,o.Z)("div",{className:"panel-content"},void 0,f().createElement(Ma,e),f().createElement(zt,e),f().createElement(Mt,e),f().createElement(qt,e),f().createElement(Ut,e),f().createElement(Bt,e),f().createElement(wt,e),f().createElement(vn,e)))))}var si,oi=function(){return(0,o.Z)("li",{className:"post"},void 0,(0,o.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,o.Z)("div",{className:"panel-body"},void 0,(0,o.Z)("div",{className:"post-side post-side-registered"},void 0,(0,o.Z)("div",{className:"media"},void 0,Ga||(Ga=(0,o.Z)("div",{className:"media-left"},void 0,(0,o.Z)("span",{},void 0,(0,o.Z)(B.ZP,{className:"poster-avatar",size:"100"})))),(0,o.Z)("div",{className:"media-body"},void 0,(0,o.Z)("span",{className:"media-heading item-title"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"80px"}},void 0," ")),(0,o.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,o.Z)("span",{className:"ui-preview-text",style:{width:"60px"}},void 0," "))))),(0,o.Z)("div",{className:"panel-content"},void 0,(0,o.Z)("div",{className:"post-body"},void 0,(0,o.Z)("article",{className:"misago-markup"},void 0,(0,o.Z)("p",{className:"ui-preview-text",style:{width:"100%"}},void 0," "),(0,o.Z)("p",{className:"ui-preview-text",style:{width:"70%"}},void 0," "),(0,o.Z)("p",{className:"ui-preview-text hidden-xs hidden-sm",style:{width:"85%"}},void 0," ")))))))};function ri(e){return e.posts.isLoaded?(0,o.Z)("ul",{className:"posts-list ui-ready"},void 0,e.posts.results.map((function(t){return f().createElement(li,(0,m.Z)({key:t.id,post:t},e))}))):si||(si=(0,o.Z)("ul",{className:"posts-list ui-preview"},void 0,(0,o.Z)(oi,{})))}function li(e){return e.post.is_event?f().createElement(Zt,e):f().createElement(ii,e)}var ci,ui,di,pi=n(55547),hi=n(53328),vi=n(78107),fi=n(59131),mi=n(98936),Zi=n(50366),gi=n(16768),yi=function(e){var t=e.thread;return(0,o.Z)("div",{className:"thread-user-card"},void 0,(0,o.Z)("div",{className:"thread-user-card-media"},void 0,t.starter?(0,o.Z)("a",{href:t.url.starter},void 0,(0,o.Z)(B.ZP,{size:40,user:t.starter})):ci||(ci=(0,o.Z)(B.ZP,{size:40}))),(0,o.Z)("div",{className:"thread-user-card-body"},void 0,(0,o.Z)("div",{className:"thread-user-card-header"},void 0,t.starter?(0,o.Z)("a",{className:"item-title",href:t.url.starter,title:gettext("Thread author")},void 0,t.starter.username):(0,o.Z)("span",{className:"item-title",title:gettext("Thread author")},void 0,t.starter_name)),(0,o.Z)("div",{},void 0,(0,o.Z)("span",{className:"text-muted",title:interpolate(gettext("Started on: %(timestamp)s"),{timestamp:t.started_on.format("LLL")},!0)},void 0,t.started_on.fromNow()))))},bi=n(99755),_i=n(12891);var Ni=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0}),N.Z.hide()})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){x.Z.dispatch(b.Ar()),x.Z.dispatch(b.Vx(e))})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){x.Z.dispatch(b.Ar()),400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onChange",(function(e){t.changeValue("title",e.target.value)})),t.state={isLoading:!1,title:e.thread.title,validators:{title:(0,_i.jn)()},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){if(!this.state.title.trim().length)return k.Z.error(gettext("You have to enter thread title.")),!1;var e=this.validate();return!e.title||(k.Z.error(e.title[0]),!1)}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.patch(this.props.thread.api.index,[{op:"replace",path:"title",value:this.state.title}])}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,ui||(ui=(0,o.Z)(ki,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_modal_title",label:gettext("Thread title")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_modal_title",onChange:this.onChange,value:this.state.title}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Change title"))))))}}]),i}(Z.Z);function ki(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,di||(di=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Change title")))}var xi,wi,Ri=n(52753);var Ci,Si,Ei,Pi,Li,Ti,Oi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSuccess",(function(e){t.handleSuccessUnmounted(e),t.setState({isLoading:!0})})),(0,h.Z)((0,c.Z)(t),"handleSuccessUnmounted",(function(e){k.Z.success(gettext("Thread has been merged with other one.")),window.location=e.url})),(0,h.Z)((0,c.Z)(t),"handleError",(function(e){x.Z.dispatch(b.Ar()),400===e.status?e.best_answers||e.polls?N.Z.show((0,o.Z)(Ri.ZP,{api:t.props.thread.api.merge,bestAnswers:e.best_answers,data:{other_thread:t.state.url},polls:e.polls,onError:t.handleError,onSuccess:t.handleSuccessUnmounted})):e.best_answer?k.Z.error(e.best_answer[0]):e.poll?k.Z.error(e.poll[0]):k.Z.error(e.detail):k.Z.apiError(e)})),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.post(this.props.thread.api.merge,{other_thread:this.state.url})}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,xi||(xi=(0,o.Z)(Ai,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to merge with"),help_text:gettext("Merge will delete current thread and move its contents to the thread specified here.")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Merge thread"))))))}}]),i}(Z.Z);function Ai(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,wi||(wi=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Merge thread")))}var Bi,Ii,Di,ji,zi,Ui,Mi,qi,Hi,Fi,Yi,Vi,Gi=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){t.changeValue("category",e.target.value)})),t.state={isReady:!1,isLoading:!1,isError:!1,category:null,categories:[]},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(E.Z.get("THREAD_EDITOR_API")).then((function(t){var n=null,a=t.map((function(e){return!1===e.post||n||(n=e.id),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));e.setState({isReady:!0,category:n,categories:a})}),(function(t){e.setState({isError:t.detail})}))}},{key:"send",value:function(){return x.Z.dispatch(b.n6()),_.Z.patch(this.props.thread.api.index,[{op:"replace",path:"category",value:this.state.category}])}},{key:"handleSuccess",value:function(){_.Z.get(this.props.thread.api.posts.index,{page:this.props.posts.page}).then((function(e){x.Z.dispatch(b.gx(e)),x.Z.dispatch(Ia.zD(e.post_set)),x.Z.dispatch(b.Ar()),k.Z.success(gettext("Thread has been moved.")),N.Z.hide()}),(function(e){x.Z.dispatch(b.Ar()),k.Z.apiError(e)}))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)}},{key:"render",value:function(){return this.state.isReady?(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,Ci||(Ci=(0,o.Z)($i,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_category",label:gettext("New category")},void 0,(0,o.Z)(Qn.Z,{choices:this.state.categories,disabled:this.state.isLoading||this.props.thread.isBusy,id:"id_category",onChange:this.onCategoryChange,value:this.state.category}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading||this.props.thread.isBusy},void 0,gettext("Move thread")))))):this.state.isError?(0,o.Z)(Qi,{message:this.state.isError}):Si||(Si=(0,o.Z)(Wi,{}))}}]),i}(Z.Z);function $i(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ei||(Ei=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move thread")))}function Wi(e){return Pi||(Pi=(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)($i,{}),(0,o.Z)(X.Z,{}))))}function Qi(e){return(0,o.Z)("div",{className:"modal-dialog modal-message",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,Li||(Li=(0,o.Z)($i,{})),Ti||(Ti=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move this thread at the moment.")),(0,o.Z)("p",{},void 0,e.message),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok")))))}var Ki,Ji,Xi,es,ts=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){var e;(0,r.Z)(this,i);for(var t=arguments.length,n=new Array(t),s=0;s<t;s++)n[s]=arguments[s];return e=a.call.apply(a,[this].concat(n)),(0,h.Z)((0,c.Z)(e),"callApi",(function(t,n){x.Z.dispatch(b.n6()),t.push({op:"add",path:"acl",value:!0}),_.Z.patch(e.props.thread.api.index,t).then((function(e){x.Z.dispatch(b.Vx(e)),x.Z.dispatch(b.Ar()),k.Z.success(n)}),(function(e){x.Z.dispatch(b.Ar()),400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e)}))})),(0,h.Z)((0,c.Z)(e),"changeTitle",(function(){N.Z.show((0,o.Z)(Ni,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"pinGlobally",(function(){e.callApi([{op:"replace",path:"weight",value:2}],gettext("Thread has been pinned globally."))})),(0,h.Z)((0,c.Z)(e),"pinLocally",(function(){e.callApi([{op:"replace",path:"weight",value:1}],gettext("Thread has been pinned locally."))})),(0,h.Z)((0,c.Z)(e),"unpin",(function(){e.callApi([{op:"replace",path:"weight",value:0}],gettext("Thread has been unpinned."))})),(0,h.Z)((0,c.Z)(e),"approve",(function(){e.callApi([{op:"replace",path:"is-unapproved",value:!1}],gettext("Thread has been approved."))})),(0,h.Z)((0,c.Z)(e),"open",(function(){e.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Thread has been opened."))})),(0,h.Z)((0,c.Z)(e),"close",(function(){e.callApi([{op:"replace",path:"is-closed",value:!0}],gettext("Thread has been closed."))})),(0,h.Z)((0,c.Z)(e),"unhide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!1}],gettext("Thread has been made visible."))})),(0,h.Z)((0,c.Z)(e),"hide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!0}],gettext("Thread has been made hidden."))})),(0,h.Z)((0,c.Z)(e),"move",(function(){N.Z.show((0,o.Z)(Gi,{posts:e.props.posts,thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"merge",(function(){N.Z.show((0,o.Z)(Oi,{thread:e.props.thread}))})),(0,h.Z)((0,c.Z)(e),"delete",(function(){window.confirm(gettext("Are you sure you want to delete this thread?"))&&(x.Z.dispatch(b.n6()),_.Z.delete(e.props.thread.api.index).then((function(t){k.Z.success(gettext("Thread has been deleted.")),window.location=e.props.thread.category.url.index}),(function(e){x.Z.dispatch(b.Ar()),k.Z.apiError(e)})))})),e}return(0,l.Z)(i,[{key:"render",value:function(){var e=this.props.moderation;return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,!!e.edit&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.changeTitle,type:"button"},void 0,Bi||(Bi=(0,o.Z)("span",{className:"material-icon"},void 0,"edit")),gettext("Change title"))),!!e.pinGlobally&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.pinGlobally,type:"button"},void 0,Ii||(Ii=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark")),gettext("Pin globally"))),!!e.pinLocally&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.pinLocally,type:"button"},void 0,Di||(Di=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),gettext("Pin locally"))),!!e.unpin&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.unpin,type:"button"},void 0,ji||(ji=(0,o.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),gettext("Unpin"))),!!e.move&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.move,type:"button"},void 0,zi||(zi=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))),!!e.merge&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.merge,type:"button"},void 0,Ui||(Ui=(0,o.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge"))),!!e.approve&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.approve,type:"button"},void 0,Mi||(Mi=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))),!!e.open&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.open,type:"button"},void 0,qi||(qi=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Open"))),!!e.close&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.close,type:"button"},void 0,Hi||(Hi=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Close"))),!!e.unhide&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.unhide,type:"button"},void 0,Fi||(Fi=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))),!!e.hide&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.hide,type:"button"},void 0,Yi||(Yi=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))),!!e.delete&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:this.delete,type:"button"},void 0,Vi||(Vi=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))))}}]),i}(f().Component),ns=ts,as=function(e){var t=e.thread,n=e.posts,a=e.moderation;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Thread options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:t.isBusy},void 0,Ki||(Ki=(0,o.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,o.Z)(ns,{thread:t,posts:n,moderation:a}))},is=n(94184),ss=n.n(is);function os(e,t,n){var a={subscription:e.subscription};x.Z.dispatch(b.Vx({subscription:t})),_.Z.patch(e.api.index,[{op:"replace",path:"subscription",value:n}]).then((function(e){x.Z.dispatch(b.Vx(e))}),(function(e){400===e.status?k.Z.error(e.detail[0]):k.Z.apiError(e),x.Z.dispatch(b.Vx(a))}))}var rs,ls,cs,us,ds,ps,hs,vs,fs,ms,Zs,gs,ys,bs=function(e){var t,n=e.stickToBottom,a=e.thread;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-block","aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,!0===(t=a.subscription)?"star":!1===t?"star_half":"star_border"),function(e){return!0===e?gettext("E-mail"):!1===e?gettext("Enabled"):gettext("Disabled")}(a.subscription)),(0,o.Z)("ul",{className:ss()("dropdown-menu dropdown-menu-right",{"stick-to-bottom":n})},void 0,(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){null!==e.subscription&&os(e,null,"unsubscribe")}(a)}},void 0,Ji||(Ji=(0,o.Z)("span",{className:"material-icon"},void 0,"star_border")),gettext("Unsubscribe"))),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){!1!==e.subscription&&os(e,!1,"notify")}(a)}},void 0,Xi||(Xi=(0,o.Z)("span",{className:"material-icon"},void 0,"star_half")),gettext("Subscribe"))),(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:function(){return function(e){!0!==e.subscription&&os(e,!0,"email")}(a)}},void 0,es||(es=(0,o.Z)("span",{className:"material-icon"},void 0,"star")),gettext("Subscribe with e-mail")))))},_s=function(e){var t=e.children,n=e.className;return(0,o.Z)("ul",{className:ss()("breadcrumbs",n)},void 0,t)},Ns=function(e){var t=e.category,n=e.className;return(0,o.Z)("li",{className:ss()("breadcrumbs-item",n)},void 0,(0,o.Z)("a",{href:t.url.index},void 0,(0,o.Z)("span",{className:"material-icon",style:{color:t.color||"inherit"}},void 0,"label"),!!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name hidden-sm hidden-md hidden-lg",title:t.name},void 0,t.short_name),!!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name hidden-xs"},void 0,t.name),!t.short_name&&(0,o.Z)("span",{className:"breadcrumbs-item-name"},void 0,t.name)))},ks=function(e){var t=e.category,n=e.className;return(0,o.Z)("li",{className:ss()("breadcrumbs-item",n)},void 0,(0,o.Z)("a",{href:t.url.index},void 0,rs||(rs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right")),(0,o.Z)("span",{className:"breadcrumbs-item-name"},void 0,"root_category"===t.special_role?gettext("Threads"):gettext("Private threads"))))},xs=function(e){var t=e.breadcrumbs;return(0,o.Z)(_s,{},void 0,t.map((function(e){return e.special_role?(0,o.Z)(ks,{category:e},e.id):(0,o.Z)(Ns,{category:e},e.id)})))},ws=function(e){var t=e.styleName,n=e.thread,a=e.posts,i=e.user,s=e.moderation;return(0,o.Z)(bi.sP,{},void 0,(0,o.Z)(bi.mr,{styleName:t},void 0,(0,o.Z)(bi.gC,{styleName:t},void 0,(0,o.Z)(xs,{breadcrumbs:n.path}),(0,o.Z)("h1",{},void 0,n.title)),(0,o.Z)(bi.eA,{className:"page-header-thread-details"},void 0,(0,o.Z)(mi.gq,{},void 0,(0,o.Z)(mi.kw,{auto:!0},void 0,(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(yi,{thread:n})),ls||(ls=(0,o.Z)(mi.Z6,{auto:!0})),n.replies>0&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(gi.Z,{thread:n})),function(e){return e.is_closed||e.is_hidden||e.is_unapproved||e.weight>0||e.best_answer||e.has_poll||e.has_unapproved_posts}(n)&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(Zi.Z,{thread:n}))),i.is_authenticated&&(0,o.Z)(mi.kw,{},void 0,(0,o.Z)(mi.Z6,{},void 0,(0,o.Z)(bs,{thread:n})),s.enabled&&(0,o.Z)(mi.Z6,{shrink:!0},void 0,(0,o.Z)(as,{thread:n,posts:a,moderation:s})))))))},Rs=n(92490),Cs=n(69987),Ss=function(e){var t=e.baseUrl,n=e.posts;return(0,o.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t,title:gettext("Go to first page")},void 0,cs||(cs=(0,o.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to first page"),type:"button",disabled:!0},void 0,us||(us=(0,o.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+(n.previous>1?n.previous+"/":""),title:gettext("Go to previous page")},void 0,ds||(ds=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to previous page"),type:"button",disabled:!0},void 0,ps||(ps=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.next+"/",title:gettext("Go to next page")},void 0,hs||(hs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to next page"),type:"button",disabled:!0},void 0,vs||(vs=(0,o.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,o.Z)(Cs.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.last+"/",title:gettext("Go to last page")},void 0,fs||(fs=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to last page"),type:"button",disabled:!0},void 0,ms||(ms=(0,o.Z)("span",{className:"material-icon"},void 0,"last_page"))))},Es=function(e){var t=e.posts;return t.more?(0,o.Z)("p",{},void 0,interpolate(ngettext("There is %(more)s more post in this thread.","There are %(more)s more posts in this thread.",t.more),{more:t.more},!0)):(0,o.Z)("p",{},void 0,gettext("There are no more posts in this thread."))};function Ps(e){var t=e.errors,n=e.posts;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Zs||(Zs=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Moderation"))),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("One or more posts could not be changed:")),(0,o.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,t.map((function(e){return(0,o.Z)(Ls,{errors:e.detail,post:n[e.id]},e.id)}))))))}function Ls(e){var t=e.errors,n=e.post,a=interpolate(gettext("%(username)s on %(posted_on)s"),{posted_on:n.posted_on.format("LL, LT"),username:n.poster_name},!0);return(0,o.Z)("li",{},void 0,(0,o.Z)("h5",{},void 0,a,":"),t.map((function(e,t){return(0,o.Z)("p",{},t,e)})))}function Ts(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_unapproved:!1}})),a=t.map((function(e){return{id:e.id,is_unapproved:e.is_unapproved}}));Ds(e,[{op:"replace",path:"is-unapproved",value:!1}],n,a)}function Os(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!0}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Ds(e,[{op:"replace",path:"is-protected",value:!0}],n,a)}function As(e){var t=e.selection,n=t.map((function(e){return{id:e.id,is_protected:!1}})),a=t.map((function(e){return{id:e.id,is_protected:e.is_protected}}));Ds(e,[{op:"replace",path:"is-protected",value:!1}],n,a)}function Bs(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!0,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Ds(e,[{op:"replace",path:"is-hidden",value:!0}],n,a)}function Is(e){var t=e.selection,n=t.map((function(t){return{id:t.id,is_hidden:!1,hidden_on:H()(),hidden_by_name:e.user.username,url:Object.assign(t.url,{hidden_by:e.user.url})}})),a=t.map((function(e){return{id:e.id,is_hidden:e.is_hidden,hidden_on:e.hidden_on,hidden_by_name:e.hidden_by_name,url:e.url}}));Ds(e,[{op:"replace",path:"is-hidden",value:!1}],n,a)}function Ds(e,t,n,a){var i=e.selection,s=e.thread;n.forEach((function(e){Ge.r$(e,e)})),x.Z.dispatch(Ia.kR());var r={ops:t,ids:i.map((function(e){return e.id}))};_.Z.patch(s.api.posts.index,r).then((function(e){e.forEach((function(e){x.Z.dispatch(Ge.r$(e,e))}))}),(function(e){if(400!==e.status)return a.forEach((function(e){x.Z.dispatch(Ge.r$(e,e))})),k.Z.apiError(e);var t=[],n=[];e.forEach((function(e){e.detail?(t.push(e),n.push(e.id)):x.Z.dispatch(Ge.r$(e,e)),a.forEach((function(e){-1!==n.indexOf(e)&&x.Z.dispatch(Ge.r$(e,e))}))}));var s={};i.forEach((function(e){s[e.id]=e})),N.Z.show((0,o.Z)(Ps,{errors:t,posts:s}))}))}function js(e){window.confirm(gettext("Are you sure you want to merge selected posts? This action is not reversible!"))&&(e.selection.slice(1).map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),_.Z.post(e.thread.api.posts.merge,{posts:e.selection.map((function(e){return e.id}))}).then((function(e){x.Z.dispatch(Ge.r$(e,Ge.ZB(e)))}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),e.selection.slice(1).map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),x.Z.dispatch(Ia.kR()))}function zs(e){if(window.confirm(gettext("Are you sure you want to delete selected posts? This action is not reversible!"))){e.selection.map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))}));var t=e.selection.map((function(e){return e.id}));_.Z.delete(e.thread.api.posts.index,t).then((function(){}),(function(t){400===t.status?k.Z.error(t.detail):k.Z.apiError(t),e.selection.map((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!1}))}))})),x.Z.dispatch(Ia.kR())}}var Us,Ms,qs,Hs,Fs,Ys,Vs=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onUrlChange",(function(e){t.changeValue("url",e.target.value)})),t.state={isLoading:!1,url:"",validators:{url:[]},errors:{}},t}return(0,l.Z)(i,[{key:"clean",value:function(){return!!this.state.url.trim().length||(k.Z.error(gettext("You have to enter link to the other thread.")),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.move,{new_thread:this.state.url,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),N.Z.hide(),k.Z.success(gettext("Selected posts were moved to the other thread."))}},{key:"handleError",value:function(e){400===e.status?k.Z.error(e.detail):k.Z.apiError(e)}},{key:"render",value:function(){return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,gs||(gs=(0,o.Z)(Gs,{})),(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{for:"id_url",label:gettext("Link to thread you want to move posts to")},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,id:"id_url",onChange:this.onUrlChange,value:this.state.url}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary",disabled:this.state.isLoading},void 0,gettext("Move posts"))))))}}]),i}(Z.Z);function Gs(e){return(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ys||(ys=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Move posts")))}function $s(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function Ws(e){return f().createElement(so,(0,m.Z)({},e,{Form:oo}))}var Qs,Ks,Js,Xs,eo,to,no,ao,io,so=function(e){(0,u.Z)(n,e);var t=$s(n);function n(e){var a;return(0,r.Z)(this,n),(a=t.call(this,e)).state={isLoaded:!1,isError:!1,categories:[]},a}return(0,l.Z)(n,[{key:"componentDidMount",value:function(){var e=this;_.Z.get(misago.get("THREAD_EDITOR_API")).then((function(t){var n=t.map((function(e){return Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id,post:e.post})}));e.setState({isLoaded:!0,categories:n})}),(function(t){e.setState({isError:t.detail})}))}},{key:"render",value:function(){return this.state.isError?(0,o.Z)(lo,{message:this.state.isError}):this.state.isLoaded?f().createElement(oo,(0,m.Z)({},this.props,{categories:this.state.categories})):Us||(Us=(0,o.Z)(ro,{}))}}]),n}(f().Component),oo=function(e){(0,u.Z)(n,e);var t=$s(n);function n(e){var a;return(0,r.Z)(this,n),a=t.call(this,e),(0,h.Z)((0,c.Z)(a),"onCategoryChange",(function(e){var t=e.target.value,n={category:t};a.acl[t].can_pin_threads<n.weight&&(n.weight=0),a.acl[t].can_hide_threads||(n.is_hidden=0),a.acl[t].can_close_threads||(n.is_closed=!1),a.setState(n)})),a.state={isLoading:!1,title:"",category:null,categories:e.categories,weight:0,is_hidden:0,is_closed:!1,validators:{title:[Jn.C1()]},errors:{}},a.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],a.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],a.acl={},a.props.categories.forEach((function(e){e.post&&(a.state.category||(a.state.category=e.id),a.acl[e.id]={can_pin_threads:e.post.pin,can_close_threads:e.post.close,can_hide_threads:e.post.hide})})),a}return(0,l.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(k.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return _.Z.post(this.props.thread.api.posts.split,{title:this.state.title,category:this.state.category,weight:this.state.weight,is_hidden:this.state.is_hidden,is_closed:this.state.is_closed,posts:this.props.selection.map((function(e){return e.id}))})}},{key:"handleSuccess",value:function(e){this.props.selection.forEach((function(e){x.Z.dispatch(Ge.r$(e,{isDeleted:!0}))})),N.Z.hide(),k.Z.success(gettext("Selected posts were split into new thread."))}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),k.Z.error(gettext("Form contains errors."))):403===e.status&&Array.isArray(e)?N.Z.show((0,o.Z)(Ps,{errors:e})):k.Z.apiError(e)}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,o.Z)(g.Z,{label:gettext("Thread weight"),for:"id_weight",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,o.Z)(g.Z,{label:gettext("Hide thread"),for:"id_is_hidden",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,o.Z)(g.Z,{label:gettext("Close thread"),for:"id_is_closed",labelClass:"col-sm-4",controlClass:"col-sm-8"},void 0,(0,o.Z)(Kn.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"render",value:function(){return(0,o.Z)(co,{className:"modal-dialog"},void 0,(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(g.Z,{label:gettext("Thread title"),for:"id_title",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.title},void 0,(0,o.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),Ms||(Ms=(0,o.Z)("div",{className:"clearfix"})),(0,o.Z)(g.Z,{label:gettext("Category"),for:"id_category",labelClass:"col-sm-4",controlClass:"col-sm-8",validation:this.state.errors.category},void 0,(0,o.Z)(Qn.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.state.categories})),qs||(qs=(0,o.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,o.Z)(Ae.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Split posts")))))}}]),n}(Z.Z);function ro(){return Hs||(Hs=(0,o.Z)(co,{className:"modal-dialog"},void 0,(0,o.Z)(X.Z,{})))}function lo(e){return(0,o.Z)(co,{className:"modal-dialog modal-message"},void 0,Fs||(Fs=(0,o.Z)("div",{className:"message-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,o.Z)("div",{className:"message-body"},void 0,(0,o.Z)("p",{className:"lead"},void 0,gettext("You can't move selected posts at the moment.")),(0,o.Z)("p",{},void 0,e.message),(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}function co(e){return(0,o.Z)("div",{className:e.className,role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Ys||(Ys=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,gettext("Split posts into new thread"))),e.children))}function uo(e){var t=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(e){return!1}}();return function(){var n,a=(0,p.Z)(e);if(t){var i=(0,p.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,d.Z)(this,n)}}function po(e){return(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,f().createElement(ko,e),f().createElement(xo,e),f().createElement(wo,e),f().createElement(Ro,e),f().createElement(Co,e),f().createElement(So,e),f().createElement(Po,e),f().createElement(Eo,e),f().createElement(Lo,e))}var ho,vo,fo,mo,Zo,go,yo,bo,_o,No,ko=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Ts(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_approve&&e.is_unapproved}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Qs||(Qs=(0,o.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve"))):null}}]),n}(f().Component),xo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){js(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.length>1&&this.props.selection.find((function(e){return e.acl.can_merge}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Ks||(Ks=(0,o.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge"))):null}}]),n}(f().Component),wo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(Vs,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Js||(Js=(0,o.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move"))):null}}]),n}(f().Component),Ro=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){N.Z.show(f().createElement(Ws,e.props))})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_move}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,Xs||(Xs=(0,o.Z)("span",{className:"material-icon"},void 0,"call_split")),gettext("Split"))):null}}]),n}(f().Component),Co=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Os(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return!e.is_protected&&e.acl.can_protect}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,eo||(eo=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Protect"))):null}}]),n}(f().Component),So=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){As(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.is_protected&&e.acl.can_protect}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,to||(to=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Unprotect"))):null}}]),n}(f().Component),Eo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Bs(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_hide&&!e.is_hidden}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,no||(no=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide"))):null}}]),n}(f().Component),Po=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){Is(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_unhide&&e.is_hidden}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,ao||(ao=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide"))):null}}]),n}(f().Component),Lo=function(e){(0,u.Z)(n,e);var t=uo(n);function n(){var e;(0,r.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,h.Z)((0,c.Z)(e),"onClick",(function(){zs(e.props)})),e}return(0,l.Z)(n,[{key:"render",value:function(){var e=this.props.selection.find((function(e){return e.acl.can_delete}));return e?(0,o.Z)("li",{},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-link",onClick:this.onClick},void 0,io||(io=(0,o.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete"))):null}}]),n}(f().Component),To=function(e){var t=e.thread,n=e.user,a=e.selection,i=e.dropup;return(0,o.Z)("div",{className:i?"dropup":"dropdown"},void 0,(0,o.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Posts options"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:0===a.length},void 0,ho||(ho=(0,o.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,o.Z)(po,{thread:t,user:n,selection:a}))},Oo=function(e){var t=e.onClick;return(0,o.Z)("button",{className:"btn btn-primary btn-outline btn-block",type:"button",onClick:t},void 0,vo||(vo=(0,o.Z)("span",{className:"material-icon"},void 0,"chat")),gettext("Reply"))},Ao=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.selection,s=e.moderation,r=e.onReply;return(0,o.Z)(Rs.o8,{},void 0,(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Ss,{baseUrl:t.url.index,posts:n})),s.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:i,dropup:!0}))),(0,o.Z)(Rs.Z2,{className:"hidden-xs hidden-sm",auto:!0},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Es,{posts:n}))),fo||(fo=(0,o.Z)(Rs.tw,{className:"hidden-md hidden-lg"})),a.is_authenticated&&(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(bs,{thread:t})),t.acl.can_reply&&(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Oo,{onClick:r})),s.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:i,dropup:!0}))))},Bo=function(e){var t=e.compact,n=e.disabled,a=e.onClick;return(0,o.Z)("button",{className:ss()("btn btn-default btn-outline",{"btn-block":!t,"btn-icon":t}),type:"button",title:t?gettext("Add poll"):null,disabled:n,onClick:a},void 0,mo||(mo=(0,o.Z)("span",{className:"material-icon"},void 0,"poll")),!t&&gettext("Add poll"))},Io=function(e){var t=e.user,n=e.thread;return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Shortcuts"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button"},void 0,Zo||(Zo=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark"))),(0,o.Z)("ul",{className:"dropdown-menu"},void 0,t.is_authenticated&&n.is_new&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.new_post},void 0,go||(go=(0,o.Z)("span",{className:"material-icon"},void 0,"comment")),gettext("Go to new post"))),n.best_answer&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.best_answer},void 0,yo||(yo=(0,o.Z)("span",{className:"material-icon"},void 0,"check_circle")),gettext("Go to best answer"))),n.has_unapproved_posts&&n.acl.can_approve&&(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.unapproved_post},void 0,bo||(bo=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Go to unapproved post"))),(0,o.Z)("li",{},void 0,(0,o.Z)("a",{className:"btn btn-link",href:n.url.last_post},void 0,_o||(_o=(0,o.Z)("span",{className:"material-icon"},void 0,"reply")),gettext("Go to last post")))))},Do=function(e){var t=e.thread,n=e.posts,a=e.user,i=e.pollDisabled,s=e.selection,r=e.moderation,l=e.onPoll,c=e.onReply;return(0,o.Z)(Rs.o8,{},void 0,(0,o.Z)(Rs.Z2,{className:"hidden-xs"},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Io,{thread:t,user:a})),(0,o.Z)(Rs.Eg,{className:"hidden-xs hidden-sm"},void 0,(0,o.Z)(Ss,{baseUrl:t.url.index,posts:n}))),No||(No=(0,o.Z)(Rs.tw,{})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Z2,{className:"hidden-xs"},void 0,(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l}))),t.acl.can_reply?(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Io,{thread:t,user:a})),(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Oo,{onClick:c})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l,compact:!0})),r.enabled&&(0,o.Z)(Rs.Eg,{className:"hidden-xs",shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:s}))):(0,o.Z)(Rs.Z2,{},void 0,(0,o.Z)(Rs.Eg,{className:"hidden-sm hidden-md hidden-lg",shrink:!0},void 0,(0,o.Z)(Io,{thread:t,user:a})),t.acl.can_start_poll&&!t.poll&&(0,o.Z)(Rs.Eg,{},void 0,(0,o.Z)(Bo,{disabled:i,onClick:l})),r.enabled&&(0,o.Z)(Rs.Eg,{shrink:!0},void 0,(0,o.Z)(To,{thread:t,user:a,selection:s}))))};var jo=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,r.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"update",(function(e){x.Z.dispatch(b.gx(e)),x.Z.dispatch(Ia.zD(e.post_set)),e.participants&&x.Z.dispatch(y.gx(e.participants)),e.poll&&x.Z.dispatch(le.gx(e.poll)),t.setPageTitle()})),(0,h.Z)((0,c.Z)(t),"openPollForm",(function(){t.setState({editPoll:!0})})),(0,h.Z)((0,c.Z)(t),"closePollForm",(function(){t.setState({editPoll:!1})})),(0,h.Z)((0,c.Z)(t),"openReplyForm",(function(){ce.Z.open({mode:"REPLY",thread:t.props.thread,config:t.props.thread.api.editor,submit:t.props.thread.api.posts.index})})),t.state={editPoll:!1},t}return(0,l.Z)(i,[{key:"componentDidMount",value:function(){this.shouldFetchData()&&(this.fetchData(),this.setPageTitle()),this.startPollingApi()}},{key:"componentDidUpdate",value:function(){this.shouldFetchData()&&(this.fetchData(),this.startPollingApi(),this.setPageTitle())}},{key:"componentWillUnmount",value:function(){this.stopPollingApi()}},{key:"shouldFetchData",value:function(){return!!this.props.posts.isLoaded&&1*(this.props.params.page||1)!=this.props.posts.page}},{key:"fetchData",value:function(){var e=this;x.Z.dispatch(Ia.Rz()),_.Z.get(this.props.thread.api.posts.index,{page:this.props.params.page||1},"posts").then((function(t){e.update(t)}),(function(e){k.Z.apiError(e)}))}},{key:"startPollingApi",value:function(){pi.Z.start({poll:"thread-posts",url:this.props.thread.api.posts.index,data:{page:this.props.params.page||1},update:this.update,frequency:12e4,delayed:!0})}},{key:"stopPollingApi",value:function(){pi.Z.stop("thread-posts")}},{key:"setPageTitle",value:function(){hi.Z.set({title:this.props.thread.title,parent:this.props.thread.category.name,page:1*(this.props.params.page||1)})}},{key:"render",value:function(){var e=this.props.thread.category,t="page page-thread";e.css_class&&(t+=" page-thread-"+e.css_class);var n="private_threads"===e.special_role?"private-threads":e.css_class||"category-threads",a=zo(this.props.thread,this.props.user),i=Uo(this.props.posts.results,this.props.user),s=this.props.posts.results.filter((function(e){return e.isSelected}));return(0,o.Z)("div",{className:t},void 0,(0,o.Z)(ws,{styleName:n,thread:this.props.thread,posts:this.props.posts,user:this.props.user,moderation:a}),(0,o.Z)(fi.Z,{},void 0,(0,o.Z)(z,{participants:this.props.participants,thread:this.props.thread,user:this.props.user}),(0,o.Z)(Do,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:s,moderation:i,pollDisabled:this.state.editPoll,onPoll:this.openPollForm,onReply:this.openReplyForm}),this.state.editPoll?(0,o.Z)(He,{poll:this.props.poll,thread:this.props.thread,close:this.closePollForm}):(0,o.Z)(De,{poll:this.props.poll,thread:this.props.thread,user:this.props.user,edit:this.openPollForm}),this.props.thread.acl.can_reply?(0,o.Z)(vi.mv,{posting:{mode:"REPLY",thread:this.props.thread,config:this.props.thread.api.editor,submit:this.props.thread.api.posts.index}},void 0,f().createElement(ri,this.props)):f().createElement(ri,this.props),(0,o.Z)(Ao,{thread:this.props.thread,posts:this.props.posts,user:this.props.user,selection:s,moderation:i,onReply:this.openReplyForm})))}}]),i}(f().Component),zo=function(e,t){var n={enabled:!1,edit:!1,approve:!1,close:!1,open:!1,hide:!1,unhide:!1,move:!1,merge:!1,pinGlobally:!1,pinLocally:!1,unpin:!1,delete:!1};return t.is_authenticated?(n.edit=e.acl.can_edit,n.approve=e.acl.can_approve&&e.is_unapproved,n.close=e.acl.can_close&&!e.is_closed,n.open=e.acl.can_close&&e.is_closed,n.hide=e.acl.can_hide&&!e.is_hidden,n.unhide=e.acl.can_unhide&&e.is_hidden,n.move=e.acl.can_move,n.merge=e.acl.can_merge,n.pinGlobally=e.acl.can_pin_globally&&e.weight<2,n.pinLocally=e.acl.can_pin&&1!==e.weight,n.unpin=e.acl.can_pin&&1===e.weight||e.acl.can_pin_globally&&2===e.weight,n.delete=e.acl.can_delete,n.enabled=n.edit||n.approve||n.close||n.open||n.hide||n.unhide||n.move||n.merge||n.pinGlobally||n.pinLocally||n.unpin||n.delete,n):n},Uo=function(e,t){var n={enabled:!1,approve:!1,move:!1,merge:!1,protect:!1,hide:!1,delete:!1};return t.is_authenticated?(e.forEach((function(e){e.is_event||(e.acl.can_approve&&e.is_unapproved&&(n.approve=!0),e.acl.can_move&&(n.move=!0),e.acl.can_merge&&(n.merge=!0),(e.acl.can_protect||e.acl.can_unprotect)&&(n.protect=!0),(e.acl.can_hide||e.acl.can_unhide)&&(n.hide=!0),e.acl.can_delete&&(n.delete=!0),(n.approve||n.move||n.merge||n.protect||n.hide||n.delete)&&(n.enabled=!0))})),n):n};function Mo(e){return{participants:e.participants,poll:e.poll,posts:e.posts,thread:e.thread,tick:e.tick.tick,user:e.auth.user}}var qo=n(39633);E.Z.addInitializer({name:"component:thread",initializer:function(e){var t,n;e.has("THREAD")&&e.has("POSTS")&&(0,qo.Z)({paths:(t=E.Z.get("THREAD"),n=t.url.index.replace(t.slug+"-"+t.pk,":slug"),[{path:n,component:(0,s.$j)(Mo)(jo)},{path:n+":page/",component:(0,s.$j)(Mo)(jo)}])})},after:"store"})},72168:function(e,t,n){"use strict";var a=n(37424),i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=n(57588),h=n.n(p),v=n(82211);function f(e,t){return e.last_post>t.last_post?-1:e.last_post<t.last_post?1:0}function m(e,t){return 2===e.weight&&e.weight>t.weight?-1:2===t.weight&&e.weight<t.weight?1:f(e,t)}function Z(e,t){return e.weight>t.weight?-1:e.weight<t.weight?1:f(e,t)}var g,y,b=n(59131),_=n(64646),N=n(92490),k=n(69987),x=function(e){var t=e.allItems,n=e.parentUrl,a=e.category,s=e.categories,o=e.list;return(0,i.Z)("div",{className:"dropdown threads-category-picker"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline dropdown-toggle btn-block text-ellipsis","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a&&(0,i.Z)("span",{className:"material-icon",style:{color:a.color||"inherit"}},void 0,"label"),a&&a.short_name&&(0,i.Z)("span",{className:a.short_name&&"hidden-md hidden-lg"},void 0,a.short_name),a?(0,i.Z)("span",{className:a.short_name&&"hidden-xs hidden-sm"},void 0,a.name):t),(0,i.Z)("ul",{className:"dropdown-menu"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)(k.rU,{to:n+o.path},void 0,t)),g||(g=(0,i.Z)("li",{role:"separator",className:"divider"})),s.map((function(e){return(0,i.Z)("li",{},e.id,(0,i.Z)(k.rU,{to:e.url.index+o.path},void 0,(0,i.Z)("span",{className:"material-icon",style:{color:e.color||"inherit"}},void 0,"label"),e.name))}))))},w=function(e){var t=e.baseUrl,n=e.list,a=e.lists;return(0,i.Z)("div",{className:"dropdown threads-list-picker"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline dropdown-toggle btn-block","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,n.longName),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,a.map((function(e){return(0,i.Z)("li",{},e.type,(0,i.Z)(k.rU,{to:t+e.path},void 0,e.longName))}))))};var R=function(e){(0,l.Z)(r,e);var t,n,a=(t=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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function r(){return(0,s.Z)(this,r),a.apply(this,arguments)}return(0,o.Z)(r,[{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,y||(y=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Threads moderation"))),(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("One or more threads could not be deleted:")),(0,i.Z)("ul",{className:"list-unstyled list-errored-items"},void 0,this.props.errors.map((function(e){return(0,i.Z)(C,{errors:e.errors,thread:e.thread},e.thread.id)}))))))}}]),r}(h().Component);function C(e){var t=e.errors,n=e.thread;return(0,i.Z)("li",{},void 0,(0,i.Z)("h5",{},void 0,n.title),t.map((function(e,t){return(0,i.Z)("p",{},void 0,e)})))}var S,E,P,L,T=n(43345),O=n(96359),A=n(57026),B=n(60471),I=n(32233),D=n(61340),j=n(77751),z=n(52753),U=n(78657),M=n(59801),q=n(53904),H=n(90287),F=n(55210);var Y,V,G=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;for(var n in(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"getFormdata",(function(){return{threads:t.props.threads.map((function(e){return e.id})),title:t.state.title,category:t.state.category,weight:t.state.weight,is_hidden:t.state.is_hidden,is_closed:t.state.is_closed}})),(0,d.Z)((0,r.Z)(t),"handleSuccess",(function(e){t.props.threads.forEach((function(e){t.props.freezeThread(e.id),t.props.deleteThread(e)})),H.Z.dispatch(j.YP()),t.props.addThreads([e]),H.Z.dispatch((0,D.V8)(t.props.route.category,t.props.categoriesMap)),M.Z.hide()})),(0,d.Z)((0,r.Z)(t),"handleError",(function(e){400===e.status?e.best_answers||e.polls?M.Z.show((0,i.Z)(z.ZP,{api:I.Z.get("MERGE_THREADS_API"),bestAnswers:e.best_answers,data:t.getFormdata(),polls:e.polls,onError:t.handleError,onSuccess:t.handleSuccess})):(t.setState({errors:Object.assign({},t.state.errors,e)}),q.Z.error(gettext("Form contains errors."))):403===e.status&&Array.isArray(e)?M.Z.show((0,i.Z)(R,{errors:e})):e.best_answer?q.Z.error(e.best_answer[0]):e.poll?q.Z.error(e.poll[0]):q.Z.apiError(e)})),(0,d.Z)((0,r.Z)(t),"onCategoryChange",(function(e){var n=e.target.value,a={category:n};t.acl[n].can_pin_threads<a.weight&&(a.weight=0),t.acl[n].can_hide_threads||(a.is_hidden=0),t.acl[n].can_close_threads||(a.is_closed=!1),t.setState(a)})),t.state={isLoading:!1,title:"",category:null,weight:0,is_hidden:0,is_closed:!1,validators:{title:[F.C1()]},errors:{}},t.acl={},e.user.acl.categories)if(e.user.acl.categories.hasOwnProperty(n)){var o=e.user.acl.categories[n];t.acl[o.id]=o}return t.categoryChoices=[],e.categories.forEach((function(e){if(e.level>0){var n=t.acl[e.id],a=!n.can_start_threads||e.is_closed&&!n.can_close_threads;t.categoryChoices.push({value:e.id,disabled:a,level:e.level-1,label:e.name}),a||t.state.category||(t.state.category=e.id)}})),t.isHiddenChoices=[{value:0,icon:"visibility",label:gettext("No")},{value:1,icon:"visibility_off",label:gettext("Yes")}],t.isClosedChoices=[{value:!1,icon:"lock_outline",label:gettext("No")},{value:!0,icon:"lock",label:gettext("Yes")}],t}return(0,o.Z)(p,[{key:"clean",value:function(){return!!this.isValid()||(q.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return U.Z.post(I.Z.get("MERGE_THREADS_API"),this.getFormdata())}},{key:"getWeightChoices",value:function(){var e=[{value:0,icon:"remove",label:gettext("Not pinned")},{value:1,icon:"bookmark_border",label:gettext("Pinned locally")}];return 2==this.acl[this.state.category].can_pin_threads&&e.push({value:2,icon:"bookmark",label:gettext("Pinned globally")}),e}},{key:"renderWeightField",value:function(){return this.acl[this.state.category].can_pin_threads?(0,i.Z)(O.Z,{label:gettext("Thread weight"),for:"id_weight"},void 0,(0,i.Z)(B.Z,{id:"id_weight",onChange:this.bindInput("weight"),value:this.state.weight,choices:this.getWeightChoices()})):null}},{key:"renderHiddenField",value:function(){return this.acl[this.state.category].can_hide_threads?(0,i.Z)(O.Z,{label:gettext("Hide thread"),for:"id_is_hidden"},void 0,(0,i.Z)(B.Z,{id:"id_is_closed",onChange:this.bindInput("is_hidden"),value:this.state.is_hidden,choices:this.isHiddenChoices})):null}},{key:"renderClosedField",value:function(){return this.acl[this.state.category].can_close_threads?(0,i.Z)(O.Z,{label:gettext("Close thread"),for:"id_is_closed"},void 0,(0,i.Z)(B.Z,{id:"id_is_closed",onChange:this.bindInput("is_closed"),value:this.state.is_closed,choices:this.isClosedChoices})):null}},{key:"renderForm",value:function(){return(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(O.Z,{label:gettext("Thread title"),for:"id_title",validation:this.state.errors.title},void 0,(0,i.Z)("input",{id:"id_title",className:"form-control",type:"text",onChange:this.bindInput("title"),value:this.state.title})),S||(S=(0,i.Z)("div",{className:"clearfix"})),(0,i.Z)(O.Z,{label:gettext("Category"),for:"id_category",validation:this.state.errors.category},void 0,(0,i.Z)(A.Z,{id:"id_category",onChange:this.onCategoryChange,value:this.state.category,choices:this.categoryChoices})),E||(E=(0,i.Z)("div",{className:"clearfix"})),this.renderWeightField(),this.renderHiddenField(),this.renderClosedField()),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)(v.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Merge threads"))))}},{key:"renderCantMergeMessage",value:function(){return(0,i.Z)("div",{className:"modal-body"},void 0,P||(P=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"message-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("You can't move threads because there are no categories you are allowed to move them to.")),(0,i.Z)("p",{},void 0,gettext("You need permission to start threads in category to be able to merge threads to it.")),(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}},{key:"getClassName",value:function(){return this.state.category?"modal-dialog":"modal-dialog modal-message"}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,L||(L=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Merge threads"))),this.state.category?this.renderForm():this.renderCantMergeMessage()))}}]),p}(T.Z);var $,W,Q,K,J,X,ee,te,ne,ae,ie,se,oe,re,le=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"handleSubmit",(function(e){e.preventDefault(),M.Z.hide(),t.props.callApi([{op:"replace",path:"category",value:t.state.category},{op:"replace",path:"flatten-categories",value:null},{op:"add",path:"acl",value:!0}],gettext("Selected threads were moved."),(function(){H.Z.dispatch((0,D.V8)(t.props.route.category,t.props.categoriesMap));var e=H.Z.getState(),n=e.threads.map((function(e){return e.id}));H.Z.dispatch(j.$6(e.selection.filter((function(e){return-1!==n.indexOf(e)}))))}))})),t.state={category:null};var n={};for(var i in e.user.acl.categories)if(e.user.acl.categories.hasOwnProperty(i)){var o=e.user.acl.categories[i];n[o.id]=o}return t.categoryChoices=[],e.categories.forEach((function(e){if(e.level>0){var a=n[e.id],i=!a.can_start_threads||e.is_closed&&!a.can_close_threads;t.categoryChoices.push({value:e.id,disabled:i,level:e.level-1,label:e.name}),i||t.state.category||(t.state.category=e.id)}})),t}return(0,o.Z)(p,[{key:"getClassName",value:function(){return this.state.category?"modal-dialog":"modal-dialog modal-message"}},{key:"renderForm",value:function(){return(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(O.Z,{label:gettext("New category"),for:"id_new_category"},void 0,(0,i.Z)(A.Z,{id:"id_new_category",onChange:this.bindInput("category"),value:this.state.category,choices:this.categoryChoices}))),(0,i.Z)("div",{className:"modal-footer"},void 0,(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,i.Z)("button",{className:"btn btn-primary"},void 0,gettext("Move threads"))))}},{key:"renderCantMoveMessage",value:function(){return(0,i.Z)("div",{className:"modal-body"},void 0,Y||(Y=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"message-body"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("You can't move threads because there are no categories you are allowed to move them to.")),(0,i.Z)("p",{},void 0,gettext("You need permission to start threads in category to be able to move threads to it.")),(0,i.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,V||(V=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Move threads"))),this.state.category?this.renderForm():this.renderCantMoveMessage()))}}]),p}(T.Z);var ce,ue,de,pe=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(){var e;(0,s.Z)(this,p);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,d.Z)((0,r.Z)(e),"callApi",(function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;e.props.threads.forEach((function(t){e.props.freezeThread(t.id)}));var s=e.props.threads.map((function(e){return e.id}));t.push({op:"add",path:"acl",value:!0}),U.Z.patch(e.props.api,{ids:s,ops:t}).then((function(t){e.props.threads.forEach((function(t){e.props.freezeThread(t.id)})),t.forEach((function(t){e.props.updateThread(t)})),q.Z.success(n),a&&a()}),(function(t){if(e.props.threads.forEach((function(t){e.props.freezeThread(t.id)})),400!==t.status)return q.Z.apiError(t);var n=[],a={};e.props.threads.forEach((function(e){a[e.id]=e})),t.forEach((function(e){var t=e.id,i=e.detail;void 0!==a[t]&&n.push({errors:i,thread:a[t]})})),M.Z.show((0,i.Z)(R,{errors:n}))}))})),(0,d.Z)((0,r.Z)(e),"pinGlobally",(function(){e.callApi([{op:"replace",path:"weight",value:2}],gettext("Selected threads were pinned globally."))})),(0,d.Z)((0,r.Z)(e),"pinLocally",(function(){e.callApi([{op:"replace",path:"weight",value:1}],gettext("Selected threads were pinned locally."))})),(0,d.Z)((0,r.Z)(e),"unpin",(function(){e.callApi([{op:"replace",path:"weight",value:0}],gettext("Selected threads were unpinned."))})),(0,d.Z)((0,r.Z)(e),"approve",(function(){e.callApi([{op:"replace",path:"is-unapproved",value:!1}],gettext("Selected threads were approved."))})),(0,d.Z)((0,r.Z)(e),"open",(function(){e.callApi([{op:"replace",path:"is-closed",value:!1}],gettext("Selected threads were opened."))})),(0,d.Z)((0,r.Z)(e),"close",(function(){e.callApi([{op:"replace",path:"is-closed",value:!0}],gettext("Selected threads were closed."))})),(0,d.Z)((0,r.Z)(e),"unhide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!1}],gettext("Selected threads were unhidden."))})),(0,d.Z)((0,r.Z)(e),"hide",(function(){e.callApi([{op:"replace",path:"is-hidden",value:!0}],gettext("Selected threads were hidden."))})),(0,d.Z)((0,r.Z)(e),"move",(function(){M.Z.show((0,i.Z)(le,{callApi:e.callApi,categories:e.props.categories,categoriesMap:e.props.categoriesMap,route:e.props.route,user:e.props.user}))})),(0,d.Z)((0,r.Z)(e),"merge",(function(){var t=[];if(e.props.threads.forEach((function(e){e.acl.can_merge||t.append({id:e.id,title:e.title,errors:[gettext("You don't have permission to merge this thread with others.")]})})),e.props.threads.length<2)q.Z.info(gettext("You have to select at least two threads to merge."));else{if(t.length)return void M.Z.show((0,i.Z)(R,{errors:t}));M.Z.show(h().createElement(G,e.props))}})),(0,d.Z)((0,r.Z)(e),"delete",(function(){if(window.confirm(gettext("Are you sure you want to delete selected threads?"))){e.props.threads.map((function(t){e.props.freezeThread(t.id)}));var t=e.props.threads.map((function(e){return e.id}));U.Z.delete(e.props.api,t).then((function(){e.props.threads.map((function(t){e.props.freezeThread(t.id),e.props.deleteThread(t)})),q.Z.success(gettext("Selected threads were deleted."))}),(function(t){if(400===t.status){var n=t.map((function(e){return e.id}));e.props.threads.map((function(t){e.props.freezeThread(t.id),-1===n.indexOf(t.id)&&e.props.deleteThread(t)})),M.Z.show((0,i.Z)(R,{errors:t}))}else q.Z.apiError(t)}))}})),e}return(0,o.Z)(p,[{key:"render",value:function(){var e=this.props,t=e.moderation,n=e.threads,a=0==this.props.selection.length;return(0,i.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",onClick:function(){return H.Z.dispatch(j.$6(n.map((function(e){return e.id}))))}},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"check_box")),gettext("Select all"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:function(){return H.Z.dispatch(j.YP())}},void 0,W||(W=(0,i.Z)("span",{className:"material-icon"},void 0,"check_box_outline_blank")),gettext("Select none"))),Q||(Q=(0,i.Z)("li",{role:"separator",className:"divider"})),!!t.can_pin_globally&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.pinGlobally},void 0,K||(K=(0,i.Z)("span",{className:"material-icon"},void 0,"bookmark")),gettext("Pin threads globally"))),!!t.can_pin&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.pinLocally},void 0,J||(J=(0,i.Z)("span",{className:"material-icon"},void 0,"bookmark_border")),gettext("Pin threads locally"))),!!t.can_pin&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.unpin},void 0,X||(X=(0,i.Z)("span",{className:"material-icon"},void 0,"panorama_fish_eye")),gettext("Unpin threads"))),!!t.can_move&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.move},void 0,ee||(ee=(0,i.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),gettext("Move threads"))),!!t.can_merge&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.merge},void 0,te||(te=(0,i.Z)("span",{className:"material-icon"},void 0,"call_merge")),gettext("Merge threads"))),!!t.can_approve&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.approve},void 0,ne||(ne=(0,i.Z)("span",{className:"material-icon"},void 0,"done")),gettext("Approve threads"))),!!t.can_close&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.open},void 0,ae||(ae=(0,i.Z)("span",{className:"material-icon"},void 0,"lock_open")),gettext("Open threads"))),!!t.can_close&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.close},void 0,ie||(ie=(0,i.Z)("span",{className:"material-icon"},void 0,"lock_outline")),gettext("Close threads"))),!!t.can_unhide&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.unhide},void 0,se||(se=(0,i.Z)("span",{className:"material-icon"},void 0,"visibility")),gettext("Unhide threads"))),!!t.can_hide&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.hide},void 0,oe||(oe=(0,i.Z)("span",{className:"material-icon"},void 0,"visibility_off")),gettext("Hide threads"))),!!t.can_delete&&(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn btn-link",type:"button",disabled:a,onClick:this.delete},void 0,re||(re=(0,i.Z)("span",{className:"material-icon"},void 0,"clear")),gettext("Delete threads"))))}}]),p}(h().Component),he=function(e){var t=e.api,n=e.categoriesMap,a=e.categories,s=e.threads,o=e.addThreads,r=e.freezeThread,l=e.updateThread,c=e.deleteThread,u=e.selection,d=e.moderation,p=e.route,h=e.user,v=e.disabled;return(0,i.Z)("div",{className:"dropdown threads-moderation"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-default btn-outline btn-icon dropdown-toggle",title:gettext("Moderation"),"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false",disabled:v},void 0,ce||(ce=(0,i.Z)("span",{className:"material-icon"},void 0,"settings"))),(0,i.Z)(pe,{api:t,categories:a,categoriesMap:n,threads:s,addThreads:o,freezeThread:r,updateThread:l,deleteThread:c,selection:u,moderation:d,route:p,user:h,disabled:v}))},ve=function(e){var t=e.api,n=e.baseUrl,a=e.category,s=e.categories,o=e.categoriesMap,r=e.topCategory,l=e.topCategories,c=e.subCategory,u=e.subCategories,d=e.list,p=e.lists,h=e.threads,f=e.addThreads,m=e.startThread,Z=e.freezeThread,g=e.updateThread,y=e.deleteThread,b=e.selection,k=e.moderation,R=e.route,C=e.user,S=e.disabled;return(0,i.Z)(N.o8,{},void 0,l.length>0&&(0,i.Z)(N.Z2,{},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(x,{allItems:gettext("All categories"),parentUrl:d.path,category:r,categories:l,list:d})),r&&u.length>0&&(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(x,{allItems:gettext("All subcategories"),parentUrl:r.url.index,category:c,categories:u,list:d}))),p.length>1&&(0,i.Z)(N.Z2,{className:"hidden-xs"},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(w,{baseUrl:n,list:d,lists:p}))),ue||(ue=(0,i.Z)(N.tw,{})),!!C.id&&(0,i.Z)(N.Z2,{},void 0,(0,i.Z)(N.Eg,{},void 0,(0,i.Z)(v.Z,{className:"btn-primary btn-outline btn-block",disabled:S,onClick:function(){_.Z.open(m||{mode:"START",config:misago.get("THREAD_EDITOR_API"),submit:misago.get("THREADS_API"),category:a.id})}},void 0,de||(de=(0,i.Z)("span",{className:"material-icon"},void 0,"chat")),gettext("Start thread"))),!!k.allow&&(0,i.Z)(N.Eg,{shrink:!0},void 0,(0,i.Z)(he,{api:t,categories:s,categoriesMap:o,threads:h.filter((function(e){return-1!==b.indexOf(e.id)})),addThreads:f,freezeThread:Z,updateThread:g,deleteThread:y,selection:b,moderation:k,route:R,user:C,disabled:S}))))};var fe=function(e){(0,l.Z)(r,e);var t,n,a=(t=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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function r(){return(0,s.Z)(this,r),a.apply(this,arguments)}return(0,o.Z)(r,[{key:"render",value:function(){var e=this.props.root,t=this.props.route,n=t.category,a=t.categories,s=t.categoriesMap,o=me(e,n,s);return(0,i.Z)(b.Z,{},void 0,(0,i.Z)(ve,{api:this.props.api,baseUrl:n.url.index,category:n,categories:a,categoriesMap:s,topCategory:o,topCategories:a.filter((function(t){return t.parent===e.id})),subCategories:o?a.filter((function(e){return e.parent===o.id})):[],subCategory:2===n.level?n:null,subcategories:this.props.subcategories,list:this.props.route.list,lists:this.props.route.lists,threads:this.props.threads,addThreads:this.props.addThreads,startThread:this.props.startThread,freezeThread:this.props.freezeThread,deleteThread:this.props.deleteThread,updateThread:this.props.updateThread,selection:this.props.selection,moderation:this.props.moderation,route:this.props.route,user:this.props.user,disabled:!this.props.isLoaded||this.props.isBusy||this.props.busyThreads.length}),this.props.children)}}]),r}(h().Component),me=function(e,t,n){return t.parent?t.parent===e.id?t:n[t.parent]:null};function Ze(e){var t={allow:!1,can_approve:0,can_close:0,can_delete:0,can_hide:0,can_merge:0,can_move:0,can_pin:0,can_pin_globally:0,can_unhide:0};return e.forEach((function(e){e.is_unapproved&&e.acl.can_approve>t.can_approve&&(t.can_approve=e.acl.can_approve),e.acl.can_close>t.can_close&&(t.can_close=e.acl.can_close),e.acl.can_delete>t.can_delete&&(t.can_delete=e.acl.can_delete),e.acl.can_hide>t.can_hide&&(t.can_hide=e.acl.can_hide),e.acl.can_merge>t.can_merge&&(t.can_merge=e.acl.can_merge),e.acl.can_move>t.can_move&&(t.can_move=e.acl.can_move),e.acl.can_pin>t.can_pin&&(t.can_pin=e.acl.can_pin),e.acl.can_pin_globally>t.can_pin_globally&&(t.can_pin_globally=e.acl.can_pin_globally),e.is_hidden&&e.acl.can_unhide>t.can_unhide&&(t.can_unhide=e.acl.can_unhide),t.allow=t.can_approve||t.can_close||t.can_delete||t.can_hide||t.can_merge||t.can_move||t.can_pin||t.can_pin_globally||t.can_unhide})),t}var ge,ye,be,_e,Ne=function(e){var t=e.category,n=e.list,a=e.message;return"all"===n.type?a?(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,a),(0,i.Z)("p",{},void 0,gettext("Why not start one yourself?"))):(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,t.special_role?gettext("There are no threads on this forum... yet!"):gettext("There are no threads in this category.")),(0,i.Z)("p",{},void 0,gettext("Why not start one yourself?"))):(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("No threads matching specified criteria were found.")))},ke=n(50366),xe=n(16768),we=function(e){var t=e.thread;return(0,i.Z)("a",{href:t.url.last_post,className:"threads-list-item-last-activity",title:interpolate(gettext("Last activity: %(timestamp)s"),{timestamp:t.last_post_on.format("LLL")},!0)},void 0,t.last_post_on.fromNow(!0))},Re=function(e){var t="threads-list-item-category threads-list-category-label";return e.color&&(t+=" threads-list-category-label-color"),t},Ce=function(e){var t=e.parent,n=e.category;return(0,i.Z)("span",{},void 0,t&&(0,i.Z)("a",{href:t.url.index,className:Re(t)+" threads-list-item-parent-category",style:t.color?{"--label-color":t.color}:null,title:t.short_name?t.name:null},void 0,t.short_name||t.name),(0,i.Z)("a",{href:n.url.index,className:Re(n),style:n.color?{"--label-color":n.color}:null,title:n.short_name?n.name:null},void 0,n.short_name||n.name))},Se=function(e){var t=e.checked,n=e.disabled,a=e.thread;return(0,i.Z)("button",{className:"btn btn-default btn-icon",type:"button",disabled:n,onClick:function(){return H.Z.dispatch(j.wc(a.id))}},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,t?"check_box":"check_box_outline_blank"))},Ee=function(e){var t=e.thread,n="threads-list-icon";return t.is_read||(n+=" threads-list-icon-new"),(0,i.Z)("a",{title:t.is_read?gettext("No new posts"):gettext("New posts"),href:t.is_read?t.url.last_post:t.url.new_post,className:n},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,t.is_read?"chat_bubble_outline":"chat_bubble"))},Pe=n(19605),Le=function(e){var t=e.thread;return t.last_poster?(0,i.Z)("a",{href:t.url.last_poster,className:"threads-list-item-last-poster",title:interpolate(gettext("Last post by: %(poster)s"),{poster:t.last_poster.username},!0)},void 0,(0,i.Z)(Pe.ZP,{size:32,user:t.last_poster})):(0,i.Z)("span",{className:"threads-list-item-last-poster",title:interpolate(gettext("Last post by: %(poster)s"),{poster:t.last_poster_name},!0)},void 0,ge||(ge=(0,i.Z)(Pe.ZP,{size:32})))};var Te,Oe,Ae,Be,Ie,De,je,ze,Ue,Me,qe,He={unsubscribe:null,notify:!1,email:!0},Fe=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;return(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"update",(function(e){var n=t.props.thread;t.setState({loading:!0}),H.Z.dispatch((0,D.r$)(n,{subscription:He[e]})),U.Z.patch(n.api.index,[{op:"replace",path:"subscription",value:e}]).then((function(){}),(function(e){H.Z.dispatch((0,D.r$)(n,{subscription:He[n.subscription]})),q.Z.apiError(e)})).then((function(){return t.setState({loading:!1})}))})),(0,d.Z)((0,r.Z)(t),"render",(function(){var e=t.state.loading,n=t.props,a=n.disabled,s=n.thread;return(0,i.Z)("ul",{className:"dropdown-menu dropdown-menu-right"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||null===s.subscription,onClick:function(){return t.update("unsubscribe")}},void 0,ye||(ye=(0,i.Z)("span",{className:"material-icon"},void 0,"star_border")),gettext("Unsubscribe"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||!1===s.subscription,onClick:function(){return t.update("notify")}},void 0,be||(be=(0,i.Z)("span",{className:"material-icon"},void 0,"star_half")),gettext("Subscribe with alert"))),(0,i.Z)("li",{},void 0,(0,i.Z)("button",{className:"btn-link",disabled:a||e||!0===s.subscription,onClick:function(){return t.update("email")}},void 0,_e||(_e=(0,i.Z)("span",{className:"material-icon"},void 0,"star")),gettext("Subscribe with e-mail"))))})),t.state={loading:!1},t}return(0,o.Z)(p)}(h().Component),Ye=function(e){var t,n=e.disabled,a=e.thread;return(0,i.Z)("div",{className:"dropdown"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-icon",type:"button",title:(t=a.subscription,!0===t?gettext("Subscribed to e-mails"):!1===t?gettext("Subscribed to alerts"):gettext("Not subscribed")),disabled:n,"data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return!0===e?"star":!1===e?"star_half":"star_border"}(a.subscription))),(0,i.Z)(Fe,{disabled:n,thread:a}))},Ve=function(e){var t=e.activeCategory,n=e.categories,a=e.showOptions,s=e.showSubscription,o=e.thread,r=e.isBusy,l=e.isSelected,c=null,u=null;t.id!==o.category&&(u=n[o.category]).parent&&u.parent!==t.id&&n[u.parent]&&!n[u.parent].special_role&&(c=n[u.parent]);var d=o.is_closed||o.is_hidden||o.is_unapproved||o.weight>0||o.best_answer||o.has_poll||o.has_unapproved_posts,p=!!a&&o.is_new;return(0,i.Z)("li",{className:"list-group-item threads-list-item"+(r?" threads-list-item-is-busy":"")},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,a&&(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)(Ee,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("a",{href:o.url.index,className:"threads-list-item-title"},void 0,o.title),(0,i.Z)("a",{href:p?o.url.new_post:o.url.index,className:"threads-list-item-title-sm"+(p?" threads-list-item-title-new":"")},void 0,o.title)),a&&o.moderation.length>0&&(0,i.Z)("div",{className:"threads-list-item-col-checkbox-sm"},void 0,(0,i.Z)(Se,{checked:l,disabled:r,thread:o}))),(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,d&&(0,i.Z)("div",{className:"threads-list-item-col-flags"},void 0,(0,i.Z)(ke.Z,{thread:o})),!!u&&(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ce,{parent:c,category:u})),Te||(Te=(0,i.Z)("div",{className:"threads-list-item-col-spacer-xs"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(xe.Z,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)(Le,{thread:o})),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)(we,{thread:o})),a&&s&&(0,i.Z)("div",{className:"threads-list-item-col-subscription"},void 0,(0,i.Z)(Ye,{disabled:r,thread:o})),a&&o.moderation.length>0&&(0,i.Z)("div",{className:"threads-list-item-col-checkbox"},void 0,(0,i.Z)(Se,{checked:l,disabled:r,thread:o}))))},Ge=function(e){var t=e.width;return(0,i.Z)("span",{className:"ui-preview-text",style:{width:t+"px"}},void 0," ")},$e=function(e){var t=e.showOptions;return(0,i.Z)("div",{className:"threads-list threads-list-loader"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(Oe||(Oe=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),Ae||(Ae=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"90"})," ",(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"90"})," ",(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"}))))),Be||(Be=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"70"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"50"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"50"})))))),(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(Ie||(Ie=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),De||(De=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"30"})," ",(0,i.Z)(Ge,{width:"60"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"30"})," ",(0,i.Z)(Ge,{width:"60"}))))),je||(je=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"55"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"60"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"70"})))))),(0,i.Z)("li",{className:"list-group-item threads-list-item"},void 0,(0,i.Z)("div",{className:"threads-list-item-top-row"},void 0,t&&(ze||(ze=(0,i.Z)("div",{className:"threads-list-item-col-icon"},void 0,(0,i.Z)("span",{className:"threads-list-icon ui-preview-img"})))),Ue||(Ue=(0,i.Z)("div",{className:"threads-list-item-col-title"},void 0,(0,i.Z)("span",{className:"threads-list-item-title"},void 0,(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"80"})),(0,i.Z)("span",{className:"threads-list-item-title-sm"},void 0,(0,i.Z)(Ge,{width:"40"})," ",(0,i.Z)(Ge,{width:"120"})," ",(0,i.Z)(Ge,{width:"80"}))))),Me||(Me=(0,i.Z)("div",{className:"threads-list-item-bottom-row"},void 0,(0,i.Z)("div",{className:"threads-list-item-col-category"},void 0,(0,i.Z)(Ge,{width:"75"})),(0,i.Z)("div",{className:"threads-list-item-col-replies"},void 0,(0,i.Z)(Ge,{width:"40"})),(0,i.Z)("div",{className:"threads-list-item-col-last-poster"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-poster"},void 0,(0,i.Z)(Pe.ZP,{size:32}))),(0,i.Z)("div",{className:"threads-list-item-col-last-activity"},void 0,(0,i.Z)("span",{className:"threads-list-item-last-activity"},void 0,(0,i.Z)(Ge,{width:"60"}))))))))},We=function(e){var t=e.threads,n=e.onClick;return(0,i.Z)("li",{className:"list-group-item threads-list-update-prompt"},void 0,(0,i.Z)("button",{type:"button",className:"btn btn-block threads-list-update-prompt-btn",onClick:n},void 0,qe||(qe=(0,i.Z)("span",{className:"material-icon"},void 0,"cached")),(0,i.Z)("span",{className:"threads-list-update-prompt-message"},void 0,interpolate(ngettext("There is %(threads)s new or updated thread. Click here to show it.","There are %(threads)s new or updated threads. Click here to show them.",t),{threads:t},!0))))},Qe=function(e){var t=e.list,n=e.categories,a=e.category,s=e.threads,o=e.busyThreads,r=e.selection,l=e.isLoaded,c=e.showOptions,u=e.updatedThreads,d=e.applyUpdate,p=e.emptyMessage;return l?(0,i.Z)("div",{className:"threads-list"},void 0,s.length>0?(0,i.Z)("ul",{className:"list-group"},void 0,u>0&&(0,i.Z)(We,{threads:u,onClick:d}),s.map((function(e){return(0,i.Z)(Ve,{activeCategory:a,categories:n,thread:e,showOptions:c,showSubscription:c&&"subscribed"===t.type,isBusy:o.indexOf(e.id)>=0,isSelected:r.indexOf(e.id)>=0},e.id)}))):(0,i.Z)("ul",{className:"list-group"},void 0,u>0&&(0,i.Z)(We,{threads:u,onClick:d}),(0,i.Z)(Ne,{category:a,list:t,message:p}))):(0,i.Z)($e,{showOptions:c})},Ke=n(82125),Je=n(55547),Xe=n(53328),et=n(20370),tt=n(99755);var nt=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"loadMore",(function(){t.setState({isBusy:!0}),t.loadThreads(t.getCategory(),t.state.next)})),(0,d.Z)((0,r.Z)(t),"pollResponse",(function(e){var n,a,i;t.setState({diff:Object.assign({},e,{results:(n=t.props.threads,a=e.results,i={},n.forEach((function(e){i[e.id]=e})),a.filter((function(e){return!i[e.id]||function(e,t){return[e.title===t.title,e.weight===t.weight,e.category===t.category,e.last_post===t.last_post,e.last_poster_name===t.last_poster_name].indexOf(!1)>=0}(i[e.id],e)})))})})})),(0,d.Z)((0,r.Z)(t),"addThreads",(function(e){H.Z.dispatch((0,D.R3)(e,t.getSorting()))})),(0,d.Z)((0,r.Z)(t),"applyDiff",(function(){t.addThreads(t.state.diff.results),t.setState(Object.assign({},t.state.diff,{moderation:Ze(H.Z.getState().threads),diff:{results:[]}}))})),(0,d.Z)((0,r.Z)(t),"freezeThread",(function(e){t.setState((function(t){return{busyThreads:et.ZN(t.busyThreads,e)}}))})),(0,d.Z)((0,r.Z)(t),"updateThread",(function(e){H.Z.dispatch((0,D.r$)(e,e,t.getSorting()))})),(0,d.Z)((0,r.Z)(t),"deleteThread",(function(e){H.Z.dispatch((0,D.l8)(e))})),t.state={isMounted:!0,isLoaded:!1,isBusy:!1,diff:{results:[]},moderation:[],busyThreads:[],dropdown:!1,subcategories:[],next:0};var n=t.getCategory();return I.Z.has("THREADS")?t.initWithPreloadedData(n,I.Z.get("THREADS")):t.initWithoutPreloadedData(n),t}return(0,o.Z)(p,[{key:"getCategory",value:function(){return this.props.route.category.special_role?null:this.props.route.category.id}},{key:"initWithPreloadedData",value:function(e,t){this.state=Object.assign(this.state,{moderation:Ze(t.results),subcategories:t.subcategories,next:t.next}),this.startPolling(e)}},{key:"initWithoutPreloadedData",value:function(e){this.loadThreads(e)}},{key:"loadThreads",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;U.Z.get(this.props.options.api,{category:e,list:this.props.route.list.type,start:n||0},"threads").then((function(a){t.state.isMounted&&(0===n?H.Z.dispatch((0,D.ZB)(a.results)):H.Z.dispatch((0,D.R3)(a.results,t.getSorting())),t.setState({isLoaded:!0,isBusy:!1,moderation:Ze(H.Z.getState().threads),subcategories:a.subcategories,next:a.next}),t.startPolling(e))}),(function(e){q.Z.apiError(e)}))}},{key:"startPolling",value:function(e){Je.Z.start({poll:"threads",url:this.props.options.api,data:{category:e,list:this.props.route.list.type},frequency:12e4,update:this.pollResponse})}},{key:"componentDidMount",value:function(){this.setPageTitle(),I.Z.has("THREADS")&&(H.Z.dispatch((0,D.ZB)(I.Z.pop("THREADS").results)),this.setState({isLoaded:!0})),H.Z.dispatch(j.YP())}},{key:"componentWillUnmount",value:function(){this.state.isMounted=!1,Je.Z.stop("threads")}},{key:"getTitle",value:function(){return this.props.options.title?this.props.options.title:(e=this.props.route).category.level?e.category.name:I.Z.get("THREADS_ON_INDEX")?I.Z.get("SETTINGS").index_header?I.Z.get("SETTINGS").index_header:I.Z.get("SETTINGS").forum_name:gettext("Threads");var e}},{key:"setPageTitle",value:function(){var e;this.props.route.category.level||!I.Z.get("THREADS_ON_INDEX")?Xe.Z.set((e=this.props.route).category.level?e.list.path?{title:e.list.longName,parent:e.category.name}:{title:e.category.name}:I.Z.get("THREADS_ON_INDEX")?e.list.path?{title:e.list.longName}:null:e.list.path?{title:e.list.longName,parent:gettext("Threads")}:{title:gettext("Threads")}):this.props.options.title?Xe.Z.set(this.props.options.title):I.Z.get("SETTINGS").index_title?document.title=I.Z.get("SETTINGS").index_title:document.title=I.Z.get("SETTINGS").forum_name}},{key:"getSorting",value:function(){return this.props.route.category.level?Z:m}},{key:"getMoreButton",value:function(){return this.state.next?(0,i.Z)("div",{className:"pager-more"},void 0,(0,i.Z)(v.Z,{className:"btn btn-default btn-outline",loading:this.state.isBusy||this.state.busyThreads.length,onClick:this.loadMore},void 0,gettext("Show more"))):null}},{key:"getClassName",value:function(){var e,t="page page-threads";return t+=" page-threads-"+this.props.route.list.type,(e=this.props).route.category.level||!I.Z.get("THREADS_ON_INDEX")||e.options.title||(t+=" page-threads-index"),this.props.route.category.css_class&&(t+=" page-threads-"+this.props.route.category.css_class),t}},{key:"render",value:function(){var e=this.props.route.categories[0],t=this.props.route,n=t.category,a=t.list,s=n.special_role;return(0,i.Z)("div",{className:this.getClassName()},void 0,"root_category"==s&&I.Z.get("THREADS_ON_INDEX")&&I.Z.get("SETTINGS").index_header&&(0,i.Z)(tt.Iv,{header:I.Z.get("SETTINGS").index_header,message:n.description&&(0,i.Z)(tt.Ql,{message:n.description.html}),styleName:"forum-index"}),"root_category"==s&&!I.Z.get("THREADS_ON_INDEX")&&(0,i.Z)(tt.Iv,{header:gettext("Threads"),styleName:"threads"}),"private_threads"==s&&(0,i.Z)(tt.Iv,{header:this.props.options.title,message:this.props.options.pageLead&&(0,i.Z)(tt.bM,{},void 0,(0,i.Z)("p",{},void 0,this.props.options.pageLead)),styleName:"private-threads"}),!s&&(0,i.Z)(tt.Iv,{header:n.name,message:n.description&&(0,i.Z)(tt.Ql,{message:n.description.html}),styleName:n.css_class||"category-threads"}),(0,i.Z)(fe,{api:this.props.options.api,root:e,route:this.props.route,user:this.props.user,pageLead:this.props.options.pageLead,threads:this.props.threads,threadsCount:this.state.count,moderation:this.state.moderation,selection:this.props.selection,busyThreads:this.state.busyThreads,addThreads:this.addThreads,startThread:this.props.options.startThread,freezeThread:this.freezeThread,deleteThread:this.deleteThread,updateThread:this.updateThread,isLoaded:this.state.isLoaded,isBusy:this.state.isBusy},void 0,(0,i.Z)(Qe,{category:n,categories:this.props.route.categoriesMap,list:a,selection:this.props.selection,threads:this.props.threads,updatedThreads:this.state.diff.results.length,applyUpdate:this.applyDiff,showOptions:!!this.props.user.id,isLoaded:this.state.isLoaded,busyThreads:this.state.busyThreads,emptyMessage:this.props.options.emptyMessage}),this.getMoreButton()))}}]),p}(Ke.Z);var at=n(39633),it="misago:private-threads";function st(e){return e.get("CURRENT_LINK").substr(0,it.length)===it?{api:e.get("PRIVATE_THREADS_API"),startThread:{mode:"START_PRIVATE",submit:I.Z.get("PRIVATE_THREADS_API")},title:gettext("Private threads"),pageLead:gettext("Private threads are threads which only those that started them and those they have invited may see and participate in."),emptyMessage:gettext("You aren't participating in any private threads.")}:{api:e.get("THREADS_API")}}I.Z.addInitializer({name:"component:threads",initializer:function(e){var t,n,i,s,o;e.has("THREADS")&&e.has("CATEGORIES")&&(0,at.Z)({paths:(t=e.get("user"),n=st(e),i=function(e){var t=[{type:"all",path:"",name:gettext("All"),longName:gettext("All threads")}];return e.id&&(t.push({type:"my",path:"my/",name:gettext("My"),longName:gettext("My threads")}),t.push({type:"new",path:"new/",name:gettext("New"),longName:gettext("New threads")}),t.push({type:"unread",path:"unread/",name:gettext("Unread"),longName:gettext("Unread threads")}),t.push({type:"subscribed",path:"subscribed/",name:gettext("Subscribed"),longName:gettext("Subscribed threads")}),e.acl.can_see_unapproved_content_lists&&t.push({type:"unapproved",path:"unapproved/",name:gettext("Unapproved"),longName:gettext("Unapproved content")})),t}(t),s=[],o={},I.Z.get("CATEGORIES").forEach((function(e){i.forEach((function(t){var r;o[e.id]=e,s.push({path:e.url.index+t.path,component:(0,a.$j)((r=n,function(e){return{options:r,selection:e.selection,threads:e.threads,tick:e.tick.tick,user:e.auth.user}}))(nt),categories:I.Z.get("CATEGORIES"),categoriesMap:o,category:e,lists:i,list:t})}))})),s)})},after:"store"})},47806:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588),p=n.n(d),h=n(19605),v=n(97326),f=n(4942),m=n(78657),Z=n(53904);function g(e){return e.filter((function(e){return e.results.count>0})).map((function(e){return Object.assign({},e,{count:e.results.count,results:e.results.results.slice(0,5)})}))}var y=n(87462),b="HEADER",_="RESULT",N="FOOTER";function k(e){var t=e.value,n=e.onChange;return(0,s.Z)("input",{"aria-haspopup":"true","aria-expanded":"false","aria-controls":"dropdown-menu dropdown-search-results",autoComplete:"off",className:"form-control",value:t,onChange:n,placeholder:gettext("Search"),role:"combobox",type:"text"})}function x(e){var t=e.children,n=e.onChange,a=e.query;return(0,s.Z)("ul",{className:"dropdown-menu dropdown-search-results",role:"menu"},void 0,(0,s.Z)("li",{className:"form-group"},void 0,(0,s.Z)(k,{value:a,onChange:n})),t)}function w(){return(0,s.Z)("li",{className:"dropdown-search-message"},void 0,gettext("Search returned no results."))}var R,C=n(37848);function S(e){return e.message,R||(R=(0,s.Z)("li",{className:"dropdown-search-loader"},void 0,(0,s.Z)(C.Z,{})))}function E(e){var t=e.provider,n=e.query,a=t.url+"?q="+encodeURI(n),i=ngettext('See full "%(provider)s" results page with %(count)s result.','See full "%(provider)s" results page with %(count)s results.',t.count);return(0,s.Z)("li",{className:"dropdown-search-footer"},void 0,(0,s.Z)("a",{href:a},void 0,interpolate(i,{count:t.count,provider:t.name},!0)))}function P(e){var t=e.provider;return(0,s.Z)("li",{className:"dropdown-search-header"},void 0,t.name)}var L,T,O,A=n(30381),B=n.n(A),I=n(19755);function D(e){var t=e.result,n=(t.poster,t.thread),a=gettext("Posted by %(poster)s on %(posted_on)s in %(category)s.");return(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:t.url.index,className:"dropdown-search-thread"},void 0,(0,s.Z)("h5",{},void 0,n.title),(0,s.Z)("small",{className:"dropdown-search-post-content"},void 0,I(t.content).text()),(0,s.Z)("small",{className:"dropdown-search-post-footer"},void 0,interpolate(a,{category:t.category.name,posted_on:B()(t.posted_on).format("LL"),poster:t.poster_name},!0))))}function j(e){var t=e.result,n=t.rank,a=gettext("%(title)s, joined on %(joined_on)s"),i=t.title||n.title||n.name;return(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:t.url,className:"dropdown-search-user"},void 0,(0,s.Z)("div",{className:"media"},void 0,(0,s.Z)("div",{className:"media-left"},void 0,(0,s.Z)(h.ZP,{size:38,user:t})),(0,s.Z)("div",{className:"media-body"},void 0,(0,s.Z)("h5",{className:"media-heading"},void 0,t.username),(0,s.Z)("small",{},void 0,interpolate(a,{title:i,joined_on:B()(t.joined_on).format("LL")},!0))))))}function z(e){var t=e.provider,n=e.result;return"threads"===t.id?(0,s.Z)(D,{result:n}):(0,s.Z)(j,{result:n})}function U(e){var t=e.provider,n=e.result,a=e.type,i=e.query;return a===b?(0,s.Z)(P,{provider:t}):a===N?(0,s.Z)(E,{provider:t,query:i}):(0,s.Z)(z,{provider:t,result:n})}function M(e,t){for(var n=e.results.length,a=0;a<n;a++){var i=e.results[a];t.push({provider:e,result:i,type:_})}t.push({provider:e,type:N})}function q(e){var t=e.isLoading,n=e.onChange,a=e.results,i=e.query;if(!i.trim().length)return(0,s.Z)(x,{onChange:n,query:i});if(a.length){var o=function(e){var t=[];return function(e,t){for(var n=e.length,a=0;a<n;a++){var i=e[a];t.push({provider:i,type:b}),M(i,t)}}(e,t),t}(a);return(0,s.Z)(x,{onChange:n,query:i},void 0,o.map((function(e){var t=e.type,n=e.provider,a=e.result;return t===_?p().createElement(U,(0,y.Z)({key:[n.id,t,a.id].join("_")},e)):p().createElement(U,(0,y.Z)({key:[n.id,t].join("_"),query:i},e))})))}return t?(0,s.Z)(x,{onChange:n,query:i},void 0,L||(L=(0,s.Z)(S,{}))):(0,s.Z)(x,{onChange:n,query:i},void 0,T||(T=(0,s.Z)(w,{})))}var H=function(e){(0,l.Z)(d,e);var t,n,a=(t=d,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function d(){var e;return(0,o.Z)(this,d),e=a.call(this),(0,f.Z)((0,v.Z)(e),"onToggle",(function(t){e.setState((function(t,n){return t.isOpen||window.setTimeout((function(){e.container.querySelector("input").focus()}),100),{isOpen:!t.isOpen}}))})),(0,f.Z)((0,v.Z)(e),"onDocumentMouseDown",(function(t){for(var n=!0,a=t.target;null!==a&&a!==document;){if(a===e.container)return void(n=!1);a=a.parentNode}n&&e.setState({isOpen:!1})})),(0,f.Z)((0,v.Z)(e),"onEscape",(function(t){"Escape"===t.key&&e.setState({isOpen:!1})})),(0,f.Z)((0,v.Z)(e),"onChange",(function(t){var n=t.target.value;e.setState({query:n}),e.loadResults(n.trim())})),e.state={isLoading:!1,isOpen:!1,query:"",results:[]},e.intervalId=null,e}return(0,r.Z)(d,[{key:"componentDidMount",value:function(){document.addEventListener("mousedown",this.onDocumentMouseDown),document.addEventListener("keydown",this.onEscape)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("mousedown",this.onDocumentMouseDown),document.removeEventListener("keydown",this.onEscape)}},{key:"loadResults",value:function(e){var t=this;if(e.length){var n=300+300*Math.random();this.intervalId&&window.clearTimeout(this.intervalId),this.setState({isLoading:!0}),this.intervalId=window.setTimeout((function(){m.Z.get(i.Z.get("SEARCH_API"),{q:e}).then((function(e){t.setState({intervalId:null,isLoading:!1,results:g(e)})}),(function(e){Z.Z.apiError(e),t.setState({intervalId:null,isLoading:!1,results:[]})}))}),n)}}},{key:"render",value:function(){var e=this,t="navbar-search dropdown";return this.state.isOpen&&(t+=" open"),p().createElement("div",{className:t,ref:function(t){return e.container=t}},(0,s.Z)("a",{"aria-haspopup":"true","aria-expanded":"false",className:"navbar-icon","data-toggle":"dropdown",href:i.Z.get("SEARCH_URL"),onClick:this.onToggle},void 0,O||(O=(0,s.Z)("i",{className:"material-icon"},void 0,"search"))),(0,s.Z)(q,{isLoading:this.state.isLoading,onChange:this.onChange,results:this.state.results,query:this.state.query}))}}]),d}(p().Component),F=n(82211),Y=n(43345),V=n(96359),G=n(59940);var $,W,Q,K=["progress-bar-danger","progress-bar-warning","progress-bar-warning","progress-bar-primary","progress-bar-success"],J=[gettext("Entered password is very weak."),gettext("Entered password is weak."),gettext("Entered password is average."),gettext("Entered password is strong."),gettext("Entered password is very strong.")],X=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),(t=a.call(this,e))._score=0,t._password=null,t._inputs=[],t.state={loaded:!1},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){var e=this;G.Z.load().then((function(){e.setState({loaded:!0})}))}},{key:"getScore",value:function(e,t){var n=this,a=!1;return e!==this._password&&(a=!0),t.length!==this._inputs.length?a=!0:t.map((function(e,t){e.trim()!==n._inputs[t]&&(a=!0)})),a&&(this._score=G.Z.scorePassword(e,t),this._password=e,this._inputs=t.map((function(e){return e.trim()}))),this._score}},{key:"render",value:function(){if(!this.state.loaded)return null;var e=this.getScore(this.props.password,this.props.inputs);return(0,s.Z)("div",{className:"help-block password-strength"},void 0,(0,s.Z)("div",{className:"progress"},void 0,(0,s.Z)("div",{className:"progress-bar "+K[e],style:{width:20+20*e+"%"},role:"progress-bar","aria-valuenow":e,"aria-valuemin":"0","aria-valuemax":"4"},void 0,(0,s.Z)("span",{className:"sr-only"},void 0,J[e]))),(0,s.Z)("p",{className:"text-small"},void 0,J[e]))}}]),i}(p().Component),ee=n(26106),te=n(47235),ne=n(98274),ae=n(93825),ie=n(59801),se=n(93051),oe=n(55210);function re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function le(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?re(Object(n),!0).forEach((function(t){(0,f.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):re(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ce(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var ue,de=function(e){(0,l.Z)(n,e);var t=ce(n);function n(e){var a;(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"handlePrivacyPolicyChange",(function(e){var t=e.target.value;a.handleToggleAgreement("privacyPolicy",t)})),(0,f.Z)((0,v.Z)(a),"handleTermsOfServiceChange",(function(e){var t=e.target.value;a.handleToggleAgreement("termsOfService",t)})),(0,f.Z)((0,v.Z)(a),"handleToggleAgreement",(function(e,t){a.setState((function(n,i){if(null===n[e]){var s=le(le({},n.errors),{},(0,f.Z)({},e,null));return(0,f.Z)({errors:s},e,t)}var o=a.state.validators[e][0],r=le(le({},n.errors),{},(0,f.Z)({},e,[o(null)]));return(0,f.Z)({errors:r},e,null)}))}));var s=a.props.criteria,r=s.username,l=s.password,c=0;l.forEach((function(e){"MinimumLengthValidator"===e.name&&(c=e.min_length)}));var u={username:[oe.lG(),oe.HR(r.min_length),oe.gS(r.max_length)],email:[oe.Do()],password:[oe.Vb(c)],captcha:ae.ZP.validator()};return i.Z.get("TERMS_OF_SERVICE_ID")&&(u.termsOfService=[oe.fT()]),i.Z.get("PRIVACY_POLICY_ID")&&(u.privacyPolicy=[oe.jA()]),a.state={isLoading:!1,username:"",email:"",password:"",captcha:"",termsOfService:null,privacyPolicy:null,validators:u,errors:{}},a}return(0,r.Z)(n,[{key:"clean",value:function(){return!!this.isValid()||(Z.Z.error(gettext("Form contains errors.")),this.setState({errors:this.validate()}),!1)}},{key:"send",value:function(){return m.Z.post(i.Z.get("USERS_API"),{username:this.state.username,email:this.state.email,password:this.state.password,captcha:this.state.captcha,terms_of_service:this.state.termsOfService,privacy_policy:this.state.privacyPolicy})}},{key:"handleSuccess",value:function(e){this.props.callback(e)}},{key:"handleError",value:function(e){400===e.status?(this.setState({errors:Object.assign({},this.state.errors,e)}),e.__all__&&e.__all__.length>0?Z.Z.error(e.__all__[0]):Z.Z.error(gettext("Form contains errors."))):403===e.status&&e.ban?((0,se.Z)(e.ban),ie.Z.hide()):Z.Z.apiError(e)}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-dialog modal-register",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,$||($=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Register"))),(0,s.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,s.Z)("input",{type:"type",style:{display:"none"}}),(0,s.Z)("input",{type:"password",style:{display:"none"}}),(0,s.Z)("div",{className:"modal-body"},void 0,(0,s.Z)(te.Z,{buttonClassName:"col-xs-12 col-sm-6",buttonLabel:gettext("Join with %(site)s"),formLabel:gettext("Or create forum account:")}),(0,s.Z)(V.Z,{label:gettext("Username"),for:"id_username",validation:this.state.errors.username},void 0,(0,s.Z)("input",{type:"text",id:"id_username",className:"form-control","aria-describedby":"id_username_status",disabled:this.state.isLoading,onChange:this.bindInput("username"),value:this.state.username})),(0,s.Z)(V.Z,{label:gettext("E-mail"),for:"id_email",validation:this.state.errors.email},void 0,(0,s.Z)("input",{type:"text",id:"id_email",className:"form-control","aria-describedby":"id_email_status",disabled:this.state.isLoading,onChange:this.bindInput("email"),value:this.state.email})),(0,s.Z)(V.Z,{label:gettext("Password"),for:"id_password",validation:this.state.errors.password,extra:(0,s.Z)(X,{password:this.state.password,inputs:[this.state.username,this.state.email]})},void 0,(0,s.Z)("input",{type:"password",id:"id_password",className:"form-control","aria-describedby":"id_password_status",disabled:this.state.isLoading,onChange:this.bindInput("password"),value:this.state.password})),ae.ZP.component({form:this}),(0,s.Z)(ee.Z,{errors:this.state.errors,privacyPolicy:this.state.privacyPolicy,termsOfService:this.state.termsOfService,onPrivacyPolicyChange:this.handlePrivacyPolicyChange,onTermsOfServiceChange:this.handleTermsOfServiceChange})),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",disabled:this.state.isLoading,type:"button"},void 0,gettext("Cancel")),(0,s.Z)(F.Z,{className:"btn-primary",loading:this.state.isLoading},void 0,gettext("Register account"))))))}}]),n}(Y.Z),pe=function(e){(0,l.Z)(n,e);var t=ce(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"getLead",value:function(){return"user"===this.props.activation?gettext("%(username)s, your account has been created but you need to activate it before you will be able to sign in."):"admin"===this.props.activation?gettext("%(username)s, your account has been created but board administrator will have to activate it before you will be able to sign in."):void 0}},{key:"getSubscript",value:function(){return"user"===this.props.activation?gettext("We have sent an e-mail to %(email)s with link that you have to click to activate your account."):"admin"===this.props.activation?gettext("We will send an e-mail to %(email)s when this takes place."):void 0}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-dialog modal-message modal-register",role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,W||(W=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Registration complete"))),(0,s.Z)("div",{className:"modal-body"},void 0,Q||(Q=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,interpolate(this.getLead(),{username:this.props.username},!0)),(0,s.Z)("p",{},void 0,interpolate(this.getSubscript(),{email:this.props.email},!0)),(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))))}}]),n}(p().Component),he=function(e){(0,l.Z)(n,e);var t=ce(n);function n(e){var a;return(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"completeRegistration",(function(e){"active"===e.activation?(ie.Z.hide(),ne.Z.signIn(e)):a.setState({complete:e})})),a.state={complete:!1},a}return(0,r.Z)(n,[{key:"render",value:function(){return this.state.complete?(0,s.Z)(pe,{activation:this.state.complete.activation,email:this.state.complete.email,username:this.state.complete.username}):p().createElement(de,(0,y.Z)({callback:this.completeRegistration},this.props))}}]),n}(p().Component);var ve,fe,me,Ze=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"showRegisterForm",(function(){"closed"===misago.get("SETTINGS").account_activation?Z.Z.info(gettext("New registrations are currently disabled.")):t.state.isLoaded?ie.Z.show((0,s.Z)(he,{criteria:t.state.criteria})):(t.setState({isLoading:!0}),Promise.all([ae.ZP.load(),m.Z.get(misago.get("AUTH_CRITERIA_API"))]).then((function(e){t.setState({isLoading:!1,isLoaded:!0,criteria:e[1]}),ie.Z.show((0,s.Z)(he,{criteria:e[1]}))}),(function(){t.setState({isLoading:!1}),Z.Z.error(gettext("Registration is currently unavailable due to an error."))})))})),t.state={isLoading:!1,isLoaded:!1,criteria:null},t}return(0,r.Z)(i,[{key:"getClassName",value:function(){return this.props.className+(this.state.isLoading?" btn-loading":"")}},{key:"render",value:function(){return(0,s.Z)("button",{className:"btn "+this.getClassName(),disabled:this.state.isLoading,onClick:this.showRegisterForm,type:"button"},void 0,gettext("Register"),this.state.isLoading?ue||(ue=(0,s.Z)(C.Z,{})):null)}}]),i}(p().Component),ge=n(14467),ye=n(8621);function be(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var _e,Ne=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showSignInModal",value:function(){ie.Z.show(ge.Z)}},{key:"render",value:function(){var e=i.Z.get("SETTINGS").DELEGATE_AUTH;return(0,s.Z)("ul",{className:"dropdown-menu user-dropdown dropdown-menu-right",role:"menu"},void 0,(0,s.Z)("li",{className:"guest-preview"},void 0,(0,s.Z)("h4",{},void 0,gettext("You are browsing as guest.")),(0,s.Z)("p",{},void 0,gettext("Sign in or register to start and participate in discussions.")),e?(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-xs-12"},void 0,(0,s.Z)("a",{className:"btn btn-default btn-sign-in btn-block",href:i.Z.get("SETTINGS").LOGIN_URL},void 0,gettext("Sign in")))):(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-xs-6"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-sign-in btn-block",onClick:this.showSignInModal,type:"button"},void 0,gettext("Sign in"))),(0,s.Z)("div",{className:"col-xs-6"},void 0,(0,s.Z)(Ze,{className:"btn-primary btn-register btn-block"},void 0,gettext("Register"))))))}}]),n}(p().Component),ke=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return i.Z.get("SETTINGS").DELEGATE_AUTH?(0,s.Z)("div",{className:"nav nav-guest"},void 0,(0,s.Z)("a",{className:"btn navbar-btn btn-default btn-sign-in",href:i.Z.get("SETTINGS").LOGIN_URL},void 0,gettext("Sign in")),ve||(ve=(0,s.Z)("div",{className:"navbar-left"},void 0,(0,s.Z)(H,{})))):(0,s.Z)("div",{className:"nav nav-guest"},void 0,(0,s.Z)("button",{className:"btn navbar-btn btn-default btn-sign-in",onClick:this.showSignInModal,type:"button"},void 0,gettext("Sign in")),(0,s.Z)(Ze,{className:"navbar-btn btn-primary btn-register"},void 0,gettext("Register")),fe||(fe=(0,s.Z)("div",{className:"navbar-left"},void 0,(0,s.Z)(H,{}))))}}]),n}(Ne),xe=function(e){(0,l.Z)(n,e);var t=be(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showGuestMenu",value:function(){ye.Z.show(Ne)}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",onClick:this.showGuestMenu},void 0,me||(me=(0,s.Z)(h.ZP,{size:"64"})))}}]),n}(p().Component);var we,Re=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"setGravatar",(function(){t.callApi("gravatar")})),(0,f.Z)((0,v.Z)(t),"setGenerated",(function(){t.callApi("generated")})),t.state={isLoading:!1},t}return(0,r.Z)(i,[{key:"callApi",value:function(e){var t=this;if(this.state.isLoading)return!1;this.setState({isLoading:!0}),m.Z.post(this.props.user.api.avatar,{avatar:e}).then((function(e){t.setState({isLoading:!1}),Z.Z.success(e.detail),t.props.onComplete(e)}),(function(e){400===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))}},{key:"getGravatarButton",value:function(){return this.props.options.gravatar?(0,s.Z)(F.Z,{onClick:this.setGravatar,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-gravatar"},void 0,gettext("Download my Gravatar")):null}},{key:"getCropButton",value:function(){return this.props.options.crop_src?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-crop",disabled:this.state.isLoading,onClick:this.props.showCrop},void 0,gettext("Re-crop uploaded image")):null}},{key:"getUploadButton",value:function(){return this.props.options.upload?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-upload",disabled:this.state.isLoading,onClick:this.props.showUpload},void 0,gettext("Upload new image")):null}},{key:"getGalleryButton",value:function(){return this.props.options.galleries?(0,s.Z)(F.Z,{className:"btn-default btn-block btn-avatar-gallery",disabled:this.state.isLoading,onClick:this.props.showGallery},void 0,gettext("Pick avatar from gallery")):null}},{key:"getAvatarPreview",value:function(){var e={id:this.props.user.id,avatars:this.props.options.avatars};return this.state.isLoading?(0,s.Z)("div",{className:"avatar-preview preview-loading"},void 0,(0,s.Z)(h.ZP,{size:"200",user:e}),_e||(_e=(0,s.Z)(C.Z,{}))):(0,s.Z)("div",{className:"avatar-preview"},void 0,(0,s.Z)(h.ZP,{size:"200",user:e}))}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-index"},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-5"},void 0,this.getAvatarPreview()),(0,s.Z)("div",{className:"col-md-7"},void 0,this.getGravatarButton(),(0,s.Z)(F.Z,{onClick:this.setGenerated,disabled:this.state.isLoading,className:"btn-default btn-block btn-avatar-generate"},void 0,gettext("Generate my individual avatar")),this.getCropButton(),this.getUploadButton(),this.getGalleryButton())))}}]),i}(p().Component),Ce=n(19755);var Se,Ee=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"cropAvatar",(function(){if(t.state.isLoading)return!1;t.setState({isLoading:!0});var e=t.props.upload?"crop_tmp":"crop_src",n=Ce(".crop-form"),a=n.cropit("exportZoom"),i=n.cropit("offset");m.Z.post(t.props.user.api.avatar,{avatar:e,crop:{offset:{x:i.x*a,y:i.y*a},zoom:n.cropit("zoom")*a}}).then((function(e){t.props.onComplete(e),Z.Z.success(e.detail)}),(function(e){400===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1})):t.props.showError(e)}))})),t.state={isLoading:!1,deviceRatio:1},t}return(0,r.Z)(i,[{key:"getAvatarSize",value:function(){return this.props.upload?this.props.options.crop_tmp.size:this.props.options.crop_src.size}},{key:"getImagePath",value:function(){return this.props.upload?this.props.dataUrl:this.props.options.crop_src.url}},{key:"componentDidMount",value:function(){for(var e=this,t=Ce(".crop-form"),n=this.getAvatarSize(),a=t.width();a<n;)n/=2;var i=this.getAvatarSize()/n;t.width(n),t.cropit({width:n,height:n,exportZoom:i,imageState:{src:this.getImagePath()},onImageLoaded:function(){if(e.props.upload){var n=t.cropit("zoom"),a=t.cropit("imageSize");if(a.width>a.height){var i=(a.width*n-e.getAvatarSize())/-2;t.cropit("offset",{x:i,y:0})}else if(a.width<a.height){var s=(a.height*n-e.getAvatarSize())/-2;t.cropit("offset",{x:0,y:s})}else t.cropit("offset",{x:0,y:0})}else{var o=e.props.options.crop_src.crop;o&&(t.cropit("zoom",o.zoom),t.cropit("offset",{x:o.x,y:o.y}))}}})}},{key:"componentWillUnmount",value:function(){Ce(".crop-form").cropit("disable")}},{key:"render",value:function(){return(0,s.Z)("div",{},void 0,we||(we=(0,s.Z)("div",{className:"modal-body modal-avatar-crop"},void 0,(0,s.Z)("div",{className:"crop-form"},void 0,(0,s.Z)("div",{className:"cropit-preview"}),(0,s.Z)("input",{type:"range",className:"cropit-image-zoom-input"})))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.cropAvatar,loading:this.state.isLoading,className:"btn-primary btn-block"},void 0,this.props.upload?gettext("Set avatar"):gettext("Crop image")),(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,gettext("Cancel")))))}}]),i}(p().Component),Pe=n(48772);var Le,Te=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,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(e){return!1}}(),function(){var e,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(e){var t;return(0,o.Z)(this,i),t=a.call(this,e),(0,f.Z)((0,v.Z)(t),"pickFile",(function(){document.getElementById("avatar-hidden-upload").click()})),(0,f.Z)((0,v.Z)(t),"uploadFile",(function(){var e=document.getElementById("avatar-hidden-upload").files[0];if(e){var n=t.validateFile(e);if(n)Z.Z.error(n);else{t.setState({image:e,preview:URL.createObjectURL(e),progress:0});var a=new FormData;a.append("avatar","upload"),a.append("image",e),m.Z.upload(t.props.user.api.avatar,a,(function(e){t.setState({progress:e})})).then((function(e){t.setState({options:e,uploaded:e.detail}),Z.Z.info(gettext("Your image has been uploaded and you may now crop it."))}),(function(e){400===e.status||413===e.status?(Z.Z.error(e.detail),t.setState({isLoading:!1,image:null,progress:0})):t.props.showError(e)}))}}})),t.state={image:null,preview:null,progress:0,uploaded:null,dataUrl:null},t}return(0,r.Z)(i,[{key:"validateFile",value:function(e){if(e.size>this.props.options.upload.limit)return interpolate(gettext("Selected file is too big. (%(filesize)s)"),{filesize:(0,Pe.Z)(e.size)},!0);var t=gettext("Selected file type is not supported.");if(-1===this.props.options.upload.allowed_mime_types.indexOf(e.type))return t;var n=!1,a=e.name.toLowerCase();return this.props.options.upload.allowed_extensions.map((function(e){a.substr(-1*e.length)===e&&(n=!0)})),!n&&t}},{key:"getUploadRequirements",value:function(e){var t=e.allowed_extensions.map((function(e){return e.substr(1)}));return interpolate(gettext("%(files)s files smaller than %(limit)s"),{files:t.join(", "),limit:(0,Pe.Z)(e.limit)},!0)}},{key:"getUploadButton",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,s.Z)(F.Z,{className:"btn-pick-file",onClick:this.pickFile},void 0,Se||(Se=(0,s.Z)("div",{className:"material-icon"},void 0,"input")),gettext("Select file")),(0,s.Z)("p",{className:"text-muted"},void 0,this.getUploadRequirements(this.props.options.upload)))}},{key:"getUploadProgressLabel",value:function(){return interpolate(gettext("%(progress)s % complete"),{progress:this.state.progress},!0)}},{key:"getUploadProgress",value:function(){return(0,s.Z)("div",{className:"modal-body modal-avatar-upload"},void 0,(0,s.Z)("div",{className:"upload-progress"},void 0,(0,s.Z)("img",{src:this.state.preview}),(0,s.Z)("div",{className:"progress"},void 0,(0,s.Z)("div",{className:"progress-bar",role:"progressbar","aria-valuenow":"{this.state.progress}","aria-valuemin":"0","aria-valuemax":"100",style:{width:this.state.progress+"%"}},void 0,(0,s.Z)("span",{className:"sr-only"},void 0,this.getUploadProgressLabel())))))}},{key:"renderUpload",value:function(){return(0,s.Z)("div",{},void 0,(0,s.Z)("input",{type:"file",id:"avatar-hidden-upload",className:"hidden-file-upload",onChange:this.uploadFile}),this.state.image?this.getUploadProgress():this.getUploadButton(),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:!!this.state.image,className:"btn-default btn-block"},void 0,gettext("Cancel")))))}},{key:"renderCrop",value:function(){return(0,s.Z)(Ee,{options:this.state.options,user:this.props.user,upload:this.state.uploaded,dataUrl:this.state.preview,onComplete:this.props.onComplete,showError:this.props.showError,showIndex:this.props.showIndex})}},{key:"render",value:function(){return this.state.uploaded?this.renderCrop():this.renderUpload()}}]),i}(p().Component),Oe=n(69130);function Ae(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var Be,Ie,De,je=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(){var e;(0,o.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,f.Z)((0,v.Z)(e),"select",(function(){e.props.select(e.props.id)})),e}return(0,r.Z)(n,[{key:"getClassName",value:function(){return this.props.selection===this.props.id?this.props.disabled?"btn btn-avatar btn-disabled avatar-selected":"btn btn-avatar avatar-selected":this.props.disabled?"btn btn-avatar btn-disabled":"btn btn-avatar"}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",className:this.getClassName(),disabled:this.props.disabled,onClick:this.select},void 0,(0,s.Z)("img",{src:this.props.url}))}}]),n}(p().Component),ze=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{className:"avatars-gallery"},void 0,(0,s.Z)("h3",{},void 0,this.props.name),(0,s.Z)("div",{className:"avatars-gallery-images"},void 0,(0,Oe.Z)(this.props.images,4,null).map((function(t,n){return(0,s.Z)("div",{className:"row"},n,t.map((function(t,n){return(0,s.Z)("div",{className:"col-xs-3"},n,t?p().createElement(je,(0,y.Z)({disabled:e.props.disabled,select:e.props.select,selection:e.props.selection},t)):Le||(Le=(0,s.Z)("div",{className:"blank-avatar"})))})))}))))}}]),n}(p().Component),Ue=function(e){(0,l.Z)(n,e);var t=Ae(n);function n(e){var a;return(0,o.Z)(this,n),a=t.call(this,e),(0,f.Z)((0,v.Z)(a),"select",(function(e){a.setState({selection:e})})),(0,f.Z)((0,v.Z)(a),"save",(function(){if(a.state.isLoading)return!1;a.setState({isLoading:!0}),m.Z.post(a.props.user.api.avatar,{avatar:"galleries",image:a.state.selection}).then((function(e){a.setState({isLoading:!1}),Z.Z.success(e.detail),a.props.onComplete(e),a.props.showIndex()}),(function(e){400===e.status?(Z.Z.error(e.detail),a.setState({isLoading:!1})):a.props.showError(e)}))})),a.state={selection:null,isLoading:!1},a}return(0,r.Z)(n,[{key:"render",value:function(){var e=this;return(0,s.Z)("div",{},void 0,(0,s.Z)("div",{className:"modal-body modal-avatar-gallery"},void 0,this.props.options.galleries.map((function(t,n){return(0,s.Z)(ze,{name:t.name,images:t.images,selection:e.state.selection,disabled:e.state.isLoading,select:e.select},n)}))),(0,s.Z)("div",{className:"modal-footer"},void 0,(0,s.Z)("div",{className:"row"},void 0,(0,s.Z)("div",{className:"col-md-6 col-md-offset-3"},void 0,(0,s.Z)(F.Z,{onClick:this.save,loading:this.state.isLoading,disabled:!this.state.selection,className:"btn-primary btn-block"},void 0,this.state.selection?gettext("Save choice"):gettext("Select avatar")),(0,s.Z)(F.Z,{onClick:this.props.showIndex,disabled:this.state.isLoading,className:"btn-default btn-block"},void 0,gettext("Cancel"))))))}}]),n}(p().Component),Me=n(3784),qe=n(6935),He=n(90287);function Fe(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var Ye,Ve,Ge,$e,We,Qe,Ke,Je,Xe,et,tt,nt,at=function(e){(0,l.Z)(n,e);var t=Fe(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"getErrorReason",value:function(){return this.props.reason?(0,s.Z)("p",{dangerouslySetInnerHTML:{__html:this.props.reason}}):null}},{key:"render",value:function(){return(0,s.Z)("div",{className:"modal-body"},void 0,Be||(Be=(0,s.Z)("div",{className:"message-icon"},void 0,(0,s.Z)("span",{className:"material-icon"},void 0,"remove_circle_outline"))),(0,s.Z)("div",{className:"message-body"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.props.message),this.getErrorReason(),(0,s.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}}]),n}(p().Component),it=function(e){(0,l.Z)(n,e);var t=Fe(n);function n(){var e;(0,o.Z)(this,n);for(var a=arguments.length,i=new Array(a),s=0;s<a;s++)i[s]=arguments[s];return e=t.call.apply(t,[this].concat(i)),(0,f.Z)((0,v.Z)(e),"showError",(function(t){e.setState({error:t})})),(0,f.Z)((0,v.Z)(e),"showIndex",(function(){e.setState({component:Re})})),(0,f.Z)((0,v.Z)(e),"showUpload",(function(){e.setState({component:Te})})),(0,f.Z)((0,v.Z)(e),"showCrop",(function(){e.setState({component:Ee})})),(0,f.Z)((0,v.Z)(e),"showGallery",(function(){e.setState({component:Ue})})),(0,f.Z)((0,v.Z)(e),"completeFlow",(function(t){He.Z.dispatch((0,qe.n1)(e.props.user,t.avatars)),e.setState({component:Re,options:t})})),e}return(0,r.Z)(n,[{key:"componentDidMount",value:function(){var e=this;m.Z.get(this.props.user.api.avatar).then((function(t){e.setState({component:Re,options:t,error:null})}),(function(t){e.showError(t)}))}},{key:"getBody",value:function(){return this.state?this.state.error?(0,s.Z)(at,{message:this.state.error.detail,reason:this.state.error.reason}):(0,s.Z)(this.state.component,{options:this.state.options,user:this.props.user,onComplete:this.completeFlow,showError:this.showError,showIndex:this.showIndex,showCrop:this.showCrop,showUpload:this.showUpload,showGallery:this.showGallery}):Ie||(Ie=(0,s.Z)(Me.Z,{}))}},{key:"getClassName",value:function(){return this.state&&this.state.error?"modal-dialog modal-message modal-change-avatar":"modal-dialog modal-change-avatar"}},{key:"render",value:function(){return(0,s.Z)("div",{className:this.getClassName(),role:"document"},void 0,(0,s.Z)("div",{className:"modal-content"},void 0,(0,s.Z)("div",{className:"modal-header"},void 0,(0,s.Z)("button",{type:"button",className:"close","data-dismiss":"modal","aria-label":pgettext("modal","Close")},void 0,De||(De=(0,s.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,s.Z)("h4",{className:"modal-title"},void 0,gettext("Change your avatar"))),this.getBody()))}}]),n}(p().Component);function st(e){return{user:e.auth.user}}function ot(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var rt=function(e){(0,l.Z)(n,e);var t=ot(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"changeAvatar",value:function(){ie.Z.show((0,a.$j)(st)(it))}},{key:"render",value:function(){var e=this.props.user;return(0,s.Z)("ul",{className:"dropdown-menu user-dropdown dropdown-menu-right",role:"menu"},void 0,(0,s.Z)("li",{className:"dropdown-header"},void 0,(0,s.Z)("strong",{},void 0,e.username),(0,s.Z)("div",{className:"row user-stats"},void 0,(0,s.Z)("div",{className:"col-sm-3"},void 0,Ye||(Ye=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),e.posts),(0,s.Z)("div",{className:"col-sm-3"},void 0,Ve||(Ve=(0,s.Z)("span",{className:"material-icon"},void 0,"forum")),e.threads),(0,s.Z)("div",{className:"col-sm-3"},void 0,Ge||(Ge=(0,s.Z)("span",{className:"material-icon"},void 0,"favorite")),e.followers),(0,s.Z)("div",{className:"col-sm-3"},void 0,$e||($e=(0,s.Z)("span",{className:"material-icon"},void 0,"favorite_outline")),e.following))),We||(We=(0,s.Z)("li",{className:"divider"})),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:e.url},void 0,Qe||(Qe=(0,s.Z)("span",{className:"material-icon"},void 0,"account_circle")),gettext("See your profile"))),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:i.Z.get("USERCP_URL")},void 0,Ke||(Ke=(0,s.Z)("span",{className:"material-icon"},void 0,"done_all")),gettext("Change options"))),(0,s.Z)("li",{},void 0,(0,s.Z)("button",{className:"btn-link",onClick:this.changeAvatar,type:"button"},void 0,Je||(Je=(0,s.Z)("span",{className:"material-icon"},void 0,"portrait")),gettext("Change avatar"))),!!e.acl.can_use_private_threads&&(0,s.Z)("li",{},void 0,(0,s.Z)("a",{href:i.Z.get("PRIVATE_THREADS_URL")},void 0,Xe||(Xe=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),gettext("Private threads"),(0,s.Z)(lt,{user:e}))),et||(et=(0,s.Z)("li",{className:"divider"})),(0,s.Z)("li",{className:"dropdown-buttons"},void 0,(0,s.Z)("button",{className:"btn btn-default btn-block",onClick:function(){return document.getElementById("hidden-logout-form").submit()},type:"button"},void 0,gettext("Log out"))))}}]),n}(p().Component);function lt(e){var t=e.user;return t.unread_private_threads?(0,s.Z)("span",{className:"badge"},void 0,t.unread_private_threads):null}function ct(e){var t=e.user;return(0,s.Z)("ul",{className:"ul nav navbar-nav nav-user"},void 0,tt||(tt=(0,s.Z)("li",{},void 0,(0,s.Z)(H,{}))),(0,s.Z)(ut,{user:t}),(0,s.Z)("li",{className:"dropdown"},void 0,(0,s.Z)("a",{"aria-haspopup":"true","aria-expanded":"false",className:"dropdown-toggle","data-toggle":"dropdown",href:t.url,role:"button"},void 0,(0,s.Z)(h.ZP,{user:t,size:"64"})),(0,s.Z)(rt,{user:t})))}function ut(e){var t=e.user;if(!t.acl.can_use_private_threads)return null;var n;return n=t.unread_private_threads?gettext("You have unread private threads!"):gettext("Private threads"),(0,s.Z)("li",{},void 0,(0,s.Z)("a",{className:"navbar-icon",href:i.Z.get("PRIVATE_THREADS_URL"),title:n},void 0,nt||(nt=(0,s.Z)("span",{className:"material-icon"},void 0,"message")),t.unread_private_threads>0&&(0,s.Z)("span",{className:"badge"},void 0,t.unread_private_threads)))}function dt(e){return{user:e.auth.user}}var pt,ht,vt=function(e){(0,l.Z)(n,e);var t=ot(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"showUserMenu",value:function(){ye.Z.showConnected("user-menu",(0,a.$j)(dt)(rt))}},{key:"render",value:function(){return(0,s.Z)("button",{type:"button",onClick:this.showUserMenu},void 0,(0,s.Z)(h.ZP,{user:this.props.user,size:"50"}))}}]),n}(p().Component);function ft(e){var t=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(e){return!1}}();return function(){var n,a=(0,u.Z)(e);if(t){var i=(0,u.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,c.Z)(this,n)}}var mt=function(e){(0,l.Z)(n,e);var t=ft(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return this.props.isAuthenticated?(0,s.Z)(ct,{user:this.props.user}):pt||(pt=(0,s.Z)(ke,{}))}}]),n}(p().Component),Zt=function(e){(0,l.Z)(n,e);var t=ft(n);function n(){return(0,o.Z)(this,n),t.apply(this,arguments)}return(0,r.Z)(n,[{key:"render",value:function(){return this.props.isAuthenticated?(0,s.Z)(vt,{user:this.props.user}):ht||(ht=(0,s.Z)(xe,{}))}}]),n}(p().Component);function gt(e){return e.auth}var yt=n(4869);i.Z.addInitializer({name:"component:user-menu",initializer:function(){(0,yt.Z)((0,a.$j)(gt)(mt),"user-menu-mount"),(0,yt.Z)((0,a.$j)(gt)(Zt),"user-menu-compact-mount")},after:"store"})},77031:function(e,t,n){"use strict";var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37424),h=n(97326),v=n(4942),f=n(59131),m=n(69987),Z=n(94417),g=function(e,t){var n=e;return"rank"===t.component?n+=t.slug:n+=t.component,n+"/"},y=function(e){var t=e.baseUrl,n=e.page,s=e.pages;return(0,i.Z)("div",{className:"nav-container"},void 0,(0,i.Z)("div",{className:"dropdown hidden-sm hidden-md hidden-lg"},void 0,(0,i.Z)("button",{className:"btn btn-default btn-block btn-outline dropdown-toggle",type:"button","data-toggle":"dropdown","aria-haspopup":"true","aria-expanded":"false"},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"menu")),n.name),(0,i.Z)("ul",{className:"dropdown-menu stick-to-bottom"},void 0,s.map((function(e){var n=g(t,e);return(0,i.Z)("li",{},n,(0,i.Z)(m.rU,{to:n},void 0,e.name))})))),(0,i.Z)("ul",{className:"nav nav-pills hidden-xs",role:"menu"},void 0,s.map((function(e){var n=g(t,e);return(0,i.Z)(Z.Z,{path:n},n,(0,i.Z)(m.rU,{to:n},void 0,e.name))}))))};var b,_,N=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getEmptyMessage",value:function(){return interpolate(gettext("No users have posted any new messages during last %(days)s days."),{days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getEmptyMessage())))}}]),u}(d().Component),k=n(19605),x=n(44039);var w=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,b||(b=(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(k.ZP,{size:"50"})))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("span",{className:"item-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,80)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-details"},void 0,(0,i.Z)("span",{className:"user-status"},void 0,_||(_=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:x.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"rank-name"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,50)+"px"}},void 0," ")),(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(30,50)+"px"}},void 0," "))),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(20,30)+"px"}},void 0," ")),(0,i.Z)("small",{},void 0,gettext("Total posts"))))}}]),u}(d().Component);var R,C=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead ui-preview"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:x.e(50,220)+"px"}},void 0," ")),(0,i.Z)("div",{className:"active-posters ui-preview"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,i.Z)(w,{hiddenOnMobile:e>0},e)}))))))}}]),u}(d().Component),S=n(24678),E=n(32233);var P=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getClassName",value:function(){return this.props.rank.css_class?"list-group-item list-group-rank-"+this.props.rank.css_class:"list-group-item"}},{key:"getUserStatus",value:function(){return this.props.user.status?(0,i.Z)(S.ZP,{user:this.props.user,status:this.props.user.status},void 0,(0,i.Z)(S.Jj,{user:this.props.user,status:this.props.user.status}),(0,i.Z)(S.pg,{user:this.props.user,status:this.props.user.status,className:"status-label hidden-xs hidden-sm"})):(0,i.Z)("span",{className:"user-status"},void 0,R||(R=(0,i.Z)("span",{className:"status-icon ui-preview-text"},void 0," ")),(0,i.Z)("span",{className:"status-label ui-preview-text hidden-xs hidden-sm",style:{width:x.e(30,50)+"px"}},void 0," "))}},{key:"getRankName",value:function(){if(!this.props.rank.is_tab)return(0,i.Z)("span",{className:"rank-name item-title"},void 0,this.props.rank.name);var e=E.Z.get("USERS_LIST_URL")+this.props.rank.slug+"/";return(0,i.Z)(m.rU,{to:e,className:"rank-name item-title"},void 0,this.props.rank.name)}},{key:"getUserTitle",value:function(){return this.props.user.title?(0,i.Z)("span",{className:"user-title hidden-xs hidden-sm"},void 0,this.props.user.title):null}},{key:"render",value:function(){return(0,i.Z)("li",{className:this.getClassName()},void 0,(0,i.Z)("div",{className:"rank-user-avatar"},void 0,(0,i.Z)("a",{href:this.props.user.url},void 0,(0,i.Z)(k.ZP,{user:this.props.user,size:50,size2x:64}))),(0,i.Z)("div",{className:"rank-user"},void 0,(0,i.Z)("div",{className:"user-name"},void 0,(0,i.Z)("a",{href:this.props.user.url,className:"item-title"},void 0,this.props.user.username)),(0,i.Z)("div",{className:"user-details"},void 0,this.getUserStatus(),this.getRankName(),this.getUserTitle()),(0,i.Z)("div",{className:"user-compact-stats visible-xs-block"},void 0,(0,i.Z)("span",{className:"rank-position"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("span",{className:"rank-posts-counted"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))))),(0,i.Z)("div",{className:"rank-position hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,"#",this.props.counter),(0,i.Z)("small",{},void 0,gettext("Rank"))),(0,i.Z)("div",{className:"rank-posts-counted hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.meta.score),(0,i.Z)("small",{},void 0,gettext("Ranked posts"))),(0,i.Z)("div",{className:"rank-posts-total hidden-xs"},void 0,(0,i.Z)("strong",{},void 0,this.props.user.posts),(0,i.Z)("small",{},void 0,gettext("Total posts"))))}}]),u}(d().Component);var L=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getLeadMessage",value:function(){var e=ngettext("%(posters)s top poster from last %(days)s days.","%(posters)s top posters from last %(days)s days.",this.props.count);return interpolate(e,{posters:this.props.count,days:this.props.trackedPeriod},!0)}},{key:"render",value:function(){return(0,i.Z)("div",{className:"active-posters-list"},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:misago.get("USERS_LIST_URL"),page:this.props.page,pages:misago.get("USERS_LISTS")}),(0,i.Z)("p",{className:"lead"},void 0,this.getLeadMessage()),(0,i.Z)("div",{className:"active-posters ui-ready"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,this.props.users.map((function(e,t){return(0,i.Z)(P,{user:e,rank:e.rank,counter:t+1},e.id)}))))))}}]),u}(d().Component),T=n(6935),O=n(55547),A=n(90287),B=n(53328);var I=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,s.Z)(this,u),t=a.call(this,e),(0,v.Z)((0,h.Z)(t),"update",(function(e){A.Z.dispatch((0,T.ZB)(e.results)),t.setState({isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count})})),E.Z.has("USERS")?t.initWithPreloadedData(E.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(),t}return(0,o.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state={isLoaded:!0,trackedPeriod:e.tracked_period,count:e.count},A.Z.dispatch((0,T.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(){O.Z.start({poll:"active-posters",url:E.Z.get("USERS_API"),data:{list:"active"},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){B.Z.set({title:this.props.route.extra.name,parent:gettext("Users")})}},{key:"componentWillUnmount",value:function(){O.Z.stop("active-posters")}},{key:"render",value:function(){var e={name:this.props.route.extra.name};return this.state.isLoaded?this.state.count>0?(0,i.Z)(L,{page:e,users:this.props.users,trackedPeriod:this.state.trackedPeriod,count:this.state.count}):(0,i.Z)(N,{page:e,trackedPeriod:this.state.trackedPeriod}):(0,i.Z)(C,{page:e})}}]),u}(d().Component);var D,j=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"getClassName",value:function(){return this.props.copy&&this.props.copy.length&&1===function(e,t){if(e=(e+"").toLowerCase(),(t=(t+"").toLowerCase()).length<=0)return 0;for(var n=0,a=0,i=t.length;(a=e.indexOf(t,a))>=0;)n+=1,a+=i;return n}(this.props.copy,"<p")&&-1===this.props.copy.indexOf("<br")?"page-lead lead":"page-lead"}},{key:"render",value:function(){return this.props.copy&&this.props.copy.length?(0,i.Z)("div",{className:this.getClassName(),dangerouslySetInnerHTML:{__html:this.props.copy}}):null}}]),u}(d().Component),z=n(40429),U=function(e){var t=e.users;return(0,i.Z)(z.Z,{cols:4,isReady:!0,showStatus:!0,users:t})};var M,q,H,F,Y,V,G,$,W,Q=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){var e;(0,s.Z)(this,u);for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return e=a.call.apply(a,[this].concat(n)),(0,v.Z)((0,h.Z)(e),"render",(function(){return D||(D=(0,i.Z)(z.Z,{cols:4,isReady:!1}))})),e}return(0,o.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}}]),u}(d().Component),K=Q,J=n(92490),X=function(e){var t=e.users;return t.more?(0,i.Z)("p",{},void 0,interpolate(ngettext("There is %(more)s more member with this role.","There are %(more)s more members with this role.",t.more),{more:t.more},!0)):(0,i.Z)("p",{},void 0,gettext("There are no more members with this role."))},ee=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)("div",{className:"misago-pagination"},void 0,n.isLoaded&&n.first?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t,title:gettext("Go to first page")},void 0,M||(M=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to first page"),type:"button",disabled:!0},void 0,q||(q=(0,i.Z)("span",{className:"material-icon"},void 0,"first_page"))),n.isLoaded&&n.previous?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+(n.previous>1?n.previous+"/":""),title:gettext("Go to previous page")},void 0,H||(H=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to previous page"),type:"button",disabled:!0},void 0,F||(F=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_left"))),n.isLoaded&&n.next?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.next+"/",title:gettext("Go to next page")},void 0,Y||(Y=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to next page"),type:"button",disabled:!0},void 0,V||(V=(0,i.Z)("span",{className:"material-icon"},void 0,"chevron_right"))),n.isLoaded&&n.last?(0,i.Z)(m.rU,{className:"btn btn-default btn-outline btn-icon",to:t+n.last+"/",title:gettext("Go to last page")},void 0,G||(G=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))):(0,i.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:gettext("Go to last page"),type:"button",disabled:!0},void 0,$||($=(0,i.Z)("span",{className:"material-icon"},void 0,"last_page"))))},te=function(e){var t=e.baseUrl,n=e.users;return(0,i.Z)(J.o8,{},void 0,(0,i.Z)(J.Z2,{},void 0,(0,i.Z)(J.Eg,{},void 0,(0,i.Z)(ee,{baseUrl:t,users:n}))),(0,i.Z)(J.Z2,{auto:!0},void 0,(0,i.Z)(J.Eg,{},void 0,(0,i.Z)(X,{users:n}))))};var ne=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(e){var t;return(0,s.Z)(this,u),t=a.call(this,e),(0,v.Z)((0,h.Z)(t),"update",(function(e){A.Z.dispatch((0,T.ZB)(e.results)),e.isLoaded=!0,t.setState(e)})),E.Z.has("USERS")?t.initWithPreloadedData(E.Z.pop("USERS")):t.initWithoutPreloadedData(),t.startPolling(e.params.page||1),t}return(0,o.Z)(u,[{key:"initWithPreloadedData",value:function(e){this.state=Object.assign(e,{isLoaded:!0}),A.Z.dispatch((0,T.ZB)(e.results))}},{key:"initWithoutPreloadedData",value:function(){this.state={isLoaded:!1}}},{key:"startPolling",value:function(e){O.Z.start({poll:"rank-users",url:E.Z.get("USERS_API"),data:{rank:this.props.route.rank.id,page:e},frequency:9e4,update:this.update})}},{key:"componentDidMount",value:function(){B.Z.set({title:this.props.route.rank.name,page:this.props.params.page||null,parent:gettext("Users")})}},{key:"componentWillUnmount",value:function(){O.Z.stop("rank-users")}},{key:"componentWillReceiveProps",value:function(e){this.props.params.page!==e.params.page&&(B.Z.set({title:this.props.route.rank.name,page:e.params.page||null,parent:gettext("Users")}),this.setState({isLoaded:!1}),O.Z.stop("rank-users"),this.startPolling(e.params.page))}},{key:"getClassName",value:function(){return this.props.route.rank.css_class?"rank-users-list rank-users-"+this.props.route.rank.css_class:"rank-users-list"}},{key:"getRankDescription",value:function(){return this.props.route.rank.description?(0,i.Z)("div",{className:"rank-description"},void 0,(0,i.Z)(j,{copy:this.props.route.rank.description.html})):null}},{key:"getComponent",value:function(){return this.state.isLoaded?this.state.count>0?(0,i.Z)(U,{users:this.props.users}):(0,i.Z)("p",{className:"lead"},void 0,gettext("There are no users with this rank at the moment.")):W||(W=(0,i.Z)(K,{}))}},{key:"render",value:function(){return(0,i.Z)("div",{className:this.getClassName()},void 0,(0,i.Z)(f.Z,{},void 0,(0,i.Z)(y,{baseUrl:E.Z.get("USERS_LIST_URL"),page:{name:this.props.route.rank.name},pages:E.Z.get("USERS_LISTS")}),this.getRankDescription(),this.getComponent(),(0,i.Z)(te,{baseUrl:E.Z.get("USERS_LIST_URL")+this.props.route.rank.slug+"/",users:this.state})))}}]),u}(d().Component),ae=n(82125),ie=n(99755);var se=function(e){(0,r.Z)(u,e);var t,n,a=(t=u,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(e){return!1}}(),function(){var e,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function u(){return(0,s.Z)(this,u),a.apply(this,arguments)}return(0,o.Z)(u,[{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-users-lists"},void 0,(0,i.Z)(ie.sP,{},void 0,(0,i.Z)(ie.mr,{styleName:"users-lists"},void 0,(0,i.Z)(ie.gC,{styleName:"users-lists"},void 0,(0,i.Z)("h1",{},void 0,gettext("Users"))))),this.props.children)}}]),u}(ae.Z);function oe(e){return{tick:e.tick.tick,user:e.auth.user,users:e.users}}function re(){var e=[];return E.Z.get("USERS_LISTS").forEach((function(t){"rank"===t.component?(e.push({path:E.Z.get("USERS_LIST_URL")+t.slug+"/:page/",component:(0,p.$j)(oe)(ne),rank:t}),e.push({path:E.Z.get("USERS_LIST_URL")+t.slug+"/",component:(0,p.$j)(oe)(ne),rank:t})):"active-posters"===t.component&&e.push({path:E.Z.get("USERS_LIST_URL")+t.component+"/",component:(0,p.$j)(oe)(I),extra:{name:t.name}})})),e}var le=n(39633);E.Z.addInitializer({name:"component:users",initializer:function(e){e.has("USERS_LISTS")&&(0,le.Z)({root:E.Z.get("USERS_LIST_URL"),component:se,paths:re()})},after:"store"})},97751:function(e,t,n){"use strict";var a=n(32233),i=n(96142);a.Z.addInitializer({name:"include",initializer:function(e){i.Z.init(e.get("STATIC_URL"))}})},76093:function(e,t,n){"use strict";var a=n(32233),i=n(62833);a.Z.addInitializer({name:"local-storage",initializer:function(){i.Z.init("misago_")}})},19764:function(e,t,n){"use strict";var a=n(32233),i=n(8621);a.Z.addInitializer({name:"dropdown",initializer:function(){var e=document.getElementById("mobile-navbar-dropdown-mount");e&&i.Z.init(e)},before:"store"})},47549:function(e,t,n){"use strict";var a=n(32233),i=n(59801);a.Z.addInitializer({name:"modal",initializer:function(){var e=document.getElementById("modal-mount");e&&i.Z.init(e)},before:"store"})},22331:function(e,t,n){"use strict";var a=n(30381),i=n.n(a),s=n(32233),o=n(19755);s.Z.addInitializer({name:"moment",initializer:function(){i().locale(o("html").attr("lang"))}})},21513:function(e,t,n){"use strict";var a=n(32233),i=n(53328);a.Z.addInitializer({name:"page-title",initializer:function(e){i.Z.init(e.get("SETTINGS").forum_index_title,e.get("SETTINGS").forum_name)}})},98749:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(53904),o=n(55547);a.Z.addInitializer({name:"polls",initializer:function(){o.Z.init(i.Z,s.Z)}})},98251:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(64646),o=n(53904);a.Z.addInitializer({name:"posting",initializer:function(){s.Z.init(i.Z,o.Z,document.getElementById("posting-mount"))}})},6720:function(e,t,n){"use strict";var a=n(32233),i=n(35486),s=n(90287);a.Z.addInitializer({name:"reducer:auth",initializer:function(e){s.Z.addReducer("auth",i.ZP,Object.assign({isAuthenticated:e.get("isAuthenticated"),isAnonymous:!e.get("isAuthenticated"),user:e.get("user")},i.E3))},before:"store"})},10846:function(e,t,n){"use strict";var a=n(32233),i=n(8154),s=n(90287);a.Z.addInitializer({name:"reducer:participants",initializer:function(){var e=null;a.Z.has("THREAD")&&(e=a.Z.get("THREAD").participants),s.Z.addReducer("participants",i.ZP,e||[])},before:"store"})},18255:function(e,t,n){"use strict";var a=n(32233),i=n(59752),s=n(90287);a.Z.addInitializer({name:"reducer:poll",initializer:function(){var e;e=a.Z.has("THREAD")&&a.Z.get("THREAD").poll?(0,i.ZB)(a.Z.get("THREAD").poll):{},s.Z.addReducer("poll",i.ZP,e)},before:"store"})},14113:function(e,t,n){"use strict";var a=n(32233),i=n(21981),s=n(90287);a.Z.addInitializer({name:"reducer:posts",initializer:function(){var e;e=a.Z.has("POSTS")?(0,i.ZB)(a.Z.get("POSTS")):{isLoaded:!1,isBusy:!1},s.Z.addReducer("posts",i.ZP,e)},before:"store"})},24444:function(e,t,n){"use strict";var a=n(32233),i=n(58598),s=n(90287);a.Z.addInitializer({name:"reducer:profile-details",initializer:function(){var e=null;a.Z.has("PROFILE_DETAILS")&&(e=a.Z.get("PROFILE_DETAILS")),s.Z.addReducer("profile-details",i.ZP,e||{})},before:"store"})},1764:function(e,t,n){"use strict";var a=n(32233),i=n(27519),s=n(90287);a.Z.addInitializer({name:"reducer:profile-hydrate",initializer:function(){a.Z.has("PROFILE")&&s.Z.dispatch((0,i.ZB)(a.Z.get("PROFILE")))},after:"store"})},68351:function(e,t,n){"use strict";var a=n(32233),i=n(27519),s=n(90287);a.Z.addInitializer({name:"reducer:profile",initializer:function(){s.Z.addReducer("profile",i.ZP,{})},before:"store"})},81521:function(e,t,n){"use strict";var a=n(32233),i=n(16427),s=n(90287);a.Z.addInitializer({name:"reducer:search",initializer:function(){s.Z.addReducer("search",i.ZP,Object.assign({},i.E3,{providers:a.Z.get("SEARCH_PROVIDERS")||[],query:a.Z.get("SEARCH_QUERY")||""}))},before:"store"})},19984:function(e,t,n){"use strict";var a=n(32233),i=n(77751),s=n(90287);a.Z.addInitializer({name:"reducer:selection",initializer:function(){s.Z.addReducer("selection",i.ZP,[])},before:"store"})},41229:function(e,t,n){"use strict";var a=n(32233),i=n(27346),s=n(90287);a.Z.addInitializer({name:"reducer:snackbar",initializer:function(){s.Z.addReducer("snackbar",i.ZP,i.E3)},before:"store"})},43589:function(e,t,n){"use strict";var a=n(32233),i=n(7738),s=n(90287);a.Z.addInitializer({name:"reducer:thread",initializer:function(){var e;e=a.Z.has("THREAD")?(0,i.ZB)(a.Z.get("THREAD")):{isBusy:!1},s.Z.addReducer("thread",i.ZP,e)},before:"store"})},24108:function(e,t,n){"use strict";var a=n(32233),i=n(61340),s=n(90287);a.Z.addInitializer({name:"reducer:threads",initializer:function(){s.Z.addReducer("threads",i.ZP,[])},before:"store"})},33934:function(e,t,n){"use strict";var a=n(32233),i=n(85586),s=n(90287);a.Z.addInitializer({name:"reducer:tick",initializer:function(){s.Z.addReducer("tick",i.ZP,i.E3)},before:"store"})},85577:function(e,t,n){"use strict";var a=n(32233),i=n(48927),s=n(90287);a.Z.addInitializer({name:"reducer:username-history",initializer:function(){s.Z.addReducer("username-history",i.ZP,[])},before:"store"})},83526:function(e,t,n){"use strict";var a=n(32233),i=n(6935),s=n(90287);a.Z.addInitializer({name:"reducer:users",initializer:function(){s.Z.addReducer("users",i.ZP,[])},before:"store"})},43060:function(e,t,n){"use strict";var a=n(32233),i=n(53904),s=n(90287);a.Z.addInitializer({name:"snackbar",initializer:function(){i.Z.init(s.Z)},after:"store"})},92292:function(e,t,n){"use strict";var a=n(32233),i=n(90287);a.Z.addInitializer({name:"store",initializer:function(){i.Z.init()},before:"_end"})},33409:function(e,t,n){"use strict";var a=n(32233),i=n(85586),s=n(90287);a.Z.addInitializer({name:"tick-start",initializer:function(){window.setInterval((function(){s.Z.dispatch((0,i.bq)())}),5e4)},after:"store"})},31341:function(e,t,n){"use strict";var a=n(32233),i=n(96142),s=n(59940);a.Z.addInitializer({name:"zxcvbn",initializer:function(){s.Z.init(i.Z)}})},35486:function(e,t,n){"use strict";n.d(t,{E3:function(){return i},ZP:function(){return d},r$:function(){return l},w7:function(){return u},zB:function(){return c}});var a=n(6935),i={signedIn:!1,signedOut:!1},s="PATCH_USER",o="SIGN_IN",r="SIGN_OUT";function l(e){return{type:s,patch:e}}function c(e){return{type:o,user:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return{type:r,soft:e}}function d(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:var n=Object.assign({},e);return n.user=Object.assign({},e.user,t.patch),n;case o:return Object.assign({},e,{signedIn:t.user});case r:return Object.assign({},e,{isAuthenticated:!1,isAnonymous:!0,signedOut:!t.soft});case a.oB:if(e.isAuthenticated&&e.user.id===t.userId){var l=Object.assign({},e);return l.user=Object.assign({},e.user,{avatars:t.avatars}),l}return e;case a.D9:if(e.isAuthenticated&&e.user.id===t.userId){var c=Object.assign({},e);return c.user=Object.assign({},e.user,{username:t.username,slug:t.slug}),c}return e;default:return e}}},8154:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s},gx:function(){return i}});var a="REPLACE_PARTICIPANTS";function i(e){return{type:a,state:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.state:e}},59752:function(e,t,n){"use strict";n.d(t,{Ar:function(){return p},Od:function(){return v},ZB:function(){return u},ZH:function(){return r},ZP:function(){return f},b9:function(){return l},gx:function(){return h},n6:function(){return d}});var a=n(30381),i=n.n(a),s="BUSY_POLL",o="RELEASE_POLL",r="REMOVE_POLL",l="REPLACE_POLL",c="UPDATE_POLL";function u(e){var t=!1;for(var n in e.choices)if(e.choices[n].selected){t=!0;break}return Object.assign({},e,{posted_on:i()(e.posted_on),hasSelectedChoices:t,endsOn:e.length?i()(e.posted_on).add(e.length,"days"):null,isBusy:!1})}function d(){return{type:s}}function p(){return{type:o}}function h(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:u(e)}}function v(){return{type:r}}function f(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:return Object.assign({},e,{isBusy:!0});case o:return Object.assign({},e,{isBusy:!1});case r:return{isBusy:!1};case l:return t.state;case c:return Object.assign({},e,t.data);default:return e}}},92747:function(e,t,n){"use strict";n.d(t,{Qu:function(){return o},ZB:function(){return r},ZP:function(){return u},r$:function(){return c}});var a=n(30381),i=n.n(a),s=n(6935),o="PATCH_POST";function r(e){return Object.assign({},e,{posted_on:i()(e.posted_on),updated_on:i()(e.updated_on),hidden_on:i()(e.hidden_on),attachments:e.attachments?e.attachments.map(l):null,poster:e.poster?(0,s.Ru)(e.poster):null,isSelected:!1,isBusy:!1,isDeleted:!1})}function l(e){return Object.assign({},e,{uploaded_on:i()(e.uploaded_on)})}function c(e,t){return{type:o,post:e,patch:t}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===o&&e.id==t.post.id?Object.assign({},e,t.patch):e}},21981:function(e,t,n){"use strict";n.d(t,{R3:function(){return m},Rz:function(){return Z},Vx:function(){return g},Ys:function(){return d},ZB:function(){return v},ZP:function(){return y},_H:function(){return p},kR:function(){return h},zD:function(){return f}});var a=n(92747),i="APPEND_POSTS",s="SELECT_POST",o="DESELECT_POST",r="DESELECT_POSTS",l="LOAD_POSTS",c="UNLOAD_POSTS",u="UPDATE_POSTS";function d(e){return{type:s,post:e}}function p(e){return{type:o,post:e}}function h(){return{type:r}}function v(e){return Object.assign({},e,{results:e.results.map(a.ZB),isLoaded:!0,isBusy:!1,isSelected:!1})}function f(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:v(e)}}function m(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:i,state:t?e:v(e)}}function Z(){return{type:c}}function g(e){return{type:u,update:e}}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case s:var n=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!0}):e}));return Object.assign({},e,{results:n});case o:var d=e.results.map((function(e){return e.id==t.post.id?Object.assign({},e,{isSelected:!1}):e}));return Object.assign({},e,{results:d});case r:var p=e.results.map((function(e){return Object.assign({},e,{isSelected:!1})}));return Object.assign({},e,{results:p});case i:var h=e.results.slice(),v=e.results.map((function(e){return e.id}));return t.state.results.map((function(e){-1===v.indexOf(e.id)&&h.push(e)})),Object.assign({},t.state,{results:h});case l:return t.state;case c:return Object.assign({},e,{isLoaded:!1});case u:return Object.assign({},e,t.update);case a.Qu:var f=e.results.map((function(e){return(0,a.ZP)(e,t)}));return Object.assign({},e,{results:f});default:return e}}},58598:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s},zD:function(){return i}});var a="LOAD_DETAILS";function i(e){return{type:a,newState:e}}function s(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===a?t.newState:e}},27519:function(e,t,n){"use strict";n.d(t,{ZB:function(){return l},ZP:function(){return u},r$:function(){return c}});var a=n(30381),i=n.n(a),s=n(6935),o="HYDRATE_PROFILE",r="PATCH_PROFILE";function l(e){return{type:o,profile:e}}function c(e){return{type:r,patch:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return Object.assign({},t.profile,{joined_on:i()(t.profile.joined_on),status:(0,s.$q)(t.profile.status)});case r:return Object.assign({},e,t.patch);case s.oB:return e.id===t.userId?Object.assign({},e,{avatars:t.avatars}):e;case s.D9:return e.id===t.userId?Object.assign({},e,{username:t.username,slug:t.slug}):e;default:return e}}},16427:function(e,t,n){"use strict";n.d(t,{E3:function(){return o},P0:function(){return l},Vx:function(){return r},ZP:function(){return c}});var a="REPLACE_SEARCH",i="UPDATE_SEARCH",s="UPDATE_SEARCH_PROVIDER",o={isLoading:!1,query:"",providers:[]};function r(e){return{type:i,update:e}}function l(e){return{type:s,provider:e}}function c(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case a:return t.state;case i:return Object.assign({},e,t.update);case s:return Object.assign({},e,{providers:e.providers.map((function(e){return e.id===t.provider.id?t.provider:e}))});default:return e}}},77751:function(e,t,n){"use strict";n.d(t,{$6:function(){return r},YP:function(){return l},ZP:function(){return u},wc:function(){return c}});var a=n(20370),i="SELECT_ALL",s="SELECT_NONE",o="SELECT_ITEM";function r(e){return{type:i,items:e}}function l(){return{type:s}}function c(e){return{type:o,item:e}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case i:return t.items;case s:return[];case o:return(0,a.ZN)(e,t.item);default:return e}}},27346:function(e,t,n){"use strict";n.d(t,{E3:function(){return a},OV:function(){return o},ZP:function(){return l},p2:function(){return r}});var a={type:"info",message:"",isVisible:!1},i="SHOW_SNACKBAR",s="HIDE_SNACKBAR";function o(e,t){return{type:i,message:e,messageType:t}}function r(){return{type:s}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?{type:t.messageType,message:t.message,isVisible:!0}:t.type===s?Object.assign({},e,{isVisible:!1}):e}},7738:function(e,t,n){"use strict";n.d(t,{Ar:function(){return h},Vx:function(){return f},ZB:function(){return d},ZP:function(){return Z},gx:function(){return v},n6:function(){return p},y8:function(){return m}});var a=n(30381),i=n.n(a),s=n(59752),o="BUSY_THREAD",r="RELEASE_THREAD",l="REPLACE_THREAD",c="UPDATE_THREAD",u="UPDATE_THREAD_ACL";function d(e){return Object.assign({},e,{started_on:i()(e.started_on),last_post_on:i()(e.last_post_on),best_answer_marked_on:e.best_answer_marked_on?i()(e.best_answer_marked_on):null,isBusy:!1})}function p(){return{type:o}}function h(){return{type:r}}function v(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return{type:l,state:t?e:d(e)}}function f(e){return{type:c,data:e}}function m(e){return{type:u,data:e}}function Z(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return Object.assign({},e,{isBusy:!0});case r:return Object.assign({},e,{isBusy:!1});case s.ZH:return Object.assign({},e,{poll:null});case s.b9:return Object.assign({},e,{poll:t.state});case l:return t.state;case c:return Object.assign({},e,t.data);case u:var n=Object.assign({},e.acl,t.data);return Object.assign({},e,{acl:n});default:return e}}},61340:function(e,t,n){"use strict";n.d(t,{R3:function(){return h},V8:function(){return f},ZB:function(){return m},ZP:function(){return y},l8:function(){return v},r$:function(){return Z}});var a=n(30381),i=n.n(a),s=n(89759),o="APPEND_THREADS",r="DELETE_THREAD",l="FILTER_THREADS",c="HYDRATE_THREADS",u="PATCH_THREAD",d="SORT_THREADS",p=["can_announce","can_approve","can_close","can_hide","can_move","can_merge","can_pin","can_review"];function h(e,t){return{type:o,items:e,sorting:t}}function v(e){return{type:r,thread:e}}function f(e,t){return{type:l,category:e,categoriesMap:t}}function m(e){return{type:c,items:e}}function Z(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return{type:u,thread:e,patch:t,sorting:n}}function g(e){return Object.assign({},e,{started_on:i()(e.started_on),last_post_on:i()(e.last_post_on),moderation:(t=e.acl,n=[],p.forEach((function(e){t[e]&&n.push(e)})),n)});var t,n}function y(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:var n=(0,s.Z)(t.items.map(g),e);return n.sort(t.sorting);case r:return e.filter((function(e){return e.id!==t.thread.id}));case l:return e.filter((function(e){var n=t.categoriesMap[e.category];return n.lft>=t.category.lft&&n.rght<=t.category.rght||2==e.weight}));case c:return t.items.map(g);case u:var a=e.map((function(e){return e.id===t.thread.id?Object.assign({},e,t.patch):e}));return t.sorting?a.sort(t.sorting):a;case d:return e.sort(t.sorting);default:return e}}},85586:function(e,t,n){"use strict";n.d(t,{E3:function(){return a},ZP:function(){return o},bq:function(){return s}});var a={tick:0},i="TICK";function s(){return{type:i}}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:a,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t.type===i?Object.assign({},e,{tick:e.tick+1}):e}},48927:function(e,t,n){"use strict";n.d(t,{KP:function(){return u},R3:function(){return d},ZB:function(){return p},ZP:function(){return v}});var a=n(30381),i=n.n(a),s=n(6935),o=n(89759),r="ADD_NAME_CHANGE",l="APPEND_HISTORY",c="HYDRATE_HISTORY";function u(e,t,n){return{type:r,change:e,user:t,changedBy:n}}function d(e){return{type:l,items:e}}function p(e){return{type:c,items:e}}function h(e){return Object.assign({},e,{changed_on:i()(e.changed_on)})}function v(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case r:var n=e.slice();return n.unshift({id:Math.floor(Date.now()/1e3),changed_by:t.changedBy,changed_by_username:t.changedBy.username,changed_on:i()(),new_username:t.change.username,old_username:t.user.username}),n;case l:return(0,o.Z)(e,t.items.map(h));case c:return t.items.map(h);case s.oB:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{avatars:t.avatars})),e}));case s.D9:return e.map((function(e){return(e=Object.assign({},e)).changed_by&&e.changed_by.id===t.userId&&(e.changed_by=Object.assign({},e.changed_by,{username:t.username,slug:t.slug})),Object.assign({},e)}));default:return e}}},6935:function(e,t,n){"use strict";n.d(t,{$q:function(){return p},D9:function(){return c},R3:function(){return u},Ru:function(){return h},ZB:function(){return d},ZP:function(){return m},_S:function(){return f},n1:function(){return v},oB:function(){return l}});var a=n(30381),i=n.n(a),s=n(89759),o="APPEND_USERS",r="HYDRATE_USERS",l="UPDATE_AVATAR",c="UPDATE_USERNAME";function u(e){return{type:o,items:e}}function d(e){return{type:r,items:e}}function p(e){return e?Object.assign({},e,{last_click:e.last_click?i()(e.last_click):null,banned_until:e.banned_until?i()(e.banned_until):null}):null}function h(e){return Object.assign({},e,{joined_on:i()(e.joined_on),status:p(e.status)})}function v(e,t){return{type:l,userId:e.id,avatars:t}}function f(e,t,n){return{type:c,userId:e.id,username:t,slug:n}}function m(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;switch(t.type){case o:return(0,s.Z)(e,t.items.map(h));case r:return t.items.map(h);case l:return e.map((function(e){return(e=Object.assign({},e)).id===t.userId&&(e.avatars=t.avatars),e}));default:return e}}},78657:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(19755),o=function(){function e(){(0,a.Z)(this,e),this._cookieName=null,this._csrfToken=null,this._locks={}}return(0,i.Z)(e,[{key:"init",value:function(e){this._cookieName=e}},{key:"getCsrfToken",value:function(){if(-1!==document.cookie.indexOf(this._cookieName)){var e=new RegExp(this._cookieName+"=([^;]*)"),t=document.cookie.match(e)[0];return t?t.split("=")[1]:null}return null}},{key:"request",value:function(e,t,n){var a=this;return new Promise((function(i,o){var r={url:t,method:e,headers:{"X-CSRFToken":a.getCsrfToken()},data:n?JSON.stringify(n):null,contentType:"application/json; charset=utf-8",dataType:"json",success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=gettext("Lost connection with application.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=gettext("Action link is invalid."))),500!==t.status||t.detail||(t.detail=gettext("Unknown error has occured.")),t.statusText=e.statusText,o(t)}};s.ajax(r)}))}},{key:"get",value:function(e,t,n){if(t&&(e+="?"+s.param(t)),n){var a=this;return this._locks[n]&&(this._locks[n].url=e),this._locks[n]&&this._locks[n].waiter?{then:function(){}}:this._locks[n]&&this._locks[n].wait?(this._locks[n].waiter=!0,new Promise((function(t,i){var s=function e(s){a._locks[n].wait?window.setTimeout((function(){e(s)}),300):a._locks[n].url!==s?e(a._locks[n].url):(a._locks[n].waiter=!1,a.request("GET",a._locks[n].url).then((function(i){a._locks[n].url===s?t(i):(a._locks[n].waiter=!0,e(a._locks[n].url))}),(function(t){a._locks[n].url===s?i(t):(a._locks[n].waiter=!0,e(a._locks[n].url))})))};window.setTimeout((function(){s(e)}),300)}))):(this._locks[n]={url:e,wait:!0,waiter:!1},new Promise((function(t,i){a.request("GET",e).then((function(i){a._locks[n].wait=!1,a._locks[n].url===e&&t(i)}),(function(t){a._locks[n].wait=!1,a._locks[n].url===e&&i(t)}))})))}return this.request("GET",e)}},{key:"post",value:function(e,t){return this.request("POST",e,t)}},{key:"patch",value:function(e,t){return this.request("PATCH",e,t)}},{key:"put",value:function(e,t){return this.request("PUT",e,t)}},{key:"delete",value:function(e,t){return this.request("DELETE",e,t)}},{key:"upload",value:function(e,t,n){var a=this;return new Promise((function(i,o){var r={url:e,method:"POST",headers:{"X-CSRFToken":a.getCsrfToken()},data:t,contentType:!1,processData:!1,xhr:function(){var e=new window.XMLHttpRequest;return e.upload.addEventListener("progress",(function(e){e.lengthComputable&&n(Math.round(e.loaded/e.total*100))}),!1),e},success:function(e){i(e)},error:function(e){var t=e.responseJSON||{};t.status=e.status,0===t.status&&(t.detail=gettext("Lost connection with application.")),413!==t.status||t.detail||(t.detail=gettext("Upload was rejected by server as too large.")),404===t.status&&(t.detail&&"NOT FOUND"!==t.detail||(t.detail=gettext("Action link is invalid."))),500!==t.status||t.detail||(t.detail=gettext("Unknown error has occured.")),t.statusText=e.statusText,o(t)}};s.ajax(r)}))}}]),e}();t.Z=new o},98274:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(35486),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){this._store=e,this._local=t,this._modal=n,this.syncSession(),this.watchState()}},{key:"syncSession",value:function(){var e=this._store.getState().auth;e.isAuthenticated?this._local.set("auth",{isAuthenticated:!0,username:e.user.username}):this._local.set("auth",{isAuthenticated:!1})}},{key:"watchState",value:function(){var e=this,t=this._store.getState().auth;this._local.watch("auth",(function(n){n.isAuthenticated?e._store.dispatch((0,s.zB)({username:n.username})):t.isAuthenticated&&e._store.dispatch((0,s.w7)())})),this._modal.hide()}},{key:"signIn",value:function(e){this._store.dispatch((0,s.zB)(e)),this._local.set("auth",{isAuthenticated:!0,username:e.username}),this._modal.hide()}},{key:"signOut",value:function(){this._store.dispatch((0,s.w7)()),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}},{key:"softSignOut",value:function(){this._store.dispatch((0,s.w7)(!0)),this._local.set("auth",{isAuthenticated:!1}),this._modal.hide()}}]),e}();t.Z=new o},93825:function(e,t,n){"use strict";var a,i=n(22928),s=n(79340),o=n(6215),r=n(61120),l=n(15671),c=n(43144),u=n(57588),d=n.n(u),p=n(96359);function h(e){var t=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(e){return!1}}();return function(){var n,a=(0,r.Z)(e);if(t){var i=(0,r.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,o.Z)(this,n)}}var v=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){this._context=e,this._ajax=t,this._include=n,this._snackbar=a}}]),e}(),f=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return new Promise((function(e){e()}))}},{key:"validator",value:function(){return null}},{key:"component",value:function(){return null}}]),n}(v),m=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){var e=this;return new Promise((function(t,n){e._ajax.get(e._context.get("CAPTCHA_API")).then((function(n){e.question=n.question,e.helpText=n.help_text,t()}),(function(){e._snackbar.error(gettext("Failed to load CAPTCHA.")),n()}))}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:this.question,for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:this.helpText||null},void 0,(0,i.Z)("input",{"aria-describedby":"id_captcha_status",className:"form-control",disabled:e.form.state.isLoading,id:"id_captcha",onChange:e.form.bindInput("captcha"),type:"text",value:e.form.state.captcha}))}}]),n}(v),Z=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"componentDidMount",value:function(){var e=this;grecaptcha.render("recaptcha",{sitekey:this.props.siteKey,callback:function(t){e.props.binding({target:{value:t}})}})}},{key:"render",value:function(){return a||(a=(0,i.Z)("div",{id:"recaptcha"}))}}]),n}(d().Component),g=function(e){(0,s.Z)(n,e);var t=h(n);function n(){return(0,l.Z)(this,n),t.apply(this,arguments)}return(0,c.Z)(n,[{key:"load",value:function(){return this._include.include("https://www.google.com/recaptcha/api.js",!0),new Promise((function(e){!function t(){"undefined"==typeof grecaptcha?window.setTimeout((function(){t()}),200):e()}()}))}},{key:"validator",value:function(){return[]}},{key:"component",value:function(e){return(0,i.Z)(p.Z,{label:gettext("Please solve the quick test"),for:"id_captcha",labelClass:e.labelClass||"",controlClass:e.controlClass||"",validation:e.form.state.errors.captcha,helpText:gettext("This test helps us prevent automated spam registrations on our site.")},void 0,(0,i.Z)(Z,{binding:e.form.bindInput("captcha"),siteKey:this._context.get("SETTINGS").recaptcha_site_key}))}}]),n}(v),y=function(){function e(){(0,l.Z)(this,e)}return(0,c.Z)(e,[{key:"init",value:function(e,t,n,a){switch(e.get("SETTINGS").captcha_type){case"no":this._captcha=new f;break;case"qa":this._captcha=new m;break;case"re":this._captcha=new g}this._captcha.init(e,t,n,a)}},{key:"load",value:function(){return this._captcha.load()}},{key:"validator",value:function(){return this._captcha.validator()}},{key:"component",value:function(e){return this._captcha.component(e)}}]),e}();t.ZP=new y},96142:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(19755),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._staticUrl=e,this._included=[]}},{key:"include",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];-1===this._included.indexOf(e)&&(this._included.push(e),this._include(e,t))}},{key:"_include",value:function(e,t){s.ajax({url:(t?"":this._staticUrl)+e,cache:!0,dataType:"script"})}}]),e}();t.Z=new o},62833:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=window.localStorage,o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._prefix=e,this._watchers=[],window.addEventListener("storage",(function(e){var n=JSON.parse(e.newValue);t._watchers.forEach((function(t){t.key===e.key&&e.oldValue!==e.newValue&&t.callback(n)}))}))}},{key:"set",value:function(e,t){s.setItem(this._prefix+e,JSON.stringify(t))}},{key:"get",value:function(e){var t=s.getItem(this._prefix+e);return t?JSON.parse(t):null}},{key:"watch",value:function(e,t){this._watchers.push({key:this._prefix+e,callback:t})}}]),e}();t.Z=new o},8621:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(4869),o=n(19755),r=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._element=e,this._component=null}},{key:"show",value:function(e){this._component===e?this.hide():(this._component=e,(0,s.Z)(e,this._element.id),o(this._element).addClass("open"))}},{key:"showConnected",value:function(e,t){this._component===e?this.hide():(this._component=e,(0,s.Z)(t,this._element.id,!0),o(this._element).addClass("open"))}},{key:"hide",value:function(){o(this._element).removeClass("open"),this._component=null}}]),e}();t.Z=new r},59801:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(73935),o=n.n(s),r=n(4869),l=n(19755),c=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){var t=this;this._element=e,this._modal=l(e).modal({show:!1}),this._modal.on("hidden.bs.modal",(function(){o().unmountComponentAtNode(t._element)}))}},{key:"show",value:function(e){(0,r.Z)(e,this._element.id),this._modal.modal("show")}},{key:"hide",value:function(){this._modal.modal("hide")}}]),e}();t.Z=new c},53328:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._indexTitle=e,this._forumName=t}},{key:"set",value:function(e){if(e){"string"==typeof e&&(e={title:e});var t=e.title;e.page>1&&(t+=" ("+interpolate(gettext("page: %(page)s"),{page:e.page},!0)+")"),e.parent&&(t+=" | "+e.parent),document.title=t+" | "+this._forumName}else document.title=this._indexTitle||this._forumName}}]),e}();t.Z=new s},55547:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e,t){this._ajax=e,this._snackbar=t,this._polls={}}},{key:"start",value:function(e){var t=this;this.stop(e.poll);var n=function n(){t._polls[e.poll]=e,t._ajax.get(e.url,e.data||null).then((function(a){t._polls[e.poll]._stopped||(e.update(a),t._polls[e.poll].timeout=window.setTimeout(n,e.frequency))}),(function(n){t._polls[e.poll]._stopped||(e.error?e.error(n):t._snackbar.apiError(n))}))};e.delayed?this._polls[e.poll]={timeout:window.setTimeout(n,e.frequency)}:n()}},{key:"stop",value:function(e){this._polls[e]&&(window.clearTimeout(this._polls[e].timeout),this._polls[e]._stopped=!0)}}]),e}();t.Z=new s},64646:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(4942),o=n(57588),r=n.n(o),l=n(73935),c=n.n(l),u=n(78107),d=n(4869),p=function(){function e(){var t=this;(0,a.Z)(this,e),(0,s.Z)(this,"close",(function(){t._isOpen&&!t._isClosing&&(t._isClosing=!0,t._mount.classList.remove("show"),window.setTimeout((function(){c().unmountComponentAtNode(t._mount),t._observer.unobserve(t._mount),t._spacer.style.height="0px;",t._isClosing=!1,t._isOpen=!1,t._mode=null}),300))}))}return(0,i.Z)(e,[{key:"init",value:function(e,t,n){var a=this;this._ajax=e,this._snackbar=t,this._mount=n,this._mode=null,this._spacer=document.getElementById("posting-spacer"),this._observer=new ResizeObserver((function(e){a._spacer.style.height=e[0].contentRect.height+"px"})),this._isOpen=!1,this._isClosing=!1}},{key:"isOpen",value:function(){return this._isOpen}},{key:"open",value:function(e){if(!1===this._isOpen)this._mode=e.mode,this._isOpen=e.submit,this._realOpen(e);else if(this._isOpen!==e.submit){var t=gettext("You are already working on other message. Do you want to discard it?");window.confirm(t)&&(this._mode=e.mode,this._isOpen=e.submit,this._realOpen(e))}else"REPLY"==this._mode&&"REPLY"==e.mode&&this._realOpen(e)}},{key:"_realOpen",value:function(e){(0,d.Z)(r().createElement(u.ZP,e),this._mount.id),this._mount.classList.add("show"),this._observer.observe(this._mount)}}]),e}();t.Z=new p},53904:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(27346),o=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._store=e,this._timeout=null}},{key:"alert",value:function(e,t){var n=this;this._timeout?(window.clearTimeout(this._timeout),this._store.dispatch((0,s.p2)()),this._timeout=window.setTimeout((function(){n._timeout=null,n.alert(e,t)}),300)):(this._store.dispatch((0,s.OV)(e,t)),this._timeout=window.setTimeout((function(){n._store.dispatch((0,s.p2)()),n._timeout=null}),5e3))}},{key:"info",value:function(e){this.alert(e,"info")}},{key:"success",value:function(e){this.alert(e,"success")}},{key:"warning",value:function(e){this.alert(e,"warning")}},{key:"error",value:function(e){this.alert(e,"error")}},{key:"apiError",value:function(e){var t=e.detail;t||(t=404===e.status?gettext("Action link is invalid."):gettext("Unknown error has occured.")),403===e.status&&"Permission denied"===t&&(t=gettext("You don't have permission to perform this action.")),this.error(t)}}]),e}();t.Z=new o},90287:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=n(41438),o=function(){function e(){(0,a.Z)(this,e),this._store=null,this._reducers={},this._initialState={}}return(0,i.Z)(e,[{key:"addReducer",value:function(e,t,n){this._reducers[e]=t,this._initialState[e]=n}},{key:"init",value:function(){this._store=(0,s.createStore)((0,s.combineReducers)(this._reducers),this._initialState)}},{key:"getStore",value:function(){return this._store}},{key:"getState",value:function(){return this._store.getState()}},{key:"dispatch",value:function(e){return this._store.dispatch(e)}}]),e}();t.Z=new o},59940:function(e,t,n){"use strict";var a=n(15671),i=n(43144),s=function(){function e(){(0,a.Z)(this,e)}return(0,i.Z)(e,[{key:"init",value:function(e){this._include=e,this._isLoaded=!1}},{key:"scorePassword",value:function(e,t){return this._isLoaded?zxcvbn(e,t).score:0}},{key:"load",value:function(){return this._isLoaded?this._loadedPromise():(this._include.include("misago/js/zxcvbn.js"),this._loadingPromise())}},{key:"_loadingPromise",value:function(){var e=this;return new Promise((function(t,n){!function a(){var i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;(i+=1)>200?n():"undefined"==typeof zxcvbn?window.setTimeout((function(){a(i)}),200):(e._isLoaded=!0,t())}()}))}},{key:"_loadedPromise",value:function(){return new Promise((function(e){e()}))}}]),e}();t.Z=new s},93051:function(e,t,n){"use strict";n.d(t,{Z:function(){return _}});var a,i=n(22928),s=n(30381),o=n.n(s),r=n(57588),l=n.n(r),c=n(73935),u=n.n(c),d=n(37424),p=n(15671),h=n(43144),v=n(79340),f=n(6215),m=n(61120);var Z=function(e){(0,v.Z)(r,e);var t,n,s=(t=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(e){return!1}}(),function(){var e,a=(0,m.Z)(t);if(n){var i=(0,m.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,f.Z)(this,e)});function r(){return(0,p.Z)(this,r),s.apply(this,arguments)}return(0,h.Z)(r,[{key:"getReasonMessage",value:function(){return this.props.message.html?(0,i.Z)("div",{className:"lead",dangerouslySetInnerHTML:{__html:this.props.message.html}}):(0,i.Z)("p",{className:"lead"},void 0,this.props.message.plain)}},{key:"getExpirationMessage",value:function(){if(this.props.expires){if(this.props.expires.isAfter(o()())){var e=interpolate(gettext("This ban expires on %(expires_on)s."),{expires_on:this.props.expires.format("LL, LT")},!0),t=interpolate(gettext("This ban expires %(expires_on)s."),{expires_on:this.props.expires.fromNow()},!0);return(0,i.Z)("abbr",{title:e},void 0,t)}return gettext("This ban has expired.")}return gettext("This ban is permanent.")}},{key:"render",value:function(){return(0,i.Z)("div",{className:"page page-error page-error-banned"},void 0,(0,i.Z)("div",{className:"container"},void 0,(0,i.Z)("div",{className:"message-panel"},void 0,a||(a=(0,i.Z)("div",{className:"message-icon"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"highlight_off"))),(0,i.Z)("div",{className:"message-body"},void 0,this.getReasonMessage(),(0,i.Z)("p",{className:"message-footnote"},void 0,this.getExpirationMessage())))))}}]),r}(l().Component),g=n(32233),y=n(90287),b=(0,d.$j)((function(e){return e.tick}))(Z);function _(e,t){if(u().render((0,i.Z)(d.zt,{store:y.Z.getStore()},void 0,(0,i.Z)(b,{message:e.message,expires:e.expires_on?o()(e.expires_on):null})),document.getElementById("page-mount")),void 0===t||t){var n=g.Z.get("SETTINGS").forum_name;document.title=gettext("You are banned")+" | "+n,window.history.pushState({},"",g.Z.get("BANNED_URL"))}}},69130:function(e,t,n){"use strict";function a(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],a=[],i=[];if(e.forEach((function(e){i.push(e),i.length===t&&(a.push(i),i=[])})),!1!==n&&i.length>0&&i.length<t)for(var s=i.length;s<t;s++)i.push(n);return i.length&&a.push(i),a}n.d(t,{Z:function(){return a}})},89759:function(e,t,n){"use strict";function a(e,t){var n=[];return e.concat(t).filter((function(e){return-1===n.indexOf(e.id)&&(n.push(e.id),!0)}))}n.d(t,{Z:function(){return a}})},89627:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};function i(e){return e.replace(/[&<>"']/g,(function(e){return a[e]}))}},48772:function(e,t,n){"use strict";function a(e){return e>1073741824?i(e/1073741824)+" GB":e>1048576?i(e/1048576)+" MB":e>1024?i(e/1024)+" KB":i(e)+" B"}function i(e){return e.toFixed(1)}n.d(t,{Z:function(){return a}})},4869:function(e,t,n){"use strict";n.d(t,{Z:function(){return l}});var a=n(22928),i=(n(57588),n(73935)),s=n.n(i),o=n(37424),r=n(90287);function l(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],i=document.getElementById(t),l=e.props?e:(0,a.Z)(e,{});i&&(n?s().render((0,a.Z)(o.zt,{store:r.Z.getStore()},void 0,l),i):s().render(l,i))}},44039:function(e,t,n){"use strict";function a(e,t){return Math.floor(Math.random()*(t-e+1))+e}n.d(t,{e:function(){return a}})},39633:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=(n(57588),n(73935)),s=n.n(i),o=n(37424),r=n(69987),l=n(90287),c=document.getElementById("page-mount");function u(e){var t={component:e.component||null,childRoutes:[]};e.root?t.childRoutes=[{path:e.root,onEnter:function(t,n){n(null,e.paths[0].path)}}].concat(e.paths):t.childRoutes=e.paths,s().render((0,a.Z)(o.zt,{store:l.Z.getStore()},void 0,(0,a.Z)(r.F0,{routes:t,history:r.mW})),c)}},20370:function(e,t,n){"use strict";function a(e,t){if(-1===e.indexOf(t)){var n=e.slice();return n.push(t),n}return e.filter((function(e){return e!==t}))}n.d(t,{ZN:function(){return a}})},55210:function(e,t,n){"use strict";n.d(t,{BS:function(){return d},C1:function(){return o},Do:function(){return c},Ei:function(){return u},HR:function(){return p},Vb:function(){return f},fT:function(){return r},gS:function(){return h},jA:function(){return l},lG:function(){return v}});var a=n(19755),i=/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,s=new RegExp("^[0-9a-z]+$","i");function o(e){return function(t){if(!1===t||null===t||0===a.trim(t).length)return e||gettext("This field is required.")}}function r(e){var t=gettext("You have to accept the terms of service.");return o(e||t)}function l(e){var t=gettext("You have to accept the privacy policy.");return o(e||t)}function c(e){return function(t){if(!i.test(t))return e||gettext("Enter a valid email address.")}}function u(e,t){return function(n){var i="",s=a.trim(n).length;if(s<e)return i=t?t(e,s):ngettext("Ensure this value has at least %(limit_value)s character (it has %(show_value)s).","Ensure this value has at least %(limit_value)s characters (it has %(show_value)s).",e),interpolate(i,{limit_value:e,show_value:s},!0)}}function d(e,t){return function(n){var i="",s=a.trim(n).length;if(s>e)return i=t?t(e,s):ngettext("Ensure this value has at most %(limit_value)s character (it has %(show_value)s).","Ensure this value has at most %(limit_value)s characters (it has %(show_value)s).",e),interpolate(i,{limit_value:e,show_value:s},!0)}}function p(e){return u(e,(function(e){return ngettext("Username must be at least %(limit_value)s character long.","Username must be at least %(limit_value)s characters long.",e)}))}function h(e){return d(e,(function(e){return ngettext("Username cannot be longer than %(limit_value)s character.","Username cannot be longer than %(limit_value)s characters.",e)}))}function v(){return function(e){if(!s.test(a.trim(e)))return gettext("Username can only contain latin alphabet letters and digits.")}}function f(e){return function(t){var n=t.length;if(n<e){var a=ngettext("Valid password must be at least %(limit_value)s character long.","Valid password must be at least %(limit_value)s characters long.",e);return interpolate(a,{limit_value:e,show_value:n},!0)}}}},46700:function(e,t,n){var a={"./af":42786,"./af.js":42786,"./ar":30867,"./ar-dz":14130,"./ar-dz.js":14130,"./ar-kw":96135,"./ar-kw.js":96135,"./ar-ly":56440,"./ar-ly.js":56440,"./ar-ma":47702,"./ar-ma.js":47702,"./ar-sa":16040,"./ar-sa.js":16040,"./ar-tn":37100,"./ar-tn.js":37100,"./ar.js":30867,"./az":31083,"./az.js":31083,"./be":9808,"./be.js":9808,"./bg":68338,"./bg.js":68338,"./bm":67438,"./bm.js":67438,"./bn":8905,"./bn-bd":76225,"./bn-bd.js":76225,"./bn.js":8905,"./bo":11560,"./bo.js":11560,"./br":1278,"./br.js":1278,"./bs":80622,"./bs.js":80622,"./ca":2468,"./ca.js":2468,"./cs":5822,"./cs.js":5822,"./cv":50877,"./cv.js":50877,"./cy":47373,"./cy.js":47373,"./da":24780,"./da.js":24780,"./de":59740,"./de-at":60217,"./de-at.js":60217,"./de-ch":60894,"./de-ch.js":60894,"./de.js":59740,"./dv":5300,"./dv.js":5300,"./el":50837,"./el.js":50837,"./en-au":78348,"./en-au.js":78348,"./en-ca":77925,"./en-ca.js":77925,"./en-gb":22243,"./en-gb.js":22243,"./en-ie":46436,"./en-ie.js":46436,"./en-il":47207,"./en-il.js":47207,"./en-in":44175,"./en-in.js":44175,"./en-nz":76319,"./en-nz.js":76319,"./en-sg":31662,"./en-sg.js":31662,"./eo":92915,"./eo.js":92915,"./es":55655,"./es-do":55251,"./es-do.js":55251,"./es-mx":96112,"./es-mx.js":96112,"./es-us":71146,"./es-us.js":71146,"./es.js":55655,"./et":5603,"./et.js":5603,"./eu":77763,"./eu.js":77763,"./fa":76959,"./fa.js":76959,"./fi":11897,"./fi.js":11897,"./fil":42549,"./fil.js":42549,"./fo":94694,"./fo.js":94694,"./fr":94470,"./fr-ca":63049,"./fr-ca.js":63049,"./fr-ch":52330,"./fr-ch.js":52330,"./fr.js":94470,"./fy":5044,"./fy.js":5044,"./ga":29295,"./ga.js":29295,"./gd":2101,"./gd.js":2101,"./gl":38794,"./gl.js":38794,"./gom-deva":27884,"./gom-deva.js":27884,"./gom-latn":23168,"./gom-latn.js":23168,"./gu":95349,"./gu.js":95349,"./he":24206,"./he.js":24206,"./hi":30094,"./hi.js":30094,"./hr":30316,"./hr.js":30316,"./hu":22138,"./hu.js":22138,"./hy-am":11423,"./hy-am.js":11423,"./id":29218,"./id.js":29218,"./is":90135,"./is.js":90135,"./it":90626,"./it-ch":10150,"./it-ch.js":10150,"./it.js":90626,"./ja":39183,"./ja.js":39183,"./jv":24286,"./jv.js":24286,"./ka":12105,"./ka.js":12105,"./kk":47772,"./kk.js":47772,"./km":18758,"./km.js":18758,"./kn":79282,"./kn.js":79282,"./ko":33730,"./ko.js":33730,"./ku":1408,"./ku.js":1408,"./ky":33291,"./ky.js":33291,"./lb":36841,"./lb.js":36841,"./lo":55466,"./lo.js":55466,"./lt":57010,"./lt.js":57010,"./lv":37595,"./lv.js":37595,"./me":39861,"./me.js":39861,"./mi":35493,"./mi.js":35493,"./mk":95966,"./mk.js":95966,"./ml":87341,"./ml.js":87341,"./mn":5115,"./mn.js":5115,"./mr":10370,"./mr.js":10370,"./ms":9847,"./ms-my":41237,"./ms-my.js":41237,"./ms.js":9847,"./mt":72126,"./mt.js":72126,"./my":56165,"./my.js":56165,"./nb":64924,"./nb.js":64924,"./ne":16744,"./ne.js":16744,"./nl":93901,"./nl-be":59814,"./nl-be.js":59814,"./nl.js":93901,"./nn":83877,"./nn.js":83877,"./oc-lnc":92135,"./oc-lnc.js":92135,"./pa-in":15858,"./pa-in.js":15858,"./pl":64495,"./pl.js":64495,"./pt":89520,"./pt-br":57971,"./pt-br.js":57971,"./pt.js":89520,"./ro":96459,"./ro.js":96459,"./ru":21793,"./ru.js":21793,"./sd":40950,"./sd.js":40950,"./se":10490,"./se.js":10490,"./si":90124,"./si.js":90124,"./sk":64249,"./sk.js":64249,"./sl":14985,"./sl.js":14985,"./sq":51104,"./sq.js":51104,"./sr":49131,"./sr-cyrl":79915,"./sr-cyrl.js":79915,"./sr.js":49131,"./ss":85893,"./ss.js":85893,"./sv":98760,"./sv.js":98760,"./sw":91172,"./sw.js":91172,"./ta":27333,"./ta.js":27333,"./te":23110,"./te.js":23110,"./tet":52095,"./tet.js":52095,"./tg":27321,"./tg.js":27321,"./th":9041,"./th.js":9041,"./tk":19005,"./tk.js":19005,"./tl-ph":75768,"./tl-ph.js":75768,"./tlh":89444,"./tlh.js":89444,"./tr":72397,"./tr.js":72397,"./tzl":28254,"./tzl.js":28254,"./tzm":51106,"./tzm-latn":30699,"./tzm-latn.js":30699,"./tzm.js":51106,"./ug-cn":9288,"./ug-cn.js":9288,"./uk":67691,"./uk.js":67691,"./ur":13795,"./ur.js":13795,"./uz":6791,"./uz-latn":60588,"./uz-latn.js":60588,"./uz.js":6791,"./vi":65666,"./vi.js":65666,"./x-pseudo":14378,"./x-pseudo.js":14378,"./yo":75805,"./yo.js":75805,"./zh-cn":83839,"./zh-cn.js":83839,"./zh-hk":55726,"./zh-hk.js":55726,"./zh-mo":99807,"./zh-mo.js":99807,"./zh-tw":74152,"./zh-tw.js":74152};function i(e){var t=s(e);return n(t)}function s(e){if(!n.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}i.keys=function(){return Object.keys(a)},i.resolve=s,e.exports=i,i.id=46700}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={id:e,loaded:!1,exports:{}};return a[e].call(n.exports,n,n.exports,s),n.loaded=!0,n.exports}s.m=a,e=[],s.O=function(t,n,a,i){if(!n){var o=1/0;for(u=0;u<e.length;u++){n=e[u][0],a=e[u][1],i=e[u][2];for(var r=!0,l=0;l<n.length;l++)(!1&i||o>=i)&&Object.keys(s.O).every((function(e){return s.O[e](n[l])}))?n.splice(l--,1):(r=!1,i<o&&(o=i));if(r){e.splice(u--,1);var c=a();void 0!==c&&(t=c)}}return t}i=i||0;for(var u=e.length;u>0&&e[u-1][2]>i;u--)e[u]=e[u-1];e[u]=[n,a,i]},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,{a:t}),t},s.d=function(e,t){for(var n in t)s.o(t,n)&&!s.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},s.f={},s.e=function(e){return Promise.all(Object.keys(s.f).reduce((function(t,n){return s.f[n](e,t),t}),[]))},s.u=function(e){return"hljs.js"},s.miniCssF=function(e){},s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),s.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t={},n="misago:",s.l=function(e,a,i,o){if(t[e])t[e].push(a);else{var r,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==n+i){r=d;break}}r||(l=!0,(r=document.createElement("script")).charset="utf-8",r.timeout=120,s.nc&&r.setAttribute("nonce",s.nc),r.setAttribute("data-webpack",n+i),r.src=e),t[e]=[a];var p=function(n,a){r.onerror=r.onload=null,clearTimeout(h);var i=t[e];if(delete t[e],r.parentNode&&r.parentNode.removeChild(r),i&&i.forEach((function(e){return e(a)})),n)return n(a)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=p.bind(null,r.onerror),r.onload=p.bind(null,r.onload),l&&document.head.appendChild(r)}},s.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},function(){var e;s.g.importScripts&&(e=s.g.location+"");var t=s.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var n=t.getElementsByTagName("script");n.length&&(e=n[n.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),s.p=e}(),function(){var e={174:0};s.f.j=function(t,n){var a=s.o(e,t)?e[t]:void 0;if(0!==a)if(a)n.push(a[2]);else{var i=new Promise((function(n,i){a=e[t]=[n,i]}));n.push(a[2]=i);var o=s.p+s.u(t),r=new Error;s.l(o,(function(n){if(s.o(e,t)&&(0!==(a=e[t])&&(e[t]=void 0),a)){var i=n&&("load"===n.type?"missing":n.type),o=n&&n.target&&n.target.src;r.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",r.name="ChunkLoadError",r.type=i,r.request=o,a[1](r)}}),"chunk-"+t,t)}},s.O.j=function(t){return 0===e[t]};var t=function(t,n){var a,i,o=n[0],r=n[1],l=n[2],c=0;if(o.some((function(t){return 0!==e[t]}))){for(a in r)s.o(r,a)&&(s.m[a]=r[a]);if(l)var u=l(s)}for(t&&t(n);c<o.length;c++)i=o[c],s.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return s.O(u)},n=self.webpackChunkmisago=self.webpackChunkmisago||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),s.O(void 0,[736],(function(){return s(32233)})),s.O(void 0,[736],(function(){return s(58339)})),s.O(void 0,[736],(function(){return s(64109)})),s.O(void 0,[736],(function(){return s(46226)})),s.O(void 0,[736],(function(){return s(93240)})),s.O(void 0,[736],(function(){return s(75147)})),s.O(void 0,[736],(function(){return s(4894)})),s.O(void 0,[736],(function(){return s(29223)})),s.O(void 0,[736],(function(){return s(3026)})),s.O(void 0,[736],(function(){return s(94795)})),s.O(void 0,[736],(function(){return s(95563)})),s.O(void 0,[736],(function(){return s(32488)})),s.O(void 0,[736],(function(){return s(11768)})),s.O(void 0,[736],(function(){return s(61323)})),s.O(void 0,[736],(function(){return s(15049)})),s.O(void 0,[736],(function(){return s(61814)})),s.O(void 0,[736],(function(){return s(95920)})),s.O(void 0,[736],(function(){return s(60630)})),s.O(void 0,[736],(function(){return s(72168)})),s.O(void 0,[736],(function(){return s(47806)})),s.O(void 0,[736],(function(){return s(77031)})),s.O(void 0,[736],(function(){return s(97751)})),s.O(void 0,[736],(function(){return s(76093)})),s.O(void 0,[736],(function(){return s(19764)})),s.O(void 0,[736],(function(){return s(47549)})),s.O(void 0,[736],(function(){return s(22331)})),s.O(void 0,[736],(function(){return s(21513)})),s.O(void 0,[736],(function(){return s(98749)})),s.O(void 0,[736],(function(){return s(98251)})),s.O(void 0,[736],(function(){return s(6720)})),s.O(void 0,[736],(function(){return s(10846)})),s.O(void 0,[736],(function(){return s(18255)})),s.O(void 0,[736],(function(){return s(14113)})),s.O(void 0,[736],(function(){return s(24444)})),s.O(void 0,[736],(function(){return s(1764)})),s.O(void 0,[736],(function(){return s(68351)})),s.O(void 0,[736],(function(){return s(81521)})),s.O(void 0,[736],(function(){return s(19984)})),s.O(void 0,[736],(function(){return s(41229)})),s.O(void 0,[736],(function(){return s(43589)})),s.O(void 0,[736],(function(){return s(24108)})),s.O(void 0,[736],(function(){return s(33934)})),s.O(void 0,[736],(function(){return s(85577)})),s.O(void 0,[736],(function(){return s(83526)})),s.O(void 0,[736],(function(){return s(43060)})),s.O(void 0,[736],(function(){return s(92292)})),s.O(void 0,[736],(function(){return s(33409)}));var o=s.O(void 0,[736],(function(){return s(31341)}));o=s.O(o)}();
 //# sourceMappingURL=misago.js.map

File diff suppressed because it is too large
+ 0 - 0
misago/static/misago/js/misago.js.map


Some files were not shown because too many files changed in this diff