text: module.exports=function(t){var e={};function n(a){if(e[a])return e[a].exports;var r=e[a]={i:a,l:!1,exports:{}};return t[a].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,a){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(n.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(a,r,function(e){return t[e]}.bind(null,r));return a},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=12)}([function(t,e){t.exports=flarum.core.compat["common/extend"]},function(t,e){t.exports=flarum.core.compat["common/utils/Stream"]},function(t,e){t.exports=flarum.core.compat["forum/components/SignUpModal"]},function(t,e){t.exports=flarum.core.compat["common/components/Button"]},function(t,e){t.exports=flarum.core.compat["common/components/EditUserModal"]},function(t,e){t.exports=flarum.core.compat["common/utils/extractText"]},function(t,e){t.exports=flarum.core.compat["forum/components/SettingsPage"]},function(t,e){t.exports=flarum.core.compat["common/Model"]},function(t,e){t.exports=flarum.core.compat["common/models/User"]},function(t,e){t.exports=flarum.core.compat["common/components/Modal"]},,,function(t,e,n){"use strict";n.r(e);var a=n(0),r=n(3),o=n.n(r),i=n(4),c=n.n(i),s=n(2),u=n.n(s),p=n(6),l=n.n(p),d=n(7),f=n.n(d),b=n(8),k=n.n(b),y=n(5),h=n.n(y),g=n(1),v=n.n(g);function N(t,e){return(N=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var x=n(9),O=function(t){var e,n;function a(){return t.apply(this,arguments)||this}n=t,(e=a).prototype=Object.create(n.prototype),e.prototype.constructor=e,N(e,n);var r=a.prototype;return r.oninit=function(e){t.prototype.oninit.call(this,e),this.nickname=v()(app.session.user.displayName())},r.className=function(){return"NickameModal Modal--small"},r.title=function(){return app.translator.trans("flarum-nicknames.forum.change_nickname.title")},r.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{type:"text",autocomplete:"off",name:"nickname",className:"FormControl",bidi:this.nickname,disabled:this.loading})),m("div",{className:"Form-group"},o.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},app.translator.trans("flarum-nicknames.forum.change_nickname.submit_button")))))},r.onsubmit=function(t){var e=this;t.preventDefault(),this.nickname()!==app.session.user.displayName()?(this.loading=!0,app.session.user.save({nickname:this.nickname()},{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))):this.hide()},a}(n.n(x).a);app.initializers.add("flarum/nicknames",(function(){k.a.prototype.canEditOwnNickname=f.a.attribute("canEditOwnNickname"),Object(a.extend)(l.a.prototype,"accountItems",(function(t){"nickname"===app.forum.attribute("displayNameDriver")&&this.user.canEditOwnNickname()&&t.add("changeNickname",m(o.a,{className:"Button",onclick:function(){return app.modal.show(O)}},app.translator.trans("flarum-nicknames.forum.settings.change_nickname_button")))})),Object(a.extend)(c.a.prototype,"oninit",(function(){"nickname"===app.forum.attribute("displayNameDriver")&&(this.nickname=v()(this.attrs.user.displayName()))})),Object(a.extend)(c.a.prototype,"fields",(function(t){"nickname"===app.forum.attribute("displayNameDriver")&&t.add("nickname",m("div",{className:"Form-group"},m("label",null,app.translator.trans("flarum-nicknames.forum.edit_user.nicknames_heading")),m("input",{className:"FormControl",placeholder:h()(app.translator.trans("flarum-nicknames.forum.edit_user.nicknames_text")),bidi:this.nickname})),100)})),Object(a.extend)(c.a.prototype,"data",(function(t){if("nickname"===app.forum.attribute("displayNameDriver")){this.attrs.user;this.nickname()!==this.attrs.user.displayName()&&(t.nickname=this.nickname())}})),Object(a.extend)(u.a.prototype,"oninit",(function(){"nickname"===app.forum.attribute("displayNameDriver")&&(this.nickname=v()(this.attrs.username||""))})),Object(a.extend)(u.a.prototype,"onready",(function(){"nickname"===app.forum.attribute("displayNameDriver")&&app.forum.attribute("setNicknameOnRegistration")&&app.forum.attribute("randomizeUsernameOnRegistration")&&this.$("[name=nickname]").select()})),Object(a.extend)(u.a.prototype,"fields",(function(t){"nickname"===app.forum.attribute("displayNameDriver")&&app.forum.attribute("setNicknameOnRegistration")&&(t.add("nickname",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"nickname",type:"text",placeholder:h()(app.translator.trans("flarum-nicknames.forum.sign_up.nickname_placeholder")),bidi:this.nickname,disabled:this.loading||this.isProvided("nickname"),required:app.forum.attribute("randomizeUsernameOnRegistration")})),25),app.forum.attribute("randomizeUsernameOnRegistration")&&t.remove("username"))})),Object(a.extend)(u.a.prototype,"submitData",(function(t){if("nickname"===app.forum.attribute("displayNameDriver")&&app.forum.attribute("setNicknameOnRegistration")&&(t.nickname=this.nickname(),app.forum.attribute("randomizeUsernameOnRegistration"))){var e=new Uint32Array(2);crypto.getRandomValues(e),t.username=e.join("")}}))}))}]);
  //# sourceMappingURL=forum.js.map