tanya-chatbot 0.5.0 → 0.5.2

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,18 +1,18 @@
1
- import { useEffect as L, useState as P, useRef as Ft } from "react";
1
+ import { useEffect as M, useState as z, useRef as Ft } from "react";
2
2
  import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
3
3
  import { createHttpLink as lr, ApolloClient as cr, InMemoryCache as dr, ApolloProvider as ur } from "@apollo/client";
4
- import { Provider as pr, useDispatch as De, useSelector as Ht } from "react-redux";
4
+ import { Provider as pr, useDispatch as De, useSelector as Vt } from "react-redux";
5
5
  import { createSlice as Le, configureStore as fr } from "@reduxjs/toolkit";
6
6
  import * as Be from "@radix-ui/react-popover";
7
7
  import "clsx";
8
8
  import "tailwind-merge";
9
- import T from "axios";
9
+ import E from "axios";
10
10
  import "crypto-js";
11
11
  import { Icon as be } from "@iconify/react";
12
- import { toast as B } from "react-toastify";
12
+ import { toast as H } from "react-toastify";
13
13
  const hr = '*,: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-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.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;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
14
  function ko() {
15
- return L(() => {
15
+ return M(() => {
16
16
  if (typeof document < "u") {
17
17
  const t = document.createElement("style");
18
18
  return t.textContent = hr, document.head.appendChild(t), () => {
@@ -78,7 +78,7 @@ const mr = {
78
78
  store: wr,
79
79
  product: br
80
80
  }
81
- }), yr = ({ children: t }) => /* @__PURE__ */ a(pr, { store: xr, children: t }), Vt = (t) => {
81
+ }), yr = ({ children: t }) => /* @__PURE__ */ a(pr, { store: xr, children: t }), Rt = (t) => {
82
82
  const e = new CustomEvent("reactCartUpdated", {
83
83
  detail: {
84
84
  cartUpdated: !0,
@@ -97,21 +97,21 @@ function kr({
97
97
  }) {
98
98
  return /* @__PURE__ */ a(Be.Trigger, { "data-slot": "popover-trigger", ...t });
99
99
  }
100
- const kt = () => ({ 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" }), Me = async () => {
100
+ const St = () => ({ 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" }), Me = async () => {
101
101
  const t = "https://tanya-sfcc-server.vercel.app/";
102
102
  try {
103
- const e = await T.post(
104
- `${t}api/auth/token-bm-grant?baseUrl=${X()}&siteId=${R()}`
103
+ const e = await E.post(
104
+ `${t}api/auth/token-bm-grant?baseUrl=${tt()}&siteId=${J()}`
105
105
  );
106
106
  return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
107
107
  } catch (e) {
108
- return T.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
108
+ return E.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
109
109
  }
110
110
  }, He = async (t) => {
111
111
  const e = "https://tanya-sfcc-server.vercel.app/";
112
112
  try {
113
- const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await T.post(
114
- `${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${X()}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
113
+ const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await E.post(
114
+ `${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${tt()}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
115
115
  {},
116
116
  {
117
117
  headers: {
@@ -122,26 +122,26 @@ const kt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
122
122
  );
123
123
  return o.status === 200 && o.data ? o.data : null;
124
124
  } catch (r) {
125
- return T.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
125
+ return E.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
126
126
  }
127
127
  };
128
- async function Pt() {
128
+ async function Ot() {
129
129
  var c;
130
- const t = R(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
130
+ const t = J(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
131
131
  return console.log(n), (c = JSON.parse(sessionStorage.getItem("customerData") || "{}")) != null && c.isGuest, console.log("access token found in local storage"), { access_token: n, expires_in: o };
132
132
  }
133
- const X = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem("SiteId"), at = () => sessionStorage.getItem("pubCfg"), it = () => sessionStorage.getItem("envRef"), st = () => sessionStorage.getItem("orgRef"), xe = async (t) => {
133
+ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getItem("SiteId"), it = () => sessionStorage.getItem("pubCfg"), st = () => sessionStorage.getItem("envRef"), lt = () => sessionStorage.getItem("orgRef"), xe = async (t) => {
134
134
  console.log("fetching results");
135
- const { serverUrl: e, basePath: r } = kt();
135
+ const { serverUrl: e, basePath: r } = St();
136
136
  let o = "";
137
137
  {
138
- const n = await Pt();
138
+ const n = await Ot();
139
139
  console.log("the token from getSearchResults", n), o = n.access_token;
140
140
  }
141
141
  try {
142
- const n = X();
143
- return (await T.get(
144
- `${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
142
+ const n = tt();
143
+ return (await E.get(
144
+ `${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
145
145
  {
146
146
  headers: {
147
147
  "Content-Type": "application/json",
@@ -154,11 +154,11 @@ const X = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
154
154
  }
155
155
  }, Ve = async (t) => {
156
156
  if (!t) throw new Error("Product ID is required");
157
- const { serverUrl: e, basePath: r } = kt(), o = X();
157
+ const { serverUrl: e, basePath: r } = St(), o = tt();
158
158
  console.log("calling access");
159
- const { access_token: n } = await Pt();
160
- return console.log(n), (await T.get(
161
- `${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
159
+ const { access_token: n } = await Ot();
160
+ return console.log(n), (await E.get(
161
+ `${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
162
162
  {
163
163
  headers: {
164
164
  "Content-Type": "application/json",
@@ -170,9 +170,9 @@ const X = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
170
170
  if (!t) throw new Error("customerId is required");
171
171
  const e = await Me(), { customer_token: r } = await He(
172
172
  e
173
- ), { serverUrl: o, basePath: n } = kt(), l = (await Pt()).access_token;
174
- return (await T.get(
175
- `${o}${n}/get-interest?baseUrl=${X()}&customerId=${t}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
173
+ ), { serverUrl: o, basePath: n } = St(), l = (await Ot()).access_token;
174
+ return (await E.get(
175
+ `${o}${n}/get-interest?baseUrl=${tt()}&customerId=${t}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
176
176
  {
177
177
  headers: {
178
178
  "Content-Type": "application/json",
@@ -197,8 +197,8 @@ const X = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
197
197
  return o ? `<p key=${r} class="mb-2"><strong>${o[1]}.</strong> ${o[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
198
198
  }).join("");
199
199
  function Ir() {
200
- const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = P(t);
201
- return L(() => {
200
+ const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = z(t);
201
+ return M(() => {
202
202
  const o = () => r(t());
203
203
  return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
204
204
  }, []), e;
@@ -206,7 +206,7 @@ function Ir() {
206
206
  const Fr = ({
207
207
  product: t
208
208
  }) => {
209
- const e = De(), r = Ir(), [o, n] = P(0), c = () => {
209
+ const e = De(), r = Ir(), [o, n] = z(0), c = () => {
210
210
  n(
211
211
  (i) => i + r >= t.length ? 0 : i + r
212
212
  );
@@ -215,8 +215,8 @@ const Fr = ({
215
215
  (i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
216
216
  );
217
217
  }, d = async (i) => {
218
- const v = await Ve(i);
219
- e(oe(v));
218
+ const y = await Ve(i);
219
+ e(oe(y));
220
220
  };
221
221
  return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
222
222
  (t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
@@ -233,7 +233,7 @@ const Fr = ({
233
233
  }
234
234
  ),
235
235
  /* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
236
- var v, k, C, _;
236
+ var y, v, C, S;
237
237
  return /* @__PURE__ */ u(
238
238
  "div",
239
239
  {
@@ -245,7 +245,7 @@ const Fr = ({
245
245
  /* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
246
246
  "img",
247
247
  {
248
- src: ((v = ve(i)[0]) == null ? void 0 : v.link) || ve(i)[0] || // fallback if it's a string
248
+ src: ((y = ve(i)[0]) == null ? void 0 : y.link) || ve(i)[0] || // fallback if it's a string
249
249
  "https://via.placeholder.com/120",
250
250
  alt: i != null && i.productName ? i.productName : "Product",
251
251
  className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
@@ -258,7 +258,7 @@ const Fr = ({
258
258
  children: [
259
259
  /* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
260
260
  /* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : Se(
261
- ye((k = i == null ? void 0 : i.name) == null ? void 0 : k["en-US"]),
261
+ ye((v = i == null ? void 0 : i.name) == null ? void 0 : v["en-US"]),
262
262
  60
263
263
  ) || "Product" }),
264
264
  /* @__PURE__ */ a(
@@ -282,7 +282,7 @@ const Fr = ({
282
282
  /* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
283
283
  /* @__PURE__ */ a("p", { children: _r(
284
284
  i != null && i.price ? Number(i == null ? void 0 : i.price) : ke(i).centAmount || 0,
285
- (_ = ke(i)) == null ? void 0 : _.currencyCode
285
+ (S = ke(i)) == null ? void 0 : S.currencyCode
286
286
  ) }),
287
287
  /* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
288
288
  "$",
@@ -339,12 +339,12 @@ const Fr = ({
339
339
  o
340
340
  )) }), Re = async (t, e) => {
341
341
  var c, l;
342
- const { serverUrl: r, basePath: o } = kt(), n = `${r}`;
342
+ const { serverUrl: r, basePath: o } = St(), n = `${r}`;
343
343
  console.log(`customer_token
344
344
  `, t);
345
345
  try {
346
- const d = await T.post(
347
- `${n}${o}/basket/create?baseUrl=${X()}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
346
+ const d = await E.post(
347
+ `${n}${o}/basket/create?baseUrl=${tt()}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
348
348
  e,
349
349
  {
350
350
  headers: {
@@ -361,13 +361,13 @@ const Fr = ({
361
361
  "*"
362
362
  ), d.data;
363
363
  } catch (d) {
364
- return T.isAxiosError(d) ? console.error("Error creating basket:", d.response || d.message) : console.error("Unexpected error:", d), null;
364
+ return E.isAxiosError(d) ? console.error("Error creating basket:", d.response || d.message) : console.error("Unexpected error:", d), null;
365
365
  }
366
366
  }, ne = async (t, e, r) => {
367
- const { serverUrl: o, basePath: n } = kt(), c = `${o}`;
367
+ const { serverUrl: o, basePath: n } = St(), c = `${o}`;
368
368
  try {
369
- const l = await T.post(
370
- `${c}${n}/basket/add-product/${t}?baseUrl=${X()}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
369
+ const l = await E.post(
370
+ `${c}${n}/basket/add-product/${t}?baseUrl=${tt()}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
371
371
  e,
372
372
  {
373
373
  headers: {
@@ -378,7 +378,7 @@ const Fr = ({
378
378
  );
379
379
  return l.status === 200 && l.data ? l.data : null;
380
380
  } catch (l) {
381
- return T.isAxiosError(l) ? console.error(
381
+ return E.isAxiosError(l) ? console.error(
382
382
  "Error adding products to basket:",
383
383
  l.response || l.message
384
384
  ) : console.error("Unexpected error:", l), null;
@@ -388,10 +388,10 @@ const Fr = ({
388
388
  customer_token: e
389
389
  }) => {
390
390
  var c;
391
- const { serverUrl: r, basePath: o } = kt(), n = `${r}`;
391
+ const { serverUrl: r, basePath: o } = St(), n = `${r}`;
392
392
  try {
393
- const l = await T.get(
394
- `${n}${o}/basket/${t}?baseUrl=${X()}&siteId=${R()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
393
+ const l = await E.get(
394
+ `${n}${o}/basket/${t}?baseUrl=${tt()}&siteId=${J()}&pubCfg=${it()}&envRef=${st()}&orgRef=${lt()}`,
395
395
  {
396
396
  headers: {
397
397
  "Content-Type": "application/json",
@@ -401,145 +401,145 @@ const Fr = ({
401
401
  );
402
402
  return { status: l.status, data: l.data };
403
403
  } catch (l) {
404
- return T.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
404
+ return E.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
405
405
  }
406
- }, Rt = "sfcc_basket_id", _e = "sfcc_customer_token", Ot = "sfcc_token_expiry", Er = 300 * 1e3, Nt = "1.0.0";
407
- const nt = (t) => {
406
+ }, Yt = "sfcc_basket_id", _e = "sfcc_customer_token", Pt = "sfcc_token_expiry", Er = 300 * 1e3, Nt = "1.0.0";
407
+ const at = (t) => {
408
408
  try {
409
- t ? localStorage.setItem(Rt, t) : localStorage.removeItem(Rt);
409
+ t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
410
410
  } catch (e) {
411
411
  console.error("Error saving basket ID to storage:", e);
412
412
  }
413
- }, Yt = (t) => {
413
+ }, Kt = (t) => {
414
414
  try {
415
415
  if (t) {
416
416
  localStorage.setItem(_e, t);
417
417
  const e = Date.now() + Er;
418
- localStorage.setItem(Ot, e.toString());
418
+ localStorage.setItem(Pt, e.toString());
419
419
  } else
420
420
  localStorage.removeItem(_e);
421
421
  } catch (e) {
422
422
  console.error("Error storing token:", e);
423
423
  }
424
- }, Ce = 300, Tr = () => {
425
- var d, i, v, k, C, _;
426
- const t = De(), e = Ht((I) => I.product.product), r = Ht((I) => I.store.store), [o, n] = P(!!e);
427
- if (L(() => {
428
- n(!!e);
429
- }, [e]), !e) return null;
430
- const c = async () => {
431
- var I, z, Q, St, lt, U, ct, _t, $t, Z, Ct, It, dt, zt, At, tt;
432
- console.log(e, "the prod");
424
+ }, Ce = 300, Tr = ({ addToCartPwa: t }) => {
425
+ var i, y, v, C, S, j;
426
+ const e = De(), r = Vt((T) => T.product.product), o = Vt((T) => T.store.store), [n, c] = z(!!r);
427
+ if (M(() => {
428
+ c(!!r);
429
+ }, [r]), !r) return null;
430
+ const l = async () => {
431
+ var T, D, W, ct, V, dt, _t, $t, et, Ct, It, ut, zt, At, rt, P;
432
+ console.log(r, "the prod");
433
433
  try {
434
- if (!((z = (I = e == null ? void 0 : e.variants) == null ? void 0 : I[0]) != null && z.product_id) && !(e.type.item || e.type.bundle) && !((St = (Q = e == null ? void 0 : e.variants) == null ? void 0 : Q[0]) != null && St.productId)) {
435
- B.error("Variants not available", {
434
+ if (!((D = (T = r == null ? void 0 : r.variants) == null ? void 0 : T[0]) != null && D.product_id) && !(r.type.item || r.type.bundle) && !((ct = (W = r == null ? void 0 : r.variants) == null ? void 0 : W[0]) != null && ct.productId)) {
435
+ H.error("Variants not available", {
436
436
  position: "bottom-right",
437
437
  autoClose: 1e3
438
438
  }), console.error("No product variant found");
439
439
  return;
440
440
  }
441
- const b = [
441
+ const _ = [
442
442
  {
443
- product_id: ((lt = e.variants) == null ? void 0 : lt[0].product_id) || ((U = e.variants) == null ? void 0 : U[0].productId) || (e == null ? void 0 : e.id),
443
+ product_id: ((V = r.variants) == null ? void 0 : V[0].product_id) || ((dt = r.variants) == null ? void 0 : dt[0].productId) || (r == null ? void 0 : r.id),
444
444
  quantity: 1
445
445
  }
446
446
  ];
447
- console.log(b, "the product data");
448
- const et = JSON.parse(
447
+ console.log(_, "the product data");
448
+ const k = JSON.parse(
449
449
  sessionStorage.getItem("customerData") || "{}"
450
- ), S = (et == null ? void 0 : et.basketId) || localStorage.getItem(Rt), Jt = !1, jt = localStorage.getItem(Ot), Dt = Date.now();
451
- if (!Jt || !jt || Dt >= parseInt(jt)) {
452
- let q = "";
450
+ ), ot = (k == null ? void 0 : k.basketId) || localStorage.getItem(Yt), Wt = !1, jt = localStorage.getItem(Pt), Dt = Date.now();
451
+ if (!Wt || !jt || Dt >= parseInt(jt)) {
452
+ let $ = "";
453
453
  {
454
- const pt = await Pt();
455
- console.log("token from auth data"), q = "Bearer " + pt.access_token;
454
+ const ft = await Ot();
455
+ console.log("token from auth data"), $ = "Bearer " + ft.access_token;
456
456
  }
457
- if (!q) {
457
+ if (!$) {
458
458
  console.error("Failed to get customer_token");
459
459
  return;
460
460
  }
461
- const rt = Dt + 300 * 1e3;
462
- if (Yt(q), localStorage.setItem(Ot, rt.toString()), S) {
463
- const pt = await Ye({
464
- basketId: S,
465
- customer_token: q
461
+ const pt = Dt + 300 * 1e3;
462
+ if (Kt($), localStorage.setItem(Pt, pt.toString()), ot) {
463
+ const ft = await Ye({
464
+ basketId: ot,
465
+ customer_token: $
466
466
  });
467
- if (console.log(S, "basket id from customer"), pt.status === 200 && pt) {
468
- const K = await ne(
469
- S,
470
- b,
471
- q
467
+ if (console.log(ot, "basket id from customer"), ft.status === 200 && ft) {
468
+ const L = await ne(
469
+ ot,
470
+ _,
471
+ $
472
472
  );
473
- (((ct = K == null ? void 0 : K.product_items) == null ? void 0 : ct.length) > 0 || ((_t = K == null ? void 0 : K.productItems) == null ? void 0 : _t.length) > 0) && (B.success("Added to cart", {
473
+ (((_t = L == null ? void 0 : L.product_items) == null ? void 0 : _t.length) > 0 || (($t = L == null ? void 0 : L.productItems) == null ? void 0 : $t.length) > 0) && (H.success("Added to cart", {
474
474
  position: "bottom-right",
475
475
  autoClose: 3e3,
476
476
  hideProgressBar: !1,
477
477
  closeOnClick: !0,
478
478
  pauseOnHover: !0,
479
479
  draggable: !0
480
- }), Vt(S));
480
+ }), Rt(ot));
481
481
  return;
482
482
  }
483
483
  }
484
- const ut = {
484
+ const Lt = {
485
485
  productItems: [
486
486
  {
487
- productId: (($t = e.variants) == null ? void 0 : $t[0].product_id) || ((Z = e.variants) == null ? void 0 : Z[0].productId) || (e == null ? void 0 : e.id),
487
+ productId: ((et = r.variants) == null ? void 0 : et[0].product_id) || ((Ct = r.variants) == null ? void 0 : Ct[0].productId) || (r == null ? void 0 : r.id),
488
488
  quantity: 1
489
489
  }
490
490
  ]
491
491
  };
492
492
  console.log("before create basket");
493
- const p = await Re(q, ut);
493
+ const h = await Re($, Lt);
494
494
  if (console.log(
495
- p,
496
- p == null ? void 0 : p.basket_id,
497
- p == null ? void 0 : p.basketId,
495
+ h,
496
+ h == null ? void 0 : h.basket_id,
497
+ h == null ? void 0 : h.basketId,
498
498
  "the basket response"
499
- ), !(p != null && p.basket_id) && !(p != null && p.basketId)) {
499
+ ), !(h != null && h.basket_id) && !(h != null && h.basketId)) {
500
500
  console.error("Failed to create basket");
501
501
  return;
502
502
  }
503
503
  console.log(
504
504
  "setting stored id",
505
- (p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId)
506
- ), nt(
507
- (p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId)
505
+ (h == null ? void 0 : h.basket_id) || (h == null ? void 0 : h.basketId)
506
+ ), at(
507
+ (h == null ? void 0 : h.basket_id) || (h == null ? void 0 : h.basketId)
508
508
  ), console.log("adding product to basket");
509
- const Y = await ne(
510
- (p == null ? void 0 : p.basket_id) || (p == null ? void 0 : p.basketId),
511
- b,
512
- q
509
+ const G = await ne(
510
+ (h == null ? void 0 : h.basket_id) || (h == null ? void 0 : h.basketId),
511
+ _,
512
+ $
513
513
  );
514
- console.log("object added to basket"), (((Ct = Y == null ? void 0 : Y.product_items) == null ? void 0 : Ct.length) > 0 || ((It = Y == null ? void 0 : Y.productItems) == null ? void 0 : It.length) > 0) && B.success("Added to cart", {
514
+ console.log("object added to basket"), (((It = G == null ? void 0 : G.product_items) == null ? void 0 : It.length) > 0 || ((ut = G == null ? void 0 : G.productItems) == null ? void 0 : ut.length) > 0) && H.success("Added to cart", {
515
515
  position: "bottom-right",
516
516
  autoClose: 3e3,
517
517
  hideProgressBar: !1,
518
518
  closeOnClick: !0,
519
519
  pauseOnHover: !0,
520
520
  draggable: !0
521
- }), Vt(p.basket_id || (p == null ? void 0 : p.basketId));
521
+ }), Rt(h.basket_id || (h == null ? void 0 : h.basketId));
522
522
  }
523
- } catch (b) {
524
- console.error("Error adding to cart:", b), B.error("Failed to add product to cart", {
523
+ } catch (_) {
524
+ console.error("Error adding to cart:", _), H.error("Failed to add product to cart", {
525
525
  position: "bottom-right",
526
526
  autoClose: 3e3
527
- }), ((dt = b == null ? void 0 : b.response) == null ? void 0 : dt.status) === 404 || // Basket not found
528
- ((zt = b == null ? void 0 : b.response) == null ? void 0 : zt.status) === 401 ? (((At = b == null ? void 0 : b.response) == null ? void 0 : At.status) === 404 && nt(null), ((tt = b == null ? void 0 : b.response) == null ? void 0 : tt.status) === 401 && (nt(null), Yt(null))) : (console.error("Failed to add product to basket:", b.message), B.error("Failed to add product to cart", {
527
+ }), ((zt = _ == null ? void 0 : _.response) == null ? void 0 : zt.status) === 404 || // Basket not found
528
+ ((At = _ == null ? void 0 : _.response) == null ? void 0 : At.status) === 401 ? (((rt = _ == null ? void 0 : _.response) == null ? void 0 : rt.status) === 404 && at(null), ((P = _ == null ? void 0 : _.response) == null ? void 0 : P.status) === 401 && (at(null), Kt(null))) : (console.error("Failed to add product to basket:", _.message), H.error("Failed to add product to cart", {
529
529
  position: "bottom-right",
530
530
  autoClose: 3e3
531
531
  }));
532
532
  }
533
- }, l = () => {
534
- e && (window.location.href = e.c_pdpUrl);
533
+ }, d = () => {
534
+ r && (window.location.href = r.c_pdpUrl);
535
535
  };
536
- return console.log(e, "the prod"), /* @__PURE__ */ u(re, { children: [
536
+ return console.log(r, "the prod"), /* @__PURE__ */ u(re, { children: [
537
537
  /* @__PURE__ */ a(
538
538
  "div",
539
539
  {
540
540
  className: "fixed inset-0 z-40 bg-black/30",
541
541
  onClick: () => {
542
- n(!1), setTimeout(() => t(oe(null)), Ce);
542
+ c(!1), setTimeout(() => e(oe(null)), Ce);
543
543
  }
544
544
  }
545
545
  ),
@@ -549,21 +549,21 @@ const nt = (t) => {
549
549
  className: `
550
550
  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
551
551
  transition-all duration-300
552
- ${o ? "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"}
552
+ ${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"}
553
553
  `,
554
554
  style: { willChange: "transform, opacity" },
555
- onClick: (I) => I.stopPropagation(),
555
+ onClick: (T) => T.stopPropagation(),
556
556
  children: [
557
557
  /* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
558
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
558
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
559
559
  /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
560
560
  be,
561
561
  {
562
562
  icon: "mdi:close",
563
563
  className: "text-[#555555] w-6 h-6 cursor-pointer",
564
564
  onClick: () => {
565
- n(!1), setTimeout(
566
- () => t(oe(null)),
565
+ c(!1), setTimeout(
566
+ () => e(oe(null)),
567
567
  Ce
568
568
  );
569
569
  }
@@ -574,20 +574,20 @@ const nt = (t) => {
574
574
  /* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
575
575
  "img",
576
576
  {
577
- src: (k = (v = (i = (d = e.imageGroups) == null ? void 0 : d[0]) == null ? void 0 : i.images) == null ? void 0 : v[0]) == null ? void 0 : k.link,
578
- alt: e.name,
577
+ src: (C = (v = (y = (i = r.imageGroups) == null ? void 0 : i[0]) == null ? void 0 : y.images) == null ? void 0 : v[0]) == null ? void 0 : C.link,
578
+ alt: r.name,
579
579
  className: "rounded-[10px]"
580
580
  }
581
581
  ) }),
582
- /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
583
- (I) => I.images.slice(1, 2).map((z) => /* @__PURE__ */ a(
582
+ /* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
583
+ (T) => T.images.slice(1, 2).map((D) => /* @__PURE__ */ a(
584
584
  "img",
585
585
  {
586
- src: z.link,
587
- alt: e.name,
586
+ src: D.link,
587
+ alt: r.name,
588
588
  className: "rounded-[10px] w-[60px] h-[60px]"
589
589
  },
590
- z.link
590
+ D.link
591
591
  ))
592
592
  ) })
593
593
  ] }),
@@ -596,16 +596,16 @@ const nt = (t) => {
596
596
  /* @__PURE__ */ u("p", { className: "text-[#14121F] font-bold font-nunitoSans", children: [
597
597
  " ",
598
598
  "$",
599
- e.price.toFixed(2)
599
+ r.price.toFixed(2)
600
600
  ] }),
601
601
  " ",
602
602
  /* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans", children: [
603
603
  " ",
604
604
  "$",
605
- (e.price + 5).toFixed(2)
605
+ (r.price + 5).toFixed(2)
606
606
  ] })
607
607
  ] }),
608
- /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: e.discount }) })
608
+ /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#EC5050] font-bold font-nunitoSans", children: r.discount }) })
609
609
  ] }),
610
610
  /* @__PURE__ */ a("div", { className: "mt-2 w-full border-t-2 border-gray-200" }),
611
611
  /* @__PURE__ */ u("div", { className: "w-full text-left", children: [
@@ -615,7 +615,7 @@ const nt = (t) => {
615
615
  {
616
616
  className: "text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",
617
617
  dangerouslySetInnerHTML: {
618
- __html: e.short_description || e.longDescription
618
+ __html: r.short_description || r.longDescription
619
619
  }
620
620
  }
621
621
  )
@@ -623,19 +623,19 @@ const nt = (t) => {
623
623
  /* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
624
624
  /* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
625
625
  /* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
626
- ((C = e == null ? void 0 : e.rating) == null ? void 0 : C.rate) || 0,
626
+ ((S = r == null ? void 0 : r.rating) == null ? void 0 : S.rate) || 0,
627
627
  " /",
628
628
  " ",
629
629
  /* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
630
630
  ] }),
631
631
  /* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
632
632
  /* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
633
- ((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.count) || 0,
633
+ ((j = r == null ? void 0 : r.rating) == null ? void 0 : j.count) || 0,
634
634
  " ratings"
635
635
  ] })
636
636
  ] }) }),
637
- /* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((I, z) => {
638
- var Q;
637
+ /* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((T, D) => {
638
+ var W;
639
639
  return /* @__PURE__ */ a(
640
640
  be,
641
641
  {
@@ -643,10 +643,10 @@ const nt = (t) => {
643
643
  width: "20",
644
644
  height: "20",
645
645
  className: `text-yellow-500
646
- ${((Q = e == null ? void 0 : e.rating) == null ? void 0 : Q.rate) > z ? "text-yellow-500" : "text-gray-300"}
646
+ ${((W = r == null ? void 0 : r.rating) == null ? void 0 : W.rate) > D ? "text-yellow-500" : "text-gray-300"}
647
647
  `
648
648
  },
649
- z
649
+ D
650
650
  );
651
651
  }) })
652
652
  ] }),
@@ -660,8 +660,8 @@ const nt = (t) => {
660
660
  "button",
661
661
  {
662
662
  className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
663
- style: { backgroundColor: r.tanyaThemeColor },
664
- onClick: c,
663
+ style: { backgroundColor: o.tanyaThemeColor },
664
+ onClick: l,
665
665
  children: "Add to Cart"
666
666
  }
667
667
  ),
@@ -669,8 +669,8 @@ const nt = (t) => {
669
669
  "button",
670
670
  {
671
671
  className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
672
- style: { backgroundColor: r.tanyaThemeColor },
673
- onClick: l,
672
+ style: { backgroundColor: o.tanyaThemeColor },
673
+ onClick: d,
674
674
  children: "View more"
675
675
  }
676
676
  )
@@ -681,7 +681,7 @@ const nt = (t) => {
681
681
  }
682
682
  )
683
683
  ] });
684
- }, Or = ({
684
+ }, Pr = ({
685
685
  tanyaConfig: t,
686
686
  basketId: e,
687
687
  addToCart: r
@@ -700,13 +700,13 @@ const nt = (t) => {
700
700
  "Niece/Nephew": "his/her niece/nephew",
701
701
  "My Friends": "his/her friends",
702
702
  Others: "others"
703
- }, c = Ft(null), l = Ft(null), d = Ft(null), i = Ft(null), [v, k] = P(null), [C, _] = P(!1), [I, z] = P(!1), [Q, St] = P(!1), [lt, U] = P(!1), [ct, _t] = P(!1), [$t, Z] = P(!1), [Ct, It] = P(""), [dt, zt] = P(""), At = (s) => ({
703
+ }, c = Ft(null), l = Ft(null), d = Ft(null), i = Ft(null), [y, v] = z(null), [C, S] = z(!1), [j, T] = z(!1), [D, W] = z(!1), [ct, V] = z(!1), [dt, _t] = z(!1), [$t, et] = z(!1), [Ct, It] = z(""), [ut, zt] = z(""), At = (s) => ({
704
704
  id: s.id,
705
705
  title: s.name,
706
706
  image: s.image ?? "",
707
707
  price: s.price ?? 0
708
- }), [tt, b] = P([]), et = Ft(null), S = Ht((s) => s.store.store), Jt = Ht((s) => s.product.product);
709
- L(() => {
708
+ }), [rt, P] = z([]), _ = Ft(null), k = Vt((s) => s.store.store), ot = Vt((s) => s.product.product);
709
+ M(() => {
710
710
  const s = localStorage.getItem(
711
711
  `access_token_${t.siteId}`
712
712
  ), g = localStorage.getItem(
@@ -714,37 +714,37 @@ const nt = (t) => {
714
714
  );
715
715
  if (s && g === s) {
716
716
  const m = localStorage.getItem("chatHistory");
717
- m && b(JSON.parse(m));
717
+ m && P(JSON.parse(m));
718
718
  } else
719
719
  localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
720
720
  `chat-token-${t.siteId}`,
721
721
  s || ""
722
722
  );
723
- }, []), L(() => {
724
- localStorage.setItem("chatHistory", JSON.stringify(tt));
723
+ }, []), M(() => {
724
+ localStorage.setItem("chatHistory", JSON.stringify(rt));
725
725
  const s = localStorage.getItem(
726
726
  `access_token_${t.siteId}`
727
727
  );
728
728
  s && localStorage.setItem(`chat-token-${t.siteId}`, s);
729
- }, [tt]);
730
- const jt = () => {
731
- St(!0), setTimeout(() => z(!0), 10);
732
- }, Dt = () => {
733
- z(!1), setTimeout(() => St(!1), 300);
729
+ }, [rt]);
730
+ const Wt = () => {
731
+ W(!0), setTimeout(() => T(!0), 10);
732
+ }, jt = () => {
733
+ T(!1), setTimeout(() => W(!1), 300);
734
734
  };
735
- L(() => {
736
- C ? jt() : Dt();
735
+ M(() => {
736
+ C ? Wt() : jt();
737
737
  }, [C]);
738
- const q = (s) => {
738
+ const Dt = (s) => {
739
739
  zt(n[s]);
740
740
  };
741
- L(() => {
742
- et.current && (et.current.scrollTop += 150);
743
- }, [tt]);
744
- let rt = null, ut = null;
745
- const p = async () => {
746
- if (rt && ut && Date.now() < ut)
747
- return rt;
741
+ M(() => {
742
+ _.current && (_.current.scrollTop += 150);
743
+ }, [rt]);
744
+ let $ = null, pt = null;
745
+ const Lt = async () => {
746
+ if ($ && pt && Date.now() < pt)
747
+ return $;
748
748
  try {
749
749
  const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", g = new URLSearchParams({
750
750
  grant_type: "client_credentials",
@@ -762,52 +762,52 @@ const nt = (t) => {
762
762
  throw new Error(
763
763
  `Token request failed! status: ${m.status}`
764
764
  );
765
- const x = await m.json();
766
- rt = x.access_token;
767
- const f = x.expires_in || 3600;
768
- return ut = Date.now() + (f - 60) * 1e3, rt;
765
+ const b = await m.json();
766
+ $ = b.access_token;
767
+ const p = b.expires_in || 3600;
768
+ return pt = Date.now() + (p - 60) * 1e3, $;
769
769
  } catch (s) {
770
- return console.error("Error obtaining JWT token:", s), rt = null, ut = null, null;
770
+ return console.error("Error obtaining JWT token:", s), $ = null, pt = null, null;
771
771
  }
772
- }, Y = async () => {
773
- const s = await Pt();
774
- s != null && k(s);
772
+ }, h = async () => {
773
+ const s = await Ot();
774
+ s != null && v(s);
775
775
  };
776
- L(() => {
776
+ M(() => {
777
777
  if (t != null && t.siteId) {
778
- const { clientID: s, host: g, organizationID: m, shortCode: x, siteId: f } = t;
779
- sessionStorage.setItem("Host", g), sessionStorage.setItem("SiteId", f), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", x), sessionStorage.setItem("orgRef", m);
778
+ const { clientID: s, host: g, organizationID: m, shortCode: b, siteId: p } = t;
779
+ sessionStorage.setItem("Host", g), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", b), sessionStorage.setItem("orgRef", m);
780
780
  }
781
- Y(), console.log("scapi environment v1");
782
- }, []), L(() => {
783
- e && (console.log("setting the basket id", e), nt(e));
784
- }, [e]), L(() => {
781
+ h(), console.log("scapi environment v1");
782
+ }, []), M(() => {
783
+ e && (console.log("setting the basket id", e), at(e));
784
+ }, [e]), M(() => {
785
785
  const s = async () => {
786
- _(!1);
786
+ S(!1);
787
787
  };
788
788
  return window.addEventListener("reactCartUpdated", s), () => window.removeEventListener("reactCartUpdated", s);
789
789
  }, []);
790
- const pt = async () => {
790
+ const G = async () => {
791
791
  const s = JSON.parse(
792
792
  sessionStorage.getItem("customerData") || "{}"
793
793
  ).customerId;
794
794
  return (await Sr(s || "")).c_interests;
795
- }, K = async (s, g) => {
795
+ }, ft = async (s, g) => {
796
796
  console.log("in secondary flow", Nt);
797
- const m = await pt();
797
+ const m = await G();
798
798
  if (console.log(m, "interests of customer", Nt), !!m)
799
799
  try {
800
- b(
801
- (D) => D.map(
802
- (M, H) => H === D.length - 1 ? { ...M, secondaryLoading: !0 } : M
800
+ P(
801
+ (q) => q.map(
802
+ (R, Y) => Y === q.length - 1 ? { ...R, secondaryLoading: !0 } : R
803
803
  )
804
804
  );
805
- const x = await p();
806
- if (!x) throw new Error("Failed to fetch token");
807
- const f = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
805
+ const b = await Lt();
806
+ if (!b) throw new Error("Failed to fetch token");
807
+ const p = localStorage.getItem("customerNumber"), w = localStorage.getItem("isLoggedIn"), ht = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
808
808
  registered: String(w || !1),
809
- userId: String(f || (/* @__PURE__ */ new Date()).getTime())
810
- }).toString()}`, ht = JSON.stringify({
809
+ userId: String(p || (/* @__PURE__ */ new Date()).getTime())
810
+ }).toString()}`, mt = JSON.stringify({
811
811
  flowId: "Q166PR519W",
812
812
  flowAliasId: "HKFUVLWVH2",
813
813
  input: {
@@ -816,55 +816,55 @@ const nt = (t) => {
816
816
  productPoints: String(g || 0),
817
817
  interests: m
818
818
  }
819
- }), A = await fetch(ft, {
819
+ }), B = await fetch(ht, {
820
820
  signal: AbortSignal.timeout(3e4),
821
821
  method: "POST",
822
822
  headers: {
823
823
  "Content-Type": "application/json",
824
- Authorization: `Bearer ${x}`
824
+ Authorization: `Bearer ${b}`
825
825
  },
826
- body: ht
826
+ body: mt
827
827
  });
828
- if (!A.body) throw new Error("Readable stream not supported");
829
- const mt = A.body.getReader(), wt = new TextDecoder();
830
- let j = "";
828
+ if (!B.body) throw new Error("Readable stream not supported");
829
+ const wt = B.body.getReader(), gt = new TextDecoder();
830
+ let U = "";
831
831
  for (; ; ) {
832
- const { done: D, value: M } = await mt.read();
833
- if (D) break;
834
- j += wt.decode(M, { stream: !0 });
835
- const H = j.split(`
832
+ const { done: q, value: R } = await wt.read();
833
+ if (q) break;
834
+ U += gt.decode(R, { stream: !0 });
835
+ const Y = U.split(`
836
836
  `);
837
- j = H.pop() || "";
838
- for (const J of H)
839
- if (J.startsWith("data:")) {
840
- const h = J.slice(5).trim();
837
+ U = Y.pop() || "";
838
+ for (const X of Y)
839
+ if (X.startsWith("data:")) {
840
+ const f = X.slice(5).trim();
841
841
  try {
842
- const V = JSON.parse(h);
843
- V.index === 0 && b(
844
- (F) => F.map(
845
- (O, W) => W === F.length - 1 ? {
842
+ const K = JSON.parse(f);
843
+ K.index === 0 && P(
844
+ (I) => I.map(
845
+ (O, Q) => Q === I.length - 1 ? {
846
846
  ...O,
847
- secondaryResponse: V.data,
847
+ secondaryResponse: K.data,
848
848
  secondaryLoading: !1
849
849
  } : O
850
850
  )
851
851
  );
852
- } catch (V) {
853
- b(
854
- (F) => F.map(
855
- (O, W) => W === F.length - 1 ? { ...O, secondaryLoading: !1 } : O
852
+ } catch (K) {
853
+ P(
854
+ (I) => I.map(
855
+ (O, Q) => Q === I.length - 1 ? { ...O, secondaryLoading: !1 } : O
856
856
  )
857
- ), console.error("Secondary flow JSON parse error:", V);
857
+ ), console.error("Secondary flow JSON parse error:", K);
858
858
  }
859
859
  }
860
860
  }
861
- } catch (x) {
862
- console.error("Secondary flow error:", x);
861
+ } catch (b) {
862
+ console.error("Secondary flow error:", b);
863
863
  }
864
- }, Wt = async (s) => {
864
+ }, L = async (s) => {
865
865
  const g = s || Ct.trim();
866
866
  if (g) {
867
- _t(!0), It(""), c.current = null, l.current = null, d.current = null, i.current = null, b((m) => [
867
+ _t(!0), It(""), c.current = null, l.current = null, d.current = null, i.current = null, P((m) => [
868
868
  ...m,
869
869
  {
870
870
  query: g,
@@ -875,60 +875,60 @@ const nt = (t) => {
875
875
  }
876
876
  ]);
877
877
  try {
878
- const m = dt, x = localStorage.getItem("customerNumber"), f = localStorage.getItem("isLoggedIn"), w = await p();
878
+ const m = ut, b = localStorage.getItem("customerNumber"), p = localStorage.getItem("isLoggedIn"), w = await Lt();
879
879
  if (!w)
880
880
  throw new Error("Failed to obtain access token");
881
- const ft = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
882
- registered: String(f || !1),
883
- userId: String(x || (/* @__PURE__ */ new Date()).getTime())
884
- }).toString()}`, ht = JSON.stringify({
881
+ const ht = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
882
+ registered: String(p || !1),
883
+ userId: String(b || (/* @__PURE__ */ new Date()).getTime())
884
+ }).toString()}`, mt = JSON.stringify({
885
885
  flowId: "MMHQKYI1NE",
886
886
  flowAliasId: "SZF9ZK1ATE",
887
887
  input: {
888
888
  userPrompt: g,
889
889
  whom: m
890
890
  }
891
- }), A = await fetch(ft, {
891
+ }), B = await fetch(ht, {
892
892
  signal: AbortSignal.timeout(3e4),
893
893
  method: "POST",
894
894
  headers: {
895
895
  "Content-Type": "application/json",
896
896
  Authorization: `Bearer ${w}`
897
897
  },
898
- body: ht
898
+ body: mt
899
899
  });
900
- if (!A.ok)
901
- throw new Error(`HTTP error! status: ${A.status}`);
902
- if (!A.body) throw new Error("Readable stream not supported");
903
- const mt = A.body.getReader(), wt = new TextDecoder();
904
- let j = "", D = "";
900
+ if (!B.ok)
901
+ throw new Error(`HTTP error! status: ${B.status}`);
902
+ if (!B.body) throw new Error("Readable stream not supported");
903
+ const wt = B.body.getReader(), gt = new TextDecoder();
904
+ let U = "", q = "";
905
905
  for (; ; ) {
906
- Z(!0);
907
- const { done: M, value: H } = await mt.read();
908
- if (M) break;
909
- j += wt.decode(H, { stream: !0 });
910
- const J = j.split(`
906
+ et(!0);
907
+ const { done: R, value: Y } = await wt.read();
908
+ if (R) break;
909
+ U += gt.decode(Y, { stream: !0 });
910
+ const X = U.split(`
911
911
  `);
912
- j = J.pop() || "";
913
- for (const h of J)
914
- if (h.startsWith("data:")) {
915
- const V = h.slice(5).trim();
912
+ U = X.pop() || "";
913
+ for (const f of X)
914
+ if (f.startsWith("data:")) {
915
+ const K = f.slice(5).trim();
916
916
  try {
917
- const F = JSON.parse(V);
918
- F.index == 1 && (D = F.data), b(
917
+ const I = JSON.parse(K);
918
+ I.index == 1 && (q = I.data), P(
919
919
  (O) => O.map(
920
- (W, Lt) => Lt === O.length - 1 ? {
921
- ...W,
922
- [F.index == 0 ? "response" : F.index == 1 ? "keywords" : F.index == 2 ? "potentialQuestions" : "end"]: F.data
923
- } : W
920
+ (Q, Bt) => Bt === O.length - 1 ? {
921
+ ...Q,
922
+ [I.index == 0 ? "response" : I.index == 1 ? "keywords" : I.index == 2 ? "potentialQuestions" : "end"]: I.data
923
+ } : Q
924
924
  )
925
925
  );
926
- } catch (F) {
927
- console.error("Error parsing JSON:", F);
926
+ } catch (I) {
927
+ console.error("Error parsing JSON:", I);
928
928
  }
929
929
  }
930
930
  }
931
- or(rr(D));
931
+ or(rr(q));
932
932
  } catch (m) {
933
933
  console.error("Error sending message to Tanya:", m);
934
934
  } finally {
@@ -938,51 +938,51 @@ const nt = (t) => {
938
938
  }, rr = (s) => {
939
939
  const g = s.match(
940
940
  /top five relevant product or category names are: (.*)/i
941
- ), f = (g ? g[1] : s).split(", ").map(($) => $.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
942
- return [...new Set(f)].filter(Boolean).join(",");
941
+ ), p = (g ? g[1] : s).split(", ").map((A) => A.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
942
+ return [...new Set(p)].filter(Boolean).join(",");
943
943
  }, or = async (s) => {
944
944
  if (typeof s == "string") {
945
945
  console.log(s, "keywords");
946
946
  const g = s.split(",");
947
947
  for (const m of g) {
948
- const x = await xe(m);
949
- if (Z(!1), (x == null ? void 0 : x.length) > 0 && (b(
950
- (f) => f.map(
951
- (w, $) => $ === f.length - 1 ? {
948
+ const b = await xe(m);
949
+ if (et(!1), (b == null ? void 0 : b.length) > 0 && (P(
950
+ (p) => p.map(
951
+ (w, A) => A === p.length - 1 ? {
952
952
  ...w,
953
953
  products: [
954
954
  ...w.products || [],
955
- { keyword: m, items: x, loading: !1 }
955
+ { keyword: m, items: b, loading: !1 }
956
956
  ]
957
957
  } : w
958
958
  )
959
959
  ), !c.current || l.current == null)) {
960
- const f = x[0];
961
- c.current = String((f == null ? void 0 : f.product_name) ?? ""), d.current = f.image.link, l.current = f.product_id;
962
- const w = typeof (f == null ? void 0 : f.price) == "number" ? f.price : void 0;
960
+ const p = b[0];
961
+ c.current = String((p == null ? void 0 : p.product_name) ?? ""), d.current = p.image.link, l.current = p.product_id;
962
+ const w = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
963
963
  i.current = typeof w == "number" && Number.isFinite(w) ? w : null;
964
964
  }
965
965
  }
966
966
  } else
967
967
  for (const g of s) {
968
968
  const m = await xe(g);
969
- Z(!1), (m == null ? void 0 : m.length) > 0 && b(
970
- (x) => x.map(
971
- (f, w) => w === x.length - 1 ? {
972
- ...f,
969
+ et(!1), (m == null ? void 0 : m.length) > 0 && P(
970
+ (b) => b.map(
971
+ (p, w) => w === b.length - 1 ? {
972
+ ...p,
973
973
  products: [
974
- ...f.products || [],
974
+ ...p.products || [],
975
975
  { keyword: g, items: m, loading: !1 }
976
976
  ]
977
- } : f
977
+ } : p
978
978
  )
979
979
  );
980
980
  }
981
981
  if (c.current) {
982
- b(
982
+ P(
983
983
  (m) => m.map(
984
- (x, f) => f === m.length - 1 ? {
985
- ...x,
984
+ (b, p) => p === m.length - 1 ? {
985
+ ...b,
986
986
  productSnapshot: {
987
987
  id: l.current,
988
988
  name: c.current,
@@ -991,122 +991,122 @@ const nt = (t) => {
991
991
  points: 0,
992
992
  quantity: 1
993
993
  }
994
- } : x
994
+ } : b
995
995
  )
996
996
  );
997
997
  const g = JSON.parse(
998
998
  sessionStorage.getItem("customerData") || "{}"
999
999
  );
1000
- (g == null ? void 0 : g.isGuest) == !1 ? (console.log("running secondary flow", Nt), K(c.current, 0)) : console.log("not running secondary flow", Nt);
1000
+ (g == null ? void 0 : g.isGuest) == !1 ? (console.log("running secondary flow", Nt), ft(c.current, 0)) : console.log("not running secondary flow", Nt);
1001
1001
  }
1002
- Z(!1);
1002
+ et(!1);
1003
1003
  }, nr = async (s, g) => {
1004
- var m, x, f, w, $, ft, ht, A, mt, wt, j, D, M, H, J;
1005
- U(!0);
1004
+ var m, b, p, w, A, ht, mt, B, wt, gt, U, q, R, Y, X;
1005
+ V(!0);
1006
1006
  try {
1007
- const h = await Ve(s.id);
1008
- if (!((x = (m = h == null ? void 0 : h.variants) == null ? void 0 : m[0]) != null && x.product_id || (w = (f = h == null ? void 0 : h.variants) == null ? void 0 : f[0]) != null && w.productId) && !(h.type.item || h.type.bundle)) {
1009
- U(!1), B.error("Variants not found", {
1007
+ const f = await Ve(s.id);
1008
+ if (!((b = (m = f == null ? void 0 : f.variants) == null ? void 0 : m[0]) != null && b.product_id || (w = (p = f == null ? void 0 : f.variants) == null ? void 0 : p[0]) != null && w.productId) && !(f.type.item || f.type.bundle)) {
1009
+ V(!1), H.error("Variants not found", {
1010
1010
  position: "bottom-right",
1011
1011
  autoClose: 1e3
1012
1012
  }), console.error("No product variant found");
1013
1013
  return;
1014
1014
  }
1015
- const V = [
1015
+ const K = [
1016
1016
  {
1017
- product_id: (($ = h.variants) == null ? void 0 : $[0].product_id) || ((ft = h.variants) == null ? void 0 : ft[0].productId) || (h == null ? void 0 : h.id),
1017
+ product_id: ((A = f.variants) == null ? void 0 : A[0].product_id) || ((ht = f.variants) == null ? void 0 : ht[0].productId) || (f == null ? void 0 : f.id),
1018
1018
  quantity: g
1019
1019
  }
1020
1020
  ];
1021
- console.log(V, "product data", "app version", Nt);
1022
- const F = JSON.parse(
1021
+ console.log(K, "product data", "app version", Nt);
1022
+ const I = JSON.parse(
1023
1023
  sessionStorage.getItem("customerData") || "{}"
1024
- ), O = (F == null ? void 0 : F.basketId) || localStorage.getItem(Rt), W = !1, Lt = localStorage.getItem(Ot), we = Date.now();
1025
- if (!W || !Lt || we >= parseInt(Lt)) {
1024
+ ), O = (I == null ? void 0 : I.basketId) || localStorage.getItem(Yt), Q = !1, Bt = localStorage.getItem(Pt), we = Date.now();
1025
+ if (!Q || !Bt || we >= parseInt(Bt)) {
1026
1026
  const ar = await Me();
1027
- let { customer_token: gt } = await He(
1027
+ let { customer_token: bt } = await He(
1028
1028
  ar
1029
1029
  );
1030
- if (gt = "Bearer " + v.access_token, !gt) {
1030
+ if (bt = "Bearer " + y.access_token, !bt) {
1031
1031
  console.error("Failed to get customer_token");
1032
1032
  return;
1033
1033
  }
1034
1034
  const ir = we + 300 * 1e3;
1035
- if (Yt(gt), localStorage.setItem(Ot, ir.toString()), console.log(O, "basketIdFromCustomer"), O) {
1035
+ if (Kt(bt), localStorage.setItem(Pt, ir.toString()), console.log(O, "basketIdFromCustomer"), O) {
1036
1036
  const ge = await Ye({
1037
1037
  basketId: O,
1038
- customer_token: gt
1038
+ customer_token: bt
1039
1039
  });
1040
1040
  if (ge.status === 200 && ge) {
1041
1041
  const Gt = await ne(
1042
1042
  O,
1043
- V,
1044
- gt
1043
+ K,
1044
+ bt
1045
1045
  );
1046
- ((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (B.success("Added to cart", {
1046
+ ((mt = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : mt.length) > 0 && (H.success("Added to cart", {
1047
1047
  position: "bottom-right",
1048
1048
  autoClose: 3e3,
1049
1049
  hideProgressBar: !1,
1050
1050
  closeOnClick: !0,
1051
1051
  pauseOnHover: !0,
1052
1052
  draggable: !0
1053
- }), Vt(O), U(!1));
1053
+ }), Rt(O), V(!1));
1054
1054
  return;
1055
1055
  }
1056
1056
  }
1057
1057
  const sr = {
1058
1058
  productItems: [
1059
1059
  {
1060
- productId: ((A = h.variants) == null ? void 0 : A[0].product_id) || ((mt = h.variants) == null ? void 0 : mt[0].productId) || (h == null ? void 0 : h.id),
1060
+ productId: ((B = f.variants) == null ? void 0 : B[0].product_id) || ((wt = f.variants) == null ? void 0 : wt[0].productId) || (f == null ? void 0 : f.id),
1061
1061
  quantity: 1
1062
1062
  }
1063
1063
  ]
1064
- }, y = await Re(gt, sr);
1064
+ }, x = await Re(bt, sr);
1065
1065
  if (console.log(
1066
- y,
1067
- y == null ? void 0 : y.basket_id,
1068
- y == null ? void 0 : y.basketId,
1066
+ x,
1067
+ x == null ? void 0 : x.basket_id,
1068
+ x == null ? void 0 : x.basketId,
1069
1069
  "the basket response"
1070
- ), !(y != null && y.basket_id || !(y != null && y.basketId))) {
1071
- U(!1), console.error("Failed to create basket");
1070
+ ), !(x != null && x.basket_id || !(x != null && x.basketId))) {
1071
+ V(!1), console.error("Failed to create basket");
1072
1072
  return;
1073
1073
  }
1074
- nt(
1075
- (y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
1074
+ at(
1075
+ (x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
1076
1076
  );
1077
- const bt = await r(
1077
+ const xt = await r(
1078
1078
  {
1079
1079
  productId: l,
1080
1080
  quantity: g
1081
1081
  },
1082
- (y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
1082
+ (x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId)
1083
1083
  );
1084
- (((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((j = bt == null ? void 0 : bt.productItems) == null ? void 0 : j.length) > 0) && B.success("Added to cart", {
1084
+ (((gt = xt == null ? void 0 : xt.product_items) == null ? void 0 : gt.length) > 0 || ((U = xt == null ? void 0 : xt.productItems) == null ? void 0 : U.length) > 0) && H.success("Added to cart", {
1085
1085
  position: "bottom-right",
1086
1086
  autoClose: 3e3,
1087
1087
  hideProgressBar: !1,
1088
1088
  closeOnClick: !0,
1089
1089
  pauseOnHover: !0,
1090
1090
  draggable: !0
1091
- }), Vt(y.basket_id || (y == null ? void 0 : y.basketId));
1091
+ }), Rt(x.basket_id || (x == null ? void 0 : x.basketId));
1092
1092
  }
1093
- } catch (h) {
1094
- U(!1), console.error("Error adding to cart:", h), B.error("Failed to add product to cart", {
1093
+ } catch (f) {
1094
+ V(!1), console.error("Error adding to cart:", f), H.error("Failed to add product to cart", {
1095
1095
  position: "bottom-right",
1096
1096
  autoClose: 3e3
1097
- }), ((D = h == null ? void 0 : h.response) == null ? void 0 : D.status) === 404 || // Basket not found
1098
- ((M = h == null ? void 0 : h.response) == null ? void 0 : M.status) === 401 ? (((H = h == null ? void 0 : h.response) == null ? void 0 : H.status) === 404 && nt(null), ((J = h == null ? void 0 : h.response) == null ? void 0 : J.status) === 401 && (nt(null), Yt(null))) : (console.error("Failed to add product to basket:", h.message), B.error("Failed to add product to cart", {
1097
+ }), ((q = f == null ? void 0 : f.response) == null ? void 0 : q.status) === 404 || // Basket not found
1098
+ ((R = f == null ? void 0 : f.response) == null ? void 0 : R.status) === 401 ? (((Y = f == null ? void 0 : f.response) == null ? void 0 : Y.status) === 404 && at(null), ((X = f == null ? void 0 : f.response) == null ? void 0 : X.status) === 401 && (at(null), Kt(null))) : (console.error("Failed to add product to basket:", f.message), H.error("Failed to add product to cart", {
1099
1099
  position: "bottom-right",
1100
1100
  autoClose: 3e3
1101
1101
  }));
1102
1102
  }
1103
- U(!1);
1103
+ V(!1);
1104
1104
  };
1105
- return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(vr, { open: C, onOpenChange: _, children: [
1105
+ return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(vr, { open: C, onOpenChange: S, children: [
1106
1106
  /* @__PURE__ */ a(
1107
1107
  kr,
1108
1108
  {
1109
- onClick: () => _(!0),
1109
+ onClick: () => S(!0),
1110
1110
  style: {
1111
1111
  // background: storeDetails.tanyaThemeColor,
1112
1112
  },
@@ -1166,12 +1166,12 @@ const nt = (t) => {
1166
1166
  ) })
1167
1167
  }
1168
1168
  ),
1169
- Q && /* @__PURE__ */ u(re, { children: [
1169
+ D && /* @__PURE__ */ u(re, { children: [
1170
1170
  /* @__PURE__ */ a(
1171
1171
  "div",
1172
1172
  {
1173
1173
  className: "fixed inset-0 z-40 bg-black/30",
1174
- onClick: () => _(!1)
1174
+ onClick: () => S(!1)
1175
1175
  }
1176
1176
  ),
1177
1177
  /* @__PURE__ */ u(
@@ -1182,9 +1182,9 @@ const nt = (t) => {
1182
1182
  top-0 right-0
1183
1183
  transition-transform duration-300 ease-in-out
1184
1184
  lg:transform
1185
- ${I ? "lg:translate-x-0" : "lg:translate-x-full"}
1185
+ ${j ? "lg:translate-x-0" : "lg:translate-x-full"}
1186
1186
  // For mobile: animate from bottom
1187
- ${I ? "translate-y-0" : "translate-y-full"}
1187
+ ${j ? "translate-y-0" : "translate-y-full"}
1188
1188
  lg:translate-y-0
1189
1189
  `,
1190
1190
  style: {
@@ -1201,7 +1201,7 @@ const nt = (t) => {
1201
1201
  {
1202
1202
  style: {
1203
1203
  display: "flex",
1204
- color: S.tanyaThemeContrastColor,
1204
+ color: k.tanyaThemeContrastColor,
1205
1205
  alignItems: "center",
1206
1206
  gap: "0.5rem"
1207
1207
  },
@@ -1262,7 +1262,7 @@ const nt = (t) => {
1262
1262
  gap: "1.25rem",
1263
1263
  margin: "0.75rem"
1264
1264
  },
1265
- children: /* @__PURE__ */ a("button", { onClick: () => _(!1), children: /* @__PURE__ */ u(
1265
+ children: /* @__PURE__ */ a("button", { onClick: () => S(!1), children: /* @__PURE__ */ u(
1266
1266
  "svg",
1267
1267
  {
1268
1268
  width: "24",
@@ -1314,15 +1314,15 @@ const nt = (t) => {
1314
1314
  /* @__PURE__ */ u(
1315
1315
  "div",
1316
1316
  {
1317
- className: `flex flex-col h-full ${Jt ? "lg:w-2/3 w-full" : "w-full"}`,
1317
+ className: `flex flex-col h-full ${ot ? "lg:w-2/3 w-full" : "w-full"}`,
1318
1318
  children: [
1319
1319
  /* @__PURE__ */ u(
1320
1320
  "div",
1321
1321
  {
1322
- ref: et,
1322
+ ref: _,
1323
1323
  className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
1324
1324
  children: [
1325
- (S == null ? void 0 : S.whomRequired) && /* @__PURE__ */ u(
1325
+ (k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
1326
1326
  "div",
1327
1327
  {
1328
1328
  className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
@@ -1331,11 +1331,11 @@ const nt = (t) => {
1331
1331
  /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: o.map((s) => /* @__PURE__ */ a(
1332
1332
  "button",
1333
1333
  {
1334
- onClick: () => q(s),
1334
+ onClick: () => Dt(s),
1335
1335
  className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
1336
1336
  style: {
1337
- backgroundColor: dt === n[s] ? "#FFFFFF" : "#F3F3F3",
1338
- borderColor: dt === n[s] ? "#BBB3DD" : ""
1337
+ backgroundColor: ut === n[s] ? "#FFFFFF" : "#F3F3F3",
1338
+ borderColor: ut === n[s] ? "#BBB3DD" : ""
1339
1339
  },
1340
1340
  children: s
1341
1341
  },
@@ -1344,8 +1344,8 @@ const nt = (t) => {
1344
1344
  ]
1345
1345
  }
1346
1346
  ),
1347
- tt.map((s, g) => {
1348
- var m, x;
1347
+ rt.map((s, g) => {
1348
+ var m, b;
1349
1349
  return /* @__PURE__ */ u("div", { children: [
1350
1350
  /* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("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: s.query }) }),
1351
1351
  s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
@@ -1366,11 +1366,11 @@ const nt = (t) => {
1366
1366
  }
1367
1367
  ) }),
1368
1368
  $t && !s.response.includes("Thinking") && ((m = s.products) == null ? void 0 : m.length) == 0 && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("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" }) }),
1369
- (s == null ? void 0 : s.products) && ((x = s == null ? void 0 : s.products) == null ? void 0 : x.length) > 0 && /* @__PURE__ */ a(
1369
+ (s == null ? void 0 : s.products) && ((b = s == null ? void 0 : s.products) == null ? void 0 : b.length) > 0 && /* @__PURE__ */ a(
1370
1370
  Nr,
1371
1371
  {
1372
1372
  chat: s.products,
1373
- storeDetails: S
1373
+ storeDetails: k
1374
1374
  }
1375
1375
  ),
1376
1376
  s.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
@@ -1378,19 +1378,19 @@ const nt = (t) => {
1378
1378
  "p",
1379
1379
  {
1380
1380
  className: "font-nunitoSans font-bold text-sm text-[#494949]",
1381
- style: { color: S.themeDarkColor },
1381
+ style: { color: k.themeDarkColor },
1382
1382
  children: "Why not explore these inquiries..."
1383
1383
  }
1384
1384
  ),
1385
- s.potentialQuestions.split(",").map((f, w) => /* @__PURE__ */ a(
1385
+ s.potentialQuestions.split(",").map((p, w) => /* @__PURE__ */ a(
1386
1386
  "button",
1387
1387
  {
1388
- className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${S.themeDarkColor} m-1 rounded-xl px-2 py-1`,
1389
- onClick: () => Wt(f),
1388
+ className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
1389
+ onClick: () => L(p),
1390
1390
  style: {
1391
- backgroundColor: S.tanyaThemeColorLight
1391
+ backgroundColor: k.tanyaThemeColorLight
1392
1392
  },
1393
- children: f
1393
+ children: p
1394
1394
  },
1395
1395
  w
1396
1396
  ))
@@ -1413,7 +1413,7 @@ const nt = (t) => {
1413
1413
  "p",
1414
1414
  {
1415
1415
  className: "font-semibold tanya-pulse",
1416
- style: { color: S.themeDarkColor },
1416
+ style: { color: k.themeDarkColor },
1417
1417
  children: "I’ve found a special surprise crafted just for you… hang on a sec!"
1418
1418
  }
1419
1419
  ),
@@ -1421,7 +1421,7 @@ const nt = (t) => {
1421
1421
  "p",
1422
1422
  {
1423
1423
  className: "tanya-dots mt-1",
1424
- style: { color: S.themeDarkColor },
1424
+ style: { color: k.themeDarkColor },
1425
1425
  children: "• • •"
1426
1426
  }
1427
1427
  )
@@ -1434,7 +1434,7 @@ const nt = (t) => {
1434
1434
  {
1435
1435
  className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
1436
1436
  style: {
1437
- backgroundColor: S.tanyaThemeColorLight
1437
+ backgroundColor: k.tanyaThemeColorLight
1438
1438
  },
1439
1439
  dangerouslySetInnerHTML: {
1440
1440
  __html: Xt(
@@ -1449,7 +1449,7 @@ const nt = (t) => {
1449
1449
  {
1450
1450
  className: "flex gap-4 items-stretch rounded-2xl p-4",
1451
1451
  style: {
1452
- backgroundColor: S.tanyaThemeColorLight
1452
+ backgroundColor: k.tanyaThemeColorLight
1453
1453
  },
1454
1454
  children: [
1455
1455
  /* @__PURE__ */ a(
@@ -1476,7 +1476,7 @@ const nt = (t) => {
1476
1476
  /* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: s.productSnapshot.name }),
1477
1477
  /* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: s.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
1478
1478
  style: "currency",
1479
- currency: (S == null ? void 0 : S.currency) || "USD"
1479
+ currency: (k == null ? void 0 : k.currency) || "USD"
1480
1480
  }).format(
1481
1481
  s.productSnapshot.price
1482
1482
  ) : "" }),
@@ -1496,9 +1496,9 @@ const nt = (t) => {
1496
1496
  "button",
1497
1497
  {
1498
1498
  className: "px-3 py-1 text-sm",
1499
- onClick: () => b(
1500
- (f) => f.map(
1501
- (w, $) => $ === g && w.productSnapshot ? {
1499
+ onClick: () => P(
1500
+ (p) => p.map(
1501
+ (w, A) => A === g && w.productSnapshot ? {
1502
1502
  ...w,
1503
1503
  productSnapshot: {
1504
1504
  ...w.productSnapshot,
@@ -1512,7 +1512,7 @@ const nt = (t) => {
1512
1512
  ),
1513
1513
  style: {
1514
1514
  background: "transparent",
1515
- color: S.themeDarkColor
1515
+ color: k.themeDarkColor
1516
1516
  },
1517
1517
  children: "−"
1518
1518
  }
@@ -1522,9 +1522,9 @@ const nt = (t) => {
1522
1522
  "button",
1523
1523
  {
1524
1524
  className: "px-3 py-1 text-sm",
1525
- onClick: () => b(
1526
- (f) => f.map(
1527
- (w, $) => $ === g && w.productSnapshot ? {
1525
+ onClick: () => P(
1526
+ (p) => p.map(
1527
+ (w, A) => A === g && w.productSnapshot ? {
1528
1528
  ...w,
1529
1529
  productSnapshot: {
1530
1530
  ...w.productSnapshot,
@@ -1535,7 +1535,7 @@ const nt = (t) => {
1535
1535
  ),
1536
1536
  style: {
1537
1537
  background: "transparent",
1538
- color: S.themeDarkColor
1538
+ color: k.themeDarkColor
1539
1539
  },
1540
1540
  children: "+"
1541
1541
  }
@@ -1552,14 +1552,14 @@ const nt = (t) => {
1552
1552
  s.productSnapshot.quantity
1553
1553
  );
1554
1554
  },
1555
- disabled: lt,
1555
+ disabled: ct,
1556
1556
  className: "px-4 py-2 rounded-full font-medium",
1557
1557
  style: {
1558
- background: S.tanyaThemeColor,
1559
- color: (S == null ? void 0 : S.tanyaThemeContrastColor) || "#fff",
1560
- opacity: lt ? 0.8 : 1
1558
+ background: k.tanyaThemeColor,
1559
+ color: (k == null ? void 0 : k.tanyaThemeContrastColor) || "#fff",
1560
+ opacity: ct ? 0.8 : 1
1561
1561
  },
1562
- children: lt ? "Adding..." : "Add to cart"
1562
+ children: ct ? "Adding..." : "Add to cart"
1563
1563
  }
1564
1564
  )
1565
1565
  ] })
@@ -1591,7 +1591,7 @@ const nt = (t) => {
1591
1591
  autoFocus: !0,
1592
1592
  onChange: (s) => It(s.target.value),
1593
1593
  onKeyDown: (s) => {
1594
- s.key === "Enter" && !ct && Wt();
1594
+ s.key === "Enter" && !dt && L();
1595
1595
  }
1596
1596
  }
1597
1597
  ),
@@ -1599,16 +1599,16 @@ const nt = (t) => {
1599
1599
  "button",
1600
1600
  {
1601
1601
  type: "submit",
1602
- disabled: ct,
1602
+ disabled: dt,
1603
1603
  className: "p-3",
1604
- onClick: () => Wt(),
1605
- children: ct ? /* @__PURE__ */ a(
1604
+ onClick: () => L(),
1605
+ children: dt ? /* @__PURE__ */ a(
1606
1606
  "div",
1607
1607
  {
1608
1608
  className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
1609
1609
  style: {
1610
1610
  borderBottom: "2px solid",
1611
- color: S.tanyaThemeColor
1611
+ color: k.tanyaThemeColor
1612
1612
  }
1613
1613
  }
1614
1614
  ) : /* @__PURE__ */ a(
@@ -1636,7 +1636,7 @@ const nt = (t) => {
1636
1636
  ]
1637
1637
  }
1638
1638
  ),
1639
- /* @__PURE__ */ a(Tr, {})
1639
+ /* @__PURE__ */ a(Tr, { addToCartPwa: r })
1640
1640
  ] })
1641
1641
  ]
1642
1642
  }
@@ -1651,7 +1651,7 @@ var ae = function(t, e) {
1651
1651
  for (var n in o) Object.prototype.hasOwnProperty.call(o, n) && (r[n] = o[n]);
1652
1652
  }, ae(t, e);
1653
1653
  };
1654
- function Pr(t, e) {
1654
+ function Or(t, e) {
1655
1655
  if (typeof e != "function" && e !== null)
1656
1656
  throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
1657
1657
  ae(t, e);
@@ -1660,14 +1660,14 @@ function Pr(t, e) {
1660
1660
  }
1661
1661
  t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
1662
1662
  }
1663
- var G = function() {
1664
- return G = Object.assign || function(e) {
1663
+ var Z = function() {
1664
+ return Z = Object.assign || function(e) {
1665
1665
  for (var r, o = 1, n = arguments.length; o < n; o++) {
1666
1666
  r = arguments[o];
1667
1667
  for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (e[c] = r[c]);
1668
1668
  }
1669
1669
  return e;
1670
- }, G.apply(this, arguments);
1670
+ }, Z.apply(this, arguments);
1671
1671
  };
1672
1672
  function $r(t, e) {
1673
1673
  var r = {};
@@ -1682,7 +1682,7 @@ var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ?
1682
1682
  } : Ie, Ke = (
1683
1683
  /** @class */
1684
1684
  (function(t) {
1685
- Pr(e, t);
1685
+ Or(e, t);
1686
1686
  function e(r) {
1687
1687
  r === void 0 && (r = Qt);
1688
1688
  var o = t.call(this, typeof r == "number" ? Qt + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
@@ -1691,12 +1691,12 @@ var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ?
1691
1691
  return e;
1692
1692
  })(Error)
1693
1693
  );
1694
- function ot(t, e) {
1694
+ function nt(t, e) {
1695
1695
  if (!t)
1696
1696
  throw new Ke(e);
1697
1697
  }
1698
1698
  var Je = ["debug", "log", "warn", "error", "silent"], Ar = Je.indexOf("log");
1699
- function Bt(t) {
1699
+ function Ut(t) {
1700
1700
  return function() {
1701
1701
  if (Je.indexOf(t) >= Ar) {
1702
1702
  var e = console[t] || console.log;
@@ -1705,22 +1705,22 @@ function Bt(t) {
1705
1705
  };
1706
1706
  }
1707
1707
  (function(t) {
1708
- t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
1709
- })(ot || (ot = {}));
1708
+ t.debug = Ut("debug"), t.log = Ut("log"), t.warn = Ut("warn"), t.error = Ut("error");
1709
+ })(nt || (nt = {}));
1710
1710
  var We = "3.14.0";
1711
- function xt(t) {
1711
+ function yt(t) {
1712
1712
  try {
1713
1713
  return t();
1714
1714
  } catch {
1715
1715
  }
1716
1716
  }
1717
- const ie = xt(function() {
1717
+ const ie = yt(function() {
1718
1718
  return globalThis;
1719
- }) || xt(function() {
1719
+ }) || yt(function() {
1720
1720
  return window;
1721
- }) || xt(function() {
1721
+ }) || yt(function() {
1722
1722
  return self;
1723
- }) || xt(function() {
1723
+ }) || yt(function() {
1724
1724
  return global;
1725
1725
  }) || // We don't expect the Function constructor ever to be invoked at runtime, as
1726
1726
  // long as at least one of globalThis, window, self, or global is defined, so
@@ -1728,8 +1728,8 @@ const ie = xt(function() {
1728
1728
  // detect syntactic usage of the Function constructor. If you think you can
1729
1729
  // improve your static analysis to detect this obfuscation, think again. This
1730
1730
  // is an arms race you cannot win, at least not in JavaScript.
1731
- xt(function() {
1732
- return xt.constructor("return this")();
1731
+ yt(function() {
1732
+ return yt.constructor("return this")();
1733
1733
  });
1734
1734
  var Fe = /* @__PURE__ */ new Map();
1735
1735
  function jr(t) {
@@ -1742,7 +1742,7 @@ function Dr(t, e) {
1742
1742
  return n === void 0 ? r : n;
1743
1743
  }, e).split(JSON.stringify(r)).join("<undefined>");
1744
1744
  }
1745
- function Ut(t) {
1745
+ function qt(t) {
1746
1746
  return function(e) {
1747
1747
  for (var r = [], o = 1; o < arguments.length; o++)
1748
1748
  r[o - 1] = arguments[o];
@@ -1756,12 +1756,12 @@ function Ut(t) {
1756
1756
  var Zt = Object.assign(function(e, r) {
1757
1757
  for (var o = [], n = 2; n < arguments.length; n++)
1758
1758
  o[n - 2] = arguments[n];
1759
- e || ot(e, ce(r, o) || de(r, o));
1759
+ e || nt(e, ce(r, o) || de(r, o));
1760
1760
  }, {
1761
- debug: Ut(ot.debug),
1762
- log: Ut(ot.log),
1763
- warn: Ut(ot.warn),
1764
- error: Ut(ot.error)
1761
+ debug: qt(nt.debug),
1762
+ log: qt(nt.log),
1763
+ warn: qt(nt.warn),
1764
+ error: qt(nt.error)
1765
1765
  });
1766
1766
  function Ge(t) {
1767
1767
  for (var e = [], r = 1; r < arguments.length; r++)
@@ -1797,7 +1797,7 @@ function Lr(t) {
1797
1797
  return e.name.value;
1798
1798
  })[0] || null;
1799
1799
  }
1800
- let N = null;
1800
+ let F = null;
1801
1801
  const Ee = {};
1802
1802
  let Br = 1;
1803
1803
  const Ur = () => class {
@@ -1810,52 +1810,52 @@ const Ur = () => class {
1810
1810
  ].join(":");
1811
1811
  }
1812
1812
  hasValue() {
1813
- for (let e = N; e; e = e.parent)
1813
+ for (let e = F; e; e = e.parent)
1814
1814
  if (this.id in e.slots) {
1815
1815
  const r = e.slots[this.id];
1816
1816
  if (r === Ee)
1817
1817
  break;
1818
- return e !== N && (N.slots[this.id] = r), !0;
1818
+ return e !== F && (F.slots[this.id] = r), !0;
1819
1819
  }
1820
- return N && (N.slots[this.id] = Ee), !1;
1820
+ return F && (F.slots[this.id] = Ee), !1;
1821
1821
  }
1822
1822
  getValue() {
1823
1823
  if (this.hasValue())
1824
- return N.slots[this.id];
1824
+ return F.slots[this.id];
1825
1825
  }
1826
1826
  withValue(e, r, o, n) {
1827
1827
  const c = {
1828
1828
  __proto__: null,
1829
1829
  [this.id]: e
1830
- }, l = N;
1831
- N = { parent: l, slots: c };
1830
+ }, l = F;
1831
+ F = { parent: l, slots: c };
1832
1832
  try {
1833
1833
  return r.apply(n, o);
1834
1834
  } finally {
1835
- N = l;
1835
+ F = l;
1836
1836
  }
1837
1837
  }
1838
1838
  // Capture the current context and wrap a callback function so that it
1839
1839
  // reestablishes the captured context when called.
1840
1840
  static bind(e) {
1841
- const r = N;
1841
+ const r = F;
1842
1842
  return function() {
1843
- const o = N;
1843
+ const o = F;
1844
1844
  try {
1845
- return N = r, e.apply(this, arguments);
1845
+ return F = r, e.apply(this, arguments);
1846
1846
  } finally {
1847
- N = o;
1847
+ F = o;
1848
1848
  }
1849
1849
  };
1850
1850
  }
1851
1851
  // Immediately run a callback function without any captured context.
1852
1852
  static noContext(e, r, o) {
1853
- if (N) {
1854
- const n = N;
1853
+ if (F) {
1854
+ const n = F;
1855
1855
  try {
1856
- return N = null, e.apply(o, r);
1856
+ return F = null, e.apply(o, r);
1857
1857
  } finally {
1858
- N = n;
1858
+ F = n;
1859
1859
  }
1860
1860
  } else
1861
1861
  return e.apply(o, r);
@@ -1877,11 +1877,11 @@ const te = "@wry/context:Slot", qr = (
1877
1877
  // back to using the Array constructor as a namespace, but that was flagged in
1878
1878
  // https://github.com/benjamn/wryware/issues/347, and can be avoided.
1879
1879
  /* @__PURE__ */ Object.create(null)
1880
- ), Oe = qr, ue = Oe[te] || // Earlier versions of this package stored the globalKey property on the Array
1880
+ ), Pe = qr, ue = Pe[te] || // Earlier versions of this package stored the globalKey property on the Array
1881
1881
  // constructor, so we check there as well, to prevent Slot class duplication.
1882
1882
  Array[te] || (function(t) {
1883
1883
  try {
1884
- Object.defineProperty(Oe, te, {
1884
+ Object.defineProperty(Pe, te, {
1885
1885
  value: t,
1886
1886
  enumerable: !1,
1887
1887
  writable: !1,
@@ -1913,13 +1913,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1913
1913
  }
1914
1914
  function Hr(t, e) {
1915
1915
  if (t) {
1916
- if (typeof t == "string") return Pe(t, e);
1916
+ if (typeof t == "string") return Oe(t, e);
1917
1917
  var r = Object.prototype.toString.call(t).slice(8, -1);
1918
1918
  if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
1919
- if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Pe(t, e);
1919
+ if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Oe(t, e);
1920
1920
  }
1921
1921
  }
1922
- function Pe(t, e) {
1922
+ function Oe(t, e) {
1923
1923
  (e == null || e > t.length) && (e = t.length);
1924
1924
  for (var r = 0, o = new Array(e); r < e; r++)
1925
1925
  o[r] = t[r];
@@ -1943,7 +1943,7 @@ var fe = function() {
1943
1943
  };
1944
1944
  fe() && !he("observable") && (Symbol.observable = Symbol("observable"));
1945
1945
  var Vr = me("iterator"), se = me("observable"), Qe = me("species");
1946
- function Kt(t, e) {
1946
+ function Jt(t, e) {
1947
1947
  var r = t[e];
1948
1948
  if (r != null) {
1949
1949
  if (typeof r != "function") throw new TypeError(r + " is not a function");
@@ -1952,22 +1952,22 @@ function Kt(t, e) {
1952
1952
  }
1953
1953
  function Et(t) {
1954
1954
  var e = t.constructor;
1955
- return e !== void 0 && (e = e[Qe], e === null && (e = void 0)), e !== void 0 ? e : E;
1955
+ return e !== void 0 && (e = e[Qe], e === null && (e = void 0)), e !== void 0 ? e : N;
1956
1956
  }
1957
1957
  function Rr(t) {
1958
- return t instanceof E;
1958
+ return t instanceof N;
1959
1959
  }
1960
- function vt(t) {
1961
- vt.log ? vt.log(t) : setTimeout(function() {
1960
+ function kt(t) {
1961
+ kt.log ? kt.log(t) : setTimeout(function() {
1962
1962
  throw t;
1963
1963
  });
1964
1964
  }
1965
- function Mt(t) {
1965
+ function Ht(t) {
1966
1966
  Promise.resolve().then(function() {
1967
1967
  try {
1968
1968
  t();
1969
1969
  } catch (e) {
1970
- vt(e);
1970
+ kt(e);
1971
1971
  }
1972
1972
  });
1973
1973
  }
@@ -1978,11 +1978,11 @@ function Ze(t) {
1978
1978
  if (typeof e == "function")
1979
1979
  e();
1980
1980
  else {
1981
- var r = Kt(e, "unsubscribe");
1981
+ var r = Jt(e, "unsubscribe");
1982
1982
  r && r.call(e);
1983
1983
  }
1984
1984
  } catch (o) {
1985
- vt(o);
1985
+ kt(o);
1986
1986
  }
1987
1987
  }
1988
1988
  function le(t) {
@@ -2000,7 +2000,7 @@ function tr(t, e, r) {
2000
2000
  t._state = "running";
2001
2001
  var o = t._observer;
2002
2002
  try {
2003
- var n = Kt(o, e);
2003
+ var n = Jt(o, e);
2004
2004
  switch (e) {
2005
2005
  case "next":
2006
2006
  n && n.call(o, r);
@@ -2014,7 +2014,7 @@ function tr(t, e, r) {
2014
2014
  break;
2015
2015
  }
2016
2016
  } catch (c) {
2017
- vt(c);
2017
+ kt(c);
2018
2018
  }
2019
2019
  t._state === "closed" ? Ze(t) : t._state === "running" && (t._state = "ready");
2020
2020
  }
@@ -2031,7 +2031,7 @@ function ee(t, e, r) {
2031
2031
  t._state = "buffering", t._queue = [{
2032
2032
  type: e,
2033
2033
  value: r
2034
- }], Mt(function() {
2034
+ }], Ht(function() {
2035
2035
  return Yr(t);
2036
2036
  });
2037
2037
  return;
@@ -2076,7 +2076,7 @@ var Kr = /* @__PURE__ */ (function() {
2076
2076
  return this._subscription._state === "closed";
2077
2077
  }
2078
2078
  }]), t;
2079
- })(), E = /* @__PURE__ */ (function() {
2079
+ })(), N = /* @__PURE__ */ (function() {
2080
2080
  function t(r) {
2081
2081
  if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
2082
2082
  if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
@@ -2100,11 +2100,11 @@ var Kr = /* @__PURE__ */ (function() {
2100
2100
  i.unsubscribe(), c();
2101
2101
  }
2102
2102
  var i = n.subscribe({
2103
- next: function(v) {
2103
+ next: function(y) {
2104
2104
  try {
2105
- o(v, d);
2106
- } catch (k) {
2107
- l(k), i.unsubscribe();
2105
+ o(y, d);
2106
+ } catch (v) {
2107
+ l(v), i.unsubscribe();
2108
2108
  }
2109
2109
  },
2110
2110
  error: l,
@@ -2158,26 +2158,26 @@ var Kr = /* @__PURE__ */ (function() {
2158
2158
  }, e.reduce = function(o) {
2159
2159
  var n = this;
2160
2160
  if (typeof o != "function") throw new TypeError(o + " is not a function");
2161
- var c = Et(this), l = arguments.length > 1, d = !1, i = arguments[1], v = i;
2162
- return new c(function(k) {
2161
+ var c = Et(this), l = arguments.length > 1, d = !1, i = arguments[1], y = i;
2162
+ return new c(function(v) {
2163
2163
  return n.subscribe({
2164
2164
  next: function(C) {
2165
- var _ = !d;
2166
- if (d = !0, !_ || l)
2165
+ var S = !d;
2166
+ if (d = !0, !S || l)
2167
2167
  try {
2168
- v = o(v, C);
2169
- } catch (I) {
2170
- return k.error(I);
2168
+ y = o(y, C);
2169
+ } catch (j) {
2170
+ return v.error(j);
2171
2171
  }
2172
2172
  else
2173
- v = C;
2173
+ y = C;
2174
2174
  },
2175
2175
  error: function(C) {
2176
- k.error(C);
2176
+ v.error(C);
2177
2177
  },
2178
2178
  complete: function() {
2179
- if (!d && !l) return k.error(new TypeError("Cannot reduce an empty sequence"));
2180
- k.next(v), k.complete();
2179
+ if (!d && !l) return v.error(new TypeError("Cannot reduce an empty sequence"));
2180
+ v.next(y), v.complete();
2181
2181
  }
2182
2182
  });
2183
2183
  });
@@ -2186,22 +2186,22 @@ var Kr = /* @__PURE__ */ (function() {
2186
2186
  c[l] = arguments[l];
2187
2187
  var d = Et(this);
2188
2188
  return new d(function(i) {
2189
- var v, k = 0;
2190
- function C(_) {
2191
- v = _.subscribe({
2192
- next: function(I) {
2193
- i.next(I);
2189
+ var y, v = 0;
2190
+ function C(S) {
2191
+ y = S.subscribe({
2192
+ next: function(j) {
2193
+ i.next(j);
2194
2194
  },
2195
- error: function(I) {
2196
- i.error(I);
2195
+ error: function(j) {
2196
+ i.error(j);
2197
2197
  },
2198
2198
  complete: function() {
2199
- k === c.length ? (v = void 0, i.complete()) : C(d.from(c[k++]));
2199
+ v === c.length ? (y = void 0, i.complete()) : C(d.from(c[v++]));
2200
2200
  }
2201
2201
  });
2202
2202
  }
2203
2203
  return C(o), function() {
2204
- v && (v.unsubscribe(), v = void 0);
2204
+ y && (y.unsubscribe(), y = void 0);
2205
2205
  };
2206
2206
  });
2207
2207
  }, e.flatMap = function(o) {
@@ -2210,40 +2210,40 @@ var Kr = /* @__PURE__ */ (function() {
2210
2210
  var c = Et(this);
2211
2211
  return new c(function(l) {
2212
2212
  var d = [], i = n.subscribe({
2213
- next: function(k) {
2213
+ next: function(v) {
2214
2214
  if (o)
2215
2215
  try {
2216
- k = o(k);
2217
- } catch (_) {
2218
- return l.error(_);
2216
+ v = o(v);
2217
+ } catch (S) {
2218
+ return l.error(S);
2219
2219
  }
2220
- var C = c.from(k).subscribe({
2221
- next: function(_) {
2222
- l.next(_);
2220
+ var C = c.from(v).subscribe({
2221
+ next: function(S) {
2222
+ l.next(S);
2223
2223
  },
2224
- error: function(_) {
2225
- l.error(_);
2224
+ error: function(S) {
2225
+ l.error(S);
2226
2226
  },
2227
2227
  complete: function() {
2228
- var _ = d.indexOf(C);
2229
- _ >= 0 && d.splice(_, 1), v();
2228
+ var S = d.indexOf(C);
2229
+ S >= 0 && d.splice(S, 1), y();
2230
2230
  }
2231
2231
  });
2232
2232
  d.push(C);
2233
2233
  },
2234
- error: function(k) {
2235
- l.error(k);
2234
+ error: function(v) {
2235
+ l.error(v);
2236
2236
  },
2237
2237
  complete: function() {
2238
- v();
2238
+ y();
2239
2239
  }
2240
2240
  });
2241
- function v() {
2241
+ function y() {
2242
2242
  i.closed && d.length === 0 && l.complete();
2243
2243
  }
2244
2244
  return function() {
2245
- d.forEach(function(k) {
2246
- return k.unsubscribe();
2245
+ d.forEach(function(v) {
2246
+ return v.unsubscribe();
2247
2247
  }), i.unsubscribe();
2248
2248
  };
2249
2249
  });
@@ -2252,7 +2252,7 @@ var Kr = /* @__PURE__ */ (function() {
2252
2252
  }, t.from = function(o) {
2253
2253
  var n = typeof this == "function" ? this : t;
2254
2254
  if (o == null) throw new TypeError(o + " is not an object");
2255
- var c = Kt(o, se);
2255
+ var c = Jt(o, se);
2256
2256
  if (c) {
2257
2257
  var l = c.call(o);
2258
2258
  if (Object(l) !== l) throw new TypeError(l + " is not an object");
@@ -2260,13 +2260,13 @@ var Kr = /* @__PURE__ */ (function() {
2260
2260
  return l.subscribe(d);
2261
2261
  });
2262
2262
  }
2263
- if (he("iterator") && (c = Kt(o, Vr), c))
2263
+ if (he("iterator") && (c = Jt(o, Vr), c))
2264
2264
  return new n(function(d) {
2265
- Mt(function() {
2265
+ Ht(function() {
2266
2266
  if (!d.closed) {
2267
- for (var i = Mr(c.call(o)), v; !(v = i()).done; ) {
2268
- var k = v.value;
2269
- if (d.next(k), d.closed) return;
2267
+ for (var i = Mr(c.call(o)), y; !(y = i()).done; ) {
2268
+ var v = y.value;
2269
+ if (d.next(v), d.closed) return;
2270
2270
  }
2271
2271
  d.complete();
2272
2272
  }
@@ -2274,7 +2274,7 @@ var Kr = /* @__PURE__ */ (function() {
2274
2274
  });
2275
2275
  if (Array.isArray(o))
2276
2276
  return new n(function(d) {
2277
- Mt(function() {
2277
+ Ht(function() {
2278
2278
  if (!d.closed) {
2279
2279
  for (var i = 0; i < o.length; ++i)
2280
2280
  if (d.next(o[i]), d.closed) return;
@@ -2288,7 +2288,7 @@ var Kr = /* @__PURE__ */ (function() {
2288
2288
  n[c] = arguments[c];
2289
2289
  var l = typeof this == "function" ? this : t;
2290
2290
  return new l(function(d) {
2291
- Mt(function() {
2291
+ Ht(function() {
2292
2292
  if (!d.closed) {
2293
2293
  for (var i = 0; i < n.length; ++i)
2294
2294
  if (d.next(n[i]), d.closed) return;
@@ -2303,10 +2303,10 @@ var Kr = /* @__PURE__ */ (function() {
2303
2303
  }
2304
2304
  }]), t;
2305
2305
  })();
2306
- fe() && Object.defineProperty(E, Symbol("extensions"), {
2306
+ fe() && Object.defineProperty(N, Symbol("extensions"), {
2307
2307
  value: {
2308
2308
  symbol: se,
2309
- hostReportError: vt
2309
+ hostReportError: kt
2310
2310
  },
2311
2311
  configurable: !0
2312
2312
  });
@@ -2326,10 +2326,10 @@ function Wr(t) {
2326
2326
  e = "@@observable";
2327
2327
  return e;
2328
2328
  }
2329
- var yt;
2330
- typeof self < "u" ? yt = self : typeof window < "u" ? yt = window : typeof global < "u" ? yt = global : typeof module < "u" ? yt = module : yt = Function("return this")();
2331
- Wr(yt);
2332
- var ze = E.prototype, Ae = "@@observable";
2329
+ var vt;
2330
+ typeof self < "u" ? vt = self : typeof window < "u" ? vt = window : typeof global < "u" ? vt = global : typeof module < "u" ? vt = module : vt = Function("return this")();
2331
+ Wr(vt);
2332
+ var ze = N.prototype, Ae = "@@observable";
2333
2333
  ze[Ae] || (ze[Ae] = function() {
2334
2334
  return this;
2335
2335
  });
@@ -2348,10 +2348,10 @@ function Gr(t) {
2348
2348
  return t;
2349
2349
  }
2350
2350
  function Xr(t, e) {
2351
- var r = G({}, t), o = function(c) {
2352
- typeof c == "function" ? r = G(G({}, r), c(r)) : r = G(G({}, r), c);
2351
+ var r = Z({}, t), o = function(c) {
2352
+ typeof c == "function" ? r = Z(Z({}, r), c(r)) : r = Z(Z({}, r), c);
2353
2353
  }, n = function() {
2354
- return G({}, r);
2354
+ return Z({}, r);
2355
2355
  };
2356
2356
  return Object.defineProperty(e, "setContext", {
2357
2357
  enumerable: !1,
@@ -2378,12 +2378,12 @@ function oo(t, e) {
2378
2378
  ro(t) || e();
2379
2379
  }
2380
2380
  function je(t, e) {
2381
- return e ? e(t) : E.of();
2381
+ return e ? e(t) : N.of();
2382
2382
  }
2383
2383
  function Tt(t) {
2384
2384
  return typeof t == "function" ? new er(t) : t;
2385
2385
  }
2386
- function qt(t) {
2386
+ function Mt(t) {
2387
2387
  return t.request.length <= 1;
2388
2388
  }
2389
2389
  var er = (
@@ -2394,7 +2394,7 @@ var er = (
2394
2394
  }
2395
2395
  return t.empty = function() {
2396
2396
  return new t(function() {
2397
- return E.of();
2397
+ return N.of();
2398
2398
  });
2399
2399
  }, t.from = function(e) {
2400
2400
  return e.length === 0 ? t.empty() : e.map(Tt).reduce(function(r, o) {
@@ -2402,26 +2402,26 @@ var er = (
2402
2402
  });
2403
2403
  }, t.split = function(e, r, o) {
2404
2404
  var n = Tt(r), c = Tt(o || new t(je)), l;
2405
- return qt(n) && qt(c) ? l = new t(function(d) {
2406
- return e(d) ? n.request(d) || E.of() : c.request(d) || E.of();
2405
+ return Mt(n) && Mt(c) ? l = new t(function(d) {
2406
+ return e(d) ? n.request(d) || N.of() : c.request(d) || N.of();
2407
2407
  }) : l = new t(function(d, i) {
2408
- return e(d) ? n.request(d, i) || E.of() : c.request(d, i) || E.of();
2408
+ return e(d) ? n.request(d, i) || N.of() : c.request(d, i) || N.of();
2409
2409
  }), Object.assign(l, { left: n, right: c });
2410
2410
  }, t.execute = function(e, r) {
2411
- return e.request(Xr(r.context, Qr(Gr(r)))) || E.of();
2411
+ return e.request(Xr(r.context, Qr(Gr(r)))) || N.of();
2412
2412
  }, t.concat = function(e, r) {
2413
2413
  var o = Tt(e);
2414
- if (qt(o))
2414
+ if (Mt(o))
2415
2415
  return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
2416
2416
  var n = Tt(r), c;
2417
- return qt(n) ? c = new t(function(l) {
2417
+ return Mt(n) ? c = new t(function(l) {
2418
2418
  return o.request(l, function(d) {
2419
- return n.request(d) || E.of();
2420
- }) || E.of();
2419
+ return n.request(d) || N.of();
2420
+ }) || N.of();
2421
2421
  }) : c = new t(function(l, d) {
2422
2422
  return o.request(l, function(i) {
2423
- return n.request(i, d) || E.of();
2424
- }) || E.of();
2423
+ return n.request(i, d) || N.of();
2424
+ }) || N.of();
2425
2425
  }), Object.assign(c, { left: o, right: n });
2426
2426
  }, t.prototype.split = function(e, r, o) {
2427
2427
  return this.concat(t.split(e, r, o || new t(je)));
@@ -2443,7 +2443,7 @@ var er = (
2443
2443
  function no(t) {
2444
2444
  return new er(function(e, r) {
2445
2445
  var o = $r(e, []);
2446
- return new E(function(n) {
2446
+ return new N(function(n) {
2447
2447
  var c, l = !1;
2448
2448
  return Promise.resolve(o).then(function(d) {
2449
2449
  return t(d, e.getContext());
@@ -2462,7 +2462,7 @@ function no(t) {
2462
2462
  const ao = async () => {
2463
2463
  const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
2464
2464
  try {
2465
- const n = await T.post(
2465
+ const n = await E.post(
2466
2466
  t,
2467
2467
  new URLSearchParams({ grant_type: "client_credentials" }),
2468
2468
  // Only grant_type in body
@@ -2475,7 +2475,7 @@ const ao = async () => {
2475
2475
  );
2476
2476
  return n.status === 200 && n.data.access_token ? n.data.access_token : (console.error("Failed to fetch token:", n.data), null);
2477
2477
  } catch (n) {
2478
- return T.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
2478
+ return E.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
2479
2479
  }
2480
2480
  }, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = lr({
2481
2481
  uri: `${io}`
@@ -2497,7 +2497,7 @@ const ao = async () => {
2497
2497
  }
2498
2498
  }), Fo = (t) => {
2499
2499
  const { tanyaConfig: e } = t;
2500
- return /* @__PURE__ */ a(ur, { client: co, children: /* @__PURE__ */ a(yr, { children: /* @__PURE__ */ a(Or, { tanyaConfig: e }) }) });
2500
+ return /* @__PURE__ */ a(ur, { client: co, children: /* @__PURE__ */ a(yr, { children: /* @__PURE__ */ a(Pr, { tanyaConfig: e }) }) });
2501
2501
  };
2502
2502
  export {
2503
2503
  Fo as TanyaChatbot,