{"version":3,"sources":["webpack:///./app/javascript/src/datatables.js"],"names":["$","extend","fn","dataTable","defaults","responsive","pagingType","bPaginate","dom","document","on","e","settings","api","table_id","url","Api","table","node","id","data","ajax","runDataTable","DataTable","language","isDataTable","ready"],"mappings":"yFAAA,yBAEAA,EAAEC,OAAOD,EAAEE,GAAGC,UAAUC,SAAU,CAChCC,YAAY,EACZC,WAAY,OACZC,WAAW,EACXC,IACE,6LAKJR,EAAES,UAAUC,GAAG,cAAc,SAAUC,EAAGC,GACxC,IAAIC,EAAKC,EAAUC,EAInB,GAFAD,EAAW,KADXD,EAAM,IAAIb,EAAEE,GAAGC,UAAUa,IAAIJ,IACRK,QAAQC,OAAOC,GACpCJ,EAAMf,EAAEc,GAAUM,KAAK,UAErB,OAAOP,EAAIQ,KAAKN,IAAIA,MAIxB,IAAMO,EAAe,WACnBtB,EAAE,oBAAoBuB,UAAU,CAC9BC,SAAU,CACRT,IAAK,6DAMXf,EAAES,UAAUC,GAAG,mBAAmB,WAC3BV,EAAEE,GAAGqB,UAAUE,YAAY,qBAC9BH,OAcJtB,EAAES,UAAUiB,OAAM,WACX1B,EAAEE,GAAGqB,UAAUE,YAAY,qBAC9BH,Q","file":"js/6-97044dedbcfcf300faf0.chunk.js","sourcesContent":["import dt from \"datatables.net-responsive-bs4\";\n\n$.extend($.fn.dataTable.defaults, {\n responsive: true,\n pagingType: \"full\",\n bPaginate: false,\n dom:\n \"<'row dataTable__head'<'col-sm-12 col-md-6'l><'col-sm-12 col-md-6'f>>\" +\n \"<'row dataTable__body'<'col-sm-12'tr>>\" +\n \"<'row dataTable__footer'<'col-sm-12 col-md-5 small'i><'col-sm-12 col-md-7'p>>\",\n});\n\n$(document).on(\"preInit.dt\", function (e, settings) {\n var api, table_id, url;\n api = new $.fn.dataTable.Api(settings);\n table_id = \"#\" + api.table().node().id;\n url = $(table_id).data(\"source\");\n if (url) {\n return api.ajax.url(url);\n }\n});\n\nconst runDataTable = () => {\n $(\"table[id^=dttb-]\").DataTable({\n language: {\n url: \"//cdn.datatables.net/plug-ins/1.10.21/i18n/French.json\",\n },\n });\n};\n\n// init on turbolinks load\n$(document).on(\"turbolinks:load\", function () {\n if (!$.fn.DataTable.isDataTable(\"table[id^=dttb-]\")) {\n runDataTable();\n }\n});\n\n// turbolinks cache fix\n// $(document).on(\"turbolinks:before-cache\", function () {\n// var dataTable = $($.fn.dataTable.tables(true)).DataTable();\n// if (dataTable !== null) {\n// dataTable.clear();\n// dataTable.destroy();\n// return (dataTable = null);\n// }\n// });\n\n$(document).ready(function () {\n if (!$.fn.DataTable.isDataTable(\"table[id^=dttb-]\")) {\n runDataTable();\n }\n});\n"],"sourceRoot":""}