tanya-chatbot 0.10.0 → 0.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +10 -10
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +784 -785
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { useEffect as xe, useState as b, useRef as Ve, forwardRef as $n, createElement as
|
|
1
|
+
import { useEffect as xe, useState as b, useRef as Ve, forwardRef as $n, createElement as mr, useMemo as Zr } from "react";
|
|
2
2
|
import { jsx as a, jsxs as d, Fragment as ke } from "react/jsx-runtime";
|
|
3
3
|
import { createHttpLink as Uo, ApolloClient as qo, InMemoryCache as Ro, ApolloProvider as Ho } from "@apollo/client";
|
|
4
|
-
import { Provider as Vo, useDispatch as Ln, useSelector as
|
|
4
|
+
import { Provider as Vo, useDispatch as Ln, useSelector as Xt } from "react-redux";
|
|
5
5
|
import { createSlice as zn, configureStore as Yo } from "@reduxjs/toolkit";
|
|
6
6
|
import * as Dn from "@radix-ui/react-popover";
|
|
7
7
|
import "clsx";
|
|
8
8
|
import "tailwind-merge";
|
|
9
|
-
import
|
|
9
|
+
import ue from "axios";
|
|
10
10
|
import "crypto-js";
|
|
11
11
|
import { Icon as Jo } from "@iconify/react";
|
|
12
12
|
import { toast as Be } from "react-toastify";
|
|
13
13
|
import { createPortal as Ko } from "react-dom";
|
|
14
14
|
const Wo = '*,: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}.visible{visibility:visible}.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}.m-\\[15px\\]{margin:15px}.mx-3{margin-left:.75rem;margin-right:.75rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-6{margin-left:1.5rem;margin-right:1.5rem}.mx-auto{margin-left:auto;margin-right:auto}.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-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.ml-3{margin-left:.75rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-0\\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.hidden{display:none}.h-12{height:3rem}.h-20{height:5rem}.h-28{height:7rem}.h-3{height:.75rem}.h-6{height:1.5rem}.h-\\[120px\\]{height:120px}.h-\\[150px\\]{height:150px}.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-12{width:3rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\\/4{width:75%}.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-\\[64\\.7vw\\]{width:64.7vw}.w-\\[96\\%\\]{width:96%}.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%}.max-w-\\[90\\%\\]{max-width:90%}.max-w-md{max-width:28rem}.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-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize{resize:both}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-center{align-items:center}.items-baseline{align-items:baseline}.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}.gap-y-2{row-gap:.5rem}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.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-bl-xl{border-bottom-left-radius:.75rem}.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-2{border-width:2px}.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-\\[\\#804c9e\\]{--tw-border-opacity: 1;border-color:rgb(128 76 158 / var(--tw-border-opacity, 1))}.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-black{--tw-border-opacity: 1;border-color:rgb(0 0 0 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-300{--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / 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-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.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))}.bg-white\\/70{background-color:#ffffffb3}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\\.5{padding:.125rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-\\[1px\\]{padding:1px}.px-1{padding-left:.25rem;padding-right:.25rem}.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-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.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-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-6{padding-bottom:1.5rem}.pl-2{padding-left:.5rem}.pr-5{padding-right:1.25rem}.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.font-nunitoSans{font-family:Nunito Sans}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-\\[11px\\]{font-size:11px}.text-\\[12px\\]{font-size:12px}.text-\\[14px\\]{font-size:14px}.text-\\[15px\\]{font-size:15px}.text-\\[16px\\]{font-size:16px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm,.text-sm\\/5{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-extrabold{font-weight:800}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.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-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / 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-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.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))}.underline{text-decoration-line:underline}.line-through{text-decoration-line:line-through}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-95{opacity:.95}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px 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_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-inner{--tw-shadow: inset 0 2px 4px 0 rgb(0 0 0 / .05);--tw-shadow-colored: inset 0 2px 4px 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-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}.drop-shadow-xl{--tw-drop-shadow: drop-shadow(0 20px 13px rgb(0 0 0 / .03)) drop-shadow(0 8px 5px rgb(0 0 0 / .08));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)}.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{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.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-150{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-150{animation-duration:.15s}.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}}.placeholder\\:text-red-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.placeholder\\:text-red-400::placeholder{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\\:-translate-y-0\\.5:hover{--tw-translate-y: -.125rem;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\\: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\\:border-gray-500:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}.hover\\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\\:text-\\[\\#6952C7\\]:hover{--tw-text-opacity: 1;color:rgb(105 82 199 / var(--tw-text-opacity, 1))}.hover\\:opacity-90:hover{opacity:.9}.hover\\:shadow-lg:hover{--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)}.hover\\:shadow-sm:hover{--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)}.focus\\:border-transparent:focus{border-color:transparent}.focus\\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\\:ring-gray-300:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(209 213 219 / var(--tw-ring-opacity, 1))}.disabled\\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:bg-gray-100:disabled{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.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\\:col-span-10{grid-column:span 10 / span 10}.sm\\:col-span-2{grid-column:span 2 / span 2}.sm\\:mx-0{margin-left:0;margin-right:0}.sm\\:w-\\[80vw\\]{width:80vw}.sm\\:grid-cols-12{grid-template-columns:repeat(12,minmax(0,1fr))}.sm\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.sm\\:flex-row{flex-direction:row}.sm\\:items-center{align-items:center}.sm\\:justify-start{justify-content:flex-start}}@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\\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.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}}';
|
|
15
|
-
function
|
|
15
|
+
function pi() {
|
|
16
16
|
return xe(() => {
|
|
17
17
|
if (typeof document < "u") {
|
|
18
18
|
const e = document.createElement("style");
|
|
@@ -74,12 +74,12 @@ const Qo = {
|
|
|
74
74
|
e.product = t.payload;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}), { setProduct:
|
|
77
|
+
}), { setProduct: hr } = Bn.actions, Zo = Bn.reducer, ea = Yo({
|
|
78
78
|
reducer: {
|
|
79
79
|
store: Go,
|
|
80
80
|
product: Zo
|
|
81
81
|
}
|
|
82
|
-
}), ta = ({ children: e }) => /* @__PURE__ */ a(Vo, { store: ea, children: e }),
|
|
82
|
+
}), ta = ({ children: e }) => /* @__PURE__ */ a(Vo, { store: ea, children: e }), Zt = (e) => {
|
|
83
83
|
const t = new CustomEvent("reactCartUpdated", {
|
|
84
84
|
detail: {
|
|
85
85
|
cartUpdated: !0,
|
|
@@ -101,17 +101,17 @@ function na({
|
|
|
101
101
|
const Xe = () => ({ 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" }), Un = async () => {
|
|
102
102
|
const e = "https://tanya-sfcc-server.vercel.app/";
|
|
103
103
|
try {
|
|
104
|
-
const t = await
|
|
104
|
+
const t = await ue.post(
|
|
105
105
|
`${e}api/auth/token-bm-grant?baseUrl=${Ye()}&siteId=${Ue()}`
|
|
106
106
|
);
|
|
107
107
|
return t.status === 200 && t.data.access_token ? t.data.access_token : (console.error("Failed to fetch token:", t.data), null);
|
|
108
108
|
} catch (t) {
|
|
109
|
-
return
|
|
109
|
+
return ue.isAxiosError(t) ? console.error("Error fetching token:", t.response || t.message) : console.error("Unexpected error:", t), null;
|
|
110
110
|
}
|
|
111
111
|
}, qn = async (e) => {
|
|
112
112
|
const t = "https://tanya-sfcc-server.vercel.app/";
|
|
113
113
|
try {
|
|
114
|
-
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await
|
|
114
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await ue.post(
|
|
115
115
|
`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
116
116
|
{},
|
|
117
117
|
{
|
|
@@ -123,7 +123,7 @@ const Xe = () => ({ aiConversationUrl: "https://mdv3qwfi2j.execute-api.us-east-1
|
|
|
123
123
|
);
|
|
124
124
|
return n.status === 200 && n.data ? n.data : null;
|
|
125
125
|
} catch (r) {
|
|
126
|
-
return
|
|
126
|
+
return ue.isAxiosError(r) ? console.error("Error creating basket:", r.response || r.message) : console.error("Unexpected error:", r), null;
|
|
127
127
|
}
|
|
128
128
|
};
|
|
129
129
|
async function Ge() {
|
|
@@ -131,7 +131,7 @@ async function Ge() {
|
|
|
131
131
|
const e = Ue(), t = "access_token_" + e, r = "expires_in_" + e, n = localStorage.getItem(r), o = localStorage.getItem(t);
|
|
132
132
|
return console.log(o), (s = JSON.parse(sessionStorage.getItem("customerData") || "{}")) != null && s.isGuest, console.log("access token found in local storage"), { access_token: o, expires_in: n };
|
|
133
133
|
}
|
|
134
|
-
const
|
|
134
|
+
const pr = async (e, t) => {
|
|
135
135
|
if (e && t && Date.now() < t)
|
|
136
136
|
return e;
|
|
137
137
|
try {
|
|
@@ -166,7 +166,7 @@ const wr = async (e, t) => {
|
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
168
|
const o = Ye();
|
|
169
|
-
return (await
|
|
169
|
+
return (await ue.get(
|
|
170
170
|
`${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
171
171
|
{
|
|
172
172
|
headers: {
|
|
@@ -183,7 +183,7 @@ const wr = async (e, t) => {
|
|
|
183
183
|
const { serverUrl: t, basePath: r } = Xe(), n = Ye();
|
|
184
184
|
console.log("calling access");
|
|
185
185
|
const { access_token: o } = await Ge();
|
|
186
|
-
return (await
|
|
186
|
+
return (await ue.get(
|
|
187
187
|
`${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
188
188
|
{
|
|
189
189
|
headers: {
|
|
@@ -197,7 +197,7 @@ const wr = async (e, t) => {
|
|
|
197
197
|
const t = await Un(), { customer_token: r } = await qn(
|
|
198
198
|
t
|
|
199
199
|
), { serverUrl: n, basePath: o } = Xe(), i = (await Ge()).access_token;
|
|
200
|
-
return (await
|
|
200
|
+
return (await ue.get(
|
|
201
201
|
`${n}${o}/get-interest?baseUrl=${Ye()}&customerId=${e}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
202
202
|
{
|
|
203
203
|
headers: {
|
|
@@ -206,10 +206,10 @@ const wr = async (e, t) => {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
)).data;
|
|
209
|
-
},
|
|
209
|
+
}, en = (e) => String(typeof e == "string" ? e : e["en-US"] || e), tn = (e) => e != null && e.image ? [e.image] : "variants" in e ? e.variants[0].images : e.masterVariant.images.map((t) => t.url), sa = (e, t) => e.toLocaleString("en-US", {
|
|
210
210
|
style: "currency",
|
|
211
211
|
currency: t || "USD"
|
|
212
|
-
}),
|
|
212
|
+
}), rn = (e) => {
|
|
213
213
|
var t, r, n;
|
|
214
214
|
return "variants" in e ? {
|
|
215
215
|
centAmount: (t = e.variants[0]) == null ? void 0 : t.prices.EUR.max,
|
|
@@ -218,7 +218,7 @@ const wr = async (e, t) => {
|
|
|
218
218
|
centAmount: (r = e.masterVariant) == null ? void 0 : r.prices[0].value.centAmount,
|
|
219
219
|
currencyCode: (n = e.masterVariant) == null ? void 0 : n.prices[0].value.currencyCode
|
|
220
220
|
};
|
|
221
|
-
}, ia = (e) => e.charAt(0).toUpperCase() + e.slice(1),
|
|
221
|
+
}, ia = (e) => e.charAt(0).toUpperCase() + e.slice(1), nn = (e, t) => e.length < t ? e : e.slice(0, t) + "...", sr = (e) => e.split("\\n").map((t, r) => {
|
|
222
222
|
const n = t.match(/^(\d+)\.\s(.+)/);
|
|
223
223
|
return n ? `<p key=${r} class="mb-2"><strong>${n[1]}.</strong> ${n[2]}</p>` : t.trim() ? `<p key=${r} class="mb-2">${t}</p>` : "<br/>";
|
|
224
224
|
}).join("");
|
|
@@ -241,8 +241,8 @@ const ca = ({
|
|
|
241
241
|
(l) => l - r < 0 ? e.length - (e.length % r || r) : l - r
|
|
242
242
|
);
|
|
243
243
|
}, c = async (l) => {
|
|
244
|
-
const
|
|
245
|
-
t(
|
|
244
|
+
const p = await Rn(l);
|
|
245
|
+
t(hr(p));
|
|
246
246
|
};
|
|
247
247
|
return /* @__PURE__ */ a("div", { className: "mt-2 overflow-x-hidden", children: /* @__PURE__ */ d("div", { className: "flex items-center justify-center gap-4 relative", children: [
|
|
248
248
|
(e == null ? void 0 : e.length) > r && /* @__PURE__ */ a(
|
|
@@ -259,7 +259,7 @@ const ca = ({
|
|
|
259
259
|
}
|
|
260
260
|
),
|
|
261
261
|
/* @__PURE__ */ a("div", { className: "flex gap-5 justify-center flex-1 overflow-hidden", children: e.slice(n, n + r).map((l) => {
|
|
262
|
-
var
|
|
262
|
+
var p, g, y, x;
|
|
263
263
|
return /* @__PURE__ */ d(
|
|
264
264
|
"div",
|
|
265
265
|
{
|
|
@@ -271,7 +271,7 @@ const ca = ({
|
|
|
271
271
|
/* @__PURE__ */ a("div", { className: "w-full p-2 flex items-center justify-center bg-white", children: /* @__PURE__ */ a(
|
|
272
272
|
"img",
|
|
273
273
|
{
|
|
274
|
-
src: ((
|
|
274
|
+
src: ((p = tn(l)[0]) == null ? void 0 : p.link) || tn(l)[0] || // fallback if it's a string
|
|
275
275
|
"https://via.placeholder.com/120",
|
|
276
276
|
alt: l != null && l.productName ? l.productName : "Product",
|
|
277
277
|
className: "w-28 h-28 rounded-[10px] transition-transform duration-300 hover:scale-125 object-cover"
|
|
@@ -283,8 +283,8 @@ const ca = ({
|
|
|
283
283
|
className: "text-white w-full p-2 text-[12px] text-center h-[60px]",
|
|
284
284
|
children: [
|
|
285
285
|
/* @__PURE__ */ d("div", { className: "relative inline-block group", children: [
|
|
286
|
-
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name :
|
|
287
|
-
|
|
286
|
+
/* @__PURE__ */ a("div", { className: "w-full line-clamp-1 overflow-hidden text-ellipsis text-[#000000] font-medium font-nunitoSans", children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : nn(
|
|
287
|
+
en((g = l == null ? void 0 : l.name) == null ? void 0 : g["en-US"]),
|
|
288
288
|
60
|
|
289
289
|
) || "Product" }),
|
|
290
290
|
/* @__PURE__ */ a(
|
|
@@ -298,8 +298,8 @@ const ca = ({
|
|
|
298
298
|
marginBottom: "5px",
|
|
299
299
|
zIndex: 50
|
|
300
300
|
},
|
|
301
|
-
children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name :
|
|
302
|
-
|
|
301
|
+
children: l != null && l.productName ? l.productName : l != null && l.product_name ? l.product_name : nn(
|
|
302
|
+
en((y = l == null ? void 0 : l.name) == null ? void 0 : y["en-US"]),
|
|
303
303
|
60
|
|
304
304
|
) || "Product"
|
|
305
305
|
}
|
|
@@ -307,8 +307,8 @@ const ca = ({
|
|
|
307
307
|
] }),
|
|
308
308
|
/* @__PURE__ */ d("div", { className: " flex text-center items-center gap-2 text-[14px] text-[#14121F] font-bold font-nunitoSans text-base mb-1", children: [
|
|
309
309
|
/* @__PURE__ */ a("p", { children: sa(
|
|
310
|
-
l != null && l.price ? Number(l == null ? void 0 : l.price) :
|
|
311
|
-
(x =
|
|
310
|
+
l != null && l.price ? Number(l == null ? void 0 : l.price) : rn(l).centAmount || 0,
|
|
311
|
+
(x = rn(l)) == null ? void 0 : x.currencyCode
|
|
312
312
|
) }),
|
|
313
313
|
/* @__PURE__ */ d("p", { className: "text-[#14121F] font-normal line-through text-sm font-nunitoSans truncate", children: [
|
|
314
314
|
"$",
|
|
@@ -363,11 +363,11 @@ const ca = ({
|
|
|
363
363
|
]
|
|
364
364
|
},
|
|
365
365
|
n
|
|
366
|
-
)) }),
|
|
366
|
+
)) }), Cr = async (e, t) => {
|
|
367
367
|
var s, i;
|
|
368
368
|
const { serverUrl: r, basePath: n } = Xe(), o = `${r}`;
|
|
369
369
|
try {
|
|
370
|
-
const c = await
|
|
370
|
+
const c = await ue.post(
|
|
371
371
|
`${o}${n}/basket/create?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
372
372
|
t,
|
|
373
373
|
{
|
|
@@ -385,12 +385,12 @@ const ca = ({
|
|
|
385
385
|
"*"
|
|
386
386
|
), c.data;
|
|
387
387
|
} catch (c) {
|
|
388
|
-
return
|
|
388
|
+
return ue.isAxiosError(c) ? console.error("Error creating basket:", c.response || c.message) : console.error("Unexpected error:", c), null;
|
|
389
389
|
}
|
|
390
|
-
},
|
|
390
|
+
}, gr = async (e, t, r) => {
|
|
391
391
|
const { serverUrl: n, basePath: o } = Xe(), s = `${n}`;
|
|
392
392
|
try {
|
|
393
|
-
const i = await
|
|
393
|
+
const i = await ue.post(
|
|
394
394
|
`${s}${o}/basket/add-product/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
395
395
|
t,
|
|
396
396
|
{
|
|
@@ -402,7 +402,7 @@ const ca = ({
|
|
|
402
402
|
);
|
|
403
403
|
return i.status === 200 && i.data ? i.data : null;
|
|
404
404
|
} catch (i) {
|
|
405
|
-
return
|
|
405
|
+
return ue.isAxiosError(i) ? console.error(
|
|
406
406
|
"Error adding products to basket:",
|
|
407
407
|
i.response || i.message
|
|
408
408
|
) : console.error("Unexpected error:", i), null;
|
|
@@ -414,7 +414,7 @@ const ca = ({
|
|
|
414
414
|
var s;
|
|
415
415
|
const { serverUrl: r, basePath: n } = Xe(), o = `${r}`;
|
|
416
416
|
try {
|
|
417
|
-
const i = await
|
|
417
|
+
const i = await ue.get(
|
|
418
418
|
`${o}${n}/basket/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
419
419
|
{
|
|
420
420
|
headers: {
|
|
@@ -425,13 +425,13 @@ const ca = ({
|
|
|
425
425
|
);
|
|
426
426
|
return { status: i.status, data: i.data };
|
|
427
427
|
} catch (i) {
|
|
428
|
-
return
|
|
428
|
+
return ue.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
429
429
|
}
|
|
430
430
|
}, ua = async (e) => {
|
|
431
431
|
var i;
|
|
432
432
|
const { serverUrl: t, basePath: r } = Xe(), n = `${t}`, o = await Ge(), s = "Bearer " + (o == null ? void 0 : o.access_token);
|
|
433
433
|
try {
|
|
434
|
-
const c = await
|
|
434
|
+
const c = await ue.get(
|
|
435
435
|
`${n}${r}/basket/shipping-methods/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${Ze()}&envRef=${et()}&orgRef=${tt()}`,
|
|
436
436
|
{
|
|
437
437
|
headers: {
|
|
@@ -442,39 +442,39 @@ const ca = ({
|
|
|
442
442
|
);
|
|
443
443
|
return ((i = c == null ? void 0 : c.data) == null ? void 0 : i.applicableShippingMethods) || [];
|
|
444
444
|
} catch (c) {
|
|
445
|
-
return
|
|
445
|
+
return ue.isAxiosError(c) ? console.error(
|
|
446
446
|
"Error fetching shipping methods:",
|
|
447
447
|
c.response || c.message
|
|
448
448
|
) : console.error("Unexpected error:", c), [];
|
|
449
449
|
}
|
|
450
|
-
},
|
|
451
|
-
const
|
|
450
|
+
}, $t = "sfcc_basket_id", on = "sfcc_customer_token", Lt = "sfcc_token_expiry", fa = 300 * 1e3, Rt = "1.0.0";
|
|
451
|
+
const it = (e) => {
|
|
452
452
|
try {
|
|
453
|
-
e ? localStorage.setItem(
|
|
453
|
+
e ? localStorage.setItem($t, e) : localStorage.removeItem($t);
|
|
454
454
|
} catch (t) {
|
|
455
455
|
console.error("Error saving basket ID to storage:", t);
|
|
456
456
|
}
|
|
457
|
-
},
|
|
457
|
+
}, er = (e) => {
|
|
458
458
|
try {
|
|
459
459
|
if (e) {
|
|
460
|
-
localStorage.setItem(
|
|
460
|
+
localStorage.setItem(on, e);
|
|
461
461
|
const t = Date.now() + fa;
|
|
462
|
-
localStorage.setItem(
|
|
462
|
+
localStorage.setItem(Lt, t.toString());
|
|
463
463
|
} else
|
|
464
|
-
localStorage.removeItem(
|
|
464
|
+
localStorage.removeItem(on);
|
|
465
465
|
} catch (t) {
|
|
466
466
|
console.error("Error storing token:", t);
|
|
467
467
|
}
|
|
468
|
-
},
|
|
469
|
-
var l,
|
|
470
|
-
const t = Ln(), r =
|
|
468
|
+
}, an = 300, ma = ({ addToCartPwa: e }) => {
|
|
469
|
+
var l, p, g, y, x, I;
|
|
470
|
+
const t = Ln(), r = Xt((S) => S.product.product), n = Xt((S) => S.store.store), [o, s] = b(!!r);
|
|
471
471
|
if (xe(() => {
|
|
472
472
|
s(!!r);
|
|
473
473
|
}, [r]), !r) return null;
|
|
474
474
|
const i = async () => {
|
|
475
|
-
var S,
|
|
475
|
+
var S, T, k, P, J, q, Y, _e, C, K, re, ye, be, lt, N, ve;
|
|
476
476
|
try {
|
|
477
|
-
if (!((
|
|
477
|
+
if (!((T = (S = r == null ? void 0 : r.variants) == null ? void 0 : S[0]) != null && T.product_id) && !(r.type.item || r.type.bundle) && !((P = (k = r == null ? void 0 : r.variants) == null ? void 0 : k[0]) != null && P.productId)) {
|
|
478
478
|
Be.error("Variants not available", {
|
|
479
479
|
position: "bottom-right",
|
|
480
480
|
autoClose: 1e3
|
|
@@ -488,33 +488,33 @@ const lt = (e) => {
|
|
|
488
488
|
}
|
|
489
489
|
], $ = JSON.parse(
|
|
490
490
|
sessionStorage.getItem("customerData") || "{}"
|
|
491
|
-
), Je = ($ == null ? void 0 : $.basketId) || localStorage.getItem(
|
|
492
|
-
if (!
|
|
493
|
-
let
|
|
494
|
-
if (
|
|
491
|
+
), Je = ($ == null ? void 0 : $.basketId) || localStorage.getItem($t), ct = !1, qe = localStorage.getItem(Lt), rt = Date.now();
|
|
492
|
+
if (!ct || !qe || rt >= parseInt(qe)) {
|
|
493
|
+
let fe = "";
|
|
494
|
+
if (fe = "Bearer " + (await Ge()).access_token, !fe) {
|
|
495
495
|
console.error("Failed to get customer_token");
|
|
496
496
|
return;
|
|
497
497
|
}
|
|
498
498
|
const Ie = rt + 300 * 1e3;
|
|
499
|
-
if (
|
|
499
|
+
if (er(fe), localStorage.setItem(Lt, Ie.toString()), Je) {
|
|
500
500
|
const Se = await Hn({
|
|
501
501
|
basketId: Je,
|
|
502
|
-
customer_token:
|
|
502
|
+
customer_token: fe
|
|
503
503
|
});
|
|
504
504
|
if (Se.status === 200 && Se) {
|
|
505
|
-
const
|
|
505
|
+
const ne = await gr(
|
|
506
506
|
Je,
|
|
507
507
|
V,
|
|
508
|
-
|
|
508
|
+
fe
|
|
509
509
|
);
|
|
510
|
-
(((Y =
|
|
510
|
+
(((Y = ne == null ? void 0 : ne.product_items) == null ? void 0 : Y.length) > 0 || ((_e = ne == null ? void 0 : ne.productItems) == null ? void 0 : _e.length) > 0) && (Be.success("Added to cart", {
|
|
511
511
|
position: "bottom-right",
|
|
512
512
|
autoClose: 3e3,
|
|
513
513
|
hideProgressBar: !1,
|
|
514
514
|
closeOnClick: !0,
|
|
515
515
|
pauseOnHover: !0,
|
|
516
516
|
draggable: !0
|
|
517
|
-
}),
|
|
517
|
+
}), Zt(Je));
|
|
518
518
|
return;
|
|
519
519
|
}
|
|
520
520
|
}
|
|
@@ -525,34 +525,34 @@ const lt = (e) => {
|
|
|
525
525
|
quantity: 1
|
|
526
526
|
}
|
|
527
527
|
]
|
|
528
|
-
}, z = await
|
|
528
|
+
}, z = await Cr(fe, je);
|
|
529
529
|
if (!(z != null && z.basket_id) && !(z != null && z.basketId)) {
|
|
530
530
|
console.error("Failed to create basket");
|
|
531
531
|
return;
|
|
532
532
|
}
|
|
533
|
-
|
|
533
|
+
it(
|
|
534
534
|
(z == null ? void 0 : z.basket_id) || (z == null ? void 0 : z.basketId)
|
|
535
535
|
), console.log("adding product to basket");
|
|
536
|
-
const Te = await
|
|
536
|
+
const Te = await gr(
|
|
537
537
|
(z == null ? void 0 : z.basket_id) || (z == null ? void 0 : z.basketId),
|
|
538
538
|
V,
|
|
539
|
-
|
|
539
|
+
fe
|
|
540
540
|
);
|
|
541
|
-
console.log("object added to basket"), (((
|
|
541
|
+
console.log("object added to basket"), (((re = Te == null ? void 0 : Te.product_items) == null ? void 0 : re.length) > 0 || ((ye = Te == null ? void 0 : Te.productItems) == null ? void 0 : ye.length) > 0) && Be.success("Added to cart", {
|
|
542
542
|
position: "bottom-right",
|
|
543
543
|
autoClose: 3e3,
|
|
544
544
|
hideProgressBar: !1,
|
|
545
545
|
closeOnClick: !0,
|
|
546
546
|
pauseOnHover: !0,
|
|
547
547
|
draggable: !0
|
|
548
|
-
}),
|
|
548
|
+
}), Zt(z.basket_id || (z == null ? void 0 : z.basketId));
|
|
549
549
|
}
|
|
550
550
|
} catch (V) {
|
|
551
551
|
console.error("Error adding to cart:", V), Be.error("Failed to add product to cart", {
|
|
552
552
|
position: "bottom-right",
|
|
553
553
|
autoClose: 3e3
|
|
554
554
|
}), ((be = V == null ? void 0 : V.response) == null ? void 0 : be.status) === 404 || // Basket not found
|
|
555
|
-
((
|
|
555
|
+
((lt = V == null ? void 0 : V.response) == null ? void 0 : lt.status) === 401 ? (((N = V == null ? void 0 : V.response) == null ? void 0 : N.status) === 404 && it(null), ((ve = V == null ? void 0 : V.response) == null ? void 0 : ve.status) === 401 && (it(null), er(null))) : (console.error("Failed to add product to basket:", V.message), Be.error("Failed to add product to cart", {
|
|
556
556
|
position: "bottom-right",
|
|
557
557
|
autoClose: 3e3
|
|
558
558
|
}));
|
|
@@ -568,7 +568,7 @@ const lt = (e) => {
|
|
|
568
568
|
{
|
|
569
569
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
570
570
|
onClick: () => {
|
|
571
|
-
s(!1), setTimeout(() => t(
|
|
571
|
+
s(!1), setTimeout(() => t(hr(null)), an);
|
|
572
572
|
}
|
|
573
573
|
}
|
|
574
574
|
),
|
|
@@ -591,8 +591,8 @@ const lt = (e) => {
|
|
|
591
591
|
className: "text-[#555555] w-6 h-6 cursor-pointer",
|
|
592
592
|
onClick: () => {
|
|
593
593
|
s(!1), setTimeout(
|
|
594
|
-
() => t(
|
|
595
|
-
|
|
594
|
+
() => t(hr(null)),
|
|
595
|
+
an
|
|
596
596
|
);
|
|
597
597
|
},
|
|
598
598
|
children: "✕"
|
|
@@ -603,20 +603,20 @@ const lt = (e) => {
|
|
|
603
603
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
604
604
|
"img",
|
|
605
605
|
{
|
|
606
|
-
src: (y = (g = (
|
|
606
|
+
src: (y = (g = (p = (l = r.imageGroups) == null ? void 0 : l[0]) == null ? void 0 : p.images) == null ? void 0 : g[0]) == null ? void 0 : y.link,
|
|
607
607
|
alt: r.name,
|
|
608
608
|
className: "rounded-[10px]"
|
|
609
609
|
}
|
|
610
610
|
) }),
|
|
611
611
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
|
|
612
|
-
(S) => S.images.slice(1, 2).map((
|
|
612
|
+
(S) => S.images.slice(1, 2).map((T) => /* @__PURE__ */ a(
|
|
613
613
|
"img",
|
|
614
614
|
{
|
|
615
|
-
src:
|
|
615
|
+
src: T.link,
|
|
616
616
|
alt: r.name,
|
|
617
617
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
618
618
|
},
|
|
619
|
-
|
|
619
|
+
T.link
|
|
620
620
|
))
|
|
621
621
|
) })
|
|
622
622
|
] }),
|
|
@@ -663,7 +663,7 @@ const lt = (e) => {
|
|
|
663
663
|
" ratings"
|
|
664
664
|
] })
|
|
665
665
|
] }) }),
|
|
666
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((S,
|
|
666
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((S, T) => {
|
|
667
667
|
var k;
|
|
668
668
|
return /* @__PURE__ */ a(
|
|
669
669
|
Jo,
|
|
@@ -672,10 +672,10 @@ const lt = (e) => {
|
|
|
672
672
|
width: "20",
|
|
673
673
|
height: "20",
|
|
674
674
|
className: `text-yellow-500
|
|
675
|
-
${((k = r == null ? void 0 : r.rating) == null ? void 0 : k.rate) >
|
|
675
|
+
${((k = r == null ? void 0 : r.rating) == null ? void 0 : k.rate) > T ? "text-yellow-500" : "text-gray-300"}
|
|
676
676
|
`
|
|
677
677
|
},
|
|
678
|
-
|
|
678
|
+
T
|
|
679
679
|
);
|
|
680
680
|
}) })
|
|
681
681
|
] }),
|
|
@@ -710,7 +710,7 @@ const lt = (e) => {
|
|
|
710
710
|
}
|
|
711
711
|
)
|
|
712
712
|
] });
|
|
713
|
-
},
|
|
713
|
+
}, ha = ({
|
|
714
714
|
tanyaConfig: e,
|
|
715
715
|
basketId: t,
|
|
716
716
|
addToCart: r
|
|
@@ -729,83 +729,83 @@ const lt = (e) => {
|
|
|
729
729
|
"Niece/Nephew": "his/her niece/nephew",
|
|
730
730
|
"My Friends": "his/her friends",
|
|
731
731
|
Others: "others"
|
|
732
|
-
}, s = Ve(null), i = Ve(null), c = Ve(null), l = Ve(null), [
|
|
732
|
+
}, s = Ve(null), i = Ve(null), c = Ve(null), l = Ve(null), [p, g] = b(null);
|
|
733
733
|
Ve(null);
|
|
734
|
-
const [y, x] = b(!1), [I, S] = b(!1), [
|
|
735
|
-
id:
|
|
736
|
-
title:
|
|
737
|
-
image:
|
|
738
|
-
price:
|
|
739
|
-
}), [N, ve] = b([]), V = Ve(null), $ =
|
|
734
|
+
const [y, x] = b(!1), [I, S] = b(!1), [T, k] = b(!1), [P, J] = b(!1), [q, Y] = b(!1), [_e, C] = b(!1), [K, re] = b(""), [ye, be] = b(""), lt = (h) => ({
|
|
735
|
+
id: h.id,
|
|
736
|
+
title: h.name,
|
|
737
|
+
image: h.image ?? "",
|
|
738
|
+
price: h.price ?? 0
|
|
739
|
+
}), [N, ve] = b([]), V = Ve(null), $ = Xt((h) => h.store.store), Je = Xt((h) => h.product.product);
|
|
740
740
|
xe(() => {
|
|
741
|
-
const
|
|
741
|
+
const h = localStorage.getItem(
|
|
742
742
|
`access_token_${e.siteId}`
|
|
743
743
|
), O = localStorage.getItem(
|
|
744
744
|
`chat-token-${e.siteId}`
|
|
745
745
|
);
|
|
746
|
-
if (
|
|
746
|
+
if (h && O === h) {
|
|
747
747
|
const B = localStorage.getItem("chatHistory");
|
|
748
748
|
B && ve(JSON.parse(B));
|
|
749
749
|
} else
|
|
750
750
|
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
751
751
|
`chat-token-${e.siteId}`,
|
|
752
|
-
|
|
752
|
+
h || ""
|
|
753
753
|
);
|
|
754
754
|
}, []), xe(() => {
|
|
755
755
|
localStorage.setItem("chatHistory", JSON.stringify(N));
|
|
756
|
-
const
|
|
756
|
+
const h = localStorage.getItem(
|
|
757
757
|
`access_token_${e.siteId}`
|
|
758
758
|
);
|
|
759
|
-
|
|
759
|
+
h && localStorage.setItem(`chat-token-${e.siteId}`, h);
|
|
760
760
|
}, [N]);
|
|
761
|
-
const
|
|
761
|
+
const ct = () => {
|
|
762
762
|
k(!0), setTimeout(() => S(!0), 10);
|
|
763
763
|
}, qe = () => {
|
|
764
764
|
S(!1), setTimeout(() => k(!1), 300);
|
|
765
765
|
};
|
|
766
766
|
xe(() => {
|
|
767
|
-
y ?
|
|
767
|
+
y ? ct() : qe();
|
|
768
768
|
}, [y]);
|
|
769
|
-
const rt = (
|
|
770
|
-
be(o[
|
|
769
|
+
const rt = (h) => {
|
|
770
|
+
be(o[h]);
|
|
771
771
|
};
|
|
772
772
|
xe(() => {
|
|
773
|
-
|
|
773
|
+
T && V.current && V.current.scrollTo({
|
|
774
774
|
top: V.current.scrollHeight,
|
|
775
775
|
behavior: "smooth"
|
|
776
776
|
});
|
|
777
|
-
}, [N,
|
|
778
|
-
const
|
|
779
|
-
const
|
|
780
|
-
|
|
777
|
+
}, [N, T]);
|
|
778
|
+
const fe = null, Ie = null, je = async () => {
|
|
779
|
+
const h = await Ge();
|
|
780
|
+
h != null && g(h);
|
|
781
781
|
};
|
|
782
782
|
xe(() => {
|
|
783
783
|
if (e != null && e.siteId) {
|
|
784
|
-
const { clientID:
|
|
785
|
-
sessionStorage.setItem("Host", O), sessionStorage.setItem("SiteId", U), sessionStorage.setItem("pubCfg", btoa(
|
|
784
|
+
const { clientID: h, host: O, organizationID: B, shortCode: Q, siteId: U } = e;
|
|
785
|
+
sessionStorage.setItem("Host", O), sessionStorage.setItem("SiteId", U), sessionStorage.setItem("pubCfg", btoa(h)), sessionStorage.setItem("envRef", Q), sessionStorage.setItem("orgRef", B);
|
|
786
786
|
}
|
|
787
787
|
je(), console.log("scapi environment v1");
|
|
788
788
|
}, []), xe(() => {
|
|
789
|
-
t && (console.log("setting the basket id", t),
|
|
789
|
+
t && (console.log("setting the basket id", t), it(t));
|
|
790
790
|
}, [t]);
|
|
791
791
|
const z = async () => {
|
|
792
|
-
const
|
|
792
|
+
const h = JSON.parse(
|
|
793
793
|
sessionStorage.getItem("customerData") || "{}"
|
|
794
794
|
).customerId;
|
|
795
|
-
return (await aa(
|
|
796
|
-
}, Te = async (
|
|
797
|
-
console.log("in secondary flow",
|
|
795
|
+
return (await aa(h || "")).c_interests;
|
|
796
|
+
}, Te = async (h, O) => {
|
|
797
|
+
console.log("in secondary flow", Rt);
|
|
798
798
|
const B = await z();
|
|
799
|
-
if (console.log(B, "interests of customer",
|
|
799
|
+
if (console.log(B, "interests of customer", Rt), !!B)
|
|
800
800
|
try {
|
|
801
801
|
ve(
|
|
802
|
-
(
|
|
803
|
-
(Ne, pe) => pe ===
|
|
802
|
+
(he) => he.map(
|
|
803
|
+
(Ne, pe) => pe === he.length - 1 ? { ...Ne, secondaryLoading: !0 } : Ne
|
|
804
804
|
)
|
|
805
805
|
);
|
|
806
|
-
const Q = await
|
|
806
|
+
const Q = await pr(fe, Ie);
|
|
807
807
|
if (!Q) throw new Error("Failed to fetch token");
|
|
808
|
-
const U = localStorage.getItem("customerNumber"), L = localStorage.getItem("isLoggedIn"),
|
|
808
|
+
const U = localStorage.getItem("customerNumber"), L = localStorage.getItem("isLoggedIn"), Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
809
809
|
registered: String(L || !1),
|
|
810
810
|
userId: String(U || (/* @__PURE__ */ new Date()).getTime())
|
|
811
811
|
}).toString()}`, R = JSON.stringify({
|
|
@@ -813,11 +813,11 @@ const lt = (e) => {
|
|
|
813
813
|
flowAliasId: "HKFUVLWVH2",
|
|
814
814
|
input: {
|
|
815
815
|
loyaltyPoints: "",
|
|
816
|
-
productName:
|
|
816
|
+
productName: h,
|
|
817
817
|
productPoints: String(O || 0),
|
|
818
818
|
interests: B
|
|
819
819
|
}
|
|
820
|
-
}),
|
|
820
|
+
}), oe = await fetch(Z, {
|
|
821
821
|
signal: AbortSignal.timeout(3e4),
|
|
822
822
|
method: "POST",
|
|
823
823
|
headers: {
|
|
@@ -826,46 +826,46 @@ const lt = (e) => {
|
|
|
826
826
|
},
|
|
827
827
|
body: R
|
|
828
828
|
});
|
|
829
|
-
if (!
|
|
830
|
-
const $e =
|
|
829
|
+
if (!oe.body) throw new Error("Readable stream not supported");
|
|
830
|
+
const $e = oe.body.getReader(), Re = new TextDecoder();
|
|
831
831
|
let G = "";
|
|
832
832
|
for (; ; ) {
|
|
833
|
-
const { done:
|
|
834
|
-
if (
|
|
833
|
+
const { done: he, value: Ne } = await $e.read();
|
|
834
|
+
if (he) break;
|
|
835
835
|
G += Re.decode(Ne, { stream: !0 });
|
|
836
836
|
const pe = G.split(`
|
|
837
837
|
`);
|
|
838
838
|
G = pe.pop() || "";
|
|
839
|
-
for (const
|
|
840
|
-
if (
|
|
841
|
-
const _ =
|
|
839
|
+
for (const X of pe)
|
|
840
|
+
if (X.startsWith("data:")) {
|
|
841
|
+
const _ = X.slice(5).trim();
|
|
842
842
|
try {
|
|
843
|
-
const
|
|
844
|
-
|
|
843
|
+
const ee = JSON.parse(_);
|
|
844
|
+
ee.index === 0 && ve(
|
|
845
845
|
(D) => D.map(
|
|
846
|
-
(
|
|
847
|
-
...
|
|
848
|
-
secondaryResponse:
|
|
846
|
+
(ae, se) => se === D.length - 1 ? {
|
|
847
|
+
...ae,
|
|
848
|
+
secondaryResponse: ee.data,
|
|
849
849
|
secondaryLoading: !1
|
|
850
|
-
} :
|
|
850
|
+
} : ae
|
|
851
851
|
)
|
|
852
852
|
);
|
|
853
|
-
} catch (
|
|
853
|
+
} catch (ee) {
|
|
854
854
|
ve(
|
|
855
855
|
(D) => D.map(
|
|
856
|
-
(
|
|
856
|
+
(ae, se) => se === D.length - 1 ? { ...ae, secondaryLoading: !1 } : ae
|
|
857
857
|
)
|
|
858
|
-
), console.error("Secondary flow JSON parse error:",
|
|
858
|
+
), console.error("Secondary flow JSON parse error:", ee);
|
|
859
859
|
}
|
|
860
860
|
}
|
|
861
861
|
}
|
|
862
862
|
} catch (Q) {
|
|
863
863
|
console.error("Secondary flow error:", Q);
|
|
864
864
|
}
|
|
865
|
-
}, Se = async (
|
|
866
|
-
const O =
|
|
865
|
+
}, Se = async (h) => {
|
|
866
|
+
const O = h || K.trim();
|
|
867
867
|
if (O) {
|
|
868
|
-
Y(!0),
|
|
868
|
+
Y(!0), re(""), s.current = null, i.current = null, c.current = null, l.current = null, ve((B) => [
|
|
869
869
|
...B,
|
|
870
870
|
{
|
|
871
871
|
query: O,
|
|
@@ -876,10 +876,10 @@ const lt = (e) => {
|
|
|
876
876
|
}
|
|
877
877
|
]);
|
|
878
878
|
try {
|
|
879
|
-
const B = ye, Q = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), L = await
|
|
879
|
+
const B = ye, Q = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), L = await pr(fe, Ie);
|
|
880
880
|
if (!L)
|
|
881
881
|
throw new Error("Failed to obtain access token");
|
|
882
|
-
const
|
|
882
|
+
const Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
883
883
|
registered: String(U || !1),
|
|
884
884
|
userId: String(Q || (/* @__PURE__ */ new Date()).getTime())
|
|
885
885
|
}).toString()}`, R = JSON.stringify({
|
|
@@ -889,7 +889,7 @@ const lt = (e) => {
|
|
|
889
889
|
userPrompt: O,
|
|
890
890
|
whom: B
|
|
891
891
|
}
|
|
892
|
-
}),
|
|
892
|
+
}), oe = await fetch(Z, {
|
|
893
893
|
signal: AbortSignal.timeout(3e4),
|
|
894
894
|
method: "POST",
|
|
895
895
|
headers: {
|
|
@@ -898,30 +898,30 @@ const lt = (e) => {
|
|
|
898
898
|
},
|
|
899
899
|
body: R
|
|
900
900
|
});
|
|
901
|
-
if (!
|
|
902
|
-
throw new Error(`HTTP error! status: ${
|
|
903
|
-
if (!
|
|
904
|
-
const $e =
|
|
905
|
-
let G = "",
|
|
901
|
+
if (!oe.ok)
|
|
902
|
+
throw new Error(`HTTP error! status: ${oe.status}`);
|
|
903
|
+
if (!oe.body) throw new Error("Readable stream not supported");
|
|
904
|
+
const $e = oe.body.getReader(), Re = new TextDecoder();
|
|
905
|
+
let G = "", he = "";
|
|
906
906
|
for (; ; ) {
|
|
907
907
|
C(!0);
|
|
908
908
|
const { done: Ne, value: pe } = await $e.read();
|
|
909
909
|
if (Ne) break;
|
|
910
910
|
G += Re.decode(pe, { stream: !0 });
|
|
911
|
-
const
|
|
911
|
+
const X = G.split(`
|
|
912
912
|
`);
|
|
913
|
-
G =
|
|
914
|
-
for (const _ of
|
|
913
|
+
G = X.pop() || "";
|
|
914
|
+
for (const _ of X)
|
|
915
915
|
if (_.startsWith("data:")) {
|
|
916
|
-
const
|
|
916
|
+
const ee = _.slice(5).trim();
|
|
917
917
|
try {
|
|
918
|
-
const D = JSON.parse(
|
|
919
|
-
D.index == 1 && (
|
|
920
|
-
(
|
|
921
|
-
(
|
|
922
|
-
...
|
|
918
|
+
const D = JSON.parse(ee);
|
|
919
|
+
D.index == 1 && (he = D.data), ve(
|
|
920
|
+
(ae) => ae.map(
|
|
921
|
+
(se, Ae) => Ae === ae.length - 1 ? {
|
|
922
|
+
...se,
|
|
923
923
|
[D.index == 0 ? "response" : D.index == 1 ? "keywords" : D.index == 2 ? "potentialQuestions" : "end"]: D.data
|
|
924
|
-
} :
|
|
924
|
+
} : se
|
|
925
925
|
)
|
|
926
926
|
);
|
|
927
927
|
} catch (D) {
|
|
@@ -929,67 +929,67 @@ const lt = (e) => {
|
|
|
929
929
|
}
|
|
930
930
|
}
|
|
931
931
|
}
|
|
932
|
-
|
|
932
|
+
me(ne(he));
|
|
933
933
|
} catch (B) {
|
|
934
934
|
console.error("Error sending message to Tanya:", B);
|
|
935
935
|
} finally {
|
|
936
936
|
Y(!1);
|
|
937
937
|
}
|
|
938
938
|
}
|
|
939
|
-
},
|
|
940
|
-
const O =
|
|
939
|
+
}, ne = (h) => {
|
|
940
|
+
const O = h.match(
|
|
941
941
|
/top five relevant product or category names are: (.*)/i
|
|
942
|
-
), U = (O ? O[1] :
|
|
942
|
+
), U = (O ? O[1] : h).split(", ").map((W) => W.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
943
943
|
return [...new Set(U)].filter(Boolean).join(",");
|
|
944
|
-
},
|
|
944
|
+
}, me = async (h) => {
|
|
945
945
|
var B, Q, U;
|
|
946
|
-
const O = typeof
|
|
946
|
+
const O = typeof h == "string" ? h.split(",") : h;
|
|
947
947
|
C(!0);
|
|
948
948
|
try {
|
|
949
949
|
const L = await Promise.all(
|
|
950
950
|
O.map((R) => oa(R).catch(() => []))
|
|
951
951
|
// prevent Promise.all crash
|
|
952
|
-
), W = O.map((R,
|
|
952
|
+
), W = O.map((R, oe) => ({
|
|
953
953
|
keyword: R,
|
|
954
|
-
items: L[
|
|
954
|
+
items: L[oe] ?? [],
|
|
955
955
|
loading: !1
|
|
956
|
-
})).filter((R) => R.items.length > 0),
|
|
957
|
-
if (
|
|
958
|
-
i.current =
|
|
959
|
-
const R = typeof
|
|
956
|
+
})).filter((R) => R.items.length > 0), Z = (Q = (B = W[0]) == null ? void 0 : B.items) == null ? void 0 : Q[0];
|
|
957
|
+
if (Z) {
|
|
958
|
+
i.current = Z.product_id, s.current = Z.product_name, c.current = (U = Z.image) == null ? void 0 : U.link;
|
|
959
|
+
const R = typeof Z.price == "number" ? Z.price : null;
|
|
960
960
|
l.current = R;
|
|
961
961
|
}
|
|
962
962
|
if (ve(
|
|
963
963
|
(R) => R.map(
|
|
964
|
-
(
|
|
965
|
-
...
|
|
964
|
+
(oe, $e) => $e === R.length - 1 ? {
|
|
965
|
+
...oe,
|
|
966
966
|
products: W,
|
|
967
|
-
productSnapshot:
|
|
967
|
+
productSnapshot: Z ? {
|
|
968
968
|
id: i.current,
|
|
969
969
|
name: s.current,
|
|
970
970
|
image: c.current,
|
|
971
971
|
price: l.current,
|
|
972
972
|
points: 0,
|
|
973
973
|
quantity: 1
|
|
974
|
-
} :
|
|
975
|
-
} :
|
|
974
|
+
} : oe.productSnapshot
|
|
975
|
+
} : oe
|
|
976
976
|
)
|
|
977
|
-
),
|
|
977
|
+
), Z) {
|
|
978
978
|
const R = JSON.parse(
|
|
979
979
|
sessionStorage.getItem("customerData") || "{}"
|
|
980
980
|
);
|
|
981
|
-
R != null && R.isGuest || (console.log("running secondary flow",
|
|
981
|
+
R != null && R.isGuest || (console.log("running secondary flow", Rt), Te(s.current, 0));
|
|
982
982
|
}
|
|
983
983
|
} catch (L) {
|
|
984
984
|
console.error("error in keyword search", L);
|
|
985
985
|
} finally {
|
|
986
986
|
C(!1);
|
|
987
987
|
}
|
|
988
|
-
},
|
|
989
|
-
var B, Q, U, L, W,
|
|
988
|
+
}, vt = async (h, O) => {
|
|
989
|
+
var B, Q, U, L, W, Z, R, oe, $e, Re, G, he, Ne, pe, X;
|
|
990
990
|
J(!0);
|
|
991
991
|
try {
|
|
992
|
-
const _ = await Rn(
|
|
992
|
+
const _ = await Rn(h.id);
|
|
993
993
|
if (!((Q = (B = _ == null ? void 0 : _.variants) == null ? void 0 : B[0]) != null && Q.product_id || (L = (U = _ == null ? void 0 : _.variants) == null ? void 0 : U[0]) != null && L.productId) && !(_.type.item || _.type.bundle)) {
|
|
994
994
|
J(!1), Be.error("Variants not found", {
|
|
995
995
|
position: "bottom-right",
|
|
@@ -997,56 +997,56 @@ const lt = (e) => {
|
|
|
997
997
|
}), console.error("No product variant found");
|
|
998
998
|
return;
|
|
999
999
|
}
|
|
1000
|
-
const
|
|
1000
|
+
const ee = [
|
|
1001
1001
|
{
|
|
1002
|
-
product_id: ((W = _.variants) == null ? void 0 : W[0].product_id) || ((
|
|
1002
|
+
product_id: ((W = _.variants) == null ? void 0 : W[0].product_id) || ((Z = _.variants) == null ? void 0 : Z[0].productId) || (_ == null ? void 0 : _.id),
|
|
1003
1003
|
quantity: O
|
|
1004
1004
|
}
|
|
1005
1005
|
];
|
|
1006
|
-
console.log(
|
|
1006
|
+
console.log(ee, "product data", "app version", Rt);
|
|
1007
1007
|
const D = JSON.parse(
|
|
1008
1008
|
sessionStorage.getItem("customerData") || "{}"
|
|
1009
|
-
),
|
|
1010
|
-
if (!
|
|
1009
|
+
), ae = (D == null ? void 0 : D.basketId) || localStorage.getItem($t), se = !1, Ae = localStorage.getItem(Lt), kt = Date.now();
|
|
1010
|
+
if (!se || !Ae || kt >= parseInt(Ae)) {
|
|
1011
1011
|
const Oe = await Un();
|
|
1012
|
-
let { customer_token:
|
|
1012
|
+
let { customer_token: ie } = await qn(
|
|
1013
1013
|
Oe
|
|
1014
1014
|
);
|
|
1015
|
-
if (
|
|
1015
|
+
if (ie = "Bearer " + p.access_token, !ie) {
|
|
1016
1016
|
console.error("Failed to get customer_token");
|
|
1017
1017
|
return;
|
|
1018
1018
|
}
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
1021
|
-
const
|
|
1022
|
-
basketId:
|
|
1023
|
-
customer_token:
|
|
1019
|
+
const St = kt + 300 * 1e3;
|
|
1020
|
+
if (er(ie), localStorage.setItem(Lt, St.toString()), console.log(ae, "basketIdFromCustomer"), ae) {
|
|
1021
|
+
const Nt = await Hn({
|
|
1022
|
+
basketId: ae,
|
|
1023
|
+
customer_token: ie
|
|
1024
1024
|
});
|
|
1025
|
-
if (
|
|
1026
|
-
const
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1025
|
+
if (Nt.status === 200 && Nt) {
|
|
1026
|
+
const Ct = await gr(
|
|
1027
|
+
ae,
|
|
1028
|
+
ee,
|
|
1029
|
+
ie
|
|
1030
1030
|
);
|
|
1031
|
-
((R =
|
|
1031
|
+
((R = Ct == null ? void 0 : Ct.product_items) == null ? void 0 : R.length) > 0 && (Be.success("Added to cart", {
|
|
1032
1032
|
position: "bottom-right",
|
|
1033
1033
|
autoClose: 3e3,
|
|
1034
1034
|
hideProgressBar: !1,
|
|
1035
1035
|
closeOnClick: !0,
|
|
1036
1036
|
pauseOnHover: !0,
|
|
1037
1037
|
draggable: !0
|
|
1038
|
-
}),
|
|
1038
|
+
}), Zt(ae), J(!1));
|
|
1039
1039
|
return;
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
const Ce = {
|
|
1043
1043
|
productItems: [
|
|
1044
1044
|
{
|
|
1045
|
-
productId: ((
|
|
1045
|
+
productId: ((oe = _.variants) == null ? void 0 : oe[0].product_id) || (($e = _.variants) == null ? void 0 : $e[0].productId) || (_ == null ? void 0 : _.id),
|
|
1046
1046
|
quantity: 1
|
|
1047
1047
|
}
|
|
1048
1048
|
]
|
|
1049
|
-
}, F = await
|
|
1049
|
+
}, F = await Cr(ie, Ce);
|
|
1050
1050
|
if (console.log(
|
|
1051
1051
|
F,
|
|
1052
1052
|
F == null ? void 0 : F.basket_id,
|
|
@@ -1056,31 +1056,31 @@ const lt = (e) => {
|
|
|
1056
1056
|
J(!1), console.error("Failed to create basket");
|
|
1057
1057
|
return;
|
|
1058
1058
|
}
|
|
1059
|
-
|
|
1059
|
+
it(
|
|
1060
1060
|
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
|
|
1061
1061
|
);
|
|
1062
|
-
const
|
|
1062
|
+
const te = await r(
|
|
1063
1063
|
{
|
|
1064
1064
|
productId: i,
|
|
1065
1065
|
quantity: O
|
|
1066
1066
|
},
|
|
1067
1067
|
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
|
|
1068
1068
|
);
|
|
1069
|
-
(((Re =
|
|
1069
|
+
(((Re = te == null ? void 0 : te.product_items) == null ? void 0 : Re.length) > 0 || ((G = te == null ? void 0 : te.productItems) == null ? void 0 : G.length) > 0) && Be.success("Added to cart", {
|
|
1070
1070
|
position: "bottom-right",
|
|
1071
1071
|
autoClose: 3e3,
|
|
1072
1072
|
hideProgressBar: !1,
|
|
1073
1073
|
closeOnClick: !0,
|
|
1074
1074
|
pauseOnHover: !0,
|
|
1075
1075
|
draggable: !0
|
|
1076
|
-
}),
|
|
1076
|
+
}), Zt(F.basket_id || (F == null ? void 0 : F.basketId));
|
|
1077
1077
|
}
|
|
1078
1078
|
} catch (_) {
|
|
1079
1079
|
J(!1), console.error("Error adding to cart:", _), Be.error("Failed to add product to cart", {
|
|
1080
1080
|
position: "bottom-right",
|
|
1081
1081
|
autoClose: 3e3
|
|
1082
|
-
}), ((
|
|
1083
|
-
((Ne = _ == null ? void 0 : _.response) == null ? void 0 : Ne.status) === 401 ? (((pe = _ == null ? void 0 : _.response) == null ? void 0 : pe.status) === 404 &&
|
|
1082
|
+
}), ((he = _ == null ? void 0 : _.response) == null ? void 0 : he.status) === 404 || // Basket not found
|
|
1083
|
+
((Ne = _ == null ? void 0 : _.response) == null ? void 0 : Ne.status) === 401 ? (((pe = _ == null ? void 0 : _.response) == null ? void 0 : pe.status) === 404 && it(null), ((X = _ == null ? void 0 : _.response) == null ? void 0 : X.status) === 401 && (it(null), er(null))) : (console.error("Failed to add product to basket:", _.message), Be.error("Failed to add product to cart", {
|
|
1084
1084
|
position: "bottom-right",
|
|
1085
1085
|
autoClose: 3e3
|
|
1086
1086
|
}));
|
|
@@ -1088,8 +1088,8 @@ const lt = (e) => {
|
|
|
1088
1088
|
J(!1);
|
|
1089
1089
|
};
|
|
1090
1090
|
return xe(() => {
|
|
1091
|
-
|
|
1092
|
-
}, [
|
|
1091
|
+
T ? setTimeout(() => S(!0), 10) : S(!1);
|
|
1092
|
+
}, [T]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ d(ra, { open: y, onOpenChange: x, children: [
|
|
1093
1093
|
/* @__PURE__ */ a(
|
|
1094
1094
|
na,
|
|
1095
1095
|
{
|
|
@@ -1153,7 +1153,7 @@ const lt = (e) => {
|
|
|
1153
1153
|
) })
|
|
1154
1154
|
}
|
|
1155
1155
|
),
|
|
1156
|
-
|
|
1156
|
+
T && /* @__PURE__ */ d(ke, { children: [
|
|
1157
1157
|
/* @__PURE__ */ a(
|
|
1158
1158
|
"div",
|
|
1159
1159
|
{
|
|
@@ -1311,38 +1311,38 @@ const lt = (e) => {
|
|
|
1311
1311
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1312
1312
|
children: [
|
|
1313
1313
|
/* @__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?" }) }),
|
|
1314
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((
|
|
1314
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((h) => /* @__PURE__ */ a(
|
|
1315
1315
|
"button",
|
|
1316
1316
|
{
|
|
1317
|
-
onClick: () => rt(
|
|
1317
|
+
onClick: () => rt(h),
|
|
1318
1318
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1319
1319
|
style: {
|
|
1320
|
-
backgroundColor: ye === o[
|
|
1321
|
-
borderColor: ye === o[
|
|
1320
|
+
backgroundColor: ye === o[h] ? "#FFFFFF" : "#F3F3F3",
|
|
1321
|
+
borderColor: ye === o[h] ? "#BBB3DD" : ""
|
|
1322
1322
|
},
|
|
1323
|
-
children:
|
|
1323
|
+
children: h
|
|
1324
1324
|
},
|
|
1325
|
-
|
|
1325
|
+
h
|
|
1326
1326
|
)) })
|
|
1327
1327
|
]
|
|
1328
1328
|
}
|
|
1329
1329
|
),
|
|
1330
|
-
N.map((
|
|
1330
|
+
N.map((h, O) => {
|
|
1331
1331
|
var B, Q;
|
|
1332
1332
|
return /* @__PURE__ */ d("div", { children: [
|
|
1333
1333
|
/* @__PURE__ */ a(
|
|
1334
1334
|
"div",
|
|
1335
1335
|
{
|
|
1336
1336
|
className: "flex justify-end",
|
|
1337
|
-
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:
|
|
1337
|
+
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: h.query })
|
|
1338
1338
|
}
|
|
1339
1339
|
),
|
|
1340
|
-
|
|
1340
|
+
h.response && h.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1341
1341
|
"div",
|
|
1342
1342
|
{
|
|
1343
1343
|
className: "font-nunitoSans animate-pulse font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1344
1344
|
dangerouslySetInnerHTML: {
|
|
1345
|
-
__html:
|
|
1345
|
+
__html: sr(h.response)
|
|
1346
1346
|
}
|
|
1347
1347
|
}
|
|
1348
1348
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1350,19 +1350,19 @@ const lt = (e) => {
|
|
|
1350
1350
|
{
|
|
1351
1351
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1352
1352
|
dangerouslySetInnerHTML: {
|
|
1353
|
-
__html:
|
|
1353
|
+
__html: sr(h.response)
|
|
1354
1354
|
}
|
|
1355
1355
|
}
|
|
1356
1356
|
) }),
|
|
1357
|
-
_e && !
|
|
1358
|
-
(
|
|
1357
|
+
_e && !h.response.includes("Thinking") && ((B = h.products) == null ? void 0 : B.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" }) }),
|
|
1358
|
+
(h == null ? void 0 : h.products) && ((Q = h == null ? void 0 : h.products) == null ? void 0 : Q.length) > 0 && /* @__PURE__ */ a(
|
|
1359
1359
|
da,
|
|
1360
1360
|
{
|
|
1361
|
-
chat:
|
|
1361
|
+
chat: h.products,
|
|
1362
1362
|
storeDetails: $
|
|
1363
1363
|
}
|
|
1364
1364
|
),
|
|
1365
|
-
(
|
|
1365
|
+
(h == null ? void 0 : h.potentialQuestions.length) > 0 && /* @__PURE__ */ d("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1366
1366
|
/* @__PURE__ */ a(
|
|
1367
1367
|
"p",
|
|
1368
1368
|
{
|
|
@@ -1371,7 +1371,7 @@ const lt = (e) => {
|
|
|
1371
1371
|
children: "Why not explore these inquiries..."
|
|
1372
1372
|
}
|
|
1373
1373
|
),
|
|
1374
|
-
|
|
1374
|
+
h.potentialQuestions.split(",").map((U, L) => /* @__PURE__ */ a(
|
|
1375
1375
|
"button",
|
|
1376
1376
|
{
|
|
1377
1377
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${$.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
@@ -1384,7 +1384,7 @@ const lt = (e) => {
|
|
|
1384
1384
|
L
|
|
1385
1385
|
))
|
|
1386
1386
|
] }),
|
|
1387
|
-
(
|
|
1387
|
+
(h == null ? void 0 : h.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ d(
|
|
1388
1388
|
"div",
|
|
1389
1389
|
{
|
|
1390
1390
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1417,7 +1417,7 @@ const lt = (e) => {
|
|
|
1417
1417
|
]
|
|
1418
1418
|
}
|
|
1419
1419
|
) }),
|
|
1420
|
-
(
|
|
1420
|
+
(h == null ? void 0 : h.secondaryResponse) && /* @__PURE__ */ a(ke, { children: /* @__PURE__ */ d("div", { className: "mt-3 mb-8 px-4 bg-indigo-300 rounded-tr-[5px]", children: [
|
|
1421
1421
|
/* @__PURE__ */ a(
|
|
1422
1422
|
"div",
|
|
1423
1423
|
{
|
|
@@ -1426,13 +1426,13 @@ const lt = (e) => {
|
|
|
1426
1426
|
backgroundColor: $.tanyaThemeColorLight
|
|
1427
1427
|
},
|
|
1428
1428
|
dangerouslySetInnerHTML: {
|
|
1429
|
-
__html:
|
|
1430
|
-
|
|
1429
|
+
__html: sr(
|
|
1430
|
+
h.secondaryResponse
|
|
1431
1431
|
)
|
|
1432
1432
|
}
|
|
1433
1433
|
}
|
|
1434
1434
|
),
|
|
1435
|
-
|
|
1435
|
+
h.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1436
1436
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ d(
|
|
1437
1437
|
"div",
|
|
1438
1438
|
{
|
|
@@ -1450,11 +1450,11 @@ const lt = (e) => {
|
|
|
1450
1450
|
height: 112,
|
|
1451
1451
|
borderColor: "#eee"
|
|
1452
1452
|
},
|
|
1453
|
-
children:
|
|
1453
|
+
children: h.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1454
1454
|
"img",
|
|
1455
1455
|
{
|
|
1456
|
-
src:
|
|
1457
|
-
alt:
|
|
1456
|
+
src: h.productSnapshot.image,
|
|
1457
|
+
alt: h.productSnapshot.name,
|
|
1458
1458
|
className: "w-full h-full object-cover"
|
|
1459
1459
|
}
|
|
1460
1460
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1462,18 +1462,18 @@ const lt = (e) => {
|
|
|
1462
1462
|
),
|
|
1463
1463
|
/* @__PURE__ */ d("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1464
1464
|
/* @__PURE__ */ d("div", { children: [
|
|
1465
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1466
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1465
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: h.productSnapshot.name }),
|
|
1466
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: h.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1467
1467
|
style: "currency",
|
|
1468
1468
|
currency: ($ == null ? void 0 : $.currency) || "USD"
|
|
1469
1469
|
}).format(
|
|
1470
|
-
|
|
1470
|
+
h.productSnapshot.price
|
|
1471
1471
|
) : "" }),
|
|
1472
|
-
|
|
1472
|
+
h.productSnapshot.points > 0 && /* @__PURE__ */ d("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1473
1473
|
"You will earn",
|
|
1474
1474
|
" ",
|
|
1475
1475
|
/* @__PURE__ */ d("strong", { children: [
|
|
1476
|
-
|
|
1476
|
+
h.productSnapshot.points,
|
|
1477
1477
|
" ",
|
|
1478
1478
|
"points"
|
|
1479
1479
|
] })
|
|
@@ -1506,7 +1506,7 @@ const lt = (e) => {
|
|
|
1506
1506
|
children: "−"
|
|
1507
1507
|
}
|
|
1508
1508
|
),
|
|
1509
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1509
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: h.productSnapshot.quantity }),
|
|
1510
1510
|
/* @__PURE__ */ a(
|
|
1511
1511
|
"button",
|
|
1512
1512
|
{
|
|
@@ -1534,11 +1534,11 @@ const lt = (e) => {
|
|
|
1534
1534
|
"button",
|
|
1535
1535
|
{
|
|
1536
1536
|
onClick: () => {
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1537
|
+
vt(
|
|
1538
|
+
lt(
|
|
1539
|
+
h.productSnapshot
|
|
1540
1540
|
),
|
|
1541
|
-
|
|
1541
|
+
h.productSnapshot.quantity
|
|
1542
1542
|
);
|
|
1543
1543
|
},
|
|
1544
1544
|
disabled: P,
|
|
@@ -1578,9 +1578,9 @@ const lt = (e) => {
|
|
|
1578
1578
|
placeholder: "How can I help you...",
|
|
1579
1579
|
value: K,
|
|
1580
1580
|
autoFocus: !0,
|
|
1581
|
-
onChange: (
|
|
1582
|
-
onKeyDown: (
|
|
1583
|
-
|
|
1581
|
+
onChange: (h) => re(h.target.value),
|
|
1582
|
+
onKeyDown: (h) => {
|
|
1583
|
+
h.key === "Enter" && !q && Se();
|
|
1584
1584
|
}
|
|
1585
1585
|
}
|
|
1586
1586
|
),
|
|
@@ -1633,17 +1633,17 @@ const lt = (e) => {
|
|
|
1633
1633
|
] })
|
|
1634
1634
|
] }) });
|
|
1635
1635
|
};
|
|
1636
|
-
var
|
|
1637
|
-
return
|
|
1636
|
+
var wr = function(e, t) {
|
|
1637
|
+
return wr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
1638
1638
|
r.__proto__ = n;
|
|
1639
1639
|
} || function(r, n) {
|
|
1640
1640
|
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
1641
|
-
},
|
|
1641
|
+
}, wr(e, t);
|
|
1642
1642
|
};
|
|
1643
|
-
function
|
|
1643
|
+
function pa(e, t) {
|
|
1644
1644
|
if (typeof t != "function" && t !== null)
|
|
1645
1645
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
1646
|
-
|
|
1646
|
+
wr(e, t);
|
|
1647
1647
|
function r() {
|
|
1648
1648
|
this.constructor = e;
|
|
1649
1649
|
}
|
|
@@ -1666,26 +1666,26 @@ function ga(e, t) {
|
|
|
1666
1666
|
t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]);
|
|
1667
1667
|
return r;
|
|
1668
1668
|
}
|
|
1669
|
-
var
|
|
1669
|
+
var ir = "Invariant Violation", sn = Object.setPrototypeOf, wa = sn === void 0 ? function(e, t) {
|
|
1670
1670
|
return e.__proto__ = t, e;
|
|
1671
|
-
} :
|
|
1671
|
+
} : sn, Vn = (
|
|
1672
1672
|
/** @class */
|
|
1673
1673
|
(function(e) {
|
|
1674
|
-
|
|
1674
|
+
pa(t, e);
|
|
1675
1675
|
function t(r) {
|
|
1676
|
-
r === void 0 && (r =
|
|
1677
|
-
var n = e.call(this, typeof r == "number" ?
|
|
1678
|
-
return n.framesToPop = 1, n.name =
|
|
1676
|
+
r === void 0 && (r = ir);
|
|
1677
|
+
var n = e.call(this, typeof r == "number" ? ir + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1678
|
+
return n.framesToPop = 1, n.name = ir, wa(n, t.prototype), n;
|
|
1679
1679
|
}
|
|
1680
1680
|
return t;
|
|
1681
1681
|
})(Error)
|
|
1682
1682
|
);
|
|
1683
|
-
function
|
|
1683
|
+
function st(e, t) {
|
|
1684
1684
|
if (!e)
|
|
1685
1685
|
throw new Vn(t);
|
|
1686
1686
|
}
|
|
1687
1687
|
var Yn = ["debug", "log", "warn", "error", "silent"], ya = Yn.indexOf("log");
|
|
1688
|
-
function
|
|
1688
|
+
function Ht(e) {
|
|
1689
1689
|
return function() {
|
|
1690
1690
|
if (Yn.indexOf(e) >= ya) {
|
|
1691
1691
|
var t = console[e] || console.log;
|
|
@@ -1694,22 +1694,22 @@ function Yt(e) {
|
|
|
1694
1694
|
};
|
|
1695
1695
|
}
|
|
1696
1696
|
(function(e) {
|
|
1697
|
-
e.debug =
|
|
1698
|
-
})(
|
|
1697
|
+
e.debug = Ht("debug"), e.log = Ht("log"), e.warn = Ht("warn"), e.error = Ht("error");
|
|
1698
|
+
})(st || (st = {}));
|
|
1699
1699
|
var Jn = "3.14.0";
|
|
1700
|
-
function
|
|
1700
|
+
function ht(e) {
|
|
1701
1701
|
try {
|
|
1702
1702
|
return e();
|
|
1703
1703
|
} catch {
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
|
-
const
|
|
1706
|
+
const yr = ht(function() {
|
|
1707
1707
|
return globalThis;
|
|
1708
|
-
}) ||
|
|
1708
|
+
}) || ht(function() {
|
|
1709
1709
|
return window;
|
|
1710
|
-
}) ||
|
|
1710
|
+
}) || ht(function() {
|
|
1711
1711
|
return self;
|
|
1712
|
-
}) ||
|
|
1712
|
+
}) || ht(function() {
|
|
1713
1713
|
return global;
|
|
1714
1714
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1715
1715
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1717,13 +1717,13 @@ const br = pt(function() {
|
|
|
1717
1717
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1718
1718
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1719
1719
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1720
|
-
|
|
1721
|
-
return
|
|
1720
|
+
ht(function() {
|
|
1721
|
+
return ht.constructor("return this")();
|
|
1722
1722
|
});
|
|
1723
|
-
var
|
|
1723
|
+
var ln = /* @__PURE__ */ new Map();
|
|
1724
1724
|
function xa(e) {
|
|
1725
|
-
var t =
|
|
1726
|
-
return
|
|
1725
|
+
var t = ln.get(e) || 1;
|
|
1726
|
+
return ln.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
|
|
1727
1727
|
}
|
|
1728
1728
|
function ba(e, t) {
|
|
1729
1729
|
var r = xa("stringifyForDisplay");
|
|
@@ -1731,33 +1731,33 @@ function ba(e, t) {
|
|
|
1731
1731
|
return o === void 0 ? r : o;
|
|
1732
1732
|
}, t).split(JSON.stringify(r)).join("<undefined>");
|
|
1733
1733
|
}
|
|
1734
|
-
function
|
|
1734
|
+
function Vt(e) {
|
|
1735
1735
|
return function(t) {
|
|
1736
1736
|
for (var r = [], n = 1; n < arguments.length; n++)
|
|
1737
1737
|
r[n - 1] = arguments[n];
|
|
1738
1738
|
if (typeof t == "number") {
|
|
1739
1739
|
var o = t;
|
|
1740
|
-
t =
|
|
1740
|
+
t = _r(o), t || (t = Ir(o, r), r = []);
|
|
1741
1741
|
}
|
|
1742
1742
|
e.apply(void 0, [t].concat(r));
|
|
1743
1743
|
};
|
|
1744
1744
|
}
|
|
1745
|
-
var
|
|
1745
|
+
var lr = Object.assign(function(t, r) {
|
|
1746
1746
|
for (var n = [], o = 2; o < arguments.length; o++)
|
|
1747
1747
|
n[o - 2] = arguments[o];
|
|
1748
|
-
t ||
|
|
1748
|
+
t || st(t, _r(r, n) || Ir(r, n));
|
|
1749
1749
|
}, {
|
|
1750
|
-
debug:
|
|
1751
|
-
log:
|
|
1752
|
-
warn:
|
|
1753
|
-
error:
|
|
1750
|
+
debug: Vt(st.debug),
|
|
1751
|
+
log: Vt(st.log),
|
|
1752
|
+
warn: Vt(st.warn),
|
|
1753
|
+
error: Vt(st.error)
|
|
1754
1754
|
});
|
|
1755
1755
|
function Kn(e) {
|
|
1756
1756
|
for (var t = [], r = 1; r < arguments.length; r++)
|
|
1757
1757
|
t[r - 1] = arguments[r];
|
|
1758
|
-
return new Vn(
|
|
1758
|
+
return new Vn(_r(e, t) || Ir(e, t));
|
|
1759
1759
|
}
|
|
1760
|
-
var
|
|
1760
|
+
var cn = Symbol.for("ApolloErrorMessageHandler_" + Jn);
|
|
1761
1761
|
function Wn(e) {
|
|
1762
1762
|
if (typeof e == "string")
|
|
1763
1763
|
return e;
|
|
@@ -1767,11 +1767,11 @@ function Wn(e) {
|
|
|
1767
1767
|
return "<non-serializable>";
|
|
1768
1768
|
}
|
|
1769
1769
|
}
|
|
1770
|
-
function
|
|
1770
|
+
function _r(e, t) {
|
|
1771
1771
|
if (t === void 0 && (t = []), !!e)
|
|
1772
|
-
return
|
|
1772
|
+
return yr[cn] && yr[cn](e, t.map(Wn));
|
|
1773
1773
|
}
|
|
1774
|
-
function
|
|
1774
|
+
function Ir(e, t) {
|
|
1775
1775
|
if (t === void 0 && (t = []), !!e)
|
|
1776
1776
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1777
1777
|
version: Jn,
|
|
@@ -1786,8 +1786,8 @@ function va(e) {
|
|
|
1786
1786
|
return t.name.value;
|
|
1787
1787
|
})[0] || null;
|
|
1788
1788
|
}
|
|
1789
|
-
let
|
|
1790
|
-
const
|
|
1789
|
+
let ce = null;
|
|
1790
|
+
const dn = {};
|
|
1791
1791
|
let ka = 1;
|
|
1792
1792
|
const Sa = () => class {
|
|
1793
1793
|
constructor() {
|
|
@@ -1799,78 +1799,78 @@ const Sa = () => class {
|
|
|
1799
1799
|
].join(":");
|
|
1800
1800
|
}
|
|
1801
1801
|
hasValue() {
|
|
1802
|
-
for (let t =
|
|
1802
|
+
for (let t = ce; t; t = t.parent)
|
|
1803
1803
|
if (this.id in t.slots) {
|
|
1804
1804
|
const r = t.slots[this.id];
|
|
1805
|
-
if (r ===
|
|
1805
|
+
if (r === dn)
|
|
1806
1806
|
break;
|
|
1807
|
-
return t !==
|
|
1807
|
+
return t !== ce && (ce.slots[this.id] = r), !0;
|
|
1808
1808
|
}
|
|
1809
|
-
return
|
|
1809
|
+
return ce && (ce.slots[this.id] = dn), !1;
|
|
1810
1810
|
}
|
|
1811
1811
|
getValue() {
|
|
1812
1812
|
if (this.hasValue())
|
|
1813
|
-
return
|
|
1813
|
+
return ce.slots[this.id];
|
|
1814
1814
|
}
|
|
1815
1815
|
withValue(t, r, n, o) {
|
|
1816
1816
|
const s = {
|
|
1817
1817
|
__proto__: null,
|
|
1818
1818
|
[this.id]: t
|
|
1819
|
-
}, i =
|
|
1820
|
-
|
|
1819
|
+
}, i = ce;
|
|
1820
|
+
ce = { parent: i, slots: s };
|
|
1821
1821
|
try {
|
|
1822
1822
|
return r.apply(o, n);
|
|
1823
1823
|
} finally {
|
|
1824
|
-
|
|
1824
|
+
ce = i;
|
|
1825
1825
|
}
|
|
1826
1826
|
}
|
|
1827
1827
|
// Capture the current context and wrap a callback function so that it
|
|
1828
1828
|
// reestablishes the captured context when called.
|
|
1829
1829
|
static bind(t) {
|
|
1830
|
-
const r =
|
|
1830
|
+
const r = ce;
|
|
1831
1831
|
return function() {
|
|
1832
|
-
const n =
|
|
1832
|
+
const n = ce;
|
|
1833
1833
|
try {
|
|
1834
|
-
return
|
|
1834
|
+
return ce = r, t.apply(this, arguments);
|
|
1835
1835
|
} finally {
|
|
1836
|
-
|
|
1836
|
+
ce = n;
|
|
1837
1837
|
}
|
|
1838
1838
|
};
|
|
1839
1839
|
}
|
|
1840
1840
|
// Immediately run a callback function without any captured context.
|
|
1841
1841
|
static noContext(t, r, n) {
|
|
1842
|
-
if (
|
|
1843
|
-
const o =
|
|
1842
|
+
if (ce) {
|
|
1843
|
+
const o = ce;
|
|
1844
1844
|
try {
|
|
1845
|
-
return
|
|
1845
|
+
return ce = null, t.apply(n, r);
|
|
1846
1846
|
} finally {
|
|
1847
|
-
|
|
1847
|
+
ce = o;
|
|
1848
1848
|
}
|
|
1849
1849
|
} else
|
|
1850
1850
|
return t.apply(n, r);
|
|
1851
1851
|
}
|
|
1852
1852
|
};
|
|
1853
|
-
function
|
|
1853
|
+
function un(e) {
|
|
1854
1854
|
try {
|
|
1855
1855
|
return e();
|
|
1856
1856
|
} catch {
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
|
-
const
|
|
1859
|
+
const cr = "@wry/context:Slot", Na = (
|
|
1860
1860
|
// Prefer globalThis when available.
|
|
1861
1861
|
// https://github.com/benjamn/wryware/issues/347
|
|
1862
|
-
|
|
1862
|
+
un(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1863
1863
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1864
1864
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1865
|
-
|
|
1865
|
+
un(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1866
1866
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1867
1867
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1868
1868
|
/* @__PURE__ */ Object.create(null)
|
|
1869
|
-
),
|
|
1869
|
+
), fn = Na, Pr = fn[cr] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1870
1870
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1871
|
-
Array[
|
|
1871
|
+
Array[cr] || (function(e) {
|
|
1872
1872
|
try {
|
|
1873
|
-
Object.defineProperty(
|
|
1873
|
+
Object.defineProperty(fn, cr, {
|
|
1874
1874
|
value: e,
|
|
1875
1875
|
enumerable: !1,
|
|
1876
1876
|
writable: !1,
|
|
@@ -1885,8 +1885,8 @@ Array[ur] || (function(e) {
|
|
|
1885
1885
|
} finally {
|
|
1886
1886
|
return e;
|
|
1887
1887
|
}
|
|
1888
|
-
})(Sa()), { bind: yi, noContext: xi } =
|
|
1889
|
-
new
|
|
1888
|
+
})(Sa()), { bind: yi, noContext: xi } = Pr;
|
|
1889
|
+
new Pr();
|
|
1890
1890
|
function Ca(e, t) {
|
|
1891
1891
|
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1892
1892
|
if (r) return (r = r.call(e)).next.bind(r);
|
|
@@ -1902,13 +1902,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1902
1902
|
}
|
|
1903
1903
|
function _a(e, t) {
|
|
1904
1904
|
if (e) {
|
|
1905
|
-
if (typeof e == "string") return
|
|
1905
|
+
if (typeof e == "string") return mn(e, t);
|
|
1906
1906
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
1907
1907
|
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
1908
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1908
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return mn(e, t);
|
|
1909
1909
|
}
|
|
1910
1910
|
}
|
|
1911
|
-
function
|
|
1911
|
+
function mn(e, t) {
|
|
1912
1912
|
(t == null || t > e.length) && (t = e.length);
|
|
1913
1913
|
for (var r = 0, n = new Array(t); r < t; r++)
|
|
1914
1914
|
n[r] = e[r];
|
|
@@ -1920,43 +1920,43 @@ function hn(e, t) {
|
|
|
1920
1920
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
1921
1921
|
}
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1923
|
+
function Fr(e, t, r) {
|
|
1924
1924
|
return t && hn(e.prototype, t), r && hn(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
1925
1925
|
}
|
|
1926
|
-
var
|
|
1926
|
+
var Er = function() {
|
|
1927
1927
|
return typeof Symbol == "function";
|
|
1928
|
-
},
|
|
1929
|
-
return
|
|
1930
|
-
},
|
|
1931
|
-
return
|
|
1928
|
+
}, Tr = function(e) {
|
|
1929
|
+
return Er() && !!Symbol[e];
|
|
1930
|
+
}, Ar = function(e) {
|
|
1931
|
+
return Tr(e) ? Symbol[e] : "@@" + e;
|
|
1932
1932
|
};
|
|
1933
|
-
|
|
1934
|
-
var Ia =
|
|
1935
|
-
function
|
|
1933
|
+
Er() && !Tr("observable") && (Symbol.observable = Symbol("observable"));
|
|
1934
|
+
var Ia = Ar("iterator"), xr = Ar("observable"), Qn = Ar("species");
|
|
1935
|
+
function tr(e, t) {
|
|
1936
1936
|
var r = e[t];
|
|
1937
1937
|
if (r != null) {
|
|
1938
1938
|
if (typeof r != "function") throw new TypeError(r + " is not a function");
|
|
1939
1939
|
return r;
|
|
1940
1940
|
}
|
|
1941
1941
|
}
|
|
1942
|
-
function
|
|
1942
|
+
function Et(e) {
|
|
1943
1943
|
var t = e.constructor;
|
|
1944
1944
|
return t !== void 0 && (t = t[Qn], t === null && (t = void 0)), t !== void 0 ? t : we;
|
|
1945
1945
|
}
|
|
1946
1946
|
function Pa(e) {
|
|
1947
1947
|
return e instanceof we;
|
|
1948
1948
|
}
|
|
1949
|
-
function
|
|
1950
|
-
|
|
1949
|
+
function xt(e) {
|
|
1950
|
+
xt.log ? xt.log(e) : setTimeout(function() {
|
|
1951
1951
|
throw e;
|
|
1952
1952
|
});
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1954
|
+
function Jt(e) {
|
|
1955
1955
|
Promise.resolve().then(function() {
|
|
1956
1956
|
try {
|
|
1957
1957
|
e();
|
|
1958
1958
|
} catch (t) {
|
|
1959
|
-
|
|
1959
|
+
xt(t);
|
|
1960
1960
|
}
|
|
1961
1961
|
});
|
|
1962
1962
|
}
|
|
@@ -1967,14 +1967,14 @@ function Gn(e) {
|
|
|
1967
1967
|
if (typeof t == "function")
|
|
1968
1968
|
t();
|
|
1969
1969
|
else {
|
|
1970
|
-
var r =
|
|
1970
|
+
var r = tr(t, "unsubscribe");
|
|
1971
1971
|
r && r.call(t);
|
|
1972
1972
|
}
|
|
1973
1973
|
} catch (n) {
|
|
1974
|
-
|
|
1974
|
+
xt(n);
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function br(e) {
|
|
1978
1978
|
e._observer = void 0, e._queue = void 0, e._state = "closed";
|
|
1979
1979
|
}
|
|
1980
1980
|
function Fa(e) {
|
|
@@ -1989,25 +1989,25 @@ function Xn(e, t, r) {
|
|
|
1989
1989
|
e._state = "running";
|
|
1990
1990
|
var n = e._observer;
|
|
1991
1991
|
try {
|
|
1992
|
-
var o =
|
|
1992
|
+
var o = tr(n, t);
|
|
1993
1993
|
switch (t) {
|
|
1994
1994
|
case "next":
|
|
1995
1995
|
o && o.call(n, r);
|
|
1996
1996
|
break;
|
|
1997
1997
|
case "error":
|
|
1998
|
-
if (
|
|
1998
|
+
if (br(e), o) o.call(n, r);
|
|
1999
1999
|
else throw r;
|
|
2000
2000
|
break;
|
|
2001
2001
|
case "complete":
|
|
2002
|
-
|
|
2002
|
+
br(e), o && o.call(n);
|
|
2003
2003
|
break;
|
|
2004
2004
|
}
|
|
2005
2005
|
} catch (s) {
|
|
2006
|
-
|
|
2006
|
+
xt(s);
|
|
2007
2007
|
}
|
|
2008
2008
|
e._state === "closed" ? Gn(e) : e._state === "running" && (e._state = "ready");
|
|
2009
2009
|
}
|
|
2010
|
-
function
|
|
2010
|
+
function dr(e, t, r) {
|
|
2011
2011
|
if (e._state !== "closed") {
|
|
2012
2012
|
if (e._state === "buffering") {
|
|
2013
2013
|
e._queue.push({
|
|
@@ -2020,7 +2020,7 @@ function fr(e, t, r) {
|
|
|
2020
2020
|
e._state = "buffering", e._queue = [{
|
|
2021
2021
|
type: t,
|
|
2022
2022
|
value: r
|
|
2023
|
-
}],
|
|
2023
|
+
}], Jt(function() {
|
|
2024
2024
|
return Fa(e);
|
|
2025
2025
|
});
|
|
2026
2026
|
return;
|
|
@@ -2041,8 +2041,8 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
var t = e.prototype;
|
|
2043
2043
|
return t.unsubscribe = function() {
|
|
2044
|
-
this._state !== "closed" && (
|
|
2045
|
-
},
|
|
2044
|
+
this._state !== "closed" && (br(this), Gn(this));
|
|
2045
|
+
}, Fr(e, [{
|
|
2046
2046
|
key: "closed",
|
|
2047
2047
|
get: function() {
|
|
2048
2048
|
return this._state === "closed";
|
|
@@ -2054,12 +2054,12 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2054
2054
|
}
|
|
2055
2055
|
var t = e.prototype;
|
|
2056
2056
|
return t.next = function(n) {
|
|
2057
|
-
|
|
2057
|
+
dr(this._subscription, "next", n);
|
|
2058
2058
|
}, t.error = function(n) {
|
|
2059
|
-
|
|
2059
|
+
dr(this._subscription, "error", n);
|
|
2060
2060
|
}, t.complete = function() {
|
|
2061
|
-
|
|
2062
|
-
},
|
|
2061
|
+
dr(this._subscription, "complete");
|
|
2062
|
+
}, Fr(e, [{
|
|
2063
2063
|
key: "closed",
|
|
2064
2064
|
get: function() {
|
|
2065
2065
|
return this._subscription._state === "closed";
|
|
@@ -2089,9 +2089,9 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2089
2089
|
l.unsubscribe(), s();
|
|
2090
2090
|
}
|
|
2091
2091
|
var l = o.subscribe({
|
|
2092
|
-
next: function(
|
|
2092
|
+
next: function(p) {
|
|
2093
2093
|
try {
|
|
2094
|
-
n(
|
|
2094
|
+
n(p, c);
|
|
2095
2095
|
} catch (g) {
|
|
2096
2096
|
i(g), l.unsubscribe();
|
|
2097
2097
|
}
|
|
@@ -2103,7 +2103,7 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2103
2103
|
}, t.map = function(n) {
|
|
2104
2104
|
var o = this;
|
|
2105
2105
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2106
|
-
var s =
|
|
2106
|
+
var s = Et(this);
|
|
2107
2107
|
return new s(function(i) {
|
|
2108
2108
|
return o.subscribe({
|
|
2109
2109
|
next: function(c) {
|
|
@@ -2125,7 +2125,7 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2125
2125
|
}, t.filter = function(n) {
|
|
2126
2126
|
var o = this;
|
|
2127
2127
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2128
|
-
var s =
|
|
2128
|
+
var s = Et(this);
|
|
2129
2129
|
return new s(function(i) {
|
|
2130
2130
|
return o.subscribe({
|
|
2131
2131
|
next: function(c) {
|
|
@@ -2147,37 +2147,37 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2147
2147
|
}, t.reduce = function(n) {
|
|
2148
2148
|
var o = this;
|
|
2149
2149
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2150
|
-
var s =
|
|
2150
|
+
var s = Et(this), i = arguments.length > 1, c = !1, l = arguments[1], p = l;
|
|
2151
2151
|
return new s(function(g) {
|
|
2152
2152
|
return o.subscribe({
|
|
2153
2153
|
next: function(y) {
|
|
2154
2154
|
var x = !c;
|
|
2155
2155
|
if (c = !0, !x || i)
|
|
2156
2156
|
try {
|
|
2157
|
-
|
|
2157
|
+
p = n(p, y);
|
|
2158
2158
|
} catch (I) {
|
|
2159
2159
|
return g.error(I);
|
|
2160
2160
|
}
|
|
2161
2161
|
else
|
|
2162
|
-
|
|
2162
|
+
p = y;
|
|
2163
2163
|
},
|
|
2164
2164
|
error: function(y) {
|
|
2165
2165
|
g.error(y);
|
|
2166
2166
|
},
|
|
2167
2167
|
complete: function() {
|
|
2168
2168
|
if (!c && !i) return g.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2169
|
-
g.next(
|
|
2169
|
+
g.next(p), g.complete();
|
|
2170
2170
|
}
|
|
2171
2171
|
});
|
|
2172
2172
|
});
|
|
2173
2173
|
}, t.concat = function() {
|
|
2174
2174
|
for (var n = this, o = arguments.length, s = new Array(o), i = 0; i < o; i++)
|
|
2175
2175
|
s[i] = arguments[i];
|
|
2176
|
-
var c =
|
|
2176
|
+
var c = Et(this);
|
|
2177
2177
|
return new c(function(l) {
|
|
2178
|
-
var
|
|
2178
|
+
var p, g = 0;
|
|
2179
2179
|
function y(x) {
|
|
2180
|
-
|
|
2180
|
+
p = x.subscribe({
|
|
2181
2181
|
next: function(I) {
|
|
2182
2182
|
l.next(I);
|
|
2183
2183
|
},
|
|
@@ -2185,18 +2185,18 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2185
2185
|
l.error(I);
|
|
2186
2186
|
},
|
|
2187
2187
|
complete: function() {
|
|
2188
|
-
g === s.length ? (
|
|
2188
|
+
g === s.length ? (p = void 0, l.complete()) : y(c.from(s[g++]));
|
|
2189
2189
|
}
|
|
2190
2190
|
});
|
|
2191
2191
|
}
|
|
2192
2192
|
return y(n), function() {
|
|
2193
|
-
|
|
2193
|
+
p && (p.unsubscribe(), p = void 0);
|
|
2194
2194
|
};
|
|
2195
2195
|
});
|
|
2196
2196
|
}, t.flatMap = function(n) {
|
|
2197
2197
|
var o = this;
|
|
2198
2198
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2199
|
-
var s =
|
|
2199
|
+
var s = Et(this);
|
|
2200
2200
|
return new s(function(i) {
|
|
2201
2201
|
var c = [], l = o.subscribe({
|
|
2202
2202
|
next: function(g) {
|
|
@@ -2215,7 +2215,7 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2215
2215
|
},
|
|
2216
2216
|
complete: function() {
|
|
2217
2217
|
var x = c.indexOf(y);
|
|
2218
|
-
x >= 0 && c.splice(x, 1),
|
|
2218
|
+
x >= 0 && c.splice(x, 1), p();
|
|
2219
2219
|
}
|
|
2220
2220
|
});
|
|
2221
2221
|
c.push(y);
|
|
@@ -2224,10 +2224,10 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2224
2224
|
i.error(g);
|
|
2225
2225
|
},
|
|
2226
2226
|
complete: function() {
|
|
2227
|
-
|
|
2227
|
+
p();
|
|
2228
2228
|
}
|
|
2229
2229
|
});
|
|
2230
|
-
function
|
|
2230
|
+
function p() {
|
|
2231
2231
|
l.closed && c.length === 0 && i.complete();
|
|
2232
2232
|
}
|
|
2233
2233
|
return function() {
|
|
@@ -2236,12 +2236,12 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2236
2236
|
}), l.unsubscribe();
|
|
2237
2237
|
};
|
|
2238
2238
|
});
|
|
2239
|
-
}, t[
|
|
2239
|
+
}, t[xr] = function() {
|
|
2240
2240
|
return this;
|
|
2241
2241
|
}, e.from = function(n) {
|
|
2242
2242
|
var o = typeof this == "function" ? this : e;
|
|
2243
2243
|
if (n == null) throw new TypeError(n + " is not an object");
|
|
2244
|
-
var s =
|
|
2244
|
+
var s = tr(n, xr);
|
|
2245
2245
|
if (s) {
|
|
2246
2246
|
var i = s.call(n);
|
|
2247
2247
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
@@ -2249,12 +2249,12 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2249
2249
|
return i.subscribe(c);
|
|
2250
2250
|
});
|
|
2251
2251
|
}
|
|
2252
|
-
if (
|
|
2252
|
+
if (Tr("iterator") && (s = tr(n, Ia), s))
|
|
2253
2253
|
return new o(function(c) {
|
|
2254
|
-
|
|
2254
|
+
Jt(function() {
|
|
2255
2255
|
if (!c.closed) {
|
|
2256
|
-
for (var l = Ca(s.call(n)),
|
|
2257
|
-
var g =
|
|
2256
|
+
for (var l = Ca(s.call(n)), p; !(p = l()).done; ) {
|
|
2257
|
+
var g = p.value;
|
|
2258
2258
|
if (c.next(g), c.closed) return;
|
|
2259
2259
|
}
|
|
2260
2260
|
c.complete();
|
|
@@ -2263,7 +2263,7 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2263
2263
|
});
|
|
2264
2264
|
if (Array.isArray(n))
|
|
2265
2265
|
return new o(function(c) {
|
|
2266
|
-
|
|
2266
|
+
Jt(function() {
|
|
2267
2267
|
if (!c.closed) {
|
|
2268
2268
|
for (var l = 0; l < n.length; ++l)
|
|
2269
2269
|
if (c.next(n[l]), c.closed) return;
|
|
@@ -2277,7 +2277,7 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2277
2277
|
o[s] = arguments[s];
|
|
2278
2278
|
var i = typeof this == "function" ? this : e;
|
|
2279
2279
|
return new i(function(c) {
|
|
2280
|
-
|
|
2280
|
+
Jt(function() {
|
|
2281
2281
|
if (!c.closed) {
|
|
2282
2282
|
for (var l = 0; l < o.length; ++l)
|
|
2283
2283
|
if (c.next(o[l]), c.closed) return;
|
|
@@ -2285,17 +2285,17 @@ var Ea = /* @__PURE__ */ (function() {
|
|
|
2285
2285
|
}
|
|
2286
2286
|
});
|
|
2287
2287
|
});
|
|
2288
|
-
},
|
|
2288
|
+
}, Fr(e, null, [{
|
|
2289
2289
|
key: Qn,
|
|
2290
2290
|
get: function() {
|
|
2291
2291
|
return this;
|
|
2292
2292
|
}
|
|
2293
2293
|
}]), e;
|
|
2294
2294
|
})();
|
|
2295
|
-
|
|
2295
|
+
Er() && Object.defineProperty(we, Symbol("extensions"), {
|
|
2296
2296
|
value: {
|
|
2297
|
-
symbol:
|
|
2298
|
-
hostReportError:
|
|
2297
|
+
symbol: xr,
|
|
2298
|
+
hostReportError: xt
|
|
2299
2299
|
},
|
|
2300
2300
|
configurable: !0
|
|
2301
2301
|
});
|
|
@@ -2315,11 +2315,11 @@ function Aa(e) {
|
|
|
2315
2315
|
t = "@@observable";
|
|
2316
2316
|
return t;
|
|
2317
2317
|
}
|
|
2318
|
-
var
|
|
2319
|
-
typeof self < "u" ?
|
|
2320
|
-
Aa(
|
|
2321
|
-
var
|
|
2322
|
-
gn
|
|
2318
|
+
var wt;
|
|
2319
|
+
typeof self < "u" ? wt = self : typeof window < "u" ? wt = window : typeof global < "u" ? wt = global : typeof module < "u" ? wt = module : wt = Function("return this")();
|
|
2320
|
+
Aa(wt);
|
|
2321
|
+
var pn = we.prototype, gn = "@@observable";
|
|
2322
|
+
pn[gn] || (pn[gn] = function() {
|
|
2323
2323
|
return this;
|
|
2324
2324
|
});
|
|
2325
2325
|
function Oa(e) {
|
|
@@ -2359,20 +2359,20 @@ function $a(e) {
|
|
|
2359
2359
|
};
|
|
2360
2360
|
return t.operationName || (t.operationName = typeof t.query != "string" ? va(t.query) || void 0 : ""), t;
|
|
2361
2361
|
}
|
|
2362
|
-
var La = Symbol.for("apollo.deprecations"), za =
|
|
2362
|
+
var La = Symbol.for("apollo.deprecations"), za = yr, Da = new Pr();
|
|
2363
2363
|
function Ma(e) {
|
|
2364
2364
|
return za[La] || (Da.getValue() || []).includes(e);
|
|
2365
2365
|
}
|
|
2366
2366
|
function Ba(e, t) {
|
|
2367
2367
|
Ma(e) || t();
|
|
2368
2368
|
}
|
|
2369
|
-
function
|
|
2369
|
+
function wn(e, t) {
|
|
2370
2370
|
return t ? t(e) : we.of();
|
|
2371
2371
|
}
|
|
2372
|
-
function
|
|
2372
|
+
function Tt(e) {
|
|
2373
2373
|
return typeof e == "function" ? new Zn(e) : e;
|
|
2374
2374
|
}
|
|
2375
|
-
function
|
|
2375
|
+
function Yt(e) {
|
|
2376
2376
|
return e.request.length <= 1;
|
|
2377
2377
|
}
|
|
2378
2378
|
var Zn = (
|
|
@@ -2386,12 +2386,12 @@ var Zn = (
|
|
|
2386
2386
|
return we.of();
|
|
2387
2387
|
});
|
|
2388
2388
|
}, e.from = function(t) {
|
|
2389
|
-
return t.length === 0 ? e.empty() : t.map(
|
|
2389
|
+
return t.length === 0 ? e.empty() : t.map(Tt).reduce(function(r, n) {
|
|
2390
2390
|
return r.concat(n);
|
|
2391
2391
|
});
|
|
2392
2392
|
}, e.split = function(t, r, n) {
|
|
2393
|
-
var o =
|
|
2394
|
-
return
|
|
2393
|
+
var o = Tt(r), s = Tt(n || new e(wn)), i;
|
|
2394
|
+
return Yt(o) && Yt(s) ? i = new e(function(c) {
|
|
2395
2395
|
return t(c) ? o.request(c) || we.of() : s.request(c) || we.of();
|
|
2396
2396
|
}) : i = new e(function(c, l) {
|
|
2397
2397
|
return t(c) ? o.request(c, l) || we.of() : s.request(c, l) || we.of();
|
|
@@ -2399,11 +2399,11 @@ var Zn = (
|
|
|
2399
2399
|
}, e.execute = function(t, r) {
|
|
2400
2400
|
return t.request(ja(r.context, $a(Oa(r)))) || we.of();
|
|
2401
2401
|
}, e.concat = function(t, r) {
|
|
2402
|
-
var n =
|
|
2403
|
-
if (
|
|
2404
|
-
return globalThis.__DEV__ !== !1 &&
|
|
2405
|
-
var o =
|
|
2406
|
-
return
|
|
2402
|
+
var n = Tt(t);
|
|
2403
|
+
if (Yt(n))
|
|
2404
|
+
return globalThis.__DEV__ !== !1 && lr.warn(47, n), n;
|
|
2405
|
+
var o = Tt(r), s;
|
|
2406
|
+
return Yt(o) ? s = new e(function(i) {
|
|
2407
2407
|
return n.request(i, function(c) {
|
|
2408
2408
|
return o.request(c) || we.of();
|
|
2409
2409
|
}) || we.of();
|
|
@@ -2413,19 +2413,19 @@ var Zn = (
|
|
|
2413
2413
|
}) || we.of();
|
|
2414
2414
|
}), Object.assign(s, { left: n, right: o });
|
|
2415
2415
|
}, e.prototype.split = function(t, r, n) {
|
|
2416
|
-
return this.concat(e.split(t, r, n || new e(
|
|
2416
|
+
return this.concat(e.split(t, r, n || new e(wn)));
|
|
2417
2417
|
}, e.prototype.concat = function(t) {
|
|
2418
2418
|
return e.concat(this, t);
|
|
2419
2419
|
}, e.prototype.request = function(t, r) {
|
|
2420
2420
|
throw Kn(48);
|
|
2421
2421
|
}, e.prototype.onError = function(t, r) {
|
|
2422
2422
|
if (globalThis.__DEV__ !== !1 && Ba("onError", function() {
|
|
2423
|
-
globalThis.__DEV__ !== !1 &&
|
|
2423
|
+
globalThis.__DEV__ !== !1 && lr.warn(49);
|
|
2424
2424
|
}), r && r.error)
|
|
2425
2425
|
return r.error(t), !1;
|
|
2426
2426
|
throw t;
|
|
2427
2427
|
}, e.prototype.setOnError = function(t) {
|
|
2428
|
-
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 &&
|
|
2428
|
+
return globalThis.__DEV__ !== !1 && globalThis.__DEV__ !== !1 && lr.warn(50), this.onError = t, this;
|
|
2429
2429
|
}, e;
|
|
2430
2430
|
})()
|
|
2431
2431
|
);
|
|
@@ -2451,7 +2451,7 @@ function Ua(e) {
|
|
|
2451
2451
|
const qa = async () => {
|
|
2452
2452
|
const e = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2453
2453
|
try {
|
|
2454
|
-
const o = await
|
|
2454
|
+
const o = await ue.post(
|
|
2455
2455
|
e,
|
|
2456
2456
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2457
2457
|
// Only grant_type in body
|
|
@@ -2464,7 +2464,7 @@ const qa = async () => {
|
|
|
2464
2464
|
);
|
|
2465
2465
|
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
2466
2466
|
} catch (o) {
|
|
2467
|
-
return
|
|
2467
|
+
return ue.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
2468
2468
|
}
|
|
2469
2469
|
}, Ra = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Ha = Uo({
|
|
2470
2470
|
uri: `${Ra}`
|
|
@@ -2486,7 +2486,7 @@ const qa = async () => {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
}), bi = (e) => {
|
|
2488
2488
|
const { tanyaConfig: t } = e;
|
|
2489
|
-
return /* @__PURE__ */ a(Ho, { client: Ya, children: /* @__PURE__ */ a(ta, { children: /* @__PURE__ */ a(
|
|
2489
|
+
return /* @__PURE__ */ a(Ho, { client: Ya, children: /* @__PURE__ */ a(ta, { children: /* @__PURE__ */ a(ha, { tanyaConfig: t }) }) });
|
|
2490
2490
|
};
|
|
2491
2491
|
function Ja(e, t) {
|
|
2492
2492
|
const r = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
@@ -2506,15 +2506,15 @@ const eo = Object.freeze({
|
|
|
2506
2506
|
top: 0,
|
|
2507
2507
|
width: 16,
|
|
2508
2508
|
height: 16
|
|
2509
|
-
}),
|
|
2509
|
+
}), rr = Object.freeze({
|
|
2510
2510
|
rotate: 0,
|
|
2511
2511
|
vFlip: !1,
|
|
2512
2512
|
hFlip: !1
|
|
2513
|
-
}),
|
|
2513
|
+
}), Or = Object.freeze({
|
|
2514
2514
|
...eo,
|
|
2515
|
-
...
|
|
2516
|
-
}),
|
|
2517
|
-
|
|
2515
|
+
...rr
|
|
2516
|
+
}), vr = Object.freeze({
|
|
2517
|
+
...Or,
|
|
2518
2518
|
body: "",
|
|
2519
2519
|
hidden: !1
|
|
2520
2520
|
});
|
|
@@ -2524,18 +2524,18 @@ function Ka(e, t) {
|
|
|
2524
2524
|
const n = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
2525
2525
|
return n && (r.rotate = n), r;
|
|
2526
2526
|
}
|
|
2527
|
-
function
|
|
2527
|
+
function yn(e, t) {
|
|
2528
2528
|
const r = Ka(e, t);
|
|
2529
|
-
for (const n in
|
|
2529
|
+
for (const n in vr) n in rr ? n in e && !(n in r) && (r[n] = rr[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
|
|
2530
2530
|
return r;
|
|
2531
2531
|
}
|
|
2532
2532
|
function Wa(e, t, r) {
|
|
2533
2533
|
const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
2534
2534
|
let s = {};
|
|
2535
2535
|
function i(c) {
|
|
2536
|
-
s =
|
|
2536
|
+
s = yn(n[c] || o[c], s);
|
|
2537
2537
|
}
|
|
2538
|
-
return i(t), r.forEach(i),
|
|
2538
|
+
return i(t), r.forEach(i), yn(e, s);
|
|
2539
2539
|
}
|
|
2540
2540
|
function to(e, t) {
|
|
2541
2541
|
const r = [];
|
|
@@ -2556,27 +2556,27 @@ const Qa = {
|
|
|
2556
2556
|
not_found: {},
|
|
2557
2557
|
...eo
|
|
2558
2558
|
};
|
|
2559
|
-
function
|
|
2559
|
+
function ur(e, t) {
|
|
2560
2560
|
for (const r in t) if (r in e && typeof e[r] != typeof t[r]) return !1;
|
|
2561
2561
|
return !0;
|
|
2562
2562
|
}
|
|
2563
2563
|
function ro(e) {
|
|
2564
2564
|
if (typeof e != "object" || e === null) return null;
|
|
2565
2565
|
const t = e;
|
|
2566
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !
|
|
2566
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !ur(e, Qa)) return null;
|
|
2567
2567
|
const r = t.icons;
|
|
2568
2568
|
for (const o in r) {
|
|
2569
2569
|
const s = r[o];
|
|
2570
|
-
if (!o || typeof s.body != "string" || !
|
|
2570
|
+
if (!o || typeof s.body != "string" || !ur(s, vr)) return null;
|
|
2571
2571
|
}
|
|
2572
2572
|
const n = t.aliases || /* @__PURE__ */ Object.create(null);
|
|
2573
2573
|
for (const o in n) {
|
|
2574
2574
|
const s = n[o], i = s.parent;
|
|
2575
|
-
if (!o || typeof i != "string" || !r[i] && !n[i] || !
|
|
2575
|
+
if (!o || typeof i != "string" || !r[i] && !n[i] || !ur(s, vr)) return null;
|
|
2576
2576
|
}
|
|
2577
2577
|
return t;
|
|
2578
2578
|
}
|
|
2579
|
-
const
|
|
2579
|
+
const xn = /* @__PURE__ */ Object.create(null);
|
|
2580
2580
|
function Ga(e, t) {
|
|
2581
2581
|
return {
|
|
2582
2582
|
provider: e,
|
|
@@ -2585,8 +2585,8 @@ function Ga(e, t) {
|
|
|
2585
2585
|
missing: /* @__PURE__ */ new Set()
|
|
2586
2586
|
};
|
|
2587
2587
|
}
|
|
2588
|
-
function
|
|
2589
|
-
const r =
|
|
2588
|
+
function bt(e, t) {
|
|
2589
|
+
const r = xn[e] || (xn[e] = /* @__PURE__ */ Object.create(null));
|
|
2590
2590
|
return r[t] || (r[t] = Ga(e, t));
|
|
2591
2591
|
}
|
|
2592
2592
|
function no(e, t) {
|
|
@@ -2602,7 +2602,7 @@ function Xa(e, t, r) {
|
|
|
2602
2602
|
}
|
|
2603
2603
|
return !1;
|
|
2604
2604
|
}
|
|
2605
|
-
const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/,
|
|
2605
|
+
const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, nr = (e, t, r, n = "") => {
|
|
2606
2606
|
const o = e.split(":");
|
|
2607
2607
|
if (e.slice(0, 1) === "@") {
|
|
2608
2608
|
if (o.length < 2 || o.length > 3) return null;
|
|
@@ -2610,12 +2610,12 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
|
|
|
2610
2610
|
}
|
|
2611
2611
|
if (o.length > 3 || !o.length) return null;
|
|
2612
2612
|
if (o.length > 1) {
|
|
2613
|
-
const c = o.pop(), l = o.pop(),
|
|
2613
|
+
const c = o.pop(), l = o.pop(), p = {
|
|
2614
2614
|
provider: o.length > 0 ? o[0] : n,
|
|
2615
2615
|
prefix: l,
|
|
2616
2616
|
name: c
|
|
2617
2617
|
};
|
|
2618
|
-
return t && !
|
|
2618
|
+
return t && !Kt(p) ? null : p;
|
|
2619
2619
|
}
|
|
2620
2620
|
const s = o[0], i = s.split("-");
|
|
2621
2621
|
if (i.length > 1) {
|
|
@@ -2624,7 +2624,7 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
|
|
|
2624
2624
|
prefix: i.shift(),
|
|
2625
2625
|
name: i.join("-")
|
|
2626
2626
|
};
|
|
2627
|
-
return t && !
|
|
2627
|
+
return t && !Kt(c) ? null : c;
|
|
2628
2628
|
}
|
|
2629
2629
|
if (r && n === "") {
|
|
2630
2630
|
const c = {
|
|
@@ -2632,41 +2632,41 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
|
|
|
2632
2632
|
prefix: "",
|
|
2633
2633
|
name: s
|
|
2634
2634
|
};
|
|
2635
|
-
return t && !
|
|
2635
|
+
return t && !Kt(c, r) ? null : c;
|
|
2636
2636
|
}
|
|
2637
2637
|
return null;
|
|
2638
|
-
},
|
|
2639
|
-
let
|
|
2638
|
+
}, Kt = (e, t) => e ? !!((t && e.prefix === "" || e.prefix) && e.name) : !1;
|
|
2639
|
+
let zt = !1;
|
|
2640
2640
|
function ao(e) {
|
|
2641
|
-
return typeof e == "boolean" && (
|
|
2641
|
+
return typeof e == "boolean" && (zt = e), zt;
|
|
2642
2642
|
}
|
|
2643
|
-
function
|
|
2644
|
-
const t = typeof e == "string" ?
|
|
2643
|
+
function bn(e) {
|
|
2644
|
+
const t = typeof e == "string" ? nr(e, !0, zt) : e;
|
|
2645
2645
|
if (t) {
|
|
2646
|
-
const r =
|
|
2646
|
+
const r = bt(t.provider, t.prefix), n = t.name;
|
|
2647
2647
|
return r.icons[n] || (r.missing.has(n) ? null : void 0);
|
|
2648
2648
|
}
|
|
2649
2649
|
}
|
|
2650
2650
|
function Za(e, t) {
|
|
2651
|
-
const r =
|
|
2651
|
+
const r = nr(e, !0, zt);
|
|
2652
2652
|
if (!r) return !1;
|
|
2653
|
-
const n =
|
|
2653
|
+
const n = bt(r.provider, r.prefix);
|
|
2654
2654
|
return t ? Xa(n, r.name, t) : (n.missing.add(r.name), !0);
|
|
2655
2655
|
}
|
|
2656
2656
|
function es(e, t) {
|
|
2657
2657
|
if (typeof e != "object") return !1;
|
|
2658
|
-
if (typeof t != "string" && (t = e.provider || ""),
|
|
2658
|
+
if (typeof t != "string" && (t = e.provider || ""), zt && !t && !e.prefix) {
|
|
2659
2659
|
let o = !1;
|
|
2660
2660
|
return ro(e) && (e.prefix = "", to(e, (s, i) => {
|
|
2661
2661
|
Za(s, i) && (o = !0);
|
|
2662
2662
|
})), o;
|
|
2663
2663
|
}
|
|
2664
2664
|
const r = e.prefix;
|
|
2665
|
-
if (!
|
|
2665
|
+
if (!Kt({
|
|
2666
2666
|
prefix: r,
|
|
2667
2667
|
name: "a"
|
|
2668
2668
|
})) return !1;
|
|
2669
|
-
const n =
|
|
2669
|
+
const n = bt(t, r);
|
|
2670
2670
|
return !!no(n, e);
|
|
2671
2671
|
}
|
|
2672
2672
|
const so = Object.freeze({
|
|
@@ -2674,9 +2674,9 @@ const so = Object.freeze({
|
|
|
2674
2674
|
height: null
|
|
2675
2675
|
}), io = Object.freeze({
|
|
2676
2676
|
...so,
|
|
2677
|
-
...
|
|
2677
|
+
...rr
|
|
2678
2678
|
}), ts = /(-?[0-9.]*[0-9]+[0-9.]*)/g, rs = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
2679
|
-
function
|
|
2679
|
+
function vn(e, t, r) {
|
|
2680
2680
|
if (t === 1) return e;
|
|
2681
2681
|
if (r = r || 100, typeof e == "number") return Math.ceil(e * t * r) / r;
|
|
2682
2682
|
if (typeof e != "string") return e;
|
|
@@ -2718,7 +2718,7 @@ function as(e, t, r) {
|
|
|
2718
2718
|
const ss = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
2719
2719
|
function is(e, t) {
|
|
2720
2720
|
const r = {
|
|
2721
|
-
|
|
2721
|
+
...Or,
|
|
2722
2722
|
...e
|
|
2723
2723
|
}, n = {
|
|
2724
2724
|
...io,
|
|
@@ -2730,9 +2730,9 @@ function is(e, t) {
|
|
|
2730
2730
|
height: r.height
|
|
2731
2731
|
};
|
|
2732
2732
|
let s = r.body;
|
|
2733
|
-
[r, n].forEach((
|
|
2734
|
-
const k = [], P =
|
|
2735
|
-
let q =
|
|
2733
|
+
[r, n].forEach((T) => {
|
|
2734
|
+
const k = [], P = T.hFlip, J = T.vFlip;
|
|
2735
|
+
let q = T.rotate;
|
|
2736
2736
|
P ? J ? q += 2 : (k.push("translate(" + (o.width + o.left).toString() + " " + (0 - o.top).toString() + ")"), k.push("scale(-1 1)"), o.top = o.left = 0) : J && (k.push("translate(" + (0 - o.left).toString() + " " + (o.height + o.top).toString() + ")"), k.push("scale(1 -1)"), o.top = o.left = 0);
|
|
2737
2737
|
let Y;
|
|
2738
2738
|
switch (q < 0 && (q -= Math.floor(q / 4) * 4), q = q % 4, q) {
|
|
@@ -2748,18 +2748,18 @@ function is(e, t) {
|
|
|
2748
2748
|
}
|
|
2749
2749
|
q % 2 === 1 && (o.left !== o.top && (Y = o.left, o.left = o.top, o.top = Y), o.width !== o.height && (Y = o.width, o.width = o.height, o.height = Y)), k.length && (s = as(s, '<g transform="' + k.join(" ") + '">', "</g>"));
|
|
2750
2750
|
});
|
|
2751
|
-
const i = n.width, c = n.height, l = o.width,
|
|
2751
|
+
const i = n.width, c = n.height, l = o.width, p = o.height;
|
|
2752
2752
|
let g, y;
|
|
2753
|
-
i === null ? (y = c === null ? "1em" : c === "auto" ?
|
|
2754
|
-
const x = {}, I = (
|
|
2755
|
-
ss(k) || (x[
|
|
2753
|
+
i === null ? (y = c === null ? "1em" : c === "auto" ? p : c, g = vn(y, l / p)) : (g = i === "auto" ? l : i, y = c === null ? vn(g, p / l) : c === "auto" ? p : c);
|
|
2754
|
+
const x = {}, I = (T, k) => {
|
|
2755
|
+
ss(k) || (x[T] = k.toString());
|
|
2756
2756
|
};
|
|
2757
2757
|
I("width", g), I("height", y);
|
|
2758
2758
|
const S = [
|
|
2759
2759
|
o.left,
|
|
2760
2760
|
o.top,
|
|
2761
2761
|
l,
|
|
2762
|
-
|
|
2762
|
+
p
|
|
2763
2763
|
];
|
|
2764
2764
|
return x.viewBox = S.join(" "), {
|
|
2765
2765
|
attributes: x,
|
|
@@ -2780,14 +2780,14 @@ function us(e, t = cs) {
|
|
|
2780
2780
|
e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
2781
2781
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
2782
2782
|
}
|
|
2783
|
-
const
|
|
2783
|
+
const kr = /* @__PURE__ */ Object.create(null);
|
|
2784
2784
|
function fs(e, t) {
|
|
2785
|
-
|
|
2785
|
+
kr[e] = t;
|
|
2786
2786
|
}
|
|
2787
|
-
function
|
|
2788
|
-
return
|
|
2787
|
+
function Sr(e) {
|
|
2788
|
+
return kr[e] || kr[""];
|
|
2789
2789
|
}
|
|
2790
|
-
function
|
|
2790
|
+
function jr(e) {
|
|
2791
2791
|
let t;
|
|
2792
2792
|
if (typeof e.resources == "string") t = [e.resources];
|
|
2793
2793
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -2802,26 +2802,26 @@ function Lr(e) {
|
|
|
2802
2802
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
2803
2803
|
};
|
|
2804
2804
|
}
|
|
2805
|
-
const
|
|
2806
|
-
for (;
|
|
2807
|
-
|
|
2805
|
+
const $r = /* @__PURE__ */ Object.create(null), At = ["https://api.simplesvg.com", "https://api.unisvg.com"], Wt = [];
|
|
2806
|
+
for (; At.length > 0; ) At.length === 1 || Math.random() > 0.5 ? Wt.push(At.shift()) : Wt.push(At.pop());
|
|
2807
|
+
$r[""] = jr({ resources: ["https://api.iconify.design"].concat(Wt) });
|
|
2808
2808
|
function ms(e, t) {
|
|
2809
|
-
const r =
|
|
2810
|
-
return r === null ? !1 : (
|
|
2809
|
+
const r = jr(t);
|
|
2810
|
+
return r === null ? !1 : ($r[e] = r, !0);
|
|
2811
2811
|
}
|
|
2812
|
-
function
|
|
2813
|
-
return
|
|
2812
|
+
function Lr(e) {
|
|
2813
|
+
return $r[e];
|
|
2814
2814
|
}
|
|
2815
|
-
const
|
|
2815
|
+
const hs = () => {
|
|
2816
2816
|
let e;
|
|
2817
2817
|
try {
|
|
2818
2818
|
if (e = fetch, typeof e == "function") return e;
|
|
2819
2819
|
} catch {
|
|
2820
2820
|
}
|
|
2821
2821
|
};
|
|
2822
|
-
let
|
|
2823
|
-
function
|
|
2824
|
-
const r =
|
|
2822
|
+
let kn = hs();
|
|
2823
|
+
function ps(e, t) {
|
|
2824
|
+
const r = Lr(e);
|
|
2825
2825
|
if (!r) return 0;
|
|
2826
2826
|
let n;
|
|
2827
2827
|
if (!r.maxURL) n = 0;
|
|
@@ -2839,15 +2839,15 @@ function gs(e) {
|
|
|
2839
2839
|
return e === 404;
|
|
2840
2840
|
}
|
|
2841
2841
|
const ws = (e, t, r) => {
|
|
2842
|
-
const n = [], o =
|
|
2842
|
+
const n = [], o = ps(e, t), s = "icons";
|
|
2843
2843
|
let i = {
|
|
2844
2844
|
type: s,
|
|
2845
2845
|
provider: e,
|
|
2846
2846
|
prefix: t,
|
|
2847
2847
|
icons: []
|
|
2848
2848
|
}, c = 0;
|
|
2849
|
-
return r.forEach((l,
|
|
2850
|
-
c += l.length + 1, c >= o &&
|
|
2849
|
+
return r.forEach((l, p) => {
|
|
2850
|
+
c += l.length + 1, c >= o && p > 0 && (n.push(i), i = {
|
|
2851
2851
|
type: s,
|
|
2852
2852
|
provider: e,
|
|
2853
2853
|
prefix: t,
|
|
@@ -2857,13 +2857,13 @@ const ws = (e, t, r) => {
|
|
|
2857
2857
|
};
|
|
2858
2858
|
function ys(e) {
|
|
2859
2859
|
if (typeof e == "string") {
|
|
2860
|
-
const t =
|
|
2860
|
+
const t = Lr(e);
|
|
2861
2861
|
if (t) return t.path;
|
|
2862
2862
|
}
|
|
2863
2863
|
return "/";
|
|
2864
2864
|
}
|
|
2865
2865
|
const xs = (e, t, r) => {
|
|
2866
|
-
if (!
|
|
2866
|
+
if (!kn) {
|
|
2867
2867
|
r("abort", 424);
|
|
2868
2868
|
return;
|
|
2869
2869
|
}
|
|
@@ -2884,7 +2884,7 @@ const xs = (e, t, r) => {
|
|
|
2884
2884
|
return;
|
|
2885
2885
|
}
|
|
2886
2886
|
let o = 503;
|
|
2887
|
-
|
|
2887
|
+
kn(e + n).then((s) => {
|
|
2888
2888
|
const i = s.status;
|
|
2889
2889
|
if (i !== 200) {
|
|
2890
2890
|
setTimeout(() => {
|
|
@@ -2927,16 +2927,16 @@ function vs(e) {
|
|
|
2927
2927
|
const i = s.icons, c = i.pending.length;
|
|
2928
2928
|
i.pending = i.pending.filter((l) => {
|
|
2929
2929
|
if (l.prefix !== o) return !0;
|
|
2930
|
-
const
|
|
2931
|
-
if (e.icons[
|
|
2930
|
+
const p = l.name;
|
|
2931
|
+
if (e.icons[p]) i.loaded.push({
|
|
2932
2932
|
provider: n,
|
|
2933
2933
|
prefix: o,
|
|
2934
|
-
name:
|
|
2934
|
+
name: p
|
|
2935
2935
|
});
|
|
2936
|
-
else if (e.missing.has(
|
|
2936
|
+
else if (e.missing.has(p)) i.missing.push({
|
|
2937
2937
|
provider: n,
|
|
2938
2938
|
prefix: o,
|
|
2939
|
-
name:
|
|
2939
|
+
name: p
|
|
2940
2940
|
});
|
|
2941
2941
|
else
|
|
2942
2942
|
return r = !0, !0;
|
|
@@ -2974,9 +2974,9 @@ function Ns(e) {
|
|
|
2974
2974
|
return e.forEach((o) => {
|
|
2975
2975
|
if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
|
|
2976
2976
|
n = o;
|
|
2977
|
-
const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)),
|
|
2977
|
+
const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), p = l[i] || (l[i] = bt(s, i));
|
|
2978
2978
|
let g;
|
|
2979
|
-
c in
|
|
2979
|
+
c in p.icons ? g = t.loaded : i === "" || p.missing.has(c) ? g = t.missing : g = t.pending;
|
|
2980
2980
|
const y = {
|
|
2981
2981
|
provider: s,
|
|
2982
2982
|
prefix: i,
|
|
@@ -2988,7 +2988,7 @@ function Ns(e) {
|
|
|
2988
2988
|
function Cs(e, t = !0, r = !1) {
|
|
2989
2989
|
const n = [];
|
|
2990
2990
|
return e.forEach((o) => {
|
|
2991
|
-
const s = typeof o == "string" ?
|
|
2991
|
+
const s = typeof o == "string" ? nr(o, t, r) : o;
|
|
2992
2992
|
s && n.push(s);
|
|
2993
2993
|
}), n;
|
|
2994
2994
|
}
|
|
@@ -3012,12 +3012,12 @@ function Is(e, t, r, n) {
|
|
|
3012
3012
|
i = i.concat(C);
|
|
3013
3013
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
3014
3014
|
const c = Date.now();
|
|
3015
|
-
let l = "pending",
|
|
3015
|
+
let l = "pending", p = 0, g, y = null, x = [], I = [];
|
|
3016
3016
|
typeof n == "function" && I.push(n);
|
|
3017
3017
|
function S() {
|
|
3018
3018
|
y && (clearTimeout(y), y = null);
|
|
3019
3019
|
}
|
|
3020
|
-
function
|
|
3020
|
+
function T() {
|
|
3021
3021
|
l === "pending" && (l = "aborted"), S(), x.forEach((C) => {
|
|
3022
3022
|
C.status === "pending" && (C.status = "aborted");
|
|
3023
3023
|
}), x = [];
|
|
@@ -3030,10 +3030,10 @@ function Is(e, t, r, n) {
|
|
|
3030
3030
|
startTime: c,
|
|
3031
3031
|
payload: t,
|
|
3032
3032
|
status: l,
|
|
3033
|
-
queriesSent:
|
|
3033
|
+
queriesSent: p,
|
|
3034
3034
|
queriesPending: x.length,
|
|
3035
3035
|
subscribe: k,
|
|
3036
|
-
abort:
|
|
3036
|
+
abort: T
|
|
3037
3037
|
};
|
|
3038
3038
|
}
|
|
3039
3039
|
function J() {
|
|
@@ -3046,7 +3046,7 @@ function Is(e, t, r, n) {
|
|
|
3046
3046
|
C.status === "pending" && (C.status = "aborted");
|
|
3047
3047
|
}), x = [];
|
|
3048
3048
|
}
|
|
3049
|
-
function Y(C, K,
|
|
3049
|
+
function Y(C, K, re) {
|
|
3050
3050
|
const ye = K !== "success";
|
|
3051
3051
|
switch (x = x.filter((be) => be !== C), l) {
|
|
3052
3052
|
case "pending":
|
|
@@ -3058,11 +3058,11 @@ function Is(e, t, r, n) {
|
|
|
3058
3058
|
return;
|
|
3059
3059
|
}
|
|
3060
3060
|
if (K === "abort") {
|
|
3061
|
-
g =
|
|
3061
|
+
g = re, J();
|
|
3062
3062
|
return;
|
|
3063
3063
|
}
|
|
3064
3064
|
if (ye) {
|
|
3065
|
-
g =
|
|
3065
|
+
g = re, x.length || (i.length ? _e() : J());
|
|
3066
3066
|
return;
|
|
3067
3067
|
}
|
|
3068
3068
|
if (S(), q(), !e.random) {
|
|
@@ -3070,7 +3070,7 @@ function Is(e, t, r, n) {
|
|
|
3070
3070
|
be !== -1 && be !== e.index && (e.index = be);
|
|
3071
3071
|
}
|
|
3072
3072
|
l = "completed", I.forEach((be) => {
|
|
3073
|
-
be(
|
|
3073
|
+
be(re);
|
|
3074
3074
|
});
|
|
3075
3075
|
}
|
|
3076
3076
|
function _e() {
|
|
@@ -3090,11 +3090,11 @@ function Is(e, t, r, n) {
|
|
|
3090
3090
|
const K = {
|
|
3091
3091
|
status: "pending",
|
|
3092
3092
|
resource: C,
|
|
3093
|
-
callback: (
|
|
3094
|
-
Y(K,
|
|
3093
|
+
callback: (re, ye) => {
|
|
3094
|
+
Y(K, re, ye);
|
|
3095
3095
|
}
|
|
3096
3096
|
};
|
|
3097
|
-
x.push(K),
|
|
3097
|
+
x.push(K), p++, y = setTimeout(_e, e.rotate), r(C, t, K.callback);
|
|
3098
3098
|
}
|
|
3099
3099
|
return setTimeout(_e), P;
|
|
3100
3100
|
}
|
|
@@ -3107,9 +3107,9 @@ function co(e) {
|
|
|
3107
3107
|
function n() {
|
|
3108
3108
|
r = r.filter((c) => c().status === "pending");
|
|
3109
3109
|
}
|
|
3110
|
-
function o(c, l,
|
|
3110
|
+
function o(c, l, p) {
|
|
3111
3111
|
const g = Is(t, c, l, (y, x) => {
|
|
3112
|
-
n(),
|
|
3112
|
+
n(), p && p(y, x);
|
|
3113
3113
|
});
|
|
3114
3114
|
return r.push(g), g;
|
|
3115
3115
|
}
|
|
@@ -3126,41 +3126,41 @@ function co(e) {
|
|
|
3126
3126
|
cleanup: n
|
|
3127
3127
|
};
|
|
3128
3128
|
}
|
|
3129
|
-
function
|
|
3129
|
+
function Sn() {
|
|
3130
3130
|
}
|
|
3131
|
-
const
|
|
3131
|
+
const fr = /* @__PURE__ */ Object.create(null);
|
|
3132
3132
|
function Ps(e) {
|
|
3133
|
-
if (!
|
|
3134
|
-
const t =
|
|
3133
|
+
if (!fr[e]) {
|
|
3134
|
+
const t = Lr(e);
|
|
3135
3135
|
if (!t) return;
|
|
3136
3136
|
const r = co(t), n = {
|
|
3137
3137
|
config: t,
|
|
3138
3138
|
redundancy: r
|
|
3139
3139
|
};
|
|
3140
|
-
|
|
3140
|
+
fr[e] = n;
|
|
3141
3141
|
}
|
|
3142
|
-
return
|
|
3142
|
+
return fr[e];
|
|
3143
3143
|
}
|
|
3144
3144
|
function Fs(e, t, r) {
|
|
3145
3145
|
let n, o;
|
|
3146
3146
|
if (typeof e == "string") {
|
|
3147
|
-
const s =
|
|
3147
|
+
const s = Sr(e);
|
|
3148
3148
|
if (!s)
|
|
3149
|
-
return r(void 0, 424),
|
|
3149
|
+
return r(void 0, 424), Sn;
|
|
3150
3150
|
o = s.send;
|
|
3151
3151
|
const i = Ps(e);
|
|
3152
3152
|
i && (n = i.redundancy);
|
|
3153
3153
|
} else {
|
|
3154
|
-
const s =
|
|
3154
|
+
const s = jr(e);
|
|
3155
3155
|
if (s) {
|
|
3156
3156
|
n = co(s);
|
|
3157
|
-
const i = e.resources ? e.resources[0] : "", c =
|
|
3157
|
+
const i = e.resources ? e.resources[0] : "", c = Sr(i);
|
|
3158
3158
|
c && (o = c.send);
|
|
3159
3159
|
}
|
|
3160
3160
|
}
|
|
3161
|
-
return !n || !o ? (r(void 0, 424),
|
|
3161
|
+
return !n || !o ? (r(void 0, 424), Sn) : n.query(t, o, r)().abort;
|
|
3162
3162
|
}
|
|
3163
|
-
function
|
|
3163
|
+
function Nn() {
|
|
3164
3164
|
}
|
|
3165
3165
|
function Es(e) {
|
|
3166
3166
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
@@ -3176,7 +3176,7 @@ function Ts(e) {
|
|
|
3176
3176
|
invalid: r
|
|
3177
3177
|
};
|
|
3178
3178
|
}
|
|
3179
|
-
function
|
|
3179
|
+
function Ot(e, t, r) {
|
|
3180
3180
|
function n() {
|
|
3181
3181
|
const o = e.pendingIcons;
|
|
3182
3182
|
t.forEach((s) => {
|
|
@@ -3193,7 +3193,7 @@ function jt(e, t, r) {
|
|
|
3193
3193
|
}
|
|
3194
3194
|
n(), Es(e);
|
|
3195
3195
|
}
|
|
3196
|
-
function
|
|
3196
|
+
function Cn(e, t) {
|
|
3197
3197
|
e instanceof Promise ? e.then((r) => {
|
|
3198
3198
|
t(r);
|
|
3199
3199
|
}).catch(() => {
|
|
@@ -3207,34 +3207,34 @@ function As(e, t) {
|
|
|
3207
3207
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
3208
3208
|
const s = e.loadIcon;
|
|
3209
3209
|
if (e.loadIcons && (o.length > 1 || !s)) {
|
|
3210
|
-
|
|
3211
|
-
|
|
3210
|
+
Cn(e.loadIcons(o, n, r), (g) => {
|
|
3211
|
+
Ot(e, o, g);
|
|
3212
3212
|
});
|
|
3213
3213
|
return;
|
|
3214
3214
|
}
|
|
3215
3215
|
if (s) {
|
|
3216
3216
|
o.forEach((g) => {
|
|
3217
3217
|
const y = s(g, n, r);
|
|
3218
|
-
|
|
3218
|
+
Cn(y, (x) => {
|
|
3219
3219
|
const I = x ? {
|
|
3220
3220
|
prefix: n,
|
|
3221
3221
|
icons: { [g]: x }
|
|
3222
3222
|
} : null;
|
|
3223
|
-
|
|
3223
|
+
Ot(e, [g], I);
|
|
3224
3224
|
});
|
|
3225
3225
|
});
|
|
3226
3226
|
return;
|
|
3227
3227
|
}
|
|
3228
3228
|
const { valid: i, invalid: c } = Ts(o);
|
|
3229
|
-
if (c.length &&
|
|
3230
|
-
const l = n.match(oo) ?
|
|
3229
|
+
if (c.length && Ot(e, c, null), !i.length) return;
|
|
3230
|
+
const l = n.match(oo) ? Sr(r) : null;
|
|
3231
3231
|
if (!l) {
|
|
3232
|
-
|
|
3232
|
+
Ot(e, i, null);
|
|
3233
3233
|
return;
|
|
3234
3234
|
}
|
|
3235
3235
|
l.prepare(r, n, i).forEach((g) => {
|
|
3236
3236
|
Fs(r, g, (y) => {
|
|
3237
|
-
|
|
3237
|
+
Ot(e, g.icons, y);
|
|
3238
3238
|
});
|
|
3239
3239
|
});
|
|
3240
3240
|
}));
|
|
@@ -3244,7 +3244,7 @@ const Os = (e, t) => {
|
|
|
3244
3244
|
if (!n.pending.length) {
|
|
3245
3245
|
let l = !0;
|
|
3246
3246
|
return t && setTimeout(() => {
|
|
3247
|
-
l && t(n.loaded, n.missing, n.pending,
|
|
3247
|
+
l && t(n.loaded, n.missing, n.pending, Nn);
|
|
3248
3248
|
}), () => {
|
|
3249
3249
|
l = !1;
|
|
3250
3250
|
};
|
|
@@ -3252,18 +3252,18 @@ const Os = (e, t) => {
|
|
|
3252
3252
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
3253
3253
|
let i, c;
|
|
3254
3254
|
return n.pending.forEach((l) => {
|
|
3255
|
-
const { provider:
|
|
3256
|
-
if (g === c &&
|
|
3257
|
-
i =
|
|
3258
|
-
const y = o[
|
|
3255
|
+
const { provider: p, prefix: g } = l;
|
|
3256
|
+
if (g === c && p === i) return;
|
|
3257
|
+
i = p, c = g, s.push(bt(p, g));
|
|
3258
|
+
const y = o[p] || (o[p] = /* @__PURE__ */ Object.create(null));
|
|
3259
3259
|
y[g] || (y[g] = []);
|
|
3260
3260
|
}), n.pending.forEach((l) => {
|
|
3261
|
-
const { provider:
|
|
3262
|
-
I.has(y) || (I.add(y), o[
|
|
3261
|
+
const { provider: p, prefix: g, name: y } = l, x = bt(p, g), I = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
|
|
3262
|
+
I.has(y) || (I.add(y), o[p][g].push(y));
|
|
3263
3263
|
}), s.forEach((l) => {
|
|
3264
|
-
const
|
|
3265
|
-
|
|
3266
|
-
}), t ? Ss(t, n, s) :
|
|
3264
|
+
const p = o[l.provider][l.prefix];
|
|
3265
|
+
p.length && As(l, p);
|
|
3266
|
+
}), t ? Ss(t, n, s) : Nn;
|
|
3267
3267
|
};
|
|
3268
3268
|
function js(e, t) {
|
|
3269
3269
|
const r = { ...e };
|
|
@@ -3325,16 +3325,16 @@ function Bs(e) {
|
|
|
3325
3325
|
function Us(e) {
|
|
3326
3326
|
return 'url("' + Bs(e) + '")';
|
|
3327
3327
|
}
|
|
3328
|
-
let
|
|
3328
|
+
let jt;
|
|
3329
3329
|
function qs() {
|
|
3330
3330
|
try {
|
|
3331
|
-
|
|
3331
|
+
jt = window.trustedTypes.createPolicy("iconify", { createHTML: (e) => e });
|
|
3332
3332
|
} catch {
|
|
3333
|
-
|
|
3333
|
+
jt = null;
|
|
3334
3334
|
}
|
|
3335
3335
|
}
|
|
3336
3336
|
function Rs(e) {
|
|
3337
|
-
return
|
|
3337
|
+
return jt === void 0 && qs(), jt ? jt.createHTML(e) : e;
|
|
3338
3338
|
}
|
|
3339
3339
|
const uo = {
|
|
3340
3340
|
...io,
|
|
@@ -3346,29 +3346,29 @@ const uo = {
|
|
|
3346
3346
|
role: "img"
|
|
3347
3347
|
}, Vs = {
|
|
3348
3348
|
display: "inline-block"
|
|
3349
|
-
},
|
|
3349
|
+
}, Nr = {
|
|
3350
3350
|
backgroundColor: "currentColor"
|
|
3351
3351
|
}, fo = {
|
|
3352
3352
|
backgroundColor: "transparent"
|
|
3353
|
-
},
|
|
3353
|
+
}, _n = {
|
|
3354
3354
|
Image: "var(--svg)",
|
|
3355
3355
|
Repeat: "no-repeat",
|
|
3356
3356
|
Size: "100% 100%"
|
|
3357
|
-
},
|
|
3358
|
-
WebkitMask:
|
|
3359
|
-
mask:
|
|
3357
|
+
}, In = {
|
|
3358
|
+
WebkitMask: Nr,
|
|
3359
|
+
mask: Nr,
|
|
3360
3360
|
background: fo
|
|
3361
3361
|
};
|
|
3362
|
-
for (const e in
|
|
3363
|
-
const t =
|
|
3364
|
-
for (const r in
|
|
3365
|
-
t[e + r] =
|
|
3362
|
+
for (const e in In) {
|
|
3363
|
+
const t = In[e];
|
|
3364
|
+
for (const r in _n)
|
|
3365
|
+
t[e + r] = _n[r];
|
|
3366
3366
|
}
|
|
3367
3367
|
const Ys = {
|
|
3368
3368
|
...uo,
|
|
3369
3369
|
inline: !0
|
|
3370
3370
|
};
|
|
3371
|
-
function
|
|
3371
|
+
function Pn(e) {
|
|
3372
3372
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
3373
3373
|
}
|
|
3374
3374
|
const Js = (e, t, r) => {
|
|
@@ -3376,7 +3376,7 @@ const Js = (e, t, r) => {
|
|
|
3376
3376
|
...s === "svg" ? Hs : {}
|
|
3377
3377
|
};
|
|
3378
3378
|
if (r) {
|
|
3379
|
-
const k =
|
|
3379
|
+
const k = nr(r, !1, !0);
|
|
3380
3380
|
if (k) {
|
|
3381
3381
|
const P = ["iconify"], J = [
|
|
3382
3382
|
"provider",
|
|
@@ -3436,7 +3436,7 @@ const Js = (e, t, r) => {
|
|
|
3436
3436
|
n[k] === void 0 && (l[k] = P);
|
|
3437
3437
|
}
|
|
3438
3438
|
}
|
|
3439
|
-
const
|
|
3439
|
+
const p = is(e, o), g = p.attributes;
|
|
3440
3440
|
if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
|
|
3441
3441
|
l.style = {
|
|
3442
3442
|
...i,
|
|
@@ -3444,23 +3444,23 @@ const Js = (e, t, r) => {
|
|
|
3444
3444
|
}, Object.assign(l, g);
|
|
3445
3445
|
let k = 0, P = t.id;
|
|
3446
3446
|
return typeof P == "string" && (P = P.replace(/-/g, "_")), l.dangerouslySetInnerHTML = {
|
|
3447
|
-
__html: Rs(us(
|
|
3448
|
-
},
|
|
3447
|
+
__html: Rs(us(p.body, P ? () => P + "ID" + k++ : "iconifyReact"))
|
|
3448
|
+
}, mr("svg", l);
|
|
3449
3449
|
}
|
|
3450
|
-
const { body: y, width: x, height: I } = e, S = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1),
|
|
3450
|
+
const { body: y, width: x, height: I } = e, S = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), T = Ds(y, {
|
|
3451
3451
|
...g,
|
|
3452
3452
|
width: x + "",
|
|
3453
3453
|
height: I + ""
|
|
3454
3454
|
});
|
|
3455
3455
|
return l.style = {
|
|
3456
3456
|
...i,
|
|
3457
|
-
"--svg": Us(
|
|
3458
|
-
width:
|
|
3459
|
-
height:
|
|
3457
|
+
"--svg": Us(T),
|
|
3458
|
+
width: Pn(g.width),
|
|
3459
|
+
height: Pn(g.height),
|
|
3460
3460
|
...Vs,
|
|
3461
|
-
...S ?
|
|
3461
|
+
...S ? Nr : fo,
|
|
3462
3462
|
...c
|
|
3463
|
-
},
|
|
3463
|
+
}, mr("span", l);
|
|
3464
3464
|
};
|
|
3465
3465
|
ao(!0);
|
|
3466
3466
|
fs("", bs);
|
|
@@ -3505,11 +3505,11 @@ function mo(e) {
|
|
|
3505
3505
|
name: "",
|
|
3506
3506
|
data: S
|
|
3507
3507
|
};
|
|
3508
|
-
const
|
|
3509
|
-
if (
|
|
3508
|
+
const T = bn(S);
|
|
3509
|
+
if (T)
|
|
3510
3510
|
return {
|
|
3511
3511
|
name: S,
|
|
3512
|
-
data:
|
|
3512
|
+
data: T
|
|
3513
3513
|
};
|
|
3514
3514
|
}
|
|
3515
3515
|
return {
|
|
@@ -3521,7 +3521,7 @@ function mo(e) {
|
|
|
3521
3521
|
const I = n.callback;
|
|
3522
3522
|
I && (I(), o({}));
|
|
3523
3523
|
}
|
|
3524
|
-
function
|
|
3524
|
+
function p(I) {
|
|
3525
3525
|
if (JSON.stringify(i) !== JSON.stringify(I))
|
|
3526
3526
|
return l(), c(I), !0;
|
|
3527
3527
|
}
|
|
@@ -3529,34 +3529,34 @@ function mo(e) {
|
|
|
3529
3529
|
var I;
|
|
3530
3530
|
const S = e.icon;
|
|
3531
3531
|
if (typeof S == "object") {
|
|
3532
|
-
|
|
3532
|
+
p({
|
|
3533
3533
|
name: "",
|
|
3534
3534
|
data: S
|
|
3535
3535
|
});
|
|
3536
3536
|
return;
|
|
3537
3537
|
}
|
|
3538
|
-
const
|
|
3539
|
-
if (
|
|
3538
|
+
const T = bn(S);
|
|
3539
|
+
if (p({
|
|
3540
3540
|
name: S,
|
|
3541
|
-
data:
|
|
3541
|
+
data: T
|
|
3542
3542
|
}))
|
|
3543
|
-
if (
|
|
3543
|
+
if (T === void 0) {
|
|
3544
3544
|
const k = Os([S], g);
|
|
3545
3545
|
o({
|
|
3546
3546
|
callback: k
|
|
3547
3547
|
});
|
|
3548
|
-
} else
|
|
3548
|
+
} else T && ((I = e.onLoad) === null || I === void 0 || I.call(e, S));
|
|
3549
3549
|
}
|
|
3550
3550
|
xe(() => (r(!0), l), []), xe(() => {
|
|
3551
3551
|
t && g();
|
|
3552
3552
|
}, [e.icon, t]);
|
|
3553
3553
|
const { name: y, data: x } = i;
|
|
3554
3554
|
return x ? Js({
|
|
3555
|
-
|
|
3555
|
+
...Or,
|
|
3556
3556
|
...x
|
|
3557
|
-
}, e, y) : e.children ? e.children : e.fallback ? e.fallback :
|
|
3557
|
+
}, e, y) : e.children ? e.children : e.fallback ? e.fallback : mr("span", {});
|
|
3558
3558
|
}
|
|
3559
|
-
const
|
|
3559
|
+
const de = $n((e, t) => mo({
|
|
3560
3560
|
...e,
|
|
3561
3561
|
_ref: t
|
|
3562
3562
|
}));
|
|
@@ -3565,11 +3565,11 @@ $n((e, t) => mo({
|
|
|
3565
3565
|
...e,
|
|
3566
3566
|
_ref: t
|
|
3567
3567
|
}));
|
|
3568
|
-
const
|
|
3568
|
+
const yt = "USD", Ks = (e, t = yt) => {
|
|
3569
3569
|
const r = (e == null ? void 0 : e.prices) ?? [];
|
|
3570
3570
|
if (!r.length) return null;
|
|
3571
3571
|
const n = (i) => {
|
|
3572
|
-
var
|
|
3572
|
+
var p, g;
|
|
3573
3573
|
const c = i.find((y) => {
|
|
3574
3574
|
var x;
|
|
3575
3575
|
return !!((x = y.discounted) != null && x.value);
|
|
@@ -3578,7 +3578,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3578
3578
|
return {
|
|
3579
3579
|
cent: c.discounted.value.centAmount,
|
|
3580
3580
|
cur: c.discounted.value.currencyCode,
|
|
3581
|
-
regularCent: (
|
|
3581
|
+
regularCent: (p = c.value) == null ? void 0 : p.centAmount
|
|
3582
3582
|
};
|
|
3583
3583
|
const l = (g = i[0]) == null ? void 0 : g.value;
|
|
3584
3584
|
return l ? { cent: l.centAmount, cur: l.currencyCode } : null;
|
|
@@ -3603,7 +3603,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3603
3603
|
r && r.value && (t = typeof r.value == "object" ? r.value.label || "" : r.value);
|
|
3604
3604
|
}
|
|
3605
3605
|
return { sizeLabel: t };
|
|
3606
|
-
},
|
|
3606
|
+
}, pt = (e) => Ws((e == null ? void 0 : e.attributesRaw) ?? [], "color"), gt = (e) => Qs((e == null ? void 0 : e.attributesRaw) ?? []).sizeLabel, We = (e) => e.charAt(0).toUpperCase() + e.slice(1), Fn = {
|
|
3607
3607
|
standard: {
|
|
3608
3608
|
label: "Standard Delivery",
|
|
3609
3609
|
fee: 0,
|
|
@@ -3626,7 +3626,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3626
3626
|
standard: "GROUND",
|
|
3627
3627
|
express: "2-DAY SHIPPING",
|
|
3628
3628
|
sameday: "OVERNIGHT"
|
|
3629
|
-
},
|
|
3629
|
+
}, at = (e, t) => {
|
|
3630
3630
|
try {
|
|
3631
3631
|
return e.toLocaleString("en-US", {
|
|
3632
3632
|
style: "currency",
|
|
@@ -3635,28 +3635,28 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3635
3635
|
} catch {
|
|
3636
3636
|
return `${t} ${e.toFixed(2)}`;
|
|
3637
3637
|
}
|
|
3638
|
-
},
|
|
3639
|
-
const t =
|
|
3638
|
+
}, ho = (e) => e == null ? void 0 : e.masterVariant, En = (e) => Array.isArray(e == null ? void 0 : e.variants) ? e.variants : [], Qt = (e) => {
|
|
3639
|
+
const t = ho(e);
|
|
3640
3640
|
return t ? [t, ...En(e)] : En(e);
|
|
3641
|
-
}, Xs = (e, t = 0) =>
|
|
3641
|
+
}, Xs = (e, t = 0) => Qt(e)[t], Zs = (e) => {
|
|
3642
3642
|
var t, r;
|
|
3643
3643
|
return ((r = (t = e == null ? void 0 : e.images) == null ? void 0 : t[0]) == null ? void 0 : r.url) ?? "";
|
|
3644
3644
|
}, Tn = (e, t) => {
|
|
3645
|
-
var r, n, o, s, i, c, l,
|
|
3646
|
-
return Zs(t) || ((s = (o = (n = (r = e.imageGroups) == null ? void 0 : r[0]) == null ? void 0 : n.images) == null ? void 0 : o[0]) == null ? void 0 : s.link) || ((
|
|
3647
|
-
}, An = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any",
|
|
3648
|
-
var s, i, c, l,
|
|
3649
|
-
const t = e ? Ks(e,
|
|
3645
|
+
var r, n, o, s, i, c, l, p;
|
|
3646
|
+
return Zs(t) || ((s = (o = (n = (r = e.imageGroups) == null ? void 0 : r[0]) == null ? void 0 : n.images) == null ? void 0 : o[0]) == null ? void 0 : s.link) || ((p = (l = (c = (i = e.image_groups) == null ? void 0 : i[0]) == null ? void 0 : c.images) == null ? void 0 : l[0]) == null ? void 0 : p.link) || "";
|
|
3647
|
+
}, An = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any", Gt = (e) => {
|
|
3648
|
+
var s, i, c, l, p, g;
|
|
3649
|
+
const t = e ? Ks(e, yt) : null;
|
|
3650
3650
|
if (t != null && t.cent && (t != null && t.cur))
|
|
3651
3651
|
return {
|
|
3652
3652
|
amount: +(t.cent / 100),
|
|
3653
3653
|
currency: t.cur,
|
|
3654
3654
|
regularAmount: t.regularCent ? t.regularCent / 100 : void 0
|
|
3655
3655
|
};
|
|
3656
|
-
const r = (c = (i = (s = e == null ? void 0 : e.prices) == null ? void 0 : s[0]) == null ? void 0 : i.value) == null ? void 0 : c.centAmount, n = ((g = (
|
|
3656
|
+
const r = (c = (i = (s = e == null ? void 0 : e.prices) == null ? void 0 : s[0]) == null ? void 0 : i.value) == null ? void 0 : c.centAmount, n = ((g = (p = (l = e == null ? void 0 : e.prices) == null ? void 0 : l[0]) == null ? void 0 : p.value) == null ? void 0 : g.currencyCode) ?? yt;
|
|
3657
3657
|
return { amount: Number.isFinite(r) ? +(Number(r) / 100) : 0, currency: n };
|
|
3658
3658
|
}, On = (e, t) => {
|
|
3659
|
-
const { amount: r } =
|
|
3659
|
+
const { amount: r } = Gt(t);
|
|
3660
3660
|
if (r) return r;
|
|
3661
3661
|
const n = (e == null ? void 0 : e.price) ?? (e == null ? void 0 : e.sellingPrice) ?? (e == null ? void 0 : e.unitPrice) ?? (e == null ? void 0 : e.mrp) ?? 0, o = Number(n);
|
|
3662
3662
|
return Number.isFinite(o) ? o : 0;
|
|
@@ -3678,10 +3678,10 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3678
3678
|
addressLoading: s,
|
|
3679
3679
|
variationAttributes: i
|
|
3680
3680
|
}) => {
|
|
3681
|
-
const
|
|
3681
|
+
const p = Qt(r), g = Math.min(
|
|
3682
3682
|
Math.max(0, n || 0),
|
|
3683
|
-
Math.max(0,
|
|
3684
|
-
), [y, x] = b([]), [I, S] = b(0), [
|
|
3683
|
+
Math.max(0, p.length - 1)
|
|
3684
|
+
), [y, x] = b([]), [I, S] = b(0), [T, k] = b([]);
|
|
3685
3685
|
xe(() => {
|
|
3686
3686
|
if (r != null && r.variants) {
|
|
3687
3687
|
const u = P(
|
|
@@ -3694,35 +3694,35 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3694
3694
|
}, [r]);
|
|
3695
3695
|
const P = (u, m, f) => {
|
|
3696
3696
|
const { colorMap: w, sizeMap: v } = J(f), j = {};
|
|
3697
|
-
m == null || m.forEach((
|
|
3698
|
-
var
|
|
3699
|
-
const M = (
|
|
3697
|
+
m == null || m.forEach((A) => {
|
|
3698
|
+
var le, Pe, ze;
|
|
3699
|
+
const M = (le = A.variationAttributes) == null ? void 0 : le.find(
|
|
3700
3700
|
(De) => De.id === "color"
|
|
3701
|
-
),
|
|
3702
|
-
|
|
3701
|
+
), E = (ze = (Pe = M == null ? void 0 : M.values) == null ? void 0 : Pe[0]) == null ? void 0 : ze.value;
|
|
3702
|
+
E && (j[E] || (j[E] = {}), j[E][A.viewType] = A.images);
|
|
3703
3703
|
});
|
|
3704
|
-
const H = u.reduce((
|
|
3705
|
-
const
|
|
3706
|
-
return E
|
|
3707
|
-
color:
|
|
3708
|
-
name: w[
|
|
3704
|
+
const H = u.reduce((A, M) => {
|
|
3705
|
+
const E = M.variationValues.color, le = M.variationValues.size;
|
|
3706
|
+
return A[E] || (A[E] = {
|
|
3707
|
+
color: E,
|
|
3708
|
+
name: w[E] || E,
|
|
3709
3709
|
// ✅ DISPLAY NAME
|
|
3710
|
-
images: j[
|
|
3710
|
+
images: j[E] || {},
|
|
3711
3711
|
variants: []
|
|
3712
|
-
}), E
|
|
3713
|
-
size:
|
|
3714
|
-
name: v[
|
|
3712
|
+
}), A[E].variants.push({
|
|
3713
|
+
size: le,
|
|
3714
|
+
name: v[le] || le,
|
|
3715
3715
|
// ✅ DISPLAY NAME
|
|
3716
3716
|
...M
|
|
3717
|
-
}),
|
|
3717
|
+
}), A;
|
|
3718
3718
|
}, {});
|
|
3719
|
-
return Object.values(H).sort((
|
|
3720
|
-
const
|
|
3721
|
-
return
|
|
3722
|
-
}).map((
|
|
3723
|
-
...
|
|
3724
|
-
variants:
|
|
3725
|
-
(M,
|
|
3719
|
+
return Object.values(H).sort((A, M) => {
|
|
3720
|
+
const E = A.colorName || A.color || "", le = M.colorName || M.color || "";
|
|
3721
|
+
return E.localeCompare(le);
|
|
3722
|
+
}).map((A) => ({
|
|
3723
|
+
...A,
|
|
3724
|
+
variants: A.variants.sort(
|
|
3725
|
+
(M, E) => Number(M.size) - Number(E.size)
|
|
3726
3726
|
)
|
|
3727
3727
|
}));
|
|
3728
3728
|
}, J = (u) => {
|
|
@@ -3734,41 +3734,41 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3734
3734
|
f[v.value] = v.name;
|
|
3735
3735
|
});
|
|
3736
3736
|
}), { colorMap: m, sizeMap: f };
|
|
3737
|
-
}, q =
|
|
3737
|
+
}, q = p.length, [Y, _e] = b(g), [C, K] = b(null), [re, ye] = b(null), be = Ve(null), lt = Ve(null), N = Xs(r, Y), [ve, V] = b(""), [$, Je] = b(""), [ct, qe] = b(!1), [rt, fe] = b(!1), [Ie, je] = b(!1), [z, Te] = b(""), [Se, ne] = b(!1), [me, vt] = b(null), [h, O] = b([]), [B, Q] = b([]), [U, L] = b([]), [W, Z] = b(!1), [R, oe] = b(), [$e, Re] = b(!0), [G, he] = b(!1), [Ne, pe] = b(!1), [X, _] = b({ id: "001" }), [ee, D] = b(!1), [ae, se] = b(!1), [Ae, kt] = b("card"), [Oe, ie] = b(!1), [St, Ce] = b(!1), [F, te] = b(!1), [Nt, Ct] = b(null), [Dt, zr] = b(null), [or, Dr] = b(""), [Mr, Br] = b(!1), [_t, po] = b(r == null ? void 0 : r.id), Mt = Ve(null);
|
|
3738
3738
|
xe(() => {
|
|
3739
|
-
const u =
|
|
3739
|
+
const u = Qt(r), m = Math.min(
|
|
3740
3740
|
Math.max(0, n || 0),
|
|
3741
3741
|
Math.max(0, u.length - 1)
|
|
3742
3742
|
);
|
|
3743
3743
|
_e(m);
|
|
3744
|
-
const f =
|
|
3745
|
-
be.current = w || null,
|
|
3744
|
+
const f = ho(r), w = pt(f), v = gt(f);
|
|
3745
|
+
be.current = w || null, lt.current = v || null, K(w || null), ye(v || null);
|
|
3746
3746
|
}, [n, r]), xe(() => {
|
|
3747
|
-
|
|
3747
|
+
Mt.current && (Mt.current.scrollTop = Mt.current.scrollHeight);
|
|
3748
3748
|
}, [
|
|
3749
|
-
|
|
3749
|
+
h,
|
|
3750
3750
|
W,
|
|
3751
3751
|
G,
|
|
3752
3752
|
Ne,
|
|
3753
|
-
|
|
3754
|
-
|
|
3753
|
+
ee,
|
|
3754
|
+
ae,
|
|
3755
3755
|
Oe,
|
|
3756
|
-
|
|
3756
|
+
St,
|
|
3757
3757
|
F,
|
|
3758
|
-
|
|
3758
|
+
ct,
|
|
3759
3759
|
rt
|
|
3760
3760
|
]);
|
|
3761
|
-
const
|
|
3761
|
+
const dt = "var(--tanya)", Ur = "var(--tanya-contrast)", Bt = dt, Le = "#804c9e", go = () => {
|
|
3762
3762
|
console.log("AgenticShopping feedback:", {
|
|
3763
|
-
rating:
|
|
3764
|
-
comment:
|
|
3765
|
-
}),
|
|
3763
|
+
rating: Dt,
|
|
3764
|
+
comment: or
|
|
3765
|
+
}), Br(!0);
|
|
3766
3766
|
}, wo = () => {
|
|
3767
|
-
|
|
3768
|
-
},
|
|
3769
|
-
const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ??
|
|
3767
|
+
zr(null), Dr(""), Br(!0);
|
|
3768
|
+
}, qr = (u) => {
|
|
3769
|
+
const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ?? Nt;
|
|
3770
3770
|
return e ? /* @__PURE__ */ d("div", { className: "mt-3 flex items-start gap-3 rounded-lg border border-green-200 bg-green-50 p-4 text-green-800", children: [
|
|
3771
|
-
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(
|
|
3771
|
+
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(de, { icon: "mdi:check-circle", width: "28", color: "#16a34a" }) }),
|
|
3772
3772
|
/* @__PURE__ */ d("div", { className: "text-sm w-full", children: [
|
|
3773
3773
|
/* @__PURE__ */ a("div", { className: "font-semibold", children: "Success!" }),
|
|
3774
3774
|
/* @__PURE__ */ a("div", { children: "Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met." }),
|
|
@@ -3782,19 +3782,19 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3782
3782
|
}
|
|
3783
3783
|
)
|
|
3784
3784
|
] }),
|
|
3785
|
-
!
|
|
3785
|
+
!Mr && /* @__PURE__ */ d("div", { className: "mt-4 rounded-lg bg-white/70 p-3 text-gray-900", children: [
|
|
3786
3786
|
/* @__PURE__ */ a("h4", { className: "font-semibold mb-1", children: "Please post your feedback here" }),
|
|
3787
3787
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-700 mb-3", children: "Rate us on how much our response was helpful" }),
|
|
3788
3788
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 mb-3", children: [1, 2, 3, 4, 5].map((w) => /* @__PURE__ */ a(
|
|
3789
3789
|
"button",
|
|
3790
3790
|
{
|
|
3791
3791
|
type: "button",
|
|
3792
|
-
onClick: () =>
|
|
3792
|
+
onClick: () => zr(w),
|
|
3793
3793
|
className: "p-0.5",
|
|
3794
3794
|
children: /* @__PURE__ */ a(
|
|
3795
|
-
|
|
3795
|
+
de,
|
|
3796
3796
|
{
|
|
3797
|
-
icon:
|
|
3797
|
+
icon: Dt && Dt >= w ? "mdi:star" : "mdi:star-outline",
|
|
3798
3798
|
width: "20",
|
|
3799
3799
|
className: "text-yellow-500"
|
|
3800
3800
|
}
|
|
@@ -3806,8 +3806,8 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3806
3806
|
/* @__PURE__ */ a(
|
|
3807
3807
|
"textarea",
|
|
3808
3808
|
{
|
|
3809
|
-
value:
|
|
3810
|
-
onChange: (w) =>
|
|
3809
|
+
value: or,
|
|
3810
|
+
onChange: (w) => Dr(w.target.value),
|
|
3811
3811
|
rows: 3,
|
|
3812
3812
|
className: "mt-1 w-full rounded-md border border-gray-300 p-2 text-sm outline-none focus:ring-1 focus:ring-gray-300",
|
|
3813
3813
|
placeholder: "Your feedback helps us improve..."
|
|
@@ -3829,14 +3829,14 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3829
3829
|
type: "button",
|
|
3830
3830
|
onClick: go,
|
|
3831
3831
|
className: "px-4 py-2 rounded-full text-sm font-semibold text-white shadow",
|
|
3832
|
-
style: { background:
|
|
3833
|
-
disabled: !
|
|
3832
|
+
style: { background: dt },
|
|
3833
|
+
disabled: !Dt && !or.trim(),
|
|
3834
3834
|
children: "Submit"
|
|
3835
3835
|
}
|
|
3836
3836
|
)
|
|
3837
3837
|
] })
|
|
3838
3838
|
] }),
|
|
3839
|
-
|
|
3839
|
+
Mr && /* @__PURE__ */ a("div", { className: "mt-3 text-xs text-green-900 font-medium", children: "Thanks for your feedback! 💚" })
|
|
3840
3840
|
] })
|
|
3841
3841
|
] }) : null;
|
|
3842
3842
|
}, yo = async () => {
|
|
@@ -3845,9 +3845,9 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3845
3845
|
const u = JSON.parse(
|
|
3846
3846
|
sessionStorage.getItem("customerData") || "{}"
|
|
3847
3847
|
);
|
|
3848
|
-
let m = (u == null ? void 0 : u.basketId) || localStorage.getItem(
|
|
3848
|
+
let m = (u == null ? void 0 : u.basketId) || localStorage.getItem($t);
|
|
3849
3849
|
if (!m) {
|
|
3850
|
-
const f = await Ge(), w = "Bearer " + (f == null ? void 0 : f.access_token), v = await
|
|
3850
|
+
const f = await Ge(), w = "Bearer " + (f == null ? void 0 : f.access_token), v = await Cr(w);
|
|
3851
3851
|
m = (v == null ? void 0 : v.basket_id) || v.basketId;
|
|
3852
3852
|
}
|
|
3853
3853
|
xo(m), V(m);
|
|
@@ -3859,7 +3859,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3859
3859
|
console.log(m, "shipping methods"), k(m);
|
|
3860
3860
|
};
|
|
3861
3861
|
console.log(ve, "the basket id");
|
|
3862
|
-
const
|
|
3862
|
+
const It = (u, m) => {
|
|
3863
3863
|
O((f) => [
|
|
3864
3864
|
...f,
|
|
3865
3865
|
{
|
|
@@ -3869,7 +3869,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3869
3869
|
snapshotPayload: m
|
|
3870
3870
|
}
|
|
3871
3871
|
]);
|
|
3872
|
-
},
|
|
3872
|
+
}, Rr = (u, m) => {
|
|
3873
3873
|
O(
|
|
3874
3874
|
(f) => f.map(
|
|
3875
3875
|
(w) => w.response === "__CARD__" ? {
|
|
@@ -3886,34 +3886,33 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3886
3886
|
(m) => !(m.query === "" && m.response !== "__SNAPSHOT__" && m.response !== "__TEXT__")
|
|
3887
3887
|
)
|
|
3888
3888
|
);
|
|
3889
|
-
},
|
|
3890
|
-
Ce(!1),
|
|
3889
|
+
}, Ut = () => {
|
|
3890
|
+
Ce(!1), Z(!1), pe(!1), se(!1), he(!1), D(!1), ie(!1), te(!1), ne(!1), vt(null), bo(), qe(!1), fe(!1);
|
|
3891
3891
|
}, vo = () => {
|
|
3892
|
-
|
|
3893
|
-
},
|
|
3892
|
+
Z(!1), he(!1), pe(!1), _("standard"), D(!1), se(!1), kt("card"), ie(!1), Ce(!1), te(!1), Re(!0), vt(null), localStorage.removeItem("agentic_order"), localStorage.removeItem("agentic_order_address"), localStorage.removeItem("agentic_order_delivery"), localStorage.removeItem("agentic_order_payment"), localStorage.removeItem("agentic_order_final");
|
|
3893
|
+
}, qt = Zr(() => Qt(r).map((m, f) => ({
|
|
3894
3894
|
index: f,
|
|
3895
3895
|
variant: m,
|
|
3896
3896
|
images: ((m == null ? void 0 : m.images) || []).map((w) => (w == null ? void 0 : w.url) || "").filter(Boolean)
|
|
3897
|
-
})), [r]),
|
|
3897
|
+
})), [r]), Pt = Zr(() => qt.length ? !!((C || void 0) && (re || void 0)) : !1, [qt, C, re, N]), ko = Ie || Se || !Pt, Ft = (u) => {
|
|
3898
3898
|
const m = Number((u == null ? void 0 : u.quantity) ?? 1);
|
|
3899
3899
|
return Number.isFinite(m) && m > 0 ? m : 1;
|
|
3900
|
-
},
|
|
3901
|
-
const m =
|
|
3900
|
+
}, Hr = (u) => {
|
|
3901
|
+
const m = Ft(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
|
|
3902
3902
|
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(On(r, N) * m);
|
|
3903
|
-
},
|
|
3904
|
-
|
|
3905
|
-
const m = fe, f = Zt(N), w = u || (m == null ? void 0 : m.currency) || f.currency || xt, v = Yr(m), j = +(v * 0.08).toFixed(2), H = ((E = wt[he]) == null ? void 0 : E.price) || 0;
|
|
3903
|
+
}, Vr = (u) => {
|
|
3904
|
+
const m = me, f = Gt(N), w = u || (m == null ? void 0 : m.currency) || f.currency || yt, v = Hr(m), j = +(v * 0.08).toFixed(2), H = (X == null ? void 0 : X.price) || 0;
|
|
3906
3905
|
return { product_total: v, tax: j, shipping_fee: H, currency: w };
|
|
3907
|
-
},
|
|
3908
|
-
|
|
3906
|
+
}, ar = async (u, m, f) => {
|
|
3907
|
+
Rr(), vo(), je(!0), ne(!0), qe(!1), fe(!1);
|
|
3909
3908
|
const w = B.slice(-jn);
|
|
3910
3909
|
try {
|
|
3911
|
-
const v = await
|
|
3910
|
+
const v = await pr(null, null);
|
|
3912
3911
|
if (!v) throw new Error("Failed to fetch token");
|
|
3913
3912
|
const j = localStorage.getItem("customerNumber"), H = localStorage.getItem("isLoggedIn"), M = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
3914
3913
|
registered: String(H || !1),
|
|
3915
3914
|
userId: String(j || (/* @__PURE__ */ new Date()).getTime())
|
|
3916
|
-
}).toString()}`,
|
|
3915
|
+
}).toString()}`, E = await fetch(`${M}`, {
|
|
3917
3916
|
method: "POST",
|
|
3918
3917
|
headers: {
|
|
3919
3918
|
"Content-Type": "application/json",
|
|
@@ -3933,19 +3932,19 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3933
3932
|
}
|
|
3934
3933
|
})
|
|
3935
3934
|
});
|
|
3936
|
-
if (!
|
|
3937
|
-
const
|
|
3935
|
+
if (!E.body) throw new Error("Readable stream not supported");
|
|
3936
|
+
const le = E.body.getReader(), Pe = new TextDecoder();
|
|
3938
3937
|
let ze = "", De = "", nt = "";
|
|
3939
3938
|
for (; ; ) {
|
|
3940
|
-
const { done: Ee, value: Ke } = await
|
|
3939
|
+
const { done: Ee, value: Ke } = await le.read();
|
|
3941
3940
|
if (Ee) break;
|
|
3942
3941
|
ze += Pe.decode(Ke, { stream: !0 });
|
|
3943
|
-
const
|
|
3942
|
+
const ut = ze.split(`
|
|
3944
3943
|
`);
|
|
3945
|
-
ze =
|
|
3946
|
-
for (const
|
|
3947
|
-
if (!
|
|
3948
|
-
const ot =
|
|
3944
|
+
ze = ut.pop() || "";
|
|
3945
|
+
for (const ft of ut) {
|
|
3946
|
+
if (!ft.startsWith("data:")) continue;
|
|
3947
|
+
const ot = ft.slice(5).trim();
|
|
3949
3948
|
try {
|
|
3950
3949
|
const He = JSON.parse(ot), Me = He.index, ge = He.data;
|
|
3951
3950
|
Me === 0 ? De = String(ge ?? "") : Me === 1 && (nt = String(ge ?? ""));
|
|
@@ -3964,7 +3963,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3964
3963
|
console.log(Ke);
|
|
3965
3964
|
}
|
|
3966
3965
|
}
|
|
3967
|
-
|
|
3966
|
+
vt(Fe), Fe && O((Ee) => [
|
|
3968
3967
|
...Ee,
|
|
3969
3968
|
{
|
|
3970
3969
|
query: "",
|
|
@@ -3980,52 +3979,52 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
3980
3979
|
}
|
|
3981
3980
|
].slice(-jn));
|
|
3982
3981
|
} catch (v) {
|
|
3983
|
-
console.error("Error sending message to Tanya:", v),
|
|
3982
|
+
console.error("Error sending message to Tanya:", v), ne(!1);
|
|
3984
3983
|
} finally {
|
|
3985
3984
|
je(!1);
|
|
3986
3985
|
}
|
|
3987
|
-
},
|
|
3988
|
-
if (Se || Ie || !
|
|
3986
|
+
}, Yr = async (u) => {
|
|
3987
|
+
if (Se || Ie || !Pt) return;
|
|
3989
3988
|
const m = z.trim();
|
|
3990
3989
|
if (!m) return;
|
|
3991
3990
|
O((w) => [...w, { query: m, response: "" }]), Te(""), Je(m);
|
|
3992
|
-
const f =
|
|
3991
|
+
const f = _t || "";
|
|
3993
3992
|
if (q <= 1) {
|
|
3994
3993
|
if (f) {
|
|
3995
|
-
|
|
3994
|
+
ar(m, f, Y);
|
|
3996
3995
|
return;
|
|
3997
3996
|
}
|
|
3998
|
-
|
|
3997
|
+
fe(!0), ne(!0);
|
|
3999
3998
|
return;
|
|
4000
3999
|
}
|
|
4001
|
-
f ? (qe(!0),
|
|
4000
|
+
f ? (qe(!0), ne(!0)) : (fe(!0), ne(!0));
|
|
4002
4001
|
}, So = () => {
|
|
4003
|
-
const u =
|
|
4004
|
-
u &&
|
|
4002
|
+
const u = _t;
|
|
4003
|
+
u && ar($, u, Y);
|
|
4005
4004
|
}, No = () => {
|
|
4006
|
-
qe(!1),
|
|
4005
|
+
qe(!1), fe(!0), ne(!0);
|
|
4007
4006
|
}, Co = () => {
|
|
4008
|
-
if (!
|
|
4009
|
-
|
|
4007
|
+
if (!_t) return;
|
|
4008
|
+
ar($, _t, Y);
|
|
4010
4009
|
}, _o = async () => {
|
|
4011
|
-
|
|
4012
|
-
extractedDetails:
|
|
4010
|
+
Z(!0), pe(!1), se(!1), Ce(!1), he(!1), D(!1), ie(!1), te(!1), await yo(), console.log("calling"), Rr("initial", {
|
|
4011
|
+
extractedDetails: me ?? void 0
|
|
4013
4012
|
});
|
|
4014
4013
|
}, Io = () => {
|
|
4015
4014
|
if (!R) return;
|
|
4016
4015
|
const u = U.find(
|
|
4017
4016
|
(m) => String(m.addressId ?? m.id) === R
|
|
4018
4017
|
) || null;
|
|
4019
|
-
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)),
|
|
4018
|
+
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), he(!0), pe(!0), D(!1), se(!1), ie(!1), Ce(!1), te(!1), It("address", u));
|
|
4020
4019
|
}, Po = () => {
|
|
4021
|
-
|
|
4020
|
+
he(!1), pe(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_address");
|
|
4022
4021
|
}, Fo = () => {
|
|
4023
|
-
|
|
4024
|
-
method:
|
|
4025
|
-
...
|
|
4022
|
+
X.id && (localStorage.setItem("agentic_order_delivery", X.id), D(!0), se(!0), ie(!1), Ce(!1), te(!1), It("delivery", {
|
|
4023
|
+
method: X.id,
|
|
4024
|
+
...X
|
|
4026
4025
|
}));
|
|
4027
|
-
},
|
|
4028
|
-
pe(!1), D(!1),
|
|
4026
|
+
}, Jr = () => {
|
|
4027
|
+
pe(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), ne(!1), Ut(), O((u) => [
|
|
4029
4028
|
...u,
|
|
4030
4029
|
{
|
|
4031
4030
|
query: "",
|
|
@@ -4036,11 +4035,11 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4036
4035
|
}
|
|
4037
4036
|
]);
|
|
4038
4037
|
}, Eo = () => {
|
|
4039
|
-
D(!1),
|
|
4038
|
+
D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_delivery");
|
|
4040
4039
|
}, To = () => {
|
|
4041
|
-
Ae && (localStorage.setItem("agentic_order_payment", Ae),
|
|
4040
|
+
Ae && (localStorage.setItem("agentic_order_payment", Ae), ie(!0), Ce(!0), te(!1), It("payment", { method: Ae }));
|
|
4042
4041
|
}, Ao = () => {
|
|
4043
|
-
|
|
4042
|
+
se(!1), ie(!1), Ce(!1), te(!1), ne(!1), Ut(), O((u) => [
|
|
4044
4043
|
...u,
|
|
4045
4044
|
{
|
|
4046
4045
|
query: "",
|
|
@@ -4051,18 +4050,18 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4051
4050
|
}
|
|
4052
4051
|
]);
|
|
4053
4052
|
}, Oo = () => {
|
|
4054
|
-
|
|
4053
|
+
ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_payment");
|
|
4055
4054
|
}, jo = async () => {
|
|
4056
4055
|
try {
|
|
4057
4056
|
je(!0);
|
|
4058
|
-
const u =
|
|
4057
|
+
const u = me || {}, m = JSON.parse(
|
|
4059
4058
|
localStorage.getItem("agentic_order_address") || "null"
|
|
4060
4059
|
), f = localStorage.getItem(
|
|
4061
4060
|
"agentic_order_delivery"
|
|
4062
|
-
), w = localStorage.getItem("agentic_order_payment") || "card", { product_total: v, tax: j, shipping_fee: H, currency:
|
|
4061
|
+
), w = localStorage.getItem("agentic_order_payment") || "card", { product_total: v, tax: j, shipping_fee: H, currency: A } = Vr(), M = u.shopper_id || localStorage.getItem("customerId") || void 0, E = (m == null ? void 0 : m.addressId) || (m == null ? void 0 : m.id) || void 0, le = f ? Gs[f] : "GROUND", Pe = "card-visa", ze = N == null ? void 0 : N.sku, De = (r == null ? void 0 : r.id) || "", nt = Ft(u), Fe = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(v * 100), ut = {
|
|
4063
4062
|
shopper_id: M,
|
|
4064
|
-
shipping_address_id:
|
|
4065
|
-
shipping_method_id:
|
|
4063
|
+
shipping_address_id: E,
|
|
4064
|
+
shipping_method_id: le,
|
|
4066
4065
|
payment_method_id: Pe,
|
|
4067
4066
|
sku: ze,
|
|
4068
4067
|
platform: "SFCC",
|
|
@@ -4070,15 +4069,15 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4070
4069
|
product_id: De,
|
|
4071
4070
|
quantity: nt,
|
|
4072
4071
|
max_price_minor: Fe,
|
|
4073
|
-
currency:
|
|
4072
|
+
currency: A,
|
|
4074
4073
|
instruction_text: $
|
|
4075
4074
|
};
|
|
4076
|
-
if (console.log(M,
|
|
4075
|
+
if (console.log(M, E, "the selected ids"), !M || !E) {
|
|
4077
4076
|
console.error(
|
|
4078
4077
|
"Missing shopper_id or shipping_address_id for intent-mandate",
|
|
4079
4078
|
{
|
|
4080
4079
|
shopperId: M,
|
|
4081
|
-
shippingAddressId:
|
|
4080
|
+
shippingAddressId: E
|
|
4082
4081
|
}
|
|
4083
4082
|
), alert(
|
|
4084
4083
|
"Missing customer or address information. Please re-select address and try again."
|
|
@@ -4094,7 +4093,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4094
4093
|
"Content-Type": "application/json",
|
|
4095
4094
|
Authorization: `Bearer ${ot}`
|
|
4096
4095
|
},
|
|
4097
|
-
body: JSON.stringify(
|
|
4096
|
+
body: JSON.stringify(ut)
|
|
4098
4097
|
});
|
|
4099
4098
|
if (!Me.ok) {
|
|
4100
4099
|
const Bo = await Me.text().catch(() => "");
|
|
@@ -4105,17 +4104,17 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4105
4104
|
}
|
|
4106
4105
|
const ge = await Me.json().catch(() => null);
|
|
4107
4106
|
console.log("intent-mandate success:", ge);
|
|
4108
|
-
const
|
|
4109
|
-
|
|
4110
|
-
const
|
|
4107
|
+
const mt = (ge == null ? void 0 : ge.intent_mandate_id) || (ge == null ? void 0 : ge.intent_mandateId) || (ge == null ? void 0 : ge.key) || null;
|
|
4108
|
+
mt && Ct(mt);
|
|
4109
|
+
const Xr = {
|
|
4111
4110
|
...u,
|
|
4112
4111
|
address: m,
|
|
4113
4112
|
delivery: f,
|
|
4114
4113
|
payment: w,
|
|
4115
|
-
summary: { product_total: v, tax: j, shipping_fee: H, currency:
|
|
4116
|
-
intent_mandate_id:
|
|
4114
|
+
summary: { product_total: v, tax: j, shipping_fee: H, currency: A },
|
|
4115
|
+
intent_mandate_id: mt
|
|
4117
4116
|
};
|
|
4118
|
-
localStorage.setItem("agentic_order_final", JSON.stringify(
|
|
4117
|
+
localStorage.setItem("agentic_order_final", JSON.stringify(Xr)), te(!0), Re(!1), It("final", Xr), It("success", { intentMandateId: mt }), Ut();
|
|
4119
4118
|
} catch (u) {
|
|
4120
4119
|
console.error("Error in handleConfirmWatch / intent-mandate:", u), alert(
|
|
4121
4120
|
"Unable to complete your smart order right now. Please try again in a moment."
|
|
@@ -4123,8 +4122,8 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4123
4122
|
} finally {
|
|
4124
4123
|
je(!1);
|
|
4125
4124
|
}
|
|
4126
|
-
},
|
|
4127
|
-
|
|
4125
|
+
}, Kr = () => {
|
|
4126
|
+
Ut(), O((u) => [
|
|
4128
4127
|
...u,
|
|
4129
4128
|
{
|
|
4130
4129
|
query: "",
|
|
@@ -4135,8 +4134,8 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4135
4134
|
}
|
|
4136
4135
|
]);
|
|
4137
4136
|
}, $o = ({ selectedIndex: u }) => {
|
|
4138
|
-
var
|
|
4139
|
-
const m = ((
|
|
4137
|
+
var E;
|
|
4138
|
+
const m = ((E = y[u]) == null ? void 0 : E.images.large[0].link) || Tn(r, N), f = An(r), w = _t || "", v = pt(N) || "", j = gt(N) || "", { amount: H } = Gt(N), A = !!(r != null && r.id), M = A;
|
|
4140
4139
|
return /* @__PURE__ */ a("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4", children: /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row items-center sm:items-center gap-4", children: [
|
|
4141
4140
|
/* @__PURE__ */ a("div", { className: "flex-shrink-0 flex justify-center sm:justify-start", children: /* @__PURE__ */ a("div", { className: "w-[150px] h-[150px] rounded-lg bg-gray-50 border border-gray-200 flex items-center justify-center overflow-hidden", children: m ? /* @__PURE__ */ a(
|
|
4142
4141
|
"img",
|
|
@@ -4146,7 +4145,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4146
4145
|
className: "object-contain w-full h-full"
|
|
4147
4146
|
}
|
|
4148
4147
|
) : /* @__PURE__ */ a(
|
|
4149
|
-
|
|
4148
|
+
de,
|
|
4150
4149
|
{
|
|
4151
4150
|
icon: "mdi:image-outline",
|
|
4152
4151
|
width: "28",
|
|
@@ -4160,20 +4159,20 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4160
4159
|
v && `Color: ${v}`,
|
|
4161
4160
|
j && `Size: ${j}`
|
|
4162
4161
|
].filter(Boolean).join(" • ") || "—" }),
|
|
4163
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children:
|
|
4162
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children: A ? (
|
|
4164
4163
|
// ? formatCurrency(Number(unitPrice) || 0, CURRENCY_PREF)
|
|
4165
4164
|
`$${r.price}`
|
|
4166
4165
|
) : "Currently unavailable" }),
|
|
4167
|
-
|
|
4166
|
+
A && !M && /* @__PURE__ */ a("div", { className: "mt-1 text-xs font-medium text-red-600", children: "Currently out of stock" })
|
|
4168
4167
|
] })
|
|
4169
4168
|
] }) });
|
|
4170
|
-
},
|
|
4169
|
+
}, Wr = ({
|
|
4171
4170
|
showSubmit: u = !0
|
|
4172
4171
|
}) => {
|
|
4173
4172
|
const m = {};
|
|
4174
|
-
|
|
4173
|
+
qt.map((w) => pt(w.variant)).filter((w) => !!w && !m[w] && (m[w] = !0));
|
|
4175
4174
|
const f = {};
|
|
4176
|
-
return
|
|
4175
|
+
return qt.map((w) => gt(w.variant)).filter((w) => !!w && !f[w] && (f[w] = !0)), /* @__PURE__ */ d("div", { className: "mx-4 mt-4 mb-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
|
|
4177
4176
|
/* @__PURE__ */ a("h3", { className: "font-semibold text-gray-800", children: "Choose a variant" }),
|
|
4178
4177
|
/* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4179
4178
|
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
@@ -4181,7 +4180,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4181
4180
|
C && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: C })
|
|
4182
4181
|
] }),
|
|
4183
4182
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: y.map((w, v) => {
|
|
4184
|
-
const j = w.name, H = C === j,
|
|
4183
|
+
const j = w.name, H = C === j, A = w.images.large[0].disBaseLink || w.images.large[0].link;
|
|
4185
4184
|
return /* @__PURE__ */ a(
|
|
4186
4185
|
"div",
|
|
4187
4186
|
{
|
|
@@ -4195,10 +4194,10 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4195
4194
|
},
|
|
4196
4195
|
className: "w-full h-20 flex items-center justify-center overflow-hidden",
|
|
4197
4196
|
title: j,
|
|
4198
|
-
children:
|
|
4197
|
+
children: A ? /* @__PURE__ */ a(
|
|
4199
4198
|
"img",
|
|
4200
4199
|
{
|
|
4201
|
-
src:
|
|
4200
|
+
src: A,
|
|
4202
4201
|
alt: j,
|
|
4203
4202
|
className: "w/full h-full object-contain"
|
|
4204
4203
|
}
|
|
@@ -4213,7 +4212,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4213
4212
|
C && /* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4214
4213
|
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
4215
4214
|
/* @__PURE__ */ a("div", { className: "text-sm font-bold", children: "Size :" }),
|
|
4216
|
-
|
|
4215
|
+
re && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: re })
|
|
4217
4216
|
] }),
|
|
4218
4217
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: (() => {
|
|
4219
4218
|
const w = y.find(
|
|
@@ -4225,9 +4224,9 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4225
4224
|
"button",
|
|
4226
4225
|
{
|
|
4227
4226
|
onClick: () => {
|
|
4228
|
-
ye(H), _e(j),
|
|
4227
|
+
ye(H), _e(j), po(v.productId);
|
|
4229
4228
|
},
|
|
4230
|
-
className: `px-4 py-2 rounded-md border text-sm ${
|
|
4229
|
+
className: `px-4 py-2 rounded-md border text-sm ${re === H ? "border-2 border-[#804c9e] font-semibold" : "border-gray-300"}`,
|
|
4231
4230
|
title: H,
|
|
4232
4231
|
children: H
|
|
4233
4232
|
},
|
|
@@ -4242,16 +4241,16 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4242
4241
|
onClick: Co,
|
|
4243
4242
|
className: "px-6 py-2.5 rounded-full font-semibold text-white shadow-md",
|
|
4244
4243
|
style: { background: Le },
|
|
4245
|
-
disabled: !
|
|
4244
|
+
disabled: !Pt,
|
|
4246
4245
|
children: "Submit"
|
|
4247
4246
|
}
|
|
4248
4247
|
) })
|
|
4249
4248
|
] });
|
|
4250
|
-
},
|
|
4249
|
+
}, Qr = (u, m = !0) => {
|
|
4251
4250
|
!(u != null && u.extractedDetails) && u && (u = { extractedDetails: u });
|
|
4252
|
-
const f = (u == null ? void 0 : u.extractedDetails) ||
|
|
4251
|
+
const f = (u == null ? void 0 : u.extractedDetails) || me;
|
|
4253
4252
|
if (!f) return null;
|
|
4254
|
-
const w =
|
|
4253
|
+
const w = Ft(f), { currency: v } = Gt(N), j = On(r, N), H = Number((f == null ? void 0 : f.max_price_minor) ?? 0), M = Number.isFinite(H) && H > 0 ? +(H / 100) : +(j * w), E = (f == null ? void 0 : f.currency) || v || yt, le = N != null && N.sku ? N.sku : f.product_id;
|
|
4255
4254
|
return /* @__PURE__ */ d(
|
|
4256
4255
|
"div",
|
|
4257
4256
|
{
|
|
@@ -4262,25 +4261,25 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4262
4261
|
"p",
|
|
4263
4262
|
{
|
|
4264
4263
|
className: "text-base font-semibold text-center mt-2",
|
|
4265
|
-
style: { color:
|
|
4264
|
+
style: { color: Ur },
|
|
4266
4265
|
children: "Here’s what I found from your instruction:"
|
|
4267
4266
|
}
|
|
4268
4267
|
),
|
|
4269
4268
|
/* @__PURE__ */ d("div", { className: "w-full max-w-md bg-white rounded-xl shadow-inner p-4", children: [
|
|
4270
4269
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-y-2 text-sm", children: [
|
|
4271
4270
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "SKU:" }),
|
|
4272
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4271
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: le }),
|
|
4273
4272
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Quantity:" }),
|
|
4274
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4273
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Ft(f) }),
|
|
4275
4274
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Currency:" }),
|
|
4276
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4275
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: E }),
|
|
4277
4276
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Maximum Total Price:" }),
|
|
4278
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4277
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: at(M, E) })
|
|
4279
4278
|
] }),
|
|
4280
4279
|
/* @__PURE__ */ d("div", { className: "mt-3 flex flex-wrap gap-2 text-xs", children: [
|
|
4281
|
-
|
|
4280
|
+
pt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4282
4281
|
"Color: ",
|
|
4283
|
-
|
|
4282
|
+
pt(N)
|
|
4284
4283
|
] }),
|
|
4285
4284
|
gt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4286
4285
|
"Size: ",
|
|
@@ -4297,7 +4296,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4297
4296
|
"p",
|
|
4298
4297
|
{
|
|
4299
4298
|
className: "text-sm font-medium text-gray-700 text-center max-w-[90%] leading-relaxed",
|
|
4300
|
-
style: { color:
|
|
4299
|
+
style: { color: Ur },
|
|
4301
4300
|
children: [
|
|
4302
4301
|
"Would you like me to ",
|
|
4303
4302
|
/* @__PURE__ */ a("strong", { children: "lock this in" }),
|
|
@@ -4315,7 +4314,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4315
4314
|
style: { background: Le },
|
|
4316
4315
|
children: [
|
|
4317
4316
|
/* @__PURE__ */ a(
|
|
4318
|
-
|
|
4317
|
+
de,
|
|
4319
4318
|
{
|
|
4320
4319
|
icon: "fluent:checkmark-circle-24-filled",
|
|
4321
4320
|
className: "mr-2",
|
|
@@ -4330,13 +4329,13 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4330
4329
|
/* @__PURE__ */ d(
|
|
4331
4330
|
"button",
|
|
4332
4331
|
{
|
|
4333
|
-
onClick:
|
|
4332
|
+
onClick: Kr,
|
|
4334
4333
|
disabled: W,
|
|
4335
4334
|
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold border transition-all duration-300 ${W ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4336
4335
|
style: { borderColor: Le, color: Le },
|
|
4337
4336
|
children: [
|
|
4338
4337
|
/* @__PURE__ */ a(
|
|
4339
|
-
|
|
4338
|
+
de,
|
|
4340
4339
|
{
|
|
4341
4340
|
icon: "fluent:dismiss-circle-24-filled",
|
|
4342
4341
|
className: "mr-2",
|
|
@@ -4353,15 +4352,15 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4353
4352
|
]
|
|
4354
4353
|
}
|
|
4355
4354
|
);
|
|
4356
|
-
},
|
|
4357
|
-
var
|
|
4358
|
-
const f = u || {}, w = ((
|
|
4355
|
+
}, Gr = (u, m = !0) => {
|
|
4356
|
+
var ft, ot, He, Me, ge;
|
|
4357
|
+
const f = u || {}, w = ((ft = f == null ? void 0 : f.summary) == null ? void 0 : ft.currency) || (me == null ? void 0 : me.currency) || yt, v = Tn(r, N), j = An(r), H = N != null && N.sku ? N.sku : (r == null ? void 0 : r.id) ?? (me == null ? void 0 : me.product_id), A = (N == null ? void 0 : N.sku) ?? ei(r), M = pt(N) || ti(r), E = gt(N) || ri(r), le = Ft(f), Pe = ((ot = f == null ? void 0 : f.summary) == null ? void 0 : ot.product_total) != null ? +f.summary.product_total : Hr(f), ze = le > 0 ? +(Pe / le).toFixed(2) : 0, De = Pe, nt = ((He = f == null ? void 0 : f.summary) == null ? void 0 : He.tax) ?? +(Pe * 0.08).toFixed(2), Fe = ((Me = f == null ? void 0 : f.summary) == null ? void 0 : Me.shipping_fee) ?? ((X == null ? void 0 : X.price) || 0), Ee = f != null && f.address ? [
|
|
4359
4358
|
f.address.addressLine1,
|
|
4360
4359
|
f.address.addressLine2,
|
|
4361
4360
|
f.address.street,
|
|
4362
4361
|
[f.address.city, f.address.state, f.address.postalCode].filter(Boolean).join(", "),
|
|
4363
4362
|
f.address.country
|
|
4364
|
-
].filter(Boolean).map((
|
|
4363
|
+
].filter(Boolean).map((mt) => We(String(mt))).join(", ") : "—", Ke = (f == null ? void 0 : f.payment) || "card", ut = Ke === "card" ? /* @__PURE__ */ d(ke, { children: [
|
|
4365
4364
|
"Credit Card — Mastercard",
|
|
4366
4365
|
/* @__PURE__ */ a("br", {}),
|
|
4367
4366
|
"•••• 7820 Exp: 12/26"
|
|
@@ -4369,11 +4368,11 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4369
4368
|
return /* @__PURE__ */ d("div", { className: "mx-auto mt-3 mb-3 rounded-2xl bg-white", children: [
|
|
4370
4369
|
/* @__PURE__ */ a("div", { className: "px-6 pt-5 pb-3", children: /* @__PURE__ */ d("h3", { className: "font-semibold text-lg mb-2 text-gray-800 flex items-center gap-2", children: [
|
|
4371
4370
|
/* @__PURE__ */ a(
|
|
4372
|
-
|
|
4371
|
+
de,
|
|
4373
4372
|
{
|
|
4374
4373
|
icon: "mdi:receipt-text-check-outline",
|
|
4375
4374
|
width: "24",
|
|
4376
|
-
color:
|
|
4375
|
+
color: dt
|
|
4377
4376
|
}
|
|
4378
4377
|
),
|
|
4379
4378
|
"All set! Here’s what your smart order looks like 🧾"
|
|
@@ -4387,7 +4386,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4387
4386
|
className: "w-full h-full object-contain"
|
|
4388
4387
|
}
|
|
4389
4388
|
) : /* @__PURE__ */ a(
|
|
4390
|
-
|
|
4389
|
+
de,
|
|
4391
4390
|
{
|
|
4392
4391
|
icon: "mdi:image-outline",
|
|
4393
4392
|
width: "24",
|
|
@@ -4402,11 +4401,11 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4402
4401
|
" ",
|
|
4403
4402
|
H ?? "—"
|
|
4404
4403
|
] }),
|
|
4405
|
-
(
|
|
4406
|
-
|
|
4404
|
+
(A || M || E) && /* @__PURE__ */ d("div", { className: "text-xs text-gray-600 mt-0.5 text-center", children: [
|
|
4405
|
+
A && /* @__PURE__ */ d(ke, { children: [
|
|
4407
4406
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
|
|
4408
4407
|
" ",
|
|
4409
|
-
|
|
4408
|
+
A,
|
|
4410
4409
|
" "
|
|
4411
4410
|
] }),
|
|
4412
4411
|
M && /* @__PURE__ */ d(ke, { children: [
|
|
@@ -4415,25 +4414,25 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4415
4414
|
M,
|
|
4416
4415
|
" "
|
|
4417
4416
|
] }),
|
|
4418
|
-
|
|
4417
|
+
E && /* @__PURE__ */ d(ke, { children: [
|
|
4419
4418
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "Size:" }),
|
|
4420
4419
|
" ",
|
|
4421
|
-
|
|
4420
|
+
E
|
|
4422
4421
|
] })
|
|
4423
4422
|
] })
|
|
4424
4423
|
] }),
|
|
4425
4424
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3", children: [
|
|
4426
4425
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4427
4426
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Unit Price" }),
|
|
4428
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4427
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: at(ze, w) })
|
|
4429
4428
|
] }),
|
|
4430
4429
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4431
4430
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Quantity" }),
|
|
4432
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4431
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: le })
|
|
4433
4432
|
] }),
|
|
4434
4433
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4435
4434
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Subtotal" }),
|
|
4436
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4435
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: at(De, w) })
|
|
4437
4436
|
] })
|
|
4438
4437
|
] })
|
|
4439
4438
|
] })
|
|
@@ -4446,58 +4445,58 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4446
4445
|
] }),
|
|
4447
4446
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4448
4447
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💳 Payment" }),
|
|
4449
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children:
|
|
4448
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: ut })
|
|
4450
4449
|
] }),
|
|
4451
4450
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4452
4451
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Delivery" }),
|
|
4453
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: f != null && f.delivery && ((
|
|
4452
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-sm font-semibold text-gray-900 text-center", children: f != null && f.delivery && ((ge = Fn[f.delivery]) == null ? void 0 : ge.name) || "—" })
|
|
4454
4453
|
] })
|
|
4455
4454
|
] }),
|
|
4456
4455
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
4457
4456
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4458
4457
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💰 any(s)" }),
|
|
4459
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4458
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(Pe, w) })
|
|
4460
4459
|
] }),
|
|
4461
4460
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4462
4461
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🏛️ Taxes" }),
|
|
4463
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4462
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(nt, w) })
|
|
4464
4463
|
] }),
|
|
4465
4464
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center justify-center rounded-xl border border-gray-200 bg-gray-50 p-4 text-center", children: [
|
|
4466
4465
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Shipping" }),
|
|
4467
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4466
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: at(Fe, w) })
|
|
4468
4467
|
] })
|
|
4469
4468
|
] }),
|
|
4470
4469
|
/* @__PURE__ */ d(
|
|
4471
4470
|
"div",
|
|
4472
4471
|
{
|
|
4473
4472
|
className: "mt-4 rounded-xl p-4 text-center text-white shadow-sm",
|
|
4474
|
-
style: { background:
|
|
4473
|
+
style: { background: Bt },
|
|
4475
4474
|
children: [
|
|
4476
4475
|
/* @__PURE__ */ a("div", { className: "text-sm/5 opacity-95", children: "🔹 Total Payable" }),
|
|
4477
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children:
|
|
4476
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children: at(Pe + nt + Fe, w) })
|
|
4478
4477
|
]
|
|
4479
4478
|
}
|
|
4480
4479
|
)
|
|
4481
4480
|
] }),
|
|
4482
4481
|
!m && /* @__PURE__ */ d("div", { className: "px-6 pb-5", children: [
|
|
4483
4482
|
!F && /* @__PURE__ */ a("p", { className: "mt-3 text-center text-sm text-gray-700", children: "Everything looks good! Do you want me to watch this product and buy it automatically when it meets your condition?" }),
|
|
4484
|
-
F &&
|
|
4483
|
+
F && qr({ intentMandateId: Nt }),
|
|
4485
4484
|
$e && !F && /* @__PURE__ */ d("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-3", children: [
|
|
4486
4485
|
/* @__PURE__ */ a(
|
|
4487
4486
|
"button",
|
|
4488
4487
|
{
|
|
4489
4488
|
onClick: jo,
|
|
4490
4489
|
className: "inline-flex items-center justify-center rounded-full px-6 py-2.5 font-semibold text-white shadow-md transition-transform duration-150 hover:-translate-y-0.5 hover:shadow-lg",
|
|
4491
|
-
style: { background:
|
|
4490
|
+
style: { background: Bt },
|
|
4492
4491
|
children: "Confirm"
|
|
4493
4492
|
}
|
|
4494
4493
|
),
|
|
4495
4494
|
/* @__PURE__ */ a(
|
|
4496
4495
|
"button",
|
|
4497
4496
|
{
|
|
4498
|
-
onClick:
|
|
4497
|
+
onClick: Kr,
|
|
4499
4498
|
className: "inline-flex items-center justify-center rounded-full border px-6 py-2.5 font-semibold hover:bg-gray-50",
|
|
4500
|
-
style: { borderColor:
|
|
4499
|
+
style: { borderColor: Bt, color: Bt },
|
|
4501
4500
|
children: "Cancel"
|
|
4502
4501
|
}
|
|
4503
4502
|
)
|
|
@@ -4520,7 +4519,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4520
4519
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4521
4520
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4522
4521
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4523
|
-
/* @__PURE__ */ a(
|
|
4522
|
+
/* @__PURE__ */ a(de, { icon: "mdi:home-map-marker", width: "20", color: dt }),
|
|
4524
4523
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Address" })
|
|
4525
4524
|
] }),
|
|
4526
4525
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: m })
|
|
@@ -4528,7 +4527,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4528
4527
|
}
|
|
4529
4528
|
);
|
|
4530
4529
|
}, zo = (u) => {
|
|
4531
|
-
const m = u == null ? void 0 : u.method, f = m ?
|
|
4530
|
+
const m = u == null ? void 0 : u.method, f = m ? Fn[m] : void 0;
|
|
4532
4531
|
return /* @__PURE__ */ a(
|
|
4533
4532
|
"div",
|
|
4534
4533
|
{
|
|
@@ -4536,12 +4535,12 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4536
4535
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4537
4536
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4538
4537
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4539
|
-
/* @__PURE__ */ a(
|
|
4538
|
+
/* @__PURE__ */ a(de, { icon: "mdi:truck-delivery", width: "20", color: dt }),
|
|
4540
4539
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Method" })
|
|
4541
4540
|
] }),
|
|
4542
4541
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: f ? /* @__PURE__ */ d(ke, { children: [
|
|
4543
4542
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4544
|
-
/* @__PURE__ */ a(
|
|
4543
|
+
/* @__PURE__ */ a(de, { icon: f.icon, width: "18" }),
|
|
4545
4544
|
/* @__PURE__ */ a("span", { className: "font-medium", children: f.label })
|
|
4546
4545
|
] }),
|
|
4547
4546
|
/* @__PURE__ */ a("div", { className: "text-gray-600", children: f.subtitle })
|
|
@@ -4559,11 +4558,11 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4559
4558
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4560
4559
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4561
4560
|
/* @__PURE__ */ a(
|
|
4562
|
-
|
|
4561
|
+
de,
|
|
4563
4562
|
{
|
|
4564
4563
|
icon: "mdi:credit-card-outline",
|
|
4565
4564
|
width: "20",
|
|
4566
|
-
color:
|
|
4565
|
+
color: dt
|
|
4567
4566
|
}
|
|
4568
4567
|
),
|
|
4569
4568
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Payment Method" })
|
|
@@ -4578,11 +4577,11 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4578
4577
|
);
|
|
4579
4578
|
}, Mo = (u, m) => {
|
|
4580
4579
|
const f = u.snapshotStage;
|
|
4581
|
-
if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" &&
|
|
4580
|
+
if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" && ae || f === "final" && St)
|
|
4582
4581
|
return null;
|
|
4583
4582
|
switch (f) {
|
|
4584
4583
|
case "initial":
|
|
4585
|
-
return
|
|
4584
|
+
return Qr(u.snapshotPayload, !m);
|
|
4586
4585
|
case "address":
|
|
4587
4586
|
return Lo(u.snapshotPayload);
|
|
4588
4587
|
case "delivery":
|
|
@@ -4590,9 +4589,9 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4590
4589
|
case "payment":
|
|
4591
4590
|
return Do(u.snapshotPayload);
|
|
4592
4591
|
case "final":
|
|
4593
|
-
return
|
|
4592
|
+
return Gr(u.snapshotPayload, !m);
|
|
4594
4593
|
case "success":
|
|
4595
|
-
return
|
|
4594
|
+
return qr(u.snapshotPayload);
|
|
4596
4595
|
default:
|
|
4597
4596
|
return null;
|
|
4598
4597
|
}
|
|
@@ -4670,7 +4669,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4670
4669
|
margin: "0.75rem"
|
|
4671
4670
|
},
|
|
4672
4671
|
children: /* @__PURE__ */ a(
|
|
4673
|
-
|
|
4672
|
+
de,
|
|
4674
4673
|
{
|
|
4675
4674
|
icon: "fluent:dismiss-24-filled",
|
|
4676
4675
|
color: "#ffffff",
|
|
@@ -4688,7 +4687,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4688
4687
|
/* @__PURE__ */ d(
|
|
4689
4688
|
"div",
|
|
4690
4689
|
{
|
|
4691
|
-
ref:
|
|
4690
|
+
ref: Mt,
|
|
4692
4691
|
className: "overflow-y-auto pr-5 pb-4 space-y-4 hide-scrollbar flex-grow",
|
|
4693
4692
|
children: [
|
|
4694
4693
|
/* @__PURE__ */ d(
|
|
@@ -4708,10 +4707,10 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4708
4707
|
}
|
|
4709
4708
|
),
|
|
4710
4709
|
/* @__PURE__ */ a($o, { selectedIndex: I }),
|
|
4711
|
-
q > 1 && /* @__PURE__ */ a(
|
|
4712
|
-
|
|
4710
|
+
q > 1 && /* @__PURE__ */ a(Wr, { showSubmit: !1 }),
|
|
4711
|
+
h.map((u, m) => {
|
|
4713
4712
|
var v;
|
|
4714
|
-
const f = m ===
|
|
4713
|
+
const f = m === h.length - 1, w = !!u.snapshotStage;
|
|
4715
4714
|
return /* @__PURE__ */ d("div", { children: [
|
|
4716
4715
|
u.query && /* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a(
|
|
4717
4716
|
"p",
|
|
@@ -4735,14 +4734,14 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4735
4734
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a("p", { children: u.snapshotPayload.text }) })
|
|
4736
4735
|
}
|
|
4737
4736
|
) }),
|
|
4738
|
-
f &&
|
|
4737
|
+
f && ct && q > 1 && /* @__PURE__ */ d("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
|
|
4739
4738
|
/* @__PURE__ */ d("div", { className: "text-sm text-gray-800", children: [
|
|
4740
4739
|
"Proceed with color:",
|
|
4741
4740
|
" ",
|
|
4742
4741
|
/* @__PURE__ */ a("span", { className: "font-semibold", children: C || "—" }),
|
|
4743
4742
|
", size:",
|
|
4744
4743
|
" ",
|
|
4745
|
-
/* @__PURE__ */ a("span", { className: "font-semibold", children:
|
|
4744
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: re || "—" }),
|
|
4746
4745
|
"?"
|
|
4747
4746
|
] }),
|
|
4748
4747
|
/* @__PURE__ */ d("div", { className: "mt-3 flex gap-3", children: [
|
|
@@ -4769,7 +4768,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4769
4768
|
)
|
|
4770
4769
|
] })
|
|
4771
4770
|
] }),
|
|
4772
|
-
f && rt && /* @__PURE__ */ a(
|
|
4771
|
+
f && rt && /* @__PURE__ */ a(Wr, { showSubmit: !0 }),
|
|
4773
4772
|
f && Ie && /* @__PURE__ */ a("div", { className: "mt-4", children: /* @__PURE__ */ a(
|
|
4774
4773
|
"div",
|
|
4775
4774
|
{
|
|
@@ -4791,7 +4790,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4791
4790
|
boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
|
|
4792
4791
|
overflow: "hidden"
|
|
4793
4792
|
},
|
|
4794
|
-
children: w ? Mo(u, f) :
|
|
4793
|
+
children: w ? Mo(u, f) : Qr(
|
|
4795
4794
|
u.snapshotPayload,
|
|
4796
4795
|
!1
|
|
4797
4796
|
)
|
|
@@ -4803,7 +4802,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4803
4802
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4804
4803
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4805
4804
|
/* @__PURE__ */ a(
|
|
4806
|
-
|
|
4805
|
+
de,
|
|
4807
4806
|
{
|
|
4808
4807
|
icon: "mdi:home-map-marker",
|
|
4809
4808
|
width: "24",
|
|
@@ -4845,7 +4844,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4845
4844
|
className: `space-y-3 ${G ? "opacity-70" : ""}`,
|
|
4846
4845
|
children: [
|
|
4847
4846
|
U.map((u) => {
|
|
4848
|
-
const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((
|
|
4847
|
+
const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((A) => We(A || "")).join(" "), f = We(u.city || ""), w = `${We(u.state || "")}${u.state && u.postalCode ? ", " : ""}${u.postalCode || ""}`, v = We(u.country || ""), j = String(u.addressId ?? u.id), H = R === j;
|
|
4849
4848
|
return /* @__PURE__ */ d(
|
|
4850
4849
|
"label",
|
|
4851
4850
|
{
|
|
@@ -4860,7 +4859,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4860
4859
|
className: "mt-1 accent-tanya-light",
|
|
4861
4860
|
checked: H,
|
|
4862
4861
|
disabled: G,
|
|
4863
|
-
onChange: () =>
|
|
4862
|
+
onChange: () => oe(j),
|
|
4864
4863
|
value: j
|
|
4865
4864
|
}
|
|
4866
4865
|
),
|
|
@@ -4883,7 +4882,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4883
4882
|
/* @__PURE__ */ a(
|
|
4884
4883
|
"button",
|
|
4885
4884
|
{
|
|
4886
|
-
onClick:
|
|
4885
|
+
onClick: Jr,
|
|
4887
4886
|
className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
|
|
4888
4887
|
style: {
|
|
4889
4888
|
borderColor: "var(--tanya-light)",
|
|
@@ -4911,7 +4910,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4911
4910
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4912
4911
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4913
4912
|
/* @__PURE__ */ a(
|
|
4914
|
-
|
|
4913
|
+
de,
|
|
4915
4914
|
{
|
|
4916
4915
|
icon: "mdi:truck-delivery",
|
|
4917
4916
|
width: "24",
|
|
@@ -4920,7 +4919,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4920
4919
|
),
|
|
4921
4920
|
"Great! Now choose how fast you want it delivered 🚚"
|
|
4922
4921
|
] }),
|
|
4923
|
-
|
|
4922
|
+
ee && /* @__PURE__ */ d(ke, { children: [
|
|
4924
4923
|
/* @__PURE__ */ a("span", { className: "ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold", children: "Selected" }),
|
|
4925
4924
|
!F && /* @__PURE__ */ a(
|
|
4926
4925
|
"button",
|
|
@@ -4941,15 +4940,15 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4941
4940
|
/* @__PURE__ */ a(
|
|
4942
4941
|
"div",
|
|
4943
4942
|
{
|
|
4944
|
-
className: `space-y-3 ${
|
|
4945
|
-
children:
|
|
4943
|
+
className: `space-y-3 ${ee ? "opacity-70" : ""}`,
|
|
4944
|
+
children: T.map(
|
|
4946
4945
|
(u) => {
|
|
4947
|
-
const m =
|
|
4946
|
+
const m = X.id === u.id;
|
|
4948
4947
|
return /* @__PURE__ */ d(
|
|
4949
4948
|
"label",
|
|
4950
4949
|
{
|
|
4951
|
-
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${
|
|
4952
|
-
title:
|
|
4950
|
+
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${m ? "border-tanya-light" : "border-gray-300"} ${ee ? "pointer-events-none" : ""}`,
|
|
4951
|
+
title: ee ? "Delivery already submitted" : "",
|
|
4953
4952
|
children: [
|
|
4954
4953
|
/* @__PURE__ */ a(
|
|
4955
4954
|
"input",
|
|
@@ -4957,19 +4956,19 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4957
4956
|
type: "radio",
|
|
4958
4957
|
name: "delivery",
|
|
4959
4958
|
className: "mt-1 accent-tanya-light",
|
|
4960
|
-
checked:
|
|
4961
|
-
disabled:
|
|
4959
|
+
checked: m,
|
|
4960
|
+
disabled: ee,
|
|
4962
4961
|
onChange: () => _(u)
|
|
4963
4962
|
}
|
|
4964
4963
|
),
|
|
4965
4964
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
4966
|
-
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children:
|
|
4967
|
-
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children:
|
|
4965
|
+
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: u.name }),
|
|
4966
|
+
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children: u.description })
|
|
4968
4967
|
] }),
|
|
4969
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children:
|
|
4968
|
+
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: u.price === 0 ? "Free" : u.price })
|
|
4970
4969
|
]
|
|
4971
4970
|
},
|
|
4972
|
-
|
|
4971
|
+
key
|
|
4973
4972
|
);
|
|
4974
4973
|
}
|
|
4975
4974
|
)
|
|
@@ -4979,7 +4978,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4979
4978
|
/* @__PURE__ */ a(
|
|
4980
4979
|
"button",
|
|
4981
4980
|
{
|
|
4982
|
-
onClick:
|
|
4981
|
+
onClick: Jr,
|
|
4983
4982
|
className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
|
|
4984
4983
|
style: {
|
|
4985
4984
|
borderColor: "var(--tanya-light)",
|
|
@@ -4992,19 +4991,19 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
4992
4991
|
"button",
|
|
4993
4992
|
{
|
|
4994
4993
|
onClick: Fo,
|
|
4995
|
-
disabled:
|
|
4996
|
-
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${
|
|
4994
|
+
disabled: ee,
|
|
4995
|
+
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${ee ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4997
4996
|
style: { background: Le },
|
|
4998
|
-
children:
|
|
4997
|
+
children: ee ? "Delivery Submitted" : "Submit Delivery Option"
|
|
4999
4998
|
}
|
|
5000
4999
|
)
|
|
5001
5000
|
] })
|
|
5002
5001
|
] }),
|
|
5003
|
-
|
|
5002
|
+
ae && /* @__PURE__ */ d("div", { className: "mt-2 mb-6 mx-6 rounded-xl p-6 shadow-md border border-gray-200 bg-white animate-fade-in", children: [
|
|
5004
5003
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
5005
5004
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
5006
5005
|
/* @__PURE__ */ a(
|
|
5007
|
-
|
|
5006
|
+
de,
|
|
5008
5007
|
{
|
|
5009
5008
|
icon: "mdi:credit-card-outline",
|
|
5010
5009
|
width: "24",
|
|
@@ -5049,12 +5048,12 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5049
5048
|
className: "mt-1 accent-tanya-light",
|
|
5050
5049
|
checked: Ae === "card",
|
|
5051
5050
|
disabled: Oe,
|
|
5052
|
-
onChange: () =>
|
|
5051
|
+
onChange: () => kt("card")
|
|
5053
5052
|
}
|
|
5054
5053
|
),
|
|
5055
5054
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
5056
5055
|
/* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
|
|
5057
|
-
/* @__PURE__ */ a(
|
|
5056
|
+
/* @__PURE__ */ a(de, { icon: "mdi:credit-card-chip-outline", width: "18" }),
|
|
5058
5057
|
" ",
|
|
5059
5058
|
"Credit Card"
|
|
5060
5059
|
] }),
|
|
@@ -5094,15 +5093,15 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5094
5093
|
)
|
|
5095
5094
|
] })
|
|
5096
5095
|
] }),
|
|
5097
|
-
|
|
5096
|
+
St && Gr(
|
|
5098
5097
|
{
|
|
5099
|
-
...
|
|
5098
|
+
...me,
|
|
5100
5099
|
address: JSON.parse(
|
|
5101
5100
|
localStorage.getItem("agentic_order_address") || "null"
|
|
5102
5101
|
),
|
|
5103
5102
|
delivery: localStorage.getItem("agentic_order_delivery"),
|
|
5104
5103
|
payment: localStorage.getItem("agentic_order_payment"),
|
|
5105
|
-
summary:
|
|
5104
|
+
summary: Vr(me == null ? void 0 : me.currency)
|
|
5106
5105
|
},
|
|
5107
5106
|
!1
|
|
5108
5107
|
)
|
|
@@ -5113,13 +5112,13 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5113
5112
|
/* @__PURE__ */ a(
|
|
5114
5113
|
"input",
|
|
5115
5114
|
{
|
|
5116
|
-
placeholder: Se ? "Complete the current step…" :
|
|
5115
|
+
placeholder: Se ? "Complete the current step…" : Pt ? `What would you like me to do? (e.g., If this product goes below $${parseInt(r.price) - 5}, grab it for me.)` : "Please select a combination first.",
|
|
5117
5116
|
disabled: ko,
|
|
5118
5117
|
className: `w-full rounded-full p-4 outline-none border-none focus:ring-0 focus:border-transparent disabled:bg-gray-100 disabled:cursor-not-allowed
|
|
5119
|
-
${
|
|
5118
|
+
${Pt ? "" : "placeholder:text-red-400 text-red-500"}`,
|
|
5120
5119
|
value: z,
|
|
5121
5120
|
onKeyDown: (u) => {
|
|
5122
|
-
u.key === "Enter" && !Ie && !Se &&
|
|
5121
|
+
u.key === "Enter" && !Ie && !Se && Yr();
|
|
5123
5122
|
},
|
|
5124
5123
|
onChange: (u) => Te(u.target.value)
|
|
5125
5124
|
}
|
|
@@ -5131,7 +5130,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5131
5130
|
disabled: Ie || Se,
|
|
5132
5131
|
className: "mr-6 font-medium",
|
|
5133
5132
|
style: { color: "var(--tanya-light)" },
|
|
5134
|
-
onClick: () =>
|
|
5133
|
+
onClick: () => Yr(),
|
|
5135
5134
|
children: Ie ? /* @__PURE__ */ a(
|
|
5136
5135
|
"div",
|
|
5137
5136
|
{
|
|
@@ -5139,7 +5138,7 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5139
5138
|
style: { borderBottom: "2px solid" }
|
|
5140
5139
|
}
|
|
5141
5140
|
) : /* @__PURE__ */ a(
|
|
5142
|
-
|
|
5141
|
+
de,
|
|
5143
5142
|
{
|
|
5144
5143
|
icon: "fluent:send-48-filled",
|
|
5145
5144
|
color: "var(--tanya-light)",
|
|
@@ -5160,6 +5159,6 @@ const xt = "USD", Ks = (e, t = xt) => {
|
|
|
5160
5159
|
export {
|
|
5161
5160
|
vi as AgenticShoppingButton,
|
|
5162
5161
|
bi as TanyaChatbot,
|
|
5163
|
-
|
|
5162
|
+
pi as TanyaChatbotProvider
|
|
5164
5163
|
};
|
|
5165
5164
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|