/*! StateRestore 1.4.1 * © SpryMedia Ltd - datatables.net/license */ import jQuery from"jquery";import DataTable from"datatables.net";let $=jQuery;!function(){"use strict";var u,m;n.prototype.remove=function(e){var t,s,o,a,i=this;return void 0===e&&(e=!1),!!this.c.remove&&(o={action:"remove",stateRestore:((t={})[this.s.identifier]=this.s.savedState,t)},a=function(){i.dom.confirmation.trigger("dtsr-remove"),u(i.s.dt.table().node()).trigger("stateRestore-change"),i.dom.background.click(),i.dom.confirmation.remove(),u(document).unbind("keyup",function(e){return i._keyupFunction(e)}),i.dom.confirmationButton.off("click")},this.c.ajax?"string"==typeof this.c.ajax&&this.s.dt.settings()[0]._bInitComplete?s=function(){return u.ajax({data:o,success:a,type:"POST",url:i.c.ajax}),!0}:"function"==typeof this.c.ajax&&(s=function(){return"function"==typeof i.c.ajax&&i.c.ajax.call(i.s.dt,o,a),!0}):s=function(){try{localStorage.removeItem("DataTables_stateRestore_"+i.s.identifier+"_"+location.pathname+(i.s.tableId?"_"+i.s.tableId:"")),a()}catch(e){return i.dom.confirmation.children("."+i.classes.modalError).remove(),i.dom.confirmation.append(i.dom.removeError),"remove"}return!0},e?(this.dom.confirmation.appendTo(this.dom.dtContainer),u(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),s(),this.dom.confirmation.remove()):this._newModal(this.dom.removeTitle,this.s.dt.i18n("stateRestore.removeSubmit",this.c.i18n.removeSubmit),s,this.dom.removeContents),!0)},n.prototype.compare=function(e){if(this.c.saveState.order||(e.order=void 0),this.c.saveState.search||(e.search=void 0),this.c.saveState.columns&&e.columns)for(var t=0,s=e.columns.length;t'+a.s.dt.i18n("stateRestore.removeConfirm",a.c.i18n.removeConfirm).replace(/%s/g,a.s.identifier)+""),a.dom.confirmation.trigger("dtsr-rename"),a.dom.background.click(),a.dom.confirmation.remove(),u(document).unbind("keyup",function(e){return a._keyupFunction(e)}),a.dom.confirmationButton.off("click")}e={action:"rename",stateRestore:((e={})[a.s.identifier]=s,e)};if(a.c.ajax)"string"==typeof a.c.ajax&&a.s.dt.settings()[0]._bInitComplete?u.ajax({data:e,success:t,type:"POST",url:a.c.ajax}):"function"==typeof a.c.ajax&&a.c.ajax.call(a.s.dt,e,t);else try{localStorage.removeItem("DataTables_stateRestore_"+a.s.identifier+"_"+location.pathname+(a.s.tableId?"_"+a.s.tableId:"")),t()}catch(e){return a.dom.confirmation.children("."+a.classes.modalError).remove(),a.dom.confirmation.append(a.dom.removeError),!1}return!0};if(null!==s){if(o.includes(s))throw new Error(this.s.dt.i18n("stateRestore.duplicateError",this.c.i18n.duplicateError));if(0===s.length)throw new Error(this.s.dt.i18n("stateRestore.emptyError",this.c.i18n.emptyError));this.dom.confirmation.appendTo(this.dom.dtContainer),u(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),e(),this.dom.confirmation.remove()}else this.dom.renameInput.val(this.s.identifier),this.dom.renameContents.append(this.dom.renameInput),this._newModal(this.dom.renameTitle,this.s.dt.i18n("stateRestore.renameButton",this.c.i18n.renameButton),e,this.dom.renameContents)}},n.prototype.save=function(e,t,s){var o,a,i,n=this;if(void 0===s&&(s=!0),this.c.save){if(this.s.dt.state.save(),void 0===e)o=this.s.dt.state();else{if("object"!=typeof e)return;o=e}if(o.stateRestore?(o.stateRestore.isPreDefined=this.s.isPreDefined,o.stateRestore.state=this.s.identifier,o.stateRestore.tableId=this.s.tableId):o.stateRestore={isPreDefined:this.s.isPreDefined,state:this.s.identifier,tableId:this.s.tableId},this.s.savedState=o,this.c.saveState.order||(this.s.savedState.order=void 0),this.c.saveState.search||(this.s.savedState.search=void 0),this.c.saveState.columns&&this.s.savedState.columns)for(var r=0,c=this.s.savedState.columns.length;r/g,">").replace(/"/g,"""):e},n.prototype._deepCompare=function(e,t){var s,o,a=[e,t],i=[Object.keys(e).sort(),Object.keys(t).sort()];for(i[0].includes("scroller")&&(s=i[0].indexOf("start"))&&i[0].splice(s,1),i[1].includes("scroller")&&(s=i[1].indexOf("start"))&&i[1].splice(s,1),o=0;o').append(this.dom.confirmationButton)).appendTo(this.dom.dtContainer),u(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),o.children("input")),i=((0'),closeButton:u('
×
'),confirmation:u('
'),confirmationButton:u('")),e=(this.dom.confirmation.empty().append(this.dom.confirmationTitleRow).append(o).append(g('
').append(n)).appendTo(this.dom.dtContainer),g(this.s.dt.table().node()).trigger("dtsr-modal-inserted"),o.children("input")),r=((0'),checkboxInputRow:g('
'),closeButton:g('
x
'),colReorderToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.colReorder",this.c.i18n.creationModal.colReorder)+"
"),columnsSearchToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.columns.search",this.c.i18n.creationModal.columns.search)+"
"),columnsVisibleToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.columns.visible",this.c.i18n.creationModal.columns.visible)+"
"),confirmation:g('
'),confirmationTitleRow:g('
'),createButtonRow:g('
"),creation:g('
'),creationForm:g('
'),creationTitle:g('

'+this.s.dt.i18n("stateRestore.creationModal.title",this.c.i18n.creationModal.title)+"

"),dtContainer:g(this.s.dt.table().container()),duplicateError:g(''+this.s.dt.i18n("stateRestore.duplicateError",this.c.i18n.duplicateError)+""),emptyError:g(''+this.s.dt.i18n("stateRestore.emptyError",this.c.i18n.emptyError)+""),lengthToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.length",this.c.i18n.creationModal.length)+"
"),nameInputRow:g('
'),orderToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.order",this.c.i18n.creationModal.order)+"
"),pagingToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.paging",this.c.i18n.creationModal.paging)+"
"),removeContents:g('
'),removeTitle:g('

'+this.s.dt.i18n("stateRestore.removeTitle",this.c.i18n.removeTitle)+"

"),scrollerToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.scroller",this.c.i18n.creationModal.scroller)+"
"),searchBuilderToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.searchBuilder",this.c.i18n.creationModal.searchBuilder)+"
"),searchPanesToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.searchPanes",this.c.i18n.creationModal.searchPanes)+"
"),searchToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.search",this.c.i18n.creationModal.search)+"
"),selectToggle:g('
'+this.s.dt.i18n("stateRestore.creationModal.select",this.c.i18n.creationModal.select)+"
")},(e.settings()[0]._stateRestore=this)._searchForStates(),this._addPreDefined(this.c.preDefined),a={action:"load"},"function"==typeof this.c.ajax?s=function(){"function"==typeof o.c.ajax&&o.c.ajax.call(o.s.dt,a,function(e){return o._addPreDefined(e)})}:"string"==typeof this.c.ajax&&(s=function(){g.ajax({data:a,success:function(e){o._addPreDefined(e)},type:"POST",url:o.c.ajax})}),"function"==typeof s&&(this.s.dt.settings()[0]._bInitComplete?s():this.s.dt.one("preInit.dtsr",function(){s()})),this.s.dt.on("destroy.dtsr",function(){o.destroy()}),this.s.dt.on("draw.dtsr buttons-action.dtsr",function(){return o.findActive()}),this}e=$,m=(u=e).fn.dataTable,e=$,i=(g=e).fn.dataTable,$.fn.dataTable.StateRestore=y,$.fn.DataTable.StateRestore=y,$.fn.dataTable.StateRestoreCollection=s,$.fn.DataTable.StateRestoreCollection=s;var e=DataTable.Api.register;function o(e,t){c(e,new DataTable.StateRestoreCollection(e,t.config))}function c(e,t){var s=e.stateRestore.states(),o=e.button("SaveStateRestore:name"),a=[];if(o[0])for(var i=o.index().split("-"),a=o[0].inst.c.buttons,n=0;n'+e.i18n("stateRestore.emptyStates",t.c.i18n.emptyStates)+"");else for(var c=0,l=s;c