From 09c24a7d35fbd2d1ba7b719db498f6ee15eac931 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Sun, 21 Jul 2024 17:55:43 -0500 Subject: [PATCH] Rebuild --- inst/htmlwidgets/reactable.js | 2 +- inst/htmlwidgets/reactable.js.map | 2 +- inst/htmlwidgets/reactable.server.js | 2 +- inst/htmlwidgets/reactable.server.js.map | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inst/htmlwidgets/reactable.js b/inst/htmlwidgets/reactable.js index 6f2f03d5..492c9c86 100644 --- a/inst/htmlwidgets/reactable.js +++ b/inst/htmlwidgets/reactable.js @@ -1,2 +1,2 @@ -!function(){var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};!function(){"use strict";e.r(t),e.d(t,{ReactableData:function(){return fu},downloadDataCSV:function(){return eu},getDataCSV:function(){return tu},getInstance:function(){return Ui},getState:function(){return Ki},gotoPage:function(){return uu},onStateChange:function(){return iu},setAllFilters:function(){return Xi},setData:function(){return au},setFilter:function(){return Ji},setGroupBy:function(){return Yi},setHiddenColumns:function(){return ou},setMeta:function(){return ru},setPageSize:function(){return lu},setSearch:function(){return qi},toggleAllRowsExpanded:function(){return Qi},toggleGroupBy:function(){return Zi},toggleHideColumn:function(){return nu}});var r={};e.r(r),e.d(r,{between:function(){return ut},equals:function(){return it},exact:function(){return at},exactText:function(){return Qe},exactTextCase:function(){return et},includes:function(){return tt},includesAll:function(){return rt},includesSome:function(){return nt},includesValue:function(){return ot},text:function(){return Ye}});var n={};e.r(n),e.d(n,{average:function(){return At},count:function(){return Bt},max:function(){return Ct},median:function(){return It},min:function(){return Et},minMax:function(){return xt},sum:function(){return jt},unique:function(){return kt},uniqueCount:function(){return Nt}});var o={};e.r(o),e.d(o,{alphanumeric:function(){return zt},basic:function(){return Tt},datetime:function(){return Mt},number:function(){return Ht},string:function(){return Wt}});var a=window.React,i=e.n(a),u=window.ReactDOM,l=e.n(u);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(t.children);try{for(o.s();!(r=o.n()).done;){var a=r.value;n.push(s(e,a))}}catch(e){o.e(e)}finally{o.f()}return i().createElement.apply(i(),n)}var f=["style","className"];function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e){return function(e){if(Array.isArray(e))return g(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return g(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?g(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var v="Renderer Error ☝️",w={init:"init"},S=function(){return i().createElement(i().Fragment,null," ")},O={Cell:function(e){var t=e.value;return void 0===t?"":t},width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function R(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[].concat(p(e),[r]).reduce((function(e,n){return P(e,n,m(m({},t),{},{userProps:r}))}),{})}},E=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce((function(e,t){return t(e,r)}),t)},C=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.forEach((function(e){e(t,r)}))};function x(e,t,r,n){e.findIndex((function(e){return e.pluginName===r})),t.forEach((function(t){e.findIndex((function(e){return e.pluginName===t}))}))}function A(e,t){return"function"==typeof e?e(t):e}function I(e){var t=i().useRef();return t.current=e,i().useCallback((function(){return t.current}),[])}var k="undefined"!=typeof document?i().useLayoutEffect:i().useEffect;function N(e,t){var r=i().useRef(!1);k((function(){r.current&&e(),r.current=!0}),t)}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a="string"==typeof n?t[n]:n;if(void 0===a)throw console.info(t),new Error(v);return F(a,m(m(m({},e),{},{column:t},r),o))}}function F(e,t){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"===d(e)&&"symbol"===d(e.$$typeof)&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?i().createElement(e,t):e;var r}function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0;return e.map((function(e){return W(e=G(G({},e),{},{parent:t,depth:r})),e.columns&&(e.columns=M(e.columns,e,r+1)),e}))}function T(e){return t="columns",r=[],function e(n){n.forEach((function(n){n[t]?e(n[t]):r.push(n)}))}(e),r;var t,r}function W(e){var t=e.id,r=e.accessor,n=e.Header;if("string"==typeof r){t=t||r;var o=r.split(".");r=function(e){return function(e,t,r){if(!t)return e;var n,o="function"==typeof t?t:JSON.stringify(t),a=L.get(o)||function(){var e=function(e){return Y(e).map((function(e){return String(e).replace(".","_")})).join(".").replace(q,".").replace(Z,"").split(".")}(t);return L.set(o,e),e}();try{n=a.reduce((function(e,t){return e[t]}),e)}catch(e){}return void 0!==n?n:void 0}(e,o)}}if(!t&&"string"==typeof n&&n&&(t=n),!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:r}),e}function H(e,t){if(!t)throw new Error;return Object.assign(e,G(G(G({Header:S,Footer:S},O),t),e)),Object.assign(e,{originalWidth:e.width}),e}function _(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return{}},n=[],o=e,a=0,i=function(){return a++},u=function(){var e={headers:[]},a=[],u=o.some((function(e){return e.parent}));o.forEach((function(n){var o,l=[].concat(a).reverse()[0];u&&(o=n.parent?G(G({},n.parent),{},{originalId:n.parent.id,id:"".concat(n.parent.id,"_").concat(i()),headers:[n]},r(n)):H(G({originalId:"".concat(n.id,"_placeholder"),id:"".concat(n.id,"_placeholder_").concat(i()),placeholderOf:n,headers:[n]},r(n)),t),l&&l.originalId===o.originalId?l.headers.push(n):a.push(o)),e.headers.push(n)})),n.push(e),o=a};o.length;)u();return n.reverse()}var L=new Map;function V(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1])||arguments[1];t.isExpanded=t.original&&t.original[r]||n[t.id],t.canExpand=t.subRows&&!!t.subRows.length,o&&i.push(t),t.subRows&&t.subRows.length&&t.isExpanded&&t.subRows.forEach((function(t){return e(t,a)}))};return e.forEach((function(e){return u(e)})),i}function K(e,t,r){return $(e)||t[e]||r[e]||r.text}function J(e,t,r){return e?e(t,r):void 0===t}function X(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var q=/\[/g,Z=/\]/g;function Y(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e))for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Oe)),{},{initialState:r,defaultColumn:o,getSubRows:i,getRowId:l,stateReducer:s,useControlledState:d})}var ze=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:0,r=0,n=0,o=0,a=0;return e.forEach((function(e){var i=e.headers;if(e.totalLeft=t,i&&i.length){var u=Re(Me(i,t),4),l=u[0],c=u[1],s=u[2],f=u[3];e.totalMinWidth=l,e.totalWidth=c,e.totalMaxWidth=s,e.totalFlexWidth=f}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,r+=e.totalMinWidth,n+=e.totalWidth,o+=e.totalMaxWidth,a+=e.totalFlexWidth)})),[r,n,o,a]}function Te(e){var t=e.data,r=e.rows,n=e.flatRows,o=e.rowsById,a=e.column,i=e.getRowId,u=e.getSubRows,l=e.accessValueHooks,c=e.getInstance,s=function e(r,s){var f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,g=r,y=i(r,s,d),m=o[y];if(m)m.subRows&&m.originalSubRows.forEach((function(t,r){return e(t,r,f+1,m)}));else if((m={id:y,original:g,index:s,depth:f,cells:[{}]}).cells.map=X,m.cells.filter=X,m.cells.forEach=X,m.cells[0].getCellProps=X,m.values={},p.push(m),n.push(m),o[y]=m,m.originalSubRows=u(r,s),m.originalSubRows){var h=[];m.originalSubRows.forEach((function(t,r){return e(t,r,f+1,m,h)})),m.subRows=h}a.accessor&&(m.values[a.id]=a.accessor(r,s,m,p,t)),m.values[a.id]=E(l,m.values[a.id],{row:m,column:a,instance:c()},!0)};t.forEach((function(e,t){return s(e,t,0,void 0,r)}))}function We(e){return We="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(e)}function He(e){var t=function(e,t){if("object"!==We(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!==We(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===We(t)?t:String(t)}function _e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(d,[l].map(He)));return Le(Le({},e),{},{expanded:p})}return e}}function Xe(e){var t=e.data,r=e.rows,n=e.rowsById,o=e.manualExpandedKey,a=void 0===o?"expanded":o,u=e.paginateExpandedRows,l=void 0===u||u,c=e.expandSubRows,s=void 0===c||c,f=e.autoResetExpanded,d=void 0===f||f,p=e.getHooks,g=e.plugins,y=e.state.expanded,m=e.dispatch;x(g,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var h=I(d),b=Boolean(Object.keys(n).length&&Object.keys(y).length);b&&Object.keys(n).some((function(e){return!y[e]}))&&(b=!1),N((function(){h()&&m({type:w.resetExpanded})}),[m,t]);var v=i().useCallback((function(e,t){m({type:w.toggleRowExpanded,id:e,value:t})}),[m]),S=i().useCallback((function(e){return m({type:w.toggleAllRowsExpanded,value:e})}),[m]),O=i().useMemo((function(){return l?U(r,{manualExpandedKey:a,expanded:y,expandSubRows:s}):r}),[l,r,a,y,s]),R=i().useMemo((function(){return function(e){var t=0;return Object.keys(e).forEach((function(e){var r=e.split(".");t=Math.max(t,r.length)})),t}(y)}),[y]),P=I(e),E=j(p().getToggleAllRowsExpandedProps,{instance:P()});Object.assign(e,{preExpandedRows:r,expandedRows:O,rows:O,expandedDepth:R,isAllRowsExpanded:b,toggleRowExpanded:v,toggleAllRowsExpanded:S,getToggleAllRowsExpandedProps:E})}function qe(e,t){var r=t.instance.getHooks,n=t.instance;e.toggleRowExpanded=function(t){return n.toggleRowExpanded(e.id,t)},e.getToggleRowExpandedProps=j(r().getToggleRowExpandedProps,{instance:n,row:e})}function Ze(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r(a="number"==typeof a?a:1/0)){var i=o;o=a,a=i}return e.filter((function(e){return t.some((function(t){var r=e.values[t];return r>=o&&r<=a}))}))};function lt(e,t){if(e){if("string"==typeof e)return ct(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ct(e,t):void 0}}function ct(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,i=o;return i=p.reduce((function(e,t){var n=t.id,o=t.value,i=u.find((function(e){return e.id===n}));if(!i)return e;0===a&&(i.preFilteredRows=e);var c=K(i.filter,l||{},r);return c?(i.filteredRows=c(e,[n],o),i.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: ".concat(i.id,".")),e)}),o),i.forEach((function(r){e.push(r),t[r.id]=r,r.subRows&&(r.subRows=r.subRows&&r.subRows.length>0?n(r.subRows,a+1):r.subRows)})),i}(n),e,t]}),[c,p,n,o,a,u,l]),S=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||lt(e,t)||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.")}()}(v,3),O=S[0],R=S[1],P=S[2];i().useMemo((function(){var e=u.filter((function(e){return!p.find((function(t){return t.id===e.id}))}));e.forEach((function(e){e.preFilteredRows=O,e.filteredRows=O}))}),[O,p,u]);var j=I(m);N((function(){j()&&g({type:w.resetFilters})}),[g,c?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:o,preFilteredRowsById:a,filteredRows:O,filteredFlatRows:R,filteredRowsById:P,rows:O,flatRows:R,rowsById:P,setFilter:h,setAllFilters:b})}pt.pluginName="useFilters";var mt=["globalFilter"];function ht(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,mt)):vt(vt({},e),{},{globalFilter:l})}}function Rt(e){var t=e.data,n=e.rows,o=e.flatRows,a=e.rowsById,u=e.allColumns,l=e.filterTypes,c=e.globalFilter,s=e.manualGlobalFilter,f=e.state.globalFilter,d=e.dispatch,p=e.autoResetGlobalFilter,g=void 0===p||p,y=e.disableGlobalFilter,m=i().useCallback((function(e){d({type:w.setGlobalFilter,filterValue:e})}),[d]),h=i().useMemo((function(){if(s||void 0===f)return[n,o,a];var e=[],t={},i=K(c,l||{},r);if(!i)return console.warn("Could not find a valid 'globalFilter' option."),n;u.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=V(!0!==t&&void 0,!0!==y&&void 0,!0)}));var d=u.filter((function(e){return!0===e.canFilter}));return[function r(n){return(n=i(n,d.map((function(e){return e.id})),f)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?r(n.subRows):n.subRows})),n}(n),e,t]}),[s,f,c,l,u,n,o,a,y]),b=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return ht(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ht(e,t):void 0}}(e,t)||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.")}()}(h,3),v=b[0],S=b[1],O=b[2],R=I(g);N((function(){R()&&d({type:w.resetGlobalFilter})}),[d,s?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:o,preGlobalFilteredRowsById:a,globalFilteredRows:v,globalFilteredFlatRows:S,globalFilteredRowsById:O,rows:v,flatRows:S,rowsById:O,setGlobalFilter:m,disableGlobalFilter:y})}function Pt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);ru)return 1;if(u>i)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return o.length-a.length};function Mt(e,t,r){var n=Ft(Lt(e,t,r),2),o=n[0],a=n[1];return _t(o=o.getTime(),a=a.getTime())}function Tt(e,t,r){var n=Ft(Lt(e,t,r),2);return _t(n[0],n[1])}function Wt(e,t,r){var n=Ft(Lt(e,t,r),2),o=n[0],a=n[1];for(o=o.split("").filter(Boolean),a=a.split("").filter(Boolean);o.length&&a.length;){var i=o.shift(),u=a.shift(),l=i.toLowerCase(),c=u.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(i>u)return 1;if(u>i)return-1}return o.length-a.length}function Ht(e,t,r){var n=Ft(Lt(e,t,r),2),o=n[0],a=n[1],i=/[^0-9.]/gi;return _t(o=Number(String(o).replace(i,"")),a=Number(String(a).replace(i,"")))}function _t(e,t){return e===t?0:e>t?1:-1}function Lt(e,t,r){return[e.values[r],t.values[r]]}function Vt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function $t(e){return function(e){if(Array.isArray(e))return Kt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ut(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(e,t){if(e){if("string"==typeof e)return Kt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Kt(e,t):void 0}}function Kt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?sr(wr,--br):0,mr--,10===vr&&(mr=1,yr--),vr}function Pr(){return vr=br2||xr(vr)>3?"":" "}function Br(e,t){for(;--t&&Pr()&&!(vr<48||vr>102||vr>57&&vr<65||vr>70&&vr<97););return Cr(e,Er()+(t<6&&32==jr()&&32==Pr()))}function Fr(e){for(;Pr();)switch(vr){case e:return br;case 34:case 39:34!==e&&39!==e&&Fr(vr);break;case 40:41===e&&Fr(e);break;case 92:Pr()}return br}function Dr(e,t){for(;Pr()&&e+vr!==57&&(e+vr!==84||47!==jr()););return"/*"+Cr(t,br-1)+"*"+ar(47===e?e:Pr())}function Gr(e){for(;!xr(jr());)Pr();return Cr(e,br)}var zr="-ms-",Mr="-moz-",Tr="-webkit-",Wr="comm",Hr="rule",_r="decl",Lr="@keyframes";function Vr(e,t){for(var r="",n=pr(e),o=0;o6)switch(sr(e,t+1)){case 109:if(45!==sr(e,t+4))break;case 102:return lr(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+Mr+(108==sr(e,t+3)?"$3":"$2-$3"))+e;case 115:return~cr(e,"stretch")?Ur(lr(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==sr(e,t+1))break;case 6444:switch(sr(e,dr(e)-3-(~cr(e,"!important")&&10))){case 107:return lr(e,":",":"+Tr)+e;case 101:return lr(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Tr+(45===sr(e,14)?"inline-":"")+"box$3$1"+Tr+"$2$3$1"+zr+"$2box$3")+e}break;case 5936:switch(sr(e,t+11)){case 114:return Tr+e+zr+lr(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Tr+e+zr+lr(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Tr+e+zr+lr(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Tr+e+zr+e+e}return e}function Kr(e){return Ir(Jr("",null,null,null,[""],e=Ar(e),0,[0],e))}function Jr(e,t,r,n,o,a,i,u,l){for(var c=0,s=0,f=i,d=0,p=0,g=0,y=1,m=1,h=1,b=0,v="",w=o,S=a,O=n,R=v;m;)switch(g=b,b=Pr()){case 40:if(108!=g&&58==R.charCodeAt(f-1)){-1!=cr(R+=lr(kr(b),"&","&\f"),"&\f")&&(h=-1);break}case 34:case 39:case 91:R+=kr(b);break;case 9:case 10:case 13:case 32:R+=Nr(g);break;case 92:R+=Br(Er()-1,7);continue;case 47:switch(jr()){case 42:case 47:gr(qr(Dr(Pr(),Er()),t,r),l);break;default:R+="/"}break;case 123*y:u[c++]=dr(R)*h;case 125*y:case 59:case 0:switch(b){case 0:case 125:m=0;case 59+s:p>0&&dr(R)-f&&gr(p>32?Zr(R+";",n,r,f-1):Zr(lr(R," ","")+";",n,r,f-2),l);break;case 59:R+=";";default:if(gr(O=Xr(R,t,r,c,s,o,u,v,w=[],S=[],f),a),123===b)if(0===s)Jr(R,t,O,O,w,a,f,u,S);else switch(d){case 100:case 109:case 115:Jr(e,O,O,n&&gr(Xr(e,O,O,0,0,o,u,v,o,w=[],f),S),o,S,f,u,n?w:S);break;default:Jr(R,O,O,O,[""],S,0,u,S)}}c=s=p=0,y=h=1,v=R="",f=i;break;case 58:f=1+dr(R),p=g;default:if(y<1)if(123==b)--y;else if(125==b&&0==y++&&125==Rr())continue;switch(R+=ar(b),b*y){case 38:h=s>0?1:(R+="\f",-1);break;case 44:u[c++]=(dr(R)-1)*h,h=1;break;case 64:45===jr()&&(R+=kr(Pr())),d=jr(),s=f=dr(v=R+=Gr(Er())),b++;break;case 45:45===g&&2==dr(R)&&(y=0)}}return a}function Xr(e,t,r,n,o,a,i,u,l,c,s){for(var f=o-1,d=0===o?a:[""],p=pr(d),g=0,y=0,m=0;g0?d[h]+" "+b:lr(b,/&\f/g,d[h])))&&(l[m++]=v);return Sr(e,t,r,0===o?Hr:u,l,c,s)}function qr(e,t,r){return Sr(e,t,r,Wr,ar(vr),fr(e,2,-2),0)}function Zr(e,t,r,n){return Sr(e,t,r,_r,fr(e,0,n),fr(e,n+1,-1),n)}var Yr=function(e,t,r){for(var n=0,o=0;n=o,o=jr(),38===n&&12===o&&(t[r]=1),!xr(o);)Pr();return Cr(e,br)},Qr=new WeakMap,en=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Qr.get(r))&&!n){Qr.set(e,!0);for(var o=[],a=function(e,t){return Ir(function(e,t){var r=-1,n=44;do{switch(xr(n)){case 0:38===n&&12===jr()&&(t[r]=1),e[r]+=Yr(br-1,t,r);break;case 2:e[r]+=kr(n);break;case 4:if(44===n){e[++r]=58===jr()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=ar(n)}}while(n=Pr());return e}(Ar(e),t))}(t,o),i=r.props,u=0,l=0;u-1&&!e.return)switch(e.type){case _r:e.return=Ur(e.value,e.length);break;case Lr:return Vr([Or(e,{value:lr(e.value,"@","@"+Tr)})],n);case Hr:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Vr([Or(e,{props:[lr(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Vr([Or(e,{props:[lr(t,/:(plac\w+)/,":-webkit-input-$1")]}),Or(e,{props:[lr(t,/:(plac\w+)/,":-moz-$1")]}),Or(e,{props:[lr(t,/:(plac\w+)/,zr+"input-$1")]})],n)}return""}))}}],nn=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},on={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},an=/[A-Z]|^ms/g,un=/_EMO_([^_]+?)_([^]*?)_EMO_/g,ln=function(e){return 45===e.charCodeAt(1)},cn=function(e){return null!=e&&"boolean"!=typeof e},sn=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=ln(r=e)?r:r.replace(an,"-$&").toLowerCase()),t[e];var r}}(),fn=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(un,(function(e,t,r){return pn={name:t,styles:r,next:pn},t}))}return 1===on[e]||ln(e)||"number"!=typeof t||0===t?t:t+"px"};function dn(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return pn={name:r.name,styles:r.styles,next:pn},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)pn={name:n.name,styles:n.styles,next:pn},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Pn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function jn(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function En(e){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},En(e)}function Cn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||xn(e,t)||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.")}()}function xn(e,t){if(e){if("string"==typeof e)return An(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?An(e,t):void 0}}function An(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=t.columnIds,n=t.headers,o=void 0===n||n,a=t.sep,i=void 0===a?",":a,u=t.dec,l=void 0===u?".":u,c=function(e){return e.map((function(e){return null==e&&(e=""),e instanceof Date?e=e.toISOString():"string"!=typeof e&&"number"!=typeof e?e=JSON.stringify(e):"."!==l&&"number"==typeof e&&(e=e.toString().replace(".",l)),"string"==typeof e&&(e.includes('"')||e.includes(i))&&(e='"'.concat(e.replace(/"/g,'""'),'"')),e})).join(i)},s=[];r||(r=e.length>0?Object.keys(e[0]):[]),o&&s.push(c(r));var f,d=Rn(e);try{var p=function(){var e=f.value,t=r.map((function(t){return e[t]}));s.push(c(t))};for(d.s();!(f=d.n()).done;)p()}catch(e){d.e(e)}finally{d.f()}return s.join("\n")+"\n"}function zn(e,t){var r=new Blob([e],{type:"text/csv;charset=utf-8"});if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var n=document.createElement("a"),o=window.URL.createObjectURL(r);n.href=o,n.download=t,n.click(),window.URL.revokeObjectURL(o)}}function Mn(){return"undefined"!=typeof document}function Tn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}(document.querySelectorAll("link"));try{for(n.s();!(r=n.n()).done;){var o=r.value,a=o.href.substring(o.href.lastIndexOf("/")+1);if("stylesheet"===o.rel&&"reactable.css"===a){e=o.parentElement,t=o;break}}}catch(e){n.e(e)}finally{n.f()}}return wn=On({key:"reactable",container:e,insertionPoint:t})}function $n(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!t)return e;var r=Object.keys(t),n="("+r.map((function(e){return"{".concat(e,"}")})).join("|")+")",o=e.split(new RegExp(n)),a=r.reduce((function(e,r){return e["{".concat(r,"}")]=t[r],e}),{}),i=o.map((function(e){return null!=a[e]?a[e]:e}));return i.some((function(e){return"object"===Un(e)}))?i:i.join("")}function Xn(e){return Xn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xn(e)}var qn=["isCurrent","className"];function Zn(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,qn);return r=In(r,"rt-page-button",t?" rt-page-button-current":null),i().createElement("button",no({type:"button",className:r},n),n.children)},ao=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Yn(e,t)}(l,e);var t,r,n,o,a,u=(o=l,a=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=to(o);if(a){var r=to(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Qn(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=u.call(this,e)).changePage=t.changePage.bind(eo(t)),t.applyPage=t.applyPage.bind(eo(t)),t.state={pageJumpValue:e.page+1,prevPage:e.page},t}return t=l,r=[{key:"changePage",value:function(e){e!==this.props.page+1&&this.props.onPageChange(e-1)}},{key:"applyPage",value:function(e){e&&e.preventDefault();var t=this.state.pageJumpValue;if(""!==t)this.changePage(t);else{var r=this.props.page+1;this.setState({pageJumpValue:r})}}},{key:"renderPageInfo",value:function(e){var t=e.page,r=e.pageSize,n=e.pageRowCount,o=e.rowCount,a=e.language,u=Math.min(t*r+1,o),l=Math.max(Math.min(t*r+r,o),n),c=Jn(a.pageInfo,{rowStart:u,rowEnd:l,rows:o});return i().createElement("div",{className:"rt-page-info","aria-live":"polite"},c)}},{key:"renderPageSizeOptions",value:function(e){var t=e.pageSize,r=e.pageSizeOptions,n=e.onPageSizeChange,o=e.language,a=i().createElement("select",{key:"page-size-select",className:"rt-page-size-select","aria-label":o.pageSizeOptionsLabel,onChange:function(e){return n(Number(e.target.value))},value:t},r.map((function(e,t){return i().createElement("option",{key:t,value:e},e)}))),u=Jn(o.pageSizeOptions,{rows:a});return i().createElement("div",{className:"rt-page-size"},u)}},{key:"renderPageJump",value:function(e){var t=e.onChange,r=e.value,n=e.onBlur,o=e.onKeyPress,a=e.inputType,u=e.language;return i().createElement("input",{key:"page-jump",className:"rt-page-jump","aria-label":u.pageJumpLabel,type:a,onChange:t,value:r,onBlur:n,onKeyPress:o})}},{key:"getPageJumpProperties",value:function(){var e=this;return{onKeyPress:function(t){13!==t.which&&13!==t.keyCode||e.applyPage()},onBlur:this.applyPage,value:this.state.pageJumpValue,onChange:function(t){var r=t.target.value;if(""!==r){var n=Number(r);if(!Number.isNaN(n)){var o=Math.min(Math.max(n,1),Math.max(e.props.pages,1));e.setState({pageJumpValue:o})}}else e.setState({pageJumpValue:r})},inputType:"number",language:this.props.language}}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.paginationType,o=r.showPageSizeOptions,a=r.showPageInfo,u=r.page,l=r.pages,c=r.canPrevious,s=r.canNext,f=r.theme,d=r.language,p=a?this.renderPageInfo(this.props):null,g=o?this.renderPageSizeOptions(this.props):null,y=u+1,m=function(e,t){return t<=6?(r=Array(t),function(e){if(Array.isArray(e))return ro(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return ro(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ro(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e,t){return t+1})):e<=4?[1,2,3,4,5,t]:t-e<3?[1,t-3,t-2,t-1,t]:[1,e-1,e,e+1,t];var r}(y,l);if("numbers"===n){var h=[];m.forEach((function(e,r){var n=y===e,o=i().createElement(oo,{key:e,isCurrent:n,onClick:t.changePage.bind(null,e),"aria-label":Jn(d.pageNumberLabel,{page:e})+(n?" ":""),"aria-current":n?"page":null},e);e-m[r-1]>1&&h.push(i().createElement("span",{className:"rt-page-ellipsis",key:"ellipsis-".concat(e),role:"separator"},"...")),h.push(o)})),e=h}else{var b="jump"===n?this.renderPageJump(this.getPageJumpProperties()):y,v=Math.max(l,1);e=i().createElement("div",{className:"rt-page-numbers"},Jn(d.pageNumbers,{page:b,pages:v}))}var w=i().createElement(oo,{className:"rt-prev-button",onClick:function(){c&&t.changePage(y-1)},disabled:!c,"aria-disabled":c?null:"true","aria-label":d.pagePreviousLabel},d.pagePrevious),S=i().createElement(oo,{className:"rt-next-button",onClick:function(){s&&t.changePage(y+1)},disabled:!s,"aria-disabled":s?null:"true","aria-label":d.pageNextLabel},d.pageNext);return i().createElement("div",{className:In("rt-pagination",$n(f.paginationStyle))},i().createElement("div",{className:"rt-pagination-info"},p,g),i().createElement("div",{className:"rt-pagination-nav"},w,e,S))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.page!==t.prevPage?{pageJumpValue:e.page+1,prevPage:e.page}:null}}],r&&Zn(t.prototype,r),n&&Zn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(i().Component);function io(e){return io="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},io(e)}function uo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function lo(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Ro(e,t){if(e){if("string"==typeof e)return Po(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Po(e,t):void 0}}function Po(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0;if(r.forEach((function(e){e.depth=n})),n!==e.length){var o=e[n],i=e.slice(0,n+1),u=a.filter((function(e){return!i.includes(e.id)})).map((function(e){return e.id}));r.forEach((function(e){e.isGrouped&&(e.groupByID=o,e.aggregatedColumns=u,t(e.subRows,n+1))}))}}(t),[r,t,o,Mo,To,t,o]}var i=g.filter((function(e){return a.find((function(t){return t.id===e}))})),u=function(e,t,r,n){var o={};return a.forEach((function(a){if(n.includes(a.id)){var i="function"==typeof a.aggregate?a.aggregate:d[a.aggregate]||zo[a.aggregate];if(i){var u=e.map((function(e){var t=e.values[a.id];if(!r&&a.aggregateValue){var n="function"==typeof a.aggregateValue?a.aggregateValue:d[a.aggregateValue]||zo[a.aggregateValue];if(!n)throw console.info({column:a}),new Error("React Table: Invalid column.aggregateValue option for column listed above");t=n(t,e,a)}return t}));o[a.id]=i(u,e.map((function(e){return e.values})),t.map((function(e){return e.values})))}else{if(a.aggregate)throw console.info({column:a}),new Error("React Table: Invalid column.aggregate option for column listed above");o[a.id]=null}}else o[a.id]=t[0]?t[0].values[a.id]:null})),o},l=[],f={},p=[],y={},m=[],h={},b=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(r===i.length)return t.forEach((function(e){e.depth=r})),t;var o=i[r],s=c(t,o),d=Object.entries(s).map((function(t,c){var s=Io(t,2),d=s[0],g=s[1],b="".concat(o,":").concat(d);b=n?"".concat(n,">").concat(b):b;var v=e(g,r+1,b),w=r?Jo(g,"leafRows"):g,S=i.slice(0,r+1),O=a.filter((function(e){return!S.includes(e.id)})).map((function(e){return e.id})),R=u(w,v,r,O),P={id:b,isGrouped:!0,groupByID:o,groupByVal:d,values:R,subRows:v,leafRows:w,depth:r,index:void 0,groupIndex:c,aggregatedColumns:O};return v.forEach((function(e){l.push(e),f[e.id]=e,e.isGrouped?(p.push(e),y[e.id]=e):(m.push(e),h[e.id]=e)})),P}));return d}(r);return b.forEach((function(e){l.push(e),f[e.id]=e,e.isGrouped?(p.push(e),y[e.id]=e):(m.push(e),h[e.id]=e)})),[b,l,f,p,y,m,h]}),[s,g,r,n,o,a,d,c]),C=Io(E,7),A=C[0],k=C[1],B=C[2],F=C[3],D=C[4],G=C[5],z=C[6],M=I(h);N((function(){M()&&y({type:w.resetGroupBy})}),[y,s?null:t]),Object.assign(e,{preGroupedRows:r,preGroupedFlatRow:n,preGroupedRowsById:o,groupedRows:A,groupedFlatRows:k,groupedRowsById:B,onlyGroupedFlatRows:F,onlyGroupedRowsById:D,nonGroupedFlatRows:G,nonGroupedRowsById:z,rows:A,flatRows:k,rowsById:B,toggleGroupBy:R,setGroupBy:P})}function Uo(e){e.allCells.forEach((function(t){var r,n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isAggregated=!t.isGrouped&&(null===(r=e.aggregatedColumns)||void 0===r?void 0:r.includes(t.column.id))&&(null===(n=e.subRows)||void 0===n?void 0:n.length),t.isPlaceholder=!t.isGrouped&&t.column.isGrouped&&!t.isAggregated}))}function Ko(e,t){return e.reduce((function(e,r){var n="".concat(r.values[t]);return e[n]=Array.isArray(e[n])?e[n]:[],e[n].push(r),e}),{})}function Jo(e,t){var r=[];return function e(n){n.forEach((function(n){n[t]?e(n[t]):r.push(n)}))}(e),r}function Xo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function qo(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)return;r=!0}var n,a,i=function(e){var t=[];return function e(r){r.columns&&r.columns.length&&r.columns.forEach(e),t.push(r)}(e),t}(t),u=i.map((function(e){return[e.id,e.getDOMWidth()]})),l=u.find((function(e){return Yo(e,1)[0]===t.id}))[1],c=r?Math.round(e.touches[0].clientX):e.clientX,s=function(){window.cancelAnimationFrame(n),n=null,o({type:w.columnResizing,clientX:a})},f=function(){window.cancelAnimationFrame(n),n=null,o({type:w.columnDoneResizing})},d=function(e){a=e,n||(n=window.requestAnimationFrame(s))},p={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(){document.removeEventListener("mousemove",p.mouse.moveHandler),document.removeEventListener("mouseup",p.mouse.upHandler),f()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(){document.removeEventListener(p.touch.moveEvent,p.touch.moveHandler),document.removeEventListener(p.touch.upEvent,p.touch.upHandler),f()}}},g=r?p.touch:p.mouse,y=!!function(){if("boolean"==typeof ea)return ea;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 ea=e}()&&{passive:!1};document.addEventListener(g.moveEvent,g.moveHandler,y),document.addEventListener(g.upEvent,g.upHandler,y),o({type:w.columnStartResizing,columnId:t.id,columnWidth:l,headerIdWidths:u,clientX:c})};return[e,{onMouseDown:function(e){return e.persist()||a(e,n)},onTouchStart:function(e){return e.persist()||a(e,n)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function na(e,t){if(t.type===w.init)return qo({columnResizing:{columnWidths:{}}},e);if(t.type===w.resetResize)return qo(qo({},e),{},{columnResizing:{columnWidths:{}}});if(t.type===w.columnStartResizing){var r=t.clientX,n=t.columnId,o=t.columnWidth,a=t.headerIdWidths;return qo(qo({},e),{},{columnResizing:qo(qo({},e.columnResizing),{},{startX:r,headerIdWidths:a,columnWidth:o,isResizingColumn:n})})}if(t.type===w.columnResizing){var i=t.clientX,u=e.columnResizing,l=u.startX,c=u.columnWidth,s=u.headerIdWidths,f=(i-l)/c,d={};return(void 0===s?[]:s).forEach((function(e){var t=Yo(e,2),r=t[0],n=t[1];d[r]=Math.max(n+n*f,0)})),qo(qo({},e),{},{columnResizing:qo(qo({},e.columnResizing),{},{columnWidths:qo(qo({},e.columnResizing.columnWidths),d)})})}return t.type===w.columnDoneResizing?qo(qo({},e),{},{columnResizing:qo(qo({},e.columnResizing),{},{startX:null,isResizingColumn:null})}):void 0}ta.pluginName="useResizeColumns";var oa=function(e){var t=e.flatHeaders,r=e.disableResizing,n=e.getHooks,o=e.state.columnResizing,a=I(e);t.forEach((function(e){var t=kn(!0!==e.disableResizing&&void 0,!0!==r&&void 0,!0);e.canResize=t,e.width=kn(o.columnWidths[e.id],e.originalWidth,e.width),e.isResizing=o.isResizingColumn===e.id,t&&(e.getResizerProps=j(n().getResizerProps,{instance:a(),header:e}))}))};function aa(e){var t=e.plugins,r=e.dispatch,n=e.autoResetResize,o=void 0===n||n,a=e.columns;x(t,["useAbsoluteLayout"],"useResizeColumns");var u=I(o);N((function(){u()&&r({type:w.resetResize})}),[a]);var l=i().useCallback((function(){return r({type:w.resetResize})}),[r]);Object.assign(e,{resetResizing:l})}function ia(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ua(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.pageIndex?u=-1===o?a.length>=e.pageSize:i-1),u?wa(wa({},e),{},{pageIndex:i}):e}if(t.type===w.setPageSize){var l=t.pageSize,c=e.pageSize*e.pageIndex,s=Math.floor(c/l);return wa(wa({},e),{},{pageIndex:s,pageSize:l})}}function Pa(e){var t=e.rows,r=e.autoResetPage,n=void 0===r||r,o=e.manualExpandedKey,a=void 0===o?"expanded":o,u=e.plugins,l=e.pageCount,c=e.paginateExpandedRows,s=void 0===c||c,f=e.expandSubRows,d=void 0===f||f,p=e.disablePagination,g=e.state,y=g.pageIndex,m=g.expanded,h=g.globalFilter,b=g.filters,v=g.groupBy,S=g.sortBy,O=e.dispatch,R=e.data,P=e.manualPagination,j=e.rowCount;x(u,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var E=I(n);N((function(){E()&&O({type:w.resetPage})}),[O,P?null:R,h,b,v,S]);var C,A=p?t.length:e.state.pageSize;C=P?null!=j&&j>=0?Math.ceil(j/A):l:Math.ceil(t.length/A);var k=i().useMemo((function(){return C>0?(e=new Array(C),function(e){if(Array.isArray(e))return ba(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ha(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).fill(null).map((function(e,t){return t})):[];var e}),[C]),B=i().useMemo((function(){var e;if(P)e=t;else{var r=A*y,n=r+A;e=t.slice(r,n)}var o=e.length;return s?[e,o]:[ja(e,{manualExpandedKey:a,expanded:m,expandSubRows:d}),o]}),[d,m,a,P,y,A,s,t]),F=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a=[],i=!0,u=!1;try{for(r=r.call(e);!(i=(n=r.next()).done)&&(a.push(n.value),!t||a.length!==t);i=!0);}catch(e){u=!0,o=e}finally{try{i||null==r.return||r.return()}finally{if(u)throw o}}return a}}(e,t)||ha(e,t)||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.")}()}(B,2),D=F[0],G=F[1],z=y>0,M=-1===C?D.length>=A:y1&&void 0!==arguments[1])||arguments[1];t.isExpanded=t.original&&t.original[r]||n[t.id],t.canExpand=t.subRows&&!!t.subRows.length,o&&i.push(t),t.subRows&&t.subRows.length&&t.isExpanded&&t.subRows.forEach((function(t){return e(t,a)}))};return e.forEach((function(e){return u(e)})),i}function Ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ca(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rt)&&(t=e)})),t},min:function(e){var t;return e.forEach((function(e){(null==t||e1?" (".concat(t[e],")"):"")})).join(", ")}};function za(e,t){return"numeric"===t&&Da[e]?Da[e]:Ga[e]}function Ma(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!Number.isFinite(e))return e;t=t>0?t:0;var r=Math.pow(10,t);return Math.sign(e)*Math.round(Math.abs(e)*r)/r}function Ta(e){return e.filter((function(e){return null!=e&&!Number.isNaN(e)}))}var Wa=["html","className"];function Ha(){return Ha=Object.assign?Object.assign.bind():function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Ua(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(i[Ja]=ei(e.subRows)),i}))}function ti(e){var t=e.html,r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Wa);return i().createElement("div",Ha({className:In("rt-text-content",r),dangerouslySetInnerHTML:{__html:t}},n))}function ri(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sortable,o=r.defaultSortDesc,u=r.showSortIcon,l=r.showSortable,c=r.filterable,s=r.resizable;return e=e.map((function(e){var t=La({},e);t.accessor=function(e){return e[t.id]},"string"==typeof t.aggregate&&(t.aggregate=za(t.aggregate,t.type));var r=oi({type:t.type,naLast:t.sortNALast});t.sortType=function(e,t,n,o){return r(e.values[n],t.values[n],o)},t.sortable=kn(t.sortable,n),t.disableSortBy=!t.sortable,t.defaultSortDesc=kn(t.defaultSortDesc,o),t.sortDescFirst=t.defaultSortDesc,t.filterable=kn(t.filterable,c),t.disableFilters=!t.filterable,!1===t.searchable&&(t.disableGlobalFilter=!0),!1===t.show&&!0!==t.searchable&&(t.disableGlobalFilter=!0),"numeric"===t.type?t.createMatcher=ii:t.createMatcher=ui,t.filter=function(e,r,n){var o=r[0];if("function"==typeof t.filterMethod)return t.filterMethod(e,o,n);var a=t.createMatcher(n);return e.filter((function(e){var t=e.values[o];return a(t)}))},"numeric"===t.type?t.align=t.align||"right":t.align=t.align||"left",t.vAlign=t.vAlign||"top",t.headerVAlign=t.headerVAlign||"top";var f=t.width,d=t.minWidth,p=t.maxWidth;t.minWidth=kn(f,d,100),t.maxWidth=kn(f,p,Number.MAX_SAFE_INTEGER),t.minWidth=Math.min(t.minWidth,t.maxWidth),t.width=t.minWidth,t.resizable=kn(t.resizable,s),t.minWidth===t.maxWidth&&(t.resizable=!1),t.disableResizing=!t.resizable,t.Cell=function(e,r){var n=e.value,o=null==n||Number.isNaN(n);return o&&(n=t.na),!o&&t.format&&t.format.cell&&(n=ai(n,t.format.cell)),t.cell&&("function"==typeof t.cell&&(n=t.cell(La(La({},e),{},{value:n}),r)),Array.isArray(t.cell)&&!e.aggregated&&(n=t.cell[e.index])&&(n=(0,rr.hydrate)({Fragment:a.Fragment,WidgetContainer:po},n))),null!=n&&""!==n||(n=Ka),i().isValidElement(n)?n:t.html?i().createElement(ti,{style:{display:"inline"},html:n}):String(n)},t.grouped?t.Grouped=function(e,r){var n=e.value,o=null==n||Number.isNaN(n);return o&&(n=t.na),!o&&t.format&&t.format.cell&&(n=ai(n,t.format.cell)),null!=(n=t.grouped(La(La({},e),{},{value:n}),r))&&""!==n||(n=Ka),i().isValidElement(n)?n:t.html?i().createElement(ti,{style:{display:"inline"},html:n}):String(n)}:t.Grouped=function(e,r){var n=t.Cell(e,r);return i().createElement(i().Fragment,null,n,e.subRows&&" (".concat(e.subRows.length,")"))},t.Aggregated=function(e,r){var n,o=e.value;if(null!=o&&t.format&&t.format.aggregated&&(o=ai(o,t.format.aggregated)),t.aggregated&&(o=t.aggregated(La(La({},e),{},{value:o}),r)),null==o&&(o=""),i().isValidElement(o))n=o;else{if(t.html)return i().createElement(ti,{html:o});n=String(o)}return n},t.Header=function(e,r){var n,o=t.name;if(null!=t.header&&(o="function"==typeof t.header?t.header(e,r):(0,rr.hydrate)({Fragment:a.Fragment,WidgetContainer:po},t.header)),n=i().isValidElement(o)?o:t.html?i().createElement(ti,{html:o}):null!=o?String(o):"",t.sortable&&u){var c=l?"rt-sort":"";return n=t.html?n:i().createElement("div",{className:"rt-text-content"},n),"right"===t.align?i().createElement("div",{className:"rt-sort-header"},i().createElement("span",{className:In(c,"rt-sort-left"),"aria-hidden":"true"}),n):i().createElement("div",{className:"rt-sort-header"},n,i().createElement("span",{className:In(c,"rt-sort-right"),"aria-hidden":"true"}))}return n},null!=t.footer?t.Footer=function(e,r){var n;return n="function"==typeof t.footer?t.footer(e,r):(0,rr.hydrate)({Fragment:a.Fragment,WidgetContainer:po},t.footer),i().isValidElement(n)?n:t.html?i().createElement(ti,{html:n}):null!=n?String(n):""}:t.Footer=Ka;var g=li(t.align),y=ci(t.vAlign),m=ci(t.headerVAlign);return t.headerClassName=In(g,m,t.headerClassName),t.footerClassName=In(g,y,t.footerClassName),t.getProps=function(e,r,n){var o,a,i={className:In(g,y)};return t.className&&(o="function"==typeof t.className?t.className(e,r,n):Array.isArray(t.className)?t.className[e.index]:t.className,i.className=In(i.className,o)),t.style&&(a="function"==typeof t.style?t.style(e,r,n):Array.isArray(t.style)?t.style[e.index]:t.style,i.style=a),i},t})),t&&(e=ni(e,t)).forEach((function(e,t){e.id="group_".concat(t),null!=e.name||null!=e.header?e.Header=function(t,r){var n=e.name;return e.header&&(n="function"==typeof e.header?e.header(t,r):(0,rr.hydrate)({Fragment:a.Fragment,WidgetContainer:po},e.header)),i().isValidElement(n)?n:e.html?i().createElement(ti,{html:n}):null!=n?String(n):""}:e.Header=Ka,Fn(e).every((function(e){return e.disableResizing}))&&(e.disableResizing=!0),e.align=e.align||"center",e.headerVAlign=e.headerVAlign||"top";var r=li(e.align),n=ci(e.headerVAlign);e.headerClassName=In(r,n,e.headerClassName)})),e}function ni(e,t){t.forEach((function(t){var r=(t=La({},t)).columns;t.columns=[],e=e.reduce((function(e,n){return n.id===r[0]?(e.push(t),t.columns.push(n)):r.includes(n.id)?t.columns.push(n):e.push(n),e}),[])}));var r,n=[];return e.forEach((function(e){e.columns?(n.push(e),r=null):(r||(r={columns:[],isUngrouped:!0},n.push(r)),r.columns.push(e))})),e=n}function oi(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type,r=e.naLast;return function(e,n,o){return"numeric"===t?(e=Number.isNaN(e)?null:e,n=Number.isNaN(n)?null:n):(e="string"==typeof e?e.toLowerCase():e,n="string"==typeof n?n.toLowerCase():n),e===n?0:null==e?r?o?-1:1:-1:null==n?r?o?1:-1:1:e>n?1:e=e.length?{done:!0}:{done:!1,value:e[n++]}},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 a,i=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}function Ni(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Bi(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var $i={};function Ui(e){if(!e)throw new Error("A reactable table ID must be provided");var t=$i[e];if(!t)throw new Error("reactable instance '".concat(e,"' not found"));return t()}function Ki(e){return Ui(e).state}function Ji(e,t,r){Ui(e).setFilter(t,r)}function Xi(e,t){Ui(e).setAllFilters(t)}function qi(e,t){Ui(e).setGlobalFilter(t)}function Zi(e,t,r){Ui(e).toggleGroupBy(t,r)}function Yi(e,t){Ui(e).setGroupBy(t)}function Qi(e,t){Ui(e).toggleAllRowsExpanded(t)}function eu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"data.csv",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};Ui(e).downloadDataCSV(t,r)}function tu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return Ui(e).getDataCSV(t)}function ru(e,t){Ui(e).setMeta(t)}function nu(e,t,r){Ui(e).toggleHideColumn(t,r)}function ou(e,t){Ui(e).setHiddenColumns(t)}function au(e,t,r){Ui(e).setData(t,r)}function iu(e,t){return Ui(e).onStateChange(t)}function uu(e,t){Ui(e).gotoPage(t)}function lu(e,t){Ui(e).setPageSize(t)}function cu(e){var t=e.data,r=e.columns,n=e.columnGroups,o=e.sortable,a=e.defaultSortDesc,u=e.showSortIcon,l=e.showSortable,c=e.filterable,s=e.resizable,f=e.theme,d=e.language,p=e.dataKey,g=Vi(e,si);for(var y in t=qa(t,r),r=ri(r,n,{sortable:o,defaultSortDesc:a,showSortIcon:u,showSortable:l,filterable:c,resizable:s}),f=function(e){if(!e)return null;var t=e.color,r=e.backgroundColor,n=e.borderColor,o=e.borderWidth,a=e.stripedColor,i=e.highlightColor,u=e.cellPadding,l=e.style,c=e.tableBorderColor,s=void 0===c?n:c,f=e.tableBorderWidth,d=void 0===f?o:f,p=e.tableStyle,g=e.headerBorderColor,y=void 0===g?n:g,m=e.headerBorderWidth,h=void 0===m?o:m,b=e.headerStyle,v=e.groupHeaderBorderColor,w=void 0===v?n:v,S=e.groupHeaderBorderWidth,O=void 0===S?o:S,R=e.groupHeaderStyle,P=e.tableBodyStyle,j=e.rowGroupStyle,E=e.rowStyle,C=e.rowStripedStyle,x=e.rowHighlightStyle,A=e.rowSelectedStyle,I=e.cellBorderColor,k=void 0===I?n:I,N=e.cellBorderWidth,B=void 0===N?o:N,F=e.cellStyle,D=e.footerBorderColor,G=void 0===D?n:D,z=e.footerBorderWidth,M=void 0===z?o:z,T=e.footerStyle,W=e.inputStyle,H=e.filterInputStyle,_=e.searchInputStyle,L=e.selectStyle,V=e.paginationStyle,$=e.pageButtonStyle,U=e.pageButtonHoverStyle,K=e.pageButtonActiveStyle,J=e.pageButtonCurrentStyle,X=Ln([F,E,P,p,l],"color",t),q=Ln([L,l],"color",t);h=Ln([b],"borderWidth",h);var Z,Y={style:Hn({color:t,backgroundColor:r},l),tableStyle:Hn({borderColor:s,borderWidth:d},p),headerStyle:Hn(Hn({borderColor:y,borderWidth:h,padding:u},b),{},{".rt-bordered &, .rt-outlined &":{borderWidth:h}}),groupHeaderStyle:Hn(Hn({borderColor:w,borderWidth:O,padding:u},R),{},{"&::after":{backgroundColor:w,height:O},".rt-bordered &":{borderWidth:O}}),tableBodyStyle:P,rowGroupStyle:j,rowStyle:Hn(Hn({},E),{},{"&.rt-tr-striped":Hn({backgroundColor:a},C),"&.rt-tr-highlight:hover":Hn({backgroundColor:i},x),"&.rt-tr-selected":Hn({},A)}),cellStyle:Hn({borderColor:k,borderWidth:B,padding:u},F),footerStyle:Hn({borderColor:G,borderWidth:M,padding:u},T),filterCellStyle:Hn({borderColor:k,borderWidth:B,padding:u},F),expanderStyle:{"&::after":{borderTopColor:X}},filterInputStyle:Hn(Hn({},W),H),searchInputStyle:Hn(Hn({},W),_),paginationStyle:Hn(Hn({borderTopColor:k,borderTopWidth:B},V),{},{".rt-page-jump":Hn({},W),".rt-page-size-select":Hn(Hn({},L),{},{"@supports (-moz-appearance: none)":{backgroundImage:q&&'url(\'data:image/svg+xml;charset=US-ASCII,'+'\')')}}),".rt-page-button":Hn({},$),".rt-page-button:not(:disabled):hover":Hn({},U),".rt-page-button:not(:disabled):active":Hn({},K),".rt-keyboard-active & .rt-page-button:not(:disabled):focus":Hn({},U),".rt-page-button-current":Hn({},J)})};return Nn(Y),Y}(f)||{},d=_i(_i({},Kn),d))d[y]=d[y]||null;return i().createElement(ku,Wi({data:t,columns:r,theme:f,language:d,key:p},g))}function su(e){var t=JSON.stringify(e);return i().useMemo((function(){return e}),[t])}function fu(e){var t=e.data,r=e.columns,n=e.columnGroups,o=e.sortable,a=e.defaultSortDesc,u=e.showSortIcon,l=e.showSortable,c=e.filterable,s=e.resizable,f=e.sortBy,d=e.filters,p=e.searchValue,g=e.groupBy,y=e.expanded,m=e.selectedRowIds,h=Vi(e,fi);return t=i().useMemo((function(){return qa(t,r)}),[]),r=i().useMemo((function(){return ri(r,n,{sortable:o,defaultSortDesc:a,showSortIcon:u,showSortable:l,filterable:c,resizable:s})}),[]),f=su(f||[]),d=su(d||[]),g=su(g||[]),y=su(y||{}),m=su(m||{}),i().createElement(Iu,Wi({data:t,columns:r,sortBy:f,filters:d,searchValue:p,groupBy:g,expanded:y,selectedRowIds:m},h))}var du=i().forwardRef((function(e,t){var r=e.className,n=Vi(e,di);return i().createElement("div",Wi({ref:t,className:In("Reactable","ReactTable",r)},n))})),pu=i().forwardRef((function(e,t){var r=e.className,n=Vi(e,pi);return i().createElement("div",Wi({ref:t,className:In("rt-table",r),role:"table"},n))}));function gu(e){var t=e.className,r=Vi(e,gi);return i().createElement("div",Wi({className:In("rt-thead",t),role:"rowgroup"},r))}function yu(e){var t=e.className,r=Vi(e,yi);return i().createElement("div",Wi({className:In("rt-tbody",t),role:"rowgroup"},r))}function mu(e){var t=e.className,r=Vi(e,mi);return i().createElement("div",Wi({className:In("rt-tfoot",t),role:"rowgroup"},r))}function hu(e){var t=e.className,r=Vi(e,hi);return i().createElement("div",Wi({className:In("rt-tr-group",t)},r))}function bu(e){var t=e.className,r=Vi(e,bi);return i().createElement("div",Wi({className:In("rt-tr",t),role:"row"},r))}var vu=i().forwardRef((function(e,t){var r=e.canSort,n=e.sortDescFirst,o=e.isSorted,a=e.isSortedDesc,u=e.toggleSortBy,l=e.canResize,c=e.isResizing,s=e.className,f=e.innerClassName,d=e.children,p=Vi(e,vi),g=zi(i().useState(!1),2),y=g[0],m=g[1];if(r){var h=o?a?"descending":"ascending":"none",b=n?"descending":"ascending",v=function(e){var t=o?!a:n;e&&(t=null),u&&u(t,e)};p=_i(_i({},p),{},{"aria-sort":h,tabIndex:"0",onClick:function(e){y||v(e.shiftKey)},onKeyPress:function(e){var t=e.which||e.keyCode;13!==t&&32!==t||v(e.shiftKey)},onMouseUp:function(){m(!!c)},onMouseDown:function(e){(e.detail>1||e.shiftKey)&&e.preventDefault()},"data-sort-hint":o?null:b})}return i().createElement("div",Wi({className:In("rt-th",l&&"rt-th-resizable",s),role:"columnheader",ref:t},p),i().createElement("div",{className:In("rt-th-inner",f)},d))}));function wu(e){var t=e.className,r=e.innerClassName,n=e.children,o=Vi(e,wi);return i().createElement("div",Wi({className:In("rt-td",t),role:"cell"},o),i().createElement("div",{className:In("rt-td-inner",r)},n))}function Su(e){if(!e)return{};if(null!=e.padding){var t=e.padding;return{className:$n(Vi(e,Si)),innerClassName:$n({padding:t})}}return{className:$n(e)}}function Ou(e){var t=e.onMouseDown,r=e.onTouchStart,n=e.className,o=Vi(e,Oi);return i().createElement("div",Wi({className:In("rt-resizer",n),onMouseDown:t,onTouchStart:r,"aria-hidden":!0},o))}var Ru,Pu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fi(e,t)}(u,e);var t,r,n,o,a=(n=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Gi(n);if(o){var r=Gi(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Di(this,e)});function u(){return Ni(this,u),a.apply(this,arguments)}return t=u,(r=[{key:"componentDidMount",value:function(){window.Shiny&&window.Shiny.bindAll&&window.Shiny.bindAll(this.el)}},{key:"componentWillUnmount",value:function(){window.Shiny&&window.Shiny.unbindAll&&window.Shiny.unbindAll(this.el)}},{key:"render",value:function(){var e=this,t=this.props,r=t.children,n=t.html,o={ref:function(t){return e.el=t}};return o=_i(_i({},o),{},n?{dangerouslySetInnerHTML:{__html:n}}:{children:r}),i().createElement("div",Wi({className:"rt-tr-details"},o))}}])&&Bi(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(i().Component);function ju(e){var t=e.isExpanded,r=e.className,n=e["aria-label"];return i().createElement("button",{className:"rt-expander-button","aria-label":n,"aria-expanded":t?"true":"false"},i().createElement("span",{className:In("rt-expander",t&&"rt-expander-open",r),tabIndex:"-1","aria-hidden":"true"},"​"))}function Eu(e){var t=e.filterValue,r=e.setFilter,n=e.className,o=e.placeholder,a=e["aria-label"];return i().createElement("input",{type:"text",className:In("rt-filter",n),value:t||"",onChange:function(e){return r(e.target.value||void 0)},placeholder:o,"aria-label":a})}function Cu(e){var t=e.searchValue,r=e.setSearch,n=e.className,o=e.placeholder,a=e["aria-label"];return i().createElement("input",{type:"text",value:t||"",onChange:function(e){return r(e.target.value||void 0)},className:In("rt-search",n),placeholder:o,"aria-label":a})}function xu(e){var t=e.className,r=Vi(e,Ri);return i().createElement("div",Wi({className:In("rt-no-data",t),"aria-live":"assertive"},r))}function Au(e){var t=e.type,r=e.checked,n=e.onChange,o=e["aria-label"];return i().createElement("div",{className:"rt-select"},i().createElement("input",{type:t,checked:r,onChange:n,className:"rt-select-input","aria-label":o}),"​")}function Iu(e){var t=e.data,r=e.columns,n=e.groupBy,o=e.searchMethod,a=e.pagination,u=e.paginateSubRows,l=e.selection,c=e.crosstalkGroup,s=e.crosstalkId,f=e.setResolvedData,d=e.pageSize,p=e.pageIndex,g=e.sortBy,y=e.filters,m=e.searchValue,h=e.expanded,b=e.selectedRowIds,v=i().useMemo((function(){return r.reduce((function(e,t){return e.concat(Fn(t))}),[])}),[r]),w=i().useMemo((function(){return o||function(e,t,r){var n=v.reduce((function(e,t){return e[t.id]=t.createMatcher(r),e}),{});return e.filter((function(e){var r,o=ki(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,i=e.values[a];if(n[a](i))return!0}}catch(e){o.e(e)}finally{o.f()}}))}}),[v,o]),S=ze({columns:r,data:t,useControlledState:function(e){return i().useMemo((function(){return _i(_i({},e),{},{pageIndex:p,pageSize:d,sortBy:g,filters:y,globalFilter:m,groupBy:n,expanded:h,selectedRowIds:b})}),[e,p,d,g,y,m,n,h,b])},globalFilter:w,paginateExpandedRows:!!u,disablePagination:!a,getSubRows:Xa,manualExpandedKey:null,autoResetGroupBy:!1,autoResetSortBy:!1,autoResetExpanded:!1,autoResetFilters:!1,autoResetGlobalFilter:!1,autoResetSelectedRows:!1,autoResetResize:!1,autoResetPage:!0},ta,go,jo,pt,St,Wo,Zt,$e,Oa,ca,(function(e){l&&e.visibleColumns.push((function(e){return[_i(_i({},e.find((function(e){return e.selectable}))),{},{selectable:!0,disableSortBy:!0,filterable:!1,disableFilters:!0,disableGlobalFilter:!0})].concat(Ii(e.filter((function(e){return!e.selectable}))))}))}),(function(e){c&&(e.visibleColumns.push((function(e){var t={id:s,filter:function(e,t,r){return r?e.filter((function(e){if(r.includes(e.index))return!0})):e},disableGlobalFilter:!0};return e.concat(t)})),e.stateReducers.push((function(e){return e.hiddenColumns.includes(s)?e:_i(_i({},e),{},{hiddenColumns:e.hiddenColumns.concat(s)})})))})),O=i().useRef(u?S.flatRows.length:S.rows.length);return i().useEffect((function(){O.current=0}),[t]),i().useEffect((function(){var e=u?S.flatRows.length:S.rows.length;e>O.current&&(O.current=e)}),[u,S.flatRows,S.rows]),f&&f({data:ei(S.page,u),rowCount:S.rows.length,maxRowCount:O.current}),null}function ku(e){var t=e.data,r=e.columns,n=e.groupBy,o=e.searchable,u=e.searchMethod,l=e.defaultSorted,c=e.pagination,s=e.paginationType,f=e.showPagination,d=e.showPageSizeOptions,p=e.showPageInfo,g=e.defaultPageSize,y=e.pageSizeOptions,m=e.minRows,h=e.paginateSubRows,b=e.defaultExpanded,v=e.selection,w=e.defaultSelected,S=e.selectionId,O=e.onClick,R=e.outlined,P=e.bordered,j=e.borderless,E=e.compact,C=e.nowrap,x=e.striped,A=e.highlight,B=e.className,F=e.style,D=e.rowClassName,G=e.rowStyle,z=e.inline,M=e.width,T=e.height,W=e.theme,H=e.language,_=e.meta,L=e.crosstalkKey,V=e.crosstalkGroup,$=e.crosstalkId,U=e.elementId,K=e.nested,J=e.dataURL,X=e.serverRowCount,q=e.serverMaxRowCount,Z=zi(i().useState(null),2),Y=Z[0],Q=Z[1],ee=i().useMemo((function(){return Y||t}),[Y,t]),te=null!=J,re=zi(i().useState(X),2),ne=re[0],oe=re[1],ae=zi(i().useState(q),2),ie=ae[0],ue=ae[1],le=i().useMemo((function(){return r.reduce((function(e,t){return e.concat(Fn(t))}),[])}),[r]),ce=i().useMemo((function(){return u||function(e,t,r){var n=le.reduce((function(e,t){return e[t.id]=t.createMatcher(r),e}),{});return e.filter((function(e){var r,o=ki(t);try{for(o.s();!(r=o.n()).done;){var a=r.value,i=e.values[a];if(n[a](i))return!0}}catch(e){o.e(e)}finally{o.f()}}))}}),[le,u]),se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ia(i().useState(e),2),r=t[0],n=t[1],o=function(e){if(null!=e){if("object"!==Aa(e)&&"function"!=typeof e)throw new Error("meta must be an object or function");n((function(t){"function"==typeof e&&(e=e(t));for(var r=Ca(Ca({},t),e),n=0,o=Object.entries(r);nIe.current&&(Ie.current=e)}),[h,he.flatRows,he.rows]);var ke=i().useRef(null),Ne={onMouseDown:function(){ke.current.classList.remove("rt-keyboard-active")},onKeyDown:function(){ke.current.classList.add("rt-keyboard-active")},onKeyUp:function(e){9===(e.which||e.keyCode)&&ke.current.classList.add("rt-keyboard-active")}},Be=i().useRef(null),Fe=zi(i().useState(!1),2),De=Fe[0],Ge=Fe[1];k((function(){var e=function(){var e=Be.current,t=e.scrollHeight,r=e.clientHeight,n=e.scrollWidth,o=e.clientWidth;Ge(t>r||n>o)};if(window.ResizeObserver){var t=new ResizeObserver((function(){e()}));return t.observe(Be.current),function(){t.disconnect()}}e()}),[]),i().useEffect((function(){if(window.Shiny&&window.Shiny.onInputChange&&!K){var e=ke.current.parentElement.getAttribute("data-reactable-output");if(e){var t,r=Re.selected.map((function(e){return e+1})),n=Re.page+1,o=Re.sorted.length>0?{}:null,a=ki(Re.sorted);try{for(a.s();!(t=a.n()).done;){var i=t.value;o[i.id]=i.desc?"desc":"asc"}}catch(e){a.e(e)}finally{a.f()}var u={page:n,pageSize:Re.pageSize,pages:Re.pages,sorted:o,selected:r};Object.keys(u).forEach((function(t){window.Shiny.onInputChange("".concat(e,"__reactable__").concat(t),u[t])}))}}}),[K,Re.page,Re.pageSize,Re.pages,Re.sorted,Re.selected]);var Me=I(he.pageCount);i().useEffect((function(){if(window.Shiny&&!K){var e=ke.current.parentElement.getAttribute("data-reactable-output");if(e){var t=he.setRowsSelected,r=he.gotoPage,n=he.toggleAllRowsExpanded;window.Shiny.addCustomMessageHandler("__reactable__".concat(e),(function(e){if(e.jsEvals){var o,a=ki(e.jsEvals);try{for(a.s();!(o=a.n()).done;){var i=o.value;window.HTMLWidgets.evaluateStringMember(e,i)}}catch(e){a.e(e)}finally{a.f()}}if(null!=e.data){var u=qa(e.data,le);Q(u)}if(null!=e.selected){var l=e.selected.map((function(e){return String(e)}));t(l)}if(null!=e.page){var c=Math.min(Math.max(e.page,0),Math.max(Me()-1,0));r(c)}null!=e.expanded&&(e.expanded?n(!0):n(!1)),void 0!==e.meta&&pe(e.meta)}))}}}),[K,he.setRowsSelected,he.gotoPage,he.toggleAllRowsExpanded,le,Me,pe]);var Te=i().useRef(null);k((function(){if(V&&window.crosstalk){var e={};e.selection=new window.crosstalk.SelectionHandle(V),e.filter=new window.crosstalk.FilterHandle(V),e.selected=e.selection.value,e.filtered=e.filter.filteredKeys,Te.current=e;var t=(L||[]).reduce((function(e,t,r){return e[t]=r,e}),{}),r=he.setFilter,n=he.setRowsSelected,o=function(){var n,o=e.selected&&e.selected.length>0?e.selected:null,a=e.filtered,i=(n=o||a?o?a?o.filter((function(e){return a.includes(e)})):o:a:null)?n.map((function(e){return t[e]})):null;r($,i)},a=function(t){e.selected!==t&&(e.selected=t,o())};return e.selection.on("change",(function(t){t.sender!==e.selection?(a(t.value),e.skipNextSelection=!0,n([])):a(null)})),e.filter.on("change",(function(t){var r;t.sender!==e.filter&&(r=t.value,e.filtered!==r&&(e.filtered=r,o()))})),(e.selected||e.filtered)&&o(),function(){try{e.selection.close()}catch(e){console.error("Error closing Crosstalk selection handle:",e)}try{e.filter.close()}catch(e){console.error("Error closing Crosstalk filter handle:",e)}}}}),[L,V,$,he.setFilter,he.setRowsSelected]),k((function(){Te.current&&(w||(Te.current.skipNextSelection=!0))}),[w]),k((function(){if(Te.current&&v){var e=Te.current;if(e.skipNextSelection)e.skipNextSelection=!1;else{var t=Object.keys(me.selectedRowIds).map((function(e){return L[ve[e].index]}));try{e.selection.set(t)}catch(e){console.error("Error selecting Crosstalk keys:",e)}}}}),[me.selectedRowIds,ve,v,L]),he.state=Re,he.downloadDataCSV=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||"data.csv";var r=he.getDataCSV(t);zn(r,e)},he.getDataCSV=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.columnIds||(e.columnIds=le.map((function(e){return e.id})));var t=ee.length>0?Object.keys(ee[0]):[];e.columnIds=e.columnIds.filter((function(e){return t.includes(e)}));var r=he.preGroupedRows.map((function(e){return e.values})),n=Gn(r,e);return n},he.setMeta=pe;var We=he.toggleHideColumn;he.toggleHideColumn=function(e,t){t&&Re.hiddenColumns.includes(e)||We(e,t)},he.setData=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({resetSelected:!0,resetExpanded:!1},t),"object"!==Ai(e)||null==e)throw new Error("data must be an array of row objects or an object containing column arrays");Array.isArray(e)||(e=qa(e,le)),Q(e),t.resetSelected&&he.setRowsSelected([]),t.resetExpanded&&he.toggleAllRowsExpanded(!1)};var He=i().useRef([]);he.onStateChange=function(e){if("function"!=typeof e)throw new Error("listenerFn must be a function");return He.current.push(e),function(){He.current=He.current.filter((function(t){return t!==e}))}};var _e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=i().useRef({}),n=I(e),o=I(t);return i().useCallback((function(){for(var e=arguments.length,t=new Array(e),a=0;a0){var y=function(){return he.toggleAllRowsSelected()};o=_i(_i({},o),{},{onClick:y,className:In(o.className,"rt-td-select")}),n=i().createElement(Au,{type:"checkbox",checked:he.isAllRowsSelected,onChange:y,"aria-label":H.selectAllRowsLabel})}var m=e.getHeaderProps(o),h=m.key,b=Vi(m,Ei);return i().createElement(vu,Wi({key:h},b),n,t)})))})),je?i().createElement(bu,{className:In("rt-tr-filters",$n(W.rowStyle))},he.visibleColumns.map((function(e){var t,r;e.filterable&&(null!=e.filterInput?(r="function"==typeof e.filterInput?e.filterInput(e,Re):(0,rr.hydrate)({Fragment:a.Fragment,WidgetContainer:po},e.filterInput),i().isValidElement(r)?t=r:e.html&&(t=i().createElement(ti,{html:r}))):t=i().createElement(Eu,{filterValue:e.filterValue,setFilter:e.setFilter,className:$n(W.filterInputStyle),placeholder:H.filterPlaceholder,"aria-label":Jn(H.filterLabel,{name:e.name})}));var n=Su(W.filterCellStyle),o=n.className,u=n.innerClassName,l={role:"cell",colSpan:null,className:In("rt-td-filter",e.headerClassName,o),innerClassName:u,style:e.headerStyle},c=e.getHeaderProps(l),s=c.key,f=Vi(c,Ci);return i().createElement(wu,Wi({key:s},f),t)}))):null)),function(){var e,t=he.visibleColumns.some((function(e){return e.sticky})),r=t?"rt-tr-highlight-sticky":"rt-tr-highlight",n=t?"rt-tr-striped-sticky":"rt-tr-striped",o=he.page.map((function(e,t){he.prepareRow(e);var o,u=function(t){null==t&&(t=!e.isSelected),"single"===v&&he.setRowsSelected([]),e.toggleRowSelected(t)},l=_i(_i({},e),{},{toggleRowSelected:u,viewIndex:t,row:e.values,subRows:Dn(e.subRows),aggregated:e.isGrouped,expanded:e.isExpanded,level:e.depth,selected:e.isSelected,page:me.pageIndex}),c={className:In(x&&(t%2?null:n),A&&r,e.isSelected&&"rt-tr-selected",$n(W.rowStyle))};D&&(o="function"==typeof D?D(l,Re):Array.isArray(D)?D[l.index]:D,c.className=In(c.className,o)),G&&("function"==typeof G?c.style=G(l,Re):Array.isArray(G)?c.style=G[l.index]:c.style=G);var s,f=function(e,t){if(!e.isExpanded||e.isGrouped)return null;var r,n=xe[e.id];if(!(r=null!=n?he.visibleColumns.find((function(e){return e.id===n})):he.visibleColumns.find((function(e){return e.details}))))return null;var o=r,u=o.details,l=o.html,c={};if("function"==typeof u){var s=u(e,t);l&&(c.html=s),c.children=s}else if(Array.isArray(u)){var f=u[e.index];if(null==f)return null;l&&(c.html=f),c.children=(0,rr.hydrate)({Reactable:cu,Fragment:a.Fragment,WidgetContainer:po},f)}return i().createElement(Pu,Wi({key:"".concat(r.id,"_").concat(e.index)},c))}(l,Re);if(e.isExpanded)if(null!=xe[e.id])s=xe[e.id];else{var d=he.visibleColumns.find((function(e){return e.details}));s=d?d.id:null}var p=e.getRowProps(c);return i().createElement(hu,{key:"".concat(e.depth,"_").concat(t),className:$n(W.rowGroupStyle)},i().createElement(bu,Wi({},p,{key:void 0}),e.cells.map((function(t,r){var n=t.column,o=n.getProps?n.getProps(l,n,Re):{},a=Su(W.cellStyle),c=a.className,f=a.innerClassName;o=_i(_i({},o),{},{className:In(o.className,c),innerClassName:f,role:n.rowHeader?"rowheader":"cell"});var d,p,g,y=_i(_i({},t),{},{column:n,filterValue:n.filterValue},l);if(d=t.isGrouped?n.Grouped?n.Grouped(y,Re):y.value:t.isAggregated?n.Aggregated?n.Aggregated(y,Re):t.render("Aggregated"):t.isPlaceholder?"":n.Cell?n.Cell(y,Re):t.render("Cell"),n.details&&!e.isGrouped&&(Array.isArray(n.details)&&null==n.details[e.index]||(p=!0)),p){var m=e.isExpanded&&s===n.id;o=_i(_i({},o),{},{onClick:function(){if(m){e.toggleRowExpanded(!1);var t=_i({},xe);delete t[e.id],Ae(t)}else{e.toggleRowExpanded(!0);var r=_i(_i({},xe),{},Li({},e.id,n.id));Ae(r)}},className:In(o.className,"rt-td-expandable")}),d===Ka&&(o.style=_i({textOverflow:"clip",userSelect:"none"},o.style));var h={isExpanded:m,className:$n(W.expanderStyle),"aria-label":H.detailsExpandLabel};g=i().createElement(ju,h)}else if(t.isGrouped){var b=e.isExpanded;o=_i(_i({},o),{},{onClick:function(){return e.toggleRowExpanded()},className:In(o.className,"rt-td-expandable")});var w={isExpanded:b,className:$n(W.expanderStyle),"aria-label":H.groupExpandLabel};g=i().createElement(ju,w)}else t.column.isGrouped&&e.canExpand&&(o=_i(_i({},o),{},{onClick:function(){return e.toggleRowExpanded()},className:In(o.className,"rt-td-expandable")}));var S,R="multiple"===v||"single"===v&&!t.isAggregated;n.selectable&&R&&(o=_i(_i({},o),{},{onClick:function(){return u()},className:In(o.className,"rt-td-select")}),S=t.isAggregated?H.selectAllSubRowsLabel:H.selectRowLabel,d=i().createElement(Au,{type:"multiple"===v?"checkbox":"radio",checked:e.isSelected,onChange:function(){return u()},"aria-label":S})),O&&!o.onClick&&("expand"===O?o.onClick=function(){return e.toggleRowExpanded()}:"select"===O&&R?o.onClick=function(){return u()}:"function"==typeof O&&(o.onClick=function(){return O(l,n,Re)}));var P=t.getCellProps(o);return i().createElement(wu,Wi({},P,{key:"".concat(r,"_").concat(n.id)}),g,d)}))),f)}));m=m?Math.max(m,1):1;var u=Math.max(m-he.page.length,0);u>0&&(e=Ii(Array(u)).map((function(e,t){var r,n={className:In("rt-tr-pad",$n(W.rowStyle))};return D&&("function"==typeof D?r=D(void 0,Re):Array.isArray(D)||(r=D),n.className=In(n.className,r)),G&&("function"==typeof G?n.style=G(void 0,Re):Array.isArray(G)||(n.style=G)),i().createElement(hu,{key:t,className:$n(W.rowGroupStyle),"aria-hidden":!0},i().createElement(bu,n,he.visibleColumns.map((function(e){var r=Su(W.cellStyle),n=r.className,o=r.innerClassName,a={className:n},u=e.getFooterProps(a),l=u.className,c=u.style;return i().createElement(wu,{key:"".concat(t,"_").concat(e.id),className:l,innerClassName:o,style:c}," ")}))))})));var l,c=$n(W.tableBodyStyle);0===he.rows.length?(l=i().createElement(xu,null,H.noData),c=In("rt-tbody-no-data",c)):l=i().createElement(xu,null);var s=he.getTableBodyProps({className:c});return i().createElement(yu,s,o,e,l)}(),function(){var e=he.visibleColumns.some((function(e){return null!=e.footer}));if(!e)return null;var t=he.getTfootProps();return i().createElement(mu,t,i().createElement(bu,null,he.visibleColumns.map((function(e){var t="function"==typeof(e=_i(_i({},e),{},{column:e,data:Oe})).Footer?e.Footer(e,Re):e.render("Footer"),r=Su(W.footerStyle),n=r.className,o=r.innerClassName,a={className:In("rt-td-footer",e.footerClassName,n),innerClassName:o,style:e.footerStyle,role:e.rowHeader?"rowheader":"cell",colSpan:null},u=e.getFooterProps(a),l=u.key,c=Vi(u,xi);return i().createElement(wu,Wi({key:l},c),t)}))))}()),function(){if(!1===f)return null;if(!c&&null==f)return null;if(c&&null==f){var e=d?Math.min.apply(Math,[me.pageSize].concat(Ii(y||[]))):me.pageSize;if((null!=ie?ie:null!=ne?ne:Ie.current)<=e)return null}return i().createElement(ao,{paginationType:s,pageSizeOptions:y,showPageInfo:p,showPageSizeOptions:d,page:me.pageIndex,pages:he.pageCount,pageSize:me.pageSize,pageRowCount:he.pageRowCount,canNext:he.canNextPage,canPrevious:he.canPreviousPage,onPageChange:he.gotoPage,onPageSizeChange:he.setPageSize,rowCount:null!=ne?ne:he.rows.length,theme:W,language:H})}())}cu.defaultProps={sortable:!0,pagination:!0,defaultPageSize:10,paginationType:"numbers",pageSizeOptions:[10,25,50,100],showPageInfo:!0,minRows:1,showSortIcon:!0,crosstalkId:"__crosstalk__"},fu.defaultProps=cu.defaultProps,Ru={Reactable:cu},window.HTMLWidgets.widget({name:"reactable",type:"output",factory:function(e){return{renderValue:function(t){e.hasAttribute("data-react-ssr")?l().hydrate(s(Ru,t.tag),e):l().render(s(Ru,t.tag),e)},resize:function(){}}}})}();var r=Reactable="undefined"==typeof Reactable?{}:Reactable;for(var n in t)r[n]=t[n];t.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})}(); +!function(){var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r:function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};!function(){"use strict";e.r(t),e.d(t,{ReactableData:function(){return Pu},downloadDataCSV:function(){return yu},getDataCSV:function(){return gu},getInstance:function(){return au},getState:function(){return uu},gotoPage:function(){return Su},onStateChange:function(){return wu},setAllFilters:function(){return cu},setData:function(){return hu},setFilter:function(){return lu},setGroupBy:function(){return du},setHiddenColumns:function(){return vu},setMeta:function(){return mu},setPageSize:function(){return Ou},setSearch:function(){return su},toggleAllRowsExpanded:function(){return pu},toggleGroupBy:function(){return fu},toggleHideColumn:function(){return bu}});var r={};e.r(r),e.d(r,{between:function(){return ft},equals:function(){return st},exact:function(){return ct},exactText:function(){return nt},exactTextCase:function(){return ot},includes:function(){return it},includesAll:function(){return at},includesSome:function(){return ut},includesValue:function(){return lt},text:function(){return rt}});var n={};e.r(n),e.d(n,{average:function(){return Tt},count:function(){return Mt},max:function(){return Bt},median:function(){return Dt},min:function(){return Nt},minMax:function(){return Ft},sum:function(){return kt},unique:function(){return Gt},uniqueCount:function(){return zt}});var o={};e.r(o),e.d(o,{alphanumeric:function(){return Lt},basic:function(){return $t},datetime:function(){return Vt},number:function(){return Kt},string:function(){return Ut}});var i=window.React,a=e.n(i),u=window.ReactDOM,l=e.n(u);function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(t.children);try{for(o.s();!(r=o.n()).done;){var i=r.value;n.push(s(e,i))}}catch(e){o.e(e)}finally{o.f()}return a().createElement.apply(a(),n)}var f=["style","className"];function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function p(e){return function(e){if(Array.isArray(e))return y(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?y(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var h="Renderer Error ☝️",w={init:"init"},S=function(){return a().createElement(a().Fragment,null," ")},O={Cell:function(e){var t=e.value;return void 0===t?"":t},width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function R(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return[].concat(p(e),[r]).reduce((function(e,n){return j(e,n,m(m({},t),{},{userProps:r}))}),{})}},E=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.reduce((function(e,t){return t(e,r)}),t)},C=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return e.forEach((function(e){e(t,r)}))};function x(e,t,r,n){e.findIndex((function(e){return e.pluginName===r})),t.forEach((function(t){e.findIndex((function(e){return e.pluginName===t}))}))}function A(e,t){return"function"==typeof e?e(t):e}function I(e){var t=a().useRef();return t.current=e,a().useCallback((function(){return t.current}),[])}var k="undefined"!=typeof document?a().useLayoutEffect:a().useEffect;function N(e,t){var r=a().useRef(!1);k((function(){r.current&&e(),r.current=!0}),t)}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return function(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i="string"==typeof n?t[n]:n;if(void 0===i)throw console.info(t),new Error(h);return F(i,m(m(m({},e),{},{column:t},r),o))}}function F(e,t){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"===d(e)&&"symbol"===d(e.$$typeof)&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?a().createElement(e,t):e;var r}function T(e){return T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},T(e)}function D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function G(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:0;return e.map((function(e){return H(e=G(G({},e),{},{parent:t,depth:r})),e.columns&&(e.columns=M(e.columns,e,r+1)),e}))}function W(e){return t="columns",r=[],function e(n){n.forEach((function(n){n[t]?e(n[t]):r.push(n)}))}(e),r;var t,r}function H(e){var t=e.id,r=e.accessor,n=e.Header;if("string"==typeof r){t=t||r;var o=r.split(".");r=function(e){return function(e,t,r){if(!t)return e;var n,o="function"==typeof t?t:JSON.stringify(t),i=V.get(o)||function(){var e=function(e){return Q(e).map((function(e){return String(e).replace(".","_")})).join(".").replace(Z,".").replace(Y,"").split(".")}(t);return V.set(o,e),e}();try{n=i.reduce((function(e,t){return e[t]}),e)}catch(e){}return void 0!==n?n:void 0}(e,o)}}if(!t&&"string"==typeof n&&n&&(t=n),!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:r}),e}function _(e,t){if(!t)throw new Error;return Object.assign(e,G(G(G({Header:S,Footer:S},O),t),e)),Object.assign(e,{originalWidth:e.width}),e}function L(e,t){for(var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return{}},n=[],o=e,i=0,a=function(){return i++},u=function(){var e={headers:[]},i=[],u=o.some((function(e){return e.parent}));o.forEach((function(n){var o,l=[].concat(i).reverse()[0];u&&(o=n.parent?G(G({},n.parent),{},{originalId:n.parent.id,id:"".concat(n.parent.id,"_").concat(a()),headers:[n]},r(n)):_(G({originalId:"".concat(n.id,"_placeholder"),id:"".concat(n.id,"_placeholder_").concat(a()),placeholderOf:n,headers:[n]},r(n)),t),l&&l.originalId===o.originalId?l.headers.push(n):i.push(o)),e.headers.push(n)})),n.push(e),o=i};o.length;)u();return n.reverse()}var V=new Map;function $(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1])||arguments[1];t.isExpanded=t.original&&t.original[r]||n[t.id],t.canExpand=t.subRows&&!!t.subRows.length,o&&a.push(t),t.subRows&&t.subRows.length&&t.isExpanded&&t.subRows.forEach((function(t){return e(t,i)}))};return e.forEach((function(e){return u(e)})),a}function J(e,t,r){return U(e)||t[e]||r[e]||r.text}function X(e,t,r){return e?e(t,r):void 0===t}function q(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var Z=/\[/g,Y=/\]/g;function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(Array.isArray(e))for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Ee)),{},{initialState:r,defaultColumn:o,getSubRows:a,getRowId:l,stateReducer:s,useControlledState:d})}var He=function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n1&&void 0!==arguments[1]?arguments[1]:0,r=0,n=0,o=0,i=0;return e.forEach((function(e){var a=e.headers;if(e.totalLeft=t,a&&a.length){var u=Ce(_e(a,t),4),l=u[0],c=u[1],s=u[2],f=u[3];e.totalMinWidth=l,e.totalWidth=c,e.totalMaxWidth=s,e.totalFlexWidth=f}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,r+=e.totalMinWidth,n+=e.totalWidth,o+=e.totalMaxWidth,i+=e.totalFlexWidth)})),[r,n,o,i]}function Le(e){var t=e.data,r=e.rows,n=e.flatRows,o=e.rowsById,i=e.column,a=e.getRowId,u=e.getSubRows,l=e.accessValueHooks,c=e.getInstance,s=function e(r,s){var f=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,d=arguments.length>3?arguments[3]:void 0,p=arguments.length>4?arguments[4]:void 0,y=r,g=a(r,s,d),m=o[g];if(m)m.subRows&&m.originalSubRows.forEach((function(t,r){return e(t,r,f+1,m)}));else if((m={id:g,original:y,index:s,depth:f,cells:[{}]}).cells.map=q,m.cells.filter=q,m.cells.forEach=q,m.cells[0].getCellProps=q,m.values={},p.push(m),n.push(m),o[g]=m,m.originalSubRows=u(r,s),m.originalSubRows){var b=[];m.originalSubRows.forEach((function(t,r){return e(t,r,f+1,m,b)})),m.subRows=b}i.accessor&&(m.values[i.id]=i.accessor(r,s,m,p,t)),m.values[i.id]=E(l,m.values[i.id],{row:m,column:i,instance:c()},!0)};t.forEach((function(e,t){return s(e,t,0,void 0,r)}))}function Ve(e){return Ve="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(e)}function $e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Ue(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(d,[l].map(Je)));return Ue(Ue({},e),{},{expanded:p})}return e}}function Qe(e){var t=e.data,r=e.rows,n=e.rowsById,o=e.manualExpandedKey,i=void 0===o?"expanded":o,u=e.paginateExpandedRows,l=void 0===u||u,c=e.expandSubRows,s=void 0===c||c,f=e.autoResetExpanded,d=void 0===f||f,p=e.getHooks,y=e.plugins,g=e.state.expanded,m=e.dispatch;x(y,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var b=I(d),v=Boolean(Object.keys(n).length&&Object.keys(g).length);v&&Object.keys(n).some((function(e){return!g[e]}))&&(v=!1),N((function(){b()&&m({type:w.resetExpanded})}),[m,t]);var h=a().useCallback((function(e,t){m({type:w.toggleRowExpanded,id:e,value:t})}),[m]),S=a().useCallback((function(e){return m({type:w.toggleAllRowsExpanded,value:e})}),[m]),O=a().useMemo((function(){return l?K(r,{manualExpandedKey:i,expanded:g,expandSubRows:s}):r}),[l,r,i,g,s]),R=a().useMemo((function(){return function(e){var t=0;return Object.keys(e).forEach((function(e){var r=e.split(".");t=Math.max(t,r.length)})),t}(g)}),[g]),j=I(e),E=P(p().getToggleAllRowsExpandedProps,{instance:j()});Object.assign(e,{preExpandedRows:r,expandedRows:O,rows:O,expandedDepth:R,isAllRowsExpanded:v,toggleRowExpanded:h,toggleAllRowsExpanded:S,getToggleAllRowsExpandedProps:E})}function et(e,t){var r=t.instance.getHooks,n=t.instance;e.toggleRowExpanded=function(t){return n.toggleRowExpanded(e.id,t)},e.getToggleRowExpandedProps=P(r().getToggleRowExpandedProps,{instance:n,row:e})}function tt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r(i="number"==typeof i?i:1/0)){var a=o;o=i,i=a}return e.filter((function(e){return t.some((function(t){var r=e.values[t];return r>=o&&r<=i}))}))};function dt(e){return dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dt(e)}function pt(e,t){if(e){if("string"==typeof e)return yt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?yt(e,t):void 0}}function yt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0,a=o;return a=p.reduce((function(e,t){var n=t.id,o=t.value,a=u.find((function(e){return e.id===n}));if(!a)return e;0===i&&(a.preFilteredRows=e);var c=J(a.filter,l||{},r);return c?(a.filteredRows=c(e,[n],o),a.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: ".concat(a.id,".")),e)}),o),a.forEach((function(r){e.push(r),t[r.id]=r,r.subRows&&(r.subRows=r.subRows&&r.subRows.length>0?n(r.subRows,i+1):r.subRows)})),a}(n),e,t]}),[c,p,n,o,i,u,l]),S=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||pt(e,t)||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.")}()}(h,3),O=S[0],R=S[1],j=S[2];a().useMemo((function(){var e=u.filter((function(e){return!p.find((function(t){return t.id===e.id}))}));e.forEach((function(e){e.preFilteredRows=O,e.filteredRows=O}))}),[O,p,u]);var P=I(m);N((function(){P()&&y({type:w.resetFilters})}),[y,c?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:o,preFilteredRowsById:i,filteredRows:O,filteredFlatRows:R,filteredRowsById:j,rows:O,flatRows:R,rowsById:j,setFilter:b,setAllFilters:v})}vt.pluginName="useFilters";var St=["globalFilter"];function Ot(e){return Ot="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ot(e)}function Rt(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,St)):Pt(Pt({},e),{},{globalFilter:l})}}function At(e){var t=e.data,n=e.rows,o=e.flatRows,i=e.rowsById,u=e.allColumns,l=e.filterTypes,c=e.globalFilter,s=e.manualGlobalFilter,f=e.state.globalFilter,d=e.dispatch,p=e.autoResetGlobalFilter,y=void 0===p||p,g=e.disableGlobalFilter,m=a().useCallback((function(e){d({type:w.setGlobalFilter,filterValue:e})}),[d]),b=a().useMemo((function(){if(s||void 0===f)return[n,o,i];var e=[],t={},a=J(c,l||{},r);if(!a)return console.warn("Could not find a valid 'globalFilter' option."),n;u.forEach((function(e){var t=e.disableGlobalFilter;e.canFilter=$(!0!==t&&void 0,!0!==g&&void 0,!0)}));var d=u.filter((function(e){return!0===e.canFilter}));return[function r(n){return(n=a(n,d.map((function(e){return e.id})),f)).forEach((function(n){e.push(n),t[n.id]=n,n.subRows=n.subRows&&n.subRows.length?r(n.subRows):n.subRows})),n}(n),e,t]}),[s,f,c,l,u,n,o,i,g]),v=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Rt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Rt(e,t):void 0}}(e,t)||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.")}()}(b,3),h=v[0],S=v[1],O=v[2],R=I(y);N((function(){R()&&d({type:w.resetGlobalFilter})}),[d,s?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:o,preGlobalFilteredRowsById:i,globalFilteredRows:h,globalFilteredFlatRows:S,globalFilteredRowsById:O,rows:h,flatRows:S,rowsById:O,setGlobalFilter:m,disableGlobalFilter:g})}function It(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);ru)return 1;if(u>a)return-1}else{if(isNaN(s[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return o.length-i.length};function Vt(e,t,r){var n=Wt(Xt(e,t,r),2),o=n[0],i=n[1];return Jt(o=o.getTime(),i=i.getTime())}function $t(e,t,r){var n=Wt(Xt(e,t,r),2);return Jt(n[0],n[1])}function Ut(e,t,r){var n=Wt(Xt(e,t,r),2),o=n[0],i=n[1];for(o=o.split("").filter(Boolean),i=i.split("").filter(Boolean);o.length&&i.length;){var a=o.shift(),u=i.shift(),l=a.toLowerCase(),c=u.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(a>u)return 1;if(u>a)return-1}return o.length-i.length}function Kt(e,t,r){var n=Wt(Xt(e,t,r),2),o=n[0],i=n[1],a=/[^0-9.]/gi;return Jt(o=Number(String(o).replace(a,"")),i=Number(String(i).replace(a,"")))}function Jt(e,t){return e===t?0:e>t?1:-1}function Xt(e,t,r){return[e.values[r],t.values[r]]}function qt(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function Yt(e){return function(e){if(Array.isArray(e))return er(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Qt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Qt(e,t){if(e){if("string"==typeof e)return er(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?er(e,t):void 0}}function er(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?br(Cr,--Pr):0,Rr--,10===Er&&(Rr=1,Or--),Er}function kr(){return Er=Pr2||Tr(Er)>3?"":" "}function Wr(e,t){for(;--t&&kr()&&!(Er<48||Er>102||Er>57&&Er<65||Er>70&&Er<97););return Fr(e,Br()+(t<6&&32==Nr()&&32==kr()))}function Hr(e){for(;kr();)switch(Er){case e:return Pr;case 34:case 39:34!==e&&39!==e&&Hr(Er);break;case 40:41===e&&Hr(e);break;case 92:kr()}return Pr}function _r(e,t){for(;kr()&&e+Er!==57&&(e+Er!==84||47!==Nr()););return"/*"+Fr(t,Pr-1)+"*"+dr(47===e?e:kr())}function Lr(e){for(;!Tr(Nr());)kr();return Fr(e,Pr)}var Vr="-ms-",$r="-moz-",Ur="-webkit-",Kr="comm",Jr="rule",Xr="decl",qr="@keyframes";function Zr(e,t){for(var r="",n=wr(e),o=0;o6)switch(br(e,t+1)){case 109:if(45!==br(e,t+4))break;case 102:return gr(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+$r+(108==br(e,t+3)?"$3":"$2-$3"))+e;case 115:return~mr(e,"stretch")?Qr(gr(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==br(e,t+1))break;case 6444:switch(br(e,hr(e)-3-(~mr(e,"!important")&&10))){case 107:return gr(e,":",":"+Ur)+e;case 101:return gr(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Ur+(45===br(e,14)?"inline-":"")+"box$3$1"+Ur+"$2$3$1"+Vr+"$2box$3")+e}break;case 5936:switch(br(e,t+11)){case 114:return Ur+e+Vr+gr(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Ur+e+Vr+gr(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Ur+e+Vr+gr(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Ur+e+Vr+e+e}return e}function en(e){return Gr(tn("",null,null,null,[""],e=Dr(e),0,[0],e))}function tn(e,t,r,n,o,i,a,u,l){for(var c=0,s=0,f=a,d=0,p=0,y=0,g=1,m=1,b=1,v=0,h="",w=o,S=i,O=n,R=h;m;)switch(y=v,v=kr()){case 40:if(108!=y&&58==R.charCodeAt(f-1)){-1!=mr(R+=gr(zr(v),"&","&\f"),"&\f")&&(b=-1);break}case 34:case 39:case 91:R+=zr(v);break;case 9:case 10:case 13:case 32:R+=Mr(y);break;case 92:R+=Wr(Br()-1,7);continue;case 47:switch(Nr()){case 42:case 47:Sr(nn(_r(kr(),Br()),t,r),l);break;default:R+="/"}break;case 123*g:u[c++]=hr(R)*b;case 125*g:case 59:case 0:switch(v){case 0:case 125:m=0;case 59+s:p>0&&hr(R)-f&&Sr(p>32?on(R+";",n,r,f-1):on(gr(R," ","")+";",n,r,f-2),l);break;case 59:R+=";";default:if(Sr(O=rn(R,t,r,c,s,o,u,h,w=[],S=[],f),i),123===v)if(0===s)tn(R,t,O,O,w,i,f,u,S);else switch(d){case 100:case 109:case 115:tn(e,O,O,n&&Sr(rn(e,O,O,0,0,o,u,h,o,w=[],f),S),o,S,f,u,n?w:S);break;default:tn(R,O,O,O,[""],S,0,u,S)}}c=s=p=0,g=b=1,h=R="",f=a;break;case 58:f=1+hr(R),p=y;default:if(g<1)if(123==v)--g;else if(125==v&&0==g++&&125==Ir())continue;switch(R+=dr(v),v*g){case 38:b=s>0?1:(R+="\f",-1);break;case 44:u[c++]=(hr(R)-1)*b,b=1;break;case 64:45===Nr()&&(R+=zr(kr())),d=Nr(),s=f=hr(h=R+=Lr(Br())),v++;break;case 45:45===y&&2==hr(R)&&(g=0)}}return i}function rn(e,t,r,n,o,i,a,u,l,c,s){for(var f=o-1,d=0===o?i:[""],p=wr(d),y=0,g=0,m=0;y0?d[b]+" "+v:gr(v,/&\f/g,d[b])))&&(l[m++]=h);return xr(e,t,r,0===o?Jr:u,l,c,s)}function nn(e,t,r){return xr(e,t,r,Kr,dr(Er),vr(e,2,-2),0)}function on(e,t,r,n){return xr(e,t,r,Xr,vr(e,0,n),vr(e,n+1,-1),n)}var an=function(e,t,r){for(var n=0,o=0;n=o,o=Nr(),38===n&&12===o&&(t[r]=1),!Tr(o);)kr();return Fr(e,Pr)},un=new WeakMap,ln=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||un.get(r))&&!n){un.set(e,!0);for(var o=[],i=function(e,t){return Gr(function(e,t){var r=-1,n=44;do{switch(Tr(n)){case 0:38===n&&12===Nr()&&(t[r]=1),e[r]+=an(Pr-1,t,r);break;case 2:e[r]+=zr(n);break;case 4:if(44===n){e[++r]=58===Nr()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=dr(n)}}while(n=kr());return e}(Dr(e),t))}(t,o),a=r.props,u=0,l=0;u-1&&!e.return)switch(e.type){case Xr:e.return=Qr(e.value,e.length);break;case qr:return Zr([Ar(e,{value:gr(e.value,"@","@"+Ur)})],n);case Jr:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=/(::plac\w+|:read-\w+)/.exec(e))?e[0]:e}(t)){case":read-only":case":read-write":return Zr([Ar(e,{props:[gr(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return Zr([Ar(e,{props:[gr(t,/:(plac\w+)/,":-webkit-input-$1")]}),Ar(e,{props:[gr(t,/:(plac\w+)/,":-moz-$1")]}),Ar(e,{props:[gr(t,/:(plac\w+)/,Vr+"input-$1")]})],n)}return""}))}}],fn=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},dn={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},pn=/[A-Z]|^ms/g,yn=/_EMO_([^_]+?)_([^]*?)_EMO_/g,gn=function(e){return 45===e.charCodeAt(1)},mn=function(e){return null!=e&&"boolean"!=typeof e},bn=function(e){var t=Object.create(null);return function(e){return void 0===t[e]&&(t[e]=gn(r=e)?r:r.replace(pn,"-$&").toLowerCase()),t[e];var r}}(),vn=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(yn,(function(e,t,r){return wn={name:t,styles:r,next:wn},t}))}return 1===dn[e]||gn(e)||"number"!=typeof t||0===t?t:t+"px"};function hn(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return wn={name:r.name,styles:r.styles,next:wn},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)wn={name:n.name,styles:n.styles,next:wn},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Nn(e,t,r){return(t=function(e){var t=function(e,t){if("object"!==Bn(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!==Bn(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e,"string");return"symbol"===Bn(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Bn(e){return Bn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bn(e)}function Fn(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||Tn(e,t)||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.")}()}function Tn(e,t){if(e){if("string"==typeof e)return Dn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Dn(e,t):void 0}}function Dn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0?function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{},r=t.columnIds,n=t.headers,o=void 0===n||n,i=t.sep,a=void 0===i?",":i,u=t.dec,l=void 0===u?".":u,c=function(e){return e.map((function(e){return null==e&&(e=""),e instanceof Date?e=e.toISOString():"string"!=typeof e&&"number"!=typeof e?e=JSON.stringify(e):"."!==l&&"number"==typeof e&&(e=e.toString().replace(".",l)),"string"==typeof e&&(e.includes('"')||e.includes(a))&&(e='"'.concat(e.replace(/"/g,'""'),'"')),e})).join(a)},s=[];r||(r=e.length>0?Object.keys(e[0]):[]),o&&s.push(c(r));var f,d=In(e);try{var p=function(){var e=f.value,t=r.map((function(t){return e[t]}));s.push(c(t))};for(d.s();!(f=d.n()).done;)p()}catch(e){d.e(e)}finally{d.f()}return s.join("\n")+"\n"}function Vn(e,t){var r=new Blob([e],{type:"text/csv;charset=utf-8"});if(window.navigator.msSaveBlob)window.navigator.msSaveBlob(r,t);else{var n=document.createElement("a"),o=window.URL.createObjectURL(r);n.href=o,n.download=t,n.click(),window.URL.revokeObjectURL(o)}}function $n(){return"undefined"!=typeof document}function Un(e){return Un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Un(e)}function Kn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}(document.querySelectorAll("link"));try{for(n.s();!(r=n.n()).done;){var o=r.value,i=o.href.substring(o.href.lastIndexOf("/")+1);if("stylesheet"===o.rel&&"reactable.css"===i){e=o.parentElement,t=o;break}}}catch(e){n.e(e)}finally{n.f()}}return Cn=An({key:"reactable",container:e,insertionPoint:t})}function Qn(){for(var e=arguments.length,t=new Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e||!t)return e;var r=Object.keys(t),n="("+r.map((function(e){return"{".concat(e,"}")})).join("|")+")",o=e.split(new RegExp(n)),i=r.reduce((function(e,r){return e["{".concat(r,"}")]=t[r],e}),{}),a=o.map((function(e){return null!=i[e]?i[e]:e}));return a.some((function(e){return"object"===eo(e)}))?a:a.join("")}function no(e){return no="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},no(e)}var oo=["isCurrent","className"];function io(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,oo);return r=Gn(r,"rt-page-button",t?" rt-page-button-current":null),a().createElement("button",fo({type:"button",className:r},n),n.children)},yo=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ao(e,t)}(l,e);var t,r,n,o,i,u=(o=l,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=co(o);if(i){var r=co(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return uo(this,e)});function l(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,l),(t=u.call(this,e)).changePage=t.changePage.bind(lo(t)),t.applyPage=t.applyPage.bind(lo(t)),t.state={pageJumpValue:e.page+1,prevPage:e.page},t}return t=l,r=[{key:"changePage",value:function(e){e!==this.props.page+1&&this.props.onPageChange(e-1)}},{key:"applyPage",value:function(e){e&&e.preventDefault();var t=this.state.pageJumpValue;if(""!==t)this.changePage(t);else{var r=this.props.page+1;this.setState({pageJumpValue:r})}}},{key:"renderPageInfo",value:function(e){var t=e.page,r=e.pageSize,n=e.pageRowCount,o=e.rowCount,i=e.language,u=Math.min(t*r+1,o),l=Math.max(Math.min(t*r+r,o),n),c=ro(i.pageInfo,{rowStart:u,rowEnd:l,rows:o});return a().createElement("div",{className:"rt-page-info","aria-live":"polite"},c)}},{key:"renderPageSizeOptions",value:function(e){var t=e.pageSize,r=e.pageSizeOptions,n=e.onPageSizeChange,o=e.language,i=a().createElement("select",{key:"page-size-select",className:"rt-page-size-select","aria-label":o.pageSizeOptionsLabel,onChange:function(e){return n(Number(e.target.value))},value:t},r.map((function(e,t){return a().createElement("option",{key:t,value:e},e)}))),u=ro(o.pageSizeOptions,{rows:i});return a().createElement("div",{className:"rt-page-size"},u)}},{key:"renderPageJump",value:function(e){var t=e.onChange,r=e.value,n=e.onBlur,o=e.onKeyPress,i=e.inputType,u=e.language;return a().createElement("input",{key:"page-jump",className:"rt-page-jump","aria-label":u.pageJumpLabel,type:i,onChange:t,value:r,onBlur:n,onKeyPress:o})}},{key:"getPageJumpProperties",value:function(){var e=this;return{onKeyPress:function(t){13!==t.which&&13!==t.keyCode||e.applyPage()},onBlur:this.applyPage,value:this.state.pageJumpValue,onChange:function(t){var r=t.target.value;if(""!==r){var n=Number(r);if(!Number.isNaN(n)){var o=Math.min(Math.max(n,1),Math.max(e.props.pages,1));e.setState({pageJumpValue:o})}}else e.setState({pageJumpValue:r})},inputType:"number",language:this.props.language}}},{key:"render",value:function(){var e,t=this,r=this.props,n=r.paginationType,o=r.showPageSizeOptions,i=r.showPageInfo,u=r.page,l=r.pages,c=r.canPrevious,s=r.canNext,f=r.theme,d=r.language,p=i?this.renderPageInfo(this.props):null,y=o?this.renderPageSizeOptions(this.props):null,g=u+1,m=function(e,t){return t<=6?(r=Array(t),function(e){if(Array.isArray(e))return so(e)}(r)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||function(e,t){if(e){if("string"==typeof e)return so(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?so(e,t):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e,t){return t+1})):e<=4?[1,2,3,4,5,t]:t-e<3?[1,t-3,t-2,t-1,t]:[1,e-1,e,e+1,t];var r}(g,l);if("numbers"===n){var b=[];m.forEach((function(e,r){var n=g===e,o=a().createElement(po,{key:e,isCurrent:n,onClick:t.changePage.bind(null,e),"aria-label":ro(d.pageNumberLabel,{page:e})+(n?" ":""),"aria-current":n?"page":null},e);e-m[r-1]>1&&b.push(a().createElement("span",{className:"rt-page-ellipsis",key:"ellipsis-".concat(e),role:"separator"},"...")),b.push(o)})),e=b}else{var v="jump"===n?this.renderPageJump(this.getPageJumpProperties()):g,h=Math.max(l,1);e=a().createElement("div",{className:"rt-page-numbers"},ro(d.pageNumbers,{page:v,pages:h}))}var w=a().createElement(po,{className:"rt-prev-button",onClick:function(){c&&t.changePage(g-1)},disabled:!c,"aria-disabled":c?null:"true","aria-label":d.pagePreviousLabel},d.pagePrevious),S=a().createElement(po,{className:"rt-next-button",onClick:function(){s&&t.changePage(g+1)},disabled:!s,"aria-disabled":s?null:"true","aria-label":d.pageNextLabel},d.pageNext);return a().createElement("div",{className:Gn("rt-pagination",Qn(f.paginationStyle))},a().createElement("div",{className:"rt-pagination-info"},p,y),a().createElement("div",{className:"rt-pagination-nav"},w,e,S))}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){return e.page!==t.prevPage?{pageJumpValue:e.page+1,prevPage:e.page}:null}}],r&&io(t.prototype,r),n&&io(t,n),Object.defineProperty(t,"prototype",{writable:!1}),l}(a().Component);function go(e){return go="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},go(e)}function mo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function bo(e,t){for(var r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ko(e,t){if(e){if("string"==typeof e)return No(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?No(e,t):void 0}}function No(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);r1&&void 0!==arguments[1]?arguments[1]:0;if(r.forEach((function(e){e.depth=n})),n!==e.length){var o=e[n],a=e.slice(0,n+1),u=i.filter((function(e){return!a.includes(e.id)})).map((function(e){return e.id}));r.forEach((function(e){e.isGrouped&&(e.groupByID=o,e.aggregatedColumns=u,t(e.subRows,n+1))}))}}(t),[r,t,o,Ko,Jo,t,o]}var a=y.filter((function(e){return i.find((function(t){return t.id===e}))})),u=function(e,t,r,n){var o={};return i.forEach((function(i){if(n.includes(i.id)){var a="function"==typeof i.aggregate?i.aggregate:d[i.aggregate]||Uo[i.aggregate];if(a){var u=e.map((function(e){var t=e.values[i.id];if(!r&&i.aggregateValue){var n="function"==typeof i.aggregateValue?i.aggregateValue:d[i.aggregateValue]||Uo[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]=a(u,e.map((function(e){return e.values})),t.map((function(e){return e.values})))}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}}else o[i.id]=t[0]?t[0].values[i.id]:null})),o},l=[],f={},p=[],g={},m=[],b={},v=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;if(r===a.length)return t.forEach((function(e){e.depth=r})),t;var o=a[r],s=c(t,o),d=Object.entries(s).map((function(t,c){var s=Mo(t,2),d=s[0],y=s[1],v="".concat(o,":").concat(d);v=n?"".concat(n,">").concat(v):v;var h=e(y,r+1,v),w=r?ni(y,"leafRows"):y,S=a.slice(0,r+1),O=i.filter((function(e){return!S.includes(e.id)})).map((function(e){return e.id})),R=u(w,h,r,O),j={id:v,isGrouped:!0,groupByID:o,groupByVal:d,values:R,subRows:h,leafRows:w,depth:r,index:void 0,groupIndex:c,aggregatedColumns:O};return h.forEach((function(e){l.push(e),f[e.id]=e,e.isGrouped?(p.push(e),g[e.id]=e):(m.push(e),b[e.id]=e)})),j}));return d}(r);return v.forEach((function(e){l.push(e),f[e.id]=e,e.isGrouped?(p.push(e),g[e.id]=e):(m.push(e),b[e.id]=e)})),[v,l,f,p,g,m,b]}),[s,y,r,n,o,i,d,c]),C=Mo(E,7),A=C[0],k=C[1],B=C[2],F=C[3],T=C[4],D=C[5],G=C[6],z=I(b);N((function(){z()&&g({type:w.resetGroupBy})}),[g,s?null:t]),Object.assign(e,{preGroupedRows:r,preGroupedFlatRow:n,preGroupedRowsById:o,groupedRows:A,groupedFlatRows:k,groupedRowsById:B,onlyGroupedFlatRows:F,onlyGroupedRowsById:T,nonGroupedFlatRows:D,nonGroupedRowsById:G,rows:A,flatRows:k,rowsById:B,toggleGroupBy:R,setGroupBy:j})}function ti(e){e.allCells.forEach((function(t){var r,n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isAggregated=!t.isGrouped&&(null===(r=e.aggregatedColumns)||void 0===r?void 0:r.includes(t.column.id))&&(null===(n=e.subRows)||void 0===n?void 0:n.length),t.isPlaceholder=!t.isGrouped&&t.column.isGrouped&&!t.isAggregated}))}function ri(e,t){return e.reduce((function(e,r){var n="".concat(r.values[t]);return e[n]=Array.isArray(e[n])?e[n]:[],e[n].push(r),e}),{})}function ni(e,t){var r=[];return function e(n){n.forEach((function(n){n[t]?e(n[t]):r.push(n)}))}(e),r}function oi(e){return oi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oi(e)}function ii(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ai(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);r1)return;r=!0}var n,i,a=function(e){var t=[];return function e(r){r.columns&&r.columns.length&&r.columns.forEach(e),t.push(r)}(e),t}(t),u=a.map((function(e){return[e.id,e.getDOMWidth()]})),l=u.find((function(e){return li(e,1)[0]===t.id}))[1],c=r?Math.round(e.touches[0].clientX):e.clientX,s=function(){window.cancelAnimationFrame(n),n=null,o({type:w.columnResizing,clientX:i})},f=function(){window.cancelAnimationFrame(n),n=null,o({type:w.columnDoneResizing})},d=function(e){i=e,n||(n=window.requestAnimationFrame(s))},p={mouse:{moveEvent:"mousemove",moveHandler:function(e){return d(e.clientX)},upEvent:"mouseup",upHandler:function(){document.removeEventListener("mousemove",p.mouse.moveHandler),document.removeEventListener("mouseup",p.mouse.upHandler),f()}},touch:{moveEvent:"touchmove",moveHandler:function(e){return e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(){document.removeEventListener(p.touch.moveEvent,p.touch.moveHandler),document.removeEventListener(p.touch.upEvent,p.touch.upHandler),f()}}},y=r?p.touch:p.mouse,g=!!function(){if("boolean"==typeof si)return si;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 si=e}()&&{passive:!1};document.addEventListener(y.moveEvent,y.moveHandler,g),document.addEventListener(y.upEvent,y.upHandler,g),o({type:w.columnStartResizing,columnId:t.id,columnWidth:l,headerIdWidths:u,clientX:c})};return[e,{onMouseDown:function(e){return e.persist()||i(e,n)},onTouchStart:function(e){return e.persist()||i(e,n)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function pi(e,t){if(t.type===w.init)return ai({columnResizing:{columnWidths:{}}},e);if(t.type===w.resetResize)return ai(ai({},e),{},{columnResizing:{columnWidths:{}}});if(t.type===w.columnStartResizing){var r=t.clientX,n=t.columnId,o=t.columnWidth,i=t.headerIdWidths;return ai(ai({},e),{},{columnResizing:ai(ai({},e.columnResizing),{},{startX:r,headerIdWidths:i,columnWidth:o,isResizingColumn:n})})}if(t.type===w.columnResizing){var a=t.clientX,u=e.columnResizing,l=u.startX,c=u.columnWidth,s=u.headerIdWidths,f=(a-l)/c,d={};return(void 0===s?[]:s).forEach((function(e){var t=li(e,2),r=t[0],n=t[1];d[r]=Math.max(n+n*f,0)})),ai(ai({},e),{},{columnResizing:ai(ai({},e.columnResizing),{},{columnWidths:ai(ai({},e.columnResizing.columnWidths),d)})})}return t.type===w.columnDoneResizing?ai(ai({},e),{},{columnResizing:ai(ai({},e.columnResizing),{},{startX:null,isResizingColumn:null})}):void 0}fi.pluginName="useResizeColumns";var yi=function(e){var t=e.flatHeaders,r=e.disableResizing,n=e.getHooks,o=e.state.columnResizing,i=I(e);t.forEach((function(e){var t=zn(!0!==e.disableResizing&&void 0,!0!==r&&void 0,!0);e.canResize=t,e.width=zn(o.columnWidths[e.id],e.originalWidth,e.width),e.isResizing=o.isResizingColumn===e.id,t&&(e.getResizerProps=P(n().getResizerProps,{instance:i(),header:e}))}))};function gi(e){var t=e.plugins,r=e.dispatch,n=e.autoResetResize,o=void 0===n||n,i=e.columns;x(t,["useAbsoluteLayout"],"useResizeColumns");var u=I(o);N((function(){u()&&r({type:w.resetResize})}),[i]);var l=a().useCallback((function(){return r({type:w.resetResize})}),[r]);Object.assign(e,{resetResizing:l})}function mi(e){return mi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mi(e)}function bi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function vi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.pageIndex?u=-1===o?i.length>=e.pageSize:a-1),u?Ni(Ni({},e),{},{pageIndex:a}):e}if(t.type===w.setPageSize){var l=t.pageSize,c=e.pageSize*e.pageIndex,s=Math.floor(c/l);return Ni(Ni({},e),{},{pageIndex:s,pageSize:l})}}function Di(e){var t=e.rows,r=e.autoResetPage,n=void 0===r||r,o=e.manualExpandedKey,i=void 0===o?"expanded":o,u=e.plugins,l=e.pageCount,c=e.paginateExpandedRows,s=void 0===c||c,f=e.expandSubRows,d=void 0===f||f,p=e.disablePagination,y=e.state,g=y.pageIndex,m=y.expanded,b=y.globalFilter,v=y.filters,h=y.groupBy,S=y.sortBy,O=e.dispatch,R=e.data,j=e.manualPagination,P=e.rowCount;x(u,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var E=I(n);N((function(){E()&&O({type:w.resetPage})}),[O,j?null:R,b,v,h,S]);var C,A=p?t.length:e.state.pageSize;C=j?null!=P&&P>=0?Math.ceil(P/A):l:Math.ceil(t.length/A);var k=a().useMemo((function(){return C>0?(e=new Array(C),function(e){if(Array.isArray(e))return Ii(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ai(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).fill(null).map((function(e,t){return t})):[];var e}),[C]),B=a().useMemo((function(){var e;if(j)e=t;else{var r=A*g,n=r+A;e=t.slice(r,n)}var o=e.length;return s?[e,o]:[Gi(e,{manualExpandedKey:i,expanded:m,expandSubRows:d}),o]}),[d,m,i,j,g,A,s,t]),F=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,u=[],l=!0,c=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(u.push(n.value),u.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(c)throw o}}return u}}(e,t)||Ai(e,t)||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.")}()}(B,2),T=F[0],D=F[1],G=g>0,z=-1===C?T.length>=A:g1&&void 0!==arguments[1])||arguments[1];t.isExpanded=t.original&&t.original[r]||n[t.id],t.canExpand=t.subRows&&!!t.subRows.length,o&&a.push(t),t.subRows&&t.subRows.length&&t.isExpanded&&t.subRows.forEach((function(t){return e(t,i)}))};return e.forEach((function(e){return u(e)})),a}function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mi(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=new Array(t);re.length)&&(t=e.length);for(var r=0,n=new Array(t);rt)&&(t=e)})),t},min:function(e){var t;return e.forEach((function(e){(null==t||e1?" (".concat(t[e],")"):"")})).join(", ")}};function Xi(e,t){return"numeric"===t&&Ki[e]?Ki[e]:Ji[e]}function qi(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3;if(!Number.isFinite(e))return e;t=t>0?t:0;var r=Math.pow(10,t);return Math.sign(e)*Math.round(Math.abs(e)*r)/r}function Zi(e){return e.filter((function(e){return null!=e&&!Number.isNaN(e)}))}function Yi(e){return Yi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yi(e)}var Qi=["html","className"];function ea(){return ea=Object.assign?Object.assign.bind():function(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function ia(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&(a[ua]=pa(e.subRows)),a}))}function ya(e){var t=e.html,r=e.className,n=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,Qi);return a().createElement("div",ea({className:Gn("rt-text-content",r),dangerouslySetInnerHTML:{__html:t}},n))}function ga(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.sortable,o=r.defaultSortDesc,u=r.showSortIcon,l=r.showSortable,c=r.filterable,s=r.resizable;return e=e.map((function(e){var t=ra({},e);t.accessor=function(e){return e[t.id]},"string"==typeof t.aggregate&&(t.aggregate=Xi(t.aggregate,t.type));var r=ba({type:t.type,naLast:t.sortNALast});t.sortType=function(e,t,n,o){return r(e.values[n],t.values[n],o)},t.sortable=zn(t.sortable,n),t.disableSortBy=!t.sortable,t.defaultSortDesc=zn(t.defaultSortDesc,o),t.sortDescFirst=t.defaultSortDesc,t.filterable=zn(t.filterable,c),t.disableFilters=!t.filterable,!1===t.searchable&&(t.disableGlobalFilter=!0),!1===t.show&&!0!==t.searchable&&(t.disableGlobalFilter=!0),"numeric"===t.type?t.createMatcher=ha:t.createMatcher=wa,t.filter=function(e,r,n){var o=r[0];if("function"==typeof t.filterMethod)return t.filterMethod(e,o,n);var i=t.createMatcher(n);return e.filter((function(e){var t=e.values[o];return i(t)}))},"numeric"===t.type?t.align=t.align||"right":t.align=t.align||"left",t.vAlign=t.vAlign||"top",t.headerVAlign=t.headerVAlign||"top";var f=t.width,d=t.minWidth,p=t.maxWidth;t.minWidth=zn(f,d,100),t.maxWidth=zn(f,p,Number.MAX_SAFE_INTEGER),t.minWidth=Math.min(t.minWidth,t.maxWidth),t.width=t.minWidth,t.resizable=zn(t.resizable,s),t.minWidth===t.maxWidth&&(t.resizable=!1),t.disableResizing=!t.resizable,t.Cell=function(e,r){var n=e.value,o=null==n||Number.isNaN(n);return o&&(n=t.na),!o&&t.format&&t.format.cell&&(n=va(n,t.format.cell)),t.cell&&("function"==typeof t.cell&&(n=t.cell(ra(ra({},e),{},{value:n}),r)),Array.isArray(t.cell)&&!e.aggregated&&(n=t.cell[e.index])&&(n=(0,cr.hydrate)({Fragment:i.Fragment,WidgetContainer:So},n))),null!=n&&""!==n||(n=aa),a().isValidElement(n)?n:t.html?a().createElement(ya,{style:{display:"inline"},html:n}):String(n)},t.grouped?t.Grouped=function(e,r){var n=e.value,o=null==n||Number.isNaN(n);return o&&(n=t.na),!o&&t.format&&t.format.cell&&(n=va(n,t.format.cell)),null!=(n=t.grouped(ra(ra({},e),{},{value:n}),r))&&""!==n||(n=aa),a().isValidElement(n)?n:t.html?a().createElement(ya,{style:{display:"inline"},html:n}):String(n)}:t.Grouped=function(e,r){var n=t.Cell(e,r);return a().createElement(a().Fragment,null,n,e.subRows&&" (".concat(e.subRows.length,")"))},t.Aggregated=function(e,r){var n,o=e.value;if(null!=o&&t.format&&t.format.aggregated&&(o=va(o,t.format.aggregated)),t.aggregated&&(o=t.aggregated(ra(ra({},e),{},{value:o}),r)),null==o&&(o=""),a().isValidElement(o))n=o;else{if(t.html)return a().createElement(ya,{html:o});n=String(o)}return n},t.Header=function(e,r){var n,o=t.name;if(null!=t.header&&(o="function"==typeof t.header?t.header(e,r):(0,cr.hydrate)({Fragment:i.Fragment,WidgetContainer:So},t.header)),n=a().isValidElement(o)?o:t.html?a().createElement(ya,{html:o}):null!=o?String(o):"",t.sortable&&u){var c=l?"rt-sort":"";return n=t.html?n:a().createElement("div",{className:"rt-text-content"},n),"right"===t.align?a().createElement("div",{className:"rt-sort-header"},a().createElement("span",{className:Gn(c,"rt-sort-left"),"aria-hidden":"true"}),n):a().createElement("div",{className:"rt-sort-header"},n,a().createElement("span",{className:Gn(c,"rt-sort-right"),"aria-hidden":"true"}))}return n},null!=t.footer?t.Footer=function(e,r){var n;return n="function"==typeof t.footer?t.footer(e,r):(0,cr.hydrate)({Fragment:i.Fragment,WidgetContainer:So},t.footer),a().isValidElement(n)?n:t.html?a().createElement(ya,{html:n}):null!=n?String(n):""}:t.Footer=aa;var y=Sa(t.align),g=Oa(t.vAlign),m=Oa(t.headerVAlign);return t.headerClassName=Gn(y,m,t.headerClassName),t.footerClassName=Gn(y,g,t.footerClassName),t.getProps=function(e,r,n){var o,i,a={className:Gn(y,g)};return t.className&&(o="function"==typeof t.className?t.className(e,r,n):Array.isArray(t.className)?t.className[e.index]:t.className,a.className=Gn(a.className,o)),t.style&&(i="function"==typeof t.style?t.style(e,r,n):Array.isArray(t.style)?t.style[e.index]:t.style,a.style=i),a},t})),t&&(e=ma(e,t)).forEach((function(e,t){e.id="group_".concat(t),null!=e.name||null!=e.header?e.Header=function(t,r){var n=e.name;return e.header&&(n="function"==typeof e.header?e.header(t,r):(0,cr.hydrate)({Fragment:i.Fragment,WidgetContainer:So},e.header)),a().isValidElement(n)?n:e.html?a().createElement(ya,{html:n}):null!=n?String(n):""}:e.Header=aa,Hn(e).every((function(e){return e.disableResizing}))&&(e.disableResizing=!0),e.align=e.align||"center",e.headerVAlign=e.headerVAlign||"top";var r=Sa(e.align),n=Oa(e.headerVAlign);e.headerClassName=Gn(r,n,e.headerClassName)})),e}function ma(e,t){t.forEach((function(t){var r=(t=ra({},t)).columns;t.columns=[],e=e.reduce((function(e,n){return n.id===r[0]?(e.push(t),t.columns.push(n)):r.includes(n.id)?t.columns.push(n):e.push(n),e}),[])}));var r,n=[];return e.forEach((function(e){e.columns?(n.push(e),r=null):(r||(r={columns:[],isUngrouped:!0},n.push(r)),r.columns.push(e))})),e=n}function ba(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.type,r=e.naLast;return function(e,n,o){return"numeric"===t?(e=Number.isNaN(e)?null:e,n=Number.isNaN(n)?null:n):(e="string"==typeof e?e.toLowerCase():e,n="string"==typeof n?n.toLowerCase():n),e===n?0:null==e?r?o?-1:1:-1:null==n?r?o?1:-1:1:e>n?1:e=e.length?{done:!0}:{done:!1,value:e[n++]}},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,a=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){u=!0,i=e},f:function(){try{a||null==r.return||r.return()}finally{if(u)throw i}}}}function $a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ua(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}var iu={};function au(e){if(!e)throw new Error("A reactable table ID must be provided");var t=iu[e];if(!t)throw new Error("reactable instance '".concat(e,"' not found"));return t()}function uu(e){return au(e).state}function lu(e,t,r){au(e).setFilter(t,r)}function cu(e,t){au(e).setAllFilters(t)}function su(e,t){au(e).setGlobalFilter(t)}function fu(e,t,r){au(e).toggleGroupBy(t,r)}function du(e,t){au(e).setGroupBy(t)}function pu(e,t){au(e).toggleAllRowsExpanded(t)}function yu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"data.csv",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};au(e).downloadDataCSV(t,r)}function gu(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return au(e).getDataCSV(t)}function mu(e,t){au(e).setMeta(t)}function bu(e,t,r){au(e).toggleHideColumn(t,r)}function vu(e,t){au(e).setHiddenColumns(t)}function hu(e,t,r){au(e).setData(t,r)}function wu(e,t){return au(e).onStateChange(t)}function Su(e,t){au(e).gotoPage(t)}function Ou(e,t){au(e).setPageSize(t)}function Ru(e){var t=e.data,r=e.columns,n=e.columnGroups,o=e.sortable,i=e.defaultSortDesc,u=e.showSortIcon,l=e.showSortable,c=e.filterable,s=e.resizable,f=e.theme,d=e.language,p=e.dataKey,y=ou(e,Ra);for(var g in t=ca(t,r),r=ga(r,n,{sortable:o,defaultSortDesc:i,showSortIcon:u,showSortable:l,filterable:c,resizable:s}),f=function(e){if(!e)return null;var t=e.color,r=e.backgroundColor,n=e.borderColor,o=e.borderWidth,i=e.stripedColor,a=e.highlightColor,u=e.cellPadding,l=e.style,c=e.tableBorderColor,s=void 0===c?n:c,f=e.tableBorderWidth,d=void 0===f?o:f,p=e.tableStyle,y=e.headerBorderColor,g=void 0===y?n:y,m=e.headerBorderWidth,b=void 0===m?o:m,v=e.headerStyle,h=e.groupHeaderBorderColor,w=void 0===h?n:h,S=e.groupHeaderBorderWidth,O=void 0===S?o:S,R=e.groupHeaderStyle,j=e.tableBodyStyle,P=e.rowGroupStyle,E=e.rowStyle,C=e.rowStripedStyle,x=e.rowHighlightStyle,A=e.rowSelectedStyle,I=e.cellBorderColor,k=void 0===I?n:I,N=e.cellBorderWidth,B=void 0===N?o:N,F=e.cellStyle,T=e.footerBorderColor,D=void 0===T?n:T,G=e.footerBorderWidth,z=void 0===G?o:G,M=e.footerStyle,W=e.inputStyle,H=e.filterInputStyle,_=e.searchInputStyle,L=e.selectStyle,V=e.paginationStyle,$=e.pageButtonStyle,U=e.pageButtonHoverStyle,K=e.pageButtonActiveStyle,J=e.pageButtonCurrentStyle,X=Zn([F,E,j,p,l],"color",t),q=Zn([L,l],"color",t);b=Zn([v],"borderWidth",b);var Z,Y={style:Xn({color:t,backgroundColor:r},l),tableStyle:Xn({borderColor:s,borderWidth:d},p),headerStyle:Xn(Xn({borderColor:g,borderWidth:b,padding:u},v),{},{".rt-bordered &, .rt-outlined &":{borderWidth:b}}),groupHeaderStyle:Xn(Xn({borderColor:w,borderWidth:O,padding:u},R),{},{"&::after":{backgroundColor:w,height:O},".rt-bordered &":{borderWidth:O}}),tableBodyStyle:j,rowGroupStyle:P,rowStyle:Xn(Xn({},E),{},{"&.rt-tr-striped":Xn({backgroundColor:i},C),"&.rt-tr-highlight:hover":Xn({backgroundColor:a},x),"&.rt-tr-selected":Xn({},A)}),cellStyle:Xn({borderColor:k,borderWidth:B,padding:u},F),footerStyle:Xn({borderColor:D,borderWidth:z,padding:u},M),filterCellStyle:Xn({borderColor:k,borderWidth:B,padding:u},F),expanderStyle:{"&::after":{borderTopColor:X}},filterInputStyle:Xn(Xn({},W),H),searchInputStyle:Xn(Xn({},W),_),paginationStyle:Xn(Xn({borderTopColor:k,borderTopWidth:B},V),{},{".rt-page-jump":Xn({},W),".rt-page-size-select":Xn(Xn({},L),{},{"@supports (-moz-appearance: none)":{backgroundImage:q&&'url(\'data:image/svg+xml;charset=US-ASCII,'+'\')')}}),".rt-page-button":Xn({},$),".rt-page-button:not(:disabled):hover":Xn({},U),".rt-page-button:not(:disabled):active":Xn({},K),".rt-keyboard-active & .rt-page-button:not(:disabled):focus":Xn({},U),".rt-page-button-current":Xn({},J)})};return Mn(Y),Y}(f)||{},d=tu(tu({},to),d))d[g]=d[g]||null;return a().createElement($u,Qa({data:t,columns:r,theme:f,language:d,key:p},y))}function ju(e){var t=JSON.stringify(e);return a().useMemo((function(){return e}),[t])}function Pu(e){var t=e.data,r=e.columns,n=e.columnGroups,o=e.sortable,i=e.defaultSortDesc,u=e.showSortIcon,l=e.showSortable,c=e.filterable,s=e.resizable,f=e.sortBy,d=e.filters,p=e.searchValue,y=e.groupBy,g=e.expanded,m=e.selectedRowIds,b=ou(e,ja);return t=a().useMemo((function(){return ca(t,r)}),[]),r=a().useMemo((function(){return ga(r,n,{sortable:o,defaultSortDesc:i,showSortIcon:u,showSortable:l,filterable:c,resizable:s})}),[]),f=ju(f||[]),d=ju(d||[]),y=ju(y||[]),g=ju(g||{}),m=ju(m||{}),a().createElement(Vu,Qa({data:t,columns:r,sortBy:f,filters:d,searchValue:p,groupBy:y,expanded:g,selectedRowIds:m},b))}var Eu=a().forwardRef((function(e,t){var r=e.className,n=ou(e,Pa);return a().createElement("div",Qa({ref:t,className:Gn("Reactable","ReactTable",r)},n))})),Cu=a().forwardRef((function(e,t){var r=e.className,n=ou(e,Ea);return a().createElement("div",Qa({ref:t,className:Gn("rt-table",r),role:"table"},n))}));function xu(e){var t=e.className,r=ou(e,Ca);return a().createElement("div",Qa({className:Gn("rt-thead",t),role:"rowgroup"},r))}function Au(e){var t=e.className,r=ou(e,xa);return a().createElement("div",Qa({className:Gn("rt-tbody",t),role:"rowgroup"},r))}function Iu(e){var t=e.className,r=ou(e,Aa);return a().createElement("div",Qa({className:Gn("rt-tfoot",t),role:"rowgroup"},r))}function ku(e){var t=e.className,r=ou(e,Ia);return a().createElement("div",Qa({className:Gn("rt-tr-group",t)},r))}function Nu(e){var t=e.className,r=ou(e,ka);return a().createElement("div",Qa({className:Gn("rt-tr",t),role:"row"},r))}var Bu=a().forwardRef((function(e,t){var r=e.canSort,n=e.sortDescFirst,o=e.isSorted,i=e.isSortedDesc,u=e.toggleSortBy,l=e.canResize,c=e.isResizing,s=e.className,f=e.innerClassName,d=e.children,p=ou(e,Na),y=qa(a().useState(!1),2),g=y[0],m=y[1];if(r){var b=o?i?"descending":"ascending":"none",v=n?"descending":"ascending",h=function(e){var t=o?!i:n;e&&(t=null),u&&u(t,e)};p=tu(tu({},p),{},{"aria-sort":b,tabIndex:"0",onClick:function(e){g||h(e.shiftKey)},onKeyPress:function(e){var t=e.which||e.keyCode;13!==t&&32!==t||h(e.shiftKey)},onMouseUp:function(){m(!!c)},onMouseDown:function(e){(e.detail>1||e.shiftKey)&&e.preventDefault()},"data-sort-hint":o?null:v})}return a().createElement("div",Qa({className:Gn("rt-th",l&&"rt-th-resizable",s),role:"columnheader",ref:t},p),a().createElement("div",{className:Gn("rt-th-inner",f)},d))}));function Fu(e){var t=e.className,r=e.innerClassName,n=e.children,o=ou(e,Ba);return a().createElement("div",Qa({className:Gn("rt-td",t),role:"cell"},o),a().createElement("div",{className:Gn("rt-td-inner",r)},n))}function Tu(e){if(!e)return{};if(null!=e.padding){var t=e.padding;return{className:Qn(ou(e,Fa)),innerClassName:Qn({padding:t})}}return{className:Qn(e)}}function Du(e){var t=e.onMouseDown,r=e.onTouchStart,n=e.className,o=ou(e,Ta);return a().createElement("div",Qa({className:Gn("rt-resizer",n),onMouseDown:t,onTouchStart:r,"aria-hidden":!0},o))}var Gu,zu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ka(e,t)}(u,e);var t,r,n,o,i=(n=u,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=Xa(n);if(o){var r=Xa(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return Ja(this,e)});function u(){return $a(this,u),i.apply(this,arguments)}return t=u,(r=[{key:"componentDidMount",value:function(){window.Shiny&&window.Shiny.bindAll&&window.Shiny.bindAll(this.el)}},{key:"componentWillUnmount",value:function(){window.Shiny&&window.Shiny.unbindAll&&window.Shiny.unbindAll(this.el)}},{key:"render",value:function(){var e=this,t=this.props,r=t.children,n=t.html,o={ref:function(t){return e.el=t}};return o=tu(tu({},o),{},n?{dangerouslySetInnerHTML:{__html:n}}:{children:r}),a().createElement("div",Qa({className:"rt-tr-details"},o))}}])&&Ua(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),u}(a().Component);function Mu(e){var t=e.isExpanded,r=e.className,n=e["aria-label"];return a().createElement("button",{className:"rt-expander-button","aria-label":n,"aria-expanded":t?"true":"false"},a().createElement("span",{className:Gn("rt-expander",t&&"rt-expander-open",r),tabIndex:"-1","aria-hidden":"true"},"​"))}function Wu(e){var t=e.filterValue,r=e.setFilter,n=e.className,o=e.placeholder,i=e["aria-label"];return a().createElement("input",{type:"text",className:Gn("rt-filter",n),value:t||"",onChange:function(e){return r(e.target.value||void 0)},placeholder:o,"aria-label":i})}function Hu(e){var t=e.searchValue,r=e.setSearch,n=e.className,o=e.placeholder,i=e["aria-label"];return a().createElement("input",{type:"text",value:t||"",onChange:function(e){return r(e.target.value||void 0)},className:Gn("rt-search",n),placeholder:o,"aria-label":i})}function _u(e){var t=e.className,r=ou(e,Da);return a().createElement("div",Qa({className:Gn("rt-no-data",t),"aria-live":"assertive"},r))}function Lu(e){var t=e.type,r=e.checked,n=e.onChange,o=e["aria-label"];return a().createElement("div",{className:"rt-select"},a().createElement("input",{type:t,checked:r,onChange:n,className:"rt-select-input","aria-label":o}),"​")}function Vu(e){var t=e.data,r=e.columns,n=e.groupBy,o=e.searchMethod,i=e.pagination,u=e.paginateSubRows,l=e.selection,c=e.crosstalkGroup,s=e.crosstalkId,f=e.setResolvedData,d=e.pageSize,p=e.pageIndex,y=e.sortBy,g=e.filters,m=e.searchValue,b=e.expanded,v=e.selectedRowIds,h=a().useMemo((function(){return r.reduce((function(e,t){return e.concat(Hn(t))}),[])}),[r]),w=a().useMemo((function(){return o||function(e,t,r){var n=h.reduce((function(e,t){return e[t.id]=t.createMatcher(r),e}),{});return e.filter((function(e){var r,o=Va(t);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=e.values[i];if(n[i](a))return!0}}catch(e){o.e(e)}finally{o.f()}}))}}),[h,o]),S=He({columns:r,data:t,useControlledState:function(e){return a().useMemo((function(){return tu(tu({},e),{},{pageIndex:p,pageSize:d,sortBy:y,filters:g,globalFilter:m,groupBy:n,expanded:b,selectedRowIds:v})}),[e,p,d,y,g,m,n,b,v])},globalFilter:w,paginateExpandedRows:!!u,disablePagination:!i,getSubRows:la,manualExpandedKey:null,autoResetGroupBy:!1,autoResetSortBy:!1,autoResetExpanded:!1,autoResetFilters:!1,autoResetGlobalFilter:!1,autoResetSelectedRows:!1,autoResetResize:!1,autoResetPage:!0},fi,Oo,Bo,vt,Ct,Xo,or,Xe,Fi,wi,(function(e){l&&e.visibleColumns.push((function(e){return[tu(tu({},e.find((function(e){return e.selectable}))),{},{selectable:!0,disableSortBy:!0,filterable:!1,disableFilters:!0,disableGlobalFilter:!0})].concat(La(e.filter((function(e){return!e.selectable}))))}))}),(function(e){c&&(e.visibleColumns.push((function(e){var t={id:s,filter:function(e,t,r){return r?e.filter((function(e){if(r.includes(e.index))return!0})):e},disableGlobalFilter:!0};return e.concat(t)})),e.stateReducers.push((function(e){return e.hiddenColumns.includes(s)?e:tu(tu({},e),{},{hiddenColumns:e.hiddenColumns.concat(s)})})))})),O=a().useRef(u?S.flatRows.length:S.rows.length);return a().useEffect((function(){O.current=0}),[t]),a().useEffect((function(){var e=u?S.flatRows.length:S.rows.length;e>O.current&&(O.current=e)}),[u,S.flatRows,S.rows]),f&&f({data:pa(S.page,u),rowCount:S.rows.length,maxRowCount:O.current}),null}function $u(e){var t=e.data,r=e.columns,n=e.groupBy,o=e.searchable,u=e.searchMethod,l=e.defaultSorted,c=e.pagination,s=e.paginationType,f=e.showPagination,d=e.showPageSizeOptions,p=e.showPageInfo,y=e.defaultPageSize,g=e.pageSizeOptions,m=e.minRows,b=e.paginateSubRows,v=e.defaultExpanded,h=e.selection,w=e.defaultSelected,S=e.selectionId,O=e.onClick,R=e.outlined,j=e.bordered,P=e.borderless,E=e.compact,C=e.nowrap,x=e.striped,A=e.highlight,B=e.className,F=e.style,T=e.rowClassName,D=e.rowStyle,G=e.inline,z=e.width,M=e.height,W=e.theme,H=e.language,_=e.meta,L=e.crosstalkKey,V=e.crosstalkGroup,$=e.crosstalkId,U=e.elementId,K=e.nested,J=e.dataURL,X=e.serverRowCount,q=e.serverMaxRowCount,Z=qa(a().useState(null),2),Y=Z[0],Q=Z[1],ee=a().useMemo((function(){return Y||t}),[Y,t]),te=null!=J,re=qa(a().useState(X),2),ne=re[0],oe=re[1],ie=qa(a().useState(q),2),ae=ie[0],ue=ie[1],le=a().useMemo((function(){return r.reduce((function(e,t){return e.concat(Hn(t))}),[])}),[r]),ce=a().useMemo((function(){return u||function(e,t,r){var n=le.reduce((function(e,t){return e[t.id]=t.createMatcher(r),e}),{});return e.filter((function(e){var r,o=Va(t);try{for(o.s();!(r=o.n()).done;){var i=r.value,a=e.values[i];if(n[i](a))return!0}}catch(e){o.e(e)}finally{o.f()}}))}}),[le,u]),se=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=_i(a().useState(e),2),r=t[0],n=t[1],o=function(e){if(null!=e){if("object"!==Hi(e)&&"function"!=typeof e)throw new Error("meta must be an object or function");n((function(t){"function"==typeof e&&(e=e(t));for(var r=Mi(Mi({},t),e),n=0,o=Object.entries(r);nIe.current&&(Ie.current=e)}),[b,be.flatRows,be.rows]);var ke=a().useRef(null),Ne={onMouseDown:function(){ke.current.classList.remove("rt-keyboard-active")},onKeyDown:function(){ke.current.classList.add("rt-keyboard-active")},onKeyUp:function(e){9===(e.which||e.keyCode)&&ke.current.classList.add("rt-keyboard-active")}},Be=a().useRef(null),Fe=qa(a().useState(!1),2),Te=Fe[0],De=Fe[1];k((function(){var e=function(){var e=Be.current,t=e.scrollHeight,r=e.clientHeight,n=e.scrollWidth,o=e.clientWidth;De(t>r||n>o)};if(window.ResizeObserver){var t=new ResizeObserver((function(){e()}));return t.observe(Be.current),function(){t.disconnect()}}e()}),[]),a().useEffect((function(){if(window.Shiny&&window.Shiny.onInputChange&&!K){var e=ke.current.parentElement.getAttribute("data-reactable-output");if(e){var t,r=Re.selected.map((function(e){return e+1})),n=Re.page+1,o=Re.sorted.length>0?{}:null,i=Va(Re.sorted);try{for(i.s();!(t=i.n()).done;){var a=t.value;o[a.id]=a.desc?"desc":"asc"}}catch(e){i.e(e)}finally{i.f()}var u={page:n,pageSize:Re.pageSize,pages:Re.pages,sorted:o,selected:r};Object.keys(u).forEach((function(t){window.Shiny.onInputChange("".concat(e,"__reactable__").concat(t),u[t])}))}}}),[K,Re.page,Re.pageSize,Re.pages,Re.sorted,Re.selected]);var Ge=I(be.pageCount);a().useEffect((function(){if(window.Shiny&&!K){var e=ke.current.parentElement.getAttribute("data-reactable-output");if(e){var t=be.setRowsSelected,r=be.gotoPage,n=be.toggleAllRowsExpanded;window.Shiny.addCustomMessageHandler("__reactable__".concat(e),(function(e){if(e.jsEvals){var o,i=Va(e.jsEvals);try{for(i.s();!(o=i.n()).done;){var a=o.value;window.HTMLWidgets.evaluateStringMember(e,a)}}catch(e){i.e(e)}finally{i.f()}}if(null!=e.data){var u=ca(e.data,le);Q(u)}if(null!=e.selected){var l=e.selected.map((function(e){return String(e)}));t(l)}if(null!=e.page){var c=Math.min(Math.max(e.page,0),Math.max(Ge()-1,0));r(c)}null!=e.expanded&&(e.expanded?n(!0):n(!1)),void 0!==e.meta&&pe(e.meta)}))}}}),[K,be.setRowsSelected,be.gotoPage,be.toggleAllRowsExpanded,le,Ge,pe]);var ze=a().useRef(null);k((function(){if(V&&window.crosstalk){var e={};e.selection=new window.crosstalk.SelectionHandle(V),e.filter=new window.crosstalk.FilterHandle(V),e.selected=e.selection.value,e.filtered=e.filter.filteredKeys,ze.current=e;var t=(L||[]).reduce((function(e,t,r){return e[t]=r,e}),{}),r=be.setFilter,n=be.setRowsSelected,o=function(){var n,o=e.selected&&e.selected.length>0?e.selected:null,i=e.filtered,a=(n=o||i?o?i?o.filter((function(e){return i.includes(e)})):o:i:null)?n.map((function(e){return t[e]})):null;r($,a)},i=function(t){e.selected!==t&&(e.selected=t,o())};return e.selection.on("change",(function(t){t.sender!==e.selection?(i(t.value),e.skipNextSelection=!0,n([])):i(null)})),e.filter.on("change",(function(t){var r;t.sender!==e.filter&&(r=t.value,e.filtered!==r&&(e.filtered=r,o()))})),(e.selected||e.filtered)&&o(),function(){try{e.selection.close()}catch(e){console.error("Error closing Crosstalk selection handle:",e)}try{e.filter.close()}catch(e){console.error("Error closing Crosstalk filter handle:",e)}}}}),[L,V,$,be.setFilter,be.setRowsSelected]),k((function(){ze.current&&(w||(ze.current.skipNextSelection=!0))}),[w]),k((function(){if(ze.current&&h){var e=ze.current;if(e.skipNextSelection)e.skipNextSelection=!1;else{var t=Object.keys(me.selectedRowIds).map((function(e){return L[he[e].index]}));try{e.selection.set(t)}catch(e){console.error("Error selecting Crosstalk keys:",e)}}}}),[me.selectedRowIds,he,h,L]),be.state=Re,be.downloadDataCSV=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=e||"data.csv";var r=be.getDataCSV(t);Vn(r,e)},be.getDataCSV=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.columnIds||(e.columnIds=le.map((function(e){return e.id})));var t=ee.length>0?Object.keys(ee[0]):[];e.columnIds=e.columnIds.filter((function(e){return t.includes(e)}));var r=be.preGroupedRows.map((function(e){return e.values})),n=Ln(r,e);return n},be.setMeta=pe;var Me=be.toggleHideColumn;be.toggleHideColumn=function(e,t){t&&Re.hiddenColumns.includes(e)||Me(e,t)},be.setData=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t=Object.assign({resetSelected:!0,resetExpanded:!1},t),"object"!==_a(e)||null==e)throw new Error("data must be an array of row objects or an object containing column arrays");Array.isArray(e)||(e=ca(e,le)),Q(e),t.resetSelected&&be.setRowsSelected([]),t.resetExpanded&&be.toggleAllRowsExpanded(!1)};var We=a().useRef([]);be.onStateChange=function(e){if("function"!=typeof e)throw new Error("listenerFn must be a function");return We.current.push(e),function(){We.current=We.current.filter((function(t){return t!==e}))}};var _e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=a().useRef({}),n=I(e),o=I(t);return a().useCallback((function(){for(var e=arguments.length,t=new Array(e),i=0;i0){var g=function(){return be.toggleAllRowsSelected()};o=tu(tu({},o),{},{onClick:g,className:Gn(o.className,"rt-td-select")}),n=a().createElement(Lu,{type:"checkbox",checked:be.isAllRowsSelected,onChange:g,"aria-label":H.selectAllRowsLabel})}var m=e.getHeaderProps(o),b=m.key,v=ou(m,Ma);return a().createElement(Bu,Qa({key:b},v),n,t)})))})),Pe?a().createElement(Nu,{className:Gn("rt-tr-filters",Qn(W.rowStyle))},be.visibleColumns.map((function(e){var t,r;e.filterable&&(null!=e.filterInput?(r="function"==typeof e.filterInput?e.filterInput(e,Re):(0,cr.hydrate)({Fragment:i.Fragment,WidgetContainer:So},e.filterInput),a().isValidElement(r)?t=r:e.html&&(t=a().createElement(ya,{html:r}))):t=a().createElement(Wu,{filterValue:e.filterValue,setFilter:e.setFilter,className:Qn(W.filterInputStyle),placeholder:H.filterPlaceholder,"aria-label":ro(H.filterLabel,{name:e.name})}));var n=Tu(W.filterCellStyle),o=n.className,u=n.innerClassName,l={role:"cell",colSpan:null,className:Gn("rt-td-filter",e.headerClassName,o),innerClassName:u,style:e.headerStyle},c=e.getHeaderProps(l),s=c.key,f=ou(c,Wa);return a().createElement(Fu,Qa({key:s},f),t)}))):null)),function(){var e,t=be.visibleColumns.some((function(e){return e.sticky})),r=t?"rt-tr-highlight-sticky":"rt-tr-highlight",n=t?"rt-tr-striped-sticky":"rt-tr-striped",o=be.page.map((function(e,t){be.prepareRow(e);var o,u=function(t){null==t&&(t=!e.isSelected),"single"===h&&be.setRowsSelected([]),e.toggleRowSelected(t)},l=tu(tu({},e),{},{toggleRowSelected:u,viewIndex:t,row:e.values,subRows:_n(e.subRows),aggregated:e.isGrouped,expanded:e.isExpanded,level:e.depth,selected:e.isSelected,page:me.pageIndex}),c={className:Gn(x&&(t%2?null:n),A&&r,e.isSelected&&"rt-tr-selected",Qn(W.rowStyle))};T&&(o="function"==typeof T?T(l,Re):Array.isArray(T)?T[l.index]:T,c.className=Gn(c.className,o)),D&&("function"==typeof D?c.style=D(l,Re):Array.isArray(D)?c.style=D[l.index]:c.style=D);var s,f=function(e,t){if(!e.isExpanded||e.isGrouped)return null;var r,n=xe[e.id];if(!(r=null!=n?be.visibleColumns.find((function(e){return e.id===n})):be.visibleColumns.find((function(e){return e.details}))))return null;var o=r,u=o.details,l=o.html,c={};if("function"==typeof u){var s=u(e,t);l&&(c.html=s),c.children=s}else if(Array.isArray(u)){var f=u[e.index];if(null==f)return null;l&&(c.html=f),c.children=(0,cr.hydrate)({Reactable:Ru,Fragment:i.Fragment,WidgetContainer:So},f)}return a().createElement(zu,Qa({key:"".concat(r.id,"_").concat(e.index)},c))}(l,Re);if(e.isExpanded)if(null!=xe[e.id])s=xe[e.id];else{var d=be.visibleColumns.find((function(e){return e.details}));s=d?d.id:null}var p=e.getRowProps(c);return a().createElement(ku,{key:"".concat(e.depth,"_").concat(t),className:Qn(W.rowGroupStyle)},a().createElement(Nu,Qa({},p,{key:void 0}),e.cells.map((function(t,r){var n=t.column,o=n.getProps?n.getProps(l,n,Re):{},i=Tu(W.cellStyle),c=i.className,f=i.innerClassName;o=tu(tu({},o),{},{className:Gn(o.className,c),innerClassName:f,role:n.rowHeader?"rowheader":"cell"});var d,p,y,g=tu(tu({},t),{},{column:n,filterValue:n.filterValue},l);if(d=t.isGrouped?n.Grouped?n.Grouped(g,Re):g.value:t.isAggregated?n.Aggregated?n.Aggregated(g,Re):t.render("Aggregated"):t.isPlaceholder?"":n.Cell?n.Cell(g,Re):t.render("Cell"),n.details&&!e.isGrouped&&(Array.isArray(n.details)&&null==n.details[e.index]||(p=!0)),p){var m=e.isExpanded&&s===n.id;o=tu(tu({},o),{},{onClick:function(){if(m){e.toggleRowExpanded(!1);var t=tu({},xe);delete t[e.id],Ae(t)}else{e.toggleRowExpanded(!0);var r=tu(tu({},xe),{},ru({},e.id,n.id));Ae(r)}},className:Gn(o.className,"rt-td-expandable")}),d===aa&&(o.style=tu({textOverflow:"clip",userSelect:"none"},o.style));var b={isExpanded:m,className:Qn(W.expanderStyle),"aria-label":H.detailsExpandLabel};y=a().createElement(Mu,b)}else if(t.isGrouped){var v=e.isExpanded;o=tu(tu({},o),{},{onClick:function(){return e.toggleRowExpanded()},className:Gn(o.className,"rt-td-expandable")});var w={isExpanded:v,className:Qn(W.expanderStyle),"aria-label":H.groupExpandLabel};y=a().createElement(Mu,w)}else t.column.isGrouped&&e.canExpand&&(o=tu(tu({},o),{},{onClick:function(){return e.toggleRowExpanded()},className:Gn(o.className,"rt-td-expandable")}));var S,R="multiple"===h||"single"===h&&!t.isAggregated;n.selectable&&R&&(o=tu(tu({},o),{},{onClick:function(){return u()},className:Gn(o.className,"rt-td-select")}),S=t.isAggregated?H.selectAllSubRowsLabel:H.selectRowLabel,d=a().createElement(Lu,{type:"multiple"===h?"checkbox":"radio",checked:e.isSelected,onChange:function(){return u()},"aria-label":S})),O&&!o.onClick&&("expand"===O?o.onClick=function(){return e.toggleRowExpanded()}:"select"===O&&R?o.onClick=function(){return u()}:"function"==typeof O&&(o.onClick=function(){return O(l,n,Re)}));var j=t.getCellProps(o);return a().createElement(Fu,Qa({},j,{key:"".concat(r,"_").concat(n.id)}),y,d)}))),f)}));m=m?Math.max(m,1):1;var u=Math.max(m-be.page.length,0);u>0&&(e=La(Array(u)).map((function(e,t){var r,n={className:Gn("rt-tr-pad",Qn(W.rowStyle))};return T&&("function"==typeof T?r=T(void 0,Re):Array.isArray(T)||(r=T),n.className=Gn(n.className,r)),D&&("function"==typeof D?n.style=D(void 0,Re):Array.isArray(D)||(n.style=D)),a().createElement(ku,{key:t,className:Qn(W.rowGroupStyle),"aria-hidden":!0},a().createElement(Nu,n,be.visibleColumns.map((function(e){var r=Tu(W.cellStyle),n=r.className,o=r.innerClassName,i={className:n},u=e.getFooterProps(i),l=u.className,c=u.style;return a().createElement(Fu,{key:"".concat(t,"_").concat(e.id),className:l,innerClassName:o,style:c}," ")}))))})));var l,c=Qn(W.tableBodyStyle);0===be.rows.length?(l=a().createElement(_u,null,H.noData),c=Gn("rt-tbody-no-data",c)):l=a().createElement(_u,null);var s=be.getTableBodyProps({className:c});return a().createElement(Au,s,o,e,l)}(),function(){var e=be.visibleColumns.some((function(e){return null!=e.footer}));if(!e)return null;var t=be.getTfootProps();return a().createElement(Iu,t,a().createElement(Nu,null,be.visibleColumns.map((function(e){var t="function"==typeof(e=tu(tu({},e),{},{column:e,data:Oe})).Footer?e.Footer(e,Re):e.render("Footer"),r=Tu(W.footerStyle),n=r.className,o=r.innerClassName,i={className:Gn("rt-td-footer",e.footerClassName,n),innerClassName:o,style:e.footerStyle,role:e.rowHeader?"rowheader":"cell",colSpan:null},u=e.getFooterProps(i),l=u.key,c=ou(u,Ha);return a().createElement(Fu,Qa({key:l},c),t)}))))}()),function(){if(!1===f)return null;if(!c&&null==f)return null;if(c&&null==f){var e=d?Math.min.apply(Math,[me.pageSize].concat(La(g||[]))):me.pageSize;if((null!=ae?ae:null!=ne?ne:Ie.current)<=e)return null}return a().createElement(yo,{paginationType:s,pageSizeOptions:g,showPageInfo:p,showPageSizeOptions:d,page:me.pageIndex,pages:be.pageCount,pageSize:me.pageSize,pageRowCount:be.pageRowCount,canNext:be.canNextPage,canPrevious:be.canPreviousPage,onPageChange:be.gotoPage,onPageSizeChange:be.setPageSize,rowCount:null!=ne?ne:be.rows.length,theme:W,language:H})}())}Ru.defaultProps={sortable:!0,pagination:!0,defaultPageSize:10,paginationType:"numbers",pageSizeOptions:[10,25,50,100],showPageInfo:!0,minRows:1,showSortIcon:!0,crosstalkId:"__crosstalk__"},Pu.defaultProps=Ru.defaultProps,Gu={Reactable:Ru},window.HTMLWidgets.widget({name:"reactable",type:"output",factory:function(e){return{renderValue:function(t){e.hasAttribute("data-react-ssr")?l().hydrate(s(Gu,t.tag),e):l().render(s(Gu,t.tag),e)},resize:function(){}}}})}();var r=Reactable="undefined"==typeof Reactable?{}:Reactable;for(var n in t)r[n]=t[n];t.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})}(); //# sourceMappingURL=reactable.js.map \ No newline at end of file diff --git a/inst/htmlwidgets/reactable.js.map b/inst/htmlwidgets/reactable.js.map index 5321dd33..a84694f6 100644 --- a/inst/htmlwidgets/reactable.js.map +++ b/inst/htmlwidgets/reactable.js.map @@ -1 +1 @@ -{"version":3,"file":"reactable.js","mappings":"YACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CACR,ECNAF,EAAwB,SAASM,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAR,EAAwB,SAASc,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGf,EAAwB,SAASM,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GACvD,G,g8CCNA,IAAI,EAA+BC,OAAOC,M,SCAtC,EAA+BD,OAAOE,S,mHCiCnC,SAASC,EAAQC,EAAYC,GAClC,GAAmB,iBAARA,EAAkB,OAAOA,EACpC,GAAIA,EAAIC,KAAK,KAAOD,EAAIC,KAAK,GAAGC,gBAAkBH,EAAWC,EAAIC,MAC/D,MAAM,I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yBA,GAAiBrsC,GAASiF,KAAKN,OAClEqsB,MAAOA,EACPlB,SAAUA,GAGf,CAiZIwlB,GAGN,CA0DD/Q,GAAUxS,aAAe,CACvBkO,UAAU,EACVkK,YAAY,EACZc,gBAAiB,GACjBta,eAAgB,UAChBpD,gBAAiB,CAAC,GAAI,GAAI,GAAI,KAC9BsD,cAAc,EACdqa,QAAS,EACT/K,cAAc,EACdmK,YAAa,iBAIf1C,GAAc7V,aAAewS,GAAUxS,alDlwECh2B,GoDNL,CACjCwoC,UAAAA,IpDMA5oC,OAAOu2B,YAAYqjB,OAAO,CACxBt5C,KoDRQ,YpDSRiE,KoDTqB,SpDUrBs1C,QAAS,SAAU/L,GACjB,MAAO,CACLgM,YADK,SACO/5C,GACN+tC,EAAGiM,aAAa,kBAClB75C,IAAAA,QAAiBC,EAAQC,GAAYL,EAAMM,KAAMytC,GAEjD5tC,IAAAA,OAAgBC,EAAQC,GAAYL,EAAMM,KAAMytC,EAEnD,EACDkM,OARK,WAUJ,EAEJ,G","sources":["webpack://Reactable/webpack/bootstrap","webpack://Reactable/webpack/runtime/compat get default export","webpack://Reactable/webpack/runtime/define property getters","webpack://Reactable/webpack/runtime/hasOwnProperty shorthand","webpack://Reactable/webpack/runtime/make namespace object","webpack://Reactable/external var \"window.React\"","webpack://Reactable/external var \"window.ReactDOM\"","webpack://Reactable/./srcjs/reactR.js","webpack://Reactable/./node_modules/react-table/src/publicUtils.js","webpack://Reactable/./node_modules/react-table/src/utils.js","webpack://Reactable/./node_modules/react-table/src/makeDefaultPluginHooks.js","webpack://Reactable/./node_modules/react-table/src/hooks/useColumnVisibility.js","webpack://Reactable/./node_modules/react-table/src/hooks/useTable.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useExpanded.js","webpack://Reactable/./node_modules/react-table/src/filterTypes.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useFilters.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGlobalFilter.js","webpack://Reactable/./node_modules/react-table/src/aggregations.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGroupBy.js","webpack://Reactable/./node_modules/react-table/src/sortTypes.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useSortBy.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/usePagination.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/_UNSTABLE_usePivotColumns.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useRowSelect.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useRowState.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useColumnOrder.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useResizeColumns.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGridLayout.js","webpack://Reactable/external var \"window.reactR\"","webpack://Reactable/./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","webpack://Reactable/./node_modules/stylis/src/Utility.js","webpack://Reactable/./node_modules/stylis/src/Tokenizer.js","webpack://Reactable/./node_modules/stylis/src/Enum.js","webpack://Reactable/./node_modules/stylis/src/Serializer.js","webpack://Reactable/./node_modules/stylis/src/Prefixer.js","webpack://Reactable/./node_modules/stylis/src/Parser.js","webpack://Reactable/./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","webpack://Reactable/./node_modules/stylis/src/Middleware.js","webpack://Reactable/./node_modules/@emotion/hash/dist/emotion-hash.esm.js","webpack://Reactable/./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","webpack://Reactable/./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","webpack://Reactable/./node_modules/@emotion/serialize/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","webpack://Reactable/./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","webpack://Reactable/./node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js","webpack://Reactable/./srcjs/theme.js","webpack://Reactable/./srcjs/utils.js","webpack://Reactable/./srcjs/language.js","webpack://Reactable/./srcjs/Pagination.js","webpack://Reactable/./srcjs/WidgetContainer.js","webpack://Reactable/./srcjs/useFlexLayout.js","webpack://Reactable/./srcjs/useStickyColumns.js","webpack://Reactable/./srcjs/useGroupBy.js","webpack://Reactable/./srcjs/useResizeColumns.js","webpack://Reactable/./srcjs/useRowSelect.js","webpack://Reactable/./srcjs/usePagination.js","webpack://Reactable/./srcjs/aggregators.js","webpack://Reactable/./srcjs/columns.js","webpack://Reactable/./srcjs/Reactable.js","webpack://Reactable/./srcjs/useMeta.js","webpack://Reactable/./srcjs/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window.React;","var __WEBPACK_NAMESPACE_OBJECT__ = window.ReactDOM;","/*\n * Adapted from reactR 0.4.4 (https://github.com/react-R/reactR/blob/v0.4.4/srcjs/widget.js)\n * Copyright 2018 Kent Russell\n * Licensed under MIT (https://github.com/react-R/reactR/blob/v0.4.4/LICENSE)\n */\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\n// Modified reactWidget() that additionally supports hydration of server-rendered markup.\nexport function reactWidget(name, type, components) {\n window.HTMLWidgets.widget({\n name: name,\n type: type,\n factory: function (el) {\n return {\n renderValue(value) {\n if (el.hasAttribute('data-react-ssr')) {\n ReactDOM.hydrate(hydrate(components, value.tag), el)\n } else {\n ReactDOM.render(hydrate(components, value.tag), el)\n }\n },\n resize() {\n // resize() is required, but unused\n }\n }\n }\n })\n}\n\n// Must be bundled because react-tools.js needs to be run in a browser context\n// and can't be sourced at runtime in V8.\nexport function hydrate(components, tag) {\n if (typeof tag === 'string') return tag\n if (tag.name[0] === tag.name[0].toUpperCase() && !components[tag.name]) {\n throw new Error('Unknown component: ' + tag.name)\n }\n const elem = components[tag.name] || tag.name\n const args = [elem, tag.attribs]\n for (let child of tag.children) {\n args.push(hydrate(components, child))\n }\n return React.createElement(...args)\n}\n","import React from 'react'\n\nlet renderErr = 'Renderer Error ☝️'\n\nexport const actions = {\n init: 'init',\n}\n\nexport const defaultRenderer = ({ value = '' }) => value;\nexport const emptyRenderer = () => <> ;\n\nexport const defaultColumn = {\n Cell: defaultRenderer,\n width: 150,\n minWidth: 0,\n maxWidth: Number.MAX_SAFE_INTEGER,\n}\n\nfunction mergeProps(...propList) {\n return propList.reduce((props, next) => {\n const { style, className, ...rest } = next\n\n props = {\n ...props,\n ...rest,\n }\n\n if (style) {\n props.style = props.style\n ? { ...(props.style || {}), ...(style || {}) }\n : style\n }\n\n if (className) {\n props.className = props.className\n ? props.className + ' ' + className\n : className\n }\n\n if (props.className === '') {\n delete props.className\n }\n\n return props\n }, {})\n}\n\nfunction handlePropGetter(prevProps, userProps, meta) {\n // Handle a lambda, pass it the previous props\n if (typeof userProps === 'function') {\n return handlePropGetter({}, userProps(prevProps, meta))\n }\n\n // Handle an array, merge each item as separate props\n if (Array.isArray(userProps)) {\n return mergeProps(prevProps, ...userProps)\n }\n\n // Handle an object by default, merge the two objects\n return mergeProps(prevProps, userProps)\n}\n\nexport const makePropGetter = (hooks, meta = {}) => {\n return (userProps = {}) =>\n [...hooks, userProps].reduce(\n (prev, next) =>\n handlePropGetter(prev, next, {\n ...meta,\n userProps,\n }),\n {}\n )\n}\n\nexport const reduceHooks = (hooks, initial, meta = {}, allowUndefined) =>\n hooks.reduce((prev, next) => {\n const nextValue = next(prev, meta)\n if (process.env.NODE_ENV !== 'production') {\n if (!allowUndefined && typeof nextValue === 'undefined') {\n console.info(next)\n throw new Error(\n 'React Table: A reducer hook ☝️ just returned undefined! This is not allowed.'\n )\n }\n }\n return nextValue\n }, initial)\n\nexport const loopHooks = (hooks, context, meta = {}) =>\n hooks.forEach(hook => {\n const nextValue = hook(context, meta)\n if (process.env.NODE_ENV !== 'production') {\n if (typeof nextValue !== 'undefined') {\n console.info(hook, nextValue)\n throw new Error(\n 'React Table: A loop-type hook ☝️ just returned a value! This is not allowed.'\n )\n }\n }\n })\n\nexport function ensurePluginOrder(plugins, befores, pluginName, afters) {\n if (process.env.NODE_ENV !== 'production' && afters) {\n throw new Error(\n `Defining plugins in the \"after\" section of ensurePluginOrder is no longer supported (see plugin ${pluginName})`\n )\n }\n const pluginIndex = plugins.findIndex(\n plugin => plugin.pluginName === pluginName\n )\n\n if (pluginIndex === -1) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(`The plugin \"${pluginName}\" was not found in the plugin list!\nThis usually means you need to need to name your plugin hook by setting the 'pluginName' property of the hook function, eg:\n\n ${pluginName}.pluginName = '${pluginName}'\n`)\n }\n }\n\n befores.forEach(before => {\n const beforeIndex = plugins.findIndex(\n plugin => plugin.pluginName === before\n )\n if (beforeIndex > -1 && beforeIndex > pluginIndex) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `React Table: The ${pluginName} plugin hook must be placed after the ${before} plugin hook!`\n )\n }\n }\n })\n}\n\nexport function functionalUpdate(updater, old) {\n return typeof updater === 'function' ? updater(old) : updater\n}\n\nexport function useGetLatest(obj) {\n const ref = React.useRef()\n ref.current = obj\n\n return React.useCallback(() => ref.current, [])\n}\n\n// SSR has issues with useLayoutEffect still, so use useEffect during SSR\nexport const safeUseLayoutEffect =\n typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport function useMountedLayoutEffect(fn, deps) {\n const mountedRef = React.useRef(false)\n\n safeUseLayoutEffect(() => {\n if (mountedRef.current) {\n fn()\n }\n mountedRef.current = true\n // eslint-disable-next-line\n }, deps)\n}\n\nexport function useAsyncDebounce(defaultFn, defaultWait = 0) {\n const debounceRef = React.useRef({})\n\n const getDefaultFn = useGetLatest(defaultFn)\n const getDefaultWait = useGetLatest(defaultWait)\n\n return React.useCallback(\n async (...args) => {\n if (!debounceRef.current.promise) {\n debounceRef.current.promise = new Promise((resolve, reject) => {\n debounceRef.current.resolve = resolve\n debounceRef.current.reject = reject\n })\n }\n\n if (debounceRef.current.timeout) {\n clearTimeout(debounceRef.current.timeout)\n }\n\n debounceRef.current.timeout = setTimeout(async () => {\n delete debounceRef.current.timeout\n try {\n debounceRef.current.resolve(await getDefaultFn()(...args))\n } catch (err) {\n debounceRef.current.reject(err)\n } finally {\n delete debounceRef.current.promise\n }\n }, getDefaultWait())\n\n return debounceRef.current.promise\n },\n [getDefaultFn, getDefaultWait]\n )\n}\n\nexport function makeRenderer(instance, column, meta = {}) {\n return (type, userProps = {}) => {\n const Comp = typeof type === 'string' ? column[type] : type\n\n if (typeof Comp === 'undefined') {\n console.info(column)\n throw new Error(renderErr)\n }\n\n return flexRender(Comp, { ...instance, column, ...meta, ...userProps })\n }\n}\n\nexport function flexRender(Comp, props) {\n return isReactComponent(Comp) ? : Comp\n}\n\nfunction isReactComponent(component) {\n return (\n isClassComponent(component) ||\n typeof component === 'function' ||\n isExoticComponent(component)\n )\n}\n\nfunction isClassComponent(component) {\n return (\n typeof component === 'function' &&\n (() => {\n const proto = Object.getPrototypeOf(component)\n return proto.prototype && proto.prototype.isReactComponent\n })()\n )\n}\n\nfunction isExoticComponent(component) {\n return (\n typeof component === 'object' &&\n typeof component.$$typeof === 'symbol' &&\n ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description)\n )\n}\n","import { defaultColumn, emptyRenderer } from './publicUtils'\n\n// Find the depth of the columns\nexport function findMaxDepth(columns, depth = 0) {\n return columns.reduce((prev, curr) => {\n if (curr.columns) {\n return Math.max(prev, findMaxDepth(curr.columns, depth + 1))\n }\n return depth\n }, 0)\n}\n\n// Build the visible columns, headers and flat column list\nexport function linkColumnStructure(columns, parent, depth = 0) {\n return columns.map(column => {\n column = {\n ...column,\n parent,\n depth,\n }\n\n assignColumnAccessor(column)\n\n if (column.columns) {\n column.columns = linkColumnStructure(column.columns, column, depth + 1)\n }\n return column\n })\n}\n\nexport function flattenColumns(columns) {\n return flattenBy(columns, 'columns')\n}\n\nexport function assignColumnAccessor(column) {\n // First check for string accessor\n let { id, accessor, Header } = column\n\n if (typeof accessor === 'string') {\n id = id || accessor\n const accessorPath = accessor.split('.')\n accessor = row => getBy(row, accessorPath)\n }\n\n if (!id && typeof Header === 'string' && Header) {\n id = Header\n }\n\n if (!id && column.columns) {\n console.error(column)\n throw new Error('A column ID (or unique \"Header\" value) is required!')\n }\n\n if (!id) {\n console.error(column)\n throw new Error('A column ID (or string accessor) is required!')\n }\n\n Object.assign(column, {\n id,\n accessor,\n })\n\n return column\n}\n\nexport function decorateColumn(column, userDefaultColumn) {\n if (!userDefaultColumn) {\n throw new Error()\n }\n Object.assign(column, {\n // Make sure there is a fallback header, just in case\n Header: emptyRenderer,\n Footer: emptyRenderer,\n ...defaultColumn,\n ...userDefaultColumn,\n ...column,\n })\n\n Object.assign(column, {\n originalWidth: column.width,\n })\n\n return column\n}\n\n// Build the header groups from the bottom up\nexport function makeHeaderGroups(\n allColumns,\n defaultColumn,\n additionalHeaderProperties = () => ({})\n) {\n const headerGroups = []\n\n let scanColumns = allColumns\n\n let uid = 0\n const getUID = () => uid++\n\n while (scanColumns.length) {\n // The header group we are creating\n const headerGroup = {\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const parentColumns = []\n\n const hasParents = scanColumns.some(d => d.parent)\n\n // Scan each column for parents\n scanColumns.forEach(column => {\n // What is the latest (last) parent column?\n let latestParentColumn = [...parentColumns].reverse()[0]\n\n let newParent\n\n if (hasParents) {\n // If the column has a parent, add it if necessary\n if (column.parent) {\n newParent = {\n ...column.parent,\n originalId: column.parent.id,\n id: `${column.parent.id}_${getUID()}`,\n headers: [column],\n ...additionalHeaderProperties(column),\n }\n } else {\n // If other columns have parents, we'll need to add a place holder if necessary\n const originalId = `${column.id}_placeholder`\n newParent = decorateColumn(\n {\n originalId,\n id: `${column.id}_placeholder_${getUID()}`,\n placeholderOf: column,\n headers: [column],\n ...additionalHeaderProperties(column),\n },\n defaultColumn\n )\n }\n\n // If the resulting parent columns are the same, just add\n // the column and increment the header span\n if (\n latestParentColumn &&\n latestParentColumn.originalId === newParent.originalId\n ) {\n latestParentColumn.headers.push(column)\n } else {\n parentColumns.push(newParent)\n }\n }\n\n headerGroup.headers.push(column)\n })\n\n headerGroups.push(headerGroup)\n\n // Start scanning the parent columns\n scanColumns = parentColumns\n }\n\n return headerGroups.reverse()\n}\n\nconst pathObjCache = new Map()\n\nexport function getBy(obj, path, def) {\n if (!path) {\n return obj\n }\n const cacheKey = typeof path === 'function' ? path : JSON.stringify(path)\n\n const pathObj =\n pathObjCache.get(cacheKey) ||\n (() => {\n const pathObj = makePathArray(path)\n pathObjCache.set(cacheKey, pathObj)\n return pathObj\n })()\n\n let val\n\n try {\n val = pathObj.reduce((cursor, pathPart) => cursor[pathPart], obj)\n } catch (e) {\n // continue regardless of error\n }\n return typeof val !== 'undefined' ? val : def\n}\n\nexport function getFirstDefined(...args) {\n for (let i = 0; i < args.length; i += 1) {\n if (typeof args[i] !== 'undefined') {\n return args[i]\n }\n }\n}\n\nexport function getElementDimensions(element) {\n const rect = element.getBoundingClientRect()\n const style = window.getComputedStyle(element)\n const margins = {\n left: parseInt(style.marginLeft),\n right: parseInt(style.marginRight),\n }\n const padding = {\n left: parseInt(style.paddingLeft),\n right: parseInt(style.paddingRight),\n }\n return {\n left: Math.ceil(rect.left),\n width: Math.ceil(rect.width),\n outerWidth: Math.ceil(\n rect.width + margins.left + margins.right + padding.left + padding.right\n ),\n marginLeft: margins.left,\n marginRight: margins.right,\n paddingLeft: padding.left,\n paddingRight: padding.right,\n scrollWidth: element.scrollWidth,\n }\n}\n\nexport function isFunction(a) {\n if (typeof a === 'function') {\n return a\n }\n}\n\nexport function flattenBy(arr, key) {\n const flat = []\n\n const recurse = arr => {\n arr.forEach(d => {\n if (!d[key]) {\n flat.push(d)\n } else {\n recurse(d[key])\n }\n })\n }\n\n recurse(arr)\n\n return flat\n}\n\nexport function expandRows(\n rows,\n { manualExpandedKey, expanded, expandSubRows = true }\n) {\n const expandedRows = []\n\n const handleRow = (row, addToExpandedRows = true) => {\n row.isExpanded =\n (row.original && row.original[manualExpandedKey]) || expanded[row.id]\n\n row.canExpand = row.subRows && !!row.subRows.length\n\n if (addToExpandedRows) {\n expandedRows.push(row)\n }\n\n if (row.subRows && row.subRows.length && row.isExpanded) {\n row.subRows.forEach(row => handleRow(row, expandSubRows))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return expandedRows\n}\n\nexport function getFilterMethod(filter, userFilterTypes, filterTypes) {\n return (\n isFunction(filter) ||\n userFilterTypes[filter] ||\n filterTypes[filter] ||\n filterTypes.text\n )\n}\n\nexport function shouldAutoRemoveFilter(autoRemove, value, column) {\n return autoRemove ? autoRemove(value, column) : typeof value === 'undefined'\n}\n\nexport function unpreparedAccessWarning() {\n throw new Error(\n 'React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.'\n )\n}\n\nlet passiveSupported = null\nexport function passiveEventSupported() {\n // memoize support to avoid adding multiple test events\n if (typeof passiveSupported === 'boolean') return passiveSupported\n\n let supported = false\n try {\n const options = {\n get passive() {\n supported = true\n return false\n },\n }\n\n window.addEventListener('test', null, options)\n window.removeEventListener('test', null, options)\n } catch (err) {\n supported = false\n }\n passiveSupported = supported\n return passiveSupported\n}\n\n//\n\nconst reOpenBracket = /\\[/g\nconst reCloseBracket = /\\]/g\n\nfunction makePathArray(obj) {\n return (\n flattenDeep(obj)\n // remove all periods in parts\n .map(d => String(d).replace('.', '_'))\n // join parts using period\n .join('.')\n // replace brackets with periods\n .replace(reOpenBracket, '.')\n .replace(reCloseBracket, '')\n // split it back out on periods\n .split('.')\n )\n}\n\nfunction flattenDeep(arr, newArr = []) {\n if (!Array.isArray(arr)) {\n newArr.push(arr)\n } else {\n for (let i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], newArr)\n }\n }\n return newArr\n}\n","const defaultGetTableProps = props => ({\n role: 'table',\n ...props,\n})\n\nconst defaultGetTableBodyProps = props => ({\n role: 'rowgroup',\n ...props,\n})\n\nconst defaultGetHeaderProps = (props, { column }) => ({\n key: `header_${column.id}`,\n colSpan: column.totalVisibleHeaderCount,\n role: 'columnheader',\n ...props,\n})\n\nconst defaultGetFooterProps = (props, { column }) => ({\n key: `footer_${column.id}`,\n colSpan: column.totalVisibleHeaderCount,\n ...props,\n})\n\nconst defaultGetHeaderGroupProps = (props, { index }) => ({\n key: `headerGroup_${index}`,\n role: 'row',\n ...props,\n})\n\nconst defaultGetFooterGroupProps = (props, { index }) => ({\n key: `footerGroup_${index}`,\n ...props,\n})\n\nconst defaultGetRowProps = (props, { row }) => ({\n key: `row_${row.id}`,\n role: 'row',\n ...props,\n})\n\nconst defaultGetCellProps = (props, { cell }) => ({\n key: `cell_${cell.row.id}_${cell.column.id}`,\n role: 'cell',\n ...props,\n})\n\nexport default function makeDefaultPluginHooks() {\n return {\n useOptions: [],\n stateReducers: [],\n useControlledState: [],\n columns: [],\n columnsDeps: [],\n allColumns: [],\n allColumnsDeps: [],\n accessValue: [],\n materializedColumns: [],\n materializedColumnsDeps: [],\n useInstanceAfterData: [],\n visibleColumns: [],\n visibleColumnsDeps: [],\n headerGroups: [],\n headerGroupsDeps: [],\n useInstanceBeforeDimensions: [],\n useInstance: [],\n prepareRow: [],\n getTableProps: [defaultGetTableProps],\n getTableBodyProps: [defaultGetTableBodyProps],\n getHeaderGroupProps: [defaultGetHeaderGroupProps],\n getFooterGroupProps: [defaultGetFooterGroupProps],\n getHeaderProps: [defaultGetHeaderProps],\n getFooterProps: [defaultGetFooterProps],\n getRowProps: [defaultGetRowProps],\n getCellProps: [defaultGetCellProps],\n useFinalInstance: [],\n }\n}\n","import React from 'react'\n\nimport {\n actions,\n functionalUpdate,\n useGetLatest,\n makePropGetter,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nactions.resetHiddenColumns = 'resetHiddenColumns'\nactions.toggleHideColumn = 'toggleHideColumn'\nactions.setHiddenColumns = 'setHiddenColumns'\nactions.toggleHideAllColumns = 'toggleHideAllColumns'\n\nexport const useColumnVisibility = hooks => {\n hooks.getToggleHiddenProps = [defaultGetToggleHiddenProps]\n hooks.getToggleHideAllColumnsProps = [defaultGetToggleHideAllColumnsProps]\n\n hooks.stateReducers.push(reducer)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n hooks.headerGroupsDeps.push((deps, { instance }) => [\n ...deps,\n instance.state.hiddenColumns,\n ])\n hooks.useInstance.push(useInstance)\n}\n\nuseColumnVisibility.pluginName = 'useColumnVisibility'\n\nconst defaultGetToggleHiddenProps = (props, { column }) => [\n props,\n {\n onChange: e => {\n column.toggleHidden(!e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: column.isVisible,\n title: 'Toggle Column Visible',\n },\n]\n\nconst defaultGetToggleHideAllColumnsProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleHideAllColumns(!e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: !instance.allColumnsHidden && !instance.state.hiddenColumns.length,\n title: 'Toggle All Columns Hidden',\n indeterminate:\n !instance.allColumnsHidden && instance.state.hiddenColumns.length,\n },\n]\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n hiddenColumns: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetHiddenColumns) {\n return {\n ...state,\n hiddenColumns: instance.initialState.hiddenColumns || [],\n }\n }\n\n if (action.type === actions.toggleHideColumn) {\n const should =\n typeof action.value !== 'undefined'\n ? action.value\n : !state.hiddenColumns.includes(action.columnId)\n\n const hiddenColumns = should\n ? [...state.hiddenColumns, action.columnId]\n : state.hiddenColumns.filter(d => d !== action.columnId)\n\n return {\n ...state,\n hiddenColumns,\n }\n }\n\n if (action.type === actions.setHiddenColumns) {\n return {\n ...state,\n hiddenColumns: functionalUpdate(action.value, state.hiddenColumns),\n }\n }\n\n if (action.type === actions.toggleHideAllColumns) {\n const shouldAll =\n typeof action.value !== 'undefined'\n ? action.value\n : !state.hiddenColumns.length\n\n return {\n ...state,\n hiddenColumns: shouldAll ? instance.allColumns.map(d => d.id) : [],\n }\n }\n}\n\nfunction useInstanceBeforeDimensions(instance) {\n const {\n headers,\n state: { hiddenColumns },\n } = instance\n\n const isMountedRef = React.useRef(false)\n\n if (!isMountedRef.current) {\n }\n\n const handleColumn = (column, parentVisible) => {\n column.isVisible = parentVisible && !hiddenColumns.includes(column.id)\n\n let totalVisibleHeaderCount = 0\n\n if (column.headers && column.headers.length) {\n column.headers.forEach(\n subColumn =>\n (totalVisibleHeaderCount += handleColumn(subColumn, column.isVisible))\n )\n } else {\n totalVisibleHeaderCount = column.isVisible ? 1 : 0\n }\n\n column.totalVisibleHeaderCount = totalVisibleHeaderCount\n\n return totalVisibleHeaderCount\n }\n\n let totalVisibleHeaderCount = 0\n\n headers.forEach(\n subHeader => (totalVisibleHeaderCount += handleColumn(subHeader, true))\n )\n}\n\nfunction useInstance(instance) {\n const {\n columns,\n flatHeaders,\n dispatch,\n allColumns,\n getHooks,\n state: { hiddenColumns },\n autoResetHiddenColumns = true,\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n const allColumnsHidden = allColumns.length === hiddenColumns.length\n\n const toggleHideColumn = React.useCallback(\n (columnId, value) =>\n dispatch({ type: actions.toggleHideColumn, columnId, value }),\n [dispatch]\n )\n\n const setHiddenColumns = React.useCallback(\n value => dispatch({ type: actions.setHiddenColumns, value }),\n [dispatch]\n )\n\n const toggleHideAllColumns = React.useCallback(\n value => dispatch({ type: actions.toggleHideAllColumns, value }),\n [dispatch]\n )\n\n const getToggleHideAllColumnsProps = makePropGetter(\n getHooks().getToggleHideAllColumnsProps,\n { instance: getInstance() }\n )\n\n flatHeaders.forEach(column => {\n column.toggleHidden = value => {\n dispatch({\n type: actions.toggleHideColumn,\n columnId: column.id,\n value,\n })\n }\n\n column.getToggleHiddenProps = makePropGetter(\n getHooks().getToggleHiddenProps,\n {\n instance: getInstance(),\n column,\n }\n )\n })\n\n const getAutoResetHiddenColumns = useGetLatest(autoResetHiddenColumns)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetHiddenColumns()) {\n dispatch({ type: actions.resetHiddenColumns })\n }\n }, [dispatch, columns])\n\n Object.assign(instance, {\n allColumnsHidden,\n toggleHideColumn,\n setHiddenColumns,\n toggleHideAllColumns,\n getToggleHideAllColumnsProps,\n })\n}\n","import React from 'react'\n\n//\n\nimport {\n linkColumnStructure,\n flattenColumns,\n assignColumnAccessor,\n unpreparedAccessWarning,\n makeHeaderGroups,\n decorateColumn,\n} from '../utils'\n\nimport {\n useGetLatest,\n reduceHooks,\n actions,\n loopHooks,\n makePropGetter,\n makeRenderer,\n} from '../publicUtils'\n\nimport makeDefaultPluginHooks from '../makeDefaultPluginHooks'\n\nimport { useColumnVisibility } from './useColumnVisibility'\n\nconst defaultInitialState = {}\nconst defaultColumnInstance = {}\nconst defaultReducer = (state, action, prevState) => state\nconst defaultGetSubRows = (row, index) => row.subRows || []\nconst defaultGetRowId = (row, index, parent) =>\n `${parent ? [parent.id, index].join('.') : index}`\nconst defaultUseControlledState = d => d\n\nfunction applyDefaults(props) {\n const {\n initialState = defaultInitialState,\n defaultColumn = defaultColumnInstance,\n getSubRows = defaultGetSubRows,\n getRowId = defaultGetRowId,\n stateReducer = defaultReducer,\n useControlledState = defaultUseControlledState,\n ...rest\n } = props\n\n return {\n ...rest,\n initialState,\n defaultColumn,\n getSubRows,\n getRowId,\n stateReducer,\n useControlledState,\n }\n}\n\nexport const useTable = (props, ...plugins) => {\n // Apply default props\n props = applyDefaults(props)\n\n // Add core plugins\n plugins = [useColumnVisibility, ...plugins]\n\n // Create the table instance\n let instanceRef = React.useRef({})\n\n // Create a getter for the instance (helps avoid a lot of potential memory leaks)\n const getInstance = useGetLatest(instanceRef.current)\n\n // Assign the props, plugins and hooks to the instance\n Object.assign(getInstance(), {\n ...props,\n plugins,\n hooks: makeDefaultPluginHooks(),\n })\n\n // Allow plugins to register hooks as early as possible\n plugins.filter(Boolean).forEach(plugin => {\n plugin(getInstance().hooks)\n })\n\n // Consume all hooks and make a getter for them\n const getHooks = useGetLatest(getInstance().hooks)\n getInstance().getHooks = getHooks\n delete getInstance().hooks\n\n // Allow useOptions hooks to modify the options coming into the table\n Object.assign(\n getInstance(),\n reduceHooks(getHooks().useOptions, applyDefaults(props))\n )\n\n const {\n data,\n columns: userColumns,\n initialState,\n defaultColumn,\n getSubRows,\n getRowId,\n stateReducer,\n useControlledState,\n } = getInstance()\n\n // Setup user reducer ref\n const getStateReducer = useGetLatest(stateReducer)\n\n // Build the reducer\n const reducer = React.useCallback(\n (state, action) => {\n // Detect invalid actions\n if (!action.type) {\n console.info({ action })\n throw new Error('Unknown Action 👆')\n }\n\n // Reduce the state from all plugin reducers\n return [\n ...getHooks().stateReducers,\n // Allow the user to add their own state reducer(s)\n ...(Array.isArray(getStateReducer())\n ? getStateReducer()\n : [getStateReducer()]),\n ].reduce(\n (s, handler) => handler(s, action, state, getInstance()) || s,\n state\n )\n },\n [getHooks, getStateReducer, getInstance]\n )\n\n // Start the reducer\n const [reducerState, dispatch] = React.useReducer(reducer, undefined, () =>\n reducer(initialState, { type: actions.init })\n )\n\n // Allow the user to control the final state with hooks\n const state = reduceHooks(\n [...getHooks().useControlledState, useControlledState],\n reducerState,\n { instance: getInstance() }\n )\n\n Object.assign(getInstance(), {\n state,\n dispatch,\n })\n\n // Decorate All the columns\n const columns = React.useMemo(\n () =>\n linkColumnStructure(\n reduceHooks(getHooks().columns, userColumns, {\n instance: getInstance(),\n })\n ),\n [\n getHooks,\n getInstance,\n userColumns,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().columnsDeps, [], { instance: getInstance() }),\n ]\n )\n getInstance().columns = columns\n\n // Get the flat list of all columns and allow hooks to decorate\n // those columns (and trigger this memoization via deps)\n let allColumns = React.useMemo(\n () =>\n reduceHooks(getHooks().allColumns, flattenColumns(columns), {\n instance: getInstance(),\n }).map(assignColumnAccessor),\n [\n columns,\n getHooks,\n getInstance,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().allColumnsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n getInstance().allColumns = allColumns\n\n // Access the row model using initial columns\n const [rows, flatRows, rowsById] = React.useMemo(() => {\n let rows = []\n let flatRows = []\n const rowsById = {}\n\n const allColumnsQueue = [...allColumns]\n\n while (allColumnsQueue.length) {\n const column = allColumnsQueue.shift()\n accessRowsForColumn({\n data,\n rows,\n flatRows,\n rowsById,\n column,\n getRowId,\n getSubRows,\n accessValueHooks: getHooks().accessValue,\n getInstance,\n })\n }\n\n return [rows, flatRows, rowsById]\n }, [allColumns, data, getRowId, getSubRows, getHooks, getInstance])\n\n Object.assign(getInstance(), {\n rows,\n initialRows: [...rows],\n flatRows,\n rowsById,\n // materializedColumns,\n })\n\n loopHooks(getHooks().useInstanceAfterData, getInstance())\n\n // Get the flat list of all columns AFTER the rows\n // have been access, and allow hooks to decorate\n // those columns (and trigger this memoization via deps)\n let visibleColumns = React.useMemo(\n () =>\n reduceHooks(getHooks().visibleColumns, allColumns, {\n instance: getInstance(),\n }).map(d => decorateColumn(d, defaultColumn)),\n [\n getHooks,\n allColumns,\n getInstance,\n defaultColumn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().visibleColumnsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n\n // Combine new visible columns with all columns\n allColumns = React.useMemo(() => {\n const columns = [...visibleColumns]\n\n allColumns.forEach(column => {\n if (!columns.find(d => d.id === column.id)) {\n columns.push(column)\n }\n })\n\n return columns\n }, [allColumns, visibleColumns])\n getInstance().allColumns = allColumns\n\n if (process.env.NODE_ENV !== 'production') {\n const duplicateColumns = allColumns.filter((column, i) => {\n return allColumns.findIndex(d => d.id === column.id) !== i\n })\n\n if (duplicateColumns.length) {\n console.info(allColumns)\n throw new Error(\n `Duplicate columns were found with ids: \"${duplicateColumns\n .map(d => d.id)\n .join(', ')}\" in the columns array above`\n )\n }\n }\n\n // Make the headerGroups\n const headerGroups = React.useMemo(\n () =>\n reduceHooks(\n getHooks().headerGroups,\n makeHeaderGroups(visibleColumns, defaultColumn),\n getInstance()\n ),\n [\n getHooks,\n visibleColumns,\n defaultColumn,\n getInstance,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().headerGroupsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n getInstance().headerGroups = headerGroups\n\n // Get the first level of headers\n const headers = React.useMemo(\n () => (headerGroups.length ? headerGroups[0].headers : []),\n [headerGroups]\n )\n getInstance().headers = headers\n\n // Provide a flat header list for utilities\n getInstance().flatHeaders = headerGroups.reduce(\n (all, headerGroup) => [...all, ...headerGroup.headers],\n []\n )\n\n loopHooks(getHooks().useInstanceBeforeDimensions, getInstance())\n\n // Filter columns down to visible ones\n const visibleColumnsDep = visibleColumns\n .filter(d => d.isVisible)\n .map(d => d.id)\n .sort()\n .join('_')\n\n visibleColumns = React.useMemo(\n () => visibleColumns.filter(d => d.isVisible),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [visibleColumns, visibleColumnsDep]\n )\n getInstance().visibleColumns = visibleColumns\n\n // Header Visibility is needed by this point\n const [\n totalColumnsMinWidth,\n totalColumnsWidth,\n totalColumnsMaxWidth,\n ] = calculateHeaderWidths(headers)\n\n getInstance().totalColumnsMinWidth = totalColumnsMinWidth\n getInstance().totalColumnsWidth = totalColumnsWidth\n getInstance().totalColumnsMaxWidth = totalColumnsMaxWidth\n\n loopHooks(getHooks().useInstance, getInstance())\n\n // Each materialized header needs to be assigned a render function and other\n // prop getter properties here.\n ;[...getInstance().flatHeaders, ...getInstance().allColumns].forEach(\n column => {\n // Give columns/headers rendering power\n column.render = makeRenderer(getInstance(), column)\n\n // Give columns/headers a default getHeaderProps\n column.getHeaderProps = makePropGetter(getHooks().getHeaderProps, {\n instance: getInstance(),\n column,\n })\n\n // Give columns/headers a default getFooterProps\n column.getFooterProps = makePropGetter(getHooks().getFooterProps, {\n instance: getInstance(),\n column,\n })\n }\n )\n\n getInstance().headerGroups = React.useMemo(\n () =>\n headerGroups.filter((headerGroup, i) => {\n // Filter out any headers and headerGroups that don't have visible columns\n headerGroup.headers = headerGroup.headers.filter(column => {\n const recurse = headers =>\n headers.filter(column => {\n if (column.headers) {\n return recurse(column.headers)\n }\n return column.isVisible\n }).length\n if (column.headers) {\n return recurse(column.headers)\n }\n return column.isVisible\n })\n\n // Give headerGroups getRowProps\n if (headerGroup.headers.length) {\n headerGroup.getHeaderGroupProps = makePropGetter(\n getHooks().getHeaderGroupProps,\n { instance: getInstance(), headerGroup, index: i }\n )\n\n headerGroup.getFooterGroupProps = makePropGetter(\n getHooks().getFooterGroupProps,\n { instance: getInstance(), headerGroup, index: i }\n )\n\n return true\n }\n\n return false\n }),\n [headerGroups, getInstance, getHooks]\n )\n\n getInstance().footerGroups = [...getInstance().headerGroups].reverse()\n\n // The prepareRow function is absolutely necessary and MUST be called on\n // any rows the user wishes to be displayed.\n\n getInstance().prepareRow = React.useCallback(\n row => {\n row.getRowProps = makePropGetter(getHooks().getRowProps, {\n instance: getInstance(),\n row,\n })\n\n // Build the visible cells for each row\n row.allCells = allColumns.map(column => {\n const value = row.values[column.id]\n\n const cell = {\n column,\n row,\n value,\n }\n\n // Give each cell a getCellProps base\n cell.getCellProps = makePropGetter(getHooks().getCellProps, {\n instance: getInstance(),\n cell,\n })\n\n // Give each cell a renderer function (supports multiple renderers)\n cell.render = makeRenderer(getInstance(), column, {\n row,\n cell,\n value,\n })\n\n return cell\n })\n\n row.cells = visibleColumns.map(column =>\n row.allCells.find(cell => cell.column.id === column.id)\n )\n\n // need to apply any row specific hooks (useExpanded requires this)\n loopHooks(getHooks().prepareRow, row, { instance: getInstance() })\n },\n [getHooks, getInstance, allColumns, visibleColumns]\n )\n\n getInstance().getTableProps = makePropGetter(getHooks().getTableProps, {\n instance: getInstance(),\n })\n\n getInstance().getTableBodyProps = makePropGetter(\n getHooks().getTableBodyProps,\n {\n instance: getInstance(),\n }\n )\n\n loopHooks(getHooks().useFinalInstance, getInstance())\n\n return getInstance()\n}\n\nfunction calculateHeaderWidths(headers, left = 0) {\n let sumTotalMinWidth = 0\n let sumTotalWidth = 0\n let sumTotalMaxWidth = 0\n let sumTotalFlexWidth = 0\n\n headers.forEach(header => {\n let { headers: subHeaders } = header\n\n header.totalLeft = left\n\n if (subHeaders && subHeaders.length) {\n const [\n totalMinWidth,\n totalWidth,\n totalMaxWidth,\n totalFlexWidth,\n ] = calculateHeaderWidths(subHeaders, left)\n header.totalMinWidth = totalMinWidth\n header.totalWidth = totalWidth\n header.totalMaxWidth = totalMaxWidth\n header.totalFlexWidth = totalFlexWidth\n } else {\n header.totalMinWidth = header.minWidth\n header.totalWidth = Math.min(\n Math.max(header.minWidth, header.width),\n header.maxWidth\n )\n header.totalMaxWidth = header.maxWidth\n header.totalFlexWidth = header.canResize ? header.totalWidth : 0\n }\n if (header.isVisible) {\n left += header.totalWidth\n sumTotalMinWidth += header.totalMinWidth\n sumTotalWidth += header.totalWidth\n sumTotalMaxWidth += header.totalMaxWidth\n sumTotalFlexWidth += header.totalFlexWidth\n }\n })\n\n return [sumTotalMinWidth, sumTotalWidth, sumTotalMaxWidth, sumTotalFlexWidth]\n}\n\nfunction accessRowsForColumn({\n data,\n rows,\n flatRows,\n rowsById,\n column,\n getRowId,\n getSubRows,\n accessValueHooks,\n getInstance,\n}) {\n // Access the row's data column-by-column\n // We do it this way so we can incrementally add materialized\n // columns after the first pass and avoid excessive looping\n const accessRow = (originalRow, rowIndex, depth = 0, parent, parentRows) => {\n // Keep the original reference around\n const original = originalRow\n\n const id = getRowId(originalRow, rowIndex, parent)\n\n let row = rowsById[id]\n\n // If the row hasn't been created, let's make it\n if (!row) {\n row = {\n id,\n original,\n index: rowIndex,\n depth,\n cells: [{}], // This is a dummy cell\n }\n\n // Override common array functions (and the dummy cell's getCellProps function)\n // to show an error if it is accessed without calling prepareRow\n row.cells.map = unpreparedAccessWarning\n row.cells.filter = unpreparedAccessWarning\n row.cells.forEach = unpreparedAccessWarning\n row.cells[0].getCellProps = unpreparedAccessWarning\n\n // Create the cells and values\n row.values = {}\n\n // Push this row into the parentRows array\n parentRows.push(row)\n // Keep track of every row in a flat array\n flatRows.push(row)\n // Also keep track of every row by its ID\n rowsById[id] = row\n\n // Get the original subrows\n row.originalSubRows = getSubRows(originalRow, rowIndex)\n\n // Then recursively access them\n if (row.originalSubRows) {\n const subRows = []\n row.originalSubRows.forEach((d, i) =>\n accessRow(d, i, depth + 1, row, subRows)\n )\n // Keep the new subRows array on the row\n row.subRows = subRows\n }\n } else if (row.subRows) {\n // If the row exists, then it's already been accessed\n // Keep recursing, but don't worry about passing the\n // accumlator array (those rows already exist)\n row.originalSubRows.forEach((d, i) => accessRow(d, i, depth + 1, row))\n }\n\n // If the column has an accessor, use it to get a value\n if (column.accessor) {\n row.values[column.id] = column.accessor(\n originalRow,\n rowIndex,\n row,\n parentRows,\n data\n )\n }\n\n // Allow plugins to manipulate the column value\n row.values[column.id] = reduceHooks(\n accessValueHooks,\n row.values[column.id],\n {\n row,\n column,\n instance: getInstance(),\n },\n true\n )\n }\n\n data.forEach((originalRow, rowIndex) =>\n accessRow(originalRow, rowIndex, 0, undefined, rows)\n )\n}\n","import React from 'react'\n\nimport { expandRows } from '../utils'\n\nimport {\n useGetLatest,\n actions,\n useMountedLayoutEffect,\n makePropGetter,\n ensurePluginOrder,\n} from '../publicUtils'\n\n// Actions\nactions.resetExpanded = 'resetExpanded'\nactions.toggleRowExpanded = 'toggleRowExpanded'\nactions.toggleAllRowsExpanded = 'toggleAllRowsExpanded'\n\nexport const useExpanded = hooks => {\n hooks.getToggleAllRowsExpandedProps = [defaultGetToggleAllRowsExpandedProps]\n hooks.getToggleRowExpandedProps = [defaultGetToggleRowExpandedProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseExpanded.pluginName = 'useExpanded'\n\nconst defaultGetToggleAllRowsExpandedProps = (props, { instance }) => [\n props,\n {\n onClick: e => {\n instance.toggleAllRowsExpanded()\n },\n style: {\n cursor: 'pointer',\n },\n title: 'Toggle All Rows Expanded',\n },\n]\n\nconst defaultGetToggleRowExpandedProps = (props, { row }) => [\n props,\n {\n onClick: () => {\n row.toggleRowExpanded()\n },\n style: {\n cursor: 'pointer',\n },\n title: 'Toggle Row Expanded',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n expanded: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetExpanded) {\n return {\n ...state,\n expanded: instance.initialState.expanded || {},\n }\n }\n\n if (action.type === actions.toggleAllRowsExpanded) {\n const { value } = action\n const { rowsById } = instance\n\n const isAllRowsExpanded =\n Object.keys(rowsById).length === Object.keys(state.expanded).length\n\n const expandAll = typeof value !== 'undefined' ? value : !isAllRowsExpanded\n\n if (expandAll) {\n const expanded = {}\n\n Object.keys(rowsById).forEach(rowId => {\n expanded[rowId] = true\n })\n\n return {\n ...state,\n expanded,\n }\n }\n\n return {\n ...state,\n expanded: {},\n }\n }\n\n if (action.type === actions.toggleRowExpanded) {\n const { id, value: setExpanded } = action\n const exists = state.expanded[id]\n\n const shouldExist =\n typeof setExpanded !== 'undefined' ? setExpanded : !exists\n\n if (!exists && shouldExist) {\n return {\n ...state,\n expanded: {\n ...state.expanded,\n [id]: true,\n },\n }\n } else if (exists && !shouldExist) {\n const { [id]: _, ...rest } = state.expanded\n return {\n ...state,\n expanded: rest,\n }\n } else {\n return state\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n rowsById,\n manualExpandedKey = 'expanded',\n paginateExpandedRows = true,\n expandSubRows = true,\n autoResetExpanded = true,\n getHooks,\n plugins,\n state: { expanded },\n dispatch,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useSortBy', 'useGroupBy', 'usePivotColumns', 'useGlobalFilter'],\n 'useExpanded'\n )\n\n const getAutoResetExpanded = useGetLatest(autoResetExpanded)\n\n let isAllRowsExpanded = Boolean(\n Object.keys(rowsById).length && Object.keys(expanded).length\n )\n\n if (isAllRowsExpanded) {\n if (Object.keys(rowsById).some(id => !expanded[id])) {\n isAllRowsExpanded = false\n }\n }\n\n // Bypass any effects from firing when this changes\n useMountedLayoutEffect(() => {\n if (getAutoResetExpanded()) {\n dispatch({ type: actions.resetExpanded })\n }\n }, [dispatch, data])\n\n const toggleRowExpanded = React.useCallback(\n (id, value) => {\n dispatch({ type: actions.toggleRowExpanded, id, value })\n },\n [dispatch]\n )\n\n const toggleAllRowsExpanded = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsExpanded, value }),\n [dispatch]\n )\n\n const expandedRows = React.useMemo(() => {\n if (paginateExpandedRows) {\n return expandRows(rows, { manualExpandedKey, expanded, expandSubRows })\n }\n\n return rows\n }, [paginateExpandedRows, rows, manualExpandedKey, expanded, expandSubRows])\n\n const expandedDepth = React.useMemo(() => findExpandedDepth(expanded), [\n expanded,\n ])\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsExpandedProps = makePropGetter(\n getHooks().getToggleAllRowsExpandedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n preExpandedRows: rows,\n expandedRows,\n rows: expandedRows,\n expandedDepth,\n isAllRowsExpanded,\n toggleRowExpanded,\n toggleAllRowsExpanded,\n getToggleAllRowsExpandedProps,\n })\n}\n\nfunction prepareRow(row, { instance: { getHooks }, instance }) {\n row.toggleRowExpanded = set => instance.toggleRowExpanded(row.id, set)\n\n row.getToggleRowExpandedProps = makePropGetter(\n getHooks().getToggleRowExpandedProps,\n {\n instance,\n row,\n }\n )\n}\n\nfunction findExpandedDepth(expanded) {\n let maxDepth = 0\n\n Object.keys(expanded).forEach(id => {\n const splitId = id.split('.')\n maxDepth = Math.max(maxDepth, splitId.length)\n })\n\n return maxDepth\n}\n","export const text = (rows, ids, filterValue) => {\n rows = rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return String(rowValue)\n .toLowerCase()\n .includes(String(filterValue).toLowerCase())\n })\n })\n return rows\n}\n\ntext.autoRemove = val => !val\n\nexport const exactText = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue).toLowerCase() === String(filterValue).toLowerCase()\n : true\n })\n })\n}\n\nexactText.autoRemove = val => !val\n\nexport const exactTextCase = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue) === String(filterValue)\n : true\n })\n })\n}\n\nexactTextCase.autoRemove = val => !val\n\nexport const includes = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue.includes(filterValue)\n })\n })\n}\n\nincludes.autoRemove = val => !val || !val.length\n\nexport const includesAll = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return (\n rowValue &&\n rowValue.length &&\n filterValue.every(val => rowValue.includes(val))\n )\n })\n })\n}\n\nincludesAll.autoRemove = val => !val || !val.length\n\nexport const includesSome = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return (\n rowValue &&\n rowValue.length &&\n filterValue.some(val => rowValue.includes(val))\n )\n })\n })\n}\n\nincludesSome.autoRemove = val => !val || !val.length\n\nexport const includesValue = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return filterValue.includes(rowValue)\n })\n })\n}\n\nincludesValue.autoRemove = val => !val || !val.length\n\nexport const exact = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue === filterValue\n })\n })\n}\n\nexact.autoRemove = val => typeof val === 'undefined'\n\nexport const equals = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n // eslint-disable-next-line eqeqeq\n return rowValue == filterValue\n })\n })\n}\n\nequals.autoRemove = val => val == null\n\nexport const between = (rows, ids, filterValue) => {\n let [min, max] = filterValue || []\n\n min = typeof min === 'number' ? min : -Infinity\n max = typeof max === 'number' ? max : Infinity\n\n if (min > max) {\n const temp = min\n min = max\n max = temp\n }\n\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue >= min && rowValue <= max\n })\n })\n}\n\nbetween.autoRemove = val =>\n !val || (typeof val[0] !== 'number' && typeof val[1] !== 'number')\n","import React from 'react'\n\nimport {\n getFirstDefined,\n getFilterMethod,\n shouldAutoRemoveFilter,\n} from '../utils'\n\nimport {\n actions,\n useGetLatest,\n functionalUpdate,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport * as filterTypes from '../filterTypes'\n\n// Actions\nactions.resetFilters = 'resetFilters'\nactions.setFilter = 'setFilter'\nactions.setAllFilters = 'setAllFilters'\n\nexport const useFilters = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseFilters.pluginName = 'useFilters'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n filters: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetFilters) {\n return {\n ...state,\n filters: instance.initialState.filters || [],\n }\n }\n\n if (action.type === actions.setFilter) {\n const { columnId, filterValue } = action\n const { allColumns, filterTypes: userFilterTypes } = instance\n\n const column = allColumns.find(d => d.id === columnId)\n\n if (!column) {\n throw new Error(\n `React-Table: Could not find a column with id: ${columnId}`\n )\n }\n\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n const previousfilter = state.filters.find(d => d.id === columnId)\n\n const newFilter = functionalUpdate(\n filterValue,\n previousfilter && previousfilter.value\n )\n\n //\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter, column)) {\n return {\n ...state,\n filters: state.filters.filter(d => d.id !== columnId),\n }\n }\n\n if (previousfilter) {\n return {\n ...state,\n filters: state.filters.map(d => {\n if (d.id === columnId) {\n return { id: columnId, value: newFilter }\n }\n return d\n }),\n }\n }\n\n return {\n ...state,\n filters: [...state.filters, { id: columnId, value: newFilter }],\n }\n }\n\n if (action.type === actions.setAllFilters) {\n const { filters } = action\n const { allColumns, filterTypes: userFilterTypes } = instance\n\n return {\n ...state,\n // Filter out undefined values\n filters: functionalUpdate(filters, state.filters).filter(filter => {\n const column = allColumns.find(d => d.id === filter.id)\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (\n shouldAutoRemoveFilter(filterMethod.autoRemove, filter.value, column)\n ) {\n return false\n }\n return true\n }),\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n filterTypes: userFilterTypes,\n manualFilters,\n defaultCanFilter = false,\n disableFilters,\n state: { filters },\n dispatch,\n autoResetFilters = true,\n } = instance\n\n const setFilter = React.useCallback(\n (columnId, filterValue) => {\n dispatch({ type: actions.setFilter, columnId, filterValue })\n },\n [dispatch]\n )\n\n const setAllFilters = React.useCallback(\n filters => {\n dispatch({\n type: actions.setAllFilters,\n filters,\n })\n },\n [dispatch]\n )\n\n allColumns.forEach(column => {\n const {\n id,\n accessor,\n defaultCanFilter: columnDefaultCanFilter,\n disableFilters: columnDisableFilters,\n } = column\n\n // Determine if a column is filterable\n column.canFilter = accessor\n ? getFirstDefined(\n columnDisableFilters === true ? false : undefined,\n disableFilters === true ? false : undefined,\n true\n )\n : getFirstDefined(columnDefaultCanFilter, defaultCanFilter, false)\n\n // Provide the column a way of updating the filter value\n column.setFilter = val => setFilter(column.id, val)\n\n // Provide the current filter value to the column for\n // convenience\n const found = filters.find(d => d.id === id)\n column.filterValue = found && found.value\n })\n\n const [\n filteredRows,\n filteredFlatRows,\n filteredRowsById,\n ] = React.useMemo(() => {\n if (manualFilters || !filters.length) {\n return [rows, flatRows, rowsById]\n }\n\n const filteredFlatRows = []\n const filteredRowsById = {}\n\n // Filters top level and nested rows\n const filterRows = (rows, depth = 0) => {\n let filteredRows = rows\n\n filteredRows = filters.reduce(\n (filteredSoFar, { id: columnId, value: filterValue }) => {\n // Find the filters column\n const column = allColumns.find(d => d.id === columnId)\n\n if (!column) {\n return filteredSoFar\n }\n\n if (depth === 0) {\n column.preFilteredRows = filteredSoFar\n }\n\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (!filterMethod) {\n console.warn(\n `Could not find a valid 'column.filter' for column with the ID: ${column.id}.`\n )\n return filteredSoFar\n }\n\n // Pass the rows, id, filterValue and column to the filterMethod\n // to get the filtered rows back\n column.filteredRows = filterMethod(\n filteredSoFar,\n [columnId],\n filterValue\n )\n\n return column.filteredRows\n },\n rows\n )\n\n // Apply the filter to any subRows\n // We technically could do this recursively in the above loop,\n // but that would severely hinder the API for the user, since they\n // would be required to do that recursion in some scenarios\n filteredRows.forEach(row => {\n filteredFlatRows.push(row)\n filteredRowsById[row.id] = row\n if (!row.subRows) {\n return\n }\n\n row.subRows =\n row.subRows && row.subRows.length > 0\n ? filterRows(row.subRows, depth + 1)\n : row.subRows\n })\n\n return filteredRows\n }\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById]\n }, [\n manualFilters,\n filters,\n rows,\n flatRows,\n rowsById,\n allColumns,\n userFilterTypes,\n ])\n\n React.useMemo(() => {\n // Now that each filtered column has it's partially filtered rows,\n // lets assign the final filtered rows to all of the other columns\n const nonFilteredColumns = allColumns.filter(\n column => !filters.find(d => d.id === column.id)\n )\n\n // This essentially enables faceted filter options to be built easily\n // using every column's preFilteredRows value\n nonFilteredColumns.forEach(column => {\n column.preFilteredRows = filteredRows\n column.filteredRows = filteredRows\n })\n }, [filteredRows, filters, allColumns])\n\n const getAutoResetFilters = useGetLatest(autoResetFilters)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetFilters()) {\n dispatch({ type: actions.resetFilters })\n }\n }, [dispatch, manualFilters ? null : data])\n\n Object.assign(instance, {\n preFilteredRows: rows,\n preFilteredFlatRows: flatRows,\n preFilteredRowsById: rowsById,\n filteredRows,\n filteredFlatRows,\n filteredRowsById,\n rows: filteredRows,\n flatRows: filteredFlatRows,\n rowsById: filteredRowsById,\n setFilter,\n setAllFilters,\n })\n}\n","import React from 'react'\n\nimport {\n getFilterMethod,\n shouldAutoRemoveFilter,\n getFirstDefined,\n} from '../utils'\n\nimport {\n actions,\n useMountedLayoutEffect,\n functionalUpdate,\n useGetLatest,\n} from '../publicUtils'\n\nimport * as filterTypes from '../filterTypes'\n\n// Actions\nactions.resetGlobalFilter = 'resetGlobalFilter'\nactions.setGlobalFilter = 'setGlobalFilter'\n\nexport const useGlobalFilter = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseGlobalFilter.pluginName = 'useGlobalFilter'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.resetGlobalFilter) {\n return {\n ...state,\n globalFilter: instance.initialState.globalFilter || undefined,\n }\n }\n\n if (action.type === actions.setGlobalFilter) {\n const { filterValue } = action\n const { userFilterTypes } = instance\n\n const filterMethod = getFilterMethod(\n instance.globalFilter,\n userFilterTypes || {},\n filterTypes\n )\n\n const newFilter = functionalUpdate(filterValue, state.globalFilter)\n\n //\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter)) {\n const { globalFilter, ...stateWithoutGlobalFilter } = state\n return stateWithoutGlobalFilter\n }\n\n return {\n ...state,\n globalFilter: newFilter,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n filterTypes: userFilterTypes,\n globalFilter,\n manualGlobalFilter,\n state: { globalFilter: globalFilterValue },\n dispatch,\n autoResetGlobalFilter = true,\n disableGlobalFilter,\n } = instance\n\n const setGlobalFilter = React.useCallback(\n filterValue => {\n dispatch({ type: actions.setGlobalFilter, filterValue })\n },\n [dispatch]\n )\n\n // TODO: Create a filter cache for incremental high speed multi-filtering\n // This gets pretty complicated pretty fast, since you have to maintain a\n // cache for each row group (top-level rows, and each row's recursive subrows)\n // This would make multi-filtering a lot faster though. Too far?\n\n const [\n globalFilteredRows,\n globalFilteredFlatRows,\n globalFilteredRowsById,\n ] = React.useMemo(() => {\n if (manualGlobalFilter || typeof globalFilterValue === 'undefined') {\n return [rows, flatRows, rowsById]\n }\n\n const filteredFlatRows = []\n const filteredRowsById = {}\n\n const filterMethod = getFilterMethod(\n globalFilter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (!filterMethod) {\n console.warn(`Could not find a valid 'globalFilter' option.`)\n return rows\n }\n\n allColumns.forEach(column => {\n const { disableGlobalFilter: columnDisableGlobalFilter } = column\n\n column.canFilter = getFirstDefined(\n columnDisableGlobalFilter === true ? false : undefined,\n disableGlobalFilter === true ? false : undefined,\n true\n )\n })\n\n const filterableColumns = allColumns.filter(c => c.canFilter === true)\n\n // Filters top level and nested rows\n const filterRows = filteredRows => {\n filteredRows = filterMethod(\n filteredRows,\n filterableColumns.map(d => d.id),\n globalFilterValue\n )\n\n filteredRows.forEach(row => {\n filteredFlatRows.push(row)\n filteredRowsById[row.id] = row\n\n row.subRows =\n row.subRows && row.subRows.length\n ? filterRows(row.subRows)\n : row.subRows\n })\n\n return filteredRows\n }\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById]\n }, [\n manualGlobalFilter,\n globalFilterValue,\n globalFilter,\n userFilterTypes,\n allColumns,\n rows,\n flatRows,\n rowsById,\n disableGlobalFilter,\n ])\n\n const getAutoResetGlobalFilter = useGetLatest(autoResetGlobalFilter)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGlobalFilter()) {\n dispatch({ type: actions.resetGlobalFilter })\n }\n }, [dispatch, manualGlobalFilter ? null : data])\n\n Object.assign(instance, {\n preGlobalFilteredRows: rows,\n preGlobalFilteredFlatRows: flatRows,\n preGlobalFilteredRowsById: rowsById,\n globalFilteredRows,\n globalFilteredFlatRows,\n globalFilteredRowsById,\n rows: globalFilteredRows,\n flatRows: globalFilteredFlatRows,\n rowsById: globalFilteredRowsById,\n setGlobalFilter,\n disableGlobalFilter,\n })\n}\n","export function sum(values, aggregatedValues) {\n // It's faster to just add the aggregations together instead of\n // process leaf nodes individually\n return aggregatedValues.reduce(\n (sum, next) => sum + (typeof next === 'number' ? next : 0),\n 0\n )\n}\n\nexport function min(values) {\n let min = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n min = Math.min(min, value)\n }\n })\n\n return min\n}\n\nexport function max(values) {\n let max = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n max = Math.max(max, value)\n }\n })\n\n return max\n}\n\nexport function minMax(values) {\n let min = values[0] || 0\n let max = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n min = Math.min(min, value)\n max = Math.max(max, value)\n }\n })\n\n return `${min}..${max}`\n}\n\nexport function average(values) {\n return sum(null, values) / values.length\n}\n\nexport function median(values) {\n if (!values.length) {\n return null\n }\n\n const mid = Math.floor(values.length / 2)\n const nums = [...values].sort((a, b) => a - b)\n return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2\n}\n\nexport function unique(values) {\n return Array.from(new Set(values).values())\n}\n\nexport function uniqueCount(values) {\n return new Set(values).size\n}\n\nexport function count(values) {\n return values.length\n}\n","import React from 'react'\n\nimport * as aggregations from '../aggregations'\n\nimport { getFirstDefined, flattenBy } from '../utils'\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nconst emptyArray = []\nconst emptyObject = {}\n\n// Actions\nactions.resetGroupBy = 'resetGroupBy'\nactions.setGroupBy = 'setGroupBy'\nactions.toggleGroupBy = 'toggleGroupBy'\n\nexport const useGroupBy = hooks => {\n hooks.getGroupByToggleProps = [defaultGetGroupByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => [\n ...deps,\n instance.state.groupBy,\n ])\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseGroupBy.pluginName = 'useGroupBy'\n\nconst defaultGetGroupByToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canGroupBy\n ? e => {\n e.persist()\n header.toggleGroupBy()\n }\n : undefined,\n style: {\n cursor: header.canGroupBy ? 'pointer' : undefined,\n },\n title: 'Toggle GroupBy',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n groupBy: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetGroupBy) {\n return {\n ...state,\n groupBy: instance.initialState.groupBy || [],\n }\n }\n\n if (action.type === actions.setGroupBy) {\n const { value } = action\n return {\n ...state,\n groupBy: value,\n }\n }\n\n if (action.type === actions.toggleGroupBy) {\n const { columnId, value: setGroupBy } = action\n\n const resolvedGroupBy =\n typeof setGroupBy !== 'undefined'\n ? setGroupBy\n : !state.groupBy.includes(columnId)\n\n if (resolvedGroupBy) {\n return {\n ...state,\n groupBy: [...state.groupBy, columnId],\n }\n }\n\n return {\n ...state,\n groupBy: state.groupBy.filter(d => d !== columnId),\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { groupBy },\n },\n }\n) {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n\n const groupByColumns = groupBy\n .map(g => columns.find(col => col.id === g))\n .filter(Boolean)\n\n const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id))\n\n columns = [...groupByColumns, ...nonGroupByColumns]\n\n columns.forEach(column => {\n column.isGrouped = groupBy.includes(column.id)\n column.groupedIndex = groupBy.indexOf(column.id)\n })\n\n return columns\n}\n\nconst defaultUserAggregations = {}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n flatHeaders,\n groupByFn = defaultGroupByFn,\n manualGroupBy,\n aggregations: userAggregations = defaultUserAggregations,\n plugins,\n state: { groupBy },\n dispatch,\n autoResetGroupBy = true,\n disableGroupBy,\n defaultCanGroupBy,\n getHooks,\n } = instance\n\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useGroupBy')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultGroupBy: defaultColumnGroupBy,\n disableGroupBy: columnDisableGroupBy,\n } = column\n\n column.canGroupBy = accessor\n ? getFirstDefined(\n column.canGroupBy,\n columnDisableGroupBy === true ? false : undefined,\n disableGroupBy === true ? false : undefined,\n true\n )\n : getFirstDefined(\n column.canGroupBy,\n defaultColumnGroupBy,\n defaultCanGroupBy,\n false\n )\n\n if (column.canGroupBy) {\n column.toggleGroupBy = () => instance.toggleGroupBy(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const toggleGroupBy = React.useCallback(\n (columnId, value) => {\n dispatch({ type: actions.toggleGroupBy, columnId, value })\n },\n [dispatch]\n )\n\n const setGroupBy = React.useCallback(\n value => {\n dispatch({ type: actions.setGroupBy, value })\n },\n [dispatch]\n )\n\n flatHeaders.forEach(header => {\n header.getGroupByToggleProps = makePropGetter(\n getHooks().getGroupByToggleProps,\n { instance: getInstance(), header }\n )\n })\n\n const [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n ] = React.useMemo(() => {\n if (manualGroupBy || !groupBy.length) {\n return [\n rows,\n flatRows,\n rowsById,\n emptyArray,\n emptyObject,\n flatRows,\n rowsById,\n ]\n }\n\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g =>\n allColumns.find(col => col.id === g)\n )\n\n // Find the columns that can or are aggregating\n // Uses each column to aggregate rows into a single value\n const aggregateRowsToValues = (leafRows, groupedRows, depth) => {\n const values = {}\n\n allColumns.forEach(column => {\n // Don't aggregate columns that are in the groupBy\n if (existingGroupBy.includes(column.id)) {\n values[column.id] = groupedRows[0]\n ? groupedRows[0].values[column.id]\n : null\n return\n }\n\n // Aggregate the values\n let aggregateFn =\n typeof column.aggregate === 'function'\n ? column.aggregate\n : userAggregations[column.aggregate] ||\n aggregations[column.aggregate]\n\n if (aggregateFn) {\n // Get the columnValues to aggregate\n const groupedValues = groupedRows.map(row => row.values[column.id])\n\n // Get the columnValues to aggregate\n const leafValues = leafRows.map(row => {\n let columnValue = row.values[column.id]\n\n if (!depth && column.aggregateValue) {\n const aggregateValueFn =\n typeof column.aggregateValue === 'function'\n ? column.aggregateValue\n : userAggregations[column.aggregateValue] ||\n aggregations[column.aggregateValue]\n\n if (!aggregateValueFn) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregateValue option for column listed above`\n )\n }\n\n columnValue = aggregateValueFn(columnValue, row, column)\n }\n return columnValue\n })\n\n values[column.id] = aggregateFn(leafValues, groupedValues)\n } else if (column.aggregate) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregate option for column listed above`\n )\n } else {\n values[column.id] = null\n }\n })\n\n return values\n }\n\n let groupedFlatRows = []\n const groupedRowsById = {}\n const onlyGroupedFlatRows = []\n const onlyGroupedRowsById = {}\n const nonGroupedFlatRows = []\n const nonGroupedRowsById = {}\n\n // Recursively group the data\n const groupUpRecursively = (rows, depth = 0, parentId) => {\n // This is the last level, just return the rows\n if (depth === existingGroupBy.length) {\n return rows.map((row) => ({ ...row, depth }))\n }\n\n const columnId = existingGroupBy[depth]\n\n // Group the rows together for this level\n let rowGroupsMap = groupByFn(rows, columnId)\n\n // Peform aggregations for each group\n const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\n ([groupByVal, groupedRows], index) => {\n let id = `${columnId}:${groupByVal}`\n id = parentId ? `${parentId}>${id}` : id\n\n // First, Recurse to group sub rows before aggregation\n const subRows = groupUpRecursively(groupedRows, depth + 1, id)\n\n // Flatten the leaf rows of the rows in this group\n const leafRows = depth\n ? flattenBy(groupedRows, 'leafRows')\n : groupedRows\n\n const values = aggregateRowsToValues(leafRows, groupedRows, depth)\n\n const row = {\n id,\n isGrouped: true,\n groupByID: columnId,\n groupByVal,\n values,\n subRows,\n leafRows,\n depth,\n index,\n }\n\n subRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n return row\n }\n )\n\n return aggregatedGroupedRows\n }\n\n const groupedRows = groupUpRecursively(rows)\n\n groupedRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n // Assign the new data\n return [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n ]\n }, [\n manualGroupBy,\n groupBy,\n rows,\n flatRows,\n rowsById,\n allColumns,\n userAggregations,\n groupByFn,\n ])\n\n const getAutoResetGroupBy = useGetLatest(autoResetGroupBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGroupBy()) {\n dispatch({ type: actions.resetGroupBy })\n }\n }, [dispatch, manualGroupBy ? null : data])\n\n Object.assign(instance, {\n preGroupedRows: rows,\n preGroupedFlatRow: flatRows,\n preGroupedRowsById: rowsById,\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById,\n toggleGroupBy,\n setGroupBy,\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the groupBy and the pivot cell for the row\n cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID\n // Placeholder cells are any columns in the groupBy that are not grouped\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped\n // Aggregated cells are not grouped, not repeated, but still have subRows\n cell.isAggregated =\n !cell.isGrouped && !cell.isPlaceholder && row.subRows?.length\n })\n}\n\nexport function defaultGroupByFn(rows, columnId) {\n return rows.reduce((prev, row, i) => {\n // TODO: Might want to implement a key serializer here so\n // irregular column values can still be grouped if needed?\n const resKey = `${row.values[columnId]}`\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : []\n prev[resKey].push(row)\n return prev\n }, {})\n}\n","const reSplitAlphaNumeric = /([0-9]+)/gm\n\n// Mixed sorting is slow, but very inclusive of many edge cases.\n// It handles numbers, mixed alphanumeric combinations, and even\n// null, undefined, and Infinity\nexport const alphanumeric = (rowA, rowB, columnId) => {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n // Force to strings (or \"\" for unsupported types)\n a = toString(a)\n b = toString(b)\n\n // Split on number groups, but keep the delimiter\n // Then remove falsey split values\n a = a.split(reSplitAlphaNumeric).filter(Boolean)\n b = b.split(reSplitAlphaNumeric).filter(Boolean)\n\n // While\n while (a.length && b.length) {\n let aa = a.shift()\n let bb = b.shift()\n\n const an = parseInt(aa, 10)\n const bn = parseInt(bb, 10)\n\n const combo = [an, bn].sort()\n\n // Both are string\n if (isNaN(combo[0])) {\n if (aa > bb) {\n return 1\n }\n if (bb > aa) {\n return -1\n }\n continue\n }\n\n // One is a string, one is a number\n if (isNaN(combo[1])) {\n return isNaN(an) ? -1 : 1\n }\n\n // Both are numbers\n if (an > bn) {\n return 1\n }\n if (bn > an) {\n return -1\n }\n }\n\n return a.length - b.length\n}\nexport function datetime(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n a = a.getTime()\n b = b.getTime()\n\n return compareBasic(a, b)\n}\n\nexport function basic(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n return compareBasic(a, b)\n}\n\nexport function string(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n a = a.split('').filter(Boolean)\n b = b.split('').filter(Boolean)\n\n while (a.length && b.length) {\n let aa = a.shift()\n let bb = b.shift()\n\n let alower = aa.toLowerCase()\n let blower = bb.toLowerCase()\n\n // Case insensitive comparison until characters match\n if (alower > blower) {\n return 1\n }\n if (blower > alower) {\n return -1\n }\n // If lowercase characters are identical\n if (aa > bb) {\n return 1\n }\n if (bb > aa) {\n return -1\n }\n continue\n }\n\n return a.length - b.length\n}\n\nexport function number(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n const replaceNonNumeric = /[^0-9.]/gi\n\n a = Number(String(a).replace(replaceNonNumeric, ''))\n b = Number(String(b).replace(replaceNonNumeric, ''))\n\n return compareBasic(a, b)\n}\n\n// Utils\n\nfunction compareBasic(a, b) {\n return a === b ? 0 : a > b ? 1 : -1\n}\n\nfunction getRowValuesByColumnID(row1, row2, columnId) {\n return [row1.values[columnId], row2.values[columnId]]\n}\n\nfunction toString(a) {\n if (typeof a === 'number') {\n if (isNaN(a) || a === Infinity || a === -Infinity) {\n return ''\n }\n return String(a)\n }\n if (typeof a === 'string') {\n return a\n }\n return ''\n}\n","import React from 'react'\n\nimport {\n actions,\n ensurePluginOrder,\n defaultColumn,\n makePropGetter,\n useGetLatest,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport { getFirstDefined, isFunction } from '../utils'\n\nimport * as sortTypes from '../sortTypes'\n\n// Actions\nactions.resetSortBy = 'resetSortBy'\nactions.setSortBy = 'setSortBy'\nactions.toggleSortBy = 'toggleSortBy'\nactions.clearSortBy = 'clearSortBy'\n\ndefaultColumn.sortType = 'alphanumeric'\ndefaultColumn.sortDescFirst = false\n\nexport const useSortBy = hooks => {\n hooks.getSortByToggleProps = [defaultGetSortByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseSortBy.pluginName = 'useSortBy'\n\nconst defaultGetSortByToggleProps = (props, { instance, column }) => {\n const { isMultiSortEvent = e => e.shiftKey } = instance\n\n return [\n props,\n {\n onClick: column.canSort\n ? e => {\n e.persist()\n column.toggleSortBy(\n undefined,\n !instance.disableMultiSort && isMultiSortEvent(e)\n )\n }\n : undefined,\n style: {\n cursor: column.canSort ? 'pointer' : undefined,\n },\n title: column.canSort ? 'Toggle SortBy' : undefined,\n },\n ]\n}\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n sortBy: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetSortBy) {\n return {\n ...state,\n sortBy: instance.initialState.sortBy || [],\n }\n }\n\n if (action.type === actions.clearSortBy) {\n const { sortBy } = state\n const newSortBy = sortBy.filter(d => d.id !== action.columnId)\n\n return {\n ...state,\n sortBy: newSortBy,\n }\n }\n\n if (action.type === actions.setSortBy) {\n const { sortBy } = action\n return {\n ...state,\n sortBy,\n }\n }\n\n if (action.type === actions.toggleSortBy) {\n const { columnId, desc, multi } = action\n\n const {\n allColumns,\n disableMultiSort,\n disableSortRemove,\n disableMultiRemove,\n maxMultiSortColCount = Number.MAX_SAFE_INTEGER,\n } = instance\n\n const { sortBy } = state\n\n // Find the column for this columnId\n const column = allColumns.find(d => d.id === columnId)\n const { sortDescFirst } = column\n\n // Find any existing sortBy for this column\n const existingSortBy = sortBy.find(d => d.id === columnId)\n const existingIndex = sortBy.findIndex(d => d.id === columnId)\n const hasDescDefined = typeof desc !== 'undefined' && desc !== null\n\n let newSortBy = []\n\n // What should we do with this sort action?\n let sortAction\n\n if (!disableMultiSort && multi) {\n if (existingSortBy) {\n sortAction = 'toggle'\n } else {\n sortAction = 'add'\n }\n } else {\n // Normal mode\n if (existingIndex !== sortBy.length - 1 || sortBy.length !== 1) {\n sortAction = 'replace'\n } else if (existingSortBy) {\n sortAction = 'toggle'\n } else {\n sortAction = 'replace'\n }\n }\n\n // Handle toggle states that will remove the sortBy\n if (\n sortAction === 'toggle' && // Must be toggling\n !disableSortRemove && // If disableSortRemove, disable in general\n !hasDescDefined && // Must not be setting desc\n (multi ? !disableMultiRemove : true) && // If multi, don't allow if disableMultiRemove\n ((existingSortBy && // Finally, detect if it should indeed be removed\n existingSortBy.desc &&\n !sortDescFirst) ||\n (!existingSortBy.desc && sortDescFirst))\n ) {\n sortAction = 'remove'\n }\n\n if (sortAction === 'replace') {\n newSortBy = [\n {\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst,\n },\n ]\n } else if (sortAction === 'add') {\n newSortBy = [\n ...sortBy,\n {\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst,\n },\n ]\n // Take latest n columns\n newSortBy.splice(0, newSortBy.length - maxMultiSortColCount)\n } else if (sortAction === 'toggle') {\n // This flips (or sets) the\n newSortBy = sortBy.map(d => {\n if (d.id === columnId) {\n return {\n ...d,\n desc: hasDescDefined ? desc : !existingSortBy.desc,\n }\n }\n return d\n })\n } else if (sortAction === 'remove') {\n newSortBy = sortBy.filter(d => d.id !== columnId)\n }\n\n return {\n ...state,\n sortBy: newSortBy,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n allColumns,\n orderByFn = defaultOrderByFn,\n sortTypes: userSortTypes,\n manualSortBy,\n defaultCanSort,\n disableSortBy,\n flatHeaders,\n state: { sortBy },\n dispatch,\n plugins,\n getHooks,\n autoResetSortBy = true,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGlobalFilter', 'useGroupBy', 'usePivotColumns'],\n 'useSortBy'\n )\n\n const setSortBy = React.useCallback(\n sortBy => {\n dispatch({ type: actions.setSortBy, sortBy })\n },\n [dispatch]\n )\n\n // Updates sorting based on a columnId, desc flag and multi flag\n const toggleSortBy = React.useCallback(\n (columnId, desc, multi) => {\n dispatch({ type: actions.toggleSortBy, columnId, desc, multi })\n },\n [dispatch]\n )\n\n // use reference to avoid memory leak in #1608\n const getInstance = useGetLatest(instance)\n\n // Add the getSortByToggleProps method to columns and headers\n flatHeaders.forEach(column => {\n const {\n accessor,\n canSort: defaultColumnCanSort,\n disableSortBy: columnDisableSortBy,\n id,\n } = column\n\n const canSort = accessor\n ? getFirstDefined(\n columnDisableSortBy === true ? false : undefined,\n disableSortBy === true ? false : undefined,\n true\n )\n : getFirstDefined(defaultCanSort, defaultColumnCanSort, false)\n\n column.canSort = canSort\n\n if (column.canSort) {\n column.toggleSortBy = (desc, multi) =>\n toggleSortBy(column.id, desc, multi)\n\n column.clearSortBy = () => {\n dispatch({ type: actions.clearSortBy, columnId: column.id })\n }\n }\n\n column.getSortByToggleProps = makePropGetter(\n getHooks().getSortByToggleProps,\n {\n instance: getInstance(),\n column,\n }\n )\n\n const columnSort = sortBy.find(d => d.id === id)\n column.isSorted = !!columnSort\n column.sortedIndex = sortBy.findIndex(d => d.id === id)\n column.isSortedDesc = column.isSorted ? columnSort.desc : undefined\n })\n\n const [sortedRows, sortedFlatRows] = React.useMemo(() => {\n if (manualSortBy || !sortBy.length) {\n return [rows, flatRows]\n }\n\n const sortedFlatRows = []\n\n // Filter out sortBys that correspond to non existing columns\n const availableSortBy = sortBy.filter(sort =>\n allColumns.find(col => col.id === sort.id)\n )\n\n const sortData = rows => {\n // Use the orderByFn to compose multiple sortBy's together.\n // This will also perform a stable sorting using the row index\n // if needed.\n const sortedData = orderByFn(\n rows,\n availableSortBy.map(sort => {\n // Support custom sorting methods for each column\n const column = allColumns.find(d => d.id === sort.id)\n\n if (!column) {\n throw new Error(\n `React-Table: Could not find a column with id: ${sort.id} while sorting`\n )\n }\n\n const { sortType } = column\n\n // Look up sortBy functions in this order:\n // column function\n // column string lookup on user sortType\n // column string lookup on built-in sortType\n // default function\n // default string lookup on user sortType\n // default string lookup on built-in sortType\n const sortMethod =\n isFunction(sortType) ||\n (userSortTypes || {})[sortType] ||\n sortTypes[sortType]\n\n if (!sortMethod) {\n throw new Error(\n `React-Table: Could not find a valid sortType of '${sortType}' for column '${sort.id}'.`\n )\n }\n\n // Return the correct sortFn.\n // This function should always return in ascending order\n return (a, b) => sortMethod(a, b, sort.id, sort.desc)\n }),\n // Map the directions\n availableSortBy.map(sort => {\n // Detect and use the sortInverted option\n const column = allColumns.find(d => d.id === sort.id)\n\n if (column && column.sortInverted) {\n return sort.desc\n }\n\n return !sort.desc\n })\n )\n\n // If there are sub-rows, sort them\n sortedData.forEach(row => {\n sortedFlatRows.push(row)\n if (!row.subRows || row.subRows.length === 0) {\n return\n }\n row.subRows = sortData(row.subRows)\n })\n\n return sortedData\n }\n\n return [sortData(rows), sortedFlatRows]\n }, [\n manualSortBy,\n sortBy,\n rows,\n flatRows,\n allColumns,\n orderByFn,\n userSortTypes,\n ])\n\n const getAutoResetSortBy = useGetLatest(autoResetSortBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSortBy()) {\n dispatch({ type: actions.resetSortBy })\n }\n }, [manualSortBy ? null : data])\n\n Object.assign(instance, {\n preSortedRows: rows,\n preSortedFlatRows: flatRows,\n sortedRows,\n sortedFlatRows,\n rows: sortedRows,\n flatRows: sortedFlatRows,\n setSortBy,\n toggleSortBy,\n })\n}\n\nexport function defaultOrderByFn(arr, funcs, dirs) {\n return [...arr].sort((rowA, rowB) => {\n for (let i = 0; i < funcs.length; i += 1) {\n const sortFn = funcs[i]\n const desc = dirs[i] === false || dirs[i] === 'desc'\n const sortInt = sortFn(rowA, rowB)\n if (sortInt !== 0) {\n return desc ? -sortInt : sortInt\n }\n }\n return dirs[0] ? rowA.index - rowB.index : rowB.index - rowA.index\n })\n}\n","import React from 'react'\n\n//\n\nimport {\n actions,\n ensurePluginOrder,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nimport { expandRows } from '../utils'\n\nconst pluginName = 'usePagination'\n\n// Actions\nactions.resetPage = 'resetPage'\nactions.gotoPage = 'gotoPage'\nactions.setPageSize = 'setPageSize'\n\nexport const usePagination = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nusePagination.pluginName = pluginName\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pageSize: 10,\n pageIndex: 0,\n ...state,\n }\n }\n\n if (action.type === actions.resetPage) {\n return {\n ...state,\n pageIndex: instance.initialState.pageIndex || 0,\n }\n }\n\n if (action.type === actions.gotoPage) {\n const { pageCount, page } = instance\n const newPageIndex = functionalUpdate(action.pageIndex, state.pageIndex)\n let canNavigate = false\n\n if (newPageIndex > state.pageIndex) {\n // next page\n canNavigate =\n pageCount === -1\n ? page.length >= state.pageSize\n : newPageIndex < pageCount\n } else if (newPageIndex < state.pageIndex) {\n // prev page\n canNavigate = newPageIndex > -1\n }\n\n if (!canNavigate) {\n return state\n }\n\n return {\n ...state,\n pageIndex: newPageIndex,\n }\n }\n\n if (action.type === actions.setPageSize) {\n const { pageSize } = action\n const topRowIndex = state.pageSize * state.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...state,\n pageIndex,\n pageSize,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n rows,\n autoResetPage = true,\n manualExpandedKey = 'expanded',\n plugins,\n pageCount: userPageCount,\n paginateExpandedRows = true,\n expandSubRows = true,\n state: {\n pageSize,\n pageIndex,\n expanded,\n globalFilter,\n filters,\n groupBy,\n sortBy,\n },\n dispatch,\n data,\n manualPagination,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],\n 'usePagination'\n )\n\n const getAutoResetPage = useGetLatest(autoResetPage)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPage()) {\n dispatch({ type: actions.resetPage })\n }\n }, [\n dispatch,\n manualPagination ? null : data,\n globalFilter,\n filters,\n groupBy,\n sortBy,\n ])\n\n const pageCount = manualPagination\n ? userPageCount\n : Math.ceil(rows.length / pageSize)\n\n const pageOptions = React.useMemo(\n () =>\n pageCount > 0\n ? [...new Array(pageCount)].fill(null).map((d, i) => i)\n : [],\n [pageCount]\n )\n\n const page = React.useMemo(() => {\n let page\n\n if (manualPagination) {\n page = rows\n } else {\n const pageStart = pageSize * pageIndex\n const pageEnd = pageStart + pageSize\n\n page = rows.slice(pageStart, pageEnd)\n }\n\n if (paginateExpandedRows) {\n return page\n }\n\n return expandRows(page, { manualExpandedKey, expanded, expandSubRows })\n }, [\n expandSubRows,\n expanded,\n manualExpandedKey,\n manualPagination,\n pageIndex,\n pageSize,\n paginateExpandedRows,\n rows,\n ])\n\n const canPreviousPage = pageIndex > 0\n const canNextPage =\n pageCount === -1 ? page.length >= pageSize : pageIndex < pageCount - 1\n\n const gotoPage = React.useCallback(\n pageIndex => {\n dispatch({ type: actions.gotoPage, pageIndex })\n },\n [dispatch]\n )\n\n const previousPage = React.useCallback(() => {\n return gotoPage(old => old - 1)\n }, [gotoPage])\n\n const nextPage = React.useCallback(() => {\n return gotoPage(old => old + 1)\n }, [gotoPage])\n\n const setPageSize = React.useCallback(\n pageSize => {\n dispatch({ type: actions.setPageSize, pageSize })\n },\n [dispatch]\n )\n\n Object.assign(instance, {\n pageOptions,\n pageCount,\n page,\n canPreviousPage,\n canNextPage,\n gotoPage,\n previousPage,\n nextPage,\n setPageSize,\n })\n}\n","/* istanbul ignore file */\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nimport { flattenColumns, getFirstDefined } from '../utils'\n\n// Actions\nactions.resetPivot = 'resetPivot'\nactions.togglePivot = 'togglePivot'\n\nexport const _UNSTABLE_usePivotColumns = hooks => {\n hooks.getPivotToggleProps = [defaultGetPivotToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstanceAfterData.push(useInstanceAfterData)\n hooks.allColumns.push(allColumns)\n hooks.accessValue.push(accessValue)\n hooks.materializedColumns.push(materializedColumns)\n hooks.materializedColumnsDeps.push(materializedColumnsDeps)\n hooks.visibleColumns.push(visibleColumns)\n hooks.visibleColumnsDeps.push(visibleColumnsDeps)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\n_UNSTABLE_usePivotColumns.pluginName = 'usePivotColumns'\n\nconst defaultPivotColumns = []\n\nconst defaultGetPivotToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canPivot\n ? e => {\n e.persist()\n header.togglePivot()\n }\n : undefined,\n style: {\n cursor: header.canPivot ? 'pointer' : undefined,\n },\n title: 'Toggle Pivot',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pivotColumns: defaultPivotColumns,\n ...state,\n }\n }\n\n if (action.type === actions.resetPivot) {\n return {\n ...state,\n pivotColumns: instance.initialState.pivotColumns || defaultPivotColumns,\n }\n }\n\n if (action.type === actions.togglePivot) {\n const { columnId, value: setPivot } = action\n\n const resolvedPivot =\n typeof setPivot !== 'undefined'\n ? setPivot\n : !state.pivotColumns.includes(columnId)\n\n if (resolvedPivot) {\n return {\n ...state,\n pivotColumns: [...state.pivotColumns, columnId],\n }\n }\n\n return {\n ...state,\n pivotColumns: state.pivotColumns.filter(d => d !== columnId),\n }\n }\n}\n\nfunction useInstanceAfterData(instance) {\n instance.allColumns.forEach(column => {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id)\n })\n}\n\nfunction allColumns(columns, { instance }) {\n columns.forEach(column => {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id)\n column.uniqueValues = new Set()\n })\n return columns\n}\n\nfunction accessValue(value, { column }) {\n if (column.uniqueValues && typeof value !== 'undefined') {\n column.uniqueValues.add(value)\n }\n return value\n}\n\nfunction materializedColumns(materialized, { instance }) {\n const { allColumns, state } = instance\n\n if (!state.pivotColumns.length || !state.groupBy || !state.groupBy.length) {\n return materialized\n }\n\n const pivotColumns = state.pivotColumns\n .map(id => allColumns.find(d => d.id === id))\n .filter(Boolean)\n\n const sourceColumns = allColumns.filter(\n d =>\n !d.isPivotSource &&\n !state.groupBy.includes(d.id) &&\n !state.pivotColumns.includes(d.id)\n )\n\n const buildPivotColumns = (depth = 0, parent, pivotFilters = []) => {\n const pivotColumn = pivotColumns[depth]\n\n if (!pivotColumn) {\n return sourceColumns.map(sourceColumn => {\n // TODO: We could offer support here for renesting pivoted\n // columns inside copies of their header groups. For now,\n // that seems like it would be (1) overkill on nesting, considering\n // you already get nesting for every pivot level and (2)\n // really hard. :)\n\n return {\n ...sourceColumn,\n canPivot: false,\n isPivoted: true,\n parent,\n depth: depth,\n id: `${parent ? `${parent.id}.${sourceColumn.id}` : sourceColumn.id}`,\n accessor: (originalRow, i, row) => {\n if (pivotFilters.every(filter => filter(row))) {\n return row.values[sourceColumn.id]\n }\n },\n }\n })\n }\n\n const uniqueValues = Array.from(pivotColumn.uniqueValues).sort()\n\n return uniqueValues.map(uniqueValue => {\n const columnGroup = {\n ...pivotColumn,\n Header:\n pivotColumn.PivotHeader || typeof pivotColumn.header === 'string'\n ? `${pivotColumn.Header}: ${uniqueValue}`\n : uniqueValue,\n isPivotGroup: true,\n parent,\n depth,\n id: parent\n ? `${parent.id}.${pivotColumn.id}.${uniqueValue}`\n : `${pivotColumn.id}.${uniqueValue}`,\n pivotValue: uniqueValue,\n }\n\n columnGroup.columns = buildPivotColumns(depth + 1, columnGroup, [\n ...pivotFilters,\n row => row.values[pivotColumn.id] === uniqueValue,\n ])\n\n return columnGroup\n })\n }\n\n const newMaterialized = flattenColumns(buildPivotColumns())\n\n return [...materialized, ...newMaterialized]\n}\n\nfunction materializedColumnsDeps(\n deps,\n {\n instance: {\n state: { pivotColumns, groupBy },\n },\n }\n) {\n return [...deps, pivotColumns, groupBy]\n}\n\nfunction visibleColumns(visibleColumns, { instance: { state } }) {\n visibleColumns = visibleColumns.filter(d => !d.isPivotSource)\n\n if (state.pivotColumns.length && state.groupBy && state.groupBy.length) {\n visibleColumns = visibleColumns.filter(\n column => column.isGrouped || column.isPivoted\n )\n }\n\n return visibleColumns\n}\n\nfunction visibleColumnsDeps(deps, { instance }) {\n return [...deps, instance.state.pivotColumns, instance.state.groupBy]\n}\n\nfunction useInstance(instance) {\n const {\n columns,\n allColumns,\n flatHeaders,\n // pivotFn = defaultPivotFn,\n // manualPivot,\n getHooks,\n plugins,\n dispatch,\n autoResetPivot = true,\n manaulPivot,\n disablePivot,\n defaultCanPivot,\n } = instance\n\n ensurePluginOrder(plugins, ['useGroupBy'], 'usePivotColumns')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultPivot: defaultColumnPivot,\n disablePivot: columnDisablePivot,\n } = column\n\n column.canPivot = accessor\n ? getFirstDefined(\n column.canPivot,\n columnDisablePivot === true ? false : undefined,\n disablePivot === true ? false : undefined,\n true\n )\n : getFirstDefined(\n column.canPivot,\n defaultColumnPivot,\n defaultCanPivot,\n false\n )\n\n if (column.canPivot) {\n column.togglePivot = () => instance.togglePivot(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const togglePivot = (columnId, value) => {\n dispatch({ type: actions.togglePivot, columnId, value })\n }\n\n flatHeaders.forEach(header => {\n header.getPivotToggleProps = makePropGetter(\n getHooks().getPivotToggleProps,\n {\n instance: getInstance(),\n header,\n }\n )\n })\n\n const getAutoResetPivot = useGetLatest(autoResetPivot)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPivot()) {\n dispatch({ type: actions.resetPivot })\n }\n }, [dispatch, manaulPivot ? null : columns])\n\n Object.assign(instance, {\n togglePivot,\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the pivotColumns and the pivot cell for the row\n cell.isPivoted = cell.column.isPivoted\n })\n}\n","import React from 'react'\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useGetLatest,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nconst pluginName = 'useRowSelect'\n\n// Actions\nactions.resetSelectedRows = 'resetSelectedRows'\nactions.toggleAllRowsSelected = 'toggleAllRowsSelected'\nactions.toggleRowSelected = 'toggleRowSelected'\nactions.toggleAllPageRowsSelected = 'toggleAllPageRowsSelected'\n\nexport const useRowSelect = hooks => {\n hooks.getToggleRowSelectedProps = [defaultGetToggleRowSelectedProps]\n hooks.getToggleAllRowsSelectedProps = [defaultGetToggleAllRowsSelectedProps]\n hooks.getToggleAllPageRowsSelectedProps = [\n defaultGetToggleAllPageRowsSelectedProps,\n ]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowSelect.pluginName = pluginName\n\nconst defaultGetToggleRowSelectedProps = (props, { instance, row }) => {\n const { manualRowSelectedKey = 'isSelected' } = instance\n let checked = false\n\n if (row.original && row.original[manualRowSelectedKey]) {\n checked = true\n } else {\n checked = row.isSelected\n }\n\n return [\n props,\n {\n onChange: e => {\n row.toggleRowSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked,\n title: 'Toggle Row Selected',\n indeterminate: row.isSomeSelected,\n },\n ]\n}\n\nconst defaultGetToggleAllRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleAllRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: instance.isAllRowsSelected,\n title: 'Toggle All Rows Selected',\n indeterminate: Boolean(\n !instance.isAllRowsSelected &&\n Object.keys(instance.state.selectedRowIds).length\n ),\n },\n]\n\nconst defaultGetToggleAllPageRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange(e) {\n instance.toggleAllPageRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: instance.isAllPageRowsSelected,\n title: 'Toggle All Current Page Rows Selected',\n indeterminate: Boolean(\n !instance.isAllPageRowsSelected &&\n instance.page.some(({ id }) => instance.state.selectedRowIds[id])\n ),\n },\n]\n\n// eslint-disable-next-line max-params\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n selectedRowIds: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetSelectedRows) {\n return {\n ...state,\n selectedRowIds: instance.initialState.selectedRowIds || {},\n }\n }\n\n if (action.type === actions.toggleAllRowsSelected) {\n const { value: setSelected } = action\n const {\n isAllRowsSelected,\n rowsById,\n nonGroupedRowsById = rowsById,\n } = instance\n\n const selectAll =\n typeof setSelected !== 'undefined' ? setSelected : !isAllRowsSelected\n\n // Only remove/add the rows that are visible on the screen\n // Leave all the other rows that are selected alone.\n const selectedRowIds = Object.assign({}, state.selectedRowIds)\n\n if (selectAll) {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n selectedRowIds[rowId] = true\n })\n } else {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n delete selectedRowIds[rowId]\n })\n }\n\n return {\n ...state,\n selectedRowIds,\n }\n }\n\n if (action.type === actions.toggleRowSelected) {\n const { id, value: setSelected } = action\n const { rowsById, selectSubRows = true, getSubRows } = instance\n const isSelected = state.selectedRowIds[id]\n const shouldExist =\n typeof setSelected !== 'undefined' ? setSelected : !isSelected\n\n if (isSelected === shouldExist) {\n return state\n }\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (row) {\n if (!row.isGrouped) {\n if (shouldExist) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && getSubRows(row)) {\n return getSubRows(row).forEach(row => handleRowById(row.id))\n }\n }\n }\n\n handleRowById(id)\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds,\n }\n }\n\n if (action.type === actions.toggleAllPageRowsSelected) {\n const { value: setSelected } = action\n const {\n page,\n rowsById,\n selectSubRows = true,\n isAllPageRowsSelected,\n getSubRows,\n } = instance\n\n const selectAll =\n typeof setSelected !== 'undefined' ? setSelected : !isAllPageRowsSelected\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (!row.isGrouped) {\n if (selectAll) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && getSubRows(row)) {\n return getSubRows(row).forEach(row => handleRowById(row.id))\n }\n }\n\n page.forEach(row => handleRowById(row.id))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds,\n }\n }\n return state\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n getHooks,\n plugins,\n rowsById,\n nonGroupedRowsById = rowsById,\n autoResetSelectedRows = true,\n state: { selectedRowIds },\n selectSubRows = true,\n dispatch,\n page,\n getSubRows,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded', 'usePagination'],\n 'useRowSelect'\n )\n\n const selectedFlatRows = React.useMemo(() => {\n const selectedFlatRows = []\n\n rows.forEach(row => {\n const isSelected = selectSubRows\n ? getRowIsSelected(row, selectedRowIds, getSubRows)\n : !!selectedRowIds[row.id]\n row.isSelected = !!isSelected\n row.isSomeSelected = isSelected === null\n\n if (isSelected) {\n selectedFlatRows.push(row)\n }\n })\n\n return selectedFlatRows\n }, [rows, selectSubRows, selectedRowIds, getSubRows])\n\n let isAllRowsSelected = Boolean(\n Object.keys(nonGroupedRowsById).length && Object.keys(selectedRowIds).length\n )\n\n let isAllPageRowsSelected = isAllRowsSelected\n\n if (isAllRowsSelected) {\n if (Object.keys(nonGroupedRowsById).some(id => !selectedRowIds[id])) {\n isAllRowsSelected = false\n }\n }\n\n if (!isAllRowsSelected) {\n if (page && page.length && page.some(({ id }) => !selectedRowIds[id])) {\n isAllPageRowsSelected = false\n }\n }\n\n const getAutoResetSelectedRows = useGetLatest(autoResetSelectedRows)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSelectedRows()) {\n dispatch({ type: actions.resetSelectedRows })\n }\n }, [dispatch, data])\n\n const toggleAllRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsSelected, value }),\n [dispatch]\n )\n\n const toggleAllPageRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllPageRowsSelected, value }),\n [dispatch]\n )\n\n const toggleRowSelected = React.useCallback(\n (id, value) => dispatch({ type: actions.toggleRowSelected, id, value }),\n [dispatch]\n )\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllRowsSelectedProps,\n { instance: getInstance() }\n )\n\n const getToggleAllPageRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllPageRowsSelectedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n selectedFlatRows,\n isAllRowsSelected,\n isAllPageRowsSelected,\n toggleRowSelected,\n toggleAllRowsSelected,\n getToggleAllRowsSelectedProps,\n getToggleAllPageRowsSelectedProps,\n toggleAllPageRowsSelected,\n })\n}\n\nfunction prepareRow(row, { instance }) {\n row.toggleRowSelected = set => instance.toggleRowSelected(row.id, set)\n\n row.getToggleRowSelectedProps = makePropGetter(\n instance.getHooks().getToggleRowSelectedProps,\n { instance: instance, row }\n )\n}\n\nfunction getRowIsSelected(row, selectedRowIds, getSubRows) {\n if (selectedRowIds[row.id]) {\n return true\n }\n\n const subRows = getSubRows(row)\n\n if (subRows && subRows.length) {\n let allChildrenSelected = true\n let someSelected = false\n\n subRows.forEach(subRow => {\n // Bail out early if we know both of these\n if (someSelected && !allChildrenSelected) {\n return\n }\n\n if (getRowIsSelected(subRow, selectedRowIds, getSubRows)) {\n someSelected = true\n } else {\n allChildrenSelected = false\n }\n })\n return allChildrenSelected ? true : someSelected ? null : false\n }\n\n return false\n}\n","import React from 'react'\n\nimport {\n actions,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nconst defaultInitialRowStateAccessor = row => ({})\nconst defaultInitialCellStateAccessor = cell => ({})\n\n// Actions\nactions.setRowState = 'setRowState'\nactions.setCellState = 'setCellState'\nactions.resetRowState = 'resetRowState'\n\nexport const useRowState = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowState.pluginName = 'useRowState'\n\nfunction reducer(state, action, previousState, instance) {\n const {\n initialRowStateAccessor = defaultInitialRowStateAccessor,\n initialCellStateAccessor = defaultInitialCellStateAccessor,\n rowsById,\n } = instance\n\n if (action.type === actions.init) {\n return {\n rowState: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetRowState) {\n return {\n ...state,\n rowState: instance.initialState.rowState || {},\n }\n }\n\n if (action.type === actions.setRowState) {\n const { rowId, value } = action\n\n const oldRowState =\n typeof state.rowState[rowId] !== 'undefined'\n ? state.rowState[rowId]\n : initialRowStateAccessor(rowsById[rowId])\n\n return {\n ...state,\n rowState: {\n ...state.rowState,\n [rowId]: functionalUpdate(value, oldRowState),\n },\n }\n }\n\n if (action.type === actions.setCellState) {\n const { rowId, columnId, value } = action\n\n const oldRowState =\n typeof state.rowState[rowId] !== 'undefined'\n ? state.rowState[rowId]\n : initialRowStateAccessor(rowsById[rowId])\n\n const oldCellState =\n typeof oldRowState?.cellState?.[columnId] !== 'undefined'\n ? oldRowState.cellState[columnId]\n : initialCellStateAccessor(\n rowsById[rowId]?.cells?.find(cell => cell.column.id === columnId)\n )\n\n return {\n ...state,\n rowState: {\n ...state.rowState,\n [rowId]: {\n ...oldRowState,\n cellState: {\n ...(oldRowState.cellState || {}),\n [columnId]: functionalUpdate(value, oldCellState),\n },\n },\n },\n }\n }\n}\n\nfunction useInstance(instance) {\n const { autoResetRowState = true, data, dispatch } = instance\n\n const setRowState = React.useCallback(\n (rowId, value) =>\n dispatch({\n type: actions.setRowState,\n rowId,\n value,\n }),\n [dispatch]\n )\n\n const setCellState = React.useCallback(\n (rowId, columnId, value) =>\n dispatch({\n type: actions.setCellState,\n rowId,\n columnId,\n value,\n }),\n [dispatch]\n )\n\n const getAutoResetRowState = useGetLatest(autoResetRowState)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetRowState()) {\n dispatch({ type: actions.resetRowState })\n }\n }, [data])\n\n Object.assign(instance, {\n setRowState,\n setCellState,\n })\n}\n\nfunction prepareRow(row, { instance }) {\n const {\n initialRowStateAccessor = defaultInitialRowStateAccessor,\n initialCellStateAccessor = defaultInitialCellStateAccessor,\n state: { rowState },\n } = instance\n\n if (row) {\n row.state =\n typeof rowState[row.id] !== 'undefined'\n ? rowState[row.id]\n : initialRowStateAccessor(row)\n\n row.setState = updater => {\n return instance.setRowState(row.id, updater)\n }\n\n row.cells.forEach(cell => {\n if (!row.state.cellState) {\n row.state.cellState = {}\n }\n\n cell.state =\n typeof row.state.cellState[cell.column.id] !== 'undefined'\n ? row.state.cellState[cell.column.id]\n : initialCellStateAccessor(cell)\n\n cell.setState = updater => {\n return instance.setCellState(row.id, cell.column.id, updater)\n }\n })\n }\n}\n","import React from 'react'\n\nimport { functionalUpdate, actions } from '../publicUtils'\n\n// Actions\nactions.resetColumnOrder = 'resetColumnOrder'\nactions.setColumnOrder = 'setColumnOrder'\n\nexport const useColumnOrder = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => {\n return [...deps, instance.state.columnOrder]\n })\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n}\n\nuseColumnOrder.pluginName = 'useColumnOrder'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n columnOrder: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetColumnOrder) {\n return {\n ...state,\n columnOrder: instance.initialState.columnOrder || [],\n }\n }\n\n if (action.type === actions.setColumnOrder) {\n return {\n ...state,\n columnOrder: functionalUpdate(action.columnOrder, state.columnOrder),\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { columnOrder },\n },\n }\n) {\n // If there is no order, return the normal columns\n if (!columnOrder || !columnOrder.length) {\n return columns\n }\n\n const columnOrderCopy = [...columnOrder]\n\n // If there is an order, make a copy of the columns\n const columnsCopy = [...columns]\n\n // And make a new ordered array of the columns\n const columnsInOrder = []\n\n // Loop over the columns and place them in order into the new array\n while (columnsCopy.length && columnOrderCopy.length) {\n const targetColumnId = columnOrderCopy.shift()\n const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId)\n if (foundIndex > -1) {\n columnsInOrder.push(columnsCopy.splice(foundIndex, 1)[0])\n }\n }\n\n // If there are any columns left, add them to the end\n return [...columnsInOrder, ...columnsCopy]\n}\n\nfunction useInstance(instance) {\n const { dispatch } = instance\n\n instance.setColumnOrder = React.useCallback(\n columnOrder => {\n return dispatch({ type: actions.setColumnOrder, columnOrder })\n },\n [dispatch]\n )\n}\n","import React from 'react'\n\nimport {\n actions,\n defaultColumn,\n makePropGetter,\n useGetLatest,\n ensurePluginOrder,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport { getFirstDefined, passiveEventSupported } from '../utils'\n\n// Default Column\ndefaultColumn.canResize = true\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport const useResizeColumns = hooks => {\n hooks.getResizerProps = [defaultGetResizerProps]\n hooks.getHeaderProps.push({\n style: {\n position: 'relative',\n },\n })\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n}\n\nconst defaultGetResizerProps = (props, { instance, header }) => {\n const { dispatch } = instance\n\n const onResizeStart = (e, header) => {\n let isTouchEvent = false\n if (e.type === 'touchstart') {\n // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n if (e.touches && e.touches.length > 1) {\n return\n }\n isTouchEvent = true\n }\n const headersToResize = getLeafHeaders(header)\n const headerIdWidths = headersToResize.map(d => [d.id, d.totalWidth])\n\n const clientX = isTouchEvent ? Math.round(e.touches[0].clientX) : e.clientX\n\n let raf\n let mostRecentClientX\n\n const dispatchEnd = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnDoneResizing })\n }\n const dispatchMove = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnResizing, clientX: mostRecentClientX })\n }\n\n const scheduleDispatchMoveOnNextAnimationFrame = clientXPos => {\n mostRecentClientX = clientXPos\n if (!raf) {\n raf = window.requestAnimationFrame(dispatchMove)\n }\n }\n\n const handlersAndEvents = {\n mouse: {\n moveEvent: 'mousemove',\n moveHandler: e => scheduleDispatchMoveOnNextAnimationFrame(e.clientX),\n upEvent: 'mouseup',\n upHandler: e => {\n document.removeEventListener(\n 'mousemove',\n handlersAndEvents.mouse.moveHandler\n )\n document.removeEventListener(\n 'mouseup',\n handlersAndEvents.mouse.upHandler\n )\n dispatchEnd()\n },\n },\n touch: {\n moveEvent: 'touchmove',\n moveHandler: e => {\n if (e.cancelable) {\n e.preventDefault()\n e.stopPropagation()\n }\n scheduleDispatchMoveOnNextAnimationFrame(e.touches[0].clientX)\n return false\n },\n upEvent: 'touchend',\n upHandler: e => {\n document.removeEventListener(\n handlersAndEvents.touch.moveEvent,\n handlersAndEvents.touch.moveHandler\n )\n document.removeEventListener(\n handlersAndEvents.touch.upEvent,\n handlersAndEvents.touch.moveHandler\n )\n dispatchEnd()\n },\n },\n }\n\n const events = isTouchEvent\n ? handlersAndEvents.touch\n : handlersAndEvents.mouse\n const passiveIfSupported = passiveEventSupported()\n ? { passive: false }\n : false\n document.addEventListener(\n events.moveEvent,\n events.moveHandler,\n passiveIfSupported\n )\n document.addEventListener(\n events.upEvent,\n events.upHandler,\n passiveIfSupported\n )\n\n dispatch({\n type: actions.columnStartResizing,\n columnId: header.id,\n columnWidth: header.totalWidth,\n headerIdWidths,\n clientX,\n })\n }\n\n return [\n props,\n {\n onMouseDown: e => e.persist() || onResizeStart(e, header),\n onTouchStart: e => e.persist() || onResizeStart(e, header),\n style: {\n cursor: 'col-resize',\n },\n draggable: false,\n role: 'separator',\n },\n ]\n}\n\nuseResizeColumns.pluginName = 'useResizeColumns'\n\nfunction reducer(state, action) {\n if (action.type === actions.init) {\n return {\n columnResizing: {\n columnWidths: {},\n },\n ...state,\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n columnResizing: {\n columnWidths: {},\n },\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { clientX, columnId, columnWidth, headerIdWidths } = action\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: clientX,\n headerIdWidths,\n columnWidth,\n isResizingColumn: columnId,\n },\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX, columnWidth, headerIdWidths = [] } = state.columnResizing\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.max(\n headerWidth + headerWidth * percentageDeltaX,\n 0\n )\n })\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n columnWidths: {\n ...state.columnResizing.columnWidths,\n ...newColumnWidths,\n },\n },\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: null,\n isResizingColumn: null,\n },\n }\n }\n}\n\nconst useInstanceBeforeDimensions = instance => {\n const {\n flatHeaders,\n disableResizing,\n getHooks,\n state: { columnResizing },\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n flatHeaders.forEach(header => {\n const canResize = getFirstDefined(\n header.disableResizing === true ? false : undefined,\n disableResizing === true ? false : undefined,\n true\n )\n\n header.canResize = canResize\n header.width =\n columnResizing.columnWidths[header.id] ||\n header.originalWidth ||\n header.width\n header.isResizing = columnResizing.isResizingColumn === header.id\n\n if (canResize) {\n header.getResizerProps = makePropGetter(getHooks().getResizerProps, {\n instance: getInstance(),\n header,\n })\n }\n })\n}\n\nfunction useInstance(instance) {\n const { plugins, dispatch, autoResetResize = true, columns } = instance\n\n ensurePluginOrder(plugins, ['useAbsoluteLayout'], 'useResizeColumns')\n\n const getAutoResetResize = useGetLatest(autoResetResize)\n useMountedLayoutEffect(() => {\n if (getAutoResetResize()) {\n dispatch({ type: actions.resetResize })\n }\n }, [columns])\n\n const resetResizing = React.useCallback(\n () => dispatch({ type: actions.resetResize }),\n [dispatch]\n )\n\n Object.assign(instance, {\n resetResizing,\n })\n}\n\nfunction getLeafHeaders(header) {\n const leafHeaders = []\n const recurseHeader = header => {\n if (header.columns && header.columns.length) {\n header.columns.map(recurseHeader)\n }\n leafHeaders.push(header)\n }\n recurseHeader(header)\n return leafHeaders\n}\n","import { actions } from '../publicUtils'\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport function useGridLayout(hooks) {\n hooks.stateReducers.push(reducer)\n hooks.getTableProps.push(getTableProps)\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getRowProps.push(getRowProps)\n}\n\nuseGridLayout.pluginName = 'useGridLayout'\n\nconst getTableProps = (props, { instance }) => {\n const gridTemplateColumns = instance.visibleColumns.map(column => {\n if (instance.state.gridLayout.columnWidths[column.id])\n return `${instance.state.gridLayout.columnWidths[column.id]}px`\n // When resizing, lock the width of all unset columns\n // instead of using user-provided width or defaultColumn width,\n // which could potentially be 'auto' or 'fr' units that don't scale linearly\n if (instance.state.columnResizing?.isResizingColumn)\n return `${instance.state.gridLayout.startWidths[column.id]}px`\n if (typeof column.width === 'number') return `${column.width}px`\n return column.width\n })\n return [\n props,\n {\n style: {\n display: `grid`,\n gridTemplateColumns: gridTemplateColumns.join(` `),\n },\n },\n ]\n}\n\nconst getHeaderProps = (props, { column }) => [\n props,\n {\n id: `header-cell-${column.id}`,\n style: {\n position: `sticky`, //enables a scroll wrapper to be placed around the table and have sticky headers\n gridColumn: `span ${column.totalVisibleHeaderCount}`,\n },\n },\n]\n\nconst getRowProps = (props, { row }) => {\n if (row.isExpanded) {\n return [\n props,\n {\n style: {\n gridColumn: `1 / ${row.cells.length + 1}`,\n },\n },\n ]\n }\n return [props, {}]\n}\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n gridLayout: {\n columnWidths: {},\n },\n ...state,\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n gridLayout: {\n columnWidths: {},\n },\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { columnId, headerIdWidths } = action\n const columnWidth = getElementWidth(columnId)\n\n if (columnWidth !== undefined) {\n const startWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: getElementWidth(column.id),\n }),\n {}\n )\n const minWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: column.minWidth,\n }),\n {}\n )\n const maxWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: column.maxWidth,\n }),\n {}\n )\n\n const headerIdGridWidths = headerIdWidths.map(([headerId]) => [\n headerId,\n getElementWidth(headerId),\n ])\n\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n startWidths,\n minWidths,\n maxWidths,\n headerIdGridWidths,\n columnWidth,\n },\n }\n } else {\n return state\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX } = state.columnResizing\n const {\n columnWidth,\n minWidths,\n maxWidths,\n headerIdGridWidths = [],\n } = state.gridLayout\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdGridWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.min(\n Math.max(\n minWidths[headerId],\n headerWidth + headerWidth * percentageDeltaX\n ),\n maxWidths[headerId]\n )\n })\n\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n columnWidths: {\n ...state.gridLayout.columnWidths,\n ...newColumnWidths,\n },\n },\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n startWidths: {},\n minWidths: {},\n maxWidths: {},\n },\n }\n }\n}\n\nfunction getElementWidth(columnId) {\n const width = document.getElementById(`header-cell-${columnId}`)?.offsetWidth\n\n if (width !== undefined) {\n return width\n }\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window.reactR;","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3)\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\n","import {IMPORT, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT} from './Enum.js'\nimport {hash, charat, strlen, indexof, replace} from './Utility.js'\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {string}\n */\nexport function prefix (value, length) {\n\tswitch (hash(value, length)) {\n\t\t// color-adjust\n\t\tcase 5103:\n\t\t\treturn WEBKIT + 'print-' + value + value\n\t\t// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\t\tcase 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:\n\t\t// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\t\tcase 5572: case 6356: case 5844: case 3191: case 6645: case 3005:\n\t\t// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\t\tcase 6391: case 5879: case 5623: case 6135: case 4599: case 4855:\n\t\t// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\t\tcase 4215: case 6389: case 5109: case 5365: case 5621: case 3829:\n\t\t\treturn WEBKIT + value + value\n\t\t// appearance, user-select, transform, hyphens, text-size-adjust\n\t\tcase 5349: case 4246: case 4810: case 6968: case 2756:\n\t\t\treturn WEBKIT + value + MOZ + value + MS + value + value\n\t\t// flex, flex-direction\n\t\tcase 6828: case 4268:\n\t\t\treturn WEBKIT + value + MS + value + value\n\t\t// order\n\t\tcase 6165:\n\t\t\treturn WEBKIT + value + MS + 'flex-' + value + value\n\t\t// align-items\n\t\tcase 5187:\n\t\t\treturn WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value\n\t\t// align-self\n\t\tcase 5443:\n\t\t\treturn WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value\n\t\t// align-content\n\t\tcase 4675:\n\t\t\treturn WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value\n\t\t// flex-shrink\n\t\tcase 5548:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value\n\t\t// flex-basis\n\t\tcase 5292:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value\n\t\t// flex-grow\n\t\tcase 6060:\n\t\t\treturn WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value\n\t\t// transition\n\t\tcase 4554:\n\t\t\treturn WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value\n\t\t// cursor\n\t\tcase 6187:\n\t\t\treturn replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value\n\t\t// background, background-image\n\t\tcase 5495: case 3959:\n\t\t\treturn replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1')\n\t\t// justify-content\n\t\tcase 4968:\n\t\t\treturn replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value\n\t\t// (margin|padding)-inline-(start|end)\n\t\tcase 4095: case 3583: case 4068: case 2532:\n\t\t\treturn replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value\n\t\t// (min|max)?(width|height|inline-size|block-size)\n\t\tcase 8116: case 7059: case 5753: case 5535:\n\t\tcase 5445: case 5701: case 4933: case 4677:\n\t\tcase 5533: case 5789: case 5021: case 4765:\n\t\t\t// stretch, max-content, min-content, fill-available\n\t\t\tif (strlen(value) - 1 - length > 6)\n\t\t\t\tswitch (charat(value, length + 1)) {\n\t\t\t\t\t// (m)ax-content, (m)in-content\n\t\t\t\t\tcase 109:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (charat(value, length + 4) !== 45)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t// (f)ill-available, (f)it-content\n\t\t\t\t\tcase 102:\n\t\t\t\t\t\treturn replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value\n\t\t\t\t\t// (s)tretch\n\t\t\t\t\tcase 115:\n\t\t\t\t\t\treturn ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value\n\t\t\t\t}\n\t\t\tbreak\n\t\t// position: sticky\n\t\tcase 4949:\n\t\t\t// (s)ticky?\n\t\t\tif (charat(value, length + 1) !== 115)\n\t\t\t\tbreak\n\t\t// display: (flex|inline-flex)\n\t\tcase 6444:\n\t\t\tswitch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n\t\t\t\t// stic(k)y\n\t\t\t\tcase 107:\n\t\t\t\t\treturn replace(value, ':', ':' + WEBKIT) + value\n\t\t\t\t// (inline-)?fl(e)x\n\t\t\t\tcase 101:\n\t\t\t\t\treturn replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value\n\t\t\t}\n\t\t\tbreak\n\t\t// writing-mode\n\t\tcase 5936:\n\t\t\tswitch (charat(value, length + 11)) {\n\t\t\t\t// vertical-l(r)\n\t\t\t\tcase 114:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value\n\t\t\t\t// vertical-r(l)\n\t\t\t\tcase 108:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value\n\t\t\t\t// horizontal(-)tb\n\t\t\t\tcase 45:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value\n\t\t\t}\n\n\t\t\treturn WEBKIT + value + MS + value + value\n\t}\n\n\treturn value\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && characters.charCodeAt(length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset:\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule) {\n\t\t\t\t\t\t\t\t\t// d m s\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, stringify, COMMENT, rulesheet, middleware, prefixer, serialize, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar last = function last(arr) {\n return arr.length ? arr[arr.length - 1] : null;\n}; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244\n\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule') return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses && cache.compat !== true) {\n var prevElement = index > 0 ? children[index - 1] : null;\n\n if (prevElement && isIgnoringComment(last(prevElement.children))) {\n return;\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if ( key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport default createCache;\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length)\n\t\t\t\t\tbreak\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport default murmur2;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n var maybeStyles = cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","import createCache from '@emotion/cache';\nimport { serializeStyles } from '@emotion/serialize';\nimport { getRegisteredStyles, insertStyles } from '@emotion/utils';\n\nfunction insertWithoutScoping(cache, serialized) {\n if (cache.inserted[serialized.name] === undefined) {\n return cache.insert('', serialized, cache.sheet, true);\n }\n}\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar createEmotion = function createEmotion(options) {\n var cache = createCache(options); // $FlowFixMe\n\n cache.sheet.speedy = function (value) {\n if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {\n throw new Error('speedy must be changed before any rules are inserted');\n }\n\n this.isSpeedy = value;\n };\n\n cache.compat = true;\n\n var css = function css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered, undefined);\n insertStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var keyframes = function keyframes() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n var animation = \"animation-\" + serialized.name;\n insertWithoutScoping(cache, {\n name: serialized.name,\n styles: \"@keyframes \" + animation + \"{\" + serialized.styles + \"}\"\n });\n return animation;\n };\n\n var injectGlobal = function injectGlobal() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n insertWithoutScoping(cache, serialized);\n };\n\n var cx = function cx() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n return {\n css: css,\n cx: cx,\n injectGlobal: injectGlobal,\n keyframes: keyframes,\n hydrate: function hydrate(ids) {\n ids.forEach(function (key) {\n cache.inserted[key] = true;\n });\n },\n flush: function flush() {\n cache.registered = {};\n cache.inserted = {};\n cache.sheet.flush();\n },\n // $FlowFixMe\n sheet: cache.sheet,\n cache: cache,\n getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),\n merge: merge.bind(null, cache.registered, css)\n };\n};\n\nvar classnames = function classnames(args) {\n var cls = '';\n\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nexport default createEmotion;\n","import createEmotion from '@emotion/css/create-instance'\n\nimport { isBrowser, removeEmptyProps } from './utils'\n\nexport function createTheme(options) {\n if (!options) return null\n let {\n color,\n backgroundColor,\n borderColor,\n borderWidth,\n stripedColor,\n highlightColor,\n cellPadding,\n style,\n\n tableBorderColor = borderColor,\n tableBorderWidth = borderWidth,\n tableStyle,\n\n headerBorderColor = borderColor,\n headerBorderWidth = borderWidth,\n headerStyle,\n\n groupHeaderBorderColor = borderColor,\n groupHeaderBorderWidth = borderWidth,\n groupHeaderStyle,\n\n tableBodyStyle,\n\n rowGroupStyle,\n\n rowStyle,\n rowStripedStyle,\n rowHighlightStyle,\n rowSelectedStyle,\n\n cellBorderColor = borderColor,\n cellBorderWidth = borderWidth,\n cellStyle,\n\n footerBorderColor = borderColor,\n footerBorderWidth = borderWidth,\n footerStyle,\n\n inputStyle,\n filterInputStyle,\n searchInputStyle,\n\n selectStyle,\n\n paginationStyle,\n pageButtonStyle,\n pageButtonHoverStyle,\n pageButtonActiveStyle,\n pageButtonCurrentStyle\n } = options\n\n const expanderColor = getFirstDefinedProp(\n [cellStyle, rowStyle, tableBodyStyle, tableStyle, style],\n 'color',\n color\n )\n const selectColor = getFirstDefinedProp([selectStyle, style], 'color', color)\n\n // Allow easier override of header border width in an outlined/bordered table\n headerBorderWidth = getFirstDefinedProp([headerStyle], 'borderWidth', headerBorderWidth)\n\n let css = {\n style: {\n color,\n backgroundColor,\n ...style\n },\n\n tableStyle: {\n borderColor: tableBorderColor,\n borderWidth: tableBorderWidth,\n ...tableStyle\n },\n\n headerStyle: {\n borderColor: headerBorderColor,\n borderWidth: headerBorderWidth,\n padding: cellPadding,\n ...headerStyle,\n '.rt-bordered &, .rt-outlined &': {\n borderWidth: headerBorderWidth\n }\n },\n\n groupHeaderStyle: {\n // For vertical borders\n borderColor: groupHeaderBorderColor,\n borderWidth: groupHeaderBorderWidth,\n padding: cellPadding,\n ...groupHeaderStyle,\n // For horizontal borders\n '&::after': {\n backgroundColor: groupHeaderBorderColor,\n height: groupHeaderBorderWidth\n },\n '.rt-bordered &': {\n borderWidth: groupHeaderBorderWidth\n }\n },\n\n tableBodyStyle,\n\n rowGroupStyle,\n\n rowStyle: {\n ...rowStyle,\n '&.rt-tr-striped': {\n backgroundColor: stripedColor,\n ...rowStripedStyle\n },\n '&.rt-tr-highlight:hover': {\n backgroundColor: highlightColor,\n ...rowHighlightStyle\n },\n '&.rt-tr-selected': {\n ...rowSelectedStyle\n }\n },\n\n cellStyle: {\n borderColor: cellBorderColor,\n borderWidth: cellBorderWidth,\n padding: cellPadding,\n ...cellStyle\n },\n\n footerStyle: {\n borderColor: footerBorderColor,\n borderWidth: footerBorderWidth,\n padding: cellPadding,\n ...footerStyle\n },\n\n filterCellStyle: {\n borderColor: cellBorderColor,\n borderWidth: cellBorderWidth,\n padding: cellPadding,\n ...cellStyle\n },\n\n expanderStyle: {\n '&::after': {\n borderTopColor: expanderColor\n }\n },\n\n filterInputStyle: {\n ...inputStyle,\n ...filterInputStyle\n },\n\n searchInputStyle: {\n ...inputStyle,\n ...searchInputStyle\n },\n\n paginationStyle: {\n borderTopColor: cellBorderColor,\n borderTopWidth: cellBorderWidth,\n ...paginationStyle,\n\n '.rt-page-jump': {\n ...inputStyle\n },\n\n '.rt-page-size-select': {\n ...selectStyle,\n '@supports (-moz-appearance: none)': {\n backgroundImage:\n selectColor &&\n `url('data:image/svg+xml;charset=US-ASCII,` +\n `` +\n // Colors should be URL encoded since they may contain # or parentheses\n `')`\n }\n },\n\n '.rt-page-button': {\n ...pageButtonStyle\n },\n '.rt-page-button:not(:disabled):hover': {\n ...pageButtonHoverStyle\n },\n '.rt-page-button:not(:disabled):active': {\n ...pageButtonActiveStyle\n },\n '.rt-keyboard-active & .rt-page-button:not(:disabled):focus': {\n ...pageButtonHoverStyle\n },\n '.rt-page-button-current': {\n ...pageButtonCurrentStyle\n }\n }\n }\n\n removeEmptyProps(css)\n\n return css\n}\n\nfunction getFirstDefinedProp(objects, prop, defaultVal) {\n const found = objects.find(x => x && x[prop] != null)\n return found ? found[prop] : defaultVal\n}\n\n// URL encoder that escapes parentheses (for data URLs)\nfunction urlEncode(str) {\n return encodeURIComponent(str).replace('(', '%28').replace(')', '%29')\n}\n\n// Defer Emotion initialization until DOM is loaded and theming is used\nlet emotion\nexport function getEmotion() {\n if (emotion) {\n return emotion\n }\n // Emotion appends style tags to head by default. Instead, we insert styles\n // immediately after the reactable stylesheet for two reasons:\n //\n // 1. Some HTML documents (pkgdown) may place htmlDependencies in the body\n // instead of head, causing Emotion theme styles in head to come before the\n // the reactable stylesheet and not override default styles properly.\n // R Markdown and Shiny put htmlDependencies in head properly.\n // 2. User styles in head may be overrided by the theme since Emotion appends to\n // the end of head, after any existing styles in head. This is not as important\n // as reason 1, however.\n let container\n let insertionPoint\n if (isBrowser()) {\n for (let link of document.querySelectorAll('link')) {\n const filename = link.href.substring(link.href.lastIndexOf('/') + 1)\n if (link.rel === 'stylesheet' && filename === 'reactable.css') {\n container = link.parentElement\n insertionPoint = link\n break\n }\n }\n }\n emotion = createEmotion({\n // Class prefix and unique key to prevent conflicts with other Emotion instances\n key: 'reactable',\n container: container,\n insertionPoint: insertionPoint\n })\n return emotion\n}\n\n// Reset Emotion instance and styles, intended for testing use only\nexport function resetEmotion() {\n if (emotion) {\n emotion.flush()\n emotion = null\n }\n}\n\n// Emotion css wrapper that returns null instead of an unused class\nexport function css(...args) {\n const emotion = getEmotion()\n args = args.filter(arg => arg != null)\n return args.length ? emotion.css(args) : null\n}\n","import React from 'react'\nimport { useGetLatest } from 'react-table'\n\nexport function classNames(...classes) {\n return classes.filter(cls => cls).join(' ')\n}\n\nexport function getFirstDefined(...args) {\n return args.find(x => x != null)\n}\n\n// Recursively remove undefined/null properties and empty objects\nexport function removeEmptyProps(obj) {\n for (let [key, value] of Object.entries(obj)) {\n if (value == null) {\n delete obj[key]\n } else if (typeof value === 'object') {\n removeEmptyProps(value)\n if (Object.keys(value).length === 0) {\n delete obj[key]\n }\n }\n }\n}\n\nexport function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n// Get leaf columns as an array\nexport function getLeafColumns(column) {\n const leafColumns = []\n const recurseColumn = column => {\n if (column.columns) {\n column.columns.forEach(recurseColumn)\n } else {\n leafColumns.push(column)\n }\n }\n recurseColumn(column)\n return leafColumns\n}\n\n// Convert row data for react-table v6 compatibility\nexport function convertRowsToV6(rows) {\n return rows.map(row => {\n if (row.subRows && row.subRows.length > 0) {\n return { _subRows: convertRowsToV6(row.subRows), ...row.values }\n } else {\n return row.values\n }\n })\n}\n\nexport function rowsToCSV(rows, options = {}) {\n let { columnIds, headers = true, sep = ',', dec = '.' } = options\n const rowToCSV = row => {\n return row\n .map(value => {\n if (value == null) {\n value = ''\n }\n // Serialize dates as ISO strings, all other non-string and non-numeric values as JSON\n if (value instanceof Date) {\n value = value.toISOString()\n } else if (typeof value !== 'string' && typeof value !== 'number') {\n value = JSON.stringify(value)\n } else if (dec !== '.' && typeof value === 'number') {\n value = value.toString().replace('.', dec)\n }\n // Escape CSV-unsafe characters\n if (typeof value === 'string' && (value.includes('\"') || value.includes(sep))) {\n value = `\"${value.replace(/\"/g, '\"\"')}\"`\n }\n return value\n })\n .join(sep)\n }\n let csvRows = []\n if (!columnIds) {\n columnIds = rows.length > 0 ? Object.keys(rows[0]) : []\n }\n if (headers) {\n csvRows.push(rowToCSV(columnIds))\n }\n for (let row of rows) {\n const values = columnIds.map(id => row[id])\n csvRows.push(rowToCSV(values))\n }\n return csvRows.join('\\n') + '\\n'\n}\n\nexport function downloadCSV(content, filename) {\n const blob = new Blob([content], { type: 'text/csv;charset=utf-8' })\n if (window.navigator.msSaveBlob) {\n // For IE11\n window.navigator.msSaveBlob(blob, filename)\n } else {\n const link = document.createElement('a')\n const url = window.URL.createObjectURL(blob)\n link.href = url\n link.download = filename\n link.click()\n window.URL.revokeObjectURL(url)\n }\n}\n\nexport function isBrowser() {\n return typeof document !== 'undefined'\n}\n\n// useAsyncDebounce from react-table without async/await (which seems to be unnecessary anyway)\n// to avoid adding regenerator-runtime to bundle.\nexport function useAsyncDebounce(defaultFn, defaultWait = 0) {\n const debounceRef = React.useRef({})\n\n const getDefaultFn = useGetLatest(defaultFn)\n const getDefaultWait = useGetLatest(defaultWait)\n\n return React.useCallback(\n (...args) => {\n if (!debounceRef.current.promise) {\n debounceRef.current.promise = new Promise((resolve, reject) => {\n debounceRef.current.resolve = resolve\n debounceRef.current.reject = reject\n })\n }\n\n if (debounceRef.current.timeout) {\n clearTimeout(debounceRef.current.timeout)\n }\n\n debounceRef.current.timeout = setTimeout(() => {\n delete debounceRef.current.timeout\n try {\n debounceRef.current.resolve(getDefaultFn()(...args))\n } catch (err) {\n debounceRef.current.reject(err)\n } finally {\n delete debounceRef.current.promise\n }\n }, getDefaultWait())\n\n return debounceRef.current.promise\n },\n [getDefaultFn, getDefaultWait]\n )\n}\n","export const defaultLanguage = {\n // Sorting\n sortLabel: 'Sort {name}',\n\n // Filters\n filterPlaceholder: '',\n filterLabel: 'Filter {name}',\n\n // Search\n searchPlaceholder: 'Search',\n searchLabel: 'Search',\n\n // Tables\n noData: 'No rows found',\n\n // Pagination\n pageNext: 'Next',\n pagePrevious: 'Previous',\n pageNumbers: '{page} of {pages}',\n pageInfo: `{rowStart}${String.fromCharCode(0x2013)}{rowEnd} of {rows} rows`,\n pageSizeOptions: 'Show {rows}',\n pageNextLabel: 'Next page',\n pagePreviousLabel: 'Previous page',\n pageNumberLabel: 'Page {page}',\n pageJumpLabel: 'Go to page',\n pageSizeOptionsLabel: 'Rows per page',\n\n // Column groups\n groupExpandLabel: 'Toggle group',\n\n // Row details\n detailsExpandLabel: 'Toggle details',\n\n // Selection\n selectAllRowsLabel: 'Select all rows',\n selectAllSubRowsLabel: 'Select all rows in group',\n selectRowLabel: 'Select row',\n\n // Deprecated in v0.3.0\n defaultGroupHeader: 'Grouped',\n detailsCollapseLabel: 'Toggle details',\n deselectAllRowsLabel: 'Deselect all rows',\n deselectAllSubRowsLabel: 'Deselect all rows in group',\n deselectRowLabel: 'Deselect row'\n}\n\nexport function renderTemplate(template, params = {}) {\n if (!template || !params) {\n return template\n }\n const keys = Object.keys(params)\n const separator = '(' + keys.map(key => `{${key}}`).join('|') + ')'\n const strings = template.split(new RegExp(separator))\n const templateParams = keys.reduce((obj, key) => {\n obj[`{${key}}`] = params[key]\n return obj\n }, {})\n const rendered = strings.map(s => (templateParams[s] != null ? templateParams[s] : s))\n if (rendered.some(val => typeof val === 'object')) {\n return rendered\n }\n return rendered.join('')\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport { css } from './theme'\nimport { defaultLanguage, renderTemplate } from './language'\nimport { classNames } from './utils'\n\nconst PageButton = ({ isCurrent, className, ...props }) => {\n className = classNames(className, 'rt-page-button', isCurrent ? ' rt-page-button-current' : null)\n return (\n \n )\n}\n\nPageButton.propTypes = {\n isCurrent: PropTypes.bool,\n className: PropTypes.string,\n children: PropTypes.node\n}\n\n// Get visible pages from current page (1-based) and total page count\nexport function getVisiblePages(page, totalPages) {\n // 6 pages or less\n if (totalPages <= 6) {\n return [...Array(totalPages)].map((_, i) => i + 1)\n }\n if (page <= 4) {\n // First 4 pages: 1 2 3 *4* 5 ... 7\n return [1, 2, 3, 4, 5, totalPages]\n } else if (totalPages - page < 3) {\n // Last 3 pages: 1 ... 4 *5* 6 7\n return [1, totalPages - 3, totalPages - 2, totalPages - 1, totalPages]\n } else {\n // Middle 3 pages: 1 ... 4 *5* 6 ... 8\n return [1, page - 1, page, page + 1, totalPages]\n }\n}\n\nexport default class Pagination extends React.Component {\n constructor(props) {\n super(props)\n this.changePage = this.changePage.bind(this)\n this.applyPage = this.applyPage.bind(this)\n this.state = {\n pageJumpValue: props.page + 1,\n prevPage: props.page\n }\n }\n\n static getDerivedStateFromProps(props, state) {\n // Update page jump value if page changes (e.g. from page size change).\n // Track previous page so we only update on prop changes.\n if (props.page !== state.prevPage) {\n return {\n pageJumpValue: props.page + 1,\n prevPage: props.page\n }\n }\n return null\n }\n\n changePage(newPage) {\n const currentPage = this.props.page + 1\n if (newPage === currentPage) {\n return\n }\n this.props.onPageChange(newPage - 1)\n }\n\n applyPage(e) {\n if (e) {\n e.preventDefault()\n }\n const newPage = this.state.pageJumpValue\n if (newPage !== '') {\n this.changePage(newPage)\n } else {\n // Reset page jump if new value is blank or invalid. (Some browsers\n // allow non-numeric characters with input type=\"number\").\n const currentPage = this.props.page + 1\n this.setState({ pageJumpValue: currentPage })\n }\n }\n\n renderPageInfo({ page, pageSize, pageRowCount, rowCount, language }) {\n const rowStart = Math.min(page * pageSize + 1, rowCount)\n // When pagination is disabled, pageSize is unused and the number of rows\n // on the page can exceed the page size.\n const rowEnd = Math.max(Math.min(page * pageSize + pageSize, rowCount), pageRowCount)\n const pageInfo = renderTemplate(language.pageInfo, { rowStart, rowEnd, rows: rowCount })\n return
{pageInfo}
\n }\n\n renderPageSizeOptions({ pageSize, pageSizeOptions, onPageSizeChange, language }) {\n const selector = (\n onPageSizeChange(Number(e.target.value))}\n value={pageSize}\n >\n {pageSizeOptions.map((option, i) => (\n \n ))}\n \n )\n const elements = renderTemplate(language.pageSizeOptions, { rows: selector })\n return
{elements}
\n }\n\n renderPageJump({ onChange, value, onBlur, onKeyPress, inputType, language }) {\n return (\n \n )\n }\n\n getPageJumpProperties() {\n return {\n onKeyPress: e => {\n if (e.which === 13 || e.keyCode === 13) {\n this.applyPage()\n }\n },\n onBlur: this.applyPage,\n value: this.state.pageJumpValue,\n onChange: e => {\n const value = e.target.value\n if (value === '') {\n this.setState({ pageJumpValue: value })\n return\n }\n const newPage = Number(value)\n if (!Number.isNaN(newPage)) {\n const nearestValidPage = Math.min(Math.max(newPage, 1), Math.max(this.props.pages, 1))\n this.setState({ pageJumpValue: nearestValidPage })\n }\n },\n inputType: 'number',\n language: this.props.language\n }\n }\n\n render() {\n const {\n paginationType,\n showPageSizeOptions,\n showPageInfo,\n page,\n pages,\n canPrevious,\n canNext,\n theme,\n language\n } = this.props\n\n const pageInfo = showPageInfo ? this.renderPageInfo(this.props) : null\n const pageSizeOptions = showPageSizeOptions ? this.renderPageSizeOptions(this.props) : null\n\n const currentPage = page + 1\n const visiblePages = getVisiblePages(currentPage, pages)\n\n let pageNumbers\n if (paginationType === 'numbers') {\n let pageButtons = []\n visiblePages.forEach((page, index) => {\n const isCurrent = currentPage === page\n const pageButton = (\n \n {page}\n \n )\n if (page - visiblePages[index - 1] > 1) {\n pageButtons.push(\n \n ...\n \n )\n }\n pageButtons.push(pageButton)\n })\n pageNumbers = pageButtons\n } else {\n const page =\n paginationType === 'jump' ? this.renderPageJump(this.getPageJumpProperties()) : currentPage\n const totalPages = Math.max(pages, 1)\n pageNumbers = (\n
\n {renderTemplate(language.pageNumbers, { page, pages: totalPages })}\n
\n )\n }\n\n const prevButton = (\n {\n if (!canPrevious) return\n this.changePage(currentPage - 1)\n }}\n disabled={!canPrevious}\n aria-disabled={!canPrevious ? 'true' : null}\n aria-label={language.pagePreviousLabel}\n >\n {language.pagePrevious}\n \n )\n\n const nextButton = (\n {\n if (!canNext) return\n this.changePage(currentPage + 1)\n }}\n disabled={!canNext}\n aria-disabled={!canNext ? 'true' : null}\n aria-label={language.pageNextLabel}\n >\n {language.pageNext}\n \n )\n\n return (\n
\n
\n {pageInfo}\n {pageSizeOptions}\n
\n\n
\n {prevButton}\n {pageNumbers}\n {nextButton}\n
\n
\n )\n }\n}\n\nPagination.propTypes = {\n paginationType: PropTypes.oneOf(['numbers', 'jump', 'simple']),\n pageSizeOptions: PropTypes.arrayOf(PropTypes.number),\n showPageSizeOptions: PropTypes.bool,\n showPageInfo: PropTypes.bool,\n page: PropTypes.number.isRequired,\n pages: PropTypes.number.isRequired,\n pageSize: PropTypes.number.isRequired,\n pageRowCount: PropTypes.number.isRequired,\n canPrevious: PropTypes.bool.isRequired,\n canNext: PropTypes.bool.isRequired,\n onPageChange: PropTypes.func.isRequired,\n onPageSizeChange: PropTypes.func.isRequired,\n rowCount: PropTypes.number.isRequired,\n theme: PropTypes.shape({\n paginationStyle: PropTypes.object\n }),\n language: PropTypes.shape({\n pageNext: PropTypes.string,\n pagePrevious: PropTypes.string,\n pageNumbers: PropTypes.string,\n pageInfo: PropTypes.string,\n pageSizeOptions: PropTypes.string,\n pageNextLabel: PropTypes.string,\n pagePreviousLabel: PropTypes.string,\n pageNumberLabel: PropTypes.string,\n pageJumpLabel: PropTypes.string,\n pageSizeOptionsLabel: PropTypes.string\n })\n}\n\nPagination.defaultProps = {\n paginationType: 'numbers',\n pageSizeOptions: [10, 25, 50, 100],\n showPageInfo: true,\n language: defaultLanguage\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport { isBrowser } from './utils'\n\nexport default class WidgetContainer extends React.Component {\n componentDidMount() {\n this.staticRender()\n }\n\n staticRender() {\n if (!window.HTMLWidgets) {\n return\n }\n if (!WidgetContainer.throttled) {\n window.HTMLWidgets.staticRender()\n // Throttle static rendering since it targets the entire document\n WidgetContainer.throttled = true\n if (typeof setTimeout !== 'undefined') {\n setTimeout(() => {\n if (WidgetContainer.lastCall) {\n window.HTMLWidgets.staticRender()\n }\n WidgetContainer.throttled = false\n WidgetContainer.lastCall = false\n })\n }\n } else {\n WidgetContainer.lastCall = true\n }\n }\n\n render() {\n // Don't serialize HTML widget HTML/scripts when server-side rendering:\n // 1. Most HTML widgets are client-side rendered and wouldn't benefit much from SSR.\n // 2. This keeps the initial HTML payload slim, as the widget script data would be\n // unnecessarily duplicated.\n // 3. Problems can occur when multiple instances of the same HTML widget type\n // are embedded in different tables, and the global HTMLWidgets.staticRender()\n // renders HTML widgets in other tables before those other tables are hydrated\n // (each table lives in its own React root). When other tables are hydrated,\n // the HTML widgets there will get wiped out, but not rerendered on the next\n // staticRender() because the root widget element is already marked as\n // html-widget-static-bound. This also helps keep the initial HTML payload slim,\n // as the widget script data would get unnecessarily duplicated.\n if (!isBrowser()) {\n return null\n }\n return this.props.children\n }\n}\n\nWidgetContainer.propTypes = {\n children: PropTypes.node\n}\n","// useFlexLayout modified to:\n// - Fix flex widths when resizing is disabled (don't use column.totalFlexWidth)\n// - Support resizing to actual min and max column widths (not flex widths)\n// - Set min width on thead/tbody/tfoot instead of table for responsive, horizontal scrolling.\n// Tables should use the new instance.getTheadProps and instance.getTfootProps for this.\n// - Include resized widths in table min width to prevent glitches with sticky headers/footers\n// - Exclude redundant styles\n\nimport { useGetLatest, makePropGetter } from 'react-table'\n\nexport default function useFlexLayout(hooks) {\n hooks.getTheadProps = [getRowGroupStyles]\n hooks.getTfootProps = [getRowGroupStyles]\n hooks.getTableBodyProps.push(getRowGroupStyles)\n hooks.getRowProps.push(getRowStyles)\n hooks.getHeaderGroupProps.push(getRowStyles)\n hooks.getFooterGroupProps.push(getRowStyles)\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getCellProps.push(getCellProps)\n hooks.getFooterProps.push(getFooterProps)\n hooks.useInstance.push(useInstance)\n}\n\nuseFlexLayout.pluginName = 'useFlexLayout'\n\n// Set min-width for thead and tfoot. Include resized widths in min width\n// (using totalColumnsWidth over totalColumnsMinWidth) so cells don't overlap\n// with sticky headers and footers when the total resized width is greater than\n// the total min width.\nconst getRowGroupStyles = (props, { instance }) => {\n return [\n props,\n {\n style: {\n minWidth: asPx(instance.totalColumnsWidth)\n }\n }\n ]\n}\n\nconst getRowStyles = (props, { instance }) => {\n return [\n props,\n {\n style: {\n flex: '1 0 auto',\n minWidth: asPx(instance.totalColumnsWidth)\n }\n }\n ]\n}\n\nconst getHeaderProps = (props, { column }) => {\n // Don't set max width if MAX_SAFE_INTEGER (the default for column.maxWidth)\n const maxWidth = column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${column.flexWidth} 0 auto`,\n minWidth: asPx(column.totalMinWidth),\n width: asPx(column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nconst getCellProps = (props, { cell }) => {\n const maxWidth =\n cell.column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? cell.column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${cell.column.flexWidth} 0 auto`,\n minWidth: asPx(cell.column.totalMinWidth),\n width: asPx(cell.column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nconst getFooterProps = (props, { column }) => {\n const maxWidth = column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${column.flexWidth} 0 auto`,\n minWidth: asPx(column.totalMinWidth),\n width: asPx(column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nfunction useInstance(instance) {\n const { headers, state, getHooks } = instance\n\n const resizedWidths = state.columnResizing.columnWidths\n\n // Manually calculate flex widths instead of using column.totalFlexWidth\n function calculateFlexWidths(columns) {\n let totalFlexWidth = 0\n columns.forEach(column => {\n if (column.headers) {\n column.flexWidth = calculateFlexWidths(column.headers)\n } else {\n // If the column has been resized or has fixed width, flex width = 0.\n // Otherwise, flex width = min width.\n if (resizedWidths[column.id] != null) {\n column.flexWidth = 0\n } else {\n const isFixedWidth = column.totalMinWidth === column.totalMaxWidth\n column.flexWidth = isFixedWidth ? 0 : column.totalMinWidth\n }\n }\n if (column.isVisible) {\n totalFlexWidth += column.flexWidth\n }\n })\n return totalFlexWidth\n }\n\n calculateFlexWidths(headers)\n\n const getInstance = useGetLatest(instance)\n const getTheadProps = makePropGetter(getHooks().getTheadProps, { instance: getInstance() })\n const getTfootProps = makePropGetter(getHooks().getTfootProps, { instance: getInstance() })\n\n Object.assign(instance, {\n getTheadProps,\n getTfootProps\n })\n}\n\nfunction asPx(value) {\n return typeof value === 'number' ? `${value}px` : undefined\n}\n","import { ensurePluginOrder } from 'react-table'\n\nimport { getLeafColumns } from './utils'\n\nexport default function useStickyColumns(hooks) {\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getCellProps.push(getCellProps)\n hooks.getFooterProps.push(getFooterProps)\n hooks.useInstance.push(useInstance)\n}\n\nuseStickyColumns.pluginName = 'useStickyColumns'\n\nconst getHeaderProps = (props, { column }) => {\n if (!column.stickyProps) {\n return props\n }\n return [props, column.stickyProps]\n}\n\nconst getCellProps = (props, { cell }) => {\n if (!cell.column.stickyProps) {\n return props\n }\n return [props, cell.column.stickyProps]\n}\n\nconst getFooterProps = (props, { column }) => {\n if (!column.stickyProps) {\n return props\n }\n return [props, column.stickyProps]\n}\n\nconst getStickyProps = (column, columns) => {\n const props = {\n className: 'rt-sticky',\n style: {\n position: 'sticky'\n }\n }\n if (column.sticky === 'left') {\n const stickyCols = columns.filter(col => col.sticky === 'left')\n props.style.left = 0\n for (let col of stickyCols) {\n if (col.id === column.id) break\n props.style.left += col.totalWidth\n }\n } else if (column.sticky === 'right') {\n const stickyCols = columns.filter(col => col.sticky === 'right')\n props.style.right = 0\n for (let col of stickyCols.reverse()) {\n if (col.id === column.id) break\n props.style.right += col.totalWidth\n }\n }\n return props\n}\n\nfunction useInstance(instance) {\n const { plugins, headerGroups } = instance\n\n ensurePluginOrder(plugins, ['useResizeColumns'], 'useStickyColumns')\n\n headerGroups.forEach(headerGroup => {\n const columns = headerGroup.headers\n\n // Ensure all columns in the group have the same sticky property.\n // If any sticky properties in the group differ, the first sticky column's\n // property is used for the whole group.\n columns.forEach(column => {\n const groupColumns = [column]\n if (column.columns) {\n groupColumns.push(...getLeafColumns(column))\n }\n const firstStickyCol = groupColumns.find(col => col.sticky)\n if (firstStickyCol) {\n groupColumns.forEach(col => {\n col.sticky = firstStickyCol.sticky\n })\n }\n })\n\n columns.forEach(column => {\n if (column.sticky) {\n column.stickyProps = getStickyProps(column, columns)\n }\n })\n })\n}\n","// useGroupBy hook modified to:\n// - Pass row objects and aggregated row objects to aggregate functions\n// - Include groupBy columns in aggregations\n// - Set nesting depth for leaf rows\n// - Omit row index properties on aggregated rows\n\nimport React from 'react'\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nimport { getFirstDefined } from './utils'\n\n// Not using any built-in aggregations\nconst aggregations = {}\n\nconst emptyArray = []\nconst emptyObject = {}\n\n// Actions\nactions.resetGroupBy = 'resetGroupBy'\nactions.setGroupBy = 'setGroupBy'\nactions.toggleGroupBy = 'toggleGroupBy'\n\nexport default function useGroupBy(hooks) {\n hooks.getGroupByToggleProps = [defaultGetGroupByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => [...deps, instance.state.groupBy])\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseGroupBy.pluginName = 'useGroupBy'\n\nconst defaultGetGroupByToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canGroupBy\n ? e => {\n e.persist()\n header.toggleGroupBy()\n }\n : undefined,\n style: {\n cursor: header.canGroupBy ? 'pointer' : undefined\n },\n title: 'Toggle GroupBy'\n }\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n groupBy: [],\n ...state\n }\n }\n\n if (action.type === actions.resetGroupBy) {\n return {\n ...state,\n groupBy: instance.initialState.groupBy || []\n }\n }\n\n if (action.type === actions.setGroupBy) {\n const { value } = action\n return {\n ...state,\n groupBy: value\n }\n }\n\n if (action.type === actions.toggleGroupBy) {\n const { columnId, value: setGroupBy } = action\n\n const resolvedGroupBy =\n typeof setGroupBy !== 'undefined' ? setGroupBy : !state.groupBy.includes(columnId)\n\n if (resolvedGroupBy) {\n return {\n ...state,\n groupBy: [...state.groupBy, columnId]\n }\n }\n\n return {\n ...state,\n groupBy: state.groupBy.filter(d => d !== columnId)\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { groupBy }\n }\n }\n) {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n\n const groupByColumns = groupBy.map(g => columns.find(col => col.id === g)).filter(Boolean)\n\n const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id))\n\n columns = [...groupByColumns, ...nonGroupByColumns]\n\n columns.forEach(column => {\n column.isGrouped = groupBy.includes(column.id)\n column.groupedIndex = groupBy.indexOf(column.id)\n })\n\n return columns\n}\n\nconst defaultUserAggregations = {}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n flatHeaders,\n groupByFn = defaultGroupByFn,\n manualGroupBy,\n aggregations: userAggregations = defaultUserAggregations,\n plugins,\n state: { groupBy },\n dispatch,\n autoResetGroupBy = true,\n disableGroupBy,\n defaultCanGroupBy,\n getHooks\n } = instance\n\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useGroupBy')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultGroupBy: defaultColumnGroupBy,\n disableGroupBy: columnDisableGroupBy\n } = column\n\n column.canGroupBy = accessor\n ? getFirstDefined(\n column.canGroupBy,\n columnDisableGroupBy === true ? false : undefined,\n disableGroupBy === true ? false : undefined,\n true\n )\n : getFirstDefined(column.canGroupBy, defaultColumnGroupBy, defaultCanGroupBy, false)\n\n if (column.canGroupBy) {\n column.toggleGroupBy = () => instance.toggleGroupBy(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const toggleGroupBy = React.useCallback(\n (columnId, value) => {\n dispatch({ type: actions.toggleGroupBy, columnId, value })\n },\n [dispatch]\n )\n\n const setGroupBy = React.useCallback(\n value => {\n dispatch({ type: actions.setGroupBy, value })\n },\n [dispatch]\n )\n\n flatHeaders.forEach(header => {\n header.getGroupByToggleProps = makePropGetter(getHooks().getGroupByToggleProps, {\n instance: getInstance(),\n header\n })\n })\n\n const [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById\n ] = React.useMemo(() => {\n if (groupBy.length === 0) {\n return [rows, flatRows, rowsById, emptyArray, emptyObject, flatRows, rowsById]\n }\n\n if (manualGroupBy) {\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g => allColumns.find(col => col.id === g))\n\n // Derive grouping props in each row that aren't present in manually grouped data.\n // Note that this excludes groupByVal and leafRows.\n const setGroupingProps = (rows, depth = 0) => {\n // Set nesting depth\n rows.forEach(row => {\n row.depth = depth\n })\n\n // Last level - these are leaf rows\n if (depth === existingGroupBy.length) {\n return\n }\n\n const columnId = existingGroupBy[depth]\n\n // Find the columns that can be aggregated, including any columns in groupBy.\n // groupBy columns that aren't in the row's group are allowed to be aggregated.\n const groupedColumns = existingGroupBy.slice(0, depth + 1)\n const aggregatedColumns = allColumns\n .filter(col => !groupedColumns.includes(col.id))\n .map(col => col.id)\n\n rows.forEach(row => {\n if (!row.isGrouped) {\n return\n }\n\n // Required but unset: row.groupByID, row.isGrouped\n row.groupByID = columnId\n // All columns that can be aggregated (including groupBy columns)\n row.aggregatedColumns = aggregatedColumns\n setGroupingProps(row.subRows, depth + 1)\n })\n }\n\n const flatRows = rows.filter(row => row.parentId == null)\n setGroupingProps(flatRows)\n\n return [rows, flatRows, rowsById, emptyArray, emptyObject, flatRows, rowsById]\n }\n\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g => allColumns.find(col => col.id === g))\n\n // Find the columns that can or are aggregating\n // Uses each column to aggregate rows into a single value\n const aggregateRowsToValues = (leafRows, groupedRows, depth, aggregatedColumns) => {\n const values = {}\n\n allColumns.forEach(column => {\n // Only aggregate columns that aren't being grouped. Originally, all groupBy\n // columns were excluded, but now, groupBy columns not in the row's group\n // may be aggregated.\n if (!aggregatedColumns.includes(column.id)) {\n // Set placeholder values\n values[column.id] = groupedRows[0] ? groupedRows[0].values[column.id] : null\n return\n }\n\n // Get the columnValues to aggregate (no longer used)\n // const groupedValues = groupedRows.map(row => row.values[column.id])\n\n // Aggregate the values\n let aggregateFn =\n typeof column.aggregate === 'function'\n ? column.aggregate\n : userAggregations[column.aggregate] || aggregations[column.aggregate]\n\n if (aggregateFn) {\n // Get the columnValues to aggregate\n const leafValues = leafRows.map(row => {\n let columnValue = row.values[column.id]\n\n if (!depth && column.aggregateValue) {\n const aggregateValueFn =\n typeof column.aggregateValue === 'function'\n ? column.aggregateValue\n : userAggregations[column.aggregateValue] || aggregations[column.aggregateValue]\n\n if (!aggregateValueFn) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregateValue option for column listed above`\n )\n }\n\n columnValue = aggregateValueFn(columnValue, row, column)\n }\n return columnValue\n })\n\n // Originally, the leafValues and groupedValues were passed to the aggregate function.\n // Now, the aggregate function takes:\n // - leafValues: flattened array of values in the column\n // - leafRows: flattened array of rows in the column (for v6 compatibility)\n // - groupedRows: array of aggregated rows in the column\n values[column.id] = aggregateFn(\n leafValues,\n leafRows.map(row => row.values),\n groupedRows.map(row => row.values)\n )\n } else if (column.aggregate) {\n console.info({ column })\n throw new Error(`React Table: Invalid column.aggregate option for column listed above`)\n } else {\n values[column.id] = null\n }\n })\n\n return values\n }\n\n let groupedFlatRows = []\n const groupedRowsById = {}\n const onlyGroupedFlatRows = []\n const onlyGroupedRowsById = {}\n const nonGroupedFlatRows = []\n const nonGroupedRowsById = {}\n\n // Recursively group the data\n const groupUpRecursively = (rows, depth = 0, parentId) => {\n // This is the last level, just return the rows\n if (depth === existingGroupBy.length) {\n // Set nesting depth for leaf rows\n rows.forEach(row => {\n row.depth = depth\n })\n return rows\n }\n\n const columnId = existingGroupBy[depth]\n\n // Group the rows together for this level\n let rowGroupsMap = groupByFn(rows, columnId)\n\n // Peform aggregations for each group\n const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\n ([groupByVal, groupedRows], index) => {\n let id = `${columnId}:${groupByVal}`\n id = parentId ? `${parentId}>${id}` : id\n\n // First, Recurse to group sub rows before aggregation\n const subRows = groupUpRecursively(groupedRows, depth + 1, id)\n\n // Flatten the leaf rows of the rows in this group\n const leafRows = depth ? flattenBy(groupedRows, 'leafRows') : groupedRows\n\n // Find the columns that can be aggregated, including any columns in\n // groupBy. Originally, no groupBy columns were aggregated. Now we\n // aggregate groupBy columns that aren't in the row's group.\n const groupedColumns = existingGroupBy.slice(0, depth + 1)\n const aggregatedColumns = allColumns\n .filter(col => !groupedColumns.includes(col.id))\n .map(col => col.id)\n\n // Originally, groupedRows were passed here, which were the same as\n // the leafRows. Now, the subRows are passed, which contain the aggregated\n // values of the immediate child rows.\n const values = aggregateRowsToValues(leafRows, subRows, depth, aggregatedColumns)\n\n const row = {\n id,\n isGrouped: true,\n groupByID: columnId,\n groupByVal,\n values,\n subRows,\n leafRows,\n depth,\n // Originally, aggregated rows had a row index corresponding to the index within\n // rowGroupsMap. This row index doesn't map to a valid data row and overlaps\n // with the leaf rows, so explicitly omit it.\n // index: undefined,\n index: undefined,\n groupIndex: index,\n // All columns that can be aggregated (including groupBy columns)\n aggregatedColumns\n }\n\n subRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n return row\n }\n )\n\n return aggregatedGroupedRows\n }\n\n const groupedRows = groupUpRecursively(rows)\n\n groupedRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n // Assign the new data\n return [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById\n ]\n }, [manualGroupBy, groupBy, rows, flatRows, rowsById, allColumns, userAggregations, groupByFn])\n\n const getAutoResetGroupBy = useGetLatest(autoResetGroupBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGroupBy()) {\n dispatch({ type: actions.resetGroupBy })\n }\n }, [dispatch, manualGroupBy ? null : data])\n\n Object.assign(instance, {\n preGroupedRows: rows,\n preGroupedFlatRow: flatRows,\n preGroupedRowsById: rowsById,\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById,\n toggleGroupBy,\n setGroupBy\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the groupBy and the pivot cell for the row\n cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID\n\n // Aggregated cells are not grouped, not repeated, but still have subRows\n cell.isAggregated =\n !cell.isGrouped && row.aggregatedColumns?.includes(cell.column.id) && row.subRows?.length\n\n // Placeholder cells are any columns in the groupBy that are not grouped or aggregated\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped && !cell.isAggregated\n })\n}\n\nexport function defaultGroupByFn(rows, columnId) {\n return rows.reduce((prev, row) => {\n // TODO: Might want to implement a key serializer here so\n // irregular column values can still be grouped if needed?\n const resKey = `${row.values[columnId]}`\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : []\n prev[resKey].push(row)\n return prev\n }, {})\n}\n\nfunction flattenBy(arr, key) {\n const flat = []\n\n const recurse = arr => {\n arr.forEach(d => {\n if (!d[key]) {\n flat.push(d)\n } else {\n recurse(d[key])\n }\n })\n }\n\n recurse(arr)\n\n return flat\n}\n","// useResizeColumns modified to:\n// - Resize based on actual DOM width of column, like in v6. Requires a\n// getDOMWidth() method to be defined on each column header and header group.\n// - Clean up touchend listeners properly (https://github.com/tannerlinsley/react-table/issues/2622)\n// - Optimize number of calls to dispatch (https://github.com/tannerlinsley/react-table/pull/3231)\n\nimport React from 'react'\nimport {\n actions,\n defaultColumn,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nimport { getFirstDefined } from './utils'\n\nlet passiveSupported = null\nfunction passiveEventSupported() {\n // memoize support to avoid adding multiple test events\n if (typeof passiveSupported === 'boolean') return passiveSupported\n\n let supported = false\n try {\n const options = {\n get passive() {\n supported = true\n return false\n }\n }\n\n window.addEventListener('test', null, options)\n window.removeEventListener('test', null, options)\n } catch (err) {\n supported = false\n }\n passiveSupported = supported\n return passiveSupported\n}\n\n// Default Column\ndefaultColumn.canResize = true\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport default function useResizeColumns(hooks) {\n hooks.getResizerProps = [defaultGetResizerProps]\n hooks.getHeaderProps.push({\n style: {\n position: 'relative'\n }\n })\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n}\n\nconst defaultGetResizerProps = (props, { instance, header }) => {\n const { dispatch } = instance\n\n const onResizeStart = (e, header) => {\n let isTouchEvent = false\n if (e.type === 'touchstart') {\n // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n if (e.touches && e.touches.length > 1) {\n return\n }\n isTouchEvent = true\n }\n const headersToResize = getAllColumns(header)\n const headerIdWidths = headersToResize.map(d => [d.id, d.getDOMWidth()])\n const columnWidth = headerIdWidths.find(([id]) => id === header.id)[1]\n\n const clientX = isTouchEvent ? Math.round(e.touches[0].clientX) : e.clientX\n\n let raf\n let mostRecentClientX\n\n const dispatchMove = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnResizing, clientX: mostRecentClientX })\n }\n const dispatchEnd = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnDoneResizing })\n }\n\n const scheduleDispatchMoveOnNextAnimationFrame = clientXPos => {\n mostRecentClientX = clientXPos\n if (!raf) {\n raf = window.requestAnimationFrame(dispatchMove)\n }\n }\n\n const handlersAndEvents = {\n mouse: {\n moveEvent: 'mousemove',\n moveHandler: e => scheduleDispatchMoveOnNextAnimationFrame(e.clientX),\n upEvent: 'mouseup',\n upHandler: () => {\n document.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler)\n document.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler)\n dispatchEnd()\n }\n },\n touch: {\n moveEvent: 'touchmove',\n moveHandler: e => {\n if (e.cancelable) {\n e.preventDefault()\n e.stopPropagation()\n }\n scheduleDispatchMoveOnNextAnimationFrame(e.touches[0].clientX)\n return false\n },\n upEvent: 'touchend',\n upHandler: () => {\n document.removeEventListener(\n handlersAndEvents.touch.moveEvent,\n handlersAndEvents.touch.moveHandler\n )\n document.removeEventListener(\n handlersAndEvents.touch.upEvent,\n handlersAndEvents.touch.upHandler\n )\n dispatchEnd()\n }\n }\n }\n\n const events = isTouchEvent ? handlersAndEvents.touch : handlersAndEvents.mouse\n const passiveIfSupported = passiveEventSupported() ? { passive: false } : false\n document.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported)\n document.addEventListener(events.upEvent, events.upHandler, passiveIfSupported)\n\n dispatch({\n type: actions.columnStartResizing,\n columnId: header.id,\n columnWidth,\n headerIdWidths,\n clientX\n })\n }\n\n return [\n props,\n {\n onMouseDown: e => e.persist() || onResizeStart(e, header),\n onTouchStart: e => e.persist() || onResizeStart(e, header),\n style: {\n cursor: 'col-resize'\n },\n draggable: false,\n role: 'separator'\n }\n ]\n}\n\nuseResizeColumns.pluginName = 'useResizeColumns'\n\nfunction reducer(state, action) {\n if (action.type === actions.init) {\n return {\n columnResizing: {\n columnWidths: {}\n },\n ...state\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n columnResizing: {\n columnWidths: {}\n }\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { clientX, columnId, columnWidth, headerIdWidths } = action\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: clientX,\n headerIdWidths,\n columnWidth,\n isResizingColumn: columnId\n }\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX, columnWidth, headerIdWidths = [] } = state.columnResizing\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.max(headerWidth + headerWidth * percentageDeltaX, 0)\n })\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n columnWidths: {\n ...state.columnResizing.columnWidths,\n ...newColumnWidths\n }\n }\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: null,\n isResizingColumn: null\n }\n }\n }\n}\n\nconst useInstanceBeforeDimensions = instance => {\n const {\n flatHeaders,\n disableResizing,\n getHooks,\n state: { columnResizing }\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n flatHeaders.forEach(header => {\n const canResize = getFirstDefined(\n header.disableResizing === true ? false : undefined,\n disableResizing === true ? false : undefined,\n true\n )\n\n header.canResize = canResize\n header.width = getFirstDefined(\n columnResizing.columnWidths[header.id],\n header.originalWidth,\n header.width\n )\n header.isResizing = columnResizing.isResizingColumn === header.id\n\n if (canResize) {\n header.getResizerProps = makePropGetter(getHooks().getResizerProps, {\n instance: getInstance(),\n header\n })\n }\n })\n}\n\nfunction useInstance(instance) {\n const { plugins, dispatch, autoResetResize = true, columns } = instance\n\n ensurePluginOrder(plugins, ['useAbsoluteLayout'], 'useResizeColumns')\n\n const getAutoResetResize = useGetLatest(autoResetResize)\n useMountedLayoutEffect(() => {\n if (getAutoResetResize()) {\n dispatch({ type: actions.resetResize })\n }\n }, [columns])\n\n const resetResizing = React.useCallback(() => dispatch({ type: actions.resetResize }), [dispatch])\n\n Object.assign(instance, {\n resetResizing\n })\n}\n\nfunction getAllColumns(column) {\n const allColumns = []\n const recurseColumn = column => {\n if (column.columns && column.columns.length) {\n column.columns.forEach(recurseColumn)\n }\n allColumns.push(column)\n }\n recurseColumn(column)\n return allColumns\n}\n","// useRowSelect hook modified to:\n// - Set row.isSelected for sub rows when paginateExpandedRows = false\n// (https://github.com/TanStack/react-table/issues/2908)\n// - Include an instance.setRowsSelected() function to set selected rows.\n// This is also useful to clear all selection, since toggleAllRowsSelected()\n// only affects visible rows, excluding any selected rows that may be filtered out.\n// - Handle sub rows correctly when custom getSubRows is used\n// (https://github.com/TanStack/react-table/pull/2886)\n\nimport React from 'react'\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useGetLatest,\n useMountedLayoutEffect\n} from 'react-table'\n\nconst pluginName = 'useRowSelect'\n\n// Actions\nactions.resetSelectedRows = 'resetSelectedRows'\nactions.toggleAllRowsSelected = 'toggleAllRowsSelected'\nactions.toggleRowSelected = 'toggleRowSelected'\nactions.toggleAllPageRowsSelected = 'toggleAllPageRowsSelected'\nactions.setRowsSelected = 'setRowsSelected'\n\nexport default function useRowSelect(hooks) {\n hooks.getToggleRowSelectedProps = [defaultGetToggleRowSelectedProps]\n hooks.getToggleAllRowsSelectedProps = [defaultGetToggleAllRowsSelectedProps]\n hooks.getToggleAllPageRowsSelectedProps = [defaultGetToggleAllPageRowsSelectedProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowSelect.pluginName = pluginName\n\nconst defaultGetToggleRowSelectedProps = (props, { instance, row }) => {\n const { manualRowSelectedKey = 'isSelected' } = instance\n let checked = false\n\n if (row.original && row.original[manualRowSelectedKey]) {\n checked = true\n } else {\n checked = row.isSelected\n }\n\n return [\n props,\n {\n onChange: e => {\n row.toggleRowSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked,\n title: 'Toggle Row Selected',\n indeterminate: row.isSomeSelected\n }\n ]\n}\n\nconst defaultGetToggleAllRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleAllRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked: instance.isAllRowsSelected,\n title: 'Toggle All Rows Selected',\n indeterminate: Boolean(\n !instance.isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length\n )\n }\n]\n\nconst defaultGetToggleAllPageRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange(e) {\n instance.toggleAllPageRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked: instance.isAllPageRowsSelected,\n title: 'Toggle All Current Page Rows Selected',\n indeterminate: Boolean(\n !instance.isAllPageRowsSelected &&\n instance.page.some(({ id }) => instance.state.selectedRowIds[id])\n )\n }\n]\n\n// eslint-disable-next-line max-params\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n selectedRowIds: {},\n ...state\n }\n }\n\n if (action.type === actions.resetSelectedRows) {\n return {\n ...state,\n selectedRowIds: instance.initialState.selectedRowIds || {}\n }\n }\n\n if (action.type === actions.toggleAllRowsSelected) {\n const { value: setSelected } = action\n const { isAllRowsSelected, rowsById, nonGroupedRowsById = rowsById } = instance\n\n const selectAll = typeof setSelected !== 'undefined' ? setSelected : !isAllRowsSelected\n\n // Only remove/add the rows that are visible on the screen\n // Leave all the other rows that are selected alone.\n const selectedRowIds = Object.assign({}, state.selectedRowIds)\n\n if (selectAll) {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n selectedRowIds[rowId] = true\n })\n } else {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n delete selectedRowIds[rowId]\n })\n }\n\n return {\n ...state,\n selectedRowIds\n }\n }\n\n if (action.type === actions.toggleRowSelected) {\n const { id, value: setSelected } = action\n const { rowsById, selectSubRows = true } = instance\n const isSelected = state.selectedRowIds[id]\n const shouldExist = typeof setSelected !== 'undefined' ? setSelected : !isSelected\n\n if (isSelected === shouldExist) {\n return state\n }\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n if (!row.isGrouped) {\n if (shouldExist) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n handleRowById(id)\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n\n if (action.type === actions.toggleAllPageRowsSelected) {\n const { value: setSelected } = action\n const { page, rowsById, selectSubRows = true, isAllPageRowsSelected } = instance\n\n const selectAll = typeof setSelected !== 'undefined' ? setSelected : !isAllPageRowsSelected\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (!row.isGrouped) {\n if (selectAll) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n page.forEach(row => handleRowById(row.id))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n\n if (action.type === actions.setRowsSelected) {\n const { ids: setSelected } = action\n const { rowsById, selectSubRows = true } = instance\n\n const newSelectedRowIds = {}\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n // Select a filtered or (less likely) invalid row (rowsById only contains visible rows).\n if (!row) {\n newSelectedRowIds[id] = true\n return\n }\n\n if (!row.isGrouped) {\n newSelectedRowIds[id] = true\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n setSelected.forEach(rowId => handleRowById(rowId))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n return state\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n getHooks,\n plugins,\n rowsById,\n nonGroupedRowsById = rowsById,\n autoResetSelectedRows = true,\n state: { selectedRowIds },\n selectSubRows = true,\n dispatch,\n page\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded', 'usePagination'],\n 'useRowSelect'\n )\n\n const selectedFlatRows = React.useMemo(() => {\n const selectedFlatRows = []\n\n // Ensure row.isSelected is set for sub rows when paginateExpandedRows = false\n // https://github.com/TanStack/react-table/issues/2908\n const handleRow = row => {\n const isSelected = selectSubRows\n ? getRowIsSelected(row, selectedRowIds)\n : !!selectedRowIds[row.id]\n row.isSelected = !!isSelected\n row.isSomeSelected = isSelected === null\n\n if (isSelected) {\n selectedFlatRows.push(row)\n }\n\n if (row.subRows && row.subRows.length) {\n row.subRows.forEach(row => handleRow(row))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return selectedFlatRows\n }, [rows, selectSubRows, selectedRowIds])\n\n let isAllRowsSelected = Boolean(\n Object.keys(nonGroupedRowsById).length && Object.keys(selectedRowIds).length\n )\n\n let isAllPageRowsSelected = isAllRowsSelected\n\n if (isAllRowsSelected) {\n if (Object.keys(nonGroupedRowsById).some(id => !selectedRowIds[id])) {\n isAllRowsSelected = false\n }\n }\n\n if (!isAllRowsSelected) {\n if (page && page.length && page.some(({ id }) => !selectedRowIds[id])) {\n isAllPageRowsSelected = false\n }\n }\n\n const getAutoResetSelectedRows = useGetLatest(autoResetSelectedRows)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSelectedRows()) {\n dispatch({ type: actions.resetSelectedRows })\n }\n }, [dispatch, data])\n\n const toggleAllRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsSelected, value }),\n [dispatch]\n )\n\n const toggleAllPageRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllPageRowsSelected, value }),\n [dispatch]\n )\n\n const toggleRowSelected = React.useCallback(\n (id, value) => dispatch({ type: actions.toggleRowSelected, id, value }),\n [dispatch]\n )\n\n const setRowsSelected = React.useCallback(\n ids => dispatch({ type: actions.setRowsSelected, ids }),\n [dispatch]\n )\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsSelectedProps = makePropGetter(getHooks().getToggleAllRowsSelectedProps, {\n instance: getInstance()\n })\n\n const getToggleAllPageRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllPageRowsSelectedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n selectedFlatRows,\n isAllRowsSelected,\n isAllPageRowsSelected,\n toggleRowSelected,\n toggleAllRowsSelected,\n setRowsSelected,\n getToggleAllRowsSelectedProps,\n getToggleAllPageRowsSelectedProps,\n toggleAllPageRowsSelected\n })\n}\n\nfunction prepareRow(row, { instance }) {\n row.toggleRowSelected = set => instance.toggleRowSelected(row.id, set)\n\n row.getToggleRowSelectedProps = makePropGetter(instance.getHooks().getToggleRowSelectedProps, {\n instance: instance,\n row\n })\n}\n\nfunction getRowIsSelected(row, selectedRowIds) {\n if (selectedRowIds[row.id]) {\n return true\n }\n\n const subRows = row.subRows\n\n if (subRows && subRows.length) {\n let allChildrenSelected = true\n let someSelected = false\n\n // TODO: For server-side pagination, if sub rows are paginated, there's no way to know \n // whether all sub rows are selected if not present on the page. Row selection needs \n // to be fully server-side, so this is a temporary workaround to prevent grouped\n // rows from always appearing as selected.\n const availableSubRows = subRows.filter(row => row != null)\n if (availableSubRows.length !== subRows.length) {\n return false\n }\n\n subRows.forEach(subRow => {\n // Bail out early if we know both of these\n if (someSelected && !allChildrenSelected) {\n return\n }\n\n if (getRowIsSelected(subRow, selectedRowIds)) {\n someSelected = true\n } else {\n allChildrenSelected = false\n }\n })\n return allChildrenSelected ? true : someSelected ? null : false\n }\n\n return false\n}\n","// usePagination modified to:\n// - Allow pagination to be disabled. This makes it easier to use the hook\n// conditionally while keeping pagination functionality intact (e.g., the\n// pagination bar and API can still be used when pagination is disabled).\n// - Provide instance.pageRowCount for the number of paginated rows on the\n// page, excluding expanded rows when paginateExpandedRows = false.\n// - Support a rowCount option in useTable() for manual pagination as an\n// alternative to pageCount. Server-side pagination typically requires\n// the server-side row count to be known, so providing page count is\n// unnecessary when it can be derived from row count and page size.\n\nimport React from 'react'\nimport {\n actions,\n ensurePluginOrder,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nconst pluginName = 'usePagination'\n\n// Actions\nactions.resetPage = 'resetPage'\nactions.gotoPage = 'gotoPage'\nactions.setPageSize = 'setPageSize'\n\nexport default function usePagination(hooks) {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nusePagination.pluginName = pluginName\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pageSize: 10,\n pageIndex: 0,\n ...state\n }\n }\n\n if (action.type === actions.resetPage) {\n return {\n ...state,\n pageIndex: instance.initialState.pageIndex || 0\n }\n }\n\n if (action.type === actions.gotoPage) {\n const { pageCount, page } = instance\n const newPageIndex = functionalUpdate(action.pageIndex, state.pageIndex)\n let canNavigate = false\n\n if (newPageIndex > state.pageIndex) {\n // next page\n canNavigate = pageCount === -1 ? page.length >= state.pageSize : newPageIndex < pageCount\n } else if (newPageIndex < state.pageIndex) {\n // prev page\n canNavigate = newPageIndex > -1\n }\n\n if (!canNavigate) {\n return state\n }\n\n return {\n ...state,\n pageIndex: newPageIndex\n }\n }\n\n if (action.type === actions.setPageSize) {\n const { pageSize } = action\n const topRowIndex = state.pageSize * state.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...state,\n pageIndex,\n pageSize\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n rows,\n autoResetPage = true,\n manualExpandedKey = 'expanded',\n plugins,\n pageCount: userPageCount,\n paginateExpandedRows = true,\n expandSubRows = true,\n disablePagination,\n state: { pageIndex, expanded, globalFilter, filters, groupBy, sortBy },\n dispatch,\n data,\n manualPagination,\n // User-specified row count when using manual pagination. Takes precedence over pageCount.\n rowCount: userRowCount\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],\n 'usePagination'\n )\n\n const getAutoResetPage = useGetLatest(autoResetPage)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPage()) {\n dispatch({ type: actions.resetPage })\n }\n }, [dispatch, manualPagination ? null : data, globalFilter, filters, groupBy, sortBy])\n\n // Disabling pagination effectively means setting the page size to the table size.\n // This is best done by the hook, rather than the user, because the row count\n // isn't known until other row-manipulating hooks have run (e.g., useGroupBy).\n const pageSize = disablePagination ? rows.length : instance.state.pageSize\n\n let pageCount\n if (manualPagination) {\n // Prefer user-specified row count for manual pagination. Server-side pagination\n // typically requires the server-side row count to be known, so providing page count\n // is unnecessary when it can be derived from row count and page size.\n pageCount =\n userRowCount != null && userRowCount >= 0 ? Math.ceil(userRowCount / pageSize) : userPageCount\n } else {\n pageCount = Math.ceil(rows.length / pageSize)\n }\n\n const pageOptions = React.useMemo(\n () => (pageCount > 0 ? [...new Array(pageCount)].fill(null).map((d, i) => i) : []),\n [pageCount]\n )\n\n const [page, pageRowCount] = React.useMemo(() => {\n let page\n\n if (manualPagination) {\n page = rows\n } else {\n const pageStart = pageSize * pageIndex\n const pageEnd = pageStart + pageSize\n\n page = rows.slice(pageStart, pageEnd)\n }\n\n const pageRowCount = page.length\n\n if (paginateExpandedRows) {\n return [page, pageRowCount]\n }\n\n return [expandRows(page, { manualExpandedKey, expanded, expandSubRows }), pageRowCount]\n }, [\n expandSubRows,\n expanded,\n manualExpandedKey,\n manualPagination,\n pageIndex,\n pageSize,\n paginateExpandedRows,\n rows\n ])\n\n const canPreviousPage = pageIndex > 0\n const canNextPage = pageCount === -1 ? page.length >= pageSize : pageIndex < pageCount - 1\n\n const gotoPage = React.useCallback(\n pageIndex => {\n dispatch({ type: actions.gotoPage, pageIndex })\n },\n [dispatch]\n )\n\n const previousPage = React.useCallback(() => {\n return gotoPage(old => old - 1)\n }, [gotoPage])\n\n const nextPage = React.useCallback(() => {\n return gotoPage(old => old + 1)\n }, [gotoPage])\n\n const setPageSize = React.useCallback(\n pageSize => {\n dispatch({ type: actions.setPageSize, pageSize })\n },\n [dispatch]\n )\n\n Object.assign(instance, {\n pageOptions,\n pageCount,\n page,\n pageRowCount,\n canPreviousPage,\n canNextPage,\n gotoPage,\n previousPage,\n nextPage,\n setPageSize\n })\n}\n\nfunction expandRows(rows, { manualExpandedKey, expanded, expandSubRows = true }) {\n const expandedRows = []\n\n const handleRow = (row, addToExpandedRows = true) => {\n row.isExpanded = (row.original && row.original[manualExpandedKey]) || expanded[row.id]\n\n row.canExpand = row.subRows && !!row.subRows.length\n\n if (addToExpandedRows) {\n expandedRows.push(row)\n }\n\n if (row.subRows && row.subRows.length && row.isExpanded) {\n row.subRows.forEach(row => handleRow(row, expandSubRows))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return expandedRows\n}\n","export function sum(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return 0\n }\n const result = numbers.reduce((a, b) => a + b, 0)\n // Adjust for floating-point precision errors\n return round(result, 12)\n}\n\nexport function mean(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n const result = sum(numbers) / numbers.length\n // Adjust for floating-point precision errors\n return round(result, 12)\n}\n\nexport function maxNumber(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n return Math.max.apply(null, numbers)\n}\n\nexport function minNumber(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n return Math.min.apply(null, numbers)\n}\n\nexport function median(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n numbers.sort((a, b) => a - b)\n if (numbers.length % 2 === 1) {\n return numbers[(numbers.length - 1) / 2]\n } else {\n return mean(numbers.slice(numbers.length / 2 - 1, numbers.length / 2 + 1))\n }\n}\n\nexport function max(values) {\n let maxValue\n values.forEach(value => {\n if (maxValue == null || value > maxValue) {\n maxValue = value\n }\n })\n return maxValue\n}\n\nexport function min(values) {\n let minValue\n values.forEach(value => {\n if (minValue == null || value < minValue) {\n minValue = value\n }\n })\n return minValue\n}\n\nexport function count(values) {\n return values.length\n}\n\nexport function unique(values) {\n return [...new Set(values)].join(', ')\n}\n\nexport function frequency(values) {\n const counts = {}\n values.forEach(value => {\n counts[value] = counts[value] || 0\n counts[value] += 1\n })\n const strs = Object.keys(counts).map(val => {\n return val + (counts[val] > 1 ? ` (${counts[val]})` : '')\n })\n return strs.join(', ')\n}\n\nconst numericAggregators = {\n mean,\n sum,\n max: maxNumber,\n min: minNumber,\n median\n}\n\nconst defaultAggregators = {\n max,\n min,\n count,\n unique,\n frequency\n}\n\nexport function getAggregateFunction(name, type) {\n if (type === 'numeric' && numericAggregators[name]) {\n return numericAggregators[name]\n }\n return defaultAggregators[name]\n}\n\nexport function round(n, digits = 3) {\n if (!Number.isFinite(n)) {\n return n\n }\n digits = digits > 0 ? digits : 0\n const c = Math.pow(10, digits)\n // Round away from zero rather than up (Math.round rounds -1.5 to -1)\n return (Math.sign(n) * Math.round(Math.abs(n) * c)) / c\n}\n\nfunction omitMissingNumbers(values) {\n return values.filter(n => n != null && !Number.isNaN(n))\n}\n","import React, { Fragment } from 'react'\nimport { hydrate } from 'reactR'\n\nimport WidgetContainer from './WidgetContainer'\nimport { getAggregateFunction } from './aggregators'\nimport {\n classNames,\n escapeRegExp,\n getFirstDefined,\n getLeafColumns,\n removeEmptyProps\n} from './utils'\n\n// Use zero-width spaces to preserve the height of empty cells\nexport const emptyValue = '\\u200b'\n\n// Override default subRows property\nconst subRowsKey = '.subRows'\n\nexport const rowSelectedKey = '.selected'\nexport const rowExpandedKey = '.expanded'\n\nexport const rowStateKey = '__state'\n\nexport function getSubRows(row) {\n return row[subRowsKey] || []\n}\n\n// Normalize raw column data from R for use in reactable\nexport function normalizeColumnData(data, columns) {\n for (let col of columns) {\n if (col.type === 'numeric' && data[col.id]) {\n convertJSONNumbers(data[col.id])\n }\n }\n return columnsToRows(data)\n}\n\n// Convert JSON-serialized numbers to JavaScript numbers in place. jsonlite::toJSON() converts\n// numeric NA, NaN, Inf, -Inf to strings, as there isn't a way to represent them in JSON otherwise.\nexport function convertJSONNumbers(arr) {\n for (let i = 0; i < arr.length; i++) {\n let n = arr[i]\n // Numeric columns can have nulls in pre-grouped data\n if (typeof n === 'number' || n == null) {\n continue\n }\n if (n === 'NA') {\n n = null\n } else if (n === 'NaN') {\n n = NaN\n } else if (n === 'Inf') {\n n = Infinity\n } else if (n === '-Inf') {\n n = -Infinity\n } else {\n n = Number(n)\n }\n arr[i] = n\n }\n}\n\n// Convert column-based data to rows\n// e.g. { a: [1, 2], b: ['x', 'y'] } to [{ a: 1, b: 'x' }, { a: 2, b: 'y' }]\nexport function columnsToRows(columns) {\n const names = Object.keys(columns)\n if (names.length === 0) {\n return []\n }\n\n if (columns[rowStateKey]) {\n columns[rowStateKey] = normalizeColumnData(columns[rowStateKey], numericRowStateColumns)\n }\n\n const rows = new Array(columns[names[0]].length)\n for (let i = 0; i < rows.length; i++) {\n rows[i] = {}\n for (let name of names) {\n const value = columns[name][i]\n if (name === subRowsKey) {\n if (value instanceof Object) {\n rows[i][name] = columnsToRows(value)\n }\n } else {\n rows[i][name] = value\n }\n }\n }\n return rows\n}\n\nconst numericRowStateColumns = [{ id: 'index', type: 'numeric' }]\nexport function materializedRowsToData(rows, paginateSubRows) {\n const parentRowIds = {}\n return rows.map(row => {\n let parentId\n let subRowCount\n if (paginateSubRows) {\n parentId = parentRowIds[row.id]\n subRowCount = row.subRows.length\n row.subRows.forEach(subRow => {\n parentRowIds[subRow.id] = row.id\n })\n }\n const rowState = {\n id: row.id,\n index: row.index,\n grouped: row.isGrouped ? true : null,\n parentId,\n subRowCount,\n // Currently unused\n expanded: row.isExpanded ? true : null,\n selected: row.isSelected ? true : null\n }\n removeEmptyProps(rowState)\n const dataRow = { ...row.values, [rowStateKey]: rowState }\n if (!paginateSubRows) {\n if (row.subRows && row.subRows.length > 0) {\n dataRow[subRowsKey] = materializedRowsToData(row.subRows)\n }\n }\n return dataRow\n })\n}\n\nexport function RawHTML({ html, className, ...props }) {\n return (\n \n )\n}\n\nexport function buildColumnDefs(columns, groups, tableProps = {}) {\n const { sortable, defaultSortDesc, showSortIcon, showSortable, filterable, resizable } =\n tableProps\n\n columns = columns.map(column => {\n let col = { ...column }\n // Always access column data by ID, not a path with periods or brackets\n col.accessor = row => row[col.id]\n\n if (typeof col.aggregate === 'string') {\n col.aggregate = getAggregateFunction(col.aggregate, col.type)\n }\n\n const sortMethod = createCompareFunction({ type: col.type, naLast: col.sortNALast })\n col.sortType = function sortType(a, b, id, desc) {\n return sortMethod(a.values[id], b.values[id], desc)\n }\n\n // Translate v6 props (e.g. sortable) to v7 (e.g. disableSortBy)\n col.sortable = getFirstDefined(col.sortable, sortable)\n col.disableSortBy = !col.sortable\n\n col.defaultSortDesc = getFirstDefined(col.defaultSortDesc, defaultSortDesc)\n col.sortDescFirst = col.defaultSortDesc\n\n col.filterable = getFirstDefined(col.filterable, filterable)\n col.disableFilters = !col.filterable\n\n if (col.searchable === false) {\n col.disableGlobalFilter = true\n }\n // Disable searching for hidden columns by default, but still allow it if requested\n if (col.show === false && col.searchable !== true) {\n col.disableGlobalFilter = true\n }\n\n // Default column filters\n // - numeric columns: string starts with\n // - other columns: case-insensitive substring\n if (col.type === 'numeric') {\n col.createMatcher = createStartsWithMatcher\n } else {\n col.createMatcher = createSubstringMatcher\n }\n col.filter = (rows, columnIds, filterValue) => {\n // For individual column filters, columnIds will always contain one column ID\n const id = columnIds[0]\n if (typeof col.filterMethod === 'function') {\n return col.filterMethod(rows, id, filterValue)\n }\n const match = col.createMatcher(filterValue)\n return rows.filter(row => {\n const value = row.values[id]\n return match(value)\n })\n }\n\n if (col.type === 'numeric') {\n // Right-align numbers by default\n col.align = col.align || 'right'\n } else {\n col.align = col.align || 'left'\n }\n\n col.vAlign = col.vAlign || 'top'\n col.headerVAlign = col.headerVAlign || 'top'\n\n const { width, minWidth, maxWidth } = col\n col.minWidth = getFirstDefined(width, minWidth, 100)\n col.maxWidth = getFirstDefined(width, maxWidth, Number.MAX_SAFE_INTEGER)\n\n // maxWidth takes priority over minWidth\n col.minWidth = Math.min(col.minWidth, col.maxWidth)\n\n // Start column width at min width / flex width, like in v6\n col.width = col.minWidth\n\n col.resizable = getFirstDefined(col.resizable, resizable)\n // Disable resizing on fixed width columns\n if (col.minWidth === col.maxWidth) {\n col.resizable = false\n }\n col.disableResizing = !col.resizable\n\n col.Cell = function Cell(cellInfo, state) {\n let value = cellInfo.value\n\n const isMissingValue = value == null || Number.isNaN(value)\n if (isMissingValue) {\n value = col.na\n }\n\n if (!isMissingValue && col.format && col.format.cell) {\n value = formatValue(value, col.format.cell)\n }\n\n if (col.cell) {\n if (typeof col.cell === 'function') {\n value = col.cell({ ...cellInfo, value }, state)\n }\n // Make sure we don't render aggregated cells for R renderers\n if (Array.isArray(col.cell) && !cellInfo.aggregated) {\n value = col.cell[cellInfo.index]\n if (value) {\n value = hydrate({ Fragment, WidgetContainer }, value)\n }\n }\n }\n\n // Use zero-width spaces to preserve the height of blank cells\n if (value == null || value === '') {\n value = emptyValue\n }\n\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n // Render inline to align with the expander\n content = \n } else {\n content = String(value)\n }\n\n return content\n }\n\n if (col.grouped) {\n col.Grouped = function Grouped(cellInfo, state) {\n let value = cellInfo.value\n\n const isMissingValue = value == null || Number.isNaN(value)\n if (isMissingValue) {\n value = col.na\n }\n\n if (!isMissingValue && col.format && col.format.cell) {\n value = formatValue(value, col.format.cell)\n }\n\n value = col.grouped({ ...cellInfo, value }, state)\n\n // Use zero-width spaces to preserve the height of blank cells\n if (value == null || value === '') {\n value = emptyValue\n }\n\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n // Render inline to align with the expander\n content = \n } else {\n content = String(value)\n }\n return content\n }\n } else {\n // Render grouped values the same as regular cells\n col.Grouped = function Grouped(cellInfo, state) {\n const value = col.Cell(cellInfo, state)\n return (\n \n {value}\n {cellInfo.subRows && ` (${cellInfo.subRows.length})`}\n \n )\n }\n }\n\n col.Aggregated = function Aggregated(cellInfo, state) {\n let value = cellInfo.value\n if (value != null && col.format && col.format.aggregated) {\n value = formatValue(value, col.format.aggregated)\n }\n if (col.aggregated) {\n value = col.aggregated({ ...cellInfo, value }, state)\n }\n if (value == null) {\n value = ''\n }\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n return \n } else {\n content = String(value)\n }\n return content\n }\n\n col.Header = function Header(column, state) {\n let header = col.name\n\n if (col.header != null) {\n if (typeof col.header === 'function') {\n header = col.header(column, state)\n } else {\n header = hydrate({ Fragment, WidgetContainer }, col.header)\n }\n }\n\n let content\n if (React.isValidElement(header)) {\n content = header\n } else if (col.html) {\n content = \n } else {\n content = header != null ? String(header) : ''\n }\n\n // Add sort icon to column header\n if (col.sortable && showSortIcon) {\n const sortClass = showSortable ? 'rt-sort' : ''\n // Ensure text is truncated with an ellipsis when text wrapping is off.\n // The outer container is a flex container, so we need to wrap text in a\n // block element to allow text to shrink below their minimum content size.\n content = col.html ? content :
{content}
\n\n if (col.align === 'right') {\n return (\n
\n \n {content}\n
\n )\n } else {\n return (\n
\n {content}\n \n
\n )\n }\n }\n return content\n }\n\n if (col.footer != null) {\n col.Footer = function Footer(column, state) {\n let footer\n if (typeof col.footer === 'function') {\n footer = col.footer(column, state)\n } else {\n footer = hydrate({ Fragment, WidgetContainer }, col.footer)\n }\n if (React.isValidElement(footer)) {\n return footer\n } else if (col.html) {\n return \n } else {\n return footer != null ? String(footer) : ''\n }\n }\n } else {\n // Set default content for an empty footer (otherwise defaults to  )\n col.Footer = emptyValue\n }\n\n const colAlignClass = getAlignClass(col.align)\n const cellVAlignClass = getVAlignClass(col.vAlign)\n const headerVAlignClass = getVAlignClass(col.headerVAlign)\n\n col.headerClassName = classNames(colAlignClass, headerVAlignClass, col.headerClassName)\n col.footerClassName = classNames(colAlignClass, cellVAlignClass, col.footerClassName)\n\n col.getProps = (rowInfo, column, state) => {\n let props = {\n className: classNames(colAlignClass, cellVAlignClass)\n }\n if (col.className) {\n let className\n if (typeof col.className === 'function') {\n className = col.className(rowInfo, column, state)\n } else if (Array.isArray(col.className)) {\n className = col.className[rowInfo.index]\n } else {\n className = col.className\n }\n props.className = classNames(props.className, className)\n }\n if (col.style) {\n let style\n if (typeof col.style === 'function') {\n style = col.style(rowInfo, column, state)\n } else if (Array.isArray(col.style)) {\n style = col.style[rowInfo.index]\n } else {\n style = col.style\n }\n props.style = style\n }\n return props\n }\n\n return col\n })\n\n if (groups) {\n columns = addColumnGroups(columns, groups)\n columns.forEach((col, i) => {\n // The column group ID is arbitrary and just has to be unique\n col.id = `group_${i}`\n if (col.name != null || col.header != null) {\n col.Header = function Header(column, state) {\n let header = col.name\n if (col.header) {\n if (typeof col.header === 'function') {\n header = col.header(column, state)\n } else {\n header = hydrate({ Fragment, WidgetContainer }, col.header)\n }\n }\n if (React.isValidElement(header)) {\n return header\n } else if (col.html) {\n return \n } else {\n return header != null ? String(header) : ''\n }\n }\n } else {\n col.Header = emptyValue\n }\n\n // Enable resizing if a single leaf column can be resized\n const leafColumns = getLeafColumns(col)\n if (leafColumns.every(col => col.disableResizing)) {\n col.disableResizing = true\n }\n\n col.align = col.align || 'center'\n col.headerVAlign = col.headerVAlign || 'top'\n\n const colAlignClass = getAlignClass(col.align)\n const headerVAlignClass = getVAlignClass(col.headerVAlign)\n\n col.headerClassName = classNames(colAlignClass, headerVAlignClass, col.headerClassName)\n })\n }\n\n return columns\n}\n\n// Add groups to an array of column definitions\nexport function addColumnGroups(columns, groups) {\n groups.forEach(group => {\n group = { ...group }\n const groupIds = group.columns\n group.columns = []\n columns = columns.reduce((newCols, col) => {\n if (col.id === groupIds[0]) {\n newCols.push(group)\n group.columns.push(col)\n } else if (groupIds.includes(col.id)) {\n group.columns.push(col)\n } else {\n newCols.push(col)\n }\n return newCols\n }, [])\n })\n\n // Create column groups for ungrouped columns, combining adjacent columns\n const newCols = []\n let lastGroup\n columns.forEach(col => {\n if (col.columns) {\n // Already a header group\n newCols.push(col)\n lastGroup = null\n } else {\n // Individual column\n if (!lastGroup) {\n lastGroup = { columns: [], isUngrouped: true }\n newCols.push(lastGroup)\n }\n lastGroup.columns.push(col)\n }\n })\n columns = newCols\n\n return columns\n}\n\n// Compare function that handles numbers and optionally sorts missing values (null, NaN) last.\nexport function createCompareFunction({ type, naLast } = {}) {\n return function compare(a, b, desc) {\n if (type === 'numeric') {\n a = Number.isNaN(a) ? null : a\n b = Number.isNaN(b) ? null : b\n } else {\n a = typeof a === 'string' ? a.toLowerCase() : a\n b = typeof b === 'string' ? b.toLowerCase() : b\n }\n if (a === b) {\n return 0\n }\n if (a == null) {\n if (naLast) return desc ? -1 : 1\n return -1\n }\n if (b == null) {\n if (naLast) return desc ? 1 : -1\n return 1\n }\n if (a > b) {\n return 1\n }\n if (a < b) {\n return -1\n }\n return 0\n }\n}\n\nexport function formatValue(value, options) {\n let {\n prefix,\n suffix,\n digits,\n separators,\n percent,\n currency,\n datetime,\n date,\n time,\n hour12,\n locales\n } = options\n\n if (typeof value === 'number') {\n if (separators || percent || currency || digits != null || locales) {\n // While Number.toLocaleString supports up to 20 fraction digits,\n // IE11 only supports up to 18 digits when formatting as percentages.\n let maximumFractionDigits = 18\n const options = { useGrouping: separators ? true : false }\n if (percent) {\n options.style = 'percent'\n // Use lower fraction digits to mitigate floating-point precision errors with\n // percent formatting, which can happen when using the Intl polyfill in V8.\n // This is the same as the rounding digits used by the aggregators.\n maximumFractionDigits = 12\n }\n if (currency) {\n options.style = 'currency'\n options.currency = currency\n } else if (digits != null) {\n options.minimumFractionDigits = Math.min(digits, maximumFractionDigits)\n options.maximumFractionDigits = Math.min(digits, maximumFractionDigits)\n } else {\n options.maximumFractionDigits = maximumFractionDigits\n }\n value = value.toLocaleString(locales || undefined, options)\n }\n }\n if (datetime || date || time) {\n locales = locales || undefined\n const options = {}\n if (hour12 != null) {\n options.hour12 = hour12\n }\n if (datetime) {\n value = new Date(value).toLocaleString(locales, options)\n } else if (date) {\n // Format YYYY-MM-DD dates in local time, not UTC.\n // Ignore ISO 8601 dates otherwise, i.e., YYYY-MM-DDTHH:MM:SS[Z]\n // http://blog.dygraphs.com/2012/03/javascript-and-dates-what-mess.html\n if (value.includes('-') && !value.includes('T') && !value.includes('Z')) {\n value = value.replace(/-/g, '/')\n }\n value = new Date(value).toLocaleDateString(locales, options)\n } else if (time) {\n value = new Date(value).toLocaleTimeString(locales, options)\n }\n }\n if (prefix != null) {\n value = value != null ? value : ''\n value = String(prefix) + value\n }\n if (suffix != null) {\n value = value != null ? value : ''\n value = value + String(suffix)\n }\n return value\n}\n\nexport function createStartsWithMatcher(str) {\n const regex = new RegExp('^' + escapeRegExp(str), 'i')\n return value => {\n // Ignore columns without data (don't match on \"undefined\"). This shouldn't\n // happen unless a data-less column (e.g., selection) is manually filtered via API.\n if (value === undefined) {\n return false\n }\n return regex.test(value)\n }\n}\n\nexport function createSubstringMatcher(str) {\n const regex = new RegExp(escapeRegExp(str), 'i')\n return value => {\n // Ignore columns without data (don't match on \"undefined\"). This shouldn't\n // happen unless a data-less column (e.g., selection) is manually filtered via API.\n if (value === undefined) {\n return false\n }\n return regex.test(value)\n }\n}\n\nfunction getAlignClass(align) {\n return `rt-align-${align}`\n}\n\nfunction getVAlignClass(vAlign) {\n if (vAlign === 'top') {\n return ''\n }\n return `rt-valign-${vAlign}`\n}\n","import React, { Fragment } from 'react'\nimport {\n safeUseLayoutEffect,\n useExpanded,\n useFilters,\n useGetLatest,\n useGlobalFilter,\n useMountedLayoutEffect,\n useSortBy,\n useTable\n} from 'react-table'\nimport PropTypes from 'prop-types'\nimport { hydrate } from 'reactR'\n\nimport Pagination from './Pagination'\nimport WidgetContainer from './WidgetContainer'\nimport useFlexLayout from './useFlexLayout'\nimport useStickyColumns from './useStickyColumns'\nimport useGroupBy from './useGroupBy'\nimport useResizeColumns from './useResizeColumns'\nimport useRowSelect from './useRowSelect'\nimport usePagination from './usePagination'\nimport useMeta from './useMeta'\nimport {\n buildColumnDefs,\n emptyValue,\n getSubRows,\n materializedRowsToData,\n normalizeColumnData,\n rowExpandedKey,\n rowSelectedKey,\n rowStateKey,\n RawHTML\n} from './columns'\nimport { defaultLanguage, renderTemplate } from './language'\nimport { createTheme, css } from './theme'\nimport {\n classNames,\n convertRowsToV6,\n getLeafColumns,\n rowsToCSV,\n downloadCSV,\n useAsyncDebounce\n} from './utils'\n\nimport './react-table.css'\nimport './reactable.css'\n\nconst tableInstances = {}\nexport function getInstance(tableId) {\n if (!tableId) {\n throw new Error('A reactable table ID must be provided')\n }\n const getInstance = tableInstances[tableId]\n if (!getInstance) {\n throw new Error(`reactable instance '${tableId}' not found`)\n }\n return getInstance()\n}\n\nexport function getState(tableId) {\n return getInstance(tableId).state\n}\n\nexport function setFilter(tableId, columnId, value) {\n getInstance(tableId).setFilter(columnId, value)\n}\n\nexport function setAllFilters(tableId, value) {\n getInstance(tableId).setAllFilters(value)\n}\n\nexport function setSearch(tableId, value) {\n getInstance(tableId).setGlobalFilter(value)\n}\n\nexport function toggleGroupBy(tableId, columnId, isGrouped) {\n getInstance(tableId).toggleGroupBy(columnId, isGrouped)\n}\n\nexport function setGroupBy(tableId, columnIds) {\n getInstance(tableId).setGroupBy(columnIds)\n}\n\nexport function toggleAllRowsExpanded(tableId, isExpanded) {\n getInstance(tableId).toggleAllRowsExpanded(isExpanded)\n}\n\nexport function downloadDataCSV(tableId, filename = 'data.csv', options = {}) {\n getInstance(tableId).downloadDataCSV(filename, options)\n}\n\nexport function getDataCSV(tableId, options = {}) {\n return getInstance(tableId).getDataCSV(options)\n}\n\nexport function setMeta(tableId, meta) {\n getInstance(tableId).setMeta(meta)\n}\n\nexport function toggleHideColumn(tableId, columnId, isHidden) {\n getInstance(tableId).toggleHideColumn(columnId, isHidden)\n}\n\nexport function setHiddenColumns(tableId, columns) {\n getInstance(tableId).setHiddenColumns(columns)\n}\n\nexport function setData(tableId, data, options) {\n getInstance(tableId).setData(data, options)\n}\n\nexport function onStateChange(tableId, listenerFn) {\n return getInstance(tableId).onStateChange(listenerFn)\n}\n\nexport function gotoPage(tableId, pageIndex) {\n getInstance(tableId).gotoPage(pageIndex)\n}\n\nexport function setPageSize(tableId, pageSize) {\n getInstance(tableId).setPageSize(pageSize)\n}\n\nexport default function Reactable({\n data,\n columns,\n columnGroups,\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable,\n theme,\n language,\n dataKey,\n ...rest\n}) {\n data = normalizeColumnData(data, columns)\n columns = buildColumnDefs(columns, columnGroups, {\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable\n })\n\n theme = createTheme(theme) || {}\n\n language = { ...defaultLanguage, ...language }\n for (let key in language) {\n language[key] = language[key] || null\n }\n\n return (\n \n )\n}\n\n// Objects and arrays must be memoized to prevent unnecessary recalculations of data\nfunction useMemoizedObject(obj) {\n const objStr = JSON.stringify(obj)\n return React.useMemo(() => {\n return obj\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [objStr])\n}\n\nexport function ReactableData({\n data,\n columns,\n columnGroups,\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable,\n // Controlled state\n sortBy,\n filters,\n searchValue,\n groupBy,\n expanded,\n selectedRowIds,\n ...rest\n}) {\n data = React.useMemo(\n () => normalizeColumnData(data, columns),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n )\n columns = React.useMemo(\n () =>\n buildColumnDefs(columns, columnGroups, {\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n )\n\n // Objects and arrays must be memoized to prevent unnecessary recalculations of data\n sortBy = useMemoizedObject(sortBy || [])\n filters = useMemoizedObject(filters || [])\n groupBy = useMemoizedObject(groupBy || [])\n expanded = useMemoizedObject(expanded || {})\n selectedRowIds = useMemoizedObject(selectedRowIds || {})\n\n return (\n \n )\n}\n\nconst RootComponent = React.forwardRef(function RootComponent({ className, ...rest }, ref) {\n // Keep ReactTable class for legacy compatibility (deprecated in v0.3.0)\n return
\n})\n\nconst TableComponent = React.forwardRef(function TableComponent({ className, ...rest }, ref) {\n return
\n})\n\nfunction TheadComponent({ className, ...rest }) {\n return
\n}\n\nfunction TbodyComponent({ className, ...rest }) {\n return
\n}\n\nfunction TfootComponent({ className, ...rest }) {\n return
\n}\n\nfunction TrGroupComponent({ className, ...rest }) {\n return
\n}\n\nfunction TrComponent({ className, ...rest }) {\n return
\n}\n\nconst ThComponent = React.forwardRef(function ThComponent(props, ref) {\n let {\n canSort,\n sortDescFirst,\n isSorted,\n isSortedDesc,\n toggleSortBy,\n canResize,\n isResizing,\n className,\n innerClassName,\n children,\n ...thProps\n } = props\n\n const [skipNextSort, setSkipNextSort] = React.useState(false)\n\n if (canSort) {\n const currentSortOrder = isSorted ? (isSortedDesc ? 'descending' : 'ascending') : 'none'\n const defaultSortOrder = sortDescFirst ? 'descending' : 'ascending'\n const toggleSort = isMultiSort => {\n let sortDesc = isSorted ? !isSortedDesc : sortDescFirst\n // Allow sort clearing if multi-sorting\n if (isMultiSort) {\n sortDesc = null\n }\n toggleSortBy && toggleSortBy(sortDesc, isMultiSort)\n }\n thProps = {\n ...thProps,\n 'aria-sort': currentSortOrder,\n tabIndex: '0',\n onClick: e => {\n if (!skipNextSort) {\n toggleSort(e.shiftKey)\n }\n },\n onKeyPress: e => {\n const keyCode = e.which || e.keyCode\n if (keyCode === 13 || keyCode === 32) {\n toggleSort(e.shiftKey)\n }\n },\n onMouseUp: () => {\n // Prevent resizer clicks from toggling sort (since resizer is in the header)\n if (isResizing) {\n setSkipNextSort(true)\n } else {\n setSkipNextSort(false)\n }\n },\n onMouseDown: e => {\n // Prevent text selection on double clicks, only when sorting\n if (e.detail > 1 || e.shiftKey) {\n e.preventDefault()\n }\n },\n // Focus indicator for keyboard navigation\n 'data-sort-hint': isSorted ? null : defaultSortOrder\n }\n }\n\n // The inner wrapper is a block container that prevents the outer flex container from\n // breaking text overflow and ellipsis truncation. Text nodes can't shrink below their\n // minimum content size.\n return (\n \n
{children}
\n
\n )\n})\n\nThComponent.propTypes = {\n defaultSortOrder: PropTypes.string,\n canSort: PropTypes.bool,\n sortDescFirst: PropTypes.bool,\n isSorted: PropTypes.bool,\n isSortedDesc: PropTypes.bool,\n toggleSortBy: PropTypes.func,\n canResize: PropTypes.bool,\n isResizing: PropTypes.bool,\n className: PropTypes.string,\n innerClassName: PropTypes.string,\n children: PropTypes.node\n}\n\nfunction TdComponent({ className, innerClassName, children, ...rest }) {\n // The inner wrapper is a block container that prevents the outer flex container from\n // breaking text overflow and ellipsis truncation. Text nodes can't shrink below their\n // minimum content size.\n return (\n
\n
{children}
\n
\n )\n}\n\n// Get class names for a cell theme. Padding is set on the inner wrapper to prevent\n// the inner wrapper (with overflow hidden) from clipping borders, box shadows, etc.\nfunction getCellTheme(style) {\n if (!style) {\n return {}\n }\n if (style.padding != null) {\n const { padding, ...cellStyle } = style\n return {\n className: css(cellStyle),\n innerClassName: css({ padding })\n }\n }\n return { className: css(style) }\n}\n\nfunction ResizerComponent({ onMouseDown, onTouchStart, className, ...rest }) {\n return (\n \n )\n}\n\nResizerComponent.propTypes = {\n onMouseDown: PropTypes.func,\n onTouchStart: PropTypes.func,\n className: PropTypes.string\n}\n\nclass RowDetails extends React.Component {\n componentDidMount() {\n if (window.Shiny && window.Shiny.bindAll) {\n window.Shiny.bindAll(this.el)\n }\n }\n\n componentWillUnmount() {\n if (window.Shiny && window.Shiny.unbindAll) {\n window.Shiny.unbindAll(this.el)\n }\n }\n\n render() {\n const { children, html } = this.props\n let props = { ref: el => (this.el = el) }\n if (html) {\n props = { ...props, dangerouslySetInnerHTML: { __html: html } }\n } else {\n props = { ...props, children }\n }\n return
\n }\n}\n\nRowDetails.propTypes = {\n children: PropTypes.node,\n html: PropTypes.string\n}\n\nfunction ExpanderComponent({ isExpanded, className, 'aria-label': ariaLabel }) {\n return (\n \n \n ​\n \n \n )\n}\n\nExpanderComponent.propTypes = {\n isExpanded: PropTypes.bool,\n className: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction FilterComponent({\n filterValue,\n setFilter,\n className,\n placeholder,\n 'aria-label': ariaLabel\n}) {\n return (\n setFilter(e.target.value || undefined)}\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n )\n}\n\nFilterComponent.propTypes = {\n filterValue: PropTypes.string,\n setFilter: PropTypes.func.isRequired,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction SearchComponent({\n searchValue,\n setSearch,\n className,\n placeholder,\n 'aria-label': ariaLabel\n}) {\n return (\n setSearch(e.target.value || undefined)}\n className={classNames('rt-search', className)}\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n )\n}\n\nSearchComponent.propTypes = {\n searchValue: PropTypes.string,\n setSearch: PropTypes.func.isRequired,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction NoDataComponent({ className, ...rest }) {\n return
\n}\n\nfunction SelectInputComponent({ type, checked, onChange, 'aria-label': ariaLabel }) {\n // Use zero-width space character to properly align checkboxes with first\n // line of text in other cells, even if the text spans multiple lines.\n return (\n
\n \n ​\n
\n )\n}\n\nSelectInputComponent.propTypes = {\n type: PropTypes.oneOf(['checkbox', 'radio']).isRequired,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string\n}\n\nfunction TableData({\n data,\n columns,\n groupBy,\n searchMethod,\n pagination,\n paginateSubRows,\n selection,\n crosstalkGroup,\n crosstalkId,\n setResolvedData,\n // Controlled state\n pageSize,\n pageIndex,\n sortBy,\n filters,\n searchValue,\n expanded,\n selectedRowIds\n}) {\n const dataColumns = React.useMemo(\n () => columns.reduce((cols, col) => cols.concat(getLeafColumns(col)), []),\n [columns]\n )\n\n // Must be memoized to prevent re-filtering on every render\n const globalFilter = React.useMemo(() => {\n if (searchMethod) {\n return searchMethod\n }\n return function globalFilter(rows, columnIds, searchValue) {\n const matchers = dataColumns.reduce((obj, col) => {\n obj[col.id] = col.createMatcher(searchValue)\n return obj\n }, {})\n\n rows = rows.filter(row => {\n for (const id of columnIds) {\n const value = row.values[id]\n if (matchers[id](value)) {\n return true\n }\n }\n })\n return rows\n }\n }, [dataColumns, searchMethod])\n\n const useRowSelectColumn = function useRowSelectColumn(hooks) {\n if (selection) {\n hooks.visibleColumns.push(columns => {\n const selectionCol = {\n // Apply defaults from existing selection column\n ...columns.find(col => col.selectable),\n selectable: true,\n // Disable sorting, filtering, and searching for selection columns\n disableSortBy: true,\n filterable: false,\n disableFilters: true,\n disableGlobalFilter: true\n }\n // Make selection column the first column, even before grouped columns\n return [selectionCol, ...columns.filter(col => !col.selectable)]\n })\n }\n }\n\n const useCrosstalkColumn = function useCrosstalkColumn(hooks) {\n if (crosstalkGroup) {\n hooks.visibleColumns.push(columns => {\n const ctCol = {\n id: crosstalkId,\n filter: (rows, id, value) => {\n if (!value) {\n return rows\n }\n return rows.filter(row => {\n if (value.includes(row.index)) {\n return true\n }\n })\n },\n disableGlobalFilter: true\n }\n return columns.concat(ctCol)\n })\n\n hooks.stateReducers.push(state => {\n if (!state.hiddenColumns.includes(crosstalkId)) {\n return {\n ...state,\n hiddenColumns: state.hiddenColumns.concat(crosstalkId)\n }\n }\n return state\n })\n }\n }\n\n const instance = useTable(\n {\n columns,\n data,\n useControlledState: state => {\n return React.useMemo(\n () => ({\n ...state,\n pageIndex,\n pageSize,\n sortBy,\n filters,\n globalFilter: searchValue,\n groupBy,\n expanded,\n selectedRowIds\n }),\n // These dependencies are required for proper table updates\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n state,\n pageIndex,\n pageSize,\n sortBy,\n filters,\n searchValue,\n groupBy,\n expanded,\n selectedRowIds\n ]\n )\n },\n globalFilter,\n paginateExpandedRows: paginateSubRows ? true : false,\n disablePagination: !pagination,\n getSubRows,\n // Disable manual row expansion\n manualExpandedKey: null,\n // Maintain grouped state when the data changes\n autoResetGroupBy: false,\n // Maintain sorted state when the data changes\n autoResetSortBy: false,\n // Maintain expanded state when groupBy, sortBy, defaultPageSize change.\n // Expanded state is still reset when the data changes via dataKey or updateReactable.\n autoResetExpanded: false,\n // Maintain filtered state when the data changes\n autoResetFilters: false,\n autoResetGlobalFilter: false,\n // Maintain selected state when groupBy, sortBy, defaultPageSize change.\n // Selected state is still reset when the data changes via dataKey or updateReactable.\n autoResetSelectedRows: false,\n // Maintain resized state when the data changes\n autoResetResize: false,\n // Reset current page when the data changes (e.g., sorting, filtering, searching)\n autoResetPage: true\n },\n useResizeColumns,\n useFlexLayout,\n useStickyColumns,\n useFilters,\n useGlobalFilter,\n useGroupBy,\n useSortBy,\n useExpanded,\n usePagination,\n useRowSelect,\n useRowSelectColumn,\n useCrosstalkColumn\n )\n\n // Track the max number of rows for auto-shown pagination. Unfortunately, the max\n // number of rows can't be determined up front in a grouped and filtered table\n // because grouping happens after filtering (and swapping these hooks would\n // disable dynamic aggregation). Instead, we track the max number of rows\n // per dataset, so at least the pagination doesn't disappear upon filtering.\n const maxRowCount = React.useRef(\n paginateSubRows ? instance.flatRows.length : instance.rows.length\n )\n\n React.useEffect(() => {\n maxRowCount.current = 0\n }, [data])\n\n React.useEffect(() => {\n const rowCount = paginateSubRows ? instance.flatRows.length : instance.rows.length\n if (rowCount > maxRowCount.current) {\n maxRowCount.current = rowCount\n }\n }, [paginateSubRows, instance.flatRows, instance.rows])\n\n if (setResolvedData) {\n setResolvedData({\n data: materializedRowsToData(instance.page, paginateSubRows),\n rowCount: instance.rows.length,\n maxRowCount: maxRowCount.current\n })\n }\n\n return null\n}\n\nfunction Table({\n data: originalData,\n columns,\n groupBy,\n searchable,\n searchMethod,\n defaultSorted,\n pagination,\n paginationType,\n showPagination,\n showPageSizeOptions,\n showPageInfo,\n defaultPageSize,\n pageSizeOptions,\n minRows,\n paginateSubRows,\n defaultExpanded,\n selection,\n defaultSelected,\n selectionId,\n onClick,\n outlined,\n bordered,\n borderless,\n compact,\n nowrap,\n striped,\n highlight,\n className,\n style,\n rowClassName,\n rowStyle,\n inline,\n width,\n height,\n theme,\n language,\n meta: initialMeta,\n crosstalkKey,\n crosstalkGroup,\n crosstalkId,\n elementId,\n nested,\n dataURL,\n serverRowCount: initialServerRowCount,\n serverMaxRowCount: initialServerMaxRowCount\n}) {\n const [newData, setNewData] = React.useState(null)\n const data = React.useMemo(() => {\n return newData ? newData : originalData\n }, [newData, originalData])\n\n const useServerData = dataURL != null\n const [serverRowCount, setServerRowCount] = React.useState(initialServerRowCount)\n const [serverMaxRowCount, setServerMaxRowCount] = React.useState(initialServerMaxRowCount)\n\n const dataColumns = React.useMemo(() => {\n return columns.reduce((cols, col) => cols.concat(getLeafColumns(col)), [])\n }, [columns])\n\n // Must be memoized to prevent re-filtering on every render\n const globalFilter = React.useMemo(() => {\n if (searchMethod) {\n return searchMethod\n }\n return function globalFilter(rows, columnIds, searchValue) {\n const matchers = dataColumns.reduce((obj, col) => {\n obj[col.id] = col.createMatcher(searchValue)\n return obj\n }, {})\n\n rows = rows.filter(row => {\n for (const id of columnIds) {\n const value = row.values[id]\n if (matchers[id](value)) {\n return true\n }\n }\n })\n return rows\n }\n }, [dataColumns, searchMethod])\n\n const useRowSelectColumn = function useRowSelectColumn(hooks) {\n if (selection) {\n hooks.visibleColumns.push(columns => {\n const selectionCol = {\n // Apply defaults from existing selection column\n ...columns.find(col => col.selectable),\n selectable: true,\n // Disable sorting, filtering, and searching for selection columns\n disableSortBy: true,\n filterable: false,\n disableFilters: true,\n disableGlobalFilter: true\n }\n // Make selection column the first column, even before grouped columns\n return [selectionCol, ...columns.filter(col => !col.selectable)]\n })\n }\n }\n\n const useCrosstalkColumn = function useCrosstalkColumn(hooks) {\n if (crosstalkGroup) {\n hooks.visibleColumns.push(columns => {\n const ctCol = {\n id: crosstalkId,\n filter: (rows, id, value) => {\n if (!value) {\n return rows\n }\n return rows.filter(row => {\n if (value.includes(row.index)) {\n return true\n }\n })\n },\n disableGlobalFilter: true\n }\n return columns.concat(ctCol)\n })\n\n hooks.stateReducers.push(state => {\n if (!state.hiddenColumns.includes(crosstalkId)) {\n return {\n ...state,\n hiddenColumns: state.hiddenColumns.concat(crosstalkId)\n }\n }\n return state\n })\n }\n }\n\n const [meta, setMeta] = useMeta(initialMeta)\n\n function useServerSideRows(hooks) {\n hooks.useInstance.push(instance => {\n const { rows, manualPagination, rowsById } = instance\n\n if (!manualPagination) {\n return\n }\n\n // Set proper row indexes and IDs\n const setRowProps = rows => {\n rows.forEach(row => {\n const rowState = row.original[rowStateKey]\n // Fall back for backends that don't implement row state\n if (!rowState) {\n return\n }\n row.index = rowState.index\n // Not used for now because we need ability to select/expand all first\n if (rowState.selected) {\n row.original[rowSelectedKey] = rowState.selected\n }\n // Not used for now because we need ability to select/expand all first\n if (rowState.expanded) {\n row.original[rowExpandedKey] = rowState.expanded\n }\n if (rowState.grouped) {\n row.isGrouped = true\n }\n // Rebuild sub rows\n if (rowState.parentId != null) {\n rowsById[rowState.parentId].subRows.push(row)\n // Set parentId on row to tell useGroupBy that this is a nested row\n // TODO change this so useGroupBy gets a properly nested row structure, not flat rows\n row.parentId = rowState.parentId\n }\n // Set row props on sub rows. Skip this when sub rows are paginated, since sub rows\n // exist in both row.subRows and the flat list of rows.\n if (!paginateSubRows) {\n setRowProps(row.subRows, row)\n }\n })\n\n // Add placeholder subRows for aggregated row counts\n if (paginateSubRows) {\n rows.forEach(row => {\n const rowState = row.original[rowStateKey]\n row.subRows.length = rowState.subRowCount\n })\n }\n }\n setRowProps(rows)\n })\n }\n\n const getRowId = React.useMemo(() => {\n const defaultGetRowId = (row, index, parent) => {\n return `${parent ? [parent.id, index].join('.') : index}`\n }\n if (!useServerData) {\n return defaultGetRowId\n }\n return (row, index, parent) => {\n if (row[rowStateKey]) {\n return row[rowStateKey].id\n }\n // Fall back for backends that don't implement row state\n return defaultGetRowId(row, index, parent)\n }\n }, [useServerData])\n\n const { state, ...instance } = useTable(\n {\n columns,\n data,\n initialState: {\n hiddenColumns: dataColumns.filter(col => col.show === false).map(col => col.id),\n groupBy: groupBy || [],\n sortBy: defaultSorted || [],\n pageSize: defaultPageSize,\n selectedRowIds: defaultSelected\n ? defaultSelected.reduce((obj, index) => ({ ...obj, [index]: true }), {})\n : {}\n },\n globalFilter,\n paginateExpandedRows: paginateSubRows ? true : false,\n disablePagination: !pagination,\n getSubRows,\n getRowId,\n // Maintain grouped state when the data changes\n autoResetGroupBy: false,\n // Maintain sorted state when the data changes\n autoResetSortBy: false,\n // Maintain expanded state when groupBy, sortBy, defaultPageSize change.\n // Expanded state is still reset when the data changes via dataKey or updateReactable.\n autoResetExpanded: false,\n // Maintain filtered state when the data changes\n autoResetFilters: false,\n autoResetGlobalFilter: false,\n // Maintain selected state when groupBy, sortBy, defaultPageSize change.\n // Selected state is still reset when the data changes via dataKey or updateReactable.\n autoResetSelectedRows: false,\n // Maintain resized state when the data changes\n autoResetResize: false,\n // Reset current page when the data changes (e.g., sorting, filtering, searching)\n autoResetPage: true,\n manualPagination: useServerData,\n manualSortBy: useServerData,\n manualGlobalFilter: useServerData,\n manualFilters: useServerData,\n manualGroupBy: useServerData,\n // TODO for when server-side row selection is implemented - need the ability to select all first\n // manualRowSelectedKey: useServerData ? rowSelectedKey : null,\n // TODO for when server-side row expansion is implemented\n // Disable manual row expansion\n manualExpandedKey: null,\n // Prevent duplicate sub rows when sub rows are paginated server-side\n expandSubRows: !(useServerData && paginateSubRows),\n rowCount: useServerData ? serverRowCount : null\n },\n useServerSideRows,\n useResizeColumns,\n useFlexLayout,\n useStickyColumns,\n useFilters,\n useGlobalFilter,\n useGroupBy,\n useSortBy,\n useExpanded,\n usePagination,\n useRowSelect,\n useRowSelectColumn,\n useCrosstalkColumn\n )\n\n // Server-side data\n const skipInitialFetch = React.useRef(initialServerRowCount != null)\n React.useEffect(() => {\n if (!useServerData) {\n return\n }\n // Skip initial data fetch if the first page was provided\n if (skipInitialFetch.current) {\n skipInitialFetch.current = false\n return\n }\n const url = new window.URL(dataURL, window.location)\n const params = {\n pageIndex: state.pageIndex,\n pageSize: state.pageSize,\n sortBy: state.sortBy,\n filters: state.filters,\n searchValue: state.globalFilter,\n groupBy: state.groupBy,\n expanded: state.expanded,\n selectedRowIds: state.selectedRowIds\n }\n window\n .fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n })\n .then(res => res.json())\n .then(body => {\n const data = normalizeColumnData(body.data, dataColumns)\n const { rowCount, maxRowCount } = body\n setNewData(data)\n setServerRowCount(rowCount)\n setServerMaxRowCount(maxRowCount)\n })\n .catch(err => {\n console.error(err)\n })\n }, [\n useServerData,\n dataURL,\n state.pageIndex,\n state.pageSize,\n state.sortBy,\n state.filters,\n state.globalFilter,\n state.groupBy,\n state.expanded,\n state.selectedRowIds,\n dataColumns\n ])\n\n // Update table when default values change (preserves behavior from v6)\n useMountedLayoutEffect(() => {\n const setSortBy = instance.setSortBy\n setSortBy(defaultSorted || [])\n }, [instance.setSortBy, defaultSorted])\n\n useMountedLayoutEffect(() => {\n const setGroupBy = instance.setGroupBy\n setGroupBy(groupBy || [])\n }, [instance.setGroupBy, groupBy])\n\n useMountedLayoutEffect(() => {\n const setPageSize = instance.setPageSize\n setPageSize(defaultPageSize)\n }, [instance.setPageSize, defaultPageSize])\n\n useMountedLayoutEffect(() => {\n const setRowsSelected = instance.setRowsSelected\n setRowsSelected((defaultSelected || []).map(index => String(index)))\n }, [instance.setRowsSelected, defaultSelected])\n\n const rowsById = instance.preFilteredRowsById || instance.rowsById\n const selectedRowIndexes = React.useMemo(() => {\n return Object.keys(state.selectedRowIds).reduce((indexes, id) => {\n const row = rowsById[id]\n if (row) {\n indexes.push(row.index)\n }\n return indexes\n }, [])\n }, [state.selectedRowIds, rowsById])\n\n // Update Shiny on selected row changes (deprecated in v0.2.0)\n React.useEffect(() => {\n if (!selection) {\n return\n }\n // Convert to R's 1-based indices\n const selectedIndexes = selectedRowIndexes.map(index => index + 1)\n\n if (selectionId && window.Shiny) {\n window.Shiny.onInputChange(selectionId, selectedIndexes)\n }\n }, [selectedRowIndexes, selection, selectionId])\n\n // Reset searched state when table is no longer searchable\n const searchableRef = React.useRef(searchable)\n safeUseLayoutEffect(() => {\n if (searchableRef.current && !searchable) {\n const setGlobalFilter = instance.setGlobalFilter\n setGlobalFilter(undefined)\n }\n searchableRef.current = searchable\n }, [searchable, instance.setGlobalFilter])\n\n const makeSearch = () => {\n if (!searchable) {\n return null\n }\n return (\n \n )\n }\n\n const rowData = convertRowsToV6(instance.rows)\n const stateInfo = React.useMemo(() => {\n return {\n ...state,\n searchValue: state.globalFilter,\n meta,\n hiddenColumns: state.hiddenColumns.filter(id => id !== crosstalkId),\n // For v6 compatibility\n sorted: state.sortBy,\n pageRows: convertRowsToV6(instance.page),\n sortedData: rowData,\n data: data,\n page: state.pageIndex,\n pageSize: state.pageSize,\n pages: instance.pageCount,\n selected: selectedRowIndexes\n }\n }, [\n state,\n meta,\n crosstalkId,\n instance.page,\n rowData,\n data,\n instance.pageCount,\n selectedRowIndexes\n ])\n\n const makeThead = () => {\n const theadProps = instance.getTheadProps()\n return (\n \n {makeHeaders()}\n {makeFilters()}\n \n )\n }\n\n // Get actual width of the column for resizing\n const headerRefs = React.useRef({})\n const handleHeader = column => {\n column.getDOMWidth = () => {\n return headerRefs.current[column.id].getBoundingClientRect().width\n }\n if (column.headers && column.headers.length) {\n column.headers.forEach(col => handleHeader(col))\n }\n }\n instance.headers.forEach(handleHeader)\n\n const makeHeaders = () => {\n return instance.headerGroups.map((headerGroup, i) => {\n const isGroupHeader = i < instance.headerGroups.length - 1\n const { key: headerGroupKey, ...headerGroupProps } = headerGroup.getHeaderGroupProps({\n className: isGroupHeader ? 'rt-tr-group-header' : 'rt-tr-header'\n })\n return (\n \n {headerGroup.headers.map(column => {\n column = {\n ...column,\n column, // Deprecated in v0.3.0\n data: rowData // Deprecated in v0.3.0\n }\n let header =\n typeof column.Header === 'function'\n ? column.Header(column, stateInfo)\n : column.render('Header')\n\n let headerProps = {\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null,\n ref: el => (headerRefs.current[column.id] = el)\n }\n if (isGroupHeader) {\n const { className: themeClass, innerClassName } = getCellTheme(theme.groupHeaderStyle)\n headerProps = {\n ...headerProps,\n 'aria-colspan': column.totalVisibleHeaderCount,\n className: classNames(\n !column.isUngrouped ? 'rt-th-group' : 'rt-th-group-none',\n column.headerClassName,\n themeClass\n ),\n innerClassName,\n style: column.headerStyle,\n canResize: column.canResize\n }\n } else {\n const { className: themeClass, innerClassName } = getCellTheme(theme.headerStyle)\n headerProps = {\n ...headerProps,\n // Assign cell role to selectable column headers to prevent input labels\n // from being read as column names (\"select all rows column\").\n role: column.selectable ? 'cell' : 'columnheader',\n className: classNames(column.headerClassName, themeClass),\n innerClassName,\n style: column.headerStyle,\n canResize: column.canResize,\n isResizing: column.isResizing\n }\n\n if (column.canSort) {\n headerProps = {\n ...headerProps,\n 'aria-label': renderTemplate(language.sortLabel, { name: column.name }),\n canSort: column.canSort,\n sortDescFirst: column.sortDescFirst,\n isSorted: column.isSorted,\n isSortedDesc: column.isSortedDesc,\n // Use toggleSortBy instead of getSortByToggleProps() for more control over sorting\n toggleSortBy: column.toggleSortBy\n }\n }\n }\n\n let resizer\n if (column.canResize) {\n const { onMouseDown, onTouchStart } = column.getResizerProps()\n resizer = (\n {\n onMouseDown(e)\n // Prevent resizer from highlighting text\n e.preventDefault()\n }}\n onTouchStart={onTouchStart}\n onClick={e => {\n // Prevent resizer from toggling sorting\n e.stopPropagation()\n }}\n />\n )\n }\n\n if (column.selectable && selection === 'multiple' && instance.rows.length > 0) {\n const toggleAllRowsSelected = () => instance.toggleAllRowsSelected()\n headerProps = {\n ...headerProps,\n onClick: toggleAllRowsSelected,\n className: classNames(headerProps.className, 'rt-td-select')\n }\n header = (\n \n )\n }\n\n const { key, ...resolvedHeaderProps } = column.getHeaderProps(headerProps)\n return (\n \n {header}\n {resizer}\n \n )\n })}\n \n )\n })\n }\n\n // Use column.filterable over column.canFilter because useGlobalFilter\n // currently sets canFilter to true on columns with disableFilters = true.\n // https://github.com/tannerlinsley/react-table/issues/2787\n const isFilterable = instance.visibleColumns.some(col => col.filterable)\n\n // Reset filtered state when table is no longer filterable\n const filterableRef = React.useRef(isFilterable)\n safeUseLayoutEffect(() => {\n if (filterableRef.current && !isFilterable) {\n const setAllFilters = instance.setAllFilters\n setAllFilters(instance.visibleColumns.map(col => ({ id: col.id, value: undefined })))\n }\n filterableRef.current = isFilterable\n }, [isFilterable, instance.visibleColumns, instance.setAllFilters])\n\n const makeFilters = () => {\n if (!isFilterable) {\n return null\n }\n\n return (\n \n {instance.visibleColumns.map(column => {\n let filter\n // Use column.filterable over column.canFilter because useGlobalFilter\n // currently sets canFilter to true on columns with disableFilters = true.\n // https://github.com/TanStack/react-table/issues/2787\n if (column.filterable) {\n if (column.filterInput != null) {\n let filterInput\n if (typeof column.filterInput === 'function') {\n filterInput = column.filterInput(column, stateInfo)\n } else {\n filterInput = hydrate({ Fragment, WidgetContainer }, column.filterInput)\n }\n if (React.isValidElement(filterInput)) {\n filter = filterInput\n } else if (column.html) {\n filter = \n }\n } else {\n filter = (\n \n )\n }\n }\n\n const { className: themeClass, innerClassName } = getCellTheme(theme.filterCellStyle)\n const filterCellProps = {\n role: 'cell',\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null,\n className: classNames('rt-td-filter', column.headerClassName, themeClass),\n innerClassName,\n style: column.headerStyle\n }\n const { key, ...resolvedFilterCellProps } = column.getHeaderProps(filterCellProps)\n return (\n \n {filter}\n \n )\n })}\n \n )\n }\n\n safeUseLayoutEffect(() => {\n const toggleAllRowsExpanded = instance.toggleAllRowsExpanded\n if (defaultExpanded) {\n toggleAllRowsExpanded(true)\n } else {\n toggleAllRowsExpanded(false)\n }\n }, [instance.toggleAllRowsExpanded, defaultExpanded])\n\n // Track expanded columns for multiple row details\n const [expandedColumns, setExpandedColumns] = React.useState({})\n const makeRowDetails = (rowInfo, state) => {\n // Ensure that row is expanded and not a grouped row. Row details are\n // currently not supported on grouped rows.\n if (!rowInfo.isExpanded || rowInfo.isGrouped) {\n return null\n }\n\n const expandedId = expandedColumns[rowInfo.id]\n let expandedCol\n if (expandedId != null) {\n expandedCol = instance.visibleColumns.find(col => col.id === expandedId)\n } else {\n // When expanding all rows, default to the first column with details\n expandedCol = instance.visibleColumns.find(col => col.details)\n }\n // Ensure that row details exist. Rows may have expanded state even though\n // there are no row details (when defaultExpanded = true).\n if (!expandedCol) {\n return null\n }\n\n const { details, html } = expandedCol\n let props = {}\n if (typeof details === 'function') {\n let content = details(rowInfo, state)\n if (html) {\n props.html = content\n }\n props.children = content\n } else if (Array.isArray(details)) {\n let content = details[rowInfo.index]\n if (content == null) {\n // No content to render. Although this row has no expander, it may still\n // have expanded state (when defaultExpanded = true).\n return null\n }\n if (html) {\n props.html = content\n }\n props.children = hydrate({ Reactable, Fragment, WidgetContainer }, content)\n }\n // Set key to force updates when expanding a different column or changing page\n return \n }\n\n const makeTbody = () => {\n const hasStickyColumns = instance.visibleColumns.some(column => column.sticky)\n let rowHighlightClass = hasStickyColumns ? 'rt-tr-highlight-sticky' : 'rt-tr-highlight'\n let rowStripedClass = hasStickyColumns ? 'rt-tr-striped-sticky' : 'rt-tr-striped'\n\n const rows = instance.page.map((row, viewIndex) => {\n instance.prepareRow(row)\n\n // toggleRowSelected that supports single selection\n const toggleRowSelected = set => {\n if (set == null) {\n set = !row.isSelected\n }\n if (selection === 'single') {\n instance.setRowsSelected([])\n }\n row.toggleRowSelected(set)\n }\n\n const rowInfo = {\n ...row,\n toggleRowSelected,\n // For v6 compatibility\n viewIndex,\n row: row.values, // Deprecated in v0.3.0\n subRows: convertRowsToV6(row.subRows),\n aggregated: row.isGrouped,\n expanded: row.isExpanded,\n level: row.depth,\n selected: row.isSelected,\n page: state.pageIndex // Deprecated in v0.3.0\n }\n\n const rowProps = {\n className: classNames(\n striped && (viewIndex % 2 ? null : rowStripedClass),\n highlight && rowHighlightClass,\n row.isSelected && 'rt-tr-selected',\n css(theme.rowStyle)\n )\n }\n if (rowClassName) {\n let rowCls\n if (typeof rowClassName === 'function') {\n rowCls = rowClassName(rowInfo, stateInfo)\n } else if (Array.isArray(rowClassName)) {\n rowCls = rowClassName[rowInfo.index]\n } else {\n rowCls = rowClassName\n }\n rowProps.className = classNames(rowProps.className, rowCls)\n }\n if (rowStyle) {\n if (typeof rowStyle === 'function') {\n rowProps.style = rowStyle(rowInfo, stateInfo)\n } else if (Array.isArray(rowStyle)) {\n rowProps.style = rowStyle[rowInfo.index]\n } else {\n rowProps.style = rowStyle\n }\n }\n\n const rowDetails = makeRowDetails(rowInfo, stateInfo)\n\n let expandedId\n if (row.isExpanded) {\n if (expandedColumns[row.id] != null) {\n expandedId = expandedColumns[row.id]\n } else {\n // When expanding all rows, default to the first column with details\n const expandedCol = instance.visibleColumns.find(col => col.details)\n expandedId = expandedCol ? expandedCol.id : null\n }\n }\n\n const resolvedRowProps = row.getRowProps(rowProps)\n return (\n // Use relative row index for key (like in v6) rather than row index (v7)\n // for better rerender performance, especially with a large number of rows.\n \n \n {row.cells.map((cell, colIndex) => {\n const { column } = cell\n let cellProps = column.getProps ? column.getProps(rowInfo, column, stateInfo) : {}\n const { className: themeClass, innerClassName } = getCellTheme(theme.cellStyle)\n cellProps = {\n ...cellProps,\n className: classNames(cellProps.className, themeClass),\n innerClassName,\n role: column.rowHeader ? 'rowheader' : 'cell'\n }\n const cellInfo = {\n ...cell,\n column,\n filterValue: column.filterValue,\n ...rowInfo\n }\n let value\n if (cell.isGrouped) {\n value = column.Grouped ? column.Grouped(cellInfo, stateInfo) : cellInfo.value\n } else if (cell.isAggregated) {\n value = column.Aggregated\n ? column.Aggregated(cellInfo, stateInfo)\n : cell.render('Aggregated')\n } else if (cell.isPlaceholder) {\n value = ''\n } else {\n value = column.Cell ? column.Cell(cellInfo, stateInfo) : cell.render('Cell')\n }\n\n let hasDetails\n if (column.details && !row.isGrouped) {\n if (Array.isArray(column.details) && column.details[row.index] == null) {\n // Don't expand rows without content\n } else {\n hasDetails = true\n }\n }\n\n let expander\n if (hasDetails) {\n const isExpanded = row.isExpanded && expandedId === column.id\n cellProps = {\n ...cellProps,\n onClick: () => {\n if (isExpanded) {\n row.toggleRowExpanded(false)\n const newExpandedColumns = { ...expandedColumns }\n delete newExpandedColumns[row.id]\n setExpandedColumns(newExpandedColumns)\n } else {\n row.toggleRowExpanded(true)\n const newExpandedColumns = { ...expandedColumns, [row.id]: column.id }\n setExpandedColumns(newExpandedColumns)\n }\n },\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n // Hide overflow ellipsis and prevent text selection on expander-only columns\n if (value === emptyValue) {\n cellProps.style = { textOverflow: 'clip', userSelect: 'none', ...cellProps.style }\n }\n const expanderProps = {\n isExpanded: isExpanded,\n className: css(theme.expanderStyle),\n 'aria-label': language.detailsExpandLabel\n }\n expander = \n } else if (cell.isGrouped) {\n const isExpanded = row.isExpanded\n cellProps = {\n ...cellProps,\n onClick: () => row.toggleRowExpanded(),\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n const expanderProps = {\n isExpanded: isExpanded,\n className: css(theme.expanderStyle),\n 'aria-label': language.groupExpandLabel\n }\n expander = \n } else if (cell.column.isGrouped && row.canExpand) {\n // Make all grouped column cells expandable (including placeholders)\n cellProps = {\n ...cellProps,\n onClick: () => row.toggleRowExpanded(),\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n }\n\n const canRowSelect =\n selection === 'multiple' || (selection === 'single' && !cell.isAggregated)\n\n if (column.selectable && canRowSelect) {\n cellProps = {\n ...cellProps,\n onClick: () => toggleRowSelected(),\n className: classNames(cellProps.className, 'rt-td-select')\n }\n let ariaLabel\n if (cell.isAggregated) {\n ariaLabel = language.selectAllSubRowsLabel\n } else {\n ariaLabel = language.selectRowLabel\n }\n value = (\n toggleRowSelected()}\n aria-label={ariaLabel}\n />\n )\n }\n\n // Add cell click actions. Don't override existing click actions.\n if (onClick && !cellProps.onClick) {\n if (onClick === 'expand') {\n cellProps.onClick = () => row.toggleRowExpanded()\n } else if (onClick === 'select' && canRowSelect) {\n cellProps.onClick = () => toggleRowSelected()\n } else if (typeof onClick === 'function') {\n cellProps.onClick = () => onClick(rowInfo, column, stateInfo)\n }\n }\n\n const resolvedCellProps = cell.getCellProps(cellProps)\n return (\n // Use column ID for key (like in v6) rather than row index (v7)\n // for better rerender performance, especially with a large number of rows.\n \n {expander}\n {value}\n \n )\n })}\n \n {rowDetails}\n \n )\n })\n\n let padRows\n // Leave at least one row to show the no data message properly\n minRows = minRows ? Math.max(minRows, 1) : 1\n const padRowCount = Math.max(minRows - instance.page.length, 0)\n if (padRowCount > 0) {\n padRows = [...Array(padRowCount)].map((_, viewIndex) => {\n const rowProps = {\n className: classNames('rt-tr-pad', css(theme.rowStyle))\n }\n if (rowClassName) {\n let rowCls\n if (typeof rowClassName === 'function') {\n rowCls = rowClassName(undefined, stateInfo)\n } else if (Array.isArray(rowClassName)) {\n // rowClassName not used for pad rows\n } else {\n rowCls = rowClassName\n }\n rowProps.className = classNames(rowProps.className, rowCls)\n }\n if (rowStyle) {\n if (typeof rowStyle === 'function') {\n rowProps.style = rowStyle(undefined, stateInfo)\n } else if (Array.isArray(rowStyle)) {\n // rowStyle not used for pad rows\n } else {\n rowProps.style = rowStyle\n }\n }\n return (\n \n \n {instance.visibleColumns.map(column => {\n const { className: themeClass, innerClassName } = getCellTheme(theme.cellStyle)\n const cellProps = {\n className: themeClass\n }\n // Get layout styles (flex, sticky) from footer props. useFlexLayout\n // doesn't have built-in support for pad cells.\n const { className, style } = column.getFooterProps(cellProps)\n return (\n \n  \n \n )\n })}\n \n \n )\n })\n }\n\n let className = css(theme.tableBodyStyle)\n let noData\n if (instance.rows.length === 0) {\n noData = {language.noData}\n // Hide cell borders when table has no data\n className = classNames('rt-tbody-no-data', className)\n } else {\n // Must be on the page for the ARIA live region to be announced\n noData = \n }\n const tbodyProps = instance.getTableBodyProps({ className })\n\n return (\n \n {rows}\n {padRows}\n {noData}\n \n )\n }\n\n const makeTfoot = () => {\n const hasFooters = instance.visibleColumns.some(column => column.footer != null)\n if (!hasFooters) {\n return null\n }\n\n const tfootProps = instance.getTfootProps()\n return (\n \n \n {instance.visibleColumns.map(column => {\n column = {\n ...column,\n column, // Deprecated in v0.3.0\n data: rowData // Deprecated in v0.3.0\n }\n const footer =\n typeof column.Footer === 'function'\n ? column.Footer(column, stateInfo)\n : column.render('Footer')\n\n const { className: themeClass, innerClassName } = getCellTheme(theme.footerStyle)\n const footerProps = {\n className: classNames('rt-td-footer', column.footerClassName, themeClass),\n innerClassName,\n style: column.footerStyle,\n role: column.rowHeader ? 'rowheader' : 'cell',\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null\n }\n const { key, ...resolvedFooterProps } = column.getFooterProps(footerProps)\n return (\n \n {footer}\n \n )\n })}\n \n \n )\n }\n\n // Track the max number of rows for auto-shown pagination. Unfortunately, the max\n // number of rows can't be determined up front in a grouped and filtered table\n // because grouping happens after filtering (and swapping these hooks would\n // disable dynamic aggregation). Instead, we track the max number of rows\n // per dataset, so at least the pagination doesn't disappear upon filtering.\n //\n // Unused for server-side pagination.\n const maxRowCount = React.useRef(\n paginateSubRows ? instance.flatRows.length : instance.rows.length\n )\n\n React.useEffect(() => {\n maxRowCount.current = 0\n }, [data])\n\n React.useEffect(() => {\n const rowCount = paginateSubRows ? instance.flatRows.length : instance.rows.length\n if (rowCount > maxRowCount.current) {\n maxRowCount.current = rowCount\n }\n }, [paginateSubRows, instance.flatRows, instance.rows])\n\n const makePagination = () => {\n if (showPagination === false) {\n return null\n } else if (!pagination && showPagination == null) {\n // Unpaginated tables can still have a visible pagination bar (e.g., for page info)\n return null\n } else if (pagination && showPagination == null) {\n // Auto-hide pagination if the entire table fits on one page\n const minPageSize = showPageSizeOptions\n ? Math.min(state.pageSize, ...(pageSizeOptions || []))\n : state.pageSize\n\n let rowCount\n if (serverMaxRowCount != null) {\n rowCount = serverMaxRowCount\n } else if (serverRowCount != null) {\n // If the optional server-side maxRowCount isn't provided, fall back to\n // serverRowCount so at least the pagination bar appears when expanding\n // a table past its initial page.\n rowCount = serverRowCount\n } else {\n rowCount = maxRowCount.current\n }\n if (rowCount <= minPageSize) {\n return null\n }\n }\n return (\n \n )\n }\n\n // Add keyboard-only focus styles\n const rootElement = React.useRef(null)\n const keyboardActiveProps = {\n onMouseDown: () => {\n rootElement.current.classList.remove('rt-keyboard-active')\n },\n onKeyDown: () => {\n rootElement.current.classList.add('rt-keyboard-active')\n },\n onKeyUp: e => {\n // Detect keyboard use when tabbing into the table\n const keyCode = e.which || e.keyCode\n if (keyCode === 9) {\n rootElement.current.classList.add('rt-keyboard-active')\n }\n }\n }\n\n // Provide keyboard access to scrollable tables. Make the table focusable,\n // but only when it has a scrollbar.\n const tableElement = React.useRef(null)\n const [tableHasScrollbar, setTableHasScrollbar] = React.useState(false)\n safeUseLayoutEffect(() => {\n const checkTableHasScrollbar = () => {\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = tableElement.current\n const hasScrollbar = scrollHeight > clientHeight || scrollWidth > clientWidth\n setTableHasScrollbar(hasScrollbar)\n }\n if (window.ResizeObserver) {\n const resizeObserver = new ResizeObserver(() => {\n checkTableHasScrollbar()\n })\n resizeObserver.observe(tableElement.current)\n return function cleanup() {\n resizeObserver.disconnect()\n }\n } else {\n // Degrade gracefully on older browsers (e.g., Safari < 13)\n checkTableHasScrollbar()\n }\n }, [])\n\n // Send reactable state to Shiny for getReactableState\n React.useEffect(() => {\n // Ignore nested tables that aren't Shiny outputs\n if (!window.Shiny || !window.Shiny.onInputChange || nested) {\n return\n }\n // Ensure this is a Shiny output, not a static rendered table in Shiny\n const outputId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n if (!outputId) {\n return\n }\n // Convert to R's 1-based indices\n const selectedIndexes = stateInfo.selected.map(index => index + 1)\n // Convert to R's 1-based indices\n const page = stateInfo.page + 1\n // Convert sortBy array to named list of \"asc\" and \"desc\"\n let sorted = stateInfo.sorted.length > 0 ? {} : null\n for (let sortInfo of stateInfo.sorted) {\n sorted[sortInfo.id] = sortInfo.desc ? 'desc' : 'asc'\n }\n\n // NOTE: any object arrays will be simplified into vectors by jsonlite by default. Avoid sending\n // arrays without transforming them first, or adding a custom input type and input handler.\n const state = {\n page: page,\n pageSize: stateInfo.pageSize,\n pages: stateInfo.pages,\n sorted: sorted,\n selected: selectedIndexes\n }\n // Shiny.onInputChange has built-in debouncing, so it's not strictly necessary to\n // debounce rapid state changes here.\n Object.keys(state).forEach(prop => {\n // NOTE: output IDs must always come first to work with Shiny modules\n window.Shiny.onInputChange(`${outputId}__reactable__${prop}`, state[prop])\n })\n }, [\n nested,\n stateInfo.page,\n stateInfo.pageSize,\n stateInfo.pages,\n stateInfo.sorted,\n stateInfo.selected\n ])\n\n // Getter for the latest page count\n const getPageCount = useGetLatest(instance.pageCount)\n\n // Add Shiny message handler for updateReactable\n React.useEffect(() => {\n // Ignore nested tables that aren't Shiny outputs\n if (!window.Shiny || nested) {\n return\n }\n // Ensure this is a Shiny output, not a static rendered table in Shiny\n const outputId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n if (!outputId) {\n return\n }\n const setRowsSelected = instance.setRowsSelected\n const gotoPage = instance.gotoPage\n const toggleAllRowsExpanded = instance.toggleAllRowsExpanded\n\n const updateState = newState => {\n if (newState.jsEvals) {\n for (let key of newState.jsEvals) {\n window.HTMLWidgets.evaluateStringMember(newState, key)\n }\n }\n if (newState.data != null) {\n const data = normalizeColumnData(newState.data, dataColumns)\n setNewData(data)\n }\n if (newState.selected != null) {\n const selectedRowIds = newState.selected.map(index => String(index))\n setRowsSelected(selectedRowIds)\n }\n if (newState.page != null) {\n // Get the latest page count in case a data update changes the number of pages\n const nearestValidPage = Math.min(\n Math.max(newState.page, 0),\n Math.max(getPageCount() - 1, 0)\n )\n gotoPage(nearestValidPage)\n }\n if (newState.expanded != null) {\n if (newState.expanded) {\n toggleAllRowsExpanded(true)\n } else {\n toggleAllRowsExpanded(false)\n }\n }\n if (newState.meta !== undefined) {\n setMeta(newState.meta)\n }\n }\n window.Shiny.addCustomMessageHandler(`__reactable__${outputId}`, updateState)\n }, [\n nested,\n instance.setRowsSelected,\n instance.gotoPage,\n instance.toggleAllRowsExpanded,\n dataColumns,\n getPageCount,\n setMeta\n ])\n\n // Set up Crosstalk and apply initial selection/filtering.\n // useLayoutEffect so the hook runs in order with other useLayoutEffect hooks.\n const ctRef = React.useRef(null)\n\n safeUseLayoutEffect(() => {\n if (!crosstalkGroup || !window.crosstalk) {\n return\n }\n\n const ct = {}\n ct.selection = new window.crosstalk.SelectionHandle(crosstalkGroup)\n ct.filter = new window.crosstalk.FilterHandle(crosstalkGroup)\n // Keep track of selected and filtered state updated by other widgets.\n // SelectionHandle and FilterHandle also track state, but will include changes\n // coming from the table as well.\n ct.selected = ct.selection.value\n ct.filtered = ct.filter.filteredKeys\n ctRef.current = ct\n\n const rowByKey = (crosstalkKey || []).reduce((obj, key, index) => {\n obj[key] = index\n return obj\n }, {})\n\n const setFilter = instance.setFilter\n const setRowsSelected = instance.setRowsSelected\n const applyCrosstalkFilter = () => {\n // Selection value is an array of keys, or null or empty array if empty\n // Filter value is an an array of keys, or null if empty\n const selectedKeys = ct.selected && ct.selected.length > 0 ? ct.selected : null\n const filteredKeys = ct.filtered\n let keys\n if (!selectedKeys && !filteredKeys) {\n keys = null\n } else if (!selectedKeys) {\n keys = filteredKeys\n } else if (!filteredKeys) {\n keys = selectedKeys\n } else {\n keys = selectedKeys.filter(key => filteredKeys.includes(key))\n }\n const filteredRows = keys ? keys.map(key => rowByKey[key]) : null\n setFilter(crosstalkId, filteredRows)\n }\n\n const setCrosstalkSelection = value => {\n if (ct.selected !== value) {\n ct.selected = value\n applyCrosstalkFilter()\n }\n }\n\n const setCrosstalkFilter = value => {\n if (ct.filtered !== value) {\n ct.filtered = value\n applyCrosstalkFilter()\n }\n }\n\n ct.selection.on('change', e => {\n if (e.sender !== ct.selection) {\n setCrosstalkSelection(e.value)\n // Selections from other widgets should clear table selection state\n ct.skipNextSelection = true\n setRowsSelected([])\n } else {\n // Selections from table should clear selections from other widgets\n setCrosstalkSelection(null)\n }\n })\n\n ct.filter.on('change', e => {\n if (e.sender !== ct.filter) {\n setCrosstalkFilter(e.value)\n }\n })\n\n // Apply initial filter/selection for dynamically rendered tables (e.g., nested tables, Shiny outputs)\n if (ct.selected || ct.filtered) {\n applyCrosstalkFilter()\n }\n\n return function cleanup() {\n // Prevent errors from other widgets from breaking the table, e.g.,\n // https://github.com/ropensci/plotly/issues/1346\n try {\n ct.selection.close()\n } catch (e) {\n console.error('Error closing Crosstalk selection handle:', e)\n }\n try {\n ct.filter.close()\n } catch (e) {\n console.error('Error closing Crosstalk filter handle:', e)\n }\n }\n }, [crosstalkKey, crosstalkGroup, crosstalkId, instance.setFilter, instance.setRowsSelected])\n\n // Don't set Crosstalk selection on initial render\n safeUseLayoutEffect(() => {\n if (!ctRef.current) {\n return\n }\n if (!defaultSelected) {\n ctRef.current.skipNextSelection = true\n }\n }, [defaultSelected])\n\n // Set Crosstalk selection. useLayoutEffect to avoid visual flickering when\n // selecting a row and clearing a pre-existing selection at the same time.\n safeUseLayoutEffect(() => {\n if (!ctRef.current || !selection) {\n return\n }\n\n const ct = ctRef.current\n // Some selections don't update Crosstalk state, like selection clears from\n // other widget selections\n if (ct.skipNextSelection) {\n ct.skipNextSelection = false\n return\n }\n\n const selectedKeys = Object.keys(state.selectedRowIds).map(id => {\n return crosstalkKey[rowsById[id].index]\n })\n // Prevent errors from other widgets from breaking the table, e.g.,\n // https://github.com/ropensci/plotly/issues/1346\n try {\n ct.selection.set(selectedKeys)\n } catch (e) {\n console.error('Error selecting Crosstalk keys:', e)\n }\n }, [state.selectedRowIds, rowsById, selection, crosstalkKey])\n\n // Expose a limited JavaScript API to the table instance\n instance.state = stateInfo\n instance.downloadDataCSV = (filename, options = {}) => {\n filename = filename || 'data.csv'\n const csv = instance.getDataCSV(options)\n downloadCSV(csv, filename)\n }\n instance.getDataCSV = (options = {}) => {\n if (!options.columnIds) {\n options.columnIds = dataColumns.map(col => col.id)\n }\n // Ignore columns without data (e.g., selection or details columns) by default\n const dataColumnIds = data.length > 0 ? Object.keys(data[0]) : []\n options.columnIds = options.columnIds.filter(id => dataColumnIds.includes(id))\n // Ensure rows are flattened and ignore sort order. Unlike instance.flatRows,\n // instance.preGroupedRows excludes aggregated rows and uses the original data order.\n const rows = instance.preGroupedRows.map(row => row.values)\n const csv = rowsToCSV(rows, options)\n return csv\n }\n instance.setMeta = setMeta\n const origToggleHideColumn = instance.toggleHideColumn\n instance.toggleHideColumn = (columnId, isHidden) => {\n // Prevent duplicate column IDs from being added to hiddenColumns\n if (isHidden && stateInfo.hiddenColumns.includes(columnId)) {\n return\n }\n origToggleHideColumn(columnId, isHidden)\n }\n instance.setData = (data, options = {}) => {\n options = Object.assign({ resetSelected: true, resetExpanded: false }, options)\n if (typeof data !== 'object' || data == null) {\n throw new Error('data must be an array of row objects or an object containing column arrays')\n }\n // If data is in row format, it's assumed to have all numbers normalized (NA/NaN/Inf/-Inf not as strings)\n if (!Array.isArray(data)) {\n data = normalizeColumnData(data, dataColumns)\n }\n setNewData(data)\n if (options.resetSelected) {\n instance.setRowsSelected([])\n }\n if (options.resetExpanded) {\n instance.toggleAllRowsExpanded(false)\n }\n }\n\n let stateCallbacks = React.useRef([])\n instance.onStateChange = listenerFn => {\n if (typeof listenerFn !== 'function') {\n throw new Error('listenerFn must be a function')\n }\n stateCallbacks.current.push(listenerFn)\n return function cancel() {\n stateCallbacks.current = stateCallbacks.current.filter(cb => cb !== listenerFn)\n }\n }\n // Debounce rapid state changes. Some actions can cause the table to render twice, e.g., when\n // sorting and the pageIndex is automatically reset to 0 via an internal side effect.\n const onStateChange = useAsyncDebounce(state => {\n stateCallbacks.current.forEach(cb => {\n cb(state)\n })\n }, 0)\n React.useEffect(() => {\n onStateChange(stateInfo)\n }, [stateInfo, onStateChange])\n\n const getTableInstance = useGetLatest(instance)\n\n React.useEffect(() => {\n // For static rendered tables, the instance ID is the element ID. For Shiny outputs,\n // the instance ID is the Shiny output ID, although the element ID may override it.\n let instanceId = elementId\n if (!instanceId) {\n instanceId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n }\n if (!instanceId) {\n return\n }\n\n tableInstances[instanceId] = getTableInstance\n\n return function cleanup() {\n delete tableInstances[instanceId]\n }\n }, [elementId, getTableInstance])\n\n className = classNames(\n className,\n css(theme.style),\n outlined && 'rt-outlined',\n bordered && 'rt-bordered',\n borderless && 'rt-borderless',\n compact && 'rt-compact',\n nowrap && 'rt-nowrap',\n inline && ' rt-inline'\n )\n style = { width, height, ...style }\n\n const isResizing = state.columnResizing.isResizingColumn != null\n const tableClassName = classNames(css(theme.tableStyle), isResizing && 'rt-resizing')\n\n return (\n \n {makeSearch()}\n \n {makeThead()}\n {makeTbody()}\n {makeTfoot()}\n \n {makePagination()}\n \n )\n}\n\nReactable.propTypes = {\n data: PropTypes.objectOf(PropTypes.array).isRequired,\n columns: PropTypes.arrayOf(PropTypes.object).isRequired,\n columnGroups: PropTypes.arrayOf(PropTypes.object),\n groupBy: PropTypes.arrayOf(PropTypes.string),\n sortable: PropTypes.bool,\n resizable: PropTypes.bool,\n filterable: PropTypes.bool,\n searchable: PropTypes.bool,\n searchMethod: PropTypes.func,\n defaultSortDesc: PropTypes.bool,\n defaultSorted: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string, desc: PropTypes.bool })),\n pagination: PropTypes.bool,\n defaultPageSize: PropTypes.number,\n pageSizeOptions: PropTypes.arrayOf(PropTypes.number),\n paginationType: PropTypes.oneOf(['numbers', 'jump', 'simple']),\n showPagination: PropTypes.bool,\n showPageSizeOptions: PropTypes.bool,\n showPageInfo: PropTypes.bool,\n minRows: PropTypes.number,\n paginateSubRows: PropTypes.bool,\n defaultExpanded: PropTypes.bool,\n selection: PropTypes.oneOf(['multiple', 'single']),\n selectionId: PropTypes.string, // Deprecated in v0.3.0\n defaultSelected: PropTypes.arrayOf(PropTypes.number),\n onClick: PropTypes.oneOfType([PropTypes.oneOf(['expand', 'select']), PropTypes.func]),\n outlined: PropTypes.bool,\n bordered: PropTypes.bool,\n borderless: PropTypes.bool,\n striped: PropTypes.bool,\n highlight: PropTypes.bool,\n compact: PropTypes.bool,\n nowrap: PropTypes.bool,\n showSortIcon: PropTypes.bool,\n showSortable: PropTypes.bool,\n className: PropTypes.string,\n style: PropTypes.object,\n rowClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.array]),\n rowStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.array]),\n inline: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n theme: PropTypes.object,\n language: PropTypes.object,\n meta: PropTypes.object,\n crosstalkKey: PropTypes.array,\n crosstalkGroup: PropTypes.string,\n crosstalkId: PropTypes.string,\n elementId: PropTypes.string,\n nested: PropTypes.bool,\n dataKey: PropTypes.string,\n dataURL: PropTypes.string,\n serverRowCount: PropTypes.number,\n serverMaxRowCount: PropTypes.number\n}\n\nReactable.defaultProps = {\n sortable: true,\n pagination: true,\n defaultPageSize: 10,\n paginationType: 'numbers',\n pageSizeOptions: [10, 25, 50, 100],\n showPageInfo: true,\n minRows: 1,\n showSortIcon: true,\n crosstalkId: '__crosstalk__'\n}\n\nReactableData.propTypes = Reactable.propTypes\nReactableData.defaultProps = Reactable.defaultProps\n","import React from 'react'\n\nexport default function useMeta(initialMeta = {}) {\n const [meta, setRawMeta] = React.useState(initialMeta)\n const setMeta = meta => {\n if (meta == null) {\n setRawMeta({})\n return\n }\n if (typeof meta !== 'object' && typeof meta !== 'function') {\n throw new Error('meta must be an object or function')\n }\n setRawMeta(prevMeta => {\n if (typeof meta === 'function') {\n meta = meta(prevMeta)\n }\n const newMeta = { ...prevMeta, ...meta }\n for (let [key, value] of Object.entries(newMeta)) {\n if (value === undefined) {\n delete meta[key]\n }\n }\n return newMeta\n })\n }\n return [meta, setMeta]\n}\n","import { reactWidget } from './reactR'\n\nimport Reactable from './Reactable'\n\nreactWidget('reactable', 'output', {\n Reactable\n})\n\nexport * from './Reactable'\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","React","ReactDOM","hydrate","components","tag","name","toUpperCase","Error","args","attribs","children","child","push","renderErr","actions","init","emptyRenderer","defaultColumn","Cell","width","minWidth","maxWidth","Number","MAX_SAFE_INTEGER","mergeProps","propList","reduce","props","next","style","className","rest","handlePropGetter","prevProps","userProps","meta","Array","isArray","makePropGetter","hooks","prev","reduceHooks","initial","loopHooks","context","forEach","hook","ensurePluginOrder","plugins","befores","pluginName","afters","findIndex","plugin","before","functionalUpdate","updater","old","useGetLatest","ref","current","safeUseLayoutEffect","document","useMountedLayoutEffect","fn","deps","mountedRef","makeRenderer","instance","column","type","Comp","console","info","flexRender","component","proto","getPrototypeOf","isReactComponent","isClassComponent","$$typeof","includes","description","isExoticComponent","linkColumnStructure","columns","parent","depth","map","assignColumnAccessor","flattenColumns","flat","recurse","arr","id","accessor","Header","accessorPath","split","row","path","def","val","cacheKey","JSON","stringify","pathObj","pathObjCache","flattenDeep","String","replace","join","reOpenBracket","reCloseBracket","makePathArray","set","cursor","pathPart","e","getBy","error","assign","decorateColumn","userDefaultColumn","Footer","originalWidth","makeHeaderGroups","allColumns","additionalHeaderProperties","headerGroups","scanColumns","uid","getUID","headerGroup","headers","parentColumns","hasParents","some","newParent","latestParentColumn","reverse","originalId","placeholderOf","length","Map","getFirstDefined","i","isFunction","expandRows","rows","manualExpandedKey","expanded","expandSubRows","expandedRows","handleRow","addToExpandedRows","isExpanded","original","canExpand","subRows","getFilterMethod","filter","userFilterTypes","filterTypes","text","shouldAutoRemoveFilter","autoRemove","unpreparedAccessWarning","newArr","defaultGetTableProps","role","defaultGetTableBodyProps","defaultGetHeaderProps","colSpan","totalVisibleHeaderCount","defaultGetFooterProps","defaultGetHeaderGroupProps","index","defaultGetFooterGroupProps","defaultGetRowProps","defaultGetCellProps","cell","makeDefaultPluginHooks","useOptions","stateReducers","useControlledState","columnsDeps","allColumnsDeps","accessValue","materializedColumns","materializedColumnsDeps","useInstanceAfterData","visibleColumns","visibleColumnsDeps","headerGroupsDeps","useInstanceBeforeDimensions","useInstance","prepareRow","getTableProps","getTableBodyProps","getHeaderGroupProps","getFooterGroupProps","getHeaderProps","getFooterProps","getRowProps","getCellProps","useFinalInstance","resetHiddenColumns","toggleHideColumn","setHiddenColumns","toggleHideAllColumns","useColumnVisibility","getToggleHiddenProps","defaultGetToggleHiddenProps","getToggleHideAllColumnsProps","defaultGetToggleHideAllColumnsProps","reducer","state","hiddenColumns","onChange","toggleHidden","target","checked","isVisible","title","allColumnsHidden","indeterminate","action","previousState","initialState","columnId","shouldAll","handleColumn","parentVisible","subColumn","subHeader","flatHeaders","dispatch","getHooks","autoResetHiddenColumns","getInstance","getAutoResetHiddenColumns","defaultInitialState","defaultColumnInstance","defaultReducer","prevState","defaultGetSubRows","defaultGetRowId","defaultUseControlledState","applyDefaults","getSubRows","getRowId","stateReducer","useTable","instanceRef","Boolean","data","userColumns","getStateReducer","s","handler","undefined","reducerState","flatRows","rowsById","allColumnsQueue","shift","accessRowsForColumn","accessValueHooks","initialRows","find","all","visibleColumnsDep","sort","calculateHeaderWidths","totalColumnsMinWidth","totalColumnsWidth","totalColumnsMaxWidth","render","footerGroups","allCells","values","cells","left","sumTotalMinWidth","sumTotalWidth","sumTotalMaxWidth","sumTotalFlexWidth","header","subHeaders","totalLeft","totalMinWidth","totalWidth","totalMaxWidth","totalFlexWidth","Math","min","max","canResize","accessRow","originalRow","rowIndex","parentRows","originalSubRows","resetExpanded","toggleRowExpanded","toggleAllRowsExpanded","useExpanded","getToggleAllRowsExpandedProps","defaultGetToggleAllRowsExpandedProps","getToggleRowExpandedProps","defaultGetToggleRowExpandedProps","onClick","isAllRowsExpanded","keys","rowId","setExpanded","exists","shouldExist","paginateExpandedRows","autoResetExpanded","getAutoResetExpanded","expandedDepth","maxDepth","splitId","findExpandedDepth","preExpandedRows","ids","filterValue","rowValue","toLowerCase","exactText","exactTextCase","includesAll","every","includesSome","includesValue","exact","equals","between","Infinity","temp","resetFilters","setFilter","setAllFilters","useFilters","filters","filterMethod","previousfilter","newFilter","manualFilters","defaultCanFilter","disableFilters","autoResetFilters","columnDefaultCanFilter","columnDisableFilters","canFilter","found","filteredFlatRows","filteredRowsById","filterRows","filteredRows","filteredSoFar","preFilteredRows","warn","nonFilteredColumns","getAutoResetFilters","preFilteredFlatRows","preFilteredRowsById","resetGlobalFilter","setGlobalFilter","useGlobalFilter","globalFilter","manualGlobalFilter","globalFilterValue","autoResetGlobalFilter","disableGlobalFilter","columnDisableGlobalFilter","filterableColumns","c","globalFilteredRows","globalFilteredFlatRows","globalFilteredRowsById","getAutoResetGlobalFilter","preGlobalFilteredRows","preGlobalFilteredFlatRows","preGlobalFilteredRowsById","sum","aggregatedValues","minMax","average","median","mid","floor","nums","b","unique","from","Set","uniqueCount","size","count","resetGroupBy","setGroupBy","toggleGroupBy","reSplitAlphaNumeric","alphanumeric","rowA","rowB","getRowValuesByColumnID","toString","aa","bb","an","parseInt","bn","combo","isNaN","datetime","compareBasic","getTime","basic","string","alower","blower","number","replaceNonNumeric","row1","row2","resetSortBy","setSortBy","toggleSortBy","clearSortBy","sortType","sortDescFirst","useSortBy","getSortByToggleProps","defaultGetSortByToggleProps","isMultiSortEvent","shiftKey","canSort","persist","disableMultiSort","sortBy","newSortBy","sortAction","desc","multi","disableSortRemove","disableMultiRemove","maxMultiSortColCount","existingSortBy","existingIndex","hasDescDefined","splice","orderByFn","defaultOrderByFn","userSortTypes","sortTypes","manualSortBy","defaultCanSort","disableSortBy","autoResetSortBy","defaultColumnCanSort","columnDisableSortBy","columnSort","isSorted","sortedIndex","isSortedDesc","sortedFlatRows","availableSortBy","col","sortData","sortedData","sortMethod","sortInverted","sortedRows","getAutoResetSortBy","preSortedRows","preSortedFlatRows","funcs","dirs","sortFn","sortInt","resetPage","gotoPage","setPageSize","resetPivot","togglePivot","resetSelectedRows","toggleAllRowsSelected","toggleRowSelected","toggleAllPageRowsSelected","setRowState","setCellState","resetRowState","resetColumnOrder","setColumnOrder","columnStartResizing","columnResizing","columnDoneResizing","resetResize","reactR","StyleSheet","options","_this","this","_insertTag","tags","insertionPoint","nextSibling","prepend","container","firstChild","insertBefore","isSpeedy","speedy","ctr","nonce","_proto","nodes","insert","rule","createElement","setAttribute","appendChild","createTextNode","createStyleElement","sheet","styleSheets","ownerNode","sheetForTag","insertRule","cssRules","flush","parentNode","removeChild","abs","fromCharCode","trim","pattern","replacement","indexof","search","indexOf","charCodeAt","begin","end","slice","array","line","position","character","characters","node","root","return","copy","peek","caret","token","alloc","dealloc","delimit","delimiter","whitespace","escaping","commenter","identifier","MS","MOZ","WEBKIT","COMMENT","DECLARATION","KEYFRAMES","serialize","callback","output","element","prefix","hash","compile","parse","rules","rulesets","pseudo","points","declarations","offset","atrule","property","previous","variable","scanning","ampersand","reference","comment","declaration","ruleset","post","j","k","x","y","z","identifierWithPointTracking","fixedElements","WeakMap","compat","isImplicitRule","parsed","toRules","getRules","parentRules","removeLabel","defaultStylisPlugins","exec","match","str","h","len","animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","hyphenateRegex","animationRegex","isCustomProperty","isProcessableValue","processStyleName","cache","create","arg","styleName","processStyleValue","p1","p2","styles","handleInterpolation","mergedProps","registered","interpolation","__emotion_styles","anim","_key","interpolated","_i","createStringFromObject","previousCursor","result","cached","labelPattern","serializeStyles","stringMode","strings","raw","lastIndex","identifierName","getRegisteredStyles","registeredStyles","classNames","rawClassName","insertStyles","serialized","isStringTag","registerStyles","inserted","insertWithoutScoping","merge","css","emotion","classnames","cls","toAdd","ssrStyles","querySelectorAll","getAttribute","head","_insert","stylisPlugins","nodesToHydrate","attrib","currentSheet","collection","finalizingPlugins","serializer","concat","selector","shouldCache","_len","arguments","cx","_len4","_key4","injectGlobal","_len3","_key3","keyframes","_len2","_key2","animation","bind","classes","removeEmptyProps","entries","escapeRegExp","getLeafColumns","leafColumns","recurseColumn","convertRowsToV6","_subRows","rowsToCSV","columnIds","sep","dec","rowToCSV","Date","toISOString","csvRows","downloadCSV","content","filename","blob","Blob","navigator","msSaveBlob","link","url","URL","createObjectURL","href","download","click","revokeObjectURL","isBrowser","getFirstDefinedProp","objects","defaultVal","getEmotion","substring","lastIndexOf","rel","parentElement","createEmotion","defaultLanguage","sortLabel","filterPlaceholder","filterLabel","searchPlaceholder","searchLabel","noData","pageNext","pagePrevious","pageNumbers","pageInfo","pageSizeOptions","pageNextLabel","pagePreviousLabel","pageNumberLabel","pageJumpLabel","pageSizeOptionsLabel","groupExpandLabel","detailsExpandLabel","selectAllRowsLabel","selectAllSubRowsLabel","selectRowLabel","defaultGroupHeader","detailsCollapseLabel","deselectAllRowsLabel","deselectAllSubRowsLabel","deselectRowLabel","renderTemplate","template","params","separator","RegExp","templateParams","rendered","PageButton","isCurrent","Pagination","changePage","applyPage","pageJumpValue","page","prevPage","newPage","onPageChange","preventDefault","currentPage","setState","pageSize","pageRowCount","rowCount","language","rowStart","rowEnd","onPageSizeChange","option","elements","onBlur","onKeyPress","inputType","which","keyCode","nearestValidPage","pages","paginationType","showPageSizeOptions","showPageInfo","canPrevious","canNext","theme","renderPageInfo","renderPageSizeOptions","visiblePages","totalPages","_","getVisiblePages","pageButtons","pageButton","renderPageJump","getPageJumpProperties","prevButton","disabled","nextButton","paginationStyle","defaultProps","WidgetContainer","staticRender","HTMLWidgets","throttled","lastCall","setTimeout","useFlexLayout","getTheadProps","getRowGroupStyles","getTfootProps","getRowStyles","asPx","flexWidth","resizedWidths","columnWidths","calculateFlexWidths","isFixedWidth","useStickyColumns","stickyProps","groupColumns","firstStickyCol","sticky","stickyCols","right","getStickyProps","aggregations","emptyArray","emptyObject","useGroupBy","getGroupByToggleProps","defaultGetGroupByToggleProps","groupBy","canGroupBy","resolvedGroupBy","groupByColumns","g","nonGroupByColumns","isGrouped","groupedIndex","defaultUserAggregations","groupByFn","defaultGroupByFn","manualGroupBy","userAggregations","autoResetGroupBy","disableGroupBy","defaultCanGroupBy","defaultColumnGroupBy","defaultGroupBy","columnDisableGroupBy","Aggregated","existingGroupBy","parentId","setGroupingProps","groupedColumns","aggregatedColumns","groupByID","aggregateRowsToValues","leafRows","groupedRows","aggregateFn","aggregate","leafValues","columnValue","aggregateValue","aggregateValueFn","groupedFlatRows","groupedRowsById","onlyGroupedFlatRows","onlyGroupedRowsById","nonGroupedFlatRows","nonGroupedRowsById","groupUpRecursively","rowGroupsMap","aggregatedGroupedRows","groupByVal","flattenBy","groupIndex","subRow","getAutoResetGroupBy","preGroupedRows","preGroupedFlatRow","preGroupedRowsById","isAggregated","isPlaceholder","resKey","passiveSupported","useResizeColumns","getResizerProps","defaultGetResizerProps","onResizeStart","isTouchEvent","touches","raf","mostRecentClientX","headersToResize","getAllColumns","headerIdWidths","getDOMWidth","columnWidth","clientX","round","dispatchMove","cancelAnimationFrame","dispatchEnd","scheduleDispatchMoveOnNextAnimationFrame","clientXPos","requestAnimationFrame","handlersAndEvents","mouse","moveEvent","moveHandler","upEvent","upHandler","removeEventListener","touch","cancelable","stopPropagation","events","passiveIfSupported","supported","passive","addEventListener","err","passiveEventSupported","onMouseDown","onTouchStart","draggable","startX","isResizingColumn","percentageDeltaX","newColumnWidths","headerId","headerWidth","disableResizing","isResizing","autoResetResize","getAutoResetResize","resetResizing","useRowSelect","getToggleRowSelectedProps","defaultGetToggleRowSelectedProps","getToggleAllRowsSelectedProps","defaultGetToggleAllRowsSelectedProps","getToggleAllPageRowsSelectedProps","defaultGetToggleAllPageRowsSelectedProps","setRowsSelected","manualRowSelectedKey","isSelected","isSomeSelected","isAllRowsSelected","selectedRowIds","isAllPageRowsSelected","setSelected","selectAll","selectSubRows","newSelectedRowIds","handleRowById","autoResetSelectedRows","selectedFlatRows","getRowIsSelected","getAutoResetSelectedRows","allChildrenSelected","someSelected","availableSubRows","usePagination","pageIndex","pageCount","newPageIndex","canNavigate","topRowIndex","autoResetPage","userPageCount","disablePagination","manualPagination","userRowCount","getAutoResetPage","ceil","pageOptions","fill","pageStart","pageEnd","canPreviousPage","canNextPage","previousPage","nextPage","numbers","omitMissingNumbers","mean","NaN","numericAggregators","apply","defaultAggregators","maxValue","minValue","frequency","counts","getAggregateFunction","n","digits","isFinite","pow","sign","emptyValue","subRowsKey","normalizeColumnData","convertJSONNumbers","columnsToRows","names","numericRowStateColumns","materializedRowsToData","paginateSubRows","parentRowIds","subRowCount","rowState","grouped","selected","dataRow","RawHTML","html","dangerouslySetInnerHTML","__html","buildColumnDefs","groups","tableProps","sortable","defaultSortDesc","showSortIcon","showSortable","filterable","resizable","createCompareFunction","naLast","sortNALast","searchable","show","createMatcher","createStartsWithMatcher","createSubstringMatcher","align","vAlign","headerVAlign","cellInfo","isMissingValue","na","format","formatValue","aggregated","Fragment","display","Grouped","sortClass","footer","colAlignClass","getAlignClass","cellVAlignClass","getVAlignClass","headerVAlignClass","headerClassName","footerClassName","getProps","rowInfo","addColumnGroups","group","groupIds","newCols","lastGroup","isUngrouped","suffix","separators","percent","currency","date","time","hour12","locales","maximumFractionDigits","useGrouping","minimumFractionDigits","toLocaleString","toLocaleDateString","toLocaleTimeString","regex","test","tableInstances","tableId","getState","setSearch","downloadDataCSV","getDataCSV","setMeta","isHidden","setData","onStateChange","listenerFn","Reactable","columnGroups","dataKey","color","backgroundColor","borderColor","borderWidth","stripedColor","highlightColor","cellPadding","tableBorderColor","tableBorderWidth","tableStyle","headerBorderColor","headerBorderWidth","headerStyle","groupHeaderBorderColor","groupHeaderBorderWidth","groupHeaderStyle","tableBodyStyle","rowGroupStyle","rowStyle","rowStripedStyle","rowHighlightStyle","rowSelectedStyle","cellBorderColor","cellBorderWidth","cellStyle","footerBorderColor","footerBorderWidth","footerStyle","inputStyle","filterInputStyle","searchInputStyle","selectStyle","pageButtonStyle","pageButtonHoverStyle","pageButtonActiveStyle","pageButtonCurrentStyle","expanderColor","selectColor","padding","height","filterCellStyle","expanderStyle","borderTopColor","borderTopWidth","backgroundImage","encodeURIComponent","createTheme","Table","useMemoizedObject","objStr","ReactableData","searchValue","TableData","RootComponent","TableComponent","TheadComponent","TbodyComponent","TfootComponent","TrGroupComponent","TrComponent","ThComponent","innerClassName","thProps","skipNextSort","setSkipNextSort","currentSortOrder","defaultSortOrder","toggleSort","isMultiSort","sortDesc","tabIndex","onMouseUp","detail","TdComponent","getCellTheme","ResizerComponent","RowDetails","Shiny","bindAll","el","unbindAll","ExpanderComponent","ariaLabel","FilterComponent","placeholder","SearchComponent","NoDataComponent","SelectInputComponent","searchMethod","pagination","selection","crosstalkGroup","crosstalkId","setResolvedData","dataColumns","cols","matchers","selectable","ctCol","maxRowCount","originalData","defaultSorted","showPagination","defaultPageSize","minRows","defaultExpanded","defaultSelected","selectionId","outlined","bordered","borderless","compact","nowrap","striped","highlight","rowClassName","inline","initialMeta","crosstalkKey","elementId","nested","dataURL","initialServerRowCount","serverRowCount","initialServerMaxRowCount","serverMaxRowCount","newData","setNewData","useServerData","setServerRowCount","setServerMaxRowCount","setRawMeta","prevMeta","newMeta","useMeta","setRowProps","skipInitialFetch","location","fetch","method","body","then","res","json","catch","selectedRowIndexes","indexes","selectedIndexes","onInputChange","searchableRef","rowData","stateInfo","sorted","pageRows","headerRefs","handleHeader","getBoundingClientRect","isFilterable","filterableRef","expandedColumns","setExpandedColumns","rootElement","keyboardActiveProps","classList","remove","onKeyDown","add","onKeyUp","tableElement","tableHasScrollbar","setTableHasScrollbar","checkTableHasScrollbar","scrollHeight","clientHeight","scrollWidth","clientWidth","ResizeObserver","resizeObserver","observe","disconnect","outputId","sortInfo","getPageCount","addCustomMessageHandler","newState","jsEvals","evaluateStringMember","ctRef","crosstalk","ct","SelectionHandle","FilterHandle","filtered","filteredKeys","rowByKey","applyCrosstalkFilter","selectedKeys","setCrosstalkSelection","on","sender","skipNextSelection","close","csv","dataColumnIds","origToggleHideColumn","resetSelected","stateCallbacks","cb","defaultFn","defaultWait","debounceRef","getDefaultFn","getDefaultWait","promise","Promise","resolve","reject","timeout","clearTimeout","useAsyncDebounce","getTableInstance","instanceId","theadProps","tableClassName","isGroupHeader","headerGroupKey","headerGroupProps","resizer","headerProps","themeClass","resolvedHeaderProps","filterInput","filterCellProps","resolvedFilterCellProps","padRows","hasStickyColumns","rowHighlightClass","rowStripedClass","viewIndex","rowCls","level","rowProps","expandedId","rowDetails","expandedCol","details","makeRowDetails","resolvedRowProps","colIndex","cellProps","rowHeader","hasDetails","expander","newExpandedColumns","textOverflow","userSelect","expanderProps","canRowSelect","resolvedCellProps","padRowCount","tbodyProps","makeTbody","hasFooters","tfootProps","footerProps","resolvedFooterProps","makeTfoot","minPageSize","makePagination","widget","factory","renderValue","hasAttribute","resize"],"sourceRoot":""} \ No newline at end of file +{"version":3,"file":"reactable.js","mappings":"YACA,IAAIA,EAAsB,CCA1BA,EAAwB,SAASC,GAChC,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,WAAa,OAAOF,EAAgB,OAAG,EACvC,WAAa,OAAOA,CAAQ,EAE7B,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CACR,ECNAF,EAAwB,SAASM,EAASC,GACzC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAG3E,ECPAR,EAAwB,SAASc,EAAKC,GAAQ,OAAOL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,EAAO,ECCtGf,EAAwB,SAASM,GACX,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GACvD,G,g8CCNA,IAAI,EAA+BC,OAAOC,M,SCAtC,EAA+BD,OAAOE,S,mHCiCnC,SAASC,EAAQC,EAAYC,GAClC,GAAmB,iBAARA,EAAkB,OAAOA,EACpC,GAAIA,EAAIC,KAAK,KAAOD,EAAIC,KAAK,GAAGC,gBAAkBH,EAAWC,EAAIC,MAC/D,MAAM,IAAIE,MAAM,sBAAwBH,EAAIC,MAE9C,IAE8BG,EADxBC,EAAO,CADAN,EAAWC,EAAIC,OAASD,EAAIC,KACrBD,EAAIM,SAAQC,E,25BAAAC,CACdR,EAAIS,UAAQ,IAA9B,IAAAF,EAAAG,MAAAN,EAAAG,EAAAI,KAAAC,MAAgC,KAAvBC,EAAKT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sources":["webpack://Reactable/webpack/bootstrap","webpack://Reactable/webpack/runtime/compat get default export","webpack://Reactable/webpack/runtime/define property getters","webpack://Reactable/webpack/runtime/hasOwnProperty shorthand","webpack://Reactable/webpack/runtime/make namespace object","webpack://Reactable/external var \"window.React\"","webpack://Reactable/external var \"window.ReactDOM\"","webpack://Reactable/./srcjs/reactR.js","webpack://Reactable/./node_modules/react-table/src/publicUtils.js","webpack://Reactable/./node_modules/react-table/src/utils.js","webpack://Reactable/./node_modules/react-table/src/makeDefaultPluginHooks.js","webpack://Reactable/./node_modules/react-table/src/hooks/useColumnVisibility.js","webpack://Reactable/./node_modules/react-table/src/hooks/useTable.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useExpanded.js","webpack://Reactable/./node_modules/react-table/src/filterTypes.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useFilters.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGlobalFilter.js","webpack://Reactable/./node_modules/react-table/src/aggregations.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGroupBy.js","webpack://Reactable/./node_modules/react-table/src/sortTypes.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useSortBy.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/usePagination.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/_UNSTABLE_usePivotColumns.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useRowSelect.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useRowState.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useColumnOrder.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useResizeColumns.js","webpack://Reactable/./node_modules/react-table/src/plugin-hooks/useGridLayout.js","webpack://Reactable/external var \"window.reactR\"","webpack://Reactable/./node_modules/@emotion/sheet/dist/emotion-sheet.browser.esm.js","webpack://Reactable/./node_modules/stylis/src/Utility.js","webpack://Reactable/./node_modules/stylis/src/Tokenizer.js","webpack://Reactable/./node_modules/stylis/src/Enum.js","webpack://Reactable/./node_modules/stylis/src/Serializer.js","webpack://Reactable/./node_modules/stylis/src/Prefixer.js","webpack://Reactable/./node_modules/stylis/src/Parser.js","webpack://Reactable/./node_modules/@emotion/cache/dist/emotion-cache.browser.esm.js","webpack://Reactable/./node_modules/stylis/src/Middleware.js","webpack://Reactable/./node_modules/@emotion/hash/dist/emotion-hash.esm.js","webpack://Reactable/./node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","webpack://Reactable/./node_modules/@emotion/serialize/dist/emotion-serialize.browser.esm.js","webpack://Reactable/./node_modules/@emotion/serialize/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","webpack://Reactable/./node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","webpack://Reactable/./node_modules/@emotion/css/create-instance/dist/emotion-css-create-instance.esm.js","webpack://Reactable/./srcjs/theme.js","webpack://Reactable/./srcjs/utils.js","webpack://Reactable/./srcjs/language.js","webpack://Reactable/./srcjs/Pagination.js","webpack://Reactable/./srcjs/WidgetContainer.js","webpack://Reactable/./srcjs/useFlexLayout.js","webpack://Reactable/./srcjs/useStickyColumns.js","webpack://Reactable/./srcjs/useGroupBy.js","webpack://Reactable/./srcjs/useResizeColumns.js","webpack://Reactable/./srcjs/useRowSelect.js","webpack://Reactable/./srcjs/usePagination.js","webpack://Reactable/./srcjs/aggregators.js","webpack://Reactable/./srcjs/columns.js","webpack://Reactable/./srcjs/Reactable.js","webpack://Reactable/./srcjs/useMeta.js","webpack://Reactable/./srcjs/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","var __WEBPACK_NAMESPACE_OBJECT__ = window.React;","var __WEBPACK_NAMESPACE_OBJECT__ = window.ReactDOM;","/*\n * Adapted from reactR 0.4.4 (https://github.com/react-R/reactR/blob/v0.4.4/srcjs/widget.js)\n * Copyright 2018 Kent Russell\n * Licensed under MIT (https://github.com/react-R/reactR/blob/v0.4.4/LICENSE)\n */\n\nimport React from 'react'\nimport ReactDOM from 'react-dom'\n\n// Modified reactWidget() that additionally supports hydration of server-rendered markup.\nexport function reactWidget(name, type, components) {\n window.HTMLWidgets.widget({\n name: name,\n type: type,\n factory: function (el) {\n return {\n renderValue(value) {\n if (el.hasAttribute('data-react-ssr')) {\n ReactDOM.hydrate(hydrate(components, value.tag), el)\n } else {\n ReactDOM.render(hydrate(components, value.tag), el)\n }\n },\n resize() {\n // resize() is required, but unused\n }\n }\n }\n })\n}\n\n// Must be bundled because react-tools.js needs to be run in a browser context\n// and can't be sourced at runtime in V8.\nexport function hydrate(components, tag) {\n if (typeof tag === 'string') return tag\n if (tag.name[0] === tag.name[0].toUpperCase() && !components[tag.name]) {\n throw new Error('Unknown component: ' + tag.name)\n }\n const elem = components[tag.name] || tag.name\n const args = [elem, tag.attribs]\n for (let child of tag.children) {\n args.push(hydrate(components, child))\n }\n return React.createElement(...args)\n}\n","import React from 'react'\n\nlet renderErr = 'Renderer Error ☝️'\n\nexport const actions = {\n init: 'init',\n}\n\nexport const defaultRenderer = ({ value = '' }) => value;\nexport const emptyRenderer = () => <> ;\n\nexport const defaultColumn = {\n Cell: defaultRenderer,\n width: 150,\n minWidth: 0,\n maxWidth: Number.MAX_SAFE_INTEGER,\n}\n\nfunction mergeProps(...propList) {\n return propList.reduce((props, next) => {\n const { style, className, ...rest } = next\n\n props = {\n ...props,\n ...rest,\n }\n\n if (style) {\n props.style = props.style\n ? { ...(props.style || {}), ...(style || {}) }\n : style\n }\n\n if (className) {\n props.className = props.className\n ? props.className + ' ' + className\n : className\n }\n\n if (props.className === '') {\n delete props.className\n }\n\n return props\n }, {})\n}\n\nfunction handlePropGetter(prevProps, userProps, meta) {\n // Handle a lambda, pass it the previous props\n if (typeof userProps === 'function') {\n return handlePropGetter({}, userProps(prevProps, meta))\n }\n\n // Handle an array, merge each item as separate props\n if (Array.isArray(userProps)) {\n return mergeProps(prevProps, ...userProps)\n }\n\n // Handle an object by default, merge the two objects\n return mergeProps(prevProps, userProps)\n}\n\nexport const makePropGetter = (hooks, meta = {}) => {\n return (userProps = {}) =>\n [...hooks, userProps].reduce(\n (prev, next) =>\n handlePropGetter(prev, next, {\n ...meta,\n userProps,\n }),\n {}\n )\n}\n\nexport const reduceHooks = (hooks, initial, meta = {}, allowUndefined) =>\n hooks.reduce((prev, next) => {\n const nextValue = next(prev, meta)\n if (process.env.NODE_ENV !== 'production') {\n if (!allowUndefined && typeof nextValue === 'undefined') {\n console.info(next)\n throw new Error(\n 'React Table: A reducer hook ☝️ just returned undefined! This is not allowed.'\n )\n }\n }\n return nextValue\n }, initial)\n\nexport const loopHooks = (hooks, context, meta = {}) =>\n hooks.forEach(hook => {\n const nextValue = hook(context, meta)\n if (process.env.NODE_ENV !== 'production') {\n if (typeof nextValue !== 'undefined') {\n console.info(hook, nextValue)\n throw new Error(\n 'React Table: A loop-type hook ☝️ just returned a value! This is not allowed.'\n )\n }\n }\n })\n\nexport function ensurePluginOrder(plugins, befores, pluginName, afters) {\n if (process.env.NODE_ENV !== 'production' && afters) {\n throw new Error(\n `Defining plugins in the \"after\" section of ensurePluginOrder is no longer supported (see plugin ${pluginName})`\n )\n }\n const pluginIndex = plugins.findIndex(\n plugin => plugin.pluginName === pluginName\n )\n\n if (pluginIndex === -1) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(`The plugin \"${pluginName}\" was not found in the plugin list!\nThis usually means you need to need to name your plugin hook by setting the 'pluginName' property of the hook function, eg:\n\n ${pluginName}.pluginName = '${pluginName}'\n`)\n }\n }\n\n befores.forEach(before => {\n const beforeIndex = plugins.findIndex(\n plugin => plugin.pluginName === before\n )\n if (beforeIndex > -1 && beforeIndex > pluginIndex) {\n if (process.env.NODE_ENV !== 'production') {\n throw new Error(\n `React Table: The ${pluginName} plugin hook must be placed after the ${before} plugin hook!`\n )\n }\n }\n })\n}\n\nexport function functionalUpdate(updater, old) {\n return typeof updater === 'function' ? updater(old) : updater\n}\n\nexport function useGetLatest(obj) {\n const ref = React.useRef()\n ref.current = obj\n\n return React.useCallback(() => ref.current, [])\n}\n\n// SSR has issues with useLayoutEffect still, so use useEffect during SSR\nexport const safeUseLayoutEffect =\n typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\nexport function useMountedLayoutEffect(fn, deps) {\n const mountedRef = React.useRef(false)\n\n safeUseLayoutEffect(() => {\n if (mountedRef.current) {\n fn()\n }\n mountedRef.current = true\n // eslint-disable-next-line\n }, deps)\n}\n\nexport function useAsyncDebounce(defaultFn, defaultWait = 0) {\n const debounceRef = React.useRef({})\n\n const getDefaultFn = useGetLatest(defaultFn)\n const getDefaultWait = useGetLatest(defaultWait)\n\n return React.useCallback(\n async (...args) => {\n if (!debounceRef.current.promise) {\n debounceRef.current.promise = new Promise((resolve, reject) => {\n debounceRef.current.resolve = resolve\n debounceRef.current.reject = reject\n })\n }\n\n if (debounceRef.current.timeout) {\n clearTimeout(debounceRef.current.timeout)\n }\n\n debounceRef.current.timeout = setTimeout(async () => {\n delete debounceRef.current.timeout\n try {\n debounceRef.current.resolve(await getDefaultFn()(...args))\n } catch (err) {\n debounceRef.current.reject(err)\n } finally {\n delete debounceRef.current.promise\n }\n }, getDefaultWait())\n\n return debounceRef.current.promise\n },\n [getDefaultFn, getDefaultWait]\n )\n}\n\nexport function makeRenderer(instance, column, meta = {}) {\n return (type, userProps = {}) => {\n const Comp = typeof type === 'string' ? column[type] : type\n\n if (typeof Comp === 'undefined') {\n console.info(column)\n throw new Error(renderErr)\n }\n\n return flexRender(Comp, { ...instance, column, ...meta, ...userProps })\n }\n}\n\nexport function flexRender(Comp, props) {\n return isReactComponent(Comp) ? : Comp\n}\n\nfunction isReactComponent(component) {\n return (\n isClassComponent(component) ||\n typeof component === 'function' ||\n isExoticComponent(component)\n )\n}\n\nfunction isClassComponent(component) {\n return (\n typeof component === 'function' &&\n (() => {\n const proto = Object.getPrototypeOf(component)\n return proto.prototype && proto.prototype.isReactComponent\n })()\n )\n}\n\nfunction isExoticComponent(component) {\n return (\n typeof component === 'object' &&\n typeof component.$$typeof === 'symbol' &&\n ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description)\n )\n}\n","import { defaultColumn, emptyRenderer } from './publicUtils'\n\n// Find the depth of the columns\nexport function findMaxDepth(columns, depth = 0) {\n return columns.reduce((prev, curr) => {\n if (curr.columns) {\n return Math.max(prev, findMaxDepth(curr.columns, depth + 1))\n }\n return depth\n }, 0)\n}\n\n// Build the visible columns, headers and flat column list\nexport function linkColumnStructure(columns, parent, depth = 0) {\n return columns.map(column => {\n column = {\n ...column,\n parent,\n depth,\n }\n\n assignColumnAccessor(column)\n\n if (column.columns) {\n column.columns = linkColumnStructure(column.columns, column, depth + 1)\n }\n return column\n })\n}\n\nexport function flattenColumns(columns) {\n return flattenBy(columns, 'columns')\n}\n\nexport function assignColumnAccessor(column) {\n // First check for string accessor\n let { id, accessor, Header } = column\n\n if (typeof accessor === 'string') {\n id = id || accessor\n const accessorPath = accessor.split('.')\n accessor = row => getBy(row, accessorPath)\n }\n\n if (!id && typeof Header === 'string' && Header) {\n id = Header\n }\n\n if (!id && column.columns) {\n console.error(column)\n throw new Error('A column ID (or unique \"Header\" value) is required!')\n }\n\n if (!id) {\n console.error(column)\n throw new Error('A column ID (or string accessor) is required!')\n }\n\n Object.assign(column, {\n id,\n accessor,\n })\n\n return column\n}\n\nexport function decorateColumn(column, userDefaultColumn) {\n if (!userDefaultColumn) {\n throw new Error()\n }\n Object.assign(column, {\n // Make sure there is a fallback header, just in case\n Header: emptyRenderer,\n Footer: emptyRenderer,\n ...defaultColumn,\n ...userDefaultColumn,\n ...column,\n })\n\n Object.assign(column, {\n originalWidth: column.width,\n })\n\n return column\n}\n\n// Build the header groups from the bottom up\nexport function makeHeaderGroups(\n allColumns,\n defaultColumn,\n additionalHeaderProperties = () => ({})\n) {\n const headerGroups = []\n\n let scanColumns = allColumns\n\n let uid = 0\n const getUID = () => uid++\n\n while (scanColumns.length) {\n // The header group we are creating\n const headerGroup = {\n headers: [],\n }\n\n // The parent columns we're going to scan next\n const parentColumns = []\n\n const hasParents = scanColumns.some(d => d.parent)\n\n // Scan each column for parents\n scanColumns.forEach(column => {\n // What is the latest (last) parent column?\n let latestParentColumn = [...parentColumns].reverse()[0]\n\n let newParent\n\n if (hasParents) {\n // If the column has a parent, add it if necessary\n if (column.parent) {\n newParent = {\n ...column.parent,\n originalId: column.parent.id,\n id: `${column.parent.id}_${getUID()}`,\n headers: [column],\n ...additionalHeaderProperties(column),\n }\n } else {\n // If other columns have parents, we'll need to add a place holder if necessary\n const originalId = `${column.id}_placeholder`\n newParent = decorateColumn(\n {\n originalId,\n id: `${column.id}_placeholder_${getUID()}`,\n placeholderOf: column,\n headers: [column],\n ...additionalHeaderProperties(column),\n },\n defaultColumn\n )\n }\n\n // If the resulting parent columns are the same, just add\n // the column and increment the header span\n if (\n latestParentColumn &&\n latestParentColumn.originalId === newParent.originalId\n ) {\n latestParentColumn.headers.push(column)\n } else {\n parentColumns.push(newParent)\n }\n }\n\n headerGroup.headers.push(column)\n })\n\n headerGroups.push(headerGroup)\n\n // Start scanning the parent columns\n scanColumns = parentColumns\n }\n\n return headerGroups.reverse()\n}\n\nconst pathObjCache = new Map()\n\nexport function getBy(obj, path, def) {\n if (!path) {\n return obj\n }\n const cacheKey = typeof path === 'function' ? path : JSON.stringify(path)\n\n const pathObj =\n pathObjCache.get(cacheKey) ||\n (() => {\n const pathObj = makePathArray(path)\n pathObjCache.set(cacheKey, pathObj)\n return pathObj\n })()\n\n let val\n\n try {\n val = pathObj.reduce((cursor, pathPart) => cursor[pathPart], obj)\n } catch (e) {\n // continue regardless of error\n }\n return typeof val !== 'undefined' ? val : def\n}\n\nexport function getFirstDefined(...args) {\n for (let i = 0; i < args.length; i += 1) {\n if (typeof args[i] !== 'undefined') {\n return args[i]\n }\n }\n}\n\nexport function getElementDimensions(element) {\n const rect = element.getBoundingClientRect()\n const style = window.getComputedStyle(element)\n const margins = {\n left: parseInt(style.marginLeft),\n right: parseInt(style.marginRight),\n }\n const padding = {\n left: parseInt(style.paddingLeft),\n right: parseInt(style.paddingRight),\n }\n return {\n left: Math.ceil(rect.left),\n width: Math.ceil(rect.width),\n outerWidth: Math.ceil(\n rect.width + margins.left + margins.right + padding.left + padding.right\n ),\n marginLeft: margins.left,\n marginRight: margins.right,\n paddingLeft: padding.left,\n paddingRight: padding.right,\n scrollWidth: element.scrollWidth,\n }\n}\n\nexport function isFunction(a) {\n if (typeof a === 'function') {\n return a\n }\n}\n\nexport function flattenBy(arr, key) {\n const flat = []\n\n const recurse = arr => {\n arr.forEach(d => {\n if (!d[key]) {\n flat.push(d)\n } else {\n recurse(d[key])\n }\n })\n }\n\n recurse(arr)\n\n return flat\n}\n\nexport function expandRows(\n rows,\n { manualExpandedKey, expanded, expandSubRows = true }\n) {\n const expandedRows = []\n\n const handleRow = (row, addToExpandedRows = true) => {\n row.isExpanded =\n (row.original && row.original[manualExpandedKey]) || expanded[row.id]\n\n row.canExpand = row.subRows && !!row.subRows.length\n\n if (addToExpandedRows) {\n expandedRows.push(row)\n }\n\n if (row.subRows && row.subRows.length && row.isExpanded) {\n row.subRows.forEach(row => handleRow(row, expandSubRows))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return expandedRows\n}\n\nexport function getFilterMethod(filter, userFilterTypes, filterTypes) {\n return (\n isFunction(filter) ||\n userFilterTypes[filter] ||\n filterTypes[filter] ||\n filterTypes.text\n )\n}\n\nexport function shouldAutoRemoveFilter(autoRemove, value, column) {\n return autoRemove ? autoRemove(value, column) : typeof value === 'undefined'\n}\n\nexport function unpreparedAccessWarning() {\n throw new Error(\n 'React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.'\n )\n}\n\nlet passiveSupported = null\nexport function passiveEventSupported() {\n // memoize support to avoid adding multiple test events\n if (typeof passiveSupported === 'boolean') return passiveSupported\n\n let supported = false\n try {\n const options = {\n get passive() {\n supported = true\n return false\n },\n }\n\n window.addEventListener('test', null, options)\n window.removeEventListener('test', null, options)\n } catch (err) {\n supported = false\n }\n passiveSupported = supported\n return passiveSupported\n}\n\n//\n\nconst reOpenBracket = /\\[/g\nconst reCloseBracket = /\\]/g\n\nfunction makePathArray(obj) {\n return (\n flattenDeep(obj)\n // remove all periods in parts\n .map(d => String(d).replace('.', '_'))\n // join parts using period\n .join('.')\n // replace brackets with periods\n .replace(reOpenBracket, '.')\n .replace(reCloseBracket, '')\n // split it back out on periods\n .split('.')\n )\n}\n\nfunction flattenDeep(arr, newArr = []) {\n if (!Array.isArray(arr)) {\n newArr.push(arr)\n } else {\n for (let i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], newArr)\n }\n }\n return newArr\n}\n","const defaultGetTableProps = props => ({\n role: 'table',\n ...props,\n})\n\nconst defaultGetTableBodyProps = props => ({\n role: 'rowgroup',\n ...props,\n})\n\nconst defaultGetHeaderProps = (props, { column }) => ({\n key: `header_${column.id}`,\n colSpan: column.totalVisibleHeaderCount,\n role: 'columnheader',\n ...props,\n})\n\nconst defaultGetFooterProps = (props, { column }) => ({\n key: `footer_${column.id}`,\n colSpan: column.totalVisibleHeaderCount,\n ...props,\n})\n\nconst defaultGetHeaderGroupProps = (props, { index }) => ({\n key: `headerGroup_${index}`,\n role: 'row',\n ...props,\n})\n\nconst defaultGetFooterGroupProps = (props, { index }) => ({\n key: `footerGroup_${index}`,\n ...props,\n})\n\nconst defaultGetRowProps = (props, { row }) => ({\n key: `row_${row.id}`,\n role: 'row',\n ...props,\n})\n\nconst defaultGetCellProps = (props, { cell }) => ({\n key: `cell_${cell.row.id}_${cell.column.id}`,\n role: 'cell',\n ...props,\n})\n\nexport default function makeDefaultPluginHooks() {\n return {\n useOptions: [],\n stateReducers: [],\n useControlledState: [],\n columns: [],\n columnsDeps: [],\n allColumns: [],\n allColumnsDeps: [],\n accessValue: [],\n materializedColumns: [],\n materializedColumnsDeps: [],\n useInstanceAfterData: [],\n visibleColumns: [],\n visibleColumnsDeps: [],\n headerGroups: [],\n headerGroupsDeps: [],\n useInstanceBeforeDimensions: [],\n useInstance: [],\n prepareRow: [],\n getTableProps: [defaultGetTableProps],\n getTableBodyProps: [defaultGetTableBodyProps],\n getHeaderGroupProps: [defaultGetHeaderGroupProps],\n getFooterGroupProps: [defaultGetFooterGroupProps],\n getHeaderProps: [defaultGetHeaderProps],\n getFooterProps: [defaultGetFooterProps],\n getRowProps: [defaultGetRowProps],\n getCellProps: [defaultGetCellProps],\n useFinalInstance: [],\n }\n}\n","import React from 'react'\n\nimport {\n actions,\n functionalUpdate,\n useGetLatest,\n makePropGetter,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nactions.resetHiddenColumns = 'resetHiddenColumns'\nactions.toggleHideColumn = 'toggleHideColumn'\nactions.setHiddenColumns = 'setHiddenColumns'\nactions.toggleHideAllColumns = 'toggleHideAllColumns'\n\nexport const useColumnVisibility = hooks => {\n hooks.getToggleHiddenProps = [defaultGetToggleHiddenProps]\n hooks.getToggleHideAllColumnsProps = [defaultGetToggleHideAllColumnsProps]\n\n hooks.stateReducers.push(reducer)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n hooks.headerGroupsDeps.push((deps, { instance }) => [\n ...deps,\n instance.state.hiddenColumns,\n ])\n hooks.useInstance.push(useInstance)\n}\n\nuseColumnVisibility.pluginName = 'useColumnVisibility'\n\nconst defaultGetToggleHiddenProps = (props, { column }) => [\n props,\n {\n onChange: e => {\n column.toggleHidden(!e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: column.isVisible,\n title: 'Toggle Column Visible',\n },\n]\n\nconst defaultGetToggleHideAllColumnsProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleHideAllColumns(!e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: !instance.allColumnsHidden && !instance.state.hiddenColumns.length,\n title: 'Toggle All Columns Hidden',\n indeterminate:\n !instance.allColumnsHidden && instance.state.hiddenColumns.length,\n },\n]\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n hiddenColumns: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetHiddenColumns) {\n return {\n ...state,\n hiddenColumns: instance.initialState.hiddenColumns || [],\n }\n }\n\n if (action.type === actions.toggleHideColumn) {\n const should =\n typeof action.value !== 'undefined'\n ? action.value\n : !state.hiddenColumns.includes(action.columnId)\n\n const hiddenColumns = should\n ? [...state.hiddenColumns, action.columnId]\n : state.hiddenColumns.filter(d => d !== action.columnId)\n\n return {\n ...state,\n hiddenColumns,\n }\n }\n\n if (action.type === actions.setHiddenColumns) {\n return {\n ...state,\n hiddenColumns: functionalUpdate(action.value, state.hiddenColumns),\n }\n }\n\n if (action.type === actions.toggleHideAllColumns) {\n const shouldAll =\n typeof action.value !== 'undefined'\n ? action.value\n : !state.hiddenColumns.length\n\n return {\n ...state,\n hiddenColumns: shouldAll ? instance.allColumns.map(d => d.id) : [],\n }\n }\n}\n\nfunction useInstanceBeforeDimensions(instance) {\n const {\n headers,\n state: { hiddenColumns },\n } = instance\n\n const isMountedRef = React.useRef(false)\n\n if (!isMountedRef.current) {\n }\n\n const handleColumn = (column, parentVisible) => {\n column.isVisible = parentVisible && !hiddenColumns.includes(column.id)\n\n let totalVisibleHeaderCount = 0\n\n if (column.headers && column.headers.length) {\n column.headers.forEach(\n subColumn =>\n (totalVisibleHeaderCount += handleColumn(subColumn, column.isVisible))\n )\n } else {\n totalVisibleHeaderCount = column.isVisible ? 1 : 0\n }\n\n column.totalVisibleHeaderCount = totalVisibleHeaderCount\n\n return totalVisibleHeaderCount\n }\n\n let totalVisibleHeaderCount = 0\n\n headers.forEach(\n subHeader => (totalVisibleHeaderCount += handleColumn(subHeader, true))\n )\n}\n\nfunction useInstance(instance) {\n const {\n columns,\n flatHeaders,\n dispatch,\n allColumns,\n getHooks,\n state: { hiddenColumns },\n autoResetHiddenColumns = true,\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n const allColumnsHidden = allColumns.length === hiddenColumns.length\n\n const toggleHideColumn = React.useCallback(\n (columnId, value) =>\n dispatch({ type: actions.toggleHideColumn, columnId, value }),\n [dispatch]\n )\n\n const setHiddenColumns = React.useCallback(\n value => dispatch({ type: actions.setHiddenColumns, value }),\n [dispatch]\n )\n\n const toggleHideAllColumns = React.useCallback(\n value => dispatch({ type: actions.toggleHideAllColumns, value }),\n [dispatch]\n )\n\n const getToggleHideAllColumnsProps = makePropGetter(\n getHooks().getToggleHideAllColumnsProps,\n { instance: getInstance() }\n )\n\n flatHeaders.forEach(column => {\n column.toggleHidden = value => {\n dispatch({\n type: actions.toggleHideColumn,\n columnId: column.id,\n value,\n })\n }\n\n column.getToggleHiddenProps = makePropGetter(\n getHooks().getToggleHiddenProps,\n {\n instance: getInstance(),\n column,\n }\n )\n })\n\n const getAutoResetHiddenColumns = useGetLatest(autoResetHiddenColumns)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetHiddenColumns()) {\n dispatch({ type: actions.resetHiddenColumns })\n }\n }, [dispatch, columns])\n\n Object.assign(instance, {\n allColumnsHidden,\n toggleHideColumn,\n setHiddenColumns,\n toggleHideAllColumns,\n getToggleHideAllColumnsProps,\n })\n}\n","import React from 'react'\n\n//\n\nimport {\n linkColumnStructure,\n flattenColumns,\n assignColumnAccessor,\n unpreparedAccessWarning,\n makeHeaderGroups,\n decorateColumn,\n} from '../utils'\n\nimport {\n useGetLatest,\n reduceHooks,\n actions,\n loopHooks,\n makePropGetter,\n makeRenderer,\n} from '../publicUtils'\n\nimport makeDefaultPluginHooks from '../makeDefaultPluginHooks'\n\nimport { useColumnVisibility } from './useColumnVisibility'\n\nconst defaultInitialState = {}\nconst defaultColumnInstance = {}\nconst defaultReducer = (state, action, prevState) => state\nconst defaultGetSubRows = (row, index) => row.subRows || []\nconst defaultGetRowId = (row, index, parent) =>\n `${parent ? [parent.id, index].join('.') : index}`\nconst defaultUseControlledState = d => d\n\nfunction applyDefaults(props) {\n const {\n initialState = defaultInitialState,\n defaultColumn = defaultColumnInstance,\n getSubRows = defaultGetSubRows,\n getRowId = defaultGetRowId,\n stateReducer = defaultReducer,\n useControlledState = defaultUseControlledState,\n ...rest\n } = props\n\n return {\n ...rest,\n initialState,\n defaultColumn,\n getSubRows,\n getRowId,\n stateReducer,\n useControlledState,\n }\n}\n\nexport const useTable = (props, ...plugins) => {\n // Apply default props\n props = applyDefaults(props)\n\n // Add core plugins\n plugins = [useColumnVisibility, ...plugins]\n\n // Create the table instance\n let instanceRef = React.useRef({})\n\n // Create a getter for the instance (helps avoid a lot of potential memory leaks)\n const getInstance = useGetLatest(instanceRef.current)\n\n // Assign the props, plugins and hooks to the instance\n Object.assign(getInstance(), {\n ...props,\n plugins,\n hooks: makeDefaultPluginHooks(),\n })\n\n // Allow plugins to register hooks as early as possible\n plugins.filter(Boolean).forEach(plugin => {\n plugin(getInstance().hooks)\n })\n\n // Consume all hooks and make a getter for them\n const getHooks = useGetLatest(getInstance().hooks)\n getInstance().getHooks = getHooks\n delete getInstance().hooks\n\n // Allow useOptions hooks to modify the options coming into the table\n Object.assign(\n getInstance(),\n reduceHooks(getHooks().useOptions, applyDefaults(props))\n )\n\n const {\n data,\n columns: userColumns,\n initialState,\n defaultColumn,\n getSubRows,\n getRowId,\n stateReducer,\n useControlledState,\n } = getInstance()\n\n // Setup user reducer ref\n const getStateReducer = useGetLatest(stateReducer)\n\n // Build the reducer\n const reducer = React.useCallback(\n (state, action) => {\n // Detect invalid actions\n if (!action.type) {\n console.info({ action })\n throw new Error('Unknown Action 👆')\n }\n\n // Reduce the state from all plugin reducers\n return [\n ...getHooks().stateReducers,\n // Allow the user to add their own state reducer(s)\n ...(Array.isArray(getStateReducer())\n ? getStateReducer()\n : [getStateReducer()]),\n ].reduce(\n (s, handler) => handler(s, action, state, getInstance()) || s,\n state\n )\n },\n [getHooks, getStateReducer, getInstance]\n )\n\n // Start the reducer\n const [reducerState, dispatch] = React.useReducer(reducer, undefined, () =>\n reducer(initialState, { type: actions.init })\n )\n\n // Allow the user to control the final state with hooks\n const state = reduceHooks(\n [...getHooks().useControlledState, useControlledState],\n reducerState,\n { instance: getInstance() }\n )\n\n Object.assign(getInstance(), {\n state,\n dispatch,\n })\n\n // Decorate All the columns\n const columns = React.useMemo(\n () =>\n linkColumnStructure(\n reduceHooks(getHooks().columns, userColumns, {\n instance: getInstance(),\n })\n ),\n [\n getHooks,\n getInstance,\n userColumns,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().columnsDeps, [], { instance: getInstance() }),\n ]\n )\n getInstance().columns = columns\n\n // Get the flat list of all columns and allow hooks to decorate\n // those columns (and trigger this memoization via deps)\n let allColumns = React.useMemo(\n () =>\n reduceHooks(getHooks().allColumns, flattenColumns(columns), {\n instance: getInstance(),\n }).map(assignColumnAccessor),\n [\n columns,\n getHooks,\n getInstance,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().allColumnsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n getInstance().allColumns = allColumns\n\n // Access the row model using initial columns\n const [rows, flatRows, rowsById] = React.useMemo(() => {\n let rows = []\n let flatRows = []\n const rowsById = {}\n\n const allColumnsQueue = [...allColumns]\n\n while (allColumnsQueue.length) {\n const column = allColumnsQueue.shift()\n accessRowsForColumn({\n data,\n rows,\n flatRows,\n rowsById,\n column,\n getRowId,\n getSubRows,\n accessValueHooks: getHooks().accessValue,\n getInstance,\n })\n }\n\n return [rows, flatRows, rowsById]\n }, [allColumns, data, getRowId, getSubRows, getHooks, getInstance])\n\n Object.assign(getInstance(), {\n rows,\n initialRows: [...rows],\n flatRows,\n rowsById,\n // materializedColumns,\n })\n\n loopHooks(getHooks().useInstanceAfterData, getInstance())\n\n // Get the flat list of all columns AFTER the rows\n // have been access, and allow hooks to decorate\n // those columns (and trigger this memoization via deps)\n let visibleColumns = React.useMemo(\n () =>\n reduceHooks(getHooks().visibleColumns, allColumns, {\n instance: getInstance(),\n }).map(d => decorateColumn(d, defaultColumn)),\n [\n getHooks,\n allColumns,\n getInstance,\n defaultColumn,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().visibleColumnsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n\n // Combine new visible columns with all columns\n allColumns = React.useMemo(() => {\n const columns = [...visibleColumns]\n\n allColumns.forEach(column => {\n if (!columns.find(d => d.id === column.id)) {\n columns.push(column)\n }\n })\n\n return columns\n }, [allColumns, visibleColumns])\n getInstance().allColumns = allColumns\n\n if (process.env.NODE_ENV !== 'production') {\n const duplicateColumns = allColumns.filter((column, i) => {\n return allColumns.findIndex(d => d.id === column.id) !== i\n })\n\n if (duplicateColumns.length) {\n console.info(allColumns)\n throw new Error(\n `Duplicate columns were found with ids: \"${duplicateColumns\n .map(d => d.id)\n .join(', ')}\" in the columns array above`\n )\n }\n }\n\n // Make the headerGroups\n const headerGroups = React.useMemo(\n () =>\n reduceHooks(\n getHooks().headerGroups,\n makeHeaderGroups(visibleColumns, defaultColumn),\n getInstance()\n ),\n [\n getHooks,\n visibleColumns,\n defaultColumn,\n getInstance,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n ...reduceHooks(getHooks().headerGroupsDeps, [], {\n instance: getInstance(),\n }),\n ]\n )\n getInstance().headerGroups = headerGroups\n\n // Get the first level of headers\n const headers = React.useMemo(\n () => (headerGroups.length ? headerGroups[0].headers : []),\n [headerGroups]\n )\n getInstance().headers = headers\n\n // Provide a flat header list for utilities\n getInstance().flatHeaders = headerGroups.reduce(\n (all, headerGroup) => [...all, ...headerGroup.headers],\n []\n )\n\n loopHooks(getHooks().useInstanceBeforeDimensions, getInstance())\n\n // Filter columns down to visible ones\n const visibleColumnsDep = visibleColumns\n .filter(d => d.isVisible)\n .map(d => d.id)\n .sort()\n .join('_')\n\n visibleColumns = React.useMemo(\n () => visibleColumns.filter(d => d.isVisible),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [visibleColumns, visibleColumnsDep]\n )\n getInstance().visibleColumns = visibleColumns\n\n // Header Visibility is needed by this point\n const [\n totalColumnsMinWidth,\n totalColumnsWidth,\n totalColumnsMaxWidth,\n ] = calculateHeaderWidths(headers)\n\n getInstance().totalColumnsMinWidth = totalColumnsMinWidth\n getInstance().totalColumnsWidth = totalColumnsWidth\n getInstance().totalColumnsMaxWidth = totalColumnsMaxWidth\n\n loopHooks(getHooks().useInstance, getInstance())\n\n // Each materialized header needs to be assigned a render function and other\n // prop getter properties here.\n ;[...getInstance().flatHeaders, ...getInstance().allColumns].forEach(\n column => {\n // Give columns/headers rendering power\n column.render = makeRenderer(getInstance(), column)\n\n // Give columns/headers a default getHeaderProps\n column.getHeaderProps = makePropGetter(getHooks().getHeaderProps, {\n instance: getInstance(),\n column,\n })\n\n // Give columns/headers a default getFooterProps\n column.getFooterProps = makePropGetter(getHooks().getFooterProps, {\n instance: getInstance(),\n column,\n })\n }\n )\n\n getInstance().headerGroups = React.useMemo(\n () =>\n headerGroups.filter((headerGroup, i) => {\n // Filter out any headers and headerGroups that don't have visible columns\n headerGroup.headers = headerGroup.headers.filter(column => {\n const recurse = headers =>\n headers.filter(column => {\n if (column.headers) {\n return recurse(column.headers)\n }\n return column.isVisible\n }).length\n if (column.headers) {\n return recurse(column.headers)\n }\n return column.isVisible\n })\n\n // Give headerGroups getRowProps\n if (headerGroup.headers.length) {\n headerGroup.getHeaderGroupProps = makePropGetter(\n getHooks().getHeaderGroupProps,\n { instance: getInstance(), headerGroup, index: i }\n )\n\n headerGroup.getFooterGroupProps = makePropGetter(\n getHooks().getFooterGroupProps,\n { instance: getInstance(), headerGroup, index: i }\n )\n\n return true\n }\n\n return false\n }),\n [headerGroups, getInstance, getHooks]\n )\n\n getInstance().footerGroups = [...getInstance().headerGroups].reverse()\n\n // The prepareRow function is absolutely necessary and MUST be called on\n // any rows the user wishes to be displayed.\n\n getInstance().prepareRow = React.useCallback(\n row => {\n row.getRowProps = makePropGetter(getHooks().getRowProps, {\n instance: getInstance(),\n row,\n })\n\n // Build the visible cells for each row\n row.allCells = allColumns.map(column => {\n const value = row.values[column.id]\n\n const cell = {\n column,\n row,\n value,\n }\n\n // Give each cell a getCellProps base\n cell.getCellProps = makePropGetter(getHooks().getCellProps, {\n instance: getInstance(),\n cell,\n })\n\n // Give each cell a renderer function (supports multiple renderers)\n cell.render = makeRenderer(getInstance(), column, {\n row,\n cell,\n value,\n })\n\n return cell\n })\n\n row.cells = visibleColumns.map(column =>\n row.allCells.find(cell => cell.column.id === column.id)\n )\n\n // need to apply any row specific hooks (useExpanded requires this)\n loopHooks(getHooks().prepareRow, row, { instance: getInstance() })\n },\n [getHooks, getInstance, allColumns, visibleColumns]\n )\n\n getInstance().getTableProps = makePropGetter(getHooks().getTableProps, {\n instance: getInstance(),\n })\n\n getInstance().getTableBodyProps = makePropGetter(\n getHooks().getTableBodyProps,\n {\n instance: getInstance(),\n }\n )\n\n loopHooks(getHooks().useFinalInstance, getInstance())\n\n return getInstance()\n}\n\nfunction calculateHeaderWidths(headers, left = 0) {\n let sumTotalMinWidth = 0\n let sumTotalWidth = 0\n let sumTotalMaxWidth = 0\n let sumTotalFlexWidth = 0\n\n headers.forEach(header => {\n let { headers: subHeaders } = header\n\n header.totalLeft = left\n\n if (subHeaders && subHeaders.length) {\n const [\n totalMinWidth,\n totalWidth,\n totalMaxWidth,\n totalFlexWidth,\n ] = calculateHeaderWidths(subHeaders, left)\n header.totalMinWidth = totalMinWidth\n header.totalWidth = totalWidth\n header.totalMaxWidth = totalMaxWidth\n header.totalFlexWidth = totalFlexWidth\n } else {\n header.totalMinWidth = header.minWidth\n header.totalWidth = Math.min(\n Math.max(header.minWidth, header.width),\n header.maxWidth\n )\n header.totalMaxWidth = header.maxWidth\n header.totalFlexWidth = header.canResize ? header.totalWidth : 0\n }\n if (header.isVisible) {\n left += header.totalWidth\n sumTotalMinWidth += header.totalMinWidth\n sumTotalWidth += header.totalWidth\n sumTotalMaxWidth += header.totalMaxWidth\n sumTotalFlexWidth += header.totalFlexWidth\n }\n })\n\n return [sumTotalMinWidth, sumTotalWidth, sumTotalMaxWidth, sumTotalFlexWidth]\n}\n\nfunction accessRowsForColumn({\n data,\n rows,\n flatRows,\n rowsById,\n column,\n getRowId,\n getSubRows,\n accessValueHooks,\n getInstance,\n}) {\n // Access the row's data column-by-column\n // We do it this way so we can incrementally add materialized\n // columns after the first pass and avoid excessive looping\n const accessRow = (originalRow, rowIndex, depth = 0, parent, parentRows) => {\n // Keep the original reference around\n const original = originalRow\n\n const id = getRowId(originalRow, rowIndex, parent)\n\n let row = rowsById[id]\n\n // If the row hasn't been created, let's make it\n if (!row) {\n row = {\n id,\n original,\n index: rowIndex,\n depth,\n cells: [{}], // This is a dummy cell\n }\n\n // Override common array functions (and the dummy cell's getCellProps function)\n // to show an error if it is accessed without calling prepareRow\n row.cells.map = unpreparedAccessWarning\n row.cells.filter = unpreparedAccessWarning\n row.cells.forEach = unpreparedAccessWarning\n row.cells[0].getCellProps = unpreparedAccessWarning\n\n // Create the cells and values\n row.values = {}\n\n // Push this row into the parentRows array\n parentRows.push(row)\n // Keep track of every row in a flat array\n flatRows.push(row)\n // Also keep track of every row by its ID\n rowsById[id] = row\n\n // Get the original subrows\n row.originalSubRows = getSubRows(originalRow, rowIndex)\n\n // Then recursively access them\n if (row.originalSubRows) {\n const subRows = []\n row.originalSubRows.forEach((d, i) =>\n accessRow(d, i, depth + 1, row, subRows)\n )\n // Keep the new subRows array on the row\n row.subRows = subRows\n }\n } else if (row.subRows) {\n // If the row exists, then it's already been accessed\n // Keep recursing, but don't worry about passing the\n // accumlator array (those rows already exist)\n row.originalSubRows.forEach((d, i) => accessRow(d, i, depth + 1, row))\n }\n\n // If the column has an accessor, use it to get a value\n if (column.accessor) {\n row.values[column.id] = column.accessor(\n originalRow,\n rowIndex,\n row,\n parentRows,\n data\n )\n }\n\n // Allow plugins to manipulate the column value\n row.values[column.id] = reduceHooks(\n accessValueHooks,\n row.values[column.id],\n {\n row,\n column,\n instance: getInstance(),\n },\n true\n )\n }\n\n data.forEach((originalRow, rowIndex) =>\n accessRow(originalRow, rowIndex, 0, undefined, rows)\n )\n}\n","import React from 'react'\n\nimport { expandRows } from '../utils'\n\nimport {\n useGetLatest,\n actions,\n useMountedLayoutEffect,\n makePropGetter,\n ensurePluginOrder,\n} from '../publicUtils'\n\n// Actions\nactions.resetExpanded = 'resetExpanded'\nactions.toggleRowExpanded = 'toggleRowExpanded'\nactions.toggleAllRowsExpanded = 'toggleAllRowsExpanded'\n\nexport const useExpanded = hooks => {\n hooks.getToggleAllRowsExpandedProps = [defaultGetToggleAllRowsExpandedProps]\n hooks.getToggleRowExpandedProps = [defaultGetToggleRowExpandedProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseExpanded.pluginName = 'useExpanded'\n\nconst defaultGetToggleAllRowsExpandedProps = (props, { instance }) => [\n props,\n {\n onClick: e => {\n instance.toggleAllRowsExpanded()\n },\n style: {\n cursor: 'pointer',\n },\n title: 'Toggle All Rows Expanded',\n },\n]\n\nconst defaultGetToggleRowExpandedProps = (props, { row }) => [\n props,\n {\n onClick: () => {\n row.toggleRowExpanded()\n },\n style: {\n cursor: 'pointer',\n },\n title: 'Toggle Row Expanded',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n expanded: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetExpanded) {\n return {\n ...state,\n expanded: instance.initialState.expanded || {},\n }\n }\n\n if (action.type === actions.toggleAllRowsExpanded) {\n const { value } = action\n const { rowsById } = instance\n\n const isAllRowsExpanded =\n Object.keys(rowsById).length === Object.keys(state.expanded).length\n\n const expandAll = typeof value !== 'undefined' ? value : !isAllRowsExpanded\n\n if (expandAll) {\n const expanded = {}\n\n Object.keys(rowsById).forEach(rowId => {\n expanded[rowId] = true\n })\n\n return {\n ...state,\n expanded,\n }\n }\n\n return {\n ...state,\n expanded: {},\n }\n }\n\n if (action.type === actions.toggleRowExpanded) {\n const { id, value: setExpanded } = action\n const exists = state.expanded[id]\n\n const shouldExist =\n typeof setExpanded !== 'undefined' ? setExpanded : !exists\n\n if (!exists && shouldExist) {\n return {\n ...state,\n expanded: {\n ...state.expanded,\n [id]: true,\n },\n }\n } else if (exists && !shouldExist) {\n const { [id]: _, ...rest } = state.expanded\n return {\n ...state,\n expanded: rest,\n }\n } else {\n return state\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n rowsById,\n manualExpandedKey = 'expanded',\n paginateExpandedRows = true,\n expandSubRows = true,\n autoResetExpanded = true,\n getHooks,\n plugins,\n state: { expanded },\n dispatch,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useSortBy', 'useGroupBy', 'usePivotColumns', 'useGlobalFilter'],\n 'useExpanded'\n )\n\n const getAutoResetExpanded = useGetLatest(autoResetExpanded)\n\n let isAllRowsExpanded = Boolean(\n Object.keys(rowsById).length && Object.keys(expanded).length\n )\n\n if (isAllRowsExpanded) {\n if (Object.keys(rowsById).some(id => !expanded[id])) {\n isAllRowsExpanded = false\n }\n }\n\n // Bypass any effects from firing when this changes\n useMountedLayoutEffect(() => {\n if (getAutoResetExpanded()) {\n dispatch({ type: actions.resetExpanded })\n }\n }, [dispatch, data])\n\n const toggleRowExpanded = React.useCallback(\n (id, value) => {\n dispatch({ type: actions.toggleRowExpanded, id, value })\n },\n [dispatch]\n )\n\n const toggleAllRowsExpanded = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsExpanded, value }),\n [dispatch]\n )\n\n const expandedRows = React.useMemo(() => {\n if (paginateExpandedRows) {\n return expandRows(rows, { manualExpandedKey, expanded, expandSubRows })\n }\n\n return rows\n }, [paginateExpandedRows, rows, manualExpandedKey, expanded, expandSubRows])\n\n const expandedDepth = React.useMemo(() => findExpandedDepth(expanded), [\n expanded,\n ])\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsExpandedProps = makePropGetter(\n getHooks().getToggleAllRowsExpandedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n preExpandedRows: rows,\n expandedRows,\n rows: expandedRows,\n expandedDepth,\n isAllRowsExpanded,\n toggleRowExpanded,\n toggleAllRowsExpanded,\n getToggleAllRowsExpandedProps,\n })\n}\n\nfunction prepareRow(row, { instance: { getHooks }, instance }) {\n row.toggleRowExpanded = set => instance.toggleRowExpanded(row.id, set)\n\n row.getToggleRowExpandedProps = makePropGetter(\n getHooks().getToggleRowExpandedProps,\n {\n instance,\n row,\n }\n )\n}\n\nfunction findExpandedDepth(expanded) {\n let maxDepth = 0\n\n Object.keys(expanded).forEach(id => {\n const splitId = id.split('.')\n maxDepth = Math.max(maxDepth, splitId.length)\n })\n\n return maxDepth\n}\n","export const text = (rows, ids, filterValue) => {\n rows = rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return String(rowValue)\n .toLowerCase()\n .includes(String(filterValue).toLowerCase())\n })\n })\n return rows\n}\n\ntext.autoRemove = val => !val\n\nexport const exactText = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue).toLowerCase() === String(filterValue).toLowerCase()\n : true\n })\n })\n}\n\nexactText.autoRemove = val => !val\n\nexport const exactTextCase = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue !== undefined\n ? String(rowValue) === String(filterValue)\n : true\n })\n })\n}\n\nexactTextCase.autoRemove = val => !val\n\nexport const includes = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue.includes(filterValue)\n })\n })\n}\n\nincludes.autoRemove = val => !val || !val.length\n\nexport const includesAll = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return (\n rowValue &&\n rowValue.length &&\n filterValue.every(val => rowValue.includes(val))\n )\n })\n })\n}\n\nincludesAll.autoRemove = val => !val || !val.length\n\nexport const includesSome = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return (\n rowValue &&\n rowValue.length &&\n filterValue.some(val => rowValue.includes(val))\n )\n })\n })\n}\n\nincludesSome.autoRemove = val => !val || !val.length\n\nexport const includesValue = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return filterValue.includes(rowValue)\n })\n })\n}\n\nincludesValue.autoRemove = val => !val || !val.length\n\nexport const exact = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue === filterValue\n })\n })\n}\n\nexact.autoRemove = val => typeof val === 'undefined'\n\nexport const equals = (rows, ids, filterValue) => {\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n // eslint-disable-next-line eqeqeq\n return rowValue == filterValue\n })\n })\n}\n\nequals.autoRemove = val => val == null\n\nexport const between = (rows, ids, filterValue) => {\n let [min, max] = filterValue || []\n\n min = typeof min === 'number' ? min : -Infinity\n max = typeof max === 'number' ? max : Infinity\n\n if (min > max) {\n const temp = min\n min = max\n max = temp\n }\n\n return rows.filter(row => {\n return ids.some(id => {\n const rowValue = row.values[id]\n return rowValue >= min && rowValue <= max\n })\n })\n}\n\nbetween.autoRemove = val =>\n !val || (typeof val[0] !== 'number' && typeof val[1] !== 'number')\n","import React from 'react'\n\nimport {\n getFirstDefined,\n getFilterMethod,\n shouldAutoRemoveFilter,\n} from '../utils'\n\nimport {\n actions,\n useGetLatest,\n functionalUpdate,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport * as filterTypes from '../filterTypes'\n\n// Actions\nactions.resetFilters = 'resetFilters'\nactions.setFilter = 'setFilter'\nactions.setAllFilters = 'setAllFilters'\n\nexport const useFilters = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseFilters.pluginName = 'useFilters'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n filters: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetFilters) {\n return {\n ...state,\n filters: instance.initialState.filters || [],\n }\n }\n\n if (action.type === actions.setFilter) {\n const { columnId, filterValue } = action\n const { allColumns, filterTypes: userFilterTypes } = instance\n\n const column = allColumns.find(d => d.id === columnId)\n\n if (!column) {\n throw new Error(\n `React-Table: Could not find a column with id: ${columnId}`\n )\n }\n\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n const previousfilter = state.filters.find(d => d.id === columnId)\n\n const newFilter = functionalUpdate(\n filterValue,\n previousfilter && previousfilter.value\n )\n\n //\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter, column)) {\n return {\n ...state,\n filters: state.filters.filter(d => d.id !== columnId),\n }\n }\n\n if (previousfilter) {\n return {\n ...state,\n filters: state.filters.map(d => {\n if (d.id === columnId) {\n return { id: columnId, value: newFilter }\n }\n return d\n }),\n }\n }\n\n return {\n ...state,\n filters: [...state.filters, { id: columnId, value: newFilter }],\n }\n }\n\n if (action.type === actions.setAllFilters) {\n const { filters } = action\n const { allColumns, filterTypes: userFilterTypes } = instance\n\n return {\n ...state,\n // Filter out undefined values\n filters: functionalUpdate(filters, state.filters).filter(filter => {\n const column = allColumns.find(d => d.id === filter.id)\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (\n shouldAutoRemoveFilter(filterMethod.autoRemove, filter.value, column)\n ) {\n return false\n }\n return true\n }),\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n filterTypes: userFilterTypes,\n manualFilters,\n defaultCanFilter = false,\n disableFilters,\n state: { filters },\n dispatch,\n autoResetFilters = true,\n } = instance\n\n const setFilter = React.useCallback(\n (columnId, filterValue) => {\n dispatch({ type: actions.setFilter, columnId, filterValue })\n },\n [dispatch]\n )\n\n const setAllFilters = React.useCallback(\n filters => {\n dispatch({\n type: actions.setAllFilters,\n filters,\n })\n },\n [dispatch]\n )\n\n allColumns.forEach(column => {\n const {\n id,\n accessor,\n defaultCanFilter: columnDefaultCanFilter,\n disableFilters: columnDisableFilters,\n } = column\n\n // Determine if a column is filterable\n column.canFilter = accessor\n ? getFirstDefined(\n columnDisableFilters === true ? false : undefined,\n disableFilters === true ? false : undefined,\n true\n )\n : getFirstDefined(columnDefaultCanFilter, defaultCanFilter, false)\n\n // Provide the column a way of updating the filter value\n column.setFilter = val => setFilter(column.id, val)\n\n // Provide the current filter value to the column for\n // convenience\n const found = filters.find(d => d.id === id)\n column.filterValue = found && found.value\n })\n\n const [\n filteredRows,\n filteredFlatRows,\n filteredRowsById,\n ] = React.useMemo(() => {\n if (manualFilters || !filters.length) {\n return [rows, flatRows, rowsById]\n }\n\n const filteredFlatRows = []\n const filteredRowsById = {}\n\n // Filters top level and nested rows\n const filterRows = (rows, depth = 0) => {\n let filteredRows = rows\n\n filteredRows = filters.reduce(\n (filteredSoFar, { id: columnId, value: filterValue }) => {\n // Find the filters column\n const column = allColumns.find(d => d.id === columnId)\n\n if (!column) {\n return filteredSoFar\n }\n\n if (depth === 0) {\n column.preFilteredRows = filteredSoFar\n }\n\n const filterMethod = getFilterMethod(\n column.filter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (!filterMethod) {\n console.warn(\n `Could not find a valid 'column.filter' for column with the ID: ${column.id}.`\n )\n return filteredSoFar\n }\n\n // Pass the rows, id, filterValue and column to the filterMethod\n // to get the filtered rows back\n column.filteredRows = filterMethod(\n filteredSoFar,\n [columnId],\n filterValue\n )\n\n return column.filteredRows\n },\n rows\n )\n\n // Apply the filter to any subRows\n // We technically could do this recursively in the above loop,\n // but that would severely hinder the API for the user, since they\n // would be required to do that recursion in some scenarios\n filteredRows.forEach(row => {\n filteredFlatRows.push(row)\n filteredRowsById[row.id] = row\n if (!row.subRows) {\n return\n }\n\n row.subRows =\n row.subRows && row.subRows.length > 0\n ? filterRows(row.subRows, depth + 1)\n : row.subRows\n })\n\n return filteredRows\n }\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById]\n }, [\n manualFilters,\n filters,\n rows,\n flatRows,\n rowsById,\n allColumns,\n userFilterTypes,\n ])\n\n React.useMemo(() => {\n // Now that each filtered column has it's partially filtered rows,\n // lets assign the final filtered rows to all of the other columns\n const nonFilteredColumns = allColumns.filter(\n column => !filters.find(d => d.id === column.id)\n )\n\n // This essentially enables faceted filter options to be built easily\n // using every column's preFilteredRows value\n nonFilteredColumns.forEach(column => {\n column.preFilteredRows = filteredRows\n column.filteredRows = filteredRows\n })\n }, [filteredRows, filters, allColumns])\n\n const getAutoResetFilters = useGetLatest(autoResetFilters)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetFilters()) {\n dispatch({ type: actions.resetFilters })\n }\n }, [dispatch, manualFilters ? null : data])\n\n Object.assign(instance, {\n preFilteredRows: rows,\n preFilteredFlatRows: flatRows,\n preFilteredRowsById: rowsById,\n filteredRows,\n filteredFlatRows,\n filteredRowsById,\n rows: filteredRows,\n flatRows: filteredFlatRows,\n rowsById: filteredRowsById,\n setFilter,\n setAllFilters,\n })\n}\n","import React from 'react'\n\nimport {\n getFilterMethod,\n shouldAutoRemoveFilter,\n getFirstDefined,\n} from '../utils'\n\nimport {\n actions,\n useMountedLayoutEffect,\n functionalUpdate,\n useGetLatest,\n} from '../publicUtils'\n\nimport * as filterTypes from '../filterTypes'\n\n// Actions\nactions.resetGlobalFilter = 'resetGlobalFilter'\nactions.setGlobalFilter = 'setGlobalFilter'\n\nexport const useGlobalFilter = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseGlobalFilter.pluginName = 'useGlobalFilter'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.resetGlobalFilter) {\n return {\n ...state,\n globalFilter: instance.initialState.globalFilter || undefined,\n }\n }\n\n if (action.type === actions.setGlobalFilter) {\n const { filterValue } = action\n const { userFilterTypes } = instance\n\n const filterMethod = getFilterMethod(\n instance.globalFilter,\n userFilterTypes || {},\n filterTypes\n )\n\n const newFilter = functionalUpdate(filterValue, state.globalFilter)\n\n //\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter)) {\n const { globalFilter, ...stateWithoutGlobalFilter } = state\n return stateWithoutGlobalFilter\n }\n\n return {\n ...state,\n globalFilter: newFilter,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n filterTypes: userFilterTypes,\n globalFilter,\n manualGlobalFilter,\n state: { globalFilter: globalFilterValue },\n dispatch,\n autoResetGlobalFilter = true,\n disableGlobalFilter,\n } = instance\n\n const setGlobalFilter = React.useCallback(\n filterValue => {\n dispatch({ type: actions.setGlobalFilter, filterValue })\n },\n [dispatch]\n )\n\n // TODO: Create a filter cache for incremental high speed multi-filtering\n // This gets pretty complicated pretty fast, since you have to maintain a\n // cache for each row group (top-level rows, and each row's recursive subrows)\n // This would make multi-filtering a lot faster though. Too far?\n\n const [\n globalFilteredRows,\n globalFilteredFlatRows,\n globalFilteredRowsById,\n ] = React.useMemo(() => {\n if (manualGlobalFilter || typeof globalFilterValue === 'undefined') {\n return [rows, flatRows, rowsById]\n }\n\n const filteredFlatRows = []\n const filteredRowsById = {}\n\n const filterMethod = getFilterMethod(\n globalFilter,\n userFilterTypes || {},\n filterTypes\n )\n\n if (!filterMethod) {\n console.warn(`Could not find a valid 'globalFilter' option.`)\n return rows\n }\n\n allColumns.forEach(column => {\n const { disableGlobalFilter: columnDisableGlobalFilter } = column\n\n column.canFilter = getFirstDefined(\n columnDisableGlobalFilter === true ? false : undefined,\n disableGlobalFilter === true ? false : undefined,\n true\n )\n })\n\n const filterableColumns = allColumns.filter(c => c.canFilter === true)\n\n // Filters top level and nested rows\n const filterRows = filteredRows => {\n filteredRows = filterMethod(\n filteredRows,\n filterableColumns.map(d => d.id),\n globalFilterValue\n )\n\n filteredRows.forEach(row => {\n filteredFlatRows.push(row)\n filteredRowsById[row.id] = row\n\n row.subRows =\n row.subRows && row.subRows.length\n ? filterRows(row.subRows)\n : row.subRows\n })\n\n return filteredRows\n }\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById]\n }, [\n manualGlobalFilter,\n globalFilterValue,\n globalFilter,\n userFilterTypes,\n allColumns,\n rows,\n flatRows,\n rowsById,\n disableGlobalFilter,\n ])\n\n const getAutoResetGlobalFilter = useGetLatest(autoResetGlobalFilter)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGlobalFilter()) {\n dispatch({ type: actions.resetGlobalFilter })\n }\n }, [dispatch, manualGlobalFilter ? null : data])\n\n Object.assign(instance, {\n preGlobalFilteredRows: rows,\n preGlobalFilteredFlatRows: flatRows,\n preGlobalFilteredRowsById: rowsById,\n globalFilteredRows,\n globalFilteredFlatRows,\n globalFilteredRowsById,\n rows: globalFilteredRows,\n flatRows: globalFilteredFlatRows,\n rowsById: globalFilteredRowsById,\n setGlobalFilter,\n disableGlobalFilter,\n })\n}\n","export function sum(values, aggregatedValues) {\n // It's faster to just add the aggregations together instead of\n // process leaf nodes individually\n return aggregatedValues.reduce(\n (sum, next) => sum + (typeof next === 'number' ? next : 0),\n 0\n )\n}\n\nexport function min(values) {\n let min = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n min = Math.min(min, value)\n }\n })\n\n return min\n}\n\nexport function max(values) {\n let max = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n max = Math.max(max, value)\n }\n })\n\n return max\n}\n\nexport function minMax(values) {\n let min = values[0] || 0\n let max = values[0] || 0\n\n values.forEach(value => {\n if (typeof value === 'number') {\n min = Math.min(min, value)\n max = Math.max(max, value)\n }\n })\n\n return `${min}..${max}`\n}\n\nexport function average(values) {\n return sum(null, values) / values.length\n}\n\nexport function median(values) {\n if (!values.length) {\n return null\n }\n\n const mid = Math.floor(values.length / 2)\n const nums = [...values].sort((a, b) => a - b)\n return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2\n}\n\nexport function unique(values) {\n return Array.from(new Set(values).values())\n}\n\nexport function uniqueCount(values) {\n return new Set(values).size\n}\n\nexport function count(values) {\n return values.length\n}\n","import React from 'react'\n\nimport * as aggregations from '../aggregations'\n\nimport { getFirstDefined, flattenBy } from '../utils'\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nconst emptyArray = []\nconst emptyObject = {}\n\n// Actions\nactions.resetGroupBy = 'resetGroupBy'\nactions.setGroupBy = 'setGroupBy'\nactions.toggleGroupBy = 'toggleGroupBy'\n\nexport const useGroupBy = hooks => {\n hooks.getGroupByToggleProps = [defaultGetGroupByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => [\n ...deps,\n instance.state.groupBy,\n ])\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseGroupBy.pluginName = 'useGroupBy'\n\nconst defaultGetGroupByToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canGroupBy\n ? e => {\n e.persist()\n header.toggleGroupBy()\n }\n : undefined,\n style: {\n cursor: header.canGroupBy ? 'pointer' : undefined,\n },\n title: 'Toggle GroupBy',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n groupBy: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetGroupBy) {\n return {\n ...state,\n groupBy: instance.initialState.groupBy || [],\n }\n }\n\n if (action.type === actions.setGroupBy) {\n const { value } = action\n return {\n ...state,\n groupBy: value,\n }\n }\n\n if (action.type === actions.toggleGroupBy) {\n const { columnId, value: setGroupBy } = action\n\n const resolvedGroupBy =\n typeof setGroupBy !== 'undefined'\n ? setGroupBy\n : !state.groupBy.includes(columnId)\n\n if (resolvedGroupBy) {\n return {\n ...state,\n groupBy: [...state.groupBy, columnId],\n }\n }\n\n return {\n ...state,\n groupBy: state.groupBy.filter(d => d !== columnId),\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { groupBy },\n },\n }\n) {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n\n const groupByColumns = groupBy\n .map(g => columns.find(col => col.id === g))\n .filter(Boolean)\n\n const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id))\n\n columns = [...groupByColumns, ...nonGroupByColumns]\n\n columns.forEach(column => {\n column.isGrouped = groupBy.includes(column.id)\n column.groupedIndex = groupBy.indexOf(column.id)\n })\n\n return columns\n}\n\nconst defaultUserAggregations = {}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n flatHeaders,\n groupByFn = defaultGroupByFn,\n manualGroupBy,\n aggregations: userAggregations = defaultUserAggregations,\n plugins,\n state: { groupBy },\n dispatch,\n autoResetGroupBy = true,\n disableGroupBy,\n defaultCanGroupBy,\n getHooks,\n } = instance\n\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useGroupBy')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultGroupBy: defaultColumnGroupBy,\n disableGroupBy: columnDisableGroupBy,\n } = column\n\n column.canGroupBy = accessor\n ? getFirstDefined(\n column.canGroupBy,\n columnDisableGroupBy === true ? false : undefined,\n disableGroupBy === true ? false : undefined,\n true\n )\n : getFirstDefined(\n column.canGroupBy,\n defaultColumnGroupBy,\n defaultCanGroupBy,\n false\n )\n\n if (column.canGroupBy) {\n column.toggleGroupBy = () => instance.toggleGroupBy(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const toggleGroupBy = React.useCallback(\n (columnId, value) => {\n dispatch({ type: actions.toggleGroupBy, columnId, value })\n },\n [dispatch]\n )\n\n const setGroupBy = React.useCallback(\n value => {\n dispatch({ type: actions.setGroupBy, value })\n },\n [dispatch]\n )\n\n flatHeaders.forEach(header => {\n header.getGroupByToggleProps = makePropGetter(\n getHooks().getGroupByToggleProps,\n { instance: getInstance(), header }\n )\n })\n\n const [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n ] = React.useMemo(() => {\n if (manualGroupBy || !groupBy.length) {\n return [\n rows,\n flatRows,\n rowsById,\n emptyArray,\n emptyObject,\n flatRows,\n rowsById,\n ]\n }\n\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g =>\n allColumns.find(col => col.id === g)\n )\n\n // Find the columns that can or are aggregating\n // Uses each column to aggregate rows into a single value\n const aggregateRowsToValues = (leafRows, groupedRows, depth) => {\n const values = {}\n\n allColumns.forEach(column => {\n // Don't aggregate columns that are in the groupBy\n if (existingGroupBy.includes(column.id)) {\n values[column.id] = groupedRows[0]\n ? groupedRows[0].values[column.id]\n : null\n return\n }\n\n // Aggregate the values\n let aggregateFn =\n typeof column.aggregate === 'function'\n ? column.aggregate\n : userAggregations[column.aggregate] ||\n aggregations[column.aggregate]\n\n if (aggregateFn) {\n // Get the columnValues to aggregate\n const groupedValues = groupedRows.map(row => row.values[column.id])\n\n // Get the columnValues to aggregate\n const leafValues = leafRows.map(row => {\n let columnValue = row.values[column.id]\n\n if (!depth && column.aggregateValue) {\n const aggregateValueFn =\n typeof column.aggregateValue === 'function'\n ? column.aggregateValue\n : userAggregations[column.aggregateValue] ||\n aggregations[column.aggregateValue]\n\n if (!aggregateValueFn) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregateValue option for column listed above`\n )\n }\n\n columnValue = aggregateValueFn(columnValue, row, column)\n }\n return columnValue\n })\n\n values[column.id] = aggregateFn(leafValues, groupedValues)\n } else if (column.aggregate) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregate option for column listed above`\n )\n } else {\n values[column.id] = null\n }\n })\n\n return values\n }\n\n let groupedFlatRows = []\n const groupedRowsById = {}\n const onlyGroupedFlatRows = []\n const onlyGroupedRowsById = {}\n const nonGroupedFlatRows = []\n const nonGroupedRowsById = {}\n\n // Recursively group the data\n const groupUpRecursively = (rows, depth = 0, parentId) => {\n // This is the last level, just return the rows\n if (depth === existingGroupBy.length) {\n return rows.map((row) => ({ ...row, depth }))\n }\n\n const columnId = existingGroupBy[depth]\n\n // Group the rows together for this level\n let rowGroupsMap = groupByFn(rows, columnId)\n\n // Peform aggregations for each group\n const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\n ([groupByVal, groupedRows], index) => {\n let id = `${columnId}:${groupByVal}`\n id = parentId ? `${parentId}>${id}` : id\n\n // First, Recurse to group sub rows before aggregation\n const subRows = groupUpRecursively(groupedRows, depth + 1, id)\n\n // Flatten the leaf rows of the rows in this group\n const leafRows = depth\n ? flattenBy(groupedRows, 'leafRows')\n : groupedRows\n\n const values = aggregateRowsToValues(leafRows, groupedRows, depth)\n\n const row = {\n id,\n isGrouped: true,\n groupByID: columnId,\n groupByVal,\n values,\n subRows,\n leafRows,\n depth,\n index,\n }\n\n subRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n return row\n }\n )\n\n return aggregatedGroupedRows\n }\n\n const groupedRows = groupUpRecursively(rows)\n\n groupedRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n // Assign the new data\n return [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n ]\n }, [\n manualGroupBy,\n groupBy,\n rows,\n flatRows,\n rowsById,\n allColumns,\n userAggregations,\n groupByFn,\n ])\n\n const getAutoResetGroupBy = useGetLatest(autoResetGroupBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGroupBy()) {\n dispatch({ type: actions.resetGroupBy })\n }\n }, [dispatch, manualGroupBy ? null : data])\n\n Object.assign(instance, {\n preGroupedRows: rows,\n preGroupedFlatRow: flatRows,\n preGroupedRowsById: rowsById,\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById,\n toggleGroupBy,\n setGroupBy,\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the groupBy and the pivot cell for the row\n cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID\n // Placeholder cells are any columns in the groupBy that are not grouped\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped\n // Aggregated cells are not grouped, not repeated, but still have subRows\n cell.isAggregated =\n !cell.isGrouped && !cell.isPlaceholder && row.subRows?.length\n })\n}\n\nexport function defaultGroupByFn(rows, columnId) {\n return rows.reduce((prev, row, i) => {\n // TODO: Might want to implement a key serializer here so\n // irregular column values can still be grouped if needed?\n const resKey = `${row.values[columnId]}`\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : []\n prev[resKey].push(row)\n return prev\n }, {})\n}\n","const reSplitAlphaNumeric = /([0-9]+)/gm\n\n// Mixed sorting is slow, but very inclusive of many edge cases.\n// It handles numbers, mixed alphanumeric combinations, and even\n// null, undefined, and Infinity\nexport const alphanumeric = (rowA, rowB, columnId) => {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n // Force to strings (or \"\" for unsupported types)\n a = toString(a)\n b = toString(b)\n\n // Split on number groups, but keep the delimiter\n // Then remove falsey split values\n a = a.split(reSplitAlphaNumeric).filter(Boolean)\n b = b.split(reSplitAlphaNumeric).filter(Boolean)\n\n // While\n while (a.length && b.length) {\n let aa = a.shift()\n let bb = b.shift()\n\n const an = parseInt(aa, 10)\n const bn = parseInt(bb, 10)\n\n const combo = [an, bn].sort()\n\n // Both are string\n if (isNaN(combo[0])) {\n if (aa > bb) {\n return 1\n }\n if (bb > aa) {\n return -1\n }\n continue\n }\n\n // One is a string, one is a number\n if (isNaN(combo[1])) {\n return isNaN(an) ? -1 : 1\n }\n\n // Both are numbers\n if (an > bn) {\n return 1\n }\n if (bn > an) {\n return -1\n }\n }\n\n return a.length - b.length\n}\nexport function datetime(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n a = a.getTime()\n b = b.getTime()\n\n return compareBasic(a, b)\n}\n\nexport function basic(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n return compareBasic(a, b)\n}\n\nexport function string(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n a = a.split('').filter(Boolean)\n b = b.split('').filter(Boolean)\n\n while (a.length && b.length) {\n let aa = a.shift()\n let bb = b.shift()\n\n let alower = aa.toLowerCase()\n let blower = bb.toLowerCase()\n\n // Case insensitive comparison until characters match\n if (alower > blower) {\n return 1\n }\n if (blower > alower) {\n return -1\n }\n // If lowercase characters are identical\n if (aa > bb) {\n return 1\n }\n if (bb > aa) {\n return -1\n }\n continue\n }\n\n return a.length - b.length\n}\n\nexport function number(rowA, rowB, columnId) {\n let [a, b] = getRowValuesByColumnID(rowA, rowB, columnId)\n\n const replaceNonNumeric = /[^0-9.]/gi\n\n a = Number(String(a).replace(replaceNonNumeric, ''))\n b = Number(String(b).replace(replaceNonNumeric, ''))\n\n return compareBasic(a, b)\n}\n\n// Utils\n\nfunction compareBasic(a, b) {\n return a === b ? 0 : a > b ? 1 : -1\n}\n\nfunction getRowValuesByColumnID(row1, row2, columnId) {\n return [row1.values[columnId], row2.values[columnId]]\n}\n\nfunction toString(a) {\n if (typeof a === 'number') {\n if (isNaN(a) || a === Infinity || a === -Infinity) {\n return ''\n }\n return String(a)\n }\n if (typeof a === 'string') {\n return a\n }\n return ''\n}\n","import React from 'react'\n\nimport {\n actions,\n ensurePluginOrder,\n defaultColumn,\n makePropGetter,\n useGetLatest,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport { getFirstDefined, isFunction } from '../utils'\n\nimport * as sortTypes from '../sortTypes'\n\n// Actions\nactions.resetSortBy = 'resetSortBy'\nactions.setSortBy = 'setSortBy'\nactions.toggleSortBy = 'toggleSortBy'\nactions.clearSortBy = 'clearSortBy'\n\ndefaultColumn.sortType = 'alphanumeric'\ndefaultColumn.sortDescFirst = false\n\nexport const useSortBy = hooks => {\n hooks.getSortByToggleProps = [defaultGetSortByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nuseSortBy.pluginName = 'useSortBy'\n\nconst defaultGetSortByToggleProps = (props, { instance, column }) => {\n const { isMultiSortEvent = e => e.shiftKey } = instance\n\n return [\n props,\n {\n onClick: column.canSort\n ? e => {\n e.persist()\n column.toggleSortBy(\n undefined,\n !instance.disableMultiSort && isMultiSortEvent(e)\n )\n }\n : undefined,\n style: {\n cursor: column.canSort ? 'pointer' : undefined,\n },\n title: column.canSort ? 'Toggle SortBy' : undefined,\n },\n ]\n}\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n sortBy: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetSortBy) {\n return {\n ...state,\n sortBy: instance.initialState.sortBy || [],\n }\n }\n\n if (action.type === actions.clearSortBy) {\n const { sortBy } = state\n const newSortBy = sortBy.filter(d => d.id !== action.columnId)\n\n return {\n ...state,\n sortBy: newSortBy,\n }\n }\n\n if (action.type === actions.setSortBy) {\n const { sortBy } = action\n return {\n ...state,\n sortBy,\n }\n }\n\n if (action.type === actions.toggleSortBy) {\n const { columnId, desc, multi } = action\n\n const {\n allColumns,\n disableMultiSort,\n disableSortRemove,\n disableMultiRemove,\n maxMultiSortColCount = Number.MAX_SAFE_INTEGER,\n } = instance\n\n const { sortBy } = state\n\n // Find the column for this columnId\n const column = allColumns.find(d => d.id === columnId)\n const { sortDescFirst } = column\n\n // Find any existing sortBy for this column\n const existingSortBy = sortBy.find(d => d.id === columnId)\n const existingIndex = sortBy.findIndex(d => d.id === columnId)\n const hasDescDefined = typeof desc !== 'undefined' && desc !== null\n\n let newSortBy = []\n\n // What should we do with this sort action?\n let sortAction\n\n if (!disableMultiSort && multi) {\n if (existingSortBy) {\n sortAction = 'toggle'\n } else {\n sortAction = 'add'\n }\n } else {\n // Normal mode\n if (existingIndex !== sortBy.length - 1 || sortBy.length !== 1) {\n sortAction = 'replace'\n } else if (existingSortBy) {\n sortAction = 'toggle'\n } else {\n sortAction = 'replace'\n }\n }\n\n // Handle toggle states that will remove the sortBy\n if (\n sortAction === 'toggle' && // Must be toggling\n !disableSortRemove && // If disableSortRemove, disable in general\n !hasDescDefined && // Must not be setting desc\n (multi ? !disableMultiRemove : true) && // If multi, don't allow if disableMultiRemove\n ((existingSortBy && // Finally, detect if it should indeed be removed\n existingSortBy.desc &&\n !sortDescFirst) ||\n (!existingSortBy.desc && sortDescFirst))\n ) {\n sortAction = 'remove'\n }\n\n if (sortAction === 'replace') {\n newSortBy = [\n {\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst,\n },\n ]\n } else if (sortAction === 'add') {\n newSortBy = [\n ...sortBy,\n {\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst,\n },\n ]\n // Take latest n columns\n newSortBy.splice(0, newSortBy.length - maxMultiSortColCount)\n } else if (sortAction === 'toggle') {\n // This flips (or sets) the\n newSortBy = sortBy.map(d => {\n if (d.id === columnId) {\n return {\n ...d,\n desc: hasDescDefined ? desc : !existingSortBy.desc,\n }\n }\n return d\n })\n } else if (sortAction === 'remove') {\n newSortBy = sortBy.filter(d => d.id !== columnId)\n }\n\n return {\n ...state,\n sortBy: newSortBy,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n allColumns,\n orderByFn = defaultOrderByFn,\n sortTypes: userSortTypes,\n manualSortBy,\n defaultCanSort,\n disableSortBy,\n flatHeaders,\n state: { sortBy },\n dispatch,\n plugins,\n getHooks,\n autoResetSortBy = true,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGlobalFilter', 'useGroupBy', 'usePivotColumns'],\n 'useSortBy'\n )\n\n const setSortBy = React.useCallback(\n sortBy => {\n dispatch({ type: actions.setSortBy, sortBy })\n },\n [dispatch]\n )\n\n // Updates sorting based on a columnId, desc flag and multi flag\n const toggleSortBy = React.useCallback(\n (columnId, desc, multi) => {\n dispatch({ type: actions.toggleSortBy, columnId, desc, multi })\n },\n [dispatch]\n )\n\n // use reference to avoid memory leak in #1608\n const getInstance = useGetLatest(instance)\n\n // Add the getSortByToggleProps method to columns and headers\n flatHeaders.forEach(column => {\n const {\n accessor,\n canSort: defaultColumnCanSort,\n disableSortBy: columnDisableSortBy,\n id,\n } = column\n\n const canSort = accessor\n ? getFirstDefined(\n columnDisableSortBy === true ? false : undefined,\n disableSortBy === true ? false : undefined,\n true\n )\n : getFirstDefined(defaultCanSort, defaultColumnCanSort, false)\n\n column.canSort = canSort\n\n if (column.canSort) {\n column.toggleSortBy = (desc, multi) =>\n toggleSortBy(column.id, desc, multi)\n\n column.clearSortBy = () => {\n dispatch({ type: actions.clearSortBy, columnId: column.id })\n }\n }\n\n column.getSortByToggleProps = makePropGetter(\n getHooks().getSortByToggleProps,\n {\n instance: getInstance(),\n column,\n }\n )\n\n const columnSort = sortBy.find(d => d.id === id)\n column.isSorted = !!columnSort\n column.sortedIndex = sortBy.findIndex(d => d.id === id)\n column.isSortedDesc = column.isSorted ? columnSort.desc : undefined\n })\n\n const [sortedRows, sortedFlatRows] = React.useMemo(() => {\n if (manualSortBy || !sortBy.length) {\n return [rows, flatRows]\n }\n\n const sortedFlatRows = []\n\n // Filter out sortBys that correspond to non existing columns\n const availableSortBy = sortBy.filter(sort =>\n allColumns.find(col => col.id === sort.id)\n )\n\n const sortData = rows => {\n // Use the orderByFn to compose multiple sortBy's together.\n // This will also perform a stable sorting using the row index\n // if needed.\n const sortedData = orderByFn(\n rows,\n availableSortBy.map(sort => {\n // Support custom sorting methods for each column\n const column = allColumns.find(d => d.id === sort.id)\n\n if (!column) {\n throw new Error(\n `React-Table: Could not find a column with id: ${sort.id} while sorting`\n )\n }\n\n const { sortType } = column\n\n // Look up sortBy functions in this order:\n // column function\n // column string lookup on user sortType\n // column string lookup on built-in sortType\n // default function\n // default string lookup on user sortType\n // default string lookup on built-in sortType\n const sortMethod =\n isFunction(sortType) ||\n (userSortTypes || {})[sortType] ||\n sortTypes[sortType]\n\n if (!sortMethod) {\n throw new Error(\n `React-Table: Could not find a valid sortType of '${sortType}' for column '${sort.id}'.`\n )\n }\n\n // Return the correct sortFn.\n // This function should always return in ascending order\n return (a, b) => sortMethod(a, b, sort.id, sort.desc)\n }),\n // Map the directions\n availableSortBy.map(sort => {\n // Detect and use the sortInverted option\n const column = allColumns.find(d => d.id === sort.id)\n\n if (column && column.sortInverted) {\n return sort.desc\n }\n\n return !sort.desc\n })\n )\n\n // If there are sub-rows, sort them\n sortedData.forEach(row => {\n sortedFlatRows.push(row)\n if (!row.subRows || row.subRows.length === 0) {\n return\n }\n row.subRows = sortData(row.subRows)\n })\n\n return sortedData\n }\n\n return [sortData(rows), sortedFlatRows]\n }, [\n manualSortBy,\n sortBy,\n rows,\n flatRows,\n allColumns,\n orderByFn,\n userSortTypes,\n ])\n\n const getAutoResetSortBy = useGetLatest(autoResetSortBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSortBy()) {\n dispatch({ type: actions.resetSortBy })\n }\n }, [manualSortBy ? null : data])\n\n Object.assign(instance, {\n preSortedRows: rows,\n preSortedFlatRows: flatRows,\n sortedRows,\n sortedFlatRows,\n rows: sortedRows,\n flatRows: sortedFlatRows,\n setSortBy,\n toggleSortBy,\n })\n}\n\nexport function defaultOrderByFn(arr, funcs, dirs) {\n return [...arr].sort((rowA, rowB) => {\n for (let i = 0; i < funcs.length; i += 1) {\n const sortFn = funcs[i]\n const desc = dirs[i] === false || dirs[i] === 'desc'\n const sortInt = sortFn(rowA, rowB)\n if (sortInt !== 0) {\n return desc ? -sortInt : sortInt\n }\n }\n return dirs[0] ? rowA.index - rowB.index : rowB.index - rowA.index\n })\n}\n","import React from 'react'\n\n//\n\nimport {\n actions,\n ensurePluginOrder,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nimport { expandRows } from '../utils'\n\nconst pluginName = 'usePagination'\n\n// Actions\nactions.resetPage = 'resetPage'\nactions.gotoPage = 'gotoPage'\nactions.setPageSize = 'setPageSize'\n\nexport const usePagination = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nusePagination.pluginName = pluginName\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pageSize: 10,\n pageIndex: 0,\n ...state,\n }\n }\n\n if (action.type === actions.resetPage) {\n return {\n ...state,\n pageIndex: instance.initialState.pageIndex || 0,\n }\n }\n\n if (action.type === actions.gotoPage) {\n const { pageCount, page } = instance\n const newPageIndex = functionalUpdate(action.pageIndex, state.pageIndex)\n let canNavigate = false\n\n if (newPageIndex > state.pageIndex) {\n // next page\n canNavigate =\n pageCount === -1\n ? page.length >= state.pageSize\n : newPageIndex < pageCount\n } else if (newPageIndex < state.pageIndex) {\n // prev page\n canNavigate = newPageIndex > -1\n }\n\n if (!canNavigate) {\n return state\n }\n\n return {\n ...state,\n pageIndex: newPageIndex,\n }\n }\n\n if (action.type === actions.setPageSize) {\n const { pageSize } = action\n const topRowIndex = state.pageSize * state.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...state,\n pageIndex,\n pageSize,\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n rows,\n autoResetPage = true,\n manualExpandedKey = 'expanded',\n plugins,\n pageCount: userPageCount,\n paginateExpandedRows = true,\n expandSubRows = true,\n state: {\n pageSize,\n pageIndex,\n expanded,\n globalFilter,\n filters,\n groupBy,\n sortBy,\n },\n dispatch,\n data,\n manualPagination,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],\n 'usePagination'\n )\n\n const getAutoResetPage = useGetLatest(autoResetPage)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPage()) {\n dispatch({ type: actions.resetPage })\n }\n }, [\n dispatch,\n manualPagination ? null : data,\n globalFilter,\n filters,\n groupBy,\n sortBy,\n ])\n\n const pageCount = manualPagination\n ? userPageCount\n : Math.ceil(rows.length / pageSize)\n\n const pageOptions = React.useMemo(\n () =>\n pageCount > 0\n ? [...new Array(pageCount)].fill(null).map((d, i) => i)\n : [],\n [pageCount]\n )\n\n const page = React.useMemo(() => {\n let page\n\n if (manualPagination) {\n page = rows\n } else {\n const pageStart = pageSize * pageIndex\n const pageEnd = pageStart + pageSize\n\n page = rows.slice(pageStart, pageEnd)\n }\n\n if (paginateExpandedRows) {\n return page\n }\n\n return expandRows(page, { manualExpandedKey, expanded, expandSubRows })\n }, [\n expandSubRows,\n expanded,\n manualExpandedKey,\n manualPagination,\n pageIndex,\n pageSize,\n paginateExpandedRows,\n rows,\n ])\n\n const canPreviousPage = pageIndex > 0\n const canNextPage =\n pageCount === -1 ? page.length >= pageSize : pageIndex < pageCount - 1\n\n const gotoPage = React.useCallback(\n pageIndex => {\n dispatch({ type: actions.gotoPage, pageIndex })\n },\n [dispatch]\n )\n\n const previousPage = React.useCallback(() => {\n return gotoPage(old => old - 1)\n }, [gotoPage])\n\n const nextPage = React.useCallback(() => {\n return gotoPage(old => old + 1)\n }, [gotoPage])\n\n const setPageSize = React.useCallback(\n pageSize => {\n dispatch({ type: actions.setPageSize, pageSize })\n },\n [dispatch]\n )\n\n Object.assign(instance, {\n pageOptions,\n pageCount,\n page,\n canPreviousPage,\n canNextPage,\n gotoPage,\n previousPage,\n nextPage,\n setPageSize,\n })\n}\n","/* istanbul ignore file */\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nimport { flattenColumns, getFirstDefined } from '../utils'\n\n// Actions\nactions.resetPivot = 'resetPivot'\nactions.togglePivot = 'togglePivot'\n\nexport const _UNSTABLE_usePivotColumns = hooks => {\n hooks.getPivotToggleProps = [defaultGetPivotToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstanceAfterData.push(useInstanceAfterData)\n hooks.allColumns.push(allColumns)\n hooks.accessValue.push(accessValue)\n hooks.materializedColumns.push(materializedColumns)\n hooks.materializedColumnsDeps.push(materializedColumnsDeps)\n hooks.visibleColumns.push(visibleColumns)\n hooks.visibleColumnsDeps.push(visibleColumnsDeps)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\n_UNSTABLE_usePivotColumns.pluginName = 'usePivotColumns'\n\nconst defaultPivotColumns = []\n\nconst defaultGetPivotToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canPivot\n ? e => {\n e.persist()\n header.togglePivot()\n }\n : undefined,\n style: {\n cursor: header.canPivot ? 'pointer' : undefined,\n },\n title: 'Toggle Pivot',\n },\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pivotColumns: defaultPivotColumns,\n ...state,\n }\n }\n\n if (action.type === actions.resetPivot) {\n return {\n ...state,\n pivotColumns: instance.initialState.pivotColumns || defaultPivotColumns,\n }\n }\n\n if (action.type === actions.togglePivot) {\n const { columnId, value: setPivot } = action\n\n const resolvedPivot =\n typeof setPivot !== 'undefined'\n ? setPivot\n : !state.pivotColumns.includes(columnId)\n\n if (resolvedPivot) {\n return {\n ...state,\n pivotColumns: [...state.pivotColumns, columnId],\n }\n }\n\n return {\n ...state,\n pivotColumns: state.pivotColumns.filter(d => d !== columnId),\n }\n }\n}\n\nfunction useInstanceAfterData(instance) {\n instance.allColumns.forEach(column => {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id)\n })\n}\n\nfunction allColumns(columns, { instance }) {\n columns.forEach(column => {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id)\n column.uniqueValues = new Set()\n })\n return columns\n}\n\nfunction accessValue(value, { column }) {\n if (column.uniqueValues && typeof value !== 'undefined') {\n column.uniqueValues.add(value)\n }\n return value\n}\n\nfunction materializedColumns(materialized, { instance }) {\n const { allColumns, state } = instance\n\n if (!state.pivotColumns.length || !state.groupBy || !state.groupBy.length) {\n return materialized\n }\n\n const pivotColumns = state.pivotColumns\n .map(id => allColumns.find(d => d.id === id))\n .filter(Boolean)\n\n const sourceColumns = allColumns.filter(\n d =>\n !d.isPivotSource &&\n !state.groupBy.includes(d.id) &&\n !state.pivotColumns.includes(d.id)\n )\n\n const buildPivotColumns = (depth = 0, parent, pivotFilters = []) => {\n const pivotColumn = pivotColumns[depth]\n\n if (!pivotColumn) {\n return sourceColumns.map(sourceColumn => {\n // TODO: We could offer support here for renesting pivoted\n // columns inside copies of their header groups. For now,\n // that seems like it would be (1) overkill on nesting, considering\n // you already get nesting for every pivot level and (2)\n // really hard. :)\n\n return {\n ...sourceColumn,\n canPivot: false,\n isPivoted: true,\n parent,\n depth: depth,\n id: `${parent ? `${parent.id}.${sourceColumn.id}` : sourceColumn.id}`,\n accessor: (originalRow, i, row) => {\n if (pivotFilters.every(filter => filter(row))) {\n return row.values[sourceColumn.id]\n }\n },\n }\n })\n }\n\n const uniqueValues = Array.from(pivotColumn.uniqueValues).sort()\n\n return uniqueValues.map(uniqueValue => {\n const columnGroup = {\n ...pivotColumn,\n Header:\n pivotColumn.PivotHeader || typeof pivotColumn.header === 'string'\n ? `${pivotColumn.Header}: ${uniqueValue}`\n : uniqueValue,\n isPivotGroup: true,\n parent,\n depth,\n id: parent\n ? `${parent.id}.${pivotColumn.id}.${uniqueValue}`\n : `${pivotColumn.id}.${uniqueValue}`,\n pivotValue: uniqueValue,\n }\n\n columnGroup.columns = buildPivotColumns(depth + 1, columnGroup, [\n ...pivotFilters,\n row => row.values[pivotColumn.id] === uniqueValue,\n ])\n\n return columnGroup\n })\n }\n\n const newMaterialized = flattenColumns(buildPivotColumns())\n\n return [...materialized, ...newMaterialized]\n}\n\nfunction materializedColumnsDeps(\n deps,\n {\n instance: {\n state: { pivotColumns, groupBy },\n },\n }\n) {\n return [...deps, pivotColumns, groupBy]\n}\n\nfunction visibleColumns(visibleColumns, { instance: { state } }) {\n visibleColumns = visibleColumns.filter(d => !d.isPivotSource)\n\n if (state.pivotColumns.length && state.groupBy && state.groupBy.length) {\n visibleColumns = visibleColumns.filter(\n column => column.isGrouped || column.isPivoted\n )\n }\n\n return visibleColumns\n}\n\nfunction visibleColumnsDeps(deps, { instance }) {\n return [...deps, instance.state.pivotColumns, instance.state.groupBy]\n}\n\nfunction useInstance(instance) {\n const {\n columns,\n allColumns,\n flatHeaders,\n // pivotFn = defaultPivotFn,\n // manualPivot,\n getHooks,\n plugins,\n dispatch,\n autoResetPivot = true,\n manaulPivot,\n disablePivot,\n defaultCanPivot,\n } = instance\n\n ensurePluginOrder(plugins, ['useGroupBy'], 'usePivotColumns')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultPivot: defaultColumnPivot,\n disablePivot: columnDisablePivot,\n } = column\n\n column.canPivot = accessor\n ? getFirstDefined(\n column.canPivot,\n columnDisablePivot === true ? false : undefined,\n disablePivot === true ? false : undefined,\n true\n )\n : getFirstDefined(\n column.canPivot,\n defaultColumnPivot,\n defaultCanPivot,\n false\n )\n\n if (column.canPivot) {\n column.togglePivot = () => instance.togglePivot(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const togglePivot = (columnId, value) => {\n dispatch({ type: actions.togglePivot, columnId, value })\n }\n\n flatHeaders.forEach(header => {\n header.getPivotToggleProps = makePropGetter(\n getHooks().getPivotToggleProps,\n {\n instance: getInstance(),\n header,\n }\n )\n })\n\n const getAutoResetPivot = useGetLatest(autoResetPivot)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPivot()) {\n dispatch({ type: actions.resetPivot })\n }\n }, [dispatch, manaulPivot ? null : columns])\n\n Object.assign(instance, {\n togglePivot,\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the pivotColumns and the pivot cell for the row\n cell.isPivoted = cell.column.isPivoted\n })\n}\n","import React from 'react'\n\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useGetLatest,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nconst pluginName = 'useRowSelect'\n\n// Actions\nactions.resetSelectedRows = 'resetSelectedRows'\nactions.toggleAllRowsSelected = 'toggleAllRowsSelected'\nactions.toggleRowSelected = 'toggleRowSelected'\nactions.toggleAllPageRowsSelected = 'toggleAllPageRowsSelected'\n\nexport const useRowSelect = hooks => {\n hooks.getToggleRowSelectedProps = [defaultGetToggleRowSelectedProps]\n hooks.getToggleAllRowsSelectedProps = [defaultGetToggleAllRowsSelectedProps]\n hooks.getToggleAllPageRowsSelectedProps = [\n defaultGetToggleAllPageRowsSelectedProps,\n ]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowSelect.pluginName = pluginName\n\nconst defaultGetToggleRowSelectedProps = (props, { instance, row }) => {\n const { manualRowSelectedKey = 'isSelected' } = instance\n let checked = false\n\n if (row.original && row.original[manualRowSelectedKey]) {\n checked = true\n } else {\n checked = row.isSelected\n }\n\n return [\n props,\n {\n onChange: e => {\n row.toggleRowSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked,\n title: 'Toggle Row Selected',\n indeterminate: row.isSomeSelected,\n },\n ]\n}\n\nconst defaultGetToggleAllRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleAllRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: instance.isAllRowsSelected,\n title: 'Toggle All Rows Selected',\n indeterminate: Boolean(\n !instance.isAllRowsSelected &&\n Object.keys(instance.state.selectedRowIds).length\n ),\n },\n]\n\nconst defaultGetToggleAllPageRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange(e) {\n instance.toggleAllPageRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer',\n },\n checked: instance.isAllPageRowsSelected,\n title: 'Toggle All Current Page Rows Selected',\n indeterminate: Boolean(\n !instance.isAllPageRowsSelected &&\n instance.page.some(({ id }) => instance.state.selectedRowIds[id])\n ),\n },\n]\n\n// eslint-disable-next-line max-params\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n selectedRowIds: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetSelectedRows) {\n return {\n ...state,\n selectedRowIds: instance.initialState.selectedRowIds || {},\n }\n }\n\n if (action.type === actions.toggleAllRowsSelected) {\n const { value: setSelected } = action\n const {\n isAllRowsSelected,\n rowsById,\n nonGroupedRowsById = rowsById,\n } = instance\n\n const selectAll =\n typeof setSelected !== 'undefined' ? setSelected : !isAllRowsSelected\n\n // Only remove/add the rows that are visible on the screen\n // Leave all the other rows that are selected alone.\n const selectedRowIds = Object.assign({}, state.selectedRowIds)\n\n if (selectAll) {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n selectedRowIds[rowId] = true\n })\n } else {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n delete selectedRowIds[rowId]\n })\n }\n\n return {\n ...state,\n selectedRowIds,\n }\n }\n\n if (action.type === actions.toggleRowSelected) {\n const { id, value: setSelected } = action\n const { rowsById, selectSubRows = true, getSubRows } = instance\n const isSelected = state.selectedRowIds[id]\n const shouldExist =\n typeof setSelected !== 'undefined' ? setSelected : !isSelected\n\n if (isSelected === shouldExist) {\n return state\n }\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (row) {\n if (!row.isGrouped) {\n if (shouldExist) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && getSubRows(row)) {\n return getSubRows(row).forEach(row => handleRowById(row.id))\n }\n }\n }\n\n handleRowById(id)\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds,\n }\n }\n\n if (action.type === actions.toggleAllPageRowsSelected) {\n const { value: setSelected } = action\n const {\n page,\n rowsById,\n selectSubRows = true,\n isAllPageRowsSelected,\n getSubRows,\n } = instance\n\n const selectAll =\n typeof setSelected !== 'undefined' ? setSelected : !isAllPageRowsSelected\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (!row.isGrouped) {\n if (selectAll) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && getSubRows(row)) {\n return getSubRows(row).forEach(row => handleRowById(row.id))\n }\n }\n\n page.forEach(row => handleRowById(row.id))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds,\n }\n }\n return state\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n getHooks,\n plugins,\n rowsById,\n nonGroupedRowsById = rowsById,\n autoResetSelectedRows = true,\n state: { selectedRowIds },\n selectSubRows = true,\n dispatch,\n page,\n getSubRows,\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded', 'usePagination'],\n 'useRowSelect'\n )\n\n const selectedFlatRows = React.useMemo(() => {\n const selectedFlatRows = []\n\n rows.forEach(row => {\n const isSelected = selectSubRows\n ? getRowIsSelected(row, selectedRowIds, getSubRows)\n : !!selectedRowIds[row.id]\n row.isSelected = !!isSelected\n row.isSomeSelected = isSelected === null\n\n if (isSelected) {\n selectedFlatRows.push(row)\n }\n })\n\n return selectedFlatRows\n }, [rows, selectSubRows, selectedRowIds, getSubRows])\n\n let isAllRowsSelected = Boolean(\n Object.keys(nonGroupedRowsById).length && Object.keys(selectedRowIds).length\n )\n\n let isAllPageRowsSelected = isAllRowsSelected\n\n if (isAllRowsSelected) {\n if (Object.keys(nonGroupedRowsById).some(id => !selectedRowIds[id])) {\n isAllRowsSelected = false\n }\n }\n\n if (!isAllRowsSelected) {\n if (page && page.length && page.some(({ id }) => !selectedRowIds[id])) {\n isAllPageRowsSelected = false\n }\n }\n\n const getAutoResetSelectedRows = useGetLatest(autoResetSelectedRows)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSelectedRows()) {\n dispatch({ type: actions.resetSelectedRows })\n }\n }, [dispatch, data])\n\n const toggleAllRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsSelected, value }),\n [dispatch]\n )\n\n const toggleAllPageRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllPageRowsSelected, value }),\n [dispatch]\n )\n\n const toggleRowSelected = React.useCallback(\n (id, value) => dispatch({ type: actions.toggleRowSelected, id, value }),\n [dispatch]\n )\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllRowsSelectedProps,\n { instance: getInstance() }\n )\n\n const getToggleAllPageRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllPageRowsSelectedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n selectedFlatRows,\n isAllRowsSelected,\n isAllPageRowsSelected,\n toggleRowSelected,\n toggleAllRowsSelected,\n getToggleAllRowsSelectedProps,\n getToggleAllPageRowsSelectedProps,\n toggleAllPageRowsSelected,\n })\n}\n\nfunction prepareRow(row, { instance }) {\n row.toggleRowSelected = set => instance.toggleRowSelected(row.id, set)\n\n row.getToggleRowSelectedProps = makePropGetter(\n instance.getHooks().getToggleRowSelectedProps,\n { instance: instance, row }\n )\n}\n\nfunction getRowIsSelected(row, selectedRowIds, getSubRows) {\n if (selectedRowIds[row.id]) {\n return true\n }\n\n const subRows = getSubRows(row)\n\n if (subRows && subRows.length) {\n let allChildrenSelected = true\n let someSelected = false\n\n subRows.forEach(subRow => {\n // Bail out early if we know both of these\n if (someSelected && !allChildrenSelected) {\n return\n }\n\n if (getRowIsSelected(subRow, selectedRowIds, getSubRows)) {\n someSelected = true\n } else {\n allChildrenSelected = false\n }\n })\n return allChildrenSelected ? true : someSelected ? null : false\n }\n\n return false\n}\n","import React from 'react'\n\nimport {\n actions,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest,\n} from '../publicUtils'\n\nconst defaultInitialRowStateAccessor = row => ({})\nconst defaultInitialCellStateAccessor = cell => ({})\n\n// Actions\nactions.setRowState = 'setRowState'\nactions.setCellState = 'setCellState'\nactions.resetRowState = 'resetRowState'\n\nexport const useRowState = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowState.pluginName = 'useRowState'\n\nfunction reducer(state, action, previousState, instance) {\n const {\n initialRowStateAccessor = defaultInitialRowStateAccessor,\n initialCellStateAccessor = defaultInitialCellStateAccessor,\n rowsById,\n } = instance\n\n if (action.type === actions.init) {\n return {\n rowState: {},\n ...state,\n }\n }\n\n if (action.type === actions.resetRowState) {\n return {\n ...state,\n rowState: instance.initialState.rowState || {},\n }\n }\n\n if (action.type === actions.setRowState) {\n const { rowId, value } = action\n\n const oldRowState =\n typeof state.rowState[rowId] !== 'undefined'\n ? state.rowState[rowId]\n : initialRowStateAccessor(rowsById[rowId])\n\n return {\n ...state,\n rowState: {\n ...state.rowState,\n [rowId]: functionalUpdate(value, oldRowState),\n },\n }\n }\n\n if (action.type === actions.setCellState) {\n const { rowId, columnId, value } = action\n\n const oldRowState =\n typeof state.rowState[rowId] !== 'undefined'\n ? state.rowState[rowId]\n : initialRowStateAccessor(rowsById[rowId])\n\n const oldCellState =\n typeof oldRowState?.cellState?.[columnId] !== 'undefined'\n ? oldRowState.cellState[columnId]\n : initialCellStateAccessor(\n rowsById[rowId]?.cells?.find(cell => cell.column.id === columnId)\n )\n\n return {\n ...state,\n rowState: {\n ...state.rowState,\n [rowId]: {\n ...oldRowState,\n cellState: {\n ...(oldRowState.cellState || {}),\n [columnId]: functionalUpdate(value, oldCellState),\n },\n },\n },\n }\n }\n}\n\nfunction useInstance(instance) {\n const { autoResetRowState = true, data, dispatch } = instance\n\n const setRowState = React.useCallback(\n (rowId, value) =>\n dispatch({\n type: actions.setRowState,\n rowId,\n value,\n }),\n [dispatch]\n )\n\n const setCellState = React.useCallback(\n (rowId, columnId, value) =>\n dispatch({\n type: actions.setCellState,\n rowId,\n columnId,\n value,\n }),\n [dispatch]\n )\n\n const getAutoResetRowState = useGetLatest(autoResetRowState)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetRowState()) {\n dispatch({ type: actions.resetRowState })\n }\n }, [data])\n\n Object.assign(instance, {\n setRowState,\n setCellState,\n })\n}\n\nfunction prepareRow(row, { instance }) {\n const {\n initialRowStateAccessor = defaultInitialRowStateAccessor,\n initialCellStateAccessor = defaultInitialCellStateAccessor,\n state: { rowState },\n } = instance\n\n if (row) {\n row.state =\n typeof rowState[row.id] !== 'undefined'\n ? rowState[row.id]\n : initialRowStateAccessor(row)\n\n row.setState = updater => {\n return instance.setRowState(row.id, updater)\n }\n\n row.cells.forEach(cell => {\n if (!row.state.cellState) {\n row.state.cellState = {}\n }\n\n cell.state =\n typeof row.state.cellState[cell.column.id] !== 'undefined'\n ? row.state.cellState[cell.column.id]\n : initialCellStateAccessor(cell)\n\n cell.setState = updater => {\n return instance.setCellState(row.id, cell.column.id, updater)\n }\n })\n }\n}\n","import React from 'react'\n\nimport { functionalUpdate, actions } from '../publicUtils'\n\n// Actions\nactions.resetColumnOrder = 'resetColumnOrder'\nactions.setColumnOrder = 'setColumnOrder'\n\nexport const useColumnOrder = hooks => {\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => {\n return [...deps, instance.state.columnOrder]\n })\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n}\n\nuseColumnOrder.pluginName = 'useColumnOrder'\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n columnOrder: [],\n ...state,\n }\n }\n\n if (action.type === actions.resetColumnOrder) {\n return {\n ...state,\n columnOrder: instance.initialState.columnOrder || [],\n }\n }\n\n if (action.type === actions.setColumnOrder) {\n return {\n ...state,\n columnOrder: functionalUpdate(action.columnOrder, state.columnOrder),\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { columnOrder },\n },\n }\n) {\n // If there is no order, return the normal columns\n if (!columnOrder || !columnOrder.length) {\n return columns\n }\n\n const columnOrderCopy = [...columnOrder]\n\n // If there is an order, make a copy of the columns\n const columnsCopy = [...columns]\n\n // And make a new ordered array of the columns\n const columnsInOrder = []\n\n // Loop over the columns and place them in order into the new array\n while (columnsCopy.length && columnOrderCopy.length) {\n const targetColumnId = columnOrderCopy.shift()\n const foundIndex = columnsCopy.findIndex(d => d.id === targetColumnId)\n if (foundIndex > -1) {\n columnsInOrder.push(columnsCopy.splice(foundIndex, 1)[0])\n }\n }\n\n // If there are any columns left, add them to the end\n return [...columnsInOrder, ...columnsCopy]\n}\n\nfunction useInstance(instance) {\n const { dispatch } = instance\n\n instance.setColumnOrder = React.useCallback(\n columnOrder => {\n return dispatch({ type: actions.setColumnOrder, columnOrder })\n },\n [dispatch]\n )\n}\n","import React from 'react'\n\nimport {\n actions,\n defaultColumn,\n makePropGetter,\n useGetLatest,\n ensurePluginOrder,\n useMountedLayoutEffect,\n} from '../publicUtils'\n\nimport { getFirstDefined, passiveEventSupported } from '../utils'\n\n// Default Column\ndefaultColumn.canResize = true\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport const useResizeColumns = hooks => {\n hooks.getResizerProps = [defaultGetResizerProps]\n hooks.getHeaderProps.push({\n style: {\n position: 'relative',\n },\n })\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n}\n\nconst defaultGetResizerProps = (props, { instance, header }) => {\n const { dispatch } = instance\n\n const onResizeStart = (e, header) => {\n let isTouchEvent = false\n if (e.type === 'touchstart') {\n // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n if (e.touches && e.touches.length > 1) {\n return\n }\n isTouchEvent = true\n }\n const headersToResize = getLeafHeaders(header)\n const headerIdWidths = headersToResize.map(d => [d.id, d.totalWidth])\n\n const clientX = isTouchEvent ? Math.round(e.touches[0].clientX) : e.clientX\n\n let raf\n let mostRecentClientX\n\n const dispatchEnd = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnDoneResizing })\n }\n const dispatchMove = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnResizing, clientX: mostRecentClientX })\n }\n\n const scheduleDispatchMoveOnNextAnimationFrame = clientXPos => {\n mostRecentClientX = clientXPos\n if (!raf) {\n raf = window.requestAnimationFrame(dispatchMove)\n }\n }\n\n const handlersAndEvents = {\n mouse: {\n moveEvent: 'mousemove',\n moveHandler: e => scheduleDispatchMoveOnNextAnimationFrame(e.clientX),\n upEvent: 'mouseup',\n upHandler: e => {\n document.removeEventListener(\n 'mousemove',\n handlersAndEvents.mouse.moveHandler\n )\n document.removeEventListener(\n 'mouseup',\n handlersAndEvents.mouse.upHandler\n )\n dispatchEnd()\n },\n },\n touch: {\n moveEvent: 'touchmove',\n moveHandler: e => {\n if (e.cancelable) {\n e.preventDefault()\n e.stopPropagation()\n }\n scheduleDispatchMoveOnNextAnimationFrame(e.touches[0].clientX)\n return false\n },\n upEvent: 'touchend',\n upHandler: e => {\n document.removeEventListener(\n handlersAndEvents.touch.moveEvent,\n handlersAndEvents.touch.moveHandler\n )\n document.removeEventListener(\n handlersAndEvents.touch.upEvent,\n handlersAndEvents.touch.moveHandler\n )\n dispatchEnd()\n },\n },\n }\n\n const events = isTouchEvent\n ? handlersAndEvents.touch\n : handlersAndEvents.mouse\n const passiveIfSupported = passiveEventSupported()\n ? { passive: false }\n : false\n document.addEventListener(\n events.moveEvent,\n events.moveHandler,\n passiveIfSupported\n )\n document.addEventListener(\n events.upEvent,\n events.upHandler,\n passiveIfSupported\n )\n\n dispatch({\n type: actions.columnStartResizing,\n columnId: header.id,\n columnWidth: header.totalWidth,\n headerIdWidths,\n clientX,\n })\n }\n\n return [\n props,\n {\n onMouseDown: e => e.persist() || onResizeStart(e, header),\n onTouchStart: e => e.persist() || onResizeStart(e, header),\n style: {\n cursor: 'col-resize',\n },\n draggable: false,\n role: 'separator',\n },\n ]\n}\n\nuseResizeColumns.pluginName = 'useResizeColumns'\n\nfunction reducer(state, action) {\n if (action.type === actions.init) {\n return {\n columnResizing: {\n columnWidths: {},\n },\n ...state,\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n columnResizing: {\n columnWidths: {},\n },\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { clientX, columnId, columnWidth, headerIdWidths } = action\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: clientX,\n headerIdWidths,\n columnWidth,\n isResizingColumn: columnId,\n },\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX, columnWidth, headerIdWidths = [] } = state.columnResizing\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.max(\n headerWidth + headerWidth * percentageDeltaX,\n 0\n )\n })\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n columnWidths: {\n ...state.columnResizing.columnWidths,\n ...newColumnWidths,\n },\n },\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: null,\n isResizingColumn: null,\n },\n }\n }\n}\n\nconst useInstanceBeforeDimensions = instance => {\n const {\n flatHeaders,\n disableResizing,\n getHooks,\n state: { columnResizing },\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n flatHeaders.forEach(header => {\n const canResize = getFirstDefined(\n header.disableResizing === true ? false : undefined,\n disableResizing === true ? false : undefined,\n true\n )\n\n header.canResize = canResize\n header.width =\n columnResizing.columnWidths[header.id] ||\n header.originalWidth ||\n header.width\n header.isResizing = columnResizing.isResizingColumn === header.id\n\n if (canResize) {\n header.getResizerProps = makePropGetter(getHooks().getResizerProps, {\n instance: getInstance(),\n header,\n })\n }\n })\n}\n\nfunction useInstance(instance) {\n const { plugins, dispatch, autoResetResize = true, columns } = instance\n\n ensurePluginOrder(plugins, ['useAbsoluteLayout'], 'useResizeColumns')\n\n const getAutoResetResize = useGetLatest(autoResetResize)\n useMountedLayoutEffect(() => {\n if (getAutoResetResize()) {\n dispatch({ type: actions.resetResize })\n }\n }, [columns])\n\n const resetResizing = React.useCallback(\n () => dispatch({ type: actions.resetResize }),\n [dispatch]\n )\n\n Object.assign(instance, {\n resetResizing,\n })\n}\n\nfunction getLeafHeaders(header) {\n const leafHeaders = []\n const recurseHeader = header => {\n if (header.columns && header.columns.length) {\n header.columns.map(recurseHeader)\n }\n leafHeaders.push(header)\n }\n recurseHeader(header)\n return leafHeaders\n}\n","import { actions } from '../publicUtils'\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport function useGridLayout(hooks) {\n hooks.stateReducers.push(reducer)\n hooks.getTableProps.push(getTableProps)\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getRowProps.push(getRowProps)\n}\n\nuseGridLayout.pluginName = 'useGridLayout'\n\nconst getTableProps = (props, { instance }) => {\n const gridTemplateColumns = instance.visibleColumns.map(column => {\n if (instance.state.gridLayout.columnWidths[column.id])\n return `${instance.state.gridLayout.columnWidths[column.id]}px`\n // When resizing, lock the width of all unset columns\n // instead of using user-provided width or defaultColumn width,\n // which could potentially be 'auto' or 'fr' units that don't scale linearly\n if (instance.state.columnResizing?.isResizingColumn)\n return `${instance.state.gridLayout.startWidths[column.id]}px`\n if (typeof column.width === 'number') return `${column.width}px`\n return column.width\n })\n return [\n props,\n {\n style: {\n display: `grid`,\n gridTemplateColumns: gridTemplateColumns.join(` `),\n },\n },\n ]\n}\n\nconst getHeaderProps = (props, { column }) => [\n props,\n {\n id: `header-cell-${column.id}`,\n style: {\n position: `sticky`, //enables a scroll wrapper to be placed around the table and have sticky headers\n gridColumn: `span ${column.totalVisibleHeaderCount}`,\n },\n },\n]\n\nconst getRowProps = (props, { row }) => {\n if (row.isExpanded) {\n return [\n props,\n {\n style: {\n gridColumn: `1 / ${row.cells.length + 1}`,\n },\n },\n ]\n }\n return [props, {}]\n}\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n gridLayout: {\n columnWidths: {},\n },\n ...state,\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n gridLayout: {\n columnWidths: {},\n },\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { columnId, headerIdWidths } = action\n const columnWidth = getElementWidth(columnId)\n\n if (columnWidth !== undefined) {\n const startWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: getElementWidth(column.id),\n }),\n {}\n )\n const minWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: column.minWidth,\n }),\n {}\n )\n const maxWidths = instance.visibleColumns.reduce(\n (acc, column) => ({\n ...acc,\n [column.id]: column.maxWidth,\n }),\n {}\n )\n\n const headerIdGridWidths = headerIdWidths.map(([headerId]) => [\n headerId,\n getElementWidth(headerId),\n ])\n\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n startWidths,\n minWidths,\n maxWidths,\n headerIdGridWidths,\n columnWidth,\n },\n }\n } else {\n return state\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX } = state.columnResizing\n const {\n columnWidth,\n minWidths,\n maxWidths,\n headerIdGridWidths = [],\n } = state.gridLayout\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdGridWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.min(\n Math.max(\n minWidths[headerId],\n headerWidth + headerWidth * percentageDeltaX\n ),\n maxWidths[headerId]\n )\n })\n\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n columnWidths: {\n ...state.gridLayout.columnWidths,\n ...newColumnWidths,\n },\n },\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n gridLayout: {\n ...state.gridLayout,\n startWidths: {},\n minWidths: {},\n maxWidths: {},\n },\n }\n }\n}\n\nfunction getElementWidth(columnId) {\n const width = document.getElementById(`header-cell-${columnId}`)?.offsetWidth\n\n if (width !== undefined) {\n return width\n }\n}\n","var __WEBPACK_NAMESPACE_OBJECT__ = window.reactR;","/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n// $FlowFixMe\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n // $FlowFixMe\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n // $FlowFixMe\n return document.styleSheets[i];\n }\n }\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? process.env.NODE_ENV === 'production' : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (process.env.NODE_ENV !== 'production') {\n var isImportRule = rule.charCodeAt(0) === 64 && rule.charCodeAt(1) === 105;\n\n if (isImportRule && this._alreadyInsertedOrderInsensitiveRule) {\n // this would only cause problem in speedy mode\n // but we don't want enabling speedy to affect the observable behavior\n // so we report this error at all times\n console.error(\"You're attempting to insert the following rule:\\n\" + rule + '\\n\\n`@import` rules must be before all other types of rules in a stylesheet but other rules have already been inserted. Please ensure that `@import` rules are before all other rules.');\n }\n this._alreadyInsertedOrderInsensitiveRule = this._alreadyInsertedOrderInsensitiveRule || !isImportRule;\n }\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n if (process.env.NODE_ENV !== 'production' && !/:(-moz-placeholder|-moz-focus-inner|-moz-focusring|-ms-input-placeholder|-moz-read-write|-moz-read-only|-ms-clear){/.test(rule)) {\n console.error(\"There was a problem inserting the following rule: \\\"\" + rule + \"\\\"\", e);\n }\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n // $FlowFixMe\n this.tags.forEach(function (tag) {\n return tag.parentNode && tag.parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n\n if (process.env.NODE_ENV !== 'production') {\n this._alreadyInsertedOrderInsensitiveRule = false;\n }\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3)\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\n","import {IMPORT, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT} from './Enum.js'\nimport {hash, charat, strlen, indexof, replace} from './Utility.js'\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {string}\n */\nexport function prefix (value, length) {\n\tswitch (hash(value, length)) {\n\t\t// color-adjust\n\t\tcase 5103:\n\t\t\treturn WEBKIT + 'print-' + value + value\n\t\t// animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\t\tcase 5737: case 4201: case 3177: case 3433: case 1641: case 4457: case 2921:\n\t\t// text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\t\tcase 5572: case 6356: case 5844: case 3191: case 6645: case 3005:\n\t\t// mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\t\tcase 6391: case 5879: case 5623: case 6135: case 4599: case 4855:\n\t\t// background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\t\tcase 4215: case 6389: case 5109: case 5365: case 5621: case 3829:\n\t\t\treturn WEBKIT + value + value\n\t\t// appearance, user-select, transform, hyphens, text-size-adjust\n\t\tcase 5349: case 4246: case 4810: case 6968: case 2756:\n\t\t\treturn WEBKIT + value + MOZ + value + MS + value + value\n\t\t// flex, flex-direction\n\t\tcase 6828: case 4268:\n\t\t\treturn WEBKIT + value + MS + value + value\n\t\t// order\n\t\tcase 6165:\n\t\t\treturn WEBKIT + value + MS + 'flex-' + value + value\n\t\t// align-items\n\t\tcase 5187:\n\t\t\treturn WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value\n\t\t// align-self\n\t\tcase 5443:\n\t\t\treturn WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value\n\t\t// align-content\n\t\tcase 4675:\n\t\t\treturn WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value\n\t\t// flex-shrink\n\t\tcase 5548:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value\n\t\t// flex-basis\n\t\tcase 5292:\n\t\t\treturn WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value\n\t\t// flex-grow\n\t\tcase 6060:\n\t\t\treturn WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value\n\t\t// transition\n\t\tcase 4554:\n\t\t\treturn WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value\n\t\t// cursor\n\t\tcase 6187:\n\t\t\treturn replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value\n\t\t// background, background-image\n\t\tcase 5495: case 3959:\n\t\t\treturn replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1')\n\t\t// justify-content\n\t\tcase 4968:\n\t\t\treturn replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value\n\t\t// (margin|padding)-inline-(start|end)\n\t\tcase 4095: case 3583: case 4068: case 2532:\n\t\t\treturn replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value\n\t\t// (min|max)?(width|height|inline-size|block-size)\n\t\tcase 8116: case 7059: case 5753: case 5535:\n\t\tcase 5445: case 5701: case 4933: case 4677:\n\t\tcase 5533: case 5789: case 5021: case 4765:\n\t\t\t// stretch, max-content, min-content, fill-available\n\t\t\tif (strlen(value) - 1 - length > 6)\n\t\t\t\tswitch (charat(value, length + 1)) {\n\t\t\t\t\t// (m)ax-content, (m)in-content\n\t\t\t\t\tcase 109:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (charat(value, length + 4) !== 45)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t// (f)ill-available, (f)it-content\n\t\t\t\t\tcase 102:\n\t\t\t\t\t\treturn replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value\n\t\t\t\t\t// (s)tretch\n\t\t\t\t\tcase 115:\n\t\t\t\t\t\treturn ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value\n\t\t\t\t}\n\t\t\tbreak\n\t\t// position: sticky\n\t\tcase 4949:\n\t\t\t// (s)ticky?\n\t\t\tif (charat(value, length + 1) !== 115)\n\t\t\t\tbreak\n\t\t// display: (flex|inline-flex)\n\t\tcase 6444:\n\t\t\tswitch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n\t\t\t\t// stic(k)y\n\t\t\t\tcase 107:\n\t\t\t\t\treturn replace(value, ':', ':' + WEBKIT) + value\n\t\t\t\t// (inline-)?fl(e)x\n\t\t\t\tcase 101:\n\t\t\t\t\treturn replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value\n\t\t\t}\n\t\t\tbreak\n\t\t// writing-mode\n\t\tcase 5936:\n\t\t\tswitch (charat(value, length + 11)) {\n\t\t\t\t// vertical-l(r)\n\t\t\t\tcase 114:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value\n\t\t\t\t// vertical-r(l)\n\t\t\t\tcase 108:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value\n\t\t\t\t// horizontal(-)tb\n\t\t\t\tcase 45:\n\t\t\t\t\treturn WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value\n\t\t\t}\n\n\t\t\treturn WEBKIT + value + MS + value + value\n\t}\n\n\treturn value\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && characters.charCodeAt(length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset:\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule) {\n\t\t\t\t\t\t\t\t\t// d m s\n\t\t\t\t\t\t\t\t\tcase 100: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, stringify, COMMENT, rulesheet, middleware, prefixer, serialize, compile } from 'stylis';\nimport '@emotion/weak-memoize';\nimport '@emotion/memoize';\n\nvar last = function last(arr) {\n return arr.length ? arr[arr.length - 1] : null;\n}; // based on https://github.com/thysultan/stylis.js/blob/e6843c373ebcbbfade25ebcc23f540ed8508da0a/src/Tokenizer.js#L239-L244\n\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value,\n parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\nvar ignoreFlag = 'emotion-disable-server-rendering-unsafe-selector-warning-please-do-not-use-this-the-warning-exists-for-a-reason';\n\nvar isIgnoringComment = function isIgnoringComment(element) {\n return !!element && element.type === 'comm' && element.children.indexOf(ignoreFlag) > -1;\n};\n\nvar createUnsafeSelectorsAlarm = function createUnsafeSelectorsAlarm(cache) {\n return function (element, index, children) {\n if (element.type !== 'rule') return;\n var unsafePseudoClasses = element.value.match(/(:first|:nth|:nth-last)-child/g);\n\n if (unsafePseudoClasses && cache.compat !== true) {\n var prevElement = index > 0 ? children[index - 1] : null;\n\n if (prevElement && isIgnoringComment(last(prevElement.children))) {\n return;\n }\n\n unsafePseudoClasses.forEach(function (unsafePseudoClass) {\n console.error(\"The pseudo class \\\"\" + unsafePseudoClass + \"\\\" is potentially unsafe when doing server-side rendering. Try changing it to \\\"\" + unsafePseudoClass.split('-child')[0] + \"-of-type\\\".\");\n });\n }\n };\n};\n\nvar isImportRule = function isImportRule(element) {\n return element.type.charCodeAt(1) === 105 && element.type.charCodeAt(0) === 64;\n};\n\nvar isPrependedWithRegularRules = function isPrependedWithRegularRules(index, children) {\n for (var i = index - 1; i >= 0; i--) {\n if (!isImportRule(children[i])) {\n return true;\n }\n }\n\n return false;\n}; // use this to remove incorrect elements from further processing\n// so they don't get handed to the `sheet` (or anything else)\n// as that could potentially lead to additional logs which in turn could be overhelming to the user\n\n\nvar nullifyElement = function nullifyElement(element) {\n element.type = '';\n element.value = '';\n element[\"return\"] = '';\n element.children = '';\n element.props = '';\n};\n\nvar incorrectImportAlarm = function incorrectImportAlarm(element, index, children) {\n if (!isImportRule(element)) {\n return;\n }\n\n if (element.parent) {\n console.error(\"`@import` rules can't be nested inside other rules. Please move it to the top level and put it before regular rules. Keep in mind that they can only be used within global styles.\");\n nullifyElement(element);\n } else if (isPrependedWithRegularRules(index, children)) {\n console.error(\"`@import` rules can't be after other rules. Please put your `@import` rules before your other rules.\");\n nullifyElement(element);\n }\n};\n\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (process.env.NODE_ENV !== 'production' && !key) {\n throw new Error(\"You have to configure `key` for your cache. Please make sure it's unique (and not equal to 'css') as it's used for linking styles to your cache.\\n\" + \"If multiple caches share the same key they might \\\"fight\\\" for each other's style elements.\");\n }\n\n if ( key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe\n if (/[^a-z-]/.test(key)) {\n throw new Error(\"Emotion key must only contain lower case alphabetical characters and - but \\\"\" + key + \"\\\" was passed\");\n }\n }\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' '); // $FlowFixMe\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (process.env.NODE_ENV !== 'production') {\n omnipresentPlugins.push(createUnsafeSelectorsAlarm({\n get compat() {\n return cache.compat;\n }\n\n }), incorrectImportAlarm);\n }\n\n {\n var currentSheet;\n var finalizingPlugins = [stringify, process.env.NODE_ENV !== 'production' ? function (element) {\n if (!element.root) {\n if (element[\"return\"]) {\n currentSheet.insert(element[\"return\"]);\n } else if (element.value && element.type !== COMMENT) {\n // insert empty rule in non-production environments\n // so @emotion/jest can grab `key` from the (JS)DOM for caches without any rules inserted yet\n currentSheet.insert(element.value + \"{}\");\n }\n }\n } : rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n if (process.env.NODE_ENV !== 'production' && serialized.map !== undefined) {\n currentSheet = {\n insert: function insert(rule) {\n sheet.insert(rule + serialized.map);\n }\n };\n }\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport default createCache;\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length)\n\t\t\t\t\tbreak\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport default murmur2;\n","var unitlessKeys = {\n animationIterationCount: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport default unitlessKeys;\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\nvar UNDEFINED_AS_OBJECT_KEY_ERROR = \"You have passed in falsy value as style object's key (can happen when in example you pass unexported component as computed key).\";\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nif (process.env.NODE_ENV !== 'production') {\n var contentValuePattern = /(var|attr|counters?|url|(((repeating-)?(linear|radial))|conic)-gradient)\\(|(no-)?(open|close)-quote/;\n var contentValues = ['normal', 'none', 'initial', 'inherit', 'unset'];\n var oldProcessStyleValue = processStyleValue;\n var msPattern = /^-ms-/;\n var hyphenPattern = /-(.)/g;\n var hyphenatedCache = {};\n\n processStyleValue = function processStyleValue(key, value) {\n if (key === 'content') {\n if (typeof value !== 'string' || contentValues.indexOf(value) === -1 && !contentValuePattern.test(value) && (value.charAt(0) !== value.charAt(value.length - 1) || value.charAt(0) !== '\"' && value.charAt(0) !== \"'\")) {\n throw new Error(\"You seem to be using a value for 'content' without quotes, try replacing it with `content: '\\\"\" + value + \"\\\"'`\");\n }\n }\n\n var processed = oldProcessStyleValue(key, value);\n\n if (processed !== '' && !isCustomProperty(key) && key.indexOf('-') !== -1 && hyphenatedCache[key] === undefined) {\n hyphenatedCache[key] = true;\n console.error(\"Using kebab-case for css properties in objects is not supported. Did you mean \" + key.replace(msPattern, 'ms-').replace(hyphenPattern, function (str, _char) {\n return _char.toUpperCase();\n }) + \"?\");\n }\n\n return processed;\n };\n}\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n if (interpolation.__emotion_styles !== undefined) {\n if (process.env.NODE_ENV !== 'production' && interpolation.toString() === 'NO_COMPONENT_SELECTOR') {\n throw new Error(noComponentSelectorMessage);\n }\n\n return interpolation;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n if (interpolation.anim === 1) {\n cursor = {\n name: interpolation.name,\n styles: interpolation.styles,\n next: cursor\n };\n return interpolation.name;\n }\n\n if (interpolation.styles !== undefined) {\n var next = interpolation.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = interpolation.styles + \";\";\n\n if (process.env.NODE_ENV !== 'production' && interpolation.map !== undefined) {\n styles += interpolation.map;\n }\n\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('Functions that are interpolated in css calls will be stringified.\\n' + 'If you want to have a css call based on props, create a function that returns a css call like this\\n' + 'let dynamicStyle = (props) => css`color: ${props.color}`\\n' + 'It can be called directly with props or interpolated in a styled call like this\\n' + \"let SomeComponent = styled('div')`${dynamicStyle}`\");\n }\n\n break;\n }\n\n case 'string':\n if (process.env.NODE_ENV !== 'production') {\n var matched = [];\n var replaced = interpolation.replace(animationRegex, function (match, p1, p2) {\n var fakeVarName = \"animation\" + matched.length;\n matched.push(\"const \" + fakeVarName + \" = keyframes`\" + p2.replace(/^@keyframes animation-\\w+/, '') + \"`\");\n return \"${\" + fakeVarName + \"}\";\n });\n\n if (matched.length) {\n console.error('`keyframes` output got interpolated into plain string, please wrap it with `css`.\\n\\n' + 'Instead of doing this:\\n\\n' + [].concat(matched, [\"`\" + replaced + \"`\"]).join('\\n') + '\\n\\nYou should wrap it with `css` like this:\\n\\n' + (\"css`\" + replaced + \"`\"));\n }\n }\n\n break;\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n if (registered == null) {\n return interpolation;\n }\n\n var cached = registered[interpolation];\n return cached !== undefined ? cached : interpolation;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var _key in obj) {\n var value = obj[_key];\n\n if (typeof value !== 'object') {\n if (registered != null && registered[value] !== undefined) {\n string += _key + \"{\" + registered[value] + \"}\";\n } else if (isProcessableValue(value)) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value) + \";\";\n }\n } else {\n if (_key === 'NO_COMPONENT_SELECTOR' && process.env.NODE_ENV !== 'production') {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(_key) + \":\" + processStyleValue(_key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (_key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(_key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n if (process.env.NODE_ENV !== 'production' && _key === 'undefined') {\n console.error(UNDEFINED_AS_OBJECT_KEY_ERROR);\n }\n\n string += _key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;\\n{]+)\\s*(;|$)/g;\nvar sourceMapPattern;\n\nif (process.env.NODE_ENV !== 'production') {\n sourceMapPattern = /\\/\\*#\\ssourceMappingURL=data:application\\/json;\\S+\\s+\\*\\//g;\n} // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\n\nvar cursor;\nvar serializeStyles = function serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n if (process.env.NODE_ENV !== 'production' && strings[0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n if (process.env.NODE_ENV !== 'production' && strings[i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles += strings[i];\n }\n }\n\n var sourceMap;\n\n if (process.env.NODE_ENV !== 'production') {\n styles = styles.replace(sourceMapPattern, function (match) {\n sourceMap = match;\n return '';\n });\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + // $FlowFixMe we know it's not null\n match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n if (process.env.NODE_ENV !== 'production') {\n // $FlowFixMe SerializedStyles type doesn't have toString property (and we don't want to add it)\n return {\n name: name,\n styles: styles,\n map: sourceMap,\n next: cursor,\n toString: function toString() {\n return \"You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).\";\n }\n };\n }\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n};\n\nexport { serializeStyles };\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport default memoize;\n","var isBrowser = \"object\" !== 'undefined';\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false ) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var current = serialized;\n\n do {\n var maybeStyles = cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","import createCache from '@emotion/cache';\nimport { serializeStyles } from '@emotion/serialize';\nimport { getRegisteredStyles, insertStyles } from '@emotion/utils';\n\nfunction insertWithoutScoping(cache, serialized) {\n if (cache.inserted[serialized.name] === undefined) {\n return cache.insert('', serialized, cache.sheet, true);\n }\n}\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar createEmotion = function createEmotion(options) {\n var cache = createCache(options); // $FlowFixMe\n\n cache.sheet.speedy = function (value) {\n if (process.env.NODE_ENV !== 'production' && this.ctr !== 0) {\n throw new Error('speedy must be changed before any rules are inserted');\n }\n\n this.isSpeedy = value;\n };\n\n cache.compat = true;\n\n var css = function css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered, undefined);\n insertStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var keyframes = function keyframes() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n var animation = \"animation-\" + serialized.name;\n insertWithoutScoping(cache, {\n name: serialized.name,\n styles: \"@keyframes \" + animation + \"{\" + serialized.styles + \"}\"\n });\n return animation;\n };\n\n var injectGlobal = function injectGlobal() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n insertWithoutScoping(cache, serialized);\n };\n\n var cx = function cx() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n return {\n css: css,\n cx: cx,\n injectGlobal: injectGlobal,\n keyframes: keyframes,\n hydrate: function hydrate(ids) {\n ids.forEach(function (key) {\n cache.inserted[key] = true;\n });\n },\n flush: function flush() {\n cache.registered = {};\n cache.inserted = {};\n cache.sheet.flush();\n },\n // $FlowFixMe\n sheet: cache.sheet,\n cache: cache,\n getRegisteredStyles: getRegisteredStyles.bind(null, cache.registered),\n merge: merge.bind(null, cache.registered, css)\n };\n};\n\nvar classnames = function classnames(args) {\n var cls = '';\n\n for (var i = 0; i < args.length; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nexport default createEmotion;\n","import createEmotion from '@emotion/css/create-instance'\n\nimport { isBrowser, removeEmptyProps } from './utils'\n\nexport function createTheme(options) {\n if (!options) return null\n let {\n color,\n backgroundColor,\n borderColor,\n borderWidth,\n stripedColor,\n highlightColor,\n cellPadding,\n style,\n\n tableBorderColor = borderColor,\n tableBorderWidth = borderWidth,\n tableStyle,\n\n headerBorderColor = borderColor,\n headerBorderWidth = borderWidth,\n headerStyle,\n\n groupHeaderBorderColor = borderColor,\n groupHeaderBorderWidth = borderWidth,\n groupHeaderStyle,\n\n tableBodyStyle,\n\n rowGroupStyle,\n\n rowStyle,\n rowStripedStyle,\n rowHighlightStyle,\n rowSelectedStyle,\n\n cellBorderColor = borderColor,\n cellBorderWidth = borderWidth,\n cellStyle,\n\n footerBorderColor = borderColor,\n footerBorderWidth = borderWidth,\n footerStyle,\n\n inputStyle,\n filterInputStyle,\n searchInputStyle,\n\n selectStyle,\n\n paginationStyle,\n pageButtonStyle,\n pageButtonHoverStyle,\n pageButtonActiveStyle,\n pageButtonCurrentStyle\n } = options\n\n const expanderColor = getFirstDefinedProp(\n [cellStyle, rowStyle, tableBodyStyle, tableStyle, style],\n 'color',\n color\n )\n const selectColor = getFirstDefinedProp([selectStyle, style], 'color', color)\n\n // Allow easier override of header border width in an outlined/bordered table\n headerBorderWidth = getFirstDefinedProp([headerStyle], 'borderWidth', headerBorderWidth)\n\n let css = {\n style: {\n color,\n backgroundColor,\n ...style\n },\n\n tableStyle: {\n borderColor: tableBorderColor,\n borderWidth: tableBorderWidth,\n ...tableStyle\n },\n\n headerStyle: {\n borderColor: headerBorderColor,\n borderWidth: headerBorderWidth,\n padding: cellPadding,\n ...headerStyle,\n '.rt-bordered &, .rt-outlined &': {\n borderWidth: headerBorderWidth\n }\n },\n\n groupHeaderStyle: {\n // For vertical borders\n borderColor: groupHeaderBorderColor,\n borderWidth: groupHeaderBorderWidth,\n padding: cellPadding,\n ...groupHeaderStyle,\n // For horizontal borders\n '&::after': {\n backgroundColor: groupHeaderBorderColor,\n height: groupHeaderBorderWidth\n },\n '.rt-bordered &': {\n borderWidth: groupHeaderBorderWidth\n }\n },\n\n tableBodyStyle,\n\n rowGroupStyle,\n\n rowStyle: {\n ...rowStyle,\n '&.rt-tr-striped': {\n backgroundColor: stripedColor,\n ...rowStripedStyle\n },\n '&.rt-tr-highlight:hover': {\n backgroundColor: highlightColor,\n ...rowHighlightStyle\n },\n '&.rt-tr-selected': {\n ...rowSelectedStyle\n }\n },\n\n cellStyle: {\n borderColor: cellBorderColor,\n borderWidth: cellBorderWidth,\n padding: cellPadding,\n ...cellStyle\n },\n\n footerStyle: {\n borderColor: footerBorderColor,\n borderWidth: footerBorderWidth,\n padding: cellPadding,\n ...footerStyle\n },\n\n filterCellStyle: {\n borderColor: cellBorderColor,\n borderWidth: cellBorderWidth,\n padding: cellPadding,\n ...cellStyle\n },\n\n expanderStyle: {\n '&::after': {\n borderTopColor: expanderColor\n }\n },\n\n filterInputStyle: {\n ...inputStyle,\n ...filterInputStyle\n },\n\n searchInputStyle: {\n ...inputStyle,\n ...searchInputStyle\n },\n\n paginationStyle: {\n borderTopColor: cellBorderColor,\n borderTopWidth: cellBorderWidth,\n ...paginationStyle,\n\n '.rt-page-jump': {\n ...inputStyle\n },\n\n '.rt-page-size-select': {\n ...selectStyle,\n '@supports (-moz-appearance: none)': {\n backgroundImage:\n selectColor &&\n `url('data:image/svg+xml;charset=US-ASCII,` +\n `` +\n // Colors should be URL encoded since they may contain # or parentheses\n `')`\n }\n },\n\n '.rt-page-button': {\n ...pageButtonStyle\n },\n '.rt-page-button:not(:disabled):hover': {\n ...pageButtonHoverStyle\n },\n '.rt-page-button:not(:disabled):active': {\n ...pageButtonActiveStyle\n },\n '.rt-keyboard-active & .rt-page-button:not(:disabled):focus': {\n ...pageButtonHoverStyle\n },\n '.rt-page-button-current': {\n ...pageButtonCurrentStyle\n }\n }\n }\n\n removeEmptyProps(css)\n\n return css\n}\n\nfunction getFirstDefinedProp(objects, prop, defaultVal) {\n const found = objects.find(x => x && x[prop] != null)\n return found ? found[prop] : defaultVal\n}\n\n// URL encoder that escapes parentheses (for data URLs)\nfunction urlEncode(str) {\n return encodeURIComponent(str).replace('(', '%28').replace(')', '%29')\n}\n\n// Defer Emotion initialization until DOM is loaded and theming is used\nlet emotion\nexport function getEmotion() {\n if (emotion) {\n return emotion\n }\n // Emotion appends style tags to head by default. Instead, we insert styles\n // immediately after the reactable stylesheet for two reasons:\n //\n // 1. Some HTML documents (pkgdown) may place htmlDependencies in the body\n // instead of head, causing Emotion theme styles in head to come before the\n // the reactable stylesheet and not override default styles properly.\n // R Markdown and Shiny put htmlDependencies in head properly.\n // 2. User styles in head may be overrided by the theme since Emotion appends to\n // the end of head, after any existing styles in head. This is not as important\n // as reason 1, however.\n let container\n let insertionPoint\n if (isBrowser()) {\n for (let link of document.querySelectorAll('link')) {\n const filename = link.href.substring(link.href.lastIndexOf('/') + 1)\n if (link.rel === 'stylesheet' && filename === 'reactable.css') {\n container = link.parentElement\n insertionPoint = link\n break\n }\n }\n }\n emotion = createEmotion({\n // Class prefix and unique key to prevent conflicts with other Emotion instances\n key: 'reactable',\n container: container,\n insertionPoint: insertionPoint\n })\n return emotion\n}\n\n// Reset Emotion instance and styles, intended for testing use only\nexport function resetEmotion() {\n if (emotion) {\n emotion.flush()\n emotion = null\n }\n}\n\n// Emotion css wrapper that returns null instead of an unused class\nexport function css(...args) {\n const emotion = getEmotion()\n args = args.filter(arg => arg != null)\n return args.length ? emotion.css(args) : null\n}\n","import React from 'react'\nimport { useGetLatest } from 'react-table'\n\nexport function classNames(...classes) {\n return classes.filter(cls => cls).join(' ')\n}\n\nexport function getFirstDefined(...args) {\n return args.find(x => x != null)\n}\n\n// Recursively remove undefined/null properties and empty objects\nexport function removeEmptyProps(obj) {\n for (let [key, value] of Object.entries(obj)) {\n if (value == null) {\n delete obj[key]\n } else if (typeof value === 'object') {\n removeEmptyProps(value)\n if (Object.keys(value).length === 0) {\n delete obj[key]\n }\n }\n }\n}\n\nexport function escapeRegExp(string) {\n return string.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n// Get leaf columns as an array\nexport function getLeafColumns(column) {\n const leafColumns = []\n const recurseColumn = column => {\n if (column.columns) {\n column.columns.forEach(recurseColumn)\n } else {\n leafColumns.push(column)\n }\n }\n recurseColumn(column)\n return leafColumns\n}\n\n// Convert row data for react-table v6 compatibility\nexport function convertRowsToV6(rows) {\n return rows.map(row => {\n if (row.subRows && row.subRows.length > 0) {\n return { _subRows: convertRowsToV6(row.subRows), ...row.values }\n } else {\n return row.values\n }\n })\n}\n\nexport function rowsToCSV(rows, options = {}) {\n let { columnIds, headers = true, sep = ',', dec = '.' } = options\n const rowToCSV = row => {\n return row\n .map(value => {\n if (value == null) {\n value = ''\n }\n // Serialize dates as ISO strings, all other non-string and non-numeric values as JSON\n if (value instanceof Date) {\n value = value.toISOString()\n } else if (typeof value !== 'string' && typeof value !== 'number') {\n value = JSON.stringify(value)\n } else if (dec !== '.' && typeof value === 'number') {\n value = value.toString().replace('.', dec)\n }\n // Escape CSV-unsafe characters\n if (typeof value === 'string' && (value.includes('\"') || value.includes(sep))) {\n value = `\"${value.replace(/\"/g, '\"\"')}\"`\n }\n return value\n })\n .join(sep)\n }\n let csvRows = []\n if (!columnIds) {\n columnIds = rows.length > 0 ? Object.keys(rows[0]) : []\n }\n if (headers) {\n csvRows.push(rowToCSV(columnIds))\n }\n for (let row of rows) {\n const values = columnIds.map(id => row[id])\n csvRows.push(rowToCSV(values))\n }\n return csvRows.join('\\n') + '\\n'\n}\n\nexport function downloadCSV(content, filename) {\n const blob = new Blob([content], { type: 'text/csv;charset=utf-8' })\n if (window.navigator.msSaveBlob) {\n // For IE11\n window.navigator.msSaveBlob(blob, filename)\n } else {\n const link = document.createElement('a')\n const url = window.URL.createObjectURL(blob)\n link.href = url\n link.download = filename\n link.click()\n window.URL.revokeObjectURL(url)\n }\n}\n\nexport function isBrowser() {\n return typeof document !== 'undefined'\n}\n\n// useAsyncDebounce from react-table without async/await (which seems to be unnecessary anyway)\n// to avoid adding regenerator-runtime to bundle.\nexport function useAsyncDebounce(defaultFn, defaultWait = 0) {\n const debounceRef = React.useRef({})\n\n const getDefaultFn = useGetLatest(defaultFn)\n const getDefaultWait = useGetLatest(defaultWait)\n\n return React.useCallback(\n (...args) => {\n if (!debounceRef.current.promise) {\n debounceRef.current.promise = new Promise((resolve, reject) => {\n debounceRef.current.resolve = resolve\n debounceRef.current.reject = reject\n })\n }\n\n if (debounceRef.current.timeout) {\n clearTimeout(debounceRef.current.timeout)\n }\n\n debounceRef.current.timeout = setTimeout(() => {\n delete debounceRef.current.timeout\n try {\n debounceRef.current.resolve(getDefaultFn()(...args))\n } catch (err) {\n debounceRef.current.reject(err)\n } finally {\n delete debounceRef.current.promise\n }\n }, getDefaultWait())\n\n return debounceRef.current.promise\n },\n [getDefaultFn, getDefaultWait]\n )\n}\n","export const defaultLanguage = {\n // Sorting\n sortLabel: 'Sort {name}',\n\n // Filters\n filterPlaceholder: '',\n filterLabel: 'Filter {name}',\n\n // Search\n searchPlaceholder: 'Search',\n searchLabel: 'Search',\n\n // Tables\n noData: 'No rows found',\n\n // Pagination\n pageNext: 'Next',\n pagePrevious: 'Previous',\n pageNumbers: '{page} of {pages}',\n pageInfo: `{rowStart}${String.fromCharCode(0x2013)}{rowEnd} of {rows} rows`,\n pageSizeOptions: 'Show {rows}',\n pageNextLabel: 'Next page',\n pagePreviousLabel: 'Previous page',\n pageNumberLabel: 'Page {page}',\n pageJumpLabel: 'Go to page',\n pageSizeOptionsLabel: 'Rows per page',\n\n // Column groups\n groupExpandLabel: 'Toggle group',\n\n // Row details\n detailsExpandLabel: 'Toggle details',\n\n // Selection\n selectAllRowsLabel: 'Select all rows',\n selectAllSubRowsLabel: 'Select all rows in group',\n selectRowLabel: 'Select row',\n\n // Deprecated in v0.3.0\n defaultGroupHeader: 'Grouped',\n detailsCollapseLabel: 'Toggle details',\n deselectAllRowsLabel: 'Deselect all rows',\n deselectAllSubRowsLabel: 'Deselect all rows in group',\n deselectRowLabel: 'Deselect row'\n}\n\nexport function renderTemplate(template, params = {}) {\n if (!template || !params) {\n return template\n }\n const keys = Object.keys(params)\n const separator = '(' + keys.map(key => `{${key}}`).join('|') + ')'\n const strings = template.split(new RegExp(separator))\n const templateParams = keys.reduce((obj, key) => {\n obj[`{${key}}`] = params[key]\n return obj\n }, {})\n const rendered = strings.map(s => (templateParams[s] != null ? templateParams[s] : s))\n if (rendered.some(val => typeof val === 'object')) {\n return rendered\n }\n return rendered.join('')\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport { css } from './theme'\nimport { defaultLanguage, renderTemplate } from './language'\nimport { classNames } from './utils'\n\nconst PageButton = ({ isCurrent, className, ...props }) => {\n className = classNames(className, 'rt-page-button', isCurrent ? ' rt-page-button-current' : null)\n return (\n \n )\n}\n\nPageButton.propTypes = {\n isCurrent: PropTypes.bool,\n className: PropTypes.string,\n children: PropTypes.node\n}\n\n// Get visible pages from current page (1-based) and total page count\nexport function getVisiblePages(page, totalPages) {\n // 6 pages or less\n if (totalPages <= 6) {\n return [...Array(totalPages)].map((_, i) => i + 1)\n }\n if (page <= 4) {\n // First 4 pages: 1 2 3 *4* 5 ... 7\n return [1, 2, 3, 4, 5, totalPages]\n } else if (totalPages - page < 3) {\n // Last 3 pages: 1 ... 4 *5* 6 7\n return [1, totalPages - 3, totalPages - 2, totalPages - 1, totalPages]\n } else {\n // Middle 3 pages: 1 ... 4 *5* 6 ... 8\n return [1, page - 1, page, page + 1, totalPages]\n }\n}\n\nexport default class Pagination extends React.Component {\n constructor(props) {\n super(props)\n this.changePage = this.changePage.bind(this)\n this.applyPage = this.applyPage.bind(this)\n this.state = {\n pageJumpValue: props.page + 1,\n prevPage: props.page\n }\n }\n\n static getDerivedStateFromProps(props, state) {\n // Update page jump value if page changes (e.g. from page size change).\n // Track previous page so we only update on prop changes.\n if (props.page !== state.prevPage) {\n return {\n pageJumpValue: props.page + 1,\n prevPage: props.page\n }\n }\n return null\n }\n\n changePage(newPage) {\n const currentPage = this.props.page + 1\n if (newPage === currentPage) {\n return\n }\n this.props.onPageChange(newPage - 1)\n }\n\n applyPage(e) {\n if (e) {\n e.preventDefault()\n }\n const newPage = this.state.pageJumpValue\n if (newPage !== '') {\n this.changePage(newPage)\n } else {\n // Reset page jump if new value is blank or invalid. (Some browsers\n // allow non-numeric characters with input type=\"number\").\n const currentPage = this.props.page + 1\n this.setState({ pageJumpValue: currentPage })\n }\n }\n\n renderPageInfo({ page, pageSize, pageRowCount, rowCount, language }) {\n const rowStart = Math.min(page * pageSize + 1, rowCount)\n // When pagination is disabled, pageSize is unused and the number of rows\n // on the page can exceed the page size.\n const rowEnd = Math.max(Math.min(page * pageSize + pageSize, rowCount), pageRowCount)\n const pageInfo = renderTemplate(language.pageInfo, { rowStart, rowEnd, rows: rowCount })\n return
{pageInfo}
\n }\n\n renderPageSizeOptions({ pageSize, pageSizeOptions, onPageSizeChange, language }) {\n const selector = (\n onPageSizeChange(Number(e.target.value))}\n value={pageSize}\n >\n {pageSizeOptions.map((option, i) => (\n \n ))}\n \n )\n const elements = renderTemplate(language.pageSizeOptions, { rows: selector })\n return
{elements}
\n }\n\n renderPageJump({ onChange, value, onBlur, onKeyPress, inputType, language }) {\n return (\n \n )\n }\n\n getPageJumpProperties() {\n return {\n onKeyPress: e => {\n if (e.which === 13 || e.keyCode === 13) {\n this.applyPage()\n }\n },\n onBlur: this.applyPage,\n value: this.state.pageJumpValue,\n onChange: e => {\n const value = e.target.value\n if (value === '') {\n this.setState({ pageJumpValue: value })\n return\n }\n const newPage = Number(value)\n if (!Number.isNaN(newPage)) {\n const nearestValidPage = Math.min(Math.max(newPage, 1), Math.max(this.props.pages, 1))\n this.setState({ pageJumpValue: nearestValidPage })\n }\n },\n inputType: 'number',\n language: this.props.language\n }\n }\n\n render() {\n const {\n paginationType,\n showPageSizeOptions,\n showPageInfo,\n page,\n pages,\n canPrevious,\n canNext,\n theme,\n language\n } = this.props\n\n const pageInfo = showPageInfo ? this.renderPageInfo(this.props) : null\n const pageSizeOptions = showPageSizeOptions ? this.renderPageSizeOptions(this.props) : null\n\n const currentPage = page + 1\n const visiblePages = getVisiblePages(currentPage, pages)\n\n let pageNumbers\n if (paginationType === 'numbers') {\n let pageButtons = []\n visiblePages.forEach((page, index) => {\n const isCurrent = currentPage === page\n const pageButton = (\n \n {page}\n \n )\n if (page - visiblePages[index - 1] > 1) {\n pageButtons.push(\n \n ...\n \n )\n }\n pageButtons.push(pageButton)\n })\n pageNumbers = pageButtons\n } else {\n const page =\n paginationType === 'jump' ? this.renderPageJump(this.getPageJumpProperties()) : currentPage\n const totalPages = Math.max(pages, 1)\n pageNumbers = (\n
\n {renderTemplate(language.pageNumbers, { page, pages: totalPages })}\n
\n )\n }\n\n const prevButton = (\n {\n if (!canPrevious) return\n this.changePage(currentPage - 1)\n }}\n disabled={!canPrevious}\n aria-disabled={!canPrevious ? 'true' : null}\n aria-label={language.pagePreviousLabel}\n >\n {language.pagePrevious}\n \n )\n\n const nextButton = (\n {\n if (!canNext) return\n this.changePage(currentPage + 1)\n }}\n disabled={!canNext}\n aria-disabled={!canNext ? 'true' : null}\n aria-label={language.pageNextLabel}\n >\n {language.pageNext}\n \n )\n\n return (\n
\n
\n {pageInfo}\n {pageSizeOptions}\n
\n\n
\n {prevButton}\n {pageNumbers}\n {nextButton}\n
\n
\n )\n }\n}\n\nPagination.propTypes = {\n paginationType: PropTypes.oneOf(['numbers', 'jump', 'simple']),\n pageSizeOptions: PropTypes.arrayOf(PropTypes.number),\n showPageSizeOptions: PropTypes.bool,\n showPageInfo: PropTypes.bool,\n page: PropTypes.number.isRequired,\n pages: PropTypes.number.isRequired,\n pageSize: PropTypes.number.isRequired,\n pageRowCount: PropTypes.number.isRequired,\n canPrevious: PropTypes.bool.isRequired,\n canNext: PropTypes.bool.isRequired,\n onPageChange: PropTypes.func.isRequired,\n onPageSizeChange: PropTypes.func.isRequired,\n rowCount: PropTypes.number.isRequired,\n theme: PropTypes.shape({\n paginationStyle: PropTypes.object\n }),\n language: PropTypes.shape({\n pageNext: PropTypes.string,\n pagePrevious: PropTypes.string,\n pageNumbers: PropTypes.string,\n pageInfo: PropTypes.string,\n pageSizeOptions: PropTypes.string,\n pageNextLabel: PropTypes.string,\n pagePreviousLabel: PropTypes.string,\n pageNumberLabel: PropTypes.string,\n pageJumpLabel: PropTypes.string,\n pageSizeOptionsLabel: PropTypes.string\n })\n}\n\nPagination.defaultProps = {\n paginationType: 'numbers',\n pageSizeOptions: [10, 25, 50, 100],\n showPageInfo: true,\n language: defaultLanguage\n}\n","import React from 'react'\nimport PropTypes from 'prop-types'\n\nimport { isBrowser } from './utils'\n\nexport default class WidgetContainer extends React.Component {\n componentDidMount() {\n this.staticRender()\n }\n\n staticRender() {\n if (!window.HTMLWidgets) {\n return\n }\n if (!WidgetContainer.throttled) {\n window.HTMLWidgets.staticRender()\n // Throttle static rendering since it targets the entire document\n WidgetContainer.throttled = true\n if (typeof setTimeout !== 'undefined') {\n setTimeout(() => {\n if (WidgetContainer.lastCall) {\n window.HTMLWidgets.staticRender()\n }\n WidgetContainer.throttled = false\n WidgetContainer.lastCall = false\n })\n }\n } else {\n WidgetContainer.lastCall = true\n }\n }\n\n render() {\n // Don't serialize HTML widget HTML/scripts when server-side rendering:\n // 1. Most HTML widgets are client-side rendered and wouldn't benefit much from SSR.\n // 2. This keeps the initial HTML payload slim, as the widget script data would be\n // unnecessarily duplicated.\n // 3. Problems can occur when multiple instances of the same HTML widget type\n // are embedded in different tables, and the global HTMLWidgets.staticRender()\n // renders HTML widgets in other tables before those other tables are hydrated\n // (each table lives in its own React root). When other tables are hydrated,\n // the HTML widgets there will get wiped out, but not rerendered on the next\n // staticRender() because the root widget element is already marked as\n // html-widget-static-bound. This also helps keep the initial HTML payload slim,\n // as the widget script data would get unnecessarily duplicated.\n if (!isBrowser()) {\n return null\n }\n return this.props.children\n }\n}\n\nWidgetContainer.propTypes = {\n children: PropTypes.node\n}\n","// useFlexLayout modified to:\n// - Fix flex widths when resizing is disabled (don't use column.totalFlexWidth)\n// - Support resizing to actual min and max column widths (not flex widths)\n// - Set min width on thead/tbody/tfoot instead of table for responsive, horizontal scrolling.\n// Tables should use the new instance.getTheadProps and instance.getTfootProps for this.\n// - Include resized widths in table min width to prevent glitches with sticky headers/footers\n// - Exclude redundant styles\n\nimport { useGetLatest, makePropGetter } from 'react-table'\n\nexport default function useFlexLayout(hooks) {\n hooks.getTheadProps = [getRowGroupStyles]\n hooks.getTfootProps = [getRowGroupStyles]\n hooks.getTableBodyProps.push(getRowGroupStyles)\n hooks.getRowProps.push(getRowStyles)\n hooks.getHeaderGroupProps.push(getRowStyles)\n hooks.getFooterGroupProps.push(getRowStyles)\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getCellProps.push(getCellProps)\n hooks.getFooterProps.push(getFooterProps)\n hooks.useInstance.push(useInstance)\n}\n\nuseFlexLayout.pluginName = 'useFlexLayout'\n\n// Set min-width for thead and tfoot. Include resized widths in min width\n// (using totalColumnsWidth over totalColumnsMinWidth) so cells don't overlap\n// with sticky headers and footers when the total resized width is greater than\n// the total min width.\nconst getRowGroupStyles = (props, { instance }) => {\n return [\n props,\n {\n style: {\n minWidth: asPx(instance.totalColumnsWidth)\n }\n }\n ]\n}\n\nconst getRowStyles = (props, { instance }) => {\n return [\n props,\n {\n style: {\n flex: '1 0 auto',\n minWidth: asPx(instance.totalColumnsWidth)\n }\n }\n ]\n}\n\nconst getHeaderProps = (props, { column }) => {\n // Don't set max width if MAX_SAFE_INTEGER (the default for column.maxWidth)\n const maxWidth = column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${column.flexWidth} 0 auto`,\n minWidth: asPx(column.totalMinWidth),\n width: asPx(column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nconst getCellProps = (props, { cell }) => {\n const maxWidth =\n cell.column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? cell.column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${cell.column.flexWidth} 0 auto`,\n minWidth: asPx(cell.column.totalMinWidth),\n width: asPx(cell.column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nconst getFooterProps = (props, { column }) => {\n const maxWidth = column.totalMaxWidth < Number.MAX_SAFE_INTEGER ? column.totalMaxWidth : null\n return [\n props,\n {\n style: {\n flex: `${column.flexWidth} 0 auto`,\n minWidth: asPx(column.totalMinWidth),\n width: asPx(column.totalWidth),\n maxWidth: asPx(maxWidth)\n }\n }\n ]\n}\n\nfunction useInstance(instance) {\n const { headers, state, getHooks } = instance\n\n const resizedWidths = state.columnResizing.columnWidths\n\n // Manually calculate flex widths instead of using column.totalFlexWidth\n function calculateFlexWidths(columns) {\n let totalFlexWidth = 0\n columns.forEach(column => {\n if (column.headers) {\n column.flexWidth = calculateFlexWidths(column.headers)\n } else {\n // If the column has been resized or has fixed width, flex width = 0.\n // Otherwise, flex width = min width.\n if (resizedWidths[column.id] != null) {\n column.flexWidth = 0\n } else {\n const isFixedWidth = column.totalMinWidth === column.totalMaxWidth\n column.flexWidth = isFixedWidth ? 0 : column.totalMinWidth\n }\n }\n if (column.isVisible) {\n totalFlexWidth += column.flexWidth\n }\n })\n return totalFlexWidth\n }\n\n calculateFlexWidths(headers)\n\n const getInstance = useGetLatest(instance)\n const getTheadProps = makePropGetter(getHooks().getTheadProps, { instance: getInstance() })\n const getTfootProps = makePropGetter(getHooks().getTfootProps, { instance: getInstance() })\n\n Object.assign(instance, {\n getTheadProps,\n getTfootProps\n })\n}\n\nfunction asPx(value) {\n return typeof value === 'number' ? `${value}px` : undefined\n}\n","import { ensurePluginOrder } from 'react-table'\n\nimport { getLeafColumns } from './utils'\n\nexport default function useStickyColumns(hooks) {\n hooks.getHeaderProps.push(getHeaderProps)\n hooks.getCellProps.push(getCellProps)\n hooks.getFooterProps.push(getFooterProps)\n hooks.useInstance.push(useInstance)\n}\n\nuseStickyColumns.pluginName = 'useStickyColumns'\n\nconst getHeaderProps = (props, { column }) => {\n if (!column.stickyProps) {\n return props\n }\n return [props, column.stickyProps]\n}\n\nconst getCellProps = (props, { cell }) => {\n if (!cell.column.stickyProps) {\n return props\n }\n return [props, cell.column.stickyProps]\n}\n\nconst getFooterProps = (props, { column }) => {\n if (!column.stickyProps) {\n return props\n }\n return [props, column.stickyProps]\n}\n\nconst getStickyProps = (column, columns) => {\n const props = {\n className: 'rt-sticky',\n style: {\n position: 'sticky'\n }\n }\n if (column.sticky === 'left') {\n const stickyCols = columns.filter(col => col.sticky === 'left')\n props.style.left = 0\n for (let col of stickyCols) {\n if (col.id === column.id) break\n props.style.left += col.totalWidth\n }\n } else if (column.sticky === 'right') {\n const stickyCols = columns.filter(col => col.sticky === 'right')\n props.style.right = 0\n for (let col of stickyCols.reverse()) {\n if (col.id === column.id) break\n props.style.right += col.totalWidth\n }\n }\n return props\n}\n\nfunction useInstance(instance) {\n const { plugins, headerGroups } = instance\n\n ensurePluginOrder(plugins, ['useResizeColumns'], 'useStickyColumns')\n\n headerGroups.forEach(headerGroup => {\n const columns = headerGroup.headers\n\n // Ensure all columns in the group have the same sticky property.\n // If any sticky properties in the group differ, the first sticky column's\n // property is used for the whole group.\n columns.forEach(column => {\n const groupColumns = [column]\n if (column.columns) {\n groupColumns.push(...getLeafColumns(column))\n }\n const firstStickyCol = groupColumns.find(col => col.sticky)\n if (firstStickyCol) {\n groupColumns.forEach(col => {\n col.sticky = firstStickyCol.sticky\n })\n }\n })\n\n columns.forEach(column => {\n if (column.sticky) {\n column.stickyProps = getStickyProps(column, columns)\n }\n })\n })\n}\n","// useGroupBy hook modified to:\n// - Pass row objects and aggregated row objects to aggregate functions\n// - Include groupBy columns in aggregations\n// - Set nesting depth for leaf rows\n// - Omit row index properties on aggregated rows\n\nimport React from 'react'\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nimport { getFirstDefined } from './utils'\n\n// Not using any built-in aggregations\nconst aggregations = {}\n\nconst emptyArray = []\nconst emptyObject = {}\n\n// Actions\nactions.resetGroupBy = 'resetGroupBy'\nactions.setGroupBy = 'setGroupBy'\nactions.toggleGroupBy = 'toggleGroupBy'\n\nexport default function useGroupBy(hooks) {\n hooks.getGroupByToggleProps = [defaultGetGroupByToggleProps]\n hooks.stateReducers.push(reducer)\n hooks.visibleColumnsDeps.push((deps, { instance }) => [...deps, instance.state.groupBy])\n hooks.visibleColumns.push(visibleColumns)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseGroupBy.pluginName = 'useGroupBy'\n\nconst defaultGetGroupByToggleProps = (props, { header }) => [\n props,\n {\n onClick: header.canGroupBy\n ? e => {\n e.persist()\n header.toggleGroupBy()\n }\n : undefined,\n style: {\n cursor: header.canGroupBy ? 'pointer' : undefined\n },\n title: 'Toggle GroupBy'\n }\n]\n\n// Reducer\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n groupBy: [],\n ...state\n }\n }\n\n if (action.type === actions.resetGroupBy) {\n return {\n ...state,\n groupBy: instance.initialState.groupBy || []\n }\n }\n\n if (action.type === actions.setGroupBy) {\n const { value } = action\n return {\n ...state,\n groupBy: value\n }\n }\n\n if (action.type === actions.toggleGroupBy) {\n const { columnId, value: setGroupBy } = action\n\n const resolvedGroupBy =\n typeof setGroupBy !== 'undefined' ? setGroupBy : !state.groupBy.includes(columnId)\n\n if (resolvedGroupBy) {\n return {\n ...state,\n groupBy: [...state.groupBy, columnId]\n }\n }\n\n return {\n ...state,\n groupBy: state.groupBy.filter(d => d !== columnId)\n }\n }\n}\n\nfunction visibleColumns(\n columns,\n {\n instance: {\n state: { groupBy }\n }\n }\n) {\n // Sort grouped columns to the start of the column list\n // before the headers are built\n\n const groupByColumns = groupBy.map(g => columns.find(col => col.id === g)).filter(Boolean)\n\n const nonGroupByColumns = columns.filter(col => !groupBy.includes(col.id))\n\n columns = [...groupByColumns, ...nonGroupByColumns]\n\n columns.forEach(column => {\n column.isGrouped = groupBy.includes(column.id)\n column.groupedIndex = groupBy.indexOf(column.id)\n })\n\n return columns\n}\n\nconst defaultUserAggregations = {}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n flatRows,\n rowsById,\n allColumns,\n flatHeaders,\n groupByFn = defaultGroupByFn,\n manualGroupBy,\n aggregations: userAggregations = defaultUserAggregations,\n plugins,\n state: { groupBy },\n dispatch,\n autoResetGroupBy = true,\n disableGroupBy,\n defaultCanGroupBy,\n getHooks\n } = instance\n\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useGroupBy')\n\n const getInstance = useGetLatest(instance)\n\n allColumns.forEach(column => {\n const {\n accessor,\n defaultGroupBy: defaultColumnGroupBy,\n disableGroupBy: columnDisableGroupBy\n } = column\n\n column.canGroupBy = accessor\n ? getFirstDefined(\n column.canGroupBy,\n columnDisableGroupBy === true ? false : undefined,\n disableGroupBy === true ? false : undefined,\n true\n )\n : getFirstDefined(column.canGroupBy, defaultColumnGroupBy, defaultCanGroupBy, false)\n\n if (column.canGroupBy) {\n column.toggleGroupBy = () => instance.toggleGroupBy(column.id)\n }\n\n column.Aggregated = column.Aggregated || column.Cell\n })\n\n const toggleGroupBy = React.useCallback(\n (columnId, value) => {\n dispatch({ type: actions.toggleGroupBy, columnId, value })\n },\n [dispatch]\n )\n\n const setGroupBy = React.useCallback(\n value => {\n dispatch({ type: actions.setGroupBy, value })\n },\n [dispatch]\n )\n\n flatHeaders.forEach(header => {\n header.getGroupByToggleProps = makePropGetter(getHooks().getGroupByToggleProps, {\n instance: getInstance(),\n header\n })\n })\n\n const [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById\n ] = React.useMemo(() => {\n if (groupBy.length === 0) {\n return [rows, flatRows, rowsById, emptyArray, emptyObject, flatRows, rowsById]\n }\n\n if (manualGroupBy) {\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g => allColumns.find(col => col.id === g))\n\n // Derive grouping props in each row that aren't present in manually grouped data.\n // Note that this excludes groupByVal and leafRows.\n const setGroupingProps = (rows, depth = 0) => {\n // Set nesting depth\n rows.forEach(row => {\n row.depth = depth\n })\n\n // Last level - these are leaf rows\n if (depth === existingGroupBy.length) {\n return\n }\n\n const columnId = existingGroupBy[depth]\n\n // Find the columns that can be aggregated, including any columns in groupBy.\n // groupBy columns that aren't in the row's group are allowed to be aggregated.\n const groupedColumns = existingGroupBy.slice(0, depth + 1)\n const aggregatedColumns = allColumns\n .filter(col => !groupedColumns.includes(col.id))\n .map(col => col.id)\n\n rows.forEach(row => {\n if (!row.isGrouped) {\n return\n }\n\n // Required but unset: row.groupByID, row.isGrouped\n row.groupByID = columnId\n // All columns that can be aggregated (including groupBy columns)\n row.aggregatedColumns = aggregatedColumns\n setGroupingProps(row.subRows, depth + 1)\n })\n }\n\n const flatRows = rows.filter(row => row.parentId == null)\n setGroupingProps(flatRows)\n\n return [rows, flatRows, rowsById, emptyArray, emptyObject, flatRows, rowsById]\n }\n\n // Ensure that the list of filtered columns exist\n const existingGroupBy = groupBy.filter(g => allColumns.find(col => col.id === g))\n\n // Find the columns that can or are aggregating\n // Uses each column to aggregate rows into a single value\n const aggregateRowsToValues = (leafRows, groupedRows, depth, aggregatedColumns) => {\n const values = {}\n\n allColumns.forEach(column => {\n // Only aggregate columns that aren't being grouped. Originally, all groupBy\n // columns were excluded, but now, groupBy columns not in the row's group\n // may be aggregated.\n if (!aggregatedColumns.includes(column.id)) {\n // Set placeholder values\n values[column.id] = groupedRows[0] ? groupedRows[0].values[column.id] : null\n return\n }\n\n // Get the columnValues to aggregate (no longer used)\n // const groupedValues = groupedRows.map(row => row.values[column.id])\n\n // Aggregate the values\n let aggregateFn =\n typeof column.aggregate === 'function'\n ? column.aggregate\n : userAggregations[column.aggregate] || aggregations[column.aggregate]\n\n if (aggregateFn) {\n // Get the columnValues to aggregate\n const leafValues = leafRows.map(row => {\n let columnValue = row.values[column.id]\n\n if (!depth && column.aggregateValue) {\n const aggregateValueFn =\n typeof column.aggregateValue === 'function'\n ? column.aggregateValue\n : userAggregations[column.aggregateValue] || aggregations[column.aggregateValue]\n\n if (!aggregateValueFn) {\n console.info({ column })\n throw new Error(\n `React Table: Invalid column.aggregateValue option for column listed above`\n )\n }\n\n columnValue = aggregateValueFn(columnValue, row, column)\n }\n return columnValue\n })\n\n // Originally, the leafValues and groupedValues were passed to the aggregate function.\n // Now, the aggregate function takes:\n // - leafValues: flattened array of values in the column\n // - leafRows: flattened array of rows in the column (for v6 compatibility)\n // - groupedRows: array of aggregated rows in the column\n values[column.id] = aggregateFn(\n leafValues,\n leafRows.map(row => row.values),\n groupedRows.map(row => row.values)\n )\n } else if (column.aggregate) {\n console.info({ column })\n throw new Error(`React Table: Invalid column.aggregate option for column listed above`)\n } else {\n values[column.id] = null\n }\n })\n\n return values\n }\n\n let groupedFlatRows = []\n const groupedRowsById = {}\n const onlyGroupedFlatRows = []\n const onlyGroupedRowsById = {}\n const nonGroupedFlatRows = []\n const nonGroupedRowsById = {}\n\n // Recursively group the data\n const groupUpRecursively = (rows, depth = 0, parentId) => {\n // This is the last level, just return the rows\n if (depth === existingGroupBy.length) {\n // Set nesting depth for leaf rows\n rows.forEach(row => {\n row.depth = depth\n })\n return rows\n }\n\n const columnId = existingGroupBy[depth]\n\n // Group the rows together for this level\n let rowGroupsMap = groupByFn(rows, columnId)\n\n // Peform aggregations for each group\n const aggregatedGroupedRows = Object.entries(rowGroupsMap).map(\n ([groupByVal, groupedRows], index) => {\n let id = `${columnId}:${groupByVal}`\n id = parentId ? `${parentId}>${id}` : id\n\n // First, Recurse to group sub rows before aggregation\n const subRows = groupUpRecursively(groupedRows, depth + 1, id)\n\n // Flatten the leaf rows of the rows in this group\n const leafRows = depth ? flattenBy(groupedRows, 'leafRows') : groupedRows\n\n // Find the columns that can be aggregated, including any columns in\n // groupBy. Originally, no groupBy columns were aggregated. Now we\n // aggregate groupBy columns that aren't in the row's group.\n const groupedColumns = existingGroupBy.slice(0, depth + 1)\n const aggregatedColumns = allColumns\n .filter(col => !groupedColumns.includes(col.id))\n .map(col => col.id)\n\n // Originally, groupedRows were passed here, which were the same as\n // the leafRows. Now, the subRows are passed, which contain the aggregated\n // values of the immediate child rows.\n const values = aggregateRowsToValues(leafRows, subRows, depth, aggregatedColumns)\n\n const row = {\n id,\n isGrouped: true,\n groupByID: columnId,\n groupByVal,\n values,\n subRows,\n leafRows,\n depth,\n // Originally, aggregated rows had a row index corresponding to the index within\n // rowGroupsMap. This row index doesn't map to a valid data row and overlaps\n // with the leaf rows, so explicitly omit it.\n // index: undefined,\n index: undefined,\n groupIndex: index,\n // All columns that can be aggregated (including groupBy columns)\n aggregatedColumns\n }\n\n subRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n return row\n }\n )\n\n return aggregatedGroupedRows\n }\n\n const groupedRows = groupUpRecursively(rows)\n\n groupedRows.forEach(subRow => {\n groupedFlatRows.push(subRow)\n groupedRowsById[subRow.id] = subRow\n if (subRow.isGrouped) {\n onlyGroupedFlatRows.push(subRow)\n onlyGroupedRowsById[subRow.id] = subRow\n } else {\n nonGroupedFlatRows.push(subRow)\n nonGroupedRowsById[subRow.id] = subRow\n }\n })\n\n // Assign the new data\n return [\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById\n ]\n }, [manualGroupBy, groupBy, rows, flatRows, rowsById, allColumns, userAggregations, groupByFn])\n\n const getAutoResetGroupBy = useGetLatest(autoResetGroupBy)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetGroupBy()) {\n dispatch({ type: actions.resetGroupBy })\n }\n }, [dispatch, manualGroupBy ? null : data])\n\n Object.assign(instance, {\n preGroupedRows: rows,\n preGroupedFlatRow: flatRows,\n preGroupedRowsById: rowsById,\n groupedRows,\n groupedFlatRows,\n groupedRowsById,\n onlyGroupedFlatRows,\n onlyGroupedRowsById,\n nonGroupedFlatRows,\n nonGroupedRowsById,\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById,\n toggleGroupBy,\n setGroupBy\n })\n}\n\nfunction prepareRow(row) {\n row.allCells.forEach(cell => {\n // Grouped cells are in the groupBy and the pivot cell for the row\n cell.isGrouped = cell.column.isGrouped && cell.column.id === row.groupByID\n\n // Aggregated cells are not grouped, not repeated, but still have subRows\n cell.isAggregated =\n !cell.isGrouped && row.aggregatedColumns?.includes(cell.column.id) && row.subRows?.length\n\n // Placeholder cells are any columns in the groupBy that are not grouped or aggregated\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped && !cell.isAggregated\n })\n}\n\nexport function defaultGroupByFn(rows, columnId) {\n return rows.reduce((prev, row) => {\n // TODO: Might want to implement a key serializer here so\n // irregular column values can still be grouped if needed?\n const resKey = `${row.values[columnId]}`\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : []\n prev[resKey].push(row)\n return prev\n }, {})\n}\n\nfunction flattenBy(arr, key) {\n const flat = []\n\n const recurse = arr => {\n arr.forEach(d => {\n if (!d[key]) {\n flat.push(d)\n } else {\n recurse(d[key])\n }\n })\n }\n\n recurse(arr)\n\n return flat\n}\n","// useResizeColumns modified to:\n// - Resize based on actual DOM width of column, like in v6. Requires a\n// getDOMWidth() method to be defined on each column header and header group.\n// - Clean up touchend listeners properly (https://github.com/tannerlinsley/react-table/issues/2622)\n// - Optimize number of calls to dispatch (https://github.com/tannerlinsley/react-table/pull/3231)\n\nimport React from 'react'\nimport {\n actions,\n defaultColumn,\n makePropGetter,\n ensurePluginOrder,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nimport { getFirstDefined } from './utils'\n\nlet passiveSupported = null\nfunction passiveEventSupported() {\n // memoize support to avoid adding multiple test events\n if (typeof passiveSupported === 'boolean') return passiveSupported\n\n let supported = false\n try {\n const options = {\n get passive() {\n supported = true\n return false\n }\n }\n\n window.addEventListener('test', null, options)\n window.removeEventListener('test', null, options)\n } catch (err) {\n supported = false\n }\n passiveSupported = supported\n return passiveSupported\n}\n\n// Default Column\ndefaultColumn.canResize = true\n\n// Actions\nactions.columnStartResizing = 'columnStartResizing'\nactions.columnResizing = 'columnResizing'\nactions.columnDoneResizing = 'columnDoneResizing'\nactions.resetResize = 'resetResize'\n\nexport default function useResizeColumns(hooks) {\n hooks.getResizerProps = [defaultGetResizerProps]\n hooks.getHeaderProps.push({\n style: {\n position: 'relative'\n }\n })\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions)\n}\n\nconst defaultGetResizerProps = (props, { instance, header }) => {\n const { dispatch } = instance\n\n const onResizeStart = (e, header) => {\n let isTouchEvent = false\n if (e.type === 'touchstart') {\n // lets not respond to multiple touches (e.g. 2 or 3 fingers)\n if (e.touches && e.touches.length > 1) {\n return\n }\n isTouchEvent = true\n }\n const headersToResize = getAllColumns(header)\n const headerIdWidths = headersToResize.map(d => [d.id, d.getDOMWidth()])\n const columnWidth = headerIdWidths.find(([id]) => id === header.id)[1]\n\n const clientX = isTouchEvent ? Math.round(e.touches[0].clientX) : e.clientX\n\n let raf\n let mostRecentClientX\n\n const dispatchMove = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnResizing, clientX: mostRecentClientX })\n }\n const dispatchEnd = () => {\n window.cancelAnimationFrame(raf)\n raf = null\n dispatch({ type: actions.columnDoneResizing })\n }\n\n const scheduleDispatchMoveOnNextAnimationFrame = clientXPos => {\n mostRecentClientX = clientXPos\n if (!raf) {\n raf = window.requestAnimationFrame(dispatchMove)\n }\n }\n\n const handlersAndEvents = {\n mouse: {\n moveEvent: 'mousemove',\n moveHandler: e => scheduleDispatchMoveOnNextAnimationFrame(e.clientX),\n upEvent: 'mouseup',\n upHandler: () => {\n document.removeEventListener('mousemove', handlersAndEvents.mouse.moveHandler)\n document.removeEventListener('mouseup', handlersAndEvents.mouse.upHandler)\n dispatchEnd()\n }\n },\n touch: {\n moveEvent: 'touchmove',\n moveHandler: e => {\n if (e.cancelable) {\n e.preventDefault()\n e.stopPropagation()\n }\n scheduleDispatchMoveOnNextAnimationFrame(e.touches[0].clientX)\n return false\n },\n upEvent: 'touchend',\n upHandler: () => {\n document.removeEventListener(\n handlersAndEvents.touch.moveEvent,\n handlersAndEvents.touch.moveHandler\n )\n document.removeEventListener(\n handlersAndEvents.touch.upEvent,\n handlersAndEvents.touch.upHandler\n )\n dispatchEnd()\n }\n }\n }\n\n const events = isTouchEvent ? handlersAndEvents.touch : handlersAndEvents.mouse\n const passiveIfSupported = passiveEventSupported() ? { passive: false } : false\n document.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported)\n document.addEventListener(events.upEvent, events.upHandler, passiveIfSupported)\n\n dispatch({\n type: actions.columnStartResizing,\n columnId: header.id,\n columnWidth,\n headerIdWidths,\n clientX\n })\n }\n\n return [\n props,\n {\n onMouseDown: e => e.persist() || onResizeStart(e, header),\n onTouchStart: e => e.persist() || onResizeStart(e, header),\n style: {\n cursor: 'col-resize'\n },\n draggable: false,\n role: 'separator'\n }\n ]\n}\n\nuseResizeColumns.pluginName = 'useResizeColumns'\n\nfunction reducer(state, action) {\n if (action.type === actions.init) {\n return {\n columnResizing: {\n columnWidths: {}\n },\n ...state\n }\n }\n\n if (action.type === actions.resetResize) {\n return {\n ...state,\n columnResizing: {\n columnWidths: {}\n }\n }\n }\n\n if (action.type === actions.columnStartResizing) {\n const { clientX, columnId, columnWidth, headerIdWidths } = action\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: clientX,\n headerIdWidths,\n columnWidth,\n isResizingColumn: columnId\n }\n }\n }\n\n if (action.type === actions.columnResizing) {\n const { clientX } = action\n const { startX, columnWidth, headerIdWidths = [] } = state.columnResizing\n\n const deltaX = clientX - startX\n const percentageDeltaX = deltaX / columnWidth\n\n const newColumnWidths = {}\n\n headerIdWidths.forEach(([headerId, headerWidth]) => {\n newColumnWidths[headerId] = Math.max(headerWidth + headerWidth * percentageDeltaX, 0)\n })\n\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n columnWidths: {\n ...state.columnResizing.columnWidths,\n ...newColumnWidths\n }\n }\n }\n }\n\n if (action.type === actions.columnDoneResizing) {\n return {\n ...state,\n columnResizing: {\n ...state.columnResizing,\n startX: null,\n isResizingColumn: null\n }\n }\n }\n}\n\nconst useInstanceBeforeDimensions = instance => {\n const {\n flatHeaders,\n disableResizing,\n getHooks,\n state: { columnResizing }\n } = instance\n\n const getInstance = useGetLatest(instance)\n\n flatHeaders.forEach(header => {\n const canResize = getFirstDefined(\n header.disableResizing === true ? false : undefined,\n disableResizing === true ? false : undefined,\n true\n )\n\n header.canResize = canResize\n header.width = getFirstDefined(\n columnResizing.columnWidths[header.id],\n header.originalWidth,\n header.width\n )\n header.isResizing = columnResizing.isResizingColumn === header.id\n\n if (canResize) {\n header.getResizerProps = makePropGetter(getHooks().getResizerProps, {\n instance: getInstance(),\n header\n })\n }\n })\n}\n\nfunction useInstance(instance) {\n const { plugins, dispatch, autoResetResize = true, columns } = instance\n\n ensurePluginOrder(plugins, ['useAbsoluteLayout'], 'useResizeColumns')\n\n const getAutoResetResize = useGetLatest(autoResetResize)\n useMountedLayoutEffect(() => {\n if (getAutoResetResize()) {\n dispatch({ type: actions.resetResize })\n }\n }, [columns])\n\n const resetResizing = React.useCallback(() => dispatch({ type: actions.resetResize }), [dispatch])\n\n Object.assign(instance, {\n resetResizing\n })\n}\n\nfunction getAllColumns(column) {\n const allColumns = []\n const recurseColumn = column => {\n if (column.columns && column.columns.length) {\n column.columns.forEach(recurseColumn)\n }\n allColumns.push(column)\n }\n recurseColumn(column)\n return allColumns\n}\n","// useRowSelect hook modified to:\n// - Set row.isSelected for sub rows when paginateExpandedRows = false\n// (https://github.com/TanStack/react-table/issues/2908)\n// - Include an instance.setRowsSelected() function to set selected rows.\n// This is also useful to clear all selection, since toggleAllRowsSelected()\n// only affects visible rows, excluding any selected rows that may be filtered out.\n// - Handle sub rows correctly when custom getSubRows is used\n// (https://github.com/TanStack/react-table/pull/2886)\n\nimport React from 'react'\nimport {\n actions,\n makePropGetter,\n ensurePluginOrder,\n useGetLatest,\n useMountedLayoutEffect\n} from 'react-table'\n\nconst pluginName = 'useRowSelect'\n\n// Actions\nactions.resetSelectedRows = 'resetSelectedRows'\nactions.toggleAllRowsSelected = 'toggleAllRowsSelected'\nactions.toggleRowSelected = 'toggleRowSelected'\nactions.toggleAllPageRowsSelected = 'toggleAllPageRowsSelected'\nactions.setRowsSelected = 'setRowsSelected'\n\nexport default function useRowSelect(hooks) {\n hooks.getToggleRowSelectedProps = [defaultGetToggleRowSelectedProps]\n hooks.getToggleAllRowsSelectedProps = [defaultGetToggleAllRowsSelectedProps]\n hooks.getToggleAllPageRowsSelectedProps = [defaultGetToggleAllPageRowsSelectedProps]\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n hooks.prepareRow.push(prepareRow)\n}\n\nuseRowSelect.pluginName = pluginName\n\nconst defaultGetToggleRowSelectedProps = (props, { instance, row }) => {\n const { manualRowSelectedKey = 'isSelected' } = instance\n let checked = false\n\n if (row.original && row.original[manualRowSelectedKey]) {\n checked = true\n } else {\n checked = row.isSelected\n }\n\n return [\n props,\n {\n onChange: e => {\n row.toggleRowSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked,\n title: 'Toggle Row Selected',\n indeterminate: row.isSomeSelected\n }\n ]\n}\n\nconst defaultGetToggleAllRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange: e => {\n instance.toggleAllRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked: instance.isAllRowsSelected,\n title: 'Toggle All Rows Selected',\n indeterminate: Boolean(\n !instance.isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length\n )\n }\n]\n\nconst defaultGetToggleAllPageRowsSelectedProps = (props, { instance }) => [\n props,\n {\n onChange(e) {\n instance.toggleAllPageRowsSelected(e.target.checked)\n },\n style: {\n cursor: 'pointer'\n },\n checked: instance.isAllPageRowsSelected,\n title: 'Toggle All Current Page Rows Selected',\n indeterminate: Boolean(\n !instance.isAllPageRowsSelected &&\n instance.page.some(({ id }) => instance.state.selectedRowIds[id])\n )\n }\n]\n\n// eslint-disable-next-line max-params\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n selectedRowIds: {},\n ...state\n }\n }\n\n if (action.type === actions.resetSelectedRows) {\n return {\n ...state,\n selectedRowIds: instance.initialState.selectedRowIds || {}\n }\n }\n\n if (action.type === actions.toggleAllRowsSelected) {\n const { value: setSelected } = action\n const { isAllRowsSelected, rowsById, nonGroupedRowsById = rowsById } = instance\n\n const selectAll = typeof setSelected !== 'undefined' ? setSelected : !isAllRowsSelected\n\n // Only remove/add the rows that are visible on the screen\n // Leave all the other rows that are selected alone.\n const selectedRowIds = Object.assign({}, state.selectedRowIds)\n\n if (selectAll) {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n selectedRowIds[rowId] = true\n })\n } else {\n Object.keys(nonGroupedRowsById).forEach(rowId => {\n delete selectedRowIds[rowId]\n })\n }\n\n return {\n ...state,\n selectedRowIds\n }\n }\n\n if (action.type === actions.toggleRowSelected) {\n const { id, value: setSelected } = action\n const { rowsById, selectSubRows = true } = instance\n const isSelected = state.selectedRowIds[id]\n const shouldExist = typeof setSelected !== 'undefined' ? setSelected : !isSelected\n\n if (isSelected === shouldExist) {\n return state\n }\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n if (!row.isGrouped) {\n if (shouldExist) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n handleRowById(id)\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n\n if (action.type === actions.toggleAllPageRowsSelected) {\n const { value: setSelected } = action\n const { page, rowsById, selectSubRows = true, isAllPageRowsSelected } = instance\n\n const selectAll = typeof setSelected !== 'undefined' ? setSelected : !isAllPageRowsSelected\n\n const newSelectedRowIds = { ...state.selectedRowIds }\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n if (!row.isGrouped) {\n if (selectAll) {\n newSelectedRowIds[id] = true\n } else {\n delete newSelectedRowIds[id]\n }\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n page.forEach(row => handleRowById(row.id))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n\n if (action.type === actions.setRowsSelected) {\n const { ids: setSelected } = action\n const { rowsById, selectSubRows = true } = instance\n\n const newSelectedRowIds = {}\n\n const handleRowById = id => {\n const row = rowsById[id]\n\n // Select a filtered or (less likely) invalid row (rowsById only contains visible rows).\n if (!row) {\n newSelectedRowIds[id] = true\n return\n }\n\n if (!row.isGrouped) {\n newSelectedRowIds[id] = true\n }\n\n if (selectSubRows && row.subRows) {\n return row.subRows.forEach(row => handleRowById(row.id))\n }\n }\n\n setSelected.forEach(rowId => handleRowById(rowId))\n\n return {\n ...state,\n selectedRowIds: newSelectedRowIds\n }\n }\n return state\n}\n\nfunction useInstance(instance) {\n const {\n data,\n rows,\n getHooks,\n plugins,\n rowsById,\n nonGroupedRowsById = rowsById,\n autoResetSelectedRows = true,\n state: { selectedRowIds },\n selectSubRows = true,\n dispatch,\n page\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded', 'usePagination'],\n 'useRowSelect'\n )\n\n const selectedFlatRows = React.useMemo(() => {\n const selectedFlatRows = []\n\n // Ensure row.isSelected is set for sub rows when paginateExpandedRows = false\n // https://github.com/TanStack/react-table/issues/2908\n const handleRow = row => {\n const isSelected = selectSubRows\n ? getRowIsSelected(row, selectedRowIds)\n : !!selectedRowIds[row.id]\n row.isSelected = !!isSelected\n row.isSomeSelected = isSelected === null\n\n if (isSelected) {\n selectedFlatRows.push(row)\n }\n\n if (row.subRows && row.subRows.length) {\n row.subRows.forEach(row => handleRow(row))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return selectedFlatRows\n }, [rows, selectSubRows, selectedRowIds])\n\n let isAllRowsSelected = Boolean(\n Object.keys(nonGroupedRowsById).length && Object.keys(selectedRowIds).length\n )\n\n let isAllPageRowsSelected = isAllRowsSelected\n\n if (isAllRowsSelected) {\n if (Object.keys(nonGroupedRowsById).some(id => !selectedRowIds[id])) {\n isAllRowsSelected = false\n }\n }\n\n if (!isAllRowsSelected) {\n if (page && page.length && page.some(({ id }) => !selectedRowIds[id])) {\n isAllPageRowsSelected = false\n }\n }\n\n const getAutoResetSelectedRows = useGetLatest(autoResetSelectedRows)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetSelectedRows()) {\n dispatch({ type: actions.resetSelectedRows })\n }\n }, [dispatch, data])\n\n const toggleAllRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllRowsSelected, value }),\n [dispatch]\n )\n\n const toggleAllPageRowsSelected = React.useCallback(\n value => dispatch({ type: actions.toggleAllPageRowsSelected, value }),\n [dispatch]\n )\n\n const toggleRowSelected = React.useCallback(\n (id, value) => dispatch({ type: actions.toggleRowSelected, id, value }),\n [dispatch]\n )\n\n const setRowsSelected = React.useCallback(\n ids => dispatch({ type: actions.setRowsSelected, ids }),\n [dispatch]\n )\n\n const getInstance = useGetLatest(instance)\n\n const getToggleAllRowsSelectedProps = makePropGetter(getHooks().getToggleAllRowsSelectedProps, {\n instance: getInstance()\n })\n\n const getToggleAllPageRowsSelectedProps = makePropGetter(\n getHooks().getToggleAllPageRowsSelectedProps,\n { instance: getInstance() }\n )\n\n Object.assign(instance, {\n selectedFlatRows,\n isAllRowsSelected,\n isAllPageRowsSelected,\n toggleRowSelected,\n toggleAllRowsSelected,\n setRowsSelected,\n getToggleAllRowsSelectedProps,\n getToggleAllPageRowsSelectedProps,\n toggleAllPageRowsSelected\n })\n}\n\nfunction prepareRow(row, { instance }) {\n row.toggleRowSelected = set => instance.toggleRowSelected(row.id, set)\n\n row.getToggleRowSelectedProps = makePropGetter(instance.getHooks().getToggleRowSelectedProps, {\n instance: instance,\n row\n })\n}\n\nfunction getRowIsSelected(row, selectedRowIds) {\n if (selectedRowIds[row.id]) {\n return true\n }\n\n const subRows = row.subRows\n\n if (subRows && subRows.length) {\n let allChildrenSelected = true\n let someSelected = false\n\n // TODO: For server-side pagination, if sub rows are paginated, there's no way to know \n // whether all sub rows are selected if not present on the page. Row selection needs \n // to be fully server-side, so this is a temporary workaround to prevent grouped\n // rows from always appearing as selected.\n const availableSubRows = subRows.filter(row => row != null)\n if (availableSubRows.length !== subRows.length) {\n return false\n }\n\n subRows.forEach(subRow => {\n // Bail out early if we know both of these\n if (someSelected && !allChildrenSelected) {\n return\n }\n\n if (getRowIsSelected(subRow, selectedRowIds)) {\n someSelected = true\n } else {\n allChildrenSelected = false\n }\n })\n return allChildrenSelected ? true : someSelected ? null : false\n }\n\n return false\n}\n","// usePagination modified to:\n// - Allow pagination to be disabled. This makes it easier to use the hook\n// conditionally while keeping pagination functionality intact (e.g., the\n// pagination bar and API can still be used when pagination is disabled).\n// - Provide instance.pageRowCount for the number of paginated rows on the\n// page, excluding expanded rows when paginateExpandedRows = false.\n// - Support a rowCount option in useTable() for manual pagination as an\n// alternative to pageCount. Server-side pagination typically requires\n// the server-side row count to be known, so providing page count is\n// unnecessary when it can be derived from row count and page size.\n\nimport React from 'react'\nimport {\n actions,\n ensurePluginOrder,\n functionalUpdate,\n useMountedLayoutEffect,\n useGetLatest\n} from 'react-table'\n\nconst pluginName = 'usePagination'\n\n// Actions\nactions.resetPage = 'resetPage'\nactions.gotoPage = 'gotoPage'\nactions.setPageSize = 'setPageSize'\n\nexport default function usePagination(hooks) {\n hooks.stateReducers.push(reducer)\n hooks.useInstance.push(useInstance)\n}\n\nusePagination.pluginName = pluginName\n\nfunction reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return {\n pageSize: 10,\n pageIndex: 0,\n ...state\n }\n }\n\n if (action.type === actions.resetPage) {\n return {\n ...state,\n pageIndex: instance.initialState.pageIndex || 0\n }\n }\n\n if (action.type === actions.gotoPage) {\n const { pageCount, page } = instance\n const newPageIndex = functionalUpdate(action.pageIndex, state.pageIndex)\n let canNavigate = false\n\n if (newPageIndex > state.pageIndex) {\n // next page\n canNavigate = pageCount === -1 ? page.length >= state.pageSize : newPageIndex < pageCount\n } else if (newPageIndex < state.pageIndex) {\n // prev page\n canNavigate = newPageIndex > -1\n }\n\n if (!canNavigate) {\n return state\n }\n\n return {\n ...state,\n pageIndex: newPageIndex\n }\n }\n\n if (action.type === actions.setPageSize) {\n const { pageSize } = action\n const topRowIndex = state.pageSize * state.pageIndex\n const pageIndex = Math.floor(topRowIndex / pageSize)\n\n return {\n ...state,\n pageIndex,\n pageSize\n }\n }\n}\n\nfunction useInstance(instance) {\n const {\n rows,\n autoResetPage = true,\n manualExpandedKey = 'expanded',\n plugins,\n pageCount: userPageCount,\n paginateExpandedRows = true,\n expandSubRows = true,\n disablePagination,\n state: { pageIndex, expanded, globalFilter, filters, groupBy, sortBy },\n dispatch,\n data,\n manualPagination,\n // User-specified row count when using manual pagination. Takes precedence over pageCount.\n rowCount: userRowCount\n } = instance\n\n ensurePluginOrder(\n plugins,\n ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'],\n 'usePagination'\n )\n\n const getAutoResetPage = useGetLatest(autoResetPage)\n\n useMountedLayoutEffect(() => {\n if (getAutoResetPage()) {\n dispatch({ type: actions.resetPage })\n }\n }, [dispatch, manualPagination ? null : data, globalFilter, filters, groupBy, sortBy])\n\n // Disabling pagination effectively means setting the page size to the table size.\n // This is best done by the hook, rather than the user, because the row count\n // isn't known until other row-manipulating hooks have run (e.g., useGroupBy).\n const pageSize = disablePagination ? rows.length : instance.state.pageSize\n\n let pageCount\n if (manualPagination) {\n // Prefer user-specified row count for manual pagination. Server-side pagination\n // typically requires the server-side row count to be known, so providing page count\n // is unnecessary when it can be derived from row count and page size.\n pageCount =\n userRowCount != null && userRowCount >= 0 ? Math.ceil(userRowCount / pageSize) : userPageCount\n } else {\n pageCount = Math.ceil(rows.length / pageSize)\n }\n\n const pageOptions = React.useMemo(\n () => (pageCount > 0 ? [...new Array(pageCount)].fill(null).map((d, i) => i) : []),\n [pageCount]\n )\n\n const [page, pageRowCount] = React.useMemo(() => {\n let page\n\n if (manualPagination) {\n page = rows\n } else {\n const pageStart = pageSize * pageIndex\n const pageEnd = pageStart + pageSize\n\n page = rows.slice(pageStart, pageEnd)\n }\n\n const pageRowCount = page.length\n\n if (paginateExpandedRows) {\n return [page, pageRowCount]\n }\n\n return [expandRows(page, { manualExpandedKey, expanded, expandSubRows }), pageRowCount]\n }, [\n expandSubRows,\n expanded,\n manualExpandedKey,\n manualPagination,\n pageIndex,\n pageSize,\n paginateExpandedRows,\n rows\n ])\n\n const canPreviousPage = pageIndex > 0\n const canNextPage = pageCount === -1 ? page.length >= pageSize : pageIndex < pageCount - 1\n\n const gotoPage = React.useCallback(\n pageIndex => {\n dispatch({ type: actions.gotoPage, pageIndex })\n },\n [dispatch]\n )\n\n const previousPage = React.useCallback(() => {\n return gotoPage(old => old - 1)\n }, [gotoPage])\n\n const nextPage = React.useCallback(() => {\n return gotoPage(old => old + 1)\n }, [gotoPage])\n\n const setPageSize = React.useCallback(\n pageSize => {\n dispatch({ type: actions.setPageSize, pageSize })\n },\n [dispatch]\n )\n\n Object.assign(instance, {\n pageOptions,\n pageCount,\n page,\n pageRowCount,\n canPreviousPage,\n canNextPage,\n gotoPage,\n previousPage,\n nextPage,\n setPageSize\n })\n}\n\nfunction expandRows(rows, { manualExpandedKey, expanded, expandSubRows = true }) {\n const expandedRows = []\n\n const handleRow = (row, addToExpandedRows = true) => {\n row.isExpanded = (row.original && row.original[manualExpandedKey]) || expanded[row.id]\n\n row.canExpand = row.subRows && !!row.subRows.length\n\n if (addToExpandedRows) {\n expandedRows.push(row)\n }\n\n if (row.subRows && row.subRows.length && row.isExpanded) {\n row.subRows.forEach(row => handleRow(row, expandSubRows))\n }\n }\n\n rows.forEach(row => handleRow(row))\n\n return expandedRows\n}\n","export function sum(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return 0\n }\n const result = numbers.reduce((a, b) => a + b, 0)\n // Adjust for floating-point precision errors\n return round(result, 12)\n}\n\nexport function mean(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n const result = sum(numbers) / numbers.length\n // Adjust for floating-point precision errors\n return round(result, 12)\n}\n\nexport function maxNumber(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n return Math.max.apply(null, numbers)\n}\n\nexport function minNumber(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n return Math.min.apply(null, numbers)\n}\n\nexport function median(values) {\n const numbers = omitMissingNumbers(values)\n if (numbers.length === 0) {\n return NaN\n }\n numbers.sort((a, b) => a - b)\n if (numbers.length % 2 === 1) {\n return numbers[(numbers.length - 1) / 2]\n } else {\n return mean(numbers.slice(numbers.length / 2 - 1, numbers.length / 2 + 1))\n }\n}\n\nexport function max(values) {\n let maxValue\n values.forEach(value => {\n if (maxValue == null || value > maxValue) {\n maxValue = value\n }\n })\n return maxValue\n}\n\nexport function min(values) {\n let minValue\n values.forEach(value => {\n if (minValue == null || value < minValue) {\n minValue = value\n }\n })\n return minValue\n}\n\nexport function count(values) {\n return values.length\n}\n\nexport function unique(values) {\n return [...new Set(values)].join(', ')\n}\n\nexport function frequency(values) {\n const counts = {}\n values.forEach(value => {\n counts[value] = counts[value] || 0\n counts[value] += 1\n })\n const strs = Object.keys(counts).map(val => {\n return val + (counts[val] > 1 ? ` (${counts[val]})` : '')\n })\n return strs.join(', ')\n}\n\nconst numericAggregators = {\n mean,\n sum,\n max: maxNumber,\n min: minNumber,\n median\n}\n\nconst defaultAggregators = {\n max,\n min,\n count,\n unique,\n frequency\n}\n\nexport function getAggregateFunction(name, type) {\n if (type === 'numeric' && numericAggregators[name]) {\n return numericAggregators[name]\n }\n return defaultAggregators[name]\n}\n\nexport function round(n, digits = 3) {\n if (!Number.isFinite(n)) {\n return n\n }\n digits = digits > 0 ? digits : 0\n const c = Math.pow(10, digits)\n // Round away from zero rather than up (Math.round rounds -1.5 to -1)\n return (Math.sign(n) * Math.round(Math.abs(n) * c)) / c\n}\n\nfunction omitMissingNumbers(values) {\n return values.filter(n => n != null && !Number.isNaN(n))\n}\n","import React, { Fragment } from 'react'\nimport { hydrate } from 'reactR'\n\nimport WidgetContainer from './WidgetContainer'\nimport { getAggregateFunction } from './aggregators'\nimport {\n classNames,\n escapeRegExp,\n getFirstDefined,\n getLeafColumns,\n removeEmptyProps\n} from './utils'\n\n// Use zero-width spaces to preserve the height of empty cells\nexport const emptyValue = '\\u200b'\n\n// Override default subRows property\nconst subRowsKey = '.subRows'\n\nexport const rowSelectedKey = '.selected'\nexport const rowExpandedKey = '.expanded'\n\nexport const rowStateKey = '__state'\n\nexport function getSubRows(row) {\n return row[subRowsKey] || []\n}\n\n// Normalize raw column data from R for use in reactable\nexport function normalizeColumnData(data, columns) {\n for (let col of columns) {\n if (col.type === 'numeric' && data[col.id]) {\n convertJSONNumbers(data[col.id])\n }\n }\n return columnsToRows(data)\n}\n\n// Convert JSON-serialized numbers to JavaScript numbers in place. jsonlite::toJSON() converts\n// numeric NA, NaN, Inf, -Inf to strings, as there isn't a way to represent them in JSON otherwise.\nexport function convertJSONNumbers(arr) {\n for (let i = 0; i < arr.length; i++) {\n let n = arr[i]\n // Numeric columns can have nulls in pre-grouped data\n if (typeof n === 'number' || n == null) {\n continue\n }\n if (n === 'NA') {\n n = null\n } else if (n === 'NaN') {\n n = NaN\n } else if (n === 'Inf') {\n n = Infinity\n } else if (n === '-Inf') {\n n = -Infinity\n } else {\n n = Number(n)\n }\n arr[i] = n\n }\n}\n\n// Convert column-based data to rows\n// e.g. { a: [1, 2], b: ['x', 'y'] } to [{ a: 1, b: 'x' }, { a: 2, b: 'y' }]\nexport function columnsToRows(columns) {\n const names = Object.keys(columns)\n if (names.length === 0) {\n return []\n }\n\n if (columns[rowStateKey]) {\n columns[rowStateKey] = normalizeColumnData(columns[rowStateKey], numericRowStateColumns)\n }\n\n const rows = new Array(columns[names[0]].length)\n for (let i = 0; i < rows.length; i++) {\n rows[i] = {}\n for (let name of names) {\n const value = columns[name][i]\n if (name === subRowsKey) {\n if (value instanceof Object) {\n rows[i][name] = columnsToRows(value)\n }\n } else {\n rows[i][name] = value\n }\n }\n }\n return rows\n}\n\nconst numericRowStateColumns = [{ id: 'index', type: 'numeric' }]\nexport function materializedRowsToData(rows, paginateSubRows) {\n const parentRowIds = {}\n return rows.map(row => {\n let parentId\n let subRowCount\n if (paginateSubRows) {\n parentId = parentRowIds[row.id]\n subRowCount = row.subRows.length\n row.subRows.forEach(subRow => {\n parentRowIds[subRow.id] = row.id\n })\n }\n const rowState = {\n id: row.id,\n index: row.index,\n grouped: row.isGrouped ? true : null,\n parentId,\n subRowCount,\n // Currently unused\n expanded: row.isExpanded ? true : null,\n selected: row.isSelected ? true : null\n }\n removeEmptyProps(rowState)\n const dataRow = { ...row.values, [rowStateKey]: rowState }\n if (!paginateSubRows) {\n if (row.subRows && row.subRows.length > 0) {\n dataRow[subRowsKey] = materializedRowsToData(row.subRows)\n }\n }\n return dataRow\n })\n}\n\nexport function RawHTML({ html, className, ...props }) {\n return (\n \n )\n}\n\nexport function buildColumnDefs(columns, groups, tableProps = {}) {\n const { sortable, defaultSortDesc, showSortIcon, showSortable, filterable, resizable } =\n tableProps\n\n columns = columns.map(column => {\n let col = { ...column }\n // Always access column data by ID, not a path with periods or brackets\n col.accessor = row => row[col.id]\n\n if (typeof col.aggregate === 'string') {\n col.aggregate = getAggregateFunction(col.aggregate, col.type)\n }\n\n const sortMethod = createCompareFunction({ type: col.type, naLast: col.sortNALast })\n col.sortType = function sortType(a, b, id, desc) {\n return sortMethod(a.values[id], b.values[id], desc)\n }\n\n // Translate v6 props (e.g. sortable) to v7 (e.g. disableSortBy)\n col.sortable = getFirstDefined(col.sortable, sortable)\n col.disableSortBy = !col.sortable\n\n col.defaultSortDesc = getFirstDefined(col.defaultSortDesc, defaultSortDesc)\n col.sortDescFirst = col.defaultSortDesc\n\n col.filterable = getFirstDefined(col.filterable, filterable)\n col.disableFilters = !col.filterable\n\n if (col.searchable === false) {\n col.disableGlobalFilter = true\n }\n // Disable searching for hidden columns by default, but still allow it if requested\n if (col.show === false && col.searchable !== true) {\n col.disableGlobalFilter = true\n }\n\n // Default column filters\n // - numeric columns: string starts with\n // - other columns: case-insensitive substring\n if (col.type === 'numeric') {\n col.createMatcher = createStartsWithMatcher\n } else {\n col.createMatcher = createSubstringMatcher\n }\n col.filter = (rows, columnIds, filterValue) => {\n // For individual column filters, columnIds will always contain one column ID\n const id = columnIds[0]\n if (typeof col.filterMethod === 'function') {\n return col.filterMethod(rows, id, filterValue)\n }\n const match = col.createMatcher(filterValue)\n return rows.filter(row => {\n const value = row.values[id]\n return match(value)\n })\n }\n\n if (col.type === 'numeric') {\n // Right-align numbers by default\n col.align = col.align || 'right'\n } else {\n col.align = col.align || 'left'\n }\n\n col.vAlign = col.vAlign || 'top'\n col.headerVAlign = col.headerVAlign || 'top'\n\n const { width, minWidth, maxWidth } = col\n col.minWidth = getFirstDefined(width, minWidth, 100)\n col.maxWidth = getFirstDefined(width, maxWidth, Number.MAX_SAFE_INTEGER)\n\n // maxWidth takes priority over minWidth\n col.minWidth = Math.min(col.minWidth, col.maxWidth)\n\n // Start column width at min width / flex width, like in v6\n col.width = col.minWidth\n\n col.resizable = getFirstDefined(col.resizable, resizable)\n // Disable resizing on fixed width columns\n if (col.minWidth === col.maxWidth) {\n col.resizable = false\n }\n col.disableResizing = !col.resizable\n\n col.Cell = function Cell(cellInfo, state) {\n let value = cellInfo.value\n\n const isMissingValue = value == null || Number.isNaN(value)\n if (isMissingValue) {\n value = col.na\n }\n\n if (!isMissingValue && col.format && col.format.cell) {\n value = formatValue(value, col.format.cell)\n }\n\n if (col.cell) {\n if (typeof col.cell === 'function') {\n value = col.cell({ ...cellInfo, value }, state)\n }\n // Make sure we don't render aggregated cells for R renderers\n if (Array.isArray(col.cell) && !cellInfo.aggregated) {\n value = col.cell[cellInfo.index]\n if (value) {\n value = hydrate({ Fragment, WidgetContainer }, value)\n }\n }\n }\n\n // Use zero-width spaces to preserve the height of blank cells\n if (value == null || value === '') {\n value = emptyValue\n }\n\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n // Render inline to align with the expander\n content = \n } else {\n content = String(value)\n }\n\n return content\n }\n\n if (col.grouped) {\n col.Grouped = function Grouped(cellInfo, state) {\n let value = cellInfo.value\n\n const isMissingValue = value == null || Number.isNaN(value)\n if (isMissingValue) {\n value = col.na\n }\n\n if (!isMissingValue && col.format && col.format.cell) {\n value = formatValue(value, col.format.cell)\n }\n\n value = col.grouped({ ...cellInfo, value }, state)\n\n // Use zero-width spaces to preserve the height of blank cells\n if (value == null || value === '') {\n value = emptyValue\n }\n\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n // Render inline to align with the expander\n content = \n } else {\n content = String(value)\n }\n return content\n }\n } else {\n // Render grouped values the same as regular cells\n col.Grouped = function Grouped(cellInfo, state) {\n const value = col.Cell(cellInfo, state)\n return (\n \n {value}\n {cellInfo.subRows && ` (${cellInfo.subRows.length})`}\n \n )\n }\n }\n\n col.Aggregated = function Aggregated(cellInfo, state) {\n let value = cellInfo.value\n if (value != null && col.format && col.format.aggregated) {\n value = formatValue(value, col.format.aggregated)\n }\n if (col.aggregated) {\n value = col.aggregated({ ...cellInfo, value }, state)\n }\n if (value == null) {\n value = ''\n }\n let content\n if (React.isValidElement(value)) {\n content = value\n } else if (col.html) {\n return \n } else {\n content = String(value)\n }\n return content\n }\n\n col.Header = function Header(column, state) {\n let header = col.name\n\n if (col.header != null) {\n if (typeof col.header === 'function') {\n header = col.header(column, state)\n } else {\n header = hydrate({ Fragment, WidgetContainer }, col.header)\n }\n }\n\n let content\n if (React.isValidElement(header)) {\n content = header\n } else if (col.html) {\n content = \n } else {\n content = header != null ? String(header) : ''\n }\n\n // Add sort icon to column header\n if (col.sortable && showSortIcon) {\n const sortClass = showSortable ? 'rt-sort' : ''\n // Ensure text is truncated with an ellipsis when text wrapping is off.\n // The outer container is a flex container, so we need to wrap text in a\n // block element to allow text to shrink below their minimum content size.\n content = col.html ? content :
{content}
\n\n if (col.align === 'right') {\n return (\n
\n \n {content}\n
\n )\n } else {\n return (\n
\n {content}\n \n
\n )\n }\n }\n return content\n }\n\n if (col.footer != null) {\n col.Footer = function Footer(column, state) {\n let footer\n if (typeof col.footer === 'function') {\n footer = col.footer(column, state)\n } else {\n footer = hydrate({ Fragment, WidgetContainer }, col.footer)\n }\n if (React.isValidElement(footer)) {\n return footer\n } else if (col.html) {\n return \n } else {\n return footer != null ? String(footer) : ''\n }\n }\n } else {\n // Set default content for an empty footer (otherwise defaults to  )\n col.Footer = emptyValue\n }\n\n const colAlignClass = getAlignClass(col.align)\n const cellVAlignClass = getVAlignClass(col.vAlign)\n const headerVAlignClass = getVAlignClass(col.headerVAlign)\n\n col.headerClassName = classNames(colAlignClass, headerVAlignClass, col.headerClassName)\n col.footerClassName = classNames(colAlignClass, cellVAlignClass, col.footerClassName)\n\n col.getProps = (rowInfo, column, state) => {\n let props = {\n className: classNames(colAlignClass, cellVAlignClass)\n }\n if (col.className) {\n let className\n if (typeof col.className === 'function') {\n className = col.className(rowInfo, column, state)\n } else if (Array.isArray(col.className)) {\n className = col.className[rowInfo.index]\n } else {\n className = col.className\n }\n props.className = classNames(props.className, className)\n }\n if (col.style) {\n let style\n if (typeof col.style === 'function') {\n style = col.style(rowInfo, column, state)\n } else if (Array.isArray(col.style)) {\n style = col.style[rowInfo.index]\n } else {\n style = col.style\n }\n props.style = style\n }\n return props\n }\n\n return col\n })\n\n if (groups) {\n columns = addColumnGroups(columns, groups)\n columns.forEach((col, i) => {\n // The column group ID is arbitrary and just has to be unique\n col.id = `group_${i}`\n if (col.name != null || col.header != null) {\n col.Header = function Header(column, state) {\n let header = col.name\n if (col.header) {\n if (typeof col.header === 'function') {\n header = col.header(column, state)\n } else {\n header = hydrate({ Fragment, WidgetContainer }, col.header)\n }\n }\n if (React.isValidElement(header)) {\n return header\n } else if (col.html) {\n return \n } else {\n return header != null ? String(header) : ''\n }\n }\n } else {\n col.Header = emptyValue\n }\n\n // Enable resizing if a single leaf column can be resized\n const leafColumns = getLeafColumns(col)\n if (leafColumns.every(col => col.disableResizing)) {\n col.disableResizing = true\n }\n\n col.align = col.align || 'center'\n col.headerVAlign = col.headerVAlign || 'top'\n\n const colAlignClass = getAlignClass(col.align)\n const headerVAlignClass = getVAlignClass(col.headerVAlign)\n\n col.headerClassName = classNames(colAlignClass, headerVAlignClass, col.headerClassName)\n })\n }\n\n return columns\n}\n\n// Add groups to an array of column definitions\nexport function addColumnGroups(columns, groups) {\n groups.forEach(group => {\n group = { ...group }\n const groupIds = group.columns\n group.columns = []\n columns = columns.reduce((newCols, col) => {\n if (col.id === groupIds[0]) {\n newCols.push(group)\n group.columns.push(col)\n } else if (groupIds.includes(col.id)) {\n group.columns.push(col)\n } else {\n newCols.push(col)\n }\n return newCols\n }, [])\n })\n\n // Create column groups for ungrouped columns, combining adjacent columns\n const newCols = []\n let lastGroup\n columns.forEach(col => {\n if (col.columns) {\n // Already a header group\n newCols.push(col)\n lastGroup = null\n } else {\n // Individual column\n if (!lastGroup) {\n lastGroup = { columns: [], isUngrouped: true }\n newCols.push(lastGroup)\n }\n lastGroup.columns.push(col)\n }\n })\n columns = newCols\n\n return columns\n}\n\n// Compare function that handles numbers and optionally sorts missing values (null, NaN) last.\nexport function createCompareFunction({ type, naLast } = {}) {\n return function compare(a, b, desc) {\n if (type === 'numeric') {\n a = Number.isNaN(a) ? null : a\n b = Number.isNaN(b) ? null : b\n } else {\n a = typeof a === 'string' ? a.toLowerCase() : a\n b = typeof b === 'string' ? b.toLowerCase() : b\n }\n if (a === b) {\n return 0\n }\n if (a == null) {\n if (naLast) return desc ? -1 : 1\n return -1\n }\n if (b == null) {\n if (naLast) return desc ? 1 : -1\n return 1\n }\n if (a > b) {\n return 1\n }\n if (a < b) {\n return -1\n }\n return 0\n }\n}\n\nexport function formatValue(value, options) {\n let {\n prefix,\n suffix,\n digits,\n separators,\n percent,\n currency,\n datetime,\n date,\n time,\n hour12,\n locales\n } = options\n\n if (typeof value === 'number') {\n if (separators || percent || currency || digits != null || locales) {\n // While Number.toLocaleString supports up to 20 fraction digits,\n // IE11 only supports up to 18 digits when formatting as percentages.\n let maximumFractionDigits = 18\n const options = { useGrouping: separators ? true : false }\n if (percent) {\n options.style = 'percent'\n // Use lower fraction digits to mitigate floating-point precision errors with\n // percent formatting, which can happen when using the Intl polyfill in V8.\n // This is the same as the rounding digits used by the aggregators.\n maximumFractionDigits = 12\n }\n if (currency) {\n options.style = 'currency'\n options.currency = currency\n } else if (digits != null) {\n options.minimumFractionDigits = Math.min(digits, maximumFractionDigits)\n options.maximumFractionDigits = Math.min(digits, maximumFractionDigits)\n } else {\n options.maximumFractionDigits = maximumFractionDigits\n }\n value = value.toLocaleString(locales || undefined, options)\n }\n }\n if (datetime || date || time) {\n locales = locales || undefined\n const options = {}\n if (hour12 != null) {\n options.hour12 = hour12\n }\n if (datetime) {\n value = new Date(value).toLocaleString(locales, options)\n } else if (date) {\n // Format YYYY-MM-DD dates in local time, not UTC.\n // Ignore ISO 8601 dates otherwise, i.e., YYYY-MM-DDTHH:MM:SS[Z]\n // http://blog.dygraphs.com/2012/03/javascript-and-dates-what-mess.html\n if (value.includes('-') && !value.includes('T') && !value.includes('Z')) {\n value = value.replace(/-/g, '/')\n }\n value = new Date(value).toLocaleDateString(locales, options)\n } else if (time) {\n value = new Date(value).toLocaleTimeString(locales, options)\n }\n }\n if (prefix != null) {\n value = value != null ? value : ''\n value = String(prefix) + value\n }\n if (suffix != null) {\n value = value != null ? value : ''\n value = value + String(suffix)\n }\n return value\n}\n\nexport function createStartsWithMatcher(str) {\n const regex = new RegExp('^' + escapeRegExp(str), 'i')\n return value => {\n // Ignore columns without data (don't match on \"undefined\"). This shouldn't\n // happen unless a data-less column (e.g., selection) is manually filtered via API.\n if (value === undefined) {\n return false\n }\n return regex.test(value)\n }\n}\n\nexport function createSubstringMatcher(str) {\n const regex = new RegExp(escapeRegExp(str), 'i')\n return value => {\n // Ignore columns without data (don't match on \"undefined\"). This shouldn't\n // happen unless a data-less column (e.g., selection) is manually filtered via API.\n if (value === undefined) {\n return false\n }\n return regex.test(value)\n }\n}\n\nfunction getAlignClass(align) {\n return `rt-align-${align}`\n}\n\nfunction getVAlignClass(vAlign) {\n if (vAlign === 'top') {\n return ''\n }\n return `rt-valign-${vAlign}`\n}\n","import React, { Fragment } from 'react'\nimport {\n safeUseLayoutEffect,\n useExpanded,\n useFilters,\n useGetLatest,\n useGlobalFilter,\n useMountedLayoutEffect,\n useSortBy,\n useTable\n} from 'react-table'\nimport PropTypes from 'prop-types'\nimport { hydrate } from 'reactR'\n\nimport Pagination from './Pagination'\nimport WidgetContainer from './WidgetContainer'\nimport useFlexLayout from './useFlexLayout'\nimport useStickyColumns from './useStickyColumns'\nimport useGroupBy from './useGroupBy'\nimport useResizeColumns from './useResizeColumns'\nimport useRowSelect from './useRowSelect'\nimport usePagination from './usePagination'\nimport useMeta from './useMeta'\nimport {\n buildColumnDefs,\n emptyValue,\n getSubRows,\n materializedRowsToData,\n normalizeColumnData,\n rowExpandedKey,\n rowSelectedKey,\n rowStateKey,\n RawHTML\n} from './columns'\nimport { defaultLanguage, renderTemplate } from './language'\nimport { createTheme, css } from './theme'\nimport {\n classNames,\n convertRowsToV6,\n getLeafColumns,\n rowsToCSV,\n downloadCSV,\n useAsyncDebounce\n} from './utils'\n\nimport './react-table.css'\nimport './reactable.css'\n\nconst tableInstances = {}\nexport function getInstance(tableId) {\n if (!tableId) {\n throw new Error('A reactable table ID must be provided')\n }\n const getInstance = tableInstances[tableId]\n if (!getInstance) {\n throw new Error(`reactable instance '${tableId}' not found`)\n }\n return getInstance()\n}\n\nexport function getState(tableId) {\n return getInstance(tableId).state\n}\n\nexport function setFilter(tableId, columnId, value) {\n getInstance(tableId).setFilter(columnId, value)\n}\n\nexport function setAllFilters(tableId, value) {\n getInstance(tableId).setAllFilters(value)\n}\n\nexport function setSearch(tableId, value) {\n getInstance(tableId).setGlobalFilter(value)\n}\n\nexport function toggleGroupBy(tableId, columnId, isGrouped) {\n getInstance(tableId).toggleGroupBy(columnId, isGrouped)\n}\n\nexport function setGroupBy(tableId, columnIds) {\n getInstance(tableId).setGroupBy(columnIds)\n}\n\nexport function toggleAllRowsExpanded(tableId, isExpanded) {\n getInstance(tableId).toggleAllRowsExpanded(isExpanded)\n}\n\nexport function downloadDataCSV(tableId, filename = 'data.csv', options = {}) {\n getInstance(tableId).downloadDataCSV(filename, options)\n}\n\nexport function getDataCSV(tableId, options = {}) {\n return getInstance(tableId).getDataCSV(options)\n}\n\nexport function setMeta(tableId, meta) {\n getInstance(tableId).setMeta(meta)\n}\n\nexport function toggleHideColumn(tableId, columnId, isHidden) {\n getInstance(tableId).toggleHideColumn(columnId, isHidden)\n}\n\nexport function setHiddenColumns(tableId, columns) {\n getInstance(tableId).setHiddenColumns(columns)\n}\n\nexport function setData(tableId, data, options) {\n getInstance(tableId).setData(data, options)\n}\n\nexport function onStateChange(tableId, listenerFn) {\n return getInstance(tableId).onStateChange(listenerFn)\n}\n\nexport function gotoPage(tableId, pageIndex) {\n getInstance(tableId).gotoPage(pageIndex)\n}\n\nexport function setPageSize(tableId, pageSize) {\n getInstance(tableId).setPageSize(pageSize)\n}\n\nexport default function Reactable({\n data,\n columns,\n columnGroups,\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable,\n theme,\n language,\n dataKey,\n ...rest\n}) {\n data = normalizeColumnData(data, columns)\n columns = buildColumnDefs(columns, columnGroups, {\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable\n })\n\n theme = createTheme(theme) || {}\n\n language = { ...defaultLanguage, ...language }\n for (let key in language) {\n language[key] = language[key] || null\n }\n\n return (\n \n )\n}\n\n// Objects and arrays must be memoized to prevent unnecessary recalculations of data\nfunction useMemoizedObject(obj) {\n const objStr = JSON.stringify(obj)\n return React.useMemo(() => {\n return obj\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [objStr])\n}\n\nexport function ReactableData({\n data,\n columns,\n columnGroups,\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable,\n // Controlled state\n sortBy,\n filters,\n searchValue,\n groupBy,\n expanded,\n selectedRowIds,\n ...rest\n}) {\n data = React.useMemo(\n () => normalizeColumnData(data, columns),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n )\n columns = React.useMemo(\n () =>\n buildColumnDefs(columns, columnGroups, {\n sortable,\n defaultSortDesc,\n showSortIcon,\n showSortable,\n filterable,\n resizable\n }),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n )\n\n // Objects and arrays must be memoized to prevent unnecessary recalculations of data\n sortBy = useMemoizedObject(sortBy || [])\n filters = useMemoizedObject(filters || [])\n groupBy = useMemoizedObject(groupBy || [])\n expanded = useMemoizedObject(expanded || {})\n selectedRowIds = useMemoizedObject(selectedRowIds || {})\n\n return (\n \n )\n}\n\nconst RootComponent = React.forwardRef(function RootComponent({ className, ...rest }, ref) {\n // Keep ReactTable class for legacy compatibility (deprecated in v0.3.0)\n return
\n})\n\nconst TableComponent = React.forwardRef(function TableComponent({ className, ...rest }, ref) {\n return
\n})\n\nfunction TheadComponent({ className, ...rest }) {\n return
\n}\n\nfunction TbodyComponent({ className, ...rest }) {\n return
\n}\n\nfunction TfootComponent({ className, ...rest }) {\n return
\n}\n\nfunction TrGroupComponent({ className, ...rest }) {\n return
\n}\n\nfunction TrComponent({ className, ...rest }) {\n return
\n}\n\nconst ThComponent = React.forwardRef(function ThComponent(props, ref) {\n let {\n canSort,\n sortDescFirst,\n isSorted,\n isSortedDesc,\n toggleSortBy,\n canResize,\n isResizing,\n className,\n innerClassName,\n children,\n ...thProps\n } = props\n\n const [skipNextSort, setSkipNextSort] = React.useState(false)\n\n if (canSort) {\n const currentSortOrder = isSorted ? (isSortedDesc ? 'descending' : 'ascending') : 'none'\n const defaultSortOrder = sortDescFirst ? 'descending' : 'ascending'\n const toggleSort = isMultiSort => {\n let sortDesc = isSorted ? !isSortedDesc : sortDescFirst\n // Allow sort clearing if multi-sorting\n if (isMultiSort) {\n sortDesc = null\n }\n toggleSortBy && toggleSortBy(sortDesc, isMultiSort)\n }\n thProps = {\n ...thProps,\n 'aria-sort': currentSortOrder,\n tabIndex: '0',\n onClick: e => {\n if (!skipNextSort) {\n toggleSort(e.shiftKey)\n }\n },\n onKeyPress: e => {\n const keyCode = e.which || e.keyCode\n if (keyCode === 13 || keyCode === 32) {\n toggleSort(e.shiftKey)\n }\n },\n onMouseUp: () => {\n // Prevent resizer clicks from toggling sort (since resizer is in the header)\n if (isResizing) {\n setSkipNextSort(true)\n } else {\n setSkipNextSort(false)\n }\n },\n onMouseDown: e => {\n // Prevent text selection on double clicks, only when sorting\n if (e.detail > 1 || e.shiftKey) {\n e.preventDefault()\n }\n },\n // Focus indicator for keyboard navigation\n 'data-sort-hint': isSorted ? null : defaultSortOrder\n }\n }\n\n // The inner wrapper is a block container that prevents the outer flex container from\n // breaking text overflow and ellipsis truncation. Text nodes can't shrink below their\n // minimum content size.\n return (\n \n
{children}
\n
\n )\n})\n\nThComponent.propTypes = {\n defaultSortOrder: PropTypes.string,\n canSort: PropTypes.bool,\n sortDescFirst: PropTypes.bool,\n isSorted: PropTypes.bool,\n isSortedDesc: PropTypes.bool,\n toggleSortBy: PropTypes.func,\n canResize: PropTypes.bool,\n isResizing: PropTypes.bool,\n className: PropTypes.string,\n innerClassName: PropTypes.string,\n children: PropTypes.node\n}\n\nfunction TdComponent({ className, innerClassName, children, ...rest }) {\n // The inner wrapper is a block container that prevents the outer flex container from\n // breaking text overflow and ellipsis truncation. Text nodes can't shrink below their\n // minimum content size.\n return (\n
\n
{children}
\n
\n )\n}\n\n// Get class names for a cell theme. Padding is set on the inner wrapper to prevent\n// the inner wrapper (with overflow hidden) from clipping borders, box shadows, etc.\nfunction getCellTheme(style) {\n if (!style) {\n return {}\n }\n if (style.padding != null) {\n const { padding, ...cellStyle } = style\n return {\n className: css(cellStyle),\n innerClassName: css({ padding })\n }\n }\n return { className: css(style) }\n}\n\nfunction ResizerComponent({ onMouseDown, onTouchStart, className, ...rest }) {\n return (\n \n )\n}\n\nResizerComponent.propTypes = {\n onMouseDown: PropTypes.func,\n onTouchStart: PropTypes.func,\n className: PropTypes.string\n}\n\nclass RowDetails extends React.Component {\n componentDidMount() {\n if (window.Shiny && window.Shiny.bindAll) {\n window.Shiny.bindAll(this.el)\n }\n }\n\n componentWillUnmount() {\n if (window.Shiny && window.Shiny.unbindAll) {\n window.Shiny.unbindAll(this.el)\n }\n }\n\n render() {\n const { children, html } = this.props\n let props = { ref: el => (this.el = el) }\n if (html) {\n props = { ...props, dangerouslySetInnerHTML: { __html: html } }\n } else {\n props = { ...props, children }\n }\n return
\n }\n}\n\nRowDetails.propTypes = {\n children: PropTypes.node,\n html: PropTypes.string\n}\n\nfunction ExpanderComponent({ isExpanded, className, 'aria-label': ariaLabel }) {\n return (\n \n \n ​\n \n \n )\n}\n\nExpanderComponent.propTypes = {\n isExpanded: PropTypes.bool,\n className: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction FilterComponent({\n filterValue,\n setFilter,\n className,\n placeholder,\n 'aria-label': ariaLabel\n}) {\n return (\n setFilter(e.target.value || undefined)}\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n )\n}\n\nFilterComponent.propTypes = {\n filterValue: PropTypes.string,\n setFilter: PropTypes.func.isRequired,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction SearchComponent({\n searchValue,\n setSearch,\n className,\n placeholder,\n 'aria-label': ariaLabel\n}) {\n return (\n setSearch(e.target.value || undefined)}\n className={classNames('rt-search', className)}\n placeholder={placeholder}\n aria-label={ariaLabel}\n />\n )\n}\n\nSearchComponent.propTypes = {\n searchValue: PropTypes.string,\n setSearch: PropTypes.func.isRequired,\n className: PropTypes.string,\n placeholder: PropTypes.string,\n 'aria-label': PropTypes.string\n}\n\nfunction NoDataComponent({ className, ...rest }) {\n return
\n}\n\nfunction SelectInputComponent({ type, checked, onChange, 'aria-label': ariaLabel }) {\n // Use zero-width space character to properly align checkboxes with first\n // line of text in other cells, even if the text spans multiple lines.\n return (\n
\n \n ​\n
\n )\n}\n\nSelectInputComponent.propTypes = {\n type: PropTypes.oneOf(['checkbox', 'radio']).isRequired,\n checked: PropTypes.bool,\n onChange: PropTypes.func,\n 'aria-label': PropTypes.string\n}\n\nfunction TableData({\n data,\n columns,\n groupBy,\n searchMethod,\n pagination,\n paginateSubRows,\n selection,\n crosstalkGroup,\n crosstalkId,\n setResolvedData,\n // Controlled state\n pageSize,\n pageIndex,\n sortBy,\n filters,\n searchValue,\n expanded,\n selectedRowIds\n}) {\n const dataColumns = React.useMemo(\n () => columns.reduce((cols, col) => cols.concat(getLeafColumns(col)), []),\n [columns]\n )\n\n // Must be memoized to prevent re-filtering on every render\n const globalFilter = React.useMemo(() => {\n if (searchMethod) {\n return searchMethod\n }\n return function globalFilter(rows, columnIds, searchValue) {\n const matchers = dataColumns.reduce((obj, col) => {\n obj[col.id] = col.createMatcher(searchValue)\n return obj\n }, {})\n\n rows = rows.filter(row => {\n for (const id of columnIds) {\n const value = row.values[id]\n if (matchers[id](value)) {\n return true\n }\n }\n })\n return rows\n }\n }, [dataColumns, searchMethod])\n\n const useRowSelectColumn = function useRowSelectColumn(hooks) {\n if (selection) {\n hooks.visibleColumns.push(columns => {\n const selectionCol = {\n // Apply defaults from existing selection column\n ...columns.find(col => col.selectable),\n selectable: true,\n // Disable sorting, filtering, and searching for selection columns\n disableSortBy: true,\n filterable: false,\n disableFilters: true,\n disableGlobalFilter: true\n }\n // Make selection column the first column, even before grouped columns\n return [selectionCol, ...columns.filter(col => !col.selectable)]\n })\n }\n }\n\n const useCrosstalkColumn = function useCrosstalkColumn(hooks) {\n if (crosstalkGroup) {\n hooks.visibleColumns.push(columns => {\n const ctCol = {\n id: crosstalkId,\n filter: (rows, id, value) => {\n if (!value) {\n return rows\n }\n return rows.filter(row => {\n if (value.includes(row.index)) {\n return true\n }\n })\n },\n disableGlobalFilter: true\n }\n return columns.concat(ctCol)\n })\n\n hooks.stateReducers.push(state => {\n if (!state.hiddenColumns.includes(crosstalkId)) {\n return {\n ...state,\n hiddenColumns: state.hiddenColumns.concat(crosstalkId)\n }\n }\n return state\n })\n }\n }\n\n const instance = useTable(\n {\n columns,\n data,\n useControlledState: state => {\n return React.useMemo(\n () => ({\n ...state,\n pageIndex,\n pageSize,\n sortBy,\n filters,\n globalFilter: searchValue,\n groupBy,\n expanded,\n selectedRowIds\n }),\n // These dependencies are required for proper table updates\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [\n state,\n pageIndex,\n pageSize,\n sortBy,\n filters,\n searchValue,\n groupBy,\n expanded,\n selectedRowIds\n ]\n )\n },\n globalFilter,\n paginateExpandedRows: paginateSubRows ? true : false,\n disablePagination: !pagination,\n getSubRows,\n // Disable manual row expansion\n manualExpandedKey: null,\n // Maintain grouped state when the data changes\n autoResetGroupBy: false,\n // Maintain sorted state when the data changes\n autoResetSortBy: false,\n // Maintain expanded state when groupBy, sortBy, defaultPageSize change.\n // Expanded state is still reset when the data changes via dataKey or updateReactable.\n autoResetExpanded: false,\n // Maintain filtered state when the data changes\n autoResetFilters: false,\n autoResetGlobalFilter: false,\n // Maintain selected state when groupBy, sortBy, defaultPageSize change.\n // Selected state is still reset when the data changes via dataKey or updateReactable.\n autoResetSelectedRows: false,\n // Maintain resized state when the data changes\n autoResetResize: false,\n // Reset current page when the data changes (e.g., sorting, filtering, searching)\n autoResetPage: true\n },\n useResizeColumns,\n useFlexLayout,\n useStickyColumns,\n useFilters,\n useGlobalFilter,\n useGroupBy,\n useSortBy,\n useExpanded,\n usePagination,\n useRowSelect,\n useRowSelectColumn,\n useCrosstalkColumn\n )\n\n // Track the max number of rows for auto-shown pagination. Unfortunately, the max\n // number of rows can't be determined up front in a grouped and filtered table\n // because grouping happens after filtering (and swapping these hooks would\n // disable dynamic aggregation). Instead, we track the max number of rows\n // per dataset, so at least the pagination doesn't disappear upon filtering.\n const maxRowCount = React.useRef(\n paginateSubRows ? instance.flatRows.length : instance.rows.length\n )\n\n React.useEffect(() => {\n maxRowCount.current = 0\n }, [data])\n\n React.useEffect(() => {\n const rowCount = paginateSubRows ? instance.flatRows.length : instance.rows.length\n if (rowCount > maxRowCount.current) {\n maxRowCount.current = rowCount\n }\n }, [paginateSubRows, instance.flatRows, instance.rows])\n\n if (setResolvedData) {\n setResolvedData({\n data: materializedRowsToData(instance.page, paginateSubRows),\n rowCount: instance.rows.length,\n maxRowCount: maxRowCount.current\n })\n }\n\n return null\n}\n\nfunction Table({\n data: originalData,\n columns,\n groupBy,\n searchable,\n searchMethod,\n defaultSorted,\n pagination,\n paginationType,\n showPagination,\n showPageSizeOptions,\n showPageInfo,\n defaultPageSize,\n pageSizeOptions,\n minRows,\n paginateSubRows,\n defaultExpanded,\n selection,\n defaultSelected,\n selectionId,\n onClick,\n outlined,\n bordered,\n borderless,\n compact,\n nowrap,\n striped,\n highlight,\n className,\n style,\n rowClassName,\n rowStyle,\n inline,\n width,\n height,\n theme,\n language,\n meta: initialMeta,\n crosstalkKey,\n crosstalkGroup,\n crosstalkId,\n elementId,\n nested,\n dataURL,\n serverRowCount: initialServerRowCount,\n serverMaxRowCount: initialServerMaxRowCount\n}) {\n const [newData, setNewData] = React.useState(null)\n const data = React.useMemo(() => {\n return newData ? newData : originalData\n }, [newData, originalData])\n\n const useServerData = dataURL != null\n const [serverRowCount, setServerRowCount] = React.useState(initialServerRowCount)\n const [serverMaxRowCount, setServerMaxRowCount] = React.useState(initialServerMaxRowCount)\n\n const dataColumns = React.useMemo(() => {\n return columns.reduce((cols, col) => cols.concat(getLeafColumns(col)), [])\n }, [columns])\n\n // Must be memoized to prevent re-filtering on every render\n const globalFilter = React.useMemo(() => {\n if (searchMethod) {\n return searchMethod\n }\n return function globalFilter(rows, columnIds, searchValue) {\n const matchers = dataColumns.reduce((obj, col) => {\n obj[col.id] = col.createMatcher(searchValue)\n return obj\n }, {})\n\n rows = rows.filter(row => {\n for (const id of columnIds) {\n const value = row.values[id]\n if (matchers[id](value)) {\n return true\n }\n }\n })\n return rows\n }\n }, [dataColumns, searchMethod])\n\n const useRowSelectColumn = function useRowSelectColumn(hooks) {\n if (selection) {\n hooks.visibleColumns.push(columns => {\n const selectionCol = {\n // Apply defaults from existing selection column\n ...columns.find(col => col.selectable),\n selectable: true,\n // Disable sorting, filtering, and searching for selection columns\n disableSortBy: true,\n filterable: false,\n disableFilters: true,\n disableGlobalFilter: true\n }\n // Make selection column the first column, even before grouped columns\n return [selectionCol, ...columns.filter(col => !col.selectable)]\n })\n }\n }\n\n const useCrosstalkColumn = function useCrosstalkColumn(hooks) {\n if (crosstalkGroup) {\n hooks.visibleColumns.push(columns => {\n const ctCol = {\n id: crosstalkId,\n filter: (rows, id, value) => {\n if (!value) {\n return rows\n }\n return rows.filter(row => {\n if (value.includes(row.index)) {\n return true\n }\n })\n },\n disableGlobalFilter: true\n }\n return columns.concat(ctCol)\n })\n\n hooks.stateReducers.push(state => {\n if (!state.hiddenColumns.includes(crosstalkId)) {\n return {\n ...state,\n hiddenColumns: state.hiddenColumns.concat(crosstalkId)\n }\n }\n return state\n })\n }\n }\n\n const [meta, setMeta] = useMeta(initialMeta)\n\n function useServerSideRows(hooks) {\n hooks.useInstance.push(instance => {\n const { rows, manualPagination, rowsById } = instance\n\n if (!manualPagination) {\n return\n }\n\n // Set proper row indexes and IDs\n const setRowProps = rows => {\n rows.forEach(row => {\n const rowState = row.original[rowStateKey]\n // Fall back for backends that don't implement row state\n if (!rowState) {\n return\n }\n row.index = rowState.index\n // Not used for now because we need ability to select/expand all first\n if (rowState.selected) {\n row.original[rowSelectedKey] = rowState.selected\n }\n // Not used for now because we need ability to select/expand all first\n if (rowState.expanded) {\n row.original[rowExpandedKey] = rowState.expanded\n }\n if (rowState.grouped) {\n row.isGrouped = true\n }\n // Rebuild sub rows\n if (rowState.parentId != null) {\n rowsById[rowState.parentId].subRows.push(row)\n // Set parentId on row to tell useGroupBy that this is a nested row\n // TODO change this so useGroupBy gets a properly nested row structure, not flat rows\n row.parentId = rowState.parentId\n }\n // Set row props on sub rows. Skip this when sub rows are paginated, since sub rows\n // exist in both row.subRows and the flat list of rows.\n if (!paginateSubRows) {\n setRowProps(row.subRows, row)\n }\n })\n\n // Add placeholder subRows for aggregated row counts\n if (paginateSubRows) {\n rows.forEach(row => {\n const rowState = row.original[rowStateKey]\n row.subRows.length = rowState.subRowCount\n })\n }\n }\n setRowProps(rows)\n })\n }\n\n const getRowId = React.useMemo(() => {\n const defaultGetRowId = (row, index, parent) => {\n return `${parent ? [parent.id, index].join('.') : index}`\n }\n if (!useServerData) {\n return defaultGetRowId\n }\n return (row, index, parent) => {\n if (row[rowStateKey]) {\n return row[rowStateKey].id\n }\n // Fall back for backends that don't implement row state\n return defaultGetRowId(row, index, parent)\n }\n }, [useServerData])\n\n const { state, ...instance } = useTable(\n {\n columns,\n data,\n initialState: {\n hiddenColumns: dataColumns.filter(col => col.show === false).map(col => col.id),\n groupBy: groupBy || [],\n sortBy: defaultSorted || [],\n pageSize: defaultPageSize,\n selectedRowIds: defaultSelected\n ? defaultSelected.reduce((obj, index) => ({ ...obj, [index]: true }), {})\n : {}\n },\n globalFilter,\n paginateExpandedRows: paginateSubRows ? true : false,\n disablePagination: !pagination,\n getSubRows,\n getRowId,\n // Maintain grouped state when the data changes\n autoResetGroupBy: false,\n // Maintain sorted state when the data changes\n autoResetSortBy: false,\n // Maintain expanded state when groupBy, sortBy, defaultPageSize change.\n // Expanded state is still reset when the data changes via dataKey or updateReactable.\n autoResetExpanded: false,\n // Maintain filtered state when the data changes\n autoResetFilters: false,\n autoResetGlobalFilter: false,\n // Maintain selected state when groupBy, sortBy, defaultPageSize change.\n // Selected state is still reset when the data changes via dataKey or updateReactable.\n autoResetSelectedRows: false,\n // Maintain resized state when the data changes\n autoResetResize: false,\n // Reset current page when the data changes (e.g., sorting, filtering, searching)\n autoResetPage: true,\n manualPagination: useServerData,\n manualSortBy: useServerData,\n manualGlobalFilter: useServerData,\n manualFilters: useServerData,\n manualGroupBy: useServerData,\n // TODO for when server-side row selection is implemented - need the ability to select all first\n // manualRowSelectedKey: useServerData ? rowSelectedKey : null,\n // TODO for when server-side row expansion is implemented\n // Disable manual row expansion\n manualExpandedKey: null,\n // Prevent duplicate sub rows when sub rows are paginated server-side\n expandSubRows: !(useServerData && paginateSubRows),\n rowCount: useServerData ? serverRowCount : null\n },\n useServerSideRows,\n useResizeColumns,\n useFlexLayout,\n useStickyColumns,\n useFilters,\n useGlobalFilter,\n useGroupBy,\n useSortBy,\n useExpanded,\n usePagination,\n useRowSelect,\n useRowSelectColumn,\n useCrosstalkColumn\n )\n\n // Server-side data\n const skipInitialFetch = React.useRef(initialServerRowCount != null)\n React.useEffect(() => {\n if (!useServerData) {\n return\n }\n // Skip initial data fetch if the first page was provided\n if (skipInitialFetch.current) {\n skipInitialFetch.current = false\n return\n }\n const url = new window.URL(dataURL, window.location)\n const params = {\n pageIndex: state.pageIndex,\n pageSize: state.pageSize,\n sortBy: state.sortBy,\n filters: state.filters,\n searchValue: state.globalFilter,\n groupBy: state.groupBy,\n expanded: state.expanded,\n selectedRowIds: state.selectedRowIds\n }\n window\n .fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(params)\n })\n .then(res => res.json())\n .then(body => {\n const data = normalizeColumnData(body.data, dataColumns)\n const { rowCount, maxRowCount } = body\n setNewData(data)\n setServerRowCount(rowCount)\n setServerMaxRowCount(maxRowCount)\n })\n .catch(err => {\n console.error(err)\n })\n }, [\n useServerData,\n dataURL,\n state.pageIndex,\n state.pageSize,\n state.sortBy,\n state.filters,\n state.globalFilter,\n state.groupBy,\n state.expanded,\n state.selectedRowIds,\n dataColumns\n ])\n\n // Update table when default values change (preserves behavior from v6)\n useMountedLayoutEffect(() => {\n const setSortBy = instance.setSortBy\n setSortBy(defaultSorted || [])\n }, [instance.setSortBy, defaultSorted])\n\n useMountedLayoutEffect(() => {\n const setGroupBy = instance.setGroupBy\n setGroupBy(groupBy || [])\n }, [instance.setGroupBy, groupBy])\n\n useMountedLayoutEffect(() => {\n const setPageSize = instance.setPageSize\n setPageSize(defaultPageSize)\n }, [instance.setPageSize, defaultPageSize])\n\n useMountedLayoutEffect(() => {\n const setRowsSelected = instance.setRowsSelected\n setRowsSelected((defaultSelected || []).map(index => String(index)))\n }, [instance.setRowsSelected, defaultSelected])\n\n const rowsById = instance.preFilteredRowsById || instance.rowsById\n const selectedRowIndexes = React.useMemo(() => {\n return Object.keys(state.selectedRowIds).reduce((indexes, id) => {\n const row = rowsById[id]\n if (row) {\n indexes.push(row.index)\n }\n return indexes\n }, [])\n }, [state.selectedRowIds, rowsById])\n\n // Update Shiny on selected row changes (deprecated in v0.2.0)\n React.useEffect(() => {\n if (!selection) {\n return\n }\n // Convert to R's 1-based indices\n const selectedIndexes = selectedRowIndexes.map(index => index + 1)\n\n if (selectionId && window.Shiny) {\n window.Shiny.onInputChange(selectionId, selectedIndexes)\n }\n }, [selectedRowIndexes, selection, selectionId])\n\n // Reset searched state when table is no longer searchable\n const searchableRef = React.useRef(searchable)\n safeUseLayoutEffect(() => {\n if (searchableRef.current && !searchable) {\n const setGlobalFilter = instance.setGlobalFilter\n setGlobalFilter(undefined)\n }\n searchableRef.current = searchable\n }, [searchable, instance.setGlobalFilter])\n\n const makeSearch = () => {\n if (!searchable) {\n return null\n }\n return (\n \n )\n }\n\n const rowData = convertRowsToV6(instance.rows)\n const stateInfo = React.useMemo(() => {\n return {\n ...state,\n searchValue: state.globalFilter,\n meta,\n hiddenColumns: state.hiddenColumns.filter(id => id !== crosstalkId),\n // For v6 compatibility\n sorted: state.sortBy,\n pageRows: convertRowsToV6(instance.page),\n sortedData: rowData,\n data: data,\n page: state.pageIndex,\n pageSize: state.pageSize,\n pages: instance.pageCount,\n selected: selectedRowIndexes\n }\n }, [\n state,\n meta,\n crosstalkId,\n instance.page,\n rowData,\n data,\n instance.pageCount,\n selectedRowIndexes\n ])\n\n const makeThead = () => {\n const theadProps = instance.getTheadProps()\n return (\n \n {makeHeaders()}\n {makeFilters()}\n \n )\n }\n\n // Get actual width of the column for resizing\n const headerRefs = React.useRef({})\n const handleHeader = column => {\n column.getDOMWidth = () => {\n return headerRefs.current[column.id].getBoundingClientRect().width\n }\n if (column.headers && column.headers.length) {\n column.headers.forEach(col => handleHeader(col))\n }\n }\n instance.headers.forEach(handleHeader)\n\n const makeHeaders = () => {\n return instance.headerGroups.map((headerGroup, i) => {\n const isGroupHeader = i < instance.headerGroups.length - 1\n const { key: headerGroupKey, ...headerGroupProps } = headerGroup.getHeaderGroupProps({\n className: isGroupHeader ? 'rt-tr-group-header' : 'rt-tr-header'\n })\n return (\n \n {headerGroup.headers.map(column => {\n column = {\n ...column,\n column, // Deprecated in v0.3.0\n data: rowData // Deprecated in v0.3.0\n }\n let header =\n typeof column.Header === 'function'\n ? column.Header(column, stateInfo)\n : column.render('Header')\n\n let headerProps = {\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null,\n ref: el => (headerRefs.current[column.id] = el)\n }\n if (isGroupHeader) {\n const { className: themeClass, innerClassName } = getCellTheme(theme.groupHeaderStyle)\n headerProps = {\n ...headerProps,\n 'aria-colspan': column.totalVisibleHeaderCount,\n className: classNames(\n !column.isUngrouped ? 'rt-th-group' : 'rt-th-group-none',\n column.headerClassName,\n themeClass\n ),\n innerClassName,\n style: column.headerStyle,\n canResize: column.canResize\n }\n } else {\n const { className: themeClass, innerClassName } = getCellTheme(theme.headerStyle)\n headerProps = {\n ...headerProps,\n // Assign cell role to selectable column headers to prevent input labels\n // from being read as column names (\"select all rows column\").\n role: column.selectable ? 'cell' : 'columnheader',\n className: classNames(column.headerClassName, themeClass),\n innerClassName,\n style: column.headerStyle,\n canResize: column.canResize,\n isResizing: column.isResizing\n }\n\n if (column.canSort) {\n headerProps = {\n ...headerProps,\n 'aria-label': renderTemplate(language.sortLabel, { name: column.name }),\n canSort: column.canSort,\n sortDescFirst: column.sortDescFirst,\n isSorted: column.isSorted,\n isSortedDesc: column.isSortedDesc,\n // Use toggleSortBy instead of getSortByToggleProps() for more control over sorting\n toggleSortBy: column.toggleSortBy\n }\n }\n }\n\n let resizer\n if (column.canResize) {\n const { onMouseDown, onTouchStart } = column.getResizerProps()\n resizer = (\n {\n onMouseDown(e)\n // Prevent resizer from highlighting text\n e.preventDefault()\n }}\n onTouchStart={onTouchStart}\n onClick={e => {\n // Prevent resizer from toggling sorting\n e.stopPropagation()\n }}\n />\n )\n }\n\n if (column.selectable && selection === 'multiple' && instance.rows.length > 0) {\n const toggleAllRowsSelected = () => instance.toggleAllRowsSelected()\n headerProps = {\n ...headerProps,\n onClick: toggleAllRowsSelected,\n className: classNames(headerProps.className, 'rt-td-select')\n }\n header = (\n \n )\n }\n\n const { key, ...resolvedHeaderProps } = column.getHeaderProps(headerProps)\n return (\n \n {header}\n {resizer}\n \n )\n })}\n \n )\n })\n }\n\n // Use column.filterable over column.canFilter because useGlobalFilter\n // currently sets canFilter to true on columns with disableFilters = true.\n // https://github.com/tannerlinsley/react-table/issues/2787\n const isFilterable = instance.visibleColumns.some(col => col.filterable)\n\n // Reset filtered state when table is no longer filterable\n const filterableRef = React.useRef(isFilterable)\n safeUseLayoutEffect(() => {\n if (filterableRef.current && !isFilterable) {\n const setAllFilters = instance.setAllFilters\n setAllFilters(instance.visibleColumns.map(col => ({ id: col.id, value: undefined })))\n }\n filterableRef.current = isFilterable\n }, [isFilterable, instance.visibleColumns, instance.setAllFilters])\n\n const makeFilters = () => {\n if (!isFilterable) {\n return null\n }\n\n return (\n \n {instance.visibleColumns.map(column => {\n let filter\n // Use column.filterable over column.canFilter because useGlobalFilter\n // currently sets canFilter to true on columns with disableFilters = true.\n // https://github.com/TanStack/react-table/issues/2787\n if (column.filterable) {\n if (column.filterInput != null) {\n let filterInput\n if (typeof column.filterInput === 'function') {\n filterInput = column.filterInput(column, stateInfo)\n } else {\n filterInput = hydrate({ Fragment, WidgetContainer }, column.filterInput)\n }\n if (React.isValidElement(filterInput)) {\n filter = filterInput\n } else if (column.html) {\n filter = \n }\n } else {\n filter = (\n \n )\n }\n }\n\n const { className: themeClass, innerClassName } = getCellTheme(theme.filterCellStyle)\n const filterCellProps = {\n role: 'cell',\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null,\n className: classNames('rt-td-filter', column.headerClassName, themeClass),\n innerClassName,\n style: column.headerStyle\n }\n const { key, ...resolvedFilterCellProps } = column.getHeaderProps(filterCellProps)\n return (\n \n {filter}\n \n )\n })}\n \n )\n }\n\n safeUseLayoutEffect(() => {\n const toggleAllRowsExpanded = instance.toggleAllRowsExpanded\n if (defaultExpanded) {\n toggleAllRowsExpanded(true)\n } else {\n toggleAllRowsExpanded(false)\n }\n }, [instance.toggleAllRowsExpanded, defaultExpanded])\n\n // Track expanded columns for multiple row details\n const [expandedColumns, setExpandedColumns] = React.useState({})\n const makeRowDetails = (rowInfo, state) => {\n // Ensure that row is expanded and not a grouped row. Row details are\n // currently not supported on grouped rows.\n if (!rowInfo.isExpanded || rowInfo.isGrouped) {\n return null\n }\n\n const expandedId = expandedColumns[rowInfo.id]\n let expandedCol\n if (expandedId != null) {\n expandedCol = instance.visibleColumns.find(col => col.id === expandedId)\n } else {\n // When expanding all rows, default to the first column with details\n expandedCol = instance.visibleColumns.find(col => col.details)\n }\n // Ensure that row details exist. Rows may have expanded state even though\n // there are no row details (when defaultExpanded = true).\n if (!expandedCol) {\n return null\n }\n\n const { details, html } = expandedCol\n let props = {}\n if (typeof details === 'function') {\n let content = details(rowInfo, state)\n if (html) {\n props.html = content\n }\n props.children = content\n } else if (Array.isArray(details)) {\n let content = details[rowInfo.index]\n if (content == null) {\n // No content to render. Although this row has no expander, it may still\n // have expanded state (when defaultExpanded = true).\n return null\n }\n if (html) {\n props.html = content\n }\n props.children = hydrate({ Reactable, Fragment, WidgetContainer }, content)\n }\n // Set key to force updates when expanding a different column or changing page\n return \n }\n\n const makeTbody = () => {\n const hasStickyColumns = instance.visibleColumns.some(column => column.sticky)\n let rowHighlightClass = hasStickyColumns ? 'rt-tr-highlight-sticky' : 'rt-tr-highlight'\n let rowStripedClass = hasStickyColumns ? 'rt-tr-striped-sticky' : 'rt-tr-striped'\n\n const rows = instance.page.map((row, viewIndex) => {\n instance.prepareRow(row)\n\n // toggleRowSelected that supports single selection\n const toggleRowSelected = set => {\n if (set == null) {\n set = !row.isSelected\n }\n if (selection === 'single') {\n instance.setRowsSelected([])\n }\n row.toggleRowSelected(set)\n }\n\n const rowInfo = {\n ...row,\n toggleRowSelected,\n // For v6 compatibility\n viewIndex,\n row: row.values, // Deprecated in v0.3.0\n subRows: convertRowsToV6(row.subRows),\n aggregated: row.isGrouped,\n expanded: row.isExpanded,\n level: row.depth,\n selected: row.isSelected,\n page: state.pageIndex // Deprecated in v0.3.0\n }\n\n const rowProps = {\n className: classNames(\n striped && (viewIndex % 2 ? null : rowStripedClass),\n highlight && rowHighlightClass,\n row.isSelected && 'rt-tr-selected',\n css(theme.rowStyle)\n )\n }\n if (rowClassName) {\n let rowCls\n if (typeof rowClassName === 'function') {\n rowCls = rowClassName(rowInfo, stateInfo)\n } else if (Array.isArray(rowClassName)) {\n rowCls = rowClassName[rowInfo.index]\n } else {\n rowCls = rowClassName\n }\n rowProps.className = classNames(rowProps.className, rowCls)\n }\n if (rowStyle) {\n if (typeof rowStyle === 'function') {\n rowProps.style = rowStyle(rowInfo, stateInfo)\n } else if (Array.isArray(rowStyle)) {\n rowProps.style = rowStyle[rowInfo.index]\n } else {\n rowProps.style = rowStyle\n }\n }\n\n const rowDetails = makeRowDetails(rowInfo, stateInfo)\n\n let expandedId\n if (row.isExpanded) {\n if (expandedColumns[row.id] != null) {\n expandedId = expandedColumns[row.id]\n } else {\n // When expanding all rows, default to the first column with details\n const expandedCol = instance.visibleColumns.find(col => col.details)\n expandedId = expandedCol ? expandedCol.id : null\n }\n }\n\n const resolvedRowProps = row.getRowProps(rowProps)\n return (\n // Use relative row index for key (like in v6) rather than row index (v7)\n // for better rerender performance, especially with a large number of rows.\n \n \n {row.cells.map((cell, colIndex) => {\n const { column } = cell\n let cellProps = column.getProps ? column.getProps(rowInfo, column, stateInfo) : {}\n const { className: themeClass, innerClassName } = getCellTheme(theme.cellStyle)\n cellProps = {\n ...cellProps,\n className: classNames(cellProps.className, themeClass),\n innerClassName,\n role: column.rowHeader ? 'rowheader' : 'cell'\n }\n const cellInfo = {\n ...cell,\n column,\n filterValue: column.filterValue,\n ...rowInfo\n }\n let value\n if (cell.isGrouped) {\n value = column.Grouped ? column.Grouped(cellInfo, stateInfo) : cellInfo.value\n } else if (cell.isAggregated) {\n value = column.Aggregated\n ? column.Aggregated(cellInfo, stateInfo)\n : cell.render('Aggregated')\n } else if (cell.isPlaceholder) {\n value = ''\n } else {\n value = column.Cell ? column.Cell(cellInfo, stateInfo) : cell.render('Cell')\n }\n\n let hasDetails\n if (column.details && !row.isGrouped) {\n if (Array.isArray(column.details) && column.details[row.index] == null) {\n // Don't expand rows without content\n } else {\n hasDetails = true\n }\n }\n\n let expander\n if (hasDetails) {\n const isExpanded = row.isExpanded && expandedId === column.id\n cellProps = {\n ...cellProps,\n onClick: () => {\n if (isExpanded) {\n row.toggleRowExpanded(false)\n const newExpandedColumns = { ...expandedColumns }\n delete newExpandedColumns[row.id]\n setExpandedColumns(newExpandedColumns)\n } else {\n row.toggleRowExpanded(true)\n const newExpandedColumns = { ...expandedColumns, [row.id]: column.id }\n setExpandedColumns(newExpandedColumns)\n }\n },\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n // Hide overflow ellipsis and prevent text selection on expander-only columns\n if (value === emptyValue) {\n cellProps.style = { textOverflow: 'clip', userSelect: 'none', ...cellProps.style }\n }\n const expanderProps = {\n isExpanded: isExpanded,\n className: css(theme.expanderStyle),\n 'aria-label': language.detailsExpandLabel\n }\n expander = \n } else if (cell.isGrouped) {\n const isExpanded = row.isExpanded\n cellProps = {\n ...cellProps,\n onClick: () => row.toggleRowExpanded(),\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n const expanderProps = {\n isExpanded: isExpanded,\n className: css(theme.expanderStyle),\n 'aria-label': language.groupExpandLabel\n }\n expander = \n } else if (cell.column.isGrouped && row.canExpand) {\n // Make all grouped column cells expandable (including placeholders)\n cellProps = {\n ...cellProps,\n onClick: () => row.toggleRowExpanded(),\n className: classNames(cellProps.className, 'rt-td-expandable')\n }\n }\n\n const canRowSelect =\n selection === 'multiple' || (selection === 'single' && !cell.isAggregated)\n\n if (column.selectable && canRowSelect) {\n cellProps = {\n ...cellProps,\n onClick: () => toggleRowSelected(),\n className: classNames(cellProps.className, 'rt-td-select')\n }\n let ariaLabel\n if (cell.isAggregated) {\n ariaLabel = language.selectAllSubRowsLabel\n } else {\n ariaLabel = language.selectRowLabel\n }\n value = (\n toggleRowSelected()}\n aria-label={ariaLabel}\n />\n )\n }\n\n // Add cell click actions. Don't override existing click actions.\n if (onClick && !cellProps.onClick) {\n if (onClick === 'expand') {\n cellProps.onClick = () => row.toggleRowExpanded()\n } else if (onClick === 'select' && canRowSelect) {\n cellProps.onClick = () => toggleRowSelected()\n } else if (typeof onClick === 'function') {\n cellProps.onClick = () => onClick(rowInfo, column, stateInfo)\n }\n }\n\n const resolvedCellProps = cell.getCellProps(cellProps)\n return (\n // Use column ID for key (like in v6) rather than row index (v7)\n // for better rerender performance, especially with a large number of rows.\n \n {expander}\n {value}\n \n )\n })}\n \n {rowDetails}\n \n )\n })\n\n let padRows\n // Leave at least one row to show the no data message properly\n minRows = minRows ? Math.max(minRows, 1) : 1\n const padRowCount = Math.max(minRows - instance.page.length, 0)\n if (padRowCount > 0) {\n padRows = [...Array(padRowCount)].map((_, viewIndex) => {\n const rowProps = {\n className: classNames('rt-tr-pad', css(theme.rowStyle))\n }\n if (rowClassName) {\n let rowCls\n if (typeof rowClassName === 'function') {\n rowCls = rowClassName(undefined, stateInfo)\n } else if (Array.isArray(rowClassName)) {\n // rowClassName not used for pad rows\n } else {\n rowCls = rowClassName\n }\n rowProps.className = classNames(rowProps.className, rowCls)\n }\n if (rowStyle) {\n if (typeof rowStyle === 'function') {\n rowProps.style = rowStyle(undefined, stateInfo)\n } else if (Array.isArray(rowStyle)) {\n // rowStyle not used for pad rows\n } else {\n rowProps.style = rowStyle\n }\n }\n return (\n \n \n {instance.visibleColumns.map(column => {\n const { className: themeClass, innerClassName } = getCellTheme(theme.cellStyle)\n const cellProps = {\n className: themeClass\n }\n // Get layout styles (flex, sticky) from footer props. useFlexLayout\n // doesn't have built-in support for pad cells.\n const { className, style } = column.getFooterProps(cellProps)\n return (\n \n  \n \n )\n })}\n \n \n )\n })\n }\n\n let className = css(theme.tableBodyStyle)\n let noData\n if (instance.rows.length === 0) {\n noData = {language.noData}\n // Hide cell borders when table has no data\n className = classNames('rt-tbody-no-data', className)\n } else {\n // Must be on the page for the ARIA live region to be announced\n noData = \n }\n const tbodyProps = instance.getTableBodyProps({ className })\n\n return (\n \n {rows}\n {padRows}\n {noData}\n \n )\n }\n\n const makeTfoot = () => {\n const hasFooters = instance.visibleColumns.some(column => column.footer != null)\n if (!hasFooters) {\n return null\n }\n\n const tfootProps = instance.getTfootProps()\n return (\n \n \n {instance.visibleColumns.map(column => {\n column = {\n ...column,\n column, // Deprecated in v0.3.0\n data: rowData // Deprecated in v0.3.0\n }\n const footer =\n typeof column.Footer === 'function'\n ? column.Footer(column, stateInfo)\n : column.render('Footer')\n\n const { className: themeClass, innerClassName } = getCellTheme(theme.footerStyle)\n const footerProps = {\n className: classNames('rt-td-footer', column.footerClassName, themeClass),\n innerClassName,\n style: column.footerStyle,\n role: column.rowHeader ? 'rowheader' : 'cell',\n // colspan doesn't apply to ARIA tables, but react-table adds it. Remove it.\n colSpan: null\n }\n const { key, ...resolvedFooterProps } = column.getFooterProps(footerProps)\n return (\n \n {footer}\n \n )\n })}\n \n \n )\n }\n\n // Track the max number of rows for auto-shown pagination. Unfortunately, the max\n // number of rows can't be determined up front in a grouped and filtered table\n // because grouping happens after filtering (and swapping these hooks would\n // disable dynamic aggregation). Instead, we track the max number of rows\n // per dataset, so at least the pagination doesn't disappear upon filtering.\n //\n // Unused for server-side pagination.\n const maxRowCount = React.useRef(\n paginateSubRows ? instance.flatRows.length : instance.rows.length\n )\n\n React.useEffect(() => {\n maxRowCount.current = 0\n }, [data])\n\n React.useEffect(() => {\n const rowCount = paginateSubRows ? instance.flatRows.length : instance.rows.length\n if (rowCount > maxRowCount.current) {\n maxRowCount.current = rowCount\n }\n }, [paginateSubRows, instance.flatRows, instance.rows])\n\n const makePagination = () => {\n if (showPagination === false) {\n return null\n } else if (!pagination && showPagination == null) {\n // Unpaginated tables can still have a visible pagination bar (e.g., for page info)\n return null\n } else if (pagination && showPagination == null) {\n // Auto-hide pagination if the entire table fits on one page\n const minPageSize = showPageSizeOptions\n ? Math.min(state.pageSize, ...(pageSizeOptions || []))\n : state.pageSize\n\n let rowCount\n if (serverMaxRowCount != null) {\n rowCount = serverMaxRowCount\n } else if (serverRowCount != null) {\n // If the optional server-side maxRowCount isn't provided, fall back to\n // serverRowCount so at least the pagination bar appears when expanding\n // a table past its initial page.\n rowCount = serverRowCount\n } else {\n rowCount = maxRowCount.current\n }\n if (rowCount <= minPageSize) {\n return null\n }\n }\n return (\n \n )\n }\n\n // Add keyboard-only focus styles\n const rootElement = React.useRef(null)\n const keyboardActiveProps = {\n onMouseDown: () => {\n rootElement.current.classList.remove('rt-keyboard-active')\n },\n onKeyDown: () => {\n rootElement.current.classList.add('rt-keyboard-active')\n },\n onKeyUp: e => {\n // Detect keyboard use when tabbing into the table\n const keyCode = e.which || e.keyCode\n if (keyCode === 9) {\n rootElement.current.classList.add('rt-keyboard-active')\n }\n }\n }\n\n // Provide keyboard access to scrollable tables. Make the table focusable,\n // but only when it has a scrollbar.\n const tableElement = React.useRef(null)\n const [tableHasScrollbar, setTableHasScrollbar] = React.useState(false)\n safeUseLayoutEffect(() => {\n const checkTableHasScrollbar = () => {\n const { scrollHeight, clientHeight, scrollWidth, clientWidth } = tableElement.current\n const hasScrollbar = scrollHeight > clientHeight || scrollWidth > clientWidth\n setTableHasScrollbar(hasScrollbar)\n }\n if (window.ResizeObserver) {\n const resizeObserver = new ResizeObserver(() => {\n checkTableHasScrollbar()\n })\n resizeObserver.observe(tableElement.current)\n return function cleanup() {\n resizeObserver.disconnect()\n }\n } else {\n // Degrade gracefully on older browsers (e.g., Safari < 13)\n checkTableHasScrollbar()\n }\n }, [])\n\n // Send reactable state to Shiny for getReactableState\n React.useEffect(() => {\n // Ignore nested tables that aren't Shiny outputs\n if (!window.Shiny || !window.Shiny.onInputChange || nested) {\n return\n }\n // Ensure this is a Shiny output, not a static rendered table in Shiny\n const outputId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n if (!outputId) {\n return\n }\n // Convert to R's 1-based indices\n const selectedIndexes = stateInfo.selected.map(index => index + 1)\n // Convert to R's 1-based indices\n const page = stateInfo.page + 1\n // Convert sortBy array to named list of \"asc\" and \"desc\"\n let sorted = stateInfo.sorted.length > 0 ? {} : null\n for (let sortInfo of stateInfo.sorted) {\n sorted[sortInfo.id] = sortInfo.desc ? 'desc' : 'asc'\n }\n\n // NOTE: any object arrays will be simplified into vectors by jsonlite by default. Avoid sending\n // arrays without transforming them first, or adding a custom input type and input handler.\n const state = {\n page: page,\n pageSize: stateInfo.pageSize,\n pages: stateInfo.pages,\n sorted: sorted,\n selected: selectedIndexes\n }\n // Shiny.onInputChange has built-in debouncing, so it's not strictly necessary to\n // debounce rapid state changes here.\n Object.keys(state).forEach(prop => {\n // NOTE: output IDs must always come first to work with Shiny modules\n window.Shiny.onInputChange(`${outputId}__reactable__${prop}`, state[prop])\n })\n }, [\n nested,\n stateInfo.page,\n stateInfo.pageSize,\n stateInfo.pages,\n stateInfo.sorted,\n stateInfo.selected\n ])\n\n // Getter for the latest page count\n const getPageCount = useGetLatest(instance.pageCount)\n\n // Add Shiny message handler for updateReactable\n React.useEffect(() => {\n // Ignore nested tables that aren't Shiny outputs\n if (!window.Shiny || nested) {\n return\n }\n // Ensure this is a Shiny output, not a static rendered table in Shiny\n const outputId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n if (!outputId) {\n return\n }\n const setRowsSelected = instance.setRowsSelected\n const gotoPage = instance.gotoPage\n const toggleAllRowsExpanded = instance.toggleAllRowsExpanded\n\n const updateState = newState => {\n if (newState.jsEvals) {\n for (let key of newState.jsEvals) {\n window.HTMLWidgets.evaluateStringMember(newState, key)\n }\n }\n if (newState.data != null) {\n const data = normalizeColumnData(newState.data, dataColumns)\n setNewData(data)\n }\n if (newState.selected != null) {\n const selectedRowIds = newState.selected.map(index => String(index))\n setRowsSelected(selectedRowIds)\n }\n if (newState.page != null) {\n // Get the latest page count in case a data update changes the number of pages\n const nearestValidPage = Math.min(\n Math.max(newState.page, 0),\n Math.max(getPageCount() - 1, 0)\n )\n gotoPage(nearestValidPage)\n }\n if (newState.expanded != null) {\n if (newState.expanded) {\n toggleAllRowsExpanded(true)\n } else {\n toggleAllRowsExpanded(false)\n }\n }\n if (newState.meta !== undefined) {\n setMeta(newState.meta)\n }\n }\n window.Shiny.addCustomMessageHandler(`__reactable__${outputId}`, updateState)\n }, [\n nested,\n instance.setRowsSelected,\n instance.gotoPage,\n instance.toggleAllRowsExpanded,\n dataColumns,\n getPageCount,\n setMeta\n ])\n\n // Set up Crosstalk and apply initial selection/filtering.\n // useLayoutEffect so the hook runs in order with other useLayoutEffect hooks.\n const ctRef = React.useRef(null)\n\n safeUseLayoutEffect(() => {\n if (!crosstalkGroup || !window.crosstalk) {\n return\n }\n\n const ct = {}\n ct.selection = new window.crosstalk.SelectionHandle(crosstalkGroup)\n ct.filter = new window.crosstalk.FilterHandle(crosstalkGroup)\n // Keep track of selected and filtered state updated by other widgets.\n // SelectionHandle and FilterHandle also track state, but will include changes\n // coming from the table as well.\n ct.selected = ct.selection.value\n ct.filtered = ct.filter.filteredKeys\n ctRef.current = ct\n\n const rowByKey = (crosstalkKey || []).reduce((obj, key, index) => {\n obj[key] = index\n return obj\n }, {})\n\n const setFilter = instance.setFilter\n const setRowsSelected = instance.setRowsSelected\n const applyCrosstalkFilter = () => {\n // Selection value is an array of keys, or null or empty array if empty\n // Filter value is an an array of keys, or null if empty\n const selectedKeys = ct.selected && ct.selected.length > 0 ? ct.selected : null\n const filteredKeys = ct.filtered\n let keys\n if (!selectedKeys && !filteredKeys) {\n keys = null\n } else if (!selectedKeys) {\n keys = filteredKeys\n } else if (!filteredKeys) {\n keys = selectedKeys\n } else {\n keys = selectedKeys.filter(key => filteredKeys.includes(key))\n }\n const filteredRows = keys ? keys.map(key => rowByKey[key]) : null\n setFilter(crosstalkId, filteredRows)\n }\n\n const setCrosstalkSelection = value => {\n if (ct.selected !== value) {\n ct.selected = value\n applyCrosstalkFilter()\n }\n }\n\n const setCrosstalkFilter = value => {\n if (ct.filtered !== value) {\n ct.filtered = value\n applyCrosstalkFilter()\n }\n }\n\n ct.selection.on('change', e => {\n if (e.sender !== ct.selection) {\n setCrosstalkSelection(e.value)\n // Selections from other widgets should clear table selection state\n ct.skipNextSelection = true\n setRowsSelected([])\n } else {\n // Selections from table should clear selections from other widgets\n setCrosstalkSelection(null)\n }\n })\n\n ct.filter.on('change', e => {\n if (e.sender !== ct.filter) {\n setCrosstalkFilter(e.value)\n }\n })\n\n // Apply initial filter/selection for dynamically rendered tables (e.g., nested tables, Shiny outputs)\n if (ct.selected || ct.filtered) {\n applyCrosstalkFilter()\n }\n\n return function cleanup() {\n // Prevent errors from other widgets from breaking the table, e.g.,\n // https://github.com/ropensci/plotly/issues/1346\n try {\n ct.selection.close()\n } catch (e) {\n console.error('Error closing Crosstalk selection handle:', e)\n }\n try {\n ct.filter.close()\n } catch (e) {\n console.error('Error closing Crosstalk filter handle:', e)\n }\n }\n }, [crosstalkKey, crosstalkGroup, crosstalkId, instance.setFilter, instance.setRowsSelected])\n\n // Don't set Crosstalk selection on initial render\n safeUseLayoutEffect(() => {\n if (!ctRef.current) {\n return\n }\n if (!defaultSelected) {\n ctRef.current.skipNextSelection = true\n }\n }, [defaultSelected])\n\n // Set Crosstalk selection. useLayoutEffect to avoid visual flickering when\n // selecting a row and clearing a pre-existing selection at the same time.\n safeUseLayoutEffect(() => {\n if (!ctRef.current || !selection) {\n return\n }\n\n const ct = ctRef.current\n // Some selections don't update Crosstalk state, like selection clears from\n // other widget selections\n if (ct.skipNextSelection) {\n ct.skipNextSelection = false\n return\n }\n\n const selectedKeys = Object.keys(state.selectedRowIds).map(id => {\n return crosstalkKey[rowsById[id].index]\n })\n // Prevent errors from other widgets from breaking the table, e.g.,\n // https://github.com/ropensci/plotly/issues/1346\n try {\n ct.selection.set(selectedKeys)\n } catch (e) {\n console.error('Error selecting Crosstalk keys:', e)\n }\n }, [state.selectedRowIds, rowsById, selection, crosstalkKey])\n\n // Expose a limited JavaScript API to the table instance\n instance.state = stateInfo\n instance.downloadDataCSV = (filename, options = {}) => {\n filename = filename || 'data.csv'\n const csv = instance.getDataCSV(options)\n downloadCSV(csv, filename)\n }\n instance.getDataCSV = (options = {}) => {\n if (!options.columnIds) {\n options.columnIds = dataColumns.map(col => col.id)\n }\n // Ignore columns without data (e.g., selection or details columns) by default\n const dataColumnIds = data.length > 0 ? Object.keys(data[0]) : []\n options.columnIds = options.columnIds.filter(id => dataColumnIds.includes(id))\n // Ensure rows are flattened and ignore sort order. Unlike instance.flatRows,\n // instance.preGroupedRows excludes aggregated rows and uses the original data order.\n const rows = instance.preGroupedRows.map(row => row.values)\n const csv = rowsToCSV(rows, options)\n return csv\n }\n instance.setMeta = setMeta\n const origToggleHideColumn = instance.toggleHideColumn\n instance.toggleHideColumn = (columnId, isHidden) => {\n // Prevent duplicate column IDs from being added to hiddenColumns\n if (isHidden && stateInfo.hiddenColumns.includes(columnId)) {\n return\n }\n origToggleHideColumn(columnId, isHidden)\n }\n instance.setData = (data, options = {}) => {\n options = Object.assign({ resetSelected: true, resetExpanded: false }, options)\n if (typeof data !== 'object' || data == null) {\n throw new Error('data must be an array of row objects or an object containing column arrays')\n }\n // If data is in row format, it's assumed to have all numbers normalized (NA/NaN/Inf/-Inf not as strings)\n if (!Array.isArray(data)) {\n data = normalizeColumnData(data, dataColumns)\n }\n setNewData(data)\n if (options.resetSelected) {\n instance.setRowsSelected([])\n }\n if (options.resetExpanded) {\n instance.toggleAllRowsExpanded(false)\n }\n }\n\n let stateCallbacks = React.useRef([])\n instance.onStateChange = listenerFn => {\n if (typeof listenerFn !== 'function') {\n throw new Error('listenerFn must be a function')\n }\n stateCallbacks.current.push(listenerFn)\n return function cancel() {\n stateCallbacks.current = stateCallbacks.current.filter(cb => cb !== listenerFn)\n }\n }\n // Debounce rapid state changes. Some actions can cause the table to render twice, e.g., when\n // sorting and the pageIndex is automatically reset to 0 via an internal side effect.\n const onStateChange = useAsyncDebounce(state => {\n stateCallbacks.current.forEach(cb => {\n cb(state)\n })\n }, 0)\n React.useEffect(() => {\n onStateChange(stateInfo)\n }, [stateInfo, onStateChange])\n\n const getTableInstance = useGetLatest(instance)\n\n React.useEffect(() => {\n // For static rendered tables, the instance ID is the element ID. For Shiny outputs,\n // the instance ID is the Shiny output ID, although the element ID may override it.\n let instanceId = elementId\n if (!instanceId) {\n instanceId = rootElement.current.parentElement.getAttribute('data-reactable-output')\n }\n if (!instanceId) {\n return\n }\n\n tableInstances[instanceId] = getTableInstance\n\n return function cleanup() {\n delete tableInstances[instanceId]\n }\n }, [elementId, getTableInstance])\n\n className = classNames(\n className,\n css(theme.style),\n outlined && 'rt-outlined',\n bordered && 'rt-bordered',\n borderless && 'rt-borderless',\n compact && 'rt-compact',\n nowrap && 'rt-nowrap',\n inline && ' rt-inline'\n )\n style = { width, height, ...style }\n\n const isResizing = state.columnResizing.isResizingColumn != null\n const tableClassName = classNames(css(theme.tableStyle), isResizing && 'rt-resizing')\n\n return (\n \n {makeSearch()}\n \n {makeThead()}\n {makeTbody()}\n {makeTfoot()}\n \n {makePagination()}\n \n )\n}\n\nReactable.propTypes = {\n data: PropTypes.objectOf(PropTypes.array).isRequired,\n columns: PropTypes.arrayOf(PropTypes.object).isRequired,\n columnGroups: PropTypes.arrayOf(PropTypes.object),\n groupBy: PropTypes.arrayOf(PropTypes.string),\n sortable: PropTypes.bool,\n resizable: PropTypes.bool,\n filterable: PropTypes.bool,\n searchable: PropTypes.bool,\n searchMethod: PropTypes.func,\n defaultSortDesc: PropTypes.bool,\n defaultSorted: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string, desc: PropTypes.bool })),\n pagination: PropTypes.bool,\n defaultPageSize: PropTypes.number,\n pageSizeOptions: PropTypes.arrayOf(PropTypes.number),\n paginationType: PropTypes.oneOf(['numbers', 'jump', 'simple']),\n showPagination: PropTypes.bool,\n showPageSizeOptions: PropTypes.bool,\n showPageInfo: PropTypes.bool,\n minRows: PropTypes.number,\n paginateSubRows: PropTypes.bool,\n defaultExpanded: PropTypes.bool,\n selection: PropTypes.oneOf(['multiple', 'single']),\n selectionId: PropTypes.string, // Deprecated in v0.3.0\n defaultSelected: PropTypes.arrayOf(PropTypes.number),\n onClick: PropTypes.oneOfType([PropTypes.oneOf(['expand', 'select']), PropTypes.func]),\n outlined: PropTypes.bool,\n bordered: PropTypes.bool,\n borderless: PropTypes.bool,\n striped: PropTypes.bool,\n highlight: PropTypes.bool,\n compact: PropTypes.bool,\n nowrap: PropTypes.bool,\n showSortIcon: PropTypes.bool,\n showSortable: PropTypes.bool,\n className: PropTypes.string,\n style: PropTypes.object,\n rowClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.func, PropTypes.array]),\n rowStyle: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.array]),\n inline: PropTypes.bool,\n width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n height: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),\n theme: PropTypes.object,\n language: PropTypes.object,\n meta: PropTypes.object,\n crosstalkKey: PropTypes.array,\n crosstalkGroup: PropTypes.string,\n crosstalkId: PropTypes.string,\n elementId: PropTypes.string,\n nested: PropTypes.bool,\n dataKey: PropTypes.string,\n dataURL: PropTypes.string,\n serverRowCount: PropTypes.number,\n serverMaxRowCount: PropTypes.number\n}\n\nReactable.defaultProps = {\n sortable: true,\n pagination: true,\n defaultPageSize: 10,\n paginationType: 'numbers',\n pageSizeOptions: [10, 25, 50, 100],\n showPageInfo: true,\n minRows: 1,\n showSortIcon: true,\n crosstalkId: '__crosstalk__'\n}\n\nReactableData.propTypes = Reactable.propTypes\nReactableData.defaultProps = Reactable.defaultProps\n","import React from 'react'\n\nexport default function useMeta(initialMeta = {}) {\n const [meta, setRawMeta] = React.useState(initialMeta)\n const setMeta = meta => {\n if (meta == null) {\n setRawMeta({})\n return\n }\n if (typeof meta !== 'object' && typeof meta !== 'function') {\n throw new Error('meta must be an object or function')\n }\n setRawMeta(prevMeta => {\n if (typeof meta === 'function') {\n meta = meta(prevMeta)\n }\n const newMeta = { ...prevMeta, ...meta }\n for (let [key, value] of Object.entries(newMeta)) {\n if (value === undefined) {\n delete meta[key]\n }\n }\n return newMeta\n })\n }\n return [meta, setMeta]\n}\n","import { reactWidget } from './reactR'\n\nimport Reactable from './Reactable'\n\nreactWidget('reactable', 'output', {\n Reactable\n})\n\nexport * from './Reactable'\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","React","ReactDOM","hydrate","components","tag","name","toUpperCase","Error","_step","args","attribs","_iterator","_createForOfIteratorHelper","children","s","n","done","child","push","err","e","f","_toConsumableArray","arr","Array","isArray","_arrayLikeToArray","_arrayWithoutHoles","iter","iterator","from","_iterableToArray","minLen","toString","slice","constructor","test","_unsupportedIterableToArray","TypeError","_nonIterableSpread","len","length","i","arr2","ownKeys","r","t","keys","getOwnPropertySymbols","filter","getOwnPropertyDescriptor","apply","_objectSpread","arguments","forEach","_defineProperty","getOwnPropertyDescriptors","defineProperties","arg","input","hint","_typeof","prim","toPrimitive","undefined","res","String","_toPrimitive","_toPropertyKey","configurable","writable","_objectWithoutProperties","source","excluded","target","sourceKeys","indexOf","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","renderErr","actions","init","emptyRenderer","defaultColumn","Cell","_ref","_ref$value","width","minWidth","maxWidth","Number","MAX_SAFE_INTEGER","mergeProps","_len","propList","_key","reduce","props","next","style","className","rest","_excluded","handlePropGetter","prevProps","userProps","meta","concat","makePropGetter","hooks","prev","reduceHooks","initial","loopHooks","context","hook","ensurePluginOrder","plugins","befores","pluginName","afters","findIndex","plugin","before","functionalUpdate","updater","old","useGetLatest","ref","current","safeUseLayoutEffect","document","useMountedLayoutEffect","fn","deps","mountedRef","makeRenderer","instance","column","type","Comp","console","info","flexRender","component","proto","getPrototypeOf","isReactComponent","isClassComponent","$$typeof","includes","description","isExoticComponent","linkColumnStructure","columns","parent","depth","map","assignColumnAccessor","flattenColumns","flat","recurse","id","accessor","Header","accessorPath","split","row","path","def","val","cacheKey","JSON","stringify","pathObj","pathObjCache","flattenDeep","replace","join","reOpenBracket","reCloseBracket","makePathArray","set","cursor","pathPart","getBy","error","assign","decorateColumn","userDefaultColumn","Footer","originalWidth","makeHeaderGroups","allColumns","additionalHeaderProperties","headerGroups","scanColumns","uid","getUID","_loop","headerGroup","headers","parentColumns","hasParents","some","newParent","latestParentColumn","reverse","originalId","placeholderOf","Map","getFirstDefined","isFunction","expandRows","rows","manualExpandedKey","expanded","_ref$expandSubRows","expandSubRows","expandedRows","handleRow","addToExpandedRows","isExpanded","original","canExpand","subRows","getFilterMethod","userFilterTypes","filterTypes","text","shouldAutoRemoveFilter","autoRemove","unpreparedAccessWarning","newArr","defaultGetTableProps","role","defaultGetTableBodyProps","defaultGetHeaderProps","colSpan","totalVisibleHeaderCount","defaultGetFooterProps","_ref2","defaultGetHeaderGroupProps","_ref3","index","defaultGetFooterGroupProps","_ref4","defaultGetRowProps","_ref5","defaultGetCellProps","_ref6","cell","makeDefaultPluginHooks","useOptions","stateReducers","useControlledState","columnsDeps","allColumnsDeps","accessValue","materializedColumns","materializedColumnsDeps","useInstanceAfterData","visibleColumns","visibleColumnsDeps","headerGroupsDeps","useInstanceBeforeDimensions","useInstance","prepareRow","getTableProps","getTableBodyProps","getHeaderGroupProps","getFooterGroupProps","getHeaderProps","getFooterProps","getRowProps","getCellProps","useFinalInstance","resetHiddenColumns","toggleHideColumn","setHiddenColumns","toggleHideAllColumns","useColumnVisibility","getToggleHiddenProps","defaultGetToggleHiddenProps","getToggleHideAllColumnsProps","defaultGetToggleHideAllColumnsProps","reducer","state","hiddenColumns","onChange","toggleHidden","checked","isVisible","title","allColumnsHidden","indeterminate","action","previousState","initialState","columnId","shouldAll","handleColumn","parentVisible","subColumn","subHeader","flatHeaders","dispatch","getHooks","_instance$autoResetHi","autoResetHiddenColumns","getInstance","getAutoResetHiddenColumns","defaultInitialState","defaultColumnInstance","defaultReducer","prevState","defaultGetSubRows","defaultGetRowId","defaultUseControlledState","applyDefaults","_props$initialState","_props$defaultColumn","_props$getSubRows","getSubRows","_props$getRowId","getRowId","_props$stateReducer","stateReducer","_props$useControlledS","useTable","instanceRef","Boolean","_getInstance","data","userColumns","getStateReducer","handler","_React$useReducer","_React$useReducer2","_slicedToArray","reducerState","_React$useMemo","flatRows","rowsById","allColumnsQueue","shift","accessRowsForColumn","accessValueHooks","_React$useMemo2","initialRows","find","all","visibleColumnsDep","sort","_calculateHeaderWidth","calculateHeaderWidths","_calculateHeaderWidth2","totalColumnsMinWidth","totalColumnsWidth","totalColumnsMaxWidth","render","footerGroups","allCells","values","cells","left","sumTotalMinWidth","sumTotalWidth","sumTotalMaxWidth","sumTotalFlexWidth","header","subHeaders","totalLeft","_calculateHeaderWidth4","totalMinWidth","totalWidth","totalMaxWidth","totalFlexWidth","Math","min","max","canResize","accessRow","originalRow","rowIndex","parentRows","originalSubRows","resetExpanded","toggleRowExpanded","toggleAllRowsExpanded","useExpanded","getToggleAllRowsExpandedProps","defaultGetToggleAllRowsExpandedProps","getToggleRowExpandedProps","defaultGetToggleRowExpandedProps","onClick","isAllRowsExpanded","rowId","setExpanded","exists","shouldExist","_state$expanded","_instance$manualExpan","_instance$paginateExp","paginateExpandedRows","_instance$expandSubRo","_instance$autoResetEx","autoResetExpanded","getAutoResetExpanded","expandedDepth","maxDepth","splitId","findExpandedDepth","preExpandedRows","ids","filterValue","rowValue","toLowerCase","exactText","exactTextCase","includesAll","every","includesSome","includesValue","exact","equals","between","Infinity","temp","resetFilters","setFilter","setAllFilters","useFilters","filters","filterMethod","previousfilter","newFilter","manualFilters","_instance$defaultCanF","defaultCanFilter","disableFilters","_instance$autoResetFi","autoResetFilters","columnDefaultCanFilter","columnDisableFilters","canFilter","found","filteredFlatRows","filteredRowsById","filterRows","filteredRows","filteredSoFar","preFilteredRows","warn","nonFilteredColumns","getAutoResetFilters","preFilteredFlatRows","preFilteredRowsById","resetGlobalFilter","setGlobalFilter","useGlobalFilter","globalFilter","manualGlobalFilter","globalFilterValue","_instance$autoResetGl","autoResetGlobalFilter","disableGlobalFilter","columnDisableGlobalFilter","filterableColumns","c","globalFilteredRows","globalFilteredFlatRows","globalFilteredRowsById","getAutoResetGlobalFilter","preGlobalFilteredRows","preGlobalFilteredFlatRows","preGlobalFilteredRowsById","sum","aggregatedValues","minMax","average","median","mid","floor","nums","b","unique","Set","uniqueCount","size","count","resetGroupBy","setGroupBy","toggleGroupBy","reSplitAlphaNumeric","alphanumeric","rowA","rowB","_getRowValuesByColumn2","getRowValuesByColumnID","aa","bb","an","parseInt","bn","combo","isNaN","datetime","_getRowValuesByColumn4","compareBasic","getTime","basic","_getRowValuesByColumn6","string","_getRowValuesByColumn8","alower","blower","number","_getRowValuesByColumn10","replaceNonNumeric","row1","row2","resetSortBy","setSortBy","toggleSortBy","clearSortBy","sortType","sortDescFirst","useSortBy","getSortByToggleProps","defaultGetSortByToggleProps","_instance$isMultiSort","isMultiSortEvent","shiftKey","canSort","persist","disableMultiSort","sortBy","newSortBy","sortAction","desc","multi","disableSortRemove","disableMultiRemove","_instance$maxMultiSor","maxMultiSortColCount","existingSortBy","existingIndex","hasDescDefined","splice","_instance$orderByFn","orderByFn","defaultOrderByFn","userSortTypes","sortTypes","manualSortBy","defaultCanSort","disableSortBy","_instance$autoResetSo","autoResetSortBy","defaultColumnCanSort","columnDisableSortBy","columnSort","isSorted","sortedIndex","isSortedDesc","sortedFlatRows","availableSortBy","col","sortData","sortedData","sortMethod","sortInverted","sortedRows","getAutoResetSortBy","preSortedRows","preSortedFlatRows","funcs","dirs","sortFn","sortInt","resetPage","gotoPage","setPageSize","resetPivot","togglePivot","resetSelectedRows","toggleAllRowsSelected","toggleRowSelected","toggleAllPageRowsSelected","setRowState","setCellState","resetRowState","resetColumnOrder","setColumnOrder","columnStartResizing","columnResizing","columnDoneResizing","resetResize","reactR","StyleSheet","options","_this","this","_insertTag","tags","insertionPoint","nextSibling","prepend","container","firstChild","insertBefore","isSpeedy","speedy","ctr","nonce","_proto","nodes","insert","rule","createElement","setAttribute","appendChild","createTextNode","createStyleElement","sheet","styleSheets","ownerNode","sheetForTag","insertRule","cssRules","flush","parentNode","removeChild","abs","fromCharCode","trim","pattern","replacement","indexof","search","charCodeAt","begin","end","array","line","position","character","characters","node","root","return","copy","peek","caret","token","alloc","dealloc","delimit","delimiter","whitespace","escaping","commenter","identifier","MS","MOZ","WEBKIT","COMMENT","DECLARATION","KEYFRAMES","serialize","callback","output","element","prefix","hash","compile","parse","rules","rulesets","pseudo","points","declarations","offset","atrule","property","previous","variable","scanning","ampersand","reference","comment","declaration","ruleset","post","j","k","x","y","z","identifierWithPointTracking","fixedElements","WeakMap","compat","isImplicitRule","parsed","toRules","getRules","parentRules","removeLabel","defaultStylisPlugins","exec","match","str","h","animationIterationCount","borderImageOutset","borderImageSlice","borderImageWidth","boxFlex","boxFlexGroup","boxOrdinalGroup","columnCount","flex","flexGrow","flexPositive","flexShrink","flexNegative","flexOrder","gridRow","gridRowEnd","gridRowSpan","gridRowStart","gridColumn","gridColumnEnd","gridColumnSpan","gridColumnStart","msGridRow","msGridRowSpan","msGridColumn","msGridColumnSpan","fontWeight","lineHeight","opacity","order","orphans","tabSize","widows","zIndex","zoom","WebkitLineClamp","fillOpacity","floodOpacity","stopOpacity","strokeDasharray","strokeDashoffset","strokeMiterlimit","strokeOpacity","strokeWidth","hyphenateRegex","animationRegex","isCustomProperty","isProcessableValue","processStyleName","cache","create","styleName","processStyleValue","p1","p2","styles","handleInterpolation","mergedProps","registered","interpolation","__emotion_styles","anim","interpolated","_i","createStringFromObject","previousCursor","result","cached","labelPattern","serializeStyles","stringMode","strings","raw","lastIndex","identifierName","getRegisteredStyles","registeredStyles","classNames","rawClassName","insertStyles","serialized","isStringTag","registerStyles","inserted","insertWithoutScoping","merge","css","emotion","classnames","cls","toAdd","ssrStyles","querySelectorAll","getAttribute","head","_insert","stylisPlugins","nodesToHydrate","attrib","currentSheet","collection","finalizingPlugins","serializer","selector","shouldCache","cx","_len4","_key4","injectGlobal","_len3","_key3","keyframes","_len2","_key2","animation","bind","classes","removeEmptyProps","_Object$entries","entries","_Object$entries$_i","escapeRegExp","getLeafColumns","leafColumns","recurseColumn","convertRowsToV6","_subRows","rowsToCSV","columnIds","_options$headers","_options$sep","sep","_options$dec","dec","rowToCSV","Date","toISOString","csvRows","downloadCSV","content","filename","blob","Blob","navigator","msSaveBlob","link","url","URL","createObjectURL","href","download","click","revokeObjectURL","isBrowser","getFirstDefinedProp","objects","defaultVal","getEmotion","substring","lastIndexOf","rel","parentElement","createEmotion","defaultLanguage","sortLabel","filterPlaceholder","filterLabel","searchPlaceholder","searchLabel","noData","pageNext","pagePrevious","pageNumbers","pageInfo","pageSizeOptions","pageNextLabel","pagePreviousLabel","pageNumberLabel","pageJumpLabel","pageSizeOptionsLabel","groupExpandLabel","detailsExpandLabel","selectAllRowsLabel","selectAllSubRowsLabel","selectRowLabel","defaultGroupHeader","detailsCollapseLabel","deselectAllRowsLabel","deselectAllSubRowsLabel","deselectRowLabel","renderTemplate","template","params","separator","RegExp","templateParams","rendered","PageButton","isCurrent","_extends","Pagination","_React$Component","_inherits","_super","_classCallCheck","changePage","_assertThisInitialized","applyPage","pageJumpValue","page","prevPage","newPage","onPageChange","preventDefault","currentPage","setState","pageSize","pageRowCount","rowCount","language","rowStart","rowEnd","onPageSizeChange","option","elements","onBlur","onKeyPress","inputType","_this2","which","keyCode","nearestValidPage","pages","_this3","_this$props","paginationType","showPageSizeOptions","showPageInfo","canPrevious","canNext","theme","renderPageInfo","renderPageSizeOptions","visiblePages","totalPages","_","getVisiblePages","pageButtons","pageButton","renderPageJump","getPageJumpProperties","prevButton","disabled","nextButton","paginationStyle","defaultProps","WidgetContainer","staticRender","HTMLWidgets","throttled","lastCall","setTimeout","useFlexLayout","getTheadProps","getRowGroupStyles","getTfootProps","getRowStyles","asPx","flexWidth","resizedWidths","columnWidths","calculateFlexWidths","isFixedWidth","useStickyColumns","stickyProps","groupColumns","firstStickyCol","sticky","stickyCols","right","_step2","_iterator2","getStickyProps","aggregations","emptyArray","emptyObject","useGroupBy","getGroupByToggleProps","defaultGetGroupByToggleProps","groupBy","canGroupBy","resolvedGroupBy","groupByColumns","g","nonGroupByColumns","isGrouped","groupedIndex","defaultUserAggregations","_instance$groupByFn","groupByFn","defaultGroupByFn","manualGroupBy","_instance$aggregation","userAggregations","_instance$autoResetGr","autoResetGroupBy","disableGroupBy","defaultCanGroupBy","defaultColumnGroupBy","defaultGroupBy","columnDisableGroupBy","Aggregated","existingGroupBy","parentId","setGroupingProps","groupedColumns","aggregatedColumns","groupByID","aggregateRowsToValues","leafRows","groupedRows","aggregateFn","aggregate","leafValues","columnValue","aggregateValue","aggregateValueFn","groupedFlatRows","groupedRowsById","onlyGroupedFlatRows","onlyGroupedRowsById","nonGroupedFlatRows","nonGroupedRowsById","groupUpRecursively","rowGroupsMap","aggregatedGroupedRows","groupByVal","flattenBy","groupIndex","subRow","getAutoResetGroupBy","preGroupedRows","preGroupedFlatRow","preGroupedRowsById","_row$aggregatedColumn","_row$subRows","isAggregated","isPlaceholder","resKey","passiveSupported","useResizeColumns","getResizerProps","defaultGetResizerProps","onResizeStart","isTouchEvent","touches","raf","mostRecentClientX","headersToResize","getAllColumns","headerIdWidths","getDOMWidth","columnWidth","clientX","round","dispatchMove","cancelAnimationFrame","dispatchEnd","scheduleDispatchMoveOnNextAnimationFrame","clientXPos","requestAnimationFrame","handlersAndEvents","mouse","moveEvent","moveHandler","upEvent","upHandler","removeEventListener","touch","cancelable","stopPropagation","events","passiveIfSupported","supported","passive","addEventListener","passiveEventSupported","onMouseDown","onTouchStart","draggable","startX","isResizingColumn","_state$columnResizing","_state$columnResizing2","percentageDeltaX","newColumnWidths","headerId","headerWidth","disableResizing","isResizing","_instance$autoResetRe","autoResetResize","getAutoResetResize","resetResizing","useRowSelect","getToggleRowSelectedProps","defaultGetToggleRowSelectedProps","getToggleAllRowsSelectedProps","defaultGetToggleAllRowsSelectedProps","getToggleAllPageRowsSelectedProps","defaultGetToggleAllPageRowsSelectedProps","setRowsSelected","_instance$manualRowSe","manualRowSelectedKey","isSelected","isSomeSelected","isAllRowsSelected","selectedRowIds","isAllPageRowsSelected","setSelected","_instance$nonGroupedR","selectAll","_instance$selectSubRo","selectSubRows","newSelectedRowIds","handleRowById","_instance$selectSubRo2","_instance$selectSubRo3","_instance$nonGroupedR2","_instance$autoResetSe","autoResetSelectedRows","_instance$selectSubRo4","selectedFlatRows","getRowIsSelected","getAutoResetSelectedRows","allChildrenSelected","someSelected","availableSubRows","usePagination","pageIndex","pageCount","newPageIndex","canNavigate","topRowIndex","_instance$autoResetPa","autoResetPage","userPageCount","disablePagination","_instance$state","manualPagination","userRowCount","getAutoResetPage","ceil","pageOptions","fill","pageStart","pageEnd","canPreviousPage","canNextPage","previousPage","nextPage","numbers","omitMissingNumbers","mean","NaN","numericAggregators","defaultAggregators","maxValue","minValue","frequency","counts","getAggregateFunction","digits","isFinite","pow","sign","emptyValue","subRowsKey","normalizeColumnData","convertJSONNumbers","columnsToRows","names","numericRowStateColumns","materializedRowsToData","paginateSubRows","parentRowIds","subRowCount","rowState","grouped","selected","dataRow","RawHTML","html","dangerouslySetInnerHTML","__html","buildColumnDefs","groups","tableProps","sortable","defaultSortDesc","showSortIcon","showSortable","filterable","resizable","createCompareFunction","naLast","sortNALast","searchable","show","createMatcher","createStartsWithMatcher","createSubstringMatcher","align","vAlign","headerVAlign","cellInfo","isMissingValue","na","format","formatValue","aggregated","Fragment","display","Grouped","sortClass","footer","colAlignClass","getAlignClass","cellVAlignClass","getVAlignClass","headerVAlignClass","headerClassName","footerClassName","getProps","rowInfo","addColumnGroups","group","groupIds","newCols","lastGroup","isUngrouped","suffix","separators","percent","currency","date","time","hour12","locales","maximumFractionDigits","useGrouping","minimumFractionDigits","toLocaleString","toLocaleDateString","toLocaleTimeString","regex","tableInstances","tableId","getState","setSearch","downloadDataCSV","getDataCSV","setMeta","isHidden","setData","onStateChange","listenerFn","Reactable","columnGroups","dataKey","color","backgroundColor","borderColor","borderWidth","stripedColor","highlightColor","cellPadding","_options$tableBorderC","tableBorderColor","_options$tableBorderW","tableBorderWidth","tableStyle","_options$headerBorder","headerBorderColor","_options$headerBorder2","headerBorderWidth","headerStyle","_options$groupHeaderB","groupHeaderBorderColor","_options$groupHeaderB2","groupHeaderBorderWidth","groupHeaderStyle","tableBodyStyle","rowGroupStyle","rowStyle","rowStripedStyle","rowHighlightStyle","rowSelectedStyle","_options$cellBorderCo","cellBorderColor","_options$cellBorderWi","cellBorderWidth","cellStyle","_options$footerBorder","footerBorderColor","_options$footerBorder2","footerBorderWidth","footerStyle","inputStyle","filterInputStyle","searchInputStyle","selectStyle","pageButtonStyle","pageButtonHoverStyle","pageButtonActiveStyle","pageButtonCurrentStyle","expanderColor","selectColor","padding","height","filterCellStyle","expanderStyle","borderTopColor","borderTopWidth","backgroundImage","encodeURIComponent","createTheme","Table","useMemoizedObject","objStr","ReactableData","searchValue","_excluded2","TableData","RootComponent","_excluded3","TableComponent","_excluded4","TheadComponent","_excluded5","TbodyComponent","_excluded6","TfootComponent","_ref7","_excluded7","TrGroupComponent","_ref8","_excluded8","TrComponent","_ref9","_excluded9","ThComponent","innerClassName","thProps","_excluded10","_React$useState2","skipNextSort","setSkipNextSort","currentSortOrder","defaultSortOrder","toggleSort","isMultiSort","sortDesc","tabIndex","onMouseUp","detail","TdComponent","_ref10","_excluded11","getCellTheme","_excluded12","ResizerComponent","_ref11","_excluded13","RowDetails","Shiny","bindAll","el","unbindAll","ExpanderComponent","_ref12","ariaLabel","FilterComponent","_ref13","placeholder","SearchComponent","_ref14","NoDataComponent","_ref15","_excluded14","SelectInputComponent","_ref16","_ref17","searchMethod","pagination","selection","crosstalkGroup","crosstalkId","setResolvedData","dataColumns","cols","matchers","selectable","ctCol","maxRowCount","_ref18","originalData","defaultSorted","showPagination","defaultPageSize","minRows","defaultExpanded","defaultSelected","selectionId","outlined","bordered","borderless","compact","nowrap","striped","highlight","rowClassName","inline","initialMeta","crosstalkKey","elementId","nested","dataURL","initialServerRowCount","serverRowCount","initialServerMaxRowCount","serverMaxRowCount","_React$useState4","newData","setNewData","useServerData","_React$useState6","setServerRowCount","_React$useState8","setServerMaxRowCount","_useMeta","setRawMeta","prevMeta","newMeta","useMeta","_useMeta2","_useTable","setRowProps","_excluded15","skipInitialFetch","location","fetch","method","body","then","json","catch","selectedRowIndexes","indexes","selectedIndexes","onInputChange","searchableRef","rowData","stateInfo","sorted","pageRows","headerRefs","handleHeader","getBoundingClientRect","isFilterable","filterableRef","_React$useState10","expandedColumns","setExpandedColumns","rootElement","keyboardActiveProps","classList","remove","onKeyDown","add","onKeyUp","tableElement","_React$useState12","tableHasScrollbar","setTableHasScrollbar","checkTableHasScrollbar","_tableElement$current","scrollHeight","clientHeight","scrollWidth","clientWidth","ResizeObserver","resizeObserver","observe","disconnect","outputId","_step3","_iterator3","sortInfo","getPageCount","addCustomMessageHandler","newState","jsEvals","_step4","_iterator4","evaluateStringMember","ctRef","crosstalk","ct","SelectionHandle","FilterHandle","filtered","filteredKeys","rowByKey","applyCrosstalkFilter","selectedKeys","setCrosstalkSelection","on","sender","skipNextSelection","close","csv","dataColumnIds","origToggleHideColumn","resetSelected","stateCallbacks","cb","defaultFn","defaultWait","debounceRef","getDefaultFn","getDefaultWait","promise","Promise","resolve","reject","timeout","clearTimeout","useAsyncDebounce","getTableInstance","instanceId","theadProps","tableClassName","isGroupHeader","_headerGroup$getHeade","headerGroupKey","headerGroupProps","_excluded16","resizer","headerProps","_getCellTheme","themeClass","_getCellTheme2","_column$getResizerPro","_column$getHeaderProp","resolvedHeaderProps","_excluded17","filterInput","_getCellTheme3","filterCellProps","_column$getHeaderProp2","resolvedFilterCellProps","_excluded18","padRows","hasStickyColumns","rowHighlightClass","rowStripedClass","viewIndex","rowCls","level","rowProps","expandedId","rowDetails","expandedCol","details","_expandedCol","makeRowDetails","resolvedRowProps","colIndex","cellProps","_getCellTheme4","rowHeader","hasDetails","expander","newExpandedColumns","textOverflow","userSelect","expanderProps","canRowSelect","resolvedCellProps","padRowCount","_getCellTheme5","_column$getFooterProp","tbodyProps","makeTbody","hasFooters","tfootProps","_getCellTheme6","footerProps","_column$getFooterProp2","resolvedFooterProps","_excluded19","makeTfoot","minPageSize","makePagination","widget","factory","renderValue","hasAttribute","resize"],"sourceRoot":""} \ No newline at end of file diff --git a/inst/htmlwidgets/reactable.server.js b/inst/htmlwidgets/reactable.server.js index e20ddca7..55724183 100644 --- a/inst/htmlwidgets/reactable.server.js +++ b/inst/htmlwidgets/reactable.server.js @@ -1,3 +1,3 @@ /*! For license information please see reactable.server.js.LICENSE.txt */ -(()=>{var __webpack_modules__={8954:(e,t,n)=>{"use strict";function r(e){return Intl.getCanonicalLocales(e)}function a(e,t){var n=t.tzData,r=t.uppercaseLinks,a=e.toUpperCase(),o=Object.keys(n).reduce((function(e,t){return e[t.toUpperCase()]=t,e}),{}),i=r[a]||o[a];return"Etc/UTC"===i||"Etc/GMT"===i?"UTC":i}function o(e){if("symbol"==typeof e)throw TypeError("Cannot convert a Symbol value to a string");return String(e)}function i(e){if(void 0===e)return NaN;if(null===e)return 0;if("boolean"==typeof e)return e?1:0;if("number"==typeof e)return e;if("symbol"==typeof e||"bigint"==typeof e)throw new TypeError("Cannot convert symbol/bigint to number");return Number(e)}function l(e){return isFinite(e)?Math.abs(e)>8640000000000001?NaN:function(e){var t=i(e);if(isNaN(t)||s(t,-0))return 0;if(isFinite(t))return t;var n=Math.floor(Math.abs(t));return t<0&&(n=-n),s(n,-0)?0:n}(e):NaN}function u(e){if(null==e)throw new TypeError("undefined/null cannot be converted to object");return Object(e)}function s(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t}function c(e){return new Array(e)}function f(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function d(e){return null===e?"Null":void 0===e?"Undefined":"function"==typeof e||"object"==typeof e?"Object":"number"==typeof e?"Number":"boolean"==typeof e?"Boolean":"string"==typeof e?"String":"symbol"==typeof e?"Symbol":"bigint"==typeof e?"BigInt":void 0}n.r(t),n.d(t,{ArrayCreate:()=>c,CanonicalizeLocaleList:()=>r,CanonicalizeTimeZoneName:()=>a,CoerceOptionsToObject:()=>x,ComputeExponent:()=>ne,ComputeExponentForMagnitude:()=>Q,CurrencyDigits:()=>re,DateFromTime:()=>E,Day:()=>g,DayFromYear:()=>m,DayWithinYear:()=>S,DaysInYear:()=>w,FormatNumericToParts:()=>he,FormatNumericToString:()=>te,GetNumberOption:()=>O,GetOption:()=>M,GetOptionsObject:()=>Z,HasOwnProperty:()=>f,HourFromTime:()=>C,InLeapYear:()=>k,InitializeNumberFormat:()=>be,IsSanctionedSimpleUnitIdentifier:()=>j,IsValidTimeZoneName:()=>B,IsWellFormedCurrencyCode:()=>z,IsWellFormedUnitIdentifier:()=>U,MinFromTime:()=>R,MonthFromTime:()=>L,OrdinaryHasInstance:()=>A,PartitionNumberPattern:()=>pe,PartitionPattern:()=>ve,RangePatternType:()=>ke,SANCTIONED_UNITS:()=>T,SIMPLE_UNITS:()=>I,SameValue:()=>s,SecFromTime:()=>N,SetNumberFormatDigitOptions:()=>me,SetNumberFormatUnitOptions:()=>ye,SupportedLocales:()=>Se,TimeClip:()=>l,TimeFromYear:()=>b,ToNumber:()=>i,ToObject:()=>u,ToRawFixed:()=>ee,ToRawPrecision:()=>J,ToString:()=>o,Type:()=>d,WeekDay:()=>y,YearFromTime:()=>v,_formatToParts:()=>se,defineProperty:()=>Y,getInternalSlot:()=>V,getMagnitude:()=>G,getMultiInternalSlots:()=>q,invariant:()=>X,isLiteralPart:()=>$,isMissingLocaleDataError:()=>Ce,msFromTime:()=>_,removeUnitNamespace:()=>D,setInternalSlot:()=>W,setMultiInternalSlots:()=>K});var p=864e5;function h(e,t){return e-Math.floor(e/t)*t}function g(e){return Math.floor(e/p)}function y(e){return h(g(e)+4,7)}function m(e){return Date.UTC(e,0)/p}function b(e){return Date.UTC(e,0)}function v(e){return new Date(e).getUTCFullYear()}function w(e){return e%4!=0?365:e%100!=0?366:e%400!=0?365:366}function S(e){return g(e)-m(v(e))}function k(e){return 365===w(v(e))?0:1}function L(e){var t=S(e),n=k(e);if(t>=0&&t<31)return 0;if(t<59+n)return 1;if(t<90+n)return 2;if(t<120+n)return 3;if(t<151+n)return 4;if(t<181+n)return 5;if(t<212+n)return 6;if(t<243+n)return 7;if(t<273+n)return 8;if(t<304+n)return 9;if(t<334+n)return 10;if(t<365+n)return 11;throw new Error("Invalid time")}function E(e){var t=S(e),n=L(e),r=k(e);if(0===n)return t+1;if(1===n)return t-30;if(2===n)return t-58-r;if(3===n)return t-89-r;if(4===n)return t-119-r;if(5===n)return t-150-r;if(6===n)return t-180-r;if(7===n)return t-211-r;if(8===n)return t-242-r;if(9===n)return t-272-r;if(10===n)return t-303-r;if(11===n)return t-333-r;throw new Error("Invalid time")}function C(e){return h(Math.floor(e/36e5),24)}function R(e){return h(Math.floor(e/6e4),60)}function N(e){return h(Math.floor(e/1e3),60)}function A(e,t,n){if("function"!=typeof e)return!1;if(null==n?void 0:n.boundTargetFunction)return t instanceof(null==n?void 0:n.boundTargetFunction);if("object"!=typeof t)return!1;var r=e.prototype;if("object"!=typeof r)throw new TypeError("OrdinaryHasInstance called on an object with an invalid prototype property.");return Object.prototype.isPrototypeOf.call(r,t)}function _(e){return h(e,1e3)}function x(e){return void 0===e?Object.create(null):u(e)}function P(e,t,n,r){if(void 0!==e){if(e=Number(e),isNaN(e)||en)throw new RangeError("".concat(e," is outside of range [").concat(t,", ").concat(n,"]"));return Math.floor(e)}return r}function O(e,t,n,r,a){return P(e[t],n,r,a)}function M(e,t,n,r,a){if("object"!=typeof e)throw new TypeError("Options must be an object");var i=e[t];if(void 0!==i){if("boolean"!==n&&"string"!==n)throw new TypeError("invalid type");if("boolean"===n&&(i=Boolean(i)),"string"===n&&(i=o(i)),void 0!==r&&!r.filter((function(e){return e==i})).length)throw new RangeError("".concat(i," is not within ").concat(r.join(", ")));return i}return a}function Z(e){if(void 0===e)return Object.create(null);if("object"==typeof e)return e;throw new TypeError("Options must be an object")}var T=["angle-degree","area-acre","area-hectare","concentr-percent","digital-bit","digital-byte","digital-gigabit","digital-gigabyte","digital-kilobit","digital-kilobyte","digital-megabit","digital-megabyte","digital-petabyte","digital-terabit","digital-terabyte","duration-day","duration-hour","duration-millisecond","duration-minute","duration-month","duration-second","duration-week","duration-year","length-centimeter","length-foot","length-inch","length-kilometer","length-meter","length-mile-scandinavian","length-mile","length-millimeter","length-yard","mass-gram","mass-kilogram","mass-ounce","mass-pound","mass-stone","temperature-celsius","temperature-fahrenheit","volume-fluid-ounce","volume-gallon","volume-liter","volume-milliliter"];function D(e){return e.slice(e.indexOf("-")+1)}var I=T.map(D);function j(e){return I.indexOf(e)>-1}function B(e,t){var n=t.tzData,r=t.uppercaseLinks,a=e.toUpperCase(),o=new Set,i=new Set;return Object.keys(n).map((function(e){return e.toUpperCase()})).forEach((function(e){return o.add(e)})),Object.keys(r).forEach((function(e){i.add(e.toUpperCase()),o.add(r[e].toUpperCase())})),o.has(a)||i.has(a)}var F=/[^A-Z]/;function z(e){return 3===(e=e.replace(/([a-z])/g,(function(e,t){return t.toUpperCase()}))).length&&!F.test(e)}function U(e){if(j(e=e.replace(/([A-Z])/g,(function(e,t){return t.toLowerCase()}))))return!0;var t=e.split("-per-");if(2!==t.length)return!1;var n=t[0],r=t[1];return!(!j(n)||!j(r))}function G(e){return Math.floor(Math.log(e)*Math.LOG10E)}function H(e,t){if("function"==typeof e.repeat)return e.repeat(t);for(var n=new Array(t),r=0;rp[p.length-1])return p[p.length-1].length-1;var h=p.indexOf(d);if(-1===h)return 0;var g=p[h];return"0"===c[g].other?0:g.length-c[g].other.match(/0+/)[0].length}}function J(e,t,n){var r,a,o,i,l=n;if(0===e)r=H("0",l),a=0,o=0;else{var u=e.toString(),s=u.indexOf("e"),c=u.split("e"),f=c[0],d=c[1],p=f.replace(".","");if(s>=0&&p.length<=l)a=+d,r=p+H("0",l-p.length),o=e;else{var h=(a=G(e))-l+1,g=Math.round(m(e,h));m(g,l-1)>=10&&(a+=1,g=Math.floor(g/10)),r=g.toString(),o=m(g,l-1-a)}}if(a>=l-1?(r+=H("0",a-l+1),i=a+1):a>=0?(r="".concat(r.slice(0,a+1),".").concat(r.slice(a+1)),i=a+1):(r="0.".concat(H("0",-a-1)).concat(r),i=1),r.indexOf(".")>=0&&n>t){for(var y=n-t;y>0&&"0"===r[r.length-1];)r=r.slice(0,-1),y--;"."===r[r.length-1]&&(r=r.slice(0,-1))}return{formattedString:r,roundedNumber:o,integerDigitsCount:i};function m(e,t){return t<0?e*Math.pow(10,-t):e/Math.pow(10,t)}}function ee(e,t,n){var r,a,o=n,i=Math.round(e*Math.pow(10,o)),l=i/Math.pow(10,o);if(i<1e21)r=i.toString();else{var u=(r=i.toString()).split("e"),s=u[0],c=u[1];r=s.replace(".",""),r+=H("0",Math.max(+c-r.length+1,0))}if(0!==o){var f=r.length;f<=o&&(r=H("0",o+1-f)+r,f=o+1);var d=r.slice(0,f-o),p=r.slice(f-o);r="".concat(d,".").concat(p),a=d.length}else a=r.length;for(var h=n-t;h>0&&"0"===r[r.length-1];)r=r.slice(0,-1),h--;return"."===r[r.length-1]&&(r=r.slice(0,-1)),{formattedString:r,roundedNumber:l,integerDigitsCount:a}}function te(e,t){var n,r=t<0||s(t,-0);switch(r&&(t=-t),e.roundingType){case"significantDigits":n=J(t,e.minimumSignificantDigits,e.maximumSignificantDigits);break;case"fractionDigits":n=ee(t,e.minimumFractionDigits,e.maximumFractionDigits);break;default:(n=J(t,1,2)).integerDigitsCount>1&&(n=ee(t,0,0))}t=n.roundedNumber;var a=n.formattedString,o=n.integerDigitsCount,i=e.minimumIntegerDigits;return o\^`\|~\xA2-\xA6\xA8\xA9\xAC\xAE-\xB1\xB4\xB8\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0384\u0385\u03F6\u0482\u058D-\u058F\u0606-\u0608\u060B\u060E\u060F\u06DE\u06E9\u06FD\u06FE\u07F6\u07FE\u07FF\u09F2\u09F3\u09FA\u09FB\u0AF1\u0B70\u0BF3-\u0BFA\u0C7F\u0D4F\u0D79\u0E3F\u0F01-\u0F03\u0F13\u0F15-\u0F17\u0F1A-\u0F1F\u0F34\u0F36\u0F38\u0FBE-\u0FC5\u0FC7-\u0FCC\u0FCE\u0FCF\u0FD5-\u0FD8\u109E\u109F\u1390-\u1399\u166D\u17DB\u1940\u19DE-\u19FF\u1B61-\u1B6A\u1B74-\u1B7C\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2044\u2052\u207A-\u207C\u208A-\u208C\u20A0-\u20BF\u2100\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F\u218A\u218B\u2190-\u2307\u230C-\u2328\u232B-\u2426\u2440-\u244A\u249C-\u24E9\u2500-\u2767\u2794-\u27C4\u27C7-\u27E5\u27F0-\u2982\u2999-\u29D7\u29DC-\u29FB\u29FE-\u2B73\u2B76-\u2B95\u2B97-\u2BFF\u2CE5-\u2CEA\u2E50\u2E51\u2E80-\u2E99\u2E9B-\u2EF3\u2F00-\u2FD5\u2FF0-\u2FFB\u3004\u3012\u3013\u3020\u3036\u3037\u303E\u303F\u309B\u309C\u3190\u3191\u3196-\u319F\u31C0-\u31E3\u3200-\u321E\u322A-\u3247\u3250\u3260-\u327F\u328A-\u32B0\u32C0-\u33FF\u4DC0-\u4DFF\uA490-\uA4C6\uA700-\uA716\uA720\uA721\uA789\uA78A\uA828-\uA82B\uA836-\uA839\uAA77-\uAA79\uAB5B\uAB6A\uAB6B\uFB29\uFBB2-\uFBC1\uFDFC\uFDFD\uFE62\uFE64-\uFE66\uFE69\uFF04\uFF0B\uFF1C-\uFF1E\uFF3E\uFF40\uFF5C\uFF5E\uFFE0-\uFFE6\uFFE8-\uFFEE\uFFFC\uFFFD]|\uD800[\uDD37-\uDD3F\uDD79-\uDD89\uDD8C-\uDD8E\uDD90-\uDD9C\uDDA0\uDDD0-\uDDFC]|\uD802[\uDC77\uDC78\uDEC8]|\uD805\uDF3F|\uD807[\uDFD5-\uDFF1]|\uD81A[\uDF3C-\uDF3F\uDF45]|\uD82F\uDC9C|\uD834[\uDC00-\uDCF5\uDD00-\uDD26\uDD29-\uDD64\uDD6A-\uDD6C\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDDE8\uDE00-\uDE41\uDE45\uDF00-\uDF56]|\uD835[\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85\uDE86]|\uD838[\uDD4F\uDEFF]|\uD83B[\uDCAC\uDCB0\uDD2E\uDEF0\uDEF1]|\uD83C[\uDC00-\uDC2B\uDC30-\uDC93\uDCA0-\uDCAE\uDCB1-\uDCBF\uDCC1-\uDCCF\uDCD1-\uDCF5\uDD0D-\uDDAD\uDDE6-\uDE02\uDE10-\uDE3B\uDE40-\uDE48\uDE50\uDE51\uDE60-\uDE65\uDF00-\uDFFF]|\uD83D[\uDC00-\uDED7\uDEE0-\uDEEC\uDEF0-\uDEFC\uDF00-\uDF73\uDF80-\uDFD8\uDFE0-\uDFEB]|\uD83E[\uDC00-\uDC0B\uDC10-\uDC47\uDC50-\uDC59\uDC60-\uDC87\uDC90-\uDCAD\uDCB0\uDCB1\uDD00-\uDD78\uDD7A-\uDDCB\uDDCD-\uDE53\uDE60-\uDE6D\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6\uDF00-\uDF92\uDF94-\uDFCA]/,ie=new RegExp("^".concat(oe.source)),le=new RegExp("".concat(oe.source,"$")),ue=/[#0](?:[\.,][#0]+)*/g;function se(e,t,n,r){var a,o,i=e.sign,l=e.exponent,u=e.magnitude,s=r.notation,c=r.style,f=r.numberingSystem,d=t.numbers.nu[0],p=null;if("compact"===s&&u&&(p=function(e,t,n,r,a,o,i){var l,u,s=e.roundedNumber,c=e.sign,f=e.magnitude,d=String(Math.pow(10,f)),p=n.numbers.nu[0];if("currency"===r&&"name"!==o){var h=null===(l=((g=n.numbers.currency)[i]||g[p]).short)||void 0===l?void 0:l[d];if(!h)return null;u=de(t,s,h)}else{var g,y=((g=n.numbers.decimal)[i]||g[p])[a][d];if(!y)return null;u=de(t,s,y)}return"0"===u?null:fe(u,c).replace(/([^\s;\-\+\d¤]+)/g,"{c:$1}").replace(/0+/,"0")}(e,n,t,c,r.compactDisplay,r.currencyDisplay,f)),"currency"===c&&"name"!==r.currencyDisplay){var h=t.currencies[r.currency];if(h)switch(r.currencyDisplay){case"code":a=r.currency;break;case"symbol":a=h.symbol;break;default:a=h.narrow}else a=r.currency}o=p||("decimal"===c||"unit"===c||"currency"===c&&"name"===r.currencyDisplay?fe((t.numbers.decimal[f]||t.numbers.decimal[d]).standard,i):fe("currency"===c?(y=t.numbers.currency[f]||t.numbers.currency[d])[r.currencySign]:t.numbers.percent[f]||t.numbers.percent[d],i));var g=ue.exec(o)[0];if(o=o.replace(ue,"{0}").replace(/'(.)'/g,"$1"),"currency"===c&&"name"!==r.currencyDisplay){var y,m=(y=t.numbers.currency[f]||t.numbers.currency[d]).currencySpacing.afterInsertBetween;m&&!le.test(a)&&(o=o.replace("¤{0}","¤".concat(m,"{0}")));var b=y.currencySpacing.beforeInsertBetween;b&&!ie.test(a)&&(o=o.replace("{0}¤","{0}".concat(b,"¤")))}for(var v=o.split(/({c:[^}]+}|\{0\}|[¤%\-\+])/g),w=[],S=t.numbers.symbols[f]||t.numbers.symbols[d],k=0,L=v;k0?(f=u.slice(0,p),d=u.slice(p+1)):f=u,o&&("compact"!==n||s>=1e4)){var h=e.group,g=[],y=i.split(".")[0].split(","),m=3,b=3;y.length>1&&(m=y[y.length-1].length),y.length>2&&(b=y[y.length-2].length);var v=f.length-m;if(v>0){for(g.push(f.slice(v,v+m)),v-=b;v>0;v-=b)g.push(f.slice(v,v+b));g.push(f.slice(0,v+b))}else g.push(f);for(;g.length>0;){var w=g.pop();l.push({type:"integer",value:w}),g.length>0&&l.push({type:"group",value:h})}}else l.push({type:"integer",value:f});if(void 0!==d&&l.push({type:"decimal",value:e.decimal},{type:"fraction",value:d}),("scientific"===n||"engineering"===n)&&isFinite(s)){l.push({type:"exponentSeparator",value:e.exponential}),r<0&&(l.push({type:"exponentMinusSign",value:e.minusSign}),r=-r);var S=ee(r,0,0);l.push({type:"exponentInteger",value:S.formattedString})}return l}function fe(e,t){e.indexOf(";")<0&&(e="".concat(e,";-").concat(e));var n=e.split(";"),r=n[0],a=n[1];switch(t){case 0:return r;case-1:return a;default:return a.indexOf("-")>=0?a.replace(/-/g,"+"):"+".concat(r)}}function de(e,t,n){return n[e.select(t)]||n.other}function pe(e,t,n){var r,a,o,i=n.getInternalSlots,l=i(e),u=l.pl,c=l.dataLocaleData,f=l.numberingSystem,d=c.numbers.symbols[f]||c.numbers.symbols[c.numbers.nu[0]],p=0,h=0;if(isNaN(t))a=d.nan;else if(isFinite(t)){"percent"===l.style&&(t*=100),h=(r=ne(e,t,{getInternalSlots:i}))[0],p=r[1];var g=te(l,t=h<0?t*Math.pow(10,-h):t/Math.pow(10,h));a=g.formattedString,t=g.roundedNumber}else a=d.infinity;switch(l.signDisplay){case"never":o=0;break;case"auto":o=s(t,0)||t>0||isNaN(t)?0:-1;break;case"always":o=s(t,0)||t>0||isNaN(t)?1:-1;break;default:o=0===t||isNaN(t)?0:t>0?1:-1}return se({roundedNumber:t,formattedString:a,exponent:h,magnitude:p,sign:o},l.dataLocaleData,u,l)}function he(e,t,n){for(var r=pe(e,t,n),a=c(0),o=0,i=r;o-1;)X((r=e.indexOf("}",n))>n,"Invalid pattern ".concat(e)),n>a&&t.push({type:"literal",value:e.substring(a,n)}),t.push({type:e.substring(n+1,r),value:void 0}),a=r+1,n=e.indexOf("{",a);return a{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isUnicodeLanguageSubtag=t.isUnicodeScriptSubtag=t.isUnicodeRegionSubtag=t.isStructurallyValidLanguageTag=t.parseUnicodeLanguageId=t.parseUnicodeLocaleId=t.getCanonicalLocales=void 0;var r=n(655),a=n(8371),o=n(825),i=n(9391);t.getCanonicalLocales=function(e){return function(e){if(void 0===e)return[];var t=[];"string"==typeof e&&(e=[e]);for(var n=0,r=e;n{"use strict";var r=n(9097),a=n(5010);"undefined"==typeof Intl&&("undefined"!=typeof window?Object.defineProperty(window,"Intl",{value:{}}):void 0!==n.g&&Object.defineProperty(n.g,"Intl",{value:{}})),(0,a.shouldPolyfill)()&&Object.defineProperty(Intl,"getCanonicalLocales",{value:r.getCanonicalLocales,writable:!0,enumerable:!1,configurable:!0})},5010:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldPolyfill=void 0,t.shouldPolyfill=function(){return"undefined"==typeof Intl||!("getCanonicalLocales"in Intl)||"x-private"===Intl.getCanonicalLocales("und-x-private")[0]}},2263:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.variantAlias=t.scriptAlias=t.territoryAlias=t.languageAlias=void 0,t.languageAlias={"aa-saaho":"ssy",aam:"aas",aar:"aa",abk:"ab",adp:"dz",afr:"af",agp:"apf",ais:"ami",aju:"jrb",aka:"ak",alb:"sq",als:"sq",amh:"am",ara:"ar",arb:"ar",arg:"an",arm:"hy","art-lojban":"jbo",asd:"snz",asm:"as",aue:"ktz",ava:"av",ave:"ae",aym:"ay",ayr:"ay",ayx:"nun",aze:"az",azj:"az",bak:"ba",bam:"bm",baq:"eu",baz:"nvo",bcc:"bal",bcl:"bik",bel:"be",ben:"bn",bgm:"bcg",bh:"bho",bhk:"fbl",bic:"bir",bih:"bho",bis:"bi",bjd:"drl",bjq:"bzc",bkb:"ebk",blg:"iba",bod:"bo",bos:"bs",bre:"br",btb:"beb",bul:"bg",bur:"my",bxk:"luy",bxr:"bua",cat:"ca",ccq:"rki","cel-gaulish":"xtg",ces:"cs",cha:"ch",che:"ce",chi:"zh",chu:"cu",chv:"cv",cjr:"mom",cka:"cmr",cld:"syr",cmk:"xch",cmn:"zh",cnr:"sr-ME",cor:"kw",cos:"co",coy:"pij",cqu:"quh",cre:"cr",cwd:"cr",cym:"cy",cze:"cs",daf:"dnj",dan:"da",dap:"njz",deu:"de",dgo:"doi",dhd:"mwr",dik:"din",diq:"zza",dit:"dif",div:"dv",djl:"dze",dkl:"aqd",drh:"mn",drr:"kzk",drw:"fa-AF",dud:"uth",duj:"dwu",dut:"nl",dwl:"dbt",dzo:"dz",ekk:"et",ell:"el",elp:"amq",emk:"man","en-GB-oed":"en-GB-oxendict",eng:"en",epo:"eo",esk:"ik",est:"et",eus:"eu",ewe:"ee",fao:"fo",fas:"fa",fat:"ak",fij:"fj",fin:"fi",fra:"fr",fre:"fr",fry:"fy",fuc:"ff",ful:"ff",gav:"dev",gaz:"om",gbc:"wny",gbo:"grb",geo:"ka",ger:"de",gfx:"vaj",ggn:"gvr",ggo:"esg",ggr:"gtu",gio:"aou",gla:"gd",gle:"ga",glg:"gl",gli:"kzk",glv:"gv",gno:"gon",gre:"el",grn:"gn",gti:"nyc",gug:"gn",guj:"gu",guv:"duz",gya:"gba",hat:"ht",hau:"ha",hbs:"sr-Latn",hdn:"hai",hea:"hmn",heb:"he",her:"hz",him:"srx",hin:"hi",hmo:"ho",hrr:"jal",hrv:"hr",hun:"hu","hy-arevmda":"hyw",hye:"hy","i-ami":"ami","i-bnn":"bnn","i-default":"en-x-i-default","i-enochian":"und-x-i-enochian","i-hak":"hak","i-klingon":"tlh","i-lux":"lb","i-mingo":"see-x-i-mingo","i-navajo":"nv","i-pwn":"pwn","i-tao":"tao","i-tay":"tay","i-tsu":"tsu",ibi:"opa",ibo:"ig",ice:"is",ido:"io",iii:"ii",ike:"iu",iku:"iu",ile:"ie",ill:"ilm",ilw:"gal",in:"id",ina:"ia",ind:"id",ipk:"ik",isl:"is",ita:"it",iw:"he",izi:"eza",jar:"jgk",jav:"jv",jeg:"oyb",ji:"yi",jpn:"ja",jw:"jv",kal:"kl",kan:"kn",kas:"ks",kat:"ka",kau:"kr",kaz:"kk",kdv:"zkd",kgc:"tdf",kgd:"ncq",kgh:"kml",khk:"mn",khm:"km",kik:"ki",kin:"rw",kir:"ky",kmr:"ku",knc:"kr",kng:"kg",knn:"kok",koj:"kwv",kom:"kv",kon:"kg",kor:"ko",kpp:"jkm",kpv:"kv",krm:"bmf",ktr:"dtp",kua:"kj",kur:"ku",kvs:"gdj",kwq:"yam",kxe:"tvd",kxl:"kru",kzh:"dgl",kzj:"dtp",kzt:"dtp",lao:"lo",lat:"la",lav:"lv",lbk:"bnc",leg:"enl",lii:"raq",lim:"li",lin:"ln",lit:"lt",llo:"ngt",lmm:"rmx",ltz:"lb",lub:"lu",lug:"lg",lvs:"lv",mac:"mk",mah:"mh",mal:"ml",mao:"mi",mar:"mr",may:"ms",meg:"cir",mgx:"jbk",mhr:"chm",mkd:"mk",mlg:"mg",mlt:"mt",mnk:"man",mnt:"wnn",mo:"ro",mof:"xnt",mol:"ro",mon:"mn",mri:"mi",msa:"ms",mst:"mry",mup:"raj",mwd:"dmw",mwj:"vaj",mya:"my",myd:"aog",myt:"mry",nad:"xny",nau:"na",nav:"nv",nbf:"nru",nbl:"nr",nbx:"ekc",ncp:"kdz",nde:"nd",ndo:"ng",nep:"ne",nld:"nl",nln:"azd",nlr:"nrk",nno:"nn",nns:"nbr",nnx:"ngv","no-bok":"nb","no-bokmal":"nb","no-nyn":"nn","no-nynorsk":"nn",nob:"nb",noo:"dtd",nor:"no",npi:"ne",nts:"pij",nxu:"bpp",nya:"ny",oci:"oc",ojg:"oj",oji:"oj",ori:"or",orm:"om",ory:"or",oss:"os",oun:"vaj",pan:"pa",pat:"kxr",pbu:"ps",pcr:"adx",per:"fa",pes:"fa",pli:"pi",plt:"mg",pmc:"huw",pmu:"phr",pnb:"lah",pol:"pl",por:"pt",ppa:"bfy",ppr:"lcq",prs:"fa-AF",pry:"prt",pus:"ps",puz:"pub",que:"qu",quz:"qu",rmr:"emx",rmy:"rom",roh:"rm",ron:"ro",rum:"ro",run:"rn",rus:"ru",sag:"sg",san:"sa",sap:"aqt",sca:"hle",scc:"sr",scr:"hr",sgl:"isk","sgn-BE-FR":"sfb","sgn-BE-NL":"vgt","sgn-BR":"bzs","sgn-CH-DE":"sgg","sgn-CO":"csn","sgn-DE":"gsg","sgn-DK":"dsl","sgn-ES":"ssp","sgn-FR":"fsl","sgn-GB":"bfi","sgn-GR":"gss","sgn-IE":"isg","sgn-IT":"ise","sgn-JP":"jsl","sgn-MX":"mfs","sgn-NI":"ncs","sgn-NL":"dse","sgn-NO":"nsi","sgn-PT":"psr","sgn-SE":"swl","sgn-US":"ase","sgn-ZA":"sfs",sh:"sr-Latn",sin:"si",skk:"oyb",slk:"sk",slo:"sk",slv:"sl",sme:"se",smo:"sm",sna:"sn",snd:"sd",som:"so",sot:"st",spa:"es",spy:"kln",sqi:"sq",src:"sc",srd:"sc",srp:"sr",ssw:"ss",sul:"sgd",sum:"ulw",sun:"su",swa:"sw",swc:"sw-CD",swe:"sv",swh:"sw",tah:"ty",tam:"ta",tat:"tt",tdu:"dtp",tel:"te",tgg:"bjp",tgk:"tg",tgl:"fil",tha:"th",thc:"tpo",thw:"ola",thx:"oyb",tib:"bo",tid:"itd",tie:"ras",tir:"ti",tkk:"twm",tl:"fil",tlw:"weo",tmp:"tyj",tne:"kak",tnf:"fa-AF",ton:"to",tsf:"taj",tsn:"tn",tso:"ts",ttq:"tmh",tuk:"tk",tur:"tr",tw:"ak",twi:"ak",uig:"ug",ukr:"uk",umu:"del","und-aaland":"und-AX","und-arevela":"und","und-arevmda":"und","und-bokmal":"und","und-hakka":"und","und-hepburn-heploc":"und-alalc97","und-lojban":"und","und-nynorsk":"und","und-saaho":"und","und-xiang":"und",unp:"wro",uok:"ema",urd:"ur",uzb:"uz",uzn:"uz",ven:"ve",vie:"vi",vol:"vo",wel:"cy",wgw:"wgb",wit:"nol",wiw:"nwo",wln:"wa",wol:"wo",xba:"cax",xho:"xh",xia:"acn",xkh:"waw",xpe:"kpe",xrq:"dmw",xsj:"suj",xsl:"den",ybd:"rki",ydd:"yi",yen:"ynq",yid:"yi",yiy:"yrm",yma:"lrr",ymt:"mtm",yor:"yo",yos:"zom",yuu:"yug",zai:"zap","zh-cmn":"zh","zh-cmn-Hans":"zh-Hans","zh-cmn-Hant":"zh-Hant","zh-gan":"gan","zh-guoyu":"zh","zh-hakka":"hak","zh-min":"nan-x-zh-min","zh-min-nan":"nan","zh-wuu":"wuu","zh-xiang":"hsn","zh-yue":"yue",zha:"za",zho:"zh",zir:"scv",zsm:"ms",zul:"zu",zyb:"za"},t.territoryAlias={100:"BG",104:"MM",108:"BI",112:"BY",116:"KH",120:"CM",124:"CA",132:"CV",136:"KY",140:"CF",144:"LK",148:"TD",152:"CL",156:"CN",158:"TW",162:"CX",166:"CC",170:"CO",172:"RU AM AZ BY GE KG KZ MD TJ TM UA UZ",174:"KM",175:"YT",178:"CG",180:"CD",184:"CK",188:"CR",191:"HR",192:"CU",196:"CY",200:"CZ SK",203:"CZ",204:"BJ",208:"DK",212:"DM",214:"DO",218:"EC",222:"SV",226:"GQ",230:"ET",231:"ET",232:"ER",233:"EE",234:"FO",238:"FK",239:"GS",242:"FJ",246:"FI",248:"AX",249:"FR",250:"FR",254:"GF",258:"PF",260:"TF",262:"DJ",266:"GA",268:"GE",270:"GM",275:"PS",276:"DE",278:"DE",280:"DE",288:"GH",292:"GI",296:"KI",300:"GR",304:"GL",308:"GD",312:"GP",316:"GU",320:"GT",324:"GN",328:"GY",332:"HT",334:"HM",336:"VA",340:"HN",344:"HK",348:"HU",352:"IS",356:"IN",360:"ID",364:"IR",368:"IQ",372:"IE",376:"IL",380:"IT",384:"CI",388:"JM",392:"JP",398:"KZ",400:"JO",404:"KE",408:"KP",410:"KR",414:"KW",417:"KG",418:"LA",422:"LB",426:"LS",428:"LV",430:"LR",434:"LY",438:"LI",440:"LT",442:"LU",446:"MO",450:"MG",454:"MW",458:"MY",462:"MV",466:"ML",470:"MT",474:"MQ",478:"MR",480:"MU",484:"MX",492:"MC",496:"MN",498:"MD",499:"ME",500:"MS",504:"MA",508:"MZ",512:"OM",516:"NA",520:"NR",524:"NP",528:"NL",530:"CW SX BQ",531:"CW",532:"CW SX BQ",533:"AW",534:"SX",535:"BQ",536:"SA IQ",540:"NC",548:"VU",554:"NZ",558:"NI",562:"NE",566:"NG",570:"NU",574:"NF",578:"NO",580:"MP",581:"UM",582:"FM MH MP PW",583:"FM",584:"MH",585:"PW",586:"PK",591:"PA",598:"PG",600:"PY",604:"PE",608:"PH",612:"PN",616:"PL",620:"PT",624:"GW",626:"TL",630:"PR",634:"QA",638:"RE",642:"RO",643:"RU",646:"RW",652:"BL",654:"SH",659:"KN",660:"AI",662:"LC",663:"MF",666:"PM",670:"VC",674:"SM",678:"ST",682:"SA",686:"SN",688:"RS",690:"SC",694:"SL",702:"SG",703:"SK",704:"VN",705:"SI",706:"SO",710:"ZA",716:"ZW",720:"YE",724:"ES",728:"SS",729:"SD",732:"EH",736:"SD",740:"SR",744:"SJ",748:"SZ",752:"SE",756:"CH",760:"SY",762:"TJ",764:"TH",768:"TG",772:"TK",776:"TO",780:"TT",784:"AE",788:"TN",792:"TR",795:"TM",796:"TC",798:"TV",800:"UG",804:"UA",807:"MK",810:"RU AM AZ BY EE GE KZ KG LV LT MD TJ TM UA UZ",818:"EG",826:"GB",830:"JE GG",831:"GG",832:"JE",833:"IM",834:"TZ",840:"US",850:"VI",854:"BF",858:"UY",860:"UZ",862:"VE",876:"WF",882:"WS",886:"YE",887:"YE",890:"RS ME SI HR MK BA",891:"RS ME",894:"ZM",958:"AA",959:"QM",960:"QN",962:"QP",963:"QQ",964:"QR",965:"QS",966:"QT",967:"EU",968:"QV",969:"QW",970:"QX",971:"QY",972:"QZ",973:"XA",974:"XB",975:"XC",976:"XD",977:"XE",978:"XF",979:"XG",980:"XH",981:"XI",982:"XJ",983:"XK",984:"XL",985:"XM",986:"XN",987:"XO",988:"XP",989:"XQ",990:"XR",991:"XS",992:"XT",993:"XU",994:"XV",995:"XW",996:"XX",997:"XY",998:"XZ",999:"ZZ","004":"AF","008":"AL","010":"AQ","012":"DZ","016":"AS","020":"AD","024":"AO","028":"AG","031":"AZ","032":"AR","036":"AU","040":"AT","044":"BS","048":"BH","050":"BD","051":"AM","052":"BB","056":"BE","060":"BM","062":"034 143","064":"BT","068":"BO","070":"BA","072":"BW","074":"BV","076":"BR","084":"BZ","086":"IO","090":"SB","092":"VG","096":"BN",AAA:"AA",ABW:"AW",AFG:"AF",AGO:"AO",AIA:"AI",ALA:"AX",ALB:"AL",AN:"CW SX BQ",AND:"AD",ANT:"CW SX BQ",ARE:"AE",ARG:"AR",ARM:"AM",ASC:"AC",ASM:"AS",ATA:"AQ",ATF:"TF",ATG:"AG",AUS:"AU",AUT:"AT",AZE:"AZ",BDI:"BI",BEL:"BE",BEN:"BJ",BES:"BQ",BFA:"BF",BGD:"BD",BGR:"BG",BHR:"BH",BHS:"BS",BIH:"BA",BLM:"BL",BLR:"BY",BLZ:"BZ",BMU:"BM",BOL:"BO",BRA:"BR",BRB:"BB",BRN:"BN",BTN:"BT",BU:"MM",BUR:"MM",BVT:"BV",BWA:"BW",CAF:"CF",CAN:"CA",CCK:"CC",CHE:"CH",CHL:"CL",CHN:"CN",CIV:"CI",CMR:"CM",COD:"CD",COG:"CG",COK:"CK",COL:"CO",COM:"KM",CPT:"CP",CPV:"CV",CRI:"CR",CS:"RS ME",CT:"KI",CUB:"CU",CUW:"CW",CXR:"CX",CYM:"KY",CYP:"CY",CZE:"CZ",DD:"DE",DDR:"DE",DEU:"DE",DGA:"DG",DJI:"DJ",DMA:"DM",DNK:"DK",DOM:"DO",DY:"BJ",DZA:"DZ",ECU:"EC",EGY:"EG",ERI:"ER",ESH:"EH",ESP:"ES",EST:"EE",ETH:"ET",FIN:"FI",FJI:"FJ",FLK:"FK",FQ:"AQ TF",FRA:"FR",FRO:"FO",FSM:"FM",FX:"FR",FXX:"FR",GAB:"GA",GBR:"GB",GEO:"GE",GGY:"GG",GHA:"GH",GIB:"GI",GIN:"GN",GLP:"GP",GMB:"GM",GNB:"GW",GNQ:"GQ",GRC:"GR",GRD:"GD",GRL:"GL",GTM:"GT",GUF:"GF",GUM:"GU",GUY:"GY",HKG:"HK",HMD:"HM",HND:"HN",HRV:"HR",HTI:"HT",HUN:"HU",HV:"BF",IDN:"ID",IMN:"IM",IND:"IN",IOT:"IO",IRL:"IE",IRN:"IR",IRQ:"IQ",ISL:"IS",ISR:"IL",ITA:"IT",JAM:"JM",JEY:"JE",JOR:"JO",JPN:"JP",JT:"UM",KAZ:"KZ",KEN:"KE",KGZ:"KG",KHM:"KH",KIR:"KI",KNA:"KN",KOR:"KR",KWT:"KW",LAO:"LA",LBN:"LB",LBR:"LR",LBY:"LY",LCA:"LC",LIE:"LI",LKA:"LK",LSO:"LS",LTU:"LT",LUX:"LU",LVA:"LV",MAC:"MO",MAF:"MF",MAR:"MA",MCO:"MC",MDA:"MD",MDG:"MG",MDV:"MV",MEX:"MX",MHL:"MH",MI:"UM",MKD:"MK",MLI:"ML",MLT:"MT",MMR:"MM",MNE:"ME",MNG:"MN",MNP:"MP",MOZ:"MZ",MRT:"MR",MSR:"MS",MTQ:"MQ",MUS:"MU",MWI:"MW",MYS:"MY",MYT:"YT",NAM:"NA",NCL:"NC",NER:"NE",NFK:"NF",NGA:"NG",NH:"VU",NIC:"NI",NIU:"NU",NLD:"NL",NOR:"NO",NPL:"NP",NQ:"AQ",NRU:"NR",NT:"SA IQ",NTZ:"SA IQ",NZL:"NZ",OMN:"OM",PAK:"PK",PAN:"PA",PC:"FM MH MP PW",PCN:"PN",PER:"PE",PHL:"PH",PLW:"PW",PNG:"PG",POL:"PL",PRI:"PR",PRK:"KP",PRT:"PT",PRY:"PY",PSE:"PS",PU:"UM",PYF:"PF",PZ:"PA",QAT:"QA",QMM:"QM",QNN:"QN",QPP:"QP",QQQ:"QQ",QRR:"QR",QSS:"QS",QTT:"QT",QU:"EU",QUU:"EU",QVV:"QV",QWW:"QW",QXX:"QX",QYY:"QY",QZZ:"QZ",REU:"RE",RH:"ZW",ROU:"RO",RUS:"RU",RWA:"RW",SAU:"SA",SCG:"RS ME",SDN:"SD",SEN:"SN",SGP:"SG",SGS:"GS",SHN:"SH",SJM:"SJ",SLB:"SB",SLE:"SL",SLV:"SV",SMR:"SM",SOM:"SO",SPM:"PM",SRB:"RS",SSD:"SS",STP:"ST",SU:"RU AM AZ BY EE GE KZ KG LV LT MD TJ TM UA UZ",SUN:"RU AM AZ BY EE GE KZ KG LV LT MD TJ TM UA UZ",SUR:"SR",SVK:"SK",SVN:"SI",SWE:"SE",SWZ:"SZ",SXM:"SX",SYC:"SC",SYR:"SY",TAA:"TA",TCA:"TC",TCD:"TD",TGO:"TG",THA:"TH",TJK:"TJ",TKL:"TK",TKM:"TM",TLS:"TL",TMP:"TL",TON:"TO",TP:"TL",TTO:"TT",TUN:"TN",TUR:"TR",TUV:"TV",TWN:"TW",TZA:"TZ",UGA:"UG",UK:"GB",UKR:"UA",UMI:"UM",URY:"UY",USA:"US",UZB:"UZ",VAT:"VA",VCT:"VC",VD:"VN",VEN:"VE",VGB:"VG",VIR:"VI",VNM:"VN",VUT:"VU",WK:"UM",WLF:"WF",WSM:"WS",XAA:"XA",XBB:"XB",XCC:"XC",XDD:"XD",XEE:"XE",XFF:"XF",XGG:"XG",XHH:"XH",XII:"XI",XJJ:"XJ",XKK:"XK",XLL:"XL",XMM:"XM",XNN:"XN",XOO:"XO",XPP:"XP",XQQ:"XQ",XRR:"XR",XSS:"XS",XTT:"XT",XUU:"XU",XVV:"XV",XWW:"XW",XXX:"XX",XYY:"XY",XZZ:"XZ",YD:"YE",YEM:"YE",YMD:"YE",YU:"RS ME",YUG:"RS ME",ZAF:"ZA",ZAR:"CD",ZMB:"ZM",ZR:"CD",ZWE:"ZW",ZZZ:"ZZ"},t.scriptAlias={Qaai:"Zinh"},t.variantAlias={heploc:"alalc97",polytoni:"polyton"}},9391:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.canonicalizeUnicodeLocaleId=t.canonicalizeUnicodeLanguageId=void 0;var r=n(655),a=n(2263),o=n(8371),i=n(3020),l=n(825);function u(e){for(var t={},n=[],r=0,a=e;rt[0]?1:0}function c(e,t){return e.typet.type?1:0}function f(e,t){for(var n=r.__spreadArray([],e,!0),a=0,o=t;a-1&&(m=w)}}m&&(t.region=m),t.region=t.region.toUpperCase()}if(t.script&&(t.script=t.script[0].toUpperCase()+t.script.slice(1).toLowerCase(),a.scriptAlias[t.script]&&(t.script=a.scriptAlias[t.script])),t.variants.length){for(var S=0;S{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.emitUnicodeLocaleId=t.emitUnicodeLanguageId=void 0;var r=n(655);function a(e){return e?r.__spreadArray([e.lang,e.script,e.region],e.variants||[],!0).filter(Boolean).join("-"):""}t.emitUnicodeLanguageId=a,t.emitUnicodeLocaleId=function(e){for(var t=e.lang,n=e.extensions,o=[a(t)],i=0,l=n;i{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.likelySubtags=void 0,t.likelySubtags={aa:"aa-Latn-ET",aai:"aai-Latn-ZZ",aak:"aak-Latn-ZZ",aau:"aau-Latn-ZZ",ab:"ab-Cyrl-GE",abi:"abi-Latn-ZZ",abq:"abq-Cyrl-ZZ",abr:"abr-Latn-GH",abt:"abt-Latn-ZZ",aby:"aby-Latn-ZZ",acd:"acd-Latn-ZZ",ace:"ace-Latn-ID",ach:"ach-Latn-UG",ada:"ada-Latn-GH",ade:"ade-Latn-ZZ",adj:"adj-Latn-ZZ",adp:"adp-Tibt-BT",ady:"ady-Cyrl-RU",adz:"adz-Latn-ZZ",ae:"ae-Avst-IR",aeb:"aeb-Arab-TN",aey:"aey-Latn-ZZ",af:"af-Latn-ZA",agc:"agc-Latn-ZZ",agd:"agd-Latn-ZZ",agg:"agg-Latn-ZZ",agm:"agm-Latn-ZZ",ago:"ago-Latn-ZZ",agq:"agq-Latn-CM",aha:"aha-Latn-ZZ",ahl:"ahl-Latn-ZZ",aho:"aho-Ahom-IN",ajg:"ajg-Latn-ZZ",ak:"ak-Latn-GH",akk:"akk-Xsux-IQ",ala:"ala-Latn-ZZ",ali:"ali-Latn-ZZ",aln:"aln-Latn-XK",alt:"alt-Cyrl-RU",am:"am-Ethi-ET",amm:"amm-Latn-ZZ",amn:"amn-Latn-ZZ",amo:"amo-Latn-NG",amp:"amp-Latn-ZZ",an:"an-Latn-ES",anc:"anc-Latn-ZZ",ank:"ank-Latn-ZZ",ann:"ann-Latn-ZZ",any:"any-Latn-ZZ",aoj:"aoj-Latn-ZZ",aom:"aom-Latn-ZZ",aoz:"aoz-Latn-ID",apc:"apc-Arab-ZZ",apd:"apd-Arab-TG",ape:"ape-Latn-ZZ",apr:"apr-Latn-ZZ",aps:"aps-Latn-ZZ",apz:"apz-Latn-ZZ",ar:"ar-Arab-EG",arc:"arc-Armi-IR","arc-Nbat":"arc-Nbat-JO","arc-Palm":"arc-Palm-SY",arh:"arh-Latn-ZZ",arn:"arn-Latn-CL",aro:"aro-Latn-BO",arq:"arq-Arab-DZ",ars:"ars-Arab-SA",ary:"ary-Arab-MA",arz:"arz-Arab-EG",as:"as-Beng-IN",asa:"asa-Latn-TZ",ase:"ase-Sgnw-US",asg:"asg-Latn-ZZ",aso:"aso-Latn-ZZ",ast:"ast-Latn-ES",ata:"ata-Latn-ZZ",atg:"atg-Latn-ZZ",atj:"atj-Latn-CA",auy:"auy-Latn-ZZ",av:"av-Cyrl-RU",avl:"avl-Arab-ZZ",avn:"avn-Latn-ZZ",avt:"avt-Latn-ZZ",avu:"avu-Latn-ZZ",awa:"awa-Deva-IN",awb:"awb-Latn-ZZ",awo:"awo-Latn-ZZ",awx:"awx-Latn-ZZ",ay:"ay-Latn-BO",ayb:"ayb-Latn-ZZ",az:"az-Latn-AZ","az-Arab":"az-Arab-IR","az-IQ":"az-Arab-IQ","az-IR":"az-Arab-IR","az-RU":"az-Cyrl-RU",ba:"ba-Cyrl-RU",bal:"bal-Arab-PK",ban:"ban-Latn-ID",bap:"bap-Deva-NP",bar:"bar-Latn-AT",bas:"bas-Latn-CM",bav:"bav-Latn-ZZ",bax:"bax-Bamu-CM",bba:"bba-Latn-ZZ",bbb:"bbb-Latn-ZZ",bbc:"bbc-Latn-ID",bbd:"bbd-Latn-ZZ",bbj:"bbj-Latn-CM",bbp:"bbp-Latn-ZZ",bbr:"bbr-Latn-ZZ",bcf:"bcf-Latn-ZZ",bch:"bch-Latn-ZZ",bci:"bci-Latn-CI",bcm:"bcm-Latn-ZZ",bcn:"bcn-Latn-ZZ",bco:"bco-Latn-ZZ",bcq:"bcq-Ethi-ZZ",bcu:"bcu-Latn-ZZ",bdd:"bdd-Latn-ZZ",be:"be-Cyrl-BY",bef:"bef-Latn-ZZ",beh:"beh-Latn-ZZ",bej:"bej-Arab-SD",bem:"bem-Latn-ZM",bet:"bet-Latn-ZZ",bew:"bew-Latn-ID",bex:"bex-Latn-ZZ",bez:"bez-Latn-TZ",bfd:"bfd-Latn-CM",bfq:"bfq-Taml-IN",bft:"bft-Arab-PK",bfy:"bfy-Deva-IN",bg:"bg-Cyrl-BG",bgc:"bgc-Deva-IN",bgn:"bgn-Arab-PK",bgx:"bgx-Grek-TR",bhb:"bhb-Deva-IN",bhg:"bhg-Latn-ZZ",bhi:"bhi-Deva-IN",bhl:"bhl-Latn-ZZ",bho:"bho-Deva-IN",bhy:"bhy-Latn-ZZ",bi:"bi-Latn-VU",bib:"bib-Latn-ZZ",big:"big-Latn-ZZ",bik:"bik-Latn-PH",bim:"bim-Latn-ZZ",bin:"bin-Latn-NG",bio:"bio-Latn-ZZ",biq:"biq-Latn-ZZ",bjh:"bjh-Latn-ZZ",bji:"bji-Ethi-ZZ",bjj:"bjj-Deva-IN",bjn:"bjn-Latn-ID",bjo:"bjo-Latn-ZZ",bjr:"bjr-Latn-ZZ",bjt:"bjt-Latn-SN",bjz:"bjz-Latn-ZZ",bkc:"bkc-Latn-ZZ",bkm:"bkm-Latn-CM",bkq:"bkq-Latn-ZZ",bku:"bku-Latn-PH",bkv:"bkv-Latn-ZZ",blg:"blg-Latn-MY",blt:"blt-Tavt-VN",bm:"bm-Latn-ML",bmh:"bmh-Latn-ZZ",bmk:"bmk-Latn-ZZ",bmq:"bmq-Latn-ML",bmu:"bmu-Latn-ZZ",bn:"bn-Beng-BD",bng:"bng-Latn-ZZ",bnm:"bnm-Latn-ZZ",bnp:"bnp-Latn-ZZ",bo:"bo-Tibt-CN",boj:"boj-Latn-ZZ",bom:"bom-Latn-ZZ",bon:"bon-Latn-ZZ",bpy:"bpy-Beng-IN",bqc:"bqc-Latn-ZZ",bqi:"bqi-Arab-IR",bqp:"bqp-Latn-ZZ",bqv:"bqv-Latn-CI",br:"br-Latn-FR",bra:"bra-Deva-IN",brh:"brh-Arab-PK",brx:"brx-Deva-IN",brz:"brz-Latn-ZZ",bs:"bs-Latn-BA",bsj:"bsj-Latn-ZZ",bsq:"bsq-Bass-LR",bss:"bss-Latn-CM",bst:"bst-Ethi-ZZ",bto:"bto-Latn-PH",btt:"btt-Latn-ZZ",btv:"btv-Deva-PK",bua:"bua-Cyrl-RU",buc:"buc-Latn-YT",bud:"bud-Latn-ZZ",bug:"bug-Latn-ID",buk:"buk-Latn-ZZ",bum:"bum-Latn-CM",buo:"buo-Latn-ZZ",bus:"bus-Latn-ZZ",buu:"buu-Latn-ZZ",bvb:"bvb-Latn-GQ",bwd:"bwd-Latn-ZZ",bwr:"bwr-Latn-ZZ",bxh:"bxh-Latn-ZZ",bye:"bye-Latn-ZZ",byn:"byn-Ethi-ER",byr:"byr-Latn-ZZ",bys:"bys-Latn-ZZ",byv:"byv-Latn-CM",byx:"byx-Latn-ZZ",bza:"bza-Latn-ZZ",bze:"bze-Latn-ML",bzf:"bzf-Latn-ZZ",bzh:"bzh-Latn-ZZ",bzw:"bzw-Latn-ZZ",ca:"ca-Latn-ES",cad:"cad-Latn-US",can:"can-Latn-ZZ",cbj:"cbj-Latn-ZZ",cch:"cch-Latn-NG",ccp:"ccp-Cakm-BD",ce:"ce-Cyrl-RU",ceb:"ceb-Latn-PH",cfa:"cfa-Latn-ZZ",cgg:"cgg-Latn-UG",ch:"ch-Latn-GU",chk:"chk-Latn-FM",chm:"chm-Cyrl-RU",cho:"cho-Latn-US",chp:"chp-Latn-CA",chr:"chr-Cher-US",cic:"cic-Latn-US",cja:"cja-Arab-KH",cjm:"cjm-Cham-VN",cjv:"cjv-Latn-ZZ",ckb:"ckb-Arab-IQ",ckl:"ckl-Latn-ZZ",cko:"cko-Latn-ZZ",cky:"cky-Latn-ZZ",cla:"cla-Latn-ZZ",cme:"cme-Latn-ZZ",cmg:"cmg-Soyo-MN",co:"co-Latn-FR",cop:"cop-Copt-EG",cps:"cps-Latn-PH",cr:"cr-Cans-CA",crh:"crh-Cyrl-UA",crj:"crj-Cans-CA",crk:"crk-Cans-CA",crl:"crl-Cans-CA",crm:"crm-Cans-CA",crs:"crs-Latn-SC",cs:"cs-Latn-CZ",csb:"csb-Latn-PL",csw:"csw-Cans-CA",ctd:"ctd-Pauc-MM",cu:"cu-Cyrl-RU","cu-Glag":"cu-Glag-BG",cv:"cv-Cyrl-RU",cy:"cy-Latn-GB",da:"da-Latn-DK",dad:"dad-Latn-ZZ",daf:"daf-Latn-CI",dag:"dag-Latn-ZZ",dah:"dah-Latn-ZZ",dak:"dak-Latn-US",dar:"dar-Cyrl-RU",dav:"dav-Latn-KE",dbd:"dbd-Latn-ZZ",dbq:"dbq-Latn-ZZ",dcc:"dcc-Arab-IN",ddn:"ddn-Latn-ZZ",de:"de-Latn-DE",ded:"ded-Latn-ZZ",den:"den-Latn-CA",dga:"dga-Latn-ZZ",dgh:"dgh-Latn-ZZ",dgi:"dgi-Latn-ZZ",dgl:"dgl-Arab-ZZ",dgr:"dgr-Latn-CA",dgz:"dgz-Latn-ZZ",dia:"dia-Latn-ZZ",dje:"dje-Latn-NE",dmf:"dmf-Medf-NG",dnj:"dnj-Latn-CI",dob:"dob-Latn-ZZ",doi:"doi-Deva-IN",dop:"dop-Latn-ZZ",dow:"dow-Latn-ZZ",drh:"drh-Mong-CN",dri:"dri-Latn-ZZ",drs:"drs-Ethi-ZZ",dsb:"dsb-Latn-DE",dtm:"dtm-Latn-ML",dtp:"dtp-Latn-MY",dts:"dts-Latn-ZZ",dty:"dty-Deva-NP",dua:"dua-Latn-CM",duc:"duc-Latn-ZZ",dud:"dud-Latn-ZZ",dug:"dug-Latn-ZZ",dv:"dv-Thaa-MV",dva:"dva-Latn-ZZ",dww:"dww-Latn-ZZ",dyo:"dyo-Latn-SN",dyu:"dyu-Latn-BF",dz:"dz-Tibt-BT",dzg:"dzg-Latn-ZZ",ebu:"ebu-Latn-KE",ee:"ee-Latn-GH",efi:"efi-Latn-NG",egl:"egl-Latn-IT",egy:"egy-Egyp-EG",eka:"eka-Latn-ZZ",eky:"eky-Kali-MM",el:"el-Grek-GR",ema:"ema-Latn-ZZ",emi:"emi-Latn-ZZ",en:"en-Latn-US","en-Shaw":"en-Shaw-GB",enn:"enn-Latn-ZZ",enq:"enq-Latn-ZZ",eo:"eo-Latn-001",eri:"eri-Latn-ZZ",es:"es-Latn-ES",esg:"esg-Gonm-IN",esu:"esu-Latn-US",et:"et-Latn-EE",etr:"etr-Latn-ZZ",ett:"ett-Ital-IT",etu:"etu-Latn-ZZ",etx:"etx-Latn-ZZ",eu:"eu-Latn-ES",ewo:"ewo-Latn-CM",ext:"ext-Latn-ES",eza:"eza-Latn-ZZ",fa:"fa-Arab-IR",faa:"faa-Latn-ZZ",fab:"fab-Latn-ZZ",fag:"fag-Latn-ZZ",fai:"fai-Latn-ZZ",fan:"fan-Latn-GQ",ff:"ff-Latn-SN","ff-Adlm":"ff-Adlm-GN",ffi:"ffi-Latn-ZZ",ffm:"ffm-Latn-ML",fi:"fi-Latn-FI",fia:"fia-Arab-SD",fil:"fil-Latn-PH",fit:"fit-Latn-SE",fj:"fj-Latn-FJ",flr:"flr-Latn-ZZ",fmp:"fmp-Latn-ZZ",fo:"fo-Latn-FO",fod:"fod-Latn-ZZ",fon:"fon-Latn-BJ",for:"for-Latn-ZZ",fpe:"fpe-Latn-ZZ",fqs:"fqs-Latn-ZZ",fr:"fr-Latn-FR",frc:"frc-Latn-US",frp:"frp-Latn-FR",frr:"frr-Latn-DE",frs:"frs-Latn-DE",fub:"fub-Arab-CM",fud:"fud-Latn-WF",fue:"fue-Latn-ZZ",fuf:"fuf-Latn-GN",fuh:"fuh-Latn-ZZ",fuq:"fuq-Latn-NE",fur:"fur-Latn-IT",fuv:"fuv-Latn-NG",fuy:"fuy-Latn-ZZ",fvr:"fvr-Latn-SD",fy:"fy-Latn-NL",ga:"ga-Latn-IE",gaa:"gaa-Latn-GH",gaf:"gaf-Latn-ZZ",gag:"gag-Latn-MD",gah:"gah-Latn-ZZ",gaj:"gaj-Latn-ZZ",gam:"gam-Latn-ZZ",gan:"gan-Hans-CN",gaw:"gaw-Latn-ZZ",gay:"gay-Latn-ID",gba:"gba-Latn-ZZ",gbf:"gbf-Latn-ZZ",gbm:"gbm-Deva-IN",gby:"gby-Latn-ZZ",gbz:"gbz-Arab-IR",gcr:"gcr-Latn-GF",gd:"gd-Latn-GB",gde:"gde-Latn-ZZ",gdn:"gdn-Latn-ZZ",gdr:"gdr-Latn-ZZ",geb:"geb-Latn-ZZ",gej:"gej-Latn-ZZ",gel:"gel-Latn-ZZ",gez:"gez-Ethi-ET",gfk:"gfk-Latn-ZZ",ggn:"ggn-Deva-NP",ghs:"ghs-Latn-ZZ",gil:"gil-Latn-KI",gim:"gim-Latn-ZZ",gjk:"gjk-Arab-PK",gjn:"gjn-Latn-ZZ",gju:"gju-Arab-PK",gkn:"gkn-Latn-ZZ",gkp:"gkp-Latn-ZZ",gl:"gl-Latn-ES",glk:"glk-Arab-IR",gmm:"gmm-Latn-ZZ",gmv:"gmv-Ethi-ZZ",gn:"gn-Latn-PY",gnd:"gnd-Latn-ZZ",gng:"gng-Latn-ZZ",god:"god-Latn-ZZ",gof:"gof-Ethi-ZZ",goi:"goi-Latn-ZZ",gom:"gom-Deva-IN",gon:"gon-Telu-IN",gor:"gor-Latn-ID",gos:"gos-Latn-NL",got:"got-Goth-UA",grb:"grb-Latn-ZZ",grc:"grc-Cprt-CY","grc-Linb":"grc-Linb-GR",grt:"grt-Beng-IN",grw:"grw-Latn-ZZ",gsw:"gsw-Latn-CH",gu:"gu-Gujr-IN",gub:"gub-Latn-BR",guc:"guc-Latn-CO",gud:"gud-Latn-ZZ",gur:"gur-Latn-GH",guw:"guw-Latn-ZZ",gux:"gux-Latn-ZZ",guz:"guz-Latn-KE",gv:"gv-Latn-IM",gvf:"gvf-Latn-ZZ",gvr:"gvr-Deva-NP",gvs:"gvs-Latn-ZZ",gwc:"gwc-Arab-ZZ",gwi:"gwi-Latn-CA",gwt:"gwt-Arab-ZZ",gyi:"gyi-Latn-ZZ",ha:"ha-Latn-NG","ha-CM":"ha-Arab-CM","ha-SD":"ha-Arab-SD",hag:"hag-Latn-ZZ",hak:"hak-Hans-CN",ham:"ham-Latn-ZZ",haw:"haw-Latn-US",haz:"haz-Arab-AF",hbb:"hbb-Latn-ZZ",hdy:"hdy-Ethi-ZZ",he:"he-Hebr-IL",hhy:"hhy-Latn-ZZ",hi:"hi-Deva-IN",hia:"hia-Latn-ZZ",hif:"hif-Latn-FJ",hig:"hig-Latn-ZZ",hih:"hih-Latn-ZZ",hil:"hil-Latn-PH",hla:"hla-Latn-ZZ",hlu:"hlu-Hluw-TR",hmd:"hmd-Plrd-CN",hmt:"hmt-Latn-ZZ",hnd:"hnd-Arab-PK",hne:"hne-Deva-IN",hnj:"hnj-Hmnp-US",hnn:"hnn-Latn-PH",hno:"hno-Arab-PK",ho:"ho-Latn-PG",hoc:"hoc-Deva-IN",hoj:"hoj-Deva-IN",hot:"hot-Latn-ZZ",hr:"hr-Latn-HR",hsb:"hsb-Latn-DE",hsn:"hsn-Hans-CN",ht:"ht-Latn-HT",hu:"hu-Latn-HU",hui:"hui-Latn-ZZ",hy:"hy-Armn-AM",hz:"hz-Latn-NA",ia:"ia-Latn-001",ian:"ian-Latn-ZZ",iar:"iar-Latn-ZZ",iba:"iba-Latn-MY",ibb:"ibb-Latn-NG",iby:"iby-Latn-ZZ",ica:"ica-Latn-ZZ",ich:"ich-Latn-ZZ",id:"id-Latn-ID",idd:"idd-Latn-ZZ",idi:"idi-Latn-ZZ",idu:"idu-Latn-ZZ",ife:"ife-Latn-TG",ig:"ig-Latn-NG",igb:"igb-Latn-ZZ",ige:"ige-Latn-ZZ",ii:"ii-Yiii-CN",ijj:"ijj-Latn-ZZ",ik:"ik-Latn-US",ikk:"ikk-Latn-ZZ",ikt:"ikt-Latn-CA",ikw:"ikw-Latn-ZZ",ikx:"ikx-Latn-ZZ",ilo:"ilo-Latn-PH",imo:"imo-Latn-ZZ",in:"in-Latn-ID",inh:"inh-Cyrl-RU",io:"io-Latn-001",iou:"iou-Latn-ZZ",iri:"iri-Latn-ZZ",is:"is-Latn-IS",it:"it-Latn-IT",iu:"iu-Cans-CA",iw:"iw-Hebr-IL",iwm:"iwm-Latn-ZZ",iws:"iws-Latn-ZZ",izh:"izh-Latn-RU",izi:"izi-Latn-ZZ",ja:"ja-Jpan-JP",jab:"jab-Latn-ZZ",jam:"jam-Latn-JM",jar:"jar-Latn-ZZ",jbo:"jbo-Latn-001",jbu:"jbu-Latn-ZZ",jen:"jen-Latn-ZZ",jgk:"jgk-Latn-ZZ",jgo:"jgo-Latn-CM",ji:"ji-Hebr-UA",jib:"jib-Latn-ZZ",jmc:"jmc-Latn-TZ",jml:"jml-Deva-NP",jra:"jra-Latn-ZZ",jut:"jut-Latn-DK",jv:"jv-Latn-ID",jw:"jw-Latn-ID",ka:"ka-Geor-GE",kaa:"kaa-Cyrl-UZ",kab:"kab-Latn-DZ",kac:"kac-Latn-MM",kad:"kad-Latn-ZZ",kai:"kai-Latn-ZZ",kaj:"kaj-Latn-NG",kam:"kam-Latn-KE",kao:"kao-Latn-ML",kbd:"kbd-Cyrl-RU",kbm:"kbm-Latn-ZZ",kbp:"kbp-Latn-ZZ",kbq:"kbq-Latn-ZZ",kbx:"kbx-Latn-ZZ",kby:"kby-Arab-NE",kcg:"kcg-Latn-NG",kck:"kck-Latn-ZW",kcl:"kcl-Latn-ZZ",kct:"kct-Latn-ZZ",kde:"kde-Latn-TZ",kdh:"kdh-Latn-TG",kdl:"kdl-Latn-ZZ",kdt:"kdt-Thai-TH",kea:"kea-Latn-CV",ken:"ken-Latn-CM",kez:"kez-Latn-ZZ",kfo:"kfo-Latn-CI",kfr:"kfr-Deva-IN",kfy:"kfy-Deva-IN",kg:"kg-Latn-CD",kge:"kge-Latn-ID",kgf:"kgf-Latn-ZZ",kgp:"kgp-Latn-BR",kha:"kha-Latn-IN",khb:"khb-Talu-CN",khn:"khn-Deva-IN",khq:"khq-Latn-ML",khs:"khs-Latn-ZZ",kht:"kht-Mymr-IN",khw:"khw-Arab-PK",khz:"khz-Latn-ZZ",ki:"ki-Latn-KE",kij:"kij-Latn-ZZ",kiu:"kiu-Latn-TR",kiw:"kiw-Latn-ZZ",kj:"kj-Latn-NA",kjd:"kjd-Latn-ZZ",kjg:"kjg-Laoo-LA",kjs:"kjs-Latn-ZZ",kjy:"kjy-Latn-ZZ",kk:"kk-Cyrl-KZ","kk-AF":"kk-Arab-AF","kk-Arab":"kk-Arab-CN","kk-CN":"kk-Arab-CN","kk-IR":"kk-Arab-IR","kk-MN":"kk-Arab-MN",kkc:"kkc-Latn-ZZ",kkj:"kkj-Latn-CM",kl:"kl-Latn-GL",kln:"kln-Latn-KE",klq:"klq-Latn-ZZ",klt:"klt-Latn-ZZ",klx:"klx-Latn-ZZ",km:"km-Khmr-KH",kmb:"kmb-Latn-AO",kmh:"kmh-Latn-ZZ",kmo:"kmo-Latn-ZZ",kms:"kms-Latn-ZZ",kmu:"kmu-Latn-ZZ",kmw:"kmw-Latn-ZZ",kn:"kn-Knda-IN",knf:"knf-Latn-GW",knp:"knp-Latn-ZZ",ko:"ko-Kore-KR",koi:"koi-C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","ky-CN":"ky-Arab-CN","ky-Latn":"ky-Latn-TR","ky-TR":"ky-Latn-TR",kye:"kye-Latn-ZZ",kyx:"kyx-Latn-ZZ",kzh:"kzh-Arab-ZZ",kzj:"kzj-Latn-MY",kzr:"kzr-Latn-ZZ",kzt:"kzt-Latn-MY",la:"la-Latn-VA",lab:"lab-Lina-GR",lad:"lad-Hebr-IL",lag:"lag-Latn-TZ",lah:"lah-Arab-PK",laj:"laj-Latn-UG",las:"las-Latn-ZZ",lb:"lb-Latn-LU",lbe:"lbe-Cyrl-RU",lbu:"lbu-Latn-ZZ",lbw:"lbw-Latn-ID",lcm:"lcm-Latn-ZZ",lcp:"lcp-Thai-CN",ldb:"ldb-Latn-ZZ",led:"led-Latn-ZZ",lee:"lee-Latn-ZZ",lem:"lem-Latn-ZZ",lep:"lep-Lepc-IN",leq:"leq-Latn-ZZ",leu:"leu-Latn-ZZ",lez:"lez-Cyrl-RU",lg:"lg-Latn-UG",lgg:"lgg-Latn-ZZ",li:"li-Latn-NL",lia:"lia-Latn-ZZ",lid:"lid-Latn-ZZ",lif:"lif-Deva-NP","lif-Limb":"lif-Limb-IN",lig:"lig-Latn-ZZ",lih:"lih-Latn-ZZ",lij:"lij-Latn-IT",lis:"lis-Lisu-CN",ljp:"ljp-Latn-ID",lki:"lki-Arab-IR",lkt:"lkt-Latn-US",lle:"lle-Latn-ZZ",lln:"lln-Latn-ZZ",lmn:"lmn-Telu-IN",lmo:"lmo-Latn-IT",lmp:"lmp-Latn-ZZ",ln:"ln-Latn-CD",lns:"lns-Latn-ZZ",lnu:"lnu-Latn-ZZ",lo:"lo-Laoo-LA",loj:"loj-Latn-ZZ",lok:"lok-Latn-ZZ",lol:"lol-Latn-CD",lor:"lor-Latn-ZZ",los:"los-Latn-ZZ",loz:"loz-Latn-ZM",lrc:"lrc-Arab-IR",lt:"lt-Latn-LT",ltg:"ltg-Latn-LV",lu:"lu-Latn-CD",lua:"lua-Latn-CD",luo:"luo-Latn-KE",luy:"luy-Latn-KE",luz:"luz-Arab-IR",lv:"lv-Latn-LV",lwl:"lwl-Thai-TH",lzh:"lzh-Hans-CN",lzz:"lzz-Latn-TR",mad:"mad-Latn-ID",maf:"maf-Latn-CM",mag:"mag-Deva-IN",mai:"mai-Deva-IN",mak:"mak-Latn-ID",man:"man-Latn-GM","man-GN":"man-Nkoo-GN","man-Nkoo":"man-Nkoo-GN",mas:"mas-Latn-KE",maw:"maw-Latn-ZZ",maz:"maz-Latn-MX",mbh:"mbh-Latn-ZZ",mbo:"mbo-Latn-ZZ",mbq:"mbq-Latn-ZZ",mbu:"mbu-Latn-ZZ",mbw:"mbw-Latn-ZZ",mci:"mci-Latn-ZZ",mcp:"mcp-Latn-ZZ",mcq:"mcq-Latn-ZZ",mcr:"mcr-Latn-ZZ",mcu:"mcu-Latn-ZZ",mda:"mda-Latn-ZZ",mde:"mde-Arab-ZZ",mdf:"mdf-Cyrl-RU",mdh:"mdh-Latn-PH",mdj:"mdj-Latn-ZZ",mdr:"mdr-Latn-ID",mdx:"mdx-Ethi-ZZ",med:"med-Latn-ZZ",mee:"mee-Latn-ZZ",mek:"mek-Latn-ZZ",men:"men-Latn-SL",mer:"mer-Latn-KE",met:"met-Latn-ZZ",meu:"meu-Latn-ZZ",mfa:"mfa-Arab-TH",mfe:"mfe-Latn-MU",mfn:"mfn-Latn-ZZ",mfo:"mfo-Latn-ZZ",mfq:"mfq-Latn-ZZ",mg:"mg-Latn-MG",mgh:"mgh-Latn-MZ",mgl:"mgl-Latn-ZZ",mgo:"mgo-Latn-CM",mgp:"mgp-Deva-NP",mgy:"mgy-Latn-TZ",mh:"mh-Latn-MH",mhi:"mhi-Latn-ZZ",mhl:"mhl-Latn-ZZ",mi:"mi-Latn-NZ",mif:"mif-Latn-ZZ",min:"min-Latn-ID",miw:"miw-Latn-ZZ",mk:"mk-Cyrl-MK",mki:"mki-Arab-ZZ",mkl:"mkl-Latn-ZZ",mkp:"mkp-Latn-ZZ",mkw:"mkw-Latn-ZZ",ml:"ml-Mlym-IN",mle:"mle-Latn-ZZ",mlp:"mlp-Latn-ZZ",mls:"mls-Latn-SD",mmo:"mmo-Latn-ZZ",mmu:"mmu-Latn-ZZ",mmx:"mmx-Latn-ZZ",mn:"mn-Cyrl-MN","mn-CN":"mn-Mong-CN","mn-Mong":"mn-Mong-CN",mna:"mna-Latn-ZZ",mnf:"mnf-Latn-ZZ",mni:"mni-Beng-IN",mnw:"mnw-Mymr-MM",mo:"mo-Latn-RO",moa:"moa-Latn-ZZ",moe:"moe-Latn-CA",moh:"moh-Latn-CA",mos:"mos-Latn-BF",mox:"mox-Latn-ZZ",mpp:"mpp-Latn-ZZ",mps:"mps-Latn-ZZ",mpt:"mpt-Latn-ZZ",mpx:"mpx-Latn-ZZ",mql:"mql-Latn-ZZ",mr:"mr-Deva-IN",mrd:"mrd-Deva-NP",mrj:"mrj-Cyrl-RU",mro:"mro-Mroo-BD",ms:"ms-Latn-MY","ms-CC":"ms-Arab-CC",mt:"mt-Latn-MT",mtc:"mtc-Latn-ZZ",mtf:"mtf-Latn-ZZ",mti:"mti-Latn-ZZ",mtr:"mtr-Deva-IN",mua:"mua-Latn-CM",mur:"mur-Latn-ZZ",mus:"mus-Latn-US",mva:"mva-Latn-ZZ",mvn:"mvn-Latn-ZZ",mvy:"mvy-Arab-PK",mwk:"mwk-Latn-ML",mwr:"mwr-Deva-IN",mwv:"mwv-Latn-ID",mww:"mww-Hmnp-US",mxc:"mxc-Latn-ZW",mxm:"mxm-Latn-ZZ",my:"my-Mymr-MM",myk:"myk-Latn-ZZ",mym:"mym-Ethi-ZZ",myv:"myv-Cyrl-RU",myw:"myw-Latn-ZZ",myx:"myx-Latn-UG",myz:"myz-Mand-IR",mzk:"mzk-Latn-ZZ",mzm:"mzm-Latn-ZZ",mzn:"mzn-Arab-IR",mzp:"mzp-Latn-ZZ",mzw:"mzw-Latn-ZZ",mzz:"mzz-Latn-ZZ",na:"na-Latn-NR",nac:"nac-Latn-ZZ",naf:"naf-Latn-ZZ",nak:"nak-Latn-ZZ",nan:"nan-Hans-CN",nap:"nap-Latn-IT",naq:"naq-Latn-NA",nas:"nas-Latn-ZZ",nb:"nb-Latn-NO",nca:"nca-Latn-ZZ",nce:"nce-Latn-ZZ",ncf:"ncf-Latn-ZZ",nch:"nch-Latn-MX",nco:"nco-Latn-ZZ",ncu:"ncu-Latn-ZZ",nd:"nd-Latn-ZW",ndc:"ndc-Latn-MZ",nds:"nds-Latn-DE",ne:"ne-Deva-NP",neb:"neb-Latn-ZZ",new:"new-Deva-NP",nex:"nex-Latn-ZZ",nfr:"nfr-Latn-ZZ",ng:"ng-Latn-NA",nga:"nga-Latn-ZZ",ngb:"ngb-Latn-ZZ",ngl:"ngl-Latn-MZ",nhb:"nhb-Latn-ZZ",nhe:"nhe-Latn-MX",nhw:"nhw-Latn-MX",nif:"nif-Latn-ZZ",nii:"nii-Latn-ZZ",nij:"nij-Latn-ID",nin:"nin-Latn-ZZ",niu:"niu-Latn-NU",niy:"niy-Latn-ZZ",niz:"niz-Latn-ZZ",njo:"njo-Latn-IN",nkg:"nkg-Latn-ZZ",nko:"nko-Latn-ZZ",nl:"nl-Latn-NL",nmg:"nmg-Latn-CM",nmz:"nmz-Latn-ZZ",nn:"nn-Latn-NO",nnf:"nnf-Latn-ZZ",nnh:"nnh-Latn-CM",nnk:"nnk-Latn-ZZ",nnm:"nnm-Latn-ZZ",nnp:"nnp-Wcho-IN",no:"no-Latn-NO",nod:"nod-Lana-TH",noe:"noe-Deva-IN",non:"non-Runr-SE",nop:"nop-Latn-ZZ",nou:"nou-Latn-ZZ",nqo:"nqo-Nkoo-GN",nr:"nr-Latn-ZA",nrb:"nrb-Latn-ZZ",nsk:"nsk-Cans-CA",nsn:"nsn-Latn-ZZ",nso:"nso-Latn-ZA",nss:"nss-Latn-ZZ",nst:"nst-Tnsa-IN",ntm:"ntm-Latn-ZZ",ntr:"ntr-Latn-ZZ",nui:"nui-Latn-ZZ",nup:"nup-Latn-ZZ",nus:"nus-Latn-SS",nuv:"nuv-Latn-ZZ",nux:"nux-Latn-ZZ",nv:"nv-Latn-US",nwb:"nwb-Latn-ZZ",nxq:"nxq-Latn-CN",nxr:"nxr-Latn-ZZ",ny:"ny-Latn-MW",nym:"nym-Latn-TZ",nyn:"nyn-Latn-UG",nzi:"nzi-Latn-GH",oc:"oc-Latn-FR",ogc:"ogc-Latn-ZZ",okr:"okr-Latn-ZZ",okv:"okv-Latn-ZZ",om:"om-Latn-ET",ong:"ong-Latn-ZZ",onn:"onn-Latn-ZZ",ons:"ons-Latn-ZZ",opm:"opm-Latn-ZZ",or:"or-Orya-IN",oro:"oro-Latn-ZZ",oru:"oru-Arab-ZZ",os:"os-Cyrl-GE",osa:"osa-Osge-US",ota:"ota-Arab-ZZ",otk:"otk-Orkh-MN",oui:"oui-Ougr-143",ozm:"ozm-Latn-ZZ",pa:"pa-Guru-IN","pa-Arab":"pa-Arab-PK","pa-PK":"pa-Arab-PK",pag:"pag-Latn-PH",pal:"pal-Phli-IR","pal-Phlp":"pal-Phlp-CN",pam:"pam-Latn-PH",pap:"pap-Latn-AW",pau:"pau-Latn-PW",pbi:"pbi-Latn-ZZ",pcd:"pcd-Latn-FR",pcm:"pcm-Latn-NG",pdc:"pdc-Latn-US",pdt:"pdt-Latn-CA",ped:"ped-Latn-ZZ",peo:"peo-Xpeo-IR",pex:"pex-Latn-ZZ",pfl:"pfl-Latn-DE",phl:"phl-Arab-ZZ",phn:"phn-Phnx-LB",pil:"pil-Latn-ZZ",pip:"pip-Latn-ZZ",pka:"pka-Brah-IN",pko:"pko-Latn-KE",pl:"pl-Latn-PL",pla:"pla-Latn-ZZ",pms:"pms-Latn-IT",png:"png-Latn-ZZ",pnn:"pnn-Latn-ZZ",pnt:"pnt-Grek-GR",pon:"pon-Latn-FM",ppa:"ppa-Deva-IN",ppo:"ppo-Latn-ZZ",pra:"pra-Khar-PK",prd:"prd-Arab-IR",prg:"prg-Latn-001",ps:"ps-Arab-AF",pss:"pss-Latn-ZZ",pt:"pt-Latn-BR",ptp:"ptp-Latn-ZZ",puu:"puu-Latn-GA",pwa:"pwa-Latn-ZZ",qu:"qu-Latn-PE",quc:"quc-Latn-GT",qug:"qug-Latn-EC",rai:"rai-Latn-ZZ",raj:"raj-Deva-IN",rao:"rao-Latn-ZZ",rcf:"rcf-Latn-RE",rej:"rej-Latn-ID",rel:"rel-Latn-ZZ",res:"res-Latn-ZZ",rgn:"rgn-Latn-IT",rhg:"rhg-Rohg-MM",ria:"ria-Latn-IN",rif:"rif-Tfng-MA","rif-NL":"rif-Latn-NL",rjs:"rjs-Deva-NP",rkt:"rkt-Beng-BD",rm:"rm-Latn-CH",rmf:"rmf-Latn-FI",rmo:"rmo-Latn-CH",rmt:"rmt-Arab-IR",rmu:"rmu-Latn-SE",rn:"rn-Latn-BI",rna:"rna-Latn-ZZ",rng:"rng-Latn-MZ",ro:"ro-Latn-RO",rob:"rob-Latn-ID",rof:"rof-Latn-TZ",roo:"roo-Latn-ZZ",rro:"rro-Latn-ZZ",rtm:"rtm-Latn-FJ",ru:"ru-Cyrl-RU",rue:"rue-Cyrl-UA",rug:"rug-Latn-SB",rw:"rw-Latn-RW",rwk:"rwk-Latn-TZ",rwo:"rwo-Latn-ZZ",ryu:"ryu-Kana-JP",sa:"sa-Deva-IN",saf:"saf-Latn-GH",sah:"sah-Cyrl-RU",saq:"saq-Latn-KE",sas:"sas-Latn-ID",sat:"sat-Olck-IN",sav:"sav-Latn-SN",saz:"saz-Saur-IN",sba:"sba-Latn-ZZ",sbe:"sbe-Latn-ZZ",sbp:"sbp-Latn-TZ",sc:"sc-Latn-IT",sck:"sck-Deva-IN",scl:"scl-Arab-ZZ",scn:"scn-Latn-IT",sco:"sco-Latn-GB",scs:"scs-Latn-CA",sd:"sd-Arab-PK","sd-Deva":"sd-Deva-IN","sd-Khoj":"sd-Khoj-IN","sd-Sind":"sd-Sind-IN",sdc:"sdc-Latn-IT",sdh:"sdh-Arab-IR",se:"se-Latn-NO",sef:"sef-Latn-CI",seh:"seh-Latn-MZ",sei:"sei-Latn-MX",ses:"ses-Latn-ML",sg:"sg-Latn-CF",sga:"sga-Ogam-IE",sgs:"sgs-Latn-LT",sgw:"sgw-Ethi-ZZ",sgz:"sgz-Latn-ZZ",shi:"shi-Tfng-MA",shk:"shk-Latn-ZZ",shn:"shn-Mymr-MM",shu:"shu-Arab-ZZ",si:"si-Sinh-LK",sid:"sid-Latn-ET",sig:"sig-Latn-ZZ",sil:"sil-Latn-ZZ",sim:"sim-Latn-ZZ",sjr:"sjr-Latn-ZZ",sk:"sk-Latn-SK",skc:"skc-Latn-ZZ",skr:"skr-Arab-PK",sks:"sks-Latn-ZZ",sl:"sl-Latn-SI",sld:"sld-Latn-ZZ",sli:"sli-Latn-PL",sll:"sll-Latn-ZZ",sly:"sly-Latn-ID",sm:"sm-Latn-WS",sma:"sma-Latn-SE",smj:"smj-Latn-SE",smn:"smn-Latn-FI",smp:"smp-Samr-IL",smq:"smq-Latn-ZZ",sms:"sms-Latn-FI",sn:"sn-Latn-ZW",snc:"snc-Latn-ZZ",snk:"snk-Latn-ML",snp:"snp-Latn-ZZ",snx:"snx-Latn-ZZ",sny:"sny-Latn-ZZ",so:"so-Latn-SO",sog:"sog-Sogd-UZ",sok:"sok-Latn-ZZ",soq:"soq-Latn-ZZ",sou:"sou-Thai-TH",soy:"soy-Latn-ZZ",spd:"spd-Latn-ZZ",spl:"spl-Latn-ZZ",sps:"sps-Latn-ZZ",sq:"sq-Latn-AL",sr:"sr-Cyrl-RS","sr-ME":"sr-Latn-ME","sr-RO":"sr-Latn-RO","sr-RU":"sr-Latn-RU","sr-TR":"sr-Latn-TR",srb:"srb-Sora-IN",srn:"srn-Latn-SR",srr:"srr-Latn-SN",srx:"srx-Deva-IN",ss:"ss-Latn-ZA",ssd:"ssd-Latn-ZZ",ssg:"ssg-Latn-ZZ",ssy:"ssy-Latn-ER",st:"st-Latn-ZA",stk:"stk-Latn-ZZ",stq:"stq-Latn-DE",su:"su-Latn-ID",sua:"sua-Latn-ZZ",sue:"sue-Latn-ZZ",suk:"suk-Latn-TZ",sur:"sur-Latn-ZZ",sus:"sus-Latn-GN",sv:"sv-Latn-SE",sw:"sw-Latn-TZ",swb:"swb-Arab-YT",swc:"swc-Latn-CD",swg:"swg-Latn-DE",swp:"swp-Latn-ZZ",swv:"swv-Deva-IN",sxn:"sxn-Latn-ID",sxw:"sxw-Latn-ZZ",syl:"syl-Beng-BD",syr:"syr-Syrc-IQ",szl:"szl-Latn-PL",ta:"ta-Taml-IN",taj:"taj-Deva-NP",tal:"tal-Latn-ZZ",tan:"tan-Latn-ZZ",taq:"taq-Latn-ZZ",tbc:"tbc-Latn-ZZ",tbd:"tbd-Latn-ZZ",tbf:"tbf-Latn-ZZ",tbg:"tbg-Latn-ZZ",tbo:"tbo-Latn-ZZ",tbw:"tbw-Latn-PH",tbz:"tbz-Latn-ZZ",tci:"tci-Latn-ZZ",tcy:"tcy-Knda-IN",tdd:"tdd-Tale-CN",tdg:"tdg-Deva-NP",tdh:"tdh-Deva-NP",tdu:"tdu-Latn-MY",te:"te-Telu-IN",ted:"ted-Latn-ZZ",tem:"tem-Latn-SL",teo:"teo-Latn-UG",tet:"tet-Latn-TL",tfi:"tfi-Latn-ZZ",tg:"tg-Cyrl-TJ","tg-Arab":"tg-Arab-PK","tg-PK":"tg-Arab-PK",tgc:"tgc-Latn-ZZ",tgo:"tgo-Latn-ZZ",tgu:"tgu-Latn-ZZ",th:"th-Thai-TH",thl:"thl-Deva-NP",thq:"thq-Deva-NP",thr:"thr-Deva-NP",ti:"ti-Ethi-ET",tif:"tif-Latn-ZZ",tig:"tig-Ethi-ER",tik:"tik-Latn-ZZ",tim:"tim-Latn-ZZ",tio:"tio-Latn-ZZ",tiv:"tiv-Latn-NG",tk:"tk-Latn-TM",tkl:"tkl-Latn-TK",tkr:"tkr-Latn-AZ",tkt:"tkt-Deva-NP",tl:"tl-Latn-PH",tlf:"tlf-Latn-ZZ",tlx:"tlx-Latn-ZZ",tly:"tly-Latn-AZ",tmh:"tmh-Latn-NE",tmy:"tmy-Latn-ZZ",tn:"tn-Latn-ZA",tnh:"tnh-Latn-ZZ",to:"to-Latn-TO",tof:"tof-Latn-ZZ",tog:"tog-Latn-MW",toq:"toq-Latn-ZZ",tpi:"tpi-Latn-PG",tpm:"tpm-Latn-ZZ",tpz:"tpz-Latn-ZZ",tqo:"tqo-Latn-ZZ",tr:"tr-Latn-TR",tru:"tru-Latn-TR",trv:"trv-Latn-TW",trw:"trw-Arab-PK",ts:"ts-Latn-ZA",tsd:"tsd-Grek-GR",tsf:"tsf-Deva-NP",tsg:"tsg-Latn-PH",tsj:"tsj-Tibt-BT",tsw:"tsw-Latn-ZZ",tt:"tt-Cyrl-RU",ttd:"ttd-Latn-ZZ",tte:"tte-Latn-ZZ",ttj:"ttj-Latn-UG",ttr:"ttr-Latn-ZZ",tts:"tts-Thai-TH",ttt:"ttt-Latn-AZ",tuh:"tuh-Latn-ZZ",tul:"tul-Latn-ZZ",tum:"tum-Latn-MW",tuq:"tuq-Latn-ZZ",tvd:"tvd-Latn-ZZ",tvl:"tvl-Latn-TV",tvu:"tvu-Latn-ZZ",twh:"twh-Latn-ZZ",twq:"twq-Latn-NE",txg:"txg-Tang-CN",txo:"txo-Toto-IN",ty:"ty-Latn-PF",tya:"tya-Latn-ZZ",tyv:"tyv-Cyrl-RU",tzm:"tzm-Latn-MA",ubu:"ubu-Latn-ZZ",udi:"udi-Aghb-RU",udm:"udm-Cyrl-RU",ug:"ug-Arab-CN","ug-Cyrl":"ug-Cyrl-KZ","ug-KZ":"ug-Cyrl-KZ","ug-MN":"ug-Cyrl-MN",uga:"uga-Ugar-SY",uk:"uk-Cyrl-UA",uli:"uli-Latn-FM",umb:"umb-Latn-AO",und:"en-Latn-US","und-002":"en-Latn-NG","und-003":"en-Latn-US","und-005":"pt-Latn-BR","und-009":"en-Latn-AU","und-011":"en-Latn-NG","und-013":"es-Latn-MX","und-014":"sw-Latn-TZ","und-015":"ar-Arab-EG","und-017":"sw-Latn-CD","und-018":"en-Latn-ZA","und-019":"en-Latn-US","und-021":"en-Latn-US","und-029":"es-Latn-CU","und-030":"zh-Hans-CN","und-034":"hi-Deva-IN","und-035":"id-Latn-ID","und-039":"it-Latn-IT","und-053":"en-Latn-AU","und-054":"en-Latn-PG","und-057":"en-Latn-GU","und-061":"sm-Latn-WS","und-142":"zh-Hans-CN","und-143":"uz-Latn-UZ","und-145":"ar-Arab-SA","und-150":"ru-Cyrl-RU","und-151":"ru-Cyrl-RU","und-154":"en-Latn-GB","und-155":"de-Latn-DE","und-202":"en-Latn-NG","und-419":"es-Latn-419","und-AD":"ca-Latn-AD","und-Adlm":"ff-Adlm-GN","und-AE":"ar-Arab-AE","und-AF":"fa-Arab-AF","und-Aghb":"udi-Aghb-RU","und-Ahom":"aho-Ahom-IN","und-AL":"sq-Latn-AL","und-AM":"hy-Armn-AM","und-AO":"pt-Latn-AO","und-AQ":"und-Latn-AQ","und-AR":"es-Latn-AR","und-Arab":"ar-Arab-EG","und-Arab-CC":"ms-Arab-CC","und-Arab-CN":"ug-Arab-CN","und-Arab-GB":"ks-Arab-GB","und-Arab-ID":"ms-Arab-ID","und-Arab-IN":"ur-Arab-IN","und-Arab-KH":"cja-Arab-KH","und-Arab-MM":"rhg-Arab-MM","und-Arab-MN":"kk-Arab-MN","und-Arab-MU":"ur-Arab-MU","und-Arab-NG":"ha-Arab-NG","und-Arab-PK":"ur-Arab-PK","und-Arab-TG":"apd-Arab-TG","und-Arab-TH":"mfa-Arab-TH","und-Arab-TJ":"fa-Arab-TJ","und-Arab-TR":"az-Arab-TR","und-Arab-YT":"swb-Arab-YT","und-Armi":"arc-Armi-IR","und-Armn":"hy-Armn-AM","und-AS":"sm-Latn-AS","und-AT":"de-Latn-AT","und-Avst":"ae-Avst-IR","und-AW":"nl-Latn-AW","und-AX":"sv-Latn-AX","und-AZ":"az-Latn-AZ","und-BA":"bs-Latn-BA","und-Bali":"ban-Bali-ID","und-Bamu":"bax-Bamu-CM","und-Bass":"bsq-Bass-LR","und-Batk":"bbc-Batk-ID","und-BD":"bn-Beng-BD","und-BE":"nl-Latn-BE","und-Beng":"bn-Beng-BD","und-BF":"fr-Latn-BF","und-BG":"bg-Cyrl-BG","und-BH":"ar-Arab-BH","und-Bhks":"sa-Bhks-IN","und-BI":"rn-Latn-BI","und-BJ":"fr-Latn-BJ","und-BL":"fr-Latn-BL","und-BN":"ms-Latn-BN","und-BO":"es-Latn-BO","und-Bopo":"zh-Bopo-TW","und-BQ":"pap-Latn-BQ","und-BR":"pt-Latn-BR","und-Brah":"pka-Brah-IN","und-Brai":"fr-Brai-FR","und-BT":"dz-Tibt-BT","und-Bugi":"bug-Bugi-ID","und-Buhd":"bku-Buhd-PH","und-BV":"und-Latn-BV","und-BY":"be-Cyrl-BY","und-Cakm":"ccp-Cakm-BD","und-Cans":"cr-Cans-CA","und-Cari":"xcr-Cari-TR","und-CD":"sw-Latn-CD","und-CF":"fr-Latn-CF","und-CG":"fr-Latn-CG","und-CH":"de-Latn-CH","und-Cham":"cjm-Cham-VN","und-Cher":"chr-Cher-US","und-Chrs":"xco-Chrs-UZ","und-CI":"fr-Latn-CI","und-CL":"es-Latn-CL","und-CM":"fr-Latn-CM","und-CN":"zh-Hans-CN","und-CO":"es-Latn-CO","und-Copt":"cop-Copt-EG","und-CP":"und-Latn-CP","und-Cpmn":"und-Cpmn-CY","und-Cpmn-CY":"und-Cpmn-CY","und-Cprt":"grc-Cprt-CY","und-CR":"es-Latn-CR","und-CU":"es-Latn-CU","und-CV":"pt-Latn-CV","und-CW":"pap-Latn-CW","und-CY":"el-Grek-CY","und-Cyrl":"ru-Cyrl-RU","und-Cyrl-AL":"mk-Cyrl-AL","und-Cyrl-BA":"sr-Cyrl-BA","und-Cyrl-GE":"os-Cyrl-GE","und-Cyrl-GR":"mk-Cyrl-GR","und-Cyrl-MD":"uk-Cyrl-MD","und-Cyrl-RO":"bg-Cyrl-RO","und-Cyrl-SK":"uk-Cyrl-SK","und-Cyrl-TR":"kbd-Cyrl-TR","und-Cyrl-XK":"sr-Cyrl-XK","und-CZ":"cs-Latn-CZ","und-DE":"de-Latn-DE","und-Deva":"hi-Deva-IN","und-Deva-BT":"ne-Deva-BT","und-Deva-FJ":"hif-Deva-FJ","und-Deva-MU":"bho-Deva-MU","und-Deva-PK":"btv-Deva-PK","und-Diak":"dv-Diak-MV","und-DJ":"aa-Latn-DJ","und-DK":"da-Latn-DK","und-DO":"es-Latn-DO","und-Dogr":"doi-Dogr-IN","und-Dupl":"fr-Dupl-FR","und-DZ":"ar-Arab-DZ","und-EA":"es-Latn-EA","und-EC":"es-Latn-EC","und-EE":"et-Latn-EE","und-EG":"ar-Arab-EG","und-Egyp":"egy-Egyp-EG","und-EH":"ar-Arab-EH","und-Elba":"sq-Elba-AL","und-Elym":"arc-Elym-IR","und-ER":"ti-Ethi-ER","und-ES":"es-Latn-ES","und-ET":"am-Ethi-ET","und-Ethi":"am-Ethi-ET","und-EU":"en-Latn-IE","und-EZ":"de-Latn-EZ","und-FI":"fi-Latn-FI","und-FO":"fo-Latn-FO","und-FR":"fr-Latn-FR","und-GA":"fr-Latn-GA","und-GE":"ka-Geor-GE","und-Geor":"ka-Geor-GE","und-GF":"fr-Latn-GF","und-GH":"ak-Latn-GH","und-GL":"kl-Latn-GL","und-Glag":"cu-Glag-BG","und-GN":"fr-Latn-GN","und-Gong":"wsg-Gong-IN","und-Gonm":"esg-Gonm-IN","und-Goth":"got-Goth-UA","und-GP":"fr-Latn-GP","und-GQ":"es-Latn-GQ","und-GR":"el-Grek-GR","und-Gran":"sa-Gran-IN","und-Grek":"el-Grek-GR","und-Grek-TR":"bgx-Grek-TR","und-GS":"und-Latn-GS","und-GT":"es-Latn-GT","und-Gujr":"gu-Gujr-IN","und-Guru":"pa-Guru-IN","und-GW":"pt-Latn-GW","und-Hanb":"zh-Hanb-TW","und-Hang":"ko-Hang-KR","und-Hani":"zh-Hani-CN","und-Hano":"hnn-Hano-PH","und-Hans":"zh-Hans-CN","und-Hant":"zh-Hant-TW","und-Hebr":"he-Hebr-IL","und-Hebr-CA":"yi-Hebr-CA","und-Hebr-GB":"yi-Hebr-GB","und-Hebr-SE":"yi-Hebr-SE","und-Hebr-UA":"yi-Hebr-UA","und-Hebr-US":"yi-Hebr-US","und-Hira":"ja-Hira-JP","und-HK":"zh-Hant-HK","und-Hluw":"hlu-Hluw-TR","und-HM":"und-Latn-HM","und-Hmng":"hnj-Hmng-LA","und-Hmnp":"hnj-Hmnp-US","und-HN":"es-Latn-HN","und-HR":"hr-Latn-HR","und-HT":"ht-Latn-HT","und-HU":"hu-Latn-HU","und-Hung":"hu-Hung-HU","und-IC":"es-Latn-IC","und-ID":"id-Latn-ID","und-IL":"he-Hebr-IL","und-IN":"hi-Deva-IN","und-IQ":"ar-Arab-IQ","und-IR":"fa-Arab-IR","und-IS":"is-Latn-IS","und-IT":"it-Latn-IT","und-Ital":"ett-Ital-IT","und-Jamo":"ko-Jamo-KR","und-Java":"jv-Java-ID","und-JO":"ar-Arab-JO","und-JP":"ja-Jpan-JP","und-Jpan":"ja-Jpan-JP","und-Kali":"eky-Kali-MM","und-Kana":"ja-Kana-JP","und-KE":"sw-Latn-KE","und-KG":"ky-Cyrl-KG","und-KH":"km-Khmr-KH","und-Khar":"pra-Khar-PK","und-Khmr":"km-Khmr-KH","und-Khoj":"sd-Khoj-IN","und-Kits":"zkt-Kits-CN","und-KM":"ar-Arab-KM","und-Knda":"kn-Knda-IN","und-Kore":"ko-Kore-KR","und-KP":"ko-Kore-KP","und-KR":"ko-Kore-KR","und-Kthi":"bho-Kthi-IN","und-KW":"ar-Arab-KW","und-KZ":"ru-Cyrl-KZ","und-LA":"lo-Laoo-LA","und-Lana":"nod-Lana-TH","und-Laoo":"lo-Laoo-LA","und-Latn-AF":"tk-Latn-AF","und-Latn-AM":"ku-Latn-AM","und-Latn-CN":"za-Latn-CN","und-Latn-CY":"tr-Latn-CY","und-Latn-DZ":"fr-Latn-DZ","und-Latn-ET":"en-Latn-ET","und-Latn-GE":"ku-Latn-GE","und-Latn-IR":"tk-Latn-IR","und-Latn-KM":"fr-Latn-KM","und-Latn-MA":"fr-Latn-MA","und-Latn-MK":"sq-Latn-MK","und-Latn-MM":"kac-Latn-MM","und-Latn-MO":"pt-Latn-MO","und-Latn-MR":"fr-Latn-MR","und-Latn-RU":"krl-Latn-RU","und-Latn-SY":"fr-Latn-SY","und-Latn-TN":"fr-Latn-TN","und-Latn-TW":"trv-Latn-TW","und-Latn-UA":"pl-Latn-UA","und-LB":"ar-Arab-LB","und-Lepc":"lep-Lepc-IN","und-LI":"de-Latn-LI","und-Limb":"lif-Limb-IN","und-Lina":"lab-Lina-GR","und-Linb":"grc-Linb-GR","und-Lisu":"lis-Lisu-CN","und-LK":"si-Sinh-LK","und-LS":"st-Latn-LS","und-LT":"lt-Latn-LT","und-LU":"fr-Latn-LU","und-LV":"lv-Latn-LV","und-LY":"ar-Arab-LY","und-Lyci":"xlc-Lyci-TR","und-Lydi":"xld-Lydi-TR","und-MA":"ar-Arab-MA","und-Mahj":"hi-Mahj-IN","und-Maka":"mak-Maka-ID","und-Mand":"myz-Mand-IR","und-Mani":"xmn-Mani-CN","und-Marc":"bo-Marc-CN","und-MC":"fr-Latn-MC","und-MD":"ro-Latn-MD","und-ME":"sr-Latn-ME","und-Medf":"dmf-Medf-NG","und-Mend":"men-Mend-SL","und-Merc":"xmr-Merc-SD","und-Mero":"xmr-Mero-SD","und-MF":"fr-Latn-MF","und-MG":"mg-Latn-MG","und-MK":"mk-Cyrl-MK","und-ML":"bm-Latn-ML","und-Mlym":"ml-Mlym-IN","und-MM":"my-Mymr-MM","und-MN":"mn-Cyrl-MN","und-MO":"zh-Hant-MO","und-Modi":"mr-Modi-IN","und-Mong":"mn-Mong-CN","und-MQ":"fr-Latn-MQ","und-MR":"ar-Arab-MR","und-Mroo":"mro-Mroo-BD","und-MT":"mt-Latn-MT","und-Mtei":"mni-Mtei-IN","und-MU":"mfe-Latn-MU","und-Mult":"skr-Mult-PK","und-MV":"dv-Thaa-MV","und-MX":"es-Latn-MX","und-MY":"ms-Latn-MY","und-Mymr":"my-Mymr-MM","und-Mymr-IN":"kht-Mymr-IN","und-Mymr-TH":"mnw-Mymr-TH","und-MZ":"pt-Latn-MZ","und-NA":"af-Latn-NA","und-Nand":"sa-Nand-IN","und-Narb":"xna-Narb-SA","und-Nbat":"arc-Nbat-JO","und-NC":"fr-Latn-NC","und-NE":"ha-Latn-NE","und-Newa":"new-Newa-NP","und-NI":"es-Latn-NI","und-Nkoo":"man-Nkoo-GN","und-NL":"nl-Latn-NL","und-NO":"nb-Latn-NO","und-NP":"ne-Deva-NP","und-Nshu":"zhx-Nshu-CN","und-Ogam":"sga-Ogam-IE","und-Olck":"sat-Olck-IN","und-OM":"ar-Arab-OM","und-Orkh":"otk-Orkh-MN","und-Orya":"or-Orya-IN","und-Osge":"osa-Osge-US","und-Osma":"so-Osma-SO","und-Ougr":"oui-Ougr-143","und-PA":"es-Latn-PA","und-Palm":"arc-Palm-SY","und-Pauc":"ctd-Pauc-MM","und-PE":"es-Latn-PE","und-Perm":"kv-Perm-RU","und-PF":"fr-Latn-PF","und-PG":"tpi-Latn-PG","und-PH":"fil-Latn-PH","und-Phag":"lzh-Phag-CN","und-Phli":"pal-Phli-IR","und-Phlp":"pal-Phlp-CN","und-Phnx":"phn-Phnx-LB","und-PK":"ur-Arab-PK","und-PL":"pl-Latn-PL","und-Plrd":"hmd-Plrd-CN","und-PM":"fr-Latn-PM","und-PR":"es-Latn-PR","und-Prti":"xpr-Prti-IR","und-PS":"ar-Arab-PS","und-PT":"pt-Latn-PT","und-PW":"pau-Latn-PW","und-PY":"gn-Latn-PY","und-QA":"ar-Arab-QA","und-QO":"en-Latn-DG","und-RE":"fr-Latn-RE","und-Rjng":"rej-Rjng-ID","und-RO":"ro-Latn-RO","und-Rohg":"rhg-Rohg-MM","und-RS":"sr-Cyrl-RS","und-RU":"ru-Cyrl-RU","und-Runr":"non-Runr-SE","und-RW":"rw-Latn-RW","und-SA":"ar-Arab-SA","und-Samr":"smp-Samr-IL","und-Sarb":"xsa-Sarb-YE","und-Saur":"saz-Saur-IN","und-SC":"fr-Latn-SC","und-SD":"ar-Arab-SD","und-SE":"sv-Latn-SE","und-Sgnw":"ase-Sgnw-US","und-Shaw":"en-Shaw-GB","und-Shrd":"sa-Shrd-IN","und-SI":"sl-Latn-SI","und-Sidd":"sa-Sidd-IN","und-Sind":"sd-Sind-IN","und-Sinh":"si-Sinh-LK","und-SJ":"nb-Latn-SJ","und-SK":"sk-Latn-SK","und-SM":"it-Latn-SM","und-SN":"fr-Latn-SN","und-SO":"so-Latn-SO","und-Sogd":"sog-Sogd-UZ","und-Sogo":"sog-Sogo-UZ","und-Sora":"srb-Sora-IN","und-Soyo":"cmg-Soyo-MN","und-SR":"nl-Latn-SR","und-ST":"pt-Latn-ST","und-Sund":"su-Sund-ID","und-SV":"es-Latn-SV","und-SY":"ar-Arab-SY","und-Sylo":"syl-Sylo-BD","und-Syrc":"syr-Syrc-IQ","und-Tagb":"tbw-Tagb-PH","und-Takr":"doi-Takr-IN","und-Tale":"tdd-Tale-CN","und-Talu":"khb-Talu-CN","und-Taml":"ta-Taml-IN","und-Tang":"txg-Tang-CN","und-Tavt":"blt-Tavt-VN","und-TD":"fr-Latn-TD","und-Telu":"te-Telu-IN","und-TF":"fr-Latn-TF","und-Tfng":"zgh-Tfng-MA","und-TG":"fr-Latn-TG","und-Tglg":"fil-Tglg-PH","und-TH":"th-Thai-TH","und-Thaa":"dv-Thaa-MV","und-Thai":"th-Thai-TH","und-Thai-CN":"lcp-Thai-CN","und-Thai-KH":"kdt-Thai-KH","und-Thai-LA":"kdt-Thai-LA","und-Tibt":"bo-Tibt-CN","und-Tirh":"mai-Tirh-IN","und-TJ":"tg-Cyrl-TJ","und-TK":"tkl-Latn-TK","und-TL":"pt-Latn-TL","und-TM":"tk-Latn-TM","und-TN":"ar-Arab-TN","und-Tnsa":"nst-Tnsa-IN","und-TO":"to-Latn-TO","und-Toto":"txo-Toto-IN","und-TR":"tr-Latn-TR","und-TV":"tvl-Latn-TV","und-TW":"zh-Hant-TW","und-TZ":"sw-Latn-TZ","und-UA":"uk-Cyrl-UA","und-UG":"sw-Latn-UG","und-Ugar":"uga-Ugar-SY","und-UY":"es-Latn-UY","und-UZ":"uz-Latn-UZ","und-VA":"it-Latn-VA","und-Vaii":"vai-Vaii-LR","und-VE":"es-Latn-VE","und-Vith":"sq-Vith-AL","und-VN":"vi-Latn-VN","und-VU":"bi-Latn-VU","und-Wara":"hoc-Wara-IN","und-Wcho":"nnp-Wcho-IN","und-WF":"fr-Latn-WF","und-WS":"sm-Latn-WS","und-XK":"sq-Latn-XK","und-Xpeo":"peo-Xpeo-IR","und-Xsux":"akk-Xsux-IQ","und-YE":"ar-Arab-YE","und-Yezi":"ku-Yezi-GE","und-Yiii":"ii-Yiii-CN","und-YT":"fr-Latn-YT","und-Zanb":"cmg-Zanb-MN","und-ZW":"sn-Latn-ZW",unr:"unr-Beng-IN","unr-Deva":"unr-Deva-NP","unr-NP":"unr-Deva-NP",unx:"unx-Beng-IN",uok:"uok-Latn-ZZ",ur:"ur-Arab-PK",uri:"uri-Latn-ZZ",urt:"urt-Latn-ZZ",urw:"urw-Latn-ZZ",usa:"usa-Latn-ZZ",uth:"uth-Latn-ZZ",utr:"utr-Latn-ZZ",uvh:"uvh-Latn-ZZ",uvl:"uvl-Latn-ZZ",uz:"uz-Latn-UZ","uz-AF":"uz-Arab-AF","uz-Arab":"uz-Arab-AF","uz-CN":"uz-Cyrl-CN",vag:"vag-Latn-ZZ",vai:"vai-Vaii-LR",van:"van-Latn-ZZ",ve:"ve-Latn-ZA",vec:"vec-Latn-IT",vep:"vep-Latn-RU",vi:"vi-Latn-VN",vic:"vic-Latn-SX",viv:"viv-Latn-ZZ",vls:"vls-Latn-BE",vmf:"vmf-Latn-DE",vmw:"vmw-Latn-MZ",vo:"vo-Latn-001",vot:"vot-Latn-RU",vro:"vro-Latn-EE",vun:"vun-Latn-TZ",vut:"vut-Latn-ZZ",wa:"wa-Latn-BE",wae:"wae-Latn-CH",waj:"waj-Latn-ZZ",wal:"wal-Ethi-ET",wan:"wan-Latn-ZZ",war:"war-Latn-PH",wbp:"wbp-Latn-AU",wbq:"wbq-Telu-IN",wbr:"wbr-Deva-IN",wci:"wci-Latn-ZZ",wer:"wer-Latn-ZZ",wgi:"wgi-Latn-ZZ",whg:"whg-Latn-ZZ",wib:"wib-Latn-ZZ",wiu:"wiu-Latn-ZZ",wiv:"wiv-Latn-ZZ",wja:"wja-Latn-ZZ",wji:"wji-Latn-ZZ",wls:"wls-Latn-WF",wmo:"wmo-Latn-ZZ",wnc:"wnc-Latn-ZZ",wni:"wni-Arab-KM",wnu:"wnu-Latn-ZZ",wo:"wo-Latn-SN",wob:"wob-Latn-ZZ",wos:"wos-Latn-ZZ",wrs:"wrs-Latn-ZZ",wsg:"wsg-Gong-IN",wsk:"wsk-Latn-ZZ",wtm:"wtm-Deva-IN",wuu:"wuu-Hans-CN",wuv:"wuv-Latn-ZZ",wwa:"wwa-Latn-ZZ",xav:"xav-Latn-BR",xbi:"xbi-Latn-ZZ",xco:"xco-Chrs-UZ",xcr:"xcr-Cari-TR",xes:"xes-Latn-ZZ",xh:"xh-Latn-ZA",xla:"xla-Latn-ZZ",xlc:"xlc-Lyci-TR",xld:"xld-Lydi-TR",xmf:"xmf-Geor-GE",xmn:"xmn-Mani-CN",xmr:"xmr-Merc-SD",xna:"xna-Narb-SA",xnr:"xnr-Deva-IN",xog:"xog-Latn-UG",xon:"xon-Latn-ZZ",xpr:"xpr-Prti-IR",xrb:"xrb-Latn-ZZ",xsa:"xsa-Sarb-YE",xsi:"xsi-Latn-ZZ",xsm:"xsm-Latn-ZZ",xsr:"xsr-Deva-NP",xwe:"xwe-Latn-ZZ",yam:"yam-Latn-ZZ",yao:"yao-Latn-MZ",yap:"yap-Latn-FM",yas:"yas-Latn-ZZ",yat:"yat-Latn-ZZ",yav:"yav-Latn-CM",yay:"yay-Latn-ZZ",yaz:"yaz-Latn-ZZ",yba:"yba-Latn-ZZ",ybb:"ybb-Latn-CM",yby:"yby-Latn-ZZ",yer:"yer-Latn-ZZ",ygr:"ygr-Latn-ZZ",ygw:"ygw-Latn-ZZ",yi:"yi-Hebr-001",yko:"yko-Latn-ZZ",yle:"yle-Latn-ZZ",ylg:"ylg-Latn-ZZ",yll:"yll-Latn-ZZ",yml:"yml-Latn-ZZ",yo:"yo-Latn-NG",yon:"yon-Latn-ZZ",yrb:"yrb-Latn-ZZ",yre:"yre-Latn-ZZ",yrl:"yrl-Latn-BR",yss:"yss-Latn-ZZ",yua:"yua-Latn-MX",yue:"yue-Hant-HK","yue-CN":"yue-Hans-CN","yue-Hans":"yue-Hans-CN",yuj:"yuj-Latn-ZZ",yut:"yut-Latn-ZZ",yuw:"yuw-Latn-ZZ",za:"za-Latn-CN",zag:"zag-Latn-SD",zdj:"zdj-Arab-KM",zea:"zea-Latn-NL",zgh:"zgh-Tfng-MA",zh:"zh-Hans-CN","zh-AU":"zh-Hant-AU","zh-BN":"zh-Hant-BN","zh-Bopo":"zh-Bopo-TW","zh-GB":"zh-Hant-GB","zh-GF":"zh-Hant-GF","zh-Hanb":"zh-Hanb-TW","zh-Hant":"zh-Hant-TW","zh-HK":"zh-Hant-HK","zh-ID":"zh-Hant-ID","zh-MO":"zh-Hant-MO","zh-PA":"zh-Hant-PA","zh-PF":"zh-Hant-PF","zh-PH":"zh-Hant-PH","zh-SR":"zh-Hant-SR","zh-TH":"zh-Hant-TH","zh-TW":"zh-Hant-TW","zh-US":"zh-Hant-US","zh-VN":"zh-Hant-VN",zhx:"zhx-Nshu-CN",zia:"zia-Latn-ZZ",zkt:"zkt-Kits-CN",zlm:"zlm-Latn-TG",zmi:"zmi-Latn-MY",zne:"zne-Latn-ZZ",zu:"zu-Latn-ZA",zza:"zza-Latn-TR"}},8371:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseUnicodeLocaleId=t.parseUnicodeLanguageId=t.isUnicodeVariantSubtag=t.isUnicodeScriptSubtag=t.isUnicodeRegionSubtag=t.isStructurallyValidLanguageTag=t.isUnicodeLanguageSubtag=t.SEPARATOR=void 0;var r=n(655),a=/^[a-z0-9]{1,8}$/i,o=/^[a-z0-9]{2,8}$/i,i=/^[a-z0-9]{3,8}$/i,l=/^[a-z0-9][a-z]$/i,u=/^[a-z0-9]{3,8}$/i,s=/^[a-z]{4}$/i,c=/^[0-9a-svwyz]$/i,f=/^([a-z]{2}|[0-9]{3})$/i,d=/^([a-z0-9]{5,8}|[0-9][a-z0-9]{3})$/i,p=/^([a-z]{2,3}|[a-z]{5,8})$/i,h=/^[a-z][0-9]$/i;function g(e){return p.test(e)}function y(e){return f.test(e)}function m(e){return s.test(e)}function b(e){return d.test(e)}function v(e){"string"==typeof e&&(e=e.split(t.SEPARATOR));var n,r,a=e.shift();if(!a)throw new RangeError("Missing unicode_language_subtag");if("root"===a)return{lang:"root",variants:[]};if(!g(a))throw new RangeError("Malformed unicode_language_subtag");e.length&&m(e[0])&&(n=e.shift()),e.length&&y(e[0])&&(r=e.shift());for(var o={};e.length&&b(e[0]);){var i=e.shift();if(i in o)throw new RangeError('Duplicate variant "'.concat(i,'"'));o[i]=1}return{lang:a,script:n,region:r,variants:Object.keys(o)}}function w(e){for(var t,n=[];e.length&&(t=S(e));)n.push(t);if(n.length)return{type:"u",keywords:n,attributes:[]};for(var r=[];e.length&&i.test(e[0]);)r.push(e.shift());for(;e.length&&(t=S(e));)n.push(t);if(n.length||r.length)return{type:"u",attributes:r,keywords:n};throw new RangeError("Malformed unicode_extension")}function S(e){var n;if(l.test(e[0])){n=e.shift();for(var r=[];e.length&&u.test(e[0]);)r.push(e.shift());var a="";return r.length&&(a=r.join(t.SEPARATOR)),[n,a]}}function k(e){var n;try{n=v(e)}catch(e){}for(var r=[];e.length&&h.test(e[0]);){for(var a=e.shift(),o=[];e.length&&i.test(e[0]);)o.push(e.shift());if(!o.length)throw new RangeError('Missing tvalue for tkey "'.concat(a,'"'));r.push([a,o.join(t.SEPARATOR)])}if(r.length)return{type:"t",fields:r,lang:n};throw new RangeError("Malformed transformed_extension")}function L(e){for(var n=[];e.length&&a.test(e[0]);)n.push(e.shift());if(n.length)return{type:"x",value:n.join(t.SEPARATOR)};throw new RangeError("Malformed private_use_extension")}function E(e){for(var n=[];e.length&&o.test(e[0]);)n.push(e.shift());return n.length?n.join(t.SEPARATOR):""}t.SEPARATOR="-",t.isUnicodeLanguageSubtag=g,t.isStructurallyValidLanguageTag=function(e){try{v(e.split(t.SEPARATOR))}catch(e){return!1}return!0},t.isUnicodeRegionSubtag=y,t.isUnicodeScriptSubtag=m,t.isUnicodeVariantSubtag=b,t.parseUnicodeLanguageId=v,t.parseUnicodeLocaleId=function(e){var n=e.split(t.SEPARATOR),a=v(n);return r.__assign({lang:a},function(e){if(!e.length)return{extensions:[]};var t,n,r,a=[],o={};do{var i=e.shift();switch(i){case"u":case"U":if(t)throw new RangeError("There can only be 1 -u- extension");t=w(e),a.push(t);break;case"t":case"T":if(n)throw new RangeError("There can only be 1 -t- extension");n=k(e),a.push(n);break;case"x":case"X":if(r)throw new RangeError("There can only be 1 -x- extension");r=L(e),a.push(r);break;default:if(!c.test(i))throw new RangeError("Malformed extension type");if(i in o)throw new RangeError("There can only be 1 -".concat(i,"- extension"));var l={type:i,value:E(e)};o[l.type]=l,a.push(l)}}while(e.length);return{extensions:a}}(n))}},539:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1069:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new WeakMap;t.default=function(e){var t=n.get(e);return t||(t=Object.create(null),n.set(e,t)),t}},9679:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Locale=void 0;var r=n(655),a=n(8954),o=n(9097),i=r.__importDefault(n(1069)),l=["ca","co","hc","kf","kn","nu"],u=/^[a-z0-9]{3,8}(-[a-z0-9]{3,8})*$/i;function s(e,t,n,a,o){return void 0===a&&(a=[]),o?{lang:e&&"und"!==e?e:o.lang,script:t||o.script,region:n||o.region,variants:r.__spreadArray(r.__spreadArray([],a,!0),o.variants,!0)}:{lang:e||"und",script:t,region:n,variants:a}}function c(e){var t=(0,o.parseUnicodeLocaleId)(e),n=t.lang,r=n.lang,a=n.script,i=n.region,l=n.variants;if(a&&i){var u=o.likelySubtags[(0,o.emitUnicodeLanguageId)({lang:r,script:a,region:i,variants:[]})];if(u){var c=(0,o.parseUnicodeLanguageId)(u);return t.lang=s(void 0,void 0,void 0,l,c),(0,o.emitUnicodeLocaleId)(t)}}if(a){var f=o.likelySubtags[(0,o.emitUnicodeLanguageId)({lang:r,script:a,variants:[]})];if(f){var d=(0,o.parseUnicodeLanguageId)(f);return t.lang=s(void 0,void 0,i,l,d),(0,o.emitUnicodeLocaleId)(t)}}if(i){var p=o.likelySubtags[(0,o.emitUnicodeLanguageId)({lang:r,region:i,variants:[]})];if(p){var h=(0,o.parseUnicodeLanguageId)(p);return t.lang=s(void 0,a,void 0,l,h),(0,o.emitUnicodeLocaleId)(t)}}var g=o.likelySubtags[r]||o.likelySubtags[(0,o.emitUnicodeLanguageId)({lang:"und",script:a,variants:[]})];if(!g)throw new Error("No match for addLikelySubtags");var y=(0,o.parseUnicodeLanguageId)(g);return t.lang=s(void 0,a,i,l,y),(0,o.emitUnicodeLocaleId)(t)}var f=function(){function e(t,n){if(!(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Intl.Locale must be called with 'new'");var l,s=e.relevantExtensionKeys,c=["initializedLocale","locale","calendar","collation","hourCycle","numberingSystem"];if(s.indexOf("kf")>-1&&c.push("caseFirst"),s.indexOf("kn")>-1&&c.push("numeric"),void 0===t)throw new TypeError("First argument to Intl.Locale constructor can't be empty or missing");if("string"!=typeof t&&"object"!=typeof t)throw new TypeError("tag must be a string or object");t="object"==typeof t&&(l=(0,i.default)(t))&&l.initializedLocale?l.locale:t.toString(),l=(0,i.default)(this);var f=(0,a.CoerceOptionsToObject)(n);t=function(e,t){(0,a.invariant)("string"==typeof e,"language tag must be a string"),(0,a.invariant)((0,o.isStructurallyValidLanguageTag)(e),"malformed language tag",RangeError);var n=(0,a.GetOption)(t,"language","string",void 0,void 0);void 0!==n&&(0,a.invariant)((0,o.isUnicodeLanguageSubtag)(n),"Malformed unicode_language_subtag",RangeError);var i=(0,a.GetOption)(t,"script","string",void 0,void 0);void 0!==i&&(0,a.invariant)((0,o.isUnicodeScriptSubtag)(i),"Malformed unicode_script_subtag",RangeError);var l=(0,a.GetOption)(t,"region","string",void 0,void 0);void 0!==l&&(0,a.invariant)((0,o.isUnicodeRegionSubtag)(l),"Malformed unicode_region_subtag",RangeError);var u=(0,o.parseUnicodeLanguageId)(e);return void 0!==n&&(u.lang=n),void 0!==i&&(u.script=i),void 0!==l&&(u.region=l),Intl.getCanonicalLocales((0,o.emitUnicodeLocaleId)(r.__assign(r.__assign({},(0,o.parseUnicodeLocaleId)(e)),{lang:u})))[0]}(t,f);var d=Object.create(null),p=(0,a.GetOption)(f,"calendar","string",void 0,void 0);if(void 0!==p&&!u.test(p))throw new RangeError("invalid calendar");d.ca=p;var h=(0,a.GetOption)(f,"collation","string",void 0,void 0);if(void 0!==h&&!u.test(h))throw new RangeError("invalid collation");d.co=h;var g=(0,a.GetOption)(f,"hourCycle","string",["h11","h12","h23","h24"],void 0);d.hc=g;var y=(0,a.GetOption)(f,"caseFirst","string",["upper","lower","false"],void 0);d.kf=y;var m,b=(0,a.GetOption)(f,"numeric","boolean",void 0,void 0);void 0!==b&&(m=String(b)),d.kn=m;var v=(0,a.GetOption)(f,"numberingSystem","string",void 0,void 0);if(void 0!==v&&!u.test(v))throw new RangeError("Invalid numberingSystem");d.nu=v;var w=function(e,t,n){for(var r,i=[],l=(0,o.parseUnicodeLocaleId)(e),u=0,s=l.extensions;u-1&&(l.caseFirst=w.kf),s.indexOf("kn")>-1&&(l.numeric=(0,a.SameValue)(w.kn,"true")),l.numberingSystem=w.nu}return e.prototype.maximize=function(){var t=(0,i.default)(this).locale;try{return new e(c(t))}catch(n){return new e(t)}},e.prototype.minimize=function(){var t=(0,i.default)(this).locale;try{return new e(function(e){var t=c(e);if(!t)return e;t=(0,o.emitUnicodeLanguageId)(r.__assign(r.__assign({},(0,o.parseUnicodeLanguageId)(t)),{variants:[]}));var n=(0,o.parseUnicodeLocaleId)(e),a=n.lang,i=a.lang,l=a.script,u=a.region,f=a.variants;return c((0,o.emitUnicodeLanguageId)({lang:i,variants:[]}))===t?(0,o.emitUnicodeLocaleId)(r.__assign(r.__assign({},n),{lang:s(i,void 0,void 0,f)})):u&&c((0,o.emitUnicodeLanguageId)({lang:i,region:u,variants:[]}))===t?(0,o.emitUnicodeLocaleId)(r.__assign(r.__assign({},n),{lang:s(i,void 0,u,f)})):l&&c((0,o.emitUnicodeLanguageId)({lang:i,script:l,variants:[]}))===t?(0,o.emitUnicodeLocaleId)(r.__assign(r.__assign({},n),{lang:s(i,l,void 0,f)})):e}(t))}catch(n){return new e(t)}},e.prototype.toString=function(){return(0,i.default)(this).locale},Object.defineProperty(e.prototype,"baseName",{get:function(){var e=(0,i.default)(this).locale;return(0,o.emitUnicodeLanguageId)((0,o.parseUnicodeLanguageId)(e))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"calendar",{get:function(){return(0,i.default)(this).calendar},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"collation",{get:function(){return(0,i.default)(this).collation},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hourCycle",{get:function(){return(0,i.default)(this).hourCycle},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"caseFirst",{get:function(){return(0,i.default)(this).caseFirst},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numeric",{get:function(){return(0,i.default)(this).numeric},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"numberingSystem",{get:function(){return(0,i.default)(this).numberingSystem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"language",{get:function(){var e=(0,i.default)(this).locale;return(0,o.parseUnicodeLanguageId)(e).lang},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"script",{get:function(){var e=(0,i.default)(this).locale;return(0,o.parseUnicodeLanguageId)(e).script},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"region",{get:function(){var e=(0,i.default)(this).locale;return(0,o.parseUnicodeLanguageId)(e).region},enumerable:!1,configurable:!0}),e.relevantExtensionKeys=l,e}();t.Locale=f;try{"undefined"!=typeof Symbol&&Object.defineProperty(f.prototype,Symbol.toStringTag,{value:"Intl.Locale",writable:!1,enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype.constructor,"length",{value:1,writable:!1,enumerable:!1,configurable:!0})}catch(e){}t.default=f},1942:(e,t,n)=>{"use strict";var r=n(9679);(0,n(5916).shouldPolyfill)()&&Object.defineProperty(Intl,"Locale",{value:r.Locale,writable:!0,enumerable:!1,configurable:!0})},5916:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldPolyfill=void 0,t.shouldPolyfill=function(){return!("Locale"in Intl)||function(){try{return"x-private"===new Intl.Locale("und-x-private").toString()}catch(e){return!0}}()}},8030:(e,t,n)=>{"use strict";function r(e,t){for(var n=t;;){if(e.has(n))return n;var r=n.lastIndexOf("-");if(!~r)return;r>=2&&"-"===n[r-2]&&(r-=2),n=n.slice(0,r)}}n.d(t,{t:()=>r})},7275:(e,t,n)=>{"use strict";n.d(t,{T:()=>o});var r=n(610),a=n(8030);function o(e,t){for(var n=[],o=0,i=t;o{"use strict";n.d(t,{f:()=>i});var r=n(610),a=n(8030);function o(e,t){(0,r.k)(2===t.length,"key must have 2 elements");var n=e.length,a="-".concat(t,"-"),o=e.indexOf(a);if(-1!==o){for(var i=o+4,l=i,u=i,s=!1;!s;){var c=e.indexOf("-",u);2==(-1===c?n-u:c-u)?s=!0:-1===c?(l=n,s=!0):(l=c,u=c+1)}return e.slice(i,l)}if(a="-".concat(t),-1!==(o=e.indexOf(a))&&o+3===n)return""}function i(e,t,n,i,l,u){var s;s="lookup"===n.localeMatcher?function(e,t,n){for(var o={locale:""},i=0,l=t;i2){var k=c.indexOf("-x-");if(-1===k)c+=d;else{var L=c.slice(0,k),E=c.slice(k,c.length);c=L+d+E}c=Intl.getCanonicalLocales(c)[0]}return f.locale=c,f}},610:(e,t,n)=>{"use strict";n.d(t,{k:()=>a,p:()=>r});var r=/-u(?:-[0-9a-z]{2,8})+/gi;function a(e,t,n){if(void 0===n&&(n=Error),!e)throw new n(t)}},983:(e,t,n)=>{"use strict";n.r(t),n.d(t,{LookupSupportedLocales:()=>a.T,ResolveLocale:()=>r.f,match:()=>o});var r=n(3362),a=n(7275);function o(e,t,n,a){var o=t.reduce((function(e,t){return e.add(t),e}),new Set);return(0,r.f)(o,function(e){return Intl.getCanonicalLocales(e)}(e),{localeMatcher:(null==a?void 0:a.algorithm)||"best fit"},[],{},(function(){return n})).locale}},1329:()=>{Intl.NumberFormat&&"function"==typeof Intl.NumberFormat.__addLocaleData&&Intl.NumberFormat.__addLocaleData({data:{units:{simple:{degree:{long:{other:"{0} degrees",one:"{0} degree"},short:{other:"{0} deg"},narrow:{other:"{0}°"},perUnit:{}},hectare:{long:{other:"{0} hectares",one:"{0} hectare"},short:{other:"{0} ha"},narrow:{other:"{0}ha"},perUnit:{}},acre:{long:{other:"{0} acres",one:"{0} acre"},short:{other:"{0} ac"},narrow:{other:"{0}ac"},perUnit:{}},percent:{long:{other:"{0} percent"},short:{other:"{0}%"},narrow:{other:"{0}%"},perUnit:{}},"liter-per-kilometer":{long:{other:"{0} liters per kilometer",one:"{0} liter per kilometer"},short:{other:"{0} L/km"},narrow:{other:"{0}L/km"},perUnit:{}},"mile-per-gallon":{long:{other:"{0} miles per gallon",one:"{0} mile per gallon"},short:{other:"{0} mpg"},narrow:{other:"{0}mpg"},perUnit:{}},petabyte:{long:{other:"{0} petabytes",one:"{0} petabyte"},short:{other:"{0} PB"},narrow:{other:"{0}PB"},perUnit:{}},terabyte:{long:{other:"{0} terabytes",one:"{0} terabyte"},short:{other:"{0} TB"},narrow:{other:"{0}TB"},perUnit:{}},terabit:{long:{other:"{0} terabits",one:"{0} terabit"},short:{other:"{0} Tb"},narrow:{other:"{0}Tb"},perUnit:{}},gigabyte:{long:{other:"{0} gigabytes",one:"{0} gigabyte"},short:{other:"{0} GB"},narrow:{other:"{0}GB"},perUnit:{}},gigabit:{long:{other:"{0} gigabits",one:"{0} gigabit"},short:{other:"{0} Gb"},narrow:{other:"{0}Gb"},perUnit:{}},megabyte:{long:{other:"{0} megabytes",one:"{0} megabyte"},short:{other:"{0} MB"},narrow:{other:"{0}MB"},perUnit:{}},megabit:{long:{other:"{0} megabits",one:"{0} megabit"},short:{other:"{0} Mb"},narrow:{other:"{0}Mb"},perUnit:{}},kilobyte:{long:{other:"{0} kilobytes",one:"{0} kilobyte"},short:{other:"{0} kB"},narrow:{other:"{0}kB"},perUnit:{}},kilobit:{long:{other:"{0} kilobits",one:"{0} kilobit"},short:{other:"{0} kb"},narrow:{other:"{0}kb"},perUnit:{}},byte:{long:{other:"{0} bytes",one:"{0} byte"},short:{other:"{0} byte"},narrow:{other:"{0}B"},perUnit:{}},bit:{long:{other:"{0} bits",one:"{0} bit"},short:{other:"{0} bit"},narrow:{other:"{0}bit"},perUnit:{}},year:{long:{other:"{0} years",one:"{0} year"},short:{other:"{0} yrs",one:"{0} yr"},narrow:{other:"{0}y"},perUnit:{long:"{0} per year",short:"{0}/y",narrow:"{0}/y"}},month:{long:{other:"{0} months",one:"{0} month"},short:{other:"{0} mths",one:"{0} mth"},narrow:{other:"{0}m"},perUnit:{long:"{0} per month",short:"{0}/m",narrow:"{0}/m"}},week:{long:{other:"{0} weeks",one:"{0} week"},short:{other:"{0} wks",one:"{0} wk"},narrow:{other:"{0}w"},perUnit:{long:"{0} per week",short:"{0}/w",narrow:"{0}/w"}},day:{long:{other:"{0} days",one:"{0} day"},short:{other:"{0} days",one:"{0} day"},narrow:{other:"{0}d"},perUnit:{long:"{0} per day",short:"{0}/d",narrow:"{0}/d"}},hour:{long:{other:"{0} hours",one:"{0} hour"},short:{other:"{0} hr"},narrow:{other:"{0}h"},perUnit:{long:"{0} per hour",short:"{0}/h",narrow:"{0}/h"}},minute:{long:{other:"{0} minutes",one:"{0} minute"},short:{other:"{0} min"},narrow:{other:"{0}m"},perUnit:{long:"{0} per minute",short:"{0}/min",narrow:"{0}/min"}},second:{long:{other:"{0} seconds",one:"{0} second"},short:{other:"{0} sec"},narrow:{other:"{0}s"},perUnit:{long:"{0} per second",short:"{0}/s",narrow:"{0}/s"}},millisecond:{long:{other:"{0} milliseconds",one:"{0} millisecond"},short:{other:"{0} ms"},narrow:{other:"{0}ms"},perUnit:{}},kilometer:{long:{other:"{0} kilometers",one:"{0} kilometer"},short:{other:"{0} km"},narrow:{other:"{0}km"},perUnit:{long:"{0} per kilometer",short:"{0}/km",narrow:"{0}/km"}},meter:{long:{other:"{0} meters",one:"{0} meter"},short:{other:"{0} m"},narrow:{other:"{0}m"},perUnit:{long:"{0} per meter",short:"{0}/m",narrow:"{0}/m"}},centimeter:{long:{other:"{0} centimeters",one:"{0} centimeter"},short:{other:"{0} cm"},narrow:{other:"{0}cm"},perUnit:{long:"{0} per centimeter",short:"{0}/cm",narrow:"{0}/cm"}},millimeter:{long:{other:"{0} millimeters",one:"{0} millimeter"},short:{other:"{0} mm"},narrow:{other:"{0}mm"},perUnit:{}},mile:{long:{other:"{0} miles",one:"{0} mile"},short:{other:"{0} mi"},narrow:{other:"{0}mi"},perUnit:{}},yard:{long:{other:"{0} yards",one:"{0} yard"},short:{other:"{0} yd"},narrow:{other:"{0}yd"},perUnit:{}},foot:{long:{other:"{0} feet",one:"{0} foot"},short:{other:"{0} ft"},narrow:{other:"{0}′"},perUnit:{long:"{0} per foot",short:"{0}/ft",narrow:"{0}/ft"}},inch:{long:{other:"{0} inches",one:"{0} inch"},short:{other:"{0} in"},narrow:{other:"{0}″"},perUnit:{long:"{0} per inch",short:"{0}/in",narrow:"{0}/in"}},"mile-scandinavian":{long:{other:"{0} miles-scandinavian",one:"{0} mile-scandinavian"},short:{other:"{0} smi"},narrow:{other:"{0}smi"},perUnit:{}},kilogram:{long:{other:"{0} kilograms",one:"{0} kilogram"},short:{other:"{0} kg"},narrow:{other:"{0}kg"},perUnit:{long:"{0} per kilogram",short:"{0}/kg",narrow:"{0}/kg"}},gram:{long:{other:"{0} grams",one:"{0} gram"},short:{other:"{0} g"},narrow:{other:"{0}g"},perUnit:{long:"{0} per gram",short:"{0}/g",narrow:"{0}/g"}},stone:{long:{other:"{0} stones",one:"{0} stone"},short:{other:"{0} st"},narrow:{other:"{0}st"},perUnit:{}},pound:{long:{other:"{0} pounds",one:"{0} pound"},short:{other:"{0} lb"},narrow:{other:"{0}#"},perUnit:{long:"{0} per pound",short:"{0}/lb",narrow:"{0}/lb"}},ounce:{long:{other:"{0} ounces",one:"{0} ounce"},short:{other:"{0} oz"},narrow:{other:"{0}oz"},perUnit:{long:"{0} per ounce",short:"{0}/oz",narrow:"{0}/oz"}},"kilometer-per-hour":{long:{other:"{0} kilometers per hour",one:"{0} kilometer per hour"},short:{other:"{0} km/h"},narrow:{other:"{0}km/h"},perUnit:{}},"meter-per-second":{long:{other:"{0} meters per second",one:"{0} meter per second"},short:{other:"{0} m/s"},narrow:{other:"{0}m/s"},perUnit:{}},"mile-per-hour":{long:{other:"{0} miles per hour",one:"{0} mile per hour"},short:{other:"{0} mph"},narrow:{other:"{0}mph"},perUnit:{}},celsius:{long:{other:"{0} degrees Celsius",one:"{0} degree Celsius"},short:{other:"{0}°C"},narrow:{other:"{0}°C"},perUnit:{}},fahrenheit:{long:{other:"{0} degrees Fahrenheit",one:"{0} degree Fahrenheit"},short:{other:"{0}°F"},narrow:{other:"{0}°"},perUnit:{}},liter:{long:{other:"{0} liters",one:"{0} liter"},short:{other:"{0} L"},narrow:{other:"{0}L"},perUnit:{long:"{0} per liter",short:"{0}/L",narrow:"{0}/L"}},milliliter:{long:{other:"{0} milliliters",one:"{0} milliliter"},short:{other:"{0} mL"},narrow:{other:"{0}mL"},perUnit:{}},gallon:{long:{other:"{0} gallons",one:"{0} gallon"},short:{other:"{0} gal"},narrow:{other:"{0}gal"},perUnit:{long:"{0} per gallon",short:"{0}/gal US",narrow:"{0}/gal"}},"fluid-ounce":{long:{other:"{0} fluid ounces",one:"{0} fluid ounce"},short:{other:"{0} fl oz"},narrow:{other:"{0}fl oz"},perUnit:{}}},compound:{per:{long:"{0} per {1}",short:"{0}/{1}",narrow:"{0}/{1}"}}},currencies:{ADP:{displayName:{other:"Andorran pesetas",one:"Andorran peseta"},symbol:"ADP",narrow:"ADP"},AED:{displayName:{other:"UAE dirhams",one:"UAE dirham"},symbol:"AED",narrow:"AED"},AFA:{displayName:{other:"Afghan afghanis (1927–2002)",one:"Afghan afghani (1927–2002)"},symbol:"AFA",narrow:"AFA"},AFN:{displayName:{other:"Afghan Afghanis",one:"Afghan Afghani"},symbol:"AFN",narrow:"؋"},ALK:{displayName:{other:"Albanian lekë (1946–1965)",one:"Albanian lek (1946–1965)"},symbol:"ALK",narrow:"ALK"},ALL:{displayName:{other:"Albanian lekë",one:"Albanian lek"},symbol:"ALL",narrow:"ALL"},AMD:{displayName:{other:"Armenian drams",one:"Armenian dram"},symbol:"AMD",narrow:"֏"},ANG:{displayName:{other:"Netherlands Antillean guilders",one:"Netherlands Antillean guilder"},symbol:"ANG",narrow:"ANG"},AOA:{displayName:{other:"Angolan kwanzas",one:"Angolan kwanza"},symbol:"AOA",narrow:"Kz"},AOK:{displayName:{other:"Angolan kwanzas (1977–1991)",one:"Angolan kwanza (1977–1991)"},symbol:"AOK",narrow:"AOK"},AON:{displayName:{other:"Angolan new kwanzas (1990–2000)",one:"Angolan new kwanza (1990–2000)"},symbol:"AON",narrow:"AON"},AOR:{displayName:{other:"Angolan readjusted kwanzas (1995–1999)",one:"Angolan readjusted kwanza (1995–1999)"},symbol:"AOR",narrow:"AOR"},ARA:{displayName:{other:"Argentine australs",one:"Argentine austral"},symbol:"ARA",narrow:"ARA"},ARL:{displayName:{other:"Argentine pesos ley (1970–1983)",one:"Argentine peso ley (1970–1983)"},symbol:"ARL",narrow:"ARL"},ARM:{displayName:{other:"Argentine pesos (1881–1970)",one:"Argentine peso (1881–1970)"},symbol:"ARM",narrow:"ARM"},ARP:{displayName:{other:"Argentine pesos (1983–1985)",one:"Argentine peso (1983–1985)"},symbol:"ARP",narrow:"ARP"},ARS:{displayName:{other:"Argentine pesos",one:"Argentine peso"},symbol:"ARS",narrow:"$"},ATS:{displayName:{other:"Austrian schillings",one:"Austrian schilling"},symbol:"ATS",narrow:"ATS"},AUD:{displayName:{other:"Australian dollars",one:"Australian dollar"},symbol:"A$",narrow:"$"},AWG:{displayName:{other:"Aruban florin"},symbol:"AWG",narrow:"AWG"},AZM:{displayName:{other:"Azerbaijani manats (1993–2006)",one:"Azerbaijani manat (1993–2006)"},symbol:"AZM",narrow:"AZM"},AZN:{displayName:{other:"Azerbaijani manats",one:"Azerbaijani manat"},symbol:"AZN",narrow:"₼"},BAD:{displayName:{other:"Bosnia-Herzegovina dinars (1992–1994)",one:"Bosnia-Herzegovina dinar (1992–1994)"},symbol:"BAD",narrow:"BAD"},BAM:{displayName:{other:"Bosnia-Herzegovina convertible marks",one:"Bosnia-Herzegovina convertible mark"},symbol:"BAM",narrow:"KM"},BAN:{displayName:{other:"Bosnia-Herzegovina new dinars (1994–1997)",one:"Bosnia-Herzegovina new dinar (1994–1997)"},symbol:"BAN",narrow:"BAN"},BBD:{displayName:{other:"Barbadian dollars",one:"Barbadian dollar"},symbol:"BBD",narrow:"$"},BDT:{displayName:{other:"Bangladeshi takas",one:"Bangladeshi taka"},symbol:"BDT",narrow:"৳"},BEC:{displayName:{other:"Belgian francs (convertible)",one:"Belgian franc (convertible)"},symbol:"BEC",narrow:"BEC"},BEF:{displayName:{other:"Belgian francs",one:"Belgian franc"},symbol:"BEF",narrow:"BEF"},BEL:{displayName:{other:"Belgian francs (financial)",one:"Belgian franc (financial)"},symbol:"BEL",narrow:"BEL"},BGL:{displayName:{other:"Bulgarian hard leva",one:"Bulgarian hard lev"},symbol:"BGL",narrow:"BGL"},BGM:{displayName:{other:"Bulgarian socialist leva",one:"Bulgarian socialist lev"},symbol:"BGM",narrow:"BGM"},BGN:{displayName:{other:"Bulgarian leva",one:"Bulgarian lev"},symbol:"BGN",narrow:"BGN"},BGO:{displayName:{other:"Bulgarian leva (1879–1952)",one:"Bulgarian lev (1879–1952)"},symbol:"BGO",narrow:"BGO"},BHD:{displayName:{other:"Bahraini dinars",one:"Bahraini dinar"},symbol:"BHD",narrow:"BHD"},BIF:{displayName:{other:"Burundian francs",one:"Burundian franc"},symbol:"BIF",narrow:"BIF"},BMD:{displayName:{other:"Bermudan dollars",one:"Bermudan dollar"},symbol:"BMD",narrow:"$"},BND:{displayName:{other:"Brunei dollars",one:"Brunei dollar"},symbol:"BND",narrow:"$"},BOB:{displayName:{other:"Bolivian bolivianos",one:"Bolivian boliviano"},symbol:"BOB",narrow:"Bs"},BOL:{displayName:{other:"Bolivian bolivianos (1863–1963)",one:"Bolivian boliviano (1863–1963)"},symbol:"BOL",narrow:"BOL"},BOP:{displayName:{other:"Bolivian pesos",one:"Bolivian peso"},symbol:"BOP",narrow:"BOP"},BOV:{displayName:{other:"Bolivian mvdols",one:"Bolivian mvdol"},symbol:"BOV",narrow:"BOV"},BRB:{displayName:{other:"Brazilian new cruzeiros (1967–1986)",one:"Brazilian new cruzeiro (1967–1986)"},symbol:"BRB",narrow:"BRB"},BRC:{displayName:{other:"Brazilian cruzados (1986–1989)",one:"Brazilian cruzado (1986–1989)"},symbol:"BRC",narrow:"BRC"},BRE:{displayName:{other:"Brazilian cruzeiros (1990–1993)",one:"Brazilian cruzeiro (1990–1993)"},symbol:"BRE",narrow:"BRE"},BRL:{displayName:{other:"Brazilian reals",one:"Brazilian real"},symbol:"R$",narrow:"R$"},BRN:{displayName:{other:"Brazilian new cruzados (1989–1990)",one:"Brazilian new cruzado (1989–1990)"},symbol:"BRN",narrow:"BRN"},BRR:{displayName:{other:"Brazilian cruzeiros (1993–1994)",one:"Brazilian cruzeiro (1993–1994)"},symbol:"BRR",narrow:"BRR"},BRZ:{displayName:{other:"Brazilian cruzeiros (1942–1967)",one:"Brazilian cruzeiro (1942–1967)"},symbol:"BRZ",narrow:"BRZ"},BSD:{displayName:{other:"Bahamian dollars",one:"Bahamian dollar"},symbol:"BSD",narrow:"$"},BTN:{displayName:{other:"Bhutanese ngultrums",one:"Bhutanese ngultrum"},symbol:"BTN",narrow:"BTN"},BUK:{displayName:{other:"Burmese kyats",one:"Burmese kyat"},symbol:"BUK",narrow:"BUK"},BWP:{displayName:{other:"Botswanan pulas",one:"Botswanan pula"},symbol:"BWP",narrow:"P"},BYB:{displayName:{other:"Belarusian rubles (1994–1999)",one:"Belarusian ruble (1994–1999)"},symbol:"BYB",narrow:"BYB"},BYN:{displayName:{other:"Belarusian rubles",one:"Belarusian ruble"},symbol:"BYN",narrow:"BYN"},BYR:{displayName:{other:"Belarusian rubles (2000–2016)",one:"Belarusian ruble (2000–2016)"},symbol:"BYR",narrow:"BYR"},BZD:{displayName:{other:"Belize dollars",one:"Belize dollar"},symbol:"BZD",narrow:"$"},CAD:{displayName:{other:"Canadian dollars",one:"Canadian dollar"},symbol:"CA$",narrow:"$"},CDF:{displayName:{other:"Congolese francs",one:"Congolese franc"},symbol:"CDF",narrow:"CDF"},CHE:{displayName:{other:"WIR euros",one:"WIR euro"},symbol:"CHE",narrow:"CHE"},CHF:{displayName:{other:"Swiss francs",one:"Swiss franc"},symbol:"CHF",narrow:"CHF"},CHW:{displayName:{other:"WIR francs",one:"WIR franc"},symbol:"CHW",narrow:"CHW"},CLE:{displayName:{other:"Chilean escudos",one:"Chilean escudo"},symbol:"CLE",narrow:"CLE"},CLF:{displayName:{other:"Chilean units of account (UF)",one:"Chilean unit of account (UF)"},symbol:"CLF",narrow:"CLF"},CLP:{displayName:{other:"Chilean pesos",one:"Chilean peso"},symbol:"CLP",narrow:"$"},CNH:{displayName:{other:"Chinese yuan (offshore)"},symbol:"CNH",narrow:"CNH"},CNX:{displayName:{other:"Chinese People’s Bank dollars",one:"Chinese People’s Bank dollar"},symbol:"CNX",narrow:"CNX"},CNY:{displayName:{other:"Chinese yuan"},symbol:"CN¥",narrow:"¥"},COP:{displayName:{other:"Colombian pesos",one:"Colombian peso"},symbol:"COP",narrow:"$"},COU:{displayName:{other:"Colombian real value units",one:"Colombian real value unit"},symbol:"COU",narrow:"COU"},CRC:{displayName:{other:"Costa Rican colóns",one:"Costa Rican colón"},symbol:"CRC",narrow:"₡"},CSD:{displayName:{other:"Serbian dinars (2002–2006)",one:"Serbian dinar (2002–2006)"},symbol:"CSD",narrow:"CSD"},CSK:{displayName:{other:"Czechoslovak hard korunas",one:"Czechoslovak hard koruna"},symbol:"CSK",narrow:"CSK"},CUC:{displayName:{other:"Cuban convertible pesos",one:"Cuban convertible peso"},symbol:"CUC",narrow:"$"},CUP:{displayName:{other:"Cuban pesos",one:"Cuban peso"},symbol:"CUP",narrow:"$"},CVE:{displayName:{other:"Cape Verdean escudos",one:"Cape Verdean escudo"},symbol:"CVE",narrow:"CVE"},CYP:{displayName:{other:"Cypriot pounds",one:"Cypriot pound"},symbol:"CYP",narrow:"CYP"},CZK:{displayName:{other:"Czech korunas",one:"Czech koruna"},symbol:"CZK",narrow:"Kč"},DDM:{displayName:{other:"East German marks",one:"East German mark"},symbol:"DDM",narrow:"DDM"},DEM:{displayName:{other:"German marks",one:"German mark"},symbol:"DEM",narrow:"DEM"},DJF:{displayName:{other:"Djiboutian francs",one:"Djiboutian franc"},symbol:"DJF",narrow:"DJF"},DKK:{displayName:{other:"Danish kroner",one:"Danish krone"},symbol:"DKK",narrow:"kr"},DOP:{displayName:{other:"Dominican pesos",one:"Dominican peso"},symbol:"DOP",narrow:"$"},DZD:{displayName:{other:"Algerian dinars",one:"Algerian dinar"},symbol:"DZD",narrow:"DZD"},ECS:{displayName:{other:"Ecuadorian sucres",one:"Ecuadorian sucre"},symbol:"ECS",narrow:"ECS"},ECV:{displayName:{other:"Ecuadorian units of constant value",one:"Ecuadorian unit of constant value"},symbol:"ECV",narrow:"ECV"},EEK:{displayName:{other:"Estonian kroons",one:"Estonian kroon"},symbol:"EEK",narrow:"EEK"},EGP:{displayName:{other:"Egyptian pounds",one:"Egyptian pound"},symbol:"EGP",narrow:"E£"},ERN:{displayName:{other:"Eritrean nakfas",one:"Eritrean nakfa"},symbol:"ERN",narrow:"ERN"},ESA:{displayName:{other:"Spanish pesetas (A account)",one:"Spanish peseta (A account)"},symbol:"ESA",narrow:"ESA"},ESB:{displayName:{other:"Spanish pesetas (convertible account)",one:"Spanish peseta (convertible account)"},symbol:"ESB",narrow:"ESB"},ESP:{displayName:{other:"Spanish pesetas",one:"Spanish peseta"},symbol:"ESP",narrow:"₧"},ETB:{displayName:{other:"Ethiopian birrs",one:"Ethiopian birr"},symbol:"ETB",narrow:"ETB"},EUR:{displayName:{other:"euros",one:"euro"},symbol:"€",narrow:"€"},FIM:{displayName:{other:"Finnish markkas",one:"Finnish markka"},symbol:"FIM",narrow:"FIM"},FJD:{displayName:{other:"Fijian dollars",one:"Fijian dollar"},symbol:"FJD",narrow:"$"},FKP:{displayName:{other:"Falkland Islands pounds",one:"Falkland Islands pound"},symbol:"FKP",narrow:"£"},FRF:{displayName:{other:"French francs",one:"French franc"},symbol:"FRF",narrow:"FRF"},GBP:{displayName:{other:"British pounds",one:"British pound"},symbol:"£",narrow:"£"},GEK:{displayName:{other:"Georgian kupon larits",one:"Georgian kupon larit"},symbol:"GEK",narrow:"GEK"},GEL:{displayName:{other:"Georgian laris",one:"Georgian lari"},symbol:"GEL",narrow:"₾"},GHC:{displayName:{other:"Ghanaian cedis (1979–2007)",one:"Ghanaian cedi (1979–2007)"},symbol:"GHC",narrow:"GHC"},GHS:{displayName:{other:"Ghanaian cedis",one:"Ghanaian cedi"},symbol:"GHS",narrow:"GH₵"},GIP:{displayName:{other:"Gibraltar pounds",one:"Gibraltar pound"},symbol:"GIP",narrow:"£"},GMD:{displayName:{other:"Gambian dalasis",one:"Gambian dalasi"},symbol:"GMD",narrow:"GMD"},GNF:{displayName:{other:"Guinean francs",one:"Guinean franc"},symbol:"GNF",narrow:"FG"},GNS:{displayName:{other:"Guinean sylis",one:"Guinean syli"},symbol:"GNS",narrow:"GNS"},GQE:{displayName:{other:"Equatorial Guinean ekwele"},symbol:"GQE",narrow:"GQE"},GRD:{displayName:{other:"Greek drachmas",one:"Greek drachma"},symbol:"GRD",narrow:"GRD"},GTQ:{displayName:{other:"Guatemalan quetzals",one:"Guatemalan quetzal"},symbol:"GTQ",narrow:"Q"},GWE:{displayName:{other:"Portuguese Guinea escudos",one:"Portuguese Guinea escudo"},symbol:"GWE",narrow:"GWE"},GWP:{displayName:{other:"Guinea-Bissau pesos",one:"Guinea-Bissau peso"},symbol:"GWP",narrow:"GWP"},GYD:{displayName:{other:"Guyanaese dollars",one:"Guyanaese dollar"},symbol:"GYD",narrow:"$"},HKD:{displayName:{other:"Hong Kong dollars",one:"Hong Kong dollar"},symbol:"HK$",narrow:"$"},HNL:{displayName:{other:"Honduran lempiras",one:"Honduran lempira"},symbol:"HNL",narrow:"L"},HRD:{displayName:{other:"Croatian dinars",one:"Croatian dinar"},symbol:"HRD",narrow:"HRD"},HRK:{displayName:{other:"Croatian kunas",one:"Croatian kuna"},symbol:"HRK",narrow:"kn"},HTG:{displayName:{other:"Haitian gourdes",one:"Haitian gourde"},symbol:"HTG",narrow:"HTG"},HUF:{displayName:{other:"Hungarian forints",one:"Hungarian forint"},symbol:"HUF",narrow:"Ft"},IDR:{displayName:{other:"Indonesian rupiahs",one:"Indonesian rupiah"},symbol:"IDR",narrow:"Rp"},IEP:{displayName:{other:"Irish pounds",one:"Irish pound"},symbol:"IEP",narrow:"IEP"},ILP:{displayName:{other:"Israeli pounds",one:"Israeli pound"},symbol:"ILP",narrow:"ILP"},ILR:{displayName:{other:"Israeli shekels (1980–1985)",one:"Israeli shekel (1980–1985)"},symbol:"ILR",narrow:"ILR"},ILS:{displayName:{other:"Israeli new shekels",one:"Israeli new shekel"},symbol:"₪",narrow:"₪"},INR:{displayName:{other:"Indian rupees",one:"Indian rupee"},symbol:"₹",narrow:"₹"},IQD:{displayName:{other:"Iraqi dinars",one:"Iraqi dinar"},symbol:"IQD",narrow:"IQD"},IRR:{displayName:{other:"Iranian rials",one:"Iranian rial"},symbol:"IRR",narrow:"IRR"},ISJ:{displayName:{other:"Icelandic krónur (1918–1981)",one:"Icelandic króna (1918–1981)"},symbol:"ISJ",narrow:"ISJ"},ISK:{displayName:{other:"Icelandic krónur",one:"Icelandic króna"},symbol:"ISK",narrow:"kr"},ITL:{displayName:{other:"Italian liras",one:"Italian lira"},symbol:"ITL",narrow:"ITL"},JMD:{displayName:{other:"Jamaican dollars",one:"Jamaican dollar"},symbol:"JMD",narrow:"$"},JOD:{displayName:{other:"Jordanian dinars",one:"Jordanian dinar"},symbol:"JOD",narrow:"JOD"},JPY:{displayName:{other:"Japanese yen"},symbol:"¥",narrow:"¥"},KES:{displayName:{other:"Kenyan shillings",one:"Kenyan shilling"},symbol:"KES",narrow:"KES"},KGS:{displayName:{other:"Kyrgystani soms",one:"Kyrgystani som"},symbol:"KGS",narrow:"KGS"},KHR:{displayName:{other:"Cambodian riels",one:"Cambodian riel"},symbol:"KHR",narrow:"៛"},KMF:{displayName:{other:"Comorian francs",one:"Comorian franc"},symbol:"KMF",narrow:"CF"},KPW:{displayName:{other:"North Korean won"},symbol:"KPW",narrow:"₩"},KRH:{displayName:{other:"South Korean hwan (1953–1962)"},symbol:"KRH",narrow:"KRH"},KRO:{displayName:{other:"South Korean won (1945–1953)"},symbol:"KRO",narrow:"KRO"},KRW:{displayName:{other:"South Korean won"},symbol:"₩",narrow:"₩"},KWD:{displayName:{other:"Kuwaiti dinars",one:"Kuwaiti dinar"},symbol:"KWD",narrow:"KWD"},KYD:{displayName:{other:"Cayman Islands dollars",one:"Cayman Islands dollar"},symbol:"KYD",narrow:"$"},KZT:{displayName:{other:"Kazakhstani tenges",one:"Kazakhstani tenge"},symbol:"KZT",narrow:"₸"},LAK:{displayName:{other:"Laotian kips",one:"Laotian kip"},symbol:"LAK",narrow:"₭"},LBP:{displayName:{other:"Lebanese pounds",one:"Lebanese pound"},symbol:"LBP",narrow:"L£"},LKR:{displayName:{other:"Sri Lankan rupees",one:"Sri Lankan rupee"},symbol:"LKR",narrow:"Rs"},LRD:{displayName:{other:"Liberian dollars",one:"Liberian dollar"},symbol:"LRD",narrow:"$"},LSL:{displayName:{other:"Lesotho lotis",one:"Lesotho loti"},symbol:"LSL",narrow:"LSL"},LTL:{displayName:{other:"Lithuanian litai",one:"Lithuanian litas"},symbol:"LTL",narrow:"Lt"},LTT:{displayName:{other:"Lithuanian talonases",one:"Lithuanian talonas"},symbol:"LTT",narrow:"LTT"},LUC:{displayName:{other:"Luxembourgian convertible francs",one:"Luxembourgian convertible franc"},symbol:"LUC",narrow:"LUC"},LUF:{displayName:{other:"Luxembourgian francs",one:"Luxembourgian franc"},symbol:"LUF",narrow:"LUF"},LUL:{displayName:{other:"Luxembourg financial francs",one:"Luxembourg financial franc"},symbol:"LUL",narrow:"LUL"},LVL:{displayName:{other:"Latvian lati",one:"Latvian lats"},symbol:"LVL",narrow:"Ls"},LVR:{displayName:{other:"Latvian rubles",one:"Latvian ruble"},symbol:"LVR",narrow:"LVR"},LYD:{displayName:{other:"Libyan dinars",one:"Libyan dinar"},symbol:"LYD",narrow:"LYD"},MAD:{displayName:{other:"Moroccan dirhams",one:"Moroccan dirham"},symbol:"MAD",narrow:"MAD"},MAF:{displayName:{other:"Moroccan francs",one:"Moroccan franc"},symbol:"MAF",narrow:"MAF"},MCF:{displayName:{other:"Monegasque francs",one:"Monegasque franc"},symbol:"MCF",narrow:"MCF"},MDC:{displayName:{other:"Moldovan cupon"},symbol:"MDC",narrow:"MDC"},MDL:{displayName:{other:"Moldovan lei",one:"Moldovan leu"},symbol:"MDL",narrow:"MDL"},MGA:{displayName:{other:"Malagasy ariaries",one:"Malagasy ariary"},symbol:"MGA",narrow:"Ar"},MGF:{displayName:{other:"Malagasy francs",one:"Malagasy franc"},symbol:"MGF",narrow:"MGF"},MKD:{displayName:{other:"Macedonian denari",one:"Macedonian denar"},symbol:"MKD",narrow:"MKD"},MKN:{displayName:{other:"Macedonian denari (1992–1993)",one:"Macedonian denar (1992–1993)"},symbol:"MKN",narrow:"MKN"},MLF:{displayName:{other:"Malian francs",one:"Malian franc"},symbol:"MLF",narrow:"MLF"},MMK:{displayName:{other:"Myanmar kyats",one:"Myanmar kyat"},symbol:"MMK",narrow:"K"},MNT:{displayName:{other:"Mongolian tugriks",one:"Mongolian tugrik"},symbol:"MNT",narrow:"₮"},MOP:{displayName:{other:"Macanese patacas",one:"Macanese pataca"},symbol:"MOP",narrow:"MOP"},MRO:{displayName:{other:"Mauritanian ouguiyas (1973–2017)",one:"Mauritanian ouguiya (1973–2017)"},symbol:"MRO",narrow:"MRO"},MRU:{displayName:{other:"Mauritanian ouguiyas",one:"Mauritanian ouguiya"},symbol:"MRU",narrow:"MRU"},MTL:{displayName:{other:"Maltese lira"},symbol:"MTL",narrow:"MTL"},MTP:{displayName:{other:"Maltese pounds",one:"Maltese pound"},symbol:"MTP",narrow:"MTP"},MUR:{displayName:{other:"Mauritian rupees",one:"Mauritian rupee"},symbol:"MUR",narrow:"Rs"},MVP:{displayName:{other:"Maldivian rupees (1947–1981)",one:"Maldivian rupee (1947–1981)"},symbol:"MVP",narrow:"MVP"},MVR:{displayName:{other:"Maldivian rufiyaas",one:"Maldivian rufiyaa"},symbol:"MVR",narrow:"MVR"},MWK:{displayName:{other:"Malawian kwachas",one:"Malawian kwacha"},symbol:"MWK",narrow:"MWK"},MXN:{displayName:{other:"Mexican pesos",one:"Mexican peso"},symbol:"MX$",narrow:"$"},MXP:{displayName:{other:"Mexican silver pesos (1861–1992)",one:"Mexican silver peso (1861–1992)"},symbol:"MXP",narrow:"MXP"},MXV:{displayName:{other:"Mexican investment units",one:"Mexican investment unit"},symbol:"MXV",narrow:"MXV"},MYR:{displayName:{other:"Malaysian ringgits",one:"Malaysian ringgit"},symbol:"MYR",narrow:"RM"},MZE:{displayName:{other:"Mozambican escudos",one:"Mozambican escudo"},symbol:"MZE",narrow:"MZE"},MZM:{displayName:{other:"Mozambican meticals (1980–2006)",one:"Mozambican metical (1980–2006)"},symbol:"MZM",narrow:"MZM"},MZN:{displayName:{other:"Mozambican meticals",one:"Mozambican metical"},symbol:"MZN",narrow:"MZN"},NAD:{displayName:{other:"Namibian dollars",one:"Namibian dollar"},symbol:"NAD",narrow:"$"},NGN:{displayName:{other:"Nigerian nairas",one:"Nigerian naira"},symbol:"NGN",narrow:"₦"},NIC:{displayName:{other:"Nicaraguan córdobas (1988–1991)",one:"Nicaraguan córdoba (1988–1991)"},symbol:"NIC",narrow:"NIC"},NIO:{displayName:{other:"Nicaraguan córdobas",one:"Nicaraguan córdoba"},symbol:"NIO",narrow:"C$"},NLG:{displayName:{other:"Dutch guilders",one:"Dutch guilder"},symbol:"NLG",narrow:"NLG"},NOK:{displayName:{other:"Norwegian kroner",one:"Norwegian krone"},symbol:"NOK",narrow:"kr"},NPR:{displayName:{other:"Nepalese rupees",one:"Nepalese rupee"},symbol:"NPR",narrow:"Rs"},NZD:{displayName:{other:"New Zealand dollars",one:"New Zealand dollar"},symbol:"NZ$",narrow:"$"},OMR:{displayName:{other:"Omani rials",one:"Omani rial"},symbol:"OMR",narrow:"OMR"},PAB:{displayName:{other:"Panamanian balboas",one:"Panamanian balboa"},symbol:"PAB",narrow:"PAB"},PEI:{displayName:{other:"Peruvian intis",one:"Peruvian inti"},symbol:"PEI",narrow:"PEI"},PEN:{displayName:{other:"Peruvian soles",one:"Peruvian sol"},symbol:"PEN",narrow:"PEN"},PES:{displayName:{other:"Peruvian soles (1863–1965)",one:"Peruvian sol (1863–1965)"},symbol:"PES",narrow:"PES"},PGK:{displayName:{other:"Papua New Guinean kina"},symbol:"PGK",narrow:"PGK"},PHP:{displayName:{other:"Philippine pisos",one:"Philippine piso"},symbol:"₱",narrow:"₱"},PKR:{displayName:{other:"Pakistani rupees",one:"Pakistani rupee"},symbol:"PKR",narrow:"Rs"},PLN:{displayName:{other:"Polish zlotys",one:"Polish zloty"},symbol:"PLN",narrow:"zł"},PLZ:{displayName:{other:"Polish zlotys (PLZ)",one:"Polish zloty (PLZ)"},symbol:"PLZ",narrow:"PLZ"},PTE:{displayName:{other:"Portuguese escudos",one:"Portuguese escudo"},symbol:"PTE",narrow:"PTE"},PYG:{displayName:{other:"Paraguayan guaranis",one:"Paraguayan guarani"},symbol:"PYG",narrow:"₲"},QAR:{displayName:{other:"Qatari rials",one:"Qatari rial"},symbol:"QAR",narrow:"QAR"},RHD:{displayName:{other:"Rhodesian dollars",one:"Rhodesian dollar"},symbol:"RHD",narrow:"RHD"},ROL:{displayName:{other:"Romanian Lei (1952–2006)",one:"Romanian leu (1952–2006)"},symbol:"ROL",narrow:"ROL"},RON:{displayName:{other:"Romanian lei",one:"Romanian leu"},symbol:"RON",narrow:"lei"},RSD:{displayName:{other:"Serbian dinars",one:"Serbian dinar"},symbol:"RSD",narrow:"RSD"},RUB:{displayName:{other:"Russian rubles",one:"Russian ruble"},symbol:"RUB",narrow:"₽"},RUR:{displayName:{other:"Russian rubles (1991–1998)",one:"Russian ruble (1991–1998)"},symbol:"RUR",narrow:"RUR"},RWF:{displayName:{other:"Rwandan francs",one:"Rwandan franc"},symbol:"RWF",narrow:"RF"},SAR:{displayName:{other:"Saudi riyals",one:"Saudi riyal"},symbol:"SAR",narrow:"SAR"},SBD:{displayName:{other:"Solomon Islands dollars",one:"Solomon Islands dollar"},symbol:"SBD",narrow:"$"},SCR:{displayName:{other:"Seychellois rupees",one:"Seychellois rupee"},symbol:"SCR",narrow:"SCR"},SDD:{displayName:{other:"Sudanese dinars (1992–2007)",one:"Sudanese dinar (1992–2007)"},symbol:"SDD",narrow:"SDD"},SDG:{displayName:{other:"Sudanese pounds",one:"Sudanese pound"},symbol:"SDG",narrow:"SDG"},SDP:{displayName:{other:"Sudanese pounds (1957–1998)",one:"Sudanese pound (1957–1998)"},symbol:"SDP",narrow:"SDP"},SEK:{displayName:{other:"Swedish kronor",one:"Swedish krona"},symbol:"SEK",narrow:"kr"},SGD:{displayName:{other:"Singapore dollars",one:"Singapore dollar"},symbol:"SGD",narrow:"$"},SHP:{displayName:{other:"St. Helena pounds",one:"St. Helena pound"},symbol:"SHP",narrow:"£"},SIT:{displayName:{other:"Slovenian tolars",one:"Slovenian tolar"},symbol:"SIT",narrow:"SIT"},SKK:{displayName:{other:"Slovak korunas",one:"Slovak koruna"},symbol:"SKK",narrow:"SKK"},SLL:{displayName:{other:"Sierra Leonean leones",one:"Sierra Leonean leone"},symbol:"SLL",narrow:"SLL"},SOS:{displayName:{other:"Somali shillings",one:"Somali shilling"},symbol:"SOS",narrow:"SOS"},SRD:{displayName:{other:"Surinamese dollars",one:"Surinamese dollar"},symbol:"SRD",narrow:"$"},SRG:{displayName:{other:"Surinamese guilders",one:"Surinamese guilder"},symbol:"SRG",narrow:"SRG"},SSP:{displayName:{other:"South Sudanese pounds",one:"South Sudanese pound"},symbol:"SSP",narrow:"£"},STD:{displayName:{other:"São Tomé & Príncipe dobras (1977–2017)",one:"São Tomé & Príncipe dobra (1977–2017)"},symbol:"STD",narrow:"STD"},STN:{displayName:{other:"São Tomé & Príncipe dobras",one:"São Tomé & Príncipe dobra"},symbol:"STN",narrow:"Db"},SUR:{displayName:{other:"Soviet roubles",one:"Soviet rouble"},symbol:"SUR",narrow:"SUR"},SVC:{displayName:{other:"Salvadoran colones",one:"Salvadoran colón"},symbol:"SVC",narrow:"SVC"},SYP:{displayName:{other:"Syrian pounds",one:"Syrian pound"},symbol:"SYP",narrow:"£"},SZL:{displayName:{other:"Swazi emalangeni",one:"Swazi lilangeni"},symbol:"SZL",narrow:"SZL"},THB:{displayName:{other:"Thai baht"},symbol:"THB",narrow:"฿"},TJR:{displayName:{other:"Tajikistani rubles",one:"Tajikistani ruble"},symbol:"TJR",narrow:"TJR"},TJS:{displayName:{other:"Tajikistani somonis",one:"Tajikistani somoni"},symbol:"TJS",narrow:"TJS"},TMM:{displayName:{other:"Turkmenistani manat (1993–2009)"},symbol:"TMM",narrow:"TMM"},TMT:{displayName:{other:"Turkmenistani manat"},symbol:"TMT",narrow:"TMT"},TND:{displayName:{other:"Tunisian dinars",one:"Tunisian dinar"},symbol:"TND",narrow:"TND"},TOP:{displayName:{other:"Tongan paʻanga"},symbol:"TOP",narrow:"T$"},TPE:{displayName:{other:"Timorese escudos",one:"Timorese escudo"},symbol:"TPE",narrow:"TPE"},TRL:{displayName:{other:"Turkish Lira (1922–2005)",one:"Turkish lira (1922–2005)"},symbol:"TRL",narrow:"TRL"},TRY:{displayName:{other:"Turkish Lira",one:"Turkish lira"},symbol:"TRY",narrow:"₺"},TTD:{displayName:{other:"Trinidad & Tobago dollars",one:"Trinidad & Tobago dollar"},symbol:"TTD",narrow:"$"},TWD:{displayName:{other:"New Taiwan dollars",one:"New Taiwan dollar"},symbol:"NT$",narrow:"$"},TZS:{displayName:{other:"Tanzanian shillings",one:"Tanzanian shilling"},symbol:"TZS",narrow:"TZS"},UAH:{displayName:{other:"Ukrainian hryvnias",one:"Ukrainian hryvnia"},symbol:"UAH",narrow:"₴"},UAK:{displayName:{other:"Ukrainian karbovantsiv",one:"Ukrainian karbovanets"},symbol:"UAK",narrow:"UAK"},UGS:{displayName:{other:"Ugandan shillings (1966–1987)",one:"Ugandan shilling (1966–1987)"},symbol:"UGS",narrow:"UGS"},UGX:{displayName:{other:"Ugandan shillings",one:"Ugandan shilling"},symbol:"UGX",narrow:"UGX"},USD:{displayName:{other:"US dollars",one:"US dollar"},symbol:"$",narrow:"$"},USN:{displayName:{other:"US dollars (next day)",one:"US dollar (next day)"},symbol:"USN",narrow:"USN"},USS:{displayName:{other:"US dollars (same day)",one:"US dollar (same day)"},symbol:"USS",narrow:"USS"},UYI:{displayName:{other:"Uruguayan pesos (indexed units)",one:"Uruguayan peso (indexed units)"},symbol:"UYI",narrow:"UYI"},UYP:{displayName:{other:"Uruguayan pesos (1975–1993)",one:"Uruguayan peso (1975–1993)"},symbol:"UYP",narrow:"UYP"},UYU:{displayName:{other:"Uruguayan pesos",one:"Uruguayan peso"},symbol:"UYU",narrow:"$"},UYW:{displayName:{other:"Uruguayan nominal wage index units",one:"Uruguayan nominal wage index unit"},symbol:"UYW",narrow:"UYW"},UZS:{displayName:{other:"Uzbekistani som"},symbol:"UZS",narrow:"UZS"},VEB:{displayName:{other:"Venezuelan bolívars (1871–2008)",one:"Venezuelan bolívar (1871–2008)"},symbol:"VEB",narrow:"VEB"},VEF:{displayName:{other:"Venezuelan bolívars (2008–2018)",one:"Venezuelan bolívar (2008–2018)"},symbol:"VEF",narrow:"Bs"},VES:{displayName:{other:"Venezuelan bolívars",one:"Venezuelan bolívar"},symbol:"VES",narrow:"VES"},VND:{displayName:{other:"Vietnamese dong"},symbol:"₫",narrow:"₫"},VNN:{displayName:{other:"Vietnamese dong (1978–1985)"},symbol:"VNN",narrow:"VNN"},VUV:{displayName:{other:"Vanuatu vatus",one:"Vanuatu vatu"},symbol:"VUV",narrow:"VUV"},WST:{displayName:{other:"Samoan tala"},symbol:"WST",narrow:"WST"},XAF:{displayName:{other:"Central African CFA francs",one:"Central African CFA franc"},symbol:"FCFA",narrow:"FCFA"},XAG:{displayName:{other:"troy ounces of silver",one:"troy ounce of silver"},symbol:"XAG",narrow:"XAG"},XAU:{displayName:{other:"troy ounces of gold",one:"troy ounce of gold"},symbol:"XAU",narrow:"XAU"},XBA:{displayName:{other:"European composite units",one:"European composite unit"},symbol:"XBA",narrow:"XBA"},XBB:{displayName:{other:"European monetary units",one:"European monetary unit"},symbol:"XBB",narrow:"XBB"},XBC:{displayName:{other:"European units of account (XBC)",one:"European unit of account (XBC)"},symbol:"XBC",narrow:"XBC"},XBD:{displayName:{other:"European units of account (XBD)",one:"European unit of account (XBD)"},symbol:"XBD",narrow:"XBD"},XCD:{displayName:{other:"East Caribbean dollars",one:"East Caribbean dollar"},symbol:"EC$",narrow:"$"},XDR:{displayName:{other:"special drawing rights"},symbol:"XDR",narrow:"XDR"},XEU:{displayName:{other:"European currency units",one:"European currency unit"},symbol:"XEU",narrow:"XEU"},XFO:{displayName:{other:"French gold francs",one:"French gold franc"},symbol:"XFO",narrow:"XFO"},XFU:{displayName:{other:"French UIC-francs",one:"French UIC-franc"},symbol:"XFU",narrow:"XFU"},XOF:{displayName:{other:"West African CFA francs",one:"West African CFA franc"},symbol:"F CFA",narrow:"F CFA"},XPD:{displayName:{other:"troy ounces of palladium",one:"troy ounce of palladium"},symbol:"XPD",narrow:"XPD"},XPF:{displayName:{other:"CFP francs",one:"CFP franc"},symbol:"CFPF",narrow:"CFPF"},XPT:{displayName:{other:"troy ounces of platinum",one:"troy ounce of platinum"},symbol:"XPT",narrow:"XPT"},XRE:{displayName:{other:"RINET Funds units",one:"RINET Funds unit"},symbol:"XRE",narrow:"XRE"},XSU:{displayName:{other:"Sucres",one:"Sucre"},symbol:"XSU",narrow:"XSU"},XTS:{displayName:{other:"Testing Currency units",one:"Testing Currency unit"},symbol:"XTS",narrow:"XTS"},XUA:{displayName:{other:"ADB units of account",one:"ADB unit of account"},symbol:"XUA",narrow:"XUA"},XXX:{displayName:{other:"(unknown currency)",one:"(unknown unit of currency)"},symbol:"¤",narrow:"¤"},YDD:{displayName:{other:"Yemeni dinars",one:"Yemeni dinar"},symbol:"YDD",narrow:"YDD"},YER:{displayName:{other:"Yemeni rials",one:"Yemeni rial"},symbol:"YER",narrow:"YER"},YUD:{displayName:{other:"Yugoslavian hard dinars (1966–1990)",one:"Yugoslavian hard dinar (1966–1990)"},symbol:"YUD",narrow:"YUD"},YUM:{displayName:{other:"Yugoslavian new dinars (1994–2002)",one:"Yugoslavian new dinar (1994–2002)"},symbol:"YUM",narrow:"YUM"},YUN:{displayName:{other:"Yugoslavian convertible dinars (1990–1992)",one:"Yugoslavian convertible dinar (1990–1992)"},symbol:"YUN",narrow:"YUN"},YUR:{displayName:{other:"Yugoslavian reformed dinars (1992–1993)",one:"Yugoslavian reformed dinar (1992–1993)"},symbol:"YUR",narrow:"YUR"},ZAL:{displayName:{other:"South African rands (financial)",one:"South African rand (financial)"},symbol:"ZAL",narrow:"ZAL"},ZAR:{displayName:{other:"South African rand"},symbol:"ZAR",narrow:"R"},ZMK:{displayName:{other:"Zambian kwachas (1968–2012)",one:"Zambian kwacha (1968–2012)"},symbol:"ZMK",narrow:"ZMK"},ZMW:{displayName:{other:"Zambian kwachas",one:"Zambian kwacha"},symbol:"ZMW",narrow:"ZK"},ZRN:{displayName:{other:"Zairean new zaires (1993–1998)",one:"Zairean new zaire (1993–1998)"},symbol:"ZRN",narrow:"ZRN"},ZRZ:{displayName:{other:"Zairean zaires (1971–1993)",one:"Zairean zaire (1971–1993)"},symbol:"ZRZ",narrow:"ZRZ"},ZWD:{displayName:{other:"Zimbabwean dollars (1980–2008)",one:"Zimbabwean dollar (1980–2008)"},symbol:"ZWD",narrow:"ZWD"},ZWL:{displayName:{other:"Zimbabwean dollars (2009)",one:"Zimbabwean dollar (2009)"},symbol:"ZWL",narrow:"ZWL"},ZWR:{displayName:{other:"Zimbabwean dollars (2008)",one:"Zimbabwean dollar (2008)"},symbol:"ZWR",narrow:"ZWR"}},numbers:{nu:["latn"],symbols:{latn:{decimal:".",group:",",list:";",percentSign:"%",plusSign:"+",minusSign:"-",approximatelySign:"~",exponential:"E",superscriptingExponent:"×",perMille:"‰",infinity:"∞",nan:"NaN",timeSeparator:":"}},percent:{latn:"#,##0%"},decimal:{latn:{standard:"#,##0.###",long:{1e3:{other:"0 thousand"},1e4:{other:"00 thousand"},1e5:{other:"000 thousand"},1e6:{other:"0 million"},1e7:{other:"00 million"},1e8:{other:"000 million"},1e9:{other:"0 billion"},1e10:{other:"00 billion"},1e11:{other:"000 billion"},1e12:{other:"0 trillion"},1e13:{other:"00 trillion"},1e14:{other:"000 trillion"}},short:{1e3:{other:"0K"},1e4:{other:"00K"},1e5:{other:"000K"},1e6:{other:"0M"},1e7:{other:"00M"},1e8:{other:"000M"},1e9:{other:"0B"},1e10:{other:"00B"},1e11:{other:"000B"},1e12:{other:"0T"},1e13:{other:"00T"},1e14:{other:"000T"}}}},currency:{latn:{currencySpacing:{beforeInsertBetween:" ",afterInsertBetween:" "},standard:"¤#,##0.00",accounting:"¤#,##0.00;(¤#,##0.00)",unitPattern:"{0} {1}",short:{1e3:{other:"¤0K"},1e4:{other:"¤00K"},1e5:{other:"¤000K"},1e6:{other:"¤0M"},1e7:{other:"¤00M"},1e8:{other:"¤000M"},1e9:{other:"¤0B"},1e10:{other:"¤00B"},1e11:{other:"¤000B"},1e12:{other:"¤0T"},1e13:{other:"¤00T"},1e14:{other:"¤000T"}}}}},nu:["latn"]},locale:"en"})},8210:(e,t,n)=>{"use strict";var r=n(2108),a=n(5418),o=n(8954);(0,n(6482).shouldPolyfill)()&&((0,o.defineProperty)(Intl,"NumberFormat",{value:r.NumberFormat}),(0,o.defineProperty)(Number.prototype,"toLocaleString",{value:function(e,t){return(0,a.toLocaleString)(this,e,t)}}))},6482:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldPolyfill=void 0;var r=n(983),a=n(4809);t.shouldPolyfill=function(e){if(void 0===e&&(e="en"),"undefined"==typeof Intl||!("NumberFormat"in Intl)||!function(){try{if("1E4 bits"!==new Intl.NumberFormat("en",{style:"unit",unit:"bit",unitDisplay:"long",notation:"scientific"}).format(1e4))return!1}catch(e){return!1}return!0}()||!Intl.NumberFormat.polyfilled&&!Intl.NumberFormat.supportedLocalesOf(["es"]).length||!function(e){if(!e)return!0;var t=Array.isArray(e)?e:[e];return Intl.NumberFormat.supportedLocalesOf(t).length===t.length}(e))return e?(0,r.match)([e],a.supportedLocales,"en"):void 0}},2108:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberFormat=void 0;var r=n(655),a=n(8954),o=n(7402),i=n(605),l=r.__importDefault(n(5657)),u=["locale","numberingSystem","style","currency","currencyDisplay","currencySign","unit","unitDisplay","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","useGrouping","notation","compactDisplay","signDisplay"];function s(e){return(0,a.FormatNumericToParts)(this,f(e),{getInternalSlots:l.default})}t.NumberFormat=function(e,n){if(!this||!(0,a.OrdinaryHasInstance)(t.NumberFormat,this))return new t.NumberFormat(e,n);(0,a.InitializeNumberFormat)(this,e,n,{getInternalSlots:l.default,localeData:t.NumberFormat.localeData,availableLocales:t.NumberFormat.availableLocales,getDefaultLocale:t.NumberFormat.getDefaultLocale,currencyDigitsData:o.currencyDigitsData,numberingSystemNames:i.numberingSystemNames});var r=(0,l.default)(this),u=r.dataLocale,s=t.NumberFormat.localeData[u];return(0,a.invariant)(void 0!==s,"Cannot load locale-dependent data for ".concat(u,".")),r.pl=new Intl.PluralRules(u,{minimumFractionDigits:r.minimumFractionDigits,maximumFractionDigits:r.maximumFractionDigits,minimumIntegerDigits:r.minimumIntegerDigits,minimumSignificantDigits:r.minimumSignificantDigits,maximumSignificantDigits:r.maximumSignificantDigits}),this};try{Object.defineProperty(s,"name",{value:"formatToParts",enumerable:!1,writable:!1,configurable:!0})}catch(e){}(0,a.defineProperty)(t.NumberFormat.prototype,"formatToParts",{value:s}),(0,a.defineProperty)(t.NumberFormat.prototype,"resolvedOptions",{value:function(){if("object"!=typeof this||!(0,a.OrdinaryHasInstance)(t.NumberFormat,this))throw TypeError("Method Intl.NumberFormat.prototype.resolvedOptions called on incompatible receiver");for(var e=(0,l.default)(this),n={},r=0,o=u;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.currencyDigitsData=void 0,t.currencyDigitsData={ADP:0,AFN:0,ALL:0,AMD:2,BHD:3,BIF:0,BYN:2,BYR:0,CAD:2,CHF:2,CLF:4,CLP:0,COP:2,CRC:2,CZK:2,DEFAULT:2,DJF:0,DKK:2,ESP:0,GNF:0,GYD:2,HUF:2,IDR:2,IQD:0,IRR:0,ISK:0,ITL:0,JOD:3,JPY:0,KMF:0,KPW:0,KRW:0,KWD:3,LAK:0,LBP:0,LUF:0,LYD:3,MGA:0,MGF:0,MMK:0,MNT:2,MRO:0,MUR:2,NOK:2,OMR:3,PKR:2,PYG:0,RSD:0,RWF:0,SEK:2,SLL:0,SOS:0,STD:0,SYP:0,TMM:0,TND:3,TRL:0,TWD:2,TZS:2,UGX:0,UYI:0,UYW:4,UZS:2,VEF:2,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,YER:0,ZMK:0,ZWD:0}},5657:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new WeakMap;t.default=function(e){var t=n.get(e);return t||(t=Object.create(null),n.set(e,t)),t}},605:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.numberingSystemNames=void 0,t.numberingSystemNames=["adlm","ahom","arab","arabext","armn","armnlow","bali","beng","bhks","brah","cakm","cham","cyrl","deva","diak","ethi","fullwide","geor","gong","gonm","grek","greklow","gujr","guru","hanidays","hanidec","hans","hansfin","hant","hantfin","hebr","hmng","hmnp","java","jpan","jpanfin","jpanyear","kali","khmr","knda","lana","lanatham","laoo","latn","lepc","limb","mathbold","mathdbl","mathmono","mathsanb","mathsans","mlym","modi","mong","mroo","mtei","mymr","mymrshan","mymrtlng","newa","nkoo","olck","orya","osma","rohg","roman","romanlow","saur","segment","shrd","sind","sinh","sora","sund","takr","talu","taml","tamldec","telu","thai","tibt","tirh","tnsa","vaii","wara","wcho"]},5418:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toLocaleString=void 0;var r=n(2108);t.toLocaleString=function(e,t,n){return new r.NumberFormat(t,n).format(e)}},4809:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedLocales=void 0,t.supportedLocales=["af","af-NA","agq","ak","am","ar","ar-AE","ar-BH","ar-DJ","ar-DZ","ar-EG","ar-EH","ar-ER","ar-IL","ar-IQ","ar-JO","ar-KM","ar-KW","ar-LB","ar-LY","ar-MA","ar-MR","ar-OM","ar-PS","ar-QA","ar-SA","ar-SD","ar-SO","ar-SS","ar-SY","ar-TD","ar-TN","ar-YE","as","asa","ast","az","az-Cyrl","az-Latn","bas","be","be-tarask","bem","bez","bg","bm","bn","bn-IN","bo","bo-IN","br","brx","bs","bs-Cyrl","bs-Latn","ca","ca-AD","ca-ES-valencia","ca-FR","ca-IT","ccp","ccp-IN","ce","ceb","cgg","chr","ckb","ckb-IR","cs","cy","da","da-GL","dav","de","de-AT","de-BE","de-CH","de-IT","de-LI","de-LU","dje","doi","dsb","dua","dyo","dz","ebu","ee","ee-TG","el","el-CY","en","en-001","en-150","en-AE","en-AG","en-AI","en-AS","en-AT","en-AU","en-BB","en-BE","en-BI","en-BM","en-BS","en-BW","en-BZ","en-CA","en-CC","en-CH","en-CK","en-CM","en-CX","en-CY","en-DE","en-DG","en-DK","en-DM","en-ER","en-FI","en-FJ","en-FK","en-FM","en-GB","en-GD","en-GG","en-GH","en-GI","en-GM","en-GU","en-GY","en-HK","en-IE","en-IL","en-IM","en-IN","en-IO","en-JE","en-JM","en-KE","en-KI","en-KN","en-KY","en-LC","en-LR","en-LS","en-MG","en-MH","en-MO","en-MP","en-MS","en-MT","en-MU","en-MW","en-MY","en-NA","en-NF","en-NG","en-NL","en-NR","en-NU","en-NZ","en-PG","en-PH","en-PK","en-PN","en-PR","en-PW","en-RW","en-SB","en-SC","en-SD","en-SE","en-SG","en-SH","en-SI","en-SL","en-SS","en-SX","en-SZ","en-TC","en-TK","en-TO","en-TT","en-TV","en-TZ","en-UG","en-UM","en-VC","en-VG","en-VI","en-VU","en-WS","en-ZA","en-ZM","en-ZW","eo","es","es-419","es-AR","es-BO","es-BR","es-BZ","es-CL","es-CO","es-CR","es-CU","es-DO","es-EA","es-EC","es-GQ","es-GT","es-HN","es-IC","es-MX","es-NI","es-PA","es-PE","es-PH","es-PR","es-PY","es-SV","es-US","es-UY","es-VE","et","eu","ewo","fa","fa-AF","ff","ff-Adlm","ff-Adlm-BF","ff-Adlm-CM","ff-Adlm-GH","ff-Adlm-GM","ff-Adlm-GW","ff-Adlm-LR","ff-Adlm-MR","ff-Adlm-NE","ff-Adlm-NG","ff-Adlm-SL","ff-Adlm-SN","ff-Latn","ff-Latn-BF","ff-Latn-CM","ff-Latn-GH","ff-Latn-GM","ff-Latn-GN","ff-Latn-GW","ff-Latn-LR","ff-Latn-MR","ff-Latn-NE","ff-Latn-NG","ff-Latn-SL","fi","fil","fo","fo-DK","fr","fr-BE","fr-BF","fr-BI","fr-BJ","fr-BL","fr-CA","fr-CD","fr-CF","fr-CG","fr-CH","fr-CI","fr-CM","fr-DJ","fr-DZ","fr-GA","fr-GF","fr-GN","fr-GP","fr-GQ","fr-HT","fr-KM","fr-LU","fr-MA","fr-MC","fr-MF","fr-MG","fr-ML","fr-MQ","fr-MR","fr-MU","fr-NC","fr-NE","fr-PF","fr-PM","fr-RE","fr-RW","fr-SC","fr-SN","fr-SY","fr-TD","fr-TG","fr-TN","fr-VU","fr-WF","fr-YT","fur","fy","ga","ga-GB","gd","gl","gsw","gsw-FR","gsw-LI","gu","guz","gv","ha","ha-GH","ha-NE","haw","he","hi","hr","hr-BA","hsb","hu","hy","ia","id","ig","ii","is","it","it-CH","it-SM","it-VA","ja","jgo","jmc","jv","ka","kab","kam","kde","kea","kgp","khq","ki","kk","kkj","kl","kln","km","kn","ko","ko-KP","kok","ks","ks-Arab","ksb","ksf","ksh","ku","kw","ky","lag","lb","lg","lkt","ln","ln-AO","ln-CF","ln-CG","lo","lrc","lrc-IQ","lt","lu","luo","luy","lv","mai","mas","mas-TZ","mer","mfe","mg","mgh","mgo","mi","mk","ml","mn","mni","mni-Beng","mr","ms","ms-BN","ms-ID","ms-SG","mt","mua","my","mzn","naq","nb","nb-SJ","nd","nds","nds-NL","ne","ne-IN","nl","nl-AW","nl-BE","nl-BQ","nl-CW","nl-SR","nl-SX","nmg","nn","nnh","no","nus","nyn","om","om-KE","or","os","os-RU","pa","pa-Arab","pa-Guru","pcm","pl","ps","ps-PK","pt","pt-AO","pt-CH","pt-CV","pt-GQ","pt-GW","pt-LU","pt-MO","pt-MZ","pt-PT","pt-ST","pt-TL","qu","qu-BO","qu-EC","rm","rn","ro","ro-MD","rof","ru","ru-BY","ru-KG","ru-KZ","ru-MD","ru-UA","rw","rwk","sa","sah","saq","sat","sat-Olck","sbp","sc","sd","sd-Arab","sd-Deva","se","se-FI","se-SE","seh","ses","sg","shi","shi-Latn","shi-Tfng","si","sk","sl","smn","sn","so","so-DJ","so-ET","so-KE","sq","sq-MK","sq-XK","sr","sr-Cyrl","sr-Cyrl-BA","sr-Cyrl-ME","sr-Cyrl-XK","sr-Latn","sr-Latn-BA","sr-Latn-ME","sr-Latn-XK","su","su-Latn","sv","sv-AX","sv-FI","sw","sw-CD","sw-KE","sw-UG","ta","ta-LK","ta-MY","ta-SG","te","teo","teo-KE","tg","th","ti","ti-ER","tk","to","tr","tr-CY","tt","twq","tzm","ug","uk","und","ur","ur-IN","uz","uz-Arab","uz-Cyrl","uz-Latn","vai","vai-Latn","vai-Vaii","vi","vun","wae","wo","xh","xog","yav","yi","yo","yo-BJ","yrl","yrl-CO","yrl-VE","yue","yue-Hans","yue-Hant","zgh","zh","zh-Hans","zh-Hans-HK","zh-Hans-MO","zh-Hans-SG","zh-Hant","zh-Hant-HK","zh-Hant-MO","zu"]},4354:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.GetOperands=void 0;var r=n(8954);t.GetOperands=function(e){(0,r.invariant)("string"==typeof e,"GetOperands should have been called with a string");var t=(0,r.ToNumber)(e);(0,r.invariant)(isFinite(t),"n should be finite");var n,a,o,i=e.indexOf("."),l="";-1===i?(n=t,a=0,o=0):(n=e.slice(0,i),l=e.slice(i,e.length),a=(0,r.ToNumber)(l),o=l.length);var u,s,c=Math.abs((0,r.ToNumber)(n));if(0!==a){var f=l.replace(/0+$/,"");u=f.length,s=(0,r.ToNumber)(f)}else u=0,s=0;return{Number:t,IntegerDigits:c,NumberOfFractionDigits:o,NumberOfFractionDigitsWithoutTrailing:u,FractionDigits:a,FractionDigitsWithoutTrailing:s}}},468:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InitializePluralRules=void 0;var r=n(8954),a=n(983);t.InitializePluralRules=function(e,t,n,o){var i=o.availableLocales,l=o.relevantExtensionKeys,u=o.localeData,s=o.getDefaultLocale,c=o.getInternalSlots,f=(0,r.CanonicalizeLocaleList)(t),d=Object.create(null),p=(0,r.CoerceOptionsToObject)(n),h=c(e);h.initializedPluralRules=!0;var g=(0,r.GetOption)(p,"localeMatcher","string",["best fit","lookup"],"best fit");d.localeMatcher=g,h.type=(0,r.GetOption)(p,"type","string",["cardinal","ordinal"],"cardinal"),(0,r.SetNumberFormatDigitOptions)(h,p,0,3,"standard");var y=(0,a.ResolveLocale)(i,f,d,l,u,s);return h.locale=y.locale,e}},1737:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ResolvePlural=void 0;var r=n(8954),a=n(4354);t.ResolvePlural=function(e,t,n){var o=n.getInternalSlots,i=n.PluralRuleSelect,l=o(e);if((0,r.invariant)("Object"===(0,r.Type)(l),"pl has to be an object"),(0,r.invariant)("initializedPluralRules"in l,"pluralrules must be initialized"),(0,r.invariant)("Number"===(0,r.Type)(t),"n must be a number"),!isFinite(t))return"other";var u=l.locale,s=l.type,c=(0,r.FormatNumericToString)(l,t).formattedString;return i(u,s,t,(0,a.GetOperands)(c))}},6930:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new WeakMap;t.default=function(e){var t=n.get(e);return t||(t=Object.create(null),n.set(e,t)),t}},4109:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PluralRules=void 0;var r=n(655),a=n(8954),o=n(468),i=n(1737),l=r.__importDefault(n(6930));function u(e,t){if(!(e instanceof c))throw new TypeError("Method Intl.PluralRules.prototype.".concat(t," called on incompatible receiver ").concat(String(e)))}function s(e,t,n,r){var a=r.IntegerDigits,o=r.NumberOfFractionDigits,i=r.FractionDigits;return c.localeData[e].fn(o?"".concat(a,".").concat(i):a,"ordinal"===t)}var c=function(){function e(t,n){if(!(this&&this instanceof e?this.constructor:void 0))throw new TypeError("Intl.PluralRules must be called with 'new'");return(0,o.InitializePluralRules)(this,t,n,{availableLocales:e.availableLocales,relevantExtensionKeys:e.relevantExtensionKeys,localeData:e.localeData,getDefaultLocale:e.getDefaultLocale,getInternalSlots:l.default})}return e.prototype.resolvedOptions=function(){u(this,"resolvedOptions");var t=Object.create(null),n=(0,l.default)(this);return t.locale=n.locale,t.type=n.type,["minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits"].forEach((function(e){var r=n[e];void 0!==r&&(t[e]=r)})),t.pluralCategories=r.__spreadArray([],e.localeData[t.locale].categories[t.type],!0),t},e.prototype.select=function(e){u(this,"select");var t=(0,a.ToNumber)(e);return(0,i.ResolvePlural)(this,t,{getInternalSlots:l.default,PluralRuleSelect:s})},e.prototype.toString=function(){return"[object Intl.PluralRules]"},e.supportedLocalesOf=function(t,n){return(0,a.SupportedLocales)(e.availableLocales,(0,a.CanonicalizeLocaleList)(t),n)},e.__addLocaleData=function(){for(var t=[],n=0;n{"use strict";var r=n(4109);(0,n(7208).shouldPolyfill)()&&Object.defineProperty(Intl,"PluralRules",{value:r.PluralRules,writable:!0,enumerable:!1,configurable:!0})},7208:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shouldPolyfill=void 0;var r=n(983),a=n(1795);t.shouldPolyfill=function(e){if(void 0===e&&(e="en"),!("PluralRules"in Intl)||"one"===new Intl.PluralRules("en",{minimumFractionDigits:2}).select(1)||!function(e){if(!e)return!0;var t=Array.isArray(e)?e:[e];return Intl.PluralRules.supportedLocalesOf(t).length===t.length}(e))return e?(0,r.match)([e],a.supportedLocales,"en"):void 0}},1795:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.supportedLocales=void 0,t.supportedLocales=["af","ak","am","an","ar","ars","as","asa","ast","az","bal","be","bem","bez","bg","bho","bm","bn","bo","br","brx","bs","ca","ce","ceb","cgg","chr","ckb","cs","cy","da","de","doi","dsb","dv","dz","ee","el","en","eo","es","et","eu","fa","ff","fi","fil","fo","fr","fur","fy","ga","gd","gl","gsw","gu","guw","gv","ha","haw","he","hi","hnj","hr","hsb","hu","hy","ia","id","ig","ii","io","is","it","iu","ja","jbo","jgo","jmc","jv","jw","ka","kab","kaj","kcg","kde","kea","kk","kkj","kl","km","kn","ko","ks","ksb","ksh","ku","kw","ky","lag","lb","lg","lij","lkt","ln","lo","lt","lv","mas","mg","mgo","mk","ml","mn","mo","mr","ms","mt","my","nah","naq","nb","nd","ne","nl","nn","nnh","no","nqo","nr","nso","ny","nyn","om","or","os","osa","pa","pap","pcm","pl","prg","ps","pt","pt-PT","rm","ro","rof","ru","rwk","sah","saq","sat","sc","scn","sd","sdh","se","seh","ses","sg","sh","shi","si","sk","sl","sma","smi","smj","smn","sms","sn","so","sq","sr","ss","ssy","st","su","sv","sw","syr","ta","te","teo","th","ti","tig","tk","tl","tn","to","tpi","tr","ts","tzm","ug","uk","und","ur","uz","ve","vi","vo","vun","wa","wae","wo","xh","xog","yi","yo","yue","zh","zu"]},6484:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function evaluateStringMember(e,t){for(var n=splitWithEscape(t,".","\\"),r=0,a=n.length;revaluateStringMember})},3878:(e,t,n)=>{"use strict";function r(){}function a(){}n.d(t,{g:()=>a,i:()=>r})},9742:(e,t)=>{"use strict";t.byteLength=function(e){var t=u(e),n=t[0],r=t[1];return 3*(n+r)/4-r},t.toByteArray=function(e){var t,n,o=u(e),i=o[0],l=o[1],s=new a(function(e,t,n){return 3*(t+n)/4-n}(0,i,l)),c=0,f=l>0?i-4:i;for(n=0;n>16&255,s[c++]=t>>8&255,s[c++]=255&t;return 2===l&&(t=r[e.charCodeAt(n)]<<2|r[e.charCodeAt(n+1)]>>4,s[c++]=255&t),1===l&&(t=r[e.charCodeAt(n)]<<10|r[e.charCodeAt(n+1)]<<4|r[e.charCodeAt(n+2)]>>2,s[c++]=t>>8&255,s[c++]=255&t),s},t.fromByteArray=function(e){for(var t,r=e.length,a=r%3,o=[],i=16383,l=0,u=r-a;lu?u:l+i));return 1===a?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===a&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")};for(var n=[],r=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,l=o.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function s(e,t,r){for(var a,o,i=[],l=t;l>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return i.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},8764:(e,t,n)=>{"use strict";const r=n(9742),a=n(645),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const i=2147483647;function l(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return s(e,t,n)}function s(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const n=0|g(e,t);let r=l(n);const a=r.write(e,t);return a!==n&&(r=r.slice(0,a)),r}(e,t);if(ArrayBuffer.isView(e))return function(e){if($(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return p(e,t,n);if("undefined"!=typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return p(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return u.from(r,t,n);const a=function(e){if(u.isBuffer(e)){const t=0|h(e.length),n=l(t);return 0===n.length||e.copy(n,0,0,t),n}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?l(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return c(e),l(e<0?0:0|h(e))}function d(e){const t=e.length<0?0:0|h(e.length),n=l(t);for(let r=0;r=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function g(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;let a=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return V(e).length;default:if(a)return r?-1:K(e).length;t=(""+t).toLowerCase(),a=!0}}function y(e,t,n){let r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,n);case"utf8":case"utf-8":return R(this,t,n);case"ascii":return A(this,t,n);case"latin1":case"binary":return _(this,t,n);case"base64":return C(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function m(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function b(e,t,n,r,a){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Y(n=+n)&&(n=a?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(a)return-1;n=e.length-1}else if(n<0){if(!a)return-1;n=0}if("string"==typeof t&&(t=u.from(t,r)),u.isBuffer(t))return 0===t.length?-1:v(e,t,n,r,a);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?a?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):v(e,[t],n,r,a);throw new TypeError("val must be string, number or Buffer")}function v(e,t,n,r,a){let o,i=1,l=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;i=2,l/=2,u/=2,n/=2}function s(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){let r=-1;for(o=n;ol&&(n=l-u),o=n;o>=0;o--){let n=!0;for(let r=0;ra&&(r=a):r=a;const o=t.length;let i;for(r>o/2&&(r=o/2),i=0;i>8,a=n%256,o.push(a),o.push(r);return o}(t,e.length-n),e,n,r)}function C(e,t,n){return 0===t&&n===e.length?r.fromByteArray(e):r.fromByteArray(e.slice(t,n))}function R(e,t,n){n=Math.min(e.length,n);const r=[];let a=t;for(;a239?4:t>223?3:t>191?2:1;if(a+i<=n){let n,r,l,u;switch(i){case 1:t<128&&(o=t);break;case 2:n=e[a+1],128==(192&n)&&(u=(31&t)<<6|63&n,u>127&&(o=u));break;case 3:n=e[a+1],r=e[a+2],128==(192&n)&&128==(192&r)&&(u=(15&t)<<12|(63&n)<<6|63&r,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:n=e[a+1],r=e[a+2],l=e[a+3],128==(192&n)&&128==(192&r)&&128==(192&l)&&(u=(15&t)<<18|(63&n)<<12|(63&r)<<6|63&l,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,i=1):o>65535&&(o-=65536,r.push(o>>>10&1023|55296),o=56320|1023&o),r.push(o),a+=i}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let n="",r=0;for(;rr.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(r,a)):Uint8Array.prototype.set.call(r,t,a);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(r,a)}a+=t.length}return r},u.byteLength=g,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tn&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,n,r,a){if($(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===a&&(a=this.length),t<0||n>e.length||r<0||a>this.length)throw new RangeError("out of range index");if(r>=a&&t>=n)return 0;if(r>=a)return-1;if(t>=n)return 1;if(this===e)return 0;let o=(a>>>=0)-(r>>>=0),i=(n>>>=0)-(t>>>=0);const l=Math.min(o,i),s=this.slice(r,a),c=e.slice(t,n);for(let e=0;e>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}const a=this.length-t;if((void 0===n||n>a)&&(n=a),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let o=!1;for(;;)switch(r){case"hex":return w(this,e,t,n);case"utf8":case"utf-8":return S(this,e,t,n);case"ascii":case"latin1":case"binary":return k(this,e,t,n);case"base64":return L(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function A(e,t,n){let r="";n=Math.min(e.length,n);for(let a=t;ar)&&(n=r);let a="";for(let r=t;rn)throw new RangeError("Trying to access beyond buffer length")}function M(e,t,n,r,a,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>a||te.length)throw new RangeError("Index out of range")}function Z(e,t,n,r,a){U(t,r,a,e,n,7);let o=Number(t&BigInt(4294967295));e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o,o>>=8,e[n++]=o;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,i>>=8,e[n++]=i,n}function T(e,t,n,r,a){U(t,r,a,e,n,7);let o=Number(t&BigInt(4294967295));e[n+7]=o,o>>=8,e[n+6]=o,o>>=8,e[n+5]=o,o>>=8,e[n+4]=o;let i=Number(t>>BigInt(32)&BigInt(4294967295));return e[n+3]=i,i>>=8,e[n+2]=i,i>>=8,e[n+1]=i,i>>=8,e[n]=i,n+8}function D(e,t,n,r,a,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function I(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,4),a.write(e,t,n,r,23,4),n+4}function j(e,t,n,r,o){return t=+t,n>>>=0,o||D(e,0,n,8),a.write(e,t,n,r,52,8),n+8}u.prototype.slice=function(e,t){const n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e],a=1,o=0;for(;++o>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e+--t],a=1;for(;t>0&&(a*=256);)r+=this[e+--t]*a;return r},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=Q((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,a=this[++e]+256*this[++e]+65536*this[++e]+n*2**24;return BigInt(r)+(BigInt(a)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=t*2**24+65536*this[++e]+256*this[++e]+this[++e],a=this[++e]*2**24+65536*this[++e]+256*this[++e]+n;return(BigInt(r)<>>=0,t>>>=0,n||O(e,t,this.length);let r=this[e],a=1,o=0;for(;++o=a&&(r-=Math.pow(2,8*t)),r},u.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||O(e,t,this.length);let r=t,a=1,o=this[e+--r];for(;r>0&&(a*=256);)o+=this[e+--r]*a;return a*=128,o>=a&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);const n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);const n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=Q((function(e){G(e>>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=this[e+4]+256*this[e+5]+65536*this[e+6]+(n<<24);return(BigInt(r)<>>=0,"offset");const t=this[e],n=this[e+7];void 0!==t&&void 0!==n||H(e,this.length-8);const r=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(r)<>>=0,t||O(e,4,this.length),a.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),a.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),a.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);let a=1,o=0;for(this[t]=255&e;++o>>=0,n>>>=0,r||M(this,e,t,n,Math.pow(2,8*n)-1,0);let a=n-1,o=1;for(this[t+a]=255&e;--a>=0&&(o*=256);)this[t+a]=e/o&255;return t+n},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=Q((function(e,t=0){return Z(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=Q((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}let a=0,o=1,i=0;for(this[t]=255&e;++a>0)-i&255;return t+n},u.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){const r=Math.pow(2,8*n-1);M(this,e,t,n,r-1,-r)}let a=n-1,o=1,i=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===i&&0!==this[t+a+1]&&(i=1),this[t+a]=(e/o>>0)-i&255;return t+n},u.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||M(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=Q((function(e,t=0){return Z(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=Q((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,n){return I(this,e,t,!0,n)},u.prototype.writeFloatBE=function(e,t,n){return I(this,e,t,!1,n)},u.prototype.writeDoubleLE=function(e,t,n){return j(this,e,t,!0,n)},u.prototype.writeDoubleBE=function(e,t,n){return j(this,e,t,!1,n)},u.prototype.copy=function(e,t,n,r){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a=r+4;n-=3)t=`_${e.slice(n-3,n)}${t}`;return`${e.slice(0,n)}${t}`}function U(e,t,n,r,a,o){if(e>n||e3?0===t||t===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(o+1)}${r}`:`>= -(2${r} ** ${8*(o+1)-1}${r}) and < 2 ** ${8*(o+1)-1}${r}`:`>= ${t}${r} and <= ${n}${r}`,new B.ERR_OUT_OF_RANGE("value",a,e)}!function(e,t,n){G(t,"offset"),void 0!==e[t]&&void 0!==e[t+n]||H(t,e.length-(n+1))}(r,a,o)}function G(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function H(e,t,n){if(Math.floor(e)!==e)throw G(e,n),new B.ERR_OUT_OF_RANGE(n||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(n||"offset",`>= ${n?1:0} and <= ${t}`,e)}F("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),F("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),F("ERR_OUT_OF_RANGE",(function(e,t,n){let r=`The value of "${e}" is out of range.`,a=n;return Number.isInteger(n)&&Math.abs(n)>2**32?a=z(String(n)):"bigint"==typeof n&&(a=String(n),(n>BigInt(2)**BigInt(32)||n<-(BigInt(2)**BigInt(32)))&&(a=z(a)),a+="n"),r+=` It must be ${t}. Received ${a}`,r}),RangeError);const W=/[^+/0-9A-Za-z-_]/g;function K(e,t){let n;t=t||1/0;const r=e.length;let a=null;const o=[];for(let i=0;i55295&&n<57344){if(!a){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(i+1===r){(t-=3)>-1&&o.push(239,191,189);continue}a=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),a=n;continue}n=65536+(a-55296<<10|n-56320)}else a&&(t-=3)>-1&&o.push(239,191,189);if(a=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function V(e){return r.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function q(e,t,n,r){let a;for(a=0;a=t.length||a>=e.length);++a)t[a+n]=e[a];return a}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const X=function(){const e="0123456789abcdef",t=new Array(256);for(let n=0;n<16;++n){const r=16*n;for(let a=0;a<16;++a)t[r+a]=e[n]+e[a]}return t}();function Q(e){return"undefined"==typeof BigInt?J:e}function J(){throw new Error("BigInt not supported")}},1924:(e,t,n)=>{"use strict";var r=n(210),a=n(5559),o=a(r("String.prototype.indexOf"));e.exports=function(e,t){var n=r(e,!!t);return"function"==typeof n&&o(e,".prototype.")>-1?a(n):n}},5559:(e,t,n)=>{"use strict";var r=n(8612),a=n(210),o=a("%Function.prototype.apply%"),i=a("%Function.prototype.call%"),l=a("%Reflect.apply%",!0)||r.call(i,o),u=a("%Object.getOwnPropertyDescriptor%",!0),s=a("%Object.defineProperty%",!0),c=a("%Math.max%");if(s)try{s({},"a",{value:1})}catch(e){s=null}e.exports=function(e){var t=l(r,i,arguments);if(u&&s){var n=u(t,"length");n.configurable&&s(t,"length",{value:1+c(0,e.length-(arguments.length-1))})}return t};var f=function(){return l(r,o,arguments)};s?s(e.exports,"apply",{value:f}):e.exports.apply=f},6497:(e,t,n)=>{function r(e){return Object.prototype.toString.call(e)}t.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===r(e)},t.isBoolean=function(e){return"boolean"==typeof e},t.isNull=function(e){return null===e},t.isNullOrUndefined=function(e){return null==e},t.isNumber=function(e){return"number"==typeof e},t.isString=function(e){return"string"==typeof e},t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=function(e){return void 0===e},t.isRegExp=function(e){return"[object RegExp]"===r(e)},t.isObject=function(e){return"object"==typeof e&&null!==e},t.isDate=function(e){return"[object Date]"===r(e)},t.isError=function(e){return"[object Error]"===r(e)||e instanceof Error},t.isFunction=function(e){return"function"==typeof e},t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(8764).Buffer.isBuffer},4422:(e,t,n)=>{"use strict";var r=n(3107);function a(e,t,n){void 0===n&&(n=t,t=e,e=null),r.Duplex.call(this,e),"function"!=typeof n.read&&(n=new r.Readable(e).wrap(n)),this._writable=t,this._readable=n,this._waiting=!1;var a=this;t.once("finish",(function(){a.end()})),this.once("finish",(function(){t.end()})),n.on("readable",(function(){a._waiting&&(a._waiting=!1,a._read())})),n.once("end",(function(){a.push(null)})),e&&void 0!==e.bubbleErrors&&!e.bubbleErrors||(t.on("error",(function(e){a.emit("error",e)})),n.on("error",(function(e){a.emit("error",e)})))}a.prototype=Object.create(r.Duplex.prototype,{constructor:{value:a}}),a.prototype._write=function(e,t,n){this._writable.write(e,t,n)},a.prototype._read=function(){for(var e,t=0;null!==(e=this._readable.read());)this.push(e),t++;0===t&&(this._waiting=!0)},e.exports=function(e,t,n){return new a(e,t,n)},e.exports.DuplexWrapper=a},8566:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},9496:(e,t,n)=>{"use strict";var r=n(8212),a=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};e.exports=f;var o=Object.create(n(6497));o.inherits=n(4378);var i=n(3782),l=n(1690);o.inherits(f,i);for(var u=a(l.prototype),s=0;s{"use strict";e.exports=o;var r=n(5767),a=Object.create(n(6497));function o(e){if(!(this instanceof o))return new o(e);r.call(this,e)}a.inherits=n(4378),a.inherits(o,r),o.prototype._transform=function(e,t,n){n(null,e)}},3782:(e,t,n)=>{"use strict";var r=n(4155),a=n(8212);e.exports=v;var o,i=n(8566);v.ReadableState=b,n(7187).EventEmitter;var l=function(e,t){return e.listeners(t).length},u=n(5823),s=n(9509).Buffer,c=n.g.Uint8Array||function(){},f=Object.create(n(6497));f.inherits=n(4378);var d=n(9539),p=void 0;p=d&&d.debuglog?d.debuglog("stream"):function(){};var h,g=n(72),y=n(5974);f.inherits(v,u);var m=["error","close","destroy","pause","resume"];function b(e,t){e=e||{};var r=t instanceof(o=o||n(9496));this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var a=e.highWaterMark,i=e.readableHighWaterMark,l=this.objectMode?16:16384;this.highWaterMark=a||0===a?a:r&&(i||0===i)?i:l,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(h||(h=n(3597).s),this.decoder=new h(e.encoding),this.encoding=e.encoding)}function v(e){if(o=o||n(9496),!(this instanceof v))return new v(e);this._readableState=new b(e,this),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),u.call(this)}function w(e,t,n,r,a){var o,i=e._readableState;return null===t?(i.reading=!1,function(e,t){if(!t.ended){if(t.decoder){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,E(e)}}(e,i)):(a||(o=function(e,t){var n,r;return r=t,s.isBuffer(r)||r instanceof c||"string"==typeof t||void 0===t||e.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}(i,t)),o?e.emit("error",o):i.objectMode||t&&t.length>0?("string"==typeof t||i.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=function(e){return s.from(e)}(t)),r?i.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):S(e,i,t,!0):i.ended?e.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!n?(t=i.decoder.write(t),i.objectMode||0!==t.length?S(e,i,t,!1):R(e,i)):S(e,i,t,!1))):r||(i.reading=!1)),function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=k?e=k:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function E(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(p("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?a.nextTick(C,e):C(e))}function C(e){p("emit readable"),e.emit("readable"),x(e)}function R(e,t){t.readingMore||(t.readingMore=!0,a.nextTick(N,e,t))}function N(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(n=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):n=function(e,t,n){var r;return eo.length?o.length:e;if(i===o.length?a+=o:a+=o.slice(0,e),0==(e-=i)){i===o.length?(++r,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(i));break}++r}return t.length-=r,a}(e,t):function(e,t){var n=s.allocUnsafe(e),r=t.head,a=1;for(r.data.copy(n),e-=r.data.length;r=r.next;){var o=r.data,i=e>o.length?o.length:e;if(o.copy(n,n.length-e,0,i),0==(e-=i)){i===o.length?(++a,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(i));break}++a}return t.length-=a,n}(e,t),r}(e,t.buffer,t.decoder),n);var n}function O(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,a.nextTick(M,t,e))}function M(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function Z(e,t){for(var n=0,r=e.length;n=t.highWaterMark||t.ended))return p("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?O(this):E(this),null;if(0===(e=L(e,t))&&t.ended)return 0===t.length&&O(this),null;var r,a=t.needReadable;return p("need readable",a),(0===t.length||t.length-e0?P(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),n!==e&&t.ended&&O(this)),null!==r&&this.emit("data",r),r},v.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},v.prototype.pipe=function(e,t){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=e;break;case 1:o.pipes=[o.pipes,e];break;default:o.pipes.push(e)}o.pipesCount+=1,p("pipe count=%d opts=%j",o.pipesCount,t);var u=t&&!1===t.end||e===r.stdout||e===r.stderr?b:s;function s(){p("onend"),e.end()}o.endEmitted?a.nextTick(u):n.once("end",u),e.on("unpipe",(function t(r,a){p("onunpipe"),r===n&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,p("cleanup"),e.removeListener("close",y),e.removeListener("finish",m),e.removeListener("drain",c),e.removeListener("error",g),e.removeListener("unpipe",t),n.removeListener("end",s),n.removeListener("end",b),n.removeListener("data",h),f=!0,!o.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;p("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(e,"data")&&(t.flowing=!0,x(e))}}(n);e.on("drain",c);var f=!1,d=!1;function h(t){p("ondata"),d=!1,!1!==e.write(t)||d||((1===o.pipesCount&&o.pipes===e||o.pipesCount>1&&-1!==Z(o.pipes,e))&&!f&&(p("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function g(t){p("onerror",t),b(),e.removeListener("error",g),0===l(e,"error")&&e.emit("error",t)}function y(){e.removeListener("finish",m),b()}function m(){p("onfinish"),e.removeListener("close",y),b()}function b(){p("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,n){if("function"==typeof e.prependListener)return e.prependListener(t,n);e._events&&e._events.error?i(e._events.error)?e._events.error.unshift(n):e._events.error=[n,e._events.error]:e.on(t,n)}(e,"error",g),e.once("close",y),e.once("finish",m),e.emit("pipe",n),o.flowing||(p("pipe resume"),n.resume()),e},v.prototype.unpipe=function(e){var t=this._readableState,n={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,n)),this;if(!e){var r=t.pipes,a=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o{"use strict";e.exports=i;var r=n(9496),a=Object.create(n(6497));function o(e,t){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(!r)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=t&&this.push(t),r(e);var a=this._readableState;a.reading=!1,(a.needReadable||a.length{"use strict";var r=n(4155),a=n(8212);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,n){var r=e.entry;for(e.entry=null;r;){var a=r.callback;t.pendingcb--,a(undefined),r=r.next}t.corkedRequestsFree?t.corkedRequestsFree.next=e:t.corkedRequestsFree=e}(t,e)}}e.exports=m;var i,l=!r.browser&&["v0.10","v0.9."].indexOf(r.version.slice(0,5))>-1?setImmediate:a.nextTick;m.WritableState=y;var u=Object.create(n(6497));u.inherits=n(4378);var s,c={deprecate:n(1159)},f=n(5823),d=n(9509).Buffer,p=n.g.Uint8Array||function(){},h=n(5974);function g(){}function y(e,t){i=i||n(9496),e=e||{};var r=t instanceof i;this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var u=e.highWaterMark,s=e.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=u||0===u?u:r&&(s||0===s)?s:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var f=!1===e.decodeStrings;this.decodeStrings=!f,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(a.nextTick(o,r),a.nextTick(L,e,t),e._writableState.errorEmitted=!0,e.emit("error",r)):(o(r),e._writableState.errorEmitted=!0,e.emit("error",r),L(e,t))}(e,n,r,t,o);else{var i=S(n);i||n.corked||n.bufferProcessing||!n.bufferedRequest||w(e,n),r?l(v,e,n,i,o):v(e,n,i,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function m(e){if(i=i||n(9496),!(s.call(m,this)||this instanceof i))return new m(e);this._writableState=new y(e,this),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),f.call(this)}function b(e,t,n,r,a,o,i){t.writelen=r,t.writecb=i,t.writing=!0,t.sync=!0,n?e._writev(a,t.onwrite):e._write(a,o,t.onwrite),t.sync=!1}function v(e,t,n,r){n||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,r(),L(e,t)}function w(e,t){t.bufferProcessing=!0;var n=t.bufferedRequest;if(e._writev&&n&&n.next){var r=t.bufferedRequestCount,a=new Array(r),i=t.corkedRequestsFree;i.entry=n;for(var l=0,u=!0;n;)a[l]=n,n.isBuf||(u=!1),n=n.next,l+=1;a.allBuffers=u,b(e,t,!0,t.length,a,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;n;){var s=n.chunk,c=n.encoding,f=n.callback;if(b(e,t,!1,t.objectMode?1:s.length,s,c,f),n=n.next,t.bufferedRequestCount--,t.writing)break}null===n&&(t.lastBufferedRequest=null)}t.bufferedRequest=n,t.bufferProcessing=!1}function S(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function k(e,t){e._final((function(n){t.pendingcb--,n&&e.emit("error",n),t.prefinished=!0,e.emit("prefinish"),L(e,t)}))}function L(e,t){var n=S(t);return n&&(function(e,t){t.prefinished||t.finalCalled||("function"==typeof e._final?(t.pendingcb++,t.finalCalled=!0,a.nextTick(k,e,t)):(t.prefinished=!0,e.emit("prefinish")))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"))),n}u.inherits(m,f),y.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(y.prototype,"buffer",{get:c.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===m&&e&&e._writableState instanceof y}})):s=function(e){return e instanceof this},m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},m.prototype.write=function(e,t,n){var r,o=this._writableState,i=!1,l=!o.objectMode&&(r=e,d.isBuffer(r)||r instanceof p);return l&&!d.isBuffer(e)&&(e=function(e){return d.from(e)}(e)),"function"==typeof t&&(n=t,t=null),l?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=g),o.ended?function(e,t){var n=new Error("write after end");e.emit("error",n),a.nextTick(t,n)}(this,n):(l||function(e,t,n,r){var o=!0,i=!1;return null===n?i=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||t.objectMode||(i=new TypeError("Invalid non-string/buffer chunk")),i&&(e.emit("error",i),a.nextTick(r,i),o=!1),o}(this,o,e,n))&&(o.pendingcb++,i=function(e,t,n,r,a,o){if(!n){var i=function(e,t,n){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=d.from(t,n)),t}(t,r,a);r!==i&&(n=!0,a="buffer",r=i)}var l=t.objectMode?1:r.length;t.length+=l;var u=t.length-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),m.prototype._write=function(e,t,n){n(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(e,t,n){var r=this._writableState;"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||function(e,t,n){t.ending=!0,L(e,t),n&&(t.finished?a.nextTick(n):e.once("finish",n)),t.ended=!0,e.writable=!1}(this,r,n)},Object.defineProperty(m.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),m.prototype.destroy=h.destroy,m.prototype._undestroy=h.undestroy,m.prototype._destroy=function(e,t){this.end(),t(e)}},72:(e,t,n)=>{"use strict";var r=n(9509).Buffer,a=n(9539);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,n=""+t.data;t=t.next;)n+=e+t.data;return n},e.prototype.concat=function(e){if(0===this.length)return r.alloc(0);if(1===this.length)return this.head.data;for(var t,n,a=r.allocUnsafe(e>>>0),o=this.head,i=0;o;)t=a,n=i,o.data.copy(t,n),i+=o.data.length,o=o.next;return a},e}(),a&&a.inspect&&a.inspect.custom&&(e.exports.prototype[a.inspect.custom]=function(){var e=a.inspect({length:this.length});return this.constructor.name+" "+e})},5974:(e,t,n)=>{"use strict";var r=n(8212);function a(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var n=this,o=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return o||i?(t?t(e):!e||this._writableState&&this._writableState.errorEmitted||r.nextTick(a,this,e),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?(r.nextTick(a,n,e),n._writableState&&(n._writableState.errorEmitted=!0)):t&&t(e)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},5823:(e,t,n)=>{e.exports=n(2830)},3107:(e,t,n)=>{var r=n(4155),a=n(2830);"disable"===r.env.READABLE_STREAM&&a?(e.exports=a,(t=e.exports=a.Readable).Readable=a.Readable,t.Writable=a.Writable,t.Duplex=a.Duplex,t.Transform=a.Transform,t.PassThrough=a.PassThrough,t.Stream=a):((t=e.exports=n(3782)).Stream=a||t,t.Readable=t,t.Writable=n(1690),t.Duplex=n(9496),t.Transform=n(5767),t.PassThrough=n(4480))},3597:(e,t,n)=>{"use strict";var r=n(9509).Buffer,a=r.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(r.isEncoding===a||!a(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=s,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=c,this.end=f,t=3;break;default:return this.write=d,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(t)}function i(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,n=function(e,t,n){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==n?n:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var n=e.toString("utf16le",t);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function s(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,n)}return t}function c(e,t){var n=(e.length-t)%3;return 0===n?e.toString("base64",t):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-n))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function d(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.s=o,o.prototype.write=function(e){if(0===e.length)return"";var t,n;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0?(a>0&&(e.lastNeed=a-1),a):--r=0?(a>0&&(e.lastNeed=a-2),a):--r=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=n;var r=e.length-(n-this.lastNeed);return e.copy(this.lastChar,0,r),e.toString("utf8",t,r)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7187:e=>{"use strict";var t,n="object"==typeof Reflect?Reflect:null,r=n&&"function"==typeof n.apply?n.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};t=n&&"function"==typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(n,r){function a(n){e.removeListener(t,o),r(n)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",a),n([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t,n){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,a)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var i=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function s(e,t,n,r){var a,o,i,s;if(l(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),i=o[t]),void 0===i)i=o[t]=n,++e._eventsCount;else if("function"==typeof i?i=o[t]=r?[n,i]:[i,n]:r?i.unshift(n):i.push(n),(a=u(e))>0&&i.length>a&&!i.warned){i.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+i.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=i.length,s=c,console&&console.warn&&console.warn(s)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},a=c.bind(r);return a.listener=n,r.wrapFn=a,a}function d(e,t,n){var r=e._events;if(void 0===r)return[];var a=r[t];return void 0===a?[]:"function"==typeof a?n?[a.listener||a]:[a]:n?function(e){for(var t=new Array(e.length),n=0;n0&&(i=t[0]),i instanceof Error)throw i;var l=new Error("Unhandled error."+(i?" ("+i.message+")":""));throw l.context=i,l}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)r(u,this,t);else{var s=u.length,c=h(u,s);for(n=0;n=0;o--)if(n[o]===t||n[o].listener===t){i=n[o].listener,a=o;break}if(a<0)return this;0===a?n.shift():function(e,t){for(;t+1=0;r--)this.removeListener(e,t[r]);return this},o.prototype.listeners=function(e){return d(this,e,!0)},o.prototype.rawListeners=function(e){return d(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},o.prototype.listenerCount=p,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},4029:(e,t,n)=>{"use strict";var r=n(5320),a=Object.prototype.toString,o=Object.prototype.hasOwnProperty,i=function(e,t,n){for(var r=0,a=e.length;r=3&&(o=n),"[object Array]"===a.call(e)?i(e,t,o):"string"==typeof e?l(e,t,o):u(e,t,o)}},7648:e=>{"use strict";var t="Function.prototype.bind called on incompatible ",n=Array.prototype.slice,r=Object.prototype.toString,a="[object Function]";e.exports=function(e){var o=this;if("function"!=typeof o||r.call(o)!==a)throw new TypeError(t+o);for(var i,l=n.call(arguments,1),u=function(){if(this instanceof i){var t=o.apply(this,l.concat(n.call(arguments)));return Object(t)===t?t:this}return o.apply(e,l.concat(n.call(arguments)))},s=Math.max(0,o.length-l.length),c=[],f=0;f{"use strict";var r=n(7648);e.exports=Function.prototype.bind||r},210:(e,t,n)=>{"use strict";var r,a=SyntaxError,o=Function,i=TypeError,l=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},u=Object.getOwnPropertyDescriptor;if(u)try{u({},"")}catch(e){u=null}var s=function(){throw new i},c=u?function(){try{return s}catch(e){try{return u(arguments,"callee").get}catch(e){return s}}}():s,f=n(1405)(),d=Object.getPrototypeOf||function(e){return e.__proto__},p={},h="undefined"==typeof Uint8Array?r:d(Uint8Array),g={"%AggregateError%":"undefined"==typeof AggregateError?r:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?r:ArrayBuffer,"%ArrayIteratorPrototype%":f?d([][Symbol.iterator]()):r,"%AsyncFromSyncIteratorPrototype%":r,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?r:Atomics,"%BigInt%":"undefined"==typeof BigInt?r:BigInt,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?r:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?r:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?r:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?r:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?r:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?r:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?r:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":f?d(d([][Symbol.iterator]())):r,"%JSON%":"object"==typeof JSON?JSON:r,"%Map%":"undefined"==typeof Map?r:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&f?d((new Map)[Symbol.iterator]()):r,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?r:Promise,"%Proxy%":"undefined"==typeof Proxy?r:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?r:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?r:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&f?d((new Set)[Symbol.iterator]()):r,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?r:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":f?d(""[Symbol.iterator]()):r,"%Symbol%":f?Symbol:r,"%SyntaxError%":a,"%ThrowTypeError%":c,"%TypedArray%":h,"%TypeError%":i,"%Uint8Array%":"undefined"==typeof Uint8Array?r:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?r:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?r:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?r:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?r:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?r:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?r:WeakSet},y=function e(t){var n;if("%AsyncFunction%"===t)n=l("async function () {}");else if("%GeneratorFunction%"===t)n=l("function* () {}");else if("%AsyncGeneratorFunction%"===t)n=l("async function* () {}");else if("%AsyncGenerator%"===t){var r=e("%AsyncGeneratorFunction%");r&&(n=r.prototype)}else if("%AsyncIteratorPrototype%"===t){var a=e("%AsyncGenerator%");a&&(n=d(a.prototype))}return g[t]=n,n},m={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},b=n(8612),v=n(7642),w=b.call(Function.call,Array.prototype.concat),S=b.call(Function.apply,Array.prototype.splice),k=b.call(Function.call,String.prototype.replace),L=b.call(Function.call,String.prototype.slice),E=b.call(Function.call,RegExp.prototype.exec),C=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,R=/\\(\\)?/g,N=function(e){var t=L(e,0,1),n=L(e,-1);if("%"===t&&"%"!==n)throw new a("invalid intrinsic syntax, expected closing `%`");if("%"===n&&"%"!==t)throw new a("invalid intrinsic syntax, expected opening `%`");var r=[];return k(e,C,(function(e,t,n,a){r[r.length]=n?k(a,R,"$1"):t||e})),r},A=function(e,t){var n,r=e;if(v(m,r)&&(r="%"+(n=m[r])[0]+"%"),v(g,r)){var o=g[r];if(o===p&&(o=y(r)),void 0===o&&!t)throw new i("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:r,value:o}}throw new a("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new i("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new i('"allowMissing" argument must be a boolean');if(null===E(/^%?[^%]*%?$/g,e))throw new a("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=N(e),r=n.length>0?n[0]:"",o=A("%"+r+"%",t),l=o.name,s=o.value,c=!1,f=o.alias;f&&(r=f[0],S(n,w([0,1],f)));for(var d=1,p=!0;d=n.length){var b=u(s,h);s=(p=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[h]}else p=v(s,h),s=s[h];p&&!c&&(g[l]=s)}}return s}},1405:(e,t,n)=>{"use strict";var r="undefined"!=typeof Symbol&&Symbol,a=n(5419);e.exports=function(){return"function"==typeof r&&"function"==typeof Symbol&&"symbol"==typeof r("foo")&&"symbol"==typeof Symbol("bar")&&a()}},5419:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),n=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(n))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var r=Object.getOwnPropertySymbols(e);if(1!==r.length||r[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var a=Object.getOwnPropertyDescriptor(e,t);if(42!==a.value||!0!==a.enumerable)return!1}return!0}},6410:(e,t,n)=>{"use strict";var r=n(5419);e.exports=function(){return r()&&!!Symbol.toStringTag}},7642:(e,t,n)=>{"use strict";var r=n(8612);e.exports=r.call(Function.call,Object.prototype.hasOwnProperty)},1346:(e,t,n)=>{var r=n(8764).Buffer,a=n(5558),o=n(1451).Transform;n(4378)(p,o),e.exports=p;var i="<".charCodeAt(0),l=">".charCodeAt(0),u="/".charCodeAt(0),s='"'.charCodeAt(0),c="'".charCodeAt(0),f="=".charCodeAt(0),d={endScript:a("")};function p(){if(!(this instanceof p))return new p;o.call(this),this._readableState.objectMode=!0,this.state="text",this.tagState=null,this.quoteState=null,this.raw=null,this.buffers=[],this._last=[]}function h(e,t){if(e.length=0&&r>=0;n--,r--)if(g(e[n])!==g(t[r]))return!1;return!0}function g(e){return e>=65&&e<=90?e+32:e}function y(e){return 32===e||9===e||10===e||12===e||13===e}p.prototype._transform=function(e,t,n){var a=0,o=0;for(this._prev&&(e=r.concat([this._prev,e]),a=this._prev.length-1,o=this._offset,this._prev=null,this._offset=0);a9&&this._last.shift(),this.raw){var g=this._testRaw(e,o,a);g&&(this.push(["text",g[0]]),this.raw===d.endComment||this.raw===d.endCdata?(this.state="text",this.buffers=[],this.push(["close",g[1]])):(this.state="open",this.buffers=[g[1]]),this.raw=null,o=a+1)}else{if("text"===this.state&&p===i&&a===e.length-1)return this._prev=e,this._offset=o,n();if("text"!==this.state||p!==i||y(e[a+1]))if(1===this.tagState&&y(p))this.tagState=2;else if(2===this.tagState&&p===f)this.tagState=3;else if(3===this.tagState&&y(p));else if(3===this.tagState&&p!==l)this.tagState=4,this.quoteState=p===s?"double":p===c?"single":null;else if(4===this.tagState&&!this.quoteState&&y(p))this.tagState=2;else if(4===this.tagState&&"double"===this.quoteState&&p===s)this.quoteState=null,this.tagState=2;else if(4===this.tagState&&"single"===this.quoteState&&p===c)this.quoteState=null,this.tagState=2;else if("open"!==this.state||p!==l||this.quoteState)"open"===this.state&&h(this._last,d.comment)?(this.buffers.push(e.slice(o,a+1)),o=a+1,this.state="text",this.raw=d.endComment,this._pushState("open")):"open"===this.state&&h(this._last,d.cdata)&&(this.buffers.push(e.slice(o,a+1)),o=a+1,this.state="text",this.raw=d.endCdata,this._pushState("open"));else if(this.buffers.push(e.slice(o,a+1)),o=a+1,this.state="text",this.tagState=null,this._getChar(1)===u)this._pushState("close");else{var m=this._getTag();"script"===m&&(this.raw=d.endScript),"style"===m&&(this.raw=d.endStyle),"title"===m&&(this.raw=d.endTitle),this._pushState("open")}else a>0&&a-o>0&&this.buffers.push(e.slice(o,a)),o=a,this.state="open",this.tagState=1,this._pushState("text")}}oe)return r[e-t];t+=r}},p.prototype._getTag=function(){for(var e=0,t="",n=0;n{var r=n(8764).Buffer,a=Object.prototype.toString,o="function"==typeof r.alloc&&"function"==typeof r.allocUnsafe&&"function"==typeof r.from;e.exports=function(e,t,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return i=e,"ArrayBuffer"===a.call(i).slice(8,-1)?function(e,t,n){t>>>=0;var a=e.byteLength-t;if(a<0)throw new RangeError("'offset' is out of bounds");if(void 0===n)n=a;else if((n>>>=0)>a)throw new RangeError("'length' is out of bounds");return o?r.from(e.slice(t,t+n)):new r(new Uint8Array(e.slice(t,t+n)))}(e,t,n):"string"==typeof e?function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!r.isEncoding(t))throw new TypeError('"encoding" must be a valid string encoding');return o?r.from(e,t):new r(e,t)}(e,t):o?r.from(e):new r(e);var i}},645:(e,t)=>{t.read=function(e,t,n,r,a){var o,i,l=8*a-r-1,u=(1<>1,c=-7,f=n?a-1:0,d=n?-1:1,p=e[t+f];for(f+=d,o=p&(1<<-c)-1,p>>=-c,c+=l;c>0;o=256*o+e[t+f],f+=d,c-=8);for(i=o&(1<<-c)-1,o>>=-c,c+=r;c>0;i=256*i+e[t+f],f+=d,c-=8);if(0===o)o=1-s;else{if(o===u)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,r),o-=s}return(p?-1:1)*i*Math.pow(2,o-r)},t.write=function(e,t,n,r,a,o){var i,l,u,s=8*o-a-1,c=(1<>1,d=23===a?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,h=r?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(l=isNaN(t)?1:0,i=c):(i=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-i))<1&&(i--,u*=2),(t+=i+f>=1?d/u:d*Math.pow(2,1-f))*u>=2&&(i++,u/=2),i+f>=c?(l=0,i=c):i+f>=1?(l=(t*u-1)*Math.pow(2,a),i+=f):(l=t*Math.pow(2,f-1)*Math.pow(2,a),i=0));a>=8;e[n+p]=255&l,p+=h,l/=256,a-=8);for(i=i<0;e[n+p]=255&i,p+=h,i/=256,s-=8);e[n+p-h]|=128*g}},4378:(e,t,n)=>{try{var r=n(9539);if("function"!=typeof r.inherits)throw"";e.exports=r.inherits}catch(t){e.exports=n(5717)}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}}},2584:(e,t,n)=>{"use strict";var r=n(6410)(),a=n(1924)("Object.prototype.toString"),o=function(e){return!(r&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===a(e)},i=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==a(e)&&"[object Function]"===a(e.callee)},l=function(){return o(arguments)}();o.isLegacyArguments=i,e.exports=l?o:i},5320:e=>{"use strict";var t,n,r=Function.prototype.toString,a="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof a&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw n}}),n={},a((function(){throw 42}),null,t)}catch(e){e!==n&&(a=null)}else a=null;var o=/^\s*class\b/,i=function(e){try{var t=r.call(e);return o.test(t)}catch(e){return!1}},l=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,s="object"==typeof document&&void 0===document.all&&void 0!==document.all?document.all:{};e.exports=a?function(e){if(e===s)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;try{a(e,null,t)}catch(e){if(e!==n)return!1}return!i(e)}:function(e){if(e===s)return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if("function"==typeof e&&!e.prototype)return!0;if(u)return function(e){try{return!i(e)&&(r.call(e),!0)}catch(e){return!1}}(e);if(i(e))return!1;var t=l.call(e);return"[object Function]"===t||"[object GeneratorFunction]"===t}},8662:(e,t,n)=>{"use strict";var r,a=Object.prototype.toString,o=Function.prototype.toString,i=/^\s*(?:function)?\*/,l=n(6410)(),u=Object.getPrototypeOf;e.exports=function(e){if("function"!=typeof e)return!1;if(i.test(o.call(e)))return!0;if(!l)return"[object GeneratorFunction]"===a.call(e);if(!u)return!1;if(void 0===r){var t=function(){if(!l)return!1;try{return Function("return function*() {}")()}catch(e){}}();r=!!t&&u(t)}return u(e)===r}},5692:(e,t,n)=>{"use strict";var r=n(4029),a=n(3083),o=n(1924),i=o("Object.prototype.toString"),l=n(6410)(),u="undefined"==typeof globalThis?n.g:globalThis,s=a(),c=o("Array.prototype.indexOf",!0)||function(e,t){for(var n=0;n-1}return!!p&&function(e){var t=!1;return r(d,(function(n,r){if(!t)try{t=n.call(e)===r}catch(e){}})),t}(e)}},5826:e=>{e.exports=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)}},2313:(e,t,n)=>{var r=n(4155),a=n(4422),o=n(2830).PassThrough,i=n(2830).PassThrough,l=n(7418),u=[].slice,s={bubbleErrors:!1,objectMode:!0};e.exports=function(e,t,n){Array.isArray(e)||(e=u.call(arguments),t=null,n=null);var c=e[e.length-1];"function"==typeof c&&(n=e.splice(-1)[0],c=e[e.length-1]),"object"==typeof c&&"function"!=typeof c.pipe&&(t=e.splice(-1)[0]);var f,d=e[0],p=e[e.length-1];if(t=l({},s,t),!d)return n&&r.nextTick(n),new o(t);if(f=d.writable&&p.readable?a(t,d,p):1==e.length?new i(t).wrap(e[0]):d.writable?d:p.readable?p:new o(t),e.forEach((function(t,n){var r=e[n+1];r&&t.pipe(r),t!=f&&t.on("error",f.emit.bind(f,"error"))})),n){var h=!1;function g(e){h||(h=!0,n(e))}f.on("error",g),p.on("finish",(function(){g()})),p.on("close",(function(){g()}))}return f}},7418:e=>{"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function a(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,o){for(var i,l,u=a(e),s=1;s{"use strict";var r=n(4155);void 0===r||!r.version||0===r.version.indexOf("v0.")||0===r.version.indexOf("v1.")&&0!==r.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,n,a){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,i,l=arguments.length;switch(l){case 0:case 1:return r.nextTick(e);case 2:return r.nextTick((function(){e.call(null,t)}));case 3:return r.nextTick((function(){e.call(null,t,n)}));case 4:return r.nextTick((function(){e.call(null,t,n,a)}));default:for(o=new Array(l-1),i=0;i{var r,a,o=n(3878).i,i=n(3878).g,l=e.exports={};function u(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function c(e){if(r===o)return o(e,0);if((r===u||!r)&&o)return r=o,o(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}!function(){try{r="function"==typeof o?o:u}catch(e){r=u}try{a="function"==typeof i?i:s}catch(e){a=s}}();var f,d=[],p=!1,h=-1;function g(){p&&f&&(p=!1,f.length?d=f.concat(d):h=-1,d.length&&y())}function y(){if(!p){var e=c(g);p=!0;for(var t=d.length;t;){for(f=d,d=[];++h1)for(var n=1;n{"use strict";var r=n(7418),a=n(7294),o=n(2830);function i(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n_;_++)A[_]=_+1;A[15]=0;var x=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,P=Object.prototype.hasOwnProperty,O={},M={};function Z(e){return!!P.call(M,e)||!P.call(O,e)&&(x.test(e)?M[e]=!0:(O[e]=!0,!1))}function T(e,t,n,r,a,o,i){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=i}var D={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){D[e]=new T(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];D[t]=new T(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){D[e]=new T(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){D[e]=new T(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){D[e]=new T(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){D[e]=new T(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){D[e]=new T(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){D[e]=new T(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){D[e]=new T(e,5,!1,e.toLowerCase(),null,!1,!1)}));var I=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(I,j);D[t]=new T(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(I,j);D[t]=new T(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(I,j);D[t]=new T(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){D[e]=new T(e,1,!1,e.toLowerCase(),null,!1,!1)})),D.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){D[e]=new T(e,1,!1,e.toLowerCase(),null,!0,!0)}));var B=/["'&<>]/;function F(e){if("boolean"==typeof e||"number"==typeof e)return""+e;e=""+e;var t=B.exec(e);if(t){var n,r="",a=0;for(n=t.index;nt}return!1}(e,t,r)?"":null!==r?(e=r.attributeName,3===(n=r.type)||4===n&&!0===t?e+'=""':(r.sanitizeURL&&(t=""+t),e+'="'+F(t)+'"')):Z(e)?e+'="'+F(t)+'"':""}var U="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},G=null,H=null,W=null,K=!1,V=!1,q=null,$=0;function Y(){if(null===G)throw Error(i(321));return G}function X(){if(0<$)throw Error(i(312));return{memoizedState:null,queue:null,next:null}}function Q(){return null===W?null===H?(K=!1,H=W=X()):(K=!0,W=H):null===W.next?(K=!1,W=W.next=X()):(K=!0,W=W.next),W}function J(e,t,n,r){for(;V;)V=!1,$+=1,W=null,n=e(t,r);return ee(),n}function ee(){G=null,V=!1,H=null,$=0,W=q=null}function te(e,t){return"function"==typeof t?t(e):t}function ne(e,t,n){if(G=Y(),W=Q(),K){var r=W.queue;if(t=r.dispatch,null!==q&&void 0!==(n=q.get(r))){q.delete(r),r=W.memoizedState;do{r=e(r,n.action),n=n.next}while(null!==n);return W.memoizedState=r,[r,t]}return[W.memoizedState,t]}return e=e===te?"function"==typeof t?t():t:void 0!==n?n(t):t,W.memoizedState=e,e=(e=W.queue={last:null,dispatch:null}).dispatch=ae.bind(null,G,e),[W.memoizedState,e]}function re(e,t){if(G=Y(),t=void 0===t?null:t,null!==(W=Q())){var n=W.memoizedState;if(null!==n&&null!==t){var r=n[1];e:if(null===r)r=!1;else{for(var a=0;a$))throw Error(i(301));if(e===G)if(V=!0,e={action:n,next:null},null===q&&(q=new Map),void 0===(n=q.get(t)))q.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}}function oe(){}var ie=null,le={readContext:function(e){var t=ie.threadID;return N(e,t),e[t]},useContext:function(e){Y();var t=ie.threadID;return N(e,t),e[t]},useMemo:re,useReducer:ne,useRef:function(e){G=Y();var t=(W=Q()).memoizedState;return null===t?(e={current:e},W.memoizedState=e):t},useState:function(e){return ne(te,e)},useLayoutEffect:function(){},useCallback:function(e,t){return re((function(){return e}),t)},useImperativeHandle:oe,useEffect:oe,useDebugValue:oe,useDeferredValue:function(e){return Y(),e},useTransition:function(){return Y(),[function(e){e()},!1]},useOpaqueIdentifier:function(){return(ie.identifierPrefix||"")+"R:"+(ie.uniqueID++).toString(36)},useMutableSource:function(e,t){return Y(),t(e._source)}},ue="http://www.w3.org/1999/xhtml";function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}var ce={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},fe=r({menuitem:!0},ce),de={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];Object.keys(de).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),de[t]=de[e]}))}));var he=/([A-Z])/g,ge=/^ms-/,ye=a.Children.toArray,me=C.ReactCurrentDispatcher,be={listing:!0,pre:!0,textarea:!0},ve=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,we={},Se={},ke=Object.prototype.hasOwnProperty,Le={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null,suppressHydrationWarning:null};function Ee(e,t){if(void 0===e)throw Error(i(152,E(t)||"Component"))}var Ce=function(){function e(e,t,n){a.isValidElement(e)?e.type!==u?e=[e]:(e=e.props.children,e=a.isValidElement(e)?[e]:ye(e)):e=ye(e),e={type:null,domNamespace:ue,children:e,childIndex:0,context:R,footer:""};var r=A[0];if(0===r){var o=A,l=2*(r=o.length);if(!(65536>=l))throw Error(i(304));var s=new Uint16Array(l);for(s.set(o),(A=s)[0]=r+1,o=r;o=l.children.length){var u=l.footer;if(""!==u&&(this.previousWasTextNode=!1),this.stack.pop(),"select"===l.type)this.currentSelectValue=null;else if(null!=l.type&&null!=l.type.type&&l.type.type.$$typeof===f)this.popProvider(l.type);else if(l.type===h){this.suspenseDepth--;var s=r.pop();if(a){a=!1;var c=l.fallbackFrame;if(!c)throw Error(i(303));this.stack.push(c),r[this.suspenseDepth]+="\x3c!--$!--\x3e";continue}r[this.suspenseDepth]+=s}r[this.suspenseDepth]+=u}else{var d=l.children[l.childIndex++],p="";try{p+=this.render(d,l.context,l.domNamespace)}catch(e){if(null!=e&&"function"==typeof e.then)throw Error(i(294));throw e}r.length<=this.suspenseDepth&&r.push(""),r[this.suspenseDepth]+=p}}return r[0]}finally{me.current=n,ie=t,ee()}},t.render=function(e,t,n){if("string"==typeof e||"number"==typeof e)return""==(n=""+e)?"":this.makeStaticMarkup?F(n):this.previousWasTextNode?"\x3c!-- --\x3e"+F(n):(this.previousWasTextNode=!0,F(n));if(e=(t=function(e,t,n){function o(a,o){var l=o.prototype&&o.prototype.isReactComponent,u=function(e,t,n,r){if(r&&"object"==typeof(r=e.contextType)&&null!==r)return N(r,n),r[n];if(e=e.contextTypes){for(var a in n={},e)n[a]=t[a];t=n}else t=R;return t}(o,t,n,l),s=[],c=!1,f={isMounted:function(){return!1},enqueueForceUpdate:function(){if(null===s)return null},enqueueReplaceState:function(e,t){c=!0,s=[t]},enqueueSetState:function(e,t){if(null===s)return null;s.push(t)}};if(l){if(l=new o(a.props,u,f),"function"==typeof o.getDerivedStateFromProps){var d=o.getDerivedStateFromProps.call(null,a.props,l.state);null!=d&&(l.state=r({},l.state,d))}}else if(G={},l=o(a.props,u,f),null==(l=J(o,a.props,l,u))||null==l.render)return void Ee(e=l,o);if(l.props=a.props,l.context=u,l.updater=f,void 0===(f=l.state)&&(l.state=f=null),"function"==typeof l.UNSAFE_componentWillMount||"function"==typeof l.componentWillMount)if("function"==typeof l.componentWillMount&&"function"!=typeof o.getDerivedStateFromProps&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&"function"!=typeof o.getDerivedStateFromProps&&l.UNSAFE_componentWillMount(),s.length){f=s;var p=c;if(s=null,c=!1,p&&1===f.length)l.state=f[0];else{d=p?f[0]:l.state;var h=!0;for(p=p?1:0;p=s.length))throw Error(i(93));s=s[0]}u=""+s}null==u&&(u="")}l=r({},l,{value:void 0,children:""+u})}else if("select"===o)this.currentSelectValue=null!=l.value?l.value:l.defaultValue,l=r({},l,{value:void 0});else if("option"===o){s=this.currentSelectValue;var c=function(e){if(null==e)return e;var t="";return a.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(l.children);if(null!=s){var f=null!=l.value?l.value+"":c;if(u=!1,Array.isArray(s)){for(var d=0;d":(S+=">",u="");e:{if(null!=(s=l.dangerouslySetInnerHTML)){if(null!=s.__html){s=s.__html;break e}}else if("string"==typeof(s=l.children)||"number"==typeof s){s=F(s);break e}s=null}return null!=s?(l=[],be.hasOwnProperty(o)&&"\n"===s.charAt(0)&&(S+="\n"),S+=s):l=ye(l.children),e=e.type,n=null==n||"http://www.w3.org/1999/xhtml"===n?se(e):"http://www.w3.org/2000/svg"===n&&"foreignObject"===e?"http://www.w3.org/1999/xhtml":n,this.stack.push({domNamespace:n,type:o,children:l,childIndex:0,context:t,footer:u}),this.previousWasTextNode=!1,S},e}();!function(e){function t(t,n,r){var a=e.call(this,{})||this;return a.partialRenderer=new Ce(t,n,r),a}!function(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}(t,e);var n=t.prototype;n._destroy=function(e,t){this.partialRenderer.destroy(),t(e)},n._read=function(e){try{this.push(this.partialRenderer.read(e))}catch(e){this.destroy(e)}}}(o.Readable);t.renderToString=function(e,t){e=new Ce(e,!1,t);try{return e.read(1/0)}finally{e.destroy()}}},4448:(e,t,n)=>{"use strict";var r=n(3878).i,a=n(3878).g,o=n(7294),i=n(7418),l=n(3840);function u(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n