tanya-chatbot 0.4.6 → 0.4.7
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.
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as Q, useState as z, useRef as Ft } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
3
|
import { createHttpLink as sr, ApolloClient as lr, InMemoryCache as cr, ApolloProvider as dr } from "@apollo/client";
|
|
4
4
|
import { Provider as ur, useDispatch as je, useSelector as Ht } from "react-redux";
|
|
@@ -12,7 +12,7 @@ import { Icon as ge } from "@iconify/react";
|
|
|
12
12
|
import { toast as M } from "react-toastify";
|
|
13
13
|
const fr = '*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media(min-width:640px){.container{max-width:640px}}@media(min-width:768px){.container{max-width:768px}}@media(min-width:1024px){.container{max-width:1024px}}@media(min-width:1280px){.container{max-width:1280px}}@media(min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.bottom-0{bottom:0}.left-0{left:0}.right-0{right:0}.top-0{top:0}.top-full{top:100%}.z-40{z-index:40}.z-50{z-index:50}.m-1{margin:.25rem}.m-3{margin:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.mb-1{margin-bottom:.25rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-20{margin-bottom:5rem}.mb-24{margin-bottom:6rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.h-12{height:3rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[200px\\]{height:200px}.h-\\[60px\\]{height:60px}.h-\\[90vh\\]{height:90vh}.h-fit{height:-moz-fit-content;height:fit-content}.h-full{height:100%}.h-screen{height:100vh}.w-28{width:7rem}.w-3{width:.75rem}.w-5\\/6{width:83.333333%}.w-6{width:1.5rem}.w-72{width:18rem}.w-\\[100vw\\]{width:100vw}.w-\\[120px\\]{width:120px}.w-\\[150px\\]{width:150px}.w-\\[60px\\]{width:60px}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-max{width:-moz-max-content;width:max-content}.max-w-\\[200px\\]{max-width:200px}.max-w-\\[75\\%\\]{max-width:75%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.flex-grow{flex-grow:1}.translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overflow-y-scroll{overflow-y:scroll}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text-ellipsis{text-overflow:ellipsis}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-\\[10px\\]{border-radius:10px}.rounded-\\[20px\\]{border-radius:20px}.rounded-\\[5px\\]{border-radius:5px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-xl{border-radius:.75rem}.rounded-l-\\[20px\\]{border-top-left-radius:20px;border-bottom-left-radius:20px}.rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.rounded-r-xl{border-top-right-radius:.75rem;border-bottom-right-radius:.75rem}.rounded-bl-2xl{border-bottom-left-radius:1rem}.rounded-br-xl{border-bottom-right-radius:.75rem}.rounded-tr-\\[20px\\]{border-top-right-radius:20px}.rounded-tr-\\[5px\\]{border-top-right-radius:5px}.border{border-width:1px}.border-0{border-width:0px}.border-b-2{border-bottom-width:2px}.border-l-2{border-left-width:2px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\\[\\#C9C2DE\\]{--tw-border-opacity: 1;border-color:rgb(201 194 222 / var(--tw-border-opacity, 1))}.border-\\[\\#E5E5E5\\]{--tw-border-opacity: 1;border-color:rgb(229 229 229 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.bg-\\[\\#553D94\\]{--tw-bg-opacity: 1;background-color:rgb(85 61 148 / var(--tw-bg-opacity, 1))}.bg-\\[\\#6851C6\\]{--tw-bg-opacity: 1;background-color:rgb(104 81 198 / var(--tw-bg-opacity, 1))}.bg-\\[\\#804C9E0D\\]{background-color:#804c9e0d}.bg-\\[\\#A21CAF\\]{--tw-bg-opacity: 1;background-color:rgb(162 28 175 / var(--tw-bg-opacity, 1))}.bg-\\[\\#AB192D\\]{--tw-bg-opacity: 1;background-color:rgb(171 25 45 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E2DBFF\\]{--tw-bg-opacity: 1;background-color:rgb(226 219 255 / var(--tw-bg-opacity, 1))}.bg-\\[\\#E3DEEF\\]{--tw-bg-opacity: 1;background-color:rgb(227 222 239 / var(--tw-bg-opacity, 1))}.bg-\\[\\#F3F3F3\\]{--tw-bg-opacity: 1;background-color:rgb(243 243 243 / var(--tw-bg-opacity, 1))}.bg-\\[\\#FFFFFF\\],.bg-\\[\\#ffffff\\]{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-black\\/30{background-color:#0000004d}.bg-indigo-300{--tw-bg-opacity: 1;background-color:rgb(165 180 252 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-\\[1px\\]{padding:1px}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pb-2{padding-bottom:.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-snug{line-height:1.375}.text-\\[\\#000000\\]{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-\\[\\#14121F\\]{--tw-text-opacity: 1;color:rgb(20 18 31 / var(--tw-text-opacity, 1))}.text-\\[\\#18181B\\]{--tw-text-opacity: 1;color:rgb(24 24 27 / var(--tw-text-opacity, 1))}.text-\\[\\#232323\\]{--tw-text-opacity: 1;color:rgb(35 35 35 / var(--tw-text-opacity, 1))}.text-\\[\\#323135\\]{--tw-text-opacity: 1;color:rgb(50 49 53 / var(--tw-text-opacity, 1))}.text-\\[\\#494949\\]{--tw-text-opacity: 1;color:rgb(73 73 73 / var(--tw-text-opacity, 1))}.text-\\[\\#555555\\]{--tw-text-opacity: 1;color:rgb(85 85 85 / var(--tw-text-opacity, 1))}.text-\\[\\#5B5B5B\\]{--tw-text-opacity: 1;color:rgb(91 91 91 / var(--tw-text-opacity, 1))}.text-\\[\\#68656E\\]{--tw-text-opacity: 1;color:rgb(104 101 110 / var(--tw-text-opacity, 1))}.text-\\[\\#959595\\]{--tw-text-opacity: 1;color:rgb(149 149 149 / var(--tw-text-opacity, 1))}.text-\\[\\#EC5050\\]{--tw-text-opacity: 1;color:rgb(236 80 80 / var(--tw-text-opacity, 1))}.text-\\[\\#FBFBFC\\]{--tw-text-opacity: 1;color:rgb(251 251 252 / var(--tw-text-opacity, 1))}.text-\\[\\#FFFFFF\\]{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-black{--tw-text-opacity: 1;color:rgb(0 0 0 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-500{--tw-text-opacity: 1;color:rgb(234 179 8 / var(--tw-text-opacity, 1))}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-80{opacity:.8}.shadow-\\[0px_2px_2px_0px_\\#9292BC40\\]{--tw-shadow: 0px 2px 2px 0px #9292BC40;--tw-shadow-colored: 0px 2px 2px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\\[0px_4px_10px_0px_\\#5F499840\\]{--tw-shadow: 0px 4px 10px 0px #5F499840;--tw-shadow-colored: 0px 4px 10px 0px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.running{animation-play-state:running}html,body,#root{margin:0;padding:0}:root{line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.hover\\:scale-125:hover{--tw-scale-x: 1.25;--tw-scale-y: 1.25;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.group:hover .group-hover\\:opacity-100{opacity:1}.data-\\[state\\=open\\]\\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\\[state\\=closed\\]\\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\\[state\\=closed\\]\\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\\[state\\=open\\]\\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\\[state\\=closed\\]\\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\\[state\\=open\\]\\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\\[side\\=bottom\\]\\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\\[side\\=left\\]\\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\\[side\\=right\\]\\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\\[side\\=top\\]\\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}@media(min-width:640px){.sm\\:w-\\[80vw\\]{width:80vw}}@media(min-width:768px){.md\\:h-\\[100vh\\]{height:100vh}.md\\:w-1\\/2{width:50%}.md\\:w-\\[770px\\]{width:770px}.md\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.md\\:flex-row{flex-direction:row}}@media(min-width:1024px){.lg\\:h-\\[100vh\\]{height:100vh}.lg\\:w-1\\/2{width:50%}.lg\\:w-2\\/3{width:66.666667%}.lg\\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-x-full{--tw-translate-x: 100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:translate-y-0{--tw-translate-y: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.lg\\:flex-row{flex-direction:row}.lg\\:rounded-l-xl{border-top-left-radius:.75rem;border-bottom-left-radius:.75rem}.lg\\:rounded-bl-xl{border-bottom-left-radius:.75rem}}';
|
|
14
14
|
function vo() {
|
|
15
|
-
return
|
|
15
|
+
return Q(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
18
|
return t.textContent = fr, document.head.appendChild(t), () => {
|
|
@@ -101,7 +101,7 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
103
|
const e = await T.post(
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${Z()}&siteId=${Y()}`
|
|
105
105
|
);
|
|
106
106
|
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
107
107
|
} catch (e) {
|
|
@@ -111,7 +111,7 @@ const vt = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
113
|
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await T.post(
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -130,7 +130,7 @@ async function Pt() {
|
|
|
130
130
|
const t = Y(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
|
|
131
131
|
return console.log(n), (c = JSON.parse(sessionStorage.getItem("customerData") || "{}")) != null && c.isGuest, console.log("access token found in local storage"), { access_token: n, expires_in: o };
|
|
132
132
|
}
|
|
133
|
-
const
|
|
133
|
+
const Z = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem("SiteId"), at = () => sessionStorage.getItem("pubCfg"), it = () => sessionStorage.getItem("envRef"), st = () => sessionStorage.getItem("orgRef"), be = async (t) => {
|
|
134
134
|
console.log("fetching results");
|
|
135
135
|
const { serverUrl: e, basePath: r } = vt();
|
|
136
136
|
let o = "";
|
|
@@ -139,7 +139,7 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
139
139
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
140
140
|
}
|
|
141
141
|
try {
|
|
142
|
-
const n =
|
|
142
|
+
const n = Z();
|
|
143
143
|
return (await T.get(
|
|
144
144
|
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
145
145
|
{
|
|
@@ -154,7 +154,7 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
154
154
|
}
|
|
155
155
|
}, He = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
|
-
const { serverUrl: e, basePath: r } = vt(), o =
|
|
157
|
+
const { serverUrl: e, basePath: r } = vt(), o = Z();
|
|
158
158
|
console.log("calling access");
|
|
159
159
|
const { access_token: n } = await Pt();
|
|
160
160
|
return console.log(n), (await T.get(
|
|
@@ -170,13 +170,13 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
170
170
|
if (!t) throw new Error("customerId is required");
|
|
171
171
|
const e = await qe(), { customer_token: r } = await Me(
|
|
172
172
|
e
|
|
173
|
-
), { serverUrl: o, basePath: n } = vt(),
|
|
173
|
+
), { serverUrl: o, basePath: n } = vt(), l = (await Pt()).access_token;
|
|
174
174
|
return (await T.get(
|
|
175
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
175
|
+
`${o}${n}/get-interest?baseUrl=${Z()}&customerId=${t}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
176
176
|
{
|
|
177
177
|
headers: {
|
|
178
178
|
"Content-Type": "application/json",
|
|
179
|
-
Authorization: `Bearer ${
|
|
179
|
+
Authorization: `Bearer ${l}`
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
)).data;
|
|
@@ -192,13 +192,13 @@ const Q = () => sessionStorage.getItem("Host"), Y = () => sessionStorage.getItem
|
|
|
192
192
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
193
193
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
194
194
|
};
|
|
195
|
-
},
|
|
195
|
+
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1), ke = (t, e) => t.length < e ? t : t.slice(0, e) + "...", Xt = (t) => t.split("\\n").map((e, r) => {
|
|
196
196
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
197
197
|
return o ? `<p key=${r} class="mb-2"><strong>${o[1]}.</strong> ${o[2]}</p>` : e.trim() ? `<p key=${r} class="mb-2">${e}</p>` : "<br/>";
|
|
198
198
|
}).join("");
|
|
199
|
-
function
|
|
199
|
+
function _r() {
|
|
200
200
|
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = z(t);
|
|
201
|
-
return
|
|
201
|
+
return Q(() => {
|
|
202
202
|
const o = () => r(t());
|
|
203
203
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
204
204
|
}, []), e;
|
|
@@ -206,11 +206,11 @@ function Cr() {
|
|
|
206
206
|
const Fr = ({
|
|
207
207
|
product: t
|
|
208
208
|
}) => {
|
|
209
|
-
const e = je(), r =
|
|
209
|
+
const e = je(), r = _r(), [o, n] = z(0), c = () => {
|
|
210
210
|
n(
|
|
211
211
|
(i) => i + r >= t.length ? 0 : i + r
|
|
212
212
|
);
|
|
213
|
-
},
|
|
213
|
+
}, l = () => {
|
|
214
214
|
n(
|
|
215
215
|
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
216
216
|
);
|
|
@@ -222,7 +222,7 @@ const Fr = ({
|
|
|
222
222
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
223
223
|
"button",
|
|
224
224
|
{
|
|
225
|
-
onClick:
|
|
225
|
+
onClick: l,
|
|
226
226
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
227
227
|
style: {
|
|
228
228
|
height: "30px",
|
|
@@ -233,7 +233,7 @@ const Fr = ({
|
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
235
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
236
|
-
var y, g,
|
|
236
|
+
var y, g, S, _;
|
|
237
237
|
return /* @__PURE__ */ u(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
@@ -273,7 +273,7 @@ const Fr = ({
|
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
275
|
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ke(
|
|
276
|
-
xe((
|
|
276
|
+
xe((S = i == null ? void 0 : i.name) == null ? void 0 : S["en-US"]),
|
|
277
277
|
60
|
|
278
278
|
) || "Product"
|
|
279
279
|
}
|
|
@@ -282,7 +282,7 @@ const Fr = ({
|
|
|
282
282
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
283
283
|
/* @__PURE__ */ a("p", { children: Sr(
|
|
284
284
|
i != null && i.price ? Number(i == null ? void 0 : i.price) : ve(i).centAmount || 0,
|
|
285
|
-
(
|
|
285
|
+
(_ = ve(i)) == null ? void 0 : _.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
@@ -324,7 +324,7 @@ const Fr = ({
|
|
|
324
324
|
"div",
|
|
325
325
|
{
|
|
326
326
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
327
|
-
children:
|
|
327
|
+
children: Cr(r.keyword) || "No keyword"
|
|
328
328
|
}
|
|
329
329
|
),
|
|
330
330
|
/* @__PURE__ */ a(
|
|
@@ -338,13 +338,13 @@ const Fr = ({
|
|
|
338
338
|
},
|
|
339
339
|
o
|
|
340
340
|
)) }), Ve = async (t, e) => {
|
|
341
|
-
var c,
|
|
341
|
+
var c, l;
|
|
342
342
|
const { serverUrl: r, basePath: o } = vt(), n = `${r}`;
|
|
343
343
|
console.log(`customer_token
|
|
344
344
|
`, t);
|
|
345
345
|
try {
|
|
346
346
|
const d = await T.post(
|
|
347
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
347
|
+
`${n}${o}/basket/create?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
348
348
|
e,
|
|
349
349
|
{
|
|
350
350
|
headers: {
|
|
@@ -356,7 +356,7 @@ const Fr = ({
|
|
|
356
356
|
return window.postMessage(
|
|
357
357
|
{
|
|
358
358
|
type: "WIDGET_CREATED_BASKET",
|
|
359
|
-
basketId: ((c = d.data) == null ? void 0 : c.basket_id) || ((
|
|
359
|
+
basketId: ((c = d.data) == null ? void 0 : c.basket_id) || ((l = d.data) == null ? void 0 : l.basketId)
|
|
360
360
|
},
|
|
361
361
|
"*"
|
|
362
362
|
), d.data;
|
|
@@ -366,8 +366,8 @@ const Fr = ({
|
|
|
366
366
|
}, Rt = async (t, e, r) => {
|
|
367
367
|
const { serverUrl: o, basePath: n } = vt(), c = `${o}`;
|
|
368
368
|
try {
|
|
369
|
-
const
|
|
370
|
-
`${c}${n}/basket/add-product/${t}?baseUrl=${
|
|
369
|
+
const l = await T.post(
|
|
370
|
+
`${c}${n}/basket/add-product/${t}?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
371
371
|
e,
|
|
372
372
|
{
|
|
373
373
|
headers: {
|
|
@@ -376,12 +376,12 @@ const Fr = ({
|
|
|
376
376
|
}
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
|
-
return
|
|
380
|
-
} catch (
|
|
381
|
-
return T.isAxiosError(
|
|
379
|
+
return l.status === 200 && l.data ? l.data : null;
|
|
380
|
+
} catch (l) {
|
|
381
|
+
return T.isAxiosError(l) ? console.error(
|
|
382
382
|
"Error adding products to basket:",
|
|
383
|
-
|
|
384
|
-
) : console.error("Unexpected error:",
|
|
383
|
+
l.response || l.message
|
|
384
|
+
) : console.error("Unexpected error:", l), null;
|
|
385
385
|
}
|
|
386
386
|
}, Re = async ({
|
|
387
387
|
basketId: t,
|
|
@@ -390,8 +390,8 @@ const Fr = ({
|
|
|
390
390
|
var c;
|
|
391
391
|
const { serverUrl: r, basePath: o } = vt(), n = `${r}`;
|
|
392
392
|
try {
|
|
393
|
-
const
|
|
394
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
393
|
+
const l = await T.get(
|
|
394
|
+
`${n}${o}/basket/${t}?baseUrl=${Z()}&siteId=${Y()}&pubCfg=${at()}&envRef=${it()}&orgRef=${st()}`,
|
|
395
395
|
{
|
|
396
396
|
headers: {
|
|
397
397
|
"Content-Type": "application/json",
|
|
@@ -399,9 +399,9 @@ const Fr = ({
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
);
|
|
402
|
-
return { status:
|
|
403
|
-
} catch (
|
|
404
|
-
return T.isAxiosError(
|
|
402
|
+
return { status: l.status, data: l.data };
|
|
403
|
+
} catch (l) {
|
|
404
|
+
return T.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
405
405
|
}
|
|
406
406
|
}, Yt = "sfcc_basket_id", Se = "sfcc_customer_token", Tt = "sfcc_token_expiry", Nr = 300 * 1e3, It = "1.0.0";
|
|
407
407
|
const nt = (t) => {
|
|
@@ -421,14 +421,14 @@ const nt = (t) => {
|
|
|
421
421
|
} catch (e) {
|
|
422
422
|
console.error("Error storing token:", e);
|
|
423
423
|
}
|
|
424
|
-
},
|
|
425
|
-
var d, i, y, g,
|
|
424
|
+
}, Ce = 300, Er = () => {
|
|
425
|
+
var d, i, y, g, S, _;
|
|
426
426
|
const t = je(), e = Ht((F) => F.product.product), r = Ht((F) => F.store.store), [o, n] = z(!!e);
|
|
427
|
-
if (
|
|
427
|
+
if (Q(() => {
|
|
428
428
|
n(!!e);
|
|
429
429
|
}, [e]), !e) return null;
|
|
430
430
|
const c = async () => {
|
|
431
|
-
var F, j, K, lt, H, ct, kt, Ot,
|
|
431
|
+
var F, j, K, lt, H, ct, kt, Ot, tt, St, Ct, dt, $t, zt, _t, O;
|
|
432
432
|
console.log(e, "the prod");
|
|
433
433
|
try {
|
|
434
434
|
if (!((j = (F = e == null ? void 0 : e.variants) == null ? void 0 : F[0]) != null && j.product_id) && !(e.type.item || e.type.bundle) && !((lt = (K = e == null ? void 0 : e.variants) == null ? void 0 : K[0]) != null && lt.productId)) {
|
|
@@ -438,16 +438,16 @@ const nt = (t) => {
|
|
|
438
438
|
}), console.error("No product variant found");
|
|
439
439
|
return;
|
|
440
440
|
}
|
|
441
|
-
const
|
|
441
|
+
const C = [
|
|
442
442
|
{
|
|
443
443
|
product_id: ((H = e.variants) == null ? void 0 : H[0].product_id) || ((ct = e.variants) == null ? void 0 : ct[0].productId) || (e == null ? void 0 : e.id),
|
|
444
444
|
quantity: 1
|
|
445
445
|
}
|
|
446
446
|
];
|
|
447
|
-
console.log(
|
|
447
|
+
console.log(C, "the product data");
|
|
448
448
|
const k = JSON.parse(
|
|
449
449
|
sessionStorage.getItem("customerData") || "{}"
|
|
450
|
-
),
|
|
450
|
+
), et = (k == null ? void 0 : k.basketId) || localStorage.getItem(Yt), Wt = !1, At = localStorage.getItem(Tt), jt = Date.now();
|
|
451
451
|
if (!Wt || !At || jt >= parseInt(At)) {
|
|
452
452
|
let $ = "";
|
|
453
453
|
{
|
|
@@ -459,15 +459,15 @@ const nt = (t) => {
|
|
|
459
459
|
return;
|
|
460
460
|
}
|
|
461
461
|
const ut = jt + 300 * 1e3;
|
|
462
|
-
if (Kt($), localStorage.setItem(Tt, ut.toString()),
|
|
462
|
+
if (Kt($), localStorage.setItem(Tt, ut.toString()), et) {
|
|
463
463
|
const pt = await Re({
|
|
464
|
-
basketId:
|
|
464
|
+
basketId: et,
|
|
465
465
|
customer_token: $
|
|
466
466
|
});
|
|
467
|
-
if (console.log(
|
|
467
|
+
if (console.log(et, "basket id from customer"), pt.status === 200 && pt) {
|
|
468
468
|
const D = await Rt(
|
|
469
|
-
|
|
470
|
-
|
|
469
|
+
et,
|
|
470
|
+
C,
|
|
471
471
|
$
|
|
472
472
|
);
|
|
473
473
|
(((kt = D == null ? void 0 : D.product_items) == null ? void 0 : kt.length) > 0 || ((Ot = D == null ? void 0 : D.productItems) == null ? void 0 : Ot.length) > 0) && (M.success("Added to cart", {
|
|
@@ -477,14 +477,14 @@ const nt = (t) => {
|
|
|
477
477
|
closeOnClick: !0,
|
|
478
478
|
pauseOnHover: !0,
|
|
479
479
|
draggable: !0
|
|
480
|
-
}), Vt(
|
|
480
|
+
}), Vt(et));
|
|
481
481
|
return;
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
484
|
const Dt = {
|
|
485
485
|
productItems: [
|
|
486
486
|
{
|
|
487
|
-
productId: ((
|
|
487
|
+
productId: ((tt = e.variants) == null ? void 0 : tt[0].product_id) || ((St = e.variants) == null ? void 0 : St[0].productId) || (e == null ? void 0 : e.id),
|
|
488
488
|
quantity: 1
|
|
489
489
|
}
|
|
490
490
|
]
|
|
@@ -508,10 +508,10 @@ const nt = (t) => {
|
|
|
508
508
|
), console.log("adding product to basket");
|
|
509
509
|
const J = await Rt(
|
|
510
510
|
(h == null ? void 0 : h.basket_id) || (h == null ? void 0 : h.basketId),
|
|
511
|
-
|
|
511
|
+
C,
|
|
512
512
|
$
|
|
513
513
|
);
|
|
514
|
-
console.log("object added to basket"), (((
|
|
514
|
+
console.log("object added to basket"), (((Ct = J == null ? void 0 : J.product_items) == null ? void 0 : Ct.length) > 0 || ((dt = J == null ? void 0 : J.productItems) == null ? void 0 : dt.length) > 0) && M.success("Added to cart", {
|
|
515
515
|
position: "bottom-right",
|
|
516
516
|
autoClose: 3e3,
|
|
517
517
|
hideProgressBar: !1,
|
|
@@ -520,17 +520,17 @@ const nt = (t) => {
|
|
|
520
520
|
draggable: !0
|
|
521
521
|
}), Vt(h.basket_id || (h == null ? void 0 : h.basketId));
|
|
522
522
|
}
|
|
523
|
-
} catch (
|
|
524
|
-
console.error("Error adding to cart:",
|
|
523
|
+
} catch (C) {
|
|
524
|
+
console.error("Error adding to cart:", C), M.error("Failed to add product to cart", {
|
|
525
525
|
position: "bottom-right",
|
|
526
526
|
autoClose: 3e3
|
|
527
|
-
}), (($t =
|
|
528
|
-
((zt =
|
|
527
|
+
}), (($t = C == null ? void 0 : C.response) == null ? void 0 : $t.status) === 404 || // Basket not found
|
|
528
|
+
((zt = C == null ? void 0 : C.response) == null ? void 0 : zt.status) === 401 ? (((_t = C == null ? void 0 : C.response) == null ? void 0 : _t.status) === 404 && nt(null), ((O = C == null ? void 0 : C.response) == null ? void 0 : O.status) === 401 && (nt(null), Kt(null))) : (console.error("Failed to add product to basket:", C.message), M.error("Failed to add product to cart", {
|
|
529
529
|
position: "bottom-right",
|
|
530
530
|
autoClose: 3e3
|
|
531
531
|
}));
|
|
532
532
|
}
|
|
533
|
-
},
|
|
533
|
+
}, l = () => {
|
|
534
534
|
e && (window.location.href = e.c_pdpUrl);
|
|
535
535
|
};
|
|
536
536
|
return console.log(e, "the prod"), /* @__PURE__ */ u(re, { children: [
|
|
@@ -539,7 +539,7 @@ const nt = (t) => {
|
|
|
539
539
|
{
|
|
540
540
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
541
541
|
onClick: () => {
|
|
542
|
-
n(!1), setTimeout(() => t(oe(null)),
|
|
542
|
+
n(!1), setTimeout(() => t(oe(null)), Ce);
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
),
|
|
@@ -564,7 +564,7 @@ const nt = (t) => {
|
|
|
564
564
|
onClick: () => {
|
|
565
565
|
n(!1), setTimeout(
|
|
566
566
|
() => t(oe(null)),
|
|
567
|
-
|
|
567
|
+
Ce
|
|
568
568
|
);
|
|
569
569
|
}
|
|
570
570
|
}
|
|
@@ -623,14 +623,14 @@ const nt = (t) => {
|
|
|
623
623
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
624
624
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
625
625
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
626
|
-
((
|
|
626
|
+
((S = e == null ? void 0 : e.rating) == null ? void 0 : S.rate) || 0,
|
|
627
627
|
" /",
|
|
628
628
|
" ",
|
|
629
629
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
630
630
|
] }),
|
|
631
631
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
632
632
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
633
|
-
((
|
|
633
|
+
((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.count) || 0,
|
|
634
634
|
" ratings"
|
|
635
635
|
] })
|
|
636
636
|
] }) }),
|
|
@@ -670,7 +670,7 @@ const nt = (t) => {
|
|
|
670
670
|
{
|
|
671
671
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
672
672
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
673
|
-
onClick:
|
|
673
|
+
onClick: l,
|
|
674
674
|
children: "View more"
|
|
675
675
|
}
|
|
676
676
|
)
|
|
@@ -699,36 +699,36 @@ const nt = (t) => {
|
|
|
699
699
|
"Niece/Nephew": "his/her niece/nephew",
|
|
700
700
|
"My Friends": "his/her friends",
|
|
701
701
|
Others: "others"
|
|
702
|
-
}, n = Ft(null), c = Ft(null),
|
|
703
|
-
id:
|
|
704
|
-
title:
|
|
705
|
-
image:
|
|
706
|
-
price:
|
|
707
|
-
}), [
|
|
702
|
+
}, n = Ft(null), c = Ft(null), l = Ft(null), d = Ft(null), [i, y] = z(null), [g, S] = z(!1), [_, F] = z(!1), [j, K] = z(!1), [lt, H] = z(!1), [ct, kt] = z(!1), [Ot, tt] = z(!1), [St, Ct] = z(""), [dt, $t] = z(""), zt = (s) => ({
|
|
703
|
+
id: s.id,
|
|
704
|
+
title: s.name,
|
|
705
|
+
image: s.image ?? "",
|
|
706
|
+
price: s.price ?? 0
|
|
707
|
+
}), [_t, O] = z([]), C = Ft(null), k = Ht((s) => s.store.store), et = Ht((s) => s.product.product), Wt = () => {
|
|
708
708
|
K(!0), setTimeout(() => F(!0), 10);
|
|
709
709
|
}, At = () => {
|
|
710
710
|
F(!1), setTimeout(() => K(!1), 300);
|
|
711
711
|
};
|
|
712
|
-
|
|
712
|
+
Q(() => {
|
|
713
713
|
g ? Wt() : At();
|
|
714
714
|
}, [g]);
|
|
715
|
-
const jt = (
|
|
716
|
-
$t(o[
|
|
715
|
+
const jt = (s) => {
|
|
716
|
+
$t(o[s]);
|
|
717
717
|
};
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}, [
|
|
718
|
+
Q(() => {
|
|
719
|
+
C.current && (C.current.scrollTop += 150);
|
|
720
|
+
}, [_t]);
|
|
721
721
|
let $ = null, ut = null;
|
|
722
722
|
const Dt = async () => {
|
|
723
723
|
if ($ && ut && Date.now() < ut)
|
|
724
724
|
return $;
|
|
725
725
|
try {
|
|
726
|
-
const
|
|
726
|
+
const s = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", v = new URLSearchParams({
|
|
727
727
|
grant_type: "client_credentials",
|
|
728
728
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
729
729
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
730
730
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
731
|
-
}), m = await fetch(
|
|
731
|
+
}), m = await fetch(s, {
|
|
732
732
|
method: "POST",
|
|
733
733
|
headers: {
|
|
734
734
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
@@ -743,28 +743,33 @@ const nt = (t) => {
|
|
|
743
743
|
$ = b.access_token;
|
|
744
744
|
const p = b.expires_in || 3600;
|
|
745
745
|
return ut = Date.now() + (p - 60) * 1e3, $;
|
|
746
|
-
} catch (
|
|
747
|
-
return console.error("Error obtaining JWT token:",
|
|
746
|
+
} catch (s) {
|
|
747
|
+
return console.error("Error obtaining JWT token:", s), $ = null, ut = null, null;
|
|
748
748
|
}
|
|
749
749
|
}, h = async () => {
|
|
750
|
-
const
|
|
751
|
-
|
|
750
|
+
const s = await Pt();
|
|
751
|
+
s != null && y(s);
|
|
752
752
|
};
|
|
753
|
-
|
|
753
|
+
Q(() => {
|
|
754
754
|
if (t != null && t.siteId) {
|
|
755
|
-
const { clientID:
|
|
756
|
-
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(
|
|
755
|
+
const { clientID: s, host: v, organizationID: m, shortCode: b, siteId: p } = t;
|
|
756
|
+
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(s)), sessionStorage.setItem("envRef", b), sessionStorage.setItem("orgRef", m);
|
|
757
757
|
}
|
|
758
758
|
h(), console.log("scapi environment v1");
|
|
759
|
-
}, []),
|
|
759
|
+
}, []), Q(() => {
|
|
760
760
|
e && (console.log("setting the basket id", e), nt(e));
|
|
761
|
-
}, [e])
|
|
761
|
+
}, [e]), Q(() => {
|
|
762
|
+
const s = async () => {
|
|
763
|
+
S(!1);
|
|
764
|
+
};
|
|
765
|
+
return window.addEventListener("reactCartUpdated", s), () => window.removeEventListener("reactCartUpdated", s);
|
|
766
|
+
}, []);
|
|
762
767
|
const J = async () => {
|
|
763
|
-
const
|
|
768
|
+
const s = JSON.parse(
|
|
764
769
|
sessionStorage.getItem("customerData") || "{}"
|
|
765
770
|
).customerId;
|
|
766
|
-
return (await kr(
|
|
767
|
-
}, pt = async (
|
|
771
|
+
return (await kr(s || "")).c_interests;
|
|
772
|
+
}, pt = async (s, v) => {
|
|
768
773
|
console.log("in secondary flow", It);
|
|
769
774
|
const m = await J();
|
|
770
775
|
if (console.log(m, "interests of customer", It), !!m)
|
|
@@ -784,7 +789,7 @@ const nt = (t) => {
|
|
|
784
789
|
flowAliasId: "HKFUVLWVH2",
|
|
785
790
|
input: {
|
|
786
791
|
loyaltyPoints: "",
|
|
787
|
-
productName:
|
|
792
|
+
productName: s,
|
|
788
793
|
productPoints: String(v || 0),
|
|
789
794
|
interests: m
|
|
790
795
|
}
|
|
@@ -833,10 +838,10 @@ const nt = (t) => {
|
|
|
833
838
|
} catch (b) {
|
|
834
839
|
console.error("Secondary flow error:", b);
|
|
835
840
|
}
|
|
836
|
-
}, D = async (
|
|
837
|
-
const v =
|
|
841
|
+
}, D = async (s) => {
|
|
842
|
+
const v = s || St.trim();
|
|
838
843
|
if (v) {
|
|
839
|
-
kt(!0),
|
|
844
|
+
kt(!0), Ct(""), n.current = null, c.current = null, l.current = null, d.current = null, O((m) => [
|
|
840
845
|
...m,
|
|
841
846
|
{
|
|
842
847
|
query: v,
|
|
@@ -875,7 +880,7 @@ const nt = (t) => {
|
|
|
875
880
|
const mt = L.body.getReader(), wt = new TextDecoder();
|
|
876
881
|
let B = "", U = "";
|
|
877
882
|
for (; ; ) {
|
|
878
|
-
|
|
883
|
+
tt(!0);
|
|
879
884
|
const { done: V, value: R } = await mt.read();
|
|
880
885
|
if (V) break;
|
|
881
886
|
B += wt.decode(R, { stream: !0 });
|
|
@@ -907,18 +912,18 @@ const nt = (t) => {
|
|
|
907
912
|
kt(!1);
|
|
908
913
|
}
|
|
909
914
|
}
|
|
910
|
-
}, er = (
|
|
911
|
-
const v =
|
|
915
|
+
}, er = (s) => {
|
|
916
|
+
const v = s.match(
|
|
912
917
|
/top five relevant product or category names are: (.*)/i
|
|
913
|
-
), p = (v ? v[1] :
|
|
918
|
+
), p = (v ? v[1] : s).split(", ").map((A) => A.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
914
919
|
return [...new Set(p)].filter(Boolean).join(",");
|
|
915
|
-
}, rr = async (
|
|
916
|
-
if (typeof
|
|
917
|
-
console.log(
|
|
918
|
-
const v =
|
|
920
|
+
}, rr = async (s) => {
|
|
921
|
+
if (typeof s == "string") {
|
|
922
|
+
console.log(s, "keywords");
|
|
923
|
+
const v = s.split(",");
|
|
919
924
|
for (const m of v) {
|
|
920
925
|
const b = await be(m);
|
|
921
|
-
if (
|
|
926
|
+
if (tt(!1), (b == null ? void 0 : b.length) > 0 && (O(
|
|
922
927
|
(p) => p.map(
|
|
923
928
|
(w, A) => A === p.length - 1 ? {
|
|
924
929
|
...w,
|
|
@@ -930,15 +935,15 @@ const nt = (t) => {
|
|
|
930
935
|
)
|
|
931
936
|
), !n.current || c.current == null)) {
|
|
932
937
|
const p = b[0];
|
|
933
|
-
n.current = String((p == null ? void 0 : p.product_name) ?? ""),
|
|
938
|
+
n.current = String((p == null ? void 0 : p.product_name) ?? ""), l.current = p.image.link, c.current = p.product_id;
|
|
934
939
|
const w = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
935
940
|
d.current = typeof w == "number" && Number.isFinite(w) ? w : null;
|
|
936
941
|
}
|
|
937
942
|
}
|
|
938
943
|
} else
|
|
939
|
-
for (const v of
|
|
944
|
+
for (const v of s) {
|
|
940
945
|
const m = await be(v);
|
|
941
|
-
|
|
946
|
+
tt(!1), (m == null ? void 0 : m.length) > 0 && O(
|
|
942
947
|
(b) => b.map(
|
|
943
948
|
(p, w) => w === b.length - 1 ? {
|
|
944
949
|
...p,
|
|
@@ -958,7 +963,7 @@ const nt = (t) => {
|
|
|
958
963
|
productSnapshot: {
|
|
959
964
|
id: c.current,
|
|
960
965
|
name: n.current,
|
|
961
|
-
image:
|
|
966
|
+
image: l.current,
|
|
962
967
|
price: d.current ?? null,
|
|
963
968
|
points: 0,
|
|
964
969
|
quantity: 1
|
|
@@ -971,12 +976,12 @@ const nt = (t) => {
|
|
|
971
976
|
);
|
|
972
977
|
(v == null ? void 0 : v.isGuest) == !1 ? (console.log("running secondary flow", It), pt(n.current, 0)) : console.log("not running secondary flow", It);
|
|
973
978
|
}
|
|
974
|
-
|
|
975
|
-
}, or = async (
|
|
979
|
+
tt(!1);
|
|
980
|
+
}, or = async (s, v) => {
|
|
976
981
|
var m, b, p, w, A, ft, ht, L, mt, wt, B, U, V, R, W;
|
|
977
982
|
H(!0);
|
|
978
983
|
try {
|
|
979
|
-
const f = await He(
|
|
984
|
+
const f = await He(s.id);
|
|
980
985
|
if (!((b = (m = f == null ? void 0 : f.variants) == null ? void 0 : m[0]) != null && b.product_id || (w = (p = f == null ? void 0 : f.variants) == null ? void 0 : p[0]) != null && w.productId) && !(f.type.item || f.type.bundle)) {
|
|
981
986
|
H(!1), M.error("Variants not found", {
|
|
982
987
|
position: "bottom-right",
|
|
@@ -996,24 +1001,24 @@ const nt = (t) => {
|
|
|
996
1001
|
), P = (I == null ? void 0 : I.basketId) || localStorage.getItem(Yt), G = !1, Lt = localStorage.getItem(Tt), me = Date.now();
|
|
997
1002
|
if (!G || !Lt || me >= parseInt(Lt)) {
|
|
998
1003
|
const nr = await qe();
|
|
999
|
-
let { customer_token:
|
|
1004
|
+
let { customer_token: rt } = await Me(
|
|
1000
1005
|
nr
|
|
1001
1006
|
);
|
|
1002
|
-
if (
|
|
1007
|
+
if (rt = "Bearer " + i.access_token, !rt) {
|
|
1003
1008
|
console.error("Failed to get customer_token");
|
|
1004
1009
|
return;
|
|
1005
1010
|
}
|
|
1006
1011
|
const ar = me + 300 * 1e3;
|
|
1007
|
-
if (Kt(
|
|
1012
|
+
if (Kt(rt), localStorage.setItem(Tt, ar.toString()), console.log(P, "basketIdFromCustomer"), P) {
|
|
1008
1013
|
const we = await Re({
|
|
1009
1014
|
basketId: P,
|
|
1010
|
-
customer_token:
|
|
1015
|
+
customer_token: rt
|
|
1011
1016
|
});
|
|
1012
1017
|
if (we.status === 200 && we) {
|
|
1013
1018
|
const Gt = await Rt(
|
|
1014
1019
|
P,
|
|
1015
1020
|
q,
|
|
1016
|
-
|
|
1021
|
+
rt
|
|
1017
1022
|
);
|
|
1018
1023
|
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (M.success("Added to cart", {
|
|
1019
1024
|
position: "bottom-right",
|
|
@@ -1033,7 +1038,7 @@ const nt = (t) => {
|
|
|
1033
1038
|
quantity: 1
|
|
1034
1039
|
}
|
|
1035
1040
|
]
|
|
1036
|
-
}, x = await Ve(
|
|
1041
|
+
}, x = await Ve(rt, ir);
|
|
1037
1042
|
if (console.log(
|
|
1038
1043
|
x,
|
|
1039
1044
|
x == null ? void 0 : x.basket_id,
|
|
@@ -1049,7 +1054,7 @@ const nt = (t) => {
|
|
|
1049
1054
|
const gt = await Rt(
|
|
1050
1055
|
(x == null ? void 0 : x.basket_id) || (x == null ? void 0 : x.basketId),
|
|
1051
1056
|
q,
|
|
1052
|
-
|
|
1057
|
+
rt
|
|
1053
1058
|
);
|
|
1054
1059
|
(((wt = gt == null ? void 0 : gt.product_items) == null ? void 0 : wt.length) > 0 || ((B = gt == null ? void 0 : gt.productItems) == null ? void 0 : B.length) > 0) && M.success("Added to cart", {
|
|
1055
1060
|
position: "bottom-right",
|
|
@@ -1072,11 +1077,11 @@ const nt = (t) => {
|
|
|
1072
1077
|
}
|
|
1073
1078
|
H(!1);
|
|
1074
1079
|
};
|
|
1075
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: g, onOpenChange:
|
|
1080
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: g, onOpenChange: S, children: [
|
|
1076
1081
|
/* @__PURE__ */ a(
|
|
1077
1082
|
vr,
|
|
1078
1083
|
{
|
|
1079
|
-
onClick: () =>
|
|
1084
|
+
onClick: () => S(!0),
|
|
1080
1085
|
style: {
|
|
1081
1086
|
// background: storeDetails.tanyaThemeColor,
|
|
1082
1087
|
},
|
|
@@ -1141,7 +1146,7 @@ const nt = (t) => {
|
|
|
1141
1146
|
"div",
|
|
1142
1147
|
{
|
|
1143
1148
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1144
|
-
onClick: () =>
|
|
1149
|
+
onClick: () => S(!1)
|
|
1145
1150
|
}
|
|
1146
1151
|
),
|
|
1147
1152
|
/* @__PURE__ */ u(
|
|
@@ -1152,9 +1157,9 @@ const nt = (t) => {
|
|
|
1152
1157
|
top-0 right-0
|
|
1153
1158
|
transition-transform duration-300 ease-in-out
|
|
1154
1159
|
lg:transform
|
|
1155
|
-
${
|
|
1160
|
+
${_ ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1156
1161
|
// For mobile: animate from bottom
|
|
1157
|
-
${
|
|
1162
|
+
${_ ? "translate-y-0" : "translate-y-full"}
|
|
1158
1163
|
lg:translate-y-0
|
|
1159
1164
|
`,
|
|
1160
1165
|
style: {
|
|
@@ -1232,7 +1237,7 @@ const nt = (t) => {
|
|
|
1232
1237
|
gap: "1.25rem",
|
|
1233
1238
|
margin: "0.75rem"
|
|
1234
1239
|
},
|
|
1235
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1240
|
+
children: /* @__PURE__ */ a("button", { onClick: () => S(!1), children: /* @__PURE__ */ u(
|
|
1236
1241
|
"svg",
|
|
1237
1242
|
{
|
|
1238
1243
|
width: "24",
|
|
@@ -1284,12 +1289,12 @@ const nt = (t) => {
|
|
|
1284
1289
|
/* @__PURE__ */ u(
|
|
1285
1290
|
"div",
|
|
1286
1291
|
{
|
|
1287
|
-
className: `flex flex-col h-full ${
|
|
1292
|
+
className: `flex flex-col h-full ${et ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1288
1293
|
children: [
|
|
1289
1294
|
/* @__PURE__ */ u(
|
|
1290
1295
|
"div",
|
|
1291
1296
|
{
|
|
1292
|
-
ref:
|
|
1297
|
+
ref: C,
|
|
1293
1298
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1294
1299
|
children: [
|
|
1295
1300
|
(k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
|
|
@@ -1298,32 +1303,32 @@ const nt = (t) => {
|
|
|
1298
1303
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1299
1304
|
children: [
|
|
1300
1305
|
/* @__PURE__ */ a("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ a("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
1301
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((
|
|
1306
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((s) => /* @__PURE__ */ a(
|
|
1302
1307
|
"button",
|
|
1303
1308
|
{
|
|
1304
|
-
onClick: () => jt(
|
|
1309
|
+
onClick: () => jt(s),
|
|
1305
1310
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1306
1311
|
style: {
|
|
1307
|
-
backgroundColor: dt === o[
|
|
1308
|
-
borderColor: dt === o[
|
|
1312
|
+
backgroundColor: dt === o[s] ? "#FFFFFF" : "#F3F3F3",
|
|
1313
|
+
borderColor: dt === o[s] ? "#BBB3DD" : ""
|
|
1309
1314
|
},
|
|
1310
|
-
children:
|
|
1315
|
+
children: s
|
|
1311
1316
|
},
|
|
1312
|
-
|
|
1317
|
+
s
|
|
1313
1318
|
)) })
|
|
1314
1319
|
]
|
|
1315
1320
|
}
|
|
1316
1321
|
),
|
|
1317
|
-
|
|
1322
|
+
_t.map((s, v) => {
|
|
1318
1323
|
var m, b;
|
|
1319
1324
|
return /* @__PURE__ */ u("div", { children: [
|
|
1320
|
-
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children:
|
|
1321
|
-
|
|
1325
|
+
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: s.query }) }),
|
|
1326
|
+
s.response && s.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1322
1327
|
"div",
|
|
1323
1328
|
{
|
|
1324
1329
|
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",
|
|
1325
1330
|
dangerouslySetInnerHTML: {
|
|
1326
|
-
__html: Xt(
|
|
1331
|
+
__html: Xt(s.response)
|
|
1327
1332
|
}
|
|
1328
1333
|
}
|
|
1329
1334
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1331,19 +1336,19 @@ const nt = (t) => {
|
|
|
1331
1336
|
{
|
|
1332
1337
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1333
1338
|
dangerouslySetInnerHTML: {
|
|
1334
|
-
__html: Xt(
|
|
1339
|
+
__html: Xt(s.response)
|
|
1335
1340
|
}
|
|
1336
1341
|
}
|
|
1337
1342
|
) }),
|
|
1338
|
-
Ot && !
|
|
1339
|
-
(
|
|
1343
|
+
Ot && !s.response.includes("Thinking") && ((m = s.products) == null ? void 0 : m.length) == 0 && /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-sm animate-pulse font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: "Finding best products for you" }) }),
|
|
1344
|
+
(s == null ? void 0 : s.products) && ((b = s == null ? void 0 : s.products) == null ? void 0 : b.length) > 0 && /* @__PURE__ */ a(
|
|
1340
1345
|
Ir,
|
|
1341
1346
|
{
|
|
1342
|
-
chat:
|
|
1347
|
+
chat: s.products,
|
|
1343
1348
|
storeDetails: k
|
|
1344
1349
|
}
|
|
1345
1350
|
),
|
|
1346
|
-
|
|
1351
|
+
s.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1347
1352
|
/* @__PURE__ */ a(
|
|
1348
1353
|
"p",
|
|
1349
1354
|
{
|
|
@@ -1352,7 +1357,7 @@ const nt = (t) => {
|
|
|
1352
1357
|
children: "Why not explore these inquiries..."
|
|
1353
1358
|
}
|
|
1354
1359
|
),
|
|
1355
|
-
|
|
1360
|
+
s.potentialQuestions.split(",").map((p, w) => /* @__PURE__ */ a(
|
|
1356
1361
|
"button",
|
|
1357
1362
|
{
|
|
1358
1363
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
@@ -1365,7 +1370,7 @@ const nt = (t) => {
|
|
|
1365
1370
|
w
|
|
1366
1371
|
))
|
|
1367
1372
|
] }),
|
|
1368
|
-
|
|
1373
|
+
s.secondaryLoading && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
1369
1374
|
"div",
|
|
1370
1375
|
{
|
|
1371
1376
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1398,7 +1403,7 @@ const nt = (t) => {
|
|
|
1398
1403
|
]
|
|
1399
1404
|
}
|
|
1400
1405
|
) }),
|
|
1401
|
-
|
|
1406
|
+
s.secondaryResponse && /* @__PURE__ */ a(re, { children: /* @__PURE__ */ u("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1402
1407
|
/* @__PURE__ */ a(
|
|
1403
1408
|
"div",
|
|
1404
1409
|
{
|
|
@@ -1408,12 +1413,12 @@ const nt = (t) => {
|
|
|
1408
1413
|
},
|
|
1409
1414
|
dangerouslySetInnerHTML: {
|
|
1410
1415
|
__html: Xt(
|
|
1411
|
-
|
|
1416
|
+
s.secondaryResponse
|
|
1412
1417
|
)
|
|
1413
1418
|
}
|
|
1414
1419
|
}
|
|
1415
1420
|
),
|
|
1416
|
-
|
|
1421
|
+
s.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1417
1422
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ u(
|
|
1418
1423
|
"div",
|
|
1419
1424
|
{
|
|
@@ -1431,11 +1436,11 @@ const nt = (t) => {
|
|
|
1431
1436
|
height: 112,
|
|
1432
1437
|
borderColor: "#eee"
|
|
1433
1438
|
},
|
|
1434
|
-
children:
|
|
1439
|
+
children: s.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1435
1440
|
"img",
|
|
1436
1441
|
{
|
|
1437
|
-
src:
|
|
1438
|
-
alt:
|
|
1442
|
+
src: s.productSnapshot.image,
|
|
1443
|
+
alt: s.productSnapshot.name,
|
|
1439
1444
|
className: "w-full h-full object-cover"
|
|
1440
1445
|
}
|
|
1441
1446
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1443,18 +1448,18 @@ const nt = (t) => {
|
|
|
1443
1448
|
),
|
|
1444
1449
|
/* @__PURE__ */ u("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1445
1450
|
/* @__PURE__ */ u("div", { children: [
|
|
1446
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1447
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1451
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: s.productSnapshot.name }),
|
|
1452
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: s.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1448
1453
|
style: "currency",
|
|
1449
1454
|
currency: (k == null ? void 0 : k.currency) || "USD"
|
|
1450
1455
|
}).format(
|
|
1451
|
-
|
|
1456
|
+
s.productSnapshot.price
|
|
1452
1457
|
) : "" }),
|
|
1453
|
-
|
|
1458
|
+
s.productSnapshot.points > 0 && /* @__PURE__ */ u("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1454
1459
|
"You will earn",
|
|
1455
1460
|
" ",
|
|
1456
1461
|
/* @__PURE__ */ u("strong", { children: [
|
|
1457
|
-
|
|
1462
|
+
s.productSnapshot.points,
|
|
1458
1463
|
" ",
|
|
1459
1464
|
"points"
|
|
1460
1465
|
] })
|
|
@@ -1487,7 +1492,7 @@ const nt = (t) => {
|
|
|
1487
1492
|
children: "−"
|
|
1488
1493
|
}
|
|
1489
1494
|
),
|
|
1490
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1495
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: s.productSnapshot.quantity }),
|
|
1491
1496
|
/* @__PURE__ */ a(
|
|
1492
1497
|
"button",
|
|
1493
1498
|
{
|
|
@@ -1517,9 +1522,9 @@ const nt = (t) => {
|
|
|
1517
1522
|
onClick: () => {
|
|
1518
1523
|
or(
|
|
1519
1524
|
zt(
|
|
1520
|
-
|
|
1525
|
+
s.productSnapshot
|
|
1521
1526
|
),
|
|
1522
|
-
|
|
1527
|
+
s.productSnapshot.quantity
|
|
1523
1528
|
);
|
|
1524
1529
|
},
|
|
1525
1530
|
disabled: lt,
|
|
@@ -1559,9 +1564,9 @@ const nt = (t) => {
|
|
|
1559
1564
|
placeholder: "How can I help you...",
|
|
1560
1565
|
value: St,
|
|
1561
1566
|
autoFocus: !0,
|
|
1562
|
-
onChange: (
|
|
1563
|
-
onKeyDown: (
|
|
1564
|
-
|
|
1567
|
+
onChange: (s) => Ct(s.target.value),
|
|
1568
|
+
onKeyDown: (s) => {
|
|
1569
|
+
s.key === "Enter" && !ct && D();
|
|
1565
1570
|
}
|
|
1566
1571
|
}
|
|
1567
1572
|
),
|
|
@@ -1647,9 +1652,9 @@ function Or(t, e) {
|
|
|
1647
1652
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1648
1653
|
return r;
|
|
1649
1654
|
}
|
|
1650
|
-
var Qt = "Invariant Violation",
|
|
1655
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, $r = _e === void 0 ? function(t, e) {
|
|
1651
1656
|
return t.__proto__ = e, t;
|
|
1652
|
-
} :
|
|
1657
|
+
} : _e, Ye = (
|
|
1653
1658
|
/** @class */
|
|
1654
1659
|
(function(t) {
|
|
1655
1660
|
Pr(e, t);
|
|
@@ -1661,7 +1666,7 @@ var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, $r = Ce === void 0 ?
|
|
|
1661
1666
|
return e;
|
|
1662
1667
|
})(Error)
|
|
1663
1668
|
);
|
|
1664
|
-
function
|
|
1669
|
+
function ot(t, e) {
|
|
1665
1670
|
if (!t)
|
|
1666
1671
|
throw new Ye(e);
|
|
1667
1672
|
}
|
|
@@ -1676,7 +1681,7 @@ function Bt(t) {
|
|
|
1676
1681
|
}
|
|
1677
1682
|
(function(t) {
|
|
1678
1683
|
t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
|
|
1679
|
-
})(
|
|
1684
|
+
})(ot || (ot = {}));
|
|
1680
1685
|
var Je = "3.14.0";
|
|
1681
1686
|
function bt(t) {
|
|
1682
1687
|
try {
|
|
@@ -1726,12 +1731,12 @@ function Ut(t) {
|
|
|
1726
1731
|
var Zt = Object.assign(function(e, r) {
|
|
1727
1732
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1728
1733
|
o[n - 2] = arguments[n];
|
|
1729
|
-
e ||
|
|
1734
|
+
e || ot(e, le(r, o) || ce(r, o));
|
|
1730
1735
|
}, {
|
|
1731
|
-
debug: Ut(
|
|
1732
|
-
log: Ut(
|
|
1733
|
-
warn: Ut(
|
|
1734
|
-
error: Ut(
|
|
1736
|
+
debug: Ut(ot.debug),
|
|
1737
|
+
log: Ut(ot.log),
|
|
1738
|
+
warn: Ut(ot.warn),
|
|
1739
|
+
error: Ut(ot.error)
|
|
1735
1740
|
});
|
|
1736
1741
|
function We(t) {
|
|
1737
1742
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
@@ -1797,12 +1802,12 @@ const Br = () => class {
|
|
|
1797
1802
|
const c = {
|
|
1798
1803
|
__proto__: null,
|
|
1799
1804
|
[this.id]: e
|
|
1800
|
-
},
|
|
1801
|
-
N = { parent:
|
|
1805
|
+
}, l = N;
|
|
1806
|
+
N = { parent: l, slots: c };
|
|
1802
1807
|
try {
|
|
1803
1808
|
return r.apply(n, o);
|
|
1804
1809
|
} finally {
|
|
1805
|
-
N =
|
|
1810
|
+
N = l;
|
|
1806
1811
|
}
|
|
1807
1812
|
}
|
|
1808
1813
|
// Capture the current context and wrap a callback function so that it
|
|
@@ -1866,7 +1871,7 @@ Array[te] || (function(t) {
|
|
|
1866
1871
|
} finally {
|
|
1867
1872
|
return t;
|
|
1868
1873
|
}
|
|
1869
|
-
})(Br()), { bind:
|
|
1874
|
+
})(Br()), { bind: Co, noContext: _o } = de;
|
|
1870
1875
|
new de();
|
|
1871
1876
|
function qr(t, e) {
|
|
1872
1877
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
@@ -2061,9 +2066,9 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2061
2066
|
}), new Yr(o, this._subscriber);
|
|
2062
2067
|
}, e.forEach = function(o) {
|
|
2063
2068
|
var n = this;
|
|
2064
|
-
return new Promise(function(c,
|
|
2069
|
+
return new Promise(function(c, l) {
|
|
2065
2070
|
if (typeof o != "function") {
|
|
2066
|
-
|
|
2071
|
+
l(new TypeError(o + " is not a function"));
|
|
2067
2072
|
return;
|
|
2068
2073
|
}
|
|
2069
2074
|
function d() {
|
|
@@ -2074,10 +2079,10 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2074
2079
|
try {
|
|
2075
2080
|
o(y, d);
|
|
2076
2081
|
} catch (g) {
|
|
2077
|
-
|
|
2082
|
+
l(g), i.unsubscribe();
|
|
2078
2083
|
}
|
|
2079
2084
|
},
|
|
2080
|
-
error:
|
|
2085
|
+
error: l,
|
|
2081
2086
|
complete: c
|
|
2082
2087
|
});
|
|
2083
2088
|
});
|
|
@@ -2085,21 +2090,21 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2085
2090
|
var n = this;
|
|
2086
2091
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2087
2092
|
var c = Nt(this);
|
|
2088
|
-
return new c(function(
|
|
2093
|
+
return new c(function(l) {
|
|
2089
2094
|
return n.subscribe({
|
|
2090
2095
|
next: function(d) {
|
|
2091
2096
|
try {
|
|
2092
2097
|
d = o(d);
|
|
2093
2098
|
} catch (i) {
|
|
2094
|
-
return
|
|
2099
|
+
return l.error(i);
|
|
2095
2100
|
}
|
|
2096
|
-
|
|
2101
|
+
l.next(d);
|
|
2097
2102
|
},
|
|
2098
2103
|
error: function(d) {
|
|
2099
|
-
|
|
2104
|
+
l.error(d);
|
|
2100
2105
|
},
|
|
2101
2106
|
complete: function() {
|
|
2102
|
-
|
|
2107
|
+
l.complete();
|
|
2103
2108
|
}
|
|
2104
2109
|
});
|
|
2105
2110
|
});
|
|
@@ -2107,58 +2112,58 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2107
2112
|
var n = this;
|
|
2108
2113
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2109
2114
|
var c = Nt(this);
|
|
2110
|
-
return new c(function(
|
|
2115
|
+
return new c(function(l) {
|
|
2111
2116
|
return n.subscribe({
|
|
2112
2117
|
next: function(d) {
|
|
2113
2118
|
try {
|
|
2114
2119
|
if (!o(d)) return;
|
|
2115
2120
|
} catch (i) {
|
|
2116
|
-
return
|
|
2121
|
+
return l.error(i);
|
|
2117
2122
|
}
|
|
2118
|
-
|
|
2123
|
+
l.next(d);
|
|
2119
2124
|
},
|
|
2120
2125
|
error: function(d) {
|
|
2121
|
-
|
|
2126
|
+
l.error(d);
|
|
2122
2127
|
},
|
|
2123
2128
|
complete: function() {
|
|
2124
|
-
|
|
2129
|
+
l.complete();
|
|
2125
2130
|
}
|
|
2126
2131
|
});
|
|
2127
2132
|
});
|
|
2128
2133
|
}, e.reduce = function(o) {
|
|
2129
2134
|
var n = this;
|
|
2130
2135
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2131
|
-
var c = Nt(this),
|
|
2136
|
+
var c = Nt(this), l = arguments.length > 1, d = !1, i = arguments[1], y = i;
|
|
2132
2137
|
return new c(function(g) {
|
|
2133
2138
|
return n.subscribe({
|
|
2134
|
-
next: function(
|
|
2135
|
-
var
|
|
2136
|
-
if (d = !0, !
|
|
2139
|
+
next: function(S) {
|
|
2140
|
+
var _ = !d;
|
|
2141
|
+
if (d = !0, !_ || l)
|
|
2137
2142
|
try {
|
|
2138
|
-
y = o(y,
|
|
2143
|
+
y = o(y, S);
|
|
2139
2144
|
} catch (F) {
|
|
2140
2145
|
return g.error(F);
|
|
2141
2146
|
}
|
|
2142
2147
|
else
|
|
2143
|
-
y =
|
|
2148
|
+
y = S;
|
|
2144
2149
|
},
|
|
2145
|
-
error: function(
|
|
2146
|
-
g.error(
|
|
2150
|
+
error: function(S) {
|
|
2151
|
+
g.error(S);
|
|
2147
2152
|
},
|
|
2148
2153
|
complete: function() {
|
|
2149
|
-
if (!d && !
|
|
2154
|
+
if (!d && !l) return g.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2150
2155
|
g.next(y), g.complete();
|
|
2151
2156
|
}
|
|
2152
2157
|
});
|
|
2153
2158
|
});
|
|
2154
2159
|
}, e.concat = function() {
|
|
2155
|
-
for (var o = this, n = arguments.length, c = new Array(n),
|
|
2156
|
-
c[
|
|
2160
|
+
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2161
|
+
c[l] = arguments[l];
|
|
2157
2162
|
var d = Nt(this);
|
|
2158
2163
|
return new d(function(i) {
|
|
2159
2164
|
var y, g = 0;
|
|
2160
|
-
function _
|
|
2161
|
-
y =
|
|
2165
|
+
function S(_) {
|
|
2166
|
+
y = _.subscribe({
|
|
2162
2167
|
next: function(F) {
|
|
2163
2168
|
i.next(F);
|
|
2164
2169
|
},
|
|
@@ -2166,11 +2171,11 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2166
2171
|
i.error(F);
|
|
2167
2172
|
},
|
|
2168
2173
|
complete: function() {
|
|
2169
|
-
g === c.length ? (y = void 0, i.complete()) :
|
|
2174
|
+
g === c.length ? (y = void 0, i.complete()) : S(d.from(c[g++]));
|
|
2170
2175
|
}
|
|
2171
2176
|
});
|
|
2172
2177
|
}
|
|
2173
|
-
return
|
|
2178
|
+
return S(o), function() {
|
|
2174
2179
|
y && (y.unsubscribe(), y = void 0);
|
|
2175
2180
|
};
|
|
2176
2181
|
});
|
|
@@ -2178,38 +2183,38 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2178
2183
|
var n = this;
|
|
2179
2184
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2180
2185
|
var c = Nt(this);
|
|
2181
|
-
return new c(function(
|
|
2186
|
+
return new c(function(l) {
|
|
2182
2187
|
var d = [], i = n.subscribe({
|
|
2183
2188
|
next: function(g) {
|
|
2184
2189
|
if (o)
|
|
2185
2190
|
try {
|
|
2186
2191
|
g = o(g);
|
|
2187
|
-
} catch (
|
|
2188
|
-
return
|
|
2192
|
+
} catch (_) {
|
|
2193
|
+
return l.error(_);
|
|
2189
2194
|
}
|
|
2190
|
-
var
|
|
2191
|
-
next: function(
|
|
2192
|
-
|
|
2195
|
+
var S = c.from(g).subscribe({
|
|
2196
|
+
next: function(_) {
|
|
2197
|
+
l.next(_);
|
|
2193
2198
|
},
|
|
2194
|
-
error: function(
|
|
2195
|
-
|
|
2199
|
+
error: function(_) {
|
|
2200
|
+
l.error(_);
|
|
2196
2201
|
},
|
|
2197
2202
|
complete: function() {
|
|
2198
|
-
var
|
|
2199
|
-
|
|
2203
|
+
var _ = d.indexOf(S);
|
|
2204
|
+
_ >= 0 && d.splice(_, 1), y();
|
|
2200
2205
|
}
|
|
2201
2206
|
});
|
|
2202
|
-
d.push(
|
|
2207
|
+
d.push(S);
|
|
2203
2208
|
},
|
|
2204
2209
|
error: function(g) {
|
|
2205
|
-
|
|
2210
|
+
l.error(g);
|
|
2206
2211
|
},
|
|
2207
2212
|
complete: function() {
|
|
2208
2213
|
y();
|
|
2209
2214
|
}
|
|
2210
2215
|
});
|
|
2211
2216
|
function y() {
|
|
2212
|
-
i.closed && d.length === 0 &&
|
|
2217
|
+
i.closed && d.length === 0 && l.complete();
|
|
2213
2218
|
}
|
|
2214
2219
|
return function() {
|
|
2215
2220
|
d.forEach(function(g) {
|
|
@@ -2224,10 +2229,10 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2224
2229
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2225
2230
|
var c = Jt(o, ie);
|
|
2226
2231
|
if (c) {
|
|
2227
|
-
var
|
|
2228
|
-
if (Object(
|
|
2229
|
-
return Vr(
|
|
2230
|
-
return
|
|
2232
|
+
var l = c.call(o);
|
|
2233
|
+
if (Object(l) !== l) throw new TypeError(l + " is not an object");
|
|
2234
|
+
return Vr(l) && l.constructor === n ? l : new n(function(d) {
|
|
2235
|
+
return l.subscribe(d);
|
|
2231
2236
|
});
|
|
2232
2237
|
}
|
|
2233
2238
|
if (fe("iterator") && (c = Jt(o, Hr), c))
|
|
@@ -2256,8 +2261,8 @@ var Yr = /* @__PURE__ */ (function() {
|
|
|
2256
2261
|
}, t.of = function() {
|
|
2257
2262
|
for (var o = arguments.length, n = new Array(o), c = 0; c < o; c++)
|
|
2258
2263
|
n[c] = arguments[c];
|
|
2259
|
-
var
|
|
2260
|
-
return new
|
|
2264
|
+
var l = typeof this == "function" ? this : t;
|
|
2265
|
+
return new l(function(d) {
|
|
2261
2266
|
Mt(function() {
|
|
2262
2267
|
if (!d.closed) {
|
|
2263
2268
|
for (var i = 0; i < n.length; ++i)
|
|
@@ -2371,12 +2376,12 @@ var tr = (
|
|
|
2371
2376
|
return r.concat(o);
|
|
2372
2377
|
});
|
|
2373
2378
|
}, t.split = function(e, r, o) {
|
|
2374
|
-
var n = Et(r), c = Et(o || new t(Ae)),
|
|
2375
|
-
return qt(n) && qt(c) ?
|
|
2379
|
+
var n = Et(r), c = Et(o || new t(Ae)), l;
|
|
2380
|
+
return qt(n) && qt(c) ? l = new t(function(d) {
|
|
2376
2381
|
return e(d) ? n.request(d) || E.of() : c.request(d) || E.of();
|
|
2377
|
-
}) :
|
|
2382
|
+
}) : l = new t(function(d, i) {
|
|
2378
2383
|
return e(d) ? n.request(d, i) || E.of() : c.request(d, i) || E.of();
|
|
2379
|
-
}), Object.assign(
|
|
2384
|
+
}), Object.assign(l, { left: n, right: c });
|
|
2380
2385
|
}, t.execute = function(e, r) {
|
|
2381
2386
|
return e.request(Gr(r.context, Xr(Wr(r)))) || E.of();
|
|
2382
2387
|
}, t.concat = function(e, r) {
|
|
@@ -2384,12 +2389,12 @@ var tr = (
|
|
|
2384
2389
|
if (qt(o))
|
|
2385
2390
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2386
2391
|
var n = Et(r), c;
|
|
2387
|
-
return qt(n) ? c = new t(function(
|
|
2388
|
-
return o.request(
|
|
2392
|
+
return qt(n) ? c = new t(function(l) {
|
|
2393
|
+
return o.request(l, function(d) {
|
|
2389
2394
|
return n.request(d) || E.of();
|
|
2390
2395
|
}) || E.of();
|
|
2391
|
-
}) : c = new t(function(
|
|
2392
|
-
return o.request(
|
|
2396
|
+
}) : c = new t(function(l, d) {
|
|
2397
|
+
return o.request(l, function(i) {
|
|
2393
2398
|
return n.request(i, d) || E.of();
|
|
2394
2399
|
}) || E.of();
|
|
2395
2400
|
}), Object.assign(c, { left: o, right: n });
|
|
@@ -2414,17 +2419,17 @@ function oo(t) {
|
|
|
2414
2419
|
return new tr(function(e, r) {
|
|
2415
2420
|
var o = Or(e, []);
|
|
2416
2421
|
return new E(function(n) {
|
|
2417
|
-
var c,
|
|
2422
|
+
var c, l = !1;
|
|
2418
2423
|
return Promise.resolve(o).then(function(d) {
|
|
2419
2424
|
return t(d, e.getContext());
|
|
2420
2425
|
}).then(e.setContext).then(function() {
|
|
2421
|
-
|
|
2426
|
+
l || (c = r(e).subscribe({
|
|
2422
2427
|
next: n.next.bind(n),
|
|
2423
2428
|
error: n.error.bind(n),
|
|
2424
2429
|
complete: n.complete.bind(n)
|
|
2425
2430
|
}));
|
|
2426
2431
|
}).catch(n.error.bind(n)), function() {
|
|
2427
|
-
|
|
2432
|
+
l = !0, c && c.unsubscribe();
|
|
2428
2433
|
};
|
|
2429
2434
|
});
|
|
2430
2435
|
});
|