tanya-chatbot 0.6.0 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as H, useState as L, useRef as xt } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
|
-
import { createHttpLink as
|
|
4
|
-
import { Provider as
|
|
5
|
-
import { createSlice as
|
|
6
|
-
import * as
|
|
3
|
+
import { createHttpLink as sr, ApolloClient as lr, InMemoryCache as cr, ApolloProvider as dr } from "@apollo/client";
|
|
4
|
+
import { Provider as ur, useDispatch as je, useSelector as Rt } from "react-redux";
|
|
5
|
+
import { createSlice as De, configureStore as pr } from "@reduxjs/toolkit";
|
|
6
|
+
import * as Le from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import $ from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
11
|
import { Icon as be } from "@iconify/react";
|
|
12
|
-
import { toast as
|
|
13
|
-
const mr = '*,: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}}';
|
|
12
|
+
import { toast as R } from "react-toastify";
|
|
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 ko() {
|
|
15
|
-
return
|
|
15
|
+
return H(() => {
|
|
16
16
|
if (typeof document < "u") {
|
|
17
17
|
const t = document.createElement("style");
|
|
18
|
-
return t.textContent =
|
|
18
|
+
return t.textContent = fr, document.head.appendChild(t), () => {
|
|
19
19
|
document.head.removeChild(t);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
22
|
}, []), null;
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const mr = {
|
|
25
25
|
store: {
|
|
26
26
|
storeCode: "",
|
|
27
27
|
storeName: "",
|
|
@@ -55,30 +55,30 @@ const hr = {
|
|
|
55
55
|
mobile: []
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
},
|
|
58
|
+
}, Be = De({
|
|
59
59
|
name: "store",
|
|
60
|
-
initialState:
|
|
60
|
+
initialState: mr,
|
|
61
61
|
reducers: {
|
|
62
62
|
setStore: (t, e) => {
|
|
63
63
|
t.store = e.payload;
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
}), { setStore: So } =
|
|
66
|
+
}), { setStore: So } = Be.actions, hr = Be.reducer, wr = {
|
|
67
67
|
product: null
|
|
68
|
-
},
|
|
68
|
+
}, Ue = De({
|
|
69
69
|
name: "product",
|
|
70
|
-
initialState:
|
|
70
|
+
initialState: wr,
|
|
71
71
|
reducers: {
|
|
72
72
|
setProduct: (t, e) => {
|
|
73
73
|
t.product = e.payload;
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
}), { setProduct: oe } =
|
|
76
|
+
}), { setProduct: oe } = Ue.actions, gr = Ue.reducer, br = pr({
|
|
77
77
|
reducer: {
|
|
78
|
-
store:
|
|
79
|
-
product:
|
|
78
|
+
store: hr,
|
|
79
|
+
product: gr
|
|
80
80
|
}
|
|
81
|
-
}),
|
|
81
|
+
}), xr = ({ children: t }) => /* @__PURE__ */ a(ur, { store: br, children: t }), Vt = (t) => {
|
|
82
82
|
const e = new CustomEvent("reactCartUpdated", {
|
|
83
83
|
detail: {
|
|
84
84
|
cartUpdated: !0,
|
|
@@ -87,31 +87,31 @@ const hr = {
|
|
|
87
87
|
});
|
|
88
88
|
window.dispatchEvent(e);
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function yr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
|
-
return /* @__PURE__ */ a(
|
|
93
|
+
return /* @__PURE__ */ a(Le.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function vr({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
|
-
return /* @__PURE__ */ a(
|
|
98
|
+
return /* @__PURE__ */ a(Le.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }),
|
|
100
|
+
const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1.amazonaws.com/dev/api/bedrock/invoke/stream", xAPIKey: "BJBtjpPkqGatuoa3qJqdR8aHXSsHkgvGaootbubi", serverUrl: "https://tanya-sfcc-server.vercel.app/", basePath: "sc-api" }), qe = async () => {
|
|
101
101
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
102
102
|
try {
|
|
103
|
-
const e = await
|
|
104
|
-
`${t}api/auth/token-bm-grant?baseUrl=${
|
|
103
|
+
const e = await $.post(
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${ot()}&siteId=${G()}`
|
|
105
105
|
);
|
|
106
106
|
return e.status === 200 && e.data.access_token ? e.data.access_token : (console.error("Failed to fetch token:", e.data), null);
|
|
107
107
|
} catch (e) {
|
|
108
|
-
return
|
|
108
|
+
return $.isAxiosError(e) ? console.error("Error fetching token:", e.response || e.message) : console.error("Unexpected error:", e), null;
|
|
109
109
|
}
|
|
110
|
-
},
|
|
110
|
+
}, Me = async (t) => {
|
|
111
111
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
112
112
|
try {
|
|
113
|
-
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await
|
|
114
|
-
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
113
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, o = await $.post(
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -122,26 +122,26 @@ const St = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
122
122
|
);
|
|
123
123
|
return o.status === 200 && o.data ? o.data : null;
|
|
124
124
|
} catch (r) {
|
|
125
|
-
return
|
|
125
|
+
return $.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
|
-
async function
|
|
128
|
+
async function Pt() {
|
|
129
129
|
var c;
|
|
130
|
-
const t =
|
|
130
|
+
const t = G(), 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 ot = () => sessionStorage.getItem("Host"), G = () => sessionStorage.getItem("SiteId"), st = () => sessionStorage.getItem("pubCfg"), lt = () => sessionStorage.getItem("envRef"), ct = () => sessionStorage.getItem("orgRef"), kr = async (t) => {
|
|
134
134
|
console.log("fetching results");
|
|
135
135
|
const { serverUrl: e, basePath: r } = St();
|
|
136
136
|
let o = "";
|
|
137
137
|
{
|
|
138
|
-
const n = await
|
|
138
|
+
const n = await Pt();
|
|
139
139
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
140
140
|
}
|
|
141
141
|
try {
|
|
142
|
-
const n =
|
|
143
|
-
return (await
|
|
144
|
-
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${
|
|
142
|
+
const n = ot();
|
|
143
|
+
return (await $.get(
|
|
144
|
+
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
145
145
|
{
|
|
146
146
|
headers: {
|
|
147
147
|
"Content-Type": "application/json",
|
|
@@ -152,13 +152,13 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
152
152
|
} catch (n) {
|
|
153
153
|
throw console.error("Error fetching search results:", n), n;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
155
|
+
}, He = async (t) => {
|
|
156
156
|
if (!t) throw new Error("Product ID is required");
|
|
157
|
-
const { serverUrl: e, basePath: r } = St(), o =
|
|
157
|
+
const { serverUrl: e, basePath: r } = St(), o = ot();
|
|
158
158
|
console.log("calling access");
|
|
159
|
-
const { access_token: n } = await
|
|
160
|
-
return (await
|
|
161
|
-
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${
|
|
159
|
+
const { access_token: n } = await Pt();
|
|
160
|
+
return (await $.get(
|
|
161
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
162
162
|
{
|
|
163
163
|
headers: {
|
|
164
164
|
"Content-Type": "application/json",
|
|
@@ -168,11 +168,11 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
168
168
|
)).data;
|
|
169
169
|
}, Sr = async (t) => {
|
|
170
170
|
if (!t) throw new Error("customerId is required");
|
|
171
|
-
const e = await
|
|
171
|
+
const e = await qe(), { customer_token: r } = await Me(
|
|
172
172
|
e
|
|
173
|
-
), { serverUrl: o, basePath: n } = St(), l = (await
|
|
174
|
-
return (await
|
|
175
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
173
|
+
), { serverUrl: o, basePath: n } = St(), l = (await Pt()).access_token;
|
|
174
|
+
return (await $.get(
|
|
175
|
+
`${o}${n}/get-interest?baseUrl=${ot()}&customerId=${t}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
176
176
|
{
|
|
177
177
|
headers: {
|
|
178
178
|
"Content-Type": "application/json",
|
|
@@ -180,10 +180,10 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
180
180
|
}
|
|
181
181
|
}
|
|
182
182
|
)).data;
|
|
183
|
-
},
|
|
183
|
+
}, xe = (t) => String(typeof t == "string" ? t : t["en-US"] || t), ye = (t) => t != null && t.image ? [t.image] : "variants" in t ? t.variants[0].images : t.masterVariant.images.map((e) => e.url), _r = (t, e) => t.toLocaleString("en-US", {
|
|
184
184
|
style: "currency",
|
|
185
185
|
currency: e || "USD"
|
|
186
|
-
}),
|
|
186
|
+
}), ve = (t) => {
|
|
187
187
|
var e, r, o;
|
|
188
188
|
return "variants" in t ? {
|
|
189
189
|
centAmount: (e = t.variants[0]) == null ? void 0 : e.prices.EUR.max,
|
|
@@ -192,13 +192,13 @@ const tt = () => sessionStorage.getItem("Host"), J = () => sessionStorage.getIte
|
|
|
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
|
-
}, Cr = (t) => t.charAt(0).toUpperCase() + t.slice(1),
|
|
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
199
|
function Ir() {
|
|
200
|
-
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] =
|
|
201
|
-
return
|
|
200
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = L(t);
|
|
201
|
+
return H(() => {
|
|
202
202
|
const o = () => r(t());
|
|
203
203
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
204
204
|
}, []), e;
|
|
@@ -206,7 +206,7 @@ function Ir() {
|
|
|
206
206
|
const Fr = ({
|
|
207
207
|
product: t
|
|
208
208
|
}) => {
|
|
209
|
-
const e =
|
|
209
|
+
const e = je(), r = Ir(), [o, n] = L(0), c = () => {
|
|
210
210
|
n(
|
|
211
211
|
(s) => s + r >= t.length ? 0 : s + r
|
|
212
212
|
);
|
|
@@ -215,8 +215,8 @@ const Fr = ({
|
|
|
215
215
|
(s) => s - r < 0 ? t.length - (t.length % r || r) : s - r
|
|
216
216
|
);
|
|
217
217
|
}, d = async (s) => {
|
|
218
|
-
const
|
|
219
|
-
e(oe(
|
|
218
|
+
const m = await He(s);
|
|
219
|
+
e(oe(m));
|
|
220
220
|
};
|
|
221
221
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
222
222
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
@@ -233,7 +233,7 @@ const Fr = ({
|
|
|
233
233
|
}
|
|
234
234
|
),
|
|
235
235
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((s) => {
|
|
236
|
-
var
|
|
236
|
+
var m, h, I, v;
|
|
237
237
|
return /* @__PURE__ */ u(
|
|
238
238
|
"div",
|
|
239
239
|
{
|
|
@@ -245,7 +245,7 @@ const Fr = ({
|
|
|
245
245
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
246
246
|
"img",
|
|
247
247
|
{
|
|
248
|
-
src: ((
|
|
248
|
+
src: ((m = ye(s)[0]) == null ? void 0 : m.link) || ye(s)[0] || // fallback if it's a string
|
|
249
249
|
"https://via.placeholder.com/120",
|
|
250
250
|
alt: s != null && s.productName ? s.productName : "Product",
|
|
251
251
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -257,8 +257,8 @@ const Fr = ({
|
|
|
257
257
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
260
|
-
/* @__PURE__ */ a("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 :
|
|
261
|
-
|
|
260
|
+
/* @__PURE__ */ a("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 : ke(
|
|
261
|
+
xe((h = s == null ? void 0 : s.name) == null ? void 0 : h["en-US"]),
|
|
262
262
|
60
|
|
263
263
|
) || "Product" }),
|
|
264
264
|
/* @__PURE__ */ a(
|
|
@@ -272,8 +272,8 @@ const Fr = ({
|
|
|
272
272
|
marginBottom: "5px",
|
|
273
273
|
zIndex: 50
|
|
274
274
|
},
|
|
275
|
-
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name :
|
|
276
|
-
|
|
275
|
+
children: s != null && s.productName ? s.productName : s != null && s.product_name ? s.product_name : ke(
|
|
276
|
+
xe((I = s == null ? void 0 : s.name) == null ? void 0 : I["en-US"]),
|
|
277
277
|
60
|
|
278
278
|
) || "Product"
|
|
279
279
|
}
|
|
@@ -281,8 +281,8 @@ const Fr = ({
|
|
|
281
281
|
] }),
|
|
282
282
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
283
283
|
/* @__PURE__ */ a("p", { children: _r(
|
|
284
|
-
s != null && s.price ? Number(s == null ? void 0 : s.price) :
|
|
285
|
-
(
|
|
284
|
+
s != null && s.price ? Number(s == null ? void 0 : s.price) : ve(s).centAmount || 0,
|
|
285
|
+
(v = ve(s)) == null ? void 0 : v.currencyCode
|
|
286
286
|
) }),
|
|
287
287
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
288
288
|
"$",
|
|
@@ -337,12 +337,12 @@ const Fr = ({
|
|
|
337
337
|
]
|
|
338
338
|
},
|
|
339
339
|
o
|
|
340
|
-
)) }),
|
|
340
|
+
)) }), Re = async (t, e) => {
|
|
341
341
|
var c, l;
|
|
342
342
|
const { serverUrl: r, basePath: o } = St(), n = `${r}`;
|
|
343
343
|
try {
|
|
344
|
-
const d = await
|
|
345
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
344
|
+
const d = await $.post(
|
|
345
|
+
`${n}${o}/basket/create?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
346
346
|
e,
|
|
347
347
|
{
|
|
348
348
|
headers: {
|
|
@@ -359,13 +359,13 @@ const Fr = ({
|
|
|
359
359
|
"*"
|
|
360
360
|
), d.data;
|
|
361
361
|
} catch (d) {
|
|
362
|
-
return
|
|
362
|
+
return $.isAxiosError(d) ? console.error("Error creating basket:", d.response || d.message) : console.error("Unexpected error:", d), null;
|
|
363
363
|
}
|
|
364
364
|
}, ne = async (t, e, r) => {
|
|
365
365
|
const { serverUrl: o, basePath: n } = St(), c = `${o}`;
|
|
366
366
|
try {
|
|
367
|
-
const l = await
|
|
368
|
-
`${c}${n}/basket/add-product/${t}?baseUrl=${
|
|
367
|
+
const l = await $.post(
|
|
368
|
+
`${c}${n}/basket/add-product/${t}?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
369
369
|
e,
|
|
370
370
|
{
|
|
371
371
|
headers: {
|
|
@@ -376,20 +376,20 @@ const Fr = ({
|
|
|
376
376
|
);
|
|
377
377
|
return l.status === 200 && l.data ? l.data : null;
|
|
378
378
|
} catch (l) {
|
|
379
|
-
return
|
|
379
|
+
return $.isAxiosError(l) ? console.error(
|
|
380
380
|
"Error adding products to basket:",
|
|
381
381
|
l.response || l.message
|
|
382
382
|
) : console.error("Unexpected error:", l), null;
|
|
383
383
|
}
|
|
384
|
-
},
|
|
384
|
+
}, Ve = async ({
|
|
385
385
|
basketId: t,
|
|
386
386
|
customer_token: e
|
|
387
387
|
}) => {
|
|
388
388
|
var c;
|
|
389
389
|
const { serverUrl: r, basePath: o } = St(), n = `${r}`;
|
|
390
390
|
try {
|
|
391
|
-
const l = await
|
|
392
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
391
|
+
const l = await $.get(
|
|
392
|
+
`${n}${o}/basket/${t}?baseUrl=${ot()}&siteId=${G()}&pubCfg=${st()}&envRef=${lt()}&orgRef=${ct()}`,
|
|
393
393
|
{
|
|
394
394
|
headers: {
|
|
395
395
|
"Content-Type": "application/json",
|
|
@@ -399,10 +399,10 @@ const Fr = ({
|
|
|
399
399
|
);
|
|
400
400
|
return { status: l.status, data: l.data };
|
|
401
401
|
} catch (l) {
|
|
402
|
-
return
|
|
402
|
+
return $.isAxiosError(l) ? { status: (c = l.response) == null ? void 0 : c.status, data: null } : { status: null, data: null };
|
|
403
403
|
}
|
|
404
|
-
}, Yt = "sfcc_basket_id",
|
|
405
|
-
const
|
|
404
|
+
}, Yt = "sfcc_basket_id", Se = "sfcc_customer_token", Tt = "sfcc_token_expiry", Er = 300 * 1e3, Bt = "1.0.0";
|
|
405
|
+
const it = (t) => {
|
|
406
406
|
try {
|
|
407
407
|
t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
|
|
408
408
|
} catch (e) {
|
|
@@ -411,102 +411,102 @@ const nt = (t) => {
|
|
|
411
411
|
}, Kt = (t) => {
|
|
412
412
|
try {
|
|
413
413
|
if (t) {
|
|
414
|
-
localStorage.setItem(
|
|
414
|
+
localStorage.setItem(Se, t);
|
|
415
415
|
const e = Date.now() + Er;
|
|
416
|
-
localStorage.setItem(
|
|
416
|
+
localStorage.setItem(Tt, e.toString());
|
|
417
417
|
} else
|
|
418
|
-
localStorage.removeItem(
|
|
418
|
+
localStorage.removeItem(Se);
|
|
419
419
|
} catch (e) {
|
|
420
420
|
console.error("Error storing token:", e);
|
|
421
421
|
}
|
|
422
|
-
},
|
|
423
|
-
var s,
|
|
424
|
-
const e =
|
|
425
|
-
if (
|
|
422
|
+
}, _e = 300, Tr = ({ addToCartPwa: t }) => {
|
|
423
|
+
var s, m, h, I, v, V;
|
|
424
|
+
const e = je(), r = Rt((E) => E.product.product), o = Rt((E) => E.store.store), [n, c] = L(!!r);
|
|
425
|
+
if (H(() => {
|
|
426
426
|
c(!!r);
|
|
427
427
|
}, [r]), !r) return null;
|
|
428
428
|
const l = async () => {
|
|
429
|
-
var
|
|
429
|
+
var E, z, X, dt, Y, ut, _t, Ot, pt, Ct, It, ft, $t, zt, nt, B;
|
|
430
430
|
try {
|
|
431
|
-
if (!((
|
|
432
|
-
|
|
431
|
+
if (!((z = (E = r == null ? void 0 : r.variants) == null ? void 0 : E[0]) != null && z.product_id) && !(r.type.item || r.type.bundle) && !((dt = (X = r == null ? void 0 : r.variants) == null ? void 0 : X[0]) != null && dt.productId)) {
|
|
432
|
+
R.error("Variants not available", {
|
|
433
433
|
position: "bottom-right",
|
|
434
434
|
autoClose: 1e3
|
|
435
435
|
}), console.error("No product variant found");
|
|
436
436
|
return;
|
|
437
437
|
}
|
|
438
|
-
const
|
|
438
|
+
const k = [
|
|
439
439
|
{
|
|
440
|
-
product_id: ((
|
|
440
|
+
product_id: ((Y = r.variants) == null ? void 0 : Y[0].product_id) || ((ut = r.variants) == null ? void 0 : ut[0].productId) || (r == null ? void 0 : r.id),
|
|
441
441
|
quantity: 1
|
|
442
442
|
}
|
|
443
|
-
],
|
|
443
|
+
], b = JSON.parse(
|
|
444
444
|
sessionStorage.getItem("customerData") || "{}"
|
|
445
|
-
),
|
|
446
|
-
if (!Wt || !
|
|
447
|
-
let
|
|
448
|
-
if (
|
|
445
|
+
), mt = (b == null ? void 0 : b.basketId) || localStorage.getItem(Yt), Wt = !1, At = localStorage.getItem(Tt), jt = Date.now();
|
|
446
|
+
if (!Wt || !At || jt >= parseInt(At)) {
|
|
447
|
+
let j = "";
|
|
448
|
+
if (j = "Bearer " + (await Pt()).access_token, !j) {
|
|
449
449
|
console.error("Failed to get customer_token");
|
|
450
450
|
return;
|
|
451
451
|
}
|
|
452
|
-
const
|
|
453
|
-
if (Kt(
|
|
454
|
-
const Ft = await
|
|
455
|
-
basketId:
|
|
456
|
-
customer_token:
|
|
452
|
+
const ht = jt + 300 * 1e3;
|
|
453
|
+
if (Kt(j), localStorage.setItem(Tt, ht.toString()), mt) {
|
|
454
|
+
const Ft = await Ve({
|
|
455
|
+
basketId: mt,
|
|
456
|
+
customer_token: j
|
|
457
457
|
});
|
|
458
458
|
if (Ft.status === 200 && Ft) {
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
459
|
+
const U = await ne(
|
|
460
|
+
mt,
|
|
461
|
+
k,
|
|
462
|
+
j
|
|
463
463
|
);
|
|
464
|
-
(((_t =
|
|
464
|
+
(((_t = U == null ? void 0 : U.product_items) == null ? void 0 : _t.length) > 0 || ((Ot = U == null ? void 0 : U.productItems) == null ? void 0 : Ot.length) > 0) && (R.success("Added to cart", {
|
|
465
465
|
position: "bottom-right",
|
|
466
466
|
autoClose: 3e3,
|
|
467
467
|
hideProgressBar: !1,
|
|
468
468
|
closeOnClick: !0,
|
|
469
469
|
pauseOnHover: !0,
|
|
470
470
|
draggable: !0
|
|
471
|
-
}), Vt(
|
|
471
|
+
}), Vt(mt));
|
|
472
472
|
return;
|
|
473
473
|
}
|
|
474
474
|
}
|
|
475
|
-
const
|
|
475
|
+
const Dt = {
|
|
476
476
|
productItems: [
|
|
477
477
|
{
|
|
478
|
-
productId: ((
|
|
478
|
+
productId: ((pt = r.variants) == null ? void 0 : pt[0].product_id) || ((Ct = r.variants) == null ? void 0 : Ct[0].productId) || (r == null ? void 0 : r.id),
|
|
479
479
|
quantity: 1
|
|
480
480
|
}
|
|
481
481
|
]
|
|
482
|
-
},
|
|
483
|
-
if (!(
|
|
482
|
+
}, y = await Re(j, Dt);
|
|
483
|
+
if (!(y != null && y.basket_id) && !(y != null && y.basketId)) {
|
|
484
484
|
console.error("Failed to create basket");
|
|
485
485
|
return;
|
|
486
486
|
}
|
|
487
|
-
|
|
488
|
-
(
|
|
487
|
+
it(
|
|
488
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
489
489
|
), console.log("adding product to basket");
|
|
490
|
-
const
|
|
491
|
-
(
|
|
492
|
-
|
|
493
|
-
|
|
490
|
+
const Q = await ne(
|
|
491
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId),
|
|
492
|
+
k,
|
|
493
|
+
j
|
|
494
494
|
);
|
|
495
|
-
console.log("object added to basket"), (((It =
|
|
495
|
+
console.log("object added to basket"), (((It = Q == null ? void 0 : Q.product_items) == null ? void 0 : It.length) > 0 || ((ft = Q == null ? void 0 : Q.productItems) == null ? void 0 : ft.length) > 0) && R.success("Added to cart", {
|
|
496
496
|
position: "bottom-right",
|
|
497
497
|
autoClose: 3e3,
|
|
498
498
|
hideProgressBar: !1,
|
|
499
499
|
closeOnClick: !0,
|
|
500
500
|
pauseOnHover: !0,
|
|
501
501
|
draggable: !0
|
|
502
|
-
}), Vt(
|
|
502
|
+
}), Vt(y.basket_id || (y == null ? void 0 : y.basketId));
|
|
503
503
|
}
|
|
504
|
-
} catch (
|
|
505
|
-
console.error("Error adding to cart:",
|
|
504
|
+
} catch (k) {
|
|
505
|
+
console.error("Error adding to cart:", k), R.error("Failed to add product to cart", {
|
|
506
506
|
position: "bottom-right",
|
|
507
507
|
autoClose: 3e3
|
|
508
|
-
}), ((
|
|
509
|
-
((
|
|
508
|
+
}), (($t = k == null ? void 0 : k.response) == null ? void 0 : $t.status) === 404 || // Basket not found
|
|
509
|
+
((zt = k == null ? void 0 : k.response) == null ? void 0 : zt.status) === 401 ? (((nt = k == null ? void 0 : k.response) == null ? void 0 : nt.status) === 404 && it(null), ((B = k == null ? void 0 : k.response) == null ? void 0 : B.status) === 401 && (it(null), Kt(null))) : (console.error("Failed to add product to basket:", k.message), R.error("Failed to add product to cart", {
|
|
510
510
|
position: "bottom-right",
|
|
511
511
|
autoClose: 3e3
|
|
512
512
|
}));
|
|
@@ -520,7 +520,7 @@ const nt = (t) => {
|
|
|
520
520
|
{
|
|
521
521
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
522
522
|
onClick: () => {
|
|
523
|
-
c(!1), setTimeout(() => e(oe(null)),
|
|
523
|
+
c(!1), setTimeout(() => e(oe(null)), _e);
|
|
524
524
|
}
|
|
525
525
|
}
|
|
526
526
|
),
|
|
@@ -533,7 +533,7 @@ const nt = (t) => {
|
|
|
533
533
|
${n ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
534
534
|
`,
|
|
535
535
|
style: { willChange: "transform, opacity" },
|
|
536
|
-
onClick: (
|
|
536
|
+
onClick: (E) => E.stopPropagation(),
|
|
537
537
|
children: [
|
|
538
538
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
539
539
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
@@ -545,7 +545,7 @@ const nt = (t) => {
|
|
|
545
545
|
onClick: () => {
|
|
546
546
|
c(!1), setTimeout(
|
|
547
547
|
() => e(oe(null)),
|
|
548
|
-
|
|
548
|
+
_e
|
|
549
549
|
);
|
|
550
550
|
}
|
|
551
551
|
}
|
|
@@ -555,20 +555,20 @@ const nt = (t) => {
|
|
|
555
555
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
556
556
|
"img",
|
|
557
557
|
{
|
|
558
|
-
src: (
|
|
558
|
+
src: (I = (h = (m = (s = r.imageGroups) == null ? void 0 : s[0]) == null ? void 0 : m.images) == null ? void 0 : h[0]) == null ? void 0 : I.link,
|
|
559
559
|
alt: r.name,
|
|
560
560
|
className: "rounded-[10px]"
|
|
561
561
|
}
|
|
562
562
|
) }),
|
|
563
563
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
|
|
564
|
-
(
|
|
564
|
+
(E) => E.images.slice(1, 2).map((z) => /* @__PURE__ */ a(
|
|
565
565
|
"img",
|
|
566
566
|
{
|
|
567
|
-
src:
|
|
567
|
+
src: z.link,
|
|
568
568
|
alt: r.name,
|
|
569
569
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
570
570
|
},
|
|
571
|
-
|
|
571
|
+
z.link
|
|
572
572
|
))
|
|
573
573
|
) })
|
|
574
574
|
] }),
|
|
@@ -604,19 +604,19 @@ const nt = (t) => {
|
|
|
604
604
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
605
605
|
/* @__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: [
|
|
606
606
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
607
|
-
((
|
|
607
|
+
((v = r == null ? void 0 : r.rating) == null ? void 0 : v.rate) || 0,
|
|
608
608
|
" /",
|
|
609
609
|
" ",
|
|
610
610
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
611
611
|
] }),
|
|
612
612
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
613
613
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
614
|
-
((
|
|
614
|
+
((V = r == null ? void 0 : r.rating) == null ? void 0 : V.count) || 0,
|
|
615
615
|
" ratings"
|
|
616
616
|
] })
|
|
617
617
|
] }) }),
|
|
618
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
619
|
-
var
|
|
618
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((E, z) => {
|
|
619
|
+
var X;
|
|
620
620
|
return /* @__PURE__ */ a(
|
|
621
621
|
be,
|
|
622
622
|
{
|
|
@@ -624,10 +624,10 @@ const nt = (t) => {
|
|
|
624
624
|
width: "20",
|
|
625
625
|
height: "20",
|
|
626
626
|
className: `text-yellow-500
|
|
627
|
-
${((
|
|
627
|
+
${((X = r == null ? void 0 : r.rating) == null ? void 0 : X.rate) > z ? "text-yellow-500" : "text-gray-300"}
|
|
628
628
|
`
|
|
629
629
|
},
|
|
630
|
-
|
|
630
|
+
z
|
|
631
631
|
);
|
|
632
632
|
}) })
|
|
633
633
|
] }),
|
|
@@ -681,171 +681,174 @@ const nt = (t) => {
|
|
|
681
681
|
"Niece/Nephew": "his/her niece/nephew",
|
|
682
682
|
"My Friends": "his/her friends",
|
|
683
683
|
Others: "others"
|
|
684
|
-
}, c = xt(null), l = xt(null), d = xt(null), s = xt(null), [
|
|
684
|
+
}, c = xt(null), l = xt(null), d = xt(null), s = xt(null), [m, h] = L(null);
|
|
685
685
|
xt(null);
|
|
686
|
-
const [
|
|
686
|
+
const [I, v] = L(!1), [V, E] = L(!1), [z, X] = L(!1), [dt, Y] = L(!1), [ut, _t] = L(!1), [Ot, pt] = L(!1), [Ct, It] = L(""), [ft, $t] = L(""), zt = (i) => ({
|
|
687
687
|
id: i.id,
|
|
688
688
|
title: i.name,
|
|
689
689
|
image: i.image ?? "",
|
|
690
690
|
price: i.price ?? 0
|
|
691
|
-
}), [
|
|
692
|
-
|
|
691
|
+
}), [nt, B] = L([]), k = xt(null), b = Rt((i) => i.store.store), mt = Rt((i) => i.product.product);
|
|
692
|
+
H(() => {
|
|
693
693
|
const i = localStorage.getItem(
|
|
694
694
|
`access_token_${t.siteId}`
|
|
695
|
-
),
|
|
695
|
+
), x = localStorage.getItem(
|
|
696
696
|
`chat-token-${t.siteId}`
|
|
697
697
|
);
|
|
698
|
-
if (i &&
|
|
699
|
-
const
|
|
700
|
-
|
|
698
|
+
if (i && x === i) {
|
|
699
|
+
const w = localStorage.getItem("chatHistory");
|
|
700
|
+
w && B(JSON.parse(w));
|
|
701
701
|
} else
|
|
702
702
|
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
703
703
|
`chat-token-${t.siteId}`,
|
|
704
704
|
i || ""
|
|
705
705
|
);
|
|
706
|
-
}, []),
|
|
707
|
-
localStorage.setItem("chatHistory", JSON.stringify(
|
|
706
|
+
}, []), H(() => {
|
|
707
|
+
localStorage.setItem("chatHistory", JSON.stringify(nt));
|
|
708
708
|
const i = localStorage.getItem(
|
|
709
709
|
`access_token_${t.siteId}`
|
|
710
710
|
);
|
|
711
711
|
i && localStorage.setItem(`chat-token-${t.siteId}`, i);
|
|
712
|
-
}, [
|
|
712
|
+
}, [nt]);
|
|
713
713
|
const Wt = () => {
|
|
714
|
-
|
|
715
|
-
},
|
|
716
|
-
|
|
714
|
+
X(!0), setTimeout(() => E(!0), 10);
|
|
715
|
+
}, At = () => {
|
|
716
|
+
E(!1), setTimeout(() => X(!1), 300);
|
|
717
717
|
};
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
}, [
|
|
721
|
-
const
|
|
722
|
-
|
|
718
|
+
H(() => {
|
|
719
|
+
I ? Wt() : At();
|
|
720
|
+
}, [I]);
|
|
721
|
+
const jt = (i) => {
|
|
722
|
+
$t(n[i]);
|
|
723
723
|
};
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
724
|
+
H(() => {
|
|
725
|
+
z && k.current && k.current.scrollTo({
|
|
726
|
+
top: k.current.scrollHeight,
|
|
727
|
+
behavior: "smooth"
|
|
728
|
+
});
|
|
729
|
+
}, [nt, z]);
|
|
730
|
+
let j = null, ht = null;
|
|
731
|
+
const Dt = async () => {
|
|
732
|
+
if (j && ht && Date.now() < ht)
|
|
733
|
+
return j;
|
|
731
734
|
try {
|
|
732
|
-
const i = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",
|
|
735
|
+
const i = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", x = new URLSearchParams({
|
|
733
736
|
grant_type: "client_credentials",
|
|
734
737
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
735
738
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
736
739
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
737
|
-
}),
|
|
740
|
+
}), w = await fetch(i, {
|
|
738
741
|
method: "POST",
|
|
739
742
|
headers: {
|
|
740
743
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
741
744
|
},
|
|
742
|
-
body:
|
|
745
|
+
body: x
|
|
743
746
|
});
|
|
744
|
-
if (!
|
|
747
|
+
if (!w.ok)
|
|
745
748
|
throw new Error(
|
|
746
|
-
`Token request failed! status: ${
|
|
749
|
+
`Token request failed! status: ${w.status}`
|
|
747
750
|
);
|
|
748
|
-
const
|
|
749
|
-
|
|
750
|
-
const
|
|
751
|
-
return
|
|
751
|
+
const _ = await w.json();
|
|
752
|
+
j = _.access_token;
|
|
753
|
+
const S = _.expires_in || 3600;
|
|
754
|
+
return ht = Date.now() + (S - 60) * 1e3, j;
|
|
752
755
|
} catch (i) {
|
|
753
|
-
return console.error("Error obtaining JWT token:", i),
|
|
756
|
+
return console.error("Error obtaining JWT token:", i), j = null, ht = null, null;
|
|
754
757
|
}
|
|
755
|
-
},
|
|
756
|
-
const i = await
|
|
757
|
-
i != null &&
|
|
758
|
+
}, y = async () => {
|
|
759
|
+
const i = await Pt();
|
|
760
|
+
i != null && h(i);
|
|
758
761
|
};
|
|
759
|
-
|
|
762
|
+
H(() => {
|
|
760
763
|
if (t != null && t.siteId) {
|
|
761
|
-
const { clientID: i, host:
|
|
762
|
-
sessionStorage.setItem("Host",
|
|
764
|
+
const { clientID: i, host: x, organizationID: w, shortCode: _, siteId: S } = t;
|
|
765
|
+
sessionStorage.setItem("Host", x), sessionStorage.setItem("SiteId", S), sessionStorage.setItem("pubCfg", btoa(i)), sessionStorage.setItem("envRef", _), sessionStorage.setItem("orgRef", w);
|
|
763
766
|
}
|
|
764
|
-
|
|
765
|
-
}, []),
|
|
766
|
-
e && (console.log("setting the basket id", e),
|
|
767
|
+
y(), console.log("scapi environment v1");
|
|
768
|
+
}, []), H(() => {
|
|
769
|
+
e && (console.log("setting the basket id", e), it(e));
|
|
767
770
|
}, [e]);
|
|
768
|
-
const
|
|
771
|
+
const Q = async () => {
|
|
769
772
|
const i = JSON.parse(
|
|
770
773
|
sessionStorage.getItem("customerData") || "{}"
|
|
771
774
|
).customerId;
|
|
772
775
|
return (await Sr(i || "")).c_interests;
|
|
773
|
-
}, Ft = async (i,
|
|
774
|
-
console.log("in secondary flow",
|
|
775
|
-
const
|
|
776
|
-
if (console.log(
|
|
776
|
+
}, Ft = async (i, x) => {
|
|
777
|
+
console.log("in secondary flow", Bt);
|
|
778
|
+
const w = await Q();
|
|
779
|
+
if (console.log(w, "interests of customer", Bt), !!w)
|
|
777
780
|
try {
|
|
778
|
-
|
|
779
|
-
(
|
|
780
|
-
(
|
|
781
|
+
B(
|
|
782
|
+
(M) => M.map(
|
|
783
|
+
(K, J) => J === M.length - 1 ? { ...K, secondaryLoading: !0 } : K
|
|
781
784
|
)
|
|
782
785
|
);
|
|
783
|
-
const
|
|
784
|
-
if (!
|
|
785
|
-
const
|
|
786
|
-
registered: String(
|
|
787
|
-
userId: String(
|
|
788
|
-
}).toString()}`,
|
|
786
|
+
const _ = await Dt();
|
|
787
|
+
if (!_) throw new Error("Failed to fetch token");
|
|
788
|
+
const S = localStorage.getItem("customerNumber"), g = localStorage.getItem("isLoggedIn"), O = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
789
|
+
registered: String(g || !1),
|
|
790
|
+
userId: String(S || (/* @__PURE__ */ new Date()).getTime())
|
|
791
|
+
}).toString()}`, C = JSON.stringify({
|
|
789
792
|
flowId: "Q166PR519W",
|
|
790
793
|
flowAliasId: "HKFUVLWVH2",
|
|
791
794
|
input: {
|
|
792
795
|
loyaltyPoints: "",
|
|
793
796
|
productName: i,
|
|
794
|
-
productPoints: String(
|
|
795
|
-
interests:
|
|
797
|
+
productPoints: String(x || 0),
|
|
798
|
+
interests: w
|
|
796
799
|
}
|
|
797
|
-
}),
|
|
800
|
+
}), T = await fetch(O, {
|
|
798
801
|
signal: AbortSignal.timeout(3e4),
|
|
799
802
|
method: "POST",
|
|
800
803
|
headers: {
|
|
801
804
|
"Content-Type": "application/json",
|
|
802
|
-
Authorization: `Bearer ${
|
|
805
|
+
Authorization: `Bearer ${_}`
|
|
803
806
|
},
|
|
804
|
-
body:
|
|
807
|
+
body: C
|
|
805
808
|
});
|
|
806
|
-
if (!
|
|
807
|
-
const
|
|
808
|
-
let
|
|
809
|
+
if (!T.body) throw new Error("Readable stream not supported");
|
|
810
|
+
const Z = T.body.getReader(), wt = new TextDecoder();
|
|
811
|
+
let q = "";
|
|
809
812
|
for (; ; ) {
|
|
810
|
-
const { done:
|
|
811
|
-
if (
|
|
812
|
-
|
|
813
|
-
const
|
|
813
|
+
const { done: M, value: K } = await Z.read();
|
|
814
|
+
if (M) break;
|
|
815
|
+
q += wt.decode(K, { stream: !0 });
|
|
816
|
+
const J = q.split(`
|
|
814
817
|
`);
|
|
815
|
-
|
|
816
|
-
for (const
|
|
817
|
-
if (
|
|
818
|
-
const
|
|
818
|
+
q = J.pop() || "";
|
|
819
|
+
for (const tt of J)
|
|
820
|
+
if (tt.startsWith("data:")) {
|
|
821
|
+
const p = tt.slice(5).trim();
|
|
819
822
|
try {
|
|
820
|
-
const
|
|
821
|
-
|
|
822
|
-
(
|
|
823
|
-
(
|
|
824
|
-
...
|
|
825
|
-
secondaryResponse:
|
|
823
|
+
const W = JSON.parse(p);
|
|
824
|
+
W.index === 0 && B(
|
|
825
|
+
(F) => F.map(
|
|
826
|
+
(A, et) => et === F.length - 1 ? {
|
|
827
|
+
...A,
|
|
828
|
+
secondaryResponse: W.data,
|
|
826
829
|
secondaryLoading: !1
|
|
827
|
-
} :
|
|
830
|
+
} : A
|
|
828
831
|
)
|
|
829
832
|
);
|
|
830
|
-
} catch (
|
|
831
|
-
|
|
832
|
-
(
|
|
833
|
-
(
|
|
833
|
+
} catch (W) {
|
|
834
|
+
B(
|
|
835
|
+
(F) => F.map(
|
|
836
|
+
(A, et) => et === F.length - 1 ? { ...A, secondaryLoading: !1 } : A
|
|
834
837
|
)
|
|
835
|
-
), console.error("Secondary flow JSON parse error:",
|
|
838
|
+
), console.error("Secondary flow JSON parse error:", W);
|
|
836
839
|
}
|
|
837
840
|
}
|
|
838
841
|
}
|
|
839
|
-
} catch (
|
|
840
|
-
console.error("Secondary flow error:",
|
|
842
|
+
} catch (_) {
|
|
843
|
+
console.error("Secondary flow error:", _);
|
|
841
844
|
}
|
|
842
|
-
},
|
|
843
|
-
const
|
|
844
|
-
if (
|
|
845
|
-
_t(!0), It(""), c.current = null, l.current = null, d.current = null, s.current = null,
|
|
846
|
-
...
|
|
845
|
+
}, U = async (i) => {
|
|
846
|
+
const x = i || Ct.trim();
|
|
847
|
+
if (x) {
|
|
848
|
+
_t(!0), It(""), c.current = null, l.current = null, d.current = null, s.current = null, B((w) => [
|
|
849
|
+
...w,
|
|
847
850
|
{
|
|
848
|
-
query:
|
|
851
|
+
query: x,
|
|
849
852
|
response: "Thinking for what suits you best...",
|
|
850
853
|
potentialQuestions: "",
|
|
851
854
|
products: [],
|
|
@@ -853,240 +856,224 @@ const nt = (t) => {
|
|
|
853
856
|
}
|
|
854
857
|
]);
|
|
855
858
|
try {
|
|
856
|
-
const
|
|
857
|
-
if (!
|
|
859
|
+
const w = ft, _ = localStorage.getItem("customerNumber"), S = localStorage.getItem("isLoggedIn"), g = await Dt();
|
|
860
|
+
if (!g)
|
|
858
861
|
throw new Error("Failed to obtain access token");
|
|
859
|
-
const
|
|
860
|
-
registered: String(
|
|
861
|
-
userId: String(
|
|
862
|
-
}).toString()}`,
|
|
862
|
+
const O = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
863
|
+
registered: String(S || !1),
|
|
864
|
+
userId: String(_ || (/* @__PURE__ */ new Date()).getTime())
|
|
865
|
+
}).toString()}`, C = JSON.stringify({
|
|
863
866
|
flowId: "MMHQKYI1NE",
|
|
864
867
|
flowAliasId: "SZF9ZK1ATE",
|
|
865
868
|
input: {
|
|
866
|
-
userPrompt:
|
|
867
|
-
whom:
|
|
869
|
+
userPrompt: x,
|
|
870
|
+
whom: w
|
|
868
871
|
}
|
|
869
|
-
}),
|
|
872
|
+
}), T = await fetch(O, {
|
|
870
873
|
signal: AbortSignal.timeout(3e4),
|
|
871
874
|
method: "POST",
|
|
872
875
|
headers: {
|
|
873
876
|
"Content-Type": "application/json",
|
|
874
|
-
Authorization: `Bearer ${
|
|
877
|
+
Authorization: `Bearer ${g}`
|
|
875
878
|
},
|
|
876
|
-
body:
|
|
879
|
+
body: C
|
|
877
880
|
});
|
|
878
|
-
if (!
|
|
879
|
-
throw new Error(`HTTP error! status: ${
|
|
880
|
-
if (!
|
|
881
|
-
const
|
|
882
|
-
let
|
|
881
|
+
if (!T.ok)
|
|
882
|
+
throw new Error(`HTTP error! status: ${T.status}`);
|
|
883
|
+
if (!T.body) throw new Error("Readable stream not supported");
|
|
884
|
+
const Z = T.body.getReader(), wt = new TextDecoder();
|
|
885
|
+
let q = "", M = "";
|
|
883
886
|
for (; ; ) {
|
|
884
|
-
|
|
885
|
-
const { done:
|
|
886
|
-
if (
|
|
887
|
-
|
|
888
|
-
const
|
|
887
|
+
pt(!0);
|
|
888
|
+
const { done: K, value: J } = await Z.read();
|
|
889
|
+
if (K) break;
|
|
890
|
+
q += wt.decode(J, { stream: !0 });
|
|
891
|
+
const tt = q.split(`
|
|
889
892
|
`);
|
|
890
|
-
|
|
891
|
-
for (const
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
893
|
+
q = tt.pop() || "";
|
|
894
|
+
for (const p of tt)
|
|
895
|
+
if (p.startsWith("data:")) {
|
|
896
|
+
const W = p.slice(5).trim();
|
|
894
897
|
try {
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
(
|
|
898
|
-
(
|
|
899
|
-
...
|
|
900
|
-
[
|
|
901
|
-
} :
|
|
898
|
+
const F = JSON.parse(W);
|
|
899
|
+
F.index == 1 && (M = F.data), B(
|
|
900
|
+
(A) => A.map(
|
|
901
|
+
(et, Lt) => Lt === A.length - 1 ? {
|
|
902
|
+
...et,
|
|
903
|
+
[F.index == 0 ? "response" : F.index == 1 ? "keywords" : F.index == 2 ? "potentialQuestions" : "end"]: F.data
|
|
904
|
+
} : et
|
|
902
905
|
)
|
|
903
906
|
);
|
|
904
|
-
} catch (
|
|
905
|
-
console.error("Error parsing JSON:",
|
|
907
|
+
} catch (F) {
|
|
908
|
+
console.error("Error parsing JSON:", F);
|
|
906
909
|
}
|
|
907
910
|
}
|
|
908
911
|
}
|
|
909
|
-
|
|
910
|
-
} catch (
|
|
911
|
-
console.error("Error sending message to Tanya:",
|
|
912
|
+
rr(er(M));
|
|
913
|
+
} catch (w) {
|
|
914
|
+
console.error("Error sending message to Tanya:", w);
|
|
912
915
|
} finally {
|
|
913
916
|
_t(!1);
|
|
914
917
|
}
|
|
915
918
|
}
|
|
916
|
-
},
|
|
917
|
-
const
|
|
919
|
+
}, er = (i) => {
|
|
920
|
+
const x = i.match(
|
|
918
921
|
/top five relevant product or category names are: (.*)/i
|
|
919
|
-
),
|
|
920
|
-
return [...new Set(
|
|
921
|
-
},
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
const p = g[0];
|
|
939
|
-
c.current = String((p == null ? void 0 : p.product_name) ?? ""), d.current = p.image.link, l.current = p.product_id;
|
|
940
|
-
const h = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
941
|
-
s.current = typeof h == "number" && Number.isFinite(h) ? h : null;
|
|
942
|
-
}
|
|
943
|
-
}
|
|
944
|
-
} else
|
|
945
|
-
for (const w of i) {
|
|
946
|
-
const m = await xe(w);
|
|
947
|
-
et(!1), (m == null ? void 0 : m.length) > 0 && P(
|
|
948
|
-
(g) => g.map(
|
|
949
|
-
(p, h) => h === g.length - 1 ? {
|
|
950
|
-
...p,
|
|
951
|
-
products: [
|
|
952
|
-
...p.products || [],
|
|
953
|
-
{ keyword: w, items: m, loading: !1 }
|
|
954
|
-
]
|
|
955
|
-
} : p
|
|
956
|
-
)
|
|
957
|
-
);
|
|
922
|
+
), S = (x ? x[1] : i).split(", ").map((D) => D.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
923
|
+
return [...new Set(S)].filter(Boolean).join(",");
|
|
924
|
+
}, rr = async (i) => {
|
|
925
|
+
var w, _, S;
|
|
926
|
+
const x = typeof i == "string" ? i.split(",") : i;
|
|
927
|
+
pt(!0);
|
|
928
|
+
try {
|
|
929
|
+
const g = await Promise.all(
|
|
930
|
+
x.map((C) => kr(C).catch(() => []))
|
|
931
|
+
// prevent Promise.all crash
|
|
932
|
+
), D = x.map((C, T) => ({
|
|
933
|
+
keyword: C,
|
|
934
|
+
items: g[T] ?? [],
|
|
935
|
+
loading: !1
|
|
936
|
+
})).filter((C) => C.items.length > 0), O = (_ = (w = D[0]) == null ? void 0 : w.items) == null ? void 0 : _[0];
|
|
937
|
+
if (O) {
|
|
938
|
+
l.current = O.product_id, c.current = O.product_name, d.current = (S = O.image) == null ? void 0 : S.link;
|
|
939
|
+
const C = typeof O.price == "number" ? O.price : null;
|
|
940
|
+
s.current = C;
|
|
958
941
|
}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
productSnapshot: {
|
|
942
|
+
if (B(
|
|
943
|
+
(C) => C.map(
|
|
944
|
+
(T, Z) => Z === C.length - 1 ? {
|
|
945
|
+
...T,
|
|
946
|
+
products: D,
|
|
947
|
+
productSnapshot: O ? {
|
|
965
948
|
id: l.current,
|
|
966
949
|
name: c.current,
|
|
967
950
|
image: d.current,
|
|
968
|
-
price: s.current
|
|
951
|
+
price: s.current,
|
|
969
952
|
points: 0,
|
|
970
953
|
quantity: 1
|
|
971
|
-
}
|
|
972
|
-
} :
|
|
954
|
+
} : T.productSnapshot
|
|
955
|
+
} : T
|
|
973
956
|
)
|
|
974
|
-
)
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
957
|
+
), O) {
|
|
958
|
+
const C = JSON.parse(
|
|
959
|
+
sessionStorage.getItem("customerData") || "{}"
|
|
960
|
+
);
|
|
961
|
+
C != null && C.isGuest || (console.log("running secondary flow", Bt), Ft(c.current, 0));
|
|
962
|
+
}
|
|
963
|
+
} catch (g) {
|
|
964
|
+
console.error("error in keyword search", g);
|
|
965
|
+
} finally {
|
|
966
|
+
pt(!1);
|
|
979
967
|
}
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
R(!0);
|
|
968
|
+
}, or = async (i, x) => {
|
|
969
|
+
var w, _, S, g, D, O, C, T, Z, wt, q, M, K, J, tt;
|
|
970
|
+
Y(!0);
|
|
984
971
|
try {
|
|
985
|
-
const
|
|
986
|
-
if (!((
|
|
987
|
-
|
|
972
|
+
const p = await He(i.id);
|
|
973
|
+
if (!((_ = (w = p == null ? void 0 : p.variants) == null ? void 0 : w[0]) != null && _.product_id || (g = (S = p == null ? void 0 : p.variants) == null ? void 0 : S[0]) != null && g.productId) && !(p.type.item || p.type.bundle)) {
|
|
974
|
+
Y(!1), R.error("Variants not found", {
|
|
988
975
|
position: "bottom-right",
|
|
989
976
|
autoClose: 1e3
|
|
990
977
|
}), console.error("No product variant found");
|
|
991
978
|
return;
|
|
992
979
|
}
|
|
993
|
-
const
|
|
980
|
+
const W = [
|
|
994
981
|
{
|
|
995
|
-
product_id: ((
|
|
996
|
-
quantity:
|
|
982
|
+
product_id: ((D = p.variants) == null ? void 0 : D[0].product_id) || ((O = p.variants) == null ? void 0 : O[0].productId) || (p == null ? void 0 : p.id),
|
|
983
|
+
quantity: x
|
|
997
984
|
}
|
|
998
985
|
];
|
|
999
|
-
console.log(
|
|
1000
|
-
const
|
|
986
|
+
console.log(W, "product data", "app version", Bt);
|
|
987
|
+
const F = JSON.parse(
|
|
1001
988
|
sessionStorage.getItem("customerData") || "{}"
|
|
1002
|
-
),
|
|
1003
|
-
if (!
|
|
1004
|
-
const
|
|
1005
|
-
let { customer_token: gt } = await
|
|
1006
|
-
|
|
989
|
+
), A = (F == null ? void 0 : F.basketId) || localStorage.getItem(Yt), et = !1, Lt = localStorage.getItem(Tt), we = Date.now();
|
|
990
|
+
if (!et || !Lt || we >= parseInt(Lt)) {
|
|
991
|
+
const nr = await qe();
|
|
992
|
+
let { customer_token: gt } = await Me(
|
|
993
|
+
nr
|
|
1007
994
|
);
|
|
1008
|
-
if (gt = "Bearer " +
|
|
995
|
+
if (gt = "Bearer " + m.access_token, !gt) {
|
|
1009
996
|
console.error("Failed to get customer_token");
|
|
1010
997
|
return;
|
|
1011
998
|
}
|
|
1012
|
-
const
|
|
1013
|
-
if (Kt(gt), localStorage.setItem(
|
|
1014
|
-
const ge = await
|
|
1015
|
-
basketId:
|
|
999
|
+
const ar = we + 300 * 1e3;
|
|
1000
|
+
if (Kt(gt), localStorage.setItem(Tt, ar.toString()), console.log(A, "basketIdFromCustomer"), A) {
|
|
1001
|
+
const ge = await Ve({
|
|
1002
|
+
basketId: A,
|
|
1016
1003
|
customer_token: gt
|
|
1017
1004
|
});
|
|
1018
1005
|
if (ge.status === 200 && ge) {
|
|
1019
1006
|
const Gt = await ne(
|
|
1020
|
-
|
|
1021
|
-
|
|
1007
|
+
A,
|
|
1008
|
+
W,
|
|
1022
1009
|
gt
|
|
1023
1010
|
);
|
|
1024
|
-
((
|
|
1011
|
+
((C = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : C.length) > 0 && (R.success("Added to cart", {
|
|
1025
1012
|
position: "bottom-right",
|
|
1026
1013
|
autoClose: 3e3,
|
|
1027
1014
|
hideProgressBar: !1,
|
|
1028
1015
|
closeOnClick: !0,
|
|
1029
1016
|
pauseOnHover: !0,
|
|
1030
1017
|
draggable: !0
|
|
1031
|
-
}), Vt(
|
|
1018
|
+
}), Vt(A), Y(!1));
|
|
1032
1019
|
return;
|
|
1033
1020
|
}
|
|
1034
1021
|
}
|
|
1035
|
-
const
|
|
1022
|
+
const ir = {
|
|
1036
1023
|
productItems: [
|
|
1037
1024
|
{
|
|
1038
|
-
productId: ((
|
|
1025
|
+
productId: ((T = p.variants) == null ? void 0 : T[0].product_id) || ((Z = p.variants) == null ? void 0 : Z[0].productId) || (p == null ? void 0 : p.id),
|
|
1039
1026
|
quantity: 1
|
|
1040
1027
|
}
|
|
1041
1028
|
]
|
|
1042
|
-
},
|
|
1029
|
+
}, f = await Re(gt, ir);
|
|
1043
1030
|
if (console.log(
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1031
|
+
f,
|
|
1032
|
+
f == null ? void 0 : f.basket_id,
|
|
1033
|
+
f == null ? void 0 : f.basketId,
|
|
1047
1034
|
"the basket response"
|
|
1048
|
-
), !(
|
|
1049
|
-
|
|
1035
|
+
), !(f != null && f.basket_id || !(f != null && f.basketId))) {
|
|
1036
|
+
Y(!1), console.error("Failed to create basket");
|
|
1050
1037
|
return;
|
|
1051
1038
|
}
|
|
1052
|
-
|
|
1053
|
-
(
|
|
1039
|
+
it(
|
|
1040
|
+
(f == null ? void 0 : f.basket_id) || (f == null ? void 0 : f.basketId)
|
|
1054
1041
|
);
|
|
1055
1042
|
const bt = await r(
|
|
1056
1043
|
{
|
|
1057
1044
|
productId: l,
|
|
1058
|
-
quantity:
|
|
1045
|
+
quantity: x
|
|
1059
1046
|
},
|
|
1060
|
-
(
|
|
1047
|
+
(f == null ? void 0 : f.basket_id) || (f == null ? void 0 : f.basketId)
|
|
1061
1048
|
);
|
|
1062
|
-
(((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((
|
|
1049
|
+
(((wt = bt == null ? void 0 : bt.product_items) == null ? void 0 : wt.length) > 0 || ((q = bt == null ? void 0 : bt.productItems) == null ? void 0 : q.length) > 0) && R.success("Added to cart", {
|
|
1063
1050
|
position: "bottom-right",
|
|
1064
1051
|
autoClose: 3e3,
|
|
1065
1052
|
hideProgressBar: !1,
|
|
1066
1053
|
closeOnClick: !0,
|
|
1067
1054
|
pauseOnHover: !0,
|
|
1068
1055
|
draggable: !0
|
|
1069
|
-
}), Vt(
|
|
1056
|
+
}), Vt(f.basket_id || (f == null ? void 0 : f.basketId));
|
|
1070
1057
|
}
|
|
1071
|
-
} catch (
|
|
1072
|
-
|
|
1058
|
+
} catch (p) {
|
|
1059
|
+
Y(!1), console.error("Error adding to cart:", p), R.error("Failed to add product to cart", {
|
|
1073
1060
|
position: "bottom-right",
|
|
1074
1061
|
autoClose: 3e3
|
|
1075
|
-
}), ((
|
|
1076
|
-
((
|
|
1062
|
+
}), ((M = p == null ? void 0 : p.response) == null ? void 0 : M.status) === 404 || // Basket not found
|
|
1063
|
+
((K = p == null ? void 0 : p.response) == null ? void 0 : K.status) === 401 ? (((J = p == null ? void 0 : p.response) == null ? void 0 : J.status) === 404 && it(null), ((tt = p == null ? void 0 : p.response) == null ? void 0 : tt.status) === 401 && (it(null), Kt(null))) : (console.error("Failed to add product to basket:", p.message), R.error("Failed to add product to cart", {
|
|
1077
1064
|
position: "bottom-right",
|
|
1078
1065
|
autoClose: 3e3
|
|
1079
1066
|
}));
|
|
1080
1067
|
}
|
|
1081
|
-
|
|
1068
|
+
Y(!1);
|
|
1082
1069
|
};
|
|
1083
|
-
return
|
|
1084
|
-
|
|
1085
|
-
}, [
|
|
1070
|
+
return H(() => {
|
|
1071
|
+
z ? setTimeout(() => E(!0), 10) : E(!1);
|
|
1072
|
+
}, [z]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: I, onOpenChange: v, children: [
|
|
1086
1073
|
/* @__PURE__ */ a(
|
|
1087
|
-
|
|
1074
|
+
vr,
|
|
1088
1075
|
{
|
|
1089
|
-
onClick: () =>
|
|
1076
|
+
onClick: () => v(!0),
|
|
1090
1077
|
style: {
|
|
1091
1078
|
// background: storeDetails.tanyaThemeColor,
|
|
1092
1079
|
},
|
|
@@ -1146,12 +1133,12 @@ const nt = (t) => {
|
|
|
1146
1133
|
) })
|
|
1147
1134
|
}
|
|
1148
1135
|
),
|
|
1149
|
-
|
|
1136
|
+
z && /* @__PURE__ */ u(re, { children: [
|
|
1150
1137
|
/* @__PURE__ */ a(
|
|
1151
1138
|
"div",
|
|
1152
1139
|
{
|
|
1153
1140
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1154
|
-
onClick: () =>
|
|
1141
|
+
onClick: () => v(!1)
|
|
1155
1142
|
}
|
|
1156
1143
|
),
|
|
1157
1144
|
/* @__PURE__ */ u(
|
|
@@ -1238,7 +1225,7 @@ const nt = (t) => {
|
|
|
1238
1225
|
gap: "1.25rem",
|
|
1239
1226
|
margin: "0.75rem"
|
|
1240
1227
|
},
|
|
1241
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1228
|
+
children: /* @__PURE__ */ a("button", { onClick: () => v(!1), children: /* @__PURE__ */ u(
|
|
1242
1229
|
"svg",
|
|
1243
1230
|
{
|
|
1244
1231
|
width: "24",
|
|
@@ -1290,15 +1277,15 @@ const nt = (t) => {
|
|
|
1290
1277
|
/* @__PURE__ */ u(
|
|
1291
1278
|
"div",
|
|
1292
1279
|
{
|
|
1293
|
-
className: `flex flex-col h-full ${
|
|
1280
|
+
className: `flex flex-col h-full ${mt ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1294
1281
|
children: [
|
|
1295
1282
|
/* @__PURE__ */ u(
|
|
1296
1283
|
"div",
|
|
1297
1284
|
{
|
|
1298
|
-
ref:
|
|
1285
|
+
ref: k,
|
|
1299
1286
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1300
1287
|
children: [
|
|
1301
|
-
(
|
|
1288
|
+
(b == null ? void 0 : b.whomRequired) && /* @__PURE__ */ u(
|
|
1302
1289
|
"div",
|
|
1303
1290
|
{
|
|
1304
1291
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
@@ -1307,11 +1294,11 @@ const nt = (t) => {
|
|
|
1307
1294
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: o.map((i) => /* @__PURE__ */ a(
|
|
1308
1295
|
"button",
|
|
1309
1296
|
{
|
|
1310
|
-
onClick: () =>
|
|
1297
|
+
onClick: () => jt(i),
|
|
1311
1298
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1312
1299
|
style: {
|
|
1313
|
-
backgroundColor:
|
|
1314
|
-
borderColor:
|
|
1300
|
+
backgroundColor: ft === n[i] ? "#FFFFFF" : "#F3F3F3",
|
|
1301
|
+
borderColor: ft === n[i] ? "#BBB3DD" : ""
|
|
1315
1302
|
},
|
|
1316
1303
|
children: i
|
|
1317
1304
|
},
|
|
@@ -1320,8 +1307,8 @@ const nt = (t) => {
|
|
|
1320
1307
|
]
|
|
1321
1308
|
}
|
|
1322
1309
|
),
|
|
1323
|
-
|
|
1324
|
-
var
|
|
1310
|
+
nt.map((i, x) => {
|
|
1311
|
+
var w, _;
|
|
1325
1312
|
return /* @__PURE__ */ u("div", { children: [
|
|
1326
1313
|
/* @__PURE__ */ a(
|
|
1327
1314
|
"div",
|
|
@@ -1347,12 +1334,12 @@ const nt = (t) => {
|
|
|
1347
1334
|
}
|
|
1348
1335
|
}
|
|
1349
1336
|
) }),
|
|
1350
|
-
|
|
1351
|
-
(i == null ? void 0 : i.products) && ((
|
|
1337
|
+
Ot && !i.response.includes("Thinking") && ((w = i.products) == null ? void 0 : w.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" }) }),
|
|
1338
|
+
(i == null ? void 0 : i.products) && ((_ = i == null ? void 0 : i.products) == null ? void 0 : _.length) > 0 && /* @__PURE__ */ a(
|
|
1352
1339
|
Nr,
|
|
1353
1340
|
{
|
|
1354
1341
|
chat: i.products,
|
|
1355
|
-
storeDetails:
|
|
1342
|
+
storeDetails: b
|
|
1356
1343
|
}
|
|
1357
1344
|
),
|
|
1358
1345
|
(i == null ? void 0 : i.potentialQuestions.length) > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
@@ -1360,21 +1347,21 @@ const nt = (t) => {
|
|
|
1360
1347
|
"p",
|
|
1361
1348
|
{
|
|
1362
1349
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
1363
|
-
style: { color:
|
|
1350
|
+
style: { color: b.themeDarkColor },
|
|
1364
1351
|
children: "Why not explore these inquiries..."
|
|
1365
1352
|
}
|
|
1366
1353
|
),
|
|
1367
|
-
i.potentialQuestions.split(",").map((
|
|
1354
|
+
i.potentialQuestions.split(",").map((S, g) => /* @__PURE__ */ a(
|
|
1368
1355
|
"button",
|
|
1369
1356
|
{
|
|
1370
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
1371
|
-
onClick: () =>
|
|
1357
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${b.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1358
|
+
onClick: () => U(S),
|
|
1372
1359
|
style: {
|
|
1373
|
-
backgroundColor:
|
|
1360
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1374
1361
|
},
|
|
1375
|
-
children:
|
|
1362
|
+
children: S
|
|
1376
1363
|
},
|
|
1377
|
-
|
|
1364
|
+
g
|
|
1378
1365
|
))
|
|
1379
1366
|
] }),
|
|
1380
1367
|
(i == null ? void 0 : i.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
@@ -1395,7 +1382,7 @@ const nt = (t) => {
|
|
|
1395
1382
|
"p",
|
|
1396
1383
|
{
|
|
1397
1384
|
className: "font-semibold tanya-pulse",
|
|
1398
|
-
style: { color:
|
|
1385
|
+
style: { color: b.themeDarkColor },
|
|
1399
1386
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
1400
1387
|
}
|
|
1401
1388
|
),
|
|
@@ -1403,7 +1390,7 @@ const nt = (t) => {
|
|
|
1403
1390
|
"p",
|
|
1404
1391
|
{
|
|
1405
1392
|
className: "tanya-dots mt-1",
|
|
1406
|
-
style: { color:
|
|
1393
|
+
style: { color: b.themeDarkColor },
|
|
1407
1394
|
children: "• • •"
|
|
1408
1395
|
}
|
|
1409
1396
|
)
|
|
@@ -1416,7 +1403,7 @@ const nt = (t) => {
|
|
|
1416
1403
|
{
|
|
1417
1404
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
1418
1405
|
style: {
|
|
1419
|
-
backgroundColor:
|
|
1406
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1420
1407
|
},
|
|
1421
1408
|
dangerouslySetInnerHTML: {
|
|
1422
1409
|
__html: Xt(
|
|
@@ -1431,7 +1418,7 @@ const nt = (t) => {
|
|
|
1431
1418
|
{
|
|
1432
1419
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
1433
1420
|
style: {
|
|
1434
|
-
backgroundColor:
|
|
1421
|
+
backgroundColor: b.tanyaThemeColorLight
|
|
1435
1422
|
},
|
|
1436
1423
|
children: [
|
|
1437
1424
|
/* @__PURE__ */ a(
|
|
@@ -1458,7 +1445,7 @@ const nt = (t) => {
|
|
|
1458
1445
|
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: i.productSnapshot.name }),
|
|
1459
1446
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: i.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1460
1447
|
style: "currency",
|
|
1461
|
-
currency: (
|
|
1448
|
+
currency: (b == null ? void 0 : b.currency) || "USD"
|
|
1462
1449
|
}).format(
|
|
1463
1450
|
i.productSnapshot.price
|
|
1464
1451
|
) : "" }),
|
|
@@ -1478,23 +1465,23 @@ const nt = (t) => {
|
|
|
1478
1465
|
"button",
|
|
1479
1466
|
{
|
|
1480
1467
|
className: "px-3 py-1 text-sm",
|
|
1481
|
-
onClick: () =>
|
|
1482
|
-
(
|
|
1483
|
-
(
|
|
1484
|
-
...
|
|
1468
|
+
onClick: () => B(
|
|
1469
|
+
(S) => S.map(
|
|
1470
|
+
(g, D) => D === x && g.productSnapshot ? {
|
|
1471
|
+
...g,
|
|
1485
1472
|
productSnapshot: {
|
|
1486
|
-
...
|
|
1473
|
+
...g.productSnapshot,
|
|
1487
1474
|
quantity: Math.max(
|
|
1488
1475
|
1,
|
|
1489
|
-
|
|
1476
|
+
g.productSnapshot.quantity - 1
|
|
1490
1477
|
)
|
|
1491
1478
|
}
|
|
1492
|
-
} :
|
|
1479
|
+
} : g
|
|
1493
1480
|
)
|
|
1494
1481
|
),
|
|
1495
1482
|
style: {
|
|
1496
1483
|
background: "transparent",
|
|
1497
|
-
color:
|
|
1484
|
+
color: b.themeDarkColor
|
|
1498
1485
|
},
|
|
1499
1486
|
children: "−"
|
|
1500
1487
|
}
|
|
@@ -1504,20 +1491,20 @@ const nt = (t) => {
|
|
|
1504
1491
|
"button",
|
|
1505
1492
|
{
|
|
1506
1493
|
className: "px-3 py-1 text-sm",
|
|
1507
|
-
onClick: () =>
|
|
1508
|
-
(
|
|
1509
|
-
(
|
|
1510
|
-
...
|
|
1494
|
+
onClick: () => B(
|
|
1495
|
+
(S) => S.map(
|
|
1496
|
+
(g, D) => D === x && g.productSnapshot ? {
|
|
1497
|
+
...g,
|
|
1511
1498
|
productSnapshot: {
|
|
1512
|
-
...
|
|
1513
|
-
quantity:
|
|
1499
|
+
...g.productSnapshot,
|
|
1500
|
+
quantity: g.productSnapshot.quantity + 1
|
|
1514
1501
|
}
|
|
1515
|
-
} :
|
|
1502
|
+
} : g
|
|
1516
1503
|
)
|
|
1517
1504
|
),
|
|
1518
1505
|
style: {
|
|
1519
1506
|
background: "transparent",
|
|
1520
|
-
color:
|
|
1507
|
+
color: b.themeDarkColor
|
|
1521
1508
|
},
|
|
1522
1509
|
children: "+"
|
|
1523
1510
|
}
|
|
@@ -1527,21 +1514,21 @@ const nt = (t) => {
|
|
|
1527
1514
|
"button",
|
|
1528
1515
|
{
|
|
1529
1516
|
onClick: () => {
|
|
1530
|
-
|
|
1531
|
-
|
|
1517
|
+
or(
|
|
1518
|
+
zt(
|
|
1532
1519
|
i.productSnapshot
|
|
1533
1520
|
),
|
|
1534
1521
|
i.productSnapshot.quantity
|
|
1535
1522
|
);
|
|
1536
1523
|
},
|
|
1537
|
-
disabled:
|
|
1524
|
+
disabled: dt,
|
|
1538
1525
|
className: "px-4 py-2 rounded-full font-medium",
|
|
1539
1526
|
style: {
|
|
1540
|
-
background:
|
|
1541
|
-
color: (
|
|
1542
|
-
opacity:
|
|
1527
|
+
background: b.tanyaThemeColor,
|
|
1528
|
+
color: (b == null ? void 0 : b.tanyaThemeContrastColor) || "#fff",
|
|
1529
|
+
opacity: dt ? 0.8 : 1
|
|
1543
1530
|
},
|
|
1544
|
-
children:
|
|
1531
|
+
children: dt ? "Adding..." : "Add to cart"
|
|
1545
1532
|
}
|
|
1546
1533
|
)
|
|
1547
1534
|
] })
|
|
@@ -1551,7 +1538,7 @@ const nt = (t) => {
|
|
|
1551
1538
|
) })
|
|
1552
1539
|
] }) }),
|
|
1553
1540
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1554
|
-
] },
|
|
1541
|
+
] }, x);
|
|
1555
1542
|
})
|
|
1556
1543
|
]
|
|
1557
1544
|
}
|
|
@@ -1573,7 +1560,7 @@ const nt = (t) => {
|
|
|
1573
1560
|
autoFocus: !0,
|
|
1574
1561
|
onChange: (i) => It(i.target.value),
|
|
1575
1562
|
onKeyDown: (i) => {
|
|
1576
|
-
i.key === "Enter" && !
|
|
1563
|
+
i.key === "Enter" && !ut && U();
|
|
1577
1564
|
}
|
|
1578
1565
|
}
|
|
1579
1566
|
),
|
|
@@ -1581,16 +1568,16 @@ const nt = (t) => {
|
|
|
1581
1568
|
"button",
|
|
1582
1569
|
{
|
|
1583
1570
|
type: "submit",
|
|
1584
|
-
disabled:
|
|
1571
|
+
disabled: ut,
|
|
1585
1572
|
className: "p-3",
|
|
1586
|
-
onClick: () =>
|
|
1587
|
-
children:
|
|
1573
|
+
onClick: () => U(),
|
|
1574
|
+
children: ut ? /* @__PURE__ */ a(
|
|
1588
1575
|
"div",
|
|
1589
1576
|
{
|
|
1590
1577
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
1591
1578
|
style: {
|
|
1592
1579
|
borderBottom: "2px solid",
|
|
1593
|
-
color:
|
|
1580
|
+
color: b.tanyaThemeColor
|
|
1594
1581
|
}
|
|
1595
1582
|
}
|
|
1596
1583
|
) : /* @__PURE__ */ a(
|
|
@@ -1642,14 +1629,14 @@ function Or(t, e) {
|
|
|
1642
1629
|
}
|
|
1643
1630
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1644
1631
|
}
|
|
1645
|
-
var
|
|
1646
|
-
return
|
|
1632
|
+
var rt = function() {
|
|
1633
|
+
return rt = Object.assign || function(e) {
|
|
1647
1634
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1648
1635
|
r = arguments[o];
|
|
1649
1636
|
for (var c in r) Object.prototype.hasOwnProperty.call(r, c) && (e[c] = r[c]);
|
|
1650
1637
|
}
|
|
1651
1638
|
return e;
|
|
1652
|
-
},
|
|
1639
|
+
}, rt.apply(this, arguments);
|
|
1653
1640
|
};
|
|
1654
1641
|
function $r(t, e) {
|
|
1655
1642
|
var r = {};
|
|
@@ -1659,9 +1646,9 @@ function $r(t, e) {
|
|
|
1659
1646
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1660
1647
|
return r;
|
|
1661
1648
|
}
|
|
1662
|
-
var Qt = "Invariant Violation",
|
|
1649
|
+
var Qt = "Invariant Violation", Ce = Object.setPrototypeOf, zr = Ce === void 0 ? function(t, e) {
|
|
1663
1650
|
return t.__proto__ = e, t;
|
|
1664
|
-
} :
|
|
1651
|
+
} : Ce, Ye = (
|
|
1665
1652
|
/** @class */
|
|
1666
1653
|
(function(t) {
|
|
1667
1654
|
Or(e, t);
|
|
@@ -1673,14 +1660,14 @@ var Qt = "Invariant Violation", Ie = Object.setPrototypeOf, zr = Ie === void 0 ?
|
|
|
1673
1660
|
return e;
|
|
1674
1661
|
})(Error)
|
|
1675
1662
|
);
|
|
1676
|
-
function
|
|
1663
|
+
function at(t, e) {
|
|
1677
1664
|
if (!t)
|
|
1678
|
-
throw new
|
|
1665
|
+
throw new Ye(e);
|
|
1679
1666
|
}
|
|
1680
|
-
var
|
|
1667
|
+
var Ke = ["debug", "log", "warn", "error", "silent"], Ar = Ke.indexOf("log");
|
|
1681
1668
|
function Ut(t) {
|
|
1682
1669
|
return function() {
|
|
1683
|
-
if (
|
|
1670
|
+
if (Ke.indexOf(t) >= Ar) {
|
|
1684
1671
|
var e = console[t] || console.log;
|
|
1685
1672
|
return e.apply(console, arguments);
|
|
1686
1673
|
}
|
|
@@ -1688,8 +1675,8 @@ function Ut(t) {
|
|
|
1688
1675
|
}
|
|
1689
1676
|
(function(t) {
|
|
1690
1677
|
t.debug = Ut("debug"), t.log = Ut("log"), t.warn = Ut("warn"), t.error = Ut("error");
|
|
1691
|
-
})(
|
|
1692
|
-
var
|
|
1678
|
+
})(at || (at = {}));
|
|
1679
|
+
var Je = "3.14.0";
|
|
1693
1680
|
function yt(t) {
|
|
1694
1681
|
try {
|
|
1695
1682
|
return t();
|
|
@@ -1713,10 +1700,10 @@ const ie = yt(function() {
|
|
|
1713
1700
|
yt(function() {
|
|
1714
1701
|
return yt.constructor("return this")();
|
|
1715
1702
|
});
|
|
1716
|
-
var
|
|
1703
|
+
var Ie = /* @__PURE__ */ new Map();
|
|
1717
1704
|
function jr(t) {
|
|
1718
|
-
var e =
|
|
1719
|
-
return
|
|
1705
|
+
var e = Ie.get(t) || 1;
|
|
1706
|
+
return Ie.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1720
1707
|
}
|
|
1721
1708
|
function Dr(t, e) {
|
|
1722
1709
|
var r = jr("stringifyForDisplay");
|
|
@@ -1738,20 +1725,20 @@ function qt(t) {
|
|
|
1738
1725
|
var Zt = Object.assign(function(e, r) {
|
|
1739
1726
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1740
1727
|
o[n - 2] = arguments[n];
|
|
1741
|
-
e ||
|
|
1728
|
+
e || at(e, ce(r, o) || de(r, o));
|
|
1742
1729
|
}, {
|
|
1743
|
-
debug: qt(
|
|
1744
|
-
log: qt(
|
|
1745
|
-
warn: qt(
|
|
1746
|
-
error: qt(
|
|
1730
|
+
debug: qt(at.debug),
|
|
1731
|
+
log: qt(at.log),
|
|
1732
|
+
warn: qt(at.warn),
|
|
1733
|
+
error: qt(at.error)
|
|
1747
1734
|
});
|
|
1748
|
-
function
|
|
1735
|
+
function We(t) {
|
|
1749
1736
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1750
1737
|
e[r - 1] = arguments[r];
|
|
1751
|
-
return new
|
|
1738
|
+
return new Ye(ce(t, e) || de(t, e));
|
|
1752
1739
|
}
|
|
1753
|
-
var
|
|
1754
|
-
function
|
|
1740
|
+
var Fe = Symbol.for("ApolloErrorMessageHandler_" + Je);
|
|
1741
|
+
function Ge(t) {
|
|
1755
1742
|
if (typeof t == "string")
|
|
1756
1743
|
return t;
|
|
1757
1744
|
try {
|
|
@@ -1762,14 +1749,14 @@ function Xe(t) {
|
|
|
1762
1749
|
}
|
|
1763
1750
|
function ce(t, e) {
|
|
1764
1751
|
if (e === void 0 && (e = []), !!t)
|
|
1765
|
-
return ie[
|
|
1752
|
+
return ie[Fe] && ie[Fe](t, e.map(Ge));
|
|
1766
1753
|
}
|
|
1767
1754
|
function de(t, e) {
|
|
1768
1755
|
if (e === void 0 && (e = []), !!t)
|
|
1769
1756
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1770
|
-
version:
|
|
1757
|
+
version: Je,
|
|
1771
1758
|
message: t,
|
|
1772
|
-
args: e.map(
|
|
1759
|
+
args: e.map(Ge)
|
|
1773
1760
|
})));
|
|
1774
1761
|
}
|
|
1775
1762
|
function Lr(t) {
|
|
@@ -1779,8 +1766,8 @@ function Lr(t) {
|
|
|
1779
1766
|
return e.name.value;
|
|
1780
1767
|
})[0] || null;
|
|
1781
1768
|
}
|
|
1782
|
-
let
|
|
1783
|
-
const
|
|
1769
|
+
let N = null;
|
|
1770
|
+
const Ne = {};
|
|
1784
1771
|
let Br = 1;
|
|
1785
1772
|
const Ur = () => class {
|
|
1786
1773
|
constructor() {
|
|
@@ -1792,58 +1779,58 @@ const Ur = () => class {
|
|
|
1792
1779
|
].join(":");
|
|
1793
1780
|
}
|
|
1794
1781
|
hasValue() {
|
|
1795
|
-
for (let e =
|
|
1782
|
+
for (let e = N; e; e = e.parent)
|
|
1796
1783
|
if (this.id in e.slots) {
|
|
1797
1784
|
const r = e.slots[this.id];
|
|
1798
|
-
if (r ===
|
|
1785
|
+
if (r === Ne)
|
|
1799
1786
|
break;
|
|
1800
|
-
return e !==
|
|
1787
|
+
return e !== N && (N.slots[this.id] = r), !0;
|
|
1801
1788
|
}
|
|
1802
|
-
return
|
|
1789
|
+
return N && (N.slots[this.id] = Ne), !1;
|
|
1803
1790
|
}
|
|
1804
1791
|
getValue() {
|
|
1805
1792
|
if (this.hasValue())
|
|
1806
|
-
return
|
|
1793
|
+
return N.slots[this.id];
|
|
1807
1794
|
}
|
|
1808
1795
|
withValue(e, r, o, n) {
|
|
1809
1796
|
const c = {
|
|
1810
1797
|
__proto__: null,
|
|
1811
1798
|
[this.id]: e
|
|
1812
|
-
}, l =
|
|
1813
|
-
|
|
1799
|
+
}, l = N;
|
|
1800
|
+
N = { parent: l, slots: c };
|
|
1814
1801
|
try {
|
|
1815
1802
|
return r.apply(n, o);
|
|
1816
1803
|
} finally {
|
|
1817
|
-
|
|
1804
|
+
N = l;
|
|
1818
1805
|
}
|
|
1819
1806
|
}
|
|
1820
1807
|
// Capture the current context and wrap a callback function so that it
|
|
1821
1808
|
// reestablishes the captured context when called.
|
|
1822
1809
|
static bind(e) {
|
|
1823
|
-
const r =
|
|
1810
|
+
const r = N;
|
|
1824
1811
|
return function() {
|
|
1825
|
-
const o =
|
|
1812
|
+
const o = N;
|
|
1826
1813
|
try {
|
|
1827
|
-
return
|
|
1814
|
+
return N = r, e.apply(this, arguments);
|
|
1828
1815
|
} finally {
|
|
1829
|
-
|
|
1816
|
+
N = o;
|
|
1830
1817
|
}
|
|
1831
1818
|
};
|
|
1832
1819
|
}
|
|
1833
1820
|
// Immediately run a callback function without any captured context.
|
|
1834
1821
|
static noContext(e, r, o) {
|
|
1835
|
-
if (
|
|
1836
|
-
const n =
|
|
1822
|
+
if (N) {
|
|
1823
|
+
const n = N;
|
|
1837
1824
|
try {
|
|
1838
|
-
return
|
|
1825
|
+
return N = null, e.apply(o, r);
|
|
1839
1826
|
} finally {
|
|
1840
|
-
|
|
1827
|
+
N = n;
|
|
1841
1828
|
}
|
|
1842
1829
|
} else
|
|
1843
1830
|
return e.apply(o, r);
|
|
1844
1831
|
}
|
|
1845
1832
|
};
|
|
1846
|
-
function
|
|
1833
|
+
function Ee(t) {
|
|
1847
1834
|
try {
|
|
1848
1835
|
return t();
|
|
1849
1836
|
} catch {
|
|
@@ -1852,18 +1839,18 @@ function Te(t) {
|
|
|
1852
1839
|
const te = "@wry/context:Slot", qr = (
|
|
1853
1840
|
// Prefer globalThis when available.
|
|
1854
1841
|
// https://github.com/benjamn/wryware/issues/347
|
|
1855
|
-
|
|
1842
|
+
Ee(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1856
1843
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1857
1844
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1858
|
-
|
|
1845
|
+
Ee(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1859
1846
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1860
1847
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1861
1848
|
/* @__PURE__ */ Object.create(null)
|
|
1862
|
-
),
|
|
1849
|
+
), Te = qr, ue = Te[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1863
1850
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1864
1851
|
Array[te] || (function(t) {
|
|
1865
1852
|
try {
|
|
1866
|
-
Object.defineProperty(
|
|
1853
|
+
Object.defineProperty(Te, te, {
|
|
1867
1854
|
value: t,
|
|
1868
1855
|
enumerable: !1,
|
|
1869
1856
|
writable: !1,
|
|
@@ -1895,26 +1882,26 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1895
1882
|
}
|
|
1896
1883
|
function Hr(t, e) {
|
|
1897
1884
|
if (t) {
|
|
1898
|
-
if (typeof t == "string") return
|
|
1885
|
+
if (typeof t == "string") return Pe(t, e);
|
|
1899
1886
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
1900
1887
|
if (r === "Object" && t.constructor && (r = t.constructor.name), r === "Map" || r === "Set") return Array.from(t);
|
|
1901
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1888
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return Pe(t, e);
|
|
1902
1889
|
}
|
|
1903
1890
|
}
|
|
1904
|
-
function
|
|
1891
|
+
function Pe(t, e) {
|
|
1905
1892
|
(e == null || e > t.length) && (e = t.length);
|
|
1906
1893
|
for (var r = 0, o = new Array(e); r < e; r++)
|
|
1907
1894
|
o[r] = t[r];
|
|
1908
1895
|
return o;
|
|
1909
1896
|
}
|
|
1910
|
-
function
|
|
1897
|
+
function Oe(t, e) {
|
|
1911
1898
|
for (var r = 0; r < e.length; r++) {
|
|
1912
1899
|
var o = e[r];
|
|
1913
1900
|
o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(t, o.key, o);
|
|
1914
1901
|
}
|
|
1915
1902
|
}
|
|
1916
1903
|
function pe(t, e, r) {
|
|
1917
|
-
return e &&
|
|
1904
|
+
return e && Oe(t.prototype, e), r && Oe(t, r), Object.defineProperty(t, "prototype", { writable: !1 }), t;
|
|
1918
1905
|
}
|
|
1919
1906
|
var fe = function() {
|
|
1920
1907
|
return typeof Symbol == "function";
|
|
@@ -1924,7 +1911,7 @@ var fe = function() {
|
|
|
1924
1911
|
return me(t) ? Symbol[t] : "@@" + t;
|
|
1925
1912
|
};
|
|
1926
1913
|
fe() && !me("observable") && (Symbol.observable = Symbol("observable"));
|
|
1927
|
-
var Rr = he("iterator"), se = he("observable"),
|
|
1914
|
+
var Rr = he("iterator"), se = he("observable"), Xe = he("species");
|
|
1928
1915
|
function Jt(t, e) {
|
|
1929
1916
|
var r = t[e];
|
|
1930
1917
|
if (r != null) {
|
|
@@ -1932,12 +1919,12 @@ function Jt(t, e) {
|
|
|
1932
1919
|
return r;
|
|
1933
1920
|
}
|
|
1934
1921
|
}
|
|
1935
|
-
function
|
|
1922
|
+
function Nt(t) {
|
|
1936
1923
|
var e = t.constructor;
|
|
1937
|
-
return e !== void 0 && (e = e[
|
|
1924
|
+
return e !== void 0 && (e = e[Xe], e === null && (e = void 0)), e !== void 0 ? e : P;
|
|
1938
1925
|
}
|
|
1939
1926
|
function Vr(t) {
|
|
1940
|
-
return t instanceof
|
|
1927
|
+
return t instanceof P;
|
|
1941
1928
|
}
|
|
1942
1929
|
function kt(t) {
|
|
1943
1930
|
kt.log ? kt.log(t) : setTimeout(function() {
|
|
@@ -1953,7 +1940,7 @@ function Ht(t) {
|
|
|
1953
1940
|
}
|
|
1954
1941
|
});
|
|
1955
1942
|
}
|
|
1956
|
-
function
|
|
1943
|
+
function Qe(t) {
|
|
1957
1944
|
var e = t._cleanup;
|
|
1958
1945
|
if (e !== void 0 && (t._cleanup = void 0, !!e))
|
|
1959
1946
|
try {
|
|
@@ -1974,11 +1961,11 @@ function Yr(t) {
|
|
|
1974
1961
|
var e = t._queue;
|
|
1975
1962
|
if (e) {
|
|
1976
1963
|
t._queue = void 0, t._state = "ready";
|
|
1977
|
-
for (var r = 0; r < e.length && (
|
|
1964
|
+
for (var r = 0; r < e.length && (Ze(t, e[r].type, e[r].value), t._state !== "closed"); ++r)
|
|
1978
1965
|
;
|
|
1979
1966
|
}
|
|
1980
1967
|
}
|
|
1981
|
-
function
|
|
1968
|
+
function Ze(t, e, r) {
|
|
1982
1969
|
t._state = "running";
|
|
1983
1970
|
var o = t._observer;
|
|
1984
1971
|
try {
|
|
@@ -1998,7 +1985,7 @@ function tr(t, e, r) {
|
|
|
1998
1985
|
} catch (c) {
|
|
1999
1986
|
kt(c);
|
|
2000
1987
|
}
|
|
2001
|
-
t._state === "closed" ?
|
|
1988
|
+
t._state === "closed" ? Qe(t) : t._state === "running" && (t._state = "ready");
|
|
2002
1989
|
}
|
|
2003
1990
|
function ee(t, e, r) {
|
|
2004
1991
|
if (t._state !== "closed") {
|
|
@@ -2018,7 +2005,7 @@ function ee(t, e, r) {
|
|
|
2018
2005
|
});
|
|
2019
2006
|
return;
|
|
2020
2007
|
}
|
|
2021
|
-
|
|
2008
|
+
Ze(t, e, r);
|
|
2022
2009
|
}
|
|
2023
2010
|
}
|
|
2024
2011
|
var Kr = /* @__PURE__ */ (function() {
|
|
@@ -2034,7 +2021,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2034
2021
|
}
|
|
2035
2022
|
var e = t.prototype;
|
|
2036
2023
|
return e.unsubscribe = function() {
|
|
2037
|
-
this._state !== "closed" && (le(this),
|
|
2024
|
+
this._state !== "closed" && (le(this), Qe(this));
|
|
2038
2025
|
}, pe(t, [{
|
|
2039
2026
|
key: "closed",
|
|
2040
2027
|
get: function() {
|
|
@@ -2058,7 +2045,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2058
2045
|
return this._subscription._state === "closed";
|
|
2059
2046
|
}
|
|
2060
2047
|
}]), t;
|
|
2061
|
-
})(),
|
|
2048
|
+
})(), P = /* @__PURE__ */ (function() {
|
|
2062
2049
|
function t(r) {
|
|
2063
2050
|
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
2064
2051
|
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
@@ -2082,11 +2069,11 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2082
2069
|
s.unsubscribe(), c();
|
|
2083
2070
|
}
|
|
2084
2071
|
var s = n.subscribe({
|
|
2085
|
-
next: function(
|
|
2072
|
+
next: function(m) {
|
|
2086
2073
|
try {
|
|
2087
|
-
o(
|
|
2088
|
-
} catch (
|
|
2089
|
-
l(
|
|
2074
|
+
o(m, d);
|
|
2075
|
+
} catch (h) {
|
|
2076
|
+
l(h), s.unsubscribe();
|
|
2090
2077
|
}
|
|
2091
2078
|
},
|
|
2092
2079
|
error: l,
|
|
@@ -2096,7 +2083,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2096
2083
|
}, e.map = function(o) {
|
|
2097
2084
|
var n = this;
|
|
2098
2085
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2099
|
-
var c =
|
|
2086
|
+
var c = Nt(this);
|
|
2100
2087
|
return new c(function(l) {
|
|
2101
2088
|
return n.subscribe({
|
|
2102
2089
|
next: function(d) {
|
|
@@ -2118,7 +2105,7 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2118
2105
|
}, e.filter = function(o) {
|
|
2119
2106
|
var n = this;
|
|
2120
2107
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2121
|
-
var c =
|
|
2108
|
+
var c = Nt(this);
|
|
2122
2109
|
return new c(function(l) {
|
|
2123
2110
|
return n.subscribe({
|
|
2124
2111
|
next: function(d) {
|
|
@@ -2140,92 +2127,92 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2140
2127
|
}, e.reduce = function(o) {
|
|
2141
2128
|
var n = this;
|
|
2142
2129
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2143
|
-
var c =
|
|
2144
|
-
return new c(function(
|
|
2130
|
+
var c = Nt(this), l = arguments.length > 1, d = !1, s = arguments[1], m = s;
|
|
2131
|
+
return new c(function(h) {
|
|
2145
2132
|
return n.subscribe({
|
|
2146
|
-
next: function(
|
|
2147
|
-
var
|
|
2148
|
-
if (d = !0, !
|
|
2133
|
+
next: function(I) {
|
|
2134
|
+
var v = !d;
|
|
2135
|
+
if (d = !0, !v || l)
|
|
2149
2136
|
try {
|
|
2150
|
-
|
|
2151
|
-
} catch (
|
|
2152
|
-
return
|
|
2137
|
+
m = o(m, I);
|
|
2138
|
+
} catch (V) {
|
|
2139
|
+
return h.error(V);
|
|
2153
2140
|
}
|
|
2154
2141
|
else
|
|
2155
|
-
|
|
2142
|
+
m = I;
|
|
2156
2143
|
},
|
|
2157
|
-
error: function(
|
|
2158
|
-
|
|
2144
|
+
error: function(I) {
|
|
2145
|
+
h.error(I);
|
|
2159
2146
|
},
|
|
2160
2147
|
complete: function() {
|
|
2161
|
-
if (!d && !l) return
|
|
2162
|
-
|
|
2148
|
+
if (!d && !l) return h.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2149
|
+
h.next(m), h.complete();
|
|
2163
2150
|
}
|
|
2164
2151
|
});
|
|
2165
2152
|
});
|
|
2166
2153
|
}, e.concat = function() {
|
|
2167
2154
|
for (var o = this, n = arguments.length, c = new Array(n), l = 0; l < n; l++)
|
|
2168
2155
|
c[l] = arguments[l];
|
|
2169
|
-
var d =
|
|
2156
|
+
var d = Nt(this);
|
|
2170
2157
|
return new d(function(s) {
|
|
2171
|
-
var
|
|
2172
|
-
function
|
|
2173
|
-
|
|
2174
|
-
next: function(
|
|
2175
|
-
s.next(
|
|
2158
|
+
var m, h = 0;
|
|
2159
|
+
function I(v) {
|
|
2160
|
+
m = v.subscribe({
|
|
2161
|
+
next: function(V) {
|
|
2162
|
+
s.next(V);
|
|
2176
2163
|
},
|
|
2177
|
-
error: function(
|
|
2178
|
-
s.error(
|
|
2164
|
+
error: function(V) {
|
|
2165
|
+
s.error(V);
|
|
2179
2166
|
},
|
|
2180
2167
|
complete: function() {
|
|
2181
|
-
|
|
2168
|
+
h === c.length ? (m = void 0, s.complete()) : I(d.from(c[h++]));
|
|
2182
2169
|
}
|
|
2183
2170
|
});
|
|
2184
2171
|
}
|
|
2185
|
-
return
|
|
2186
|
-
|
|
2172
|
+
return I(o), function() {
|
|
2173
|
+
m && (m.unsubscribe(), m = void 0);
|
|
2187
2174
|
};
|
|
2188
2175
|
});
|
|
2189
2176
|
}, e.flatMap = function(o) {
|
|
2190
2177
|
var n = this;
|
|
2191
2178
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2192
|
-
var c =
|
|
2179
|
+
var c = Nt(this);
|
|
2193
2180
|
return new c(function(l) {
|
|
2194
2181
|
var d = [], s = n.subscribe({
|
|
2195
|
-
next: function(
|
|
2182
|
+
next: function(h) {
|
|
2196
2183
|
if (o)
|
|
2197
2184
|
try {
|
|
2198
|
-
|
|
2199
|
-
} catch (
|
|
2200
|
-
return l.error(
|
|
2185
|
+
h = o(h);
|
|
2186
|
+
} catch (v) {
|
|
2187
|
+
return l.error(v);
|
|
2201
2188
|
}
|
|
2202
|
-
var
|
|
2203
|
-
next: function(
|
|
2204
|
-
l.next(
|
|
2189
|
+
var I = c.from(h).subscribe({
|
|
2190
|
+
next: function(v) {
|
|
2191
|
+
l.next(v);
|
|
2205
2192
|
},
|
|
2206
|
-
error: function(
|
|
2207
|
-
l.error(
|
|
2193
|
+
error: function(v) {
|
|
2194
|
+
l.error(v);
|
|
2208
2195
|
},
|
|
2209
2196
|
complete: function() {
|
|
2210
|
-
var
|
|
2211
|
-
|
|
2197
|
+
var v = d.indexOf(I);
|
|
2198
|
+
v >= 0 && d.splice(v, 1), m();
|
|
2212
2199
|
}
|
|
2213
2200
|
});
|
|
2214
|
-
d.push(
|
|
2201
|
+
d.push(I);
|
|
2215
2202
|
},
|
|
2216
|
-
error: function(
|
|
2217
|
-
l.error(
|
|
2203
|
+
error: function(h) {
|
|
2204
|
+
l.error(h);
|
|
2218
2205
|
},
|
|
2219
2206
|
complete: function() {
|
|
2220
|
-
|
|
2207
|
+
m();
|
|
2221
2208
|
}
|
|
2222
2209
|
});
|
|
2223
|
-
function
|
|
2210
|
+
function m() {
|
|
2224
2211
|
s.closed && d.length === 0 && l.complete();
|
|
2225
2212
|
}
|
|
2226
2213
|
return function() {
|
|
2227
|
-
d.forEach(function(
|
|
2228
|
-
return
|
|
2214
|
+
d.forEach(function(h) {
|
|
2215
|
+
return h.unsubscribe();
|
|
2229
2216
|
}), s.unsubscribe();
|
|
2230
2217
|
};
|
|
2231
2218
|
});
|
|
@@ -2246,9 +2233,9 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2246
2233
|
return new n(function(d) {
|
|
2247
2234
|
Ht(function() {
|
|
2248
2235
|
if (!d.closed) {
|
|
2249
|
-
for (var s = Mr(c.call(o)),
|
|
2250
|
-
var
|
|
2251
|
-
if (d.next(
|
|
2236
|
+
for (var s = Mr(c.call(o)), m; !(m = s()).done; ) {
|
|
2237
|
+
var h = m.value;
|
|
2238
|
+
if (d.next(h), d.closed) return;
|
|
2252
2239
|
}
|
|
2253
2240
|
d.complete();
|
|
2254
2241
|
}
|
|
@@ -2279,13 +2266,13 @@ var Kr = /* @__PURE__ */ (function() {
|
|
|
2279
2266
|
});
|
|
2280
2267
|
});
|
|
2281
2268
|
}, pe(t, null, [{
|
|
2282
|
-
key:
|
|
2269
|
+
key: Xe,
|
|
2283
2270
|
get: function() {
|
|
2284
2271
|
return this;
|
|
2285
2272
|
}
|
|
2286
2273
|
}]), t;
|
|
2287
2274
|
})();
|
|
2288
|
-
fe() && Object.defineProperty(
|
|
2275
|
+
fe() && Object.defineProperty(P, Symbol("extensions"), {
|
|
2289
2276
|
value: {
|
|
2290
2277
|
symbol: se,
|
|
2291
2278
|
hostReportError: kt
|
|
@@ -2311,8 +2298,8 @@ function Wr(t) {
|
|
|
2311
2298
|
var vt;
|
|
2312
2299
|
typeof self < "u" ? vt = self : typeof window < "u" ? vt = window : typeof global < "u" ? vt = global : typeof module < "u" ? vt = module : vt = Function("return this")();
|
|
2313
2300
|
Wr(vt);
|
|
2314
|
-
var
|
|
2315
|
-
ze
|
|
2301
|
+
var $e = P.prototype, ze = "@@observable";
|
|
2302
|
+
$e[ze] || ($e[ze] = function() {
|
|
2316
2303
|
return this;
|
|
2317
2304
|
});
|
|
2318
2305
|
function Gr(t) {
|
|
@@ -2325,15 +2312,15 @@ function Gr(t) {
|
|
|
2325
2312
|
], r = 0, o = Object.keys(t); r < o.length; r++) {
|
|
2326
2313
|
var n = o[r];
|
|
2327
2314
|
if (e.indexOf(n) < 0)
|
|
2328
|
-
throw
|
|
2315
|
+
throw We(58, n);
|
|
2329
2316
|
}
|
|
2330
2317
|
return t;
|
|
2331
2318
|
}
|
|
2332
2319
|
function Xr(t, e) {
|
|
2333
|
-
var r =
|
|
2334
|
-
typeof c == "function" ? r =
|
|
2320
|
+
var r = rt({}, t), o = function(c) {
|
|
2321
|
+
typeof c == "function" ? r = rt(rt({}, r), c(r)) : r = rt(rt({}, r), c);
|
|
2335
2322
|
}, n = function() {
|
|
2336
|
-
return
|
|
2323
|
+
return rt({}, r);
|
|
2337
2324
|
};
|
|
2338
2325
|
return Object.defineProperty(e, "setContext", {
|
|
2339
2326
|
enumerable: !1,
|
|
@@ -2359,16 +2346,16 @@ function ro(t) {
|
|
|
2359
2346
|
function oo(t, e) {
|
|
2360
2347
|
ro(t) || e();
|
|
2361
2348
|
}
|
|
2362
|
-
function
|
|
2363
|
-
return e ? e(t) :
|
|
2349
|
+
function Ae(t, e) {
|
|
2350
|
+
return e ? e(t) : P.of();
|
|
2364
2351
|
}
|
|
2365
|
-
function
|
|
2366
|
-
return typeof t == "function" ? new
|
|
2352
|
+
function Et(t) {
|
|
2353
|
+
return typeof t == "function" ? new tr(t) : t;
|
|
2367
2354
|
}
|
|
2368
2355
|
function Mt(t) {
|
|
2369
2356
|
return t.request.length <= 1;
|
|
2370
2357
|
}
|
|
2371
|
-
var
|
|
2358
|
+
var tr = (
|
|
2372
2359
|
/** @class */
|
|
2373
2360
|
(function() {
|
|
2374
2361
|
function t(e) {
|
|
@@ -2376,41 +2363,41 @@ var er = (
|
|
|
2376
2363
|
}
|
|
2377
2364
|
return t.empty = function() {
|
|
2378
2365
|
return new t(function() {
|
|
2379
|
-
return
|
|
2366
|
+
return P.of();
|
|
2380
2367
|
});
|
|
2381
2368
|
}, t.from = function(e) {
|
|
2382
|
-
return e.length === 0 ? t.empty() : e.map(
|
|
2369
|
+
return e.length === 0 ? t.empty() : e.map(Et).reduce(function(r, o) {
|
|
2383
2370
|
return r.concat(o);
|
|
2384
2371
|
});
|
|
2385
2372
|
}, t.split = function(e, r, o) {
|
|
2386
|
-
var n =
|
|
2373
|
+
var n = Et(r), c = Et(o || new t(Ae)), l;
|
|
2387
2374
|
return Mt(n) && Mt(c) ? l = new t(function(d) {
|
|
2388
|
-
return e(d) ? n.request(d) ||
|
|
2375
|
+
return e(d) ? n.request(d) || P.of() : c.request(d) || P.of();
|
|
2389
2376
|
}) : l = new t(function(d, s) {
|
|
2390
|
-
return e(d) ? n.request(d, s) ||
|
|
2377
|
+
return e(d) ? n.request(d, s) || P.of() : c.request(d, s) || P.of();
|
|
2391
2378
|
}), Object.assign(l, { left: n, right: c });
|
|
2392
2379
|
}, t.execute = function(e, r) {
|
|
2393
|
-
return e.request(Xr(r.context, Qr(Gr(r)))) ||
|
|
2380
|
+
return e.request(Xr(r.context, Qr(Gr(r)))) || P.of();
|
|
2394
2381
|
}, t.concat = function(e, r) {
|
|
2395
|
-
var o =
|
|
2382
|
+
var o = Et(e);
|
|
2396
2383
|
if (Mt(o))
|
|
2397
2384
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2398
|
-
var n =
|
|
2385
|
+
var n = Et(r), c;
|
|
2399
2386
|
return Mt(n) ? c = new t(function(l) {
|
|
2400
2387
|
return o.request(l, function(d) {
|
|
2401
|
-
return n.request(d) ||
|
|
2402
|
-
}) ||
|
|
2388
|
+
return n.request(d) || P.of();
|
|
2389
|
+
}) || P.of();
|
|
2403
2390
|
}) : c = new t(function(l, d) {
|
|
2404
2391
|
return o.request(l, function(s) {
|
|
2405
|
-
return n.request(s, d) ||
|
|
2406
|
-
}) ||
|
|
2392
|
+
return n.request(s, d) || P.of();
|
|
2393
|
+
}) || P.of();
|
|
2407
2394
|
}), Object.assign(c, { left: o, right: n });
|
|
2408
2395
|
}, t.prototype.split = function(e, r, o) {
|
|
2409
|
-
return this.concat(t.split(e, r, o || new t(
|
|
2396
|
+
return this.concat(t.split(e, r, o || new t(Ae)));
|
|
2410
2397
|
}, t.prototype.concat = function(e) {
|
|
2411
2398
|
return t.concat(this, e);
|
|
2412
2399
|
}, t.prototype.request = function(e, r) {
|
|
2413
|
-
throw
|
|
2400
|
+
throw We(48);
|
|
2414
2401
|
}, t.prototype.onError = function(e, r) {
|
|
2415
2402
|
if (globalThis.__DEV__ !== !1 && oo("onError", function() {
|
|
2416
2403
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
@@ -2423,9 +2410,9 @@ var er = (
|
|
|
2423
2410
|
})()
|
|
2424
2411
|
);
|
|
2425
2412
|
function no(t) {
|
|
2426
|
-
return new
|
|
2413
|
+
return new tr(function(e, r) {
|
|
2427
2414
|
var o = $r(e, []);
|
|
2428
|
-
return new
|
|
2415
|
+
return new P(function(n) {
|
|
2429
2416
|
var c, l = !1;
|
|
2430
2417
|
return Promise.resolve(o).then(function(d) {
|
|
2431
2418
|
return t(d, e.getContext());
|
|
@@ -2444,7 +2431,7 @@ function no(t) {
|
|
|
2444
2431
|
const ao = async () => {
|
|
2445
2432
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2446
2433
|
try {
|
|
2447
|
-
const n = await
|
|
2434
|
+
const n = await $.post(
|
|
2448
2435
|
t,
|
|
2449
2436
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2450
2437
|
// Only grant_type in body
|
|
@@ -2457,9 +2444,9 @@ const ao = async () => {
|
|
|
2457
2444
|
);
|
|
2458
2445
|
return n.status === 200 && n.data.access_token ? n.data.access_token : (console.error("Failed to fetch token:", n.data), null);
|
|
2459
2446
|
} catch (n) {
|
|
2460
|
-
return
|
|
2447
|
+
return $.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2461
2448
|
}
|
|
2462
|
-
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so =
|
|
2449
|
+
}, io = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", so = sr({
|
|
2463
2450
|
uri: `${io}`
|
|
2464
2451
|
}), lo = no(async (t, { headers: e }) => {
|
|
2465
2452
|
const r = await ao();
|
|
@@ -2469,9 +2456,9 @@ const ao = async () => {
|
|
|
2469
2456
|
authorization: `Bearer ${r}`
|
|
2470
2457
|
}
|
|
2471
2458
|
};
|
|
2472
|
-
}), co = new
|
|
2459
|
+
}), co = new lr({
|
|
2473
2460
|
link: lo.concat(so),
|
|
2474
|
-
cache: new
|
|
2461
|
+
cache: new cr(),
|
|
2475
2462
|
defaultOptions: {
|
|
2476
2463
|
watchQuery: {
|
|
2477
2464
|
fetchPolicy: "cache-and-network"
|
|
@@ -2479,7 +2466,7 @@ const ao = async () => {
|
|
|
2479
2466
|
}
|
|
2480
2467
|
}), Fo = (t) => {
|
|
2481
2468
|
const { tanyaConfig: e } = t;
|
|
2482
|
-
return /* @__PURE__ */ a(
|
|
2469
|
+
return /* @__PURE__ */ a(dr, { client: co, children: /* @__PURE__ */ a(xr, { children: /* @__PURE__ */ a(Pr, { tanyaConfig: e }) }) });
|
|
2483
2470
|
};
|
|
2484
2471
|
export {
|
|
2485
2472
|
Fo as TanyaChatbot,
|