tanya-chatbot 0.0.12 → 0.0.14

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.
@@ -1,16 +1,27 @@
1
- import { jsx as l, jsxs as p, Fragment as dt } from "react/jsx-runtime";
2
- import { createHttpLink as Zn, ApolloClient as Xn, InMemoryCache as er, ApolloProvider as tr } from "@apollo/client";
3
- import { Provider as nr, useDispatch as mn, useSelector as Ge } from "react-redux";
4
- import { createSlice as gn, configureStore as rr } from "@reduxjs/toolkit";
5
- import { forwardRef as yn, useState as M, useEffect as ge, createElement as pt, useRef as Oe } from "react";
6
- import * as bn from "@radix-ui/react-popover";
1
+ import { useEffect as ct, forwardRef as hr, useState as D, createElement as fe, useRef as Ot } from "react";
2
+ import { jsx as l, jsxs as p, Fragment as pe } from "react/jsx-runtime";
3
+ import { createHttpLink as Qr, ApolloClient as Xr, InMemoryCache as Zr, ApolloProvider as tn } from "@apollo/client";
4
+ import { Provider as en, useDispatch as mr, useSelector as Kt } from "react-redux";
5
+ import { createSlice as gr, configureStore as rn } from "@reduxjs/toolkit";
6
+ import * as wr from "@radix-ui/react-popover";
7
7
  import "clsx";
8
8
  import "tailwind-merge";
9
- import q from "axios";
9
+ import U from "axios";
10
10
  import "crypto-js";
11
- import { Icon as Lt } from "@iconify/react";
12
- import { toast as Z } from "react-toastify";
13
- const or = {
11
+ import { Icon as Le } from "@iconify/react";
12
+ import { toast as X } from "react-toastify";
13
+ const nn = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.p-\\[5px\\]{padding:5px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
14
+ function pa() {
15
+ return ct(() => {
16
+ if (typeof document < "u") {
17
+ const t = document.createElement("style");
18
+ return t.textContent = nn, document.head.appendChild(t), () => {
19
+ document.head.removeChild(t);
20
+ };
21
+ }
22
+ }, []), null;
23
+ }
24
+ const on = {
14
25
  store: {
15
26
  storeCode: "",
16
27
  storeName: "",
@@ -44,123 +55,123 @@ const or = {
44
55
  mobile: []
45
56
  }
46
57
  }
47
- }, wn = gn({
58
+ }, yr = gr({
48
59
  name: "store",
49
- initialState: or,
60
+ initialState: on,
50
61
  reducers: {
51
- setStore: (e, t) => {
52
- e.store = t.payload;
62
+ setStore: (t, e) => {
63
+ t.store = e.payload;
53
64
  }
54
65
  }
55
- }), { setStore: ds } = wn.actions, sr = wn.reducer, ir = {
66
+ }), { setStore: ha } = yr.actions, an = yr.reducer, sn = {
56
67
  product: null
57
- }, xn = gn({
68
+ }, br = gr({
58
69
  name: "product",
59
- initialState: ir,
70
+ initialState: sn,
60
71
  reducers: {
61
- setProduct: (e, t) => {
62
- e.product = t.payload;
72
+ setProduct: (t, e) => {
73
+ t.product = e.payload;
63
74
  }
64
75
  }
65
- }), { setProduct: ht } = xn.actions, ar = xn.reducer, cr = rr({
76
+ }), { setProduct: he } = br.actions, cn = br.reducer, ln = rn({
66
77
  reducer: {
67
- store: sr,
68
- product: ar
78
+ store: an,
79
+ product: cn
69
80
  }
70
- }), lr = ({ children: e }) => /* @__PURE__ */ l(nr, { store: cr, children: e }), Ne = (e) => {
71
- const t = new CustomEvent("reactCartUpdated", {
81
+ }), un = ({ children: t }) => /* @__PURE__ */ l(en, { store: ln, children: t }), Ft = (t) => {
82
+ const e = new CustomEvent("reactCartUpdated", {
72
83
  detail: {
73
84
  cartUpdated: !0,
74
- basketId: e
85
+ basketId: t
75
86
  // any other data SFCC needs
76
87
  }
77
88
  });
78
- window.dispatchEvent(t);
89
+ window.dispatchEvent(e);
79
90
  };
80
- function ur({
81
- ...e
91
+ function dn({
92
+ ...t
82
93
  }) {
83
- return /* @__PURE__ */ l(bn.Root, { "data-slot": "popover", ...e });
94
+ return /* @__PURE__ */ l(wr.Root, { "data-slot": "popover", ...t });
84
95
  }
85
- function fr({
86
- ...e
96
+ function fn({
97
+ ...t
87
98
  }) {
88
- return /* @__PURE__ */ l(bn.Trigger, { "data-slot": "popover-trigger", ...e });
99
+ return /* @__PURE__ */ l(wr.Trigger, { "data-slot": "popover-trigger", ...t });
89
100
  }
90
- const ye = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), vn = async () => {
91
- const e = "https://tanya-sfcc-server.vercel.app/";
101
+ const wt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), xr = async () => {
102
+ const t = "https://tanya-sfcc-server.vercel.app/";
92
103
  try {
93
- const t = await q.post(
94
- `${e}api/auth/token-bm-grant?baseUrl=${ce()}&siteId=${ne()}`
104
+ const e = await U.post(
105
+ `${t}api/auth/token-bm-grant?baseUrl=${lt()}&siteId=${rt()}`
95
106
  );
96
- return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
97
- } catch (t) {
98
- return q.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
107
+ return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
108
+ } catch (e) {
109
+ return U.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
99
110
  }
100
- }, Sn = async (e) => {
101
- const t = "https://tanya-sfcc-server.vercel.app/";
111
+ }, vr = async (t) => {
112
+ const e = "https://tanya-sfcc-server.vercel.app/";
102
113
  try {
103
- const n = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, r = await q.post(
104
- `${t}api/auth/token-existing-guest-customer?dwsid=${n}&baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
114
+ const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await U.post(
115
+ `${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
105
116
  {},
106
117
  {
107
118
  headers: {
108
119
  "Content-Type": "application/json",
109
- Authorization: `Bearer ${e}`
120
+ Authorization: `Bearer ${t}`
110
121
  }
111
122
  }
112
123
  );
113
- return r.status === 200 && r.data ? r.data : null;
114
- } catch (n) {
115
- return q.isAxiosError(n) ? console.error("Error creating basket:", n.response || n.message) : console.error("Unexpected error:", n), null;
124
+ return n.status === 200 && n.data ? n.data : null;
125
+ } catch (r) {
126
+ return U.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
116
127
  }
117
128
  };
118
- async function Xe() {
119
- const e = localStorage.getItem("expires_in"), t = localStorage.getItem("access_token"), n = JSON.parse(
129
+ async function Zt() {
130
+ const t = localStorage.getItem("expires_in"), e = localStorage.getItem("access_token"), r = JSON.parse(
120
131
  sessionStorage.getItem("customerData") || "{}"
121
132
  ).isGuest;
122
- if (e && t && (/* @__PURE__ */ new Date()).getTime() < parseInt(e) && n === JSON.parse(localStorage.getItem("isGuest") || "false"))
123
- return console.log("access token found in local storage"), { access_token: t, expires_in: e };
124
- const { serverUrl: r } = ye(), o = JSON.parse(
133
+ if (t && e && (/* @__PURE__ */ new Date()).getTime() < parseInt(t) && r === JSON.parse(localStorage.getItem("isGuest") || "false"))
134
+ return console.log("access token found in local storage"), { access_token: e, expires_in: t };
135
+ const { serverUrl: n } = wt(), o = JSON.parse(
125
136
  sessionStorage.getItem("customerData") || "{}"
126
- ).dwsid, s = JSON.parse(
137
+ ).dwsid, a = JSON.parse(
127
138
  sessionStorage.getItem("customerData") || "{}"
128
139
  ).usrRef;
129
140
  try {
130
- const i = n ? "unregister-auth" : "register-auth", c = await q.get(
131
- `${r}sc-api/${i}?dwsid=${o}&email=${s}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}&siteId=${ne()}`
141
+ const i = r ? "unregister-auth" : "register-auth", c = await U.get(
142
+ `${n}sc-api/${i}?dwsid=${o}&email=${a}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}&siteId=${rt()}`
132
143
  );
133
144
  return localStorage.setItem("access_token", c.data.access_token), localStorage.setItem(
134
145
  "expires_in",
135
146
  String((/* @__PURE__ */ new Date()).getTime() + c.data.expires_in * 1e3)
136
- ), localStorage.setItem("isGuest", n.toString()), console.log(c.data), c.data;
147
+ ), localStorage.setItem("isGuest", r.toString()), console.log(c.data), c.data;
137
148
  } catch (i) {
138
149
  console.log(i);
139
150
  }
140
151
  }
141
- const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getItem("SiteId"), le = () => sessionStorage.getItem("pubCfg"), ue = () => sessionStorage.getItem("envRef"), fe = () => sessionStorage.getItem("orgRef"), Dt = async (e, t) => {
142
- const { serverUrl: n, basePath: r } = ye();
152
+ const lt = () => sessionStorage.getItem("Host"), rt = () => sessionStorage.getItem("SiteId"), ut = () => sessionStorage.getItem("pubCfg"), dt = () => sessionStorage.getItem("envRef"), ft = () => sessionStorage.getItem("orgRef"), ze = async (t, e) => {
153
+ const { serverUrl: r, basePath: n } = wt();
143
154
  try {
144
- const o = ce();
145
- return (await q.get(
146
- `${n}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
155
+ const o = lt();
156
+ return (await U.get(
157
+ `${r}${n}/search-sfcc?baseUrl=${o}&query=${t}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
147
158
  {
148
159
  headers: {
149
160
  "Content-Type": "application/json",
150
- Authorization: `Bearer ${t}`
161
+ Authorization: `Bearer ${e}`
151
162
  }
152
163
  }
153
164
  )).data.hits;
154
165
  } catch (o) {
155
166
  throw console.error("Error fetching search results:", o), o;
156
167
  }
157
- }, kn = async (e) => {
158
- if (!e) throw new Error("Product ID is required");
159
- const { serverUrl: t, basePath: n } = ye(), r = ce();
168
+ }, kr = async (t) => {
169
+ if (!t) throw new Error("Product ID is required");
170
+ const { serverUrl: e, basePath: r } = wt(), n = lt();
160
171
  console.log("calling access");
161
- const { access_token: o } = await Xe();
162
- return console.log(o), (await q.get(
163
- `${t}${n}/product-sfcc/${e}?baseUrl=${r}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
172
+ const { access_token: o } = await Zt();
173
+ return console.log(o), (await U.get(
174
+ `${e}${r}/product-sfcc/${t}?baseUrl=${n}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
164
175
  {
165
176
  headers: {
166
177
  "Content-Type": "application/json",
@@ -168,13 +179,13 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
168
179
  }
169
180
  }
170
181
  )).data;
171
- }, dr = async (e) => {
172
- if (!e) throw new Error("customerId is required");
173
- const t = await vn(), { customer_token: n } = await Sn(
174
- t
175
- ), { serverUrl: r, basePath: o } = ye(), i = (await Xe()).access_token;
176
- return (await q.get(
177
- `${r}${o}/get-interest?baseUrl=${ce()}&customerId=${e}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
182
+ }, pn = async (t) => {
183
+ if (!t) throw new Error("customerId is required");
184
+ const e = await xr(), { customer_token: r } = await vr(
185
+ e
186
+ ), { serverUrl: n, basePath: o } = wt(), i = (await Zt()).access_token;
187
+ return (await U.get(
188
+ `${n}${o}/get-interest?baseUrl=${lt()}&customerId=${t}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
178
189
  {
179
190
  headers: {
180
191
  "Content-Type": "application/json",
@@ -182,527 +193,527 @@ const ce = () => sessionStorage.getItem("Host"), ne = () => sessionStorage.getIt
182
193
  }
183
194
  }
184
195
  )).data;
185
- }, Mt = (e) => String(typeof e == "string" ? e : e["en-US"] || e), Ut = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), pr = (e, t) => e.toLocaleString("en-US", {
196
+ }, De = (t) => String(typeof t == "string" ? t : t["en-US"] || t), Me = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), hn = (t, e) => t.toLocaleString("en-US", {
186
197
  style: "currency",
187
- currency: t || "USD"
188
- }), qt = (e) => {
189
- var t, n, r;
190
- return "variants" in e ? {
191
- centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
198
+ currency: e || "USD"
199
+ }), Ue = (t) => {
200
+ var e, r, n;
201
+ return "variants" in t ? {
202
+ centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
192
203
  currencyCode: "DOL"
193
204
  } : {
194
- centAmount: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.centAmount,
195
- currencyCode: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.currencyCode
205
+ centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
206
+ currencyCode: (n = t.masterVariant) == null ? void 0 : n.prices[0].value.currencyCode
196
207
  };
197
- }, hr = (e) => e.charAt(0).toUpperCase() + e.slice(1), Bt = (e, t) => e.length < t ? e : e.slice(0, t) + "...", st = (e) => e.split("\\n").map((t, n) => {
198
- const r = t.match(/^(\d+)\.\s(.+)/);
199
- return r ? `<p key=${n} class="mb-2"><strong>${r[1]}.</strong> ${r[2]}</p>` : t.trim() ? `<p key=${n} class="mb-2">${t}</p>` : "<br/>";
208
+ }, mn = (t) => t.charAt(0).toUpperCase() + t.slice(1), Be = (t, e) => t.length < e ? t : t.slice(0, e) + "...", ae = (t) => t.split("\\n").map((e, r) => {
209
+ const n = e.match(/^(\d+)\.\s(.+)/);
210
+ return n ? `<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
200
211
  }).join("");
201
- function mr(e, t) {
202
- const n = e.icons, r = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
203
- function s(i) {
204
- if (n[i]) return o[i] = [];
212
+ function gn(t, e) {
213
+ const r = t.icons, n = t.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
214
+ function a(i) {
215
+ if (r[i]) return o[i] = [];
205
216
  if (!(i in o)) {
206
217
  o[i] = null;
207
- const c = r[i] && r[i].parent, a = c && s(c);
208
- a && (o[i] = [c].concat(a));
218
+ const c = n[i] && n[i].parent, s = c && a(c);
219
+ s && (o[i] = [c].concat(s));
209
220
  }
210
221
  return o[i];
211
222
  }
212
- return Object.keys(n).concat(Object.keys(r)).forEach(s), o;
223
+ return Object.keys(r).concat(Object.keys(n)).forEach(a), o;
213
224
  }
214
- const In = Object.freeze({
225
+ const Sr = Object.freeze({
215
226
  left: 0,
216
227
  top: 0,
217
228
  width: 16,
218
229
  height: 16
219
- }), We = Object.freeze({
230
+ }), Gt = Object.freeze({
220
231
  rotate: 0,
221
232
  vFlip: !1,
222
233
  hFlip: !1
223
- }), kt = Object.freeze({
224
- ...In,
225
- ...We
226
- }), mt = Object.freeze({
227
- ...kt,
234
+ }), Se = Object.freeze({
235
+ ...Sr,
236
+ ...Gt
237
+ }), me = Object.freeze({
238
+ ...Se,
228
239
  body: "",
229
240
  hidden: !1
230
241
  });
231
- function gr(e, t) {
232
- const n = {};
233
- !e.hFlip != !t.hFlip && (n.hFlip = !0), !e.vFlip != !t.vFlip && (n.vFlip = !0);
234
- const r = ((e.rotate || 0) + (t.rotate || 0)) % 4;
235
- return r && (n.rotate = r), n;
236
- }
237
- function Ht(e, t) {
238
- const n = gr(e, t);
239
- for (const r in mt) r in We ? r in e && !(r in n) && (n[r] = We[r]) : r in t ? n[r] = t[r] : r in e && (n[r] = e[r]);
240
- return n;
242
+ function wn(t, e) {
243
+ const r = {};
244
+ !t.hFlip != !e.hFlip && (r.hFlip = !0), !t.vFlip != !e.vFlip && (r.vFlip = !0);
245
+ const n = ((t.rotate || 0) + (e.rotate || 0)) % 4;
246
+ return n && (r.rotate = n), r;
247
+ }
248
+ function qe(t, e) {
249
+ const r = wn(t, e);
250
+ for (const n in me) n in Gt ? n in t && !(n in r) && (r[n] = Gt[n]) : n in e ? r[n] = e[n] : n in t && (r[n] = t[n]);
251
+ return r;
241
252
  }
242
- function yr(e, t, n) {
243
- const r = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
244
- let s = {};
253
+ function yn(t, e, r) {
254
+ const n = t.icons, o = t.aliases || /* @__PURE__ */ Object.create(null);
255
+ let a = {};
245
256
  function i(c) {
246
- s = Ht(r[c] || o[c], s);
257
+ a = qe(n[c] || o[c], a);
247
258
  }
248
- return i(t), n.forEach(i), Ht(e, s);
259
+ return i(e), r.forEach(i), qe(t, a);
249
260
  }
250
- function Cn(e, t) {
251
- const n = [];
252
- if (typeof e != "object" || typeof e.icons != "object") return n;
253
- e.not_found instanceof Array && e.not_found.forEach((o) => {
254
- t(o, null), n.push(o);
261
+ function Cr(t, e) {
262
+ const r = [];
263
+ if (typeof t != "object" || typeof t.icons != "object") return r;
264
+ t.not_found instanceof Array && t.not_found.forEach((o) => {
265
+ e(o, null), r.push(o);
255
266
  });
256
- const r = mr(e);
257
- for (const o in r) {
258
- const s = r[o];
259
- s && (t(o, yr(e, o, s)), n.push(o));
267
+ const n = gn(t);
268
+ for (const o in n) {
269
+ const a = n[o];
270
+ a && (e(o, yn(t, o, a)), r.push(o));
260
271
  }
261
- return n;
272
+ return r;
262
273
  }
263
- const br = {
274
+ const bn = {
264
275
  provider: "",
265
276
  aliases: {},
266
277
  not_found: {},
267
- ...In
278
+ ...Sr
268
279
  };
269
- function it(e, t) {
270
- for (const n in t) if (n in e && typeof e[n] != typeof t[n]) return !1;
280
+ function ie(t, e) {
281
+ for (const r in e) if (r in t && typeof t[r] != typeof e[r]) return !1;
271
282
  return !0;
272
283
  }
273
- function _n(e) {
274
- if (typeof e != "object" || e === null) return null;
275
- const t = e;
276
- if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !it(e, br)) return null;
277
- const n = t.icons;
278
- for (const o in n) {
279
- const s = n[o];
280
- if (!o || typeof s.body != "string" || !it(s, mt)) return null;
281
- }
282
- const r = t.aliases || /* @__PURE__ */ Object.create(null);
284
+ function Ir(t) {
285
+ if (typeof t != "object" || t === null) return null;
286
+ const e = t;
287
+ if (typeof e.prefix != "string" || !t.icons || typeof t.icons != "object" || !ie(t, bn)) return null;
288
+ const r = e.icons;
283
289
  for (const o in r) {
284
- const s = r[o], i = s.parent;
285
- if (!o || typeof i != "string" || !n[i] && !r[i] || !it(s, mt)) return null;
290
+ const a = r[o];
291
+ if (!o || typeof a.body != "string" || !ie(a, me)) return null;
286
292
  }
287
- return t;
293
+ const n = e.aliases || /* @__PURE__ */ Object.create(null);
294
+ for (const o in n) {
295
+ const a = n[o], i = a.parent;
296
+ if (!o || typeof i != "string" || !r[i] && !n[i] || !ie(a, me)) return null;
297
+ }
298
+ return e;
288
299
  }
289
- const Rt = /* @__PURE__ */ Object.create(null);
290
- function wr(e, t) {
300
+ const Re = /* @__PURE__ */ Object.create(null);
301
+ function xn(t, e) {
291
302
  return {
292
- provider: e,
293
- prefix: t,
303
+ provider: t,
304
+ prefix: e,
294
305
  icons: /* @__PURE__ */ Object.create(null),
295
306
  missing: /* @__PURE__ */ new Set()
296
307
  };
297
308
  }
298
- function Te(e, t) {
299
- const n = Rt[e] || (Rt[e] = /* @__PURE__ */ Object.create(null));
300
- return n[t] || (n[t] = wr(e, t));
309
+ function Et(t, e) {
310
+ const r = Re[t] || (Re[t] = /* @__PURE__ */ Object.create(null));
311
+ return r[e] || (r[e] = xn(t, e));
301
312
  }
302
- function Nn(e, t) {
303
- return _n(t) ? Cn(t, (n, r) => {
304
- r ? e.icons[n] = r : e.missing.add(n);
313
+ function _r(t, e) {
314
+ return Ir(e) ? Cr(e, (r, n) => {
315
+ n ? t.icons[r] = n : t.missing.add(r);
305
316
  }) : [];
306
317
  }
307
- function xr(e, t, n) {
318
+ function vn(t, e, r) {
308
319
  try {
309
- if (typeof n.body == "string")
310
- return e.icons[t] = { ...n }, !0;
320
+ if (typeof r.body == "string")
321
+ return t.icons[e] = { ...r }, !0;
311
322
  } catch {
312
323
  }
313
324
  return !1;
314
325
  }
315
- const Fn = /^[a-z0-9]+(-[a-z0-9]+)*$/, et = (e, t, n, r = "") => {
316
- const o = e.split(":");
317
- if (e.slice(0, 1) === "@") {
326
+ const Fr = /^[a-z0-9]+(-[a-z0-9]+)*$/, te = (t, e, r, n = "") => {
327
+ const o = t.split(":");
328
+ if (t.slice(0, 1) === "@") {
318
329
  if (o.length < 2 || o.length > 3) return null;
319
- r = o.shift().slice(1);
330
+ n = o.shift().slice(1);
320
331
  }
321
332
  if (o.length > 3 || !o.length) return null;
322
333
  if (o.length > 1) {
323
- const c = o.pop(), a = o.pop(), u = {
324
- provider: o.length > 0 ? o[0] : r,
325
- prefix: a,
334
+ const c = o.pop(), s = o.pop(), u = {
335
+ provider: o.length > 0 ? o[0] : n,
336
+ prefix: s,
326
337
  name: c
327
338
  };
328
- return t && !Ve(u) ? null : u;
339
+ return e && !Vt(u) ? null : u;
329
340
  }
330
- const s = o[0], i = s.split("-");
341
+ const a = o[0], i = a.split("-");
331
342
  if (i.length > 1) {
332
343
  const c = {
333
- provider: r,
344
+ provider: n,
334
345
  prefix: i.shift(),
335
346
  name: i.join("-")
336
347
  };
337
- return t && !Ve(c) ? null : c;
348
+ return e && !Vt(c) ? null : c;
338
349
  }
339
- if (n && r === "") {
350
+ if (r && n === "") {
340
351
  const c = {
341
- provider: r,
352
+ provider: n,
342
353
  prefix: "",
343
- name: s
354
+ name: a
344
355
  };
345
- return t && !Ve(c, n) ? null : c;
356
+ return e && !Vt(c, r) ? null : c;
346
357
  }
347
358
  return null;
348
- }, Ve = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
349
- let Ue = !1;
350
- function Tn(e) {
351
- return typeof e == "boolean" && (Ue = e), Ue;
359
+ }, Vt = (t, e) => t ? !!((e && t.prefix === "" || t.prefix) && t.name) : !1;
360
+ let Mt = !1;
361
+ function Nr(t) {
362
+ return typeof t == "boolean" && (Mt = t), Mt;
352
363
  }
353
- function zt(e) {
354
- const t = typeof e == "string" ? et(e, !0, Ue) : e;
355
- if (t) {
356
- const n = Te(t.provider, t.prefix), r = t.name;
357
- return n.icons[r] || (n.missing.has(r) ? null : void 0);
364
+ function He(t) {
365
+ const e = typeof t == "string" ? te(t, !0, Mt) : t;
366
+ if (e) {
367
+ const r = Et(e.provider, e.prefix), n = e.name;
368
+ return r.icons[n] || (r.missing.has(n) ? null : void 0);
358
369
  }
359
370
  }
360
- function vr(e, t) {
361
- const n = et(e, !0, Ue);
362
- if (!n) return !1;
363
- const r = Te(n.provider, n.prefix);
364
- return t ? xr(r, n.name, t) : (r.missing.add(n.name), !0);
371
+ function kn(t, e) {
372
+ const r = te(t, !0, Mt);
373
+ if (!r) return !1;
374
+ const n = Et(r.provider, r.prefix);
375
+ return e ? vn(n, r.name, e) : (n.missing.add(r.name), !0);
365
376
  }
366
- function Sr(e, t) {
367
- if (typeof e != "object") return !1;
368
- if (typeof t != "string" && (t = e.provider || ""), Ue && !t && !e.prefix) {
377
+ function Sn(t, e) {
378
+ if (typeof t != "object") return !1;
379
+ if (typeof e != "string" && (e = t.provider || ""), Mt && !e && !t.prefix) {
369
380
  let o = !1;
370
- return _n(e) && (e.prefix = "", Cn(e, (s, i) => {
371
- vr(s, i) && (o = !0);
381
+ return Ir(t) && (t.prefix = "", Cr(t, (a, i) => {
382
+ kn(a, i) && (o = !0);
372
383
  })), o;
373
384
  }
374
- const n = e.prefix;
375
- if (!Ve({
376
- prefix: n,
385
+ const r = t.prefix;
386
+ if (!Vt({
387
+ prefix: r,
377
388
  name: "a"
378
389
  })) return !1;
379
- const r = Te(t, n);
380
- return !!Nn(r, e);
390
+ const n = Et(e, r);
391
+ return !!_r(n, t);
381
392
  }
382
- const En = Object.freeze({
393
+ const Er = Object.freeze({
383
394
  width: null,
384
395
  height: null
385
- }), Pn = Object.freeze({
386
- ...En,
387
- ...We
388
- }), kr = /(-?[0-9.]*[0-9]+[0-9.]*)/g, Ir = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
389
- function Vt(e, t, n) {
390
- if (t === 1) return e;
391
- if (n = n || 100, typeof e == "number") return Math.ceil(e * t * n) / n;
392
- if (typeof e != "string") return e;
393
- const r = e.split(kr);
394
- if (r === null || !r.length) return e;
396
+ }), Tr = Object.freeze({
397
+ ...Er,
398
+ ...Gt
399
+ }), Cn = /(-?[0-9.]*[0-9]+[0-9.]*)/g, In = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
400
+ function Ve(t, e, r) {
401
+ if (e === 1) return t;
402
+ if (r = r || 100, typeof t == "number") return Math.ceil(t * e * r) / r;
403
+ if (typeof t != "string") return t;
404
+ const n = t.split(Cn);
405
+ if (n === null || !n.length) return t;
395
406
  const o = [];
396
- let s = r.shift(), i = Ir.test(s);
407
+ let a = n.shift(), i = In.test(a);
397
408
  for (; ; ) {
398
409
  if (i) {
399
- const c = parseFloat(s);
400
- isNaN(c) ? o.push(s) : o.push(Math.ceil(c * t * n) / n);
401
- } else o.push(s);
402
- if (s = r.shift(), s === void 0) return o.join("");
410
+ const c = parseFloat(a);
411
+ isNaN(c) ? o.push(a) : o.push(Math.ceil(c * e * r) / r);
412
+ } else o.push(a);
413
+ if (a = n.shift(), a === void 0) return o.join("");
403
414
  i = !i;
404
415
  }
405
416
  }
406
- function Cr(e, t = "defs") {
407
- let n = "";
408
- const r = e.indexOf("<" + t);
409
- for (; r >= 0; ) {
410
- const o = e.indexOf(">", r), s = e.indexOf("</" + t);
411
- if (o === -1 || s === -1) break;
412
- const i = e.indexOf(">", s);
417
+ function _n(t, e = "defs") {
418
+ let r = "";
419
+ const n = t.indexOf("<" + e);
420
+ for (; n >= 0; ) {
421
+ const o = t.indexOf(">", n), a = t.indexOf("</" + e);
422
+ if (o === -1 || a === -1) break;
423
+ const i = t.indexOf(">", a);
413
424
  if (i === -1) break;
414
- n += e.slice(o + 1, s).trim(), e = e.slice(0, r).trim() + e.slice(i + 1);
425
+ r += t.slice(o + 1, a).trim(), t = t.slice(0, n).trim() + t.slice(i + 1);
415
426
  }
416
427
  return {
417
- defs: n,
418
- content: e
428
+ defs: r,
429
+ content: t
419
430
  };
420
431
  }
421
- function _r(e, t) {
422
- return e ? "<defs>" + e + "</defs>" + t : t;
432
+ function Fn(t, e) {
433
+ return t ? "<defs>" + t + "</defs>" + e : e;
423
434
  }
424
- function Nr(e, t, n) {
425
- const r = Cr(e);
426
- return _r(r.defs, t + r.content + n);
435
+ function Nn(t, e, r) {
436
+ const n = _n(t);
437
+ return Fn(n.defs, e + n.content + r);
427
438
  }
428
- const Fr = (e) => e === "unset" || e === "undefined" || e === "none";
429
- function Tr(e, t) {
430
- const n = {
431
- ...kt,
432
- ...e
433
- }, r = {
434
- ...Pn,
439
+ const En = (t) => t === "unset" || t === "undefined" || t === "none";
440
+ function Tn(t, e) {
441
+ const r = {
442
+ ...Se,
435
443
  ...t
444
+ }, n = {
445
+ ...Tr,
446
+ ...e
436
447
  }, o = {
437
- left: n.left,
438
- top: n.top,
439
- width: n.width,
440
- height: n.height
448
+ left: r.left,
449
+ top: r.top,
450
+ width: r.width,
451
+ height: r.height
441
452
  };
442
- let s = n.body;
443
- [n, r].forEach((_) => {
444
- const y = [], v = _.hFlip, B = _.vFlip;
453
+ let a = r.body;
454
+ [r, n].forEach((_) => {
455
+ const w = [], v = _.hFlip, B = _.vFlip;
445
456
  let P = _.rotate;
446
- v ? B ? P += 2 : (y.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), y.push("scale(-1 1)"), o.top = o.left = 0) : B && (y.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), y.push("scale(1 -1)"), o.top = o.left = 0);
447
- let j;
457
+ v ? B ? P += 2 : (w.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), w.push("scale(-1 1)"), o.top = o.left = 0) : B && (w.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), w.push("scale(1 -1)"), o.top = o.left = 0);
458
+ let $;
448
459
  switch (P < 0 && (P -= Math.floor(P / 4) * 4), P = P % 4, P) {
449
460
  case 1:
450
- j = o.height / 2 + o.top, y.unshift("rotate(90 " + j.toString() + " " + j.toString() + ")");
461
+ $ = o.height / 2 + o.top, w.unshift("rotate(90 " + $.toString() + " " + $.toString() + ")");
451
462
  break;
452
463
  case 2:
453
- y.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
464
+ w.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
454
465
  break;
455
466
  case 3:
456
- j = o.width / 2 + o.left, y.unshift("rotate(-90 " + j.toString() + " " + j.toString() + ")");
467
+ $ = o.width / 2 + o.left, w.unshift("rotate(-90 " + $.toString() + " " + $.toString() + ")");
457
468
  break;
458
469
  }
459
- P % 2 === 1 && (o.left !== o.top && (j = o.left, o.left = o.top, o.top = j), o.width !== o.height && (j = o.width, o.width = o.height, o.height = j)), y.length && (s = Nr(s, '<g transform="' + y.join(" ") + '">', "</g>"));
470
+ P % 2 === 1 && (o.left !== o.top && ($ = o.left, o.left = o.top, o.top = $), o.width !== o.height && ($ = o.width, o.width = o.height, o.height = $)), w.length && (a = Nn(a, '<g transform="' + w.join(" ") + '">', "</g>"));
460
471
  });
461
- const i = r.width, c = r.height, a = o.width, u = o.height;
462
- let d, h;
463
- i === null ? (h = c === null ? "1em" : c === "auto" ? u : c, d = Vt(h, a / u)) : (d = i === "auto" ? a : i, h = c === null ? Vt(d, u / a) : c === "auto" ? u : c);
464
- const m = {}, g = (_, y) => {
465
- Fr(y) || (m[_] = y.toString());
472
+ const i = n.width, c = n.height, s = o.width, u = o.height;
473
+ let f, h;
474
+ i === null ? (h = c === null ? "1em" : c === "auto" ? u : c, f = Ve(h, s / u)) : (f = i === "auto" ? s : i, h = c === null ? Ve(f, u / s) : c === "auto" ? u : c);
475
+ const m = {}, g = (_, w) => {
476
+ En(w) || (m[_] = w.toString());
466
477
  };
467
- g("width", d), g("height", h);
468
- const S = [
478
+ g("width", f), g("height", h);
479
+ const k = [
469
480
  o.left,
470
481
  o.top,
471
- a,
482
+ s,
472
483
  u
473
484
  ];
474
- return m.viewBox = S.join(" "), {
485
+ return m.viewBox = k.join(" "), {
475
486
  attributes: m,
476
- viewBox: S,
477
- body: s
487
+ viewBox: k,
488
+ body: a
478
489
  };
479
490
  }
480
- const Er = /\sid="(\S+)"/g, Pr = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
481
- let Or = 0;
482
- function $r(e, t = Pr) {
483
- const n = [];
484
- let r;
485
- for (; r = Er.exec(e); ) n.push(r[1]);
486
- if (!n.length) return e;
491
+ const Pn = /\sid="(\S+)"/g, On = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
492
+ let jn = 0;
493
+ function $n(t, e = On) {
494
+ const r = [];
495
+ let n;
496
+ for (; n = Pn.exec(t); ) r.push(n[1]);
497
+ if (!r.length) return t;
487
498
  const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
488
- return n.forEach((s) => {
489
- const i = typeof t == "function" ? t(s) : t + (Or++).toString(), c = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
490
- e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
491
- }), e = e.replace(new RegExp(o, "g"), ""), e;
499
+ return r.forEach((a) => {
500
+ const i = typeof e == "function" ? e(a) : e + (jn++).toString(), c = a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
501
+ t = t.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
502
+ }), t = t.replace(new RegExp(o, "g"), ""), t;
492
503
  }
493
- const gt = /* @__PURE__ */ Object.create(null);
494
- function jr(e, t) {
495
- gt[e] = t;
504
+ const ge = /* @__PURE__ */ Object.create(null);
505
+ function An(t, e) {
506
+ ge[t] = e;
496
507
  }
497
- function yt(e) {
498
- return gt[e] || gt[""];
508
+ function we(t) {
509
+ return ge[t] || ge[""];
499
510
  }
500
- function It(e) {
501
- let t;
502
- if (typeof e.resources == "string") t = [e.resources];
503
- else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
511
+ function Ce(t) {
512
+ let e;
513
+ if (typeof t.resources == "string") e = [t.resources];
514
+ else if (e = t.resources, !(e instanceof Array) || !e.length) return null;
504
515
  return {
505
- resources: t,
506
- path: e.path || "/",
507
- maxURL: e.maxURL || 500,
508
- rotate: e.rotate || 750,
509
- timeout: e.timeout || 5e3,
510
- random: e.random === !0,
511
- index: e.index || 0,
512
- dataAfterTimeout: e.dataAfterTimeout !== !1
516
+ resources: e,
517
+ path: t.path || "/",
518
+ maxURL: t.maxURL || 500,
519
+ rotate: t.rotate || 750,
520
+ timeout: t.timeout || 5e3,
521
+ random: t.random === !0,
522
+ index: t.index || 0,
523
+ dataAfterTimeout: t.dataAfterTimeout !== !1
513
524
  };
514
525
  }
515
- const Ct = /* @__PURE__ */ Object.create(null), $e = ["https://api.simplesvg.com", "https://api.unisvg.com"], Je = [];
516
- for (; $e.length > 0; ) $e.length === 1 || Math.random() > 0.5 ? Je.push($e.shift()) : Je.push($e.pop());
517
- Ct[""] = It({ resources: ["https://api.iconify.design"].concat(Je) });
518
- function Ar(e, t) {
519
- const n = It(t);
520
- return n === null ? !1 : (Ct[e] = n, !0);
526
+ const Ie = /* @__PURE__ */ Object.create(null), jt = ["https://api.simplesvg.com", "https://api.unisvg.com"], Yt = [];
527
+ for (; jt.length > 0; ) jt.length === 1 || Math.random() > 0.5 ? Yt.push(jt.shift()) : Yt.push(jt.pop());
528
+ Ie[""] = Ce({ resources: ["https://api.iconify.design"].concat(Yt) });
529
+ function Ln(t, e) {
530
+ const r = Ce(e);
531
+ return r === null ? !1 : (Ie[t] = r, !0);
521
532
  }
522
- function _t(e) {
523
- return Ct[e];
533
+ function _e(t) {
534
+ return Ie[t];
524
535
  }
525
- const Lr = () => {
526
- let e;
536
+ const zn = () => {
537
+ let t;
527
538
  try {
528
- if (e = fetch, typeof e == "function") return e;
539
+ if (t = fetch, typeof t == "function") return t;
529
540
  } catch {
530
541
  }
531
542
  };
532
- let Jt = Lr();
533
- function Dr(e, t) {
534
- const n = _t(e);
535
- if (!n) return 0;
536
- let r;
537
- if (!n.maxURL) r = 0;
543
+ let Ye = zn();
544
+ function Dn(t, e) {
545
+ const r = _e(t);
546
+ if (!r) return 0;
547
+ let n;
548
+ if (!r.maxURL) n = 0;
538
549
  else {
539
550
  let o = 0;
540
- n.resources.forEach((i) => {
551
+ r.resources.forEach((i) => {
541
552
  o = Math.max(o, i.length);
542
553
  });
543
- const s = t + ".json?icons=";
544
- r = n.maxURL - o - n.path.length - s.length;
554
+ const a = e + ".json?icons=";
555
+ n = r.maxURL - o - r.path.length - a.length;
545
556
  }
546
- return r;
557
+ return n;
547
558
  }
548
- function Mr(e) {
549
- return e === 404;
559
+ function Mn(t) {
560
+ return t === 404;
550
561
  }
551
- const Ur = (e, t, n) => {
552
- const r = [], o = Dr(e, t), s = "icons";
562
+ const Un = (t, e, r) => {
563
+ const n = [], o = Dn(t, e), a = "icons";
553
564
  let i = {
554
- type: s,
555
- provider: e,
556
- prefix: t,
565
+ type: a,
566
+ provider: t,
567
+ prefix: e,
557
568
  icons: []
558
569
  }, c = 0;
559
- return n.forEach((a, u) => {
560
- c += a.length + 1, c >= o && u > 0 && (r.push(i), i = {
561
- type: s,
562
- provider: e,
563
- prefix: t,
570
+ return r.forEach((s, u) => {
571
+ c += s.length + 1, c >= o && u > 0 && (n.push(i), i = {
572
+ type: a,
573
+ provider: t,
574
+ prefix: e,
564
575
  icons: []
565
- }, c = a.length), i.icons.push(a);
566
- }), r.push(i), r;
576
+ }, c = s.length), i.icons.push(s);
577
+ }), n.push(i), n;
567
578
  };
568
- function qr(e) {
569
- if (typeof e == "string") {
570
- const t = _t(e);
571
- if (t) return t.path;
579
+ function Bn(t) {
580
+ if (typeof t == "string") {
581
+ const e = _e(t);
582
+ if (e) return e.path;
572
583
  }
573
584
  return "/";
574
585
  }
575
- const Br = (e, t, n) => {
576
- if (!Jt) {
577
- n("abort", 424);
586
+ const qn = (t, e, r) => {
587
+ if (!Ye) {
588
+ r("abort", 424);
578
589
  return;
579
590
  }
580
- let r = qr(t.provider);
581
- switch (t.type) {
591
+ let n = Bn(e.provider);
592
+ switch (e.type) {
582
593
  case "icons": {
583
- const s = t.prefix, c = t.icons.join(","), a = new URLSearchParams({ icons: c });
584
- r += s + ".json?" + a.toString();
594
+ const a = e.prefix, c = e.icons.join(","), s = new URLSearchParams({ icons: c });
595
+ n += a + ".json?" + s.toString();
585
596
  break;
586
597
  }
587
598
  case "custom": {
588
- const s = t.uri;
589
- r += s.slice(0, 1) === "/" ? s.slice(1) : s;
599
+ const a = e.uri;
600
+ n += a.slice(0, 1) === "/" ? a.slice(1) : a;
590
601
  break;
591
602
  }
592
603
  default:
593
- n("abort", 400);
604
+ r("abort", 400);
594
605
  return;
595
606
  }
596
607
  let o = 503;
597
- Jt(e + r).then((s) => {
598
- const i = s.status;
608
+ Ye(t + n).then((a) => {
609
+ const i = a.status;
599
610
  if (i !== 200) {
600
611
  setTimeout(() => {
601
- n(Mr(i) ? "abort" : "next", i);
612
+ r(Mn(i) ? "abort" : "next", i);
602
613
  });
603
614
  return;
604
615
  }
605
- return o = 501, s.json();
606
- }).then((s) => {
607
- if (typeof s != "object" || s === null) {
616
+ return o = 501, a.json();
617
+ }).then((a) => {
618
+ if (typeof a != "object" || a === null) {
608
619
  setTimeout(() => {
609
- s === 404 ? n("abort", s) : n("next", o);
620
+ a === 404 ? r("abort", a) : r("next", o);
610
621
  });
611
622
  return;
612
623
  }
613
624
  setTimeout(() => {
614
- n("success", s);
625
+ r("success", a);
615
626
  });
616
627
  }).catch(() => {
617
- n("next", o);
628
+ r("next", o);
618
629
  });
619
- }, Hr = {
620
- prepare: Ur,
621
- send: Br
630
+ }, Rn = {
631
+ prepare: Un,
632
+ send: qn
622
633
  };
623
- function On(e, t) {
624
- e.forEach((n) => {
625
- const r = n.loaderCallbacks;
626
- r && (n.loaderCallbacks = r.filter((o) => o.id !== t));
634
+ function Pr(t, e) {
635
+ t.forEach((r) => {
636
+ const n = r.loaderCallbacks;
637
+ n && (r.loaderCallbacks = n.filter((o) => o.id !== e));
627
638
  });
628
639
  }
629
- function Rr(e) {
630
- e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
631
- e.pendingCallbacksFlag = !1;
632
- const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
633
- if (!t.length) return;
634
- let n = !1;
635
- const r = e.provider, o = e.prefix;
636
- t.forEach((s) => {
637
- const i = s.icons, c = i.pending.length;
638
- i.pending = i.pending.filter((a) => {
639
- if (a.prefix !== o) return !0;
640
- const u = a.name;
641
- if (e.icons[u]) i.loaded.push({
642
- provider: r,
640
+ function Hn(t) {
641
+ t.pendingCallbacksFlag || (t.pendingCallbacksFlag = !0, setTimeout(() => {
642
+ t.pendingCallbacksFlag = !1;
643
+ const e = t.loaderCallbacks ? t.loaderCallbacks.slice(0) : [];
644
+ if (!e.length) return;
645
+ let r = !1;
646
+ const n = t.provider, o = t.prefix;
647
+ e.forEach((a) => {
648
+ const i = a.icons, c = i.pending.length;
649
+ i.pending = i.pending.filter((s) => {
650
+ if (s.prefix !== o) return !0;
651
+ const u = s.name;
652
+ if (t.icons[u]) i.loaded.push({
653
+ provider: n,
643
654
  prefix: o,
644
655
  name: u
645
656
  });
646
- else if (e.missing.has(u)) i.missing.push({
647
- provider: r,
657
+ else if (t.missing.has(u)) i.missing.push({
658
+ provider: n,
648
659
  prefix: o,
649
660
  name: u
650
661
  });
651
662
  else
652
- return n = !0, !0;
663
+ return r = !0, !0;
653
664
  return !1;
654
- }), i.pending.length !== c && (n || On([e], s.id), s.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), s.abort));
665
+ }), i.pending.length !== c && (r || Pr([t], a.id), a.callback(i.loaded.slice(0), i.missing.slice(0), i.pending.slice(0), a.abort));
655
666
  });
656
667
  }));
657
668
  }
658
- let zr = 0;
659
- function Vr(e, t, n) {
660
- const r = zr++, o = On.bind(null, n, r);
661
- if (!t.pending.length) return o;
662
- const s = {
663
- id: r,
664
- icons: t,
665
- callback: e,
669
+ let Vn = 0;
670
+ function Yn(t, e, r) {
671
+ const n = Vn++, o = Pr.bind(null, r, n);
672
+ if (!e.pending.length) return o;
673
+ const a = {
674
+ id: n,
675
+ icons: e,
676
+ callback: t,
666
677
  abort: o
667
678
  };
668
- return n.forEach((i) => {
669
- (i.loaderCallbacks || (i.loaderCallbacks = [])).push(s);
679
+ return r.forEach((i) => {
680
+ (i.loaderCallbacks || (i.loaderCallbacks = [])).push(a);
670
681
  }), o;
671
682
  }
672
- function Jr(e) {
673
- const t = {
683
+ function Jn(t) {
684
+ const e = {
674
685
  loaded: [],
675
686
  missing: [],
676
687
  pending: []
677
- }, n = /* @__PURE__ */ Object.create(null);
678
- e.sort((o, s) => o.provider !== s.provider ? o.provider.localeCompare(s.provider) : o.prefix !== s.prefix ? o.prefix.localeCompare(s.prefix) : o.name.localeCompare(s.name));
679
- let r = {
688
+ }, r = /* @__PURE__ */ Object.create(null);
689
+ t.sort((o, a) => o.provider !== a.provider ? o.provider.localeCompare(a.provider) : o.prefix !== a.prefix ? o.prefix.localeCompare(a.prefix) : o.name.localeCompare(a.name));
690
+ let n = {
680
691
  provider: "",
681
692
  prefix: "",
682
693
  name: ""
683
694
  };
684
- return e.forEach((o) => {
685
- if (r.name === o.name && r.prefix === o.prefix && r.provider === o.provider) return;
686
- r = o;
687
- const s = o.provider, i = o.prefix, c = o.name, a = n[s] || (n[s] = /* @__PURE__ */ Object.create(null)), u = a[i] || (a[i] = Te(s, i));
688
- let d;
689
- c in u.icons ? d = t.loaded : i === "" || u.missing.has(c) ? d = t.missing : d = t.pending;
695
+ return t.forEach((o) => {
696
+ if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
697
+ n = o;
698
+ const a = o.provider, i = o.prefix, c = o.name, s = r[a] || (r[a] = /* @__PURE__ */ Object.create(null)), u = s[i] || (s[i] = Et(a, i));
699
+ let f;
700
+ c in u.icons ? f = e.loaded : i === "" || u.missing.has(c) ? f = e.missing : f = e.pending;
690
701
  const h = {
691
- provider: s,
702
+ provider: a,
692
703
  prefix: i,
693
704
  name: c
694
705
  };
695
- d.push(h);
696
- }), t;
706
+ f.push(h);
707
+ }), e;
697
708
  }
698
- function Kr(e, t = !0, n = !1) {
699
- const r = [];
700
- return e.forEach((o) => {
701
- const s = typeof o == "string" ? et(o, t, n) : o;
702
- s && r.push(s);
703
- }), r;
709
+ function Kn(t, e = !0, r = !1) {
710
+ const n = [];
711
+ return t.forEach((o) => {
712
+ const a = typeof o == "string" ? te(o, e, r) : o;
713
+ a && n.push(a);
714
+ }), n;
704
715
  }
705
- const Gr = {
716
+ const Gn = {
706
717
  resources: [],
707
718
  index: 0,
708
719
  timeout: 2e3,
@@ -710,88 +721,88 @@ const Gr = {
710
721
  random: !1,
711
722
  dataAfterTimeout: !1
712
723
  };
713
- function Wr(e, t, n, r) {
714
- const o = e.resources.length, s = e.random ? Math.floor(Math.random() * o) : e.index;
724
+ function Wn(t, e, r, n) {
725
+ const o = t.resources.length, a = t.random ? Math.floor(Math.random() * o) : t.index;
715
726
  let i;
716
- if (e.random) {
717
- let k = e.resources.slice(0);
718
- for (i = []; k.length > 1; ) {
719
- const L = Math.floor(Math.random() * k.length);
720
- i.push(k[L]), k = k.slice(0, L).concat(k.slice(L + 1));
727
+ if (t.random) {
728
+ let S = t.resources.slice(0);
729
+ for (i = []; S.length > 1; ) {
730
+ const L = Math.floor(Math.random() * S.length);
731
+ i.push(S[L]), S = S.slice(0, L).concat(S.slice(L + 1));
721
732
  }
722
- i = i.concat(k);
723
- } else i = e.resources.slice(s).concat(e.resources.slice(0, s));
733
+ i = i.concat(S);
734
+ } else i = t.resources.slice(a).concat(t.resources.slice(0, a));
724
735
  const c = Date.now();
725
- let a = "pending", u = 0, d, h = null, m = [], g = [];
726
- typeof r == "function" && g.push(r);
727
- function S() {
736
+ let s = "pending", u = 0, f, h = null, m = [], g = [];
737
+ typeof n == "function" && g.push(n);
738
+ function k() {
728
739
  h && (clearTimeout(h), h = null);
729
740
  }
730
741
  function _() {
731
- a === "pending" && (a = "aborted"), S(), m.forEach((k) => {
732
- k.status === "pending" && (k.status = "aborted");
742
+ s === "pending" && (s = "aborted"), k(), m.forEach((S) => {
743
+ S.status === "pending" && (S.status = "aborted");
733
744
  }), m = [];
734
745
  }
735
- function y(k, L) {
736
- L && (g = []), typeof k == "function" && g.push(k);
746
+ function w(S, L) {
747
+ L && (g = []), typeof S == "function" && g.push(S);
737
748
  }
738
749
  function v() {
739
750
  return {
740
751
  startTime: c,
741
- payload: t,
742
- status: a,
752
+ payload: e,
753
+ status: s,
743
754
  queriesSent: u,
744
755
  queriesPending: m.length,
745
- subscribe: y,
756
+ subscribe: w,
746
757
  abort: _
747
758
  };
748
759
  }
749
760
  function B() {
750
- a = "failed", g.forEach((k) => {
751
- k(void 0, d);
761
+ s = "failed", g.forEach((S) => {
762
+ S(void 0, f);
752
763
  });
753
764
  }
754
765
  function P() {
755
- m.forEach((k) => {
756
- k.status === "pending" && (k.status = "aborted");
766
+ m.forEach((S) => {
767
+ S.status === "pending" && (S.status = "aborted");
757
768
  }), m = [];
758
769
  }
759
- function j(k, L, z) {
770
+ function $(S, L, H) {
760
771
  const V = L !== "success";
761
- switch (m = m.filter((O) => O !== k), a) {
772
+ switch (m = m.filter((O) => O !== S), s) {
762
773
  case "pending":
763
774
  break;
764
775
  case "failed":
765
- if (V || !e.dataAfterTimeout) return;
776
+ if (V || !t.dataAfterTimeout) return;
766
777
  break;
767
778
  default:
768
779
  return;
769
780
  }
770
781
  if (L === "abort") {
771
- d = z, B();
782
+ f = H, B();
772
783
  return;
773
784
  }
774
785
  if (V) {
775
- d = z, m.length || (i.length ? X() : B());
786
+ f = H, m.length || (i.length ? Z() : B());
776
787
  return;
777
788
  }
778
- if (S(), P(), !e.random) {
779
- const O = e.resources.indexOf(k.resource);
780
- O !== -1 && O !== e.index && (e.index = O);
789
+ if (k(), P(), !t.random) {
790
+ const O = t.resources.indexOf(S.resource);
791
+ O !== -1 && O !== t.index && (t.index = O);
781
792
  }
782
- a = "completed", g.forEach((O) => {
783
- O(z);
793
+ s = "completed", g.forEach((O) => {
794
+ O(H);
784
795
  });
785
796
  }
786
- function X() {
787
- if (a !== "pending") return;
788
- S();
789
- const k = i.shift();
790
- if (k === void 0) {
797
+ function Z() {
798
+ if (s !== "pending") return;
799
+ k();
800
+ const S = i.shift();
801
+ if (S === void 0) {
791
802
  if (m.length) {
792
803
  h = setTimeout(() => {
793
- S(), a === "pending" && (P(), B());
794
- }, e.timeout);
804
+ k(), s === "pending" && (P(), B());
805
+ }, t.timeout);
795
806
  return;
796
807
  }
797
808
  B();
@@ -799,215 +810,215 @@ function Wr(e, t, n, r) {
799
810
  }
800
811
  const L = {
801
812
  status: "pending",
802
- resource: k,
803
- callback: (z, V) => {
804
- j(L, z, V);
813
+ resource: S,
814
+ callback: (H, V) => {
815
+ $(L, H, V);
805
816
  }
806
817
  };
807
- m.push(L), u++, h = setTimeout(X, e.rotate), n(k, t, L.callback);
818
+ m.push(L), u++, h = setTimeout(Z, t.rotate), r(S, e, L.callback);
808
819
  }
809
- return setTimeout(X), v;
820
+ return setTimeout(Z), v;
810
821
  }
811
- function $n(e) {
812
- const t = {
813
- ...Gr,
814
- ...e
822
+ function Or(t) {
823
+ const e = {
824
+ ...Gn,
825
+ ...t
815
826
  };
816
- let n = [];
817
- function r() {
818
- n = n.filter((c) => c().status === "pending");
827
+ let r = [];
828
+ function n() {
829
+ r = r.filter((c) => c().status === "pending");
819
830
  }
820
- function o(c, a, u) {
821
- const d = Wr(t, c, a, (h, m) => {
822
- r(), u && u(h, m);
831
+ function o(c, s, u) {
832
+ const f = Wn(e, c, s, (h, m) => {
833
+ n(), u && u(h, m);
823
834
  });
824
- return n.push(d), d;
835
+ return r.push(f), f;
825
836
  }
826
- function s(c) {
827
- return n.find((a) => c(a)) || null;
837
+ function a(c) {
838
+ return r.find((s) => c(s)) || null;
828
839
  }
829
840
  return {
830
841
  query: o,
831
- find: s,
842
+ find: a,
832
843
  setIndex: (c) => {
833
- t.index = c;
844
+ e.index = c;
834
845
  },
835
- getIndex: () => t.index,
836
- cleanup: r
846
+ getIndex: () => e.index,
847
+ cleanup: n
837
848
  };
838
849
  }
839
- function Kt() {
850
+ function Je() {
840
851
  }
841
- const at = /* @__PURE__ */ Object.create(null);
842
- function Qr(e) {
843
- if (!at[e]) {
844
- const t = _t(e);
845
- if (!t) return;
846
- const n = $n(t), r = {
847
- config: t,
848
- redundancy: n
852
+ const se = /* @__PURE__ */ Object.create(null);
853
+ function Qn(t) {
854
+ if (!se[t]) {
855
+ const e = _e(t);
856
+ if (!e) return;
857
+ const r = Or(e), n = {
858
+ config: e,
859
+ redundancy: r
849
860
  };
850
- at[e] = r;
851
- }
852
- return at[e];
853
- }
854
- function Yr(e, t, n) {
855
- let r, o;
856
- if (typeof e == "string") {
857
- const s = yt(e);
858
- if (!s)
859
- return n(void 0, 424), Kt;
860
- o = s.send;
861
- const i = Qr(e);
862
- i && (r = i.redundancy);
861
+ se[t] = n;
862
+ }
863
+ return se[t];
864
+ }
865
+ function Xn(t, e, r) {
866
+ let n, o;
867
+ if (typeof t == "string") {
868
+ const a = we(t);
869
+ if (!a)
870
+ return r(void 0, 424), Je;
871
+ o = a.send;
872
+ const i = Qn(t);
873
+ i && (n = i.redundancy);
863
874
  } else {
864
- const s = It(e);
865
- if (s) {
866
- r = $n(s);
867
- const i = e.resources ? e.resources[0] : "", c = yt(i);
875
+ const a = Ce(t);
876
+ if (a) {
877
+ n = Or(a);
878
+ const i = t.resources ? t.resources[0] : "", c = we(i);
868
879
  c && (o = c.send);
869
880
  }
870
881
  }
871
- return !r || !o ? (n(void 0, 424), Kt) : r.query(t, o, n)().abort;
882
+ return !n || !o ? (r(void 0, 424), Je) : n.query(e, o, r)().abort;
872
883
  }
873
- function Gt() {
884
+ function Ke() {
874
885
  }
875
- function Zr(e) {
876
- e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
877
- e.iconsLoaderFlag = !1, Rr(e);
886
+ function Zn(t) {
887
+ t.iconsLoaderFlag || (t.iconsLoaderFlag = !0, setTimeout(() => {
888
+ t.iconsLoaderFlag = !1, Hn(t);
878
889
  }));
879
890
  }
880
- function Xr(e) {
881
- const t = [], n = [];
882
- return e.forEach((r) => {
883
- (r.match(Fn) ? t : n).push(r);
891
+ function to(t) {
892
+ const e = [], r = [];
893
+ return t.forEach((n) => {
894
+ (n.match(Fr) ? e : r).push(n);
884
895
  }), {
885
- valid: t,
886
- invalid: n
896
+ valid: e,
897
+ invalid: r
887
898
  };
888
899
  }
889
- function je(e, t, n) {
890
- function r() {
891
- const o = e.pendingIcons;
892
- t.forEach((s) => {
893
- o && o.delete(s), e.icons[s] || e.missing.add(s);
900
+ function $t(t, e, r) {
901
+ function n() {
902
+ const o = t.pendingIcons;
903
+ e.forEach((a) => {
904
+ o && o.delete(a), t.icons[a] || t.missing.add(a);
894
905
  });
895
906
  }
896
- if (n && typeof n == "object") try {
897
- if (!Nn(e, n).length) {
898
- r();
907
+ if (r && typeof r == "object") try {
908
+ if (!_r(t, r).length) {
909
+ n();
899
910
  return;
900
911
  }
901
912
  } catch (o) {
902
913
  console.error(o);
903
914
  }
904
- r(), Zr(e);
915
+ n(), Zn(t);
905
916
  }
906
- function Wt(e, t) {
907
- e instanceof Promise ? e.then((n) => {
908
- t(n);
917
+ function Ge(t, e) {
918
+ t instanceof Promise ? t.then((r) => {
919
+ e(r);
909
920
  }).catch(() => {
910
- t(null);
911
- }) : t(e);
912
- }
913
- function eo(e, t) {
914
- e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
915
- e.iconsQueueFlag = !1;
916
- const { provider: n, prefix: r } = e, o = e.iconsToLoad;
917
- if (delete e.iconsToLoad, !o || !o.length) return;
918
- const s = e.loadIcon;
919
- if (e.loadIcons && (o.length > 1 || !s)) {
920
- Wt(e.loadIcons(o, r, n), (d) => {
921
- je(e, o, d);
921
+ e(null);
922
+ }) : e(t);
923
+ }
924
+ function eo(t, e) {
925
+ t.iconsToLoad ? t.iconsToLoad = t.iconsToLoad.concat(e).sort() : t.iconsToLoad = e, t.iconsQueueFlag || (t.iconsQueueFlag = !0, setTimeout(() => {
926
+ t.iconsQueueFlag = !1;
927
+ const { provider: r, prefix: n } = t, o = t.iconsToLoad;
928
+ if (delete t.iconsToLoad, !o || !o.length) return;
929
+ const a = t.loadIcon;
930
+ if (t.loadIcons && (o.length > 1 || !a)) {
931
+ Ge(t.loadIcons(o, n, r), (f) => {
932
+ $t(t, o, f);
922
933
  });
923
934
  return;
924
935
  }
925
- if (s) {
926
- o.forEach((d) => {
927
- const h = s(d, r, n);
928
- Wt(h, (m) => {
936
+ if (a) {
937
+ o.forEach((f) => {
938
+ const h = a(f, n, r);
939
+ Ge(h, (m) => {
929
940
  const g = m ? {
930
- prefix: r,
931
- icons: { [d]: m }
941
+ prefix: n,
942
+ icons: { [f]: m }
932
943
  } : null;
933
- je(e, [d], g);
944
+ $t(t, [f], g);
934
945
  });
935
946
  });
936
947
  return;
937
948
  }
938
- const { valid: i, invalid: c } = Xr(o);
939
- if (c.length && je(e, c, null), !i.length) return;
940
- const a = r.match(Fn) ? yt(n) : null;
941
- if (!a) {
942
- je(e, i, null);
949
+ const { valid: i, invalid: c } = to(o);
950
+ if (c.length && $t(t, c, null), !i.length) return;
951
+ const s = n.match(Fr) ? we(r) : null;
952
+ if (!s) {
953
+ $t(t, i, null);
943
954
  return;
944
955
  }
945
- a.prepare(n, r, i).forEach((d) => {
946
- Yr(n, d, (h) => {
947
- je(e, d.icons, h);
956
+ s.prepare(r, n, i).forEach((f) => {
957
+ Xn(r, f, (h) => {
958
+ $t(t, f.icons, h);
948
959
  });
949
960
  });
950
961
  }));
951
962
  }
952
- const to = (e, t) => {
953
- const n = Kr(e, !0, Tn()), r = Jr(n);
954
- if (!r.pending.length) {
955
- let a = !0;
956
- return t && setTimeout(() => {
957
- a && t(r.loaded, r.missing, r.pending, Gt);
963
+ const ro = (t, e) => {
964
+ const r = Kn(t, !0, Nr()), n = Jn(r);
965
+ if (!n.pending.length) {
966
+ let s = !0;
967
+ return e && setTimeout(() => {
968
+ s && e(n.loaded, n.missing, n.pending, Ke);
958
969
  }), () => {
959
- a = !1;
970
+ s = !1;
960
971
  };
961
972
  }
962
- const o = /* @__PURE__ */ Object.create(null), s = [];
973
+ const o = /* @__PURE__ */ Object.create(null), a = [];
963
974
  let i, c;
964
- return r.pending.forEach((a) => {
965
- const { provider: u, prefix: d } = a;
966
- if (d === c && u === i) return;
967
- i = u, c = d, s.push(Te(u, d));
975
+ return n.pending.forEach((s) => {
976
+ const { provider: u, prefix: f } = s;
977
+ if (f === c && u === i) return;
978
+ i = u, c = f, a.push(Et(u, f));
968
979
  const h = o[u] || (o[u] = /* @__PURE__ */ Object.create(null));
969
- h[d] || (h[d] = []);
970
- }), r.pending.forEach((a) => {
971
- const { provider: u, prefix: d, name: h } = a, m = Te(u, d), g = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
972
- g.has(h) || (g.add(h), o[u][d].push(h));
973
- }), s.forEach((a) => {
974
- const u = o[a.provider][a.prefix];
975
- u.length && eo(a, u);
976
- }), t ? Vr(t, r, s) : Gt;
980
+ h[f] || (h[f] = []);
981
+ }), n.pending.forEach((s) => {
982
+ const { provider: u, prefix: f, name: h } = s, m = Et(u, f), g = m.pendingIcons || (m.pendingIcons = /* @__PURE__ */ new Set());
983
+ g.has(h) || (g.add(h), o[u][f].push(h));
984
+ }), a.forEach((s) => {
985
+ const u = o[s.provider][s.prefix];
986
+ u.length && eo(s, u);
987
+ }), e ? Yn(e, n, a) : Ke;
977
988
  };
978
- function no(e, t) {
979
- const n = { ...e };
980
- for (const r in t) {
981
- const o = t[r], s = typeof o;
982
- r in En ? (o === null || o && (s === "string" || s === "number")) && (n[r] = o) : s === typeof n[r] && (n[r] = r === "rotate" ? o % 4 : o);
989
+ function no(t, e) {
990
+ const r = { ...t };
991
+ for (const n in e) {
992
+ const o = e[n], a = typeof o;
993
+ n in Er ? (o === null || o && (a === "string" || a === "number")) && (r[n] = o) : a === typeof r[n] && (r[n] = n === "rotate" ? o % 4 : o);
983
994
  }
984
- return n;
995
+ return r;
985
996
  }
986
- const ro = /[\s,]+/;
987
- function oo(e, t) {
988
- t.split(ro).forEach((n) => {
989
- switch (n.trim()) {
997
+ const oo = /[\s,]+/;
998
+ function ao(t, e) {
999
+ e.split(oo).forEach((r) => {
1000
+ switch (r.trim()) {
990
1001
  case "horizontal":
991
- e.hFlip = !0;
1002
+ t.hFlip = !0;
992
1003
  break;
993
1004
  case "vertical":
994
- e.vFlip = !0;
1005
+ t.vFlip = !0;
995
1006
  break;
996
1007
  }
997
1008
  });
998
1009
  }
999
- function so(e, t = 0) {
1000
- const n = e.replace(/^-?[0-9.]*/, "");
1001
- function r(o) {
1010
+ function io(t, e = 0) {
1011
+ const r = t.replace(/^-?[0-9.]*/, "");
1012
+ function n(o) {
1002
1013
  for (; o < 0; ) o += 4;
1003
1014
  return o % 4;
1004
1015
  }
1005
- if (n === "") {
1006
- const o = parseInt(e);
1007
- return isNaN(o) ? 0 : r(o);
1008
- } else if (n !== e) {
1016
+ if (r === "") {
1017
+ const o = parseInt(t);
1018
+ return isNaN(o) ? 0 : n(o);
1019
+ } else if (r !== t) {
1009
1020
  let o = 0;
1010
- switch (n) {
1021
+ switch (r) {
1011
1022
  case "%":
1012
1023
  o = 25;
1013
1024
  break;
@@ -1015,92 +1026,92 @@ function so(e, t = 0) {
1015
1026
  o = 90;
1016
1027
  }
1017
1028
  if (o) {
1018
- let s = parseFloat(e.slice(0, e.length - n.length));
1019
- return isNaN(s) ? 0 : (s = s / o, s % 1 === 0 ? r(s) : 0);
1029
+ let a = parseFloat(t.slice(0, t.length - r.length));
1030
+ return isNaN(a) ? 0 : (a = a / o, a % 1 === 0 ? n(a) : 0);
1020
1031
  }
1021
1032
  }
1022
- return t;
1033
+ return e;
1023
1034
  }
1024
- function io(e, t) {
1025
- let n = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1026
- for (const r in t) n += " " + r + '="' + t[r] + '"';
1027
- return '<svg xmlns="http://www.w3.org/2000/svg"' + n + ">" + e + "</svg>";
1035
+ function so(t, e) {
1036
+ let r = t.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
1037
+ for (const n in e) r += " " + n + '="' + e[n] + '"';
1038
+ return '<svg xmlns="http://www.w3.org/2000/svg"' + r + ">" + t + "</svg>";
1028
1039
  }
1029
- function ao(e) {
1030
- return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1040
+ function co(t) {
1041
+ return t.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
1031
1042
  }
1032
- function co(e) {
1033
- return "data:image/svg+xml," + ao(e);
1043
+ function lo(t) {
1044
+ return "data:image/svg+xml," + co(t);
1034
1045
  }
1035
- function lo(e) {
1036
- return 'url("' + co(e) + '")';
1046
+ function uo(t) {
1047
+ return 'url("' + lo(t) + '")';
1037
1048
  }
1038
- let Me;
1039
- function uo() {
1049
+ let Dt;
1050
+ function fo() {
1040
1051
  try {
1041
- Me = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
1052
+ Dt = window.trustedTypes.createPolicy("iconify", { createHTML: (t) => t });
1042
1053
  } catch {
1043
- Me = null;
1054
+ Dt = null;
1044
1055
  }
1045
1056
  }
1046
- function fo(e) {
1047
- return Me === void 0 && uo(), Me ? Me.createHTML(e) : e;
1057
+ function po(t) {
1058
+ return Dt === void 0 && fo(), Dt ? Dt.createHTML(t) : t;
1048
1059
  }
1049
- const jn = {
1050
- ...Pn,
1060
+ const jr = {
1061
+ ...Tr,
1051
1062
  inline: !1
1052
- }, po = {
1063
+ }, ho = {
1053
1064
  xmlns: "http://www.w3.org/2000/svg",
1054
1065
  xmlnsXlink: "http://www.w3.org/1999/xlink",
1055
1066
  "aria-hidden": !0,
1056
1067
  role: "img"
1057
- }, ho = {
1068
+ }, mo = {
1058
1069
  display: "inline-block"
1059
- }, bt = {
1070
+ }, ye = {
1060
1071
  backgroundColor: "currentColor"
1061
- }, An = {
1072
+ }, $r = {
1062
1073
  backgroundColor: "transparent"
1063
- }, Qt = {
1074
+ }, We = {
1064
1075
  Image: "var(--svg)",
1065
1076
  Repeat: "no-repeat",
1066
1077
  Size: "100% 100%"
1067
- }, Yt = {
1068
- WebkitMask: bt,
1069
- mask: bt,
1070
- background: An
1078
+ }, Qe = {
1079
+ WebkitMask: ye,
1080
+ mask: ye,
1081
+ background: $r
1071
1082
  };
1072
- for (const e in Yt) {
1073
- const t = Yt[e];
1074
- for (const n in Qt)
1075
- t[e + n] = Qt[n];
1083
+ for (const t in Qe) {
1084
+ const e = Qe[t];
1085
+ for (const r in We)
1086
+ e[t + r] = We[r];
1076
1087
  }
1077
- const mo = {
1078
- ...jn,
1088
+ const go = {
1089
+ ...jr,
1079
1090
  inline: !0
1080
1091
  };
1081
- function Zt(e) {
1082
- return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
1092
+ function Xe(t) {
1093
+ return t + (t.match(/^[-0-9.]+$/) ? "px" : "");
1083
1094
  }
1084
- const go = (e, t, n) => {
1085
- const r = t.inline ? mo : jn, o = no(r, t), s = t.mode || "svg", i = {}, c = t.style || {}, a = {
1086
- ...s === "svg" ? po : {}
1095
+ const wo = (t, e, r) => {
1096
+ const n = e.inline ? go : jr, o = no(n, e), a = e.mode || "svg", i = {}, c = e.style || {}, s = {
1097
+ ...a === "svg" ? ho : {}
1087
1098
  };
1088
- if (n) {
1089
- const y = et(n, !1, !0);
1090
- if (y) {
1099
+ if (r) {
1100
+ const w = te(r, !1, !0);
1101
+ if (w) {
1091
1102
  const v = ["iconify"], B = [
1092
1103
  "provider",
1093
1104
  "prefix"
1094
1105
  ];
1095
1106
  for (const P of B)
1096
- y[P] && v.push("iconify--" + y[P]);
1097
- a.className = v.join(" ");
1107
+ w[P] && v.push("iconify--" + w[P]);
1108
+ s.className = v.join(" ");
1098
1109
  }
1099
1110
  }
1100
- for (let y in t) {
1101
- const v = t[y];
1111
+ for (let w in e) {
1112
+ const v = e[w];
1102
1113
  if (v !== void 0)
1103
- switch (y) {
1114
+ switch (w) {
1104
1115
  // Properties to ignore
1105
1116
  case "icon":
1106
1117
  case "style":
@@ -1112,21 +1123,21 @@ const go = (e, t, n) => {
1112
1123
  break;
1113
1124
  // Forward ref
1114
1125
  case "_ref":
1115
- a.ref = v;
1126
+ s.ref = v;
1116
1127
  break;
1117
1128
  // Merge class names
1118
1129
  case "className":
1119
- a[y] = (a[y] ? a[y] + " " : "") + v;
1130
+ s[w] = (s[w] ? s[w] + " " : "") + v;
1120
1131
  break;
1121
1132
  // Boolean attributes
1122
1133
  case "inline":
1123
1134
  case "hFlip":
1124
1135
  case "vFlip":
1125
- o[y] = v === !0 || v === "true" || v === 1;
1136
+ o[w] = v === !0 || v === "true" || v === 1;
1126
1137
  break;
1127
1138
  // Flip as string: 'horizontal,vertical'
1128
1139
  case "flip":
1129
- typeof v == "string" && oo(o, v);
1140
+ typeof v == "string" && ao(o, v);
1130
1141
  break;
1131
1142
  // Color: copy to style
1132
1143
  case "color":
@@ -1134,91 +1145,91 @@ const go = (e, t, n) => {
1134
1145
  break;
1135
1146
  // Rotation as string
1136
1147
  case "rotate":
1137
- typeof v == "string" ? o[y] = so(v) : typeof v == "number" && (o[y] = v);
1148
+ typeof v == "string" ? o[w] = io(v) : typeof v == "number" && (o[w] = v);
1138
1149
  break;
1139
1150
  // Remove aria-hidden
1140
1151
  case "ariaHidden":
1141
1152
  case "aria-hidden":
1142
- v !== !0 && v !== "true" && delete a["aria-hidden"];
1153
+ v !== !0 && v !== "true" && delete s["aria-hidden"];
1143
1154
  break;
1144
1155
  // Copy missing property if it does not exist in customisations
1145
1156
  default:
1146
- r[y] === void 0 && (a[y] = v);
1157
+ n[w] === void 0 && (s[w] = v);
1147
1158
  }
1148
1159
  }
1149
- const u = Tr(e, o), d = u.attributes;
1150
- if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
1151
- a.style = {
1160
+ const u = Tn(t, o), f = u.attributes;
1161
+ if (o.inline && (i.verticalAlign = "-0.125em"), a === "svg") {
1162
+ s.style = {
1152
1163
  ...i,
1153
1164
  ...c
1154
- }, Object.assign(a, d);
1155
- let y = 0, v = t.id;
1156
- return typeof v == "string" && (v = v.replace(/-/g, "_")), a.dangerouslySetInnerHTML = {
1157
- __html: fo($r(u.body, v ? () => v + "ID" + y++ : "iconifyReact"))
1158
- }, pt("svg", a);
1159
- }
1160
- const { body: h, width: m, height: g } = e, S = s === "mask" || (s === "bg" ? !1 : h.indexOf("currentColor") !== -1), _ = io(h, {
1161
- ...d,
1165
+ }, Object.assign(s, f);
1166
+ let w = 0, v = e.id;
1167
+ return typeof v == "string" && (v = v.replace(/-/g, "_")), s.dangerouslySetInnerHTML = {
1168
+ __html: po($n(u.body, v ? () => v + "ID" + w++ : "iconifyReact"))
1169
+ }, fe("svg", s);
1170
+ }
1171
+ const { body: h, width: m, height: g } = t, k = a === "mask" || (a === "bg" ? !1 : h.indexOf("currentColor") !== -1), _ = so(h, {
1172
+ ...f,
1162
1173
  width: m + "",
1163
1174
  height: g + ""
1164
1175
  });
1165
- return a.style = {
1176
+ return s.style = {
1166
1177
  ...i,
1167
- "--svg": lo(_),
1168
- width: Zt(d.width),
1169
- height: Zt(d.height),
1170
- ...ho,
1171
- ...S ? bt : An,
1178
+ "--svg": uo(_),
1179
+ width: Xe(f.width),
1180
+ height: Xe(f.height),
1181
+ ...mo,
1182
+ ...k ? ye : $r,
1172
1183
  ...c
1173
- }, pt("span", a);
1184
+ }, fe("span", s);
1174
1185
  };
1175
- Tn(!0);
1176
- jr("", Hr);
1186
+ Nr(!0);
1187
+ An("", Rn);
1177
1188
  if (typeof document < "u" && typeof window < "u") {
1178
- const e = window;
1179
- if (e.IconifyPreload !== void 0) {
1180
- const t = e.IconifyPreload, n = "Invalid IconifyPreload syntax.";
1181
- typeof t == "object" && t !== null && (t instanceof Array ? t : [t]).forEach((r) => {
1189
+ const t = window;
1190
+ if (t.IconifyPreload !== void 0) {
1191
+ const e = t.IconifyPreload, r = "Invalid IconifyPreload syntax.";
1192
+ typeof e == "object" && e !== null && (e instanceof Array ? e : [e]).forEach((n) => {
1182
1193
  try {
1183
1194
  // Check if item is an object and not null/array
1184
- (typeof r != "object" || r === null || r instanceof Array || // Check for 'icons' and 'prefix'
1185
- typeof r.icons != "object" || typeof r.prefix != "string" || // Add icon set
1186
- !Sr(r)) && console.error(n);
1195
+ (typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
1196
+ typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
1197
+ !Sn(n)) && console.error(r);
1187
1198
  } catch {
1188
- console.error(n);
1199
+ console.error(r);
1189
1200
  }
1190
1201
  });
1191
1202
  }
1192
- if (e.IconifyProviders !== void 0) {
1193
- const t = e.IconifyProviders;
1194
- if (typeof t == "object" && t !== null)
1195
- for (let n in t) {
1196
- const r = "IconifyProviders[" + n + "] is invalid.";
1203
+ if (t.IconifyProviders !== void 0) {
1204
+ const e = t.IconifyProviders;
1205
+ if (typeof e == "object" && e !== null)
1206
+ for (let r in e) {
1207
+ const n = "IconifyProviders[" + r + "] is invalid.";
1197
1208
  try {
1198
- const o = t[n];
1209
+ const o = e[r];
1199
1210
  if (typeof o != "object" || !o || o.resources === void 0)
1200
1211
  continue;
1201
- Ar(n, o) || console.error(r);
1212
+ Ln(r, o) || console.error(n);
1202
1213
  } catch {
1203
- console.error(r);
1214
+ console.error(n);
1204
1215
  }
1205
1216
  }
1206
1217
  }
1207
1218
  }
1208
- function Ln(e) {
1209
- const [t, n] = M(!!e.ssr), [r, o] = M({});
1210
- function s(g) {
1219
+ function Ar(t) {
1220
+ const [e, r] = D(!!t.ssr), [n, o] = D({});
1221
+ function a(g) {
1211
1222
  if (g) {
1212
- const S = e.icon;
1213
- if (typeof S == "object")
1223
+ const k = t.icon;
1224
+ if (typeof k == "object")
1214
1225
  return {
1215
1226
  name: "",
1216
- data: S
1227
+ data: k
1217
1228
  };
1218
- const _ = zt(S);
1229
+ const _ = He(k);
1219
1230
  if (_)
1220
1231
  return {
1221
- name: S,
1232
+ name: k,
1222
1233
  data: _
1223
1234
  };
1224
1235
  }
@@ -1226,102 +1237,102 @@ function Ln(e) {
1226
1237
  name: ""
1227
1238
  };
1228
1239
  }
1229
- const [i, c] = M(s(!!e.ssr));
1230
- function a() {
1231
- const g = r.callback;
1240
+ const [i, c] = D(a(!!t.ssr));
1241
+ function s() {
1242
+ const g = n.callback;
1232
1243
  g && (g(), o({}));
1233
1244
  }
1234
1245
  function u(g) {
1235
1246
  if (JSON.stringify(i) !== JSON.stringify(g))
1236
- return a(), c(g), !0;
1247
+ return s(), c(g), !0;
1237
1248
  }
1238
- function d() {
1249
+ function f() {
1239
1250
  var g;
1240
- const S = e.icon;
1241
- if (typeof S == "object") {
1251
+ const k = t.icon;
1252
+ if (typeof k == "object") {
1242
1253
  u({
1243
1254
  name: "",
1244
- data: S
1255
+ data: k
1245
1256
  });
1246
1257
  return;
1247
1258
  }
1248
- const _ = zt(S);
1259
+ const _ = He(k);
1249
1260
  if (u({
1250
- name: S,
1261
+ name: k,
1251
1262
  data: _
1252
1263
  }))
1253
1264
  if (_ === void 0) {
1254
- const y = to([S], d);
1265
+ const w = ro([k], f);
1255
1266
  o({
1256
- callback: y
1267
+ callback: w
1257
1268
  });
1258
- } else _ && ((g = e.onLoad) === null || g === void 0 || g.call(e, S));
1269
+ } else _ && ((g = t.onLoad) === null || g === void 0 || g.call(t, k));
1259
1270
  }
1260
- ge(() => (n(!0), a), []), ge(() => {
1261
- t && d();
1262
- }, [e.icon, t]);
1271
+ ct(() => (r(!0), s), []), ct(() => {
1272
+ e && f();
1273
+ }, [t.icon, e]);
1263
1274
  const { name: h, data: m } = i;
1264
- return m ? go({
1265
- ...kt,
1275
+ return m ? wo({
1276
+ ...Se,
1266
1277
  ...m
1267
- }, e, h) : e.children ? e.children : e.fallback ? e.fallback : pt("span", {});
1278
+ }, t, h) : t.children ? t.children : t.fallback ? t.fallback : fe("span", {});
1268
1279
  }
1269
- const Xt = yn((e, t) => Ln({
1270
- ...e,
1271
- _ref: t
1280
+ const Ze = hr((t, e) => Ar({
1281
+ ...t,
1282
+ _ref: e
1272
1283
  }));
1273
- yn((e, t) => Ln({
1284
+ hr((t, e) => Ar({
1274
1285
  inline: !0,
1275
- ...e,
1276
- _ref: t
1286
+ ...t,
1287
+ _ref: e
1277
1288
  }));
1278
1289
  function yo() {
1279
- const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, n] = M(e);
1280
- return ge(() => {
1281
- const r = () => n(e());
1282
- return window.addEventListener("resize", r), () => window.removeEventListener("resize", r);
1283
- }, []), t;
1290
+ const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = D(t);
1291
+ return ct(() => {
1292
+ const n = () => r(t());
1293
+ return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
1294
+ }, []), e;
1284
1295
  }
1285
1296
  const bo = ({
1286
- product: e
1297
+ product: t
1287
1298
  }) => {
1288
- const t = mn(), n = yo(), [r, o] = M(0), s = () => {
1299
+ const e = mr(), r = yo(), [n, o] = D(0), a = () => {
1289
1300
  o(
1290
- (a) => a + n >= e.length ? 0 : a + n
1301
+ (s) => s + r >= t.length ? 0 : s + r
1291
1302
  );
1292
1303
  }, i = () => {
1293
1304
  o(
1294
- (a) => a - n < 0 ? e.length - (e.length % n || n) : a - n
1305
+ (s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
1295
1306
  );
1296
- }, c = async (a) => {
1297
- const u = await kn(a);
1298
- t(ht(u));
1307
+ }, c = async (s) => {
1308
+ const u = await kr(s);
1309
+ e(he(u));
1299
1310
  };
1300
1311
  return /* @__PURE__ */ l("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ p("div", { className: "flex items-center justify-center gap-4 relative", children: [
1301
- (e == null ? void 0 : e.length) > n && /* @__PURE__ */ l(
1312
+ (t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
1302
1313
  "button",
1303
1314
  {
1304
1315
  onClick: i,
1305
1316
  className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
1306
- children: /* @__PURE__ */ l(Xt, { icon: "mdi:chevron-left", width: "25" })
1317
+ children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-left", width: "25" })
1307
1318
  }
1308
1319
  ),
1309
- /* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(r, r + n).map((a) => {
1310
- var u, d, h, m;
1320
+ /* @__PURE__ */ l("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(n, n + r).map((s) => {
1321
+ var u, f, h, m;
1311
1322
  return /* @__PURE__ */ p(
1312
1323
  "div",
1313
1324
  {
1314
1325
  className: "flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",
1315
1326
  onClick: () => {
1316
- c(a.product_id ?? a.productId);
1327
+ c(s.product_id ?? s.productId);
1317
1328
  },
1318
1329
  children: [
1319
1330
  /* @__PURE__ */ l("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ l(
1320
1331
  "img",
1321
1332
  {
1322
- src: ((u = Ut(a)[0]) == null ? void 0 : u.link) || Ut(a)[0] || // fallback if it's a string
1333
+ src: ((u = Me(s)[0]) == null ? void 0 : u.link) || Me(s)[0] || // fallback if it's a string
1323
1334
  "https://via.placeholder.com/120",
1324
- alt: a != null && a.productName ? a.productName : "Product",
1335
+ alt: s != null && s.productName ? s.productName : "Product",
1325
1336
  className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
1326
1337
  }
1327
1338
  ) }),
@@ -1331,8 +1342,8 @@ const bo = ({
1331
1342
  className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
1332
1343
  children: [
1333
1344
  /* @__PURE__ */ p("div", { className: "relative inline-block group", children: [
1334
- /* @__PURE__ */ l("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : Bt(
1335
- Mt((d = a == null ? void 0 : a.name) == null ? void 0 : d["en-US"]),
1345
+ /* @__PURE__ */ l("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : Be(
1346
+ De((f = s == null ? void 0 : s.name) == null ? void 0 : f["en-US"]),
1336
1347
  60
1337
1348
  ) || "Product" }),
1338
1349
  /* @__PURE__ */ l(
@@ -1346,21 +1357,21 @@ const bo = ({
1346
1357
  marginBottom: "5px",
1347
1358
  zIndex: 50
1348
1359
  },
1349
- children: a != null && a.productName ? a.productName : a != null && a.product_name ? a.product_name : Bt(
1350
- Mt((h = a == null ? void 0 : a.name) == null ? void 0 : h["en-US"]),
1360
+ children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : Be(
1361
+ De((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
1351
1362
  60
1352
1363
  ) || "Product"
1353
1364
  }
1354
1365
  )
1355
1366
  ] }),
1356
1367
  /* @__PURE__ */ p("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
1357
- /* @__PURE__ */ l("p", { children: pr(
1358
- a != null && a.price ? Number(a == null ? void 0 : a.price) : qt(a).centAmount || 0,
1359
- (m = qt(a)) == null ? void 0 : m.currencyCode
1368
+ /* @__PURE__ */ l("p", { children: hn(
1369
+ s != null && s.price ? Number(s == null ? void 0 : s.price) : Ue(s).centAmount || 0,
1370
+ (m = Ue(s)) == null ? void 0 : m.currencyCode
1360
1371
  ) }),
1361
1372
  /* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
1362
1373
  "$",
1363
- Number(a == null ? void 0 : a.price).toFixed(2) ?? 5
1374
+ Number(s == null ? void 0 : s.price).toFixed(2) ?? 5
1364
1375
  ] })
1365
1376
  ] })
1366
1377
  ]
@@ -1368,19 +1379,19 @@ const bo = ({
1368
1379
  )
1369
1380
  ]
1370
1381
  },
1371
- a.productId
1382
+ s.productId
1372
1383
  );
1373
1384
  }) }),
1374
- (e == null ? void 0 : e.length) > n && /* @__PURE__ */ l(
1385
+ (t == null ? void 0 : t.length) > r && /* @__PURE__ */ l(
1375
1386
  "button",
1376
1387
  {
1377
- onClick: s,
1388
+ onClick: a,
1378
1389
  className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
1379
- children: /* @__PURE__ */ l(Xt, { icon: "mdi:chevron-right", width: "25" })
1390
+ children: /* @__PURE__ */ l(Ze, { icon: "mdi:chevron-right", width: "25" })
1380
1391
  }
1381
1392
  )
1382
1393
  ] }) });
1383
- }, wo = ({ chat: e, storeDetails: t }) => /* @__PURE__ */ l("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: e.map((n, r) => /* @__PURE__ */ p(
1394
+ }, xo = ({ chat: t, storeDetails: e }) => /* @__PURE__ */ l("div", { className: "bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full", children: t.map((r, n) => /* @__PURE__ */ p(
1384
1395
  "div",
1385
1396
  {
1386
1397
  className: "mb-4 p-3 rounded-xl",
@@ -1393,216 +1404,216 @@ const bo = ({
1393
1404
  "div",
1394
1405
  {
1395
1406
  className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
1396
- children: hr(n.keyword) || "No keyword"
1407
+ children: mn(r.keyword) || "No keyword"
1397
1408
  }
1398
1409
  ),
1399
1410
  /* @__PURE__ */ l(
1400
1411
  bo,
1401
1412
  {
1402
- product: n.items,
1403
- storeDetails: t
1413
+ product: r.items,
1414
+ storeDetails: e
1404
1415
  }
1405
1416
  )
1406
1417
  ]
1407
1418
  },
1408
- r
1409
- )) }), Dn = async (e, t) => {
1410
- const { serverUrl: n, basePath: r } = ye(), o = `${n}`;
1419
+ n
1420
+ )) }), Lr = async (t, e) => {
1421
+ const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
1411
1422
  console.log(`customer_token
1412
- `, e);
1423
+ `, t);
1413
1424
  try {
1414
- return (await q.post(
1415
- `${o}${r}/basket/create?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
1416
- t,
1425
+ return (await U.post(
1426
+ `${o}${n}/basket/create?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
1427
+ e,
1417
1428
  {
1418
1429
  headers: {
1419
1430
  "Content-Type": "application/json",
1420
- Authorization: e
1431
+ Authorization: t
1421
1432
  }
1422
1433
  }
1423
1434
  )).data;
1424
- } catch (s) {
1425
- return q.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
1435
+ } catch (a) {
1436
+ return U.isAxiosError(a) ? console.error("Error creating basket:", a.response || a.message) : console.error("Unexpected error:", a), null;
1426
1437
  }
1427
- }, Qe = async (e, t, n) => {
1428
- const { serverUrl: r, basePath: o } = ye(), s = `${r}`;
1438
+ }, Wt = async (t, e, r) => {
1439
+ const { serverUrl: n, basePath: o } = wt(), a = `${n}`;
1429
1440
  try {
1430
- const i = await q.post(
1431
- `${s}${o}/basket/add-product/${e}?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
1432
- t,
1441
+ const i = await U.post(
1442
+ `${a}${o}/basket/add-product/${t}?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
1443
+ e,
1433
1444
  {
1434
1445
  headers: {
1435
1446
  "Content-Type": "application/json",
1436
- Authorization: n
1447
+ Authorization: r
1437
1448
  }
1438
1449
  }
1439
1450
  );
1440
1451
  return i.status === 200 && i.data ? i.data : null;
1441
1452
  } catch (i) {
1442
- return q.isAxiosError(i) ? console.error(
1453
+ return U.isAxiosError(i) ? console.error(
1443
1454
  "Error adding products to basket:",
1444
1455
  i.response || i.message
1445
1456
  ) : console.error("Unexpected error:", i), null;
1446
1457
  }
1447
- }, Mn = async ({
1448
- basketId: e,
1449
- customer_token: t
1458
+ }, zr = async ({
1459
+ basketId: t,
1460
+ customer_token: e
1450
1461
  }) => {
1451
- var s;
1452
- const { serverUrl: n, basePath: r } = ye(), o = `${n}`;
1462
+ var a;
1463
+ const { serverUrl: r, basePath: n } = wt(), o = `${r}`;
1453
1464
  try {
1454
- const i = await q.get(
1455
- `${o}${r}/basket/${e}?baseUrl=${ce()}&siteId=${ne()}&pubCfg=${le()}&envRef=${ue()}&orgRef=${fe()}`,
1465
+ const i = await U.get(
1466
+ `${o}${n}/basket/${t}?baseUrl=${lt()}&siteId=${rt()}&pubCfg=${ut()}&envRef=${dt()}&orgRef=${ft()}`,
1456
1467
  {
1457
1468
  headers: {
1458
1469
  "Content-Type": "application/json",
1459
- Authorization: t
1470
+ Authorization: e
1460
1471
  }
1461
1472
  }
1462
1473
  );
1463
1474
  return { status: i.status, data: i.data };
1464
1475
  } catch (i) {
1465
- return q.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
1476
+ return U.isAxiosError(i) ? { status: (a = i.response) == null ? void 0 : a.status, data: null } : { status: null, data: null };
1466
1477
  }
1467
- }, en = "sfcc_basket_id", tn = "sfcc_customer_token", qe = "sfcc_token_expiry", xo = 300 * 1e3, Ae = "1.0.0";
1468
- const Fe = (e) => {
1478
+ }, tr = "sfcc_basket_id", er = "sfcc_customer_token", Ut = "sfcc_token_expiry", vo = 300 * 1e3, At = "1.0.0";
1479
+ const Nt = (t) => {
1469
1480
  try {
1470
- e ? localStorage.setItem(en, e) : localStorage.removeItem(en);
1471
- } catch (t) {
1472
- console.error("Error saving basket ID to storage:", t);
1481
+ t ? localStorage.setItem(tr, t) : localStorage.removeItem(tr);
1482
+ } catch (e) {
1483
+ console.error("Error saving basket ID to storage:", e);
1473
1484
  }
1474
- }, Ye = (e) => {
1485
+ }, Qt = (t) => {
1475
1486
  try {
1476
- if (e) {
1477
- localStorage.setItem(tn, e);
1478
- const t = Date.now() + xo;
1479
- localStorage.setItem(qe, t.toString());
1487
+ if (t) {
1488
+ localStorage.setItem(er, t);
1489
+ const e = Date.now() + vo;
1490
+ localStorage.setItem(Ut, e.toString());
1480
1491
  } else
1481
- localStorage.removeItem(tn);
1482
- } catch (t) {
1483
- console.error("Error storing token:", t);
1484
- }
1485
- }, nn = 300, vo = () => {
1486
- var c, a, u, d, h, m;
1487
- const e = mn(), t = Ge((g) => g.product.product), n = Ge((g) => g.store.store), [r, o] = M(!!t);
1488
- if (ge(() => {
1489
- o(!!t);
1490
- }, [t]), !t) return null;
1491
- const s = async () => {
1492
- var g, S, _, y, v, B, P, j, X, k, L, z, V, O, be, E;
1493
- console.log(t, "the prod");
1492
+ localStorage.removeItem(er);
1493
+ } catch (e) {
1494
+ console.error("Error storing token:", e);
1495
+ }
1496
+ }, rr = 300, ko = () => {
1497
+ var c, s, u, f, h, m;
1498
+ const t = mr(), e = Kt((g) => g.product.product), r = Kt((g) => g.store.store), [n, o] = D(!!e);
1499
+ if (ct(() => {
1500
+ o(!!e);
1501
+ }, [e]), !e) return null;
1502
+ const a = async () => {
1503
+ var g, k, _, w, v, B, P, $, Z, S, L, H, V, O, yt, T;
1504
+ console.log(e, "the prod");
1494
1505
  try {
1495
- if (!((S = (g = t == null ? void 0 : t.variants) == null ? void 0 : g[0]) != null && S.product_id) && !(t.type.item || t.type.bundle) && !((y = (_ = t == null ? void 0 : t.variants) == null ? void 0 : _[0]) != null && y.productId)) {
1496
- Z.error("Variants not available", {
1506
+ if (!((k = (g = e == null ? void 0 : e.variants) == null ? void 0 : g[0]) != null && k.product_id) && !(e.type.item || e.type.bundle) && !((w = (_ = e == null ? void 0 : e.variants) == null ? void 0 : _[0]) != null && w.productId)) {
1507
+ X.error("Variants not available", {
1497
1508
  position: "bottom-right",
1498
1509
  autoClose: 1e3
1499
1510
  }), console.error("No product variant found");
1500
1511
  return;
1501
1512
  }
1502
- const $ = [
1513
+ const j = [
1503
1514
  {
1504
- product_id: ((v = t.variants) == null ? void 0 : v[0].product_id) || ((B = t.variants) == null ? void 0 : B[0].productId) || (t == null ? void 0 : t.id),
1515
+ product_id: ((v = e.variants) == null ? void 0 : v[0].product_id) || ((B = e.variants) == null ? void 0 : B[0].productId) || (e == null ? void 0 : e.id),
1505
1516
  quantity: 1
1506
1517
  }
1507
1518
  ];
1508
- console.log($, "the product data");
1509
- const Pe = JSON.parse(
1519
+ console.log(j, "the product data");
1520
+ const Pt = JSON.parse(
1510
1521
  sessionStorage.getItem("customerData") || "{}"
1511
- ), de = Pe == null ? void 0 : Pe.basketId, tt = !1, re = localStorage.getItem(qe), pe = Date.now();
1512
- if (!tt || !re || pe >= parseInt(re)) {
1513
- let J = "";
1522
+ ), pt = Pt == null ? void 0 : Pt.basketId, ee = !1, nt = localStorage.getItem(Ut), ht = Date.now();
1523
+ if (!ee || !nt || ht >= parseInt(nt)) {
1524
+ let Y = "";
1514
1525
  {
1515
- const we = await Xe();
1516
- console.log("token from auth data"), J = "Bearer " + we.access_token;
1526
+ const bt = await Zt();
1527
+ console.log("token from auth data"), Y = "Bearer " + bt.access_token;
1517
1528
  }
1518
- if (!J) {
1529
+ if (!Y) {
1519
1530
  console.error("Failed to get customer_token");
1520
1531
  return;
1521
1532
  }
1522
- const nt = pe + 300 * 1e3;
1523
- if (Ye(J), localStorage.setItem(qe, nt.toString()), de) {
1524
- const we = await Mn({
1525
- basketId: de,
1526
- customer_token: J
1533
+ const re = ht + 300 * 1e3;
1534
+ if (Qt(Y), localStorage.setItem(Ut, re.toString()), pt) {
1535
+ const bt = await zr({
1536
+ basketId: pt,
1537
+ customer_token: Y
1527
1538
  });
1528
- if (console.log(de, "basket id from customer"), we.status === 200 && we) {
1529
- const oe = await Qe(
1530
- de,
1531
- $,
1532
- J
1539
+ if (console.log(pt, "basket id from customer"), bt.status === 200 && bt) {
1540
+ const ot = await Wt(
1541
+ pt,
1542
+ j,
1543
+ Y
1533
1544
  );
1534
- (((P = oe == null ? void 0 : oe.product_items) == null ? void 0 : P.length) > 0 || ((j = oe == null ? void 0 : oe.productItems) == null ? void 0 : j.length) > 0) && (Z.success("Added to cart", {
1545
+ (((P = ot == null ? void 0 : ot.product_items) == null ? void 0 : P.length) > 0 || (($ = ot == null ? void 0 : ot.productItems) == null ? void 0 : $.length) > 0) && (X.success("Added to cart", {
1535
1546
  position: "bottom-right",
1536
1547
  autoClose: 3e3,
1537
1548
  hideProgressBar: !1,
1538
1549
  closeOnClick: !0,
1539
1550
  pauseOnHover: !0,
1540
1551
  draggable: !0
1541
- }), Ne(de));
1552
+ }), Ft(pt));
1542
1553
  return;
1543
1554
  }
1544
1555
  }
1545
- const rt = {
1556
+ const ne = {
1546
1557
  productItems: [
1547
1558
  {
1548
- productId: ((X = t.variants) == null ? void 0 : X[0].product_id) || ((k = t.variants) == null ? void 0 : k[0].productId) || (t == null ? void 0 : t.id),
1559
+ productId: ((Z = e.variants) == null ? void 0 : Z[0].product_id) || ((S = e.variants) == null ? void 0 : S[0].productId) || (e == null ? void 0 : e.id),
1549
1560
  quantity: 1
1550
1561
  }
1551
1562
  ]
1552
1563
  };
1553
1564
  console.log("before create basket");
1554
- const w = await Dn(J, rt);
1565
+ const b = await Lr(Y, ne);
1555
1566
  if (console.log(
1556
- w,
1557
- w == null ? void 0 : w.basket_id,
1558
- w == null ? void 0 : w.basketId,
1567
+ b,
1568
+ b == null ? void 0 : b.basket_id,
1569
+ b == null ? void 0 : b.basketId,
1559
1570
  "the basket response"
1560
- ), !(w != null && w.basket_id) && !(w != null && w.basketId)) {
1571
+ ), !(b != null && b.basket_id) && !(b != null && b.basketId)) {
1561
1572
  console.error("Failed to create basket");
1562
1573
  return;
1563
1574
  }
1564
1575
  console.log(
1565
1576
  "setting stored id",
1566
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
1567
- ), Fe(
1568
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId)
1577
+ (b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
1578
+ ), Nt(
1579
+ (b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId)
1569
1580
  ), console.log("adding product to basket");
1570
- const K = await Qe(
1571
- (w == null ? void 0 : w.basket_id) || (w == null ? void 0 : w.basketId),
1572
- $,
1573
- J
1581
+ const J = await Wt(
1582
+ (b == null ? void 0 : b.basket_id) || (b == null ? void 0 : b.basketId),
1583
+ j,
1584
+ Y
1574
1585
  );
1575
- console.log("object added to basket"), (((L = K == null ? void 0 : K.product_items) == null ? void 0 : L.length) > 0 || ((z = K == null ? void 0 : K.productItems) == null ? void 0 : z.length) > 0) && Z.success("Added to cart", {
1586
+ console.log("object added to basket"), (((L = J == null ? void 0 : J.product_items) == null ? void 0 : L.length) > 0 || ((H = J == null ? void 0 : J.productItems) == null ? void 0 : H.length) > 0) && X.success("Added to cart", {
1576
1587
  position: "bottom-right",
1577
1588
  autoClose: 3e3,
1578
1589
  hideProgressBar: !1,
1579
1590
  closeOnClick: !0,
1580
1591
  pauseOnHover: !0,
1581
1592
  draggable: !0
1582
- }), Ne(w.basket_id || (w == null ? void 0 : w.basketId));
1593
+ }), Ft(b.basket_id || (b == null ? void 0 : b.basketId));
1583
1594
  }
1584
- } catch ($) {
1585
- console.error("Error adding to cart:", $), Z.error("Failed to add product to cart", {
1595
+ } catch (j) {
1596
+ console.error("Error adding to cart:", j), X.error("Failed to add product to cart", {
1586
1597
  position: "bottom-right",
1587
1598
  autoClose: 3e3
1588
- }), ((V = $ == null ? void 0 : $.response) == null ? void 0 : V.status) === 404 || // Basket not found
1589
- ((O = $ == null ? void 0 : $.response) == null ? void 0 : O.status) === 401 ? (((be = $ == null ? void 0 : $.response) == null ? void 0 : be.status) === 404 && Fe(null), ((E = $ == null ? void 0 : $.response) == null ? void 0 : E.status) === 401 && (Fe(null), Ye(null))) : (console.error("Failed to add product to basket:", $.message), Z.error("Failed to add product to cart", {
1599
+ }), ((V = j == null ? void 0 : j.response) == null ? void 0 : V.status) === 404 || // Basket not found
1600
+ ((O = j == null ? void 0 : j.response) == null ? void 0 : O.status) === 401 ? (((yt = j == null ? void 0 : j.response) == null ? void 0 : yt.status) === 404 && Nt(null), ((T = j == null ? void 0 : j.response) == null ? void 0 : T.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", j.message), X.error("Failed to add product to cart", {
1590
1601
  position: "bottom-right",
1591
1602
  autoClose: 3e3
1592
1603
  }));
1593
1604
  } finally {
1594
- Ne();
1605
+ Ft();
1595
1606
  }
1596
1607
  }, i = () => {
1597
- t && (window.location.href = t.c_pdpUrl);
1608
+ e && (window.location.href = e.c_pdpUrl);
1598
1609
  };
1599
- return console.log(t, "the prod"), /* @__PURE__ */ p(dt, { children: [
1610
+ return console.log(e, "the prod"), /* @__PURE__ */ p(pe, { children: [
1600
1611
  /* @__PURE__ */ l(
1601
1612
  "div",
1602
1613
  {
1603
1614
  className: "fixed inset-0 z-40 bg-black/30",
1604
1615
  onClick: () => {
1605
- o(!1), setTimeout(() => e(ht(null)), nn);
1616
+ o(!1), setTimeout(() => t(he(null)), rr);
1606
1617
  }
1607
1618
  }
1608
1619
  ),
@@ -1612,22 +1623,22 @@ const Fe = (e) => {
1612
1623
  className: `
1613
1624
  flex flex-col gap-2 items-center h-[90vh] absolute right-0 bottom-0 z-50 w-full md:w-1/2 md:h-[100vh] lg:w-1/2 lg:h-[100vh] shadow-xl p-2 border-l-2 bg-white border-gray-200 overflow-y-scroll
1614
1625
  transition-all duration-300
1615
- ${r ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
1626
+ ${n ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
1616
1627
  `,
1617
1628
  style: { willChange: "transform, opacity" },
1618
1629
  onClick: (g) => g.stopPropagation(),
1619
1630
  children: [
1620
1631
  /* @__PURE__ */ p("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
1621
- /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children: t.name }) }),
1632
+ /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
1622
1633
  /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
1623
- Lt,
1634
+ Le,
1624
1635
  {
1625
1636
  icon: "mdi:close",
1626
1637
  className: "text-[#555555] w-6 h-6 cursor-pointer",
1627
1638
  onClick: () => {
1628
1639
  o(!1), setTimeout(
1629
- () => e(ht(null)),
1630
- nn
1640
+ () => t(he(null)),
1641
+ rr
1631
1642
  );
1632
1643
  }
1633
1644
  }
@@ -1637,20 +1648,20 @@ const Fe = (e) => {
1637
1648
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ l(
1638
1649
  "img",
1639
1650
  {
1640
- src: (d = (u = (a = (c = t.imageGroups) == null ? void 0 : c[0]) == null ? void 0 : a.images) == null ? void 0 : u[0]) == null ? void 0 : d.link,
1641
- alt: t.name,
1651
+ src: (f = (u = (s = (c = e.imageGroups) == null ? void 0 : c[0]) == null ? void 0 : s.images) == null ? void 0 : u[0]) == null ? void 0 : f.link,
1652
+ alt: e.name,
1642
1653
  className: "rounded-[10px]"
1643
1654
  }
1644
1655
  ) }),
1645
- /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: t.imageGroups.slice(1, 2).map(
1646
- (g) => g.images.slice(1, 2).map((S) => /* @__PURE__ */ l(
1656
+ /* @__PURE__ */ l("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
1657
+ (g) => g.images.slice(1, 2).map((k) => /* @__PURE__ */ l(
1647
1658
  "img",
1648
1659
  {
1649
- src: S.link,
1650
- alt: t.name,
1660
+ src: k.link,
1661
+ alt: e.name,
1651
1662
  className: "rounded-[10px] w-[60px] h-[60px]"
1652
1663
  },
1653
- S.link
1664
+ k.link
1654
1665
  ))
1655
1666
  ) })
1656
1667
  ] }),
@@ -1659,16 +1670,16 @@ const Fe = (e) => {
1659
1670
  /* @__PURE__ */ p("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
1660
1671
  " ",
1661
1672
  "$",
1662
- t.price.toFixed(2)
1673
+ e.price.toFixed(2)
1663
1674
  ] }),
1664
1675
  " ",
1665
1676
  /* @__PURE__ */ p("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
1666
1677
  " ",
1667
1678
  "$",
1668
- (t.price + 5).toFixed(2)
1679
+ (e.price + 5).toFixed(2)
1669
1680
  ] })
1670
1681
  ] }),
1671
- /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: t.discount }) })
1682
+ /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: e.discount }) })
1672
1683
  ] }),
1673
1684
  /* @__PURE__ */ l("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
1674
1685
  /* @__PURE__ */ p("div", { className: "w-full text-left", children: [
@@ -1677,37 +1688,37 @@ const Fe = (e) => {
1677
1688
  "div",
1678
1689
  {
1679
1690
  className: "text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",
1680
- dangerouslySetInnerHTML: { __html: t.short_description || t.longDescription }
1691
+ dangerouslySetInnerHTML: { __html: e.short_description || e.longDescription }
1681
1692
  }
1682
1693
  )
1683
1694
  ] }),
1684
1695
  /* @__PURE__ */ p("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
1685
1696
  /* @__PURE__ */ l("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ p("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
1686
1697
  /* @__PURE__ */ p("div", { className: "text-[#323135] font-bold", children: [
1687
- ((h = t == null ? void 0 : t.rating) == null ? void 0 : h.rate) || 0,
1698
+ ((h = e == null ? void 0 : e.rating) == null ? void 0 : h.rate) || 0,
1688
1699
  " /",
1689
1700
  " ",
1690
1701
  /* @__PURE__ */ l("span", { className: "text-[#68656E]", children: "5" })
1691
1702
  ] }),
1692
1703
  /* @__PURE__ */ l("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
1693
1704
  /* @__PURE__ */ p("div", { className: "text-[#68656E] font-semibold text-sm", children: [
1694
- ((m = t == null ? void 0 : t.rating) == null ? void 0 : m.count) || 0,
1705
+ ((m = e == null ? void 0 : e.rating) == null ? void 0 : m.count) || 0,
1695
1706
  " ratings"
1696
1707
  ] })
1697
1708
  ] }) }),
1698
- /* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g, S) => {
1709
+ /* @__PURE__ */ l("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((g, k) => {
1699
1710
  var _;
1700
1711
  return /* @__PURE__ */ l(
1701
- Lt,
1712
+ Le,
1702
1713
  {
1703
1714
  icon: "mdi:star",
1704
1715
  width: "20",
1705
1716
  height: "20",
1706
1717
  className: `text-yellow-500
1707
- ${((_ = t == null ? void 0 : t.rating) == null ? void 0 : _.rate) > S ? "text-yellow-500" : "text-gray-300"}
1718
+ ${((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.rate) > k ? "text-yellow-500" : "text-gray-300"}
1708
1719
  `
1709
1720
  },
1710
- S
1721
+ k
1711
1722
  );
1712
1723
  }) })
1713
1724
  ] }),
@@ -1721,8 +1732,8 @@ const Fe = (e) => {
1721
1732
  "button",
1722
1733
  {
1723
1734
  className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
1724
- style: { backgroundColor: n.tanyaThemeColor },
1725
- onClick: s,
1735
+ style: { backgroundColor: r.tanyaThemeColor },
1736
+ onClick: a,
1726
1737
  children: "Add to Cart"
1727
1738
  }
1728
1739
  ),
@@ -1730,7 +1741,7 @@ const Fe = (e) => {
1730
1741
  "button",
1731
1742
  {
1732
1743
  className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
1733
- style: { backgroundColor: n.tanyaThemeColor },
1744
+ style: { backgroundColor: r.tanyaThemeColor },
1734
1745
  onClick: i,
1735
1746
  children: "View more"
1736
1747
  }
@@ -1743,157 +1754,157 @@ const Fe = (e) => {
1743
1754
  )
1744
1755
  ] });
1745
1756
  }, So = () => {
1746
- const e = [
1757
+ const t = [
1747
1758
  "Myself",
1748
1759
  "My Child",
1749
1760
  "My Grandchild",
1750
1761
  "Niece/Nephew",
1751
1762
  "My Friends",
1752
1763
  "Others"
1753
- ], t = {
1764
+ ], e = {
1754
1765
  Myself: "himself/herself",
1755
1766
  "My Child": "his/her child",
1756
1767
  "My Grandchild": "his/her grandchild",
1757
1768
  "Niece/Nephew": "his/her niece/nephew",
1758
1769
  "My Friends": "his/her friends",
1759
1770
  Others: "others"
1760
- }, n = Oe(null), r = Oe(null), o = Oe(null), s = Oe(null), [i, c] = M(null), [a, u] = M(
1771
+ }, r = Ot(null), n = Ot(null), o = Ot(null), a = Ot(null), [i, c] = D(null), [s, u] = D(
1761
1772
  !1
1762
- ), [d, h] = M(!1), [m, g] = M(!1), [S, _] = M(!1), [y, v] = M(!1), [B, P] = M(!1), [j, X] = M(""), [k, L] = M(""), z = (f) => ({
1763
- id: f.id,
1764
- title: f.name,
1765
- image: f.image ?? "",
1766
- price: f.price ?? 0
1767
- }), [V, O] = M([]), be = Oe(null), E = Ge((f) => f.store.store), $ = Ge((f) => f.product.product), Pe = () => {
1773
+ ), [f, h] = D(!1), [m, g] = D(!1), [k, _] = D(!1), [w, v] = D(!1), [B, P] = D(!1), [$, Z] = D(""), [S, L] = D(""), H = (d) => ({
1774
+ id: d.id,
1775
+ title: d.name,
1776
+ image: d.image ?? "",
1777
+ price: d.price ?? 0
1778
+ }), [V, O] = D([]), yt = Ot(null), T = Kt((d) => d.store.store), j = Kt((d) => d.product.product), Pt = () => {
1768
1779
  g(!0), setTimeout(() => h(!0), 10);
1769
- }, de = () => {
1780
+ }, pt = () => {
1770
1781
  h(!1), setTimeout(() => g(!1), 300);
1771
1782
  };
1772
- ge(() => {
1773
- a ? Pe() : de();
1774
- }, [a]);
1775
- const tt = (f) => {
1776
- L(t[f]);
1783
+ ct(() => {
1784
+ s ? Pt() : pt();
1785
+ }, [s]);
1786
+ const ee = (d) => {
1787
+ L(e[d]);
1777
1788
  };
1778
- ge(() => {
1779
- be.current && (be.current.scrollTop += 150);
1789
+ ct(() => {
1790
+ yt.current && (yt.current.scrollTop += 150);
1780
1791
  }, [V]);
1781
- let re = null, pe = null;
1782
- const J = async () => {
1783
- if (re && pe && Date.now() < pe)
1784
- return re;
1792
+ let nt = null, ht = null;
1793
+ const Y = async () => {
1794
+ if (nt && ht && Date.now() < ht)
1795
+ return nt;
1785
1796
  try {
1786
- const f = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", T = new URLSearchParams({
1797
+ const d = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", E = new URLSearchParams({
1787
1798
  grant_type: "client_credentials",
1788
1799
  client_id: "4i8rd70sgt961tc4dhskgf08c",
1789
1800
  client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
1790
1801
  scope: "default-m2m-resource-server-8xzfzo/read"
1791
- }), C = await fetch(f, {
1802
+ }), I = await fetch(d, {
1792
1803
  method: "POST",
1793
1804
  headers: {
1794
1805
  "Content-Type": "application/x-www-form-urlencoded"
1795
1806
  },
1796
- body: T
1807
+ body: E
1797
1808
  });
1798
- if (!C.ok)
1809
+ if (!I.ok)
1799
1810
  throw new Error(
1800
- `Token request failed! status: ${C.status}`
1811
+ `Token request failed! status: ${I.status}`
1801
1812
  );
1802
- const F = await C.json();
1803
- re = F.access_token;
1804
- const x = F.expires_in || 3600;
1805
- return pe = Date.now() + (x - 60) * 1e3, re;
1806
- } catch (f) {
1807
- return console.error("Error obtaining JWT token:", f), re = null, pe = null, null;
1813
+ const N = await I.json();
1814
+ nt = N.access_token;
1815
+ const x = N.expires_in || 3600;
1816
+ return ht = Date.now() + (x - 60) * 1e3, nt;
1817
+ } catch (d) {
1818
+ return console.error("Error obtaining JWT token:", d), nt = null, ht = null, null;
1808
1819
  }
1809
- }, nt = async () => {
1810
- const f = await Xe();
1811
- f != null && c(f);
1820
+ }, re = async () => {
1821
+ const d = await Zt();
1822
+ d != null && c(d);
1812
1823
  };
1813
- ge(() => {
1814
- nt(), console.log("scapi environment v1");
1824
+ ct(() => {
1825
+ re(), console.log("scapi environment v1");
1815
1826
  }, []);
1816
- const rt = async () => {
1817
- const f = JSON.parse(
1827
+ const ne = async () => {
1828
+ const d = JSON.parse(
1818
1829
  sessionStorage.getItem("customerData") || "{}"
1819
1830
  ).customerId;
1820
- return (await dr(f || "")).c_interests;
1821
- }, w = async (f, T) => {
1822
- console.log("in secondary flow", Ae);
1823
- const C = await rt();
1824
- if (console.log(C, "interests of customer", Ae), !!C)
1831
+ return (await pn(d || "")).c_interests;
1832
+ }, b = async (d, E) => {
1833
+ console.log("in secondary flow", At);
1834
+ const I = await ne();
1835
+ if (console.log(I, "interests of customer", At), !!I)
1825
1836
  try {
1826
1837
  O(
1827
- (Q) => Q.map(
1828
- (ee, te) => te === Q.length - 1 ? { ...ee, secondaryLoading: !0 } : ee
1838
+ (W) => W.map(
1839
+ (tt, et) => et === W.length - 1 ? { ...tt, secondaryLoading: !0 } : tt
1829
1840
  )
1830
1841
  );
1831
- const F = await J();
1832
- if (!F) throw new Error("Failed to fetch token");
1833
- const x = localStorage.getItem("customerNumber"), I = localStorage.getItem("isLoggedIn"), xe = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1834
- registered: String(I || !1),
1842
+ const N = await Y();
1843
+ if (!N) throw new Error("Failed to fetch token");
1844
+ const x = localStorage.getItem("customerNumber"), C = localStorage.getItem("isLoggedIn"), xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1845
+ registered: String(C || !1),
1835
1846
  userId: String(x || (/* @__PURE__ */ new Date()).getTime())
1836
- }).toString()}`, ve = JSON.stringify({
1847
+ }).toString()}`, vt = JSON.stringify({
1837
1848
  flowId: "Q166PR519W",
1838
1849
  flowAliasId: "HKFUVLWVH2",
1839
1850
  input: {
1840
1851
  loyaltyPoints: "",
1841
- productName: f,
1842
- productPoints: String(T || 0),
1843
- interests: C
1852
+ productName: d,
1853
+ productPoints: String(E || 0),
1854
+ interests: I
1844
1855
  }
1845
- }), G = await fetch(xe, {
1856
+ }), K = await fetch(xt, {
1846
1857
  signal: AbortSignal.timeout(3e4),
1847
1858
  method: "POST",
1848
1859
  headers: {
1849
1860
  "Content-Type": "application/json",
1850
- Authorization: `Bearer ${F}`
1861
+ Authorization: `Bearer ${N}`
1851
1862
  },
1852
- body: ve
1863
+ body: vt
1853
1864
  });
1854
- if (!G.body) throw new Error("Readable stream not supported");
1855
- const Se = G.body.getReader(), ke = new TextDecoder();
1856
- let W = "";
1865
+ if (!K.body) throw new Error("Readable stream not supported");
1866
+ const kt = K.body.getReader(), St = new TextDecoder();
1867
+ let G = "";
1857
1868
  for (; ; ) {
1858
- const { done: Q, value: ee } = await Se.read();
1859
- if (Q) break;
1860
- W += ke.decode(ee, { stream: !0 });
1861
- const te = W.split(`
1869
+ const { done: W, value: tt } = await kt.read();
1870
+ if (W) break;
1871
+ G += St.decode(tt, { stream: !0 });
1872
+ const et = G.split(`
1862
1873
  `);
1863
- W = te.pop() || "";
1864
- for (const se of te)
1865
- if (se.startsWith("data:")) {
1866
- const b = se.slice(5).trim();
1874
+ G = et.pop() || "";
1875
+ for (const at of et)
1876
+ if (at.startsWith("data:")) {
1877
+ const y = at.slice(5).trim();
1867
1878
  try {
1868
- const Y = JSON.parse(b);
1869
- Y.index === 0 && O(
1879
+ const Q = JSON.parse(y);
1880
+ Q.index === 0 && O(
1870
1881
  (A) => A.map(
1871
- (H, ie) => ie === A.length - 1 ? {
1872
- ...H,
1873
- secondaryResponse: Y.data,
1882
+ (q, it) => it === A.length - 1 ? {
1883
+ ...q,
1884
+ secondaryResponse: Q.data,
1874
1885
  secondaryLoading: !1
1875
- } : H
1886
+ } : q
1876
1887
  )
1877
1888
  );
1878
- } catch (Y) {
1889
+ } catch (Q) {
1879
1890
  O(
1880
1891
  (A) => A.map(
1881
- (H, ie) => ie === A.length - 1 ? { ...H, secondaryLoading: !1 } : H
1892
+ (q, it) => it === A.length - 1 ? { ...q, secondaryLoading: !1 } : q
1882
1893
  )
1883
- ), console.error("Secondary flow JSON parse error:", Y);
1894
+ ), console.error("Secondary flow JSON parse error:", Q);
1884
1895
  }
1885
1896
  }
1886
1897
  }
1887
- } catch (F) {
1888
- console.error("Secondary flow error:", F);
1898
+ } catch (N) {
1899
+ console.error("Secondary flow error:", N);
1889
1900
  }
1890
- }, K = async (f) => {
1891
- const T = f || j.trim();
1892
- if (T) {
1893
- v(!0), X(""), n.current = null, r.current = null, o.current = null, s.current = null, O((C) => [
1894
- ...C,
1901
+ }, J = async (d) => {
1902
+ const E = d || $.trim();
1903
+ if (E) {
1904
+ v(!0), Z(""), r.current = null, n.current = null, o.current = null, a.current = null, O((I) => [
1905
+ ...I,
1895
1906
  {
1896
- query: T,
1907
+ query: E,
1897
1908
  response: "Thinking for what suits you best...",
1898
1909
  potentialQuestions: "",
1899
1910
  products: [],
@@ -1901,52 +1912,52 @@ const Fe = (e) => {
1901
1912
  }
1902
1913
  ]);
1903
1914
  try {
1904
- const C = k, F = localStorage.getItem("customerNumber"), x = localStorage.getItem("isLoggedIn"), I = await J();
1905
- if (!I)
1915
+ const I = S, N = localStorage.getItem("customerNumber"), x = localStorage.getItem("isLoggedIn"), C = await Y();
1916
+ if (!C)
1906
1917
  throw new Error("Failed to obtain access token");
1907
- const xe = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1918
+ const xt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
1908
1919
  registered: String(x || !1),
1909
- userId: String(F || (/* @__PURE__ */ new Date()).getTime())
1910
- }).toString()}`, ve = JSON.stringify({
1920
+ userId: String(N || (/* @__PURE__ */ new Date()).getTime())
1921
+ }).toString()}`, vt = JSON.stringify({
1911
1922
  flowId: "MMHQKYI1NE",
1912
1923
  flowAliasId: "SZF9ZK1ATE",
1913
1924
  input: {
1914
- userPrompt: T,
1915
- whom: C
1925
+ userPrompt: E,
1926
+ whom: I
1916
1927
  }
1917
- }), G = await fetch(xe, {
1928
+ }), K = await fetch(xt, {
1918
1929
  signal: AbortSignal.timeout(3e4),
1919
1930
  method: "POST",
1920
1931
  headers: {
1921
1932
  "Content-Type": "application/json",
1922
- Authorization: `Bearer ${I}`
1933
+ Authorization: `Bearer ${C}`
1923
1934
  },
1924
- body: ve
1935
+ body: vt
1925
1936
  });
1926
- if (!G.ok)
1927
- throw new Error(`HTTP error! status: ${G.status}`);
1928
- if (!G.body) throw new Error("Readable stream not supported");
1929
- const Se = G.body.getReader(), ke = new TextDecoder();
1930
- let W = "", Q = "";
1937
+ if (!K.ok)
1938
+ throw new Error(`HTTP error! status: ${K.status}`);
1939
+ if (!K.body) throw new Error("Readable stream not supported");
1940
+ const kt = K.body.getReader(), St = new TextDecoder();
1941
+ let G = "", W = "";
1931
1942
  for (; ; ) {
1932
1943
  P(!0);
1933
- const { done: ee, value: te } = await Se.read();
1934
- if (ee) break;
1935
- W += ke.decode(te, { stream: !0 });
1936
- const se = W.split(`
1944
+ const { done: tt, value: et } = await kt.read();
1945
+ if (tt) break;
1946
+ G += St.decode(et, { stream: !0 });
1947
+ const at = G.split(`
1937
1948
  `);
1938
- W = se.pop() || "";
1939
- for (const b of se)
1940
- if (b.startsWith("data:")) {
1941
- const Y = b.slice(5).trim();
1949
+ G = at.pop() || "";
1950
+ for (const y of at)
1951
+ if (y.startsWith("data:")) {
1952
+ const Q = y.slice(5).trim();
1942
1953
  try {
1943
- const A = JSON.parse(Y);
1944
- A.index == 1 && (Q = A.data), O(
1945
- (H) => H.map(
1946
- (ie, Be) => Be === H.length - 1 ? {
1947
- ...ie,
1954
+ const A = JSON.parse(Q);
1955
+ A.index == 1 && (W = A.data), O(
1956
+ (q) => q.map(
1957
+ (it, Bt) => Bt === q.length - 1 ? {
1958
+ ...it,
1948
1959
  [A.index == 0 ? "response" : A.index == 1 ? "keywords" : A.index == 2 ? "potentialQuestions" : "end"]: A.data
1949
- } : ie
1960
+ } : it
1950
1961
  )
1951
1962
  );
1952
1963
  } catch (A) {
@@ -1954,189 +1965,189 @@ const Fe = (e) => {
1954
1965
  }
1955
1966
  }
1956
1967
  }
1957
- oe(we(Q));
1958
- } catch (C) {
1959
- console.error("Error sending message to Tanya:", C);
1968
+ ot(bt(W));
1969
+ } catch (I) {
1970
+ console.error("Error sending message to Tanya:", I);
1960
1971
  } finally {
1961
1972
  v(!1);
1962
1973
  }
1963
1974
  }
1964
- }, we = (f) => {
1965
- const T = f.match(
1975
+ }, bt = (d) => {
1976
+ const E = d.match(
1966
1977
  /top five relevant product or category names are: (.*)/i
1967
- ), x = (T ? T[1] : f).split(", ").map((R) => R.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
1978
+ ), x = (E ? E[1] : d).split(", ").map((R) => R.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
1968
1979
  return [...new Set(x)].filter(Boolean).join(",");
1969
- }, oe = async (f) => {
1970
- if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof f == "string") {
1971
- console.log(f, "keywords");
1972
- const T = f.split(",");
1973
- for (const C of T) {
1974
- const F = await Dt(
1975
- C,
1980
+ }, ot = async (d) => {
1981
+ if (console.log(i == null ? void 0 : i.access_token, "access_token"), typeof d == "string") {
1982
+ console.log(d, "keywords");
1983
+ const E = d.split(",");
1984
+ for (const I of E) {
1985
+ const N = await ze(
1986
+ I,
1976
1987
  i == null ? void 0 : i.access_token
1977
1988
  );
1978
- if (P(!1), (F == null ? void 0 : F.length) > 0 && (O(
1989
+ if (P(!1), (N == null ? void 0 : N.length) > 0 && (O(
1979
1990
  (x) => x.map(
1980
- (I, R) => R === x.length - 1 ? {
1981
- ...I,
1991
+ (C, R) => R === x.length - 1 ? {
1992
+ ...C,
1982
1993
  products: [
1983
- ...I.products || [],
1984
- { keyword: C, items: F, loading: !1 }
1994
+ ...C.products || [],
1995
+ { keyword: I, items: N, loading: !1 }
1985
1996
  ]
1986
- } : I
1997
+ } : C
1987
1998
  )
1988
- ), !n.current || r.current == null)) {
1989
- const x = F[0];
1990
- n.current = String((x == null ? void 0 : x.product_name) ?? ""), o.current = x.image.link, r.current = x.product_id;
1991
- const I = typeof (x == null ? void 0 : x.price) == "number" ? x.price : void 0;
1992
- s.current = typeof I == "number" && Number.isFinite(I) ? I : null;
1999
+ ), !r.current || n.current == null)) {
2000
+ const x = N[0];
2001
+ r.current = String((x == null ? void 0 : x.product_name) ?? ""), o.current = x.image.link, n.current = x.product_id;
2002
+ const C = typeof (x == null ? void 0 : x.price) == "number" ? x.price : void 0;
2003
+ a.current = typeof C == "number" && Number.isFinite(C) ? C : null;
1993
2004
  }
1994
2005
  }
1995
2006
  } else
1996
- for (const T of f) {
1997
- const C = await Dt(
1998
- T,
2007
+ for (const E of d) {
2008
+ const I = await ze(
2009
+ E,
1999
2010
  i == null ? void 0 : i.access_token
2000
2011
  );
2001
- P(!1), (C == null ? void 0 : C.length) > 0 && O(
2002
- (F) => F.map(
2003
- (x, I) => I === F.length - 1 ? {
2012
+ P(!1), (I == null ? void 0 : I.length) > 0 && O(
2013
+ (N) => N.map(
2014
+ (x, C) => C === N.length - 1 ? {
2004
2015
  ...x,
2005
2016
  products: [
2006
2017
  ...x.products || [],
2007
- { keyword: T, items: C, loading: !1 }
2018
+ { keyword: E, items: I, loading: !1 }
2008
2019
  ]
2009
2020
  } : x
2010
2021
  )
2011
2022
  );
2012
2023
  }
2013
- if (n.current) {
2024
+ if (r.current) {
2014
2025
  O(
2015
- (C) => C.map(
2016
- (F, x) => x === C.length - 1 ? {
2017
- ...F,
2026
+ (I) => I.map(
2027
+ (N, x) => x === I.length - 1 ? {
2028
+ ...N,
2018
2029
  productSnapshot: {
2019
- id: r.current,
2020
- name: n.current,
2030
+ id: n.current,
2031
+ name: r.current,
2021
2032
  image: o.current,
2022
- price: s.current ?? null,
2033
+ price: a.current ?? null,
2023
2034
  points: 0,
2024
2035
  quantity: 1
2025
2036
  }
2026
- } : F
2037
+ } : N
2027
2038
  )
2028
2039
  );
2029
- const T = JSON.parse(
2040
+ const E = JSON.parse(
2030
2041
  sessionStorage.getItem("customerData") || "{}"
2031
2042
  );
2032
- (T == null ? void 0 : T.isGuest) == !1 ? (console.log("running secondary flow", Ae), w(n.current, 0)) : console.log("not running secondary flow", Ae);
2043
+ (E == null ? void 0 : E.isGuest) == !1 ? (console.log("running secondary flow", At), b(r.current, 0)) : console.log("not running secondary flow", At);
2033
2044
  }
2034
2045
  P(!1);
2035
- }, Gn = async (f, T) => {
2036
- var C, F, x, I, R, xe, ve, G, Se, ke, W, Q, ee, te, se;
2046
+ }, Jr = async (d, E) => {
2047
+ var I, N, x, C, R, xt, vt, K, kt, St, G, W, tt, et, at;
2037
2048
  _(!0);
2038
2049
  try {
2039
- const b = await kn(f.id);
2040
- if (!((F = (C = b == null ? void 0 : b.variants) == null ? void 0 : C[0]) != null && F.product_id || (I = (x = b == null ? void 0 : b.variants) == null ? void 0 : x[0]) != null && I.productId) && !(b.type.item || b.type.bundle)) {
2041
- _(!1), Z.error("Variants not found", {
2050
+ const y = await kr(d.id);
2051
+ if (!((N = (I = y == null ? void 0 : y.variants) == null ? void 0 : I[0]) != null && N.product_id || (C = (x = y == null ? void 0 : y.variants) == null ? void 0 : x[0]) != null && C.productId) && !(y.type.item || y.type.bundle)) {
2052
+ _(!1), X.error("Variants not found", {
2042
2053
  position: "bottom-right",
2043
2054
  autoClose: 1e3
2044
2055
  }), console.error("No product variant found");
2045
2056
  return;
2046
2057
  }
2047
- const Y = [
2058
+ const Q = [
2048
2059
  {
2049
- product_id: ((R = b.variants) == null ? void 0 : R[0].product_id) || ((xe = b.variants) == null ? void 0 : xe[0].productId) || (b == null ? void 0 : b.id),
2050
- quantity: T
2060
+ product_id: ((R = y.variants) == null ? void 0 : R[0].product_id) || ((xt = y.variants) == null ? void 0 : xt[0].productId) || (y == null ? void 0 : y.id),
2061
+ quantity: E
2051
2062
  }
2052
2063
  ];
2053
- console.log(Y, "product data", "app version", Ae);
2064
+ console.log(Q, "product data", "app version", At);
2054
2065
  const A = JSON.parse(
2055
2066
  sessionStorage.getItem("customerData") || "{}"
2056
- ), H = A == null ? void 0 : A.basketId, ie = !1, Be = localStorage.getItem(qe), jt = Date.now();
2057
- if (!ie || !Be || jt >= parseInt(Be)) {
2058
- const Wn = await vn();
2059
- let { customer_token: he } = await Sn(
2060
- Wn
2067
+ ), q = A == null ? void 0 : A.basketId, it = !1, Bt = localStorage.getItem(Ut), $e = Date.now();
2068
+ if (!it || !Bt || $e >= parseInt(Bt)) {
2069
+ const Kr = await xr();
2070
+ let { customer_token: mt } = await vr(
2071
+ Kr
2061
2072
  );
2062
- if (he = "Bearer " + i.access_token, !he) {
2073
+ if (mt = "Bearer " + i.access_token, !mt) {
2063
2074
  console.error("Failed to get customer_token");
2064
2075
  return;
2065
2076
  }
2066
- const Qn = jt + 300 * 1e3;
2067
- if (Ye(he), localStorage.setItem(qe, Qn.toString()), H) {
2068
- const At = await Mn({
2069
- basketId: H,
2070
- customer_token: he
2077
+ const Gr = $e + 300 * 1e3;
2078
+ if (Qt(mt), localStorage.setItem(Ut, Gr.toString()), q) {
2079
+ const Ae = await zr({
2080
+ basketId: q,
2081
+ customer_token: mt
2071
2082
  });
2072
- if (At.status === 200 && At) {
2073
- const ot = await Qe(
2074
- H,
2075
- Y,
2076
- he
2083
+ if (Ae.status === 200 && Ae) {
2084
+ const oe = await Wt(
2085
+ q,
2086
+ Q,
2087
+ mt
2077
2088
  );
2078
- ((ve = ot == null ? void 0 : ot.product_items) == null ? void 0 : ve.length) > 0 && (Z.success("Added to cart", {
2089
+ ((vt = oe == null ? void 0 : oe.product_items) == null ? void 0 : vt.length) > 0 && (X.success("Added to cart", {
2079
2090
  position: "bottom-right",
2080
2091
  autoClose: 3e3,
2081
2092
  hideProgressBar: !1,
2082
2093
  closeOnClick: !0,
2083
2094
  pauseOnHover: !0,
2084
2095
  draggable: !0
2085
- }), Ne(H), _(!1));
2096
+ }), Ft(q), _(!1));
2086
2097
  return;
2087
2098
  }
2088
2099
  }
2089
- const Yn = {
2100
+ const Wr = {
2090
2101
  productItems: [
2091
2102
  {
2092
- productId: ((G = b.variants) == null ? void 0 : G[0].product_id) || ((Se = b.variants) == null ? void 0 : Se[0].productId) || (b == null ? void 0 : b.id),
2103
+ productId: ((K = y.variants) == null ? void 0 : K[0].product_id) || ((kt = y.variants) == null ? void 0 : kt[0].productId) || (y == null ? void 0 : y.id),
2093
2104
  quantity: 1
2094
2105
  }
2095
2106
  ]
2096
- }, N = await Dn(he, Yn);
2107
+ }, F = await Lr(mt, Wr);
2097
2108
  if (console.log(
2098
- N,
2099
- N == null ? void 0 : N.basket_id,
2100
- N == null ? void 0 : N.basketId,
2109
+ F,
2110
+ F == null ? void 0 : F.basket_id,
2111
+ F == null ? void 0 : F.basketId,
2101
2112
  "the basket response"
2102
- ), !(N != null && N.basket_id || !(N != null && N.basketId))) {
2113
+ ), !(F != null && F.basket_id || !(F != null && F.basketId))) {
2103
2114
  _(!1), console.error("Failed to create basket");
2104
2115
  return;
2105
2116
  }
2106
- Fe(
2107
- (N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId)
2117
+ Nt(
2118
+ (F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
2108
2119
  );
2109
- const Ie = await Qe(
2110
- (N == null ? void 0 : N.basket_id) || (N == null ? void 0 : N.basketId),
2111
- Y,
2112
- he
2120
+ const Ct = await Wt(
2121
+ (F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId),
2122
+ Q,
2123
+ mt
2113
2124
  );
2114
- (((ke = Ie == null ? void 0 : Ie.product_items) == null ? void 0 : ke.length) > 0 || ((W = Ie == null ? void 0 : Ie.productItems) == null ? void 0 : W.length) > 0) && Z.success("Added to cart", {
2125
+ (((St = Ct == null ? void 0 : Ct.product_items) == null ? void 0 : St.length) > 0 || ((G = Ct == null ? void 0 : Ct.productItems) == null ? void 0 : G.length) > 0) && X.success("Added to cart", {
2115
2126
  position: "bottom-right",
2116
2127
  autoClose: 3e3,
2117
2128
  hideProgressBar: !1,
2118
2129
  closeOnClick: !0,
2119
2130
  pauseOnHover: !0,
2120
2131
  draggable: !0
2121
- }), Ne(N.basket_id || (N == null ? void 0 : N.basketId));
2132
+ }), Ft(F.basket_id || (F == null ? void 0 : F.basketId));
2122
2133
  }
2123
- } catch (b) {
2124
- _(!1), console.error("Error adding to cart:", b), Z.error("Failed to add product to cart", {
2134
+ } catch (y) {
2135
+ _(!1), console.error("Error adding to cart:", y), X.error("Failed to add product to cart", {
2125
2136
  position: "bottom-right",
2126
2137
  autoClose: 3e3
2127
- }), ((Q = b == null ? void 0 : b.response) == null ? void 0 : Q.status) === 404 || // Basket not found
2128
- ((ee = b == null ? void 0 : b.response) == null ? void 0 : ee.status) === 401 ? (((te = b == null ? void 0 : b.response) == null ? void 0 : te.status) === 404 && Fe(null), ((se = b == null ? void 0 : b.response) == null ? void 0 : se.status) === 401 && (Fe(null), Ye(null))) : (console.error("Failed to add product to basket:", b.message), Z.error("Failed to add product to cart", {
2138
+ }), ((W = y == null ? void 0 : y.response) == null ? void 0 : W.status) === 404 || // Basket not found
2139
+ ((tt = y == null ? void 0 : y.response) == null ? void 0 : tt.status) === 401 ? (((et = y == null ? void 0 : y.response) == null ? void 0 : et.status) === 404 && Nt(null), ((at = y == null ? void 0 : y.response) == null ? void 0 : at.status) === 401 && (Nt(null), Qt(null))) : (console.error("Failed to add product to basket:", y.message), X.error("Failed to add product to cart", {
2129
2140
  position: "bottom-right",
2130
2141
  autoClose: 3e3
2131
2142
  }));
2132
2143
  } finally {
2133
- Ne();
2144
+ Ft();
2134
2145
  }
2135
2146
  _(!1);
2136
2147
  };
2137
- return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(ur, { open: a, onOpenChange: u, children: [
2148
+ return /* @__PURE__ */ l("div", { className: "relative flex justify-center", children: /* @__PURE__ */ p(dn, { open: s, onOpenChange: u, children: [
2138
2149
  /* @__PURE__ */ l(
2139
- fr,
2150
+ fn,
2140
2151
  {
2141
2152
  onClick: () => u(!0),
2142
2153
  style: {
@@ -2198,7 +2209,7 @@ const Fe = (e) => {
2198
2209
  ) })
2199
2210
  }
2200
2211
  ),
2201
- m && /* @__PURE__ */ p(dt, { children: [
2212
+ m && /* @__PURE__ */ p(pe, { children: [
2202
2213
  /* @__PURE__ */ l(
2203
2214
  "div",
2204
2215
  {
@@ -2214,9 +2225,9 @@ const Fe = (e) => {
2214
2225
  top-0 right-0
2215
2226
  transition-transform duration-300 ease-in-out
2216
2227
  lg:transform
2217
- ${d ? "lg:translate-x-0" : "lg:translate-x-full"}
2228
+ ${f ? "lg:translate-x-0" : "lg:translate-x-full"}
2218
2229
  // For mobile: animate from bottom
2219
- ${d ? "translate-y-0" : "translate-y-full"}
2230
+ ${f ? "translate-y-0" : "translate-y-full"}
2220
2231
  lg:translate-y-0
2221
2232
  `,
2222
2233
  style: {
@@ -2233,7 +2244,7 @@ const Fe = (e) => {
2233
2244
  {
2234
2245
  style: {
2235
2246
  display: "flex",
2236
- color: E.tanyaThemeContrastColor,
2247
+ color: T.tanyaThemeContrastColor,
2237
2248
  alignItems: "center",
2238
2249
  gap: "0.5rem"
2239
2250
  },
@@ -2346,46 +2357,46 @@ const Fe = (e) => {
2346
2357
  /* @__PURE__ */ p(
2347
2358
  "div",
2348
2359
  {
2349
- className: `flex flex-col h-full ${$ ? "lg:w-2/3 w-full" : "w-full"}`,
2360
+ className: `flex flex-col h-full ${j ? "lg:w-2/3 w-full" : "w-full"}`,
2350
2361
  children: [
2351
2362
  /* @__PURE__ */ p(
2352
2363
  "div",
2353
2364
  {
2354
- ref: be,
2365
+ ref: yt,
2355
2366
  className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
2356
2367
  children: [
2357
- (E == null ? void 0 : E.whomRequired) && /* @__PURE__ */ p(
2368
+ (T == null ? void 0 : T.whomRequired) && /* @__PURE__ */ p(
2358
2369
  "div",
2359
2370
  {
2360
2371
  className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
2361
2372
  children: [
2362
2373
  /* @__PURE__ */ l("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ l("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
2363
- /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children: e.map((f) => /* @__PURE__ */ l(
2374
+ /* @__PURE__ */ l("div", { className: "flex flex-wrap gap-2 mt-2", children: t.map((d) => /* @__PURE__ */ l(
2364
2375
  "button",
2365
2376
  {
2366
- onClick: () => tt(f),
2377
+ onClick: () => ee(d),
2367
2378
  className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
2368
2379
  style: {
2369
- backgroundColor: k === t[f] ? "#FFFFFF" : "#F3F3F3",
2370
- borderColor: k === t[f] ? "#BBB3DD" : ""
2380
+ backgroundColor: S === e[d] ? "#FFFFFF" : "#F3F3F3",
2381
+ borderColor: S === e[d] ? "#BBB3DD" : ""
2371
2382
  },
2372
- children: f
2383
+ children: d
2373
2384
  },
2374
- f
2385
+ d
2375
2386
  )) })
2376
2387
  ]
2377
2388
  }
2378
2389
  ),
2379
- V.map((f, T) => {
2380
- var C, F;
2390
+ V.map((d, E) => {
2391
+ var I, N;
2381
2392
  return /* @__PURE__ */ p("div", { children: [
2382
- /* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: f.query }) }),
2383
- f.response && f.response.includes("Thinking") ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
2393
+ /* @__PURE__ */ l("div", { className: "flex justify-end", children: /* @__PURE__ */ l("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: d.query }) }),
2394
+ d.response && d.response.includes("Thinking") ? /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
2384
2395
  "div",
2385
2396
  {
2386
2397
  className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
2387
2398
  dangerouslySetInnerHTML: {
2388
- __html: st(f.response)
2399
+ __html: ae(d.response)
2389
2400
  }
2390
2401
  }
2391
2402
  ) }) : /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(
@@ -2393,41 +2404,41 @@ const Fe = (e) => {
2393
2404
  {
2394
2405
  className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
2395
2406
  dangerouslySetInnerHTML: {
2396
- __html: st(f.response)
2407
+ __html: ae(d.response)
2397
2408
  }
2398
2409
  }
2399
2410
  ) }),
2400
- B && !f.response.includes("Thinking") && ((C = f.products) == null ? void 0 : C.length) == 0 && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
2401
- (f == null ? void 0 : f.products) && ((F = f == null ? void 0 : f.products) == null ? void 0 : F.length) > 0 && /* @__PURE__ */ l(
2402
- wo,
2411
+ B && !d.response.includes("Thinking") && ((I = d.products) == null ? void 0 : I.length) == 0 && /* @__PURE__ */ l("div", { children: /* @__PURE__ */ l("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
2412
+ (d == null ? void 0 : d.products) && ((N = d == null ? void 0 : d.products) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ l(
2413
+ xo,
2403
2414
  {
2404
- chat: f.products,
2405
- storeDetails: E
2415
+ chat: d.products,
2416
+ storeDetails: T
2406
2417
  }
2407
2418
  ),
2408
- f.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
2419
+ d.potentialQuestions.length > 0 && /* @__PURE__ */ p("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
2409
2420
  /* @__PURE__ */ l(
2410
2421
  "p",
2411
2422
  {
2412
2423
  className: "font-nunitoSans font-bold text-sm text-[#494949]",
2413
- style: { color: E.themeDarkColor },
2424
+ style: { color: T.themeDarkColor },
2414
2425
  children: "Why not explore these inquiries..."
2415
2426
  }
2416
2427
  ),
2417
- f.potentialQuestions.split(",").map((x, I) => /* @__PURE__ */ l(
2428
+ d.potentialQuestions.split(",").map((x, C) => /* @__PURE__ */ l(
2418
2429
  "button",
2419
2430
  {
2420
- className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${E.themeDarkColor} m-1 rounded-xl px-2 py-1`,
2421
- onClick: () => K(x),
2431
+ className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${T.themeDarkColor} m-1 rounded-xl px-2 py-1`,
2432
+ onClick: () => J(x),
2422
2433
  style: {
2423
- backgroundColor: E.tanyaThemeColorLight
2434
+ backgroundColor: T.tanyaThemeColorLight
2424
2435
  },
2425
2436
  children: x
2426
2437
  },
2427
- I
2438
+ C
2428
2439
  ))
2429
2440
  ] }),
2430
- f.secondaryLoading && /* @__PURE__ */ l("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
2441
+ d.secondaryLoading && /* @__PURE__ */ l("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ p(
2431
2442
  "div",
2432
2443
  {
2433
2444
  className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
@@ -2445,7 +2456,7 @@ const Fe = (e) => {
2445
2456
  "p",
2446
2457
  {
2447
2458
  className: "font-semibold tanya-pulse",
2448
- style: { color: E.themeDarkColor },
2459
+ style: { color: T.themeDarkColor },
2449
2460
  children: "I’ve found a special surprise crafted just for you… hang on a sec!"
2450
2461
  }
2451
2462
  ),
@@ -2453,35 +2464,35 @@ const Fe = (e) => {
2453
2464
  "p",
2454
2465
  {
2455
2466
  className: "tanya-dots mt-1",
2456
- style: { color: E.themeDarkColor },
2467
+ style: { color: T.themeDarkColor },
2457
2468
  children: "• • •"
2458
2469
  }
2459
2470
  )
2460
2471
  ]
2461
2472
  }
2462
2473
  ) }),
2463
- f.secondaryResponse && /* @__PURE__ */ l(dt, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
2474
+ d.secondaryResponse && /* @__PURE__ */ l(pe, { children: /* @__PURE__ */ p("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
2464
2475
  /* @__PURE__ */ l(
2465
2476
  "div",
2466
2477
  {
2467
2478
  className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
2468
2479
  style: {
2469
- backgroundColor: E.tanyaThemeColorLight
2480
+ backgroundColor: T.tanyaThemeColorLight
2470
2481
  },
2471
2482
  dangerouslySetInnerHTML: {
2472
- __html: st(
2473
- f.secondaryResponse
2483
+ __html: ae(
2484
+ d.secondaryResponse
2474
2485
  )
2475
2486
  }
2476
2487
  }
2477
2488
  ),
2478
- f.productSnapshot && // chat.productSnapshot.points > 0 &&
2489
+ d.productSnapshot && // chat.productSnapshot.points > 0 &&
2479
2490
  /* @__PURE__ */ l("div", { className: "mt-4 w-full", children: /* @__PURE__ */ p(
2480
2491
  "div",
2481
2492
  {
2482
2493
  className: "flex gap-4 items-stretch rounded-2xl p-4",
2483
2494
  style: {
2484
- backgroundColor: E.tanyaThemeColorLight
2495
+ backgroundColor: T.tanyaThemeColorLight
2485
2496
  },
2486
2497
  children: [
2487
2498
  /* @__PURE__ */ l(
@@ -2493,11 +2504,11 @@ const Fe = (e) => {
2493
2504
  height: 112,
2494
2505
  borderColor: "#eee"
2495
2506
  },
2496
- children: f.productSnapshot.image ? /* @__PURE__ */ l(
2507
+ children: d.productSnapshot.image ? /* @__PURE__ */ l(
2497
2508
  "img",
2498
2509
  {
2499
- src: f.productSnapshot.image,
2500
- alt: f.productSnapshot.name,
2510
+ src: d.productSnapshot.image,
2511
+ alt: d.productSnapshot.name,
2501
2512
  className: "w-full h-full object-cover"
2502
2513
  }
2503
2514
  ) : /* @__PURE__ */ l("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
@@ -2505,18 +2516,18 @@ const Fe = (e) => {
2505
2516
  ),
2506
2517
  /* @__PURE__ */ p("div", { className: "flex flex-col flex-1 justify-between", children: [
2507
2518
  /* @__PURE__ */ p("div", { children: [
2508
- /* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children: f.productSnapshot.name }),
2509
- /* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children: f.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
2519
+ /* @__PURE__ */ l("p", { className: "font-semibold text-[15px] leading-snug", children: d.productSnapshot.name }),
2520
+ /* @__PURE__ */ l("p", { className: "mt-1 text-[14px] font-medium", children: d.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
2510
2521
  style: "currency",
2511
- currency: (E == null ? void 0 : E.currency) || "USD"
2522
+ currency: (T == null ? void 0 : T.currency) || "USD"
2512
2523
  }).format(
2513
- f.productSnapshot.price
2524
+ d.productSnapshot.price
2514
2525
  ) : "" }),
2515
- f.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
2526
+ d.productSnapshot.points > 0 && /* @__PURE__ */ p("p", { className: "mt-1 text-xs opacity-80", children: [
2516
2527
  "You will earn",
2517
2528
  " ",
2518
2529
  /* @__PURE__ */ p("strong", { children: [
2519
- f.productSnapshot.points,
2530
+ d.productSnapshot.points,
2520
2531
  " ",
2521
2532
  "points"
2522
2533
  ] })
@@ -2530,44 +2541,44 @@ const Fe = (e) => {
2530
2541
  className: "px-3 py-1 text-sm",
2531
2542
  onClick: () => O(
2532
2543
  (x) => x.map(
2533
- (I, R) => R === T && I.productSnapshot ? {
2534
- ...I,
2544
+ (C, R) => R === E && C.productSnapshot ? {
2545
+ ...C,
2535
2546
  productSnapshot: {
2536
- ...I.productSnapshot,
2547
+ ...C.productSnapshot,
2537
2548
  quantity: Math.max(
2538
2549
  1,
2539
- I.productSnapshot.quantity - 1
2550
+ C.productSnapshot.quantity - 1
2540
2551
  )
2541
2552
  }
2542
- } : I
2553
+ } : C
2543
2554
  )
2544
2555
  ),
2545
2556
  style: {
2546
2557
  background: "transparent",
2547
- color: E.themeDarkColor
2558
+ color: T.themeDarkColor
2548
2559
  },
2549
2560
  children: "−"
2550
2561
  }
2551
2562
  ),
2552
- /* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children: f.productSnapshot.quantity }),
2563
+ /* @__PURE__ */ l("div", { className: "px-3 py-1 text-sm select-none", children: d.productSnapshot.quantity }),
2553
2564
  /* @__PURE__ */ l(
2554
2565
  "button",
2555
2566
  {
2556
2567
  className: "px-3 py-1 text-sm",
2557
2568
  onClick: () => O(
2558
2569
  (x) => x.map(
2559
- (I, R) => R === T && I.productSnapshot ? {
2560
- ...I,
2570
+ (C, R) => R === E && C.productSnapshot ? {
2571
+ ...C,
2561
2572
  productSnapshot: {
2562
- ...I.productSnapshot,
2563
- quantity: I.productSnapshot.quantity + 1
2573
+ ...C.productSnapshot,
2574
+ quantity: C.productSnapshot.quantity + 1
2564
2575
  }
2565
- } : I
2576
+ } : C
2566
2577
  )
2567
2578
  ),
2568
2579
  style: {
2569
2580
  background: "transparent",
2570
- color: E.themeDarkColor
2581
+ color: T.themeDarkColor
2571
2582
  },
2572
2583
  children: "+"
2573
2584
  }
@@ -2577,21 +2588,21 @@ const Fe = (e) => {
2577
2588
  "button",
2578
2589
  {
2579
2590
  onClick: () => {
2580
- Gn(
2581
- z(
2582
- f.productSnapshot
2591
+ Jr(
2592
+ H(
2593
+ d.productSnapshot
2583
2594
  ),
2584
- f.productSnapshot.quantity
2595
+ d.productSnapshot.quantity
2585
2596
  );
2586
2597
  },
2587
- disabled: S,
2598
+ disabled: k,
2588
2599
  className: "px-4 py-2 rounded-full font-medium",
2589
2600
  style: {
2590
- background: E.tanyaThemeColor,
2591
- color: (E == null ? void 0 : E.tanyaThemeContrastColor) || "#fff",
2592
- opacity: S ? 0.8 : 1
2601
+ background: T.tanyaThemeColor,
2602
+ color: (T == null ? void 0 : T.tanyaThemeContrastColor) || "#fff",
2603
+ opacity: k ? 0.8 : 1
2593
2604
  },
2594
- children: S ? "Adding..." : "Add to cart"
2605
+ children: k ? "Adding..." : "Add to cart"
2595
2606
  }
2596
2607
  )
2597
2608
  ] })
@@ -2601,7 +2612,7 @@ const Fe = (e) => {
2601
2612
  ) })
2602
2613
  ] }) }),
2603
2614
  /* @__PURE__ */ l("div", { className: "mb-20" })
2604
- ] }, T);
2615
+ ] }, E);
2605
2616
  })
2606
2617
  ]
2607
2618
  }
@@ -2619,11 +2630,11 @@ const Fe = (e) => {
2619
2630
  {
2620
2631
  className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
2621
2632
  placeholder: "How can I help you...",
2622
- value: j,
2633
+ value: $,
2623
2634
  autoFocus: !0,
2624
- onChange: (f) => X(f.target.value),
2625
- onKeyDown: (f) => {
2626
- f.key === "Enter" && !y && K();
2635
+ onChange: (d) => Z(d.target.value),
2636
+ onKeyDown: (d) => {
2637
+ d.key === "Enter" && !w && J();
2627
2638
  }
2628
2639
  }
2629
2640
  ),
@@ -2631,16 +2642,16 @@ const Fe = (e) => {
2631
2642
  "button",
2632
2643
  {
2633
2644
  type: "submit",
2634
- disabled: y,
2645
+ disabled: w,
2635
2646
  className: "p-3",
2636
- onClick: () => K(),
2637
- children: y ? /* @__PURE__ */ l(
2647
+ onClick: () => J(),
2648
+ children: w ? /* @__PURE__ */ l(
2638
2649
  "div",
2639
2650
  {
2640
2651
  className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
2641
2652
  style: {
2642
2653
  borderBottom: "2px solid",
2643
- color: E.tanyaThemeColor
2654
+ color: T.tanyaThemeColor
2644
2655
  }
2645
2656
  }
2646
2657
  ) : /* @__PURE__ */ l(
@@ -2668,7 +2679,7 @@ const Fe = (e) => {
2668
2679
  ]
2669
2680
  }
2670
2681
  ),
2671
- /* @__PURE__ */ l(vo, {})
2682
+ /* @__PURE__ */ l(ko, {})
2672
2683
  ] })
2673
2684
  ]
2674
2685
  }
@@ -2676,83 +2687,83 @@ const Fe = (e) => {
2676
2687
  ] })
2677
2688
  ] }) });
2678
2689
  };
2679
- var wt = function(e, t) {
2680
- return wt = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, r) {
2681
- n.__proto__ = r;
2682
- } || function(n, r) {
2683
- for (var o in r) Object.prototype.hasOwnProperty.call(r, o) && (n[o] = r[o]);
2684
- }, wt(e, t);
2690
+ var be = function(t, e) {
2691
+ return be = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
2692
+ r.__proto__ = n;
2693
+ } || function(r, n) {
2694
+ for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
2695
+ }, be(t, e);
2685
2696
  };
2686
- function ko(e, t) {
2687
- if (typeof t != "function" && t !== null)
2688
- throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
2689
- wt(e, t);
2690
- function n() {
2691
- this.constructor = e;
2697
+ function Co(t, e) {
2698
+ if (typeof e != "function" && e !== null)
2699
+ throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
2700
+ be(t, e);
2701
+ function r() {
2702
+ this.constructor = t;
2692
2703
  }
2693
- e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
2704
+ t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
2694
2705
  }
2695
- var ae = function() {
2696
- return ae = Object.assign || function(t) {
2697
- for (var n, r = 1, o = arguments.length; r < o; r++) {
2698
- n = arguments[r];
2699
- for (var s in n) Object.prototype.hasOwnProperty.call(n, s) && (t[s] = n[s]);
2706
+ var st = function() {
2707
+ return st = Object.assign || function(e) {
2708
+ for (var r, n = 1, o = arguments.length; n < o; n++) {
2709
+ r = arguments[n];
2710
+ for (var a in r) Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
2700
2711
  }
2701
- return t;
2702
- }, ae.apply(this, arguments);
2712
+ return e;
2713
+ }, st.apply(this, arguments);
2703
2714
  };
2704
- function Io(e, t) {
2705
- var n = {};
2706
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2707
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
2708
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2709
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2710
- return n;
2715
+ function Io(t, e) {
2716
+ var r = {};
2717
+ for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && e.indexOf(n) < 0 && (r[n] = t[n]);
2718
+ if (t != null && typeof Object.getOwnPropertySymbols == "function")
2719
+ for (var o = 0, n = Object.getOwnPropertySymbols(t); o < n.length; o++)
2720
+ e.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(t, n[o]) && (r[n[o]] = t[n[o]]);
2721
+ return r;
2711
2722
  }
2712
- var ct = "Invariant Violation", rn = Object.setPrototypeOf, Co = rn === void 0 ? function(e, t) {
2713
- return e.__proto__ = t, e;
2714
- } : rn, Un = (
2723
+ var ce = "Invariant Violation", nr = Object.setPrototypeOf, _o = nr === void 0 ? function(t, e) {
2724
+ return t.__proto__ = e, t;
2725
+ } : nr, Dr = (
2715
2726
  /** @class */
2716
- (function(e) {
2717
- ko(t, e);
2718
- function t(n) {
2719
- n === void 0 && (n = ct);
2720
- var r = e.call(this, typeof n == "number" ? ct + ": " + n + " (see https://github.com/apollographql/invariant-packages)" : n) || this;
2721
- return r.framesToPop = 1, r.name = ct, Co(r, t.prototype), r;
2727
+ (function(t) {
2728
+ Co(e, t);
2729
+ function e(r) {
2730
+ r === void 0 && (r = ce);
2731
+ var n = t.call(this, typeof r == "number" ? ce + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
2732
+ return n.framesToPop = 1, n.name = ce, _o(n, e.prototype), n;
2722
2733
  }
2723
- return t;
2734
+ return e;
2724
2735
  })(Error)
2725
2736
  );
2726
- function me(e, t) {
2727
- if (!e)
2728
- throw new Un(t);
2737
+ function gt(t, e) {
2738
+ if (!t)
2739
+ throw new Dr(e);
2729
2740
  }
2730
- var qn = ["debug", "log", "warn", "error", "silent"], _o = qn.indexOf("log");
2731
- function He(e) {
2741
+ var Mr = ["debug", "log", "warn", "error", "silent"], Fo = Mr.indexOf("log");
2742
+ function qt(t) {
2732
2743
  return function() {
2733
- if (qn.indexOf(e) >= _o) {
2734
- var t = console[e] || console.log;
2735
- return t.apply(console, arguments);
2744
+ if (Mr.indexOf(t) >= Fo) {
2745
+ var e = console[t] || console.log;
2746
+ return e.apply(console, arguments);
2736
2747
  }
2737
2748
  };
2738
2749
  }
2739
- (function(e) {
2740
- e.debug = He("debug"), e.log = He("log"), e.warn = He("warn"), e.error = He("error");
2741
- })(me || (me = {}));
2742
- var Bn = "3.14.0";
2743
- function Ce(e) {
2750
+ (function(t) {
2751
+ t.debug = qt("debug"), t.log = qt("log"), t.warn = qt("warn"), t.error = qt("error");
2752
+ })(gt || (gt = {}));
2753
+ var Ur = "3.14.0";
2754
+ function It(t) {
2744
2755
  try {
2745
- return e();
2756
+ return t();
2746
2757
  } catch {
2747
2758
  }
2748
2759
  }
2749
- const xt = Ce(function() {
2760
+ const xe = It(function() {
2750
2761
  return globalThis;
2751
- }) || Ce(function() {
2762
+ }) || It(function() {
2752
2763
  return window;
2753
- }) || Ce(function() {
2764
+ }) || It(function() {
2754
2765
  return self;
2755
- }) || Ce(function() {
2766
+ }) || It(function() {
2756
2767
  return global;
2757
2768
  }) || // We don't expect the Function constructor ever to be invoked at runtime, as
2758
2769
  // long as at least one of globalThis, window, self, or global is defined, so
@@ -2760,161 +2771,161 @@ const xt = Ce(function() {
2760
2771
  // detect syntactic usage of the Function constructor. If you think you can
2761
2772
  // improve your static analysis to detect this obfuscation, think again. This
2762
2773
  // is an arms race you cannot win, at least not in JavaScript.
2763
- Ce(function() {
2764
- return Ce.constructor("return this")();
2774
+ It(function() {
2775
+ return It.constructor("return this")();
2765
2776
  });
2766
- var on = /* @__PURE__ */ new Map();
2767
- function No(e) {
2768
- var t = on.get(e) || 1;
2769
- return on.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
2770
- }
2771
- function Fo(e, t) {
2772
- var n = No("stringifyForDisplay");
2773
- return JSON.stringify(e, function(r, o) {
2774
- return o === void 0 ? n : o;
2775
- }, t).split(JSON.stringify(n)).join("<undefined>");
2776
- }
2777
- function Re(e) {
2778
- return function(t) {
2779
- for (var n = [], r = 1; r < arguments.length; r++)
2780
- n[r - 1] = arguments[r];
2781
- if (typeof t == "number") {
2782
- var o = t;
2783
- t = Nt(o), t || (t = Ft(o, n), n = []);
2777
+ var or = /* @__PURE__ */ new Map();
2778
+ function No(t) {
2779
+ var e = or.get(t) || 1;
2780
+ return or.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
2781
+ }
2782
+ function Eo(t, e) {
2783
+ var r = No("stringifyForDisplay");
2784
+ return JSON.stringify(t, function(n, o) {
2785
+ return o === void 0 ? r : o;
2786
+ }, e).split(JSON.stringify(r)).join("<undefined>");
2787
+ }
2788
+ function Rt(t) {
2789
+ return function(e) {
2790
+ for (var r = [], n = 1; n < arguments.length; n++)
2791
+ r[n - 1] = arguments[n];
2792
+ if (typeof e == "number") {
2793
+ var o = e;
2794
+ e = Fe(o), e || (e = Ne(o, r), r = []);
2784
2795
  }
2785
- e.apply(void 0, [t].concat(n));
2796
+ t.apply(void 0, [e].concat(r));
2786
2797
  };
2787
2798
  }
2788
- var lt = Object.assign(function(t, n) {
2789
- for (var r = [], o = 2; o < arguments.length; o++)
2790
- r[o - 2] = arguments[o];
2791
- t || me(t, Nt(n, r) || Ft(n, r));
2799
+ var le = Object.assign(function(e, r) {
2800
+ for (var n = [], o = 2; o < arguments.length; o++)
2801
+ n[o - 2] = arguments[o];
2802
+ e || gt(e, Fe(r, n) || Ne(r, n));
2792
2803
  }, {
2793
- debug: Re(me.debug),
2794
- log: Re(me.log),
2795
- warn: Re(me.warn),
2796
- error: Re(me.error)
2804
+ debug: Rt(gt.debug),
2805
+ log: Rt(gt.log),
2806
+ warn: Rt(gt.warn),
2807
+ error: Rt(gt.error)
2797
2808
  });
2798
- function Hn(e) {
2799
- for (var t = [], n = 1; n < arguments.length; n++)
2800
- t[n - 1] = arguments[n];
2801
- return new Un(Nt(e, t) || Ft(e, t));
2802
- }
2803
- var sn = Symbol.for("ApolloErrorMessageHandler_" + Bn);
2804
- function Rn(e) {
2805
- if (typeof e == "string")
2806
- return e;
2809
+ function Br(t) {
2810
+ for (var e = [], r = 1; r < arguments.length; r++)
2811
+ e[r - 1] = arguments[r];
2812
+ return new Dr(Fe(t, e) || Ne(t, e));
2813
+ }
2814
+ var ar = Symbol.for("ApolloErrorMessageHandler_" + Ur);
2815
+ function qr(t) {
2816
+ if (typeof t == "string")
2817
+ return t;
2807
2818
  try {
2808
- return Fo(e, 2).slice(0, 1e3);
2819
+ return Eo(t, 2).slice(0, 1e3);
2809
2820
  } catch {
2810
2821
  return "<non-serializable>";
2811
2822
  }
2812
2823
  }
2813
- function Nt(e, t) {
2814
- if (t === void 0 && (t = []), !!e)
2815
- return xt[sn] && xt[sn](e, t.map(Rn));
2824
+ function Fe(t, e) {
2825
+ if (e === void 0 && (e = []), !!t)
2826
+ return xe[ar] && xe[ar](t, e.map(qr));
2816
2827
  }
2817
- function Ft(e, t) {
2818
- if (t === void 0 && (t = []), !!e)
2828
+ function Ne(t, e) {
2829
+ if (e === void 0 && (e = []), !!t)
2819
2830
  return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
2820
- version: Bn,
2821
- message: e,
2822
- args: t.map(Rn)
2831
+ version: Ur,
2832
+ message: t,
2833
+ args: e.map(qr)
2823
2834
  })));
2824
2835
  }
2825
- function To(e) {
2826
- return e.definitions.filter(function(t) {
2827
- return t.kind === "OperationDefinition" && !!t.name;
2828
- }).map(function(t) {
2829
- return t.name.value;
2836
+ function To(t) {
2837
+ return t.definitions.filter(function(e) {
2838
+ return e.kind === "OperationDefinition" && !!e.name;
2839
+ }).map(function(e) {
2840
+ return e.name.value;
2830
2841
  })[0] || null;
2831
2842
  }
2832
- let D = null;
2833
- const an = {};
2834
- let Eo = 1;
2835
- const Po = () => class {
2843
+ let z = null;
2844
+ const ir = {};
2845
+ let Po = 1;
2846
+ const Oo = () => class {
2836
2847
  constructor() {
2837
2848
  this.id = [
2838
2849
  "slot",
2839
- Eo++,
2850
+ Po++,
2840
2851
  Date.now(),
2841
2852
  Math.random().toString(36).slice(2)
2842
2853
  ].join(":");
2843
2854
  }
2844
2855
  hasValue() {
2845
- for (let t = D; t; t = t.parent)
2846
- if (this.id in t.slots) {
2847
- const n = t.slots[this.id];
2848
- if (n === an)
2856
+ for (let e = z; e; e = e.parent)
2857
+ if (this.id in e.slots) {
2858
+ const r = e.slots[this.id];
2859
+ if (r === ir)
2849
2860
  break;
2850
- return t !== D && (D.slots[this.id] = n), !0;
2861
+ return e !== z && (z.slots[this.id] = r), !0;
2851
2862
  }
2852
- return D && (D.slots[this.id] = an), !1;
2863
+ return z && (z.slots[this.id] = ir), !1;
2853
2864
  }
2854
2865
  getValue() {
2855
2866
  if (this.hasValue())
2856
- return D.slots[this.id];
2867
+ return z.slots[this.id];
2857
2868
  }
2858
- withValue(t, n, r, o) {
2859
- const s = {
2869
+ withValue(e, r, n, o) {
2870
+ const a = {
2860
2871
  __proto__: null,
2861
- [this.id]: t
2862
- }, i = D;
2863
- D = { parent: i, slots: s };
2872
+ [this.id]: e
2873
+ }, i = z;
2874
+ z = { parent: i, slots: a };
2864
2875
  try {
2865
- return n.apply(o, r);
2876
+ return r.apply(o, n);
2866
2877
  } finally {
2867
- D = i;
2878
+ z = i;
2868
2879
  }
2869
2880
  }
2870
2881
  // Capture the current context and wrap a callback function so that it
2871
2882
  // reestablishes the captured context when called.
2872
- static bind(t) {
2873
- const n = D;
2883
+ static bind(e) {
2884
+ const r = z;
2874
2885
  return function() {
2875
- const r = D;
2886
+ const n = z;
2876
2887
  try {
2877
- return D = n, t.apply(this, arguments);
2888
+ return z = r, e.apply(this, arguments);
2878
2889
  } finally {
2879
- D = r;
2890
+ z = n;
2880
2891
  }
2881
2892
  };
2882
2893
  }
2883
2894
  // Immediately run a callback function without any captured context.
2884
- static noContext(t, n, r) {
2885
- if (D) {
2886
- const o = D;
2895
+ static noContext(e, r, n) {
2896
+ if (z) {
2897
+ const o = z;
2887
2898
  try {
2888
- return D = null, t.apply(r, n);
2899
+ return z = null, e.apply(n, r);
2889
2900
  } finally {
2890
- D = o;
2901
+ z = o;
2891
2902
  }
2892
2903
  } else
2893
- return t.apply(r, n);
2904
+ return e.apply(n, r);
2894
2905
  }
2895
2906
  };
2896
- function cn(e) {
2907
+ function sr(t) {
2897
2908
  try {
2898
- return e();
2909
+ return t();
2899
2910
  } catch {
2900
2911
  }
2901
2912
  }
2902
- const ut = "@wry/context:Slot", Oo = (
2913
+ const ue = "@wry/context:Slot", jo = (
2903
2914
  // Prefer globalThis when available.
2904
2915
  // https://github.com/benjamn/wryware/issues/347
2905
- cn(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
2916
+ sr(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
2906
2917
  // bundlers to the appropriate identifier (window, self, ...) depending on the
2907
2918
  // bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
2908
- cn(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
2919
+ sr(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
2909
2920
  // back to using the Array constructor as a namespace, but that was flagged in
2910
2921
  // https://github.com/benjamn/wryware/issues/347, and can be avoided.
2911
2922
  /* @__PURE__ */ Object.create(null)
2912
- ), ln = Oo, Tt = ln[ut] || // Earlier versions of this package stored the globalKey property on the Array
2923
+ ), cr = jo, Ee = cr[ue] || // Earlier versions of this package stored the globalKey property on the Array
2913
2924
  // constructor, so we check there as well, to prevent Slot class duplication.
2914
- Array[ut] || (function(e) {
2925
+ Array[ue] || (function(t) {
2915
2926
  try {
2916
- Object.defineProperty(ln, ut, {
2917
- value: e,
2927
+ Object.defineProperty(cr, ue, {
2928
+ value: t,
2918
2929
  enumerable: !1,
2919
2930
  writable: !1,
2920
2931
  // When it was possible for globalHost to be the Array constructor (a
@@ -2926,234 +2937,234 @@ Array[ut] || (function(e) {
2926
2937
  configurable: !0
2927
2938
  });
2928
2939
  } finally {
2929
- return e;
2940
+ return t;
2930
2941
  }
2931
- })(Po()), { bind: hs, noContext: ms } = Tt;
2932
- new Tt();
2933
- function $o(e, t) {
2934
- var n = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
2935
- if (n) return (n = n.call(e)).next.bind(n);
2936
- if (Array.isArray(e) || (n = jo(e)) || t) {
2937
- n && (e = n);
2938
- var r = 0;
2942
+ })(Oo()), { bind: ga, noContext: wa } = Ee;
2943
+ new Ee();
2944
+ function $o(t, e) {
2945
+ var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
2946
+ if (r) return (r = r.call(t)).next.bind(r);
2947
+ if (Array.isArray(t) || (r = Ao(t)) || e) {
2948
+ r && (t = r);
2949
+ var n = 0;
2939
2950
  return function() {
2940
- return r >= e.length ? { done: !0 } : { done: !1, value: e[r++] };
2951
+ return n >= t.length ? { done: !0 } : { done: !1, value: t[n++] };
2941
2952
  };
2942
2953
  }
2943
2954
  throw new TypeError(`Invalid attempt to iterate non-iterable instance.
2944
2955
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
2945
2956
  }
2946
- function jo(e, t) {
2947
- if (e) {
2948
- if (typeof e == "string") return un(e, t);
2949
- var n = Object.prototype.toString.call(e).slice(8, -1);
2950
- if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
2951
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return un(e, t);
2957
+ function Ao(t, e) {
2958
+ if (t) {
2959
+ if (typeof t == "string") return lr(t, e);
2960
+ var r = Object.prototype.toString.call(t).slice(8, -1);
2961
+ if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
2962
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return lr(t, e);
2952
2963
  }
2953
2964
  }
2954
- function un(e, t) {
2955
- (t == null || t > e.length) && (t = e.length);
2956
- for (var n = 0, r = new Array(t); n < t; n++)
2957
- r[n] = e[n];
2958
- return r;
2965
+ function lr(t, e) {
2966
+ (e == null || e > t.length) && (e = t.length);
2967
+ for (var r = 0, n = new Array(e); r < e; r++)
2968
+ n[r] = t[r];
2969
+ return n;
2959
2970
  }
2960
- function fn(e, t) {
2961
- for (var n = 0; n < t.length; n++) {
2962
- var r = t[n];
2963
- r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, r.key, r);
2971
+ function ur(t, e) {
2972
+ for (var r = 0; r < e.length; r++) {
2973
+ var n = e[r];
2974
+ n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n);
2964
2975
  }
2965
2976
  }
2966
- function Et(e, t, n) {
2967
- return t && fn(e.prototype, t), n && fn(e, n), Object.defineProperty(e, "prototype", { writable: !1 }), e;
2977
+ function Te(t, e, r) {
2978
+ return e && ur(t.prototype, e), r && ur(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
2968
2979
  }
2969
- var Pt = function() {
2980
+ var Pe = function() {
2970
2981
  return typeof Symbol == "function";
2971
- }, Ot = function(e) {
2972
- return Pt() && !!Symbol[e];
2973
- }, $t = function(e) {
2974
- return Ot(e) ? Symbol[e] : "@@" + e;
2982
+ }, Oe = function(t) {
2983
+ return Pe() && !!Symbol[t];
2984
+ }, je = function(t) {
2985
+ return Oe(t) ? Symbol[t] : "@@" + t;
2975
2986
  };
2976
- Pt() && !Ot("observable") && (Symbol.observable = Symbol("observable"));
2977
- var Ao = $t("iterator"), vt = $t("observable"), zn = $t("species");
2978
- function Ze(e, t) {
2979
- var n = e[t];
2980
- if (n != null) {
2981
- if (typeof n != "function") throw new TypeError(n + " is not a function");
2982
- return n;
2987
+ Pe() && !Oe("observable") && (Symbol.observable = Symbol("observable"));
2988
+ var Lo = je("iterator"), ve = je("observable"), Rr = je("species");
2989
+ function Xt(t, e) {
2990
+ var r = t[e];
2991
+ if (r != null) {
2992
+ if (typeof r != "function") throw new TypeError(r + " is not a function");
2993
+ return r;
2983
2994
  }
2984
2995
  }
2985
- function Le(e) {
2986
- var t = e.constructor;
2987
- return t !== void 0 && (t = t[zn], t === null && (t = void 0)), t !== void 0 ? t : U;
2996
+ function Lt(t) {
2997
+ var e = t.constructor;
2998
+ return e !== void 0 && (e = e[Rr], e === null && (e = void 0)), e !== void 0 ? e : M;
2988
2999
  }
2989
- function Lo(e) {
2990
- return e instanceof U;
3000
+ function zo(t) {
3001
+ return t instanceof M;
2991
3002
  }
2992
- function Ee(e) {
2993
- Ee.log ? Ee.log(e) : setTimeout(function() {
2994
- throw e;
3003
+ function Tt(t) {
3004
+ Tt.log ? Tt.log(t) : setTimeout(function() {
3005
+ throw t;
2995
3006
  });
2996
3007
  }
2997
- function Ke(e) {
3008
+ function Jt(t) {
2998
3009
  Promise.resolve().then(function() {
2999
3010
  try {
3000
- e();
3001
- } catch (t) {
3002
- Ee(t);
3011
+ t();
3012
+ } catch (e) {
3013
+ Tt(e);
3003
3014
  }
3004
3015
  });
3005
3016
  }
3006
- function Vn(e) {
3007
- var t = e._cleanup;
3008
- if (t !== void 0 && (e._cleanup = void 0, !!t))
3017
+ function Hr(t) {
3018
+ var e = t._cleanup;
3019
+ if (e !== void 0 && (t._cleanup = void 0, !!e))
3009
3020
  try {
3010
- if (typeof t == "function")
3011
- t();
3021
+ if (typeof e == "function")
3022
+ e();
3012
3023
  else {
3013
- var n = Ze(t, "unsubscribe");
3014
- n && n.call(t);
3024
+ var r = Xt(e, "unsubscribe");
3025
+ r && r.call(e);
3015
3026
  }
3016
- } catch (r) {
3017
- Ee(r);
3027
+ } catch (n) {
3028
+ Tt(n);
3018
3029
  }
3019
3030
  }
3020
- function St(e) {
3021
- e._observer = void 0, e._queue = void 0, e._state = "closed";
3031
+ function ke(t) {
3032
+ t._observer = void 0, t._queue = void 0, t._state = "closed";
3022
3033
  }
3023
- function Do(e) {
3024
- var t = e._queue;
3025
- if (t) {
3026
- e._queue = void 0, e._state = "ready";
3027
- for (var n = 0; n < t.length && (Jn(e, t[n].type, t[n].value), e._state !== "closed"); ++n)
3034
+ function Do(t) {
3035
+ var e = t._queue;
3036
+ if (e) {
3037
+ t._queue = void 0, t._state = "ready";
3038
+ for (var r = 0; r < e.length && (Vr(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
3028
3039
  ;
3029
3040
  }
3030
3041
  }
3031
- function Jn(e, t, n) {
3032
- e._state = "running";
3033
- var r = e._observer;
3042
+ function Vr(t, e, r) {
3043
+ t._state = "running";
3044
+ var n = t._observer;
3034
3045
  try {
3035
- var o = Ze(r, t);
3036
- switch (t) {
3046
+ var o = Xt(n, e);
3047
+ switch (e) {
3037
3048
  case "next":
3038
- o && o.call(r, n);
3049
+ o && o.call(n, r);
3039
3050
  break;
3040
3051
  case "error":
3041
- if (St(e), o) o.call(r, n);
3042
- else throw n;
3052
+ if (ke(t), o) o.call(n, r);
3053
+ else throw r;
3043
3054
  break;
3044
3055
  case "complete":
3045
- St(e), o && o.call(r);
3056
+ ke(t), o && o.call(n);
3046
3057
  break;
3047
3058
  }
3048
- } catch (s) {
3049
- Ee(s);
3059
+ } catch (a) {
3060
+ Tt(a);
3050
3061
  }
3051
- e._state === "closed" ? Vn(e) : e._state === "running" && (e._state = "ready");
3062
+ t._state === "closed" ? Hr(t) : t._state === "running" && (t._state = "ready");
3052
3063
  }
3053
- function ft(e, t, n) {
3054
- if (e._state !== "closed") {
3055
- if (e._state === "buffering") {
3056
- e._queue.push({
3057
- type: t,
3058
- value: n
3064
+ function de(t, e, r) {
3065
+ if (t._state !== "closed") {
3066
+ if (t._state === "buffering") {
3067
+ t._queue.push({
3068
+ type: e,
3069
+ value: r
3059
3070
  });
3060
3071
  return;
3061
3072
  }
3062
- if (e._state !== "ready") {
3063
- e._state = "buffering", e._queue = [{
3064
- type: t,
3065
- value: n
3066
- }], Ke(function() {
3067
- return Do(e);
3073
+ if (t._state !== "ready") {
3074
+ t._state = "buffering", t._queue = [{
3075
+ type: e,
3076
+ value: r
3077
+ }], Jt(function() {
3078
+ return Do(t);
3068
3079
  });
3069
3080
  return;
3070
3081
  }
3071
- Jn(e, t, n);
3082
+ Vr(t, e, r);
3072
3083
  }
3073
3084
  }
3074
3085
  var Mo = /* @__PURE__ */ (function() {
3075
- function e(n, r) {
3076
- this._cleanup = void 0, this._observer = n, this._queue = void 0, this._state = "initializing";
3086
+ function t(r, n) {
3087
+ this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
3077
3088
  var o = new Uo(this);
3078
3089
  try {
3079
- this._cleanup = r.call(void 0, o);
3080
- } catch (s) {
3081
- o.error(s);
3090
+ this._cleanup = n.call(void 0, o);
3091
+ } catch (a) {
3092
+ o.error(a);
3082
3093
  }
3083
3094
  this._state === "initializing" && (this._state = "ready");
3084
3095
  }
3085
- var t = e.prototype;
3086
- return t.unsubscribe = function() {
3087
- this._state !== "closed" && (St(this), Vn(this));
3088
- }, Et(e, [{
3096
+ var e = t.prototype;
3097
+ return e.unsubscribe = function() {
3098
+ this._state !== "closed" && (ke(this), Hr(this));
3099
+ }, Te(t, [{
3089
3100
  key: "closed",
3090
3101
  get: function() {
3091
3102
  return this._state === "closed";
3092
3103
  }
3093
- }]), e;
3104
+ }]), t;
3094
3105
  })(), Uo = /* @__PURE__ */ (function() {
3095
- function e(n) {
3096
- this._subscription = n;
3097
- }
3098
- var t = e.prototype;
3099
- return t.next = function(r) {
3100
- ft(this._subscription, "next", r);
3101
- }, t.error = function(r) {
3102
- ft(this._subscription, "error", r);
3103
- }, t.complete = function() {
3104
- ft(this._subscription, "complete");
3105
- }, Et(e, [{
3106
+ function t(r) {
3107
+ this._subscription = r;
3108
+ }
3109
+ var e = t.prototype;
3110
+ return e.next = function(n) {
3111
+ de(this._subscription, "next", n);
3112
+ }, e.error = function(n) {
3113
+ de(this._subscription, "error", n);
3114
+ }, e.complete = function() {
3115
+ de(this._subscription, "complete");
3116
+ }, Te(t, [{
3106
3117
  key: "closed",
3107
3118
  get: function() {
3108
3119
  return this._subscription._state === "closed";
3109
3120
  }
3110
- }]), e;
3111
- })(), U = /* @__PURE__ */ (function() {
3112
- function e(n) {
3113
- if (!(this instanceof e)) throw new TypeError("Observable cannot be called as a function");
3114
- if (typeof n != "function") throw new TypeError("Observable initializer must be a function");
3115
- this._subscriber = n;
3116
- }
3117
- var t = e.prototype;
3118
- return t.subscribe = function(r) {
3119
- return (typeof r != "object" || r === null) && (r = {
3120
- next: r,
3121
+ }]), t;
3122
+ })(), M = /* @__PURE__ */ (function() {
3123
+ function t(r) {
3124
+ if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
3125
+ if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
3126
+ this._subscriber = r;
3127
+ }
3128
+ var e = t.prototype;
3129
+ return e.subscribe = function(n) {
3130
+ return (typeof n != "object" || n === null) && (n = {
3131
+ next: n,
3121
3132
  error: arguments[1],
3122
3133
  complete: arguments[2]
3123
- }), new Mo(r, this._subscriber);
3124
- }, t.forEach = function(r) {
3134
+ }), new Mo(n, this._subscriber);
3135
+ }, e.forEach = function(n) {
3125
3136
  var o = this;
3126
- return new Promise(function(s, i) {
3127
- if (typeof r != "function") {
3128
- i(new TypeError(r + " is not a function"));
3137
+ return new Promise(function(a, i) {
3138
+ if (typeof n != "function") {
3139
+ i(new TypeError(n + " is not a function"));
3129
3140
  return;
3130
3141
  }
3131
3142
  function c() {
3132
- a.unsubscribe(), s();
3143
+ s.unsubscribe(), a();
3133
3144
  }
3134
- var a = o.subscribe({
3145
+ var s = o.subscribe({
3135
3146
  next: function(u) {
3136
3147
  try {
3137
- r(u, c);
3138
- } catch (d) {
3139
- i(d), a.unsubscribe();
3148
+ n(u, c);
3149
+ } catch (f) {
3150
+ i(f), s.unsubscribe();
3140
3151
  }
3141
3152
  },
3142
3153
  error: i,
3143
- complete: s
3154
+ complete: a
3144
3155
  });
3145
3156
  });
3146
- }, t.map = function(r) {
3157
+ }, e.map = function(n) {
3147
3158
  var o = this;
3148
- if (typeof r != "function") throw new TypeError(r + " is not a function");
3149
- var s = Le(this);
3150
- return new s(function(i) {
3159
+ if (typeof n != "function") throw new TypeError(n + " is not a function");
3160
+ var a = Lt(this);
3161
+ return new a(function(i) {
3151
3162
  return o.subscribe({
3152
3163
  next: function(c) {
3153
3164
  try {
3154
- c = r(c);
3155
- } catch (a) {
3156
- return i.error(a);
3165
+ c = n(c);
3166
+ } catch (s) {
3167
+ return i.error(s);
3157
3168
  }
3158
3169
  i.next(c);
3159
3170
  },
@@ -3165,17 +3176,17 @@ var Mo = /* @__PURE__ */ (function() {
3165
3176
  }
3166
3177
  });
3167
3178
  });
3168
- }, t.filter = function(r) {
3179
+ }, e.filter = function(n) {
3169
3180
  var o = this;
3170
- if (typeof r != "function") throw new TypeError(r + " is not a function");
3171
- var s = Le(this);
3172
- return new s(function(i) {
3181
+ if (typeof n != "function") throw new TypeError(n + " is not a function");
3182
+ var a = Lt(this);
3183
+ return new a(function(i) {
3173
3184
  return o.subscribe({
3174
3185
  next: function(c) {
3175
3186
  try {
3176
- if (!r(c)) return;
3177
- } catch (a) {
3178
- return i.error(a);
3187
+ if (!n(c)) return;
3188
+ } catch (s) {
3189
+ return i.error(s);
3179
3190
  }
3180
3191
  i.next(c);
3181
3192
  },
@@ -3187,69 +3198,69 @@ var Mo = /* @__PURE__ */ (function() {
3187
3198
  }
3188
3199
  });
3189
3200
  });
3190
- }, t.reduce = function(r) {
3201
+ }, e.reduce = function(n) {
3191
3202
  var o = this;
3192
- if (typeof r != "function") throw new TypeError(r + " is not a function");
3193
- var s = Le(this), i = arguments.length > 1, c = !1, a = arguments[1], u = a;
3194
- return new s(function(d) {
3203
+ if (typeof n != "function") throw new TypeError(n + " is not a function");
3204
+ var a = Lt(this), i = arguments.length > 1, c = !1, s = arguments[1], u = s;
3205
+ return new a(function(f) {
3195
3206
  return o.subscribe({
3196
3207
  next: function(h) {
3197
3208
  var m = !c;
3198
3209
  if (c = !0, !m || i)
3199
3210
  try {
3200
- u = r(u, h);
3211
+ u = n(u, h);
3201
3212
  } catch (g) {
3202
- return d.error(g);
3213
+ return f.error(g);
3203
3214
  }
3204
3215
  else
3205
3216
  u = h;
3206
3217
  },
3207
3218
  error: function(h) {
3208
- d.error(h);
3219
+ f.error(h);
3209
3220
  },
3210
3221
  complete: function() {
3211
- if (!c && !i) return d.error(new TypeError("Cannot reduce an empty sequence"));
3212
- d.next(u), d.complete();
3222
+ if (!c && !i) return f.error(new TypeError("Cannot reduce an empty sequence"));
3223
+ f.next(u), f.complete();
3213
3224
  }
3214
3225
  });
3215
3226
  });
3216
- }, t.concat = function() {
3217
- for (var r = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
3218
- s[i] = arguments[i];
3219
- var c = Le(this);
3220
- return new c(function(a) {
3221
- var u, d = 0;
3227
+ }, e.concat = function() {
3228
+ for (var n = this, o = arguments.length, a = new Array(o), i = 0; i < o; i++)
3229
+ a[i] = arguments[i];
3230
+ var c = Lt(this);
3231
+ return new c(function(s) {
3232
+ var u, f = 0;
3222
3233
  function h(m) {
3223
3234
  u = m.subscribe({
3224
3235
  next: function(g) {
3225
- a.next(g);
3236
+ s.next(g);
3226
3237
  },
3227
3238
  error: function(g) {
3228
- a.error(g);
3239
+ s.error(g);
3229
3240
  },
3230
3241
  complete: function() {
3231
- d === s.length ? (u = void 0, a.complete()) : h(c.from(s[d++]));
3242
+ f === a.length ? (u = void 0, s.complete()) : h(c.from(a[f++]));
3232
3243
  }
3233
3244
  });
3234
3245
  }
3235
- return h(r), function() {
3246
+ return h(n), function() {
3236
3247
  u && (u.unsubscribe(), u = void 0);
3237
3248
  };
3238
3249
  });
3239
- }, t.flatMap = function(r) {
3250
+ }, e.flatMap = function(n) {
3240
3251
  var o = this;
3241
- if (typeof r != "function") throw new TypeError(r + " is not a function");
3242
- var s = Le(this);
3243
- return new s(function(i) {
3244
- var c = [], a = o.subscribe({
3245
- next: function(d) {
3246
- if (r)
3252
+ if (typeof n != "function") throw new TypeError(n + " is not a function");
3253
+ var a = Lt(this);
3254
+ return new a(function(i) {
3255
+ var c = [], s = o.subscribe({
3256
+ next: function(f) {
3257
+ if (n)
3247
3258
  try {
3248
- d = r(d);
3259
+ f = n(f);
3249
3260
  } catch (m) {
3250
3261
  return i.error(m);
3251
3262
  }
3252
- var h = s.from(d).subscribe({
3263
+ var h = a.from(f).subscribe({
3253
3264
  next: function(m) {
3254
3265
  i.next(m);
3255
3266
  },
@@ -3263,272 +3274,273 @@ var Mo = /* @__PURE__ */ (function() {
3263
3274
  });
3264
3275
  c.push(h);
3265
3276
  },
3266
- error: function(d) {
3267
- i.error(d);
3277
+ error: function(f) {
3278
+ i.error(f);
3268
3279
  },
3269
3280
  complete: function() {
3270
3281
  u();
3271
3282
  }
3272
3283
  });
3273
3284
  function u() {
3274
- a.closed && c.length === 0 && i.complete();
3285
+ s.closed && c.length === 0 && i.complete();
3275
3286
  }
3276
3287
  return function() {
3277
- c.forEach(function(d) {
3278
- return d.unsubscribe();
3279
- }), a.unsubscribe();
3288
+ c.forEach(function(f) {
3289
+ return f.unsubscribe();
3290
+ }), s.unsubscribe();
3280
3291
  };
3281
3292
  });
3282
- }, t[vt] = function() {
3293
+ }, e[ve] = function() {
3283
3294
  return this;
3284
- }, e.from = function(r) {
3285
- var o = typeof this == "function" ? this : e;
3286
- if (r == null) throw new TypeError(r + " is not an object");
3287
- var s = Ze(r, vt);
3288
- if (s) {
3289
- var i = s.call(r);
3295
+ }, t.from = function(n) {
3296
+ var o = typeof this == "function" ? this : t;
3297
+ if (n == null) throw new TypeError(n + " is not an object");
3298
+ var a = Xt(n, ve);
3299
+ if (a) {
3300
+ var i = a.call(n);
3290
3301
  if (Object(i) !== i) throw new TypeError(i + " is not an object");
3291
- return Lo(i) && i.constructor === o ? i : new o(function(c) {
3302
+ return zo(i) && i.constructor === o ? i : new o(function(c) {
3292
3303
  return i.subscribe(c);
3293
3304
  });
3294
3305
  }
3295
- if (Ot("iterator") && (s = Ze(r, Ao), s))
3306
+ if (Oe("iterator") && (a = Xt(n, Lo), a))
3296
3307
  return new o(function(c) {
3297
- Ke(function() {
3308
+ Jt(function() {
3298
3309
  if (!c.closed) {
3299
- for (var a = $o(s.call(r)), u; !(u = a()).done; ) {
3300
- var d = u.value;
3301
- if (c.next(d), c.closed) return;
3310
+ for (var s = $o(a.call(n)), u; !(u = s()).done; ) {
3311
+ var f = u.value;
3312
+ if (c.next(f), c.closed) return;
3302
3313
  }
3303
3314
  c.complete();
3304
3315
  }
3305
3316
  });
3306
3317
  });
3307
- if (Array.isArray(r))
3318
+ if (Array.isArray(n))
3308
3319
  return new o(function(c) {
3309
- Ke(function() {
3320
+ Jt(function() {
3310
3321
  if (!c.closed) {
3311
- for (var a = 0; a < r.length; ++a)
3312
- if (c.next(r[a]), c.closed) return;
3322
+ for (var s = 0; s < n.length; ++s)
3323
+ if (c.next(n[s]), c.closed) return;
3313
3324
  c.complete();
3314
3325
  }
3315
3326
  });
3316
3327
  });
3317
- throw new TypeError(r + " is not observable");
3318
- }, e.of = function() {
3319
- for (var r = arguments.length, o = new Array(r), s = 0; s < r; s++)
3320
- o[s] = arguments[s];
3321
- var i = typeof this == "function" ? this : e;
3328
+ throw new TypeError(n + " is not observable");
3329
+ }, t.of = function() {
3330
+ for (var n = arguments.length, o = new Array(n), a = 0; a < n; a++)
3331
+ o[a] = arguments[a];
3332
+ var i = typeof this == "function" ? this : t;
3322
3333
  return new i(function(c) {
3323
- Ke(function() {
3334
+ Jt(function() {
3324
3335
  if (!c.closed) {
3325
- for (var a = 0; a < o.length; ++a)
3326
- if (c.next(o[a]), c.closed) return;
3336
+ for (var s = 0; s < o.length; ++s)
3337
+ if (c.next(o[s]), c.closed) return;
3327
3338
  c.complete();
3328
3339
  }
3329
3340
  });
3330
3341
  });
3331
- }, Et(e, null, [{
3332
- key: zn,
3342
+ }, Te(t, null, [{
3343
+ key: Rr,
3333
3344
  get: function() {
3334
3345
  return this;
3335
3346
  }
3336
- }]), e;
3347
+ }]), t;
3337
3348
  })();
3338
- Pt() && Object.defineProperty(U, Symbol("extensions"), {
3349
+ Pe() && Object.defineProperty(M, Symbol("extensions"), {
3339
3350
  value: {
3340
- symbol: vt,
3341
- hostReportError: Ee
3351
+ symbol: ve,
3352
+ hostReportError: Tt
3342
3353
  },
3343
3354
  configurable: !0
3344
3355
  });
3345
- function qo(e) {
3346
- var t, n = e.Symbol;
3347
- if (typeof n == "function")
3348
- if (n.observable)
3349
- t = n.observable;
3356
+ function Bo(t) {
3357
+ var e, r = t.Symbol;
3358
+ if (typeof r == "function")
3359
+ if (r.observable)
3360
+ e = r.observable;
3350
3361
  else {
3351
- typeof n.for == "function" ? t = n.for("https://github.com/benlesh/symbol-observable") : t = n("https://github.com/benlesh/symbol-observable");
3362
+ typeof r.for == "function" ? e = r.for("https://github.com/benlesh/symbol-observable") : e = r("https://github.com/benlesh/symbol-observable");
3352
3363
  try {
3353
- n.observable = t;
3364
+ r.observable = e;
3354
3365
  } catch {
3355
3366
  }
3356
3367
  }
3357
3368
  else
3358
- t = "@@observable";
3359
- return t;
3369
+ e = "@@observable";
3370
+ return e;
3360
3371
  }
3361
- var _e;
3362
- typeof self < "u" ? _e = self : typeof window < "u" ? _e = window : typeof global < "u" ? _e = global : typeof module < "u" ? _e = module : _e = Function("return this")();
3363
- qo(_e);
3364
- var dn = U.prototype, pn = "@@observable";
3365
- dn[pn] || (dn[pn] = function() {
3372
+ var _t;
3373
+ typeof self < "u" ? _t = self : typeof window < "u" ? _t = window : typeof global < "u" ? _t = global : typeof module < "u" ? _t = module : _t = Function("return this")();
3374
+ Bo(_t);
3375
+ var dr = M.prototype, fr = "@@observable";
3376
+ dr[fr] || (dr[fr] = function() {
3366
3377
  return this;
3367
3378
  });
3368
- function Bo(e) {
3369
- for (var t = [
3379
+ function qo(t) {
3380
+ for (var e = [
3370
3381
  "query",
3371
3382
  "operationName",
3372
3383
  "variables",
3373
3384
  "extensions",
3374
3385
  "context"
3375
- ], n = 0, r = Object.keys(e); n < r.length; n++) {
3376
- var o = r[n];
3377
- if (t.indexOf(o) < 0)
3378
- throw Hn(58, o);
3386
+ ], r = 0, n = Object.keys(t); r < n.length; r++) {
3387
+ var o = n[r];
3388
+ if (e.indexOf(o) < 0)
3389
+ throw Br(58, o);
3379
3390
  }
3380
- return e;
3391
+ return t;
3381
3392
  }
3382
- function Ho(e, t) {
3383
- var n = ae({}, e), r = function(s) {
3384
- typeof s == "function" ? n = ae(ae({}, n), s(n)) : n = ae(ae({}, n), s);
3393
+ function Ro(t, e) {
3394
+ var r = st({}, t), n = function(a) {
3395
+ typeof a == "function" ? r = st(st({}, r), a(r)) : r = st(st({}, r), a);
3385
3396
  }, o = function() {
3386
- return ae({}, n);
3397
+ return st({}, r);
3387
3398
  };
3388
- return Object.defineProperty(t, "setContext", {
3399
+ return Object.defineProperty(e, "setContext", {
3389
3400
  enumerable: !1,
3390
- value: r
3391
- }), Object.defineProperty(t, "getContext", {
3401
+ value: n
3402
+ }), Object.defineProperty(e, "getContext", {
3392
3403
  enumerable: !1,
3393
3404
  value: o
3394
- }), t;
3395
- }
3396
- function Ro(e) {
3397
- var t = {
3398
- variables: e.variables || {},
3399
- extensions: e.extensions || {},
3400
- operationName: e.operationName,
3401
- query: e.query
3405
+ }), e;
3406
+ }
3407
+ function Ho(t) {
3408
+ var e = {
3409
+ variables: t.variables || {},
3410
+ extensions: t.extensions || {},
3411
+ operationName: t.operationName,
3412
+ query: t.query
3402
3413
  };
3403
- return t.operationName || (t.operationName = typeof t.query != "string" ? To(t.query) || void 0 : ""), t;
3414
+ return e.operationName || (e.operationName = typeof e.query != "string" ? To(e.query) || void 0 : ""), e;
3404
3415
  }
3405
- var zo = Symbol.for("apollo.deprecations"), Vo = xt, Jo = new Tt();
3406
- function Ko(e) {
3407
- return Vo[zo] || (Jo.getValue() || []).includes(e);
3416
+ var Vo = Symbol.for("apollo.deprecations"), Yo = xe, Jo = new Ee();
3417
+ function Ko(t) {
3418
+ return Yo[Vo] || (Jo.getValue() || []).includes(t);
3408
3419
  }
3409
- function Go(e, t) {
3410
- Ko(e) || t();
3420
+ function Go(t, e) {
3421
+ Ko(t) || e();
3411
3422
  }
3412
- function hn(e, t) {
3413
- return t ? t(e) : U.of();
3423
+ function pr(t, e) {
3424
+ return e ? e(t) : M.of();
3414
3425
  }
3415
- function De(e) {
3416
- return typeof e == "function" ? new Kn(e) : e;
3426
+ function zt(t) {
3427
+ return typeof t == "function" ? new Yr(t) : t;
3417
3428
  }
3418
- function ze(e) {
3419
- return e.request.length <= 1;
3429
+ function Ht(t) {
3430
+ return t.request.length <= 1;
3420
3431
  }
3421
- var Kn = (
3432
+ var Yr = (
3422
3433
  /** @class */
3423
3434
  (function() {
3424
- function e(t) {
3425
- t && (this.request = t);
3435
+ function t(e) {
3436
+ e && (this.request = e);
3426
3437
  }
3427
- return e.empty = function() {
3428
- return new e(function() {
3429
- return U.of();
3438
+ return t.empty = function() {
3439
+ return new t(function() {
3440
+ return M.of();
3430
3441
  });
3431
- }, e.from = function(t) {
3432
- return t.length === 0 ? e.empty() : t.map(De).reduce(function(n, r) {
3433
- return n.concat(r);
3442
+ }, t.from = function(e) {
3443
+ return e.length === 0 ? t.empty() : e.map(zt).reduce(function(r, n) {
3444
+ return r.concat(n);
3434
3445
  });
3435
- }, e.split = function(t, n, r) {
3436
- var o = De(n), s = De(r || new e(hn)), i;
3437
- return ze(o) && ze(s) ? i = new e(function(c) {
3438
- return t(c) ? o.request(c) || U.of() : s.request(c) || U.of();
3439
- }) : i = new e(function(c, a) {
3440
- return t(c) ? o.request(c, a) || U.of() : s.request(c, a) || U.of();
3441
- }), Object.assign(i, { left: o, right: s });
3442
- }, e.execute = function(t, n) {
3443
- return t.request(Ho(n.context, Ro(Bo(n)))) || U.of();
3444
- }, e.concat = function(t, n) {
3445
- var r = De(t);
3446
- if (ze(r))
3447
- return globalThis.__DEV__ !== !1 && lt.warn(47, r), r;
3448
- var o = De(n), s;
3449
- return ze(o) ? s = new e(function(i) {
3450
- return r.request(i, function(c) {
3451
- return o.request(c) || U.of();
3452
- }) || U.of();
3453
- }) : s = new e(function(i, c) {
3454
- return r.request(i, function(a) {
3455
- return o.request(a, c) || U.of();
3456
- }) || U.of();
3457
- }), Object.assign(s, { left: r, right: o });
3458
- }, e.prototype.split = function(t, n, r) {
3459
- return this.concat(e.split(t, n, r || new e(hn)));
3460
- }, e.prototype.concat = function(t) {
3461
- return e.concat(this, t);
3462
- }, e.prototype.request = function(t, n) {
3463
- throw Hn(48);
3464
- }, e.prototype.onError = function(t, n) {
3446
+ }, t.split = function(e, r, n) {
3447
+ var o = zt(r), a = zt(n || new t(pr)), i;
3448
+ return Ht(o) && Ht(a) ? i = new t(function(c) {
3449
+ return e(c) ? o.request(c) || M.of() : a.request(c) || M.of();
3450
+ }) : i = new t(function(c, s) {
3451
+ return e(c) ? o.request(c, s) || M.of() : a.request(c, s) || M.of();
3452
+ }), Object.assign(i, { left: o, right: a });
3453
+ }, t.execute = function(e, r) {
3454
+ return e.request(Ro(r.context, Ho(qo(r)))) || M.of();
3455
+ }, t.concat = function(e, r) {
3456
+ var n = zt(e);
3457
+ if (Ht(n))
3458
+ return globalThis.__DEV__ !== !1 && le.warn(47, n), n;
3459
+ var o = zt(r), a;
3460
+ return Ht(o) ? a = new t(function(i) {
3461
+ return n.request(i, function(c) {
3462
+ return o.request(c) || M.of();
3463
+ }) || M.of();
3464
+ }) : a = new t(function(i, c) {
3465
+ return n.request(i, function(s) {
3466
+ return o.request(s, c) || M.of();
3467
+ }) || M.of();
3468
+ }), Object.assign(a, { left: n, right: o });
3469
+ }, t.prototype.split = function(e, r, n) {
3470
+ return this.concat(t.split(e, r, n || new t(pr)));
3471
+ }, t.prototype.concat = function(e) {
3472
+ return t.concat(this, e);
3473
+ }, t.prototype.request = function(e, r) {
3474
+ throw Br(48);
3475
+ }, t.prototype.onError = function(e, r) {
3465
3476
  if (globalThis.__DEV__ !== !1 && Go("onError", function() {
3466
- globalThis.__DEV__ !== !1 && lt.warn(49);
3467
- }), n && n.error)
3468
- return n.error(t), !1;
3469
- throw t;
3470
- }, e.prototype.setOnError = function(t) {
3471
- return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && lt.warn(50), this.onError = t, this;
3472
- }, e;
3477
+ globalThis.__DEV__ !== !1 && le.warn(49);
3478
+ }), r && r.error)
3479
+ return r.error(e), !1;
3480
+ throw e;
3481
+ }, t.prototype.setOnError = function(e) {
3482
+ return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && le.warn(50), this.onError = e, this;
3483
+ }, t;
3473
3484
  })()
3474
3485
  );
3475
- function Wo(e) {
3476
- return new Kn(function(t, n) {
3477
- var r = Io(t, []);
3478
- return new U(function(o) {
3479
- var s, i = !1;
3480
- return Promise.resolve(r).then(function(c) {
3481
- return e(c, t.getContext());
3482
- }).then(t.setContext).then(function() {
3483
- i || (s = n(t).subscribe({
3486
+ function Wo(t) {
3487
+ return new Yr(function(e, r) {
3488
+ var n = Io(e, []);
3489
+ return new M(function(o) {
3490
+ var a, i = !1;
3491
+ return Promise.resolve(n).then(function(c) {
3492
+ return t(c, e.getContext());
3493
+ }).then(e.setContext).then(function() {
3494
+ i || (a = r(e).subscribe({
3484
3495
  next: o.next.bind(o),
3485
3496
  error: o.error.bind(o),
3486
3497
  complete: o.complete.bind(o)
3487
3498
  }));
3488
3499
  }).catch(o.error.bind(o)), function() {
3489
- i = !0, s && s.unsubscribe();
3500
+ i = !0, a && a.unsubscribe();
3490
3501
  };
3491
3502
  });
3492
3503
  });
3493
3504
  }
3494
3505
  const Qo = async () => {
3495
- const e = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", r = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
3506
+ const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
3496
3507
  try {
3497
- const o = await q.post(
3498
- e,
3508
+ const o = await U.post(
3509
+ t,
3499
3510
  new URLSearchParams({ grant_type: "client_credentials" }),
3500
3511
  // Only grant_type in body
3501
3512
  {
3502
3513
  headers: {
3503
3514
  "Content-Type": "application/x-www-form-urlencoded",
3504
- Authorization: r
3515
+ Authorization: n
3505
3516
  }
3506
3517
  }
3507
3518
  );
3508
3519
  return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
3509
3520
  } catch (o) {
3510
- return q.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
3521
+ return U.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
3511
3522
  }
3512
- }, Yo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Zo = Zn({
3513
- uri: `${Yo}`
3514
- }), Xo = Wo(async (e, { headers: t }) => {
3515
- const n = await Qo();
3523
+ }, Xo = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Zo = Qr({
3524
+ uri: `${Xo}`
3525
+ }), ta = Wo(async (t, { headers: e }) => {
3526
+ const r = await Qo();
3516
3527
  return {
3517
3528
  headers: {
3518
- ...t,
3519
- authorization: `Bearer ${n}`
3529
+ ...e,
3530
+ authorization: `Bearer ${r}`
3520
3531
  }
3521
3532
  };
3522
- }), es = new Xn({
3523
- link: Xo.concat(Zo),
3524
- cache: new er(),
3533
+ }), ea = new Xr({
3534
+ link: ta.concat(Zo),
3535
+ cache: new Zr(),
3525
3536
  defaultOptions: {
3526
3537
  watchQuery: {
3527
3538
  fetchPolicy: "cache-and-network"
3528
3539
  }
3529
3540
  }
3530
- }), gs = () => /* @__PURE__ */ l(tr, { client: es, children: /* @__PURE__ */ l(lr, { children: /* @__PURE__ */ l(So, {}) }) });
3541
+ }), ya = () => /* @__PURE__ */ l(tn, { client: ea, children: /* @__PURE__ */ l(un, { children: /* @__PURE__ */ l(So, {}) }) });
3531
3542
  export {
3532
- gs as TanyaChatbot
3543
+ ya as TanyaChatbot,
3544
+ pa as TanyaChatbotProvider
3533
3545
  };
3534
3546
  //# sourceMappingURL=tanya-chatbot.es.js.map