1jQuery(document).ready(function(e){"use strict";e.widget("cp.UseyourDriveUploadbox",{options:{standalone:!1,auto_upload:!1,restrictions:{accepted_formats:null,min_file_size:null,max_file_size:null,max_uploads:null,quota:null,has_requirements:!1},attached_browser:null,dropzone:self.element,pre_process:!1,template_row:".fileupload-table-row-template",queue_table:".fileupload-table-body",debug:!1},_create:function(){this.options.auto_upload=!0===this.element.hasClass("auto_upload")||!0===this.element.hasClass("force_auto_upload"),this.options.standalone=!0===this.options.main.element.hasClass("upload"),this.options.support_xhr=e.support.xhrFileUpload,this.options.support_chunked=this.options.support_xhr,this.options.multipart_val=!this.options.support_xhr,this.options.method_val=this.options.support_xhr?"PUT":"POST",this.options.singlefileuploads_val=!0,this.options.maxchunksize_val=this.options.support_chunked?52428800:0,this.options.chunk_transfer_idle_timeout=6e4,this.options.chunk_response_timeout=18e4,this.options.max_chunk_retries=5,this.options.max_offset_query_attempts=3,this.options.max_server_connections=5,void 0===window.current_server_connections&&(window.current_server_connections=0),this.upload_events={},this.options.restrictions={},this.options.restrictions.accepted_formats=new RegExp(this.element.find('input[name="acceptfiletypes"]').val(),"i"),this.options.restrictions.min_file_size=parseInt(this.element.find('input[name="minfilesize"]').val()),this.options.restrictions.max_file_size=this.options.support_xhr&&"0"===this.element.find('input[name="maxfilesize"]').attr("data-limit")?-1:parseInt(this.element.find('input[name="maxfilesize"]').val()),this.options.restrictions.max_uploads=parseInt(this.element.find('input[name="maxnumberofuploads"]').val()),this.options.has_requirements=0!==this.element.find(".upload-requirements-content-subtitle").children().length,this.options.pre_process=1==this.element.data("preprocess"),this.options.template_row=this.element.find(this.options.template_row),this.options.queue_table=this.element.find(this.options.queue_table),this.options.dropzone=this.options.main.element,this.in_form=this.element.closest("form").length>0,this.form_element=this.element.closest("form"),this.element.parents(".gform_page").length?this.form_submit_button=this.element.parents(".gform_page").find('input[type="submit"], [type="button"].gform_next_button, button[id^="gform_submit_button"], button[class*="cf7md-submit-btn"], button[class*="wpcf7-submit"], button.wpforms-submit, button.wpforms-page-next, button.frm_button_submit, button.ff-btn-submit, button.ff-btn-next, button.wsf-button.wsf-button-primary').not(".wpcp-upload-submit, .frm_prev_page"):this.form_submit_button=this.form_element.find('input[type="submit"]:visible, [type="button"].gform_next_button:visible, button[id^="gform_submit_button"]:visible, button[class*="cf7md-submit-btn"]:visible, button[class*="wpcf7-submit"]:visible, button.wpforms-submit:visible, button.wpforms-page-next:visible, button.frm_button_submit, button.ff-btn-submit:visible, button.ff-btn-next:visible, button.nex-step:visible, button.nex-submit:visible, button.wsf-button.wsf-button-primary, .elementor-field-type-next button:visible, .elementor-field-type-submit button:visible, .arfsubmitbutton .next_btn:visible, .arfsubmitbutton .arf_submit_btn:visible').not(".wpcp-upload-submit, .frm_prev_page").filter(function(){return 0===e(this).closest("#frm_top_bar").length}),this.in_form&&this._log("PART OF FORM"),this.edit_form=this.form_element.find('input[name="frm_action"][value="update"]').length,this.form_upload_button=null,this.block_upload_element=null,this.upload_process=null,this.pre_process=null,this.pre_process_completed=!1,this.pending_uploads={},this.finished_uploads={},this.files_storage={},this.queue={},this.queue_length=0,this.queue_size=0,this.progress_timer=null,this.upload_started,this.time_remaining=0,this.progress_percentage=0,this.progress_bar=this.element.find(".fileupload-global-progress-bar"),this._hydrateUploadInputs(),this._initiate()}
1,_hydrateUploadInputs:function(){let t=this;t.element.find(".upload-input[data-upload-input-type]").each(function(){let t=e(this),i={type:t.attr("data-upload-input-type"),class:t.attr("class")},o=t.attr("data-upload-input-name"),n=t.attr("data-upload-input-accept");o&&(i.name=o),n&&(i.accept=n);let s=e("<input/>",i);t.attr("data-upload-input-multiple")&&s.attr("multiple","multiple"),t.attr("data-upload-input-directory")&&s.attr("directory","directory"),t.attr("data-upload-input-webkitdirectory")&&s.attr("webkitdirectory","webkitdirectory"),t.replaceWith(s)})},_destroy:function(){return this._super()},_setOption:function(e,t){this._super(e,t)},_initiate:function(){let e=this;e._log("LOADED",e),e._initUploadBox(),e._initFunctions(),e._refreshView(),e._log("ACTIVATED",e),window.setTimeout(function(){e.initated=!0},2e3)},_initUploadBox:function(){let t=this;t.upload_box=t.element.fileupload({url:t.options.ajax_url,type:t.options.method_val,maxChunkSize:t.options.maxchunksize_val,chunkTransferIdleTimeout:t.options.chunk_transfer_idle_timeout,chunkResponseTimeout:t.options.chunk_response_timeout,maxChunkRetries:t.options.max_chunk_retries,maxOffsetQueryAttempts:t.options.max_offset_query_attempts,singleFileUploads:t.options.singlefileuploads_val,multipart:t.options.multipart_val,dataType:"json",autoUpload:t.options.auto_upload,maxFileSize:t.options.restrictions.max_file_size,acceptFileTypes:t.options.restrictions.accepted_formats,dropZone:t.options.dropzone,messages:{maxNumberOfFiles:t.options.maxNumberOfFiles,acceptFileTypes:t.options.acceptFileTypes,maxFileSize:t.options.maxFileSize,minFileSize:t.options.minFileSize},limitConcurrentUploads:3,disableImageLoad:!0,disableImageResize:!0,disableImagePreview:!0,disableAudioPreview:!0,disableVideoPreview:!0,uploadTemplateId:null,downloadTemplateId:null,add:function(e,i){t._add(i)},submit:function(e,i){return t._start(i),!1}}).on({fileuploaddrop:function(e,i){null!==t.block_upload_element&&t.block_upload_element.is(":visible")&&(i.files=[])},fileuploadprogress:function(e,i){t._progress(i)},fileuploadfail:function(e,i){var o=i.files[0];!1===o.error&&(t.queue[o.hash].error=t._getUploadFailureMessage(o)),t.queue[o.hash].status.type="upload-failed",t._isFinished(o)},fileuploadchunkretry:function(e,i){var o=i.offsetQueryAttempt?"OFFSET QUERY":"CHUNK";t._log("RESUMABLE UPLOAD RETRY "+o+" (STATUS "+i.failureStatus+", DELAY "+i.retryDelay+"MS)")},fileuploadchunkfail:function(e,i){var o=i.files[0];t.queue[o.hash].upload_failure={category:i.failureCategory||"generic",reason:i.failureReason||null,status:void 0!==i.failureStatus?i.failureStatus:null},t._log("RESUMABLE UPLOAD TERMINAL FAILURE (STATUS "+t.queue[o.hash].upload_failure.status+", REASON "+t.queue[o.hash].upload_failure.reason+")")},fileuploadchunkcorsrangehidden:function(){t._log("CORS RANGE HEADER NOT EXPOSED: RESUMABLE UPLOAD RECOVERY IS BLOCKED")},fileuploaddone:function(e,i){t._done(i)},"useyourdrive-upload-start":function(){e.each(t.queue,function(e,i){null!==i.upload_event&&void 0===t.finished_uploads[i.hash]&&void 0===t.pending_uploads[i.hash]&&(t.pending_uploads[i.hash]=i,i.upload_event())})}})},_add:function(t){let i=this;(i.element[0].getBoundingClientRect().bottom>window.innerHeight||i.element[0].getBoundingClientRect().top<0)&&i.element[0].scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),e.each(t.files,function(e,o){var n="";"relativePath"in o?n=o.relativePath:"webkitRelativePath"in o&&(n=o.webkitRelativePath),o.path=n.replace(o.name,""),""!==o.path&&(i.options.pre_process=!0,i.pre_process_completed=!1),o.hash=WPCPhashCode(o.path+o.name+o.size+("lastModified"in o?o.lastModified:"")),o.listtoken=i.options.listtoken,o.description=void 0!==o.description?o.description:"",void 0!==i.queue[o.hash]&&(i._log("FILE ALREADY ADDED"),null!==i.queue[o.hash].status.request&&(i._log("STOP UPLOAD CURRENT FILE UPLOAD"),i._stop(o)),i.removeFileFromQueueTable(o)),o=i._validate(o),o.upload_failure=null,i.queue[o.hash]=o,i.queue[o.hash].status={type:"upload-waiting",progress:0,progressbar:null,request:null},i.queue[o.hash].element=i.addFileToQueueTable(o),i.queue_size+=o.size,i.queue_length++,o.error?(i._log("FILE NOT VALID"),i.element.find(".fileupload-requirements-button").click(),i.queue[o.hash].status.type="validation-failed",i.queue[o.hash].upload_event=null,i.element.trigger("useyourdrive-upload-validation-failed",[o,t,i])):(i.queue[o.hash].upload_event=function(){t.process().done(function(){t.submit()})},i.element.trigger("useyourdrive-add-upload",[o,t,i]),i._log("FILE ADDED")),i.updateFileInQueueTable(o)}),i.options.auto_upload&&window.setTimeout(function(){i._log("AUTO UPLOAD"),i.element.trigger("useyourdrive-upload-start")},500)},_validate:function(e){let t=this;return e.error=!1,e.name.length&&!t.options.restrictions.accepted_formats.test(e.name)?e.error=t.options.str_filetype_not_allowed:""!==t.options.restrictions.min_file_size&&e.size<=t.options.restrictions.min_file_size?e.error=t.options.str_min_file_size:t.options.restrictions.max_file_size>-1&&e.size>0&&e.size>t.options.restrictions.max_file_size?e.error=t.options.str_max_file_size:t.options.restrictions.max_uploads>0&&t.queue_length>0&&t.queue_length>=t.options.restrictions.max_uploads&&(e.error=t.options.str_files_limit),t._log("VALIDATED",e),e},_delete:function(e){},_start:function(t){let i=this;if(i._log("START",t),e.each(t.files,function(o,n){e.isEmptyObject(i.queue[n.hash])?n.error=!0:i.updateFileInQueueTable(n),!1!==n.error&&t.files.splice(o,1)}),0!==t.files.length){null===i.upload_process&&(i.upload_started=(new Date).getTime()),null===i.upload_process&&(i.upload_process=e.Deferred(),e.
1when(i.upload_process).then(function(){i._log("ALL UPLOADS FINISHED",t),i.upload_process=null,i._postProcess().then(function(e){i._finish(t,e)})})),window.onbeforeunload=function(){return!0},i.element.addClass("-is-uploading"),i.in_form&&i.form_upload_button.val(i.options.str_uploading).html(i.options.str_uploading).prop("disabled",!0).addClass("-wpcp-submit-active"),i.element.trigger("useyourdrive-start-upload",[t.files[0],t,i]);var o=t.files[0];i.queue[o.hash].status.type="upload-starting",i.updateFileInQueueTable(o),o.queue_index=i.queue[o.hash].element.index(),i.pending_uploads[o.hash]=o,setTimeout(function(){i._preProcess().then(function(){if(i.pre_process_completed=!0,i.pre_process=null,i._log("PREPROCESS COMPLETED"),i._scrollToFile(o),!i.options.support_xhr)return i._log("ONLY DIRECT UPLOADS SUPPORTED"),!1;i._getUploadUrl(o).then(function(n){if(window.current_server_connections--,e.isEmptyObject(n)||void 0===n.result||void 0===n.url)return i._log("UPLOAD FAILED",o),i.queue[o.hash].error=i.options.str_uploading_failed,i.queue[o.hash].status.type="upload-failed",i._isFinished(o),!1;t.url=n.url,i.queue[o.hash].convert=n.convert,t.jqXHR=i.queue[o.hash].status.request=i.upload_box.fileupload("send",t),i._log("UPLOAD DIRECTLY TO CLOUD",t)},function(e){return window.current_server_connections--,i._log("UPLOAD FAILED",o),i.queue[o.hash].error=i.options.str_uploading_failed,i.queue[o.hash].status.type="upload-failed",i._isFinished(o),!1})},function(){i.pre_process=null,i.pre_process_completed=!1,i._log("PREPROCESS FAILED");var e=t.files[0];return i.queue[e.hash].error=i.options.str_uploading_failed,i.queue[e.hash].status.type="upload-failed",i._isFinished(e),!1})},500)}else i._refreshView()},_preProcess:function(){let t=this;if(!1===t.options.pre_process||t.pre_process_completed)return new Promise(function(e,t){e(!0)});if(null!==t.pre_process)return t.pre_process;var i=e.map(t.pending_uploads,function(e){return{hash:e.hash,name:e.name,description:e.description,type:e.type,path:e.path,last_modified:e.lastModified}});return t.pre_process=e.ajax({type:"POST",url:t.options.ajax_url,data:{action:"useyourdrive-upload-file",account_id:t.options.main.element.attr("data-account-id"),type:"upload-preprocess",files:i,listtoken:t.options.listtoken,lastFolder:t.options.main.element.attr("data-id"),page_url:document.location.href,_ajax_nonce:t.options.upload_nonce},dataType:"json"}),t._log("PREPROCESS STARTED",t.pre_process),t.pre_process},_getUploadUrl:function(t){let i=this;return i._log("OBTAIN DIRECT UPLOAD URL",t),new Promise(function(e,t){(function t(){if(window.current_server_connections<i.options.max_server_connections)return window.current_server_connections++,e();setTimeout(t,500)})()}).then(function(o){return e.ajax({type:"POST",url:UseyourDrive_vars.ajax_url,data:{action:"useyourdrive-upload-file",account_id:i.options.main.options.account_id,type:"get-direct-url",filename:t.name,file_size:t.size,file_path:t.path,queue_index:t.queue_index,file_description:t.description,mimetype:t.type,last_modified:t.lastModified,orgin:window.location.origin?window.location.origin:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:""),lastFolder:i.options.main.element.attr("data-id"),listtoken:i.options.listtoken,page_url:document.location.href,_ajax_nonce:i.options.upload_nonce},dataType:"json"})})},_done:function(t){let i=this;var o=t.files[0];!1===i.options.support_xhr&&void 0!==i.queue[o.hash].status.server_progress&&i.queue[o.hash].status.server_progress.abort();var n=!0;if(!i.options.support_xhr||void 0!==t.result&&null!==t.result&&""!==t.result||(n=!1),!1!==i.options.support_xhr||void 0!==t.result.file&&void 0!==t.result.file.fileid||(n=!1),!1===n)return i.queue[o.hash].error=i.options.str_uploading_failed,i.queue[o.hash].status.type="upload-failed",void i._isFinished(o);i.queue[o.hash].fileid=i.options.support_xhr?t.result.id:t.result.file.fileid,i.queue[o.hash].convert=i.options.support_xhr?i.queue[o.hash].convert:t.result.file.convert,o=i.queue[o.hash],i._convert(o).then(function(t){if(e.isEmptyObject(t)||void 0===t.result||0===t.result)return i.queue[o.hash].error=i.options.str_uploading_convert_failed,i._isFinished(o),!1;i.queue[o.hash].status.type="upload-finished",i.queue[o.hash].fileid=t.fileid,i.finished_uploads[i.queue[o.hash].fileid]=i.queue[o.hash],sendAnalyticsUYD("Upload file",i.queue[o.hash].name),i._isFinished(o)})},_convert:function(t){let i=this;return!1===t.convert?new Promise(function(e,i){var o={result:1,fileid:t.fileid};e(o)}):(i.queue[t.hash].status.type="upload-converting",i.updateFileInQueueTable(t),i._log("START CONVERT",t),e.ajax({type:"POST",url:UseyourDrive_vars.ajax_url,data:{action:"useyourdrive-upload-file",account_id:i.options.main.options.account_id,type:"upload-convert",listtoken:i.options.listtoken,fileid:t.fileid,convert:t.convert,page_url:document.location.href,_ajax_nonce:i.options.upload_nonce},dataType:"json"}))},_isFinished:function(e){let t=this;t._log("FILE UPLOAD FINISHED",e),t.updateFileInQueueTable(e),!1!==e.error&&t.options.main._logEvent("log_failed_upload_event",t.options.main.element.attr("data-id"),{name:e.name,size:e.size,error:e.error,api_error_reason:e.upload_failure?e.upload_failure.reason:null,api_http_status:e.upload_failure&&void 0!==e.upload_failure.status?e.upload_failure.status:null}),t.queue[e.hash].upload_event=null,delete t.pending_uploads[e.hash],0===Object.keys(t.pending_uploads).length&&t.upload_process.resolve("upload-finished")},_postProcess:function(){let t=this;return 0===Object.keys(t.finished_uploads).length?(t._log("NO POST PROCESS (NO FILES UPLOADED)"),new Promise(function(e,t){e(!0)})):(t._log("POST PROCESS STARTED"),t._resetGlobalProgress(),t.progress_bar.width("99%"),e.ajax({type:"POST",url:t.options.ajax_url,data:{action:"useyourdrive-upload-file",account_id:t.options.main.options.account_id,type:"upload-postprocess",listtoken:t.options.listtoken,files:Object.keys(t.finished_uploads),lastFolder:t.options.main.element.attr("data-id"),page_url:document.location.href,_ajax_nonce:t.options.upload_nonce},dataType:"json"}))},_finish:function(t,i){let o=this;o._log("POST PROCESS FINISHED",i),window.onbeforeunload=null,e.each(i.files,function(e,t){o.files_storage[e]={hash:e,account_id:t.account_id,name:t.name,description:t.description,type:t.type,path:t.relative_path,absolute_path:t.absolute_path,size:t.filesize,preview_url:t.preview_url,shared_url:t.shared_url,folder_absolute_path:t.folder_absolute_path,folder_relative_path:t.folder_relative_path,folder_preview_url:t.folder_preview_url,folder_shared_url:t.folder_shared_url};let i=Object.values(o.queue).find(t=>t.fileid===e);void 0!==i&&(o.finished_uploads[e].hash=i.hash,i.fileid=e,i.account_id=t.account_id,null!==t.thumburl&&(i.temp_thumburl=t.temp_thumburl),o.updateFileInQueueTable(i))}),o.element.find(".fileupload-filelist").val(JSON.stringify(o.files_storage)).trigger("change"),o.element.removeClass("-is-uploading"),o.element.find(".-upload-finished").addClass("-upload-postprocess-finished"),o._resetGlobalProgress(),o.in_form&&o.form_upload_button.val(o.form_submit_button.val()).html(o.form_submit_button.html()).prop("disabled",!1).removeClass("-wpcp-submit-active"),o._refreshView(),!1===o.options.standalone&&!1===o.options.main.element.hasClass("upload")&&(o.options.main.options.clearLocalCache=!0,o.options.main.options.forceRefresh=!0,clearTimeout(o.options.main.updateTimer),o.options.main._getFileList({}));var n=!0;o.in_form&&e.each(o.queue,function(e,i){!1!==i.error&&(n=!1,o._scrollToFile(i),o._log("QUEUE CONTAINS ERRORS",o.queue),o._abort(t),o._dialogFailedUploads([i]))}),n&&o.element.trigger("useyourdrive-upload-finished",[t,o])},_abort:function(e,t){let i=this;i._log("UPLOAD ABORT",t),window.onbeforeunload=null,i.upload_process=null,i.element.removeClass("-is-uploading"),i._refreshView(),i._resetGlobalProgress(),!1===i.options.standalone&&!1===i.options.main.element.hasClass("upload")&&(i.options.main.options.clearLocalCache=!0,i.options.main.options.forceRefresh=!0,clearTimeout(i.options.main.updateTimer),i.options.main._getFileList({})),i.form_upload_button.val(i.form_submit_button.val()).html(i.form_submit_button.html()).prop("disabled",!1).removeClass("-wpcp-submit-active")},_progress:function(e){let t=this;t._log("PROGRESS",e);var i,o=e.files[0];t.options.support_xhr?(i=parseInt(e.loaded/e.total*100,10),t.queue[o.hash].status.type="uploading-to-cloud",null===t.progress_t
1imer&&(t.progress_timer=setInterval(function(){t._globalProgress(t)},2e3),t._globalProgress(t))):(i=parseInt(e.loaded/e.total*100,10)/2,t.queue[o.hash].status.type="uploading-to-server",i>=50&&(i=50,t.queue[o.hash].status.type="uploading-to-cloud",setTimeout(function(){t._watchServerProgres(o)},2e3))),i=Math.max(i,1),i=Math.min(i,100),t.queue[o.hash].status.progress=i,t.updateFileInQueueTable(o)},_globalProgress:function(){let t=this;var i=(new Date).getTime()-t.upload_started,o=0,n=0;e.each(t.queue,function(e,t){"validation-failed"!==t.status.type&&("upload-finished"===t.status.type||t.status.type,o+=t.size)}),e.each(t.queue,function(e,t){"validation-failed"!==t.status.type&&("upload-finished"===t.status.type||"upload-failed"===t.status.type?n+=t.size/o*100:n+=t.size/o*t.status.progressbar.value)}),t.progress_percentage=Math.max(Math.round(n),1),t.time_remaining=Math.round((i/(n/100)-i)/1e3),t.time_remaining=Math.max(t.time_remaining,1),t.element.trigger("progress-update")},_resetGlobalProgress:function(){let e=this;
1clearInterval(e.progress_timer),e.progress_timer=null,e.progress_percentage=0,e.progress_bar.width(0)},_watchServerProgres:function(t){let i=this;null===i.progress_timer&&(i.progress_timer=setInterval(function(){i._globalProgress(i)},2e3),i._globalProgress(i)),i._getServerProgress(t).then(function(o){i._log("RECEIVED STATUS UPLOAD SERVER -> CLOUD",o),e.isEmptyObject(o)||void 0===o.status||"upload-failed"===o.status.progress||(i.queue[t.hash].status.type=o.status.progress,i.queue[t.hash].status.progress=50+o.status.percentage/2-1,i.updateFileInQueueTable(t),"upload-finished"!==o.status.progress&&setTimeout(function(){"upload-failed"!==i.queue[t.hash].status.type&&"upload-finished"!==i.queue[t.hash].status.type&&i._watchServerProgres(t)},2e3))})},_getServerProgress:function(t){let i=this;return i._log("GET STATUS UPLOAD SERVER -> CLOUD",t),i.queue[t.hash].status.server_progress=e.ajax({type:"POST",url:i.options.ajax_url,data:{action:"useyourdrive-upload-file",account_id:i.element.attr("data-account-id"),type:"get-status",listtoken:i.options.listtoken,hash:t.hash,page_url:document.location.href,_ajax_nonce:i.options.upload_nonce},dataType:"json"}),i.queue[t.hash].status.server_progress},_stop:function(e){let t=this;var i=t.queue[e.hash].status.request;t._log("ABORT FILE UPLOAD",e),t.queue[e.hash].status.type="upload-failed",t.queue[e.hash].error=e.error=t.options.str_uploading_cancelled,i&&"function"==typeof i.abort&&(i.cancelledByUser=!0,i.abort())},_getUploadFailureMessage:function(e){let t=this;var i=t.queue[e.hash].upload_failure;return i?"rate-limited"===i.category?t.options.str_uploading_failed_rate_limited:"stalled"===i.category?t.options.str_uploading_failed_stalled:"session"===i.category?t.options.str_uploading_failed_session:t.options.str_uploading_failed:t.options.str_uploading_failed},_redo:function(e){let t=this;t._log("REDO FILE UPLOAD",e),t.element.fileupload("add",{files:[e]})},_clear:function(){let e=this;e.upload_process=null,e.pre_process=null,e.pre_process_completed=!1,e.pending_uploads={},e.finished_uploads={},e.files_storage={},e.queue={},e.queue_length=0,e.queue_size=0,e.element.find('input[name="fileupload-filelist_'+e.options.listtoken+'"]').val(),e.in_form&&(e.form_element.find(".fileupload-filelist").val(""),e.form_upload_button.remove(),e.form_upload_button=null,e._addFormSubmitButton()),e.options.queue_table.find("tr:not(.fileupload-table-row-template)").remove(),e._refreshView(),e._log("CLEAR")},_log:function(e){let t=this;t.options.debug&&console.log("UPLOAD BOX:"+e)},addFileToQueueTable:function(t){let i=this;var o=i.options.template_row.clone().removeClass("fileupload-table-row-template").addClass("-upload-waiting");return o.attr("data-id",t.hash),o.find(".fileupload-table-text-title").text(t.path.replace(t.name,"")+t.name),"undefined"!==t.size&&t.size>0&&o.find(".fileupload-table-text-subtitle").text(i.options.main._helperFormatBytes(t.size,1)),o.find(".fileupload-table-cell-icon img").attr("src",i._getThumbnail(t)).attr("data-src-backup",i._getThumbnail(t,!0)).on("error",function(){e(this).attr("src",e(this).attr("data-src-backup"))}),i.queue[t.hash].status.progressbar=new ldBar(o.find(".fileupload-loading-bar")[0],{preset:"circle",value:0}),i.options.queue_table.append(o),o},updateFileInQueueTable:function(e){let t=this;var i=t.queue[e.hash].element,o=!1;i.removeClass("-upload-waiting -upload-starting -uploading-to-cloud -uploading-to-server -upload-converting -upload-failed"),i.addClass("-"+t.queue[e.hash].status.type),t._log(t.queue[e.hash],t.queue[e.hash].status.progress),"uploading-to-cloud"!==t.queue[e.hash].status.type&&"uploading-to-server"!==t.queue[e.hash].status.type||(t.queue[e.hash].status.progressbar.set(t.queue[e.hash].status.progress),e.size>5e7&&(o=!0,i.find(".fileupload-table-text-subtitle").text(t.options.main._helperFormatBytes(Math.round(t.queue[e.hash].status.progress*e.size/100),1)+" / "+t.options.main._helperFormatBytes(e.size,1)))),!1===o&&i.find(".fileupload-table-text-subtitle").text(t.options.main._helperFormatBytes(e.size,1)+(e.description?" - "+e.description:"")),void 0!==e.temp_thumburl&&null!==e.temp_thumburl&&i.find(".fileupload-table-cell-icon img").attr("src",e.temp_thumburl).addClass("fileupload-own-thumbnail"),!1!==e.error&&(i.find(".fileupload-table-text-subtitle").text(e.error),i.addClass("-upload-failed"),t.queue_size-=e.size,t.queue_length--),t._refreshView()},removeFileFromQueueTable:function(t){let i=this;var o=i.queue[t.hash].element;o.removeClass("-upload-waiting"),o.animate({opacity:"0"},"slow",function(){e(this).remove()}),!1===o.hasClass("-upload-failed")&&!1===o.hasClass("-upload-finished")&&(i.queue_size-=t.size,i.queue_length--),delete i.queue[t.hash],i.element.trigger("useyourdrive-upload-removed",[t,i]),i._refreshView()},_deleteFile:function(t){let i=this;var o=t.element;e.ajax({type:"POST",url:i.options.ajax_url,data:{action:"useyourdrive-delete-entries",account_id:t.account_id,listtoken:i.options.listtoken,entries:[t.fileid],lastFolder:i.options.main.element.attr("data-id"),page_url:document.location.href,_ajax_nonce:i.options.delete_nonce},beforeSend:function(){o.removeClass("-upload-waiting"),o.animate({opacity:"0.5"})},success:function(e){void 0!==e&&1==e.result?(o.removeClass("-upload-finished"),delete i.files_storage[t.hash],delete i.files_storage[t.fileid],delete i.finished_uploads[t.hash],delete i.finished_uploads[t.fileid],i.removeFileFromQueueTable(t),i.element.find(".fileupload-filelist").val(JSON.stringify(i.files_storage)).trigger("change"),i.edit_form&&i.form_upload_button.trigger("click")):o.animate({opacity:"1"})},error:function(e){o.animate({opacity:"1"})},dataType:"json"})},_downloadFile:function(e){let t=this;const i=document.createElement("a");i.style.display="none",i.href=t.options.ajax_url+"?action=useyourdrive-download&id="+e.fileid+"&dl=1&account_id="+e.account_id+"&listtoken="+t.options.listtoken,i.download=e.name,document.body.appendChild(i),i.click(),setTimeout(()=>{URL.revokeObjectURL(i.href),i.parentNode.removeChild(i)},0)},_refreshView:function(){let e=this;e.element.removeClass("-has-queue"),e.queue_length>0&&e.element.addClass("-has-queue"),e.queue_length>0&&(e.element.find(".fileupload-items").text(e.queue_length+" "+(1===e.queue_length?e.options.str_item:e.options.str_items)),e.element.find(".fileupload-items-size").text(e.options.main._helperFormatBytes(e.queue_size,1)));var t=e.element.find(".fileupload-start-button");t.prop("disabled",null!==e.upload_process),null!==e.upload_process?t.html('<i class="eva eva-settings-outline eva-spin eva-fw"></i><span> '+e.options.str_uploading+"</span>"):t.html("<span> "+e.options.str_uploading_start+"</span>"),!1===e.options.auto_upload&&e.element.find(".fileupload-add-button").prop("disabled",null!==e.upload_process),e.queue_length>1?e.progress_bar.fadeIn():e.progress_bar.fadeOut(),e._updateRequiredUI()},_initFunctions:function(){let t=this;t.options.main.options.mobile&&t.element.find(".upload-add-folder").remove(),t.element.find(".upload-add-file, .fileupload-header-title").on("click",function(e){e.preventDefault(),e.stopPropagation(),t.element.find(".upload-input.upload-input-files").trigger("click"),tippy.hideAll()}),t.element.find(".upload-add-folder").on("click",function(e){e.preventDefault(),e.stopPropagation(),t.element.find(".upload-input.upload-input-folder").trigger("click"),tippy.hideAll()});var i=t.element.find(".fileupload-add-button");if(1===i.next().find("li").length?i.on("click",function(e){t.element.find(".upload-add-file:first").trigger("click")}):(i.next().removeClass("tippy-content-holder"),tippy(i.get(0),{trigger:"click",content:i.next().get(0),allowHTML:!0,placement:"bottom-end",appendTo:t.options.main.element[0],moveTransition:"transform 0.2s ease-out",interactive:!0,interactiveDebounce:500,onShown:function(e){},onCreate:function(e){}})),e(t.element).on("click",".upload-remove",function(i){i.preventDefault(),i.stopPropagation();var o=e(this).closest(".fileupload-table-row").attr("data-id"),n=t.queue[o];t.removeFileFromQueueTable(n)}),t.element.find(".fileupload-start-button").on("click",function(e){e.preventDefault(),e.stopPropagation(),t.element.trigger("useyourdrive-upload-start")}),e(t.element).on("click",".upload-stop",function(i){i.preventDefault(),i.stopPropagation();var o=e(this).closest(".fileupload-table-row").attr("data-id"),n=t.queue[o];t._stop(n)}),e(t.element).on("click",".upload-redo",function(i){i.preventDefault(),i.stopPropagation();var o=e(this).closest(".fileupload-table-row").attr("data-id"),n=t.queue[o];t._redo(n)}),e(t.element).on("progress-update",function(e,i,o){t.progress_bar.width(t.progress_percentage+"%")}),!1===t.options.has_requirements)t.element.find(".fileupload-requirements-button").remove();else{var o=t.element.find(".fileupload-requirements-button");o.next().removeClass("tippy-content-holder"),tippy(o.get(0),{trigger:"click mouseenter focus",content:o.next().get(0),allowHTML:!0,moveTransition:"transform 0.2s ease-out",onShown:function(e){},onCreate:function(e){}})}t.options.restrictions.max_file_size<0&&t.element.find(".max-file-size").text(t.options.str_uploading_no_limit),t._initDragDrop(),e(t.element).on("click","button.upload-add-description",function(i){var o=e(this).closest(".fileupload-table-row").attr("data-id"),n=t.queue[o];t._dialogAddDescription(n)}),e(t.element).on("click","button.upload-delete",function(i){var o=e(this).closest(".fileupload-table-row").attr("data-id");let n=Object.values(t.finished_uploads).find(e=>e.hash==o);t._deleteFile(n)}),e(t.element).on("click","button.upload-download",function(i){var o=e(this).closest(".fileupload-table-row").attr("data-id");let n=Object.values(t.finished_uploads).find(e=>e.hash==o);t._downloadFile(n)}),t.in_form&&t._initFormActions(),t._prefillQueue()},_initFormActions:function(){let t=this;t.element.addClass("-is-formfield"),t._addFormSubmitButton(),t._updateRequiredUI(),t._initCustomFolderNames(),t.options.auto_upload=t.element.hasClass("auto_upload")||t.element.hasClass("force_auto_upload")||!1,t.element.on("useyourdrive-add-upload useyourdrive-upload-removed",function(){t._updateRequiredUI()}),t.form_element.find("input, textarea").on("input change",function(){setTimeout(function(){t._updateRequiredUI()},100)}),t.element.find(".fileupload-filelist").on("change",function(){t.options.main.element.parents(".wpcp-container").nextAll(".fileupload-input-filelist").val(e(this).val())}),!1===t.options.auto_upload&&t.element.on("useyourdrive-upload-finished",function(){e(".UseyourDrive .-is-uploading").length>0||t.form_upload_button.trigger("click")});var i=e(t.element).closest(".wpcf7");i.length>0&&i.get(0).addEventListener("wpcf7submit",function(e){t.form_element.removeClass("-is-submitting")},!1);var o=e(t.element).closest(".wpforms-form");o.length>0&&(t.form_element.on("invalid-form wpformsAjaxSubmitError wpformsAjaxSubmitFailed",function(e){t.form_element.removeClass("-is-submitting")}),t.form_element.on("wpformsPageChange",function(e,i,o){t.form_element.removeClass("-is-submitting"),t.form_upload_button.removeClass("-wpcp-submit-done"),t.form_submit_button.addClass("-wpcp-submit-hidden"),t._refreshView()})),jQuery(document).on("frmFormComplete frmFormErrors",function(e,i,o){t.form_element.removeClass("-is-submitting")}),jQuery(document).on("frmFormComplete",function(e,i,o){t._clear()}),jQuery(document).on("frmPageChanged",function(e,i,o){t.form_element.removeClass("-is-submitting"),t.form_upload_button.removeClass("-wpcp-submit-done"),t.form_submit_button.addClass("-wpcp-submit-hidden"),t._refreshView()}),t.form_element.on("reset",function(){t._clear()})},_updateRequiredUI:function(){let e=this;if(!1!==e.in_form){var t=e.element.closest(".gfield_contains_required, .wpcf7-validates-as-required, .frm_required_field");t=t.add(e.element.closest(".wpforms-field").find(".wpforms-required-label")),t=t.add(e.element.closest(".ff-el-group").find(".ff-el-is-required")),e.o
1ptions.is_required=t.length,e.options.is_required&&e.element.addClass("-is-required"),e.element.removeClass("-is-hidden-by-conditional-logic"),t.is(":hidden")&&e.element.addClass("-is-hidden-by-conditional-logic"),e.element.hasClass("-is-uploading")||(e.element.removeClass("-need-files -has-files"),e.options.is_required&&!1===e.element.hasClass("-is-hidden-by-conditional-logic")&&0===e.element.find(".-upload-waiting").length&&0===Object.keys(e.finished_uploads).length?(e.element.addClass("-need-files"),e.form_upload_button.prop("disabled",!0)):(e.element.addClass("-has-files"),e.form_upload_button.prop("disabled",!1)))}},_addFormSubmitButton:function(){let e=this;e.form_submit_button.addClass("wpcp-submit-original -wpcp-submit-hidden"), 2e.form_upload_button=e.form_submit_button.clone().attr("id","wpcp_submit_replacement_"+e.options.listtoken).attr("onclick",null).attr("onkeypress",null).prop("onclick",null).prop("onkeypress",null).off().addClass("wpcp-upload-submit wpcf7-submit").removeClass("wpcp-submit-original -wpcp-submit-hidden").insertBefore(e.form_submit_button).on("click",function(t){e._formSubmitEvent(t)})},_formSubmitEvent:function(t){let i=this;if(t.stopPropagation(),t.preventDefault(),e.isFunction(i.form_element.valid)&&!1===i.form_element.valid())return!1;var o=!1;if(Object.keys(i.queue).length>0&&Object.keys(i.queue).forEach(function(e){var t=i.queue[e];!1!==t.error&&(o=!0,i._scrollToFile(t))}),o)return i._dialogRemoveFromQueue(),!1;if(i.element.removeClass("-need-files"),i.options.is_required&&!1===i.element.hasClass("-is-hidden-by-conditional-logic")&&0===i.element.find(".-upload-waiting").length&&0===Object.keys(i.finished_uploads).length)return i.element.addClass("-need-files"),i.element[0].scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),!1;let n={plugin:i,allow:!0};if(i.element.trigger("useyourdrive-upload-allowed",[n]),!1===n.allow)return!1;if(i.form_upload_button.prop("disabled",!1).removeClass("-wpcp-submit-active"),i.element.find(".-upload-waiting").length>0&&!1===i.element.hasClass("-is-hidden-by-conditional-logic"))return i.element.trigger("useyourdrive-upload-start"),!1;if(i.element.find(".-upload-waiting").length>0||i.element.find(".-need-files").length>0||e(".UseyourDrive .-is-uploading").length>0)return!1;if(i.form_upload_button.val(i.form_submit_button.val()).html(i.form_submit_button.html()).addClass("-wpcp-submit-done"),i.form_upload_button.next(".wpcp-upload-submit").length>0)i.form_upload_button.next(".wpcp-upload-submit").trigger("click");else{var s=[];if(i.form_element.find(".upload-input").each(function(){s.push({parent:e(this).parent(),input:e(this).clone(!0)}),e(this).remove()}),i.element.hasClass("-is-submitting"))return!1;i.form_element.addClass("-is-submitting"),i.form_submit_button.removeClass("-wpcp-submit-hidden").trigger("click"),i.form_submit_button[0].scrollIntoView({behavior:"smooth",block:"center",inline:"center"}),e.each(s,function(){this.parent.append(this.input)})}},_prefillQueue:function(){let t=this;var i=t.element.find('input[name="fileupload-filelist_'+t.options.listtoken+'"]'),o=t.options.main.element.parents(".wpcp-container").nextAll(".fileupload-input-filelist");if(0===i.val().length){if(0===o.length||0===o.val().length)return;i.val(o.val())}t.finished_uploads=JSON.parse(i.val()),t.files_storage=JSON.parse(i.val()),e.each(t.finished_uploads,function(e,i){t.queue[i.hash]=i,t.queue[i.hash].status={type:"upload-finished",progress:100,progressbar:null,request:null},t.queue[i.hash].fileid=i.hash,t.queue[i.hash].upload_event=null,t.queue[i.hash].size=t.options.main._helperReturnBytes(i.size),t.queue[i.hash].error=!1,t.queue[i.hash].element=t.addFileToQueueTable(i),t.queue[i.hash].element.addClass("-upload-finished -upload-postprocess-finished"),t.queue_size+=i.size,t.queue_length++,t.files_storage[i.hash].fileid=i.hash,t.element.trigger("useyourdrive-add-upload",[i,[],t]),t.updateFileInQueueTable(i)}),t._refreshView()},_initCustomFolderNames:function(){let t=this,i=this.options.topContainer.attr("data-module-id"),o=0===t.element.parents(".gform_page, .wpforms-page").length;var n=t.form_element.find("input.useyourdrive_private_folder_name, select.useyourdrive_private_folder_name, .useyourdrive_private_folder_name input
2:last-of-type, .useyourdrive_private_folder_name select").not('[id*="gforms_calendar"]'),s=t.form_element.find("input[class*=wpcp-use-input], select[class*=wpcp-use-input], [class*=wpcp-use-input] input:last-of-type, [class*=wpcp-use-input] select, input[class*=wpcp-"+i+"-use-input], select[class*=wpcp-"+i+"-use-input], [class*=wpcp-"+i+"-use-input] input:last-of-type, [class*=wpcp-"+i+"-use-input] select").not('[id*="gforms_calendar"]'),l=t.form_element.find("input[id*=wpcp_use_input], select[id*=wpcp_use_input], [id*=wpcp_use_input] input:last-of-type, [id*=wpcp_use_input] select, input[id*=wpcp_"+i+"_use_input], select[id*=wpcp_"+i+"_use_input], [id*=wpcp_"+i+"_use_input] input:last-of-type, [id*=wpcp_"+i+"_use_input] select"),a=e.merge(n,s);a=e.merge(l,a);var u="[class*=wpcp-use-input], [id*=wpcp_use_input], [class*=wpcp-"+i+"-use-input], [id*=wpcp_"+i+"_use_input]",r=t.form_element.find(u),p=':disabled, .gf_invisible, [aria-hidden="true"], [id*=gforms_calendar]';0!==a.length&&(null===t.block_upload_element&&(t.block_upload_element=e("<div>").attr("class","fileupload-box-block").html("<div>"+t.options.str_uploading_required_data+"</div>"),t.block_upload_element.insertBefore(t.element.css("position","relative"))),t.block_upload_element.show(),a.on("change keyup input",function(){var n="",s={},l=!0;a.each(function(){let t=e(this).closest("[class*=wpcp-use-input], [id*=wpcp_use_input]"),a=e(this).closest("[class*=wpcp-"+i+"-use-input], [id*=wpcp_"+i+"_use_input]"),u=e.merge(t,a);if(u.length){let t=u.attr("class")&&u.attr("class").match(/wpcp-[\w-]*use-(input\S*)/),i=u.attr("id")&&u.attr("id").match(/wpcp_[\w-]*use_(input\S*)/);t?s[t[1]]=e(this).val():i&&(s[i[1].replaceAll("_","-")]=e(this).val())}"radio"!==e(this).attr("type")||!1!==e(this).is(":checked")?e(this).is("select")&&o&&!1===e(this).is(":visible")||e(this).is("input[type=text]")&&o&&!1===e(this).is(":visible")||(""===e(this).val()&&(l=!1),n+=e(this).val()+"|"):o&&e(this).is(":visible")&&0===e('input[name="'+this.name+'"]:checked').length&&(l=!1)}),r.each(function(){let i=e(this),o=i.find("input[type=text], input:not([type])").not(p).filter(function(){return e(this).closest(u).get(0)===i.get(0)});if(o.length<2)return;let n=i.attr("class")&&i.attr("class").match(/wpcp-[\w-]*use-(input\S*)/),l=i.attr("id")&&i.attr("id").match(/wpcp_[\w-]*use_(input\S*)/),a=n?n[1]:l?l[1].replaceAll("_","-"):null;if(null===a)return;s[a]=o.map(function(){return e(this).val().trim()}).get().filter(function(e){return""!==e}).join(" ");let r=Object.create(null);o.each(function(i){let o=t._getInputSubKey(this,i);r[o]&&(o+="-"+(i+1)),r[o]=!0,s[a+"-"+o]=e(this).val().trim()})}),n=n.length>0?n.slice(0,-1):n,l&&n.length>2?t.block_upload_element.fadeOut():t.block_upload_element.fadeIn(),document.cookie="WPCP-FORM-NAME-"+t.options.listtoken+"="+n+"; path="+t.options.cookie_path+"; domain="+t.options.cookie_domain+";SameSite=Lax;",document.cookie="WPCP-FORM-VALUES-"+t.options.listtoken+"="+JSON.stringify(s)+"; path="+t.options.cookie_path+"; domain="+t.options.cookie_domain+";SameSite=Lax;"}),a.trigger("keyup"))},_getInputSubKey:function(e,t){let i,o=e.name||e.id||"",n=[],s=/\[([^\]]+)\]/g;for(;null!==(i=s.exec(o));)n.push(i[1]);let l="";for(let e=n.length-1;e>=0;e--)if(!1===/^\d+$/.test(n[e])){l=n[e];break}if(""===l&&0===n.length){let e=o.split(/[._]/),t=e[e.length-1];!1===/^\d+$/.test(t)&&(l=t)}return l=l.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,""),""===l?String(t+1):l},_initDragDrop:function(){let t=this;e(document).on("dragover",function(i){if(null===t.block_upload_element||!t.block_upload_element.is(":visible")){var o=t.options.dropzone,n=t.dropZoneTimeout;n?clearTimeout(n):o.addClass("in");var s=!1,l=i.target;do{if(e(l).is(o)){s=!0;break}l=l.parentNode}while(null!==l);s?e(l).addClass("hover"):o.removeClass("hover"),t.dropZoneTimeout=setTimeout(function(){t.dropZoneTimeout=null,o.removeClass("in hover")},100)}}),e(document).on("drop dragover",function(e){e.preventDefault()})},_scrollToFile:function(e){let t=this;var i=t.options.queue_table.scrollTop();i+=t.queue[e.hash].element.position().top,clearTimeout(t.tablescroller),t.tablescroller=setTimeout(function(){t.options.queue_table.animate({scrollTop:i},800)},500)},_getThumbnail:function(e,t){let i=this;var o,n=i.options.icons_set;return void 0===e.thumbnail||null===e.thumbnail||""===e.thumbnail||void 0!==t?(o=void 0===e.type||null===e.type?"icon_11_generic_xl128":e.type.indexOf("word")>=0?"icon_11_word_xl128":e.type.indexOf("excel")>=0||e.type.indexOf("spreadsheet")>=0?"icon_11_excel_xl128":e.type.indexOf("powerpoint")>=0||e.type.indexOf("presentation")>=0?"icon_11_powerpoint_xl128":e.type.indexOf("image")>=0?"icon_11_image_xl128":e.type.indexOf("audio")>=0?"icon_11_audio_xl128":e.type.indexOf("video")>=0?"icon_11_video_xl128":e.type.indexOf("pdf")>=0?"icon_11_pdf_xl128":e.type.indexOf("text")>=0?"icon_11_text_xl128":"icon_11_generic_xl128",n+o+".png"):e.thumbnail},_dialogAddDescription:function(t){let i=this;e("#wpcp-modal-action").remove();let o=`\n <button class="button wpcp-modal-cancel-btn secondary" data-action="cancel" type="button" onclick="window.modal_action.close();" title="${i.options.str_close_title}">${i.options.str_close_title}</button>\n <button class="button wpcp-modal-confirm-btn" data-action="adddescription" type="button" title="${i.options.str_save_title}">${i.options.str_save_title}</button>`,n=e(`<div class="wpcp-modal-header" tabindex="0">\n <h2>${i.options.main.options.str_edit_description}</h2> \n <a tabindex="0" class="close-button" title="${i.options.main.options.str_close_title}" onclick="window.modal_action.close();"><i class="eva eva-close eva-lg" aria-hidden="true"></i></a>\n </div>`),s=e('<div class="wpcp-modal-body" tabindex="0" ><textarea id="wpcp-modal-description-input" name="wpcp-modal-description-input" style="width:100%" rows="8" placeholder="'+t.name+" | "+this.options.main.options.str_add_description+'"></textarea></div>'),l=e(`<div class="wpcp-modal-footer"><div class="wpcp-modal-buttons">${o}</div></div>
2`),a=e('<div id="wpcp-modal-action" class="UseyourDrive wpcp wpcp-modal '+this.options.main.options.content_skin+'"><div class="modal-dialog"><div class="modal-content"></div></div></div>');e("body").append(a),e("#wpcp-modal-action .modal-content").append(n,s,l),e("#wpcp-modal-description-input").val(t.description.replace(/<br\s?\/?>/g,"\r")),e("#wpcp-modal-action #wpcp-modal-description-input").on("keyup",function(t){13!=t.which&&13!=t.keyCode||e("#wpcp-modal-action .wpcp-modal-description-btn").trigger("click")}),e("#wpcp-modal-action .wpcp-modal-confirm-btn").on("click",function(o){t.description=e("#wpcp-modal-description-input").val(),i.queue[t.hash]=t,i.updateFileInQueueTable(t),u.close()});let u=new RModal(document.getElementById("wpcp-modal-action"),{bodyClass:"rmodal-open",dialogOpenClass:"animated slideInDown",dialogCloseClass:"animated slideOutUp",escapeClose:!0});return document.addEventListener("keydown",function(e){u.keydown(e)},!1),u.open(),window.modal_action=u,!1},_dialogFailedUploads:function(t,i){e("#wpcp-modal-action").remove();var o=this,n="";e.each(t,function(t,i){var o=i.element.find("img:first()"),s=e('<div class="wpcp-modal-file-icon">');o.length>0&&o.clone().appendTo(s),n+="<li>"+s.html()+"<span>"+i.name+"</span></li>"});let s=`\n <button class="button wpcp-modal-confirm-btn" data-action="confirm" type="button" title="${o.options.str_close_title}">${o.options.str_close_title}</button>`,l=e(`<div class="wpcp-modal-header" tabindex="0">\n <h2>${o.options.str_upload}</h2> \n <a tabindex="0" class="close-button" title="${o.options.str_close_title}" onclick="window.modal_action.close();"><i class="eva eva-close eva-lg" aria-hidden="true"></i></a>\n </div>`),a=e('<div class="wpcp-modal-body" tabindex="0" >'+o.options.str_uploading_failed_msg+'<br/><br/><ul class="wpcp-list-vertical">'+n+"</ul></div>"),u=e(`<div class="wpcp-modal-footer"><div class="wpcp-modal-buttons">${s}</div></div>`),r=e(`<div id="wpcp-modal-action" class="UseyourDrive wpcp wpcp-modal wpcp-theme-${o.options.content_skin}"><div class="modal-dialog"><div class="modal-content"></div></div></div>`);e("body").append(r),e("#wpcp-modal-action .modal-content").append(l,a,u),e("#wpcp-modal-action .wpcp-modal-confirm-btn").on("click",function(e){p.close()});let p=new RModal(document.getElementById("wpcp-modal-action"),{bodyClass:"rmodal-open",dialogOpenClass:"animated slideInDown",dialogCloseClass:"animated slideOutUp",escapeClose:!0});return document.addEventListener("keydown",function(e){p.keydown(e)},!1),p.open(),window.modal_action=p,!1},_dialogRemoveFromQueue:function(t){e("#wpcp-modal-action").remove();let i=this,o="";o+='<button class="button wpcp-modal-confirm-btn" data-action="confirm" type="button" title="'+i.options.str_close_title+'" >'+i.options.str_close_title+"</button>";let n=e(`<div class="wpcp-modal-header" tabindex="0">\n <h2>${i.options.str_upload}</h2> \n <a tabindex="0" class="close-button" title="${i.options.str_close_title}" onclick="window.modal_action.close();"><i class="eva eva-close eva-lg" aria-hidden="true"></i></a>\n </div>`),s=e('<div class="wpcp-modal-body" tabindex="0" >'+i.options.str_uploading_failed_in_form+"</div>"),l=e(`<div class="wpcp-modal-footer"><div class="wpcp-modal-buttons">${o}</div></div>`),a=e(`<div id="wpcp-modal-action" class="UseyourDrive wpcp wpcp-modal wpcp-theme-${i.options.content_skin}"><div class="modal-dialog"><div class="modal-content"></div></div></div>`);e("body").append(a),e("#wpcp-modal-action .modal-content").append(n,s,l),e("#wpcp-modal-action .wpcp-modal-confirm-btn").on("click",function(e){u.close()});let u=new RModal(document.getElementById("wpcp-modal-action"),{bodyClass:"rmodal-open",dialogOpenClass:"animated slideInDown",dialogCloseClass:"animated slideOutUp",escapeClose:!0});return document.addEventListener("keydown",function(e){u.keydown(e)},!1),u.open(),window.modal_action=u,!1}})});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.