tanya-chatbot 0.9.8 → 0.9.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/tanya-chatbot.cjs.js +11 -11
- package/dist/tanya-chatbot.cjs.js.map +1 -1
- package/dist/tanya-chatbot.es.js +1056 -1080
- package/dist/tanya-chatbot.es.js.map +1 -1
- package/package.json +1 -1
package/dist/tanya-chatbot.es.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { useEffect as
|
|
1
|
+
import { useEffect as xe, useState as b, useRef as Ve, forwardRef as $n, createElement as pr, useMemo as en } from "react";
|
|
2
2
|
import { jsx as a, jsxs as d, Fragment as ke } from "react/jsx-runtime";
|
|
3
|
-
import { createHttpLink as Uo, ApolloClient as
|
|
4
|
-
import { Provider as Vo, useDispatch as
|
|
5
|
-
import { createSlice as
|
|
6
|
-
import * as
|
|
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 er } from "react-redux";
|
|
5
|
+
import { createSlice as zn, configureStore as Yo } from "@reduxjs/toolkit";
|
|
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
|
-
import { toast as
|
|
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
|
|
16
|
-
return
|
|
15
|
+
function pi() {
|
|
16
|
+
return xe(() => {
|
|
17
17
|
if (typeof document < "u") {
|
|
18
18
|
const e = document.createElement("style");
|
|
19
19
|
return e.textContent = Wo, document.head.appendChild(e), () => {
|
|
@@ -56,7 +56,7 @@ const Qo = {
|
|
|
56
56
|
mobile: []
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
},
|
|
59
|
+
}, Mn = zn({
|
|
60
60
|
name: "store",
|
|
61
61
|
initialState: Qo,
|
|
62
62
|
reducers: {
|
|
@@ -64,9 +64,9 @@ const Qo = {
|
|
|
64
64
|
e.store = t.payload;
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
}), { setStore:
|
|
67
|
+
}), { setStore: gi } = Mn.actions, Go = Mn.reducer, Xo = {
|
|
68
68
|
product: null
|
|
69
|
-
},
|
|
69
|
+
}, Bn = zn({
|
|
70
70
|
name: "product",
|
|
71
71
|
initialState: Xo,
|
|
72
72
|
reducers: {
|
|
@@ -74,7 +74,7 @@ const Qo = {
|
|
|
74
74
|
e.product = t.payload;
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
|
-
}), { setProduct: gr } =
|
|
77
|
+
}), { setProduct: gr } = Bn.actions, Zo = Bn.reducer, ea = Yo({
|
|
78
78
|
reducer: {
|
|
79
79
|
store: Go,
|
|
80
80
|
product: Zo
|
|
@@ -91,28 +91,28 @@ const Qo = {
|
|
|
91
91
|
function ra({
|
|
92
92
|
...e
|
|
93
93
|
}) {
|
|
94
|
-
return /* @__PURE__ */ a(
|
|
94
|
+
return /* @__PURE__ */ a(Dn.Root, { "data-slot": "popover", ...e });
|
|
95
95
|
}
|
|
96
96
|
function na({
|
|
97
97
|
...e
|
|
98
98
|
}) {
|
|
99
|
-
return /* @__PURE__ */ a(
|
|
99
|
+
return /* @__PURE__ */ a(Dn.Trigger, { "data-slot": "popover-trigger", ...e });
|
|
100
100
|
}
|
|
101
|
-
const
|
|
101
|
+
const Ze = () => ({ 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
|
|
105
|
-
`${e}api/auth/token-bm-grant?baseUrl=${
|
|
104
|
+
const t = await ue.post(
|
|
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
|
|
115
|
-
`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${
|
|
114
|
+
const r = JSON.parse(sessionStorage.getItem("customerData") || "{}").dwsid, n = await ue.post(
|
|
115
|
+
`${t}api/auth/token-existing-guest-customer?dwsid=${r}&baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
116
116
|
{},
|
|
117
117
|
{
|
|
118
118
|
headers: {
|
|
@@ -123,12 +123,12 @@ const Je = () => ({ 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
|
-
async function
|
|
129
|
+
async function Xe() {
|
|
130
130
|
var s;
|
|
131
|
-
const e =
|
|
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
134
|
const wr = async (e, t) => {
|
|
@@ -156,18 +156,18 @@ const wr = async (e, t) => {
|
|
|
156
156
|
} catch (r) {
|
|
157
157
|
return console.error("Error obtaining JWT token:", r), e = null, t = null, null;
|
|
158
158
|
}
|
|
159
|
-
},
|
|
159
|
+
}, Ye = () => sessionStorage.getItem("Host"), Ue = () => sessionStorage.getItem("SiteId"), et = () => sessionStorage.getItem("pubCfg"), tt = () => sessionStorage.getItem("envRef"), rt = () => sessionStorage.getItem("orgRef"), oa = async (e) => {
|
|
160
160
|
console.log("fetching results");
|
|
161
|
-
const { serverUrl: t, basePath: r } =
|
|
161
|
+
const { serverUrl: t, basePath: r } = Ze();
|
|
162
162
|
let n = "";
|
|
163
163
|
{
|
|
164
|
-
const o = await
|
|
164
|
+
const o = await Xe();
|
|
165
165
|
console.log("the token from getSearchResults", o), n = o.access_token;
|
|
166
166
|
}
|
|
167
167
|
try {
|
|
168
|
-
const o =
|
|
169
|
-
return (await
|
|
170
|
-
`${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${
|
|
168
|
+
const o = Ye();
|
|
169
|
+
return (await ue.get(
|
|
170
|
+
`${t}${r}/search-sfcc?baseUrl=${o}&query=${e}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
171
171
|
{
|
|
172
172
|
headers: {
|
|
173
173
|
"Content-Type": "application/json",
|
|
@@ -180,11 +180,11 @@ const wr = async (e, t) => {
|
|
|
180
180
|
}
|
|
181
181
|
}, Rn = async (e) => {
|
|
182
182
|
if (!e) throw new Error("Product ID is required");
|
|
183
|
-
const { serverUrl: t, basePath: r } =
|
|
183
|
+
const { serverUrl: t, basePath: r } = Ze(), n = Ye();
|
|
184
184
|
console.log("calling access");
|
|
185
|
-
const { access_token: o } = await
|
|
186
|
-
return (await
|
|
187
|
-
`${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${
|
|
185
|
+
const { access_token: o } = await Xe();
|
|
186
|
+
return (await ue.get(
|
|
187
|
+
`${t}${r}/product-sfcc/${e}?baseUrl=${n}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
188
188
|
{
|
|
189
189
|
headers: {
|
|
190
190
|
"Content-Type": "application/json",
|
|
@@ -194,11 +194,11 @@ const wr = async (e, t) => {
|
|
|
194
194
|
)).data;
|
|
195
195
|
}, aa = async (e) => {
|
|
196
196
|
if (!e) throw new Error("customerId is required");
|
|
197
|
-
const t = await
|
|
197
|
+
const t = await Un(), { customer_token: r } = await qn(
|
|
198
198
|
t
|
|
199
|
-
), { serverUrl: n, basePath: o } =
|
|
200
|
-
return (await
|
|
201
|
-
`${n}${o}/get-interest?baseUrl=${
|
|
199
|
+
), { serverUrl: n, basePath: o } = Ze(), i = (await Xe()).access_token;
|
|
200
|
+
return (await ue.get(
|
|
201
|
+
`${n}${o}/get-interest?baseUrl=${Ye()}&customerId=${e}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
202
202
|
{
|
|
203
203
|
headers: {
|
|
204
204
|
"Content-Type": "application/json",
|
|
@@ -206,10 +206,10 @@ const wr = async (e, t) => {
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
)).data;
|
|
209
|
-
},
|
|
209
|
+
}, tn = (e) => String(typeof e == "string" ? e : e["en-US"] || e), rn = (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
|
+
}), nn = (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,13 +218,13 @@ 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), on = (e, t) => e.length < t ? e : e.slice(0, t) + "...", lr = (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("");
|
|
225
225
|
function la() {
|
|
226
|
-
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, r] =
|
|
227
|
-
return
|
|
226
|
+
const e = () => window.innerWidth < 425 ? 1 : window.innerWidth < 768 ? 2 : 4, [t, r] = b(e);
|
|
227
|
+
return xe(() => {
|
|
228
228
|
const n = () => r(e());
|
|
229
229
|
return window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
230
230
|
}, []), t;
|
|
@@ -232,7 +232,7 @@ function la() {
|
|
|
232
232
|
const ca = ({
|
|
233
233
|
product: e
|
|
234
234
|
}) => {
|
|
235
|
-
const t =
|
|
235
|
+
const t = Ln(), r = la(), [n, o] = b(0), s = () => {
|
|
236
236
|
o(
|
|
237
237
|
(l) => l + r >= e.length ? 0 : l + r
|
|
238
238
|
);
|
|
@@ -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(gr(
|
|
244
|
+
const p = await Rn(l);
|
|
245
|
+
t(gr(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 = rn(l)[0]) == null ? void 0 : p.link) || rn(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 : on(
|
|
287
|
+
tn((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 : on(
|
|
302
|
+
tn((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
|
-
(
|
|
310
|
+
l != null && l.price ? Number(l == null ? void 0 : l.price) : nn(l).centAmount || 0,
|
|
311
|
+
(x = nn(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,12 +363,12 @@ const ca = ({
|
|
|
363
363
|
]
|
|
364
364
|
},
|
|
365
365
|
n
|
|
366
|
-
)) }),
|
|
366
|
+
)) }), Ir = async (e, t) => {
|
|
367
367
|
var s, i;
|
|
368
|
-
const { serverUrl: r, basePath: n } =
|
|
368
|
+
const { serverUrl: r, basePath: n } = Ze(), o = `${r}`;
|
|
369
369
|
try {
|
|
370
|
-
const c = await
|
|
371
|
-
`${o}${n}/basket/create?baseUrl=${
|
|
370
|
+
const c = await ue.post(
|
|
371
|
+
`${o}${n}/basket/create?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
372
372
|
t,
|
|
373
373
|
{
|
|
374
374
|
headers: {
|
|
@@ -385,37 +385,13 @@ const ca = ({
|
|
|
385
385
|
"*"
|
|
386
386
|
), c.data;
|
|
387
387
|
} catch (c) {
|
|
388
|
-
return
|
|
389
|
-
}
|
|
390
|
-
}, ua = async () => {
|
|
391
|
-
var s, i;
|
|
392
|
-
const e = await rt(), t = "Bearer " + (e == null ? void 0 : e.access_token), { serverUrl: r, basePath: n } = Je(), o = `${r}`;
|
|
393
|
-
try {
|
|
394
|
-
const c = await re.post(
|
|
395
|
-
`${o}${n}/basket/agentic-create?baseUrl=${Re()}&siteId=${Oe()}&pubCfg=${Ke()}&envRef=${We()}&orgRef=${Qe()}`,
|
|
396
|
-
{},
|
|
397
|
-
{
|
|
398
|
-
headers: {
|
|
399
|
-
"Content-Type": "application/json",
|
|
400
|
-
Authorization: t
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
);
|
|
404
|
-
return window.postMessage(
|
|
405
|
-
{
|
|
406
|
-
type: "WIDGET_CREATED_BASKET",
|
|
407
|
-
basketId: ((s = c.data) == null ? void 0 : s.basket_id) || ((i = c.data) == null ? void 0 : i.basketId)
|
|
408
|
-
},
|
|
409
|
-
"*"
|
|
410
|
-
), c.data;
|
|
411
|
-
} catch (c) {
|
|
412
|
-
return re.isAxiosError(c) ? console.error("Error creating basket:", c.response || c.message) : console.error("Unexpected error:", c), null;
|
|
388
|
+
return ue.isAxiosError(c) ? console.error("Error creating basket:", c.response || c.message) : console.error("Unexpected error:", c), null;
|
|
413
389
|
}
|
|
414
390
|
}, yr = async (e, t, r) => {
|
|
415
|
-
const { serverUrl: n, basePath: o } =
|
|
391
|
+
const { serverUrl: n, basePath: o } = Ze(), s = `${n}`;
|
|
416
392
|
try {
|
|
417
|
-
const i = await
|
|
418
|
-
`${s}${o}/basket/add-product/${e}?baseUrl=${
|
|
393
|
+
const i = await ue.post(
|
|
394
|
+
`${s}${o}/basket/add-product/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
419
395
|
t,
|
|
420
396
|
{
|
|
421
397
|
headers: {
|
|
@@ -426,7 +402,7 @@ const ca = ({
|
|
|
426
402
|
);
|
|
427
403
|
return i.status === 200 && i.data ? i.data : null;
|
|
428
404
|
} catch (i) {
|
|
429
|
-
return
|
|
405
|
+
return ue.isAxiosError(i) ? console.error(
|
|
430
406
|
"Error adding products to basket:",
|
|
431
407
|
i.response || i.message
|
|
432
408
|
) : console.error("Unexpected error:", i), null;
|
|
@@ -436,10 +412,10 @@ const ca = ({
|
|
|
436
412
|
customer_token: t
|
|
437
413
|
}) => {
|
|
438
414
|
var s;
|
|
439
|
-
const { serverUrl: r, basePath: n } =
|
|
415
|
+
const { serverUrl: r, basePath: n } = Ze(), o = `${r}`;
|
|
440
416
|
try {
|
|
441
|
-
const i = await
|
|
442
|
-
`${o}${n}/basket/${e}?baseUrl=${
|
|
417
|
+
const i = await ue.get(
|
|
418
|
+
`${o}${n}/basket/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
443
419
|
{
|
|
444
420
|
headers: {
|
|
445
421
|
"Content-Type": "application/json",
|
|
@@ -449,13 +425,13 @@ const ca = ({
|
|
|
449
425
|
);
|
|
450
426
|
return { status: i.status, data: i.data };
|
|
451
427
|
} catch (i) {
|
|
452
|
-
return
|
|
428
|
+
return ue.isAxiosError(i) ? { status: (s = i.response) == null ? void 0 : s.status, data: null } : { status: null, data: null };
|
|
453
429
|
}
|
|
454
|
-
},
|
|
455
|
-
const { serverUrl: t, basePath: r } =
|
|
430
|
+
}, ua = async (e) => {
|
|
431
|
+
const { serverUrl: t, basePath: r } = Ze(), n = `${t}`, o = await Xe(), s = "Bearer " + (o == null ? void 0 : o.access_token);
|
|
456
432
|
try {
|
|
457
|
-
return (await
|
|
458
|
-
`${n}${r}/basket/shipping-methods/${e}?baseUrl=${
|
|
433
|
+
return (await ue.get(
|
|
434
|
+
`${n}${r}/basket/shipping-methods/${e}?baseUrl=${Ye()}&siteId=${Ue()}&pubCfg=${et()}&envRef=${tt()}&orgRef=${rt()}`,
|
|
459
435
|
{
|
|
460
436
|
headers: {
|
|
461
437
|
"Content-Type": "application/json",
|
|
@@ -464,12 +440,12 @@ const ca = ({
|
|
|
464
440
|
}
|
|
465
441
|
)).data;
|
|
466
442
|
} catch (i) {
|
|
467
|
-
return
|
|
443
|
+
return ue.isAxiosError(i) ? console.error(
|
|
468
444
|
"Error fetching shipping methods:",
|
|
469
445
|
i.response || i.message
|
|
470
446
|
) : console.error("Unexpected error:", i), [];
|
|
471
447
|
}
|
|
472
|
-
}, Lt = "sfcc_basket_id",
|
|
448
|
+
}, Lt = "sfcc_basket_id", an = "sfcc_customer_token", zt = "sfcc_token_expiry", fa = 300 * 1e3, Vt = "1.0.0";
|
|
473
449
|
const lt = (e) => {
|
|
474
450
|
try {
|
|
475
451
|
e ? localStorage.setItem(Lt, e) : localStorage.removeItem(Lt);
|
|
@@ -479,25 +455,25 @@ const lt = (e) => {
|
|
|
479
455
|
}, rr = (e) => {
|
|
480
456
|
try {
|
|
481
457
|
if (e) {
|
|
482
|
-
localStorage.setItem(
|
|
483
|
-
const t = Date.now() +
|
|
458
|
+
localStorage.setItem(an, e);
|
|
459
|
+
const t = Date.now() + fa;
|
|
484
460
|
localStorage.setItem(zt, t.toString());
|
|
485
461
|
} else
|
|
486
|
-
localStorage.removeItem(
|
|
462
|
+
localStorage.removeItem(an);
|
|
487
463
|
} catch (t) {
|
|
488
464
|
console.error("Error storing token:", t);
|
|
489
465
|
}
|
|
490
|
-
},
|
|
491
|
-
var l,
|
|
492
|
-
const t =
|
|
493
|
-
if (
|
|
466
|
+
}, sn = 300, ma = ({ addToCartPwa: e }) => {
|
|
467
|
+
var l, p, g, y, x, I;
|
|
468
|
+
const t = Ln(), r = er((S) => S.product.product), n = er((S) => S.store.store), [o, s] = b(!!r);
|
|
469
|
+
if (xe(() => {
|
|
494
470
|
s(!!r);
|
|
495
471
|
}, [r]), !r) return null;
|
|
496
472
|
const i = async () => {
|
|
497
|
-
var
|
|
473
|
+
var S, A, k, P, J, q, Y, _e, C, K, re, ye, be, dt, N, ve;
|
|
498
474
|
try {
|
|
499
|
-
if (!((
|
|
500
|
-
|
|
475
|
+
if (!((A = (S = r == null ? void 0 : r.variants) == null ? void 0 : S[0]) != null && A.product_id) && !(r.type.item || r.type.bundle) && !((P = (k = r == null ? void 0 : r.variants) == null ? void 0 : k[0]) != null && P.productId)) {
|
|
476
|
+
Be.error("Variants not available", {
|
|
501
477
|
position: "bottom-right",
|
|
502
478
|
autoClose: 1e3
|
|
503
479
|
}), console.error("No product variant found");
|
|
@@ -505,49 +481,49 @@ const lt = (e) => {
|
|
|
505
481
|
}
|
|
506
482
|
const V = [
|
|
507
483
|
{
|
|
508
|
-
product_id: ((J = r.variants) == null ? void 0 : J[0].product_id) || ((
|
|
484
|
+
product_id: ((J = r.variants) == null ? void 0 : J[0].product_id) || ((q = r.variants) == null ? void 0 : q[0].productId) || (r == null ? void 0 : r.id),
|
|
509
485
|
quantity: 1
|
|
510
486
|
}
|
|
511
487
|
], $ = JSON.parse(
|
|
512
488
|
sessionStorage.getItem("customerData") || "{}"
|
|
513
|
-
),
|
|
489
|
+
), Je = ($ == null ? void 0 : $.basketId) || localStorage.getItem(Lt), ut = !1, qe = localStorage.getItem(zt), nt = Date.now();
|
|
514
490
|
if (!ut || !qe || nt >= parseInt(qe)) {
|
|
515
491
|
let fe = "";
|
|
516
|
-
if (fe = "Bearer " + (await
|
|
492
|
+
if (fe = "Bearer " + (await Xe()).access_token, !fe) {
|
|
517
493
|
console.error("Failed to get customer_token");
|
|
518
494
|
return;
|
|
519
495
|
}
|
|
520
|
-
const
|
|
521
|
-
if (rr(fe), localStorage.setItem(zt,
|
|
496
|
+
const Ie = nt + 300 * 1e3;
|
|
497
|
+
if (rr(fe), localStorage.setItem(zt, Ie.toString()), Je) {
|
|
522
498
|
const Se = await Hn({
|
|
523
|
-
basketId:
|
|
499
|
+
basketId: Je,
|
|
524
500
|
customer_token: fe
|
|
525
501
|
});
|
|
526
502
|
if (Se.status === 200 && Se) {
|
|
527
|
-
const
|
|
528
|
-
|
|
503
|
+
const ne = await yr(
|
|
504
|
+
Je,
|
|
529
505
|
V,
|
|
530
506
|
fe
|
|
531
507
|
);
|
|
532
|
-
(((Y =
|
|
508
|
+
(((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", {
|
|
533
509
|
position: "bottom-right",
|
|
534
510
|
autoClose: 3e3,
|
|
535
511
|
hideProgressBar: !1,
|
|
536
512
|
closeOnClick: !0,
|
|
537
513
|
pauseOnHover: !0,
|
|
538
514
|
draggable: !0
|
|
539
|
-
}), tr(
|
|
515
|
+
}), tr(Je));
|
|
540
516
|
return;
|
|
541
517
|
}
|
|
542
518
|
}
|
|
543
|
-
const
|
|
519
|
+
const je = {
|
|
544
520
|
productItems: [
|
|
545
521
|
{
|
|
546
522
|
productId: ((C = r.variants) == null ? void 0 : C[0].product_id) || ((K = r.variants) == null ? void 0 : K[0].productId) || (r == null ? void 0 : r.id),
|
|
547
523
|
quantity: 1
|
|
548
524
|
}
|
|
549
525
|
]
|
|
550
|
-
}, z = await
|
|
526
|
+
}, z = await Ir(fe, je);
|
|
551
527
|
if (!(z != null && z.basket_id) && !(z != null && z.basketId)) {
|
|
552
528
|
console.error("Failed to create basket");
|
|
553
529
|
return;
|
|
@@ -560,7 +536,7 @@ const lt = (e) => {
|
|
|
560
536
|
V,
|
|
561
537
|
fe
|
|
562
538
|
);
|
|
563
|
-
console.log("object added to basket"), (((
|
|
539
|
+
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", {
|
|
564
540
|
position: "bottom-right",
|
|
565
541
|
autoClose: 3e3,
|
|
566
542
|
hideProgressBar: !1,
|
|
@@ -570,19 +546,19 @@ const lt = (e) => {
|
|
|
570
546
|
}), tr(z.basket_id || (z == null ? void 0 : z.basketId));
|
|
571
547
|
}
|
|
572
548
|
} catch (V) {
|
|
573
|
-
console.error("Error adding to cart:", V),
|
|
549
|
+
console.error("Error adding to cart:", V), Be.error("Failed to add product to cart", {
|
|
574
550
|
position: "bottom-right",
|
|
575
551
|
autoClose: 3e3
|
|
576
|
-
}), ((
|
|
577
|
-
((dt = V == null ? void 0 : V.response) == null ? void 0 : dt.status) === 401 ? (((
|
|
552
|
+
}), ((be = V == null ? void 0 : V.response) == null ? void 0 : be.status) === 404 || // Basket not found
|
|
553
|
+
((dt = V == null ? void 0 : V.response) == null ? void 0 : dt.status) === 401 ? (((N = V == null ? void 0 : V.response) == null ? void 0 : N.status) === 404 && lt(null), ((ve = V == null ? void 0 : V.response) == null ? void 0 : ve.status) === 401 && (lt(null), rr(null))) : (console.error("Failed to add product to basket:", V.message), Be.error("Failed to add product to cart", {
|
|
578
554
|
position: "bottom-right",
|
|
579
555
|
autoClose: 3e3
|
|
580
556
|
}));
|
|
581
557
|
}
|
|
582
558
|
}, c = () => {
|
|
583
559
|
if (!r) return;
|
|
584
|
-
const
|
|
585
|
-
console.log("path",
|
|
560
|
+
const S = window.location.origin + "/product/" + r.id;
|
|
561
|
+
console.log("path", S), window.location.href = S;
|
|
586
562
|
};
|
|
587
563
|
return console.log(r, "the prod"), /* @__PURE__ */ d(ke, { children: [
|
|
588
564
|
/* @__PURE__ */ a(
|
|
@@ -590,7 +566,7 @@ const lt = (e) => {
|
|
|
590
566
|
{
|
|
591
567
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
592
568
|
onClick: () => {
|
|
593
|
-
s(!1), setTimeout(() => t(gr(null)),
|
|
569
|
+
s(!1), setTimeout(() => t(gr(null)), sn);
|
|
594
570
|
}
|
|
595
571
|
}
|
|
596
572
|
),
|
|
@@ -603,7 +579,7 @@ const lt = (e) => {
|
|
|
603
579
|
${o ? "translate-y-0 md:translate-y-0 md:translate-x-0 opacity-100" : "translate-y-full md:translate-y-0 md:translate-x-full opacity-0 pointer-events-none"}
|
|
604
580
|
`,
|
|
605
581
|
style: { willChange: "transform, opacity" },
|
|
606
|
-
onClick: (
|
|
582
|
+
onClick: (S) => S.stopPropagation(),
|
|
607
583
|
children: [
|
|
608
584
|
/* @__PURE__ */ d("div", { className: "mt-3 flex flex-row justify-between w-full ", children: [
|
|
609
585
|
/* @__PURE__ */ a("div", { children: /* @__PURE__ */ a("p", { className: "text-[#000000] font-bold font-nunitoSans", children: r.name }) }),
|
|
@@ -614,7 +590,7 @@ const lt = (e) => {
|
|
|
614
590
|
onClick: () => {
|
|
615
591
|
s(!1), setTimeout(
|
|
616
592
|
() => t(gr(null)),
|
|
617
|
-
|
|
593
|
+
sn
|
|
618
594
|
);
|
|
619
595
|
},
|
|
620
596
|
children: "✕"
|
|
@@ -625,20 +601,20 @@ const lt = (e) => {
|
|
|
625
601
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center justify-center w-[120px] h-[120px] my-5", children: /* @__PURE__ */ a(
|
|
626
602
|
"img",
|
|
627
603
|
{
|
|
628
|
-
src: (y = (g = (
|
|
604
|
+
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,
|
|
629
605
|
alt: r.name,
|
|
630
606
|
className: "rounded-[10px]"
|
|
631
607
|
}
|
|
632
608
|
) }),
|
|
633
609
|
/* @__PURE__ */ a("div", { className: "flex flex-col items-center gap-2", children: r.imageGroups.slice(1, 2).map(
|
|
634
|
-
(
|
|
610
|
+
(S) => S.images.slice(1, 2).map((A) => /* @__PURE__ */ a(
|
|
635
611
|
"img",
|
|
636
612
|
{
|
|
637
|
-
src:
|
|
613
|
+
src: A.link,
|
|
638
614
|
alt: r.name,
|
|
639
615
|
className: "rounded-[10px] w-[60px] h-[60px]"
|
|
640
616
|
},
|
|
641
|
-
|
|
617
|
+
A.link
|
|
642
618
|
))
|
|
643
619
|
) })
|
|
644
620
|
] }),
|
|
@@ -674,19 +650,19 @@ const lt = (e) => {
|
|
|
674
650
|
/* @__PURE__ */ d("div", { className: "mt-4 flex flex-col gap-2 w-full p-2", children: [
|
|
675
651
|
/* @__PURE__ */ a("div", { className: "flex flex-row items-center gap-2", children: /* @__PURE__ */ d("div", { className: "flex items-center gap-2 text-left font-nunitoSans", children: [
|
|
676
652
|
/* @__PURE__ */ d("div", { className: "text-[#323135] font-bold", children: [
|
|
677
|
-
((
|
|
653
|
+
((x = r == null ? void 0 : r.rating) == null ? void 0 : x.rate) || 0,
|
|
678
654
|
" /",
|
|
679
655
|
" ",
|
|
680
656
|
/* @__PURE__ */ a("span", { className: "text-[#68656E]", children: "5" })
|
|
681
657
|
] }),
|
|
682
658
|
/* @__PURE__ */ a("div", { className: "text-[#323135] font-semibold text-sm", children: "Overall Rating" }),
|
|
683
659
|
/* @__PURE__ */ d("div", { className: "text-[#68656E] font-semibold text-sm", children: [
|
|
684
|
-
((
|
|
660
|
+
((I = r == null ? void 0 : r.rating) == null ? void 0 : I.count) || 0,
|
|
685
661
|
" ratings"
|
|
686
662
|
] })
|
|
687
663
|
] }) }),
|
|
688
|
-
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((
|
|
689
|
-
var
|
|
664
|
+
/* @__PURE__ */ a("div", { className: "mt-2 flex flex-row items-center gap-2", children: Array.from({ length: 5 }).map((S, A) => {
|
|
665
|
+
var k;
|
|
690
666
|
return /* @__PURE__ */ a(
|
|
691
667
|
Jo,
|
|
692
668
|
{
|
|
@@ -694,10 +670,10 @@ const lt = (e) => {
|
|
|
694
670
|
width: "20",
|
|
695
671
|
height: "20",
|
|
696
672
|
className: `text-yellow-500
|
|
697
|
-
${((
|
|
673
|
+
${((k = r == null ? void 0 : r.rating) == null ? void 0 : k.rate) > A ? "text-yellow-500" : "text-gray-300"}
|
|
698
674
|
`
|
|
699
675
|
},
|
|
700
|
-
|
|
676
|
+
A
|
|
701
677
|
);
|
|
702
678
|
}) })
|
|
703
679
|
] }),
|
|
@@ -751,131 +727,131 @@ const lt = (e) => {
|
|
|
751
727
|
"Niece/Nephew": "his/her niece/nephew",
|
|
752
728
|
"My Friends": "his/her friends",
|
|
753
729
|
Others: "others"
|
|
754
|
-
}, s =
|
|
755
|
-
|
|
756
|
-
const [y,
|
|
757
|
-
id:
|
|
758
|
-
title:
|
|
759
|
-
image:
|
|
760
|
-
price:
|
|
761
|
-
}), [
|
|
762
|
-
|
|
763
|
-
const
|
|
730
|
+
}, s = Ve(null), i = Ve(null), c = Ve(null), l = Ve(null), [p, g] = b(null);
|
|
731
|
+
Ve(null);
|
|
732
|
+
const [y, x] = b(!1), [I, S] = b(!1), [A, k] = b(!1), [P, J] = b(!1), [q, Y] = b(!1), [_e, C] = b(!1), [K, re] = b(""), [ye, be] = b(""), dt = (h) => ({
|
|
733
|
+
id: h.id,
|
|
734
|
+
title: h.name,
|
|
735
|
+
image: h.image ?? "",
|
|
736
|
+
price: h.price ?? 0
|
|
737
|
+
}), [N, ve] = b([]), V = Ve(null), $ = er((h) => h.store.store), Je = er((h) => h.product.product);
|
|
738
|
+
xe(() => {
|
|
739
|
+
const h = localStorage.getItem(
|
|
764
740
|
`access_token_${e.siteId}`
|
|
765
|
-
),
|
|
741
|
+
), O = localStorage.getItem(
|
|
766
742
|
`chat-token-${e.siteId}`
|
|
767
743
|
);
|
|
768
|
-
if (
|
|
769
|
-
const
|
|
770
|
-
|
|
744
|
+
if (h && O === h) {
|
|
745
|
+
const B = localStorage.getItem("chatHistory");
|
|
746
|
+
B && ve(JSON.parse(B));
|
|
771
747
|
} else
|
|
772
748
|
localStorage.setItem("chatHistory", JSON.stringify([])), localStorage.setItem(
|
|
773
749
|
`chat-token-${e.siteId}`,
|
|
774
|
-
|
|
750
|
+
h || ""
|
|
775
751
|
);
|
|
776
|
-
}, []),
|
|
777
|
-
localStorage.setItem("chatHistory", JSON.stringify(
|
|
778
|
-
const
|
|
752
|
+
}, []), xe(() => {
|
|
753
|
+
localStorage.setItem("chatHistory", JSON.stringify(N));
|
|
754
|
+
const h = localStorage.getItem(
|
|
779
755
|
`access_token_${e.siteId}`
|
|
780
756
|
);
|
|
781
|
-
|
|
782
|
-
}, [
|
|
757
|
+
h && localStorage.setItem(`chat-token-${e.siteId}`, h);
|
|
758
|
+
}, [N]);
|
|
783
759
|
const ut = () => {
|
|
784
|
-
|
|
760
|
+
k(!0), setTimeout(() => S(!0), 10);
|
|
785
761
|
}, qe = () => {
|
|
786
|
-
|
|
762
|
+
S(!1), setTimeout(() => k(!1), 300);
|
|
787
763
|
};
|
|
788
|
-
|
|
764
|
+
xe(() => {
|
|
789
765
|
y ? ut() : qe();
|
|
790
766
|
}, [y]);
|
|
791
|
-
const nt = (
|
|
792
|
-
|
|
767
|
+
const nt = (h) => {
|
|
768
|
+
be(o[h]);
|
|
793
769
|
};
|
|
794
|
-
|
|
795
|
-
|
|
770
|
+
xe(() => {
|
|
771
|
+
A && V.current && V.current.scrollTo({
|
|
796
772
|
top: V.current.scrollHeight,
|
|
797
773
|
behavior: "smooth"
|
|
798
774
|
});
|
|
799
|
-
}, [
|
|
800
|
-
const fe = null,
|
|
801
|
-
const
|
|
802
|
-
|
|
775
|
+
}, [N, A]);
|
|
776
|
+
const fe = null, Ie = null, je = async () => {
|
|
777
|
+
const h = await Xe();
|
|
778
|
+
h != null && g(h);
|
|
803
779
|
};
|
|
804
|
-
|
|
780
|
+
xe(() => {
|
|
805
781
|
if (e != null && e.siteId) {
|
|
806
|
-
const { clientID:
|
|
807
|
-
sessionStorage.setItem("Host",
|
|
782
|
+
const { clientID: h, host: O, organizationID: B, shortCode: Q, siteId: U } = e;
|
|
783
|
+
sessionStorage.setItem("Host", O), sessionStorage.setItem("SiteId", U), sessionStorage.setItem("pubCfg", btoa(h)), sessionStorage.setItem("envRef", Q), sessionStorage.setItem("orgRef", B);
|
|
808
784
|
}
|
|
809
|
-
|
|
810
|
-
}, []),
|
|
785
|
+
je(), console.log("scapi environment v1");
|
|
786
|
+
}, []), xe(() => {
|
|
811
787
|
t && (console.log("setting the basket id", t), lt(t));
|
|
812
788
|
}, [t]);
|
|
813
789
|
const z = async () => {
|
|
814
|
-
const
|
|
790
|
+
const h = JSON.parse(
|
|
815
791
|
sessionStorage.getItem("customerData") || "{}"
|
|
816
792
|
).customerId;
|
|
817
|
-
return (await aa(
|
|
818
|
-
}, Te = async (
|
|
793
|
+
return (await aa(h || "")).c_interests;
|
|
794
|
+
}, Te = async (h, O) => {
|
|
819
795
|
console.log("in secondary flow", Vt);
|
|
820
|
-
const
|
|
821
|
-
if (console.log(
|
|
796
|
+
const B = await z();
|
|
797
|
+
if (console.log(B, "interests of customer", Vt), !!B)
|
|
822
798
|
try {
|
|
823
799
|
ve(
|
|
824
800
|
(me) => me.map(
|
|
825
|
-
(Ne,
|
|
801
|
+
(Ne, he) => he === me.length - 1 ? { ...Ne, secondaryLoading: !0 } : Ne
|
|
826
802
|
)
|
|
827
803
|
);
|
|
828
|
-
const Q = await wr(fe,
|
|
804
|
+
const Q = await wr(fe, Ie);
|
|
829
805
|
if (!Q) throw new Error("Failed to fetch token");
|
|
830
|
-
const
|
|
806
|
+
const U = localStorage.getItem("customerNumber"), L = localStorage.getItem("isLoggedIn"), Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
831
807
|
registered: String(L || !1),
|
|
832
|
-
userId: String(
|
|
833
|
-
}).toString()}`,
|
|
808
|
+
userId: String(U || (/* @__PURE__ */ new Date()).getTime())
|
|
809
|
+
}).toString()}`, R = JSON.stringify({
|
|
834
810
|
flowId: "Q166PR519W",
|
|
835
811
|
flowAliasId: "HKFUVLWVH2",
|
|
836
812
|
input: {
|
|
837
813
|
loyaltyPoints: "",
|
|
838
|
-
productName:
|
|
839
|
-
productPoints: String(
|
|
840
|
-
interests:
|
|
814
|
+
productName: h,
|
|
815
|
+
productPoints: String(O || 0),
|
|
816
|
+
interests: B
|
|
841
817
|
}
|
|
842
|
-
}),
|
|
818
|
+
}), oe = await fetch(Z, {
|
|
843
819
|
signal: AbortSignal.timeout(3e4),
|
|
844
820
|
method: "POST",
|
|
845
821
|
headers: {
|
|
846
822
|
"Content-Type": "application/json",
|
|
847
823
|
Authorization: `Bearer ${Q}`
|
|
848
824
|
},
|
|
849
|
-
body:
|
|
825
|
+
body: R
|
|
850
826
|
});
|
|
851
|
-
if (!
|
|
852
|
-
const
|
|
827
|
+
if (!oe.body) throw new Error("Readable stream not supported");
|
|
828
|
+
const $e = oe.body.getReader(), Re = new TextDecoder();
|
|
853
829
|
let G = "";
|
|
854
830
|
for (; ; ) {
|
|
855
|
-
const { done: me, value: Ne } = await
|
|
831
|
+
const { done: me, value: Ne } = await $e.read();
|
|
856
832
|
if (me) break;
|
|
857
|
-
G +=
|
|
858
|
-
const
|
|
833
|
+
G += Re.decode(Ne, { stream: !0 });
|
|
834
|
+
const he = G.split(`
|
|
859
835
|
`);
|
|
860
|
-
G =
|
|
861
|
-
for (const
|
|
862
|
-
if (
|
|
863
|
-
const
|
|
836
|
+
G = he.pop() || "";
|
|
837
|
+
for (const pe of he)
|
|
838
|
+
if (pe.startsWith("data:")) {
|
|
839
|
+
const _ = pe.slice(5).trim();
|
|
864
840
|
try {
|
|
865
|
-
const ee = JSON.parse(
|
|
841
|
+
const ee = JSON.parse(_);
|
|
866
842
|
ee.index === 0 && ve(
|
|
867
843
|
(D) => D.map(
|
|
868
|
-
(
|
|
869
|
-
...
|
|
844
|
+
(ae, se) => se === D.length - 1 ? {
|
|
845
|
+
...ae,
|
|
870
846
|
secondaryResponse: ee.data,
|
|
871
847
|
secondaryLoading: !1
|
|
872
|
-
} :
|
|
848
|
+
} : ae
|
|
873
849
|
)
|
|
874
850
|
);
|
|
875
851
|
} catch (ee) {
|
|
876
852
|
ve(
|
|
877
853
|
(D) => D.map(
|
|
878
|
-
(
|
|
854
|
+
(ae, se) => se === D.length - 1 ? { ...ae, secondaryLoading: !1 } : ae
|
|
879
855
|
)
|
|
880
856
|
), console.error("Secondary flow JSON parse error:", ee);
|
|
881
857
|
}
|
|
@@ -884,13 +860,13 @@ const lt = (e) => {
|
|
|
884
860
|
} catch (Q) {
|
|
885
861
|
console.error("Secondary flow error:", Q);
|
|
886
862
|
}
|
|
887
|
-
}, Se = async (
|
|
888
|
-
const
|
|
889
|
-
if (
|
|
890
|
-
Y(!0),
|
|
891
|
-
...
|
|
863
|
+
}, Se = async (h) => {
|
|
864
|
+
const O = h || K.trim();
|
|
865
|
+
if (O) {
|
|
866
|
+
Y(!0), re(""), s.current = null, i.current = null, c.current = null, l.current = null, ve((B) => [
|
|
867
|
+
...B,
|
|
892
868
|
{
|
|
893
|
-
query:
|
|
869
|
+
query: O,
|
|
894
870
|
response: "Thinking for what suits you best...",
|
|
895
871
|
potentialQuestions: "",
|
|
896
872
|
products: [],
|
|
@@ -898,52 +874,52 @@ const lt = (e) => {
|
|
|
898
874
|
}
|
|
899
875
|
]);
|
|
900
876
|
try {
|
|
901
|
-
const
|
|
877
|
+
const B = ye, Q = localStorage.getItem("customerNumber"), U = localStorage.getItem("isLoggedIn"), L = await wr(fe, Ie);
|
|
902
878
|
if (!L)
|
|
903
879
|
throw new Error("Failed to obtain access token");
|
|
904
880
|
const Z = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
905
|
-
registered: String(
|
|
881
|
+
registered: String(U || !1),
|
|
906
882
|
userId: String(Q || (/* @__PURE__ */ new Date()).getTime())
|
|
907
|
-
}).toString()}`,
|
|
883
|
+
}).toString()}`, R = JSON.stringify({
|
|
908
884
|
flowId: "MMHQKYI1NE",
|
|
909
885
|
flowAliasId: "SZF9ZK1ATE",
|
|
910
886
|
input: {
|
|
911
|
-
userPrompt:
|
|
912
|
-
whom:
|
|
887
|
+
userPrompt: O,
|
|
888
|
+
whom: B
|
|
913
889
|
}
|
|
914
|
-
}),
|
|
890
|
+
}), oe = await fetch(Z, {
|
|
915
891
|
signal: AbortSignal.timeout(3e4),
|
|
916
892
|
method: "POST",
|
|
917
893
|
headers: {
|
|
918
894
|
"Content-Type": "application/json",
|
|
919
895
|
Authorization: `Bearer ${L}`
|
|
920
896
|
},
|
|
921
|
-
body:
|
|
897
|
+
body: R
|
|
922
898
|
});
|
|
923
|
-
if (!
|
|
924
|
-
throw new Error(`HTTP error! status: ${
|
|
925
|
-
if (!
|
|
926
|
-
const
|
|
899
|
+
if (!oe.ok)
|
|
900
|
+
throw new Error(`HTTP error! status: ${oe.status}`);
|
|
901
|
+
if (!oe.body) throw new Error("Readable stream not supported");
|
|
902
|
+
const $e = oe.body.getReader(), Re = new TextDecoder();
|
|
927
903
|
let G = "", me = "";
|
|
928
904
|
for (; ; ) {
|
|
929
905
|
C(!0);
|
|
930
|
-
const { done: Ne, value:
|
|
906
|
+
const { done: Ne, value: he } = await $e.read();
|
|
931
907
|
if (Ne) break;
|
|
932
|
-
G +=
|
|
933
|
-
const
|
|
908
|
+
G += Re.decode(he, { stream: !0 });
|
|
909
|
+
const pe = G.split(`
|
|
934
910
|
`);
|
|
935
|
-
G =
|
|
936
|
-
for (const
|
|
937
|
-
if (
|
|
938
|
-
const ee =
|
|
911
|
+
G = pe.pop() || "";
|
|
912
|
+
for (const _ of pe)
|
|
913
|
+
if (_.startsWith("data:")) {
|
|
914
|
+
const ee = _.slice(5).trim();
|
|
939
915
|
try {
|
|
940
916
|
const D = JSON.parse(ee);
|
|
941
917
|
D.index == 1 && (me = D.data), ve(
|
|
942
|
-
(
|
|
943
|
-
(
|
|
944
|
-
...
|
|
918
|
+
(ae) => ae.map(
|
|
919
|
+
(se, Ae) => Ae === ae.length - 1 ? {
|
|
920
|
+
...se,
|
|
945
921
|
[D.index == 0 ? "response" : D.index == 1 ? "keywords" : D.index == 2 ? "potentialQuestions" : "end"]: D.data
|
|
946
|
-
} :
|
|
922
|
+
} : se
|
|
947
923
|
)
|
|
948
924
|
);
|
|
949
925
|
} catch (D) {
|
|
@@ -951,40 +927,40 @@ const lt = (e) => {
|
|
|
951
927
|
}
|
|
952
928
|
}
|
|
953
929
|
}
|
|
954
|
-
X(
|
|
955
|
-
} catch (
|
|
956
|
-
console.error("Error sending message to Tanya:",
|
|
930
|
+
X(ne(me));
|
|
931
|
+
} catch (B) {
|
|
932
|
+
console.error("Error sending message to Tanya:", B);
|
|
957
933
|
} finally {
|
|
958
934
|
Y(!1);
|
|
959
935
|
}
|
|
960
936
|
}
|
|
961
|
-
},
|
|
962
|
-
const
|
|
937
|
+
}, ne = (h) => {
|
|
938
|
+
const O = h.match(
|
|
963
939
|
/top five relevant product or category names are: (.*)/i
|
|
964
|
-
),
|
|
965
|
-
return [...new Set(
|
|
966
|
-
}, X = async (
|
|
967
|
-
var
|
|
968
|
-
const
|
|
940
|
+
), U = (O ? O[1] : h).split(", ").map((W) => W.replace(/\s*(Toys|Bags|Miniature|etc\.*)\s*/gi, "").trim());
|
|
941
|
+
return [...new Set(U)].filter(Boolean).join(",");
|
|
942
|
+
}, X = async (h) => {
|
|
943
|
+
var B, Q, U;
|
|
944
|
+
const O = typeof h == "string" ? h.split(",") : h;
|
|
969
945
|
C(!0);
|
|
970
946
|
try {
|
|
971
947
|
const L = await Promise.all(
|
|
972
|
-
|
|
948
|
+
O.map((R) => oa(R).catch(() => []))
|
|
973
949
|
// prevent Promise.all crash
|
|
974
|
-
), W =
|
|
975
|
-
keyword:
|
|
976
|
-
items: L[
|
|
950
|
+
), W = O.map((R, oe) => ({
|
|
951
|
+
keyword: R,
|
|
952
|
+
items: L[oe] ?? [],
|
|
977
953
|
loading: !1
|
|
978
|
-
})).filter((
|
|
954
|
+
})).filter((R) => R.items.length > 0), Z = (Q = (B = W[0]) == null ? void 0 : B.items) == null ? void 0 : Q[0];
|
|
979
955
|
if (Z) {
|
|
980
|
-
i.current = Z.product_id, s.current = Z.product_name, c.current = (
|
|
981
|
-
const
|
|
982
|
-
l.current =
|
|
956
|
+
i.current = Z.product_id, s.current = Z.product_name, c.current = (U = Z.image) == null ? void 0 : U.link;
|
|
957
|
+
const R = typeof Z.price == "number" ? Z.price : null;
|
|
958
|
+
l.current = R;
|
|
983
959
|
}
|
|
984
960
|
if (ve(
|
|
985
|
-
(
|
|
986
|
-
(
|
|
987
|
-
...
|
|
961
|
+
(R) => R.map(
|
|
962
|
+
(oe, $e) => $e === R.length - 1 ? {
|
|
963
|
+
...oe,
|
|
988
964
|
products: W,
|
|
989
965
|
productSnapshot: Z ? {
|
|
990
966
|
id: i.current,
|
|
@@ -993,27 +969,27 @@ const lt = (e) => {
|
|
|
993
969
|
price: l.current,
|
|
994
970
|
points: 0,
|
|
995
971
|
quantity: 1
|
|
996
|
-
} :
|
|
997
|
-
} :
|
|
972
|
+
} : oe.productSnapshot
|
|
973
|
+
} : oe
|
|
998
974
|
)
|
|
999
975
|
), Z) {
|
|
1000
|
-
const
|
|
976
|
+
const R = JSON.parse(
|
|
1001
977
|
sessionStorage.getItem("customerData") || "{}"
|
|
1002
978
|
);
|
|
1003
|
-
|
|
979
|
+
R != null && R.isGuest || (console.log("running secondary flow", Vt), Te(s.current, 0));
|
|
1004
980
|
}
|
|
1005
981
|
} catch (L) {
|
|
1006
982
|
console.error("error in keyword search", L);
|
|
1007
983
|
} finally {
|
|
1008
984
|
C(!1);
|
|
1009
985
|
}
|
|
1010
|
-
}, kt = async (
|
|
1011
|
-
var
|
|
986
|
+
}, kt = async (h, O) => {
|
|
987
|
+
var B, Q, U, L, W, Z, R, oe, $e, Re, G, me, Ne, he, pe;
|
|
1012
988
|
J(!0);
|
|
1013
989
|
try {
|
|
1014
|
-
const
|
|
1015
|
-
if (!((Q = (
|
|
1016
|
-
J(!1),
|
|
990
|
+
const _ = await Rn(h.id);
|
|
991
|
+
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)) {
|
|
992
|
+
J(!1), Be.error("Variants not found", {
|
|
1017
993
|
position: "bottom-right",
|
|
1018
994
|
autoClose: 1e3
|
|
1019
995
|
}), console.error("No product variant found");
|
|
@@ -1021,54 +997,54 @@ const lt = (e) => {
|
|
|
1021
997
|
}
|
|
1022
998
|
const ee = [
|
|
1023
999
|
{
|
|
1024
|
-
product_id: ((W =
|
|
1025
|
-
quantity:
|
|
1000
|
+
product_id: ((W = _.variants) == null ? void 0 : W[0].product_id) || ((Z = _.variants) == null ? void 0 : Z[0].productId) || (_ == null ? void 0 : _.id),
|
|
1001
|
+
quantity: O
|
|
1026
1002
|
}
|
|
1027
1003
|
];
|
|
1028
1004
|
console.log(ee, "product data", "app version", Vt);
|
|
1029
1005
|
const D = JSON.parse(
|
|
1030
1006
|
sessionStorage.getItem("customerData") || "{}"
|
|
1031
|
-
),
|
|
1032
|
-
if (!
|
|
1033
|
-
const
|
|
1034
|
-
let { customer_token:
|
|
1035
|
-
|
|
1007
|
+
), ae = (D == null ? void 0 : D.basketId) || localStorage.getItem(Lt), se = !1, Ae = localStorage.getItem(zt), St = Date.now();
|
|
1008
|
+
if (!se || !Ae || St >= parseInt(Ae)) {
|
|
1009
|
+
const Oe = await Un();
|
|
1010
|
+
let { customer_token: ie } = await qn(
|
|
1011
|
+
Oe
|
|
1036
1012
|
);
|
|
1037
|
-
if (
|
|
1013
|
+
if (ie = "Bearer " + p.access_token, !ie) {
|
|
1038
1014
|
console.error("Failed to get customer_token");
|
|
1039
1015
|
return;
|
|
1040
1016
|
}
|
|
1041
1017
|
const Nt = St + 300 * 1e3;
|
|
1042
|
-
if (rr(
|
|
1018
|
+
if (rr(ie), localStorage.setItem(zt, Nt.toString()), console.log(ae, "basketIdFromCustomer"), ae) {
|
|
1043
1019
|
const Ct = await Hn({
|
|
1044
|
-
basketId:
|
|
1045
|
-
customer_token:
|
|
1020
|
+
basketId: ae,
|
|
1021
|
+
customer_token: ie
|
|
1046
1022
|
});
|
|
1047
1023
|
if (Ct.status === 200 && Ct) {
|
|
1048
|
-
const
|
|
1049
|
-
|
|
1024
|
+
const _t = await yr(
|
|
1025
|
+
ae,
|
|
1050
1026
|
ee,
|
|
1051
|
-
|
|
1027
|
+
ie
|
|
1052
1028
|
);
|
|
1053
|
-
((
|
|
1029
|
+
((R = _t == null ? void 0 : _t.product_items) == null ? void 0 : R.length) > 0 && (Be.success("Added to cart", {
|
|
1054
1030
|
position: "bottom-right",
|
|
1055
1031
|
autoClose: 3e3,
|
|
1056
1032
|
hideProgressBar: !1,
|
|
1057
1033
|
closeOnClick: !0,
|
|
1058
1034
|
pauseOnHover: !0,
|
|
1059
1035
|
draggable: !0
|
|
1060
|
-
}), tr(
|
|
1036
|
+
}), tr(ae), J(!1));
|
|
1061
1037
|
return;
|
|
1062
1038
|
}
|
|
1063
1039
|
}
|
|
1064
1040
|
const Ce = {
|
|
1065
1041
|
productItems: [
|
|
1066
1042
|
{
|
|
1067
|
-
productId: ((
|
|
1043
|
+
productId: ((oe = _.variants) == null ? void 0 : oe[0].product_id) || (($e = _.variants) == null ? void 0 : $e[0].productId) || (_ == null ? void 0 : _.id),
|
|
1068
1044
|
quantity: 1
|
|
1069
1045
|
}
|
|
1070
1046
|
]
|
|
1071
|
-
}, F = await
|
|
1047
|
+
}, F = await Ir(ie, Ce);
|
|
1072
1048
|
if (console.log(
|
|
1073
1049
|
F,
|
|
1074
1050
|
F == null ? void 0 : F.basket_id,
|
|
@@ -1084,11 +1060,11 @@ const lt = (e) => {
|
|
|
1084
1060
|
const te = await r(
|
|
1085
1061
|
{
|
|
1086
1062
|
productId: i,
|
|
1087
|
-
quantity:
|
|
1063
|
+
quantity: O
|
|
1088
1064
|
},
|
|
1089
1065
|
(F == null ? void 0 : F.basket_id) || (F == null ? void 0 : F.basketId)
|
|
1090
1066
|
);
|
|
1091
|
-
(((
|
|
1067
|
+
(((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", {
|
|
1092
1068
|
position: "bottom-right",
|
|
1093
1069
|
autoClose: 3e3,
|
|
1094
1070
|
hideProgressBar: !1,
|
|
@@ -1097,25 +1073,25 @@ const lt = (e) => {
|
|
|
1097
1073
|
draggable: !0
|
|
1098
1074
|
}), tr(F.basket_id || (F == null ? void 0 : F.basketId));
|
|
1099
1075
|
}
|
|
1100
|
-
} catch (
|
|
1101
|
-
J(!1), console.error("Error adding to cart:",
|
|
1076
|
+
} catch (_) {
|
|
1077
|
+
J(!1), console.error("Error adding to cart:", _), Be.error("Failed to add product to cart", {
|
|
1102
1078
|
position: "bottom-right",
|
|
1103
1079
|
autoClose: 3e3
|
|
1104
|
-
}), ((me =
|
|
1105
|
-
((Ne =
|
|
1080
|
+
}), ((me = _ == null ? void 0 : _.response) == null ? void 0 : me.status) === 404 || // Basket not found
|
|
1081
|
+
((Ne = _ == null ? void 0 : _.response) == null ? void 0 : Ne.status) === 401 ? (((he = _ == null ? void 0 : _.response) == null ? void 0 : he.status) === 404 && lt(null), ((pe = _ == null ? void 0 : _.response) == null ? void 0 : pe.status) === 401 && (lt(null), rr(null))) : (console.error("Failed to add product to basket:", _.message), Be.error("Failed to add product to cart", {
|
|
1106
1082
|
position: "bottom-right",
|
|
1107
1083
|
autoClose: 3e3
|
|
1108
1084
|
}));
|
|
1109
1085
|
}
|
|
1110
1086
|
J(!1);
|
|
1111
1087
|
};
|
|
1112
|
-
return
|
|
1113
|
-
|
|
1114
|
-
}, [
|
|
1088
|
+
return xe(() => {
|
|
1089
|
+
A ? setTimeout(() => S(!0), 10) : S(!1);
|
|
1090
|
+
}, [A]), /* @__PURE__ */ a("div", { className: "relative flex justify-center", children: /* @__PURE__ */ d(ra, { open: y, onOpenChange: x, children: [
|
|
1115
1091
|
/* @__PURE__ */ a(
|
|
1116
1092
|
na,
|
|
1117
1093
|
{
|
|
1118
|
-
onClick: () =>
|
|
1094
|
+
onClick: () => x(!0),
|
|
1119
1095
|
style: {
|
|
1120
1096
|
// background: storeDetails.tanyaThemeColor,
|
|
1121
1097
|
},
|
|
@@ -1175,12 +1151,12 @@ const lt = (e) => {
|
|
|
1175
1151
|
) })
|
|
1176
1152
|
}
|
|
1177
1153
|
),
|
|
1178
|
-
|
|
1154
|
+
A && /* @__PURE__ */ d(ke, { children: [
|
|
1179
1155
|
/* @__PURE__ */ a(
|
|
1180
1156
|
"div",
|
|
1181
1157
|
{
|
|
1182
1158
|
className: "fixed inset-0 z-40 bg-black/30",
|
|
1183
|
-
onClick: () =>
|
|
1159
|
+
onClick: () => x(!1)
|
|
1184
1160
|
}
|
|
1185
1161
|
),
|
|
1186
1162
|
/* @__PURE__ */ d(
|
|
@@ -1267,7 +1243,7 @@ const lt = (e) => {
|
|
|
1267
1243
|
gap: "1.25rem",
|
|
1268
1244
|
margin: "0.75rem"
|
|
1269
1245
|
},
|
|
1270
|
-
children: /* @__PURE__ */ a("button", { onClick: () =>
|
|
1246
|
+
children: /* @__PURE__ */ a("button", { onClick: () => x(!1), children: /* @__PURE__ */ d(
|
|
1271
1247
|
"svg",
|
|
1272
1248
|
{
|
|
1273
1249
|
width: "24",
|
|
@@ -1319,7 +1295,7 @@ const lt = (e) => {
|
|
|
1319
1295
|
/* @__PURE__ */ d(
|
|
1320
1296
|
"div",
|
|
1321
1297
|
{
|
|
1322
|
-
className: `flex flex-col h-full ${
|
|
1298
|
+
className: `flex flex-col h-full ${Je ? "lg:w-2/3 w-full" : "w-full"}`,
|
|
1323
1299
|
children: [
|
|
1324
1300
|
/* @__PURE__ */ d(
|
|
1325
1301
|
"div",
|
|
@@ -1333,38 +1309,38 @@ const lt = (e) => {
|
|
|
1333
1309
|
className: "mx-3 p-3 rounded-2xl bg-[#FFFFFF]",
|
|
1334
1310
|
children: [
|
|
1335
1311
|
/* @__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?" }) }),
|
|
1336
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((
|
|
1312
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: n.map((h) => /* @__PURE__ */ a(
|
|
1337
1313
|
"button",
|
|
1338
1314
|
{
|
|
1339
|
-
onClick: () => nt(
|
|
1315
|
+
onClick: () => nt(h),
|
|
1340
1316
|
className: "px-2 py-2 font-semibold text-xs text-[#18181B] bg-[#F3F3F3] rounded-2xl",
|
|
1341
1317
|
style: {
|
|
1342
|
-
backgroundColor: ye === o[
|
|
1343
|
-
borderColor: ye === o[
|
|
1318
|
+
backgroundColor: ye === o[h] ? "#FFFFFF" : "#F3F3F3",
|
|
1319
|
+
borderColor: ye === o[h] ? "#BBB3DD" : ""
|
|
1344
1320
|
},
|
|
1345
|
-
children:
|
|
1321
|
+
children: h
|
|
1346
1322
|
},
|
|
1347
|
-
|
|
1323
|
+
h
|
|
1348
1324
|
)) })
|
|
1349
1325
|
]
|
|
1350
1326
|
}
|
|
1351
1327
|
),
|
|
1352
|
-
|
|
1353
|
-
var
|
|
1328
|
+
N.map((h, O) => {
|
|
1329
|
+
var B, Q;
|
|
1354
1330
|
return /* @__PURE__ */ d("div", { children: [
|
|
1355
1331
|
/* @__PURE__ */ a(
|
|
1356
1332
|
"div",
|
|
1357
1333
|
{
|
|
1358
1334
|
className: "flex justify-end",
|
|
1359
|
-
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:
|
|
1335
|
+
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 })
|
|
1360
1336
|
}
|
|
1361
1337
|
),
|
|
1362
|
-
|
|
1338
|
+
h.response && h.response.includes("Thinking") ? /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
1363
1339
|
"div",
|
|
1364
1340
|
{
|
|
1365
1341
|
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",
|
|
1366
1342
|
dangerouslySetInnerHTML: {
|
|
1367
|
-
__html: lr(
|
|
1343
|
+
__html: lr(h.response)
|
|
1368
1344
|
}
|
|
1369
1345
|
}
|
|
1370
1346
|
) }) : /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
@@ -1372,19 +1348,19 @@ const lt = (e) => {
|
|
|
1372
1348
|
{
|
|
1373
1349
|
className: "font-nunitoSans font-bold text-sm text-[#494949] bg-[#FFFFFF] px-7 py-1 rounded-r-xl rounded-bl-2xl w-full",
|
|
1374
1350
|
dangerouslySetInnerHTML: {
|
|
1375
|
-
__html: lr(
|
|
1351
|
+
__html: lr(h.response)
|
|
1376
1352
|
}
|
|
1377
1353
|
}
|
|
1378
1354
|
) }),
|
|
1379
|
-
|
|
1380
|
-
(
|
|
1355
|
+
_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" }) }),
|
|
1356
|
+
(h == null ? void 0 : h.products) && ((Q = h == null ? void 0 : h.products) == null ? void 0 : Q.length) > 0 && /* @__PURE__ */ a(
|
|
1381
1357
|
da,
|
|
1382
1358
|
{
|
|
1383
|
-
chat:
|
|
1359
|
+
chat: h.products,
|
|
1384
1360
|
storeDetails: $
|
|
1385
1361
|
}
|
|
1386
1362
|
),
|
|
1387
|
-
(
|
|
1363
|
+
(h == null ? void 0 : h.potentialQuestions.length) > 0 && /* @__PURE__ */ d("div", { className: "my-2 px-4 text-sm text-gray-700", children: [
|
|
1388
1364
|
/* @__PURE__ */ a(
|
|
1389
1365
|
"p",
|
|
1390
1366
|
{
|
|
@@ -1393,20 +1369,20 @@ const lt = (e) => {
|
|
|
1393
1369
|
children: "Why not explore these inquiries..."
|
|
1394
1370
|
}
|
|
1395
1371
|
),
|
|
1396
|
-
|
|
1372
|
+
h.potentialQuestions.split(",").map((U, L) => /* @__PURE__ */ a(
|
|
1397
1373
|
"button",
|
|
1398
1374
|
{
|
|
1399
1375
|
className: `cursor-pointer font-nunitoSans font-semibold text-[#232323] border bg-[#804C9E0D] border-${$.themeDarkColor} m-1 rounded-xl px-2 py-1`,
|
|
1400
|
-
onClick: () => Se(
|
|
1376
|
+
onClick: () => Se(U),
|
|
1401
1377
|
style: {
|
|
1402
1378
|
backgroundColor: $.tanyaThemeColorLight
|
|
1403
1379
|
},
|
|
1404
|
-
children:
|
|
1380
|
+
children: U
|
|
1405
1381
|
},
|
|
1406
1382
|
L
|
|
1407
1383
|
))
|
|
1408
1384
|
] }),
|
|
1409
|
-
(
|
|
1385
|
+
(h == null ? void 0 : h.secondaryLoading) && /* @__PURE__ */ a("div", { className: "mt-3 mb-4 px-4", children: /* @__PURE__ */ d(
|
|
1410
1386
|
"div",
|
|
1411
1387
|
{
|
|
1412
1388
|
className: "tanya-surprise-wrapper bg-indigo-300 text-sm px-7 py-4 rounded-r-xl rounded-bl-2xl w-full relative overflow-hidden",
|
|
@@ -1439,7 +1415,7 @@ const lt = (e) => {
|
|
|
1439
1415
|
]
|
|
1440
1416
|
}
|
|
1441
1417
|
) }),
|
|
1442
|
-
(
|
|
1418
|
+
(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: [
|
|
1443
1419
|
/* @__PURE__ */ a(
|
|
1444
1420
|
"div",
|
|
1445
1421
|
{
|
|
@@ -1449,12 +1425,12 @@ const lt = (e) => {
|
|
|
1449
1425
|
},
|
|
1450
1426
|
dangerouslySetInnerHTML: {
|
|
1451
1427
|
__html: lr(
|
|
1452
|
-
|
|
1428
|
+
h.secondaryResponse
|
|
1453
1429
|
)
|
|
1454
1430
|
}
|
|
1455
1431
|
}
|
|
1456
1432
|
),
|
|
1457
|
-
|
|
1433
|
+
h.productSnapshot && // chat.productSnapshot.points > 0 &&
|
|
1458
1434
|
/* @__PURE__ */ a("div", { className: "mt-4 w-full", children: /* @__PURE__ */ d(
|
|
1459
1435
|
"div",
|
|
1460
1436
|
{
|
|
@@ -1472,11 +1448,11 @@ const lt = (e) => {
|
|
|
1472
1448
|
height: 112,
|
|
1473
1449
|
borderColor: "#eee"
|
|
1474
1450
|
},
|
|
1475
|
-
children:
|
|
1451
|
+
children: h.productSnapshot.image ? /* @__PURE__ */ a(
|
|
1476
1452
|
"img",
|
|
1477
1453
|
{
|
|
1478
|
-
src:
|
|
1479
|
-
alt:
|
|
1454
|
+
src: h.productSnapshot.image,
|
|
1455
|
+
alt: h.productSnapshot.name,
|
|
1480
1456
|
className: "w-full h-full object-cover"
|
|
1481
1457
|
}
|
|
1482
1458
|
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs text-gray-500", children: "No Image" })
|
|
@@ -1484,18 +1460,18 @@ const lt = (e) => {
|
|
|
1484
1460
|
),
|
|
1485
1461
|
/* @__PURE__ */ d("div", { className: "flex flex-col flex-1 justify-between", children: [
|
|
1486
1462
|
/* @__PURE__ */ d("div", { children: [
|
|
1487
|
-
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children:
|
|
1488
|
-
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children:
|
|
1463
|
+
/* @__PURE__ */ a("p", { className: "font-semibold text-[15px] leading-snug", children: h.productSnapshot.name }),
|
|
1464
|
+
/* @__PURE__ */ a("p", { className: "mt-1 text-[14px] font-medium", children: h.productSnapshot.price != null ? new Intl.NumberFormat(void 0, {
|
|
1489
1465
|
style: "currency",
|
|
1490
1466
|
currency: ($ == null ? void 0 : $.currency) || "USD"
|
|
1491
1467
|
}).format(
|
|
1492
|
-
|
|
1468
|
+
h.productSnapshot.price
|
|
1493
1469
|
) : "" }),
|
|
1494
|
-
|
|
1470
|
+
h.productSnapshot.points > 0 && /* @__PURE__ */ d("p", { className: "mt-1 text-xs opacity-80", children: [
|
|
1495
1471
|
"You will earn",
|
|
1496
1472
|
" ",
|
|
1497
1473
|
/* @__PURE__ */ d("strong", { children: [
|
|
1498
|
-
|
|
1474
|
+
h.productSnapshot.points,
|
|
1499
1475
|
" ",
|
|
1500
1476
|
"points"
|
|
1501
1477
|
] })
|
|
@@ -1508,8 +1484,8 @@ const lt = (e) => {
|
|
|
1508
1484
|
{
|
|
1509
1485
|
className: "px-3 py-1 text-sm",
|
|
1510
1486
|
onClick: () => ve(
|
|
1511
|
-
(
|
|
1512
|
-
(L, W) => W ===
|
|
1487
|
+
(U) => U.map(
|
|
1488
|
+
(L, W) => W === O && L.productSnapshot ? {
|
|
1513
1489
|
...L,
|
|
1514
1490
|
productSnapshot: {
|
|
1515
1491
|
...L.productSnapshot,
|
|
@@ -1528,14 +1504,14 @@ const lt = (e) => {
|
|
|
1528
1504
|
children: "−"
|
|
1529
1505
|
}
|
|
1530
1506
|
),
|
|
1531
|
-
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children:
|
|
1507
|
+
/* @__PURE__ */ a("div", { className: "px-3 py-1 text-sm select-none", children: h.productSnapshot.quantity }),
|
|
1532
1508
|
/* @__PURE__ */ a(
|
|
1533
1509
|
"button",
|
|
1534
1510
|
{
|
|
1535
1511
|
className: "px-3 py-1 text-sm",
|
|
1536
1512
|
onClick: () => ve(
|
|
1537
|
-
(
|
|
1538
|
-
(L, W) => W ===
|
|
1513
|
+
(U) => U.map(
|
|
1514
|
+
(L, W) => W === O && L.productSnapshot ? {
|
|
1539
1515
|
...L,
|
|
1540
1516
|
productSnapshot: {
|
|
1541
1517
|
...L.productSnapshot,
|
|
@@ -1558,9 +1534,9 @@ const lt = (e) => {
|
|
|
1558
1534
|
onClick: () => {
|
|
1559
1535
|
kt(
|
|
1560
1536
|
dt(
|
|
1561
|
-
|
|
1537
|
+
h.productSnapshot
|
|
1562
1538
|
),
|
|
1563
|
-
|
|
1539
|
+
h.productSnapshot.quantity
|
|
1564
1540
|
);
|
|
1565
1541
|
},
|
|
1566
1542
|
disabled: P,
|
|
@@ -1580,7 +1556,7 @@ const lt = (e) => {
|
|
|
1580
1556
|
) })
|
|
1581
1557
|
] }) }),
|
|
1582
1558
|
/* @__PURE__ */ a("div", { className: "mb-20" })
|
|
1583
|
-
] },
|
|
1559
|
+
] }, O);
|
|
1584
1560
|
})
|
|
1585
1561
|
]
|
|
1586
1562
|
}
|
|
@@ -1600,9 +1576,9 @@ const lt = (e) => {
|
|
|
1600
1576
|
placeholder: "How can I help you...",
|
|
1601
1577
|
value: K,
|
|
1602
1578
|
autoFocus: !0,
|
|
1603
|
-
onChange: (
|
|
1604
|
-
onKeyDown: (
|
|
1605
|
-
|
|
1579
|
+
onChange: (h) => re(h.target.value),
|
|
1580
|
+
onKeyDown: (h) => {
|
|
1581
|
+
h.key === "Enter" && !q && Se();
|
|
1606
1582
|
}
|
|
1607
1583
|
}
|
|
1608
1584
|
),
|
|
@@ -1610,10 +1586,10 @@ const lt = (e) => {
|
|
|
1610
1586
|
"button",
|
|
1611
1587
|
{
|
|
1612
1588
|
type: "submit",
|
|
1613
|
-
disabled:
|
|
1589
|
+
disabled: q,
|
|
1614
1590
|
className: "p-3",
|
|
1615
1591
|
onClick: () => Se(),
|
|
1616
|
-
children:
|
|
1592
|
+
children: q ? /* @__PURE__ */ a(
|
|
1617
1593
|
"div",
|
|
1618
1594
|
{
|
|
1619
1595
|
className: "p-3 animate-spin rounded-full h-3 w-3 border-b-2",
|
|
@@ -1647,7 +1623,7 @@ const lt = (e) => {
|
|
|
1647
1623
|
]
|
|
1648
1624
|
}
|
|
1649
1625
|
),
|
|
1650
|
-
/* @__PURE__ */ a(
|
|
1626
|
+
/* @__PURE__ */ a(ma, { addToCartPwa: r })
|
|
1651
1627
|
] })
|
|
1652
1628
|
]
|
|
1653
1629
|
}
|
|
@@ -1655,32 +1631,32 @@ const lt = (e) => {
|
|
|
1655
1631
|
] })
|
|
1656
1632
|
] }) });
|
|
1657
1633
|
};
|
|
1658
|
-
var
|
|
1659
|
-
return
|
|
1634
|
+
var xr = function(e, t) {
|
|
1635
|
+
return xr = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(r, n) {
|
|
1660
1636
|
r.__proto__ = n;
|
|
1661
1637
|
} || function(r, n) {
|
|
1662
1638
|
for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && (r[o] = n[o]);
|
|
1663
|
-
},
|
|
1639
|
+
}, xr(e, t);
|
|
1664
1640
|
};
|
|
1665
|
-
function
|
|
1641
|
+
function pa(e, t) {
|
|
1666
1642
|
if (typeof t != "function" && t !== null)
|
|
1667
1643
|
throw new TypeError("Class extends value " + String(t) + " is not a constructor or null");
|
|
1668
|
-
|
|
1644
|
+
xr(e, t);
|
|
1669
1645
|
function r() {
|
|
1670
1646
|
this.constructor = e;
|
|
1671
1647
|
}
|
|
1672
1648
|
e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
|
|
1673
1649
|
}
|
|
1674
|
-
var
|
|
1675
|
-
return
|
|
1650
|
+
var Ge = function() {
|
|
1651
|
+
return Ge = Object.assign || function(t) {
|
|
1676
1652
|
for (var r, n = 1, o = arguments.length; n < o; n++) {
|
|
1677
1653
|
r = arguments[n];
|
|
1678
1654
|
for (var s in r) Object.prototype.hasOwnProperty.call(r, s) && (t[s] = r[s]);
|
|
1679
1655
|
}
|
|
1680
1656
|
return t;
|
|
1681
|
-
},
|
|
1657
|
+
}, Ge.apply(this, arguments);
|
|
1682
1658
|
};
|
|
1683
|
-
function
|
|
1659
|
+
function ga(e, t) {
|
|
1684
1660
|
var r = {};
|
|
1685
1661
|
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
1686
1662
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
@@ -1688,16 +1664,16 @@ function wa(e, t) {
|
|
|
1688
1664
|
t.indexOf(n[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[o]) && (r[n[o]] = e[n[o]]);
|
|
1689
1665
|
return r;
|
|
1690
1666
|
}
|
|
1691
|
-
var cr = "Invariant Violation",
|
|
1667
|
+
var cr = "Invariant Violation", ln = Object.setPrototypeOf, wa = ln === void 0 ? function(e, t) {
|
|
1692
1668
|
return e.__proto__ = t, e;
|
|
1693
|
-
} :
|
|
1669
|
+
} : ln, Vn = (
|
|
1694
1670
|
/** @class */
|
|
1695
1671
|
(function(e) {
|
|
1696
|
-
|
|
1672
|
+
pa(t, e);
|
|
1697
1673
|
function t(r) {
|
|
1698
1674
|
r === void 0 && (r = cr);
|
|
1699
1675
|
var n = e.call(this, typeof r == "number" ? cr + ": " + r + " (see https://github.com/apollographql/invariant-packages)" : r) || this;
|
|
1700
|
-
return n.framesToPop = 1, n.name = cr,
|
|
1676
|
+
return n.framesToPop = 1, n.name = cr, wa(n, t.prototype), n;
|
|
1701
1677
|
}
|
|
1702
1678
|
return t;
|
|
1703
1679
|
})(Error)
|
|
@@ -1706,10 +1682,10 @@ function it(e, t) {
|
|
|
1706
1682
|
if (!e)
|
|
1707
1683
|
throw new Vn(t);
|
|
1708
1684
|
}
|
|
1709
|
-
var Yn = ["debug", "log", "warn", "error", "silent"],
|
|
1685
|
+
var Yn = ["debug", "log", "warn", "error", "silent"], ya = Yn.indexOf("log");
|
|
1710
1686
|
function Yt(e) {
|
|
1711
1687
|
return function() {
|
|
1712
|
-
if (Yn.indexOf(e) >=
|
|
1688
|
+
if (Yn.indexOf(e) >= ya) {
|
|
1713
1689
|
var t = console[e] || console.log;
|
|
1714
1690
|
return t.apply(console, arguments);
|
|
1715
1691
|
}
|
|
@@ -1719,19 +1695,19 @@ function Yt(e) {
|
|
|
1719
1695
|
e.debug = Yt("debug"), e.log = Yt("log"), e.warn = Yt("warn"), e.error = Yt("error");
|
|
1720
1696
|
})(it || (it = {}));
|
|
1721
1697
|
var Jn = "3.14.0";
|
|
1722
|
-
function
|
|
1698
|
+
function pt(e) {
|
|
1723
1699
|
try {
|
|
1724
1700
|
return e();
|
|
1725
1701
|
} catch {
|
|
1726
1702
|
}
|
|
1727
1703
|
}
|
|
1728
|
-
const
|
|
1704
|
+
const br = pt(function() {
|
|
1729
1705
|
return globalThis;
|
|
1730
|
-
}) ||
|
|
1706
|
+
}) || pt(function() {
|
|
1731
1707
|
return window;
|
|
1732
|
-
}) ||
|
|
1708
|
+
}) || pt(function() {
|
|
1733
1709
|
return self;
|
|
1734
|
-
}) ||
|
|
1710
|
+
}) || pt(function() {
|
|
1735
1711
|
return global;
|
|
1736
1712
|
}) || // We don't expect the Function constructor ever to be invoked at runtime, as
|
|
1737
1713
|
// long as at least one of globalThis, window, self, or global is defined, so
|
|
@@ -1739,15 +1715,15 @@ const xr = ht(function() {
|
|
|
1739
1715
|
// detect syntactic usage of the Function constructor. If you think you can
|
|
1740
1716
|
// improve your static analysis to detect this obfuscation, think again. This
|
|
1741
1717
|
// is an arms race you cannot win, at least not in JavaScript.
|
|
1742
|
-
|
|
1743
|
-
return
|
|
1718
|
+
pt(function() {
|
|
1719
|
+
return pt.constructor("return this")();
|
|
1744
1720
|
});
|
|
1745
|
-
var
|
|
1721
|
+
var cn = /* @__PURE__ */ new Map();
|
|
1746
1722
|
function xa(e) {
|
|
1747
|
-
var t =
|
|
1748
|
-
return
|
|
1723
|
+
var t = cn.get(e) || 1;
|
|
1724
|
+
return cn.set(e, t + 1), "".concat(e, ":").concat(t, ":").concat(Math.random().toString(36).slice(2));
|
|
1749
1725
|
}
|
|
1750
|
-
function
|
|
1726
|
+
function ba(e, t) {
|
|
1751
1727
|
var r = xa("stringifyForDisplay");
|
|
1752
1728
|
return JSON.stringify(e, function(n, o) {
|
|
1753
1729
|
return o === void 0 ? r : o;
|
|
@@ -1759,7 +1735,7 @@ function Jt(e) {
|
|
|
1759
1735
|
r[n - 1] = arguments[n];
|
|
1760
1736
|
if (typeof t == "number") {
|
|
1761
1737
|
var o = t;
|
|
1762
|
-
t =
|
|
1738
|
+
t = Pr(o), t || (t = Fr(o, r), r = []);
|
|
1763
1739
|
}
|
|
1764
1740
|
e.apply(void 0, [t].concat(r));
|
|
1765
1741
|
};
|
|
@@ -1767,7 +1743,7 @@ function Jt(e) {
|
|
|
1767
1743
|
var dr = Object.assign(function(t, r) {
|
|
1768
1744
|
for (var n = [], o = 2; o < arguments.length; o++)
|
|
1769
1745
|
n[o - 2] = arguments[o];
|
|
1770
|
-
t || it(t,
|
|
1746
|
+
t || it(t, Pr(r, n) || Fr(r, n));
|
|
1771
1747
|
}, {
|
|
1772
1748
|
debug: Jt(it.debug),
|
|
1773
1749
|
log: Jt(it.log),
|
|
@@ -1777,23 +1753,23 @@ var dr = Object.assign(function(t, r) {
|
|
|
1777
1753
|
function Kn(e) {
|
|
1778
1754
|
for (var t = [], r = 1; r < arguments.length; r++)
|
|
1779
1755
|
t[r - 1] = arguments[r];
|
|
1780
|
-
return new Vn(
|
|
1756
|
+
return new Vn(Pr(e, t) || Fr(e, t));
|
|
1781
1757
|
}
|
|
1782
|
-
var
|
|
1758
|
+
var dn = Symbol.for("ApolloErrorMessageHandler_" + Jn);
|
|
1783
1759
|
function Wn(e) {
|
|
1784
1760
|
if (typeof e == "string")
|
|
1785
1761
|
return e;
|
|
1786
1762
|
try {
|
|
1787
|
-
return
|
|
1763
|
+
return ba(e, 2).slice(0, 1e3);
|
|
1788
1764
|
} catch {
|
|
1789
1765
|
return "<non-serializable>";
|
|
1790
1766
|
}
|
|
1791
1767
|
}
|
|
1792
|
-
function
|
|
1768
|
+
function Pr(e, t) {
|
|
1793
1769
|
if (t === void 0 && (t = []), !!e)
|
|
1794
|
-
return
|
|
1770
|
+
return br[dn] && br[dn](e, t.map(Wn));
|
|
1795
1771
|
}
|
|
1796
|
-
function
|
|
1772
|
+
function Fr(e, t) {
|
|
1797
1773
|
if (t === void 0 && (t = []), !!e)
|
|
1798
1774
|
return "An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#".concat(encodeURIComponent(JSON.stringify({
|
|
1799
1775
|
version: Jn,
|
|
@@ -1801,98 +1777,98 @@ function Pr(e, t) {
|
|
|
1801
1777
|
args: t.map(Wn)
|
|
1802
1778
|
})));
|
|
1803
1779
|
}
|
|
1804
|
-
function
|
|
1780
|
+
function va(e) {
|
|
1805
1781
|
return e.definitions.filter(function(t) {
|
|
1806
1782
|
return t.kind === "OperationDefinition" && !!t.name;
|
|
1807
1783
|
}).map(function(t) {
|
|
1808
1784
|
return t.name.value;
|
|
1809
1785
|
})[0] || null;
|
|
1810
1786
|
}
|
|
1811
|
-
let
|
|
1812
|
-
const
|
|
1813
|
-
let
|
|
1814
|
-
const
|
|
1787
|
+
let de = null;
|
|
1788
|
+
const un = {};
|
|
1789
|
+
let ka = 1;
|
|
1790
|
+
const Sa = () => class {
|
|
1815
1791
|
constructor() {
|
|
1816
1792
|
this.id = [
|
|
1817
1793
|
"slot",
|
|
1818
|
-
|
|
1794
|
+
ka++,
|
|
1819
1795
|
Date.now(),
|
|
1820
1796
|
Math.random().toString(36).slice(2)
|
|
1821
1797
|
].join(":");
|
|
1822
1798
|
}
|
|
1823
1799
|
hasValue() {
|
|
1824
|
-
for (let t =
|
|
1800
|
+
for (let t = de; t; t = t.parent)
|
|
1825
1801
|
if (this.id in t.slots) {
|
|
1826
1802
|
const r = t.slots[this.id];
|
|
1827
|
-
if (r ===
|
|
1803
|
+
if (r === un)
|
|
1828
1804
|
break;
|
|
1829
|
-
return t !==
|
|
1805
|
+
return t !== de && (de.slots[this.id] = r), !0;
|
|
1830
1806
|
}
|
|
1831
|
-
return
|
|
1807
|
+
return de && (de.slots[this.id] = un), !1;
|
|
1832
1808
|
}
|
|
1833
1809
|
getValue() {
|
|
1834
1810
|
if (this.hasValue())
|
|
1835
|
-
return
|
|
1811
|
+
return de.slots[this.id];
|
|
1836
1812
|
}
|
|
1837
1813
|
withValue(t, r, n, o) {
|
|
1838
1814
|
const s = {
|
|
1839
1815
|
__proto__: null,
|
|
1840
1816
|
[this.id]: t
|
|
1841
|
-
}, i =
|
|
1842
|
-
|
|
1817
|
+
}, i = de;
|
|
1818
|
+
de = { parent: i, slots: s };
|
|
1843
1819
|
try {
|
|
1844
1820
|
return r.apply(o, n);
|
|
1845
1821
|
} finally {
|
|
1846
|
-
|
|
1822
|
+
de = i;
|
|
1847
1823
|
}
|
|
1848
1824
|
}
|
|
1849
1825
|
// Capture the current context and wrap a callback function so that it
|
|
1850
1826
|
// reestablishes the captured context when called.
|
|
1851
1827
|
static bind(t) {
|
|
1852
|
-
const r =
|
|
1828
|
+
const r = de;
|
|
1853
1829
|
return function() {
|
|
1854
|
-
const n =
|
|
1830
|
+
const n = de;
|
|
1855
1831
|
try {
|
|
1856
|
-
return
|
|
1832
|
+
return de = r, t.apply(this, arguments);
|
|
1857
1833
|
} finally {
|
|
1858
|
-
|
|
1834
|
+
de = n;
|
|
1859
1835
|
}
|
|
1860
1836
|
};
|
|
1861
1837
|
}
|
|
1862
1838
|
// Immediately run a callback function without any captured context.
|
|
1863
1839
|
static noContext(t, r, n) {
|
|
1864
|
-
if (
|
|
1865
|
-
const o =
|
|
1840
|
+
if (de) {
|
|
1841
|
+
const o = de;
|
|
1866
1842
|
try {
|
|
1867
|
-
return
|
|
1843
|
+
return de = null, t.apply(n, r);
|
|
1868
1844
|
} finally {
|
|
1869
|
-
|
|
1845
|
+
de = o;
|
|
1870
1846
|
}
|
|
1871
1847
|
} else
|
|
1872
1848
|
return t.apply(n, r);
|
|
1873
1849
|
}
|
|
1874
1850
|
};
|
|
1875
|
-
function
|
|
1851
|
+
function fn(e) {
|
|
1876
1852
|
try {
|
|
1877
1853
|
return e();
|
|
1878
1854
|
} catch {
|
|
1879
1855
|
}
|
|
1880
1856
|
}
|
|
1881
|
-
const ur = "@wry/context:Slot",
|
|
1857
|
+
const ur = "@wry/context:Slot", Na = (
|
|
1882
1858
|
// Prefer globalThis when available.
|
|
1883
1859
|
// https://github.com/benjamn/wryware/issues/347
|
|
1884
|
-
|
|
1860
|
+
fn(() => globalThis) || // Fall back to global, which works in Node.js and may be converted by some
|
|
1885
1861
|
// bundlers to the appropriate identifier (window, self, ...) depending on the
|
|
1886
1862
|
// bundling target. https://github.com/endojs/endo/issues/576#issuecomment-1178515224
|
|
1887
|
-
|
|
1863
|
+
fn(() => global) || // Otherwise, use a dummy host that's local to this module. We used to fall
|
|
1888
1864
|
// back to using the Array constructor as a namespace, but that was flagged in
|
|
1889
1865
|
// https://github.com/benjamn/wryware/issues/347, and can be avoided.
|
|
1890
1866
|
/* @__PURE__ */ Object.create(null)
|
|
1891
|
-
),
|
|
1867
|
+
), mn = Na, Er = mn[ur] || // Earlier versions of this package stored the globalKey property on the Array
|
|
1892
1868
|
// constructor, so we check there as well, to prevent Slot class duplication.
|
|
1893
1869
|
Array[ur] || (function(e) {
|
|
1894
1870
|
try {
|
|
1895
|
-
Object.defineProperty(
|
|
1871
|
+
Object.defineProperty(mn, ur, {
|
|
1896
1872
|
value: e,
|
|
1897
1873
|
enumerable: !1,
|
|
1898
1874
|
writable: !1,
|
|
@@ -1907,9 +1883,9 @@ Array[ur] || (function(e) {
|
|
|
1907
1883
|
} finally {
|
|
1908
1884
|
return e;
|
|
1909
1885
|
}
|
|
1910
|
-
})(
|
|
1911
|
-
new
|
|
1912
|
-
function
|
|
1886
|
+
})(Sa()), { bind: yi, noContext: xi } = Er;
|
|
1887
|
+
new Er();
|
|
1888
|
+
function Ca(e, t) {
|
|
1913
1889
|
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
1914
1890
|
if (r) return (r = r.call(e)).next.bind(r);
|
|
1915
1891
|
if (Array.isArray(e) || (r = _a(e)) || t) {
|
|
@@ -1924,13 +1900,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1924
1900
|
}
|
|
1925
1901
|
function _a(e, t) {
|
|
1926
1902
|
if (e) {
|
|
1927
|
-
if (typeof e == "string") return
|
|
1903
|
+
if (typeof e == "string") return hn(e, t);
|
|
1928
1904
|
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
1929
1905
|
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
1930
|
-
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return
|
|
1906
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return hn(e, t);
|
|
1931
1907
|
}
|
|
1932
1908
|
}
|
|
1933
|
-
function
|
|
1909
|
+
function hn(e, t) {
|
|
1934
1910
|
(t == null || t > e.length) && (t = e.length);
|
|
1935
1911
|
for (var r = 0, n = new Array(t); r < t; r++)
|
|
1936
1912
|
n[r] = e[r];
|
|
@@ -1942,18 +1918,18 @@ function pn(e, t) {
|
|
|
1942
1918
|
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
|
|
1943
1919
|
}
|
|
1944
1920
|
}
|
|
1945
|
-
function
|
|
1921
|
+
function Tr(e, t, r) {
|
|
1946
1922
|
return t && pn(e.prototype, t), r && pn(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
1947
1923
|
}
|
|
1948
|
-
var
|
|
1924
|
+
var Ar = function() {
|
|
1949
1925
|
return typeof Symbol == "function";
|
|
1950
|
-
},
|
|
1951
|
-
return
|
|
1926
|
+
}, Or = function(e) {
|
|
1927
|
+
return Ar() && !!Symbol[e];
|
|
1952
1928
|
}, jr = function(e) {
|
|
1953
|
-
return
|
|
1929
|
+
return Or(e) ? Symbol[e] : "@@" + e;
|
|
1954
1930
|
};
|
|
1955
|
-
|
|
1956
|
-
var
|
|
1931
|
+
Ar() && !Or("observable") && (Symbol.observable = Symbol("observable"));
|
|
1932
|
+
var Ia = jr("iterator"), vr = jr("observable"), Qn = jr("species");
|
|
1957
1933
|
function nr(e, t) {
|
|
1958
1934
|
var r = e[t];
|
|
1959
1935
|
if (r != null) {
|
|
@@ -1965,11 +1941,11 @@ function Tt(e) {
|
|
|
1965
1941
|
var t = e.constructor;
|
|
1966
1942
|
return t !== void 0 && (t = t[Qn], t === null && (t = void 0)), t !== void 0 ? t : we;
|
|
1967
1943
|
}
|
|
1968
|
-
function
|
|
1944
|
+
function Pa(e) {
|
|
1969
1945
|
return e instanceof we;
|
|
1970
1946
|
}
|
|
1971
|
-
function
|
|
1972
|
-
|
|
1947
|
+
function bt(e) {
|
|
1948
|
+
bt.log ? bt.log(e) : setTimeout(function() {
|
|
1973
1949
|
throw e;
|
|
1974
1950
|
});
|
|
1975
1951
|
}
|
|
@@ -1978,7 +1954,7 @@ function Wt(e) {
|
|
|
1978
1954
|
try {
|
|
1979
1955
|
e();
|
|
1980
1956
|
} catch (t) {
|
|
1981
|
-
|
|
1957
|
+
bt(t);
|
|
1982
1958
|
}
|
|
1983
1959
|
});
|
|
1984
1960
|
}
|
|
@@ -1993,13 +1969,13 @@ function Gn(e) {
|
|
|
1993
1969
|
r && r.call(t);
|
|
1994
1970
|
}
|
|
1995
1971
|
} catch (n) {
|
|
1996
|
-
|
|
1972
|
+
bt(n);
|
|
1997
1973
|
}
|
|
1998
1974
|
}
|
|
1999
1975
|
function kr(e) {
|
|
2000
1976
|
e._observer = void 0, e._queue = void 0, e._state = "closed";
|
|
2001
1977
|
}
|
|
2002
|
-
function
|
|
1978
|
+
function Fa(e) {
|
|
2003
1979
|
var t = e._queue;
|
|
2004
1980
|
if (t) {
|
|
2005
1981
|
e._queue = void 0, e._state = "ready";
|
|
@@ -2025,7 +2001,7 @@ function Xn(e, t, r) {
|
|
|
2025
2001
|
break;
|
|
2026
2002
|
}
|
|
2027
2003
|
} catch (s) {
|
|
2028
|
-
|
|
2004
|
+
bt(s);
|
|
2029
2005
|
}
|
|
2030
2006
|
e._state === "closed" ? Gn(e) : e._state === "running" && (e._state = "ready");
|
|
2031
2007
|
}
|
|
@@ -2043,17 +2019,17 @@ function fr(e, t, r) {
|
|
|
2043
2019
|
type: t,
|
|
2044
2020
|
value: r
|
|
2045
2021
|
}], Wt(function() {
|
|
2046
|
-
return
|
|
2022
|
+
return Fa(e);
|
|
2047
2023
|
});
|
|
2048
2024
|
return;
|
|
2049
2025
|
}
|
|
2050
2026
|
Xn(e, t, r);
|
|
2051
2027
|
}
|
|
2052
2028
|
}
|
|
2053
|
-
var
|
|
2029
|
+
var Ea = /* @__PURE__ */ (function() {
|
|
2054
2030
|
function e(r, n) {
|
|
2055
2031
|
this._cleanup = void 0, this._observer = r, this._queue = void 0, this._state = "initializing";
|
|
2056
|
-
var o = new
|
|
2032
|
+
var o = new Ta(this);
|
|
2057
2033
|
try {
|
|
2058
2034
|
this._cleanup = n.call(void 0, o);
|
|
2059
2035
|
} catch (s) {
|
|
@@ -2064,13 +2040,13 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2064
2040
|
var t = e.prototype;
|
|
2065
2041
|
return t.unsubscribe = function() {
|
|
2066
2042
|
this._state !== "closed" && (kr(this), Gn(this));
|
|
2067
|
-
},
|
|
2043
|
+
}, Tr(e, [{
|
|
2068
2044
|
key: "closed",
|
|
2069
2045
|
get: function() {
|
|
2070
2046
|
return this._state === "closed";
|
|
2071
2047
|
}
|
|
2072
2048
|
}]), e;
|
|
2073
|
-
})(),
|
|
2049
|
+
})(), Ta = /* @__PURE__ */ (function() {
|
|
2074
2050
|
function e(r) {
|
|
2075
2051
|
this._subscription = r;
|
|
2076
2052
|
}
|
|
@@ -2081,7 +2057,7 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2081
2057
|
fr(this._subscription, "error", n);
|
|
2082
2058
|
}, t.complete = function() {
|
|
2083
2059
|
fr(this._subscription, "complete");
|
|
2084
|
-
},
|
|
2060
|
+
}, Tr(e, [{
|
|
2085
2061
|
key: "closed",
|
|
2086
2062
|
get: function() {
|
|
2087
2063
|
return this._subscription._state === "closed";
|
|
@@ -2099,7 +2075,7 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2099
2075
|
next: n,
|
|
2100
2076
|
error: arguments[1],
|
|
2101
2077
|
complete: arguments[2]
|
|
2102
|
-
}), new
|
|
2078
|
+
}), new Ea(n, this._subscriber);
|
|
2103
2079
|
}, t.forEach = function(n) {
|
|
2104
2080
|
var o = this;
|
|
2105
2081
|
return new Promise(function(s, i) {
|
|
@@ -2111,9 +2087,9 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2111
2087
|
l.unsubscribe(), s();
|
|
2112
2088
|
}
|
|
2113
2089
|
var l = o.subscribe({
|
|
2114
|
-
next: function(
|
|
2090
|
+
next: function(p) {
|
|
2115
2091
|
try {
|
|
2116
|
-
n(
|
|
2092
|
+
n(p, c);
|
|
2117
2093
|
} catch (g) {
|
|
2118
2094
|
i(g), l.unsubscribe();
|
|
2119
2095
|
}
|
|
@@ -2169,26 +2145,26 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2169
2145
|
}, t.reduce = function(n) {
|
|
2170
2146
|
var o = this;
|
|
2171
2147
|
if (typeof n != "function") throw new TypeError(n + " is not a function");
|
|
2172
|
-
var s = Tt(this), i = arguments.length > 1, c = !1, l = arguments[1],
|
|
2148
|
+
var s = Tt(this), i = arguments.length > 1, c = !1, l = arguments[1], p = l;
|
|
2173
2149
|
return new s(function(g) {
|
|
2174
2150
|
return o.subscribe({
|
|
2175
2151
|
next: function(y) {
|
|
2176
|
-
var
|
|
2177
|
-
if (c = !0, !
|
|
2152
|
+
var x = !c;
|
|
2153
|
+
if (c = !0, !x || i)
|
|
2178
2154
|
try {
|
|
2179
|
-
|
|
2180
|
-
} catch (
|
|
2181
|
-
return g.error(
|
|
2155
|
+
p = n(p, y);
|
|
2156
|
+
} catch (I) {
|
|
2157
|
+
return g.error(I);
|
|
2182
2158
|
}
|
|
2183
2159
|
else
|
|
2184
|
-
|
|
2160
|
+
p = y;
|
|
2185
2161
|
},
|
|
2186
2162
|
error: function(y) {
|
|
2187
2163
|
g.error(y);
|
|
2188
2164
|
},
|
|
2189
2165
|
complete: function() {
|
|
2190
2166
|
if (!c && !i) return g.error(new TypeError("Cannot reduce an empty sequence"));
|
|
2191
|
-
g.next(
|
|
2167
|
+
g.next(p), g.complete();
|
|
2192
2168
|
}
|
|
2193
2169
|
});
|
|
2194
2170
|
});
|
|
@@ -2197,22 +2173,22 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2197
2173
|
s[i] = arguments[i];
|
|
2198
2174
|
var c = Tt(this);
|
|
2199
2175
|
return new c(function(l) {
|
|
2200
|
-
var
|
|
2201
|
-
function y(
|
|
2202
|
-
|
|
2203
|
-
next: function(
|
|
2204
|
-
l.next(
|
|
2176
|
+
var p, g = 0;
|
|
2177
|
+
function y(x) {
|
|
2178
|
+
p = x.subscribe({
|
|
2179
|
+
next: function(I) {
|
|
2180
|
+
l.next(I);
|
|
2205
2181
|
},
|
|
2206
|
-
error: function(
|
|
2207
|
-
l.error(
|
|
2182
|
+
error: function(I) {
|
|
2183
|
+
l.error(I);
|
|
2208
2184
|
},
|
|
2209
2185
|
complete: function() {
|
|
2210
|
-
g === s.length ? (
|
|
2186
|
+
g === s.length ? (p = void 0, l.complete()) : y(c.from(s[g++]));
|
|
2211
2187
|
}
|
|
2212
2188
|
});
|
|
2213
2189
|
}
|
|
2214
2190
|
return y(n), function() {
|
|
2215
|
-
|
|
2191
|
+
p && (p.unsubscribe(), p = void 0);
|
|
2216
2192
|
};
|
|
2217
2193
|
});
|
|
2218
2194
|
}, t.flatMap = function(n) {
|
|
@@ -2225,19 +2201,19 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2225
2201
|
if (n)
|
|
2226
2202
|
try {
|
|
2227
2203
|
g = n(g);
|
|
2228
|
-
} catch (
|
|
2229
|
-
return i.error(
|
|
2204
|
+
} catch (x) {
|
|
2205
|
+
return i.error(x);
|
|
2230
2206
|
}
|
|
2231
2207
|
var y = s.from(g).subscribe({
|
|
2232
|
-
next: function(
|
|
2233
|
-
i.next(
|
|
2208
|
+
next: function(x) {
|
|
2209
|
+
i.next(x);
|
|
2234
2210
|
},
|
|
2235
|
-
error: function(
|
|
2236
|
-
i.error(
|
|
2211
|
+
error: function(x) {
|
|
2212
|
+
i.error(x);
|
|
2237
2213
|
},
|
|
2238
2214
|
complete: function() {
|
|
2239
|
-
var
|
|
2240
|
-
|
|
2215
|
+
var x = c.indexOf(y);
|
|
2216
|
+
x >= 0 && c.splice(x, 1), p();
|
|
2241
2217
|
}
|
|
2242
2218
|
});
|
|
2243
2219
|
c.push(y);
|
|
@@ -2246,10 +2222,10 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2246
2222
|
i.error(g);
|
|
2247
2223
|
},
|
|
2248
2224
|
complete: function() {
|
|
2249
|
-
|
|
2225
|
+
p();
|
|
2250
2226
|
}
|
|
2251
2227
|
});
|
|
2252
|
-
function
|
|
2228
|
+
function p() {
|
|
2253
2229
|
l.closed && c.length === 0 && i.complete();
|
|
2254
2230
|
}
|
|
2255
2231
|
return function() {
|
|
@@ -2267,16 +2243,16 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2267
2243
|
if (s) {
|
|
2268
2244
|
var i = s.call(n);
|
|
2269
2245
|
if (Object(i) !== i) throw new TypeError(i + " is not an object");
|
|
2270
|
-
return
|
|
2246
|
+
return Pa(i) && i.constructor === o ? i : new o(function(c) {
|
|
2271
2247
|
return i.subscribe(c);
|
|
2272
2248
|
});
|
|
2273
2249
|
}
|
|
2274
|
-
if (
|
|
2250
|
+
if (Or("iterator") && (s = nr(n, Ia), s))
|
|
2275
2251
|
return new o(function(c) {
|
|
2276
2252
|
Wt(function() {
|
|
2277
2253
|
if (!c.closed) {
|
|
2278
|
-
for (var l =
|
|
2279
|
-
var g =
|
|
2254
|
+
for (var l = Ca(s.call(n)), p; !(p = l()).done; ) {
|
|
2255
|
+
var g = p.value;
|
|
2280
2256
|
if (c.next(g), c.closed) return;
|
|
2281
2257
|
}
|
|
2282
2258
|
c.complete();
|
|
@@ -2307,21 +2283,21 @@ var Ta = /* @__PURE__ */ (function() {
|
|
|
2307
2283
|
}
|
|
2308
2284
|
});
|
|
2309
2285
|
});
|
|
2310
|
-
},
|
|
2286
|
+
}, Tr(e, null, [{
|
|
2311
2287
|
key: Qn,
|
|
2312
2288
|
get: function() {
|
|
2313
2289
|
return this;
|
|
2314
2290
|
}
|
|
2315
2291
|
}]), e;
|
|
2316
2292
|
})();
|
|
2317
|
-
|
|
2293
|
+
Ar() && Object.defineProperty(we, Symbol("extensions"), {
|
|
2318
2294
|
value: {
|
|
2319
2295
|
symbol: vr,
|
|
2320
|
-
hostReportError:
|
|
2296
|
+
hostReportError: bt
|
|
2321
2297
|
},
|
|
2322
2298
|
configurable: !0
|
|
2323
2299
|
});
|
|
2324
|
-
function
|
|
2300
|
+
function Aa(e) {
|
|
2325
2301
|
var t, r = e.Symbol;
|
|
2326
2302
|
if (typeof r == "function")
|
|
2327
2303
|
if (r.observable)
|
|
@@ -2337,11 +2313,11 @@ function ja(e) {
|
|
|
2337
2313
|
t = "@@observable";
|
|
2338
2314
|
return t;
|
|
2339
2315
|
}
|
|
2340
|
-
var
|
|
2341
|
-
typeof self < "u" ?
|
|
2342
|
-
|
|
2343
|
-
var
|
|
2344
|
-
|
|
2316
|
+
var xt;
|
|
2317
|
+
typeof self < "u" ? xt = self : typeof window < "u" ? xt = window : typeof global < "u" ? xt = global : typeof module < "u" ? xt = module : xt = Function("return this")();
|
|
2318
|
+
Aa(xt);
|
|
2319
|
+
var gn = we.prototype, wn = "@@observable";
|
|
2320
|
+
gn[wn] || (gn[wn] = function() {
|
|
2345
2321
|
return this;
|
|
2346
2322
|
});
|
|
2347
2323
|
function Oa(e) {
|
|
@@ -2358,11 +2334,11 @@ function Oa(e) {
|
|
|
2358
2334
|
}
|
|
2359
2335
|
return e;
|
|
2360
2336
|
}
|
|
2361
|
-
function
|
|
2362
|
-
var r =
|
|
2363
|
-
typeof s == "function" ? r =
|
|
2337
|
+
function ja(e, t) {
|
|
2338
|
+
var r = Ge({}, e), n = function(s) {
|
|
2339
|
+
typeof s == "function" ? r = Ge(Ge({}, r), s(r)) : r = Ge(Ge({}, r), s);
|
|
2364
2340
|
}, o = function() {
|
|
2365
|
-
return
|
|
2341
|
+
return Ge({}, r);
|
|
2366
2342
|
};
|
|
2367
2343
|
return Object.defineProperty(t, "setContext", {
|
|
2368
2344
|
enumerable: !1,
|
|
@@ -2372,23 +2348,23 @@ function $a(e, t) {
|
|
|
2372
2348
|
value: o
|
|
2373
2349
|
}), t;
|
|
2374
2350
|
}
|
|
2375
|
-
function
|
|
2351
|
+
function $a(e) {
|
|
2376
2352
|
var t = {
|
|
2377
2353
|
variables: e.variables || {},
|
|
2378
2354
|
extensions: e.extensions || {},
|
|
2379
2355
|
operationName: e.operationName,
|
|
2380
2356
|
query: e.query
|
|
2381
2357
|
};
|
|
2382
|
-
return t.operationName || (t.operationName = typeof t.query != "string" ?
|
|
2358
|
+
return t.operationName || (t.operationName = typeof t.query != "string" ? va(t.query) || void 0 : ""), t;
|
|
2383
2359
|
}
|
|
2384
|
-
var
|
|
2385
|
-
function
|
|
2386
|
-
return
|
|
2360
|
+
var La = Symbol.for("apollo.deprecations"), za = br, Da = new Er();
|
|
2361
|
+
function Ma(e) {
|
|
2362
|
+
return za[La] || (Da.getValue() || []).includes(e);
|
|
2387
2363
|
}
|
|
2388
|
-
function
|
|
2389
|
-
|
|
2364
|
+
function Ba(e, t) {
|
|
2365
|
+
Ma(e) || t();
|
|
2390
2366
|
}
|
|
2391
|
-
function
|
|
2367
|
+
function yn(e, t) {
|
|
2392
2368
|
return t ? t(e) : we.of();
|
|
2393
2369
|
}
|
|
2394
2370
|
function At(e) {
|
|
@@ -2412,14 +2388,14 @@ var Zn = (
|
|
|
2412
2388
|
return r.concat(n);
|
|
2413
2389
|
});
|
|
2414
2390
|
}, e.split = function(t, r, n) {
|
|
2415
|
-
var o = At(r), s = At(n || new e(
|
|
2391
|
+
var o = At(r), s = At(n || new e(yn)), i;
|
|
2416
2392
|
return Kt(o) && Kt(s) ? i = new e(function(c) {
|
|
2417
2393
|
return t(c) ? o.request(c) || we.of() : s.request(c) || we.of();
|
|
2418
2394
|
}) : i = new e(function(c, l) {
|
|
2419
2395
|
return t(c) ? o.request(c, l) || we.of() : s.request(c, l) || we.of();
|
|
2420
2396
|
}), Object.assign(i, { left: o, right: s });
|
|
2421
2397
|
}, e.execute = function(t, r) {
|
|
2422
|
-
return t.request(
|
|
2398
|
+
return t.request(ja(r.context, $a(Oa(r)))) || we.of();
|
|
2423
2399
|
}, e.concat = function(t, r) {
|
|
2424
2400
|
var n = At(t);
|
|
2425
2401
|
if (Kt(n))
|
|
@@ -2435,13 +2411,13 @@ var Zn = (
|
|
|
2435
2411
|
}) || we.of();
|
|
2436
2412
|
}), Object.assign(s, { left: n, right: o });
|
|
2437
2413
|
}, e.prototype.split = function(t, r, n) {
|
|
2438
|
-
return this.concat(e.split(t, r, n || new e(
|
|
2414
|
+
return this.concat(e.split(t, r, n || new e(yn)));
|
|
2439
2415
|
}, e.prototype.concat = function(t) {
|
|
2440
2416
|
return e.concat(this, t);
|
|
2441
2417
|
}, e.prototype.request = function(t, r) {
|
|
2442
2418
|
throw Kn(48);
|
|
2443
2419
|
}, e.prototype.onError = function(t, r) {
|
|
2444
|
-
if (globalThis.__DEV__ !== !1 &&
|
|
2420
|
+
if (globalThis.__DEV__ !== !1 && Ba("onError", function() {
|
|
2445
2421
|
globalThis.__DEV__ !== !1 && dr.warn(49);
|
|
2446
2422
|
}), r && r.error)
|
|
2447
2423
|
return r.error(t), !1;
|
|
@@ -2451,9 +2427,9 @@ var Zn = (
|
|
|
2451
2427
|
}, e;
|
|
2452
2428
|
})()
|
|
2453
2429
|
);
|
|
2454
|
-
function
|
|
2430
|
+
function Ua(e) {
|
|
2455
2431
|
return new Zn(function(t, r) {
|
|
2456
|
-
var n =
|
|
2432
|
+
var n = ga(t, []);
|
|
2457
2433
|
return new we(function(o) {
|
|
2458
2434
|
var s, i = !1;
|
|
2459
2435
|
return Promise.resolve(n).then(function(c) {
|
|
@@ -2473,7 +2449,7 @@ function Ra(e) {
|
|
|
2473
2449
|
const qa = async () => {
|
|
2474
2450
|
const e = "https://auth.australia-southeast1.gcp.commercetools.com/oauth/token", n = "Basic " + btoa(encodeURIComponent("tfegsSBVOYnR7e_yE-AjxVVN") + ":" + encodeURIComponent("pyKWgHuTxuMwDygh9JH1ehLEaLvAhBo4"));
|
|
2475
2451
|
try {
|
|
2476
|
-
const o = await
|
|
2452
|
+
const o = await ue.post(
|
|
2477
2453
|
e,
|
|
2478
2454
|
new URLSearchParams({ grant_type: "client_credentials" }),
|
|
2479
2455
|
// Only grant_type in body
|
|
@@ -2486,11 +2462,11 @@ const qa = async () => {
|
|
|
2486
2462
|
);
|
|
2487
2463
|
return o.status === 200 && o.data.access_token ? o.data.access_token : (console.error("Failed to fetch token:", o.data), null);
|
|
2488
2464
|
} catch (o) {
|
|
2489
|
-
return
|
|
2465
|
+
return ue.isAxiosError(o) ? console.error("Error fetching token:", o.response || o.message) : console.error("Unexpected error:", o), null;
|
|
2490
2466
|
}
|
|
2491
|
-
},
|
|
2492
|
-
uri: `${
|
|
2493
|
-
}),
|
|
2467
|
+
}, Ra = "https://api.australia-southeast1.gcp.commercetools.com/kt-demo/graphql", Ha = Uo({
|
|
2468
|
+
uri: `${Ra}`
|
|
2469
|
+
}), Va = Ua(async (e, { headers: t }) => {
|
|
2494
2470
|
const r = await qa();
|
|
2495
2471
|
return {
|
|
2496
2472
|
headers: {
|
|
@@ -2498,19 +2474,19 @@ const qa = async () => {
|
|
|
2498
2474
|
authorization: `Bearer ${r}`
|
|
2499
2475
|
}
|
|
2500
2476
|
};
|
|
2501
|
-
}),
|
|
2502
|
-
link:
|
|
2503
|
-
cache: new
|
|
2477
|
+
}), Ya = new qo({
|
|
2478
|
+
link: Va.concat(Ha),
|
|
2479
|
+
cache: new Ro(),
|
|
2504
2480
|
defaultOptions: {
|
|
2505
2481
|
watchQuery: {
|
|
2506
2482
|
fetchPolicy: "cache-and-network"
|
|
2507
2483
|
}
|
|
2508
2484
|
}
|
|
2509
|
-
}),
|
|
2485
|
+
}), bi = (e) => {
|
|
2510
2486
|
const { tanyaConfig: t } = e;
|
|
2511
|
-
return /* @__PURE__ */ a(Ho, { client:
|
|
2487
|
+
return /* @__PURE__ */ a(Ho, { client: Ya, children: /* @__PURE__ */ a(ta, { children: /* @__PURE__ */ a(ha, { tanyaConfig: t }) }) });
|
|
2512
2488
|
};
|
|
2513
|
-
function
|
|
2489
|
+
function Ja(e, t) {
|
|
2514
2490
|
const r = e.icons, n = e.aliases || /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
|
|
2515
2491
|
function s(i) {
|
|
2516
2492
|
if (r[i]) return o[i] = [];
|
|
@@ -2532,32 +2508,32 @@ const eo = Object.freeze({
|
|
|
2532
2508
|
rotate: 0,
|
|
2533
2509
|
vFlip: !1,
|
|
2534
2510
|
hFlip: !1
|
|
2535
|
-
}),
|
|
2511
|
+
}), $r = Object.freeze({
|
|
2536
2512
|
...eo,
|
|
2537
2513
|
...or
|
|
2538
2514
|
}), Sr = Object.freeze({
|
|
2539
|
-
|
|
2515
|
+
...$r,
|
|
2540
2516
|
body: "",
|
|
2541
2517
|
hidden: !1
|
|
2542
2518
|
});
|
|
2543
|
-
function
|
|
2519
|
+
function Ka(e, t) {
|
|
2544
2520
|
const r = {};
|
|
2545
2521
|
!e.hFlip != !t.hFlip && (r.hFlip = !0), !e.vFlip != !t.vFlip && (r.vFlip = !0);
|
|
2546
2522
|
const n = ((e.rotate || 0) + (t.rotate || 0)) % 4;
|
|
2547
2523
|
return n && (r.rotate = n), r;
|
|
2548
2524
|
}
|
|
2549
|
-
function
|
|
2550
|
-
const r =
|
|
2525
|
+
function xn(e, t) {
|
|
2526
|
+
const r = Ka(e, t);
|
|
2551
2527
|
for (const n in Sr) n in or ? n in e && !(n in r) && (r[n] = or[n]) : n in t ? r[n] = t[n] : n in e && (r[n] = e[n]);
|
|
2552
2528
|
return r;
|
|
2553
2529
|
}
|
|
2554
|
-
function
|
|
2530
|
+
function Wa(e, t, r) {
|
|
2555
2531
|
const n = e.icons, o = e.aliases || /* @__PURE__ */ Object.create(null);
|
|
2556
2532
|
let s = {};
|
|
2557
2533
|
function i(c) {
|
|
2558
|
-
s =
|
|
2534
|
+
s = xn(n[c] || o[c], s);
|
|
2559
2535
|
}
|
|
2560
|
-
return i(t), r.forEach(i),
|
|
2536
|
+
return i(t), r.forEach(i), xn(e, s);
|
|
2561
2537
|
}
|
|
2562
2538
|
function to(e, t) {
|
|
2563
2539
|
const r = [];
|
|
@@ -2565,14 +2541,14 @@ function to(e, t) {
|
|
|
2565
2541
|
e.not_found instanceof Array && e.not_found.forEach((o) => {
|
|
2566
2542
|
t(o, null), r.push(o);
|
|
2567
2543
|
});
|
|
2568
|
-
const n =
|
|
2544
|
+
const n = Ja(e);
|
|
2569
2545
|
for (const o in n) {
|
|
2570
2546
|
const s = n[o];
|
|
2571
|
-
s && (t(o,
|
|
2547
|
+
s && (t(o, Wa(e, o, s)), r.push(o));
|
|
2572
2548
|
}
|
|
2573
2549
|
return r;
|
|
2574
2550
|
}
|
|
2575
|
-
const
|
|
2551
|
+
const Qa = {
|
|
2576
2552
|
provider: "",
|
|
2577
2553
|
aliases: {},
|
|
2578
2554
|
not_found: {},
|
|
@@ -2585,7 +2561,7 @@ function mr(e, t) {
|
|
|
2585
2561
|
function ro(e) {
|
|
2586
2562
|
if (typeof e != "object" || e === null) return null;
|
|
2587
2563
|
const t = e;
|
|
2588
|
-
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !mr(e,
|
|
2564
|
+
if (typeof t.prefix != "string" || !e.icons || typeof e.icons != "object" || !mr(e, Qa)) return null;
|
|
2589
2565
|
const r = t.icons;
|
|
2590
2566
|
for (const o in r) {
|
|
2591
2567
|
const s = r[o];
|
|
@@ -2599,7 +2575,7 @@ function ro(e) {
|
|
|
2599
2575
|
return t;
|
|
2600
2576
|
}
|
|
2601
2577
|
const bn = /* @__PURE__ */ Object.create(null);
|
|
2602
|
-
function
|
|
2578
|
+
function Ga(e, t) {
|
|
2603
2579
|
return {
|
|
2604
2580
|
provider: e,
|
|
2605
2581
|
prefix: t,
|
|
@@ -2609,14 +2585,14 @@ function Xa(e, t) {
|
|
|
2609
2585
|
}
|
|
2610
2586
|
function vt(e, t) {
|
|
2611
2587
|
const r = bn[e] || (bn[e] = /* @__PURE__ */ Object.create(null));
|
|
2612
|
-
return r[t] || (r[t] =
|
|
2588
|
+
return r[t] || (r[t] = Ga(e, t));
|
|
2613
2589
|
}
|
|
2614
2590
|
function no(e, t) {
|
|
2615
2591
|
return ro(t) ? to(t, (r, n) => {
|
|
2616
2592
|
n ? e.icons[r] = n : e.missing.add(r);
|
|
2617
2593
|
}) : [];
|
|
2618
2594
|
}
|
|
2619
|
-
function
|
|
2595
|
+
function Xa(e, t, r) {
|
|
2620
2596
|
try {
|
|
2621
2597
|
if (typeof r.body == "string")
|
|
2622
2598
|
return e.icons[t] = { ...r }, !0;
|
|
@@ -2632,12 +2608,12 @@ const oo = /^[a-z0-9]+(-[a-z0-9]+)*$/, ar = (e, t, r, n = "") => {
|
|
|
2632
2608
|
}
|
|
2633
2609
|
if (o.length > 3 || !o.length) return null;
|
|
2634
2610
|
if (o.length > 1) {
|
|
2635
|
-
const c = o.pop(), l = o.pop(),
|
|
2611
|
+
const c = o.pop(), l = o.pop(), p = {
|
|
2636
2612
|
provider: o.length > 0 ? o[0] : n,
|
|
2637
2613
|
prefix: l,
|
|
2638
2614
|
name: c
|
|
2639
2615
|
};
|
|
2640
|
-
return t && !Qt(
|
|
2616
|
+
return t && !Qt(p) ? null : p;
|
|
2641
2617
|
}
|
|
2642
2618
|
const s = o[0], i = s.split("-");
|
|
2643
2619
|
if (i.length > 1) {
|
|
@@ -2662,25 +2638,25 @@ let Dt = !1;
|
|
|
2662
2638
|
function ao(e) {
|
|
2663
2639
|
return typeof e == "boolean" && (Dt = e), Dt;
|
|
2664
2640
|
}
|
|
2665
|
-
function
|
|
2641
|
+
function vn(e) {
|
|
2666
2642
|
const t = typeof e == "string" ? ar(e, !0, Dt) : e;
|
|
2667
2643
|
if (t) {
|
|
2668
2644
|
const r = vt(t.provider, t.prefix), n = t.name;
|
|
2669
2645
|
return r.icons[n] || (r.missing.has(n) ? null : void 0);
|
|
2670
2646
|
}
|
|
2671
2647
|
}
|
|
2672
|
-
function
|
|
2648
|
+
function Za(e, t) {
|
|
2673
2649
|
const r = ar(e, !0, Dt);
|
|
2674
2650
|
if (!r) return !1;
|
|
2675
2651
|
const n = vt(r.provider, r.prefix);
|
|
2676
|
-
return t ?
|
|
2652
|
+
return t ? Xa(n, r.name, t) : (n.missing.add(r.name), !0);
|
|
2677
2653
|
}
|
|
2678
|
-
function
|
|
2654
|
+
function es(e, t) {
|
|
2679
2655
|
if (typeof e != "object") return !1;
|
|
2680
2656
|
if (typeof t != "string" && (t = e.provider || ""), Dt && !t && !e.prefix) {
|
|
2681
2657
|
let o = !1;
|
|
2682
2658
|
return ro(e) && (e.prefix = "", to(e, (s, i) => {
|
|
2683
|
-
|
|
2659
|
+
Za(s, i) && (o = !0);
|
|
2684
2660
|
})), o;
|
|
2685
2661
|
}
|
|
2686
2662
|
const r = e.prefix;
|
|
@@ -2697,15 +2673,15 @@ const so = Object.freeze({
|
|
|
2697
2673
|
}), io = Object.freeze({
|
|
2698
2674
|
...so,
|
|
2699
2675
|
...or
|
|
2700
|
-
}),
|
|
2701
|
-
function
|
|
2676
|
+
}), ts = /(-?[0-9.]*[0-9]+[0-9.]*)/g, rs = /^-?[0-9.]*[0-9]+[0-9.]*$/g;
|
|
2677
|
+
function kn(e, t, r) {
|
|
2702
2678
|
if (t === 1) return e;
|
|
2703
2679
|
if (r = r || 100, typeof e == "number") return Math.ceil(e * t * r) / r;
|
|
2704
2680
|
if (typeof e != "string") return e;
|
|
2705
|
-
const n = e.split(
|
|
2681
|
+
const n = e.split(ts);
|
|
2706
2682
|
if (n === null || !n.length) return e;
|
|
2707
2683
|
const o = [];
|
|
2708
|
-
let s = n.shift(), i =
|
|
2684
|
+
let s = n.shift(), i = rs.test(s);
|
|
2709
2685
|
for (; ; ) {
|
|
2710
2686
|
if (i) {
|
|
2711
2687
|
const c = parseFloat(s);
|
|
@@ -2715,7 +2691,7 @@ function vn(e, t, r) {
|
|
|
2715
2691
|
i = !i;
|
|
2716
2692
|
}
|
|
2717
2693
|
}
|
|
2718
|
-
function
|
|
2694
|
+
function ns(e, t = "defs") {
|
|
2719
2695
|
let r = "";
|
|
2720
2696
|
const n = e.indexOf("<" + t);
|
|
2721
2697
|
for (; n >= 0; ) {
|
|
@@ -2730,17 +2706,17 @@ function os(e, t = "defs") {
|
|
|
2730
2706
|
content: e
|
|
2731
2707
|
};
|
|
2732
2708
|
}
|
|
2733
|
-
function
|
|
2709
|
+
function os(e, t) {
|
|
2734
2710
|
return e ? "<defs>" + e + "</defs>" + t : t;
|
|
2735
2711
|
}
|
|
2736
|
-
function
|
|
2737
|
-
const n =
|
|
2738
|
-
return
|
|
2712
|
+
function as(e, t, r) {
|
|
2713
|
+
const n = ns(e);
|
|
2714
|
+
return os(n.defs, t + n.content + r);
|
|
2739
2715
|
}
|
|
2740
|
-
const
|
|
2741
|
-
function
|
|
2716
|
+
const ss = (e) => e === "unset" || e === "undefined" || e === "none";
|
|
2717
|
+
function is(e, t) {
|
|
2742
2718
|
const r = {
|
|
2743
|
-
|
|
2719
|
+
...$r,
|
|
2744
2720
|
...e
|
|
2745
2721
|
}, n = {
|
|
2746
2722
|
...io,
|
|
@@ -2752,64 +2728,64 @@ function ls(e, t) {
|
|
|
2752
2728
|
height: r.height
|
|
2753
2729
|
};
|
|
2754
2730
|
let s = r.body;
|
|
2755
|
-
[r, n].forEach((
|
|
2756
|
-
const
|
|
2757
|
-
let
|
|
2758
|
-
P ? J ?
|
|
2731
|
+
[r, n].forEach((A) => {
|
|
2732
|
+
const k = [], P = A.hFlip, J = A.vFlip;
|
|
2733
|
+
let q = A.rotate;
|
|
2734
|
+
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);
|
|
2759
2735
|
let Y;
|
|
2760
|
-
switch (
|
|
2736
|
+
switch (q < 0 && (q -= Math.floor(q / 4) * 4), q = q % 4, q) {
|
|
2761
2737
|
case 1:
|
|
2762
|
-
Y = o.height / 2 + o.top,
|
|
2738
|
+
Y = o.height / 2 + o.top, k.unshift("rotate(90 " + Y.toString() + " " + Y.toString() + ")");
|
|
2763
2739
|
break;
|
|
2764
2740
|
case 2:
|
|
2765
|
-
|
|
2741
|
+
k.unshift("rotate(180 " + (o.width / 2 + o.left).toString() + " " + (o.height / 2 + o.top).toString() + ")");
|
|
2766
2742
|
break;
|
|
2767
2743
|
case 3:
|
|
2768
|
-
Y = o.width / 2 + o.left,
|
|
2744
|
+
Y = o.width / 2 + o.left, k.unshift("rotate(-90 " + Y.toString() + " " + Y.toString() + ")");
|
|
2769
2745
|
break;
|
|
2770
2746
|
}
|
|
2771
|
-
|
|
2747
|
+
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>"));
|
|
2772
2748
|
});
|
|
2773
|
-
const i = n.width, c = n.height, l = o.width,
|
|
2749
|
+
const i = n.width, c = n.height, l = o.width, p = o.height;
|
|
2774
2750
|
let g, y;
|
|
2775
|
-
i === null ? (y = c === null ? "1em" : c === "auto" ?
|
|
2776
|
-
const
|
|
2777
|
-
|
|
2751
|
+
i === null ? (y = c === null ? "1em" : c === "auto" ? p : c, g = kn(y, l / p)) : (g = i === "auto" ? l : i, y = c === null ? kn(g, p / l) : c === "auto" ? p : c);
|
|
2752
|
+
const x = {}, I = (A, k) => {
|
|
2753
|
+
ss(k) || (x[A] = k.toString());
|
|
2778
2754
|
};
|
|
2779
|
-
|
|
2780
|
-
const
|
|
2755
|
+
I("width", g), I("height", y);
|
|
2756
|
+
const S = [
|
|
2781
2757
|
o.left,
|
|
2782
2758
|
o.top,
|
|
2783
2759
|
l,
|
|
2784
|
-
|
|
2760
|
+
p
|
|
2785
2761
|
];
|
|
2786
|
-
return
|
|
2787
|
-
attributes:
|
|
2788
|
-
viewBox:
|
|
2762
|
+
return x.viewBox = S.join(" "), {
|
|
2763
|
+
attributes: x,
|
|
2764
|
+
viewBox: S,
|
|
2789
2765
|
body: s
|
|
2790
2766
|
};
|
|
2791
2767
|
}
|
|
2792
|
-
const
|
|
2793
|
-
let
|
|
2794
|
-
function
|
|
2768
|
+
const ls = /\sid="(\S+)"/g, cs = "IconifyId" + Date.now().toString(16) + (Math.random() * 16777216 | 0).toString(16);
|
|
2769
|
+
let ds = 0;
|
|
2770
|
+
function us(e, t = cs) {
|
|
2795
2771
|
const r = [];
|
|
2796
2772
|
let n;
|
|
2797
|
-
for (; n =
|
|
2773
|
+
for (; n = ls.exec(e); ) r.push(n[1]);
|
|
2798
2774
|
if (!r.length) return e;
|
|
2799
2775
|
const o = "suffix" + (Math.random() * 16777216 | Date.now()).toString(16);
|
|
2800
2776
|
return r.forEach((s) => {
|
|
2801
|
-
const i = typeof t == "function" ? t(s) : t + (
|
|
2777
|
+
const i = typeof t == "function" ? t(s) : t + (ds++).toString(), c = s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2802
2778
|
e = e.replace(new RegExp('([#;"])(' + c + ')([")]|\\.[a-z])', "g"), "$1" + i + o + "$3");
|
|
2803
2779
|
}), e = e.replace(new RegExp(o, "g"), ""), e;
|
|
2804
2780
|
}
|
|
2805
2781
|
const Nr = /* @__PURE__ */ Object.create(null);
|
|
2806
|
-
function
|
|
2782
|
+
function fs(e, t) {
|
|
2807
2783
|
Nr[e] = t;
|
|
2808
2784
|
}
|
|
2809
2785
|
function Cr(e) {
|
|
2810
2786
|
return Nr[e] || Nr[""];
|
|
2811
2787
|
}
|
|
2812
|
-
function
|
|
2788
|
+
function Lr(e) {
|
|
2813
2789
|
let t;
|
|
2814
2790
|
if (typeof e.resources == "string") t = [e.resources];
|
|
2815
2791
|
else if (t = e.resources, !(t instanceof Array) || !t.length) return null;
|
|
@@ -2824,15 +2800,15 @@ function $r(e) {
|
|
|
2824
2800
|
dataAfterTimeout: e.dataAfterTimeout !== !1
|
|
2825
2801
|
};
|
|
2826
2802
|
}
|
|
2827
|
-
const
|
|
2828
|
-
for (;
|
|
2829
|
-
|
|
2830
|
-
function
|
|
2831
|
-
const r =
|
|
2832
|
-
return r === null ? !1 : (
|
|
2803
|
+
const zr = /* @__PURE__ */ Object.create(null), Ot = ["https://api.simplesvg.com", "https://api.unisvg.com"], Gt = [];
|
|
2804
|
+
for (; Ot.length > 0; ) Ot.length === 1 || Math.random() > 0.5 ? Gt.push(Ot.shift()) : Gt.push(Ot.pop());
|
|
2805
|
+
zr[""] = Lr({ resources: ["https://api.iconify.design"].concat(Gt) });
|
|
2806
|
+
function ms(e, t) {
|
|
2807
|
+
const r = Lr(t);
|
|
2808
|
+
return r === null ? !1 : (zr[e] = r, !0);
|
|
2833
2809
|
}
|
|
2834
|
-
function
|
|
2835
|
-
return
|
|
2810
|
+
function Dr(e) {
|
|
2811
|
+
return zr[e];
|
|
2836
2812
|
}
|
|
2837
2813
|
const hs = () => {
|
|
2838
2814
|
let e;
|
|
@@ -2841,9 +2817,9 @@ const hs = () => {
|
|
|
2841
2817
|
} catch {
|
|
2842
2818
|
}
|
|
2843
2819
|
};
|
|
2844
|
-
let
|
|
2845
|
-
function
|
|
2846
|
-
const r =
|
|
2820
|
+
let Sn = hs();
|
|
2821
|
+
function ps(e, t) {
|
|
2822
|
+
const r = Dr(e);
|
|
2847
2823
|
if (!r) return 0;
|
|
2848
2824
|
let n;
|
|
2849
2825
|
if (!r.maxURL) n = 0;
|
|
@@ -2857,19 +2833,19 @@ function gs(e, t) {
|
|
|
2857
2833
|
}
|
|
2858
2834
|
return n;
|
|
2859
2835
|
}
|
|
2860
|
-
function
|
|
2836
|
+
function gs(e) {
|
|
2861
2837
|
return e === 404;
|
|
2862
2838
|
}
|
|
2863
|
-
const
|
|
2864
|
-
const n = [], o =
|
|
2839
|
+
const ws = (e, t, r) => {
|
|
2840
|
+
const n = [], o = ps(e, t), s = "icons";
|
|
2865
2841
|
let i = {
|
|
2866
2842
|
type: s,
|
|
2867
2843
|
provider: e,
|
|
2868
2844
|
prefix: t,
|
|
2869
2845
|
icons: []
|
|
2870
2846
|
}, c = 0;
|
|
2871
|
-
return r.forEach((l,
|
|
2872
|
-
c += l.length + 1, c >= o &&
|
|
2847
|
+
return r.forEach((l, p) => {
|
|
2848
|
+
c += l.length + 1, c >= o && p > 0 && (n.push(i), i = {
|
|
2873
2849
|
type: s,
|
|
2874
2850
|
provider: e,
|
|
2875
2851
|
prefix: t,
|
|
@@ -2877,19 +2853,19 @@ const ys = (e, t, r) => {
|
|
|
2877
2853
|
}, c = l.length), i.icons.push(l);
|
|
2878
2854
|
}), n.push(i), n;
|
|
2879
2855
|
};
|
|
2880
|
-
function
|
|
2856
|
+
function ys(e) {
|
|
2881
2857
|
if (typeof e == "string") {
|
|
2882
|
-
const t =
|
|
2858
|
+
const t = Dr(e);
|
|
2883
2859
|
if (t) return t.path;
|
|
2884
2860
|
}
|
|
2885
2861
|
return "/";
|
|
2886
2862
|
}
|
|
2887
2863
|
const xs = (e, t, r) => {
|
|
2888
|
-
if (!
|
|
2864
|
+
if (!Sn) {
|
|
2889
2865
|
r("abort", 424);
|
|
2890
2866
|
return;
|
|
2891
2867
|
}
|
|
2892
|
-
let n =
|
|
2868
|
+
let n = ys(t.provider);
|
|
2893
2869
|
switch (t.type) {
|
|
2894
2870
|
case "icons": {
|
|
2895
2871
|
const s = t.prefix, c = t.icons.join(","), l = new URLSearchParams({ icons: c });
|
|
@@ -2906,11 +2882,11 @@ const xs = (e, t, r) => {
|
|
|
2906
2882
|
return;
|
|
2907
2883
|
}
|
|
2908
2884
|
let o = 503;
|
|
2909
|
-
|
|
2885
|
+
Sn(e + n).then((s) => {
|
|
2910
2886
|
const i = s.status;
|
|
2911
2887
|
if (i !== 200) {
|
|
2912
2888
|
setTimeout(() => {
|
|
2913
|
-
r(
|
|
2889
|
+
r(gs(i) ? "abort" : "next", i);
|
|
2914
2890
|
});
|
|
2915
2891
|
return;
|
|
2916
2892
|
}
|
|
@@ -2928,8 +2904,8 @@ const xs = (e, t, r) => {
|
|
|
2928
2904
|
}).catch(() => {
|
|
2929
2905
|
r("next", o);
|
|
2930
2906
|
});
|
|
2931
|
-
},
|
|
2932
|
-
prepare:
|
|
2907
|
+
}, bs = {
|
|
2908
|
+
prepare: ws,
|
|
2933
2909
|
send: xs
|
|
2934
2910
|
};
|
|
2935
2911
|
function lo(e, t) {
|
|
@@ -2938,7 +2914,7 @@ function lo(e, t) {
|
|
|
2938
2914
|
n && (r.loaderCallbacks = n.filter((o) => o.id !== t));
|
|
2939
2915
|
});
|
|
2940
2916
|
}
|
|
2941
|
-
function
|
|
2917
|
+
function vs(e) {
|
|
2942
2918
|
e.pendingCallbacksFlag || (e.pendingCallbacksFlag = !0, setTimeout(() => {
|
|
2943
2919
|
e.pendingCallbacksFlag = !1;
|
|
2944
2920
|
const t = e.loaderCallbacks ? e.loaderCallbacks.slice(0) : [];
|
|
@@ -2949,16 +2925,16 @@ function ks(e) {
|
|
|
2949
2925
|
const i = s.icons, c = i.pending.length;
|
|
2950
2926
|
i.pending = i.pending.filter((l) => {
|
|
2951
2927
|
if (l.prefix !== o) return !0;
|
|
2952
|
-
const
|
|
2953
|
-
if (e.icons[
|
|
2928
|
+
const p = l.name;
|
|
2929
|
+
if (e.icons[p]) i.loaded.push({
|
|
2954
2930
|
provider: n,
|
|
2955
2931
|
prefix: o,
|
|
2956
|
-
name:
|
|
2932
|
+
name: p
|
|
2957
2933
|
});
|
|
2958
|
-
else if (e.missing.has(
|
|
2934
|
+
else if (e.missing.has(p)) i.missing.push({
|
|
2959
2935
|
provider: n,
|
|
2960
2936
|
prefix: o,
|
|
2961
|
-
name:
|
|
2937
|
+
name: p
|
|
2962
2938
|
});
|
|
2963
2939
|
else
|
|
2964
2940
|
return r = !0, !0;
|
|
@@ -2967,9 +2943,9 @@ function ks(e) {
|
|
|
2967
2943
|
});
|
|
2968
2944
|
}));
|
|
2969
2945
|
}
|
|
2970
|
-
let
|
|
2971
|
-
function
|
|
2972
|
-
const n =
|
|
2946
|
+
let ks = 0;
|
|
2947
|
+
function Ss(e, t, r) {
|
|
2948
|
+
const n = ks++, o = lo.bind(null, r, n);
|
|
2973
2949
|
if (!t.pending.length) return o;
|
|
2974
2950
|
const s = {
|
|
2975
2951
|
id: n,
|
|
@@ -2981,7 +2957,7 @@ function Ns(e, t, r) {
|
|
|
2981
2957
|
(i.loaderCallbacks || (i.loaderCallbacks = [])).push(s);
|
|
2982
2958
|
}), o;
|
|
2983
2959
|
}
|
|
2984
|
-
function
|
|
2960
|
+
function Ns(e) {
|
|
2985
2961
|
const t = {
|
|
2986
2962
|
loaded: [],
|
|
2987
2963
|
missing: [],
|
|
@@ -2996,9 +2972,9 @@ function Cs(e) {
|
|
|
2996
2972
|
return e.forEach((o) => {
|
|
2997
2973
|
if (n.name === o.name && n.prefix === o.prefix && n.provider === o.provider) return;
|
|
2998
2974
|
n = o;
|
|
2999
|
-
const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)),
|
|
2975
|
+
const s = o.provider, i = o.prefix, c = o.name, l = r[s] || (r[s] = /* @__PURE__ */ Object.create(null)), p = l[i] || (l[i] = vt(s, i));
|
|
3000
2976
|
let g;
|
|
3001
|
-
c in
|
|
2977
|
+
c in p.icons ? g = t.loaded : i === "" || p.missing.has(c) ? g = t.missing : g = t.pending;
|
|
3002
2978
|
const y = {
|
|
3003
2979
|
provider: s,
|
|
3004
2980
|
prefix: i,
|
|
@@ -3007,7 +2983,7 @@ function Cs(e) {
|
|
|
3007
2983
|
g.push(y);
|
|
3008
2984
|
}), t;
|
|
3009
2985
|
}
|
|
3010
|
-
function
|
|
2986
|
+
function Cs(e, t = !0, r = !1) {
|
|
3011
2987
|
const n = [];
|
|
3012
2988
|
return e.forEach((o) => {
|
|
3013
2989
|
const s = typeof o == "string" ? ar(o, t, r) : o;
|
|
@@ -3022,7 +2998,7 @@ const _s = {
|
|
|
3022
2998
|
random: !1,
|
|
3023
2999
|
dataAfterTimeout: !1
|
|
3024
3000
|
};
|
|
3025
|
-
function
|
|
3001
|
+
function Is(e, t, r, n) {
|
|
3026
3002
|
const o = e.resources.length, s = e.random ? Math.floor(Math.random() * o) : e.index;
|
|
3027
3003
|
let i;
|
|
3028
3004
|
if (e.random) {
|
|
@@ -3034,43 +3010,43 @@ function Ps(e, t, r, n) {
|
|
|
3034
3010
|
i = i.concat(C);
|
|
3035
3011
|
} else i = e.resources.slice(s).concat(e.resources.slice(0, s));
|
|
3036
3012
|
const c = Date.now();
|
|
3037
|
-
let l = "pending",
|
|
3038
|
-
typeof n == "function" &&
|
|
3039
|
-
function
|
|
3013
|
+
let l = "pending", p = 0, g, y = null, x = [], I = [];
|
|
3014
|
+
typeof n == "function" && I.push(n);
|
|
3015
|
+
function S() {
|
|
3040
3016
|
y && (clearTimeout(y), y = null);
|
|
3041
3017
|
}
|
|
3042
|
-
function
|
|
3043
|
-
l === "pending" && (l = "aborted"),
|
|
3018
|
+
function A() {
|
|
3019
|
+
l === "pending" && (l = "aborted"), S(), x.forEach((C) => {
|
|
3044
3020
|
C.status === "pending" && (C.status = "aborted");
|
|
3045
|
-
}),
|
|
3021
|
+
}), x = [];
|
|
3046
3022
|
}
|
|
3047
|
-
function
|
|
3048
|
-
K && (
|
|
3023
|
+
function k(C, K) {
|
|
3024
|
+
K && (I = []), typeof C == "function" && I.push(C);
|
|
3049
3025
|
}
|
|
3050
3026
|
function P() {
|
|
3051
3027
|
return {
|
|
3052
3028
|
startTime: c,
|
|
3053
3029
|
payload: t,
|
|
3054
3030
|
status: l,
|
|
3055
|
-
queriesSent:
|
|
3056
|
-
queriesPending:
|
|
3057
|
-
subscribe:
|
|
3058
|
-
abort:
|
|
3031
|
+
queriesSent: p,
|
|
3032
|
+
queriesPending: x.length,
|
|
3033
|
+
subscribe: k,
|
|
3034
|
+
abort: A
|
|
3059
3035
|
};
|
|
3060
3036
|
}
|
|
3061
3037
|
function J() {
|
|
3062
|
-
l = "failed",
|
|
3038
|
+
l = "failed", I.forEach((C) => {
|
|
3063
3039
|
C(void 0, g);
|
|
3064
3040
|
});
|
|
3065
3041
|
}
|
|
3066
|
-
function
|
|
3067
|
-
|
|
3042
|
+
function q() {
|
|
3043
|
+
x.forEach((C) => {
|
|
3068
3044
|
C.status === "pending" && (C.status = "aborted");
|
|
3069
|
-
}),
|
|
3045
|
+
}), x = [];
|
|
3070
3046
|
}
|
|
3071
|
-
function Y(C, K,
|
|
3047
|
+
function Y(C, K, re) {
|
|
3072
3048
|
const ye = K !== "success";
|
|
3073
|
-
switch (
|
|
3049
|
+
switch (x = x.filter((be) => be !== C), l) {
|
|
3074
3050
|
case "pending":
|
|
3075
3051
|
break;
|
|
3076
3052
|
case "failed":
|
|
@@ -3080,29 +3056,29 @@ function Ps(e, t, r, n) {
|
|
|
3080
3056
|
return;
|
|
3081
3057
|
}
|
|
3082
3058
|
if (K === "abort") {
|
|
3083
|
-
g =
|
|
3059
|
+
g = re, J();
|
|
3084
3060
|
return;
|
|
3085
3061
|
}
|
|
3086
3062
|
if (ye) {
|
|
3087
|
-
g =
|
|
3063
|
+
g = re, x.length || (i.length ? _e() : J());
|
|
3088
3064
|
return;
|
|
3089
3065
|
}
|
|
3090
|
-
if (
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3066
|
+
if (S(), q(), !e.random) {
|
|
3067
|
+
const be = e.resources.indexOf(C.resource);
|
|
3068
|
+
be !== -1 && be !== e.index && (e.index = be);
|
|
3093
3069
|
}
|
|
3094
|
-
l = "completed",
|
|
3095
|
-
|
|
3070
|
+
l = "completed", I.forEach((be) => {
|
|
3071
|
+
be(re);
|
|
3096
3072
|
});
|
|
3097
3073
|
}
|
|
3098
|
-
function
|
|
3074
|
+
function _e() {
|
|
3099
3075
|
if (l !== "pending") return;
|
|
3100
|
-
|
|
3076
|
+
S();
|
|
3101
3077
|
const C = i.shift();
|
|
3102
3078
|
if (C === void 0) {
|
|
3103
|
-
if (
|
|
3079
|
+
if (x.length) {
|
|
3104
3080
|
y = setTimeout(() => {
|
|
3105
|
-
|
|
3081
|
+
S(), l === "pending" && (q(), J());
|
|
3106
3082
|
}, e.timeout);
|
|
3107
3083
|
return;
|
|
3108
3084
|
}
|
|
@@ -3112,13 +3088,13 @@ function Ps(e, t, r, n) {
|
|
|
3112
3088
|
const K = {
|
|
3113
3089
|
status: "pending",
|
|
3114
3090
|
resource: C,
|
|
3115
|
-
callback: (
|
|
3116
|
-
Y(K,
|
|
3091
|
+
callback: (re, ye) => {
|
|
3092
|
+
Y(K, re, ye);
|
|
3117
3093
|
}
|
|
3118
3094
|
};
|
|
3119
|
-
|
|
3095
|
+
x.push(K), p++, y = setTimeout(_e, e.rotate), r(C, t, K.callback);
|
|
3120
3096
|
}
|
|
3121
|
-
return setTimeout(
|
|
3097
|
+
return setTimeout(_e), P;
|
|
3122
3098
|
}
|
|
3123
3099
|
function co(e) {
|
|
3124
3100
|
const t = {
|
|
@@ -3129,9 +3105,9 @@ function co(e) {
|
|
|
3129
3105
|
function n() {
|
|
3130
3106
|
r = r.filter((c) => c().status === "pending");
|
|
3131
3107
|
}
|
|
3132
|
-
function o(c, l,
|
|
3133
|
-
const g =
|
|
3134
|
-
n(),
|
|
3108
|
+
function o(c, l, p) {
|
|
3109
|
+
const g = Is(t, c, l, (y, x) => {
|
|
3110
|
+
n(), p && p(y, x);
|
|
3135
3111
|
});
|
|
3136
3112
|
return r.push(g), g;
|
|
3137
3113
|
}
|
|
@@ -3148,48 +3124,48 @@ function co(e) {
|
|
|
3148
3124
|
cleanup: n
|
|
3149
3125
|
};
|
|
3150
3126
|
}
|
|
3151
|
-
function
|
|
3127
|
+
function Nn() {
|
|
3152
3128
|
}
|
|
3153
|
-
const
|
|
3154
|
-
function
|
|
3155
|
-
if (!
|
|
3156
|
-
const t =
|
|
3129
|
+
const hr = /* @__PURE__ */ Object.create(null);
|
|
3130
|
+
function Ps(e) {
|
|
3131
|
+
if (!hr[e]) {
|
|
3132
|
+
const t = Dr(e);
|
|
3157
3133
|
if (!t) return;
|
|
3158
3134
|
const r = co(t), n = {
|
|
3159
3135
|
config: t,
|
|
3160
3136
|
redundancy: r
|
|
3161
3137
|
};
|
|
3162
|
-
|
|
3138
|
+
hr[e] = n;
|
|
3163
3139
|
}
|
|
3164
|
-
return
|
|
3140
|
+
return hr[e];
|
|
3165
3141
|
}
|
|
3166
|
-
function
|
|
3142
|
+
function Fs(e, t, r) {
|
|
3167
3143
|
let n, o;
|
|
3168
3144
|
if (typeof e == "string") {
|
|
3169
3145
|
const s = Cr(e);
|
|
3170
3146
|
if (!s)
|
|
3171
|
-
return r(void 0, 424),
|
|
3147
|
+
return r(void 0, 424), Nn;
|
|
3172
3148
|
o = s.send;
|
|
3173
|
-
const i =
|
|
3149
|
+
const i = Ps(e);
|
|
3174
3150
|
i && (n = i.redundancy);
|
|
3175
3151
|
} else {
|
|
3176
|
-
const s =
|
|
3152
|
+
const s = Lr(e);
|
|
3177
3153
|
if (s) {
|
|
3178
3154
|
n = co(s);
|
|
3179
3155
|
const i = e.resources ? e.resources[0] : "", c = Cr(i);
|
|
3180
3156
|
c && (o = c.send);
|
|
3181
3157
|
}
|
|
3182
3158
|
}
|
|
3183
|
-
return !n || !o ? (r(void 0, 424),
|
|
3159
|
+
return !n || !o ? (r(void 0, 424), Nn) : n.query(t, o, r)().abort;
|
|
3184
3160
|
}
|
|
3185
|
-
function
|
|
3161
|
+
function Cn() {
|
|
3186
3162
|
}
|
|
3187
|
-
function
|
|
3163
|
+
function Es(e) {
|
|
3188
3164
|
e.iconsLoaderFlag || (e.iconsLoaderFlag = !0, setTimeout(() => {
|
|
3189
|
-
e.iconsLoaderFlag = !1,
|
|
3165
|
+
e.iconsLoaderFlag = !1, vs(e);
|
|
3190
3166
|
}));
|
|
3191
3167
|
}
|
|
3192
|
-
function
|
|
3168
|
+
function Ts(e) {
|
|
3193
3169
|
const t = [], r = [];
|
|
3194
3170
|
return e.forEach((n) => {
|
|
3195
3171
|
(n.match(oo) ? t : r).push(n);
|
|
@@ -3198,7 +3174,7 @@ function As(e) {
|
|
|
3198
3174
|
invalid: r
|
|
3199
3175
|
};
|
|
3200
3176
|
}
|
|
3201
|
-
function
|
|
3177
|
+
function jt(e, t, r) {
|
|
3202
3178
|
function n() {
|
|
3203
3179
|
const o = e.pendingIcons;
|
|
3204
3180
|
t.forEach((s) => {
|
|
@@ -3213,60 +3189,60 @@ function Ot(e, t, r) {
|
|
|
3213
3189
|
} catch (o) {
|
|
3214
3190
|
console.error(o);
|
|
3215
3191
|
}
|
|
3216
|
-
n(),
|
|
3192
|
+
n(), Es(e);
|
|
3217
3193
|
}
|
|
3218
|
-
function
|
|
3194
|
+
function _n(e, t) {
|
|
3219
3195
|
e instanceof Promise ? e.then((r) => {
|
|
3220
3196
|
t(r);
|
|
3221
3197
|
}).catch(() => {
|
|
3222
3198
|
t(null);
|
|
3223
3199
|
}) : t(e);
|
|
3224
3200
|
}
|
|
3225
|
-
function
|
|
3201
|
+
function As(e, t) {
|
|
3226
3202
|
e.iconsToLoad ? e.iconsToLoad = e.iconsToLoad.concat(t).sort() : e.iconsToLoad = t, e.iconsQueueFlag || (e.iconsQueueFlag = !0, setTimeout(() => {
|
|
3227
3203
|
e.iconsQueueFlag = !1;
|
|
3228
3204
|
const { provider: r, prefix: n } = e, o = e.iconsToLoad;
|
|
3229
3205
|
if (delete e.iconsToLoad, !o || !o.length) return;
|
|
3230
3206
|
const s = e.loadIcon;
|
|
3231
3207
|
if (e.loadIcons && (o.length > 1 || !s)) {
|
|
3232
|
-
|
|
3233
|
-
|
|
3208
|
+
_n(e.loadIcons(o, n, r), (g) => {
|
|
3209
|
+
jt(e, o, g);
|
|
3234
3210
|
});
|
|
3235
3211
|
return;
|
|
3236
3212
|
}
|
|
3237
3213
|
if (s) {
|
|
3238
3214
|
o.forEach((g) => {
|
|
3239
3215
|
const y = s(g, n, r);
|
|
3240
|
-
|
|
3241
|
-
const
|
|
3216
|
+
_n(y, (x) => {
|
|
3217
|
+
const I = x ? {
|
|
3242
3218
|
prefix: n,
|
|
3243
|
-
icons: { [g]:
|
|
3219
|
+
icons: { [g]: x }
|
|
3244
3220
|
} : null;
|
|
3245
|
-
|
|
3221
|
+
jt(e, [g], I);
|
|
3246
3222
|
});
|
|
3247
3223
|
});
|
|
3248
3224
|
return;
|
|
3249
3225
|
}
|
|
3250
|
-
const { valid: i, invalid: c } =
|
|
3251
|
-
if (c.length &&
|
|
3226
|
+
const { valid: i, invalid: c } = Ts(o);
|
|
3227
|
+
if (c.length && jt(e, c, null), !i.length) return;
|
|
3252
3228
|
const l = n.match(oo) ? Cr(r) : null;
|
|
3253
3229
|
if (!l) {
|
|
3254
|
-
|
|
3230
|
+
jt(e, i, null);
|
|
3255
3231
|
return;
|
|
3256
3232
|
}
|
|
3257
3233
|
l.prepare(r, n, i).forEach((g) => {
|
|
3258
|
-
|
|
3259
|
-
|
|
3234
|
+
Fs(r, g, (y) => {
|
|
3235
|
+
jt(e, g.icons, y);
|
|
3260
3236
|
});
|
|
3261
3237
|
});
|
|
3262
3238
|
}));
|
|
3263
3239
|
}
|
|
3264
3240
|
const Os = (e, t) => {
|
|
3265
|
-
const r =
|
|
3241
|
+
const r = Cs(e, !0, ao()), n = Ns(r);
|
|
3266
3242
|
if (!n.pending.length) {
|
|
3267
3243
|
let l = !0;
|
|
3268
3244
|
return t && setTimeout(() => {
|
|
3269
|
-
l && t(n.loaded, n.missing, n.pending,
|
|
3245
|
+
l && t(n.loaded, n.missing, n.pending, Cn);
|
|
3270
3246
|
}), () => {
|
|
3271
3247
|
l = !1;
|
|
3272
3248
|
};
|
|
@@ -3274,20 +3250,20 @@ const Os = (e, t) => {
|
|
|
3274
3250
|
const o = /* @__PURE__ */ Object.create(null), s = [];
|
|
3275
3251
|
let i, c;
|
|
3276
3252
|
return n.pending.forEach((l) => {
|
|
3277
|
-
const { provider:
|
|
3278
|
-
if (g === c &&
|
|
3279
|
-
i =
|
|
3280
|
-
const y = o[
|
|
3253
|
+
const { provider: p, prefix: g } = l;
|
|
3254
|
+
if (g === c && p === i) return;
|
|
3255
|
+
i = p, c = g, s.push(vt(p, g));
|
|
3256
|
+
const y = o[p] || (o[p] = /* @__PURE__ */ Object.create(null));
|
|
3281
3257
|
y[g] || (y[g] = []);
|
|
3282
3258
|
}), n.pending.forEach((l) => {
|
|
3283
|
-
const { provider:
|
|
3284
|
-
|
|
3259
|
+
const { provider: p, prefix: g, name: y } = l, x = vt(p, g), I = x.pendingIcons || (x.pendingIcons = /* @__PURE__ */ new Set());
|
|
3260
|
+
I.has(y) || (I.add(y), o[p][g].push(y));
|
|
3285
3261
|
}), s.forEach((l) => {
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3288
|
-
}), t ?
|
|
3262
|
+
const p = o[l.provider][l.prefix];
|
|
3263
|
+
p.length && As(l, p);
|
|
3264
|
+
}), t ? Ss(t, n, s) : Cn;
|
|
3289
3265
|
};
|
|
3290
|
-
function
|
|
3266
|
+
function js(e, t) {
|
|
3291
3267
|
const r = { ...e };
|
|
3292
3268
|
for (const n in t) {
|
|
3293
3269
|
const o = t[n], s = typeof o;
|
|
@@ -3295,9 +3271,9 @@ function $s(e, t) {
|
|
|
3295
3271
|
}
|
|
3296
3272
|
return r;
|
|
3297
3273
|
}
|
|
3298
|
-
const
|
|
3299
|
-
function
|
|
3300
|
-
t.split(
|
|
3274
|
+
const $s = /[\s,]+/;
|
|
3275
|
+
function Ls(e, t) {
|
|
3276
|
+
t.split($s).forEach((r) => {
|
|
3301
3277
|
switch (r.trim()) {
|
|
3302
3278
|
case "horizontal":
|
|
3303
3279
|
e.hFlip = !0;
|
|
@@ -3308,7 +3284,7 @@ function zs(e, t) {
|
|
|
3308
3284
|
}
|
|
3309
3285
|
});
|
|
3310
3286
|
}
|
|
3311
|
-
function
|
|
3287
|
+
function zs(e, t = 0) {
|
|
3312
3288
|
const r = e.replace(/^-?[0-9.]*/, "");
|
|
3313
3289
|
function n(o) {
|
|
3314
3290
|
for (; o < 0; ) o += 4;
|
|
@@ -3333,19 +3309,19 @@ function Ds(e, t = 0) {
|
|
|
3333
3309
|
}
|
|
3334
3310
|
return t;
|
|
3335
3311
|
}
|
|
3336
|
-
function
|
|
3312
|
+
function Ds(e, t) {
|
|
3337
3313
|
let r = e.indexOf("xlink:") === -1 ? "" : ' xmlns:xlink="http://www.w3.org/1999/xlink"';
|
|
3338
3314
|
for (const n in t) r += " " + n + '="' + t[n] + '"';
|
|
3339
3315
|
return '<svg xmlns="http://www.w3.org/2000/svg"' + r + ">" + e + "</svg>";
|
|
3340
3316
|
}
|
|
3341
|
-
function
|
|
3317
|
+
function Ms(e) {
|
|
3342
3318
|
return e.replace(/"/g, "'").replace(/%/g, "%25").replace(/#/g, "%23").replace(/</g, "%3C").replace(/>/g, "%3E").replace(/\s+/g, " ");
|
|
3343
3319
|
}
|
|
3344
|
-
function
|
|
3345
|
-
return "data:image/svg+xml," +
|
|
3320
|
+
function Bs(e) {
|
|
3321
|
+
return "data:image/svg+xml," + Ms(e);
|
|
3346
3322
|
}
|
|
3347
|
-
function
|
|
3348
|
-
return 'url("' +
|
|
3323
|
+
function Us(e) {
|
|
3324
|
+
return 'url("' + Bs(e) + '")';
|
|
3349
3325
|
}
|
|
3350
3326
|
let $t;
|
|
3351
3327
|
function qs() {
|
|
@@ -3355,20 +3331,20 @@ function qs() {
|
|
|
3355
3331
|
$t = null;
|
|
3356
3332
|
}
|
|
3357
3333
|
}
|
|
3358
|
-
function
|
|
3334
|
+
function Rs(e) {
|
|
3359
3335
|
return $t === void 0 && qs(), $t ? $t.createHTML(e) : e;
|
|
3360
3336
|
}
|
|
3361
3337
|
const uo = {
|
|
3362
3338
|
...io,
|
|
3363
3339
|
inline: !1
|
|
3364
|
-
},
|
|
3340
|
+
}, Hs = {
|
|
3365
3341
|
xmlns: "http://www.w3.org/2000/svg",
|
|
3366
3342
|
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
3367
3343
|
"aria-hidden": !0,
|
|
3368
3344
|
role: "img"
|
|
3369
|
-
},
|
|
3345
|
+
}, Vs = {
|
|
3370
3346
|
display: "inline-block"
|
|
3371
|
-
},
|
|
3347
|
+
}, _r = {
|
|
3372
3348
|
backgroundColor: "currentColor"
|
|
3373
3349
|
}, fo = {
|
|
3374
3350
|
backgroundColor: "transparent"
|
|
@@ -3376,43 +3352,43 @@ const uo = {
|
|
|
3376
3352
|
Image: "var(--svg)",
|
|
3377
3353
|
Repeat: "no-repeat",
|
|
3378
3354
|
Size: "100% 100%"
|
|
3379
|
-
},
|
|
3380
|
-
WebkitMask:
|
|
3381
|
-
mask:
|
|
3355
|
+
}, Pn = {
|
|
3356
|
+
WebkitMask: _r,
|
|
3357
|
+
mask: _r,
|
|
3382
3358
|
background: fo
|
|
3383
3359
|
};
|
|
3384
|
-
for (const e in
|
|
3385
|
-
const t =
|
|
3360
|
+
for (const e in Pn) {
|
|
3361
|
+
const t = Pn[e];
|
|
3386
3362
|
for (const r in In)
|
|
3387
3363
|
t[e + r] = In[r];
|
|
3388
3364
|
}
|
|
3389
|
-
const
|
|
3365
|
+
const Ys = {
|
|
3390
3366
|
...uo,
|
|
3391
3367
|
inline: !0
|
|
3392
3368
|
};
|
|
3393
|
-
function
|
|
3369
|
+
function Fn(e) {
|
|
3394
3370
|
return e + (e.match(/^[-0-9.]+$/) ? "px" : "");
|
|
3395
3371
|
}
|
|
3396
|
-
const
|
|
3397
|
-
const n = t.inline ?
|
|
3398
|
-
...s === "svg" ?
|
|
3372
|
+
const Js = (e, t, r) => {
|
|
3373
|
+
const n = t.inline ? Ys : uo, o = js(n, t), s = t.mode || "svg", i = {}, c = t.style || {}, l = {
|
|
3374
|
+
...s === "svg" ? Hs : {}
|
|
3399
3375
|
};
|
|
3400
3376
|
if (r) {
|
|
3401
|
-
const
|
|
3402
|
-
if (
|
|
3377
|
+
const k = ar(r, !1, !0);
|
|
3378
|
+
if (k) {
|
|
3403
3379
|
const P = ["iconify"], J = [
|
|
3404
3380
|
"provider",
|
|
3405
3381
|
"prefix"
|
|
3406
3382
|
];
|
|
3407
|
-
for (const
|
|
3408
|
-
|
|
3383
|
+
for (const q of J)
|
|
3384
|
+
k[q] && P.push("iconify--" + k[q]);
|
|
3409
3385
|
l.className = P.join(" ");
|
|
3410
3386
|
}
|
|
3411
3387
|
}
|
|
3412
|
-
for (let
|
|
3413
|
-
const P = t[
|
|
3388
|
+
for (let k in t) {
|
|
3389
|
+
const P = t[k];
|
|
3414
3390
|
if (P !== void 0)
|
|
3415
|
-
switch (
|
|
3391
|
+
switch (k) {
|
|
3416
3392
|
// Properties to ignore
|
|
3417
3393
|
case "icon":
|
|
3418
3394
|
case "style":
|
|
@@ -3428,17 +3404,17 @@ const Ks = (e, t, r) => {
|
|
|
3428
3404
|
break;
|
|
3429
3405
|
// Merge class names
|
|
3430
3406
|
case "className":
|
|
3431
|
-
l[
|
|
3407
|
+
l[k] = (l[k] ? l[k] + " " : "") + P;
|
|
3432
3408
|
break;
|
|
3433
3409
|
// Boolean attributes
|
|
3434
3410
|
case "inline":
|
|
3435
3411
|
case "hFlip":
|
|
3436
3412
|
case "vFlip":
|
|
3437
|
-
o[
|
|
3413
|
+
o[k] = P === !0 || P === "true" || P === 1;
|
|
3438
3414
|
break;
|
|
3439
3415
|
// Flip as string: 'horizontal,vertical'
|
|
3440
3416
|
case "flip":
|
|
3441
|
-
typeof P == "string" &&
|
|
3417
|
+
typeof P == "string" && Ls(o, P);
|
|
3442
3418
|
break;
|
|
3443
3419
|
// Color: copy to style
|
|
3444
3420
|
case "color":
|
|
@@ -3446,7 +3422,7 @@ const Ks = (e, t, r) => {
|
|
|
3446
3422
|
break;
|
|
3447
3423
|
// Rotation as string
|
|
3448
3424
|
case "rotate":
|
|
3449
|
-
typeof P == "string" ? o[
|
|
3425
|
+
typeof P == "string" ? o[k] = zs(P) : typeof P == "number" && (o[k] = P);
|
|
3450
3426
|
break;
|
|
3451
3427
|
// Remove aria-hidden
|
|
3452
3428
|
case "ariaHidden":
|
|
@@ -3455,37 +3431,37 @@ const Ks = (e, t, r) => {
|
|
|
3455
3431
|
break;
|
|
3456
3432
|
// Copy missing property if it does not exist in customisations
|
|
3457
3433
|
default:
|
|
3458
|
-
n[
|
|
3434
|
+
n[k] === void 0 && (l[k] = P);
|
|
3459
3435
|
}
|
|
3460
3436
|
}
|
|
3461
|
-
const
|
|
3437
|
+
const p = is(e, o), g = p.attributes;
|
|
3462
3438
|
if (o.inline && (i.verticalAlign = "-0.125em"), s === "svg") {
|
|
3463
3439
|
l.style = {
|
|
3464
3440
|
...i,
|
|
3465
3441
|
...c
|
|
3466
3442
|
}, Object.assign(l, g);
|
|
3467
|
-
let
|
|
3443
|
+
let k = 0, P = t.id;
|
|
3468
3444
|
return typeof P == "string" && (P = P.replace(/-/g, "_")), l.dangerouslySetInnerHTML = {
|
|
3469
|
-
__html:
|
|
3470
|
-
},
|
|
3445
|
+
__html: Rs(us(p.body, P ? () => P + "ID" + k++ : "iconifyReact"))
|
|
3446
|
+
}, pr("svg", l);
|
|
3471
3447
|
}
|
|
3472
|
-
const { body: y, width:
|
|
3448
|
+
const { body: y, width: x, height: I } = e, S = s === "mask" || (s === "bg" ? !1 : y.indexOf("currentColor") !== -1), A = Ds(y, {
|
|
3473
3449
|
...g,
|
|
3474
|
-
width:
|
|
3475
|
-
height:
|
|
3450
|
+
width: x + "",
|
|
3451
|
+
height: I + ""
|
|
3476
3452
|
});
|
|
3477
3453
|
return l.style = {
|
|
3478
3454
|
...i,
|
|
3479
|
-
"--svg":
|
|
3480
|
-
width:
|
|
3481
|
-
height:
|
|
3482
|
-
...
|
|
3483
|
-
...
|
|
3455
|
+
"--svg": Us(A),
|
|
3456
|
+
width: Fn(g.width),
|
|
3457
|
+
height: Fn(g.height),
|
|
3458
|
+
...Vs,
|
|
3459
|
+
...S ? _r : fo,
|
|
3484
3460
|
...c
|
|
3485
|
-
},
|
|
3461
|
+
}, pr("span", l);
|
|
3486
3462
|
};
|
|
3487
3463
|
ao(!0);
|
|
3488
|
-
|
|
3464
|
+
fs("", bs);
|
|
3489
3465
|
if (typeof document < "u" && typeof window < "u") {
|
|
3490
3466
|
const e = window;
|
|
3491
3467
|
if (e.IconifyPreload !== void 0) {
|
|
@@ -3495,7 +3471,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
3495
3471
|
// Check if item is an object and not null/array
|
|
3496
3472
|
(typeof n != "object" || n === null || n instanceof Array || // Check for 'icons' and 'prefix'
|
|
3497
3473
|
typeof n.icons != "object" || typeof n.prefix != "string" || // Add icon set
|
|
3498
|
-
!
|
|
3474
|
+
!es(n)) && console.error(r);
|
|
3499
3475
|
} catch {
|
|
3500
3476
|
console.error(r);
|
|
3501
3477
|
}
|
|
@@ -3510,7 +3486,7 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
3510
3486
|
const o = t[r];
|
|
3511
3487
|
if (typeof o != "object" || !o || o.resources === void 0)
|
|
3512
3488
|
continue;
|
|
3513
|
-
|
|
3489
|
+
ms(r, o) || console.error(n);
|
|
3514
3490
|
} catch {
|
|
3515
3491
|
console.error(n);
|
|
3516
3492
|
}
|
|
@@ -3518,89 +3494,89 @@ if (typeof document < "u" && typeof window < "u") {
|
|
|
3518
3494
|
}
|
|
3519
3495
|
}
|
|
3520
3496
|
function mo(e) {
|
|
3521
|
-
const [t, r] =
|
|
3522
|
-
function s(
|
|
3523
|
-
if (
|
|
3524
|
-
const
|
|
3525
|
-
if (typeof
|
|
3497
|
+
const [t, r] = b(!!e.ssr), [n, o] = b({});
|
|
3498
|
+
function s(I) {
|
|
3499
|
+
if (I) {
|
|
3500
|
+
const S = e.icon;
|
|
3501
|
+
if (typeof S == "object")
|
|
3526
3502
|
return {
|
|
3527
3503
|
name: "",
|
|
3528
|
-
data:
|
|
3504
|
+
data: S
|
|
3529
3505
|
};
|
|
3530
|
-
const
|
|
3531
|
-
if (
|
|
3506
|
+
const A = vn(S);
|
|
3507
|
+
if (A)
|
|
3532
3508
|
return {
|
|
3533
|
-
name:
|
|
3534
|
-
data:
|
|
3509
|
+
name: S,
|
|
3510
|
+
data: A
|
|
3535
3511
|
};
|
|
3536
3512
|
}
|
|
3537
3513
|
return {
|
|
3538
3514
|
name: ""
|
|
3539
3515
|
};
|
|
3540
3516
|
}
|
|
3541
|
-
const [i, c] =
|
|
3517
|
+
const [i, c] = b(s(!!e.ssr));
|
|
3542
3518
|
function l() {
|
|
3543
|
-
const
|
|
3544
|
-
|
|
3519
|
+
const I = n.callback;
|
|
3520
|
+
I && (I(), o({}));
|
|
3545
3521
|
}
|
|
3546
|
-
function
|
|
3547
|
-
if (JSON.stringify(i) !== JSON.stringify(
|
|
3548
|
-
return l(), c(
|
|
3522
|
+
function p(I) {
|
|
3523
|
+
if (JSON.stringify(i) !== JSON.stringify(I))
|
|
3524
|
+
return l(), c(I), !0;
|
|
3549
3525
|
}
|
|
3550
3526
|
function g() {
|
|
3551
|
-
var
|
|
3552
|
-
const
|
|
3553
|
-
if (typeof
|
|
3554
|
-
|
|
3527
|
+
var I;
|
|
3528
|
+
const S = e.icon;
|
|
3529
|
+
if (typeof S == "object") {
|
|
3530
|
+
p({
|
|
3555
3531
|
name: "",
|
|
3556
|
-
data:
|
|
3532
|
+
data: S
|
|
3557
3533
|
});
|
|
3558
3534
|
return;
|
|
3559
3535
|
}
|
|
3560
|
-
const
|
|
3561
|
-
if (
|
|
3562
|
-
name:
|
|
3563
|
-
data:
|
|
3536
|
+
const A = vn(S);
|
|
3537
|
+
if (p({
|
|
3538
|
+
name: S,
|
|
3539
|
+
data: A
|
|
3564
3540
|
}))
|
|
3565
|
-
if (
|
|
3566
|
-
const
|
|
3541
|
+
if (A === void 0) {
|
|
3542
|
+
const k = Os([S], g);
|
|
3567
3543
|
o({
|
|
3568
|
-
callback:
|
|
3544
|
+
callback: k
|
|
3569
3545
|
});
|
|
3570
|
-
} else
|
|
3546
|
+
} else A && ((I = e.onLoad) === null || I === void 0 || I.call(e, S));
|
|
3571
3547
|
}
|
|
3572
|
-
|
|
3548
|
+
xe(() => (r(!0), l), []), xe(() => {
|
|
3573
3549
|
t && g();
|
|
3574
3550
|
}, [e.icon, t]);
|
|
3575
|
-
const { name: y, data:
|
|
3576
|
-
return
|
|
3577
|
-
|
|
3578
|
-
...
|
|
3579
|
-
}, e, y) : e.children ? e.children : e.fallback ? e.fallback :
|
|
3551
|
+
const { name: y, data: x } = i;
|
|
3552
|
+
return x ? Js({
|
|
3553
|
+
...$r,
|
|
3554
|
+
...x
|
|
3555
|
+
}, e, y) : e.children ? e.children : e.fallback ? e.fallback : pr("span", {});
|
|
3580
3556
|
}
|
|
3581
|
-
const
|
|
3557
|
+
const ce = $n((e, t) => mo({
|
|
3582
3558
|
...e,
|
|
3583
3559
|
_ref: t
|
|
3584
3560
|
}));
|
|
3585
|
-
|
|
3561
|
+
$n((e, t) => mo({
|
|
3586
3562
|
inline: !0,
|
|
3587
3563
|
...e,
|
|
3588
3564
|
_ref: t
|
|
3589
3565
|
}));
|
|
3590
|
-
const ct = "USD",
|
|
3566
|
+
const ct = "USD", Ks = (e, t = ct) => {
|
|
3591
3567
|
const r = (e == null ? void 0 : e.prices) ?? [];
|
|
3592
3568
|
if (!r.length) return null;
|
|
3593
3569
|
const n = (i) => {
|
|
3594
|
-
var
|
|
3570
|
+
var p, g;
|
|
3595
3571
|
const c = i.find((y) => {
|
|
3596
|
-
var
|
|
3597
|
-
return !!((
|
|
3572
|
+
var x;
|
|
3573
|
+
return !!((x = y.discounted) != null && x.value);
|
|
3598
3574
|
});
|
|
3599
3575
|
if (c)
|
|
3600
3576
|
return {
|
|
3601
3577
|
cent: c.discounted.value.centAmount,
|
|
3602
3578
|
cur: c.discounted.value.currencyCode,
|
|
3603
|
-
regularCent: (
|
|
3579
|
+
regularCent: (p = c.value) == null ? void 0 : p.centAmount
|
|
3604
3580
|
};
|
|
3605
3581
|
const l = (g = i[0]) == null ? void 0 : g.value;
|
|
3606
3582
|
return l ? { cent: l.centAmount, cur: l.currencyCode } : null;
|
|
@@ -3611,21 +3587,21 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3611
3587
|
}
|
|
3612
3588
|
), s = n(o);
|
|
3613
3589
|
return s || n(r) || null;
|
|
3614
|
-
},
|
|
3590
|
+
}, Ws = (e, t) => {
|
|
3615
3591
|
if (!Array.isArray(e)) return "";
|
|
3616
3592
|
const r = e.find((n) => n.name === t) || e.find((n) => {
|
|
3617
3593
|
var o;
|
|
3618
3594
|
return ((o = n.name) == null ? void 0 : o.toLowerCase()) === t.toLowerCase();
|
|
3619
3595
|
});
|
|
3620
3596
|
return !r || !r.value ? "" : typeof r.value == "object" ? r.value.label || "" : r.value;
|
|
3621
|
-
},
|
|
3597
|
+
}, Qs = (e) => {
|
|
3622
3598
|
let t = "";
|
|
3623
3599
|
if (Array.isArray(e)) {
|
|
3624
3600
|
const r = e.find((n) => n.name === "size") || e.find((n) => n.name === "Size");
|
|
3625
3601
|
r && r.value && (t = typeof r.value == "object" ? r.value.label || "" : r.value);
|
|
3626
3602
|
}
|
|
3627
3603
|
return { sizeLabel: t };
|
|
3628
|
-
}, gt = (e) =>
|
|
3604
|
+
}, gt = (e) => Ws((e == null ? void 0 : e.attributesRaw) ?? [], "color"), wt = (e) => Qs((e == null ? void 0 : e.attributesRaw) ?? []).sizeLabel, We = (e) => e.charAt(0).toUpperCase() + e.slice(1), yt = {
|
|
3629
3605
|
standard: {
|
|
3630
3606
|
label: "Standard Delivery",
|
|
3631
3607
|
fee: 0,
|
|
@@ -3644,11 +3620,11 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3644
3620
|
subtitle: "Available in select locations (+$10)",
|
|
3645
3621
|
icon: "mdi:truck-fast-outline"
|
|
3646
3622
|
}
|
|
3647
|
-
},
|
|
3623
|
+
}, Gs = {
|
|
3648
3624
|
standard: "GROUND",
|
|
3649
3625
|
express: "2-DAY SHIPPING",
|
|
3650
3626
|
sameday: "OVERNIGHT"
|
|
3651
|
-
},
|
|
3627
|
+
}, Qe = (e, t) => {
|
|
3652
3628
|
try {
|
|
3653
3629
|
return e.toLocaleString("en-US", {
|
|
3654
3630
|
style: "currency",
|
|
@@ -3657,41 +3633,41 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3657
3633
|
} catch {
|
|
3658
3634
|
return `${t} ${e.toFixed(2)}`;
|
|
3659
3635
|
}
|
|
3660
|
-
},
|
|
3661
|
-
const t =
|
|
3662
|
-
return t ? [t, ...
|
|
3663
|
-
},
|
|
3636
|
+
}, ho = (e) => e == null ? void 0 : e.masterVariant, En = (e) => Array.isArray(e == null ? void 0 : e.variants) ? e.variants : [], Xt = (e) => {
|
|
3637
|
+
const t = ho(e);
|
|
3638
|
+
return t ? [t, ...En(e)] : En(e);
|
|
3639
|
+
}, Xs = (e, t = 0) => Xt(e)[t], Zs = (e) => {
|
|
3664
3640
|
var t, r;
|
|
3665
3641
|
return ((r = (t = e == null ? void 0 : e.images) == null ? void 0 : t[0]) == null ? void 0 : r.url) ?? "";
|
|
3666
|
-
},
|
|
3667
|
-
var r, n, o, s, i, c, l,
|
|
3668
|
-
return
|
|
3669
|
-
},
|
|
3670
|
-
var s, i, c, l,
|
|
3671
|
-
const t = e ?
|
|
3642
|
+
}, Tn = (e, t) => {
|
|
3643
|
+
var r, n, o, s, i, c, l, p;
|
|
3644
|
+
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) || "";
|
|
3645
|
+
}, An = (e) => (e == null ? void 0 : e.name) || (e == null ? void 0 : e.title) || (e == null ? void 0 : e.productName) || "any", Zt = (e) => {
|
|
3646
|
+
var s, i, c, l, p, g;
|
|
3647
|
+
const t = e ? Ks(e, ct) : null;
|
|
3672
3648
|
if (t != null && t.cent && (t != null && t.cur))
|
|
3673
3649
|
return {
|
|
3674
3650
|
amount: +(t.cent / 100),
|
|
3675
3651
|
currency: t.cur,
|
|
3676
3652
|
regularAmount: t.regularCent ? t.regularCent / 100 : void 0
|
|
3677
3653
|
};
|
|
3678
|
-
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 = (
|
|
3654
|
+
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) ?? ct;
|
|
3679
3655
|
return { amount: Number.isFinite(r) ? +(Number(r) / 100) : 0, currency: n };
|
|
3680
|
-
},
|
|
3656
|
+
}, On = (e, t) => {
|
|
3681
3657
|
const { amount: r } = Zt(t);
|
|
3682
3658
|
if (r) return r;
|
|
3683
3659
|
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);
|
|
3684
3660
|
return Number.isFinite(o) ? o : 0;
|
|
3685
|
-
},
|
|
3661
|
+
}, ei = (e) => {
|
|
3686
3662
|
var t;
|
|
3687
3663
|
return (e == null ? void 0 : e.sku) || ((t = e == null ? void 0 : e.variant) == null ? void 0 : t.sku) || (e == null ? void 0 : e.selectedSku) || "";
|
|
3688
|
-
},
|
|
3664
|
+
}, ti = (e) => {
|
|
3689
3665
|
var t;
|
|
3690
3666
|
return (e == null ? void 0 : e.color) || (e == null ? void 0 : e.selectedColor) || ((t = e == null ? void 0 : e.variant) == null ? void 0 : t.color) || "";
|
|
3691
|
-
},
|
|
3667
|
+
}, ri = (e) => {
|
|
3692
3668
|
var t;
|
|
3693
3669
|
return (e == null ? void 0 : e.size) || (e == null ? void 0 : e.selectedSize) || ((t = e == null ? void 0 : e.variant) == null ? void 0 : t.size) || "";
|
|
3694
|
-
}, jn = 20,
|
|
3670
|
+
}, jn = 20, vi = ({
|
|
3695
3671
|
open: e,
|
|
3696
3672
|
onClose: t,
|
|
3697
3673
|
product: r,
|
|
@@ -3700,97 +3676,97 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3700
3676
|
addressLoading: s,
|
|
3701
3677
|
variationAttributes: i
|
|
3702
3678
|
}) => {
|
|
3703
|
-
const
|
|
3679
|
+
const p = Xt(r), g = Math.min(
|
|
3704
3680
|
Math.max(0, n || 0),
|
|
3705
|
-
Math.max(0,
|
|
3706
|
-
), [y,
|
|
3707
|
-
|
|
3681
|
+
Math.max(0, p.length - 1)
|
|
3682
|
+
), [y, x] = b([]), [I, S] = b(0), [A, k] = b([]);
|
|
3683
|
+
xe(() => {
|
|
3708
3684
|
if (r != null && r.variants) {
|
|
3709
3685
|
const u = P(
|
|
3710
3686
|
r.variants,
|
|
3711
3687
|
r.imageGroups,
|
|
3712
3688
|
i
|
|
3713
3689
|
);
|
|
3714
|
-
|
|
3690
|
+
x(u);
|
|
3715
3691
|
}
|
|
3716
3692
|
}, [r]);
|
|
3717
3693
|
const P = (u, m, f) => {
|
|
3718
|
-
const { colorMap: w, sizeMap:
|
|
3694
|
+
const { colorMap: w, sizeMap: v } = J(f), j = {};
|
|
3719
3695
|
m == null || m.forEach((E) => {
|
|
3720
|
-
var
|
|
3721
|
-
const
|
|
3722
|
-
(
|
|
3723
|
-
),
|
|
3724
|
-
|
|
3696
|
+
var le, Pe, ze;
|
|
3697
|
+
const M = (le = E.variationAttributes) == null ? void 0 : le.find(
|
|
3698
|
+
(De) => De.id === "color"
|
|
3699
|
+
), T = (ze = (Pe = M == null ? void 0 : M.values) == null ? void 0 : Pe[0]) == null ? void 0 : ze.value;
|
|
3700
|
+
T && (j[T] || (j[T] = {}), j[T][E.viewType] = E.images);
|
|
3725
3701
|
});
|
|
3726
|
-
const H = u.reduce((E,
|
|
3727
|
-
const
|
|
3728
|
-
return E[
|
|
3729
|
-
color:
|
|
3730
|
-
name: w[
|
|
3702
|
+
const H = u.reduce((E, M) => {
|
|
3703
|
+
const T = M.variationValues.color, le = M.variationValues.size;
|
|
3704
|
+
return E[T] || (E[T] = {
|
|
3705
|
+
color: T,
|
|
3706
|
+
name: w[T] || T,
|
|
3731
3707
|
// ✅ DISPLAY NAME
|
|
3732
|
-
images:
|
|
3708
|
+
images: j[T] || {},
|
|
3733
3709
|
variants: []
|
|
3734
|
-
}), E[
|
|
3735
|
-
size:
|
|
3736
|
-
name:
|
|
3710
|
+
}), E[T].variants.push({
|
|
3711
|
+
size: le,
|
|
3712
|
+
name: v[le] || le,
|
|
3737
3713
|
// ✅ DISPLAY NAME
|
|
3738
|
-
...
|
|
3714
|
+
...M
|
|
3739
3715
|
}), E;
|
|
3740
3716
|
}, {});
|
|
3741
|
-
return Object.values(H).sort((E,
|
|
3742
|
-
const
|
|
3743
|
-
return
|
|
3717
|
+
return Object.values(H).sort((E, M) => {
|
|
3718
|
+
const T = E.colorName || E.color || "", le = M.colorName || M.color || "";
|
|
3719
|
+
return T.localeCompare(le);
|
|
3744
3720
|
}).map((E) => ({
|
|
3745
3721
|
...E,
|
|
3746
3722
|
variants: E.variants.sort(
|
|
3747
|
-
(
|
|
3723
|
+
(M, T) => Number(M.size) - Number(T.size)
|
|
3748
3724
|
)
|
|
3749
3725
|
}));
|
|
3750
3726
|
}, J = (u) => {
|
|
3751
3727
|
const m = {}, f = {};
|
|
3752
3728
|
return u == null || u.forEach((w) => {
|
|
3753
|
-
w.id === "color" && w.values.forEach((
|
|
3754
|
-
m[
|
|
3755
|
-
}), w.id === "size" && w.values.forEach((
|
|
3756
|
-
f[
|
|
3729
|
+
w.id === "color" && w.values.forEach((v) => {
|
|
3730
|
+
m[v.value] = v.name;
|
|
3731
|
+
}), w.id === "size" && w.values.forEach((v) => {
|
|
3732
|
+
f[v.value] = v.name;
|
|
3757
3733
|
});
|
|
3758
3734
|
}), { colorMap: m, sizeMap: f };
|
|
3759
|
-
},
|
|
3760
|
-
|
|
3735
|
+
}, q = p.length, [Y, _e] = b(g), [C, K] = b(null), [re, ye] = b(null), be = Ve(null), dt = Ve(null), N = Xs(r, Y), [ve, V] = b(""), [$, Je] = b(""), [ut, qe] = b(!1), [nt, fe] = b(!1), [Ie, je] = b(!1), [z, Te] = b(""), [Se, ne] = b(!1), [X, kt] = b(null), [h, O] = b([]), [B, Q] = b([]), [U, L] = b([]), [W, Z] = b(!1), [R, oe] = b(), [$e, Re] = b(!0), [G, me] = b(!1), [Ne, he] = b(!1), [pe, _] = b("standard"), [ee, D] = b(!1), [ae, se] = b(!1), [Ae, St] = b("card"), [Oe, ie] = b(!1), [Nt, Ce] = b(!1), [F, te] = b(!1), [Ct, _t] = b(null), [Mt, Mr] = b(null), [sr, Br] = b(""), [Ur, qr] = b(!1), [It, po] = b(r == null ? void 0 : r.id), Bt = Ve(null);
|
|
3736
|
+
xe(() => {
|
|
3761
3737
|
const u = Xt(r), m = Math.min(
|
|
3762
3738
|
Math.max(0, n || 0),
|
|
3763
3739
|
Math.max(0, u.length - 1)
|
|
3764
3740
|
);
|
|
3765
|
-
|
|
3766
|
-
const f =
|
|
3767
|
-
|
|
3768
|
-
}, [n, r]),
|
|
3741
|
+
_e(m);
|
|
3742
|
+
const f = ho(r), w = gt(f), v = wt(f);
|
|
3743
|
+
be.current = w || null, dt.current = v || null, K(w || null), ye(v || null);
|
|
3744
|
+
}, [n, r]), xe(() => {
|
|
3769
3745
|
Bt.current && (Bt.current.scrollTop = Bt.current.scrollHeight);
|
|
3770
3746
|
}, [
|
|
3771
|
-
|
|
3747
|
+
h,
|
|
3772
3748
|
W,
|
|
3773
3749
|
G,
|
|
3774
3750
|
Ne,
|
|
3775
3751
|
ee,
|
|
3776
|
-
|
|
3777
|
-
|
|
3752
|
+
ae,
|
|
3753
|
+
Oe,
|
|
3778
3754
|
Nt,
|
|
3779
3755
|
F,
|
|
3780
3756
|
ut,
|
|
3781
3757
|
nt
|
|
3782
3758
|
]);
|
|
3783
|
-
const ft = "var(--tanya)", Rr = "var(--tanya-contrast)", Ut = ft,
|
|
3759
|
+
const ft = "var(--tanya)", Rr = "var(--tanya-contrast)", Ut = ft, Le = "#804c9e", go = () => {
|
|
3784
3760
|
console.log("AgenticShopping feedback:", {
|
|
3785
3761
|
rating: Mt,
|
|
3786
3762
|
comment: sr
|
|
3787
|
-
}),
|
|
3763
|
+
}), qr(!0);
|
|
3788
3764
|
}, wo = () => {
|
|
3789
|
-
|
|
3790
|
-
},
|
|
3765
|
+
Mr(null), Br(""), qr(!0);
|
|
3766
|
+
}, Hr = (u) => {
|
|
3791
3767
|
const f = ((u == null ? void 0 : u.intentMandateId) || (u == null ? void 0 : u.intent_mandate_id) || (u == null ? void 0 : u.id) || null) ?? Ct;
|
|
3792
3768
|
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: [
|
|
3793
|
-
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(
|
|
3769
|
+
/* @__PURE__ */ a("div", { className: "success-tick-animation", children: /* @__PURE__ */ a(ce, { icon: "mdi:check-circle", width: "28", color: "#16a34a" }) }),
|
|
3794
3770
|
/* @__PURE__ */ d("div", { className: "text-sm w-full", children: [
|
|
3795
3771
|
/* @__PURE__ */ a("div", { className: "font-semibold", children: "Success!" }),
|
|
3796
3772
|
/* @__PURE__ */ a("div", { children: "Your smart order has been saved. I’ll watch the price and auto-purchase when the conditions are met." }),
|
|
@@ -3804,17 +3780,17 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3804
3780
|
}
|
|
3805
3781
|
)
|
|
3806
3782
|
] }),
|
|
3807
|
-
!
|
|
3783
|
+
!Ur && /* @__PURE__ */ d("div", { className: "mt-4 rounded-lg bg-white/70 p-3 text-gray-900", children: [
|
|
3808
3784
|
/* @__PURE__ */ a("h4", { className: "font-semibold mb-1", children: "Please post your feedback here" }),
|
|
3809
3785
|
/* @__PURE__ */ a("p", { className: "text-sm text-gray-700 mb-3", children: "Rate us on how much our response was helpful" }),
|
|
3810
3786
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 mb-3", children: [1, 2, 3, 4, 5].map((w) => /* @__PURE__ */ a(
|
|
3811
3787
|
"button",
|
|
3812
3788
|
{
|
|
3813
3789
|
type: "button",
|
|
3814
|
-
onClick: () =>
|
|
3790
|
+
onClick: () => Mr(w),
|
|
3815
3791
|
className: "p-0.5",
|
|
3816
3792
|
children: /* @__PURE__ */ a(
|
|
3817
|
-
|
|
3793
|
+
ce,
|
|
3818
3794
|
{
|
|
3819
3795
|
icon: Mt && Mt >= w ? "mdi:star" : "mdi:star-outline",
|
|
3820
3796
|
width: "20",
|
|
@@ -3829,7 +3805,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3829
3805
|
"textarea",
|
|
3830
3806
|
{
|
|
3831
3807
|
value: sr,
|
|
3832
|
-
onChange: (w) =>
|
|
3808
|
+
onChange: (w) => Br(w.target.value),
|
|
3833
3809
|
rows: 3,
|
|
3834
3810
|
className: "mt-1 w-full rounded-md border border-gray-300 p-2 text-sm outline-none focus:ring-1 focus:ring-gray-300",
|
|
3835
3811
|
placeholder: "Your feedback helps us improve..."
|
|
@@ -3858,7 +3834,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3858
3834
|
)
|
|
3859
3835
|
] })
|
|
3860
3836
|
] }),
|
|
3861
|
-
|
|
3837
|
+
Ur && /* @__PURE__ */ a("div", { className: "mt-3 text-xs text-green-900 font-medium", children: "Thanks for your feedback! 💚" })
|
|
3862
3838
|
] })
|
|
3863
3839
|
] }) : null;
|
|
3864
3840
|
}, yo = async () => {
|
|
@@ -3869,20 +3845,20 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3869
3845
|
);
|
|
3870
3846
|
let m = (u == null ? void 0 : u.basketId) || localStorage.getItem(Lt);
|
|
3871
3847
|
if (!m) {
|
|
3872
|
-
const f = await
|
|
3873
|
-
m = (
|
|
3848
|
+
const f = await Xe(), w = "Bearer " + (f == null ? void 0 : f.access_token), v = await Ir(w);
|
|
3849
|
+
m = (v == null ? void 0 : v.basket_id) || v.basketId;
|
|
3874
3850
|
}
|
|
3875
|
-
|
|
3851
|
+
xo(m), V(m);
|
|
3876
3852
|
} catch (u) {
|
|
3877
3853
|
console.error("Error fetching addresses:", u);
|
|
3878
3854
|
}
|
|
3879
|
-
},
|
|
3880
|
-
const m = await
|
|
3881
|
-
console.log(m, "shipping methods"),
|
|
3855
|
+
}, xo = async (u) => {
|
|
3856
|
+
const m = await ua(u);
|
|
3857
|
+
console.log(m, "shipping methods"), k(m);
|
|
3882
3858
|
};
|
|
3883
3859
|
console.log(ve, "the basket id");
|
|
3884
3860
|
const Pt = (u, m) => {
|
|
3885
|
-
|
|
3861
|
+
O((f) => [
|
|
3886
3862
|
...f,
|
|
3887
3863
|
{
|
|
3888
3864
|
query: "",
|
|
@@ -3891,8 +3867,8 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3891
3867
|
snapshotPayload: m
|
|
3892
3868
|
}
|
|
3893
3869
|
]);
|
|
3894
|
-
},
|
|
3895
|
-
|
|
3870
|
+
}, Vr = (u, m) => {
|
|
3871
|
+
O(
|
|
3896
3872
|
(f) => f.map(
|
|
3897
3873
|
(w) => w.response === "__CARD__" ? {
|
|
3898
3874
|
...w,
|
|
@@ -3902,44 +3878,44 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3902
3878
|
} : w
|
|
3903
3879
|
)
|
|
3904
3880
|
);
|
|
3905
|
-
},
|
|
3906
|
-
|
|
3881
|
+
}, bo = () => {
|
|
3882
|
+
O(
|
|
3907
3883
|
(u) => u.filter(
|
|
3908
3884
|
(m) => !(m.query === "" && m.response !== "__SNAPSHOT__" && m.response !== "__TEXT__")
|
|
3909
3885
|
)
|
|
3910
3886
|
);
|
|
3911
|
-
},
|
|
3912
|
-
Ce(!1), Z(!1),
|
|
3887
|
+
}, qt = () => {
|
|
3888
|
+
Ce(!1), Z(!1), he(!1), se(!1), me(!1), D(!1), ie(!1), te(!1), ne(!1), kt(null), bo(), qe(!1), fe(!1);
|
|
3913
3889
|
}, vo = () => {
|
|
3914
|
-
Z(!1), me(!1),
|
|
3915
|
-
},
|
|
3890
|
+
Z(!1), me(!1), he(!1), _("standard"), D(!1), se(!1), St("card"), ie(!1), Ce(!1), te(!1), Re(!0), kt(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");
|
|
3891
|
+
}, Rt = en(() => Xt(r).map((m, f) => ({
|
|
3916
3892
|
index: f,
|
|
3917
3893
|
variant: m,
|
|
3918
3894
|
images: ((m == null ? void 0 : m.images) || []).map((w) => (w == null ? void 0 : w.url) || "").filter(Boolean)
|
|
3919
|
-
})), [r]), Ft =
|
|
3895
|
+
})), [r]), Ft = en(() => Rt.length ? !!((C || void 0) && (re || void 0)) : !1, [Rt, C, re, N]), ko = Ie || Se || !Ft, Et = (u) => {
|
|
3920
3896
|
const m = Number((u == null ? void 0 : u.quantity) ?? 1);
|
|
3921
3897
|
return Number.isFinite(m) && m > 0 ? m : 1;
|
|
3922
|
-
}, Vr = (u) => {
|
|
3923
|
-
const m = Et(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
|
|
3924
|
-
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(An(r, S) * m);
|
|
3925
3898
|
}, Yr = (u) => {
|
|
3899
|
+
const m = Et(u), f = Number((u == null ? void 0 : u.max_price_minor) ?? 0);
|
|
3900
|
+
return Number.isFinite(f) && f > 0 ? +(f / 100) : +(On(r, N) * m);
|
|
3901
|
+
}, Jr = (u) => {
|
|
3926
3902
|
var E;
|
|
3927
|
-
const m = X, f = Zt(
|
|
3928
|
-
return { product_total:
|
|
3903
|
+
const m = X, f = Zt(N), w = u || (m == null ? void 0 : m.currency) || f.currency || ct, v = Yr(m), j = +(v * 0.08).toFixed(2), H = ((E = yt[pe]) == null ? void 0 : E.fee) || 0;
|
|
3904
|
+
return { product_total: v, tax: j, shipping_fee: H, currency: w };
|
|
3929
3905
|
}, ir = async (u, m, f) => {
|
|
3930
|
-
|
|
3931
|
-
const w =
|
|
3906
|
+
Vr(), vo(), je(!0), ne(!0), qe(!1), fe(!1);
|
|
3907
|
+
const w = B.slice(-jn);
|
|
3932
3908
|
try {
|
|
3933
|
-
const
|
|
3934
|
-
if (!
|
|
3935
|
-
const
|
|
3909
|
+
const v = await wr(null, null);
|
|
3910
|
+
if (!v) throw new Error("Failed to fetch token");
|
|
3911
|
+
const j = localStorage.getItem("customerNumber"), H = localStorage.getItem("isLoggedIn"), M = `https://tanya.aspiresystems.com/api/bedrock/invoke/stream?${new URLSearchParams({
|
|
3936
3912
|
registered: String(H || !1),
|
|
3937
|
-
userId: String(
|
|
3938
|
-
}).toString()}`,
|
|
3913
|
+
userId: String(j || (/* @__PURE__ */ new Date()).getTime())
|
|
3914
|
+
}).toString()}`, T = await fetch(`${M}`, {
|
|
3939
3915
|
method: "POST",
|
|
3940
3916
|
headers: {
|
|
3941
3917
|
"Content-Type": "application/json",
|
|
3942
|
-
Authorization: `Bearer ${
|
|
3918
|
+
Authorization: `Bearer ${v}`
|
|
3943
3919
|
},
|
|
3944
3920
|
body: JSON.stringify({
|
|
3945
3921
|
flowId: "MTMI0P4LC6",
|
|
@@ -3955,38 +3931,38 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3955
3931
|
}
|
|
3956
3932
|
})
|
|
3957
3933
|
});
|
|
3958
|
-
if (!
|
|
3959
|
-
const
|
|
3960
|
-
let
|
|
3934
|
+
if (!T.body) throw new Error("Readable stream not supported");
|
|
3935
|
+
const le = T.body.getReader(), Pe = new TextDecoder();
|
|
3936
|
+
let ze = "", De = "", ot = "";
|
|
3961
3937
|
for (; ; ) {
|
|
3962
|
-
const { done: Ee, value:
|
|
3938
|
+
const { done: Ee, value: Ke } = await le.read();
|
|
3963
3939
|
if (Ee) break;
|
|
3964
|
-
|
|
3965
|
-
const mt =
|
|
3940
|
+
ze += Pe.decode(Ke, { stream: !0 });
|
|
3941
|
+
const mt = ze.split(`
|
|
3966
3942
|
`);
|
|
3967
|
-
|
|
3968
|
-
for (const
|
|
3969
|
-
if (!
|
|
3970
|
-
const at =
|
|
3943
|
+
ze = mt.pop() || "";
|
|
3944
|
+
for (const ht of mt) {
|
|
3945
|
+
if (!ht.startsWith("data:")) continue;
|
|
3946
|
+
const at = ht.slice(5).trim();
|
|
3971
3947
|
try {
|
|
3972
|
-
const
|
|
3973
|
-
|
|
3974
|
-
} catch (
|
|
3975
|
-
console.error("Error parsing JSON chunk:",
|
|
3948
|
+
const He = JSON.parse(at), Me = He.index, ge = He.data;
|
|
3949
|
+
Me === 0 ? De = String(ge ?? "") : Me === 1 && (ot = String(ge ?? ""));
|
|
3950
|
+
} catch (He) {
|
|
3951
|
+
console.error("Error parsing JSON chunk:", He);
|
|
3976
3952
|
}
|
|
3977
3953
|
}
|
|
3978
3954
|
}
|
|
3979
3955
|
let Fe = null;
|
|
3980
|
-
if (
|
|
3981
|
-
const Ee = String(
|
|
3956
|
+
if (De) {
|
|
3957
|
+
const Ee = String(De).replace(/\\n/g, "").trim();
|
|
3982
3958
|
if (Ee.startsWith("{") && Ee.endsWith("}"))
|
|
3983
3959
|
try {
|
|
3984
3960
|
Fe = JSON.parse(Ee), Fe.product_id = m, Fe.sku_id = m, localStorage.setItem("agentic_order", JSON.stringify(Fe));
|
|
3985
|
-
} catch (
|
|
3986
|
-
console.log(
|
|
3961
|
+
} catch (Ke) {
|
|
3962
|
+
console.log(Ke);
|
|
3987
3963
|
}
|
|
3988
3964
|
}
|
|
3989
|
-
kt(Fe), Fe &&
|
|
3965
|
+
kt(Fe), Fe && O((Ee) => [
|
|
3990
3966
|
...Ee,
|
|
3991
3967
|
{
|
|
3992
3968
|
query: "",
|
|
@@ -3997,57 +3973,57 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
3997
3973
|
...Ee,
|
|
3998
3974
|
{
|
|
3999
3975
|
userQuery: u,
|
|
4000
|
-
mainResponse:
|
|
3976
|
+
mainResponse: De || "",
|
|
4001
3977
|
keywords: ot || ""
|
|
4002
3978
|
}
|
|
4003
3979
|
].slice(-jn));
|
|
4004
|
-
} catch (
|
|
4005
|
-
console.error("Error sending message to Tanya:",
|
|
3980
|
+
} catch (v) {
|
|
3981
|
+
console.error("Error sending message to Tanya:", v), ne(!1);
|
|
4006
3982
|
} finally {
|
|
4007
|
-
|
|
3983
|
+
je(!1);
|
|
4008
3984
|
}
|
|
4009
|
-
},
|
|
4010
|
-
if (Se ||
|
|
3985
|
+
}, Kr = async (u) => {
|
|
3986
|
+
if (Se || Ie || !Ft) return;
|
|
4011
3987
|
const m = z.trim();
|
|
4012
3988
|
if (!m) return;
|
|
4013
|
-
|
|
4014
|
-
const f =
|
|
4015
|
-
if (
|
|
3989
|
+
O((w) => [...w, { query: m, response: "" }]), Te(""), Je(m);
|
|
3990
|
+
const f = It || "";
|
|
3991
|
+
if (q <= 1) {
|
|
4016
3992
|
if (f) {
|
|
4017
3993
|
ir(m, f, Y);
|
|
4018
3994
|
return;
|
|
4019
3995
|
}
|
|
4020
|
-
fe(!0),
|
|
3996
|
+
fe(!0), ne(!0);
|
|
4021
3997
|
return;
|
|
4022
3998
|
}
|
|
4023
|
-
f ? (qe(!0),
|
|
3999
|
+
f ? (qe(!0), ne(!0)) : (fe(!0), ne(!0));
|
|
4024
4000
|
}, So = () => {
|
|
4025
|
-
const u =
|
|
4001
|
+
const u = It;
|
|
4026
4002
|
u && ir($, u, Y);
|
|
4027
4003
|
}, No = () => {
|
|
4028
|
-
qe(!1), fe(!0),
|
|
4004
|
+
qe(!1), fe(!0), ne(!0);
|
|
4029
4005
|
}, Co = () => {
|
|
4030
|
-
if (!
|
|
4031
|
-
ir($,
|
|
4032
|
-
},
|
|
4033
|
-
Z(!0),
|
|
4006
|
+
if (!It) return;
|
|
4007
|
+
ir($, It, Y);
|
|
4008
|
+
}, _o = async () => {
|
|
4009
|
+
Z(!0), he(!1), se(!1), Ce(!1), me(!1), D(!1), ie(!1), te(!1), await yo(), console.log("calling"), Vr("initial", {
|
|
4034
4010
|
extractedDetails: X ?? void 0
|
|
4035
4011
|
});
|
|
4036
|
-
},
|
|
4037
|
-
if (!
|
|
4038
|
-
const u =
|
|
4039
|
-
(m) => String(m.addressId ?? m.id) ===
|
|
4012
|
+
}, Io = () => {
|
|
4013
|
+
if (!R) return;
|
|
4014
|
+
const u = U.find(
|
|
4015
|
+
(m) => String(m.addressId ?? m.id) === R
|
|
4040
4016
|
) || null;
|
|
4041
|
-
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), me(!0),
|
|
4017
|
+
u && (localStorage.setItem("agentic_order_address", JSON.stringify(u)), me(!0), he(!0), D(!1), se(!1), ie(!1), Ce(!1), te(!1), Pt("address", u));
|
|
4042
4018
|
}, Po = () => {
|
|
4043
|
-
me(!1),
|
|
4019
|
+
me(!1), he(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_address");
|
|
4044
4020
|
}, Fo = () => {
|
|
4045
|
-
|
|
4046
|
-
method:
|
|
4047
|
-
...yt[
|
|
4021
|
+
pe && (localStorage.setItem("agentic_order_delivery", pe), D(!0), se(!0), ie(!1), Ce(!1), te(!1), Pt("delivery", {
|
|
4022
|
+
method: pe,
|
|
4023
|
+
...yt[pe]
|
|
4048
4024
|
}));
|
|
4049
|
-
},
|
|
4050
|
-
|
|
4025
|
+
}, Wr = () => {
|
|
4026
|
+
he(!1), D(!1), se(!1), ie(!1), Ce(!1), te(!1), ne(!1), qt(), O((u) => [
|
|
4051
4027
|
...u,
|
|
4052
4028
|
{
|
|
4053
4029
|
query: "",
|
|
@@ -4058,11 +4034,11 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4058
4034
|
}
|
|
4059
4035
|
]);
|
|
4060
4036
|
}, Eo = () => {
|
|
4061
|
-
D(!1),
|
|
4037
|
+
D(!1), se(!1), ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_delivery");
|
|
4062
4038
|
}, To = () => {
|
|
4063
|
-
Ae && (localStorage.setItem("agentic_order_payment", Ae),
|
|
4039
|
+
Ae && (localStorage.setItem("agentic_order_payment", Ae), ie(!0), Ce(!0), te(!1), Pt("payment", { method: Ae }));
|
|
4064
4040
|
}, Ao = () => {
|
|
4065
|
-
|
|
4041
|
+
se(!1), ie(!1), Ce(!1), te(!1), ne(!1), qt(), O((u) => [
|
|
4066
4042
|
...u,
|
|
4067
4043
|
{
|
|
4068
4044
|
query: "",
|
|
@@ -4072,45 +4048,45 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4072
4048
|
}
|
|
4073
4049
|
}
|
|
4074
4050
|
]);
|
|
4075
|
-
},
|
|
4076
|
-
|
|
4077
|
-
},
|
|
4051
|
+
}, Oo = () => {
|
|
4052
|
+
ie(!1), Ce(!1), te(!1), localStorage.removeItem("agentic_order_payment");
|
|
4053
|
+
}, jo = async () => {
|
|
4078
4054
|
try {
|
|
4079
|
-
|
|
4055
|
+
je(!0);
|
|
4080
4056
|
const u = X || {}, m = JSON.parse(
|
|
4081
4057
|
localStorage.getItem("agentic_order_address") || "null"
|
|
4082
4058
|
), f = localStorage.getItem(
|
|
4083
4059
|
"agentic_order_delivery"
|
|
4084
|
-
), w = localStorage.getItem("agentic_order_payment") || "card", { product_total:
|
|
4085
|
-
shopper_id:
|
|
4086
|
-
shipping_address_id:
|
|
4087
|
-
shipping_method_id:
|
|
4060
|
+
), w = localStorage.getItem("agentic_order_payment") || "card", { product_total: v, tax: j, shipping_fee: H, currency: E } = Jr(), M = u.shopper_id || localStorage.getItem("customerId") || void 0, T = (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) || "", ot = Et(u), Fe = typeof u.max_price_minor == "number" ? u.max_price_minor : Math.round(v * 100), mt = {
|
|
4061
|
+
shopper_id: M,
|
|
4062
|
+
shipping_address_id: T,
|
|
4063
|
+
shipping_method_id: le,
|
|
4088
4064
|
payment_method_id: Pe,
|
|
4089
|
-
sku:
|
|
4065
|
+
sku: ze,
|
|
4090
4066
|
platform: "SFCC",
|
|
4091
4067
|
storeCode: "Sites-SiteGenesis-Site",
|
|
4092
|
-
product_id:
|
|
4068
|
+
product_id: De,
|
|
4093
4069
|
quantity: ot,
|
|
4094
4070
|
max_price_minor: Fe,
|
|
4095
4071
|
currency: E,
|
|
4096
4072
|
instruction_text: $
|
|
4097
4073
|
};
|
|
4098
|
-
if (!
|
|
4074
|
+
if (console.log(M, T, "the selected ids"), !M || !T) {
|
|
4099
4075
|
console.error(
|
|
4100
4076
|
"Missing shopper_id or shipping_address_id for intent-mandate",
|
|
4101
4077
|
{
|
|
4102
|
-
shopperId:
|
|
4103
|
-
shippingAddressId:
|
|
4078
|
+
shopperId: M,
|
|
4079
|
+
shippingAddressId: T
|
|
4104
4080
|
}
|
|
4105
4081
|
), alert(
|
|
4106
4082
|
"Missing customer or address information. Please re-select address and try again."
|
|
4107
|
-
),
|
|
4083
|
+
), je(!1);
|
|
4108
4084
|
return;
|
|
4109
4085
|
}
|
|
4110
|
-
const at = (await
|
|
4086
|
+
const at = (await Xe()).access_token;
|
|
4111
4087
|
if (!at)
|
|
4112
4088
|
throw new Error("Failed to fetch auth token for intent-mandate");
|
|
4113
|
-
const { serverUrl:
|
|
4089
|
+
const { serverUrl: He } = Ze(), Me = await fetch(`${He}/api/intent-mandate`, {
|
|
4114
4090
|
method: "POST",
|
|
4115
4091
|
headers: {
|
|
4116
4092
|
"Content-Type": "application/json",
|
|
@@ -4118,35 +4094,35 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4118
4094
|
},
|
|
4119
4095
|
body: JSON.stringify(mt)
|
|
4120
4096
|
});
|
|
4121
|
-
if (!
|
|
4122
|
-
const Bo = await
|
|
4123
|
-
console.error("intent-mandate failed",
|
|
4097
|
+
if (!Me.ok) {
|
|
4098
|
+
const Bo = await Me.text().catch(() => "");
|
|
4099
|
+
console.error("intent-mandate failed", Me.status, Bo), alert(
|
|
4124
4100
|
"Something went wrong while saving your smart order. Please try again."
|
|
4125
|
-
),
|
|
4101
|
+
), je(!1);
|
|
4126
4102
|
return;
|
|
4127
4103
|
}
|
|
4128
|
-
const ge = await
|
|
4104
|
+
const ge = await Me.json().catch(() => null);
|
|
4129
4105
|
console.log("intent-mandate success:", ge);
|
|
4130
4106
|
const st = (ge == null ? void 0 : ge.intent_mandate_id) || (ge == null ? void 0 : ge.intent_mandateId) || (ge == null ? void 0 : ge.key) || null;
|
|
4131
|
-
st &&
|
|
4107
|
+
st && _t(st);
|
|
4132
4108
|
const Ht = {
|
|
4133
4109
|
...u,
|
|
4134
4110
|
address: m,
|
|
4135
4111
|
delivery: f,
|
|
4136
4112
|
payment: w,
|
|
4137
|
-
summary: { product_total:
|
|
4113
|
+
summary: { product_total: v, tax: j, shipping_fee: H, currency: E },
|
|
4138
4114
|
intent_mandate_id: st
|
|
4139
4115
|
};
|
|
4140
|
-
localStorage.setItem("agentic_order_final", JSON.stringify(Ht)), te(!0),
|
|
4116
|
+
localStorage.setItem("agentic_order_final", JSON.stringify(Ht)), te(!0), Re(!1), Pt("final", Ht), Pt("success", { intentMandateId: st }), qt();
|
|
4141
4117
|
} catch (u) {
|
|
4142
4118
|
console.error("Error in handleConfirmWatch / intent-mandate:", u), alert(
|
|
4143
4119
|
"Unable to complete your smart order right now. Please try again in a moment."
|
|
4144
4120
|
);
|
|
4145
4121
|
} finally {
|
|
4146
|
-
|
|
4122
|
+
je(!1);
|
|
4147
4123
|
}
|
|
4148
|
-
},
|
|
4149
|
-
|
|
4124
|
+
}, Qr = () => {
|
|
4125
|
+
qt(), O((u) => [
|
|
4150
4126
|
...u,
|
|
4151
4127
|
{
|
|
4152
4128
|
query: "",
|
|
@@ -4157,8 +4133,8 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4157
4133
|
}
|
|
4158
4134
|
]);
|
|
4159
4135
|
}, $o = ({ selectedIndex: u }) => {
|
|
4160
|
-
var
|
|
4161
|
-
const m = ((
|
|
4136
|
+
var T;
|
|
4137
|
+
const m = ((T = y[u]) == null ? void 0 : T.images.large[0].link) || Tn(r, N), f = An(r), w = It || "", v = gt(N) || "", j = wt(N) || "", { amount: H } = Zt(N), E = !!(r != null && r.id), M = E;
|
|
4162
4138
|
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: [
|
|
4163
4139
|
/* @__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(
|
|
4164
4140
|
"img",
|
|
@@ -4168,7 +4144,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4168
4144
|
className: "object-contain w-full h-full"
|
|
4169
4145
|
}
|
|
4170
4146
|
) : /* @__PURE__ */ a(
|
|
4171
|
-
|
|
4147
|
+
ce,
|
|
4172
4148
|
{
|
|
4173
4149
|
icon: "mdi:image-outline",
|
|
4174
4150
|
width: "28",
|
|
@@ -4179,31 +4155,31 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4179
4155
|
/* @__PURE__ */ a("div", { className: "text-2xl font-bold text-gray-900 mb-1", children: f }),
|
|
4180
4156
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700 mb-1", children: [
|
|
4181
4157
|
w && `SKU: ${w}`,
|
|
4182
|
-
|
|
4183
|
-
|
|
4158
|
+
v && `Color: ${v}`,
|
|
4159
|
+
j && `Size: ${j}`
|
|
4184
4160
|
].filter(Boolean).join(" • ") || "—" }),
|
|
4185
4161
|
/* @__PURE__ */ a("div", { className: "mt-1 text-xl font-semibold text-gray-900", children: E ? (
|
|
4186
4162
|
// ? formatCurrency(Number(unitPrice) || 0, CURRENCY_PREF)
|
|
4187
4163
|
`$${r.price}`
|
|
4188
4164
|
) : "Currently unavailable" }),
|
|
4189
|
-
E && !
|
|
4165
|
+
E && !M && /* @__PURE__ */ a("div", { className: "mt-1 text-xs font-medium text-red-600", children: "Currently out of stock" })
|
|
4190
4166
|
] })
|
|
4191
4167
|
] }) });
|
|
4192
|
-
},
|
|
4168
|
+
}, Gr = ({
|
|
4193
4169
|
showSubmit: u = !0
|
|
4194
4170
|
}) => {
|
|
4195
4171
|
const m = {};
|
|
4196
|
-
|
|
4172
|
+
Rt.map((w) => gt(w.variant)).filter((w) => !!w && !m[w] && (m[w] = !0));
|
|
4197
4173
|
const f = {};
|
|
4198
|
-
return
|
|
4174
|
+
return Rt.map((w) => wt(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: [
|
|
4199
4175
|
/* @__PURE__ */ a("h3", { className: "font-semibold text-gray-800", children: "Choose a variant" }),
|
|
4200
4176
|
/* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4201
4177
|
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
4202
4178
|
/* @__PURE__ */ a("div", { className: "text-sm font-bold", children: "Color :" }),
|
|
4203
4179
|
C && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: C })
|
|
4204
4180
|
] }),
|
|
4205
|
-
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: y.map((w,
|
|
4206
|
-
const
|
|
4181
|
+
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-4 mt-2", children: y.map((w, v) => {
|
|
4182
|
+
const j = w.name, H = C === j, E = w.images.large[0].disBaseLink || w.images.large[0].link;
|
|
4207
4183
|
return /* @__PURE__ */ a(
|
|
4208
4184
|
"div",
|
|
4209
4185
|
{
|
|
@@ -4213,43 +4189,43 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4213
4189
|
"button",
|
|
4214
4190
|
{
|
|
4215
4191
|
onClick: () => {
|
|
4216
|
-
K(
|
|
4192
|
+
K(j), ye(null), _e(null), S(v);
|
|
4217
4193
|
},
|
|
4218
4194
|
className: "w-full h-20 flex items-center justify-center overflow-hidden",
|
|
4219
|
-
title:
|
|
4195
|
+
title: j,
|
|
4220
4196
|
children: E ? /* @__PURE__ */ a(
|
|
4221
4197
|
"img",
|
|
4222
4198
|
{
|
|
4223
4199
|
src: E,
|
|
4224
|
-
alt:
|
|
4200
|
+
alt: j,
|
|
4225
4201
|
className: "w/full h-full object-contain"
|
|
4226
4202
|
}
|
|
4227
|
-
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs px-1", children:
|
|
4203
|
+
) : /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center text-xs px-1", children: j })
|
|
4228
4204
|
}
|
|
4229
4205
|
)
|
|
4230
4206
|
},
|
|
4231
|
-
|
|
4207
|
+
j
|
|
4232
4208
|
);
|
|
4233
4209
|
}) })
|
|
4234
4210
|
] }),
|
|
4235
4211
|
C && /* @__PURE__ */ d("div", { className: "mt-4", children: [
|
|
4236
4212
|
/* @__PURE__ */ d("div", { className: "flex items-baseline gap-2", children: [
|
|
4237
4213
|
/* @__PURE__ */ a("div", { className: "text-sm font-bold", children: "Size :" }),
|
|
4238
|
-
|
|
4214
|
+
re && /* @__PURE__ */ a("div", { className: "text-sm text-gray-600", children: re })
|
|
4239
4215
|
] }),
|
|
4240
4216
|
/* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2 mt-2", children: (() => {
|
|
4241
4217
|
const w = y.find(
|
|
4242
|
-
(
|
|
4218
|
+
(v) => v.name === C
|
|
4243
4219
|
);
|
|
4244
|
-
return w ? w.variants.map((
|
|
4245
|
-
const H =
|
|
4220
|
+
return w ? w.variants.map((v, j) => {
|
|
4221
|
+
const H = v.name;
|
|
4246
4222
|
return /* @__PURE__ */ a(
|
|
4247
4223
|
"button",
|
|
4248
4224
|
{
|
|
4249
4225
|
onClick: () => {
|
|
4250
|
-
ye(H),
|
|
4226
|
+
ye(H), _e(j), po(v.productId);
|
|
4251
4227
|
},
|
|
4252
|
-
className: `px-4 py-2 rounded-md border text-sm ${
|
|
4228
|
+
className: `px-4 py-2 rounded-md border text-sm ${re === H ? "border-2 border-[#804c9e] font-semibold" : "border-gray-300"}`,
|
|
4253
4229
|
title: H,
|
|
4254
4230
|
children: H
|
|
4255
4231
|
},
|
|
@@ -4263,17 +4239,17 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4263
4239
|
{
|
|
4264
4240
|
onClick: Co,
|
|
4265
4241
|
className: "px-6 py-2.5 rounded-full font-semibold text-white shadow-md",
|
|
4266
|
-
style: { background:
|
|
4242
|
+
style: { background: Le },
|
|
4267
4243
|
disabled: !Ft,
|
|
4268
4244
|
children: "Submit"
|
|
4269
4245
|
}
|
|
4270
4246
|
) })
|
|
4271
4247
|
] });
|
|
4272
|
-
},
|
|
4248
|
+
}, Xr = (u, m = !0) => {
|
|
4273
4249
|
!(u != null && u.extractedDetails) && u && (u = { extractedDetails: u });
|
|
4274
4250
|
const f = (u == null ? void 0 : u.extractedDetails) || X;
|
|
4275
4251
|
if (!f) return null;
|
|
4276
|
-
const w = Et(f), { currency:
|
|
4252
|
+
const w = Et(f), { currency: v } = Zt(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), T = (f == null ? void 0 : f.currency) || v || ct, le = N != null && N.sku ? N.sku : f.product_id;
|
|
4277
4253
|
return /* @__PURE__ */ d(
|
|
4278
4254
|
"div",
|
|
4279
4255
|
{
|
|
@@ -4291,26 +4267,26 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4291
4267
|
/* @__PURE__ */ d("div", { className: "w-full max-w-md bg-white rounded-xl shadow-inner p-4", children: [
|
|
4292
4268
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-2 gap-y-2 text-sm", children: [
|
|
4293
4269
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "SKU:" }),
|
|
4294
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4270
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: le }),
|
|
4295
4271
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Quantity:" }),
|
|
4296
4272
|
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Et(f) }),
|
|
4297
4273
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Currency:" }),
|
|
4298
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4274
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: T }),
|
|
4299
4275
|
/* @__PURE__ */ a("p", { className: "font-semibold text-gray-600", children: "Maximum Total Price:" }),
|
|
4300
|
-
/* @__PURE__ */ a("p", { className: "text-gray-800", children:
|
|
4276
|
+
/* @__PURE__ */ a("p", { className: "text-gray-800", children: Qe(M, T) })
|
|
4301
4277
|
] }),
|
|
4302
4278
|
/* @__PURE__ */ d("div", { className: "mt-3 flex flex-wrap gap-2 text-xs", children: [
|
|
4303
|
-
gt(
|
|
4279
|
+
gt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4304
4280
|
"Color: ",
|
|
4305
|
-
gt(
|
|
4281
|
+
gt(N)
|
|
4306
4282
|
] }),
|
|
4307
|
-
wt(
|
|
4283
|
+
wt(N) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4308
4284
|
"Size: ",
|
|
4309
|
-
wt(
|
|
4285
|
+
wt(N)
|
|
4310
4286
|
] }),
|
|
4311
|
-
(
|
|
4287
|
+
(N == null ? void 0 : N.sku) && /* @__PURE__ */ d("span", { className: "rounded-full bg-gray-100 px-2 py-1", children: [
|
|
4312
4288
|
"SKU: ",
|
|
4313
|
-
|
|
4289
|
+
N.sku
|
|
4314
4290
|
] })
|
|
4315
4291
|
] })
|
|
4316
4292
|
] }),
|
|
@@ -4331,13 +4307,13 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4331
4307
|
/* @__PURE__ */ d(
|
|
4332
4308
|
"button",
|
|
4333
4309
|
{
|
|
4334
|
-
onClick:
|
|
4310
|
+
onClick: _o,
|
|
4335
4311
|
disabled: W,
|
|
4336
4312
|
className: `relative inline-flex items-center justify-center px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${W ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4337
|
-
style: { background:
|
|
4313
|
+
style: { background: Le },
|
|
4338
4314
|
children: [
|
|
4339
4315
|
/* @__PURE__ */ a(
|
|
4340
|
-
|
|
4316
|
+
ce,
|
|
4341
4317
|
{
|
|
4342
4318
|
icon: "fluent:checkmark-circle-24-filled",
|
|
4343
4319
|
className: "mr-2",
|
|
@@ -4352,13 +4328,13 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4352
4328
|
/* @__PURE__ */ d(
|
|
4353
4329
|
"button",
|
|
4354
4330
|
{
|
|
4355
|
-
onClick:
|
|
4331
|
+
onClick: Qr,
|
|
4356
4332
|
disabled: W,
|
|
4357
4333
|
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"}`,
|
|
4358
|
-
style: { borderColor:
|
|
4334
|
+
style: { borderColor: Le, color: Le },
|
|
4359
4335
|
children: [
|
|
4360
4336
|
/* @__PURE__ */ a(
|
|
4361
|
-
|
|
4337
|
+
ce,
|
|
4362
4338
|
{
|
|
4363
4339
|
icon: "fluent:dismiss-circle-24-filled",
|
|
4364
4340
|
className: "mr-2",
|
|
@@ -4375,23 +4351,23 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4375
4351
|
]
|
|
4376
4352
|
}
|
|
4377
4353
|
);
|
|
4378
|
-
},
|
|
4379
|
-
var
|
|
4380
|
-
const f = u || {}, w = ((
|
|
4354
|
+
}, Zr = (u, m = !0) => {
|
|
4355
|
+
var ht, at, He, Me, ge, st;
|
|
4356
|
+
const f = u || {}, w = ((ht = f == null ? void 0 : f.summary) == null ? void 0 : ht.currency) || (X == null ? void 0 : X.currency) || ct, v = Tn(r, N), j = An(r), H = N != null && N.sku ? N.sku : (r == null ? void 0 : r.id) ?? (X == null ? void 0 : X.product_id), E = (N == null ? void 0 : N.sku) ?? ei(r), M = gt(N) || ti(r), T = wt(N) || ri(r), le = Et(f), Pe = ((at = f == null ? void 0 : f.summary) == null ? void 0 : at.product_total) != null ? +f.summary.product_total : Yr(f), ze = le > 0 ? +(Pe / le).toFixed(2) : 0, De = Pe, ot = ((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) ?? (((ge = yt[pe]) == null ? void 0 : ge.fee) || 0), Ee = f != null && f.address ? [
|
|
4381
4357
|
f.address.addressLine1,
|
|
4382
4358
|
f.address.addressLine2,
|
|
4383
4359
|
f.address.street,
|
|
4384
4360
|
[f.address.city, f.address.state, f.address.postalCode].filter(Boolean).join(", "),
|
|
4385
4361
|
f.address.country
|
|
4386
|
-
].filter(Boolean).map((Ht) =>
|
|
4362
|
+
].filter(Boolean).map((Ht) => We(String(Ht))).join(", ") : "—", Ke = (f == null ? void 0 : f.payment) || "card", mt = Ke === "card" ? /* @__PURE__ */ d(ke, { children: [
|
|
4387
4363
|
"Credit Card — Mastercard",
|
|
4388
4364
|
/* @__PURE__ */ a("br", {}),
|
|
4389
4365
|
"•••• 7820 Exp: 12/26"
|
|
4390
|
-
] }) : /* @__PURE__ */ a(ke, { children:
|
|
4366
|
+
] }) : /* @__PURE__ */ a(ke, { children: We(Ke) });
|
|
4391
4367
|
return /* @__PURE__ */ d("div", { className: "mx-auto mt-3 mb-3 rounded-2xl bg-white", children: [
|
|
4392
4368
|
/* @__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: [
|
|
4393
4369
|
/* @__PURE__ */ a(
|
|
4394
|
-
|
|
4370
|
+
ce,
|
|
4395
4371
|
{
|
|
4396
4372
|
icon: "mdi:receipt-text-check-outline",
|
|
4397
4373
|
width: "24",
|
|
@@ -4401,15 +4377,15 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4401
4377
|
"All set! Here’s what your smart order looks like 🧾"
|
|
4402
4378
|
] }) }),
|
|
4403
4379
|
/* @__PURE__ */ a("div", { className: "px-6 pb-4", children: /* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-12 gap-4 rounded-xl border border-gray-200 bg-gray-50 p-3", children: [
|
|
4404
|
-
/* @__PURE__ */ a("div", { className: "sm:col-span-2 flex", children: /* @__PURE__ */ a("div", { className: "w-30 h-26 sm:w-30 sm:h-26 overflow-hidden rounded-lg bg-white border border-gray-200 flex items-center justify-center mx-auto sm:mx-0", children:
|
|
4380
|
+
/* @__PURE__ */ a("div", { className: "sm:col-span-2 flex", children: /* @__PURE__ */ a("div", { className: "w-30 h-26 sm:w-30 sm:h-26 overflow-hidden rounded-lg bg-white border border-gray-200 flex items-center justify-center mx-auto sm:mx-0", children: v ? /* @__PURE__ */ a(
|
|
4405
4381
|
"img",
|
|
4406
4382
|
{
|
|
4407
|
-
src:
|
|
4408
|
-
alt:
|
|
4383
|
+
src: v,
|
|
4384
|
+
alt: j,
|
|
4409
4385
|
className: "w-full h-full object-contain"
|
|
4410
4386
|
}
|
|
4411
4387
|
) : /* @__PURE__ */ a(
|
|
4412
|
-
|
|
4388
|
+
ce,
|
|
4413
4389
|
{
|
|
4414
4390
|
icon: "mdi:image-outline",
|
|
4415
4391
|
width: "24",
|
|
@@ -4418,44 +4394,44 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4418
4394
|
) }) }),
|
|
4419
4395
|
/* @__PURE__ */ d("div", { className: "sm:col-span-10", children: [
|
|
4420
4396
|
/* @__PURE__ */ d("div", { className: "mb-3", children: [
|
|
4421
|
-
/* @__PURE__ */ a("div", { className: "text-lg text-center font-bold text-gray-900", children:
|
|
4397
|
+
/* @__PURE__ */ a("div", { className: "text-lg text-center font-bold text-gray-900", children: j }),
|
|
4422
4398
|
/* @__PURE__ */ d("div", { className: "text-xs text-center font-bold text-gray-600", children: [
|
|
4423
4399
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
|
|
4424
4400
|
" ",
|
|
4425
4401
|
H ?? "—"
|
|
4426
4402
|
] }),
|
|
4427
|
-
(E ||
|
|
4403
|
+
(E || M || T) && /* @__PURE__ */ d("div", { className: "text-xs text-gray-600 mt-0.5 text-center", children: [
|
|
4428
4404
|
E && /* @__PURE__ */ d(ke, { children: [
|
|
4429
4405
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "SKU:" }),
|
|
4430
4406
|
" ",
|
|
4431
4407
|
E,
|
|
4432
4408
|
" "
|
|
4433
4409
|
] }),
|
|
4434
|
-
|
|
4410
|
+
M && /* @__PURE__ */ d(ke, { children: [
|
|
4435
4411
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "Color:" }),
|
|
4436
4412
|
" ",
|
|
4437
|
-
|
|
4413
|
+
M,
|
|
4438
4414
|
" "
|
|
4439
4415
|
] }),
|
|
4440
|
-
|
|
4416
|
+
T && /* @__PURE__ */ d(ke, { children: [
|
|
4441
4417
|
/* @__PURE__ */ a("span", { className: "font-medium", children: "Size:" }),
|
|
4442
4418
|
" ",
|
|
4443
|
-
|
|
4419
|
+
T
|
|
4444
4420
|
] })
|
|
4445
4421
|
] })
|
|
4446
4422
|
] }),
|
|
4447
4423
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 md-grid-cols-3 md:grid-cols-3 gap-3", children: [
|
|
4448
4424
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4449
4425
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Unit Price" }),
|
|
4450
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4426
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Qe(ze, w) })
|
|
4451
4427
|
] }),
|
|
4452
4428
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4453
4429
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Quantity" }),
|
|
4454
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4430
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: le })
|
|
4455
4431
|
] }),
|
|
4456
4432
|
/* @__PURE__ */ d("div", { className: "flex flex-col items-center rounded-xl border border-gray-200 bg-white p-3 text-center", children: [
|
|
4457
4433
|
/* @__PURE__ */ a("div", { className: "text-[11px] uppercase tracking-wide text-gray-500", children: "Subtotal" }),
|
|
4458
|
-
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children:
|
|
4434
|
+
/* @__PURE__ */ a("div", { className: "mt-0.5 text-base font-bold text-gray-900", children: Qe(De, w) })
|
|
4459
4435
|
] })
|
|
4460
4436
|
] })
|
|
4461
4437
|
] })
|
|
@@ -4478,15 +4454,15 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4478
4454
|
/* @__PURE__ */ d("div", { className: "grid grid-cols-1 sm:grid-cols-3 gap-3", children: [
|
|
4479
4455
|
/* @__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: [
|
|
4480
4456
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "💰 any(s)" }),
|
|
4481
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4457
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(Pe, w) })
|
|
4482
4458
|
] }),
|
|
4483
4459
|
/* @__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: [
|
|
4484
4460
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🏛️ Taxes" }),
|
|
4485
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4461
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(ot, w) })
|
|
4486
4462
|
] }),
|
|
4487
4463
|
/* @__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: [
|
|
4488
4464
|
/* @__PURE__ */ a("div", { className: "text-xs uppercase tracking-wide text-gray-500", children: "🚚 Shipping" }),
|
|
4489
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children:
|
|
4465
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-2xl font-bold text-gray-900", children: Qe(Fe, w) })
|
|
4490
4466
|
] })
|
|
4491
4467
|
] }),
|
|
4492
4468
|
/* @__PURE__ */ d(
|
|
@@ -4496,19 +4472,19 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4496
4472
|
style: { background: Ut },
|
|
4497
4473
|
children: [
|
|
4498
4474
|
/* @__PURE__ */ a("div", { className: "text-sm/5 opacity-95", children: "🔹 Total Payable" }),
|
|
4499
|
-
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children:
|
|
4475
|
+
/* @__PURE__ */ a("div", { className: "mt-1 text-3xl font-extrabold tracking-tight", children: Qe(Pe + ot + Fe, w) })
|
|
4500
4476
|
]
|
|
4501
4477
|
}
|
|
4502
4478
|
)
|
|
4503
4479
|
] }),
|
|
4504
4480
|
!m && /* @__PURE__ */ d("div", { className: "px-6 pb-5", children: [
|
|
4505
4481
|
!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?" }),
|
|
4506
|
-
F &&
|
|
4507
|
-
|
|
4482
|
+
F && Hr({ intentMandateId: Ct }),
|
|
4483
|
+
$e && !F && /* @__PURE__ */ d("div", { className: "mt-4 flex flex-wrap items-center justify-center gap-3", children: [
|
|
4508
4484
|
/* @__PURE__ */ a(
|
|
4509
4485
|
"button",
|
|
4510
4486
|
{
|
|
4511
|
-
onClick:
|
|
4487
|
+
onClick: jo,
|
|
4512
4488
|
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",
|
|
4513
4489
|
style: { background: Ut },
|
|
4514
4490
|
children: "Confirm"
|
|
@@ -4517,7 +4493,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4517
4493
|
/* @__PURE__ */ a(
|
|
4518
4494
|
"button",
|
|
4519
4495
|
{
|
|
4520
|
-
onClick:
|
|
4496
|
+
onClick: Qr,
|
|
4521
4497
|
className: "inline-flex items-center justify-center rounded-full border px-6 py-2.5 font-semibold hover:bg-gray-50",
|
|
4522
4498
|
style: { borderColor: Ut, color: Ut },
|
|
4523
4499
|
children: "Cancel"
|
|
@@ -4534,7 +4510,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4534
4510
|
u.street,
|
|
4535
4511
|
[u.city, u.state, u.postalCode].filter(Boolean).join(", "),
|
|
4536
4512
|
u.country
|
|
4537
|
-
].filter((f) => !!f).map((f) =>
|
|
4513
|
+
].filter((f) => !!f).map((f) => We(f)).join(", ");
|
|
4538
4514
|
return /* @__PURE__ */ a(
|
|
4539
4515
|
"div",
|
|
4540
4516
|
{
|
|
@@ -4542,7 +4518,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4542
4518
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4543
4519
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4544
4520
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-2", children: [
|
|
4545
|
-
/* @__PURE__ */ a(
|
|
4521
|
+
/* @__PURE__ */ a(ce, { icon: "mdi:home-map-marker", width: "20", color: ft }),
|
|
4546
4522
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Address" })
|
|
4547
4523
|
] }),
|
|
4548
4524
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: m })
|
|
@@ -4558,12 +4534,12 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4558
4534
|
style: { backgroundColor: "var(--tanya-light)" },
|
|
4559
4535
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4560
4536
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4561
|
-
/* @__PURE__ */ a(
|
|
4537
|
+
/* @__PURE__ */ a(ce, { icon: "mdi:truck-delivery", width: "20", color: ft }),
|
|
4562
4538
|
/* @__PURE__ */ a("div", { className: "font-semibold text-gray-800", children: "Delivery Method" })
|
|
4563
4539
|
] }),
|
|
4564
4540
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-800", children: f ? /* @__PURE__ */ d(ke, { children: [
|
|
4565
4541
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4566
|
-
/* @__PURE__ */ a(
|
|
4542
|
+
/* @__PURE__ */ a(ce, { icon: f.icon, width: "18" }),
|
|
4567
4543
|
/* @__PURE__ */ a("span", { className: "font-medium", children: f.label })
|
|
4568
4544
|
] }),
|
|
4569
4545
|
/* @__PURE__ */ a("div", { className: "text-gray-600", children: f.subtitle })
|
|
@@ -4581,7 +4557,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4581
4557
|
children: /* @__PURE__ */ d("div", { className: "rounded-xl border border-gray-200 bg-white p-4", children: [
|
|
4582
4558
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2 mb-1", children: [
|
|
4583
4559
|
/* @__PURE__ */ a(
|
|
4584
|
-
|
|
4560
|
+
ce,
|
|
4585
4561
|
{
|
|
4586
4562
|
icon: "mdi:credit-card-outline",
|
|
4587
4563
|
width: "20",
|
|
@@ -4594,17 +4570,17 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4594
4570
|
"Credit Card — Mastercard",
|
|
4595
4571
|
/* @__PURE__ */ a("br", {}),
|
|
4596
4572
|
"•••• 7820 Exp: 12/26"
|
|
4597
|
-
] }) :
|
|
4573
|
+
] }) : We(m) })
|
|
4598
4574
|
] })
|
|
4599
4575
|
}
|
|
4600
4576
|
);
|
|
4601
4577
|
}, Mo = (u, m) => {
|
|
4602
4578
|
const f = u.snapshotStage;
|
|
4603
|
-
if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" &&
|
|
4579
|
+
if (!f || f === "address" && W || f === "delivery" && Ne || f === "payment" && ae || f === "final" && Nt)
|
|
4604
4580
|
return null;
|
|
4605
4581
|
switch (f) {
|
|
4606
4582
|
case "initial":
|
|
4607
|
-
return
|
|
4583
|
+
return Xr(u.snapshotPayload, !m);
|
|
4608
4584
|
case "address":
|
|
4609
4585
|
return Lo(u.snapshotPayload);
|
|
4610
4586
|
case "delivery":
|
|
@@ -4612,9 +4588,9 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4612
4588
|
case "payment":
|
|
4613
4589
|
return Do(u.snapshotPayload);
|
|
4614
4590
|
case "final":
|
|
4615
|
-
return
|
|
4591
|
+
return Zr(u.snapshotPayload, !m);
|
|
4616
4592
|
case "success":
|
|
4617
|
-
return
|
|
4593
|
+
return Hr(u.snapshotPayload);
|
|
4618
4594
|
default:
|
|
4619
4595
|
return null;
|
|
4620
4596
|
}
|
|
@@ -4646,7 +4622,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4646
4622
|
borderTopLeftRadius: "0.75rem",
|
|
4647
4623
|
borderBottomLeftRadius: "0.75rem",
|
|
4648
4624
|
padding: "0.25rem",
|
|
4649
|
-
background:
|
|
4625
|
+
background: Le
|
|
4650
4626
|
},
|
|
4651
4627
|
children: [
|
|
4652
4628
|
/* @__PURE__ */ d(
|
|
@@ -4692,7 +4668,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4692
4668
|
margin: "0.75rem"
|
|
4693
4669
|
},
|
|
4694
4670
|
children: /* @__PURE__ */ a(
|
|
4695
|
-
|
|
4671
|
+
ce,
|
|
4696
4672
|
{
|
|
4697
4673
|
icon: "fluent:dismiss-24-filled",
|
|
4698
4674
|
color: "#ffffff",
|
|
@@ -4729,11 +4705,11 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4729
4705
|
]
|
|
4730
4706
|
}
|
|
4731
4707
|
),
|
|
4732
|
-
/* @__PURE__ */ a($o, { selectedIndex:
|
|
4733
|
-
|
|
4734
|
-
|
|
4735
|
-
var
|
|
4736
|
-
const f = m ===
|
|
4708
|
+
/* @__PURE__ */ a($o, { selectedIndex: I }),
|
|
4709
|
+
q > 1 && /* @__PURE__ */ a(Gr, { showSubmit: !1 }),
|
|
4710
|
+
h.map((u, m) => {
|
|
4711
|
+
var v;
|
|
4712
|
+
const f = m === h.length - 1, w = !!u.snapshotStage;
|
|
4737
4713
|
return /* @__PURE__ */ d("div", { children: [
|
|
4738
4714
|
u.query && /* @__PURE__ */ a("div", { className: "flex justify-end", children: /* @__PURE__ */ a(
|
|
4739
4715
|
"p",
|
|
@@ -4746,7 +4722,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4746
4722
|
children: u.query
|
|
4747
4723
|
}
|
|
4748
4724
|
) }),
|
|
4749
|
-
u.response === "__TEXT__" && ((
|
|
4725
|
+
u.response === "__TEXT__" && ((v = u.snapshotPayload) == null ? void 0 : v.text) && /* @__PURE__ */ a("div", { className: "mt-2", children: /* @__PURE__ */ a(
|
|
4750
4726
|
"div",
|
|
4751
4727
|
{
|
|
4752
4728
|
className: "text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",
|
|
@@ -4757,14 +4733,14 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4757
4733
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ a("p", { children: u.snapshotPayload.text }) })
|
|
4758
4734
|
}
|
|
4759
4735
|
) }),
|
|
4760
|
-
f && ut &&
|
|
4736
|
+
f && ut && q > 1 && /* @__PURE__ */ d("div", { className: "mx-4 mt-2 rounded-xl border border-gray-200 bg-white p-4 animate-fade-in", children: [
|
|
4761
4737
|
/* @__PURE__ */ d("div", { className: "text-sm text-gray-800", children: [
|
|
4762
4738
|
"Proceed with color:",
|
|
4763
4739
|
" ",
|
|
4764
4740
|
/* @__PURE__ */ a("span", { className: "font-semibold", children: C || "—" }),
|
|
4765
4741
|
", size:",
|
|
4766
4742
|
" ",
|
|
4767
|
-
/* @__PURE__ */ a("span", { className: "font-semibold", children:
|
|
4743
|
+
/* @__PURE__ */ a("span", { className: "font-semibold", children: re || "—" }),
|
|
4768
4744
|
"?"
|
|
4769
4745
|
] }),
|
|
4770
4746
|
/* @__PURE__ */ d("div", { className: "mt-3 flex gap-3", children: [
|
|
@@ -4773,7 +4749,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4773
4749
|
{
|
|
4774
4750
|
onClick: So,
|
|
4775
4751
|
className: "px-5 py-2 rounded-full text-white font-semibold",
|
|
4776
|
-
style: { background:
|
|
4752
|
+
style: { background: Le },
|
|
4777
4753
|
children: "Yes"
|
|
4778
4754
|
}
|
|
4779
4755
|
),
|
|
@@ -4783,16 +4759,16 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4783
4759
|
onClick: No,
|
|
4784
4760
|
className: "px-5 py-2 rounded-full font-semibold border",
|
|
4785
4761
|
style: {
|
|
4786
|
-
borderColor:
|
|
4787
|
-
color:
|
|
4762
|
+
borderColor: Le,
|
|
4763
|
+
color: Le
|
|
4788
4764
|
},
|
|
4789
4765
|
children: "No, change SKU"
|
|
4790
4766
|
}
|
|
4791
4767
|
)
|
|
4792
4768
|
] })
|
|
4793
4769
|
] }),
|
|
4794
|
-
f && nt && /* @__PURE__ */ a(
|
|
4795
|
-
f &&
|
|
4770
|
+
f && nt && /* @__PURE__ */ a(Gr, { showSubmit: !0 }),
|
|
4771
|
+
f && Ie && /* @__PURE__ */ a("div", { className: "mt-4", children: /* @__PURE__ */ a(
|
|
4796
4772
|
"div",
|
|
4797
4773
|
{
|
|
4798
4774
|
className: "text-sm text-tanya-contrast px-7 py-4 rounded-r-xl rounded-bl-2xl w-full",
|
|
@@ -4803,7 +4779,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4803
4779
|
children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 tanya-pulse-text", children: /* @__PURE__ */ a("p", { children: "Reading your instruction and setting things up…" }) })
|
|
4804
4780
|
}
|
|
4805
4781
|
) }),
|
|
4806
|
-
(w || u.response === "__CARD__") && (!
|
|
4782
|
+
(w || u.response === "__CARD__") && (!Ie || !f) && /* @__PURE__ */ a(
|
|
4807
4783
|
"div",
|
|
4808
4784
|
{
|
|
4809
4785
|
className: "mt-6 mb-4 mx-4 animate-fade-in",
|
|
@@ -4813,7 +4789,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4813
4789
|
boxShadow: "0 2px 8px rgba(0,0,0,0.08)",
|
|
4814
4790
|
overflow: "hidden"
|
|
4815
4791
|
},
|
|
4816
|
-
children: w ? Mo(u, f) :
|
|
4792
|
+
children: w ? Mo(u, f) : Xr(
|
|
4817
4793
|
u.snapshotPayload,
|
|
4818
4794
|
!1
|
|
4819
4795
|
)
|
|
@@ -4825,7 +4801,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4825
4801
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4826
4802
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4827
4803
|
/* @__PURE__ */ a(
|
|
4828
|
-
|
|
4804
|
+
ce,
|
|
4829
4805
|
{
|
|
4830
4806
|
icon: "mdi:home-map-marker",
|
|
4831
4807
|
width: "24",
|
|
@@ -4861,13 +4837,13 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4861
4837
|
}
|
|
4862
4838
|
),
|
|
4863
4839
|
/* @__PURE__ */ a("p", { className: "ml-3 text-gray-600", children: "Fetching your addresses..." })
|
|
4864
|
-
] }) : (
|
|
4840
|
+
] }) : (U == null ? void 0 : U.length) > 0 ? /* @__PURE__ */ d(
|
|
4865
4841
|
"div",
|
|
4866
4842
|
{
|
|
4867
4843
|
className: `space-y-3 ${G ? "opacity-70" : ""}`,
|
|
4868
4844
|
children: [
|
|
4869
|
-
|
|
4870
|
-
const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((E) =>
|
|
4845
|
+
U.map((u) => {
|
|
4846
|
+
const m = [u.addressLine1, u.addressLine2].filter(Boolean).map((E) => We(E || "")).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;
|
|
4871
4847
|
return /* @__PURE__ */ d(
|
|
4872
4848
|
"label",
|
|
4873
4849
|
{
|
|
@@ -4882,8 +4858,8 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4882
4858
|
className: "mt-1 accent-tanya-light",
|
|
4883
4859
|
checked: H,
|
|
4884
4860
|
disabled: G,
|
|
4885
|
-
onChange: () =>
|
|
4886
|
-
value:
|
|
4861
|
+
onChange: () => oe(j),
|
|
4862
|
+
value: j
|
|
4887
4863
|
}
|
|
4888
4864
|
),
|
|
4889
4865
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
@@ -4893,19 +4869,19 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4893
4869
|
/* @__PURE__ */ a("br", {}),
|
|
4894
4870
|
w,
|
|
4895
4871
|
/* @__PURE__ */ a("br", {}),
|
|
4896
|
-
|
|
4872
|
+
v
|
|
4897
4873
|
] })
|
|
4898
4874
|
] })
|
|
4899
4875
|
]
|
|
4900
4876
|
},
|
|
4901
|
-
|
|
4877
|
+
j
|
|
4902
4878
|
);
|
|
4903
4879
|
}),
|
|
4904
4880
|
/* @__PURE__ */ d("div", { className: "flex justify-between pt-2", children: [
|
|
4905
4881
|
/* @__PURE__ */ a(
|
|
4906
4882
|
"button",
|
|
4907
4883
|
{
|
|
4908
|
-
onClick:
|
|
4884
|
+
onClick: Wr,
|
|
4909
4885
|
className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
|
|
4910
4886
|
style: {
|
|
4911
4887
|
borderColor: "var(--tanya-light)",
|
|
@@ -4917,10 +4893,10 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4917
4893
|
/* @__PURE__ */ a(
|
|
4918
4894
|
"button",
|
|
4919
4895
|
{
|
|
4920
|
-
onClick:
|
|
4896
|
+
onClick: Io,
|
|
4921
4897
|
disabled: G,
|
|
4922
4898
|
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${G ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
4923
|
-
style: { background:
|
|
4899
|
+
style: { background: Le },
|
|
4924
4900
|
children: G ? "Address Submitted" : "Submit Address"
|
|
4925
4901
|
}
|
|
4926
4902
|
)
|
|
@@ -4933,7 +4909,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4933
4909
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
4934
4910
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
4935
4911
|
/* @__PURE__ */ a(
|
|
4936
|
-
|
|
4912
|
+
ce,
|
|
4937
4913
|
{
|
|
4938
4914
|
icon: "mdi:truck-delivery",
|
|
4939
4915
|
width: "24",
|
|
@@ -4964,9 +4940,9 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4964
4940
|
"div",
|
|
4965
4941
|
{
|
|
4966
4942
|
className: `space-y-3 ${ee ? "opacity-70" : ""}`,
|
|
4967
|
-
children: Object.keys(
|
|
4943
|
+
children: Object.keys(A).map(
|
|
4968
4944
|
(u) => {
|
|
4969
|
-
const m = yt[u], f =
|
|
4945
|
+
const m = yt[u], f = pe === u;
|
|
4970
4946
|
return /* @__PURE__ */ d(
|
|
4971
4947
|
"label",
|
|
4972
4948
|
{
|
|
@@ -4981,18 +4957,18 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
4981
4957
|
className: "mt-1 accent-tanya-light",
|
|
4982
4958
|
checked: f,
|
|
4983
4959
|
disabled: ee,
|
|
4984
|
-
onChange: () =>
|
|
4960
|
+
onChange: () => _(u)
|
|
4985
4961
|
}
|
|
4986
4962
|
),
|
|
4987
4963
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
4988
4964
|
/* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
|
|
4989
|
-
/* @__PURE__ */ a(
|
|
4965
|
+
/* @__PURE__ */ a(ce, { icon: m.icon, width: "18" }),
|
|
4990
4966
|
" ",
|
|
4991
4967
|
m.label
|
|
4992
4968
|
] }),
|
|
4993
4969
|
/* @__PURE__ */ a("div", { className: "text-sm text-gray-700", children: m.subtitle })
|
|
4994
4970
|
] }),
|
|
4995
|
-
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: m.fee === 0 ? "Free" :
|
|
4971
|
+
/* @__PURE__ */ a("div", { className: "text-sm font-semibold text-gray-800", children: m.fee === 0 ? "Free" : Qe(
|
|
4996
4972
|
m.fee,
|
|
4997
4973
|
(X == null ? void 0 : X.currency) || ct
|
|
4998
4974
|
) })
|
|
@@ -5008,7 +4984,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5008
4984
|
/* @__PURE__ */ a(
|
|
5009
4985
|
"button",
|
|
5010
4986
|
{
|
|
5011
|
-
onClick:
|
|
4987
|
+
onClick: Wr,
|
|
5012
4988
|
className: "px-6 py-2.5 rounded-full font-semibold border transition-all hover:-translate-y-0.5 hover:shadow-sm",
|
|
5013
4989
|
style: {
|
|
5014
4990
|
borderColor: "var(--tanya-light)",
|
|
@@ -5023,17 +4999,17 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5023
4999
|
onClick: Fo,
|
|
5024
5000
|
disabled: ee,
|
|
5025
5001
|
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"}`,
|
|
5026
|
-
style: { background:
|
|
5002
|
+
style: { background: Le },
|
|
5027
5003
|
children: ee ? "Delivery Submitted" : "Submit Delivery Option"
|
|
5028
5004
|
}
|
|
5029
5005
|
)
|
|
5030
5006
|
] })
|
|
5031
5007
|
] }),
|
|
5032
|
-
|
|
5008
|
+
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: [
|
|
5033
5009
|
/* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
|
|
5034
5010
|
/* @__PURE__ */ d("h3", { className: "font-semibold text-lg text-gray-800 flex items-center gap-2", children: [
|
|
5035
5011
|
/* @__PURE__ */ a(
|
|
5036
|
-
|
|
5012
|
+
ce,
|
|
5037
5013
|
{
|
|
5038
5014
|
icon: "mdi:credit-card-outline",
|
|
5039
5015
|
width: "24",
|
|
@@ -5042,12 +5018,12 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5042
5018
|
),
|
|
5043
5019
|
"Almost done! 💳"
|
|
5044
5020
|
] }),
|
|
5045
|
-
|
|
5021
|
+
Oe && /* @__PURE__ */ d(ke, { children: [
|
|
5046
5022
|
/* @__PURE__ */ a("span", { className: "ml-2 text-xs px-2 py-1 rounded-full bg-green-100 text-green-700 font-semibold", children: "Selected" }),
|
|
5047
5023
|
!F && /* @__PURE__ */ a(
|
|
5048
5024
|
"button",
|
|
5049
5025
|
{
|
|
5050
|
-
onClick:
|
|
5026
|
+
onClick: Oo,
|
|
5051
5027
|
className: "ml-2 text-xs px-2 py-1 rounded-full border hover:bg-gray-50",
|
|
5052
5028
|
style: {
|
|
5053
5029
|
borderColor: "var(--tanya-light)",
|
|
@@ -5063,12 +5039,12 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5063
5039
|
/* @__PURE__ */ a(
|
|
5064
5040
|
"div",
|
|
5065
5041
|
{
|
|
5066
|
-
className: `space-y-3 ${
|
|
5042
|
+
className: `space-y-3 ${Oe ? "opacity-70" : ""}`,
|
|
5067
5043
|
children: /* @__PURE__ */ d(
|
|
5068
5044
|
"label",
|
|
5069
5045
|
{
|
|
5070
|
-
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${Ae === "card" ? "border-tanya-light" : "border-gray-300"} ${
|
|
5071
|
-
title:
|
|
5046
|
+
className: `flex items-start gap-3 p-4 border rounded-lg cursor-pointer transition hover:shadow-sm ${Ae === "card" ? "border-tanya-light" : "border-gray-300"} ${Oe ? "pointer-events-none" : ""}`,
|
|
5047
|
+
title: Oe ? "Payment already submitted" : "",
|
|
5072
5048
|
children: [
|
|
5073
5049
|
/* @__PURE__ */ a(
|
|
5074
5050
|
"input",
|
|
@@ -5077,13 +5053,13 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5077
5053
|
name: "payment",
|
|
5078
5054
|
className: "mt-1 accent-tanya-light",
|
|
5079
5055
|
checked: Ae === "card",
|
|
5080
|
-
disabled:
|
|
5056
|
+
disabled: Oe,
|
|
5081
5057
|
onChange: () => St("card")
|
|
5082
5058
|
}
|
|
5083
5059
|
),
|
|
5084
5060
|
/* @__PURE__ */ d("div", { className: "flex-1", children: [
|
|
5085
5061
|
/* @__PURE__ */ d("div", { className: "font-semibold text-gray-800 flex items-center gap-2", children: [
|
|
5086
|
-
/* @__PURE__ */ a(
|
|
5062
|
+
/* @__PURE__ */ a(ce, { icon: "mdi:credit-card-chip-outline", width: "18" }),
|
|
5087
5063
|
" ",
|
|
5088
5064
|
"Credit Card"
|
|
5089
5065
|
] }),
|
|
@@ -5115,15 +5091,15 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5115
5091
|
"button",
|
|
5116
5092
|
{
|
|
5117
5093
|
onClick: To,
|
|
5118
|
-
disabled:
|
|
5119
|
-
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${
|
|
5094
|
+
disabled: Oe,
|
|
5095
|
+
className: `px-6 py-2.5 rounded-full font-semibold text-white shadow-md transition-all duration-300 ${Oe ? "opacity-60 cursor-not-allowed" : "hover:-translate-y-0.5 hover:shadow-lg"}`,
|
|
5120
5096
|
style: { background: "var(--tanya)" },
|
|
5121
|
-
children:
|
|
5097
|
+
children: Oe ? "Payment Submitted" : "Submit Payment Method"
|
|
5122
5098
|
}
|
|
5123
5099
|
)
|
|
5124
5100
|
] })
|
|
5125
5101
|
] }),
|
|
5126
|
-
Nt &&
|
|
5102
|
+
Nt && Zr(
|
|
5127
5103
|
{
|
|
5128
5104
|
...X,
|
|
5129
5105
|
address: JSON.parse(
|
|
@@ -5131,7 +5107,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5131
5107
|
),
|
|
5132
5108
|
delivery: localStorage.getItem("agentic_order_delivery"),
|
|
5133
5109
|
payment: localStorage.getItem("agentic_order_payment"),
|
|
5134
|
-
summary:
|
|
5110
|
+
summary: Jr(X == null ? void 0 : X.currency)
|
|
5135
5111
|
},
|
|
5136
5112
|
!1
|
|
5137
5113
|
)
|
|
@@ -5148,7 +5124,7 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5148
5124
|
${Ft ? "" : "placeholder:text-red-400 text-red-500"}`,
|
|
5149
5125
|
value: z,
|
|
5150
5126
|
onKeyDown: (u) => {
|
|
5151
|
-
u.key === "Enter" && !
|
|
5127
|
+
u.key === "Enter" && !Ie && !Se && Kr();
|
|
5152
5128
|
},
|
|
5153
5129
|
onChange: (u) => Te(u.target.value)
|
|
5154
5130
|
}
|
|
@@ -5157,18 +5133,18 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5157
5133
|
"button",
|
|
5158
5134
|
{
|
|
5159
5135
|
type: "submit",
|
|
5160
|
-
disabled:
|
|
5136
|
+
disabled: Ie || Se,
|
|
5161
5137
|
className: "mr-6 font-medium",
|
|
5162
5138
|
style: { color: "var(--tanya-light)" },
|
|
5163
|
-
onClick: () =>
|
|
5164
|
-
children:
|
|
5139
|
+
onClick: () => Kr(),
|
|
5140
|
+
children: Ie ? /* @__PURE__ */ a(
|
|
5165
5141
|
"div",
|
|
5166
5142
|
{
|
|
5167
5143
|
className: "m-3 animate-spin rounded-full h-6 w-6 border-b-2",
|
|
5168
5144
|
style: { borderBottom: "2px solid" }
|
|
5169
5145
|
}
|
|
5170
5146
|
) : /* @__PURE__ */ a(
|
|
5171
|
-
|
|
5147
|
+
ce,
|
|
5172
5148
|
{
|
|
5173
5149
|
icon: "fluent:send-48-filled",
|
|
5174
5150
|
color: "var(--tanya-light)",
|
|
@@ -5187,8 +5163,8 @@ const ct = "USD", Ws = (e, t = ct) => {
|
|
|
5187
5163
|
);
|
|
5188
5164
|
};
|
|
5189
5165
|
export {
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5166
|
+
vi as AgenticShoppingButton,
|
|
5167
|
+
bi as TanyaChatbot,
|
|
5168
|
+
pi as TanyaChatbotProvider
|
|
5193
5169
|
};
|
|
5194
5170
|
//# sourceMappingURL=tanya-chatbot.es.js.map
|