Changeset 3048093
- Timestamp:
- 03/09/2024 12:22:36 AM (2 years ago)
- Location:
- squarewoosync
- Files:
-
- 142 added
- 6 edited
-
tags/1.5.2 (added)
-
tags/1.5.2/assets (added)
-
tags/1.5.2/assets/banner-1544x500.jpg (added)
-
tags/1.5.2/assets/banner-772x250.jpg (added)
-
tags/1.5.2/assets/icon-128x128.png (added)
-
tags/1.5.2/assets/icon-256x256.png (added)
-
tags/1.5.2/assets/images (added)
-
tags/1.5.2/assets/images/box-outline.svg (added)
-
tags/1.5.2/assets/images/logo-new.svg (added)
-
tags/1.5.2/assets/images/logo.png (added)
-
tags/1.5.2/assets/js (added)
-
tags/1.5.2/assets/js/sync-metabox.js (added)
-
tags/1.5.2/assets/screenshot-1.png (added)
-
tags/1.5.2/assets/screenshot-2.png (added)
-
tags/1.5.2/assets/screenshot-3.png (added)
-
tags/1.5.2/assets/screenshot-4.png (added)
-
tags/1.5.2/build (added)
-
tags/1.5.2/build/images (added)
-
tags/1.5.2/build/images/logo.4a5282be.png (added)
-
tags/1.5.2/build/index.asset.php (added)
-
tags/1.5.2/build/index.css (added)
-
tags/1.5.2/build/index.js (added)
-
tags/1.5.2/includes (added)
-
tags/1.5.2/includes/Abstracts (added)
-
tags/1.5.2/includes/Abstracts/RESTController.php (added)
-
tags/1.5.2/includes/Admin (added)
-
tags/1.5.2/includes/Admin/Menu.php (added)
-
tags/1.5.2/includes/Assets (added)
-
tags/1.5.2/includes/Assets/Manager.php (added)
-
tags/1.5.2/includes/Common (added)
-
tags/1.5.2/includes/Common/Keys.php (added)
-
tags/1.5.2/includes/Logger (added)
-
tags/1.5.2/includes/Logger/Logger.php (added)
-
tags/1.5.2/includes/REST (added)
-
tags/1.5.2/includes/REST/Api.php (added)
-
tags/1.5.2/includes/REST/LogController.php (added)
-
tags/1.5.2/includes/REST/OrdersController.php (added)
-
tags/1.5.2/includes/REST/SettingsController.php (added)
-
tags/1.5.2/includes/REST/SquareController.php (added)
-
tags/1.5.2/includes/Setup (added)
-
tags/1.5.2/includes/Setup/Installer.php (added)
-
tags/1.5.2/includes/Square (added)
-
tags/1.5.2/includes/Square/SquareHelper.php (added)
-
tags/1.5.2/includes/Square/SquareImport.php (added)
-
tags/1.5.2/includes/Square/SquareInventory.php (added)
-
tags/1.5.2/includes/Woo (added)
-
tags/1.5.2/includes/Woo/CreateProduct.php (added)
-
tags/1.5.2/includes/Woo/SyncProduct.php (added)
-
tags/1.5.2/package.json (added)
-
tags/1.5.2/readme.txt (added)
-
tags/1.5.2/squarewoosync.php (added)
-
tags/1.5.2/src (added)
-
tags/1.5.2/src/App.jsx (added)
-
tags/1.5.2/src/components (added)
-
tags/1.5.2/src/components/Actions.jsx (added)
-
tags/1.5.2/src/components/AlertDialog.jsx (added)
-
tags/1.5.2/src/components/DebouncedInput.jsx (added)
-
tags/1.5.2/src/components/Dialog.jsx (added)
-
tags/1.5.2/src/components/NavigationContext.jsx (added)
-
tags/1.5.2/src/components/features (added)
-
tags/1.5.2/src/components/features/dashboard (added)
-
tags/1.5.2/src/components/features/dashboard/Contact.jsx (added)
-
tags/1.5.2/src/components/features/dashboard/logs (added)
-
tags/1.5.2/src/components/features/dashboard/logs/SyncLog.jsx (added)
-
tags/1.5.2/src/components/features/inventory (added)
-
tags/1.5.2/src/components/features/inventory/IndeterminateCheckbox.jsx (added)
-
tags/1.5.2/src/components/features/inventory/InvEmptyState.jsx (added)
-
tags/1.5.2/src/components/features/inventory/InvLoading.jsx (added)
-
tags/1.5.2/src/components/features/inventory/import (added)
-
tags/1.5.2/src/components/features/inventory/import/ImportDialog.jsx (added)
-
tags/1.5.2/src/components/features/inventory/import/steps (added)
-
tags/1.5.2/src/components/features/inventory/import/steps/StepController.jsx (added)
-
tags/1.5.2/src/components/features/inventory/import/steps/StepOne.jsx (added)
-
tags/1.5.2/src/components/features/inventory/import/steps/StepThree.jsx (added)
-
tags/1.5.2/src/components/features/inventory/import/steps/StepTwo.jsx (added)
-
tags/1.5.2/src/components/features/inventory/table (added)
-
tags/1.5.2/src/components/features/inventory/table/Icons.jsx (added)
-
tags/1.5.2/src/components/features/inventory/table/InventoryTable.jsx (added)
-
tags/1.5.2/src/components/features/inventory/table/PaginationControls.jsx (added)
-
tags/1.5.2/src/components/features/inventory/table/TableHeader.jsx (added)
-
tags/1.5.2/src/components/features/inventory/table/TableRow.jsx (added)
-
tags/1.5.2/src/components/features/orders (added)
-
tags/1.5.2/src/components/features/orders/InvLoading.jsx (added)
-
tags/1.5.2/src/components/features/orders/Table.jsx (added)
-
tags/1.5.2/src/components/features/orders/TableHeader.jsx (added)
-
tags/1.5.2/src/components/features/settings (added)
-
tags/1.5.2/src/components/features/settings/general (added)
-
tags/1.5.2/src/components/features/settings/general/AccessToken.jsx (added)
-
tags/1.5.2/src/components/features/settings/general/Locations.jsx (added)
-
tags/1.5.2/src/components/features/settings/general/SKUSuffix.jsx (added)
-
tags/1.5.2/src/components/features/settings/general/SquareWoo.jsx (added)
-
tags/1.5.2/src/components/features/settings/general/Webhook.jsx (added)
-
tags/1.5.2/src/components/features/settings/general/WooSquare.jsx (added)
-
tags/1.5.2/src/components/hooks (added)
-
tags/1.5.2/src/components/hooks/useImport.jsx (added)
-
tags/1.5.2/src/components/hooks/useMenuFix.jsx (added)
-
tags/1.5.2/src/components/hooks/useTableData.jsx (added)
-
tags/1.5.2/src/components/layout (added)
-
tags/1.5.2/src/components/layout/index.jsx (added)
-
tags/1.5.2/src/components/logo (added)
-
tags/1.5.2/src/components/logo/index.js (added)
-
tags/1.5.2/src/index.js (added)
-
tags/1.5.2/src/pages (added)
-
tags/1.5.2/src/pages/Dashboard.jsx (added)
-
tags/1.5.2/src/pages/Inventory.jsx (added)
-
tags/1.5.2/src/pages/Orders.jsx (added)
-
tags/1.5.2/src/pages/Settings.jsx (added)
-
tags/1.5.2/src/pages/settings (added)
-
tags/1.5.2/src/pages/settings/General.jsx (added)
-
tags/1.5.2/src/redux (added)
-
tags/1.5.2/src/redux/inventorySlice.js (added)
-
tags/1.5.2/src/redux/ordersSlice.js (added)
-
tags/1.5.2/src/redux/store.js (added)
-
tags/1.5.2/src/routes (added)
-
tags/1.5.2/src/routes/index.js (added)
-
tags/1.5.2/src/style (added)
-
tags/1.5.2/src/style/main.scss (added)
-
tags/1.5.2/src/style/tailwind.css (added)
-
tags/1.5.2/src/utils (added)
-
tags/1.5.2/src/utils/classHelper.js (added)
-
tags/1.5.2/src/utils/filterRows.js (added)
-
tags/1.5.2/src/utils/formatTableData.js (added)
-
tags/1.5.2/src/utils/general.js (added)
-
tags/1.5.2/src/utils/importProduct.js (added)
-
tags/1.5.2/src/utils/inventoryUtils.js (added)
-
tags/1.5.2/src/utils/menuFix.js (added)
-
tags/1.5.2/src/utils/orders.js (added)
-
tags/1.5.2/templates (added)
-
tags/1.5.2/templates/app.php (added)
-
tags/1.5.2/vendor (added)
-
tags/1.5.2/vendor/autoload.php (added)
-
tags/1.5.2/vendor/composer (added)
-
tags/1.5.2/vendor/composer/ClassLoader.php (added)
-
tags/1.5.2/vendor/composer/InstalledVersions.php (added)
-
tags/1.5.2/vendor/composer/LICENSE (added)
-
tags/1.5.2/vendor/composer/autoload_classmap.php (added)
-
tags/1.5.2/vendor/composer/autoload_namespaces.php (added)
-
tags/1.5.2/vendor/composer/autoload_psr4.php (added)
-
tags/1.5.2/vendor/composer/autoload_real.php (added)
-
tags/1.5.2/vendor/composer/autoload_static.php (added)
-
tags/1.5.2/vendor/composer/installed.json (added)
-
tags/1.5.2/vendor/composer/installed.php (added)
-
trunk/build/index.asset.php (modified) (1 diff)
-
trunk/build/index.js (modified) (1 diff)
-
trunk/package.json (modified) (1 diff)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/squarewoosync.php (modified) (3 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
squarewoosync/trunk/build/index.asset.php
r3046624 r3048093 1 <?php return array('dependencies' => array('moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-element'), 'version' => ' 8110d97892da2fd480c4');1 <?php return array('dependencies' => array('moment', 'react', 'react-dom', 'wp-api-fetch', 'wp-element'), 'version' => '10c093545980ea29ab9b'); -
squarewoosync/trunk/build/index.js
r3046624 r3048093 1 (()=>{var e={ 42:(e,t,n)=>{"use strict";var r=n(664),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u=!1;t||(t={}),n=t.debug||!1;try{if(i=r(),l=document.createRange(),s=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=o[t.format]||o.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(c),l.selectNodeContents(c),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),c&&document.body.removeChild(c),i()}return u}},35:(e,t,n)=>{"use strict";var r=n(959),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=d(n);o&&o!==m&&e(t,o,r)}var i=u(n);f&&(i=i.concat(f(n)));for(var l=s(t),g=s(n),h=0;h<i.length;++h){var y=i[h];if(!(a[y]||r&&r[y]||g&&g[y]||l&&l[y])){var v=p(n,y);try{c(t,y,v)}catch(e){}}}}return t}},843:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case a:case l:case i:case d:return e;default:switch(e=e&&e.$$typeof){case c:case p:case h:case g:case s:return e;default:return t}}case o:return t}}}function x(e){return E(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=a,t.Lazy=h,t.Memo=g,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||E(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return E(e)===c},t.isContextProvider=function(e){return E(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===p},t.isFragment=function(e){return E(e)===a},t.isLazy=function(e){return E(e)===h},t.isMemo=function(e){return E(e)===g},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===l},t.isStrictMode=function(e){return E(e)===i},t.isSuspense=function(e){return E(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===l||e===i||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===g||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b||e.$$typeof===y)},t.typeOf=E},959:(e,t,n)=>{"use strict";e.exports=n(843)},604:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},176:(e,t,n)=>{"use strict";n(604)},515:(e,t,n)=>{"use strict";t.__esModule=!0,t.default=function(e){var t=(0,o.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var r,o=(r=n(941))&&r.__esModule?r:{default:r}},941:(e,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){}t.__esModule=!0,t.default=function(e){var t="".concat(e,"Storage");return function(e){if("object"!==("undefined"==typeof self?"undefined":n(self))||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch(e){return!1}return!0}(t)?self[t]:o};var o={getItem:r,setItem:r,removeItem:r}},274:(e,t,n)=>{"use strict";var r;t.A=void 0;var o=(0,((r=n(515))&&r.__esModule?r:{default:r}).default)("session");t.A=o},664:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},392:(e,t,n)=>{"use strict";var r=n(609),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),i((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},547:(e,t,n)=>{"use strict";var r=n(609),o=n(289),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var f=l(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;f=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return l=t}return l=e}if(t=l,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,l=n)}var i,l,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var d=i(e,f[0],f[1]);return s((function(){p.hasValue=!0,p.value=d}),[d]),u(d),d}},289:(e,t,n)=>{"use strict";e.exports=n(392)},591:(e,t,n)=>{"use strict";e.exports=n(547)},609:e=>{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";const e=window.wp.element;var t=n(609);function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}const o=function(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o},a=e=>"number"==typeof e&&!isNaN(e),i=e=>"string"==typeof e,l=e=>"function"==typeof e,s=e=>i(e)||l(e)?e:null,c=e=>(0,t.isValidElement)(e)||i(e)||l(e)||a(e);function u(e){let{enter:n,exit:r,appendPosition:o=!1,collapse:a=!0,collapseDuration:i=300}=e;return function(e){let{children:l,position:s,preventExitTransition:c,done:u,nodeRef:f,isIn:p}=e;const d=o?`${n}--${s}`:n,m=o?`${r}--${s}`:r,g=(0,t.useRef)(0);return(0,t.useLayoutEffect)((()=>{const e=f.current,t=d.split(" "),n=r=>{r.target===f.current&&(e.dispatchEvent(new Event("d")),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===g.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)}),[]),(0,t.useEffect)((()=>{const e=f.current,t=()=>{e.removeEventListener("animationend",t),a?function(e,t,n){void 0===n&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame((()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame((()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)}))}))}(e,u,i):u()};p||(c?t():(g.current=1,e.className+=` ${m}`,e.addEventListener("animationend",t)))}),[p]),t.createElement(t.Fragment,null,l)}}function f(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const p={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter((e=>e!==t));return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach((t=>{const n=setTimeout((()=>{t(...[].slice.call(arguments,1))}),0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)}))}},d=e=>{let{theme:n,type:r,...o}=e;return t.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":`var(--toastify-icon-color-${r})`,...o})},m={info:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};function g(e){const[,n]=(0,t.useReducer)((e=>e+1),0),[r,o]=(0,t.useState)([]),u=(0,t.useRef)(null),d=(0,t.useRef)(new Map).current,g=e=>-1!==r.indexOf(e),h=(0,t.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:g,getToast:e=>d.get(e)}).current;function y(e){let{containerId:t}=e;const{limit:n}=h.props;!n||t&&h.containerId!==t||(h.count-=h.queue.length,h.queue=[])}function v(e){o((t=>null==e?[]:t.filter((t=>t!==e))))}function w(){const{toastContent:e,toastProps:t,staleId:n}=h.queue.shift();E(e,t,n)}function b(e,r){let{delay:o,staleId:g,...y}=r;if(!c(e)||function(e){return!u.current||h.props.enableMultiContainer&&e.containerId!==h.props.containerId||d.has(e.toastId)&&null==e.updateId}(y))return;const{toastId:b,updateId:x,data:S}=y,{props:O}=h,C=()=>v(b),k=null==x;k&&h.count++;const P={...O,style:O.toastStyle,key:h.toastKey++,...Object.fromEntries(Object.entries(y).filter((e=>{let[t,n]=e;return null!=n}))),toastId:b,updateId:x,data:S,closeToast:C,isIn:!1,className:s(y.className||O.toastClassName),bodyClassName:s(y.bodyClassName||O.bodyClassName),progressClassName:s(y.progressClassName||O.progressClassName),autoClose:!y.isLoading&&(j=y.autoClose,R=O.autoClose,!1===j||a(j)&&j>0?j:R),deleteToast(){const e=f(d.get(b),"removed");d.delete(b),p.emit(4,e);const t=h.queue.length;if(h.count=null==b?h.count-h.displayedToast:h.count-1,h.count<0&&(h.count=0),t>0){const e=null==b?h.props.limit:1;if(1===t||1===e)h.displayedToast++,w();else{const n=e>t?t:e;h.displayedToast=n;for(let e=0;e<n;e++)w()}}else n()}};var j,R;P.iconOut=function(e){let{theme:n,type:r,isLoading:o,icon:s}=e,c=null;const u={theme:n,type:r};return!1===s||(l(s)?c=s(u):(0,t.isValidElement)(s)?c=(0,t.cloneElement)(s,u):i(s)||a(s)?c=s:o?c=m.spinner():(e=>e in m)(r)&&(c=m[r](u))),c}(P),l(y.onOpen)&&(P.onOpen=y.onOpen),l(y.onClose)&&(P.onClose=y.onClose),P.closeButton=O.closeButton,!1===y.closeButton||c(y.closeButton)?P.closeButton=y.closeButton:!0===y.closeButton&&(P.closeButton=!c(O.closeButton)||O.closeButton);let N=e;(0,t.isValidElement)(e)&&!i(e.type)?N=(0,t.cloneElement)(e,{closeToast:C,toastProps:P,data:S}):l(e)&&(N=e({closeToast:C,toastProps:P,data:S})),O.limit&&O.limit>0&&h.count>O.limit&&k?h.queue.push({toastContent:N,toastProps:P,staleId:g}):a(o)?setTimeout((()=>{E(N,P,g)}),o):E(N,P,g)}function E(e,t,n){const{toastId:r}=t;n&&d.delete(n);const a={content:e,props:t};d.set(r,a),o((e=>[...e,r].filter((e=>e!==n)))),p.emit(4,f(a,null==a.props.updateId?"added":"updated"))}return(0,t.useEffect)((()=>(h.containerId=e.containerId,p.cancelEmit(3).on(0,b).on(1,(e=>u.current&&v(e))).on(5,y).emit(2,h),()=>{d.clear(),p.emit(3,h)})),[]),(0,t.useEffect)((()=>{h.props=e,h.isToastActive=g,h.displayedToast=r.length})),{getToastToRender:function(t){const n=new Map,r=Array.from(d.values());return e.newestOnTop&&r.reverse(),r.forEach((e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)})),Array.from(n,(e=>t(e[0],e[1])))},containerRef:u,isToastActive:g}}function h(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function y(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function v(e){const[n,r]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),i=(0,t.useRef)(null),s=(0,t.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,c=(0,t.useRef)(e),{autoClose:u,pauseOnHover:f,closeToast:p,onClick:d,closeOnClick:m}=e;function g(t){if(e.draggable){"touchstart"===t.nativeEvent.type&&t.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",E),document.addEventListener("mouseup",x),document.addEventListener("touchmove",E),document.addEventListener("touchend",x);const n=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=n.getBoundingClientRect(),n.style.transition="",s.x=h(t.nativeEvent),s.y=y(t.nativeEvent),"x"===e.draggableDirection?(s.start=s.x,s.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function v(t){if(s.boundingRect){const{top:n,bottom:r,left:o,right:a}=s.boundingRect;"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&s.x>=o&&s.x<=a&&s.y>=n&&s.y<=r?b():w()}}function w(){r(!0)}function b(){r(!1)}function E(t){const r=i.current;s.canDrag&&r&&(s.didMove=!0,n&&b(),s.x=h(t),s.y=y(t),s.delta="x"===e.draggableDirection?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),r.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,r.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function x(){document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",x);const t=i.current;if(s.canDrag&&s.didMove&&t){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return a(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform=`translate${e.draggableDirection}(0)`,t.style.opacity="1"}}(0,t.useEffect)((()=>{c.current=e})),(0,t.useEffect)((()=>(i.current&&i.current.addEventListener("d",w,{once:!0}),l(e.onOpen)&&e.onOpen((0,t.isValidElement)(e.children)&&e.children.props),()=>{const e=c.current;l(e.onClose)&&e.onClose((0,t.isValidElement)(e.children)&&e.children.props)})),[]),(0,t.useEffect)((()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",w),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",w),window.removeEventListener("blur",b))})),[e.pauseOnFocusLoss]);const S={onMouseDown:g,onTouchStart:g,onMouseUp:v,onTouchEnd:v};return u&&f&&(S.onMouseEnter=b,S.onMouseLeave=w),m&&(S.onClick=e=>{d&&d(e),s.canCloseOnClick&&p()}),{playToast:w,pauseToast:b,isRunning:n,preventExitTransition:o,toastRef:i,eventHandlers:S}}function w(e){let{closeToast:n,theme:r,ariaLabel:o="close"}=e;return t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${r}`,type:"button",onClick:e=>{e.stopPropagation(),n(e)},"aria-label":o},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function b(e){let{delay:n,isRunning:r,closeToast:a,type:i="default",hide:s,className:c,style:u,controlledProgress:f,progress:p,rtl:d,isIn:m,theme:g}=e;const h=s||f&&0===p,y={...u,animationDuration:`${n}ms`,animationPlayState:r?"running":"paused",opacity:h?0:1};f&&(y.transform=`scaleX(${p})`);const v=o("Toastify__progress-bar",f?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":d}),w=l(c)?c({rtl:d,type:i,defaultClassName:v}):o(v,c);return t.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:w,style:y,[f&&p>=1?"onTransitionEnd":"onAnimationEnd"]:f&&p<1?null:()=>{m&&a()}})}const E=e=>{const{isRunning:n,preventExitTransition:r,toastRef:a,eventHandlers:i}=v(e),{closeButton:s,children:c,autoClose:u,onClick:f,type:p,hideProgressBar:d,closeToast:m,transition:g,position:h,className:y,style:E,bodyClassName:x,bodyStyle:S,progressClassName:O,progressStyle:C,updateId:k,role:P,progress:j,rtl:R,toastId:N,deleteToast:_,isIn:L,isLoading:I,iconOut:F,closeOnClick:M,theme:A}=e,T=o("Toastify__toast",`Toastify__toast-theme--${A}`,`Toastify__toast--${p}`,{"Toastify__toast--rtl":R},{"Toastify__toast--close-on-click":M}),D=l(y)?y({rtl:R,position:h,type:p,defaultClassName:T}):o(T,y),V=!!j||!u,G={closeToast:m,type:p,theme:A};let z=null;return!1===s||(z=l(s)?s(G):(0,t.isValidElement)(s)?(0,t.cloneElement)(s,G):w(G)),t.createElement(g,{isIn:L,done:_,position:h,preventExitTransition:r,nodeRef:a},t.createElement("div",{id:N,onClick:f,className:D,...i,style:E,ref:a},t.createElement("div",{...L&&{role:P},className:l(x)?x({type:p}):o("Toastify__toast-body",x),style:S},null!=F&&t.createElement("div",{className:o("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},F),t.createElement("div",null,c)),z,t.createElement(b,{...k&&!V?{key:`pb-${k}`}:{},rtl:R,theme:A,delay:u,isRunning:n,isIn:L,closeToast:m,hide:d,type:p,style:C,className:O,controlledProgress:V,progress:j||0})))},x=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},S=u(x("bounce",!0)),O=(u(x("slide",!0)),u(x("zoom")),u(x("flip")),(0,t.forwardRef)(((e,n)=>{const{getToastToRender:r,containerRef:a,isToastActive:i}=g(e),{className:c,style:u,rtl:f,containerId:p}=e;function d(e){const t=o("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":f});return l(c)?c({position:e,rtl:f,defaultClassName:t}):o(t,s(c))}return(0,t.useEffect)((()=>{n&&(n.current=a.current)}),[]),t.createElement("div",{ref:a,className:"Toastify",id:p},r(((e,n)=>{const r=n.length?{...u}:{...u,pointerEvents:"none"};return t.createElement("div",{className:d(e),style:r,key:`container-${e}`},n.map(((e,r)=>{let{content:o,props:a}=e;return t.createElement(E,{...a,isIn:i(a.toastId),style:{...a.style,"--nth":r+1,"--len":n.length},key:`toast-${a.key}`},o)})))})))})));O.displayName="ToastContainer",O.defaultProps={position:"top-right",transition:S,autoClose:5e3,closeButton:w,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let C,k=new Map,P=[],j=1;function R(){return""+j++}function N(e){return e&&(i(e.toastId)||a(e.toastId))?e.toastId:R()}function _(e,t){return k.size>0?p.emit(0,e,t):P.push({content:e,options:t}),t.toastId}function L(e,t){return{...t,type:t&&t.type||e,toastId:N(t)}}function I(e){return(t,n)=>_(t,L(e,n))}function F(e,t){return _(e,L("default",t))}F.loading=(e,t)=>_(e,L("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),F.promise=function(e,t,n){let r,{pending:o,error:a,success:s}=t;o&&(r=i(o)?F.loading(o,n):F.loading(o.render,{...n,...o}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,o)=>{if(null==t)return void F.dismiss(r);const a={type:e,...c,...n,data:o},l=i(t)?{render:t}:t;return r?F.update(r,{...a,...l}):F(l.render,{...a,...l}),o},f=l(e)?e():e;return f.then((e=>u("success",s,e))).catch((e=>u("error",a,e))),f},F.success=I("success"),F.info=I("info"),F.error=I("error"),F.warning=I("warning"),F.warn=F.warning,F.dark=(e,t)=>_(e,L("default",{theme:"dark",...t})),F.dismiss=e=>{k.size>0?p.emit(1,e):P=P.filter((t=>null!=e&&t.options.toastId!==e))},F.clearWaitingQueue=function(e){return void 0===e&&(e={}),p.emit(5,e)},F.isActive=e=>{let t=!1;return k.forEach((n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)})),t},F.update=function(e,t){void 0===t&&(t={}),setTimeout((()=>{const n=function(e,t){let{containerId:n}=t;const r=k.get(n||C);return r&&r.getToast(e)}(e,t);if(n){const{props:r,content:o}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:R()};a.toastId!==e&&(a.staleId=e);const i=a.render||o;delete a.render,_(i,a)}}),0)},F.done=e=>{F.update(e,{progress:1})},F.onChange=e=>(p.on(4,e),()=>{p.off(4,e)}),F.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},F.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},p.on(2,(e=>{C=e.containerId||e,k.set(C,e),P.forEach((e=>{p.emit(0,e.content,e.options)})),P=[]})).on(3,(e=>{k.delete(e.containerId||e),0===k.size&&p.off(0).off(1).off(5)}));var M=n(289),A=n(591);const T=window.ReactDOM;let D=function(e){e()};const V=()=>D,G=Symbol.for("react-redux-context"),z="undefined"!=typeof globalThis?globalThis:{};function B(){var e;if(!t.createContext)return{};const n=null!=(e=z[G])?e:z[G]=new Map;let r=n.get(t.createContext);return r||(r=t.createContext(null),n.set(t.createContext,r)),r}const H=B();function q(e=H){return function(){return(0,t.useContext)(e)}}const U=q();let $=()=>{throw new Error("uSES not initialized!")};const W=(e,t)=>e===t;function Z(e=H){const n=e===H?U:q(e);return function(e,r={}){const{equalityFn:o=W,stabilityCheck:a,noopCheck:i}="function"==typeof r?{equalityFn:r}:r,{store:l,subscription:s,getServerState:c,stabilityCheck:u,noopCheck:f}=n(),p=((0,t.useRef)(!0),(0,t.useCallback)({[e.name]:t=>e(t)}[e.name],[e,u,a])),d=$(s.addNestedSub,l.getState,c||l.getState,p,o);return(0,t.useDebugValue)(d),d}}const Y=Z();n(35),n(176);const K={notify(){},get:()=>[]};const X="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;let J=null;function Q(e=H){const t=e===H?U:q(e);return function(){const{store:e}=t();return e}}const ee=Q();function te(e=H){const t=e===H?ee:Q(e);return function(){return t().dispatch}}const ne=te();var re;function oe(e){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(e)}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ie(e){return ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ie(e)}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e,t){return se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},se(e,t)}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(e=>{$=e})(A.useSyncExternalStoreWithSelector),(e=>{J=e})(M.useSyncExternalStore),re=T.unstable_batchedUpdates,D=re;var ue,fe=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=function(e,t){return!t||"object"!==oe(t)&&"function"!=typeof t?le(e):t}(this,(e=ie(t)).call.apply(e,[this].concat(o))),ce(le(n),"state",{bootstrapped:!1}),ce(le(n),"_unsubscribe",void 0),ce(le(n),"handlePersistorState",(function(){n.props.persistor.getState().bootstrapped&&(n.props.onBeforeLift?Promise.resolve(n.props.onBeforeLift()).finally((function(){return n.setState({bootstrapped:!0})})):n.setState({bootstrapped:!0}),n._unsubscribe&&n._unsubscribe())})),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&se(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&ae(n.prototype,r),t}(t.PureComponent);function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}ce(fe,"defaultProps",{children:null,loading:null}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ue||(ue={}));const de="popstate";function me(e,t){if(!1===e||null==e)throw new Error(t)}function ge(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function he(e,t){return{usr:e.state,key:e.key,idx:t}}function ye(e,t,n,r){return void 0===n&&(n=null),pe({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?we(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function ve(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function we(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var be;function Ee(e,t,n){void 0===n&&(n="/");let r=Me(("string"==typeof t?we(t):t).pathname||"/",n);if(null==r)return null;let o=xe(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e){let t=Fe(r);a=Le(o[e],t)}return a}function xe(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(me(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let l=Ve([r,i.relativePath]),s=n.concat(i);e.children&&e.children.length>0&&(me(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),xe(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:_e(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of Se(e.path))o(e,t,n);else o(e,t)})),t}function Se(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let i=Se(r.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(be||(be={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const Oe=/^:[\w-]+$/,Ce=3,ke=2,Pe=1,je=10,Re=-2,Ne=e=>"*"===e;function _e(e,t){let n=e.split("/"),r=n.length;return n.some(Ne)&&(r+=Re),t&&(r+=ke),n.filter((e=>!Ne(e))).reduce(((e,t)=>e+(Oe.test(t)?Ce:""===t?Pe:je)),r)}function Le(e,t){let{routesMeta:n}=e,r={},o="/",a=[];for(let e=0;e<n.length;++e){let i=n[e],l=e===n.length-1,s="/"===o?t:t.slice(o.length)||"/",c=Ie({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(r,c.params);let u=i.route;a.push({params:r,pathname:Ve([o,c.pathname]),pathnameBase:Ge(Ve([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=Ve([o,c.pathnameBase]))}return a}function Ie(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),ge("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1),s=r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{});return{params:s,pathname:a,pathnameBase:i,pattern:e}}function Fe(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return ge(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function Me(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Ae(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Te(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function De(e,t,n,r){let o;void 0===r&&(r=!1),"string"==typeof e?o=we(e):(o=pe({},e),me(!o.pathname||!o.pathname.includes("?"),Ae("?","pathname","search",o)),me(!o.pathname||!o.pathname.includes("#"),Ae("#","pathname","hash",o)),me(!o.search||!o.search.includes("#"),Ae("#","search","hash",o)));let a,i=""===e||""===o.pathname,l=i?"/":o.pathname;if(null==l)a=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"==typeof e?we(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:ze(r),hash:Be(o)}}(o,a),c=l&&"/"!==l&&l.endsWith("/"),u=(i||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const Ve=e=>e.join("/").replace(/\/\/+/g,"/"),Ge=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ze=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Be=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const He=["post","put","patch","delete"],qe=(new Set(He),["get",...He]);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}new Set(qe),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const $e=t.createContext(null),We=t.createContext(null),Ze=t.createContext(null),Ye=t.createContext(null),Ke=t.createContext({outlet:null,matches:[],isDataRoute:!1}),Xe=t.createContext(null);function Je(){return null!=t.useContext(Ye)}function Qe(){return Je()||me(!1),t.useContext(Ye).location}function et(e){t.useContext(Ze).static||t.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=t.useContext(Ke);return e?function(){let{router:e}=function(e){let n=t.useContext($e);return n||me(!1),n}(st.UseNavigateStable),n=ut(ct.UseNavigateStable),r=t.useRef(!1);return et((()=>{r.current=!0})),t.useCallback((function(t,o){void 0===o&&(o={}),r.current&&("number"==typeof t?e.navigate(t):e.navigate(t,Ue({fromRouteId:n},o)))}),[e,n])}():function(){Je()||me(!1);let e=t.useContext($e),{basename:n,future:r,navigator:o}=t.useContext(Ze),{matches:a}=t.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(Te(a,r.v7_relativeSplatPath)),s=t.useRef(!1);return et((()=>{s.current=!0})),t.useCallback((function(t,r){if(void 0===r&&(r={}),!s.current)return;if("number"==typeof t)return void o.go(t);let a=De(t,JSON.parse(l),i,"path"===r.relative);null==e&&"/"!==n&&(a.pathname="/"===a.pathname?n:Ve([n,a.pathname])),(r.replace?o.replace:o.push)(a,r.state,r)}),[n,o,l,i,e])}()}function nt(e,n){let{relative:r}=void 0===n?{}:n,{future:o}=t.useContext(Ze),{matches:a}=t.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(Te(a,o.v7_relativeSplatPath));return t.useMemo((()=>De(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function rt(e,n,r,o){Je()||me(!1);let{navigator:a}=t.useContext(Ze),{matches:i}=t.useContext(Ke),l=i[i.length-1],s=l?l.params:{},c=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let u,f=Qe();if(n){var p;let e="string"==typeof n?we(n):n;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||me(!1),u=e}else u=f;let d=u.pathname||"/",m=d;if("/"!==c){let e=c.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=Ee(e,{pathname:m}),h=function(e,n,r,o){var a;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===o&&(o=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(a=r)?void 0:a.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||me(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,u=-1;if(r&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,o=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||o){c=!0,l=u>=0?l.slice(0,u+1):[l[0]];break}}}return l.reduceRight(((e,o,a)=>{let i,f=!1,p=null,d=null;var m;r&&(i=s&&o.route.id?s[o.route.id]:void 0,p=o.route.errorElement||at,c&&(u<0&&0===a?(ft[m="route-fallback"]||(ft[m]=!0),f=!0,d=null):u===a&&(f=!0,d=o.route.hydrateFallbackElement||null)));let g=n.concat(l.slice(0,a+1)),h=()=>{let n;return n=i?p:f?d:o.route.Component?t.createElement(o.route.Component,null):o.route.element?o.route.element:e,t.createElement(lt,{match:o,routeContext:{outlet:e,matches:g,isDataRoute:null!=r},children:n})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?t.createElement(it,{location:r.location,revalidation:r.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()}),null)}(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Ve([c,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Ve([c,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,r,o);return n&&h?t.createElement(Ye.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ue.Pop}},h):h}function ot(){let e=function(){var e;let n=t.useContext(Xe),r=function(e){let n=t.useContext(We);return n||me(!1),n}(ct.UseRouteError),o=ut(ct.UseRouteError);return void 0!==n?n:null==(e=r.errors)?void 0:e[o]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:o},r):null,null)}const at=t.createElement(ot,null);class it extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(Ke.Provider,{value:this.props.routeContext},t.createElement(Xe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lt(e){let{routeContext:n,match:r,children:o}=e,a=t.useContext($e);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(Ke.Provider,{value:n},o)}var st=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(st||{}),ct=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ct||{});function ut(e){let n=function(e){let n=t.useContext(Ke);return n||me(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||me(!1),r.route.id}const ft={};function pt(e){me(!1)}function dt(e){let{basename:n="/",children:r=null,location:o,navigationType:a=ue.Pop,navigator:i,static:l=!1,future:s}=e;Je()&&me(!1);let c=n.replace(/^\/*/,"/"),u=t.useMemo((()=>({basename:c,navigator:i,static:l,future:Ue({v7_relativeSplatPath:!1},s)})),[c,s,i,l]);"string"==typeof o&&(o=we(o));let{pathname:f="/",search:p="",hash:d="",state:m=null,key:g="default"}=o,h=t.useMemo((()=>{let e=Me(f,c);return null==e?null:{location:{pathname:e,search:p,hash:d,state:m,key:g},navigationType:a}}),[c,f,p,d,m,g,a]);return null==h?null:t.createElement(Ze.Provider,{value:u},t.createElement(Ye.Provider,{children:r,value:h}))}function mt(e){let{children:t,location:n}=e;return rt(gt(t),n)}function gt(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,((e,o)=>{if(!t.isValidElement(e))return;let a=[...n,o];if(e.type===t.Fragment)return void r.push.apply(r,gt(e.props.children,a));e.type!==pt&&me(!1),e.props.index&&e.props.children&&me(!1);let i={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=gt(e.props.children,a)),r.push(i)})),r}function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ht.apply(this,arguments)}function yt(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}t.startTransition,new Promise((()=>{})),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const vt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wt=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const bt=t.createContext({isTransitioning:!1});new Map;const Et=t.startTransition;function xt(e){let{basename:n,children:r,future:o,window:a}=e,i=t.useRef();var l;null==i.current&&(i.current=(void 0===(l={window:a,v5Compat:!0})&&(l={}),function(e,t,n,r){void 0===r&&(r={});let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,l=ue.Pop,s=null,c=u();function u(){return(i.state||{idx:null}).idx}function f(){l=ue.Pop;let e=u(),t=null==e?null:e-c;c=e,s&&s({action:l,location:d.location,delta:t})}function p(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,n="string"==typeof e?e:ve(e);return n=n.replace(/ $/,"%20"),me(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==c&&(c=0,i.replaceState(pe({},i.state,{idx:c}),""));let d={get action(){return l},get location(){return e(o,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(de,f),s=e,()=>{o.removeEventListener(de,f),s=null}},createHref:e=>t(o,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=ue.Push;let r=ye(d.location,e,t);n&&n(r,e),c=u()+1;let f=he(r,c),p=d.createHref(r);try{i.pushState(f,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&s&&s({action:l,location:d.location,delta:1})},replace:function(e,t){l=ue.Replace;let r=ye(d.location,e,t);n&&n(r,e),c=u();let o=he(r,c),f=d.createHref(r);i.replaceState(o,"",f),a&&s&&s({action:l,location:d.location,delta:0})},go:e=>i.go(e)};return d}((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=we(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),ye("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:ve(t))}),(function(e,t){ge("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),l)));let s=i.current,[c,u]=t.useState({action:s.action,location:s.location}),{v7_startTransition:f}=o||{},p=t.useCallback((e=>{f&&Et?Et((()=>u(e))):u(e)}),[u,f]);return t.useLayoutEffect((()=>s.listen(p)),[s,p]),t.createElement(dt,{basename:n,children:r,location:c.location,navigationType:c.action,navigator:s,future:o})}T.flushSync,t.useId;const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=t.forwardRef((function(e,n){let r,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:f,unstable_viewTransition:p}=e,d=yt(e,vt),{basename:m}=t.useContext(Ze),g=!1;if("string"==typeof u&&Ot.test(u)&&(r=u,St))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=Me(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch(e){}let h=function(e,n){let{relative:r}=void 0===n?{}:n;Je()||me(!1);let{basename:o,navigator:a}=t.useContext(Ze),{hash:i,pathname:l,search:s}=nt(e,{relative:r}),c=l;return"/"!==o&&(c="/"===l?o:Ve([o,l])),a.createHref({pathname:c,search:s,hash:i})}(u,{relative:a}),y=function(e,n){let{target:r,replace:o,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,c=tt(),u=Qe(),f=nt(e,{relative:l});return t.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let n=void 0!==o?o:ve(u)===ve(f);c(e,{replace:n,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[u,c,f,o,a,r,e,i,l,s])}(u,{replace:l,state:s,target:c,preventScrollReset:f,relative:a,unstable_viewTransition:p});return t.createElement("a",ht({},d,{href:r||h,onClick:g||i?o:function(e){o&&o(e),e.defaultPrevented||y(e)},ref:n,target:c}))})),kt=t.forwardRef((function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,unstable_viewTransition:c,children:u}=e,f=yt(e,wt),p=nt(s,{relative:f.relative}),d=Qe(),m=t.useContext(We),{navigator:g,basename:h}=t.useContext(Ze),y=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(bt);null==r&&me(!1);let{basename:o}=function(e){let n=t.useContext($e);return n||me(!1),n}(Pt.useViewTransitionState),a=nt(e,{relative:n.relative});if(!r.isTransitioning)return!1;let i=Me(r.currentLocation.pathname,o)||r.currentLocation.pathname,l=Me(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=Ie(a.pathname,l)||null!=Ie(a.pathname,i)}(p)&&!0===c,v=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,w=d.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(w=w.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&h&&(b=Me(b,h)||b);const E="/"!==v&&v.endsWith("/")?v.length-1:v.length;let x,S=w===v||!i&&w.startsWith(v)&&"/"===w.charAt(E),O=null!=b&&(b===v||!i&&b.startsWith(v)&&"/"===b.charAt(v.length)),C={isActive:S,isPending:O,isTransitioning:y},k=S?r:void 0;x="function"==typeof a?a(C):[a,S?"active":null,O?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof l?l(C):l;return t.createElement(Ct,ht({},f,{"aria-current":k,className:x,ref:n,style:P,to:s,unstable_viewTransition:c}),"function"==typeof u?u(C):u)}));var Pt,jt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Pt||(Pt={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(jt||(jt={}));const Rt=n.p+"images/logo.4a5282be.png";function Nt(e){var t=e.to,n=e.children;return wp.element.createElement(kt,{to:t,className:function(e){return e.isActive?"text-sky-400 focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400":"focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400"}},n)}const _t=function(e){var t=e.children,n="h-full flex items-center justify-center mb-0";return wp.element.createElement("div",{className:"relative"},wp.element.createElement("header",{className:"bg-white dark:bg-zinc-800 px-10 xl:px-20 items-stretch justify-between h-14 hidden xl:flex"},wp.element.createElement("div",{className:"flex items-center gap-px py-4 "},wp.element.createElement("img",{className:"h-10 w-auto",src:Rt,alt:"SquareWooSync"}),wp.element.createElement("h2",{className:"ml-2 font-bold text-base dark:text-white"},"SQUAREWOOSYNC"),wp.element.createElement("nav",{className:"h-full ml-10"},wp.element.createElement("ul",{className:"flex items-center h-full gap-4 justify-center divide-x divide-gray-200 font-semibold dark:text-zinc-300"},wp.element.createElement("li",{className:n},wp.element.createElement(Nt,{to:"/"},"Dashboard")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/inventory"},"Inventory")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/orders"},"Orders")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/settings/general"},"Settings")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement("a",{target:"_blank",href:"https://squarewoosync.com/documentation",className:function(e){return e.isActive?"text-sky-400 focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400":"focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400"}},"Documentation"))))),wp.element.createElement("div",{className:"flex items-center justify-end"},wp.element.createElement("a",{href:"https://squarewoosync.com",target:"_blank",className:" h-full bg-sky-400 flex justify-center items-center w-40 text-white font-bold"},"Upgrade to Pro"))),wp.element.createElement("main",{className:"mx-auto pb-20 mt-10 px-10 xl:px-20"},t))};function Lt(){return wp.element.createElement("div",{className:"bg-white dark:bg-transparent dark:border dark:border-zinc-700 p-6 rounded-xl not-prose grid grid-cols-1 gap-6 sm:grid-cols-2 w-full dark:text-zinc-100"},wp.element.createElement("header",{className:"mb-2 col-span-full flex flex-col"},wp.element.createElement("p",{className:"text-sm font-medium text-sky-500 dark:text-sky-400"},"Introduction"),wp.element.createElement("h1",{className:"text-3xl tracking-tight text-slate-900 font-bold dark:text-zinc-100"},"Getting started"),wp.element.createElement("p",{className:"text-xl text-gray-600 mt-2 dark:text-zinc-100"},"Welcome to SquareWooSync. See below to learn how to start importing and synchronizing products with Square and Woo.")),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient",gradientTransform:"matrix(0 21 -21 0 20 11)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient-dark-1",gradientTransform:"matrix(0 22.75 -22.75 0 16 6.25)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient-dark-2",gradientTransform:"matrix(0 14 -14 0 16 10)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"20",cy:"20",r:"12",fill:"url(#:S3:-gradient)"}),wp.element.createElement("g",{fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 9v14l12 6V15L3 9Z"}),wp.element.createElement("path",{d:"M27 9v14l-12 6V15l12-6Z"})),wp.element.createElement("path",{d:"M11 4h8v2l6 3-10 6L5 9l6-3V4Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)]"}),wp.element.createElement("g",{className:"stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M20 5.5 27 9l-12 6L3 9l7-3.5"}),wp.element.createElement("path",{d:"M20 5c0 1.105-2.239 2-5 2s-5-.895-5-2m10 0c0-1.105-2.239-2-5-2s-5 .895-5 2m10 0v3c0 1.105-2.239 2-5 2s-5-.895-5-2V5"}))),wp.element.createElement("g",{className:"hidden ",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M17.676 3.38a3.887 3.887 0 0 0-3.352 0l-9 4.288C3.907 8.342 3 9.806 3 11.416v9.168c0 1.61.907 3.073 2.324 3.748l9 4.288a3.887 3.887 0 0 0 3.352 0l9-4.288C28.093 23.657 29 22.194 29 20.584v-9.168c0-1.61-.907-3.074-2.324-3.748l-9-4.288Z",stroke:"url(#:S3:-gradient-dark-1)"}),wp.element.createElement("path",{d:"M16.406 8.087a.989.989 0 0 0-.812 0l-7 3.598A1.012 1.012 0 0 0 8 12.61v6.78c0 .4.233.762.594.925l7 3.598a.989.989 0 0 0 .812 0l7-3.598c.361-.163.594-.525.594-.925v-6.78c0-.4-.233-.762-.594-.925l-7-3.598Z",fill:"url(#:S3:-gradient-dark-2)",stroke:"url(#:S3:-gradient-dark-2)"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/inventory"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Start a new import")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Click here to begin importing or syncronizing products from Square to Woo"))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S1:-gradient",gradientTransform:"matrix(0 21 -21 0 12 3)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S1:-gradient-dark",gradientTransform:"matrix(0 21 -21 0 16 7)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#:S1:-gradient)"}),wp.element.createElement("path",{d:"m8 8 9 21 2-10 10-2L8 8Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),wp.element.createElement("g",{className:"hidden "},wp.element.createElement("path",{d:"m4 4 10.286 24 2.285-11.429L28 14.286 4 4Z",fill:"url(#:S1:-gradient-dark)",stroke:"url(#:S1:-gradient-dark)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"https://squarewoosync.com/documentation",target:"_blank"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Installation")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Step-by-step guides to setting up your Square account and Woo to talk to each other"))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S2:-gradient",gradientTransform:"matrix(0 21 -21 0 20 3)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S2:-gradient-dark",gradientTransform:"matrix(0 22.75 -22.75 0 16 6.25)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"20",cy:"12",r:"12",fill:"url(#:S2:-gradient)"}),wp.element.createElement("g",{className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",fillOpacity:"0.5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 5v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M18 17v10a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V17a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M18 5v4a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M3 25v2a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2Z"}))),wp.element.createElement("g",{className:"hidden ",fill:"url(#:S2:-gradient-dark)"},wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 17V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Zm16 10v-9a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2Zm0-23v5a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-8a1 1 0 0 0-1 1ZM3 28v-3a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Z"}),wp.element.createElement("path",{d:"M2 4v13h2V4H2Zm2-2a2 2 0 0 0-2 2h2V2Zm8 0H4v2h8V2Zm2 2a2 2 0 0 0-2-2v2h2Zm0 13V4h-2v13h2Zm-2 2a2 2 0 0 0 2-2h-2v2Zm-8 0h8v-2H4v2Zm-2-2a2 2 0 0 0 2 2v-2H2Zm16 1v9h2v-9h-2Zm3-3a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1v-2Zm6 0h-6v2h6v-2Zm3 3a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2Zm0 9v-9h-2v9h2Zm-3 3a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2Zm-6 0h6v-2h-6v2Zm-3-3a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1h-2Zm2-18V4h-2v5h2Zm0 0h-2a2 2 0 0 0 2 2V9Zm8 0h-8v2h8V9Zm0 0v2a2 2 0 0 0 2-2h-2Zm0-5v5h2V4h-2Zm0 0h2a2 2 0 0 0-2-2v2Zm-8 0h8V2h-8v2Zm0 0V2a2 2 0 0 0-2 2h2ZM2 25v3h2v-3H2Zm2-2a2 2 0 0 0-2 2h2v-2Zm9 0H4v2h9v-2Zm2 2a2 2 0 0 0-2-2v2h2Zm0 3v-3h-2v3h2Zm-2 2a2 2 0 0 0 2-2h-2v2Zm-9 0h9v-2H4v2Zm-2-2a2 2 0 0 0 2 2v-2H2Z"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#import-data",target:"_blank"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Controlling your import data")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Learn how the internals work and how you can choose which data you would like to sync."))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S4:-gradient",gradientTransform:"matrix(0 21 -21 0 12 11)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S4:-gradient-dark",gradientTransform:"matrix(0 24.5 -24.5 0 16 5.5)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"12",cy:"20",r:"12",fill:"url(#:S4:-gradient)"}),wp.element.createElement("path",{d:"M27 12.13 19.87 5 13 11.87v14.26l14-14Z",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",fillOpacity:"0.5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),wp.element.createElement("path",{d:"M3 3h10v22a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V3Z",className:"fill-[var(--icon-background)]",fillOpacity:"0.5"}),wp.element.createElement("path",{d:"M3 9v16a4 4 0 0 0 4 4h2a4 4 0 0 0 4-4V9M3 9V3h10v6M3 9h10M3 15h10M3 21h10",className:"stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),wp.element.createElement("path",{d:"M29 29V19h-8.5L13 26c0 1.5-2.5 3-5 3h21Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),wp.element.createElement("g",{className:"hidden "},wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 2a1 1 0 0 0-1 1v21a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H3Zm16.752 3.293a1 1 0 0 0-1.593.244l-1.045 2A1 1 0 0 0 17 8v13a1 1 0 0 0 1.71.705l7.999-8.045a1 1 0 0 0-.002-1.412l-6.955-6.955ZM26 18a1 1 0 0 0-.707.293l-10 10A1 1 0 0 0 16 30h13a1 1 0 0 0 1-1V19a1 1 0 0 0-1-1h-3ZM5 18a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H5Zm-1-5a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Zm1-7a1 1 0 0 0 0 2h6a1 1 0 1 0 0-2H5Z",fill:"url(#:S4:-gradient-dark)"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/settings/general"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Settings")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Manage your access token, import data and webhook url for automatic synchronization"))))}const It=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))})),Ft=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"}))})),Mt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"}))}));function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var Tt=[{icon:wp.element.createElement(It,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Sales/License support",description:"Wish to talk to us about your license or have another question related to sales?"},{icon:wp.element.createElement(Ft,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Bug reports",description:"Found a bug? Let us know so we can jump on it right away! And thank you for your help!"},{icon:wp.element.createElement(Mt,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Technical support",description:"Can't figure out how to set up this plugin or having another technical issue? Let us know and we would be glad to assist you."}],Dt=function(e){var t=e.icon,n=e.title,r=e.description;return wp.element.createElement("div",{className:"flex gap-x-4"},wp.element.createElement("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-sky-600"},t),wp.element.createElement("div",null,wp.element.createElement("h3",{className:"text-sm font-semibold text-gray-900"},n),wp.element.createElement("p",{className:"text-gray-600"},r),wp.element.createElement("p",null,wp.element.createElement("a",{href:"https://squarewoosync.com/#contact",target:"_blank",className:"text-sm font-semibold text-sky-600"},"Contact us"," ",wp.element.createElement("span",{"aria-hidden":"true"},"→")))))};function Vt(){return wp.element.createElement("div",{className:"isolate bg-white p-5 rounded-xl"},wp.element.createElement("div",{className:""},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Support")),wp.element.createElement("div",{className:"mt-3 space-y-4"},Tt.map((function(e,t){return wp.element.createElement(Dt,At({key:t},e))}))))}const Gt=window.wp.apiFetch;var zt=n.n(Gt);const Bt=window.moment;var Ht=n.n(Bt);const qt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))})),Ut=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))})),$t=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))})),Wt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function Yt(){Yt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Zt(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Zt(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Kt(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Jt=function(){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)([]),2),n=t[0],r=t[1];(0,e.useEffect)((function(){var e=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Kt(a,r,o,i,l,"next",e)}function l(e){Kt(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Yt().mark((function e(){var t,n;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zt()({path:"/sws/v1/logs",method:"GET"});case 2:(t=e.sent).logs&&(n=t.logs.reduce((function(e,t){return e.find((function(e){return e.id===t.id}))?e:e.concat([t])}),[]).sort((function(e,t){return Ht()(e.timestamp,"YYYY-MM-DD HH:mm:ss").diff(Ht()(t.timestamp,"YYYY-MM-DD HH:mm:ss"))})),console.log(n),r(n));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var o=function(e){try{return JSON.parse(e),!0}catch(e){return!1}};return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:" bg-white rounded-xl p-5 w-full"},wp.element.createElement("h3",{className:"text-base font-semibold text-gray-900 mb-6 flex justify-start items-center gap-2"},wp.element.createElement(Wt,{className:"w-6 h-6"}),"Sync Feed",wp.element.createElement("span",{className:"text-xs text-gray-500 font-normal mt-[1px] -ml-1"}," ","- Shows last 50 logs")),n.length<1&&wp.element.createElement("p",null,"No data, starting import/syncing to view logs"),wp.element.createElement("ul",{role:"list",className:"overflow-auto max-h-[1042px] h-auto overflow-y-auto "},n.reverse().map((function(e,t){return wp.element.createElement("li",{key:e.id},wp.element.createElement("div",{className:"relative pb-4"},t!==n.length-1?wp.element.createElement("span",{className:"absolute left-5 top-5 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}):null,wp.element.createElement("div",{className:"relative flex items-start space-x-3"},wp.element.createElement(React.Fragment,null,wp.element.createElement("div",null,wp.element.createElement("div",{className:"relative px-1"},wp.element.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 ring-8 ring-white"},"success"===e.log_level?wp.element.createElement(qt,{className:"h-5 w-5 text-green-500","aria-hidden":"true"}):"error"===e.log_level||"failed"===e.log_level?wp.element.createElement(Ut,{className:"h-5 w-5 text-red-500","aria-hidden":"true"}):wp.element.createElement($t,{className:"h-5 w-5 text-blue-500","aria-hidden":"true"})))),wp.element.createElement("div",{className:"min-w-0 flex-1 py-0"},wp.element.createElement("div",{className:"text-sm text-gray-500"},wp.element.createElement("p",{className:"whitespace-nowrap text-xs"},Ht()(e.timestamp)&&Ht()(e.timestamp).format("MMM DD HH:MM")),wp.element.createElement("p",{className:"mr-0.5"},e.message.length<1&&"failed"===e.log_level?"Unkown sync error":e.message),o(e.context)&&JSON.parse(e.context).product_id&&"success"===e.log_level&&wp.element.createElement("a",{className:"mr-0.5 text-xs mt-4 text-blue-600",href:"/wp-admin/post.php?post=".concat(JSON.parse(e.context).product_id,"&action=edit"),target:"_blank"},"View product"),o(e.context)&&JSON.parse(e.context).error_message&&"error"===e.log_level&&wp.element.createElement("p",{className:"text-xs italic text-red-800"},JSON.parse(e.context).error_message)))))))})))))};var Qt="squarewoosync";function en(){var t=Qe();return(0,e.useEffect)((function(){!function(){var e=jQuery,t=e("#toplevel_page_"+Qt),n=window.location.href,r=n.substr(n.indexOf("admin.php"));e("ul.wp-submenu li",t).removeClass("current"),t.on("click","a",(function(){var n=e(this);e("ul.wp-submenu li",t).removeClass("current"),n.hasClass("wp-has-submenu")?e("li.wp-first-item",t).addClass("current"):n.parents("li").addClass("current")}));var o=r.split("/");e("ul.wp-submenu a",t).each((function(t,n){void 0!==o[1]&&o[1];var a=!1;e(n).attr("href")===r&&(a=!0),a&&e(n).parent().addClass("current")}))}()}),[t.pathname]),null}const tn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{d:"M2 3a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H2Z"}),t.createElement("path",{fillRule:"evenodd",d:"M2 7.5h16l-.811 7.71a2 2 0 0 1-1.99 1.79H4.802a2 2 0 0 1-1.99-1.79L2 7.5ZM7 11a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z",clipRule:"evenodd"}))})),nn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM6.75 9.25a.75.75 0 0 0 0 1.5h4.59l-2.1 1.95a.75.75 0 0 0 1.02 1.1l3.5-3.25a.75.75 0 0 0 0-1.1l-3.5-3.25a.75.75 0 1 0-1.02 1.1l2.1 1.95H6.75Z",clipRule:"evenodd"}))})),rn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}));function on(e){var t=e.getInventory,n=e.validToken;return wp.element.createElement("div",{className:"px-4 py-32 sm:px-6 flex items-center justify-center flex-col"},wp.element.createElement(rn,{className:"mx-auto h-12 w-12 text-gray-400"}),wp.element.createElement("h3",{className:"mt-2 text-sm font-semibold text-gray-900"},"Square Inventory"),wp.element.createElement("p",{className:"mt-1 text-sm text-gray-500"},"Get started by loading your Square's inventory"),wp.element.createElement("div",{className:"mt-6"},n?wp.element.createElement("button",{type:"button",onClick:t,className:"inline-flex items-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},wp.element.createElement(tn,{className:"-ml-0.5 mr-1.5 h-5 w-5","aria-hidden":"true"}),"Load inventory"):wp.element.createElement("div",{className:"flex flex-col gap-2 items-center"},wp.element.createElement("p",{className:"text-red-500 text-center text-base"},"Access Token not set"),wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/settings/general",className:"inline-flex items-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},"Set access token",wp.element.createElement(nn,{className:"h-5 w-5 ml-1","aria-hidden":"true"})))))}function an(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const ln=function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"px-4 py-5 sm:px-6"},wp.element.createElement("div",{className:"flex flex-wrap items-center justify-start sm:flex-nowrap"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-gray-900"},"Square Inventory"))),wp.element.createElement("div",{className:"overflow-x-auto"},wp.element.createElement("table",{className:"whitespace-nowrap text-left bg-white w-full"},wp.element.createElement("colgroup",null,wp.element.createElement("col",{className:"w-full lg:w-1/12"}),wp.element.createElement("col",{className:"w-full lg:w-2/12"})),wp.element.createElement("thead",{className:"border-b border-gray-900/10 text-sm leading-6 text-gray-900"},wp.element.createElement("tr",null,wp.element.createElement("th",{scope:"col",className:"py-2 pl-4 pr-8 font-semibold sm:pl-6 lg:pl-8"},"SKU"),wp.element.createElement("th",{scope:"col",className:"py-2 pl-4 pr-8 font-semibold sm:pl-6 lg:pl-8"},"Product Name"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Type"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Price"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Categories"),wp.element.createElement("th",{scope:"col",className:"py-2 pl-0 pr-4 text-right font-semibold sm:pr-8 sm:text-left lg:pr-20"},"Status"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-4 text-right font-semibold sm:table-cell sm:pr-6 lg:pr-8"},"Actions"))),wp.element.createElement("tbody",{className:"divide-y divide-gray-200 animate-pulse"},(e=Array(3),function(e){if(Array.isArray(e))return an(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return an(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?an(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e,t){return wp.element.createElement("tr",{key:t},wp.element.createElement("td",{colSpan:7,className:"py-2 pl-4 pr-8 sm:pl-6 lg:pl-8"},wp.element.createElement("div",{className:"h-6 bg-gray-200 rounded"})))}))))));var e};function sn(e,t){return"function"==typeof e?e(t):e}function cn(e,t){return n=>{t.setState((t=>({...t,[e]:sn(n,t[e])})))}}function un(e){return e instanceof Function}function fn(e,t,n){let r,o=[];return a=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(a);if(l.length===o.length&&!l.some(((e,t)=>o[t]!==e)))return r;let s;if(o=l,n.key&&n.debug&&(s=Date.now()),r=t(...l),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-s))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function pn(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}const dn="debugHeaders";function mn(e,t,n){var r;let o={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const gn={createTable:e=>{e.getHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,r,o)=>{var a,i;const l=null!=(a=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?a:[],s=null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[];return hn(t,[...l,...n.filter((e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id)))),...s],e)}),pn(e.options,dn)),e.getCenterHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,r,o)=>hn(t,n=n.filter((e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),pn(e.options,dn)),e.getLeftHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,r)=>{var o;const a=null!=(o=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[];return hn(t,a,e,"left")}),pn(e.options,dn)),e.getRightHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,r)=>{var o;const a=null!=(o=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[];return hn(t,a,e,"right")}),pn(e.options,dn)),e.getFooterGroups=fn((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getLeftFooterGroups=fn((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getCenterFooterGroups=fn((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getRightFooterGroups=fn((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getFlatHeaders=fn((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getLeftFlatHeaders=fn((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getCenterFlatHeaders=fn((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getRightFlatHeaders=fn((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getCenterLeafHeaders=fn((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getLeftLeafHeaders=fn((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getRightLeafHeaders=fn((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getLeafHeaders=fn((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var r,o,a,i,l,s;return[...null!=(r=null==(o=e[0])?void 0:o.headers)?r:[],...null!=(a=null==(i=t[0])?void 0:i.headers)?a:[],...null!=(l=null==(s=n[0])?void 0:s.headers)?l:[]].map((e=>e.getLeafHeaders())).flat()}),pn(e.options,dn))}};function hn(e,t,n,r){var o,a;let i=0;const l=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&l(e.columns,t+1)}),0)};l(e);let s=[];const c=(e,t)=>{const o={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},a=[];e.forEach((e=>{const i=[...a].reverse()[0];let l,s=!1;if(e.column.depth===o.depth&&e.column.parent?l=e.column.parent:(l=e.column,s=!0),i&&(null==i?void 0:i.column)===l)i.subHeaders.push(e);else{const o=mn(n,l,{id:[r,t,l.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${a.filter((e=>e.column===l)).length}`:void 0,depth:t,index:a.length});o.subHeaders.push(e),a.push(o)}o.headers.push(e),e.headerGroup=o})),s.push(o),t>0&&c(a,t-1)},u=t.map(((e,t)=>mn(n,e,{depth:i,index:t})));c(u,i-1),s.reverse();const f=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],f(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,r.push(o)}))):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return f(null!=(o=null==(a=s[0])?void 0:a.headers)?o:[]),s}const yn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},vn={getDefaultColumnDef:()=>yn,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:cn("columnSizing",e),onColumnSizingInfoChange:cn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const a=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:yn.minSize,null!=(r=null!=a?a:e.columnDef.size)?r:yn.size),null!=(o=e.columnDef.maxSize)?o:yn.maxSize)},e.getStart=fn((e=>[e,Qn(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),pn(t.options,"debugColumns")),e.getAfter=fn((e=>[e,Qn(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),pn(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...r}=t;return r}))},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var r;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(r=e.column.getSize())?r:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=null==r?void 0:r.getCanResize();return a=>{if(!r||!o)return;if(null==a.persist||a.persist(),bn(a)&&a.touches&&a.touches.length>1)return;const i=e.getSize(),l=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[r.id,r.getSize()]],s=bn(a)?Math.round(a.touches[0].clientX):a.clientX,c={},u=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var r,o;const a="rtl"===t.options.columnResizeDirection?-1:1,i=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*a,l=Math.max(i/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;c[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:i,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...c}))))},f=e=>u("move",e),p=e=>{u("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},d=n||"undefined"!=typeof document?document:null,m={moveHandler:e=>f(e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",m.moveHandler),null==d||d.removeEventListener("mouseup",m.upHandler),p(e.clientX)}},g={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",g.moveHandler),null==d||d.removeEventListener("touchend",g.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),p(null==(t=e.touches[0])?void 0:t.clientX)}},h=!!function(){if("boolean"==typeof wn)return wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return wn=e,wn}()&&{passive:!1};bn(a)?(null==d||d.addEventListener("touchmove",g.moveHandler,h),null==d||d.addEventListener("touchend",g.upHandler,h)):(null==d||d.addEventListener("mousemove",m.moveHandler,h),null==d||d.addEventListener("mouseup",m.upHandler,h)),t.setColumnSizingInfo((e=>({...e,startOffset:s,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let wn=null;function bn(e){return"touchstart"===e.type}const En={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:cn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((r=>{var o;const a=!0===r||!(null==r||!r[e.id]);let i={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=r,n=null!=(o=n)?o:!a,!a&&n)return{...i,[e.id]:!0};if(a&&!n){const{[e.id]:t,...n}=i;return n}return r}))},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(r=t.options.enableExpanding)||r)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},xn=(e,t,n)=>{var r;const o=n.toLowerCase();return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};xn.autoRemove=e=>In(e);const Sn=(e,t,n)=>{var r;return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};Sn.autoRemove=e=>In(e);const On=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};On.autoRemove=e=>In(e);const Cn=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};Cn.autoRemove=e=>In(e)||!(null!=e&&e.length);const kn=(e,t,n)=>!n.some((n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))}));kn.autoRemove=e=>In(e)||!(null!=e&&e.length);const Pn=(e,t,n)=>n.some((n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)}));Pn.autoRemove=e=>In(e)||!(null!=e&&e.length);const jn=(e,t,n)=>e.getValue(t)===n;jn.autoRemove=e=>In(e);const Rn=(e,t,n)=>e.getValue(t)==n;Rn.autoRemove=e=>In(e);const Nn=(e,t,n)=>{let[r,o]=n;const a=e.getValue(t);return a>=r&&a<=o};Nn.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,a=null===t||Number.isNaN(r)?-1/0:r,i=null===n||Number.isNaN(o)?1/0:o;if(a>i){const e=a;a=i,i=e}return[a,i]},Nn.autoRemove=e=>In(e)||In(e[0])&&In(e[1]);const Ln={includesString:xn,includesStringSensitive:Sn,equalsString:On,arrIncludes:Cn,arrIncludesAll:kn,arrIncludesSome:Pn,equals:jn,weakEquals:Rn,inNumberRange:Nn};function In(e){return null==e||""===e}const Fn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:cn("columnFilters",e),onGlobalFilterChange:cn("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?Ln.includesString:"number"==typeof r?Ln.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?Ln.equals:Array.isArray(r)?Ln.arrIncludes:Ln.weakEquals},e.getFilterFn=()=>{var n,r;return un(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:Ln[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,a;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(o=t.options.enableFilters)||o)&&(null==(a=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||a)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find((t=>t.id===e.id)))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const r=e.getFilterFn(),o=null==t?void 0:t.find((t=>t.id===e.id)),a=sn(n,o?o.value:void 0);var i;if(Mn(r,a,e))return null!=(i=null==t?void 0:t.filter((t=>t.id!==e.id)))?i:[];const l={id:e.id,value:a};var s;return o?null!=(s=null==t?void 0:t.map((t=>t.id===e.id?l:t)))?s:[]:null!=t&&t.length?[...t,l]:[l]}))},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ln.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return un(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:Ln[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var r;return null==(r=sn(t,e))?void 0:r.filter((e=>{const t=n.find((t=>t.id===e.id));return!t||!Mn(t.getFilterFn(),e.value,t)}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function Mn(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const An={sum:(e,t,n)=>n.reduce(((t,n)=>{const r=n.getValue(e);return t+("number"==typeof r?r:0)}),0),min:(e,t,n)=>{let r;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)})),r},max:(e,t,n)=>{let r;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)})),r},extent:(e,t,n)=>{let r,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=o=n):(r>n&&(r=n),o<n&&(o=n)))})),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,r+=o)})),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}(n))return;if(1===n.length)return n[0];const r=Math.floor(n.length/2),o=n.sort(((e,t)=>e-t));return n.length%2!=0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},Tn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:cn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,r,o,a;return null!=(n=null==(r=null!=(o=null==(a=e.columnDef.enableGrouping)||a)?o:t.options.enableGrouping)||r)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?An.sum:"[object Date]"===Object.prototype.toString.call(r)?An.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return un(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:An[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},Dn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:cn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=fn((e=>[Qn(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),pn(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return(null==(r=Qn(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Qn(t,n);return(null==(r=o[o.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=fn((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>r=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...r];for(;n.length&&t.length;){const e=t.shift(),r=n.findIndex((t=>t.id===e));r>-1&&o.push(n.splice(r,1)[0])}o=[...o,...n]}else o=r;return function(e,t,n){if(null==t||!t.length||!n)return e;const r=e.filter((e=>!t.includes(e.id)));if("remove"===n)return r;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...r]}(o,t,n)}),pn(e.options,"debugTable"))}},Vn={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:cn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>sn(t,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((n=>{let r=sn(t,n.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...n,pageIndex:r}}))},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,sn(t,e.pageSize)),r=e.pageSize*e.pageIndex,o=Math.floor(r/n);return{...e,pageIndex:o,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var r;let o=sn(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}})),e.getPageOptions=fn((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),pn(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},Gn={getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:cn("columnPinning",e),onRowPinningChange:cn("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,a,i,l,s;return"right"===n?{left:(null!=(a=null==e?void 0:e.left)?a:[]).filter((e=>!(null!=r&&r.includes(e)))),right:[...(null!=(i=null==e?void 0:e.right)?i:[]).filter((e=>!(null!=r&&r.includes(e)))),...r]}:"left"===n?{left:[...(null!=(l=null==e?void 0:e.left)?l:[]).filter((e=>!(null!=r&&r.includes(e)))),...r],right:(null!=(s=null==e?void 0:e.right)?s:[]).filter((e=>!(null!=r&&r.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=r&&r.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=r&&r.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,r,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||r)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:r,right:o}=t.getState().columnPinning,a=n.some((e=>null==r?void 0:r.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return a?"left":!!i&&"right"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[o])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const a=r?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],i=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],l=new Set([...i,e.id,...a]);t.setRowPinning((e=>{var t,r,o,a,i,s;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=l&&l.has(e)))),bottom:[...(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=l&&l.has(e)))),...Array.from(l)]}:"top"===n?{top:[...(null!=(i=null==e?void 0:e.top)?i:[]).filter((e=>!(null!=l&&l.has(e)))),...Array.from(l)],bottom:(null!=(s=null==e?void 0:e.bottom)?s:[]).filter((e=>!(null!=l&&l.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=l&&l.has(e)))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter((e=>!(null!=l&&l.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,a=n.some((e=>null==r?void 0:r.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return a?"top":!!i&&"bottom"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const a=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(r=null==a?void 0:a.indexOf(e.id))?r:-1},e.getCenterVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!r.includes(e.column.id)))}),pn(t.options,"debugRows")),e.getLeftVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>{const n=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})));return n}),pn(t.options,"debugRows")),e.getRightVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>{const n=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})));return n}),pn(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;var o,a;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.left)?void 0:o.length)||(null==(a=r.right)?void 0:a.length))},e.getLeftLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),pn(e.options,"debugColumns")),e.getRightLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),pn(e.options,"debugColumns")),e.getCenterLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!r.includes(e.id)))}),pn(e.options,"debugColumns")),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;var o,a;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.top)?void 0:o.length)||(null==(a=r.bottom)?void 0:a.length))},e._getPinnedRows=fn((t=>[e.getRowModel().rows,e.getState().rowPinning[t],t]),((t,n,r)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:r})))}),pn(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=fn((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!r.has(e.id)))}),pn(e.options,"debugRows"))}},zn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:cn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(r[e.id]=!0)})):o.forEach((e=>{delete r[e.id]})),r}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const r=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{Bn(o,t.id,r,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getFilteredSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getGroupedSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=Boolean(t.length&&Object.keys(n).length);return r&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some((e=>!n[e.id]))&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection((a=>{var i;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return a;const l={...a};return Bn(l,e.id,n,null==(i=null==r?void 0:r.selectChildren)||i,t),l}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qn(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Un(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Un(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},Bn=(e,t,n,r,o)=>{var a;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(a=i.subRows)&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>Bn(e,t.id,n,r,o)))};function Hn(e,t){const n=e.getState().rowSelection,r=[],o={},a=function(e,t){return e.map((e=>{var t;const i=qn(e,n);if(i&&(r.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:a(e.subRows)}),i)return e})).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:o}}function qn(e,t){var n;return null!=(n=t[e.id])&&n}function Un(e,t,n){var r;if(null==(r=e.subRows)||!r.length)return!1;let o=!0,a=!1;return e.subRows.forEach((e=>{if((!a||o)&&(e.getCanSelect()&&(qn(e,t)?a=!0:o=!1),e.subRows&&e.subRows.length)){const n=Un(e,t);"all"===n?a=!0:"some"===n?(a=!0,o=!1):o=!1}})),o?"all":!!a&&"some"}const $n=/([0-9]+)/gm;function Wn(e,t){return e===t?0:e>t?1:-1}function Zn(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Yn(e,t){const n=e.split($n).filter(Boolean),r=t.split($n).filter(Boolean);for(;n.length&&r.length;){const e=n.shift(),t=r.shift(),o=parseInt(e,10),a=parseInt(t,10),i=[o,a].sort();if(isNaN(i[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(i[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}}return n.length-r.length}const Kn={alphanumeric:(e,t,n)=>Yn(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Yn(Zn(e.getValue(n)),Zn(t.getValue(n))),text:(e,t,n)=>Wn(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>Wn(Zn(e.getValue(n)),Zn(t.getValue(n))),datetime:(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},basic:(e,t,n)=>Wn(e.getValue(n),t.getValue(n))},Xn={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:cn("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return Kn.datetime;if("string"==typeof n&&(r=!0,n.split($n).length>1))return Kn.alphanumeric}return r?Kn.text:Kn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return un(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:Kn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),a=null!=n;t.setSorting((i=>{const l=null==i?void 0:i.find((t=>t.id===e.id)),s=null==i?void 0:i.findIndex((t=>t.id===e.id));let c,u=[],f=a?n:"desc"===o;var p;return c=null!=i&&i.length&&e.getCanMultiSort()&&r?l?"toggle":"add":null!=i&&i.length&&s!==i.length-1?"replace":l?"toggle":"replace","toggle"===c&&(a||o||(c="remove")),"add"===c?(u=[...i,{id:e.id,desc:f}],u.splice(0,u.length-(null!=(p=t.options.maxMultiSortColCount)?p:Number.MAX_SAFE_INTEGER))):u="toggle"===c?i.map((t=>t.id===e.id?{...t,desc:f}:t)):"remove"===c?i.filter((t=>t.id!==e.id)):[{id:e.id,desc:f}],u}))},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?!!(i===a||null!=(r=t.options.enableSortingRemoval)&&!r||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===i?"asc":"desc"):a},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Jn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:cn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,r;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=fn((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),pn(t.options,"debugRows")),e.getVisibleCells=fn((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),pn(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>fn((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),pn(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function Qn(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const er=[gn,Jn,Dn,Gn,Fn,Xn,Tn,En,Vn,zn,vn];function tr(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:er};const r=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let o={...null!=(t=e.initialState)?t:{}};n._features.forEach((e=>{var t;o=null!=(t=null==e.getInitialState?void 0:e.getInitialState(o))?t:o}));const a=[];let i=!1;const l={_features:er,options:{...r,...e},initialState:o,_queue:e=>{a.push(e),i||(i=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();i=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const t=sn(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e})(t)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,r)=>{var o;return null!=(o=null==n.options.getRowId?void 0:n.options.getRowId(e,t,r))?o:`${r?[r.id,t].join("."):t}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw new Error;return r},_getDefaultColumnDef:fn((()=>[n.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),pn(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:fn((()=>[n._getColumnDefs()]),(e=>{const t=function(e,r,o){return void 0===o&&(o=0),e.map((e=>{const a=function(e,t,n,r){var o,a;const i={...e._getDefaultColumnDef(),...t},l=i.accessorKey;let s,c=null!=(o=null!=(a=i.id)?a:l?l.replace(".","_"):void 0)?o:"string"==typeof i.header?i.header:void 0;if(i.accessorFn?s=i.accessorFn:l&&(s=l.includes(".")?e=>{let t=e;for(const e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[i.accessorKey]),!c)throw new Error;let u={id:`${String(c)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:fn((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),pn(e.options,"debugColumns")),getLeafColumns:fn((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),pn(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(u,e);return u}(n,e,o,r),i=e;return a.columns=i.columns?t(i.columns,a,o+1):[],a}))};return t(e)}),pn(e,"debugColumns")),getAllFlatColumns:fn((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),pn(e,"debugColumns")),_getAllFlatColumnsById:fn((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),pn(e,"debugColumns")),getAllLeafColumns:fn((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),pn(e,"debugColumns")),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,l);for(let e=0;e<n._features.length;e++){const t=n._features[e];null==t||null==t.createTable||t.createTable(n)}return n}const nr=(e,t,n,r,o,a,i)=>{let l={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(l._valuesCache.hasOwnProperty(t))return l._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(l._valuesCache[t]=n.accessorFn(l.original,r),l._valuesCache[t]):void 0},getUniqueValues:t=>{if(l._uniqueValuesCache.hasOwnProperty(t))return l._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(l._uniqueValuesCache[t]=n.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[t]):(l._uniqueValuesCache[t]=[l.getValue(t)],l._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=l.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=a?a:[],getLeafRows:()=>function(e,t){const n=[],r=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&r(o)}))};return r(e),n}(l.subRows,(e=>e.subRows)),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let e=[],t=l;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:fn((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,r){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:fn((()=>[e,n,t,o]),((e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue})),pn(e.options,"debugCells"))};return e._features.forEach((r=>{null==r.createCell||r.createCell(o,n,t,e)}),{}),o}(e,l,t,t.id)))),pn(e.options,"debugRows")),_getAllCellsByColumnId:fn((()=>[l.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),pn(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(l,e)}return l};function rr(e){const t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function or(e,n){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(r=e)||"function"==typeof r||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?t.createElement(e,n):e:null;var r}const ar=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))})),ir=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 7.5h-.75A2.25 2.25 0 0 0 4.5 9.75v7.5a2.25 2.25 0 0 0 2.25 2.25h7.5a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75m-6 3.75 3 3m0 0 3-3m-3 3V1.5m6 9h.75a2.25 2.25 0 0 1 2.25 2.25v7.5a2.25 2.25 0 0 1-2.25 2.25h-7.5a2.25 2.25 0 0 1-2.25-2.25v-.75"}))}));var lr=["value","onChange","debounce"];function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sr.apply(this,arguments)}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ur(t){var n=t.value,r=t.onChange,o=t.debounce,a=void 0===o?500:o,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,lr),l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(n),2),s=l[0],c=l[1];return(0,e.useEffect)((function(){c(n)}),[n]),(0,e.useEffect)((function(){var e=setTimeout((function(){r(s)}),a);return function(){return clearTimeout(e)}}),[s]),wp.element.createElement("input",sr({},i,{value:s,onChange:function(e){return c(e.target.value)}}))}const fr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))})),pr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))})),dr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))})),mr=function(e){var t=e.table;return wp.element.createElement("thead",{className:"border-b border-gray-900/10 text-sm leading-6 text-gray-900"},t.getHeaderGroups().map((function(e){return wp.element.createElement("tr",{key:e.id},e.headers.map((function(e,t){return wp.element.createElement("th",{onClick:e.column.getToggleSortingHandler(),key:e.id,colSpan:e.colSpan,className:"py-2 font-bold select-none",style:{width:0==t?"50px":"auto",cursor:e.column.getCanSort()?"pointer":"default"}},e.isPlaceholder?null:wp.element.createElement("div",{className:"flex items-end leading-none capitalize"},or(e.column.columnDef.header,e.getContext()),wp.element.createElement("span",null,e.column.getIsSorted()?"desc"===e.column.getIsSorted()?wp.element.createElement(fr,{className:"w-3 h-3"}):wp.element.createElement(pr,{className:"w-3 h-3"}):e.column.getCanSort()?wp.element.createElement(dr,{className:"w-3 h-3"}):"")))})))})))};function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}const hr=function(e){var t=e.row,n=e.toggleExpanded,r="variation"===t.original.type,o=t.getIsExpanded(),a=gr(r?"bg-sky-50":"","py-4 wrap");return wp.element.createElement("tr",{key:t.id,className:gr(a,o?"bg-sky-300":"")},t.getVisibleCells().map((function(e,r){return wp.element.createElement("td",{key:e.id,onClick:function(){"select"!==e.column.id&&"actions"!==e.column.id&&n()},className:"py-4 wrap text-gray-600 ".concat(r===t.getVisibleCells().length-1?"text-right":"text-left"," ").concat(t.getCanExpand()&&"cursor-pointer"," ")},or(e.column.columnDef.cell,e.getContext()))})))};function yr(e){return yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(e)}var vr=["indeterminate","className"];function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}function Er(t){var n=t.indeterminate,r=t.className,o=void 0===r?"":r,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,vr),i=(0,e.useRef)(null);return(0,e.useEffect)((function(){"boolean"==typeof n&&(i.current.indeterminate=!a.checked&&n)}),[i,n]),wp.element.createElement("input",br({type:"checkbox",ref:i,className:o+" cursor-pointer"},a))}const xr=function(e){var t=e.table,n=e.selectablePageRows,r=e.rowSelection,o=e.setRowSelection;return wp.element.createElement("div",{className:"flex justify-between items-center sm:px-6 lg:px-8"},wp.element.createElement("div",{className:"flex items-center gap-2 "},wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.setPageIndex(0)},disabled:!t.getCanPreviousPage()},"<<"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.previousPage()},disabled:!t.getCanPreviousPage()},"<"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.nextPage()},disabled:!t.getCanNextPage()},">"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.setPageIndex(t.getPageCount()-1)},disabled:!t.getCanNextPage()},">>"),wp.element.createElement("span",{className:"flex items-center gap-1"},wp.element.createElement("div",null,"Page"),wp.element.createElement("strong",null,t.getState().pagination.pageIndex+1," of"," ",t.getPageCount())),wp.element.createElement("span",{className:"flex items-center gap-1"},"| Go to page:",wp.element.createElement("input",{type:"number",defaultValue:t.getState().pagination.pageIndex+1,onChange:function(e){var n=e.target.value?Number(e.target.value)-1:0;t.setPageIndex(n)},className:"border p-1 rounded w-16"})),wp.element.createElement("select",{value:t.getState().pagination.pageSize,onChange:function(e){t.setPageSize(Number(e.target.value))}},[10,20,30,40,50].map((function(e){return wp.element.createElement("option",{key:e,value:e},"Show ",e)})))),wp.element.createElement("div",{className:"flex justify-center items-center pr-2 gap-2 py-4"},"Select Page (",t.getRowModel().rows.filter((function(e){return!e.getCanExpand()})).length,")",wp.element.createElement(Er,{checked:n.every((function(e){return r[e]})),indeterminate:n.some((function(e){return r[e]}))&&!n.every((function(e){return r[e]})),onChange:function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=yr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==yr(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r);e.target.checked?n.forEach((function(e){t[e]=!0})):t={},o(t)}})))},Sr=function(t){var n=t.children,r=t.open,o=(t.onClose,t.className),a=t.backdrop,i=void 0===a||a,l=(0,e.useRef)(null);return r?wp.element.createElement("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-start p-4 z-50",style:{marginLeft:"160px"}},i&&wp.element.createElement("div",{className:"absolute top-0 left-0 right-0 bottom-0 bg-black/30","aria-hidden":"true"}),wp.element.createElement("div",{ref:l,tabIndex:-1,className:gr("flex justify-center z-50 mx-auto",o),onClick:function(e){return e.stopPropagation()}},n)):null},Or=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 9-3 3m0 0 3 3m-3-3h7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})),Cr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m12.75 15 3-3m0 0-3-3m3 3h-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}));var kr=function(e){e.productsToImport;var t=e.rangeValue,n=e.dataToImport,r=e.handleStepChange,o=e.importProduct,a=e.importCount;return wp.element.createElement("div",null,wp.element.createElement("h4",{className:"text-base mb-4"},"Review"),wp.element.createElement("p",null,"You are about to import"," ",wp.element.createElement("span",{className:"font-semibold"},a)," products in batches of"," ",wp.element.createElement("span",{className:"font-semibold"},t),". Existing products will have their data updated, while new entries will be created for products not already in the system."),wp.element.createElement("div",{className:"mt-2"},wp.element.createElement("p",null,"You have chosen to import/sync the following:"),wp.element.createElement("ul",{className:"flex gap-2 mt-2 flex-wrap"},Object.keys(n).map((function(e,t){if(n[e])return wp.element.createElement("li",{key:n[e]+t,className:"p-2 border border-gray-300 uppercase text-xs font-semibold"},e)})))),wp.element.createElement("div",{className:"flex items-center mt-10 justify-end gap-2"},wp.element.createElement("button",{type:"button",onClick:function(){return r("backward")},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(Or,{className:"mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Go back")),wp.element.createElement("button",{type:"button",onClick:function(){r("forward"),o()},className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"IMPORT"),wp.element.createElement(Cr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"}))))};const Pr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}));var jr=function(t){var n=t.progress,r=t.importCount,o=t.isImporting,a=t.setIsDialogOpen,i=t.setCurrentStep,l=(0,e.useRef)(null);return(0,e.useEffect)((function(){l.current&&(l.current.scrollTop=l.current.scrollHeight)}),[n]),wp.element.createElement("div",null,wp.element.createElement("div",null,wp.element.createElement("div",{className:""},wp.element.createElement("div",{className:"h-4 bg-gray-200 w-full rounded-lg mt-2"},wp.element.createElement("div",{className:"h-full bg-blue-500 rounded-lg",style:{width:"".concat(n.filter((function(e){return"string"!=typeof e})).length/r*100,"%")}})),wp.element.createElement("div",{className:"text-sm text-gray-500 mt-1"},"Imported"," ",n.filter((function(e){return"string"!=typeof e&&"success"===e.status})).length," ","of ",r," products."," ",Number(n.filter((function(e){return"string"!=typeof e})).length/r*100).toFixed(1),"%")),wp.element.createElement("div",{ref:l,className:"bg-slate-950 p-4 rounded-xl max-h-52 overflow-y-auto overflow-x-hidden w-full flex flex-col gap-2 mt-2"},n.map((function(e,t){return wp.element.createElement("p",{className:"break-words ".concat(e.status&&"success"===e.status?"text-green-500":e.status&&"failed"===e.status?"text-red-500":"text-blue-500"),key:e.square_id||e},JSON.stringify(e))}))),!o&&wp.element.createElement("div",{className:"flex flex-col items-center justify-center gap-2 py-4"},wp.element.createElement(qt,{className:"w-12 h-12 text-green-500"}),wp.element.createElement("h3",{className:"text-xl text-green-500 font-semibold"},"Import complete!"),wp.element.createElement("p",{className:"font-semibold"},"You can now safely close this window."))),!o&&wp.element.createElement("div",{className:"flex items-center justify-end gap-2 mt-6"},wp.element.createElement("button",{type:"button",onClick:function(){a(!1),i(0)},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(Pr,{className:"mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Close"))))};function Rr(e){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rr(e)}function Nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Rr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Rr(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lr=function(e){var t=e.dataToImport,n=e.setDataToImport,r=e.rangeValue,o=e.handleRangeChange,a=e.handleStepChange,i=e.setCurrentStep,l=e.setIsDialogOpen;return wp.element.createElement("div",null,wp.element.createElement("h4",{className:"text-base mb-4"},"Select the data you wish to import / sync:"),wp.element.createElement("fieldset",{className:"mb-3"},wp.element.createElement("legend",{className:"sr-only"},"data to sync"),wp.element.createElement("div",{className:"flex gap-x-6 gap-y-4 items-start flex-wrap"},wp.element.createElement("label",{htmlFor:"title",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",required:!0,checked:t.title,disabled:!0,id:"title",className:"h-full !m-0"}),"Title"),wp.element.createElement("label",{htmlFor:"SKU",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",checked:t.sku,id:"SKU",className:"h-full !m-0",onChange:function(){return n(_r(_r({},t),{},{sku:!t.sku}))}}),"SKU"),wp.element.createElement("label",{htmlFor:"price",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"price",className:"h-full !m-0",checked:t.price,onChange:function(){return n(_r(_r({},t),{},{price:!t.price}))}}),"Price"),wp.element.createElement("label",{htmlFor:"stock",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"stock",className:"h-full !m-0",checked:t.stock,onChange:function(){return n(_r(_r({},t),{},{stock:!t.stock}))}}),"Stock"),wp.element.createElement("label",{htmlFor:"description",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"description",checked:t.description,onChange:function(){return n(_r(_r({},t),{},{description:!t.description}))},className:"h-full !m-0"}),"Description"),wp.element.createElement("label",{htmlFor:"image",className:"flex items-center gap-1 leading-none relative"},wp.element.createElement("input",{type:"checkbox",id:"image",className:"h-full !m-0",checked:!1,disabled:!0}),"Image",wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO")),wp.element.createElement("label",{htmlFor:"categories",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"categories",className:"h-full !m-0",checked:!1,disabled:!0}),"Categories"," ",wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO")))),wp.element.createElement("p",null,"Existing products will have their data updated, while new entries will be created for products not already in the system."),wp.element.createElement("h4",{className:"text-base mt-4 mb-2"},"How many products to import in each batch?"),wp.element.createElement("p",null,"Raising the batch size puts more strain on the server, particularly during image imports. Should errors arise, you might want to lower this number to enhance stability or turn off image importing."),wp.element.createElement("div",{className:"relative mb-6 mt-3"},wp.element.createElement("label",{htmlFor:"labels-range-input",className:"sr-only"},"Labels range"),wp.element.createElement("input",{id:"labels-range-input",type:"range",value:r,onChange:o,step:5,min:"5",max:"50",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"}),wp.element.createElement("span",{className:"text-sm text-gray-500 absolute start-0 -bottom-6"},"Min 5"),wp.element.createElement("span",{className:"text-sm text-gray-600 font-semibold absolute start-1/2 -translate-x-1/2 -bottom-6"},r),wp.element.createElement("span",{className:"text-sm text-gray-500 absolute end-0 -bottom-6"},"Max 50")),wp.element.createElement("div",{className:"flex items-center mt-10 justify-end gap-2"},wp.element.createElement("button",{type:"button",onClick:function(){i(0),l(!1)},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"Cancel"),wp.element.createElement(Pr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"})),wp.element.createElement("button",{type:"button",onClick:function(){return a("forward")},className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"Continue"),wp.element.createElement(Cr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"}))))},Ir=function(e){var t=e.currentStep,n=e.rangeValue,r=e.dataToImport,o=e.handleStepChange,a=e.setCurrentStep,i=e.handleRangeChange,l=e.setDataToImport,s=e.importProduct,c=e.importCount,u=e.productsToImport,f=e.isImporting,p=e.setIsDialogOpen,d=e.progress;switch(t){case 0:return wp.element.createElement(Lr,{dataToImport:r,setDataToImport:l,rangeValue:n,handleRangeChange:i,handleStepChange:o,setCurrentStep:a,setIsDialogOpen:p});case 1:return wp.element.createElement(kr,{progress:d,dataToImport:r,importProduct:s,importCount:c,handleStepChange:o,setCurrentStep:a,productsToImport:u,isImporting:f,rangeValue:n,setIsDialogOpen:p});case 2:return wp.element.createElement(jr,{progress:d,importCount:c,handleStepChange:o,setCurrentStep:a,isImporting:f,setIsDialogOpen:p});default:return wp.element.createElement("div",null,"Invalid step")}};function Fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Mr=function(t){var n=t.isDialogOpen,r=t.setIsDialogOpen,o=t.progress,a=t.rangeValue,i=t.setRangeValue,l=t.setDataToImport,s=t.dataToImport,c=t.importProduct,u=t.productsToImport,f=t.importCount,p=t.isImporting,d=[{name:"Step 1",href:"#",status:"current"},{name:"Step 2",href:"#",status:"upcoming"},{name:"Step 3",href:"#",status:"upcoming"}],m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(0),2),g=m[0],h=m[1];return wp.element.createElement(Sr,{open:n,onClose:function(){return r(!1)},className:"w-[40vw] max-w-[40vw] mx-auto bg-white p-6 rounded-xl"},wp.element.createElement("div",{className:"w-full"},wp.element.createElement("header",{className:"flex justify-between items-center gap-2 mb-4"},wp.element.createElement("h3",{className:"text-lg font-medium leading-6 text-gray-900"},"Import from Square"),wp.element.createElement("nav",{className:"flex items-center justify-center","aria-label":"Progress"},wp.element.createElement("p",{className:"text-sm font-medium"},"Step ",g+1," of ",d.length),wp.element.createElement("ol",{role:"list",className:"ml-8 flex items-center space-x-5"},d.map((function(e,t){return wp.element.createElement("li",{key:e.name},"complete"===e.status?wp.element.createElement("span",{className:"block h-2.5 w-2.5 rounded-full bg-sky-600 hover:bg-sky-900"},wp.element.createElement("span",{className:"sr-only"},e.name)):g===t?wp.element.createElement("span",{className:"relative flex items-center justify-center","aria-current":"step"},wp.element.createElement("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true"},wp.element.createElement("span",{className:"h-full w-full rounded-full bg-sky-200"})),wp.element.createElement("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-sky-600","aria-hidden":"true"}),wp.element.createElement("span",{className:"sr-only"},e.name)):wp.element.createElement("span",{className:"block h-2.5 w-2.5 rounded-full bg-gray-200 hover:bg-gray-400"},wp.element.createElement("span",{className:"sr-only"},e.name)))}))))),wp.element.createElement(Ir,{currentStep:g,rangeValue:a,dataToImport:s,handleStepChange:function(e){h((function(t){return"forward"===e&&t<d.length-1?t+1:"backward"===e&&t>0?t-1:t}))},setCurrentStep:h,handleRangeChange:function(e){i(Number(e.target.value))},importCount:f,productsToImport:u,setDataToImport:l,importProduct:c,isImporting:p,setIsDialogOpen:r,progress:o}),p&&wp.element.createElement("p",{className:"text-red-500 font-semibold text-center mt-2"},"Do not close this window, import will be cancelled")))};function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tr=(0,e.createContext)({blockNavigation:!1,setBlockNavigation:function(){}}),Dr=function(t){var n=t.children,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),o=r[0],a=r[1];return wp.element.createElement(Tr.Provider,{value:{blockNavigation:o,setBlockNavigation:a}},n)};function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zr(e){return function(e){if(Array.isArray(e))return Br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Br(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hr=function(e){var t=e.isExpanded;return e.row.getCanExpand()?wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 ".concat(t?"rotate-90":"")},wp.element.createElement("polyline",{points:"9 18 15 12 9 6"})):wp.element.createElement(React.Fragment,null)},qr=function(){return wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-300"},wp.element.createElement("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),wp.element.createElement("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"}))},Ur=function(e){var t={false:{bgColor:"bg-red-100",textColor:"text-red-700",fillColor:"fill-red-500",text:"Not imported"},partial:{bgColor:"bg-yellow-100",textColor:"text-yellow-700",fillColor:"fill-yellow-500",text:"Partial"},true:{bgColor:"bg-green-100",textColor:"text-green-700",fillColor:"fill-green-500",text:"Imported"}},n=t[e.status]||t.false,r=n.bgColor,o=n.textColor,a=n.fillColor,i=n.text;return wp.element.createElement("span",{className:"inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ".concat(r," ").concat(o)},wp.element.createElement("svg",{className:"h-1.5 w-1.5 ".concat(a),viewBox:"0 0 6 6","aria-hidden":"true"},wp.element.createElement("circle",{cx:"3",cy:"3",r:"3"})),i)},$r=function(e){var t=e.value;return wp.element.createElement("div",{className:"group relative w-10 h-10"},t.map((function(e,n){return wp.element.createElement("img",{key:n,src:e,alt:"",width:40,height:40,className:gr("w-10 h-10 rounded object-cover flex items-center gap-2 shadow top-0 absolute transition-transform duration-300",0===n&&t.length>1&&"group-hover:-translate-y-2 rotate-12 group-hover:rotate-[-16deg]",1===n&&t.length>1&&"group-hover:translate-y-2 group-hover:rotate-[16deg]")})})))},Wr=["indeterminate","className"];function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}const Yr=function(e){var n=e.indeterminate,r=e.className,o=void 0===r?"":r,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Wr),i=(0,t.useRef)(null);return(0,t.useEffect)((function(){"boolean"==typeof n&&(i.current.indeterminate=!a.checked&&n)}),[n,a.checked]),wp.element.createElement("input",Zr({type:"checkbox",ref:i,className:o+" cursor-pointer"},a))};var Kr=function(e,t,n){var r=!!e.getValue(t)&&e.getValue(t).toString().toLowerCase().includes(n.toLowerCase()),o=e.subRows&&e.subRows.some((function(e){var r=e.getValue(t);return!!r&&r.toString().toLowerCase().includes(n.toLowerCase())}));return r||o};function Xr(e){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xr(e)}function Jr(e,t,n){return t=function(e){var t=function(e,t){if("object"!=Xr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Xr(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qr(e){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qr(e)}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Qr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Qr(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function no(){no=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Qr(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Qr(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function ro(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ro(a,r,o,i,l,"next",e)}function l(e){ro(a,r,o,i,l,"throw",e)}i(void 0)}))}}function ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var io=function(e,t){return e.reduce((function(n,r,o){return o%t?n:[].concat(function(e){if(Array.isArray(e))return ao(e)}(a=n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.slice(o,o+t)]);var a}),[])};function lo(_x,e,t,n){return so.apply(this,arguments)}function so(){return so=oo(no().mark((function e(t,n,r,o){var a;return no().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.find((function(e){return e.id===t.id}))){e.next=3;break}return e.abrupt("return",{error:"Product ".concat(t.id," not found in inventory")});case 3:return e.prev=3,e.next=6,zt()({path:"/sws/v1/square-inventory/import",signal:null==r?void 0:r.signal,method:"POST",data:{product:[a],datatoimport:o}});case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("return",{error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[3,9]])}))),so.apply(this,arguments)}var co=function(){var e=oo(no().mark((function e(t){return no().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zt()({path:"/sws/v1/logs",method:"POST",data:{log:t}});case 3:return e.abrupt("return",e.sent);case 6:e.prev=6,e.t0=e.catch(0),console.error("Error logging to backend:",e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),uo=function(e,t){return t.map((function(t){var n=e.find((function(e){return e.square_id===t.id})),r=!(!n||"success"!==n.status);return to(to({},t),{},{woocommerce_product_id:(null==n?void 0:n.product_id)||t.woocommerce_product_id,imported:n?r:t.imported,status:n?r:t.status,item_data:to(to({},t.item_data),{},{variations:t.item_data.variations.map((function(e){return to(to({},e),{},{imported:n?r:t.imported,status:n?r:t.status})}))})})}))};function fo(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function po(e){return!!e&&!!e[Qo]}function mo(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ea}(e)||Array.isArray(e)||!!e[Jo]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Jo])||bo(e)||Eo(e))}function go(e,t,n){void 0===n&&(n=!1),0===ho(e)?(n?Object.keys:ta)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function ho(e){var t=e[Qo];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:bo(e)?2:Eo(e)?3:0}function yo(e,t){return 2===ho(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vo(e,t,n){var r=ho(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function wo(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function bo(e){return Zo&&e instanceof Map}function Eo(e){return Yo&&e instanceof Set}function xo(e){return e.o||e.t}function So(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=na(e);delete t[Qo];for(var n=ta(t),r=0;r<n.length;r++){var o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Oo(e,t){return void 0===t&&(t=!1),ko(e)||po(e)||!mo(e)||(ho(e)>1&&(e.set=e.add=e.clear=e.delete=Co),Object.freeze(e),t&&go(e,(function(e,t){return Oo(t,!0)}),!0)),e}function Co(){fo(2)}function ko(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Po(e){var t=ra[e];return t||fo(18,e),t}function jo(){return $o}function Ro(e,t){t&&(Po("Patches"),e.u=[],e.s=[],e.v=t)}function No(e){_o(e),e.p.forEach(Io),e.p=null}function _o(e){e===$o&&($o=e.l)}function Lo(e){return $o={p:[],l:$o,h:e,m:!0,_:0}}function Io(e){var t=e[Qo];0===t.i||1===t.i?t.j():t.g=!0}function Fo(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||Po("ES5").S(t,e,r),r?(n[Qo].P&&(No(t),fo(4)),mo(e)&&(e=Mo(t,e),t.l||To(t,e)),t.u&&Po("Patches").M(n[Qo].t,e,t.u,t.s)):e=Mo(t,n,[]),No(t),t.u&&t.v(t.u,t.s),e!==Xo?e:void 0}function Mo(e,t,n){if(ko(t))return t;var r=t[Qo];if(!r)return go(t,(function(o,a){return Ao(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return To(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=So(r.k):r.o,a=o,i=!1;3===r.i&&(a=new Set(o),o.clear(),i=!0),go(a,(function(t,a){return Ao(e,r,o,t,a,n,i)})),To(e,o,!1),n&&e.u&&Po("Patches").N(r,n,e.u,e.s)}return r.o}function Ao(e,t,n,r,o,a,i){if(po(o)){var l=Mo(e,o,a&&t&&3!==t.i&&!yo(t.R,r)?a.concat(r):void 0);if(vo(n,r,l),!po(l))return;e.m=!1}else i&&n.add(o);if(mo(o)&&!ko(o)){if(!e.h.D&&e._<1)return;Mo(e,o),t&&t.A.l||To(e,o)}}function To(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&Oo(t,n)}function Do(e,t){var n=e[Qo];return(n?xo(n):e)[t]}function Vo(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Go(e){e.P||(e.P=!0,e.l&&Go(e.l))}function zo(e){e.o||(e.o=So(e.t))}function Bo(e,t,n){var r=bo(t)?Po("MapSet").F(t,n):Eo(t)?Po("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:jo(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=oa;n&&(o=[r],a=aa);var i=Proxy.revocable(o,a),l=i.revoke,s=i.proxy;return r.k=s,r.j=l,s}(t,n):Po("ES5").J(t,n);return(n?n.A:jo()).p.push(r),r}function Ho(e){return po(e)||fo(22,e),function e(t){if(!mo(t))return t;var n,r=t[Qo],o=ho(t);if(r){if(!r.P&&(r.i<4||!Po("ES5").K(r)))return r.t;r.I=!0,n=qo(t,o),r.I=!1}else n=qo(t,o);return go(n,(function(t,o){r&&function(e,t){return 2===ho(e)?e.get(t):e[t]}(r.t,t)===o||vo(n,t,e(o))})),3===o?new Set(n):n}(e)}function qo(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return So(e)}var Uo,$o,Wo="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Zo="undefined"!=typeof Map,Yo="undefined"!=typeof Set,Ko="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Xo=Wo?Symbol.for("immer-nothing"):((Uo={})["immer-nothing"]=!0,Uo),Jo=Wo?Symbol.for("immer-draftable"):"__$immer_draftable",Qo=Wo?Symbol.for("immer-state"):"__$immer_state",ea=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),ta="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,na=Object.getOwnPropertyDescriptors||function(e){var t={};return ta(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ra={},oa={get:function(e,t){if(t===Qo)return e;var n=xo(e);if(!yo(n,t))return function(e,t,n){var r,o=Vo(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!mo(r)?r:r===Do(e.t,t)?(zo(e),e.o[t]=Bo(e.A.h,r,e)):r},has:function(e,t){return t in xo(e)},ownKeys:function(e){return Reflect.ownKeys(xo(e))},set:function(e,t,n){var r=Vo(xo(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Do(xo(e),t),a=null==o?void 0:o[Qo];if(a&&a.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(wo(n,o)&&(void 0!==n||yo(e.t,t)))return!0;zo(e),Go(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==Do(e.t,t)||t in e.t?(e.R[t]=!1,zo(e),Go(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=xo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){fo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){fo(12)}},aa={};go(oa,(function(e,t){aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),aa.deleteProperty=function(e,t){return aa.set.call(this,e,t,void 0)},aa.set=function(e,t,n){return oa.set.call(this,e[0],t,n,e[0])};var ia=function(){function e(e){var t=this;this.O=Ko,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];return a.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&fo(6),void 0!==r&&"function"!=typeof r&&fo(7),mo(e)){var l=Lo(t),s=Bo(t,e,void 0),c=!0;try{i=n(s),c=!1}finally{c?No(l):_o(l)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return Ro(l,r),Fo(e,l)}),(function(e){throw No(l),e})):(Ro(l,r),Fo(i,l))}if(!e||"object"!=typeof e){if(void 0===(i=n(e))&&(i=e),i===Xo&&(i=void 0),t.D&&Oo(i,!0),r){var u=[],f=[];Po("Patches").M(e,i,u,f),r(u,f)}return i}fo(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,a=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,r,o]})):[a,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){mo(e)||fo(8),po(e)&&(e=Ho(e));var t=Lo(this),n=Bo(this,e,void 0);return n[Qo].C=!0,_o(t),n},t.finishDraft=function(e,t){var n=(e&&e[Qo]).A;return Ro(n,t),Fo(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Ko&&fo(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Po("Patches").$;return po(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),la=new ia,sa=la.produce;la.produceWithPatches.bind(la),la.setAutoFreeze.bind(la),la.setUseProxies.bind(la),la.applyPatches.bind(la),la.createDraft.bind(la),la.finishDraft.bind(la);const ca=sa;function ua(e){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ua(e)}function fa(e){var t=function(e,t){if("object"!=ua(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ua(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ua(t)?t:String(t)}function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function da(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pa(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=fa(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ma(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ga="function"==typeof Symbol&&Symbol.observable||"@@observable",ha=function(){return Math.random().toString(36).substring(7).split("").join(".")},ya={INIT:"@@redux/INIT"+ha(),REPLACE:"@@redux/REPLACE"+ha(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ha()}};function va(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ma(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ma(1));return n(va)(e,t)}if("function"!=typeof e)throw new Error(ma(2));var o=e,a=t,i=[],l=i,s=!1;function c(){l===i&&(l=i.slice())}function u(){if(s)throw new Error(ma(3));return a}function f(e){if("function"!=typeof e)throw new Error(ma(4));if(s)throw new Error(ma(5));var t=!0;return c(),l.push(e),function(){if(t){if(s)throw new Error(ma(6));t=!1,c();var n=l.indexOf(e);l.splice(n,1),i=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(ma(7));if(void 0===e.type)throw new Error(ma(8));if(s)throw new Error(ma(9));try{s=!0,a=o(a,e)}finally{s=!1}for(var t=i=l,n=0;n<t.length;n++)(0,t[n])();return e}return p({type:ya.INIT}),(r={dispatch:p,subscribe:f,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(ma(10));o=e,p({type:ya.REPLACE})}})[ga]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(ma(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[ga]=function(){return this},e},r}function wa(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var a,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:ya.INIT}))throw new Error(ma(12));if(void 0===n(void 0,{type:ya.PROBE_UNKNOWN_ACTION()}))throw new Error(ma(13))}))}(n)}catch(e){a=e}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var r=!1,o={},l=0;l<i.length;l++){var s=i[l],c=n[s],u=e[s],f=c(u,t);if(void 0===f)throw t&&t.type,new Error(ma(14));o[s]=f,r=r||f!==u}return(r=r||i.length!==Object.keys(e).length)?o:e}}function ba(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(ma(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map((function(e){return e(o)}));return r=ba.apply(void 0,a)(n.dispatch),da(da({},n),{},{dispatch:r})}}}function xa(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Sa=xa();Sa.withExtraArgument=xa;const Oa=Sa;var Ca,ka=(Ca=function(e,t){return Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ca(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}Ca(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),Pa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},ja=Object.defineProperty,Ra=Object.defineProperties,Na=Object.getOwnPropertyDescriptors,_a=Object.getOwnPropertySymbols,La=Object.prototype.hasOwnProperty,Ia=Object.prototype.propertyIsEnumerable,Fa=function(e,t,n){return t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ma=function(e,t){for(var n in t||(t={}))La.call(t,n)&&Fa(e,n,t[n]);if(_a)for(var r=0,o=_a(t);r<o.length;r++)n=o[r],Ia.call(t,n)&&Fa(e,n,t[n]);return e},Aa=function(e,t){return Ra(e,Na(t))},Ta="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ba:ba.apply(null,arguments)};function Da(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Ma(Ma({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Va=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return ka(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Pa([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pa([void 0],e.concat(this))))},t}(Array),Ga=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return ka(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Pa([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pa([void 0],e.concat(this))))},t}(Array);function za(e){return mo(e)?ca(e,(function(){})):e}function Ba(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Ha(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:za(e.initialState),o=e.reducers||{},a=Object.keys(o),i={},l={},s={};function c(){var t="function"==typeof e.extraReducers?Ba(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,a=t[1],i=void 0===a?[]:a,s=t[2],c=void 0===s?void 0:s,u=Ma(Ma({},o),l);return function(e,t,n,r){void 0===n&&(n=[]);var o,a=Ba(t),i=a[0],l=a[1],s=a[2];if("function"==typeof e)o=function(){return za(e())};else{var c=za(e);o=function(){return c}}function u(e,t){void 0===e&&(e=o());var n=Pa([i[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[s]),n.reduce((function(e,n){if(n){var r;if(po(e))return void 0===(r=n(e,t))?e:r;if(mo(e))return ca(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=i;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}c&&e.addDefaultCase(c)}))}return a.forEach((function(e){var n,r,a=o[e],c=t+"/"+e;"reducer"in a?(n=a.reducer,r=a.prepare):n=a,i[e]=n,l[c]=n,s[e]=r?Da(c,r):Da(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:s,caseReducers:i,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}var qa=["name","message","stack","code"],Ua=function(e,t){this.payload=e,this.meta=t},$a=function(e,t){this.payload=e,this.meta=t},Wa=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=qa;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},Za=function(){function e(e,t,n){var r=Da(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Aa(Ma({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Da(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Aa(Ma({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Da(e+"/rejected",(function(e,t,r,o,a){return{payload:o,error:(n&&n.serializeError||Wa)(e||"Rejected"),meta:Aa(Ma({},a||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),i="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(l,s,c){var u,f=(null==n?void 0:n.idGenerator)?n.idGenerator(e):function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t}(),p=new i;function d(e){u=e,p.abort()}var m=function(){return i=this,m=null,g=function(){var i,m,g,h,y,v;return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),null===(b=h=null==(i=null==n?void 0:n.condition)?void 0:i.call(n,e,{getState:s,extra:c}))||"object"!=typeof b||"function"!=typeof b.then?[3,2]:[4,h];case 1:h=w.sent(),w.label=2;case 2:if(!1===h||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return y=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),l(o(f,e,null==(m=null==n?void 0:n.getPendingMeta)?void 0:m.call(n,{requestId:f,arg:e},{getState:s,extra:c}))),[4,Promise.race([y,Promise.resolve(t(e,{dispatch:l,getState:s,extra:c,requestId:f,signal:p.signal,abort:d,rejectWithValue:function(e,t){return new Ua(e,t)},fulfillWithValue:function(e,t){return new $a(e,t)}})).then((function(t){if(t instanceof Ua)throw t;return t instanceof $a?r(t.payload,f,e,t.meta):r(t,f,e)}))])];case 3:return g=w.sent(),[3,5];case 4:return v=w.sent(),g=v instanceof Ua?a(null,f,e,v.payload,v.meta):a(v,f,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&a.match(g)&&g.meta.condition||l(g),[2,g]}var b}))},new Promise((function(e,t){var n=function(e){try{o(g.next(e))}catch(e){t(e)}},r=function(e){try{o(g.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((g=g.apply(i,m)).next())}));var i,m,g}();return Object.assign(m,{abort:d,requestId:f,arg:e,unwrap:function(){return m.then(Ya)}})}}),{pending:o,rejected:a,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function Ya(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}Object.assign;var Ka="listenerMiddleware";Da(Ka+"/add"),Da(Ka+"/removeAll"),Da(Ka+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:void 0!==n.g?n.g:globalThis);"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Qo];return oa.get(t,e)},set:function(t){var n=this[Qo];oa.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Qo];if(!o.P)switch(o.i){case 5:r(o)&&Go(o);break;case 4:n(o)&&Go(o)}}}function n(e){for(var t=e.t,n=e.k,r=ta(n),o=r.length-1;o>=0;o--){var a=r[o];if(a!==Qo){var i=t[a];if(void 0===i&&!yo(t,a))return!0;var l=n[a],s=l&&l[Qo];if(s?s.t!==i:!wo(l,i))return!0}}var c=!!t[Qo];return r.length!==ta(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){ra[e]||(ra[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var a=na(n);delete a[Qo];for(var i=ta(a),l=0;l<i.length;l++){var s=i[l];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:jo(),P:!1,I:!1,R:{},l:n,t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Qo,{value:a,writable:!0}),o},S:function(e,n,o){o?po(n)&&n[Qo].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Qo];if(n){var o=n.t,a=n.k,i=n.R,l=n.i;if(4===l)go(a,(function(t){t!==Qo&&(void 0!==o[t]||yo(o,t)?i[t]||e(a[t]):(i[t]=!0,Go(n)))})),go(o,(function(e){void 0!==a[e]||yo(a,e)||(i[e]=!1,Go(n))}));else if(5===l){if(r(n)&&(Go(n),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var u=Math.min(a.length,o.length),f=0;f<u;f++)a.hasOwnProperty(f)||(i[f]=!0),void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();var Xa=Ha({name:"inventory",initialState:{items:null},reducers:{setInventory:function(e,t){e.items=t.payload},addItem:function(e,t){e.items.push(t.payload)},removeItem:function(e,t){e.items=e.items.filter((function(e){return e.id!==t.payload}))}}}),Ja=Xa.actions,Qa=Ja.setInventory;Ja.addItem,Ja.removeItem;const ei=Xa.reducer;function ti(e){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ti(e)}function ni(e){return function(e){if(Array.isArray(e))return fi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ui(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ri(){ri=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ti(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ti(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function oi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=ti(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ti(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ii(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ui(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function li(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function si(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){li(a,r,o,i,l,"next",e)}function l(e){li(a,r,o,i,l,"throw",e)}i(void 0)}))}}function ci(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||ui(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ui(e,t){if(e){if("string"==typeof e)return fi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fi(e,t):void 0}}function fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return di(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?di(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function di(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mi="undefined"==typeof AbortController?void 0:new AbortController;const gi=function(n){var r=n.getInventory,o=Y((function(e){return e.inventory.items})),a=pi((0,e.useState)(!1),2),i=a[0],l=a[1],s=pi((0,e.useState)(15),2),c=s[0],u=s[1],f=function(){var t=ci((0,e.useState)(!1),2),n=t[0],r=t[1],o=ci((0,e.useState)([]),2),a=o[0],i=o[1],l=ne(),s=(0,e.useCallback)(function(){var e=si(ri().mark((function e(t,o,a,s){var c,u,f,p,d,m,g,h=arguments;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=h.length>4&&void 0!==h[4]?h[4]:15,!n){e.next=3;break}return e.abrupt("return");case 3:r(!0),i([]),u=io(t,c),f=[],p=ii(u),e.prev=8,m=ri().mark((function e(){var t,n;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.value,e.next=3,Promise.all(t.map(function(){var e=si(ri().mark((function e(t){var n,r,i,l;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,lo(t,o,a,s);case 3:return n=e.sent,r=n.error?{status:"failed",product_id:"N/A",square_id:t.id,message:n.error}:ai(ai({},n[0]),{},{status:"success"}),co({type:r.status,message:r.message,context:{product_id:r.product_id,square_id:t.id}}),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),i="AbortError"===e.t0.name?"Request Aborted":e.t0.message,l={status:"failed",product_id:"N/A",square_id:t.id,message:i},co({type:"error",message:i,context:{product_id:l.product_id,square_id:t.id}}),e.abrupt("return",l);case 15:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()));case 3:n=e.sent,f=[].concat(ni(f),ni(n)),i((function(e){return[].concat(ni(e),ni(n.map((function(e){return e}))))}));case 6:case"end":return e.stop()}}),e)})),p.s();case 11:if((d=p.n()).done){e.next=15;break}return e.delegateYield(m(),"t0",13);case 13:e.next=11;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(8),p.e(e.t1);case 20:return e.prev=20,p.f(),e.finish(20);case 23:(g=uo(f,o))&&l(Qa(g)),r(!1);case 26:case"end":return e.stop()}}),e,null,[[8,17,20,23]])})));return function(_x,t,n,r){return e.apply(this,arguments)}}(),[n,l]);return{isImporting:n,progress:a,importProduct:s}}(),p=f.isImporting,d=f.progress,m=f.importProduct,g=pi((0,e.useState)([]),2),h=g[0],y=g[1],v=pi((0,e.useState)({title:!0,sku:!0,description:!0,stock:!0,image:!1,categories:!1,price:!0}),2),w=v[0],b=v[1],E=pi((0,e.useState)({}),2),x=E[0],S=E[1],O=pi((0,e.useState)([]),2),C=O[0],k=O[1],P=pi((0,e.useState)(""),2),j=P[0],R=P[1],N=pi((0,e.useState)({}),2),_=N[0],L=N[1],I=pi((0,e.useState)([]),2),F=I[0],M=I[1],A=pi((0,e.useState)([]),2),T=A[0],D=A[1],V=function(t,n){var r=n.expanded,o=n.setExpanded,a=n.sorting,i=n.setSorting,l=n.globalFilter,s=n.setGlobalFilter,c=n.isImporting,u=n.setProductsToImport,f=n.setIsDialogOpen,p=n.rowSelection,d=n.setRowSelection,m=n.selectableRows,g=n.setSelectableRows,h=(0,e.useMemo)((function(){return function(e){return e.map((function(e){var t,n,r,o,a,i,l,s,c,u,f=((null===(t=e.item_data)||void 0===t?void 0:t.variations)||[]).map((function(e){var t=isNaN(parseInt(e.inventory_count))?0:parseInt(e.inventory_count),n=e.item_variation_data.price_money?e.item_variation_data.price_money.amount/100:0;return{sku:e.item_variation_data.sku,name:e.item_variation_data.name,type:"variation",price:n,status:e.imported,stock:t,id:e.id,woocommerce_product_id:e.woocommerce_product_id||null}})),p=((null===(n=e.item_data)||void 0===n?void 0:n.variations)||[]).map((function(e){return e.item_variation_data.price_money?e.item_variation_data.price_money.amount/100:0})),d=((null===(r=e.item_data)||void 0===r?void 0:r.variations)||[]).map((function(e){return isNaN(parseInt(e.inventory_count))?0:parseInt(e.inventory_count)}));p.length>0?(c=Math.min.apply(Math,zr(p)),u=Math.max.apply(Math,zr(p))):c=u=0;var m=d.length?Math.min.apply(Math,zr(d)):0,g=d.length?Math.max.apply(Math,zr(d)):0;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Vr(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Vr(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({sku:(null===(o=e.item_data)||void 0===o||null===(o=o.variations[0])||void 0===o?void 0:o.item_variation_data.sku)||"",id:e.id,name:(null===(a=e.item_data)||void 0===a?void 0:a.name)||"",stock:m===g?"".concat(m):"".concat(m," - ").concat(g),image:null!==(i=e.item_data)&&void 0!==i&&i.image_urls?e.item_data.image_urls:null,woocommerce_product_id:e.woocommerce_product_id||null,type:((null===(l=e.item_data)||void 0===l||null===(l=l.variations)||void 0===l?void 0:l.length)||0)>1?"Variable":"Simple",price:c===u?"$".concat(c):"$".concat(c," - $").concat(u),categories:null!==(s=e.item_data)&&void 0!==s&&s.categories?e.item_data.categories:"",status:e.imported},f.length>1&&{subRows:f})}))}(t)}),[t]),y=(0,e.useMemo)((function(){return[{id:"expander",width:50,cell:function(e){var t=e.row;return wp.element.createElement(React.Fragment,null,t.getCanExpand()?wp.element.createElement("button",{type:"button"},wp.element.createElement(Hr,{isExpanded:t.getIsExpanded(),row:t})):null)}},{accessorKey:"id",header:function(){return"id"},show:!1},{accessorKey:"sku",header:function(){return"SKU"},canSort:!0},{accessorKey:"image",header:function(){return""},enableSorting:!1,width:50,cell:function(e){var t=(0,e.getValue)();return t?wp.element.createElement($r,{value:t}):wp.element.createElement(qr,null)}},{accessorKey:"name",header:function(){return"Name"},canSort:!0},{accessorKey:"type",header:function(){return"Type"},canSort:!0},{accessorKey:"price",canSort:!0,header:function(){return"Price"}},{accessorKey:"stock",canSort:!0,header:function(){return"Stock"}},{accessorKey:"categories",header:function(){return"categories"},canSort:!0,cell:function(e){var t=(0,e.getValue)();return t&&t.length>0?function(e){var t="",n=e.filter((function(e){return!1===e.parent_id}));n.forEach((function(n){var r=e.filter((function(e){return e.parent_id===n.id})).map((function(e){return e.name}));t+=(t?" | ":"")+n.name,r.length>0&&(t+=" -> "+r.join(", "))}));var r=e.filter((function(e){return!n.find((function(t){return t.id===e.id}))&&!n.some((function(t){return t.id===e.parent_id}))}));if(r.length>0){var o=r.map((function(e){return e.name})).join(", ");t+=(t?" | ":"")+o}return t}(t):""}},{accessorKey:"status",canSort:!0,header:function(){return"Status"},cell:function(e){var t=(0,e.getValue)();return wp.element.createElement(Ur,{status:t})}},{id:"actions",colSpan:2,cell:function(e){var t=e.row;return t.parentId?wp.element.createElement(React.Fragment,null):t.getCanExpand()?wp.element.createElement("div",{className:"relative flex justify-end"},wp.element.createElement("span",{className:"inline-flex items-center rounded-md bg-purple-50 px-1.5 py-0.5 text-xs font-medium text-purple-700 ring-1 ring-inset ring-purple-700/10 whitespace-nowrap -top-4 uppercase"},"Pro Only")):wp.element.createElement("div",{className:"flex items-center justify-end gap-2"},t.original.woocommerce_product_id&&wp.element.createElement("a",{className:"rounded px-2 py-1 text-xs font-semibold text-sky-500 border-sky-500 border hover:border-sky-200 shadow-sm hover:text-sky-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-purple-600 cursor-pointer",href:"/wp-admin/post.php?post=".concat(t.original.woocommerce_product_id,"&action=edit"),target:"_blank"},"View Woo Product"),wp.element.createElement("button",{type:"button",onClick:function(){u([t.original]),f(!0)},disabled:c,className:"rounded bg-sky-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},!0===t.original.status?"Sync":"Import"))}},{id:"select",header:function(e){var t=e.table,n=t.getFilteredRowModel().rows.filter((function(e){return!e.getCanExpand()})).every((function(e){return e.getIsSelected()})),r=t.getFilteredRowModel().rows.filter((function(e){return!e.getCanExpand()})).some((function(e){return e.getIsSelected()}))&&!n;return wp.element.createElement("div",{className:"flex justify-center items-center w-full gap-2 relative"},wp.element.createElement(Yr,{checked:n,indeterminate:r,onChange:function(e){t.getFilteredRowModel().rows.forEach((function(t){t.getCanExpand()||t.toggleSelected(e.target.checked)}))}}))},cell:function(e){var t=e.row;return t.getCanExpand()?wp.element.createElement(React.Fragment,null):t.parentId?void 0:wp.element.createElement("div",{className:"px-1"},wp.element.createElement(Yr,{checked:t.getIsSelected(),disabled:!t.getCanSelect(),indeterminate:t.getIsSomeSelected(),onChange:t.getToggleSelectedHandler()}))}}]}),[]),v=(0,e.useMemo)((function(){return Jr(Jr({data:h,columns:y,state:{expanded:r,sorting:a,columnVisibility:{id:!1},globalFilter:l,rowSelection:p},filterFns:{custom:Kr},onExpandedChange:o,onRowSelectionChange:d,globalFilterFn:"custom",getSubRows:function(e){return e.subRows||[]},getCoreRowModel:e=>fn((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let s=0;s<t.length;s++){const c=nr(e,e._getRowId(t[s],s,a),t[s],s,o,void 0,null==a?void 0:a.id);var l;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=c.originalSubRows)&&l.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getPaginationRowModel:e=>fn((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:a,flatRows:i,rowsById:l}=n;const s=r*o,c=s+r;let u;a=a.slice(s,c),u=e.options.paginateExpandedRows?{rows:a,flatRows:i,rowsById:l}:rr({rows:a,flatRows:i,rowsById:l}),u.flatRows=[];const f=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(f)};return u.rows.forEach(f),u}),pn(e.options,"debugTable")),getFilteredRowModel:e=>fn((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],a=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const a=r.getFilterFn();a&&o.push({id:t.id,filterFn:a,resolvedValue:null!=(n=null==a.resolveFilterValue?void 0:a.resolveFilterValue(t.value))?n:t.value})}));const i=n.map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,u;r&&l&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;a.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(a.length){for(let e=0;e<a.length;e++){u=a[e];const t=u.id;if(u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var r;const o=[],a={},i=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,l=function(e,r){void 0===r&&(r=0);const s=[];for(let u=0;u<e.length;u++){var c;let f=e[u];const p=nr(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,null!=(c=f.subRows)&&c.length&&r<i){if(p.subRows=l(f.subRows,r+1),f=p,t(f)&&!p.subRows.length){s.push(f),a[f.id]=f,o.push(f);continue}if(t(f)||p.subRows.length){s.push(f),a[f.id]=f,o.push(f);continue}}else f=p,t(f)&&(s.push(f),a[f.id]=f,o.push(f))}return s};return{rows:l(e),flatRows:o,rowsById:a}}(e,t,n):function(e,t,n){var r;const o=[],a={},i=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,l=function(e,r){void 0===r&&(r=0);const s=[];for(let u=0;u<e.length;u++){let f=e[u];if(t(f)){var c;if(null!=(c=f.subRows)&&c.length&&r<i){const e=nr(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);e.subRows=l(f.subRows,r+1),f=e}s.push(f),o.push(f),a[f.id]=f}}return s};return{rows:l(e),flatRows:o,rowsById:a}}(e,t,n)}(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getExpandedRowModel:e=>fn((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?rr(t):t),pn(e.options,"debugTable")),onSortingChange:i,onGlobalFilterChange:s,getSortedRowModel:e=>fn((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],l=i[o.id],s=null!=(n=null==o?void 0:o.desc)&&n;let c=0;if(l.sortUndefined){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);(n||r)&&(c=n&&r?0:n?l.sortUndefined:-l.sortUndefined)}if(0===c&&(c=l.sortingFn(e,t,o.id)),0!==c)return s&&(c*=-1),l.invertSorting&&(c*=-1),c}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))})),t};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),autoResetPageIndex:!1,enableRowSelection:!0},"onRowSelectionChange",d),"getRowId",(function(e){return e.id}))}),[h,y,r,a,l,o,i,s,p,d,m,g]);return v}(o,{expanded:x,setExpanded:S,sorting:C,setSorting:k,globalFilter:j,setGlobalFilter:R,isImporting:p,setProductsToImport:y,setIsDialogOpen:l,rowSelection:_,setRowSelection:L,selectableRows:F,setSelectableRows:M}),G=function(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=t.useState((()=>({current:tr(n)}))),[o,a]=t.useState((()=>r.current.initialState));return r.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}}))),r.current}(V);(0,e.useEffect)((function(){var e=G.getCoreRowModel().rows.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)})).map((function(e){return e.id}));M(e)}),[G.getRowModel()]),(0,e.useEffect)((function(){var e=G.getRowModel().rows.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)})).map((function(e){return e.id}));D(e)}),[G.getRowModel()]),(0,e.useEffect)((function(){function e(e){p&&(e.preventDefault(),e.returnValue="")}return p&&window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[p]);var z=(0,e.useContext)(Tr).setBlockNavigation;(0,e.useEffect)((function(){z(!!p)}),[p,z]);return wp.element.createElement("div",null,wp.element.createElement(Mr,{dataToImport:w,setDataToImport:b,importCount:h.length,importProduct:function(){var e;m(h,o,mi,w,c),e=G.getState().pagination.pageIndex,G.setPageIndex(e)},controller:mi,isImporting:p,productsToImport:h,rangeValue:c,setRangeValue:u,isDialogOpen:i,progress:d,setIsDialogOpen:function(e){return function(e){l(e)}(e)}}),wp.element.createElement("div",{className:"px-4 py-5 sm:px-6"},wp.element.createElement("div",{className:"grid grid-cols-3 gap-2 mb-4 items-center"},wp.element.createElement("div",{className:"flex flex-wrap items-center justify-start sm:flex-nowrap"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-gray-900 "},"Square Inventory"),wp.element.createElement("div",{className:"ml-4 flex flex-shrink-0"},wp.element.createElement("button",{type:"button",onClick:r,className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(ar,{className:"-ml-0.5 mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Refresh")))),wp.element.createElement("div",{className:"relative flex"},wp.element.createElement(ur,{value:null!=j?j:"",onChange:function(e){return R(e)},className:"block w-full rounded-md border-0 py-1.5 pr-14 pl-4 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sku-600 sm:text-sm sm:leading-6",placeholder:"Search inventory..."}),wp.element.createElement("div",{className:"absolute inset-y-0 right-0 flex py-1.5 pr-1.5"},wp.element.createElement("kbd",{className:"inline-flex items-center rounded border border-gray-200 px-1 font-sans text-xs text-gray-400"},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-search w-3 h-3"},wp.element.createElement("circle",{cx:"11",cy:"11",r:"8"}),wp.element.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))))),wp.element.createElement("div",{className:"flex justify-end items-center"},wp.element.createElement("button",{type:"button",onClick:function(){var e=G.getFilteredRowModel().rows,t=e.filter((function(e){return e.getIsSelected()})).map((function(e){return e.original}));0===t.length?y(e.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)}))):y(t),l(!0)},className:"disabled:bg-gray-200 relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(ir,{className:"-ml-0.5 mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,Object.keys(_).length<1?"Import all":"Import "+Object.keys(_).length+" selected products"))))),wp.element.createElement("div",{className:"sm:px-6 lg:px-8 relative overflow-auto w-full"},wp.element.createElement("table",{className:"w-full min-w-full whitespace-nowrap text-left bg-white"},wp.element.createElement(mr,{table:G}),wp.element.createElement("tbody",{className:"divide-y divide-gray-200"},G.getRowModel().rows.map((function(e){return wp.element.createElement(hr,{key:e.id,row:e,toggleExpanded:function(){e.getCanExpand()&&e.toggleExpanded()}})}))))),wp.element.createElement("hr",null),wp.element.createElement(xr,{table:G,selectablePageRows:T,rowSelection:_,setRowSelection:L}))};function hi(e){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hi(e)}function yi(){yi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==hi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(hi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function vi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function wi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){vi(a,r,o,i,l,"next",e)}function l(e){vi(a,r,o,i,l,"throw",e)}i(void 0)}))}}function bi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ei(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ei(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xi(e){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xi(e)}function Si(){Si=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==xi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(xi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Oi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var Ci=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Oi(a,r,o,i,l,"next",e)}function l(e){Oi(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Si().mark((function e(){var t,n;return Si().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=F.loading("Retrieving Woo Orders"),e.prev=3,e.next=6,zt()({path:"/sws/v1/orders"});case 6:if(501!==(n=e.sent).status&&!n.message){e.next=10;break}throw F.update(t,{render:"Error fetching orders: ".concat(n.message||"Server error"),type:"error",isLoading:!1,closeOnClick:!0,autoClose:5e3}),new Error(n.message||"Server error");case 10:return F.update(t,{render:"Orders Received",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),e.abrupt("return",{status:"success",data:n});case 14:throw e.prev=14,e.t0=e.catch(3),F.update(t,{render:"Error fetching orders: ".concat(e.t0.error),type:"error",isLoading:!1,closeOnClick:!0,autoClose:5e3}),console.error("Error fetching orders:",e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}();function ki(e){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ki(e)}function Pi(){Pi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ki(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ki(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function ji(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Ri(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ji(a,r,o,i,l,"next",e)}function l(e){ji(a,r,o,i,l,"throw",e)}i(void 0)}))}}var Ni=Za("orders/fetchIfNeeded",Ri(Pi().mark((function e(){var t,n,r,o,a,i,l,s,c,u=arguments;return Pi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=u.length>0&&void 0!==u[0]?u[0]:{}).forceRefresh,r=void 0!==n&&n,t.page,t.perPage,a=(o=u.length>1?u[1]:void 0).getState,i=o.rejectWithValue,l=a(),s=l.orders,!(r||!s.data||s.data.length<1)){e.next=18;break}return console.log("fetch orders"),e.prev=5,e.next=8,Ci();case 8:return c=e.sent,console.log(c),e.abrupt("return",c.data.orders);case 13:return e.prev=13,e.t0=e.catch(5),e.abrupt("return",i(e.t0.error));case 16:e.next=20;break;case 18:return console.log("return orders"),e.abrupt("return",s.data);case 20:case"end":return e.stop()}}),e,null,[[5,13]])}))));const _i=Ha({name:"orders",initialState:{data:null,loading:!1,error:null},reducers:{},extraReducers:function(e){e.addCase(Ni.pending,(function(e){e.loading=!0})).addCase(Ni.fulfilled,(function(e,t){e.loading=!1,e.data=t.payload,e.error=null})).addCase(Ni.rejected,(function(e,t){e.loading=!1,e.data=[],e.error=t.payload}))}}).reducer,Li=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}));function Ii(e){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ii(e)}function Fi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Ii(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Ii(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ai(){Ai=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Ii(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Ii(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Ti(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Di(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Ti(a,r,o,i,l,"next",e)}function l(e){Ti(a,r,o,i,l,"throw",e)}i(void 0)}))}}function Vi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zi(t){var n=t.updateSettings,r=t.setSettings,o=t.settings,a=t.setLocations,i=t.getLocations,l=Vi((0,e.useState)(""),2),s=l[0],c=l[1],u=Vi((0,e.useState)(null),2),f=u[0],p=u[1],d=Vi((0,e.useState)(!0),2),m=d[0],g=d[1],h=function(e){var t,n=e.silent,r=void 0!==n&&n;r||(t=F.loading("Retrieving access token")),zt()({path:"/sws/v1/settings/access-token"}).then((function(e){e.access_token&&e.access_token.length>0&&"Token not set or empty"!==e.access_token?(r||F.update(t,{render:"Access token retrieved",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),p(e.access_token)):r||F.update(t,{render:"Access Token not set",type:"warning",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0})})).catch((function(e){F.update(t,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})})),g(!1)};(0,e.useEffect)((function(){h({silent:!0})}),[]);var y=function(){var e=Di(Ai().mark((function e(t){var n;return Ai().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),g(!0),n=F.loading("Updating access token"),e.next=5,zt()({path:"/sws/v1/settings/access-token",method:"POST",data:{access_token:s}}).then((function(e){c(""),200===e.status?(i(),h({silent:!0}),F.update(n,{render:"Access token updated.",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0})):(p(null),F.update(n,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0}))})).catch((function(e){c(""),p(null),F.update(n,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),v=function(){var e=Di(Ai().mark((function e(){var t;return Ai().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n("location",null),r(Mi(Mi({},o),{},{location:null})),a([]),g(!0),c(""),t=F.loading("Removing access token"),e.next=8,zt()({path:"/sws/v1/settings/access-token",method:"DELETE"}).then((function(){F.update(t,{render:"Access token removed.",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),p(null)})).catch((function(e){F.update(t,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 8:g(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return wp.element.createElement("div",{className:"px-4 py-5 sm:p-6"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Your Square Access Token"),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"Read the following documentation on how to create a square access token: ",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#access-token",target:"_blank",className:"underline text-sky-500"},"How to obtain Square Access Token"))),f?wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:"mt-5 sm:flex sm:items-center"},wp.element.createElement("input",{type:"text",name:"existingToken",id:"existingToken",className:"block !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6",value:f,disabled:!0}),wp.element.createElement("button",{onClick:v,type:"button",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600 sm:ml-3 sm:mt-0 sm:w-auto",disabled:m},m?"Loading":"Remove token")),wp.element.createElement("p",{className:"mt-2"},"Removing your access token will stop all synchronization with Square")):wp.element.createElement("form",{className:"mt-5 sm:flex sm:items-center",onSubmit:y},wp.element.createElement("div",{className:"w-full sm:max-w-xs"},wp.element.createElement("label",{htmlFor:"accessToken",className:"sr-only"},"Access Token"),wp.element.createElement("input",{type:"text",name:"accessToken",id:"accessToken",className:"block w-full !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6",placeholder:"Enter your access token",value:s,disabled:m,onChange:function(e){return c(e.target.value)}})),wp.element.createElement("button",{type:"submit",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600 sm:ml-3 sm:mt-0 sm:w-auto",disabled:m},m?"Loading":"Save")))}n(42);const Bi=function(){return wp.element.createElement("div",{className:"px-4 py-5 sm:p-6"},wp.element.createElement("div",{className:"relative flex"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Webhook URL"),wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO ONLY")),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"The webhook URL is used to keep a live inventory sync between square and woocommerce. Copy this URL and paste it into your square developer webhook subscriptions. Read the following documentation on how to do this:",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#webhook",target:"_blank",className:"underline text-sky-500"},"Setting up webhook url to retrieve inventory updates"))),wp.element.createElement("div",{className:"max-w-xl flex items-center mt-4 blur"},wp.element.createElement("input",{disabled:!0,id:"webhookURL",name:"webhookURL",className:"!select-none block disabled:text-gray-700 w-full !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6 pointer-events-none",value:"https://squarewoosync.com/wp-json/sws/v1"}),wp.element.createElement("button",{type:"button",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600 sm:ml-3 sm:mt-0 sm:w-auto"},"Copy")))};function Hi(e){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(e)}function qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ui(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const $i=function(t){var n=t.settings,r=(t.updateSettings,t.settingsLoading),o=(0,e.useState)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Hi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Hi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Hi(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.squareAuto)),a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ui(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ui(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o,2),i=a[0],l=a[1];(0,e.useEffect)((function(){l(n.squareAuto)}),[n]);var s=function(e){var t=e.id,n=e.label;return wp.element.createElement("li",{className:"w-auto mb-0"},wp.element.createElement("div",{className:"flex items-center gap-2 p-4"},wp.element.createElement("input",{id:t,type:"checkbox",checked:!1,disabled:!0,className:"!m-0 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 leading-normal"}),wp.element.createElement("label",{htmlFor:t,className:"w-full text-sm font-light text-gray-700 leading-normal"},n)))};return wp.element.createElement("div",{className:"px-4 pb-5 sm:px-6"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900 relative"},"Automatic Syncing",wp.element.createElement("a",{className:"pro-badge",href:"https://squarewoosync.com",target:"_blank"},"PRO ONLY")),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500 mb-4"},wp.element.createElement("p",null,"Enable or disable automatic inventory syncing between Woo and Square effortlessly with our Inventory Sync Toggle. Streamline your product management with ease.",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#import-data",className:"underline text-sky-500",target:"_blank"},"How to setup and control automatic syncing between Square and Woo"))),wp.element.createElement("div",{className:""},wp.element.createElement("label",{className:"relative inline-flex items-center cursor-pointer justify-start"},wp.element.createElement("input",{type:"checkbox",checked:!1,disabled:!0,className:"sr-only peer"}),wp.element.createElement("div",{className:"w-11 h-6 bg-gray-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"}),wp.element.createElement("span",{className:"ms-3 text-sm font-medium text-gray-700 "},"Square to woo (Webhook must be setup)")),i.isActive&&!r&&wp.element.createElement(React.Fragment,null,wp.element.createElement("ul",{className:"text-sm font-medium text-gray-900 bg-white my-3 flex flex-wrap fit-content"},[{id:"stock",label:"Stock",checked:!1},{id:"title",label:"Title",checked:!1},{id:"sku",label:"SKU",checked:!1},{id:"price",label:"Price",checked:!1},{id:"description",label:"Description",checked:!1},{id:"images",label:"Images",checked:!1},{id:"category",label:"Category",checked:!1}].map((function(e){return wp.element.createElement(s,{key:e.id,id:e.id,label:e.label,checked:!1,squareWoo:i})}))))))};function Wi(e){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wi(e)}function Zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Ki=function(t){var n=t.settings,r=(t.updateSettings,t.settingsLoading),o=(0,e.useState)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],o=function(e){var t=function(e,t){if("object"!=Wi(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==Wi(t)?t:String(t)}(o),o in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.wooAuto)),a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o,2),i=a[0],l=a[1];(0,e.useEffect)((function(){l(n.wooAuto)}),[n]);var s=function(e){var t=e.id,n=e.label;return wp.element.createElement("li",{className:"w-auto mb-0"},wp.element.createElement("div",{className:"flex items-center gap-2 p-4"},wp.element.createElement("input",{id:t,type:"checkbox",disabled:!0,checked:!1,className:"!m-0 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 leading-normal"}),wp.element.createElement("label",{htmlFor:t,className:"w-full text-sm font-light text-gray-700 leading-normal"},n)))},c=[{id:"stock",label:"Stock",checked:i.stock||!1}];return wp.element.createElement("div",{className:"px-4 pb-5 sm:px-6"},wp.element.createElement("div",{className:"mb-6"},wp.element.createElement("label",{className:"relative inline-flex items-center cursor-pointer"},wp.element.createElement("input",{type:"checkbox",checked:!1,disabled:!0,className:"sr-only peer"}),wp.element.createElement("div",{className:"w-11 h-6 bg-gray-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"}),wp.element.createElement("span",{className:"ms-3 text-sm font-medium text-gray-700 "},"Woo to Square")),i.isActive&&!r&&wp.element.createElement(React.Fragment,null,wp.element.createElement("p",{className:"mt-4"},"Sync stock on order processing. Stock/Inventory count is the the sole permitted auto-sync option from Woo to Square."," ",wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#woo-to-square"},"Learn why here")),wp.element.createElement("p",null,"You can manually sync from the product actions. Learn how here"),wp.element.createElement("ul",{className:"fit-content flex-wrap items-center justify-start text-sm font-medium text-gray-900 bg-white sm:flex"},c.map((function(e){return wp.element.createElement(s,{key:e.id,id:e.id,label:e.label,checked:!1,squareWoo:i})}))))))};function Xi(e){return Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xi(e)}function Ji(){Ji=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Xi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Xi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Qi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function el(e){var t=e.updateSettings,n=e.locations,r=e.settings,o=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Qi(a,r,o,i,l,"next",e)}function l(e){Qi(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Ji().mark((function e(n){return Ji().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.preventDefault(),t("location",n.target.value);case 2:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();return wp.element.createElement("div",{className:"sm:px-6 px-4 pb-5"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Square Locations"),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"Select the location you wish to derive your websites products and inventory from: ",wp.element.createElement("br",null))),wp.element.createElement("div",null,wp.element.createElement("select",{id:"location",name:"location",onChange:function(e){return o(e)},value:r.location?r.location:"",className:"block !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6 mt-2 !pr-10"},wp.element.createElement("option",{value:"",disabled:!0},"Select your location"),n.map((function(e){return wp.element.createElement("option",{key:e.id,value:e.id},e.name)})))))}function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nl(Object(n),!0).forEach((function(t){ol(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ol(e,t,n){return t=function(e){var t=function(e,t){if("object"!=tl(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==tl(t)?t:String(t)}(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function al(){al=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==tl(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(tl(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function il(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function ll(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){il(a,r,o,i,l,"next",e)}function l(e){il(a,r,o,i,l,"throw",e)}i(void 0)}))}}function sl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cl(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ul=[{name:"General",href:"/settings/general",icon:Li,current:!0}];function fl(){en();var t=sl((0,e.useState)(!0),2),n=t[0],r=t[1],o=sl((0,e.useState)([]),2),a=o[0],i=o[1],l=sl((0,e.useState)({location:"",squareAuto:{isActive:!1,stock:!0,sku:!0,title:!0,description:!0,images:!0,price:!0,category:!0},wooAuto:{isActive:!1,stock:!1,sku:!0,title:!1,description:!1,images:!1,category:!1,price:!1}}),2),s=l[0],c=l[1];(0,e.useEffect)((function(){var e=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings",method:"GET"}).then((function(e){c(e),r(!1)})).catch((function(e){r(!1),F({render:"Failed to update settings: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]),(0,e.useEffect)((function(){var e=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings/get-locations",method:"GET"}).then((function(e){i(e.locations.data.locations),r(!1)})).catch((function(e){r(!1),F({render:"Failed to get locations: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var u=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings/get-locations",method:"GET"}).then((function(e){i(e.locations.data.locations),r(!1)})).catch((function(e){r(!1),F({render:"Failed to get locations: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(){var e=ll(al().mark((function e(t,n){var r,o;return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=F.loading("Updating setting: ".concat(t)),e.prev=1,e.next=4,zt()({path:"/sws/v1/settings",method:"POST",data:ol({},t,n)});case 4:(o=e.sent)&&(F.update(r,{render:"settings updated successfully",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),c(rl(rl({},s),o))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),F.update(r,{render:"Failed to update settings: "+e.t0.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0});case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x,t){return e.apply(this,arguments)}}();return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:"lg:flex lg:gap-x-16 bg-white rounded-2xl shadow-lg p-6"},wp.element.createElement("aside",{className:"flex border-b border-gray-900/5 lg:block lg:w-64 lg:flex-none lg:border-0 "},wp.element.createElement("nav",{className:"flex-none px-4 sm:px-6 lg:px-0"},wp.element.createElement("ul",{role:"list",className:"flex gap-x-3 gap-y-1 whitespace-nowrap lg:flex-col"},ul.map((function(e){return wp.element.createElement("li",{key:e.name},wp.element.createElement(Ct,{to:e.href,className:gr(e.current?"bg-gray-50 text-sky-600":"text-gray-700 hover:text-sky-600 hover:bg-gray-50","group flex gap-x-3 rounded-lg py-2 pl-2 pr-3 text-sm leading-6 font-semibold")},wp.element.createElement(e.icon,{className:gr(e.current?"text-sky-600":"text-gray-400 group-hover:text-sky-600","h-6 w-6 shrink-0"),"aria-hidden":"true"}),e.name))})))),wp.element.createElement("div",{className:"mt-4 p-6 rounded-md relative bg-gray-900 overflow-hidden"},wp.element.createElement("svg",{viewBox:"0 0 1024 1024",className:"absolute bottom-[-140%] left-[50%] -translate-x-1/2 [mask-image:radial-gradient(closest-side,white,transparent)] w-[150%]","aria-hidden":"true"},wp.element.createElement("circle",{cx:512,cy:512,r:512,fill:"url(#827591b1-ce8c-4110-b064-7cb85a0b1217)",fillOpacity:"0.7"}),wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{id:"827591b1-ce8c-4110-b064-7cb85a0b1217"},wp.element.createElement("stop",{stopColor:"#7775D6"}),wp.element.createElement("stop",{offset:1,stopColor:"#E935C1"})))),wp.element.createElement("h4",{className:"text-xl font-bold tracking-tight text-white relative z-10"},"Ready to boost your productivity?",wp.element.createElement("br",null),"Get started today."),wp.element.createElement("div",{className:"flex items-center gap-x-6 lg:mt-0 lg:flex-shrink-0 relative z-10"},wp.element.createElement("a",{href:"https://squarewoosync.com",target:"_blank",className:"rounded-md bg-white px-3.5 py-2.5 text-sm font-semibold text-black shadow-sm hover:bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white mt-4"},"Go Pro")))),wp.element.createElement("main",{className:"px-4 sm:px-6 lg:flex-auto lg:px-0"},n?wp.element.createElement("div",null,"Loading..."):wp.element.createElement(React.Fragment,null,wp.element.createElement(zi,{updateSettings:f,setSettings:c,settings:s,setLocations:i,getLocations:u}),wp.element.createElement(el,{updateSettings:f,locations:a,settings:s}),wp.element.createElement(Bi,null),wp.element.createElement($i,{settings:s,updateSettings:f,settingsLoading:n}),wp.element.createElement(Ki,{settings:s,updateSettings:f,settingsLoading:n})))))}const pl=[{path:"/",element:function(){return en(),wp.element.createElement("div",{className:"dashboard-grid"},wp.element.createElement("div",{className:"actions"},wp.element.createElement(Lt,null)),wp.element.createElement("div",{className:"log"},wp.element.createElement(Jt,null)),wp.element.createElement("div",{className:"support"},wp.element.createElement(Vt,null)),wp.element.createElement("div",{className:"pro"},wp.element.createElement("div",{className:"bg-white pt-9 pb-12 rounded-xl"},wp.element.createElement("div",{className:"mx-auto max-w-7xl px-6 lg:px-8"},wp.element.createElement("div",{className:"grid max-w-2xl grid-cols-1 gap-x-8 gap-y-8 "},wp.element.createElement("div",null,wp.element.createElement("h2",{className:"text-sm font-semibold leading-7 text-sky-600"},"SquareWooSync"," ",wp.element.createElement("span",{className:"inline-flex items-center rounded-md bg-purple-50 px-1.5 py-0.5 text-xs font-medium text-purple-700 ring-1 ring-inset ring-purple-700/10 whitespace-nowrap"},"PRO")),wp.element.createElement("p",{className:"text-xl font-bold tracking-tight text-gray-900"},"Pro Features"),wp.element.createElement("p",{className:"mt-2 text-sm leading-7 text-gray-600"},"Check out these pro features to boost your productivity")),wp.element.createElement("dl",{className:"col-span-2 grid grid-cols-1 gap-x-8 gap-y-4 text-sm leading-7 text-gray-600"},wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Automatic live sync between Square and Woo."),wp.element.createElement("dd",{className:""},"Optimize productivity and streamline store management with real-time inventory synchronization.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Dynamic data import"),wp.element.createElement("dd",null,"Take control over what data you would like to import.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Variable products"),wp.element.createElement("dd",null,"Seamlessly manage product variations within your inventory, ensuring you have complete control and flexibility over your Woo and Square products.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Hierarchical Categories"),wp.element.createElement("dd",null,"Seamlessly imports hierarchical categories directly to your website. Simplify the process of organizing and displaying your products online. By accurately mirroring the structured hierarchy of your square inventory system.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Smart Image Import"),wp.element.createElement("dd",null,"Easily enhance your product catalog with our image import feature. No duplicate images.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Customer Support"),wp.element.createElement("dd",null,"Access round-the-clock assistance from our dedicated support team. Get help whenever you need it to ensure a smooth and successful integration experience."))))))))}},{path:"/inventory",element:function(){var t=ne(),n=Y((function(e){return e.inventory.items})),r=bi((0,e.useState)(!1),2),o=r[0],a=r[1],i=bi((0,e.useState)(!1),2),l=i[0],s=i[1];en();var c=(0,e.useCallback)(wi(yi().mark((function e(){var n,r;return yi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),n=F.loading("Retrieving square inventory"),e.prev=2,e.next=5,zt()({path:"/sws/v1/square-inventory/"});case 5:r=e.sent,F.update(n,{render:"Inventory received",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),t(Qa(r)),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),F.update(n,{render:e.t0.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0});case 13:return e.prev=13,a(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])}))),[t]);return(0,e.useEffect)((function(){var e=function(){var e=wi(yi().mark((function e(){var t;return yi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zt()({path:"/sws/v1/settings/access-token"});case 3:t=e.sent,console.log(t),t.access_token&&t.access_token.length>0&&"Token not set or empty"!==t.access_token&&s(t.access_token),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();e()}),[]),wp.element.createElement("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden mt-10"},!n&&!o&&wp.element.createElement(on,{getInventory:c,validToken:l}),o&&wp.element.createElement(ln,null),n&&!o&&wp.element.createElement(gi,{getInventory:c}))}},{path:"/orders",element:function(){return en(),wp.element.createElement("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden mt-10"},wp.element.createElement("div",{className:"bg-white py-12 sm:py-32"},wp.element.createElement("div",{className:"mx-auto max-w-7xl px-6 lg:px-8"},wp.element.createElement("div",{className:"mx-auto grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 sm:gap-y-20 lg:mx-0 lg:max-w-none lg:grid-cols-3"},wp.element.createElement("div",{className:"col-span-full text-center max-w-md mx-auto"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-sky-600"},"Coming Soon"),wp.element.createElement("p",{className:"mt-2 text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl"},"Sync Orders"),wp.element.createElement("p",{className:"mt-6 text-base leading-7 text-gray-600"},"Transform the way you manage your online and offline sales with our upcoming WooCommerce to Square Order Sync feature. Designed to seamlessly integrate your WooCommerce store with the Square payment system, this powerful feature will ensure that your orders and sales records are perfectly synchronized."))))))}},{path:"/settings/general",element:function(){return en(),wp.element.createElement(fl,null)}},{path:"/settings/general",element:fl}];var dl="persist:",ml="persist/FLUSH",gl="persist/REHYDRATE",hl="persist/PAUSE",yl="persist/PERSIST",vl="persist/PURGE",wl="persist/REGISTER";function bl(e){return bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bl(e)}function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sl(e){return JSON.stringify(e)}function Ol(e){return JSON.parse(e)}function Cl(e){}function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kl(n,!0).forEach((function(t){jl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kl(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nl(n,!0).forEach((function(t){Ll(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ll(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Il,Fl,Ml,Al,Tl,Dl,Vl,Gl,zl,Bl,Hl={registry:[],bootstrapped:!1},ql=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wl:return _l({},e,{registry:[].concat(Rl(e.registry),[t.key])});case gl:var n=e.registry.indexOf(t.key),r=Rl(e.registry);return r.splice(n,1),_l({},e,{registry:r,bootstrapped:0===r.length});default:return e}},Ul=n(274),$l=wa({inventory:ei,orders:_i}),Wl={key:"root",storage:Ul.A,whitelist:["inventory","orders"]},Zl=(Fl=$l,Ml=void 0!==(Il=Wl).version?Il.version:-1,Al=void 0===Il.stateReconciler?function(e,t,n,r){r.debug;var o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?El(n,!0).forEach((function(t){xl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):El(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n);return e&&"object"===bl(e)&&Object.keys(e).forEach((function(r){"_persist"!==r&&t[r]===n[r]&&(o[r]=e[r])})),o}:Il.stateReconciler,Tl=Il.getStoredState||function(e){var t,n=e.transforms||[],r="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key),o=e.storage;return e.debug,t=!1===e.deserialize?function(e){return e}:"function"==typeof e.deserialize?e.deserialize:Ol,o.getItem(r).then((function(e){if(e)try{var r={},o=t(e);return Object.keys(o).forEach((function(e){r[e]=n.reduceRight((function(t,n){return n.out(t,e,o)}),t(o[e]))})),r}catch(e){throw e}}))},Dl=void 0!==Il.timeout?Il.timeout:5e3,Vl=null,Gl=!1,zl=!0,Bl=function(e){return e._persist.rehydrated&&Vl&&!zl&&Vl.update(e),e},function(e,t){var n=e||{},r=n._persist,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["_persist"]);if(t.type===yl){var a=!1,i=function(e,n){a||(t.rehydrate(Il.key,e,n),a=!0)};if(Dl&&setTimeout((function(){!a&&i(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(Il.key,'"')))}),Dl),zl=!1,Vl||(Vl=function(e){var t,n=e.blacklist||null,r=e.whitelist||null,o=e.transforms||[],a=e.throttle||0,i="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key),l=e.storage;t=!1===e.serialize?function(e){return e}:"function"==typeof e.serialize?e.serialize:Sl;var s=e.writeFailHandler||null,c={},u={},f=[],p=null,d=null;function m(){if(0===f.length)return p&&clearInterval(p),void(p=null);var e=f.shift(),n=o.reduce((function(t,n){return n.in(t,e,c)}),c[e]);if(void 0!==n)try{u[e]=t(n)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete u[e];0===f.length&&(Object.keys(u).forEach((function(e){void 0===c[e]&&delete u[e]})),d=l.setItem(i,t(u)).catch(h))}function g(e){return!(r&&-1===r.indexOf(e)&&"_persist"!==e||n&&-1!==n.indexOf(e))}function h(e){s&&s(e)}return{update:function(e){Object.keys(e).forEach((function(t){g(t)&&c[t]!==e[t]&&-1===f.indexOf(t)&&f.push(t)})),Object.keys(c).forEach((function(t){void 0===e[t]&&g(t)&&-1===f.indexOf(t)&&void 0!==c[t]&&f.push(t)})),null===p&&(p=setInterval(m,a)),c=e},flush:function(){for(;0!==f.length;)m();return d||Promise.resolve()}}}(Il)),r)return Pl({},Fl(o,t),{_persist:r});if("function"!=typeof t.rehydrate||"function"!=typeof t.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return t.register(Il.key),Tl(Il).then((function(e){var t=Il.migrate||function(e,t){return Promise.resolve(e)};t(e,Ml).then((function(e){i(e)}),(function(e){i(void 0,e)}))}),(function(e){i(void 0,e)})),Pl({},Fl(o,t),{_persist:{version:Ml,rehydrated:!1}})}if(t.type===vl)return Gl=!0,t.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key);return t.removeItem(n,Cl)}(Il)),Pl({},Fl(o,t),{_persist:r});if(t.type===ml)return t.result(Vl&&Vl.flush()),Pl({},Fl(o,t),{_persist:r});if(t.type===hl)zl=!0;else if(t.type===gl){if(Gl)return Pl({},o,{_persist:Pl({},r,{rehydrated:!0})});if(t.key===Il.key){var l=Fl(o,t),s=t.payload,c=Pl({},!1!==Al&&void 0!==s?Al(s,e,l,Il):l,{_persist:Pl({},r,{rehydrated:!0})});return Bl(c)}}if(!r)return Fl(e,t);var u=Fl(o,t);return u===o?e:Bl(Pl({},u,{_persist:r}))}),Yl=function(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,e.actionCreatorCheck,new Va);return n&&("boolean"!=typeof n?r.push(Oa.withExtraArgument(n.extraArgument)):r.push(Oa)),r}(e)},r=e||{},o=r.reducer,a=void 0===o?void 0:o,i=r.middleware,l=void 0===i?n():i,s=r.devTools,c=void 0===s||s,u=r.preloadedState,f=void 0===u?void 0:u,p=r.enhancers,d=void 0===p?void 0:p;if("function"==typeof a)t=a;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=wa(a)}var m=l;"function"==typeof m&&(m=m(n));var g=Ea.apply(void 0,m),h=ba;c&&(h=Ta(Ma({trace:!1},"object"==typeof c&&c)));var y=new Ga(g),v=y;return Array.isArray(d)?v=Pa([g],d):"function"==typeof d&&(v=d(y)),va(t,f,h.apply(void 0,v))}({reducer:Zl,middleware:function(e){return e({serializableCheck:!1})}}),Kl=function(e,t,n){var r=!1,o=va(ql,Hl,void 0),a=function(e){o.dispatch({type:wl,key:e})},i=function(t,n,a){var i={type:gl,payload:n,err:a,key:t};e.dispatch(i),o.dispatch(i),r&&l.getState().bootstrapped&&(r(),r=!1)},l=_l({},o,{purge:function(){var t=[];return e.dispatch({type:vl,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:ml,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:hl})},persist:function(){e.dispatch({type:yl,register:a,rehydrate:i})}});return l.persist(),l}(Yl),Xl=document.getElementById("square-woo-sync");null!=Xl&&(0,e.createRoot)(Xl).render(wp.element.createElement(React.Fragment,null,wp.element.createElement(O,{className:"toast-position",position:"top-center",autoClose:500,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"}),wp.element.createElement((function({store:e,context:n,children:r,serverState:o,stabilityCheck:a="once",noopCheck:i="once"}){const l=t.useMemo((()=>{const t=function(e,t){let n,r=K,o=0,a=!1;function i(){c.onStateChange&&c.onStateChange()}function l(){o++,n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){const e=V();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function s(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=K)}const c={addNestedSub:function(e){l();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),s())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,l())},tryUnsubscribe:function(){a&&(a=!1,s())},getListeners:()=>r};return c}(e);return{store:e,subscription:t,getServerState:o?()=>o:void 0,stabilityCheck:a,noopCheck:i}}),[e,o,a,i]),s=t.useMemo((()=>e.getState()),[e]);X((()=>{const{subscription:t}=l;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[l,s]);const c=n||H;return t.createElement(c.Provider,{value:l},r)}),{store:Yl},wp.element.createElement(fe,{loading:null,persistor:Kl},wp.element.createElement((function(){return wp.element.createElement(xt,null,wp.element.createElement(_t,null,wp.element.createElement(Dr,null,wp.element.createElement(mt,null,pl.map((function(e,t){return wp.element.createElement(pt,{key:t,path:e.path,element:wp.element.createElement(e.element,null)})}))))))}),null)))))})()})();1 (()=>{var e={874:(e,t,n)=>{"use strict";var r=n(935),o={"text/plain":"Text","text/html":"Url",default:"Text"};e.exports=function(e,t){var n,a,i,l,s,c,u=!1;t||(t={}),n=t.debug||!1;try{if(i=r(),l=document.createRange(),s=document.getSelection(),(c=document.createElement("span")).textContent=e,c.ariaHidden="true",c.style.all="unset",c.style.position="fixed",c.style.top=0,c.style.clip="rect(0, 0, 0, 0)",c.style.whiteSpace="pre",c.style.webkitUserSelect="text",c.style.MozUserSelect="text",c.style.msUserSelect="text",c.style.userSelect="text",c.addEventListener("copy",(function(r){if(r.stopPropagation(),t.format)if(r.preventDefault(),void 0===r.clipboardData){n&&console.warn("unable to use e.clipboardData"),n&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var a=o[t.format]||o.default;window.clipboardData.setData(a,e)}else r.clipboardData.clearData(),r.clipboardData.setData(t.format,e);t.onCopy&&(r.preventDefault(),t.onCopy(r.clipboardData))})),document.body.appendChild(c),l.selectNodeContents(c),s.addRange(l),!document.execCommand("copy"))throw new Error("copy command was unsuccessful");u=!0}catch(r){n&&console.error("unable to copy using execCommand: ",r),n&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),u=!0}catch(r){n&&console.error("unable to copy using clipboardData: ",r),n&&console.error("falling back to prompt"),a=function(e){var t=(/mac os x/i.test(navigator.userAgent)?"⌘":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}("message"in t?t.message:"Copy to clipboard: #{key}, Enter"),window.prompt(a,e)}}finally{s&&("function"==typeof s.removeRange?s.removeRange(l):s.removeAllRanges()),c&&document.body.removeChild(c),i()}return u}},535:(e,t,n)=>{"use strict";var r=n(237),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!=typeof n){if(m){var o=d(n);o&&o!==m&&e(t,o,r)}var i=u(n);f&&(i=i.concat(f(n)));for(var l=s(t),g=s(n),h=0;h<i.length;++h){var y=i[h];if(!(a[y]||r&&r[y]||g&&g[y]||l&&l[y])){var v=p(n,y);try{c(t,y,v)}catch(e){}}}}return t}},198:(e,t)=>{"use strict";var n="function"==typeof Symbol&&Symbol.for,r=n?Symbol.for("react.element"):60103,o=n?Symbol.for("react.portal"):60106,a=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,s=n?Symbol.for("react.provider"):60109,c=n?Symbol.for("react.context"):60110,u=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,p=n?Symbol.for("react.forward_ref"):60112,d=n?Symbol.for("react.suspense"):60113,m=n?Symbol.for("react.suspense_list"):60120,g=n?Symbol.for("react.memo"):60115,h=n?Symbol.for("react.lazy"):60116,y=n?Symbol.for("react.block"):60121,v=n?Symbol.for("react.fundamental"):60117,w=n?Symbol.for("react.responder"):60118,b=n?Symbol.for("react.scope"):60119;function E(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case u:case f:case a:case l:case i:case d:return e;default:switch(e=e&&e.$$typeof){case c:case p:case h:case g:case s:return e;default:return t}}case o:return t}}}function x(e){return E(e)===f}t.AsyncMode=u,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=s,t.Element=r,t.ForwardRef=p,t.Fragment=a,t.Lazy=h,t.Memo=g,t.Portal=o,t.Profiler=l,t.StrictMode=i,t.Suspense=d,t.isAsyncMode=function(e){return x(e)||E(e)===u},t.isConcurrentMode=x,t.isContextConsumer=function(e){return E(e)===c},t.isContextProvider=function(e){return E(e)===s},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},t.isForwardRef=function(e){return E(e)===p},t.isFragment=function(e){return E(e)===a},t.isLazy=function(e){return E(e)===h},t.isMemo=function(e){return E(e)===g},t.isPortal=function(e){return E(e)===o},t.isProfiler=function(e){return E(e)===l},t.isStrictMode=function(e){return E(e)===i},t.isSuspense=function(e){return E(e)===d},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===f||e===l||e===i||e===d||e===m||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===g||e.$$typeof===s||e.$$typeof===c||e.$$typeof===p||e.$$typeof===v||e.$$typeof===w||e.$$typeof===b||e.$$typeof===y)},t.typeOf=E},237:(e,t,n)=>{"use strict";e.exports=n(198)},195:(e,t)=>{"use strict";Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen");Symbol.for("react.module.reference")},357:(e,t,n)=>{"use strict";n(195)},49:(e,t,n)=>{"use strict";t.__esModule=!0,t.default=function(e){var t=(0,o.default)(e);return{getItem:function(e){return new Promise((function(n,r){n(t.getItem(e))}))},setItem:function(e,n){return new Promise((function(r,o){r(t.setItem(e,n))}))},removeItem:function(e){return new Promise((function(n,r){n(t.removeItem(e))}))}}};var r,o=(r=n(275))&&r.__esModule?r:{default:r}},275:(e,t)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function r(){}t.__esModule=!0,t.default=function(e){var t="".concat(e,"Storage");return function(e){if("object"!==("undefined"==typeof self?"undefined":n(self))||!(e in self))return!1;try{var t=self[e],r="redux-persist ".concat(e," test");t.setItem(r,"test"),t.getItem(r),t.removeItem(r)}catch(e){return!1}return!0}(t)?self[t]:o};var o={getItem:r,setItem:r,removeItem:r}},851:(e,t,n)=>{"use strict";var r;t.Z=void 0;var o=(0,((r=n(49))&&r.__esModule?r:{default:r}).default)("session");t.Z=o},935:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,n=[],r=0;r<e.rangeCount;r++)n.push(e.getRangeAt(r));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||n.forEach((function(t){e.addRange(t)})),t&&t.focus()}}},415:(e,t,n)=>{"use strict";var r=n(196),o="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},a=r.useState,i=r.useEffect,l=r.useLayoutEffect,s=r.useDebugValue;function c(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!o(e,n)}catch(e){return!0}}var u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l((function(){o.value=n,o.getSnapshot=t,c(o)&&u({inst:o})}),[e,n,t]),i((function(){return c(o)&&u({inst:o}),e((function(){c(o)&&u({inst:o})}))}),[e]),s(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:u},179:(e,t,n)=>{"use strict";var r=n(196),o=n(322),a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=o.useSyncExternalStore,l=r.useRef,s=r.useEffect,c=r.useMemo,u=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var f=l(null);if(null===f.current){var p={hasValue:!1,value:null};f.current=p}else p=f.current;f=c((function(){function e(e){if(!s){if(s=!0,i=e,e=r(e),void 0!==o&&p.hasValue){var t=p.value;if(o(t,e))return l=t}return l=e}if(t=l,a(i,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(i=e,l=n)}var i,l,s=!1,c=void 0===n?null:n;return[function(){return e(t())},null===c?void 0:function(){return e(c())}]}),[t,n,r,o]);var d=i(e,f[0],f[1]);return s((function(){p.hasValue=!0,p.value=d}),[d]),u(d),d}},322:(e,t,n)=>{"use strict";e.exports=n(415)},231:(e,t,n)=>{"use strict";e.exports=n(179)},196:e=>{"use strict";e.exports=window.React}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&!e;)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{"use strict";const e=window.wp.element;var t=n(196);function r(e){var t,n,o="";if("string"==typeof e||"number"==typeof e)o+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=r(e[t]))&&(o&&(o+=" "),o+=n);else for(t in e)e[t]&&(o&&(o+=" "),o+=t);return o}const o=function(){for(var e,t,n=0,o="";n<arguments.length;)(e=arguments[n++])&&(t=r(e))&&(o&&(o+=" "),o+=t);return o},a=e=>"number"==typeof e&&!isNaN(e),i=e=>"string"==typeof e,l=e=>"function"==typeof e,s=e=>i(e)||l(e)?e:null,c=e=>(0,t.isValidElement)(e)||i(e)||l(e)||a(e);function u(e){let{enter:n,exit:r,appendPosition:o=!1,collapse:a=!0,collapseDuration:i=300}=e;return function(e){let{children:l,position:s,preventExitTransition:c,done:u,nodeRef:f,isIn:p}=e;const d=o?`${n}--${s}`:n,m=o?`${r}--${s}`:r,g=(0,t.useRef)(0);return(0,t.useLayoutEffect)((()=>{const e=f.current,t=d.split(" "),n=r=>{r.target===f.current&&(e.dispatchEvent(new Event("d")),e.removeEventListener("animationend",n),e.removeEventListener("animationcancel",n),0===g.current&&"animationcancel"!==r.type&&e.classList.remove(...t))};e.classList.add(...t),e.addEventListener("animationend",n),e.addEventListener("animationcancel",n)}),[]),(0,t.useEffect)((()=>{const e=f.current,t=()=>{e.removeEventListener("animationend",t),a?function(e,t,n){void 0===n&&(n=300);const{scrollHeight:r,style:o}=e;requestAnimationFrame((()=>{o.minHeight="initial",o.height=r+"px",o.transition=`all ${n}ms`,requestAnimationFrame((()=>{o.height="0",o.padding="0",o.margin="0",setTimeout(t,n)}))}))}(e,u,i):u()};p||(c?t():(g.current=1,e.className+=` ${m}`,e.addEventListener("animationend",t)))}),[p]),t.createElement(t.Fragment,null,l)}}function f(e,t){return null!=e?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const p={list:new Map,emitQueue:new Map,on(e,t){return this.list.has(e)||this.list.set(e,[]),this.list.get(e).push(t),this},off(e,t){if(t){const n=this.list.get(e).filter((e=>e!==t));return this.list.set(e,n),this}return this.list.delete(e),this},cancelEmit(e){const t=this.emitQueue.get(e);return t&&(t.forEach(clearTimeout),this.emitQueue.delete(e)),this},emit(e){this.list.has(e)&&this.list.get(e).forEach((t=>{const n=setTimeout((()=>{t(...[].slice.call(arguments,1))}),0);this.emitQueue.has(e)||this.emitQueue.set(e,[]),this.emitQueue.get(e).push(n)}))}},d=e=>{let{theme:n,type:r,...o}=e;return t.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:"colored"===n?"currentColor":`var(--toastify-icon-color-${r})`,...o})},m={info:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return t.createElement(d,{...e},t.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return t.createElement("div",{className:"Toastify__spinner"})}};function g(e){const[,n]=(0,t.useReducer)((e=>e+1),0),[r,o]=(0,t.useState)([]),u=(0,t.useRef)(null),d=(0,t.useRef)(new Map).current,g=e=>-1!==r.indexOf(e),h=(0,t.useRef)({toastKey:1,displayedToast:0,count:0,queue:[],props:e,containerId:null,isToastActive:g,getToast:e=>d.get(e)}).current;function y(e){let{containerId:t}=e;const{limit:n}=h.props;!n||t&&h.containerId!==t||(h.count-=h.queue.length,h.queue=[])}function v(e){o((t=>null==e?[]:t.filter((t=>t!==e))))}function w(){const{toastContent:e,toastProps:t,staleId:n}=h.queue.shift();E(e,t,n)}function b(e,r){let{delay:o,staleId:g,...y}=r;if(!c(e)||function(e){return!u.current||h.props.enableMultiContainer&&e.containerId!==h.props.containerId||d.has(e.toastId)&&null==e.updateId}(y))return;const{toastId:b,updateId:x,data:S}=y,{props:O}=h,C=()=>v(b),k=null==x;k&&h.count++;const P={...O,style:O.toastStyle,key:h.toastKey++,...Object.fromEntries(Object.entries(y).filter((e=>{let[t,n]=e;return null!=n}))),toastId:b,updateId:x,data:S,closeToast:C,isIn:!1,className:s(y.className||O.toastClassName),bodyClassName:s(y.bodyClassName||O.bodyClassName),progressClassName:s(y.progressClassName||O.progressClassName),autoClose:!y.isLoading&&(j=y.autoClose,R=O.autoClose,!1===j||a(j)&&j>0?j:R),deleteToast(){const e=f(d.get(b),"removed");d.delete(b),p.emit(4,e);const t=h.queue.length;if(h.count=null==b?h.count-h.displayedToast:h.count-1,h.count<0&&(h.count=0),t>0){const e=null==b?h.props.limit:1;if(1===t||1===e)h.displayedToast++,w();else{const n=e>t?t:e;h.displayedToast=n;for(let e=0;e<n;e++)w()}}else n()}};var j,R;P.iconOut=function(e){let{theme:n,type:r,isLoading:o,icon:s}=e,c=null;const u={theme:n,type:r};return!1===s||(l(s)?c=s(u):(0,t.isValidElement)(s)?c=(0,t.cloneElement)(s,u):i(s)||a(s)?c=s:o?c=m.spinner():(e=>e in m)(r)&&(c=m[r](u))),c}(P),l(y.onOpen)&&(P.onOpen=y.onOpen),l(y.onClose)&&(P.onClose=y.onClose),P.closeButton=O.closeButton,!1===y.closeButton||c(y.closeButton)?P.closeButton=y.closeButton:!0===y.closeButton&&(P.closeButton=!c(O.closeButton)||O.closeButton);let N=e;(0,t.isValidElement)(e)&&!i(e.type)?N=(0,t.cloneElement)(e,{closeToast:C,toastProps:P,data:S}):l(e)&&(N=e({closeToast:C,toastProps:P,data:S})),O.limit&&O.limit>0&&h.count>O.limit&&k?h.queue.push({toastContent:N,toastProps:P,staleId:g}):a(o)?setTimeout((()=>{E(N,P,g)}),o):E(N,P,g)}function E(e,t,n){const{toastId:r}=t;n&&d.delete(n);const a={content:e,props:t};d.set(r,a),o((e=>[...e,r].filter((e=>e!==n)))),p.emit(4,f(a,null==a.props.updateId?"added":"updated"))}return(0,t.useEffect)((()=>(h.containerId=e.containerId,p.cancelEmit(3).on(0,b).on(1,(e=>u.current&&v(e))).on(5,y).emit(2,h),()=>{d.clear(),p.emit(3,h)})),[]),(0,t.useEffect)((()=>{h.props=e,h.isToastActive=g,h.displayedToast=r.length})),{getToastToRender:function(t){const n=new Map,r=Array.from(d.values());return e.newestOnTop&&r.reverse(),r.forEach((e=>{const{position:t}=e.props;n.has(t)||n.set(t,[]),n.get(t).push(e)})),Array.from(n,(e=>t(e[0],e[1])))},containerRef:u,isToastActive:g}}function h(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientX:e.clientX}function y(e){return e.targetTouches&&e.targetTouches.length>=1?e.targetTouches[0].clientY:e.clientY}function v(e){const[n,r]=(0,t.useState)(!1),[o,a]=(0,t.useState)(!1),i=(0,t.useRef)(null),s=(0,t.useRef)({start:0,x:0,y:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,boundingRect:null,didMove:!1}).current,c=(0,t.useRef)(e),{autoClose:u,pauseOnHover:f,closeToast:p,onClick:d,closeOnClick:m}=e;function g(t){if(e.draggable){"touchstart"===t.nativeEvent.type&&t.nativeEvent.preventDefault(),s.didMove=!1,document.addEventListener("mousemove",E),document.addEventListener("mouseup",x),document.addEventListener("touchmove",E),document.addEventListener("touchend",x);const n=i.current;s.canCloseOnClick=!0,s.canDrag=!0,s.boundingRect=n.getBoundingClientRect(),n.style.transition="",s.x=h(t.nativeEvent),s.y=y(t.nativeEvent),"x"===e.draggableDirection?(s.start=s.x,s.removalDistance=n.offsetWidth*(e.draggablePercent/100)):(s.start=s.y,s.removalDistance=n.offsetHeight*(80===e.draggablePercent?1.5*e.draggablePercent:e.draggablePercent/100))}}function v(t){if(s.boundingRect){const{top:n,bottom:r,left:o,right:a}=s.boundingRect;"touchend"!==t.nativeEvent.type&&e.pauseOnHover&&s.x>=o&&s.x<=a&&s.y>=n&&s.y<=r?b():w()}}function w(){r(!0)}function b(){r(!1)}function E(t){const r=i.current;s.canDrag&&r&&(s.didMove=!0,n&&b(),s.x=h(t),s.y=y(t),s.delta="x"===e.draggableDirection?s.x-s.start:s.y-s.start,s.start!==s.x&&(s.canCloseOnClick=!1),r.style.transform=`translate${e.draggableDirection}(${s.delta}px)`,r.style.opacity=""+(1-Math.abs(s.delta/s.removalDistance)))}function x(){document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",x),document.removeEventListener("touchmove",E),document.removeEventListener("touchend",x);const t=i.current;if(s.canDrag&&s.didMove&&t){if(s.canDrag=!1,Math.abs(s.delta)>s.removalDistance)return a(!0),void e.closeToast();t.style.transition="transform 0.2s, opacity 0.2s",t.style.transform=`translate${e.draggableDirection}(0)`,t.style.opacity="1"}}(0,t.useEffect)((()=>{c.current=e})),(0,t.useEffect)((()=>(i.current&&i.current.addEventListener("d",w,{once:!0}),l(e.onOpen)&&e.onOpen((0,t.isValidElement)(e.children)&&e.children.props),()=>{const e=c.current;l(e.onClose)&&e.onClose((0,t.isValidElement)(e.children)&&e.children.props)})),[]),(0,t.useEffect)((()=>(e.pauseOnFocusLoss&&(document.hasFocus()||b(),window.addEventListener("focus",w),window.addEventListener("blur",b)),()=>{e.pauseOnFocusLoss&&(window.removeEventListener("focus",w),window.removeEventListener("blur",b))})),[e.pauseOnFocusLoss]);const S={onMouseDown:g,onTouchStart:g,onMouseUp:v,onTouchEnd:v};return u&&f&&(S.onMouseEnter=b,S.onMouseLeave=w),m&&(S.onClick=e=>{d&&d(e),s.canCloseOnClick&&p()}),{playToast:w,pauseToast:b,isRunning:n,preventExitTransition:o,toastRef:i,eventHandlers:S}}function w(e){let{closeToast:n,theme:r,ariaLabel:o="close"}=e;return t.createElement("button",{className:`Toastify__close-button Toastify__close-button--${r}`,type:"button",onClick:e=>{e.stopPropagation(),n(e)},"aria-label":o},t.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},t.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function b(e){let{delay:n,isRunning:r,closeToast:a,type:i="default",hide:s,className:c,style:u,controlledProgress:f,progress:p,rtl:d,isIn:m,theme:g}=e;const h=s||f&&0===p,y={...u,animationDuration:`${n}ms`,animationPlayState:r?"running":"paused",opacity:h?0:1};f&&(y.transform=`scaleX(${p})`);const v=o("Toastify__progress-bar",f?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${i}`,{"Toastify__progress-bar--rtl":d}),w=l(c)?c({rtl:d,type:i,defaultClassName:v}):o(v,c);return t.createElement("div",{role:"progressbar","aria-hidden":h?"true":"false","aria-label":"notification timer",className:w,style:y,[f&&p>=1?"onTransitionEnd":"onAnimationEnd"]:f&&p<1?null:()=>{m&&a()}})}const E=e=>{const{isRunning:n,preventExitTransition:r,toastRef:a,eventHandlers:i}=v(e),{closeButton:s,children:c,autoClose:u,onClick:f,type:p,hideProgressBar:d,closeToast:m,transition:g,position:h,className:y,style:E,bodyClassName:x,bodyStyle:S,progressClassName:O,progressStyle:C,updateId:k,role:P,progress:j,rtl:R,toastId:N,deleteToast:_,isIn:L,isLoading:I,iconOut:F,closeOnClick:M,theme:A}=e,T=o("Toastify__toast",`Toastify__toast-theme--${A}`,`Toastify__toast--${p}`,{"Toastify__toast--rtl":R},{"Toastify__toast--close-on-click":M}),D=l(y)?y({rtl:R,position:h,type:p,defaultClassName:T}):o(T,y),V=!!j||!u,G={closeToast:m,type:p,theme:A};let z=null;return!1===s||(z=l(s)?s(G):(0,t.isValidElement)(s)?(0,t.cloneElement)(s,G):w(G)),t.createElement(g,{isIn:L,done:_,position:h,preventExitTransition:r,nodeRef:a},t.createElement("div",{id:N,onClick:f,className:D,...i,style:E,ref:a},t.createElement("div",{...L&&{role:P},className:l(x)?x({type:p}):o("Toastify__toast-body",x),style:S},null!=F&&t.createElement("div",{className:o("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!I})},F),t.createElement("div",null,c)),z,t.createElement(b,{...k&&!V?{key:`pb-${k}`}:{},rtl:R,theme:A,delay:u,isRunning:n,isIn:L,closeToast:m,hide:d,type:p,style:C,className:O,controlledProgress:V,progress:j||0})))},x=function(e,t){return void 0===t&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},S=u(x("bounce",!0)),O=(u(x("slide",!0)),u(x("zoom")),u(x("flip")),(0,t.forwardRef)(((e,n)=>{const{getToastToRender:r,containerRef:a,isToastActive:i}=g(e),{className:c,style:u,rtl:f,containerId:p}=e;function d(e){const t=o("Toastify__toast-container",`Toastify__toast-container--${e}`,{"Toastify__toast-container--rtl":f});return l(c)?c({position:e,rtl:f,defaultClassName:t}):o(t,s(c))}return(0,t.useEffect)((()=>{n&&(n.current=a.current)}),[]),t.createElement("div",{ref:a,className:"Toastify",id:p},r(((e,n)=>{const r=n.length?{...u}:{...u,pointerEvents:"none"};return t.createElement("div",{className:d(e),style:r,key:`container-${e}`},n.map(((e,r)=>{let{content:o,props:a}=e;return t.createElement(E,{...a,isIn:i(a.toastId),style:{...a.style,"--nth":r+1,"--len":n.length},key:`toast-${a.key}`},o)})))})))})));O.displayName="ToastContainer",O.defaultProps={position:"top-right",transition:S,autoClose:5e3,closeButton:w,pauseOnHover:!0,pauseOnFocusLoss:!0,closeOnClick:!0,draggable:!0,draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};let C,k=new Map,P=[],j=1;function R(){return""+j++}function N(e){return e&&(i(e.toastId)||a(e.toastId))?e.toastId:R()}function _(e,t){return k.size>0?p.emit(0,e,t):P.push({content:e,options:t}),t.toastId}function L(e,t){return{...t,type:t&&t.type||e,toastId:N(t)}}function I(e){return(t,n)=>_(t,L(e,n))}function F(e,t){return _(e,L("default",t))}F.loading=(e,t)=>_(e,L("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),F.promise=function(e,t,n){let r,{pending:o,error:a,success:s}=t;o&&(r=i(o)?F.loading(o,n):F.loading(o.render,{...n,...o}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},u=(e,t,o)=>{if(null==t)return void F.dismiss(r);const a={type:e,...c,...n,data:o},l=i(t)?{render:t}:t;return r?F.update(r,{...a,...l}):F(l.render,{...a,...l}),o},f=l(e)?e():e;return f.then((e=>u("success",s,e))).catch((e=>u("error",a,e))),f},F.success=I("success"),F.info=I("info"),F.error=I("error"),F.warning=I("warning"),F.warn=F.warning,F.dark=(e,t)=>_(e,L("default",{theme:"dark",...t})),F.dismiss=e=>{k.size>0?p.emit(1,e):P=P.filter((t=>null!=e&&t.options.toastId!==e))},F.clearWaitingQueue=function(e){return void 0===e&&(e={}),p.emit(5,e)},F.isActive=e=>{let t=!1;return k.forEach((n=>{n.isToastActive&&n.isToastActive(e)&&(t=!0)})),t},F.update=function(e,t){void 0===t&&(t={}),setTimeout((()=>{const n=function(e,t){let{containerId:n}=t;const r=k.get(n||C);return r&&r.getToast(e)}(e,t);if(n){const{props:r,content:o}=n,a={delay:100,...r,...t,toastId:t.toastId||e,updateId:R()};a.toastId!==e&&(a.staleId=e);const i=a.render||o;delete a.render,_(i,a)}}),0)},F.done=e=>{F.update(e,{progress:1})},F.onChange=e=>(p.on(4,e),()=>{p.off(4,e)}),F.POSITION={TOP_LEFT:"top-left",TOP_RIGHT:"top-right",TOP_CENTER:"top-center",BOTTOM_LEFT:"bottom-left",BOTTOM_RIGHT:"bottom-right",BOTTOM_CENTER:"bottom-center"},F.TYPE={INFO:"info",SUCCESS:"success",WARNING:"warning",ERROR:"error",DEFAULT:"default"},p.on(2,(e=>{C=e.containerId||e,k.set(C,e),P.forEach((e=>{p.emit(0,e.content,e.options)})),P=[]})).on(3,(e=>{k.delete(e.containerId||e),0===k.size&&p.off(0).off(1).off(5)}));var M=n(322),A=n(231);const T=window.ReactDOM;let D=function(e){e()};const V=()=>D,G=Symbol.for("react-redux-context"),z="undefined"!=typeof globalThis?globalThis:{};function B(){var e;if(!t.createContext)return{};const n=null!=(e=z[G])?e:z[G]=new Map;let r=n.get(t.createContext);return r||(r=t.createContext(null),n.set(t.createContext,r)),r}const H=B();function q(e=H){return function(){return(0,t.useContext)(e)}}const U=q();let $=()=>{throw new Error("uSES not initialized!")};const W=(e,t)=>e===t;function Z(e=H){const n=e===H?U:q(e);return function(e,r={}){const{equalityFn:o=W,stabilityCheck:a,noopCheck:i}="function"==typeof r?{equalityFn:r}:r,{store:l,subscription:s,getServerState:c,stabilityCheck:u,noopCheck:f}=n(),p=((0,t.useRef)(!0),(0,t.useCallback)({[e.name]:t=>e(t)}[e.name],[e,u,a])),d=$(s.addNestedSub,l.getState,c||l.getState,p,o);return(0,t.useDebugValue)(d),d}}const Y=Z();n(535),n(357);const K={notify(){},get:()=>[]};const X="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;let J=null;function Q(e=H){const t=e===H?U:q(e);return function(){const{store:e}=t();return e}}const ee=Q();function te(e=H){const t=e===H?ee:Q(e);return function(){return t().dispatch}}const ne=te();var re;function oe(e){return oe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},oe(e)}function ae(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function ie(e){return ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},ie(e)}function le(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function se(e,t){return se=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},se(e,t)}function ce(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}(e=>{$=e})(A.useSyncExternalStoreWithSelector),(e=>{J=e})(M.useSyncExternalStore),re=T.unstable_batchedUpdates,D=re;var ue,fe=function(e){function t(){var e,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=function(e,t){return!t||"object"!==oe(t)&&"function"!=typeof t?le(e):t}(this,(e=ie(t)).call.apply(e,[this].concat(o))),ce(le(n),"state",{bootstrapped:!1}),ce(le(n),"_unsubscribe",void 0),ce(le(n),"handlePersistorState",(function(){n.props.persistor.getState().bootstrapped&&(n.props.onBeforeLift?Promise.resolve(n.props.onBeforeLift()).finally((function(){return n.setState({bootstrapped:!0})})):n.setState({bootstrapped:!0}),n._unsubscribe&&n._unsubscribe())})),n}var n,r;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&se(e,t)}(t,e),n=t,(r=[{key:"componentDidMount",value:function(){this._unsubscribe=this.props.persistor.subscribe(this.handlePersistorState),this.handlePersistorState()}},{key:"componentWillUnmount",value:function(){this._unsubscribe&&this._unsubscribe()}},{key:"render",value:function(){return"function"==typeof this.props.children?this.props.children(this.state.bootstrapped):this.state.bootstrapped?this.props.children:this.props.loading}}])&&ae(n.prototype,r),t}(t.PureComponent);function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},pe.apply(this,arguments)}ce(fe,"defaultProps",{children:null,loading:null}),function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"}(ue||(ue={}));const de="popstate";function me(e,t){if(!1===e||null==e)throw new Error(t)}function ge(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function he(e,t){return{usr:e.state,key:e.key,idx:t}}function ye(e,t,n,r){return void 0===n&&(n=null),pe({pathname:"string"==typeof e?e:e.pathname,search:"",hash:""},"string"==typeof t?we(t):t,{state:n,key:t&&t.key||r||Math.random().toString(36).substr(2,8)})}function ve(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&"?"!==n&&(t+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(t+="#"===r.charAt(0)?r:"#"+r),t}function we(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var be;function Ee(e,t,n){void 0===n&&(n="/");let r=Me(("string"==typeof t?we(t):t).pathname||"/",n);if(null==r)return null;let o=xe(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let n=e.length===t.length&&e.slice(0,-1).every(((e,n)=>e===t[n]));return n?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let a=null;for(let e=0;null==a&&e<o.length;++e){let t=Fe(r);a=Le(o[e],t)}return a}function xe(e,t,n,r){void 0===t&&(t=[]),void 0===n&&(n=[]),void 0===r&&(r="");let o=(e,o,a)=>{let i={relativePath:void 0===a?e.path||"":a,caseSensitive:!0===e.caseSensitive,childrenIndex:o,route:e};i.relativePath.startsWith("/")&&(me(i.relativePath.startsWith(r),'Absolute route path "'+i.relativePath+'" nested under path "'+r+'" is not valid. An absolute child route path must start with the combined path of all its parent routes.'),i.relativePath=i.relativePath.slice(r.length));let l=Ve([r,i.relativePath]),s=n.concat(i);e.children&&e.children.length>0&&(me(!0!==e.index,'Index routes must not have child routes. Please remove all child routes from route path "'+l+'".'),xe(e.children,t,s,l)),(null!=e.path||e.index)&&t.push({path:l,score:_e(l,e.index),routesMeta:s})};return e.forEach(((e,t)=>{var n;if(""!==e.path&&null!=(n=e.path)&&n.includes("?"))for(let n of Se(e.path))o(e,t,n);else o(e,t)})),t}function Se(e){let t=e.split("/");if(0===t.length)return[];let[n,...r]=t,o=n.endsWith("?"),a=n.replace(/\?$/,"");if(0===r.length)return o?[a,""]:[a];let i=Se(r.join("/")),l=[];return l.push(...i.map((e=>""===e?a:[a,e].join("/")))),o&&l.push(...i),l.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"}(be||(be={})),new Set(["lazy","caseSensitive","path","id","index","children"]);const Oe=/^:[\w-]+$/,Ce=3,ke=2,Pe=1,je=10,Re=-2,Ne=e=>"*"===e;function _e(e,t){let n=e.split("/"),r=n.length;return n.some(Ne)&&(r+=Re),t&&(r+=ke),n.filter((e=>!Ne(e))).reduce(((e,t)=>e+(Oe.test(t)?Ce:""===t?Pe:je)),r)}function Le(e,t){let{routesMeta:n}=e,r={},o="/",a=[];for(let e=0;e<n.length;++e){let i=n[e],l=e===n.length-1,s="/"===o?t:t.slice(o.length)||"/",c=Ie({path:i.relativePath,caseSensitive:i.caseSensitive,end:l},s);if(!c)return null;Object.assign(r,c.params);let u=i.route;a.push({params:r,pathname:Ve([o,c.pathname]),pathnameBase:Ge(Ve([o,c.pathnameBase])),route:u}),"/"!==c.pathnameBase&&(o=Ve([o,c.pathnameBase]))}return a}function Ie(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!0),ge("*"===e||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were "'+e.replace(/\*$/,"/*")+'" because the `*` character must always follow a `/` in the pattern. To get rid of this warning, please change the route path to "'+e.replace(/\*$/,"/*")+'".');let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,n)=>(r.push({paramName:t,isOptional:null!=n}),n?"/?([^\\/]+)?":"/([^\\/]+)")));return e.endsWith("*")?(r.push({paramName:"*"}),o+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":""!==e&&"/"!==e&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let a=o[0],i=a.replace(/(.)\/+$/,"$1"),l=o.slice(1),s=r.reduce(((e,t,n)=>{let{paramName:r,isOptional:o}=t;if("*"===r){let e=l[n]||"";i=a.slice(0,a.length-e.length).replace(/(.)\/+$/,"$1")}const s=l[n];return e[r]=o&&!s?void 0:(s||"").replace(/%2F/g,"/"),e}),{});return{params:s,pathname:a,pathnameBase:i,pattern:e}}function Fe(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return ge(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent encoding ('+t+")."),e}}function Me(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&"/"!==r?null:e.slice(n)||"/"}function Ae(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified `to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the `to."+n+'` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.'}function Te(e,t){let n=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t?n.map(((t,n)=>n===e.length-1?t.pathname:t.pathnameBase)):n.map((e=>e.pathnameBase))}function De(e,t,n,r){let o;void 0===r&&(r=!1),"string"==typeof e?o=we(e):(o=pe({},e),me(!o.pathname||!o.pathname.includes("?"),Ae("?","pathname","search",o)),me(!o.pathname||!o.pathname.includes("#"),Ae("#","pathname","hash",o)),me(!o.search||!o.search.includes("#"),Ae("#","search","hash",o)));let a,i=""===e||""===o.pathname,l=i?"/":o.pathname;if(null==l)a=n;else{let e=t.length-1;if(!r&&l.startsWith("..")){let t=l.split("/");for(;".."===t[0];)t.shift(),e-=1;o.pathname=t.join("/")}a=e>=0?t[e]:"/"}let s=function(e,t){void 0===t&&(t="/");let{pathname:n,search:r="",hash:o=""}="string"==typeof e?we(e):e,a=n?n.startsWith("/")?n:function(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?n.length>1&&n.pop():"."!==e&&n.push(e)})),n.length>1?n.join("/"):"/"}(n,t):t;return{pathname:a,search:ze(r),hash:Be(o)}}(o,a),c=l&&"/"!==l&&l.endsWith("/"),u=(i||"."===l)&&n.endsWith("/");return s.pathname.endsWith("/")||!c&&!u||(s.pathname+="/"),s}const Ve=e=>e.join("/").replace(/\/\/+/g,"/"),Ge=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),ze=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",Be=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";Error;const He=["post","put","patch","delete"],qe=(new Set(He),["get",...He]);function Ue(){return Ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ue.apply(this,arguments)}new Set(qe),new Set([301,302,303,307,308]),new Set([307,308]),Symbol("deferred");const $e=t.createContext(null),We=t.createContext(null),Ze=t.createContext(null),Ye=t.createContext(null),Ke=t.createContext({outlet:null,matches:[],isDataRoute:!1}),Xe=t.createContext(null);function Je(){return null!=t.useContext(Ye)}function Qe(){return Je()||me(!1),t.useContext(Ye).location}function et(e){t.useContext(Ze).static||t.useLayoutEffect(e)}function tt(){let{isDataRoute:e}=t.useContext(Ke);return e?function(){let{router:e}=function(e){let n=t.useContext($e);return n||me(!1),n}(st.UseNavigateStable),n=ut(ct.UseNavigateStable),r=t.useRef(!1);return et((()=>{r.current=!0})),t.useCallback((function(t,o){void 0===o&&(o={}),r.current&&("number"==typeof t?e.navigate(t):e.navigate(t,Ue({fromRouteId:n},o)))}),[e,n])}():function(){Je()||me(!1);let e=t.useContext($e),{basename:n,future:r,navigator:o}=t.useContext(Ze),{matches:a}=t.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(Te(a,r.v7_relativeSplatPath)),s=t.useRef(!1);return et((()=>{s.current=!0})),t.useCallback((function(t,r){if(void 0===r&&(r={}),!s.current)return;if("number"==typeof t)return void o.go(t);let a=De(t,JSON.parse(l),i,"path"===r.relative);null==e&&"/"!==n&&(a.pathname="/"===a.pathname?n:Ve([n,a.pathname])),(r.replace?o.replace:o.push)(a,r.state,r)}),[n,o,l,i,e])}()}function nt(e,n){let{relative:r}=void 0===n?{}:n,{future:o}=t.useContext(Ze),{matches:a}=t.useContext(Ke),{pathname:i}=Qe(),l=JSON.stringify(Te(a,o.v7_relativeSplatPath));return t.useMemo((()=>De(e,JSON.parse(l),i,"path"===r)),[e,l,i,r])}function rt(e,n,r,o){Je()||me(!1);let{navigator:a}=t.useContext(Ze),{matches:i}=t.useContext(Ke),l=i[i.length-1],s=l?l.params:{},c=(l&&l.pathname,l?l.pathnameBase:"/");l&&l.route;let u,f=Qe();if(n){var p;let e="string"==typeof n?we(n):n;"/"===c||(null==(p=e.pathname)?void 0:p.startsWith(c))||me(!1),u=e}else u=f;let d=u.pathname||"/",m=d;if("/"!==c){let e=c.replace(/^\//,"").split("/");m="/"+d.replace(/^\//,"").split("/").slice(e.length).join("/")}let g=Ee(e,{pathname:m}),h=function(e,n,r,o){var a;if(void 0===n&&(n=[]),void 0===r&&(r=null),void 0===o&&(o=null),null==e){var i;if(null==(i=r)||!i.errors)return null;e=r.matches}let l=e,s=null==(a=r)?void 0:a.errors;if(null!=s){let e=l.findIndex((e=>e.route.id&&(null==s?void 0:s[e.route.id])));e>=0||me(!1),l=l.slice(0,Math.min(l.length,e+1))}let c=!1,u=-1;if(r&&o&&o.v7_partialHydration)for(let e=0;e<l.length;e++){let t=l[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(u=e),t.route.id){let{loaderData:e,errors:n}=r,o=t.route.loader&&void 0===e[t.route.id]&&(!n||void 0===n[t.route.id]);if(t.route.lazy||o){c=!0,l=u>=0?l.slice(0,u+1):[l[0]];break}}}return l.reduceRight(((e,o,a)=>{let i,f=!1,p=null,d=null;var m;r&&(i=s&&o.route.id?s[o.route.id]:void 0,p=o.route.errorElement||at,c&&(u<0&&0===a?(ft[m="route-fallback"]||(ft[m]=!0),f=!0,d=null):u===a&&(f=!0,d=o.route.hydrateFallbackElement||null)));let g=n.concat(l.slice(0,a+1)),h=()=>{let n;return n=i?p:f?d:o.route.Component?t.createElement(o.route.Component,null):o.route.element?o.route.element:e,t.createElement(lt,{match:o,routeContext:{outlet:e,matches:g,isDataRoute:null!=r},children:n})};return r&&(o.route.ErrorBoundary||o.route.errorElement||0===a)?t.createElement(it,{location:r.location,revalidation:r.revalidation,component:p,error:i,children:h(),routeContext:{outlet:null,matches:g,isDataRoute:!0}}):h()}),null)}(g&&g.map((e=>Object.assign({},e,{params:Object.assign({},s,e.params),pathname:Ve([c,a.encodeLocation?a.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?c:Ve([c,a.encodeLocation?a.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),i,r,o);return n&&h?t.createElement(Ye.Provider,{value:{location:Ue({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:ue.Pop}},h):h}function ot(){let e=function(){var e;let n=t.useContext(Xe),r=function(e){let n=t.useContext(We);return n||me(!1),n}(ct.UseRouteError),o=ut(ct.UseRouteError);return void 0!==n?n:null==(e=r.errors)?void 0:e[o]}(),n=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return t.createElement(t.Fragment,null,t.createElement("h2",null,"Unexpected Application Error!"),t.createElement("h3",{style:{fontStyle:"italic"}},n),r?t.createElement("pre",{style:o},r):null,null)}const at=t.createElement(ot,null);class it extends t.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?t.createElement(Ke.Provider,{value:this.props.routeContext},t.createElement(Xe.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lt(e){let{routeContext:n,match:r,children:o}=e,a=t.useContext($e);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),t.createElement(Ke.Provider,{value:n},o)}var st=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(st||{}),ct=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(ct||{});function ut(e){let n=function(e){let n=t.useContext(Ke);return n||me(!1),n}(),r=n.matches[n.matches.length-1];return r.route.id||me(!1),r.route.id}const ft={};function pt(e){me(!1)}function dt(e){let{basename:n="/",children:r=null,location:o,navigationType:a=ue.Pop,navigator:i,static:l=!1,future:s}=e;Je()&&me(!1);let c=n.replace(/^\/*/,"/"),u=t.useMemo((()=>({basename:c,navigator:i,static:l,future:Ue({v7_relativeSplatPath:!1},s)})),[c,s,i,l]);"string"==typeof o&&(o=we(o));let{pathname:f="/",search:p="",hash:d="",state:m=null,key:g="default"}=o,h=t.useMemo((()=>{let e=Me(f,c);return null==e?null:{location:{pathname:e,search:p,hash:d,state:m,key:g},navigationType:a}}),[c,f,p,d,m,g,a]);return null==h?null:t.createElement(Ze.Provider,{value:u},t.createElement(Ye.Provider,{children:r,value:h}))}function mt(e){let{children:t,location:n}=e;return rt(gt(t),n)}function gt(e,n){void 0===n&&(n=[]);let r=[];return t.Children.forEach(e,((e,o)=>{if(!t.isValidElement(e))return;let a=[...n,o];if(e.type===t.Fragment)return void r.push.apply(r,gt(e.props.children,a));e.type!==pt&&me(!1),e.props.index&&e.props.children&&me(!1);let i={id:e.props.id||a.join("-"),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,loader:e.props.loader,action:e.props.action,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:null!=e.props.ErrorBoundary||null!=e.props.errorElement,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(i.children=gt(e.props.children,a)),r.push(i)})),r}function ht(){return ht=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ht.apply(this,arguments)}function yt(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}t.startTransition,new Promise((()=>{})),t.Component,new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);const vt=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],wt=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"];try{window.__reactRouterVersion="6"}catch(e){}const bt=t.createContext({isTransitioning:!1});new Map;const Et=t.startTransition;function xt(e){let{basename:n,children:r,future:o,window:a}=e,i=t.useRef();var l;null==i.current&&(i.current=(void 0===(l={window:a,v5Compat:!0})&&(l={}),function(e,t,n,r){void 0===r&&(r={});let{window:o=document.defaultView,v5Compat:a=!1}=r,i=o.history,l=ue.Pop,s=null,c=u();function u(){return(i.state||{idx:null}).idx}function f(){l=ue.Pop;let e=u(),t=null==e?null:e-c;c=e,s&&s({action:l,location:d.location,delta:t})}function p(e){let t="null"!==o.location.origin?o.location.origin:o.location.href,n="string"==typeof e?e:ve(e);return n=n.replace(/ $/,"%20"),me(t,"No window.location.(origin|href) available to create URL for href: "+n),new URL(n,t)}null==c&&(c=0,i.replaceState(pe({},i.state,{idx:c}),""));let d={get action(){return l},get location(){return e(o,i)},listen(e){if(s)throw new Error("A history only accepts one active listener");return o.addEventListener(de,f),s=e,()=>{o.removeEventListener(de,f),s=null}},createHref:e=>t(o,e),createURL:p,encodeLocation(e){let t=p(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:function(e,t){l=ue.Push;let r=ye(d.location,e,t);n&&n(r,e),c=u()+1;let f=he(r,c),p=d.createHref(r);try{i.pushState(f,"",p)}catch(e){if(e instanceof DOMException&&"DataCloneError"===e.name)throw e;o.location.assign(p)}a&&s&&s({action:l,location:d.location,delta:1})},replace:function(e,t){l=ue.Replace;let r=ye(d.location,e,t);n&&n(r,e),c=u();let o=he(r,c),f=d.createHref(r);i.replaceState(o,"",f),a&&s&&s({action:l,location:d.location,delta:0})},go:e=>i.go(e)};return d}((function(e,t){let{pathname:n="/",search:r="",hash:o=""}=we(e.location.hash.substr(1));return n.startsWith("/")||n.startsWith(".")||(n="/"+n),ye("",{pathname:n,search:r,hash:o},t.state&&t.state.usr||null,t.state&&t.state.key||"default")}),(function(e,t){let n=e.document.querySelector("base"),r="";if(n&&n.getAttribute("href")){let t=e.location.href,n=t.indexOf("#");r=-1===n?t:t.slice(0,n)}return r+"#"+("string"==typeof t?t:ve(t))}),(function(e,t){ge("/"===e.pathname.charAt(0),"relative pathnames are not supported in hash history.push("+JSON.stringify(t)+")")}),l)));let s=i.current,[c,u]=t.useState({action:s.action,location:s.location}),{v7_startTransition:f}=o||{},p=t.useCallback((e=>{f&&Et?Et((()=>u(e))):u(e)}),[u,f]);return t.useLayoutEffect((()=>s.listen(p)),[s,p]),t.createElement(dt,{basename:n,children:r,location:c.location,navigationType:c.action,navigator:s,future:o})}T.flushSync,t.useId;const St="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,Ot=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ct=t.forwardRef((function(e,n){let r,{onClick:o,relative:a,reloadDocument:i,replace:l,state:s,target:c,to:u,preventScrollReset:f,unstable_viewTransition:p}=e,d=yt(e,vt),{basename:m}=t.useContext(Ze),g=!1;if("string"==typeof u&&Ot.test(u)&&(r=u,St))try{let e=new URL(window.location.href),t=u.startsWith("//")?new URL(e.protocol+u):new URL(u),n=Me(t.pathname,m);t.origin===e.origin&&null!=n?u=n+t.search+t.hash:g=!0}catch(e){}let h=function(e,n){let{relative:r}=void 0===n?{}:n;Je()||me(!1);let{basename:o,navigator:a}=t.useContext(Ze),{hash:i,pathname:l,search:s}=nt(e,{relative:r}),c=l;return"/"!==o&&(c="/"===l?o:Ve([o,l])),a.createHref({pathname:c,search:s,hash:i})}(u,{relative:a}),y=function(e,n){let{target:r,replace:o,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s}=void 0===n?{}:n,c=tt(),u=Qe(),f=nt(e,{relative:l});return t.useCallback((t=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(t,r)){t.preventDefault();let n=void 0!==o?o:ve(u)===ve(f);c(e,{replace:n,state:a,preventScrollReset:i,relative:l,unstable_viewTransition:s})}}),[u,c,f,o,a,r,e,i,l,s])}(u,{replace:l,state:s,target:c,preventScrollReset:f,relative:a,unstable_viewTransition:p});return t.createElement("a",ht({},d,{href:r||h,onClick:g||i?o:function(e){o&&o(e),e.defaultPrevented||y(e)},ref:n,target:c}))})),kt=t.forwardRef((function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:a="",end:i=!1,style:l,to:s,unstable_viewTransition:c,children:u}=e,f=yt(e,wt),p=nt(s,{relative:f.relative}),d=Qe(),m=t.useContext(We),{navigator:g,basename:h}=t.useContext(Ze),y=null!=m&&function(e,n){void 0===n&&(n={});let r=t.useContext(bt);null==r&&me(!1);let{basename:o}=function(e){let n=t.useContext($e);return n||me(!1),n}(Pt.useViewTransitionState),a=nt(e,{relative:n.relative});if(!r.isTransitioning)return!1;let i=Me(r.currentLocation.pathname,o)||r.currentLocation.pathname,l=Me(r.nextLocation.pathname,o)||r.nextLocation.pathname;return null!=Ie(a.pathname,l)||null!=Ie(a.pathname,i)}(p)&&!0===c,v=g.encodeLocation?g.encodeLocation(p).pathname:p.pathname,w=d.pathname,b=m&&m.navigation&&m.navigation.location?m.navigation.location.pathname:null;o||(w=w.toLowerCase(),b=b?b.toLowerCase():null,v=v.toLowerCase()),b&&h&&(b=Me(b,h)||b);const E="/"!==v&&v.endsWith("/")?v.length-1:v.length;let x,S=w===v||!i&&w.startsWith(v)&&"/"===w.charAt(E),O=null!=b&&(b===v||!i&&b.startsWith(v)&&"/"===b.charAt(v.length)),C={isActive:S,isPending:O,isTransitioning:y},k=S?r:void 0;x="function"==typeof a?a(C):[a,S?"active":null,O?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let P="function"==typeof l?l(C):l;return t.createElement(Ct,ht({},f,{"aria-current":k,className:x,ref:n,style:P,to:s,unstable_viewTransition:c}),"function"==typeof u?u(C):u)}));var Pt,jt;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(Pt||(Pt={})),function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"}(jt||(jt={}));const Rt=n.p+"images/logo.4a5282be.png";function Nt(e){var t=e.to,n=e.children;return wp.element.createElement(kt,{to:t,className:function(e){return e.isActive?"text-sky-400 focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400":"focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400"}},n)}const _t=function(e){var t=e.children,n="h-full flex items-center justify-center mb-0";return wp.element.createElement("div",{className:"relative"},wp.element.createElement("header",{className:"bg-white dark:bg-zinc-800 px-10 xl:px-20 items-stretch justify-between h-14 hidden xl:flex"},wp.element.createElement("div",{className:"flex items-center gap-px py-4 "},wp.element.createElement("img",{className:"h-10 w-auto",src:Rt,alt:"SquareWooSync"}),wp.element.createElement("h2",{className:"ml-2 font-bold text-base dark:text-white"},"SQUAREWOOSYNC"),wp.element.createElement("nav",{className:"h-full ml-10"},wp.element.createElement("ul",{className:"flex items-center h-full gap-4 justify-center divide-x divide-gray-200 font-semibold dark:text-zinc-300"},wp.element.createElement("li",{className:n},wp.element.createElement(Nt,{to:"/"},"Dashboard")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/inventory"},"Inventory")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/orders"},"Orders")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement(Nt,{to:"/settings/general"},"Settings")),wp.element.createElement("li",{className:"".concat(n," pl-4")},wp.element.createElement("a",{target:"_blank",href:"https://squarewoosync.com/documentation",className:function(e){return e.isActive?"text-sky-400 focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400":"focus:!shadow-none active:text-sky-400 focus:text-sky-400 hover:!text-sky-400"}},"Documentation"))))),wp.element.createElement("div",{className:"flex items-center justify-end"},wp.element.createElement("a",{href:"https://squarewoosync.com",target:"_blank",className:" h-full bg-sky-400 flex justify-center items-center w-40 text-white font-bold"},"Upgrade to Pro"))),wp.element.createElement("main",{className:"mx-auto pb-20 mt-10 px-10 xl:px-20"},t))};function Lt(){return wp.element.createElement("div",{className:"bg-white dark:bg-transparent dark:border dark:border-zinc-700 p-6 rounded-xl not-prose grid grid-cols-1 gap-6 sm:grid-cols-2 w-full dark:text-zinc-100"},wp.element.createElement("header",{className:"mb-2 col-span-full flex flex-col"},wp.element.createElement("p",{className:"text-sm font-medium text-sky-500 dark:text-sky-400"},"Introduction"),wp.element.createElement("h1",{className:"text-3xl tracking-tight text-slate-900 font-bold dark:text-zinc-100"},"Getting started"),wp.element.createElement("p",{className:"text-xl text-gray-600 mt-2 dark:text-zinc-100"},"Welcome to SquareWooSync. See below to learn how to start importing and synchronizing products with Square and Woo.")),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient",gradientTransform:"matrix(0 21 -21 0 20 11)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient-dark-1",gradientTransform:"matrix(0 22.75 -22.75 0 16 6.25)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S3:-gradient-dark-2",gradientTransform:"matrix(0 14 -14 0 16 10)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"20",cy:"20",r:"12",fill:"url(#:S3:-gradient)"}),wp.element.createElement("g",{fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 9v14l12 6V15L3 9Z"}),wp.element.createElement("path",{d:"M27 9v14l-12 6V15l12-6Z"})),wp.element.createElement("path",{d:"M11 4h8v2l6 3-10 6L5 9l6-3V4Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)]"}),wp.element.createElement("g",{className:"stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M20 5.5 27 9l-12 6L3 9l7-3.5"}),wp.element.createElement("path",{d:"M20 5c0 1.105-2.239 2-5 2s-5-.895-5-2m10 0c0-1.105-2.239-2-5-2s-5 .895-5 2m10 0v3c0 1.105-2.239 2-5 2s-5-.895-5-2V5"}))),wp.element.createElement("g",{className:"hidden ",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M17.676 3.38a3.887 3.887 0 0 0-3.352 0l-9 4.288C3.907 8.342 3 9.806 3 11.416v9.168c0 1.61.907 3.073 2.324 3.748l9 4.288a3.887 3.887 0 0 0 3.352 0l9-4.288C28.093 23.657 29 22.194 29 20.584v-9.168c0-1.61-.907-3.074-2.324-3.748l-9-4.288Z",stroke:"url(#:S3:-gradient-dark-1)"}),wp.element.createElement("path",{d:"M16.406 8.087a.989.989 0 0 0-.812 0l-7 3.598A1.012 1.012 0 0 0 8 12.61v6.78c0 .4.233.762.594.925l7 3.598a.989.989 0 0 0 .812 0l7-3.598c.361-.163.594-.525.594-.925v-6.78c0-.4-.233-.762-.594-.925l-7-3.598Z",fill:"url(#:S3:-gradient-dark-2)",stroke:"url(#:S3:-gradient-dark-2)"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/inventory"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Start a new import")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Click here to begin importing or syncronizing products from Square to Woo"))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S1:-gradient",gradientTransform:"matrix(0 21 -21 0 12 3)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S1:-gradient-dark",gradientTransform:"matrix(0 21 -21 0 16 7)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"12",cy:"12",r:"12",fill:"url(#:S1:-gradient)"}),wp.element.createElement("path",{d:"m8 8 9 21 2-10 10-2L8 8Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),wp.element.createElement("g",{className:"hidden "},wp.element.createElement("path",{d:"m4 4 10.286 24 2.285-11.429L28 14.286 4 4Z",fill:"url(#:S1:-gradient-dark)",stroke:"url(#:S1:-gradient-dark)",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"https://squarewoosync.com/documentation",target:"_blank"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Installation")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Step-by-step guides to setting up your Square account and Woo to talk to each other"))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S2:-gradient",gradientTransform:"matrix(0 21 -21 0 20 3)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S2:-gradient-dark",gradientTransform:"matrix(0 22.75 -22.75 0 16 6.25)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"20",cy:"12",r:"12",fill:"url(#:S2:-gradient)"}),wp.element.createElement("g",{className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",fillOpacity:"0.5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},wp.element.createElement("path",{d:"M3 5v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M18 17v10a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V17a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M18 5v4a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2Z"}),wp.element.createElement("path",{d:"M3 25v2a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2v-2a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2Z"}))),wp.element.createElement("g",{className:"hidden ",fill:"url(#:S2:-gradient-dark)"},wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 17V4a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Zm16 10v-9a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-6a2 2 0 0 1-2-2Zm0-23v5a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-8a1 1 0 0 0-1 1ZM3 28v-3a1 1 0 0 1 1-1h9a1 1 0 0 1 1 1v3a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1Z"}),wp.element.createElement("path",{d:"M2 4v13h2V4H2Zm2-2a2 2 0 0 0-2 2h2V2Zm8 0H4v2h8V2Zm2 2a2 2 0 0 0-2-2v2h2Zm0 13V4h-2v13h2Zm-2 2a2 2 0 0 0 2-2h-2v2Zm-8 0h8v-2H4v2Zm-2-2a2 2 0 0 0 2 2v-2H2Zm16 1v9h2v-9h-2Zm3-3a3 3 0 0 0-3 3h2a1 1 0 0 1 1-1v-2Zm6 0h-6v2h6v-2Zm3 3a3 3 0 0 0-3-3v2a1 1 0 0 1 1 1h2Zm0 9v-9h-2v9h2Zm-3 3a3 3 0 0 0 3-3h-2a1 1 0 0 1-1 1v2Zm-6 0h6v-2h-6v2Zm-3-3a3 3 0 0 0 3 3v-2a1 1 0 0 1-1-1h-2Zm2-18V4h-2v5h2Zm0 0h-2a2 2 0 0 0 2 2V9Zm8 0h-8v2h8V9Zm0 0v2a2 2 0 0 0 2-2h-2Zm0-5v5h2V4h-2Zm0 0h2a2 2 0 0 0-2-2v2Zm-8 0h8V2h-8v2Zm0 0V2a2 2 0 0 0-2 2h2ZM2 25v3h2v-3H2Zm2-2a2 2 0 0 0-2 2h2v-2Zm9 0H4v2h9v-2Zm2 2a2 2 0 0 0-2-2v2h2Zm0 3v-3h-2v3h2Zm-2 2a2 2 0 0 0 2-2h-2v2Zm-9 0h9v-2H4v2Zm-2-2a2 2 0 0 0 2 2v-2H2Z"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#import-data",target:"_blank"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Controlling your import data")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Learn how the internals work and how you can choose which data you would like to sync."))),wp.element.createElement("div",{className:"group relative rounded-xl border border-slate-400 "},wp.element.createElement("div",{className:"absolute -inset-px rounded-xl border-2 border-transparent opacity-0 [background:linear-gradient(var(--quick-links-hover-bg,theme(colors.sky.50)),var(--quick-links-hover-bg,theme(colors.sky.50)))_padding-box,linear-gradient(to_top,theme(colors.sky.400),theme(colors.cyan.400),theme(colors.sky.500))_border-box] group-hover:opacity-100 "}),wp.element.createElement("div",{className:"relative overflow-hidden rounded-xl p-6"},wp.element.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 32 32",fill:"none",className:"h-8 w-8 [--icon-foreground:theme(colors.slate.900)] [--icon-background:theme(colors.white)]"},wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S4:-gradient",gradientTransform:"matrix(0 21 -21 0 12 11)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"})),wp.element.createElement("radialGradient",{cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",id:":S4:-gradient-dark",gradientTransform:"matrix(0 24.5 -24.5 0 16 5.5)"},wp.element.createElement("stop",{stopColor:"#0EA5E9"}),wp.element.createElement("stop",{stopColor:"#22D3EE",offset:".527"}),wp.element.createElement("stop",{stopColor:"#818CF8",offset:"1"}))),wp.element.createElement("g",{className:""},wp.element.createElement("circle",{cx:"12",cy:"20",r:"12",fill:"url(#:S4:-gradient)"}),wp.element.createElement("path",{d:"M27 12.13 19.87 5 13 11.87v14.26l14-14Z",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",fillOpacity:"0.5",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),wp.element.createElement("path",{d:"M3 3h10v22a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V3Z",className:"fill-[var(--icon-background)]",fillOpacity:"0.5"}),wp.element.createElement("path",{d:"M3 9v16a4 4 0 0 0 4 4h2a4 4 0 0 0 4-4V9M3 9V3h10v6M3 9h10M3 15h10M3 21h10",className:"stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),wp.element.createElement("path",{d:"M29 29V19h-8.5L13 26c0 1.5-2.5 3-5 3h21Z",fillOpacity:"0.5",className:"fill-[var(--icon-background)] stroke-[color:var(--icon-foreground)]",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})),wp.element.createElement("g",{className:"hidden "},wp.element.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3 2a1 1 0 0 0-1 1v21a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H3Zm16.752 3.293a1 1 0 0 0-1.593.244l-1.045 2A1 1 0 0 0 17 8v13a1 1 0 0 0 1.71.705l7.999-8.045a1 1 0 0 0-.002-1.412l-6.955-6.955ZM26 18a1 1 0 0 0-.707.293l-10 10A1 1 0 0 0 16 30h13a1 1 0 0 0 1-1V19a1 1 0 0 0-1-1h-3ZM5 18a1 1 0 1 0 0 2h6a1 1 0 1 0 0-2H5Zm-1-5a1 1 0 0 1 1-1h6a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1Zm1-7a1 1 0 0 0 0 2h6a1 1 0 1 0 0-2H5Z",fill:"url(#:S4:-gradient-dark)"}))),wp.element.createElement("h2",{className:"mt-4 text-base text-slate-900 "},wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/settings/general"},wp.element.createElement("span",{className:"absolute -inset-px rounded-xl"}),"Settings")),wp.element.createElement("p",{className:"mt-1 text-sm text-slate-700 "},"Manage your access token, import data and webhook url for automatic synchronization"))))}const It=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"}))})),Ft=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"}))})),Mt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"}))}));function At(){return At=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},At.apply(this,arguments)}var Tt=[{icon:wp.element.createElement(It,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Sales/License support",description:"Wish to talk to us about your license or have another question related to sales?"},{icon:wp.element.createElement(Ft,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Bug reports",description:"Found a bug? Let us know so we can jump on it right away! And thank you for your help!"},{icon:wp.element.createElement(Mt,{className:"h-6 w-6 text-white","aria-hidden":"true"}),title:"Technical support",description:"Can't figure out how to set up this plugin or having another technical issue? Let us know and we would be glad to assist you."}],Dt=function(e){var t=e.icon,n=e.title,r=e.description;return wp.element.createElement("div",{className:"flex gap-x-4"},wp.element.createElement("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-sky-600"},t),wp.element.createElement("div",null,wp.element.createElement("h3",{className:"text-sm font-semibold text-gray-900"},n),wp.element.createElement("p",{className:"text-gray-600"},r),wp.element.createElement("p",null,wp.element.createElement("a",{href:"https://squarewoosync.com/#contact",target:"_blank",className:"text-sm font-semibold text-sky-600"},"Contact us"," ",wp.element.createElement("span",{"aria-hidden":"true"},"→")))))};function Vt(){return wp.element.createElement("div",{className:"isolate bg-white p-5 rounded-xl"},wp.element.createElement("div",{className:""},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Support")),wp.element.createElement("div",{className:"mt-3 space-y-4"},Tt.map((function(e,t){return wp.element.createElement(Dt,At({key:t},e))}))))}const Gt=window.wp.apiFetch;var zt=n.n(Gt);const Bt=window.moment;var Ht=n.n(Bt);const qt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))})),Ut=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))})),$t=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))})),Wt=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"}))}));function Zt(e){return Zt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zt(e)}function Yt(){Yt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Zt(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Zt(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Kt(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Xt(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Jt=function(){var t=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Xt(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xt(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)([]),2),n=t[0],r=t[1];(0,e.useEffect)((function(){var e=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Kt(a,r,o,i,l,"next",e)}function l(e){Kt(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Yt().mark((function e(){var t,n;return Yt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,zt()({path:"/sws/v1/logs",method:"GET"});case 2:(t=e.sent).logs&&(n=t.logs.reduce((function(e,t){return e.find((function(e){return e.id===t.id}))?e:e.concat([t])}),[]).sort((function(e,t){return Ht()(e.timestamp,"YYYY-MM-DD HH:mm:ss").diff(Ht()(t.timestamp,"YYYY-MM-DD HH:mm:ss"))})),console.log(n),r(n));case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var o=function(e){try{return JSON.parse(e),!0}catch(e){return!1}};return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:" bg-white rounded-xl p-5 w-full"},wp.element.createElement("h3",{className:"text-base font-semibold text-gray-900 mb-6 flex justify-start items-center gap-2"},wp.element.createElement(Wt,{className:"w-6 h-6"}),"Sync Feed",wp.element.createElement("span",{className:"text-xs text-gray-500 font-normal mt-[1px] -ml-1"}," ","- Shows last 50 logs")),n.length<1&&wp.element.createElement("p",null,"No data, starting import/syncing to view logs"),wp.element.createElement("ul",{role:"list",className:"overflow-auto max-h-[1042px] h-auto overflow-y-auto "},n.reverse().map((function(e,t){return wp.element.createElement("li",{key:e.id},wp.element.createElement("div",{className:"relative pb-4"},t!==n.length-1?wp.element.createElement("span",{className:"absolute left-5 top-5 -ml-px h-full w-0.5 bg-gray-200","aria-hidden":"true"}):null,wp.element.createElement("div",{className:"relative flex items-start space-x-3"},wp.element.createElement(React.Fragment,null,wp.element.createElement("div",null,wp.element.createElement("div",{className:"relative px-1"},wp.element.createElement("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-gray-100 ring-8 ring-white"},"success"===e.log_level?wp.element.createElement(qt,{className:"h-5 w-5 text-green-500","aria-hidden":"true"}):"error"===e.log_level||"failed"===e.log_level?wp.element.createElement(Ut,{className:"h-5 w-5 text-red-500","aria-hidden":"true"}):wp.element.createElement($t,{className:"h-5 w-5 text-blue-500","aria-hidden":"true"})))),wp.element.createElement("div",{className:"min-w-0 flex-1 py-0"},wp.element.createElement("div",{className:"text-sm text-gray-500"},wp.element.createElement("p",{className:"whitespace-nowrap text-xs"},Ht()(e.timestamp)&&Ht()(e.timestamp).format("MMM DD HH:MM")),wp.element.createElement("p",{className:"mr-0.5"},e.message.length<1&&"failed"===e.log_level?"Unkown sync error":e.message),o(e.context)&&JSON.parse(e.context).product_id&&"success"===e.log_level&&wp.element.createElement("a",{className:"mr-0.5 text-xs mt-4 text-blue-600",href:"/wp-admin/post.php?post=".concat(JSON.parse(e.context).product_id,"&action=edit"),target:"_blank"},"View product"),o(e.context)&&JSON.parse(e.context).error_message&&"error"===e.log_level&&wp.element.createElement("p",{className:"text-xs italic text-red-800"},JSON.parse(e.context).error_message)))))))})))))};var Qt="squarewoosync";function en(){var t=Qe();return(0,e.useEffect)((function(){!function(){var e=jQuery,t=e("#toplevel_page_"+Qt),n=window.location.href,r=n.substr(n.indexOf("admin.php"));e("ul.wp-submenu li",t).removeClass("current"),t.on("click","a",(function(){var n=e(this);e("ul.wp-submenu li",t).removeClass("current"),n.hasClass("wp-has-submenu")?e("li.wp-first-item",t).addClass("current"):n.parents("li").addClass("current")}));var o=r.split("/");e("ul.wp-submenu a",t).each((function(t,n){void 0!==o[1]&&o[1];var a=!1;e(n).attr("href")===r&&(a=!0),a&&e(n).parent().addClass("current")}))}()}),[t.pathname]),null}const tn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{d:"M2 3a1 1 0 0 0-1 1v1a1 1 0 0 0 1 1h16a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H2Z"}),t.createElement("path",{fillRule:"evenodd",d:"M2 7.5h16l-.811 7.71a2 2 0 0 1-1.99 1.79H4.802a2 2 0 0 1-1.99-1.79L2 7.5ZM7 11a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1Z",clipRule:"evenodd"}))})),nn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM6.75 9.25a.75.75 0 0 0 0 1.5h4.59l-2.1 1.95a.75.75 0 0 0 1.02 1.1l3.5-3.25a.75.75 0 0 0 0-1.1l-3.5-3.25a.75.75 0 1 0-1.02 1.1l2.1 1.95H6.75Z",clipRule:"evenodd"}))})),rn=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"}))}));function on(e){var t=e.getInventory,n=e.validToken;return wp.element.createElement("div",{className:"px-4 py-32 sm:px-6 flex items-center justify-center flex-col"},wp.element.createElement(rn,{className:"mx-auto h-12 w-12 text-gray-400"}),wp.element.createElement("h3",{className:"mt-2 text-sm font-semibold text-gray-900"},"Square Inventory"),wp.element.createElement("p",{className:"mt-1 text-sm text-gray-500"},"Get started by loading your Square's inventory"),wp.element.createElement("div",{className:"mt-6"},n?wp.element.createElement("button",{type:"button",onClick:t,className:"inline-flex items-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},wp.element.createElement(tn,{className:"-ml-0.5 mr-1.5 h-5 w-5","aria-hidden":"true"}),"Load inventory"):wp.element.createElement("div",{className:"flex flex-col gap-2 items-center"},wp.element.createElement("p",{className:"text-red-500 text-center text-base"},"Access Token not set"),wp.element.createElement("a",{href:"/wp-admin/admin.php?page=squarewoosync#/settings/general",className:"inline-flex items-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},"Set access token",wp.element.createElement(nn,{className:"h-5 w-5 ml-1","aria-hidden":"true"})))))}function an(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const ln=function(){return wp.element.createElement("div",null,wp.element.createElement("div",{className:"px-4 py-5 sm:px-6"},wp.element.createElement("div",{className:"flex flex-wrap items-center justify-start sm:flex-nowrap"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-gray-900"},"Square Inventory"))),wp.element.createElement("div",{className:"overflow-x-auto"},wp.element.createElement("table",{className:"whitespace-nowrap text-left bg-white w-full"},wp.element.createElement("colgroup",null,wp.element.createElement("col",{className:"w-full lg:w-1/12"}),wp.element.createElement("col",{className:"w-full lg:w-2/12"})),wp.element.createElement("thead",{className:"border-b border-gray-900/10 text-sm leading-6 text-gray-900"},wp.element.createElement("tr",null,wp.element.createElement("th",{scope:"col",className:"py-2 pl-4 pr-8 font-semibold sm:pl-6 lg:pl-8"},"SKU"),wp.element.createElement("th",{scope:"col",className:"py-2 pl-4 pr-8 font-semibold sm:pl-6 lg:pl-8"},"Product Name"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Type"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Price"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-8 font-semibold sm:table-cell"},"Categories"),wp.element.createElement("th",{scope:"col",className:"py-2 pl-0 pr-4 text-right font-semibold sm:pr-8 sm:text-left lg:pr-20"},"Status"),wp.element.createElement("th",{scope:"col",className:"hidden py-2 pl-0 pr-4 text-right font-semibold sm:table-cell sm:pr-6 lg:pr-8"},"Actions"))),wp.element.createElement("tbody",{className:"divide-y divide-gray-200 animate-pulse"},(e=Array(3),function(e){if(Array.isArray(e))return an(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return an(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?an(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e,t){return wp.element.createElement("tr",{key:t},wp.element.createElement("td",{colSpan:7,className:"py-2 pl-4 pr-8 sm:pl-6 lg:pl-8"},wp.element.createElement("div",{className:"h-6 bg-gray-200 rounded"})))}))))));var e};function sn(e,t){return"function"==typeof e?e(t):e}function cn(e,t){return n=>{t.setState((t=>({...t,[e]:sn(n,t[e])})))}}function un(e){return e instanceof Function}function fn(e,t,n){let r,o=[];return a=>{let i;n.key&&n.debug&&(i=Date.now());const l=e(a);if(l.length===o.length&&!l.some(((e,t)=>o[t]!==e)))return r;let s;if(o=l,n.key&&n.debug&&(s=Date.now()),r=t(...l),null==n||null==n.onChange||n.onChange(r),n.key&&n.debug&&null!=n&&n.debug()){const e=Math.round(100*(Date.now()-i))/100,t=Math.round(100*(Date.now()-s))/100,r=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,null==n?void 0:n.key)}return r}}function pn(e,t,n,r){return{debug:()=>{var n;return null!=(n=null==e?void 0:e.debugAll)?n:e[t]},key:!1,onChange:r}}const dn="debugHeaders";function mn(e,t,n){var r;let o={id:null!=(r=n.id)?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(o),e},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach((t=>{null==t.createHeader||t.createHeader(o,e)})),o}const gn={createTable:e=>{e.getHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,r,o)=>{var a,i;const l=null!=(a=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?a:[],s=null!=(i=null==o?void 0:o.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?i:[];return hn(t,[...l,...n.filter((e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id)))),...s],e)}),pn(e.options,dn)),e.getCenterHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((t,n,r,o)=>hn(t,n=n.filter((e=>!(null!=r&&r.includes(e.id)||null!=o&&o.includes(e.id)))),e,"center")),pn(e.options,dn)),e.getLeftHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left]),((t,n,r)=>{var o;const a=null!=(o=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[];return hn(t,a,e,"left")}),pn(e.options,dn)),e.getRightHeaderGroups=fn((()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right]),((t,n,r)=>{var o;const a=null!=(o=null==r?void 0:r.map((e=>n.find((t=>t.id===e)))).filter(Boolean))?o:[];return hn(t,a,e,"right")}),pn(e.options,dn)),e.getFooterGroups=fn((()=>[e.getHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getLeftFooterGroups=fn((()=>[e.getLeftHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getCenterFooterGroups=fn((()=>[e.getCenterHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getRightFooterGroups=fn((()=>[e.getRightHeaderGroups()]),(e=>[...e].reverse()),pn(e.options,dn)),e.getFlatHeaders=fn((()=>[e.getHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getLeftFlatHeaders=fn((()=>[e.getLeftHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getCenterFlatHeaders=fn((()=>[e.getCenterHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getRightFlatHeaders=fn((()=>[e.getRightHeaderGroups()]),(e=>e.map((e=>e.headers)).flat()),pn(e.options,dn)),e.getCenterLeafHeaders=fn((()=>[e.getCenterFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getLeftLeafHeaders=fn((()=>[e.getLeftFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getRightLeafHeaders=fn((()=>[e.getRightFlatHeaders()]),(e=>e.filter((e=>{var t;return!(null!=(t=e.subHeaders)&&t.length)}))),pn(e.options,dn)),e.getLeafHeaders=fn((()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()]),((e,t,n)=>{var r,o,a,i,l,s;return[...null!=(r=null==(o=e[0])?void 0:o.headers)?r:[],...null!=(a=null==(i=t[0])?void 0:i.headers)?a:[],...null!=(l=null==(s=n[0])?void 0:s.headers)?l:[]].map((e=>e.getLeafHeaders())).flat()}),pn(e.options,dn))}};function hn(e,t,n,r){var o,a;let i=0;const l=function(e,t){void 0===t&&(t=1),i=Math.max(i,t),e.filter((e=>e.getIsVisible())).forEach((e=>{var n;null!=(n=e.columns)&&n.length&&l(e.columns,t+1)}),0)};l(e);let s=[];const c=(e,t)=>{const o={depth:t,id:[r,`${t}`].filter(Boolean).join("_"),headers:[]},a=[];e.forEach((e=>{const i=[...a].reverse()[0];let l,s=!1;if(e.column.depth===o.depth&&e.column.parent?l=e.column.parent:(l=e.column,s=!0),i&&(null==i?void 0:i.column)===l)i.subHeaders.push(e);else{const o=mn(n,l,{id:[r,t,l.id,null==e?void 0:e.id].filter(Boolean).join("_"),isPlaceholder:s,placeholderId:s?`${a.filter((e=>e.column===l)).length}`:void 0,depth:t,index:a.length});o.subHeaders.push(e),a.push(o)}o.headers.push(e),e.headerGroup=o})),s.push(o),t>0&&c(a,t-1)},u=t.map(((e,t)=>mn(n,e,{depth:i,index:t})));c(u,i-1),s.reverse();const f=e=>e.filter((e=>e.column.getIsVisible())).map((e=>{let t=0,n=0,r=[0];return e.subHeaders&&e.subHeaders.length?(r=[],f(e.subHeaders).forEach((e=>{let{colSpan:n,rowSpan:o}=e;t+=n,r.push(o)}))):t=1,n+=Math.min(...r),e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}}));return f(null!=(o=null==(a=s[0])?void 0:a.headers)?o:[]),s}const yn={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},vn={getDefaultColumnDef:()=>yn,getInitialState:e=>({columnSizing:{},columnSizingInfo:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]},...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:cn("columnSizing",e),onColumnSizingInfoChange:cn("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const a=t.getState().columnSizing[e.id];return Math.min(Math.max(null!=(n=e.columnDef.minSize)?n:yn.minSize,null!=(r=null!=a?a:e.columnDef.size)?r:yn.size),null!=(o=e.columnDef.maxSize)?o:yn.maxSize)},e.getStart=fn((e=>[e,Qn(t,e),t.getState().columnSizing]),((t,n)=>n.slice(0,e.getIndex(t)).reduce(((e,t)=>e+t.getSize()),0)),pn(t.options,"debugColumns")),e.getAfter=fn((e=>[e,Qn(t,e),t.getState().columnSizing]),((t,n)=>n.slice(e.getIndex(t)+1).reduce(((e,t)=>e+t.getSize()),0)),pn(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing((t=>{let{[e.id]:n,...r}=t;return r}))},e.getCanResize=()=>{var n,r;return(null==(n=e.columnDef.enableResizing)||n)&&(null==(r=t.options.enableColumnResizing)||r)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0;const n=e=>{var r;e.subHeaders.length?e.subHeaders.forEach(n):t+=null!=(r=e.column.getSize())?r:0};return n(e),t},e.getStart=()=>{if(e.index>0){const t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=null==r?void 0:r.getCanResize();return a=>{if(!r||!o)return;if(null==a.persist||a.persist(),bn(a)&&a.touches&&a.touches.length>1)return;const i=e.getSize(),l=e?e.getLeafHeaders().map((e=>[e.column.id,e.column.getSize()])):[[r.id,r.getSize()]],s=bn(a)?Math.round(a.touches[0].clientX):a.clientX,c={},u=(e,n)=>{"number"==typeof n&&(t.setColumnSizingInfo((e=>{var r,o;const a="rtl"===t.options.columnResizeDirection?-1:1,i=(n-(null!=(r=null==e?void 0:e.startOffset)?r:0))*a,l=Math.max(i/(null!=(o=null==e?void 0:e.startSize)?o:0),-.999999);return e.columnSizingStart.forEach((e=>{let[t,n]=e;c[t]=Math.round(100*Math.max(n+n*l,0))/100})),{...e,deltaOffset:i,deltaPercentage:l}})),"onChange"!==t.options.columnResizeMode&&"end"!==e||t.setColumnSizing((e=>({...e,...c}))))},f=e=>u("move",e),p=e=>{u("end",e),t.setColumnSizingInfo((e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]})))},d=n||"undefined"!=typeof document?document:null,m={moveHandler:e=>f(e.clientX),upHandler:e=>{null==d||d.removeEventListener("mousemove",m.moveHandler),null==d||d.removeEventListener("mouseup",m.upHandler),p(e.clientX)}},g={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0].clientX),!1),upHandler:e=>{var t;null==d||d.removeEventListener("touchmove",g.moveHandler),null==d||d.removeEventListener("touchend",g.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),p(null==(t=e.touches[0])?void 0:t.clientX)}},h=!!function(){if("boolean"==typeof wn)return wn;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch(t){e=!1}return wn=e,wn}()&&{passive:!1};bn(a)?(null==d||d.addEventListener("touchmove",g.moveHandler,h),null==d||d.addEventListener("touchend",g.upHandler,h)):(null==d||d.addEventListener("mousemove",m.moveHandler,h),null==d||d.addEventListener("mouseup",m.upHandler,h)),t.setColumnSizingInfo((e=>({...e,startOffset:s,startSize:i,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:r.id})))}}},createTable:e=>{e.setColumnSizing=t=>null==e.options.onColumnSizingChange?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>null==e.options.onColumnSizingInfoChange?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:null!=(n=e.initialState.columnSizing)?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}:null!=(n=e.initialState.columnSizingInfo)?n:{startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]})},e.getTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getLeftTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getLeftHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getCenterTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getCenterHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0},e.getRightTotalSize=()=>{var t,n;return null!=(t=null==(n=e.getRightHeaderGroups()[0])?void 0:n.headers.reduce(((e,t)=>e+t.getSize()),0))?t:0}}};let wn=null;function bn(e){return"touchstart"===e.type}const En={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:cn("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetExpanded)?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue((()=>{e.resetExpanded(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setExpanded=t=>null==e.options.onExpandedChange?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{(null!=t?t:!e.getIsAllRowsExpanded())?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{var n,r;e.setExpanded(t?{}:null!=(n=null==(r=e.initialState)?void 0:r.expanded)?n:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some((e=>e.getCanExpand())),e.getToggleAllRowsExpandedHandler=()=>t=>{null==t.persist||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const t=e.getState().expanded;return!0===t||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{const t=e.getState().expanded;return"boolean"==typeof t?!0===t:!!Object.keys(t).length&&!e.getRowModel().flatRows.some((e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(!0===e.getState().expanded?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach((e=>{const n=e.split(".");t=Math.max(t,n.length)})),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded((r=>{var o;const a=!0===r||!(null==r||!r[e.id]);let i={};if(!0===r?Object.keys(t.getRowModel().rowsById).forEach((e=>{i[e]=!0})):i=r,n=null!=(o=n)?o:!a,!a&&n)return{...i,[e.id]:!0};if(a&&!n){const{[e.id]:t,...n}=i;return n}return r}))},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!(null!=(n=null==t.options.getIsRowExpanded?void 0:t.options.getIsRowExpanded(e))?n:!0===r||(null==r?void 0:r[e.id]))},e.getCanExpand=()=>{var n,r,o;return null!=(n=null==t.options.getRowCanExpand?void 0:t.options.getRowCanExpand(e))?n:(null==(r=t.options.enableExpanding)||r)&&!(null==(o=e.subRows)||!o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},xn=(e,t,n)=>{var r;const o=n.toLowerCase();return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())||null==(r=r.toLowerCase())?void 0:r.includes(o))};xn.autoRemove=e=>In(e);const Sn=(e,t,n)=>{var r;return Boolean(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.includes(n))};Sn.autoRemove=e=>In(e);const On=(e,t,n)=>{var r;return(null==(r=e.getValue(t))||null==(r=r.toString())?void 0:r.toLowerCase())===(null==n?void 0:n.toLowerCase())};On.autoRemove=e=>In(e);const Cn=(e,t,n)=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)};Cn.autoRemove=e=>In(e)||!(null!=e&&e.length);const kn=(e,t,n)=>!n.some((n=>{var r;return!(null!=(r=e.getValue(t))&&r.includes(n))}));kn.autoRemove=e=>In(e)||!(null!=e&&e.length);const Pn=(e,t,n)=>n.some((n=>{var r;return null==(r=e.getValue(t))?void 0:r.includes(n)}));Pn.autoRemove=e=>In(e)||!(null!=e&&e.length);const jn=(e,t,n)=>e.getValue(t)===n;jn.autoRemove=e=>In(e);const Rn=(e,t,n)=>e.getValue(t)==n;Rn.autoRemove=e=>In(e);const Nn=(e,t,n)=>{let[r,o]=n;const a=e.getValue(t);return a>=r&&a<=o};Nn.resolveFilterValue=e=>{let[t,n]=e,r="number"!=typeof t?parseFloat(t):t,o="number"!=typeof n?parseFloat(n):n,a=null===t||Number.isNaN(r)?-1/0:r,i=null===n||Number.isNaN(o)?1/0:o;if(a>i){const e=a;a=i,i=e}return[a,i]},Nn.autoRemove=e=>In(e)||In(e[0])&&In(e[1]);const Ln={includesString:xn,includesStringSensitive:Sn,equalsString:On,arrIncludes:Cn,arrIncludesAll:kn,arrIncludesSome:Pn,equals:jn,weakEquals:Rn,inNumberRange:Nn};function In(e){return null==e||""===e}const Fn={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:cn("columnFilters",e),onGlobalFilterChange:cn("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=null==(n=e.getCoreRowModel().flatRows[0])||null==(n=n._getAllCellsByColumnId()[t.id])?void 0:n.getValue();return"string"==typeof r||"number"==typeof r}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"string"==typeof r?Ln.includesString:"number"==typeof r?Ln.inNumberRange:"boolean"==typeof r||null!==r&&"object"==typeof r?Ln.equals:Array.isArray(r)?Ln.arrIncludes:Ln.weakEquals},e.getFilterFn=()=>{var n,r;return un(e.columnDef.filterFn)?e.columnDef.filterFn:"auto"===e.columnDef.filterFn?e.getAutoFilterFn():null!=(n=null==(r=t.options.filterFns)?void 0:r[e.columnDef.filterFn])?n:Ln[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return(null==(n=e.columnDef.enableColumnFilter)||n)&&(null==(r=t.options.enableColumnFilters)||r)&&(null==(o=t.options.enableFilters)||o)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,o,a;return(null==(n=e.columnDef.enableGlobalFilter)||n)&&(null==(r=t.options.enableGlobalFilter)||r)&&(null==(o=t.options.enableFilters)||o)&&(null==(a=null==t.options.getColumnCanGlobalFilter?void 0:t.options.getColumnCanGlobalFilter(e))||a)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return null==(n=t.getState().columnFilters)||null==(n=n.find((t=>t.id===e.id)))?void 0:n.value},e.getFilterIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().columnFilters)?void 0:r.findIndex((t=>t.id===e.id)))?n:-1},e.setFilterValue=n=>{t.setColumnFilters((t=>{const r=e.getFilterFn(),o=null==t?void 0:t.find((t=>t.id===e.id)),a=sn(n,o?o.value:void 0);var i;if(Mn(r,a,e))return null!=(i=null==t?void 0:t.filter((t=>t.id!==e.id)))?i:[];const l={id:e.id,value:a};var s;return o?null!=(s=null==t?void 0:t.map((t=>t.id===e.id?l:t)))?s:[]:null!=t&&t.length?[...t,l]:[l]}))},e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ln.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return un(r)?r:"auto"===r?e.getGlobalAutoFilterFn():null!=(t=null==(n=e.options.filterFns)?void 0:n[r])?t:Ln[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns();null==e.options.onColumnFiltersChange||e.options.onColumnFiltersChange((e=>{var r;return null==(r=sn(t,e))?void 0:r.filter((e=>{const t=n.find((t=>t.id===e.id));return!t||!Mn(t.getFilterFn(),e.value,t)}))}))},e.setGlobalFilter=t=>{null==e.options.onGlobalFilterChange||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.columnFilters)?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel()),e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}};function Mn(e,t,n){return!(!e||!e.autoRemove)&&e.autoRemove(t,n)||void 0===t||"string"==typeof t&&!t}const An={sum:(e,t,n)=>n.reduce(((t,n)=>{const r=n.getValue(e);return t+("number"==typeof r?r:0)}),0),min:(e,t,n)=>{let r;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(r>n||void 0===r&&n>=n)&&(r=n)})),r},max:(e,t,n)=>{let r;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(r<n||void 0===r&&n>=n)&&(r=n)})),r},extent:(e,t,n)=>{let r,o;return n.forEach((t=>{const n=t.getValue(e);null!=n&&(void 0===r?n>=n&&(r=o=n):(r>n&&(r=n),o<n&&(o=n)))})),[r,o]},mean:(e,t)=>{let n=0,r=0;if(t.forEach((t=>{let o=t.getValue(e);null!=o&&(o=+o)>=o&&(++n,r+=o)})),n)return r/n},median:(e,t)=>{if(!t.length)return;const n=t.map((t=>t.getValue(e)));if(!function(e){return Array.isArray(e)&&e.every((e=>"number"==typeof e))}(n))return;if(1===n.length)return n[0];const r=Math.floor(n.length/2),o=n.sort(((e,t)=>e-t));return n.length%2!=0?o[r]:(o[r-1]+o[r])/2},unique:(e,t)=>Array.from(new Set(t.map((t=>t.getValue(e)))).values()),uniqueCount:(e,t)=>new Set(t.map((t=>t.getValue(e)))).size,count:(e,t)=>t.length},Tn={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return null!=(t=null==(n=e.getValue())||null==n.toString?void 0:n.toString())?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:cn("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping((t=>null!=t&&t.includes(e.id)?t.filter((t=>t!==e.id)):[...null!=t?t:[],e.id]))},e.getCanGroup=()=>{var n,r,o,a;return null!=(n=null==(r=null!=(o=null==(a=e.columnDef.enableGrouping)||a)?o:t.options.enableGrouping)||r)?n:!!e.accessorFn},e.getIsGrouped=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return null==(n=t.getState().grouping)?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=null==n?void 0:n.getValue(e.id);return"number"==typeof r?An.sum:"[object Date]"===Object.prototype.toString.call(r)?An.extent:void 0},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return un(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:"auto"===e.columnDef.aggregationFn?e.getAutoAggregationFn():null!=(n=null==(r=t.options.aggregationFns)?void 0:r[e.columnDef.aggregationFn])?n:An[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>null==e.options.onGroupingChange?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.grouping)?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return null!=r&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!(null==(t=n.subRows)||!t.length)}}},Dn={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:cn("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=fn((e=>[Qn(t,e)]),(t=>t.findIndex((t=>t.id===e.id))),pn(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return(null==(r=Qn(t,n)[0])?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=Qn(t,n);return(null==(r=o[o.length-1])?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>null==e.options.onColumnOrderChange?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:null!=(n=e.initialState.columnOrder)?n:[])},e._getOrderColumnsFn=fn((()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode]),((e,t,n)=>r=>{let o=[];if(null!=e&&e.length){const t=[...e],n=[...r];for(;n.length&&t.length;){const e=t.shift(),r=n.findIndex((t=>t.id===e));r>-1&&o.push(n.splice(r,1)[0])}o=[...o,...n]}else o=r;return function(e,t,n){if(null==t||!t.length||!n)return e;const r=e.filter((e=>!t.includes(e.id)));if("remove"===n)return r;return[...t.map((t=>e.find((e=>e.id===t)))).filter(Boolean),...r]}(o,t,n)}),pn(e.options,"debugTable"))}},Vn={getInitialState:e=>({...e,pagination:{pageIndex:0,pageSize:10,...null==e?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:cn("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(t){if(null!=(r=null!=(o=e.options.autoResetAll)?o:e.options.autoResetPageIndex)?r:!e.options.manualPagination){if(n)return;n=!0,e._queue((()=>{e.resetPageIndex(),n=!1}))}}else e._queue((()=>{t=!0}))},e.setPagination=t=>null==e.options.onPaginationChange?void 0:e.options.onPaginationChange((e=>sn(t,e))),e.resetPagination=t=>{var n;e.setPagination(t?{pageIndex:0,pageSize:10}:null!=(n=e.initialState.pagination)?n:{pageIndex:0,pageSize:10})},e.setPageIndex=t=>{e.setPagination((n=>{let r=sn(t,n.pageIndex);const o=void 0===e.options.pageCount||-1===e.options.pageCount?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return r=Math.max(0,Math.min(r,o)),{...n,pageIndex:r}}))},e.resetPageIndex=t=>{var n,r;e.setPageIndex(t?0:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageIndex)?n:0)},e.resetPageSize=t=>{var n,r;e.setPageSize(t?10:null!=(n=null==(r=e.initialState)||null==(r=r.pagination)?void 0:r.pageSize)?n:10)},e.setPageSize=t=>{e.setPagination((e=>{const n=Math.max(1,sn(t,e.pageSize)),r=e.pageSize*e.pageIndex,o=Math.floor(r/n);return{...e,pageIndex:o,pageSize:n}}))},e.setPageCount=t=>e.setPagination((n=>{var r;let o=sn(t,null!=(r=e.options.pageCount)?r:-1);return"number"==typeof o&&(o=Math.max(-1,o)),{...n,pageCount:o}})),e.getPageOptions=fn((()=>[e.getPageCount()]),(e=>{let t=[];return e&&e>0&&(t=[...new Array(e)].fill(null).map(((e,t)=>t))),t}),pn(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return-1===n||0!==n&&t<n-1},e.previousPage=()=>e.setPageIndex((e=>e-1)),e.nextPage=()=>e.setPageIndex((e=>e+1)),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var t;return null!=(t=e.options.pageCount)?t:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var t;return null!=(t=e.options.rowCount)?t:e.getPrePaginationRowModel().rows.length}}},Gn={getInitialState:e=>({columnPinning:{left:[],right:[]},rowPinning:{top:[],bottom:[]},...e}),getDefaultOptions:e=>({onColumnPinningChange:cn("columnPinning",e),onRowPinningChange:cn("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map((e=>e.id)).filter(Boolean);t.setColumnPinning((e=>{var t,o,a,i,l,s;return"right"===n?{left:(null!=(a=null==e?void 0:e.left)?a:[]).filter((e=>!(null!=r&&r.includes(e)))),right:[...(null!=(i=null==e?void 0:e.right)?i:[]).filter((e=>!(null!=r&&r.includes(e)))),...r]}:"left"===n?{left:[...(null!=(l=null==e?void 0:e.left)?l:[]).filter((e=>!(null!=r&&r.includes(e)))),...r],right:(null!=(s=null==e?void 0:e.right)?s:[]).filter((e=>!(null!=r&&r.includes(e))))}:{left:(null!=(t=null==e?void 0:e.left)?t:[]).filter((e=>!(null!=r&&r.includes(e)))),right:(null!=(o=null==e?void 0:e.right)?o:[]).filter((e=>!(null!=r&&r.includes(e))))}}))},e.getCanPin=()=>e.getLeafColumns().some((e=>{var n,r,o;return(null==(n=e.columnDef.enablePinning)||n)&&(null==(r=null!=(o=t.options.enableColumnPinning)?o:t.options.enablePinning)||r)})),e.getIsPinned=()=>{const n=e.getLeafColumns().map((e=>e.id)),{left:r,right:o}=t.getState().columnPinning,a=n.some((e=>null==r?void 0:r.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return a?"left":!!i&&"right"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?null!=(n=null==(r=t.getState().columnPinning)||null==(r=r[o])?void 0:r.indexOf(e.id))?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,o)=>{const a=r?e.getLeafRows().map((e=>{let{id:t}=e;return t})):[],i=o?e.getParentRows().map((e=>{let{id:t}=e;return t})):[],l=new Set([...i,e.id,...a]);t.setRowPinning((e=>{var t,r,o,a,i,s;return"bottom"===n?{top:(null!=(o=null==e?void 0:e.top)?o:[]).filter((e=>!(null!=l&&l.has(e)))),bottom:[...(null!=(a=null==e?void 0:e.bottom)?a:[]).filter((e=>!(null!=l&&l.has(e)))),...Array.from(l)]}:"top"===n?{top:[...(null!=(i=null==e?void 0:e.top)?i:[]).filter((e=>!(null!=l&&l.has(e)))),...Array.from(l)],bottom:(null!=(s=null==e?void 0:e.bottom)?s:[]).filter((e=>!(null!=l&&l.has(e))))}:{top:(null!=(t=null==e?void 0:e.top)?t:[]).filter((e=>!(null!=l&&l.has(e)))),bottom:(null!=(r=null==e?void 0:e.bottom)?r:[]).filter((e=>!(null!=l&&l.has(e))))}}))},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return"function"==typeof r?r(e):null==(n=null!=r?r:o)||n},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,a=n.some((e=>null==r?void 0:r.includes(e))),i=n.some((e=>null==o?void 0:o.includes(e)));return a?"top":!!i&&"bottom"},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const a=null==(n=t._getPinnedRows(o))?void 0:n.map((e=>{let{id:t}=e;return t}));return null!=(r=null==a?void 0:a.indexOf(e.id))?r:-1},e.getCenterVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right]),((e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!r.includes(e.column.id)))}),pn(t.options,"debugRows")),e.getLeftVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.left]),((e,t)=>{const n=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"left"})));return n}),pn(t.options,"debugRows")),e.getRightVisibleCells=fn((()=>[e._getAllVisibleCells(),t.getState().columnPinning.right]),((e,t)=>{const n=(null!=t?t:[]).map((t=>e.find((e=>e.column.id===t)))).filter(Boolean).map((e=>({...e,position:"right"})));return n}),pn(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>null==e.options.onColumnPinningChange?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?{left:[],right:[]}:null!=(n=null==(r=e.initialState)?void 0:r.columnPinning)?n:{left:[],right:[]})},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;var o,a;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.left)?void 0:o.length)||(null==(a=r.right)?void 0:a.length))},e.getLeftLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),pn(e.options,"debugColumns")),e.getRightLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.right]),((e,t)=>(null!=t?t:[]).map((t=>e.find((e=>e.id===t)))).filter(Boolean)),pn(e.options,"debugColumns")),e.getCenterLeafColumns=fn((()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right]),((e,t,n)=>{const r=[...null!=t?t:[],...null!=n?n:[]];return e.filter((e=>!r.includes(e.id)))}),pn(e.options,"debugColumns")),e.setRowPinning=t=>null==e.options.onRowPinningChange?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?{top:[],bottom:[]}:null!=(n=null==(r=e.initialState)?void 0:r.rowPinning)?n:{top:[],bottom:[]})},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;var o,a;return t?Boolean(null==(n=r[t])?void 0:n.length):Boolean((null==(o=r.top)?void 0:o.length)||(null==(a=r.bottom)?void 0:a.length))},e._getPinnedRows=fn((t=>[e.getRowModel().rows,e.getState().rowPinning[t],t]),((t,n,r)=>{var o;return(null==(o=e.options.keepPinnedRows)||o?(null!=n?n:[]).map((t=>{const n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null})):(null!=n?n:[]).map((e=>t.find((t=>t.id===e))))).filter(Boolean).map((e=>({...e,position:r})))}),pn(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=fn((()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom]),((e,t,n)=>{const r=new Set([...null!=t?t:[],...null!=n?n:[]]);return e.filter((e=>!r.has(e.id)))}),pn(e.options,"debugRows"))}},zn={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:cn("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>null==e.options.onRowSelectionChange?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:null!=(n=e.initialState.rowSelection)?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection((n=>{t=void 0!==t?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach((e=>{e.getCanSelect()&&(r[e.id]=!0)})):o.forEach((e=>{delete r[e.id]})),r}))},e.toggleAllPageRowsSelected=t=>e.setRowSelection((n=>{const r=void 0!==t?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach((t=>{Bn(o,t.id,r,!0,e)})),o})),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getCoreRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getFilteredSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getFilteredRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getGroupedSelectedRowModel=fn((()=>[e.getState().rowSelection,e.getSortedRowModel()]),((t,n)=>Object.keys(t).length?Hn(e,n):{rows:[],flatRows:[],rowsById:{}}),pn(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=Boolean(t.length&&Object.keys(n).length);return r&&t.some((e=>e.getCanSelect()&&!n[e.id]))&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter((e=>e.getCanSelect())),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some((e=>!n[e.id]))&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys(null!=(t=e.getState().rowSelection)?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return!e.getIsAllPageRowsSelected()&&t.filter((e=>e.getCanSelect())).some((e=>e.getIsSelected()||e.getIsSomeSelected()))},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection((a=>{var i;if(n=void 0!==n?n:!o,e.getCanSelect()&&o===n)return a;const l={...a};return Bn(l,e.id,n,null==(i=null==r?void 0:r.selectChildren)||i,t),l}))},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return qn(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return"some"===Un(e,n)},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return"all"===Un(e,n)},e.getCanSelect=()=>{var n;return"function"==typeof t.options.enableRowSelection?t.options.enableRowSelection(e):null==(n=t.options.enableRowSelection)||n},e.getCanSelectSubRows=()=>{var n;return"function"==typeof t.options.enableSubRowSelection?t.options.enableSubRowSelection(e):null==(n=t.options.enableSubRowSelection)||n},e.getCanMultiSelect=()=>{var n;return"function"==typeof t.options.enableMultiRowSelection?t.options.enableMultiRowSelection(e):null==(n=t.options.enableMultiRowSelection)||n},e.getToggleSelectedHandler=()=>{const t=e.getCanSelect();return n=>{var r;t&&e.toggleSelected(null==(r=n.target)?void 0:r.checked)}}}},Bn=(e,t,n,r,o)=>{var a;const i=o.getRow(t,!0);n?(i.getCanMultiSelect()||Object.keys(e).forEach((t=>delete e[t])),i.getCanSelect()&&(e[t]=!0)):delete e[t],r&&null!=(a=i.subRows)&&a.length&&i.getCanSelectSubRows()&&i.subRows.forEach((t=>Bn(e,t.id,n,r,o)))};function Hn(e,t){const n=e.getState().rowSelection,r=[],o={},a=function(e,t){return e.map((e=>{var t;const i=qn(e,n);if(i&&(r.push(e),o[e.id]=e),null!=(t=e.subRows)&&t.length&&(e={...e,subRows:a(e.subRows)}),i)return e})).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:o}}function qn(e,t){var n;return null!=(n=t[e.id])&&n}function Un(e,t,n){var r;if(null==(r=e.subRows)||!r.length)return!1;let o=!0,a=!1;return e.subRows.forEach((e=>{if((!a||o)&&(e.getCanSelect()&&(qn(e,t)?a=!0:o=!1),e.subRows&&e.subRows.length)){const n=Un(e,t);"all"===n?a=!0:"some"===n?(a=!0,o=!1):o=!1}})),o?"all":!!a&&"some"}const $n=/([0-9]+)/gm;function Wn(e,t){return e===t?0:e>t?1:-1}function Zn(e){return"number"==typeof e?isNaN(e)||e===1/0||e===-1/0?"":String(e):"string"==typeof e?e:""}function Yn(e,t){const n=e.split($n).filter(Boolean),r=t.split($n).filter(Boolean);for(;n.length&&r.length;){const e=n.shift(),t=r.shift(),o=parseInt(e,10),a=parseInt(t,10),i=[o,a].sort();if(isNaN(i[0])){if(e>t)return 1;if(t>e)return-1}else{if(isNaN(i[1]))return isNaN(o)?-1:1;if(o>a)return 1;if(a>o)return-1}}return n.length-r.length}const Kn={alphanumeric:(e,t,n)=>Yn(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),alphanumericCaseSensitive:(e,t,n)=>Yn(Zn(e.getValue(n)),Zn(t.getValue(n))),text:(e,t,n)=>Wn(Zn(e.getValue(n)).toLowerCase(),Zn(t.getValue(n)).toLowerCase()),textCaseSensitive:(e,t,n)=>Wn(Zn(e.getValue(n)),Zn(t.getValue(n))),datetime:(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},basic:(e,t,n)=>Wn(e.getValue(n),t.getValue(n))},Xn={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:cn("sorting",e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const t of n){const n=null==t?void 0:t.getValue(e.id);if("[object Date]"===Object.prototype.toString.call(n))return Kn.datetime;if("string"==typeof n&&(r=!0,n.split($n).length>1))return Kn.alphanumeric}return r?Kn.text:Kn.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return"string"==typeof(null==n?void 0:n.getValue(e.id))?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return un(e.columnDef.sortingFn)?e.columnDef.sortingFn:"auto"===e.columnDef.sortingFn?e.getAutoSortingFn():null!=(n=null==(r=t.options.sortingFns)?void 0:r[e.columnDef.sortingFn])?n:Kn[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),a=null!=n;t.setSorting((i=>{const l=null==i?void 0:i.find((t=>t.id===e.id)),s=null==i?void 0:i.findIndex((t=>t.id===e.id));let c,u=[],f=a?n:"desc"===o;var p;return c=null!=i&&i.length&&e.getCanMultiSort()&&r?l?"toggle":"add":null!=i&&i.length&&s!==i.length-1?"replace":l?"toggle":"replace","toggle"===c&&(a||o||(c="remove")),"add"===c?(u=[...i,{id:e.id,desc:f}],u.splice(0,u.length-(null!=(p=t.options.maxMultiSortColCount)?p:Number.MAX_SAFE_INTEGER))):u="toggle"===c?i.map((t=>t.id===e.id?{...t,desc:f}:t)):"remove"===c?i.filter((t=>t.id!==e.id)):[{id:e.id,desc:f}],u}))},e.getFirstSortDir=()=>{var n,r;return(null!=(n=null!=(r=e.columnDef.sortDescFirst)?r:t.options.sortDescFirst)?n:"desc"===e.getAutoSortDir())?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const a=e.getFirstSortDir(),i=e.getIsSorted();return i?!!(i===a||null!=(r=t.options.enableSortingRemoval)&&!r||n&&null!=(o=t.options.enableMultiRemove)&&!o)&&("desc"===i?"asc":"desc"):a},e.getCanSort=()=>{var n,r;return(null==(n=e.columnDef.enableSorting)||n)&&(null==(r=t.options.enableSorting)||r)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return null!=(n=null!=(r=e.columnDef.enableMultiSort)?r:t.options.enableMultiSort)?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=null==(n=t.getState().sorting)?void 0:n.find((t=>t.id===e.id));return!!r&&(r.desc?"desc":"asc")},e.getSortIndex=()=>{var n,r;return null!=(n=null==(r=t.getState().sorting)?void 0:r.findIndex((t=>t.id===e.id)))?n:-1},e.clearSorting=()=>{t.setSorting((t=>null!=t&&t.length?t.filter((t=>t.id!==e.id)):[]))},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(null==r.persist||r.persist(),null==e.toggleSorting||e.toggleSorting(void 0,!!e.getCanMultiSort()&&(null==t.options.isMultiSortEvent?void 0:t.options.isMultiSortEvent(r))))}}},createTable:e=>{e.setSorting=t=>null==e.options.onSortingChange?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:null!=(n=null==(r=e.initialState)?void 0:r.sorting)?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Jn={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:cn("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility((t=>({...t,[e.id]:null!=n?n:!e.getIsVisible()})))},e.getIsVisible=()=>{var n,r;const o=e.columns;return null==(n=o.length?o.some((e=>e.getIsVisible())):null==(r=t.getState().columnVisibility)?void 0:r[e.id])||n},e.getCanHide=()=>{var n,r;return(null==(n=e.columnDef.enableHiding)||n)&&(null==(r=t.options.enableHiding)||r)},e.getToggleVisibilityHandler=()=>t=>{null==e.toggleVisibility||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=fn((()=>[e.getAllCells(),t.getState().columnVisibility]),(e=>e.filter((e=>e.column.getIsVisible()))),pn(t.options,"debugRows")),e.getVisibleCells=fn((()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()]),((e,t,n)=>[...e,...t,...n]),pn(t.options,"debugRows"))},createTable:e=>{const t=(t,n)=>fn((()=>[n(),n().filter((e=>e.getIsVisible())).map((e=>e.id)).join("_")]),(e=>e.filter((e=>null==e.getIsVisible?void 0:e.getIsVisible()))),pn(e.options,"debugColumns"));e.getVisibleFlatColumns=t(0,(()=>e.getAllFlatColumns())),e.getVisibleLeafColumns=t(0,(()=>e.getAllLeafColumns())),e.getLeftVisibleLeafColumns=t(0,(()=>e.getLeftLeafColumns())),e.getRightVisibleLeafColumns=t(0,(()=>e.getRightLeafColumns())),e.getCenterVisibleLeafColumns=t(0,(()=>e.getCenterLeafColumns())),e.setColumnVisibility=t=>null==e.options.onColumnVisibilityChange?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{var n;e.setColumnVisibility(t?{}:null!=(n=e.initialState.columnVisibility)?n:{})},e.toggleAllColumnsVisible=t=>{var n;t=null!=(n=t)?n:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce(((e,n)=>({...e,[n.id]:t||!(null!=n.getCanHide&&n.getCanHide())})),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some((e=>!(null!=e.getIsVisible&&e.getIsVisible()))),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some((e=>null==e.getIsVisible?void 0:e.getIsVisible())),e.getToggleAllColumnsVisibilityHandler=()=>t=>{var n;e.toggleAllColumnsVisible(null==(n=t.target)?void 0:n.checked)}}};function Qn(e,t){return t?"center"===t?e.getCenterVisibleLeafColumns():"left"===t?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const er=[gn,Jn,Dn,Gn,Fn,Xn,Tn,En,Vn,zn,vn];function tr(e){var t;(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");let n={_features:er};const r=n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultOptions?void 0:t.getDefaultOptions(n))),{});let o={...null!=(t=e.initialState)?t:{}};n._features.forEach((e=>{var t;o=null!=(t=null==e.getInitialState?void 0:e.getInitialState(o))?t:o}));const a=[];let i=!1;const l={_features:er,options:{...r,...e},initialState:o,_queue:e=>{a.push(e),i||(i=!0,Promise.resolve().then((()=>{for(;a.length;)a.shift()();i=!1})).catch((e=>setTimeout((()=>{throw e})))))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{const t=sn(e,n.options);n.options=(e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e})(t)},getState:()=>n.options.state,setState:e=>{null==n.options.onStateChange||n.options.onStateChange(e)},_getRowId:(e,t,r)=>{var o;return null!=(o=null==n.options.getRowId?void 0:n.options.getRowId(e,t,r))?o:`${r?[r.id,t].join("."):t}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw new Error;return r},_getDefaultColumnDef:fn((()=>[n.options.defaultColumn]),(e=>{var t;return e=null!=(t=e)?t:{},{header:e=>{const t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t,n;return null!=(t=null==(n=e.renderValue())||null==n.toString?void 0:n.toString())?t:null},...n._features.reduce(((e,t)=>Object.assign(e,null==t.getDefaultColumnDef?void 0:t.getDefaultColumnDef())),{}),...e}}),pn(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:fn((()=>[n._getColumnDefs()]),(e=>{const t=function(e,r,o){return void 0===o&&(o=0),e.map((e=>{const a=function(e,t,n,r){var o,a;const i={...e._getDefaultColumnDef(),...t},l=i.accessorKey;let s,c=null!=(o=null!=(a=i.id)?a:l?l.replace(".","_"):void 0)?o:"string"==typeof i.header?i.header:void 0;if(i.accessorFn?s=i.accessorFn:l&&(s=l.includes(".")?e=>{let t=e;for(const e of l.split(".")){var n;t=null==(n=t)?void 0:n[e]}return t}:e=>e[i.accessorKey]),!c)throw new Error;let u={id:`${String(c)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:fn((()=>[!0]),(()=>{var e;return[u,...null==(e=u.columns)?void 0:e.flatMap((e=>e.getFlatColumns()))]}),pn(e.options,"debugColumns")),getLeafColumns:fn((()=>[e._getOrderColumnsFn()]),(e=>{var t;if(null!=(t=u.columns)&&t.length){let t=u.columns.flatMap((e=>e.getLeafColumns()));return e(t)}return[u]}),pn(e.options,"debugColumns"))};for(const t of e._features)null==t.createColumn||t.createColumn(u,e);return u}(n,e,o,r),i=e;return a.columns=i.columns?t(i.columns,a,o+1):[],a}))};return t(e)}),pn(e,"debugColumns")),getAllFlatColumns:fn((()=>[n.getAllColumns()]),(e=>e.flatMap((e=>e.getFlatColumns()))),pn(e,"debugColumns")),_getAllFlatColumnsById:fn((()=>[n.getAllFlatColumns()]),(e=>e.reduce(((e,t)=>(e[t.id]=t,e)),{})),pn(e,"debugColumns")),getAllLeafColumns:fn((()=>[n.getAllColumns(),n._getOrderColumnsFn()]),((e,t)=>t(e.flatMap((e=>e.getLeafColumns())))),pn(e,"debugColumns")),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,l);for(let e=0;e<n._features.length;e++){const t=n._features[e];null==t||null==t.createTable||t.createTable(n)}return n}const nr=(e,t,n,r,o,a,i)=>{let l={id:t,index:r,original:n,depth:o,parentId:i,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(l._valuesCache.hasOwnProperty(t))return l._valuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?(l._valuesCache[t]=n.accessorFn(l.original,r),l._valuesCache[t]):void 0},getUniqueValues:t=>{if(l._uniqueValuesCache.hasOwnProperty(t))return l._uniqueValuesCache[t];const n=e.getColumn(t);return null!=n&&n.accessorFn?n.columnDef.getUniqueValues?(l._uniqueValuesCache[t]=n.columnDef.getUniqueValues(l.original,r),l._uniqueValuesCache[t]):(l._uniqueValuesCache[t]=[l.getValue(t)],l._uniqueValuesCache[t]):void 0},renderValue:t=>{var n;return null!=(n=l.getValue(t))?n:e.options.renderFallbackValue},subRows:null!=a?a:[],getLeafRows:()=>function(e,t){const n=[],r=e=>{e.forEach((e=>{n.push(e);const o=t(e);null!=o&&o.length&&r(o)}))};return r(e),n}(l.subRows,(e=>e.subRows)),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let e=[],t=l;for(;;){const n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:fn((()=>[e.getAllLeafColumns()]),(t=>t.map((t=>function(e,t,n,r){const o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>{var t;return null!=(t=o.getValue())?t:e.options.renderFallbackValue},getContext:fn((()=>[e,n,t,o]),((e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue})),pn(e.options,"debugCells"))};return e._features.forEach((r=>{null==r.createCell||r.createCell(o,n,t,e)}),{}),o}(e,l,t,t.id)))),pn(e.options,"debugRows")),_getAllCellsByColumnId:fn((()=>[l.getAllCells()]),(e=>e.reduce(((e,t)=>(e[t.column.id]=t,e)),{})),pn(e.options,"debugRows"))};for(let t=0;t<e._features.length;t++){const n=e._features[t];null==n||null==n.createRow||n.createRow(l,e)}return l};function rr(e){const t=[],n=e=>{var r;t.push(e),null!=(r=e.subRows)&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function or(e,n){return e?function(e){return"function"==typeof e&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}(r=e)||"function"==typeof r||function(e){return"object"==typeof e&&"symbol"==typeof e.$$typeof&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}(r)?t.createElement(e,n):e:null;var r}const ar=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))})),ir=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.5 7.5h-.75A2.25 2.25 0 0 0 4.5 9.75v7.5a2.25 2.25 0 0 0 2.25 2.25h7.5a2.25 2.25 0 0 0 2.25-2.25v-7.5a2.25 2.25 0 0 0-2.25-2.25h-.75m-6 3.75 3 3m0 0 3-3m-3 3V1.5m6 9h.75a2.25 2.25 0 0 1 2.25 2.25v7.5a2.25 2.25 0 0 1-2.25 2.25h-7.5a2.25 2.25 0 0 1-2.25-2.25v-.75"}))}));var lr=["value","onChange","debounce"];function sr(){return sr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},sr.apply(this,arguments)}function cr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ur(t){var n=t.value,r=t.onChange,o=t.debounce,a=void 0===o?500:o,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,lr),l=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(n),2),s=l[0],c=l[1];return(0,e.useEffect)((function(){c(n)}),[n]),(0,e.useEffect)((function(){var e=setTimeout((function(){r(s)}),a);return function(){return clearTimeout(e)}}),[s]),wp.element.createElement("input",sr({},i,{value:s,onChange:function(e){return c(e.target.value)}}))}const fr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))})),pr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))})),dr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))})),mr=function(e){var t=e.table;return wp.element.createElement("thead",{className:"border-b border-gray-900/10 text-sm leading-6 text-gray-900"},t.getHeaderGroups().map((function(e){return wp.element.createElement("tr",{key:e.id},e.headers.map((function(e,t){return wp.element.createElement("th",{onClick:e.column.getToggleSortingHandler(),key:e.id,colSpan:e.colSpan,className:"py-2 font-bold select-none",style:{width:0==t?"50px":"auto",cursor:e.column.getCanSort()?"pointer":"default"}},e.isPlaceholder?null:wp.element.createElement("div",{className:"flex items-end leading-none capitalize"},or(e.column.columnDef.header,e.getContext()),wp.element.createElement("span",null,e.column.getIsSorted()?"desc"===e.column.getIsSorted()?wp.element.createElement(fr,{className:"w-3 h-3"}):wp.element.createElement(pr,{className:"w-3 h-3"}):e.column.getCanSort()?wp.element.createElement(dr,{className:"w-3 h-3"}):"")))})))})))};function gr(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter(Boolean).join(" ")}const hr=function(e){var t=e.row,n=e.toggleExpanded,r="variation"===t.original.type,o=t.getIsExpanded(),a=gr(r?"bg-sky-50":"","py-4 wrap");return wp.element.createElement("tr",{key:t.id,className:gr(a,o?"bg-sky-300":"")},t.getVisibleCells().map((function(e,r){return wp.element.createElement("td",{key:e.id,onClick:function(){"select"!==e.column.id&&"actions"!==e.column.id&&n()},className:"py-4 wrap text-gray-600 ".concat(r===t.getVisibleCells().length-1?"text-right":"text-left"," ").concat(t.getCanExpand()&&"cursor-pointer"," ")},or(e.column.columnDef.cell,e.getContext()))})))};function yr(e){return yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},yr(e)}var vr=["indeterminate","className"];function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function br(){return br=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},br.apply(this,arguments)}function Er(t){var n=t.indeterminate,r=t.className,o=void 0===r?"":r,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(t,vr),i=(0,e.useRef)(null);return(0,e.useEffect)((function(){"boolean"==typeof n&&(i.current.indeterminate=!a.checked&&n)}),[i,n]),wp.element.createElement("input",br({type:"checkbox",ref:i,className:o+" cursor-pointer"},a))}const xr=function(e){var t=e.table,n=e.selectablePageRows,r=e.rowSelection,o=e.setRowSelection;return wp.element.createElement("div",{className:"flex justify-between items-center sm:px-6 lg:px-8"},wp.element.createElement("div",{className:"flex items-center gap-2 "},wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.setPageIndex(0)},disabled:!t.getCanPreviousPage()},"<<"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.previousPage()},disabled:!t.getCanPreviousPage()},"<"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.nextPage()},disabled:!t.getCanNextPage()},">"),wp.element.createElement("button",{className:"border rounded p-1",onClick:function(){return t.setPageIndex(t.getPageCount()-1)},disabled:!t.getCanNextPage()},">>"),wp.element.createElement("span",{className:"flex items-center gap-1"},wp.element.createElement("div",null,"Page"),wp.element.createElement("strong",null,t.getState().pagination.pageIndex+1," of"," ",t.getPageCount())),wp.element.createElement("span",{className:"flex items-center gap-1"},"| Go to page:",wp.element.createElement("input",{type:"number",defaultValue:t.getState().pagination.pageIndex+1,onChange:function(e){var n=e.target.value?Number(e.target.value)-1:0;t.setPageIndex(n)},className:"border p-1 rounded w-16"})),wp.element.createElement("select",{value:t.getState().pagination.pageSize,onChange:function(e){t.setPageSize(Number(e.target.value))}},[10,20,30,40,50].map((function(e){return wp.element.createElement("option",{key:e,value:e},"Show ",e)})))),wp.element.createElement("div",{className:"flex justify-center items-center pr-2 gap-2 py-4"},"Select Page (",t.getRowModel().rows.filter((function(e){return!e.getCanExpand()})).length,")",wp.element.createElement(Er,{checked:n.every((function(e){return r[e]})),indeterminate:n.some((function(e){return r[e]}))&&!n.every((function(e){return r[e]})),onChange:function(e){var t=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==yr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==yr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===yr(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},r);e.target.checked?n.forEach((function(e){t[e]=!0})):t={},o(t)}})))},Sr=function(t){var n=t.children,r=t.open,o=(t.onClose,t.className),a=t.backdrop,i=void 0===a||a,l=(0,e.useRef)(null);return r?wp.element.createElement("div",{className:"fixed top-0 left-0 right-0 bottom-0 flex items-center justify-start p-4 z-50",style:{marginLeft:"160px"}},i&&wp.element.createElement("div",{className:"absolute top-0 left-0 right-0 bottom-0 bg-black/30","aria-hidden":"true"}),wp.element.createElement("div",{ref:l,tabIndex:-1,className:gr("flex justify-center z-50 mx-auto",o),onClick:function(e){return e.stopPropagation()}},n)):null},Or=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 9-3 3m0 0 3 3m-3-3h7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))})),Cr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m12.75 15 3-3m0 0-3-3m3 3h-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}));var kr=function(e){e.productsToImport;var t=e.rangeValue,n=e.dataToImport,r=e.handleStepChange,o=e.importProduct,a=e.importCount;return wp.element.createElement("div",null,wp.element.createElement("h4",{className:"text-base mb-4"},"Review"),wp.element.createElement("p",null,"You are about to import"," ",wp.element.createElement("span",{className:"font-semibold"},a)," products in batches of"," ",wp.element.createElement("span",{className:"font-semibold"},t),". Existing products will have their data updated, while new entries will be created for products not already in the system."),wp.element.createElement("div",{className:"mt-2"},wp.element.createElement("p",null,"You have chosen to import/sync the following:"),wp.element.createElement("ul",{className:"flex gap-2 mt-2 flex-wrap"},Object.keys(n).map((function(e,t){if(n[e])return wp.element.createElement("li",{key:n[e]+t,className:"p-2 border border-gray-300 uppercase text-xs font-semibold"},e)})))),wp.element.createElement("div",{className:"flex items-center mt-10 justify-end gap-2"},wp.element.createElement("button",{type:"button",onClick:function(){return r("backward")},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(Or,{className:"mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Go back")),wp.element.createElement("button",{type:"button",onClick:function(){r("forward"),o()},className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"IMPORT"),wp.element.createElement(Cr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"}))))};const Pr=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))}));var jr=function(t){var n=t.progress,r=t.importCount,o=t.isImporting,a=t.setIsDialogOpen,i=t.setCurrentStep,l=(0,e.useRef)(null);return(0,e.useEffect)((function(){l.current&&(l.current.scrollTop=l.current.scrollHeight)}),[n]),wp.element.createElement("div",null,wp.element.createElement("div",null,wp.element.createElement("div",{className:""},wp.element.createElement("div",{className:"h-4 bg-gray-200 w-full rounded-lg mt-2"},wp.element.createElement("div",{className:"h-full bg-blue-500 rounded-lg",style:{width:"".concat(n.filter((function(e){return"string"!=typeof e})).length/r*100,"%")}})),wp.element.createElement("div",{className:"text-sm text-gray-500 mt-1"},"Imported"," ",n.filter((function(e){return"string"!=typeof e&&"success"===e.status})).length," ","of ",r," products."," ",Number(n.filter((function(e){return"string"!=typeof e})).length/r*100).toFixed(1),"%")),wp.element.createElement("div",{ref:l,className:"bg-slate-950 p-4 rounded-xl max-h-52 overflow-y-auto overflow-x-hidden w-full flex flex-col gap-2 mt-2"},n.map((function(e,t){return wp.element.createElement("p",{className:"break-words ".concat(e.status&&"success"===e.status?"text-green-500":e.status&&"failed"===e.status?"text-red-500":"text-blue-500"),key:e.square_id||e},JSON.stringify(e))}))),!o&&wp.element.createElement("div",{className:"flex flex-col items-center justify-center gap-2 py-4"},wp.element.createElement(qt,{className:"w-12 h-12 text-green-500"}),wp.element.createElement("h3",{className:"text-xl text-green-500 font-semibold"},"Import complete!"),wp.element.createElement("p",{className:"font-semibold"},"You can now safely close this window."))),!o&&wp.element.createElement("div",{className:"flex items-center justify-end gap-2 mt-6"},wp.element.createElement("button",{type:"button",onClick:function(){a(!1),i(0)},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(Pr,{className:"mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Close"))))};function Rr(e){return Rr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Rr(e)}function Nr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _r(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Rr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Rr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Rr(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var Lr=function(e){var t=e.dataToImport,n=e.setDataToImport,r=e.rangeValue,o=e.handleRangeChange,a=e.handleStepChange,i=e.setCurrentStep,l=e.setIsDialogOpen;return wp.element.createElement("div",null,wp.element.createElement("h4",{className:"text-base mb-4"},"Select the data you wish to import / sync:"),wp.element.createElement("fieldset",{className:"mb-3"},wp.element.createElement("legend",{className:"sr-only"},"data to sync"),wp.element.createElement("div",{className:"flex gap-x-6 gap-y-4 items-start flex-wrap"},wp.element.createElement("label",{htmlFor:"title",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",required:!0,checked:t.title,disabled:!0,id:"title",className:"h-full !m-0"}),"Title"),wp.element.createElement("label",{htmlFor:"SKU",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",checked:t.sku,id:"SKU",className:"h-full !m-0",onChange:function(){return n(_r(_r({},t),{},{sku:!t.sku}))}}),"SKU"),wp.element.createElement("label",{htmlFor:"price",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"price",className:"h-full !m-0",checked:t.price,onChange:function(){return n(_r(_r({},t),{},{price:!t.price}))}}),"Price"),wp.element.createElement("label",{htmlFor:"stock",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"stock",className:"h-full !m-0",checked:t.stock,onChange:function(){return n(_r(_r({},t),{},{stock:!t.stock}))}}),"Stock"),wp.element.createElement("label",{htmlFor:"description",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"description",checked:t.description,onChange:function(){return n(_r(_r({},t),{},{description:!t.description}))},className:"h-full !m-0"}),"Description"),wp.element.createElement("label",{htmlFor:"image",className:"flex items-center gap-1 leading-none relative"},wp.element.createElement("input",{type:"checkbox",id:"image",className:"h-full !m-0",checked:!1,disabled:!0}),"Image",wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO")),wp.element.createElement("label",{htmlFor:"categories",className:"flex items-center gap-1 leading-none"},wp.element.createElement("input",{type:"checkbox",id:"categories",className:"h-full !m-0",checked:!1,disabled:!0}),"Categories"," ",wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO")))),wp.element.createElement("p",null,"Existing products will have their data updated, while new entries will be created for products not already in the system."),wp.element.createElement("h4",{className:"text-base mt-4 mb-2"},"How many products to import in each batch?"),wp.element.createElement("p",null,"Raising the batch size puts more strain on the server, particularly during image imports. Should errors arise, you might want to lower this number to enhance stability or turn off image importing."),wp.element.createElement("div",{className:"relative mb-6 mt-3"},wp.element.createElement("label",{htmlFor:"labels-range-input",className:"sr-only"},"Labels range"),wp.element.createElement("input",{id:"labels-range-input",type:"range",value:r,onChange:o,step:5,min:"5",max:"50",className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"}),wp.element.createElement("span",{className:"text-sm text-gray-500 absolute start-0 -bottom-6"},"Min 5"),wp.element.createElement("span",{className:"text-sm text-gray-600 font-semibold absolute start-1/2 -translate-x-1/2 -bottom-6"},r),wp.element.createElement("span",{className:"text-sm text-gray-500 absolute end-0 -bottom-6"},"Max 50")),wp.element.createElement("div",{className:"flex items-center mt-10 justify-end gap-2"},wp.element.createElement("button",{type:"button",onClick:function(){i(0),l(!1)},className:"relative inline-flex items-center rounded-md bg-gray-400 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"Cancel"),wp.element.createElement(Pr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"})),wp.element.createElement("button",{type:"button",onClick:function(){return a("forward")},className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement("span",null,"Continue"),wp.element.createElement(Cr,{className:"ml-1.5 h-4 w-4 text-white","aria-hidden":"true"}))))},Ir=function(e){var t=e.currentStep,n=e.rangeValue,r=e.dataToImport,o=e.handleStepChange,a=e.setCurrentStep,i=e.handleRangeChange,l=e.setDataToImport,s=e.importProduct,c=e.importCount,u=e.productsToImport,f=e.isImporting,p=e.setIsDialogOpen,d=e.progress;switch(t){case 0:return wp.element.createElement(Lr,{dataToImport:r,setDataToImport:l,rangeValue:n,handleRangeChange:i,handleStepChange:o,setCurrentStep:a,setIsDialogOpen:p});case 1:return wp.element.createElement(kr,{progress:d,dataToImport:r,importProduct:s,importCount:c,handleStepChange:o,setCurrentStep:a,productsToImport:u,isImporting:f,rangeValue:n,setIsDialogOpen:p});case 2:return wp.element.createElement(jr,{progress:d,importCount:c,handleStepChange:o,setCurrentStep:a,isImporting:f,setIsDialogOpen:p});default:return wp.element.createElement("div",null,"Invalid step")}};function Fr(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Mr=function(t){var n=t.isDialogOpen,r=t.setIsDialogOpen,o=t.progress,a=t.rangeValue,i=t.setRangeValue,l=t.setDataToImport,s=t.dataToImport,c=t.importProduct,u=t.productsToImport,f=t.importCount,p=t.isImporting,d=[{name:"Step 1",href:"#",status:"current"},{name:"Step 2",href:"#",status:"upcoming"},{name:"Step 3",href:"#",status:"upcoming"}],m=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Fr(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Fr(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(0),2),g=m[0],h=m[1];return wp.element.createElement(Sr,{open:n,onClose:function(){return r(!1)},className:"w-[40vw] max-w-[40vw] mx-auto bg-white p-6 rounded-xl"},wp.element.createElement("div",{className:"w-full"},wp.element.createElement("header",{className:"flex justify-between items-center gap-2 mb-4"},wp.element.createElement("h3",{className:"text-lg font-medium leading-6 text-gray-900"},"Import from Square"),wp.element.createElement("nav",{className:"flex items-center justify-center","aria-label":"Progress"},wp.element.createElement("p",{className:"text-sm font-medium"},"Step ",g+1," of ",d.length),wp.element.createElement("ol",{role:"list",className:"ml-8 flex items-center space-x-5"},d.map((function(e,t){return wp.element.createElement("li",{key:e.name},"complete"===e.status?wp.element.createElement("span",{className:"block h-2.5 w-2.5 rounded-full bg-sky-600 hover:bg-sky-900"},wp.element.createElement("span",{className:"sr-only"},e.name)):g===t?wp.element.createElement("span",{className:"relative flex items-center justify-center","aria-current":"step"},wp.element.createElement("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true"},wp.element.createElement("span",{className:"h-full w-full rounded-full bg-sky-200"})),wp.element.createElement("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-sky-600","aria-hidden":"true"}),wp.element.createElement("span",{className:"sr-only"},e.name)):wp.element.createElement("span",{className:"block h-2.5 w-2.5 rounded-full bg-gray-200 hover:bg-gray-400"},wp.element.createElement("span",{className:"sr-only"},e.name)))}))))),wp.element.createElement(Ir,{currentStep:g,rangeValue:a,dataToImport:s,handleStepChange:function(e){h((function(t){return"forward"===e&&t<d.length-1?t+1:"backward"===e&&t>0?t-1:t}))},setCurrentStep:h,handleRangeChange:function(e){i(Number(e.target.value))},importCount:f,productsToImport:u,setDataToImport:l,importProduct:c,isImporting:p,setIsDialogOpen:r,progress:o}),p&&wp.element.createElement("p",{className:"text-red-500 font-semibold text-center mt-2"},"Do not close this window, import will be cancelled")))};function Ar(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Tr=(0,e.createContext)({blockNavigation:!1,setBlockNavigation:function(){}}),Dr=function(t){var n=t.children,r=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ar(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ar(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}((0,e.useState)(!1),2),o=r[0],a=r[1];return wp.element.createElement(Tr.Provider,{value:{blockNavigation:o,setBlockNavigation:a}},n)};function Vr(e){return Vr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Vr(e)}function Gr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function zr(e){return function(e){if(Array.isArray(e))return Br(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return Br(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Br(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Br(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Hr=function(e){var t=e.isExpanded;return e.row.getCanExpand()?wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"w-4 h-4 ".concat(t?"rotate-90":"")},wp.element.createElement("polyline",{points:"9 18 15 12 9 6"})):wp.element.createElement(React.Fragment,null)},qr=function(){return wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-gray-300"},wp.element.createElement("path",{d:"M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z"}),wp.element.createElement("line",{x1:"7",y1:"7",x2:"7.01",y2:"7"}))},Ur=function(e){var t={false:{bgColor:"bg-red-100",textColor:"text-red-700",fillColor:"fill-red-500",text:"Not imported"},partial:{bgColor:"bg-yellow-100",textColor:"text-yellow-700",fillColor:"fill-yellow-500",text:"Partial"},true:{bgColor:"bg-green-100",textColor:"text-green-700",fillColor:"fill-green-500",text:"Imported"}},n=t[e.status]||t.false,r=n.bgColor,o=n.textColor,a=n.fillColor,i=n.text;return wp.element.createElement("span",{className:"inline-flex items-center gap-x-1.5 rounded-md px-2 py-1 text-xs font-medium ".concat(r," ").concat(o)},wp.element.createElement("svg",{className:"h-1.5 w-1.5 ".concat(a),viewBox:"0 0 6 6","aria-hidden":"true"},wp.element.createElement("circle",{cx:"3",cy:"3",r:"3"})),i)},$r=function(e){var t=e.value;return wp.element.createElement("div",{className:"group relative w-10 h-10"},t.map((function(e,n){return wp.element.createElement("img",{key:n,src:e,alt:"",width:40,height:40,className:gr("w-10 h-10 rounded object-cover flex items-center gap-2 shadow top-0 absolute transition-transform duration-300",0===n&&t.length>1&&"group-hover:-translate-y-2 rotate-12 group-hover:rotate-[-16deg]",1===n&&t.length>1&&"group-hover:translate-y-2 group-hover:rotate-[16deg]")})})))},Wr=["indeterminate","className"];function Zr(){return Zr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zr.apply(this,arguments)}const Yr=function(e){var n=e.indeterminate,r=e.className,o=void 0===r?"":r,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Wr),i=(0,t.useRef)(null);return(0,t.useEffect)((function(){"boolean"==typeof n&&(i.current.indeterminate=!a.checked&&n)}),[n,a.checked]),wp.element.createElement("input",Zr({type:"checkbox",ref:i,className:o+" cursor-pointer"},a))};var Kr=function(e,t,n){var r=!!e.getValue(t)&&e.getValue(t).toString().toLowerCase().includes(n.toLowerCase()),o=e.subRows&&e.subRows.some((function(e){var r=e.getValue(t);return!!r&&r.toString().toLowerCase().includes(n.toLowerCase())}));return r||o};function Xr(e){return Xr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xr(e)}function Jr(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==Xr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Xr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Xr(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qr(e){return Qr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qr(e)}function eo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function to(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?eo(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Qr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Qr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Qr(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eo(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function no(){no=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Qr(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Qr(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function ro(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function oo(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ro(a,r,o,i,l,"next",e)}function l(e){ro(a,r,o,i,l,"throw",e)}i(void 0)}))}}function ao(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var io=function(e,t){return e.reduce((function(n,r,o){return o%t?n:[].concat(function(e){if(Array.isArray(e))return ao(e)}(a=n)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(a)||function(e,t){if(e){if("string"==typeof e)return ao(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ao(e,t):void 0}}(a)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),[e.slice(o,o+t)]);var a}),[])};function lo(_x,e,t,n){return so.apply(this,arguments)}function so(){return so=oo(no().mark((function e(t,n,r,o){var a;return no().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=n.find((function(e){return e.id===t.id}))){e.next=3;break}return e.abrupt("return",{error:"Product ".concat(t.id," not found in inventory")});case 3:return e.prev=3,e.next=6,zt()({path:"/sws/v1/square-inventory/import",signal:null==r?void 0:r.signal,method:"POST",data:{product:[a],datatoimport:o}});case 6:return e.abrupt("return",e.sent);case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("return",{error:e.t0});case 12:case"end":return e.stop()}}),e,null,[[3,9]])}))),so.apply(this,arguments)}var co=function(){var e=oo(no().mark((function e(t){return no().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zt()({path:"/sws/v1/logs",method:"POST",data:{log:t}});case 3:return e.abrupt("return",e.sent);case 6:e.prev=6,e.t0=e.catch(0),console.error("Error logging to backend:",e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])})));return function(t){return e.apply(this,arguments)}}(),uo=function(e,t){return t.map((function(t){var n=e.find((function(e){return e.square_id===t.id})),r=!(!n||"success"!==n.status);return to(to({},t),{},{woocommerce_product_id:(null==n?void 0:n.product_id)||t.woocommerce_product_id,imported:n?r:t.imported,status:n?r:t.status,item_data:to(to({},t.item_data),{},{variations:t.item_data.variations.map((function(e){return to(to({},e),{},{imported:n?r:t.imported,status:n?r:t.status})}))})})}))};function fo(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];throw Error("[Immer] minified error nr: "+e+(n.length?" "+n.map((function(e){return"'"+e+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function po(e){return!!e&&!!e[Qo]}function mo(e){var t;return!!e&&(function(e){if(!e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===ea}(e)||Array.isArray(e)||!!e[Jo]||!!(null===(t=e.constructor)||void 0===t?void 0:t[Jo])||bo(e)||Eo(e))}function go(e,t,n){void 0===n&&(n=!1),0===ho(e)?(n?Object.keys:ta)(e).forEach((function(r){n&&"symbol"==typeof r||t(r,e[r],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function ho(e){var t=e[Qo];return t?t.i>3?t.i-4:t.i:Array.isArray(e)?1:bo(e)?2:Eo(e)?3:0}function yo(e,t){return 2===ho(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vo(e,t,n){var r=ho(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function wo(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}function bo(e){return Zo&&e instanceof Map}function Eo(e){return Yo&&e instanceof Set}function xo(e){return e.o||e.t}function So(e){if(Array.isArray(e))return Array.prototype.slice.call(e);var t=na(e);delete t[Qo];for(var n=ta(t),r=0;r<n.length;r++){var o=n[r],a=t[o];!1===a.writable&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(t[o]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[o]})}return Object.create(Object.getPrototypeOf(e),t)}function Oo(e,t){return void 0===t&&(t=!1),ko(e)||po(e)||!mo(e)||(ho(e)>1&&(e.set=e.add=e.clear=e.delete=Co),Object.freeze(e),t&&go(e,(function(e,t){return Oo(t,!0)}),!0)),e}function Co(){fo(2)}function ko(e){return null==e||"object"!=typeof e||Object.isFrozen(e)}function Po(e){var t=ra[e];return t||fo(18,e),t}function jo(){return $o}function Ro(e,t){t&&(Po("Patches"),e.u=[],e.s=[],e.v=t)}function No(e){_o(e),e.p.forEach(Io),e.p=null}function _o(e){e===$o&&($o=e.l)}function Lo(e){return $o={p:[],l:$o,h:e,m:!0,_:0}}function Io(e){var t=e[Qo];0===t.i||1===t.i?t.j():t.g=!0}function Fo(e,t){t._=t.p.length;var n=t.p[0],r=void 0!==e&&e!==n;return t.h.O||Po("ES5").S(t,e,r),r?(n[Qo].P&&(No(t),fo(4)),mo(e)&&(e=Mo(t,e),t.l||To(t,e)),t.u&&Po("Patches").M(n[Qo].t,e,t.u,t.s)):e=Mo(t,n,[]),No(t),t.u&&t.v(t.u,t.s),e!==Xo?e:void 0}function Mo(e,t,n){if(ko(t))return t;var r=t[Qo];if(!r)return go(t,(function(o,a){return Ao(e,r,t,o,a,n)}),!0),t;if(r.A!==e)return t;if(!r.P)return To(e,r.t,!0),r.t;if(!r.I){r.I=!0,r.A._--;var o=4===r.i||5===r.i?r.o=So(r.k):r.o,a=o,i=!1;3===r.i&&(a=new Set(o),o.clear(),i=!0),go(a,(function(t,a){return Ao(e,r,o,t,a,n,i)})),To(e,o,!1),n&&e.u&&Po("Patches").N(r,n,e.u,e.s)}return r.o}function Ao(e,t,n,r,o,a,i){if(po(o)){var l=Mo(e,o,a&&t&&3!==t.i&&!yo(t.R,r)?a.concat(r):void 0);if(vo(n,r,l),!po(l))return;e.m=!1}else i&&n.add(o);if(mo(o)&&!ko(o)){if(!e.h.D&&e._<1)return;Mo(e,o),t&&t.A.l||To(e,o)}}function To(e,t,n){void 0===n&&(n=!1),!e.l&&e.h.D&&e.m&&Oo(t,n)}function Do(e,t){var n=e[Qo];return(n?xo(n):e)[t]}function Vo(e,t){if(t in e)for(var n=Object.getPrototypeOf(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Object.getPrototypeOf(n)}}function Go(e){e.P||(e.P=!0,e.l&&Go(e.l))}function zo(e){e.o||(e.o=So(e.t))}function Bo(e,t,n){var r=bo(t)?Po("MapSet").F(t,n):Eo(t)?Po("MapSet").T(t,n):e.O?function(e,t){var n=Array.isArray(e),r={i:n?1:0,A:t?t.A:jo(),P:!1,I:!1,R:{},l:t,t:e,k:null,o:null,j:null,C:!1},o=r,a=oa;n&&(o=[r],a=aa);var i=Proxy.revocable(o,a),l=i.revoke,s=i.proxy;return r.k=s,r.j=l,s}(t,n):Po("ES5").J(t,n);return(n?n.A:jo()).p.push(r),r}function Ho(e){return po(e)||fo(22,e),function e(t){if(!mo(t))return t;var n,r=t[Qo],o=ho(t);if(r){if(!r.P&&(r.i<4||!Po("ES5").K(r)))return r.t;r.I=!0,n=qo(t,o),r.I=!1}else n=qo(t,o);return go(n,(function(t,o){r&&function(e,t){return 2===ho(e)?e.get(t):e[t]}(r.t,t)===o||vo(n,t,e(o))})),3===o?new Set(n):n}(e)}function qo(e,t){switch(t){case 2:return new Map(e);case 3:return Array.from(e)}return So(e)}var Uo,$o,Wo="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),Zo="undefined"!=typeof Map,Yo="undefined"!=typeof Set,Ko="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,Xo=Wo?Symbol.for("immer-nothing"):((Uo={})["immer-nothing"]=!0,Uo),Jo=Wo?Symbol.for("immer-draftable"):"__$immer_draftable",Qo=Wo?Symbol.for("immer-state"):"__$immer_state",ea=("undefined"!=typeof Symbol&&Symbol.iterator,""+Object.prototype.constructor),ta="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames,na=Object.getOwnPropertyDescriptors||function(e){var t={};return ta(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n)})),t},ra={},oa={get:function(e,t){if(t===Qo)return e;var n=xo(e);if(!yo(n,t))return function(e,t,n){var r,o=Vo(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.k):void 0}(e,n,t);var r=n[t];return e.I||!mo(r)?r:r===Do(e.t,t)?(zo(e),e.o[t]=Bo(e.A.h,r,e)):r},has:function(e,t){return t in xo(e)},ownKeys:function(e){return Reflect.ownKeys(xo(e))},set:function(e,t,n){var r=Vo(xo(e),t);if(null==r?void 0:r.set)return r.set.call(e.k,n),!0;if(!e.P){var o=Do(xo(e),t),a=null==o?void 0:o[Qo];if(a&&a.t===n)return e.o[t]=n,e.R[t]=!1,!0;if(wo(n,o)&&(void 0!==n||yo(e.t,t)))return!0;zo(e),Go(e)}return e.o[t]===n&&(void 0!==n||t in e.o)||Number.isNaN(n)&&Number.isNaN(e.o[t])||(e.o[t]=n,e.R[t]=!0),!0},deleteProperty:function(e,t){return void 0!==Do(e.t,t)||t in e.t?(e.R[t]=!1,zo(e),Go(e)):delete e.R[t],e.o&&delete e.o[t],!0},getOwnPropertyDescriptor:function(e,t){var n=xo(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.i||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){fo(11)},getPrototypeOf:function(e){return Object.getPrototypeOf(e.t)},setPrototypeOf:function(){fo(12)}},aa={};go(oa,(function(e,t){aa[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),aa.deleteProperty=function(e,t){return aa.set.call(this,e,t,void 0)},aa.set=function(e,t,n){return oa.set.call(this,e[0],t,n,e[0])};var ia=function(){function e(e){var t=this;this.O=Ko,this.D=!0,this.produce=function(e,n,r){if("function"==typeof e&&"function"!=typeof n){var o=n;n=e;var a=t;return function(e){var t=this;void 0===e&&(e=o);for(var r=arguments.length,i=Array(r>1?r-1:0),l=1;l<r;l++)i[l-1]=arguments[l];return a.produce(e,(function(e){var r;return(r=n).call.apply(r,[t,e].concat(i))}))}}var i;if("function"!=typeof n&&fo(6),void 0!==r&&"function"!=typeof r&&fo(7),mo(e)){var l=Lo(t),s=Bo(t,e,void 0),c=!0;try{i=n(s),c=!1}finally{c?No(l):_o(l)}return"undefined"!=typeof Promise&&i instanceof Promise?i.then((function(e){return Ro(l,r),Fo(e,l)}),(function(e){throw No(l),e})):(Ro(l,r),Fo(i,l))}if(!e||"object"!=typeof e){if(void 0===(i=n(e))&&(i=e),i===Xo&&(i=void 0),t.D&&Oo(i,!0),r){var u=[],f=[];Po("Patches").M(e,i,u,f),r(u,f)}return i}fo(21,e)},this.produceWithPatches=function(e,n){if("function"==typeof e)return function(n){for(var r=arguments.length,o=Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return t.produceWithPatches(n,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,a=t.produce(e,n,(function(e,t){r=e,o=t}));return"undefined"!=typeof Promise&&a instanceof Promise?a.then((function(e){return[e,r,o]})):[a,r,o]},"boolean"==typeof(null==e?void 0:e.useProxies)&&this.setUseProxies(e.useProxies),"boolean"==typeof(null==e?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze)}var t=e.prototype;return t.createDraft=function(e){mo(e)||fo(8),po(e)&&(e=Ho(e));var t=Lo(this),n=Bo(this,e,void 0);return n[Qo].C=!0,_o(t),n},t.finishDraft=function(e,t){var n=(e&&e[Qo]).A;return Ro(n,t),Fo(void 0,n)},t.setAutoFreeze=function(e){this.D=e},t.setUseProxies=function(e){e&&!Ko&&fo(20),this.O=e},t.applyPatches=function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Po("Patches").$;return po(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))},e}(),la=new ia,sa=la.produce;la.produceWithPatches.bind(la),la.setAutoFreeze.bind(la),la.setUseProxies.bind(la),la.applyPatches.bind(la),la.createDraft.bind(la),la.finishDraft.bind(la);const ca=sa;function ua(e){return ua="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ua(e)}function fa(e){var t=function(e,t){if("object"!=ua(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!=ua(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==ua(t)?t:String(t)}function pa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function da(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pa(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=fa(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pa(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ma(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var ga="function"==typeof Symbol&&Symbol.observable||"@@observable",ha=function(){return Math.random().toString(36).substring(7).split("").join(".")},ya={INIT:"@@redux/INIT"+ha(),REPLACE:"@@redux/REPLACE"+ha(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+ha()}};function va(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(ma(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(ma(1));return n(va)(e,t)}if("function"!=typeof e)throw new Error(ma(2));var o=e,a=t,i=[],l=i,s=!1;function c(){l===i&&(l=i.slice())}function u(){if(s)throw new Error(ma(3));return a}function f(e){if("function"!=typeof e)throw new Error(ma(4));if(s)throw new Error(ma(5));var t=!0;return c(),l.push(e),function(){if(t){if(s)throw new Error(ma(6));t=!1,c();var n=l.indexOf(e);l.splice(n,1),i=null}}}function p(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(ma(7));if(void 0===e.type)throw new Error(ma(8));if(s)throw new Error(ma(9));try{s=!0,a=o(a,e)}finally{s=!1}for(var t=i=l,n=0;n<t.length;n++)(0,t[n])();return e}return p({type:ya.INIT}),(r={dispatch:p,subscribe:f,getState:u,replaceReducer:function(e){if("function"!=typeof e)throw new Error(ma(10));o=e,p({type:ya.REPLACE})}})[ga]=function(){var e,t=f;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(ma(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[ga]=function(){return this},e},r}function wa(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var a,i=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:ya.INIT}))throw new Error(ma(12));if(void 0===n(void 0,{type:ya.PROBE_UNKNOWN_ACTION()}))throw new Error(ma(13))}))}(n)}catch(e){a=e}return function(e,t){if(void 0===e&&(e={}),a)throw a;for(var r=!1,o={},l=0;l<i.length;l++){var s=i[l],c=n[s],u=e[s],f=c(u,t);if(void 0===f)throw t&&t.type,new Error(ma(14));o[s]=f,r=r||f!==u}return(r=r||i.length!==Object.keys(e).length)?o:e}}function ba(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Ea(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(ma(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},a=t.map((function(e){return e(o)}));return r=ba.apply(void 0,a)(n.dispatch),da(da({},n),{},{dispatch:r})}}}function xa(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Sa=xa();Sa.withExtraArgument=xa;const Oa=Sa;var Ca,ka=(Ca=function(e,t){return Ca=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Ca(e,t)},function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function __(){this.constructor=e}Ca(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),Pa=function(e,t){for(var n=0,r=t.length,o=e.length;n<r;n++,o++)e[o]=t[n];return e},ja=Object.defineProperty,Ra=Object.defineProperties,Na=Object.getOwnPropertyDescriptors,_a=Object.getOwnPropertySymbols,La=Object.prototype.hasOwnProperty,Ia=Object.prototype.propertyIsEnumerable,Fa=function(e,t,n){return t in e?ja(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n},Ma=function(e,t){for(var n in t||(t={}))La.call(t,n)&&Fa(e,n,t[n]);if(_a)for(var r=0,o=_a(t);r<o.length;r++)n=o[r],Ia.call(t,n)&&Fa(e,n,t[n]);return e},Aa=function(e,t){return Ra(e,Na(t))},Ta="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?ba:ba.apply(null,arguments)};function Da(e,t){function n(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];if(t){var o=t.apply(void 0,n);if(!o)throw new Error("prepareAction did not return an object");return Ma(Ma({type:e,payload:o.payload},"meta"in o&&{meta:o.meta}),"error"in o&&{error:o.error})}return{type:e,payload:n[0]}}return n.toString=function(){return""+e},n.type=e,n.match=function(t){return t.type===e},n}"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Va=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return ka(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Pa([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pa([void 0],e.concat(this))))},t}(Array),Ga=function(e){function t(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var o=e.apply(this,n)||this;return Object.setPrototypeOf(o,t.prototype),o}return ka(t,e),Object.defineProperty(t,Symbol.species,{get:function(){return t},enumerable:!1,configurable:!0}),t.prototype.concat=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return e.prototype.concat.apply(this,t)},t.prototype.prepend=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===e.length&&Array.isArray(e[0])?new(t.bind.apply(t,Pa([void 0],e[0].concat(this)))):new(t.bind.apply(t,Pa([void 0],e.concat(this))))},t}(Array);function za(e){return mo(e)?ca(e,(function(){})):e}function Ba(e){var t,n={},r=[],o={addCase:function(e,t){var r="string"==typeof e?e:e.type;if(!r)throw new Error("`builder.addCase` cannot be called with an empty action type");if(r in n)throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");return n[r]=t,o},addMatcher:function(e,t){return r.push({matcher:e,reducer:t}),o},addDefaultCase:function(e){return t=e,o}};return e(o),[n,r,t]}function Ha(e){var t=e.name;if(!t)throw new Error("`name` is a required option for createSlice");var n,r="function"==typeof e.initialState?e.initialState:za(e.initialState),o=e.reducers||{},a=Object.keys(o),i={},l={},s={};function c(){var t="function"==typeof e.extraReducers?Ba(e.extraReducers):[e.extraReducers],n=t[0],o=void 0===n?{}:n,a=t[1],i=void 0===a?[]:a,s=t[2],c=void 0===s?void 0:s,u=Ma(Ma({},o),l);return function(e,t,n,r){void 0===n&&(n=[]);var o,a=Ba(t),i=a[0],l=a[1],s=a[2];if("function"==typeof e)o=function(){return za(e())};else{var c=za(e);o=function(){return c}}function u(e,t){void 0===e&&(e=o());var n=Pa([i[t.type]],l.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer})));return 0===n.filter((function(e){return!!e})).length&&(n=[s]),n.reduce((function(e,n){if(n){var r;if(po(e))return void 0===(r=n(e,t))?e:r;if(mo(e))return ca(e,(function(e){return n(e,t)}));if(void 0===(r=n(e,t))){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return r}return e}),e)}return u.getInitialState=o,u}(r,(function(e){for(var t in u)e.addCase(t,u[t]);for(var n=0,r=i;n<r.length;n++){var o=r[n];e.addMatcher(o.matcher,o.reducer)}c&&e.addDefaultCase(c)}))}return a.forEach((function(e){var n,r,a=o[e],c=t+"/"+e;"reducer"in a?(n=a.reducer,r=a.prepare):n=a,i[e]=n,l[c]=n,s[e]=r?Da(c,r):Da(c)})),{name:t,reducer:function(e,t){return n||(n=c()),n(e,t)},actions:s,caseReducers:i,getInitialState:function(){return n||(n=c()),n.getInitialState()}}}var qa=["name","message","stack","code"],Ua=function(e,t){this.payload=e,this.meta=t},$a=function(e,t){this.payload=e,this.meta=t},Wa=function(e){if("object"==typeof e&&null!==e){for(var t={},n=0,r=qa;n<r.length;n++){var o=r[n];"string"==typeof e[o]&&(t[o]=e[o])}return t}return{message:String(e)}},Za=function(){function e(e,t,n){var r=Da(e+"/fulfilled",(function(e,t,n,r){return{payload:e,meta:Aa(Ma({},r||{}),{arg:n,requestId:t,requestStatus:"fulfilled"})}})),o=Da(e+"/pending",(function(e,t,n){return{payload:void 0,meta:Aa(Ma({},n||{}),{arg:t,requestId:e,requestStatus:"pending"})}})),a=Da(e+"/rejected",(function(e,t,r,o,a){return{payload:o,error:(n&&n.serializeError||Wa)(e||"Rejected"),meta:Aa(Ma({},a||{}),{arg:r,requestId:t,rejectedWithValue:!!o,requestStatus:"rejected",aborted:"AbortError"===(null==e?void 0:e.name),condition:"ConditionError"===(null==e?void 0:e.name)})}})),i="undefined"!=typeof AbortController?AbortController:function(){function e(){this.signal={aborted:!1,addEventListener:function(){},dispatchEvent:function(){return!1},onabort:function(){},removeEventListener:function(){},reason:void 0,throwIfAborted:function(){}}}return e.prototype.abort=function(){},e}();return Object.assign((function(e){return function(l,s,c){var u,f=(null==n?void 0:n.idGenerator)?n.idGenerator(e):function(e){void 0===e&&(e=21);for(var t="",n=e;n--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t}(),p=new i;function d(e){u=e,p.abort()}var m=function(){return i=this,m=null,g=function(){var i,m,g,h,y,v;return function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:l(0),throw:l(1),return:l(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(a){return function(l){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,l])}}}(this,(function(w){switch(w.label){case 0:return w.trys.push([0,4,,5]),null===(b=h=null==(i=null==n?void 0:n.condition)?void 0:i.call(n,e,{getState:s,extra:c}))||"object"!=typeof b||"function"!=typeof b.then?[3,2]:[4,h];case 1:h=w.sent(),w.label=2;case 2:if(!1===h||p.signal.aborted)throw{name:"ConditionError",message:"Aborted due to condition callback returning false."};return y=new Promise((function(e,t){return p.signal.addEventListener("abort",(function(){return t({name:"AbortError",message:u||"Aborted"})}))})),l(o(f,e,null==(m=null==n?void 0:n.getPendingMeta)?void 0:m.call(n,{requestId:f,arg:e},{getState:s,extra:c}))),[4,Promise.race([y,Promise.resolve(t(e,{dispatch:l,getState:s,extra:c,requestId:f,signal:p.signal,abort:d,rejectWithValue:function(e,t){return new Ua(e,t)},fulfillWithValue:function(e,t){return new $a(e,t)}})).then((function(t){if(t instanceof Ua)throw t;return t instanceof $a?r(t.payload,f,e,t.meta):r(t,f,e)}))])];case 3:return g=w.sent(),[3,5];case 4:return v=w.sent(),g=v instanceof Ua?a(null,f,e,v.payload,v.meta):a(v,f,e),[3,5];case 5:return n&&!n.dispatchConditionRejection&&a.match(g)&&g.meta.condition||l(g),[2,g]}var b}))},new Promise((function(e,t){var n=function(e){try{o(g.next(e))}catch(e){t(e)}},r=function(e){try{o(g.throw(e))}catch(e){t(e)}},o=function(t){return t.done?e(t.value):Promise.resolve(t.value).then(n,r)};o((g=g.apply(i,m)).next())}));var i,m,g}();return Object.assign(m,{abort:d,requestId:f,arg:e,unwrap:function(){return m.then(Ya)}})}}),{pending:o,rejected:a,fulfilled:r,typePrefix:e})}return e.withTypes=function(){return e},e}();function Ya(e){if(e.meta&&e.meta.rejectedWithValue)throw e.payload;if(e.error)throw e.error;return e.payload}Object.assign;var Ka="listenerMiddleware";Da(Ka+"/add"),Da(Ka+"/removeAll"),Da(Ka+"/remove"),"function"==typeof queueMicrotask&&queueMicrotask.bind("undefined"!=typeof window?window:void 0!==n.g?n.g:globalThis);"undefined"!=typeof window&&window.requestAnimationFrame&&window.requestAnimationFrame,function(){function e(e,t){var n=o[e];return n?n.enumerable=t:o[e]=n={configurable:!0,enumerable:t,get:function(){var t=this[Qo];return oa.get(t,e)},set:function(t){var n=this[Qo];oa.set(n,e,t)}},n}function t(e){for(var t=e.length-1;t>=0;t--){var o=e[t][Qo];if(!o.P)switch(o.i){case 5:r(o)&&Go(o);break;case 4:n(o)&&Go(o)}}}function n(e){for(var t=e.t,n=e.k,r=ta(n),o=r.length-1;o>=0;o--){var a=r[o];if(a!==Qo){var i=t[a];if(void 0===i&&!yo(t,a))return!0;var l=n[a],s=l&&l[Qo];if(s?s.t!==i:!wo(l,i))return!0}}var c=!!t[Qo];return r.length!==ta(t).length+(c?0:1)}function r(e){var t=e.k;if(t.length!==e.t.length)return!0;var n=Object.getOwnPropertyDescriptor(t,t.length-1);if(n&&!n.get)return!0;for(var r=0;r<t.length;r++)if(!t.hasOwnProperty(r))return!0;return!1}var o={};!function(e,t){ra[e]||(ra[e]=t)}("ES5",{J:function(t,n){var r=Array.isArray(t),o=function(t,n){if(t){for(var r=Array(n.length),o=0;o<n.length;o++)Object.defineProperty(r,""+o,e(o,!0));return r}var a=na(n);delete a[Qo];for(var i=ta(a),l=0;l<i.length;l++){var s=i[l];a[s]=e(s,t||!!a[s].enumerable)}return Object.create(Object.getPrototypeOf(n),a)}(r,t),a={i:r?5:4,A:n?n.A:jo(),P:!1,I:!1,R:{},l:n,t,k:o,o:null,g:!1,C:!1};return Object.defineProperty(o,Qo,{value:a,writable:!0}),o},S:function(e,n,o){o?po(n)&&n[Qo].A===e&&t(e.p):(e.u&&function e(t){if(t&&"object"==typeof t){var n=t[Qo];if(n){var o=n.t,a=n.k,i=n.R,l=n.i;if(4===l)go(a,(function(t){t!==Qo&&(void 0!==o[t]||yo(o,t)?i[t]||e(a[t]):(i[t]=!0,Go(n)))})),go(o,(function(e){void 0!==a[e]||yo(a,e)||(i[e]=!1,Go(n))}));else if(5===l){if(r(n)&&(Go(n),i.length=!0),a.length<o.length)for(var s=a.length;s<o.length;s++)i[s]=!1;else for(var c=o.length;c<a.length;c++)i[c]=!0;for(var u=Math.min(a.length,o.length),f=0;f<u;f++)a.hasOwnProperty(f)||(i[f]=!0),void 0===i[f]&&e(a[f])}}}}(e.p[0]),t(e.p))},K:function(e){return 4===e.i?n(e):r(e)}})}();var Xa=Ha({name:"inventory",initialState:{items:null},reducers:{setInventory:function(e,t){e.items=t.payload},addItem:function(e,t){e.items.push(t.payload)},removeItem:function(e,t){e.items=e.items.filter((function(e){return e.id!==t.payload}))}}}),Ja=Xa.actions,Qa=Ja.setInventory;Ja.addItem,Ja.removeItem;const ei=Xa.reducer;function ti(e){return ti="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ti(e)}function ni(e){return function(e){if(Array.isArray(e))return fi(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ui(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ri(){ri=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ti(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ti(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function oi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ai(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?oi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==ti(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ti(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===ti(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ii(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ui(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){l=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function li(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function si(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){li(a,r,o,i,l,"next",e)}function l(e){li(a,r,o,i,l,"throw",e)}i(void 0)}))}}function ci(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||ui(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ui(e,t){if(e){if("string"==typeof e)return fi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fi(e,t):void 0}}function fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function pi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return di(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?di(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function di(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var mi="undefined"==typeof AbortController?void 0:new AbortController;const gi=function(n){var r=n.getInventory,o=Y((function(e){return e.inventory.items})),a=pi((0,e.useState)(!1),2),i=a[0],l=a[1],s=pi((0,e.useState)(15),2),c=s[0],u=s[1],f=function(){var t=ci((0,e.useState)(!1),2),n=t[0],r=t[1],o=ci((0,e.useState)([]),2),a=o[0],i=o[1],l=ne(),s=(0,e.useCallback)(function(){var e=si(ri().mark((function e(t,o,a,s){var c,u,f,p,d,m,g,h=arguments;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c=h.length>4&&void 0!==h[4]?h[4]:15,!n){e.next=3;break}return e.abrupt("return");case 3:r(!0),i([]),u=io(t,c),f=[],p=ii(u),e.prev=8,m=ri().mark((function e(){var t,n;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=d.value,e.next=3,Promise.all(t.map(function(){var e=si(ri().mark((function e(t){var n,r,i,l;return ri().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,lo(t,o,a,s);case 3:return n=e.sent,r=n.error?{status:"failed",product_id:"N/A",square_id:t.id,message:n.error}:ai(ai({},n[0]),{},{status:"success"}),co({type:r.status,message:r.message,context:{product_id:r.product_id,square_id:t.id}}),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),i="AbortError"===e.t0.name?"Request Aborted":e.t0.message,l={status:"failed",product_id:"N/A",square_id:t.id,message:i},co({type:"error",message:i,context:{product_id:l.product_id,square_id:t.id}}),e.abrupt("return",l);case 15:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(t){return e.apply(this,arguments)}}()));case 3:n=e.sent,f=[].concat(ni(f),ni(n)),i((function(e){return[].concat(ni(e),ni(n.map((function(e){return e}))))}));case 6:case"end":return e.stop()}}),e)})),p.s();case 11:if((d=p.n()).done){e.next=15;break}return e.delegateYield(m(),"t0",13);case 13:e.next=11;break;case 15:e.next=20;break;case 17:e.prev=17,e.t1=e.catch(8),p.e(e.t1);case 20:return e.prev=20,p.f(),e.finish(20);case 23:(g=uo(f,o))&&l(Qa(g)),r(!1);case 26:case"end":return e.stop()}}),e,null,[[8,17,20,23]])})));return function(_x,t,n,r){return e.apply(this,arguments)}}(),[n,l]);return{isImporting:n,progress:a,importProduct:s}}(),p=f.isImporting,d=f.progress,m=f.importProduct,g=pi((0,e.useState)([]),2),h=g[0],y=g[1],v=pi((0,e.useState)({title:!0,sku:!0,description:!0,stock:!0,image:!1,categories:!1,price:!0}),2),w=v[0],b=v[1],E=pi((0,e.useState)({}),2),x=E[0],S=E[1],O=pi((0,e.useState)([]),2),C=O[0],k=O[1],P=pi((0,e.useState)(""),2),j=P[0],R=P[1],N=pi((0,e.useState)({}),2),_=N[0],L=N[1],I=pi((0,e.useState)([]),2),F=I[0],M=I[1],A=pi((0,e.useState)([]),2),T=A[0],D=A[1],V=function(t,n){var r=n.expanded,o=n.setExpanded,a=n.sorting,i=n.setSorting,l=n.globalFilter,s=n.setGlobalFilter,c=n.isImporting,u=n.setProductsToImport,f=n.setIsDialogOpen,p=n.rowSelection,d=n.setRowSelection,m=n.selectableRows,g=n.setSelectableRows,h=(0,e.useMemo)((function(){return function(e){return e.map((function(e){var t,n,r,o,a,i,l,s,c,u,f=((null===(t=e.item_data)||void 0===t?void 0:t.variations)||[]).map((function(e){var t=isNaN(parseInt(e.inventory_count))?0:parseInt(e.inventory_count),n=e.item_variation_data.price_money?e.item_variation_data.price_money.amount/100:0;return{sku:e.item_variation_data.sku,name:e.item_variation_data.name,type:"variation",price:n,status:e.imported,stock:t,id:e.id,woocommerce_product_id:e.woocommerce_product_id||null}})),p=((null===(n=e.item_data)||void 0===n?void 0:n.variations)||[]).map((function(e){return e.item_variation_data.price_money?e.item_variation_data.price_money.amount/100:0})),d=((null===(r=e.item_data)||void 0===r?void 0:r.variations)||[]).map((function(e){return isNaN(parseInt(e.inventory_count))?0:parseInt(e.inventory_count)}));p.length>0?(c=Math.min.apply(Math,zr(p)),u=Math.max.apply(Math,zr(p))):c=u=0;var m=d.length?Math.min.apply(Math,zr(d)):0,g=d.length?Math.max.apply(Math,zr(d)):0;return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Vr(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Vr(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Vr(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gr(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({sku:(null===(o=e.item_data)||void 0===o||null===(o=o.variations[0])||void 0===o?void 0:o.item_variation_data.sku)||"",id:e.id,name:(null===(a=e.item_data)||void 0===a?void 0:a.name)||"",stock:m===g?"".concat(m):"".concat(m," - ").concat(g),image:null!==(i=e.item_data)&&void 0!==i&&i.image_urls?e.item_data.image_urls:null,woocommerce_product_id:e.woocommerce_product_id||null,type:((null===(l=e.item_data)||void 0===l||null===(l=l.variations)||void 0===l?void 0:l.length)||0)>1?"Variable":"Simple",price:c===u?"$".concat(c):"$".concat(c," - $").concat(u),categories:null!==(s=e.item_data)&&void 0!==s&&s.categories?e.item_data.categories:"",status:e.imported},f.length>1&&{subRows:f})}))}(t)}),[t]),y=(0,e.useMemo)((function(){return[{id:"expander",width:50,cell:function(e){var t=e.row;return wp.element.createElement(React.Fragment,null,t.getCanExpand()?wp.element.createElement("button",{type:"button"},wp.element.createElement(Hr,{isExpanded:t.getIsExpanded(),row:t})):null)}},{accessorKey:"id",header:function(){return"id"},show:!1},{accessorKey:"sku",header:function(){return"SKU"},canSort:!0},{accessorKey:"image",header:function(){return""},enableSorting:!1,width:50,cell:function(e){var t=(0,e.getValue)();return t?wp.element.createElement($r,{value:t}):wp.element.createElement(qr,null)}},{accessorKey:"name",header:function(){return"Name"},canSort:!0},{accessorKey:"type",header:function(){return"Type"},canSort:!0},{accessorKey:"price",canSort:!0,header:function(){return"Price"}},{accessorKey:"stock",canSort:!0,header:function(){return"Stock"}},{accessorKey:"categories",header:function(){return"categories"},canSort:!0,cell:function(e){var t=(0,e.getValue)();return t&&t.length>0?function(e){var t="",n=e.filter((function(e){return!1===e.parent_id}));n.forEach((function(n){var r=e.filter((function(e){return e.parent_id===n.id})).map((function(e){return e.name}));t+=(t?" | ":"")+n.name,r.length>0&&(t+=" -> "+r.join(", "))}));var r=e.filter((function(e){return!n.find((function(t){return t.id===e.id}))&&!n.some((function(t){return t.id===e.parent_id}))}));if(r.length>0){var o=r.map((function(e){return e.name})).join(", ");t+=(t?" | ":"")+o}return t}(t):""}},{accessorKey:"status",canSort:!0,header:function(){return"Status"},cell:function(e){var t=(0,e.getValue)();return wp.element.createElement(Ur,{status:t})}},{id:"actions",colSpan:2,cell:function(e){var t=e.row;return t.parentId?wp.element.createElement(React.Fragment,null):t.getCanExpand()?wp.element.createElement("div",{className:"relative flex justify-end"},wp.element.createElement("span",{className:"inline-flex items-center rounded-md bg-purple-50 px-1.5 py-0.5 text-xs font-medium text-purple-700 ring-1 ring-inset ring-purple-700/10 whitespace-nowrap -top-4 uppercase"},"Pro Only")):wp.element.createElement("div",{className:"flex items-center justify-end gap-2"},t.original.woocommerce_product_id&&wp.element.createElement("a",{className:"rounded px-2 py-1 text-xs font-semibold text-sky-500 border-sky-500 border hover:border-sky-200 shadow-sm hover:text-sky-200 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-purple-600 cursor-pointer",href:"/wp-admin/post.php?post=".concat(t.original.woocommerce_product_id,"&action=edit"),target:"_blank"},"View Woo Product"),wp.element.createElement("button",{type:"button",onClick:function(){u([t.original]),f(!0)},disabled:c,className:"rounded bg-sky-600 px-2 py-1 text-xs font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600"},!0===t.original.status?"Sync":"Import"))}},{id:"select",header:function(e){var t=e.table,n=t.getFilteredRowModel().rows.filter((function(e){return!e.getCanExpand()})).every((function(e){return e.getIsSelected()})),r=t.getFilteredRowModel().rows.filter((function(e){return!e.getCanExpand()})).some((function(e){return e.getIsSelected()}))&&!n;return wp.element.createElement("div",{className:"flex justify-center items-center w-full gap-2 relative"},wp.element.createElement(Yr,{checked:n,indeterminate:r,onChange:function(e){t.getFilteredRowModel().rows.forEach((function(t){t.getCanExpand()||t.toggleSelected(e.target.checked)}))}}))},cell:function(e){var t=e.row;return t.getCanExpand()?wp.element.createElement(React.Fragment,null):t.parentId?void 0:wp.element.createElement("div",{className:"px-1"},wp.element.createElement(Yr,{checked:t.getIsSelected(),disabled:!t.getCanSelect(),indeterminate:t.getIsSomeSelected(),onChange:t.getToggleSelectedHandler()}))}}]}),[]),v=(0,e.useMemo)((function(){return Jr(Jr({data:h,columns:y,state:{expanded:r,sorting:a,columnVisibility:{id:!1},globalFilter:l,rowSelection:p},filterFns:{custom:Kr},onExpandedChange:o,onRowSelectionChange:d,globalFilterFn:"custom",getSubRows:function(e){return e.subRows||[]},getCoreRowModel:e=>fn((()=>[e.options.data]),(t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(t,o,a){void 0===o&&(o=0);const i=[];for(let s=0;s<t.length;s++){const c=nr(e,e._getRowId(t[s],s,a),t[s],s,o,void 0,null==a?void 0:a.id);var l;n.flatRows.push(c),n.rowsById[c.id]=c,i.push(c),e.options.getSubRows&&(c.originalSubRows=e.options.getSubRows(t[s],s),null!=(l=c.originalSubRows)&&l.length&&(c.subRows=r(c.originalSubRows,o+1,c)))}return i};return n.rows=r(t),n}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getPaginationRowModel:e=>fn((()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded]),((t,n)=>{if(!n.rows.length)return n;const{pageSize:r,pageIndex:o}=t;let{rows:a,flatRows:i,rowsById:l}=n;const s=r*o,c=s+r;let u;a=a.slice(s,c),u=e.options.paginateExpandedRows?{rows:a,flatRows:i,rowsById:l}:rr({rows:a,flatRows:i,rowsById:l}),u.flatRows=[];const f=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(f)};return u.rows.forEach(f),u}),pn(e.options,"debugTable")),getFilteredRowModel:e=>fn((()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter]),((t,n,r)=>{if(!t.rows.length||(null==n||!n.length)&&!r){for(let e=0;e<t.flatRows.length;e++)t.flatRows[e].columnFilters={},t.flatRows[e].columnFiltersMeta={};return t}const o=[],a=[];(null!=n?n:[]).forEach((t=>{var n;const r=e.getColumn(t.id);if(!r)return;const a=r.getFilterFn();a&&o.push({id:t.id,filterFn:a,resolvedValue:null!=(n=null==a.resolveFilterValue?void 0:a.resolveFilterValue(t.value))?n:t.value})}));const i=n.map((e=>e.id)),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter((e=>e.getCanGlobalFilter()));let c,u;r&&l&&s.length&&(i.push("__global__"),s.forEach((e=>{var t;a.push({id:e.id,filterFn:l,resolvedValue:null!=(t=null==l.resolveFilterValue?void 0:l.resolveFilterValue(r))?t:r})})));for(let e=0;e<t.flatRows.length;e++){const n=t.flatRows[e];if(n.columnFilters={},o.length)for(let e=0;e<o.length;e++){c=o[e];const t=c.id;n.columnFilters[t]=c.filterFn(n,t,c.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))}if(a.length){for(let e=0;e<a.length;e++){u=a[e];const t=u.id;if(u.filterFn(n,t,u.resolvedValue,(e=>{n.columnFiltersMeta[t]=e}))){n.columnFilters.__global__=!0;break}}!0!==n.columnFilters.__global__&&(n.columnFilters.__global__=!1)}}return function(e,t,n){return n.options.filterFromLeafRows?function(e,t,n){var r;const o=[],a={},i=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,l=function(e,r){void 0===r&&(r=0);const s=[];for(let u=0;u<e.length;u++){var c;let f=e[u];const p=nr(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);if(p.columnFilters=f.columnFilters,null!=(c=f.subRows)&&c.length&&r<i){if(p.subRows=l(f.subRows,r+1),f=p,t(f)&&!p.subRows.length){s.push(f),a[f.id]=f,o.push(f);continue}if(t(f)||p.subRows.length){s.push(f),a[f.id]=f,o.push(f);continue}}else f=p,t(f)&&(s.push(f),a[f.id]=f,o.push(f))}return s};return{rows:l(e),flatRows:o,rowsById:a}}(e,t,n):function(e,t,n){var r;const o=[],a={},i=null!=(r=n.options.maxLeafRowFilterDepth)?r:100,l=function(e,r){void 0===r&&(r=0);const s=[];for(let u=0;u<e.length;u++){let f=e[u];if(t(f)){var c;if(null!=(c=f.subRows)&&c.length&&r<i){const e=nr(n,f.id,f.original,f.index,f.depth,void 0,f.parentId);e.subRows=l(f.subRows,r+1),f=e}s.push(f),o.push(f),a[f.id]=f}}return s};return{rows:l(e),flatRows:o,rowsById:a}}(e,t,n)}(t.rows,(e=>{for(let t=0;t<i.length;t++)if(!1===e.columnFilters[i[t]])return!1;return!0}),e)}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),getExpandedRowModel:e=>fn((()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows]),((e,t,n)=>!t.rows.length||!0!==e&&!Object.keys(null!=e?e:{}).length?t:n?rr(t):t),pn(e.options,"debugTable")),onSortingChange:i,onGlobalFilterChange:s,getSortedRowModel:e=>fn((()=>[e.getState().sorting,e.getPreSortedRowModel()]),((t,n)=>{if(!n.rows.length||null==t||!t.length)return n;const r=e.getState().sorting,o=[],a=r.filter((t=>{var n;return null==(n=e.getColumn(t.id))?void 0:n.getCanSort()})),i={};a.forEach((t=>{const n=e.getColumn(t.id);n&&(i[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})}));const l=e=>{const t=e.map((e=>({...e})));return t.sort(((e,t)=>{for(let r=0;r<a.length;r+=1){var n;const o=a[r],l=i[o.id],s=null!=(n=null==o?void 0:o.desc)&&n;let c=0;if(l.sortUndefined){const n=void 0===e.getValue(o.id),r=void 0===t.getValue(o.id);(n||r)&&(c=n&&r?0:n?l.sortUndefined:-l.sortUndefined)}if(0===c&&(c=l.sortingFn(e,t,o.id)),0!==c)return s&&(c*=-1),l.invertSorting&&(c*=-1),c}return e.index-t.index})),t.forEach((e=>{var t;o.push(e),null!=(t=e.subRows)&&t.length&&(e.subRows=l(e.subRows))})),t};return{rows:l(n.rows),flatRows:o,rowsById:n.rowsById}}),pn(e.options,"debugTable",0,(()=>e._autoResetPageIndex()))),autoResetPageIndex:!1,enableRowSelection:!0},"onRowSelectionChange",d),"getRowId",(function(e){return e.id}))}),[h,y,r,a,l,o,i,s,p,d,m,g]);return v}(o,{expanded:x,setExpanded:S,sorting:C,setSorting:k,globalFilter:j,setGlobalFilter:R,isImporting:p,setProductsToImport:y,setIsDialogOpen:l,rowSelection:_,setRowSelection:L,selectableRows:F,setSelectableRows:M}),G=function(e){const n={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[r]=t.useState((()=>({current:tr(n)}))),[o,a]=t.useState((()=>r.current.initialState));return r.current.setOptions((t=>({...t,...e,state:{...o,...e.state},onStateChange:t=>{a(t),null==e.onStateChange||e.onStateChange(t)}}))),r.current}(V);(0,e.useEffect)((function(){var e=G.getCoreRowModel().rows.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)})).map((function(e){return e.id}));M(e)}),[G.getRowModel()]),(0,e.useEffect)((function(){var e=G.getRowModel().rows.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)})).map((function(e){return e.id}));D(e)}),[G.getRowModel()]),(0,e.useEffect)((function(){function e(e){p&&(e.preventDefault(),e.returnValue="")}return p&&window.addEventListener("beforeunload",e),function(){window.removeEventListener("beforeunload",e)}}),[p]);var z=(0,e.useContext)(Tr).setBlockNavigation;(0,e.useEffect)((function(){z(!!p)}),[p,z]);return wp.element.createElement("div",null,wp.element.createElement(Mr,{dataToImport:w,setDataToImport:b,importCount:h.length,importProduct:function(){var e;m(h,o,mi,w,c),e=G.getState().pagination.pageIndex,G.setPageIndex(e)},controller:mi,isImporting:p,productsToImport:h,rangeValue:c,setRangeValue:u,isDialogOpen:i,progress:d,setIsDialogOpen:function(e){return function(e){l(e)}(e)}}),wp.element.createElement("div",{className:"px-4 py-5 sm:px-6"},wp.element.createElement("div",{className:"grid grid-cols-3 gap-2 mb-4 items-center"},wp.element.createElement("div",{className:"flex flex-wrap items-center justify-start sm:flex-nowrap"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-gray-900 "},"Square Inventory"),wp.element.createElement("div",{className:"ml-4 flex flex-shrink-0"},wp.element.createElement("button",{type:"button",onClick:r,className:"relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(ar,{className:"-ml-0.5 mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,"Refresh")))),wp.element.createElement("div",{className:"relative flex"},wp.element.createElement(ur,{value:null!=j?j:"",onChange:function(e){return R(e)},className:"block w-full rounded-md border-0 py-1.5 pr-14 pl-4 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sku-600 sm:text-sm sm:leading-6",placeholder:"Search inventory..."}),wp.element.createElement("div",{className:"absolute inset-y-0 right-0 flex py-1.5 pr-1.5"},wp.element.createElement("kbd",{className:"inline-flex items-center rounded border border-gray-200 px-1 font-sans text-xs text-gray-400"},wp.element.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"feather feather-search w-3 h-3"},wp.element.createElement("circle",{cx:"11",cy:"11",r:"8"}),wp.element.createElement("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"}))))),wp.element.createElement("div",{className:"flex justify-end items-center"},wp.element.createElement("button",{type:"button",onClick:function(){var e=G.getFilteredRowModel().rows,t=e.filter((function(e){return e.getIsSelected()})).map((function(e){return e.original}));0===t.length?y(e.filter((function(e){return!(e.original.subRows&&e.original.subRows.length>0)}))):y(t),l(!0)},className:"disabled:bg-gray-200 relative inline-flex items-center rounded-md bg-sky-500 px-3 py-2 text-xs font-semibold text-white shadow-sm hover:bg-sky-400"},wp.element.createElement(ir,{className:"-ml-0.5 mr-1.5 h-4 w-4 text-white","aria-hidden":"true"}),wp.element.createElement("span",null,Object.keys(_).length<1?"Import all":"Import "+Object.keys(_).length+" selected products"))))),wp.element.createElement("div",{className:"sm:px-6 lg:px-8 relative overflow-auto w-full"},wp.element.createElement("table",{className:"w-full min-w-full whitespace-nowrap text-left bg-white"},wp.element.createElement(mr,{table:G}),wp.element.createElement("tbody",{className:"divide-y divide-gray-200"},G.getRowModel().rows.map((function(e){return wp.element.createElement(hr,{key:e.id,row:e,toggleExpanded:function(){e.getCanExpand()&&e.toggleExpanded()}})}))))),wp.element.createElement("hr",null),wp.element.createElement(xr,{table:G,selectablePageRows:T,rowSelection:_,setRowSelection:L}))};function hi(e){return hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hi(e)}function yi(){yi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==hi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(hi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function vi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function wi(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){vi(a,r,o,i,l,"next",e)}function l(e){vi(a,r,o,i,l,"throw",e)}i(void 0)}))}}function bi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ei(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ei(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ei(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function xi(e){return xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xi(e)}function Si(){Si=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==xi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(xi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Oi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}var Ci=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Oi(a,r,o,i,l,"next",e)}function l(e){Oi(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Si().mark((function e(){var t,n;return Si().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=F.loading("Retrieving Woo Orders"),e.prev=3,e.next=6,zt()({path:"/sws/v1/orders"});case 6:if(501!==(n=e.sent).status&&!n.message){e.next=10;break}throw F.update(t,{render:"Error fetching orders: ".concat(n.message||"Server error"),type:"error",isLoading:!1,closeOnClick:!0,autoClose:5e3}),new Error(n.message||"Server error");case 10:return F.update(t,{render:"Orders Received",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),e.abrupt("return",{status:"success",data:n});case 14:throw e.prev=14,e.t0=e.catch(3),F.update(t,{render:"Error fetching orders: ".concat(e.t0.error),type:"error",isLoading:!1,closeOnClick:!0,autoClose:5e3}),console.error("Error fetching orders:",e.t0),e.t0;case 19:case"end":return e.stop()}}),e,null,[[3,14]])})));return function(){return e.apply(this,arguments)}}();function ki(e){return ki="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ki(e)}function Pi(){Pi=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==ki(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(ki(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function ji(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Ri(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){ji(a,r,o,i,l,"next",e)}function l(e){ji(a,r,o,i,l,"throw",e)}i(void 0)}))}}var Ni=Za("orders/fetchIfNeeded",Ri(Pi().mark((function e(){var t,n,r,o,a,i,l,s,c,u=arguments;return Pi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=(t=u.length>0&&void 0!==u[0]?u[0]:{}).forceRefresh,r=void 0!==n&&n,t.page,t.perPage,a=(o=u.length>1?u[1]:void 0).getState,i=o.rejectWithValue,l=a(),s=l.orders,!(r||!s.data||s.data.length<1)){e.next=18;break}return console.log("fetch orders"),e.prev=5,e.next=8,Ci();case 8:return c=e.sent,console.log(c),e.abrupt("return",c.data.orders);case 13:return e.prev=13,e.t0=e.catch(5),e.abrupt("return",i(e.t0.error));case 16:e.next=20;break;case 18:return console.log("return orders"),e.abrupt("return",s.data);case 20:case"end":return e.stop()}}),e,null,[[5,13]])}))));const _i=Ha({name:"orders",initialState:{data:null,loading:!1,error:null},reducers:{},extraReducers:function(e){e.addCase(Ni.pending,(function(e){e.loading=!0})).addCase(Ni.fulfilled,(function(e,t){e.loading=!1,e.data=t.payload,e.error=null})).addCase(Ni.rejected,(function(e,t){e.loading=!1,e.data=[],e.error=t.payload}))}}).reducer,Li=t.forwardRef((function({title:e,titleId:n,...r},o){return t.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:o,"aria-labelledby":n},r),e?t.createElement("title",{id:n},e):null,t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z"}),t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))}));function Ii(e){return Ii="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ii(e)}function Fi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Mi(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Fi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Ii(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Ii(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Ii(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Fi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ai(){Ai=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Ii(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Ii(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Ti(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function Di(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Ti(a,r,o,i,l,"next",e)}function l(e){Ti(a,r,o,i,l,"throw",e)}i(void 0)}))}}function Vi(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Gi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Gi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function zi(t){var n=t.updateSettings,r=t.setSettings,o=t.settings,a=t.setLocations,i=t.getLocations,l=Vi((0,e.useState)(""),2),s=l[0],c=l[1],u=Vi((0,e.useState)(null),2),f=u[0],p=u[1],d=Vi((0,e.useState)(!0),2),m=d[0],g=d[1],h=function(e){var t,n=e.silent,r=void 0!==n&&n;r||(t=F.loading("Retrieving access token")),zt()({path:"/sws/v1/settings/access-token"}).then((function(e){e.access_token&&e.access_token.length>0&&"Token not set or empty"!==e.access_token?(r||F.update(t,{render:"Access token retrieved",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),p(e.access_token)):r||F.update(t,{render:"Access Token not set",type:"warning",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0})})).catch((function(e){F.update(t,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})})),g(!1)};(0,e.useEffect)((function(){h({silent:!0})}),[]);var y=function(){var e=Di(Ai().mark((function e(t){var n;return Ai().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.preventDefault(),g(!0),n=F.loading("Updating access token"),e.next=5,zt()({path:"/sws/v1/settings/access-token",method:"POST",data:{access_token:s}}).then((function(e){c(""),200===e.status?(i(),h({silent:!0}),F.update(n,{render:"Access token updated.",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0})):(p(null),F.update(n,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0}))})).catch((function(e){c(""),p(null),F.update(n,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 5:g(!1);case 6:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}(),v=function(){var e=Di(Ai().mark((function e(){var t;return Ai().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n("location",null),r(Mi(Mi({},o),{},{location:null})),a([]),g(!0),c(""),t=F.loading("Removing access token"),e.next=8,zt()({path:"/sws/v1/settings/access-token",method:"DELETE"}).then((function(){F.update(t,{render:"Access token removed.",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),p(null)})).catch((function(e){F.update(t,{render:e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 8:g(!1);case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return wp.element.createElement("div",{className:"px-4 py-5 sm:p-6"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Your Square Access Token"),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"Read the following documentation on how to create a square access token: ",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#access-token",target:"_blank",className:"underline text-sky-500"},"How to obtain Square Access Token"))),f?wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:"mt-5 sm:flex sm:items-center"},wp.element.createElement("input",{type:"text",name:"existingToken",id:"existingToken",className:"block !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6",value:f,disabled:!0}),wp.element.createElement("button",{onClick:v,type:"button",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-red-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-red-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-red-600 sm:ml-3 sm:mt-0 sm:w-auto",disabled:m},m?"Loading":"Remove token")),wp.element.createElement("p",{className:"mt-2"},"Removing your access token will stop all synchronization with Square")):wp.element.createElement("form",{className:"mt-5 sm:flex sm:items-center",onSubmit:y},wp.element.createElement("div",{className:"w-full sm:max-w-xs"},wp.element.createElement("label",{htmlFor:"accessToken",className:"sr-only"},"Access Token"),wp.element.createElement("input",{type:"text",name:"accessToken",id:"accessToken",className:"block w-full !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6",placeholder:"Enter your access token",value:s,disabled:m,onChange:function(e){return c(e.target.value)}})),wp.element.createElement("button",{type:"submit",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600 sm:ml-3 sm:mt-0 sm:w-auto",disabled:m},m?"Loading":"Save")))}n(874);const Bi=function(){return wp.element.createElement("div",{className:"px-4 py-5 sm:p-6"},wp.element.createElement("div",{className:"relative flex"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Webhook URL"),wp.element.createElement("a",{className:"pro-badge !relative",href:"https://squarewoosync.com",target:"_blank"},"PRO ONLY")),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"The webhook URL is used to keep a live inventory sync between square and woocommerce. Copy this URL and paste it into your square developer webhook subscriptions. Read the following documentation on how to do this:",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#webhook",target:"_blank",className:"underline text-sky-500"},"Setting up webhook url to retrieve inventory updates"))),wp.element.createElement("div",{className:"max-w-xl flex items-center mt-4 blur"},wp.element.createElement("input",{disabled:!0,id:"webhookURL",name:"webhookURL",className:"!select-none block disabled:text-gray-700 w-full !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6 pointer-events-none",value:"https://squarewoosync.com/wp-json/sws/v1"}),wp.element.createElement("button",{type:"button",className:"mt-3 inline-flex w-full items-center justify-center rounded-md bg-sky-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-sky-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-sky-600 sm:ml-3 sm:mt-0 sm:w-auto"},"Copy")))};function Hi(e){return Hi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hi(e)}function qi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Ui(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const $i=function(t){var n=t.settings,r=(t.updateSettings,t.settingsLoading),o=(0,e.useState)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Hi(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Hi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Hi(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.squareAuto)),a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Ui(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Ui(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o,2),i=a[0],l=a[1];(0,e.useEffect)((function(){l(n.squareAuto)}),[n]);var s=function(e){var t=e.id,n=e.label;return wp.element.createElement("li",{className:"w-auto mb-0"},wp.element.createElement("div",{className:"flex items-center gap-2 p-4"},wp.element.createElement("input",{id:t,type:"checkbox",checked:!1,disabled:!0,className:"!m-0 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 leading-normal"}),wp.element.createElement("label",{htmlFor:t,className:"w-full text-sm font-light text-gray-700 leading-normal"},n)))};return wp.element.createElement("div",{className:"px-4 pb-5 sm:px-6"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900 relative"},"Automatic Syncing",wp.element.createElement("a",{className:"pro-badge",href:"https://squarewoosync.com",target:"_blank"},"PRO ONLY")),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500 mb-4"},wp.element.createElement("p",null,"Enable or disable automatic inventory syncing between Woo and Square effortlessly with our Inventory Sync Toggle. Streamline your product management with ease.",wp.element.createElement("br",null),wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#import-data",className:"underline text-sky-500",target:"_blank"},"How to setup and control automatic syncing between Square and Woo"))),wp.element.createElement("div",{className:""},wp.element.createElement("label",{className:"relative inline-flex items-center cursor-pointer justify-start"},wp.element.createElement("input",{type:"checkbox",checked:!1,disabled:!0,className:"sr-only peer"}),wp.element.createElement("div",{className:"w-11 h-6 bg-gray-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"}),wp.element.createElement("span",{className:"ms-3 text-sm font-medium text-gray-700 "},"Square to woo (Webhook must be setup)")),i.isActive&&!r&&wp.element.createElement(React.Fragment,null,wp.element.createElement("ul",{className:"text-sm font-medium text-gray-900 bg-white my-3 flex flex-wrap fit-content"},[{id:"stock",label:"Stock",checked:!1},{id:"title",label:"Title",checked:!1},{id:"sku",label:"SKU",checked:!1},{id:"price",label:"Price",checked:!1},{id:"description",label:"Description",checked:!1},{id:"images",label:"Images",checked:!1},{id:"category",label:"Category",checked:!1}].map((function(e){return wp.element.createElement(s,{key:e.id,id:e.id,label:e.label,checked:!1,squareWoo:i})}))))))};function Wi(e){return Wi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wi(e)}function Zi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Yi(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}const Ki=function(t){var n=t.settings,r=(t.updateSettings,t.settingsLoading),o=(0,e.useState)(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Zi(Object(n),!0).forEach((function(t){var r,o,a;r=e,o=t,a=n[t],(o=function(e){var t=function(e,t){if("object"!==Wi(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Wi(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Wi(t)?t:String(t)}(o))in r?Object.defineProperty(r,o,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[o]=a})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Zi(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n.wooAuto)),a=function(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Yi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Yi(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(o,2),i=a[0],l=a[1];(0,e.useEffect)((function(){l(n.wooAuto)}),[n]);var s=function(e){var t=e.id,n=e.label;return wp.element.createElement("li",{className:"w-auto mb-0"},wp.element.createElement("div",{className:"flex items-center gap-2 p-4"},wp.element.createElement("input",{id:t,type:"checkbox",disabled:!0,checked:!1,className:"!m-0 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 focus:ring-2 leading-normal"}),wp.element.createElement("label",{htmlFor:t,className:"w-full text-sm font-light text-gray-700 leading-normal"},n)))},c=[{id:"stock",label:"Stock",checked:i.stock||!1}];return wp.element.createElement("div",{className:"px-4 pb-5 sm:px-6"},wp.element.createElement("div",{className:"mb-6"},wp.element.createElement("label",{className:"relative inline-flex items-center cursor-pointer"},wp.element.createElement("input",{type:"checkbox",checked:!1,disabled:!0,className:"sr-only peer"}),wp.element.createElement("div",{className:"w-11 h-6 bg-gray-200 rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"}),wp.element.createElement("span",{className:"ms-3 text-sm font-medium text-gray-700 "},"Woo to Square")),i.isActive&&!r&&wp.element.createElement(React.Fragment,null,wp.element.createElement("p",{className:"mt-4"},"Sync stock on order processing. Stock/Inventory count is the the sole permitted auto-sync option from Woo to Square."," ",wp.element.createElement("a",{href:"https://squarewoosync.com/documentation#woo-to-square"},"Learn why here")),wp.element.createElement("p",null,"You can manually sync from the product actions. Learn how here"),wp.element.createElement("ul",{className:"fit-content flex-wrap items-center justify-start text-sm font-medium text-gray-900 bg-white sm:flex"},c.map((function(e){return wp.element.createElement(s,{key:e.id,id:e.id,label:e.label,checked:!1,squareWoo:i})}))))))};function Xi(e){return Xi="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xi(e)}function Ji(){Ji=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==Xi(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(Xi(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function Qi(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function el(e){var t=e.updateSettings,n=e.locations,r=e.settings,o=function(){var e=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){Qi(a,r,o,i,l,"next",e)}function l(e){Qi(a,r,o,i,l,"throw",e)}i(void 0)}))}}(Ji().mark((function e(n){return Ji().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.preventDefault(),t("location",n.target.value);case 2:case"end":return e.stop()}}),e)})));return function(_x){return e.apply(this,arguments)}}();return wp.element.createElement("div",{className:"sm:px-6 px-4 pb-5"},wp.element.createElement("h3",{className:"text-base font-semibold leading-6 text-gray-900"},"Square Locations"),wp.element.createElement("div",{className:"mt-2 max-w-xl text-sm text-gray-500"},wp.element.createElement("p",null,"Select the location you wish to derive your websites products and inventory from: ",wp.element.createElement("br",null))),wp.element.createElement("div",null,wp.element.createElement("select",{id:"location",name:"location",onChange:function(e){return o(e)},value:r.location?r.location:"",className:"block !rounded-lg !border-0 !py-1.5 text-gray-900 !ring-1 !ring-inset !ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-sky-600 sm:text-sm !px-4 !leading-6 mt-2 !pr-10"},wp.element.createElement("option",{value:"",disabled:!0},"Select your location"),n.map((function(e){return wp.element.createElement("option",{key:e.id,value:e.id},e.name)})))))}function tl(e){return tl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tl(e)}function nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function rl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?nl(Object(n),!0).forEach((function(t){ol(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):nl(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ol(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==tl(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==tl(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===tl(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function al(){al=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var a=t&&t.prototype instanceof y?t:y,i=Object.create(a.prototype),l=new N(r||[]);return o(i,"_invoke",{value:k(e,n,l)}),i}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var p="suspendedStart",d="suspendedYield",m="executing",g="completed",h={};function y(){}function v(){}function w(){}var b={};c(b,i,(function(){return this}));var E=Object.getPrototypeOf,x=E&&E(E(_([])));x&&x!==n&&r.call(x,i)&&(b=x);var S=w.prototype=y.prototype=Object.create(b);function O(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,a,i,l){var s=f(e[o],e,a);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"==tl(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,i,l)}),(function(e){n("throw",e,i,l)})):t.resolve(u).then((function(e){c.value=e,i(c)}),(function(e){return n("throw",e,i,l)}))}l(s.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function k(t,n,r){var o=p;return function(a,i){if(o===m)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var l=r.delegate;if(l){var s=P(l,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=m;var c=f(t,n,r);if("normal"===c.type){if(o=r.done?g:d,c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=g,r.method="throw",r.arg=c.arg)}}}function P(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,P(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),h;var a=f(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,h;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,h):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function _(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(tl(t)+" is not iterable")}return v.prototype=w,o(S,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:v,configurable:!0}),v.displayName=c(w,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,c(e,s,"GeneratorFunction")),e.prototype=Object.create(S),e},t.awrap=function(e){return{__await:e}},O(C.prototype),c(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new C(u(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},O(S),c(S,s,"Generator"),c(S,i,(function(){return this})),c(S,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=_,N.prototype={constructor:N,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],l=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var s=r.call(i,"catchLoc"),c=r.call(i,"finallyLoc");if(s&&c){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:_(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),h}},t}function il(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function ll(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){il(a,r,o,i,l,"next",e)}function l(e){il(a,r,o,i,l,"throw",e)}i(void 0)}))}}function sl(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,l=[],s=!0,c=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=a.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return cl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?cl(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function cl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var ul=[{name:"General",href:"/settings/general",icon:Li,current:!0}];function fl(){en();var t=sl((0,e.useState)(!0),2),n=t[0],r=t[1],o=sl((0,e.useState)([]),2),a=o[0],i=o[1],l=sl((0,e.useState)({location:"",squareAuto:{isActive:!1,stock:!0,sku:!0,title:!0,description:!0,images:!0,price:!0,category:!0},wooAuto:{isActive:!1,stock:!1,sku:!0,title:!1,description:!1,images:!1,category:!1,price:!1}}),2),s=l[0],c=l[1];(0,e.useEffect)((function(){var e=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings",method:"GET"}).then((function(e){c(e),r(!1)})).catch((function(e){r(!1),F({render:"Failed to update settings: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]),(0,e.useEffect)((function(){var e=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings/get-locations",method:"GET"}).then((function(e){i(e.locations.data.locations),r(!1)})).catch((function(e){r(!1),F({render:"Failed to get locations: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[]);var u=function(){var e=ll(al().mark((function e(){return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:zt()({path:"/sws/v1/settings/get-locations",method:"GET"}).then((function(e){i(e.locations.data.locations),r(!1)})).catch((function(e){r(!1),F({render:"Failed to get locations: "+e.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0})}));case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),f=function(){var e=ll(al().mark((function e(t,n){var r,o;return al().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=F.loading("Updating setting: ".concat(t)),e.prev=1,e.next=4,zt()({path:"/sws/v1/settings",method:"POST",data:ol({},t,n)});case 4:(o=e.sent)&&(F.update(r,{render:"settings updated successfully",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),c(rl(rl({},s),o))),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),F.update(r,{render:"Failed to update settings: "+e.t0.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0});case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(_x,t){return e.apply(this,arguments)}}();return wp.element.createElement(React.Fragment,null,wp.element.createElement("div",{className:"lg:flex lg:gap-x-16 bg-white rounded-2xl shadow-lg p-6"},wp.element.createElement("aside",{className:"flex border-b border-gray-900/5 lg:block lg:w-64 lg:flex-none lg:border-0 "},wp.element.createElement("nav",{className:"flex-none px-4 sm:px-6 lg:px-0"},wp.element.createElement("ul",{role:"list",className:"flex gap-x-3 gap-y-1 whitespace-nowrap lg:flex-col"},ul.map((function(e){return wp.element.createElement("li",{key:e.name},wp.element.createElement(Ct,{to:e.href,className:gr(e.current?"bg-gray-50 text-sky-600":"text-gray-700 hover:text-sky-600 hover:bg-gray-50","group flex gap-x-3 rounded-lg py-2 pl-2 pr-3 text-sm leading-6 font-semibold")},wp.element.createElement(e.icon,{className:gr(e.current?"text-sky-600":"text-gray-400 group-hover:text-sky-600","h-6 w-6 shrink-0"),"aria-hidden":"true"}),e.name))})))),wp.element.createElement("div",{className:"mt-4 p-6 rounded-md relative bg-gray-900 overflow-hidden"},wp.element.createElement("svg",{viewBox:"0 0 1024 1024",className:"absolute bottom-[-140%] left-[50%] -translate-x-1/2 [mask-image:radial-gradient(closest-side,white,transparent)] w-[150%]","aria-hidden":"true"},wp.element.createElement("circle",{cx:512,cy:512,r:512,fill:"url(#827591b1-ce8c-4110-b064-7cb85a0b1217)",fillOpacity:"0.7"}),wp.element.createElement("defs",null,wp.element.createElement("radialGradient",{id:"827591b1-ce8c-4110-b064-7cb85a0b1217"},wp.element.createElement("stop",{stopColor:"#7775D6"}),wp.element.createElement("stop",{offset:1,stopColor:"#E935C1"})))),wp.element.createElement("h4",{className:"text-xl font-bold tracking-tight text-white relative z-10"},"Ready to boost your productivity?",wp.element.createElement("br",null),"Get started today."),wp.element.createElement("div",{className:"flex items-center gap-x-6 lg:mt-0 lg:flex-shrink-0 relative z-10"},wp.element.createElement("a",{href:"https://squarewoosync.com",target:"_blank",className:"rounded-md bg-white px-3.5 py-2.5 text-sm font-semibold text-black shadow-sm hover:bg-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-white mt-4"},"Go Pro")))),wp.element.createElement("main",{className:"px-4 sm:px-6 lg:flex-auto lg:px-0"},n?wp.element.createElement("div",null,"Loading..."):wp.element.createElement(React.Fragment,null,wp.element.createElement(zi,{updateSettings:f,setSettings:c,settings:s,setLocations:i,getLocations:u}),wp.element.createElement(el,{updateSettings:f,locations:a,settings:s}),wp.element.createElement(Bi,null),wp.element.createElement($i,{settings:s,updateSettings:f,settingsLoading:n}),wp.element.createElement(Ki,{settings:s,updateSettings:f,settingsLoading:n})))))}const pl=[{path:"/",element:function(){return en(),wp.element.createElement("div",{className:"dashboard-grid"},wp.element.createElement("div",{className:"actions"},wp.element.createElement(Lt,null)),wp.element.createElement("div",{className:"log"},wp.element.createElement(Jt,null)),wp.element.createElement("div",{className:"support"},wp.element.createElement(Vt,null)),wp.element.createElement("div",{className:"pro"},wp.element.createElement("div",{className:"bg-white pt-9 pb-12 rounded-xl"},wp.element.createElement("div",{className:"mx-auto max-w-7xl px-6 lg:px-8"},wp.element.createElement("div",{className:"grid max-w-2xl grid-cols-1 gap-x-8 gap-y-8 "},wp.element.createElement("div",null,wp.element.createElement("h2",{className:"text-sm font-semibold leading-7 text-sky-600"},"SquareWooSync"," ",wp.element.createElement("span",{className:"inline-flex items-center rounded-md bg-purple-50 px-1.5 py-0.5 text-xs font-medium text-purple-700 ring-1 ring-inset ring-purple-700/10 whitespace-nowrap"},"PRO")),wp.element.createElement("p",{className:"text-xl font-bold tracking-tight text-gray-900"},"Pro Features"),wp.element.createElement("p",{className:"mt-2 text-sm leading-7 text-gray-600"},"Check out these pro features to boost your productivity")),wp.element.createElement("dl",{className:"col-span-2 grid grid-cols-1 gap-x-8 gap-y-4 text-sm leading-7 text-gray-600"},wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Automatic live sync between Square and Woo."),wp.element.createElement("dd",{className:""},"Optimize productivity and streamline store management with real-time inventory synchronization.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Dynamic data import"),wp.element.createElement("dd",null,"Take control over what data you would like to import.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Variable products"),wp.element.createElement("dd",null,"Seamlessly manage product variations within your inventory, ensuring you have complete control and flexibility over your Woo and Square products.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Hierarchical Categories"),wp.element.createElement("dd",null,"Seamlessly imports hierarchical categories directly to your website. Simplify the process of organizing and displaying your products online. By accurately mirroring the structured hierarchy of your square inventory system.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Smart Image Import"),wp.element.createElement("dd",null,"Easily enhance your product catalog with our image import feature. No duplicate images.")),wp.element.createElement("div",{className:"relative pl-9"},wp.element.createElement("dt",{className:"font-semibold text-gray-900 text-sm"},wp.element.createElement("svg",{className:"absolute left-0 top-1 h-5 w-5 text-sky-500",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true"},wp.element.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})),"Customer Support"),wp.element.createElement("dd",null,"Access round-the-clock assistance from our dedicated support team. Get help whenever you need it to ensure a smooth and successful integration experience."))))))))}},{path:"/inventory",element:function(){var t=ne(),n=Y((function(e){return e.inventory.items})),r=bi((0,e.useState)(!1),2),o=r[0],a=r[1],i=bi((0,e.useState)(!1),2),l=i[0],s=i[1];en();var c=(0,e.useCallback)(wi(yi().mark((function e(){var n,r;return yi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a(!0),n=F.loading("Retrieving square inventory"),e.prev=2,e.next=5,zt()({path:"/sws/v1/square-inventory/"});case 5:r=e.sent,F.update(n,{render:"Inventory received",type:"success",isLoading:!1,autoClose:2e3,hideProgressBar:!1,closeOnClick:!0}),t(Qa(r)),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),F.update(n,{render:e.t0.message,type:"error",isLoading:!1,autoClose:!1,closeOnClick:!0});case 13:return e.prev=13,a(!1),e.finish(13);case 16:case"end":return e.stop()}}),e,null,[[2,10,13,16]])}))),[t]);return(0,e.useEffect)((function(){var e=function(){var e=wi(yi().mark((function e(){var t;return yi().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,zt()({path:"/sws/v1/settings/access-token"});case 3:t=e.sent,console.log(t),t.access_token&&t.access_token.length>0&&"Token not set or empty"!==t.access_token&&s(t.access_token),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}();e()}),[]),wp.element.createElement("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden mt-10"},!n&&!o&&wp.element.createElement(on,{getInventory:c,validToken:l}),o&&wp.element.createElement(ln,null),n&&!o&&wp.element.createElement(gi,{getInventory:c}))}},{path:"/orders",element:function(){return en(),wp.element.createElement("div",{className:"bg-white rounded-xl shadow-lg overflow-hidden mt-10"},wp.element.createElement("div",{className:"bg-white py-12 sm:py-32"},wp.element.createElement("div",{className:"mx-auto max-w-7xl px-6 lg:px-8"},wp.element.createElement("div",{className:"mx-auto grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 sm:gap-y-20 lg:mx-0 lg:max-w-none lg:grid-cols-3"},wp.element.createElement("div",{className:"col-span-full text-center max-w-md mx-auto"},wp.element.createElement("h2",{className:"text-base font-semibold leading-7 text-sky-600"},"Coming Soon"),wp.element.createElement("p",{className:"mt-2 text-3xl font-bold tracking-tight text-gray-900 sm:text-4xl"},"Sync Orders"),wp.element.createElement("p",{className:"mt-6 text-base leading-7 text-gray-600"},"Transform the way you manage your online and offline sales with our upcoming WooCommerce to Square Order Sync feature. Designed to seamlessly integrate your WooCommerce store with the Square payment system, this powerful feature will ensure that your orders and sales records are perfectly synchronized."))))))}},{path:"/settings/general",element:function(){return en(),wp.element.createElement(fl,null)}},{path:"/settings/general",element:fl}];var dl="persist:",ml="persist/FLUSH",gl="persist/REHYDRATE",hl="persist/PAUSE",yl="persist/PERSIST",vl="persist/PURGE",wl="persist/REGISTER";function bl(e){return bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bl(e)}function El(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Sl(e){return JSON.stringify(e)}function Ol(e){return JSON.parse(e)}function Cl(e){}function kl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function Pl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?kl(n,!0).forEach((function(t){jl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):kl(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function jl(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rl(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Nl(n,!0).forEach((function(t){Ll(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Ll(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Il,Fl,Ml,Al,Tl,Dl,Vl,Gl,zl,Bl,Hl={registry:[],bootstrapped:!1},ql=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Hl,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case wl:return _l({},e,{registry:[].concat(Rl(e.registry),[t.key])});case gl:var n=e.registry.indexOf(t.key),r=Rl(e.registry);return r.splice(n,1),_l({},e,{registry:r,bootstrapped:0===r.length});default:return e}},Ul=n(851),$l=wa({inventory:ei,orders:_i}),Wl={key:"root",storage:Ul.Z,whitelist:["inventory","orders"]},Zl=(Fl=$l,Ml=void 0!==(Il=Wl).version?Il.version:-1,Al=void 0===Il.stateReconciler?function(e,t,n,r){r.debug;var o=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?El(n,!0).forEach((function(t){xl(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):El(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},n);return e&&"object"===bl(e)&&Object.keys(e).forEach((function(r){"_persist"!==r&&t[r]===n[r]&&(o[r]=e[r])})),o}:Il.stateReconciler,Tl=Il.getStoredState||function(e){var t,n=e.transforms||[],r="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key),o=e.storage;return e.debug,t=!1===e.deserialize?function(e){return e}:"function"==typeof e.deserialize?e.deserialize:Ol,o.getItem(r).then((function(e){if(e)try{var r={},o=t(e);return Object.keys(o).forEach((function(e){r[e]=n.reduceRight((function(t,n){return n.out(t,e,o)}),t(o[e]))})),r}catch(e){throw e}}))},Dl=void 0!==Il.timeout?Il.timeout:5e3,Vl=null,Gl=!1,zl=!0,Bl=function(e){return e._persist.rehydrated&&Vl&&!zl&&Vl.update(e),e},function(e,t){var n=e||{},r=n._persist,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["_persist"]);if(t.type===yl){var a=!1,i=function(e,n){a||(t.rehydrate(Il.key,e,n),a=!0)};if(Dl&&setTimeout((function(){!a&&i(void 0,new Error('redux-persist: persist timed out for persist key "'.concat(Il.key,'"')))}),Dl),zl=!1,Vl||(Vl=function(e){var t,n=e.blacklist||null,r=e.whitelist||null,o=e.transforms||[],a=e.throttle||0,i="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key),l=e.storage;t=!1===e.serialize?function(e){return e}:"function"==typeof e.serialize?e.serialize:Sl;var s=e.writeFailHandler||null,c={},u={},f=[],p=null,d=null;function m(){if(0===f.length)return p&&clearInterval(p),void(p=null);var e=f.shift(),n=o.reduce((function(t,n){return n.in(t,e,c)}),c[e]);if(void 0!==n)try{u[e]=t(n)}catch(e){console.error("redux-persist/createPersistoid: error serializing state",e)}else delete u[e];0===f.length&&(Object.keys(u).forEach((function(e){void 0===c[e]&&delete u[e]})),d=l.setItem(i,t(u)).catch(h))}function g(e){return!(r&&-1===r.indexOf(e)&&"_persist"!==e||n&&-1!==n.indexOf(e))}function h(e){s&&s(e)}return{update:function(e){Object.keys(e).forEach((function(t){g(t)&&c[t]!==e[t]&&-1===f.indexOf(t)&&f.push(t)})),Object.keys(c).forEach((function(t){void 0===e[t]&&g(t)&&-1===f.indexOf(t)&&void 0!==c[t]&&f.push(t)})),null===p&&(p=setInterval(m,a)),c=e},flush:function(){for(;0!==f.length;)m();return d||Promise.resolve()}}}(Il)),r)return Pl({},Fl(o,t),{_persist:r});if("function"!=typeof t.rehydrate||"function"!=typeof t.register)throw new Error("redux-persist: either rehydrate or register is not a function on the PERSIST action. This can happen if the action is being replayed. This is an unexplored use case, please open an issue and we will figure out a resolution.");return t.register(Il.key),Tl(Il).then((function(e){var t=Il.migrate||function(e,t){return Promise.resolve(e)};t(e,Ml).then((function(e){i(e)}),(function(e){i(void 0,e)}))}),(function(e){i(void 0,e)})),Pl({},Fl(o,t),{_persist:{version:Ml,rehydrated:!1}})}if(t.type===vl)return Gl=!0,t.result(function(e){var t=e.storage,n="".concat(void 0!==e.keyPrefix?e.keyPrefix:dl).concat(e.key);return t.removeItem(n,Cl)}(Il)),Pl({},Fl(o,t),{_persist:r});if(t.type===ml)return t.result(Vl&&Vl.flush()),Pl({},Fl(o,t),{_persist:r});if(t.type===hl)zl=!0;else if(t.type===gl){if(Gl)return Pl({},o,{_persist:Pl({},r,{rehydrated:!0})});if(t.key===Il.key){var l=Fl(o,t),s=t.payload,c=Pl({},!1!==Al&&void 0!==s?Al(s,e,l,Il):l,{_persist:Pl({},r,{rehydrated:!0})});return Bl(c)}}if(!r)return Fl(e,t);var u=Fl(o,t);return u===o?e:Bl(Pl({},u,{_persist:r}))}),Yl=function(e){var t,n=function(e){return function(e){void 0===e&&(e={});var t=e.thunk,n=void 0===t||t,r=(e.immutableCheck,e.serializableCheck,e.actionCreatorCheck,new Va);return n&&("boolean"!=typeof n?r.push(Oa.withExtraArgument(n.extraArgument)):r.push(Oa)),r}(e)},r=e||{},o=r.reducer,a=void 0===o?void 0:o,i=r.middleware,l=void 0===i?n():i,s=r.devTools,c=void 0===s||s,u=r.preloadedState,f=void 0===u?void 0:u,p=r.enhancers,d=void 0===p?void 0:p;if("function"==typeof a)t=a;else{if(!function(e){if("object"!=typeof e||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var n=t;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return t===n}(a))throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');t=wa(a)}var m=l;"function"==typeof m&&(m=m(n));var g=Ea.apply(void 0,m),h=ba;c&&(h=Ta(Ma({trace:!1},"object"==typeof c&&c)));var y=new Ga(g),v=y;return Array.isArray(d)?v=Pa([g],d):"function"==typeof d&&(v=d(y)),va(t,f,h.apply(void 0,v))}({reducer:Zl,middleware:function(e){return e({serializableCheck:!1})}}),Kl=function(e,t,n){var r=!1,o=va(ql,Hl,void 0),a=function(e){o.dispatch({type:wl,key:e})},i=function(t,n,a){var i={type:gl,payload:n,err:a,key:t};e.dispatch(i),o.dispatch(i),r&&l.getState().bootstrapped&&(r(),r=!1)},l=_l({},o,{purge:function(){var t=[];return e.dispatch({type:vl,result:function(e){t.push(e)}}),Promise.all(t)},flush:function(){var t=[];return e.dispatch({type:ml,result:function(e){t.push(e)}}),Promise.all(t)},pause:function(){e.dispatch({type:hl})},persist:function(){e.dispatch({type:yl,register:a,rehydrate:i})}});return l.persist(),l}(Yl),Xl=document.getElementById("square-woo-sync");null!=Xl&&(0,e.createRoot)(Xl).render(wp.element.createElement(React.Fragment,null,wp.element.createElement(O,{className:"toast-position",position:"top-center",autoClose:500,hideProgressBar:!0,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!0,draggable:!0,pauseOnHover:!0,theme:"light"}),wp.element.createElement((function({store:e,context:n,children:r,serverState:o,stabilityCheck:a="once",noopCheck:i="once"}){const l=t.useMemo((()=>{const t=function(e,t){let n,r=K,o=0,a=!1;function i(){c.onStateChange&&c.onStateChange()}function l(){o++,n||(n=t?t.addNestedSub(i):e.subscribe(i),r=function(){const e=V();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function s(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=K)}const c={addNestedSub:function(e){l();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),s())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:i,isSubscribed:function(){return a},trySubscribe:function(){a||(a=!0,l())},tryUnsubscribe:function(){a&&(a=!1,s())},getListeners:()=>r};return c}(e);return{store:e,subscription:t,getServerState:o?()=>o:void 0,stabilityCheck:a,noopCheck:i}}),[e,o,a,i]),s=t.useMemo((()=>e.getState()),[e]);X((()=>{const{subscription:t}=l;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),s!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[l,s]);const c=n||H;return t.createElement(c.Provider,{value:l},r)}),{store:Yl},wp.element.createElement(fe,{loading:null,persistor:Kl},wp.element.createElement((function(){return wp.element.createElement(xt,null,wp.element.createElement(_t,null,wp.element.createElement(Dr,null,wp.element.createElement(mt,null,pl.map((function(e,t){return wp.element.createElement(pt,{key:t,path:e.path,element:wp.element.createElement(e.element,null)})}))))))}),null)))))})()})(); -
squarewoosync/trunk/package.json
r3046624 r3048093 1 1 { 2 2 "name": "squarewoosync", 3 "version": "1.5. 1",3 "version": "1.5.2", 4 4 "description": "", 5 5 "main": "src/index.js", -
squarewoosync/trunk/readme.txt
r3046624 r3048093 1 === Square WooSync===1 === SquareSync for Woocommerce === 2 2 Contributors: squarewoosync 3 3 Tags: square,inventory sync,woocommerce,square import,import,import products, square woocommerce sync, square woocommerce import … … 5 5 Tested up to: 6.4 6 6 Requires PHP: 7.4 7 Stable tag: 1.5. 17 Stable tag: 1.5.2 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 103 103 104 104 == Changelog == 105 = 1.5.2 = 106 * Display name changed 107 105 108 = 1.5.1 = 106 109 * CSS hotfix -
squarewoosync/trunk/squarewoosync.php
r3046624 r3048093 2 2 3 3 /** 4 * Plugin Name: Square WooSync4 * Plugin Name: SquareSync for Woocommerce 5 5 * Plugin URI: https://squarewoosync.com 6 6 * Description: Automate inventory syncing with Square and Woocommerce. Dynanic data importing supports variations, images, categories and more. … … 10 10 * License URI: http://www.gnu.org/licenses/gpl-2.0.html 11 11 * Domain Path: /languages 12 * Version: 1.5. 112 * Version: 1.5.2 13 13 * Requires at least: 5.4 14 14 * Requires PHP: 7.4 … … 35 35 * @var string 36 36 */ 37 const VERSION = '1.5. 1';37 const VERSION = '1.5.2'; 38 38 39 39 /** -
squarewoosync/trunk/vendor/composer/installed.php
r3046624 r3048093 4 4 'pretty_version' => 'dev-main', 5 5 'version' => 'dev-main', 6 'reference' => ' 46b09fec004877af3b1a7289ab10bf72711b2923',6 'reference' => '3e6d2661bd6da95ad79803024c730c0290150655', 7 7 'type' => 'project', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-main', 15 15 'version' => 'dev-main', 16 'reference' => ' 46b09fec004877af3b1a7289ab10bf72711b2923',16 'reference' => '3e6d2661bd6da95ad79803024c730c0290150655', 17 17 'type' => 'project', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.