/*! * froala_editor v4.0.11 (https://www.froala.com/wysiwyg-editor) * License https://froala.com/wysiwyg-editor/terms/ * Copyright 2014-2022 Froala Labs */ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(require("froala-editor")):"function"==typeof define&&define.amd?define(["froala-editor"],t):t(e.FroalaEditor)}(this,function(It){"use strict";function Lt(e){return(Lt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}It=It&&It.hasOwnProperty("default")?It["default"]:It,Object.assign(It.POPUP_TEMPLATES,{"filesManager.insert":"[_BUTTONS_][_UPLOAD_LAYER_][_BY_URL_LAYER_][_EMBED_LAYER_][_UPLOAD_PROGRESS_LAYER_][_PROGRESS_BAR_]","image.edit":"[_BUTTONS_]","image.alt":"[_BUTTONS_][_ALT_LAYER_]","image.size":"[_BUTTONS_][_SIZE_LAYER_]"}),Object.assign(It.DEFAULTS,{filesInsertButtons:["imageBack","|","filesUpload","filesByURL","filesEmbed"],filesInsertButtons2:["deleteAll","insertAll","cancel","minimize"],imageEditButtons:["imageReplace","imageAlign","imageCaption","imageRemove","imageLink","linkOpen","linkEdit","linkRemove","-","imageDisplay","imageStyle","imageAlt","imageSize"],imageAltButtons:["imageBack","|"],imageSizeButtons:["imageBack","|"],imageUpload:!0,filesManagerUploadURL:null,imageCORSProxy:"https://cors-anywhere.froala.com",imageUploadRemoteUrls:!0,filesManagerUploadParam:"file",filesManagerUploadParams:{},googleOptions:{},filesManagerUploadToS3:!1,filesManagerUploadToAzure:!1,filesManagerUploadMethod:"POST",filesManagerMaxSize:10485760,filesManagerAllowedTypes:["*"],imageResize:!0,imageResizeWithPercent:!1,imageRoundPercent:!1,imageDefaultWidth:300,imageDefaultAlign:"center",imageDefaultDisplay:"block",imageSplitHTML:!1,imageStyles:{"fr-rounded":"Rounded","fr-bordered":"Bordered","fr-shadow":"Shadow"},imageMove:!0,imageMultipleStyles:!0,imageTextNear:!0,imagePaste:!0,imagePasteProcess:!1,imageMinWidth:16,imageOutputSize:!1,imageDefaultMargin:5,imageAddNewLine:!1}),It.VIDEO_PROVIDERS=[{test_regex:/^.*((youtu.be)|(youtube.com))\/((v\/)|(\/u\/\w\/)|(embed\/)|(watch\?))?\??v?=?([^#\&\?]*).*/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube\.com|youtu\.be)\/(?:watch\?v=|embed\/)?([0-9a-zA-Z_\-]+)(.+)?/g,url_text:"https://www.youtube.com/embed/$1?$2",html:'',provider:"youtube"},{test_regex:/^.*(?:vimeo.com)\/(?:channels(\/\w+\/)?|groups\/*\/videos\/\u200b\d+\/|video\/|)(\d+)(?:$|\/|\?)/,url_regex:/(?:https?:\/\/)?(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?(\/[a-zA-Z0-9_\-]+)?/i,url_text:"https://player.vimeo.com/video/$1",html:'',provider:"vimeo"},{test_regex:/^.+(dailymotion.com|dai.ly)\/(video|hub)?\/?([^_]+)[^#]*(#video=([^_&]+))?/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:dailymotion\.com|dai\.ly)\/(?:video|hub)?\/?(.+)/g,url_text:"https://www.dailymotion.com/embed/video/$1",html:'',provider:"dailymotion"},{test_regex:/^.+(screen.yahoo.com)\/[^_&]+/,url_regex:"",url_text:"",html:'',provider:"yahoo"},{test_regex:/^.+(rutube.ru)\/[^_&]+/,url_regex:/(?:https?:\/\/)?(?:www\.)?(?:rutube\.ru)\/(?:video)?\/?(.+)/g,url_text:"https://rutube.ru/play/embed/$1",html:'',provider:"rutube"},{test_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/,url_regex:/^(?:.+)vidyard.com\/(?:watch)?\/?([^.&/]+)\/?(?:[^_.&]+)?/g,url_text:"https://play.vidyard.com/$1",html:'',provider:"vidyard"}],It.VIDEO_EMBED_REGEX=/^\W*(((\s|\n)*<\/iframe>)|())\W*$/i,It.IMAGE_EMBED_REGEX=/^\W*(((\s|\n)*))\W*$/i,It.IMAGE_TYPE="image/png",It.IMAGE_ALLOW_REGEX=/\.(gif|jpe?g|tiff?|png|webp|bmp)$/i,It.PLUGINS.filesManager=function(A){var x,o,C,l,d,f,s,c,I=A.$,M="https://i.froala.com/upload",p=!1,t=!1,L=new Map,_=new Map,E=new Map,k=new Map,D=new Map,S=new Map,r=0,a=[],g=-1,T=[],u=0,m=["file","image","imageTUI","video"],B=1,v=2,R=3,U=4,z=5,O=6,$=10,P=["video/avi","video/mpeg","video/x-ms-wmv"],h={};function b(){var e=A.popups.get("filesManager.insert"),t=e.find(".fr-files-by-url-layer input");t.val(""),e.find(".fr-files-embed-layer textarea").val("").trigger("change"),t.trigger("change")}function y(e){var t;A.hasOwnProperty("imageTUI")||(s="fr-disabled"),S.forEach(function(e,t){q(t)}),w()?(t=A.popups.get("filesManager.insert"))||(t=Fe()):(t=A.popups.get("filesManager.insert"))||(t=function o(){var e='
'.concat(A.button.buildList(A.opts.fileInsertButtons),"
"),t="
\n

".concat(A.language.translate(function a(){var e="",t=function i(){var t=[];return m.forEach(function(e){A.opts.pluginsEnabled.indexOf(e)<0&&t.push(e.charAt(0).toUpperCase()+e.slice(1))}),t}();e=t.join(", "),1

\n
\n \n \n
"),i={buttons:e,upload_layer:t,by_url_layer:"",embed_layer:"",upload_progress_layer:"",progress_bar:""},n=A.popups.create("filesManager.insert",i);return Be(n),n}());var i=A.$tb.find('.fr-command[data-cmd="insertFiles"]');if(Q(),e||!t.hasClass("fr-active"))if(e||Z(),A.popups.refresh("filesManager.insert"),A.popups.setContainer("filesManager.insert",A.$tb),i.isVisible()){var n=A.button.getPosition(i,L.size),a=n.left,r=n.top;A.popups.show("filesManager.insert",a,r,i.outerHeight())}else A.position.forSelection(t),A.popups.show("filesManager.insert");A.popups.setPopupDimensions(t),w()&&A.popups.setFileListHeight(t),t.find(".fr-upload-progress")&&0==L.size&&t.find(".fr-upload-progress").addClass("fr-none")}function w(){var t=!0;return m.forEach(function(e){A.opts.pluginsEnabled.indexOf(e)<0&&(t=!1)}),t}function F(){Q()}function N(){if(l||function o(){var e;A.shared.$image_resizer?(l=A.shared.$image_resizer,f=A.shared.$img_overlay,A.events.on("destroy",function(){I("body").first().append(l.removeClass("fr-active"))},!0)):(A.shared.$image_resizer=I(document.createElement("div")).attr("class","fr-image-resizer"),l=A.shared.$image_resizer,A.events.$on(l,"mousedown",function(e){e.stopPropagation()},!0),A.opts.imageResize&&(l.append(H("nw")+H("ne")+H("sw")+H("se")),A.shared.$img_overlay=I(document.createElement("div")).attr("class","fr-image-overlay"),f=A.shared.$img_overlay,e=l.get(0).ownerDocument,I(e).find("body").first().append(f)));A.events.on("shared.destroy",function(){l.html("").removeData().remove(),l=null,A.opts.imageResize&&(f.remove(),f=null)},!0),A.helpers.isMobile()||A.events.$on(I(A.o_win),"resize",function(){x&&!x.hasClass("fr-uploading")?it(!0):x&&(N(),replace(),J(!1))});if(A.opts.imageResize){e=l.get(0).ownerDocument,A.events.$on(l,A._mousedown,".fr-handler",Y),A.events.$on(I(e),A._mousemove,V),A.events.$on(I(e.defaultView||e.parentWindow),A._mouseup,W),A.events.$on(f,"mouseleave",W);var n=1,a=null,r=0;A.events.on("keydown",function(e){if(x){var t=-1!=navigator.userAgent.indexOf("Mac OS X")?e.metaKey:e.ctrlKey,i=e.which;(i!==a||200"),Ee(x)),a=i,r=e.timeStamp}},!0),A.events.on("keyup",function(){n=1})}}(),!x)return!1;var e=A.$wp||A.$sc;e.append(l),l.data("instance",A);var t=e.scrollTop()-("static"!=e.css("position")?e.offset().top:0),i=e.scrollLeft()-("static"!=e.css("position")?e.offset().left:0);i-=A.helpers.getPX(e.css("border-left-width")),t-=A.helpers.getPX(e.css("border-top-width")),A.$el.is("img")&&A.$sc.is("body")&&(i=t=0);var n=lt();dt()&&(n=n.find(".fr-img-wrap"));var a=0,r=0;A.opts.iframe&&(a=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-top")),r=A.helpers.getPX(A.$wp.find(".fr-iframe").css("padding-left"))),l.css("top",(A.opts.iframe?n.offset().top+a:n.offset().top+t)-1).css("left",(A.opts.iframe?n.offset().left+r:n.offset().left+i)-1).css("width",n.get(0).getBoundingClientRect().width).css("height",n.get(0).getBoundingClientRect().height).addClass("fr-active")}function H(e){return'
')}function K(e){dt()?x.parents(".fr-img-caption").css("width",e):x.css("width",e)}function Y(e){if(!A.core.sameInstance(l))return!0;if(e.preventDefault(),e.stopPropagation(),A.$el.find("img.fr-error").left)return!1;A.undo.canDo()||A.undo.saveStep();var t=e.pageX||e.originalEvent.touches[0].pageX;if("mousedown"==e.type){var i=A.$oel.get(0).ownerDocument,n=i.defaultView||i.parentWindow,a=!1;try{a=n.location!=n.parent.location&&!(n.$&&n.$.FE)}catch(s){}a&&n.frameElement&&(t+=A.helpers.getPX(I(n.frameElement).offset().left)+n.frameElement.clientLeft)}(d=I(this)).data("start-x",t),d.data("start-width",x.width()),d.data("start-height",x.height());var r=x.width();if(A.opts.imageResizeWithPercent){var o=x.parentsUntil(A.$el,A.html.blockTagsQuery()).get(0)||A.el;r=(r/I(o).outerWidth()*100).toFixed(2)+"%"}K(r),f.show(),A.popups.hideAll(),rt()}function V(e){if(!A.core.sameInstance(l))return!0;var t;if(d&&x){if(e.preventDefault(),A.$el.find("img.fr-error").left)return!1;var i=e.pageX||(e.originalEvent.touches?e.originalEvent.touches[0].pageX:null);if(!i)return!1;var n=i-d.data("start-x"),a=d.data("start-width");if((d.hasClass("fr-hnw")||d.hasClass("fr-hsw"))&&(n=0-n),A.opts.imageResizeWithPercent){var r=x.parentsUntil(A.$el,A.html.blockTagsQuery()).get(0)||A.el;a=((a+n)/I(r).outerWidth()*100).toFixed(2),A.opts.imageRoundPercent&&(a=Math.round(a)),K("".concat(a,"%")),(t=dt()?(A.helpers.getPX(x.parents(".fr-img-caption").css("width"))/I(r).outerWidth()*100).toFixed(2):(A.helpers.getPX(x.css("width"))/I(r).outerWidth()*100).toFixed(2))===a||A.opts.imageRoundPercent||K("".concat(t,"%")),x.css("height","").removeAttr("height")}else a+n>=A.opts.imageMinWidth&&(K(a+n),t=dt()?A.helpers.getPX(x.parents(".fr-img-caption").css("width")):A.helpers.getPX(x.css("width"))),t!==a+n&&K(t),((x.attr("style")||"").match(/(^height:)|(; *height:)/)||x.attr("height"))&&(x.css("height",d.data("start-height")*x.width()/d.data("start-width")),x.removeAttr("height"));N(),A.events.trigger("image.resize",[st()])}}function W(e){if(!A.core.sameInstance(l))return!0;if(d&&x){if(e&&e.stopPropagation(),A.$el.find("img.fr-error").left)return!1;d=null,f.hide(),N(),A.undo.saveStep(),A.events.trigger("image.resizeEnd",[st()])}else l.removeClass("fr-active")}function G(){S.forEach(function(e,t){var i=A.popups.get("filesManager.insert");i.find(".fr-checkbox-file-"+t).get(0).disabled=!0,document.getElementById("fr-file-autoplay-button-"+t)&&(document.getElementById("fr-file-autoplay-button-"+t).disabled=!0,document.getElementById("fr-file-autoplay-button-"+t).parentElement.classList.add("fr-checkbox-disabled"),document.getElementById("fr-file-autoplay-button-"+t).parentElement.classList.remove("fr-files-checkbox")),i.find(".fr-checkbox-"+t).get(0).classList.remove("fr-files-checkbox"),i.find(".fr-checkbox-"+t).get(0).classList.add("fr-checkbox-disabled")})}function X(e,t,i,n){A.edit.on(),x&&x.addClass("fr-error"),h[e]?(e!=R&&e!=v&&e!=U||we(100,n,!0),S.set(n,h[e]),G(),function a(){S.forEach(function(e,t){A.popups.get("filesManager.insert"),document.getElementById("fr-file-edit-button-".concat(t))&&(document.getElementById("fr-file-edit-button-".concat(t)).classList.add("fr-disabled"),document.getElementById("fr-file-view-button-".concat(t)).classList.add("fr-disabled"),document.getElementById("fr-file-insert-button-".concat(t)).classList.add("fr-disabled"))})}(),ie(A.language.translate(h[e]),n)):ie(A.language.translate("Something went wrong. Please try again."),n),!x&&i&&je(i),A.events.trigger("filesManager.error",[{code:e,message:h[e]},t,i])}function j(){var e=A.popups.get("filesManager.insert"),t=e.find('.fr-command[data-cmd="insertAll"]'),i=e.find('.fr-command[data-cmd="deleteAll"]'),n=!0;D.forEach(function a(e,t,i){D.get(t)&&(n=!1)}),n?t.addClass("fr-disabled"):t.removeClass("fr-disabled"),n?i.addClass("fr-disabled"):i.removeClass("fr-disabled")}function q(e){_.get(e)&&_.get(e).link&&A.events.trigger("filesManager.removed",[_.get(e).link]);var t=A.popups.get("filesManager.insert");t.find(".fr-file-"+e).get(0)!==undefined&&(t.find(".fr-file-"+e).get(0).outerHTML=""),_["delete"](e),L["delete"](e),D["delete"](e),j(),0==L.size&&(u=0),S["delete"](e),A.popups.setPopupDimensions(t,!0),A.opts.toolbarBottom?y(!0):A.popups.setPopupDimensions(t),t.find(".fr-upload-progress")&&0==L.size&&t.find(".fr-upload-progress").addClass("fr-none")}function Z(){for(var e=A.popups.get("filesManager.insert"),t=e.find(".fr-insert-checkbox"),i=0;i span").css("width","".concat(t,"%"))):n.find("div").addClass("fr-indeterminate")}}function te(e){J();var t=A.popups.get("filesManager.insert").find(".fr-files-progress-bar-layer");t.addClass("fr-error");var i=t.find("h3");i.text(e),A.events.disableBlur(),i.focus()}function ie(e,t){var i=A.popups.get("filesManager.insert"),n=i.find(".fr-upload-progress-layer"),a=i.find(".fr-file-".concat(t));n.addClass("fr-error"),a.find("h5").text(e)}h[B]="File cannot be loaded from the passed link.",h[v]="No link in upload response.",h[R]="Error during file upload.",h[U]="Parsing response failed.",h[z]="File is too large.",h[O]="File type is invalid.",h[7]="Files can be uploaded only to same domain in IE 8 and IE 9.",h[8]="File is corrupted.",h[9]="Error during file loading.",h[$]="File upload cancelled";var i,ne,ae,re,oe,se,n,le,de,fe,ce="";function pe(e){ce=e,i=document.getElementsByClassName(e),Array.prototype.map.call(i,function(e){!function n(e){if(e.addEventListener("dragover",function(e){e.preventDefault(),e.stopPropagation(),ne=e.pageX,ae=e.pageY;var t=document.getElementById("filesList");ae+20>t.getBoundingClientRect().bottom&&ge(t,0,10),ae-20a.getBoundingClientRect().bottom&&ge(a,0,5),e.targetTouches[0].clientY-5\n
\n\n \n
\n ').concat(A.helpers.isMobile()?"
\n
"):"",'\n
\n \n ').concat('','\n \n
\n \n
\n \n
\n Image preview\n
\n\n
\n
\n ").concat(function s(e,t,i){null==t&&(t=100);null==i&&(i="...");return e.length>t?e.substring(0,t-i.length)+i:e}(t.name,20),'\n ').concat(t.name,"\n \n
\n
\n
").concat(i,"\n
\n \n
\n ").concat(function l(e){if(0==e)return"0 Bytes";var t=Math.floor(Math.log(e)/Math.log(1024));return" | "+1*(e/Math.pow(1024,t)).toFixed(2)+" "+["Bytes","KB","MB","GB","TB"][t]}(t.size),"\n
\n
\n\n
\n
\n
\n
\n \n
\n\n
")+ye(e)+"
\n
";n.find(".fr-upload-progress-layer")[0].innerHTML=r+n.find(".fr-upload-progress-layer")[0].innerHTML,L.forEach(function d(e,t,i){D.get(t)&&n.find("input.fr-insert-attr.fr-checkbox-file-".concat(t))[0].setAttribute("checked",null)}),T.forEach(function(e){document.getElementById("fr-file-autoplay-button-"+e).checked=!0}),be(e,t),Q(),A.opts.toolbarBottom?y(!0):A.popups.setPopupDimensions(n),pe("fr-file-list-item")}function he(e){switch(e){case"application/msword":return A.icon.getFileIcon("docIcon");case"application/vnd.openxmlformats-officedocument.wordprocessingml.document":return A.icon.getFileIcon("docxIcon");case"image/gif":return A.icon.getFileIcon("gifIcon");case"image/jpeg":return A.icon.getFileIcon("jpegIcon");case"image/jpeg":return A.icon.getFileIcon("jpgIcon");case"type/text":return A.icon.getFileIcon("logIcon");case"video/quicktime":return A.icon.getFileIcon("movIcon");case"audio/mp3":case"audio/mpeg":return A.icon.getFileIcon("mp3Icon");case"video/mp4":return A.icon.getFileIcon("mp4Icon");case"audio/ogg":return A.icon.getFileIcon("oggIcon");case"video/ogg":return A.icon.getFileIcon("ogvIcon");case"application/pdf":return A.icon.getFileIcon("pdfIcon");case"image/png":return A.icon.getFileIcon("pngIcon");case"text/plain":return A.icon.getFileIcon("txtIcon");case"video/webm":return A.icon.getFileIcon("webmIcon");case"image/webp":return A.icon.getFileIcon("webpIcon");case"video/x-ms-wmv":return A.icon.getFileIcon("wmvIcon");case"application/vnd.ms-excel":return A.icon.getFileIcon("xlsIcon");case"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":return A.icon.getFileIcon("xlsxIcon");case"application/x-zip-compressed":case"application/zip":return A.icon.getFileIcon("zipIcon");default:return A.icon.getFileIcon("defaultIcon")}}function be(n,a,e){var r=A.popups.get("filesManager.insert"),t=r.find(".fr-file-item-icon-"+n).get(0);if(Ue(Le(a))&&"image/gif"!=Le(a)&&"image/webp"!=Le(a)){"a"!=t.children[0].localName&&(t.innerHTML=""+t.innerHTML+"");r.find(".fr-file-item-icon-"+n).get(0).children[0].children[0];var o=new FileReader;if(null!=e&&e){var i=L.get(n);a.name=i.name,L.set(n,a)}if(o.onloadend=function(){r.find(".fr-file-item-icon-"+n).get(0).children[0].children[0].src=o.result;for(var e=atob(o.result.split(",")[1]),t=[],i=0;i\n '.concat(s.path,"\n ")}}else{var l=he(Le(a));t.innerHTML='\n '.concat(l.path,"\n ")}}function ye(e){var t="";if(Oe(Le(L.get(e)))){var i="fr-files-checkbox",n="";Pe(Le(L.get(e)))||(i="fr-checkbox-disabled",n="disabled");t='\n
\n
\n \n \n\n ").concat(''," \n
\n \n
")}var a="application/msword",r="application/vnd.openxmlformats-officedocument.wordprocessingml.document",o="";return!$e(Le(L.get(e)))&&Pe(Le(L.get(e)))||(s="fr-disabled"),Oe(Le(L.get(e)))&&(s="fr-disabled"),ze(Le(L.get(e)))&&(s="fr-disabled",Le(L.get(e))!=a&&Le(L.get(e))!=r||A.opts.googleOptions&&!A.helpers.isMobile()&&A.opts.googleOptions.API_KEY&&A.opts.googleOptions.CLIENT_ID&&(s=""),"text/plain"!=Le(L.get(e))&&Le(L.get(e))!=a&&"application/pdf"!=Le(L.get(e))&&Le(L.get(e))!=r&&"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"!=Le(L.get(e))&&"application/vnd.ms-excel"!=Le(L.get(e))&&"type/text"!=Le(L.get(e))||(o="")),"video/url"===Le(L.get(e))&&(s="fr-disabled"),t+='
\n \n\n \n \n \n\n \n \n
\n
\n \n
\n\n
\n\n
\n ")}function we(e,t,i){var n=A.popups.get("filesManager.insert");if(!i&&e<=100){n.find(".fr-checkbox-file-"+t).get(0).disabled=!0,n.find(".fr-checkbox-"+t).get(0).classList.remove("fr-files-checkbox"),n.find(".fr-checkbox-"+t).get(0).classList.add("fr-checkbox-disabled");var a=n.find(".fr-file-progress-circle-"+t),r=n.find(".fr-file-upload-percent-"+t);return 50 *")),i=[];for(e=0;e',i.appendChild(n),document.getElementById("signout_button").onclick=a,document.getElementById("cancel_file_edit").onclick=l}function l(){document.getElementById("markSignOut").checked&&gapi.auth2.getAuthInstance().signOut().then(function(){gapi.auth.getToken()&&(gapi.auth.getToken().access_token=undefined)});var e=document.getElementById("editDocContainer");e.parentNode.removeChild(e),document.getElementById("user_area-".concat(p.fileIndex))&&(document.getElementById("user_area-".concat(p.fileIndex)).style.display="none"),function n(e){for(var t=document.getElementsByClassName("fr-doc-edit-".concat(e)),i=0;i').concat(i,""));var a=A.$el.find("#fr-inserted-file");a.removeAttr("id"),A.undo.saveStep(),function M(){var e,t=Array.prototype.slice.call(A.el.querySelectorAll("a.fr-file")),i=[];for(e=0;e'.concat(_.get(s).video,""),!1,A.opts.videoSplitHTML),A.popups.hide("filesManager.insert");var m=A.$el.find(".fr-jiv");m.removeClass("fr-jiv"),m.toggleClass("fr-rv",A.opts.videoResponsive),function E(e,t,i){!A.opts.htmlUntouched&&A.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv".concat(i[0]," fr-dv").concat(t[0]))):"inline"==t?(e.css({display:"inline-block"}),"center"==i?e.css({"float":"none"}):"left"==i?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==i?e.css({textAlign:"left"}):"right"==i?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}(m,A.opts.videoDefaultDisplay,A.opts.videoDefaultAlign),m.toggleClass("fr-draggable",A.opts.videoMove),A.events.trigger("video.inserted",[m]),ke.call(m)}else{var v=_.get(s).link,h=_.get(s).sanitize,b=_.get(s).data,y=_.get(s).$existing_img,w=_.get(s).response;A.edit.off(),h&&(v=A.helpers.sanitizeURL(v)),function k(){var e,t;if(y){A.undo.canDo()||y.find("video").hasClass("fr-uploading")||A.undo.saveStep();var i=y.find("video").data("fr-old-src"),n=y.data("fr-replaced");y.data("fr-replaced",!1),A.$wp?((e=y.clone(!0)).find("video").removeData("fr-old-src").removeClass("fr-uploading"),e.find("video").off("canplay"),i&&y.find("video").attr("src",i),y.replaceWith(e)):e=y;for(var a=e.find("video").get(0).attributes,r=0;r"+A.language.translate("Your browser does not support HTML5 video.")+"");else{var d="",f=document.getElementById("fr-file-autoplay-button-"+a).checked;f&&(d="autoplay"),s=I(document.createElement("span")).attr("contenteditable","false").attr("draggable","true").attr("class","fr-video fr-dv"+A.opts.videoDefaultDisplay[0]+("center"!=A.opts.videoDefaultAlign?" fr-fv"+A.opts.videoDefaultAlign[0]:"")).html('")}s.toggleClass("fr-draggable",A.opts.videoMove),A.edit.on(),A.events.focus(!0),A.selection.restore(),A.undo.saveStep(),A.opts.videoSplitHTML?A.markers.split():A.markers.insert();A.html.wrap();var c=A.$el.find(".fr-marker");A.node.isLastSibling(c)&&c.parent().hasClass("fr-deletable")&&c.insertAfter(c.parent());c.replaceWith(s);var p="";p=$e(n)?"audio":"video",s.find(p).get(0).readyState>s.find(p).get(0).HAVE_FUTURE_DATA||A.helpers.isIOS()?i.call(s.find(p).get(0)):(s.find(p).on("canplaythrough load",i),s.find(p).on("error",i));return s}(v,b,ke,Le(_.get(s)),s),Ae(),A.undo.saveStep(),A.events.trigger("video.inserted",[e,w])}()}A.popups.hide("filesManager.insert"),D["delete"](s);var x=A.popups.get("filesManager.insert");x.find("input.fr-insert-attr.fr-checkbox-file-".concat(s))[0].checked=!1,x.find(".fr-file-"+s).get(0).classList.add("fr-unchecked"),j(),document.getElementById("fr-file-autoplay-button-"+s)&&(document.getElementById("fr-file-autoplay-button-"+s).checked=!1),T=T.filter(function(e){return e!=s})}function De(e,t){try{if(!1===A.events.trigger("filesManager.uploaded",[e],!0))return A.edit.on(),!1;var i=JSON.parse(e);return i.link?i:(X(v,e,null,t),!1)}catch(n){return X(U,e,null,t),!1}}function Se(e,t){try{var i=I(e).find("Location").text(),n=I(e).find("Key").text();return!1===A.events.trigger("filesManager.uploadedToS3",[i,n,e],!0)?(A.edit.on(),!1):i}catch(a){return X(U,e,null,t),!1}}function Te(e,t,i,n){if(-1A.opts.filesManagerMaxSize)return X(z,null,null,n),!1;if(A.opts.filesManagerAllowedTypes.indexOf("*")<0&&A.opts.filesManagerAllowedTypes.indexOf(Le(e))<0)return X(O,null,null,n),!1;var a;if(function w(e){isNaN(e)||(A.popups.get("filesManager.insert").find(".fr-file-item-right-"+e).get(0).innerHTML='
\n \n\n \n\n
\n 0%\n
\n
\n
\n
\n
\n
"),k.set(e,0))}(n),A.drag_support.formdata&&(a=A.drag_support.formdata?new FormData:null),a){var r;if(!1!==A.opts.filesManagerUploadToS3)for(r in a.append("key",A.opts.filesManagerUploadToS3.keyStart+(new Date).getTime()+"-"+(e.name||"untitled")),a.append("success_action_status","201"),a.append("X-Requested-With","xhr"),a.append("Content-Type",Le(e)),A.opts.filesManagerUploadToS3.params)A.opts.filesManagerUploadToS3.params.hasOwnProperty(r)&&a.append(r,A.opts.filesManagerUploadToS3.params[r]);for(r in A.opts.filesManagerUploadParams)A.opts.filesManagerUploadParams.hasOwnProperty(r)&&a.append(r,A.opts.filesManagerUploadParams[r]);a.append(A.opts.filesManagerUploadParam,e,e.name);var o,s,l=A.opts.filesManagerUploadURL;A.opts.filesManagerUploadToS3&&(l=A.opts.filesManagerUploadToS3.uploadURL?A.opts.filesManagerUploadToS3.uploadURL:"https://".concat(A.opts.filesManagerUploadToS3.region,".amazonaws.com/").concat(A.opts.filesManagerUploadToS3.bucket)),A.opts.filesManagerUploadToAzure&&(l=A.opts.filesManagerUploadToAzure.uploadURL?"".concat(A.opts.filesManagerUploadToAzure.uploadURL,"/").concat(e.name):encodeURI("https://".concat(A.opts.filesManagerUploadToAzure.account,".blob.core.windows.net/").concat(A.opts.filesManagerUploadToAzure.container,"/").concat(e.name)),o=l,A.opts.filesManagerUploadToAzure.SASToken&&(l+=A.opts.filesManagerUploadToAzure.SASToken),A.opts.filesManagerUploadMethod="PUT");var d=A.core.getXHR(l,A.opts.filesManagerUploadMethod);if(A.opts.filesManagerUploadToAzure){var f=(new Date).toUTCString();if(!A.opts.filesManagerUploadToAzure.SASToken&&A.opts.filesManagerUploadToAzure.accessKey){var c=A.opts.filesManagerUploadToAzure.account,p=A.opts.filesManagerUploadToAzure.container;if(A.opts.filesManagerUploadToAzure.uploadURL){var g=A.opts.filesManagerUploadToAzure.uploadURL.split("/");p=g.pop(),c=g.pop().split(".")[0]}var u="x-ms-blob-type:BlockBlob\nx-ms-date:".concat(f,"\nx-ms-version:2019-07-07"),m=encodeURI("/"+c+"/"+p+"/"+e.name),v=A.opts.filesManagerUploadMethod+"\n\n\n"+e.size+"\n\n"+Le(e)+"\n\n\n\n\n\n\n"+u+"\n"+m,h=A.cryptoJSPlugin.cryptoJS.HmacSHA256(v,A.cryptoJSPlugin.cryptoJS.enc.Base64.parse(A.opts.filesManagerUploadToAzure.accessKey)).toString(A.cryptoJSPlugin.cryptoJS.enc.Base64),b="SharedKey "+c+":"+h;s=h,d.setRequestHeader("Authorization",b)}for(r in d.setRequestHeader("x-ms-version","2019-07-07"),d.setRequestHeader("x-ms-date",f),d.setRequestHeader("Content-Type",Le(e)),d.setRequestHeader("x-ms-blob-type","BlockBlob"),A.opts.filesManagerUploadParams)A.opts.filesManagerUploadParams.hasOwnProperty(r)&&d.setRequestHeader(r,A.opts.filesManagerUploadParams[r]);for(r in A.opts.filesManagerUploadToAzure.params)A.opts.filesManagerUploadToAzure.params.hasOwnProperty(r)&&d.setRequestHeader(r,A.opts.filesManagerUploadToAzure.params[r])}d.onload=function(){ze(Le(e))?function u(e,t,i,n,a){var r=this.status,o=this.response,s=this.responseXML,l=this.responseText;try{if(A.opts.filesManagerUploadToS3||A.opts.filesManagerUploadToAzure)if(201===r){var d;if(A.opts.filesManagerUploadToAzure){if(!1===A.events.trigger("filesManager.uploadedToAzure",[this.responseURL,a,o],!0))return A.edit.on(),!1;d=n}else d=Se(s,t);if(d){var f={link:d,text:e,response:o,type:i};_.set(t,f)}}else X(U,o||s,null,t);else if(200<=r&&r<300){var c=De(l,t);if(c){var p={link:c.link,text:e,response:o,type:i};_.set(t,p)}}else X(R,o||l,null,t)}catch(g){X(U,o||l,null,t)}}.call(d,e.name,n,Le(e),o,s):function m(e,t,i,n,a){var r=this.status,o=this.response,s=this.responseXML,l=this.responseText;try{if(A.opts.filesManagerUploadToS3||A.opts.filesManagerUploadToAzure)if(201==r){var d;if(A.opts.filesManagerUploadToAzure){if(!1===A.events.trigger("filesManager.uploadedToAzure",[this.responseURL,a,o],!0))return A.edit.on(),!1;d=n}else d=Se(s,t);if(d){var f={link:d,sanitize:!1,data:[],$existing_img:e,response:o||s,type:i};_.set(t,f)}}else X(U,o||s,e,t);else if(200<=r&&r<300){var c=De(l,t);if(c){var p={link:c.link,sanitize:!1,data:c,$existing_img:e,response:o||s,type:i};_.set(t,p)}}else X(R,o||l,e,t)}catch(g){X(U,o||l,e,t)}}.call(d,x,n,Le(e),o,s),S.has(n)||we(100,n,!0)},d.onerror=function(){X(U,this.response||this.responseText||this.responseXML,null,n)},d.upload.onprogress=function(e){!function i(e,t){e.lengthComputable&&we(e.loaded/e.total*100|0,t,!1)}(e,n)},d.onabort=function(e){!function i(e,t){X($,t,x,e)}(n,e)},d.send(A.opts.filesManagerUploadToAzure?e:a),E.set(n,d)}}function Be(l){A.events.$on(l,"click",".fr-upload-progress-layer",function(e){if(A.helpers.isMobile())return e.stopPropagation(),!1},!0),A.events.$on(l,"dragover dragenter",".fr-upload-progress-layer",function(e){e.preventDefault();for(var t=0;t\n \n ";s[0].innerHTML=l+s[0].innerHTML}else if(Oe(Le(_.get(e)))){var d;if(_.get(e).hasOwnProperty("video")){var f=_.get(e).video.substring(_.get(e).video.indexOf("src")+3),c=f.substring(f.indexOf('"')+1);c=c.substring(0,c.indexOf('"')),d='
\n
\n
×
\n \n
\n
')}else d='
\n
\n
×
\n \n
\n
";s[0].innerHTML=d+s[0].innerHTML}else if($e(Le(_.get(e)))){var p='
\n
\n
×
\n \n
\n
');s[0].innerHTML=p+s[0].innerHTML}else if(ze(Le(_.get(e)))){var g=_.get(e).link,u=_.get(e).text;if(g.endsWith(".pdf")||g.endsWith(".txt")){var m='
\t\n
\t\n
×
\t\n \t\n
\t\n
');s[0].innerHTML=m+s[0].innerHTML}else if(0===g.indexOf("blob:")&&A.browser.msie&&window.navigator&&window.navigator.msSaveBlob)window.navigator.msSaveBlob(L.get(e),u);else{var v=document.createElement("a");v.href=g,v.download=u,v.click()}}}}(t)}),A.events.$on(l,"click",".fr-file-delete-button",function(e){q(parseInt(this.id.split("-").pop()))}),A.events.$on(l,"click",".fr-file-cancel-upload-button",function(e){!function i(e){var t=A.popups.get("filesManager.insert");t.find(".fr-file-item-right-"+e).get(0).innerHTML=ye(e),E.get(e).abort(),xe(e,100,!0),t.find(".fr-checkbox-file-"+e).get(0).disabled=!0}(parseInt(this.id.split("-").pop()))}),A.events.$on(l,"click",".fr-upload-delete-button",function(e){!function t(e){0!=E.get(e).readyState&&(E.get(e).abort(),xe(e,100,!0),E["delete"](e)),q(e)}(parseInt(this.id.split("-").pop()))}),A.events.$on(l,"click",".fr-file-view-close",function(e){l.find(".fr-file-view-modal").get(0).outerHTML=""}),A.events.$on(l,"click",".fr-plugins-enable",function(e){!function t(){m.forEach(function(e){A.opts.pluginsEnabled.indexOf(e)<0&&A.opts.pluginsEnabled.push(e)})}(),function i(e){for(var t in e)if(!A[t]){if(It.PLUGINS[t]&&A.opts.pluginsEnabled.indexOf(t)<0)continue;A[t]=new e[t](A),A[t]._init&&A[t]._init()}}(It.PLUGINS),A.popups.get("filesManager.insert").get(0).outerHTML="",Fe(),y(!0)}),A.events.$on(l,"click",".fr-plugins-cancel",function(e){A.popups.hide("filesManager.insert")}),A.events.$on(l,"drop",".fr-upload-progress",function(e){e.preventDefault(),e.stopPropagation()}),A.events.$on(l,"drop",".fr-files-upload-layer",function(e){e.preventDefault(),e.stopPropagation(),I(this).removeClass("fr-drop");var t=e.originalEvent.dataTransfer;if(t&&t.files){var i=l.data("instance")||A;i.events.disableBlur();for(var n=[],a=0;a'.concat(a,'').concat(r,""));var o=A.opts.filesInsertButtons.indexOf("filesUpload"),s=A.opts.filesInsertButtons.indexOf("filesByURL"),l=A.opts.filesInsertButtons.indexOf("filesEmbed"),d="";0<=o&&(t=" fr-active",0<=s&&s
Drag & Drop One or More Files
OR
Click Browse Files
'));var f="";0<=l&&(t=" fr-active",(o
"));var c="";0<=s&&(t=" fr-active",0<=o&&o
"));var p={buttons:n,upload_layer:d,by_url_layer:c,embed_layer:f,upload_progress_layer:"
"),progress_bar:'

Uploading

'};return 1<=A.opts.imageInsertButtons.length&&(i=A.popups.create("filesManager.insert",p)),A.$wp&&A.events.$on(A.$wp,"scroll",function(){x&&A.popups.isVisible("filesManager.insert")&&replace()}),Be(i),A.popups.setPopupDimensions(i),i}function Ne(e){var t=e.split("/").pop();if(t.split(".").length<2){var i=new Date;return t+"-"+i.getDate()+"/"+(i.getMonth()+1)+"/"+i.getFullYear()}return t}function He(){x&&A.popups.get("image.alt").find("input").val(x.attr("alt")||"").trigger("change")}function Ke(){var e=A.popups.get("image.alt");e||(e=Ye()),Q(),A.popups.refresh("image.alt"),A.popups.setContainer("image.alt",A.$sc);var t=lt();dt()&&(t=t.find(".fr-img-wrap"));var i=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();A.popups.show("image.alt",i,n,t.outerHeight(),!0)}function Ye(e){if(e)return A.popups.onRefresh("image.alt",He),!0;var t={buttons:'
'.concat(A.button.buildList(A.opts.imageAltButtons),"
"),alt_layer:'
")},i=A.popups.create("image.alt",t);return A.$wp&&A.events.$on(A.$wp,"scroll.image-alt",function(){x&&A.popups.isVisible("image.alt")&&Ke()}),i}function Ve(){var e=A.popups.get("image.size");if(x)if(dt()){var t=x.parent();t.get(0).style.width||(t=x.parent().parent()),e.find('input[name="width"]').val(t.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(t.get(0).style.height).trigger("change")}else e.find('input[name="width"]').val(x.get(0).style.width).trigger("change"),e.find('input[name="height"]').val(x.get(0).style.height).trigger("change")}function We(){var e=A.popups.get("image.size");e||(e=Ge()),Q(),A.popups.refresh("image.size"),A.popups.setContainer("image.size",A.$sc);var t=lt();dt()&&(t=t.find(".fr-img-wrap"));var i=t.offset().left+t.outerWidth()/2,n=t.offset().top+t.outerHeight();A.popups.show("image.size",i,n,t.outerHeight(),!0)}function Ge(e){if(e)return A.popups.onRefresh("image.size",Ve),!0;var t={buttons:'
'.concat(A.button.buildList(A.opts.imageSizeButtons),"
"),size_layer:'
")},i=A.popups.create("image.size",t);return A.$wp&&A.events.$on(A.$wp,"scroll.image-size",function(){x&&A.popups.isVisible("image.size")&&We()}),i}function Xe(e,t,i,n){return e.pageX=t,Y.call(this,e),e.pageX=e.pageX+i*Math.floor(Math.pow(1.1,n)),V.call(this,e),W.call(this,e),++n}function je(e){(e=e||lt())&&!1!==A.events.trigger("image.beforeRemove",[e])&&(A.popups.hideAll(),it(!0),A.undo.canDo()||A.undo.saveStep(),e.get(0)==A.el?e.removeAttr("src"):(e.get(0).parentNode&&"A"==e.get(0).parentNode.tagName?(A.selection.setBefore(e.get(0).parentNode)||A.selection.setAfter(e.get(0).parentNode)||e.parent().after(It.MARKERS),I(e.get(0).parentNode).remove()):(A.selection.setBefore(e.get(0))||A.selection.setAfter(e.get(0))||e.after(It.MARKERS),e.remove()),A.html.fillEmptyBlocks(),A.selection.restore()),A.undo.saveStep())}function qe(e){var t=e.which;if(x&&(t==It.KEYCODE.BACKSPACE||t==It.KEYCODE.DELETE))return e.preventDefault(),e.stopPropagation(),je(),!1;if(x&&t==It.KEYCODE.ESC){var i=x;return it(!0),A.selection.setAfter(i.get(0)),A.selection.restore(),e.preventDefault(),!1}if(!x||t!=It.KEYCODE.ARROW_LEFT&&t!=It.KEYCODE.ARROW_RIGHT)return x&&t===It.KEYCODE.TAB?(e.preventDefault(),e.stopPropagation(),it(!0),!1):x&&t!=It.KEYCODE.F10&&!A.keys.isBrowserAction(e)?(e.preventDefault(),e.stopPropagation(),!1):void 0;var n=x.get(0);return it(!0),t==It.KEYCODE.ARROW_LEFT?A.selection.setBefore(n):A.selection.setAfter(n),A.selection.restore(),e.preventDefault(),!1}function Ze(e){if(e&&"IMG"==e.tagName){if(A.node.hasClass(e,"fr-uploading")||A.node.hasClass(e,"fr-error")?e.parentNode.removeChild(e):A.node.hasClass(e,"fr-draggable")&&e.classList.remove("fr-draggable"),e.parentNode&&e.parentNode.parentNode&&A.node.hasClass(e.parentNode.parentNode,"fr-img-caption")){var t=e.parentNode.parentNode;t.removeAttribute("contenteditable"),t.removeAttribute("draggable"),t.classList.remove("fr-draggable");var i=e.nextSibling;i&&i.removeAttribute("contenteditable")}}else if(e&&e.nodeType==Node.ELEMENT_NODE)for(var n=e.querySelectorAll("img.fr-uploading, img.fr-error, img.fr-draggable"),a=0;a"));var n=A.$el.find('img[data-fr-image-pasted="true"]');n&&ot(n,A.opts.imageDefaultDisplay,A.opts.imageDefaultAlign),A.events.trigger("paste.after")}function Qe(e,t){var i=new FileReader;i.onload=function n(e){var t=A.opts.imageDefaultWidth;t&&"auto"!=t&&(t+=A.opts.imageResizeWithPercent?"%":"px"),A.html.insert('"));var i=A.$el.find('img[data-fr-image-pasted="true"]');i&&ot(i,A.opts.imageDefaultDisplay,A.opts.imageDefaultAlign),A.events.trigger("paste.after")}(t),i.readAsDataURL(e,t)}function et(e){if(e&&e.clipboardData&&e.clipboardData.items){var t=(e.clipboardData||window.clipboardData).getData("text/html")||"",i=(new DOMParser).parseFromString(t,"text/html").querySelector("img");if(i){if(!i)return!1;var n=i.src,a=null;if(e.clipboardData.types&&-1!=[].indexOf.call(e.clipboardData.types,"text/rtf")||e.clipboardData.getData("text/rtf"))a=e.clipboardData.items[0].getAsFile();else for(var r=0;r"):I(A.node.blockParent(e.get(0))).after("<".concat(A.html.defaultTag(),">
")))})})(),"IMG"==A.el.tagName&&A.$el.addClass("fr-view"),A.helpers.isMobile()&&(A.events.$on(A.$el,"touchstart","IMG"==A.el.tagName?null:'img:not([contenteditable="false"])',function(){fe=!1}),A.events.$on(A.$el,"touchmove",function(){fe=!0})),A.$wp?(A.events.on("window.keydown keydown",qe,!0),A.events.on("keyup",function(e){if(x&&e.which==It.KEYCODE.ENTER)return!1},!0),A.events.$on(A.$el,"keydown",function(){var e=A.selection.element();(e.nodeType===Node.TEXT_NODE||"BR"==e.tagName&&A.node.isLastSibling(e))&&(e=e.parentNode),A.node.hasClass(e,"fr-inner")||(A.node.hasClass(e,"fr-img-caption")||(e=I(e).parents(".fr-img-caption").get(0)),A.node.hasClass(e,"fr-img-caption")&&(A.opts.trackChangesEnabled||I(e).after(It.INVISIBLE_SPACE+It.MARKERS),A.selection.restore()))})):A.events.$on(A.$win,"keydown",qe),A.events.on("toolbar.esc",function(){if(x){if(A.$wp)A.events.disableBlur(),A.events.focus();else{var e=x;it(!0),A.selection.setAfter(e.get(0)),A.selection.restore()}return!1}},!0),A.events.on("toolbar.focusEditor",function(){if(x)return!1},!0),A.events.on("window.cut window.copy",function(e){if(x&&A.popups.isVisible("image.edit")&&!A.popups.get("image.edit").find(":focus").length){var t=lt();dt()?(t.before(It.START_MARKER),t.after(It.END_MARKER),A.selection.restore(),A.paste.saveCopiedText(t.get(0).outerHTML,t.text())):A.paste.saveCopiedText(x.get(0).outerHTML,x.attr("alt")),"copy"==e.type?setTimeout(function(){Ee(x)}):(it(!0),A.undo.saveStep(),setTimeout(function(){A.undo.saveStep()},0))}},!0),A.browser.msie&&A.events.on("keydown",function(e){if(!A.selection.isCollapsed()||!x)return!0;var t=e.which;t==It.KEYCODE.C&&A.keys.ctrlKey(e)?A.events.trigger("window.copy"):t==It.KEYCODE.X&&A.keys.ctrlKey(e)&&A.events.trigger("window.cut")}),A.events.$on(I(A.o_win),"keydown",function(e){var t=e.which;if(x&&t==It.KEYCODE.BACKSPACE)return e.preventDefault(),!1}),A.events.$on(A.$win,"keydown",function(e){var t=e.which;x&&x.hasClass("fr-uploading")&&t==It.KEYCODE.ESC&&x.trigger("abortUpload")}),A.events.on("destroy",function(){x&&x.hasClass("fr-uploading")&&x.trigger("abortUpload")}),A.events.on("paste.before",et),A.events.on("paste.beforeCleanup",tt),A.events.on("html.processGet",Ze),A.opts.imageOutputSize&&A.events.on("html.beforeGet",function(){n=A.el.querySelectorAll("img");for(var e=0;e \n '.concat(A.button.buildList(A.opts.imageEditButtons),"\n ")};return A.popups.create("image.edit",i)}return!1}(!0),Fe(!0),Ge(!0),Ye(!0),A.events.on("node.remove",function(e){if("IMG"==e.get(0).tagName)return je(e),!1}),A.events.on("popups.hide.filesManager.insert",function(e){A.filesManager.minimizePopup(C)})},showInsertPopup:y,showLayer:function ct(e){var t,i,n=A.popups.get("filesManager.insert");if(x||A.opts.toolbarInline){if(x){var a=lt();dt()&&(a=a.find(".fr-img-wrap")),i=a.offset().top+a.outerHeight(),t=a.offset().left}}else{var r=A.$tb.find('.fr-command[data-cmd="insertFiles"]');t=r.offset().left,i=r.offset().top+(A.opts.toolbarBottom?10:r.outerHeight()-10)}!x&&A.opts.toolbarInline&&(i=n.offset().top-A.helpers.getPX(n.css("margin-top")),n.hasClass("fr-above")&&(i+=n.outerHeight())),n.find(".fr-layer").removeClass("fr-active"),n.find(".fr-".concat(e,"-layer")).addClass("fr-active"),n.find(".fr-upload-progress-layer").addClass("fr-active"),A.popups.show("filesManager.insert",t,i,x?x.outerHeight():0),A.accessibility.focusPopup(n)},refreshUploadButton:function pt(e){var t=A.popups.get("filesManager.insert");t&&t.find(".fr-files-upload-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},refreshByURLButton:function gt(e){var t=A.popups.get("filesManager.insert");t&&t.find(".fr-files-by-url-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},upload:Te,insertByURL:function ut(){for(var e,t=A.popups.get("filesManager.insert").find(".fr-files-by-url-layer input"),i=t.val().trim().split(/[ ,]+/),n=[],a=0,r=0;r

 

'),e.wrap(''),x.after('").concat(It.START_MARKER).concat(A.language.translate("Image Caption")).concat(It.END_MARKER,"")),x.removeAttr("class").removeAttr("style").removeAttr("width"),x.parents(".fr-img-caption").css("width",s),it(!0),A.selection.restore()}else e=lt(),x.insertAfter(e),x.attr("class",e.attr("class").replace("fr-img-caption","")).attr("style",e.attr("style")),e.remove(),Ee(x)},refreshEmbedButton:function wt(e){var t=A.popups.get("filesManager.insert");t&&t.find(".fr-files-embed-layer").hasClass("fr-active")&&e.addClass("fr-active").attr("aria-pressed",!0)},insertEmbed:function xt(e){void 0===e&&(e=A.popups.get("filesManager.insert").find(".fr-files-embed-layer textarea").val()||""),0===e.length||!It.VIDEO_EMBED_REGEX.test(e)&&!It.IMAGE_EMBED_REGEX.test(e)?(te(A.language.translate("Something went wrong. Please try again.")),It.VIDEO_EMBED_REGEX.test(e)&&A.events.trigger("video.codeError",[e])):function s(e,t){var i,n;It.VIDEO_EMBED_REGEX.test(e)?(i="video",n=A.opts.videoSplitHTML):It.IMAGE_EMBED_REGEX.test(e)&&(i="image",n=A.opts.imageSplitHTML),A.events.focus(!0),A.selection.restore();var a=!1;x&&(je(),a=!0),A.html.insert('').concat(e,""),!1,n),A.popups.hide("filesManager.insert");var r=A.$el.find(".fr-jiv");r.removeClass("fr-jiv"),"video"==i&&(r.toggleClass("fr-rv",A.opts.videoResponsive),function o(e,t,i){!A.opts.htmlUntouched&&A.opts.useClasses?(e.removeClass("fr-fvl fr-fvr fr-dvb fr-dvi"),e.addClass("fr-fv".concat(i[0]," fr-dv").concat(t[0]))):"inline"==t?(e.css({display:"inline-block"}),"center"==i?e.css({"float":"none"}):"left"==i?e.css({"float":"left"}):e.css({"float":"right"})):(e.css({display:"block",clear:"both"}),"left"==i?e.css({textAlign:"left"}):"right"==i?e.css({textAlign:"right"}):e.css({textAlign:"center"}))}(r,A.opts.videoDefaultDisplay,A.opts.videoDefaultAlign),r.toggleClass("fr-draggable",A.opts.videoMove),A.events.trigger(a?"video.replaced":"video.inserted",[r])),"image"==i&&(ot(r,A.opts.imageDefaultDisplay,A.opts.imageDefaultAlign),r.find("img").removeClass("fr-dii"),r.find("img").addClass("fr-dib"),r.toggleClass("fr-draggable",A.opts.imageMove),A.events.trigger(a?"image.replaced":"image.inserted",[r])),t&&(c=r,A.selection.clear(),A.toolbar.disable(),A.video._editVideo(c))}(e)},hasCaption:dt,exitEdit:it,edit:Ee,cancelFileInsert:function Mt(){this.file_manager_dialog_open=!1,E.forEach(function(e,t){4!=e.readyState&&(e.abort(),q(t))});var e=A.popups.get("filesManager.insert");e.find(".fr-progress-bar").removeClass("fr-display-block").addClass("fr-none"),e.find('.fr-command[data-cmd="filesUpload"]').removeClass("fr-disabled"),e.find('.fr-command[data-cmd="filesByURL"]').removeClass("fr-disabled"),e.find('.fr-command[data-cmd="filesEmbed"]').removeClass("fr-disabled"),r=0,E=new Map,k=new Map,Z(),A.popups.hide("filesManager.insert")},minimizePopup:function Et(e){this.file_manager_dialog_open=!1,A.popups.hide("filesManager.insert"),Z()},editImage:Ie,saveImage:function kt(e){var t=_.get(o);t.link=window.URL.createObjectURL(new Blob(e,{type:"image/png"})),_.set(o,t)},_showErrorMessage:te,_showFileErrorMessage:ie,getFileThumbnail:be,deleteFile:q,checkAutoplay:Re,checkInsertAllState:j,_disableInsertCheckbox:G,_getFileType:Le,isChildWindowOpen:function At(){return p},setChildWindowState:function Ct(e){e!==undefined&&(p=e)},resetAllFilesCheckbox:Z}},It.DefineIcon("insertFiles",{NAME:"image",SVG_KEY:"fileManager"}),It.RegisterShortcut(It.KEYCODE.P,"insertFiles",null,"P"),It.RegisterCommand("insertFiles",{title:"Insert Files",undo:!1,focus:!0,refreshAfterCallback:!1,popup:!0,callback:function(){this.popups.isVisible("filesManager.insert")?(this.$el.find(".fr-marker").length&&(this.events.disableBlur(),this.selection.restore()),this.popups.hide("filesManager.insert")):this.filesManager.showInsertPopup()},plugin:"filesManager"}),It.DefineIcon("cloudIcon",{NAME:"cloudIcon",SVG_KEY:"uploadFiles"}),It.DefineIcon("filesUpload",{NAME:"uploadFiles",SVG_KEY:"uploadFiles"}),It.RegisterCommand("filesUpload",{title:"Upload Files",undo:!1,focus:!1,toggle:!0,callback:function(){this.filesManager.showLayer("files-upload")},refresh:function(e){this.filesManager.refreshUploadButton(e)}}),It.DefineIcon("filesByURL",{NAME:"link",SVG_KEY:"insertLink"}),It.RegisterCommand("filesByURL",{title:"By URL",undo:!1,focus:!1,toggle:!0,callback:function(){this.filesManager.showLayer("files-by-url")},refresh:function(e){this.filesManager.refreshByURLButton(e)}}),It.DefineIcon("filesEmbed",{NAME:"code",SVG_KEY:"codeView"}),It.RegisterCommand("filesEmbed",{title:"Embedded Code",undo:!1,focus:!1,toggle:!0,callback:function(){this.filesManager.showLayer("files-embed")},refresh:function(e){this.filesManager.refreshEmbedButton(e)}}),It.DefineIcon("insertAll",{NAME:"insertAll",SVG_KEY:"fileInsert"}),It.RegisterCommand("insertAll",{title:"Insert",undo:!1,focus:!1,toggle:!0,disabled:!0,callback:function(){this.filesManager.insertAllFiles()}}),It.DefineIcon("deleteAll",{NAME:"remove",SVG_KEY:"remove"}),It.RegisterCommand("deleteAll",{title:"Delete",undo:!1,focus:!1,toggle:!0,disabled:!0,callback:function(){this.filesManager.deleteAllFiles()}}),It.DefineIcon("cancel",{NAME:"cancel",SVG_KEY:"cancel"}),It.RegisterCommand("cancel",{title:"Cancel",undo:!1,focus:!1,toggle:!0,callback:function(){this.filesManager.cancelFileInsert()},refresh:function(e){}}),It.DefineIcon("minimize",{NAME:"minimize",SVG_KEY:"minimize"}),It.RegisterCommand("minimize",{title:"Minimize",undo:!1,focus:!1,toggle:!0,callback:function(){this.filesManager.minimizePopup("image.insert",!0)},refresh:function(e){this.filesManager.refreshEmbedButton(e)}}),It.RegisterCommand("filesInsertByURL",{title:"Insert Image",undo:!0,refreshAfterCallback:!1,callback:function(){this.filesManager.insertByURL()},refresh:function(e){e.text(this.language.translate("Add"))}}),It.RegisterCommand("imageInsertByUpload",{title:"Insert",undo:!0,refreshAfterCallback:!1,callback:function(e,t){},refresh:function(e){}}),It.RegisterCommand("viewImage",{title:"View Image",undo:!0,refreshAfterCallback:!1,callback:function(e,t){},refresh:function(e){}}),It.RegisterCommand("insertEmbed",{undo:!0,focus:!0,callback:function(){this.filesManager.insertEmbed(),this.popups.get("filesManager.insert").find("textarea")[0].value="",this.popups.get("filesManager.insert").find("textarea").removeClass("fr-not-empty")}}),It.RegisterCommand("filesDismissError",{title:"OK",undo:!1,callback:function(){this.filesManager.hideProgressBar(!0)}})});