(()=>{var e={7658:()=>{$((function(){$(document).on("submit","#forms",(function(e){e.preventDefault();var t=new FormData($(this)[0]),o=window.route("admin.ebook.export_csv");$.ajax({url:o,type:"POST",data:t,dataType:"json",cache:!1,contentType:!1,processData:!1,success:function(e){$("#forms").trigger("reset"),$(".show-csv-data").removeClass("d-none"),$(".select-matching-csv-data").css("border-radius","10px");var o="",a=["title","description","short_description","categories","authors","key_word","target_reader","publisher","publication_year","password","isbn","book_edition","price","country_origin","book_language","number_of_pages","buy_url","file_type","book_cover","book_file","is_featured","is_private","is_active","file_url","embed_code","audio_book_files"];$.each(e[0],(function(e,t){o+="<td><select name='fields' class='select-matching-csv-data custom-select w-auto'>",$.each(a,(function(e,a){o+=t==a?"<option value='"+a+"' selected>"+a.charAt(0).toUpperCase()+a.slice(1).replace("_"," ",a)+"</option>":"<option value='"+a+"'>"+a.charAt(0).toUpperCase()+a.slice(1).replace("_"," ",a)+"</option>"})),o+="</select></td>"})),$("thead > tr").append(o);var r="";$.each(e,(function(e,t){r+="<tr>",$.each(t,(function(e,t){r+="<td>"+t+"</td>"})),r+="</tr>"})),$("tbody").append(r),$(document).on("click","#import-csv",(function(e){e.preventDefault();var o=window.route("admin.importer.store");$.ajax({url:o,type:"POST",data:t,dataType:"json",cache:!1,contentType:!1,processData:!1,success:function(e){$(".show-csv-data").hide(),$("#loader-spin").show(),setTimeout((function(){location.reload()}),1e3)}})}))}})}))}))}},t={};function o(a){var r=t[a];if(void 0!==r)return r.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,o),n.exports}o.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";o(7658);$("#btn-import").on("click",(function(e){e.preventDefault();var t=$("#import_type").val();window.location.href=route("admin.download_csv.index",{import_type:t})}))})()})();
//# sourceMappingURL=import.js.map