jQuery(document).ready(function(o){o(".filr").DataTable({paging:filr_shortcode.pagination,searching:filr_shortcode.search,order:[filr_shortcode.default_sort,filr_shortcode.default_sort_type],pageLength:filr_shortcode.default_number_rows,autoWidth:!1,responsive:!0,language:{decimal:"",emptyTable:filr_shortcode.translations.no_files,info:filr_shortcode.translations.count_files,infoEmpty:filr_shortcode.translations.no_files,infoFiltered:filr_shortcode.translations.filtered_files,lengthMenu:filr_shortcode.translations.available_files,loadingRecords:filr_shortcode.translations.loading_files,searchPlaceholder:filr_shortcode.translations.search_files,search:"",zeroRecords:filr_shortcode.translations.no_files_found,paginate:{first:filr_shortcode.translations.first_page_files,last:filr_shortcode.translations.last_page_files,next:filr_shortcode.translations.next_page_files,previous:filr_shortcode.translations.previous_page_files}}}),o(".filr-button").on("click",function(t){var e=o(this).attr("data-download"),s=o(this).attr("data-expire"),i=o(this);"∞"!==s&&o.ajax({type:"post",dataType:"json",url:filr_shortcode.ajax_url,data:{action:"decrease_downloads",post_id:e,nonce:filr_shortcode.nonce},success:function(t){var e=o(i).parent().parent();0===t.remaining?o(e).remove():o(e).find(".remaining").text(t.remaining)}})}),o(".filr-folder-table").DataTable({paging:filr_shortcode.pagination,searching:filr_shortcode.search,order:[filr_shortcode.default_sort,filr_shortcode.default_sort_type],pageLength:filr_shortcode.default_number_rows,autoWidth:!1,responsive:!0,language:{decimal:"",emptyTable:filr_shortcode.translations.no_files,info:filr_shortcode.translations.count_files,infoEmpty:filr_shortcode.translations.no_files,infoFiltered:filr_shortcode.translations.filtered_files,lengthMenu:filr_shortcode.translations.available_files,loadingRecords:filr_shortcode.translations.loading_files,searchPlaceholder:filr_shortcode.translations.search_files,search:"",zeroRecords:filr_shortcode.translations.no_files_found,paginate:{first:filr_shortcode.translations.first_page_files,last:filr_shortcode.translations.last_page_files,next:filr_shortcode.translations.next_page_files,previous:filr_shortcode.translations.previous_page_files}}});o(".dataTables_wrapper").each(function(){"hidden"==o(this).css("visibility")?o(this).css("position","absolute"):o(this).css("position","relative")}),o(document).on("click",".filr-folder-button",function(){var t=o(this).attr("id"),t=o("#filr-"+t+"_wrapper");o(this).toggleClass("filr-folder-button-close"),o(this).text(filr_shortcode.translations.close_folder_text),"hidden"==o(t).css("visibility")?(o(t).css("visibility","visible"),o(t).css("position","relative")):(o(this).text(filr_shortcode.translations.open_folder_text),o(t).css("visibility","hidden"),o(t).css("position","absolute"))}),0<o(".filr-preview").length&&"on"===filr_shortcode.use_preview&&o(".filr-preview").each(function(){var t=o(this).attr("href");/\.(jpg|jpeg|png|webp|avif|gif|svg)$/.test(t)&&o(this).anarchytip()})});