Your IP : 3.133.155.48


Current Path : /home/church/www/wp-content/plugins/ninja-forms/build/
Upload File :
Current File : /home/church/www/wp-content/plugins/ninja-forms/build/sub-table-render.js

!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=47)}([function(e,t){e.exports=window.wp.element},,,function(e,t){e.exports=window.wp.i18n},function(e,t){e.exports=window.React},function(e,t){e.exports=window.regeneratorRuntime},,function(e,t,n){var r=n(15),o=n(16),i=n(13),u=n(17);e.exports=function(e,t){return r(e)||o(e,t)||i(e,t)||u()},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.wp.apiFetch},function(e,t){e.exports=window.wp.data},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},e.exports.default=e.exports,e.exports.__esModule=!0,n.apply(this,arguments)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){var r=n(14);e.exports=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],_n=!0,u=!1;try{for(n=n.call(e);!(_n=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);_n=!0);}catch(e){u=!0,o=e}finally{try{_n||null==n.return||n.return()}finally{if(u)throw o}}return i}},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.default=e.exports,e.exports.__esModule=!0},,function(e,t,n){e.exports=n(30)},,,,,,,function(e,t,n){"use strict";var r=n(8),o=n.n(r),i=n(5),u=n.n(i),s=n(9),a=n.n(s);function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var d={forms:!1,fields:{},submissions:{}},f={setForms:function(e){return{type:"SET_FORMS",forms:e}},setFields:function(e,t){return{type:"SET_FIELDS",formID:e,fields:t}},setSubmissions:function(e,t,n){return{type:"SET_SUBMISSIONS",formID:e,submissions:t,page:n}},fetchFromAPI:function(e,t){return{type:"FETCH_FROM_API",path:e,data:t}}},p={getForms:function(e){return e.forms},getForm:function(e,t){var n=p.getForms(e);return Object.values(n).find((function(e){return e.formID==t}))},getFormFields:function(e,t){return e.fields[t]},getFormSubmissions:function(e,t){return e.submissions[t]},getFormSubmissionsPage:function(e,t,n){var r=e.submissions;return void 0!==r[t]&&r[t][n]}};t.a={reducer:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:d,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_FORMS":return c(c({},e),{},{forms:t.forms});case"SET_FIELDS":return c(c({},e),{},{fields:c(c({},e.fields),{},o()({},t.formID,t.fields))});case"SET_SUBMISSIONS":return c(c({},e),{},{submissions:c(c({},e.submissions),{},o()({},t.formID,c(c({},e.submissions[t.formID]),{},o()({},t.page,t.submissions))))})}return e},actions:f,selectors:p,controls:{FETCH_FROM_API:function(e){return a()({path:e.path})}},resolvers:{getForms:u.a.mark((function e(){var t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=3,f.fetchFromAPI("/ninja-forms-views/forms");case 3:return t=e.sent,e.abrupt("return",f.setForms(t));case 5:case"end":return e.stop()}}),e)})),getFormFields:u.a.mark((function e(t){var n,r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="/ninja-forms-views/forms/"+t+"/fields",e.next=3,f.fetchFromAPI(n);case 3:return r=e.sent,e.abrupt("return",f.setFields(t,r));case 5:case"end":return e.stop()}}),e)})),getFormSubmissions:u.a.mark((function e(t){var n,r;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n="/ninja-forms-views/forms/"+t+"/submissions?page=1&perPage=10",e.next=3,f.fetchFromAPI(n);case 3:return r=e.sent,e.abrupt("return",f.setSubmissions(t,r,1));case 5:case"end":return e.stop()}}),e)})),getFormSubmissionsPage:u.a.mark((function e(t,n){var r,o;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/ninja-forms-views/forms/"+t+"/submissions?page="+n+"&perPage=10",e.next=3,f.fetchFromAPI(r);case 3:return o=e.sent,e.abrupt("return",f.setSubmissions(t,o,n));case 5:case"end":return e.stop()}}),e)}))}}},function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(8),o=n.n(r);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e){function t(e,n){if(0!==(e.path||"").indexOf("/ninja-forms-views/"))return n(e);var r=e.headers,o=void 0===r?{}:r;for(var i in o)if("x-ninjaformsviews-auth"===i.toLowerCase())return n(e);return n(u(u({},e),{},{headers:u(u({},o),{},{"X-NinjaFormsViews-Auth":t.token})}))}return t.token=e,t}},function(e,t,n){"use strict";var r=n(11),o=n.n(r),i=n(7),u=n.n(i),s=n(0),a=n(3),l=n(10),c=n(19);function d(e){var t=e.columns,n=e.data,r=e.initialPageIndex,i=e.loadMore,u=e.more,a=e.loading,l=Object(c.useTable)({columns:t,data:n,initialState:{pageIndex:r,pageSize:10}},c.usePagination),d=l.state.pageIndex,v=l.getTableProps,m=l.getTableBodyProps,h=l.canNextPage,y=l.canPreviousPage,w=l.page;return Object(s.createElement)(s.Fragment,null,Object(s.createElement)("table",v(),Object(s.createElement)("thead",null,Object(s.createElement)(f,l)),Object(s.createElement)("tbody",m(),Object(s.createElement)(p,o()({},l,{dataset:w})))),Object(s.createElement)(g,o()({},l,{loadMore:function(){return i(d+1)},more:u,loading:a,canNextPage:h,canPreviousPage:y})))}function f(e){var t=e.headerGroups;return t.length<=0?Object(s.createElement)("tr",null,Object(s.createElement)("th",null,Object(a.__)("No columns selected. Please choose fields using the block settings ->","ninja-forms"))):t.map((function(e){return Object(s.createElement)("tr",e.getHeaderGroupProps(),e.headers.map((function(e){return Object(s.createElement)("th",e.getHeaderProps(),e.render("Header"))})))}))}function p(e){var t=e.dataset,n=e.prepareRow;return t.map((function(e,t){return n(e),Object(s.createElement)("tr",e.getRowProps(),e.cells.map((function(e){return Object(s.createElement)("td",o()({},e.getCellProps(),{"data-header":e.column.Header}),e.render("Cell"))})))}))}function g(e){var t,n=e.previousPage,r=e.nextPage,o=e.canPreviousPage,i=e.canNextPage,u=e.loadMore,a=e.more,l=e.loading,c=function(){u(),r()};return i?t=Object(s.createElement)("button",{onClick:c},">"):a&&(t=Object(s.createElement)("button",{onClick:c},l?"...":">")),Object(s.createElement)("div",{style:{display:"flex",justifyContent:"space-between"}},Object(s.createElement)("div",null,o&&Object(s.createElement)("button",{onClick:function(){return n()}},"<")),i&&Object(s.createElement)("div",null,t))}t.a=function(e){var t=e.formID,n=e.selectedFields,r=e.fields,o=e.submissions,i=r.filter((function(e){return-1!==n.indexOf(e.id)})).map((function(e){return{Header:e.label,accessor:e.id.toString()}})),a=Object(s.useState)(0),c=u()(a,2),f=c[0],p=c[1],g=Object(s.useState)(!1),v=u()(g,2),m=v[0],h=v[1];o[m]&&(o[m].length&&p(m),h(!1)),o[f+1]||Object(l.select)("ninja-forms-views").getFormSubmissionsPage(t,f+2);var y=o[o.length-1]&&o[o.length-1].length,w=o.flat();return Object(s.createElement)(d,{columns:i,data:w,initialPageIndex:f,loadMore:function(e){h(e),Object(l.select)("ninja-forms-views").getFormSubmissionsPage(t,e+1)},more:y,loading:m})}},,function(e,t,n){!function(e,t){"use strict";function n(e,t,n,r,o,i,u){try{var s=e[i](u),a=s.value}catch(e){return void n(e)}s.done?t(a):Promise.resolve(a).then(r,o)}function r(e){return function(){var t=this,r=arguments;return new Promise((function(o,i){var u=e.apply(t,r);function s(e){n(u,o,i,s,a,"next",e)}function a(e){n(u,o,i,s,a,"throw",e)}s(void 0)}))}}function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}function u(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var s={init:"init"},a=function(e){var t=e.value;return void 0===t?"":t},l=function(){return t.createElement(t.Fragment,null," ")},c={Cell:a,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function d(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce((function(e,t){var n=t.style,r=t.className;return e=o({},e,{},i(t,["style","className"])),n&&(e.style=e.style?o({},e.style||{},{},n||{}):n),r&&(e.className=e.className?e.className+" "+r:r),""===e.className&&delete e.className,e}),{})}var f=function(e,t){return void 0===t&&(t={}),function(n){return void 0===n&&(n={}),[].concat(e,[n]).reduce((function(e,r){return function e(t,n,r){return"function"==typeof n?e({},n(t,r)):Array.isArray(n)?d.apply(void 0,[t].concat(n)):d(t,n)}(e,r,o({},t,{userProps:n}))}),{})}},p=function(e,t,n,r){return void 0===n&&(n={}),e.reduce((function(e,t){return t(e,n)}),t)},g=function(e,t,n){return void 0===n&&(n={}),e.forEach((function(e){e(t,n)}))};function v(e,t,n,r){e.findIndex((function(e){return e.pluginName===n})),t.forEach((function(t){e.findIndex((function(e){return e.pluginName===t}))}))}function m(e,t){return"function"==typeof e?e(t):e}function h(e){var n=t.useRef();return n.current=e,t.useCallback((function(){return n.current}),[])}var y="undefined"!=typeof document?t.useLayoutEffect:t.useEffect;function w(e,n){var r=t.useRef(!1);y((function(){r.current&&e(),r.current=!0}),n)}function b(e,t,n){return void 0===n&&(n={}),function(r,i){void 0===i&&(i={});var u="string"==typeof r?t[r]:r;if(void 0===u)throw console.info(t),new Error("Renderer Error ☝️");return R(u,o({},e,{column:t},n,{},i))}}function R(e,n){return function(e){return"function"==typeof e&&(t=Object.getPrototypeOf(e)).prototype&&t.prototype.isReactComponent;var t}(r=e)||"function"==typeof r||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?t.createElement(e,n):e;var r}function S(e,t,n){return void 0===n&&(n=0),e.map((function(e){return C(e=o({},e,{parent:t,depth:n})),e.columns&&(e.columns=S(e.columns,e,n+1)),e}))}function x(e){return F(e,"columns")}function C(e){var t=e.id,n=e.accessor,r=e.Header;if("string"==typeof n){t=t||n;var o=n.split(".");n=function(e){return function(e,t,n){if(!t)return e;var r,o="function"==typeof t?t:JSON.stringify(t),i=I.get(o)||function(){var e=function(e){return function e(t,n){if(void 0===n&&(n=[]),Array.isArray(t))for(var r=0;r<t.length;r+=1)e(t[r],n);else n.push(t);return n}(e).map((function(e){return String(e).replace(".","_")})).join(".").replace(T,".").replace(M,"").split(".")}(t);return I.set(o,e),e}();try{r=i.reduce((function(e,t){return e[t]}),e)}catch(e){}return void 0!==r?r:void 0}(e,o)}}if(!t&&"string"==typeof r&&r&&(t=r),!t&&e.columns)throw console.error(e),new Error('A column ID (or unique "Header" value) is required!');if(!t)throw console.error(e),new Error("A column ID (or string accessor) is required!");return Object.assign(e,{id:t,accessor:n}),e}function P(e,t){if(!t)throw new Error;return Object.assign(e,o({Header:l,Footer:l},c,{},t,{},e)),Object.assign(e,{originalWidth:e.width}),e}function E(e,t,n){void 0===n&&(n=function(){return{}});for(var r=[],i=e,u=0,s=function(){return u++},a=function(){var e={headers:[]},u=[],a=i.some((function(e){return e.parent}));i.forEach((function(r){var i,l=[].concat(u).reverse()[0];a&&(i=r.parent?o({},r.parent,{originalId:r.parent.id,id:r.parent.id+"_"+s(),headers:[r]},n(r)):P(o({originalId:r.id+"_placeholder",id:r.id+"_placeholder_"+s(),placeholderOf:r,headers:[r]},n(r)),t),l&&l.originalId===i.originalId?l.headers.push(r):u.push(i)),e.headers.push(r)})),r.push(e),i=u};i.length;)a();return r.reverse()}var I=new Map;function B(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r+=1)if(void 0!==t[r])return t[r]}function O(e){if("function"==typeof e)return e}function F(e,t){var n=[];return function e(r){r.forEach((function(r){r[t]?e(r[t]):n.push(r)}))}(e),n}function j(e,t){var n=t.manualExpandedKey,r=t.expanded,o=t.expandSubRows,i=void 0===o||o,u=[];return e.forEach((function(e){return function e(t,o){void 0===o&&(o=!0),t.isExpanded=t.original&&t.original[n]||r[t.id],t.canExpand=t.subRows&&!!t.subRows.length,o&&u.push(t),t.subRows&&t.subRows.length&&t.isExpanded&&t.subRows.forEach((function(t){return e(t,i)}))}(e)})),u}function G(e,t,n){return O(e)||t[e]||n[e]||n.text}function A(e,t,n){return e?e(t,n):void 0===t}function k(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var H=null,T=/\[/g,M=/\]/g,z=function(e){return o({role:"table"},e)},W=function(e){return o({role:"rowgroup"},e)},_=function(e,t){var n=t.column;return o({key:"header_"+n.id,colSpan:n.totalVisibleHeaderCount,role:"columnheader"},e)},D=function(e,t){var n=t.column;return o({key:"footer_"+n.id,colSpan:n.totalVisibleHeaderCount},e)},N=function(e,t){return o({key:"headerGroup_"+t.index,role:"row"},e)},L=function(e,t){return o({key:"footerGroup_"+t.index},e)},V=function(e,t){return o({key:"row_"+t.row.id,role:"row"},e)},X=function(e,t){var n=t.cell;return o({key:"cell_"+n.row.id+"_"+n.column.id,role:"cell"},e)};function q(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[z],getTableBodyProps:[W],getHeaderGroupProps:[N],getFooterGroupProps:[L],getHeaderProps:[_],getFooterProps:[D],getRowProps:[V],getCellProps:[X],useFinalInstance:[]}}s.resetHiddenColumns="resetHiddenColumns",s.toggleHideColumn="toggleHideColumn",s.setHiddenColumns="setHiddenColumns",s.toggleHideAllColumns="toggleHideAllColumns";var U=function(e){e.getToggleHiddenProps=[K],e.getToggleHideAllColumnsProps=[$],e.stateReducers.push(J),e.useInstanceBeforeDimensions.push(Y),e.headerGroupsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.hiddenColumns])})),e.useInstance.push(Q)};U.pluginName="useColumnVisibility";var K=function(e,t){var n=t.column;return[e,{onChange:function(e){n.toggleHidden(!e.target.checked)},style:{cursor:"pointer"},checked:n.isVisible,title:"Toggle Column Visible"}]},$=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleHideAllColumns(!e.target.checked)},style:{cursor:"pointer"},checked:!n.allColumnsHidden&&!n.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!n.allColumnsHidden&&n.state.hiddenColumns.length}]};function J(e,t,n,r){if(t.type===s.init)return o({hiddenColumns:[]},e);if(t.type===s.resetHiddenColumns)return o({},e,{hiddenColumns:r.initialState.hiddenColumns||[]});if(t.type===s.toggleHideColumn){var i=(void 0!==t.value?t.value:!e.hiddenColumns.includes(t.columnId))?[].concat(e.hiddenColumns,[t.columnId]):e.hiddenColumns.filter((function(e){return e!==t.columnId}));return o({},e,{hiddenColumns:i})}return t.type===s.setHiddenColumns?o({},e,{hiddenColumns:m(t.value,e.hiddenColumns)}):t.type===s.toggleHideAllColumns?o({},e,{hiddenColumns:(void 0!==t.value?t.value:!e.hiddenColumns.length)?r.allColumns.map((function(e){return e.id})):[]}):void 0}function Y(e){var n=e.headers,r=e.state.hiddenColumns;t.useRef(!1).current;var o=0;n.forEach((function(e){return o+=function e(t,n){t.isVisible=n&&!r.includes(t.id);var o=0;return t.headers&&t.headers.length?t.headers.forEach((function(n){return o+=e(n,t.isVisible)})):o=t.isVisible?1:0,t.totalVisibleHeaderCount=o,o}(e,!0)}))}function Q(e){var n=e.columns,r=e.flatHeaders,o=e.dispatch,i=e.allColumns,u=e.getHooks,a=e.state.hiddenColumns,l=e.autoResetHiddenColumns,c=void 0===l||l,d=h(e),p=i.length===a.length,g=t.useCallback((function(e,t){return o({type:s.toggleHideColumn,columnId:e,value:t})}),[o]),v=t.useCallback((function(e){return o({type:s.setHiddenColumns,value:e})}),[o]),m=t.useCallback((function(e){return o({type:s.toggleHideAllColumns,value:e})}),[o]),y=f(u().getToggleHideAllColumnsProps,{instance:d()});r.forEach((function(e){e.toggleHidden=function(t){o({type:s.toggleHideColumn,columnId:e.id,value:t})},e.getToggleHiddenProps=f(u().getToggleHiddenProps,{instance:d(),column:e})}));var b=h(c);w((function(){b()&&o({type:s.resetHiddenColumns})}),[o,n]),Object.assign(e,{allColumnsHidden:p,toggleHideColumn:g,setHiddenColumns:v,toggleHideAllColumns:m,getToggleHideAllColumnsProps:y})}var Z={},ee={},te=function(e,t,n){return e},ne=function(e,t){return e.subRows||[]},re=function(e,t,n){return""+(n?[n.id,t].join("."):t)},oe=function(e){return e};function ie(e){var t=e.initialState,n=void 0===t?Z:t,r=e.defaultColumn,u=void 0===r?ee:r,s=e.getSubRows,a=void 0===s?ne:s,l=e.getRowId,c=void 0===l?re:l,d=e.stateReducer,f=void 0===d?te:d,p=e.useControlledState,g=void 0===p?oe:p;return o({},i(e,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:n,defaultColumn:u,getSubRows:a,getRowId:c,stateReducer:f,useControlledState:g})}function ue(e,t){void 0===t&&(t=0);var n=0,r=0,o=0,i=0;return e.forEach((function(e){var u=e.headers;if(e.totalLeft=t,u&&u.length){var s=ue(u,t),a=s[0],l=s[1],c=s[2],d=s[3];e.totalMinWidth=a,e.totalWidth=l,e.totalMaxWidth=c,e.totalFlexWidth=d}else e.totalMinWidth=e.minWidth,e.totalWidth=Math.min(Math.max(e.minWidth,e.width),e.maxWidth),e.totalMaxWidth=e.maxWidth,e.totalFlexWidth=e.canResize?e.totalWidth:0;e.isVisible&&(t+=e.totalWidth,n+=e.totalMinWidth,r+=e.totalWidth,o+=e.totalMaxWidth,i+=e.totalFlexWidth)})),[n,r,o,i]}function se(e){var t=e.data,n=e.rows,r=e.flatRows,o=e.rowsById,i=e.column,u=e.getRowId,s=e.getSubRows,a=e.accessValueHooks,l=e.getInstance;t.forEach((function(e,c){return function e(n,c,d,f,g){void 0===d&&(d=0);var v=n,m=u(n,c,f),h=o[m];if(h)h.subRows&&h.originalSubRows.forEach((function(t,n){return e(t,n,d+1,h)}));else if((h={id:m,original:v,index:c,depth:d,cells:[{}]}).cells.map=k,h.cells.filter=k,h.cells.forEach=k,h.cells[0].getCellProps=k,h.values={},g.push(h),r.push(h),o[m]=h,h.originalSubRows=s(n,c),h.originalSubRows){var y=[];h.originalSubRows.forEach((function(t,n){return e(t,n,d+1,h,y)})),h.subRows=y}i.accessor&&(h.values[i.id]=i.accessor(n,c,h,g,t)),h.values[i.id]=p(a,h.values[i.id],{row:h,column:i,instance:l()})}(e,c,0,void 0,n)}))}s.resetExpanded="resetExpanded",s.toggleRowExpanded="toggleRowExpanded",s.toggleAllRowsExpanded="toggleAllRowsExpanded";var ae=function(e){e.getToggleAllRowsExpandedProps=[le],e.getToggleRowExpandedProps=[ce],e.stateReducers.push(de),e.useInstance.push(fe),e.prepareRow.push(pe)};ae.pluginName="useExpanded";var le=function(e,t){var n=t.instance;return[e,{onClick:function(e){n.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},ce=function(e,t){var n=t.row;return[e,{onClick:function(){n.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function de(e,t,n,r){if(t.type===s.init)return o({expanded:{}},e);if(t.type===s.resetExpanded)return o({},e,{expanded:r.initialState.expanded||{}});if(t.type===s.toggleAllRowsExpanded){var a=t.value,l=r.isAllRowsExpanded,c=r.rowsById;if(void 0!==a?a:!l){var d={};return Object.keys(c).forEach((function(e){d[e]=!0})),o({},e,{expanded:d})}return o({},e,{expanded:{}})}if(t.type===s.toggleRowExpanded){var f,p=t.id,g=t.value,v=e.expanded[p],m=void 0!==g?g:!v;if(!v&&m)return o({},e,{expanded:o({},e.expanded,(f={},f[p]=!0,f))});if(v&&!m){var h=e.expanded;return h[p],o({},e,{expanded:i(h,[p].map(u))})}return e}}function fe(e){var n=e.data,r=e.rows,o=e.rowsById,i=e.manualExpandedKey,u=void 0===i?"expanded":i,a=e.paginateExpandedRows,l=void 0===a||a,c=e.expandSubRows,d=void 0===c||c,p=e.autoResetExpanded,g=void 0===p||p,m=e.getHooks,y=e.plugins,b=e.state.expanded,R=e.dispatch;v(y,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var S=h(g),x=Boolean(Object.keys(o).length&&Object.keys(b).length);x&&Object.keys(o).some((function(e){return!b[e]}))&&(x=!1),w((function(){S()&&R({type:s.resetExpanded})}),[R,n]);var C=t.useCallback((function(e,t){R({type:s.toggleRowExpanded,id:e,value:t})}),[R]),P=t.useCallback((function(e){return R({type:s.toggleAllRowsExpanded,value:e})}),[R]),E=t.useMemo((function(){return l?j(r,{manualExpandedKey:u,expanded:b,expandSubRows:d}):r}),[l,r,u,b,d]),I=t.useMemo((function(){return function(e){var t=0;return Object.keys(e).forEach((function(e){var n=e.split(".");t=Math.max(t,n.length)})),t}(b)}),[b]),B=h(e),O=f(m().getToggleAllRowsExpandedProps,{instance:B()});Object.assign(e,{preExpandedRows:r,expandedRows:E,rows:E,expandedDepth:I,isAllRowsExpanded:x,toggleRowExpanded:C,toggleAllRowsExpanded:P,getToggleAllRowsExpandedProps:O})}function pe(e,t){var n=t.instance.getHooks,r=t.instance;e.toggleRowExpanded=function(t){return r.toggleRowExpanded(e.id,t)},e.getToggleRowExpandedProps=f(n().getToggleRowExpandedProps,{instance:r,row:e})}var ge=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return String(r).toLowerCase().includes(String(n).toLowerCase())}))}))};ge.autoRemove=function(e){return!e};var ve=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return void 0===r||String(r).toLowerCase()===String(n).toLowerCase()}))}))};ve.autoRemove=function(e){return!e};var me=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return void 0===r||String(r)===String(n)}))}))};me.autoRemove=function(e){return!e};var he=function(e,t,n){return e.filter((function(e){return t.some((function(t){return e.values[t].includes(n)}))}))};he.autoRemove=function(e){return!e||!e.length};var ye=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return r&&r.length&&n.every((function(e){return r.includes(e)}))}))}))};ye.autoRemove=function(e){return!e||!e.length};var we=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return r&&r.length&&n.some((function(e){return r.includes(e)}))}))}))};we.autoRemove=function(e){return!e||!e.length};var be=function(e,t,n){return e.filter((function(e){return t.some((function(t){var r=e.values[t];return n.includes(r)}))}))};be.autoRemove=function(e){return!e||!e.length};var Re=function(e,t,n){return e.filter((function(e){return t.some((function(t){return e.values[t]===n}))}))};Re.autoRemove=function(e){return void 0===e};var Se=function(e,t,n){return e.filter((function(e){return t.some((function(t){return e.values[t]==n}))}))};Se.autoRemove=function(e){return null==e};var xe=function(e,t,n){var r=n||[],o=r[0],i=r[1];if((o="number"==typeof o?o:-1/0)>(i="number"==typeof i?i:1/0)){var u=o;o=i,i=u}return e.filter((function(e){return t.some((function(t){var n=e.values[t];return n>=o&&n<=i}))}))};xe.autoRemove=function(e){return!e||"number"!=typeof e[0]&&"number"!=typeof e[1]};var Ce=Object.freeze({__proto__:null,text:ge,exactText:ve,exactTextCase:me,includes:he,includesAll:ye,includesSome:we,includesValue:be,exact:Re,equals:Se,between:xe});s.resetFilters="resetFilters",s.setFilter="setFilter",s.setAllFilters="setAllFilters";var Pe=function(e){e.stateReducers.push(Ee),e.useInstance.push(Ie)};function Ee(e,t,n,r){if(t.type===s.init)return o({filters:[]},e);if(t.type===s.resetFilters)return o({},e,{filters:r.initialState.filters||[]});if(t.type===s.setFilter){var i=t.columnId,u=t.filterValue,a=r.allColumns,l=r.filterTypes,c=a.find((function(e){return e.id===i}));if(!c)throw new Error("React-Table: Could not find a column with id: "+i);var d=G(c.filter,l||{},Ce),f=e.filters.find((function(e){return e.id===i})),p=m(u,f&&f.value);return A(d.autoRemove,p,c)?o({},e,{filters:e.filters.filter((function(e){return e.id!==i}))}):o({},e,f?{filters:e.filters.map((function(e){return e.id===i?{id:i,value:p}:e}))}:{filters:[].concat(e.filters,[{id:i,value:p}])})}if(t.type===s.setAllFilters){var g=t.filters,v=r.allColumns,h=r.filterTypes;return o({},e,{filters:m(g,e.filters).filter((function(e){var t=v.find((function(t){return t.id===e.id}));return!A(G(t.filter,h||{},Ce).autoRemove,e.value,t)}))})}}function Ie(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,u=e.allColumns,a=e.filterTypes,l=e.manualFilters,c=e.defaultCanFilter,d=void 0!==c&&c,f=e.disableFilters,p=e.state.filters,g=e.dispatch,v=e.autoResetFilters,m=void 0===v||v,y=t.useCallback((function(e,t){g({type:s.setFilter,columnId:e,filterValue:t})}),[g]),b=t.useCallback((function(e){g({type:s.setAllFilters,filters:e})}),[g]);u.forEach((function(e){var t=e.id,n=e.accessor,r=e.defaultCanFilter,o=e.disableFilters;e.canFilter=n?B(!0!==o&&void 0,!0!==f&&void 0,!0):B(r,d,!1),e.setFilter=function(t){return y(e.id,t)};var i=p.find((function(e){return e.id===t}));e.filterValue=i&&i.value}));var R=t.useMemo((function(){if(l||!p.length)return[r,o,i];var e=[],t={};return[function n(r,o){void 0===o&&(o=0);var i=r;return(i=p.reduce((function(e,t){var n=t.id,r=t.value,i=u.find((function(e){return e.id===n}));if(!i)return e;0===o&&(i.preFilteredRows=e);var s=G(i.filter,a||{},Ce);return s?(i.filteredRows=s(e,[n],r),i.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+i.id+"."),e)}),r)).forEach((function(r){e.push(r),t[r.id]=r,r.subRows&&(r.subRows=r.subRows&&r.subRows.length>0?n(r.subRows,o+1):r.subRows)})),i}(r),e,t]}),[l,p,r,o,i,u,a]),S=R[0],x=R[1],C=R[2];t.useMemo((function(){u.filter((function(e){return!p.find((function(t){return t.id===e.id}))})).forEach((function(e){e.preFilteredRows=S,e.filteredRows=S}))}),[S,p,u]);var P=h(m);w((function(){P()&&g({type:s.resetFilters})}),[g,l?null:n]),Object.assign(e,{preFilteredRows:r,preFilteredFlatRows:o,preFilteredRowsById:i,filteredRows:S,filteredFlatRows:x,filteredRowsById:C,rows:S,flatRows:x,rowsById:C,setFilter:y,setAllFilters:b})}Pe.pluginName="useFilters",s.resetGlobalFilter="resetGlobalFilter",s.setGlobalFilter="setGlobalFilter";var Be=function(e){e.stateReducers.push(Oe),e.useInstance.push(Fe)};function Oe(e,t,n,r){if(t.type===s.resetGlobalFilter)return o({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===s.setGlobalFilter){var u=t.filterValue,a=r.userFilterTypes,l=G(r.globalFilter,a||{},Ce),c=m(u,e.globalFilter);return A(l.autoRemove,c)?(e.globalFilter,i(e,["globalFilter"])):o({},e,{globalFilter:c})}}function Fe(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,u=e.allColumns,a=e.filterTypes,l=e.globalFilter,c=e.manualGlobalFilter,d=e.state.globalFilter,f=e.dispatch,p=e.autoResetGlobalFilter,g=void 0===p||p,v=e.disableGlobalFilter,m=t.useCallback((function(e){f({type:s.setGlobalFilter,filterValue:e})}),[f]),y=t.useMemo((function(){if(c||void 0===d)return[r,o,i];var e=[],t={},n=G(l,a||{},Ce);if(!n)return console.warn("Could not find a valid 'globalFilter' option."),r;u.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=B(!0!==t&&void 0,!0!==v&&void 0,!0)}));var s=u.filter((function(e){return!0===e.canFilter}));return[function r(o){return(o=n(o,s.map((function(e){return e.id})),d)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?r(n.subRows):n.subRows})),o}(r),e,t]}),[c,d,l,a,u,r,o,i,v]),b=y[0],R=y[1],S=y[2],x=h(g);w((function(){x()&&f({type:s.resetGlobalFilter})}),[f,c?null:n]),Object.assign(e,{preGlobalFilteredRows:r,preGlobalFilteredFlatRows:o,preGlobalFilteredRowsById:i,globalFilteredRows:b,globalFilteredFlatRows:R,globalFilteredRowsById:S,rows:b,flatRows:R,rowsById:S,setGlobalFilter:m,disableGlobalFilter:v})}function je(e,t){return t.reduce((function(e,t){return e+("number"==typeof t?t:0)}),0)}Be.pluginName="useGlobalFilter";var Ge=Object.freeze({__proto__:null,sum:je,min:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e))})),t},max:function(e){var t=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.max(t,e))})),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach((function(e){"number"==typeof e&&(t=Math.min(t,e),n=Math.max(n,e))})),t+".."+n},average:function(e){return je(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort((function(e,t){return e-t}));return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),Ae=[],ke={};s.resetGroupBy="resetGroupBy",s.setGroupBy="setGroupBy",s.toggleGroupBy="toggleGroupBy";var He=function(e){e.getGroupByToggleProps=[Te],e.stateReducers.push(Me),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.groupBy])})),e.visibleColumns.push(ze),e.useInstance.push(_e),e.prepareRow.push(De)};He.pluginName="useGroupBy";var Te=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(e){e.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function Me(e,t,n,r){if(t.type===s.init)return o({groupBy:[]},e);if(t.type===s.resetGroupBy)return o({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===s.setGroupBy)return o({},e,{groupBy:t.value});if(t.type===s.toggleGroupBy){var i=t.columnId,u=t.value,a=void 0!==u?u:!e.groupBy.includes(i);return o({},e,a?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter((function(e){return e!==i}))})}}function ze(e,t){var n=t.instance.state.groupBy,r=n.map((function(t){return e.find((function(e){return e.id===t}))})).filter(Boolean),o=e.filter((function(e){return!n.includes(e.id)}));return(e=[].concat(r,o)).forEach((function(e){e.isGrouped=n.includes(e.id),e.groupedIndex=n.indexOf(e.id)})),e}var We={};function _e(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.rowsById,u=e.allColumns,a=e.flatHeaders,l=e.groupByFn,c=void 0===l?Ne:l,d=e.manualGroupBy,p=e.aggregations,g=void 0===p?We:p,m=e.plugins,y=e.state.groupBy,b=e.dispatch,R=e.autoResetGroupBy,S=void 0===R||R,x=e.disableGroupBy,C=e.defaultCanGroupBy,P=e.getHooks;v(m,["useColumnOrder","useFilters"],"useGroupBy");var E=h(e);u.forEach((function(t){var n=t.accessor,r=t.defaultGroupBy,o=t.disableGroupBy;t.canGroupBy=n?B(t.canGroupBy,!0!==o&&void 0,!0!==x&&void 0,!0):B(t.canGroupBy,r,C,!1),t.canGroupBy&&(t.toggleGroupBy=function(){return e.toggleGroupBy(t.id)}),t.Aggregated=t.Aggregated||t.Cell}));var I=t.useCallback((function(e,t){b({type:s.toggleGroupBy,columnId:e,value:t})}),[b]),O=t.useCallback((function(e){b({type:s.setGroupBy,value:e})}),[b]);a.forEach((function(e){e.getGroupByToggleProps=f(P().getGroupByToggleProps,{instance:E(),header:e})}));var j=t.useMemo((function(){if(d||!y.length)return[r,o,i,Ae,ke,o,i];var e=y.filter((function(e){return u.find((function(t){return t.id===e}))})),t=[],n={},s=[],a={},l=[],f={},p=function r(o,i,d){if(void 0===i&&(i=0),i===e.length)return o;var p=e[i],v=c(o,p);return Object.entries(v).map((function(o,c){var v=o[0],m=o[1],h=p+":"+v,y=r(m,i+1,h=d?d+">"+h:h),w=i?F(m,"leafRows"):m,b=function(t,n,r){var o={};return u.forEach((function(i){if(e.includes(i.id))o[i.id]=n[0]?n[0].values[i.id]:null;else{var u="function"==typeof i.aggregate?i.aggregate:g[i.aggregate]||Ge[i.aggregate];if(u){var s=n.map((function(e){return e.values[i.id]})),a=t.map((function(e){var t=e.values[i.id];if(!r&&i.aggregateValue){var n="function"==typeof i.aggregateValue?i.aggregateValue:g[i.aggregateValue]||Ge[i.aggregateValue];if(!n)throw console.info({column:i}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,i)}return t}));o[i.id]=u(a,s)}else{if(i.aggregate)throw console.info({column:i}),new Error("React Table: Invalid column.aggregate option for column listed above");o[i.id]=null}}})),o}(w,m,i),R={id:h,isGrouped:!0,groupByID:p,groupByVal:v,values:b,subRows:y,leafRows:w,depth:i,index:c};return y.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(s.push(e),a[e.id]=e):(l.push(e),f[e.id]=e)})),R}))}(r);return p.forEach((function(e){t.push(e),n[e.id]=e,e.isGrouped?(s.push(e),a[e.id]=e):(l.push(e),f[e.id]=e)})),[p,t,n,s,a,l,f]}),[d,y,r,o,i,u,g,c]),G=j[0],A=j[1],k=j[2],H=j[3],T=j[4],M=j[5],z=j[6],W=h(S);w((function(){W()&&b({type:s.resetGroupBy})}),[b,d?null:n]),Object.assign(e,{preGroupedRows:r,preGroupedFlatRow:o,preGroupedRowsById:i,groupedRows:G,groupedFlatRows:A,groupedRowsById:k,onlyGroupedFlatRows:H,onlyGroupedRowsById:T,nonGroupedFlatRows:M,nonGroupedRowsById:z,rows:G,flatRows:A,rowsById:k,toggleGroupBy:I,setGroupBy:O})}function De(e){e.allCells.forEach((function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&(null==(n=e.subRows)?void 0:n.length)}))}function Ne(e,t){return e.reduce((function(e,n,r){var o=""+n.values[t];return e[o]=Array.isArray(e[o])?e[o]:[],e[o].push(n),e}),{})}var Le=/([0-9]+)/gm;function Ve(e,t){return e===t?0:e>t?1:-1}function Xe(e,t,n){return[e.values[n],t.values[n]]}function qe(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}var Ue=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=Xe(e,t,n),o=r[0],i=r[1];for(o=qe(o),i=qe(i),o=o.split(Le).filter(Boolean),i=i.split(Le).filter(Boolean);o.length&&i.length;){var u=o.shift(),s=i.shift(),a=parseInt(u,10),l=parseInt(s,10),c=[a,l].sort();if(isNaN(c[0])){if(u>s)return 1;if(s>u)return-1}else{if(isNaN(c[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}}return o.length-i.length},datetime:function(e,t,n){var r=Xe(e,t,n),o=r[0],i=r[1];return Ve(o=o.getTime(),i=i.getTime())},basic:function(e,t,n){var r=Xe(e,t,n);return Ve(r[0],r[1])},string:function(e,t,n){var r=Xe(e,t,n),o=r[0],i=r[1];for(o=o.split("").filter(Boolean),i=i.split("").filter(Boolean);o.length&&i.length;){var u=o.shift(),s=i.shift(),a=u.toLowerCase(),l=s.toLowerCase();if(a>l)return 1;if(l>a)return-1;if(u>s)return 1;if(s>u)return-1}return o.length-i.length},number:function(e,t,n){var r=Xe(e,t,n),o=r[0],i=r[1],u=/[^0-9.]/gi;return Ve(o=Number(String(o).replace(u,"")),i=Number(String(i).replace(u,"")))}});s.resetSortBy="resetSortBy",s.setSortBy="setSortBy",s.toggleSortBy="toggleSortBy",s.clearSortBy="clearSortBy",c.sortType="alphanumeric",c.sortDescFirst=!1;var Ke=function(e){e.getSortByToggleProps=[$e],e.stateReducers.push(Je),e.useInstance.push(Ye)};Ke.pluginName="useSortBy";var $e=function(e,t){var n=t.instance,r=t.column,o=n.isMultiSortEvent,i=void 0===o?function(e){return e.shiftKey}:o;return[e,{onClick:r.canSort?function(e){e.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&i(e))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function Je(e,t,n,r){if(t.type===s.init)return o({sortBy:[]},e);if(t.type===s.resetSortBy)return o({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===s.clearSortBy)return o({},e,{sortBy:e.sortBy.filter((function(e){return e.id!==t.columnId}))});if(t.type===s.setSortBy)return o({},e,{sortBy:t.sortBy});if(t.type===s.toggleSortBy){var i,u=t.columnId,a=t.desc,l=t.multi,c=r.allColumns,d=r.disableMultiSort,f=r.disableSortRemove,p=r.disableMultiRemove,g=r.maxMultiSortColCount,v=void 0===g?Number.MAX_SAFE_INTEGER:g,m=e.sortBy,h=c.find((function(e){return e.id===u})).sortDescFirst,y=m.find((function(e){return e.id===u})),w=m.findIndex((function(e){return e.id===u})),b=null!=a,R=[];return"toggle"!=(i=!d&&l?y?"toggle":"add":w!==m.length-1||1!==m.length?"replace":y?"toggle":"replace")||f||b||l&&p||!(y&&y.desc&&!h||!y.desc&&h)||(i="remove"),"replace"===i?R=[{id:u,desc:b?a:h}]:"add"===i?(R=[].concat(m,[{id:u,desc:b?a:h}])).splice(0,R.length-v):"toggle"===i?R=m.map((function(e){return e.id===u?o({},e,{desc:b?a:!y.desc}):e})):"remove"===i&&(R=m.filter((function(e){return e.id!==u}))),o({},e,{sortBy:R})}}function Ye(e){var n=e.data,r=e.rows,o=e.flatRows,i=e.allColumns,u=e.orderByFn,a=void 0===u?Qe:u,l=e.sortTypes,c=e.manualSortBy,d=e.defaultCanSort,p=e.disableSortBy,g=e.flatHeaders,m=e.state.sortBy,y=e.dispatch,b=e.plugins,R=e.getHooks,S=e.autoResetSortBy,x=void 0===S||S;v(b,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var C=t.useCallback((function(e){y({type:s.setSortBy,sortBy:e})}),[y]),P=t.useCallback((function(e,t,n){y({type:s.toggleSortBy,columnId:e,desc:t,multi:n})}),[y]),E=h(e);g.forEach((function(e){var t=e.accessor,n=e.canSort,r=e.disableSortBy,o=e.id,i=t?B(!0!==r&&void 0,!0!==p&&void 0,!0):B(d,n,!1);e.canSort=i,e.canSort&&(e.toggleSortBy=function(t,n){return P(e.id,t,n)},e.clearSortBy=function(){y({type:s.clearSortBy,columnId:e.id})}),e.getSortByToggleProps=f(R().getSortByToggleProps,{instance:E(),column:e});var u=m.find((function(e){return e.id===o}));e.isSorted=!!u,e.sortedIndex=m.findIndex((function(e){return e.id===o})),e.isSortedDesc=e.isSorted?u.desc:void 0}));var I=t.useMemo((function(){if(c||!m.length)return[r,o];var e=[],t=m.filter((function(e){return i.find((function(t){return t.id===e.id}))}));return[function n(r){var o=a(r,t.map((function(e){var t=i.find((function(t){return t.id===e.id}));if(!t)throw new Error("React-Table: Could not find a column with id: "+e.id+" while sorting");var n=t.sortType,r=O(n)||(l||{})[n]||Ue[n];if(!r)throw new Error("React-Table: Could not find a valid sortType of '"+n+"' for column '"+e.id+"'.");return function(t,n){return r(t,n,e.id,e.desc)}})),t.map((function(e){var t=i.find((function(t){return t.id===e.id}));return t&&t.sortInverted?e.desc:!e.desc})));return o.forEach((function(t){e.push(t),t.subRows&&0!==t.subRows.length&&(t.subRows=n(t.subRows))})),o}(r),e]}),[c,m,r,o,i,a,l]),F=I[0],j=I[1],G=h(x);w((function(){G()&&y({type:s.resetSortBy})}),[c?null:n]),Object.assign(e,{preSortedRows:r,preSortedFlatRows:o,sortedRows:F,sortedFlatRows:j,rows:F,flatRows:j,setSortBy:C,toggleSortBy:P})}function Qe(e,t,n){return[].concat(e).sort((function(e,r){for(var o=0;o<t.length;o+=1){var i=t[o],u=!1===n[o]||"desc"===n[o],s=i(e,r);if(0!==s)return u?-s:s}return n[0]?e.index-r.index:r.index-e.index}))}s.resetPage="resetPage",s.gotoPage="gotoPage",s.setPageSize="setPageSize";var Ze=function(e){e.stateReducers.push(et),e.useInstance.push(tt)};function et(e,t,n,r){if(t.type===s.init)return o({pageSize:10,pageIndex:0},e);if(t.type===s.resetPage)return o({},e,{pageIndex:r.initialState.pageIndex||0});if(t.type===s.gotoPage){var i=r.pageCount,u=r.page,a=m(t.pageIndex,e.pageIndex),l=!1;return a>e.pageIndex?l=-1===i?u.length>=e.pageSize:a<i:a<e.pageIndex&&(l=a>-1),l?o({},e,{pageIndex:a}):e}if(t.type===s.setPageSize){var c=t.pageSize,d=e.pageSize*e.pageIndex;return o({},e,{pageIndex:Math.floor(d/c),pageSize:c})}}function tt(e){var n=e.rows,r=e.autoResetPage,o=void 0===r||r,i=e.manualExpandedKey,u=void 0===i?"expanded":i,a=e.plugins,l=e.pageCount,c=e.paginateExpandedRows,d=void 0===c||c,f=e.expandSubRows,p=void 0===f||f,g=e.state,m=g.pageSize,y=g.pageIndex,b=g.expanded,R=g.globalFilter,S=g.filters,x=g.groupBy,C=g.sortBy,P=e.dispatch,E=e.data,I=e.manualPagination;v(a,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var B=h(o);w((function(){B()&&P({type:s.resetPage})}),[P,I?null:E,R,S,x,C]);var O=I?l:Math.ceil(n.length/m),F=t.useMemo((function(){return O>0?[].concat(new Array(O)).fill(null).map((function(e,t){return t})):[]}),[O]),G=t.useMemo((function(){var e;if(I)e=n;else{var t=m*y,r=t+m;e=n.slice(t,r)}return d?e:j(e,{manualExpandedKey:u,expanded:b,expandSubRows:p})}),[p,b,u,I,y,m,d,n]),A=y>0,k=-1===O?G.length>=m:y<O-1,H=t.useCallback((function(e){P({type:s.gotoPage,pageIndex:e})}),[P]),T=t.useCallback((function(){return H((function(e){return e-1}))}),[H]),M=t.useCallback((function(){return H((function(e){return e+1}))}),[H]),z=t.useCallback((function(e){P({type:s.setPageSize,pageSize:e})}),[P]);Object.assign(e,{pageOptions:F,pageCount:O,page:G,canPreviousPage:A,canNextPage:k,gotoPage:H,previousPage:T,nextPage:M,setPageSize:z})}Ze.pluginName="usePagination",s.resetPivot="resetPivot",s.togglePivot="togglePivot";var nt=function(e){e.getPivotToggleProps=[ot],e.stateReducers.push(it),e.useInstanceAfterData.push(ut),e.allColumns.push(st),e.accessValue.push(at),e.materializedColumns.push(lt),e.materializedColumnsDeps.push(ct),e.visibleColumns.push(dt),e.visibleColumnsDeps.push(ft),e.useInstance.push(pt),e.prepareRow.push(gt)};nt.pluginName="usePivotColumns";var rt=[],ot=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(e){e.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function it(e,t,n,r){if(t.type===s.init)return o({pivotColumns:rt},e);if(t.type===s.resetPivot)return o({},e,{pivotColumns:r.initialState.pivotColumns||rt});if(t.type===s.togglePivot){var i=t.columnId,u=t.value,a=void 0!==u?u:!e.pivotColumns.includes(i);return o({},e,a?{pivotColumns:[].concat(e.pivotColumns,[i])}:{pivotColumns:e.pivotColumns.filter((function(e){return e!==i}))})}}function ut(e){e.allColumns.forEach((function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)}))}function st(e,t){var n=t.instance;return e.forEach((function(e){e.isPivotSource=n.state.pivotColumns.includes(e.id),e.uniqueValues=new Set})),e}function at(e,t){var n=t.column;return n.uniqueValues&&void 0!==e&&n.uniqueValues.add(e),e}function lt(e,t){var n=t.instance,r=n.allColumns,i=n.state;if(!i.pivotColumns.length||!i.groupBy||!i.groupBy.length)return e;var u=i.pivotColumns.map((function(e){return r.find((function(t){return t.id===e}))})).filter(Boolean),s=r.filter((function(e){return!e.isPivotSource&&!i.groupBy.includes(e.id)&&!i.pivotColumns.includes(e.id)})),a=x(function e(t,n,r){void 0===t&&(t=0),void 0===r&&(r=[]);var i=u[t];return i?Array.from(i.uniqueValues).sort().map((function(u){var s=o({},i,{Header:i.PivotHeader||"string"==typeof i.header?i.Header+": "+u:u,isPivotGroup:!0,parent:n,depth:t,id:n?n.id+"."+i.id+"."+u:i.id+"."+u,pivotValue:u});return s.columns=e(t+1,s,[].concat(r,[function(e){return e.values[i.id]===u}])),s})):s.map((function(e){return o({},e,{canPivot:!1,isPivoted:!0,parent:n,depth:t,id:""+(n?n.id+"."+e.id:e.id),accessor:function(t,n,o){if(r.every((function(e){return e(o)})))return o.values[e.id]}})}))}());return[].concat(e,a)}function ct(e,t){var n=t.instance.state,r=n.pivotColumns,o=n.groupBy;return[].concat(e,[r,o])}function dt(e,t){var n=t.instance.state;return e=e.filter((function(e){return!e.isPivotSource})),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter((function(e){return e.isGrouped||e.isPivoted}))),e}function ft(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function pt(e){var t=e.columns,n=e.allColumns,r=e.flatHeaders,o=e.getHooks,i=e.plugins,u=e.dispatch,a=e.autoResetPivot,l=void 0===a||a,c=e.manaulPivot,d=e.disablePivot,p=e.defaultCanPivot;v(i,["useGroupBy"],"usePivotColumns");var g=h(e);n.forEach((function(t){var n=t.accessor,r=t.defaultPivot,o=t.disablePivot;t.canPivot=n?B(t.canPivot,!0!==o&&void 0,!0!==d&&void 0,!0):B(t.canPivot,r,p,!1),t.canPivot&&(t.togglePivot=function(){return e.togglePivot(t.id)}),t.Aggregated=t.Aggregated||t.Cell})),r.forEach((function(e){e.getPivotToggleProps=f(o().getPivotToggleProps,{instance:g(),header:e})}));var m=h(l);w((function(){m()&&u({type:s.resetPivot})}),[u,c?null:t]),Object.assign(e,{togglePivot:function(e,t){u({type:s.togglePivot,columnId:e,value:t})}})}function gt(e){e.allCells.forEach((function(e){e.isPivoted=e.column.isPivoted}))}s.resetSelectedRows="resetSelectedRows",s.toggleAllRowsSelected="toggleAllRowsSelected",s.toggleRowSelected="toggleRowSelected",s.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var vt=function(e){e.getToggleRowSelectedProps=[mt],e.getToggleAllRowsSelectedProps=[ht],e.getToggleAllPageRowsSelectedProps=[yt],e.stateReducers.push(wt),e.useInstance.push(bt),e.prepareRow.push(Rt)};vt.pluginName="useRowSelect";var mt=function(e,t){var n=t.instance,r=t.row,o=n.manualRowSelectedKey,i=void 0===o?"isSelected":o;return[e,{onChange:function(e){r.toggleRowSelected(e.target.checked)},style:{cursor:"pointer"},checked:!(!r.original||!r.original[i])||r.isSelected,title:"Toggle Row Selected",indeterminate:r.isSomeSelected}]},ht=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:Boolean(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},yt=function(e,t){var n=t.instance;return[e,{onChange:function(e){n.toggleAllPageRowsSelected(e.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:Boolean(!n.isAllPageRowsSelected&&n.page.some((function(e){var t=e.id;return n.state.selectedRowIds[t]})))}]};function wt(e,t,n,r){if(t.type===s.init)return o({selectedRowIds:{}},e);if(t.type===s.resetSelectedRows)return o({},e,{selectedRowIds:r.initialState.selectedRowIds||{}});if(t.type===s.toggleAllRowsSelected){var i=t.value,u=r.isAllRowsSelected,a=r.rowsById,l=r.nonGroupedRowsById,c=void 0===l?a:l,d=void 0!==i?i:!u,f=Object.assign({},e.selectedRowIds);return d?Object.keys(c).forEach((function(e){f[e]=!0})):Object.keys(c).forEach((function(e){delete f[e]})),o({},e,{selectedRowIds:f})}if(t.type===s.toggleRowSelected){var p=t.id,g=t.value,v=r.rowsById,m=r.selectSubRows,h=void 0===m||m,y=r.getSubRows,w=e.selectedRowIds[p],b=void 0!==g?g:!w;if(w===b)return e;var R=o({},e.selectedRowIds);return function e(t){var n=v[t];if(n.isGrouped||(b?R[t]=!0:delete R[t]),h&&y(n))return y(n).forEach((function(t){return e(t.id)}))}(p),o({},e,{selectedRowIds:R})}if(t.type===s.toggleAllPageRowsSelected){var S=t.value,x=r.page,C=r.rowsById,P=r.selectSubRows,E=void 0===P||P,I=r.isAllPageRowsSelected,B=r.getSubRows,O=void 0!==S?S:!I,F=o({},e.selectedRowIds);return x.forEach((function(e){return function e(t){var n=C[t];if(n.isGrouped||(O?F[t]=!0:delete F[t]),E&&B(n))return B(n).forEach((function(t){return e(t.id)}))}(e.id)})),o({},e,{selectedRowIds:F})}return e}function bt(e){var n=e.data,r=e.rows,o=e.getHooks,i=e.plugins,u=e.rowsById,a=e.nonGroupedRowsById,l=void 0===a?u:a,c=e.autoResetSelectedRows,d=void 0===c||c,p=e.state.selectedRowIds,g=e.selectSubRows,m=void 0===g||g,y=e.dispatch,b=e.page,R=e.getSubRows;v(i,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var S=t.useMemo((function(){var e=[];return r.forEach((function(t){var n=m?function e(t,n,r){if(n[t.id])return!0;var o=r(t);if(o&&o.length){var i=!0,u=!1;return o.forEach((function(t){u&&!i||(e(t,n,r)?u=!0:i=!1)})),!!i||!!u&&null}return!1}(t,p,R):!!p[t.id];t.isSelected=!!n,t.isSomeSelected=null===n,n&&e.push(t)})),e}),[r,m,p,R]),x=Boolean(Object.keys(l).length&&Object.keys(p).length),C=x;x&&Object.keys(l).some((function(e){return!p[e]}))&&(x=!1),x||b&&b.length&&b.some((function(e){var t=e.id;return!p[t]}))&&(C=!1);var P=h(d);w((function(){P()&&y({type:s.resetSelectedRows})}),[y,n]);var E=t.useCallback((function(e){return y({type:s.toggleAllRowsSelected,value:e})}),[y]),I=t.useCallback((function(e){return y({type:s.toggleAllPageRowsSelected,value:e})}),[y]),B=t.useCallback((function(e,t){return y({type:s.toggleRowSelected,id:e,value:t})}),[y]),O=h(e),F=f(o().getToggleAllRowsSelectedProps,{instance:O()}),j=f(o().getToggleAllPageRowsSelectedProps,{instance:O()});Object.assign(e,{selectedFlatRows:S,isAllRowsSelected:x,isAllPageRowsSelected:C,toggleRowSelected:B,toggleAllRowsSelected:E,getToggleAllRowsSelectedProps:F,getToggleAllPageRowsSelectedProps:j,toggleAllPageRowsSelected:I})}function Rt(e,t){var n=t.instance;e.toggleRowSelected=function(t){return n.toggleRowSelected(e.id,t)},e.getToggleRowSelectedProps=f(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var St=function(e){return{}},xt=function(e){return{}};s.setRowState="setRowState",s.setCellState="setCellState",s.resetRowState="resetRowState";var Ct=function(e){e.stateReducers.push(Pt),e.useInstance.push(Et),e.prepareRow.push(It)};function Pt(e,t,n,r){var i=r.initialRowStateAccessor,u=void 0===i?St:i,a=r.initialCellStateAccessor,l=void 0===a?xt:a,c=r.rowsById;if(t.type===s.init)return o({rowState:{}},e);if(t.type===s.resetRowState)return o({},e,{rowState:r.initialState.rowState||{}});if(t.type===s.setRowState){var d,f=t.rowId,p=t.value,g=void 0!==e.rowState[f]?e.rowState[f]:u(c[f]);return o({},e,{rowState:o({},e.rowState,(d={},d[f]=m(p,g),d))})}if(t.type===s.setCellState){var v,h,y,w,b,R=t.rowId,S=t.columnId,x=t.value,C=void 0!==e.rowState[R]?e.rowState[R]:u(c[R]),P=void 0!==(null==C||null==(v=C.cellState)?void 0:v[S])?C.cellState[S]:l(null==(h=c[R])||null==(y=h.cells)?void 0:y.find((function(e){return e.column.id===S})));return o({},e,{rowState:o({},e.rowState,(b={},b[R]=o({},C,{cellState:o({},C.cellState||{},(w={},w[S]=m(x,P),w))}),b))})}}function Et(e){var n=e.autoResetRowState,r=void 0===n||n,o=e.data,i=e.dispatch,u=t.useCallback((function(e,t){return i({type:s.setRowState,rowId:e,value:t})}),[i]),a=t.useCallback((function(e,t,n){return i({type:s.setCellState,rowId:e,columnId:t,value:n})}),[i]),l=h(r);w((function(){l()&&i({type:s.resetRowState})}),[o]),Object.assign(e,{setRowState:u,setCellState:a})}function It(e,t){var n=t.instance,r=n.initialRowStateAccessor,o=void 0===r?St:r,i=n.initialCellStateAccessor,u=void 0===i?xt:i,s=n.state.rowState;e&&(e.state=void 0!==s[e.id]?s[e.id]:o(e),e.setState=function(t){return n.setRowState(e.id,t)},e.cells.forEach((function(t){e.state.cellState||(e.state.cellState={}),t.state=void 0!==e.state.cellState[t.column.id]?e.state.cellState[t.column.id]:u(t),t.setState=function(r){return n.setCellState(e.id,t.column.id,r)}})))}Ct.pluginName="useRowState",s.resetColumnOrder="resetColumnOrder",s.setColumnOrder="setColumnOrder";var Bt=function(e){e.stateReducers.push(Ot),e.visibleColumnsDeps.push((function(e,t){var n=t.instance;return[].concat(e,[n.state.columnOrder])})),e.visibleColumns.push(Ft),e.useInstance.push(jt)};function Ot(e,t,n,r){return t.type===s.init?o({columnOrder:[]},e):t.type===s.resetColumnOrder?o({},e,{columnOrder:r.initialState.columnOrder||[]}):t.type===s.setColumnOrder?o({},e,{columnOrder:m(t.columnOrder,e.columnOrder)}):void 0}function Ft(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var r=[].concat(n),o=[].concat(e),i=[],u=function(){var e=r.shift(),t=o.findIndex((function(t){return t.id===e}));t>-1&&i.push(o.splice(t,1)[0])};o.length&&r.length;)u();return[].concat(i,o)}function jt(e){var n=e.dispatch;e.setColumnOrder=t.useCallback((function(e){return n({type:s.setColumnOrder,columnOrder:e})}),[n])}Bt.pluginName="useColumnOrder",c.canResize=!0,s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize";var Gt=function(e){e.getResizerProps=[At],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(kt),e.useInstance.push(Tt),e.useInstanceBeforeDimensions.push(Ht)},At=function(e,t){var n=t.instance,r=t.header,o=n.dispatch,i=function(e,t){var n=!1;if("touchstart"===e.type){if(e.touches&&e.touches.length>1)return;n=!0}var r=function(e){var t=[];return function e(n){n.columns&&n.columns.length&&n.columns.map(e),t.push(n)}(e),t}(t).map((function(e){return[e.id,e.totalWidth]})),i=n?Math.round(e.touches[0].clientX):e.clientX,u=function(e){o({type:s.columnResizing,clientX:e})},a=function(){return o({type:s.columnDoneResizing})},l={mouse:{moveEvent:"mousemove",moveHandler:function(e){return u(e.clientX)},upEvent:"mouseup",upHandler:function(e){document.removeEventListener("mousemove",l.mouse.moveHandler),document.removeEventListener("mouseup",l.mouse.upHandler),a()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),u(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(e){document.removeEventListener(l.touch.moveEvent,l.touch.moveHandler),document.removeEventListener(l.touch.upEvent,l.touch.moveHandler),a()}}},c=n?l.touch:l.mouse,d=!!function(){if("boolean"==typeof H)return H;var e=!1;try{var t={get passive(){return e=!0,!1}};window.addEventListener("test",null,t),window.removeEventListener("test",null,t)}catch(t){e=!1}return H=e}()&&{passive:!1};document.addEventListener(c.moveEvent,c.moveHandler,d),document.addEventListener(c.upEvent,c.upHandler,d),o({type:s.columnStartResizing,columnId:t.id,columnWidth:t.totalWidth,headerIdWidths:r,clientX:i})};return[e,{onMouseDown:function(e){return e.persist()||i(e,r)},onTouchStart:function(e){return e.persist()||i(e,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function kt(e,t){if(t.type===s.init)return o({columnResizing:{columnWidths:{}}},e);if(t.type===s.resetResize)return o({},e,{columnResizing:{columnWidths:{}}});if(t.type===s.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,u=t.headerIdWidths;return o({},e,{columnResizing:o({},e.columnResizing,{startX:n,headerIdWidths:u,columnWidth:i,isResizingColumn:r})})}if(t.type===s.columnResizing){var a=t.clientX,l=e.columnResizing,c=l.startX,d=l.columnWidth,f=l.headerIdWidths,p=(a-c)/d,g={};return(void 0===f?[]:f).forEach((function(e){var t=e[0],n=e[1];g[t]=Math.max(n+n*p,0)})),o({},e,{columnResizing:o({},e.columnResizing,{columnWidths:o({},e.columnResizing.columnWidths,{},g)})})}return t.type===s.columnDoneResizing?o({},e,{columnResizing:o({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}Gt.pluginName="useResizeColumns";var Ht=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,o=e.state.columnResizing,i=h(e);t.forEach((function(e){var t=B(!0!==e.disableResizing&&void 0,!0!==n&&void 0,!0);e.canResize=t,e.width=o.columnWidths[e.id]||e.originalWidth||e.width,e.isResizing=o.isResizingColumn===e.id,t&&(e.getResizerProps=f(r().getResizerProps,{instance:i(),header:e}))}))};function Tt(e){var n=e.plugins,r=e.dispatch,o=e.autoResetResize,i=void 0===o||o,u=e.columns;v(n,["useAbsoluteLayout"],"useResizeColumns");var a=h(i);w((function(){a()&&r({type:s.resetResize})}),[u]);var l=t.useCallback((function(){return r({type:s.resetResize})}),[r]);Object.assign(e,{resetResizing:l})}var Mt={position:"absolute",top:0},zt=function(e){e.getTableBodyProps.push(Wt),e.getRowProps.push(Wt),e.getHeaderGroupProps.push(Wt),e.getFooterGroupProps.push(Wt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:o({},Mt,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:o({},Mt,{left:n.column.totalLeft+"px",width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:o({},Mt,{left:n.totalLeft+"px",width:n.totalWidth+"px"})}]}))};zt.pluginName="useAbsoluteLayout";var Wt=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},_t={display:"inline-block",boxSizing:"border-box"},Dt=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Nt=function(e){e.getRowProps.push(Dt),e.getHeaderGroupProps.push(Dt),e.getFooterGroupProps.push(Dt),e.getHeaderProps.push((function(e,t){var n=t.column;return[e,{style:o({},_t,{width:n.totalWidth+"px"})}]})),e.getCellProps.push((function(e,t){var n=t.cell;return[e,{style:o({},_t,{width:n.column.totalWidth+"px"})}]})),e.getFooterProps.push((function(e,t){var n=t.column;return[e,{style:o({},_t,{width:n.totalWidth+"px"})}]}))};function Lt(e){e.getTableProps.push(Vt),e.getRowProps.push(Xt),e.getHeaderGroupProps.push(Xt),e.getFooterGroupProps.push(Xt),e.getHeaderProps.push(qt),e.getCellProps.push(Ut),e.getFooterProps.push(Kt)}Nt.pluginName="useBlockLayout",Lt.pluginName="useFlexLayout";var Vt=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Xt=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},qt=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},Ut=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},Kt=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function $t(e){e.stateReducers.push(Qt),e.getTableProps.push(Jt),e.getHeaderProps.push(Yt)}$t.pluginName="useGridLayout";var Jt=function(e,t){return[e,{style:{display:"grid",gridTemplateColumns:t.instance.state.gridLayout.columnWidths.map((function(e){return e})).join(" ")}}]},Yt=function(e,t){return[e,{id:"header-cell-"+t.column.id,style:{position:"sticky"}}]};function Qt(e,t,n,r){if("init"===t.type)return o({gridLayout:{columnWidths:r.columns.map((function(){return"auto"}))}},e);if("columnStartResizing"===t.type){var i=t.columnId,u=r.visibleColumns.findIndex((function(e){return e.id===i})),s=function(e){var t,n=null==(t=document.getElementById("header-cell-"+e))?void 0:t.offsetWidth;if(void 0!==n)return n}(i);return void 0!==s?o({},e,{gridLayout:o({},e.gridLayout,{columnId:i,columnIndex:u,startingWidth:s})}):e}if("columnResizing"===t.type){var a=e.gridLayout,l=a.columnIndex,c=a.startingWidth,d=a.columnWidths,f=c-(e.columnResizing.startX-t.clientX),p=[].concat(d);return p[l]=f+"px",o({},e,{gridLayout:o({},e.gridLayout,{columnWidths:p})})}}e._UNSTABLE_usePivotColumns=nt,e.actions=s,e.defaultColumn=c,e.defaultGroupByFn=Ne,e.defaultOrderByFn=Qe,e.defaultRenderer=a,e.emptyRenderer=l,e.ensurePluginOrder=v,e.flexRender=R,e.functionalUpdate=m,e.loopHooks=g,e.makePropGetter=f,e.makeRenderer=b,e.reduceHooks=p,e.safeUseLayoutEffect=y,e.useAbsoluteLayout=zt,e.useAsyncDebounce=function(e,n){void 0===n&&(n=0);var o=t.useRef({}),i=h(e),u=h(n);return t.useCallback(function(){var e=r(regeneratorRuntime.mark((function e(){var t,n,s,a=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=a.length,n=new Array(t),s=0;s<t;s++)n[s]=a[s];return o.current.promise||(o.current.promise=new Promise((function(e,t){o.current.resolve=e,o.current.reject=t}))),o.current.timeout&&clearTimeout(o.current.timeout),o.current.timeout=setTimeout(r(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete o.current.timeout,e.prev=1,e.t0=o.current,e.next=5,i().apply(void 0,n);case 5:e.t1=e.sent,e.t0.resolve.call(e.t0,e.t1),e.next=12;break;case 9:e.prev=9,e.t2=e.catch(1),o.current.reject(e.t2);case 12:return e.prev=12,delete o.current.promise,e.finish(12);case 15:case"end":return e.stop()}}),e,null,[[1,9,12,15]])}))),u()),e.abrupt("return",o.current.promise);case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),[i,u])},e.useBlockLayout=Nt,e.useColumnOrder=Bt,e.useExpanded=ae,e.useFilters=Pe,e.useFlexLayout=Lt,e.useGetLatest=h,e.useGlobalFilter=Be,e.useGridLayout=$t,e.useGroupBy=He,e.useMountedLayoutEffect=w,e.usePagination=Ze,e.useResizeColumns=Gt,e.useRowSelect=vt,e.useRowState=Ct,e.useSortBy=Ke,e.useTable=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e=ie(e),r=[U].concat(r);var u=t.useRef({}),a=h(u.current);Object.assign(a(),o({},e,{plugins:r,hooks:q()})),r.filter(Boolean).forEach((function(e){e(a().hooks)}));var l=h(a().hooks);a().getHooks=l,delete a().hooks,Object.assign(a(),p(l().useOptions,ie(e)));var c=a(),d=c.data,v=c.columns,m=c.initialState,y=c.defaultColumn,w=c.getSubRows,R=c.getRowId,I=c.stateReducer,B=c.useControlledState,O=h(I),F=t.useCallback((function(e,t){if(!t.type)throw console.info({action:t}),new Error("Unknown Action 👆");return[].concat(l().stateReducers,Array.isArray(O())?O():[O()]).reduce((function(n,r){return r(n,t,e,a())||n}),e)}),[l,O,a]),j=t.useReducer(F,void 0,(function(){return F(m,{type:s.init})})),G=j[0],A=j[1],k=p([].concat(l().useControlledState,[B]),G,{instance:a()});Object.assign(a(),{state:k,dispatch:A});var H=t.useMemo((function(){return S(p(l().columns,v,{instance:a()}))}),[l,a,v].concat(p(l().columnsDeps,[],{instance:a()})));a().columns=H;var T=t.useMemo((function(){return p(l().allColumns,x(H),{instance:a()}).map(C)}),[H,l,a].concat(p(l().allColumnsDeps,[],{instance:a()})));a().allColumns=T;var M=t.useMemo((function(){for(var e=[],t=[],n={},r=[].concat(T);r.length;){var o=r.shift();se({data:d,rows:e,flatRows:t,rowsById:n,column:o,getRowId:R,getSubRows:w,accessValueHooks:l().accessValue,getInstance:a})}return[e,t,n]}),[T,d,R,w,l,a]),z=M[0],W=M[1],_=M[2];Object.assign(a(),{rows:z,initialRows:[].concat(z),flatRows:W,rowsById:_}),g(l().useInstanceAfterData,a());var D=t.useMemo((function(){return p(l().visibleColumns,T,{instance:a()}).map((function(e){return P(e,y)}))}),[l,T,a,y].concat(p(l().visibleColumnsDeps,[],{instance:a()})));T=t.useMemo((function(){var e=[].concat(D);return T.forEach((function(t){e.find((function(e){return e.id===t.id}))||e.push(t)})),e}),[T,D]),a().allColumns=T;var N=t.useMemo((function(){return p(l().headerGroups,E(D,y),a())}),[l,D,y,a].concat(p(l().headerGroupsDeps,[],{instance:a()})));a().headerGroups=N;var L=t.useMemo((function(){return N.length?N[0].headers:[]}),[N]);a().headers=L,a().flatHeaders=N.reduce((function(e,t){return[].concat(e,t.headers)}),[]),g(l().useInstanceBeforeDimensions,a());var V=D.filter((function(e){return e.isVisible})).map((function(e){return e.id})).sort().join("_");D=t.useMemo((function(){return D.filter((function(e){return e.isVisible}))}),[D,V]),a().visibleColumns=D;var X=ue(L),K=X[0],$=X[1],J=X[2];return a().totalColumnsMinWidth=K,a().totalColumnsWidth=$,a().totalColumnsMaxWidth=J,g(l().useInstance,a()),[].concat(a().flatHeaders,a().allColumns).forEach((function(e){e.render=b(a(),e),e.getHeaderProps=f(l().getHeaderProps,{instance:a(),column:e}),e.getFooterProps=f(l().getFooterProps,{instance:a(),column:e})})),a().headerGroups=t.useMemo((function(){return N.filter((function(e,t){return e.headers=e.headers.filter((function(e){return e.headers?function e(t){return t.filter((function(t){return t.headers?e(t.headers):t.isVisible})).length}(e.headers):e.isVisible})),!!e.headers.length&&(e.getHeaderGroupProps=f(l().getHeaderGroupProps,{instance:a(),headerGroup:e,index:t}),e.getFooterGroupProps=f(l().getFooterGroupProps,{instance:a(),headerGroup:e,index:t}),!0)}))}),[N,a,l]),a().footerGroups=[].concat(a().headerGroups).reverse(),a().prepareRow=t.useCallback((function(e){e.getRowProps=f(l().getRowProps,{instance:a(),row:e}),e.allCells=T.map((function(t){var n=e.values[t.id],r={column:t,row:e,value:n};return r.getCellProps=f(l().getCellProps,{instance:a(),cell:r}),r.render=b(a(),t,{row:e,cell:r,value:n}),r})),e.cells=D.map((function(t){return e.allCells.find((function(e){return e.column.id===t.id}))})),g(l().prepareRow,e,{instance:a()})}),[l,a,T,D]),a().getTableProps=f(l().getTableProps,{instance:a()}),a().getTableBodyProps=f(l().getTableBodyProps,{instance:a()}),g(l().useFinalInstance,a()),a()},Object.defineProperty(e,"__esModule",{value:!0})}(t,n(4))},,,,,,,,,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=n(0),o=n(9),i=n.n(o),u=n(28),s=n(27),a=n(26),l=n(10);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}i.a.use(Object(s.a)(window.ninjaFormsViews.token)),Object(l.registerStore)("ninja-forms-views",a.a);var d,f=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(e,void 0):void 0}}(e))){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return u=e.done,e},e:function(e){s=!0,i=e},f:function(){try{u||null==n.return||n.return()}finally{if(s)throw i}}}}(document.getElementsByClassName("ninja-forms-views-submissions-table"));try{var p=function(){var e=d.value,t=JSON.parse(e.dataset.attributes),n=t.formID,o=t.selectedFields,i=Object(l.withSelect)((function(e){return{fields:e("ninja-forms-views").getFormFields(n),submissions:e("ninja-forms-views").getFormSubmissions(n)}}))((function(e){var t=e.fields,i=e.submissions;return t&&i?Object(r.createElement)(u.a,{formID:n,selectedFields:o,fields:Object.values(t),submissions:Object.values(i)}):"Loading again..."}));Object(r.render)(Object(r.createElement)(i,null),e)};for(f.s();!(d=f.n()).done;)p()}catch(e){f.e(e)}finally{f.f()}}]);