(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-521c00c8"],{"0481":function(e,t,s){"use strict";var a=s("23e7"),r=s("a2bf"),n=s("7b0b"),i=s("50c4"),c=s("a691"),o=s("65f0");a({target:"Array",proto:!0},{flat:function(){var e=arguments.length?arguments[0]:void 0,t=n(this),s=i(t.length),a=o(t,0);return a.length=r(a,t,t,s,0,void 0===e?1:c(e)),a}})},"1d48":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"message-preview"},[e.opponentMessage?e._e():s("span",{staticClass:"message-thread__author"},[e._v(e._s(e.$t("You"))+": ")]),s("span",[e._v(e._s(e.text))])])},r=[],n=(s("a9e3"),s("d4ec")),i=s("bee2"),c=s("262e"),o=s("2caf"),u=s("9ab4"),l=s("2fe1"),d=s("d5a8"),g=s("78f9"),h=s("392c"),m=function(e){Object(c["a"])(s,e);var t=Object(o["a"])(s);function s(){return Object(n["a"])(this,s),t.apply(this,arguments)}return Object(i["a"])(s,[{key:"opponentMessage",get:function(){return!!Object(h["isCallMessageDetails"])(this.message.details)&&this.message.details.callerId!==Number(this.authUserId)}},{key:"text",get:function(){if(Object(h["isCallMessageDetails"])(this.message.details)){var e=this.message.details.status;if(e===h["CallStatus"].ENDED)return this.opponentMessage?Object(g["a"])("{0} call",[Object(g["a"])("Incoming")]):Object(g["a"])("{0} call",[Object(g["a"])("Outgoing")]);if(this.opponentMessage)return Object(g["a"])("{0} call",[Object(g["a"])("Missed")]);if(e===h["CallStatus"].CANCELLED)return Object(g["a"])("{0} call",[Object(g["a"])("Cancelled")]);if(e===h["CallStatus"].DECLINED)return Object(g["a"])("{0} call",[Object(g["a"])("Declined")])}return""}}]),s}(Object(l["c"])(d["a"]));m=Object(u["__decorate"])([Object(l["b"])({name:"MessagePreview"})],m);var f=m,p=f,b=s("2877"),v=Object(b["a"])(p,a,r,!1,null,null,null);t["default"]=v.exports},"236b":function(e,t,s){"use strict";s("4502")},4069:function(e,t,s){var a=s("44d2");a("flat")},"420c":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.details?s("div",{staticClass:"message-preview"},[e.opponentMessage?e._e():s("span",{staticClass:"message-preview__author"},[e._v(e._s(e.$t("You"))+": ")]),s("format-money",{attrs:{cost:e.details.amount,hideNumberSymbol:!1},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.amount,r=t.symbol,n=t.separator;return[s("span",[e._v(e._s(e.$t("I sent you a {0} tip!",[""+r+a[0]+n+a[1]])))])]}}],null,!1,2503113857)})],1):e._e()},r=[],n=s("a6f4"),i=s("6a2d"),c=s("6d37"),o=Object(n["c"])({name:"MessagePreviewTip",components:{FormatMoney:c["a"]},props:{message:{type:Object,required:!0},authUserId:{type:String,required:!0}},computed:{opponentMessage:function(){var e;return(null===(e=this.message.senderUser)||void 0===e?void 0:e.id)!==this.authUserId},details:function(){return Object(i["isTipMessageDetails"])(this.message.details)?this.message.details:null}}}),u=o,l=s("2877"),d=Object(l["a"])(u,a,r,!1,null,null,null);t["default"]=d.exports},4502:function(e,t,s){},"5bae":function(e,t,s){},"75d7":function(e,t,s){"use strict";s.d(t,"a",(function(){return y}));var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("base-input-textarea",{ref:"baseInput",staticClass:"message-input",class:{__send:e.allowSend(e.value),__transparent:e.transparent},attrs:{rows:1,"max-rows":2,"auto-grow":!0,placeholder:e.priceAmount?e.$t("{0} for {1}",[e.placeholder,e.priceAmount]):e.placeholder,"prepend-icon":e.prependIcon,submit:"enter","append-icon":"sci-send"},on:{"click:appendIcon":e.sendMessage,submit:e.sendMessage,"click:prependIcon":function(t){return e.$emit("click:prependIcon")},resize:function(t){return e.$emit("resize",t)}},scopedSlots:e._u([e.$scopedSlots.fileInput?{key:"prependIcon",fn:function(){return[e._t("fileInput")]},proxy:!0}:null,{key:"appendIcon",fn:function(){return[e.sending?s("base-spinner",{staticClass:"message-input__progress-bar",attrs:{size:"24px"}}):e._e()]},proxy:!0}],null,!0),model:{value:e.value,callback:function(t){e.value=t},expression:"value"}})},r=[],n=s("d4ec"),i=s("bee2"),c=s("262e"),o=s("2caf"),u=s("9ab4"),l=s("2fe1"),d=s("2b0e"),g=s("7f85"),h=s("ab58"),m=s("60a3"),f=s("b1ec"),p=s("78f9"),b=s("31cf"),v=function(e){Object(c["a"])(s,e);var t=Object(o["a"])(s);function s(){var e;return Object(n["a"])(this,s),e=t.apply(this,arguments),e.value="",e}return Object(i["a"])(s,[{key:"clearInput",value:function(){this.value=""}},{key:"sendMessage",value:function(){if(!this.sending&&this.allowSend(this.value)&&(this.value||this.files)&&(this.$emit("send",this.value,this.clearInput),this.keepFocus))try{Object(f["c"])(this.$refs.baseInput.$refs.textarea).focus()}catch(e){}}}]),s}(d["default"]);Object(u["__decorate"])([Object(m["e"])({type:Boolean,default:!1})],v.prototype,"keepFocus",void 0),Object(u["__decorate"])([Object(m["e"])({required:!0})],v.prototype,"sending",void 0),Object(u["__decorate"])([Object(m["e"])({type:Boolean,default:!1})],v.prototype,"transparent",void 0),Object(u["__decorate"])([Object(m["e"])({default:null})],v.prototype,"files",void 0),Object(u["__decorate"])([Object(m["e"])({default:Object(p["a"])("Message")})],v.prototype,"placeholder",void 0),Object(u["__decorate"])([Object(m["e"])({type:String})],v.prototype,"priceAmount",void 0),Object(u["__decorate"])([Object(m["e"])()],v.prototype,"prependIcon",void 0),Object(u["__decorate"])([Object(m["e"])({type:Function,default:function(e){return e.length>0}})],v.prototype,"allowSend",void 0),Object(u["__decorate"])([b["a"]],v.prototype,"sendMessage",null),v=Object(u["__decorate"])([Object(l["b"])({name:"BaseSendMessage",components:{BaseInputTextarea:g["a"],BaseSpinner:h["a"]}})],v);var _=v,O=_,j=s("2877"),M=Object(j["a"])(O,a,r,!1,null,null,null),y=M.exports},"9aa0":function(e,t,s){"use strict";s("5bae")},a2bf:function(e,t,s){"use strict";var a=s("e8b5"),r=s("50c4"),n=s("0366"),i=function(e,t,s,c,o,u,l,d){var g,h=o,m=0,f=!!l&&n(l,d,3);while(m<c){if(m in s){if(g=f?f(s[m],m,t):s[m],u>0&&a(g))h=i(e,t,g,r(g.length),h,u-1)-1;else{if(h>=9007199254740991)throw TypeError("Exceed the acceptable array length");e[h]=g}h++}m++}return h};e.exports=i},a2da:function(e,t,s){"use strict";s("eb2f")},a49f:function(e,t,s){"use strict";s("c2c5")},a8f5:function(e,t,s){"use strict";s.d(t,"a",(function(){return v}));var a=function(e,t){var s=t._c;return s("div",{staticClass:"empty-content centered-content",class:(Array.isArray(t.data.class)?t.data.class:[t.data.class]).concat([t.data.staticClass])},[t._t("prepend"),t.props.imgSrc?s("base-image",{staticClass:"empty-content__image",attrs:{src:t.props.imgSrc,alt:t.props.imgAlt}}):t._e(),t._t("default",(function(){return[s("div",{class:{"mt-4":!!t.props.imgSrc}},[t._v(" "+t._s(t.props.text)+" ")])]})),t._t("append")],2)},r=[],n=s("d4ec"),i=s("262e"),c=s("2caf"),o=s("9ab4"),u=s("2fe1"),l=s("2b0e"),d=s("60a3"),g=s("0fb2");l["default"].component("BaseImage",g["a"]);var h=function(e){Object(i["a"])(s,e);var t=Object(c["a"])(s);function s(){return Object(n["a"])(this,s),t.apply(this,arguments)}return s}(l["default"]);Object(o["__decorate"])([Object(d["e"])()],h.prototype,"imgSrc",void 0),Object(o["__decorate"])([Object(d["e"])()],h.prototype,"imgAlt",void 0),Object(o["__decorate"])([Object(d["e"])({type:String,default:""})],h.prototype,"text",void 0),h=Object(o["__decorate"])([Object(u["b"])({name:"EmptyContent",components:{BaseImage:g["a"]}})],h);var m=h,f=m,p=s("2877"),b=Object(p["a"])(f,a,r,!0,null,null,null),v=b.exports},c2c5:function(e,t,s){},c604:function(e,t,s){},cc94:function(e,t,s){"use strict";s.r(t),s.d(t,"default",(function(){return et}));s("99af"),s("7db0"),s("d81d"),s("d3b7"),s("ac1f"),s("3ca3"),s("5319"),s("ddb0");var a=s("5530"),r=(s("96cf"),s("1da1")),n=s("a34a"),i=s.n(n),c=s("fe95"),o=s("ff07"),u=s("a5de"),l=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("base-page",{attrs:{loading:e.loading}},[s("page-title",{staticClass:"px-4 py-0 message-threads__head",attrs:{hideBack:""},scopedSlots:e._u([{key:"append",fn:function(){return[s("div",{staticClass:"d-flex ml-auto mr-n2",staticStyle:{"font-size":"24px"}},[e.menuItems.length>0?s("base-menu",{staticClass:"message-threads__menu",attrs:{items:e.menuItems},on:{"click:statistics":function(t){return e.$router.push({name:"massMessagesStatistics"})},"click:sendMassMessage":function(t){return e.$emit("massMessage")}},scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on;return[s("base-icon-button",e._g({staticClass:"message-threads__menu__activator"},a),[e._v("sci-mass-message")])]}}],null,!1,4003594157)}):e._e(),s("message-threads-sort",{staticClass:"message-threads-view__menu-item",attrs:{"sort-items":e.sortItems,"current-sort-item":e.currentSortItem},on:{select:function(t){return e.$emit("sort",t)}}})],1)]},proxy:!0}])},[e._v(" "+e._s(e.$t("Messages"))+" ")]),e.emptyThreads?s("empty-content",{attrs:{"img-src":"/img/empty-messages.png","img-alt":"empty-messages",text:e.emptyContentText}}):s("div",{staticClass:"py-2"},[s("infinite-scroll",{attrs:{enable:e.scroll},on:{next:e.$listeners.next}},e._l(e.messageThreadList,(function(t){return s("message-thread-item",{key:t.id,attrs:{messageThread:t,authUserId:e.authUserId}})})),1)],1)],1)},d=[],g=(s("a9e3"),s("a6f4")),h=s("9b43"),m=s("78f9"),f=s("4afc"),p=s("4580"),b=s("1031"),v=s("5beb"),_=s("855c"),O=s("24a8"),j=s("a8f5"),M=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("router-link",{staticClass:"message-thread py-2 px-4",attrs:{to:e.to}},[s("base-avatar",{staticClass:"mr-2",attrs:{size:56,user:e.user}}),s("div",{staticClass:"message-thread__content"},[s("div",{staticClass:"message-thread__name"},[e._v(e._s(e.screenName))]),e.messageThread.unreadMessageCount>1?s("div",{staticClass:"message-thread__unread"},[e._v(" "+e._s(e.$tc(e.$t("new message"),e.messageThread.unreadMessageCount))+" ")]):s("message-preview",{class:{"message-thread__unread":e.messageThread.unreadMessageCount},attrs:{message:e.messageThread.lastMessage,"auth-user-id":e.authUserId}})],1),s("div",{staticClass:"message-thread__info ml-2"},[s("div",{staticClass:"message-thread__time"},[e._v(e._s(e.timeData))]),e.messageThread.pinTime?s("base-icon",{staticClass:"message-thread__pinned",attrs:{fontSize:24}},[e._v("sci-star")]):e._e()],1)],1)},y=[],S=s("d4ec"),w=s("bee2"),I=s("262e"),k=s("2caf"),T=s("9ab4"),C=s("2b0e"),E=s("2fe1"),U=s("60a3"),x=s("56f4"),A=s("76da"),P=s("7fc7"),$=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s(e.messagePreview,{tag:"component",attrs:{message:e.message,"auth-user-id":e.authUserId}})},D=[],B=s("d5a8"),N=(s("4d63"),s("25f0"),s("466d"),s("d726")),q=s("dbd3");function R(e){if(e&&Number(e.senderId)>0)return N["default"];if(e&&e.details){var t=e.details.type,s=q.keys().find((function(e){return e.match(new RegExp("MessagePreview".concat(t.substr(0,1).toUpperCase()).concat(t.substr(1),".vue$")))}));if(s)return q(s).default}return C["default"].extend({functional:!0,render:function(e){return e()}})}var F=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){return Object(S["a"])(this,s),t.apply(this,arguments)}return Object(w["a"])(s,[{key:"messagePreview",get:function(){return R(this.message)}}]),s}(Object(E["c"])(B["a"]));F=Object(T["__decorate"])([Object(E["b"])({name:"MessagePreview"})],F);var L=F,V=L,z=s("2877"),G=Object(z["a"])(V,$,D,!1,null,null,null),W=G.exports,Y=s("9058"),H=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){return Object(S["a"])(this,s),t.apply(this,arguments)}return Object(w["a"])(s,[{key:"isBroadcast",get:function(){return x["MessageThreadSubjectTypeEnum"].BROADCAST_MEMBER===this.messageThread.subject.subjectType||x["MessageThreadSubjectTypeEnum"].BROADCAST_CREATOR===this.messageThread.subject.subjectType}},{key:"to",get:function(){var e=this;if(this.isBroadcast){var t=this.messageThread.id;return{name:"generalMessageThread",params:{threadId:t}}}var s=this.messageThread.userIds.find((function(t){return t!==e.authUserId}))||this.authUserId;return{name:"messages",params:{userId:s}}}},{key:"user",get:function(){var e,t,s,a=this;return this.isBroadcast?this.messageThread.users[0]:null!==(e=null===(t=this.messageThread)||void 0===t?void 0:t.users.find((function(e){return e.id!==a.authUserId})))&&void 0!==e?e:null===(s=this.messageThread)||void 0===s?void 0:s.users.find((function(e){return e.id===a.authUserId}))}},{key:"screenName",get:function(){var e,t;return this.isBroadcast?this.messageThread.users[0].screenName:null!==(e=null===(t=this.user)||void 0===t?void 0:t.screenName)&&void 0!==e?e:""}},{key:"timeData",get:function(){return Object(A["timeAgo"])(this.messageThread.updatedTime)}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],H.prototype,"messageThread",void 0),Object(T["__decorate"])([Object(U["e"])({type:String,required:!0})],H.prototype,"authUserId",void 0),H=Object(T["__decorate"])([Object(E["b"])({name:"MessageThreadItem",components:{MessagePreview:W,BasePage:_["a"],BaseIcon:Y["a"],PageTitle:b["a"],BaseAvatar:P["a"]}})],H);var J,K=H,Q=K,X=(s("236b"),Object(z["a"])(Q,M,y,!1,null,"993e169c",null)),Z=X.exports,ee=function(){var e=this,t=e.$createElement,s=e._self._c||t;return e.sortItems.length>0?s("div",[s("base-menu",{staticClass:"message-threads-sort",scopedSlots:e._u([{key:"activator",fn:function(t){var a=t.on;return[s("base-icon-button",e._g({staticClass:"message-threads-sort__activator"},a),[e._v("sci-sort")])]}}],null,!1,3642166233)},[s("base-list",e._l(e.sortItems,(function(t,a){return s("base-list-item",{key:a,staticClass:"message-threads-sort__item",class:e.activeItem===a&&"__active",on:{click:function(t){e.activeItem=a}}},[s("span",[e._v(e._s(e.$t(t)))])])})),1)],1)],1):e._e()},te=[],se=s("75c7");(function(e){e[e["DEFAULT"]=0]="DEFAULT",e[e["UNREAD"]=1]="UNREAD",e[e["UNREAD_OLDEST"]=2]="UNREAD_OLDEST"})(J||(J={}));var ae=Object(g["c"])({name:"MessageThreadsSort",components:{BaseMenu:v["a"],BaseList:se["b"],BaseListItem:se["a"],BaseIconButton:p["a"]},props:{sortItems:{type:Array,required:!0},currentSortItem:{type:Number,required:!0,validator:function(e){return void 0!==J[e]}}},setup:function(e,t){var s=t.emit,a=Object(g["o"])(e.currentSortItem);return Object(g["s"])(a,(function(e,t){e!==t&&s("select",e)})),{activeItem:a}}}),re=ae,ne=(s("9aa0"),Object(z["a"])(re,ee,te,!1,null,null,null)),ie=ne.exports,ce=Object(g["c"])({name:"MessageThreadsView",components:{InfiniteScroll:O["a"],EmptyContent:j["a"],BasePage:_["a"],BaseMenu:v["a"],BaseIconButton:p["a"],PageTitle:b["a"],MessageThreadItem:Z,MessageThreadsSort:ie},props:{loading:{type:Boolean,required:!0},allowMassMessage:{type:Boolean,required:!0},messageThreadList:{type:Array,required:!0},authUserId:{type:String,required:!0},scroll:{type:Boolean,required:!0},sortItems:{type:Array,required:!0},currentSortItem:{type:Number,required:!0}},setup:function(e){var t=Object(f["a"])(),s=t.authorities,a=Object(g["a"])((function(){return Object(h["checkAuthorities"])(s.value,["updateMyContentPrice","getMyMassMessageStat"])})),r=Object(g["a"])((function(){return!e.loading&&0===e.messageThreadList.length})),n=Object(g["a"])((function(){var t=[];return e.allowMassMessage&&t.push({name:"sendMassMessage",text:Object(m["a"])("Send Mass message"),icon:"sci-send"}),a.value&&t.push({name:"statistics",text:Object(m["a"])("Statistics"),icon:"sci-bar"}),t})),i=Object(g["a"])((function(){return e.currentSortItem===J.DEFAULT?Object(m["a"])("No messages yet"):Object(m["a"])("No unread messages")}));return{allowMassMessageStat:a,emptyThreads:r,menuItems:n,emptyContentText:i}}}),oe=ce,ue=(s("d836"),Object(z["a"])(oe,l,d,!1,null,"030e8ea4",null)),le=ue.exports,de=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("mass-message-view",{attrs:{loading:e.loading,massMessageUsers:e.massMessageUsers,"selected-users":e.selected},on:{check:e.onCheck,back:function(t){return e.$emit("back")}}})},ge=[],he=(s("0481"),s("4160"),s("13d5"),s("4069"),s("4ec9"),s("841c"),s("159b"),s("3835")),me=s("2ef0"),fe=s("d70b"),pe=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("base-page",{staticClass:"mass-message",attrs:{loading:e.loading}},[s("page-title",{staticClass:"pa-4",on:{click:function(t){e.sendMessage?e.sendMessage=!1:e.$emit("back")}}},[e.selectedCount<1?[e._v(e._s(e.$t("Select recipients")))]:s("div",{staticClass:"caption"},[e._v(e._s(e.$tc(e.$t("recipient"),e.selectedCount)))])],2),e.sendMessage?s("mass-message-send-view",{attrs:{"user-ids":e.selectedUsersArray}}):s("mass-message-select-view",{attrs:{loading:e.loading,"any-selected":e.selectedCount>0,"mass-message-users":e.massMessageUsers,"selected-users":e.selectedUsers},on:{check:e.$listeners.check,continue:e.onContinue}})],1)},be=[],ve=(s("b64b"),function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",[s("div",{staticClass:"px-4 pb-2 mass-message__selector"},[s("span",{staticClass:"mr-auto subtitle-1 normal"},[e._v(e._s(e.selectedText))]),e.anySelected?s("span",{staticClass:"link caption mass-message__clear",on:{click:e.onClear}},[e._v(" "+e._s(e.$t("Clear"))+" ")]):[s("span",{staticClass:"link caption mr-4 mass-message__select-subscribers",on:{click:e.onSelectSubscribersOnly}},[e._v(e._s(e.$t("Subscribers")))]),s("span",{staticClass:"link caption mass-message__select-all",on:{click:e.onSelectAll}},[e._v(e._s(e.$t("All")))])]],2),s("div",{class:{"mass-message__list":!0,__selected:e.anySelected}},e._l(e.massMessageUsers,(function(t){return s("mass-message-item",{key:t.follower.followerId,attrs:{massMessageUser:t,selected:e.selectedUsers[t.follower.followerId]},on:{input:e.onSelect}})})),1),e.anySelected?s("base-button",{staticClass:"mass-message__button",on:{click:function(t){return e.$emit("continue")}}},[e._v(" "+e._s(e.$t("Continue"))+" "),s("base-icon",{staticClass:"ml-3"},[e._v("sci-arrow-right")])],1):e._e()],1)}),_e=[],Oe=s("9310"),je=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("base-checkbox",{staticClass:"mass-message-item",attrs:{checked:e.selected},on:{input:function(t){return e.$emit("input",t,e.massMessageUser.follower.followerId)}},scopedSlots:e._u([{key:"prepend",fn:function(){return[s("router-link",{attrs:{to:e.to}},[s("base-avatar",{staticClass:"mr-2",attrs:{size:56,user:e.massMessageUser.follower.follower}})],1),s("div",{staticClass:"mass-message-item__content"},[s("div",{staticClass:"mass-message-item__name"},[s("router-link",{attrs:{to:e.to}},[e._v(e._s(e.massMessageUser.follower.follower.screenName))])],1),s("div",{staticClass:"mass-message-item__time"},[e._v(" "+e._s(e.time)+" ")])])]},proxy:!0}])})},Me=[],ye=s("bd25"),Se=s("64ae"),we=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){return Object(S["a"])(this,s),t.apply(this,arguments)}return Object(w["a"])(s,[{key:"to",get:function(){return this.massMessageUser.follower.follower&&Object(Se["e"])(this.massMessageUser.follower.follower)}},{key:"time",get:function(){return Object(A["timeAgo"])(this.massMessageUser.follower.time)}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],we.prototype,"massMessageUser",void 0),Object(T["__decorate"])([Object(U["e"])({default:!1})],we.prototype,"selected",void 0),we=Object(T["__decorate"])([Object(E["b"])({name:"MassMessageItem",components:{BaseCheckbox:ye["a"],BaseAvatar:P["a"]}})],we);var Ie=we,ke=Ie,Te=(s("a49f"),Object(z["a"])(ke,je,Me,!1,null,null,null)),Ce=Te.exports,Ee=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){return Object(S["a"])(this,s),t.apply(this,arguments)}return Object(w["a"])(s,[{key:"sendCheckEvent",value:function(e){this.$emit("check",this.massMessageUsers.reduce((function(t,s){return t[s.follower.followerId]=e(s),t}),{}))}},{key:"onSelect",value:function(e,t){var s=this;this.sendCheckEvent((function(a){return a.follower.followerId===t?e:!!s.selectedUsers[a.follower.followerId]}))}},{key:"onSelectAll",value:function(){this.sendCheckEvent((function(){return!0}))}},{key:"onSelectSubscribersOnly",value:function(){this.sendCheckEvent((function(e){return e.subscriber}))}},{key:"onClear",value:function(){this.sendCheckEvent((function(){return!1}))}},{key:"selectedType",get:function(){var e=this,t="none",s=0,a=0,r=0;return this.massMessageUsers.forEach((function(t){t.subscriber&&a++,e.selectedUsers[t.follower.followerId]&&(t.subscriber?r++:s++)})),s+r===this.massMessageUsers.length?t="all":0===s&&r>0&&r===a?t="subscribes":(s>0||r>0)&&(t="manual"),t}},{key:"selectedText",get:function(){return"none"===this.selectedType?Object(m["a"])("Select:"):"subscribes"===this.selectedType?Object(m["a"])("Subscribers selected"):""}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],Ee.prototype,"loading",void 0),Object(T["__decorate"])([Object(U["e"])({required:!0})],Ee.prototype,"anySelected",void 0),Object(T["__decorate"])([Object(U["e"])({required:!0})],Ee.prototype,"massMessageUsers",void 0),Object(T["__decorate"])([Object(U["e"])({required:!0})],Ee.prototype,"selectedUsers",void 0),Ee=Object(T["__decorate"])([Object(E["b"])({name:"MassMessageSelectView",components:{MassMessageItem:Ce,BaseButton:Oe["a"],BaseIcon:Y["a"]}})],Ee);var Ue=Ee,xe=Ue,Ae=(s("a2da"),Object(z["a"])(xe,ve,_e,!1,null,null,null)),Pe=Ae.exports,$e=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("message-send-with-attachment",{staticClass:"mass-message-send-view mt-auto",attrs:{"recipient-ids":e.userIds},on:{addMessage:e.onSend,startedSending:e.onStartSending,stoppedSending:e.onStopSending}})},De=[],Be=s("0e5a"),Ne=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){return Object(S["a"])(this,s),t.apply(this,arguments)}return Object(w["a"])(s,[{key:"onSend",value:function(){this.$router.push({name:"messageThreads"})}},{key:"onStartSending",value:function(){var e=this;this.timeout=setTimeout((function(){var t={text:Object(m["a"])("You are sending a mass message to {0} recipients. This process may take some time. They will receive this message in a few minutes, and you will see it in threads.",[e.userIds.length]),timeout:8e3};c["a"].emit(u["b"].NOTIFICATION_SHOW,t),e.onSend()}),1e4)}},{key:"onStopSending",value:function(){this.timeout&&clearTimeout(this.timeout)}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],Ne.prototype,"userIds",void 0),Ne=Object(T["__decorate"])([Object(E["b"])({name:"MassMessageSendView",components:{MessageSendWithAttachment:Be["a"]}})],Ne);var qe=Ne,Re=qe,Fe=Object(z["a"])(Re,$e,De,!1,null,null,null),Le=Fe.exports,Ve=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){var e;return Object(S["a"])(this,s),e=t.apply(this,arguments),e.sendMessage=!1,e}return Object(w["a"])(s,[{key:"onContinue",value:function(){1===this.selectedUsersArray.length?this.$router.push({name:"messages",params:{userId:this.selectedUsersArray[0]}}):this.sendMessage=!0}},{key:"selectedCount",get:function(){return this.selectedUsersArray.length}},{key:"selectedUsersArray",get:function(){var e=this,t=[];return Object.keys(this.selectedUsers).forEach((function(s){e.selectedUsers[s]&&t.push(s)})),t}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],Ve.prototype,"loading",void 0),Object(T["__decorate"])([Object(U["e"])({required:!0})],Ve.prototype,"massMessageUsers",void 0),Object(T["__decorate"])([Object(U["e"])({required:!0})],Ve.prototype,"selectedUsers",void 0),Ve=Object(T["__decorate"])([Object(E["b"])({name:"MassMessageView",components:{MassMessageSelectView:Pe,MassMessageSendView:Le,BasePage:_["a"],PageTitle:b["a"]}})],Ve);var ze=Ve,Ge=ze,We=Object(z["a"])(Ge,pe,be,!1,null,null,null),Ye=We.exports,He=function(e){Object(I["a"])(s,e);var t=Object(k["a"])(s);function s(){var e;return Object(S["a"])(this,s),e=t.apply(this,arguments),e.loading=!1,e.selected={},e.messagePrices=[],e.followers=[],e.subscribes=new Map,e}return Object(w["a"])(s,[{key:"onCheck",value:function(e){this.selected=e}},{key:"getAllFollowers",value:function(){var e=Object(r["a"])(i.a.mark((function e(){var t,s,a,r=arguments;return i.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:0,e.next=3,o["a"].FollowingsProvider.find({data:{userId:this.authUserId,page:t,sort:"TIME,DESC",size:1e3}});case 3:if(s=e.sent,!s.hasNextPage){e.next=9;break}return e.next=7,this.getAllFollowers(s.page+1);case 7:a=e.sent,s.result=s.result.concat(a);case 9:return e.abrupt("return",s.result);case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getAllSubscribes",value:function(){var e=Object(r["a"])(i.a.mark((function e(){var t,s,a,r=arguments;return i.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:0,e.next=3,o["a"].SubscriptionProvider.search({data:{providerId:this.authUserId,expired:!1,page:t,size:1e3}});case 3:if(s=e.sent,!s.hasNextPage){e.next=9;break}return e.next=7,this.getAllSubscribes(s.page+1);case 7:a=e.sent,s.result=s.result.concat(a);case 9:return e.abrupt("return",s.result);case 10:case"end":return e.stop()}}),e,this)})));function t(){return e.apply(this,arguments)}return t}()},{key:"getPageData",value:function(){var e=Object(r["a"])(i.a.mark((function e(){var t,s,a,r,n,c,u,l,d;return i.a.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,Promise.all([this.getAllFollowers(),this.getAllSubscribes()]);case 4:if(t=e.sent,s=Object(he["a"])(t,2),a=s[0],r=s[1],!fe["a"].featurePaidSentMessage){e.next=16;break}return n=a.map((function(e){return e.followerId})),c=Object(me["chunk"])(n,1e3),u=c.map((function(e){return o["a"].MessagePricesProvider.find({userIds:e})})),e.next=14,Promise.all(u);case 14:l=e.sent,this.messagePrices=l.flat();case 16:this.followers=a,d=new Map,r.forEach((function(e){return d.set(e.consumerId,e)})),this.subscribes=d;case 20:return e.prev=20,this.loading=!1,e.finish(20);case 23:case"end":return e.stop()}}),e,this,[[0,,20,23]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"created",value:function(){this.getPageData(),c["a"].emit(u["b"].MAIN_MENU_HIDE,{hide:!0})}},{key:"beforeDestroy",value:function(){c["a"].emit(u["b"].MAIN_MENU_HIDE,{hide:!1})}},{key:"massMessageUsers",get:function(){var e=this,t=new Map;return this.messagePrices.forEach((function(e){"0"===e.perSentPriceId&&"0"===e.perSentWithAttachmentPriceId||t.set(e.userId,e.userId)})),this.followers.reduce((function(s,a){return t.has(a.followerId)||s.push({follower:a,subscriber:!!e.subscribes.get(a.followerId)}),s}),[])}}]),s}(C["default"]);Object(T["__decorate"])([Object(U["e"])({required:!0})],He.prototype,"authUserId",void 0),He=Object(T["__decorate"])([Object(E["b"])({name:"MassMessage",components:{MassMessageView:Ye}})],He);var Je=He,Ke=Je,Qe=Object(z["a"])(Ke,de,ge,!1,null,null,null),Xe=Qe.exports,Ze=s("1c22"),et=Object(g["c"])({name:"PageMessageThreads",components:{MassMessage:Xe,MessageThreadsView:le},props:{isMassMessage:{type:Boolean,required:!0}},setup:function(){var e=Object(f["a"])(),t=e.authorities,s=e.authUserStrict,a=Object(Ze["b"])(),r=a.getUserSetting,n=a.setUserSetting;return{authUserAuthorities:t,authUserStrict:s,getUserSetting:r,setUserSetting:n}},data:function(){return{scroll:!1,loading:!1,hasMoreThanOneFollowers:!1,messageThreadsSearchResult:null,userMessageSetting:{}}},computed:{allowMassMessage:function(){return Object(h["checkAuthorities"])(this.authUserAuthorities,["updateMyContentPrice"])&&this.hasMoreThanOneFollowers},messageThreadList:function(){var e,t;return null!==(e=null===(t=this.messageThreadsSearchResult)||void 0===t?void 0:t.result)&&void 0!==e?e:[]},authUserId:function(){return this.authUserStrict.id},sortItemsArray:function(){return[{label:"Most recent",sort:"UPDATED_TIME,DESC"},{label:"Unread",sort:"UPDATED_TIME,DESC",unreadOnly:!0},{label:"Oldest unread",sort:"UPDATED_TIME,ASC",unreadOnly:!0}]}},watch:{isMassMessage:function(e,t){!e&&t&&this.getPageData()}},methods:{getFollowings:function(){var e=this;return Object(r["a"])(i.a.mark((function t(){var s;return i.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,o["a"].FollowingsProvider.find({data:{userId:e.authUserId}});case 2:s=t.sent,e.hasMoreThanOneFollowers=s.totalRecords>1;case 4:case"end":return t.stop()}}),t)})))()},toggleMassMessage:function(e){this.$router.replace({name:"messageThreads",query:{massMessage:e?e+"":void 0}})},getThreads:function(){var e=arguments,t=this;return Object(r["a"])(i.a.mark((function s(){var r,n,c,u,l,d,g;return i.a.wrap((function(s){while(1)switch(s.prev=s.next){case 0:return n=e.length>0&&void 0!==e[0]?e[0]:0,c=!(e.length>1&&void 0!==e[1])||e[1],t.scroll=!1,u=Object(a["a"])({},t.sortItemsArray[(null===(r=t.userMessageSetting)||void 0===r?void 0:r.sort)||J.DEFAULT]),delete u.label,s.prev=5,s.next=8,o["a"].MessageThreadsProvider.find({data:Object(a["a"])({userId:t.authUserStrict.id,page:n,size:20},u)});case 8:l=s.sent,t.messageThreadsSearchResult=Object(a["a"])(Object(a["a"])({},l),{},{result:c||!t.messageThreadsSearchResult?l.result:t.messageThreadsSearchResult.result.concat(l.result)});case 10:return s.prev=10,t.scroll=null!==(d=null===(g=t.messageThreadsSearchResult)||void 0===g?void 0:g.hasNextPage)&&void 0!==d&&d,s.finish(10);case 13:case"end":return s.stop()}}),s,null,[[5,,10,13]])})))()},getPageData:function(){var e=this;return Object(r["a"])(i.a.mark((function t(){return i.a.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,e.loading=!0,t.next=4,Promise.all([e.getUserMessageSetting(),e.getThreads(),e.getFollowings()]);case 4:return t.prev=4,e.loading=!1,t.finish(4);case 7:case"end":return t.stop()}}),t,null,[[0,,4,7]])})))()},onMessage:function(){this.getThreads()},getNextPage:function(e){var t,s,a=(null!==(t=null===(s=this.messageThreadsSearchResult)||void 0===s?void 0:s.page)&&void 0!==t?t:0)+1;this.getThreads(a,!1).finally((function(){return e()}))},getUserMessageSetting:function(){this.userMessageSetting=this.getUserSetting(Ze["a"].MESSAGE_SETTINGS)},saveUserMessageSetting:function(e){this.userMessageSetting=Object(a["a"])(Object(a["a"])({},this.userMessageSetting),e),this.setUserSetting(Ze["a"].MESSAGE_SETTINGS,this.userMessageSetting)}},render:function(e){var t,s=this;return this.isMassMessage?e(Xe,{props:{authUserId:this.authUserId},on:{back:function(){return s.toggleMassMessage(!1)}}}):e(le,{props:{loading:this.loading,authUserId:this.authUserId,allowMassMessage:this.allowMassMessage,messageThreadList:this.messageThreadList,scroll:this.scroll,sortItems:this.sortItemsArray.map((function(e){return e.label})),currentSortItem:(null===(t=this.userMessageSetting)||void 0===t?void 0:t.sort)||J.DEFAULT},on:{sort:function(e){s.saveUserMessageSetting({sort:e}),s.getThreads(0,!0)},massMessage:function(){return s.toggleMassMessage(!0)},next:this.getNextPage}})},created:function(){this.onMessage=Object(me["throttle"])(this.onMessage,3e3,{trailing:!1}),this.getPageData(),c["a"].on(u["b"].MESSAGES_NEW_MESSAGE,this.onMessage),c["a"].on(u["b"].MESSAGES_MARKED_READ,this.onMessage)},beforeDestroy:function(){c["a"].off(u["b"].MESSAGES_NEW_MESSAGE,this.onMessage),c["a"].off(u["b"].MESSAGES_MARKED_READ,this.onMessage)},beforeRouteEnter:function(e,t,s){s((function(e){!e.allowMassMessage&&e.isMassMessage&&e.$router.replace({name:"messageThreads",query:{massMessage:void 0}})}))}})},d5a8:function(e,t,s){"use strict";var a=s("d4ec"),r=s("262e"),n=s("2caf"),i=s("9ab4"),c=s("2fe1"),o=s("2b0e"),u=s("60a3"),l=function(e){Object(r["a"])(s,e);var t=Object(n["a"])(s);function s(){return Object(a["a"])(this,s),t.apply(this,arguments)}return s}(o["default"]);Object(i["__decorate"])([Object(u["e"])({required:!0})],l.prototype,"message",void 0),Object(i["__decorate"])([Object(u["e"])({type:String,required:!0})],l.prototype,"authUserId",void 0),l=Object(i["__decorate"])([Object(c["b"])({name:"MessagePreviewMixin"})],l),t["a"]=l},d726:function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"message-preview"},[e.opponentMessage?e._e():s("span",{staticClass:"message-preview__author"},[e._v(e._s(e.$t("You"))+": ")]),s("span",{class:{link:e.isAttachmentOnly}},[e._v(e._s(e.text))])])},r=[],n=(s("498a"),s("d4ec")),i=s("bee2"),c=s("262e"),o=s("2caf"),u=s("9ab4"),l=s("2fe1"),d=s("392c"),g=s("78f9"),h=s("bc5a"),m=s("d5a8"),f=function(e){Object(c["a"])(s,e);var t=Object(o["a"])(s);function s(){return Object(n["a"])(this,s),t.apply(this,arguments)}return Object(i["a"])(s,[{key:"opponentMessage",get:function(){return this.message.senderId!==this.authUserId}},{key:"isAttachmentOnly",get:function(){return""===this.message.text.trim()&&this.message.attachment}},{key:"text",get:function(){var e=this.message,t=e.text.trim();if(e.attachment&&""===t){if(this.isImage)return Object(g["a"])("Photo");if(this.isVideo)return Object(g["a"])("Video")}return Object(d["isCallMessageDetails"])(e.details)?Object(g["a"])("Call"):t}},{key:"isImage",get:function(){return Object(h["f"])(this.message.attachment[0].file)}},{key:"isVideo",get:function(){return Object(h["i"])(this.message.attachment[0].file)}}]),s}(Object(l["c"])(m["a"]));f=Object(u["__decorate"])([Object(l["b"])({name:"MessagePreview"})],f);var p=f,b=p,v=s("2877"),_=Object(v["a"])(b,a,r,!1,null,null,null);t["default"]=_.exports},d836:function(e,t,s){"use strict";s("c604")},dbd3:function(e,t,s){var a={"./MessagePreview.vue":"d726","./MessagePreviewCall.vue":"1d48","./MessagePreviewTip.vue":"420c"};function r(e){var t=n(e);return s(t)}function n(e){if(!s.o(a,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return a[e]}r.keys=function(){return Object.keys(a)},r.resolve=n,e.exports=r,r.id="dbd3"},eb2f:function(e,t,s){}}]);