tanya-chatbot 0.3.9 → 0.4.1
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.cjs.js +11 -11
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +671 -668
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as it, useState as z, useRef as Ft } from "react";
|
|
2
2
|
import { jsx as a, jsxs as u, Fragment as re } from "react/jsx-runtime";
|
|
3
|
-
import { createHttpLink as
|
|
4
|
-
import { Provider as
|
|
5
|
-
import { createSlice as De, configureStore 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 Ae, useSelector as Ht } from "react-redux";
|
|
5
|
+
import { createSlice as De, configureStore as pr } from "@reduxjs/toolkit";
|
|
6
6
|
import * as Le from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import T from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
11
|
import { Icon as ge } from "@iconify/react";
|
|
12
|
-
import { toast as
|
|
13
|
-
const pr = '*,: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
|
-
function
|
|
15
|
-
return
|
|
12
|
+
import { toast as M } 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
|
+
function vo() {
|
|
15
|
+
return it(() => {
|
|
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: "",
|
|
@@ -57,28 +57,28 @@ const fr = {
|
|
|
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:
|
|
66
|
+
}), { setStore: ko } = 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 } = Ue.actions,
|
|
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 fr = {
|
|
|
87
87
|
});
|
|
88
88
|
window.dispatchEvent(e);
|
|
89
89
|
};
|
|
90
|
-
function
|
|
90
|
+
function yr({
|
|
91
91
|
...t
|
|
92
92
|
}) {
|
|
93
93
|
return /* @__PURE__ */ a(Le.Root, { "data-slot": "popover", ...t });
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function vr({
|
|
96
96
|
...t
|
|
97
97
|
}) {
|
|
98
98
|
return /* @__PURE__ */ a(Le.Trigger, { "data-slot": "popover-trigger", ...t });
|
|
99
99
|
}
|
|
100
|
-
const
|
|
100
|
+
const lt = () => ({ 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 T.post(
|
|
104
|
+
`${t}api/auth/token-bm-grant?baseUrl=${Q()}&siteId=${H()}`
|
|
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 T.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 T.post(
|
|
114
|
+
`${e}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Q()}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
115
115
|
{},
|
|
116
116
|
{
|
|
117
117
|
headers: {
|
|
@@ -122,48 +122,48 @@ 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 T.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
async function Ot() {
|
|
129
|
-
var
|
|
130
|
-
const t =
|
|
131
|
-
console.log(
|
|
132
|
-
const
|
|
133
|
-
if (
|
|
134
|
-
return console.log("access token found in local storage"), { access_token:
|
|
135
|
-
const { serverUrl: l } =
|
|
129
|
+
var b;
|
|
130
|
+
const t = H(), e = "access_token_" + t, r = "expires_in_" + t, o = localStorage.getItem(r), n = localStorage.getItem(e);
|
|
131
|
+
console.log(n);
|
|
132
|
+
const s = ((b = JSON.parse(sessionStorage.getItem("customerData") || "{}")) == null ? void 0 : b.isGuest) || !0;
|
|
133
|
+
if (o && n && (/* @__PURE__ */ new Date()).getTime() < parseInt(o))
|
|
134
|
+
return console.log("access token found in local storage"), { access_token: n, expires_in: o };
|
|
135
|
+
const { serverUrl: l } = lt(), d = JSON.parse(
|
|
136
136
|
sessionStorage.getItem("customerData") || "{}"
|
|
137
|
-
).dwsid,
|
|
137
|
+
).dwsid, i = JSON.parse(
|
|
138
138
|
sessionStorage.getItem("customerData") || "{}"
|
|
139
139
|
).usrRef;
|
|
140
140
|
try {
|
|
141
|
-
const
|
|
142
|
-
`${l}sc-api/${
|
|
141
|
+
const h = s ? "unregister-auth" : "register-auth", S = await T.get(
|
|
142
|
+
`${l}sc-api/${h}?dwsid=${d}&email=${i}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}&siteId=${H()}&token=true`,
|
|
143
143
|
{
|
|
144
144
|
withCredentials: !0
|
|
145
145
|
}
|
|
146
146
|
);
|
|
147
|
-
return localStorage.setItem(
|
|
148
|
-
|
|
149
|
-
String((/* @__PURE__ */ new Date()).getTime() +
|
|
150
|
-
), localStorage.setItem("isGuest",
|
|
151
|
-
} catch (
|
|
152
|
-
console.log(
|
|
147
|
+
return localStorage.setItem(e, S.data.access_token), localStorage.setItem(
|
|
148
|
+
r,
|
|
149
|
+
String((/* @__PURE__ */ new Date()).getTime() + S.data.expires_in * 1e3)
|
|
150
|
+
), localStorage.setItem("isGuest", s ? "true" : "false"), S.data;
|
|
151
|
+
} catch (h) {
|
|
152
|
+
console.log(h);
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
const
|
|
155
|
+
const Q = () => sessionStorage.getItem("Host"), H = () => sessionStorage.getItem("SiteId"), Z = () => sessionStorage.getItem("pubCfg"), tt = () => sessionStorage.getItem("envRef"), et = () => sessionStorage.getItem("orgRef"), be = async (t) => {
|
|
156
156
|
console.log("fetching results");
|
|
157
|
-
const { serverUrl: e, basePath: r } =
|
|
157
|
+
const { serverUrl: e, basePath: r } = lt();
|
|
158
158
|
let o = "";
|
|
159
159
|
{
|
|
160
160
|
const n = await Ot();
|
|
161
161
|
console.log("the token from getSearchResults", n), o = n.access_token;
|
|
162
162
|
}
|
|
163
163
|
try {
|
|
164
|
-
const n =
|
|
165
|
-
return (await
|
|
166
|
-
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${
|
|
164
|
+
const n = Q();
|
|
165
|
+
return (await T.get(
|
|
166
|
+
`${e}${r}/search-sfcc?baseUrl=${n}&query=${t}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
167
167
|
{
|
|
168
168
|
headers: {
|
|
169
169
|
"Content-Type": "application/json",
|
|
@@ -176,11 +176,11 @@ const Z = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
|
|
|
176
176
|
}
|
|
177
177
|
}, He = async (t) => {
|
|
178
178
|
if (!t) throw new Error("Product ID is required");
|
|
179
|
-
const { serverUrl: e, basePath: r } =
|
|
179
|
+
const { serverUrl: e, basePath: r } = lt(), o = Q();
|
|
180
180
|
console.log("calling access");
|
|
181
181
|
const { access_token: n } = await Ot();
|
|
182
|
-
return console.log(n), (await
|
|
183
|
-
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${
|
|
182
|
+
return console.log(n), (await T.get(
|
|
183
|
+
`${e}${r}/product-sfcc/${t}?baseUrl=${o}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
184
184
|
{
|
|
185
185
|
headers: {
|
|
186
186
|
"Content-Type": "application/json",
|
|
@@ -188,21 +188,21 @@ const Z = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
|
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
190
|
)).data;
|
|
191
|
-
},
|
|
191
|
+
}, kr = async (t) => {
|
|
192
192
|
if (!t) throw new Error("customerId is required");
|
|
193
193
|
const e = await qe(), { customer_token: r } = await Me(
|
|
194
194
|
e
|
|
195
|
-
), { serverUrl: o, basePath: n } =
|
|
196
|
-
return (await
|
|
197
|
-
`${o}${n}/get-interest?baseUrl=${
|
|
195
|
+
), { serverUrl: o, basePath: n } = lt(), l = (await Ot()).access_token;
|
|
196
|
+
return (await T.get(
|
|
197
|
+
`${o}${n}/get-interest?baseUrl=${Q()}&customerId=${t}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
198
198
|
{
|
|
199
199
|
headers: {
|
|
200
200
|
"Content-Type": "application/json",
|
|
201
|
-
Authorization: `Bearer ${
|
|
201
|
+
Authorization: `Bearer ${l}`
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
204
|
)).data;
|
|
205
|
-
}, 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),
|
|
205
|
+
}, 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), Sr = (t, e) => t.toLocaleString("en-US", {
|
|
206
206
|
style: "currency",
|
|
207
207
|
currency: e || "USD"
|
|
208
208
|
}), ve = (t) => {
|
|
@@ -214,37 +214,37 @@ const Z = () => sessionStorage.getItem("Host"), R = () => sessionStorage.getItem
|
|
|
214
214
|
centAmount: (r = t.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
215
215
|
currencyCode: (o = t.masterVariant) == null ? void 0 : o.prices[0].value.currencyCode
|
|
216
216
|
};
|
|
217
|
-
},
|
|
217
|
+
}, 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) => {
|
|
218
218
|
const o = e.match(/^(\d+)\.\s(.+)/);
|
|
219
219
|
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/>";
|
|
220
220
|
}).join("");
|
|
221
|
-
function
|
|
222
|
-
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] =
|
|
223
|
-
return
|
|
221
|
+
function _r() {
|
|
222
|
+
const t = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [e, r] = z(t);
|
|
223
|
+
return it(() => {
|
|
224
224
|
const o = () => r(t());
|
|
225
225
|
return window.addEventListener("resize", o), () => window.removeEventListener("resize", o);
|
|
226
226
|
}, []), e;
|
|
227
227
|
}
|
|
228
|
-
const
|
|
228
|
+
const Fr = ({
|
|
229
229
|
product: t
|
|
230
230
|
}) => {
|
|
231
|
-
const e = Ae(), r =
|
|
231
|
+
const e = Ae(), r = _r(), [o, n] = z(0), s = () => {
|
|
232
232
|
n(
|
|
233
233
|
(i) => i + r >= t.length ? 0 : i + r
|
|
234
234
|
);
|
|
235
|
-
},
|
|
235
|
+
}, l = () => {
|
|
236
236
|
n(
|
|
237
237
|
(i) => i - r < 0 ? t.length - (t.length % r || r) : i - r
|
|
238
238
|
);
|
|
239
239
|
}, d = async (i) => {
|
|
240
|
-
const
|
|
241
|
-
e(oe(
|
|
240
|
+
const b = await He(i);
|
|
241
|
+
e(oe(b));
|
|
242
242
|
};
|
|
243
243
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ u("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
244
244
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
245
245
|
"button",
|
|
246
246
|
{
|
|
247
|
-
onClick:
|
|
247
|
+
onClick: l,
|
|
248
248
|
className: "absolute z-50 left-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
249
249
|
style: {
|
|
250
250
|
height: "30px",
|
|
@@ -255,7 +255,7 @@ const _r = ({
|
|
|
255
255
|
}
|
|
256
256
|
),
|
|
257
257
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: t.slice(o, o + r).map((i) => {
|
|
258
|
-
var
|
|
258
|
+
var b, h, S, _;
|
|
259
259
|
return /* @__PURE__ */ u(
|
|
260
260
|
"div",
|
|
261
261
|
{
|
|
@@ -267,7 +267,7 @@ const _r = ({
|
|
|
267
267
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
268
268
|
"img",
|
|
269
269
|
{
|
|
270
|
-
src: ((
|
|
270
|
+
src: ((b = ye(i)[0]) == null ? void 0 : b.link) || ye(i)[0] || // fallback if it's a string
|
|
271
271
|
"https://via.placeholder.com/120",
|
|
272
272
|
alt: i != null && i.productName ? i.productName : "Product",
|
|
273
273
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -280,7 +280,7 @@ const _r = ({
|
|
|
280
280
|
children: [
|
|
281
281
|
/* @__PURE__ */ u("div", { className: "relative inline-block group", children: [
|
|
282
282
|
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ke(
|
|
283
|
-
xe((
|
|
283
|
+
xe((h = i == null ? void 0 : i.name) == null ? void 0 : h["en-US"]),
|
|
284
284
|
60
|
|
285
285
|
) || "Product" }),
|
|
286
286
|
/* @__PURE__ */ a(
|
|
@@ -295,16 +295,16 @@ const _r = ({
|
|
|
295
295
|
zIndex: 50
|
|
296
296
|
},
|
|
297
297
|
children: i != null && i.productName ? i.productName : i != null && i.product_name ? i.product_name : ke(
|
|
298
|
-
xe((
|
|
298
|
+
xe((S = i == null ? void 0 : i.name) == null ? void 0 : S["en-US"]),
|
|
299
299
|
60
|
|
300
300
|
) || "Product"
|
|
301
301
|
}
|
|
302
302
|
)
|
|
303
303
|
] }),
|
|
304
304
|
/* @__PURE__ */ u("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
305
|
-
/* @__PURE__ */ a("p", { children:
|
|
305
|
+
/* @__PURE__ */ a("p", { children: Sr(
|
|
306
306
|
i != null && i.price ? Number(i == null ? void 0 : i.price) : ve(i).centAmount || 0,
|
|
307
|
-
(
|
|
307
|
+
(_ = ve(i)) == null ? void 0 : _.currencyCode
|
|
308
308
|
) }),
|
|
309
309
|
/* @__PURE__ */ u("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
310
310
|
"$",
|
|
@@ -322,7 +322,7 @@ const _r = ({
|
|
|
322
322
|
(t == null ? void 0 : t.length) > r && /* @__PURE__ */ a(
|
|
323
323
|
"button",
|
|
324
324
|
{
|
|
325
|
-
onClick:
|
|
325
|
+
onClick: s,
|
|
326
326
|
className: "absolute z-50 right-0 text-[#000000] bg-[#ffffff] rounded-full p-2 flex items-center h-fit",
|
|
327
327
|
style: {
|
|
328
328
|
height: "30px",
|
|
@@ -346,11 +346,11 @@ const _r = ({
|
|
|
346
346
|
"div",
|
|
347
347
|
{
|
|
348
348
|
className: "font-nunitoSans font-bold text-sm text-[#494949] p-2 w-fit rounded-[20px]",
|
|
349
|
-
children:
|
|
349
|
+
children: Cr(r.keyword) || "No keyword"
|
|
350
350
|
}
|
|
351
351
|
),
|
|
352
352
|
/* @__PURE__ */ a(
|
|
353
|
-
|
|
353
|
+
Fr,
|
|
354
354
|
{
|
|
355
355
|
product: r.items,
|
|
356
356
|
storeDetails: e
|
|
@@ -360,12 +360,12 @@ const _r = ({
|
|
|
360
360
|
},
|
|
361
361
|
o
|
|
362
362
|
)) }), Ve = async (t, e) => {
|
|
363
|
-
const { serverUrl: r, basePath: o } =
|
|
363
|
+
const { serverUrl: r, basePath: o } = lt(), n = `${r}`;
|
|
364
364
|
console.log(`customer_token
|
|
365
365
|
`, t);
|
|
366
366
|
try {
|
|
367
|
-
return (await
|
|
368
|
-
`${n}${o}/basket/create?baseUrl=${
|
|
367
|
+
return (await T.post(
|
|
368
|
+
`${n}${o}/basket/create?baseUrl=${Q()}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
369
369
|
e,
|
|
370
370
|
{
|
|
371
371
|
headers: {
|
|
@@ -374,14 +374,14 @@ const _r = ({
|
|
|
374
374
|
}
|
|
375
375
|
}
|
|
376
376
|
)).data;
|
|
377
|
-
} catch (
|
|
378
|
-
return
|
|
377
|
+
} catch (s) {
|
|
378
|
+
return T.isAxiosError(s) ? console.error("Error creating basket:", s.response || s.message) : console.error("Unexpected error:", s), null;
|
|
379
379
|
}
|
|
380
|
-
},
|
|
381
|
-
const { serverUrl: o, basePath: n } =
|
|
380
|
+
}, Rt = async (t, e, r) => {
|
|
381
|
+
const { serverUrl: o, basePath: n } = lt(), s = `${o}`;
|
|
382
382
|
try {
|
|
383
|
-
const
|
|
384
|
-
`${
|
|
383
|
+
const l = await T.post(
|
|
384
|
+
`${s}${n}/basket/add-product/${t}?baseUrl=${Q()}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
385
385
|
e,
|
|
386
386
|
{
|
|
387
387
|
headers: {
|
|
@@ -390,22 +390,22 @@ const _r = ({
|
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
392
|
);
|
|
393
|
-
return
|
|
394
|
-
} catch (
|
|
395
|
-
return
|
|
393
|
+
return l.status === 200 && l.data ? l.data : null;
|
|
394
|
+
} catch (l) {
|
|
395
|
+
return T.isAxiosError(l) ? console.error(
|
|
396
396
|
"Error adding products to basket:",
|
|
397
|
-
|
|
398
|
-
) : console.error("Unexpected error:",
|
|
397
|
+
l.response || l.message
|
|
398
|
+
) : console.error("Unexpected error:", l), null;
|
|
399
399
|
}
|
|
400
400
|
}, Re = async ({
|
|
401
401
|
basketId: t,
|
|
402
402
|
customer_token: e
|
|
403
403
|
}) => {
|
|
404
|
-
var
|
|
405
|
-
const { serverUrl: r, basePath: o } =
|
|
404
|
+
var s;
|
|
405
|
+
const { serverUrl: r, basePath: o } = lt(), n = `${r}`;
|
|
406
406
|
try {
|
|
407
|
-
const
|
|
408
|
-
`${n}${o}/basket/${t}?baseUrl=${
|
|
407
|
+
const l = await T.get(
|
|
408
|
+
`${n}${o}/basket/${t}?baseUrl=${Q()}&siteId=${H()}&pubCfg=${Z()}&envRef=${tt()}&orgRef=${et()}`,
|
|
409
409
|
{
|
|
410
410
|
headers: {
|
|
411
411
|
"Content-Type": "application/json",
|
|
@@ -413,138 +413,138 @@ const _r = ({
|
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
);
|
|
416
|
-
return { status:
|
|
417
|
-
} catch (
|
|
418
|
-
return
|
|
416
|
+
return { status: l.status, data: l.data };
|
|
417
|
+
} catch (l) {
|
|
418
|
+
return T.isAxiosError(l) ? { status: (s = l.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
419
419
|
}
|
|
420
|
-
},
|
|
421
|
-
const
|
|
420
|
+
}, Yt = "sfcc_basket_id", Se = "sfcc_customer_token", Tt = "sfcc_token_expiry", Nr = 300 * 1e3, It = "1.0.0";
|
|
421
|
+
const st = (t) => {
|
|
422
422
|
try {
|
|
423
|
-
t ? localStorage.setItem(
|
|
423
|
+
t ? localStorage.setItem(Yt, t) : localStorage.removeItem(Yt);
|
|
424
424
|
} catch (e) {
|
|
425
425
|
console.error("Error saving basket ID to storage:", e);
|
|
426
426
|
}
|
|
427
|
-
},
|
|
427
|
+
}, Kt = (t) => {
|
|
428
428
|
try {
|
|
429
429
|
if (t) {
|
|
430
430
|
localStorage.setItem(Se, t);
|
|
431
|
-
const e = Date.now() +
|
|
431
|
+
const e = Date.now() + Nr;
|
|
432
432
|
localStorage.setItem(Tt, e.toString());
|
|
433
433
|
} else
|
|
434
434
|
localStorage.removeItem(Se);
|
|
435
435
|
} catch (e) {
|
|
436
436
|
console.error("Error storing token:", e);
|
|
437
437
|
}
|
|
438
|
-
}, Ce = 300,
|
|
439
|
-
var d, i,
|
|
440
|
-
const t = Ae(), e =
|
|
441
|
-
if (
|
|
438
|
+
}, Ce = 300, Er = () => {
|
|
439
|
+
var d, i, b, h, S, _;
|
|
440
|
+
const t = Ae(), e = Ht((F) => F.product.product), r = Ht((F) => F.store.store), [o, n] = z(!!e);
|
|
441
|
+
if (it(() => {
|
|
442
442
|
n(!!e);
|
|
443
443
|
}, [e]), !e) return null;
|
|
444
|
-
const
|
|
445
|
-
var
|
|
444
|
+
const s = async () => {
|
|
445
|
+
var F, A, K, ct, V, dt, kt, Pt, rt, St, Ct, ut, $t, zt, _t, P;
|
|
446
446
|
console.log(e, "the prod");
|
|
447
447
|
try {
|
|
448
|
-
if (!((
|
|
449
|
-
|
|
448
|
+
if (!((A = (F = e == null ? void 0 : e.variants) == null ? void 0 : F[0]) != null && A.product_id) && !(e.type.item || e.type.bundle) && !((ct = (K = e == null ? void 0 : e.variants) == null ? void 0 : K[0]) != null && ct.productId)) {
|
|
449
|
+
M.error("Variants not available", {
|
|
450
450
|
position: "bottom-right",
|
|
451
451
|
autoClose: 1e3
|
|
452
452
|
}), console.error("No product variant found");
|
|
453
453
|
return;
|
|
454
454
|
}
|
|
455
|
-
const
|
|
455
|
+
const C = [
|
|
456
456
|
{
|
|
457
|
-
product_id: ((
|
|
457
|
+
product_id: ((V = e.variants) == null ? void 0 : V[0].product_id) || ((dt = e.variants) == null ? void 0 : dt[0].productId) || (e == null ? void 0 : e.id),
|
|
458
458
|
quantity: 1
|
|
459
459
|
}
|
|
460
460
|
];
|
|
461
|
-
console.log(
|
|
462
|
-
const
|
|
461
|
+
console.log(C, "the product data");
|
|
462
|
+
const k = JSON.parse(
|
|
463
463
|
sessionStorage.getItem("customerData") || "{}"
|
|
464
|
-
),
|
|
465
|
-
if (!
|
|
464
|
+
), ot = (k == null ? void 0 : k.basketId) || localStorage.getItem(Yt), Wt = !1, jt = localStorage.getItem(Tt), At = Date.now();
|
|
465
|
+
if (!Wt || !jt || At >= parseInt(jt)) {
|
|
466
466
|
let $ = "";
|
|
467
467
|
{
|
|
468
|
-
const
|
|
469
|
-
console.log("token from auth data"), $ = "Bearer " +
|
|
468
|
+
const ft = await Ot();
|
|
469
|
+
console.log("token from auth data"), $ = "Bearer " + ft.access_token;
|
|
470
470
|
}
|
|
471
471
|
if (!$) {
|
|
472
472
|
console.error("Failed to get customer_token");
|
|
473
473
|
return;
|
|
474
474
|
}
|
|
475
|
-
const
|
|
476
|
-
if (
|
|
477
|
-
const
|
|
478
|
-
basketId:
|
|
475
|
+
const pt = At + 300 * 1e3;
|
|
476
|
+
if (Kt($), localStorage.setItem(Tt, pt.toString()), ot) {
|
|
477
|
+
const ft = await Re({
|
|
478
|
+
basketId: ot,
|
|
479
479
|
customer_token: $
|
|
480
480
|
});
|
|
481
|
-
if (console.log(
|
|
482
|
-
const
|
|
483
|
-
|
|
484
|
-
|
|
481
|
+
if (console.log(ot, "basket id from customer"), ft.status === 200 && ft) {
|
|
482
|
+
const D = await Rt(
|
|
483
|
+
ot,
|
|
484
|
+
C,
|
|
485
485
|
$
|
|
486
486
|
);
|
|
487
|
-
(((
|
|
487
|
+
(((kt = D == null ? void 0 : D.product_items) == null ? void 0 : kt.length) > 0 || ((Pt = D == null ? void 0 : D.productItems) == null ? void 0 : Pt.length) > 0) && (M.success("Added to cart", {
|
|
488
488
|
position: "bottom-right",
|
|
489
489
|
autoClose: 3e3,
|
|
490
490
|
hideProgressBar: !1,
|
|
491
491
|
closeOnClick: !0,
|
|
492
492
|
pauseOnHover: !0,
|
|
493
493
|
draggable: !0
|
|
494
|
-
}),
|
|
494
|
+
}), Vt(ot));
|
|
495
495
|
return;
|
|
496
496
|
}
|
|
497
497
|
}
|
|
498
|
-
const
|
|
498
|
+
const Dt = {
|
|
499
499
|
productItems: [
|
|
500
500
|
{
|
|
501
|
-
productId: ((
|
|
501
|
+
productId: ((rt = e.variants) == null ? void 0 : rt[0].product_id) || ((St = e.variants) == null ? void 0 : St[0].productId) || (e == null ? void 0 : e.id),
|
|
502
502
|
quantity: 1
|
|
503
503
|
}
|
|
504
504
|
]
|
|
505
505
|
};
|
|
506
506
|
console.log("before create basket");
|
|
507
|
-
const
|
|
507
|
+
const m = await Ve($, Dt);
|
|
508
508
|
if (console.log(
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
509
|
+
m,
|
|
510
|
+
m == null ? void 0 : m.basket_id,
|
|
511
|
+
m == null ? void 0 : m.basketId,
|
|
512
512
|
"the basket response"
|
|
513
|
-
), !(
|
|
513
|
+
), !(m != null && m.basket_id) && !(m != null && m.basketId)) {
|
|
514
514
|
console.error("Failed to create basket");
|
|
515
515
|
return;
|
|
516
516
|
}
|
|
517
517
|
console.log(
|
|
518
518
|
"setting stored id",
|
|
519
|
-
(
|
|
520
|
-
),
|
|
521
|
-
(
|
|
519
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId)
|
|
520
|
+
), st(
|
|
521
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId)
|
|
522
522
|
), console.log("adding product to basket");
|
|
523
|
-
const
|
|
524
|
-
(
|
|
525
|
-
|
|
523
|
+
const J = await Rt(
|
|
524
|
+
(m == null ? void 0 : m.basket_id) || (m == null ? void 0 : m.basketId),
|
|
525
|
+
C,
|
|
526
526
|
$
|
|
527
527
|
);
|
|
528
|
-
console.log("object added to basket"), (((
|
|
528
|
+
console.log("object added to basket"), (((Ct = J == null ? void 0 : J.product_items) == null ? void 0 : Ct.length) > 0 || ((ut = J == null ? void 0 : J.productItems) == null ? void 0 : ut.length) > 0) && M.success("Added to cart", {
|
|
529
529
|
position: "bottom-right",
|
|
530
530
|
autoClose: 3e3,
|
|
531
531
|
hideProgressBar: !1,
|
|
532
532
|
closeOnClick: !0,
|
|
533
533
|
pauseOnHover: !0,
|
|
534
534
|
draggable: !0
|
|
535
|
-
}),
|
|
535
|
+
}), Vt(m.basket_id || (m == null ? void 0 : m.basketId));
|
|
536
536
|
}
|
|
537
|
-
} catch (
|
|
538
|
-
console.error("Error adding to cart:",
|
|
537
|
+
} catch (C) {
|
|
538
|
+
console.error("Error adding to cart:", C), M.error("Failed to add product to cart", {
|
|
539
539
|
position: "bottom-right",
|
|
540
540
|
autoClose: 3e3
|
|
541
|
-
}), ((
|
|
542
|
-
((
|
|
541
|
+
}), (($t = C == null ? void 0 : C.response) == null ? void 0 : $t.status) === 404 || // Basket not found
|
|
542
|
+
((zt = C == null ? void 0 : C.response) == null ? void 0 : zt.status) === 401 ? (((_t = C == null ? void 0 : C.response) == null ? void 0 : _t.status) === 404 && st(null), ((P = C == null ? void 0 : C.response) == null ? void 0 : P.status) === 401 && (st(null), Kt(null))) : (console.error("Failed to add product to basket:", C.message), M.error("Failed to add product to cart", {
|
|
543
543
|
position: "bottom-right",
|
|
544
544
|
autoClose: 3e3
|
|
545
545
|
}));
|
|
546
546
|
}
|
|
547
|
-
},
|
|
547
|
+
}, l = () => {
|
|
548
548
|
e && (window.location.href = e.c_pdpUrl);
|
|
549
549
|
};
|
|
550
550
|
return console.log(e, "the prod"), /* @__PURE__ */ u(re, { children: [
|
|
@@ -566,7 +566,7 @@ const xt = (t) => {
|
|
|
566
566
|
${o ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
567
567
|
`,
|
|
568
568
|
style: { willChange: "transform, opacity" },
|
|
569
|
-
onClick: (
|
|
569
|
+
onClick: (F) => F.stopPropagation(),
|
|
570
570
|
children: [
|
|
571
571
|
/* @__PURE__ */ u("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
572
572
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: e.name }) }),
|
|
@@ -588,20 +588,20 @@ const xt = (t) => {
|
|
|
588
588
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
589
589
|
"img",
|
|
590
590
|
{
|
|
591
|
-
src: (
|
|
591
|
+
src: (h = (b = (i = (d = e.imageGroups) == null ? void 0 : d[0]) == null ? void 0 : i.images) == null ? void 0 : b[0]) == null ? void 0 : h.link,
|
|
592
592
|
alt: e.name,
|
|
593
593
|
className: "rounded-[10px]"
|
|
594
594
|
}
|
|
595
595
|
) }),
|
|
596
596
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: e.imageGroups.slice(1, 2).map(
|
|
597
|
-
(
|
|
597
|
+
(F) => F.images.slice(1, 2).map((A) => /* @__PURE__ */ a(
|
|
598
598
|
"img",
|
|
599
599
|
{
|
|
600
|
-
src:
|
|
600
|
+
src: A.link,
|
|
601
601
|
alt: e.name,
|
|
602
602
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
603
603
|
},
|
|
604
|
-
|
|
604
|
+
A.link
|
|
605
605
|
))
|
|
606
606
|
) })
|
|
607
607
|
] }),
|
|
@@ -637,19 +637,19 @@ const xt = (t) => {
|
|
|
637
637
|
/* @__PURE__ */ u("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
638
638
|
/* @__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: [
|
|
639
639
|
/* @__PURE__ */ u("div", { className: "text-[#323135] font-bold", children: [
|
|
640
|
-
((
|
|
640
|
+
((S = e == null ? void 0 : e.rating) == null ? void 0 : S.rate) || 0,
|
|
641
641
|
" /",
|
|
642
642
|
" ",
|
|
643
643
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
644
644
|
] }),
|
|
645
645
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
646
646
|
/* @__PURE__ */ u("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
647
|
-
((
|
|
647
|
+
((_ = e == null ? void 0 : e.rating) == null ? void 0 : _.count) || 0,
|
|
648
648
|
" ratings"
|
|
649
649
|
] })
|
|
650
650
|
] }) }),
|
|
651
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
652
|
-
var
|
|
651
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((F, A) => {
|
|
652
|
+
var K;
|
|
653
653
|
return /* @__PURE__ */ a(
|
|
654
654
|
ge,
|
|
655
655
|
{
|
|
@@ -657,10 +657,10 @@ const xt = (t) => {
|
|
|
657
657
|
width: "20",
|
|
658
658
|
height: "20",
|
|
659
659
|
className: `text-yellow-500
|
|
660
|
-
${((
|
|
660
|
+
${((K = e == null ? void 0 : e.rating) == null ? void 0 : K.rate) > A ? "text-yellow-500" : "text-gray-300"}
|
|
661
661
|
`
|
|
662
662
|
},
|
|
663
|
-
|
|
663
|
+
A
|
|
664
664
|
);
|
|
665
665
|
}) })
|
|
666
666
|
] }),
|
|
@@ -675,7 +675,7 @@ const xt = (t) => {
|
|
|
675
675
|
{
|
|
676
676
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer",
|
|
677
677
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
678
|
-
onClick:
|
|
678
|
+
onClick: s,
|
|
679
679
|
children: "Add to Cart"
|
|
680
680
|
}
|
|
681
681
|
),
|
|
@@ -684,7 +684,7 @@ const xt = (t) => {
|
|
|
684
684
|
{
|
|
685
685
|
className: "rounded-[5px] shadow-sm text-[#FBFBFC] bg-[#6851C6] p-2 w-full text-center cursor-pointer mb-16",
|
|
686
686
|
style: { backgroundColor: r.tanyaThemeColor },
|
|
687
|
-
onClick:
|
|
687
|
+
onClick: l,
|
|
688
688
|
children: "View more"
|
|
689
689
|
}
|
|
690
690
|
)
|
|
@@ -695,162 +695,165 @@ const xt = (t) => {
|
|
|
695
695
|
}
|
|
696
696
|
)
|
|
697
697
|
] });
|
|
698
|
-
},
|
|
699
|
-
tanyaConfig: t
|
|
698
|
+
}, Tr = ({
|
|
699
|
+
tanyaConfig: t,
|
|
700
|
+
basketId: e
|
|
700
701
|
}) => {
|
|
701
|
-
const
|
|
702
|
+
const r = [
|
|
702
703
|
"Myself",
|
|
703
704
|
"My Child",
|
|
704
705
|
"My Grandchild",
|
|
705
706
|
"Niece/Nephew",
|
|
706
707
|
"My Friends",
|
|
707
708
|
"Others"
|
|
708
|
-
],
|
|
709
|
+
], o = {
|
|
709
710
|
Myself: "himself/herself",
|
|
710
711
|
"My Child": "his/her child",
|
|
711
712
|
"My Grandchild": "his/her grandchild",
|
|
712
713
|
"Niece/Nephew": "his/her niece/nephew",
|
|
713
714
|
"My Friends": "his/her friends",
|
|
714
715
|
Others: "others"
|
|
715
|
-
},
|
|
716
|
+
}, n = Ft(null), s = Ft(null), l = Ft(null), d = Ft(null), [i, b] = z(null), [h, S] = z(!1), [_, F] = z(!1), [A, K] = z(!1), [ct, V] = z(!1), [dt, kt] = z(!1), [Pt, rt] = z(!1), [St, Ct] = z(""), [ut, $t] = z(""), zt = (c) => ({
|
|
716
717
|
id: c.id,
|
|
717
718
|
title: c.name,
|
|
718
719
|
image: c.image ?? "",
|
|
719
720
|
price: c.price ?? 0
|
|
720
|
-
}), [
|
|
721
|
-
|
|
722
|
-
},
|
|
723
|
-
|
|
721
|
+
}), [_t, P] = z([]), C = Ft(null), k = Ht((c) => c.store.store), ot = Ht((c) => c.product.product), Wt = () => {
|
|
722
|
+
K(!0), setTimeout(() => F(!0), 10);
|
|
723
|
+
}, jt = () => {
|
|
724
|
+
F(!1), setTimeout(() => K(!1), 300);
|
|
724
725
|
};
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
}, [
|
|
728
|
-
const
|
|
729
|
-
$t(
|
|
726
|
+
it(() => {
|
|
727
|
+
h ? Wt() : jt();
|
|
728
|
+
}, [h]);
|
|
729
|
+
const At = (c) => {
|
|
730
|
+
$t(o[c]);
|
|
730
731
|
};
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
}, [
|
|
734
|
-
let
|
|
735
|
-
const
|
|
736
|
-
if (
|
|
737
|
-
return
|
|
732
|
+
it(() => {
|
|
733
|
+
C.current && (C.current.scrollTop += 150);
|
|
734
|
+
}, [_t]);
|
|
735
|
+
let $ = null, pt = null;
|
|
736
|
+
const Dt = async () => {
|
|
737
|
+
if ($ && pt && Date.now() < pt)
|
|
738
|
+
return $;
|
|
738
739
|
try {
|
|
739
|
-
const c = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token",
|
|
740
|
+
const c = "https://us-east-1lsr29ln3u.auth.us-east-1.amazoncognito.com/oauth2/token", v = new URLSearchParams({
|
|
740
741
|
grant_type: "client_credentials",
|
|
741
742
|
client_id: "4i8rd70sgt961tc4dhskgf08c",
|
|
742
743
|
client_secret: "bnsfq1220loh2cn2cm2ttn8fdhdpt0u8m1fgj8vfk2rn61aurjg",
|
|
743
744
|
scope: "default-m2m-resource-server-8xzfzo/read"
|
|
744
|
-
}),
|
|
745
|
+
}), w = await fetch(c, {
|
|
745
746
|
method: "POST",
|
|
746
747
|
headers: {
|
|
747
748
|
"Content-Type": "application/x-www-form-urlencoded"
|
|
748
749
|
},
|
|
749
|
-
body:
|
|
750
|
+
body: v
|
|
750
751
|
});
|
|
751
|
-
if (!
|
|
752
|
+
if (!w.ok)
|
|
752
753
|
throw new Error(
|
|
753
|
-
`Token request failed! status: ${
|
|
754
|
+
`Token request failed! status: ${w.status}`
|
|
754
755
|
);
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
const
|
|
758
|
-
return
|
|
756
|
+
const x = await w.json();
|
|
757
|
+
$ = x.access_token;
|
|
758
|
+
const p = x.expires_in || 3600;
|
|
759
|
+
return pt = Date.now() + (p - 60) * 1e3, $;
|
|
759
760
|
} catch (c) {
|
|
760
|
-
return console.error("Error obtaining JWT token:", c),
|
|
761
|
+
return console.error("Error obtaining JWT token:", c), $ = null, pt = null, null;
|
|
761
762
|
}
|
|
762
|
-
},
|
|
763
|
+
}, m = async () => {
|
|
763
764
|
const c = await Ot();
|
|
764
|
-
c != null &&
|
|
765
|
+
c != null && b(c);
|
|
765
766
|
};
|
|
766
|
-
|
|
767
|
+
it(() => {
|
|
767
768
|
if (t != null && t.siteId) {
|
|
768
|
-
const { clientID: c, host:
|
|
769
|
-
sessionStorage.setItem("Host",
|
|
769
|
+
const { clientID: c, host: v, organizationID: w, shortCode: x, siteId: p } = t;
|
|
770
|
+
sessionStorage.setItem("Host", v), sessionStorage.setItem("SiteId", p), sessionStorage.setItem("pubCfg", btoa(c)), sessionStorage.setItem("envRef", x), sessionStorage.setItem("orgRef", w);
|
|
770
771
|
}
|
|
771
|
-
|
|
772
|
-
}, [])
|
|
773
|
-
|
|
772
|
+
m(), console.log("scapi environment v1");
|
|
773
|
+
}, []), it(() => {
|
|
774
|
+
e && (console.log("setting the basket id", e), st(e));
|
|
775
|
+
}, [e]);
|
|
776
|
+
const J = async () => {
|
|
774
777
|
const c = JSON.parse(
|
|
775
778
|
sessionStorage.getItem("customerData") || "{}"
|
|
776
779
|
).customerId;
|
|
777
|
-
return (await
|
|
778
|
-
},
|
|
779
|
-
console.log("in secondary flow",
|
|
780
|
-
const
|
|
781
|
-
if (console.log(
|
|
780
|
+
return (await kr(c || "")).c_interests;
|
|
781
|
+
}, ft = async (c, v) => {
|
|
782
|
+
console.log("in secondary flow", It);
|
|
783
|
+
const w = await J();
|
|
784
|
+
if (console.log(w, "interests of customer", It), !!w)
|
|
782
785
|
try {
|
|
783
|
-
|
|
784
|
-
(
|
|
785
|
-
(
|
|
786
|
+
P(
|
|
787
|
+
(U) => U.map(
|
|
788
|
+
(R, Y) => Y === U.length - 1 ? { ...R, secondaryLoading: !0 } : R
|
|
786
789
|
)
|
|
787
790
|
);
|
|
788
|
-
const
|
|
789
|
-
if (!
|
|
790
|
-
const
|
|
791
|
-
registered: String(
|
|
792
|
-
userId: String(
|
|
793
|
-
}).toString()}`,
|
|
791
|
+
const x = await Dt();
|
|
792
|
+
if (!x) throw new Error("Failed to fetch token");
|
|
793
|
+
const p = localStorage.getItem("customerNumber"), g = localStorage.getItem("isLoggedIn"), mt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
794
|
+
registered: String(g || !1),
|
|
795
|
+
userId: String(p || (/* @__PURE__ */ new Date()).getTime())
|
|
796
|
+
}).toString()}`, ht = JSON.stringify({
|
|
794
797
|
flowId: "Q166PR519W",
|
|
795
798
|
flowAliasId: "HKFUVLWVH2",
|
|
796
799
|
input: {
|
|
797
800
|
loyaltyPoints: "",
|
|
798
801
|
productName: c,
|
|
799
|
-
productPoints: String(
|
|
800
|
-
interests:
|
|
802
|
+
productPoints: String(v || 0),
|
|
803
|
+
interests: w
|
|
801
804
|
}
|
|
802
|
-
}),
|
|
805
|
+
}), L = await fetch(mt, {
|
|
803
806
|
signal: AbortSignal.timeout(3e4),
|
|
804
807
|
method: "POST",
|
|
805
808
|
headers: {
|
|
806
809
|
"Content-Type": "application/json",
|
|
807
|
-
Authorization: `Bearer ${
|
|
810
|
+
Authorization: `Bearer ${x}`
|
|
808
811
|
},
|
|
809
|
-
body:
|
|
812
|
+
body: ht
|
|
810
813
|
});
|
|
811
|
-
if (!
|
|
812
|
-
const
|
|
813
|
-
let
|
|
814
|
+
if (!L.body) throw new Error("Readable stream not supported");
|
|
815
|
+
const wt = L.body.getReader(), gt = new TextDecoder();
|
|
816
|
+
let B = "";
|
|
814
817
|
for (; ; ) {
|
|
815
|
-
const { done:
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
-
const
|
|
818
|
+
const { done: U, value: R } = await wt.read();
|
|
819
|
+
if (U) break;
|
|
820
|
+
B += gt.decode(R, { stream: !0 });
|
|
821
|
+
const Y = B.split(`
|
|
819
822
|
`);
|
|
820
|
-
|
|
821
|
-
for (const
|
|
822
|
-
if (
|
|
823
|
-
const
|
|
823
|
+
B = Y.pop() || "";
|
|
824
|
+
for (const W of Y)
|
|
825
|
+
if (W.startsWith("data:")) {
|
|
826
|
+
const f = W.slice(5).trim();
|
|
824
827
|
try {
|
|
825
|
-
const
|
|
826
|
-
|
|
828
|
+
const q = JSON.parse(f);
|
|
829
|
+
q.index === 0 && P(
|
|
827
830
|
(I) => I.map(
|
|
828
|
-
(
|
|
829
|
-
...
|
|
830
|
-
secondaryResponse:
|
|
831
|
+
(O, G) => G === I.length - 1 ? {
|
|
832
|
+
...O,
|
|
833
|
+
secondaryResponse: q.data,
|
|
831
834
|
secondaryLoading: !1
|
|
832
|
-
} :
|
|
835
|
+
} : O
|
|
833
836
|
)
|
|
834
837
|
);
|
|
835
|
-
} catch (
|
|
836
|
-
|
|
838
|
+
} catch (q) {
|
|
839
|
+
P(
|
|
837
840
|
(I) => I.map(
|
|
838
|
-
(
|
|
841
|
+
(O, G) => G === I.length - 1 ? { ...O, secondaryLoading: !1 } : O
|
|
839
842
|
)
|
|
840
|
-
), console.error("Secondary flow JSON parse error:",
|
|
843
|
+
), console.error("Secondary flow JSON parse error:", q);
|
|
841
844
|
}
|
|
842
845
|
}
|
|
843
846
|
}
|
|
844
|
-
} catch (
|
|
845
|
-
console.error("Secondary flow error:",
|
|
847
|
+
} catch (x) {
|
|
848
|
+
console.error("Secondary flow error:", x);
|
|
846
849
|
}
|
|
847
|
-
},
|
|
848
|
-
const
|
|
849
|
-
if (
|
|
850
|
-
|
|
851
|
-
...
|
|
850
|
+
}, D = async (c) => {
|
|
851
|
+
const v = c || St.trim();
|
|
852
|
+
if (v) {
|
|
853
|
+
kt(!0), Ct(""), n.current = null, s.current = null, l.current = null, d.current = null, P((w) => [
|
|
854
|
+
...w,
|
|
852
855
|
{
|
|
853
|
-
query:
|
|
856
|
+
query: v,
|
|
854
857
|
response: "Thinking for what suits you best...",
|
|
855
858
|
potentialQuestions: "",
|
|
856
859
|
products: [],
|
|
@@ -858,52 +861,52 @@ const xt = (t) => {
|
|
|
858
861
|
}
|
|
859
862
|
]);
|
|
860
863
|
try {
|
|
861
|
-
const
|
|
862
|
-
if (!
|
|
864
|
+
const w = ut, x = localStorage.getItem("customerNumber"), p = localStorage.getItem("isLoggedIn"), g = await Dt();
|
|
865
|
+
if (!g)
|
|
863
866
|
throw new Error("Failed to obtain access token");
|
|
864
|
-
const
|
|
865
|
-
registered: String(
|
|
866
|
-
userId: String(
|
|
867
|
-
}).toString()}`,
|
|
867
|
+
const mt = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
868
|
+
registered: String(p || !1),
|
|
869
|
+
userId: String(x || (/* @__PURE__ */ new Date()).getTime())
|
|
870
|
+
}).toString()}`, ht = JSON.stringify({
|
|
868
871
|
flowId: "MMHQKYI1NE",
|
|
869
872
|
flowAliasId: "SZF9ZK1ATE",
|
|
870
873
|
input: {
|
|
871
|
-
userPrompt:
|
|
872
|
-
whom:
|
|
874
|
+
userPrompt: v,
|
|
875
|
+
whom: w
|
|
873
876
|
}
|
|
874
|
-
}),
|
|
877
|
+
}), L = await fetch(mt, {
|
|
875
878
|
signal: AbortSignal.timeout(3e4),
|
|
876
879
|
method: "POST",
|
|
877
880
|
headers: {
|
|
878
881
|
"Content-Type": "application/json",
|
|
879
|
-
Authorization: `Bearer ${
|
|
882
|
+
Authorization: `Bearer ${g}`
|
|
880
883
|
},
|
|
881
|
-
body:
|
|
884
|
+
body: ht
|
|
882
885
|
});
|
|
883
|
-
if (!
|
|
884
|
-
throw new Error(`HTTP error! status: ${
|
|
885
|
-
if (!
|
|
886
|
-
const
|
|
887
|
-
let
|
|
886
|
+
if (!L.ok)
|
|
887
|
+
throw new Error(`HTTP error! status: ${L.status}`);
|
|
888
|
+
if (!L.body) throw new Error("Readable stream not supported");
|
|
889
|
+
const wt = L.body.getReader(), gt = new TextDecoder();
|
|
890
|
+
let B = "", U = "";
|
|
888
891
|
for (; ; ) {
|
|
889
|
-
|
|
890
|
-
const { done:
|
|
891
|
-
if (
|
|
892
|
-
|
|
893
|
-
const
|
|
892
|
+
rt(!0);
|
|
893
|
+
const { done: R, value: Y } = await wt.read();
|
|
894
|
+
if (R) break;
|
|
895
|
+
B += gt.decode(Y, { stream: !0 });
|
|
896
|
+
const W = B.split(`
|
|
894
897
|
`);
|
|
895
|
-
|
|
896
|
-
for (const
|
|
897
|
-
if (
|
|
898
|
-
const
|
|
898
|
+
B = W.pop() || "";
|
|
899
|
+
for (const f of W)
|
|
900
|
+
if (f.startsWith("data:")) {
|
|
901
|
+
const q = f.slice(5).trim();
|
|
899
902
|
try {
|
|
900
|
-
const I = JSON.parse(
|
|
901
|
-
I.index == 1 && (
|
|
902
|
-
(
|
|
903
|
-
(
|
|
904
|
-
...
|
|
903
|
+
const I = JSON.parse(q);
|
|
904
|
+
I.index == 1 && (U = I.data), P(
|
|
905
|
+
(O) => O.map(
|
|
906
|
+
(G, Lt) => Lt === O.length - 1 ? {
|
|
907
|
+
...G,
|
|
905
908
|
[I.index == 0 ? "response" : I.index == 1 ? "keywords" : I.index == 2 ? "potentialQuestions" : "end"]: I.data
|
|
906
|
-
} :
|
|
909
|
+
} : G
|
|
907
910
|
)
|
|
908
911
|
);
|
|
909
912
|
} catch (I) {
|
|
@@ -911,183 +914,183 @@ const xt = (t) => {
|
|
|
911
914
|
}
|
|
912
915
|
}
|
|
913
916
|
}
|
|
914
|
-
er(
|
|
915
|
-
} catch (
|
|
916
|
-
console.error("Error sending message to Tanya:",
|
|
917
|
+
rr(er(U));
|
|
918
|
+
} catch (w) {
|
|
919
|
+
console.error("Error sending message to Tanya:", w);
|
|
917
920
|
} finally {
|
|
918
|
-
|
|
921
|
+
kt(!1);
|
|
919
922
|
}
|
|
920
923
|
}
|
|
921
|
-
},
|
|
922
|
-
const
|
|
924
|
+
}, er = (c) => {
|
|
925
|
+
const v = c.match(
|
|
923
926
|
/top five relevant product or category names are: (.*)/i
|
|
924
|
-
),
|
|
925
|
-
return [...new Set(
|
|
926
|
-
},
|
|
927
|
+
), p = (v ? v[1] : c).split(", ").map((j) => j.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
928
|
+
return [...new Set(p)].filter(Boolean).join(",");
|
|
929
|
+
}, rr = async (c) => {
|
|
927
930
|
if (typeof c == "string") {
|
|
928
931
|
console.log(c, "keywords");
|
|
929
|
-
const
|
|
930
|
-
for (const
|
|
931
|
-
const
|
|
932
|
-
if (
|
|
933
|
-
(
|
|
934
|
-
(
|
|
935
|
-
...
|
|
932
|
+
const v = c.split(",");
|
|
933
|
+
for (const w of v) {
|
|
934
|
+
const x = await be(w);
|
|
935
|
+
if (rt(!1), (x == null ? void 0 : x.length) > 0 && (P(
|
|
936
|
+
(p) => p.map(
|
|
937
|
+
(g, j) => j === p.length - 1 ? {
|
|
938
|
+
...g,
|
|
936
939
|
products: [
|
|
937
|
-
...
|
|
938
|
-
{ keyword:
|
|
940
|
+
...g.products || [],
|
|
941
|
+
{ keyword: w, items: x, loading: !1 }
|
|
939
942
|
]
|
|
940
|
-
} :
|
|
943
|
+
} : g
|
|
941
944
|
)
|
|
942
|
-
), !
|
|
943
|
-
const
|
|
944
|
-
|
|
945
|
-
const
|
|
946
|
-
|
|
945
|
+
), !n.current || s.current == null)) {
|
|
946
|
+
const p = x[0];
|
|
947
|
+
n.current = String((p == null ? void 0 : p.product_name) ?? ""), l.current = p.image.link, s.current = p.product_id;
|
|
948
|
+
const g = typeof (p == null ? void 0 : p.price) == "number" ? p.price : void 0;
|
|
949
|
+
d.current = typeof g == "number" && Number.isFinite(g) ? g : null;
|
|
947
950
|
}
|
|
948
951
|
}
|
|
949
952
|
} else
|
|
950
|
-
for (const
|
|
951
|
-
const
|
|
952
|
-
|
|
953
|
-
(
|
|
954
|
-
(
|
|
955
|
-
...
|
|
953
|
+
for (const v of c) {
|
|
954
|
+
const w = await be(v);
|
|
955
|
+
rt(!1), (w == null ? void 0 : w.length) > 0 && P(
|
|
956
|
+
(x) => x.map(
|
|
957
|
+
(p, g) => g === x.length - 1 ? {
|
|
958
|
+
...p,
|
|
956
959
|
products: [
|
|
957
|
-
...
|
|
958
|
-
{ keyword:
|
|
960
|
+
...p.products || [],
|
|
961
|
+
{ keyword: v, items: w, loading: !1 }
|
|
959
962
|
]
|
|
960
|
-
} :
|
|
963
|
+
} : p
|
|
961
964
|
)
|
|
962
965
|
);
|
|
963
966
|
}
|
|
964
|
-
if (
|
|
965
|
-
|
|
966
|
-
(
|
|
967
|
-
(
|
|
968
|
-
...
|
|
967
|
+
if (n.current) {
|
|
968
|
+
P(
|
|
969
|
+
(w) => w.map(
|
|
970
|
+
(x, p) => p === w.length - 1 ? {
|
|
971
|
+
...x,
|
|
969
972
|
productSnapshot: {
|
|
970
|
-
id:
|
|
971
|
-
name:
|
|
973
|
+
id: s.current,
|
|
974
|
+
name: n.current,
|
|
972
975
|
image: l.current,
|
|
973
|
-
price:
|
|
976
|
+
price: d.current ?? null,
|
|
974
977
|
points: 0,
|
|
975
978
|
quantity: 1
|
|
976
979
|
}
|
|
977
|
-
} :
|
|
980
|
+
} : x
|
|
978
981
|
)
|
|
979
982
|
);
|
|
980
|
-
const
|
|
983
|
+
const v = JSON.parse(
|
|
981
984
|
sessionStorage.getItem("customerData") || "{}"
|
|
982
985
|
);
|
|
983
|
-
(
|
|
986
|
+
(v == null ? void 0 : v.isGuest) == !1 ? (console.log("running secondary flow", It), ft(n.current, 0)) : console.log("not running secondary flow", It);
|
|
984
987
|
}
|
|
985
|
-
|
|
986
|
-
},
|
|
987
|
-
var
|
|
988
|
-
|
|
988
|
+
rt(!1);
|
|
989
|
+
}, or = async (c, v) => {
|
|
990
|
+
var w, x, p, g, j, mt, ht, L, wt, gt, B, U, R, Y, W;
|
|
991
|
+
V(!0);
|
|
989
992
|
try {
|
|
990
|
-
const
|
|
991
|
-
if (!((
|
|
992
|
-
|
|
993
|
+
const f = await He(c.id);
|
|
994
|
+
if (!((x = (w = f == null ? void 0 : f.variants) == null ? void 0 : w[0]) != null && x.product_id || (g = (p = f == null ? void 0 : f.variants) == null ? void 0 : p[0]) != null && g.productId) && !(f.type.item || f.type.bundle)) {
|
|
995
|
+
V(!1), M.error("Variants not found", {
|
|
993
996
|
position: "bottom-right",
|
|
994
997
|
autoClose: 1e3
|
|
995
998
|
}), console.error("No product variant found");
|
|
996
999
|
return;
|
|
997
1000
|
}
|
|
998
|
-
const
|
|
1001
|
+
const q = [
|
|
999
1002
|
{
|
|
1000
|
-
product_id: ((
|
|
1001
|
-
quantity:
|
|
1003
|
+
product_id: ((j = f.variants) == null ? void 0 : j[0].product_id) || ((mt = f.variants) == null ? void 0 : mt[0].productId) || (f == null ? void 0 : f.id),
|
|
1004
|
+
quantity: v
|
|
1002
1005
|
}
|
|
1003
1006
|
];
|
|
1004
|
-
console.log(
|
|
1007
|
+
console.log(q, "product data", "app version", It);
|
|
1005
1008
|
const I = JSON.parse(
|
|
1006
1009
|
sessionStorage.getItem("customerData") || "{}"
|
|
1007
|
-
),
|
|
1008
|
-
if (!
|
|
1009
|
-
const
|
|
1010
|
-
let { customer_token:
|
|
1011
|
-
|
|
1010
|
+
), O = (I == null ? void 0 : I.basketId) || localStorage.getItem(Yt), G = !1, Lt = localStorage.getItem(Tt), he = Date.now();
|
|
1011
|
+
if (!G || !Lt || he >= parseInt(Lt)) {
|
|
1012
|
+
const nr = await qe();
|
|
1013
|
+
let { customer_token: nt } = await Me(
|
|
1014
|
+
nr
|
|
1012
1015
|
);
|
|
1013
|
-
if (
|
|
1016
|
+
if (nt = "Bearer " + i.access_token, !nt) {
|
|
1014
1017
|
console.error("Failed to get customer_token");
|
|
1015
1018
|
return;
|
|
1016
1019
|
}
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1020
|
+
const ar = he + 300 * 1e3;
|
|
1021
|
+
if (Kt(nt), localStorage.setItem(Tt, ar.toString()), console.log(O, "basketIdFromCustomer"), O) {
|
|
1019
1022
|
const we = await Re({
|
|
1020
|
-
basketId:
|
|
1021
|
-
customer_token:
|
|
1023
|
+
basketId: O,
|
|
1024
|
+
customer_token: nt
|
|
1022
1025
|
});
|
|
1023
1026
|
if (we.status === 200 && we) {
|
|
1024
|
-
const Gt = await
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1027
|
+
const Gt = await Rt(
|
|
1028
|
+
O,
|
|
1029
|
+
q,
|
|
1030
|
+
nt
|
|
1028
1031
|
);
|
|
1029
|
-
((
|
|
1032
|
+
((ht = Gt == null ? void 0 : Gt.product_items) == null ? void 0 : ht.length) > 0 && (M.success("Added to cart", {
|
|
1030
1033
|
position: "bottom-right",
|
|
1031
1034
|
autoClose: 3e3,
|
|
1032
1035
|
hideProgressBar: !1,
|
|
1033
1036
|
closeOnClick: !0,
|
|
1034
1037
|
pauseOnHover: !0,
|
|
1035
1038
|
draggable: !0
|
|
1036
|
-
}),
|
|
1039
|
+
}), Vt(O), V(!1));
|
|
1037
1040
|
return;
|
|
1038
1041
|
}
|
|
1039
1042
|
}
|
|
1040
|
-
const
|
|
1043
|
+
const ir = {
|
|
1041
1044
|
productItems: [
|
|
1042
1045
|
{
|
|
1043
|
-
productId: ((
|
|
1046
|
+
productId: ((L = f.variants) == null ? void 0 : L[0].product_id) || ((wt = f.variants) == null ? void 0 : wt[0].productId) || (f == null ? void 0 : f.id),
|
|
1044
1047
|
quantity: 1
|
|
1045
1048
|
}
|
|
1046
1049
|
]
|
|
1047
|
-
},
|
|
1050
|
+
}, y = await Ve(nt, ir);
|
|
1048
1051
|
if (console.log(
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
+
y,
|
|
1053
|
+
y == null ? void 0 : y.basket_id,
|
|
1054
|
+
y == null ? void 0 : y.basketId,
|
|
1052
1055
|
"the basket response"
|
|
1053
|
-
), !(
|
|
1054
|
-
|
|
1056
|
+
), !(y != null && y.basket_id || !(y != null && y.basketId))) {
|
|
1057
|
+
V(!1), console.error("Failed to create basket");
|
|
1055
1058
|
return;
|
|
1056
1059
|
}
|
|
1057
|
-
|
|
1058
|
-
(
|
|
1060
|
+
st(
|
|
1061
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId)
|
|
1059
1062
|
);
|
|
1060
|
-
const
|
|
1061
|
-
(
|
|
1062
|
-
|
|
1063
|
-
|
|
1063
|
+
const bt = await Rt(
|
|
1064
|
+
(y == null ? void 0 : y.basket_id) || (y == null ? void 0 : y.basketId),
|
|
1065
|
+
q,
|
|
1066
|
+
nt
|
|
1064
1067
|
);
|
|
1065
|
-
(((
|
|
1068
|
+
(((gt = bt == null ? void 0 : bt.product_items) == null ? void 0 : gt.length) > 0 || ((B = bt == null ? void 0 : bt.productItems) == null ? void 0 : B.length) > 0) && M.success("Added to cart", {
|
|
1066
1069
|
position: "bottom-right",
|
|
1067
1070
|
autoClose: 3e3,
|
|
1068
1071
|
hideProgressBar: !1,
|
|
1069
1072
|
closeOnClick: !0,
|
|
1070
1073
|
pauseOnHover: !0,
|
|
1071
1074
|
draggable: !0
|
|
1072
|
-
}),
|
|
1075
|
+
}), Vt(y.basket_id || (y == null ? void 0 : y.basketId));
|
|
1073
1076
|
}
|
|
1074
|
-
} catch (
|
|
1075
|
-
|
|
1077
|
+
} catch (f) {
|
|
1078
|
+
V(!1), console.error("Error adding to cart:", f), M.error("Failed to add product to cart", {
|
|
1076
1079
|
position: "bottom-right",
|
|
1077
1080
|
autoClose: 3e3
|
|
1078
|
-
}), ((
|
|
1079
|
-
((
|
|
1081
|
+
}), ((U = f == null ? void 0 : f.response) == null ? void 0 : U.status) === 404 || // Basket not found
|
|
1082
|
+
((R = f == null ? void 0 : f.response) == null ? void 0 : R.status) === 401 ? (((Y = f == null ? void 0 : f.response) == null ? void 0 : Y.status) === 404 && st(null), ((W = f == null ? void 0 : f.response) == null ? void 0 : W.status) === 401 && (st(null), Kt(null))) : (console.error("Failed to add product to basket:", f.message), M.error("Failed to add product to cart", {
|
|
1080
1083
|
position: "bottom-right",
|
|
1081
1084
|
autoClose: 3e3
|
|
1082
1085
|
}));
|
|
1083
1086
|
}
|
|
1084
|
-
|
|
1087
|
+
V(!1);
|
|
1085
1088
|
};
|
|
1086
|
-
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(
|
|
1089
|
+
return /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ u(yr, { open: h, onOpenChange: S, children: [
|
|
1087
1090
|
/* @__PURE__ */ a(
|
|
1088
|
-
|
|
1091
|
+
vr,
|
|
1089
1092
|
{
|
|
1090
|
-
onClick: () =>
|
|
1093
|
+
onClick: () => S(!0),
|
|
1091
1094
|
style: {
|
|
1092
1095
|
// background: storeDetails.tanyaThemeColor,
|
|
1093
1096
|
},
|
|
@@ -1147,12 +1150,12 @@ const xt = (t) => {
|
|
|
1147
1150
|
) })
|
|
1148
1151
|
}
|
|
1149
1152
|
),
|
|
1150
|
-
|
|
1153
|
+
A && /* @__PURE__ */ u(re, { children: [
|
|
1151
1154
|
/* @__PURE__ */ a(
|
|
1152
1155
|
"div",
|
|
1153
1156
|
{
|
|
1154
1157
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1155
|
-
onClick: () =>
|
|
1158
|
+
onClick: () => S(!1)
|
|
1156
1159
|
}
|
|
1157
1160
|
),
|
|
1158
1161
|
/* @__PURE__ */ u(
|
|
@@ -1163,9 +1166,9 @@ const xt = (t) => {
|
|
|
1163
1166
|
top-0 right-0
|
|
1164
1167
|
transition-transform duration-300 ease-in-out
|
|
1165
1168
|
lg:transform
|
|
1166
|
-
${
|
|
1169
|
+
${_ ? "lg:translate-x-0" : "lg:translate-x-full"}
|
|
1167
1170
|
// For mobile: animate from bottom
|
|
1168
|
-
${
|
|
1171
|
+
${_ ? "translate-y-0" : "translate-y-full"}
|
|
1169
1172
|
lg:translate-y-0
|
|
1170
1173
|
`,
|
|
1171
1174
|
style: {
|
|
@@ -1182,7 +1185,7 @@ const xt = (t) => {
|
|
|
1182
1185
|
{
|
|
1183
1186
|
style: {
|
|
1184
1187
|
display: "flex",
|
|
1185
|
-
color:
|
|
1188
|
+
color: k.tanyaThemeContrastColor,
|
|
1186
1189
|
alignItems: "center",
|
|
1187
1190
|
gap: "0.5rem"
|
|
1188
1191
|
},
|
|
@@ -1243,7 +1246,7 @@ const xt = (t) => {
|
|
|
1243
1246
|
gap: "1.25rem",
|
|
1244
1247
|
margin: "0.75rem"
|
|
1245
1248
|
},
|
|
1246
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1249
|
+
children: /* @__PURE__ */ a("button", { onClick: () => S(!1), children: /* @__PURE__ */ u(
|
|
1247
1250
|
"svg",
|
|
1248
1251
|
{
|
|
1249
1252
|
width: "24",
|
|
@@ -1295,28 +1298,28 @@ const xt = (t) => {
|
|
|
1295
1298
|
/* @__PURE__ */ u(
|
|
1296
1299
|
"div",
|
|
1297
1300
|
{
|
|
1298
|
-
className: `flex flex-col h-full ${
|
|
1301
|
+
className: `flex flex-col h-full ${ot ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1299
1302
|
children: [
|
|
1300
1303
|
/* @__PURE__ */ u(
|
|
1301
1304
|
"div",
|
|
1302
1305
|
{
|
|
1303
|
-
ref:
|
|
1306
|
+
ref: C,
|
|
1304
1307
|
className: "overflow-y-auto pr-5 pb-2 space-y-4 hide-scrollbar flex-grow mb-24",
|
|
1305
1308
|
children: [
|
|
1306
|
-
(
|
|
1309
|
+
(k == null ? void 0 : k.whomRequired) && /* @__PURE__ */ u(
|
|
1307
1310
|
"div",
|
|
1308
1311
|
{
|
|
1309
1312
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1310
1313
|
children: [
|
|
1311
1314
|
/* @__PURE__ */ a("div", { className: "flex gap-2 bg-[#FFFFFF]", children: /* @__PURE__ */ a("p", { className: "font-bold font-nunitoSans text-[#494949]", children: "Is this for you or someone else?" }) }),
|
|
1312
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children:
|
|
1315
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: r.map((c) => /* @__PURE__ */ a(
|
|
1313
1316
|
"button",
|
|
1314
1317
|
{
|
|
1315
|
-
onClick: () =>
|
|
1318
|
+
onClick: () => At(c),
|
|
1316
1319
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1317
1320
|
style: {
|
|
1318
|
-
backgroundColor:
|
|
1319
|
-
borderColor:
|
|
1321
|
+
backgroundColor: ut === o[c] ? "#FFFFFF" : "#F3F3F3",
|
|
1322
|
+
borderColor: ut === o[c] ? "#BBB3DD" : ""
|
|
1320
1323
|
},
|
|
1321
1324
|
children: c
|
|
1322
1325
|
},
|
|
@@ -1325,8 +1328,8 @@ const xt = (t) => {
|
|
|
1325
1328
|
]
|
|
1326
1329
|
}
|
|
1327
1330
|
),
|
|
1328
|
-
|
|
1329
|
-
var
|
|
1331
|
+
_t.map((c, v) => {
|
|
1332
|
+
var w, x;
|
|
1330
1333
|
return /* @__PURE__ */ u("div", { children: [
|
|
1331
1334
|
/* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a("p", { className: "text-sm font-nunitoSans font-bold text-[#000000] bg-[#E2DBFF] border border-[#C9C2DE] rounded-l-xl p-2 m-3 mb-4 rounded-br-xl max-w-[75%]", children: c.query }) }),
|
|
1332
1335
|
c.response && c.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1346,12 +1349,12 @@ const xt = (t) => {
|
|
|
1346
1349
|
}
|
|
1347
1350
|
}
|
|
1348
1351
|
) }),
|
|
1349
|
-
Pt && !c.response.includes("Thinking") && ((
|
|
1350
|
-
(c == null ? void 0 : c.products) && ((
|
|
1352
|
+
Pt && !c.response.includes("Thinking") && ((w = c.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" }) }),
|
|
1353
|
+
(c == null ? void 0 : c.products) && ((x = c == null ? void 0 : c.products) == null ? void 0 : x.length) > 0 && /* @__PURE__ */ a(
|
|
1351
1354
|
Ir,
|
|
1352
1355
|
{
|
|
1353
1356
|
chat: c.products,
|
|
1354
|
-
storeDetails:
|
|
1357
|
+
storeDetails: k
|
|
1355
1358
|
}
|
|
1356
1359
|
),
|
|
1357
1360
|
c.potentialQuestions.length > 0 && /* @__PURE__ */ u("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
@@ -1359,21 +1362,21 @@ const xt = (t) => {
|
|
|
1359
1362
|
"p",
|
|
1360
1363
|
{
|
|
1361
1364
|
className: "font-nunitoSans font-bold text-sm text-[#494949]",
|
|
1362
|
-
style: { color:
|
|
1365
|
+
style: { color: k.themeDarkColor },
|
|
1363
1366
|
children: "Why not explore these inquiries..."
|
|
1364
1367
|
}
|
|
1365
1368
|
),
|
|
1366
|
-
c.potentialQuestions.split(",").map((
|
|
1369
|
+
c.potentialQuestions.split(",").map((p, g) => /* @__PURE__ */ a(
|
|
1367
1370
|
"button",
|
|
1368
1371
|
{
|
|
1369
|
-
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${
|
|
1370
|
-
onClick: () =>
|
|
1372
|
+
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${k.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1373
|
+
onClick: () => D(p),
|
|
1371
1374
|
style: {
|
|
1372
|
-
backgroundColor:
|
|
1375
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1373
1376
|
},
|
|
1374
|
-
children:
|
|
1377
|
+
children: p
|
|
1375
1378
|
},
|
|
1376
|
-
|
|
1379
|
+
g
|
|
1377
1380
|
))
|
|
1378
1381
|
] }),
|
|
1379
1382
|
c.secondaryLoading && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ u(
|
|
@@ -1394,7 +1397,7 @@ const xt = (t) => {
|
|
|
1394
1397
|
"p",
|
|
1395
1398
|
{
|
|
1396
1399
|
className: "font-semibold tanya-pulse",
|
|
1397
|
-
style: { color:
|
|
1400
|
+
style: { color: k.themeDarkColor },
|
|
1398
1401
|
children: "I’ve found a special surprise crafted just for you… hang on a sec!"
|
|
1399
1402
|
}
|
|
1400
1403
|
),
|
|
@@ -1402,7 +1405,7 @@ const xt = (t) => {
|
|
|
1402
1405
|
"p",
|
|
1403
1406
|
{
|
|
1404
1407
|
className: "tanya-dots mt-1",
|
|
1405
|
-
style: { color:
|
|
1408
|
+
style: { color: k.themeDarkColor },
|
|
1406
1409
|
children: "• • •"
|
|
1407
1410
|
}
|
|
1408
1411
|
)
|
|
@@ -1415,7 +1418,7 @@ const xt = (t) => {
|
|
|
1415
1418
|
{
|
|
1416
1419
|
className: "text-sm text-[#232323] bg-[#FFFFFF] px-7 py-4 rounded-br-xl rounded-bl-2xl w-full",
|
|
1417
1420
|
style: {
|
|
1418
|
-
backgroundColor:
|
|
1421
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1419
1422
|
},
|
|
1420
1423
|
dangerouslySetInnerHTML: {
|
|
1421
1424
|
__html: Xt(
|
|
@@ -1430,7 +1433,7 @@ const xt = (t) => {
|
|
|
1430
1433
|
{
|
|
1431
1434
|
className: "flex gap-4 items-stretch rounded-2xl p-4",
|
|
1432
1435
|
style: {
|
|
1433
|
-
backgroundColor:
|
|
1436
|
+
backgroundColor: k.tanyaThemeColorLight
|
|
1434
1437
|
},
|
|
1435
1438
|
children: [
|
|
1436
1439
|
/* @__PURE__ */ a(
|
|
@@ -1457,7 +1460,7 @@ const xt = (t) => {
|
|
|
1457
1460
|
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: c.productSnapshot.name }),
|
|
1458
1461
|
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: c.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1459
1462
|
style: "currency",
|
|
1460
|
-
currency: (
|
|
1463
|
+
currency: (k == null ? void 0 : k.currency) || "USD"
|
|
1461
1464
|
}).format(
|
|
1462
1465
|
c.productSnapshot.price
|
|
1463
1466
|
) : "" }),
|
|
@@ -1477,23 +1480,23 @@ const xt = (t) => {
|
|
|
1477
1480
|
"button",
|
|
1478
1481
|
{
|
|
1479
1482
|
className: "px-3 py-1 text-sm",
|
|
1480
|
-
onClick: () =>
|
|
1481
|
-
(
|
|
1482
|
-
(
|
|
1483
|
-
...
|
|
1483
|
+
onClick: () => P(
|
|
1484
|
+
(p) => p.map(
|
|
1485
|
+
(g, j) => j === v && g.productSnapshot ? {
|
|
1486
|
+
...g,
|
|
1484
1487
|
productSnapshot: {
|
|
1485
|
-
...
|
|
1488
|
+
...g.productSnapshot,
|
|
1486
1489
|
quantity: Math.max(
|
|
1487
1490
|
1,
|
|
1488
|
-
|
|
1491
|
+
g.productSnapshot.quantity - 1
|
|
1489
1492
|
)
|
|
1490
1493
|
}
|
|
1491
|
-
} :
|
|
1494
|
+
} : g
|
|
1492
1495
|
)
|
|
1493
1496
|
),
|
|
1494
1497
|
style: {
|
|
1495
1498
|
background: "transparent",
|
|
1496
|
-
color:
|
|
1499
|
+
color: k.themeDarkColor
|
|
1497
1500
|
},
|
|
1498
1501
|
children: "−"
|
|
1499
1502
|
}
|
|
@@ -1503,20 +1506,20 @@ const xt = (t) => {
|
|
|
1503
1506
|
"button",
|
|
1504
1507
|
{
|
|
1505
1508
|
className: "px-3 py-1 text-sm",
|
|
1506
|
-
onClick: () =>
|
|
1507
|
-
(
|
|
1508
|
-
(
|
|
1509
|
-
...
|
|
1509
|
+
onClick: () => P(
|
|
1510
|
+
(p) => p.map(
|
|
1511
|
+
(g, j) => j === v && g.productSnapshot ? {
|
|
1512
|
+
...g,
|
|
1510
1513
|
productSnapshot: {
|
|
1511
|
-
...
|
|
1512
|
-
quantity:
|
|
1514
|
+
...g.productSnapshot,
|
|
1515
|
+
quantity: g.productSnapshot.quantity + 1
|
|
1513
1516
|
}
|
|
1514
|
-
} :
|
|
1517
|
+
} : g
|
|
1515
1518
|
)
|
|
1516
1519
|
),
|
|
1517
1520
|
style: {
|
|
1518
1521
|
background: "transparent",
|
|
1519
|
-
color:
|
|
1522
|
+
color: k.themeDarkColor
|
|
1520
1523
|
},
|
|
1521
1524
|
children: "+"
|
|
1522
1525
|
}
|
|
@@ -1526,21 +1529,21 @@ const xt = (t) => {
|
|
|
1526
1529
|
"button",
|
|
1527
1530
|
{
|
|
1528
1531
|
onClick: () => {
|
|
1529
|
-
|
|
1532
|
+
or(
|
|
1530
1533
|
zt(
|
|
1531
1534
|
c.productSnapshot
|
|
1532
1535
|
),
|
|
1533
1536
|
c.productSnapshot.quantity
|
|
1534
1537
|
);
|
|
1535
1538
|
},
|
|
1536
|
-
disabled:
|
|
1539
|
+
disabled: ct,
|
|
1537
1540
|
className: "px-4 py-2 rounded-full font-medium",
|
|
1538
1541
|
style: {
|
|
1539
|
-
background:
|
|
1540
|
-
color: (
|
|
1541
|
-
opacity:
|
|
1542
|
+
background: k.tanyaThemeColor,
|
|
1543
|
+
color: (k == null ? void 0 : k.tanyaThemeContrastColor) || "#fff",
|
|
1544
|
+
opacity: ct ? 0.8 : 1
|
|
1542
1545
|
},
|
|
1543
|
-
children:
|
|
1546
|
+
children: ct ? "Adding..." : "Add to cart"
|
|
1544
1547
|
}
|
|
1545
1548
|
)
|
|
1546
1549
|
] })
|
|
@@ -1550,7 +1553,7 @@ const xt = (t) => {
|
|
|
1550
1553
|
) })
|
|
1551
1554
|
] }) }),
|
|
1552
1555
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1553
|
-
] },
|
|
1556
|
+
] }, v);
|
|
1554
1557
|
})
|
|
1555
1558
|
]
|
|
1556
1559
|
}
|
|
@@ -1568,11 +1571,11 @@ const xt = (t) => {
|
|
|
1568
1571
|
{
|
|
1569
1572
|
className: "flex-1 bg-[#FFFFFF] text-[#232323] outline-none border-none px-2 py-2 text-sm",
|
|
1570
1573
|
placeholder: "How can I help you...",
|
|
1571
|
-
value:
|
|
1574
|
+
value: St,
|
|
1572
1575
|
autoFocus: !0,
|
|
1573
|
-
onChange: (c) =>
|
|
1576
|
+
onChange: (c) => Ct(c.target.value),
|
|
1574
1577
|
onKeyDown: (c) => {
|
|
1575
|
-
c.key === "Enter" && !
|
|
1578
|
+
c.key === "Enter" && !dt && D();
|
|
1576
1579
|
}
|
|
1577
1580
|
}
|
|
1578
1581
|
),
|
|
@@ -1580,16 +1583,16 @@ const xt = (t) => {
|
|
|
1580
1583
|
"button",
|
|
1581
1584
|
{
|
|
1582
1585
|
type: "submit",
|
|
1583
|
-
disabled:
|
|
1586
|
+
disabled: dt,
|
|
1584
1587
|
className: "p-3",
|
|
1585
|
-
onClick: () =>
|
|
1586
|
-
children:
|
|
1588
|
+
onClick: () => D(),
|
|
1589
|
+
children: dt ? /* @__PURE__ */ a(
|
|
1587
1590
|
"div",
|
|
1588
1591
|
{
|
|
1589
1592
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
1590
1593
|
style: {
|
|
1591
1594
|
borderBottom: "2px solid",
|
|
1592
|
-
color:
|
|
1595
|
+
color: k.tanyaThemeColor
|
|
1593
1596
|
}
|
|
1594
1597
|
}
|
|
1595
1598
|
) : /* @__PURE__ */ a(
|
|
@@ -1617,7 +1620,7 @@ const xt = (t) => {
|
|
|
1617
1620
|
]
|
|
1618
1621
|
}
|
|
1619
1622
|
),
|
|
1620
|
-
/* @__PURE__ */ a(
|
|
1623
|
+
/* @__PURE__ */ a(Er, {})
|
|
1621
1624
|
] })
|
|
1622
1625
|
]
|
|
1623
1626
|
}
|
|
@@ -1632,7 +1635,7 @@ var ne = function(t, e) {
|
|
|
1632
1635
|
for (var n in o) Object.prototype.hasOwnProperty.call(o, n) && (r[n] = o[n]);
|
|
1633
1636
|
}, ne(t, e);
|
|
1634
1637
|
};
|
|
1635
|
-
function
|
|
1638
|
+
function Or(t, e) {
|
|
1636
1639
|
if (typeof e != "function" && e !== null)
|
|
1637
1640
|
throw new TypeError("Class extends value " + String(e) + " is not a constructor or null");
|
|
1638
1641
|
ne(t, e);
|
|
@@ -1641,16 +1644,16 @@ function Tr(t, e) {
|
|
|
1641
1644
|
}
|
|
1642
1645
|
t.prototype = e === null ? Object.create(e) : (r.prototype = e.prototype, new r());
|
|
1643
1646
|
}
|
|
1644
|
-
var
|
|
1645
|
-
return
|
|
1647
|
+
var X = function() {
|
|
1648
|
+
return X = Object.assign || function(e) {
|
|
1646
1649
|
for (var r, o = 1, n = arguments.length; o < n; o++) {
|
|
1647
1650
|
r = arguments[o];
|
|
1648
|
-
for (var
|
|
1651
|
+
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (e[s] = r[s]);
|
|
1649
1652
|
}
|
|
1650
1653
|
return e;
|
|
1651
|
-
},
|
|
1654
|
+
}, X.apply(this, arguments);
|
|
1652
1655
|
};
|
|
1653
|
-
function
|
|
1656
|
+
function Pr(t, e) {
|
|
1654
1657
|
var r = {};
|
|
1655
1658
|
for (var o in t) Object.prototype.hasOwnProperty.call(t, o) && e.indexOf(o) < 0 && (r[o] = t[o]);
|
|
1656
1659
|
if (t != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1658,50 +1661,50 @@ function Or(t, e) {
|
|
|
1658
1661
|
e.indexOf(o[n]) < 0 && Object.prototype.propertyIsEnumerable.call(t, o[n]) && (r[o[n]] = t[o[n]]);
|
|
1659
1662
|
return r;
|
|
1660
1663
|
}
|
|
1661
|
-
var Qt = "Invariant Violation", _e = Object.setPrototypeOf,
|
|
1664
|
+
var Qt = "Invariant Violation", _e = Object.setPrototypeOf, $r = _e === void 0 ? function(t, e) {
|
|
1662
1665
|
return t.__proto__ = e, t;
|
|
1663
1666
|
} : _e, Ye = (
|
|
1664
1667
|
/** @class */
|
|
1665
1668
|
(function(t) {
|
|
1666
|
-
|
|
1669
|
+
Or(e, t);
|
|
1667
1670
|
function e(r) {
|
|
1668
1671
|
r === void 0 && (r = Qt);
|
|
1669
1672
|
var o = t.call(this, typeof r == "number" ? Qt + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1670
|
-
return o.framesToPop = 1, o.name = Qt,
|
|
1673
|
+
return o.framesToPop = 1, o.name = Qt, $r(o, e.prototype), o;
|
|
1671
1674
|
}
|
|
1672
1675
|
return e;
|
|
1673
1676
|
})(Error)
|
|
1674
1677
|
);
|
|
1675
|
-
function
|
|
1678
|
+
function at(t, e) {
|
|
1676
1679
|
if (!t)
|
|
1677
1680
|
throw new Ye(e);
|
|
1678
1681
|
}
|
|
1679
|
-
var Ke = ["debug", "log", "warn", "error", "silent"],
|
|
1680
|
-
function
|
|
1682
|
+
var Ke = ["debug", "log", "warn", "error", "silent"], zr = Ke.indexOf("log");
|
|
1683
|
+
function Bt(t) {
|
|
1681
1684
|
return function() {
|
|
1682
|
-
if (Ke.indexOf(t) >=
|
|
1685
|
+
if (Ke.indexOf(t) >= zr) {
|
|
1683
1686
|
var e = console[t] || console.log;
|
|
1684
1687
|
return e.apply(console, arguments);
|
|
1685
1688
|
}
|
|
1686
1689
|
};
|
|
1687
1690
|
}
|
|
1688
1691
|
(function(t) {
|
|
1689
|
-
t.debug =
|
|
1690
|
-
})(
|
|
1692
|
+
t.debug = Bt("debug"), t.log = Bt("log"), t.warn = Bt("warn"), t.error = Bt("error");
|
|
1693
|
+
})(at || (at = {}));
|
|
1691
1694
|
var Je = "3.14.0";
|
|
1692
|
-
function
|
|
1695
|
+
function xt(t) {
|
|
1693
1696
|
try {
|
|
1694
1697
|
return t();
|
|
1695
1698
|
} catch {
|
|
1696
1699
|
}
|
|
1697
1700
|
}
|
|
1698
|
-
const ae =
|
|
1701
|
+
const ae = xt(function() {
|
|
1699
1702
|
return globalThis;
|
|
1700
|
-
}) ||
|
|
1703
|
+
}) || xt(function() {
|
|
1701
1704
|
return window;
|
|
1702
|
-
}) ||
|
|
1705
|
+
}) || xt(function() {
|
|
1703
1706
|
return self;
|
|
1704
|
-
}) ||
|
|
1707
|
+
}) || xt(function() {
|
|
1705
1708
|
return global;
|
|
1706
1709
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1707
1710
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1709,21 +1712,21 @@ const ae = wt(function() {
|
|
|
1709
1712
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1710
1713
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1711
1714
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1712
|
-
|
|
1713
|
-
return
|
|
1715
|
+
xt(function() {
|
|
1716
|
+
return xt.constructor("return this")();
|
|
1714
1717
|
});
|
|
1715
|
-
var
|
|
1716
|
-
function
|
|
1717
|
-
var e =
|
|
1718
|
-
return
|
|
1718
|
+
var Fe = /* @__PURE__ */ new Map();
|
|
1719
|
+
function jr(t) {
|
|
1720
|
+
var e = Fe.get(t) || 1;
|
|
1721
|
+
return Fe.set(t, e + 1), "".concat(t, ":").concat(e, ":").concat(Math.random().toString(36).slice(2));
|
|
1719
1722
|
}
|
|
1720
|
-
function
|
|
1721
|
-
var r =
|
|
1723
|
+
function Ar(t, e) {
|
|
1724
|
+
var r = jr("stringifyForDisplay");
|
|
1722
1725
|
return JSON.stringify(t, function(o, n) {
|
|
1723
1726
|
return n === void 0 ? r : n;
|
|
1724
1727
|
}, e).split(JSON.stringify(r)).join("<undefined>");
|
|
1725
1728
|
}
|
|
1726
|
-
function
|
|
1729
|
+
function Ut(t) {
|
|
1727
1730
|
return function(e) {
|
|
1728
1731
|
for (var r = [], o = 1; o < arguments.length; o++)
|
|
1729
1732
|
r[o - 1] = arguments[o];
|
|
@@ -1737,31 +1740,31 @@ function Bt(t) {
|
|
|
1737
1740
|
var Zt = Object.assign(function(e, r) {
|
|
1738
1741
|
for (var o = [], n = 2; n < arguments.length; n++)
|
|
1739
1742
|
o[n - 2] = arguments[n];
|
|
1740
|
-
e ||
|
|
1743
|
+
e || at(e, le(r, o) || ce(r, o));
|
|
1741
1744
|
}, {
|
|
1742
|
-
debug:
|
|
1743
|
-
log:
|
|
1744
|
-
warn:
|
|
1745
|
-
error:
|
|
1745
|
+
debug: Ut(at.debug),
|
|
1746
|
+
log: Ut(at.log),
|
|
1747
|
+
warn: Ut(at.warn),
|
|
1748
|
+
error: Ut(at.error)
|
|
1746
1749
|
});
|
|
1747
1750
|
function We(t) {
|
|
1748
1751
|
for (var e = [], r = 1; r < arguments.length; r++)
|
|
1749
1752
|
e[r - 1] = arguments[r];
|
|
1750
1753
|
return new Ye(le(t, e) || ce(t, e));
|
|
1751
1754
|
}
|
|
1752
|
-
var
|
|
1755
|
+
var Ie = Symbol.for("ApolloErrorMessageHandler_" + Je);
|
|
1753
1756
|
function Ge(t) {
|
|
1754
1757
|
if (typeof t == "string")
|
|
1755
1758
|
return t;
|
|
1756
1759
|
try {
|
|
1757
|
-
return
|
|
1760
|
+
return Ar(t, 2).slice(0, 1e3);
|
|
1758
1761
|
} catch {
|
|
1759
1762
|
return "<non-serializable>";
|
|
1760
1763
|
}
|
|
1761
1764
|
}
|
|
1762
1765
|
function le(t, e) {
|
|
1763
1766
|
if (e === void 0 && (e = []), !!t)
|
|
1764
|
-
return ae[
|
|
1767
|
+
return ae[Ie] && ae[Ie](t, e.map(Ge));
|
|
1765
1768
|
}
|
|
1766
1769
|
function ce(t, e) {
|
|
1767
1770
|
if (e === void 0 && (e = []), !!t)
|
|
@@ -1771,72 +1774,72 @@ function ce(t, e) {
|
|
|
1771
1774
|
args: e.map(Ge)
|
|
1772
1775
|
})));
|
|
1773
1776
|
}
|
|
1774
|
-
function
|
|
1777
|
+
function Dr(t) {
|
|
1775
1778
|
return t.definitions.filter(function(e) {
|
|
1776
1779
|
return e.kind === "OperationDefinition" && !!e.name;
|
|
1777
1780
|
}).map(function(e) {
|
|
1778
1781
|
return e.name.value;
|
|
1779
1782
|
})[0] || null;
|
|
1780
1783
|
}
|
|
1781
|
-
let
|
|
1784
|
+
let N = null;
|
|
1782
1785
|
const Ne = {};
|
|
1783
|
-
let
|
|
1784
|
-
const
|
|
1786
|
+
let Lr = 1;
|
|
1787
|
+
const Br = () => class {
|
|
1785
1788
|
constructor() {
|
|
1786
1789
|
this.id = [
|
|
1787
1790
|
"slot",
|
|
1788
|
-
|
|
1791
|
+
Lr++,
|
|
1789
1792
|
Date.now(),
|
|
1790
1793
|
Math.random().toString(36).slice(2)
|
|
1791
1794
|
].join(":");
|
|
1792
1795
|
}
|
|
1793
1796
|
hasValue() {
|
|
1794
|
-
for (let e =
|
|
1797
|
+
for (let e = N; e; e = e.parent)
|
|
1795
1798
|
if (this.id in e.slots) {
|
|
1796
1799
|
const r = e.slots[this.id];
|
|
1797
1800
|
if (r === Ne)
|
|
1798
1801
|
break;
|
|
1799
|
-
return e !==
|
|
1802
|
+
return e !== N && (N.slots[this.id] = r), !0;
|
|
1800
1803
|
}
|
|
1801
|
-
return
|
|
1804
|
+
return N && (N.slots[this.id] = Ne), !1;
|
|
1802
1805
|
}
|
|
1803
1806
|
getValue() {
|
|
1804
1807
|
if (this.hasValue())
|
|
1805
|
-
return
|
|
1808
|
+
return N.slots[this.id];
|
|
1806
1809
|
}
|
|
1807
1810
|
withValue(e, r, o, n) {
|
|
1808
|
-
const
|
|
1811
|
+
const s = {
|
|
1809
1812
|
__proto__: null,
|
|
1810
1813
|
[this.id]: e
|
|
1811
|
-
},
|
|
1812
|
-
|
|
1814
|
+
}, l = N;
|
|
1815
|
+
N = { parent: l, slots: s };
|
|
1813
1816
|
try {
|
|
1814
1817
|
return r.apply(n, o);
|
|
1815
1818
|
} finally {
|
|
1816
|
-
|
|
1819
|
+
N = l;
|
|
1817
1820
|
}
|
|
1818
1821
|
}
|
|
1819
1822
|
// Capture the current context and wrap a callback function so that it
|
|
1820
1823
|
// reestablishes the captured context when called.
|
|
1821
1824
|
static bind(e) {
|
|
1822
|
-
const r =
|
|
1825
|
+
const r = N;
|
|
1823
1826
|
return function() {
|
|
1824
|
-
const o =
|
|
1827
|
+
const o = N;
|
|
1825
1828
|
try {
|
|
1826
|
-
return
|
|
1829
|
+
return N = r, e.apply(this, arguments);
|
|
1827
1830
|
} finally {
|
|
1828
|
-
|
|
1831
|
+
N = o;
|
|
1829
1832
|
}
|
|
1830
1833
|
};
|
|
1831
1834
|
}
|
|
1832
1835
|
// Immediately run a callback function without any captured context.
|
|
1833
1836
|
static noContext(e, r, o) {
|
|
1834
|
-
if (
|
|
1835
|
-
const n =
|
|
1837
|
+
if (N) {
|
|
1838
|
+
const n = N;
|
|
1836
1839
|
try {
|
|
1837
|
-
return
|
|
1840
|
+
return N = null, e.apply(o, r);
|
|
1838
1841
|
} finally {
|
|
1839
|
-
|
|
1842
|
+
N = n;
|
|
1840
1843
|
}
|
|
1841
1844
|
} else
|
|
1842
1845
|
return e.apply(o, r);
|
|
@@ -1848,7 +1851,7 @@ function Ee(t) {
|
|
|
1848
1851
|
} catch {
|
|
1849
1852
|
}
|
|
1850
1853
|
}
|
|
1851
|
-
const te = "@wry/context:Slot",
|
|
1854
|
+
const te = "@wry/context:Slot", Ur = (
|
|
1852
1855
|
// Prefer globalThis when available.
|
|
1853
1856
|
// https://github.com/benjamn/wryware/issues/347
|
|
1854
1857
|
Ee(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
@@ -1858,7 +1861,7 @@ const te = "@wry/context:Slot", Br = (
|
|
|
1858
1861
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1859
1862
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1860
1863
|
/* @__PURE__ */ Object.create(null)
|
|
1861
|
-
), Te =
|
|
1864
|
+
), Te = Ur, de = Te[te] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1862
1865
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1863
1866
|
Array[te] || (function(t) {
|
|
1864
1867
|
try {
|
|
@@ -1877,12 +1880,12 @@ Array[te] || (function(t) {
|
|
|
1877
1880
|
} finally {
|
|
1878
1881
|
return t;
|
|
1879
1882
|
}
|
|
1880
|
-
})(
|
|
1883
|
+
})(Br()), { bind: Co, noContext: _o } = de;
|
|
1881
1884
|
new de();
|
|
1882
|
-
function
|
|
1885
|
+
function qr(t, e) {
|
|
1883
1886
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
1884
1887
|
if (r) return (r = r.call(t)).next.bind(r);
|
|
1885
|
-
if (Array.isArray(t) || (r =
|
|
1888
|
+
if (Array.isArray(t) || (r = Mr(t)) || e) {
|
|
1886
1889
|
r && (t = r);
|
|
1887
1890
|
var o = 0;
|
|
1888
1891
|
return function() {
|
|
@@ -1892,7 +1895,7 @@ function Ur(t, e) {
|
|
|
1892
1895
|
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
1893
1896
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
1894
1897
|
}
|
|
1895
|
-
function
|
|
1898
|
+
function Mr(t, e) {
|
|
1896
1899
|
if (t) {
|
|
1897
1900
|
if (typeof t == "string") return Oe(t, e);
|
|
1898
1901
|
var r = Object.prototype.toString.call(t).slice(8, -1);
|
|
@@ -1923,8 +1926,8 @@ var pe = function() {
|
|
|
1923
1926
|
return fe(t) ? Symbol[t] : "@@" + t;
|
|
1924
1927
|
};
|
|
1925
1928
|
pe() && !fe("observable") && (Symbol.observable = Symbol("observable"));
|
|
1926
|
-
var
|
|
1927
|
-
function
|
|
1929
|
+
var Hr = me("iterator"), ie = me("observable"), Xe = me("species");
|
|
1930
|
+
function Jt(t, e) {
|
|
1928
1931
|
var r = t[e];
|
|
1929
1932
|
if (r != null) {
|
|
1930
1933
|
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
@@ -1933,22 +1936,22 @@ function Kt(t, e) {
|
|
|
1933
1936
|
}
|
|
1934
1937
|
function Nt(t) {
|
|
1935
1938
|
var e = t.constructor;
|
|
1936
|
-
return e !== void 0 && (e = e[Xe], e === null && (e = void 0)), e !== void 0 ? e :
|
|
1939
|
+
return e !== void 0 && (e = e[Xe], e === null && (e = void 0)), e !== void 0 ? e : E;
|
|
1937
1940
|
}
|
|
1938
|
-
function
|
|
1939
|
-
return t instanceof
|
|
1941
|
+
function Vr(t) {
|
|
1942
|
+
return t instanceof E;
|
|
1940
1943
|
}
|
|
1941
|
-
function
|
|
1942
|
-
|
|
1944
|
+
function vt(t) {
|
|
1945
|
+
vt.log ? vt.log(t) : setTimeout(function() {
|
|
1943
1946
|
throw t;
|
|
1944
1947
|
});
|
|
1945
1948
|
}
|
|
1946
|
-
function
|
|
1949
|
+
function Mt(t) {
|
|
1947
1950
|
Promise.resolve().then(function() {
|
|
1948
1951
|
try {
|
|
1949
1952
|
t();
|
|
1950
1953
|
} catch (e) {
|
|
1951
|
-
|
|
1954
|
+
vt(e);
|
|
1952
1955
|
}
|
|
1953
1956
|
});
|
|
1954
1957
|
}
|
|
@@ -1959,17 +1962,17 @@ function Qe(t) {
|
|
|
1959
1962
|
if (typeof e == "function")
|
|
1960
1963
|
e();
|
|
1961
1964
|
else {
|
|
1962
|
-
var r =
|
|
1965
|
+
var r = Jt(e, "unsubscribe");
|
|
1963
1966
|
r && r.call(e);
|
|
1964
1967
|
}
|
|
1965
1968
|
} catch (o) {
|
|
1966
|
-
|
|
1969
|
+
vt(o);
|
|
1967
1970
|
}
|
|
1968
1971
|
}
|
|
1969
1972
|
function se(t) {
|
|
1970
1973
|
t._observer = void 0, t._queue = void 0, t._state = "closed";
|
|
1971
1974
|
}
|
|
1972
|
-
function
|
|
1975
|
+
function Rr(t) {
|
|
1973
1976
|
var e = t._queue;
|
|
1974
1977
|
if (e) {
|
|
1975
1978
|
t._queue = void 0, t._state = "ready";
|
|
@@ -1981,7 +1984,7 @@ function Ze(t, e, r) {
|
|
|
1981
1984
|
t._state = "running";
|
|
1982
1985
|
var o = t._observer;
|
|
1983
1986
|
try {
|
|
1984
|
-
var n =
|
|
1987
|
+
var n = Jt(o, e);
|
|
1985
1988
|
switch (e) {
|
|
1986
1989
|
case "next":
|
|
1987
1990
|
n && n.call(o, r);
|
|
@@ -1994,8 +1997,8 @@ function Ze(t, e, r) {
|
|
|
1994
1997
|
se(t), n && n.call(o);
|
|
1995
1998
|
break;
|
|
1996
1999
|
}
|
|
1997
|
-
} catch (
|
|
1998
|
-
|
|
2000
|
+
} catch (s) {
|
|
2001
|
+
vt(s);
|
|
1999
2002
|
}
|
|
2000
2003
|
t._state === "closed" ? Qe(t) : t._state === "running" && (t._state = "ready");
|
|
2001
2004
|
}
|
|
@@ -2012,22 +2015,22 @@ function ee(t, e, r) {
|
|
|
2012
2015
|
t._state = "buffering", t._queue = [{
|
|
2013
2016
|
type: e,
|
|
2014
2017
|
value: r
|
|
2015
|
-
}],
|
|
2016
|
-
return
|
|
2018
|
+
}], Mt(function() {
|
|
2019
|
+
return Rr(t);
|
|
2017
2020
|
});
|
|
2018
2021
|
return;
|
|
2019
2022
|
}
|
|
2020
2023
|
Ze(t, e, r);
|
|
2021
2024
|
}
|
|
2022
2025
|
}
|
|
2023
|
-
var
|
|
2026
|
+
var Yr = /* @__PURE__ */ (function() {
|
|
2024
2027
|
function t(r, o) {
|
|
2025
2028
|
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
2026
|
-
var n = new
|
|
2029
|
+
var n = new Kr(this);
|
|
2027
2030
|
try {
|
|
2028
2031
|
this._cleanup = o.call(void 0, n);
|
|
2029
|
-
} catch (
|
|
2030
|
-
n.error(
|
|
2032
|
+
} catch (s) {
|
|
2033
|
+
n.error(s);
|
|
2031
2034
|
}
|
|
2032
2035
|
this._state === "initializing" && (this._state = "ready");
|
|
2033
2036
|
}
|
|
@@ -2040,7 +2043,7 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2040
2043
|
return this._state === "closed";
|
|
2041
2044
|
}
|
|
2042
2045
|
}]), t;
|
|
2043
|
-
})(),
|
|
2046
|
+
})(), Kr = /* @__PURE__ */ (function() {
|
|
2044
2047
|
function t(r) {
|
|
2045
2048
|
this._subscription = r;
|
|
2046
2049
|
}
|
|
@@ -2057,7 +2060,7 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2057
2060
|
return this._subscription._state === "closed";
|
|
2058
2061
|
}
|
|
2059
2062
|
}]), t;
|
|
2060
|
-
})(),
|
|
2063
|
+
})(), E = /* @__PURE__ */ (function() {
|
|
2061
2064
|
function t(r) {
|
|
2062
2065
|
if (!(this instanceof t)) throw new TypeError("Observable cannot be called as a function");
|
|
2063
2066
|
if (typeof r != "function") throw new TypeError("Observable initializer must be a function");
|
|
@@ -2069,162 +2072,162 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2069
2072
|
next: o,
|
|
2070
2073
|
error: arguments[1],
|
|
2071
2074
|
complete: arguments[2]
|
|
2072
|
-
}), new
|
|
2075
|
+
}), new Yr(o, this._subscriber);
|
|
2073
2076
|
}, e.forEach = function(o) {
|
|
2074
2077
|
var n = this;
|
|
2075
|
-
return new Promise(function(
|
|
2078
|
+
return new Promise(function(s, l) {
|
|
2076
2079
|
if (typeof o != "function") {
|
|
2077
|
-
|
|
2080
|
+
l(new TypeError(o + " is not a function"));
|
|
2078
2081
|
return;
|
|
2079
2082
|
}
|
|
2080
2083
|
function d() {
|
|
2081
|
-
i.unsubscribe(),
|
|
2084
|
+
i.unsubscribe(), s();
|
|
2082
2085
|
}
|
|
2083
2086
|
var i = n.subscribe({
|
|
2084
|
-
next: function(
|
|
2087
|
+
next: function(b) {
|
|
2085
2088
|
try {
|
|
2086
|
-
o(
|
|
2087
|
-
} catch (
|
|
2088
|
-
|
|
2089
|
+
o(b, d);
|
|
2090
|
+
} catch (h) {
|
|
2091
|
+
l(h), i.unsubscribe();
|
|
2089
2092
|
}
|
|
2090
2093
|
},
|
|
2091
|
-
error:
|
|
2092
|
-
complete:
|
|
2094
|
+
error: l,
|
|
2095
|
+
complete: s
|
|
2093
2096
|
});
|
|
2094
2097
|
});
|
|
2095
2098
|
}, e.map = function(o) {
|
|
2096
2099
|
var n = this;
|
|
2097
2100
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2098
|
-
var
|
|
2099
|
-
return new
|
|
2101
|
+
var s = Nt(this);
|
|
2102
|
+
return new s(function(l) {
|
|
2100
2103
|
return n.subscribe({
|
|
2101
2104
|
next: function(d) {
|
|
2102
2105
|
try {
|
|
2103
2106
|
d = o(d);
|
|
2104
2107
|
} catch (i) {
|
|
2105
|
-
return
|
|
2108
|
+
return l.error(i);
|
|
2106
2109
|
}
|
|
2107
|
-
|
|
2110
|
+
l.next(d);
|
|
2108
2111
|
},
|
|
2109
2112
|
error: function(d) {
|
|
2110
|
-
|
|
2113
|
+
l.error(d);
|
|
2111
2114
|
},
|
|
2112
2115
|
complete: function() {
|
|
2113
|
-
|
|
2116
|
+
l.complete();
|
|
2114
2117
|
}
|
|
2115
2118
|
});
|
|
2116
2119
|
});
|
|
2117
2120
|
}, e.filter = function(o) {
|
|
2118
2121
|
var n = this;
|
|
2119
2122
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2120
|
-
var
|
|
2121
|
-
return new
|
|
2123
|
+
var s = Nt(this);
|
|
2124
|
+
return new s(function(l) {
|
|
2122
2125
|
return n.subscribe({
|
|
2123
2126
|
next: function(d) {
|
|
2124
2127
|
try {
|
|
2125
2128
|
if (!o(d)) return;
|
|
2126
2129
|
} catch (i) {
|
|
2127
|
-
return
|
|
2130
|
+
return l.error(i);
|
|
2128
2131
|
}
|
|
2129
|
-
|
|
2132
|
+
l.next(d);
|
|
2130
2133
|
},
|
|
2131
2134
|
error: function(d) {
|
|
2132
|
-
|
|
2135
|
+
l.error(d);
|
|
2133
2136
|
},
|
|
2134
2137
|
complete: function() {
|
|
2135
|
-
|
|
2138
|
+
l.complete();
|
|
2136
2139
|
}
|
|
2137
2140
|
});
|
|
2138
2141
|
});
|
|
2139
2142
|
}, e.reduce = function(o) {
|
|
2140
2143
|
var n = this;
|
|
2141
2144
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2142
|
-
var
|
|
2143
|
-
return new
|
|
2145
|
+
var s = Nt(this), l = arguments.length > 1, d = !1, i = arguments[1], b = i;
|
|
2146
|
+
return new s(function(h) {
|
|
2144
2147
|
return n.subscribe({
|
|
2145
|
-
next: function(
|
|
2146
|
-
var
|
|
2147
|
-
if (d = !0, !
|
|
2148
|
+
next: function(S) {
|
|
2149
|
+
var _ = !d;
|
|
2150
|
+
if (d = !0, !_ || l)
|
|
2148
2151
|
try {
|
|
2149
|
-
|
|
2150
|
-
} catch (
|
|
2151
|
-
return
|
|
2152
|
+
b = o(b, S);
|
|
2153
|
+
} catch (F) {
|
|
2154
|
+
return h.error(F);
|
|
2152
2155
|
}
|
|
2153
2156
|
else
|
|
2154
|
-
|
|
2157
|
+
b = S;
|
|
2155
2158
|
},
|
|
2156
|
-
error: function(
|
|
2157
|
-
|
|
2159
|
+
error: function(S) {
|
|
2160
|
+
h.error(S);
|
|
2158
2161
|
},
|
|
2159
2162
|
complete: function() {
|
|
2160
|
-
if (!d && !
|
|
2161
|
-
|
|
2163
|
+
if (!d && !l) return h.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2164
|
+
h.next(b), h.complete();
|
|
2162
2165
|
}
|
|
2163
2166
|
});
|
|
2164
2167
|
});
|
|
2165
2168
|
}, e.concat = function() {
|
|
2166
|
-
for (var o = this, n = arguments.length,
|
|
2167
|
-
l
|
|
2169
|
+
for (var o = this, n = arguments.length, s = new Array(n), l = 0; l < n; l++)
|
|
2170
|
+
s[l] = arguments[l];
|
|
2168
2171
|
var d = Nt(this);
|
|
2169
2172
|
return new d(function(i) {
|
|
2170
|
-
var
|
|
2171
|
-
function
|
|
2172
|
-
|
|
2173
|
-
next: function(
|
|
2174
|
-
i.next(
|
|
2173
|
+
var b, h = 0;
|
|
2174
|
+
function S(_) {
|
|
2175
|
+
b = _.subscribe({
|
|
2176
|
+
next: function(F) {
|
|
2177
|
+
i.next(F);
|
|
2175
2178
|
},
|
|
2176
|
-
error: function(
|
|
2177
|
-
i.error(
|
|
2179
|
+
error: function(F) {
|
|
2180
|
+
i.error(F);
|
|
2178
2181
|
},
|
|
2179
2182
|
complete: function() {
|
|
2180
|
-
|
|
2183
|
+
h === s.length ? (b = void 0, i.complete()) : S(d.from(s[h++]));
|
|
2181
2184
|
}
|
|
2182
2185
|
});
|
|
2183
2186
|
}
|
|
2184
|
-
return
|
|
2185
|
-
|
|
2187
|
+
return S(o), function() {
|
|
2188
|
+
b && (b.unsubscribe(), b = void 0);
|
|
2186
2189
|
};
|
|
2187
2190
|
});
|
|
2188
2191
|
}, e.flatMap = function(o) {
|
|
2189
2192
|
var n = this;
|
|
2190
2193
|
if (typeof o != "function") throw new TypeError(o + " is not a function");
|
|
2191
|
-
var
|
|
2192
|
-
return new
|
|
2194
|
+
var s = Nt(this);
|
|
2195
|
+
return new s(function(l) {
|
|
2193
2196
|
var d = [], i = n.subscribe({
|
|
2194
|
-
next: function(
|
|
2197
|
+
next: function(h) {
|
|
2195
2198
|
if (o)
|
|
2196
2199
|
try {
|
|
2197
|
-
|
|
2198
|
-
} catch (
|
|
2199
|
-
return
|
|
2200
|
+
h = o(h);
|
|
2201
|
+
} catch (_) {
|
|
2202
|
+
return l.error(_);
|
|
2200
2203
|
}
|
|
2201
|
-
var
|
|
2202
|
-
next: function(
|
|
2203
|
-
|
|
2204
|
+
var S = s.from(h).subscribe({
|
|
2205
|
+
next: function(_) {
|
|
2206
|
+
l.next(_);
|
|
2204
2207
|
},
|
|
2205
|
-
error: function(
|
|
2206
|
-
|
|
2208
|
+
error: function(_) {
|
|
2209
|
+
l.error(_);
|
|
2207
2210
|
},
|
|
2208
2211
|
complete: function() {
|
|
2209
|
-
var
|
|
2210
|
-
|
|
2212
|
+
var _ = d.indexOf(S);
|
|
2213
|
+
_ >= 0 && d.splice(_, 1), b();
|
|
2211
2214
|
}
|
|
2212
2215
|
});
|
|
2213
|
-
d.push(
|
|
2216
|
+
d.push(S);
|
|
2214
2217
|
},
|
|
2215
|
-
error: function(
|
|
2216
|
-
|
|
2218
|
+
error: function(h) {
|
|
2219
|
+
l.error(h);
|
|
2217
2220
|
},
|
|
2218
2221
|
complete: function() {
|
|
2219
|
-
|
|
2222
|
+
b();
|
|
2220
2223
|
}
|
|
2221
2224
|
});
|
|
2222
|
-
function
|
|
2223
|
-
i.closed && d.length === 0 &&
|
|
2225
|
+
function b() {
|
|
2226
|
+
i.closed && d.length === 0 && l.complete();
|
|
2224
2227
|
}
|
|
2225
2228
|
return function() {
|
|
2226
|
-
d.forEach(function(
|
|
2227
|
-
return
|
|
2229
|
+
d.forEach(function(h) {
|
|
2230
|
+
return h.unsubscribe();
|
|
2228
2231
|
}), i.unsubscribe();
|
|
2229
2232
|
};
|
|
2230
2233
|
});
|
|
@@ -2233,21 +2236,21 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2233
2236
|
}, t.from = function(o) {
|
|
2234
2237
|
var n = typeof this == "function" ? this : t;
|
|
2235
2238
|
if (o == null) throw new TypeError(o + " is not an object");
|
|
2236
|
-
var
|
|
2237
|
-
if (
|
|
2238
|
-
var
|
|
2239
|
-
if (Object(
|
|
2240
|
-
return
|
|
2241
|
-
return
|
|
2239
|
+
var s = Jt(o, ie);
|
|
2240
|
+
if (s) {
|
|
2241
|
+
var l = s.call(o);
|
|
2242
|
+
if (Object(l) !== l) throw new TypeError(l + " is not an object");
|
|
2243
|
+
return Vr(l) && l.constructor === n ? l : new n(function(d) {
|
|
2244
|
+
return l.subscribe(d);
|
|
2242
2245
|
});
|
|
2243
2246
|
}
|
|
2244
|
-
if (fe("iterator") && (
|
|
2247
|
+
if (fe("iterator") && (s = Jt(o, Hr), s))
|
|
2245
2248
|
return new n(function(d) {
|
|
2246
|
-
|
|
2249
|
+
Mt(function() {
|
|
2247
2250
|
if (!d.closed) {
|
|
2248
|
-
for (var i =
|
|
2249
|
-
var
|
|
2250
|
-
if (d.next(
|
|
2251
|
+
for (var i = qr(s.call(o)), b; !(b = i()).done; ) {
|
|
2252
|
+
var h = b.value;
|
|
2253
|
+
if (d.next(h), d.closed) return;
|
|
2251
2254
|
}
|
|
2252
2255
|
d.complete();
|
|
2253
2256
|
}
|
|
@@ -2255,7 +2258,7 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2255
2258
|
});
|
|
2256
2259
|
if (Array.isArray(o))
|
|
2257
2260
|
return new n(function(d) {
|
|
2258
|
-
|
|
2261
|
+
Mt(function() {
|
|
2259
2262
|
if (!d.closed) {
|
|
2260
2263
|
for (var i = 0; i < o.length; ++i)
|
|
2261
2264
|
if (d.next(o[i]), d.closed) return;
|
|
@@ -2265,11 +2268,11 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2265
2268
|
});
|
|
2266
2269
|
throw new TypeError(o + " is not observable");
|
|
2267
2270
|
}, t.of = function() {
|
|
2268
|
-
for (var o = arguments.length, n = new Array(o),
|
|
2269
|
-
n[
|
|
2270
|
-
var
|
|
2271
|
-
return new
|
|
2272
|
-
|
|
2271
|
+
for (var o = arguments.length, n = new Array(o), s = 0; s < o; s++)
|
|
2272
|
+
n[s] = arguments[s];
|
|
2273
|
+
var l = typeof this == "function" ? this : t;
|
|
2274
|
+
return new l(function(d) {
|
|
2275
|
+
Mt(function() {
|
|
2273
2276
|
if (!d.closed) {
|
|
2274
2277
|
for (var i = 0; i < n.length; ++i)
|
|
2275
2278
|
if (d.next(n[i]), d.closed) return;
|
|
@@ -2284,14 +2287,14 @@ var Rr = /* @__PURE__ */ (function() {
|
|
|
2284
2287
|
}
|
|
2285
2288
|
}]), t;
|
|
2286
2289
|
})();
|
|
2287
|
-
pe() && Object.defineProperty(
|
|
2290
|
+
pe() && Object.defineProperty(E, Symbol("extensions"), {
|
|
2288
2291
|
value: {
|
|
2289
2292
|
symbol: ie,
|
|
2290
|
-
hostReportError:
|
|
2293
|
+
hostReportError: vt
|
|
2291
2294
|
},
|
|
2292
2295
|
configurable: !0
|
|
2293
2296
|
});
|
|
2294
|
-
function
|
|
2297
|
+
function Jr(t) {
|
|
2295
2298
|
var e, r = t.Symbol;
|
|
2296
2299
|
if (typeof r == "function")
|
|
2297
2300
|
if (r.observable)
|
|
@@ -2307,14 +2310,14 @@ function Kr(t) {
|
|
|
2307
2310
|
e = "@@observable";
|
|
2308
2311
|
return e;
|
|
2309
2312
|
}
|
|
2310
|
-
var
|
|
2311
|
-
typeof self < "u" ?
|
|
2312
|
-
|
|
2313
|
-
var $e =
|
|
2313
|
+
var yt;
|
|
2314
|
+
typeof self < "u" ? yt = self : typeof window < "u" ? yt = window : typeof global < "u" ? yt = global : typeof module < "u" ? yt = module : yt = Function("return this")();
|
|
2315
|
+
Jr(yt);
|
|
2316
|
+
var $e = E.prototype, ze = "@@observable";
|
|
2314
2317
|
$e[ze] || ($e[ze] = function() {
|
|
2315
2318
|
return this;
|
|
2316
2319
|
});
|
|
2317
|
-
function
|
|
2320
|
+
function Wr(t) {
|
|
2318
2321
|
for (var e = [
|
|
2319
2322
|
"query",
|
|
2320
2323
|
"operationName",
|
|
@@ -2328,11 +2331,11 @@ function Jr(t) {
|
|
|
2328
2331
|
}
|
|
2329
2332
|
return t;
|
|
2330
2333
|
}
|
|
2331
|
-
function
|
|
2332
|
-
var r =
|
|
2333
|
-
typeof
|
|
2334
|
+
function Gr(t, e) {
|
|
2335
|
+
var r = X({}, t), o = function(s) {
|
|
2336
|
+
typeof s == "function" ? r = X(X({}, r), s(r)) : r = X(X({}, r), s);
|
|
2334
2337
|
}, n = function() {
|
|
2335
|
-
return
|
|
2338
|
+
return X({}, r);
|
|
2336
2339
|
};
|
|
2337
2340
|
return Object.defineProperty(e, "setContext", {
|
|
2338
2341
|
enumerable: !1,
|
|
@@ -2342,29 +2345,29 @@ function Wr(t, e) {
|
|
|
2342
2345
|
value: n
|
|
2343
2346
|
}), e;
|
|
2344
2347
|
}
|
|
2345
|
-
function
|
|
2348
|
+
function Xr(t) {
|
|
2346
2349
|
var e = {
|
|
2347
2350
|
variables: t.variables || {},
|
|
2348
2351
|
extensions: t.extensions || {},
|
|
2349
2352
|
operationName: t.operationName,
|
|
2350
2353
|
query: t.query
|
|
2351
2354
|
};
|
|
2352
|
-
return e.operationName || (e.operationName = typeof e.query != "string" ?
|
|
2355
|
+
return e.operationName || (e.operationName = typeof e.query != "string" ? Dr(e.query) || void 0 : ""), e;
|
|
2353
2356
|
}
|
|
2354
|
-
var
|
|
2355
|
-
function
|
|
2356
|
-
return Qr
|
|
2357
|
+
var Qr = Symbol.for("apollo.deprecations"), Zr = ae, to = new de();
|
|
2358
|
+
function eo(t) {
|
|
2359
|
+
return Zr[Qr] || (to.getValue() || []).includes(t);
|
|
2357
2360
|
}
|
|
2358
|
-
function
|
|
2359
|
-
|
|
2361
|
+
function ro(t, e) {
|
|
2362
|
+
eo(t) || e();
|
|
2360
2363
|
}
|
|
2361
2364
|
function je(t, e) {
|
|
2362
|
-
return e ? e(t) :
|
|
2365
|
+
return e ? e(t) : E.of();
|
|
2363
2366
|
}
|
|
2364
2367
|
function Et(t) {
|
|
2365
2368
|
return typeof t == "function" ? new tr(t) : t;
|
|
2366
2369
|
}
|
|
2367
|
-
function
|
|
2370
|
+
function qt(t) {
|
|
2368
2371
|
return t.request.length <= 1;
|
|
2369
2372
|
}
|
|
2370
2373
|
var tr = (
|
|
@@ -2375,35 +2378,35 @@ var tr = (
|
|
|
2375
2378
|
}
|
|
2376
2379
|
return t.empty = function() {
|
|
2377
2380
|
return new t(function() {
|
|
2378
|
-
return
|
|
2381
|
+
return E.of();
|
|
2379
2382
|
});
|
|
2380
2383
|
}, t.from = function(e) {
|
|
2381
2384
|
return e.length === 0 ? t.empty() : e.map(Et).reduce(function(r, o) {
|
|
2382
2385
|
return r.concat(o);
|
|
2383
2386
|
});
|
|
2384
2387
|
}, t.split = function(e, r, o) {
|
|
2385
|
-
var n = Et(r),
|
|
2386
|
-
return
|
|
2387
|
-
return e(d) ? n.request(d) ||
|
|
2388
|
-
}) :
|
|
2389
|
-
return e(d) ? n.request(d, i) ||
|
|
2390
|
-
}), Object.assign(
|
|
2388
|
+
var n = Et(r), s = Et(o || new t(je)), l;
|
|
2389
|
+
return qt(n) && qt(s) ? l = new t(function(d) {
|
|
2390
|
+
return e(d) ? n.request(d) || E.of() : s.request(d) || E.of();
|
|
2391
|
+
}) : l = new t(function(d, i) {
|
|
2392
|
+
return e(d) ? n.request(d, i) || E.of() : s.request(d, i) || E.of();
|
|
2393
|
+
}), Object.assign(l, { left: n, right: s });
|
|
2391
2394
|
}, t.execute = function(e, r) {
|
|
2392
|
-
return e.request(
|
|
2395
|
+
return e.request(Gr(r.context, Xr(Wr(r)))) || E.of();
|
|
2393
2396
|
}, t.concat = function(e, r) {
|
|
2394
2397
|
var o = Et(e);
|
|
2395
|
-
if (
|
|
2398
|
+
if (qt(o))
|
|
2396
2399
|
return globalThis.__DEV__ !== !1 && Zt.warn(47, o), o;
|
|
2397
|
-
var n = Et(r),
|
|
2398
|
-
return
|
|
2399
|
-
return o.request(
|
|
2400
|
-
return n.request(d) ||
|
|
2401
|
-
}) ||
|
|
2402
|
-
}) :
|
|
2403
|
-
return o.request(
|
|
2404
|
-
return n.request(i, d) ||
|
|
2405
|
-
}) ||
|
|
2406
|
-
}), Object.assign(
|
|
2400
|
+
var n = Et(r), s;
|
|
2401
|
+
return qt(n) ? s = new t(function(l) {
|
|
2402
|
+
return o.request(l, function(d) {
|
|
2403
|
+
return n.request(d) || E.of();
|
|
2404
|
+
}) || E.of();
|
|
2405
|
+
}) : s = new t(function(l, d) {
|
|
2406
|
+
return o.request(l, function(i) {
|
|
2407
|
+
return n.request(i, d) || E.of();
|
|
2408
|
+
}) || E.of();
|
|
2409
|
+
}), Object.assign(s, { left: o, right: n });
|
|
2407
2410
|
}, t.prototype.split = function(e, r, o) {
|
|
2408
2411
|
return this.concat(t.split(e, r, o || new t(je)));
|
|
2409
2412
|
}, t.prototype.concat = function(e) {
|
|
@@ -2411,7 +2414,7 @@ var tr = (
|
|
|
2411
2414
|
}, t.prototype.request = function(e, r) {
|
|
2412
2415
|
throw We(48);
|
|
2413
2416
|
}, t.prototype.onError = function(e, r) {
|
|
2414
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
2417
|
+
if (globalThis.__DEV__ !== !1 && ro("onError", function() {
|
|
2415
2418
|
globalThis.__DEV__ !== !1 && Zt.warn(49);
|
|
2416
2419
|
}), r && r.error)
|
|
2417
2420
|
return r.error(e), !1;
|
|
@@ -2421,29 +2424,29 @@ var tr = (
|
|
|
2421
2424
|
}, t;
|
|
2422
2425
|
})()
|
|
2423
2426
|
);
|
|
2424
|
-
function
|
|
2427
|
+
function oo(t) {
|
|
2425
2428
|
return new tr(function(e, r) {
|
|
2426
|
-
var o =
|
|
2427
|
-
return new
|
|
2428
|
-
var
|
|
2429
|
+
var o = Pr(e, []);
|
|
2430
|
+
return new E(function(n) {
|
|
2431
|
+
var s, l = !1;
|
|
2429
2432
|
return Promise.resolve(o).then(function(d) {
|
|
2430
2433
|
return t(d, e.getContext());
|
|
2431
2434
|
}).then(e.setContext).then(function() {
|
|
2432
|
-
|
|
2435
|
+
l || (s = r(e).subscribe({
|
|
2433
2436
|
next: n.next.bind(n),
|
|
2434
2437
|
error: n.error.bind(n),
|
|
2435
2438
|
complete: n.complete.bind(n)
|
|
2436
2439
|
}));
|
|
2437
2440
|
}).catch(n.error.bind(n)), function() {
|
|
2438
|
-
|
|
2441
|
+
l = !0, s && s.unsubscribe();
|
|
2439
2442
|
};
|
|
2440
2443
|
});
|
|
2441
2444
|
});
|
|
2442
2445
|
}
|
|
2443
|
-
const
|
|
2446
|
+
const no = async () => {
|
|
2444
2447
|
const t = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", o = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2445
2448
|
try {
|
|
2446
|
-
const n = await
|
|
2449
|
+
const n = await T.post(
|
|
2447
2450
|
t,
|
|
2448
2451
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2449
2452
|
// Only grant_type in body
|
|
@@ -2456,32 +2459,32 @@ const oo = async () => {
|
|
|
2456
2459
|
);
|
|
2457
2460
|
return n.status === 200 && n.data.access_token ? n.data.access_token : (console.error("Failed to fetch token:", n.data), null);
|
|
2458
2461
|
} catch (n) {
|
|
2459
|
-
return
|
|
2462
|
+
return T.isAxiosError(n) ? console.error("Error fetching token:", n.response || n.message) : console.error("Unexpected error:", n), null;
|
|
2460
2463
|
}
|
|
2461
|
-
},
|
|
2462
|
-
uri: `${
|
|
2463
|
-
}),
|
|
2464
|
-
const r = await
|
|
2464
|
+
}, ao = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", io = sr({
|
|
2465
|
+
uri: `${ao}`
|
|
2466
|
+
}), so = oo(async (t, { headers: e }) => {
|
|
2467
|
+
const r = await no();
|
|
2465
2468
|
return {
|
|
2466
2469
|
headers: {
|
|
2467
2470
|
...e,
|
|
2468
2471
|
authorization: `Bearer ${r}`
|
|
2469
2472
|
}
|
|
2470
2473
|
};
|
|
2471
|
-
}),
|
|
2472
|
-
link:
|
|
2473
|
-
cache: new
|
|
2474
|
+
}), lo = new lr({
|
|
2475
|
+
link: so.concat(io),
|
|
2476
|
+
cache: new cr(),
|
|
2474
2477
|
defaultOptions: {
|
|
2475
2478
|
watchQuery: {
|
|
2476
2479
|
fetchPolicy: "cache-and-network"
|
|
2477
2480
|
}
|
|
2478
2481
|
}
|
|
2479
|
-
}),
|
|
2482
|
+
}), Fo = (t) => {
|
|
2480
2483
|
const { tanyaConfig: e } = t;
|
|
2481
|
-
return /* @__PURE__ */ a(
|
|
2484
|
+
return /* @__PURE__ */ a(dr, { client: lo, children: /* @__PURE__ */ a(xr, { children: /* @__PURE__ */ a(Tr, { tanyaConfig: e }) }) });
|
|
2482
2485
|
};
|
|
2483
2486
|
export {
|
|
2484
|
-
|
|
2485
|
-
|
|
2487
|
+
Fo as TanyaChatbot,
|
|
2488
|
+
vo as TanyaChatbotProvider
|
|
2486
2489
|
};
|
|
2487
2490
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|