(window.webpackJsonp=window.webpackJsonp||[]).push([[207],{1129:function(t,e,n){var content=n(1372);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("1c718a7f",content,!0,{sourceMap:!1})},1130:function(t,e,n){var content=n(1374);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("2389c931",content,!0,{sourceMap:!1})},1371:function(t,e,n){"use strict";var o=n(1129);n.n(o).a},1372:function(t,e,n){(e=n(8)(!1)).push([t.i,".m-pickUserItem[data-v-7af4da9d]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.m-pickUserItem__avatar[data-v-7af4da9d]{-webkit-box-flex:0;flex:0 0 auto;margin-right:8px}.m-pickUserItem__name[data-v-7af4da9d]{margin-right:16px;font-weight:700;font-size:14px;word-break:break-all}.m-pickUserItem__delete[data-v-7af4da9d]{margin-left:auto;color:#a8abb1;cursor:pointer}@media only screen and (min-width:769px){.m-pickUserItem__delete[data-v-7af4da9d]{-webkit-transition:color .2s cubic-bezier(1,0,0,1);transition:color .2s cubic-bezier(1,0,0,1)}.m-pickUserItem__delete[data-v-7af4da9d]:hover{color:#787c7b}}",""]),t.exports=e},1373:function(t,e,n){"use strict";var o=n(1130);n.n(o).a},1374:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-userPick[data-v-b03a2baa]{position:relative}.o-userPick__dropdown[data-v-b03a2baa]{position:relative;z-index:2;width:100%;max-height:300px;margin-top:-4px;overflow-y:auto;background:#fff;border:1px solid #a8abb1;border-top:none;border-radius:0 0 4px 4px}.o-userPick__item+.o-userPick__item[data-v-b03a2baa]{border-top:1px solid #f2f2f2}.o-userPick__itemLink[data-v-b03a2baa]{display:-webkit-box;display:flex;padding:16px}.o-userPick__itemAvatar[data-v-b03a2baa]{-webkit-box-flex:0;flex:0 0 auto;margin-right:8px}.o-userPick__itemName[data-v-b03a2baa]{font-weight:700;font-size:14px}.o-userPick__itemUrl[data-v-b03a2baa]{font-size:12px;line-height:1;color:#787c7b}.o-userPick__selected[data-v-b03a2baa]{padding:16px;margin-top:8px;background-color:#f7f9f9;border-radius:4px}.o-userPick__selectedItem+.o-userPick__selectedItem[data-v-b03a2baa]{margin-top:16px}",""]),t.exports=e},1390:function(t,e,n){"use strict";n(162);var o=n(0),r=n(1),d=n(393),l=n(110),c=n(861),m=n(115),_=n(19),v=n(82),h=n(16),f=r.default.extend({components:{Avatar:l.a,NtIcon:h.c},props:{user:{type:Object,required:!0}}}),x=(n(1371),n(4)),k=Object(x.a)(f,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-pickUserItem"},[n("div",{staticClass:"m-pickUserItem__avatar"},[n("avatar",{attrs:{src:t.user.profileImageUrl,size:"medium"}})],1),t._v(" "),n("div",{staticClass:"m-pickUserItem__name"},[t._v("\n "+t._s(t.user.nickname||t.user.urlname)+"\n ")]),t._v(" "),n("div",{staticClass:"m-pickUserItem__delete"},[n("nt-icon",{attrs:{clickable:!1,type:"close",size:"medium"},nativeOn:{click:function(e){return t.$emit("remove")}}})],1)])}),[],!1,null,"7af4da9d",null).exports,z=r.default.extend({components:{Avatar:l.a,InfiniteScroll:c.a,NtInput:m.a,NtLink:_.a,NtLoadingDots:v.a,PickedItem:k},props:{pickedList:{type:Array,required:!0,default:()=>[]},alreadyPickedUserIds:{type:Array,default:()=>[]},isMagazineMember:{type:Boolean,default:!1}},data:()=>({searchText:"",suggests:[],composing:!1}),methods:{removeItem(t){this.$emit("remove",t)},addItem(t){this.$emit("add",t),this.suggests=[],this.searchText=""},compositionstart(){this.composing=!0},compositionend(){this.composing=!1},handleInputChange:Object(d.a)((function(){this.inputChange()}),300),inputChange(){var t=this;return Object(o.a)((function*(){t.composing||t.searching||(t.searchText?(t.searching=!0,t.isLastPage=!1,t.cursor="initial",yield t.search(),t.searching=!1):t.suggests=[])}))()},infiniteHandler(t){var e=this;return Object(o.a)((function*(){e.isLastPage?t.complete():(yield e.search(),t.loaded())}))()},search(){var t=this;return Object(o.a)((function*(){var e={params:{context:"user",q:t.searchText,size:20,cursor:JSON.stringify({user:t.cursor}),mode:t.isMagazineMember?"magazine-member":null}},n=yield t.$axios.$get("/v2/searches",e).catch(()=>null);n&&("initial"===t.cursor&&(t.suggests=[]),t.cursor=n.data.cursor.user,n.data.users.contents.length<1&&(t.isLastPage=!0),t.$nextTick(()=>{n.data.users.contents.filter(e=>!t.isJustPicked(e.id)&&!t.isAlreadyPicked(e.id)).forEach(e=>{e.userProfileImagePath=e.profileImageUrl,t.suggests.push(e)})}))}))()},isJustPicked(t){return this.pickedList.some(e=>e.id===t)},isAlreadyPicked(t){return this.alreadyPickedUserIds.includes(t)}}}),I=(n(1373),Object(x.a)(z,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"o-userPick"},[n("div",{staticClass:"o-userPick__field"},[n("nt-input",{attrs:{type:"text",placeholder:"クリエイター名(noteで表示される名前) or note ID を入力",width:"fit"},on:{input:t.handleInputChange},nativeOn:{compositionend:function(e){return t.compositionend(e)},compositionstart:function(e){return t.compositionstart(e)}},model:{value:t.searchText,callback:function(e){t.searchText="string"==typeof e?e.trim():e},expression:"searchText"}})],1),t._v(" "),t.suggests.length>0?n("div",{ref:"suggest",staticClass:"o-userPick__dropdown"},[t._l(t.suggests,(function(e){return n("div",{key:e.id,staticClass:"o-userPick__item"},[n("nt-link",{staticClass:"o-userPick__itemLink",nativeOn:{click:function(n){return t.addItem(e)}}},[n("div",{staticClass:"o-userPick__itemAvatar"},[n("avatar",{attrs:{src:e.profileImageUrl,size:"small"}})],1),t._v(" "),n("div",{staticClass:"o-userPick__itemBody"},[n("div",{staticClass:"o-userPick__itemName"},[t._v("\n "+t._s(e.nickname)+"\n ")]),t._v(" "),n("div",{staticClass:"o-userPick__itemUrl"},[t._v("\n "+t._s(e.urlname)+"\n ")])])])],1)})),t._v(" "),n("infinite-scroll",{attrs:{"scroller-ref":"suggest",distance:300},on:{infinite:t.infiniteHandler}},[n("nt-loading-dots",{attrs:{slot:"loading"},slot:"loading"})],1)],2):t._e(),t._v(" "),t.pickedList.length>0?n("div",{staticClass:"o-userPick__selected"},t._l(t.pickedList,(function(e){return n("div",{key:e.id,staticClass:"o-userPick__selectedItem"},[n("picked-item",{attrs:{user:e},on:{remove:function(n){return t.removeItem(e.id)}}})],1)})),0):t._e()])}),[],!1,null,"b03a2baa",null));e.a=I.exports},1811:function(t,e,n){var content=n(2489);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("303c9b1b",content,!0,{sourceMap:!1})},1812:function(t,e,n){var content=n(2491);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("f1e66668",content,!0,{sourceMap:!1})},1813:function(t,e,n){var content=n(2493);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("74b92263",content,!0,{sourceMap:!1})},1814:function(t,e,n){var content=n(2495);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("a079b8ca",content,!0,{sourceMap:!1})},1815:function(t,e,n){var content=n(2497);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("614db213",content,!0,{sourceMap:!1})},1816:function(t,e,n){var content=n(2499);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("2752ca82",content,!0,{sourceMap:!1})},1817:function(t,e,n){var content=n(2501);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("eac0b684",content,!0,{sourceMap:!1})},1818:function(t,e,n){var content=n(2503);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("14486836",content,!0,{sourceMap:!1})},2488:function(t,e,n){"use strict";var o=n(1811);n.n(o).a},2489:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineLeave__body[data-v-1346ec00]{padding:40px;text-align:center}@media only screen and (max-width:479px){.o-magazineLeave__body[data-v-1346ec00]{padding:24px}}.o-magazineLeave__name[data-v-1346ec00]{font-weight:700}.o-magazineLeave__alert[data-v-1346ec00]{margin-top:16px;font-weight:700;color:#f95;font-size:14px}",""]),t.exports=e},2490:function(t,e,n){"use strict";var o=n(1812);n.n(o).a},2491:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineDeactivate__body[data-v-574a7845]{padding:40px;text-align:center}@media only screen and (max-width:479px){.o-magazineDeactivate__body[data-v-574a7845]{padding:24px}}.o-magazineDeactivate__name[data-v-574a7845]{font-weight:700}.o-magazineDeactivate__alert[data-v-574a7845]{margin-top:16px;font-weight:700;color:#f95;font-size:14px}",""]),t.exports=e},2492:function(t,e,n){"use strict";var o=n(1813);n.n(o).a},2493:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineAuthority__body[data-v-915ae3f6]{padding:40px;text-align:center}@media only screen and (max-width:479px){.o-magazineAuthority__body[data-v-915ae3f6]{padding:24px}}.o-magazineAuthority__name[data-v-915ae3f6]{font-weight:700}",""]),t.exports=e},2494:function(t,e,n){"use strict";var o=n(1814);n.n(o).a},2495:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineResendInvitation__body[data-v-3ec37e3c]{padding:40px;text-align:center}@media only screen and (max-width:479px){.o-magazineResendInvitation__body[data-v-3ec37e3c]{padding:24px}}.o-magazineResendInvitation__name[data-v-3ec37e3c]{font-weight:700}",""]),t.exports=e},2496:function(t,e,n){"use strict";var o=n(1815);n.n(o).a},2497:function(t,e,n){(e=n(8)(!1)).push([t.i,".m-magazineDistributeItem[data-v-1b1d7e8a]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center}.m-magazineDistributeItem__avatar[data-v-1b1d7e8a]{-webkit-box-flex:0;flex:0 0 auto;margin-right:8px}.m-magazineDistributeItem__body[data-v-1b1d7e8a]{margin-right:16px}.m-magazineDistributeItem__name[data-v-1b1d7e8a]{font-weight:700;word-break:break-all;font-size:14px}.m-magazineDistributeItem__role[data-v-1b1d7e8a]{font-size:12px;line-height:1;color:#787c7b}.m-magazineDistributeItem__number[data-v-1b1d7e8a]{display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;margin-left:auto}.m-magazineDistributeItem__numberField[data-v-1b1d7e8a]{margin-right:8px}.m-magazineDistributeItem__numberFixed[data-v-1b1d7e8a]{font-size:16px;margin-right:8px;margin-left:8ex;font-weight:700}.m-magazineDistributeItem__numberRatio[data-v-1b1d7e8a]{font-size:14px}",""]),t.exports=e},2498:function(t,e,n){"use strict";var o=n(1816);n.n(o).a},2499:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineDistribute__body[data-v-70185e1e]{padding:24px}@media only screen and (max-width:479px){.o-magazineDistribute__body[data-v-70185e1e]{padding:16px}}.o-magazineDistribute__item+.o-magazineDistribute__item[data-v-70185e1e]{padding-top:8px;margin-top:8px;border-top:1px solid #f2f2f2}.o-magazineDistribute__error[data-v-70185e1e]{margin-top:16px;font-weight:700;color:#ed4956;font-size:14px}",""]),t.exports=e},2500:function(t,e,n){"use strict";var o=n(1817);n.n(o).a},2501:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineDistributeConfirm__body[data-v-43e1a82e]{padding:24px}@media only screen and (max-width:479px){.o-magazineDistributeConfirm__body[data-v-43e1a82e]{padding:16px}}.o-magazineDistributeConfirm__item+.o-magazineDistributeConfirm__item[data-v-43e1a82e]{padding-top:8px;margin-top:8px;border-top:1px solid #f2f2f2}",""]),t.exports=e},2502:function(t,e,n){"use strict";var o=n(1818);n.n(o).a},2503:function(t,e,n){(e=n(8)(!1)).push([t.i,".o-magazineUserpick__body[data-v-1a117573]{padding:24px}@media only screen and (max-width:479px){.o-magazineUserpick__body[data-v-1a117573]{padding:16px}}.o-magazineUserpick__premium[data-v-1a117573]{padding:24px;margin-top:16px;text-align:center;background-color:#f7f9f9;border:1px solid #f2f2f2;border-radius:4px}@media only screen and (max-width:479px){.o-magazineUserpick__premium[data-v-1a117573]{text-align:left}}.o-magazineUserpick__premiumTitle[data-v-1a117573]{font-size:14px;margin-bottom:8px;font-weight:700}.o-magazineUserpick__premiumDescription[data-v-1a117573]{font-size:12px}.o-magazineUserpick__premiumButton[data-v-1a117573]{margin-top:16px}.o-magazineUserpick__limit[data-v-1a117573]{margin-top:16px;font-weight:700;color:#ed4956;text-align:center;font-size:14px}",""]),t.exports=e},2971:function(t,e,n){"use strict";n.r(e);var o=n(1),r=n(0),d=n(30),l=n(399),c=n(314),m=n(28),_=n(46),v=n(160),h=n(38),f=n(22),x=o.default.extend({components:{BasicModalContent:_.a,ModalFooterButtonGroup:v.a,NtModal:h.a,NtButton:f.a},mixins:[c.a,m.a],data:()=>({processing:!1}),computed:{disableSubmit(){return this.processing}}}),k=n(4),z=Object(k.a)(x,void 0,void 0,!1,null,null,null).exports,I=o.default.extend({extends:z,computed:Object.assign({},Object(d.e)(l.moduleName,["magazine"])),methods:{submit(){var t=this;return Object(r.a)((function*(){if(!t.disableSubmit){t.processing=!0;try{yield t.$axios.$put("/v1/our/magazines/".concat(t.magazine.key,"/editors/leave"));var e="「".concat(t.magazine.name,"」から脱退しました。");t.replaceAnyMessageModal({message:e,closeCallback:()=>t.redirectToMagazineTop()})}catch(e){var n=t.toApiErrorMessage(e.response);t.replaceAnyMessageModal({message:n})}t.processing=!1}}))()},redirectToMagazineTop(){this.popModal();var path=this.$path.contentPath({contentType:"magazine",content:this.magazine});window.location.href=path}}}),y=(n(2488),Object(k.a)(I,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.magazine?n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineEditorLeave"}},[n("basic-modal-content",{staticClass:"o-magazineLeave"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 運営メンバーから脱退\n ")]),t._v(" "),n("div",{staticClass:"o-magazineLeave__body",attrs:{slot:"body"},slot:"body"},[n("span",{staticClass:"o-magazineLeave__name"},[t._v(t._s(t.magazine.name))]),t._v("から脱退しますか?\n "),n("div",{staticClass:"o-magazineLeave__alert"},[t._v("\n 追加した記事はマガジンから削除されません。\n ")])]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.popModal()}}},[t._v("\n キャンセル\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"danger"},on:{click:function(e){return t.submit()}}},[t._v("\n 脱退\n ")])]}}],null,!1,268222015)})],1)],1):t._e()}),[],!1,null,"1346ec00",null).exports),E=o.default.extend({extends:z,computed:Object.assign(Object.assign({},Object(d.e)(l.moduleName,["magazine"])),{name(){return this.editor.user.nickname||this.editor.user.urlname},editor(){return this.$store.state.modal.magazineEditModalContainer.editor}}),methods:{submit(){var t=this;return Object(r.a)((function*(){if(!t.disableSubmit){t.processing=!0;try{yield t.$axios.$delete("/v1/our/magazines/".concat(t.magazine.key,"/editors/").concat(t.editor.userId)),t.$store.dispatch(l.MAGAZINE_EDIT_ACTION_TYPES.GET_EDITORS);t.replaceAnyMessageModal({message:"運営メンバーの削除が完了しました。"})}catch(n){var e=t.toApiErrorMessage(n.response);t.replaceAnyMessageModal({message:e})}t.processing=!1}}))()}}}),M=(n(2490),Object(k.a)(E,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.editor?n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineEditorDeactivate"}},[n("basic-modal-content",{staticClass:"o-magazineDeactivate"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 運営メンバーの削除\n ")]),t._v(" "),n("div",{attrs:{slot:"body"},slot:"body"},[n("div",{staticClass:"o-magazineDeactivate__body"},[n("span",{staticClass:"o-magazineDeactivate__name"},[t._v(t._s(t.name))]),t._v("さんを運営メンバーから削除しますか?\n "),n("div",{staticClass:"o-magazineDeactivate__alert"},[t._v("\n "+t._s(t.name)+"さんの追加した記事はマガジンから削除されません。\n ")])])]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.popModal()}}},[t._v("\n キャンセル\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"danger"},on:{click:function(e){return t.submit()}}},[t._v("\n 削除\n ")])]}}],null,!1,920303712)})],1)],1):t._e()}),[],!1,null,"574a7845",null).exports),C=o.default.extend({extends:z,computed:Object.assign(Object.assign({},Object(d.e)(l.moduleName,["magazine"])),{name(){return this.editor.user.nickname||this.editor.user.urlname},editor(){return this.$store.state.modal.magazineEditModalContainer.editor},role(){return this.$store.state.modal.magazineEditModalContainer.role},oldRole(){return this.editorRoleLabel(this.editor.role)},newRole(){return this.editorRoleLabel(this.role)}}),methods:{editorRoleLabel:t=>"admin"===t?"管理者":"member"===t?"メンバー":"",submit(){var t=this;return Object(r.a)((function*(){if(!t.disableSubmit){t.processing=!0;try{var e={role:t.role};yield t.$axios.$put("/v1/our/magazines/".concat(t.magazine.key,"/editors/").concat(t.editor.userId,"/rolify"),e),t.$store.dispatch(l.MAGAZINE_EDIT_ACTION_TYPES.GET_EDITORS);var n="".concat(t.editorRoleLabel(t.role),"にしました。");t.replaceAnyMessageModal({message:n})}catch(e){var o=t.toApiErrorMessage(e.response);t.replaceAnyMessageModal({message:o})}t.processing=!1}}))()}}}),T=(n(2492),Object(k.a)(C,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.editor?n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineEditorAuthority"}},[n("basic-modal-content",{staticClass:"o-magazineAuthority"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 権限の変更\n ")]),t._v(" "),n("div",{staticClass:"o-magazineAuthority__body",attrs:{slot:"body"},slot:"body"},[n("span",{staticClass:"o-magazineAuthority__name"},[t._v("\n "+t._s(t.name)+"\n ")]),t._v("\n さんを"+t._s(t.oldRole)+"から"+t._s(t.newRole)+"にしますか?\n ")]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.popModal()}}},[t._v("\n キャンセル\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("\n 変更\n ")])]}}],null,!1,3557970884)})],1)],1):t._e()}),[],!1,null,"915ae3f6",null).exports),P=o.default.extend({extends:z,computed:Object.assign(Object.assign({},Object(d.e)(l.moduleName,["magazine"])),{name(){return this.editor.user.nickname||this.editor.user.urlname},editor(){return this.$store.state.modal.magazineEditModalContainer.editor}}),methods:{submit(){var t=this;return Object(r.a)((function*(){if(!t.disableSubmit){t.processing=!0;try{var e={user_ids:[t.editor.userId]};yield t.$axios.$post("/v1/our/magazines/".concat(t.magazine.key,"/editors/invite"),e);t.replaceAnyMessageModal({message:"承認メールを再送しました。"})}catch(e){var n=t.toApiErrorMessage(e.response);t.replaceAnyMessageModal({message:n})}t.processing=!1}}))()}}}),D=(n(2494),Object(k.a)(P,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.editor?n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineResendInvitation"}},[n("basic-modal-content",{staticClass:"o-magazineResendInvitation"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 承認メールの再送信\n ")]),t._v(" "),n("div",{staticClass:"o-magazineResendInvitation__body",attrs:{slot:"body"},slot:"body"},[n("span",{staticClass:"o-magazineResendInvitation__name"},[t._v(t._s(t.name))]),t._v("さんに承認メールを再送信しますか?\n ")]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.popModal()}}},[t._v("\n キャンセル\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.submit()}}},[t._v("\n 再送信\n ")])]}}],null,!1,3117410132)})],1)],1):t._e()}),[],!1,null,"3ec37e3c",null).exports),O=(n(11),n(32)),A=n(854),R=n(7),w=n(110),N=n(115),S={components:{Avatar:w.a,NtInput:N.a},props:{editor:{type:Object,required:!0},isEdit:{type:Boolean,default:!1}}},$=(n(2496),Object(k.a)(S,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"m-magazineDistributeItem"},[n("div",{staticClass:"m-magazineDistributeItem__avatar"},[n("avatar",{attrs:{src:t.editor.user.userProfileImagePath,size:"medium"}})],1),t._v(" "),n("div",{staticClass:"m-magazineDistributeItem__body"},[n("div",{staticClass:"m-magazineDistributeItem__name"},[t._v("\n "+t._s(t.editor.user.nickname||t.editor.user.urlname)+"\n ")]),t._v(" "),n("div",{staticClass:"m-magazineDistributeItem__role"},["root"===t.editor.role?[t._v("\n オーナー\n ")]:"admin"===t.editor.role?[t._v("\n 管理者\n ")]:"member"===t.editor.role?[t._v("\n メンバー\n ")]:t._e()],2)]),t._v(" "),n("div",{staticClass:"m-magazineDistributeItem__number"},[t.isEdit?n("div",{staticClass:"m-magazineDistributeItem__numberField"},[n("nt-input",{attrs:{value:t.editor.distributionRatio,max:100,min:0,type:"number"},on:{input:function(e){return t.$emit("change",e)}}})],1):n("div",{staticClass:"m-magazineDistributeItem__numberFixed"},[t._v("\n "+t._s(t.editor.distributionRatio)+"\n ")]),t._v(" "),n("div",{staticClass:"m-magazineDistributeItem__numberRatio"},[t._v("\n %\n ")])])])}),[],!1,null,"1b1d7e8a",null).exports),L=O.helpers.regex("ratioPattern",/(^0$|^[1-9][0-9]*$)/),j=o.default.extend({components:{BasicModalContent:_.a,MagazineDistributeListItem:$,ModalFooterButtonGroup:v.a,NtButton:f.a,NtModal:h.a},mixins:[m.a],computed:Object.assign(Object.assign(Object.assign({},Object(d.e)(l.moduleName,["editorsToDistribute","isInvite"])),Object(d.c)({isPickWithRatio:l.MAGAZINE_EDIT_GETTER_TYPES.IS_PICK_WITH_RATIO})),{editors(){return this.editorsToDistribute},disableSubmit(){return this.$v.$invalid||!this.isValidRatio},isValidRatio(){return 100===this.editors.reduce((t,e)=>t+e.distributionRatio,0)}}),validations:()=>({editors:{$each:{distributionRatio:{required:O.required,pattern:L,minValue:Object(O.minValue)(0),maxValue:Object(O.maxValue)(100)}}}}),methods:{confirm(){this.popModal(),this.pushMagazineDistributeConfirmModal()},handleChange(t,e){this.$store.dispatch(l.MAGAZINE_EDIT_ACTION_TYPES.UPDATE_EDITORS_TO_DISTRIBUTE,{ratio:t,editor:e})},hasError(t){var e=this.$v.editors.$each.$iter;return!!Object(A.a)(e)||Object.keys(e).some(n=>!1===e[n].distributionRatio[t])},back(){this.$store.dispatch(R.MODAL_ACTION_TYPES.SET_MAGAZINE_EDIT_MODAL_CONTAINER,{isBack:!0}),this.popModal(),this.pushMagazineUserPickModal()}}}),U=(n(2498),Object(k.a)(j,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineDistribute"}},[n("basic-modal-content",{staticClass:"o-magazineDistribute"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 分配率の変更\n ")]),t._v(" "),n("div",{staticClass:"o-magazineDistribute__body",attrs:{slot:"body"},slot:"body"},[n("div",{staticClass:"o-magazineDistribute__list"},t._l(t.$v.editors.$model,(function(e,i){return n("div",{key:i,staticClass:"o-magazineDistribute__item"},[n("magazine-distribute-list-item",{attrs:{"is-edit":!0,editor:e},on:{change:function(n){return t.handleChange(n,e)}}})],1)})),0),t._v(" "),t.$v.editors.$invalid||!t.isValidRatio?n("div",{staticClass:"o-magazineDistribute__error"},[t.hasError("required")?n("div",[t._v("\n 分配率を入力してください。\n ")]):t._e(),t._v(" "),t.hasError("minValue")||t.hasError("maxValue")||t.hasError("pattern")?n("div",[t._v("\n 分配率は0〜100の範囲の整数で設定してください。\n ")]):t._e(),t._v(" "),t.isValidRatio?t._e():n("div",[t._v("\n 分配率の合計が100になるように設定してください。\n ")])]):t._e()]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){t.isPickWithRatio&&t.isInvite?t.back():t.popModal()}}},[t._v("\n "+t._s(t.isPickWithRatio&&t.isInvite?"戻る":"キャンセル")+"\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.confirm()}}},[t._v("\n 確認\n ")])]}}])})],1)],1)}),[],!1,null,"70185e1e",null).exports),B=o.default.extend({components:{BasicModalContent:_.a,ModalFooterButtonGroup:v.a,NtButton:f.a,NtModal:h.a},mixins:[c.a,m.a],data:()=>({processing:!1}),computed:{disableSubmit(){return this.processing}},methods:{setRatio(){var t={};for(var e of this.editorsToDistribute)t[e.userId]=e.distributionRatio;return t},complete(){var t=this;return Object(r.a)((function*(){if(!t.disableSubmit){if(t.processing=!0,t.isInvite){var e={user_ids:t.pickedList.map(t=>t.id),ratios:null};t.isPickWithRatio&&(e.ratios=t.setRatio());try{yield t.$axios.post("/v1/our/magazines/".concat(t.magazine.key,"/editors/invite"),e),t.$store.dispatch(l.MAGAZINE_EDIT_ACTION_TYPES.GET_EDITORS);var n=t.invitablePrice>0&&!t.isPickWithRatio?"".concat("招待するクリエイターに確認メールが送信されました。","
追加したクリエイターへの収益分配率は初期値では0%になっているので分配率の設定をオーナーに依頼してください。"):"招待するクリエイターに確認メールが送信されました。",o=t.invitablePrice>0&&!t.magazine.isJointlyManaged?()=>window.location.reload():null;t.replaceAnyMessageModal({message:n,closeCallback:o})}catch(e){var r=t.toApiErrorMessage(e.response);t.replaceAnyMessageModal({message:r})}}else{var d={ratios:t.setRatio()};try{yield t.$axios.put("/v1/our/magazines/".concat(t.magazine.key,"/editors/update_ratio"),d),t.$store.dispatch(l.MAGAZINE_EDIT_ACTION_TYPES.GET_EDITORS);t.replaceAnyMessageModal({message:"分配率の変更が完了しました。"})}catch(e){var c=t.toApiErrorMessage(e.response);t.replaceAnyMessageModal({message:c})}}t.processing=!1}}))()}}}),G=Object(k.a)(B,void 0,void 0,!1,null,null,null).exports,Y=o.default.extend({components:{MagazineDistributeListItem:$},extends:G,computed:Object.assign(Object.assign({},Object(d.e)(l.moduleName,["magazine","editorsToDistribute","pickedList","isInvite"])),Object(d.c)({invitablePrice:l.MAGAZINE_EDIT_GETTER_TYPES.INVITABLE_PRICE,isPickWithRatio:l.MAGAZINE_EDIT_GETTER_TYPES.IS_PICK_WITH_RATIO})),methods:{back(){this.popModal(),this.pushMagazineDistributeModal()}}}),Z=(n(2500),Object(k.a)(Y,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineDistributeConfirm"}},[n("basic-modal-content",{staticClass:"o-magazineDistributeConfirm"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 分配率の確認\n ")]),t._v(" "),n("div",{staticClass:"o-magazineDistributeConfirm__body",attrs:{slot:"body"},slot:"body"},[n("div",{staticClass:"o-magazineDistributeConfirm__list"},t._l(t.editorsToDistribute,(function(t,i){return n("div",{key:i,staticClass:"o-magazineDistributeConfirm__item"},[n("magazine-distribute-list-item",{attrs:{editor:t}})],1)})),0)]),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.back()}}},[t._v("\n 戻る\n ")]),t._v(" "),n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.complete()}}},[t._v("\n "+t._s(t.isPickWithRatio&&t.isInvite?"招待を送信":"更新")+"\n ")])]}}])})],1)],1)}),[],!1,null,"43e1a82e",null).exports),W=n(19),F=n(1390),V=o.default.extend({components:{NtLink:W.a,UserPick:F.a},extends:G,computed:Object.assign(Object.assign(Object.assign({},Object(d.e)(l.moduleName,["magazine","currentEditor","editors","editorsToDistribute","pickedList","isInvite"])),Object(d.c)({invitablePrice:l.MAGAZINE_EDIT_GETTER_TYPES.INVITABLE_PRICE,isPickWithRatio:l.MAGAZINE_EDIT_GETTER_TYPES.IS_PICK_WITH_RATIO,remainingToInvite:l.MAGAZINE_EDIT_GETTER_TYPES.REMAINING_TO_INVITE})),{role(){return this.currentEditor.editorRole},isPremium(){return this.currentEditor.hasAuthorityJointlyManagedMagazine},max(){return this.remainingToInvite},alreadyPickedUserIds(){return this.editors.map(t=>t.userId)},showMessage(){return this.pickedList.length&&this.pickedList.length>this.max},showPremiumAppeal(){return"root"===this.role&&!this.isPremium},showRemainingInvite(){return this.invitablePrice>0&&("root"===this.role&&this.isPremium||"root"!==this.role)},showNextButton(){return this.isPickWithRatio&&this.pickedList.length&&this.pickedList.length<=this.max},showInviteButtonForPremium(){return!this.isPickWithRatio&&this.pickedList.length&&(0===this.invitablePrice||this.pickedList.length<=this.max)},showButtonForPremium(){return!this.pickedList.length||this.pickedList.length&&this.invitablePrice>0&&this.pickedList.length>this.max},showInviteButtonForNotPremium(){return!this.isPickWithRatio&&this.pickedList.length&&this.pickedList.length<=this.max},showButtonForNotPremium(){return!this.pickedList.length||this.pickedList.length&&this.pickedList.length>this.max}}),methods:Object.assign(Object.assign({},Object(d.b)({addPickedList:l.MAGAZINE_EDIT_ACTION_TYPES.ADD_PICKED_LIST,removePickedList:l.MAGAZINE_EDIT_ACTION_TYPES.REMOVE_PICKED_LIST,resetPickedList:l.MAGAZINE_EDIT_ACTION_TYPES.RESET_PICKED_LIST,setEditorsToDistribute:l.MAGAZINE_EDIT_ACTION_TYPES.SET_EDITORS_TO_DISTRIBUTE})),{init(){this.$store.state.modal.magazineEditModalContainer.isBack?this.$store.dispatch(R.MODAL_ACTION_TYPES.SET_MAGAZINE_EDIT_MODAL_CONTAINER,{isBack:!1}):this.resetPickedList()},proceed(){var t=this.pickedList.map(t=>({role:"member",userId:t.id,distributionRatio:0,user:t})),e=this.editors.concat(t);this.setEditorsToDistribute(e),this.popModal(),this.pushMagazineDistributeModal()}})}),J=(n(2502),Object(k.a)(V,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("nt-modal",{attrs:{"disable-backdrop":!0,name:"magazineUserPick"},on:{"before-open":function(e){return t.init()}}},[n("basic-modal-content",{staticClass:"o-magazineUserpick"},[n("div",{attrs:{slot:"header"},slot:"header"},[t._v("\n 運営メンバーに招待\n ")]),t._v(" "),n("div",{staticClass:"o-magazineUserpick__body",attrs:{slot:"body"},slot:"body"},[n("user-pick",{attrs:{"picked-list":t.pickedList,"already-picked-user-ids":t.alreadyPickedUserIds,"is-magazine-member":!0},on:{add:t.addPickedList,remove:t.removePickedList}}),t._v(" "),t.showMessage?[t.showPremiumAppeal?n("div",{staticClass:"o-magazineUserpick__premium"},[n("div",{staticClass:"o-magazineUserpick__premiumTitle"},[t._v("\n 無料会員が招待できるクリエイターは100名までです。\n ")]),t._v(" "),n("div",{staticClass:"o-magazineUserpick__premiumDescription"},[t._v("\n noteプレミアムに登録して、クリエイターを招待しましょう!\n ")]),t._v(" "),n("nt-link",{staticClass:"o-magazineUserpick__premiumButton",attrs:{href:"/premium",target:"_blank","is-button-link":!0,"button-type":"primary","button-size":"small"}},[t._v("\n noteプレミアムに登録\n ")])],1):t._e(),t._v(" "),t.showRemainingInvite?n("div",{staticClass:"o-magazineUserpick__limit"},[t._v("\n 招待出来る人数はあと"+t._s(t.max)+"名までです。\n ")]):t._e()]:t._e()],2),t._v(" "),n("modal-footer-button-group",{attrs:{slot:"footer"},slot:"footer",scopedSlots:t._u([{key:"default",fn:function(e){return[n("nt-button",{class:e.buttonClass,attrs:{type:"basic",size:"small"},on:{click:function(e){return t.popModal()}}},[t._v("\n キャンセル\n ")]),t._v(" "),t.isPremium?[t.showNextButton?n("nt-button",{class:e.buttonClass,attrs:{size:"small",type:"primary"},on:{click:function(e){return t.proceed()}}},[t._v("\n 分配率変更\n ")]):t.showInviteButtonForPremium?n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.complete()}}},[t._v("\n 招待\n ")]):t.showButtonForPremium?n("nt-button",{class:e.buttonClass,attrs:{disabled:!0,size:"small"}},[t._v("\n "+t._s(t.isPickWithRatio?"次へ":"招待")+"\n ")]):t._e()]:[t.showNextButton?n("nt-button",{class:e.buttonClass,attrs:{size:"small",type:"primary"},on:{click:function(e){return t.proceed()}}},[t._v("\n 分配率変更\n ")]):t.showInviteButtonForNotPremium?n("nt-button",{class:e.buttonClass,attrs:{disabled:t.disableSubmit,size:"small",type:"primary"},on:{click:function(e){return t.complete()}}},[t._v("\n 招待\n ")]):t.showButtonForNotPremium?n("nt-button",{class:e.buttonClass,attrs:{disabled:!0,size:"small"}},[t._v("\n "+t._s(t.isPickWithRatio?"次へ":"招待")+"\n ")]):t._e()]]}}])})],1)],1)}),[],!1,null,"1a117573",null).exports),H=o.default.extend({components:{MagazineEditorLeaveModal:y,MagazineEditorDeactivateModal:M,MagazineEditorAuthorityModal:T,MagazineResendInvitationModal:D,MagazineDistributeModal:U,MagazineDistributeConfirmModal:Z,MagazineUserPickModal:J}}),K=Object(k.a)(H,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",[e("magazine-editor-leave-modal"),this._v(" "),e("magazine-editor-deactivate-modal"),this._v(" "),e("magazine-editor-authority-modal"),this._v(" "),e("magazine-resend-invitation-modal"),this._v(" "),e("magazine-distribute-modal"),this._v(" "),e("magazine-distribute-confirm-modal"),this._v(" "),e("magazine-user-pick-modal")],1)}),[],!1,null,null,null);e.default=K.exports},859:function(t,e,n){var content=n(902);"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(9).default)("d9975e68",content,!0,{sourceMap:!1})},861:function(t,e,n){"use strict";var o=n(1),r=n(114),d=o.default.extend({props:{scrollerRef:{type:String,default:void 0},distance:{type:Number,default:2e3}},data:()=>({loading:!1,nomore:!1,observer:null}),computed:{observerRoot(){if(this.scrollerRef&&this.$parent&&this.$parent.$refs[this.scrollerRef]){var t=this.$parent.$refs[this.scrollerRef];return null!=t?t:null}return null}},mounted(){this.$nextTick(()=>{this.setIntersectionObserver()})},beforeDestroy(){this.removeIntersectionObserver()},methods:{setIntersectionObserver(){if(window.IntersectionObserver){var t={root:this.observerRoot,rootMargin:"".concat(this.distance,"px"),threshold:[0,.5,1]};this.observer=new IntersectionObserver(this.onIntersecting,t);var e=this.$refs.observer;e&&(this.detectIntersecting(e),this.observer.observe(e))}},removeIntersectionObserver(){this.observer&&(this.observer.disconnect(),this.observer=null)},onIntersecting(t,e){t.forEach(t=>{if(t.isIntersecting&&!1===this.loading&&!1===this.nomore){this.emitInfinite();var e=this.$refs.observer;e&&this.detectIntersecting(e)}})},detectIntersecting(t){var rect=Object(r.a)(t);if(rect){var{top:e}=rect;e-this.distance<=window.innerHeight&&!1===this.nomore&&(this.emitInfinite(),setTimeout(()=>{this.detectIntersecting(t)},1e3))}},emitInfinite(){if(!this.loading){this.loading=!0;var t={loaded:()=>{this.loading=!1},complete:()=>{this.loading=!1,this.nomore=!0}};this.$emit("infinite",t)}}}}),l=(n(901),n(4)),component=Object(l.a)(d,(function(){var t=this.$createElement,e=this._self._c||t;return e("div",{ref:"observer",staticClass:"m-infiniteScroll"},[this.loading?this._t("loading"):!1===this.nomore&&!1===this.loading?e("div",{staticClass:"m-infiniteScroll__spacer"}):this._e()],2)}),[],!1,null,"04138d63",null);e.a=component.exports},901:function(t,e,n){"use strict";var o=n(859);n.n(o).a},902:function(t,e,n){(e=n(8)(!1)).push([t.i,".m-infiniteScroll__spacer[data-v-04138d63]{height:1px}",""]),t.exports=e}}]);