{"version":3,"sources":["webpack://nada.org/./node_modules/react-error-boundary/dist/react-error-boundary.umd.js","webpack://nada.org/./node_modules/react-table/dist/react-table.development.js","webpack://nada.org/./node_modules/react-table/index.js","webpack://nada.org/./node_modules/swr/infinite/dist/index.mjs"],"names":[],"mappings":";;;;;;;;AAAA;AACA,EAAE,KAA4D,oBAAoB,mBAAO,CAAC,4CAAO;AACjG,EAAE,CACiI;AACnI,CAAC,oCAAoC;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,aAAa;AAC3C,WAAW;AACX;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,0EAA0E,aAAa;AACvF;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA,8EAA8E,eAAe;AAC7F;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,2CAA2C;AAC3C;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;;AAEA;AACA,GAAG;;AAEH;AACA;AACA;AACA,MAAM;;;AAGN;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gDAAgD,cAAc;;AAE9D,CAAC;AACD;;;;;;;;;;;AC1LA;AACA,EAAE,KAA4D,oBAAoB,mBAAO,CAAC,4CAAO;AACjG,EAAE,CACwE;AAC1E,CAAC,mCAAmC;;AAEpC;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA,qBAAqB,sBAAsB;AAC3C;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,eAAe,uBAAuB;AACtC;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2EAA2E,aAAa;AACxF;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yBAAyB,WAAW;;AAEpC;AACA,+CAA+C,mBAAmB,IAAI,aAAa;AACnF;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK,IAAI;AACT;;AAEA;AACA;AACA;AACA,gCAAgC;AAChC,KAAK;;;AAGL;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,uDAAuD;AACvD;AACA,SAAS;AACT,OAAO,IAAI;AACX;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gCAAgC;AAChC,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,+EAA+E,eAAe;AAC9F;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB;AACnB;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB;AACnB,iBAAiB;AACjB;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA,yCAAyC;AACzC;AACA,OAAO,UAAU;AACjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK,mBAAmB,uBAAuB;AAC/C;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,QAAQ;;AAER;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,WAAW;AACX;;;AAGA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA,OAAO;AACP,qCAAqC;;AAErC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK,YAAY;AACjB;;AAEA;AACA;AACA;AACA,uEAAuE,aAAa;AACpF;AACA;;AAEA,mBAAmB,iBAAiB;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL,qBAAqB,gBAAgB;AACrC;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA,6FAA6F,aAAa;AAC1G;AACA;;AAEA;AACA,iCAAiC;;AAEjC,oDAAoD;;AAEpD,qCAAqC,EAAE;;AAEvC,wDAAwD;;AAExD,4CAA4C;AAC5C;AACA;AACA,KAAK,GAAG;;AAER;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA,+BAA+B;;AAE/B;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D;;;AAG7D,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;;;AAGP;AACA;AACA,OAAO;AACP,KAAK,4CAA4C;;AAEjD;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,wCAAwC;;;AAGxC;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL,oCAAoC;AACpC;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK;AACL,0CAA0C;;AAE1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,KAAK;AACL,8DAA8D;AAC9D;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,KAAK;AACL;AACA,KAAK,IAAI;;AAET;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;;AAGL;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL,8CAA8C;;AAE9C;AACA;AACA,KAAK;AACL,oCAAoC;;AAEpC;AACA;AACA,KAAK;AACL,qEAAqE;;AAErE;AACA;AACA,KAAK;AACL;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA,kDAAkD;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D;;AAE1D;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;AACb;;AAEA;AACA;AACA;;AAEA;AACA,SAAS,EAAE;;AAEX;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA,OAAO;AACP,KAAK;AACL,iFAAiF;AACjF;;AAEA;AACA;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;AACA;AACA;AACA;AACA,UAAU;;AAEV;AACA;AACA;AACA,SAAS,EAAE;;AAEX;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT,OAAO,EAAE;;AAET;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB;;AAEpB,UAAU;AACV;;AAEA;AACA;AACA;AACA,4DAA4D;;AAE5D,wBAAwB;;AAExB,6BAA6B;;AAE7B,2BAA2B;;AAE3B,2BAA2B;;AAE3B,gEAAgE;;AAEhE;AACA;AACA;AACA;AACA,WAAW,EAAE;;AAEb;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;;;AAGP;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,0BAA0B;AAC1B;AACA,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,0BAA0B;AAC1B,+BAA+B,iCAAiC;AAChE,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA,0BAA0B;AAC1B;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;;AAGL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,sCAAsC;;AAEtC;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;;AAEA,6EAA6E;AAC7E;AACA;AACA,OAAO;AACP,4FAA4F;;AAE5F;AACA,0BAA0B;AAC1B;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,WAAW;AACX,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA,WAAW;;AAEX,kFAAkF;;AAElF;AACA;AACA;;AAEA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,uDAAuD;;AAEvD,6NAA6N;;AAE7N;AACA;AACA,QAAQ;AACR;;;AAGA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA,gCAAgC;;AAEhC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA;AACA;AACA;;AAEA,iFAAiF;;AAEjF;AACA;AACA;AACA,WAAW;AACX;;;AAGA;AACA;AACA,SAAS,QAAQ;AACjB;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO,EAAE;AACT;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,qFAAqF;AACrF,wEAAwE;;AAExE;AACA;AACA;;AAEA;AACA;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,cAAc;AACnB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,4EAA4E;;AAE5E;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO,EAAE;;AAET;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA,uBAAuB;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;;AAEL;AACA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA,SAAS;AACT,OAAO,EAAE;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;;AAGX;;AAEA;AACA;AACA;AACA;AACA,aAAa,EAAE;;AAEf;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,mBAAmB;AACnB;AACA;;AAEA;AACA;;AAEA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA,aAAa;AACb;AACA,WAAW;AACX;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,aAAa;AACb,WAAW;AACX;;AAEA,8CAA8C;;AAE9C,qDAAqD;;AAErD;AACA;AACA;AACA;AACA,mDAAmD;;AAEnD,uEAAuE;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,WAAW;AACX;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO,EAAE;;AAET;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;;AAEA;AACA,iFAAiF;;AAEjF,oEAAoE;;AAEpE;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK,IAAI;AACT;;AAEA,yCAAyC;AACzC;AACA;;AAEA;AACA;AACA;AACA,qCAAqC;;;AAGrC;AACA,oBAAoB;AACpB;;AAEA;AACA,qDAAqD;;AAErD;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,OAAO;;;AAGP;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,oCAAoC;;AAEpC;AACA;AACA;;AAEA;AACA;AACA,OAAO;;;AAGP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC;;AAElC;AACA;AACA,OAAO;AACP,+CAA+C;;AAE/C;AACA;AACA,OAAO;;AAEP;AACA;AACA,OAAO;;AAEP;AACA,0BAA0B;;AAE1B;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,SAAS;AACT;AACA,SAAS;AACT;AACA;AACA,OAAO;;;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA;AACA,SAAS,GAAG;;AAEZ;AACA,OAAO;AACP;AACA;AACA;AACA,8BAA8B;AAC9B;AACA,aAAa;AACb;;AAEA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,cAAc;;AAEnB;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK,cAAc;;AAEnB,6CAA6C;;AAE7C;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA,8BAA8B;;AAE9B;AACA;AACA;AACA,SAAS;AACT,OAAO;;AAEP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA,uEAAuE;;AAEvE;AACA;AACA,WAAW;AACX;;;AAGA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,WAAW;;AAEX;AACA;AACA;;AAEA;AACA,SAAS,GAAG;;AAEZ;AACA;;AAEA;AACA;AACA;;AAEA;AACA,SAAS;AACT;AACA;;AAEA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA,qBAAqB,kBAAkB;AACvC;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA,mCAAmC;;AAEnC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe;AACf;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT;;AAEA;AACA;AACA,qCAAqC;AACrC;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;AACA,OAAO;AACP;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL,IAAI;;;AAGJ;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4FAA4F;AAC5F;;AAEA,2CAA2C;;AAE3C;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;AACA,SAAS;AACT;;AAEA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,yCAAyC;;AAEzC;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,0CAA0C;;AAE1C;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;;AAEA;AACA;AACA;AACA,WAAW;AACX;AACA;;AAEA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,IAAI;;;AAGJ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wBAAwB;AACxB,6BAA6B,iCAAiC;AAC9D,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,OAAO;AACP,wBAAwB;AACxB,6BAA6B,iCAAiC,iCAAiC;AAC/F,gCAAgC,8BAA8B,iBAAiB;AAC/E,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iDAAiD;;AAEjD,yCAAyC;;AAEzC,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA,OAAO;;AAEP;AACA;AACA;AACA;;AAEA;AACA;AACA,KAAK;;;AAGL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;;AAEA,iCAAiC;;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,WAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;AACL;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;AACA;AACA,wBAAwB;AACxB,mCAAmC;AACnC;AACA;AACA;AACA;AACA,SAAS;AACT,OAAO;AACP;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP,wBAAwB;AACxB,mCAAmC;AACnC,mCAAmC,uCAAuC;AAC1E,SAAS;AACT,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB,mCAAmC;AACnC;AACA;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;AACL;AACA;AACA;AACA,OAAO;AACP,KAAK;AACL;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;AACA;AACA,0BAA0B;AAC1B;AACA,SAAS;AACT,OAAO;AACP,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,6HAA6H;AAC7H;AACA;;AAEA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA,qBAAqB;AACrB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB;AACA;AACA;AACA,OAAO;AACP;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,4BAA4B,sBAAsB;AAClD,SAAS,IAAI;AACb;AACA;;AAEA,4BAA4B,sBAAsB;AAClD,SAAS,IAAI;AACb;AACA;;AAEA,4BAA4B,sBAAsB;AAClD,SAAS,IAAI;AACb;AACA;AACA;AACA,SAAS;AACT,0BAA0B;AAC1B,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,WAAW;AACX,SAAS;AACT,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO;;AAEP,wBAAwB;AACxB,+BAA+B;AAC/B,mCAAmC,mCAAmC;AACtE,SAAS;AACT,OAAO;AACP;;AAEA;AACA,wBAAwB;AACxB,+BAA+B;AAC/B,yBAAyB;AACzB,uBAAuB;AACvB;AACA,SAAS;AACT,OAAO;AACP;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gDAAgD,cAAc;;AAE9D,CAAC;AACD;;;;;;;;;;;ACvjJA,IAAI,KAAqC,EAAE,EAE1C;AACD,EAAE,2IAA6D;AAC/D;;;;;;;;;;;;;;;;;;;;ACJkF;AACzD;;AAEzB;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD,OAAO;AACvD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,+DAA+D,gBAAgB,EAAE,EAAE;AAC9G;AACA,mCAAmC,MAAM,6BAA6B,EAAE,YAAY,WAAW,EAAE;AACjG,kCAAkC,MAAM,iCAAiC,EAAE,YAAY,WAAW,EAAE;AACpG,+BAA+B,qFAAqF;AACpH;AACA,KAAK;AACL;;AAEA;AACA,aAAa,6BAA6B,0BAA0B,aAAa,EAAE,qBAAqB;AACxG,gBAAgB,qDAAqD,oEAAoE,aAAa,EAAE;AACxJ,sBAAsB,sBAAsB,qBAAqB,GAAG;AACpE;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,kCAAkC,SAAS;AAC3C,kCAAkC,WAAW,UAAU;AACvD,yCAAyC,cAAc;AACvD;AACA,6GAA6G,OAAO,UAAU;AAC9H,gFAAgF,iBAAiB,OAAO;AACxG,wDAAwD,gBAAgB,QAAQ,OAAO;AACvF,8CAA8C,gBAAgB,gBAAgB,OAAO;AACrF;AACA,iCAAiC;AACjC;AACA;AACA,SAAS,YAAY,aAAa,OAAO,EAAE,UAAU,WAAW;AAChE,mCAAmC,SAAS;AAC5C;AACA;;AAEA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA,gCAAgC,wBAAwB;AACxD,+BAA+B,+BAA+B;AAC9D;AACA;AACA,6BAA6B,uCAAuC;;AAEpE;AACA;AACA;AACA;AACA,4CAA4C,4CAAS,GAAG,kDAAe;;AAEvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,oBAAoB;AAC/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,0CAA0C;AAC1C,sEAAsE;AACtE;;AAEA;AACA;AACA;AACA;AACA,wBAAwB,uBAAuB;AAC/C;AACA;AACA;AACA;AACA,mDAAmD,YAAY,YAAY;AAC3E;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,+CAAQ,GAAG;AAClC,0BAA0B,6CAAM;AAChC,sBAAsB,6CAAM;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA8B,kDAAW;AACzC;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,8BAA8B,6CAAM;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,gGAAgG;AAChG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS,EAAE,EAAE;AACb;AACA;AACA;AACA,SAAS;AACT,qBAAqB,kDAAW;AAChC;AACA,4BAA4B,uBAAuB;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2BAA2B,cAAc;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAsB,kDAAW;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB;AACvB;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,2BAA2B,wCAAM;;AAEyB","file":"webpack-chunks/chunk.vendors-node_modules_react-error-boundary_dist_react-error-boundary_umd_js-node_modules_react-ac78ee.e4b78d676632f0e759a8.js","sourcesContent":["(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ReactErrorBoundary = {}, global.React));\n})(this, (function (exports, React) { 'use strict';\n\n function _interopNamespace(e) {\n if (e && e.__esModule) return e;\n var n = Object.create(null);\n if (e) {\n Object.keys(e).forEach(function (k) {\n if (k !== 'default') {\n var d = Object.getOwnPropertyDescriptor(e, k);\n Object.defineProperty(n, k, d.get ? d : {\n enumerable: true,\n get: function () { return e[k]; }\n });\n }\n });\n }\n n[\"default\"] = e;\n return Object.freeze(n);\n }\n\n var React__namespace = /*#__PURE__*/_interopNamespace(React);\n\n function _setPrototypeOf(o, p) {\n _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n };\n\n return _setPrototypeOf(o, p);\n }\n\n function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n _setPrototypeOf(subClass, superClass);\n }\n\n var changedArray = function changedArray(a, b) {\n if (a === void 0) {\n a = [];\n }\n\n if (b === void 0) {\n b = [];\n }\n\n return a.length !== b.length || a.some(function (item, index) {\n return !Object.is(item, b[index]);\n });\n };\n\n var initialState = {\n error: null\n };\n\n var ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(ErrorBoundary, _React$Component);\n\n function ErrorBoundary() {\n var _this;\n\n for (var _len = arguments.length, _args = new Array(_len), _key = 0; _key < _len; _key++) {\n _args[_key] = arguments[_key];\n }\n\n _this = _React$Component.call.apply(_React$Component, [this].concat(_args)) || this;\n _this.state = initialState;\n\n _this.resetErrorBoundary = function () {\n var _this$props;\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n _this.props.onReset == null ? void 0 : (_this$props = _this.props).onReset.apply(_this$props, args);\n\n _this.reset();\n };\n\n return _this;\n }\n\n ErrorBoundary.getDerivedStateFromError = function getDerivedStateFromError(error) {\n return {\n error: error\n };\n };\n\n var _proto = ErrorBoundary.prototype;\n\n _proto.reset = function reset() {\n this.setState(initialState);\n };\n\n _proto.componentDidCatch = function componentDidCatch(error, info) {\n var _this$props$onError, _this$props2;\n\n (_this$props$onError = (_this$props2 = this.props).onError) == null ? void 0 : _this$props$onError.call(_this$props2, error, info);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps, prevState) {\n var error = this.state.error;\n var resetKeys = this.props.resetKeys; // There's an edge case where if the thing that triggered the error\n // happens to *also* be in the resetKeys array, we'd end up resetting\n // the error boundary immediately. This would likely trigger a second\n // error to be thrown.\n // So we make sure that we don't check the resetKeys on the first call\n // of cDU after the error is set\n\n if (error !== null && prevState.error !== null && changedArray(prevProps.resetKeys, resetKeys)) {\n var _this$props$onResetKe, _this$props3;\n\n (_this$props$onResetKe = (_this$props3 = this.props).onResetKeysChange) == null ? void 0 : _this$props$onResetKe.call(_this$props3, prevProps.resetKeys, resetKeys);\n this.reset();\n }\n };\n\n _proto.render = function render() {\n var error = this.state.error;\n var _this$props4 = this.props,\n fallbackRender = _this$props4.fallbackRender,\n FallbackComponent = _this$props4.FallbackComponent,\n fallback = _this$props4.fallback;\n\n if (error !== null) {\n var _props = {\n error: error,\n resetErrorBoundary: this.resetErrorBoundary\n };\n\n if ( /*#__PURE__*/React__namespace.isValidElement(fallback)) {\n return fallback;\n } else if (typeof fallbackRender === 'function') {\n return fallbackRender(_props);\n } else if (FallbackComponent) {\n return /*#__PURE__*/React__namespace.createElement(FallbackComponent, _props);\n } else {\n throw new Error('react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop');\n }\n }\n\n return this.props.children;\n };\n\n return ErrorBoundary;\n }(React__namespace.Component);\n\n function withErrorBoundary(Component, errorBoundaryProps) {\n var Wrapped = function Wrapped(props) {\n return /*#__PURE__*/React__namespace.createElement(ErrorBoundary, errorBoundaryProps, /*#__PURE__*/React__namespace.createElement(Component, props));\n }; // Format for display in DevTools\n\n\n var name = Component.displayName || Component.name || 'Unknown';\n Wrapped.displayName = \"withErrorBoundary(\" + name + \")\";\n return Wrapped;\n }\n\n function useErrorHandler(givenError) {\n var _React$useState = React__namespace.useState(null),\n error = _React$useState[0],\n setError = _React$useState[1];\n\n if (givenError != null) throw givenError;\n if (error != null) throw error;\n return setError;\n }\n /*\n eslint\n @typescript-eslint/sort-type-union-intersection-members: \"off\",\n @typescript-eslint/no-throw-literal: \"off\",\n @typescript-eslint/prefer-nullish-coalescing: \"off\"\n */\n\n exports.ErrorBoundary = ErrorBoundary;\n exports.useErrorHandler = useErrorHandler;\n exports.withErrorBoundary = withErrorBoundary;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n}));\n//# sourceMappingURL=react-error-boundary.umd.js.map\n","(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :\n typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :\n (global = global || self, factory(global.ReactTable = {}, global.React));\n}(this, (function (exports, React) { 'use strict';\n\n React = React && Object.prototype.hasOwnProperty.call(React, 'default') ? React['default'] : React;\n\n function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n }\n\n function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n }\n\n function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n }\n\n function _objectWithoutPropertiesLoose(source, excluded) {\n if (source == null) return {};\n var target = {};\n var sourceKeys = Object.keys(source);\n var key, i;\n\n for (i = 0; i < sourceKeys.length; i++) {\n key = sourceKeys[i];\n if (excluded.indexOf(key) >= 0) continue;\n target[key] = source[key];\n }\n\n return target;\n }\n\n function _toPrimitive(input, hint) {\n if (typeof input !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (typeof res !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n\n return (hint === \"string\" ? String : Number)(input);\n }\n\n function _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n\n return typeof key === \"symbol\" ? key : String(key);\n }\n\n var renderErr = 'Renderer Error ☝️';\n var actions = {\n init: 'init'\n };\n var defaultRenderer = function defaultRenderer(_ref) {\n var _ref$value = _ref.value,\n value = _ref$value === void 0 ? '' : _ref$value;\n return value;\n };\n var emptyRenderer = function emptyRenderer() {\n return React.createElement(React.Fragment, null, \"\\xA0\");\n };\n var defaultColumn = {\n Cell: defaultRenderer,\n width: 150,\n minWidth: 0,\n maxWidth: Number.MAX_SAFE_INTEGER\n };\n\n function mergeProps() {\n for (var _len = arguments.length, propList = new Array(_len), _key = 0; _key < _len; _key++) {\n propList[_key] = arguments[_key];\n }\n\n return propList.reduce(function (props, next) {\n var style = next.style,\n className = next.className,\n rest = _objectWithoutPropertiesLoose(next, [\"style\", \"className\"]);\n\n props = _extends({}, props, {}, rest);\n\n if (style) {\n props.style = props.style ? _extends({}, props.style || {}, {}, style || {}) : style;\n }\n\n if (className) {\n props.className = props.className ? props.className + ' ' + className : className;\n }\n\n if (props.className === '') {\n delete props.className;\n }\n\n return props;\n }, {});\n }\n\n function 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 } // Handle an array, merge each item as separate props\n\n\n if (Array.isArray(userProps)) {\n return mergeProps.apply(void 0, [prevProps].concat(userProps));\n } // Handle an object by default, merge the two objects\n\n\n return mergeProps(prevProps, userProps);\n }\n\n var makePropGetter = function makePropGetter(hooks, meta) {\n if (meta === void 0) {\n meta = {};\n }\n\n return function (userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n return [].concat(hooks, [userProps]).reduce(function (prev, next) {\n return handlePropGetter(prev, next, _extends({}, meta, {\n userProps: userProps\n }));\n }, {});\n };\n };\n var reduceHooks = function reduceHooks(hooks, initial, meta, allowUndefined) {\n if (meta === void 0) {\n meta = {};\n }\n\n return hooks.reduce(function (prev, next) {\n var nextValue = next(prev, meta);\n\n {\n if (!allowUndefined && typeof nextValue === 'undefined') {\n console.info(next);\n throw new Error('React Table: A reducer hook ☝️ just returned undefined! This is not allowed.');\n }\n }\n\n return nextValue;\n }, initial);\n };\n var loopHooks = function loopHooks(hooks, context, meta) {\n if (meta === void 0) {\n meta = {};\n }\n\n return hooks.forEach(function (hook) {\n var nextValue = hook(context, meta);\n\n {\n if (typeof nextValue !== 'undefined') {\n console.info(hook, nextValue);\n throw new Error('React Table: A loop-type hook ☝️ just returned a value! This is not allowed.');\n }\n }\n });\n };\n function ensurePluginOrder(plugins, befores, pluginName, afters) {\n if ( afters) {\n throw new Error(\"Defining plugins in the \\\"after\\\" section of ensurePluginOrder is no longer supported (see plugin \" + pluginName + \")\");\n }\n\n var pluginIndex = plugins.findIndex(function (plugin) {\n return plugin.pluginName === pluginName;\n });\n\n if (pluginIndex === -1) {\n {\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(function (before) {\n var beforeIndex = plugins.findIndex(function (plugin) {\n return plugin.pluginName === before;\n });\n\n if (beforeIndex > -1 && beforeIndex > pluginIndex) {\n {\n throw new Error(\"React Table: The \" + pluginName + \" plugin hook must be placed after the \" + before + \" plugin hook!\");\n }\n }\n });\n }\n function functionalUpdate(updater, old) {\n return typeof updater === 'function' ? updater(old) : updater;\n }\n function useGetLatest(obj) {\n var ref = React.useRef();\n ref.current = obj;\n return React.useCallback(function () {\n return ref.current;\n }, []);\n } // SSR has issues with useLayoutEffect still, so use useEffect during SSR\n\n var safeUseLayoutEffect = typeof document !== 'undefined' ? React.useLayoutEffect : React.useEffect;\n function useMountedLayoutEffect(fn, deps) {\n var mountedRef = React.useRef(false);\n safeUseLayoutEffect(function () {\n if (mountedRef.current) {\n fn();\n }\n\n mountedRef.current = true; // eslint-disable-next-line\n }, deps);\n }\n function useAsyncDebounce(defaultFn, defaultWait) {\n if (defaultWait === void 0) {\n defaultWait = 0;\n }\n\n var debounceRef = React.useRef({});\n var getDefaultFn = useGetLatest(defaultFn);\n var getDefaultWait = useGetLatest(defaultWait);\n return React.useCallback(\n /*#__PURE__*/\n function () {\n var _ref2 = _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee2() {\n var _len2,\n args,\n _key2,\n _args2 = arguments;\n\n return regeneratorRuntime.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n for (_len2 = _args2.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = _args2[_key2];\n }\n\n if (!debounceRef.current.promise) {\n debounceRef.current.promise = new Promise(function (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 /*#__PURE__*/\n _asyncToGenerator(\n /*#__PURE__*/\n regeneratorRuntime.mark(function _callee() {\n return regeneratorRuntime.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n delete debounceRef.current.timeout;\n _context.prev = 1;\n _context.t0 = debounceRef.current;\n _context.next = 5;\n return getDefaultFn().apply(void 0, args);\n\n case 5:\n _context.t1 = _context.sent;\n\n _context.t0.resolve.call(_context.t0, _context.t1);\n\n _context.next = 12;\n break;\n\n case 9:\n _context.prev = 9;\n _context.t2 = _context[\"catch\"](1);\n debounceRef.current.reject(_context.t2);\n\n case 12:\n _context.prev = 12;\n delete debounceRef.current.promise;\n return _context.finish(12);\n\n case 15:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[1, 9, 12, 15]]);\n })), getDefaultWait());\n return _context2.abrupt(\"return\", debounceRef.current.promise);\n\n case 5:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function () {\n return _ref2.apply(this, arguments);\n };\n }(), [getDefaultFn, getDefaultWait]);\n }\n function makeRenderer(instance, column, meta) {\n if (meta === void 0) {\n meta = {};\n }\n\n return function (type, userProps) {\n if (userProps === void 0) {\n userProps = {};\n }\n\n var 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, _extends({}, instance, {\n column: column\n }, meta, {}, userProps));\n };\n }\n function flexRender(Comp, props) {\n return isReactComponent(Comp) ? React.createElement(Comp, props) : Comp;\n }\n\n function isReactComponent(component) {\n return isClassComponent(component) || typeof component === 'function' || isExoticComponent(component);\n }\n\n function isClassComponent(component) {\n return typeof component === 'function' && function () {\n var proto = Object.getPrototypeOf(component);\n return proto.prototype && proto.prototype.isReactComponent;\n }();\n }\n\n function isExoticComponent(component) {\n return typeof component === 'object' && typeof component.$$typeof === 'symbol' && ['react.memo', 'react.forward_ref'].includes(component.$$typeof.description);\n }\n\n function linkColumnStructure(columns, parent, depth) {\n if (depth === void 0) {\n depth = 0;\n }\n\n return columns.map(function (column) {\n column = _extends({}, column, {\n parent: parent,\n depth: depth\n });\n assignColumnAccessor(column);\n\n if (column.columns) {\n column.columns = linkColumnStructure(column.columns, column, depth + 1);\n }\n\n return column;\n });\n }\n function flattenColumns(columns) {\n return flattenBy(columns, 'columns');\n }\n function assignColumnAccessor(column) {\n // First check for string accessor\n var id = column.id,\n accessor = column.accessor,\n Header = column.Header;\n\n if (typeof accessor === 'string') {\n id = id || accessor;\n var accessorPath = accessor.split('.');\n\n accessor = function accessor(row) {\n return getBy(row, accessorPath);\n };\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: id,\n accessor: accessor\n });\n return column;\n }\n function decorateColumn(column, userDefaultColumn) {\n if (!userDefaultColumn) {\n throw new Error();\n }\n\n Object.assign(column, _extends({\n // Make sure there is a fallback header, just in case\n Header: emptyRenderer,\n Footer: emptyRenderer\n }, defaultColumn, {}, userDefaultColumn, {}, column));\n Object.assign(column, {\n originalWidth: column.width\n });\n return column;\n } // Build the header groups from the bottom up\n\n function makeHeaderGroups(allColumns, defaultColumn, additionalHeaderProperties) {\n if (additionalHeaderProperties === void 0) {\n additionalHeaderProperties = function additionalHeaderProperties() {\n return {};\n };\n }\n\n var headerGroups = [];\n var scanColumns = allColumns;\n var uid = 0;\n\n var getUID = function getUID() {\n return uid++;\n };\n\n var _loop = function _loop() {\n // The header group we are creating\n var headerGroup = {\n headers: []\n }; // The parent columns we're going to scan next\n\n var parentColumns = [];\n var hasParents = scanColumns.some(function (d) {\n return d.parent;\n }); // Scan each column for parents\n\n scanColumns.forEach(function (column) {\n // What is the latest (last) parent column?\n var latestParentColumn = [].concat(parentColumns).reverse()[0];\n var newParent;\n\n if (hasParents) {\n // If the column has a parent, add it if necessary\n if (column.parent) {\n newParent = _extends({}, column.parent, {\n originalId: column.parent.id,\n id: column.parent.id + \"_\" + getUID(),\n headers: [column]\n }, additionalHeaderProperties(column));\n } else {\n // If other columns have parents, we'll need to add a place holder if necessary\n var originalId = column.id + \"_placeholder\";\n newParent = decorateColumn(_extends({\n originalId: originalId,\n id: column.id + \"_placeholder_\" + getUID(),\n placeholderOf: column,\n headers: [column]\n }, additionalHeaderProperties(column)), defaultColumn);\n } // If the resulting parent columns are the same, just add\n // the column and increment the header span\n\n\n if (latestParentColumn && latestParentColumn.originalId === newParent.originalId) {\n latestParentColumn.headers.push(column);\n } else {\n parentColumns.push(newParent);\n }\n }\n\n headerGroup.headers.push(column);\n });\n headerGroups.push(headerGroup); // Start scanning the parent columns\n\n scanColumns = parentColumns;\n };\n\n while (scanColumns.length) {\n _loop();\n }\n\n return headerGroups.reverse();\n }\n var pathObjCache = new Map();\n function getBy(obj, path, def) {\n if (!path) {\n return obj;\n }\n\n var cacheKey = typeof path === 'function' ? path : JSON.stringify(path);\n\n var pathObj = pathObjCache.get(cacheKey) || function () {\n var pathObj = makePathArray(path);\n pathObjCache.set(cacheKey, pathObj);\n return pathObj;\n }();\n\n var val;\n\n try {\n val = pathObj.reduce(function (cursor, pathPart) {\n return cursor[pathPart];\n }, obj);\n } catch (e) {// continue regardless of error\n }\n\n return typeof val !== 'undefined' ? val : def;\n }\n function getFirstDefined() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n for (var i = 0; i < args.length; i += 1) {\n if (typeof args[i] !== 'undefined') {\n return args[i];\n }\n }\n }\n function isFunction(a) {\n if (typeof a === 'function') {\n return a;\n }\n }\n function flattenBy(arr, key) {\n var flat = [];\n\n var recurse = function recurse(arr) {\n arr.forEach(function (d) {\n if (!d[key]) {\n flat.push(d);\n } else {\n recurse(d[key]);\n }\n });\n };\n\n recurse(arr);\n return flat;\n }\n function expandRows(rows, _ref) {\n var manualExpandedKey = _ref.manualExpandedKey,\n expanded = _ref.expanded,\n _ref$expandSubRows = _ref.expandSubRows,\n expandSubRows = _ref$expandSubRows === void 0 ? true : _ref$expandSubRows;\n var expandedRows = [];\n\n var handleRow = function handleRow(row, addToExpandedRows) {\n if (addToExpandedRows === void 0) {\n addToExpandedRows = true;\n }\n\n row.isExpanded = row.original && row.original[manualExpandedKey] || expanded[row.id];\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(function (row) {\n return handleRow(row, expandSubRows);\n });\n }\n };\n\n rows.forEach(function (row) {\n return handleRow(row);\n });\n return expandedRows;\n }\n function getFilterMethod(filter, userFilterTypes, filterTypes) {\n return isFunction(filter) || userFilterTypes[filter] || filterTypes[filter] || filterTypes.text;\n }\n function shouldAutoRemoveFilter(autoRemove, value, column) {\n return autoRemove ? autoRemove(value, column) : typeof value === 'undefined';\n }\n function unpreparedAccessWarning() {\n throw new Error('React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.');\n }\n var passiveSupported = null;\n function passiveEventSupported() {\n // memoize support to avoid adding multiple test events\n if (typeof passiveSupported === 'boolean') return passiveSupported;\n var supported = false;\n\n try {\n var 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\n passiveSupported = supported;\n return passiveSupported;\n } //\n\n var reOpenBracket = /\\[/g;\n var reCloseBracket = /\\]/g;\n\n function makePathArray(obj) {\n return flattenDeep(obj) // remove all periods in parts\n .map(function (d) {\n return String(d).replace('.', '_');\n }) // join parts using period\n .join('.') // replace brackets with periods\n .replace(reOpenBracket, '.').replace(reCloseBracket, '') // split it back out on periods\n .split('.');\n }\n\n function flattenDeep(arr, newArr) {\n if (newArr === void 0) {\n newArr = [];\n }\n\n if (!Array.isArray(arr)) {\n newArr.push(arr);\n } else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], newArr);\n }\n }\n\n return newArr;\n }\n\n var defaultGetTableProps = function defaultGetTableProps(props) {\n return _extends({\n role: 'table'\n }, props);\n };\n\n var defaultGetTableBodyProps = function defaultGetTableBodyProps(props) {\n return _extends({\n role: 'rowgroup'\n }, props);\n };\n\n var defaultGetHeaderProps = function defaultGetHeaderProps(props, _ref) {\n var column = _ref.column;\n return _extends({\n key: \"header_\" + column.id,\n colSpan: column.totalVisibleHeaderCount,\n role: 'columnheader'\n }, props);\n };\n\n var defaultGetFooterProps = function defaultGetFooterProps(props, _ref2) {\n var column = _ref2.column;\n return _extends({\n key: \"footer_\" + column.id,\n colSpan: column.totalVisibleHeaderCount\n }, props);\n };\n\n var defaultGetHeaderGroupProps = function defaultGetHeaderGroupProps(props, _ref3) {\n var index = _ref3.index;\n return _extends({\n key: \"headerGroup_\" + index,\n role: 'row'\n }, props);\n };\n\n var defaultGetFooterGroupProps = function defaultGetFooterGroupProps(props, _ref4) {\n var index = _ref4.index;\n return _extends({\n key: \"footerGroup_\" + index\n }, props);\n };\n\n var defaultGetRowProps = function defaultGetRowProps(props, _ref5) {\n var row = _ref5.row;\n return _extends({\n key: \"row_\" + row.id,\n role: 'row'\n }, props);\n };\n\n var defaultGetCellProps = function defaultGetCellProps(props, _ref6) {\n var cell = _ref6.cell;\n return _extends({\n key: \"cell_\" + cell.row.id + \"_\" + cell.column.id,\n role: 'cell'\n }, props);\n };\n\n 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\n actions.resetHiddenColumns = 'resetHiddenColumns';\n actions.toggleHideColumn = 'toggleHideColumn';\n actions.setHiddenColumns = 'setHiddenColumns';\n actions.toggleHideAllColumns = 'toggleHideAllColumns';\n var useColumnVisibility = function useColumnVisibility(hooks) {\n hooks.getToggleHiddenProps = [defaultGetToggleHiddenProps];\n hooks.getToggleHideAllColumnsProps = [defaultGetToggleHideAllColumnsProps];\n hooks.stateReducers.push(reducer);\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions);\n hooks.headerGroupsDeps.push(function (deps, _ref) {\n var instance = _ref.instance;\n return [].concat(deps, [instance.state.hiddenColumns]);\n });\n hooks.useInstance.push(useInstance);\n };\n useColumnVisibility.pluginName = 'useColumnVisibility';\n\n var defaultGetToggleHiddenProps = function defaultGetToggleHiddenProps(props, _ref2) {\n var column = _ref2.column;\n return [props, {\n onChange: function 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\n var defaultGetToggleHideAllColumnsProps = function defaultGetToggleHideAllColumnsProps(props, _ref3) {\n var instance = _ref3.instance;\n return [props, {\n onChange: function 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: !instance.allColumnsHidden && instance.state.hiddenColumns.length\n }];\n };\n\n function reducer(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n hiddenColumns: []\n }, state);\n }\n\n if (action.type === actions.resetHiddenColumns) {\n return _extends({}, state, {\n hiddenColumns: instance.initialState.hiddenColumns || []\n });\n }\n\n if (action.type === actions.toggleHideColumn) {\n var should = typeof action.value !== 'undefined' ? action.value : !state.hiddenColumns.includes(action.columnId);\n var hiddenColumns = should ? [].concat(state.hiddenColumns, [action.columnId]) : state.hiddenColumns.filter(function (d) {\n return d !== action.columnId;\n });\n return _extends({}, state, {\n hiddenColumns: hiddenColumns\n });\n }\n\n if (action.type === actions.setHiddenColumns) {\n return _extends({}, state, {\n hiddenColumns: functionalUpdate(action.value, state.hiddenColumns)\n });\n }\n\n if (action.type === actions.toggleHideAllColumns) {\n var shouldAll = typeof action.value !== 'undefined' ? action.value : !state.hiddenColumns.length;\n return _extends({}, state, {\n hiddenColumns: shouldAll ? instance.allColumns.map(function (d) {\n return d.id;\n }) : []\n });\n }\n }\n\n function useInstanceBeforeDimensions(instance) {\n var headers = instance.headers,\n hiddenColumns = instance.state.hiddenColumns;\n var isMountedRef = React.useRef(false);\n\n if (!isMountedRef.current) ;\n\n var handleColumn = function handleColumn(column, parentVisible) {\n column.isVisible = parentVisible && !hiddenColumns.includes(column.id);\n var totalVisibleHeaderCount = 0;\n\n if (column.headers && column.headers.length) {\n column.headers.forEach(function (subColumn) {\n return totalVisibleHeaderCount += handleColumn(subColumn, column.isVisible);\n });\n } else {\n totalVisibleHeaderCount = column.isVisible ? 1 : 0;\n }\n\n column.totalVisibleHeaderCount = totalVisibleHeaderCount;\n return totalVisibleHeaderCount;\n };\n\n var totalVisibleHeaderCount = 0;\n headers.forEach(function (subHeader) {\n return totalVisibleHeaderCount += handleColumn(subHeader, true);\n });\n }\n\n function useInstance(instance) {\n var columns = instance.columns,\n flatHeaders = instance.flatHeaders,\n dispatch = instance.dispatch,\n allColumns = instance.allColumns,\n getHooks = instance.getHooks,\n hiddenColumns = instance.state.hiddenColumns,\n _instance$autoResetHi = instance.autoResetHiddenColumns,\n autoResetHiddenColumns = _instance$autoResetHi === void 0 ? true : _instance$autoResetHi;\n var getInstance = useGetLatest(instance);\n var allColumnsHidden = allColumns.length === hiddenColumns.length;\n var toggleHideColumn = React.useCallback(function (columnId, value) {\n return dispatch({\n type: actions.toggleHideColumn,\n columnId: columnId,\n value: value\n });\n }, [dispatch]);\n var setHiddenColumns = React.useCallback(function (value) {\n return dispatch({\n type: actions.setHiddenColumns,\n value: value\n });\n }, [dispatch]);\n var toggleHideAllColumns = React.useCallback(function (value) {\n return dispatch({\n type: actions.toggleHideAllColumns,\n value: value\n });\n }, [dispatch]);\n var getToggleHideAllColumnsProps = makePropGetter(getHooks().getToggleHideAllColumnsProps, {\n instance: getInstance()\n });\n flatHeaders.forEach(function (column) {\n column.toggleHidden = function (value) {\n dispatch({\n type: actions.toggleHideColumn,\n columnId: column.id,\n value: value\n });\n };\n\n column.getToggleHiddenProps = makePropGetter(getHooks().getToggleHiddenProps, {\n instance: getInstance(),\n column: column\n });\n });\n var getAutoResetHiddenColumns = useGetLatest(autoResetHiddenColumns);\n useMountedLayoutEffect(function () {\n if (getAutoResetHiddenColumns()) {\n dispatch({\n type: actions.resetHiddenColumns\n });\n }\n }, [dispatch, columns]);\n Object.assign(instance, {\n allColumnsHidden: allColumnsHidden,\n toggleHideColumn: toggleHideColumn,\n setHiddenColumns: setHiddenColumns,\n toggleHideAllColumns: toggleHideAllColumns,\n getToggleHideAllColumnsProps: getToggleHideAllColumnsProps\n });\n }\n\n var defaultInitialState = {};\n var defaultColumnInstance = {};\n\n var defaultReducer = function defaultReducer(state, action, prevState) {\n return state;\n };\n\n var defaultGetSubRows = function defaultGetSubRows(row, index) {\n return row.subRows || [];\n };\n\n var defaultGetRowId = function defaultGetRowId(row, index, parent) {\n return \"\" + (parent ? [parent.id, index].join('.') : index);\n };\n\n var defaultUseControlledState = function defaultUseControlledState(d) {\n return d;\n };\n\n function applyDefaults(props) {\n var _props$initialState = props.initialState,\n initialState = _props$initialState === void 0 ? defaultInitialState : _props$initialState,\n _props$defaultColumn = props.defaultColumn,\n defaultColumn = _props$defaultColumn === void 0 ? defaultColumnInstance : _props$defaultColumn,\n _props$getSubRows = props.getSubRows,\n getSubRows = _props$getSubRows === void 0 ? defaultGetSubRows : _props$getSubRows,\n _props$getRowId = props.getRowId,\n getRowId = _props$getRowId === void 0 ? defaultGetRowId : _props$getRowId,\n _props$stateReducer = props.stateReducer,\n stateReducer = _props$stateReducer === void 0 ? defaultReducer : _props$stateReducer,\n _props$useControlledS = props.useControlledState,\n useControlledState = _props$useControlledS === void 0 ? defaultUseControlledState : _props$useControlledS,\n rest = _objectWithoutPropertiesLoose(props, [\"initialState\", \"defaultColumn\", \"getSubRows\", \"getRowId\", \"stateReducer\", \"useControlledState\"]);\n\n return _extends({}, rest, {\n initialState: initialState,\n defaultColumn: defaultColumn,\n getSubRows: getSubRows,\n getRowId: getRowId,\n stateReducer: stateReducer,\n useControlledState: useControlledState\n });\n }\n\n var useTable = function useTable(props) {\n for (var _len = arguments.length, plugins = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n plugins[_key - 1] = arguments[_key];\n }\n\n // Apply default props\n props = applyDefaults(props); // Add core plugins\n\n plugins = [useColumnVisibility].concat(plugins); // Create the table instance\n\n var instanceRef = React.useRef({}); // Create a getter for the instance (helps avoid a lot of potential memory leaks)\n\n var getInstance = useGetLatest(instanceRef.current); // Assign the props, plugins and hooks to the instance\n\n Object.assign(getInstance(), _extends({}, props, {\n plugins: plugins,\n hooks: makeDefaultPluginHooks()\n })); // Allow plugins to register hooks as early as possible\n\n plugins.filter(Boolean).forEach(function (plugin) {\n plugin(getInstance().hooks);\n }); // Consume all hooks and make a getter for them\n\n var getHooks = useGetLatest(getInstance().hooks);\n getInstance().getHooks = getHooks;\n delete getInstance().hooks; // Allow useOptions hooks to modify the options coming into the table\n\n Object.assign(getInstance(), reduceHooks(getHooks().useOptions, applyDefaults(props)));\n\n var _getInstance = getInstance(),\n data = _getInstance.data,\n userColumns = _getInstance.columns,\n initialState = _getInstance.initialState,\n defaultColumn = _getInstance.defaultColumn,\n getSubRows = _getInstance.getSubRows,\n getRowId = _getInstance.getRowId,\n stateReducer = _getInstance.stateReducer,\n useControlledState = _getInstance.useControlledState; // Setup user reducer ref\n\n\n var getStateReducer = useGetLatest(stateReducer); // Build the reducer\n\n var reducer = React.useCallback(function (state, action) {\n // Detect invalid actions\n if (!action.type) {\n console.info({\n action: action\n });\n throw new Error('Unknown Action 👆');\n } // Reduce the state from all plugin reducers\n\n\n return [].concat(getHooks().stateReducers, Array.isArray(getStateReducer()) ? getStateReducer() : [getStateReducer()]).reduce(function (s, handler) {\n return handler(s, action, state, getInstance()) || s;\n }, state);\n }, [getHooks, getStateReducer, getInstance]); // Start the reducer\n\n var _React$useReducer = React.useReducer(reducer, undefined, function () {\n return reducer(initialState, {\n type: actions.init\n });\n }),\n reducerState = _React$useReducer[0],\n dispatch = _React$useReducer[1]; // Allow the user to control the final state with hooks\n\n\n var state = reduceHooks([].concat(getHooks().useControlledState, [useControlledState]), reducerState, {\n instance: getInstance()\n });\n Object.assign(getInstance(), {\n state: state,\n dispatch: dispatch\n }); // Decorate All the columns\n\n var columns = React.useMemo(function () {\n return linkColumnStructure(reduceHooks(getHooks().columns, userColumns, {\n instance: getInstance()\n }));\n }, [getHooks, getInstance, userColumns].concat(reduceHooks(getHooks().columnsDeps, [], {\n instance: getInstance()\n })));\n getInstance().columns = columns; // Get the flat list of all columns and allow hooks to decorate\n // those columns (and trigger this memoization via deps)\n\n var allColumns = React.useMemo(function () {\n return reduceHooks(getHooks().allColumns, flattenColumns(columns), {\n instance: getInstance()\n }).map(assignColumnAccessor);\n }, [columns, getHooks, getInstance].concat(reduceHooks(getHooks().allColumnsDeps, [], {\n instance: getInstance()\n })));\n getInstance().allColumns = allColumns; // Access the row model using initial columns\n\n var _React$useMemo = React.useMemo(function () {\n var rows = [];\n var flatRows = [];\n var rowsById = {};\n var allColumnsQueue = [].concat(allColumns);\n\n while (allColumnsQueue.length) {\n var column = allColumnsQueue.shift();\n accessRowsForColumn({\n data: data,\n rows: rows,\n flatRows: flatRows,\n rowsById: rowsById,\n column: column,\n getRowId: getRowId,\n getSubRows: getSubRows,\n accessValueHooks: getHooks().accessValue,\n getInstance: getInstance\n });\n }\n\n return [rows, flatRows, rowsById];\n }, [allColumns, data, getRowId, getSubRows, getHooks, getInstance]),\n rows = _React$useMemo[0],\n flatRows = _React$useMemo[1],\n rowsById = _React$useMemo[2];\n\n Object.assign(getInstance(), {\n rows: rows,\n initialRows: [].concat(rows),\n flatRows: flatRows,\n rowsById: rowsById // materializedColumns,\n\n });\n loopHooks(getHooks().useInstanceAfterData, getInstance()); // 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\n var visibleColumns = React.useMemo(function () {\n return reduceHooks(getHooks().visibleColumns, allColumns, {\n instance: getInstance()\n }).map(function (d) {\n return decorateColumn(d, defaultColumn);\n });\n }, [getHooks, allColumns, getInstance, defaultColumn].concat(reduceHooks(getHooks().visibleColumnsDeps, [], {\n instance: getInstance()\n }))); // Combine new visible columns with all columns\n\n allColumns = React.useMemo(function () {\n var columns = [].concat(visibleColumns);\n allColumns.forEach(function (column) {\n if (!columns.find(function (d) {\n return d.id === column.id;\n })) {\n columns.push(column);\n }\n });\n return columns;\n }, [allColumns, visibleColumns]);\n getInstance().allColumns = allColumns;\n\n {\n var duplicateColumns = allColumns.filter(function (column, i) {\n return allColumns.findIndex(function (d) {\n return d.id === column.id;\n }) !== i;\n });\n\n if (duplicateColumns.length) {\n console.info(allColumns);\n throw new Error(\"Duplicate columns were found with ids: \\\"\" + duplicateColumns.map(function (d) {\n return d.id;\n }).join(', ') + \"\\\" in the columns array above\");\n }\n } // Make the headerGroups\n\n\n var headerGroups = React.useMemo(function () {\n return reduceHooks(getHooks().headerGroups, makeHeaderGroups(visibleColumns, defaultColumn), getInstance());\n }, [getHooks, visibleColumns, defaultColumn, getInstance].concat(reduceHooks(getHooks().headerGroupsDeps, [], {\n instance: getInstance()\n })));\n getInstance().headerGroups = headerGroups; // Get the first level of headers\n\n var headers = React.useMemo(function () {\n return headerGroups.length ? headerGroups[0].headers : [];\n }, [headerGroups]);\n getInstance().headers = headers; // Provide a flat header list for utilities\n\n getInstance().flatHeaders = headerGroups.reduce(function (all, headerGroup) {\n return [].concat(all, headerGroup.headers);\n }, []);\n loopHooks(getHooks().useInstanceBeforeDimensions, getInstance()); // Filter columns down to visible ones\n\n var visibleColumnsDep = visibleColumns.filter(function (d) {\n return d.isVisible;\n }).map(function (d) {\n return d.id;\n }).sort().join('_');\n visibleColumns = React.useMemo(function () {\n return visibleColumns.filter(function (d) {\n return d.isVisible;\n });\n }, // eslint-disable-next-line react-hooks/exhaustive-deps\n [visibleColumns, visibleColumnsDep]);\n getInstance().visibleColumns = visibleColumns; // Header Visibility is needed by this point\n\n var _calculateHeaderWidth = calculateHeaderWidths(headers),\n totalColumnsMinWidth = _calculateHeaderWidth[0],\n totalColumnsWidth = _calculateHeaderWidth[1],\n totalColumnsMaxWidth = _calculateHeaderWidth[2];\n\n getInstance().totalColumnsMinWidth = totalColumnsMinWidth;\n getInstance().totalColumnsWidth = totalColumnsWidth;\n getInstance().totalColumnsMaxWidth = totalColumnsMaxWidth;\n loopHooks(getHooks().useInstance, getInstance()) // Each materialized header needs to be assigned a render function and other\n // prop getter properties here.\n ;\n [].concat(getInstance().flatHeaders, getInstance().allColumns).forEach(function (column) {\n // Give columns/headers rendering power\n column.render = makeRenderer(getInstance(), column); // Give columns/headers a default getHeaderProps\n\n column.getHeaderProps = makePropGetter(getHooks().getHeaderProps, {\n instance: getInstance(),\n column: column\n }); // Give columns/headers a default getFooterProps\n\n column.getFooterProps = makePropGetter(getHooks().getFooterProps, {\n instance: getInstance(),\n column: column\n });\n });\n getInstance().headerGroups = React.useMemo(function () {\n return headerGroups.filter(function (headerGroup, i) {\n // Filter out any headers and headerGroups that don't have visible columns\n headerGroup.headers = headerGroup.headers.filter(function (column) {\n var recurse = function recurse(headers) {\n return headers.filter(function (column) {\n if (column.headers) {\n return recurse(column.headers);\n }\n\n return column.isVisible;\n }).length;\n };\n\n if (column.headers) {\n return recurse(column.headers);\n }\n\n return column.isVisible;\n }); // Give headerGroups getRowProps\n\n if (headerGroup.headers.length) {\n headerGroup.getHeaderGroupProps = makePropGetter(getHooks().getHeaderGroupProps, {\n instance: getInstance(),\n headerGroup: headerGroup,\n index: i\n });\n headerGroup.getFooterGroupProps = makePropGetter(getHooks().getFooterGroupProps, {\n instance: getInstance(),\n headerGroup: headerGroup,\n index: i\n });\n return true;\n }\n\n return false;\n });\n }, [headerGroups, getInstance, getHooks]);\n getInstance().footerGroups = [].concat(getInstance().headerGroups).reverse(); // 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(function (row) {\n row.getRowProps = makePropGetter(getHooks().getRowProps, {\n instance: getInstance(),\n row: row\n }); // Build the visible cells for each row\n\n row.allCells = allColumns.map(function (column) {\n var value = row.values[column.id];\n var cell = {\n column: column,\n row: row,\n value: value\n }; // Give each cell a getCellProps base\n\n cell.getCellProps = makePropGetter(getHooks().getCellProps, {\n instance: getInstance(),\n cell: cell\n }); // Give each cell a renderer function (supports multiple renderers)\n\n cell.render = makeRenderer(getInstance(), column, {\n row: row,\n cell: cell,\n value: value\n });\n return cell;\n });\n row.cells = visibleColumns.map(function (column) {\n return row.allCells.find(function (cell) {\n return cell.column.id === column.id;\n });\n }); // need to apply any row specific hooks (useExpanded requires this)\n\n loopHooks(getHooks().prepareRow, row, {\n instance: getInstance()\n });\n }, [getHooks, getInstance, allColumns, visibleColumns]);\n getInstance().getTableProps = makePropGetter(getHooks().getTableProps, {\n instance: getInstance()\n });\n getInstance().getTableBodyProps = makePropGetter(getHooks().getTableBodyProps, {\n instance: getInstance()\n });\n loopHooks(getHooks().useFinalInstance, getInstance());\n return getInstance();\n };\n\n function calculateHeaderWidths(headers, left) {\n if (left === void 0) {\n left = 0;\n }\n\n var sumTotalMinWidth = 0;\n var sumTotalWidth = 0;\n var sumTotalMaxWidth = 0;\n var sumTotalFlexWidth = 0;\n headers.forEach(function (header) {\n var subHeaders = header.headers;\n header.totalLeft = left;\n\n if (subHeaders && subHeaders.length) {\n var _calculateHeaderWidth2 = calculateHeaderWidths(subHeaders, left),\n totalMinWidth = _calculateHeaderWidth2[0],\n totalWidth = _calculateHeaderWidth2[1],\n totalMaxWidth = _calculateHeaderWidth2[2],\n totalFlexWidth = _calculateHeaderWidth2[3];\n\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(Math.max(header.minWidth, header.width), header.maxWidth);\n header.totalMaxWidth = header.maxWidth;\n header.totalFlexWidth = header.canResize ? header.totalWidth : 0;\n }\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 return [sumTotalMinWidth, sumTotalWidth, sumTotalMaxWidth, sumTotalFlexWidth];\n }\n\n function accessRowsForColumn(_ref) {\n var data = _ref.data,\n rows = _ref.rows,\n flatRows = _ref.flatRows,\n rowsById = _ref.rowsById,\n column = _ref.column,\n getRowId = _ref.getRowId,\n getSubRows = _ref.getSubRows,\n accessValueHooks = _ref.accessValueHooks,\n getInstance = _ref.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 var accessRow = function accessRow(originalRow, rowIndex, depth, parent, parentRows) {\n if (depth === void 0) {\n depth = 0;\n }\n\n // Keep the original reference around\n var original = originalRow;\n var id = getRowId(originalRow, rowIndex, parent);\n var row = rowsById[id]; // If the row hasn't been created, let's make it\n\n if (!row) {\n row = {\n id: id,\n original: original,\n index: rowIndex,\n depth: depth,\n cells: [{}] // This is a dummy cell\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\n row.cells.map = unpreparedAccessWarning;\n row.cells.filter = unpreparedAccessWarning;\n row.cells.forEach = unpreparedAccessWarning;\n row.cells[0].getCellProps = unpreparedAccessWarning; // Create the cells and values\n\n row.values = {}; // Push this row into the parentRows array\n\n parentRows.push(row); // Keep track of every row in a flat array\n\n flatRows.push(row); // Also keep track of every row by its ID\n\n rowsById[id] = row; // Get the original subrows\n\n row.originalSubRows = getSubRows(originalRow, rowIndex); // Then recursively access them\n\n if (row.originalSubRows) {\n var subRows = [];\n row.originalSubRows.forEach(function (d, i) {\n return accessRow(d, i, depth + 1, row, subRows);\n }); // Keep the new subRows array on the row\n\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(function (d, i) {\n return accessRow(d, i, depth + 1, row);\n });\n } // If the column has an accessor, use it to get a value\n\n\n if (column.accessor) {\n row.values[column.id] = column.accessor(originalRow, rowIndex, row, parentRows, data);\n } // Allow plugins to manipulate the column value\n\n\n row.values[column.id] = reduceHooks(accessValueHooks, row.values[column.id], {\n row: row,\n column: column,\n instance: getInstance()\n }, true);\n };\n\n data.forEach(function (originalRow, rowIndex) {\n return accessRow(originalRow, rowIndex, 0, undefined, rows);\n });\n }\n\n actions.resetExpanded = 'resetExpanded';\n actions.toggleRowExpanded = 'toggleRowExpanded';\n actions.toggleAllRowsExpanded = 'toggleAllRowsExpanded';\n var useExpanded = function useExpanded(hooks) {\n hooks.getToggleAllRowsExpandedProps = [defaultGetToggleAllRowsExpandedProps];\n hooks.getToggleRowExpandedProps = [defaultGetToggleRowExpandedProps];\n hooks.stateReducers.push(reducer$1);\n hooks.useInstance.push(useInstance$1);\n hooks.prepareRow.push(prepareRow);\n };\n useExpanded.pluginName = 'useExpanded';\n\n var defaultGetToggleAllRowsExpandedProps = function defaultGetToggleAllRowsExpandedProps(props, _ref) {\n var instance = _ref.instance;\n return [props, {\n onClick: function onClick(e) {\n instance.toggleAllRowsExpanded();\n },\n style: {\n cursor: 'pointer'\n },\n title: 'Toggle All Rows Expanded'\n }];\n };\n\n var defaultGetToggleRowExpandedProps = function defaultGetToggleRowExpandedProps(props, _ref2) {\n var row = _ref2.row;\n return [props, {\n onClick: function onClick() {\n row.toggleRowExpanded();\n },\n style: {\n cursor: 'pointer'\n },\n title: 'Toggle Row Expanded'\n }];\n }; // Reducer\n\n\n function reducer$1(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n expanded: {}\n }, state);\n }\n\n if (action.type === actions.resetExpanded) {\n return _extends({}, state, {\n expanded: instance.initialState.expanded || {}\n });\n }\n\n if (action.type === actions.toggleAllRowsExpanded) {\n var value = action.value;\n var rowsById = instance.rowsById;\n var isAllRowsExpanded = Object.keys(rowsById).length === Object.keys(state.expanded).length;\n var expandAll = typeof value !== 'undefined' ? value : !isAllRowsExpanded;\n\n if (expandAll) {\n var expanded = {};\n Object.keys(rowsById).forEach(function (rowId) {\n expanded[rowId] = true;\n });\n return _extends({}, state, {\n expanded: expanded\n });\n }\n\n return _extends({}, state, {\n expanded: {}\n });\n }\n\n if (action.type === actions.toggleRowExpanded) {\n var id = action.id,\n setExpanded = action.value;\n var exists = state.expanded[id];\n var shouldExist = typeof setExpanded !== 'undefined' ? setExpanded : !exists;\n\n if (!exists && shouldExist) {\n var _extends2;\n\n return _extends({}, state, {\n expanded: _extends({}, state.expanded, (_extends2 = {}, _extends2[id] = true, _extends2))\n });\n } else if (exists && !shouldExist) {\n var _state$expanded = state.expanded,\n _ = _state$expanded[id],\n rest = _objectWithoutPropertiesLoose(_state$expanded, [id].map(_toPropertyKey));\n\n return _extends({}, state, {\n expanded: rest\n });\n } else {\n return state;\n }\n }\n }\n\n function useInstance$1(instance) {\n var data = instance.data,\n rows = instance.rows,\n rowsById = instance.rowsById,\n _instance$manualExpan = instance.manualExpandedKey,\n manualExpandedKey = _instance$manualExpan === void 0 ? 'expanded' : _instance$manualExpan,\n _instance$paginateExp = instance.paginateExpandedRows,\n paginateExpandedRows = _instance$paginateExp === void 0 ? true : _instance$paginateExp,\n _instance$expandSubRo = instance.expandSubRows,\n expandSubRows = _instance$expandSubRo === void 0 ? true : _instance$expandSubRo,\n _instance$autoResetEx = instance.autoResetExpanded,\n autoResetExpanded = _instance$autoResetEx === void 0 ? true : _instance$autoResetEx,\n getHooks = instance.getHooks,\n plugins = instance.plugins,\n expanded = instance.state.expanded,\n dispatch = instance.dispatch;\n ensurePluginOrder(plugins, ['useSortBy', 'useGroupBy', 'usePivotColumns', 'useGlobalFilter'], 'useExpanded');\n var getAutoResetExpanded = useGetLatest(autoResetExpanded);\n var isAllRowsExpanded = Boolean(Object.keys(rowsById).length && Object.keys(expanded).length);\n\n if (isAllRowsExpanded) {\n if (Object.keys(rowsById).some(function (id) {\n return !expanded[id];\n })) {\n isAllRowsExpanded = false;\n }\n } // Bypass any effects from firing when this changes\n\n\n useMountedLayoutEffect(function () {\n if (getAutoResetExpanded()) {\n dispatch({\n type: actions.resetExpanded\n });\n }\n }, [dispatch, data]);\n var toggleRowExpanded = React.useCallback(function (id, value) {\n dispatch({\n type: actions.toggleRowExpanded,\n id: id,\n value: value\n });\n }, [dispatch]);\n var toggleAllRowsExpanded = React.useCallback(function (value) {\n return dispatch({\n type: actions.toggleAllRowsExpanded,\n value: value\n });\n }, [dispatch]);\n var expandedRows = React.useMemo(function () {\n if (paginateExpandedRows) {\n return expandRows(rows, {\n manualExpandedKey: manualExpandedKey,\n expanded: expanded,\n expandSubRows: expandSubRows\n });\n }\n\n return rows;\n }, [paginateExpandedRows, rows, manualExpandedKey, expanded, expandSubRows]);\n var expandedDepth = React.useMemo(function () {\n return findExpandedDepth(expanded);\n }, [expanded]);\n var getInstance = useGetLatest(instance);\n var getToggleAllRowsExpandedProps = makePropGetter(getHooks().getToggleAllRowsExpandedProps, {\n instance: getInstance()\n });\n Object.assign(instance, {\n preExpandedRows: rows,\n expandedRows: expandedRows,\n rows: expandedRows,\n expandedDepth: expandedDepth,\n isAllRowsExpanded: isAllRowsExpanded,\n toggleRowExpanded: toggleRowExpanded,\n toggleAllRowsExpanded: toggleAllRowsExpanded,\n getToggleAllRowsExpandedProps: getToggleAllRowsExpandedProps\n });\n }\n\n function prepareRow(row, _ref3) {\n var getHooks = _ref3.instance.getHooks,\n instance = _ref3.instance;\n\n row.toggleRowExpanded = function (set) {\n return instance.toggleRowExpanded(row.id, set);\n };\n\n row.getToggleRowExpandedProps = makePropGetter(getHooks().getToggleRowExpandedProps, {\n instance: instance,\n row: row\n });\n }\n\n function findExpandedDepth(expanded) {\n var maxDepth = 0;\n Object.keys(expanded).forEach(function (id) {\n var splitId = id.split('.');\n maxDepth = Math.max(maxDepth, splitId.length);\n });\n return maxDepth;\n }\n\n var text = function text(rows, ids, filterValue) {\n rows = rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return String(rowValue).toLowerCase().includes(String(filterValue).toLowerCase());\n });\n });\n return rows;\n };\n\n text.autoRemove = function (val) {\n return !val;\n };\n\n var exactText = function exactText(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue !== undefined ? String(rowValue).toLowerCase() === String(filterValue).toLowerCase() : true;\n });\n });\n };\n\n exactText.autoRemove = function (val) {\n return !val;\n };\n\n var exactTextCase = function exactTextCase(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue !== undefined ? String(rowValue) === String(filterValue) : true;\n });\n });\n };\n\n exactTextCase.autoRemove = function (val) {\n return !val;\n };\n\n var includes = function includes(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue.includes(filterValue);\n });\n });\n };\n\n includes.autoRemove = function (val) {\n return !val || !val.length;\n };\n\n var includesAll = function includesAll(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue && rowValue.length && filterValue.every(function (val) {\n return rowValue.includes(val);\n });\n });\n });\n };\n\n includesAll.autoRemove = function (val) {\n return !val || !val.length;\n };\n\n var includesSome = function includesSome(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue && rowValue.length && filterValue.some(function (val) {\n return rowValue.includes(val);\n });\n });\n });\n };\n\n includesSome.autoRemove = function (val) {\n return !val || !val.length;\n };\n\n var includesValue = function includesValue(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return filterValue.includes(rowValue);\n });\n });\n };\n\n includesValue.autoRemove = function (val) {\n return !val || !val.length;\n };\n\n var exact = function exact(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue === filterValue;\n });\n });\n };\n\n exact.autoRemove = function (val) {\n return typeof val === 'undefined';\n };\n\n var equals = function equals(rows, ids, filterValue) {\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id]; // eslint-disable-next-line eqeqeq\n\n return rowValue == filterValue;\n });\n });\n };\n\n equals.autoRemove = function (val) {\n return val == null;\n };\n\n var between = function between(rows, ids, filterValue) {\n var _ref = filterValue || [],\n min = _ref[0],\n max = _ref[1];\n\n min = typeof min === 'number' ? min : -Infinity;\n max = typeof max === 'number' ? max : Infinity;\n\n if (min > max) {\n var temp = min;\n min = max;\n max = temp;\n }\n\n return rows.filter(function (row) {\n return ids.some(function (id) {\n var rowValue = row.values[id];\n return rowValue >= min && rowValue <= max;\n });\n });\n };\n\n between.autoRemove = function (val) {\n return !val || typeof val[0] !== 'number' && typeof val[1] !== 'number';\n };\n\n var filterTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n text: text,\n exactText: exactText,\n exactTextCase: exactTextCase,\n includes: includes,\n includesAll: includesAll,\n includesSome: includesSome,\n includesValue: includesValue,\n exact: exact,\n equals: equals,\n between: between\n });\n\n actions.resetFilters = 'resetFilters';\n actions.setFilter = 'setFilter';\n actions.setAllFilters = 'setAllFilters';\n var useFilters = function useFilters(hooks) {\n hooks.stateReducers.push(reducer$2);\n hooks.useInstance.push(useInstance$2);\n };\n useFilters.pluginName = 'useFilters';\n\n function reducer$2(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n filters: []\n }, state);\n }\n\n if (action.type === actions.resetFilters) {\n return _extends({}, state, {\n filters: instance.initialState.filters || []\n });\n }\n\n if (action.type === actions.setFilter) {\n var columnId = action.columnId,\n filterValue = action.filterValue;\n var allColumns = instance.allColumns,\n userFilterTypes = instance.filterTypes;\n var column = allColumns.find(function (d) {\n return d.id === columnId;\n });\n\n if (!column) {\n throw new Error(\"React-Table: Could not find a column with id: \" + columnId);\n }\n\n var filterMethod = getFilterMethod(column.filter, userFilterTypes || {}, filterTypes);\n var previousfilter = state.filters.find(function (d) {\n return d.id === columnId;\n });\n var newFilter = functionalUpdate(filterValue, previousfilter && previousfilter.value); //\n\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter, column)) {\n return _extends({}, state, {\n filters: state.filters.filter(function (d) {\n return d.id !== columnId;\n })\n });\n }\n\n if (previousfilter) {\n return _extends({}, state, {\n filters: state.filters.map(function (d) {\n if (d.id === columnId) {\n return {\n id: columnId,\n value: newFilter\n };\n }\n\n return d;\n })\n });\n }\n\n return _extends({}, state, {\n filters: [].concat(state.filters, [{\n id: columnId,\n value: newFilter\n }])\n });\n }\n\n if (action.type === actions.setAllFilters) {\n var filters = action.filters;\n var _allColumns = instance.allColumns,\n _userFilterTypes = instance.filterTypes;\n return _extends({}, state, {\n // Filter out undefined values\n filters: functionalUpdate(filters, state.filters).filter(function (filter) {\n var column = _allColumns.find(function (d) {\n return d.id === filter.id;\n });\n\n var filterMethod = getFilterMethod(column.filter, _userFilterTypes || {}, filterTypes);\n\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, filter.value, column)) {\n return false;\n }\n\n return true;\n })\n });\n }\n }\n\n function useInstance$2(instance) {\n var data = instance.data,\n rows = instance.rows,\n flatRows = instance.flatRows,\n rowsById = instance.rowsById,\n allColumns = instance.allColumns,\n userFilterTypes = instance.filterTypes,\n manualFilters = instance.manualFilters,\n _instance$defaultCanF = instance.defaultCanFilter,\n defaultCanFilter = _instance$defaultCanF === void 0 ? false : _instance$defaultCanF,\n disableFilters = instance.disableFilters,\n filters = instance.state.filters,\n dispatch = instance.dispatch,\n _instance$autoResetFi = instance.autoResetFilters,\n autoResetFilters = _instance$autoResetFi === void 0 ? true : _instance$autoResetFi;\n var setFilter = React.useCallback(function (columnId, filterValue) {\n dispatch({\n type: actions.setFilter,\n columnId: columnId,\n filterValue: filterValue\n });\n }, [dispatch]);\n var setAllFilters = React.useCallback(function (filters) {\n dispatch({\n type: actions.setAllFilters,\n filters: filters\n });\n }, [dispatch]);\n allColumns.forEach(function (column) {\n var id = column.id,\n accessor = column.accessor,\n columnDefaultCanFilter = column.defaultCanFilter,\n columnDisableFilters = column.disableFilters; // Determine if a column is filterable\n\n column.canFilter = accessor ? getFirstDefined(columnDisableFilters === true ? false : undefined, disableFilters === true ? false : undefined, true) : getFirstDefined(columnDefaultCanFilter, defaultCanFilter, false); // Provide the column a way of updating the filter value\n\n column.setFilter = function (val) {\n return setFilter(column.id, val);\n }; // Provide the current filter value to the column for\n // convenience\n\n\n var found = filters.find(function (d) {\n return d.id === id;\n });\n column.filterValue = found && found.value;\n });\n\n var _React$useMemo = React.useMemo(function () {\n if (manualFilters || !filters.length) {\n return [rows, flatRows, rowsById];\n }\n\n var filteredFlatRows = [];\n var filteredRowsById = {}; // Filters top level and nested rows\n\n var filterRows = function filterRows(rows, depth) {\n if (depth === void 0) {\n depth = 0;\n }\n\n var filteredRows = rows;\n filteredRows = filters.reduce(function (filteredSoFar, _ref) {\n var columnId = _ref.id,\n filterValue = _ref.value;\n // Find the filters column\n var column = allColumns.find(function (d) {\n return d.id === columnId;\n });\n\n if (!column) {\n return filteredSoFar;\n }\n\n if (depth === 0) {\n column.preFilteredRows = filteredSoFar;\n }\n\n var filterMethod = getFilterMethod(column.filter, userFilterTypes || {}, filterTypes);\n\n if (!filterMethod) {\n console.warn(\"Could not find a valid 'column.filter' for column with the ID: \" + column.id + \".\");\n return filteredSoFar;\n } // Pass the rows, id, filterValue and column to the filterMethod\n // to get the filtered rows back\n\n\n column.filteredRows = filterMethod(filteredSoFar, [columnId], filterValue);\n return column.filteredRows;\n }, rows); // 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\n filteredRows.forEach(function (row) {\n filteredFlatRows.push(row);\n filteredRowsById[row.id] = row;\n\n if (!row.subRows) {\n return;\n }\n\n row.subRows = row.subRows && row.subRows.length > 0 ? filterRows(row.subRows, depth + 1) : row.subRows;\n });\n return filteredRows;\n };\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById];\n }, [manualFilters, filters, rows, flatRows, rowsById, allColumns, userFilterTypes]),\n filteredRows = _React$useMemo[0],\n filteredFlatRows = _React$useMemo[1],\n filteredRowsById = _React$useMemo[2];\n\n React.useMemo(function () {\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 var nonFilteredColumns = allColumns.filter(function (column) {\n return !filters.find(function (d) {\n return d.id === column.id;\n });\n }); // This essentially enables faceted filter options to be built easily\n // using every column's preFilteredRows value\n\n nonFilteredColumns.forEach(function (column) {\n column.preFilteredRows = filteredRows;\n column.filteredRows = filteredRows;\n });\n }, [filteredRows, filters, allColumns]);\n var getAutoResetFilters = useGetLatest(autoResetFilters);\n useMountedLayoutEffect(function () {\n if (getAutoResetFilters()) {\n dispatch({\n type: actions.resetFilters\n });\n }\n }, [dispatch, manualFilters ? null : data]);\n Object.assign(instance, {\n preFilteredRows: rows,\n preFilteredFlatRows: flatRows,\n preFilteredRowsById: rowsById,\n filteredRows: filteredRows,\n filteredFlatRows: filteredFlatRows,\n filteredRowsById: filteredRowsById,\n rows: filteredRows,\n flatRows: filteredFlatRows,\n rowsById: filteredRowsById,\n setFilter: setFilter,\n setAllFilters: setAllFilters\n });\n }\n\n actions.resetGlobalFilter = 'resetGlobalFilter';\n actions.setGlobalFilter = 'setGlobalFilter';\n var useGlobalFilter = function useGlobalFilter(hooks) {\n hooks.stateReducers.push(reducer$3);\n hooks.useInstance.push(useInstance$3);\n };\n useGlobalFilter.pluginName = 'useGlobalFilter';\n\n function reducer$3(state, action, previousState, instance) {\n if (action.type === actions.resetGlobalFilter) {\n return _extends({}, state, {\n globalFilter: instance.initialState.globalFilter || undefined\n });\n }\n\n if (action.type === actions.setGlobalFilter) {\n var filterValue = action.filterValue;\n var userFilterTypes = instance.userFilterTypes;\n var filterMethod = getFilterMethod(instance.globalFilter, userFilterTypes || {}, filterTypes);\n var newFilter = functionalUpdate(filterValue, state.globalFilter); //\n\n if (shouldAutoRemoveFilter(filterMethod.autoRemove, newFilter)) {\n var globalFilter = state.globalFilter,\n stateWithoutGlobalFilter = _objectWithoutPropertiesLoose(state, [\"globalFilter\"]);\n\n return stateWithoutGlobalFilter;\n }\n\n return _extends({}, state, {\n globalFilter: newFilter\n });\n }\n }\n\n function useInstance$3(instance) {\n var data = instance.data,\n rows = instance.rows,\n flatRows = instance.flatRows,\n rowsById = instance.rowsById,\n allColumns = instance.allColumns,\n userFilterTypes = instance.filterTypes,\n globalFilter = instance.globalFilter,\n manualGlobalFilter = instance.manualGlobalFilter,\n globalFilterValue = instance.state.globalFilter,\n dispatch = instance.dispatch,\n _instance$autoResetGl = instance.autoResetGlobalFilter,\n autoResetGlobalFilter = _instance$autoResetGl === void 0 ? true : _instance$autoResetGl,\n disableGlobalFilter = instance.disableGlobalFilter;\n var setGlobalFilter = React.useCallback(function (filterValue) {\n dispatch({\n type: actions.setGlobalFilter,\n filterValue: filterValue\n });\n }, [dispatch]); // 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 var _React$useMemo = React.useMemo(function () {\n if (manualGlobalFilter || typeof globalFilterValue === 'undefined') {\n return [rows, flatRows, rowsById];\n }\n\n var filteredFlatRows = [];\n var filteredRowsById = {};\n var filterMethod = getFilterMethod(globalFilter, userFilterTypes || {}, filterTypes);\n\n if (!filterMethod) {\n console.warn(\"Could not find a valid 'globalFilter' option.\");\n return rows;\n }\n\n allColumns.forEach(function (column) {\n var columnDisableGlobalFilter = column.disableGlobalFilter;\n column.canFilter = getFirstDefined(columnDisableGlobalFilter === true ? false : undefined, disableGlobalFilter === true ? false : undefined, true);\n });\n var filterableColumns = allColumns.filter(function (c) {\n return c.canFilter === true;\n }); // Filters top level and nested rows\n\n var filterRows = function filterRows(filteredRows) {\n filteredRows = filterMethod(filteredRows, filterableColumns.map(function (d) {\n return d.id;\n }), globalFilterValue);\n filteredRows.forEach(function (row) {\n filteredFlatRows.push(row);\n filteredRowsById[row.id] = row;\n row.subRows = row.subRows && row.subRows.length ? filterRows(row.subRows) : row.subRows;\n });\n return filteredRows;\n };\n\n return [filterRows(rows), filteredFlatRows, filteredRowsById];\n }, [manualGlobalFilter, globalFilterValue, globalFilter, userFilterTypes, allColumns, rows, flatRows, rowsById, disableGlobalFilter]),\n globalFilteredRows = _React$useMemo[0],\n globalFilteredFlatRows = _React$useMemo[1],\n globalFilteredRowsById = _React$useMemo[2];\n\n var getAutoResetGlobalFilter = useGetLatest(autoResetGlobalFilter);\n useMountedLayoutEffect(function () {\n if (getAutoResetGlobalFilter()) {\n dispatch({\n type: actions.resetGlobalFilter\n });\n }\n }, [dispatch, manualGlobalFilter ? null : data]);\n Object.assign(instance, {\n preGlobalFilteredRows: rows,\n preGlobalFilteredFlatRows: flatRows,\n preGlobalFilteredRowsById: rowsById,\n globalFilteredRows: globalFilteredRows,\n globalFilteredFlatRows: globalFilteredFlatRows,\n globalFilteredRowsById: globalFilteredRowsById,\n rows: globalFilteredRows,\n flatRows: globalFilteredFlatRows,\n rowsById: globalFilteredRowsById,\n setGlobalFilter: setGlobalFilter,\n disableGlobalFilter: disableGlobalFilter\n });\n }\n\n 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(function (sum, next) {\n return sum + (typeof next === 'number' ? next : 0);\n }, 0);\n }\n function min(values) {\n var min = values[0] || 0;\n values.forEach(function (value) {\n if (typeof value === 'number') {\n min = Math.min(min, value);\n }\n });\n return min;\n }\n function max(values) {\n var max = values[0] || 0;\n values.forEach(function (value) {\n if (typeof value === 'number') {\n max = Math.max(max, value);\n }\n });\n return max;\n }\n function minMax(values) {\n var min = values[0] || 0;\n var max = values[0] || 0;\n values.forEach(function (value) {\n if (typeof value === 'number') {\n min = Math.min(min, value);\n max = Math.max(max, value);\n }\n });\n return min + \"..\" + max;\n }\n function average(values) {\n return sum(null, values) / values.length;\n }\n function median(values) {\n if (!values.length) {\n return null;\n }\n\n var mid = Math.floor(values.length / 2);\n var nums = [].concat(values).sort(function (a, b) {\n return a - b;\n });\n return values.length % 2 !== 0 ? nums[mid] : (nums[mid - 1] + nums[mid]) / 2;\n }\n function unique(values) {\n return Array.from(new Set(values).values());\n }\n function uniqueCount(values) {\n return new Set(values).size;\n }\n function count(values) {\n return values.length;\n }\n\n var aggregations = /*#__PURE__*/Object.freeze({\n __proto__: null,\n sum: sum,\n min: min,\n max: max,\n minMax: minMax,\n average: average,\n median: median,\n unique: unique,\n uniqueCount: uniqueCount,\n count: count\n });\n\n var emptyArray = [];\n var emptyObject = {}; // Actions\n\n actions.resetGroupBy = 'resetGroupBy';\n actions.setGroupBy = 'setGroupBy';\n actions.toggleGroupBy = 'toggleGroupBy';\n var useGroupBy = function useGroupBy(hooks) {\n hooks.getGroupByToggleProps = [defaultGetGroupByToggleProps];\n hooks.stateReducers.push(reducer$4);\n hooks.visibleColumnsDeps.push(function (deps, _ref) {\n var instance = _ref.instance;\n return [].concat(deps, [instance.state.groupBy]);\n });\n hooks.visibleColumns.push(visibleColumns);\n hooks.useInstance.push(useInstance$4);\n hooks.prepareRow.push(prepareRow$1);\n };\n useGroupBy.pluginName = 'useGroupBy';\n\n var defaultGetGroupByToggleProps = function defaultGetGroupByToggleProps(props, _ref2) {\n var header = _ref2.header;\n return [props, {\n onClick: header.canGroupBy ? function (e) {\n e.persist();\n header.toggleGroupBy();\n } : undefined,\n style: {\n cursor: header.canGroupBy ? 'pointer' : undefined\n },\n title: 'Toggle GroupBy'\n }];\n }; // Reducer\n\n\n function reducer$4(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n groupBy: []\n }, state);\n }\n\n if (action.type === actions.resetGroupBy) {\n return _extends({}, state, {\n groupBy: instance.initialState.groupBy || []\n });\n }\n\n if (action.type === actions.setGroupBy) {\n var value = action.value;\n return _extends({}, state, {\n groupBy: value\n });\n }\n\n if (action.type === actions.toggleGroupBy) {\n var columnId = action.columnId,\n setGroupBy = action.value;\n var resolvedGroupBy = typeof setGroupBy !== 'undefined' ? setGroupBy : !state.groupBy.includes(columnId);\n\n if (resolvedGroupBy) {\n return _extends({}, state, {\n groupBy: [].concat(state.groupBy, [columnId])\n });\n }\n\n return _extends({}, state, {\n groupBy: state.groupBy.filter(function (d) {\n return d !== columnId;\n })\n });\n }\n }\n\n function visibleColumns(columns, _ref3) {\n var groupBy = _ref3.instance.state.groupBy;\n // Sort grouped columns to the start of the column list\n // before the headers are built\n var groupByColumns = groupBy.map(function (g) {\n return columns.find(function (col) {\n return col.id === g;\n });\n }).filter(Boolean);\n var nonGroupByColumns = columns.filter(function (col) {\n return !groupBy.includes(col.id);\n });\n columns = [].concat(groupByColumns, nonGroupByColumns);\n columns.forEach(function (column) {\n column.isGrouped = groupBy.includes(column.id);\n column.groupedIndex = groupBy.indexOf(column.id);\n });\n return columns;\n }\n\n var defaultUserAggregations = {};\n\n function useInstance$4(instance) {\n var data = instance.data,\n rows = instance.rows,\n flatRows = instance.flatRows,\n rowsById = instance.rowsById,\n allColumns = instance.allColumns,\n flatHeaders = instance.flatHeaders,\n _instance$groupByFn = instance.groupByFn,\n groupByFn = _instance$groupByFn === void 0 ? defaultGroupByFn : _instance$groupByFn,\n manualGroupBy = instance.manualGroupBy,\n _instance$aggregation = instance.aggregations,\n userAggregations = _instance$aggregation === void 0 ? defaultUserAggregations : _instance$aggregation,\n plugins = instance.plugins,\n groupBy = instance.state.groupBy,\n dispatch = instance.dispatch,\n _instance$autoResetGr = instance.autoResetGroupBy,\n autoResetGroupBy = _instance$autoResetGr === void 0 ? true : _instance$autoResetGr,\n disableGroupBy = instance.disableGroupBy,\n defaultCanGroupBy = instance.defaultCanGroupBy,\n getHooks = instance.getHooks;\n ensurePluginOrder(plugins, ['useColumnOrder', 'useFilters'], 'useGroupBy');\n var getInstance = useGetLatest(instance);\n allColumns.forEach(function (column) {\n var accessor = column.accessor,\n defaultColumnGroupBy = column.defaultGroupBy,\n columnDisableGroupBy = column.disableGroupBy;\n column.canGroupBy = accessor ? getFirstDefined(column.canGroupBy, columnDisableGroupBy === true ? false : undefined, disableGroupBy === true ? false : undefined, true) : getFirstDefined(column.canGroupBy, defaultColumnGroupBy, defaultCanGroupBy, false);\n\n if (column.canGroupBy) {\n column.toggleGroupBy = function () {\n return instance.toggleGroupBy(column.id);\n };\n }\n\n column.Aggregated = column.Aggregated || column.Cell;\n });\n var toggleGroupBy = React.useCallback(function (columnId, value) {\n dispatch({\n type: actions.toggleGroupBy,\n columnId: columnId,\n value: value\n });\n }, [dispatch]);\n var setGroupBy = React.useCallback(function (value) {\n dispatch({\n type: actions.setGroupBy,\n value: value\n });\n }, [dispatch]);\n flatHeaders.forEach(function (header) {\n header.getGroupByToggleProps = makePropGetter(getHooks().getGroupByToggleProps, {\n instance: getInstance(),\n header: header\n });\n });\n\n var _React$useMemo = React.useMemo(function () {\n if (manualGroupBy || !groupBy.length) {\n return [rows, flatRows, rowsById, emptyArray, emptyObject, flatRows, rowsById];\n } // Ensure that the list of filtered columns exist\n\n\n var existingGroupBy = groupBy.filter(function (g) {\n return allColumns.find(function (col) {\n return 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\n var aggregateRowsToValues = function aggregateRowsToValues(leafRows, groupedRows, depth) {\n var values = {};\n allColumns.forEach(function (column) {\n // Don't aggregate columns that are in the groupBy\n if (existingGroupBy.includes(column.id)) {\n values[column.id] = groupedRows[0] ? groupedRows[0].values[column.id] : null;\n return;\n } // Aggregate the values\n\n\n var aggregateFn = typeof column.aggregate === 'function' ? column.aggregate : userAggregations[column.aggregate] || aggregations[column.aggregate];\n\n if (aggregateFn) {\n // Get the columnValues to aggregate\n var groupedValues = groupedRows.map(function (row) {\n return row.values[column.id];\n }); // Get the columnValues to aggregate\n\n var leafValues = leafRows.map(function (row) {\n var columnValue = row.values[column.id];\n\n if (!depth && column.aggregateValue) {\n var aggregateValueFn = typeof column.aggregateValue === 'function' ? column.aggregateValue : userAggregations[column.aggregateValue] || aggregations[column.aggregateValue];\n\n if (!aggregateValueFn) {\n console.info({\n column: column\n });\n throw new Error(\"React Table: Invalid column.aggregateValue option for column listed above\");\n }\n\n columnValue = aggregateValueFn(columnValue, row, column);\n }\n\n return columnValue;\n });\n values[column.id] = aggregateFn(leafValues, groupedValues);\n } else if (column.aggregate) {\n console.info({\n column: column\n });\n throw new Error(\"React Table: Invalid column.aggregate option for column listed above\");\n } else {\n values[column.id] = null;\n }\n });\n return values;\n };\n\n var groupedFlatRows = [];\n var groupedRowsById = {};\n var onlyGroupedFlatRows = [];\n var onlyGroupedRowsById = {};\n var nonGroupedFlatRows = [];\n var nonGroupedRowsById = {}; // Recursively group the data\n\n var groupUpRecursively = function groupUpRecursively(rows, depth, parentId) {\n if (depth === void 0) {\n depth = 0;\n }\n\n // This is the last level, just return the rows\n if (depth === existingGroupBy.length) {\n return rows.map(function (row) {\n return _extends({}, row, {\n depth: depth\n });\n });\n }\n\n var columnId = existingGroupBy[depth]; // Group the rows together for this level\n\n var rowGroupsMap = groupByFn(rows, columnId); // Peform aggregations for each group\n\n var aggregatedGroupedRows = Object.entries(rowGroupsMap).map(function (_ref4, index) {\n var groupByVal = _ref4[0],\n groupedRows = _ref4[1];\n var id = columnId + \":\" + groupByVal;\n id = parentId ? parentId + \">\" + id : id; // First, Recurse to group sub rows before aggregation\n\n var subRows = groupUpRecursively(groupedRows, depth + 1, id); // Flatten the leaf rows of the rows in this group\n\n var leafRows = depth ? flattenBy(groupedRows, 'leafRows') : groupedRows;\n var values = aggregateRowsToValues(leafRows, groupedRows, depth);\n var row = {\n id: id,\n isGrouped: true,\n groupByID: columnId,\n groupByVal: groupByVal,\n values: values,\n subRows: subRows,\n leafRows: leafRows,\n depth: depth,\n index: index\n };\n subRows.forEach(function (subRow) {\n groupedFlatRows.push(subRow);\n groupedRowsById[subRow.id] = subRow;\n\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 return row;\n });\n return aggregatedGroupedRows;\n };\n\n var groupedRows = groupUpRecursively(rows);\n groupedRows.forEach(function (subRow) {\n groupedFlatRows.push(subRow);\n groupedRowsById[subRow.id] = subRow;\n\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 }); // Assign the new data\n\n return [groupedRows, groupedFlatRows, groupedRowsById, onlyGroupedFlatRows, onlyGroupedRowsById, nonGroupedFlatRows, nonGroupedRowsById];\n }, [manualGroupBy, groupBy, rows, flatRows, rowsById, allColumns, userAggregations, groupByFn]),\n groupedRows = _React$useMemo[0],\n groupedFlatRows = _React$useMemo[1],\n groupedRowsById = _React$useMemo[2],\n onlyGroupedFlatRows = _React$useMemo[3],\n onlyGroupedRowsById = _React$useMemo[4],\n nonGroupedFlatRows = _React$useMemo[5],\n nonGroupedRowsById = _React$useMemo[6];\n\n var getAutoResetGroupBy = useGetLatest(autoResetGroupBy);\n useMountedLayoutEffect(function () {\n if (getAutoResetGroupBy()) {\n dispatch({\n type: actions.resetGroupBy\n });\n }\n }, [dispatch, manualGroupBy ? null : data]);\n Object.assign(instance, {\n preGroupedRows: rows,\n preGroupedFlatRow: flatRows,\n preGroupedRowsById: rowsById,\n groupedRows: groupedRows,\n groupedFlatRows: groupedFlatRows,\n groupedRowsById: groupedRowsById,\n onlyGroupedFlatRows: onlyGroupedFlatRows,\n onlyGroupedRowsById: onlyGroupedRowsById,\n nonGroupedFlatRows: nonGroupedFlatRows,\n nonGroupedRowsById: nonGroupedRowsById,\n rows: groupedRows,\n flatRows: groupedFlatRows,\n rowsById: groupedRowsById,\n toggleGroupBy: toggleGroupBy,\n setGroupBy: setGroupBy\n });\n }\n\n function prepareRow$1(row) {\n row.allCells.forEach(function (cell) {\n var _row$subRows;\n\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; // Placeholder cells are any columns in the groupBy that are not grouped\n\n cell.isPlaceholder = !cell.isGrouped && cell.column.isGrouped; // Aggregated cells are not grouped, not repeated, but still have subRows\n\n cell.isAggregated = !cell.isGrouped && !cell.isPlaceholder && ((_row$subRows = row.subRows) == null ? void 0 : _row$subRows.length);\n });\n }\n\n function defaultGroupByFn(rows, columnId) {\n return rows.reduce(function (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 var resKey = \"\" + row.values[columnId];\n prev[resKey] = Array.isArray(prev[resKey]) ? prev[resKey] : [];\n prev[resKey].push(row);\n return prev;\n }, {});\n }\n\n var reSplitAlphaNumeric = /([0-9]+)/gm; // 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\n\n var alphanumeric = function alphanumeric(rowA, rowB, columnId) {\n var _getRowValuesByColumn = getRowValuesByColumnID(rowA, rowB, columnId),\n a = _getRowValuesByColumn[0],\n b = _getRowValuesByColumn[1]; // Force to strings (or \"\" for unsupported types)\n\n\n a = toString(a);\n b = toString(b); // Split on number groups, but keep the delimiter\n // Then remove falsey split values\n\n a = a.split(reSplitAlphaNumeric).filter(Boolean);\n b = b.split(reSplitAlphaNumeric).filter(Boolean); // While\n\n while (a.length && b.length) {\n var aa = a.shift();\n var bb = b.shift();\n var an = parseInt(aa, 10);\n var bn = parseInt(bb, 10);\n var combo = [an, bn].sort(); // Both are string\n\n if (isNaN(combo[0])) {\n if (aa > bb) {\n return 1;\n }\n\n if (bb > aa) {\n return -1;\n }\n\n continue;\n } // One is a string, one is a number\n\n\n if (isNaN(combo[1])) {\n return isNaN(an) ? -1 : 1;\n } // Both are numbers\n\n\n if (an > bn) {\n return 1;\n }\n\n if (bn > an) {\n return -1;\n }\n }\n\n return a.length - b.length;\n };\n function datetime(rowA, rowB, columnId) {\n var _getRowValuesByColumn2 = getRowValuesByColumnID(rowA, rowB, columnId),\n a = _getRowValuesByColumn2[0],\n b = _getRowValuesByColumn2[1];\n\n a = a.getTime();\n b = b.getTime();\n return compareBasic(a, b);\n }\n function basic(rowA, rowB, columnId) {\n var _getRowValuesByColumn3 = getRowValuesByColumnID(rowA, rowB, columnId),\n a = _getRowValuesByColumn3[0],\n b = _getRowValuesByColumn3[1];\n\n return compareBasic(a, b);\n }\n function string(rowA, rowB, columnId) {\n var _getRowValuesByColumn4 = getRowValuesByColumnID(rowA, rowB, columnId),\n a = _getRowValuesByColumn4[0],\n b = _getRowValuesByColumn4[1];\n\n a = a.split('').filter(Boolean);\n b = b.split('').filter(Boolean);\n\n while (a.length && b.length) {\n var aa = a.shift();\n var bb = b.shift();\n var alower = aa.toLowerCase();\n var blower = bb.toLowerCase(); // Case insensitive comparison until characters match\n\n if (alower > blower) {\n return 1;\n }\n\n if (blower > alower) {\n return -1;\n } // If lowercase characters are identical\n\n\n if (aa > bb) {\n return 1;\n }\n\n if (bb > aa) {\n return -1;\n }\n\n continue;\n }\n\n return a.length - b.length;\n }\n function number(rowA, rowB, columnId) {\n var _getRowValuesByColumn5 = getRowValuesByColumnID(rowA, rowB, columnId),\n a = _getRowValuesByColumn5[0],\n b = _getRowValuesByColumn5[1];\n\n var replaceNonNumeric = /[^0-9.]/gi;\n a = Number(String(a).replace(replaceNonNumeric, ''));\n b = Number(String(b).replace(replaceNonNumeric, ''));\n return compareBasic(a, b);\n } // Utils\n\n function compareBasic(a, b) {\n return a === b ? 0 : a > b ? 1 : -1;\n }\n\n function getRowValuesByColumnID(row1, row2, columnId) {\n return [row1.values[columnId], row2.values[columnId]];\n }\n\n function toString(a) {\n if (typeof a === 'number') {\n if (isNaN(a) || a === Infinity || a === -Infinity) {\n return '';\n }\n\n return String(a);\n }\n\n if (typeof a === 'string') {\n return a;\n }\n\n return '';\n }\n\n var sortTypes = /*#__PURE__*/Object.freeze({\n __proto__: null,\n alphanumeric: alphanumeric,\n datetime: datetime,\n basic: basic,\n string: string,\n number: number\n });\n\n actions.resetSortBy = 'resetSortBy';\n actions.setSortBy = 'setSortBy';\n actions.toggleSortBy = 'toggleSortBy';\n actions.clearSortBy = 'clearSortBy';\n defaultColumn.sortType = 'alphanumeric';\n defaultColumn.sortDescFirst = false;\n var useSortBy = function useSortBy(hooks) {\n hooks.getSortByToggleProps = [defaultGetSortByToggleProps];\n hooks.stateReducers.push(reducer$5);\n hooks.useInstance.push(useInstance$5);\n };\n useSortBy.pluginName = 'useSortBy';\n\n var defaultGetSortByToggleProps = function defaultGetSortByToggleProps(props, _ref) {\n var instance = _ref.instance,\n column = _ref.column;\n var _instance$isMultiSort = instance.isMultiSortEvent,\n isMultiSortEvent = _instance$isMultiSort === void 0 ? function (e) {\n return e.shiftKey;\n } : _instance$isMultiSort;\n return [props, {\n onClick: column.canSort ? function (e) {\n e.persist();\n column.toggleSortBy(undefined, !instance.disableMultiSort && isMultiSortEvent(e));\n } : undefined,\n style: {\n cursor: column.canSort ? 'pointer' : undefined\n },\n title: column.canSort ? 'Toggle SortBy' : undefined\n }];\n }; // Reducer\n\n\n function reducer$5(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n sortBy: []\n }, state);\n }\n\n if (action.type === actions.resetSortBy) {\n return _extends({}, state, {\n sortBy: instance.initialState.sortBy || []\n });\n }\n\n if (action.type === actions.clearSortBy) {\n var sortBy = state.sortBy;\n var newSortBy = sortBy.filter(function (d) {\n return d.id !== action.columnId;\n });\n return _extends({}, state, {\n sortBy: newSortBy\n });\n }\n\n if (action.type === actions.setSortBy) {\n var _sortBy = action.sortBy;\n return _extends({}, state, {\n sortBy: _sortBy\n });\n }\n\n if (action.type === actions.toggleSortBy) {\n var columnId = action.columnId,\n desc = action.desc,\n multi = action.multi;\n var allColumns = instance.allColumns,\n disableMultiSort = instance.disableMultiSort,\n disableSortRemove = instance.disableSortRemove,\n disableMultiRemove = instance.disableMultiRemove,\n _instance$maxMultiSor = instance.maxMultiSortColCount,\n maxMultiSortColCount = _instance$maxMultiSor === void 0 ? Number.MAX_SAFE_INTEGER : _instance$maxMultiSor;\n var _sortBy2 = state.sortBy; // Find the column for this columnId\n\n var column = allColumns.find(function (d) {\n return d.id === columnId;\n });\n var sortDescFirst = column.sortDescFirst; // Find any existing sortBy for this column\n\n var existingSortBy = _sortBy2.find(function (d) {\n return d.id === columnId;\n });\n\n var existingIndex = _sortBy2.findIndex(function (d) {\n return d.id === columnId;\n });\n\n var hasDescDefined = typeof desc !== 'undefined' && desc !== null;\n var _newSortBy = []; // What should we do with this sort action?\n\n var 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 !== _sortBy2.length - 1 || _sortBy2.length !== 1) {\n sortAction = 'replace';\n } else if (existingSortBy) {\n sortAction = 'toggle';\n } else {\n sortAction = 'replace';\n }\n } // Handle toggle states that will remove the sortBy\n\n\n if (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 && !sortDescFirst || !existingSortBy.desc && sortDescFirst)) {\n sortAction = 'remove';\n }\n\n if (sortAction === 'replace') {\n _newSortBy = [{\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst\n }];\n } else if (sortAction === 'add') {\n _newSortBy = [].concat(_sortBy2, [{\n id: columnId,\n desc: hasDescDefined ? desc : sortDescFirst\n }]); // Take latest n columns\n\n _newSortBy.splice(0, _newSortBy.length - maxMultiSortColCount);\n } else if (sortAction === 'toggle') {\n // This flips (or sets) the\n _newSortBy = _sortBy2.map(function (d) {\n if (d.id === columnId) {\n return _extends({}, d, {\n desc: hasDescDefined ? desc : !existingSortBy.desc\n });\n }\n\n return d;\n });\n } else if (sortAction === 'remove') {\n _newSortBy = _sortBy2.filter(function (d) {\n return d.id !== columnId;\n });\n }\n\n return _extends({}, state, {\n sortBy: _newSortBy\n });\n }\n }\n\n function useInstance$5(instance) {\n var data = instance.data,\n rows = instance.rows,\n flatRows = instance.flatRows,\n allColumns = instance.allColumns,\n _instance$orderByFn = instance.orderByFn,\n orderByFn = _instance$orderByFn === void 0 ? defaultOrderByFn : _instance$orderByFn,\n userSortTypes = instance.sortTypes,\n manualSortBy = instance.manualSortBy,\n defaultCanSort = instance.defaultCanSort,\n disableSortBy = instance.disableSortBy,\n flatHeaders = instance.flatHeaders,\n sortBy = instance.state.sortBy,\n dispatch = instance.dispatch,\n plugins = instance.plugins,\n getHooks = instance.getHooks,\n _instance$autoResetSo = instance.autoResetSortBy,\n autoResetSortBy = _instance$autoResetSo === void 0 ? true : _instance$autoResetSo;\n ensurePluginOrder(plugins, ['useFilters', 'useGlobalFilter', 'useGroupBy', 'usePivotColumns'], 'useSortBy');\n var setSortBy = React.useCallback(function (sortBy) {\n dispatch({\n type: actions.setSortBy,\n sortBy: sortBy\n });\n }, [dispatch]); // Updates sorting based on a columnId, desc flag and multi flag\n\n var toggleSortBy = React.useCallback(function (columnId, desc, multi) {\n dispatch({\n type: actions.toggleSortBy,\n columnId: columnId,\n desc: desc,\n multi: multi\n });\n }, [dispatch]); // use reference to avoid memory leak in #1608\n\n var getInstance = useGetLatest(instance); // Add the getSortByToggleProps method to columns and headers\n\n flatHeaders.forEach(function (column) {\n var accessor = column.accessor,\n defaultColumnCanSort = column.canSort,\n columnDisableSortBy = column.disableSortBy,\n id = column.id;\n var canSort = accessor ? getFirstDefined(columnDisableSortBy === true ? false : undefined, disableSortBy === true ? false : undefined, true) : getFirstDefined(defaultCanSort, defaultColumnCanSort, false);\n column.canSort = canSort;\n\n if (column.canSort) {\n column.toggleSortBy = function (desc, multi) {\n return toggleSortBy(column.id, desc, multi);\n };\n\n column.clearSortBy = function () {\n dispatch({\n type: actions.clearSortBy,\n columnId: column.id\n });\n };\n }\n\n column.getSortByToggleProps = makePropGetter(getHooks().getSortByToggleProps, {\n instance: getInstance(),\n column: column\n });\n var columnSort = sortBy.find(function (d) {\n return d.id === id;\n });\n column.isSorted = !!columnSort;\n column.sortedIndex = sortBy.findIndex(function (d) {\n return d.id === id;\n });\n column.isSortedDesc = column.isSorted ? columnSort.desc : undefined;\n });\n\n var _React$useMemo = React.useMemo(function () {\n if (manualSortBy || !sortBy.length) {\n return [rows, flatRows];\n }\n\n var sortedFlatRows = []; // Filter out sortBys that correspond to non existing columns\n\n var availableSortBy = sortBy.filter(function (sort) {\n return allColumns.find(function (col) {\n return col.id === sort.id;\n });\n });\n\n var sortData = function 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 var sortedData = orderByFn(rows, availableSortBy.map(function (sort) {\n // Support custom sorting methods for each column\n var column = allColumns.find(function (d) {\n return d.id === sort.id;\n });\n\n if (!column) {\n throw new Error(\"React-Table: Could not find a column with id: \" + sort.id + \" while sorting\");\n }\n\n var sortType = column.sortType; // 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\n var sortMethod = isFunction(sortType) || (userSortTypes || {})[sortType] || sortTypes[sortType];\n\n if (!sortMethod) {\n throw new Error(\"React-Table: Could not find a valid sortType of '\" + sortType + \"' for column '\" + sort.id + \"'.\");\n } // Return the correct sortFn.\n // This function should always return in ascending order\n\n\n return function (a, b) {\n return sortMethod(a, b, sort.id, sort.desc);\n };\n }), // Map the directions\n availableSortBy.map(function (sort) {\n // Detect and use the sortInverted option\n var column = allColumns.find(function (d) {\n return d.id === sort.id;\n });\n\n if (column && column.sortInverted) {\n return sort.desc;\n }\n\n return !sort.desc;\n })); // If there are sub-rows, sort them\n\n sortedData.forEach(function (row) {\n sortedFlatRows.push(row);\n\n if (!row.subRows || row.subRows.length === 0) {\n return;\n }\n\n row.subRows = sortData(row.subRows);\n });\n return sortedData;\n };\n\n return [sortData(rows), sortedFlatRows];\n }, [manualSortBy, sortBy, rows, flatRows, allColumns, orderByFn, userSortTypes]),\n sortedRows = _React$useMemo[0],\n sortedFlatRows = _React$useMemo[1];\n\n var getAutoResetSortBy = useGetLatest(autoResetSortBy);\n useMountedLayoutEffect(function () {\n if (getAutoResetSortBy()) {\n dispatch({\n type: actions.resetSortBy\n });\n }\n }, [manualSortBy ? null : data]);\n Object.assign(instance, {\n preSortedRows: rows,\n preSortedFlatRows: flatRows,\n sortedRows: sortedRows,\n sortedFlatRows: sortedFlatRows,\n rows: sortedRows,\n flatRows: sortedFlatRows,\n setSortBy: setSortBy,\n toggleSortBy: toggleSortBy\n });\n }\n\n function defaultOrderByFn(arr, funcs, dirs) {\n return [].concat(arr).sort(function (rowA, rowB) {\n for (var i = 0; i < funcs.length; i += 1) {\n var sortFn = funcs[i];\n var desc = dirs[i] === false || dirs[i] === 'desc';\n var sortInt = sortFn(rowA, rowB);\n\n if (sortInt !== 0) {\n return desc ? -sortInt : sortInt;\n }\n }\n\n return dirs[0] ? rowA.index - rowB.index : rowB.index - rowA.index;\n });\n }\n\n var pluginName = 'usePagination'; // Actions\n\n actions.resetPage = 'resetPage';\n actions.gotoPage = 'gotoPage';\n actions.setPageSize = 'setPageSize';\n var usePagination = function usePagination(hooks) {\n hooks.stateReducers.push(reducer$6);\n hooks.useInstance.push(useInstance$6);\n };\n usePagination.pluginName = pluginName;\n\n function reducer$6(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n pageSize: 10,\n pageIndex: 0\n }, state);\n }\n\n if (action.type === actions.resetPage) {\n return _extends({}, state, {\n pageIndex: instance.initialState.pageIndex || 0\n });\n }\n\n if (action.type === actions.gotoPage) {\n var pageCount = instance.pageCount,\n page = instance.page;\n var newPageIndex = functionalUpdate(action.pageIndex, state.pageIndex);\n var 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 _extends({}, state, {\n pageIndex: newPageIndex\n });\n }\n\n if (action.type === actions.setPageSize) {\n var pageSize = action.pageSize;\n var topRowIndex = state.pageSize * state.pageIndex;\n var pageIndex = Math.floor(topRowIndex / pageSize);\n return _extends({}, state, {\n pageIndex: pageIndex,\n pageSize: pageSize\n });\n }\n }\n\n function useInstance$6(instance) {\n var rows = instance.rows,\n _instance$autoResetPa = instance.autoResetPage,\n autoResetPage = _instance$autoResetPa === void 0 ? true : _instance$autoResetPa,\n _instance$manualExpan = instance.manualExpandedKey,\n manualExpandedKey = _instance$manualExpan === void 0 ? 'expanded' : _instance$manualExpan,\n plugins = instance.plugins,\n userPageCount = instance.pageCount,\n _instance$paginateExp = instance.paginateExpandedRows,\n paginateExpandedRows = _instance$paginateExp === void 0 ? true : _instance$paginateExp,\n _instance$expandSubRo = instance.expandSubRows,\n expandSubRows = _instance$expandSubRo === void 0 ? true : _instance$expandSubRo,\n _instance$state = instance.state,\n pageSize = _instance$state.pageSize,\n pageIndex = _instance$state.pageIndex,\n expanded = _instance$state.expanded,\n globalFilter = _instance$state.globalFilter,\n filters = _instance$state.filters,\n groupBy = _instance$state.groupBy,\n sortBy = _instance$state.sortBy,\n dispatch = instance.dispatch,\n data = instance.data,\n manualPagination = instance.manualPagination;\n ensurePluginOrder(plugins, ['useGlobalFilter', 'useFilters', 'useGroupBy', 'useSortBy', 'useExpanded'], 'usePagination');\n var getAutoResetPage = useGetLatest(autoResetPage);\n useMountedLayoutEffect(function () {\n if (getAutoResetPage()) {\n dispatch({\n type: actions.resetPage\n });\n }\n }, [dispatch, manualPagination ? null : data, globalFilter, filters, groupBy, sortBy]);\n var pageCount = manualPagination ? userPageCount : Math.ceil(rows.length / pageSize);\n var pageOptions = React.useMemo(function () {\n return pageCount > 0 ? [].concat(new Array(pageCount)).fill(null).map(function (d, i) {\n return i;\n }) : [];\n }, [pageCount]);\n var page = React.useMemo(function () {\n var page;\n\n if (manualPagination) {\n page = rows;\n } else {\n var pageStart = pageSize * pageIndex;\n var pageEnd = pageStart + pageSize;\n page = rows.slice(pageStart, pageEnd);\n }\n\n if (paginateExpandedRows) {\n return page;\n }\n\n return expandRows(page, {\n manualExpandedKey: manualExpandedKey,\n expanded: expanded,\n expandSubRows: expandSubRows\n });\n }, [expandSubRows, expanded, manualExpandedKey, manualPagination, pageIndex, pageSize, paginateExpandedRows, rows]);\n var canPreviousPage = pageIndex > 0;\n var canNextPage = pageCount === -1 ? page.length >= pageSize : pageIndex < pageCount - 1;\n var gotoPage = React.useCallback(function (pageIndex) {\n dispatch({\n type: actions.gotoPage,\n pageIndex: pageIndex\n });\n }, [dispatch]);\n var previousPage = React.useCallback(function () {\n return gotoPage(function (old) {\n return old - 1;\n });\n }, [gotoPage]);\n var nextPage = React.useCallback(function () {\n return gotoPage(function (old) {\n return old + 1;\n });\n }, [gotoPage]);\n var setPageSize = React.useCallback(function (pageSize) {\n dispatch({\n type: actions.setPageSize,\n pageSize: pageSize\n });\n }, [dispatch]);\n Object.assign(instance, {\n pageOptions: pageOptions,\n pageCount: pageCount,\n page: page,\n canPreviousPage: canPreviousPage,\n canNextPage: canNextPage,\n gotoPage: gotoPage,\n previousPage: previousPage,\n nextPage: nextPage,\n setPageSize: setPageSize\n });\n }\n\n actions.resetPivot = 'resetPivot';\n actions.togglePivot = 'togglePivot';\n var _UNSTABLE_usePivotColumns = function _UNSTABLE_usePivotColumns(hooks) {\n hooks.getPivotToggleProps = [defaultGetPivotToggleProps];\n hooks.stateReducers.push(reducer$7);\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$1);\n hooks.visibleColumnsDeps.push(visibleColumnsDeps);\n hooks.useInstance.push(useInstance$7);\n hooks.prepareRow.push(prepareRow$2);\n };\n _UNSTABLE_usePivotColumns.pluginName = 'usePivotColumns';\n var defaultPivotColumns = [];\n\n var defaultGetPivotToggleProps = function defaultGetPivotToggleProps(props, _ref) {\n var header = _ref.header;\n return [props, {\n onClick: header.canPivot ? function (e) {\n e.persist();\n header.togglePivot();\n } : undefined,\n style: {\n cursor: header.canPivot ? 'pointer' : undefined\n },\n title: 'Toggle Pivot'\n }];\n }; // Reducer\n\n\n function reducer$7(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n pivotColumns: defaultPivotColumns\n }, state);\n }\n\n if (action.type === actions.resetPivot) {\n return _extends({}, state, {\n pivotColumns: instance.initialState.pivotColumns || defaultPivotColumns\n });\n }\n\n if (action.type === actions.togglePivot) {\n var columnId = action.columnId,\n setPivot = action.value;\n var resolvedPivot = typeof setPivot !== 'undefined' ? setPivot : !state.pivotColumns.includes(columnId);\n\n if (resolvedPivot) {\n return _extends({}, state, {\n pivotColumns: [].concat(state.pivotColumns, [columnId])\n });\n }\n\n return _extends({}, state, {\n pivotColumns: state.pivotColumns.filter(function (d) {\n return d !== columnId;\n })\n });\n }\n }\n\n function useInstanceAfterData(instance) {\n instance.allColumns.forEach(function (column) {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id);\n });\n }\n\n function allColumns(columns, _ref2) {\n var instance = _ref2.instance;\n columns.forEach(function (column) {\n column.isPivotSource = instance.state.pivotColumns.includes(column.id);\n column.uniqueValues = new Set();\n });\n return columns;\n }\n\n function accessValue(value, _ref3) {\n var column = _ref3.column;\n\n if (column.uniqueValues && typeof value !== 'undefined') {\n column.uniqueValues.add(value);\n }\n\n return value;\n }\n\n function materializedColumns(materialized, _ref4) {\n var instance = _ref4.instance;\n var allColumns = instance.allColumns,\n state = instance.state;\n\n if (!state.pivotColumns.length || !state.groupBy || !state.groupBy.length) {\n return materialized;\n }\n\n var pivotColumns = state.pivotColumns.map(function (id) {\n return allColumns.find(function (d) {\n return d.id === id;\n });\n }).filter(Boolean);\n var sourceColumns = allColumns.filter(function (d) {\n return !d.isPivotSource && !state.groupBy.includes(d.id) && !state.pivotColumns.includes(d.id);\n });\n\n var buildPivotColumns = function buildPivotColumns(depth, parent, pivotFilters) {\n if (depth === void 0) {\n depth = 0;\n }\n\n if (pivotFilters === void 0) {\n pivotFilters = [];\n }\n\n var pivotColumn = pivotColumns[depth];\n\n if (!pivotColumn) {\n return sourceColumns.map(function (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 return _extends({}, sourceColumn, {\n canPivot: false,\n isPivoted: true,\n parent: parent,\n depth: depth,\n id: \"\" + (parent ? parent.id + \".\" + sourceColumn.id : sourceColumn.id),\n accessor: function accessor(originalRow, i, row) {\n if (pivotFilters.every(function (filter) {\n return filter(row);\n })) {\n return row.values[sourceColumn.id];\n }\n }\n });\n });\n }\n\n var uniqueValues = Array.from(pivotColumn.uniqueValues).sort();\n return uniqueValues.map(function (uniqueValue) {\n var columnGroup = _extends({}, pivotColumn, {\n Header: pivotColumn.PivotHeader || typeof pivotColumn.header === 'string' ? pivotColumn.Header + \": \" + uniqueValue : uniqueValue,\n isPivotGroup: true,\n parent: parent,\n depth: depth,\n id: parent ? parent.id + \".\" + pivotColumn.id + \".\" + uniqueValue : pivotColumn.id + \".\" + uniqueValue,\n pivotValue: uniqueValue\n });\n\n columnGroup.columns = buildPivotColumns(depth + 1, columnGroup, [].concat(pivotFilters, [function (row) {\n return row.values[pivotColumn.id] === uniqueValue;\n }]));\n return columnGroup;\n });\n };\n\n var newMaterialized = flattenColumns(buildPivotColumns());\n return [].concat(materialized, newMaterialized);\n }\n\n function materializedColumnsDeps(deps, _ref5) {\n var _ref5$instance$state = _ref5.instance.state,\n pivotColumns = _ref5$instance$state.pivotColumns,\n groupBy = _ref5$instance$state.groupBy;\n return [].concat(deps, [pivotColumns, groupBy]);\n }\n\n function visibleColumns$1(visibleColumns, _ref6) {\n var state = _ref6.instance.state;\n visibleColumns = visibleColumns.filter(function (d) {\n return !d.isPivotSource;\n });\n\n if (state.pivotColumns.length && state.groupBy && state.groupBy.length) {\n visibleColumns = visibleColumns.filter(function (column) {\n return column.isGrouped || column.isPivoted;\n });\n }\n\n return visibleColumns;\n }\n\n function visibleColumnsDeps(deps, _ref7) {\n var instance = _ref7.instance;\n return [].concat(deps, [instance.state.pivotColumns, instance.state.groupBy]);\n }\n\n function useInstance$7(instance) {\n var columns = instance.columns,\n allColumns = instance.allColumns,\n flatHeaders = instance.flatHeaders,\n getHooks = instance.getHooks,\n plugins = instance.plugins,\n dispatch = instance.dispatch,\n _instance$autoResetPi = instance.autoResetPivot,\n autoResetPivot = _instance$autoResetPi === void 0 ? true : _instance$autoResetPi,\n manaulPivot = instance.manaulPivot,\n disablePivot = instance.disablePivot,\n defaultCanPivot = instance.defaultCanPivot;\n ensurePluginOrder(plugins, ['useGroupBy'], 'usePivotColumns');\n var getInstance = useGetLatest(instance);\n allColumns.forEach(function (column) {\n var accessor = column.accessor,\n defaultColumnPivot = column.defaultPivot,\n columnDisablePivot = column.disablePivot;\n column.canPivot = accessor ? getFirstDefined(column.canPivot, columnDisablePivot === true ? false : undefined, disablePivot === true ? false : undefined, true) : getFirstDefined(column.canPivot, defaultColumnPivot, defaultCanPivot, false);\n\n if (column.canPivot) {\n column.togglePivot = function () {\n return instance.togglePivot(column.id);\n };\n }\n\n column.Aggregated = column.Aggregated || column.Cell;\n });\n\n var togglePivot = function togglePivot(columnId, value) {\n dispatch({\n type: actions.togglePivot,\n columnId: columnId,\n value: value\n });\n };\n\n flatHeaders.forEach(function (header) {\n header.getPivotToggleProps = makePropGetter(getHooks().getPivotToggleProps, {\n instance: getInstance(),\n header: header\n });\n });\n var getAutoResetPivot = useGetLatest(autoResetPivot);\n useMountedLayoutEffect(function () {\n if (getAutoResetPivot()) {\n dispatch({\n type: actions.resetPivot\n });\n }\n }, [dispatch, manaulPivot ? null : columns]);\n Object.assign(instance, {\n togglePivot: togglePivot\n });\n }\n\n function prepareRow$2(row) {\n row.allCells.forEach(function (cell) {\n // Grouped cells are in the pivotColumns and the pivot cell for the row\n cell.isPivoted = cell.column.isPivoted;\n });\n }\n\n var pluginName$1 = 'useRowSelect'; // Actions\n\n actions.resetSelectedRows = 'resetSelectedRows';\n actions.toggleAllRowsSelected = 'toggleAllRowsSelected';\n actions.toggleRowSelected = 'toggleRowSelected';\n actions.toggleAllPageRowsSelected = 'toggleAllPageRowsSelected';\n var useRowSelect = function useRowSelect(hooks) {\n hooks.getToggleRowSelectedProps = [defaultGetToggleRowSelectedProps];\n hooks.getToggleAllRowsSelectedProps = [defaultGetToggleAllRowsSelectedProps];\n hooks.getToggleAllPageRowsSelectedProps = [defaultGetToggleAllPageRowsSelectedProps];\n hooks.stateReducers.push(reducer$8);\n hooks.useInstance.push(useInstance$8);\n hooks.prepareRow.push(prepareRow$3);\n };\n useRowSelect.pluginName = pluginName$1;\n\n var defaultGetToggleRowSelectedProps = function defaultGetToggleRowSelectedProps(props, _ref) {\n var instance = _ref.instance,\n row = _ref.row;\n var _instance$manualRowSe = instance.manualRowSelectedKey,\n manualRowSelectedKey = _instance$manualRowSe === void 0 ? 'isSelected' : _instance$manualRowSe;\n var checked = false;\n\n if (row.original && row.original[manualRowSelectedKey]) {\n checked = true;\n } else {\n checked = row.isSelected;\n }\n\n return [props, {\n onChange: function onChange(e) {\n row.toggleRowSelected(e.target.checked);\n },\n style: {\n cursor: 'pointer'\n },\n checked: checked,\n title: 'Toggle Row Selected',\n indeterminate: row.isSomeSelected\n }];\n };\n\n var defaultGetToggleAllRowsSelectedProps = function defaultGetToggleAllRowsSelectedProps(props, _ref2) {\n var instance = _ref2.instance;\n return [props, {\n onChange: function 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(!instance.isAllRowsSelected && Object.keys(instance.state.selectedRowIds).length)\n }];\n };\n\n var defaultGetToggleAllPageRowsSelectedProps = function defaultGetToggleAllPageRowsSelectedProps(props, _ref3) {\n var instance = _ref3.instance;\n return [props, {\n onChange: function 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(!instance.isAllPageRowsSelected && instance.page.some(function (_ref4) {\n var id = _ref4.id;\n return instance.state.selectedRowIds[id];\n }))\n }];\n }; // eslint-disable-next-line max-params\n\n\n function reducer$8(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n selectedRowIds: {}\n }, state);\n }\n\n if (action.type === actions.resetSelectedRows) {\n return _extends({}, state, {\n selectedRowIds: instance.initialState.selectedRowIds || {}\n });\n }\n\n if (action.type === actions.toggleAllRowsSelected) {\n var setSelected = action.value;\n var isAllRowsSelected = instance.isAllRowsSelected,\n rowsById = instance.rowsById,\n _instance$nonGroupedR = instance.nonGroupedRowsById,\n nonGroupedRowsById = _instance$nonGroupedR === void 0 ? rowsById : _instance$nonGroupedR;\n var selectAll = typeof setSelected !== 'undefined' ? setSelected : !isAllRowsSelected; // Only remove/add the rows that are visible on the screen\n // Leave all the other rows that are selected alone.\n\n var selectedRowIds = Object.assign({}, state.selectedRowIds);\n\n if (selectAll) {\n Object.keys(nonGroupedRowsById).forEach(function (rowId) {\n selectedRowIds[rowId] = true;\n });\n } else {\n Object.keys(nonGroupedRowsById).forEach(function (rowId) {\n delete selectedRowIds[rowId];\n });\n }\n\n return _extends({}, state, {\n selectedRowIds: selectedRowIds\n });\n }\n\n if (action.type === actions.toggleRowSelected) {\n var id = action.id,\n _setSelected = action.value;\n var _rowsById = instance.rowsById,\n _instance$selectSubRo = instance.selectSubRows,\n selectSubRows = _instance$selectSubRo === void 0 ? true : _instance$selectSubRo,\n getSubRows = instance.getSubRows;\n var isSelected = state.selectedRowIds[id];\n var shouldExist = typeof _setSelected !== 'undefined' ? _setSelected : !isSelected;\n\n if (isSelected === shouldExist) {\n return state;\n }\n\n var newSelectedRowIds = _extends({}, state.selectedRowIds);\n\n var handleRowById = function handleRowById(id) {\n var 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(function (row) {\n return handleRowById(row.id);\n });\n }\n }\n };\n\n handleRowById(id);\n return _extends({}, state, {\n selectedRowIds: newSelectedRowIds\n });\n }\n\n if (action.type === actions.toggleAllPageRowsSelected) {\n var _setSelected2 = action.value;\n\n var page = instance.page,\n _rowsById2 = instance.rowsById,\n _instance$selectSubRo2 = instance.selectSubRows,\n _selectSubRows = _instance$selectSubRo2 === void 0 ? true : _instance$selectSubRo2,\n isAllPageRowsSelected = instance.isAllPageRowsSelected,\n _getSubRows = instance.getSubRows;\n\n var _selectAll = typeof _setSelected2 !== 'undefined' ? _setSelected2 : !isAllPageRowsSelected;\n\n var _newSelectedRowIds = _extends({}, state.selectedRowIds);\n\n var _handleRowById = function _handleRowById(id) {\n var row = _rowsById2[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(function (row) {\n return _handleRowById(row.id);\n });\n }\n };\n\n page.forEach(function (row) {\n return _handleRowById(row.id);\n });\n return _extends({}, state, {\n selectedRowIds: _newSelectedRowIds\n });\n }\n\n return state;\n }\n\n function useInstance$8(instance) {\n var data = instance.data,\n rows = instance.rows,\n getHooks = instance.getHooks,\n plugins = instance.plugins,\n rowsById = instance.rowsById,\n _instance$nonGroupedR2 = instance.nonGroupedRowsById,\n nonGroupedRowsById = _instance$nonGroupedR2 === void 0 ? rowsById : _instance$nonGroupedR2,\n _instance$autoResetSe = instance.autoResetSelectedRows,\n autoResetSelectedRows = _instance$autoResetSe === void 0 ? true : _instance$autoResetSe,\n selectedRowIds = instance.state.selectedRowIds,\n _instance$selectSubRo3 = instance.selectSubRows,\n selectSubRows = _instance$selectSubRo3 === void 0 ? true : _instance$selectSubRo3,\n dispatch = instance.dispatch,\n page = instance.page,\n getSubRows = instance.getSubRows;\n ensurePluginOrder(plugins, ['useFilters', 'useGroupBy', 'useSortBy', 'useExpanded', 'usePagination'], 'useRowSelect');\n var selectedFlatRows = React.useMemo(function () {\n var selectedFlatRows = [];\n rows.forEach(function (row) {\n var isSelected = selectSubRows ? getRowIsSelected(row, selectedRowIds, getSubRows) : !!selectedRowIds[row.id];\n row.isSelected = !!isSelected;\n row.isSomeSelected = isSelected === null;\n\n if (isSelected) {\n selectedFlatRows.push(row);\n }\n });\n return selectedFlatRows;\n }, [rows, selectSubRows, selectedRowIds, getSubRows]);\n var isAllRowsSelected = Boolean(Object.keys(nonGroupedRowsById).length && Object.keys(selectedRowIds).length);\n var isAllPageRowsSelected = isAllRowsSelected;\n\n if (isAllRowsSelected) {\n if (Object.keys(nonGroupedRowsById).some(function (id) {\n return !selectedRowIds[id];\n })) {\n isAllRowsSelected = false;\n }\n }\n\n if (!isAllRowsSelected) {\n if (page && page.length && page.some(function (_ref5) {\n var id = _ref5.id;\n return !selectedRowIds[id];\n })) {\n isAllPageRowsSelected = false;\n }\n }\n\n var getAutoResetSelectedRows = useGetLatest(autoResetSelectedRows);\n useMountedLayoutEffect(function () {\n if (getAutoResetSelectedRows()) {\n dispatch({\n type: actions.resetSelectedRows\n });\n }\n }, [dispatch, data]);\n var toggleAllRowsSelected = React.useCallback(function (value) {\n return dispatch({\n type: actions.toggleAllRowsSelected,\n value: value\n });\n }, [dispatch]);\n var toggleAllPageRowsSelected = React.useCallback(function (value) {\n return dispatch({\n type: actions.toggleAllPageRowsSelected,\n value: value\n });\n }, [dispatch]);\n var toggleRowSelected = React.useCallback(function (id, value) {\n return dispatch({\n type: actions.toggleRowSelected,\n id: id,\n value: value\n });\n }, [dispatch]);\n var getInstance = useGetLatest(instance);\n var getToggleAllRowsSelectedProps = makePropGetter(getHooks().getToggleAllRowsSelectedProps, {\n instance: getInstance()\n });\n var getToggleAllPageRowsSelectedProps = makePropGetter(getHooks().getToggleAllPageRowsSelectedProps, {\n instance: getInstance()\n });\n Object.assign(instance, {\n selectedFlatRows: selectedFlatRows,\n isAllRowsSelected: isAllRowsSelected,\n isAllPageRowsSelected: isAllPageRowsSelected,\n toggleRowSelected: toggleRowSelected,\n toggleAllRowsSelected: toggleAllRowsSelected,\n getToggleAllRowsSelectedProps: getToggleAllRowsSelectedProps,\n getToggleAllPageRowsSelectedProps: getToggleAllPageRowsSelectedProps,\n toggleAllPageRowsSelected: toggleAllPageRowsSelected\n });\n }\n\n function prepareRow$3(row, _ref6) {\n var instance = _ref6.instance;\n\n row.toggleRowSelected = function (set) {\n return instance.toggleRowSelected(row.id, set);\n };\n\n row.getToggleRowSelectedProps = makePropGetter(instance.getHooks().getToggleRowSelectedProps, {\n instance: instance,\n row: row\n });\n }\n\n function getRowIsSelected(row, selectedRowIds, getSubRows) {\n if (selectedRowIds[row.id]) {\n return true;\n }\n\n var subRows = getSubRows(row);\n\n if (subRows && subRows.length) {\n var allChildrenSelected = true;\n var someSelected = false;\n subRows.forEach(function (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\n var defaultInitialRowStateAccessor = function defaultInitialRowStateAccessor(row) {\n return {};\n };\n\n var defaultInitialCellStateAccessor = function defaultInitialCellStateAccessor(cell) {\n return {};\n }; // Actions\n\n\n actions.setRowState = 'setRowState';\n actions.setCellState = 'setCellState';\n actions.resetRowState = 'resetRowState';\n var useRowState = function useRowState(hooks) {\n hooks.stateReducers.push(reducer$9);\n hooks.useInstance.push(useInstance$9);\n hooks.prepareRow.push(prepareRow$4);\n };\n useRowState.pluginName = 'useRowState';\n\n function reducer$9(state, action, previousState, instance) {\n var _instance$initialRowS = instance.initialRowStateAccessor,\n initialRowStateAccessor = _instance$initialRowS === void 0 ? defaultInitialRowStateAccessor : _instance$initialRowS,\n _instance$initialCell = instance.initialCellStateAccessor,\n initialCellStateAccessor = _instance$initialCell === void 0 ? defaultInitialCellStateAccessor : _instance$initialCell,\n rowsById = instance.rowsById;\n\n if (action.type === actions.init) {\n return _extends({\n rowState: {}\n }, state);\n }\n\n if (action.type === actions.resetRowState) {\n return _extends({}, state, {\n rowState: instance.initialState.rowState || {}\n });\n }\n\n if (action.type === actions.setRowState) {\n var _extends2;\n\n var rowId = action.rowId,\n value = action.value;\n var oldRowState = typeof state.rowState[rowId] !== 'undefined' ? state.rowState[rowId] : initialRowStateAccessor(rowsById[rowId]);\n return _extends({}, state, {\n rowState: _extends({}, state.rowState, (_extends2 = {}, _extends2[rowId] = functionalUpdate(value, oldRowState), _extends2))\n });\n }\n\n if (action.type === actions.setCellState) {\n var _oldRowState$cellStat, _rowsById$_rowId, _rowsById$_rowId$cell, _extends3, _extends4;\n\n var _rowId = action.rowId,\n columnId = action.columnId,\n _value = action.value;\n\n var _oldRowState = typeof state.rowState[_rowId] !== 'undefined' ? state.rowState[_rowId] : initialRowStateAccessor(rowsById[_rowId]);\n\n var oldCellState = typeof (_oldRowState == null ? void 0 : (_oldRowState$cellStat = _oldRowState.cellState) == null ? void 0 : _oldRowState$cellStat[columnId]) !== 'undefined' ? _oldRowState.cellState[columnId] : initialCellStateAccessor((_rowsById$_rowId = rowsById[_rowId]) == null ? void 0 : (_rowsById$_rowId$cell = _rowsById$_rowId.cells) == null ? void 0 : _rowsById$_rowId$cell.find(function (cell) {\n return cell.column.id === columnId;\n }));\n return _extends({}, state, {\n rowState: _extends({}, state.rowState, (_extends4 = {}, _extends4[_rowId] = _extends({}, _oldRowState, {\n cellState: _extends({}, _oldRowState.cellState || {}, (_extends3 = {}, _extends3[columnId] = functionalUpdate(_value, oldCellState), _extends3))\n }), _extends4))\n });\n }\n }\n\n function useInstance$9(instance) {\n var _instance$autoResetRo = instance.autoResetRowState,\n autoResetRowState = _instance$autoResetRo === void 0 ? true : _instance$autoResetRo,\n data = instance.data,\n dispatch = instance.dispatch;\n var setRowState = React.useCallback(function (rowId, value) {\n return dispatch({\n type: actions.setRowState,\n rowId: rowId,\n value: value\n });\n }, [dispatch]);\n var setCellState = React.useCallback(function (rowId, columnId, value) {\n return dispatch({\n type: actions.setCellState,\n rowId: rowId,\n columnId: columnId,\n value: value\n });\n }, [dispatch]);\n var getAutoResetRowState = useGetLatest(autoResetRowState);\n useMountedLayoutEffect(function () {\n if (getAutoResetRowState()) {\n dispatch({\n type: actions.resetRowState\n });\n }\n }, [data]);\n Object.assign(instance, {\n setRowState: setRowState,\n setCellState: setCellState\n });\n }\n\n function prepareRow$4(row, _ref) {\n var instance = _ref.instance;\n var _instance$initialRowS2 = instance.initialRowStateAccessor,\n initialRowStateAccessor = _instance$initialRowS2 === void 0 ? defaultInitialRowStateAccessor : _instance$initialRowS2,\n _instance$initialCell2 = instance.initialCellStateAccessor,\n initialCellStateAccessor = _instance$initialCell2 === void 0 ? defaultInitialCellStateAccessor : _instance$initialCell2,\n rowState = instance.state.rowState;\n\n if (row) {\n row.state = typeof rowState[row.id] !== 'undefined' ? rowState[row.id] : initialRowStateAccessor(row);\n\n row.setState = function (updater) {\n return instance.setRowState(row.id, updater);\n };\n\n row.cells.forEach(function (cell) {\n if (!row.state.cellState) {\n row.state.cellState = {};\n }\n\n cell.state = typeof row.state.cellState[cell.column.id] !== 'undefined' ? row.state.cellState[cell.column.id] : initialCellStateAccessor(cell);\n\n cell.setState = function (updater) {\n return instance.setCellState(row.id, cell.column.id, updater);\n };\n });\n }\n }\n\n actions.resetColumnOrder = 'resetColumnOrder';\n actions.setColumnOrder = 'setColumnOrder';\n var useColumnOrder = function useColumnOrder(hooks) {\n hooks.stateReducers.push(reducer$a);\n hooks.visibleColumnsDeps.push(function (deps, _ref) {\n var instance = _ref.instance;\n return [].concat(deps, [instance.state.columnOrder]);\n });\n hooks.visibleColumns.push(visibleColumns$2);\n hooks.useInstance.push(useInstance$a);\n };\n useColumnOrder.pluginName = 'useColumnOrder';\n\n function reducer$a(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n columnOrder: []\n }, state);\n }\n\n if (action.type === actions.resetColumnOrder) {\n return _extends({}, state, {\n columnOrder: instance.initialState.columnOrder || []\n });\n }\n\n if (action.type === actions.setColumnOrder) {\n return _extends({}, state, {\n columnOrder: functionalUpdate(action.columnOrder, state.columnOrder)\n });\n }\n }\n\n function visibleColumns$2(columns, _ref2) {\n var columnOrder = _ref2.instance.state.columnOrder;\n\n // If there is no order, return the normal columns\n if (!columnOrder || !columnOrder.length) {\n return columns;\n }\n\n var columnOrderCopy = [].concat(columnOrder); // If there is an order, make a copy of the columns\n\n var columnsCopy = [].concat(columns); // And make a new ordered array of the columns\n\n var columnsInOrder = []; // Loop over the columns and place them in order into the new array\n\n var _loop = function _loop() {\n var targetColumnId = columnOrderCopy.shift();\n var foundIndex = columnsCopy.findIndex(function (d) {\n return d.id === targetColumnId;\n });\n\n if (foundIndex > -1) {\n columnsInOrder.push(columnsCopy.splice(foundIndex, 1)[0]);\n }\n };\n\n while (columnsCopy.length && columnOrderCopy.length) {\n _loop();\n } // If there are any columns left, add them to the end\n\n\n return [].concat(columnsInOrder, columnsCopy);\n }\n\n function useInstance$a(instance) {\n var dispatch = instance.dispatch;\n instance.setColumnOrder = React.useCallback(function (columnOrder) {\n return dispatch({\n type: actions.setColumnOrder,\n columnOrder: columnOrder\n });\n }, [dispatch]);\n }\n\n defaultColumn.canResize = true; // Actions\n\n actions.columnStartResizing = 'columnStartResizing';\n actions.columnResizing = 'columnResizing';\n actions.columnDoneResizing = 'columnDoneResizing';\n actions.resetResize = 'resetResize';\n var useResizeColumns = function useResizeColumns(hooks) {\n hooks.getResizerProps = [defaultGetResizerProps];\n hooks.getHeaderProps.push({\n style: {\n position: 'relative'\n }\n });\n hooks.stateReducers.push(reducer$b);\n hooks.useInstance.push(useInstance$b);\n hooks.useInstanceBeforeDimensions.push(useInstanceBeforeDimensions$1);\n };\n\n var defaultGetResizerProps = function defaultGetResizerProps(props, _ref) {\n var instance = _ref.instance,\n header = _ref.header;\n var dispatch = instance.dispatch;\n\n var onResizeStart = function onResizeStart(e, header) {\n var isTouchEvent = false;\n\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\n isTouchEvent = true;\n }\n\n var headersToResize = getLeafHeaders(header);\n var headerIdWidths = headersToResize.map(function (d) {\n return [d.id, d.totalWidth];\n });\n var clientX = isTouchEvent ? Math.round(e.touches[0].clientX) : e.clientX;\n var raf;\n var mostRecentClientX;\n\n var dispatchEnd = function dispatchEnd() {\n window.cancelAnimationFrame(raf);\n raf = null;\n dispatch({\n type: actions.columnDoneResizing\n });\n };\n\n var dispatchMove = function dispatchMove() {\n window.cancelAnimationFrame(raf);\n raf = null;\n dispatch({\n type: actions.columnResizing,\n clientX: mostRecentClientX\n });\n };\n\n var scheduleDispatchMoveOnNextAnimationFrame = function scheduleDispatchMoveOnNextAnimationFrame(clientXPos) {\n mostRecentClientX = clientXPos;\n\n if (!raf) {\n raf = window.requestAnimationFrame(dispatchMove);\n }\n };\n\n var handlersAndEvents = {\n mouse: {\n moveEvent: 'mousemove',\n moveHandler: function moveHandler(e) {\n return scheduleDispatchMoveOnNextAnimationFrame(e.clientX);\n },\n upEvent: 'mouseup',\n upHandler: function upHandler(e) {\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: function moveHandler(e) {\n if (e.cancelable) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n scheduleDispatchMoveOnNextAnimationFrame(e.touches[0].clientX);\n return false;\n },\n upEvent: 'touchend',\n upHandler: function upHandler(e) {\n document.removeEventListener(handlersAndEvents.touch.moveEvent, handlersAndEvents.touch.moveHandler);\n document.removeEventListener(handlersAndEvents.touch.upEvent, handlersAndEvents.touch.moveHandler);\n dispatchEnd();\n }\n }\n };\n var events = isTouchEvent ? handlersAndEvents.touch : handlersAndEvents.mouse;\n var passiveIfSupported = passiveEventSupported() ? {\n passive: false\n } : false;\n document.addEventListener(events.moveEvent, events.moveHandler, passiveIfSupported);\n document.addEventListener(events.upEvent, events.upHandler, passiveIfSupported);\n dispatch({\n type: actions.columnStartResizing,\n columnId: header.id,\n columnWidth: header.totalWidth,\n headerIdWidths: headerIdWidths,\n clientX: clientX\n });\n };\n\n return [props, {\n onMouseDown: function onMouseDown(e) {\n return e.persist() || onResizeStart(e, header);\n },\n onTouchStart: function onTouchStart(e) {\n return e.persist() || onResizeStart(e, header);\n },\n style: {\n cursor: 'col-resize'\n },\n draggable: false,\n role: 'separator'\n }];\n };\n\n useResizeColumns.pluginName = 'useResizeColumns';\n\n function reducer$b(state, action) {\n if (action.type === actions.init) {\n return _extends({\n columnResizing: {\n columnWidths: {}\n }\n }, state);\n }\n\n if (action.type === actions.resetResize) {\n return _extends({}, state, {\n columnResizing: {\n columnWidths: {}\n }\n });\n }\n\n if (action.type === actions.columnStartResizing) {\n var clientX = action.clientX,\n columnId = action.columnId,\n columnWidth = action.columnWidth,\n headerIdWidths = action.headerIdWidths;\n return _extends({}, state, {\n columnResizing: _extends({}, state.columnResizing, {\n startX: clientX,\n headerIdWidths: headerIdWidths,\n columnWidth: columnWidth,\n isResizingColumn: columnId\n })\n });\n }\n\n if (action.type === actions.columnResizing) {\n var _clientX = action.clientX;\n\n var _state$columnResizing = state.columnResizing,\n startX = _state$columnResizing.startX,\n _columnWidth = _state$columnResizing.columnWidth,\n _state$columnResizing2 = _state$columnResizing.headerIdWidths,\n _headerIdWidths = _state$columnResizing2 === void 0 ? [] : _state$columnResizing2;\n\n var deltaX = _clientX - startX;\n var percentageDeltaX = deltaX / _columnWidth;\n var newColumnWidths = {};\n\n _headerIdWidths.forEach(function (_ref2) {\n var headerId = _ref2[0],\n headerWidth = _ref2[1];\n newColumnWidths[headerId] = Math.max(headerWidth + headerWidth * percentageDeltaX, 0);\n });\n\n return _extends({}, state, {\n columnResizing: _extends({}, state.columnResizing, {\n columnWidths: _extends({}, state.columnResizing.columnWidths, {}, newColumnWidths)\n })\n });\n }\n\n if (action.type === actions.columnDoneResizing) {\n return _extends({}, state, {\n columnResizing: _extends({}, state.columnResizing, {\n startX: null,\n isResizingColumn: null\n })\n });\n }\n }\n\n var useInstanceBeforeDimensions$1 = function useInstanceBeforeDimensions(instance) {\n var flatHeaders = instance.flatHeaders,\n disableResizing = instance.disableResizing,\n getHooks = instance.getHooks,\n columnResizing = instance.state.columnResizing;\n var getInstance = useGetLatest(instance);\n flatHeaders.forEach(function (header) {\n var canResize = getFirstDefined(header.disableResizing === true ? false : undefined, disableResizing === true ? false : undefined, true);\n header.canResize = canResize;\n header.width = columnResizing.columnWidths[header.id] || header.originalWidth || header.width;\n header.isResizing = columnResizing.isResizingColumn === header.id;\n\n if (canResize) {\n header.getResizerProps = makePropGetter(getHooks().getResizerProps, {\n instance: getInstance(),\n header: header\n });\n }\n });\n };\n\n function useInstance$b(instance) {\n var plugins = instance.plugins,\n dispatch = instance.dispatch,\n _instance$autoResetRe = instance.autoResetResize,\n autoResetResize = _instance$autoResetRe === void 0 ? true : _instance$autoResetRe,\n columns = instance.columns;\n ensurePluginOrder(plugins, ['useAbsoluteLayout'], 'useResizeColumns');\n var getAutoResetResize = useGetLatest(autoResetResize);\n useMountedLayoutEffect(function () {\n if (getAutoResetResize()) {\n dispatch({\n type: actions.resetResize\n });\n }\n }, [columns]);\n var resetResizing = React.useCallback(function () {\n return dispatch({\n type: actions.resetResize\n });\n }, [dispatch]);\n Object.assign(instance, {\n resetResizing: resetResizing\n });\n }\n\n function getLeafHeaders(header) {\n var leafHeaders = [];\n\n var recurseHeader = function recurseHeader(header) {\n if (header.columns && header.columns.length) {\n header.columns.map(recurseHeader);\n }\n\n leafHeaders.push(header);\n };\n\n recurseHeader(header);\n return leafHeaders;\n }\n\n var cellStyles = {\n position: 'absolute',\n top: 0\n };\n var useAbsoluteLayout = function useAbsoluteLayout(hooks) {\n hooks.getTableBodyProps.push(getRowStyles);\n hooks.getRowProps.push(getRowStyles);\n hooks.getHeaderGroupProps.push(getRowStyles);\n hooks.getFooterGroupProps.push(getRowStyles);\n hooks.getHeaderProps.push(function (props, _ref) {\n var column = _ref.column;\n return [props, {\n style: _extends({}, cellStyles, {\n left: column.totalLeft + \"px\",\n width: column.totalWidth + \"px\"\n })\n }];\n });\n hooks.getCellProps.push(function (props, _ref2) {\n var cell = _ref2.cell;\n return [props, {\n style: _extends({}, cellStyles, {\n left: cell.column.totalLeft + \"px\",\n width: cell.column.totalWidth + \"px\"\n })\n }];\n });\n hooks.getFooterProps.push(function (props, _ref3) {\n var column = _ref3.column;\n return [props, {\n style: _extends({}, cellStyles, {\n left: column.totalLeft + \"px\",\n width: column.totalWidth + \"px\"\n })\n }];\n });\n };\n useAbsoluteLayout.pluginName = 'useAbsoluteLayout';\n\n var getRowStyles = function getRowStyles(props, _ref4) {\n var instance = _ref4.instance;\n return [props, {\n style: {\n position: 'relative',\n width: instance.totalColumnsWidth + \"px\"\n }\n }];\n };\n\n var cellStyles$1 = {\n display: 'inline-block',\n boxSizing: 'border-box'\n };\n\n var getRowStyles$1 = function getRowStyles(props, _ref) {\n var instance = _ref.instance;\n return [props, {\n style: {\n display: 'flex',\n width: instance.totalColumnsWidth + \"px\"\n }\n }];\n };\n\n var useBlockLayout = function useBlockLayout(hooks) {\n hooks.getRowProps.push(getRowStyles$1);\n hooks.getHeaderGroupProps.push(getRowStyles$1);\n hooks.getFooterGroupProps.push(getRowStyles$1);\n hooks.getHeaderProps.push(function (props, _ref2) {\n var column = _ref2.column;\n return [props, {\n style: _extends({}, cellStyles$1, {\n width: column.totalWidth + \"px\"\n })\n }];\n });\n hooks.getCellProps.push(function (props, _ref3) {\n var cell = _ref3.cell;\n return [props, {\n style: _extends({}, cellStyles$1, {\n width: cell.column.totalWidth + \"px\"\n })\n }];\n });\n hooks.getFooterProps.push(function (props, _ref4) {\n var column = _ref4.column;\n return [props, {\n style: _extends({}, cellStyles$1, {\n width: column.totalWidth + \"px\"\n })\n }];\n });\n };\n useBlockLayout.pluginName = 'useBlockLayout';\n\n function useFlexLayout(hooks) {\n hooks.getTableProps.push(getTableProps);\n hooks.getRowProps.push(getRowStyles$2);\n hooks.getHeaderGroupProps.push(getRowStyles$2);\n hooks.getFooterGroupProps.push(getRowStyles$2);\n hooks.getHeaderProps.push(getHeaderProps);\n hooks.getCellProps.push(getCellProps);\n hooks.getFooterProps.push(getFooterProps);\n }\n useFlexLayout.pluginName = 'useFlexLayout';\n\n var getTableProps = function getTableProps(props, _ref) {\n var instance = _ref.instance;\n return [props, {\n style: {\n minWidth: instance.totalColumnsMinWidth + \"px\"\n }\n }];\n };\n\n var getRowStyles$2 = function getRowStyles(props, _ref2) {\n var instance = _ref2.instance;\n return [props, {\n style: {\n display: 'flex',\n flex: '1 0 auto',\n minWidth: instance.totalColumnsMinWidth + \"px\"\n }\n }];\n };\n\n var getHeaderProps = function getHeaderProps(props, _ref3) {\n var column = _ref3.column;\n return [props, {\n style: {\n boxSizing: 'border-box',\n flex: column.totalFlexWidth ? column.totalFlexWidth + \" 0 auto\" : undefined,\n minWidth: column.totalMinWidth + \"px\",\n width: column.totalWidth + \"px\"\n }\n }];\n };\n\n var getCellProps = function getCellProps(props, _ref4) {\n var cell = _ref4.cell;\n return [props, {\n style: {\n boxSizing: 'border-box',\n flex: cell.column.totalFlexWidth + \" 0 auto\",\n minWidth: cell.column.totalMinWidth + \"px\",\n width: cell.column.totalWidth + \"px\"\n }\n }];\n };\n\n var getFooterProps = function getFooterProps(props, _ref5) {\n var column = _ref5.column;\n return [props, {\n style: {\n boxSizing: 'border-box',\n flex: column.totalFlexWidth ? column.totalFlexWidth + \" 0 auto\" : undefined,\n minWidth: column.totalMinWidth + \"px\",\n width: column.totalWidth + \"px\"\n }\n }];\n };\n\n actions.columnStartResizing = 'columnStartResizing';\n actions.columnResizing = 'columnResizing';\n actions.columnDoneResizing = 'columnDoneResizing';\n actions.resetResize = 'resetResize';\n function useGridLayout(hooks) {\n hooks.stateReducers.push(reducer$c);\n hooks.getTableProps.push(getTableProps$1);\n hooks.getHeaderProps.push(getHeaderProps$1);\n hooks.getRowProps.push(getRowProps);\n }\n useGridLayout.pluginName = 'useGridLayout';\n\n var getTableProps$1 = function getTableProps(props, _ref) {\n var instance = _ref.instance;\n var gridTemplateColumns = instance.visibleColumns.map(function (column) {\n var _instance$state$colum;\n\n if (instance.state.gridLayout.columnWidths[column.id]) return instance.state.gridLayout.columnWidths[column.id] + \"px\"; // 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\n if ((_instance$state$colum = instance.state.columnResizing) == null ? void 0 : _instance$state$colum.isResizingColumn) 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 [props, {\n style: {\n display: \"grid\",\n gridTemplateColumns: gridTemplateColumns.join(\" \")\n }\n }];\n };\n\n var getHeaderProps$1 = function getHeaderProps(props, _ref2) {\n var column = _ref2.column;\n return [props, {\n id: \"header-cell-\" + column.id,\n style: {\n position: \"sticky\",\n //enables a scroll wrapper to be placed around the table and have sticky headers\n gridColumn: \"span \" + column.totalVisibleHeaderCount\n }\n }];\n };\n\n var getRowProps = function getRowProps(props, _ref3) {\n var row = _ref3.row;\n\n if (row.isExpanded) {\n return [props, {\n style: {\n gridColumn: \"1 / \" + (row.cells.length + 1)\n }\n }];\n }\n\n return [props, {}];\n };\n\n function reducer$c(state, action, previousState, instance) {\n if (action.type === actions.init) {\n return _extends({\n gridLayout: {\n columnWidths: {}\n }\n }, state);\n }\n\n if (action.type === actions.resetResize) {\n return _extends({}, state, {\n gridLayout: {\n columnWidths: {}\n }\n });\n }\n\n if (action.type === actions.columnStartResizing) {\n var columnId = action.columnId,\n headerIdWidths = action.headerIdWidths;\n var columnWidth = getElementWidth(columnId);\n\n if (columnWidth !== undefined) {\n var startWidths = instance.visibleColumns.reduce(function (acc, column) {\n var _extends2;\n\n return _extends({}, acc, (_extends2 = {}, _extends2[column.id] = getElementWidth(column.id), _extends2));\n }, {});\n var minWidths = instance.visibleColumns.reduce(function (acc, column) {\n var _extends3;\n\n return _extends({}, acc, (_extends3 = {}, _extends3[column.id] = column.minWidth, _extends3));\n }, {});\n var maxWidths = instance.visibleColumns.reduce(function (acc, column) {\n var _extends4;\n\n return _extends({}, acc, (_extends4 = {}, _extends4[column.id] = column.maxWidth, _extends4));\n }, {});\n var headerIdGridWidths = headerIdWidths.map(function (_ref4) {\n var headerId = _ref4[0];\n return [headerId, getElementWidth(headerId)];\n });\n return _extends({}, state, {\n gridLayout: _extends({}, state.gridLayout, {\n startWidths: startWidths,\n minWidths: minWidths,\n maxWidths: maxWidths,\n headerIdGridWidths: headerIdGridWidths,\n columnWidth: columnWidth\n })\n });\n } else {\n return state;\n }\n }\n\n if (action.type === actions.columnResizing) {\n var clientX = action.clientX;\n var startX = state.columnResizing.startX;\n\n var _state$gridLayout = state.gridLayout,\n _columnWidth = _state$gridLayout.columnWidth,\n _minWidths = _state$gridLayout.minWidths,\n _maxWidths = _state$gridLayout.maxWidths,\n _state$gridLayout$hea = _state$gridLayout.headerIdGridWidths,\n _headerIdGridWidths = _state$gridLayout$hea === void 0 ? [] : _state$gridLayout$hea;\n\n var deltaX = clientX - startX;\n var percentageDeltaX = deltaX / _columnWidth;\n var newColumnWidths = {};\n\n _headerIdGridWidths.forEach(function (_ref5) {\n var headerId = _ref5[0],\n headerWidth = _ref5[1];\n newColumnWidths[headerId] = Math.min(Math.max(_minWidths[headerId], headerWidth + headerWidth * percentageDeltaX), _maxWidths[headerId]);\n });\n\n return _extends({}, state, {\n gridLayout: _extends({}, state.gridLayout, {\n columnWidths: _extends({}, state.gridLayout.columnWidths, {}, newColumnWidths)\n })\n });\n }\n\n if (action.type === actions.columnDoneResizing) {\n return _extends({}, state, {\n gridLayout: _extends({}, state.gridLayout, {\n startWidths: {},\n minWidths: {},\n maxWidths: {}\n })\n });\n }\n }\n\n function getElementWidth(columnId) {\n var _document$getElementB;\n\n var width = (_document$getElementB = document.getElementById(\"header-cell-\" + columnId)) == null ? void 0 : _document$getElementB.offsetWidth;\n\n if (width !== undefined) {\n return width;\n }\n }\n\n exports._UNSTABLE_usePivotColumns = _UNSTABLE_usePivotColumns;\n exports.actions = actions;\n exports.defaultColumn = defaultColumn;\n exports.defaultGroupByFn = defaultGroupByFn;\n exports.defaultOrderByFn = defaultOrderByFn;\n exports.defaultRenderer = defaultRenderer;\n exports.emptyRenderer = emptyRenderer;\n exports.ensurePluginOrder = ensurePluginOrder;\n exports.flexRender = flexRender;\n exports.functionalUpdate = functionalUpdate;\n exports.loopHooks = loopHooks;\n exports.makePropGetter = makePropGetter;\n exports.makeRenderer = makeRenderer;\n exports.reduceHooks = reduceHooks;\n exports.safeUseLayoutEffect = safeUseLayoutEffect;\n exports.useAbsoluteLayout = useAbsoluteLayout;\n exports.useAsyncDebounce = useAsyncDebounce;\n exports.useBlockLayout = useBlockLayout;\n exports.useColumnOrder = useColumnOrder;\n exports.useExpanded = useExpanded;\n exports.useFilters = useFilters;\n exports.useFlexLayout = useFlexLayout;\n exports.useGetLatest = useGetLatest;\n exports.useGlobalFilter = useGlobalFilter;\n exports.useGridLayout = useGridLayout;\n exports.useGroupBy = useGroupBy;\n exports.useMountedLayoutEffect = useMountedLayoutEffect;\n exports.usePagination = usePagination;\n exports.useResizeColumns = useResizeColumns;\n exports.useRowSelect = useRowSelect;\n exports.useRowState = useRowState;\n exports.useSortBy = useSortBy;\n exports.useTable = useTable;\n\n Object.defineProperty(exports, '__esModule', { value: true });\n\n})));\n//# sourceMappingURL=react-table.development.js.map\n","if (process.env.NODE_ENV === 'production') {\n module.exports = require('./dist/react-table.production.min.js')\n} else {\n module.exports = require('./dist/react-table.development.js')\n}\n","import { useEffect, useLayoutEffect, useState, useRef, useCallback } from 'react';\nimport useSWR from 'swr';\n\n/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\n\nvar noop = function () { };\n// Using noop() as the undefined value as undefined can possibly be replaced\n// by something else. Prettier ignore and extra parentheses are necessary here\n// to ensure that tsc doesn't remove the __NOINLINE__ comment.\n// prettier-ignore\nvar UNDEFINED = ( /*#__NOINLINE__*/noop());\nvar OBJECT = Object;\nvar isUndefined = function (v) { return v === UNDEFINED; };\nvar isFunction = function (v) { return typeof v == 'function'; };\nvar STR_UNDEFINED = 'undefined';\n// NOTE: Use function to guarantee it's re-evaluated between jsdom and node runtime for tests.\nvar hasWindow = function () { return typeof window != STR_UNDEFINED; };\n\nvar IS_SERVER = !hasWindow() || 'Deno' in window;\n// React currently throws a warning when using useLayoutEffect on the server.\n// To get around it, we can conditionally useEffect on the server (no-op) and\n// useLayoutEffect in the browser.\nvar useIsomorphicLayoutEffect = IS_SERVER ? useEffect : useLayoutEffect;\n\n// use WeakMap to store the object->key mapping\n// so the objects can be garbage collected.\n// WeakMap uses a hashtable under the hood, so the lookup\n// complexity is almost O(1).\nvar table = new WeakMap();\n// counter of the key\nvar counter = 0;\n// A stable hash implementation that supports:\n// - Fast and ensures unique hash properties\n// - Handles unserializable values\n// - Handles object key ordering\n// - Generates short results\n//\n// This is not a serialization function, and the result is not guaranteed to be\n// parsible.\nvar stableHash = function (arg) {\n var type = typeof arg;\n var constructor = arg && arg.constructor;\n var isDate = constructor == Date;\n var result;\n var index;\n if (OBJECT(arg) === arg && !isDate && constructor != RegExp) {\n // Object/function, not null/date/regexp. Use WeakMap to store the id first.\n // If it's already hashed, directly return the result.\n result = table.get(arg);\n if (result)\n return result;\n // Store the hash first for circular reference detection before entering the\n // recursive `stableHash` calls.\n // For other objects like set and map, we use this id directly as the hash.\n result = ++counter + '~';\n table.set(arg, result);\n if (constructor == Array) {\n // Array.\n result = '@';\n for (index = 0; index < arg.length; index++) {\n result += stableHash(arg[index]) + ',';\n }\n table.set(arg, result);\n }\n if (constructor == OBJECT) {\n // Object, sort keys.\n result = '#';\n var keys = OBJECT.keys(arg).sort();\n while (!isUndefined((index = keys.pop()))) {\n if (!isUndefined(arg[index])) {\n result += index + ':' + stableHash(arg[index]) + ',';\n }\n }\n table.set(arg, result);\n }\n }\n else {\n result = isDate\n ? arg.toJSON()\n : type == 'symbol'\n ? arg.toString()\n : type == 'string'\n ? JSON.stringify(arg)\n : '' + arg;\n }\n return result;\n};\n\nvar serialize = function (key) {\n if (isFunction(key)) {\n try {\n key = key();\n }\n catch (err) {\n // dependencies not ready\n key = '';\n }\n }\n var args = [].concat(key);\n // If key is not falsy, or not an empty array, hash it.\n key =\n typeof key == 'string'\n ? key\n : (Array.isArray(key) ? key.length : key)\n ? stableHash(key)\n : '';\n var infoKey = key ? '$swr$' + key : '';\n return [key, args, infoKey];\n};\n\nvar normalize = function (args) {\n return isFunction(args[1])\n ? [args[0], args[1], args[2] || {}]\n : [args[0], null, (args[1] === null ? args[2] : args[1]) || {}];\n};\n\n// Create a custom hook with a middleware\nvar withMiddleware = function (useSWR, middleware) {\n return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var _a = normalize(args), key = _a[0], fn = _a[1], config = _a[2];\n var uses = (config.use || []).concat(middleware);\n return useSWR(key, fn, __assign(__assign({}, config), { use: uses }));\n };\n};\n\n// We have to several type castings here because `useSWRInfinite` is a special\nvar INFINITE_PREFIX = '$inf$';\nvar getFirstPageKey = function (getKey) {\n return serialize(getKey ? getKey(0, null) : null)[0];\n};\nvar unstable_serialize = function (getKey) {\n return INFINITE_PREFIX + getFirstPageKey(getKey);\n};\nvar infinite = (function (useSWRNext) {\n return function (getKey, fn, config) {\n var rerender = useState({})[1];\n var didMountRef = useRef(false);\n var dataRef = useRef();\n var cache = config.cache, _a = config.initialSize, initialSize = _a === void 0 ? 1 : _a, _b = config.revalidateAll, revalidateAll = _b === void 0 ? false : _b, _c = config.persistSize, persistSize = _c === void 0 ? false : _c, _d = config.revalidateFirstPage, revalidateFirstPage = _d === void 0 ? true : _d, _e = config.revalidateOnMount, revalidateOnMount = _e === void 0 ? false : _e;\n // The serialized key of the first page.\n var firstPageKey = null;\n try {\n firstPageKey = getFirstPageKey(getKey);\n }\n catch (err) {\n // not ready\n }\n // We use cache to pass extra info (context) to fetcher so it can be globally\n // shared. The key of the context data is based on the first page key.\n var contextCacheKey = null;\n // Page size is also cached to share the page data between hooks with the\n // same key.\n var pageSizeCacheKey = null;\n if (firstPageKey) {\n contextCacheKey = '$ctx$' + firstPageKey;\n pageSizeCacheKey = '$len$' + firstPageKey;\n }\n var resolvePageSize = useCallback(function () {\n var cachedPageSize = cache.get(pageSizeCacheKey);\n return isUndefined(cachedPageSize) ? initialSize : cachedPageSize;\n // `cache` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [pageSizeCacheKey, initialSize]);\n // keep the last page size to restore it with the persistSize option\n var lastPageSizeRef = useRef(resolvePageSize());\n // When the page key changes, we reset the page size if it's not persisted\n useIsomorphicLayoutEffect(function () {\n if (!didMountRef.current) {\n didMountRef.current = true;\n return;\n }\n if (firstPageKey) {\n // If the key has been changed, we keep the current page size if persistSize is enabled\n cache.set(pageSizeCacheKey, persistSize ? lastPageSizeRef.current : initialSize);\n }\n // `initialSize` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [firstPageKey]);\n // Needs to check didMountRef during mounting, not in the fetcher\n var shouldRevalidateOnMount = revalidateOnMount && !didMountRef.current;\n // Actual SWR hook to load all pages in one fetcher.\n var swr = useSWRNext(firstPageKey ? INFINITE_PREFIX + firstPageKey : null, function () { return __awaiter(void 0, void 0, void 0, function () {\n var _a, forceRevalidateAll, originalData, data, pageSize, previousPageData, i, _b, pageKey, pageArgs, pageData, shouldFetchPage;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = cache.get(contextCacheKey) || [], forceRevalidateAll = _a[0], originalData = _a[1];\n data = [];\n pageSize = resolvePageSize();\n previousPageData = null;\n i = 0;\n _c.label = 1;\n case 1:\n if (!(i < pageSize)) return [3 /*break*/, 5];\n _b = serialize(getKey(i, previousPageData)), pageKey = _b[0], pageArgs = _b[1];\n if (!pageKey) {\n // `pageKey` is falsy, stop fetching new pages.\n return [3 /*break*/, 5];\n }\n pageData = cache.get(pageKey);\n shouldFetchPage = revalidateAll ||\n forceRevalidateAll ||\n isUndefined(pageData) ||\n (revalidateFirstPage && !i && !isUndefined(dataRef.current)) ||\n shouldRevalidateOnMount ||\n (originalData &&\n !isUndefined(originalData[i]) &&\n !config.compare(originalData[i], pageData));\n if (!(fn && shouldFetchPage)) return [3 /*break*/, 3];\n return [4 /*yield*/, fn.apply(void 0, pageArgs)];\n case 2:\n pageData = _c.sent();\n cache.set(pageKey, pageData);\n _c.label = 3;\n case 3:\n data.push(pageData);\n previousPageData = pageData;\n _c.label = 4;\n case 4:\n ++i;\n return [3 /*break*/, 1];\n case 5:\n // once we executed the data fetching based on the context, clear the context\n cache.delete(contextCacheKey);\n // return the data\n return [2 /*return*/, data];\n }\n });\n }); }, config);\n // update dataRef\n useIsomorphicLayoutEffect(function () {\n dataRef.current = swr.data;\n }, [swr.data]);\n var mutate = useCallback(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var data = args[0];\n // Default to true.\n var shouldRevalidate = args[1] !== false;\n // It is possible that the key is still falsy.\n if (!contextCacheKey)\n return;\n if (shouldRevalidate) {\n if (!isUndefined(data)) {\n // We only revalidate the pages that are changed\n var originalData = dataRef.current;\n cache.set(contextCacheKey, [false, originalData]);\n }\n else {\n // Calling `mutate()`, we revalidate all pages\n cache.set(contextCacheKey, [true]);\n }\n }\n return args.length ? swr.mutate(data, shouldRevalidate) : swr.mutate();\n }, \n // swr.mutate is always the same reference\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [contextCacheKey]);\n // Function to load pages data from the cache based on the page size.\n var resolvePagesFromCache = function (pageSize) {\n // return an array of page data\n var data = [];\n var previousPageData = null;\n for (var i = 0; i < pageSize; ++i) {\n var pageKey = serialize(getKey(i, previousPageData))[0];\n // Get the cached page data.\n var pageData = pageKey ? cache.get(pageKey) : UNDEFINED;\n // Return the current data if we can't get it from the cache.\n if (isUndefined(pageData))\n return dataRef.current;\n data.push(pageData);\n previousPageData = pageData;\n }\n // Return the data\n return data;\n };\n // Extend the SWR API\n var setSize = useCallback(function (arg) {\n // It is possible that the key is still falsy.\n if (!pageSizeCacheKey)\n return;\n var size;\n if (isFunction(arg)) {\n size = arg(resolvePageSize());\n }\n else if (typeof arg == 'number') {\n size = arg;\n }\n if (typeof size != 'number')\n return;\n cache.set(pageSizeCacheKey, size);\n lastPageSizeRef.current = size;\n rerender({});\n return mutate(resolvePagesFromCache(size));\n }, \n // `cache` and `rerender` isn't allowed to change during the lifecycle\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [pageSizeCacheKey, resolvePageSize, mutate]);\n // Use getter functions to avoid unnecessary re-renders caused by triggering\n // all the getters of the returned swr object.\n return {\n size: resolvePageSize(),\n setSize: setSize,\n mutate: mutate,\n get error() {\n return swr.error;\n },\n get data() {\n return swr.data;\n },\n get isValidating() {\n return swr.isValidating;\n }\n };\n };\n});\nvar index = withMiddleware(useSWR, infinite);\n\nexport { index as default, infinite, unstable_serialize };\n"],"sourceRoot":""}