@simpoobusiness/sdk 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -218,5 +218,5 @@ to {
218
218
  animation: ${Yw} 2.5s cubic-bezier(0.35, 0.04, 0.63, 0.95) infinite;
219
219
  `,Hw.svg`
220
220
  transform-origin: 50% 65%;
221
- `,Array(12).fill(0);let nx=1;const rx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...r}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:nx++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:i,title:n}):t):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let o,a=void 0!==n;const i=r.then(async e=>{o=["resolve",e];if(M.isValidElement(e))a=!1,this.create({id:n,type:"default",message:e});else if(ox(e)&&!e.ok){a=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;const r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"success",description:o,...i})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{const n=(null==t?void 0:t.id)||nx++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ox=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,ax=(e,t)=>{const n=(null==t?void 0:t.id)||nx++;return rx.addToast({title:e,...t,id:n}),n},ix=Object.assign(ax,{success:rx.success,info:rx.info,warning:rx.warning,error:rx.error,custom:rx.custom,message:rx.message,promise:rx.promise,dismiss:rx.dismiss,loading:rx.loading},{getHistory:()=>rx.toasts,getToasts:()=>rx.getActiveToasts()});function sx(e,t){return function(){return e.apply(t,arguments)}}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const{toString:lx}=Object.prototype,{getPrototypeOf:ux}=Object,{iterator:cx,toStringTag:dx}=Symbol,fx=(px=Object.create(null),e=>{const t=lx.call(e);return px[t]||(px[t]=t.slice(8,-1).toLowerCase())});var px;const hx=e=>(e=e.toLowerCase(),t=>fx(t)===e),mx=e=>t=>typeof t===e,{isArray:gx}=Array,yx=mx("undefined");function bx(e){return null!==e&&!yx(e)&&null!==e.constructor&&!yx(e.constructor)&&xx(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vx=hx("ArrayBuffer");const wx=mx("string"),xx=mx("function"),Sx=mx("number"),Cx=e=>null!==e&&"object"==typeof e,kx=e=>{if("object"!==fx(e))return!1;const t=ux(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||dx in e||cx in e)},Ex=hx("Date"),Rx=hx("File"),Px=hx("Blob"),_x=hx("FileList"),Ox=hx("URLSearchParams"),[Nx,Tx,Ax,jx]=["ReadableStream","Request","Response","Headers"].map(hx);function Mx(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),gx(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(bx(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;r<a;r++)i=o[r],t.call(null,e[i],i,e)}}function Fx(e,t){if(bx(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Dx="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Lx=e=>!yx(e)&&e!==Dx;const zx=(Ix="undefined"!=typeof Uint8Array&&ux(Uint8Array),e=>Ix&&e instanceof Ix);var Ix;const $x=hx("HTMLFormElement"),Bx=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vx=hx("RegExp"),Hx=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mx(n,(n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)}),Object.defineProperties(e,r)};const Ux=hx("AsyncFunction"),qx=(Wx="function"==typeof setImmediate,Gx=xx(Dx.postMessage),Wx?setImmediate:Gx?((e,t)=>(Dx.addEventListener("message",({source:n,data:r})=>{n===Dx&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Dx.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Wx,Gx;const Kx="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Dx):"undefined"!=typeof process&&process.nextTick||qx;var Qx={isArray:gx,isArrayBuffer:vx,isBuffer:bx,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||xx(e.append)&&("formdata"===(t=fx(e))||"object"===t&&xx(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&vx(e.buffer),t},isString:wx,isNumber:Sx,isBoolean:e=>!0===e||!1===e,isObject:Cx,isPlainObject:kx,isEmptyObject:e=>{if(!Cx(e)||bx(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Nx,isRequest:Tx,isResponse:Ax,isHeaders:jx,isUndefined:yx,isDate:Ex,isFile:Rx,isBlob:Px,isRegExp:Vx,isFunction:xx,isStream:e=>Cx(e)&&xx(e.pipe),isURLSearchParams:Ox,isTypedArray:zx,isFileList:_x,forEach:Mx,merge:function e(){const{caseless:t}=Lx(this)&&this||{},n={},r=(r,o)=>{const a=t&&Fx(n,o)||o;kx(n[a])&&kx(r)?n[a]=e(n[a],r):kx(r)?n[a]=e({},r):gx(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Mx(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Mx(t,(t,r)=>{n&&xx(t)?e[r]=sx(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&ux(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:fx,kindOfTest:hx,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(gx(e))return e;let t=e.length;if(!Sx(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[cx]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$x,hasOwnProperty:Bx,hasOwnProp:Bx,reduceDescriptors:Hx,freezeMethods:e=>{Hx(e,(t,n)=>{if(xx(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];xx(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return gx(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Fx,global:Dx,isContextDefined:Lx,isSpecCompliantForm:function(e){return!!(e&&xx(e.append)&&"FormData"===e[dx]&&e[cx])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Cx(e)){if(t.indexOf(e)>=0)return;if(bx(e))return e;if(!("toJSON"in e)){t[r]=e;const o=gx(e)?[]:{};return Mx(e,(e,t)=>{const a=n(e,r+1);!yx(a)&&(o[t]=a)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ux,isThenable:e=>e&&(Cx(e)||xx(e))&&xx(e.then)&&xx(e.catch),setImmediate:qx,asap:Kx,isIterable:e=>null!=e&&xx(e[cx])};function Xx(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Qx.inherits(Xx,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qx.toJSONObject(this.config),code:this.code,status:this.status}}});const Yx=Xx.prototype,Zx={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zx[e]={value:e}}),Object.defineProperties(Xx,Zx),Object.defineProperty(Yx,"isAxiosError",{value:!0}),Xx.from=(e,t,n,r,o,a)=>{const i=Object.create(Yx);return Qx.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Xx.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};function Jx(e){return Qx.isPlainObject(e)||Qx.isArray(e)}function eS(e){return Qx.endsWith(e,"[]")?e.slice(0,-2):e}function tS(e,t,n){return e?e.concat(t).map(function(e,t){return e=eS(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const nS=Qx.toFlatObject(Qx,{},null,function(e){return/^is[A-Z]/.test(e)});function rS(e,t,n){if(!Qx.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Qx.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Qx.isUndefined(t[e])})).metaTokens,o=n.visitor||u,a=n.dots,i=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Qx.isSpecCompliantForm(t);if(!Qx.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Qx.isDate(e))return e.toISOString();if(Qx.isBoolean(e))return e.toString();if(!s&&Qx.isBlob(e))throw new Xx("Blob is not supported. Use a Buffer instead.");return Qx.isArrayBuffer(e)||Qx.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Qx.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Qx.isArray(e)&&function(e){return Qx.isArray(e)&&!e.some(Jx)}(e)||(Qx.isFileList(e)||Qx.endsWith(n,"[]"))&&(s=Qx.toArray(e)))return n=eS(n),s.forEach(function(e,r){!Qx.isUndefined(e)&&null!==e&&t.append(!0===i?tS([n],r,a):null===i?n:n+"[]",l(e))}),!1;return!!Jx(e)||(t.append(tS(o,n,a),l(e)),!1)}const c=[],d=Object.assign(nS,{defaultVisitor:u,convertValue:l,isVisitable:Jx});if(!Qx.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Qx.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),Qx.forEach(n,function(n,a){!0===(!(Qx.isUndefined(n)||null===n)&&o.call(t,n,Qx.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])}),c.pop()}}(e),t}function oS(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function aS(e,t){this._pairs=[],e&&rS(e,this,t)}const iS=aS.prototype;function sS(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lS(e,t,n){if(!t)return e;const r=n&&n.encode||sS;Qx.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(a=o?o(t,n):Qx.isURLSearchParams(t)?t.toString():new aS(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}iS.append=function(e,t){this._pairs.push([e,t])},iS.toString=function(e){const t=e?function(t){return e.call(this,t,oS)}:oS;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class uS{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Qx.forEach(this.handlers,function(t){null!==t&&e(t)})}}var cS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dS={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:aS,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const fS="undefined"!=typeof window&&"undefined"!=typeof document,pS="object"==typeof navigator&&navigator||void 0,hS=fS&&(!pS||["ReactNative","NativeScript","NS"].indexOf(pS.product)<0),mS="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gS=fS&&window.location.href||"http://localhost";var yS={...Object.freeze({__proto__:null,hasBrowserEnv:fS,hasStandardBrowserEnv:hS,hasStandardBrowserWebWorkerEnv:mS,navigator:pS,origin:gS}),...dS};function bS(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;if(a=!a&&Qx.isArray(r)?r.length:a,s)return Qx.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i;r[a]&&Qx.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],o)&&Qx.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i}if(Qx.isFormData(e)&&Qx.isFunction(e.entries)){const n={};return Qx.forEachEntry(e,(e,r)=>{t(function(e){return Qx.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const vS={transitional:cS,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Qx.isObject(e);o&&Qx.isHTMLForm(e)&&(e=new FormData(e));if(Qx.isFormData(e))return r?JSON.stringify(bS(e)):e;if(Qx.isArrayBuffer(e)||Qx.isBuffer(e)||Qx.isStream(e)||Qx.isFile(e)||Qx.isBlob(e)||Qx.isReadableStream(e))return e;if(Qx.isArrayBufferView(e))return e.buffer;if(Qx.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return rS(e,new yS.classes.URLSearchParams,{visitor:function(e,t,n,r){return yS.isNode&&Qx.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=Qx.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return rS(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Qx.isString(e))try{return(t||JSON.parse)(e),Qx.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||vS.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Qx.isResponse(e)||Qx.isReadableStream(e))return e;if(e&&Qx.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Xx.from(e,Xx.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yS.classes.FormData,Blob:yS.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qx.forEach(["delete","get","head","post","put","patch"],e=>{vS.headers[e]={}});const wS=Qx.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const xS=Symbol("internals");function SS(e){return e&&String(e).trim().toLowerCase()}function CS(e){return!1===e||null==e?e:Qx.isArray(e)?e.map(CS):String(e)}function kS(e,t,n,r,o){return Qx.isFunction(r)?r.call(this,t,n):(o&&(t=n),Qx.isString(t)?Qx.isString(r)?-1!==t.indexOf(r):Qx.isRegExp(r)?r.test(t):void 0:void 0)}let ES=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=SS(t);if(!o)throw new Error("header name must be a non-empty string");const a=Qx.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=CS(e))}const a=(e,t)=>Qx.forEach(e,(e,n)=>o(e,n,t));if(Qx.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Qx.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&wS[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Qx.isObject(e)&&Qx.isIterable(e)){let n,r,o={};for(const t of e){if(!Qx.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Qx.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=SS(e)){const n=Qx.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Qx.isFunction(t))return t.call(this,e,n);if(Qx.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=SS(e)){const n=Qx.findKey(this,e);return!(!n||void 0===this[n]||t&&!kS(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=SS(e)){const o=Qx.findKey(n,e);!o||t&&!kS(0,n[o],o,t)||(delete n[o],r=!0)}}return Qx.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!kS(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Qx.forEach(this,(r,o)=>{const a=Qx.findKey(n,o);if(a)return t[a]=CS(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=CS(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Qx.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Qx.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[xS]=this[xS]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=SS(e);t[r]||(!function(e,t){const n=Qx.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Qx.isArray(e)?e.forEach(r):r(e),this}};function RS(e,t){const n=this||vS,r=t||n,o=ES.from(r.headers);let a=r.data;return Qx.forEach(e,function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function PS(e){return!(!e||!e.__CANCEL__)}function _S(e,t,n){Xx.call(this,null==e?"canceled":e,Xx.ERR_CANCELED,t,n),this.name="CanceledError"}function OS(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Xx("Request failed with status code "+n.status,[Xx.ERR_BAD_REQUEST,Xx.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}ES.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Qx.reduceDescriptors(ES.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Qx.freezeMethods(ES),Qx.inherits(_S,Xx,{__CANCEL__:!0});const NS=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),u=r[i];o||(o=l),n[a]=s,r[a]=l;let c=i,d=0;for(;c!==a;)d+=n[c++],c%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),l-o<t)return;const f=u&&l-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,a=1e3/t;const i=(t,a=Date.now())=>{o=a,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=a?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},a-s)))},()=>n&&i(n)]}(n=>{const a=n.loaded,i=n.lengthComputable?n.total:void 0,s=a-r,l=o(s);r=a;e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&a<=i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},TS=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},AS=e=>(...t)=>Qx.asap(()=>e(...t));var jS=yS.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yS.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yS.origin),yS.navigator&&/(msie|trident)/i.test(yS.navigator.userAgent)):()=>!0,MS=yS.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];Qx.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Qx.isString(r)&&i.push("path="+r),Qx.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function FS(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const DS=e=>e instanceof ES?{...e}:e;function LS(e,t){t=t||{};const n={};function r(e,t,n,r){return Qx.isPlainObject(e)&&Qx.isPlainObject(t)?Qx.merge.call({caseless:r},e,t):Qx.isPlainObject(t)?Qx.merge({},t):Qx.isArray(t)?t.slice():t}function o(e,t,n,o){return Qx.isUndefined(t)?Qx.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function a(e,t){if(!Qx.isUndefined(t))return r(void 0,t)}function i(e,t){return Qx.isUndefined(t)?Qx.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const l={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(DS(e),DS(t),0,!0)};return Qx.forEach(Object.keys({...e,...t}),function(r){const a=l[r]||o,i=a(e[r],t[r],r);Qx.isUndefined(i)&&a!==s||(n[r]=i)}),n}var zS=e=>{const t=LS({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=ES.from(s),t.url=lS(FS(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Qx.isFormData(r))if(yS.hasStandardBrowserEnv||yS.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(yS.hasStandardBrowserEnv&&(o&&Qx.isFunction(o)&&(o=o(t)),o||!1!==o&&jS(t.url))){const e=a&&i&&MS.read(i);e&&s.set(a,e)}return t};var IS="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=zS(e);let o=r.data;const a=ES.from(r.headers).normalize();let i,s,l,u,c,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ES.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());OS(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Xx("Request aborted",Xx.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Xx("Network Error",Xx.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||cS;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Xx(t,o.clarifyTimeoutError?Xx.ETIMEDOUT:Xx.ECONNABORTED,e,m)),m=null},void 0===o&&a.setContentType(null),"setRequestHeader"in m&&Qx.forEach(a.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Qx.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([l,c]=NS(p,!0),m.addEventListener("progress",l)),f&&m.upload&&([s,u]=NS(f),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new _S(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===yS.protocols.indexOf(y)?n(new Xx("Unsupported protocol "+y+":",Xx.ERR_BAD_REQUEST,e)):m.send(o||null)})};const $S=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Xx?t:new _S(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new Xx(`timeout ${t} of ms exceeded`,Xx.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Qx.asap(i),s}},BS=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},VS=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},HS=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of VS(e))yield*BS(n,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=i+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},US="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,qS=US&&"function"==typeof ReadableStream,WS=US&&("function"==typeof TextEncoder?(GS=new TextEncoder,e=>GS.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var GS;const KS=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},QS=qS&&KS(()=>{let e=!1;const t=new Request(yS.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),XS=qS&&KS(()=>Qx.isReadableStream(new Response("").body)),YS={stream:XS&&(e=>e.body)};var ZS;US&&(ZS=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!YS[e]&&(YS[e]=Qx.isFunction(ZS[e])?t=>t[e]():(t,n)=>{throw new Xx(`Response type '${e}' is not supported`,Xx.ERR_NOT_SUPPORT,n)})}));const JS=async(e,t)=>{const n=Qx.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Qx.isBlob(e))return e.size;if(Qx.isSpecCompliantForm(e)){const t=new Request(yS.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Qx.isArrayBufferView(e)||Qx.isArrayBuffer(e)?e.byteLength:(Qx.isURLSearchParams(e)&&(e+=""),Qx.isString(e)?(await WS(e)).byteLength:void 0)})(t):n};var eC=US&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:a,timeout:i,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=zS(e);u=u?(u+"").toLowerCase():"text";let p,h=$S([o,a&&a.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&&QS&&"get"!==n&&"head"!==n&&0!==(g=await JS(c,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Qx.isFormData(r)&&(e=n.headers.get("content-type"))&&c.setContentType(e),n.body){const[e,t]=TS(g,NS(AS(l)));r=HS(n.body,65536,e,t)}}Qx.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let a=await fetch(p,f);const i=XS&&("stream"===u||"response"===u);if(XS&&(s||i&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=a[t]});const t=Qx.toFiniteNumber(a.headers.get("content-length")),[n,r]=s&&TS(t,NS(AS(s),!0))||[];a=new Response(HS(a.body,65536,n,()=>{r&&r(),m&&m()}),e)}u=u||"text";let y=await YS[Qx.findKey(YS,u)||"text"](a,e);return!i&&m&&m(),await new Promise((t,n)=>{OS(t,n,{data:y,headers:ES.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:p})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Xx("Network Error",Xx.ERR_NETWORK,e,p),{cause:t.cause||t});throw Xx.from(t,t&&t.code,e,p)}});const tC={http:null,xhr:IS,fetch:eC};Qx.forEach(tC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const nC=e=>`- ${e}`,rC=e=>Qx.isFunction(e)||null===e||!1===e;var oC=e=>{e=Qx.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!rC(n)&&(r=tC[(t=String(n)).toLowerCase()],void 0===r))throw new Xx(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+a]=r}if(!r){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Xx("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(nC).join("\n"):" "+nC(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function aC(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _S(null,e)}function iC(e){aC(e),e.headers=ES.from(e.headers),e.data=RS.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return oC(e.adapter||vS.adapter)(e).then(function(t){return aC(e),t.data=RS.call(e,e.transformResponse,t),t.headers=ES.from(t.headers),t},function(t){return PS(t)||(aC(e),t&&t.response&&(t.response.data=RS.call(e,e.transformResponse,t.response),t.response.headers=ES.from(t.response.headers))),Promise.reject(t)})}const sC="1.11.0",lC={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lC[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const uC={};lC.transitional=function(e,t,n){function r(e,t){return"[Axios v"+sC+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,a)=>{if(!1===e)throw new Xx(r(o," has been removed"+(t?" in "+t:"")),Xx.ERR_DEPRECATED);return t&&!uC[o]&&(uC[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}},lC.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var cC={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Xx("options must be an object",Xx.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new Xx("option "+a+" must be "+n,Xx.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Xx("Unknown option "+a,Xx.ERR_BAD_OPTION)}},validators:lC};const dC=cC.validators;let fC=class{constructor(e){this.defaults=e||{},this.interceptors={request:new uS,response:new uS}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=LS(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&cC.assertOptions(n,{silentJSONParsing:dC.transitional(dC.boolean),forcedJSONParsing:dC.transitional(dC.boolean),clarifyTimeoutError:dC.transitional(dC.boolean)},!1),null!=r&&(Qx.isFunction(r)?t.paramsSerializer={serialize:r}:cC.assertOptions(r,{encode:dC.function,serialize:dC.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cC.assertOptions(t,{baseUrl:dC.spelling("baseURL"),withXsrfToken:dC.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&Qx.merge(o.common,o[t.method]);o&&Qx.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ES.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,d=0;if(!s){const e=[iC.bind(this),void 0];for(e.unshift(...i),e.push(...l),c=e.length,u=Promise.resolve(t);d<c;)u=u.then(e[d++],e[d++]);return u}c=i.length;let f=t;for(d=0;d<c;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=iC.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,c=l.length;d<c;)u=u.then(l[d++],l[d++]);return u}getUri(e){return lS(FS((e=LS(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Qx.forEach(["delete","get","head","options"],function(e){fC.prototype[e]=function(t,n){return this.request(LS(n||{},{method:e,url:t,data:(n||{}).data}))}}),Qx.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(LS(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}fC.prototype[e]=t(),fC.prototype[e+"Form"]=t(!0)});const pC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pC).forEach(([e,t])=>{pC[t]=e});const hC=function e(t){const n=new fC(t),r=sx(fC.prototype.request,n);return Qx.extend(r,fC.prototype,n,{allOwnKeys:!0}),Qx.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(LS(t,n))},r}(vS);hC.Axios=fC,hC.CanceledError=_S,hC.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new _S(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;const n=new e(function(e){t=e});return{token:n,cancel:t}}},hC.isCancel=PS,hC.VERSION=sC,hC.toFormData=rS,hC.AxiosError=Xx,hC.Cancel=hC.CanceledError,hC.all=function(e){return Promise.all(e)},hC.spread=function(e){return function(t){return e.apply(null,t)}},hC.isAxiosError=function(e){return Qx.isObject(e)&&!0===e.isAxiosError},hC.mergeConfig=LS,hC.AxiosHeaders=ES,hC.formToJSON=e=>bS(Qx.isHTMLForm(e)?new FormData(e):e),hC.getAdapter=oC,hC.HttpStatusCode=pC,hC.default=hC;const{Axios:mC,AxiosError:gC,CanceledError:yC,isCancel:bC,CancelToken:vC,VERSION:wC,all:xC,Cancel:SC,isAxiosError:CC,spread:kC,toFormData:EC,AxiosHeaders:RC,HttpStatusCode:PC,formToJSON:_C,getAdapter:OC,mergeConfig:NC}=hC,TC=(e,t,n={})=>{const{apiKey:r}=Cn(),o=(e=>{e||console.warn("⚠️ No API key provided to createApiClient");const t=hC.create({baseURL:"https://biz.api.simpoocodes.com/api/gateway/v1",headers:{"Content-Type":"application/json","SIMPOO-API-KEY":e}});return t.interceptors.request.use(t=>(e&&t.headers&&(t.headers["SIMPOO-API-KEY"]=e),t),e=>Promise.reject(e)),t.interceptors.response.use(e=>e,e=>(e.response?console.error("API Error:",e.response.status,e.response.data):console.error("Network or Axios Error:",e.message),Promise.reject(e))),t})(r||"");return function(e){return xn(e,dn)}({queryKey:e,queryFn:()=>(async e=>{try{const{data:t}=await o.get(e);return t}catch(e){AC(e)}})(t),...n})},AC=e=>{e?.response?(console.log("response data:",e.response.data),console.log("Status Code:",e.response.status),console.log("Status Text:",e.response.statusText),500===e.response.status?ix.error("Something went wrong",{position:"top-right"}):e.response.data&&e.response.data.message&&ix.error(`${e.response?.data?.message}`,{position:"top-right"})):(e.request,console.log(e?.message),ix.error(`${e?.message}`,{position:"top-right"}))},jC="https://unpkg.com/@simpoobusiness/sdk/dist/simpoo-sdk.css";let MC={};function FC(e){MC=e}const DC={inventory:()=>{const[e,t]=M.useState(),{currentPage:n,perview:r}=ne(e=>e.app),[o,a]=j.useState("all"),[i,s]=j.useState(!1),[l,u]=j.useState("all"),[c,d]=j.useState("");tx(c,1e3);const{apiKey:f}=Cn(),{data:p,isFetching:h}=TC(["items",r.toString(),n?.toString(),o],`/outbound/items?page=${n}&paginate=${r}&status=all`,{enabled:!!f}),g=p?.data?.[0]||[],y=g?.data?.map(e=>({item_description:e?.name,all_quantity:+e?.all_quantity,quantity:+e?.quantity,type:e?.item_type?.name,selling_price:+e?.selling_price,categories:e?.category||[],tags:e?.item_tags?.map(e=>e.name)||[],status:e?.status?"published":"draft",sku:e?.sku,item_image:e.images?.length>0?e.images[0].image:"https://unpkg.com/@simpoobusiness/sdk/dist/assets/placeholder-imageaf93498c918127fb.svg",barcode:e?.barcode,expired:e?.expired,expiring:e?.expiring,unit:e?.item_unit,uuid:e?.uuid,item_type_id:e?.item_type?.uuid,reorder_level:e?.reorder_level,fullData:e})),{data:b,isFetching:v}=TC(["items-tab"],"/outbound/items/count",{enabled:!!f}),w=b?.data,x=[{label:"all",count:w?.all||0,action:()=>a("all")},{label:"published",count:w?.published||0,action:()=>a("published")},{label:"out of stock",count:w?.out_of_stock||0,action:()=>a("out_of_stock")},{label:"draft",count:w?.draft||0,action:()=>a("draft")},{label:"expiring",count:w?.expiring||0,action:()=>a("expiring")},{label:"expired",count:w?.expired||0,action:()=>a("expired")}];return m.jsxs(nb,{className:"px-4 py-6 flex flex-col gap-8",children:[m.jsx(hb,{tabs:x,loading:h}),m.jsxs("div",{className:" flex items-center justify-between flex-wrap gap-4",children:[m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx(Jw,{placeholder:"Search Item name, barcode or sku",value:c,onChange:e=>d(e.target.value)}),h?m.jsx(zo,{className:"w-20 h-6"}):m.jsxs("p",{className:"text-dark text-sm font-medium",children:[g?.meta?.total??0," ",m.jsx("span",{className:"text-gray-700",children:"Items"})]})]}),m.jsxs("div",{className:"flex gap-4",children:[m.jsx(Zw,{label:"Filter",left_addon:M.cloneElement(Ry.filter_edit,{fill:"#5E6278"}),onClick:()=>s(!0),className:"!font-medium !bg-gray-200 hover:!bg-gray-300 !text-gray-700 !text-sm !h-12"}),m.jsx(Zw,{label:"Create New",left_addon:Ry.plus_squared,className:"!font-medium !text-sm !h-12",onClick:()=>alert("create new item")})]})]}),m.jsx(fb,{loading:h,data:p?.data?.[1],meta:g?.meta}),m.jsx(Oy,{loading:h,columns:eb,data:y||[],emptyData:0===y.length,emptyProps:{header:"No item yet",subText:"Add new item to start managing your inventory."},tHeadClass:"whitespace-nowrap",tbCellClass:"text-dark font-semibold",meta:g?.meta})]})}};function LC(e,t){!function(){if(!document.querySelector(`link[href="${jC}"]`)){const e=document.createElement("link");e.rel="stylesheet",e.href=jC,document.head.appendChild(e)}}();const n=DC[e];if(!n)return void console.error(`SimpooSDK: Widget "${e}" not found.`);const r=document.querySelector(t);if(!r)throw new Error(`Container "${t}" not found!`);A.createRoot(r).render(m.jsx(kn,{apiKey:MC.apiKey||"",children:m.jsx(n,{})}))}"undefined"!=typeof window&&(window.SimpooSDK={init:FC,renderWidget:LC}),e.init=FC,e.renderWidget=LC});
221
+ `,Array(12).fill(0);let nx=1;const rx=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{const t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;const{message:n,...r}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:nx++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:n}),{...t,...e,id:o,dismissible:i,title:n}):t):this.addToast({title:n,...r,dismissible:i,id:o}),o},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let n;void 0!==t.loading&&(n=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));const r=Promise.resolve(e instanceof Function?e():e);let o,a=void 0!==n;const i=r.then(async e=>{o=["resolve",e];if(M.isValidElement(e))a=!1,this.create({id:n,type:"default",message:e});else if(ox(e)&&!e.ok){a=!1;const r="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(e instanceof Error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}else if(void 0!==t.success){a=!1;const r="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"success",description:o,...i})}}).catch(async e=>{if(o=["reject",e],void 0!==t.error){a=!1;const r="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description,i="object"==typeof r&&!M.isValidElement(r)?r:{message:r};this.create({id:n,type:"error",description:o,...i})}}).finally(()=>{a&&(this.dismiss(n),n=void 0),null==t.finally||t.finally.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===o[0]?t(o[1]):e(o[1])).catch(t));return"string"!=typeof n&&"number"!=typeof n?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{const n=(null==t?void 0:t.id)||nx++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ox=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,ax=(e,t)=>{const n=(null==t?void 0:t.id)||nx++;return rx.addToast({title:e,...t,id:n}),n},ix=Object.assign(ax,{success:rx.success,info:rx.info,warning:rx.warning,error:rx.error,custom:rx.custom,message:rx.message,promise:rx.promise,dismiss:rx.dismiss,loading:rx.loading},{getHistory:()=>rx.toasts,getToasts:()=>rx.getActiveToasts()});function sx(e,t){return function(){return e.apply(t,arguments)}}!function(e){if("undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}");const{toString:lx}=Object.prototype,{getPrototypeOf:ux}=Object,{iterator:cx,toStringTag:dx}=Symbol,fx=(px=Object.create(null),e=>{const t=lx.call(e);return px[t]||(px[t]=t.slice(8,-1).toLowerCase())});var px;const hx=e=>(e=e.toLowerCase(),t=>fx(t)===e),mx=e=>t=>typeof t===e,{isArray:gx}=Array,yx=mx("undefined");function bx(e){return null!==e&&!yx(e)&&null!==e.constructor&&!yx(e.constructor)&&xx(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const vx=hx("ArrayBuffer");const wx=mx("string"),xx=mx("function"),Sx=mx("number"),Cx=e=>null!==e&&"object"==typeof e,kx=e=>{if("object"!==fx(e))return!1;const t=ux(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||dx in e||cx in e)},Ex=hx("Date"),Rx=hx("File"),Px=hx("Blob"),_x=hx("FileList"),Ox=hx("URLSearchParams"),[Nx,Tx,Ax,jx]=["ReadableStream","Request","Response","Headers"].map(hx);function Mx(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,o;if("object"!=typeof e&&(e=[e]),gx(e))for(r=0,o=e.length;r<o;r++)t.call(null,e[r],r,e);else{if(bx(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let i;for(r=0;r<a;r++)i=o[r],t.call(null,e[i],i,e)}}function Fx(e,t){if(bx(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,o=n.length;for(;o-- >0;)if(r=n[o],t===r.toLowerCase())return r;return null}const Dx="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Lx=e=>!yx(e)&&e!==Dx;const zx=(Ix="undefined"!=typeof Uint8Array&&ux(Uint8Array),e=>Ix&&e instanceof Ix);var Ix;const $x=hx("HTMLFormElement"),Bx=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),Vx=hx("RegExp"),Hx=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Mx(n,(n,o)=>{let a;!1!==(a=t(n,o,e))&&(r[o]=a||n)}),Object.defineProperties(e,r)};const Ux=hx("AsyncFunction"),qx=(Wx="function"==typeof setImmediate,Gx=xx(Dx.postMessage),Wx?setImmediate:Gx?((e,t)=>(Dx.addEventListener("message",({source:n,data:r})=>{n===Dx&&r===e&&t.length&&t.shift()()},!1),n=>{t.push(n),Dx.postMessage(e,"*")}))(`axios@${Math.random()}`,[]):e=>setTimeout(e));var Wx,Gx;const Kx="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Dx):"undefined"!=typeof process&&process.nextTick||qx;var Qx={isArray:gx,isArrayBuffer:vx,isBuffer:bx,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||xx(e.append)&&("formdata"===(t=fx(e))||"object"===t&&xx(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&vx(e.buffer),t},isString:wx,isNumber:Sx,isBoolean:e=>!0===e||!1===e,isObject:Cx,isPlainObject:kx,isEmptyObject:e=>{if(!Cx(e)||bx(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Nx,isRequest:Tx,isResponse:Ax,isHeaders:jx,isUndefined:yx,isDate:Ex,isFile:Rx,isBlob:Px,isRegExp:Vx,isFunction:xx,isStream:e=>Cx(e)&&xx(e.pipe),isURLSearchParams:Ox,isTypedArray:zx,isFileList:_x,forEach:Mx,merge:function e(){const{caseless:t}=Lx(this)&&this||{},n={},r=(r,o)=>{const a=t&&Fx(n,o)||o;kx(n[a])&&kx(r)?n[a]=e(n[a],r):kx(r)?n[a]=e({},r):gx(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&Mx(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(Mx(t,(t,r)=>{n&&xx(t)?e[r]=sx(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let o,a,i;const s={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),a=o.length;a-- >0;)i=o[a],r&&!r(i,e,t)||s[i]||(t[i]=e[i],s[i]=!0);e=!1!==n&&ux(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:fx,kindOfTest:hx,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(gx(e))return e;let t=e.length;if(!Sx(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[cx]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:$x,hasOwnProperty:Bx,hasOwnProp:Bx,reduceDescriptors:Hx,freezeMethods:e=>{Hx(e,(t,n)=>{if(xx(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];xx(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return gx(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:Fx,global:Dx,isContextDefined:Lx,isSpecCompliantForm:function(e){return!!(e&&xx(e.append)&&"FormData"===e[dx]&&e[cx])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(Cx(e)){if(t.indexOf(e)>=0)return;if(bx(e))return e;if(!("toJSON"in e)){t[r]=e;const o=gx(e)?[]:{};return Mx(e,(e,t)=>{const a=n(e,r+1);!yx(a)&&(o[t]=a)}),t[r]=void 0,o}}return e};return n(e,0)},isAsyncFn:Ux,isThenable:e=>e&&(Cx(e)||xx(e))&&xx(e.then)&&xx(e.catch),setImmediate:qx,asap:Kx,isIterable:e=>null!=e&&xx(e[cx])};function Xx(e,t,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}Qx.inherits(Xx,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Qx.toJSONObject(this.config),code:this.code,status:this.status}}});const Yx=Xx.prototype,Zx={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Zx[e]={value:e}}),Object.defineProperties(Xx,Zx),Object.defineProperty(Yx,"isAxiosError",{value:!0}),Xx.from=(e,t,n,r,o,a)=>{const i=Object.create(Yx);return Qx.toFlatObject(e,i,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Xx.call(i,e.message,t,n,r,o),i.cause=e,i.name=e.name,a&&Object.assign(i,a),i};function Jx(e){return Qx.isPlainObject(e)||Qx.isArray(e)}function eS(e){return Qx.endsWith(e,"[]")?e.slice(0,-2):e}function tS(e,t,n){return e?e.concat(t).map(function(e,t){return e=eS(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const nS=Qx.toFlatObject(Qx,{},null,function(e){return/^is[A-Z]/.test(e)});function rS(e,t,n){if(!Qx.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=Qx.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!Qx.isUndefined(t[e])})).metaTokens,o=n.visitor||u,a=n.dots,i=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Qx.isSpecCompliantForm(t);if(!Qx.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(Qx.isDate(e))return e.toISOString();if(Qx.isBoolean(e))return e.toString();if(!s&&Qx.isBlob(e))throw new Xx("Blob is not supported. Use a Buffer instead.");return Qx.isArrayBuffer(e)||Qx.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,o){let s=e;if(e&&!o&&"object"==typeof e)if(Qx.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(Qx.isArray(e)&&function(e){return Qx.isArray(e)&&!e.some(Jx)}(e)||(Qx.isFileList(e)||Qx.endsWith(n,"[]"))&&(s=Qx.toArray(e)))return n=eS(n),s.forEach(function(e,r){!Qx.isUndefined(e)&&null!==e&&t.append(!0===i?tS([n],r,a):null===i?n:n+"[]",l(e))}),!1;return!!Jx(e)||(t.append(tS(o,n,a),l(e)),!1)}const c=[],d=Object.assign(nS,{defaultVisitor:u,convertValue:l,isVisitable:Jx});if(!Qx.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!Qx.isUndefined(n)){if(-1!==c.indexOf(n))throw Error("Circular reference detected in "+r.join("."));c.push(n),Qx.forEach(n,function(n,a){!0===(!(Qx.isUndefined(n)||null===n)&&o.call(t,n,Qx.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])}),c.pop()}}(e),t}function oS(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function aS(e,t){this._pairs=[],e&&rS(e,this,t)}const iS=aS.prototype;function sS(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function lS(e,t,n){if(!t)return e;const r=n&&n.encode||sS;Qx.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let a;if(a=o?o(t,n):Qx.isURLSearchParams(t)?t.toString():new aS(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}iS.append=function(e,t){this._pairs.push([e,t])},iS.toString=function(e){const t=e?function(t){return e.call(this,t,oS)}:oS;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class uS{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Qx.forEach(this.handlers,function(t){null!==t&&e(t)})}}var cS={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},dS={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:aS,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const fS="undefined"!=typeof window&&"undefined"!=typeof document,pS="object"==typeof navigator&&navigator||void 0,hS=fS&&(!pS||["ReactNative","NativeScript","NS"].indexOf(pS.product)<0),mS="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,gS=fS&&window.location.href||"http://localhost";var yS={...Object.freeze({__proto__:null,hasBrowserEnv:fS,hasStandardBrowserEnv:hS,hasStandardBrowserWebWorkerEnv:mS,navigator:pS,origin:gS}),...dS};function bS(e){function t(e,n,r,o){let a=e[o++];if("__proto__"===a)return!0;const i=Number.isFinite(+a),s=o>=e.length;if(a=!a&&Qx.isArray(r)?r.length:a,s)return Qx.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!i;r[a]&&Qx.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],o)&&Qx.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const o=n.length;let a;for(r=0;r<o;r++)a=n[r],t[a]=e[a];return t}(r[a])),!i}if(Qx.isFormData(e)&&Qx.isFunction(e.entries)){const n={};return Qx.forEachEntry(e,(e,r)=>{t(function(e){return Qx.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const vS={transitional:cS,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,o=Qx.isObject(e);o&&Qx.isHTMLForm(e)&&(e=new FormData(e));if(Qx.isFormData(e))return r?JSON.stringify(bS(e)):e;if(Qx.isArrayBuffer(e)||Qx.isBuffer(e)||Qx.isStream(e)||Qx.isFile(e)||Qx.isBlob(e)||Qx.isReadableStream(e))return e;if(Qx.isArrayBufferView(e))return e.buffer;if(Qx.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return rS(e,new yS.classes.URLSearchParams,{visitor:function(e,t,n,r){return yS.isNode&&Qx.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((a=Qx.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return rS(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||r?(t.setContentType("application/json",!1),function(e,t,n){if(Qx.isString(e))try{return(t||JSON.parse)(e),Qx.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||vS.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(Qx.isResponse(e)||Qx.isReadableStream(e))return e;if(e&&Qx.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Xx.from(e,Xx.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:yS.classes.FormData,Blob:yS.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Qx.forEach(["delete","get","head","post","put","patch"],e=>{vS.headers[e]={}});const wS=Qx.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const xS=Symbol("internals");function SS(e){return e&&String(e).trim().toLowerCase()}function CS(e){return!1===e||null==e?e:Qx.isArray(e)?e.map(CS):String(e)}function kS(e,t,n,r,o){return Qx.isFunction(r)?r.call(this,t,n):(o&&(t=n),Qx.isString(t)?Qx.isString(r)?-1!==t.indexOf(r):Qx.isRegExp(r)?r.test(t):void 0:void 0)}let ES=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function o(e,t,n){const o=SS(t);if(!o)throw new Error("header name must be a non-empty string");const a=Qx.findKey(r,o);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=CS(e))}const a=(e,t)=>Qx.forEach(e,(e,n)=>o(e,n,t));if(Qx.isPlainObject(e)||e instanceof this.constructor)a(e,t);else if(Qx.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))a((e=>{const t={};let n,r,o;return e&&e.split("\n").forEach(function(e){o=e.indexOf(":"),n=e.substring(0,o).trim().toLowerCase(),r=e.substring(o+1).trim(),!n||t[n]&&wS[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(Qx.isObject(e)&&Qx.isIterable(e)){let n,r,o={};for(const t of e){if(!Qx.isArray(t))throw TypeError("Object iterator must return a key-value pair");o[r=t[0]]=(n=o[r])?Qx.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}a(o,t)}else null!=e&&o(t,e,n);return this}get(e,t){if(e=SS(e)){const n=Qx.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(Qx.isFunction(t))return t.call(this,e,n);if(Qx.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=SS(e)){const n=Qx.findKey(this,e);return!(!n||void 0===this[n]||t&&!kS(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function o(e){if(e=SS(e)){const o=Qx.findKey(n,e);!o||t&&!kS(0,n[o],o,t)||(delete n[o],r=!0)}}return Qx.isArray(e)?e.forEach(o):o(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const o=t[n];e&&!kS(0,this[o],o,e,!0)||(delete this[o],r=!0)}return r}normalize(e){const t=this,n={};return Qx.forEach(this,(r,o)=>{const a=Qx.findKey(n,o);if(a)return t[a]=CS(r),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(o):String(o).trim();i!==o&&delete t[o],t[i]=CS(r),n[i]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Qx.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&Qx.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[xS]=this[xS]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=SS(e);t[r]||(!function(e,t){const n=Qx.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,o){return this[r].call(this,t,e,n,o)},configurable:!0})})}(n,e),t[r]=!0)}return Qx.isArray(e)?e.forEach(r):r(e),this}};function RS(e,t){const n=this||vS,r=t||n,o=ES.from(r.headers);let a=r.data;return Qx.forEach(e,function(e){a=e.call(n,a,o.normalize(),t?t.status:void 0)}),o.normalize(),a}function PS(e){return!(!e||!e.__CANCEL__)}function _S(e,t,n){Xx.call(this,null==e?"canceled":e,Xx.ERR_CANCELED,t,n),this.name="CanceledError"}function OS(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new Xx("Request failed with status code "+n.status,[Xx.ERR_BAD_REQUEST,Xx.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}ES.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Qx.reduceDescriptors(ES.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),Qx.freezeMethods(ES),Qx.inherits(_S,Xx,{__CANCEL__:!0});const NS=(e,t,n=3)=>{let r=0;const o=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o,a=0,i=0;return t=void 0!==t?t:1e3,function(s){const l=Date.now(),u=r[i];o||(o=l),n[a]=s,r[a]=l;let c=i,d=0;for(;c!==a;)d+=n[c++],c%=e;if(a=(a+1)%e,a===i&&(i=(i+1)%e),l-o<t)return;const f=u&&l-u;return f?Math.round(1e3*d/f):void 0}}(50,250);return function(e,t){let n,r,o=0,a=1e3/t;const i=(t,a=Date.now())=>{o=a,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),s=t-o;s>=a?i(e,t):(n=e,r||(r=setTimeout(()=>{r=null,i(n)},a-s)))},()=>n&&i(n)]}(n=>{const a=n.loaded,i=n.lengthComputable?n.total:void 0,s=a-r,l=o(s);r=a;e({loaded:a,total:i,progress:i?a/i:void 0,bytes:s,rate:l||void 0,estimated:l&&i&&a<=i?(i-a)/l:void 0,event:n,lengthComputable:null!=i,[t?"download":"upload"]:!0})},n)},TS=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},AS=e=>(...t)=>Qx.asap(()=>e(...t));var jS=yS.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,yS.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(yS.origin),yS.navigator&&/(msie|trident)/i.test(yS.navigator.userAgent)):()=>!0,MS=yS.hasStandardBrowserEnv?{write(e,t,n,r,o,a){const i=[e+"="+encodeURIComponent(t)];Qx.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),Qx.isString(r)&&i.push("path="+r),Qx.isString(o)&&i.push("domain="+o),!0===a&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function FS(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const DS=e=>e instanceof ES?{...e}:e;function LS(e,t){t=t||{};const n={};function r(e,t,n,r){return Qx.isPlainObject(e)&&Qx.isPlainObject(t)?Qx.merge.call({caseless:r},e,t):Qx.isPlainObject(t)?Qx.merge({},t):Qx.isArray(t)?t.slice():t}function o(e,t,n,o){return Qx.isUndefined(t)?Qx.isUndefined(e)?void 0:r(void 0,e,0,o):r(e,t,0,o)}function a(e,t){if(!Qx.isUndefined(t))return r(void 0,t)}function i(e,t){return Qx.isUndefined(t)?Qx.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,o,a){return a in t?r(n,o):a in e?r(void 0,n):void 0}const l={url:a,method:a,data:a,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:s,headers:(e,t,n)=>o(DS(e),DS(t),0,!0)};return Qx.forEach(Object.keys({...e,...t}),function(r){const a=l[r]||o,i=a(e[r],t[r],r);Qx.isUndefined(i)&&a!==s||(n[r]=i)}),n}var zS=e=>{const t=LS({},e);let n,{data:r,withXSRFToken:o,xsrfHeaderName:a,xsrfCookieName:i,headers:s,auth:l}=t;if(t.headers=s=ES.from(s),t.url=lS(FS(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Qx.isFormData(r))if(yS.hasStandardBrowserEnv||yS.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(n=s.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...t].join("; "))}if(yS.hasStandardBrowserEnv&&(o&&Qx.isFunction(o)&&(o=o(t)),o||!1!==o&&jS(t.url))){const e=a&&i&&MS.read(i);e&&s.set(a,e)}return t};var IS="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=zS(e);let o=r.data;const a=ES.from(r.headers).normalize();let i,s,l,u,c,{responseType:d,onUploadProgress:f,onDownloadProgress:p}=r;function h(){u&&u(),c&&c(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=ES.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());OS(function(e){t(e),h()},function(e){n(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Xx("Request aborted",Xx.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new Xx("Network Error",Xx.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||cS;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new Xx(t,o.clarifyTimeoutError?Xx.ETIMEDOUT:Xx.ECONNABORTED,e,m)),m=null},void 0===o&&a.setContentType(null),"setRequestHeader"in m&&Qx.forEach(a.toJSON(),function(e,t){m.setRequestHeader(t,e)}),Qx.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),p&&([l,c]=NS(p,!0),m.addEventListener("progress",l)),f&&m.upload&&([s,u]=NS(f),m.upload.addEventListener("progress",s),m.upload.addEventListener("loadend",u)),(r.cancelToken||r.signal)&&(i=t=>{m&&(n(!t||t.type?new _S(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const y=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);y&&-1===yS.protocols.indexOf(y)?n(new Xx("Unsupported protocol "+y+":",Xx.ERR_BAD_REQUEST,e)):m.send(o||null)})};const $S=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const o=function(e){if(!n){n=!0,i();const t=e instanceof Error?e:this.reason;r.abort(t instanceof Xx?t:new _S(t instanceof Error?t.message:t))}};let a=t&&setTimeout(()=>{a=null,o(new Xx(`timeout ${t} of ms exceeded`,Xx.ETIMEDOUT))},t);const i=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(o):e.removeEventListener("abort",o)}),e=null)};e.forEach(e=>e.addEventListener("abort",o));const{signal:s}=r;return s.unsubscribe=()=>Qx.asap(i),s}},BS=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,o=0;for(;o<n;)r=o+t,yield e.slice(o,r),o=r},VS=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},HS=(e,t,n,r)=>{const o=async function*(e,t){for await(const n of VS(e))yield*BS(n,t)}(e,t);let a,i=0,s=e=>{a||(a=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await o.next();if(t)return s(),void e.close();let a=r.byteLength;if(n){let e=i+=a;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw s(e),e}},cancel:e=>(s(e),o.return())},{highWaterMark:2})},US="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,qS=US&&"function"==typeof ReadableStream,WS=US&&("function"==typeof TextEncoder?(GS=new TextEncoder,e=>GS.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var GS;const KS=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},QS=qS&&KS(()=>{let e=!1;const t=new Request(yS.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),XS=qS&&KS(()=>Qx.isReadableStream(new Response("").body)),YS={stream:XS&&(e=>e.body)};var ZS;US&&(ZS=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!YS[e]&&(YS[e]=Qx.isFunction(ZS[e])?t=>t[e]():(t,n)=>{throw new Xx(`Response type '${e}' is not supported`,Xx.ERR_NOT_SUPPORT,n)})}));const JS=async(e,t)=>{const n=Qx.toFiniteNumber(e.getContentLength());return null==n?(async e=>{if(null==e)return 0;if(Qx.isBlob(e))return e.size;if(Qx.isSpecCompliantForm(e)){const t=new Request(yS.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return Qx.isArrayBufferView(e)||Qx.isArrayBuffer(e)?e.byteLength:(Qx.isURLSearchParams(e)&&(e+=""),Qx.isString(e)?(await WS(e)).byteLength:void 0)})(t):n};var eC=US&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:a,timeout:i,onDownloadProgress:s,onUploadProgress:l,responseType:u,headers:c,withCredentials:d="same-origin",fetchOptions:f}=zS(e);u=u?(u+"").toLowerCase():"text";let p,h=$S([o,a&&a.toAbortSignal()],i);const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let g;try{if(l&&QS&&"get"!==n&&"head"!==n&&0!==(g=await JS(c,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(Qx.isFormData(r)&&(e=n.headers.get("content-type"))&&c.setContentType(e),n.body){const[e,t]=TS(g,NS(AS(l)));r=HS(n.body,65536,e,t)}}Qx.isString(d)||(d=d?"include":"omit");const o="credentials"in Request.prototype;p=new Request(t,{...f,signal:h,method:n.toUpperCase(),headers:c.normalize().toJSON(),body:r,duplex:"half",credentials:o?d:void 0});let a=await fetch(p,f);const i=XS&&("stream"===u||"response"===u);if(XS&&(s||i&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=a[t]});const t=Qx.toFiniteNumber(a.headers.get("content-length")),[n,r]=s&&TS(t,NS(AS(s),!0))||[];a=new Response(HS(a.body,65536,n,()=>{r&&r(),m&&m()}),e)}u=u||"text";let y=await YS[Qx.findKey(YS,u)||"text"](a,e);return!i&&m&&m(),await new Promise((t,n)=>{OS(t,n,{data:y,headers:ES.from(a.headers),status:a.status,statusText:a.statusText,config:e,request:p})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new Xx("Network Error",Xx.ERR_NETWORK,e,p),{cause:t.cause||t});throw Xx.from(t,t&&t.code,e,p)}});const tC={http:null,xhr:IS,fetch:eC};Qx.forEach(tC,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const nC=e=>`- ${e}`,rC=e=>Qx.isFunction(e)||null===e||!1===e;var oC=e=>{e=Qx.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let a=0;a<t;a++){let t;if(n=e[a],r=n,!rC(n)&&(r=tC[(t=String(n)).toLowerCase()],void 0===r))throw new Xx(`Unknown adapter '${t}'`);if(r)break;o[t||"#"+a]=r}if(!r){const e=Object.entries(o).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Xx("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(nC).join("\n"):" "+nC(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function aC(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new _S(null,e)}function iC(e){aC(e),e.headers=ES.from(e.headers),e.data=RS.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return oC(e.adapter||vS.adapter)(e).then(function(t){return aC(e),t.data=RS.call(e,e.transformResponse,t),t.headers=ES.from(t.headers),t},function(t){return PS(t)||(aC(e),t&&t.response&&(t.response.data=RS.call(e,e.transformResponse,t.response),t.response.headers=ES.from(t.response.headers))),Promise.reject(t)})}const sC="1.11.0",lC={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{lC[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const uC={};lC.transitional=function(e,t,n){function r(e,t){return"[Axios v"+sC+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,o,a)=>{if(!1===e)throw new Xx(r(o," has been removed"+(t?" in "+t:"")),Xx.ERR_DEPRECATED);return t&&!uC[o]&&(uC[o]=!0,console.warn(r(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,o,a)}},lC.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var cC={assertOptions:function(e,t,n){if("object"!=typeof e)throw new Xx("options must be an object",Xx.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const a=r[o],i=t[a];if(i){const t=e[a],n=void 0===t||i(t,a,e);if(!0!==n)throw new Xx("option "+a+" must be "+n,Xx.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Xx("Unknown option "+a,Xx.ERR_BAD_OPTION)}},validators:lC};const dC=cC.validators;let fC=class{constructor(e){this.defaults=e||{},this.interceptors={request:new uS,response:new uS}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=LS(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:o}=t;void 0!==n&&cC.assertOptions(n,{silentJSONParsing:dC.transitional(dC.boolean),forcedJSONParsing:dC.transitional(dC.boolean),clarifyTimeoutError:dC.transitional(dC.boolean)},!1),null!=r&&(Qx.isFunction(r)?t.paramsSerializer={serialize:r}:cC.assertOptions(r,{encode:dC.function,serialize:dC.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),cC.assertOptions(t,{baseUrl:dC.spelling("baseURL"),withXsrfToken:dC.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let a=o&&Qx.merge(o.common,o[t.method]);o&&Qx.forEach(["delete","get","head","post","put","patch","common"],e=>{delete o[e]}),t.headers=ES.concat(a,o);const i=[];let s=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,i.unshift(e.fulfilled,e.rejected))});const l=[];let u;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let c,d=0;if(!s){const e=[iC.bind(this),void 0];for(e.unshift(...i),e.push(...l),c=e.length,u=Promise.resolve(t);d<c;)u=u.then(e[d++],e[d++]);return u}c=i.length;let f=t;for(d=0;d<c;){const e=i[d++],t=i[d++];try{f=e(f)}catch(e){t.call(this,e);break}}try{u=iC.call(this,f)}catch(e){return Promise.reject(e)}for(d=0,c=l.length;d<c;)u=u.then(l[d++],l[d++]);return u}getUri(e){return lS(FS((e=LS(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};Qx.forEach(["delete","get","head","options"],function(e){fC.prototype[e]=function(t,n){return this.request(LS(n||{},{method:e,url:t,data:(n||{}).data}))}}),Qx.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,o){return this.request(LS(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}fC.prototype[e]=t(),fC.prototype[e+"Form"]=t(!0)});const pC={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(pC).forEach(([e,t])=>{pC[t]=e});const hC=function e(t){const n=new fC(t),r=sx(fC.prototype.request,n);return Qx.extend(r,fC.prototype,n,{allOwnKeys:!0}),Qx.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(LS(t,n))},r}(vS);hC.Axios=fC,hC.CanceledError=_S,hC.CancelToken=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,o){n.reason||(n.reason=new _S(e,r,o),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let t;const n=new e(function(e){t=e});return{token:n,cancel:t}}},hC.isCancel=PS,hC.VERSION=sC,hC.toFormData=rS,hC.AxiosError=Xx,hC.Cancel=hC.CanceledError,hC.all=function(e){return Promise.all(e)},hC.spread=function(e){return function(t){return e.apply(null,t)}},hC.isAxiosError=function(e){return Qx.isObject(e)&&!0===e.isAxiosError},hC.mergeConfig=LS,hC.AxiosHeaders=ES,hC.formToJSON=e=>bS(Qx.isHTMLForm(e)?new FormData(e):e),hC.getAdapter=oC,hC.HttpStatusCode=pC,hC.default=hC;const{Axios:mC,AxiosError:gC,CanceledError:yC,isCancel:bC,CancelToken:vC,VERSION:wC,all:xC,Cancel:SC,isAxiosError:CC,spread:kC,toFormData:EC,AxiosHeaders:RC,HttpStatusCode:PC,formToJSON:_C,getAdapter:OC,mergeConfig:NC}=hC,TC=(e,t,n={})=>{const{apiKey:r}=Cn(),o=(e=>{e||console.warn("⚠️ No API key provided to createApiClient");const t=hC.create({baseURL:"https://biz.api.simpoocodes.com/api/gateway/v1",headers:{"Content-Type":"application/json","SIMPOO-API-KEY":e}});return t.interceptors.request.use(t=>(e&&t.headers&&(t.headers["SIMPOO-API-KEY"]=e),t),e=>Promise.reject(e)),t.interceptors.response.use(e=>e,e=>(e.response?console.error("API Error:",e.response.status,e.response.data):console.error("Network or Axios Error:",e.message),Promise.reject(e))),t})(r||"");return function(e){return xn(e,dn)}({queryKey:e,queryFn:()=>(async e=>{try{const{data:t}=await o.get(e);return t}catch(e){AC(e)}})(t),...n})},AC=e=>{e?.response?(console.log("response data:",e.response.data),console.log("Status Code:",e.response.status),console.log("Status Text:",e.response.statusText),500===e.response.status?ix.error("Something went wrong",{position:"top-right"}):e.response.data&&e.response.data.message&&ix.error(`${e.response?.data?.message}`,{position:"top-right"})):(e.request,console.log(e?.message),ix.error(`${e?.message}`,{position:"top-right"}))},jC="https://unpkg.com/@simpoobusiness/sdk/dist/simpoo-sdk.css";let MC={};function FC(e){MC=e}const DC={inventory:()=>{const[e,t]=M.useState(),{currentPage:n,perview:r}=ne(e=>e.app),[o,a]=j.useState("all"),[i,s]=j.useState(!1),[l,u]=j.useState("all"),[c,d]=j.useState("");tx(c,1e3);const{apiKey:f}=Cn(),{data:p,isFetching:h}=TC(["items",r.toString(),n?.toString(),o],`/outbound/items?page=${n}&paginate=${r}&status=all`,{enabled:!!f}),g=p?.data?.[0]||[],y=g?.data?.map(e=>({item_description:e?.name,all_quantity:+e?.all_quantity,quantity:+e?.quantity,type:e?.item_type?.name,selling_price:+e?.selling_price,categories:e?.category||[],tags:e?.item_tags?.map(e=>e.name)||[],status:e?.status?"published":"draft",sku:e?.sku,item_image:e.images?.length>0?e.images[0].image:"https://unpkg.com/@simpoobusiness/sdk/dist/assets/placeholder-imageaf93498c918127fb.svg",barcode:e?.barcode,expired:e?.expired,expiring:e?.expiring,unit:e?.item_unit,uuid:e?.uuid,item_type_id:e?.item_type?.uuid,reorder_level:e?.reorder_level,fullData:e}))||[],{data:b,isFetching:v}=TC(["items-tab"],"/outbound/items/count",{enabled:!!f}),w=b?.data,x=[{label:"all",count:w?.all||0,action:()=>a("all")},{label:"published",count:w?.published||0,action:()=>a("published")},{label:"out of stock",count:w?.out_of_stock||0,action:()=>a("out_of_stock")},{label:"draft",count:w?.draft||0,action:()=>a("draft")},{label:"expiring",count:w?.expiring||0,action:()=>a("expiring")},{label:"expired",count:w?.expired||0,action:()=>a("expired")}];return m.jsxs(nb,{className:"px-4 py-6 flex flex-col gap-8",children:[m.jsx(hb,{tabs:x,loading:h}),m.jsxs("div",{className:" flex items-center justify-between flex-wrap gap-4",children:[m.jsxs("div",{className:"flex items-center gap-2.5",children:[m.jsx(Jw,{placeholder:"Search Item name, barcode or sku",value:c,onChange:e=>d(e.target.value)}),h?m.jsx(zo,{className:"w-20 h-6"}):m.jsxs("p",{className:"text-dark text-sm font-medium",children:[g?.meta?.total??0," ",m.jsx("span",{className:"text-gray-700",children:"Items"})]})]}),m.jsxs("div",{className:"flex gap-4",children:[m.jsx(Zw,{label:"Filter",left_addon:M.cloneElement(Ry.filter_edit,{fill:"#5E6278"}),onClick:()=>s(!0),className:"!font-medium !bg-gray-200 hover:!bg-gray-300 !text-gray-700 !text-sm !h-12"}),m.jsx(Zw,{label:"Create New",left_addon:Ry.plus_squared,className:"!font-medium !text-sm !h-12",onClick:()=>alert("create new item")})]})]}),m.jsx(fb,{loading:h,data:p?.data?.[1],meta:g?.meta}),m.jsx(Oy,{loading:h,columns:eb,data:y,emptyData:0===y.length,emptyProps:{header:"No item yet",subText:"Add new item to start managing your inventory."},tHeadClass:"whitespace-nowrap",tbCellClass:"text-dark font-semibold",meta:g?.meta})]})}};function LC(e,t){!function(){if(!document.querySelector(`link[href="${jC}"]`)){const e=document.createElement("link");e.rel="stylesheet",e.href=jC,document.head.appendChild(e)}}();const n=DC[e];if(!n)return void console.error(`SimpooSDK: Widget "${e}" not found.`);const r=document.querySelector(t);if(!r)throw new Error(`Container "${t}" not found!`);A.createRoot(r).render(m.jsx(kn,{apiKey:MC.apiKey||"",children:m.jsx(n,{})}))}"undefined"!=typeof window&&(window.SimpooSDK={init:FC,renderWidget:LC}),e.init=FC,e.renderWidget=LC});
222
222
  //# sourceMappingURL=simpoo-sdk.js.map