"use strict";(self["webpackChunk_zoom_client_email_desktop"]=self["webpackChunk_zoom_client_email_desktop"]||[]).push([[617],{5617:function(i,t,l){l.r(t),l.d(t,{default:function(){return u}});var n=function(){var i=this,t=i._self._c;return t("zm-dialog",{attrs:{title:i.$t("editor.editLink"),visible:i.visible,"show-close":!1,width:"600px","append-to-body":"","aria-labelledby":i.$t("editor.editLink"),"aria-describedby":i.$t("editor.editLink")},on:{close:i.close}},[t("div",{staticClass:"link-input"},[t("zm-form",{attrs:{"label-width":"140px","label-position":"left"}},[t("zm-form-item",{attrs:{label:i.$t("editor.textToDisplay")}},[t("zm-input",{ref:"linkDisplayText",attrs:{disabled:i.isInputTextDisabled,"focus-first":"",max:"maxlength",maxlength:"2048"},on:{change:i.unsetSync},model:{value:i.linkDisplayText,callback:function(t){i.linkDisplayText=t},expression:"linkDisplayText"}})],1),t("zm-form-item",{attrs:{label:i.$t("editor.linkTo")}},[t("zm-input",{ref:"linkUrl",attrs:{maxlength:"2048"},model:{value:i.linkUrl,callback:function(t){i.linkUrl=t},expression:"linkUrl"}})],1)],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("zm-button",{on:{click:i.onCancel}},[i._v(i._s(i.$t("operation.cancel")))]),t("zm-button",{attrs:{"focus-first":"",type:"primary",disabled:!i.isLinkUrlValid},on:{click:i.onConfirm}},[i._v(i._s(i.$t("operation.confirm")))])],1)])},e=[],s=l(87693),o={name:"AddEditorLinkDialog",props:{text:{type:String,default:""},link:{type:String,default:""}},data:function(){return{linkDisplayText:"",linkUrl:"",visible:!1,isDisplayTextSyncToUrl:!1}},computed:{isInputTextDisabled:function(){return 0!==this.text.trim().length},trimmedLowCaseLinkUrl:function(i){var t=i.linkUrl;return t.trim().toLowerCase()},isLinkUrlValid:function(i){var t=i.trimmedLowCaseLinkUrl;return!!t.length&&s.oc.test(t)}},watch:{linkUrl:function(i){this.isDisplayTextSyncToUrl&&(this.linkDisplayText=i)}},methods:{open:function(){var i=this;this.visible=!0,this.$nextTick((function(){var t;(i.linkDisplayText=i.text.trim(),i.linkUrl=i.link,i.isDisplayTextSyncToUrl=!i.linkDisplayText,i.isInputTextDisabled)&&(null===(t=i.$refs.linkUrl)||void 0===t||t.focus())}))},close:function(){this.linkDisplayText="",this.linkUrl="",this.visible=!1},unsetSync:function(){this.isDisplayTextSyncToUrl=!1},onCancel:function(){this.close(),this.$emit("cancel")},onConfirm:function(){if(!this.linkUrl.includes(":")){var i=this.linkUrl.split("://");this.linkUrl="http://".concat(i[2===i.length?1:0])}this.$emit("confirm",this.linkDisplayText,this.linkUrl),this.close()}}},r=o,a=l(93483),c=(0,a.Z)(r,n,e,!1,null,null,null),u=c.exports}}]);