| 1 |
- (self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[910],{65803:function(e,t,i){"use strict";i.d(t,{Z:function(){return Z}});var n=function(){var e=this,t=e._self._c;return t("div",[t("DeleteLabelDialog",{attrs:{show:e.visible&&e.action===e.labelActions.DELETE,item:e.item},on:{onOk:e.onOk,onCancel:e.onCancel}}),t("UpdateLabelDialog",{attrs:{isCreate:[e.labelActions.CREATE,e.labelActions.ADDSUB].includes(e.action),isCreatingSublabel:e.action===e.labelActions.ADDSUB,value:e.labelInput,bgColor:e.bgColor,show:e.visible&&e.action!==e.labelActions.DELETE,onValidate:e.onValidateLabelName,customClass:"label-dialog basic-font"},on:{onOk:e.onOk,onCancel:e.onCancel}})],1)},r=[],a=i(70021),l=i(56706),s=i(34948),o=(i(45794),i(71372),i(29648)),c=function(){var e,t=this,i=t._self._c;return i("zm-dialog",{ref:"dialog",attrs:{visible:t.isVisible,title:t.title,"aria-labelledby":"title","close-on-click-modal":!1,customClass:t.customClass,"append-to-body":!0,"close-on-press-escape":!0},on:{"update:visible":function(e){t.isVisible=e}}},[i("div",{staticClass:"label-name"},[t._v(t._s(t.labelName))]),i("div",{staticClass:"dialog-body",on:{keyup:function(e){return e.stopPropagation(),t.handleKeyup.apply(null,arguments)},keydown:function(e){return e.stopPropagation(),t.handleKeydown.apply(null,arguments)},compositionend:t.handleCompositionEnd,compositionstart:t.handleCompositionStart}},[i("zm-input",{attrs:{autofocus:!0,value:t.input,maxlength:t.charactersLimit,label:t.labelName,autocorrect:"off",autocapitalize:"none","zm-ta":"create-label-dialog-input"},on:{input:t.handleInput}}),i("div",{directives:[{name:"show",rawName:"v-show",value:t.errorText,expression:"errorText"}],staticClass:"input-error-text"},[i("SvgIcon",{staticClass:"alert-icon",attrs:{iconClass:"triangle-alert"}}),i("span",[t._v(t._s(t.errorText))])],1)],1),t.showColor?i("div",{staticClass:"label-color"},[i("div",{staticClass:"label-name"},[t._v(t._s(t.selectColor))]),i("div",{staticClass:"label-color-select-panel tab-focus",attrs:{tabindex:"0","aria-label":t.$t("accessibility.labelColorArea")},on:{keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:(e.preventDefault(),e.stopPropagation(),t.focusOnFirst.apply(null,arguments))}]}},t._l(t.LabelColors,(function(e,n){return i("span",{key:e.color,ref:"".concat(n),refInFor:!0,class:["label-color-block tab-focus",{active:e.color===t.currentColor}],style:{background:e.color},attrs:{"aria-label":e.color===t.currentColor?t.$t("accessibility.labelColorSelected",[e.depth,e.label]):t.$t("accessibility.labelColorNotSelected",[e.depth,e.label]),tabindex:"-1","aria-live":"polite"},on:{click:function(){return t.onSelectColor(e.color)},keydown:[function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"up",38,e.key,["Up","ArrowUp"])?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnPrev(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"down",40,e.key,["Down","ArrowDown"])?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnNext(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"left",37,e.key,["Left","ArrowLeft"])||"button"in e&&0!==e.button?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnPrev(n)}.apply(null,arguments))},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"right",39,e.key,["Right","ArrowRight"])||"button"in e&&2!==e.button?null:(e.preventDefault(),e.stopPropagation(),function(){return t.focusOnNext(n)}.apply(null,arguments))},function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"enter",13,i.key,"Enter")?null:function(){return t.onSelectColor(e.color)}.apply(null,arguments)},function(i){return!i.type.indexOf("key")&&t._k(i.keyCode,"space",32,i.key,[" ","Spacebar"])?null:function(){return t.onSelectColor(e.color)}.apply(null,arguments)}]}})})),0)]):t._e(),i("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("zm-button",{attrs:{type:"primary",disabled:t.isInvalidInput||t.confirmed,"zm-ta":"user-label-add-".concat(null===(e=t.primaryActionText)||void 0===e?void 0:e.toLocaleLowerCase())},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.onOk.apply(null,arguments)}}},[t._v(" "+t._s(t.primaryActionText)+" ")]),i("zm-button",{attrs:{"zm-ta":"user-label-add-cancel"},on:{click:function(e){return e.stopPropagation(),e.preventDefault(),t.onCancel.apply(null,arguments)}}},[t._v(" "+t._s(t.$t("common.cancel"))+" ")])],1)])},d=[],u=(i(27072),i(67694),i(86508)),f={name:"UpdateLabelDialog",props:{isCreate:{type:Boolean,default:!1},isCreatingSublabel:{type:Boolean,default:!1},value:{type:String,default:""},bgColor:{type:String,default:""},label:String,show:{type:Boolean,default:!1},onValidate:{type:Function,default:function(){return!0}},customClass:{type:String,default:""}},data:function(){return{input:this.value,errorText:"",isVisible:!1,isComposing:!1,hasCompositionJustEnd:!1,confirmed:!1,isInvalidInput:!1,currentColor:""}},computed:(0,s.Z)((0,s.Z)({},(0,o.Se)(["isZmail","isGmail","isOutlook"])),{},{LabelColors:function(){return u.HM.flat()},charactersLimit:function(){return this.isOutlook?255:225},title:function(e){var t=e.isOutlook,i=e.isCreate,n=e.isCreatingSublabel;return t?i?n?this.$t("label.addSubfolder"):this.$t("label.createFolder"):this.$t("label.editFolder"):i?n?this.$t("label.addSublabel"):this.$t("label.createLabel"):this.$t("label.editLabel")},labelName:function(){return this.isOutlook?this.$t("label.folderName"):this.$t("label.labelName")},showColor:function(){return this.isZmail||this.isGmail},selectColor:function(){return this.$t("label.selectColor")},primaryActionText:function(){return this.isCreate?this.$t("common.create"):this.$t("operation.save")}}),watch:{show:function(e){this.isVisible=e,this.input=this.value,this.currentColor=this.bgColor||this.LabelColors[0].color,this.errorText="",e&&(this.confirmed=!1),this.isInvalidInput=!0},value:function(e){this.input=e},input:function(){this.confirmed=!1}},methods:{onOk:function(){var e;this.confirmed=!0,this.$emit("onOk",{newName:null===(e=this.input)||void 0===e?void 0:e.trim(),bgColor:this.currentColor})},onCancel:function(){this.$emit("onCancel")},onError:function(e){this.errorText=e},handleInput:function(e){this.input=e,this.validateInput()},handleCompositionStart:function(){this.isComposing=!0},handleCompositionEnd:function(){this.isComposing=!1,this.hasCompositionJustEnd=!0},handleKeydown:function(e){229!==this.getKeyCode(e)&&(this.hasCompositionJustEnd=!1)},handleKeyup:function(e){this.isComposing||this.hasCompositionJustEnd?this.hasCompositionJustEnd=!1:13===this.getKeyCode(e)&&this.handleEnter()},getKeyCode:function(e){return e.keyCode||e.which},handleEnter:function(){this.confirmed||this.isInvalidInput||this.onOk()},validateInput:function(){var e=this.onValidate({value:this.input,color:this.currentColor}),t=e.isValid,i=e.errorText;this.onError(i),this.isInvalidInput=!t},onSelectColor:function(e){this.currentColor=e,this.input&&this.validateInput()},focusOnFirst:function(){this.focusOn(0)},focusOnPrev:function(e){var t=e-1;t<0&&(t=this.LabelColors.length-1),this.focusOn(t)},focusOnNext:function(e){var t=e+1;t>=this.LabelColors.length&&(t=0),this.focusOn(t)},focusOn:function(e){var t=this.$refs["".concat(e)][0];this.$nextTick((function(){t.focus()}))}}},h=f,m=i(93483),p=(0,m.Z)(h,c,d,!1,null,"7c2cf4d5",null),b=p.exports,v=function(){var e=this,t=e._self._c;return t("zm-dialog",{ref:"dialog",attrs:{visible:e.isVisible,title:e.title,"close-on-click-modal":!1,"append-to-body":!0,width:"400px","close-on-press-escape":!0,"aria-describedby":"removeLabelDialogDescription"},on:{"update:visible":function(t){e.isVisible=t},close:e.onCancel}},[t("span",{attrs:{id:"removeLabelDialogDescription"}},[e._v(e._s(e.getDialogContent))]),e.isMultipleDeletion?t("DeleteLabelTree",{staticClass:"label-tree",attrs:{data:[e.item]}}):e._e(),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{attrs:{"aria-label":e.$t("operation.cancel"),role:"button","zm-ta":"remove-label-modal-cancel"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.onCancel.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("operation.cancel"))+" ")]),t("zm-button",{staticClass:"delete-btn",attrs:{"aria-label":e.$t("operation.remove"),role:"button",type:"danger","zm-ta":"remove-label-modal-remove"},on:{click:function(t){return t.stopPropagation(),t.preventDefault(),e.onOk.apply(null,arguments)}}},[e._v(" "+e._s(e.$t("operation.remove"))+" ")])],1)],1)},y=[],k=function(){var e=this,t=e._self._c;return t("ul",{staticClass:"label-list"},e._l(e.data,(function(i){var n;return t("li",{key:i.id,staticClass:"list-item"},[t("span",{staticClass:"label"},[t("span",{staticClass:"label-name"},[e._v(e._s(i.displayName))]),e.getEmailCount(i)>0?t("span",{staticClass:"email-count"},[e._v(" ("+e._s(e.getEmailCount(i))+" "+e._s(e.$tc("label.emails",e.getEmailCount(i)))+") ")]):e._e()]),null!==i&&void 0!==i&&null!==(n=i.children)&&void 0!==n&&n.length?t("DeleteLabelTree",{attrs:{data:i.children}}):e._e()],1)})),0)},g=[],C={name:"DeleteLabelTree",props:{data:{type:Array,default:[]}},computed:(0,s.Z)({},(0,o.rn)("inbox",["isConversationView"])),methods:{getEmailCount:function(e){var t=this.isConversationView?e.count.threadsTotal:e.count.msgTotal;return"DecryptFailed"===e.labelDecryptionStatus||t<=0?0:t}}},I=C,$=(0,m.Z)(I,k,g,!1,null,"f8041bf4",null),z=$.exports,_={name:"DeleteLabelDialog",components:{DeleteLabelTree:z},props:{item:{type:Object},show:{type:Boolean,default:!1}},data:function(){return{isVisible:!1}},computed:(0,s.Z)((0,s.Z)((0,s.Z)({},(0,o.Se)(["isOutlook"])),(0,o.rn)("inbox",["isConversationView"])),{},{title:function(e){var t=e.isOutlook,i=e.isMultipleDeletion;return t?i?this.$tc("label.removeFolders",2):this.$tc("label.removeFolders",1):i?this.$tc("label.removeLabels",2):this.$tc("label.removeLabels",1)},isMultipleDeletion:function(e){var t,i=e.item;return i&&(null===(t=i.children)||void 0===t?void 0:t.length)>0},getDialogContent:function(e){var t,i=e.isOutlook,n=e.isMultipleDeletion,r="";if(i)r=this.$t("label.confirmDeleteFolder",[null===(t=this.item)||void 0===t?void 0:t.displayName]);else if(n)r=this.$t("label.confirmDeleteLabelWithSubLabels");else{var a,l,s,o,c,d=this.isConversationView?null===(a=this.item)||void 0===a||null===(l=a.count)||void 0===l?void 0:l.threadsTotal:null===(s=this.item)||void 0===s||null===(o=s.count)||void 0===o?void 0:o.msgTotal;r=this.$tc("label.confirmDeleteLabelFromEmail",d,[null===(c=this.item)||void 0===c?void 0:c.displayName,d])}return r}}),watch:{show:function(e){this.isVisible=e}},methods:{onOk:function(){this.$emit("onOk")},onCancel:function(){this.$emit("onCancel")}}},w=_,x=(0,m.Z)(w,v,y,!1,null,"0bd8faa8",null),S=x.exports,L=i(63012),D=i(53806),E=i(42082),A=i(12546),T=D.Business.labelUtils,O={name:"LabelDialog",components:{UpdateLabelDialog:b,DeleteLabelDialog:S},props:{action:{type:String},visible:{type:Boolean},item:{type:Object,default:function(){}},labelListTree:{type:Array},showNotice:{type:Boolean,default:!0}},data:function(){return{labelActions:D.Enums.LabelActions}},computed:(0,s.Z)((0,s.Z)((0,s.Z)({},(0,o.rn)(["allLabels","selectMailLabel","typeOfEmail"])),(0,o.Se)(["isOutlook","isGmail","systemLabelsTree"])),{},{labelInput:function(){var e;return this.action===D.Enums.LabelActions.EDIT?null===(e=this.item)||void 0===e?void 0:e.displayName:""},bgColor:function(){var e;return this.action===D.Enums.LabelActions.EDIT&&(null===(e=this.item)||void 0===e?void 0:e.backgroundColor)||""},deletedItems:function(){return this.allLabels.find((function(e){return e.id===D.Enums.SystemDefinedMailLabelIds.TRASH}))}}),methods:(0,s.Z)((0,s.Z)({},(0,o.OI)(["addMailLabels","changeMailLabelsDisplayNum","replaceTemporatyLabel"])),{},{onOk:function(){var e=(0,l.Z)((0,a.Z)().mark((function e(t){return(0,a.Z)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$emit("close"),e.t0=this.action,e.next=e.t0===D.Enums.LabelActions.EDIT?4:e.t0===D.Enums.LabelActions.CREATE?6:e.t0===D.Enums.LabelActions.ADDSUB?8:e.t0===D.Enums.LabelActions.DELETE?10:12;break;case 4:return this.updateLabel(t),e.abrupt("break",13);case 6:return this.createLabel(t),e.abrupt("break",13);case 8:return this.createLabel(t,this.isOutlook?this.item.office365SrvId:this.item.id),e.abrupt("break",13);case 10:return this.isOutlook?this.isLabelFromTrash(this.item.id)?this.deleteLabels(this.item):this.removeFolder(this.item):this.deleteLabels(this.item),e.abrupt("break",13);case 12:console.log("Unknown action: ",this.action);case 13:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),isLabelFromTrash:function(e){var t=[];return this.systemLabelsTree.forEach((function(e){e.id===D.Enums.SystemDefinedMailLabelIds.TRASH&&(t=T.flatLabelsFromLabelListTree([e]))})),t.filter((function(t){return t.id===e})).length},onCancel:function(){this.$emit("close"),this.$emit("onCancel")},checkNavigate2Inbox:function(e){(e.includes(this.selectMailLabel.id)||this.selectMailLabel.id===D.Enums.SystemDefinedMailLabelIds.SEARCH)&&this.handleSelectLabel({isSystem:!0,id:D.Enums.SystemDefinedMailLabelIds.INBOX})},createLabel:function(e){var t=arguments,i=this;return(0,l.Z)((0,a.Z)().mark((function n(){var r,l,o,c,d,u,f,h;return(0,a.Z)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return r=e.newName,l=e.bgColor,o=t.length>1&&void 0!==t[1]?t[1]:"",n.prev=2,c={parentFolderId:o,name:r,textColor:"#000000",backgroundColor:l,displayName:r},i.addMailLabels((0,s.Z)((0,s.Z)({},c),{},{id:"label_temporary_".concat(r)})),n.next=7,L.Mail.createLabel({labelData:c});case 7:if(d=n.sent,u=d.errorCode,f=d.data,!u){n.next=13;break}throw i.$store.commit("deleteMailLabels","label_temporary_".concat(r)),new Error("create new label failed!");case 13:i.replaceTemporatyLabel({labelId:"label_temporary_".concat(r),mailLabel:f.CreateLabel.mailLabels}),i.$emit("onOk",{action:i.action,labels:f.CreateLabel.mailLabels}),i.showNotice&&(h=i.isOutlook?"label.folderCreated":"label.labelCreated",i.$undoNotice({title:i.$tc(h,1,[r])})),i.$metric.report("sidebar_create_new_label"),n.next=23;break;case 19:n.prev=19,n.t0=n["catch"](2),i.$msg({type:"Error",content:i.$t("label.creatingLabelFailed")}),i.$metric.report("sidebar_create_new_label",{error:i.$metric.jsError("mailui_createalabel",n.t0)});case 23:case"end":return n.stop()}}),n,null,[[2,19]])})))()},deleteLabels:function(e){var t=this;return(0,l.Z)((0,a.Z)().mark((function i(){var n,r,l,s;return(0,a.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,L.Mail.deleteLabels({labelIds:[e.id]});case 3:if(n=i.sent,r=n.errorCode,l=n.data,0===r){i.next=8;break}throw new Error("delete label failed!");case 8:t.$store.commit("deleteMailLabels",l.DeleteLabels.labelIds),s=t.isOutlook?"label.folderDeleted":"label.labelDeleted",t.$undoNotice({title:t.$tc(s,1,[e.name])}),t.checkNavigate2Inbox(l.DeleteLabels.labelIds),i.next=18;break;case 14:i.prev=14,i.t0=i["catch"](0),console.error(i.t0),t.$msg({type:"Error",content:t.isOutlook?t.$t("label.failedToDeleteFolder"):t.$t("label.failedToDeleteLabel")});case 18:case"end":return i.stop()}}),i,null,[[0,14]])})))()},updateLabel:function(e){var t=this;return(0,l.Z)((0,a.Z)().mark((function i(){var n,r,l,o,c,d;return(0,a.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return n=e.newName,r=e.bgColor,i.prev=1,l=(0,s.Z)((0,s.Z)({},t.item),{},{name:n,displayName:n,backgroundColor:r}),t.changeMailLabelsDisplayNum([l]),i.next=6,L.Mail.updateLabel({labelData:l});case 6:if(o=i.sent,c=o.errorCode,0===c){i.next=11;break}throw t.changeMailLabelsDisplayNum([t.item]),new Error("update label failed!");case 11:t.$emit("onOk",{action:t.action,labels:l}),d=t.isOutlook?t.$t("label.folderUpdated"):t.$t("label.labelUpdated"),t.showNotice&&t.$undoNotice({title:d}),i.next=19;break;case 16:i.prev=16,i.t0=i["catch"](1),t.$msg({type:"Error",content:t.isOutlook?t.$t("label.failedToUpdateFolder"):t.$t("label.failedToUpdateLabel")});case 19:case"end":return i.stop()}}),i,null,[[1,16]])})))()},removeFolder:function(e){var t=this;return(0,l.Z)((0,a.Z)().mark((function i(){var n,r,l,s,o,c,d;return(0,a.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.prev=0,r=(null===(n=t.deletedItems)||void 0===n?void 0:n.office365SrvId)||"",l=e.id,i.next=5,L.Mail.moveFolder({destinationId:r,folderId:l});case 5:if(s=i.sent,o=s.errorCode,c=s.data,0===o){i.next=10;break}throw new Error("remove folder failed!");case 10:t.$store.commit("deleteMailLabels",c.UpdateLabel.labelIds),d=t.isOutlook?"label.folderDeleted":"label.labelDeleted",t.$undoNotice({title:t.$tc(d,1,[e.name])}),t.checkNavigate2Inbox(c.UpdateLabel.labelIds),t.$store.dispatch("refreshMailLabels"),i.next=20;break;case 17:i.prev=17,i.t0=i["catch"](0),t.$msg({type:"Error",content:t.$t("label.failedToDeleteFolder")});case 20:case"end":return i.stop()}}),i,null,[[0,17]])})))()},handleSelectLabel:function(e){this.$emit("handleSelectLabel",e)},onValidateLabelName:function(e){var t,i,n,r=this,a=e.value,l=e.color,s=null===a||void 0===a?void 0:a.trim(),o=null!==(t=this.item)&&void 0!==t&&t.children?null===(i=this.item)||void 0===i?void 0:i.children:[];return this.action===D.Enums.LabelActions.CREATE&&(o=this.labelListTree),this.action===D.Enums.LabelActions.EDIT&&(o=1===this.item.level?this.labelListTree:this.allLabels.filter((function(e){return!e.isSystem&&e.parentFolderId===r.item.parentFolderId}))),(0,E.P)(s,{siblingLabels:o,oldLabelName:this.labelInput,i18n:A.ZP,mailProvider:this.typeOfEmail,isSameColor:(null===(n=this.item)||void 0===n?void 0:n.backgroundColor)===l})}})},M=O,V=(0,m.Z)(M,n,r,!1,null,null,null),Z=V.exports},20910:function(e,t,i){"use strict";i.r(t),i.d(t,{default:function(){return Z}});var n=function(){var e=this,t=e._self._c;return t("zm-dialog",{ref:"dialog",attrs:{title:e.title,visible:e.visible,"close-on-press-escape":!1,top:"4vh",width:"548px","append-to-body":""}},[t("filter-criteria",{directives:[{name:"show",rawName:"v-show",value:1===e.step,expression:"step === 1"}],ref:"criteriaForm",attrs:{filterEdits:e.filterEdits,"zm-ta":"add-filter-criteria"},on:{update:e.handleCriteriaUpdate}}),t("filter-actions",{directives:[{name:"show",rawName:"v-show",value:2===e.step,expression:"step === 2"}],ref:"actionsForm",attrs:{filterEdits:e.filterEdits,userLabels:e.userLabelItems,"zm-ta":"add-filter-actions"},on:{update:e.handleActionsUpdate}}),t("span",{staticClass:"add-filter-footer",attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{staticClass:"button-left",attrs:{tabindex:"0","zm-ta":"add-filter-cancel"},on:{click:e.handleCancel}},[e._v(e._s(e.$t("operation.cancel")))]),t("section",{staticClass:"button-right"},[t("zm-button",{directives:[{name:"show",rawName:"v-show",value:2===e.step,expression:"step === 2"}],attrs:{disabled:e.loading,tabindex:"0","zm-ta":"add-filter-back"},on:{click:function(t){e.step=1}}},[e._v(" "+e._s(e.$t("common.back"))+" ")]),t("zm-button",{directives:[{name:"show",rawName:"v-show",value:1===e.step,expression:"step === 1"}],attrs:{type:"primary",tabindex:"0",disabled:!e.isCriteriaExist,"zm-ta":"add-filter-next"},on:{click:e.handleNextStep}},[e._v(" "+e._s(e.$t("operation.next"))+" ")]),t("zm-button",{directives:[{name:"show",rawName:"v-show",value:2===e.step,expression:"step === 2"}],attrs:{type:"primary",disabled:!e.isFulfilled,loading:e.loading,tabindex:"0","zm-ta":"add-filter-submit"},on:{click:e.handleSubmit}},[e._v(" "+e._s(e.submitText)+" ")])],1)],1)],1)},r=[],a=i(70021),l=i(56706),s=i(68571),o=i(34948),c=(i(45794),i(6886),i(51367)),d=i.n(c),u=i(29648),f=i(63012),h=function(){var e=this,t=e._self._c;return t("section",{staticClass:"filter-criteria-container"},[t("p",{staticClass:"label"},[e._v(e._s(e.$t("filter.filterCriteria")))]),t("zm-form",{ref:"form",staticClass:"filter-criteria-form",attrs:{model:e.formInline,rules:e.rules,"label-position":"top"}},[t("zm-form-item",{attrs:{label:e.$t("filter.from"),prop:"from",for:"formInline-from"}},[t("zm-input",{staticClass:"input-box",attrs:{autofocus:"",maxlength:e.maxInputLength+1,label:e.$t("filter.from"),"zm-ta":"add-filter-criteria-from"},model:{value:e.formInline.from,callback:function(t){e.$set(e.formInline,"from",t)},expression:"formInline.from"}})],1),e.isShowFromTips?t("div",{staticClass:"contain-special-characters"},[e._v(" "+e._s(e.$t("filter.specialCharactersTips"))+" ")]):e._e(),t("zm-form-item",{attrs:{label:e.$t("filter.to"),prop:"to",for:"formInline-to"}},[t("zm-input",{staticClass:"input-box",attrs:{maxlength:e.maxInputLength+1,label:e.$t("filter.to"),"zm-ta":"add-filter-criteria-to"},model:{value:e.formInline.to,callback:function(t){e.$set(e.formInline,"to",t)},expression:"formInline.to"}})],1),e.isShowToTips?t("div",{staticClass:"contain-special-characters"},[e._v(" "+e._s(e.$t("filter.specialCharactersTips"))+" ")]):e._e(),!e.isEncryptedZmail||e.hybridModeActive?t("zm-form-item",{attrs:{label:e.$t("filter.subject"),prop:"subject",for:"formInline-subject"}},[t("zm-input",{staticClass:"input-box",attrs:{label:e.$t("filter.subject"),"zm-ta":"add-filter-criteria-subject"},model:{value:e.formInline.subject,callback:function(t){e.$set(e.formInline,"subject",t)},expression:"formInline.subject"}})],1):e._e(),e.isGmail?t("zm-form-item",{attrs:{label:e.$t("filter.contains"),prop:"query",for:"formInline-query"}},[t("zm-input",{staticClass:"input-box",attrs:{label:e.$t("filter.contains"),"zm-ta":"add-filter-criteria-query"},model:{value:e.formInline.query,callback:function(t){e.$set(e.formInline,"query",t)},expression:"formInline.query"}})],1):e._e(),e.isGmail?t("zm-form-item",{attrs:{label:e.$t("filter.doesNotContain"),prop:"negatedQuery",for:"formInline-negatedQuery"}},[t("zm-input",{staticClass:"input-box",attrs:{label:e.$t("filter.doesNotContain"),"zm-ta":"add-filter-criteria-negated-query"},model:{value:e.formInline.negatedQuery,callback:function(t){e.$set(e.formInline,"negatedQuery",t)},expression:"formInline.negatedQuery"}})],1):e._e(),e.isEncryptedZmail?e._e():t("zm-form-item",{attrs:{label:e.$t("filter.size"),prop:"sizeValue",for:"formInline-sizeValue"}},[t("section",{style:{display:"flex"}},[t("zm-select",{staticClass:"input-select",attrs:{label:e.$t("filter.size"),"zm-ta":"add-filter-criteria-size"},model:{value:e.formInline.sizeComparison,callback:function(t){e.$set(e.formInline,"sizeComparison",t)},expression:"formInline.sizeComparison"}},[t("zm-option",{key:"larger",attrs:{label:e.$t("filter.greaterThan"),value:"larger"}}),t("zm-option",{key:"smaller",attrs:{label:e.$t("filter.lessThan"),value:"smaller"}})],1),t("zm-input",{staticClass:"input-box",attrs:{label:"",min:0,step:1,"zm-ta":"add-filter-criteria-size-value"},model:{value:e.formInline.sizeValue,callback:function(t){e.$set(e.formInline,"sizeValue",t)},expression:"formInline.sizeValue"}}),t("zm-select",{staticClass:"input-unit",attrs:{label:"","zm-ta":"add-filter-criteria-size-unit"},model:{value:e.formInline.sizeUnit,callback:function(t){e.$set(e.formInline,"sizeUnit",t)},expression:"formInline.sizeUnit"}},[t("zm-option",{key:"MB",attrs:{label:"MB",value:"MB"}}),t("zm-option",{key:"KB",attrs:{label:"KB",value:"KB"}}),t("zm-option",{key:"Bytes",attrs:{label:"Bytes",value:"Bytes"}})],1)],1)]),t("zm-form-item",{attrs:{label:"",prop:"hasAttachment",for:"formInline-hasAttachment"}},[t("zm-checkbox",{attrs:{"zm-ta":"add-filter-criteria-has-attachment"},model:{value:e.formInline.hasAttachment,callback:function(t){e.$set(e.formInline,"hasAttachment",t)},expression:"formInline.hasAttachment"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.hasAttachment")))])])],1)],1)],1)},m=[],p=(i(77950),i(71372),2147483648),b=["[","]","(",")","&","#","*","!","%","$","^"],v=1e3,y={name:"FilterCriteria",props:{filterEdits:{type:Object,default:function(){}}},data:function(){return{maxAmount:p/1e6-1,test:"",isShowFromTips:!1,isShowToTips:!1,maxInputLength:v,formInline:{from:"",to:"",subject:"",query:"",negatedQuery:"",sizeComparison:"larger",sizeValue:"",sizeUnit:"MB",excludeChats:!1,hasAttachment:!1},rules:{sizeValue:[{validator:this.validateSizeValue,trigger:"change"}]}}},computed:(0,o.Z)((0,o.Z)({},(0,u.Se)(["isGmail","isEncryptedZmail","hybridModeActive"])),{},{formatSize:function(){return function(e){return isNaN(e)?"":e<1e3?e:e<1e6?(e/1e3).toFixed(0):(e/1e6).toFixed(0)}},formatUnit:function(){return function(e){return e<1e3?"Bytes":e<1e6?"KB":"MB"}}}),watch:{formInline:{handler:function(e){this.$emit("update",e),this.checkSpecialCharacters(e)},immediate:!0,deep:!0}},methods:{init:function(){var e,t,i,n,r,a,l,s,o,c,d,u,f,h,m,p;this.formInline.from=(null===(e=this.filterEdits)||void 0===e||null===(t=e.criteria)||void 0===t?void 0:t.from)||"",this.formInline.to=(null===(i=this.filterEdits)||void 0===i||null===(n=i.criteria)||void 0===n?void 0:n.to)||"",this.formInline.subject=(null===(r=this.filterEdits)||void 0===r||null===(a=r.criteria)||void 0===a?void 0:a.subject)||"",this.formInline.query=(null===(l=this.filterEdits)||void 0===l||null===(s=l.criteria)||void 0===s?void 0:s.query)||"",this.formInline.negatedQuery=(null===(o=this.filterEdits)||void 0===o||null===(c=o.criteria)||void 0===c?void 0:c.negatedQuery)||"",this.formInline.sizeComparison=(null===(d=this.filterEdits)||void 0===d||null===(u=d.criteria)||void 0===u?void 0:u.sizeComparison)||"larger",this.formInline.sizeValue=this.formatSize(this.filterEdits.criteria.size)||"",this.formInline.sizeUnit=this.formatUnit(this.filterEdits.criteria.size)||"Bytes",this.formInline.excludeChats=(null===(f=this.filterEdits)||void 0===f||null===(h=f.criteria)||void 0===h?void 0:h.excludeChats)||!1,this.formInline.hasAttachment=(null===(m=this.filterEdits)||void 0===m||null===(p=m.criteria)||void 0===p?void 0:p.hasAttachment)||!1,this.$refs.form.clearValidate()},validate:function(){var e=this;return new Promise((function(t,i){e.$refs.form.validate((function(n){if(!n)return i(new Error("validate error"));var r=Object.values(e.formInline).some((function(e){return!!e}));return r?t(e.formInline):i(new Error("validate error"))}))}))},validateSizeValue:function(e,t,i){"MB"===this.formInline.sizeUnit&&t>=p/1e6&&i(new Error(this.$t("filter.sizeValueIsTooLarge"))),"KB"===this.formInline.sizeUnit&&t>=p/1e3&&i(new Error(this.$t("filter.sizeValueIsTooLarge"))),"Bytes"===this.formInline.sizeUnit&&t>=p&&i(new Error(this.$t("filter.sizeValueIsTooLarge"))),t&&t<=0&&i(new Error(this.$t("filter.sizeValueMustBeLargerThan_0"))),t&&!/^[0-9]+$/.test(t)&&(this.formInline.sizeValue=parseFloat(t)||"",i()),i()},isContainSpecialCharacters:function(e){return e&&Array.from(e).findIndex((function(e){return b.includes(e)}))>-1},checkSpecialCharacters:function(e){var t=e.from,i=e.to;this.isShowFromTips=this.isContainSpecialCharacters(t),this.isShowToTips=this.isContainSpecialCharacters(i)}}},k=y,g=i(93483),C=(0,g.Z)(k,h,m,!1,null,"7f4a337e",null),I=C.exports,$=function(){var e=this,t=e._self._c;return t("section",{staticClass:"filter-actions-container"},[t("p",{staticClass:"label"},[e._v(e._s(e.$t("filter.filterActions")))]),t("zm-form",{ref:"form",staticClass:"filter-actions-form",attrs:{model:e.formInline,rules:e.rules,"label-position":"top"}},[t("zm-form-item",{attrs:{label:"",prop:"archiveChecked",for:"formInline-archiveChecked"}},[t("zm-checkbox",{ref:"archiveCheckbox",attrs:{"aria-label":e.$t("filter.archiveEmail"),disabled:e.formInline.deleteChecked||e.formInline.applyToHistoryMsgs,"zm-ta":"add-filter-dialog-archive"},model:{value:e.formInline.archiveChecked,callback:function(t){e.$set(e.formInline,"archiveChecked",t)},expression:"formInline.archiveChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.archiveEmail")))])])],1),t("zm-form-item",{attrs:{label:"",prop:"markReadChecked",for:"formInline-markReadChecked"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("common.markAsRead"),"zm-ta":"add-filter-dialog-read"},model:{value:e.formInline.markReadChecked,callback:function(t){e.$set(e.formInline,"markReadChecked",t)},expression:"formInline.markReadChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("common.markAsRead")))])])],1),t("zm-form-item",{attrs:{label:"",prop:"neverSpamChecked",for:"formInline-neverSpamChecked"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.neverMarkAsSpam"),"zm-ta":"add-filter-dialog-spam"},model:{value:e.formInline.neverSpamChecked,callback:function(t){e.$set(e.formInline,"neverSpamChecked",t)},expression:"formInline.neverSpamChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.neverMarkAsSpam")))])])],1),t("zm-form-item",{attrs:{label:"",prop:"deleteChecked",for:"formInline-deleteChecked"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.deleteEmail"),disabled:e.formInline.archiveChecked,"zm-ta":"add-filter-dialog-delete"},model:{value:e.formInline.deleteChecked,callback:function(t){e.$set(e.formInline,"deleteChecked",t)},expression:"formInline.deleteChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.deleteEmail")))])])],1),t("zm-form-item",{attrs:{label:"",prop:"markStarredChecked",for:"formInline-markStarredChecked"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.markAsStarred"),"zm-ta":"add-filter-dialog-starred"},model:{value:e.formInline.markStarredChecked,callback:function(t){e.$set(e.formInline,"markStarredChecked",t)},expression:"formInline.markStarredChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.markAsStarred")))])])],1),e.isZmail||e.isGmail?t("zm-form-item",{attrs:{label:"",prop:"alwaysMarkAsImportantChecked",for:"formInline-alwaysMarkAsImportant"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.alwaysMarkAsImportant"),disabled:e.formInline.neverMarkAsImportantChecked,"zm-ta":"add-filter-dialog-important"},model:{value:e.formInline.alwaysMarkAsImportantChecked,callback:function(t){e.$set(e.formInline,"alwaysMarkAsImportantChecked",t)},expression:"formInline.alwaysMarkAsImportantChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.alwaysMarkAsImportant")))])])],1):e._e(),e.isZmail||e.isGmail?t("zm-form-item",{attrs:{label:"",prop:"neverMarkAsImportantChecked",for:"formInline-neverMarkAsImportant"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.neverMarkAsImportant"),disabled:e.formInline.alwaysMarkAsImportantChecked,"zm-ta":"add-filter-dialog-not-important"},model:{value:e.formInline.neverMarkAsImportantChecked,callback:function(t){e.$set(e.formInline,"neverMarkAsImportantChecked",t)},expression:"formInline.neverMarkAsImportantChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.neverMarkAsImportant")))])])],1):e._e(),e.isZmail&&!e.isDelegated?t("zm-form-item",{attrs:{label:"",prop:"markPrivateChecked",for:"formInline-markPrivateChecked"}},[t("zm-checkbox",{attrs:{"aria-label":e.$t("filter.markAsPrivate"),"zm-ta":"add-filter-dialog-private"},model:{value:e.formInline.markPrivateChecked,callback:function(t){e.$set(e.formInline,"markPrivateChecked",t)},expression:"formInline.markPrivateChecked"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.markAsPrivate")))])])],1):e._e(),e.enableFilterHistoryEmail?t("zm-form-item",{staticClass:"filter-history-email",attrs:{label:"",role:"",prop:"applyToHistoryMsgs",for:"formInline-applyToHistoryMsgs"}},[t("zm-checkbox",{attrs:{disabled:e.formInline.archiveChecked,"aria-label":e.$t("filter.applyToHistoryMsgs"),"zm-ta":"add-filter-dialog-applyToHistoryMsgs"},model:{value:e.formInline.applyToHistoryMsgs,callback:function(t){e.$set(e.formInline,"applyToHistoryMsgs",t)},expression:"formInline.applyToHistoryMsgs"}},[t("span",{staticClass:"checkbox-label"},[e._v(e._s(e.$t("filter.applyToHistoryMsgs")))])]),t("span",[t("zm-tooltip",{attrs:{placement:"top",content:e.$t("filter.filterHistoryEmail")}},[t("span",{staticClass:"tab-focus filter-history-email-tooltip",attrs:{"aria-label":e.$t("filter.filterHistoryEmail"),role:"button"}},[t("svg-icon",{staticClass:"question",attrs:{iconClass:"question"}})],1)])],1),t("svg-icon",{staticClass:"beta-icon",attrs:{iconClass:"beta"}})],1):e._e(),t("zm-form-item",{attrs:{label:""}},[t("span",{staticClass:"user-labels"},[e._v(" "+e._s(e.$t("filter.applyLabel"))+" ")])]),t("zm-form-item",{attrs:{label:"",prop:"userSelectedLabel",for:"formInline-userSelectedLabel"}},[t("zm-select",{directives:[{name:"loading",rawName:"v-loading",value:e.dialogVisible,expression:"dialogVisible"}],staticClass:"select-input-box",attrs:{id:"custom-select",filterable:"",placeholder:e.$t("filter.selectLabel"),label:e.$t("filter.applyLabel"),"popper-class":"filter-action-user-label-select","width-limit":"",clearable:!e.dialogVisible,filterLabel:e.filterUserLabel,filterMethod:e.filterMethod,"zm-ta":"add-filter-dialog-custom"},on:{change:e.userSelectedLabelChange,"visible-change":e.onUserLabelDropdownChange},model:{value:e.formInline.userSelectedLabel,callback:function(t){e.$set(e.formInline,"userSelectedLabel",t)},expression:"formInline.userSelectedLabel"}},[t("RecycleScroller",{staticClass:"user-label-virtual-list",attrs:{items:e.displayedLabels,"key-field":"value","item-size":32,"simple-array":!1},scopedSlots:e._u([{key:"before",fn:function(){return[t("zm-option",{key:"labelCreate",staticClass:"menu-item-create-label",attrs:{label:"createLabel",role:"button",value:"createLabel"}},[t("div",{staticClass:"label-options"},[t("svg-icon",{attrs:{iconClass:"plus"}}),t("span",{staticClass:"menu-item-text"},[e._v(" "+e._s(e.$t("label.createLabel"))+" ")])],1)])]},proxy:!0},{key:"default",fn:function(i){var n=i.item;return[t("zm-option",{attrs:{label:n.label,value:n.value}},[t("zm-tooltip",{attrs:{content:n.label,placement:"bottom-end",disabled:""===n.label,"break-word":""}},[t("div",{staticClass:"label-options"},[t("svg-label",{attrs:{labelClass:"stroke-label",labelColor:n.color}}),t("span",{staticClass:"label-name"},[e._v(e._s(n.label||"Unknown"))])],1)])],1)]}}])})],1)],1)],1),t("labelDialog",{attrs:{visible:e.dialogVisible,action:e.LabelActions.CREATE,showNotice:!1,labelListTree:e.allLabelsTree},on:{onOk:e.handleCreationOk,onCancel:e.handleCreationCancel,close:function(t){e.dialogVisible=!1}}})],1)},z=[],_=i(53806),w=i(87692),x=i(65803),S=i(87585),L=_.Enums.SystemDefinedMailLabelIds,D={name:"FilterActions",components:{SvgLabel:w.Z,labelDialog:x.Z,RecycleScroller:S.EK},props:{filterEdits:{type:Object},userLabels:{type:Array}},data:function(){return{dialogVisible:!1,LabelActions:_.Enums.LabelActions,queryText:"",formInline:{archiveChecked:!1,markReadChecked:!1,neverSpamChecked:!1,deleteChecked:!1,markStarredChecked:!1,alwaysMarkAsImportantChecked:!1,neverMarkAsImportantChecked:!1,markPrivateChecked:!1,applyToHistoryMsgs:!1,userSelectedLabel:""},rules:{archiveChecked:[],markReadChecked:[],neverSpamChecked:[],deleteChecked:[],markStarredChecked:[],alwaysMarkAsImportantChecked:[],neverMarkAsImportantChecked:[],markPrivateChecked:[],applyToHistoryMsgs:[],userSelectedLabel:[]}}},computed:(0,o.Z)((0,o.Z)((0,o.Z)((0,o.Z)({},(0,u.rn)({isDelegated:function(e){return e.userProfile.isDelegated}})),(0,u.Se)(["isZmail","isGmail","allLabelsTree"])),(0,u.Se)("features",["enableFilterHistoryEmail"])),{},{displayedLabels:function(e){var t=this,i=e.userLabels;return 0===this.queryText.trim().length?i:i.filter((function(e){var i;return null===(i=e.label)||void 0===i?void 0:i.toLowerCase().includes(t.queryText.toLowerCase())}))}}),watch:{formInline:{handler:function(e){this.$emit("update",e)},immediate:!0}},methods:{init:function(){this.formInline.archiveChecked=!!this.filterEdits.action.removeLabelIds&&this.filterEdits.action.removeLabelIds.includes(L.INBOX),this.formInline.markReadChecked=!!this.filterEdits.action.removeLabelIds&&this.filterEdits.action.removeLabelIds.includes(L.UNREAD),this.formInline.neverMarkAsImportantChecked=!!this.filterEdits.action.removeLabelIds&&this.filterEdits.action.removeLabelIds.includes(L.IMPORTANT),this.formInline.neverSpamChecked=!!this.filterEdits.action.removeLabelIds&&this.filterEdits.action.removeLabelIds.includes(L.SPAM),this.formInline.deleteChecked=!!this.filterEdits.action.addLabelIds&&this.filterEdits.action.addLabelIds.includes(L.TRASH),this.formInline.markStarredChecked=!!this.filterEdits.action.addLabelIds&&this.filterEdits.action.addLabelIds.includes(L.STARRED),this.formInline.alwaysMarkAsImportantChecked=!!this.filterEdits.action.addLabelIds&&this.filterEdits.action.addLabelIds.includes(L.IMPORTANT),this.formInline.markPrivateChecked=!!this.filterEdits.action.addLabelIds&&this.filterEdits.action.addLabelIds.includes(L.PRIVATE),this.formInline.applyToHistoryMsgs=!1,this.formInline.userSelectedLabel=this.filterEdits.action.addLabelIds&&this.filterEdits.action.addLabelIds.filter((function(e){var t=[L.INBOX,L.UNREAD,L.SPAM,L.TRASH,L.STARRED,L.IMPORTANT,L.PRIVATE];return!t.includes(e)}))[0]||"",this.userSelectedLabelHistory=this.formInline.userSelectedLabel,this.$refs.form.clearValidate()},autoFocus:function(){this.$refs.archiveCheckbox.focus()},validate:function(){var e=this;return new Promise((function(t,i){e.$refs.form.validate((function(n){return n?t(e.formInline):i(new Error("validate error"))}))}))},userSelectedLabelChange:function(e){"createLabel"===e?(this.dialogVisible=!0,this.formInline.userSelectedLabel=""):this.userSelectedLabelHistory=e},handleCreationOk:function(e){var t;this.dialogVisible=!1,this.formInline.userSelectedLabel=null===(t=e.labels[0])||void 0===t?void 0:t.id},handleCreationCancel:function(){this.dialogVisible=!1,this.formInline.userSelectedLabel||(this.formInline.userSelectedLabel=this.userSelectedLabelHistory)},filterUserLabel:function(e,t){var i;return(null===(i=this.displayedLabels.find((function(e){return e.value===t})))||void 0===i?void 0:i.label)||e},filterMethod:function(e){0!==e.trim().length&&(this.queryText=e)},onUserLabelDropdownChange:function(e){e||(this.queryText="")}}},E=D,A=(0,g.Z)(E,$,z,!1,null,"423319f9",null),T=A.exports,O={name:"AddFilterDialog",components:{FilterCriteria:I,FilterActions:T},props:{filterEdits:{type:Object}},data:function(){return{visible:!1,step:1,isCriteriaExist:!1,isFulfilled:!1,loading:!1,criteriaData:null,actionsData:null}},computed:(0,o.Z)((0,o.Z)((0,o.Z)({},(0,u.rn)(["allLabels"])),(0,u.Se)(["isZmail","flattenedUserLabels","userLabels","labelNameInfo"])),{},{isEdit:function(){return this.filterEdits.id&&this.isZmail},userLabelItems:function(e){var t=this,i=e.labelNameInfo,n=e.flattenedUserLabels,r=e.userLabels,a=this.isZmail?n:r;return a.map((function(e){var n;return{value:e.id,label:t.isZmail?null===(n=i[e.id])||void 0===n?void 0:n.labelDisplayFullName:e.name,color:e.backgroundColor}}))},title:function(){return this.isEdit?this.$t("filter.updateAFilter"):this.$t("filter.addAFilter")},submitText:function(){return this.isEdit?this.$t("common.update"):this.$t("common.create")}}),watch:{visible:{handler:function(e){var t=this;this.$store.commit("setPreventBack",e),e&&this.$nextTick((function(){t.$refs.criteriaForm.init(),t.$refs.actionsForm.init()}))},immediate:!0},criteriaData:{handler:function(e){this.isCriteriaExist=e&&Object.entries(e).filter((function(e){var t=(0,s.Z)(e,2),i=t[0],n=t[1];return!["sizeComparison","sizeUnit"].includes(i)&&("string"===typeof n?!!n.trim():n)})).length>0},deep:!0,immediate:!0},actionsData:{handler:function(e){if(e){var t=Object.values(e).filter((function(e){return!!e}));this.isFulfilled=t.length>0,1===t.length&&e.applyToHistoryMsgs&&(this.isFulfilled=!1)}else this.isFulfilled=!1},deep:!0,immediate:!0}},methods:{createFilter:function(e){var t=this;return(0,l.Z)((0,a.Z)().mark((function i(){var n;return(0,a.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.debug("create filter",e),i.next=3,f.Setting.createFilter({action:e.action,criteria:e.criteria});case 3:n=i.sent,n||t.$msg(t.$t("filter.failedToCreateAFilter"));case 5:case"end":return i.stop()}}),i)})))()},updateFilter:function(e){var t=this;return(0,l.Z)((0,a.Z)().mark((function i(){var n;return(0,a.Z)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:return console.debug("update filter",e),i.next=3,f.Setting.updateFilter({id:e.id,action:e.action,criteria:e.criteria});case 3:n=i.sent,n?t.$undoNotice({title:t.$t("filter.filterHasBeenUpdated")}):t.$msg(t.$t("filter.failedToUpdateFilter"));case 5:case"end":return i.stop()}}),i)})))()},open:function(){this.visible=!0},close:function(){var e=this;this.visible=!1,setTimeout((function(){e.step=1}),400),Object.assign(this.criteriaData,this.$options.data.call(this).criteriaData),Object.assign(this.actionsData,this.$options.data.call(this).actionsData)},handleCriteriaUpdate:function(e){this.criteriaData=e},handleActionsUpdate:function(e){this.actionsData=e},handleNextStep:function(){var e=this;return(0,l.Z)((0,a.Z)().mark((function t(){return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.$refs.criteriaForm.validate();case 2:e.step=2,e.$nextTick((function(){e.$refs.actionsForm.autoFocus()}));case 4:case"end":return t.stop()}}),t)})))()},handleSubmit:function(){var e=this;return(0,l.Z)((0,a.Z)().mark((function t(){var i,n,r,l,s,c,u,f,h;return(0,a.Z)().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,e.$refs.actionsForm.validate();case 3:e.loading=!0,i=Object.create(null),n=Object.create(null),t.t0=(0,a.Z)().keys(e.criteriaData);case 7:if((t.t1=t.t0()).done){t.next=16;break}if(r=t.t1.value,e.criteriaData.hasOwnProperty(r)){t.next=11;break}return t.abrupt("continue",7);case 11:if("sizeUnit"!==r){t.next=13;break}return t.abrupt("continue",7);case 13:"hasAttachment"===r||"excludeChats"===r?i[r]="true"===d().sanitize(e.criteriaData[r]).toLowerCase():"sizeValue"===r?e.criteriaData[r]&&("MB"===(null===(l=e.criteriaData)||void 0===l?void 0:l.sizeUnit)?i.size=1e3*Number(e.criteriaData[r])*1e3:"KB"===(null===(s=e.criteriaData)||void 0===s?void 0:s.sizeUnit)?i.size=1e3*Number(e.criteriaData[r]):i.size=Number(e.criteriaData[r])):"sizeComparison"===r?i[r]=e.criteriaData[r]:(c="string"===typeof e.criteriaData[r]?e.criteriaData[r].trim():e.criteriaData[r],i[r]=d().sanitize(c)),t.next=7;break;case 16:n.forward="",n.removeLabelIds=[],n.addLabelIds=[],t.t2=(0,a.Z)().keys(e.actionsData);case 20:if((t.t3=t.t2()).done){t.next=51;break}if(u=t.t3.value,e.actionsData.hasOwnProperty(u)){t.next=24;break}return t.abrupt("continue",20);case 24:t.t4=u,t.next="archiveChecked"===t.t4?27:"markReadChecked"===t.t4?29:"neverSpamChecked"===t.t4?31:"deleteChecked"===t.t4?34:"markStarredChecked"===t.t4?36:"alwaysMarkAsImportantChecked"===t.t4?38:"neverMarkAsImportantChecked"===t.t4?40:"applyToHistoryMsgs"===t.t4?42:"markPrivateChecked"===t.t4?44:"userSelectedLabel"===t.t4?46:48;break;case 27:return e.actionsData[u]&&n.removeLabelIds.push(_.Enums.SystemDefinedMailLabelIds.INBOX),t.abrupt("break",49);case 29:return e.actionsData[u]&&n.removeLabelIds.push(_.Enums.SystemDefinedMailLabelIds.UNREAD),t.abrupt("break",49);case 31:return e.isZmail&&e.actionsData[u]&&n.addLabelIds.push(_.Enums.SystemDefinedMailLabelIds.INBOX),e.actionsData[u]&&n.removeLabelIds.push(_.Enums.SystemDefinedMailLabelIds.SPAM),t.abrupt("break",49);case 34:return e.actionsData[u]&&n.addLabelIds.push(_.Enums.SystemDefinedMailLabelIds.TRASH),t.abrupt("break",49);case 36:return e.actionsData[u]&&n.addLabelIds.push(_.Enums.SystemDefinedMailLabelIds.STARRED),t.abrupt("break",49);case 38:return e.actionsData[u]&&n.addLabelIds.push(_.Enums.SystemDefinedMailLabelIds.IMPORTANT),t.abrupt("break",49);case 40:return e.actionsData[u]&&n.removeLabelIds.push(_.Enums.SystemDefinedMailLabelIds.IMPORTANT),t.abrupt("break",49);case 42:return e.actionsData[u]&&(n["applyToHistoryMsgs"]=!0),t.abrupt("break",49);case 44:return e.actionsData[u]&&n.addLabelIds.push(_.Enums.SystemDefinedMailLabelIds.PRIVATE),t.abrupt("break",49);case 46:return e.actionsData[u]&&!n.addLabelIds.includes(e.actionsData[u])&&n.addLabelIds.push(e.actionsData[u]),t.abrupt("break",49);case 48:return t.abrupt("break",49);case 49:t.next=20;break;case 51:if(f=["excludeChats"],[i,n].forEach((function(e,t){Object.keys(e).forEach((function(i){var n=e[i],r=Array.isArray(n)&&!n.length,a=""===n,l=0===t&&f.includes(i);(r||a||l)&&delete e[i]}))})),h=(0,o.Z)((0,o.Z)({},e.filterEdits),{},{criteria:i,action:n}),!e.isEdit){t.next=59;break}return t.next=57,e.updateFilter(h);case 57:t.next=62;break;case 59:return h.id="",t.next=62,e.createFilter(h);case 62:e.$emit("submit",h),e.close(),t.next=69;break;case 66:t.prev=66,t.t5=t["catch"](0),console.error(t.t5);case 69:return t.prev=69,e.loading=!1,t.finish(69);case 72:case"end":return t.stop()}}),t,null,[[0,66,69,72]])})))()},handleCancel:function(){this.$emit("cancel"),this.close(),this.loading=!1}}},M=O,V=(0,g.Z)(M,n,r,!1,null,"023cb6b0",null),Z=V.exports},74032:function(e,t,i){"use strict";i.d(t,{Z:function(){return c}});var n,r,a={name:"DynamicScrollerItem",inject:["vscrollData","vscrollParent","vscrollResizeObserver"],props:{item:{required:!0},watchData:{type:Boolean,default:!1},active:{type:Boolean,required:!0},index:{type:Number,default:void 0},sizeDependencies:{type:[Array,Object],default:null},emitResize:{type:Boolean,default:!1},tag:{type:String,default:"div"}},computed:{id:function(){return this.vscrollData.simpleArray?this.index:this.item[this.vscrollData.keyField]},size:function(){return this.vscrollData.validSizes[this.id]&&this.vscrollData.sizes[this.id]||0},finalActive:function(){return this.active&&this.vscrollData.active}},watch:{watchData:"updateWatchData",id:function(){this.size||this.onDataUpdate()},finalActive:function(e){this.size||(e?this.vscrollParent.$_undefinedMap[this.id]||(this.vscrollParent.$_undefinedSizes++,this.vscrollParent.$_undefinedMap[this.id]=!0):this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=!1)),this.vscrollResizeObserver?e?this.observeSize():this.unobserveSize():e&&this.$_pendingVScrollUpdate===this.id&&this.updateSize()}},created:function(){var e=this;if(!this.$isServer&&(this.$_forceNextVScrollUpdate=null,this.updateWatchData(),!this.vscrollResizeObserver)){var t=function(t){e.$watch((function(){return e.sizeDependencies[t]}),e.onDataUpdate)};for(var i in this.sizeDependencies)t(i);this.vscrollParent.$on("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$on("vscroll:update-size",this.onVscrollUpdateSize)}},mounted:function(){this.vscrollData.active&&(this.updateSize(),this.observeSize())},beforeDestroy:function(){this.vscrollParent.$off("vscroll:update",this.onVscrollUpdate),this.vscrollParent.$off("vscroll:update-size",this.onVscrollUpdateSize),this.unobserveSize()},methods:{updateSize:function(){this.finalActive?this.$_pendingSizeUpdate!==this.id&&(this.$_pendingSizeUpdate=this.id,this.$_forceNextVScrollUpdate=null,this.$_pendingVScrollUpdate=null,this.computeSize(this.id)):this.$_forceNextVScrollUpdate=this.id},updateWatchData:function(){var e=this;this.watchData?this.$_watchData=this.$watch("data",(function(){e.onDataUpdate()}),{deep:!0}):this.$_watchData&&(this.$_watchData(),this.$_watchData=null)},onVscrollUpdate:function(e){var t=e.force;!this.finalActive&&t&&(this.$_pendingVScrollUpdate=this.id),this.$_forceNextVScrollUpdate!==this.id&&!t&&this.size||this.updateSize()},onDataUpdate:function(){this.updateSize()},computeSize:function(e){var t=this;this.$nextTick((function(){if(t.id===e){var i=t.$el.offsetWidth,n=t.$el.offsetHeight;t.applySize(i,n)}t.$_pendingSizeUpdate=null}))},applySize:function(e,t){var i=Math.round("vertical"===this.vscrollParent.direction?t:e);i&&this.size!==i&&(this.vscrollParent.$_undefinedMap[this.id]&&(this.vscrollParent.$_undefinedSizes--,this.vscrollParent.$_undefinedMap[this.id]=void 0),this.$set(this.vscrollData.sizes,this.id,i),this.$set(this.vscrollData.validSizes,this.id,!0),this.emitResize&&this.$emit("resize",this.id))},observeSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.observe(this.$el.parentNode),this.$el.parentNode.addEventListener("resize",this.onResize))},unobserveSize:function(){this.vscrollResizeObserver&&(this.vscrollResizeObserver.unobserve(this.$el.parentNode),this.$el.parentNode.removeEventListener("resize",this.onResize))},onResize:function(e){var t=e.detail.contentRect,i=t.width,n=t.height;this.applySize(i,n)}},render:function(e){return e(this.tag,this.$slots["default"])}},l=a,s=i(93483),o=(0,s.Z)(l,n,r,!1,null,null,null),c=o.exports},34494:function(e,t,i){"use strict";function n(){var e=window.navigator.userAgent,t=e.indexOf("MSIE ");if(t>0)return parseInt(e.substring(t+5,e.indexOf(".",t)),10);var i=e.indexOf("Trident/");if(i>0){var n=e.indexOf("rv:");return parseInt(e.substring(n+3,e.indexOf(".",n)),10)}var r=e.indexOf("Edge/");return r>0?parseInt(e.substring(r+5,e.indexOf(".",r)),10):-1}var r;function a(){a.init||(a.init=!0,r=-1!==n())}i.d(t,{do:function(){return p}});var l={name:"ResizeObserver",props:{emitOnMount:{type:Boolean,default:!1},ignoreWidth:{type:Boolean,default:!1},ignoreHeight:{type:Boolean,default:!1}},mounted:function(){var e=this;a(),this.$nextTick((function(){e._w=e.$el.offsetWidth,e._h=e.$el.offsetHeight,e.emitOnMount&&e.emitSize()}));var t=document.createElement("object");this._resizeObject=t,t.setAttribute("aria-hidden","true"),t.setAttribute("tabindex",-1),t.onload=this.addResizeHandlers,t.type="text/html",r&&this.$el.appendChild(t),t.data="about:blank",r||this.$el.appendChild(t)},beforeDestroy:function(){this.removeResizeHandlers()},methods:{compareAndNotify:function(){(!this.ignoreWidth&&this._w!==this.$el.offsetWidth||!this.ignoreHeight&&this._h!==this.$el.offsetHeight)&&(this._w=this.$el.offsetWidth,this._h=this.$el.offsetHeight,this.emitSize())},emitSize:function(){this.$emit("notify",{width:this._w,height:this._h})},addResizeHandlers:function(){this._resizeObject.contentDocument.defaultView.addEventListener("resize",this.compareAndNotify),this.compareAndNotify()},removeResizeHandlers:function(){this._resizeObject&&this._resizeObject.onload&&(!r&&this._resizeObject.contentDocument&&this._resizeObject.contentDocument.defaultView.removeEventListener("resize",this.compareAndNotify),this.$el.removeChild(this._resizeObject),this._resizeObject.onload=null,this._resizeObject=null)}}};function s(e,t,i,n,r,a,l,s,o,c){"boolean"!==typeof l&&(o=s,s=l,l=!1);var d,u="function"===typeof i?i.options:i;if(e&&e.render&&(u.render=e.render,u.staticRenderFns=e.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),n&&(u._scopeId=n),a?(d=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,o(e)),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=d):t&&(d=l?function(e){t.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,s(e))}),d)if(u.functional){var f=u.render;u.render=function(e,t){return d.call(t),f(e,t)}}else{var h=u.beforeCreate;u.beforeCreate=h?[].concat(h,d):[d]}return i}var o=l,c=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"resize-observer",attrs:{tabindex:"-1"}})},d=[];c._withStripped=!0;var u=void 0,f="data-v-8859cc6c",h=void 0,m=!1,p=s({render:c,staticRenderFns:d},u,o,f,m,h,!1,void 0,void 0,void 0);function b(e){e.component("resize-observer",p),e.component("ResizeObserver",p)}var v={version:"1.0.1",install:b},y=null;"undefined"!==typeof window?y=window.Vue:"undefined"!==typeof i.g&&(y=i.g.Vue),y&&y.use(v)},87585:function(e,t,i){"use strict";i.d(t,{EK:function(){return F}});var n={itemsLimit:1e3},r=i(26274),a=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"observe-visibility",rawName:"v-observe-visibility",value:e.handleVisibilityChange,expression:"handleVisibilityChange"}],ref:"scroller",staticClass:"vue-recycle-scroller",class:(0,r.Z)({ready:e.ready,"page-mode":e.pageMode},"direction-".concat(e.direction),!0),attrs:{role:"application"},on:{"&scroll":function(t){return e.handleScroll.apply(null,arguments)},contextmenu:e.handleHideActions,keydown:[function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnPrev.apply(null,arguments))},function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?null:(t.stopPropagation(),t.preventDefault(),e.focusOnNext.apply(null,arguments))}],focus:function(t){return t.target!==t.currentTarget?null:e.handleFocus.apply(null,arguments)}}},[e.$slots.before?t("div",{staticClass:"vue-recycle-scroller__slot",on:{contextmenu:e.handleHideActions}},[e._t("before")],2):e._e(),t("div",{ref:"wrapper",staticClass:"vue-recycle-scroller__item-wrapper",style:(0,r.Z)({},"vertical"===e.direction?"minHeight":"minWidth",e.totalSize+"px"),attrs:{id:e.id}},[t("transition-group",{attrs:{name:"scroll-item-fade",tag:"div"}},e._l(e.pool,(function(i){return t("div",{key:i.nr.id,ref:i.nr.id,refInFor:!0,staticClass:"vue-recycle-scroller__item-view",class:{hover:e.hoverKey===i.nr.key,__in__view:e.ready&&i.nr.used},style:e.ready&&i.nr.used?{transform:"translate".concat("vertical"===e.direction?"Y":"X","(").concat(i.position,"px)")}:{display:"none"},attrs:{tabindex:"-1"},on:{mouseenter:function(t){e.hoverKey=i.nr.key},mouseleave:function(t){e.hoverKey=null}}},[e._t("default",null,{item:i.item,index:i.nr.index,active:i.nr.used})],2)})),0)],1),e.$slots.after?t("div",{ref:"after",staticClass:"vue-recycle-scroller__slot vue-recycle-scroller-after__slot",on:{contextmenu:e.handleHideActions}},[e._t("after")],2):e._e(),t("ResizeObserver",{on:{notify:e.handleResize}})],1)},l=[],s=i(34948),o=(i(6886),i(43430),i(71372),i(34494)),c=i(56632);i(634);function d(e){return d="function"===typeof Symbol&&"symbol"===(0,c.Z)(Symbol.iterator)?function(e){return(0,c.Z)(e)}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":(0,c.Z)(e)},d(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function f(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t,i){return t&&f(e.prototype,t),i&&f(e,i),e}function m(e){return p(e)||b(e)||v()}function p(e){if(Array.isArray(e)){for(var t=0,i=new Array(e.length);t<e.length;t++)i[t]=e[t];return i}}function b(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function v(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function y(e){var t;return t="function"===typeof e?{callback:e}:e,t}function k(e,t){var i,n,r,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=function(l){for(var s=arguments.length,o=new Array(s>1?s-1:0),c=1;c<s;c++)o[c-1]=arguments[c];if(r=o,!i||l!==n){var d=a.leading;"function"===typeof d&&(d=d(l,n)),i&&l===n||!d||e.apply(void 0,[l].concat(m(r))),n=l,clearTimeout(i),i=setTimeout((function(){e.apply(void 0,[l].concat(m(r))),i=0}),t)}};return l._clear=function(){clearTimeout(i),i=null},l}function g(e,t){if(e===t)return!0;if("object"===d(e)){for(var i in e)if(!g(e[i],t[i]))return!1;return!0}return!1}var C=function(){function e(t,i,n){u(this,e),this.el=t,this.observer=null,this.frozen=!1,this.createObserver(i,n)}return h(e,[{key:"createObserver",value:function(e,t){var i=this;if(this.observer&&this.destroyObserver(),!this.frozen){if(this.options=y(e),this.callback=function(e,t){i.options.callback(e,t),e&&i.options.once&&(i.frozen=!0,i.destroyObserver())},this.callback&&this.options.throttle){var n=this.options.throttleOptions||{},r=n.leading;this.callback=k(this.callback,this.options.throttle,{leading:function(e){return"both"===r||"visible"===r&&e||"hidden"===r&&!e}})}this.oldResult=void 0,this.observer=new IntersectionObserver((function(e){var t=e[0];if(e.length>1){var n=e.find((function(e){return e.isIntersecting}));n&&(t=n)}if(i.callback){var r=t.isIntersecting&&t.intersectionRatio>=i.threshold;if(r===i.oldResult)return;i.oldResult=r,i.callback(r,t)}}),this.options.intersection),t.context.$nextTick((function(){i.observer&&i.observer.observe(i.el)}))}}},{key:"destroyObserver",value:function(){this.observer&&(this.observer.disconnect(),this.observer=null),this.callback&&this.callback._clear&&(this.callback._clear(),this.callback=null)}},{key:"threshold",get:function(){return this.options.intersection&&"number"===typeof this.options.intersection.threshold?this.options.intersection.threshold:0}}]),e}();function I(e,t,i){var n=t.value;if(n)if("undefined"===typeof IntersectionObserver)console.warn("[vue-observe-visibility] IntersectionObserver API is not available in your browser. Please install this polyfill: https://github.com/w3c/IntersectionObserver/tree/master/polyfill");else{var r=new C(e,n,i);e._vue_visibilityState=r}}function $(e,t,i){var n=t.value,r=t.oldValue;if(!g(n,r)){var a=e._vue_visibilityState;n?a?a.createObserver(n,i):I(e,{value:n},i):z(e)}}function z(e){var t=e._vue_visibilityState;t&&(t.destroyObserver(),delete e._vue_visibilityState)}var _={bind:I,update:$,unbind:z};function w(e){e.directive("observe-visibility",_)}var x={version:"1.0.0",install:w},S=null;"undefined"!==typeof window?S=window.Vue:"undefined"!==typeof i.g&&(S=i.g.Vue),S&&S.use(x);var L=i(66311),D=i.n(L),E={items:{type:Array,required:!0},keyField:{type:String,default:"id"},direction:{type:String,default:"vertical",validator:function(e){return["vertical","horizontal"].includes(e)}},simpleArray:{type:Boolean,default:!1}},A=E,T=!1;if("undefined"!==typeof window){T=!1;try{var O=Object.defineProperty({},"passive",{get:function(){T=!0}});window.addEventListener("test",null,O)}catch(Y){}}var M=i(29648),V=(i(37761),0),Z={name:"RecycleScroller",components:{ResizeObserver:o["do"]},directives:{ObserveVisibility:_},props:(0,s.Z)((0,s.Z)({},A),{},{itemSize:{type:Number,default:null},minItemSize:{type:[Number,String],default:null},sizeField:{type:String,default:"size"},typeField:{type:String,default:"type"},buffer:{type:Number,default:200},pageMode:{type:Boolean,default:!1},prerender:{type:Number,default:0},emitUpdate:{type:Boolean,default:!1},id:{type:String,default:""}}),data:function(){return{pool:[],totalSize:0,ready:!1,hoverKey:null,focusIndex:-1}},computed:(0,s.Z)((0,s.Z)({},(0,M.rn)({selectMailLabel:function(e){return e.selectMailLabel.id},labelPositionMap:function(e){return e.labelPositionMap}})),{},{sizes:function(){if(null===this.itemSize){for(var e,t={"-1":{accumulator:0}},i=this.items,n=this.sizeField,r=this.minItemSize,a=1e4,l=0,s=0,o=i.length;s<o;s++)e=i[s][n]||r,e<a&&(a=e),l+=e,t[s]={accumulator:l,size:e};return this.$_computedMinItemSize=a,t}return[]}}),watch:{items:function(){this.updateVisibleItems(!0)},pageMode:function(){this.applyPageMode(),this.updateVisibleItems(!1)},focusIndex:function(e){this.focusOn(e)},sizes:{handler:function(){this.updateVisibleItems(!1)},deep:!0}},created:function(){this.$_startIndex=0,this.$_endIndex=0,this.$_views=new Map,this.$_unusedViews=new Map,this.$_scrollDirty=!1,this.$_lastUpdateScrollPosition=0,this.prerender&&(this.$_prerender=!0,this.updateVisibleItems(!1))},activated:function(){var e=this,t=this.$_lastUpdateScrollPosition;"number"===typeof t&&this.$nextTick((function(){e.scrollToPosition(t)}))},mounted:function(){var e=this;this.applyPageMode(),this.$nextTick((function(){e.$_prerender=!1,e.updateVisibleItems(!0),e.ready=!0})),this.addAfterVisibleListener()},beforeDestroy:function(){var e;this.removeListeners(),this.removeAfterVisibleListener(),null===(e=this.forceRepaint)||void 0===e||e.cancel(),this.forceRepaint=null},methods:(0,s.Z)((0,s.Z)({},(0,M.OI)(["setLabelPositionMap"])),{},{handleInboxItemFocus:function(){var e=this;setTimeout((function(){e.focusOn(e.focusIndex)}),100)},handleHideActions:function(){this.$emit("handleHideActions")},addView:function(e,t,i,n,r){var a={item:i,position:0},l={id:V++,index:t,used:!0,key:n,type:r};return Object.defineProperty(a,"nr",{configurable:!1,value:l}),e.push(a),a},unuseView:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.$_unusedViews,n=e.nr.type,r=i.get(n);r||(r=[],i.set(n,r)),r.push(e),t||(e.nr.used=!1,this.$_views["delete"](e.nr.key))},handleResize:function(){this.$emit("resize"),this.ready&&this.updateVisibleItems(!1)},handleScroll:function(e){var t=this;this.$store.commit("setLabelPositionMap",(0,r.Z)({},this.selectMailLabel,this.getScroll().start)),this.$_scrollDirty||(this.$_scrollDirty=!0,requestAnimationFrame((function(){t.$_scrollDirty=!1,t.updateVisibleItems(!1,!0)})))},handleVisibilityChange:function(e,t){var i=this;this.ready&&(e||0!==t.boundingClientRect.width||0!==t.boundingClientRect.height?(this.$emit("visible"),requestAnimationFrame((function(){i.updateVisibleItems(!1)}))):this.$emit("hidden"))},updateVisibleItems:function(e){var t,i,r,a,l,s=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=this.itemSize,c=this.$_computedMinItemSize,d=this.typeField,u=this.simpleArray?null:this.keyField,f=this.items,h=f.length,m=this.sizes,p=this.$_views,b=this.$_unusedViews,v=this.pool;if(h)if(this.$_prerender)i=0,r=this.prerender,a=null;else{var y=this.getScroll();if(s){var k=y.start-this.$_lastUpdateScrollPosition;if(k<0&&(k=-k),null===o&&k<c||k<o)return{continuous:!0}}this.$_lastUpdateScrollPosition=y.start;var g=this.buffer;if(y.start-=g,y.end+=g,null===o){var C,I,$=0,z=h-1,_=~~(h/2);do{I=_,C=m[_].accumulator,C<y.start?$=_:_<h-1&&m[_+1].accumulator>y.start&&(z=_),_=~~(($+z)/2)}while(_!==I);for(_<0&&(_=0),i=_,a=m[h-1].accumulator,r=_;r<h&&m[r].accumulator<y.end;r++);-1===r?r=f.length-1:(r++,r>h&&(r=h))}else i=~~(y.start/o),r=Math.ceil(y.end/o),i<0&&(i=0),r>h&&(r=h),a=h*o}else i=r=a=0;r-i>n.itemsLimit&&this.itemsLimitError(),this.totalSize=a;var w=i<=this.$_endIndex&&r>=this.$_startIndex;if(this.$_continuous!==w){if(w){p.clear(),b.clear();for(var x=0,S=v.length;x<S;x++)l=v[x],this.unuseView(l)}this.$_continuous=w}else if(w)for(var L=0,D=v.length;L<D;L++)l=v[L],l.nr.used&&(e&&(l.nr.index=f.findIndex((function(e){return u?e[u]===l.item[u]:e===l.item}))),(-1===l.nr.index||l.nr.index<i||l.nr.index>=r)&&this.unuseView(l));for(var E,A,T,O,M=w?null:new Map,V=i;V<r;V++){E=f[V];var Z=E[u]||E;if(null==Z)throw new Error("Key is ".concat(Z," on item (keyField is '").concat(u,"')"));l=p.get(Z),o||m[V].size?(l?(l.nr.used=!0,l.item=E):(V===f.length-1&&this.$emit("scrollEnd"),0===V&&this.$emit("scrollStart"),A=E[d],T=b.get(A),w?T&&T.length?(l=T.pop(),l.item=E,l.nr.used=!0,l.nr.index=V,l.nr.key=Z,l.nr.type=A):l=this.addView(v,V,E,Z,A):(O=M.get(A)||0,(!T||O>=T.length)&&(l=this.addView(v,V,E,Z,A),this.unuseView(l,!0),T=b.get(A)),l=T[O],l.item=E,l.nr.used=!0,l.nr.index=V,l.nr.key=Z,l.nr.type=A,M.set(A,O+1),O++),p.set(Z,l)),l.position=null===o?m[V-1].accumulator:V*o):l&&this.unuseView(l)}return this.$_startIndex=i,this.$_endIndex=r,this.emitUpdate&&this.$emit("update",i,r),null===(t=this.forceRepaint)||void 0===t||t.call(this),{continuous:w}},getListenerTarget:function(){var e=D()(this.$el);return!window.document||e!==window.document.documentElement&&e!==window.document.body||(e=window),e},getScroll:function(){var e,t=this.$el,i=this.direction,n="vertical"===i;if(this.pageMode){var r=t.getBoundingClientRect(),a=n?r.height:r.width,l=-(n?r.top:r.left),s=n?window.innerHeight:window.innerWidth;l<0&&(s+=l,l=0),l+s>a&&(s=a-l),e={start:l,end:l+s}}else e=n?{start:t.scrollTop,end:t.scrollTop+(t.clientHeight||window.innerHeight)}:{start:t.scrollLeft,end:t.scrollLeft+(t.clientWidth||window.innerWidth)};return e},applyPageMode:function(){this.pageMode?this.addListeners():this.removeListeners()},addListeners:function(){this.listenerTarget=this.getListenerTarget(),this.listenerTarget.addEventListener("scroll",this.handleScroll,!!T&&{passive:!0}),this.listenerTarget.addEventListener("resize",this.handleResize)},removeListeners:function(){this.listenerTarget&&(this.listenerTarget.removeEventListener("scroll",this.handleScroll),this.listenerTarget.removeEventListener("resize",this.handleResize),this.listenerTarget=null)},scrollToItem:function(e){var t=this;this.$nextTick((function(){var i;i=t.itemSize?e*t.itemSize:e>0?t.sizes[e-1].accumulator:0,t.scrollToPosition(i)}))},scrollToPosition:function(e){"vertical"===this.direction?this.$el.scrollTop=e:this.$el.scrollLeft=e},itemsLimitError:function(){var e=this;throw setTimeout((function(){console.log("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",e.$el),console.log("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")})),new Error("Rendered items limit reached")},sortViews:function(){this.pool.sort((function(e,t){return e.nr.index-t.nr.index}))},focusOnPrev:function(){this.focusIndex<0?this.focusIndex=0:this.focusIndex=Math.max(this.$_startIndex,this.focusIndex-1)},focusOnNext:function(){this.focusIndex<0?this.focusIndex=0:this.focusIndex=Math.min(this.focusIndex+1,this.$_endIndex-1)},focusOn:function(e){var t;if(!(e<0)){var i=this.$_startIndex>e||this.$_endIndex<e;i&&this.scrollToItem(e);var n=this.pool.find((function(t){var i=t.nr;return i.index===e})),r=this.$refs[null===n||void 0===n||null===(t=n.nr)||void 0===t?void 0:t.id][0];null===r||void 0===r||r.firstElementChild.focus()}},handleFocus:function(){this.focusIndex=-1},addAfterVisibleListener:function(){var e=this,t=this.$refs.wrapper,i=this.$refs.scroller;this.observer=new IntersectionObserver((function(n){n.forEach((function(n){var r=i.scrollTop+i.clientHeight>=t.clientHeight;n.isIntersecting&&r&&e.$emit("onLoadMore")}))}),{root:this.$refs.scroller}),this.$refs.after&&this.observer.observe(this.$refs.after)},removeAfterVisibleListener:function(){this.observer.disconnect(),this.observer=null}})},R=Z,N=i(93483),P=(0,N.Z)(R,a,l,!1,null,"127b444a",null),F=P.exports,U=function(){var e=this,t=e._self._c;return t("RecycleScroller",e._g(e._b({ref:"scroller",attrs:{items:e.itemsWithSize,"min-item-size":e.minItemSize,direction:e.direction,"key-field":"id"},on:{resize:e.onScrollerResize,visible:e.onScrollerVisible,scrollEnd:e.onScrollEnd},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.item,n=t.index,r=t.active;return[e._t("default",null,null,{item:i.item,index:n,active:r,itemWithSize:i})]}}],null,!0)},"RecycleScroller",e.$attrs,!1),e.listeners),[t("template",{slot:"before"},[e._t("before")],2),t("template",{slot:"after"},[e._t("after")],2)],2)},H=[],B=i(84282),j={name:"DynamicScroller",components:{RecycleScroller:F},inheritAttrs:!1,provide:function(){return"undefined"!==typeof ResizeObserver&&(this.$_resizeObserver=new ResizeObserver((function(e){var t,i=(0,B.Z)(e);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(n.target){var r=new CustomEvent("resize",{detail:{contentRect:n.contentRect}});n.target.dispatchEvent(r)}}}catch(a){i.e(a)}finally{i.f()}}))),{vscrollData:this.vscrollData,vscrollParent:this,vscrollResizeObserver:this.$_resizeObserver}},props:(0,s.Z)((0,s.Z)({},A),{},{minItemSize:{type:[Number,String],required:!0}}),data:function(){return{vscrollData:{active:!0,sizes:{},validSizes:{},keyField:this.keyField,simpleArray:!1}}},computed:{itemsWithSize:function(){for(var e=[],t=this.items,i=this.keyField,n=this.simpleArray,r=this.vscrollData.sizes,a=0;a<t.length;a++){var l=t[a],s=n?a:l[i],o=r[s];"undefined"!==typeof o||this.$_undefinedMap[s]||(o=0),e.push({item:l,id:s,size:o})}return e},listeners:function(){var e={};for(var t in this.$listeners)"resize"!==t&&"visible"!==t&&(e[t]=this.$listeners[t]);return e}},watch:{items:function(){this.forceUpdate(!1)},simpleArray:{handler:function(e){this.vscrollData.simpleArray=e},immediate:!0},direction:function(e){this.forceUpdate(!0)}},created:function(){this.$_updates=[],this.$_undefinedSizes=0,this.$_undefinedMap={}},activated:function(){this.vscrollData.active=!0},deactivated:function(){this.vscrollData.active=!1},methods:{onScrollerResize:function(){var e=this.$refs.scroller;e&&this.forceUpdate(),this.$emit("resize")},onScrollerVisible:function(){this.$emit("vscroll:update",{force:!1}),this.$emit("visible")},forceUpdate:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];(e||this.simpleArray)&&(this.vscrollData.validSizes={}),this.$emit("vscroll:update",{force:!0})},scrollToItem:function(e){var t=this.$refs.scroller;t&&t.scrollToItem(e)},getItemSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0,i=this.simpleArray?null!=t?t:this.items.indexOf(e):e[this.keyField];return this.vscrollData.sizes[i]||0},scrollToBottom:function(){var e=this;if(!this.$_scrollingToBottom){this.$_scrollingToBottom=!0;var t=this.$el;this.$nextTick((function(){t.scrollTop=t.scrollHeight+5e3;var i=function i(){t.scrollTop=t.scrollHeight+5e3,requestAnimationFrame((function(){t.scrollTop=t.scrollHeight+5e3,0===e.$_undefinedSizes?e.$_scrollingToBottom=!1:requestAnimationFrame(i)}))};requestAnimationFrame(i)}))}},onScrollEnd:function(){this.$emit("scrollEnd")}}},q=j,K=(0,N.Z)(q,U,H,!1,null,null,null),W=K.exports,G=i(74032);function Q(e,t){e.component("".concat(t,"recycle-scroller"),F),e.component("".concat(t,"RecycleScroller"),F),e.component("".concat(t,"dynamic-scroller"),W),e.component("".concat(t,"DynamicScroller"),W),e.component("".concat(t,"dynamic-scroller-item"),G.Z),e.component("".concat(t,"DynamicScrollerItem"),G.Z)}var X={version:"0.0.1",install:function(e,t){var i=Object.assign({},{installComponents:!0,componentsPrefix:""},t);for(var r in i)"undefined"!==typeof i[r]&&(n[r]=i[r]);i.installComponents&&Q(e,i.componentsPrefix)}},J=null;"undefined"!==typeof window?J=window.Vue:"undefined"!==typeof i.g&&(J=i.g.Vue),J&&J.use(X)},66311:function(e,t,i){var n,r,a;i(76716)["default"];i(77950),i(77950),function(i,l){r=[],n=l,a="function"===typeof n?n.apply(t,r):n,void 0===a||(e.exports=a)}(0,(function(){var e=/(auto|scroll)/,t=function e(t,i){return null===t.parentNode?i:e(t.parentNode,i.concat([t]))},i=function(e,t){return getComputedStyle(e,null).getPropertyValue(t)},n=function(e){return i(e,"overflow")+i(e,"overflow-y")+i(e,"overflow-x")},r=function(t){return e.test(n(t))},a=function(e){if(e instanceof HTMLElement||e instanceof SVGElement){for(var i=t(e.parentNode,[]),n=0;n<i.length;n+=1)if(r(i[n]))return i[n];return document.scrollingElement||document.documentElement}};return a}))}}]);
|