tanya-chatbot 0.4.4 → 0.4.6
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,13 +1,13 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),n=require("react/jsx-runtime"),Ut=require("@apollo/client"),st=require("react-redux"),ae=require("@reduxjs/toolkit"),or=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const E=require("axios");require("crypto-js");const me=require("@iconify/react"),U=require("react-toastify");function nr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const $e=nr(or),ar='*,: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}}';function sr(){return k.useEffect(()=>{if(typeof document<"u"){const t=document.createElement("style");return t.textContent=ar,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[]),null}const ir={store:{storeCode:"",storeName:"",storeDescription:"",activeCatalogId:0,isDefault:!1,logoDarkBg:"",logoLightBg:"",logoTransparent:"",catalogs:[],themeColor:"",themeContrastColor:"",tanyaThemeColor:"",tanyaThemeColorLight:"",favicon:"",websiteTitle:"",flowId:"",aliasId:"",searchConfigs:{endpoint:"",accessKey:"",secretKey:""},homePageCategories:[],carouselImages:{web:[],mobile:[]},otherImages:{web:[],mobile:[]}}},ze=ae.createSlice({name:"store",initialState:ir,reducers:{setStore:(t,e)=>{t.store=e.payload}}}),{setStore:oo}=ze.actions,lr=ze.reducer,cr={product:null},De=ae.createSlice({name:"product",initialState:cr,reducers:{setProduct:(t,e)=>{t.product=e.payload}}}),{setProduct:te}=De.actions,dr=De.reducer,ur=ae.configureStore({reducer:{store:lr,product:dr}}),fr=({children:t})=>n.jsx(st.Provider,{store:ur,children:t}),Mt=t=>{const e=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:t}});window.dispatchEvent(e)};function pr({...t}){return n.jsx($e.Root,{"data-slot":"popover",...t})}function hr({...t}){return n.jsx($e.Trigger,{"data-slot":"popover-trigger",...t})}const it=()=>({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"}),Ae=async()=>{const t="https://tanya-sfcc-server.vercel.app/";try{const e=await E.post(`${t}api/auth/token-bm-grant?baseUrl=${X()}&siteId=${M()}`);return e.status===200&&e.data.access_token?e.data.access_token:(console.error("Failed to fetch token:",e.data),null)}catch(e){return E.isAxiosError(e)?console.error("Error fetching token:",e.response||e.message):console.error("Unexpected error:",e),null}},qe=async t=>{const e="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,o=await E.post(`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${X()}&siteId=${M()}&pubCfg=${Q()}&envRef=${Z()}&orgRef=${tt()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return o.status===200&&o.data?o.data:null}catch(r){return E.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function Nt(){var g;const t=M(),e="access_token_"+t,r="expires_in_"+t,o=localStorage.getItem(r),a=localStorage.getItem(e);console.log(a);const d=((g=JSON.parse(sessionStorage.getItem("customerData")||"{}"))==null?void 0:g.isGuest)||!0;if(o&&a&&new Date().getTime()<parseInt(o))return console.log("access token found in local storage"),{access_token:a,expires_in:o};const{serverUrl:i}=it(),l=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,s=JSON.parse(sessionStorage.getItem("customerData")||"{}").usrRef;try{const h=d?"unregister-auth":"register-auth";return(await E.get(`${i}sc-api/${h}?dwsid=${l}&email=${s}&pubCfg=${Q()}&envRef=${Z()}&orgRef=${tt()}&siteId=${M()}&token=true`,{withCredentials:!0})).data}catch(h){console.log(h)}}const X=()=>sessionStorage.getItem("Host"),M=()=>sessionStorage.getItem("SiteId"),Q=()=>sessionStorage.getItem("pubCfg"),Z=()=>sessionStorage.getItem("envRef"),tt=()=>sessionStorage.getItem("orgRef"),we=async t=>{console.log("fetching results");const{serverUrl:e,basePath:r}=it();let o="";{const a=await Nt();console.log("the token from getSearchResults",a),o=a.access_token}try{const a=X();return(await E.get(`${e}${r}/search-sfcc?baseUrl=${a}&query=${t}&siteId=${M()}&pubCfg=${Q()}&envRef=${Z()}&orgRef=${tt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data.hits}catch(a){throw console.error("Error fetching search results:",a),a}},Le=async t=>{if(!t)throw new Error("Product ID is required");const{serverUrl:e,basePath:r}=it(),o=X();console.log("calling access");const{access_token:a}=await Nt();return console.log(a),(await E.get(`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${M()}&pubCfg=${Q()}&envRef=${Z()}&orgRef=${tt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}})).data},mr=async t=>{if(!t)throw new Error("customerId is required");const e=await Ae(),{customer_token:r}=await qe(e),{serverUrl:o,basePath:a}=it(),i=(await Nt()).access_token;return(await E.get(`${o}${a}/get-interest?baseUrl=${X()}&customerId=${t}&siteId=${M()}&pubCfg=${Q()}&envRef=${Z()}&orgRef=${tt()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})).data},ge=t=>String(typeof t=="string"?t:t["en-US"]||t),xe=t=>t!=null&&t.image?[t.image]:"variants"in t?t.variants[0].images:t.masterVariant.images.map(e=>e.url),wr=(t,e)=>t.toLocaleString("en-US",{style:"currency",currency:e||"USD"}),be=t=>{var e,r,o;return"variants"in t?{centAmount:(e=t.variants[0])==null?void 0:e.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=t.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(o=t.masterVariant)==null?void 0:o.prices[0].value.currencyCode}},gr=t=>t.charAt(0).toUpperCase()+t.slice(1),ye=(t,e)=>t.length<e?t:t.slice(0,e)+"...",Wt=t=>t.split("\\n").map((e,r)=>{const o=e.match(/^(\d+)\.\s(.+)/);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/>"}).join("");function xr(){const t=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[e,r]=k.useState(t);return k.useEffect(()=>{const o=()=>r(t());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e}const br=({product:t})=>{const e=st.useDispatch(),r=xr(),[o,a]=k.useState(0),d=()=>{a(s=>s+r>=t.length?0:s+r)},i=()=>{a(s=>s-r<0?t.length-(t.length%r||r):s-r)},l=async s=>{const g=await Le(s);e(te(g))};return n.jsx("div",{className:"mt-2 overflow-x-hidden",children:n.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(t==null?void 0:t.length)>r&&n.jsx("button",{onClick:i,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:"<"}),n.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:t.slice(o,o+r).map(s=>{var g,h,S,_;return n.jsxs("div",{className:"flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",onClick:()=>{l(s.product_id??s.productId)},children:[n.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:n.jsx("img",{src:((g=xe(s)[0])==null?void 0:g.link)||xe(s)[0]||"https://via.placeholder.com/120",alt:s!=null&&s.productName?s.productName:"Product",className:"w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"})}),n.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[n.jsxs("div",{className:"relative inline-block group",children:[n.jsx("div",{className:"w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans",children:s!=null&&s.productName?s.productName:s!=null&&s.product_name?s.product_name:ye(ge((h=s==null?void 0:s.name)==null?void 0:h["en-US"]),60)||"Product"}),n.jsx("div",{className:"absolute left-0 top-full mt-1 w-max max-w-[200px] p-2 bg-white shadow-lg text-black text-xs rounded opacity-0 transition-opacity duration-300 group-hover:opacity-100 z-50 pointer-events-auto",style:{position:"absolute",top:"-100%",left:"0",marginBottom:"5px",zIndex:50},children:s!=null&&s.productName?s.productName:s!=null&&s.product_name?s.product_name:ye(ge((S=s==null?void 0:s.name)==null?void 0:S["en-US"]),60)||"Product"})]}),n.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[n.jsx("p",{children:wr(s!=null&&s.price?Number(s==null?void 0:s.price):be(s).centAmount||0,(_=be(s))==null?void 0:_.currencyCode)}),n.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate",children:["$",Number(s==null?void 0:s.price).toFixed(2)??5]})]})]})]},s.productId)})}),(t==null?void 0:t.length)>r&&n.jsx("button",{onClick:d,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:">"})]})})},yr=({chat:t,storeDetails:e})=>n.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:t.map((r,o)=>n.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[n.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:gr(r.keyword)||"No keyword"}),n.jsx(br,{product:r.items,storeDetails:e})]},o))}),Be=async(t,e)=>{var d,i;const{serverUrl:r,basePath:o}=it(),a=`${r}`;console.log(`customer_token
|
|
2
|
-
`,t);try{const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),n=require("react/jsx-runtime"),Ut=require("@apollo/client"),ot=require("react-redux"),ae=require("@reduxjs/toolkit"),or=require("@radix-ui/react-popover");require("clsx");require("tailwind-merge");const E=require("axios");require("crypto-js");const me=require("@iconify/react"),U=require("react-toastify");function nr(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,o.get?o:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const $e=nr(or),ar='*,: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}}';function sr(){return k.useEffect(()=>{if(typeof document<"u"){const t=document.createElement("style");return t.textContent=ar,document.head.appendChild(t),()=>{document.head.removeChild(t)}}},[]),null}const ir={store:{storeCode:"",storeName:"",storeDescription:"",activeCatalogId:0,isDefault:!1,logoDarkBg:"",logoLightBg:"",logoTransparent:"",catalogs:[],themeColor:"",themeContrastColor:"",tanyaThemeColor:"",tanyaThemeColorLight:"",favicon:"",websiteTitle:"",flowId:"",aliasId:"",searchConfigs:{endpoint:"",accessKey:"",secretKey:""},homePageCategories:[],carouselImages:{web:[],mobile:[]},otherImages:{web:[],mobile:[]}}},ze=ae.createSlice({name:"store",initialState:ir,reducers:{setStore:(t,e)=>{t.store=e.payload}}}),{setStore:oo}=ze.actions,lr=ze.reducer,cr={product:null},Ae=ae.createSlice({name:"product",initialState:cr,reducers:{setProduct:(t,e)=>{t.product=e.payload}}}),{setProduct:te}=Ae.actions,dr=Ae.reducer,ur=ae.configureStore({reducer:{store:lr,product:dr}}),fr=({children:t})=>n.jsx(ot.Provider,{store:ur,children:t}),Mt=t=>{const e=new CustomEvent("reactCartUpdated",{detail:{cartUpdated:!0,basketId:t}});window.dispatchEvent(e)};function pr({...t}){return n.jsx($e.Root,{"data-slot":"popover",...t})}function hr({...t}){return n.jsx($e.Trigger,{"data-slot":"popover-trigger",...t})}const yt=()=>({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"}),De=async()=>{const t="https://tanya-sfcc-server.vercel.app/";try{const e=await E.post(`${t}api/auth/token-bm-grant?baseUrl=${X()}&siteId=${V()}`);return e.status===200&&e.data.access_token?e.data.access_token:(console.error("Failed to fetch token:",e.data),null)}catch(e){return E.isAxiosError(e)?console.error("Error fetching token:",e.response||e.message):console.error("Unexpected error:",e),null}},qe=async t=>{const e="https://tanya-sfcc-server.vercel.app/";try{const r=JSON.parse(sessionStorage.getItem("customerData")||"{}").dwsid,o=await E.post(`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${X()}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`}});return o.status===200&&o.data?o.data:null}catch(r){return E.isAxiosError(r)?console.error("Error creating basket:",r.response||r.message):console.error("Unexpected error:",r),null}};async function Nt(){var c;const t=V(),e="access_token_"+t,r="expires_in_"+t,o=localStorage.getItem(r),a=localStorage.getItem(e);return console.log(a),(c=JSON.parse(sessionStorage.getItem("customerData")||"{}"))!=null&&c.isGuest,console.log("access token found in local storage"),{access_token:a,expires_in:o}}const X=()=>sessionStorage.getItem("Host"),V=()=>sessionStorage.getItem("SiteId"),nt=()=>sessionStorage.getItem("pubCfg"),at=()=>sessionStorage.getItem("envRef"),st=()=>sessionStorage.getItem("orgRef"),we=async t=>{console.log("fetching results");const{serverUrl:e,basePath:r}=yt();let o="";{const a=await Nt();console.log("the token from getSearchResults",a),o=a.access_token}try{const a=X();return(await E.get(`${e}${r}/search-sfcc?baseUrl=${a}&query=${t}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${o}`}})).data.hits}catch(a){throw console.error("Error fetching search results:",a),a}},Le=async t=>{if(!t)throw new Error("Product ID is required");const{serverUrl:e,basePath:r}=yt(),o=X();console.log("calling access");const{access_token:a}=await Nt();return console.log(a),(await E.get(`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${a}`}})).data},mr=async t=>{if(!t)throw new Error("customerId is required");const e=await De(),{customer_token:r}=await qe(e),{serverUrl:o,basePath:a}=yt(),i=(await Nt()).access_token;return(await E.get(`${o}${a}/get-interest?baseUrl=${X()}&customerId=${t}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,{headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`}})).data},ge=t=>String(typeof t=="string"?t:t["en-US"]||t),xe=t=>t!=null&&t.image?[t.image]:"variants"in t?t.variants[0].images:t.masterVariant.images.map(e=>e.url),wr=(t,e)=>t.toLocaleString("en-US",{style:"currency",currency:e||"USD"}),be=t=>{var e,r,o;return"variants"in t?{centAmount:(e=t.variants[0])==null?void 0:e.prices.EUR.max,currencyCode:"DOL"}:{centAmount:(r=t.masterVariant)==null?void 0:r.prices[0].value.centAmount,currencyCode:(o=t.masterVariant)==null?void 0:o.prices[0].value.currencyCode}},gr=t=>t.charAt(0).toUpperCase()+t.slice(1),ye=(t,e)=>t.length<e?t:t.slice(0,e)+"...",Wt=t=>t.split("\\n").map((e,r)=>{const o=e.match(/^(\d+)\.\s(.+)/);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/>"}).join("");function xr(){const t=()=>window.innerWidth<425?1:window.innerWidth<768?2:4,[e,r]=k.useState(t);return k.useEffect(()=>{const o=()=>r(t());return window.addEventListener("resize",o),()=>window.removeEventListener("resize",o)},[]),e}const br=({product:t})=>{const e=ot.useDispatch(),r=xr(),[o,a]=k.useState(0),c=()=>{a(s=>s+r>=t.length?0:s+r)},i=()=>{a(s=>s-r<0?t.length-(t.length%r||r):s-r)},d=async s=>{const b=await Le(s);e(te(b))};return n.jsx("div",{className:"mt-2 overflow-x-hidden",children:n.jsxs("div",{className:"flex items-center justify-center gap-4 relative",children:[(t==null?void 0:t.length)>r&&n.jsx("button",{onClick:i,className:"absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:"<"}),n.jsx("div",{className:"flex gap-5 justify-center flex-1 overflow-hidden",children:t.slice(o,o+r).map(s=>{var b,w,j,_;return n.jsxs("div",{className:"flex-shrink-0 flex flex-col w-[150px] h-[200px] p-2 items-center justify-between cursor-pointer bg-[#FFFFFF] rounded-[10px] shadow-[0px_2px_2px_0px_#9292BC40]",onClick:()=>{d(s.product_id??s.productId)},children:[n.jsx("div",{className:"w-full p-2 flex items-center justify-center bg-white",children:n.jsx("img",{src:((b=xe(s)[0])==null?void 0:b.link)||xe(s)[0]||"https://via.placeholder.com/120",alt:s!=null&&s.productName?s.productName:"Product",className:"w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"})}),n.jsxs("div",{className:"text-white w-full p-2 text-[12px] text-center h-[60px]",children:[n.jsxs("div",{className:"relative inline-block group",children:[n.jsx("div",{className:"w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans",children:s!=null&&s.productName?s.productName:s!=null&&s.product_name?s.product_name:ye(ge((w=s==null?void 0:s.name)==null?void 0:w["en-US"]),60)||"Product"}),n.jsx("div",{className:"absolute left-0 top-full mt-1 w-max max-w-[200px] p-2 bg-white shadow-lg text-black text-xs rounded opacity-0 transition-opacity duration-300 group-hover:opacity-100 z-50 pointer-events-auto",style:{position:"absolute",top:"-100%",left:"0",marginBottom:"5px",zIndex:50},children:s!=null&&s.productName?s.productName:s!=null&&s.product_name?s.product_name:ye(ge((j=s==null?void 0:s.name)==null?void 0:j["en-US"]),60)||"Product"})]}),n.jsxs("div",{className:" flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1",children:[n.jsx("p",{children:wr(s!=null&&s.price?Number(s==null?void 0:s.price):be(s).centAmount||0,(_=be(s))==null?void 0:_.currencyCode)}),n.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate",children:["$",Number(s==null?void 0:s.price).toFixed(2)??5]})]})]})]},s.productId)})}),(t==null?void 0:t.length)>r&&n.jsx("button",{onClick:c,className:"absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",style:{height:"30px",width:"30px",boxShadow:"0 4px 10px rgba(0, 0, 0, 0.25)"},children:">"})]})})},yr=({chat:t,storeDetails:e})=>n.jsx("div",{className:"bg-[#FFFFFF] px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",children:t.map((r,o)=>n.jsxs("div",{className:"mb-4 p-3 rounded-xl",style:{background:"linear-gradient(109.52deg, #F0EEF5 36.91%, #F4F3EE 100.34%"},children:[n.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",children:gr(r.keyword)||"No keyword"}),n.jsx(br,{product:r.items,storeDetails:e})]},o))}),Be=async(t,e)=>{var c,i;const{serverUrl:r,basePath:o}=yt(),a=`${r}`;console.log(`customer_token
|
|
2
|
+
`,t);try{const d=await E.post(`${a}${o}/basket/create?baseUrl=${X()}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,e,{headers:{"Content-Type":"application/json",Authorization:t}});return window.postMessage({type:"WIDGET_CREATED_BASKET",basketId:((c=d.data)==null?void 0:c.basket_id)||((i=d.data)==null?void 0:i.basketId)},"*"),d.data}catch(d){return E.isAxiosError(d)?console.error("Error creating basket:",d.response||d.message):console.error("Unexpected error:",d),null}},Ht=async(t,e,r)=>{const{serverUrl:o,basePath:a}=yt(),c=`${o}`;try{const i=await E.post(`${c}${a}/basket/add-product/${t}?baseUrl=${X()}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,e,{headers:{"Content-Type":"application/json",Authorization:r}});return i.status===200&&i.data?i.data:null}catch(i){return E.isAxiosError(i)?console.error("Error adding products to basket:",i.response||i.message):console.error("Unexpected error:",i),null}},Ue=async({basketId:t,customer_token:e})=>{var c;const{serverUrl:r,basePath:o}=yt(),a=`${r}`;try{const i=await E.get(`${a}${o}/basket/${t}?baseUrl=${X()}&siteId=${V()}&pubCfg=${nt()}&envRef=${at()}&orgRef=${st()}`,{headers:{"Content-Type":"application/json",Authorization:e}});return{status:i.status,data:i.data}}catch(i){return E.isAxiosError(i)?{status:(c=i.response)==null?void 0:c.status,data:null}:{status:null,data:null}}},Rt="sfcc_basket_id",ve="sfcc_customer_token",It="sfcc_token_expiry",vr=300*1e3,_t="1.0.0";const rt=t=>{try{t?localStorage.setItem(Rt,t):localStorage.removeItem(Rt)}catch(e){console.error("Error saving basket ID to storage:",e)}},Vt=t=>{try{if(t){localStorage.setItem(ve,t);const e=Date.now()+vr;localStorage.setItem(It,e.toString())}else localStorage.removeItem(ve)}catch(e){console.error("Error storing token:",e)}},ke=300,kr=()=>{var d,s,b,w,j,_;const t=ot.useDispatch(),e=ot.useSelector(C=>C.product.product),r=ot.useSelector(C=>C.store.store),[o,a]=k.useState(!!e);if(k.useEffect(()=>{a(!!e)},[e]),!e)return null;const c=async()=>{var C,z,Y,it,M,lt,vt,Et,Q,kt,St,ct,Tt,Pt,jt,P;console.log(e,"the prod");try{if(!((z=(C=e==null?void 0:e.variants)==null?void 0:C[0])!=null&&z.product_id)&&!(e.type.item||e.type.bundle)&&!((it=(Y=e==null?void 0:e.variants)==null?void 0:Y[0])!=null&&it.productId)){U.toast.error("Variants not available",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const S=[{product_id:((M=e.variants)==null?void 0:M[0].product_id)||((lt=e.variants)==null?void 0:lt[0].productId)||(e==null?void 0:e.id),quantity:1}];console.log(S,"the product data");const v=JSON.parse(sessionStorage.getItem("customerData")||"{}"),Z=(v==null?void 0:v.basketId)||localStorage.getItem(Rt),Kt=!1,Ot=localStorage.getItem(It),$t=Date.now();if(!Kt||!Ot||$t>=parseInt(Ot)){let O="";{const ut=await Nt();console.log("token from auth data"),O="Bearer "+ut.access_token}if(!O){console.error("Failed to get customer_token");return}const dt=$t+300*1e3;if(Vt(O),localStorage.setItem(It,dt.toString()),Z){const ut=await Ue({basketId:Z,customer_token:O});if(console.log(Z,"basket id from customer"),ut.status===200&&ut){const A=await Ht(Z,S,O);(((vt=A==null?void 0:A.product_items)==null?void 0:vt.length)>0||((Et=A==null?void 0:A.productItems)==null?void 0:Et.length)>0)&&(U.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Mt(Z));return}}const zt={productItems:[{productId:((Q=e.variants)==null?void 0:Q[0].product_id)||((kt=e.variants)==null?void 0:kt[0].productId)||(e==null?void 0:e.id),quantity:1}]};console.log("before create basket");const p=await Be(O,zt);if(console.log(p,p==null?void 0:p.basket_id,p==null?void 0:p.basketId,"the basket response"),!(p!=null&&p.basket_id)&&!(p!=null&&p.basketId)){console.error("Failed to create basket");return}console.log("setting stored id",(p==null?void 0:p.basket_id)||(p==null?void 0:p.basketId)),rt((p==null?void 0:p.basket_id)||(p==null?void 0:p.basketId)),console.log("adding product to basket");const K=await Ht((p==null?void 0:p.basket_id)||(p==null?void 0:p.basketId),S,O);console.log("object added to basket"),(((St=K==null?void 0:K.product_items)==null?void 0:St.length)>0||((ct=K==null?void 0:K.productItems)==null?void 0:ct.length)>0)&&U.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Mt(p.basket_id||(p==null?void 0:p.basketId))}}catch(S){console.error("Error adding to cart:",S),U.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((Tt=S==null?void 0:S.response)==null?void 0:Tt.status)===404||((Pt=S==null?void 0:S.response)==null?void 0:Pt.status)===401?(((jt=S==null?void 0:S.response)==null?void 0:jt.status)===404&&rt(null),((P=S==null?void 0:S.response)==null?void 0:P.status)===401&&(rt(null),Vt(null))):(console.error("Failed to add product to basket:",S.message),U.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}},i=()=>{e&&(window.location.href=e.c_pdpUrl)};return console.log(e,"the prod"),n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>{a(!1),setTimeout(()=>t(te(null)),ke)}}),n.jsxs("div",{className:`
|
|
3
3
|
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
|
|
4
4
|
transition-all duration-300
|
|
5
5
|
${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"}
|
|
6
|
-
`,style:{willChange:"transform, opacity"},onClick:C=>C.stopPropagation(),children:[n.jsxs("div",{className:"mt-3 flex flex-row justify-between w-full ",children:[n.jsx("div",{children:n.jsx("p",{className:"text-[#000000] font-bold font-nunitoSans",children:e.name})}),n.jsx("div",{children:n.jsx(me.Icon,{icon:"mdi:close",className:"text-[#555555] w-6 h-6 cursor-pointer",onClick:()=>{a(!1),setTimeout(()=>t(te(null)),ke)}})})]}),n.jsxs("div",{className:"flex flex-row gap-2 items-center flex-wrap",children:[n.jsx("div",{className:"flex flex-row items-center justify-center w-[120px] h-[120px] my-5",children:n.jsx("img",{src:(
|
|
6
|
+
`,style:{willChange:"transform, opacity"},onClick:C=>C.stopPropagation(),children:[n.jsxs("div",{className:"mt-3 flex flex-row justify-between w-full ",children:[n.jsx("div",{children:n.jsx("p",{className:"text-[#000000] font-bold font-nunitoSans",children:e.name})}),n.jsx("div",{children:n.jsx(me.Icon,{icon:"mdi:close",className:"text-[#555555] w-6 h-6 cursor-pointer",onClick:()=>{a(!1),setTimeout(()=>t(te(null)),ke)}})})]}),n.jsxs("div",{className:"flex flex-row gap-2 items-center flex-wrap",children:[n.jsx("div",{className:"flex flex-row items-center justify-center w-[120px] h-[120px] my-5",children:n.jsx("img",{src:(w=(b=(s=(d=e.imageGroups)==null?void 0:d[0])==null?void 0:s.images)==null?void 0:b[0])==null?void 0:w.link,alt:e.name,className:"rounded-[10px]"})}),n.jsx("div",{className:"flex flex-col items-center gap-2",children:e.imageGroups.slice(1,2).map(C=>C.images.slice(1,2).map(z=>n.jsx("img",{src:z.link,alt:e.name,className:"rounded-[10px] w-[60px] h-[60px]"},z.link)))})]}),n.jsxs("div",{className:"flex flex-row items-center justify-between w-full",children:[n.jsxs("div",{className:"flex flex-row items-center gap-2",children:[n.jsxs("p",{className:"text-[#14121F] font-bold font-nunitoSans",children:[" ","$",e.price.toFixed(2)]})," ",n.jsxs("p",{className:"text-[#14121F] font-normal line-through text-sm font-nunitoSans",children:[" ","$",(e.price+5).toFixed(2)]})]}),n.jsx("div",{children:n.jsx("p",{className:"text-[#EC5050] font-bold font-nunitoSans",children:e.discount})})]}),n.jsx("div",{className:"mt-2 w-full border-t-2 border-gray-200"}),n.jsxs("div",{className:"w-full text-left",children:[n.jsx("div",{className:"text-[#323135] font-bold font-nunitoSans mt-3 text-[14px]",children:"Product Details"}),n.jsx("div",{className:"text-[#68656E] font-normal font-nunitoSans text-xs pl-2 mt-3",dangerouslySetInnerHTML:{__html:e.short_description||e.longDescription}})]}),n.jsxs("div",{className:"mt-4 flex flex-col gap-2 w-full p-2",children:[n.jsx("div",{className:"flex flex-row items-center gap-2",children:n.jsxs("div",{className:"flex items-center gap-2 text-left font-nunitoSans",children:[n.jsxs("div",{className:"text-[#323135] font-bold",children:[((j=e==null?void 0:e.rating)==null?void 0:j.rate)||0," /"," ",n.jsx("span",{className:"text-[#68656E]",children:"5"})]}),n.jsx("div",{className:"text-[#323135] font-semibold text-sm",children:"Overall Rating"}),n.jsxs("div",{className:"text-[#68656E] font-semibold text-sm",children:[((_=e==null?void 0:e.rating)==null?void 0:_.count)||0," ratings"]})]})}),n.jsx("div",{className:"mt-2 flex flex-row items-center gap-2",children:Array.from({length:5}).map((C,z)=>{var Y;return n.jsx(me.Icon,{icon:"mdi:star",width:"20",height:"20",className:`text-yellow-500
|
|
7
7
|
${((Y=e==null?void 0:e.rating)==null?void 0:Y.rate)>z?"text-yellow-500":"text-gray-300"}
|
|
8
|
-
`},z)})})]}),n.jsxs("div",{className:"flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",style:{marginTop:"150px"},children:[n.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",style:{backgroundColor:r.tanyaThemeColor},onClick:
|
|
9
|
-
`);q=
|
|
10
|
-
`);q=J.pop()||"";for(const f of J)if(f.startsWith("data:")){const B=f.slice(5).trim();try{const F=JSON.parse(B);F.index==1&&(L=F.data),
|
|
8
|
+
`},z)})})]}),n.jsxs("div",{className:"flex flex-col items-center justify-between font-nunitoSans font-semibold w-5/6 text-black gap-2",style:{marginTop:"150px"},children:[n.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",style:{backgroundColor:r.tanyaThemeColor},onClick:c,children:"Add to Cart"}),n.jsx("button",{className:"rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",style:{backgroundColor:r.tanyaThemeColor},onClick:i,children:"View more"})]})]})]})},Sr=({tanyaConfig:t,basketId:e})=>{const r=["Myself","My Child","My Grandchild","Niece/Nephew","My Friends","Others"],o={Myself:"himself/herself","My Child":"his/her child","My Grandchild":"his/her grandchild","Niece/Nephew":"his/her niece/nephew","My Friends":"his/her friends",Others:"others"},a=k.useRef(null),c=k.useRef(null),i=k.useRef(null),d=k.useRef(null),[s,b]=k.useState(null),[w,j]=k.useState(!1),[_,C]=k.useState(!1),[z,Y]=k.useState(!1),[it,M]=k.useState(!1),[lt,vt]=k.useState(!1),[Et,Q]=k.useState(!1),[kt,St]=k.useState(""),[ct,Tt]=k.useState(""),Pt=l=>({id:l.id,title:l.name,image:l.image??"",price:l.price??0}),[jt,P]=k.useState([]),S=k.useRef(null),v=ot.useSelector(l=>l.store.store),Z=ot.useSelector(l=>l.product.product),Kt=()=>{Y(!0),setTimeout(()=>C(!0),10)},Ot=()=>{C(!1),setTimeout(()=>Y(!1),300)};k.useEffect(()=>{w?Kt():Ot()},[w]);const $t=l=>{Tt(o[l])};k.useEffect(()=>{S.current&&(S.current.scrollTop+=150)},[jt]);let O=null,dt=null;const zt=async()=>{if(O&&dt&&Date.now()<dt)return O;try{const l="https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",y=new URLSearchParams({grant_type:"client_credentials",client_id:"4i8rd70sgt961tc4dhskgf08c",client_secret:"bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",scope:"default-m2m-resource-server-8xzfzo/read"}),h=await fetch(l,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:y});if(!h.ok)throw new Error(`Token request failed! status: ${h.status}`);const g=await h.json();O=g.access_token;const u=g.expires_in||3600;return dt=Date.now()+(u-60)*1e3,O}catch(l){return console.error("Error obtaining JWT token:",l),O=null,dt=null,null}},p=async()=>{const l=await Nt();l!=null&&b(l)};k.useEffect(()=>{if(t!=null&&t.siteId){const{clientID:l,host:y,organizationID:h,shortCode:g,siteId:u}=t;sessionStorage.setItem("Host",y),sessionStorage.setItem("SiteId",u),sessionStorage.setItem("pubCfg",btoa(l)),sessionStorage.setItem("envRef",g),sessionStorage.setItem("orgRef",h)}p(),console.log("scapi environment v1")},[]),k.useEffect(()=>{e&&(console.log("setting the basket id",e),rt(e))},[e]);const K=async()=>{const l=JSON.parse(sessionStorage.getItem("customerData")||"{}").customerId;return(await mr(l||"")).c_interests},ut=async(l,y)=>{console.log("in secondary flow",_t);const h=await K();if(console.log(h,"interests of customer",_t),!!h)try{P(L=>L.map((H,R)=>R===L.length-1?{...H,secondaryLoading:!0}:H));const g=await zt();if(!g)throw new Error("Failed to fetch token");const u=localStorage.getItem("customerNumber"),m=localStorage.getItem("isLoggedIn"),ft=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(m||!1),userId:String(u||new Date().getTime())}).toString()}`,pt=JSON.stringify({flowId:"Q166PR519W",flowAliasId:"HKFUVLWVH2",input:{loyaltyPoints:"",productName:l,productPoints:String(y||0),interests:h}}),D=await fetch(ft,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${g}`},body:pt});if(!D.body)throw new Error("Readable stream not supported");const ht=D.body.getReader(),mt=new TextDecoder;let q="";for(;;){const{done:L,value:H}=await ht.read();if(L)break;q+=mt.decode(H,{stream:!0});const R=q.split(`
|
|
9
|
+
`);q=R.pop()||"";for(const J of R)if(J.startsWith("data:")){const f=J.slice(5).trim();try{const B=JSON.parse(f);B.index===0&&P(F=>F.map((T,W)=>W===F.length-1?{...T,secondaryResponse:B.data,secondaryLoading:!1}:T))}catch(B){P(F=>F.map((T,W)=>W===F.length-1?{...T,secondaryLoading:!1}:T)),console.error("Secondary flow JSON parse error:",B)}}}}catch(g){console.error("Secondary flow error:",g)}},A=async l=>{const y=l||kt.trim();if(y){vt(!0),St(""),a.current=null,c.current=null,i.current=null,d.current=null,P(h=>[...h,{query:y,response:"Thinking for what suits you best...",potentialQuestions:"",products:[],keywords:"Thinking for best products..."}]);try{const h=ct,g=localStorage.getItem("customerNumber"),u=localStorage.getItem("isLoggedIn"),m=await zt();if(!m)throw new Error("Failed to obtain access token");const ft=`https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({registered:String(u||!1),userId:String(g||new Date().getTime())}).toString()}`,pt=JSON.stringify({flowId:"MMHQKYI1NE",flowAliasId:"SZF9ZK1ATE",input:{userPrompt:y,whom:h}}),D=await fetch(ft,{signal:AbortSignal.timeout(3e4),method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${m}`},body:pt});if(!D.ok)throw new Error(`HTTP error! status: ${D.status}`);if(!D.body)throw new Error("Readable stream not supported");const ht=D.body.getReader(),mt=new TextDecoder;let q="",L="";for(;;){Q(!0);const{done:H,value:R}=await ht.read();if(H)break;q+=mt.decode(R,{stream:!0});const J=q.split(`
|
|
10
|
+
`);q=J.pop()||"";for(const f of J)if(f.startsWith("data:")){const B=f.slice(5).trim();try{const F=JSON.parse(B);F.index==1&&(L=F.data),P(T=>T.map((W,At)=>At===T.length-1?{...W,[F.index==0?"response":F.index==1?"keywords":F.index==2?"potentialQuestions":"end"]:F.data}:W))}catch(F){console.error("Error parsing JSON:",F)}}}Qe(Xe(L))}catch(h){console.error("Error sending message to Tanya:",h)}finally{vt(!1)}}},Xe=l=>{const y=l.match(/top five relevant product or category names are: (.*)/i),u=(y?y[1]:l).split(", ").map($=>$.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi,"").trim());return[...new Set(u)].filter(Boolean).join(",")},Qe=async l=>{if(typeof l=="string"){console.log(l,"keywords");const y=l.split(",");for(const h of y){const g=await we(h);if(Q(!1),(g==null?void 0:g.length)>0&&(P(u=>u.map((m,$)=>$===u.length-1?{...m,products:[...m.products||[],{keyword:h,items:g,loading:!1}]}:m)),!a.current||c.current==null)){const u=g[0];a.current=String((u==null?void 0:u.product_name)??""),i.current=u.image.link,c.current=u.product_id;const m=typeof(u==null?void 0:u.price)=="number"?u.price:void 0;d.current=typeof m=="number"&&Number.isFinite(m)?m:null}}}else for(const y of l){const h=await we(y);Q(!1),(h==null?void 0:h.length)>0&&P(g=>g.map((u,m)=>m===g.length-1?{...u,products:[...u.products||[],{keyword:y,items:h,loading:!1}]}:u))}if(a.current){P(h=>h.map((g,u)=>u===h.length-1?{...g,productSnapshot:{id:c.current,name:a.current,image:i.current,price:d.current??null,points:0,quantity:1}}:g));const y=JSON.parse(sessionStorage.getItem("customerData")||"{}");(y==null?void 0:y.isGuest)==!1?(console.log("running secondary flow",_t),ut(a.current,0)):console.log("not running secondary flow",_t)}Q(!1)},Ze=async(l,y)=>{var h,g,u,m,$,ft,pt,D,ht,mt,q,L,H,R,J;M(!0);try{const f=await Le(l.id);if(!((g=(h=f==null?void 0:f.variants)==null?void 0:h[0])!=null&&g.product_id||(m=(u=f==null?void 0:f.variants)==null?void 0:u[0])!=null&&m.productId)&&!(f.type.item||f.type.bundle)){M(!1),U.toast.error("Variants not found",{position:"bottom-right",autoClose:1e3}),console.error("No product variant found");return}const B=[{product_id:(($=f.variants)==null?void 0:$[0].product_id)||((ft=f.variants)==null?void 0:ft[0].productId)||(f==null?void 0:f.id),quantity:y}];console.log(B,"product data","app version",_t);const F=JSON.parse(sessionStorage.getItem("customerData")||"{}"),T=(F==null?void 0:F.basketId)||localStorage.getItem(Rt),W=!1,At=localStorage.getItem(It),pe=Date.now();if(!W||!At||pe>=parseInt(At)){const tr=await De();let{customer_token:tt}=await qe(tr);if(tt="Bearer "+s.access_token,!tt){console.error("Failed to get customer_token");return}const er=pe+300*1e3;if(Vt(tt),localStorage.setItem(It,er.toString()),console.log(T,"basketIdFromCustomer"),T){const he=await Ue({basketId:T,customer_token:tt});if(he.status===200&&he){const Jt=await Ht(T,B,tt);((pt=Jt==null?void 0:Jt.product_items)==null?void 0:pt.length)>0&&(U.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Mt(T),M(!1));return}}const rr={productItems:[{productId:((D=f.variants)==null?void 0:D[0].product_id)||((ht=f.variants)==null?void 0:ht[0].productId)||(f==null?void 0:f.id),quantity:1}]},x=await Be(tt,rr);if(console.log(x,x==null?void 0:x.basket_id,x==null?void 0:x.basketId,"the basket response"),!(x!=null&&x.basket_id||!(x!=null&&x.basketId))){M(!1),console.error("Failed to create basket");return}rt((x==null?void 0:x.basket_id)||(x==null?void 0:x.basketId));const wt=await Ht((x==null?void 0:x.basket_id)||(x==null?void 0:x.basketId),B,tt);(((mt=wt==null?void 0:wt.product_items)==null?void 0:mt.length)>0||((q=wt==null?void 0:wt.productItems)==null?void 0:q.length)>0)&&U.toast.success("Added to cart",{position:"bottom-right",autoClose:3e3,hideProgressBar:!1,closeOnClick:!0,pauseOnHover:!0,draggable:!0}),Mt(x.basket_id||(x==null?void 0:x.basketId))}}catch(f){M(!1),console.error("Error adding to cart:",f),U.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}),((L=f==null?void 0:f.response)==null?void 0:L.status)===404||((H=f==null?void 0:f.response)==null?void 0:H.status)===401?(((R=f==null?void 0:f.response)==null?void 0:R.status)===404&&rt(null),((J=f==null?void 0:f.response)==null?void 0:J.status)===401&&(rt(null),Vt(null))):(console.error("Failed to add product to basket:",f.message),U.toast.error("Failed to add product to cart",{position:"bottom-right",autoClose:3e3}))}M(!1)};return n.jsx("div",{className:"relative flex justify-center",children:n.jsxs(pr,{open:w,onOpenChange:j,children:[n.jsx(hr,{onClick:()=>j(!0),style:{},className:"flex items-center rounded-lg cursor-pointer hover:opacity-90 transition-opacity p-0",children:n.jsx("div",{className:"flex flex-col",children:n.jsxs("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{clipPath:"url(#clip0_958_585)",children:[n.jsx("path",{d:"M30.0002 5C31.7683 5 33.464 5.70238 34.7142 6.95262C35.9644 8.20286 36.6668 9.89856 36.6668 11.6667V25C36.6668 26.7681 35.9644 28.4638 34.7142 29.714C33.464 30.9643 31.7683 31.6667 30.0002 31.6667H25.6902L21.1785 36.1783C20.8915 36.4653 20.5097 36.6377 20.1046 36.6631C19.6996 36.6886 19.2992 36.5654 18.9785 36.3167L18.8218 36.1783L14.3085 31.6667H10.0002C8.28976 31.6667 6.64478 31.0093 5.40548 29.8305C4.16617 28.6516 3.42735 27.0416 3.34183 25.3333L3.3335 25V11.6667C3.3335 9.89856 4.03588 8.20286 5.28612 6.95262C6.53636 5.70238 8.23205 5 10.0002 5H30.0002Z",fill:"url(#paint0_linear_958_585)"}),n.jsx("path",{d:"M28.3335 15.6511V11.6667C28.3335 11.6667 22.2774 12.6042 20.1148 15.4167C17.9521 18.2292 18.6644 26.6667 18.6644 26.6667H22.5321C22.5321 26.6667 22.0614 18.9323 23.4989 17.2917C24.9364 15.6511 28.3335 15.6511 28.3335 15.6511Z",fill:"white"}),n.jsx("path",{d:"M13.3335 11.6667H19.6184V15.4167H13.3335V11.6667Z",fill:"white"})]}),n.jsxs("defs",{children:[n.jsxs("linearGradient",{id:"paint0_linear_958_585",x1:"20.0002",y1:"5",x2:"35.0002",y2:"30",gradientUnits:"userSpaceOnUse",children:[n.jsx("stop",{stopColor:"#452697"}),n.jsx("stop",{offset:"1",stopColor:"#7C5BFF"})]}),n.jsx("clipPath",{id:"clip0_958_585",children:n.jsx("rect",{width:"40",height:"40",fill:"white"})})]})]})})}),z&&n.jsxs(n.Fragment,{children:[n.jsx("div",{className:"fixed inset-0 z-40 bg-black/30",onClick:()=>j(!1)}),n.jsxs("div",{className:`
|
|
11
11
|
fixed z-50 h-screen w-[100vw] sm:w-[80vw] md:w-[770px] border-0 bg-white lg:rounded-l-xl overflow-hidden flex flex-col shadow-[0px_4px_10px_0px_#5F499840]
|
|
12
12
|
top-0 right-0
|
|
13
13
|
transition-transform duration-300 ease-in-out
|
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
// For mobile: animate from bottom
|
|
17
17
|
${_?"translate-y-0":"translate-y-full"}
|
|
18
18
|
lg:translate-y-0
|
|
19
|
-
`,style:{background:"linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"},children:[n.jsxs("div",{className:"flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",children:[n.jsx("div",{style:{display:"flex",color:v.tanyaThemeContrastColor,alignItems:"center",gap:"0.5rem"},children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",style:{background:"linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M15 4.48438V0.5C15 0.5 8.94395 1.4375 6.78127 4.25C4.61859 7.0625 5.33095 15.5 5.33095 15.5H9.19857C9.19857 15.5 8.72793 7.76562 10.1654 6.125C11.6029 4.48438 15 4.48438 15 4.48438Z",fill:"white"}),n.jsx("path",{d:"M0 0.5H6.28488V4.25H0V0.5Z",fill:"white"})]}),n.jsx("p",{className:"text-[#FFFFFF] font-nunitoSans font-semibold",children:"TANYA"})]}),n.jsxs("p",{className:"text-[#5B5B5B] font-nunitoSans font-semibold",style:{fontStyle:"italic"},children:[" ","Your AI shopping assistant !"," "]})]})}),n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:n.jsx("button",{onClick:()=>S(!1),children:n.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{clipPath:"url(#clip0_501_6036)",children:[n.jsx("path",{d:"M18 6.5L6 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M6 6.5L18 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0_501_6036",children:n.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 0.5)"})})})]})})})]}),n.jsxs("div",{className:"flex h-full md:flex-row lg:flex-row",children:[n.jsxs("div",{className:`flex flex-col h-full ${rt?"lg:w-2/3 w-full":"w-full"}`,children:[n.jsxs("div",{ref:j,className:"overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",children:[(v==null?void 0:v.whomRequired)&&n.jsxs("div",{className:"mx-3 p-3 rounded-2xl bg-[#FFFFFF]",children:[n.jsx("div",{className:"flex gap-2 bg-[#FFFFFF]",children:n.jsx("p",{className:"font-bold font-nunitoSans text-[#494949]",children:"Is this for you or someone else?"})}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:r.map(c=>n.jsx("button",{onClick:()=>$t(c),className:"px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",style:{backgroundColor:dt===o[c]?"#FFFFFF":"#F3F3F3",borderColor:dt===o[c]?"#BBB3DD":""},children:c},c))})]}),jt.map((c,y)=>{var m,x;return n.jsxs("div",{children:[n.jsx("div",{className:"flex justify-end",children:n.jsx("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:c.query})}),c.response&&c.response.includes("Thinking")?n.jsx("div",{children:n.jsx("div",{className:"font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:Wt(c.response)}})}):n.jsx("div",{children:n.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:Wt(c.response)}})}),Et&&!c.response.includes("Thinking")&&((m=c.products)==null?void 0:m.length)==0&&n.jsx("div",{children:n.jsx("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"})}),(c==null?void 0:c.products)&&((x=c==null?void 0:c.products)==null?void 0:x.length)>0&&n.jsx(yr,{chat:c.products,storeDetails:v}),c.potentialQuestions.length>0&&n.jsxs("div",{className:"my-2 px-4 text-sm text-gray-700",children:[n.jsx("p",{className:"font-nunitoSans font-bold text-sm text-[#494949]",style:{color:v.themeDarkColor},children:"Why not explore these inquiries..."}),c.potentialQuestions.split(",").map((u,w)=>n.jsx("button",{className:`cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${v.themeDarkColor} m-1 rounded-xl px-2 py-1`,onClick:()=>D(u),style:{backgroundColor:v.tanyaThemeColorLight},children:u},w))]}),c.secondaryLoading&&n.jsx("div",{className:"mt-3 mb-4 px-4",children:n.jsxs("div",{className:"tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",style:{margin:"0.75rem"},children:[n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"tanya-sparkle tanya-sparkle-1",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-2",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-3",children:"✨"})]}),n.jsx("div",{className:"tanya-shimmer"}),n.jsx("p",{className:"font-semibold tanya-pulse",style:{color:v.themeDarkColor},children:"I’ve found a special surprise crafted just for you… hang on a sec!"}),n.jsx("p",{className:"tanya-dots mt-1",style:{color:v.themeDarkColor},children:"• • •"})]})}),c.secondaryResponse&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]",children:[n.jsx("div",{className:"text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",style:{backgroundColor:v.tanyaThemeColorLight},dangerouslySetInnerHTML:{__html:Wt(c.secondaryResponse)}}),c.productSnapshot&&n.jsx("div",{className:"mt-4 w-full",children:n.jsxs("div",{className:"flex gap-4 items-stretch rounded-2xl p-4",style:{backgroundColor:v.tanyaThemeColorLight},children:[n.jsx("div",{className:"flex-shrink-0 rounded-xl overflow-hidden border",style:{width:112,height:112,borderColor:"#eee"},children:c.productSnapshot.image?n.jsx("img",{src:c.productSnapshot.image,alt:c.productSnapshot.name,className:"w-full h-full object-cover"}):n.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"No Image"})}),n.jsxs("div",{className:"flex flex-col flex-1 justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-semibold text-[15px] leading-snug",children:c.productSnapshot.name}),n.jsx("p",{className:"mt-1 text-[14px] font-medium",children:c.productSnapshot.price!=null?new Intl.NumberFormat(void 0,{style:"currency",currency:(v==null?void 0:v.currency)||"USD"}).format(c.productSnapshot.price):""}),c.productSnapshot.points>0&&n.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["You will earn"," ",n.jsxs("strong",{children:[c.productSnapshot.points," ","points"]})]})]}),n.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center border rounded-full overflow-hidden",children:[n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>O(u=>u.map((w,$)=>$===y&&w.productSnapshot?{...w,productSnapshot:{...w.productSnapshot,quantity:Math.max(1,w.productSnapshot.quantity-1)}}:w)),style:{background:"transparent",color:v.themeDarkColor},children:"−"}),n.jsx("div",{className:"px-3 py-1 text-sm select-none",children:c.productSnapshot.quantity}),n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>O(u=>u.map((w,$)=>$===y&&w.productSnapshot?{...w,productSnapshot:{...w.productSnapshot,quantity:w.productSnapshot.quantity+1}}:w)),style:{background:"transparent",color:v.themeDarkColor},children:"+"})]}),n.jsx("button",{onClick:()=>{Ze(Ot(c.productSnapshot),c.productSnapshot.quantity)},disabled:lt,className:"px-4 py-2 rounded-full font-medium",style:{background:v.tanyaThemeColor,color:(v==null?void 0:v.tanyaThemeContrastColor)||"#fff",opacity:lt?.8:1},children:lt?"Adding...":"Add to cart"})]})]})]})})]})}),n.jsx("div",{className:"mb-20"})]},y)})]}),n.jsx("div",{className:"flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2",children:n.jsx("div",{className:"p-[1px] rounded-xl",style:{background:"linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"},children:n.jsxs("div",{className:"flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1",children:[n.jsx("input",{className:"flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",placeholder:"How can I help you...",value:kt,autoFocus:!0,onChange:c=>St(c.target.value),onKeyDown:c=>{c.key==="Enter"&&!ct&&D()}}),n.jsx("button",{type:"submit",disabled:ct,className:"p-3",onClick:()=>D(),children:ct?n.jsx("div",{className:"p-3 animate-spin rounded-full h-3 w-3 border-b-2",style:{borderBottom:"2px solid",color:v.tanyaThemeColor}}):n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M16.6357 13.6701L18.3521 8.5208C19.8516 4.02242 20.6013 1.77322 19.414 0.585948C18.2268 -0.601312 15.9776 0.148418 11.4792 1.64788L6.32987 3.36432C2.69923 4.57453 0.883923 5.17964 0.368062 6.06698C-0.122688 6.91112 -0.122688 7.95369 0.368062 8.7978C0.883923 9.6852 2.69923 10.2903 6.32987 11.5005C6.77981 11.6505 7.28601 11.5434 7.62294 11.2096L13.1286 5.75495C13.4383 5.44808 13.9382 5.45041 14.245 5.76015C14.5519 6.06989 14.5496 6.56975 14.2398 6.87662L8.8231 12.2432C8.4518 12.6111 8.3342 13.1742 8.4995 13.6701C9.7097 17.3007 10.3148 19.1161 11.2022 19.6319C12.0463 20.1227 13.0889 20.1227 13.933 19.6319C14.8204 19.1161 15.4255 17.3008 16.6357 13.6701Z",fill:"#6952C7"})})})]})})})]}),n.jsx(kr,{})]})]})]})]})})};var ee=function(t,e){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},ee(t,e)};function jr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ee(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var G=function(){return G=Object.assign||function(e){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var d in r)Object.prototype.hasOwnProperty.call(r,d)&&(e[d]=r[d])}return e},G.apply(this,arguments)};function _r(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]]);return r}var Gt="Invariant Violation",Se=Object.setPrototypeOf,Cr=Se===void 0?function(t,e){return t.__proto__=e,t}:Se,Me=(function(t){jr(e,t);function e(r){r===void 0&&(r=Gt);var o=t.call(this,typeof r=="number"?Gt+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return o.framesToPop=1,o.name=Gt,Cr(o,e.prototype),o}return e})(Error);function nt(t,e){if(!t)throw new Me(e)}var Re=["debug","log","warn","error","silent"],Fr=Re.indexOf("log");function At(t){return function(){if(Re.indexOf(t)>=Fr){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=At("debug"),t.log=At("log"),t.warn=At("warn"),t.error=At("error")})(nt||(nt={}));var He="3.14.0";function xt(t){try{return t()}catch{}}const re=xt(function(){return globalThis})||xt(function(){return window})||xt(function(){return self})||xt(function(){return global})||xt(function(){return xt.constructor("return this")()});var je=new Map;function Ir(t){var e=je.get(t)||1;return je.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Nr(t,e){var r=Ir("stringifyForDisplay");return JSON.stringify(t,function(o,a){return a===void 0?r:a},e).split(JSON.stringify(r)).join("<undefined>")}function qt(t){return function(e){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(typeof e=="number"){var a=e;e=se(a),e||(e=ie(a,r),r=[])}t.apply(void 0,[e].concat(r))}}var Xt=Object.assign(function(e,r){for(var o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];e||nt(e,se(r,o)||ie(r,o))},{debug:qt(nt.debug),log:qt(nt.log),warn:qt(nt.warn),error:qt(nt.error)});function Ve(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new Me(se(t,e)||ie(t,e))}var _e=Symbol.for("ApolloErrorMessageHandler_"+He);function Ye(t){if(typeof t=="string")return t;try{return Nr(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function se(t,e){if(e===void 0&&(e=[]),!!t)return re[_e]&&re[_e](t,e.map(Ye))}function ie(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:He,message:t,args:e.map(Ye)})))}function Er(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}let I=null;const Ce={};let Tr=1;const Or=()=>class{constructor(){this.id=["slot",Tr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=I;e;e=e.parent)if(this.id in e.slots){const r=e.slots[this.id];if(r===Ce)break;return e!==I&&(I.slots[this.id]=r),!0}return I&&(I.slots[this.id]=Ce),!1}getValue(){if(this.hasValue())return I.slots[this.id]}withValue(e,r,o,a){const d={__proto__:null,[this.id]:e},i=I;I={parent:i,slots:d};try{return r.apply(a,o)}finally{I=i}}static bind(e){const r=I;return function(){const o=I;try{return I=r,e.apply(this,arguments)}finally{I=o}}}static noContext(e,r,o){if(I){const a=I;try{return I=null,e.apply(o,r)}finally{I=a}}else return e.apply(o,r)}};function Fe(t){try{return t()}catch{}}const Qt="@wry/context:Slot",Pr=Fe(()=>globalThis)||Fe(()=>global)||Object.create(null),Ie=Pr,le=Ie[Qt]||Array[Qt]||(function(t){try{Object.defineProperty(Ie,Qt,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}})(Or()),{bind:ao,noContext:so}=le;new le;function $r(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=zr(t))||e){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
20
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zr(t,e){if(t){if(typeof t=="string")return Ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(t,e)}}function Ne(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function Ee(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function ce(t,e,r){return e&&Ee(t.prototype,e),r&&Ee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var de=function(){return typeof Symbol=="function"},ue=function(t){return de()&&!!Symbol[t]},fe=function(t){return ue(t)?Symbol[t]:"@@"+t};de()&&!ue("observable")&&(Symbol.observable=Symbol("observable"));var Dr=fe("iterator"),oe=fe("observable"),Ke=fe("species");function Yt(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ct(t){var e=t.constructor;return e!==void 0&&(e=e[Ke],e===null&&(e=void 0)),e!==void 0?e:N}function Ar(t){return t instanceof N}function yt(t){yt.log?yt.log(t):setTimeout(function(){throw t})}function Bt(t){Promise.resolve().then(function(){try{t()}catch(e){yt(e)}})}function Je(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Yt(e,"unsubscribe");r&&r.call(e)}}catch(o){yt(o)}}function ne(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function qr(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(We(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function We(t,e,r){t._state="running";var o=t._observer;try{var a=Yt(o,e);switch(e){case"next":a&&a.call(o,r);break;case"error":if(ne(t),a)a.call(o,r);else throw r;break;case"complete":ne(t),a&&a.call(o);break}}catch(d){yt(d)}t._state==="closed"?Je(t):t._state==="running"&&(t._state="ready")}function Zt(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Bt(function(){return qr(t)});return}We(t,e,r)}}var Lr=(function(){function t(r,o){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var a=new Br(this);try{this._cleanup=o.call(void 0,a)}catch(d){a.error(d)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(ne(this),Je(this))},ce(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t})(),Br=(function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(o){Zt(this._subscription,"next",o)},e.error=function(o){Zt(this._subscription,"error",o)},e.complete=function(){Zt(this._subscription,"complete")},ce(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t})(),N=(function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(o){return(typeof o!="object"||o===null)&&(o={next:o,error:arguments[1],complete:arguments[2]}),new Lr(o,this._subscriber)},e.forEach=function(o){var a=this;return new Promise(function(d,i){if(typeof o!="function"){i(new TypeError(o+" is not a function"));return}function l(){s.unsubscribe(),d()}var s=a.subscribe({next:function(g){try{o(g,l)}catch(h){i(h),s.unsubscribe()}},error:i,complete:d})})},e.map=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var d=Ct(this);return new d(function(i){return a.subscribe({next:function(l){try{l=o(l)}catch(s){return i.error(s)}i.next(l)},error:function(l){i.error(l)},complete:function(){i.complete()}})})},e.filter=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var d=Ct(this);return new d(function(i){return a.subscribe({next:function(l){try{if(!o(l))return}catch(s){return i.error(s)}i.next(l)},error:function(l){i.error(l)},complete:function(){i.complete()}})})},e.reduce=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var d=Ct(this),i=arguments.length>1,l=!1,s=arguments[1],g=s;return new d(function(h){return a.subscribe({next:function(S){var _=!l;if(l=!0,!_||i)try{g=o(g,S)}catch(C){return h.error(C)}else g=S},error:function(S){h.error(S)},complete:function(){if(!l&&!i)return h.error(new TypeError("Cannot reduce an empty sequence"));h.next(g),h.complete()}})})},e.concat=function(){for(var o=this,a=arguments.length,d=new Array(a),i=0;i<a;i++)d[i]=arguments[i];var l=Ct(this);return new l(function(s){var g,h=0;function S(_){g=_.subscribe({next:function(C){s.next(C)},error:function(C){s.error(C)},complete:function(){h===d.length?(g=void 0,s.complete()):S(l.from(d[h++]))}})}return S(o),function(){g&&(g.unsubscribe(),g=void 0)}})},e.flatMap=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var d=Ct(this);return new d(function(i){var l=[],s=a.subscribe({next:function(h){if(o)try{h=o(h)}catch(_){return i.error(_)}var S=d.from(h).subscribe({next:function(_){i.next(_)},error:function(_){i.error(_)},complete:function(){var _=l.indexOf(S);_>=0&&l.splice(_,1),g()}});l.push(S)},error:function(h){i.error(h)},complete:function(){g()}});function g(){s.closed&&l.length===0&&i.complete()}return function(){l.forEach(function(h){return h.unsubscribe()}),s.unsubscribe()}})},e[oe]=function(){return this},t.from=function(o){var a=typeof this=="function"?this:t;if(o==null)throw new TypeError(o+" is not an object");var d=Yt(o,oe);if(d){var i=d.call(o);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Ar(i)&&i.constructor===a?i:new a(function(l){return i.subscribe(l)})}if(ue("iterator")&&(d=Yt(o,Dr),d))return new a(function(l){Bt(function(){if(!l.closed){for(var s=$r(d.call(o)),g;!(g=s()).done;){var h=g.value;if(l.next(h),l.closed)return}l.complete()}})});if(Array.isArray(o))return new a(function(l){Bt(function(){if(!l.closed){for(var s=0;s<o.length;++s)if(l.next(o[s]),l.closed)return;l.complete()}})});throw new TypeError(o+" is not observable")},t.of=function(){for(var o=arguments.length,a=new Array(o),d=0;d<o;d++)a[d]=arguments[d];var i=typeof this=="function"?this:t;return new i(function(l){Bt(function(){if(!l.closed){for(var s=0;s<a.length;++s)if(l.next(a[s]),l.closed)return;l.complete()}})})},ce(t,null,[{key:Ke,get:function(){return this}}]),t})();de()&&Object.defineProperty(N,Symbol("extensions"),{value:{symbol:oe,hostReportError:yt},configurable:!0});function Ur(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var bt;typeof self<"u"?bt=self:typeof window<"u"?bt=window:typeof global<"u"?bt=global:typeof module<"u"?bt=module:bt=Function("return this")();Ur(bt);var Te=N.prototype,Oe="@@observable";Te[Oe]||(Te[Oe]=function(){return this});function Mr(t){for(var e=["query","operationName","variables","extensions","context"],r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];if(e.indexOf(a)<0)throw Ve(58,a)}return t}function Rr(t,e){var r=G({},t),o=function(d){typeof d=="function"?r=G(G({},r),d(r)):r=G(G({},r),d)},a=function(){return G({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:o}),Object.defineProperty(e,"getContext",{enumerable:!1,value:a}),e}function Hr(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Er(e.query)||void 0:""),e}var Vr=Symbol.for("apollo.deprecations"),Yr=re,Kr=new le;function Jr(t){return Yr[Vr]||(Kr.getValue()||[]).includes(t)}function Wr(t,e){Jr(t)||e()}function Pe(t,e){return e?e(t):N.of()}function Ft(t){return typeof t=="function"?new Ge(t):t}function Lt(t){return t.request.length<=1}var Ge=(function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return N.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Ft).reduce(function(r,o){return r.concat(o)})},t.split=function(e,r,o){var a=Ft(r),d=Ft(o||new t(Pe)),i;return Lt(a)&&Lt(d)?i=new t(function(l){return e(l)?a.request(l)||N.of():d.request(l)||N.of()}):i=new t(function(l,s){return e(l)?a.request(l,s)||N.of():d.request(l,s)||N.of()}),Object.assign(i,{left:a,right:d})},t.execute=function(e,r){return e.request(Rr(r.context,Hr(Mr(r))))||N.of()},t.concat=function(e,r){var o=Ft(e);if(Lt(o))return globalThis.__DEV__!==!1&&Xt.warn(47,o),o;var a=Ft(r),d;return Lt(a)?d=new t(function(i){return o.request(i,function(l){return a.request(l)||N.of()})||N.of()}):d=new t(function(i,l){return o.request(i,function(s){return a.request(s,l)||N.of()})||N.of()}),Object.assign(d,{left:o,right:a})},t.prototype.split=function(e,r,o){return this.concat(t.split(e,r,o||new t(Pe)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw Ve(48)},t.prototype.onError=function(e,r){if(globalThis.__DEV__!==!1&&Wr("onError",function(){globalThis.__DEV__!==!1&&Xt.warn(49)}),r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&Xt.warn(50),this.onError=e,this},t})();function Gr(t){return new Ge(function(e,r){var o=_r(e,[]);return new N(function(a){var d,i=!1;return Promise.resolve(o).then(function(l){return t(l,e.getContext())}).then(e.setContext).then(function(){i||(d=r(e).subscribe({next:a.next.bind(a),error:a.error.bind(a),complete:a.complete.bind(a)}))}).catch(a.error.bind(a)),function(){i=!0,d&&d.unsubscribe()}})})}const Xr=async()=>{const t="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",o="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const a=await E.post(t,new URLSearchParams({grant_type:"client_credentials"}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:o}});return a.status===200&&a.data.access_token?a.data.access_token:(console.error("Failed to fetch token:",a.data),null)}catch(a){return E.isAxiosError(a)?console.error("Error fetching token:",a.response||a.message):console.error("Unexpected error:",a),null}},Qr="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",Zr=Ut.createHttpLink({uri:`${Qr}`}),to=Gr(async(t,{headers:e})=>{const r=await Xr();return{headers:{...e,authorization:`Bearer ${r}`}}}),eo=new Ut.ApolloClient({link:to.concat(Zr),cache:new Ut.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),ro=t=>{const{tanyaConfig:e}=t;return n.jsx(Ut.ApolloProvider,{client:eo,children:n.jsx(fr,{children:n.jsx(Sr,{tanyaConfig:e})})})};exports.TanyaChatbot=ro;exports.TanyaChatbotProvider=sr;
|
|
19
|
+
`,style:{background:"linear-gradient(170.1deg, #FFFFFF 60.03%, #E3DEEF 99.59%)"},children:[n.jsxs("div",{className:"flex justify-between p-3 bg-[#FFFFFF] border border-b-1 border-[#E5E5E5] ",children:[n.jsx("div",{style:{display:"flex",color:v.tanyaThemeContrastColor,alignItems:"center",gap:"0.5rem"},children:n.jsxs("div",{className:"flex flex-col gap-1",children:[n.jsxs("div",{className:"flex gap-2 w-28 h-12 text-center items-center p-2 border rounded-l-[20px] rounded-tr-[20px]",style:{background:"linear-gradient(265.62deg, #6851C6 5.24%, #8668FF 98.49%)"},children:[n.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 15 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsx("path",{d:"M15 4.48438V0.5C15 0.5 8.94395 1.4375 6.78127 4.25C4.61859 7.0625 5.33095 15.5 5.33095 15.5H9.19857C9.19857 15.5 8.72793 7.76562 10.1654 6.125C11.6029 4.48438 15 4.48438 15 4.48438Z",fill:"white"}),n.jsx("path",{d:"M0 0.5H6.28488V4.25H0V0.5Z",fill:"white"})]}),n.jsx("p",{className:"text-[#FFFFFF] font-nunitoSans font-semibold",children:"TANYA"})]}),n.jsxs("p",{className:"text-[#5B5B5B] font-nunitoSans font-semibold",style:{fontStyle:"italic"},children:[" ","Your AI shopping assistant !"," "]})]})}),n.jsx("div",{style:{display:"flex",alignItems:"center",gap:"1.25rem",margin:"0.75rem"},children:n.jsx("button",{onClick:()=>j(!1),children:n.jsxs("svg",{width:"24",height:"25",viewBox:"0 0 24 25",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[n.jsxs("g",{clipPath:"url(#clip0_501_6036)",children:[n.jsx("path",{d:"M18 6.5L6 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),n.jsx("path",{d:"M6 6.5L18 18.5",stroke:"#555555",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),n.jsx("defs",{children:n.jsx("clipPath",{id:"clip0_501_6036",children:n.jsx("rect",{width:"24",height:"24",fill:"white",transform:"translate(0 0.5)"})})})]})})})]}),n.jsxs("div",{className:"flex h-full md:flex-row lg:flex-row",children:[n.jsxs("div",{className:`flex flex-col h-full ${Z?"lg:w-2/3 w-full":"w-full"}`,children:[n.jsxs("div",{ref:S,className:"overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",children:[(v==null?void 0:v.whomRequired)&&n.jsxs("div",{className:"mx-3 p-3 rounded-2xl bg-[#FFFFFF]",children:[n.jsx("div",{className:"flex gap-2 bg-[#FFFFFF]",children:n.jsx("p",{className:"font-bold font-nunitoSans text-[#494949]",children:"Is this for you or someone else?"})}),n.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:r.map(l=>n.jsx("button",{onClick:()=>$t(l),className:"px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",style:{backgroundColor:ct===o[l]?"#FFFFFF":"#F3F3F3",borderColor:ct===o[l]?"#BBB3DD":""},children:l},l))})]}),jt.map((l,y)=>{var h,g;return n.jsxs("div",{children:[n.jsx("div",{className:"flex justify-end",children:n.jsx("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:l.query})}),l.response&&l.response.includes("Thinking")?n.jsx("div",{children:n.jsx("div",{className:"font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:Wt(l.response)}})}):n.jsx("div",{children:n.jsx("div",{className:"font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",dangerouslySetInnerHTML:{__html:Wt(l.response)}})}),Et&&!l.response.includes("Thinking")&&((h=l.products)==null?void 0:h.length)==0&&n.jsx("div",{children:n.jsx("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"})}),(l==null?void 0:l.products)&&((g=l==null?void 0:l.products)==null?void 0:g.length)>0&&n.jsx(yr,{chat:l.products,storeDetails:v}),l.potentialQuestions.length>0&&n.jsxs("div",{className:"my-2 px-4 text-sm text-gray-700",children:[n.jsx("p",{className:"font-nunitoSans font-bold text-sm text-[#494949]",style:{color:v.themeDarkColor},children:"Why not explore these inquiries..."}),l.potentialQuestions.split(",").map((u,m)=>n.jsx("button",{className:`cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${v.themeDarkColor} m-1 rounded-xl px-2 py-1`,onClick:()=>A(u),style:{backgroundColor:v.tanyaThemeColorLight},children:u},m))]}),l.secondaryLoading&&n.jsx("div",{className:"mt-3 mb-4 px-4",children:n.jsxs("div",{className:"tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",style:{margin:"0.75rem"},children:[n.jsxs("div",{className:"flex gap-1",children:[n.jsx("div",{className:"tanya-sparkle tanya-sparkle-1",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-2",children:"✨"}),n.jsx("div",{className:"tanya-sparkle tanya-sparkle-3",children:"✨"})]}),n.jsx("div",{className:"tanya-shimmer"}),n.jsx("p",{className:"font-semibold tanya-pulse",style:{color:v.themeDarkColor},children:"I’ve found a special surprise crafted just for you… hang on a sec!"}),n.jsx("p",{className:"tanya-dots mt-1",style:{color:v.themeDarkColor},children:"• • •"})]})}),l.secondaryResponse&&n.jsx(n.Fragment,{children:n.jsxs("div",{className:"mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]",children:[n.jsx("div",{className:"text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",style:{backgroundColor:v.tanyaThemeColorLight},dangerouslySetInnerHTML:{__html:Wt(l.secondaryResponse)}}),l.productSnapshot&&n.jsx("div",{className:"mt-4 w-full",children:n.jsxs("div",{className:"flex gap-4 items-stretch rounded-2xl p-4",style:{backgroundColor:v.tanyaThemeColorLight},children:[n.jsx("div",{className:"flex-shrink-0 rounded-xl overflow-hidden border",style:{width:112,height:112,borderColor:"#eee"},children:l.productSnapshot.image?n.jsx("img",{src:l.productSnapshot.image,alt:l.productSnapshot.name,className:"w-full h-full object-cover"}):n.jsx("div",{className:"w-full h-full flex items-center justify-center text-xs text-gray-500",children:"No Image"})}),n.jsxs("div",{className:"flex flex-col flex-1 justify-between",children:[n.jsxs("div",{children:[n.jsx("p",{className:"font-semibold text-[15px] leading-snug",children:l.productSnapshot.name}),n.jsx("p",{className:"mt-1 text-[14px] font-medium",children:l.productSnapshot.price!=null?new Intl.NumberFormat(void 0,{style:"currency",currency:(v==null?void 0:v.currency)||"USD"}).format(l.productSnapshot.price):""}),l.productSnapshot.points>0&&n.jsxs("p",{className:"mt-1 text-xs opacity-80",children:["You will earn"," ",n.jsxs("strong",{children:[l.productSnapshot.points," ","points"]})]})]}),n.jsxs("div",{className:"mt-3 flex items-center gap-3",children:[n.jsxs("div",{className:"flex items-center border rounded-full overflow-hidden",children:[n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>P(u=>u.map((m,$)=>$===y&&m.productSnapshot?{...m,productSnapshot:{...m.productSnapshot,quantity:Math.max(1,m.productSnapshot.quantity-1)}}:m)),style:{background:"transparent",color:v.themeDarkColor},children:"−"}),n.jsx("div",{className:"px-3 py-1 text-sm select-none",children:l.productSnapshot.quantity}),n.jsx("button",{className:"px-3 py-1 text-sm",onClick:()=>P(u=>u.map((m,$)=>$===y&&m.productSnapshot?{...m,productSnapshot:{...m.productSnapshot,quantity:m.productSnapshot.quantity+1}}:m)),style:{background:"transparent",color:v.themeDarkColor},children:"+"})]}),n.jsx("button",{onClick:()=>{Ze(Pt(l.productSnapshot),l.productSnapshot.quantity)},disabled:it,className:"px-4 py-2 rounded-full font-medium",style:{background:v.tanyaThemeColor,color:(v==null?void 0:v.tanyaThemeContrastColor)||"#fff",opacity:it?.8:1},children:it?"Adding...":"Add to cart"})]})]})]})})]})}),n.jsx("div",{className:"mb-20"})]},y)})]}),n.jsx("div",{className:"flex flex-col gap-2 sticky bottom-0 left-0 right-0 bg-[#E3DEEF] z-50 px-4 py-2",children:n.jsx("div",{className:"p-[1px] rounded-xl",style:{background:"linear-gradient(180deg, #B09FFF 0%, #8D79F6 100%)"},children:n.jsxs("div",{className:"flex items-center bg-[#FFFFFF] flex-1 rounded-xl px-2 py-1",children:[n.jsx("input",{className:"flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",placeholder:"How can I help you...",value:kt,autoFocus:!0,onChange:l=>St(l.target.value),onKeyDown:l=>{l.key==="Enter"&&!lt&&A()}}),n.jsx("button",{type:"submit",disabled:lt,className:"p-3",onClick:()=>A(),children:lt?n.jsx("div",{className:"p-3 animate-spin rounded-full h-3 w-3 border-b-2",style:{borderBottom:"2px solid",color:v.tanyaThemeColor}}):n.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:n.jsx("path",{d:"M16.6357 13.6701L18.3521 8.5208C19.8516 4.02242 20.6013 1.77322 19.414 0.585948C18.2268 -0.601312 15.9776 0.148418 11.4792 1.64788L6.32987 3.36432C2.69923 4.57453 0.883923 5.17964 0.368062 6.06698C-0.122688 6.91112 -0.122688 7.95369 0.368062 8.7978C0.883923 9.6852 2.69923 10.2903 6.32987 11.5005C6.77981 11.6505 7.28601 11.5434 7.62294 11.2096L13.1286 5.75495C13.4383 5.44808 13.9382 5.45041 14.245 5.76015C14.5519 6.06989 14.5496 6.56975 14.2398 6.87662L8.8231 12.2432C8.4518 12.6111 8.3342 13.1742 8.4995 13.6701C9.7097 17.3007 10.3148 19.1161 11.2022 19.6319C12.0463 20.1227 13.0889 20.1227 13.933 19.6319C14.8204 19.1161 15.4255 17.3008 16.6357 13.6701Z",fill:"#6952C7"})})})]})})})]}),n.jsx(kr,{})]})]})]})]})})};var ee=function(t,e){return ee=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(r[a]=o[a])},ee(t,e)};function jr(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");ee(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var G=function(){return G=Object.assign||function(e){for(var r,o=1,a=arguments.length;o<a;o++){r=arguments[o];for(var c in r)Object.prototype.hasOwnProperty.call(r,c)&&(e[c]=r[c])}return e},G.apply(this,arguments)};function _r(t,e){var r={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]]);return r}var Gt="Invariant Violation",Se=Object.setPrototypeOf,Cr=Se===void 0?function(t,e){return t.__proto__=e,t}:Se,Me=(function(t){jr(e,t);function e(r){r===void 0&&(r=Gt);var o=t.call(this,typeof r=="number"?Gt+": "+r+" (see https://github.com/apollographql/invariant-packages)":r)||this;return o.framesToPop=1,o.name=Gt,Cr(o,e.prototype),o}return e})(Error);function et(t,e){if(!t)throw new Me(e)}var He=["debug","log","warn","error","silent"],Fr=He.indexOf("log");function Dt(t){return function(){if(He.indexOf(t)>=Fr){var e=console[t]||console.log;return e.apply(console,arguments)}}}(function(t){t.debug=Dt("debug"),t.log=Dt("log"),t.warn=Dt("warn"),t.error=Dt("error")})(et||(et={}));var Re="3.14.0";function gt(t){try{return t()}catch{}}const re=gt(function(){return globalThis})||gt(function(){return window})||gt(function(){return self})||gt(function(){return global})||gt(function(){return gt.constructor("return this")()});var je=new Map;function Ir(t){var e=je.get(t)||1;return je.set(t,e+1),"".concat(t,":").concat(e,":").concat(Math.random().toString(36).slice(2))}function Nr(t,e){var r=Ir("stringifyForDisplay");return JSON.stringify(t,function(o,a){return a===void 0?r:a},e).split(JSON.stringify(r)).join("<undefined>")}function qt(t){return function(e){for(var r=[],o=1;o<arguments.length;o++)r[o-1]=arguments[o];if(typeof e=="number"){var a=e;e=se(a),e||(e=ie(a,r),r=[])}t.apply(void 0,[e].concat(r))}}var Xt=Object.assign(function(e,r){for(var o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];e||et(e,se(r,o)||ie(r,o))},{debug:qt(et.debug),log:qt(et.log),warn:qt(et.warn),error:qt(et.error)});function Ve(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return new Me(se(t,e)||ie(t,e))}var _e=Symbol.for("ApolloErrorMessageHandler_"+Re);function Ye(t){if(typeof t=="string")return t;try{return Nr(t,2).slice(0,1e3)}catch{return"<non-serializable>"}}function se(t,e){if(e===void 0&&(e=[]),!!t)return re[_e]&&re[_e](t,e.map(Ye))}function ie(t,e){if(e===void 0&&(e=[]),!!t)return"An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({version:Re,message:t,args:e.map(Ye)})))}function Er(t){return t.definitions.filter(function(e){return e.kind==="OperationDefinition"&&!!e.name}).map(function(e){return e.name.value})[0]||null}let I=null;const Ce={};let Tr=1;const Pr=()=>class{constructor(){this.id=["slot",Tr++,Date.now(),Math.random().toString(36).slice(2)].join(":")}hasValue(){for(let e=I;e;e=e.parent)if(this.id in e.slots){const r=e.slots[this.id];if(r===Ce)break;return e!==I&&(I.slots[this.id]=r),!0}return I&&(I.slots[this.id]=Ce),!1}getValue(){if(this.hasValue())return I.slots[this.id]}withValue(e,r,o,a){const c={__proto__:null,[this.id]:e},i=I;I={parent:i,slots:c};try{return r.apply(a,o)}finally{I=i}}static bind(e){const r=I;return function(){const o=I;try{return I=r,e.apply(this,arguments)}finally{I=o}}}static noContext(e,r,o){if(I){const a=I;try{return I=null,e.apply(o,r)}finally{I=a}}else return e.apply(o,r)}};function Fe(t){try{return t()}catch{}}const Qt="@wry/context:Slot",Or=Fe(()=>globalThis)||Fe(()=>global)||Object.create(null),Ie=Or,le=Ie[Qt]||Array[Qt]||(function(t){try{Object.defineProperty(Ie,Qt,{value:t,enumerable:!1,writable:!1,configurable:!0})}finally{return t}})(Pr()),{bind:ao,noContext:so}=le;new le;function $r(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=zr(t))||e){r&&(t=r);var o=0;return function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zr(t,e){if(t){if(typeof t=="string")return Ne(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ne(t,e)}}function Ne(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,o=new Array(e);r<e;r++)o[r]=t[r];return o}function Ee(t,e){for(var r=0;r<e.length;r++){var o=e[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function ce(t,e,r){return e&&Ee(t.prototype,e),r&&Ee(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}var de=function(){return typeof Symbol=="function"},ue=function(t){return de()&&!!Symbol[t]},fe=function(t){return ue(t)?Symbol[t]:"@@"+t};de()&&!ue("observable")&&(Symbol.observable=Symbol("observable"));var Ar=fe("iterator"),oe=fe("observable"),Ke=fe("species");function Yt(t,e){var r=t[e];if(r!=null){if(typeof r!="function")throw new TypeError(r+" is not a function");return r}}function Ct(t){var e=t.constructor;return e!==void 0&&(e=e[Ke],e===null&&(e=void 0)),e!==void 0?e:N}function Dr(t){return t instanceof N}function bt(t){bt.log?bt.log(t):setTimeout(function(){throw t})}function Bt(t){Promise.resolve().then(function(){try{t()}catch(e){bt(e)}})}function Je(t){var e=t._cleanup;if(e!==void 0&&(t._cleanup=void 0,!!e))try{if(typeof e=="function")e();else{var r=Yt(e,"unsubscribe");r&&r.call(e)}}catch(o){bt(o)}}function ne(t){t._observer=void 0,t._queue=void 0,t._state="closed"}function qr(t){var e=t._queue;if(e){t._queue=void 0,t._state="ready";for(var r=0;r<e.length&&(We(t,e[r].type,e[r].value),t._state!=="closed");++r);}}function We(t,e,r){t._state="running";var o=t._observer;try{var a=Yt(o,e);switch(e){case"next":a&&a.call(o,r);break;case"error":if(ne(t),a)a.call(o,r);else throw r;break;case"complete":ne(t),a&&a.call(o);break}}catch(c){bt(c)}t._state==="closed"?Je(t):t._state==="running"&&(t._state="ready")}function Zt(t,e,r){if(t._state!=="closed"){if(t._state==="buffering"){t._queue.push({type:e,value:r});return}if(t._state!=="ready"){t._state="buffering",t._queue=[{type:e,value:r}],Bt(function(){return qr(t)});return}We(t,e,r)}}var Lr=(function(){function t(r,o){this._cleanup=void 0,this._observer=r,this._queue=void 0,this._state="initializing";var a=new Br(this);try{this._cleanup=o.call(void 0,a)}catch(c){a.error(c)}this._state==="initializing"&&(this._state="ready")}var e=t.prototype;return e.unsubscribe=function(){this._state!=="closed"&&(ne(this),Je(this))},ce(t,[{key:"closed",get:function(){return this._state==="closed"}}]),t})(),Br=(function(){function t(r){this._subscription=r}var e=t.prototype;return e.next=function(o){Zt(this._subscription,"next",o)},e.error=function(o){Zt(this._subscription,"error",o)},e.complete=function(){Zt(this._subscription,"complete")},ce(t,[{key:"closed",get:function(){return this._subscription._state==="closed"}}]),t})(),N=(function(){function t(r){if(!(this instanceof t))throw new TypeError("Observable cannot be called as a function");if(typeof r!="function")throw new TypeError("Observable initializer must be a function");this._subscriber=r}var e=t.prototype;return e.subscribe=function(o){return(typeof o!="object"||o===null)&&(o={next:o,error:arguments[1],complete:arguments[2]}),new Lr(o,this._subscriber)},e.forEach=function(o){var a=this;return new Promise(function(c,i){if(typeof o!="function"){i(new TypeError(o+" is not a function"));return}function d(){s.unsubscribe(),c()}var s=a.subscribe({next:function(b){try{o(b,d)}catch(w){i(w),s.unsubscribe()}},error:i,complete:c})})},e.map=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var c=Ct(this);return new c(function(i){return a.subscribe({next:function(d){try{d=o(d)}catch(s){return i.error(s)}i.next(d)},error:function(d){i.error(d)},complete:function(){i.complete()}})})},e.filter=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var c=Ct(this);return new c(function(i){return a.subscribe({next:function(d){try{if(!o(d))return}catch(s){return i.error(s)}i.next(d)},error:function(d){i.error(d)},complete:function(){i.complete()}})})},e.reduce=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var c=Ct(this),i=arguments.length>1,d=!1,s=arguments[1],b=s;return new c(function(w){return a.subscribe({next:function(j){var _=!d;if(d=!0,!_||i)try{b=o(b,j)}catch(C){return w.error(C)}else b=j},error:function(j){w.error(j)},complete:function(){if(!d&&!i)return w.error(new TypeError("Cannot reduce an empty sequence"));w.next(b),w.complete()}})})},e.concat=function(){for(var o=this,a=arguments.length,c=new Array(a),i=0;i<a;i++)c[i]=arguments[i];var d=Ct(this);return new d(function(s){var b,w=0;function j(_){b=_.subscribe({next:function(C){s.next(C)},error:function(C){s.error(C)},complete:function(){w===c.length?(b=void 0,s.complete()):j(d.from(c[w++]))}})}return j(o),function(){b&&(b.unsubscribe(),b=void 0)}})},e.flatMap=function(o){var a=this;if(typeof o!="function")throw new TypeError(o+" is not a function");var c=Ct(this);return new c(function(i){var d=[],s=a.subscribe({next:function(w){if(o)try{w=o(w)}catch(_){return i.error(_)}var j=c.from(w).subscribe({next:function(_){i.next(_)},error:function(_){i.error(_)},complete:function(){var _=d.indexOf(j);_>=0&&d.splice(_,1),b()}});d.push(j)},error:function(w){i.error(w)},complete:function(){b()}});function b(){s.closed&&d.length===0&&i.complete()}return function(){d.forEach(function(w){return w.unsubscribe()}),s.unsubscribe()}})},e[oe]=function(){return this},t.from=function(o){var a=typeof this=="function"?this:t;if(o==null)throw new TypeError(o+" is not an object");var c=Yt(o,oe);if(c){var i=c.call(o);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Dr(i)&&i.constructor===a?i:new a(function(d){return i.subscribe(d)})}if(ue("iterator")&&(c=Yt(o,Ar),c))return new a(function(d){Bt(function(){if(!d.closed){for(var s=$r(c.call(o)),b;!(b=s()).done;){var w=b.value;if(d.next(w),d.closed)return}d.complete()}})});if(Array.isArray(o))return new a(function(d){Bt(function(){if(!d.closed){for(var s=0;s<o.length;++s)if(d.next(o[s]),d.closed)return;d.complete()}})});throw new TypeError(o+" is not observable")},t.of=function(){for(var o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];var i=typeof this=="function"?this:t;return new i(function(d){Bt(function(){if(!d.closed){for(var s=0;s<a.length;++s)if(d.next(a[s]),d.closed)return;d.complete()}})})},ce(t,null,[{key:Ke,get:function(){return this}}]),t})();de()&&Object.defineProperty(N,Symbol("extensions"),{value:{symbol:oe,hostReportError:bt},configurable:!0});function Ur(t){var e,r=t.Symbol;if(typeof r=="function")if(r.observable)e=r.observable;else{typeof r.for=="function"?e=r.for("https://github.com/benlesh/symbol-observable"):e=r("https://github.com/benlesh/symbol-observable");try{r.observable=e}catch{}}else e="@@observable";return e}var xt;typeof self<"u"?xt=self:typeof window<"u"?xt=window:typeof global<"u"?xt=global:typeof module<"u"?xt=module:xt=Function("return this")();Ur(xt);var Te=N.prototype,Pe="@@observable";Te[Pe]||(Te[Pe]=function(){return this});function Mr(t){for(var e=["query","operationName","variables","extensions","context"],r=0,o=Object.keys(t);r<o.length;r++){var a=o[r];if(e.indexOf(a)<0)throw Ve(58,a)}return t}function Hr(t,e){var r=G({},t),o=function(c){typeof c=="function"?r=G(G({},r),c(r)):r=G(G({},r),c)},a=function(){return G({},r)};return Object.defineProperty(e,"setContext",{enumerable:!1,value:o}),Object.defineProperty(e,"getContext",{enumerable:!1,value:a}),e}function Rr(t){var e={variables:t.variables||{},extensions:t.extensions||{},operationName:t.operationName,query:t.query};return e.operationName||(e.operationName=typeof e.query!="string"?Er(e.query)||void 0:""),e}var Vr=Symbol.for("apollo.deprecations"),Yr=re,Kr=new le;function Jr(t){return Yr[Vr]||(Kr.getValue()||[]).includes(t)}function Wr(t,e){Jr(t)||e()}function Oe(t,e){return e?e(t):N.of()}function Ft(t){return typeof t=="function"?new Ge(t):t}function Lt(t){return t.request.length<=1}var Ge=(function(){function t(e){e&&(this.request=e)}return t.empty=function(){return new t(function(){return N.of()})},t.from=function(e){return e.length===0?t.empty():e.map(Ft).reduce(function(r,o){return r.concat(o)})},t.split=function(e,r,o){var a=Ft(r),c=Ft(o||new t(Oe)),i;return Lt(a)&&Lt(c)?i=new t(function(d){return e(d)?a.request(d)||N.of():c.request(d)||N.of()}):i=new t(function(d,s){return e(d)?a.request(d,s)||N.of():c.request(d,s)||N.of()}),Object.assign(i,{left:a,right:c})},t.execute=function(e,r){return e.request(Hr(r.context,Rr(Mr(r))))||N.of()},t.concat=function(e,r){var o=Ft(e);if(Lt(o))return globalThis.__DEV__!==!1&&Xt.warn(47,o),o;var a=Ft(r),c;return Lt(a)?c=new t(function(i){return o.request(i,function(d){return a.request(d)||N.of()})||N.of()}):c=new t(function(i,d){return o.request(i,function(s){return a.request(s,d)||N.of()})||N.of()}),Object.assign(c,{left:o,right:a})},t.prototype.split=function(e,r,o){return this.concat(t.split(e,r,o||new t(Oe)))},t.prototype.concat=function(e){return t.concat(this,e)},t.prototype.request=function(e,r){throw Ve(48)},t.prototype.onError=function(e,r){if(globalThis.__DEV__!==!1&&Wr("onError",function(){globalThis.__DEV__!==!1&&Xt.warn(49)}),r&&r.error)return r.error(e),!1;throw e},t.prototype.setOnError=function(e){return globalThis.__DEV__!==!1&&globalThis.__DEV__!==!1&&Xt.warn(50),this.onError=e,this},t})();function Gr(t){return new Ge(function(e,r){var o=_r(e,[]);return new N(function(a){var c,i=!1;return Promise.resolve(o).then(function(d){return t(d,e.getContext())}).then(e.setContext).then(function(){i||(c=r(e).subscribe({next:a.next.bind(a),error:a.error.bind(a),complete:a.complete.bind(a)}))}).catch(a.error.bind(a)),function(){i=!0,c&&c.unsubscribe()}})})}const Xr=async()=>{const t="https://auth.australia-southeast1.gcp.commercetools.com/oauth/token",o="Basic "+btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN")+":"+encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));try{const a=await E.post(t,new URLSearchParams({grant_type:"client_credentials"}),{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:o}});return a.status===200&&a.data.access_token?a.data.access_token:(console.error("Failed to fetch token:",a.data),null)}catch(a){return E.isAxiosError(a)?console.error("Error fetching token:",a.response||a.message):console.error("Unexpected error:",a),null}},Qr="https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql",Zr=Ut.createHttpLink({uri:`${Qr}`}),to=Gr(async(t,{headers:e})=>{const r=await Xr();return{headers:{...e,authorization:`Bearer ${r}`}}}),eo=new Ut.ApolloClient({link:to.concat(Zr),cache:new Ut.InMemoryCache,defaultOptions:{watchQuery:{fetchPolicy:"cache-and-network"}}}),ro=t=>{const{tanyaConfig:e}=t;return n.jsx(Ut.ApolloProvider,{client:eo,children:n.jsx(fr,{children:n.jsx(Sr,{tanyaConfig:e})})})};exports.TanyaChatbot=ro;exports.TanyaChatbotProvider=sr;
|
|
21
21
|
//# sourceMappingURL=tanya-chatbot.cjs.js.map
|