\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
\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="