1(self.webpackChunkBCCheckoutBar=self.webpackChunkBCCheckoutBar||[]).push([[625],{26055(e,t,n){"use strict";n.r(t),n.d(t,{ConciergeButton:()=>Cp,useConciergeWidget:()=>tp.T});var r=n(42056),o=n(42391),i=n(52165),a=n(80979);var l=n(80596),s=n(21521),c=n(39577),d=n(72817),u=n(94660),p=n(74690),g=n(90),f=n(29424);const h=e=>Object.fromEntries((null!=e?e:[]).map(e=>[e.name,e.value]));var m=n(51729);function v(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?v(Object(n),!0).forEach(function(t){x(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function x(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const b=()=>(0,m.e5)(),w=new class{constructor(){this.productCache=new Map,this.productInflight=new Map}async fetchByStacklineSku(e){let{stacklineSku:t,headersToInject:n,apiBaseUrl:r=b()}=e;try{const e=y(y({},n),{},{"Content-Type":"application/json"}),o=await fetch("".concat(r,"/api-rewards/product/").concat(t),{method:"GET",headers:e});if(!o.ok){if(404===o.status)return null;throw new Error("Failed to fetch product: ".concat(o.status))}const i=await o.json();return i.product||i}catch(e){return console.error("Error fetching product by stacklineSku:",e),null}}async fetchV2ByStacklineSku(e){let{stacklineSku:t,headersToInject:n,apiBaseUrl:r=b()}=e;var o,i,a,l;try{var s;const e=y(y({},n),{},{"Content-Type":"application/json"}),c="\n query ConciergePinnedProductV2($stacklineSku: String!) {\n productV2(stacklineSku: $stacklineSku) {\n stacklineSku\n title\n imageUrl\n imageUrls\n reviewSummary {\n averageRating\n reviewCount\n }\n }\n }\n ",d=await fetch("".concat(r.replace(/\/+$/,""),"/api-rewards/graphql?id=ConciergePinnedProductV2"),{method:"POST",headers:e,body:JSON.stringify({query:c,variables:{stacklineSku:t}})});if(!d.ok)throw new Error("Failed to fetch product V2: ".concat(d.status));const u=await d.json(),p=null==(o=null==u?void 0:u.data)?void 0:o.productV2;return p?y(y({},p),{},{imageUrls:null!==(s=p.imageUrls)&&void 0!==s?s:p.imageUrl?[p.imageUrl]:[],reviewsRating:null==(i=p.reviewSummary)?void 0:i.averageRating,reviewsAverageRating:null==(a=p.reviewSummary)?void 0:a.averageRating,reviewsCount:null==(l=p.reviewSummary)?void 0:l.reviewCount}):null}catch(e){return console.error("Error fetching product V2 by stacklineSku:",e),null}}async fetchWithVariants(e){let{stacklineSku:t,headersToInject:n,apiBaseUrl:r=b()}=e;var o;try{const e=y(y({},n),{},{"Content-Type":"application/json"}),i="\n query ConciergeProductDetailV2($stacklineSku: String!) {\n productV2(stacklineSku: $stacklineSku) {\n ".concat("\n stacklineSku\n parentStacklineSku\n catalogSku\n title\n imageUrl\n imageUrls\n brandId\n brandName\n retailPrice\n compareAtPrice\n retailerId\n retailerSku\n retailerName\n retailerProductPageUrl\n isAvailable\n checkoutEligible\n whereToBuyFallback\n whereToBuyOfferRetailerIds\n featureBullets\n description\n rewardAmount\n reviewSummary {\n averageRating\n reviewCount\n }\n variantOptions {\n name\n value\n }\n variants {\n stacklineSku\n title\n retailPrice\n compareAtPrice\n imageUrl\n retailerProductPageUrl\n featureBullets\n isAvailable\n availabilityStatus\n checkoutEligible\n whereToBuyFallback\n whereToBuyOfferRetailerIds\n options {\n name\n value\n }\n variantPosition\n offers {\n stacklineSku\n retailerId\n retailerSku\n retailerName\n retailPrice\n compareAtPrice\n retailerProductPageUrl\n imageUrls\n isPrimary\n rewardAmount\n }\n }\n offers {\n stacklineSku\n retailerId\n retailerSku\n retailerName\n retailPrice\n compareAtPrice\n retailerProductPageUrl\n imageUrls\n isPrimary\n rewardAmount\n }\n","\n }\n }\n "),a=await fetch("".concat(r.replace(/\/+$/,""),"/api-rewards/graphql?id=ConciergeProductDetailV2"),{method:"POST",headers:e,body:JSON.stringify({query:i,variables:{stacklineSku:t}})});if(!a.ok)throw new Error("Failed to fetch product with variants: ".concat(a.status));const l=await a.json(),s=null==(o=null==l?void 0:l.data)?void 0:o.productV2;return s?this.mapDetail(s):null}catch(e){return console.error("Error fetching product with variants:",e),null}}getCachedWithVariants(e,t){return this.productCache.get(this.productCacheKey(e,t))}fetchWithVariantsCached(e){const t=this.productCacheKey(e.stacklineSku,e.apiBaseUrl),n=this.productCache.get(t);if(n)return Promise.resolve(n);const r=this.productInflight.get(t);if(r)return r;const o=this.fetchWithVariants(e).then(e=>(this.productInflight.delete(t),e&&this.productCache.set(t,e),e));return this.productInflight.set(t,o),o}prefetchWithVariants(e){this.fetchWithVariantsCached(e).catch(()=>{})}mapDetail(e){var t,n,r,o,i,a,l,s;const c=(null!==(t=e.variants)&&void 0!==t?t:[]).map(e=>y(y({},e),{},{variationNameValues:h(e.options)})),d=h(e.variantOptions),u=(null!==(n=e.offers)&&void 0!==n?n:[]).map(e=>e.rewardAmount).filter(e=>"number"==typeof e),p=Math.max(null!==(r=e.rewardAmount)&&void 0!==r?r:0,...u,0),g=null!==(o=e.retailPrice)&&void 0!==o?o:0,f=e.compareAtPrice,m="number"==typeof f&&f>g?{isActive:!0,promoPrice:g,listPrice:f,discountPercentage:(f-g)/f,discountAmount:f-g,promoType:"",updatedTime:"","@promoUpdatedTime":""}:void 0;return y(y({},e),{},{imageUrls:null!==(i=e.imageUrls)&&void 0!==i?i:e.imageUrl?[e.imageUrl]:[],reviewsRating:null==(a=e.reviewSummary)?void 0:a.averageRating,reviewsAverageRating:null==(l=e.reviewSummary)?void 0:l.averageRating,reviewsCount:null==(s=e.reviewSummary)?void 0:s.reviewCount,totalRewardAmount:p,hasRew
1ards:p>0,variants:c,variationNameValues:d,activeProductPromotion:m})}productCacheKey(e,t){return"".concat(null!=t?t:"","|").concat(e)}};var A=n(70851);const C=(0,n(98807).zu)({prefix:"tw:"});function j(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return C((0,A.$)(t))}var S=n(33224);const k=["className"],O=["className"],I=["className"];function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function E(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach(function(t){V(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function V(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function F(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const B=e=>{let{className:t}=e,n=F(e,k);return(0,l.jsx)(S.z,E({className:j("tw:relative tw:flex-1 tw:overflow-hidden",t),initial:"smooth",resize:"smooth",role:"log","aria-live":"off"},n))},L=e=>{let{className:t}=e,n=F(e,O);return(0,l.jsx)(S.z.Content,E({className:j("tw:p-4",t)},n))},R=e=>{let{className:t}=e,n=F(e,I);const{isAtBottom:o,scrollToBottom:i}=(0,S.B)(),a=(0,r.useCallback)(()=>{i()},[i]);return o?null:(0,l.jsx)("button",E(E({className:j("tw:absolute tw:bottom-4 tw:left-1/2 tw:-translate-x-1/2 tw:z-10 tw:hover:bg-[#DCDDDC] tw:transition-colors",t),onClick:a,type:"button","aria-label":"Scroll to bottom",style:{width:32,height:32,borderRadius:"50%",backgroundColor:"#FFFFFF",border:"1px solid #DCDDDC",display:"flex",alignItems:"center",justifyContent:"center",cursor:"pointer",padding:0}},n),{},{children:(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 9 13",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M4.63193 12.243C4.63209 12.2428 4.63234 12.2426 4.63252 12.2424L8.11923 8.73875C8.3804 8.47628 8.37946 8.05174 8.11695 7.79047C7.85448 7.52923 7.42992 7.53023 7.16871 7.79272L4.82777 10.145V0.670522C4.82777 0.300195 4.52759 0 4.15725 0C3.78692 0 3.48668 0.300195 3.48668 0.670522V10.145L1.1458 7.79276C0.884551 7.53029 0.460066 7.52928 0.197536 7.79051C-0.0650053 8.05178 -0.0659275 8.47636 0.195274 8.7388L3.68201 12.2424C3.68221 12.2426 3.68243 12.2428 3.68263 12.243C3.94472 12.5056 4.37064 12.5048 4.63191 12.243H4.63193Z",style:{fill:"var(--color-foreground, black)"}})})}))};var T=n(87145),M=n(15445);const D=["className","variant","size","asChild"];function N(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function z(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const W=(0,M.F)("tw:inline-flex tw:items-center tw:justify-center tw:gap-2 tw:whitespace-nowrap tw:rounded-md tw:text-sm tw:font-medium tw:transition-colors tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:pointer-events-none tw:disabled:opacity-50 tw:[&_svg]:pointer-events-none tw:[&_svg]:size-4 tw:[&_svg]:shrink-0",{variants:{variant:{default:"tw:bg-primary tw:text-primary-foreground tw:shadow tw:hover:bg-primary/90",destructive:"tw:bg-destructive tw:text-destructive-foreground tw:shadow-sm tw:hover:bg-destructive/90",outline:"tw:border tw:border-input tw:bg-background tw:shadow-sm tw:hover:bg-accent tw:hover:text-accent-foreground",secondary:"tw:bg-secondary tw:text-secondary-foreground tw:shadow-sm tw:hover:bg-secondary/80",ghost:"tw:hover:bg-accent tw:hover:text-accent-foreground",link:"tw:text-primary tw:underline-offset-4 tw:hover:underline"},size:{default:"tw:h-9 tw:px-4 tw:py-2",sm:"tw:h-8 tw:rounded-md tw:px-3 tw:text-xs",lg:"tw:h-10 tw:rounded-md tw:px-8",icon:"tw:h-9 tw:w-9"}},defaultVariants:{variant:"default",size:"default"}}),U=r.forwardRef((e,t)=>
1{let{className:n,variant:r,size:o,asChild:i=!1}=e,a=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,D);const s=i?T.DX:"button";return(0,l.jsx)(s,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?N(Object(n),!0).forEach(function(t){z(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):N(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({className:j(W({variant:r,size:o,className:n})),ref:t},a))});U.displayName="Button";var H=n(49115);const Q=["className","align","sideOffset"];function Z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Y=H.bL,K=H.l9,G=r.forwardRef((e,t)=>{let{className:n,align:r="center",sideOffset:o=4}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Q);return(0,l.jsx)(H.UC,function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Z(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({ref:t,align:r,sideOffset:o,className:j("tw:z-50 tw:w-64 tw:rounded-md tw:border tw:bg-popover tw:p-4 tw:text-popover-foreground tw:shadow-md tw:outline-none tw:data-[state=open]:animate-in tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=open]:fade-in-0 tw:data-[state=closed]:zoom-out-95 tw:data-[state=open]:zoom-in-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-hover-card-content-transform-origin]",n)},i))});G.displayName=H.UC.displayName;const J=["className"];function X(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function _(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $=r.forwardRef((e,t)=>{let{className:n}=e,r=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,J);return(0,l.jsx)("textarea",function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?X(Object(n),!0).forEach(function(t){_(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):X(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({className:j("tw:flex tw:min-h-[60px] tw:w-full tw:rounded-md tw:border tw:border-input tw:bg-transparent tw:px-3 tw:py-2 tw:text-base tw:placeholder:text-muted-foreground tw:focus-visible:outline-none tw:focus-visible:ring-1 tw:focus-visible:ring-ring tw:disabled:cursor-not-allowed tw:disabled:opacity-50 tw:md:text-sm",n),ref:t},r))});$.displayName="Textarea";const ee=["className","type","variant","size"],te=["className"];function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach(function(t){oe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function oe(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ie(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(0,M.F)("tw:text-muted-foreground tw:flex tw:h-auto tw:cursor-text tw:select-none tw:items-center tw:justify-center tw:gap-2 tw:py-1.5 tw:text-sm tw:font-medium tw:group-data-[disabled=true]/input-group:opacity-50 tw:[&>kbd]:rounded-[calc(var(--radius)-5px)] tw:[&>svg:not([class*=size-])]:size-4",{variants:{align:{"inline-start":"tw:order-first tw:pl-3 tw:has-[>button]:ml-[-0.45rem] tw:has-[>kbd]:ml-[-0.35rem]","inline-end":"tw:order-last tw:pr-3 tw:has-[>button]:mr-[-0.4rem] tw:has-[>kbd]:mr-[-0.35rem]","block-start":"tw:[.border-b]:pb-3 tw:order-first tw:w-full tw:justify-start tw:px-3 tw:pt-3 tw:group-has-[>input]/input-group:pt-2.5","block-end":"tw:[.border-t]:pt-3 tw:order-last tw:w-full tw:justify-start tw:px-3 tw:pb-3 tw:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});const ae=(0,M.F)("tw:flex tw:items-center tw:gap-2 tw:text-sm tw:shadow-none",{variants:{size:{xs:"tw:h-6 tw:gap-1 tw:rounded-[calc(var(--radius)-5px)] tw:px-2 tw:has-[>svg]:px-2 tw:[&>svg:not([class*=size-])]:size-3.5",sm:"tw:h-8 tw:gap-1.5 tw:rounded-md tw:px-2.5 tw:has-[>svg]:px-2.5","icon-xs":"tw:size-6 tw:rounded-[calc(var(--radius)-5px)] tw:p-0 tw:has-[>svg]:p-0","icon-sm":"tw:size-8 tw:p-0 tw:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function le(e){let{className:t,type:n="button",variant:r="ghost",size:o="xs"}=e,i=ie(e,ee);return(0,l.jsx)(U,re({type:n,"data-size":o,variant:r,className:j(ae({size:o}),t)},i))}const se=r.forwardRef((e,t)=>{let{className:n}=e,r=ie(e,te);return(0,l.jsx)($,re({ref:t,"data-slot":"input-group-control",className:j("tw:flex-1 tw:resize-none tw:rounded-none tw:border-0 tw:bg-transparent tw:py-3 tw:shadow-none tw:focus-visible:ring-0 tw:dark:bg-transparent",n)},r))});se.displayName="InputGroupTextarea";var ce=n(11219),de=n(41527),ue=n(81228),pe=n(73616);const ge=["data","className"],fe=["className","accept","multiple","globalDrop","syncHiddenInput","maxFiles","maxFileSize","onError","onSubmit","children"],he=["id"],me=["className"],ve=["onChange","className","placeholder"],ye=["variant","className","size"],xe=["className","textareaRef","onTranscriptionChange","onListeningChange","children"],be=["openDelay","closeDelay"],we=["align"];function Ae(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ce(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Ae(Object(n),!0).forEach(function(t){je(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ae(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function je(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Se(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const ke=(0,r.createContext)(null),Oe=(0,r.createContext)(null),Ie=()=>(0,r.useContext)(ke),Pe=(0,r.createContext)(null),Ee=()=>{const e=(0,r.useContext)(Oe),t=(0,r.useContext)(Pe),n=null!=e?e:t;if(!n)throw new Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");return n};function Ve(e){let{data:t,className:n}=e,r=Se(e,ge);var o;const i=Ee(),a=t.filename||"";if("image"==((null==(o=t.mediaType)?void 0:o.startsWith("image/"))&&t.url?"image":"file"))return(0,l.jsx)("div",{style:{padding:4,alignSelf:"flex-start"},children:(0,l.jsxs)(De,{openDelay:200,children:[(0,l.jsx)(K,{asChild:!0,children:(0,l.jsxs)("div",Ce(Ce({className:j("tw:relative tw:flex tw:justify-end tw:items-start tw:shrink-0 tw:rounded-lg tw:border tw:border-border tw:overflow-hidden tw:bg-background tw:cursor-pointer",n),style:{width:56,height:56,padding:4}},r),{},{children:[(0,l.jsx)("img",{alt:a||"attachment",src:t.url,style:{position:"absolute",inset:0,width:"100%",height:"100%",objectFit:"cover",borderRadius:8}}),(0,l.jsxs)("button",{"aria-label":"Remove attachment",onClick:e=>{e.stopPropagation(),i.remove(t.id)},onPointerEnter:e=>e.stopPropagation(),onPointerLeave:e=>e.stopPropagation(),onMouseEnter:e=>e.stopPropagation(),onMouseLeave:e=>e.stopPropagation(),type:"button",style:{position:"relative",zIndex:10,width:16,height:16,minWidth:16,cursor:"pointer",borderRadius:"50%",padding:0,backgroundColor:"white",border:"1px solid #e5e7eb",boxShadow:"0 1px 2px rgba(0,0,0,0.05)",display:"flex",alignItems:"center",justifyContent:"center"},children:[(0,l.jsx)(ce.A,{style:{width:10,height:10}}),(0,l.jsx)("span",{className:"tw:sr-only",children:"Remove"})]})]}),t.id)}),(0,l.jsx)(Ne,{className:"tw:w-auto tw:p-2",side:"top",sideOffset:8,collisionPadding:16,avoidCollisions:!0,children:(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:overflow-hidden tw:rounded-md",children:(0,l.jsx)("img",{alt:a||"attachment preview",src:t.url,style:{maxHeight:280,maxWidth:280,objectFit:"contain"}})})})]})});const s=a||"Attachment";return(0,l.jsxs)(De,{children:[(0,l.jsx)(K,{asChild:!0,children:(0,l.jsxs)("div",Ce(Ce({className:j("tw:group tw:relative tw:flex tw:h-8 tw:cursor-default tw:select-none tw:items-center tw:gap-1.5 tw:rounded-md tw:border tw:border-border tw:px-1.5 tw:font-medium tw:text-sm tw:transition-all tw:hover:bg-accent tw:hover:text-accent-foreground tw:dark:hover:bg-accent/50",n)},r),{},{children:[(0,l.jsxs)("div",{className:"tw:relative tw:size-5 tw:shrink-0",children:[(0,l.jsx)("div",{className:"tw:absolute tw:inset-0 tw:flex tw:size-5 tw:items-center tw:justify-center tw:overflow-hidden tw:rounded tw:bg-background tw:transition-opacity tw:group-hover:opacity-0",children:(0,l.jsx)("div",{className:"tw:flex tw:size-5 tw:items-center tw:justify-center tw:text-muted-foreground",children:(0,l.jsx)(de.A,{className:"tw:size-3"})})}),(0,l.jsxs)(U,{"aria-label":"Remove attachment",className:"tw:absolute tw:inset-0 tw:size-5 tw:cursor-pointer tw:rounded tw:p-0 tw:opacity-0 tw:transition-opacity tw:group-hover:pointer-events-auto tw:group-hover:opacity-100 t
1w:[&>svg]:size-2.5",onClick:e=>{e.stopPropagation(),i.remove(t.id)},type:"button",variant:"ghost",children:[(0,l.jsx)(ce.A,{}),(0,l.jsx)("span",{className:"tw:sr-only",children:"Remove"})]})]}),(0,l.jsx)("span",{className:"tw:flex-1 tw:truncate",children:s})]}),t.id)}),(0,l.jsx)(Ne,{className:"tw:w-auto tw:p-2",children:(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:gap-2.5",children:(0,l.jsxs)("div",{className:"tw:min-w-0 tw:flex-1 tw:space-y-1 tw:px-0.5",children:[(0,l.jsx)("h4",{className:"tw:truncate tw:font-semibold tw:text-sm tw:leading-none",children:s}),t.mediaType&&(0,l.jsx)("p",{className:"tw:truncate tw:font-mono tw:text-muted-foreground tw:text-xs",children:t.mediaType})]})})})]})}function Fe(e){let{children:t}=e;const n=Ee();return n.files.length?n.files.map(e=>(0,l.jsx)(r.Fragment,{children:t(e)},e.id)):null}const Be=e=>{let{className:t,accept:n,multiple:o,globalDrop:i,syncHiddenInput:a,maxFiles:s,maxFileSize:c,onError:d,onSubmit:u,children:p}=e,g=Se(e,fe);const f=Ie(),h=!!f,m=(0,r.useRef)(null),v=(0,r.useRef)(null),y=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;const t=null==(e=v.current)?void 0:e.closest("form");t instanceof HTMLFormElement&&(y.current=t)},[]);const[x,b]=(0,r.useState)([]),w=h?f.attachments.files:x,A=(0,r.useCallback)(()=>{var e;null==(e=m.current)||e.click()},[]),C=(0,r.useCallback)(e=>!n||""===n.trim()||!n.includes("image/*")||e.type.startsWith("image/"),[n]),S=(0,r.useCallback)(e=>{const t=Array.from(e),n=t.filter(e=>C(e));if(t.length&&0===n.length)return void(null==d||d({code:"accept",message:"No files match the accepted types."}));const r=n.filter(e=>!c||e.size<=c);n.length>0&&0===r.length?null==d||d({code:"max_file_size",message:"All files exceed the maximum size."}):b(e=>{const t="number"==typeof s?Math.max(0,s-e.length):void 0,n="number"==typeof t?r.slice(0,t):r;"number"==typeof t&&r.length>t&&(null==d||d({code:"max_files",message:"Too many files. Some were not added."}));const o=[];for(const e of n)o.push({id:(0,pe.Ak)(),type:"file",url:URL.createObjectURL(e),mediaType:e.type,filename:e.name});return e.concat(o)})},[C,s,c,d]),k=h?e=>f.attachments.add(e):S,O=h?e=>f.attachments.remove(e):e=>b(t=>{const n=t.find(t=>t.id===e);return(null==n?void 0:n.url)&&URL.revokeObjectURL(n.url),t.filter(t=>t.id!==e)}),I=h?()=>f.attachments.clear():()=>b(e=>{for(const t of e)t.url&&URL.revokeObjectURL(t.url);return[]}),P=h?()=>f.attachments.openFileDialog():A;(0,r.useEffect)(()=>{h&&f.__registerFileInput(m,()=>{var e;return null==(e=m.current)?void 0:e.click()})},[h,f]),(0,r.useEffect)(()=>{a&&m.current&&0===w.length&&(m.current.value="")},[w,a]),(0,r.useEffect)(()=>{const e=y.current;if(!e)return;const t=e=>{var t,n;(null==(n=null==(t=e.dataTransfer)?void 0:t.types)?void 0:n.includes("Files"))&&e.preventDefault()},n=e=>{var t,n,r;(null==(n=null==(t=e.dataTransfer)?void 0:t.types)?void 0:n.includes("Files"))&&e.preventDefault(),(null==(r=e.dataTransfer)?void 0:r.files)&&e.dataTransfer.files.length>0&&k(e.dataTransfer.files)};return e.addEventListener("dragover",t),e.addEventListener("drop",n),()=>{e.removeEventListener("dragover",t),e.removeEventListener("drop",n)}},[k]),(0,r.useEffect)(()=>{if(!i)return;const e=e=>{var t,n;(null==(n=null==(t=e.dataTransfer)?void 0:t.types)?void 0:n.includes("Files"))&&e.preventDefault()},t=e=>{var t,n,r;(null==(n=null==(t=e.dataTransfer)?void 0:t.types)?void 0:n.includes("Files"))&&e.preventDefault(),(null==(r=e.dataTransfer)?void 0:r.files)&&e.dataTransfer.files.length>0&&k(e.dataTransfer.files)};return document.addEventListener("dragover",e),document.addEventListener("drop",t),()=>{document.removeEventListener("dragover",e),document.removeEventListener("drop",t)}},[k,i]);const E=(0,r.useRef)(w);E.current=w,(0,r.useEffect)(()=>()=>{if(!h)for(const e of E.current)e.url&&e.url.startsWith("blob:")&&URL.revokeObjectURL(e.url)},[h]);const V=async e=>{const t=await fetch(e),n=await t.blob();return new Promise((e,t)=>{const r=new FileReader;r.onloadend=()=>e(r.result),r.onerror=t,r.readAsDataURL(n)})},F=(0,r.useMemo)(()=>({files:w.map(e=>Ce(Ce({},e),{},{id:e.id})),add:k,remove:O,clear:I,openFileDialog:P,fileInputRef:m}),[w,k,O,I,P]),B=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{"aria-hidden":"true",className:"tw:hidden",ref:v}),(0,l.jsx)("input",{accept:n,"aria-label":"Upload files",className:"tw:hidden",multiple:o,onChange:e=>{e.currentTarget.files&&k(e.currentTarget.files)},ref:m,title:"Upload files",type:"file"}),(0,l.jsx)("form",Ce(Ce({className:j("tw:w-full",t),onSubmit:e=>{e.preventDefault();const t=e.currentTarget,n=h?f.textInput.value:new FormData(t).get("message")||"";h||t.reset(),Promise.all(w.map(async e=>{let{id:t}=e,n=Se(e,he);return n.url&&n.url.startsWith("blob:")?Ce(Ce({},n),{},{url:await V(n.url)}):n})).then(t=>{try{const r=u({text:n,files:t},e);r instanceof Promise?r.then(()=>{I(),h&&f.textInput.clear()}).catch(()=>{}):(I(),h&&f.textInput.clear())}catch(e){}}).catch(()=>{null==d||d({code:"file_read",message:"That image couldn't be read. Try adding it again â your message wasn't sent."})})}},g),{},{children:p}))]});return h?B:(0,l.jsx)(Pe.Provider,{value:F,children:B})},Le=e=>{let{className:t}=e,n=Se(e,me);return(0,l.jsx)("div",Ce({className:j("tw:contents",t)},n))},Re=r.forwardRef((e,t)=>
1{let{onChange:n,className:o,placeholder:i="What would you like to know?"}=e,a=Se(e,ve);const s=Ie(),c=Ee(),[d,u]=(0,r.useState)(!1),p=s?{value:s.textInput.value,onChange:e=>{s.textInput.setInput(e.currentTarget.value),null==n||n(e)}}:{onChange:n};return(0,l.jsx)(se,Ce(Ce({ref:t,className:j("tw:field-sizing-content tw:max-h-48 tw:min-h-16",o),name:"message",onCompositionEnd:()=>u(!1),onCompositionStart:()=>u(!0),onKeyDown:e=>{var t;if("Enter"===e.key){if(d||e.nativeEvent.isComposing)return;if(e.shiftKey)return;e.preventDefault(),null==(t=e.currentTarget.form)||t.requestSubmit()}if("Backspace"===e.key&&""===e.currentTarget.value&&c.files.length>0){e.preventDefault();const t=c.files.at(-1);t&&c.remove(t.id)}},onPaste:e=>{var t;const n=null==(t=e.clipboardData)?void 0:t.items;if(!n)return;const r=[];for(const e of Array.from(n))if("file"===e.kind){const t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),c.add(r))},placeholder:i},a),p))});Re.displayName="PromptInputTextarea";const Te=e=>{let{variant:t="ghost",className:n,size:o}=e,i=Se(e,ye);const a=null!=o?o:r.Children.count(i.children)>1?"sm":"icon-sm";return(0,l.jsx)(le,Ce({className:j(n),size:a,type:"button",variant:t},i))},Me=e=>{let{className:t,textareaRef:n,onTranscriptionChange:o,onListeningChange:i,children:a}=e,s=Se(e,xe);const[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(null),g=(0,r.useRef)(null),f=(0,r.useRef)(0),h=(0,r.useRef)(n);h.current=n;const m=(0,r.useRef)(o);m.current=o;const v=(0,r.useRef)(i);v.current=i,(0,r.useEffect)(()=>{if("undefined"!=typeof window&&("SpeechRecognition"in window||"webkitSpeechRecognition"in window)){const e=new(window.SpeechRecognition||window.webkitSpeechRecognition);e.continuous=!0,e.interimResults=!0,e.lang="en-US",e.onstart=()=>{var e;f.current=0,d(!0),null==(e=v.current)||e.call(v,!0)},e.onend=()=>{var e;d(!1),null==(e=v.current)||e.call(v,!1)},e.onresult=e=>{var t,n,r;let o="";for(let n=f.current;n<e.results.length;n++){const r=e.results[n];var i;r.isFinal&&(o+=null!==(i=null==(t=r[0])?void 0:t.transcript)&&void 0!==i?i:"",f.current=n+1)}const a=null==(n=h.current)?void 0:n.current;if(o&&a){const e=a.value,t=e+(e?" ":"")+o;a.value=t,a.dispatchEvent(new Event("input",{bubbles:!0})),null==(r=m.current)||r.call(m,t)}},e.onerror=e=>{var t;console.error("Speech recognition error:",e.error),d(!1),null==(t=v.current)||t.call(v,!1)},g.current=e,p(e)}return()=>{g.current&&g.current.stop()}},[]),(0,r.useEffect)(()=>{var e,t;const n=null==(t=null==(e=h.current)?void 0:e.current)?void 0:t.closest("form");if(!n||!g.current)return;const r=()=>{var e;return null==(e=g.current)?void 0:e.stop()};return n.addEventListener("submit",r),()=>n.removeEventListener("submit",r)},[u]);const y=(0,r.useCallback)(()=>{u&&(c?u.stop():u.start())},[u,c]),x="function"==typeof a?a(c):null!=a?a:(0,l.jsx)(ue.A,{className:"tw:size-4"});return(0,l.jsx)(Te,Ce(Ce({className:j("tw:relative tw:transition-all tw:duration-200",c&&"tw:animate-pulse tw:bg-accent tw:text-accent-foreground",t),disabled:!u,onClick:y},s),{},{children:x}))},De=e=>{let{openDelay:t=0,closeDelay:n=0}=e,r=Se(e,be);return(0,l.jsx)(Y,Ce({closeDelay:n,openDelay:t},r))},Ne=e=>{let{align:t="start"}=e,n=Se(e,we);return(0,l.jsx)(G,Ce({align:t},n))},ze=e=>{let{onAttachmentsChange:t,styles:n}=e;const o=Ee();return(0,r.useEffect)(()=>{t(o.files.length>0)},[o.files.length,t]),0===o.files.length?null:(0,l.jsx)("div",{style:{paddingLeft:n.paddingX,paddingRight:n.paddingX,paddingTop:n.paddingY},className:"tw:flex tw:flex-row tw:flex-wrap tw:gap-1",children:(0,l.jsx)(Fe,{children:e=>(0,l.jsx)(Ve,{data:e})})})},We=e=>{let{size:t=20,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M12 2.09998L1 12H4V21H11V15H13V21H20V12H23L12 2.09998ZM18 19H15V13H9V19H6V10.19L12 4.68998L18 10.19V19Z",fill:"currentColor"})})},Ue=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:Math.round(20*t/24),viewBox:"0 0 24 20",fill:"none",className:n,style:r,children:(0,l.jsx)("path",{d:"M4.07715 0.0996094H19.9229C20.9788 0.0996279 21.9907 0.504276 22.7363 1.22266C23.4818 1.94096 23.9004 2.91453 23.9004 3.92871V16.0713C23.9004 17.0855 23.4818 18.059 22.7363 18.7773C21.9907 19.4957 20.9788 19.9004 19.9229 19.9004H4.07715C3.0212 19.9004 2.00926 19.4957 1.26367 18.7773C0.518186 18.059 0.0996094 17.0855 0.0996094 16.0713V3.92871C0.0996094 2.91453 0.518186 1.94096 1.26367 1.22266C2.00926 0.504276 3.0212 0.0996276 4.07715 0.0996094ZM4.07715 2.04297C3.56031 2.04299 3.06382 2.24056 2.69727 2.59375C2.33057 2.94708 2.12402 3.42736 2.12402 3.92871V16.0713C2.12402 16.5726 2.33057 17.0529 2.69727 17.4062C3.06382 17.7594 3.56031 17.957 4.07715 17.957H6.03027V2.04297H4.07715ZM8.05469 17.957H19.9229C20.4397 17.957 20.9362 17.7594 21.3027 17.4062C21.6694
117.0529 21.876 16.5726 21.876 16.0713V3.92871C21.876 3.42736 21.6694 2.94708 21.3027 2.59375C20.9362 2.24056 20.4397 2.04299 19.9229 2.04297H8.05469V17.957Z",fill:"currentColor"})})},He=e=>{let{size:t=20,className:n,style:r}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:[(0,l.jsx)("path",{d:"M5.95216 19.6877C5.99369 19.6794 6.03672 19.6865 6.07357 19.7074C7.55917 20.5512 9.24531 21 11 21C13.4663 21 15.7971 20.1133 17.6265 18.4899C17.7783 18.3552 17.9265 18.2154 18.071 18.071C19.96 16.1824 21 13.6713 21 11C21 8.32909 19.96 5.81806 18.071 3.92901C16.1966 2.05461 13.6654 1.00374 11.0146 1.00001C8.33826 0.996234 5.821 2.03706 3.92905 3.92901C3.78461 4.07349 3.64481 4.22167 3.51012 4.37358C1.88672 6.20337 1 8.53366 1 11C1 12.8347 1.49071 14.5937 2.41 16.1274C2.43403 16.1675 2.44137 16.2153 2.43 16.2606L1.60577 19.5527C1.54751 19.7857 1.61324 20.0322 1.77909 20.206C1.91237 20.3449 2.10817 20.4713 2.45494 20.3876L5.95216 19.6877Z",stroke:"currentColor",strokeWidth:"2",strokeMiterlimit:"10"}),(0,l.jsx)("path",{d:"M8.44141 11.0098H13.5451",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M11.0039 8.44531V13.549",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},Qe=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:[(0,l.jsx)("path",{d:"M15.342 23.9893H8.64729C2.58861 23.9893 0 21.4007 0 15.342V8.64729C0 2.58861 2.58861 0 8.64729 0H15.342C21.4007 0 23.9893 2.58861 23.9893 8.64729V15.342C23.9893 21.4007 21.4007 23.9893 15.342 23.9893ZM8.64729 1.67367C3.50355 1.67367 1.67367 3.50355 1.67367 8.64729V15.342C1.67367 20.4857 3.50355 22.3156 8.64729 22.3156H15.342C20.4857 22.3156 22.3156 20.4857 22.3156 15.342V8.64729C22.3156 3.50355 20.4857 1.67367 15.342 1.67367H8.64729Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M8.64728 10.5999C6.9513 10.5999 5.57889 9.2275 5.57889 7.53151C5.57889 5.83553 6.9513 4.46312 8.64728 4.46312C10.3433 4.46312 11.7157 5.83553 11.7157 7.53151C11.7157 9.2275 10.3433 10.5999 8.64728 10.5999ZM8.64728 6.13679C7.8774 6.13679 7.25256 6.76162 7.25256 7.53151C7.25256 8.3014 7.8774 8.92624 8.64728 8.92624C9.41717 8.92624 10.042 8.3014 10.042 7.53151C10.042 6.76162 9.41717 6.13679 8.64728 6.13679Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M1.58414 20.5863C1.31636 20.5863 1.04857 20.4524 0.892361 20.218C0.635731 19.8387 0.736151 19.3143 1.12667 19.0576L6.62747 15.3644C7.83251 14.5499 9.49502 14.6503 10.5885 15.5764L10.9567 15.9C11.5146 16.3798 12.463 16.3798 13.0098 15.9L17.6514 11.9166C18.8341 10.9013 20.6975 10.9013 21.8914 11.9166L23.7101 13.4787C24.056 13.78 24.1006 14.3044 23.7994 14.6615C23.4981 15.0074 22.9737 15.052 22.6166 14.7507L20.7979 13.1886C20.24 12.7088 19.2916 12.7088 18.7337 13.1886L14.0921 17.172C12.9093 18.1873 11.046 18.1873 9.85211 17.172L9.48387 16.8484C8.97061 16.4132 8.12261 16.3686 7.55357 16.7591L2.05277 20.4524C1.90772 20.5416 1.74035 20.5863 1.58414 20.5863Z",fill:"currentColor"})]})},Ze=e=>{let{size:t=17,height:n=24,className:r,style:o}=e;return(0,l.jsx)("svg",{width:t,height:n,viewBox:"0 0 17 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:r,style:o,children:(0,l.jsx)("path",{d:"M8.5 17.1429C5.68778 17.1429 3.4 14.8359 3.4 12V5.14286C3.4 2.307 5.68778 0 8.5 0C11.3122 0 13.6 2.307 13.6 5.14286V12C13.6 14.8359 11.3122 17.1429 8.5 17.1429ZM8.5 1.71429C6.62533 1.71429 5.1 3.25243 5.1 5.14286V12C5.1 13.8904 6.62533 15.4286 8.5 15.4286C10.3747 15.4286 11.9 13.8904 11.9 12V5.14286C11.9 3.25243 10.3747 1.71429 8.5 1.71429ZM16.15 10.2857C15.6806 10.2857 15.3 10.6695 15.3 11.1429V12C15.3 15.7811 12.2496 18.8571 8.5 18.8571C4.75044 18.8571 1.7 15.7811 1.7 12V11.1429C1.7 10.6695 1.31941 10.2857 0.85 10.2857C0.380587 10.2857 0 10.6695 0 11.1429V12C0 16.4372 3.36069 20.0966 7.65 20.5279V22.2857H5.95C5.48059 22.2857 5.1 22.6695 5.1 23.1429C5.1 23.6162 5.48059 24 5.95 24H11.05C11.5194 24 11.9 23.6162 11.9 23.1429C11.9 22.6695 11.5194 22.2857 11.05 22.285
17H9.35V20.5279C13.6393 20.0964 17 16.437 17 12V11.1429C17 10.6695 16.6194 10.2857 16.15 10.2857Z",fill:"currentColor"})})},qe=e=>{let{size:t=12,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:9*t/12,viewBox:"0 0 12 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.1231 4.03711C11.1229 4.03695 11.1228 4.03675 11.1226 4.03659L8.22563 1.16103C8.0086 0.945614 7.65757 0.946414 7.44154 1.1629C7.22553 1.37938 7.22637 1.72952 7.44339 1.94495L9.38841 3.87559H1.55442C1.24822 3.87559 1 4.12315 1 4.42858C1 4.734 1.24822 4.98161 1.55442 4.98161H9.38839L7.44344 6.9122C7.22641 7.12765 7.22557 7.47776 7.44158 7.69423C7.6576 7.91075 8.00867 7.91151 8.22567 7.69612L11.1226 4.82053C11.1228 4.82037 11.1229 4.82017 11.1231 4.82C11.3403 4.60386 11.3396 4.25257 11.1231 4.03712L11.1231 4.03711Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.428571"})})},Ye=e=>{let{size:t=32,className:n,style:r}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:[(0,l.jsx)("path",{d:"M2.5 4.5h9",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M2.5 10h15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),(0,l.jsx)("path",{d:"M2.5 15.5h12",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})},Ke=e=>{let{size:t=20,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 21 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M20.2796 16.1373L19.118 12.7029C19.6779 11.5401 19.9738 10.2468 19.9758 8.94564C19.9792 6.68311 19.1176 4.54385 17.5495 2.92195C15.9812 1.29973 13.8912 0.386554 11.6647 0.35072C9.35587 0.313654 7.18572 1.20584 5.55419 2.86329C3.98099 4.4615 3.10841 6.56846 3.08079 8.81999C1.53024 10.006 0.615044 11.8551 0.618052 13.8301C0.619497 14.7544 0.824263 15.6731 1.21227 16.5039L0.412153 18.8694C0.274614 19.2761 0.375083 19.7176 0.67438 20.0217C0.885006 20.2357 1.1627 20.3496 1.44829 20.3496C1.56844 20.3496 1.69001 20.3295 1.80856 20.2881L4.13704 19.4752C4.95481 19.8694 5.85915 20.0774 6.76892 20.0789C6.7722 20.0789 6.77532 20.0789 6.77861 20.0789C8.75165 20.0788 10.5856 19.1251 11.7488 17.5112C12.9592 17.4788 14.1569 17.1812 15.2396 16.6431L18.6202 17.8232C18.761 17.8724 18.9055 17.8964 19.0483 17.8964C19.3876 17.8964 19.7176 17.761 19.968 17.5066C20.3236 17.1453 20.443 16.6206 20.2796 16.1373ZM6.77853 18.8695C6.77599 18.8695 6.77329 18.8695 6.77075 18.8695C5.96552 18.8682 5.16587 18.6666 4.45841 18.2863C4.31294 18.2082 4.14216 18.1946 3.98661 18.2489L1.59899 19.0824L2.41942 16.6568C2.47286 16.4988 2.45958 16.3253 2.38262 16.1775C2.00833 15.4588 1.80981 14.6464 1.80856 13.8283C1.80657 12.5124 2.31044 11.2652 3.19157 10.3313C3.47938 12.1137 4.3156 13.7563 5.61177 15.0496C6.89837 16.3335 8.51564 17.1509 10.2606 17.4181C9.33923 18.3407 8.0972 18.8695 6.77853 18.8695ZM19.1261 16.6514C19.0923 16.6858 19.0521 16.6952 19.0069 16.6794L15.3879 15.416C15.325 15.394 15.2596 15.3832 15.1945 15.3832C15.0984 15.3832 15.0027 15.4068 14.9161 15.4534C13.8828 16.0087 12.7151 16.3032 11.5393 16.3051C11.5354 16.3051 11.5319 16.3051 11.528 16.3051C7.58806 16.3051 4.33364 13.0536 4.27122 9.05183C4.23978 7.03646 4.99439 5.14237 6.39599 3.71845C7.79759 2.29454 9.66232 1.52819 11.6458 1.55994C15.5887 1.62348 18.7914 4.93581 18.7853 8.94373C18.7835 10.1383 18.4936 11.3246 17.947 12.3743C17.87 12.522 17.8567 12.6955 17.9102 12.8536L19.1537 16.5303C19.1692 16.5763 19.1599 16.6171 19.1261 16.6514Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.7"})})},Ge=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M18 15l-6-6-6 6",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Je=e=>{let{size:t=20,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M15.5 4.5L4.5 15.5M4.5 4.5l11 11",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Xe=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M7.1478e-07 9.99805V9.83203C7.1478e-07 9.46476 0.29777 9.16699 0.66504 9.16699C1.03231 9.16699 1.33008 9.46476 1.33008 9.83203V9.99805C1.33008 10.7089 1.33099 11.2025 1.36231 11.5859C1.39299 11.9615 1.44982 12.1731 1.53027 12.3311L1.60059 12.458C1.7769 12.7454 2.02992 12.9799 2.33203 13.1338L2.46191 13.1895C2.60569 13.2409 2.7952 13.2787 3.07715 13.3018C3.46067 13.3331 3.954 13.333 4.66504 13.333H9.99805C10.7089 13.333 11.2025 13.3331 11.5859 13.3018C11.9613 13.2711 12.1731 13.2142 12.3311 13.1338L12.458 13.0625C12.7454 12.8862 12.9799 12.6331 13.1338 12.3311L13.1895 12.2012C13.2409 12.0574 13.2787 11.8677 13.3018 11.5859C13.3331 11.2025 13.333 10.7089 13.333 9.99805V9.83203C13.333 9.46487 13.6309 9.16717 13.998 9.16699C14.3653 9.16699 14.6631 9.46476 14.6631 9.83203V9.99805C14.6631 10.6871 14.6637 11.2441 14.627 11.6943C14.5942 12.0953 14.5292 12.4565 14.3848 12.793L14.3184 12.9355C14.0529 13.4565 13.649 13.8922 13.1533 14.1963L12.9355 14.3184C12.5588 14.5103 12.1523 14.5895 11.6943 14.627C11.2441 14.6637 10.6871 14.6631 9.99805 14.6631H4.66504C3.97595 14.6631 3.41899 14.6637 2.96875 14.627C2.56821 14.5942 2.20731 14.5299 1.87109 14.3857L1.72852 14.3184C1.2074 14.0528 0.770898 13.6491 0.466798 13.1533L0.344727 12.9355C0.152758 12.5588 0.073554 12.1523 0.0361335 11.6943C-0.000636417 11.2441 7.1478e-07 10.687 7.1478e-07 9.99805ZM6.66699 9.83203V2.27051L4.46875 4.46875C4.20911 4.72839 3.78803 4.72829 3.52832 4.46875C3.26862 4.20905 3.26862 3.78802 3.52832 3.52832L6.86133 0.194336L6.96289 0.111328C7.07128 0.0391338 7.19987 9.45271e-09 7.33203 0C7.50813 8.62398e-05 7.67715 0.0699043 7.80176 0.194336L11.1357 3.52832C11.3951 3.78799 11.3952 4.20915 11.
11357 4.46875C10.876 4.72845 10.454 4.72845 10.1943 4.46875L7.99707 2.27148V9.83203C7.9969 10.199 7.69904 10.4969 7.33203 10.4971C6.96487 10.4971 6.66717 10.1992 6.66699 9.83203Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.3",strokeLinejoin:"round"})})},_e=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 17 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M13.7569 2.44313C12.2458 0.932132 10.2369 0.0999756 8.09998 0.0999756C5.9631 0.0999756 3.95413 0.932132 2.4431 2.44313C0.932132 3.95413 0.0999756 5.9631 0.0999756 8.09998C0.0999756 10.2369 0.932132 12.2458 2.4431 13.7568C3.95413 15.2678 5.9631 16.1 8.09998 16.1C10.2369 16.1 12.2458 15.2678 13.7569 13.7568C15.2678 12.2458 16.1 10.2369 16.1 8.09998C16.1 5.9631 15.2678 3.95413 13.7569 2.44313ZM8.09998 15.1625C6.1986 15.1625 4.47054 14.4069 3.1996 13.1806C3.88785 11.0777 5.86519 9.63123 8.09998 9.63123C10.3348 9.63123 12.3121 11.0777 13.0004 13.1807C11.7294 14.4069 10.0014 15.1625 8.09998 15.1625ZM5.75623 6.34998C5.75623 5.05763 6.80763 4.00623 8.09998 4.00623C9.39232 4.00623 10.4437 5.05763 10.4437 6.34998C10.4437 7.64232 9.39232 8.69373 8.09998 8.69373C6.80763 8.69373 5.75623 7.64232 5.75623 6.34998ZM13.7044 12.3923C13.0147 10.7787 11.6605 9.55263 10.0238 9.00635C10.8457 8.40948 11.3812 7.44116 11.3812 6.34998C11.3812 4.54069 9.90926 3.06873 8.09998 3.06873C6.29069 3.06873 4.81873 4.54069 4.81873 6.34998C4.81873 7.44116 5.35426 8.40948 6.17616 9.00635C4.53948 9.55263 3.18529 10.7787 2.4956 12.3923C1.58166 11.2018 1.03748 9.71335 1.03748 8.09998C1.03748 4.20569 4.20569 1.03748 8.09998 1.03748C11.9943 1.03748 15.1625 4.20569 15.1625 8.09998C15.1625 9.71335 14.6183 11.2018 13.7044 12.3923Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})})},$e=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 18 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:(0,l.jsx)("path",{d:"M17.3117 4.92841L9.05741 0.162776C8.98615 0.121635 8.90532 0.0999756 8.82303 0.0999756C8.74075 0.0999756 8.65992 0.121635 8.58866 0.162776L0.334351 4.92841C0.263094 4.96955 0.203921 5.02872 0.162779 5.09998C0.121638 5.17123 0.0999777 5.25206 0.0999756 5.33435V14.8656C0.0999777 14.9479 0.121638 15.0287 0.162779 15.1C0.203921 15.1712 0.263094 15.2304 0.334351 15.2715L8.58866 20.0372C8.65992 20.0783 8.74075 20.1 8.82303 20.1C8.90532 20.1 8.98615 20.0783 9.05741 20.0372L17.3117 15.2715C17.383 15.2304 17.4421 15.1712 17.4833 15.1C17.5244 15.0287 17.5461 14.9479 17.5461 14.8656V5.33435C17.5461 5.25206 17.5244 5.17123 17.4833 5.09998C17.4421 5.02872 17.383 4.96955 17.3117 4.92841ZM8.82303 9.55873L5.63338 7.71716L12.9502 3.49282L16.1398 5.33435L8.82303 9.55873ZM8.82303 1.11L12.0127 2.95153L4.69588 7.17591L1.50627 5.33435L8.82303 1.11ZM1.03748 6.14622L4.22889 7.98884V12.3827C4.22889 12.507 4.27827 12.6262 4.36618 12.7141C4.45409 12.802 4.57332 12.8514 4.69764 12.8514C4.82196 12.8514 4.94119 12.802 5.02909 12.7141C5.117 12.6262 5.16639 12.507 5.16639 12.3827V8.53013L8.35428 10.3706V18.8193L1.03748 14.5949V6.14622ZM9.29178 18.8193V10.3706L16.6086 6.14626V14.5949L9.29178 18.8193Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})})},et=e=>{let{size:t=24,className:n,style:r}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:n,style:r,children:[(0,l.jsx)("mask",{id:"mask0_logout",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"18",height:"18",children:(0,l.jsx)("path",{d:"M0 0H18V18H0V0Z",fill:"white"})}),(0,l.jsxs)("g",{mask:"url(#mask0_logout)",children:[(0,l.jsx)("path",{d:"M11.9882 13.7812V15.1875C11.9882 16.3525 11.0438 17.2969 9.87885 17.2969H2.81244C1.64747 17.2969 0.703064 16.3525 0.703064 15.1875V2.8125C0.703064 1.64753 1.64747 0.703125 2.81244 0.703125H9.87885C11.0438 0.703125 11.9882 1.64753 11.9882 2.8125V4.21875",stroke:"currentColor",strokeWidth:"1.25",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M17.1211 9.03515H7.59375",stroke:"currentColor",strokeWidth:"1.25",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),(0,l.jsx)("path",{d:"M15.4134 11.3555L16.9879 9.78092C17.3998 9.36903 17.3998 8.70128 16.9879 8.28938L15.4134 6.71484",stroke:"currentColor",strokeWidth:"1.25",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})]})]})},tt=e=>{let{disabled:t,styles:n,resolveColor:r}=e;const o=Ee();return(0,l.jsx)("button",{type:"button",disabled:t,onClick:()=>o.openFileDialog(),"aria-label":"Attach image",className:"tw:p-0 tw:bg-transparent tw:border-none tw:cursor-pointer disabled:tw:cursor-not-allowed tw:transition-colors",style:{width:n.iconSize,height:n.iconSize},children:(0,l.jsx)(Qe,{size:n.iconSize,style:{color:r(n.iconColor),opacity:t?.5:1,transition:"opacity 0.15s ease"}})})},nt=e=>{let{disabled:t,textareaRef:n,onChange:r,styles:o,themeIcons:i,resolveColor:a}=e;const s=o.microphoneIcon,c=s&&"default"!==s?i[s]:null;return(0,l.jsx)(Me,{disabled:t,textareaRef:n,onTranscriptionChange:r,"aria-label":"Voice input",className:"tw:p-0 tw:bg-transparent! tw:shadow-none! tw:border-none tw:cursor-pointer hover:tw:bg-transparent! disabled:tw:opacity-50 disabled:tw:cursor-not-allowed",style:{width:o.iconSize,height:o.iconSize},children:e=>(0,l.jsxs)("div",{className:"tw:relative tw:cursor-pointer",children:[c?(0,l.jsx)("img",{src:c.url,alt:c.name,style:{width:o.iconSize,height:o.iconSize,filter:e?"drop-shadow(0 0 2px ".concat(a(o.micActiveColor),")"):void 0}}):(0,l.jsx)(Ze,{size:o.iconSize,style:{color:a(e?o.micActiveColor:o.iconColor),width:o.iconSize,height:o.iconSize}}),e&&(0,l.jsx)("span",{className:"tw:absolute tw:-top-0.5 tw:-right-0.5 tw:size-2 tw:rounded-full tw:animate-pulse",style:{backgroundColor:a(o.micActiveColor)}})]})})};function rt(e){if(!e)return null;let t,n,r;const o=e.trim().match(/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i),i=e.trim().match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/i);
1if(o){let e=o[1];3===e.length&&(e=e.split("").map(e=>e+e).join("")),t=parseInt(e.slice(0,2),16),n=parseInt(e.slice(2,4),16),r=parseInt(e.slice(4,6),16)}else{if(!i)return null;t=Number(i[1]),n=Number(i[2]),r=Number(i[3])}const a=e=>{const t=e/255;return t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)};return.2126*a(t)+.7152*a(n)+.0722*a(r)}const ot=e=>{var t;let{disabled:n,isStreaming:o=!1,onStop:i,styles:a,resolveColor:s}=e;const[c,d]=(0,r.useState)(!1),u=!o&&n,p=s(a.submitButtonBgColor),g=c?s(a.submitButtonBgColorHover):p,f=s(a.submitButtonIconColor),h=null!==(t=rt(s(a.backgroundColor)))&&void 0!==t?t:1,m=rt(p),v=rt(f);let y=p;null!=m&&null!=v&&(y=Math.abs(v-h)>Math.abs(m-h)?f:p);const x=a.submitButtonSize;return(0,l.jsxs)("button",{type:o?"button":"submit",disabled:u,onClick:e=>{o&&i&&(e.preventDefault(),i())},"aria-label":o?"Stop generating":"Submit","data-concierge-submit":!0,className:"tw:flex tw:items-center tw:justify-center tw:cursor-pointer disabled:tw:cursor-not-allowed",style:{width:x,height:x,position:"relative",border:"none",borderRadius:a.submitButtonBorderRadius,background:"transparent",padding:0},onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),children:[(0,l.jsx)("span",{style:{position:"absolute",inset:0,borderRadius:a.submitButtonBorderRadius,backgroundColor:g,opacity:u?.1:1,transition:"background-color 0.15s ease, opacity 0.15s ease",pointerEvents:"none"}}),(0,l.jsx)("span",{style:{position:"relative",display:"flex",alignItems:"center",justifyContent:"center"},children:o?(0,l.jsx)("div",{style:{width:Math.round(x/3),height:Math.round(x/3),borderRadius:1,backgroundColor:"#FFFFFF"}}):(0,l.jsx)(qe,{size:x/2,style:{color:u?y:f,opacity:u?.5:1,transition:"color 0.15s ease, opacity 0.15s ease"}})})]})},it=e=>{let{size:t,color:n}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",style:{display:"block"},children:(0,l.jsx)("path",{d:"M8 3a1 1 0 0 1 1 1v16a1 1 0 1 1-2 0V4a1 1 0 0 1 1-1Zm8 2a1 1 0 0 1 1 1v12a1 1 0 1 1-2 0V6a1 1 0 0 1 1-1Zm-4 2a1 1 0 0 1 1 1v8a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1ZM4 9a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Zm16 0a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0v-4a1 1 0 0 1 1-1Z",fill:n})})},at=e=>{let{disabled:t=!1,onClick:n,assistantName:r="Benny",ctaLabel:o,styles:i,resolveColor:a}=e;const s=a(i.iconColor),c=i.iconSize,d=o||"Call ".concat(r);return(0,l.jsx)("button",{type:"button",onClick:n,disabled:t,"aria-label":d,title:d,className:"tw:p-0 tw:bg-transparent tw:border-none tw:cursor-pointer disabled:tw:cursor-not-allowed tw:transition-colors",style:{width:c,height:c,opacity:t?.5:1},children:(0,l.jsx)(it,{size:c,color:s})})},lt={normal:400,medium:500,semibold:600,bold:700};function st(e){const t="\n .concierge-prompt-input {\n --icon-size: ".concat(e.mobileIconSize,"px;\n --submit-button-size: ").concat(e.mobileSubmitButtonSize,"px;\n --font-size-small: ").concat(e.mobileFontSize,"px;\n --font-size-base: ").concat(e.mobileFontSize,'px;\n }\n .concierge-prompt-input textarea,\n .concierge-prompt-input textarea[data-slot="input-group-control"] {\n font-size: ').concat(e.mobileFontSize,"px !important;\n }\n .concierge-input-container {\n padding: ").concat(e.mobilePaddingY,"px ").concat(e.mobilePaddingX,"px !important;\n }\n .concierge-input-container:not(:has(textarea[data-expanded])) {\n min-height: ").concat(e.mobileMinHeight>0?"".concat(e.mobileMinHeight,"px"):"auto"," !important;\n }\n .concierge-input-container:has(textarea[data-expanded]) {\n min-height: ").concat(e.mobileMinHeight>0?"".concat(e.mobileMinHeight,"px"):"auto"," !important;\n height: auto !important;\n /* Extra 4px on top/left when expanded for breathing room */\n padding: ").concat(e.mobilePaddingY+4,"px ").concat(e.mobilePaddingX,"px ").concat(e.mobilePaddingY,"px ").concat(e.mobilePaddingX+4,"px !important;\n }\n .concierge-prompt-input-icons {\n gap: ").concat(e.mobileIconGap,"px !important;\n }"),n=e.forceMobile?t:"@media (max-width: 767px) {".concat(t,"\n }"),r='\n .concierge-prompt-input textarea,\n .concierge-prompt-input textarea[data-slot="input-group-control"] {\n font-size: '.concat(Math.max(16,e.mobileFontSize),"px !important;\n }"),o="@supports (-webkit-touch-callout: none) {".concat(e.forceMobile?r:"\n @media (max-width: 767px) {".concat(r,"\n }"),"\n }");return"\n .concierge-prompt-input {\n --icon-size: auto;\n --submit-button-size: auto;\n --font-size-small: ".concat(e.fontSize,"px;\n --font-size-base: ").concat(e.fontSize,'px;\n }\n .concierge-prompt-input [data-slot="input-group"] {\n border: none !important;\n box-shadow: none !important;\n --tw-shadow: 0 0 #0000 !important;\n --tw-shadow-colored: 0 0 #0000 !important;\n background: transparent !important;\n padding: 0 !important;\n margin: 0 !important;\n min-height: 0 !important;\n height: auto !important;\n outline: none !important;\n }\n .concierge-prompt-input [data-slot="input-group"]:has([data-slot="input-group-control"]:focus-visible) {\n --tw-ring-color: transparent !important;\n --tw-ring-offset-width: 0 !important;\n --tw-ring-width: 0 !important;\n box-shadow: none !important;\n }\n .concierge-prompt-input [data-slot="input-group-control"]:focus-visible {\n outline: none !important;\n --tw-ring-color: transparent !important;\n box-shadow: none !important;\n }\n .concierge-prompt-input textarea,\n .concierge-prompt-input textarea:focus,\n .concierge-prompt-input textarea:focus-visible {\n border: none !important;\n outline: none !important;\n box-shadow: none !important;\n --tw-shadow: 0 0 #0000 !important;\n --tw-shadow-colored: 0 0 #0000 !important;\n }\n .concierge-prompt-input *:focus,\n .concierge-prompt-input *:focus-visible {\n outline: none !important;\n --tw-ring-color: transparent !important;\n --tw-ring-width: 0 !important;\n --tw-ring-offset-width: 0 !important;\n }\n .concierge-prompt-input:focus-within {\n outline: none !important;\n }\n /* The blanket suppression above exists so the composer reads as one box\n rather than a strip of separately-ringed controls. The BUTTONS in it are\n not part of that box, though - attach / mic / call / submit are discrete\n controls, and with the ring gone a keyboard user could not see where\n focus was (WCAG 2.4.7). Higher specificity than the universal rule\n above, so this wins for buttons only and the textarea stays ring-free. */\n .concierge-prompt-input button:focus-visible {\n outline: 2px solid ').concat(e.textColor,' !important;\n outline-offset: 2px !important;\n }\n .concierge-prompt-input textarea,\n .concierge-prompt-input textarea[data-slot="input-group-control"] {\n font-size: ').concat(e.fontSize,"px !important;
1\n font-weight: ").concat((i=e.fontWeight,null!==(a=lt[i])&&void 0!==a?a:400)," !important;\n font-family: ").concat(e.fontFamilyCss," !important;\n color: ").concat(e.textColor," !important;\n line-height: 1.5 !important;\n }\n .concierge-prompt-input textarea::placeholder {\n color: ").concat(e.placeholderColor," !important;\n }\n\n ").concat(n,"\n\n ").concat(o,"\n ");var i,a}const ct=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=()=>n(new Error("read failed")),r.readAsDataURL(e)}),dt=["image/jpeg","image/png","image/webp","image/gif"],ut={readBlob:async e=>(await fetch(e)).blob(),compress:async function(e,t){const n=t||e.type||"image/jpeg";if("image/gif"===n)return{url:await ct(e),mediaType:n};let r=null;try{r=URL.createObjectURL(e);const t=await(o=r,new Promise((e,t)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>t(new Error("image decode failed")),n.src=o})),i=Math.max(t.naturalWidth,t.naturalHeight),a=i>1568;if(!a&&e.size<=1048576)return{url:await ct(e),mediaType:n};const l=a?1568/i:1,s=document.createElement("canvas");s.width=Math.max(1,Math.round(t.naturalWidth*l)),s.height=Math.max(1,Math.round(t.naturalHeight*l));const c=s.getContext("2d");if(!c)return{url:await ct(e),mediaType:n};c.fillStyle="#ffffff",c.fillRect(0,0,s.width,s.height),c.drawImage(t,0,0,s.width,s.height);const d=s.toDataURL("image/jpeg",.85);return d.startsWith("data:image/jpeg")?{url:d,mediaType:"image/jpeg"}:{url:await ct(e),mediaType:n}}catch(t){return{url:await ct(e),mediaType:n}}finally{r&&URL.revokeObjectURL(r)}var o}};function pt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pt(Object(n),!0).forEach(function(t){ft(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ft(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ht=e=>{var t,n;let{placeholder:o="Ask anything",onSubmit:i,disabled:a=!1,isStreaming:s=!1,onStop:c,value:u,onChange:g,expandDirection:f="up",maxHeight:h,widgetId:m="concierge-chat-input",displayName:v="Chat Input",initialState:y,presets:x,forceMobile:b=!1,showCallButton:w=!1,onCallClick:A,voiceAssistantName:C,voiceCtaLabel:j}=e;const S=(0,r.useRef)(null),[k,O]=(0,r.useState)(!1),[I,P]=(0,r.useState)(!1),E=(null!==(t=null==u?void 0:u.length)&&void 0!==t?t:0)>40||null!==(n=null==u?void 0:u.includes("\n"))&&void 0!==n&&n,V=(0,r.useCallback)(async e=>{var t,n;if(!((null==(t=e.text)?void 0:t.trim())||e.files&&0!==e.files.length))return;let r;P(!0);try{r=await async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ut;if(!(null==e?void 0:e.length))return{ok:!0,fileParts:[]};for(const t of e)if(!dt.includes(t.mediaType||""))return{ok:!1,reason:"unsupported-type"};const n=[];for(const r of e){const e=r.url,o=r.mediaType||"image/jpeg";if(!e)return{ok:!1,reason:"unreadable"};if(e.startsWith("http"))n.push({type:"file",mediaType:o,url:e});else try{const r=await t.readBlob(e),{url:i,mediaType:a}=await t.compress(r,o);n.push({type:"file",mediaType:a,url:i})}catch(e){return{ok:!1,reason:"unreadable"}}}return{ok:!0,fileParts:n}}(e.files)}finally{P(!1)}if(!r.ok)return void p.oR.error((o=r.reason,"unsupported-type"===o?"Please upload a valid image file (JPEG, PNG, WebP, or GIF)":"That image couldn't be attached. Try adding it again â your message wasn't sent."));var o;const{fileParts:a}=r;i(e.text||"",a.length>0?a:void 0),(b||"undefined"!=typeof window&&window.innerWidth<768)&&(null==(n=S.current)||n.blur())},[i,b]),F=(0,r.useCallback)(e=>{"max_file_size"===e.code?p.oR.error("File size exceeds 10MB limit"):"accept"===e.code?p.oR.error("Please upload a valid image file"):p.oR.error(e.message)},[]);return(0,l.jsx)(d.VA,{widgetId:m,displayName:v,initialState:y,presets:x,children:(e,t,n)=>{var r,i,d,p,f,m,v,y,x,P,B,L,R;const T=e,M=b||"undefined"!=typeof window&&window.innerWidth<768,D=b&&"undefined"!=typeof window&&window.innerWidth<768,N=M&&null!=T.mobile_minHeight?T.mobile_minHeight:T.minHeight,z=!D&&N>=100,W=E||k||z,U=M&&null!=T.mobile_borderRadiusSingleLine?T.mobile_borderRadiusSingleLine:e.borderRadiusSingleLine,H=M&&null!=T.mobile_borderRadiusMultiLine?T.mobile_borderRadiusMultiLine:e.borderRadiusMultiLine,Q="".concat(W?H:U,"px"),Z=null!==(r=e.borderWidth)&&void 0!==r?r:1,q=n(e.borderColor),Y="0 0 0 ".concat(Z,"px ").concat(q),K=e.shadowEnabled&&e.shadow?"".concat(e.shadow,", ").concat(Y):Y,G=gt(gt({},e),{},{iconSize:M&&T.mobile_iconSize?T.mobile_iconSize:e.iconSize,submitButtonSize:M&&T.mobile_submitButtonSize?T.mobile_submitButtonSize:e.submitButtonSize,iconGap:M&&T.mobile_iconGap?T.mobile_iconGap:null!==(i=T.iconGap)&&void 0!==i?i:8});return(0,l.jsx)("div",{className:"tw:mx-auto tw:w-full",style:{maxWidth:"".concat(e.maxWidth,"px")}
1,children:(0,l.jsxs)("div",{className:"concierge-prompt-input",style:{borderRadius:Q,backgroundColor:n(e.backgroundColor),boxShadow:K,transition:"border-radius 0.15s ease-out"},children:[(0,l.jsx)("style",{children:st({focusBorderColor:n(e.borderColorFocus),fontSize:e.fontSize,fontWeight:e.fontWeight,fontFamilyCss:T.fontFamilyCss||"inherit",textColor:n(e.textColor),placeholderColor:n(e.placeholderColor),submitBgColor:n(e.submitButtonBgColor),submitBgColorHover:n(e.submitButtonBgColorHover),mobileFontSize:null!==(d=T.mobile_fontSize)&&void 0!==d?d:14,mobilePaddingY:null!==(p=T.mobile_paddingY)&&void 0!==p?p:e.paddingY,mobilePaddingX:null!==(f=T.mobile_paddingX)&&void 0!==f?f:e.paddingX,mobileMinHeight:D?Math.min(null!==(m=null!==(v=T.mobile_minHeight)&&void 0!==v?v:T.minHeight)&&void 0!==m?m:0,46):null!==(y=null!==(x=T.mobile_minHeight)&&void 0!==x?x:T.minHeight)&&void 0!==y?y:0,mobileIconGap:null!==(P=null!==(B=T.mobile_iconGap)&&void 0!==B?B:T.iconGap)&&void 0!==P?P:8,mobileIconSize:null!==(L=T.mobile_iconSize)&&void 0!==L?L:e.iconSize,mobileSubmitButtonSize:null!==(R=T.mobile_submitButtonSize)&&void 0!==R?R:e.submitButtonSize,forceMobile:b})}),(0,l.jsx)(Be,{onSubmit:V,multiple:!0,globalDrop:!0,accept:"image/*",maxFiles:5,maxFileSize:10485760,onError:F,className:"tw:w-full",children:(0,l.jsxs)(Le,{className:"tw:flex tw:flex-col tw:w-full",children:[(0,l.jsx)(ze,{onAttachmentsChange:O,styles:e}),(0,l.jsxs)("div",{className:"tw:flex tw:w-full concierge-input-container",style:gt(gt({flexDirection:W?"column":"row",alignItems:W?"stretch":"center"},T.minHeight>0?{minHeight:"".concat(D?Math.min(T.minHeight,46):T.minHeight,"px")}:void 0),{},{padding:W?"".concat(e.paddingY+4,"px ").concat(e.paddingX,"px ").concat(e.paddingY,"px ").concat(e.paddingX+4,"px"):"".concat(e.paddingY,"px ").concat(e.paddingX,"px"),boxSizing:"border-box",transition:"all 0.2s ease-out",cursor:"text"}),onClick:e=>{var t;e.target.closest(".concierge-prompt-input-icons")||null==(t=S.current)||t.focus()},children:[(0,l.jsx)("div",{className:W?"tw:flex-1 tw:min-w-0":"tw:flex-1 tw:min-w-0 tw:flex tw:items-center",style:z?{overflow:"auto"}:void 0,children:(0,l.jsx)(Re,{ref:S,placeholder:o,"aria-label":o,disabled:a,value:u,onChange:e=>null==g?void 0:g(e.target.value),rows:1,"data-expanded":W?"true":void 0,style:{minHeight:"auto",maxHeight:null!=h?h:Math.ceil(1.5*e.fontSize*5),overflowY:"auto",paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0,transition:"padding 0.2s ease-out"}})}),(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:shrink-0 concierge-prompt-input-icons","data-expanded":W?"true":void 0,style:{gap:G.iconGap,paddingRight:0,paddingLeft:0,paddingBottom:0,paddingTop:W?8:0,justifyContent:W?"flex-end":void 0,transition:"all 0.2s ease-out"},children:[e.showAttachmentButton&&(0,l.jsx)(tt,{disabled:a||s,styles:G,resolveColor:n}),e.showMicrophoneButton&&!(w&&A)&&(0,l.jsx)(nt,{disabled:a||s,textareaRef:S,onChange:g,styles:G,themeIcons:t,resolve
1Color:n}),w&&A&&(0,l.jsx)(at,{disabled:a||s,onClick:A,assistantName:C,ctaLabel:j,styles:G,resolveColor:n}),(0,l.jsx)(ot,{disabled:a||I||!s&&!(null==u?void 0:u.trim())&&!k,isStreaming:s,onStop:c,styles:G,resolveColor:n})]})]})]})})]})})}})};var mt=n(33662);function vt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vt(Object(n),!0).forEach(function(t){xt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bt=e=>{let{stacklineSku:t,axios:n,apiBaseUrl:r,enabled:o=!0,source:i}=e;const{data:a,isLoading:l,error:s}=(0,mt.I)({queryKey:["conversationStarters",t,r,i],queryFn:()=>(async(e,t,n,r)=>{var o;const i=JSON.stringify(yt({stacklineSku:e},r?{source:r}:{}));if(t)return(null==(o=(await t.post("/concierge/conversationStarters",yt({stacklineSku:e},r?{source:r}:{}))).data)?void 0:o.questions)||[];if(n){const e=await fetch("".concat(n,"/api-rewards/concierge/conversationStarters"),{method:"POST",headers:{"Content-Type":"application/json"},body:i});if(e.ok){const t=await e.json();return(null==t?void 0:t.questions)||[]}return[]}{const e=await(0,f.fk)(),t=await fetch("".concat((0,m.e5)(),"/api-rewards/concierge/conversationStarters"),{method:"POST",headers:yt(yt({},e),{},{"Content-Type":"application/json"}),body:i});if(t.ok){const e=await t.json();return(null==e?void 0:e.questions)||[]}return[]}})(t,n,r,i),enabled:o&&!!t,staleTime:3e5,gcTime:6e5});return{questions:a||[],isLoading:l,error:s}},wt=e=>{let{displayQueries:t,isLoadingSuggestedQueries:n,onSearch:o,pageContext:i,apiBaseUrl:a,brandLogoUrl:s,brandName:c="",userName:u,conciergeName:p="Concierge",searchInputValue:g,setSearchInputValue:f,handleSearch:h,isActivelyStreaming:m,isMobile:v=!1,voiceCallEnabled:y=!1,onVoiceCallClick:x,voiceAssistantName:b}=e;const w=null==i?void 0:i.pageType,A=null==i?void 0:i.stacklineSku,C=(0,d.at)("concierge-chat-input",{}).placeholderDefault||"Ask me anything",{questions:j,isLoading:S}=bt({stacklineSku:A,apiBaseUrl:a,source:null==i?void 0:i.source,enabled:"pdp"===w&&!!A}),k=(0,r.useMemo)(()=>j.length>0?j:t,[j,t]),O=(0,r.useMemo)(()=>S||"pdp"===(null==i?void 0:i.pageType)&&n,[S,null==i?void 0:i.pageType,n]);return(0,l.jsx)(d.hO,{widgetId:"concierge-home-layout",displayName:"Home Layout",children:(e,t)=>{var n;const r=v||"undefined"!=typeof window&&window.innerWidth<768,i=r&&"inherit"!==e.mobile_logoPosition?e.mobile_logoPosition:e.logoPosition,a=r&&"inherit"!==e.mobile_startersMode?e.mobile_startersMode:e.startersMode,w="colored"===e.backgroundStyle?t(e.backgroundColor):"#ffffff",A="hidden"!==a&&k.length>0&&!O?(0,l.jsx)(d.BR,{mode:a,elementStyle:e.elementStyle,cardLayoutDirection:e.cardLayoutDirection,maxStarters:e.maxStarters,queries:k,onSearch:o}):null;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"100%",flex:1,minHeight:0,boxSizing:"border-box",overflow:r?"hidden auto":"auto",backgroundColor:w,position:"relative"},children:[(0,l.jsx)("div",{style:{flex:1}}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",textAlign:"center",padding:r?"16px 16px":"24px 16px",flexShrink:0},children:["hero"===i&&(0,l.jsxs)(l.Fragment,{children:["above-hero-logo"===e.brandLabelPosition&&(0,l.jsx)(d.qr,{}),(0,l.jsx)(d.Mr,{logoUrl:s}),"under-hero-logo"===e.subtitlePosition&&(0,l.jsx)(d.t1,{brandName:c,conciergeName:p})]}),e.showGreeting&&(0,l.jsx)(d.Mb,{userName:u,showIcon:e.showGreetingIcon,iconPosition:e.greetingIconPosition}),"under-greeting"===e.subtitlePosition&&(0,l.jsx)(d.t1,{brandName:c,conciergeName:p}),!r&&h&&f&&(0,l.jsx)("div",{style:{width:"100%",maxWidth:768,marginTop:null!==(n=e.searchInputGa
1p)&&void 0!==n?n:24},children:(0,l.jsx)(ht,{placeholder:C,value:null!=g?g:"",onChange:f,onSubmit:h,isStreaming:m,showCallButton:y&&!!x,onCallClick:x,voiceAssistantName:b})}),!r&&A,!r&&"after-content"===i&&(0,l.jsxs)("div",{style:{marginTop:e.footerGap,display:"flex",flexDirection:"column",alignItems:"center"},children:["above-footer-logo"===e.brandLabelPosition&&(0,l.jsx)(d.qr,{}),(0,l.jsx)(d.Mr,{logoUrl:s})]})]}),(0,l.jsx)("div",{style:{flex:r?1:1.2}}),r&&A&&(0,l.jsx)("div",{style:{flexShrink:0},children:A}),r&&h&&f&&(0,l.jsx)("div",{style:{flexShrink:0,paddingTop:16,paddingLeft:16,paddingRight:16,paddingBottom:"max(24px, env(safe-area-inset-bottom))"},children:(0,l.jsx)(ht,{placeholder:"Ask me anything",value:null!=g?g:"",onChange:f,onSubmit:h,isStreaming:m,showCallButton:y&&!!x,onCallClick:x,voiceAssistantName:b,forceMobile:!0})}),!r&&"footer"===i&&(0,l.jsx)("div",{style:{position:"absolute",bottom:0,left:0,right:0,display:"flex",flexDirection:"column",alignItems:"center",gap:e.footerGap,pointerEvents:"none"},children:(0,l.jsxs)("div",{style:{pointerEvents:"auto"},children:["above-footer-logo"===e.brandLabelPosition&&(0,l.jsx)(d.qr,{}),(0,l.jsx)(d.Mr,{logoUrl:s})]})})]})}})},At=(0,r.memo)(wt);function Ct(){const[e,t]=(0,r.useState)("undefined"!=typeof window&&window.innerWidth<768);return(0,r.useEffect)(()=>{const e=()=>t(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),e}function jt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function St(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jt(Object(n),!0).forEach(function(t){kt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ot=e=>{let{color:t="currentColor"}=e;return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"14",viewBox:"0 0 10 12",fill:"none",style:{flexShrink:0},children:(0,l.jsx)("path",{d:"M9.2697 7.16486C9.27038 7.1669 9.27106 7.16893 9.27173 7.17097C9.28997 7.21715 9.30078 7.26673 9.30078 7.31971C9.30078 7.372 9.28997 7.42226 9.27173 7.46844C9.27106 7.47048 9.27038 7.47252 9.2697 7.47455C9.24876 7.52481 9.21904 7.57031 9.1812 7.60835L6.12418 10.6809C5.9661 10.8398 5.70939 10.8398 5.55129 10.6809C5.39321 10.5219 5.39321 10.2639 5.55129 10.1049L7.91652 7.72718H3.94894C1.93704 7.72718 0.300781 6.08228 0.300781 4.05971V0.707551C0.300781 0.482746 0.482514 0.300049 0.706136 0.300049C0.929757 0.300049 1.11149 0.482746 1.11149 0.707551V4.05971C1.11149 5.63263 2.38428 6.91211 3.94887 6.91211H7.91594L5.55071 4.53436C5.39262 4.37544 5.39262 4.11736 5.55071 3.95844C5.62975 3.87897 5.73379 3.8389 5.83714 3.8389C5.94051 3.8389 6.04454 3.87897 6.12358 3.95844L9.1806 7.03164C9.21911 7.06899 9.24876 7.11392 9.2697 7.16486Z",fill:t,stroke:t,strokeWidth:"0.6"})})},It={normal:400,medium:500,semibold:600,bold:700},Pt=e=>{let{query:t,state:n,resolveColor:o,onSearch:i}=e;const[a,s]=(0,r.useState)(!1);return(0,l.jsxs)("button",{onClick:()=>i(t),onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),style:{padding:"".concat(n.pillPaddingY,"px ").concat(n.pillPaddingX,"px"),borderRadius:"".concat(n.pillBorderRadius,"px"),border:"".concat(n.pillBorderWidth,"px solid ").concat(o(n.pillBorderColor)),backgroundColor:a&&o(n.pillBgColorHover)||o(n.pillBgColor),color:o(n.pillTextColor),fontSize:"".concat(n.pillFontSize,"px"),fontWeight:It[n.pillFontWeight]||500,fontFamily:n.pillFontFamilyCss||"inherit",curs
1or:"pointer",textAlign:"left",boxShadow:"0 4px 16px 0 rgba(0, 0, 0, 0.05)",transition:"background-color 0.15s ease",width:"horizontal"===n.layout?"auto":"100%",whiteSpace:"horizontal"===n.layout?"nowrap":void 0,flexShrink:"horizontal"===n.layout?0:void 0,display:"flex",alignItems:"center",gap:n.showIcon?"8px":void 0},children:[n.showIcon&&(0,l.jsx)(Ot,{color:o(n.pillTextColor)}),t]})},Et=e=>{let{displayQueries:t,isLoadingSuggestedQueries:n,onSearch:o,pageContext:i,apiBaseUrl:a,userName:s,brandName:c="",conciergeName:u="Concierge"}=e;const p=null==i?void 0:i.pageType,g=null==i?void 0:i.stacklineSku,f=Ct(),h=(0,d.at)("concierge-welcome-greeting",{}),{questions:m,isLoading:v}=bt({stacklineSku:g,apiBaseUrl:a,source:null==i?void 0:i.source,enabled:"pdp"===p&&!!g}),y=(0,r.useMemo)(()=>m.length>0?m:t,[m,t]),x=(0,r.useMemo)(()=>v||"pdp"===(null==i?void 0:i.pageType)&&n,[v,null==i?void 0:i.pageType,n]);return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",width:"100%",flex:1,minHeight:0,boxSizing:"border-box"},children:[(0,l.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"24px 16px 0 16px",textAlign:"center",minHeight:0,gap:0},children:[(0,l.jsx)(d.fI,{widgetId:"concierge-welcome-greeting",displayName:"Welcome Greeting",initialState:{content:s?"Hi, ".concat(s,"."):h.loggedOutGreeting||"Hello!",fontSize:16,fontWeight:"semibold",color:{type:"custom",value:"#000000"},textAlign:"center",lineHeight:1.625,letterSpacing:.08,textTransform:"none"}}),(0,l.jsx)("div",{style:{maxWidth:340},children:(0,l.jsx)(d.fI,{widgetId:"concierge-welcome-message",displayName:"Welcome Message",excludeEditFields:["content"],initialState:{content:c&&"brandclub"!==c.toLowerCase()?"I'm ".concat(u,", your shopping assistant for ").concat(c,"."):"I'm ".concat(u,", your Brandclub shopping assistant."),fontSize:20,fontWeight:"semibold",color:{type:"custom",value:"#000000"},textAlign:"center",lineHeight:1.4,letterSpacing:.08,textTransform:"none"}})})]}),!f&&y.length>0&&!x&&(0,l.jsx)(d.nr,{widgetId:"concierge-suggestion-list",displayName:"Suggestion List",children:(e,t)=>{const n="horizontal"===e.layout;return(0,l.jsxs)("div",{style:{flexShrink:0,padding:"0 16px 12px 16px"},children:[(0,l.jsx)("div",{style:St({width:"100%",display:"flex",flexDirection:n?"row":"column",gap:"".concat(e.containerGap,"px"),maxWidth:"100%"},n?{overflowX:"auto",overflowY:"hidden",paddingRight:16,paddingBottom:4,scrollbarWidth:"none",msOverflowStyle:"none"}:{}),children:y.slice(0,n?void 0:4).map((n,r)=>(0,l.jsx)(Pt,{query:n,state:e,resolveColor:t,onSearch:o},r))}),n&&(0,l.jsx)("style",{children:"\n .concierge-root div::-webkit-scrollbar { display: none; }\n "})]})}})]})},Vt=(0,r.memo)(Et);var Ft=n(23375);const Bt=()=>{const[e,t]=(0,r.useState)("undefined"!=typeof window?window.location.pathname:"/");(0,r.useEffect)(()=>{const n=()=>t(window.location.pathname);window.addEventListener("popstate",n);const r=setInterval(()=>{window.location.pathname!==e&&n()},100);return t(window.location.pathname),()=>{window.removeEventListener("popstate",n),clearInterval(r)}},[e]);const n=Ft.FI.isPDP(e),o=e.match(/\/p\/([^/]+)\/product/i);if(n||o){const t=/^\/pdp\/([^/]+)/i,n=e.match(t),r=(null==n?void 0:n[1])||(null==o?void 0:o[1]);if(r)return{pageType:"pdp",stacklineSku:r}}return Ft.FI.isBrandPage(e)?{pageType:"brand"}:Ft.FI.isBrandclubPage(e)?{pageType:"brandclub"}:{pageType:"other"}};var Lt=n(4327);function Rt(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Rt(Object(n),!0).forEach(function(t){Mt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Rt(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Mt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Dt=e=>{let{trendingSearches:t,onSearch:n,brandId:o,isEmbedded:i=!1,apiBaseUrl:a,userFirstName:s,pageContext:c,brandLogoUrl:u,brandName:p,conciergeName:f,searchInputValue:h,setSearchInputValue:m,handleSearch:v,isActivelyStreaming:y,isMobile:x}=e;const{data:b,isLoading:w}=(0,g.J0)(o,a),A=(0,d.Hr)(),C=(0,d.S5)(),j=(0,d.Zp)(),{openVoiceCall:S}=(0,Lt.Ox)(),k=(0,r.useCallback)(()=>{S()},[S]),O=(0,r.useMemo)(()=>(null==b?void 0:b.suggestedQuestions)||(null==t?void 0:t.map(e=>({query:e.text,imageUrl:""})))||[],[null==b?void 0:b.suggestedQuestions,t]),I=(0,r.useMemo)(()=>{var e;
1if(!1===(null==A?void 0:A.searchPrompts))return[];const t=null==(e=null==A?void 0:A.defaultSearchPrompts)?void 0:e.filter(e=>e.trim());return(null==t?void 0:t.length)?t:O.map(e=>e.query)},[O,A]),P=Bt(),E={displayQueries:I,isLoadingSuggestedQueries:w,onSearch:n,pageContext:null!=c?c:P,apiBaseUrl:a,brandLogoUrl:u,brandName:p,userName:s,conciergeName:f,searchInputValue:h,setSearchInputValue:m,handleSearch:v,isActivelyStreaming:y,isMobile:x};return i?(0,l.jsx)(Vt,Tt({},E)):(0,l.jsx)(At,Tt(Tt({},E),{},{voiceCallEnabled:C.enabled,onVoiceCallClick:k,voiceAssistantName:j.persona.assistantName}))},Nt=(0,r.memo)(Dt),zt=()=>(0,l.jsxs)("div",{style:{width:"100%",maxWidth:"768px",display:"flex",flexDirection:"column",gap:"16px",padding:"16px"},children:[(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",animation:"fadeIn 0.3s ease-in"},children:(0,l.jsx)("div",{style:{width:"min(70%, 280px)",height:"48px",backgroundColor:"#EEF4FC",borderRadius:"18px",borderBottomRightRadius:"5px",animation:"pulse 1.5s ease-in-out infinite"}})}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-start",animation:"fadeIn 0.3s ease-in 0.2s both"},children:(0,l.jsxs)("div",{style:{width:"100%",display:"flex",flexDirection:"column",gap:"8px"},children:[(0,l.jsx)("div",{style:{width:"100%",height:"80px",backgroundColor:"#f8f9fa",borderRadius:"12px",animation:"pulse 1.5s ease-in-out infinite"}}),(0,l.jsx)("div",{style:{width:"85%",height:"60px",backgroundColor:"#f8f9fa",borderRadius:"12px",animation:"pulse 1.5s ease-in-out infinite",animationDelay:"0.2s"}})]})}),(0,l.jsx)("style",{children:"\n @keyframes pulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.5; }\n }\n "})]});var Wt=n(5740);const Ut=["className","sideOffset"];function Ht(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Qt(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ht(Object(n),!0).forEach(function(t){Zt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ht(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Zt(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const qt=Wt.Kq,Yt=Wt.bL,Kt=Wt.l9,Gt=r.forwardRef((e,t)=>{let{className:n,sideOffset:r=4}=e,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Ut);return(0,l.jsx)(Wt.ZL,{children:(0,l.jsx)(Wt.UC,Qt({ref:t,sideOffset:r,className:j("tw:z-50 tw:overflow-hidden tw:rounded-md tw:bg-primary tw:px-3 tw:py-1.5 tw:text-xs tw:font-semibold tw:text-primary-foreground tw:animate-in tw:fade-in-0 tw:zoom-in-95 tw:data-[state=closed]:animate-out tw:data-[state=closed]:fade-out-0 tw:data-[state=closed]:zoom-out-95 tw:data-[side=bottom]:slide-in-from-top-2 tw:data-[side=left]:slide-in-from-right-2 tw:data-[side=right]:slide-in-from-left-2 tw:data-[side=top]:slide-in-from-bottom-2 tw:origin-[--radix-tooltip-content-transform-origin]",n)},o))})});Gt.displayName=Wt.UC.displayName;const Jt=["className","children"],Xt=["tooltip","children","label","className","tooltipOpen"];function _t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function $t(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?_t(Object(n),!0).forEach(function(t){en(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_t(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function en(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function tn(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}const nn=e=>{let{className:t,children:n}=e,r=tn(e,Jt);return(0,l.jsx)("div",$t($t({className:j("tw:inline-flex tw:items-center tw:gap-1 tw:rounded-[10px]",t)},r),{},{children:n}))},rn=e=>{if(!e)return;e.style.setProperty("width","".concat(24,"px"),"important"),e.style.setProperty("height","".concat(24,"px"),"important"),e.style.setProperty("padding","0","important"),e.style.setProperty("border","none","important"),e.style.setProperty("box-sizing","border-box","important");const t=e.querySelector("svg");t&&(t.style.setProperty("width","".concat(20,"px"),"important"),t.style.setProperty("height","".concat(20,"px"),"important"),t.style.setProperty("flex-shrink","0","important"))},on=e=>{let{tooltip:t,children:n,label:o,className:i,tooltipOpen:a}=e,s=tn(e,Xt);const[c,d]=(0,r.useState)(!1),u=(0,r.useRef)(a);(0,r.useEffect)(()=>{!0!==u.current||a||d(!1),u.current=a},[a]);const p=a||c,g=(0,l.jsxs)("button",$t($t({ref:rn,className:j("tw:flex tw:items-center tw:justify-center tw:w-6 tw:h-6 tw:min-w-0 tw:min-h-0 tw:cursor-pointer tw:rounded-[5px] tw:bg-transparent tw:border-none tw:p-0 tw:text-current tw:hover:bg-[#F7F8FA] tw:transition-colors tw:[&_svg]:w-5 tw:[&_svg]:h-5 tw:[&_svg]:shrink-0",i),type:"button",onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1)},s),{},{children:[n,(0,l.jsx)("span",{className:"tw:sr-only",children:o||t})]}));return t?(0,l.jsx)(qt,{delayDuration:200,children:(0,l.jsxs)(Yt,{open:p,children:[(0,l.jsx)(Kt,{asChild:!0,children:g}),(0,l.jsx)(Gt,{side:"bottom",children:(0,l.jsx)("p",{children:t})})]})}):g};var an=n(20074);function ln(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function sn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ln(Object(n),!0).forEach(function(t){cn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ln(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function cn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const dn=e=>{let{children:t,as:n="p",className:o,duration:i=2,spread:a=2,style:s,color:c,highlightColor:d}=e;const u=(0,an.P)(n),p=(0,r.useMemo)(()=>{var e;return(null!==(e=null==t?void 0:t.length)&&void 0!==e?e:0)*a},[t,a]),g=null!=c?c:"var(--color-muted-foreground)",f=null!=d?d:"var(--color-background)";return(0,l.jsx)(u,{animate:{backgroundPosition:"0% center"},className:j("tw:relative tw:inline-block tw:bg-[length:250%_100%,auto] tw:bg-clip-text tw:text-transparent","tw:[background-repeat:no-repeat,padding-box]",o),initial:{backgroundPosition:"100% center"},style:sn({"--spread":"".concat(p,"px"),backgroundImage:"linear-gradient(90deg, #0000 calc(50% - var(--spread)), ".concat(f,", #0000 calc(50% + var(--spread))), linear-gradient(").concat(g,", ").concat(g,")")},s),transition:{repeat:Number.POSITIVE_INFINITY,duration:i,ease:"linear"},children:t})},un=(0,r.memo)(dn);var pn=n(68709);function gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function fn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?gn(Object(n),!0).forEach(function(t){hn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function hn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const mn=(0,r.forwardRef)((e,t)=>(0,l.jsx)("svg",fn(fn({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none"},e),{},{ref:t,children:(0,l.jsx)("path",{d:"M12.668 10.667c0-.71 0-1.204-.031-1.588a2.4 2.4 0 0 0-.113-.615l-.055-.13a1.84 1.84 0 0 0-.676-.731l-.127-.072c-.158-.08-.37-.137-.745-.168-.384-.031-.877-.031-1.588-.031H6.5c-.711 0-1.204 0-1.588.031a2.4 2.4 0 0 0-.615.113l-.13.055a1.84 1.84 0 0 0-.731.676l-.07.127c-.081.158-.138.37-.169.745-.031.384-.032.877-.032 1.588V13.5c0 .711 0 1.204.032 1.588.031.376.088.587.168.745l.07.126c.177.288.43.522.732.676l.13.056c.144.052.333.089.615.112.384.031.877.032 1.588.032h2.833c.71 0 1.204 0 1.588-.032.376-.031.587-.088.745-.168l.127-.07c.287-.177.522-.43.676-.732l.055-.13c.052-.144.09-.333.113-.615.031-.384.031-.877.031-1.588zm1.33 1.998c.455-.002.803-.005 1.09-.028.376-.031.587-.088.745-.168l.126-.071c.288-.177.522-.43.676-.732l.056-.13a2.4 2.4 0 0 0 .112-.615c.031-.384.032-.877.032-1.588V6.5c0-.711 0-1.204-.032-1.588a2.4 2.4 0 0 0-.112-.615l-.056-.13a1.84 1.84 0 0 0-.676-.731l-.126-.07c-.158-.081-.37-.138-.745-.169-.384-.031-.877-.032-1.588-.032h-2.833c-.71 0-1.204.001-1.588.032-.282.023-.471.06-.615.112l-.13.056a1.84 1.84 0 0 0-.731.676l-.072.126c-.08.158-.137.37-.168.745-.023.287-.027.635-.029 1.09h1.999c.689 0 1.246 0 1.696.036.458.038.865.117 1.242.309l.217.122c.496.304.9.74 1.165 1.26l.067.143c.144.337.21.698.242 1.099.037.45.036 1.007.036 1.696zm4.167-3.332c0 .689 0 1.246-.036 1.696-.033.401-.098.762-.242 1.099l-.067.143c-.265.52-.67.956-1.165 1.26l-.219.122c-.376.192-.782.271-1.24.309-.337.027-.734.031-1.2.033-.003.467-.007.864-.034 1.201-.033.401-.098.762-.242 1.098l-.067.142c-.265.522-.669.958-1.165 1.262l-.217.122c-.377.192-.784.271-1.242.309-.45.037-1.007.036-1.696.036H6.5c-.69 0-1.246 0-1.696-.036-.4-.033-.762-.098-1.098-.242l-.143-.067a3.17 3.17 0 0 1-1.261-1.165l-.122-.219c-.192-.376-.271-.782-.309-1.24-.037-.45-.036-1.007-.036-1.696v-2.833c0-.689 0-1.246.036-1.696.038-.458.117-.865.309-1.242l.122-.217c.304-.496.74-.9 1.261-1.165l.143-.067c.336-.144.697-.21 1.098-.242.337-.027.733-.032 1.2-.034.002-.467.007-.863.034-1.2.037-.458.117-.864.309-1.24l.122-.22c.304-.495.74-.899 1.26-1.164l.143-.067c.337-.144.698-.21 1.099-.242.45-.037 1.007-.036 1.696-.036H13.5c.69 0 1.246 0 1.696.036.458.038.864.117 1.24.309l.22.122c.495.304.899.74 1.164 1.261l.067.143c.144.336.21.697.242 1.098.037.45.036 1.007.036 1.696z",fill:"currentColor"})})));function vn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vn(Object(n),!0).forEach(function(t){xn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}mn.displayName="CopyIcon";const bn=(0,r.forwardRef)((e,t)=>(0,l.jsx)("svg",yn(yn({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none"},e),{},{ref:t,children:(0,l.jsx)("path",{d:"M2.668 12.666V12.5a.665.665 0 0 1 1.33 0v.166c0 .711.001 1.205.033 1.588.03.376.087.587.167.745l.07.127c.177.288.43.522.732.676l.13.056c.144.051.333.089.615.112.384.031.877.031 1.588.031h5.333c.711 0 1.205 0 1.588-.031.376-.03.587-.088.745-.168l.127-.071c.288-.176.522-.43.676-.732l.056-.13c.051-.143.089-.333.112-.615.031-.383.031-.877.031-1.588V12.5a.665.665 0 0 1 1.33 0v.166c0 .69 0 1.246-.036 1.697-.033.4-.098.762-.242 1.098l-.066.143c-.266.52-.67.957-1.165 1.26l-.218.123c-.377.192-.783.27-1.241.308-.45.037-1.008.036-1.697.036H7.333c-.689 0-1.246.001-1.696-.036-.4-.033-.761-.097-1.098-.241l-.142-.067a3.17 3.17 0 0 1-1.262-1.165l-.122-.218c-.192-.377-.271-.783-.309-1.241-.036-.45-.036-1.008-.036-1.697m6.667-.166V4.94L7.137 7.137a.665.665 0 0 1-.94-.94L9.53 2.863l.101-.083a.666.666 0 0 1 .839.083l3.334 3.334a.666.666 0 0 1-.941.94L10.665 4.94v7.56a.666.666 0 0 1-1.33 0",fill:"currentColor"})})));function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function An(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?wn(Object(n),!0).forEach(function(t){Cn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}bn.displayName="ShareIcon";const jn=(0,r.forwardRef)((e,t)=>(0,l.jsx)("svg",An(An({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none"},e),{},{ref:t,children:(0,l.jsx)("path",{d:"M12.669 5.833c0-.613-.004-.923-.03-1.129l-.033-.179a1.84 1.84 0 0 0-1.18-1.262l-.118-.035c-.212-.057-.49-.063-1.308-.063H8.055c-1.01 0-1.43.01-1.725.097l-.12.042c-.26.107-.49.272-.676.482l-.077.092c-.152.197-.254.453-.423 1.039l-.196.705-.381 1.396c-.209.764-.354 1.3-.434 1.721-.08.418-.08.653-.042.825l.055.194c.15.442.464.812.882 1.032l.133.058c.15.053.357.095.674.12.427.033.983.034 1.775.034a.665.665 0 0 1 .654.784l-.019.076-.79 2.57a1.833 1.833 0 0 0 1.466 2.35l2.698-4.721.074-.12a2.1 2.1 0 0 1 1.086-.832zm4.663 2.5c0 .64.004 1.101-.07 1.49l-.039.162a3.17 3.17 0 0 1-2.036 2.177l-.2.062c-.425.113-.921.108-1.653.108a.77.77 0 0 0-.614.303l-.056.085-2.92 5.11a.67.67 0 0 1-.66.33l-.378-.048a3.165 3.165 0 0 1-2.632-4.071l.526-1.714a15 15 0 0 1-.98-.033c-.432-.034-.82-.1-1.173-.255l-.148-.072a3.16 3.16 0 0 1-1.574-1.947l-.042-.167c-.095-.431-.06-.875.034-1.363.092-.484.254-1.079.457-1.822l.38-1.396.192-.692c.183-.638.356-1.123.658-1.515l.133-.16c.32-.361.717-.646 1.165-.83l.234-.083c.559-.166 1.215-.157 2.12-.157h4.61c.69 0 1.247 0 1.697.036.458.038.864.117 1.24.309l.218.122c.496.304.9.74 1.166 1.262l.067.142c.144.336.209.697.242 1.098.036.45.036 1.007.036 1.696zm-3.334 2.663c.334-.006.503-.019.643-.056l.117-.037a1.84 1.84 0 0 0 1.181-1.261l.033-.18c.026-.205.03-.515.03-1.129V6.5c0-.711-.001-1.204-.032-1.588a2.4 2.4 0 0 0-.113-.615l-.055-.13a1.84 1.84 0 0 0-.676-.731L15 3.366c-.158-.081-.37-.138-.745-.169a12 12 0 0 0-.843-.029c.215.302.38.643.478 1.013l.037.163c.054.278.068.592.07.982z",fill:"currentColor"})})));function Sn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function kn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Sn(Object(n),!0).forEach(function(t){On(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Sn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function On(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}jn.displayName="ThumbsDownIcon";const In=(0,r.forwardRef)((e,t)=>(0,l.jsx)("svg",kn(kn({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none"},e),{},{ref:t,children:(0,l.jsx)("path",{d:"m10.915 1.84.38.048.18.027a3.165 3.165 0 0 1 2.5 3.867l-.049.177-.527 1.713c.372.004.697.012.98.034.495.039.932.122 1.322.327l.152.085a3.17 3.17 0 0 1 1.464 2.03l.03.162c.056.38.018.773-.064 1.2q-.07.361-.187.813l-.27 1.01-.38 1.395c-.238.872-.402 1.508-.71 2.002l-.141.205a3.2 3.2 0 0 1-1.108.906l-.189.085c-.61.251-1.32.24-2.353.24H7.333c-.689 0-1.246 0-1.696-.037-.4-.033-.761-.098-1.098-.242l-.142-.067a3.17 3.17 0 0 1-1.262-1.165l-.122-.218c-.192-.377-.271-.783-.309-1.24-.036-.45-.036-1.008-.036-1.697v-1.833c0-.732-.006-1.23.108-1.653l.061-.201a3.17 3.17 0 0 1 2.177-2.037l.163-.037c.389-.075.849-.071 1.49-.071a.77.77 0 0 0 .67-.388l2.92-5.11.055-.082a.67.67 0 0 1 .603-.248M7.331 14.167c0 .817.006 1.096.063 1.308l.036.117a1.84 1.84 0 0 0 1.262 1.18l.178.035c.207.025.517.028 1.13.028h1.945c1.154 0 1.539-.012 1.845-.139l.11-.05c.25-.123.472-.302.643-.524l.073-.105c.16-.262.28-.665.546-1.639l.381-1.39
16.265-.99c.072-.282.129-.52.169-.731.06-.313.075-.523.062-.682l-.021-.143a1.84 1.84 0 0 0-.764-1.123l-.173-.103c-.156-.082-.383-.145-.806-.178-.427-.033-.983-.034-1.775-.034a.665.665 0 0 1-.635-.86l.79-2.57.05-.205a1.833 1.833 0 0 0-1.517-2.145L8.49 7.939a2.1 2.1 0 0 1-1.16.95zM3.998 13.5c0 .711.001 1.204.033 1.588.03.376.087.587.168.745l.07.126c.176.288.43.522.731.676l.13.055c.144.052.333.09.615.113.233.019.505.025.842.028a3.2 3.2 0 0 1-.416-.81l-.061-.202C5.996 15.396 6 14.9 6 14.167V9.003c-.207.004-.35.01-.464.024l-.178.034a1.84 1.84 0 0 0-1.263 1.18l-.035.117c-.057.212-.063.491-.063 1.309z",fill:"currentColor"})})));In.displayName="ThumbsUpIcon";const Pn=e=>{let{src:t,alt:n,onClose:o}=e;return(0,r.useEffect)(()=>{const e=e=>{"Escape"===e.key&&o()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),(0,u.createPortal)((0,l.jsxs)("div",{onClick:o,style:{position:"fixed",inset:0,zIndex:1e4,display:"flex",alignItems:"center",justifyContent:"center",backgroundColor:"lab(0% 0 0 / 0.9)"},children:[(0,l.jsx)("button",{onClick:o,style:{position:"absolute",top:"16px",right:"16px",background:"none",border:"none",color:"#fff",cursor:"pointer",padding:"8px",lineHeight:0},"aria-label":"Close preview",children:(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),(0,l.jsx)("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}),(0,l.jsx)("img",{src:t,alt:n||"Preview",onClick:e=>e.stopPropagation(),style:{maxWidth:"90vw",maxHeight:"90vh",objectFit:"contain",borderRadius:"8px",cursor:"default"}})]}),document.body)};function En(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Vn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?En(Object(n),!0).forEach(function(t){Fn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):En(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Fn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Bn=()=>(0,m.e5)(),Ln=!1,Rn=async e=>{let{conversationId:t,messageIndex:n,feedbackType:r,headersToInject:o,apiBaseUrl:i=Bn()}=e;const a=Vn(Vn({},o),{},{"Content-Type":"application/json"}),l=await fetch("".concat(i,"/api-rewards/concierge/message/feedback"),{method:"POST",headers:a,body:JSON.stringify({conversationId:t,messageIndex:n,feedbackType:r})});if(!l.ok)throw new Error("HTTP error! status: ".concat(l.status));return l.json()},Tn=20,Mn=3,Dn=new Set(["end_call"]),Nn=/\b(bye|goodbye|see ya|see you|talk (to you )?later|catch you later|take care|have a (good|great|nice) (day|one|evening))\b/i,zn=async e=>{let{conversationId:t,events:n,headersToInject:r,apiBaseUrl:o=Bn()}=e;try{await fetch("".concat(o,"/api-rewards/concierge/voice/event"),{method:"POST",headers:Vn(Vn({},r),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,events:n}),keepalive:!0})}catch(e){}},Wn=async e=>{let{conversationId:t,callId:n,toolName:r,args:o,headersToInject:i,apiBaseUrl:a=Bn()}=e;const l=await fetch("".concat(a,"/api-rewards/concierge/voice/tool"),{method:"POST",headers:Vn(Vn({},i),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,callId:n,toolName:r,args:o})});return l.ok?l.json():{status:"error",narratorText:"Sorry, I had a problem with that. Want to try again?",toolResultId:"".concat(n,"-fail-").concat(Date.now())}},Un=async e=>{let{conversationId:t,track:n,durationMs:r,mimeType:o,byteSize:i,uploadOk:a,headersToInject:l,apiBaseUrl:s=Bn()}=e;try{const e=await fetch("".concat(s,"/api-rewards/concierge/voice/recording/finalize"),{method:"POST",headers:Vn(Vn({},l),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,track:n,durationMs:r,mimeType:o,byteSize:i,uploadOk:a}),keepalive:!0});return e.ok?await e.json():{ok:!1,error:"http_".concat(e.status)}}catch(e){return{ok:!1,error:"network_error"}}};var Hn=n(41355);function Qn(e){let{text:t,sourcesMap:n}=e;if(!t.trim())return null;const r=(null==n?void 0:n.size)?function(e,t){return e.replace(/\[(\d+)\]/g,(e,n)=>{const r=t.get(n);if(!r)return e;const o=(r.title||r.url).replace(/[\r\n]+/g," ").replace(/\s{2,}/g," ").trim();return"[".concat(o,"](").concat(r.url,")")})}(t,n):t,o=Hn.xI.parse(r);return(0,l.jsx)("div",{className:"message-markdown",style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:o}})}Hn.xI.use({gfm:!0,breaks:!0,pedantic:!1,hooks:{postprocess:e=>e.replace(/<ul>/g,'<ul style="list-style-type:disc;padding-left:24px;">').replace(/<li>/g,'<li style="display:list-item;">')},renderer:{link(e){let{href:t,text:n}=e;return'<a href="'.concat(t,'" target="_blank" rel="noopener noreferrer" style="text-decoration:underline;color:inherit;">').concat(n,"</a>")}}});const Zn=e=>"call"===e||"partial-call"===e||"input-streaming"===e||"input-available"===e,qn=e=>
1"result"===e||"output-available"===e||"output"===e||"complete"===e;function Yn(e){let{part:t}=e;if(Zn(t.state))return null;if(qn(t.state)&&t.output){const{originalCount:e,filteredCount:n,appliedFilters:r}=t.output;return 0===e?null:(0,l.jsx)("div",{className:"concierge-search-results",children:(0,l.jsxs)("div",{className:"concierge-search-summary",children:["Filtered ",e," â ",n," products",(null==r?void 0:r.length)>0&&(0,l.jsxs)("span",{children:[" (",r.join(", "),")"]})]})})}return null}const Kn=["children","styleProps","gap"];function Gn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Jn(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Gn(Object(n),!0).forEach(function(t){Xn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xn(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _n=e=>{let{children:t,styleProps:n,gap:o=15}=e,i=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(e,Kn);const a=(0,r.useRef)(null),s=(0,r.useRef)([]),[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)(!1),g=()=>{if(!a.current)return;const{scrollLeft:e,scrollWidth:t,clientWidth:n}=a.current;d(e>10),p(e<t-n-10)};(0,r.useEffect)(()=>{const e=a.current;if(!e)return;g();const t=()=>{g()};return e.addEventListener("scroll",t),window.addEventListener("resize",g),()=>{e.removeEventListener("scroll",t),window.removeEventListener("resize",g)}},[t]);const f=e=>{if(!a.current)return;const t=.8*a.current.clientWidth,n=a.current.scrollLeft+("right"===e?t:-t);a.current.scrollTo({left:n,behavior:"smooth"})};return(0,l.jsxs)("div",Jn(Jn({className:j("tw:relative tw:w-full tw:max-w-full tw:overflow-hidden tw:flex tw:justify-start tw:items-center store-carousel-container")},n),{},{children:[(0,l.jsx)("style",{children:"\n .store-carousel-scroll::-webkit-scrollbar {\n display: none;\n }\n .store-carousel-arrow {\n position: absolute;\n top: 50%;\n transform: translateY(-50%);\n width: 32px;\n height: 32px;\n border-radius: 50%;\n background: white;\n border: 1px solid #e5e7eb;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n z-index: 10;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);\n opacity: 0;\n transition: opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;\n pointer-events: none;\n }\n .store-carousel-container:hover .store-carousel-arrow {\n opacity: 1;\n pointer-events: auto;\n }\n .store-carousel-arrow:hover {\n background: #f9fafb;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n }\n .store-carousel-arrow:active {\n transform: translateY(-50%) scale(0.95);\n }\n .store-carousel-arrow-left {\n left: 8px;\n }\n .store-carousel-arrow-right {\n right: 8px;\n }\n .store-carousel-arrow svg {\n width: 16px;\n height: 16px;\n color: #374151;\n }\n "}),c&&(0,l.jsx)("button",{className:"store-carousel-arrow store-carousel-arrow-left",onClick:()=>f("left"),"aria-label":"Scroll left",children:(0,l.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})})}),u&&(0,l.jsx)("button",{className:"store-carousel-arrow store-carousel-arrow-right",onClick:()=>f("right"),"aria-label":"Scroll right",children:(0,l.jsx)("svg",{fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,l.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})}),(0,l.jsx)(an.P.div,Jn(Jn({ref:a,style:{gap:"".concat(o,"px"),scrollbarWidth:"none",msOverflowStyle:"none"},className:j("store-carousel-scroll","tw:flex tw:overflow-auto tw:[scroll-snap-type:x_mandatory]")},i),{},{children:r.Children.map(t,(e,t)=>(0,l.jsx)("div",{className:"tw:snap-start tw:shrink-0",ref:e=>{!s.current[t]||e?s.current[t]=e:s.current=s.current.filter((e,n
1)=>n!==t)},children:e},t))}))]}))},$n=e=>{let{surveys:t,isLoading:n=!1,onSurveyClick:o}=e;const[i,a]=(0,r.useState)(()=>"undefined"!=typeof window&&window.innerWidth<500);(0,r.useEffect)(()=>{const e=()=>{a(window.innerWidth<500)};return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const s=i?240:280;return n&&0===t.length?(0,l.jsx)("div",{className:"tw:w-full tw:my-4",children:(0,l.jsx)(_n,{children:[1,2,3].map(e=>(0,l.jsx)("div",{style:{width:s,height:280,borderRadius:16,backgroundColor:"#f3f4f6",animation:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite"}},e))})}):t&&0!==t.length?(0,l.jsx)("div",{className:"tw:w-full tw:my-4",style:{padding:"8px 0"},children:(0,l.jsx)(_n,{gap:16,children:t.map(e=>(0,l.jsx)("div",{style:{padding:"4px"},children:(0,l.jsx)(d.rl,{survey:{campaignId:e.campaignId,title:e.title,brandName:e.brandName,brandId:e.brandId,brandLogoUrl:e.brandLogoUrl,description:e.description,rewardAmount:e.rewardAmount,previewImageUrl:e.previewImageUrl},width:s,onClick:o?()=>o(e):()=>window.open("/survey/".concat(e.campaignId),"_blank","noopener")})},e.campaignId))})}):null};function er(e){let{part:t,allParts:n}=e;var r;if(Zn(t.state))return null;const o=t.output;return qn(t.state)&&(null==(r=null==o?void 0:o.surveys)?void 0:r.length)&&o.surveys.length>0?(0,l.jsx)($n,{surveys:o.surveys}):null}function tr(e){let{part:t,onProductClick:n,pdpStacklineSku:r}=e;var o;if(Zn(t.state))return null;const i=t.output;if(qn(t.state)&&(null==(o=null==i?void 0:i.products)?void 0:o.length)&&i.products.length>0){const e=i.products;return r&&e.every(e=>e.stacklineSku===r)||i.fromPdp?null:(0,l.jsx)("div",{className:"concierge-product-details",children:e.map((e,t)=>(0,l.jsxs)("div",{className:"concierge-product-detail-card",onClick:()=>null==n?void 0:n(e.stacklineSku),role:"button",tabIndex:0,children:[e.imageUrl&&(0,l.jsx)("img",{src:e.imageUrl,alt:e.title}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{children:e.brand}),(0,l.jsx)("div",{children:e.title}),(0,l.jsxs)("div",{children:["$",null!=e.price?Number(e.price).toFixed(2):""]}),e.description&&(0,l.jsx)("div",{children:e.description})]})]},e.stacklineSku||t))})}return null}var nr=n(29520),rr=n(77555),or=n(59701);function ir(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ir(Object(n),!0).forEach(function(t){lr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ir(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sr=e=>{if(e>=1e3){const t=e/1e3;return"".concat(t%1==0?t:t.toFixed(1),"K")}return e.toLocaleString()},cr=e=>{let{color:t}=e;return(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",style:{flexShrink:0},children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.4819 6.07562C15.4285 5.8977 15.2864 5.76804 15.1153 5.74117L10.3089 4.98558L8.1594 0.273902C8.0829 0.106169 7.92499 0 7.75211 0C7.5792 0 7.42132 0.106169 7.3448 0.273902L5.19518 4.98558L0.388901 5.74117C0.217838 5.76804 0.0756731 5.89771 0.0222526 6.07558C-0.0311937 6.2535 0.0133808 6.44878 0.137199 6.57932L3.61497 10.2469L2.7941 15.4256C2.76485 15.6099 2.83492 15.7962 2.97479 15.9062C3.05391 15.9684 3.14764 16 3.24182 16C3.31413 16 3.38668 15.9814 3.45312 15.9436L7.75208 13.4985L12.0509 15.9435C12.204 16.0306 12.3894 16.0161 12.5292 15.9061C12.6691 15.7962 12.7392 15.6099 12.71 15.4255L11.8888 10.2469L15.367 6.5793C15.4908 6.44879 15.5354 6.2535 15.4819 6.07562H15.4819Z",fill:t})})};function dr(e){let{pdpUrl:t,styles:n,children:r}=e;const o={display:"flex",alignItems:"center",justifyContent:"space-between",padding:n.containerPadding,border:"1px solid ".concat(n.containerBorderColor),borderRadius:n.containerBorderRadius,gap:16,minHeight:80,boxSizing:"border-box",textDecoration:"none",color:"inherit"};return t?(0,l.jsx)("a",{href:t,target:"_blank",rel:"noopener noreferrer",style:ar(ar({},o),{},{cursor:"pointer"}),children:r}):(0,l.jsx)("div",{style:o,children:r})}function ur(e){let{title:t,imageUrl:n,rating:r,reviewsCount:o,pdpUrl:i,styles:a}=e;return(0,l.jsxs)("div",{style:{animation:"concierge-fade-in 0.35s ease-out both"},children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:"\n@keyframes concierge-fade-in {\n from { opacity: 0; transform: translateY(12px); }\n to { opacity: 1; transform: translateY(0); }\n}"}}),(0,l.jsx)(dr,{pdpUrl:i,styles:a,children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0,flex:1},children:[(0,l.jsx)("img",{src:n||"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Crect width='120' height='120' fill='%23f5f5f5' rx='8'/%3E%3C/svg%3E",alt:t,style:{width:a.imageSize,height:a.imageSize,objectFit:"contain",flexShrink:0,alignSelf:"flex-start"}}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",columnGap:16,rowGap:2,minWidth:0,flex:1},children:[(0,l.jsx)("span",{style:{fontFamily:"inherit",fontWeight:a.titleFontWeight,fontSize:a.titleFontSize,lineHeight:"24px",color:a.titleColor,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:120,maxWidth:380,flex:1},children:t}),null!=r&&r>0&&(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:8,flexShrink:0},children:[(0,l.jsx)(cr,{color:a.ratingStarColor}),(0,l.jsxs)("span",{style:{fontFamily:"inherit",fontWeight:500,fontSize:a.ratingFontSize,lineHeight:"16px",color:a.ratingTextColor,whiteSpace:"nowrap"},children:[r.toFixed(1),null!=o&&o>0&&" (".concat(sr(o)," reviews)")]})]})]})]})})]})}function pr(e){let{data:t,styles:n}=e;const{title:r,imageUrl:o,rating:i,reviewsCount:a,stacklineSku:s,productUrl:c}=t,d=(0,rr.W)(window.location.search),u=(0,or.Ts)({title:r,stackl
1ineSku:s,urlSearchParams:d,retailerProductPageUrl:c});return(0,l.jsx)(ur,{title:r,imageUrl:o,rating:i,reviewsCount:a,pdpUrl:u,styles:n})}const gr="concierge-pdp-product-card",fr={containerBorderColor:(0,d.vT)("#dcdddc"),containerBorderRadius:10,containerPadding:16,imageSize:48,titleColor:(0,d.vT)(""),titleFontSize:14,titleFontWeight:"600",ratingStarColor:(0,d.vT)("#ED792F"),ratingTextColor:(0,d.vT)(""),ratingFontSize:12},hr=[{key:"containerBorderColor",label:"Card Border",type:"color",group:"Card"},{key:"containerBorderRadius",label:"Card Radius (px)",type:"number",min:0,max:24,step:2,group:"Card"},{key:"containerPadding",label:"Card Padding (px)",type:"number",min:8,max:32,step:2,group:"Card"},{key:"imageSize",label:"Image Size (px)",type:"number",min:32,max:96,step:4,group:"Card"},{key:"titleColor",label:"Title Color",type:"color",group:"Title"},{key:"titleFontSize",label:"Title Font Size (px)",type:"number",min:12,max:24,step:1,group:"Title"},{key:"titleFontWeight",label:"Title Font Weight",type:"options",options:[{label:"400",value:"400"},{label:"500",value:"500"},{label:"600",value:"600"},{label:"700",value:"700"}],group:"Title"},{key:"ratingStarColor",label:"Rating Star Color",type:"color",group:"Rating"},{key:"ratingTextColor",label:"Rating Text Color",type:"color",group:"Rating"},{key:"ratingFontSize",label:"Rating Font Size (px)",type:"number",min:10,max:18,step:1,group:"Rating"}];function mr(e){let{part:t}=e;const n=(0,nr.A)(),{state:r,isSaving:o,handleEditChange:i,handleSave:a,resetField:s,savedKeys:c,studioLockedKeys:u,themeColors:p,themeFonts:g,themeIcons:f,resolveColor:h,canSave:m}=(0,d.i_)(gr,fr,hr),v=t.data;if(!(null==v?void 0:v.stacklineSku))return null;const y=((e,t,n)=>{const r=(e,n)=>t(e,n)||n;return{containerBorderColor:r(e.containerBorderColor,"#dcdddc"),containerBorderRadius:Number(e.containerBorderRadius),containerPadding:Number(e.containerPadding),imageSize:Number(e.imageSize),titleColor:r(e.titleColor,n.textPrimary),titleFontSize:Number(e.titleFontSize),titleFontWeight:String(e.titleFontWeight),ratingStarColor:r(e.ratingStarColor,"#ED792F"),ratingTextColor:r(e.ratingTextColor,n.textPrimary),ratingFontSize:Number(e.ratingFontSize)}})(r,h,{textPrimary:n.palette.text.primary});return(0,l.jsx)(d.of,{widgetId:gr,displayName:"PDP Product Card",editFields:hr,editValues:r,onEditChange:i,onSave:m?a:void 0,isSaving:o,savedKeys:c,studioLockedKeys:u,onResetField:s,themeColors:p,themeFonts:g,themeIcons:f,children:(0,l.jsx)(pr,{data:v,styles:y})})}var vr=n(41586),yr=n(39244),xr=n(25792),br=n(35031);function wr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ar(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?wr(Object(n),!0).forEach(function(t){Cr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Cr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const jr=e=>{const t=e.replace(/\D/g,"").slice(0,10);return t.length<=3?t:t.length<=6?"".concat(t.slice(0,3),"-").concat(t.slice(3)):"(".concat(t.slice(0,3),") ").concat(t.slice(3,6),"-").concat(t.slice(6))};function Sr(e){let{children:t}=e;const n=(0,r.useRef)(null),o=(0,r.useRef)(null),i=(0,r.useRef)(!1);return(0,r.useLayoutEffect)(()=>{const e=n.current,t=o.current;if(!e||!t)return;const r=n=>{const r=t.offsetHeight;n?e.style.height="".concat(r,"px"):(e.style.transition="none",e.style.height="".concat(r,"px"),e.offsetHeight,e.style.transition="height 0.3s cubic-bezier(0.4, 0, 0.2, 1)",i.current=!0)},a=new ResizeObserver(()=>r(i.current));return a.observe(t),r(!1),()=>a.disconnect()},[]),(0,l.jsx)("div",{ref:n,style:{overflow:"hidden"},children:(0,l.jsx)("div",{ref:o,children:t})})}const kr=e=>{let{size:t=48,color:n="#0D0D0D",trackColor:r="#E0E0E0"}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 48 48",fill:"none",style:{animation:"login-dialog-spin 0.9s linear infinite",flexShrink:0},children:[(0,l.jsx)("circle",{cx:"24",cy:"24",r:"18",stroke:r,strokeWidth:"5"}),(0,l.jsx)("path",{d:"M42 24A18 18 0 0 0 24 6",stroke:n,strokeWidth:"5",strokeLinecap:"round"})]})};function Or(e){let{onClose:t,brandLogoUrl:n,styles:o,resolveColor:i}=e;const{inlineSignIn:a,inlineVerifyOtp:s}=(0,Lt.Ox)(),[c,d]=(0,r.useState)(!1),[u,p]=(0,r.useState)("phone"),[g,f]=(0,r.useState)(""),[h,m]=(0,r.useState)(""),[v,y]=(0,r.useState)(null),[x,b]=(0,r.useState)(null),[w,A]=(0,r.useState)(0),[C,j]=(0,r.useState)(!1),S=(0,r.useRef)(null),k=(0,r.useRef)(null);(0,r.useEffect)(()=>
1{if(w<=0)return;const e=setTimeout(()=>A(e=>e-1),1e3);return()=>clearTimeout(e)},[w]),(0,r.useEffect)(()=>{var e,t;"phone"===u&&(null==(e=S.current)||e.focus()),"otp"===u&&(null==(t=k.current)||t.focus())},[u]);const O=async e=>{var t,n;if(null==e||e.preventDefault(),!a||"phone"!==u||C)return;b(null),j(!0);const r=null!==(t=null==(n=(0,vr.lq)(g,{regionCode:"US"}).number)?void 0:n.e164)&&void 0!==t?t:g,o=await a(r);j(!1),"error"in o?b(o.error):(y(o.session),p("otp"),A(30))},I=async e=>{if(null==e||e.preventDefault(),!s||"otp"!==u)return;b(null),p("loading");const n=await s(v,h);n.success?t():(p("otp"),b(n.error))},P=i(o.titleColor),E=i(o.subtitleColor);if("loading"===u)return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:16,padding:o.dialogPadding,textAlign:"center"},children:[(0,l.jsx)("p",{style:{fontSize:o.titleFontSize,fontWeight:600,color:P,margin:0,lineHeight:"25px"},children:"Almost there!"}),(0,l.jsx)("p",{style:{fontSize:o.subtitleFontSize,fontWeight:500,color:E,margin:0,lineHeight:"1.5",maxWidth:280},children:"We're verifying your information, it will only take a second."}),(0,l.jsx)(kr,{size:48,color:P,trackColor:"rgba(0,0,0,0.1)"})]});const V="phone"===u,F=(V?(e=>(0,vr.lq)(e,{regionCode:"US"}).valid)(g):h.length>0)&&!C,B=V?"Welcome":"Just confirming it's you",L=V?"Enter your phone number to continue. New here? Weâll create an account.":"Please enter the code we sent to ".concat(jr(g),"."),R=i(o.primaryButtonBgColor),T=i(o.primaryButtonTextColor),M=w>0,D=i(M?o.secondaryButtonDisabledBorderColor:o.secondaryButtonBorderColor),N=i(o.secondaryButtonTextColor);return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:o.dialogPadding,boxSizing:"border-box"},children:[(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:16},children:[(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:24},children:[(0,l.jsx)("div",{style:{width:64,height:64,borderRadius:0,backgroundColor:i(o.logoContainerBgColor),overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},children:n&&!c&&(0,l.jsx)("img",{src:n,alt:"",onError:()=>d(!0),style:{width:"100%",height:"100%",objectFit:"contain"}})}),(0,l.jsx)("p",{style:{fontSize:o.titleFontSize,fontWeight:600,color:P,margin:0,textAlign:"center",lineHeight:"25px"},children:B})]}),(0,l.jsx)("p",{style:{fontSize:o.subtitleFontSize,fontWeight:500,color:E,margin:0,textAlign:"center",lineHeight:"1.5",maxWidth:320},children:L}),(0,l.jsx)(yr.A,{variant:"filled",fullWidth:!0,label:V?"Phone number":"Verification code",value:V?jr(g):h,type:V?"tel":"text",inputProps:{inputMode:V?"tel":"numeric",maxLength:V?void 0:6},inputRef:V?S:k,disabled:C,onChange:V?e=>{var t;f((t=e.target.value,t.replace(/\D/g,"")).slice(0,10)),b(null)}:e=>{m(e.target.value.replace(/\D/g,"")),b(null)},onKeyDown:e=>{"Enter"===e.key&&(V?O():I())},slotProps:{input:{disableUnderline:!0}},sx:{".MuiInputLabel-root":{fontSize:16,fontWeight:500,color:P,opacity:.5,"&.Mui-focused":{color:P,opacity:.5},"&.Mui-disabled":{color:P}},".MuiFilledInput-root":{backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&.Mui-focused":{backgroundColor:"transparent"},"&.Mui-disabled":{backgroundColor:"transparent"},border:"1px solid ".concat(i(o.inputBorderColor)),borderRadius:"".concat(o.inputBorderRadius,"px"),fontSize:14,fontWeight:500,color:P,boxSizing:"border-box",minHeight:60,".MuiInputBase-input":{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px ".concat(i(o.dialogBgColor)," inset"),WebkitTextFillColor:P,fontSize:"14px"}}}}})]}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12,alignItems:"center"},children:[x&&(0,l.jsx)("p",{style:{width:"100%",margin:0,fontSize:12,color:"#dc2626",padding:"4px 8px",backgroundColor:"#fef2f2",borderRadius:6,lineHeight:1.4,boxSizing:"border-box"},children:x}),(0,l.jsx)("button",{type:"button",disabled:!F,onClick:V?O:I,style:{width:"100%",padding:"13px 16px",borderRadius:o.primaryButtonBorderRadius,border:"none",fontSize:14,fontWeight:600,lineHeight:"20px",backgroundColor:R,c
1olor:T,opacity:F?1:.3,cursor:F?"pointer":"default",pointerEvents:F?"auto":"none",transition:"background-color 0.15s ease, opacity 0.15s ease",display:"flex",alignItems:"center",justifyContent:"center",gap:8},children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(kr,{size:18,color:T,trackColor:"rgba(255,255,255,0.35)"}),"Sending codeâ¦"]}):"Continue"}),!V&&(0,l.jsx)("button",{type:"button",disabled:M,onClick:async()=>{var e,t;if(!a||w>0)return;b(null);const n=null!==(e=null==(t=(0,vr.lq)(g,{regionCode:"US"}).number)?void 0:t.e164)&&void 0!==e?e:g,r=await a(n);"error"in r?b(r.error):(y(r.session),A(30),m(""))},style:{width:"100%",padding:"13px 16px",borderRadius:o.secondaryButtonBorderRadius,border:"1.5px solid ".concat(D),fontSize:14,fontWeight:600,lineHeight:"20px",backgroundColor:"transparent",color:M?i(o.secondaryButtonDisabledBorderColor):N,cursor:M?"default":"pointer",transition:"all 0.15s ease"},children:M?"Resend code in 0:".concat(String(w).padStart(2,"0")):"Resend code"}),(0,l.jsx)("button",{type:"button",onClick:t,style:{background:"none",border:"none",padding:0,fontSize:14,fontWeight:600,lineHeight:"20px",color:i(o.cancelTextColor),cursor:"pointer"},children:"Back"})]})]})}function Ir(e){let{reason:t,loginMethod:n,isStreaming:o}=e;var i;const{isSignedIn:a,inlineSignIn:s,inlineVerifyOtp:c,isSharedView:u,requestSignIn:p}=(0,Lt.Ox)(),{data:f}=(0,g.rD)(),[h,v]=(0,r.useState)(!o),y="shopify"===(null==f?void 0:f.authType)||void 0===(null==f?void 0:f.authType)&&("shopify_link"===n||(0,m.Fw)());(0,r.useEffect)(()=>{o||h||v(!0)},[o]);const x=null==(i=null==f?void 0:f.domainConfig)?void 0:i.brandId,b=x?(0,xr.LO)(x):void 0,w=(0,d.at)("concierge-chat-input",{}),{themeFonts:A}=(0,d.vl)(),C=function(e,t){if(!e||"inherit"===e)return;const n=t[e];return n?"system"===n.format?n.url:'"'.concat(n.name,'", sans-serif'):void 0}(w.fontFamily,A),j=w.fontFamily&&"inherit"!==w.fontFamily?A[w.fontFamily]:null;if((0,r.useEffect)(()=>{"google"===(null==j?void 0:j.format)&&j.url&&function(e){if("undefined"==typeof document)return;if(document.querySelector('link[href="'.concat(e,'"]')))return;const t=document.createElement("link");t.rel="stylesheet",t.href=e,document.head.appendChild(t)}(j.url)},[null==j?void 0:j.url]),a||u)return null;if(y||!s||!c){if(!p)return null;const e=null==t?void 0:t.trim(),n=y?e?"Sign in with your store account to ".concat(e,"."):"Sign in with your store account to continue.":e?"Sign in to ".concat(e,"."):"Sign in to continue.";return(0,l.jsx)("div",{style:Ar({maxWidth:400,margin:"0 auto 20px"},C?{fontFamily:C}:{}),children:(0,l.jsx)(d.ie,{children:(0,l.jsx)(d.Ef,{widgetId:"concierge-prompt-login",title:"Sign in to continue",description:n,buttonText:"Sign in",onSignIn:()=>p()})})})}return h?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{children:"\n @keyframes login-dialog-spin { from { transform: rotate(0deg) } to { transform: rotate(360deg) } }\n @media (max-width: 899.95px) { .login-dialog-content { border-bottom-left-radius: 0 !important; border-bottom-right-radius: 0 !important; } }\n "}),(0,l.jsx)(br.R,{open:h,onClose:(e,t)=>{"backdropClick"!==t&&v(!1)},disableScrollLock:!0,sx:e=>({zIndex:1e4,"& div.MuiDialog-paper":{margin:"0 20px",width:"100%",maxWidth:400,overflow:"visible",backgroundColor:"transparent",boxShadow:"none",paddingTop:0,[e.breakpoints.down("md")]:{maxWidth:"100%",width:"100%",margin:0,padding:0,paddingTop:"12px",boxSizing:"border-box"}}}),children:(0,l.jsx)(d.ie,{children:(0,l.jsx)(d.ub,{widgetId:"concierge-login-dialog",displayName:"Login Dialog",children:(e,t,n)=>(0,l.jsx)("div",{className:"login-dialog-content",style:Ar({backgroundColor:t(e.dialogBgColor),borderRadius:e.dialogBorderRadius,boxShadow:"8px 8px 14px 0px rgba(0,0,0,0.03)",border:"1px solid rgba(13,13,13,0.05)",overflow:"hidden"},C?{fontFamily:C}:{}),children:(0,l.jsx)(Sr,{children:(0,l.jsx)(Or,{onClose:()=>v(!1),brandLogoUrl:null!=n?n:b,styles:e,resolveColor:t})})})})})})]}):null}var Pr=n(97970);const Er="concierge-support-ticket-card",Vr={cardBgColor:(0,d.vT)("#ffffff"),cardBorderColor:(0,d.vT)("#e5e5e5"),cardBorderRadius:12,cardPadding:16,listCardPadding:12,labelColor:(0,d.vT)("#8f8f8f"),refColor:(0,d.vT)("#181d56"),refFontSize:16,listRefFontSize:14,metaColor:(0,d.vT)("#8f8f8f"),metaFontSize:12,countColor:(0,d.vT)("#aeaeae"),bodyColor:(0,d.vT)("#555555"),bodyFontSize:14,viewBgColor:(0,d.vT)("#f8f8f8"),viewBorderColor:(0,d.vT)("#e5e5e5"),viewTextColor:(0,d.vT)("#555555"),viewBorderRadius:6,viewFontSize:12,replyBgColor:(0,d.vT)("#f8f8f8"),replyBorderColor:(0,d.vT)("#e5e5e5"),replyTextColor:(0,d.vT)("#3a3a3a")}
1,Fr=[{key:"cardBgColor",label:"Card Background",type:"color",group:"Card"},{key:"cardBorderColor",label:"Card Border",type:"color",group:"Card"},{key:"cardBorderRadius",label:"Card Radius (px)",type:"number",min:0,max:24,step:2,group:"Card"},{key:"cardPadding",label:"Card Padding (px)",type:"number",min:8,max:32,step:2,group:"Card"},{key:"listCardPadding",label:"Ticket List Padding (px)",type:"number",min:8,max:32,step:2,group:"Card"},{key:"labelColor",label:'"Ticket" Label Color',type:"color",group:"Header"},{key:"refColor",label:"Ticket Number Color",type:"color",group:"Header"},{key:"refFontSize",label:"Ticket Number Size (px)",type:"number",min:12,max:24,step:1,group:"Header"},{key:"listRefFontSize",label:"List Ticket Number Size (px)",type:"number",min:10,max:20,step:1,group:"Header"},{key:"metaColor",label:"Secondary Text Color",type:"color",group:"Text"},{key:"metaFontSize",label:"Secondary Text Size (px)",type:"number",min:10,max:16,step:1,group:"Text"},{key:"countColor",label:"Ticket Count Color",type:"color",group:"Text"},{key:"bodyColor",label:"Body Text Color",type:"color",group:"Text"},{key:"bodyFontSize",label:"Body Text Size (px)",type:"number",min:12,max:20,step:1,group:"Text"},{key:"viewBgColor",label:"View Button Background",type:"color",group:"View Button"},{key:"viewBorderColor",label:"View Button Border",type:"color",group:"View Button"},{key:"viewTextColor",label:"View Button Text",type:"color",group:"View Button"},{key:"viewBorderRadius",label:"View Button Radius (px)",type:"number",min:0,max:20,step:2,group:"View Button"},{key:"viewFontSize",label:"View Button Font Size (px)",type:"number",min:10,max:16,step:1,group:"View Button"},{key:"replyBgColor",label:"Reply Block Background",type:"color",group:"Latest Reply"},{key:"replyBorderColor",label:"Reply Block Accent",type:"color",group:"Latest Reply"},{key:"replyTextColor",label:"Reply Text Color",type:"color",group:"Latest Reply"}];function Br(e){let{children:t}=e;const{state:n,isSaving:r,handleEditChange:o,handleSave:i,resetField:a,savedKeys:s,studioLockedKeys:c,themeColors:u,themeFonts:p,themeIcons:g,resolveColor:f,canSave:h}=(0,d.i_)(Er,Vr,Fr),m=((e,t)=>({cardBgColor:t(e.cardBgColor,"#ffffff"),cardBorderColor:t(e.cardBorderColor,"#e5e5e5"),cardBorderRadius:Number(e.cardBorderRadius),cardPadding:Number(e.cardPadding),listCardPadding:Number(e.listCardPadding),labelColor:t(e.labelColor,"#8f8f8f"),refColor:t(e.refColor,"#181d56"),refFontSize:Number(e.refFontSize),listRefFontSize:Number(e.listRefFontSize),metaColor:t(e.metaColor,"#8f8f8f"),metaFontSize:Number(e.metaFontSize),countColor:t(e.countColor,"#aeaeae"),bodyColor:t(e.bodyColor,"#555555"),bodyFontSize:Number(e.bodyFontSize),viewBgColor:t(e.viewBgColor,"#f8f8f8"),viewBorderColor:t(e.viewBorderColor,"#e5e5e5"),viewTextColor:t(e.viewTextColor,"#555555"),viewBorderRadius:Number(e.viewBorderRadius),viewFontSize:Number(e.viewFontSize),replyBgColor:t(e.replyBgColor,"#f8f8f8"),replyBorderColor:t(e.replyBorderColor,"#e5e5e5"),replyTextColor:t(e.replyTextColor,"#3a3a3a")}))(n,f);return(0,l.jsx)(d.of,{widgetId:Er,displayName:"Support Ticket Cards",editFields:Fr,editValues:n,onEditChange:o,onSave:h?i:void 0,isSaving:r,savedKeys:s,studioLockedKeys:c,onResetField:a,themeColors:u,themeFonts:p,themeIcons:g,children:t(m)})}function Lr(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rr(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Lr(Object(n),!0).forEach(function(t){Tr(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Lr(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tr(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mr(e){const{status:t,ticketId:n}=e;return"success"===t&&n?(0,l.jsx)(Br,{children:t=>(0,l.jsx)(Dr,Rr(Rr({},e),{},{styles:t}))}):null}function Dr(e){let{ticketId:t,displayId:n,ticketUrl:r,ticketState:o,ticketTypeName:i,category:a,nextSteps:s,message:c,styles:d}=e;const u=o?function(e){switch(e){case"submitted":return"Submitted";case"in_progress":return"In progress";case"waiting_on_customer":return"Waiting on you";case"resolved":return"Resolved";case"closed":return"Closed";default:return e.replace(/_/g," ")}}(o):"Submitted",p=null!=n?n:t,g=s||c;
1return(0,l.jsxs)("div",{className:"tw:my-2 tw:border tw:shadow-sm",style:{borderRadius:d.cardBorderRadius,borderColor:d.cardBorderColor,backgroundColor:d.cardBgColor,padding:d.cardPadding},role:"group","aria-label":"Support ticket card",children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-start tw:justify-between tw:gap-3",children:[(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:gap-1",children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:gap-2",children:[(0,l.jsx)("span",{className:"tw:text-xs tw:font-semibold tw:uppercase tw:tracking-wide",style:{color:d.labelColor},children:"Ticket"}),(0,l.jsx)("span",{className:"tw:rounded-full tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium",style:{backgroundColor:"var(--bc-support-bg)",color:"var(--bc-support-text)"},children:u})]}),(0,l.jsxs)("div",{className:"tw:font-semibold",style:{fontSize:d.refFontSize,color:d.refColor},children:["#",p]}),(i||a)&&(0,l.jsx)("div",{style:{fontSize:d.metaFontSize,color:d.metaColor},children:[i,a].filter(Boolean).join(" · ")})]}),r&&(0,l.jsx)("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"tw:border tw:px-3 tw:py-1.5 tw:font-semibold tw:no-underline",style:{borderRadius:d.viewBorderRadius,borderColor:d.viewBorderColor,backgroundColor:d.viewBgColor,color:d.viewTextColor,fontSize:d.viewFontSize},children:"View"})]}),g&&(0,l.jsx)("p",{className:"tw:mt-3 tw:leading-relaxed",style:{fontSize:d.bodyFontSize,color:d.bodyColor},children:g})]})}function Nr(e){var t;let{output:n}=e;if(!n)return null;const r="string"==typeof n?n:null!==(t=n.reason)&&void 0!==t?t:"";if(!r)return null;const o=/Ticket\s+#?([A-Za-z0-9_-]+)/.exec(r);return o?(0,l.jsx)(Mr,{status:"success",message:r,ticketId:o[1],displayId:o[1],ticketState:"submitted",nextSteps:r.replace(/^SUCCESS:\s*/,"")}):null}function zr(e){let{output:t}=e;return t?(0,l.jsx)(Mr,{status:t.status,message:t.message,ticketId:t.ticketId,displayId:t.displayId,ticketUrl:t.ticketUrl,ticketState:t.ticketState,ticketTypeName:t.ticketTypeName,category:t.category,nextSteps:t.nextSteps}):null}function Wr(e){let{output:t}=e;return t&&"ok"===t.status&&t.tickets&&0!==t.tickets.length?(0,l.jsx)(Br,{children:e=>(0,l.jsx)(Ur,{output:t,styles:e})}):null}function Ur(e){var t;let{output:n,styles:r}=e;var o;const i=(null!==(t=n.tickets)&&void 0!==t?t:[]).slice(0,10);return(0,l.jsxs)("div",{className:"tw:my-2 tw:border tw:shadow-sm",style:{borderRadius:r.cardBorderRadius,borderColor:r.cardBorderColor,backgroundColor:r.cardBgColor,padding:r.listCardPadding},role:"group","aria-label":"Your support tickets",children:[(0,l.jsxs)("div",{className:"tw:mb-2 tw:flex tw:items-center tw:justify-between",children:[(0,l.jsx)("span",{className:"tw:text-xs tw:font-semibold tw:uppercase tw:tracking-wide",style:{color:r.labelColor},children:"Your tickets"}),(0,l.jsx)("span",{className:"tw:text-xs",style:{color:r.countColor},children:null==(o=n.tickets)?void 0:o.length})]}),(0,l.jsx)("div",{className:"tw:flex tw:flex-col tw:divide-y tw:divide-gray-100",children:i.map(e=>{var t,n,o,i;const a=null!==(t=e.displayId)&&void 0!==t?t:e.ticketId,s=e.ticketUrl,c=null!==(n=null!==(o=null!==(i=e.title)&&void 0!==i?i:e.summary)&&void 0!==o?o:e.ticketTypeName)&&void 0!==n?n:"Ticket #".concat(a);return(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:justify-between tw:py-2 tw:gap-3",children:[(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:min-w-0",children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:gap-2",children:[(0,l.jsxs)("span",{className:"tw:font-semibold",style:{fontSize:r.listRefFontSize,color:r.refColor},children:["#",a]}),(0,l.jsx)("span",{className:"tw:rounded-full tw:px-2 tw:py-0.5 tw:text-[10px] tw:font-medium ".concat(Qr(e.state)),style:(d=e.state,"resolved"!==d&&"closed"!==d&&"waiting_on_customer"!==d&&"in_progress"!==d?Zr:void 0),children:Hr(e.state)})]}),(0,l.jsx)("div",{className:"tw:truncate",style:{fontSize:r.metaFontSize,color:r.metaColor},children:c})]}),s&&(0,l.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"tw:shrink-0 tw:border tw:px-2 tw:py-1 tw:font-semibold tw:no-underline",style:{borderRadius:r.viewBorderRadius,borderColor:r.viewBorderColor,backgroundColor:r.viewBgColor,color:r.viewTextColor,fontSize:r.viewFontSize-1},children:"View"})]},e.ticketId);var d})})]})}function Hr(e){switch(e){case"submitted":return"Submitted";case"in_progress":return"In progress";case"waiting_on_customer":return"Waiting on you";case"resolved":return"Resolved";case"closed":return"Closed";default:return e.replace(/_/g," ")}}function Qr(e){switch(e){case"resolved":case"closed":return"tw:bg-gray-100 tw:text-gray-600";case"waiting_on_customer":return"tw:bg-amber-50 tw:text-amber-700";case"in_progress":return"tw:bg-blue-50 tw:text-blue-700";default:return""}}const Zr={backgroundColor:"var(--bc-support-bg)",color:"var(--bc-support-text)"};function qr(e){let{output:t}=e;return t&&"ok"===t.status&&t.ticketId?(0,l.jsx)(Br,{children:e=>(0,l.jsx)(Yr,{output:t,styles:e})}):null}function Yr(e){var t,n,r;let{output:o,styles:i}=e;const a=null!==(t=o.displayId)&&void 0!==t?t:o.ticketId,s=o.state?function(e){switch(e){case"submitted":return"Submitted";case"in_progress":return"In progress";case"waiting_on_customer":return"Waiting on you";case"resolved":return"Resolved";case"closed":return"Closed";default:return(null!=e?e:"Submitted").replace(/_/g," ")}}(o.state):"Submitted",c=o.latestAdminReply,d=null!==(n=null!==(r=o.title)&&void 0!==r?r:o.ticketTypeName)&&void 0!==n?n:"Ticket #".concat(a);
1return(0,l.jsxs)("div",{className:"tw:my-2 tw:border tw:shadow-sm",style:{borderRadius:i.cardBorderRadius,borderColor:i.cardBorderColor,backgroundColor:i.cardBgColor,padding:i.cardPadding},role:"group","aria-label":"Support ticket status",children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-start tw:justify-between tw:gap-3",children:[(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:gap-1",children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:gap-2",children:[(0,l.jsx)("span",{className:"tw:text-xs tw:font-semibold tw:uppercase tw:tracking-wide",style:{color:i.labelColor},children:"Ticket"}),(0,l.jsx)("span",{className:"tw:rounded-full tw:px-2 tw:py-0.5 tw:text-xs tw:font-medium ".concat(Kr(o.state)),style:Gr(o.state)?Jr:void 0,children:s})]}),(0,l.jsxs)("div",{className:"tw:font-semibold",style:{fontSize:i.refFontSize,color:i.refColor},children:["#",a]}),(0,l.jsx)("div",{style:{fontSize:i.metaFontSize,color:i.metaColor},children:d})]}),o.ticketUrl&&(0,l.jsx)("a",{href:o.ticketUrl,target:"_blank",rel:"noopener noreferrer",className:"tw:border tw:px-3 tw:py-1.5 tw:font-semibold tw:no-underline",style:{borderRadius:i.viewBorderRadius,borderColor:i.viewBorderColor,backgroundColor:i.viewBgColor,color:i.viewTextColor,fontSize:i.viewFontSize},children:"View"})]}),c?(0,l.jsxs)("div",{className:"tw:mt-4 tw:rounded-lg tw:border-l-4 tw:p-3",style:{borderColor:i.replyBorderColor,backgroundColor:i.replyBgColor},children:[(0,l.jsx)("div",{className:"tw:text-xs tw:font-semibold",style:{color:i.bodyColor},children:c.authorName?"".concat(c.authorName," replied"):"Latest reply from support"}),(0,l.jsx)("div",{className:"tw:mb-1",style:{fontSize:i.metaFontSize,color:i.metaColor},children:new Date(c.postedAt).toLocaleString()}),(0,l.jsx)("div",{className:"tw:leading-relaxed tw:whitespace-pre-wrap",style:{fontSize:i.bodyFontSize,color:i.replyTextColor},children:(u=c.body,u.replace(/<br\s*\/?>(\n)?/gi,"\n").replace(/<\/(p|div)>/gi,"\n").replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim())})]}):(0,l.jsx)("p",{className:"tw:mt-3",style:{fontSize:i.bodyFontSize,color:i.metaColor},children:"No reply from the support team yet."})]});var u}function Kr(e){switch(e){case"resolved":case"closed":return"tw:bg-gray-100 tw:text-gray-600";case"waiting_on_customer":return"tw:bg-amber-50 tw:text-amber-700";case"in_progress":return"tw:bg-blue-50 tw:text-blue-700";default:return""}}function Gr(e){return"resolved"!==e&&"closed"!==e&&"waiting_on_customer"!==e&&"in_progress"!==e}const Jr={backgroundColor:"var(--bc-support-bg)",color:"var(--bc-support-text)"},Xr={teamLabel:"Support Team",pausedFooterCopy:"You're chatting with support team. Concierge is paused.",takeoverPlaceholder:"Message {firstName}â¦",deliveredCopy:"Delivered to Support Team",teamAvatarUrl:""},_r=(0,r.createContext)(Xr),$r=e=>{let{children:t,className:n}=e;const o=(0,d.EI)(),i=(0,r.useMemo)(()=>({display:"contents","--bc-support-bg":o.softBackgroundHex,"--bc-support-border":o.borderHex,"--bc-support-dot":o.accentDotHex,"--bc-support-text":o.textHex}),[o.softBackgroundHex,o.borderHex,o.accentDotHex,o.textHex]),a=(0,r.useMemo)(()=>({teamLabel:o.teamLabel,pausedFooterCopy:o.pausedFooterCopy,takeoverPlaceholder:o.takeoverPlaceholder,deliveredCopy:o.deliveredCopy,teamAvatarUrl:o.teamAvatarUrl}),[o.teamLabel,o.pausedFooterCopy,o.takeoverPlaceholder,o.deliveredCopy,o.teamAvatarUrl]);return(0,l.jsx)("div",{className:n,style:i,children:(0,l.jsx)(_r.Provider,{value:a,children:t})})},eo=()=>(0,r.useContext)(_r);function to(e){var t;let{data:n}=e;const{teamLabel:r,teamAvatarUrl:o}=eo();if(!(null==n?void 0:n.body))return null;const i=(null!==(t=n.adminName)&&void 0!==t?t:"Support").slice(0,1).toUpperCase(),a=n.adminAvatarUrl||o||"";return(0,l.jsxs)("div",{className:"tw:my-2 tw:flex tw:items-start tw:gap-2",children:[a?(0,l.jsx)("img",{src:a,alt:"",className:"tw:h-7 tw:w-7 tw:rounded-full tw:object-cover tw:bg-gray-100"}):(0,l.jsx)("div",{className:"tw:flex tw:h-7 tw:w-7 tw:items-center tw:justify-center tw:rounded-full tw:text-xs tw:font-semibold tw:ring-1",style:{backgroundColor:"var(--bc-support-bg)",color:"var(--bc-support-text)",boxShadow:"inset 0 0 0 1px var(--bc-support-border)"},children:i}),(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:gap-0.5 tw:max-w-[80%]",children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:gap-1.5 tw:text-xs",children:n.adminName?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{className:"tw:font-semibold tw:text-gray-800",children:n.adminName}),(0,l.jsx)("span",{"aria-hidden":"true",className:"tw:text-gray-300",children:"·"}),(0,l.jsx)("span",{className:"tw:font-medium",style:{color:"var(--bc-support-text)"},children:r})]}):(0,l.jsx)("span",{className:"tw:font-medium",style:{color:"var(--bc-support-text)"},children:r})}),(0,l.jsx)("div",{className:"tw:rounded-2xl tw:rounded-tl-sm tw:px-3 tw:py-2 tw:text-sm tw:text-gray-900 tw:whitespace-pre-wrap tw:leading-relaxed",style:{backgroundColor:"var(--bc-support-bg)"},children:(s=n.body,s.replace(/<br\s*\/?>(\n)?/gi,"\n").replace(/<\/(p|div)>/gi,"\n").replace(/<[^>]+>/g,"").replace(/ /g," ").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'").trim())})]})]});var s}function no(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ro(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oo(e){return!e||"object"!=typeof e||Array.isArray(e)?null:e}function io(e){if("number"==typeof e&&Number.isFinite(e))return e;if("string"!=typeof e)return;
1const t=e.replace(/[^0-9.-]/g,""),n=Number.parseFloat(t);return Number.isFinite(n)?n:void 0}function ao(e){var t;const n=oo(e);if(!n)return null;const r=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?no(Object(n),!0).forEach(function(t){ro(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):no(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}({},n),o=io(null!==(t=n.retailPrice)&&void 0!==t?t:n.price);void 0!==o&&(r.retailPrice=o,r.price=o);const i=io(n.totalRewardAmount);return void 0!==i&&(r.totalRewardAmount=i),r}function lo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function so(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?lo(Object(n),!0).forEach(function(t){co(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):lo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function co(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const uo=(0,r.createContext)({persona:{assistantName:"Benny"},visual:{}}),po=()=>(0,r.useContext)(uo),go=e=>{let{children:t,overrides:n}=e;const o=(0,d.Zp)(),{themeColors:i}=(0,d.FG)(),a=(0,r.useMemo)(()=>{var e,t,r,i,a,l,s,c,d;return n?{persona:so(so({},o.persona),n.persona),visual:{blobStyle:null!==(e=null==(i=n.visual)?void 0:i.blobStyle)&&void 0!==e?e:null==(a=o.visual)?void 0:a.blobStyle,blobEnabled:null!==(t=null==(l=n.visual)?void 0:l.blobEnabled)&&void 0!==t?t:null==(s=o.visual)?void 0:s.blobEnabled,blobColors:null!==(r=null==(c=n.visual)?void 0:c.blobColors)&&void 0!==r?r:null==(d=o.visual)?void 0:d.blobColors}}:o},[o,n]),s=(0,r.useMemo)(()=>function(e){const t={};return e.textPrimary&&(t["--voice-widget-fg"]=e.textPrimary,t["--voice-widget-price"]=e.textPrimary),e.primary&&(t["--voice-widget-button-bg"]=e.primary,t["--voice-widget-accent"]=e.primary,t["--voice-widget-accent-dark"]=e.primary),e.buttonText&&(t["--voice-widget-button-fg"]=e.buttonText),t}(i),[i]),c=(0,r.useMemo)(()=>{var e;return{persona:a.persona,visual:null!==(e=a.visual)&&void 0!==e?e:{}}},[a.persona,a.visual]);return(0,l.jsx)(uo.Provider,{value:c,children:(0,l.jsx)("div",{style:so({display:"contents"},s),children:t})})},fo=e=>{const t=e.replace(/\D/g,"").slice(0,10);return t.length<=3?t:t.length<=6?"".concat(t.slice(0,3),"-").concat(t.slice(3)):"(".concat(t.slice(0,3),") ").concat(t.slice(3,6),"-").concat(t.slice(6))},ho=e=>e.replace(/\D/g,"");function mo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?mo(Object(n),!0).forEach(function(t){yo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yo(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xo=(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,l.jsx)("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6A19.79 19.79 0 0 1 2.12 4.18 2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2z"})}),bo=(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,l.jsx)("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),(0,l.jsx)("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),wo={width:"100%",maxWidth:380,background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,padding:"18px 18px 16px",boxSizing:"border-box",boxShadow:"0 2px 12px rgba(0,0,0,0.07)"}
1,Ao={width:34,height:34,borderRadius:"50%",background:"var(--voice-widget-img-bg, #F9FAFB)",color:"var(--voice-widget-accent-dark, #0D9488)",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0},Co={fontSize:14,fontWeight:700,color:"var(--voice-widget-fg, #111827)",lineHeight:1.3},jo={fontSize:12,color:"var(--voice-widget-muted, #6B7280)",marginTop:3,lineHeight:1.4},So={display:"block",fontSize:11,fontWeight:600,color:"var(--voice-widget-muted, #6B7280)",textTransform:"uppercase",letterSpacing:.5,marginBottom:12},ko={display:"block",marginTop:6,width:"100%",boxSizing:"border-box",padding:"12px 14px",fontSize:16,fontWeight:500,color:"var(--voice-widget-fg, #111827)",background:"var(--voice-widget-img-bg, #F9FAFB)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:10,outline:"none",fontVariantNumeric:"tabular-nums",letterSpacing:1},Oo={display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,fontSize:11,color:"var(--voice-widget-muted, #6B7280)",background:"var(--voice-widget-img-bg, #F9FAFB)",border:"1px dashed var(--voice-widget-border, #E5E7EB)",borderRadius:8,padding:"6px 10px",marginBottom:10},Io={fontSize:11,color:"var(--voice-widget-warn, #DC2626)",background:"var(--voice-widget-warn-bg, #FEF2F2)",border:"1px solid var(--voice-widget-warn-border, #FECACA)",borderRadius:6,padding:"6px 10px",marginBottom:10},Po={width:"100%",textAlign:"center",padding:"11px 14px",fontSize:12,fontWeight:600,color:"var(--voice-widget-muted, #6B7280)"},Eo={display:"block",width:"100%",boxSizing:"border-box",padding:"12px 14px",fontSize:14,fontWeight:600,color:"var(--voice-widget-card-bg, #FFFFFF)",background:"var(--voice-widget-accent-dark, #0D9488)",border:"none",borderRadius:10,cursor:"pointer"},Vo={cancel:{icon:"ð«",accentColor:"#DC2626",accentBg:"#FEF2F2"},refund:{icon:"ð°",accentColor:"#D97706",accentBg:"#FFFBEB"},return:{icon:"â©ï¸",accentColor:"#7C3AED",accentBg:"#F5F3FF"}},Fo={placed:{label:"Order Placed",color:"#059669",bg:"#ECFDF5"},processing:{label:"Processing Order",color:"#D97706",bg:"#FFFBEB"},shipped:{label:"Shipped",color:"#2563EB",bg:"#EFF6FF"},out_for_delivery:{label:"Out For Delivery",color:"#2563EB",bg:"#EFF6FF"},delivered:{label:"Delivered",color:"#059669",bg:"#ECFDF5"},cancelled:{label:"Cancelled",color:"#DC2626",bg:"#FEF2F2"},returned:{label:"Returned",color:"#7C3AED",bg:"#F5F3FF"},unknown:{label:"Unknown",color:"#6B7280",bg:"#F9FAFB"}};function Bo(e){try{return new Date(e).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}catch(t){return e}}const Lo="(max-width: 759.98px)",Ro=(0,r.createContext)(null);function To(){const e=(0,r.useContext)(Ro),[t,n]=(0,r.useState)(()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia&&window.matchMedia(Lo).matches);return(0,r.useEffect)(()=>{var e;if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const t=window.matchMedia(Lo),r=e=>n(e.matches);return n(t.matches),"function"==typeof t.addEventListener?(t.addEventListener("change",r),()=>t.removeEventListener("change",r)):(null==(e=t.addListener)||e.call(t,r),()=>{var e;null==(e=t.removeListener)||e.call(t,r)})},[]),null!==e?e:t}const Mo="\n@keyframes voice-store-list-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n/* Scrollbar matched to the Figma mock (node 4934:2143): a thin, fully\n rounded #E8E8ED thumb on a transparent track instead of the browser\n default chrome. */\n.voice-store-list-scroll {\n scrollbar-width: thin;\n scrollbar-color: ".concat("#E8E8ED"," transparent;\n}\n.voice-store-list-scroll::-webkit-scrollbar {\n width: 6px;\n}\n.voice-store-list-scroll::-webkit-scrollbar-track {\n background: transparent;\n}\n.voice-store-list-scroll::-webkit-scrollbar-thumb {\n background-color: ","#E8E8ED",";\n border-radius: 100px;\n}\n"),Do={display:"block",flexShrink:0},No=()=>(0,l.jsx)("svg",{width:16,height:16,viewBox:"-1.3333 -1.3333 16 16",fill:"none","aria-hidden":!0,focusable:!1,style:Do,children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.60932 1.72375C7.0887 1.20311 6.24478 1.2032 5.7235 1.72399C5.20331 2.24371 5.20308 3.08838 5.72397 3.60982C6.24362 4.13001 7.08816 4.13026 7.60955 3.60935C8.13005 3.08933 8.13038 2.24484 7.60932 1.72375ZM4.78114 0.780731C5.82242 -0.259564 7.51023 -0.261002 8.55215 0.780967C9.59362 1.82249 9.59395 3.51152 8.55192 4.55259C8.20239 4.9018 7.77985 5.13398 7.33333 5.24889V10C7.33333 10.3682 7.03486 10.6667 6.66667 10.6667C6.29848 10.6667 6 10.3682 6 10V5.24932C5.55323 5.13458 5.13042 4.90226 4.78067 4.55213C3.74058 3.51095 3.73883 1.8221 4.78114 0.780731ZM4.65456 8.11604C4.72442 8.47754 4.488 8.82723 4.1265 8.89709C3.18542 9.07896 2.4364 9.35134 1.9416 9.6555C1.41878 9.97688 1.33333 10.2294 1.33333 10.3333C1.33333 10.4059 1.36853 10.5477 1.5894 10.7508C1.81083 10.9544 2.16805 11.
11684 2.66566 11.3619C3.65664 11.7473 5.07098 12 6.66667 12C8.26236 12 9.67671 11.7473 10.6677 11.3619C11.1653 11.1684 11.5225 10.9544 11.7439 10.7508C11.9648 10.5477 12 10.4059 12 10.3333C12 10.2294 11.9145 9.97689 11.3917 9.6555C10.8969 9.35134 10.1479 9.07896 9.20683 8.89709C8.84533 8.82723 8.60891 8.47754 8.67878 8.11604C8.74864 7.75453 9.09833 7.51811 9.45983 7.58798C10.4944 7.78791 11.412 8.10286 12.09 8.51962C12.7399 8.91915 13.3333 9.52111 13.3333 10.3333C13.3333 10.9051 13.0327 11.3771 12.6464 11.7323C12.2606 12.087 11.7391 12.3758 11.1509 12.6046C9.97036 13.0637 8.3847 13.3333 6.66667 13.3333C4.94864 13.3333 3.36299 13.0637 2.1824 12.6046C1.59422 12.3759 1.07276 12.0871 0.686955 11.7323C0.300587 11.3771 0 10.9051 0 10.3333C0 9.52111 0.593403 8.91915 1.24335 8.51962C1.92131 8.10286 2.83896 7.78791 3.8735 7.58798C4.235 7.51812 4.58469 7.75454 4.65456 8.11604Z",fill:"currentColor"})}),zo=()=>(0,l.jsx)("svg",{width:16,height:16,viewBox:"-1.3333 -1.3333 16 16",fill:"none","aria-hidden":!0,focusable:!1,style:Do,children:(0,l.jsx)("path",{d:"M0 2.38095C0 1.06599 1.06599 0 2.38095 0H4.41667C4.6858 0 4.92854 0.161825 5.03205 0.410256L6.28205 3.41026C6.38295 3.65242 6.33245 3.93124 6.15302 4.12263L5.21827 5.11969C5.93624 6.50417 6.84882 7.4698 8.20106 8.18947L9.19526 7.19526C9.38629 7.00424 9.67371 6.94738 9.92308 7.05128L12.9231 8.30128C13.1715 8.40479 13.3333 8.64753 13.3333 8.91667V10.9524C13.3333 12.2673 12.2673 13.3333 10.9524 13.3333C4.90355 13.3333 0 8.42978 0 2.38095ZM2.38095 1.33333C1.80237 1.33333 1.33333 1.80237 1.33333 2.38095C1.33333 7.6934 5.63993 12 10.9524 12C11.531 12 12 11.531 12 10.9524V9.36111L9.82237 8.45377L8.80474 9.4714C8.60651 9.66963 8.30545 9.72267 8.05141 9.60412C6.02098 8.65659 4.74717 7.2847 3.81254 5.28192C3.69732 5.03501 3.74395 4.74282 3.93031 4.54404L4.88549 3.52518L3.97222 1.33333H2.38095Z",fill:"currentColor"})}),Wo=()=>(0,l.jsxs)("svg",{width:16,height:16,viewBox:"-2 -2 16 16",fill:"none","aria-hidden":!0,focusable:!1,style:Do,children:[(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.60352 6.87891C5.32398 6.0866 6.0866 5.32398 6.87891 5.60352L12.1191 7.45313C12.9635 7.75115 13.021 8.92334 12.2096 9.30208L10.2272 10.2272L9.30208 12.2096C8.92334 13.021 7.75115 12.9635 7.45313 12.1191L5.60352 6.87891ZM8.43815 10.9063L9.07031 9.55339L9.11068 9.47591C9.21287 9.29913 9.36709 9.15727 9.55339 9.07031L10.9063 8.43815L7.09245 7.09245L8.43815 10.9063Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M9.33333 0C10.8061 0 12 1.19391 12 2.66667V4C12 4.36819 11.7015 4.66667 11.3333 4.66667C10.9651 4.66667 10.6667 4.36819 10.6667 4V2.66667C10.6667 1.93029 10.0697 1.33333 9.33333 1.33333H2.66667C1.93029 1.33333 1.33333 1.93029 1.33333 2.66667V9.33333C1.33333 10.0697 1.93029 10.6667 2.66667 10.6667H4C4.36819 10.6667 4.66667 10.9651 4.66667 11.3333C4.66667 11.7015 4.36819 12 4 12H2.66667C1.19391 12 0 10.8061 0 9.33333V2.66667C0 1.19391 1.19391 0 2.66667 0H9.33333Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M3.66797 6.13672C4.00429 6.17071 4.26693 6.45484 4.26693 6.80013C4.26684 7.14535 4.00425 7.42956 3.66797 7.46354L3.60026 7.4668H2.80013C2.43199 7.4668 2.13355 7.16825 2.13346 6.80013C2.13346 6.43194 2.43194 6.13346 2.80013 6.13346H3.60026L3.66797 6.13672Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M3.32878 3.32878C3.58913 3.06843 4.01113 3.06843 4.27148 3.32878L4.87174 3.92904L4.91732 3.97917C5.13089 4.24102 5.11583 4.62766 4.87174 4.87174C4.62765 5.11575 4.24099 5.13088 3.97917 4.91732L3.92904 4.87174L3.32878 4.27148C3.06845 4.01116 3.06851 3.58913 3.32878 3.32878Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M6.80013 2.13346C7.16832 2.13346 7.4668 2.43194 7.4668 2.80013V3.60026C7.46664 3.96832 7.16822 4.26693 6.80013 4.26693C6.43204 4.26693 6.13362 3.96832 6.13346 3.60026V2.80013C6.13346 2.43194 6.43194 2.13346 6.80013 2.13346Z",fill:"currentColor"})]}),Uo="#E8E8ED",Ho="#F6F8FA";function Qo(e){if(e.googleMapsUri)return e.googleMapsUri;const t=encodeURIComponent("".concat(e.address,", ").concat(e.city,", ").concat(e.state," ").concat(e.zipcode));return"https://www.google.com/maps/dir/?api=1&destination=".concat(t)}function Zo(e){const t=e.replace(/[^\d+]/g,"");return"tel:".concat(t)}function qo(e){const t=e.toFixed(1);return"".concat(t," mile").concat(1===e?"":"s"," away")}function Yo(e){return e.openNow?e.openUntil?"Open until ".concat(e.openUntil," today"):"Open now":"Closed"}const Ko=e=>{let{store:t,isCompact:n}=e;const r="boolean"==typeof t.openNow,o=!0===t.openNow;return(0,l.jsxs)("div",{style:{display:"flex",gap:16,padding:"24px",borderBottom:"1px solid ".concat(Uo),background:"var(--voice-widget-card-bg, #FFFFFF)"},children:[(0,l.jsx)("div",{style:{width:48,height:48,borderRadius:5.333,flexShrink:0,overflow:"hidden",background:Ho,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)("img",{src:t.retailerLogoUrl,alt:t.retailerName,style:{width:37.333,height:37.333,objectFit:"contain"},onError:e=>{e.currentTarget.style.display="none"}})}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,justifyContent:"space-between"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",gap:8,minWidth:0},children:[(0,l.jsx)("span",{style:{fontSize:16,fontWeight:600,lineHeight:"24px",color:"var(--voice-widget-fg, #111827)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",minWidth:0},title:t.storeName,children:t.storeName}),(0,l.jsx)("span",{style:{fontSize:14,fontWeight:500,lineHeight:"20px",color:"var(--voice-widget-muted, rgba(0,0,0,0.5))",
1whiteSpace:"nowrap",flexShrink:0},children:qo(t.distanceMiles)})]}),r&&(0,l.jsx)("span",{style:{fontSize:12,fontWeight:600,lineHeight:"20px",color:o?"#71C184":"#9CA3AF",background:o?"#F1F9F3":"#F3F4F6",padding:"6px 16px",borderRadius:100,whiteSpace:"nowrap",flexShrink:0},children:Yo(t)})]}),(0,l.jsxs)("div",{style:{fontSize:14,fontWeight:500,lineHeight:"16px",color:"var(--voice-widget-fg, #111827)",marginTop:4,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:"".concat(t.address,", ").concat(t.city,", ").concat(t.state," ").concat(t.zipcode),children:[t.address,", ",t.city,", ",t.state," ",t.zipcode]}),(0,l.jsxs)("div",{style:{display:"flex",gap:8,marginTop:12},children:[(0,l.jsxs)("a",{href:Qo(t),target:"_blank",rel:"noopener noreferrer",style:Go("primary",n),"aria-label":"Directions",title:n?"Directions":void 0,children:[(0,l.jsx)(No,{}),!n&&(0,l.jsx)("span",{children:"Directions"})]}),t.phone&&(0,l.jsxs)("a",{href:Zo(t.phone),style:Go("secondary",n),title:t.phone,"aria-label":"Call ".concat(t.phone),children:[(0,l.jsx)(zo,{}),!n&&(0,l.jsx)("span",{children:"Call"})]}),t.website&&(0,l.jsxs)("a",{href:t.website,target:"_blank",rel:"noopener noreferrer",style:Go("secondary",n),"aria-label":"Website",title:n?"Website":void 0,children:[(0,l.jsx)(Wo,{}),!n&&(0,l.jsx)("span",{children:"Website"})]})]})]})]})};function Go(e,t){const n="primary"===e;return{display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,height:32,width:t?40:124,padding:t?0:"4px 16px",fontSize:12,fontWeight:600,textDecoration:"none",lineHeight:"24px",letterSpacing:"0.08px",borderRadius:16,color:n?"var(--voice-widget-button-fg, #FFFFFF)":"var(--voice-widget-fg, #111827)",background:n?"var(--voice-widget-button-bg, #111827)":Ho,border:"none",flexShrink:0,boxSizing:"border-box"}}function Jo(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xo(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(n),!0).forEach(function(t){_o(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jo(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _o(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $o="var(--voice-widget-fg, #000000)",ei="#e8e8ed",ti="#f6f8fa",ni="#ffbd32",ri="#e8e8ed",oi={positive:{bg:"#f8fcf9",fg:"#71c184"},caution:{bg:"rgba(255, 189, 50, 0.05)",fg:"#ffbd32"},negative:{bg:"#fcebeb",fg:"#791f1f"}};function ii(e){let{size:t,color:n}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 13.3333 13.3333",fill:"none","aria-hidden":"true",style:{display:"block"},children:(0,l.jsx)("path",{d:"M13.2986 5.03851C13.2113 4.75677 12.9718 4.55668 12.6885 4.53004L8.84014 4.16541L7.3184 0.448707C7.2062 0.17632 6.95065 0 6.66673 0C6.38281 0 6.12726 0.17632 6.01506 0.449347L4.49332 4.16541L0.644343 4.53004C0.361543 4.55732 0.12269 4.75679 0.0348901 5.03851C-0.0528966 5.32024 0.0281701 5.62924 0.242103 5.82403L3.15101 8.48611L2.29324 12.4289C2.23048 12.7188 2.3383 13.0185 2.56881 13.1924C2.69272 13.2858 2.83768 13.3333 2.98386 13.3333C3.1099 13.3333 3.23493 13.2979 3.34713 13.2278L6.6667 11.1575L9.98506 13.2278C10.2279 13.3803 10.534 13.3664 10.764 13.1924C10.9946 13.018 11.1023 12.7182 11.0396 12.4289L10.1818 8.48612L13.0907 5.82457C13.3047 5.62925 13.3863 5.32077 13.2985 5.03852L13.2986 5.03851Z",fill:n,fillRule:"evenodd",clipRule:"evenodd"})})}function ai(e){let{size:t,kind:n}=e;return"half"!==n?(0,l.jsx)(ii,{size:t,color:"full"===n?ni:ri}):(0,l.jsxs)("span",{style:{position:"relative",display:"inline-block",width:t,height:t},children:[(0,l.jsx)(ii,{size:t,color:ri}),(0,l.jsx)("span",{style:{position:"absolute",inset:0,width:"50%",overflow:"hidden"},children:(0,l.jsx)(ii,{size:t,color:ni})})]})}function li(e){let{stars:t,size:n=16}=e;const r=Math.max(0,Math.min(5,Math.floor(t))),o=t-r>=.5&&r<5;return(0,l.jsx)("span",{style:{display:"inline-flex",alignItems:"center",gap:2},role:"img","aria-label":"".concat(t," out of 5 stars"),children:Array.from({length:5},(e,t)=>{const i=t<r?"full":t===r&&o?"half":"empty";return(0,l.jsx)(ai,{size:n,kind:i},t)})})}function si(e){let{size:t=20,color:n=$o}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",style:{display:"block"},children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.59511 16.4286C7.39411 16.4286 7.19308 16.35 7.03996 16.1936L2.23034
111.2814C1.92322 10.9678 1.92322 10.4609 2.23034 10.1474C2.53733 9.83385 3.03351 9.83385 3.34066 10.1474L7.59511 14.4925L16.6595 5.23515C16.9665 4.92162 17.4626 4.92162 17.7698 5.23515C18.0767 5.54881 18.0767 6.05559 17.7698 6.36926L8.15039 16.1936C7.99727 16.35 7.79613 16.4286 7.59511 16.4286Z",fill:n})})}function ci(e){let{size:t=20,color:n=$o}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 20 20",fill:"none","aria-hidden":"true",style:{display:"block"},children:(0,l.jsx)("circle",{cx:"10",cy:"10",r:"3",fill:n})})}function di(e){let{size:t=32,color:n=$o}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none","aria-hidden":"true",style:{display:"block"},children:[(0,l.jsx)("rect",{width:"32",height:"32",rx:"5",fill:ti}),(0,l.jsx)("path",{d:"M12.6679 6C8.99117 6 6 8.99144 6 12.6679C6 16.3445 8.99144 19.336 12.6679 19.336C14.3234 19.336 15.8365 18.7277 17.0039 17.7251L18.1419 18.8632L17.4366 19.5684C17.3393 19.6648 17.2844 19.796 17.2844 19.9331C17.2844 20.07 17.3393 20.2014 17.4366 20.2976L22.9907 25.8517C23.087 25.9491 23.2183 26.0039 23.3554 26.0039C23.4923 26.0039 23.6237 25.9491 23.72 25.8517L25.8518 23.7118C25.9467 23.6158 26 23.4862 26 23.3512C26 23.2162 25.9467 23.0865 25.8518 22.9905L20.2977 17.4287C20.1859 17.318 20.0293 17.2647 19.873 17.2844C19.7582 17.2968 19.6508 17.3477 19.5685 17.4287L18.8633 18.1339L17.7331 17.0039C18.7328 15.8375 19.3361 14.3209 19.3361 12.6679C19.3361 8.99117 16.3446 6 12.6679 6H12.6679ZM12.6679 7.0258C15.79 7.0258 18.3101 9.54586 18.3101 12.6681C18.3101 15.7903 15.7901 18.3104 12.6679 18.3104C9.54562 18.3104 7.02556 15.7903 7.02556 12.6681C7.02556 9.54586 9.54562 7.0258 12.6679 7.0258ZM19.9371 18.5187L20.8346 19.4163L19.4242 20.8269L18.5265 19.9292L19.9371 18.5187ZM21.564 20.1457L24.7698 23.3515L23.3592 24.762L20.1534 21.5562L21.564 20.1457Z",fill:n})]})}function ui(e){let{tone:t,size:n=20}=e;return"positive"===t?(0,l.jsx)(si,{size:n}):(0,l.jsx)(ci,{size:n})}const pi={fontSize:16,fontWeight:600,color:$o,letterSpacing:"0.08px",margin:0};function gi(e){let{excerpt:t}=e;return(0,l.jsxs)("div",{style:{background:ti,border:"1px solid ".concat(ei),borderRadius:10,padding:16,display:"flex",flexDirection:"column",gap:10},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:12},children:[t.title&&(0,l.jsx)("span",{style:{fontSize:14,fontWeight:600,color:$o,letterSpacing:"0.08px",lineHeight:"24px"},children:t.title}),(0,l.jsx)("span",{style:{flexShrink:0},children:(0,l.jsx)(li,{stars:t.stars,size:16})})]}),(0,l.jsx)("p",{style:{margin:0,fontSize:14,fontWeight:500,color:$o,letterSpacing:"0.08px",lineHeight:"24px"},children:t.snippet})]})}function fi(e){let{summary:t}=e;const{title:n,query:r,bullets:o,themes:i,excerpts:a}=t,s=[...o.filter(e=>"positive"===e.tone),...o.filter(e=>"positive"!==e.tone)];return(0,l.jsxs)("div",{style:{background:"#ffffff",border:"1px solid ".concat(ei),borderRadius:10,padding:24,boxSizing:"border-box",color:$o,animation:"voice-widget-fade-in 0.28s ease-out both"},children:[(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,l.jsx)("span",{style:{fontSize:12,color:"rgba(0, 0, 0, 0.5)",letterSpacing:"1px",textTransform:"uppercase"},children:"Shopper Insights"}),n&&(0,l.jsx)("h3",{style:{fontSize:18,fontWeight:600,margin:0,color:$o,letterSpacing:"0.08px"},children:n})]}),(0,l.jsx)("div",{style:{height:1,background:ei,margin:"20px -24px"}}),r&&(0,l.jsxs)("div",{style:{background:ti,border:"1px solid ".concat(ei),borderRadius:10,padding:16,display:"flex",alignItems:"center",gap:13,marginBottom:24},children:[(0,l.jsx)("span",{style:{flexShrink:0},children:(0,l.jsx)(di,{size:32})}),(0,l.jsx)("span",{style:{fontSize:16,fontWeight:500,color:$o,letterSpacing:"0.08px",lineHeight:"24px"},children:r})]}),i.length>0&&(0,l.jsxs)("div",{style:{marginBottom:24},children:[(0,l.jsx)("p",{style:Xo(Xo({},pi),{},{marginBottom:16}),children:"Key themes"}),(0,l.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:8},children:i.map((e,t)=>{var n;const r=null!==(n=oi[e.tone])&&void 0!==n?n:oi.positive;return(0,l.jsx)("span",{style:{fontSize:12,fontWeight:600,lineHeight:"20px",padding:"4px 16px",borderRadius:100,background:r.bg,color:r.fg,whiteSpace:"nowrap"},children:e.label},"".concat(t,"-").concat(e.label))})})]}),s.length>0&&(0,l.jsxs)("div",{style:{marginBottom:24},children:[(0,l.jsx)("p",{style:Xo(Xo({},pi),{},{marginBottom:16}),children:"What customers are saying"}),(0,l.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:15},children:s.map((e,t)=>(0,l.jsxs)("li",{style:{display:"flex",alignItems:"center",gap:8,fontSize:14,fontWeight:500,color:$o,letterSpacing:"0.08px",lineHeight:"20px"},children:[(0,l.jsx)("span",{style:{flexShrink:0},children:(0,l.jsx)(ui,{tone:e.tone})}),(0,l.jsx)("span",{children:e.text})]},"".concat(t,"-").concat(e.text.slice(0,12))))})]}),a.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{style:Xo(Xo({},pi),{},{marginBottom:16}),children:"Highlights"}),(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:14},children:a.map((e,t)=>{var n;return(0,l.jsx)(gi,{excerpt:e},"".concat(t,"-").concat((null!==(n=e.title)&&void 0!==n?n:e.snippet).slice(0,12)))})})]})]})}function hi(e){let{product:t}=e;return(0,l.jsxs)("div",{style:{background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:10,padding:"10px 8px",display:"flex",flexDirection:"column",gap:6,animation:"voice-widget-fade-in 0.28s ease-out both",minWidth:0},children:[t.imageUrl&&(0,l.jsx)("img",{src:t.imageUrl,alt:t.title,style:{width:"100%",height:56,objectFit:"contain",borderRadius:6,background:"var(--voice-widget-img-bg, #F9FAFB)"}}),(0,l.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--voice-widget-fg, #111827)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:t.title}),(0,l.jsx)("div",{style:{fontSize:13,fontWeight:700,color:"var(--voice-widget-price, #111827)",marginTop:"auto"},children:t.price})]})}
1const mi="var(--voice-widget-star, #F59E0B)";function vi(e){let{size:t}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 640 640",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,style:{display:"block",flexShrink:0},children:(0,l.jsx)("path",{fill:mi,d:"M341.5 45.1C337.4 37.1 329.1 32 320.1 32C311.1 32 302.8 37.1 298.7 45.1L225.1 189.3L65.2 214.7C56.3 216.1 48.9 222.4 46.1 231C43.3 239.6 45.6 249 51.9 255.4L166.3 369.9L141.1 529.8C139.7 538.7 143.4 547.7 150.7 553C158 558.3 167.6 559.1 175.7 555L320.1 481.6L464.4 555C472.4 559.1 482.1 558.3 489.4 553C496.7 547.7 500.4 538.8 499 529.8L473.7 369.9L588.1 255.4C594.5 249 596.7 239.6 593.9 231C591.1 222.4 583.8 216.1 574.8 214.7L415 189.3L341.5 45.1z"})})}function yi(e){let{size:t}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,style:{display:"block",flexShrink:0},children:(0,l.jsx)("path",{fill:mi,d:"M304.1 7.6c0-11.1-7.6-20.7-18.4-23.3s-21.9 2.5-27 12.4L193.1 125.3 33.2 150.7c-8.9 1.4-16.3 7.7-19.1 16.3s-.5 18 5.8 24.4l114.4 114.5-25.2 159.9c-1.4 8.9 2.3 17.9 9.6 23.2s16.9 6.1 25 2L291 416.1c8-4.1 13.1-12.4 13.1-21.4l0-387.1z"})})}function xi(e){let{size:t}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 576 512",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,style:{display:"block",flexShrink:0},children:(0,l.jsx)("path",{fill:mi,d:"M287.9 0C297.1 0 305.5 5.25 309.5 13.52L378.1 154.8L531.4 177.5C540.4 178.8 547.8 185.1 550.7 193.7C553.5 202.4 551.2 211.9 544.8 218.2L433.6 328.4L459.9 483.9C461.4 492.9 457.7 502.1 450.2 507.4C442.8 512.7 432.1 513.4 424.9 509.1L287.9 435.9L150.1 509.1C142.9 513.4 133.1 512.7 125.6 507.4C118.2 502.1 114.5 492.9 116 483.9L142.3 328.4L31.11 218.2C24.65 211.9 22.36 202.4 25.32 193.7C28.27 185.1 35.66 178.8 44.61 177.5L197.9 154.8L266.5 13.52C270.5 5.25 278.9 0 287.9 0L287.9 0zM287.9 78.95L235.4 187.2C231.9 194.3 225.1 199.3 217.3 200.5L98.98 217.9L184.9 303C190.4 308.5 192.9 316.4 191.6 324.1L171.4 443.7L276.6 387.5C283.7 383.7 292.2 383.7 299.2 387.5L404.4 443.7L384.2 324.1C382.9 316.4 385.5 308.5 391 303L476.9 217.9L358.6 200.5C350.7 199.3 343.9 194.3 340.5 187.2L287.9 78.95z"})})}function bi(e){let{amazonRating:t,amazonReviewCount:n,size:r=14,countFontSize:o=11,format:i="short"}=e;if("number"!=typeof t||t<=0)return null;const a=Math.min(5,Math.floor(t)),s=t-a>=.5&&a<5,c=Math.max(0,5-a-(s?1:0)),d="number"==typeof n&&n>0?n.toLocaleString("en-US"):null,u="long"===i?"".concat(t.toFixed(1)).concat(d?" (".concat(d," review").concat(1===n?"":"s",")"):""):d?"(".concat(d,")"):null;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,flexWrap:"wrap"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:2},role:"img","aria-label":"".concat(t," out of 5 stars"),children:[Array.from({length:a},(e,t)=>(0,l.jsx)(vi,{size:r},"f-".concat(t))),s?(0,l.jsx)(yi,{size:r}):null,Array.from({length:c},(e,t)=>(0,l.jsx)(xi,{size:r},"e-".concat(t)))]}),u?(0,l.jsx)("span",{style:{fontSize:o,color:"var(--voice-widget-muted, #6B7280)"},children:u}):null]})}const wi="var(--voice-widget-fg, #2B4168)",Ai="var(--voice-widget-border, #E5E7EB)",Ci="var(--voice-widget-card-bg, #FFFFFF)",ji="var(--voice-widget-button-fg, #FFFFFF)",Si="var(--voice-widget-hairline, #F1F1F4)";function ki(e){let{size:t}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:wi,strokeWidth:1.5,style:{opacity:.3,display:"block"},"aria-hidden":!0,children:[(0,l.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,l.jsx)("circle",{cx:"9",cy:"9",r:"2"}),(0,l.jsx)("path",{d:"m21 15-5-5L5 21"})]})}function Oi(e){let{src:t,alt:n,height:o,padding:i}=e;const[a,s]=(0,r.useState)(!1);(0,r.useEffect)(()=>{s(!1)},[t]);const c=!!t&&!a;return(0,l.jsx)("div",{style:{background:Ci,border:"1px solid ".concat(Ai),borderRadius:8,padding:i,height:o,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:c?(0,l.jsx)("img",{src:t,alt:n,onError:()=>s(!0),style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block"}}):(0,l.jsx)(ki,{size:48})})}function Ii(e){let{src:t,active:n,onClick:o,index:i}=e;const[a,s]=(0,r.useState)(!1);(0,r.useEffect)(()=>{s(!1)},[t]);const c=!!t&&!!o,d=!!t&&!a;return(0,l.jsx)("button",{type:"button",onClick:c?o:void 0,"aria-label":"View ".concat(i+1),style:{flex:1,aspectRatio:"1 / 1",background:Ci,border:"1.5px solid ".concat(n?wi:Ai),borderRadius:8,padding:6,cursor:c?"pointer":"default",display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden",transition:"border-color 160ms ease-out",font:"inherit",color:"inherit"},children:d?(0,l.jsx)("img",{src:t,alt:"",onError:()=>s(!0),style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain",display:"block"}}):(0,l.jsx)(ki,{size:20})})}function Pi(e){let{category:t,subcategory:n,compact:r}=e;const o=(r?[n||t]:[t,n]).filter(e=>"string"==typeof e&&e.trim().length>0).join(" · ");return o?(0,l.jsx)("div",{style:{fontSize:13,color:wi,opacity:.75,marginBottom:14},children:o}):null}function Ei(e){let{text:t}=e;return(0,l.jsxs)("li",{style:{fontSize:13,lineHeight:1.5,color:wi,padding:"6px 0 6px 22px",position:"relative"},children:[(0,l.jsx)("span",{"aria-hidden":!0,style:{position:"absolute",left:0,top:6,color:wi,fontWeight:700,fontSize:13},children:"â"}),t]})}function Vi(e){let{bullets:t,collapseKeyFeatures:n}=e;const[o,i]=(0,r.useState)(!1),a=r.useRef(null),[s,c]=(0,r.useState)(0),d=t.join("�"),u=n&&t.length>3,p=u?t.slice(3):[];return(0,r.useLayoutEffect)(()=>
1{if(!u)return void c(0);const e=a.current;e&&c(o?e.scrollHeight:0)},[u,o,d]),0===t.length?null:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:wi,opacity:.7,textTransform:"uppercase",letterSpacing:"0.05em"},children:"Key Features"}),(0,l.jsx)("ul",{style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:0},children:(u?t.slice(0,3):t).map((e,t)=>(0,l.jsx)(Ei,{text:e},t))}),u?(0,l.jsx)("div",{style:{overflow:"hidden",maxHeight:o?s:0,opacity:o?1:0,transition:"max-height ".concat(260,"ms ease-out, opacity ").concat(260,"ms ease-out")},"aria-hidden":!o,children:(0,l.jsx)("ul",{ref:a,style:{listStyle:"none",margin:0,padding:0,display:"flex",flexDirection:"column",gap:0},children:p.map((e,t)=>(0,l.jsx)(Ei,{text:e},t))})}):null,u?(0,l.jsx)("button",{type:"button",onClick:()=>i(e=>!e),"aria-expanded":o,style:{alignSelf:"flex-start",margin:0,padding:0,border:"none",background:"none",font:"inherit",fontSize:13,fontWeight:500,color:wi,cursor:"pointer",textDecoration:"underline",textUnderlineOffset:3},children:o?"See less":"See more"}):null]})}function Fi(e){let{price:t,href:n}=e;const r={background:"var(--voice-widget-button-bg, #2B4168)",color:ji,border:"none",padding:"14px 28px",fontSize:14,fontWeight:500,borderRadius:999,textDecoration:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:10,cursor:n?"pointer":"default",width:"100%",maxWidth:400,boxSizing:"border-box"},o=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{children:"View product"}),t?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{"aria-hidden":!0,style:{width:4,height:4,borderRadius:"50%",background:ji,opacity:.85,display:"inline-block",flexShrink:0}}),(0,l.jsx)("span",{style:{fontWeight:600},children:t})]}):null]});return n?(0,l.jsx)("a",{href:n,target:"_blank",rel:"noreferrer",style:r,children:o}):(0,l.jsx)("div",{style:r,children:o})}var Bi=n(47355),Li=n(57469),Ri=n(17078),Ti=n(56196),Mi=n(93053),Di=n(19165);const Ni={placed:{label:"Placed",bg:"#F1EFE8",fg:"#444441",dot:"#888780"},processing:{label:"Processing",bg:"#FAEEDA",fg:"#633806",dot:"#BA7517"},shipped:{label:"Shipped",bg:"#E6F1FB",fg:"#0C447C",dot:"#185FA5"},out_for_delivery:{label:"Out for delivery",bg:"#E6F1FB",fg:"#0C447C",dot:"#185FA5"},delivered:{label:"Delivered",bg:"#E8F3E4",fg:"#1F4711",dot:"#3B6D11"},cancelled:{label:"Cancelled",bg:"#FCEBEB",fg:"#791F1F",dot:"#A32D2D"},returned:{label:"Returned",bg:"#F1EFE8",fg:"#444441",dot:"#888780"},unknown:{label:"Unknown",bg:"#F1EFE8",fg:"#444441",dot:"#888780"}},zi="var(--voice-widget-card-bg, #FFFFFF)",Wi="var(--voice-widget-border, #E5E7EB)",Ui="var(--voice-widget-fg, #111827)",Hi="var(--voice-widget-muted, #6B7280)",Qi="var(--voice-widget-img-bg, #F9FAFB)",Zi={USD:"$",CAD:"$",EUR:"â¬",GBP:"£"};function qi(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"USD";if(null==e||Number.isNaN(e))return;const r=null!==(t=Zi[n])&&void 0!==t?t:"";return"".concat(r).concat(Number(e).toFixed(2))}function Yi(e){let{src:t,alt:n}=e;const[o,i]=(0,r.useState)(!1),a=!t||o;return(0,l.jsx)("div",{style:{width:88,height:88,flexShrink:0,background:Qi,border:"1px solid ".concat(Wi),borderRadius:10,display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"},children:a?(0,l.jsx)(Bi.A,{size:28,strokeWidth:1.5,color:Hi,"aria-hidden":!0}):(0,l.jsx)("img",{src:t,alt:n,onError:()=>i(!0),style:{width:"100%",height:"100%",objectFit:"contain",display:"block"}})})}function Ki(e){let{icon:t,text:n}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:10.5,fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:Hi,marginBottom:10},children:[t,n]})}function Gi(e){let{label:t,value:n,valueColor:r,valueWeight:o}=e;return void 0===n?null:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between"},children:[(0,l.jsx)("span",{style:{color:Hi},children:t}),(0,l.jsx)("span",{style:{fontVariantNumeric:"tabular-nums",color:null!=r?r:Ui,fontWeight:null!=o?o:400},children:n})]})}function Ji(e){var t,n;let{item:r,currency:o,isLast:i}=e;const a=null!==(t=r.currency)&&void 0!==t?t:o,s=void 0!==r.currentRetailPrice&&r.currentRetailPrice!==r.pricePaid,c=[r.subtitle,r.qty?"Qty ".concat(r.qty):void 0].filter(
1Boolean);return(0,l.jsxs)("div",{style:{display:"flex",gap:16,padding:"20px 24px",borderBottom:i?void 0:"1px solid ".concat(Wi)},children:[(0,l.jsx)(Yi,{src:r.imageUrl,alt:r.title}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[r.brand&&(0,l.jsx)("div",{style:{fontSize:10.5,fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:Hi,marginBottom:4},children:r.brand}),(0,l.jsx)("div",{style:{fontSize:15,fontWeight:500,color:Ui,lineHeight:1.35},children:r.title}),(c.length>0||r.sellerName)&&(0,l.jsxs)("div",{style:{fontSize:12.5,color:Hi,marginTop:4},children:[c.join(" · "),r.sellerName&&(0,l.jsxs)(l.Fragment,{children:[c.length>0&&(0,l.jsx)("span",{style:{margin:"0 6px",color:Wi},children:"·"}),(0,l.jsxs)("span",{children:["Sold by ",r.sellerName]})]})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",flexWrap:"wrap",gap:"4px 10px",marginTop:10},children:[(0,l.jsx)("span",{style:{fontSize:17,fontWeight:600,color:Ui,fontVariantNumeric:"tabular-nums"},children:qi(r.pricePaid,a)}),s&&(0,l.jsx)("span",{style:{fontSize:12.5,color:Hi,textDecoration:"line-through",fontVariantNumeric:"tabular-nums"},children:qi(r.currentRetailPrice,a)}),void 0!==r.rewardEarned&&r.rewardEarned>0&&(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontSize:11,fontWeight:500,color:"#26215C",background:"#EEEDFE",padding:"2px 8px",borderRadius:999},children:[(0,l.jsx)(Li.A,{size:12,strokeWidth:2,"aria-hidden":!0}),qi(r.rewardEarned,a)," reward earned"]})]}),r.shipmentStatus&&(0,l.jsx)("div",{style:{fontSize:12,color:Hi,marginTop:8},children:null!==(n=r.shipmentStatusMessage)&&void 0!==n?n:r.shipmentStatus}),r.returnStatus&&(0,l.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:6,marginTop:12,fontSize:12,fontWeight:500,color:"#633806",background:"#FAEEDA",padding:"4px 10px",borderRadius:6},children:[(0,l.jsx)(Ri.A,{size:13,strokeWidth:2,"aria-hidden":!0}),r.returnStatus.label,r.returnStatus.reason&&(0,l.jsxs)("span",{style:{fontWeight:400,color:"#854F0B"},children:["· ",r.returnStatus.reason]})]})]})]})}function Xi(e){let{shipping:t}=e;const n=[t.city,t.state].filter(Boolean).join(", ");return(0,l.jsxs)("div",{style:{background:zi,padding:"20px 24px"},children:[(0,l.jsx)(Ki,{icon:(0,l.jsx)(Ti.A,{size:13,strokeWidth:2,color:Hi,"aria-hidden":!0}),text:t.isPickup?"Pickup":"Shipping"}),(0,l.jsxs)("div",{style:{fontSize:13,lineHeight:1.55,color:Ui},children:[t.recipientName&&(0,l.jsx)("div",{children:t.recipientName}),t.addressLine1&&(0,l.jsx)("div",{children:t.addressLine1}),t.addressLine2&&(0,l.jsx)("div",{children:t.addressLine2}),(n||t.zipCode)&&(0,l.jsxs)("div",{children:[n,t.zipCode?" ".concat(t.zipCode):""]}),t.country&&(0,l.jsx)("div",{children:t.country})]}),(t.method||t.etaLabel)&&(0,l.jsx)("div",{style:{fontSize:12,color:Hi,marginTop:10},children:[t.method,t.etaLabel].filter(Boolean).join(" · ")}),t.trackingUrl&&(0,l.jsxs)("a",{href:t.trackingUrl,target:"_blank",rel:"noopener noreferrer",style:{marginTop:8,display:"inline-flex",alignItems:"center",gap:4,fontSize:12,fontWeight:500,color:"var(--voice-widget-accent-dark, #0D9488)",textDecoration:"none"},children:["Track",t.carrier?" with ".concat(t.carrier):"",(0,l.jsx)(Mi.A,{size:12,strokeWidth:2,"aria-hidden":!0})]})]})}function _i(e){let{payment:t,currency:n}=e;const r=function(e){if(!e)return;const t=e.trim().toLowerCase();return"visa"===t?"VISA":"mastercard"===t||"master"===t||"master-card"===t?"MASTERCARD":"american-express"===t||"amex"===t||"american_express"===t?"AMEX":"discover"===t?"DISCOVER":e.toUpperCase()}(t.issuer);return(0,l.jsxs)("div",{style:{background:zi,padding:"20px 24px"},children:[(0,l.jsx)(Ki,{icon:(0,l.jsx)(Di.A,{size:13,strokeWidth:2,color:Hi,"aria-hidden":!0}),text:"Payment"}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,fontSize:13,color:Ui},children:[r&&(0,l.jsx)("span",{style:{background:Ui,color:zi,padding:"2px 6px",borderRadius:4,fontSize:10,fontWeight:600,letterSpacing:"0.05em"},children:r}),t.last4&&(0,l.jsxs)("span",{children:["ending in ",t.last4]}),!r&&!t.last4&&t.methodLabel&&(0,l.jsx)("span",{children:t.methodLabel})]}),t.cardHolderName&&(0,l.jsx)("div",{style:{fontSize:12,color:Hi,marginTop:4},children:t.cardHolderName}),t.billedToSame&&(0,l.jsx)("div",{style:{fontSize:12,color:Hi,marginTop:10},children:"Billed to same address"}),void 0!==t.giftCardApplied&&t.giftCardApplied>0&&(0,l.jsxs)("div",{style:{fontSize:12,color:Hi,marginTop:4},children:["Gift card applied: ",qi(t.giftCardApplied,n)]})]})}function $i(e){let{summary:t,currency:n}=e;return(0,l.jsxs)("div",{style:{background:Qi,padding:"20px 24px",borderTop:"1px solid ".concat(Wi)},children:[(0,l.jsx)("div",{style:{fontSize:10.5,fontWeight:600,letterSpacing:"0.08em",textTransform:"uppercase",color:Hi,marginBottom:12},children:"Order summary"}),(0,l.jsxs)("div",{style:{fontSize:13,display:"flex",flexDirection:"column",gap:6},children:[(0,l.jsx)(Gi,{label:"Subtotal",value:qi(t.subtotal,n)}),void 0!==t.shipping&&(0,l.jsx)(Gi,{label:"Shipping",value:0===t.shipping?"Free":qi(t.shipping,n),valueColor:0===t.shipping?"#3B6D11":void 0,valueWeight:0===t.shipping?500:void 0}),void 0!==t.shippingDiscount&&t.shippingDiscount>0&&(0,l.jsx)(Gi,{label:"Shipping discount",value:"â".concat(qi(t.shippingDiscount,n))}),void 0!==t.couponDiscount&&t.couponDiscount>0&&(0,l.jsx)(Gi,{label:"Coupon",value:"â".concat(qi(t.couponDiscount,n))}),void 0!==t.giftCard&&t.giftCard>0&&(0,l.jsx)(Gi,{label:"Gift card",value:"â".concat(qi(t.giftCard,n))}),void 0!==t.tax&&(0,l.jsx)(Gi,{label:"Tax",value:qi(t.tax,n)}),void 0!==t.serviceFee&&t.serviceFee>0&&(0,l.jsx)(Gi,{label:"Service fee",value:qi(t.serviceFee,n)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",marginTop:12,paddingTop:12,borderTop:"1px solid ".concat(Wi)},children:[(0,l.jsx)("span",{style:{fontSize:13,fontWeight:500,color:Ui},children:"Total"}),(0,l.jsx)("span",{style:{fontSize:19,fontWeight:600,color:Ui,fontVariantNumeric:"tabular-nums"},children:qi(t.total,n)})]})]})}const ea=[{key:"placed",label:"Order Placed"},{key:"shipped",label:"Shipped"},{key:"out_for_delivery",label:"Out for delivery"},{key:"delivered",label:"Delivered"}],ta={processing:{label:"Processing Order",color:"#D97706",bg:"#FFFBEB"},cancelled:{label:"Cancelled",color:"#DC2626",bg:"#FEF2F2"},returned:{label:"Returned",color:"#7C3AED",bg:"#F5F3FF"},unknown:{label:"Unknown",color:"#6B7280",bg:"#F9FAFB"}};var na=n(41153);const ra=e=>{let{retailerIds:t,maxSize:n=4,iconSize:r=18,buildUnrenderedIconCountString:o=e=>"+".concat(e)}=e;const i=t.slice(0,n),a=t.length-n,s=i.length*r-.46*r*(i.length-1);return(0,l.jsxs)("div",{className:j("tw:flex tw:items-center"),style:{isolation:"isolate"},children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center",style:{width:"".concat(s,"px")},children:i.map((e,t)=>{const n=.46*r;return(0,l.jsx)("img",{src:(0,xr.d2)(e,"retailer"),alt:"","aria-hidden":"true",onError:e=>{e.currentTarget.style.display="none"},className:"tw:object-contain tw:rounded-full tw:relative",style:{width:"".concat(r,"px"),height:"".concat(r,"px"),left:"".concat(-n*t,"px"),zIndex:"".concat(i.length-t),mixBlendMode:"normal"}},"retailer-logo-".concat(e,"-").concat(t))})}),a>=1?(0,l.jsx)("div",{className:"tw:ml-[7px] tw:font-semibold tw:text-[11px]",children:o(a)}):null]})};function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ia(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?oa(Object(n),!0).forEach(function(t){aa(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function aa(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const la="\n@keyframes voice-widget-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n";function sa(e){let{product:t}=e;const n=t.retailerProductPageUrl,r="number"==typeof t.retailerId&&t.retailerId>0&&t.retailerId<1e5,o=n?{href:n,target:"_blank",rel:"noreferrer"}:null,i="number"==typeof(a=t.price)?"$".concat(a.toFixed(2)):"string"==typeof a?a:"";var a;return(0,l.jsxs)("div",{style:{position:"relative",background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,padding:"16px 12px 12px",display:"flex",flexDirection:"column",gap:8,boxShadow:"0 1px 4px rgba(0,0,0,0.06)",transition:"box-shadow 160ms ease-out, transform 160ms ease-out",animation:"voice-widget-fade-in 0.28s ease-out both",height:"100%",maxWidth:230,width:"100%",boxSizing:"border-box",minWidth:0},children:[t.imageUrl&&(o?(0,l.jsx)("a",ia(ia({},o),{},{style:{display:"flex",justifyContent:"center"},children:(0,l.jsx)("img",{src:t.imageUrl,alt:t.title,style:{width:100,height:100,objectFit:"contain",borderRadius:8,background:"var(--voice-widget-img-bg, #F9FAFB)"}})})):(0,l.jsx)("div",{style:{display:"flex",justifyContent:"center"},children:(0,l.jsx)("img",{src:t.imageUrl,alt:t.title,style:{width:100,height:100,objectFit:"contain",borderRadius:8,background:"var(--voice-widget-img-bg, #F9FAFB)"}})})),t.brand&&(0,l.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--voice-widget-muted, #6B7280)",textTransform:"uppercase",letterSpacing:.4,lineHeight:1.2},children:t.brand}),o?(0,l.jsx)("a",ia(ia({},o),{},{style:{fontSize:13,fontWeight:600,color:"var(--voice-widget-fg, #111827)",lineHeight:1.35,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",minHeight:"calc(13px * 1.35 * 2)",textDecoration:"none"},children:t.title})):(0,l.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"var(--voice-widget-fg, #111827)",lineHeight:1.35,display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",overflow:"hidden",minHeight:"calc(13px * 1.35 * 2)"},children:t.title}),t.badge&&(0,l.jsx)("div",{style:{fontSize:10,fontWeight:600,color:"var(--voice-widget-badge-fg, #059669)",background:"var(--voice-widget-badge-bg, #ECFDF5)",padding:"2px 8px",borderRadius:999,alignSelf:"flex-start"},children:t.badge}),(0,l.jsx)(bi,{amazonRating:t.amazonRating,amazonReviewCount:t.amazonReviewCount,size:13,countFontSize:11}),(r||t.retailerName)&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:6,minHeight:18},children:[r&&(0,l.jsx)(ra,{retailerIds:[t.retailerId],iconSize:16,maxSize:3}),!r&&t.retailerName&&(0,l.jsx)("span",{style:{fontSize:11,color:"var(--voice-widget-muted, #6B7280)"},children:t.retailerName})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:6,marginTop:"auto"},children:[(0,l.jsx)("div",{style:{fontSize:17,fontWeight:700,color:"var(--voice-widget-price, #111827)",lineHeight:1.1},children:i}),t.hasRewards&&null!=t.totalRewardAmount&&t.totalRewardAmount>0&&(0,l.jsxs)("div",{style:{fontSize:10,fontWeight:600,color:"var(--voice-widget-badge-fg, #059669)",background:"var(--voice-widget-badge-bg, #ECFDF5)",padding:"2px 7px",borderRadius:999,whiteSpace:"nowrap"},children:["$",t.totalRewardAmount.toFixed(2)," back"]})]}),!1===t.isAvailable&&(0,l.jsx)("div",{style:{fontSize:11,fontWeight:600,color:"var(--voice-widget-warn, #DC2626)"},children:"Out of stock"}),o&&(0,l.jsx)("a",ia(ia({},o),{},{style:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:32,background:"var(--voice-widget-button-bg, #111827)",color:"var(--voice-widget-button-fg, #FFFFFF)",borderRadius:999,fontSize:12,fontWeight:600,textDecoration:"none",marginTop:6,flexShrink:0},children:"View product"}))]})}function ca(e,t){switch(e.type){case"price":{const e=t.price;if(null==e||""===e)return"â";const n="number"==typeof e?e:Number(e.replace(/[^\d.-]/g,""));return!Number.isFinite(n)||n<=0?"string"==typeof e?e:"â":(0,l.jsxs)("span",{style:{fontWeight:700,color:"var(--voice-widget-price, #111827)"},children:["$",n.toFixed(2)]})}case"rating":return"number"!=typeof t.amazonRating||t.amazonRating<=0?"â":(0,l.jsx)(bi,{amazonRating:t.amazonRating,amazonReviewCount:t.amazonReviewCount});case"availability":return null==t.isAvailable?"â":t.isAvailable?(0,l.jsx)("span",{style:{color:"var(--voice-widget-badge-fg, #059669)",fontWeight:600,fontSize:12},children:"In stock"}):(0,l.jsx)("span",{style:{color:"var(--voice-widget-warn, #DC2626)",fontWeight:600,fontSize:12},children:"Out of stock"});case"reward":return t.hasRewards&&null!=t.totalRewardAmount&&t.totalRewardAmount>0?(0,l.jsxs)("span",{style:{fontSize:11,fontWeight:600,color:"var(--voice-widget-badge-fg, #059669)",background:"var(--voice-widget-badge-bg, #ECFDF5)",padding:"2px 8px",borderRadius:999},children:["$",t.totalRewardAmount.toFixed(2)," back"]}):(0,l.jsx)("span",{style:{color:"var(--voice-widget-muted, #6B7280)"},children:"None"});case"bullets":{const n=t[e.key];return Array.isArray(n)&&0!==n.length?(0,l.jsx)("ul",{style:{margin:0,paddingLeft:16,fontSize:11,lineHeight:1.5,color:"var(--voice-widget-fg, #111827)"},children:n.slice(0,3).map((e,t)=>(0,l.jsx)("li",{children:e},t))}):"â"}default:{const n=t[e.key];return null==n||""===n||"â"===n?"â":String(n)}}}const da=e=>{let{products:t,attributes:n,isCompact:r}=e;const o=r?100:110,i=r?o+(r?150:0)*t.length:void 0;return(0,l.jsx)("div",{style:{width:"100%",boxSizing:"border-box",padding:"8px 8px 12px",overflowX:r?"auto":"visible",WebkitOverflowScrolling:"touch"},children:(0,l.jsxs)("table",{style:{width:"100%",minWidth:i,borderCollapse:"separate",borderSpacing:0,background:"var(--voice-widget-card-bg, #FFFFFF)",borderRadius:14,overflow:"hidden",boxShadow:"0 1px 4px rgba(0,0,0,0.06)",tableLayout:"fixed",fontSize:12,color:"var(--voice-widget-fg, #111827)"},children:[(0,l.jsx)("thead",{children:(0,l.jsxs)("tr",{children:[(0,l.jsx)("th",{style:{width:o,background:"var(--voice-widget-table-head-bg, #F9FAFB)",borderBottom:"1px solid var(--voice-widget-border, #E5E7EB)"}}),t.map(e=>{const t=e.retailerProductPageUrl,n=t?{href:t,target:"_blank",rel:"noreferrer"}:null;return(0,l.jsx)("th",{style:{padding:"14px 12px 10px",textAlign:"center",verticalAlign:"top",fontWeight:600,borderBottom:"1px solid var(--voice-widget-border, #E5E7EB)",background:"var(--voice-widget-table-head-bg, #F9FAFB)"},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:8},children:[e.imageUrl&&(n?(0,l.jsx)("a",ia(ia({},n),{},{style:{lineHeight:0},children:(0,l.jsx)("img",{src:e.imageUrl,alt:e.title,style:{width:64,height:64,objectFit:"contain",borderRadius:6,background:"var(--voice-widget-img-bg, #F9FAFB)"}})})):(0,l.jsx)("img",{src:e.imageUrl,alt:e.title,style:{width:64,height:64,objectFit:"contain",borderRadius:6,background:"var(--voice-widget-img-bg, #F9FAFB)"}})),(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--voice-widget-fg, #111827)",lineHeight:1.3,display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden"},children:e.title}),n&&(0,l.jsx)("a",ia(ia({},n),{},{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",background:"var(--voice-widget-button-bg, #111827)",color:"var(--voice-widget-button-fg, #FFFFFF)",borderRadius:999,padding:"6px 14px",fontSize:11,fontWeight:600,textDecoration:"none"},children:"View product"}))]})}
1,e.stacklineSku)})]})}),(0,l.jsx)("tbody",{children:n.map((e,n)=>(0,l.jsxs)("tr",{style:{background:n%2==0?"var(--voice-widget-card-bg, #FFFFFF)":"var(--voice-widget-table-row-alt-bg, #F9FAFB)"},children:[(0,l.jsx)("td",{style:{padding:"10px 12px",fontSize:11,fontWeight:600,textTransform:"uppercase",letterSpacing:.3,color:"var(--voice-widget-muted, #6B7280)",borderBottom:"1px solid var(--voice-widget-border, #E5E7EB)",verticalAlign:"top"},children:e.label}),t.map(t=>(0,l.jsx)("td",{style:{padding:"10px 12px",textAlign:"center",verticalAlign:"top",borderBottom:"1px solid var(--voice-widget-border, #E5E7EB)",color:"var(--voice-widget-fg, #111827)",fontSize:12,lineHeight:1.4},children:ca(e,t)},t.stacklineSku))]},e.key))})]})})};function ua(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function pa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ua(Object(n),!0).forEach(function(t){ga(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ua(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ga(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const fa={"data-widget-comparison":e=>{let{data:t}=e;const n=t.products.slice(0,3),r=Array.isArray(t.attributes)&&t.attributes.length>0,o=To();if(r)return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:768,padding:"12px 8px 8px",boxSizing:"border-box",margin:"0 auto"},children:[(0,l.jsx)("style",{children:la}),(0,l.jsx)(da,{products:n,attributes:t.attributes,isCompact:o})]});const i=o?"minmax(0, 230px)":"repeat(".concat(n.length,", minmax(0, 230px))");return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:768,padding:"16px 12px 8px",boxSizing:"border-box",margin:"0 auto"},children:[(0,l.jsx)("style",{children:la}),(0,l.jsx)("div",{style:{display:"grid",gridTemplateColumns:i,justifyContent:"center",gap:10,alignItems:"stretch"},children:n.map(e=>(0,l.jsx)(sa,{product:e},e.stacklineSku))})]})},"data-widget-cart":e=>{let{data:t}=e;const{item:n,qty:r,total:o,isSubscription:i}=t,{bag:a}=(0,na.T)();return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:400,background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,padding:"20px 20px 16px",boxSizing:"border-box",boxShadow:"0 2px 12px rgba(0,0,0,0.07)"},children:[(0,l.jsxs)("div",{style:{fontSize:12,fontWeight:700,letterSpacing:.5,textTransform:"uppercase",color:"var(--voice-widget-accent, #7DD3C0)",marginBottom:12},children:["Added to ",a]}),(0,l.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"flex-start"},children:[n.imageUrl&&(0,l.jsx)("img",{src:n.imageUrl,alt:n.title,style:{width:64,height:64,objectFit:"contain",borderRadius:8,background:"var(--voice-widget-img-bg, #F9FAFB)",flexShrink:0}}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:14,fontWeight:600,color:"var(--voice-widget-fg, #111827)",lineHeight:1.35,marginBottom:4},children:n.title}),(0,l.jsxs)("div",{style:{fontSize:13,color:"var(--voice-widget-muted, #6B7280)"},children:["Qty: ",r,i&&" · Subscribe & Save"]})]})]}),(0,l.jsx)("div",{style:{borderTop:"1px solid var(--voice-widget-border, #E5E7EB)",margin:"14px 0 12px"}}),(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:14},children:[(0,l.jsx)("span",{style:{fontSize:13,color:"var(--voice-widget-muted, #6B7280)"},children:"Total"}),(0,l.jsx)("span",{style:{fontSize:18,fontWeight:700,color:"var(--voice-widget-fg, #111827)"},children:o})]}),(0,l.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,l.jsx)("button",{type:"button",style:{flex:1,padding:"10px 12px",borderRadius:999,border:"none",background:"var(--voice-widget-accent, #7DD3C0)",color:"var(--voice-widget-accent-fg, #FFFFFF)",fontSize:13,fontWeight:700,cursor:"pointer"},children:"Checkout"}),(0,l.jsx)("button",{type:"button",style:{flex:1,padding:"10px 12px",borderRadius:999,border:"1.5px solid var(--voice-widget-border, #E5E7EB)",background:"transparent",color:"var(--voice-widget-fg, #111827)",fontSize:13,fontWeight:600,cursor:"pointer"},children:"Keep talking"})]})]})},"data-widget-order":e=>{let{data:t}=e;const{orderId:n,items:o,status:i,eta:a,trackingUrl:s,carrier:c}=t,d=function(e){const t=ea.findIndex(t=>t.key===e);return t>=0?t:-1}(i),u=ta[i],p=void 0!==u;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:480,maxHeight:"100%",background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,padding:"18px 18px 14px",boxSizing:"border-box",boxShadow:"0 2px 12px rgba(0,0,0,0.07)",overflowY:"auto"},children:[(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:14},children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:11,fontWeight:700,letterSpacing:.5,textTransform:"uppercase",color:"var(--voice-widget-muted, #6B7280)",marginBottom:2},children:"Order"}),(0,l.jsxs)("div",{style:{fontSize:15,fontWeight:700,color:"var(--voice-widget-fg, #111827)"},children:["#",n]})]}),!p&&(0,l.jsxs)("div",{style:{textAlign:"right"},children:[(0,l.jsx)("div",{style:{fontSize:11,color:"var(--voice-widget-muted, #6B7280)",marginBottom:2},children:"Arriving"}),(0,l.jsx)("div",{style:{fontSize:13,fontWeight:600,color:"var(--voice-widget-fg, #111827)"},children:a})]}),p&&u&&(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:u.color,background:u.bg,padding:"3px 10px",borderRadius:999},children:u.label})]}),!p&&(0,l.jsxs)("div",{style:{marginBottom:14},children:[(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",position:"relative"},children:ea.map((e,t)=>{const n=t<=d,o=t===d;return(0,l.jsxs)(r.Fragment,{children:[(0,l.jsx)("div",{style:{width:22,height:22,borderRadius:"50%",background:n?"var(--voice-widget-accent, #7DD3C0)":"var(--voice-widget-border, #E5E7EB)",border:o?"3px solid var(--voice-widget-accent, #7DD3C0)":"none",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,zIndex:1,boxSizing:"border-box",transition:"background 200ms ease-out"},children:n&&(0,l.jsx)("svg",{width:"11",height:"9",viewBox:"0 0 11 9",fill:"none",children:(0,l.jsx)("path",{d:"M1 4l3 3 6-6",stroke:"white",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})})}),t<ea.length-1&&(0,l.jsx)("div",{style:{flex:1,height:3,background:t<d?"var(--voice-widget-accent, #7DD3C0)":"var(--voice-widget-border, #E5E7EB)",transition:"background 200ms ease-out"}})]},e.key)})}),(0,l.jsx)("div",{style:{display:"flex",justifyContent:"space-between",marginTop:6},children:ea.map((e,t)=>(0,l.jsx)("div",{style:{fontSize:10,fontWeight:t===d?700:400,color:t<=d?"var(--voice-widget-accent-dark, #0D9488)":"var(--voice-widget-muted, #6B7280)",textAlign:"center",width:48,lineHeight:1.2},children:e.label},e.key))})]}),o.slice(0,2).map((e,t)=>(0,l.jsxs)("div",{style:{display:"flex",gap:10,alignItems:"center",marginBottom:8},children:[e.imageUrl&&(0,l.jsx)("img",{src:e.imageUrl,alt:e.title,style:{width:40,height:40,objectFit:"contain",borderRadius:6,background:"var(--voice-widget-img-bg, #F9FAFB)",flexShrink:0}}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:500,color:"var(--voice-widget-fg, #111827)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:e.title}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--voice-widget-muted, #6B7280)"},children:["Qty ",e.qty," · ",e.price]})]})]},t)),c&&(0,l.jsxs)("div",{style:{borderTop:"1px solid var(--voice-widget-border, #E5E7EB)",marginTop:8,paddingTop:10,display:"flex",alignItems:"center",gap:8},children:[(0,l.jsxs)("span",{style:{fontSize:12,color:"var(--voice-widget-muted, #6B7280)"},children:["Carrier: ",(0,l.jsx)("strong",{style:{color:"var(--voice-widget-fg, #111827)"},children:c})]}),s&&(0,l.jsx)("a",{href:s,target:"_blank",rel:"noopener noreferrer",style:{marginLeft:"auto",fontSize:12,fontWeight:600,color:"var(--voice-widget-accent-dark, #0D9488)",textDecoration:"none"},children:"Track â"})]})]})},"data-widget-order-detail":e=>{var t,n,r;let{data:o}=e;var i;const a=null!==(t=null==(i=o.summary)?void 0:i.currency)&&void 0!==t?t:"USD",s=null!==(n=Ni[o.status])&&void 0!==n?n:Ni.unknown,c=function(e){if(!e)return;const t=new Date(e);return Number.isNaN(t.getTime())?void 0:t.toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}(o.placedAt),d=!!o.shipping,u=!!o.payment;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:640,maxHeight:"100%",boxSizing:"border-box",background:zi,border:"1px solid ".concat(Wi),borderRadius:16,overflow:"hidden",boxShadow:"0 2px 16px rgba(0,0,0,0.06)",animation:"voice-order-detail-fade-in 0.28s ease-out both",display:"flex",flexDirection:"column"},children:[(0,l.jsx)("style",{children:"\n@keyframes voice-order-detail-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n"}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",justifyContent:"space-between",gap:12,padding:"20px 24px",borderBottom:"1px solid ".concat(Wi)},children:[(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",flexWrap:"wrap",gap:8,marginBottom:10},children:[(0,l.jsxs)("span",{style:{display:"inline-flex",alignItems:"center",gap:6,padding:"3px 10px",borderRadius:999,fontSize:11.5,fontWeight:500,letterSpacing:"0.02em",background:s.bg,color:s.fg},children:[(0,l.jsx)("span",{style:{width:6,height:6,borderRadius:"50%",background:s.dot,display:"inline-block"},"aria-hidden":!0}),s.label]}),(0,l.jsxs)("span",{style:{fontSize:11.5,color:Hi,fontVariantNumeric:"tabular-nums"},children:["#",o.orderId]})]}),o.headline&&(0,l.jsx)("div",{style:{fontSize:21,fontWeight:600,color:Ui,lineHeight:1.2,letterSpacing:"-0.01em"},children:o.headline}),o.subHeadline&&(0,l.jsx)("div",{style:{fontSize:13,color:Hi,marginTop:6,lineHeight:1.4},children:o.subHeadline}),(c||o.retailerName)&&(0,l.jsxs)("div",{style:{fontSize:13,color:Hi,marginTop:8},children:[c&&(0,l.jsxs)("span",{children:["Placed ",c]}),c&&o.retailerName&&(0,l.jsx)("span",{style:{margin:"0 6px",color:Wi},children:"·"}),o.retailerName&&(0,l.jsx)("span",{children:o.retailerName})]})]}),o.retailerOrderPageUrl&&(0,l.jsxs)("a",{href:o.retailerOrderPageUrl,target:"_blank",rel:"noopener noreferrer",style:{flexShrink:0,display:"inline-flex",alignItems:"center",gap:6,padding:"6px 12px",borderRadius:999,border:"1px solid ".concat(Wi),background:zi,color:Ui,fontSize:12,fontWeight:500,textDecoration:"none",whiteSpace:"nowrap"},children:["View on ",null!==(r=o.retailerName)&&void 0!==r?r:"retailer",(0,l.jsx)(Mi.A,{size:12,strokeWidth:2,"aria-hidden":!0})]})]}),(0,l.jsx)("div",{style:{maxHeight:320,overflowY:"auto"},children:o.items.map((e,t)=>(0,l.jsx)(Ji,{item:e,currency:a,isLast:t===o.items.length-1},t))}),(d||u)&&(0,l.jsxs)("div",{style:{display:"grid",gridTemplateColumns:d&&u?"1fr 1fr":"1fr",gap:1,background:Wi,borderTop:"1px solid ".concat(Wi)},children:[d&&o.shipping&&(0,l.jsx)(Xi,{shipping:o.shipping}),u&&o.payment&&(0,l.jsx)(_i,{payment:o.payment,currency:a})]}),(0,l.jsx)($i,{summary:o.summary,currency:a})]})},"data-widget-return":e=>{let{data:t}=e;const{orderId:n,steps:r,currentStepIndex:o}=t;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:400,background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,padding:"18px 18px 14px",boxSizing:"border-box",boxShadow:"0 2px 12px rgba(0,0,0,0.07)"},children:[(0,l.jsxs)("div",{style:{marginBottom:16},children:[(0,l.jsxs)("div",{style:{fontSize:11,fontWeight:700,letterSpacing:.5,textTransform:"uppercase",color:"var(--voice-widget-muted, #6B7280)",marginBottom:2},children:["Return â Order #",n]}),(0,l.jsxs)("div",{style:{fontSize:14,fontWeight:600,color:"var(--voice-widget-fg, #111827)"},children:["Step ",o+1," of ",r.length]})]}),(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:0},children:r.map((e,t)=>{const n=t<o,i=t===o,a=t>o;return(0,l.jsxs)("div",{style:{display:"flex",gap:12,position:"relative"},children:[(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",width:24,flexShrink:0},children:[(0,l.jsxs)("div",{style:{width:22,height:22,borderRadius:"50%",background:n||i?"var(--voice-widget-accent, #7DD3C0)":"var(--voice-widget-border, #E5E7EB)",border:i?"3px solid var(--voice-widget-accent, #7DD3C0)":"none",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,boxSizing:"border-box",zIndex:1},children:[n&&(0,l.jsx)("svg",{width:"11",height:"9",viewBox:"0 0 11 9",fill:"none",children:(0,l.jsx)("path",{d:"M1 4l3 3 6-6",stroke:"white",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})}),i&&(0,l.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"white"}})]}),t<r.length-1&&(0,l.jsx)("div",{style:{width:2,flex:1,minHeight:20,background:t<o?"var(--voice-widget-accent, #7DD3C0)":"var(--voice-widget-border, #E5E7EB)",margin:"2px 0"}})]}),(0,l.jsxs)("div",{style:{paddingBottom:t<r.length-1?16:0,flex:1,paddingTop:1},children:[(0,l.jsx)("div",{style:{fontSize:13,fontWeight:i?700:n?500:400,color:a?"var(--voice-widget-muted, #6B7280)":"var(--voice-widget-fg, #111827)",marginBottom:e.description&&i?3:0},children:e.label}),i&&e.description&&(0,l.jsx)("div",{style:{fontSize:12,color:"var(--voice-widget-muted, #6B7280)",lineHeight:1.4},children:e.description})]})]},t)})})]})},"data-widget-ticket":e=>{let{data:t}=e;const{ticketId:n,displayId:r,status:o,sla:i,priority:a,ticketUrl:s,message:c,nextSteps:d}=t;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:420,padding:"4px 0",boxSizing:"border-box"},children:["high"===a&&(0,l.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:5,fontSize:11,fontWeight:700,letterSpacing:.4,textTransform:"uppercase",color:"var(--voice-widget-warn, #DC2626)",background:"var(--voice-widget-warn-bg, #FEF2F2)",border:"1px solid var(--voice-widget-warn-border, #FECACA)",padding:"3px 10px",borderRadius:999,marginBottom:8},children:[(0,l.jsx)("span",{children:"â"})," High priority"]}),(0,l.jsxs)("div",{style:{fontSize:12,color:"var(--voice-widget-muted, #6B7280)",marginBottom:6},children:["Response within ",(0,l.jsx)("strong",{style:{color:"var(--voice-widget-fg, #111827)"},children:i})]}),(0,l.jsx)(Mr,{status:"success",message:null!=c?c:"",ticketId:n,displayId:r,ticketUrl:s,ticketState:o,nextSteps:d})]})},"data-widget-product-card":e=>{let{data:t,collapseKeyFeatures:n=!1}=e;const o=To(),i=t.retailerProductPageUrl,{mainSrc:a,thumbs:s,activeIndex:c,setActiveIndex:d}=function(e){var t;const n=(0,r.useMemo)(()=>{const t=[],n=new Set,r=e=>{e&&"string"==typeof e&&(n.has(e)||(n.add(e),t.push(e)))};r(e.imageUrl);for(const t of null!==(o=e.imageUrls)&&void 0!==o?o:[]){var o;r(t)}return t},[e.imageUrl,e.imageUrls]),[o,i]=(0,r.useState)(0);(0,r.useEffect)(()=>{i(0)},[n]);const a=Array.from({length:5},(e,t)=>n[t]);return{mainSrc:null!==(t=n[Math.min(o,Math.max(0,n.length-1))])&&void 0!==t?t:n[0],thumbs:a,activeIndex:o,setActiveIndex:i}}(t),u=(0,r.useMemo)(()=>{var e;return(null!==(e=t.featureBullets)&&void 0!==e?e:[]).map(e=>"string"==typeof e?e.trim():"").filter(e=>e.length>0).slice(0,8)},[t.featureBullets]),p=t.brand?(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:wi,textTransform:"uppercase",letterSpacing:"0.05em",marginBottom:8},children:t.brand}):null,g=(0,l.jsx)("h2",{style:{fontSize:o?18:20,fontWeight:600,lineHeight:1.3,color:wi,margin:"0 0 8px"},children:t.title}),f=(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,fontSize:13,color:"var(--voice-widget-muted, #6B7280)",marginBottom:20,paddingBottom:20,borderBottom:"1px solid ".concat(Si)},children:(0,l.jsx)(bi,{amazon
1Rating:t.amazonRating,amazonReviewCount:t.amazonReviewCount,size:14,countFontSize:13,format:"long"})}),h=(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,l.jsx)(Oi,{src:a,alt:t.title,height:o?240:320,padding:o?20:24}),(0,l.jsx)("div",{style:{display:"flex",gap:8},children:s.map((e,t)=>(0,l.jsx)(Ii,{src:e,index:t,active:t===c,onClick:e?()=>d(t):void 0},t))})]}),m=(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",flex:1},children:[p,g,(0,l.jsx)(Pi,{category:t.category,subcategory:t.subcategory,compact:o}),f,(0,l.jsx)(Vi,{bullets:u,collapseKeyFeatures:n},t.stacklineSku),(0,l.jsx)("div",{style:{marginTop:o?20:"auto",paddingTop:o?16:24,borderTop:o?"1px solid ".concat(Si):"none",display:"flex",alignItems:"center",justifyContent:"flex-start"},children:(0,l.jsx)(Fi,{price:t.price,href:i})})]});return(0,l.jsxs)("div",{style:{width:"100%",display:"flex",justifyContent:"center",boxSizing:"border-box"},children:[(0,l.jsx)("style",{children:"\n@keyframes voice-widget-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n"}),(0,l.jsxs)("article",{style:{width:"100%",maxWidth:o?420:1024,background:Ci,border:"1px solid ".concat(Ai),borderRadius:12,overflow:"hidden",display:"grid",gridTemplateColumns:o?"1fr":"1fr 1fr",minHeight:o?void 0:520,boxShadow:"0 2px 16px rgba(0,0,0,0.06)",animation:"voice-widget-fade-in 0.28s ease-out both",boxSizing:"border-box"},children:[(0,l.jsx)("div",{style:{padding:o?"20px 20px 0":32,background:Ci,borderRight:o?"none":"1px solid ".concat(Ai),borderBottom:o?"1px solid ".concat(Ai):"none"},children:h}),(0,l.jsx)("div",{style:{padding:o?20:32,display:"flex"},children:m})]})]})},"data-widget-carousels":e=>{let{data:t}=e;const n=t.sections.slice(0,4),r=To();return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:700,padding:"12px 12px 8px",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:14,overflowY:"auto",maxHeight:"100%"},children:[(0,l.jsx)("style",{children:"\n@keyframes voice-widget-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n"}),n.map(e=>(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:11,fontWeight:700,color:"var(--voice-widget-muted, #6B7280)",textTransform:"uppercase",letterSpacing:.8,marginBottom:8},children:e.title}),(0,l.jsx)("div",{style:{display:"grid",gridTemplateColumns:r?"repeat(2, minmax(0, 1fr))":"repeat(".concat(Math.min(e.products.length,4),", 1fr)"),gap:8},children:e.products.slice(0,r?6:4).map(e=>(0,l.jsx)(hi,{product:e},e.stacklineSku))})]},e.title))]})},"data-widget-review-insights":e=>{let{data:t}=e;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:768,maxHeight:"100%",padding:"16px 0 8px",boxSizing:"border-box",display:"flex",flexDirection:"column",gap:12,overflowY:"auto",fontFamily:"inherit"},children:[(0,l.jsx)("style",{children:"\n@keyframes voice-widget-fade-in {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n}\n"}),t.searches.map(e=>(0,l.jsx)(fi,{summary:e},e.name))]})},"data-widget-store-list":e=>{let{data:t}=e;const n=To();return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:768,boxSizing:"border-box",margin:"0 auto",background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid ".concat(Uo),borderRadius:10,overflow:"hidden",animation:"voice-store-list-fade-in 0.28s ease-out both",display:"flex",flexDirection:"column",maxHeight:"min(78vh, 620px)"},children:[(0,l.jsx)("style",{children:Mo}),(0,l.jsxs)("div",{style:{flexShrink:0,padding:"19px 24px 25px",borderBottom:"1px solid ".concat(Uo)},children:[(0,l.jsx)("div",{style:{fontSize:13,fontWeight:600,lineHeight:"24px",letterSpacing:"1px",textTransform:"uppercase",color:"var(--voice-widget-muted, rgba(0,0,0,0.5))"},children:"Nearby stores"}),(0,l.jsxs)("div",{style:{fontSize:18,fontWeight:600,lineHeight:"24px",letterSpacing:"0.08px",color:"var(--voice-widget-fg, #111827)",marginTop:8},children:["Showing stores near ",t.resolvedLocation.label]})]}),(0,l.jsx)("div",{className:"voice-store-list-scroll",style:{flex:1,minHeight:0,overflowY:"auto"},children:t.stores.map(e=>(0,l.jsx)(Ko,{store:e,isCompact:n},e.storeId))})]})},"data-widget-order-list":e=>{let{data:t}=e;const{orders:n,total:r}=t,o=r-n.length;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:480,maxHeight:"100%",background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1px solid var(--voice-widget-border, #E5E7EB)",borderRadius:16,overflowY:"auto",boxShadow:"0 2px 12px rgba(0,0,0,0.07)"},children:[(0,l.jsxs)("div",{style:{padding:"14px 18px 12px",borderBottom:"1px solid var(--voice-widget-border, #E5E7EB)"},children:[(0,l.jsx)("div",{style:{fontSize:11,fontWeight:700,letterSpacing:.5,textTransform:"uppercase",color:"var(--voice-widget-muted, #6B7280)"},children:"Recent Orders"}),(0,l.jsxs)("div",{style:{fontSize:13,fontWeight:600,color:"var(--voice-widget-fg, #111827)",marginTop:2},children:[r," order",1!==r?"s":""]})]}),(0,l.jsx)("div",{children:n.map((e,t)=>{var r,o,i,a,s;const c=null!==(r=Fo[e.status])&&void 0!==r?r:Fo.unknown;return(0,l.jsxs)("div",{style:{display:"flex",gap:12,alignItems:"center",padding:"10px 18px",borderBottom:t<n.length-1?"1px solid var(--voice-widget-border, #E5E7EB)":void 0},children:[(null==(a=e.leadItem)?void 0:a.imageUrl)?(0,l.jsx)("img",{src:e.leadItem.imageUrl,alt:e.leadItem.title,style:{width:40,height:40,objectFit:"contain",borderRadius:6,background:"var(--voice-widget-img-bg, #F9FAFB)",flexShrink:0}}):(0,l.jsx)("div",{style:{width:40,height:40,borderRadius:6,background:"var(--voice-widget-border, #E5E7EB)",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",fontSize:18,color:"var(--voice-widget-muted, #6B7280)"},children:"ð¦"}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--voice-widget-fg, #111827)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:null!==(o=null==(s=e.leadItem)?void 0:s.title)&&void 0!==o?o:"Order #".concat(null!==(i=e.retailerOrderId)&&void 0!==i?i:e.orderId)}),(0,l.jsxs)("div",{style:{fontSize:11,color:"var(--voice-widget-muted, #6B7280)",marginTop:1},children:[e.itemCount," item",1!==e.itemCount?"s":""," · ",Bo(e.orderDate),e.retailerName?" · ".concat(e.retailerName):""]})]}),(0,l.jsxs)("div",{style:{textAlign:"right",flexShrink:0},children:[(0,l.jsx)("div",{style:{fontSize:11,fontWeight:600,color:c.color,background:c.bg,padding:"2px 8px",borderRadius:999,display:"inline-block",marginBottom:3},children:c.label}),(0,l.jsx)("div",{style:{fontSize:12,fontWeight:700,color:"var(--voice-widget-fg, #111827)"},children:(d=e.totalAmount,"$".concat(d.toFixed(2)))})]})]},e.orderId);var d})}),o>0&&(0,l.jsxs)("div",{style:{padding:"8px 18px",fontSize:12,color:"var(--voice-widget-muted, #6B7280)",borderTop:"1px solid var(--voice-widget-border, #E5E7EB)",textAlign:"center"},children:["+",o," more order",1!==o?"s":""," â ask me to look up specific ones"]}
1)]})},"data-widget-confirm":e=>{var t;let{data:n}=e;const{kind:r,title:o,body:i,primaryLabel:a,secondaryLabel:s,lineItems:c,totalAmount:d}=n,{icon:u,accentColor:p,accentBg:g}=null!==(t=Vo[r])&&void 0!==t?t:Vo.cancel;return(0,l.jsxs)("div",{style:{width:"100%",maxWidth:420,background:"var(--voice-widget-card-bg, #FFFFFF)",border:"1.5px solid ".concat(p,"33"),borderRadius:16,padding:"18px 18px 16px",boxSizing:"border-box",boxShadow:"0 2px 12px rgba(0,0,0,0.07)"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",gap:10,marginBottom:10},children:[(0,l.jsx)("div",{style:{width:34,height:34,borderRadius:"50%",background:g,display:"flex",alignItems:"center",justifyContent:"center",fontSize:16,flexShrink:0},children:u}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontSize:14,fontWeight:700,color:"var(--voice-widget-fg, #111827)",lineHeight:1.3},children:o}),(0,l.jsx)("div",{style:{fontSize:12,color:"var(--voice-widget-muted, #6B7280)",marginTop:3,lineHeight:1.4},children:i})]})]}),c&&c.length>0&&(0,l.jsxs)("div",{style:{background:"var(--voice-widget-img-bg, #F9FAFB)",borderRadius:8,padding:"8px 12px",marginBottom:12},children:[c.map((e,t)=>(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:12,padding:"3px 0",borderBottom:t<c.length-1?"1px solid var(--voice-widget-border, #E5E7EB)":void 0},children:[(0,l.jsx)("span",{style:{color:"var(--voice-widget-muted, #6B7280)"},children:e.label}),(0,l.jsx)("span",{style:{fontWeight:600,color:"var(--voice-widget-fg, #111827)"},children:e.value})]},t)),d&&(0,l.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:13,fontWeight:700,paddingTop:6,marginTop:c.length>0?4:0,borderTop:c.length>0?"1px solid ".concat(p,"33"):void 0,color:p},children:[(0,l.jsx)("span",{children:"Total"}),(0,l.jsx)("span",{children:d})]})]}),(0,l.jsxs)("div",{style:{display:"flex",gap:8},children:[(0,l.jsx)("div",{style:{flex:1,padding:"8px 0",borderRadius:8,background:g,border:"1px solid ".concat(p,"44"),textAlign:"center",fontSize:12,fontWeight:700,color:p},children:a}),(0,l.jsx)("div",{style:{flex:1,padding:"8px 0",borderRadius:8,background:"var(--voice-widget-img-bg, #F9FAFB)",border:"1px solid var(--voice-widget-border, #E5E7EB)",textAlign:"center",fontSize:12,fontWeight:600,color:"var(--voice-widget-muted, #6B7280)"},children:s})]}),(0,l.jsx)("div",{style:{textAlign:"center",fontSize:11,color:"var(--voice-widget-muted, #6B7280)",marginTop:8},children:"Say your choice aloud"})]})},"data-widget-prompt-login":e=>{let{data:t,onLoginCompleted:n,onLoginFailed:o,readOnly:i=!1}=e;var a,s;const c=(0,Lt.AU)(),d=null==c?void 0:c.inlineSignIn,u=null==c?void 0:c.inlineVerifyOtp,p=null==c?void 0:c.requestSignIn,g="shopify_link"===t.loginMethod||(0,m.Fw)(),[f,h]=(0,r.useState)("otp"===t.stage?"otp":"phone"),[v,y]=(0,r.useState)(""),[x,b]=(0,r.useState)(""),[w,A]=(0,r.useState)(null),[C,j]=(0,r.useState)(null),[S,k]=(0,r.useState)(null),O=(0,r.useRef)(null),I=(0,r.useRef)(null),P=(0,r.useRef)({});(0,r.useEffect)(()=>{var e,t;"phone"===f&&(null==(e=O.current)||e.focus()),"otp"===f&&(null==(t=I.current)||t.focus())},[f]);const E=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!g||i)return;const e=e=>{E.current||e.key&&e.newValue&&e.key.includes("CognitoIdentityServiceProvider")&&e.key.endsWith(".idToken")&&(E.current=!0,null==n||n())};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[g,i,n]);const V=(0,r.useCallback)(async e=>{var t,n;if(!d)return void j("Sign-in unavailable right now.");j(null),k(null),h("submitting");const r=null!==(t=null==(n=(0,vr.lq)(e,{regionCode:"US"}).number)?void 0:n.e164)&&void 0!==t?t:e,o=await d(r);if("error"in o)return h("phone"),void j(o.error);A(o.session),h("otp")},[d]),F=(0,r.useCallback)(async e=>{if(!u)return j("Sign-in unavailable right now."),void(null==o||o("inline verify unavailable"));j(null),k(null),h("verifying");const t=await u(w,e);t.success?null==n||n():(h("otp"),j(t.error),null==o||o(t.error||"verification failed"))},[u,w,n,o]);if((0,r.useEffect)(()=>{var e;const n=null==(e=t.prefill)?void 0:e.phone;if(!n)return;const r=ho(n).slice(0,10);if(0===r.length)return;if(i)return void y(r);const o=!0===t.confirmed;if(P.current.phone!==r||P.current.phoneConfirmed!==o){if(y(r),o)return P.current.phone=r,P.current.phoneConfirmed=!0,void((e=>(0,vr.lq)(e,{regionCode:"US"}).valid)(r)?V(r):j("That doesn't look like a complete number â please correct it."));"phone"!==f&&(h("phone"),b(""),A(null),P.current.otp=void 0,P.current.otpConfirmed=void 0),P.current.phone=r,P.current.phoneConfirmed=!1,k({kind:"phone",value:r}),j(null)}},[null==(a=t.prefill)?void 0:a.phone,t.confirmed,f,V]),(0,r.useEffect)(()=>{var e;const n=null==(e=t.prefill)?void 0:e.otp;if(!n)return;const r=ho(n).slice(0,6);if(0===r.length)return;if(i)return void b(r);const o=!0===t.confirmed;if(P.current.otp!==r||P.current.otpConfirmed!==o){if(b(r),o)return P.current.otp=r,P.current.otpConfirmed=!0,void(6===r.length?F(r):j("Only got part of the code â please say the full six digits again."));P.current.otp=r,P.current.otpConfirmed=!1,k({kind:"otp",value:r}),j(null)}},[null==(s=t.prefill)?void 0:s.otp,t.confirmed,f,F]),(0,r.useEffect)(()=>{S&&"phone"===S.kind&&S.value!==v&&k(null)},[v,S]),(0,r.useEffect)(()=>{S&&"otp"===S.kind&&S.value!==x&&k(null)},[x,S]),g){const e=t.reason?"Sign in with your store account to ".concat(t.reason,"."):"Sign in with your store account to continue.";return(0,l.jsxs)("div",{style:wo,role:"dialog","aria-labelledby":"voice-login-title",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:i?0:12}
1,children:[(0,l.jsx)("div",{style:Ao,"aria-hidden":!0,children:bo}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{id:"voice-login-title",style:Co,children:"Sign in to continue"}),(0,l.jsx)("div",{style:jo,children:e})]})]}),!i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{type:"button",onClick:()=>null==p?void 0:p({newTab:!0}),style:Eo,children:"Sign in"}),(0,l.jsx)("div",{style:vo(vo({},jo),{},{marginTop:8,textAlign:"center"}),children:"Opens in a new tab â your call stays connected."})]})]})}if(!(i||d&&u))return(0,l.jsx)("div",{style:vo(vo({},wo),{},{color:"var(--voice-widget-warn, #DC2626)"}),children:"Sign-in is unavailable in this environment."});const B="phone"===f||"submitting"===f,L="submitting"===f||"verifying"===f,R=fo(v),T=B?t.reason?"Sign in to ".concat(t.reason,". Just say your phone number â I'll fill it in for you."):"Just say your phone number â I'll fill it in for you.":"We sent a 6-digit code to ".concat(R,". Say the digits aloud to continue.");return(0,l.jsxs)("div",{style:wo,role:"dialog","aria-labelledby":"voice-login-title",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:10},children:[(0,l.jsx)("div",{style:Ao,"aria-hidden":!0,children:B?xo:bo}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{id:"voice-login-title",style:Co,children:B?"Sign in to continue":"Confirm it's you"}),(0,l.jsx)("div",{style:jo,children:T})]})]}),(0,l.jsxs)("label",{style:So,children:[B?"Phone number":"Verification code",(0,l.jsx)("input",{type:B?"tel":"text",inputMode:"none",maxLength:B?14:6,ref:B?O:I,value:B?R:x,disabled:L,readOnly:!0,"aria-readonly":!0,tabIndex:-1,placeholder:B?"(555) 555-5555":"123456",style:ko})]}),!i&&S&&(0,l.jsx)("div",{style:Oo,children:(0,l.jsxs)("span",{children:["Heard you say"," ",(0,l.jsx)("strong",{style:{color:"var(--voice-widget-fg, #111827)"},children:"phone"===S.kind?fo(S.value):S.value}),". Say ",(0,l.jsx)("strong",{children:"yes"})," to ","phone"===S.kind?"send the code":"verify",", or correct it."]})}),!i&&C&&(0,l.jsx)("div",{style:Io,children:C}),!i&&L&&(0,l.jsx)("div",{style:Po,children:B?"Sending codeâ¦":"Verifyingâ¦"})]})}},ha=new Set(["data-widget-tool-running","data-widget-clear","data-widget-contact-card"]),ma=new Set(["data-widget-prompt-login"]),va=e=>{let{type:t,data:n,liveLoginCallbacks:r,collapseProductCardFeatures:o}=e;if(ha.has(t))return null;const i=fa[t],a={width:"100%",overflowX:"auto",marginTop:8,marginBottom:8,display:"flex",justifyContent:"center"},s=function(e,t){const n=oo(t);if(!n)return null;if("data-widget-product-card"===e){const e=n.stacklineSku;return"string"==typeof e&&e?{widgetId:"product-highlight",toolOutput:{stacklineSku:e}}:null}if("data-widget-comparison"===e){const e=n.products;if(!Array.isArray(e)||0===e.length)return null;const t=function(e){const t=[];for(const n of e){const e=ao(n);e&&t.push(e)}return t}(e);if(0===t.length)return null;const r=n.attributes;return Array.isArray(r)&&r.length>0?{widgetId:"compare-products",toolOutput:{products:t,comparisonAttributes:r}}:{widgetId:"product-carousels",toolOutput:{sections:[{title:"",products:t}]}}}return null}(t,n);if(s)return(0,l.jsx)("div",{style:{width:"100%",marginTop:8,marginBottom:8},children:(0,l.jsx)(Pr.H,{widgetId:s.widgetId,toolInput:s.toolInput,toolOutput:s.toolOutput,partState:"complete"})});if(!i)return(0,l.jsx)("div",{style:a,children:(0,l.jsxs)("div",{style:{fontSize:12,color:"rgba(0,0,0,0.5)",fontStyle:"italic",padding:"8px 12px",background:"rgba(0,0,0,0.04)",borderRadius:8},children:["Voice widget · ",t]})});const c={};return ma.has(t)&&("data-widget-prompt-login"===t&&r?(c.readOnly=!1,c.onLoginCompleted=r.onLoginCompleted,c.onLoginFailed=r.onLoginFailed):c.readOnly=!0),"data-widget-product-card"===t&&o&&(c.collapseKeyFeatures=!0),(0,l.jsx)("div",{style:a,children:(0,l.jsx)(go,{children:(0,l.jsx)(i,pa({data:n},c))})})};function ya(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function xa(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ya(Object(n),!0).forEach(function(t){ba(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ya(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ba(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function wa(e){var t;let{part:n,allParts:o,onProductClick:i,isStreaming:a,pdpStacklineSku:s,isOnChatWidget:c,apiBaseUrl:d}=e;var u,p,g,f,h,m,v,y,x,b;const[w,A]=(0,r.useState)(null),C=(0,r.useCallback)(()=>A(null),[]),j=Ct(),S=(0,r.useMemo)(()=>{const e=new Map;return o.forEach(t=>{if("source-url"===t.type){const n=t;e.set(String(n.sourceId),{url:n.url,title:n.title})}else if("data-source-url"===t.type){const n=t.data;(null==n?void 0:n.sourceId)&&e.set(String(n.sourceId),{url:n.url,title:n.title})}}),e},[o]);if("string"==typeof n.type&&n.type.startsWith("data-widget-")&&"data-widget-tool-running"!==n.type&&"data-widget-clear"!==n.type)return(0,l.jsx)(va,{type:n.type,data:n.data});if("string"==typeof n.type&&n.type.startsWith("tool-")&&function(e){if(!e||"object"!=typeof e)return!1;const t=e;return void 0!==t.narrator&&void 0!==t.durationMs}(n.output))return null;switch(n.type){case"file":if((null==(u=n.mediaType)?void 0:u.startsWith("image/"))&&n.url){const e=1===o.filter(e=>{var t;return"file"===e.type&&(null==(t=e.mediaType)?void 0:t.startsWith("image/"))}).length?j?250:256:j?96:128;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"tw:flex tw:justify-end tw:w-full tw:mb-2",children:(0,l.jsx)("div",{onClick:()=>A(n.url),style:{width:"".concat(e,"px"),height:"".concat(e,"px"),borderRadius:"12px",overflow:"hidden",backgroundColor:"#f9f9f9",cursor:"zoom-in"},children:(0,l.jsx)("img",{src:n.url,alt:n.filename||"Uploaded image",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",mixBlendMode:"multiply"}})})}),w&&(0,l.jsx)(Pn,{src:w,onClose:C})]})}return n.url?(0,l.jsx)("a",{href:n.url,target:"_blank",rel:"noopener noreferrer",className:"tw:text-sm tw:underline tw:text-blue-600",children:n.filename||"Attached file"}):null;case"text":return(0,l.jsx)(Qn,{text:n.text||"",sourcesMap:S});case"tool-analyze_query":case"tool-search_products":case"source-url":case"data-source-url":case"tool-request_live_agent":case"tool-end_live_agent":case"tool-delegate_to_support_agent":case"data-live-takeover-active":case"data-live-takeover-started":case"data-live-takeover-ended":case"data-takeover-team-changed":case"data-user-message-mirrored":case"data-user-message-delivery-failed":case"data-ticket-status-updated":case"tool-search_faq":case"tool-escalate_to_support":case"tool-ask_user_for_information":case"tool-query_knowledge_base":default:return null;case"tool-filter_results":return(0,l.jsx)(Yn,{part:n});case"tool-product_carousels":case"tool-organize_results":var k;return o.some(e=>"data-product-carousels"===e.type||"data-section"===e.type)||Zn(n.state)&&a?null:(0,l.jsx)(Pr.H,{widgetId:"product-carousels",toolOutput:null!==(k=n.output)&&void 0!==k?k:null,partState:n.state});case"data-product-carousels":case"data-section":return(0,l.jsx)(Pr.H,{widgetId:"product-carousels",dataParts:[{type:n.type,data:n.data}]});case"tool-get_surveys":return(0,l.jsx)(er,{part:n,allParts:o});case"tool-show_store_locator":{var O,I,P;const e=function(e){const t=[];if(e.forEach((e,n)=>{var r;if("tool-show_store_locator"!==e.type)return;const o=e;if(!qn(o.state))return;const i=o.output;if(!i||i.error||i.isOnlineOnly||!i.hasStores)return;const a=null!==(r=i.stacklineSkus)&&void 0!==r?r:[];a.length>0&&t.push({index:n,skus:a})}),t.length<=1)return null;const n=[...new Set(t.flatMap(e=>e.skus))];return{renderIndex:t[t.length-1].index,allSkus:n}}(o);if(e&&o.indexOf(n)!==e.renderIndex)return null;if(Zn(n.state)&&a)return null;const t=n.output;if(!t||t.error||t.isOnlineOnly)return null;const r=null!==(O=null!==(I=null==e?void 0:e.allSkus)&&void 0!==I?I:null==t?void 0:t.stackl
1ineSkus)&&void 0!==O?O:[];return t.hasStores&&0!==r.length?(0,l.jsx)(Pr.H,{widgetId:"store-locator",toolInput:null!==(P=n.input)&&void 0!==P?P:null,toolOutput:xa(xa({},t),{},{stacklineSkus:r}),partState:n.state}):null}case"tool-get_product_details":return(null==(p=n.input)?void 0:p.silent)?null:(0,l.jsx)(tr,{part:n,onProductClick:i,pdpStacklineSku:s});case"tool-compare_products":{var E;if(Zn(n.state)&&a)return null;const e=n.output;return!(null==(g=null==e?void 0:e.products)?void 0:g.length)||e.products.length<2?null:(0,l.jsx)(Pr.H,{widgetId:"compare-products",toolInput:null!==(E=n.input)&&void 0!==E?E:null,toolOutput:e,partState:n.state})}case"data-product-highlight":return(0,l.jsx)(Pr.H,{widgetId:"product-highlight",toolOutput:null!==(t=n.data)&&void 0!==t?t:null,dataParts:[{type:"data-product-highlight",data:n.data}]});case"data-pdp-product-info":return c&&(null==(f=n.data)?void 0:f.autoInjected)?null:(0,l.jsx)(mr,{part:n});case"data-prompt-login":return(0,l.jsx)(Ir,{reason:null==(h=n.data)?void 0:h.reason,loginMethod:null==(m=n.data)?void 0:m.loginMethod,isStreaming:a});case"tool-prompt_login":return o.some(e=>"data-prompt-login"===e.type)?null:(0,l.jsx)(Ir,{reason:null==(v=n.input)?void 0:v.reason,isStreaming:a});case"tool-show_order_history":{var V;if(Zn(n.state)&&a)return null;if(!qn(n.state)&&a)return null;const e=n.output;return(null==(y=null==e?void 0:e._metadata)?void 0:y.isAuthenticated)?(0,l.jsx)(Pr.H,{widgetId:"order-history",toolInput:null!==(V=n.input)&&void 0!==V?V:null,toolOutput:e,partState:n.state}):null}case"tool-route_to_support":return(0,l.jsx)(Nr,{output:n.output});case"tool-create_ticket":return(0,l.jsx)(zr,{output:n.output});case"tool-search_related_tickets":case"tool-lookup_tickets":return(0,l.jsx)(Wr,{output:n.output});case"tool-get_ticket_status":return(0,l.jsx)(qr,{output:n.output});case"data-human-reply":return(0,l.jsx)(to,{data:n.data});case"tool-search_review_insights":{if(Zn(n.state)&&a)return null;const e=null==(x=n.output)?void 0:x.widgetData;return(null==(b=null==e?void 0:e.searches)?void 0:b.length)?(0,l.jsx)(va,{type:"data-widget-review-insights",data:e}):null}case"tool-invocation":{const e=n.toolInvocation;if(!(null==e?void 0:e.toolName))return null;const t={type:"tool-".concat(e.toolName),state:e.state,toolCallId:e.toolCallId,toolName:e.toolName,input:e.args,output:e.result};return(0,l.jsx)(wa,{part:t,allParts:o,onProductClick:i,isStreaming:a,pdpStacklineSku:s,isOnChatWidget:c,apiBaseUrl:d})}}}function Aa(e){let{parts:t,onProductClick:n,isStreaming:o,pdpStacklineSku:i,isOnChatWidget:a,apiBaseUrl:s}=e;if(!t||0===t.length)return null;const c=(0,r.useMemo)(()=>function(e){const t=new Map;for(const n of e)"tool-result"===n.type&&t.set(n.toolCallId,n);const n=new Set,r=[];for(const o of e){const e=o;if("tool-call"===e.type){const o=t.get(e.toolCallId),i={type:"tool-".concat(e.toolName),toolCallId:e.toolCallId,state:o?"result":"call",input:e.args};o&&(i.output=o.result,n.add(e.toolCallId)),r.push(i)}else"tool-result"===e.type?n.has(e.toolCallId)||r.push({type:"tool-".concat(e.toolName),toolCallId:e.toolCallId,state:"result",output:e.result}):r.push(o)}return r}(t),[t]);return(0,l.jsx)(l.Fragment,{children:c.map((e,t)=>(0,l.jsx)(wa,{part:e,allParts:c,onProductClick:n,isStreaming:o,pdpStacklineSku:i,isOnChatWidget:a,apiBaseUrl:s},"".concat(e.type,"-").concat(t)))})}const Ca=e=>Number(null!=e&&"object"==typeof e&&"value"in e?e.value:e),ja=e=>{let{devInfo:t}=e;var n;const o=(0,r.useMemo)(()=>"true"===new URLSearchParams(window.location.search).get("isDev"),[]),[i,a]=(0,r.useState)(!1);if(!o)return null;const{devOptions:s,effectiveRankingWeights:c,brandIds:d,dtcRetailerIds:u,retailerIds:p,normalizedQuery:g,productDomain:f,brandHints:h,isFollowUp:m,priceConstraint:v,resolvedAngleStrategy:y}=t,x=s.rankingWeights,b=e=>{let{label:t,base:n,effective:r}=e;const o=Ca(n),i=Ca(r),a=i-o,s=Math.abs(a)>.001;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"12px"},children:[(0,l.jsx)("span",{style:{minWidth:"70px",color:"#666"},children:t}),(0,l.jsx)("span",{style:{minWidth:"38px",textAlign:"right",fontVariantNumeric:"tabular-nums",color:"#999"},children:o.toFixed(2)}),(0,l.jsx)("span",{style:{color:"#999",fontSize:"11px"},children:"â"}),(0,l.jsx)("span",{style:{minWidth:"38px",textAlign:"right",fontVariantNumeric:"tabular-nums",fontWeight:600,color:s?"#2563eb":"#444"},children:i.toFixed(2)}),s&&(0,l.jsxs)("span",{style:{fontSize:"11px",color:a>0?"#16a34a":"#dc2626",fontVariantNumeric:"tabular-nums"},children:["(",a>0?"+":"",a.toFixed(2),")"]})]})};return(0,l.jsxs)("div",{style:{border:"1px solid #e5e7eb",borderRadius:"8px",overflow:"hidden",marginBottom:"8px",background:"#fefce8"},children:[(0,l.jsxs)("button",{onClick:()=>a(e=>!e),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 12px",background:"transparent",border:"none",cursor:"pointer",fontSize:"12px",color:"#92400e",fontWeight:500},children:[(0,l.jsx)("span",{children:"Search Dev Info"}),(0,l.jsx)("span",{style:{fontSize:"11px"},children:i?"â²":"â¼"})]}),i&&(0,l.jsxs)("div",{style:{padding:"10px 12px",fontSize:"12px",color:"#555",display:"flex",flexDirection:"column",gap:"12px",borderTop:"1px solid #e5e7eb",background:"#fffef5"},children:[(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"center"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Recall:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.useTextRecall?"#2563eb":"#16a34a",backgroundColor:s.useTextRecall?"#eff6ff":"#f0fdf4",color:s.useTextRecall?"#2563eb":"#16a34a",fontSize:"11px",fontWeight:600},children:s.useTextRecall?"Text":"KNN"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Sections:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.useTargetedSectionTitles?"#2563eb":"#6b7280",backgroundColor:s.useTargetedSectionTitles?"#eff6ff":"#f3f4f6",color:s.useTargetedSectionTitles?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:s.useTargetedSectionTitles?"Targeted":"Legacy"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"KNN:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.useTwoPhaseFiltering?"#2563eb":"#6b7280",backgroundColor:s.useTwoPhaseFiltering?"#eff6ff":"#f3f4f6",color:s.useTwoPhaseFiltering?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:s.useTwoPhaseFiltering?"2-Phase":"PostFilter"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Outlier Filter:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.useOutlierFiltering?"#16a34a":"#dc2626",backgroundColor:s.useOutlierFiltering?"#f0fdf4":"#fef2f2",color:s.useOutlierFiltering?"#16a34a":"#dc2626",fontSize:"11px",fontWeight:600},children:s.useOutlierFiltering?"On":"Off"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Search Angles:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:"brand"===s.angleStrategy?"#2563eb":"auto"===s.angleStrategy?"#9333ea":"#6b7280",backgroundColor:"brand"===s.angleStrategy?"#eff6ff":"auto"===s.angleStrategy?"#faf5ff":"#f3f4f6",color:"brand"===s.angleStrategy?"#2563eb":"auto"===s.angleStrategy?"#9333ea":"#6b7280",fontSize:"11px",fontWeight:600},children:"brand"===s.angleStrategy?"Brand":"auto"===s.angleStrategy?"Auto":"Generic"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Rerank:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.useOriginalQueryReranking?"#16a34a":"#dc2626",backgroundColor:s.useOriginalQueryReranking?"#f0fdf4":"#fef2f2",color:s.useOriginalQueryReranking?"#16a34a":"#dc2626",fontSize:"11px",fontWeight:600},children:s.useOriginalQueryReranking?"On":"Off"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Ratings:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:s.ignoreRatings?"#dc2626":"#16a34a",backgroundColor:s.ignoreRatings?"#fef2f2":"#f0fdf4",color:s.ignoreRatings?"#dc2626":"#16a34a",fontSize:"11px",fontWeight:600},children:s.ignoreRatings?"Ignored":">=".concat(Ca(s.ratingThreshold).toFixed(1))})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Availability:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:"apply"===s.availabilityFilter?"#16a34a":"skipFalse"===s.availabilityFilter?"#d97706":"#dc2626",backgroundColor:"apply"===s.availabilityFilter?"#f0fdf4":"skipFalse"===s.availabilityFilter?"#fffbeb":"#fef2f2",color:"apply"===s.availabilityFilter?"#16a34a":"skipFalse"===s.availabilityFilter?"#d97706":"#dc2626",fontSize:"11px",fontWeight:600},children:"apply"===s.availabilityFilter?"Required":"skipFalse"===s.availabilityFilter?"Skip False":"Skip All"})]})]}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"center"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"LLM:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333",fontSize:"11px"},children:s.llmModel}),(0,l.jsx)("span",{style:{color:"#999",fontSize:"11px"},children:"/"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#666",fontSize:"11px"},children:s.llmModelLight}),s.recatModel?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{style:{color:"#999",fontSize:"11px"},children:"/"}),(0,l.jsxs)("span",{style:{fontWeight:600,color:"#b45309",fontSize:"11px"},children:["recat:",s.recatModel]})]}):null]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Angles:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.numSearchAngles)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Categories:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.targetCategories)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Max/brand:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.maxPerBrand)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Max LLM:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.maxProductsForLLM)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Page:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.pageSize)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Per sec:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.productsPerSection)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Buffer:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.productsBuffer)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Temp:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.searchTemperature).toFixed(1)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Semantic:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333"},children:Ca(s.semanticThreshold).toFixed(2)})]})]}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"2px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Ranking weights"}),(0,l.jsx)("span",{style:{fontSize:"11px",color:"#999"},children:"(base â effective)"})]}),(0,l.jsx)(b,{label:"semantic",base:x.semanticWeight,effective:c.semanticWeight}
1),(0,l.jsx)(b,{label:"sales",base:x.salesWeight,effective:c.salesWeight}),(0,l.jsx)(b,{label:"content",base:x.contentWeight,effective:c.contentWeight}),(0,l.jsx)(b,{label:"review",base:x.reviewWeight,effective:c.reviewWeight}),(0,l.jsx)(b,{label:"reward",base:x.rewardWeight,effective:c.rewardWeight}),(0,l.jsx)(b,{label:"price",base:x.priceWeight,effective:c.priceWeight})]}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"6px",borderTop:"1px solid #e5e7eb",paddingTop:"10px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Search Debug"}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"center"},children:[null!=m&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Follow-up:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:m?"#2563eb":"#6b7280",backgroundColor:m?"#eff6ff":"#f3f4f6",color:m?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:m?"Yes":"No"})]}),"auto"===s.angleStrategy&&y&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"LLM chose:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:"brand"===y?"#2563eb":"#6b7280",backgroundColor:"brand"===y?"#eff6ff":"#f3f4f6",color:"brand"===y?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:"brand"===y?"Brand":"Generic"})]}),f&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Domain:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333",fontSize:"11px"},children:f})]}),g&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Normalized:"}),(0,l.jsxs)("span",{style:{fontWeight:600,color:"#333",fontSize:"11px",fontStyle:"italic"},children:['"',g,'"']})]}),v&&(null!=v.min||null!=v.max)&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Price:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#b45309",fontSize:"11px"},children:null!=v.min&&null!=v.max?"$".concat(v.min," â $").concat(v.max):null!=v.min?">= $".concat(v.min):"<= $".concat(v.max)})]})]}),h&&(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"center"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Brand Specific:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:h.isBrandSpecific?"#2563eb":"#6b7280",backgroundColor:h.isBrandSpecific?"#eff6ff":"#f3f4f6",color:h.isBrandSpecific?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:h.isBrandSpecific?"Yes":"No"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Brand Wide:"}),(0,l.jsx)("span",{style:{padding:"2px 8px",borderRadius:"4px",border:"1px solid",borderColor:h.isBrandWide?"#2563eb":"#6b7280",backgroundColor:h.isBrandWide?"#eff6ff":"#f3f4f6",color:h.isBrandWide?"#2563eb":"#6b7280",fontSize:"11px",fontWeight:600},children:h.isBrandWide?"Yes":"No"})]}),(null==(n=h.brandNames)?void 0:n.length)>0&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Brands:"}),(0,l.jsx)("span",{style:{fontWeight:600,color:"#333",fontSize:"11px"},children:h.brandNames.join(", ")})]})]}),(0,l.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:"16px",alignItems:"center"},children:[d&&d.length>0&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Brand IDs:"}),(0,l.jsxs)("span",{style:{fontWeight:600,color:"#7c3aed",fontSize:"11px",fontFamily:"monospace"},children:["[",d.join(", "),"]"]})]}),u&&u.length>0&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"DTC Retailer IDs:"}),(0,l.jsxs)("span",{style:{fontWeight:600,color:"#0891b2",fontSize:"11px",fontFamily:"monospace"},children:["[",u.join(", "),"]"]})]}),p&&p.length>0&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[(0,l.jsx)("span",{style:{color:"#666",fontWeight:500},children:"Retailer IDs (used):"}),(0,l.jsxs)("span",{style:{fontWeight:600,color:"#0891b2",fontSize:"11px",fontFamily:"monospace"},children:["[",p.join(", "),"]"]})]}),(!d||0===d.length)&&(!p||0===p.length)&&(0,l.jsx)("span",{style:{fontSize:"11px",color:"#999",fontStyle:"italic"},children:"No brand/retailer filters applied"})]})]})]})]})};var Sa=n(27203),ka=n(64527),Oa=n(5797),Ia=n(66430),Pa=n(24221),Ea=n(45398),Va=n(1420);const Fa=e=>{let{status:t}=e;const n={DELIVERED:{icon:Oa.A,label:"Delivered",bgColor:"#dcfce7",textColor:"#166534",iconColor:"#16a34a"},CANCELLED:{icon:Ia.A,label:"Cancelled",bgColor:"#fee2e2",textColor:"#991b1b",iconColor:"#dc2626"},IN_TRANSIT:{icon:Ti.A,label:"In Transit",bgColor:"#dbeafe",textColor:"#1e40af",iconColor:"#2563eb"},PROCESSING:{icon:Pa.A,label:"Processing",bgColor:"#fef3c7",textColor:"#92400e",iconColor:"#d97706"},UNKNOWN:{icon:Pa.A,label:"Pending",bgColor:"#f3f4f6",textColor:"#374151",iconColor:"#6b7280"}}[t],r=n.icon;return(0,l.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",backgroundColor:n.bgColor,color:n.textColor,fontSize:"12px",fontWeight:500},children:[(0,l.jsx)(r,{size:14,color:n.iconColor}),n.label]})},Ba=e=>{let{orderType:t}=e;if(!t)return null;const n="ONLINE"===t,r=n?Bi.A:Ea.A;return(0,l.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:"4px",padding:"4px 10px",borderRadius:"9999px",backgroundColor:"#f3f4f6",color:"#374151",fontSize:"12px",fontWeight:500},children:[(0,l.jsx)(r,{size:14,color:"#6b7280"}),n?"Online":"In-Store"]})},La=e=>{var t;let{order:n}=e;const{orderId:r,orderDate:o,retailerId:i,retailerDisplayName:a,retailerName:s,shipmentStatus:c,orderType:d,products:u}=n,p=new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}),g=u.reduce((e,t)=>
1e+t.retailPrice*t.quantity,0),f=u.reduce((e,t)=>e+t.quantity,0),h=null!==(t=n.retailerShortLogo)&&void 0!==t?t:(0,xr.d2)(i,"retailer"),m=a||s;return(0,l.jsxs)("div",{style:{border:"1px solid #e5e7eb",borderRadius:"12px",backgroundColor:"#ffffff",overflow:"hidden",transition:"box-shadow 0.2s ease"},className:"tw:hover:shadow-md",children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",backgroundColor:"#f9fafb",borderBottom:"1px solid #e5e7eb"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[(0,l.jsx)("img",{src:h,alt:m,style:{width:"36px",height:"36px",borderRadius:"8px",objectFit:"contain",backgroundColor:"#fff",border:"1px solid #e5e7eb"}}),(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{style:{fontWeight:600,fontSize:"14px",color:"#111827"},children:m}),(0,l.jsx)("div",{style:{fontSize:"12px",color:"#6b7280"},children:p})]})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)(Ba,{orderType:d}),(0,l.jsx)(Fa,{status:c})]})]}),(0,l.jsx)("div",{style:{padding:"12px 16px"},children:(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"12px"},children:[u.slice(0,3).map((e,t)=>(0,l.jsxs)("div",{style:{display:"flex",gap:"12px"},children:[(0,l.jsx)("div",{style:{width:"64px",height:"64px",borderRadius:"8px",backgroundColor:"#f9fafb",border:"1px solid #e5e7eb",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,overflow:"hidden"},children:e.imageUrl?(0,l.jsx)(ka.A,{src:e.imageUrl,fallbackImage:e.imageUrl.replace("media.brandclub.com","media-api.brandclub.com"),alt:e.title||"Product",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}}):(0,l.jsx)(Va.A,{size:24,color:"#9ca3af"})}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[(0,l.jsx)("div",{style:{fontSize:"14px",fontWeight:500,color:"#111827",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflow:"hidden",lineHeight:"1.4"},children:e.title||"Product"}),e.brandName&&(0,l.jsx)("div",{style:{fontSize:"12px",color:"#6b7280",marginTop:"2px"},children:e.brandName}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"},children:[(0,l.jsx)("span",{style:{fontSize:"14px",fontWeight:600,color:"#111827"},children:(0,Sa.up)(e.retailPrice)}),e.quantity>1&&(0,l.jsxs)("span",{style:{fontSize:"12px",color:"#6b7280"},children:["x",e.quantity]})]})]})]},"".concat(e.retailerSku,"-").concat(t))),u.length>3&&(0,l.jsxs)("div",{style:{fontSize:"13px",color:"#6b7280",textAlign:"center",padding:"8px",backgroundColor:"#f9fafb",borderRadius:"6px"},children:["+",u.length-3," more item",u.length-3>1?"s":""]})]})}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",backgroundColor:"#f9fafb",borderTop:"1px solid #e5e7eb"},children:[(0,l.jsxs)("div",{style:{fontSize:"13px",color:"#6b7280"},children:[f," item",1!==f?"s":""]}),(0,l.jsxs)("div",{style:{fontSize:"16px",fontWeight:600,color:"#111827"},children:["Total: ",(0,Sa.up)(g)]})]})]})},Ra=e=>{let{orders:t}=e;return t&&0!==t.length?(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:"12px",marginTop:"16px"},children:t.map((e,t)=>(0,l.jsx)(La,{order:e},"".concat(e.orderId,"-").concat(e.retailerId,"-").concat(t)))}):null};function Ta(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ma(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ta(Object(n),!0).forEach(function(t){Da(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ta(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Da(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Na=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",children:(0,l.jsx)("path",{d:"M3.502 16.666v-3.333c0-.367.298-.665.665-.665H7.5l.134.014a.665.665 0 0 1 0 1.303l-.134.013H5.475A6.12 6.12 0 0 0 10 16.001c3.06 0 5.586-2.29 5.955-5.25l.03-.131a.665.665 0 0 1 1.29.295l-.05.337A7.33 7.33 0 0 1 10 17.332a7.46 7.46 0 0 1-5.168-2.085v1.42a.665.665 0 0 1-1.33 0m.543-7.417a.665.665 0 0 1-1.32-.165zM10 2.67c1.994 0 3.837.797 5.178 2.093V3.333a.665.665 0 0 1 1.33 0v3.333a.665.665 0 0 1-.665.665H12.51a.665.665 0 0 1 0-1.33h2.015A6.12 6.12 0 0 0 10 3.998 6.003 6.003 0 0 0 4.045 9.25l-.66-.083-.66-.082A7.333 7.333 0 0 1 10 2.668",fill:"
1currentColor"})}),za=r.forwardRef((e,t)=>{var n;let{role:o,content:i,bottomRef:a,isTyping:s=!1,isStreaming:c=!1,isLastMessage:u=!1,messageIndex:g,conversationId:h,feedback:m,followUpQueries:v=[],nextUserMessage:y,orders:x,devInfo:b,onSearch:w,onUpdateFeedback:A,onVariantSelect:C,onSuggestionClick:j,apiBaseUrl:S,isSharedView:k,uiMessageParts:O,transientStatus:I,pdpStacklineSku:P,isOnChatWidget:E,brandLogoUrl:V,followUpsLoading:F,onRetry:B,onOpenShareDialog:L,viewMode:R,liveTakeoverActive:T,isLastUserMessage:M,isActivelyStreaming:D,latestUserDeliveryFromEvents:N}=e;const z="user"===o,W=Array.isArray(O)&&O.length>0,U=i.length>0||W&&null!==(n=null==O?void 0:O.some(e=>"text"!==e.type||e.text))&&void 0!==n&&n,H=!s&&c&&!!I&&0===i.length,[Q,Z]=(0,r.useState)("like"===(null==m?void 0:m.type)),[q,Y]=(0,r.useState)("dislike"===(null==m?void 0:m.type)),[K,G]=(0,r.useState)(!1),[J,X]=(0,r.useState)(null),_=(0,r.useCallback)(()=>X(null),[]),$=Ct(),[ee,te]=(0,r.useState)(void 0),ne=(0,r.useMemo)(()=>{if(y&&v.length)return v.find(e=>e===y)},[y,v])||ee,re=(0,r.useRef)(null),[oe,ie]=(0,r.useState)(!1),ae=(0,r.useRef)(null),[le,se]=(0,r.useState)(void 0),ce=(0,r.useRef)(null),[de,ue]=(0,r.useState)(!1),pe=(0,r.useMemo)(()=>Array.isArray(O)&&O.some(e=>!["text","source-url","data-source-url","data-follow-ups","tool-call","tool-result","tool-search_products","tool-analyze_query"].includes(e.type)),[O]);(0,r.useLayoutEffect)(()=>{if(!z||!re.current)return;const e=re.current,t=e.firstChild;if(t&&t.nodeType===Node.TEXT_NODE){const t=document.createRange();t.selectNodeContents(e);const n=t.getClientRects();ie(n.length>1)}else{const t=window.getComputedStyle(e),n=parseFloat(t.lineHeight)||1.5*parseFloat(t.fontSize);ie(e.scrollHeight>1.5*n)}},[z,i]),(0,r.useLayoutEffect)(()=>{if(z||s||pe)return void se(void 0);const e=ae.current;if(!e)return void se(void 0);const t=e.getBoundingClientRect().left,n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT);let r,o=0;for(;r=n.nextNode();){const e=document.createRange();e.selectNodeContents(r);const t=e.getClientRects();for(let e=0;e<t.length;e++)o=Math.max(o,t[e].right)}if(o>0){const n=o-t,r=window.getComputedStyle(e),i=parseFloat(r.paddingLeft)||0,a=parseFloat(r.paddingRight)||0,l=Math.ceil(n)+i+a+2;l<e.offsetWidth-8?se(l):se(void 0)}else se(void 0)},[z,s,i,W,pe]),(0,r.useLayoutEffect)(()=>{var e,t;if(z||s||c||pe)return void ue(!1);const n=ae.current;if(!n)return;const r=(null!==(e=null==(t=n.textContent)?void 0:t.trim().length)&&void 0!==e?e:0)>0||null!==n.querySelector('img, svg, canvas, video, iframe, [class*="phc-"], [class*="concierge-product"], [class*="concierge-section"]');ue(!r)},[z,s,c,i,W,O,pe]);const ge=async()=>{try{await navigator.clipboard.writeText(i),G(!0),setTimeout(()=>G(!1),1500)}catch(e){p.oR.error("Failed to copy message")}},fe=()=>{h?null==L||L(h,g):console.warn("Cannot share: missing conversationId")},he=async()=>{var e;if(!h||void 0===g)return;const t=!Q;Z(t),Y(!1);try{const n=await(0,f.fk)(),r=await Rn({conversationId:h,messageIndex:g,feedbackType:t?"like":null,headersToInject:n,apiBaseUrl:S});A&&(null==(e=r.message.metadata)?void 0:e.feedback)&&A(g,r.message.metadata.feedback)}catch(e){console.error("Failed to update feedback:",e),Z(!t)}},me=async()=>{var e;if(!h||void 0===g)return;const t=!q;Y(t),Z(!1);try{const n=await(0,f.fk)(),r=await Rn({conversationId:h,messageIndex:g,feedbackType:t?"dislike":null,headersToInject:n,apiBaseUrl:S});A&&(null==(e=r.message.metadata)?void 0:e.feedback)&&A(g,r.message.metadata.feedback)}catch(e){console.error("Failed to update feedback:",e),Y(!t)}},ve=e=>{switch(e){case"right":return"flex-end";case"center":return"center";default:return"flex-start"}},ye=(0,r.useMemo)(()=>{if(!z||!T)return;const e=null!=O?O:[];return e.some(e=>"data-user-message-mirrored"===e.type)?"delivered":e.some(e=>"data-user-message-delivery-failed"===e.type)?"failed":"delivered"===N?"delivered":"failed"===N?"failed":M&&D?"pending":void 0},[z,T,O,M,D,N]),xe=(0,r.useCallback)(()=>{w&&i&&w(i)},[w,i]),be=eo(),we=()=>{if(!ye)return null;const e="tw:mt-1 tw:flex tw:items-center tw:justify-end tw:gap-1.5 tw:text-xs tw:leading-tight";return"delivered"===ye?(0,l.jsxs)("div",{className:e,style:{color:"var(--bc-support-text)"},role:"status","aria-label":"Message delivered to ".concat(be.teamLabel.toLowerCase()),children:[(0,l.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:(0,l.jsx)("path",{d:"M3 8.5l3 3 7-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,l.jsx)("span",{children:be.deliveredCopy})]}):"failed"===ye?(0,l.jsxs)("div",{className:"".concat(e," tw:text-red-600"),role:"status","aria-label":"Message failed to deliver to supp
1ort team",children:[(0,l.jsx)("span",{"aria-hidden":"true",children:"â"}),(0,l.jsx)("span",{children:"Failed to deliver"}),w&&i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{"aria-hidden":"true",className:"tw:text-gray-400",children:"·"}),(0,l.jsx)("button",{type:"button",onClick:xe,className:"tw:cursor-pointer tw:font-semibold tw:text-red-700 tw:underline tw:underline-offset-2 hover:tw:text-red-800",children:"Retry"})]})]}):(0,l.jsx)("div",{className:"".concat(e," tw:text-gray-500"),role:"status","aria-label":"Delivering message",children:(0,l.jsx)("span",{children:"Deliveringâ¦"})})};return s||U||H?(0,l.jsxs)("div",{ref:ce,className:"message ".concat(o),style:{display:de?"none":"flex",flexDirection:"column",width:"100%",marginBottom:pe?16:void 0},children:[!z&&b&&(0,l.jsx)(ja,{devInfo:b}),!z&&s&&(0,l.jsx)(d.wr,{widgetId:"chain-of-thought",displayName:"Chain of Thought",children:(e,t)=>(0,l.jsxs)("div",{style:{padding:"".concat(e.thinkingPaddingY,"px ").concat(e.thinkingPaddingX,"px")},children:[(0,l.jsx)("style",{children:"@keyframes cc-pulse{0%,100%{transform:scale(1)}50%{transform:scale(0.5)}}"}),(0,l.jsx)("span",{style:{display:"inline-block",width:12,height:12,backgroundColor:t(e.thinkingTextColor),borderRadius:"50%",animation:"cc-pulse 1s ease-in-out infinite"}})]})}),!z&&H&&(0,l.jsx)(d.wr,{widgetId:"chain-of-thought",displayName:"Chain of Thought",children:(e,t)=>e.thinkingEnabled?(0,l.jsx)("div",{style:{maxWidth:"100%"},children:(0,l.jsx)("div",{className:"message-content",style:{maxWidth:"100%",backgroundColor:"none",color:t(e.thinkingTextColor),borderRadius:"".concat(e.thinkingBorderRadius,"px"),borderBottomLeftRadius:"".concat(e.thinkingBorderRadiusBottomLeft,"px"),borderBottomRightRadius:"".concat(e.thinkingBorderRadius,"px"),wordWrap:"break-word",padding:"".concat(e.thinkingPaddingY,"px ").concat(e.thinkingPaddingX,"px")},children:(0,l.jsx)(un,{as:"p",style:{fontSize:"".concat(e.thinkingTextFontSize,"px"),fontFamily:"inherit"},duration:e.shimmerDuration,color:t(e.thinkingTextColor),highlightColor:t(e.shimmerColor),children:I&&"thinking"!==I?I:e.thinkingText})})}):null}),z&&W&&(()=>{const e=O.filter(e=>{var t;return"file"===e.type&&(null==(t=e.mediaType)?void 0:t.startsWith("image/"))});return 0===e.length?null:(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",flexWrap:"wrap",gap:"0.5rem",width:"100%",marginBottom:"0.5rem"},children:e.map((t,n)=>{const r=1===e.length?$?250:256:$?96:128;return(0,l.jsx)("div",{onClick:()=>X(t.url),style:{width:"".concat(r,"px"),height:"".concat(r,"px"),borderRadius:"12px",overflow:"hidden",backgroundColor:"#f9f9f9",cursor:"zoom-in"},children:(0,l.jsx)("img",{src:t.url,alt:t.filename||"Uploaded image",style:{width:"100%",height:"100%",objectFit:"cover",display:"block",mixBlendMode:"multiply"}})},n)})})})(),!s&&(z?(0,l.jsx)(d.Yi,{widgetId:"concierge-user-message",displayName:"User Message Bubble",initialState:{bgColor:(0,d.vT)(pn.A.blueWhite),textColor:(0,d.hm)("textPrimary"),maxWidth:"90%",alignment:"right"},children:(e,t)=>{const n=oe?e.borderRadius:e.borderRadiusShort,r=e.fontFamilyCss&&"inherit"!==e.fontFamilyCss?e.fontFamilyCss:"var(--concierge-user-message-font-family, inherit)";return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:ve(e.alignment),width:"100%"},children:(0,l.jsxs)("div",{style:{maxWidth:e.maxWidth},children:[(0,l.jsx)("div",{className:"message-content user-message",style:Ma({maxWidth:"100%",minWidth:"50px",backgroundColor:t(e.bgColor),color:t(e.textColor),borderRadius:"".concat(n,"px"),wordWrap:"break-word",padding:"".concat(e.paddingY,"px ").concat(e.paddingX,"px"),fontSize:"".concat($?14:e.fontSize,"px"),fontWeight:e.fontWeight,fontFamily:r,lineHeight:e.lineHeight},!oe&&e.singleLineHeight>0?{minHeight:e.singleLineHeight,display:"flex",alignItems:"center",boxSizing:"border-box"}:{}),children:(0,l.jsx)("div",{ref:re,style:{whiteSpace:"pre-wrap",minWidth:0,overflowWrap:"anywhere"},children:i})}),we()]})})}}):(0,l.jsx)(d.Yi,{widgetId:"concierge-assistant-message",displayName:"Assistant Message Bubble",initialState:{bgColor:(0,d.hm)("background"),textColor:(0,d.hm)("textPrimary"),maxWidth:"100%",paddingX:0,paddingY:0,alignment:"left"},children:(e,t)=>(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:ve(e.alignment),width:"100%"},children:(0,l.jsxs)("div",{style:{maxWidth:e.maxWidth,width:pe?"100%":null!=le?le:void 0,color:t(e.textColor)},children:[(0,l.jsxs)("div",{ref:ae,className:"message-content",style:{maxWidth:"100%",minWidth:"50px",backgroundColor:t(e.bgColor),color:t(e.textColor),borderRadius:"".concat(e.borderRadius,"px"),wordWrap:"break-word",padding:"".concat(e.paddingY,"px ").concat(e.paddingX,"px"),fontSize:"".concat(e.fontSize,"px"),fontWeight:e.fontWeight,lineHeight:e.lineHeight},children:[W?(0,l.jsx)(Aa,{parts:O,onProductClick:C,isStreaming:c,pdpStacklineSku:P,isOnChatWidget:E,apiBaseUrl:S}):(0,l.jsx)("div",{className:"message-markdown",style:{display:"flex",flexDirection:"column"},dangerouslySetInnerHTML:{__html:Hn.xI.parse(i)}}),x&&x.length>0&&(0,l.jsx)(Ra,{orders:x})]}),a&&(0,l.jsx)("div",{style:{height:"1px",width:"100%"},ref:a}),"read-only"!==R&&!s&&!c&&i.length>0?(0,l.jsxs)(nn,{className:"tw:mt-2",children:[(0,l.jsx)(on,{label:"Copy",tooltip:K?"Response copied!":"Copy response",tooltipOpen:K||void 0,onClick:ge,children:(0,l.jsx)(mn,{width:20,height:20})}),(0,l.jsx)(on,{label:"Like",tooltip:Q?"Thanks for your feedback!":"Good response",onClick:he,className:Q?"tw:bg-[#DCDDDC]":"",children:(0,l.jsx)(In,{width:20,height:20,className:Q?"tw:fill-current":""})}),(0,l.jsx)(on,{label:"Dislike",tooltip:q?"Thanks for your feedback!":"Bad response",onClick:me,className:q?"tw:bg-[#DCDDDC]":"",children:(0,l.jsx)(jn,{width:20,height:20,className:q?"tw:fill-current":""})}),!k&&!E&&(0,l.jsx)(on,{label:"Share",tooltip:"Share",onClick:fe,children:(0,l.jsx)(bn,{width:20,height:20})}),u&&!k&&B&&(0,l.jsx)(on,{label:"Retry",tooltip:"Try again",onClick:()=>B(),children:(0,l.jsx)(Na,{})})]}):null,F&&(0,l.jsx)("div",{style:{padding:"4px 0 8px",color:"var(--color-text-secondary, #9ca3af)",fontSize:"13px",letterSpacing:"0.1em"},children:"..."}),!s&&!c&&v.length>0&&!(y&&!ne)&&(0,l.jsx)(d.Dw,{widgetId:"concierge-follow-up-queries",displayName:"Follow-up Suggestions",children:(e,t)=>{const n=!u||!!ne,r=e=>!e||e.startsWith("#")||e.startsWith("rgb")?e:"#".concat(e),o=r(t(e.pillBgColor)),i=r(t(e.pillTextColor)),a=r(t(e.pillBorderColor)),s=i,c=o,d=i,p=r(t(e.pillBgColorSelected)),g=r(t(e.pillTextColorSelected)),f=r(t(e.pillBorderColorSelected));return(0,l.jsxs)("div",{className:"fuq-wrap",style:{display:"flex",flexWrap:"wrap",marginTop:16,gap:"".concat(e.containerGap,"px"),width:"100%"},children:[(0,l.jsx)("style",{children:"\n .fuq-wrap .fuq-pill {\n background-color: ".concat(o,";\n color: ").concat(i,";\n border-color: ").concat(a,";\n transition: all 0.2s ease;\n }\n .fuq-wrap .fuq-pill:not(:disabled):not(.fuq-selected):hover {\n background-color: ").concat(s,";\n color: ").concat(c,";\n border-color: ").concat(d,";\n }\n .fuq-wrap .fuq-pill.fuq-selected {\n background-color: ").concat(p,";\n color: ").concat(g,";\n border-color: ").concat(f,";\n }\n ")}),v.map((t,r)=>{const o=ne===t;return(0,l.jsx)("button",{className:"fuq-pill".concat(o?" fuq-selected":""),onClick:()=>(e=>{u&&!ne&&(te(e),null==w||w(e))})(t),disabled:n&&!o,style:{padding:"".concat(e.pillPaddingY,"px ").concat(e.pillPaddingX,"px"),borderRadius:"".concat(e.pillBorderRadius,"px"),borderWidth:e.pillBorderWidth,borderStyle:"solid",fontSize:"".concat(e.pillFontSize,"px"),fontWeight:e.pillFontWeight,lineHeight:"22px",textAlign:"left",cursor:o?"default":n?"not-allowed":"pointer",opacity:!o&&n?.5:1},children:t},r)})]})}})]})})})),J&&(0,l.jsx)(Pn,{src:J,onClose:_})]}):null});function Wa(e){return(null==e?void 0:e.length)?"".concat(e.length,":").concat(e.map(e=>{var t,n,r,o,i;return"text"===e.type?"text|".concat(null!==(t=null==(o=e.text)?void 0:o.length)&&void 0!==t?t:0):"data-product-carou
1sels"===e.type||"data-section"===e.type?"ds|".concat(null!==(n=null==(i=e.data)?void 0:i.title)&&void 0!==n?n:""):"".concat(e.type,"|").concat(null!==(r=e.state)&&void 0!==r?r:"")}).join(",")):""}const Ua=r.memo(za,(e,t)=>{var n,r;return e.role===t.role&&e.content===t.content&&e.isTyping===t.isTyping&&e.bottomRef===t.bottomRef&&e.isStreaming===t.isStreaming&&e.isLastMessage===t.isLastMessage&&(null==(n=e.followUpQueries)?void 0:n.length)===(null==(r=t.followUpQueries)?void 0:r.length)&&e.nextUserMessage===t.nextUserMessage&&e.orders===t.orders&&e.onSearch===t.onSearch&&e.onVariantSelect===t.onVariantSelect&&e.onSuggestionClick===t.onSuggestionClick&&e.liveTakeoverActive===t.liveTakeoverActive&&e.isLastUserMessage===t.isLastUserMessage&&e.isActivelyStreaming===t.isActivelyStreaming&&e.latestUserDeliveryFromEvents===t.latestUserDeliveryFromEvents&&Wa(e.uiMessageParts)===Wa(t.uiMessageParts)}),Ha=e=>"string"==typeof e&&e.startsWith("voice-"),Qa=e=>e?e instanceof Date?e.toISOString():e:"",Za=e=>{if(!e)return NaN;if(e instanceof Date)return e.getTime();const t=Date.parse(e);return Number.isNaN(t)?NaN:t};function qa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ya(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?qa(Object(n),!0).forEach(function(t){Ka(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qa(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ka(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ga=e=>"id"in e&&"parts"in e&&Array.isArray(e.parts);function Ja(e){return e?e.filter(e=>"text"===e.type&&"text"in e).map(e=>e.text).join(""):""}const Xa=e=>{let{text:t}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"4px 0",margin:"8px 0"},children:[(0,l.jsx)("div",{style:{flex:1,height:"1px",backgroundColor:"rgba(0,0,0,0.12)"}}),(0,l.jsx)("span",{style:{fontSize:"13px",color:"rgba(0,0,0,0.4)",whiteSpace:"nowrap"},children:t}),(0,l.jsx)("div",{style:{flex:1,height:"1px",backgroundColor:"rgba(0,0,0,0.12)"}})]})},_a=(0,r.memo)(e=>{let{conversationId:t,messages:n,showTypingIndicator:o,streamingAIResponse:i,isActivelyStreaming:a,transientStatus:s,streamingDevInfo:c,followUpQuestions:u=[],latestFollowUps:p=[],isLoadingFollowUps:g=!1,bottomRef:f,onSearch:h,onUpdateFeedback:m,onVariantSelect:v,onSuggestionClick:y,apiBaseUrl:x,isSharedView:b,sharedByUserName:w,sourceConversationId:A,sourceCheckpointIndex:C,isPendingAssistantResponse:j,isPollingTimedOut:S,onRetry:k,onRetryLastMessage:O,streamErrorMessage:I,onStreamErrorRetry:P,liveTakeoverActive:E,latestUserDelivery:V,pdpStacklineSku:F,isOnChatWidget:B,brandLogoUrl:L,onOpenShareDialog:R,viewMode:T}=e;const M=(0,r.useRef)(null),D=(0,r.useRef)(null),{themeColors:N}=(0,d.FG)(),z=(0,r.useMemo)(()=>[...n,...o?[{role:"assistant",content:"",timestamp:new Date,isTyping:!0}]:[],...!j||S||o||E?[]:[{role:"assistant",content:"",timestamp:new Date,isTyping:!0}],...i?[{role:"assistant",content:i,timestamp:new Date,isStreaming:a}]:[]],[n,o,i,a,j,S,E]),W=(0,r.useRef)(!1);(0,r.useEffect)(()=>{a&&(W.current=!0)},[a]),(0,r.useEffect)(()=>{W.current=!1},[t]),(0,r.useEffect)(()=>{const e=M.current;if(!e||0===z.length||E)return void(D.current&&(D.current.style.minHeight="",D.current.style.marginBottom="",D.current=null));const t=e.closest('[role="log"]');if(!t)return;const n=()=>{const n=e.querySelectorAll(".message.user, .message.assistant"),r=n[n.length-1];if(!r)return;const o=e.querySelectorAll(".message.user"),i=o[o.length-1];if(W.current){const e=t.clientHeight,n=i?i.offsetHeight:0;r.style.marginBottom="50px",r.style.minHeight=e-n-104+"px"}else r.style.minHeight="",r.style.marginBottom="50px";D.current&&D.current!==r&&(D.current.style.minHeight="",D.current.style.marginBottom=""),D.current=r};n();const r=new MutationObserver(n);r.observe(e,{childList:!0});const o=new ResizeObserver(n);return o.observe(t),()=>{r.disconnect(),o.disconnect(),D.current&&(D.current.style.minHeight="",D.current.style.marginBottom="",D.current=null)}},[z.length,S,E]);const U=(e=>{let{viewMode:t,isSharedView:n,sharedByUserName:r,sourceConversationId:o}=e;return"read-only"===t?null:n?r?"Shared with you by ".concat(r):"Shared with you":o?"Your copy of a shared conversation":null}
1)({viewMode:T,isSharedView:b,sharedByUserName:w,sourceConversationId:A}),H=(0,r.useMemo)(()=>{for(let e=z.length-1;e>=0;e--)if("user"===z[e].role)return e;return-1},[z]),Q=(0,r.useMemo)(()=>{const e=function(e){var t,n,r;const o=[];let i=0,a=0;for(;i<e.length;){const l=e[i];if(!Ha(l.id)){o.push({kind:"message",message:l,segmentKey:null}),i+=1;continue}const s=i;let c=i;for(;c<e.length&&Ha(e[c].id);)c+=1;const d="voice-segment-".concat(a++),u=e.slice(s,c),p=Za(null==(t=u[0])?void 0:t.createdAt),g=Za(null==(n=u[u.length-1])?void 0:n.createdAt),f=Number.isFinite(p)&&Number.isFinite(g)&&g>=p?Math.max(0,Math.round((g-p)/1e3)):0,h=u.filter(e=>"user"===e.role).length,m=Qa(null==(r=u[0])?void 0:r.createdAt);o.push({kind:"voice-segment-header",segmentKey:d,durationSec:f,turnCount:h,tWallStartIso:m,messageCount:u.length});for(const e of u)o.push({kind:"message",message:e,segmentKey:d});i=c}return o}(z);let t=-1;return e.map(e=>"voice-segment-header"===e.kind?e:Ya(Ya({},e),{},{displayIndex:++t}))},[z]),[Z,q]=(0,r.useState)(()=>new Set);return(0,r.useEffect)(()=>{q(new Set)},[t]),(0,r.useCallback)(e=>{q(t=>{const n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),(0,l.jsxs)("div",{ref:M,style:{width:"100%",maxWidth:"768px",display:"flex",flexDirection:"column",gap:"24px"},children:[U&&(0,l.jsx)(Xa,{text:U}),Q.map(e=>{if("voice-segment-header"===e.kind)return null;const d=e.message,u=e.displayIndex;if(e.segmentKey&&Z.has(e.segmentKey))return null;const w=!!i,j=u===n.length+(o?1:0)+(w?1:0)-1,S="isTyping"in d&&d.isTyping,k="isStreaming"in d&&d.isStreaming,I=a&&!k&&Ga(d)&&"assistant"===d.role&&u===n.length-1,P=k||I,M=S?"typing-indicator":Ga(d)&&d.id?"msg-".concat(d.id):"message-".concat(u),D=Ja(d.parts),N=d.parts,z=j&&"assistant"===d.role?p:Ga(d)?d.parts.filter(e=>"data-follow-ups"===e.type).flatMap(e=>{var t,n;return null!==(t=null==(n=e.data)?void 0:n.questions)&&void 0!==t?t:[]}):[],W=!S&&!P&&"assistant"===d.role&&z.length>0,U=j&&!S&&!P&&"assistant"===d.role&&g&&0===p.length,Q=A&&void 0!==C&&!S&&!P&&u===C+1;return(0,l.jsxs)(r.Fragment,{children:[Q&&(0,l.jsx)(Xa,{text:"Your messages below â only visible to you"}),(0,l.jsx)(Ua,{bottomRef:j?f:void 0,role:d.role,content:D,isTyping:S,isStreaming:P,isLastMessage:j,conversationId:t||void 0,messageIndex:"messageIndex"in d?d.messageIndex:S||P?void 0:u,feedback:"feedback"in d?d.feedback:void 0,followUpQueries:W?z:[],nextUserMessage:(()=>{const e=n[u+1];if(!(u>=n.length-1||"user"!==(null==e?void 0:e.role)))return Ja(e.parts)})(),orders:"orders"in d?d.orders:void 0,devInfo:P&&c?c:"devInfo"in d?d.devInfo:void 0,onSearch:h,onUpdateFeedback:m,onVariantSelect:v,onSuggestionClick:y,apiBaseUrl:x,isSharedView:b,uiMessageParts:N,transientStatus:P?s:void 0,pdpStacklineSku:F,isOnChatWidget:B,brandLogoUrl:L,onRetry:j&&"assistant"===d.role&&!e.segmentKey?O:void 0,onOpenShareDialog:R,followUpsLoading:U,viewMode:T,liveTakeoverActive:E,isLastUserMessage:"user"===d.role&&u===H,isActivelyStreaming:a,latestUserDeliveryFromEvents:"user"===d.role&&u===H?V:void 0})]},M)}),S&&k&&!E&&(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"12px",padding:"24px 16px"},children:[(0,l.jsx)("p",{style:{fontSize:"14px",color:"rgba(0,0,0,0.5)",textAlign:"center",margin:0},children:"Response generation timed out. Please try again."}),(0,l.jsx)("button",{type:"button",onClick:k,style:{padding:"8px 24px",borderRadius:"20px",border:"1px solid rgba(0,0,0,0.2)",backgroundColor:"transparent",cursor:"pointer",fontSize:"14px",color:"rgba(0,0,0,0.7)"},children:"Retry"})]}),I&&!E&&(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",gap:"12px",padding:"8px 0"},children:[(0,l.jsx)("p",{style:{fontSize:"14px",color:N.textPrimary||"rgba(0,0,0,0.7)",textAlign:"left",margin:0},children:I}),P&&(0,l.jsx)("button",{type:"button",onClick:P,style:{padding:"8px 24px",borderRadius:"20px",border:"none",backgroundColor:N.primary||"#181d56",color:N.buttonText||"#ffffff",cursor:"pointer",fontSize:"14px",fontWeight:600},children:"Try again"})]})]})}),$a={position:"absolute",width:1,height:1,margin:-1,padding:0,border:0,overflow:"hidden",clipPath:"inset(50%)",whiteSpace:"nowrap"},el=e=>{let{isActivelyStreaming:t,scopeRef:n}=e;const[o,i]=(0,r.useState)(""),a=(0,r.useRef)(!1);return(0,r.useEffect)(()=>
1{if(t)return void(a.current=!0);if(!a.current)return;a.current=!1;const e=requestAnimationFrame(()=>{var e,t;const r=null==(e=n.current)?void 0:e.querySelectorAll(".message.assistant"),o=null==r?void 0:r[r.length-1],a=null==(t=null==o?void 0:o.innerText)?void 0:t.trim();a&&i(a)});return()=>cancelAnimationFrame(e)},[t,n]),(0,l.jsx)("div",{"aria-live":"polite","aria-atomic":"true",style:$a,children:o})};var tl=n(10345),nl=n(41151),rl=n(73686),ol=n(4878);function il(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function al(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?il(Object(n),!0).forEach(function(t){ll(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):il(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ll(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const sl="conversations",cl={all:[sl],list:e=>[sl,e]},dl=30;var ul=n(94813);function pl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function gl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?pl(Object(n),!0).forEach(function(t){fl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):pl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function fl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const hl=e=>{let{open:t,title:n,message:r,confirmText:o="Confirm",cancelText:i="Cancel",confirmDisabled:a=!1,onConfirm:s,onCancel:c,backgroundColor:d="#ffffff",primaryColor:u="#0d2340",primaryForegroundColor:p="#ffffff",fontFamily:g}=e;const f=(0,ul.A)(e=>e.breakpoints.down("md")),h=(0,l.jsx)("button",{type:"button",onClick:c,style:{padding:"0 24px",border:"1px solid ".concat(u),borderRadius:100,backgroundColor:d,color:u,cursor:"pointer",fontSize:f?15:14,fontWeight:600,lineHeight:"22px",height:f?48:40,width:f?"100%":void 0,boxSizing:"border-box",fontFamily:"inherit"},children:i}),m=(0,l.jsx)("button",{type:"button",onClick:s,disabled:a,style:{padding:"0 24px",border:"1px solid ".concat(u),borderRadius:100,backgroundColor:u,color:p,cursor:a?"not-allowed":"pointer",fontSize:f?15:14,fontWeight:600,lineHeight:"22px",height:f?48:40,width:f?"100%":void 0,boxSizing:"border-box",opacity:a?.7:1,fontFamily:"inherit"},children:o});return(0,l.jsx)(br.R,{open:t,onClose:c,disableScrollLock:!0,sx:e=>({zIndex:1e4,"& .bc_dialog_close_button":{display:"none"},"& div.MuiDialog-paper":{margin:"0 20px",width:"100%",maxWidth:584,minHeight:172,backgroundColor:d,paddingTop:0,borderRadius:"10px",[e.breakpoints.down("md")]:{maxWidth:"100%",width:"100%",height:"auto",margin:0,paddingTop:"12px",borderTopLeftRadius:16,borderTopRightRadius:16,borderBottomLeftRadius:0,borderBottomRightRadius:0}}}),children:(0,l.jsxs)("div",{style:gl({padding:f?40:"24px 15px 16px 24px",backgroundColor:d},g?{fontFamily:g}:{}),children:[(0,l.jsx)("p",{style:{margin:0,color:u,fontSize:f?24:16,fontWeight:f?600:500,lineHeight:f?"25px":"24px",textAlign:f?"center":"left"},children:n}),(0,l.jsx)("div",{style:{marginTop:f?16:8,color:u,fontSize:16,fontWeight:500,lineHeight:f?1.5:"24px",textAlign:f?"center":"left"},children:r}),(0,l.jsx)("div",{style:f?{display:"flex",flexDirection:"column",gap:12,marginTop:16}:{display:"flex",justifyContent:"flex-end",gap:8,marginTop:36},children:f?(0,l.jsxs)(l.Fragment,{children:[m,h]}):(0,l.jsxs)(l.Fragment,{children:[h,m]})})]})})};function ml(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function vl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ml(Object(n),!0).forEach(function(t){yl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ml(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function yl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const xl=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",children:(0,l.jsx)("path",{d:"M7.1478e-07 9.99805V9.83203C7.1478e-07 9.46476 0.29777 9.16699 0.66504 9.16699C1.03231 9.16699 1.33008 9.46476 1.33008 9.83203V9.99805C1.33008 10.7089 1.33099 11.2025 1.36231 11.5859C1.39299 11.9615 1.44982 12.1731 1.53027 12.3311L1.60059 12.458C1.7769 12.7454 2.02992 12.9799 2.33203 13.1338L2.46191 13.1895C2.60569 13.2409 2.7952 13.2787 3.07715 13.3018C3.46067 13.3331 3.954 13.333 4.66504 13.333H9.99805C10.7089 13.333 11.2025 13.3331 11.5859 13.3018C11.9613 13.2711 12.1731 13.2142 12.3311 13.1338L12.458 13.0625C12.7454 12.8862 12.9799 12.6331 13.1338 12.3311L13.1895 12.2012C13.2409 12.0574 13.2787 11.8677 13.3018 11.5859C13.3331 11.2025 13.333 10.7089 13.333 9.99805V9.83203C13.333 9.46487 13.6309 9.16717 13.998 9.16699C14.3653 9.16699 14.6631 9.46476 14.6631 9.83203V9.99805C14.6631 10.6871 14.6637 11.2441 14.627 11.6943C14.5942 12.0953 14.5292 12.4565 14.3848 12.793L14.3184 12.9355C14.0529 13.4565 13.649 13.8922 13.1533 14.1963L12.9355 14.3184C12.5588 14.5103 12.1523 14.5895 11.6943 14.627C11.2441 14.6637 10.6871 14.6631 9.99805 14.6631H4.66504C3.97595 14.6631 3.41899 14.6637 2.96875 14.627C2.56821 14.5942 2.20731 14.5299 1.87109 14.3857L1.72852 14.3184C1.2074 14.0528 0.770898 13.6491 0.466798 13.1533L0.344727 12.9355C0.152758 12.5588 0.073554 12.1523 0.0361335 11.6943C-0.000636417 11.2441 7.1478e-07 10.687 7.1478e-07 9.99805ZM6.66699 9.83203V2.27051L4.46875 4.46875C4.20911 4.72839 3.78803 4.72829 3.52832 4.46875C3.26862 4.20905 3.26862 3.78802 3.52832 3.52832L6.86133 0.194336L6.96289 0.111328C7.07128 0.0391338 7.19987 9.45271e-09 7.33203 0C7.50813 8.62398e-05 7.67715 0.0699043 7.80176 0.194336L11.1357 3.52832C11.3951 3.78799 11.3952 4.20915 11.1357 4.46875C10.876 4.72845 10.454 4.72845 10.1943 4.46875L7.99707 2.27148V9.83203C7.9969 10.199 7.69904 10.4969 7.33203 10.4971C6.96487 10.4971 6.66717 10.1992 6.66699 9.83203Z",fill:"currentColor"})}),bl=()=>(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,l.jsx)("path",{d:"M14.5416 1.1557L14.046 0.66012C13.2991 -0.0867392 12.0776 -0.0867392 11.3308 0.66012L4.13441 7.87045C3.93199 8.07287 3.80635 8.33811 3.77843 8.62429L3.58997 10.6694C3.56903 10.9277 3.65977 11.179 3.84125 11.3674C4.00877 11.5349 4.22515 11.6257 4.45549 11.6257H4.53227L6.57741 11.4372C6.86359 11.4093 7.12883 11.2837 7.33125 11.0812L14.5346 3.8779C14.8976 3.51494 15.1 3.03332 15.1 2.52378C15.1 2.01424 14.8976 1.52564 14.5346 1.16966L14.5416 1.1557ZM6.59835 10.3344C6.59835 10.3344 6.52855 10.3832 6.49365 10.3832L4.65791 10.5508L4.82543 8.71503C4.82543 8.67315 4.84637 8.63825 4.87429 8.60335L10.7235 2.75412L12.4476 4.47817L6.59835 10.3274V10.3344ZM13.8017 3.13104L13.1875 3.74528L11.4634 2.02122L12.0776 1.40698C12.2452 1.23946 12.4685 1.14872 12.6919 1.14872C12.9152 1.14872 13.1386 1.23248 13.3061 1.40698L13.8017 1.90256C13.9692 2.07008 14.06 2.28646 14.06 2.5168C14.06 2.74714 13.9692 2.9705 13.8017 3.13104ZM13.711 8.43583V12.4912C13.711 13.9361 12.5383 15.1087 11.0935 15.1087H2.71747C1.27261 15.1087 0.0999756 13.9361 0.0999756 12.4912V4.11522C0.0999756 2.67036 1.27261 1.49772 2.71747 1.49772H6.77285C7.05903 1.49772 7.29635 1.73504 7.29635 2.02122C7.29635 2.3074 7.05903 2.54472 6.77285 2.54472H2.71747C1.85195 2.54472 1.14697 3.2497 1.14697 4.11522V12.4912C1.14697 13.3567 1.85195 14.0617 2.71747 14.0617H11.0935C11.959 14.0617 12.664 13.3567 12.664 12.4912V8.43583C12.664 8.14965 12.9013 7.91233 13.1875 7.91233C13.4736 7.91233 13.711 8.14965 13.711 8.43583Z",fill:"currentColor",stroke:"currentColor",strokeWidth:"0.2"})}),wl=()=>(0,l.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"5 4 14 16",fill:"none",children:[(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.39474 9.11443C7.71533 9.12219 7.96889 9.3867 7.96108 9.70524L7.38061 9.69119L6.80013 9.67713C6.80794 9.3586 7.07416 9.10668 7.39474 9.11443ZM7.38061 9.69119C6.80013 9.67714 6.80013 9.67713 6.80013 9.67713L6.79936 9.70993L6.79726 9.80316C6.7955 9.88421 6.79306 10.0018 6.79035 10.1485C6.78493 10.4418 6.77844 10.8518 6.7741 11.3183C6.76546 12.2486 6.76533 13.4138 6.80038 14.3285C6.83872 15.329 6.94195 16.6241 7.02712 17.5884C7.12331 18.6775 8.04392 19.4989 9.13533 19.4989H14.8548C15.9462 19.4989 16.8669 18.6775 16.9631 17.5884C17.0482 16.6241 17.1515 15.329 17.1898 14.3285C17.2248 13.4138 17.2247 12.2486 17.2161 11.3183C17.2117 10.8518 17.2053 10.4418 17.1999 10.1485C17.1971 10.0018 17.1947 9.88421 17.1929 9.80316L17.1909 9.70993L17.19 9.67774C17.1822 9.35921 16.916 9.10668 16.5954 9.11443C16.2748 9.12219 16.0213 9.3867 16.0291 9.70524L16.399 9.69628C16.0291 9.70524 16.0291 9.70524 16.0291 9.70524L16.0299 9.73653L16.0319 9.82812C16.0336 9.90803 16.
10361 10.0244 16.0387 10.1697C16.0441 10.4603 16.0506 10.8666 16.0548 11.3289C16.0635 12.2559 16.0633 13.3985 16.0293 14.2847C15.9922 15.2548 15.8912 16.5257 15.8062 17.4875C15.7635 17.972 15.3531 18.345 14.8548 18.345H9.13533C8.63703 18.345 8.22675 17.972 8.18396 17.4875C8.09901 16.5257 7.99801 15.2548 7.96083 14.2847C7.92687 13.3985 7.92673 12.2559 7.93534 11.3289C7.93964 10.8666 7.94608 10.4603 7.95145 10.1697C7.95413 10.0244 7.95655 9.90803 7.95829 9.82812L7.96033 9.73653L7.96108 9.70524L7.38061 9.69119Z",fill:"currentColor"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.995 7.38344C5.995 7.06482 6.25496 6.80652 6.57564 6.80652H17.4143C17.735 6.80652 17.995 7.06482 17.995 7.38344C17.995 7.70207 17.735 7.96037 17.4143 7.96037H6.57564C6.25496 7.96037 5.995 7.70207 5.995 7.38344Z",fill:"currentColor"}),(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M9.18745 5.61881C9.55746 4.92948 10.2797 4.4989 11.066 4.4989H12.9241C13.7104 4.4989 14.4326 4.92948 14.8027 5.61881L15.6041 7.11202C15.7551 7.39317 15.648 7.74263 15.3651 7.89257C15.0821 8.04251 14.7304 7.93615 14.5795 7.65501L13.7779 6.16179C13.6098 5.84847 13.2814 5.65275 12.9241 5.65275H11.066C10.7086 5.65275 10.3803 5.84847 10.2121 6.16179L9.4106 7.65501C9.25969 7.93615 8.90797 8.04251 8.62502 7.89257C8.34207 7.74263 8.23502 7.39317 8.38593 7.11202L9.18745 5.61881Z",fill:"currentColor"})]});function Al(e){let{onShare:t,onRename:n,onDelete:r,defaultColor:o}=e;return[{label:"Share",icon:(0,l.jsx)(xl,{}),color:o,action:t},{label:"Rename",icon:(0,l.jsx)(bl,{}),color:o,action:n},{label:"Delete",icon:(0,l.jsx)(wl,{}),color:"#dc2626",action:r}]}const Cl=(0,r.forwardRef)((e,t)=>{let{items:n,fontFamily:r,style:o,className:i}=e;return(0,l.jsx)("div",{ref:t,className:i,style:vl(vl({backgroundColor:"#ffffff",borderRadius:5,boxShadow:"0 4px 12px rgba(0,0,0,0.08)",padding:"4px",border:"1px solid rgba(0,0,0,0.08)",minWidth:140},r&&"inherit"!==r?{fontFamily:r}:{}),o),children:n.map(e=>(0,l.jsxs)("button",{type:"button",onClick:t=>{t.stopPropagation(),e.action()},style:{display:"flex",alignItems:"center",gap:8,width:"100%",padding:"4px 8px",border:"none",borderRadius:6,cursor:"pointer",backgroundColor:"transparent",textAlign:"left",fontSize:14,fontWeight:500,fontFamily:"inherit",color:e.color,lineHeight:"24px",whiteSpace:"nowrap",transition:"background-color 0.15s ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="rgba(0,0,0,0.05)"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},children:[e.icon,e.label]},e.label))})});function jl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Sl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?jl(Object(n),!0).forEach(function(t){kl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):jl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function kl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}Cl.displayName="ConversationActionMenu";const Ol={normal:400,medium:500,semibold:600,bold:700},Il=e=>{var t;let{icon:n,label:o,onClick:i,isExpanded:a,ariaLabel:s,state:c,resolveColor:d}=e;const[u,p]=(0,r.useState)(!1);return(0,l.jsxs)("div",{className:"tw:relative",children:[(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),null==i||i()},"aria-label":s,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),className:"tw:flex tw:items-center tw:h-10 tw:rounded-lg tw:transition-colors tw:cursor-pointer hover:tw:bg-black/5 tw:w-full tw:px-3 tw:gap-2",children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:shrink-0 tw:size-6",children:n}),a&&(0,l.jsx)("span",{className:"tw:font-medium tw:whitespace-nowrap tw:overflow-hidden",style:{color:d(c.labelColor),fontSize:c.labelFontSize,fontWeight:null!==(t=Ol[c.labelFontWeight])&&void 0!==t?t:500,lineHeight:"24px"},children:o})]}),!a&&u&&(0,l.jsx)("div",{className:"tw:absolute tw:left-[53px] tw:top-1/2 tw:-translate-y-1/2 tw:px-2 tw:h-8 tw:flex tw:items-center tw:z-50 tw:whitespace-nowrap",style:{backgroundColor:d(c.tooltipBgColor),color:d(c.tooltipTextColor),fontSize:c.tooltipFontSize,fontWeight:600,lineHeight:"18px",borderRadius:c.tooltipBorderRadius},children:o})]})},Pl=e=>{let{state:t,icons:n,resolveColor:o,isExpanded:i,brandLogoUrl:a,onToggle:s,onClick:c,sidebarHovered:d,justCollapsedRef:u}=e;const p=!i&&!!d&&!(null==u?void 0:u.current),[g,f]=(0,r.useState)(!1),[h,m]=(0,r.useState)(!1);return(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:shrink-0 tw:pt-[20px] tw:px-[12px] tw:pb-[24px] ".concat(i?"tw:justify-between":""),onClick:e=>e.stopPropagation(),children:[!i&&(0,l.jsxs)("div",{className:"tw:relative",children:[(0,l.jsx)("button",{onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),className:"tw:flex tw:items-center tw:justify-center tw:size-6 tw:rounded-lg tw:transition-colors hover:tw:bg-black/5 tw:cursor-pointer tw:border-none tw:bg-transparent tw:p-0","aria-label":p?t.openSidebarLabel:"Concierge home",onClick:e=>{e.stopPropagation(),p?null==s||s():null==c||c()},children:p?(0,l.jsx)(Ue,{size:t.sidebarIconSize,style:{color:o(t.sidebarIconColor)}}):!n.logoIconUrl&&!a||h?(0,l.jsx)(We,{size:t.logoIconSize,style:{color:o(t.sidebarIconColor)}}):(0,l.jsx)("img",{src:n.logoIconUrl||a,alt:"Brand",className:"tw:object-contain",onError:()=>m(!0),style:{height:t.logoIconSize,width:t.logoIconSize}})}),p&&g&&(0,l.jsx)("div",{className:"tw:absolute tw:left-[53px] tw:top-1/2 tw:-translate-y-1/2 tw:px-2 tw:h-8 tw:flex tw:items-center tw:z-50 tw:whitespace-nowrap",style:{backgroundColor:o(t.tooltipBgColor),color:o(t.tooltipTextColor),fontSize:t.tooltipFontSize,fontWeight:600,lineHeight:"18px",borderRadius:t.tooltipBorderRadius},children:t.openSidebarLabel})]}),i&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{className:"tw:flex tw:items-center tw:justify-center tw:rounded-lg tw:transition-colors hover:tw:bg-black/5 tw:cursor-pointer tw:border-none tw:bg-transparent tw:p-0","aria-label":"Concierge home",onClick:e=>{e.stopPropagation(),null==c||c()},children:n.logoIconUrl||a?(0,l.jsx)("img",{src:n.logoIconUrl||a,alt:"Brand",className:"tw:object-contain",style:{height:t.logoIconSize,width:t.logoIconSize}}):(0,l.jsx)(We,{size:t.logoIconSize,style:{color:o(t.sidebarIconColor)}})}),(0,l.jsx)("button",{onClick:e=>{e.stopPropagation(),null==s||s()},"aria-label":t.closeSidebarLabel,className:"tw:flex tw:items-center tw:justify-center tw:size-6 tw:rounded-lg tw:transition-colors tw:cursor-pointer hover:tw:bg-black/5 tw:shrink-0 tw:border-none tw:bg-transparent tw:p-0",children:(0,l.jsx)(Ue,{size:t.sidebarIconSize,style:{color:o(t.closeIconColor)}})})]})]})},El=e=>{var t,n;let{conversation:o,isActive:i,isInLiveTakeover:a,onSelect:s,onDelete:c,onShareChat:d,isEditingTitle:p,editingTitleValue:g,onStartEditTitle:f,onSaveEditTitle:h,onCancelEditTitle:m,state:v,resolve
1Color:y}=e;const[x,b]=(0,r.useState)(!1),[w,A]=(0,r.useState)(!1),[C,j]=(0,r.useState)(!1),[S,k]=(0,r.useState)(!1),[O,I]=(0,r.useState)(""),P=(0,r.useRef)(null),E=(0,r.useRef)(null),V=(0,r.useRef)(null),[F,B]=(0,r.useState)(null),L=Ct(),R=p,T=(x||w||L)&&!C,[M,D]=(0,r.useState)(null),N=R?o.conversationId:null;N!==M&&(D(N),I(N?g:"")),(0,r.useEffect)(()=>{if(!R)return;const e=P.current;e&&(e.focus(),e.setSelectionRange(0,e.value.length))},[R]),(0,r.useEffect)(()=>{if(!w)return;const e=e=>{E.current&&!E.current.contains(e.target)&&A(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[w]);const z=(0,r.useCallback)(()=>{if(V.current){const e=V.current.getBoundingClientRect(),t=160,n=120,r=8,o=window.innerWidth,i=window.innerHeight,a=e.left,l=Math.max(r,Math.min(a,o-t-r)),s=e.bottom+4,c=Math.min(s,i-n-r);B({top:c,left:l})}A(e=>!e)},[]);return(0,l.jsxs)("div",{className:"tw:relative",onMouseEnter:L?void 0:()=>b(!0),onMouseLeave:L?void 0:()=>{b(!1),w||A(!1)},children:[(0,l.jsx)("button",{onClick:()=>!C&&!R&&s(o.conversationId,o.mode),style:{width:"100%",textAlign:"left",padding:"".concat(v.chatItemPaddingY,"px ").concat(v.chatItemPaddingX,"px"),paddingRight:T||R?32:v.chatItemPaddingX,backgroundColor:i||R?y(v.chatItemActiveBgColor,"rgba(220,221,220,0.5)"):L||!x&&!w?"transparent":y(v.chatItemHoverBgColor,"rgba(220,221,220,0.3)"),border:"none",cursor:C?"default":"pointer",transition:"background-color 0.15s ease, opacity 0.2s ease",borderRadius:v.chatItemBorderRadius,display:"block",opacity:C?.5:1},children:(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:gap-2",style:{fontSize:v.chatItemFontSize,fontWeight:null!==(t=Ol[v.chatItemFontWeight])&&void 0!==t?t:500,color:y(v.chatItemColor),lineHeight:"24px"},children:[C&&(0,l.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",className:"tw:shrink-0",style:{animation:"spin 1s linear infinite"},children:(0,l.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:y(v.chatItemColor),strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"12"})}),R?(0,l.jsx)("input",{ref:P,type:"text",value:O,onChange:e=>I(e.target.value),onBlur:()=>{const e=O.trim();e&&e!==(o.title||o.preview)?h(o.conversationId,e):m()},onKeyDown:e=>{if("Enter"===e.key){e.preventDefault();const t=O.trim();t?h(o.conversationId,t):m()}else"Escape"===e.key&&(e.preventDefault(),m())},onClick:e=>e.stopPropagation(),onFocus:e=>{e.currentTarget.setSelectionRange(0,e.currentTarget.value.length)},style:{width:"100%",flex:1,minWidth:0,padding:0,border:"none",outline:"none",background:"transparent",fontSize:v.chatItemFontSize,fontWeight:null!==(n=Ol[v.chatItemFontWeight])&&void 0!==n?n:500,color:y(v.chatItemColor),lineHeight:"24px"},"aria-label":"Edit conversation name"}):(0,l.jsxs)(l.Fragment,{children:[a&&(0,l.jsxs)("span",{className:"tw:relative tw:flex tw:h-1.5 tw:w-1.5 tw:shrink-0","aria-label":"Connected to support team",children:[(0,l.jsx)("span",{className:"tw:absolute tw:inline-flex tw:h-full tw:w-full tw:animate-ping tw:rounded-full tw:opacity-75",style:{backgroundColor:"var(--bc-support-dot)"}}),(0,l.jsx)("span",{className:"tw:relative tw:inline-flex tw:h-1.5 tw:w-1.5 tw:rounded-full",style:{backgroundColor:"var(--bc-support-dot)"}})]}),(0,l.jsx)("span",{style:{overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:v.chatItemLineClamp,WebkitBoxOrient:"vertical"},children:o.title||o.preview||"New chat"})]})]})}),T&&(0,l.jsx)("div",{className:"tw:absolute tw:right-1 tw:top-1/2 tw:-translate-y-1/2",children:(0,l.jsx)("button",{ref:V,onClick:e=>{e.stopPropagation(),z()},className:"tw:flex tw:items-center tw:justify-center tw:size-6 tw:rounded tw:border-none tw:cursor-pointer tw:bg-transparent hover:tw:bg-black/10 tw:transition-colors","aria-label":"More options for conversation: ".concat(o.title||o.preview||"New chat"),"aria-expanded":w,"aria-haspopup":"menu",children:(0,l.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:[(0,l.jsx)("circle",{cx:"8",cy:"3",r:"1.5",fill:y(v.chatItemColor)}
1),(0,l.jsx)("circle",{cx:"8",cy:"8",r:"1.5",fill:y(v.chatItemColor)}),(0,l.jsx)("circle",{cx:"8",cy:"13",r:"1.5",fill:y(v.chatItemColor)})]})})}),w&&F&&u.createPortal((0,l.jsx)(Cl,{ref:E,fontFamily:v.fontFamilyCss,items:Al({onShare:()=>{A(!1),null==d||d(o.conversationId)},onRename:()=>{A(!1),f(o.conversationId,o.title||o.preview||"")},onDelete:()=>{A(!1),k(!0)},defaultColor:y(v.chatItemColor)}),style:{position:"fixed",top:F.top,left:F.left,zIndex:9999}}),document.body),(0,l.jsx)(hl,{open:S,title:"Are you sure? This action cannot be undone.",message:(0,l.jsxs)(l.Fragment,{children:["Continuing will delete ",(0,l.jsx)("strong",{children:o.title||"this conversation"}),"."]}),confirmText:"Delete",backgroundColor:y(v.expandedBgColor),primaryColor:y(v.chatItemColor),primaryForegroundColor:y(v.tooltipTextColor),fontFamily:v.fontFamilyCss,onCancel:()=>k(!1),onConfirm:async()=>{k(!1),j(!0);try{await c(o.conversationId)}finally{j(!1)}}})]})},Vl=e=>{let{onProfileClick:t,onPurchasesClick:n,onSignOutClick:r,signOutLabel:o,labelColor:i,resolveColor:a,onClose:s}=e;const c=a(i),d={gap:8,padding:"4px",fontFamily:"inherit"},u={fontSize:14,fontWeight:500,color:c,lineHeight:"24px",whiteSpace:"nowrap"};return(0,l.jsxs)("div",{className:"tw:flex tw:flex-col",style:{padding:"4px"},children:[t&&(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),s(),t()},className:"tw:flex tw:items-center tw:border-none tw:cursor-pointer tw:bg-transparent tw:hover:bg-black/5 tw:transition-colors tw:rounded-md",style:d,children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:shrink-0",style:{width:24,height:24},children:(0,l.jsx)(_e,{size:18,style:{color:c}})}),(0,l.jsx)("span",{style:u,children:"Profile"})]}),n&&(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),s(),n()},className:"tw:flex tw:items-center tw:border-none tw:cursor-pointer tw:bg-transparent tw:hover:bg-black/5 tw:transition-colors tw:rounded-md",style:d,children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:shrink-0",style:{width:24,height:24},children:(0,l.jsx)($e,{size:18,style:{color:c}})}),(0,l.jsx)("span",{style:u,children:"Purchases"})]}),(0,l.jsx)("div",{style:{height:0,borderTop:"1px solid #e8e8ed",margin:"4px -4px"}}),(0,l.jsxs)("button",{onClick:e=>{e.stopPropagation(),s(),null==r||r()},className:"tw:flex tw:items-center tw:border-none tw:cursor-pointer tw:bg-transparent tw:hover:bg-black/5 tw:transition-colors tw:rounded-md",style:d,children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:shrink-0",style:{width:24,height:24},children:(0,l.jsx)(et,{size:18,style:{color:c}})}),(0,l.jsx)("span",{style:u,children:o})]})]})},Fl=e=>{var t,n;let{onConversationSelect:o,onComposeClick:i,onChatsClick:a,currentConversationId:s,userProfile:p,apiBaseUrl:h,onSignOutClick:v,onProfileClick:y,onPurchasesClick:x,onHomeClick:b,brandLogoUrl:w,isExpanded:A,onToggle:C,mobileOverlay:j=!1,onShareChat:S,onSignInClick:k,liveTakeoverActiveConversationId:O}=e;const I=Ct(),P=(0,Lt.AU)(),E=null!==(t=null!=h?h:null==P?void 0:P.apiBaseUrl)&&void 0!==t?t:(0,m.e5)(),{data:V}=(0,g.S1)(),{data:F}=(0,g.CH)(E),B=(0,d.pF)(),L=!1!==(null==B?void 0:B.customerLogin),R=(()=>{var e;if(null==V?void 0:V.customShopDomainName)return V.customShopDomainName;const t=null==(e=null==F?void 0:F.branchIOConfig)?void 0:e.webAppBranchLink;if(t)try{return new URL(t).hostname}catch(e){return t.replace(/^https?:\/\//,"").replace(/\/+$/,"")}})(),[T,M]=(0,r.useState)(!1),D=void 0!==A,N=D?A:T,z=(0,r.useRef)(!1),W=(0,r.useRef)(void 0),U=()=>{N&&(z.current=!0,clearTimeout(W.current),W.current=setTimeout(()=>{z.current=!1},400)),D?null==C||C():M(e=>!e)},{conversations:H,isLoading:Q,fetchNextPage:Z,hasNextPage:q,isFetchingNextPage:Y,deleteMutation:K,renameMutation:G,refresh:J}=function(e){var t;let{apiBaseUrl:n,searchText:o,enabled:i=!0,pageSize:a=dl}=e;const l=(0,c.jE)(),s=n||"/api-rewards",d=cl.list(o),{data:u,fetchNextPage:p,hasNextPage:g,isFetchingNextPage:h,isLoading:m,isError:v}=(0,rl.q)({queryKey:d,queryFn:e=>{let{pageParam:t}=e;return(async(e,t,n,r)=>{const o=await(0,f.fk)(),i=new URLSearchParams({limit:String(t)});n&&i.set("cursor",n),(null==r?void 0:r.trim())&&i.set("searchText",r.trim());const a=await fetch("".concat(e,"/api-rewards/concierge/conversations?").concat(i),{method:"GET",headers:al({"Content-Type":"application/json"},o)});if(!a.ok)throw new Error("Failed to fetch conversations: ".concat(a.status));return a.json()})(s,a,t,o)},getNextPageParam:e=>e.nextCursor,initialPageParam:void 0,enabled:i,staleTime:3e4,gcTime:6e5,refetchOnMount:"always"}),y=null!==(t=null==u?void 0:u.pages.flatMap(e=>e.conversations))&&void 0!==t?t:[],x=(0,ol.n)({mutationFn:async e=>{await Promise.all(e.map(e=>(async(e,t)=>{const n=await(0,f.fk)();if(!(await fetch("".concat(e,"/api-rewards/concierge/conversations/").concat(t),{method:"DELETE",headers:al({"Content-Type":"application/json"},n)})).ok)throw new Error("Failed to delete conversation")})(s,e)))},onMutate:async e=>{await l.cancelQueries({queryKey:cl.all});const t=new Map,n=new Set(e);return l.setQueriesData({queryKey:cl.all},e=>(null==e?void 0:e.pages)?al(al({},e),{},{pages:e.pages.map(e=>al(al({},e),{},{conversations:e.conversations.filter(e=>!n.has(e.conversationId))}))}):e),{snapshots:t}},onError:()=>
1{l.invalidateQueries({queryKey:cl.all})},onSettled:()=>{l.invalidateQueries({queryKey:cl.all})}}),b=(0,ol.n)({mutationFn:async e=>{let{conversationId:t,title:n}=e;await(async(e,t,n)=>{const r=await(0,f.fk)();if(!(await fetch("".concat(e,"/api-rewards/concierge/conversations/").concat(t),{method:"PATCH",headers:al({"Content-Type":"application/json"},r),body:JSON.stringify({title:n})})).ok)throw new Error("Failed to rename conversation")})(s,t,n)},onMutate:async e=>{let{conversationId:t,title:n}=e;await l.cancelQueries({queryKey:cl.all}),l.setQueriesData({queryKey:cl.all},e=>(null==e?void 0:e.pages)?al(al({},e),{},{pages:e.pages.map(e=>al(al({},e),{},{conversations:e.conversations.map(e=>e.conversationId===t?al(al({},e),{},{title:n}):e)}))}):e)},onError:()=>{l.invalidateQueries({queryKey:cl.all})},onSettled:()=>{l.invalidateQueries({queryKey:cl.all})}});return{conversations:y,isLoading:m,isError:v,fetchNextPage:p,hasNextPage:null!=g&&g,isFetchingNextPage:h,deleteMutation:x,renameMutation:b,refresh:(0,r.useCallback)(()=>{l.invalidateQueries({queryKey:cl.all})},[l]),queryKey:d}}({apiBaseUrl:E}),X=H.some(e=>"in_progress"===e.status&&Date.now()-new Date(e.lastUpdated).getTime()<3e5);(0,r.useEffect)(()=>{if(!N||!X)return;const e=window.setInterval(()=>J(),3e3);return()=>window.clearInterval(e)},[N,X,J]);const _=(0,r.useRef)(null);(0,r.useEffect)(()=>{const e=_.current;if(!e||!N||!q)return;const t=new IntersectionObserver(e=>{var t;(null==(t=e[0])?void 0:t.isIntersecting)&&!Y&&Z()},{threshold:.1});return t.observe(e),()=>t.disconnect()},[N,q,Y,Z]);const $=(0,r.useCallback)(async e=>{try{await K.mutateAsync([e]),(0,tl.u4)(nl.A.CONCIERGE_CONVERSATION_DELETE,{conversationId:e,pageUrl:"undefined"!=typeof window?window.location.href:"",appVersion:"v2"}).catch(()=>{}),s===e&&(null==i||i())}catch(e){}},[K,s,i]),[ee,te]=(0,r.useState)(null),[ne,re]=(0,r.useState)(""),oe=(0,r.useCallback)((e,t)=>{te(e),re(t)},[]),ie=(0,r.useCallback)(async(e,t)=>{te(null),re("");try{await G.mutateAsync({conversationId:e,title:t})}catch(e){}},[G]),ae=(0,r.useCallback)(()=>{te(null),re("")},[]),le=(()=>{const e=(null==p?void 0:p.firstName)||"",t=(null==p?void 0:p.lastName)||"";if(e&&t)return"".concat(e[0]).concat(t[0]).toUpperCase();if(e)return e.slice(0,2).toUpperCase();const n=((null==p?void 0:p.email)||"").split("@")[0];return n?n.slice(0,2).toUpperCase():""})(),se=[null==p?void 0:p.firstName,null==p?void 0:p.lastName].filter(Boolean).join(" ")||"",ce=null!==(n=null==p?void 0:p.isSignedIn)&&void 0!==n&&n,{data:de,isSuccess:ue}=(0,g.rD)(),pe=!ue||((null==de?void 0:de.authType)?"no_auth"!==de.authType:Boolean(null==de?void 0:de.authConfig)),ge=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{const e=ge.current;ge.current=ce,!1===e&&ce&&J()},[ce,J]);const[fe,he]=(0,r.useState)(!1),[me,ve]=(0,r.useState)(!1),[ye,xe]=(0,r.useState)(!1),be=(0,r.useRef)(null),we=(0,r.useRef)(null),[Ae,Ce]=(0,r.useState)(null);return(0,r.useEffect)(()=>{if(!ye)return;const e=e=>{we.current&&!we.current.contains(e.target)&&be.current&&!be.current.contains(e.target)&&xe(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ye]),(0,l.jsx)(d._g,{widgetId:"concierge-sidebar",displayName:"Concierge Sidebar",wrapperStyle:{width:"auto",flexShrink:0,display:"flex",height:"100%"},children:(e,t,n)=>{var r,c,d;const p=R?Sl(Sl({},e),{},{brandLinkText:R}):e;return(0,l.jsxs)("aside",{role:"complementary","aria-expanded":N,onClick:N?void 0:U,onMouseEnter:()=>!N&&ve(!0),onMouseLeave:()=>ve(!1),className:j?"tw:flex tw:flex-col tw:shrink-0 tw:h-full":"tw:hidden tw:md:flex tw:flex-col tw:shrink-0 tw:h-full",style:Sl({backgroundColor:n(N?p.expandedBgColor:p.collapsedBgColor),width:N?p.expandedWidth:p.collapsedWidth,transition:"width 0.25s ease-in-out",cursor:N?void 0:"pointer",borderRight:"1px solid ".concat(n(p.borderColor)),boxSizing:"content-box",overflow:"hidden"},p.fontFamilyCss&&"inherit"!==p.fontFamilyCss?{fontFamily:p.fontFamilyCss}:{}
1),children:[(0,l.jsx)(Pl,{state:p,icons:t,resolveColor:n,isExpanded:N,brandLogoUrl:w,onToggle:U,onClick:i,sidebarHovered:me,justCollapsedRef:z}),(0,l.jsxs)("div",{className:"tw:flex tw:flex-col",children:[(0,l.jsx)(Il,{icon:(0,l.jsx)(He,{size:p.composeIconSize,style:{color:n(p.composeIconColor)}}),label:p.newChatLabel,onClick:i,isExpanded:N,ariaLabel:p.newChatLabel,state:p,resolveColor:n}),(0,l.jsx)(Il,{icon:(0,l.jsx)(Ke,{size:p.chatsIconSize,style:{color:n(p.chatsIconColor)}}),label:p.chatsLabel,onClick:a,isExpanded:N,ariaLabel:"".concat(p.chatsLabel,": view your conversation history"),state:p,resolveColor:n})]}),N?(0,l.jsxs)("div",{className:"sidebar-history-enter tw:flex tw:flex-col tw:flex-1 tw:min-h-0 tw:overflow-hidden tw:mt-[24px]",children:[(Q||H.length>0)&&(0,l.jsx)("div",{className:"tw:px-4 tw:pb-1 tw:shrink-0",style:{fontSize:p.chatHistoryTitleFontSize,fontWeight:null!==(r=Ol[p.chatHistoryTitleFontWeight])&&void 0!==r?r:500,color:n(p.chatHistoryTitleColor),lineHeight:"24px",whiteSpace:"nowrap"},children:p.chatHistoryTitle}),(0,l.jsxs)("div",{className:"tw:flex-1 tw:overflow-y-auto tw:mt-1 tw:px-2 concierge-conversation-scroll",children:[Q&&(0,l.jsx)("div",{className:"tw:flex tw:justify-center tw:py-4",children:(0,l.jsx)(Bl,{color:n(p.chatHistoryTitleColor)})}),!Q&&H.length>0&&(0,l.jsxs)("div",{className:"sidebar-history-list",children:[H.map(e=>(0,l.jsx)(El,{conversation:e,isActive:e.conversationId===s,isInLiveTakeover:e.conversationId===O,onSelect:(e,t)=>null==o?void 0:o(e,t),onDelete:$,onShareChat:S,isEditingTitle:ee===e.conversationId,editingTitleValue:ne,onStartEditTitle:oe,onSaveEditTitle:ie,onCancelEditTitle:ae,state:p,resolveColor:n},e.conversationId)),q&&(0,l.jsx)("div",{ref:_,className:"tw:flex tw:justify-center tw:py-2",style:{minHeight:1},children:Y&&(0,l.jsx)(Bl,{color:n(p.chatHistoryTitleColor)})})]})]})]}):(0,l.jsx)("div",{className:"tw:flex-1"}),ce?(0,l.jsxs)("div",{className:"tw:relative tw:mt-auto tw:shrink-0",onClick:e=>e.stopPropagation(),style:{borderTop:N?"1px solid ".concat(n(p.borderColor)):void 0,backgroundColor:N?n(p.expandedBgColor):void 0},children:[ye&&N&&(0,l.jsx)("div",{ref:we,className:"tw:absolute tw:bottom-full tw:z-50",style:{left:16,marginBottom:8,width:216,backgroundColor:"#ffffff",border:"1px solid #e8e8ed",borderRadius:5,boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.05)",fontFamily:"inherit"},children:(0,l.jsx)(Vl,{onProfileClick:y,onPurchasesClick:x,onSignOutClick:v,signOutLabel:p.signOutLabel,labelColor:p.labelColor,resolveColor:n,onClose:()=>xe(!1)})}),(0,l.jsxs)("button",{ref:be,"aria-label":se?"Account menu for ".concat(se):"Account menu (".concat(p.signOutLabel,")"),"aria-expanded":ye,"aria-haspopup":"menu",onClick:e=>{if(e.stopPropagation(),!N&&be.current){const e=be.current.getBoundingClientRect();
1Ce({top:e.top-4,left:e.left+4})}xe(e=>!e)},onMouseEnter:()=>he(!0),onMouseLeave:()=>he(!1),className:"tw:flex tw:items-center tw:cursor-pointer tw:w-full tw:rounded-none tw:transition-colors hover:tw:bg-black/5 tw:border-none tw:bg-transparent tw:overflow-hidden ".concat(N?"tw:h-16 tw:px-4 tw:gap-3":"tw:py-2 tw:px-2 tw:mb-2"),style:I&&N?{height:65}:void 0,children:[(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:rounded-full tw:shrink-0",style:{width:p.avatarSize,height:p.avatarSize,backgroundColor:n(p.avatarBgColor),color:n(p.avatarTextColor),fontSize:p.avatarFontSize,fontWeight:null!==(c=Ol[p.avatarFontWeight])&&void 0!==c?c:600,lineHeight:"1.5"},children:le||(0,l.jsx)(_e,{size:Math.round(.6*p.avatarSize)})}),N&&(0,l.jsx)("span",{className:"tw:whitespace-nowrap tw:overflow-hidden tw:text-ellipsis tw:flex-1 tw:text-left",style:{color:n(p.labelColor),fontSize:14,fontWeight:null!==(d=Ol[p.labelFontWeight])&&void 0!==d?d:500,lineHeight:"24px"},children:se||p.signOutLabel}),N&&(0,l.jsx)(Ge,{size:18,style:{color:n(p.labelColor),transform:ye?"rotate(180deg)":"rotate(0deg)",transition:"transform 0.2s ease",flexShrink:0}})]}),!N&&fe&&!ye&&(0,l.jsx)("div",{className:"tw:absolute tw:left-[53px] tw:top-1/2 tw:-translate-y-1/2 tw:px-2 tw:h-8 tw:flex tw:items-center tw:z-50 tw:whitespace-nowrap",style:{backgroundColor:n(p.tooltipBgColor),color:n(p.tooltipTextColor),fontSize:p.tooltipFontSize,fontWeight:600,lineHeight:"18px",borderRadius:p.tooltipBorderRadius},children:se||p.signOutLabel}),ye&&!N&&Ae&&u.createPortal((0,l.jsx)("div",{ref:we,className:"tw:fixed tw:z-[9999]",style:{to
1p:Ae.top,left:Ae.left,transform:"translateY(-100%)",width:216,backgroundColor:"#ffffff",border:"1px solid #e8e8ed",borderRadius:5,boxShadow:"0px 4px 16px rgba(0, 0, 0, 0.05)",fontFamily:p.fontFamilyCss&&"inherit"!==p.fontFamilyCss?p.fontFamilyCss:void 0},children:(0,l.jsx)(Vl,{onProfileClick:y,onPurchasesClick:x,onSignOutClick:v,signOutLabel:p.signOutLabel,labelColor:p.labelColor,resolveColor:n,onClose:()=>xe(!1)})}),document.body)]}):L&&pe?(0,l.jsxs)("div",{className:"tw:relative tw:mt-auto tw:shrink-0",onClick:e=>e.stopPropagation(),style:{borderTop:N?"1px solid #dcdddc":void 0,backgroundColor:N?n(p.expandedBgColor):void 0},children:[!N&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{"aria-label":"Sign in",onClick:e=>{e.stopPropagation(),null==k||k()},onMouseEnter:()=>he(!0),onMouseLeave:()=>he(!1),className:"tw:flex tw:items-center tw:cursor-pointer tw:w-full tw:rounded-none tw:transition-colors hover:tw:bg-black/5 tw:border-none tw:bg-transparent tw:overflow-hidden tw:py-2 tw:px-2 tw:mb-2",children:(0,l.jsx)("div",{className:"tw:flex tw:items-center tw:justify-center tw:rounded-full tw:shrink-0",style:{width:p.avatarSize,height:p.avatarSize,backgroundColor:n(p.avatarBgColor),color:n(p.avatarTextColor)},children:(0,l.jsx)(_e,{size:18})})}),fe&&(0,l.jsx)("div",{className:"tw:absolute tw:left-[53px] tw:top-1/2 tw:-translate-y-1/2 tw:px-2 tw:h-8 tw:flex tw:items-center tw:z-50 tw:whitespace-nowrap",style:{backgroundColor:n(p.tooltipBgColor),color:n(p.tooltipTextColor),fontSize:p.tooltipFontSize,fontWeight:600,lineHeight:"18px",borderRadius:p.tooltipBorderRadius},children:"Sign in"})]}),N&&(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:items-stretch",style:{padding:"20px 12px",width:p.expandedWidth-1,boxSizing:"border-box"},children:[(0,l.jsx)("p",{style:{fontSize:14,fontWeight:500,color:n(p.labelColor),lineHeight:"24px",margin:"0 0 16px",whiteSpace:"nowrap"},children:"Get responses tailored to you"}),(0,l.jsxs)("p",{style:{fontSize:12,fontWeight:400,color:n(p.labelColor),lineHeight:"18px",margin:"0 0 24px",whiteSpace:"nowrap"},children:["Log in to access your profile and",(0,l.jsx)("br",{}),"get personalized assistance."]}),(0,l.jsx)("button",{onClick:e=>{e.stopPropagation(),null==k||k()},className:"tw:cursor-pointer tw:border tw:border-solid tw:border-[#dcdddc] tw:rounded-full tw:transition-all tw:duration-200 tw:bg-white",style:{padding:"8px 12px",fontSize:14,fontWeight:600,color:n(p.labelColor),fontFamily:"inherit",lineHeight:"20px",whiteSpace:"nowrap"},children:"Sign in"})]})]}):null]})}})},Bl=e=>{let{color:t}=e;return(0,l.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",style:{animation:"spin 1s linear infinite"},children:[(0,l.jsx)("style",{children:"@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }"}),(0,l.jsx)("circle",{cx:"12",cy:"12",r:"10",stroke:t,strokeWidth:"3",strokeLinecap:"round",strokeDasharray:"32",strokeDashoffset:"12"})]})};function Ll(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Rl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ll(Object(n),!0).forEach(function(t){Tl(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ll(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Tl(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ml="concierge-bag-button-mobile-only";function Dl(e){let{size:t,count:n}=e;const r=null==n?null:n>99?"99+":String(n);return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[(0,l.jsx)("path",{d:"M11 12V9.5a5 5 0 0 1 10 0V12"}),(0,l.jsx)("rect",{x:"5.5",y:"12",width:"21",height:"16.5",rx:"3.5"}),r&&(0,l.jsx)("text",{x:"16",y:"21.6",textAnchor:"middle",dominantBaseline:"middle",stroke:"none",fill:"
1currentColor",fontSize:r.length>2?8.5:11,fontWeight:700,fontFamily:"inherit",children:r})]})}const Nl=e=>{let{floating:t,hideOnDesktop:n,size:o,color:i}=e;const{commerce:a,closeProductPanel:s}=(0,Lt.Ox)(),{bag:c}=(0,na.T)(),[d,u]=(0,r.useState)(()=>{var e;return null!==(e=null==a?void 0:a.getCartState().itemCount)&&void 0!==e?e:0});if((0,r.useEffect)(()=>{if(!a)return;u(a.getCartState().itemCount);const e=a.subscribe(e=>u(e.itemCount));return a.refreshCart(),e},[a]),!a)return null;const p=d>0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{dangerouslySetInnerHTML:{__html:n?"@media(min-width:1280px){.".concat(Ml,"{display:none!important}}"):""}}),(0,l.jsx)("button",{type:"button",className:n?Ml:void 0,"aria-label":p?"View ".concat(c,", ").concat(d," item").concat(1===d?"":"s"):"View ".concat(c),onClick:()=>{s(),a.goToCart()},"data-concierge-filled-action":"",style:Rl(Rl({},t?{top:12,right:16,zIndex:10}:{}),{},{position:t?"absolute":"relative",background:"none",border:"none",borderRadius:8,display:"inline-flex",alignItems:"center",justifyContent:"center",width:null!=o?o:42,he
1ight:null!=o?o:42,padding:0,cursor:"pointer",color:null!=i?i:"inherit",flexShrink:0}),children:(0,l.jsx)(Dl,{size:null!=o?o:30,count:p?d:null})})]})};function zl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Wl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?zl(Object(n),!0).forEach(function(t){Ul(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ul(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Hl=e=>{let{brandLogoUrl:t,onMenuClick:n,onCloseClick:r,onShareClick:o,showBag:i=!1,closeLabel:a="Close"}=e;return(0,l.jsx)(d.Yo,{children:(e,s,c)=>{const u=c(e.navBgColor),p=c(e.hamburgerIconColor),g=c(e.closeIconColor),f=1+(o?1:0)+(i?1:0),h=e.closeIconSize*f+12*(f-1);return(0,l.jsxs)("nav",{"data-concierge-mobile-nav":!0,style:Wl({display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",height:e.navHeight,padding:"".concat(e.navPaddingY,"px ").concat(e.navPaddingX,"px"),boxSizing:"border-box",flexShrink:0,color:p||void 0},u&&"transparent"!==u?{backgroundColor:u}:{}),children:[(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-start",width:h,flexShrink:0},children:(0,l.jsx)("button",{type:"button",onClick:n,"aria-label":"Open menu",style:{display:"flex",alignItems:"center",justifyContent:"center",width:e.hamburgerIconSize,height:e.hamburgerIconSize,padding:0,border:"none",background:"none",cursor:"pointer"},children:s.hamburgerIconUrl?(0,l.jsx)("img",{src:s.hamburgerIconUrl,alt:"Menu",style:{width:e.hamburgerIconSize,height:e.hamburgerIconSize,objectFit:"contain"}}):(0,l.jsx)(Ye,{size:e.hamburgerIconSize,style:{color:p}})})}),e.showLogo?(0,l.jsx)("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",flex:1,minWidth:0,padding:"0 8px"},children:(0,l.jsx)("div",{style:{width:"100%",maxWidth:120},children:(0,l.jsx)(d.Mr,{widgetId:"concierge-home-mobile-nav-logo",displayName:"Mobile Nav Logo",initialState:{logoWidth:79,mobile_logoWidth:79,logoMaxHeight:18},logoUrl:t})})}):(0,l.jsx)("div",{style:{width:e.closeIconSize,height:e.closeIconSize}}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:12,width:h,flexShrink:0},children:[i&&(0,l.jsx)(Nl,{size:e.closeIconSize,color:g}),o&&(0,l.jsx)("button",{type:"button",onClick:o,"aria-label":"Share conversation",style:{display:"flex",alignItems:"center",justifyContent:"center",width:e.closeIconSize,height:e.closeIconSize,padding:0,border:"none",background:"none",cursor:"pointer"},children:(0,l.jsx)(Xe,{size:24,style:{color:g}})}),(0,l.jsx)("button",{type:"button",onClick:r,"aria-label":a,style:{display:"flex",alignItems:"center",justifyContent:"center",width:e.closeIconSize,height:e.closeIconSize,padding:0,border:"none",background:"none",cursor:"pointer"},children:s.closeIconUrl?(0,l.jsx)("img",{src:s.closeIconUrl,alt:"Close",style:{width:e.closeIconSize,height:e.closeIconSize,objectFit:"contain"}}):(0,l.jsx)(Je,{size:e.closeIconSize,style:{color:g}})})]})]})}})};function Ql(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ql(Object(n),!0).forEach(function(t){ql(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ql(Object(n)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ql(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Yl=e=>{let{searchInputValue:t,setSearchInputValue:n,handleSearch:o,isActivelyStreaming:i,conversationHistoryLength:a,onTrackAccessPoint:s,onStop:c,widgetId:u="concierge-panel-chat-input",displayName:p="Chat Input (Conversation)",initialState:g,presets:f,forceMobile:h=!1,liveTakeoverActive:m=!1,adminName:v,adminAvatarUrl:y,onEndLiveAgent:x}=e;const b=(0,d.at)(u,{}),w=(0,d.at)("concierge-chat-input",{}),A=eo(),C=(0,r.useMemo)(()=>v?v.split(" ")[0]:void 0,[v]),j=(0,r.useMemo)(()=>m?C?A.takeoverPlaceholder.replace(/\{firstName\}/g,C):"Reply to supportâ¦":a>0?b.placeholderFollowUp||"Have another question?":b.placeholderDefault||"Ask me anything",[m,C,a,b.placeholderDefault,b.placeholderFollowUp,A.takeoverPlaceholder]),S=(0,r.useCallback)((e,t)=>{null==s||s("search_bar",e),o(e,t)},[o,s]),k=(0,r.useMemo)(()=>{const e=Zl(Zl({},w.fontFamily?{fontFamily:w.fontFamily}:{}),g);return m?Zl(Zl({},e),{},{borderColor:(0,d.vT)("transparent"),borderColorFocus:(0,d.vT)("transparent"),borderWidth:0,shadowEnabled:!1}):e},[w.fontFamily,g,m]),[O,I]=(0,r.useState)(!1),P=(0,r.useCallback)(async()=>{if(x&&!O){I(!0);try{await x()}finally{I(!1)}}},[x,O]),E=(0,d.S5)(),V=(0,d.Zp)(),{conversationId:F,openVoiceCall:B}=(0,Lt.Ox)(),L=E.enabled&&!m,R=(0,r.useCallback)(()=>{B(null!=F?F:void 0)},[B,F]),T=(0,l.jsx)(ht,{placeholder:j,value:t,onChange:n,onSubmit:S,isStreaming:i,onStop:c,widgetId:u,displayName:p,presets:f,forceMobile:h,initialState:k,showCallButton:L,onCallClick:L?R:void 0,voiceAssistantName:V.persona.assistantName});return(0,l.jsx)("div",{className:"tw:flex tw:shrink-0 tw:flex-col tw:gap-1 tw:px-4 tw:pt-1",style:{paddingBottom:"max(1rem, env(safe-area-inset-bottom))"},children:m?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{role:"status","aria-live":"polite",className:"tw:mx-auto tw:w-full tw:max-w-[768px] tw:overflow-hidden tw:rounded-2xl tw:border tw:bg-white tw:shadow-sm",style:{borderColor:"var(--bc-support-border)"},children:[(0,l.jsxs)("div",{className:"tw:flex tw:items-center tw:justify-between tw:gap-3 tw:border-b tw:px-3 tw:py-2",style:{backgroundColor:"var(--bc-support-bg)",borderBottomColor:"var(--bc-support-border)"},children:[(0,l.jsxs)("span",{className:"tw:flex tw:min-w-0 tw:items-center tw:gap-2 tw:text-sm tw:truncate",style:{color:"var(--bc-support-text)"},children:[(0,l.jsxs)("span",{className:"tw:relative tw:flex tw:h-1.5 tw:w-1.5 tw:shrink-0",children:[(0,l.jsx)("span",{className:"tw:absolute tw:inline-flex tw:h-full tw:w-full tw:animate-ping tw:rounded-full tw:opacity-75",style:{backgroundColor:"var(--bc-support-dot)"}}),(0,l.jsx)("span",{className:"tw:relative tw:inline-flex tw:h-1.5 tw:w-1.5 tw:rounded-full",style:{backgroundColor:"var(--bc-support-dot)"}})]}),v?(0,l.jsxs)("span",{className:"tw:truncate",children:["Connected to ",(0,l.jsx)("span",{className:"tw:font-semibold",children:v}),(0,l.jsx)("span",{className:"tw:mx-1",children:"·"}),(0,l.jsx)("span",{children:A.teamLabel})]}):(0,l.jsxs)("span",{className:"tw:truncate",children:["Connected to ",(0,l.jsx)("span",{className:"tw:font-semibold",children:A.teamLabel})]})]}),x&&(0,l.jsx)("button",{type:"button",onClick:P,disabled:O,className:"tw:shrink-0 tw:inline-flex tw:cursor-pointer tw:items-center tw:rounded-full tw:border tw:px-3 tw:py-1 tw:text-xs tw:font-semibold tw:transition-colors hover:tw:border-red-300 hover:tw:bg-red-50 hover:tw:text-red-600 disabled:tw:cursor-not-allowed disabled:tw:opacity-50",style:{borderColor:"var(--bc-support-border)",backgroundColor:"var(--bc-support-bg)",color:"var(--bc-support-text)"},"aria-label":"Disconnect from ".concat(A.teamLabel.toLowerCase()),children:O?"Endingâ¦":"Disconnect"})]}),T]}),(0,l.jsx)("p",{className:"tw:mx-auto tw:mt-1 tw:max-w-[768px] tw:text-center tw:text-xs tw:text-gray-500",children:A.pausedFooterCopy})]}):T})},Kl=["data-events-connected","data-live-takeover-state","data-human-reply","data-live-takeover-started","data-live-takeover-ended","data-takeover-team-changed","data-ticket-status-updated","data-user-message-mirrored","data-user-message-delivery-failed","data-debug-ping"],Gl={0:"CONNECTING",1:"OPEN",2:"CLOSED"};function Jl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Xl(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Jl(Object(n),!0).forEach(function(t){_l(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Jl(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function _l(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const $l=e=>{let{appName:t,conciergeName:n,brandId:o,conversationId:i,isEmbedded:a=!1,isOnChatWidget:s=!1,apiBaseUrl:c,userFirstName:u,pageContext:p,conversationHistory:g,followUpQuestions:h,latestFollowUps:m,isLoadingFollowUps:v,streamingDevInfo:y,isActivelyStreaming:x,transientStatus:b,streamingAIResponse:w,onStop:A,isLoadingConversationQuery:C,isPendingAssistantResponse:j,isPollingTimedOut:S,onRetry:k,onRetryLastMessage:O,streamErrorMessage:I,onStreamErrorRetry:P,onLiveTakeoverActive:E,onTakeoverConversationChange:V,handleSearch:F,onUpdateFeedback:T,onVariantSelect:M,onTrackAccessPoint:D,onHomeClick:N,isSidebarExpanded:z=!0,brandLogoUrl:W,searchInputValue:U,setSearchInputValue:H,mobileSidebarProps:Q,isSharedView:Z,sharedByUserName:q,sourceConversationId:Y,sourceCheckpointIndex:K,onOpenShareDialog:G,onShareClick:J,viewMode:X,onSupportEventsReconnect:_}=e;const $="pdp"===(null==p?void 0:p.pageType)?p.stacklineSku:null,ee=Ct(),{commerce:te}=(0,Lt.Ox)(),[ne,re]=(0,r.useState)(!1),oe=0===g.length&&!C&&!j&&!i,ie=g[g.length-1],ae="assistant"===(null==ie?void 0:ie.role)&&"parts"in ie&&Array.isArray(ie.parts)&&ie.parts.length>0,le=x&&!w&&!ae,se=function(e,t,n){const[o,i]=(0,r.useState)([]),a=(0,r.useRef)(n);return(0,r.useEffect)(()=>{a.current=n},[n]),(0,r.useEffect)(()=>{if(!e)return i([]),void console.info("[concierge-events] skip_open no_conversation_id");const n="".concat(null!=t?t:"","/api-rewards/concierge/support/conversation/").concat(encodeURIComponent(e),"/events");let r=null;const o=Date.now();let l,s=null;try{var c;r=new EventSource(n,{withCredentials:!0}),console.info("[concierge-events] event_source_created",{conversationId:e,url:n,readyState:null!==(c=Gl[r.readyState])&&void 0!==c?c:r.readyState})}catch(t){return void console.warn("[concierge-events] event_source_create_failed",{conversationId:e,url:n,err:t})}s=setInterval(()=>{const t=null==r?void 0:r.readyState;if(void 0!==t&&t!==l){var n,i;const r=void 0===l?"INIT":null!==(n=Gl[l])&&void 0!==n?n:l,a=null!==(i=Gl[t])&&void 0!==i?i:t;console.info("[concierge-events] ready_state_changed",{conversationId:e,from:r,to:a,uptimeMs:Date.now()-o}),l=t}},1e3),r.onerror=t=>{var n;console.warn("[concierge-events] error",{conversationId:e,readyState:r?null!==(n=Gl[r.readyState])&&void 0!==n?n:r.readyState:"NULL",uptimeMs:Date.now()-o,errEvent:t})};let d=0;const u=[];for(const t of Kl){const n=n=>{var r;let l;try{l=n.data?JSON.parse(n.data):void 0}catch(r){return void console.warn("[concierge-events] event_parse_failed",{conversationId:e,type:t,raw:n.data,err:r})}if(console.info("[concierge-events] event_received",{conversationId:e,type:t,data:l,uptimeMs:Date.now()-o}),"data-debug-ping"!==t&&(i(e=>[...e,{type:t,data:l}]),"data-events-connected"===t&&(d+=1,console.info("[concierge-events] connected",{conversationId:e,connectCount:d}),d>=2))){console.info("[concierge-events] reconnected firing_onReconnect",{conversationId:e,connectCount:d});try{null==(r=a.current)||r.call(a)}catch(t){console.warn("[concierge-events] onReconnect_handler_threw",{conversationId:e,err:t})}}};r.addEventListener(t,n),u.push({type:t,fn:n})}return()=>{console.info("[concierge-events] closing",{conversationId:e,uptimeMs:Date.now()-o}),s&&clearInterval(s);for(const{type:e,fn:t}of u)null==r||r.removeEventListener(e,t);null==r||r.close()}},[e,t]),o}(i,c,_),ce=(0,r.useRef)(new Map),de=(0,r.useRef)(null),ue=(0,r.useMemo)(()=>{var e,t;const n=new Set;for(const t of g){const r=t.parts;if(Array.isArray(r))for(const t of r)"data-human-reply"===(null==t?void 0:t.type)&&"string"==typeof(null==(e=null==t?void 0:t.data)?void 0:e.postedAt)&&n.add(t.data.postedAt)}const r=[];for(let e=0;e<se.length;e++){const o=se[e];
1if("data-human-reply"!==(null==o?void 0:o.type))continue;const i=null==(t=null==o?void 0:o.data)?void 0:t.postedAt;if(i&&n.has(i))continue;const a=null!=i?i:"idx-".concat(e);ce.current.has(a)||ce.current.set(a,g.length);const l=ce.current.get(a);r.push({anchor:l,order:e,message:{id:"live-human-reply-".concat(a),role:"assistant",parts:[o]}})}if(r.sort((e,t)=>e.anchor-t.anchor||e.order-t.order),0===r.length)return g;const o=[];let i=0;for(let e=0;e<=g.length;e++){for(;i<r.length&&r[i].anchor===e;)o.push(r[i].message),i++;e<g.length&&o.push(g[e])}for(;i<r.length;)o.push(r[i].message),i++;return o},[g,se]),pe=(0,r.useMemo)(()=>({followUpQuestions:h,isActivelyStreaming:x,conversationHistoryLength:g.length,showWelcome:oe,searchInputValue:""}),[h,x,g.length,oe]),{bottomRef:ge}=(e=>{let{followUpQuestions:t,isActivelyStreaming:n,conversationHistoryLength:o,showWelcome:i,searchInputValue:a}=e;const[l,s]=(0,r.useState)(!1),[c,d]=(0,r.useState)(!0),u=(0,r.useRef)(null),p=!i&&o>0&&!n&&t.length>0;(0,r.useEffect)(()=>{if(!p||!u.current)return void d(!0);const e=new IntersectionObserver(e=>{const t=e[0].isIntersecting;d(t)},{threshold:.1,rootMargin:"0px 0px 100px 0px"});return e.observe(u.current),()=>{e.disconnect()}},[p]);const g=p&&(c||l);return(0,r.useEffect)(()=>{const e=e=>{const t=e.target;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||s(!0)},t=e=>{const t=e.target;!t||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName||s(!1)};return document.addEventListener("focusin",e),document.addEventListener("focusout",t),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t)}},[]),{showSuggestions:g,shouldShowSuggestions:p,bottomRef:u}})(pe),fe=(0,r.useMemo)(()=>F,[F]),he=(0,r.useCallback)(e=>{null==D||D("quick_prompts",e),fe(e)},[fe,D]),me=(0,r.useCallback)(e=>{null==D||D("follow_up_question",e),fe(e)},[fe,D]),ve=(0,r.useMemo)(()=>({onSearch:he,brandId:o?parseInt(o):void 0,isEmbedded:a,apiBaseUrl:c,userFirstName:u,pageContext:p,brandLogoUrl:W,brandName:t,conciergeName:n,searchInputValue:U,setSearchInputValue:H,handleSearch:F,isActivelyStreaming:x,isMobile:ee}),[he,o,a,c,u,p,W,t,n,U,H,F,x,ee]),ye=(0,r.useMemo)(()=>(0,l.jsxs)("div",{className:"tw:flex tw:flex-col tw:items-center tw:justify-center tw:w-full tw:text-center",children:[(0,l.jsx)("p",{className:"tw:font-bold tw:text-[16px] tw:leading-[32px] tw:tracking-[2px] tw:uppercase tw:text-primary",children:"CONCIERGE"}),(0,l.jsxs)("h1",{className:"tw:font-semibold tw:text-[24px] tw:leading-[32px] tw:tracking-[0.08px] tw:mt-4 tw:text-primary",children:["Let us help you find what you've been looking for",u?", ".concat(u):"","."]})]}),[u]),xe=(0,r.useMemo)(()=>{let e;for(const t of se)"data-user-message-mirrored"===t.type?e="delivered":"data-user-message-delivery-failed"===t.type&&(e="failed");return e},[se]),be=(0,r.useMemo)(()=>{const e=[];for(const t of g)t&&"parts"in t&&Array.isArray(t.parts)&&e.push(...t.parts);return e.push(...se),e},[g,se]),we=(Ae=be,(0,r.useMemo)(()=>{let e,t,n,r,o,i,a,l=!1,s=!1;for(const m of Ae)if("data-live-takeover-state"===m.type){const l=m.data;a=!!(null==l?void 0:l.active),(null==l?void 0:l.intercomConversationId)&&(e=l.intercomConversationId),(null==l?void 0:l.teamId)&&(t=l.teamId),(null==l?void 0:l.adminId)&&(n=l.adminId),(null==l?void 0:l.adminName)&&(r=l.adminName),(null==l?void 0:l.adminAvatarUrl)&&(o=l.adminAvatarUrl),(null==l?void 0:l.startedAt)&&(i=l.startedAt),(null==l?void 0:l.active)||(s=!0)}else if("data-live-takeover-active"===m.type){var c;const t=m.data;l=!0,a=!0,s=!1,e=null!==(c=null==t?void 0:t.intercomConversationId)&&void 0!==c?c:e}else if("data-live-takeover-started"===m.type){var d,u;const n=m.data;l=!0,a=!0,s=!1,e=null!==(d=null==n?void 0:n.intercomConversationId)&&void 0!==d?d:e,t=null!==(u=null==n?void 0:n.teamId)&&void 0!==u?u:t,i=null!=i?i:(new Date).toISOString()}else if("data-takeover-team-changed"===m.type){var p,g;const e=m.data;t=null!==(p=null==e?void 0:e.teamId)&&void 0!==p?p:t,n=null!==(g=null==e?void 0:e.adminId)&&void 0!==g?g:n}else if("data-human-reply"===m.type){var f,h;const e=m.data;r=null!==(f=null==e?void 0:e.adminName)&&void 0!==f?f:r,o=null!==(h=null==e?void 0:e.adminAvatarUrl)&&void 0!==h?h:o,s||(l=!0)}else"data-live-takeover-ended"===m.type&&(l=!1,a=!1,s=!0);return{active:void 0!==a?a:l,intercomConversationId:e,teamId:t,adminId:n,adminName:r,adminAvatarUrl:o,startedAt:i}},[Ae]));var Ae;const[Ce,je]=(0,r.useState)(!1);(0,r.useEffect)(()=>{je(!1)},[i]);const Se=(0,r.useRef)(we.startedAt);(0,r.useEffect)(()=>{we.startedAt&&we.startedAt!==Se.current&&(Se.current=we.startedAt,je(!1))},[we.startedAt]);const ke=we.active&&!Ce;(0,r.useEffect)(()=>{ke&&E&&E()},[ke,E]),(0,r.useEffect)(()=>{V&&V(ke&&i?i:null)},[ke,i,V]);const Oe=(0,r.useMemo)(()=>C&&0===g.length?(0,l.jsx)(zt,{}):oe?(0,l.jsx)(Nt,Xl({},ve)):(0,l.jsx)(_a,{conversationId:i,messages:ue,showTypingIndicator:le&&!ke,streamingAIResponse:w,isActivelyStreaming:x,transientStatus:b,streamingDevInfo:y,followUpQuestions:h,latestFollowUps:m,isLoadingFollowUps:v,onSearch:me,onUpdateFeedback:T,onVariantSelect:M,bottomRef:ge,apiBaseUrl:c,isPendingAssistantResponse:j,isPollingTimedOut:S,onRetry:k,onRetryLastMessage:O,streamErrorMessage:I,onStreamErrorRetry:P,liveTakeoverActive:ke,latestUserDelivery:xe,isSharedView:Z,sharedByUserName:q,sourceConversationId:Y,sourceCheckpointIndex:K,pdpStacklineSku:$,isOnChatWidget:s,brandLogoUrl:W,onOpenShareDialog:G,viewMode:X}),[C,oe,!1,ye,ve,i,g,ue,le,w,x,b,y,h,m,v,me,T,M,ge,j,S,k,O,I,P,ke,xe,Z,q,Y,K,$,s,W,G]),Ie=(0,d.at)("concierge-panel",{preset:"vertical-expanded",mainBgColor:(0,d.vT)("transparent"),pillLayout:"vertical",pillShowIcon:!1,pillBorderRadius:100,pillBorderColor:(0,d.vT)("#F3F3F3"),pillBorderWidth:1,pillShadowEnabled:!0,pillBgColor:(0,d.vT)("#ffffff"),pillTextColor:(0,d.vT)("#181d56"),pillShadow:"0px 4px 16px 0 rgba(0, 0, 0, 0.05)",pillContainerBgColor:(0,d.vT)("transparent"),pillContainerBorderRadius:12,inputBorderColor:(0,d.vT)("#DCDDDC"),inputBorderWidth:1,inputBorderRadius:20,inputMinHeight:116,inputShadowEnabled:!1,inputShadow:"0px 4px 16px 0 rgba(0, 0, 0, 0.05)"}),Pe=(0,d.Rh)(),Ee=(0,r.useCallback)(async()=>
1{if(i){je(!0);try{const e=await(0,f.fk)();await(async e=>{let{conversationId:t,headersToInject:n,apiBaseUrl:r=Bn()}=e;const o=Vn(Vn({},n),{},{"Content-Type":"application/json"}),i=await fetch("".concat(r,"/api-rewards/concierge/support/conversation/").concat(t,"/end-live-agent"),{method:"POST",headers:o});if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error||"HTTP ".concat(i.status))}return i.json()})({conversationId:i,headersToInject:e,apiBaseUrl:c})}catch(e){console.warn("Failed to end live agent",e),je(!1)}}},[i,c]),Ve=(e,t)=>{var n;const r=s?t(e.mainBgColor):void 0;return(0,l.jsx)($r,{children:(0,l.jsxs)("div",{className:"chat-container tw:relative tw:flex tw:flex-1 tw:flex-col",style:Xl({minHeight:0,maxHeight:"100%",overflow:"hidden"},r&&"transparent"!==r?{backgroundColor:r}:{}),children:["read-only"!==X&&ee&&Q&&(0,l.jsxs)("div",{style:{position:"absolute",inset:0,zIndex:50,display:"flex",pointerEvents:ne?"auto":"none"},children:[(0,l.jsx)("div",{style:{position:"absolute",inset:0,backgroundColor:"rgba(0,0,0,0.3)",opacity:ne?1:0,transition:"opacity 0.25s ease-in-out"},onClick:()=>re(!1)}),(0,l.jsx)("div",{style:{position:"relative",zIndex:1,height:"100%",transform:ne?"translateX(0)":"translateX(-100%)",transition:"transform 0.25s ease-in-out"},children:(0,l.jsx)(Fl,Xl(Xl({},Q),{},{onConversationSelect:(e,t)=>{var n;null==(n=Q.onConversationSelect)||n.call(Q,e,t),re(!1)},onComposeClick:()=>{var e;null==(e=Q.onComposeClick)||e.call(Q),re(!1)},onChatsClick:()=>{var e;null==(e=Q.onChatsClick)||e.call(Q),re(!1)},onShareChat:e=>{var t;null==(t=Q.onShareChat)||t.call(Q,e),re(!1)},isExpanded:!0,onToggle:()=>re(!1),mobileOverlay:!0}))})]}),"read-only"!==X&&ee&&Q&&(0,l.jsx)(Hl,{brandLogoUrl:W,onMenuClick:()=>re(!0),onCloseClick:oe?N:null!==(n=Q.onComposeClick)&&void 0!==n?n:N,closeLabel:oe?"Close Concierge":"Close conversation",onShareClick:J,showBag:!!te}),a&&oe?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"concierge-conversation-scroll",style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",minHeight:0,maxHeight:"100%"},children:(0,l.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:Oe})}),"read-only"!==X&&(0,l.jsx)(Yl,{searchInputValue:U,setSearchInputValue:H,handleSearch:F,isActivelyStreaming:x,conversationHistoryLength:g.length,onTrackAccessPoint:D,onStop:A,widgetId:"concierge-panel-chat-input",displayName:"Chat Input (Panel Home)",presets:d.gR,forceMobile:!0,initialState:ee?Xl({preset:"compact"},d.gR.compact):Xl({preset:"expanded"},d.gR.expanded),liveTakeoverActive:ke,adminName:we.adminName,adminAvatarUrl:we.adminAvatarUrl,onEndLiveAgent:Ee})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{ref:de,className:"non-embedded-container concierge-conversation-scroll",style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column",minHeight:0,maxHeight:"100%"},children:[(0,l.jsx)(el,{isActivelyStreaming:x,scopeRef:de}),oe?(0,l.jsx)("div",{style:{flex:1,display:"flex",flexDirection:"column",minHeight:0},children:Oe}):(0,l.jsxs)(B,{className:"conversation-container",children:[(0,l.jsx)(L,{className:"tw:flex tw:items-center tw:justify-center",children:Oe}),!ee&&(0,l.jsx)(R,{})]})]}),"read-only"!==X&&(a||!oe)&&(0,l.jsx)(Yl,{searchInputValue:U,setSearchInputValue:H,handleSearch:F,isActivelyStreaming:x,conversationHistoryLength:g.length,onTrackAccessPoint:D,onStop:A,widgetId:a?"concierge-panel-conversation-chat-input":"concierge-conversation-chat-input",displayName:a?"Chat Input (Panel Conversation)":"Chat Input (Conversation)",presets:a?d.gR:void 0,forceMobile:a,initialState:Xl({preset:"compact"},a?d.gR.compact:d.XI.compact),liveTakeoverActive:ke,adminName:we.adminName,adminAvatarUrl:we.adminAvatarUrl,onEndLiveAgent:Ee})]})]})})};return a?(0,l.jsx)(d.Y_,{widgetId:"concierge-panel",displayName:"Concierge Panel",suggestionListWidgetId:"concierge-suggestion-list",chatInputWidgetId:"concierge-panel-chat-input",suppressChildEdits:!1,children:(e,t)=>Ve(e,t)}):Ve(Ie,Pe)},es=(0,r.memo)($l),ts=["gpt-5.2","gpt-4o","gpt-4o-mini","gpt-4.1-mini"],ns=["gpt-4o-mini","gpt-4.1-mini","gpt-4o","gpt-5.2"],rs=["","gpt-4o-mini","gpt-4.1-mini","gpt-4o","gpt-5.2"],os=["","gpt-4o-mini","gpt-4.1-mini","gpt-4o","gpt-5.2"],is=e=>{let{label:t,value:n,onLabel:r,offLabel:o,onToggle:i,disabled:a}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",opacity:a?.4:1},children:[(0,l.jsxs)("span",{style:{color:"#555",fontWeight:500},children:[t,":"]}),[!0,!1].map(e=>(0,l.jsx)("button",{onClick:()=>!a&&i(e),disabled:a,style:{padding:"4px 14px",borderRadius:"6px",border:"1px solid",borderColor:n===e?"#2563eb":"#d1d5db",backgroundColor:n===e?"#eff6ff":"transparent",color:n===e?"#2563eb":"#6b7280",cursor:a?"not-allowed":"pointer",fontSize:"13px",fontWeight:n===e?600:400},children:e?r:o},String(e)))]})},as=e=>{let{label:t,value:n,onChange:r,min:o=1,max:i=999,step:a=1,width:s="72px",disabled:c}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",opacity:c?.4:1},children:[(0,l.jsxs)("span",{style:{color:"#555",fontWeight:500},children:[t,":"]}),(0,l.jsx)("input",{type:"number",value:n,onChange:e=>{const t=a<1?parseFloat(e.target.value):parseInt(e.target.value);isNaN(t)||r(Math.max(o,Math.min(i,t)))},disabled:c,step:a,style:{width:s,padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px",textAlign:"center",cursor:c?"not-allowed":"text"}})]})},ls=e=>{let{label:t,value:n,options:r,onChange:o,disabled:i}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px",opacity:i?.4:1},children:[(0,l.jsxs)("span",{style:{color:"#555",fontWeight:500},children:[t,":"]}),r.map(e=>(0,l.jsx)("button",{onClick:()=>!i&&o(e.value),disabled:i,style:{padding:"4px 14px",borderRadius:"6px",border:"1px solid",borderColor:n===e.value?"#2563eb":"#d1d5db",backgroundColor:n===e.value?"#eff6ff":"transparent",color:n===e.value?"#2563eb":"#6b7280",cursor:i?"not-allowed":"pointer",fontSize:"13px",fontWeight:n===e.value?600:4
100},children:e.label},e.value))]})},ss=e=>{let{label:t,value:n,options:r,onChange:o}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsxs)("span",{style:{color:"#555",fontWeight:500},children:[t,":"]}),(0,l.jsx)("select",{value:n,onChange:e=>o(e.target.value),style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px",cursor:"pointer",background:"white"},children:r.map(e=>(0,l.jsx)("option",{value:e,children:e},e))})]})},cs=e=>{let{isDevMode:t,devOptionsExpanded:n,setDevOptionsExpanded:r,useTextRecall:o,setUseTextRecall:i,pageSize:a,setPageSize:s,rankingWeights:c,handleWeightChange:d,useTargetedSectionTitles:u,setUseTargetedSectionTitles:p,useTwoPhaseFiltering:g,setUseTwoPhaseFiltering:f,useOutlierFiltering:h,setUseOutlierFiltering:m,ignoreRatings:v,setIgnoreRatings:y,ratingThreshold:x,setRatingThreshold:b,llmModel:w,setLlmModel:A,llmModelLight:C,setLlmModelLight:j,searchTemperature:S,setSearchTemperature:k,maxPerBrand:O,setMaxPerBrand:I,maxProductsForLLM:P,setMaxProductsForLLM:E,numSearchAngles:V,setNumSearchAngles:F,targetCategories:B,setTargetCategories:L,semanticThreshold:R,setSemanticThreshold:T,productsPerSection:M,setProductsPerSection:D,productsBuffer:N,setProductsBuffer:z,angleStrategy:W,setAngleStrategy:U,availabilityFilter:H,setAvailabilityFilter:Q,useOriginalQueryReranking:Z,setUseOriginalQueryReranking:q,recatModel:Y,setRecatModel:K,analyzeModel:G,setAnalyzeModel:J,planModel:X,setPlanModel:_,promptLabel:$,setPromptLabel:ee}=e;return t?(0,l.jsxs)("div",{style:{borderBottom:"1px solid #e5e7eb",flexShrink:0},children:[(0,l.jsxs)("button",{onClick:()=>r(e=>!e),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 16px",background:"#fefce8",border:"none",cursor:"pointer",fontSize:"13px",color:"#92400e",fontWeight:500},children:[(0,l.jsx)("span",{children:"Dev Options"}),(0,l.jsx)("span",{style:{fontSize:"12px"},children:n?"â²":"â¼"})]}),n&&(0,l.jsxs)("div",{style:{padding:"12px 16px",fontSize:"13px",color:"#555",display:"flex",flexDirection:"column",gap:"14px",background:"#fffef5"},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[(0,l.jsx)(is,{label:"Recall",value:o,onLabel:"Text",offLabel:"KNN",onToggle:i}),(0,l.jsx)(is,{label:"Sections",value:u,onLabel:"Targeted",offLabel:"Legacy",onToggle:p}),(0,l.jsx)(is,{label:"KNN",value:g,onLabel:"2-Phase",offLabel:"PostFilter",onToggle:f}),(0,l.jsx)(is,{label:"Outlier Filter",value:h,onLabel:"On",offLabel:"Off",onToggle:m}),(0,l.jsx)(is,{label:"Ratings",value:v,onLabel:"Ignore",offLabel:"Filter",onToggle:y}),(0,l.jsx)(ls,{label:"Search Angles",value:W,options:[{value:"brand",label:"Brand"},{value:"generic",label:"Generic"},{value:"auto",label:"Auto"}],onChange:e=>U(e)}),(0,l.jsx)(is,{label:"Rerank",value:Z,onLabel:"On",offLabel:"Off",onToggle:q}),(0,l.jsx)(ls,{label:"Availability",value:H,options:[{value:"apply",label:"Apply"},{value:"skipFalse",label:"Skip False"},{value:"skipAll",label:"Skip All"}],onChange:e=>Q(e)})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[(0,l.jsx)(ss,{label:"LLM (heavy)",value:w,options:ts,onChange:A}),(0,l.jsx)(ss,{label:"LLM (light)",value:C,options:ns,onChange:j}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)("span",{style:{color:"#555",fontWeight:500},children:"Recat:"}),(0,l.jsx)("select",{value:Y,onChange:e=>K(e.target.value),style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px",cursor:"pointer",background:"white"},children:rs.map(e=>(0,l.jsx)("option",{value:e,children:e||"(same as heavy)"},e))})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)("span",{style:{color:"#555",fontWeight:500},children:"Analyze:"}),(0,l.jsx)("select",{value:G,onChange:e=>J(e.target.value),style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px",cursor:"pointer",background:"white"},children:os.map(e=>(0,l.jsx)("option",{value:e,children:e||"(same as light)"},e))})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)("span",{style:{color:"#555",fontWeight:500},children:"Plan:"}),(0,l.jsx)("select",{value:X,onChange:e=>_(e.target.value),style:{padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px",cursor:"pointer",background:"white"},children:os.map(e=>(0,l.jsx)("option",{value:e,children:e||"(same as light)"},e))})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,l.jsx)("span",{style:{color:"#555",fontWeight:500},children:"Prompt:"}),(0,l.jsx)("input",{type:"text",value:$,onChange:e=>ee(e.target.value),placeholder:"production",style:{width:"120px",padding:"4px 8px",borderRadius:"6px",border:"1px solid #d1d5db",fontSize:"13px"}})]})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[(0,l.jsx)(as,{label:"Angles",value:V,onChange:F,min:1,max:12}
1),(0,l.jsx)(as,{label:"Categories",value:B,onChange:L,min:1,max:10}),(0,l.jsx)(as,{label:"Max/brand",value:O,onChange:I,min:1,max:20}),(0,l.jsx)(as,{label:"Max LLM",value:P,onChange:E,min:10,max:200}),(0,l.jsx)(as,{label:"Page size",value:a,onChange:s,min:1,max:200})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"24px",flexWrap:"wrap"},children:[(0,l.jsx)(as,{label:"Per section",value:M,onChange:D,min:1,max:50}),(0,l.jsx)(as,{label:"Buffer",value:N,onChange:z,min:1,max:50,disabled:!h}),(0,l.jsx)(as,{label:"Rating min",value:x,onChange:b,min:0,max:5,step:.1,width:"72px",disabled:v}),(0,l.jsx)(as,{label:"Temp",value:S,onChange:k,min:0,max:1,step:.1,width:"72px"}),(0,l.jsx)(as,{label:"Semantic",value:R,onChange:T,min:0,max:1,step:.05,width:"72px"})]}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"8px"},children:[(0,l.jsxs)("span",{style:{color:"#555",fontWeight:500},children:["Ranking weights"," ",(0,l.jsxs)("span",{style:{fontWeight:400,color:"#999"},children:["(total: ",Object.values(c).reduce((e,t)=>e+t,0).toFixed(2),")"]})]}),Object.keys(c).map(e=>(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[(0,l.jsx)("span",{style:{minWidth:"70px",color:"#666",fontSize:"13px"},children:e.replace("Weight","")}),(0,l.jsx)("input",{type:"range",min:"0",max:"1",step:"0.01",value:c[e],onChange:t=>d(e,parseFloat(t.target.value)),style:{flex:1,accentColor:"#2563eb",cursor:"pointer"}}),(0,l.jsx)("span",{style:{minWidth:"36px",textAlign:"right",fontSize:"13px",color:"#444",fontVariantNumeric:"tabular-nums"},children:c[e].toFixed(2)})]},e))]})]})]}):null};function ds(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function us(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ds(Object(n),!0).forEach(function(t){ps(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ds(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ps(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const gs=e=>{var t;let{pageContext:n,product:r,isLoading:o=!1}=e;const{themeColors:i}=(0,d.FG)(),{themeFonts:a}=(0,d.vl)(),s=i.textPrimary||"#1F2937",c=function(e,t){const n=t["studio-brand-font"];if(n)return"system"===n.format?n.url:'"'.concat(n.name,'", sans-serif')}(0,a);if("pdp"!==(null==n?void 0:n.pageType)||!(null==n?void 0:n.stacklineSku))return null;const u=n.stacklineSku,{src:p}=(0,xr.le)(null!=r?r:{stacklineSku:u}),g=null==r?void 0:r.title;return null!==(t=null==r?void 0:r.reviewsRating)&&void 0!==t||null==r||r.reviewsAverageRating,null==r||r.reviewsCount,o?(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"8px 16px",backgroundColor:"#ffffff",borderBottom:"1px solid #f3f3f3",borderRadius:"10px 10px 0 0",boxShadow:"8px 8px 14px 0px rgba(0, 0, 0, 0.03)"},children:[(0,l.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",backgroundColor:"#f3f4f6",flexShrink:0}}),(0,l.jsxs)("div",{style:{flex:1,display:"flex",flexDirection:"column",gap:"6px"},children:[(0,l.jsx)("div",{style:{height:"14px",width:"70%",borderRadius:"4px",backgroundColor:"#f3f4f6"}}),(0,l.jsx)("div",{style:{height:"12px",width:"40%",borderRadius:"4px",backgroundColor:"#f3f4f6"}})]})]}):(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"12px",padding:"8px 16px",backgroundColor:"#ffffff",borderBottom:"1px solid #f3f3f3",borderRadius:"10px 10px 0 0",boxShadow:"8px 8px 14px 0px rgba(0, 0, 0, 0.03)",fontFamily:c},children:[(0,l.jsx)("div",{style:{width:"48px",height:"48px",borderRadius:"6px",overflow:"hidden",backgroundColor:"#ffffff",flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)("img",{src:p,alt:g||"Product",style:{width:"100%",height:"100%",objectFit:"contain"},onError:e=>{e.target.style.display="none"}})}),(0,l.jsxs)("div",{style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:"2px"},children:[g?(0,l.jsx)("span",{style:{fontSize:"14px",fontWeight:600,color:s,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",lineHeight:"24px"},title:g,children:g}):(0,l.jsx)("span",{style:{fontSize:"14px",fontWeight:600,color:s,lineHeight:"24px"},children:"This product"}),!1]})]})};var fs=n(62595),hs=n(2639);function ms(){if("undefined"==typeof window)return"desktop";const e=window.innerWidth;return e<768?"mobile":e<1024?"tablet":"desktop"}function vs(e){return"/"===e||""===e?"Homepage":e.includes("/pdp/")||e.includes("/p/")?"Product Detail Page":e.includes("/brand/")?"Brand Page":e.includes("/search")?"Search Results":e.includes("/category/")?"Category Page":e.includes("/brandclub")?"Brandclub Page":"Other"}function ys(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:200;return e.length<=t?e:e.substring(0,t)+"..."}function xs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function bs(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?xs(Object(n),!0).forEach(function(t){ws(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ws(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var As=n(3383);function Cs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function js(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cs(Object(n),!0).forEach(function(t){Ss(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cs(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ss(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ks="[useConciergeChat]";function Os(e){if(!e)return"";const t=e.replace(/\s+/g," ").trim();return t.length<=80?t:"".concat(t.slice(0,80),"â¦")}function Is(){return"msg-".concat(Date.now(),"-").concat(Math.random().toString(36).substring(2,9))}function Ps(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Es(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ps(Object(n),!0).forEach(function(t){Vs(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ps(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vs(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fs=new(n(41212).A);function Bs(e){return"".concat("bc_concierge_agreement_").concat(e||"default")}function Ls(e,t){Fs.set(Bs(e),t,{path:"/",maxAge:31536e3,sameSite:"lax"})}async function Rs(e){let{apiBaseUrl:t,appIdV2:n,version:r}=e;if(t)try{const e=await(0,f.fk)();await fetch("".concat(t,"/api-rewards/concierge/agreement/accept"),{method:"POST",headers:Es(Es({},e),{},{"Content-Type":"application/json"}),body:JSON.stringify({appIdV2:n,version:r})})}catch(e){console.warn("[ConciergeAgreementGate] failed to record acceptance to DB",e)}}function Ts(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ms(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Ts(Object(n),!0).forEach(function(t){Ds(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ts(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Ds(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Ns={termsOfUse:"Terms of Use",privacyPolicy:"Privacy Policy",consumerHealth:"Consumer Health Data Privacy Policy",contactEmail:""},zs=/\{(termsOfUse|privacyPolicy|consumerHealth|contactEmail)\}/g;function Ws(e,t){switch(e){case"termsOfUse":return t.termsOfUseUrl||null;case"privacyPolicy":return t.privacyPolicyUrl||null;case"consumerHealth":return t.consumerHealthUrl||null;case"contactEmail":return t.contactEmail?"mailto:".concat(t.contactEmail):null;default:return null}}function Us(e,t){return"contactEmail"===e?t.contactEmail||"{".concat(e,"}"):Ns[e]||"{".concat(e,"}")}function Hs(e,t,n){const r=[];let o,i=0,a=0;for(zs.lastIndex=0;null!==(o=zs.exec(e));){o.index>i&&r.push(e.slice(i,o.index));const s=o[1],c=Ws(s,t),d=Us(s,t);if(c){const e=c.startsWith("mailto:");r.push((0,l.jsx)("a",{href:c,target:e?void 0:"_blank",rel:e?void 0:"noopener noreferrer",style:{color:n,textDecoration:"underline"},children:d},"tok-".concat(a++)))}else r.push(o[0]);i=o.index+o[0].length}return i<e.length&&r.push(e.slice(i)),r}function Qs(e,t,n,r){return e.split(/\n\s*\n/).map((e,o)=>(0,l.jsx)("p",{style:{margin:"0 0 12px",fontSize:15,lineHeight:"22px",color:n,whiteSpace:"pre-wrap"},children:Hs(e,t,r)},"p-".concat(o)))}
1const Zs=e=>{let{buttonLabel:t,primaryColor:n,buttonTextColor:r,onAgree:o}=e;return(0,l.jsx)("button",{type:"button",onClick:o,style:{width:"100%",padding:"14px 16px",background:n,color:r,border:"none",borderRadius:4,fontSize:15,fontWeight:500,cursor:"pointer"},children:t})},qs=e=>{let{text:t,primaryColor:n,buttonTextColor:r}=e;return(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end"},children:(0,l.jsx)("div",{style:{maxWidth:"80%",background:n,color:r,borderRadius:20,padding:"10px 16px",fontSize:15,lineHeight:"22px",wordBreak:"break-word"},children:t})})},Ys=e=>{let{agreement:t,pendingUserPrompt:n,buttonLabel:o,textColor:i,primaryColor:a,buttonTextColor:s,linkColor:c,onAgree:d}=e;const u=(0,r.useMemo)(()=>Qs(t.body||"",t,i,c),[t,i,c]);return(0,l.jsx)("div",{role:"region","aria-label":t.title||"Agreement",style:{position:"absolute",inset:0,zIndex:60,display:"flex",flexDirection:"column",justifyContent:"flex-end",background:"rgba(255,255,255,0.96)"},children:(0,l.jsxs)("div",{style:{padding:"24px 20px 20px",maxWidth:720,width:"100%",margin:"0 auto",maxHeight:"100%",overflowY:"auto",display:"flex",flexDirection:"column",gap:16},children:[n?(0,l.jsx)(qs,{text:n,primaryColor:a,buttonTextColor:s}):null,(0,l.jsxs)("div",{children:[t.title?(0,l.jsx)("p",{style:{margin:"0 0 8px",fontSize:15,lineHeight:"22px",fontWeight:600,color:i},children:t.title}):null,u]}),(0,l.jsx)(Zs,{buttonLabel:o,primaryColor:a,buttonTextColor:s,onAgree:d})]})})},Ks=e=>{let{agreement:t,buttonLabel:n,textColor:o,primaryColor:i,buttonTextColor:a,linkColor:s,onAgree:c}=e;const d=(0,r.useMemo)(()=>Qs(t.body||"",t,o,s),[t,o,s]);return(0,l.jsx)("div",{role:"dialog","aria-modal":"true","aria-label":t.title||"Agreement",style:{position:"absolute",inset:0,zIndex:60,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.4)",padding:16},children:(0,l.jsxs)("div",{style:{background:"#fff",borderRadius:12,padding:24,maxWidth:480,width:"100%",maxHeight:"100%",overflowY:"auto",boxShadow:"0 12px 32px rgba(0,0,0,0.2)",display:"flex",flexDirection:"column",gap:16},children:[t.title?(0,l.jsx)("h2",{style:{margin:0,fontSize:18,lineHeight:"24px",fontWeight:700,color:o,textAlign:"center"},children:t.title}):null,(0,l.jsx)("div",{children:d}),(0,l.jsx)(Zs,{buttonLabel:n,primaryColor:i,buttonTextColor:a,onAgree:c})]})})},Gs=e=>{let{agreement:t,buttonLabel:n,textColor:o,primaryColor:i,buttonTextColor:a,linkColor:s,onAgree:c}=e;const[d,u]=(0,r.useState)(!1),p=(0,r.useMemo)(()=>Qs(t.body||"",t,o,s),[t,o,s]),g=t.title||"Please review and accept to continue.";return(0,l.jsx)("div",{role:"region","aria-label":t.title||"Agreement",style:{position:"absolute",left:0,right:0,bottom:0,zIndex:60,background:"#fff",borderTop:"1px solid rgba(0,0,0,0.08)",boxShadow:"0 -4px 16px rgba(0,0,0,0.08)",padding:"12px 16px",maxHeight:"60%",overflowY:"auto"},children:(0,l.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",display:"flex",flexDirection:"column",gap:8},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12},children:[(0,l.jsx)("div",{style:{flex:1,fontSize:14,lineHeight:"20px",color:o,fontWeight:600},children:g}),(0,l.jsx)("button",{type:"button",onClick:()=>u(e=>!e),style:{background:"transparent",border:"none",color:s,fontSize:13,cursor:"pointer",padding:"4px 8px",textDecoration:"underline"},children:d?"Hide":"Read more"}),(0,l.jsx)("button",{type:"button",onClick:c,style:{padding:"8px 16px",background:i,color:a,border:"none",borderRadius:4,fontSize:14,fontWeight:500,cursor:"pointer",whiteSpace:"nowrap"},children:n})]}),d?(0,l.jsx)("div",{children:p}):null]})})},Js=e=>{let{agreement:t,textColor:n,linkColor:o,onAgree:i}=e;const a=(0,r.useMemo)(()=>Qs(t.body||"",t,n,o),[t,n,o]);return(0,l.jsx)("div",{role:"region","aria-label":t.title||"Agreement",style:{position:"absolute",left:0,right:0,bottom:0,zIndex:60,background:"#fff",borderTop:"1px solid rgba(0,0,0,0.08)",boxShadow:"0 -4px 16px rgba(0,0,0,0.08)",padding:"12px 16px",maxHeight:"60%",overflowY:"auto"},children:(0,l.jsx)("div",{style:{maxWidth:720,margin:"0 auto",display:"flex",flexDirection:"column",gap:8},children:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"flex-start",ga
1p:12},children:[(0,l.jsxs)("div",{style:{flex:1,minWidth:0},children:[t.title?(0,l.jsx)("div",{style:{fontSize:14,lineHeight:"20px",color:n,fontWeight:600,marginBottom:4},children:t.title}):null,(0,l.jsx)("div",{children:a})]}),(0,l.jsx)("button",{type:"button",onClick:i,style:{background:"transparent",border:"none",color:o,fontSize:13,cursor:"pointer",padding:"4px 8px",textDecoration:"underline",whiteSpace:"nowrap",flexShrink:0},children:"Close"})]})})})},Xs=e=>{let{agreement:t,pendingUserPrompt:n,themeColors:r,onAgree:o}=e;const i=t.agreeButtonLabel||"I agree",a=(null==r?void 0:r.textPrimary)||"#111827",s=(null==r?void 0:r.primary)||"#000",c=(null==r?void 0:r.buttonText)||"#fff",d=t.template||"inline",u={agreement:t,pendingUserPrompt:n,buttonLabel:i,textColor:a,primaryColor:s,buttonTextColor:c,linkColor:"#0E7490",onAgree:o};return"centered-modal"===d?(0,l.jsx)(Ks,Ms({},u)):"bottom-banner"===d?(0,l.jsx)(Gs,Ms({},u)):"auto-accept"===d?(0,l.jsx)(Js,Ms({},u)):(0,l.jsx)(Ys,Ms({},u))};function _s(e){let t,{track:n,stream:r,codec:o,presignedUrl:i}=e;try{t=new MediaRecorder(r,{mimeType:o.mime,audioBitsPerSecond:32e3})}catch(e){return console.warn("[voice-recorder] MediaRecorder construction failed",{track:n,err:e}),null}const a={track:n,recorder:t,chunks:[],recorderStartMs:Date.now(),mimeType:o.mime,stopped:!1,presignedUrl:i};t.addEventListener("dataavailable",e=>{e.data&&e.data.size>0&&a.chunks.push(e.data)}),t.addEventListener("error",e=>{console.warn("[voice-recorder] MediaRecorder error",{track:n,ev:e})});try{t.start()}catch(e){return console.warn("[voice-recorder] MediaRecorder.start failed",{track:n,err:e}),null}return a}async function $s(e,t,n,r){const o=n.current;if(!o||o.stopped)return;o.stopped=!0,n.current=null;try{"inactive"!==o.recorder.state&&o.recorder.stop()}catch(e){}if(await new Promise(e=>setTimeout(e,0)),0===o.chunks.length){const n=await(0,f.fk)().catch(()=>({}));return void await Un({apiBaseUrl:r,conversationId:t,track:e,durationMs:0,mimeType:o.mimeType,byteSize:0,uploadOk:!1,headersToInject:n})}const i=new Blob(o.chunks,{type:o.mimeType}),a=Math.max(0,Date.now()-o.recorderStartMs);let l=!1;try{const t=await fetch(o.presignedUrl,{method:"PUT",body:i,headers:{"Content-Type":o.mimeType}});l=t.ok,t.ok||console.warn("[voice-recorder] PUT failed",{track:e,status:t.status})}catch(t){console.warn("[voice-recorder] PUT threw",{track:e,err:t})}const s=await(0,f.fk)().catch(()=>({}));await Un({apiBaseUrl:r,conversationId:t,track:e,durationMs:a,mimeType:o.mimeType,byteSize:i.size,uploadOk:l,headersToInject:s})}const ec=5e3;function tc(e,t){let n=null;return e.forEach(e=>{e.type===t&&(e.kind&&"audio"!==e.kind||e.mediaType&&"audio"!==e.mediaType||(n={packetsLost:"number"==typeof e.packetsLost?e.packetsLost:void 0,packetsReceived:"number"==typeof e.packetsReceived?e.packetsReceived:void 0,jitterSec:"number"==typeof e.jitter?e.jitter:void 0,bytes:"number"==typeof e.bytesReceived?e.bytesReceived:"number"==typeof e.bytesSent?e.bytesSent:void 0,audioLevel:"number"==typeof e.audioLevel?e.audioLevel:void 0,ts:"number"==typeof e.timestamp?e.timestamp:Date.now()}))}),n}var nc=n(65122);function rc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function oc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?rc(Object(n),!0).forEach(function(t){ic(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):rc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ic(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ac="https://cdn.jsdelivr.net/npm/@ricky0123/vad-web@".concat("0.0.30","/dist/"),lc="https://cdn.jsdelivr.net/npm/onnxruntime-web@".concat("1.22.0","/dist/");class sc{constructor(){this.vad=null,this.deps=null,this.isDucked=!1,this.duckStartedAt=null,this.fadeRafId=null,this.started=!1}async start(e){if(this.started)return!0;
1if(this.deps=e,!e.getStream())return this.emitVadEvent("vad.init_failed",{reason:"no_stream"}),e.onInitFailed(),!1;try{return this.vad=await nc.Jl.new({baseAssetPath:ac,onnxWASMBasePath:lc,startOnLoad:!1,positiveSpeechThreshold:.55,negativeSpeechThreshold:.35,minSpeechMs:600,redemptionMs:600,getStream:async()=>{var e;const t=null==(e=this.deps)?void 0:e.getStream();if(!t)throw new Error("Voice barge-in mic stream unavailable");return t},pauseStream:async()=>{},resumeStream:async()=>{var e;const t=null==(e=this.deps)?void 0:e.getStream();if(!t)throw new Error("Voice barge-in mic stream unavailable");return t},onSpeechStart:()=>{this.handleSpeechStart()},onSpeechRealStart:()=>{this.handleSpeechRealStart()},onVADMisfire:()=>{this.handleVadMisfire()},onSpeechEnd:()=>{},onFrameProcessed:()=>{}}),await this.vad.start(),this.started=!0,!0}catch(t){return this.emitVadEvent("vad.init_failed",{reason:t instanceof Error?t.message:String(t)}),e.onInitFailed(),this.vad=null,!1}}async stop(){if(this.cancelVolumeFade(),this.restoreVolumeImmediate(),this.isDucked=!1,this.duckStartedAt=null,this.vad){try{await this.vad.pause(),await this.vad.destroy()}catch(e){}this.vad=null}this.deps=null,this.started=!1}shouldGateBargeIn(){const e=this.deps;return!!e&&(e.isAssistantAudible()||e.isResponseInFlight())}async handleSpeechStart(){var e,t,n,r;this.shouldGateBargeIn()&&(this.duckStartedAt=Date.now(),this.fadeVolumeTo(.5),this.isDucked=!0,this.emitVadEvent("vad.ducked",{duckVolume:.5,assistantAudible:null!==(e=null==(n=this.deps)?void 0:n.isAssistantAudible())&&void 0!==e&&e,responseInFlight:null!==(t=null==(r=this.deps)?void 0:r.isResponseInFlight())&&void 0!==t&&t}))}async handleSpeechRealStart(){var e,t;if(null==(t=null==(e=this.deps)?void 0:e.onConfirmedUserSpeech)||t.call(e),!this.shouldGateBargeIn())return void(this.isDucked&&(this.restoreVolumeImmediate(),this.isDucked=!1,this.duckStartedAt=null));const n=null!=this.duckStartedAt?Math.max(0,Date.now()-this.duckStartedAt):void 0;this.restoreVolumeImmediate(),this.isDucked=!1,this.duckStartedAt=null;const r=this.deps;if(!r)return;const o=r.isResponseInFlight();o&&r.sendDataChannel({type:"response.cancel"}),this.emitVadEvent("vad.confirmed_interrupt",{duckDurationMs:n,assistantAudible:r.isAssistantAudible(),responseInFlight:o,cancelSent:o})}async handleVadMisfire(){if(!this.isDucked)return;const e=null!=this.duckStartedAt?Math.max(0,Date.now()-this.duckStartedAt):void 0;this.restoreVolumeImmediate(),this.isDucked=!1,this.duckStartedAt=null,this.emitVadEvent("vad.misfire",{duckDurationMs:e,minSpeechMs:600})}fadeVolumeTo(e){var t;const n=null==(t=this.deps)?void 0:t.getAudioEl();if(!n)return;this.cancelVolumeFade();const r=n.volume,o=performance.now(),i=()=>{const t=performance.now()-o,a=Math.min(1,t/80);n.volume=r+(e-r)*a,a<1?this.fadeRafId=requestAnimationFrame(i):(this.fadeRafId=null,n.volume=e)};this.fadeRafId=requestAnimationFrame(i)}restoreVolumeImmediate(){var e;this.cancelVolumeFade();const t=null==(e=this.deps)?void 0:e.getAudioEl();t&&(t.volume=1)}cancelVolumeFade(){null!=this.fadeRafId&&(cancelAnimationFrame(this.fadeRafId),this.fadeRafId=null)}emitVadEvent(e,t){var n;const r=this.deps;r&&(null==(n=r.log)||n.call(r,e,t),zn({conversationId:r.conversationId,events:[oc({type:e,t:Date.now()},t)],headersToInject:r.getAuthHeaders()}))}}const cc=["tracing"];function dc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function uc(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?dc(Object(n),!0).forEach(function(t){pc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):dc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function pc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}async function gc(){try{return await(0,f.fk)()}catch(e){return{}}}const fc=6e3,hc=["The shopper just opened a voice call while we were chatting in text. The","prior conversation has been seeded into your context. This call is just",'BEGINNING â never say goodbye, "bye", or anything that ends the call, even',"if the prior conversation ended with a farewell. Do NOT call end_call now.","In ONE short sentence (max 20 words), acknowledge the resume and offer to","keep going. Do not greet by name. Do not list capabilities. Do not summarize","the prior conversation. Examples (tone, not literal):",'"Picking up where we left off â what would you like next?"','"Glad to hear from you â what can I do?"',"\"I'm here â what's the next thing?\""].join("\n"),mc=new Set(["end_call","prompt_login","submit_phone_for_login","submit_otp_for_login"]);function vc(e){const{conversationId:t,pdpStacklineSku:n,onEnded:o,onEndCallInitiated:i}=e,a=(0,Lt.AU)(),l=(0,r.useRef)(null==a?void 0:a.apiBaseUrl);l.current=null==a?void 0:a.apiBaseUrl;const[s,c]=(0,r.useState)("idle"),[d,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(0),[h,m]=(0,r.useState)([]),v=(0,r.useRef)([]);v.current=h;const[y,x]=(0,r.useState)(void 0),[b,w]=(0,r.useState)(void 0),A=(0,r.useRef)(null),[C,j]=(0,r.useState)(0),[S,k]=(0,r.useState)(!1),[O,I]=(0,r.useState)(!1),P=(0,r.useRef)(!1);P.current=O;const[E,V]=(0,r.useState)(!1),[F,B]=(0,r.useState)(0),[L,R]=(0,r.useState)(void 0),[T,M]=(0,r.useState)([]),D=(0,r.useRef)([]);D.current=T;const N=(0,r.useRef)(0),[z,W]=(0,r.useState)(void 0),U=(0,r.useRef)(void 0),H=(0,r.useRef)({}),[Q,Z]=(0,r.useState)(null),[q,Y]=(0,r.useState)(null),[K,G]=(0,r.useState)(null),[J,X]=(0,r.useState)(void 0),_=(0,r.useRef)(null),$=(0,r.useRef)(!1),ee=(0,r.useRef)(o);ee.current=o;const te=(0,r.useRef)(i);te.current=i;const ne=(0,r.useRef)({});(0,r.useEffect)(()=>{let e=!1;return gc().then(t=>{e||(ne.current=t)}),()=>{e=!0}},[]);const re=(0,r.useRef)(!1);re.current=d;const oe=(0,r.useRef)({}),ie=(0,r.useCallback)((e,t)=>{if(e&&"open"===e.readyState)try{e.send(JSON.stringify(t)),bc("BROWSER","string"==typeof(null==t?void 0:t.type)?t.type:"unknown",t)}catch(e){}},[]),ae=(0,r.useCallback)((e,t)=>{if(!e.dc||"open"!==e.dc.readyState)return;if(!e.responseInFlight)return void ie(e.dc,t);e.pendingResponseCreate&&clearTimeout(e.pendingResponseCreate.timer);const n=setTimeout(()=>{var r;(null==(r=e.pendingResponseCreate)?void 0:r.timer)===n&&(e.pendingResponseCreate=void 0,e.dc&&"open"===e.dc.readyState&&ie(e.dc,t))},6e3);e.pendingResponseCreate={payload:t,timer:n}},[ie]),le=(0,r.useCallback)((e,t,n)=>{const r=oe.current[e],o=r?r.id:"".concat(e,"-").concat(Date.now(),"-").concat(Math.floor(1e6*Math.random()));m(r=>{const i=r.findIndex(e=>e.id===o);if(i>=0){const e=r.slice();return e[i]=uc(uc({},e[i]),{},{text:t,partial:n.partial}),e}const a={id:o,role:e,text:t,partial:n.partial,createdAt:Date.now()};return[...r,a]}),n.partial?oe.current[e]={id:o,text:t}:oe.current[e]=void 0},[]),se=(0,r.useCallback)(async(e,n,r)=>{var o,i,a,s,d,u;if(e.closing)return;e.closing=!0,e.cancelled=!0,void 0!==U.current&&(clearTimeout(U.current),U.current=void 0),void 0!==e.pendingEndTimer&&(clearTimeout(e.pendingEndTimer),e.pendingEndTimer=void 0),e.pendingEndAfterMs=void 0,e.pendingEndReason=void 0,e.pendingResponseCreate&&(clearTimeout(e.pendingResponseCreate.timer),e.pendingResponseCreate=void 0),e.responseInFlight=!1,I(!1),void 0!==e.livenessTimer&&(clearTimeout(e.livenessTimer),e.livenessTimer=void 0);const p=e.bargeIn;e.bargeIn=void 0;try{e.heartbeat&&clearInterval(e.heartbeat),e.ticker&&clearInterval(e.ticker)}catch(e){}e.heartbeat=void 0,e.ticker=void 0;try{null==(o=e.eventSource)||o.close()}catch(e){}e.eventSource=void 0;try{null==(i=e.dc)||i.close()}catch(e){}e.dc=void 0;
1try{null==(a=e.pc)||a.getSenders().forEach(e=>{var t;try{null==(t=e.track)||t.stop()}catch(e){}}),null==(s=e.pc)||s.close()}catch(e){}e.pc=void 0;try{null==(d=e.stream)||d.getTracks().forEach(e=>e.stop())}catch(e){}e.stream=void 0,e.assistantStream=void 0;try{e.audioEl&&(e.audioEl.srcObject=null)}catch(e){}if(e.audioEl=void 0,_.current===e&&(_.current=null,Z(null),Y(null),G(null),X(void 0)),r.notifyOnEnded){c("ended");const t=null!=e.liveStartMs?Math.max(0,Math.round((Date.now()-e.liveStartMs)/1e3)):0;null==(u=ee.current)||u.call(ee,{reason:n,durationSec:t,lines:v.current,widgetEvents:D.current})}r.postEnd&&e.minted&&(A.current=(async e=>{let{conversationId:t,reason:n,headersToInject:r,apiBaseUrl:o=Bn()}=e;try{const e=await fetch("".concat(o,"/api-rewards/concierge/voice/end"),{method:"POST",headers:Vn(Vn({},r),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,reason:n}),keepalive:!0});return e.ok?await e.json():null}catch(e){return null}})({apiBaseUrl:l.current,conversationId:t,reason:n,headersToInject:ne.current}).catch(()=>{})),null==p||p.stop().catch(()=>{})},[t]),ce=(0,r.useCallback)(e=>{if(e.cancelled||e.closing)return;const n=Date.now()-e.lastServerEventAt,r={conversationId:t,reachedLive:e.reachedLive,minted:e.minted,sinceLastServerEventMs:n,livenessTimeoutMs:fc};bc("BROWSER","session declared dead (D-93 liveness watchdog)",r),zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"webrtc.session_dropped_detected",payload:r,t:Date.now()}],headersToInject:ne.current}),w("Voice session timed out"),x("Your voice chat stopped responding. Reconnect to pick up where you left off, or head back to start a new chat."),se(e,"session_dropped",{postEnd:e.minted,notifyOnEnded:!1}),c("error")},[t,se]),de=(0,r.useCallback)(e=>{if(e.cancelled||e.closing)return;void 0!==e.livenessTimer&&clearTimeout(e.livenessTimer);const t=Date.now();e.livenessTimer=setTimeout(()=>{e.livenessTimer=void 0,e.cancelled||e.closing||e.lastServerEventAt<t&&ce(e)},fc)},[ce]);(0,r.useEffect)(()=>{if(!t)return;const e={cancelled:!1,minted:!1,reachedLive:!1,closing:!1,responseInFlight:!1,responseIdAtItemSpeechStart:new Map,suppressedResponseIds:new Set,lastServerEventAt:Date.now()};_.current=e;const r=t=>{if(e.cancelled)return!0;const n=t instanceof Error?t.message:String(null!=t?t:"Voice mode failed");return w("Voice mode unavailable"),x(n),c("error"),se(e,"error",{postEnd:e.minted,notifyOnEnded:!1}),!0},o=async n=>{var r,o;let i=n.arguments;try{i="string"==typeof n.arguments?JSON.parse(n.arguments):n.arguments}catch(e){}if("end_call"===n.name){if(bc("BROWSER","tool request - ".concat(n.name," (async)"),{conversationId:t,callId:n.call_id,args:i}),Wn({apiBaseUrl:l.current,conversationId:t,callId:n.call_id,toolName:n.name,args:n.arguments,headersToInject:ne.current}).then(e=>{bc("BACKEND","tool response - ".concat(n.name," (async)"),e)}).catch(e=>{bc("BACKEND","tool response - ".concat(n.name," (async)"),{status:"error",error:e instanceof Error?e.message:String(e)})}),e.closing||e.cancelled)return;null==(r=te.current)||r.call(te),c("ending");try{null==(o=e.stream)||o.getAudioTracks().forEach(e=>e.enabled=!1)}catch(e){}return void 0!==e.pendingEndTimer&&clearTimeout(e.pendingEndTimer),void(e.pendingEndTimer=setTimeout(()=>{e.pendingEndTimer=void 0,e.cancelled||e.closing||se(e,"ended_by_model",{postEnd:!0,notifyOnEnded:!0})},2e3))}bc("BROWSER","tool request - ".concat(n.name),{conversationId:t,callId:n.call_id,args:i});const a=!mc.has(n.name);a&&B(e=>e+1);try{var s;const r=await Wn({apiBaseUrl:l.current,conversationId:t,callId:n.call_id,toolName:n.name,args:n.arguments,headersToInject:ne.current});if(bc("BACKEND","tool response - ".concat(n.name),r),"number"==typeof r.endCallAfterMs&&r.endCallAfterMs>0&&(e.pendingEndAfterMs=r.endCallAfterMs,e.pendingEndReason="string"==typeof r.endCallReason&&r.endCallReason.length>0?r.endCallReason:void 0),Array.isArray(r.widgets)&&r.widgets.length>0){for(const e of r.widgets){const t="data-widget-".concat(e.type);if(R({type:t,data:e.data}),"clear"!==e.type){const n=++N.current,r={id:"".concat(t,":").concat(n),type:t,data:e.data,createdAt:Date.now()};M(e=>[...e,r])}if("prompt-login"===e.type&&!H.current.loginGateMs){const e="prompt_login"===n.name;H.current={loginGateMs:Date.now(),blockedToolName:e?void 0:n.name}}}void 0!==U.current&&(clearTimeout(U.current),U.current=void 0),W(void 0)}let o;ie(e.dc,{type:"conversation.item.create",item:{type:"function_call_output",call_id:n.call_id,output:null!==(s=r.narratorText)&&void 0!==s?s:""}});try{o="string"==typeof n.arguments?JSON.parse(n.arguments):n.arguments}catch(e){o=void 0}const i="submit_otp_for_login"===n.name&&!0===(null==o?void 0:o.confirmed);ae(e,i?{type:"response.create",response:{instructions:"Say ONLY 'One moment â verifying that codeâ¦' (or a brief equivalent, ⤠6 words) and then STOP. Do NOT call any tools. Do NOT speak further until a system instruction tells you the user is signed in.",tool_choice:"none"}}:{type:"response.create"})}catch(t){bc("BACKEND","tool response - ".concat(n.name),{status:"error",error:t instanceof Error?t.message:String(t)}),console.warn("[voice] tool proxy failed",t),ie(e.dc,{type:"conversation.item.create",item:{type:"function_call_output",call_id:n.call_id,output:"Tool unavailable. Apologize and offer an alternative."}}),ae(e,{type:"response.create"})}finally{a&&B(e=>Math.max(0,e-1))}},i=new Set(["session.created","session.updated","response.created","response.done","conversation.item.input_audio_transcription.completed","response.audio_transcript.done","response.output_audio_transcript.done","output_audio_buffer.started","output_audio_buffer.stopped","input_audio_buffer.speech_started","input_audio_buffer.speech_stopped","error"]);return(async()=>{var a,s,d;let u;c("requesting-permission");try{u=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!1}})}catch(t){if(e.cancelled)return;const n=function(e){switch(e instanceof Error?e.name:""){case"NotAllowedError":case"SecurityError":return{title:"Microphone access needed",body:"Voice mode needs your microphone. Allow microphone access for this site in your browser settings, then try again."};case"NotFoundError":case"OverconstrainedError":return{title:"No microphone found",body:"We couldn't find a microphone. Connect one, then try again."};case"NotReadableError":case"AbortError":return{title:"Microphone unavailable",body:"Your microphone is unavailable â it may be in use by another app. Close anything else using it, then try again."};default:return{title:"Microphone unavailable",body:"We couldn't start your microphone. Please try again."}}}(t);return w(n.title),x(n.body),void c("error")}
1if(e.cancelled)return void u.getTracks().forEach(e=>e.stop());e.stream=u,c("connecting");const p=new RTCPeerConnection;e.pc=p;const f=()=>{if(e.cancelled)return;const n=p.connectionState;"connected"!==n||e.webrtcConnectedEmitted||(e.webrtcConnectedEmitted=!0,zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"webrtc.connected",t:Date.now()}],headersToInject:ne.current})),"failed"!==n&&"closed"!==n&&"disconnected"!==n||se(e,"webrtc_drop",{postEnd:!0,notifyOnEnded:!0})};p.addEventListener("connectionstatechange",f),"connected"===p.connectionState&&f();const h=document.createElement("audio");h.autoplay=!0,e.audioEl=h,p.ontrack=n=>{var r,o,i;if(e.cancelled)return;h.srcObject=n.streams[0];const a=null!==(r=null==(i=null==(o=n.streams[0])?void 0:o.getAudioTracks)?void 0:i.call(o))&&void 0!==r?r:[];if(a.length>0&&!e.assistantStream)try{const t=new MediaStream;t.addTrack(a[0]),e.assistantStream=t,e.reachedLive&&G(t)}catch(t){e.assistantStream=n.streams[0],e.reachedLive&&G(n.streams[0])}e.firstAudioEmitted||(e.firstAudioEmitted=!0,zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"webrtc.first_audio",t:Date.now()}],headersToInject:ne.current}))},u.getTracks().forEach(e=>p.addTrack(e,u));const v=p.createDataChannel("oai-events");e.dc=v,v.addEventListener("message",n=>{try{const r=JSON.parse(n.data);bc("OPENAI","string"==typeof(null==r?void 0:r.type)?r.type:"unknown",r),(async n=>{var r,a,s,c,d,u,p;if(n&&"object"==typeof n&&"string"==typeof n.type&&!e.cancelled&&!$.current)switch(e.lastServerEventAt=Date.now(),i.has(n.type)&&zn({apiBaseUrl:l.current,conversationId:t,events:[n],headersToInject:ne.current}),n.type){case"input_audio_buffer.speech_started":V(!0),"string"==typeof n.item_id&&e.responseIdAtItemSpeechStart.set(n.item_id,e.activeResponseId),void 0!==e.pendingEndTimer&&(clearTimeout(e.pendingEndTimer),e.pendingEndTimer=void 0),e.pendingEndAfterMs=void 0,e.pendingEndReason=void 0;break;case"input_audio_buffer.speech_stopped":V(!1);break;case"output_audio_buffer.started":I(!0);break;case"output_audio_buffer.stopped":I(!1);break;case"response.created":if(k(!0),e.responseInFlight=!0,e.activeResponseId="string"==typeof(null==(r=n.response)?void 0:r.id)?n.response.id:void 0,oe.current.assistant){const e=oe.current.assistant;le("assistant",e.text,{partial:!1})}break;case"response.done":{var g;k(!1),e.responseInFlight=!1,e.activeResponseId=void 0;const t=e.pendingResponseCreate;t&&"open"===(null==(a=e.dc)?void 0:a.readyState)&&(clearTimeout(t.timer),e.pendingResponseCreate=void 0,ie(e.dc,t.payload));const r=null==(s=n.response)?void 0:s.status;if(r&&"completed"!==r&&oe.current.assistant){const e=oe.current.assistant;le("assistant",e.text,{partial:!1})}r&&"completed"!==r&&I(!1);const i="string"==typeof(null==(c=n.response)?void 0:c.id)?n.response.id:void 0;if(i&&e.suppressedResponseIds.has(i)){e.suppressedResponseIds.delete(i);break}const l=(null!==(g=null==(d=n.response)?void 0:d.output)&&void 0!==g?g:[]).filter(e=>"function_call"===(null==e?void 0:e.type));for(const e of l)await o(e);if(void 0!==e.pendingEndAfterMs&&e.pendingEndAfterMs>0&&0===l.length){var f;const t=e.pendingEndAfterMs,n=null!==(f=e.pendingEndReason)&&void 0!==f?f:"call_ended_by_tool";e.pendingEndAfterMs=void 0,e.pendingEndReason=void 0,e.pendingEndTimer=setTimeout(()=>{e.pendingEndTimer=void 0,e.cancelled||e.closing||se(e,n,{postEnd:!0,notifyOnEnded:!0})},t)}break}case"conversation.item.input_audio_transcription.delta":if("string"==typeof n.delta){var h;const e=null!==(h=null==(u=oe.current.user)?void 0:u.text)&&void 0!==h?h:"";le("user",e+n.delta,{partial:!0})}break;case"conversation.item.input_audio_transcription.completed":{const t=("string"==typeof n.transcript?n.transcript:"").trim();if(!t){const t="string"==typeof n.item_id?n.item_id:void 0,r=t?e.responseIdAtItemSpeechStart.get(t):void 0;t&&e.responseIdAtItemSpeechStart.delete(t);const o=e.activeResponseId;!!o&&o!==r&&o&&(ie(e.dc,{type:"response.cancel"}),e.suppressedResponseIds.add(o)),oe.current.user&&(m(e=>e.filter(e=>e.id!==oe.current.user.id)),oe.current.user=void 0);break}le("user",t,{partial:!1});break}case"response.audio_transcript.delta":case"response.output_audio_transcript.delta":if("string"==typeof n.delta){var v;const e=null!==(v=null==(p=oe.current.assistant)?void 0:p.text)&&void 0!==v?v:"";le("assistant",e+n.delta,{partial:!0})}break;case"response.audio_transcript.done":case"response.output_audio_transcript.done":"string"==typeof n.transcript&&le("assistant",n.transcript,{partial:!1});break;case"error":{let e="";try{e=JSON.stringify(n)}catch(t){e=String(n)}console.warn("[voice] OpenAI error event",e,n);break}}})(r)}catch(e){}});const y=()=>{e.cancelled||e.closing||ce(e)};v.addEventListener("close",y),v.addEventListener("error",y);try{ne.current=await gc()}catch(e){}let b,A;bc("BROWSER","session request",{conversationId:t,pdpStacklineSku:n}
1);try{b=await(async e=>{let{conversationId:t,pdpStacklineSku:n,headersToInject:r,apiBaseUrl:o=Bn()}=e;const i=await fetch("".concat(o,"/api-rewards/concierge/voice/session"),{method:"POST",headers:Vn(Vn({},r),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,pdpStacklineSku:n})});if(!i.ok){const e=await i.text().catch(()=>"");throw new Error("mintVoiceSession failed (".concat(i.status,"): ").concat(e.slice(0,200)))}return await i.json()})({apiBaseUrl:l.current,conversationId:t,pdpStacklineSku:n,headersToInject:ne.current})}catch(e){const n=e instanceof Error?e.message:String(e),o=n.includes("(409)");return bc("BACKEND","session response - error",{conversationId:t,error:n,collision:o}),void r(e)}if(e.cancelled)return;e.minted=!0,bc("BACKEND","session response",b);try{const e=await p.createOffer();await p.setLocalDescription(e);const n=await fetch("https://api.openai.com/v1/realtime/calls",{method:"POST",body:e.sdp,headers:{Authorization:"Bearer ".concat(b.ephemeralKey),"Content-Type":"application/sdp"}});if(!n.ok){const e=await n.text().catch(()=>"");throw new Error("OpenAI WebRTC handshake failed (".concat(n.status,"): ").concat(e.slice(0,200)))}try{const e=n.headers.get("Location"),r=null==(s=null==e?void 0:e.split("/").pop())?void 0:s.trim();r&&zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"webrtc.openai_call_id",payload:{call_id:r},t:Date.now()}],headersToInject:ne.current})}catch(e){}A=await n.text()}catch(e){return void r(e)}if(e.cancelled)return;try{await p.setRemoteDescription({type:"answer",sdp:A})}catch(e){return void r(e)}if(e.cancelled)return;try{await function(e){return"open"===e.readyState?Promise.resolve():new Promise((t,n)=>{const r=setTimeout(()=>{n(new Error("Data channel open timeout"))},1e4),o=()=>{clearTimeout(r),e.removeEventListener("open",o),t()};e.addEventListener("open",o)})}(v)}catch(e){return void r(e)}if(e.cancelled)return;let C=[];try{C=await(async e=>{let{conversationId:t,limit:n=Tn,toolLimit:r=Mn,headersToInject:o,apiBaseUrl:i=Bn()}=e;var a,l;if(!t)return[];try{var s;const e=Vn(Vn({},o),{},{"Content-Type":"application/json"}),f="".concat(i,"/api-rewards/concierge/conversation/").concat(t,"/ui-messages?includeToolParts=true"),h=await fetch(f,{method:"GET",headers:e});if(!h.ok)return[];let m;try{m=await h.json()}catch(e){return[]}if(m.error)return[];const v=null!==(s=m.messages)&&void 0!==s?s:[],y=Math.max(0,Math.floor(n)),x=y>0?v.slice(-y):v,b=[],w=new Map;for(const e of x){var c,d;const t="user"===e.role?"user":"assistant",n=null!==(c=null!==(d=null==(a=e.content)?void 0:a.parts)&&void 0!==d?d:e.parts)&&void 0!==c?c:[],r=n.filter(e=>e&&"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join("\n\n");r&&b.push({kind:"text",role:t,text:r});for(const e of n)if(null==e?void 0:e.type)if("tool-call"===e.type&&"string"==typeof e.toolCallId){const t=e.toolCallId,n="string"==typeof e.toolName?e.toolName:"";let r="{}";try{var u;r=JSON.stringify(null!==(u=e.args)&&void 0!==u?u:{})}catch(e){r="{}"}t&&n&&w.set(t,{toolName:n,argsJson:r})}else if("tool-result"===e.type&&"string"==typeof e.toolCallId){const t=e.toolCallId,n=w.get(t);if(n){const r=null==(l=null==e?void 0:e.result)?void 0:l.narrator;b.push({kind:"tool",callId:t,toolName:n.toolName,argsJson:n.argsJson,output:"string"==typeof r?r:""}),w.delete(t)}}else if("tool-invocation"===e.type&&e.toolInvocation){const t=e.toolInvocation;if("result"===t.state&&"string"==typeof t.toolCallId&&"string"==typeof t.toolName){let e="{}";try{var p;e=JSON.stringify(null!==(p=t.args)&&void 0!==p?p:{})}catch(t){e="{}"}let n="";try{var g;n=JSON.stringify(null!==(g=t.result)&&void 0!==g?g:{}),n.length>2e3&&(n=n.slice(0,2e3)+"â¦[truncated]")}catch(e){n=""}b.push({kind:"tool",callId:t.toolCallId,toolName:t.toolName,argsJson:e,output:n})}}}const A=Math.max(0,Math.floor(r)),C=b.reduce((e,t)=>"tool"===t.kind?e+1:e,0),j=Math.max(0,C-A);let S=b;if(j>0){let e=0;S=b.filter(t=>!("tool"===t.kind&&e<j&&(e++,1)))}return(e=>{const t=e.filter(e=>!("tool"===e.kind&&Dn.has(e.toolName)));let n=t.length;for(;n>0;){const e=t[n-1];if(!("text"===e.kind&&e.text.trim().length<=80&&Nn.test(e.text)))break;n-=1}return n===t.length?t:t.slice(0,n)})(S)}catch(e){return[]}})({apiBaseUrl:l.current,conversationId:t,limit:20,toolLimit:3,headersToInject:ne.current})}catch(e){C=[]}if(e.cancelled)return;try{const n=b.sessionConfig,{tracing:r}=n,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(-1!==t.indexOf(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],-1===t.indexOf(n)&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,cc);ie(v,{type:"session.update",session:o});let i=0,a=0,s=0;for(const e of C)"text"===e.kind?(i+=e.text.length,a+=1,ie(v,{type:"conversation.item.create",item:{type:"message",role:e.role,content:[{type:"user"===e.role?"input_text":"output_text",text:e.text}]}})):(i+=e.argsJson.length+e.output.length,s+=1,ie(v,{type:"conversation.item.create",item:{type:"function_call",call_id:e.callId,name:e.toolName,arguments:e.argsJson}}),ie(v,{type:"conversation.item.create",item:{type:"function_call_output",call_id:e.callId,output:e.output}}));C.length>0?(ie(v,{type:"response.create",response:{instructions:hc}}),console.info("[voice] primed N=".concat(a," text + ").concat(s," tool round-trips; using context-aware acknowledgment")),zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"webrtc.priming_completed",t:Date.now(),payload:{priorMessageCount:a,priorToolCallCount:s,totalChars:i}}],headersToInject:ne.current})):(ie(v,{type:"response.create",response:{instructions:'Say exactly and only this
1sentence: "'.concat(b.greeting,'". Do not add anything else. Do not list what you can help with. Do not say any other words.')}}),console.info("[voice] no prior messages; using standard greeting"));const c=new sc;e.bargeIn=c,await c.start({conversationId:t,getStream:()=>e.stream,getAudioEl:()=>e.audioEl,getDataChannel:()=>e.dc,isAssistantAudible:()=>P.current,isResponseInFlight:()=>e.responseInFlight,getAuthHeaders:()=>ne.current,sendDataChannel:t=>ie(e.dc,t),onInitFailed:()=>{ie(e.dc,{type:"session.update",session:{type:"realtime",audio:{input:{turn_detection:{type:"semantic_vad",eagerness:"auto",interrupt_response:!0,create_response:!0}}}}})},onConfirmedUserSpeech:()=>de(e),log:(e,t)=>bc("VAD",e,t)})}catch(e){}const j=null!==(a=ne.current.Authorization)&&void 0!==a?a:ne.current.authorization,S=(null==j?void 0:j.replace(/^Bearer\s+/i,"").trim())||void 0,O=(null==(d=ne.current["x-bc-visitor-id"])?void 0:d.trim())||void 0,E=(e=>{let{conversationId:t,accessToken:n,visitorId:r,apiBaseUrl:o=Bn()}=e;const i="".concat(o,"/api-rewards/concierge/voice/event-channel/").concat(encodeURIComponent(t)),a=new URLSearchParams;n&&a.set("token",n),r&&a.set("visitorId",r);const l=a.toString(),s=l?"".concat(i,"?").concat(l):i;return new EventSource(s,{withCredentials:!0})})({apiBaseUrl:l.current,conversationId:t,accessToken:S,visitorId:O});e.eventSource=E,E.addEventListener("error",()=>{console.warn("[voice] event channel error")}),E.onmessage=t=>{var n;if(!e.cancelled)try{const e=JSON.parse(t.data);if("string"!=typeof(null==e?void 0:e.type))return;if("data-status"===e.type){const t={type:"data-status",data:{status:"string"==typeof(null==(n=e.data)?void 0:n.status)?e.data.status:"Thinkingâ¦"}};W(t),void 0!==U.current&&clearTimeout(U.current),U.current=setTimeout(()=>{W(void 0),U.current=void 0},1e4)}}catch(e){}},e.liveStartMs=Date.now(),e.reachedLive=!0,c("live"),g(0),Z(p),Y(u),X(e.liveStartMs),e.assistantStream&&G(e.assistantStream),e.ticker=setInterval(()=>{!e.cancelled&&e.liveStartMs&&g(Math.floor((Date.now()-e.liveStartMs)/1e3))},1e3),e.heartbeat=setInterval(()=>{e.cancelled||zn({apiBaseUrl:l.current,conversationId:t,events:[{type:"browser.heartbeat",t:Date.now()}],headersToInject:ne.current})},5e3)})(),()=>{se(e,"unmount",{postEnd:e.minted,notifyOnEnded:e.reachedLive})}},[t,C]),function(e){const{conversationId:t,userStream:n,assistantStream:o,enabled:i}=e,a=(0,Lt.AU)(),l=(0,r.useRef)(null==a?void 0:a.apiBaseUrl);l.current=null==a?void 0:a.apiBaseUrl;const s=(0,r.useRef)(null),c=(0,r.useRef)(null),d=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!i||!t||!n)return;if(s.current)return;const e=function(){if("undefined"==typeof window)return null;const e=window.MediaRecorder;if(!e||"function"!=typeof e.isTypeSupported)return null;const t=[{mime:"audio/webm;codecs=opus",ext:"webm"},{mime:"audio/webm",ext:"webm"},{mime:"audio/mp4;codecs=mp4a.40.2",ext:"mp4"},{mime:"audio/mp4",ext:"mp4"},{mime:"audio/ogg;codecs=opus",ext:"ogg"}];for(const n of t)try{if(e.isTypeSupported(n.mime))return n}catch(e){}return null}();if(s.current={initialized:!1,enabled:!1,cancelled:!1,codec:e},!e)return void console.warn("[voice-recorder] no MediaRecorder codec supported; recording disabled");const r=s.current;return r.inFlightInit=(async()=>{var n,o;const i=await(0,f.fk)().catch(()=>({})),a=await(async e=>{let{conversationId:t,mimeUser:n,mimeAssistant:r,extUser:o,extAssistant:i,headersToInject:a,apiBaseUrl:l=Bn()}=e;try{const e=await fetch("".concat(l,"/api-rewards/concierge/voice/recording/init"),{method:"POST",headers:Vn(Vn({},a),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,mimeUser:n,mimeAssistant:r,extUser:o,extAssistant:i})});return e.ok?await e.json():{enabled:!1,reason:"http_".concat(e.status)}}catch(e){return{enabled:!1,reason:"network_error"}}})({apiBaseUrl:l.current,conversationId:t,mimeUser:e.mime,mimeAssistant:e.mime,extUser:e.ext,extAssistant:e.ext,headersToInject:i});r.cancelled||(r.initialized=!0,r.enabled=!!a.enabled,r.presignedUrlUser=null==(n=a.presignedUrls)?void 0:n.user,r.presignedUrlAssistant=null==(o=a.presignedUrls)?void 0:o.assistant,!r.enabled||r.presignedUrlUser&&r.presignedUrlAssistant||(console.warn("[voice-recorder] init returned enabled without presigned URLs; recording disabled for this call"),r.enabled=!1))})().catch(()=>{r.initialized=!0,r.enabled=!1}),()=>{r.cancelled=!0,$s("user",t,c,l.current),$s("assistant",t,d,l.current)}},[i,t]),(0,r.useEffect)(()=>
1{if(!i)return;const e=s.current;if(!e)return;let t=!1;return(async()=>{if(e.inFlightInit)try{await e.inFlightInit}catch(e){}t||e.enabled&&e.codec&&(n&&!c.current&&e.presignedUrlUser&&(c.current=_s({track:"user",stream:n,codec:e.codec,presignedUrl:e.presignedUrlUser})),o&&!d.current&&e.presignedUrlAssistant&&(d.current=_s({track:"assistant",stream:o,codec:e.codec,presignedUrl:e.presignedUrlAssistant})))})(),()=>{t=!0}},[i,t,n,o])}({conversationId:t,userStream:q,assistantStream:K,enabled:"live"===s}),function(e){const{conversationId:t,pc:n,enabled:o,intervalMs:i=ec}=e,a=(0,r.useRef)({flag:!1}),l=(0,r.useRef)({});(0,r.useEffect)(()=>{if(!o||!t||!n)return;const e={flag:!1};a.current=e,(0,f.fk)().then(t=>{e.flag||(l.current=t)}).catch(()=>{});const r={lastPacketsLost:0,lastPacketsReceived:0,lastBytes:0,lastTs:0},s={lastPacketsLost:0,lastPacketsReceived:0,lastBytes:0,lastTs:0},c=async()=>{if(e.flag)return;if("connected"!==n.connectionState)return;let o;try{o=await n.getStats()}catch(e){return}if(e.flag)return;const i=tc(o,"inbound-rtp"),a=tc(o,"outbound-rtp"),c=function(e){let t=null;return e.forEach(e=>{"candidate-pair"===e.type&&(!e.nominated&&t||e.state&&"succeeded"!==e.state||(t=e))}),t?{currentRoundTripTimeSec:t.currentRoundTripTime}:null}(o),d=function(e){let t=null;return e.forEach(e=>{"remote-inbound-rtp"===e.type&&(e.kind&&"audio"!==e.kind||(t=e))}),t?{roundTripTimeSec:t.roundTripTime}:null}(o),u=Date.now(),p=(e,t)=>{if(!t||void 0===t.bytes)return;if(0===e.lastTs)return e.lastBytes=t.bytes,void(e.lastTs=t.ts);const n=Math.max(.001,(t.ts-e.lastTs)/1e3),r=Math.max(0,t.bytes-e.lastBytes);return e.lastBytes=t.bytes,e.lastTs=t.ts,Math.round(8*r/n)},g=(e,t)=>{var n,r,o,i;if(!t)return{dLost:0,dRecv:0};const a=Math.max(0,(null!==(n=t.packetsLost)&&void 0!==n?n:0)-e.lastPacketsLost),l=Math.max(0,(null!==(r=t.packetsReceived)&&void 0!==r?r:0)-e.lastPacketsReceived);return e.lastPacketsLost=null!==(o=t.packetsLost)&&void 0!==o?o:e.lastPacketsLost,e.lastPacketsReceived=null!==(i=t.packetsReceived)&&void 0!==i?i:e.lastPacketsReceived,{dLost:a,dRecv:l}},f=p(r,i),h=p(s,a),m=g(r,i),v=g(s,a),y={rttMs:c&&"number"==typeof c.currentRoundTripTimeSec?Math.round(1e3*c.currentRoundTripTimeSec):d&&"number"==typeof d.roundTripTimeSec?Math.round(1e3*d.roundTripTimeSec):void 0,jitterMs:void 0!==(null==i?void 0:i.jitterSec)?Math.round(1e3*i.jitterSec):void 0,packetsLostIn:m.dLost,packetsReceivedIn:m.dRecv,packetsLostOut:v.dLost,packetsReceivedOut:v.dRecv,bitrateIn:f,bitrateOut:h,audioLevelIn:null==i?void 0:i.audioLevel,audioLevelOut:null==a?void 0:a.audioLevel};zn({conversationId:t,events:[{type:"webrtc.stats",payload:y,t:u}],headersToInject:l.current})};c();const d=setInterval(()=>{c()},i);return()=>{e.flag=!0,clearInterval(d)}},[o,t,n,i])}({conversationId:t,pc:Q,enabled:"live"===s}),(0,r.useEffect)(()=>{const e=()=>{const e=_.current;e&&se(e,"tab_close",{postEnd:e.minted,notifyOnEnded:!1})};return window.addEventListener("beforeunload",e),()=>window.removeEventListener("beforeunload",e)},[se]),(0,r.useEffect)(()=>{if("undefined"==typeof window)return;const e={dropOpenAiConnection:e=>{var t;const n=_.current;if(n&&n.reachedLive)return"instant"===(null!==(t=null==e?void 0:e.mode)&&void 0!==t?t:"watchdog")?(console.info("[voiceDebug] declaring session dead immediately (instant mode)."),void ce(n)):(console.info("[voiceDebug] simulating OpenAI silence â watchdog will declare the session dead in ~".concat(fc,"ms.")),$.current=!0,void de(n));console.warn("[voiceDebug] no live voice call to drop â start a call first.")}};return window.__voiceDebug=e,()=>{window.__voiceDebug===e&&delete window.__voiceDebug}},[ce,de]);const ue=(0,r.useCallback)(e=>{u(e),re.current=e;const t=_.current;(null==t?void 0:t.stream)&&t.stream.getAudioTracks().forEach(t=>{t.enabled=!e})},[]),pe=(0,r.useCallback)(async e=>{const t=_.current;t&&(c("ending"),await se(t,null!=e?e:"user_ended",{postEnd:t.minted,notifyOnEnded:t.reachedLive}))},[se]),ge=(0,r.useCallback)(()=>{bc("BROWSER","retry reconnect requested (D-93)",{conversationId:t,hadPendingEnd:null!=A.current}),$.current=!1,x(void 0),w(void 0),m([]),M([]),R(void 0),c("connecting");const e=A.current,n=()=>{A.current=null,j(e=>e+1)};if(!e)return void n();const r=new Promise(e=>setTimeout(e,1500));Promise.race([e,r]).then(n)},[t]),fe=(0,r.useCallback)(async()=>{const e=_.current,n=H.current,r=n.blockedToolName,o=await gc().catch(()=>({}));if(ne.current=uc(uc({},ne.current),o),(async e=>{let{conversationId:t,durationMs:n,blockedToolName:r,headersToInject:o,apiBaseUrl:i=Bn()}=e;try{const e=await fetch("".concat(i,"/api-rewards/concierge/voice/auth-promote"),{method:"POST",headers:Vn(Vn({},o),{},{"Content-Type":"application/json"}),body:JSON.stringify({conversationId:t,durationMs:n,blockedToolName:r})});return e.ok?await e.json():{ok:!1}}catch(e){return{ok:!1}}})({apiBaseUrl:l.current,conversationId:t,durationMs:n.loginGateMs?Date.now()-n.loginGateMs:void 0,blockedToolName:r,headersToInject:ne.current}),R({type:"data-widget-clear",data:{}}),H.current={},e){const t=r?{type:"function",name:r}:"auto",n=r?"The shopper just finished signing in. Immediately call `".concat(r,"` again with the SAME arguments as before. Do NOT explain. Do NOT apologize. Do NOT re-greet. Do NOT say you can't help â you CAN now, they're signed in. Speak only after the tool returns."):"The shopper just finished signing in. Immediately call the tool you were going to call before the login prompt, with the same arguments. Do NOT explain or apologize â the user is signed in now. Speak only after the tool returns.";ae(e,{type:"response.create",response:{instructions:n,tool_choice:t}})}}
1,[t,ae]),he=(0,r.useCallback)(e=>{const t=e.trim();if(!t)return;const n=_.current;(null==n?void 0:n.dc)&&"open"===n.dc.readyState&&"live"===s&&(n.responseInFlight&&ie(n.dc,{type:"response.cancel"}),ie(n.dc,{type:"conversation.item.create",item:{type:"message",role:"user",content:[{type:"input_text",text:t}]}}),ae(n,{type:"response.create"}),de(n),oe.current.user=void 0,le("user",t,{partial:!1}))},[de,s,ie,ae,le]),me=(0,r.useCallback)(e=>{const t=_.current;if(!t)return;const n=(e||"verification failed").replace(/["\n]/g," ").slice(0,200);ae(t,{type:"response.create",response:{instructions:"The verification code didn't match (reason: ".concat(n,"). Gently tell the user the code was wrong and ask them to read the six digits again â they can still see the OTP form on screen. Do NOT re-prompt for the phone number, do NOT call any tools yet. Wait for the user to read the digits aloud.")}})},[ae]);return{phase:s,muted:d,seconds:p,lines:h,error:y,errorTitle:b,isAssistantSpeaking:S,isAssistantAudible:O,isUserSpeaking:E,toolCallsInFlight:F,lastWidgetEvent:L,widgetEvents:T,lastStatusEvent:z,setMuted:ue,end:pe,retry:ge,notifyLoginCompleted:fe,notifyLoginFailed:me,sendText:he}}const yc={OPENAI:"#10B981",BROWSER:"#3B82F6",BACKEND:"#8B5CF6",VAD:"#F59E0B"};function xc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date;const t=e.getHours()>=12?"PM":"AM",n=e.getHours()%12||12,r=String(n).padStart(2,"0"),o=String(e.getMinutes()).padStart(2,"0"),i=String(e.getSeconds()).padStart(2,"0"),a=String(e.getMilliseconds()).padStart(3,"0");let l="";try{var s;const t=e.toLocaleTimeString("en-US",{timeZoneName:"short"}).split(" ");l=null!==(s=t[t.length-1])&&void 0!==s?s:""}catch(e){l=""}return"".concat(r,":").concat(o,":").concat(i,":").concat(a," ").concat(t).concat(l?" ".concat(l):"")}function bc(e,t,n){let r=!1;try{r="undefined"!=typeof localStorage&&"true"===localStorage.getItem("logVoiceChat")}catch(e){return}if(!r)return;const o="".concat(e," - ").concat(t),i=n&&"object"==typeof n?uc(uc({},n),{},{timestamp:xc()}):{value:n,timestamp:xc()};let a;try{a=JSON.stringify(i,null,2)}catch(e){a="[unserializable payload]"}const l="color: ".concat(yc[e],"; font-weight: 700");console.log("%c".concat(o,"%c\n").concat(a),l,"color: inherit; font-weight: 400; font-family: ui-monospace, Menlo, Consolas, monospace")}function wc(e,t,n,r,o){const i=Math.max(1,Math.round(r/20)),a=(n-t)/i;let l=t,s=0;e.volume=t;const c=setInterval(()=>{if(s+=1,l+=a,s>=i)return e.volume=n,clearInterval(c),void(null==o||o());e.volume=Math.max(0,Math.min(1,l))},20);return c}const Ac=e=>{let{mode:t,value:n,onChange:o,onSubmit:i,muted:a,onToggleMute:s,onEnd:c,active:u,toolActive:p=!1,micDisabled:g=!1}=e;const f=(0,r.useId)(),{themeColors:h}=(0,d.FG)(),m=h.primary||"#000000",v=h.buttonText||"#FFFFFF",y=h.textPrimary||"#000000",x=n.trim().length>0,b=u||p,w="live"!==t,A="live"===t&&x,C="connecting"===t||"ending"===t,j="ending"===t,S=(0,r.useCallback)(e=>{"Enter"===e.key&&!e.shiftKey&&"live"===t&&x&&(e.preventDefault(),i())},[x,t,i]),k=(0,r.useCallback)(()=>{j||(A?i():c())},[j,c,i,A]);return(0,l.jsxs)("footer",{style:{position:"relative",zIndex:3,flexShrink:0,display:"flex",alignItems:"center",justifyContent:"center",minHeight:88,padding:"0 16px",paddingBottom:"env(safe-area-inset-bottom, 0px)",background:"transparent"},children:[(0,l.jsx)("style",{children:Ic}),(0,l.jsxs)("div",{className:"voice-input-bar",style:{width:"100%",maxWidth:768,height:54,display:"flex",alignItems:"center",gap:16,padding:"0 16px",background:"var(--voice-bar-bg, #FFFFFF)",border:"1px solid #DCDDDC",borderRadius:9999,boxShadow:"0 4px 8px rgba(0, 0, 0, 0.05)"},children:[(0,l.jsx)("input",{id:f,type:"text",className:"voice-input-bar-field",value:n,onChange:e=>o(e.target.value),onKeyDown:S,disabled:w,placeholder:"Type or say anything","aria-label":"Type or say anything",autoComplete:"off",style:{flex:1,minWidth:0,border:"none",outline:"none",background:"transparent",fontSize:16,lineHeight:"22px",fontWeight:500,color:y,fontFamily:"inherit"}}),(0,l.jsxs)("div",{style:{display:"inline-flex",alignItems:"center",gap:16,flexShrink:0},children:[(0,l.jsx)("button",{type:"button",onClick:s,disabled:g,"aria-pressed":a,"aria-label":a?"Unmute microphone":"Mute microphone",className:"voice-input-bar-mic",style:{appearance:"none",border:"none",background:"transparent",padding:0,width:24,height:24,display:"inline-flex",alignItems:"center",justifyContent:"center",cursor:g?"not-allowed":"pointer",opacity:g?.45:1,color:y},children:a?(0,l.jsx)(jc,{}):(0,l.jsx)(Cc,{color:y})}),(0,l.jsx)("button",{type:"button",onClick:k,disabled:j,"aria-label":A?"Send message":"connecting"===t?"Cancel call":"ending"===t?"Ending call":"End call",className:"voice-input-bar-action",style:{appearance:"none",border:"none",background:m,color:v,borderRadius:24,minHeight:40,padding:A?"8px 12px":"8px 16px",display:"inline-flex",alignItems:"center",justifyContent:"center",gap:4,fontSize:16,lineHeight:"22px",fontWeight:500,fontFamily:"inherit",curs
1or:j?"default":"pointer",transition:"transform 80ms ease, opacity 120ms ease"},children:C?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Oc,{color:v}),(0,l.jsx)("span",{className:"voice-input-bar-action-label",style:{color:v},children:"ending"===t?"Ending":"Cancel"})]}):A?(0,l.jsx)(kc,{color:v}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Sc,{active:b,color:v}),(0,l.jsx)("span",{className:"voice-input-bar-action-label",style:{color:v},children:"End"})]})})]})]})]})},Cc=e=>{let{color:t}=e;return(0,l.jsx)("svg",{width:"17",height:"24",viewBox:"0 0 17 24",fill:"none","aria-hidden":!0,children:(0,l.jsx)("path",{d:"M8.5 17.1429C5.68778 17.1429 3.4 14.8359 3.4 12V5.14286C3.4 2.307 5.68778 0 8.5 0C11.3122 0 13.6 2.307 13.6 5.14286V12C13.6 14.8359 11.3122 17.1429 8.5 17.1429ZM8.5 1.71429C6.62533 1.71429 5.1 3.25243 5.1 5.14286V12C5.1 13.8904 6.62533 15.4286 8.5 15.4286C10.3747 15.4286 11.9 13.8904 11.9 12V5.14286C11.9 3.25243 10.3747 1.71429 8.5 1.71429ZM16.15 10.2857C15.6806 10.2857 15.3 10.6695 15.3 11.1429V12C15.3 15.7811 12.2496 18.8571 8.5 18.8571C4.75044 18.8571 1.7 15.7811 1.7 12V11.1429C1.7 10.6695 1.31941 10.2857 0.85 10.2857C0.380587 10.2857 0 10.6695 0 11.1429V12C0 16.4372 3.36069 20.0966 7.65 20.5279V22.2857H5.95C5.48059 22.2857 5.1 22.6695 5.1 23.1429C5.1 23.6162 5.48059 24 5.95 24H11.05C11.5194 24 11.9 23.6162 11.9 23.1429C11.9 22.6695 11.5194 22.2857 11.05 22.2857H9.35V20.5279C13.6393 20.0964 17 16.437 17 12V11.1429C17 10.6695 16.6194 10.2857 16.15 10.2857Z",fill:t})})},jc=()=>(0,l.jsxs)("svg",{width:"20",height:"24",viewBox:"0 0 20.75 24",fill:"none","aria-hidden":!0,children:[(0,l.jsx)("mask",{id:"voice-mic-muted-mask",fill:"white",children:(0,l.jsx)("path",{d:"M10.5 17.1429C7.68778 17.1429 5.4 14.8359 5.4 12V5.14286C5.4 2.307 7.68778 0 10.5 0C13.3122 0 15.6 2.307 15.6 5.14286V12C15.6 14.8359 13.3122 17.1429 10.5 17.1429ZM10.5 1.71429C8.62533 1.71429 7.1 3.25243 7.1 5.14286V12C7.1 13.8904 8.62533 15.4286 10.5 15.4286C12.3747 15.4286 13.9 13.8904 13.9 12V5.14286C13.9 3.25243 12.3747 1.71429 10.5 1.71429ZM18.15 10.2857C17.6806 10.2857 17.3 10.6695 17.3 11.1429V12C17.3 15.7811 14.2496 18.8571 10.5 18.8571C6.75044 18.8571 3.7 15.7811 3.7 12V11.1429C3.7 10.6695 3.31941 10.2857 2.85 10.2857C2.38059 10.2857 2 10.6695 2 11.1429V12C2 16.4372 5.36069 20.0966 9.65 20.5279V22.2857H7.95C7.48059 22.2857 7.1 22.6695 7.1 23.1429C7.1 23.6162 7.48059 24 7.95 24H13.05C13.5194 24 13.9 23.6162 13.9 23.1429C13.9 22.6695 13.5194 22.2857 13.05 22.2857H11.35V20.5279C15.6393 20.0964 19 16.437 19 12V11.1429C19 10.6695 18.6194 10.2857 18.15 10.2857Z"})}),(0,l.jsx)("path",{d:"M10.5 17.1429C7.68778 17.1429 5.4 14.8359 5.4 12V5.14286C5.4 2.307 7.68778 0 10.5 0C13.3122 0 15.6 2.307 15.6 5.14286V12C15.6 14.8359 13.3122 17.1429 10.5 17.1429ZM10.5 1.71429C8.62533 1.71429 7.1 3.25243 7.1 5.14286V12C7.1 13.8904 8.62533 15.4286 10.5 15.4286C12.3747 15.4286 13.9 13.8904 13.9 12V5.14286C13.9 3.25243 12.3747 1.71429 10.5 1.71429ZM18.15 10.2857C17.6806 10.2857 17.3 10.6695 17.3 11.1429V12C17.3 15.7811 14.2496 18.8571 10.5 18.8571C6.75044 18.8571 3.7 15.7811 3.7 12V11.1429C3.7 10.6695 3.31941 10.2857 2.85 10.2857C2.38059 10.2857 2 10.6695 2 11.1429V12C2 16.4372 5.36069 20.0966 9.65 20.5279V22.2857H7.95C7.48059 22.2857 7.1 22.6695 7.1 23.1429C7.1 23.6162 7.48059 24 7.95 24H13.05C13.5194 24 13.9 23.6162 13.9 23.1429C13.9 22.6695 13.5194 22.2857 13.05 22.2857H11.35V20.5279C15.6393 20.0964 19 16.437 19 12V11.1429C19 10.6695 18.6194 10.2857 18.15 10.2857Z",fill:"#FF634A"}),(0,l.jsx)("path",{d:"M9.65 20.5279H13.65V16.91L10.0502 16.548L9.65 20.5279ZM9.65 22.2857V26.2857H13.65V22.2857H9.65ZM11.35 22.2857H7.35V26.2857H11.35V22.2857ZM11.35 20.5279L10.9496 16.548L7.35 16.9102V20.5279H11.35ZM10.5 17.1429V13.1429C9.92841 13.1429 9.4 12.6583 9.4 12H5.4H1.4C1.4 17.0134 5.44714 21.1429 10.5 21.1429V17.1429ZM5.4 12H9.4V5.14286H5.4H1.4V12H5.4ZM5.4 5.14286H9.4C9.4 4.48451 9.92841 4 10.5 4V0V-4C5.44714 -4 1.4 0.129485 1.4 5.14286H5.4ZM10.5 0V4C11.0716 4 11.6 4.48451 11.6 5.14286H15.6H19.6C19.6 0.129485 15.5529 -4 10.5 -4V0ZM15.6 5.14286H11.6V12H15.6H19.6V5.14286H15.6ZM15.6 12H11.6C11.6 12.6583 11.0716 13.1429 10.5 13.1429V17.1429V21.1429C15.5529 21.1429 19.6 17.0134 19.6 12H15.6ZM10.5 1.71429V-2.28571C6.38469 -2.28571 3.1 1.07491 3.1 5.14286H7.1H11.1C11.1 5.42994 10.866 5.71429 10.5 5.71429V1.71429ZM7.1 5.14286H3.1V12H7.1H11.1V5.14286H7.1ZM7.1 12H3.1C3.1 16.0679 6.38469 19.4286 10.5 19.4286V15.4286V11.4286C10.866 11.4286 11.1 11.7129 11.1 12H7.1ZM10.5 15.4286V19.4286C14.6153 19.4286 17.9 16.0679 17.9 12H13.9H9.9C9.9 11.7129 10.134 11.4286 10.5 11.4286V15.4286ZM13.9 12H17.9V5.14286H13.9H9.9V12H13.9ZM13.9 5.14286H17.9C17.9 1.07491 14.6153 -2.28571 10.5 -2.28571V1.71429V5.71429C10.134 5.71429 9.9 5.42994 9.9 5.14286H13.9ZM18.15 10.2857V6.28571C15.44 6.28571 13.3 8.49199 13.3 11.1429H17.3H21.3C21.3 12.847 19.9212 14.2857 18.15 14.2857V10.2857ZM17.3 11.1429H13.3V12H17.3H21.3V11.1429H17.3ZM17.3 12H13.3C13.3 13.6036 12.0089 14.8571 10.5 14.8571V18.8571V22.8571C16.4902 22.8571 21.3 17.9586 21.3 12H17.3ZM10.5 18.8571V14.8571C8.99107 14.8571 7.7 13.6036 7.7 12H3.7H-0.3C-0.3 17.9586 4.50981 22.8571 10.5 22.8571V18.8571ZM3.7 12H7.7V11.1429H3.7H-0.3V12H3.7ZM3.7 11.1429H7.7C7.7 8.49199 5.56004 6.28571 2.85 6.28571V10.2857V14.2857C1.07878 14.2857 -0.3 12.847 -0.3 11.1429H3.7ZM2.85 10.2857V6.28571C0.139956 6.28571 -2 8.49199 -2 11.1429H2H6C6 12.847 4.62122 14.2857 2.85 14.2857V10.2857ZM2 11.1429H-2V12H2H6V11.1429H2ZM2 12H-2C-2 18.4873 2.91258 23.8706 9.24976 24.5079L9.65 20.5279L10.0502 16.548C7.80879 16.3226 6 14.3871 6 12H2ZM9.65 20.5279H
15.65V22.2857H9.65H13.65V20.5279H9.65ZM9.65 22.2857V18.2857H7.95V22.2857V26.2857H9.65V22.2857ZM7.95 22.2857V18.2857C5.23996 18.2857 3.1 20.492 3.1 23.1429H7.1H11.1C11.1 24.847 9.72122 26.2857 7.95 26.2857V22.2857ZM7.1 23.1429H3.1C3.1 25.7937 5.23996 28 7.95 28V24V20C9.72122 20 11.1 21.4387 11.1 23.1429H7.1ZM7.95 24V28H13.05V24V20H7.95V24ZM13.05 24V28C15.76 28 17.9 25.7937 17.9 23.1429H13.9H9.9C9.9 21.4387 11.2788 20 13.05 20V24ZM13.9 23.1429H17.9C17.9 20.492 15.76 18.2857 13.05 18.2857V22.2857V26.2857C11.2788 26.2857 9.9 24.847 9.9 23.1429H13.9ZM13.05 22.2857V18.2857H11.35V22.2857V26.2857H13.05V22.2857ZM11.35 22.2857H15.35V20.5279H11.35H7.35V22.2857H11.35ZM11.35 20.5279L11.7504 24.5078C18.0874 23.8702 23 18.4872 23 12H19H15C15 14.3868 13.1913 16.3225 10.9496 16.548L11.35 20.5279ZM19 12H23V11.1429H19H15V12H19ZM19 11.1429H23C23 8.49199 20.86 6.28571 18.15 6.28571V10.2857V14.2857C16.3788 14.2857 15 12.847 15 11.1429H19Z",fill:"#FF534A",mask:"url(#voice-mic-muted-mask)"}),(0,l.jsx)("line",{x1:"1.06066",y1:"2",x2:"20",y2:"20.9393",stroke:"#FF534A",strokeWidth:"1.5",strokeLinecap:"round"})]}),Sc=e=>{let{active:t,color:n}=e;return(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,className:t?"voice-bars-active":void 0,children:(0,l.jsxs)("g",{transform:"translate(4 4)",fill:n,children:[(0,l.jsx)("rect",{className:"voice-bar voice-bar-1",x:"0",y:"5",width:"2",height:"6",rx:"1"}),(0,l.jsx)("rect",{className:"voice-bar voice-bar-2",x:"4.66",y:"0",width:"2",height:"16",rx:"1"}),(0,l.jsx)("rect",{className:"voice-bar voice-bar-3",x:"9.33",y:"3",width:"2",height:"10",rx:"1"}),(0,l.jsx)("rect",{className:"voice-bar voice-bar-4",x:"14",y:"5",width:"2",height:"6",rx:"1"})]})})},kc=e=>{let{color:t}=e;return(0,l.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":!0,children:(0,l.jsx)("path",{d:"M5 12h12M13 7l5 5-5 5",stroke:t,strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})},Oc=e=>{let{color:t}=e;return(0,l.jsx)("span",{className:"voice-input-bar-spinner","aria-hidden":!0,style:{width:18,height:18,border:"2px solid ".concat(t),borderTopColor:"transparent",borderRadius:"50%",flexShrink:0}})},Ic="\n.voice-input-bar-field::placeholder {\n color: #9CA3AF;\n opacity: 1;\n}\n.voice-input-bar-field:disabled {\n opacity: 0.55;\n cursor: not-allowed;\n}\n.voice-input-bar-mic:not(:disabled):hover {\n opacity: 0.75;\n}\n.voice-input-bar-action:hover {\n transform: translateY(-1px);\n}\n.voice-input-bar-action:active {\n transform: translateY(0);\n}\n.voice-input-bar-spinner {\n animation: voice-input-spin 0.75s linear infinite;\n}\n@keyframes voice-input-spin {\n to { transform: rotate(360deg); }\n}\n.voice-bar {\n transform-box: fill-box;\n transform-origin: center;\n}\n.voice-bars-active .voice-bar {\n animation: voice-bar-pulse 0.9s ease-in-out infinite;\n}\n.voice-bars-active .voice-bar-1 { animation-delay: 0ms; }\n.voice-bars-active .voice-bar-2 { animation-delay: 120ms; }\n.voice-bars-active .voice-bar-3 { animation-delay: 240ms; }\n.voice-bars-active .voice-bar-4 { animation-delay: 360ms; }\n@keyframes voice-bar-pulse {\n 0%, 100% { transform: scaleY(0.4); }\n 50% { transform: scaleY(1); }\n}\n@media (max-width: 759.98px) {\n .voice-input-bar-action {\n width: 44px !important;\n min-width: 44px !important;\n height: 44px !important;\n padding: 0 !important;\n }\n .voice-input-bar-action-label {\n display: none;\n }\n}\n";function Pc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ec(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Pc(Object(n),!0).forEach(function(t){Vc(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Pc(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Vc(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Fc={layer1:"#FF508C",layer2:"#78B4FF",layer3:"#64FFC8",layer4:"#FFC850"};function Bc(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"255,255,255";const n=parseInt(t[1],16);return"".concat(n>>16&255,",").concat(n>>8&255,",").concat(255&n)}const Lc=e=>{let{level:t,size:n,colors:r}=e;const o=1+.18*t,i=null!=r?r:Fc,a=[{color:Bc(i.layer1),delay:"0s",duration:"7s",anim:0}
1,{color:Bc(i.layer2),delay:"-2s",duration:"8s",anim:1},{color:Bc(i.layer3),delay:"-4s",duration:"9s",anim:2},{color:Bc(i.layer4),delay:"-1s",duration:"6s",anim:3}];return(0,l.jsxs)("div",{style:{width:n,height:n,position:"relative",borderRadius:"50%",overflow:"hidden",isolation:"isolate",transform:"scale(".concat(o,")"),transition:"transform 100ms ease-out",background:"radial-gradient(circle at 50% 50%, #2a1048 0%, #1a0830 48%, #3d1868 78%, #4a2088 100%)"},"aria-hidden":!0,children:[a.map((e,n)=>(0,l.jsx)("div",{style:{position:"absolute",inset:"-10%",background:"radial-gradient(circle at 50% 50%, rgba(".concat(e.color,",").concat(.82+.14*t,") 0%, rgba(").concat(e.color,",0.58) 28%, rgba(").concat(e.color,",0.28) 50%, rgba(").concat(e.color,",0) 62%)"),mixBlendMode:"plus-lighter",filter:"blur(".concat(8+6*(1-t),"px)"),animation:"aurora-".concat(e.anim," ").concat(e.duration," ease-in-out ").concat(e.delay," infinite")}},n)),(0,l.jsx)("div",{style:{position:"absolute",inset:0,background:"radial-gradient(circle at 35% 30%, rgba(255,255,255,0.2), transparent 22%)",mixBlendMode:"screen",pointerEvents:"none"}}),(0,l.jsx)("style",{children:"\n @keyframes aurora-0 {\n 0%,100% { transform: translate(-22%, -18%) scale(1); }\n 50% { transform: translate(18%, 14%) scale(1.2); }\n }\n @keyframes aurora-1 {\n 0%,100% { transform: translate(20%, -16%) scale(1.15); }\n 50% { transform: translate(-18%, 18%) scale(0.95); }\n }\n @keyframes aurora-2 {\n 0%,100% { transform: translate(-14%, 22%) scale(0.95); }\n 50% { transform: translate(16%, -20%) scale(1.15); }\n }\n @keyframes aurora-3 {\n 0%,100% { transform: translate(16%, 18%) scale(1.05); }\n 50% { transform: translate(-20%, -14%) scale(1.25); }\n }\n "})]})},Rc={from:"#FFAE00",to:"#FF2D75"},Tc=e=>{let{level:t,size:n,colors:o}=e;const i=(0,r.useRef)(0),[a,s]=(0,r.useState)([]);(0,r.useEffect)(()=>{let e;const n=()=>{i.current+=.015;const r=[];for(let e=0;e<5;e++){const n=e/5*Math.PI*2+.4*i.current,o=12+14*t,a=14+6*Math.sin(1.2*i.current+e)+12*t;r.push({cx:50+Math.cos(n)*a,cy:50+Math.sin(n)*a,r:o})}r.push({cx:50,cy:50,r:18+8*t}),s(r),e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[t]);const c=null!=o?o:Rc,d=(0,r.useId)().replace(/:/g,""),u="voice-meta-goo-".concat(d),p="voice-meta-g-".concat(d);return(0,l.jsxs)("svg",{width:n,height:n,viewBox:"0 0 100 100","aria-hidden":!0,children:[(0,l.jsxs)("defs",{children:[(0,l.jsxs)("filter",{id:u,children:[(0,l.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.2",result:"blur"}),(0,l.jsx)("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 18 -8"})]}),(0,l.jsxs)("linearGradient",{id:p,x1:"0",y1:"0",x2:"1",y2:"1",children:[(0,l.jsx)("stop",{offset:"0%",stopColor:c.from}),(0,l.jsx)("stop",{offset:"100%",stopColor:c.to})]})]}),(0,l.jsx)("g",{filter:"url(#".concat(u,")"),children:a.map((e,t)=>(0,l.jsx)("circle",{cx:e.cx,cy:e.cy,r:e.r,fill:"url(#".concat(p,")")},t))})]})},Mc={highlight:"#FFFFFF",primary:"#7C5CFF",deep:"#1A0B4D"},Dc=e=>{let{level:t,size:n,colors:o}=e;const i=(0,r.useRef)(0),[a,s]=(0,r.useState)("");(0,r.useEffect)(()=>{let e;const n=()=>{i.current+=.012;const r=36+6*t,o=2.5+7*t,a=[];for(let e=0;e<8;e++){const t=e/8*Math.PI*2,n=r+(Math.sin(1.3*i.current+1.7*e)*o+Math.sin(.7*i.current+.9*e)*o*.5);a.push([50+Math.cos(t)*n,50+Math.sin(t)*n])}let l="M ".concat(a[0][0].toFixed(2)," ").concat(a[0][1].toFixed(2));for(let e=0;e<8;e++){const t=a[(e-1+8)%8],n=a[e],r=a[(e+1)%8],o=a[(e+2)%8],i=n[0]+(r[0]-t[0])/6,s=n[1]+(r[1]-t[1])/6,c=r[0]-(o[0]-n[0])/6,d=r[1]-(o[1]-n[1])/6;l+=" C ".concat(i.toFixed(2)," ").concat(s.toFixed(2),", ").concat(c.toFixed(2)," ").concat(d.toFixed(2),", ").concat(r[0].toFixed(2)," ").concat(r[1].toFixed(2))}l+=" Z",s(l),e=requestAnimationFrame(n)};return e=requestAnimationFrame(n),()=>cancelAnimationFrame(e)},[t]);const c=null!=o?o:Mc,d=(0,r.useId)().replace(/:/g,""),u="organic-g-".concat(d),p="organic-glow-".concat(d),g=o?c.primary:"var(--voice-orb-primary, ".concat(c.primary,")");return(0,l.jsxs)("svg",{width:n,height:n,viewBox:"0 0 100 100","aria-hidden":!0,
1children:[(0,l.jsxs)("defs",{children:[(0,l.jsxs)("radialGradient",{id:u,cx:"35%",cy:"35%",children:[(0,l.jsx)("stop",{offset:"0%",stopColor:c.highlight,stopOpacity:"0.85"}),(0,l.jsx)("stop",{offset:"22%",stopColor:g,stopOpacity:"1"}),(0,l.jsx)("stop",{offset:"100%",stopColor:c.deep,stopOpacity:"1"})]}),(0,l.jsx)("filter",{id:p,children:(0,l.jsx)("feGaussianBlur",{stdDeviation:"0.5"})})]}),(0,l.jsx)("path",{d:a,fill:"url(#".concat(u,")"),filter:"url(#".concat(p,")")})]})},Nc={ring1:"#FF7DD9",ring2:"#75ECFF",ring3:"#75AFFF",ring4:"#7575FF"};function zc(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return 0;const n=parseInt(t[1],16),r=(n>>16&255)/255,o=(n>>8&255)/255,i=(255&n)/255,a=Math.max(r,o,i),l=a-Math.min(r,o,i);if(0===l)return 0;let s;return s=a===r?(o-i)/l%6:a===o?(i-r)/l+2:(r-o)/l+4,s*=60,s<0?s+360:s}const Wc=e=>{let{level:t,size:n,colors:o}=e;const i=(0,r.useRef)(null),a=(0,r.useRef)(t);(0,r.useEffect)(()=>{a.current=t},[t]);const s=o?"".concat(o.ring1,"|").concat(o.ring2,"|").concat(o.ring3,"|").concat(o.ring4):"default";return(0,r.useEffect)(()=>{const e=i.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const r="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=n*r,e.height=n*r,t.scale(r,r);const l=null!=o?o:Nc,s=[{count:44,radius:.22*n,hue:zc(l.ring1)},{count:52,radius:.28*n,hue:zc(l.ring2)},{count:40,radius:.345*n,hue:zc(l.ring3)},{count:30,radius:.4*n,hue:zc(l.ring4)}],c=s[1].hue,d=[];let u;s.forEach(e=>{for(let t=0;t<e.count;t++)d.push({a:t/e.count*Math.PI*2+.12*Math.random(),baseR:e.radius+3*(Math.random()-.5),speed:.0025+.002*Math.random(),phase:Math.random()*Math.PI*2,sz:1.2+1.4*Math.random(),hue:e.hue+25*Math.random()-12})});const p=()=>{t.clearRect(0,0,n,n);const e=n/2,r=n/2,o=a.current,i=t.createRadialGradient(e,r,0,e,r,.25*n+o*n*.16);i.addColorStop(0,"hsla(".concat(c,", 95%, 75%, ").concat(.55+.35*o,")")),i.addColorStop(1,"hsla(".concat(c,", 95%, 75%, 0)")),t.fillStyle=i,t.fillRect(0,0,n,n);for(const n of d){n.a+=n.speed*(1+1.5*o);const i=2*Math.sin(.002*performance.now()+n.phase),a=n.baseR+i+10*o,l=e+Math.cos(n.a)*a,s=r+Math.sin(n.a)*a;t.beginPath(),t.fillStyle="hsla(".concat(n.hue,", 95%, ").concat(65+15*o,"%, ").concat(.55+.4*o,")"),t.arc(l,s,n.sz+1.2*o,0,2*Math.PI),t.fill()}u=requestAnimationFrame(p)};return p(),()=>cancelAnimationFrame(u)},[n,s]),(0,l.jsx)("canvas",{ref:i,style:{width:n,height:n},"aria-hidden":!0})},Uc={highlight:"#D8FFF0",mid:"#2CE39A",deep:"#064D33",ring:"#2CE39A"};function Hc(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"255,255,255";const n=parseInt(t[1],16);return"".concat(n>>16&255,",").concat(n>>8&255,",").concat(255&n)}const Qc=e=>{let{level:t,size:n,colors:o}=e;const[i,a]=(0,r.useState)([]),s=(0,r.useRef)(0),c=(0,r.useRef)(t);(0,r.useEffect)(()=>{c.current=t},[t]),(0,r.useEffect)(()=>{let e=!0;const t=()=>{if(!e)return;const n=c.current;n>.08&&a(e=>[...e,{id:s.current++,strength:n,born:performance.now()}]),setTimeout(t,180+600*(1-n))};return t(),()=>{e=!1}},[]),(0,r.useEffect)(()=>{const e=setInterval(()=>{const e=performance.now();a(t=>t.filter(t=>e-t.born<2200))},400);return()=>clearInterval(e)},[]);const d=1+.35*t,u=null!=o?o:Uc,p=Hc(u.ring),g=Hc(u.mid);return(0,l.jsxs)("div",{style:{width:n,height:n,position:"relative",display:"grid",placeItems:"center"},"aria-hidden":!0,children:[i.map(e=>(0,l.jsx)("span",{style:{position:"absolute",width:.35*n,height:.35*n,borderRadius:"50%",border:"2.5px solid rgba(".concat(p,",").concat(Math.min(.95,.55+.4*e.strength),")"),boxShadow:"0 0 12px rgba(".concat(p,",").concat(.35+.25*e.strength,")"),animation:"voice-ripple-out 2.2s ease-out forwards"}},e.id)),(0,l.jsx)("div",{style:{width:.35*n,height:.35*n,borderRadius:"50%",background:"radial-gradient(circle at 35% 35%, ".concat(u.highlight,", ").concat(u.mid," 55%, ").concat(u.deep,")"),boxShadow:"0 0 ".concat(20+60*t,"px rgba(").concat(g,",").concat(.5+.4*t,")"),transform:"scale(".concat(d,")"),transition:"transform 80ms ease-out, box-shadow 120ms ease-out"}}),(0,l.jsx)("style",{children:"\n @keyframes voice-ripple-out {\n 0% { transform: scale(0.9); opacity: 1; }\n 100% { transform: scale(2.6); opacity: 0; }\n }\n "})]})},Zc={core:"#FF8CC8",ring1:"#FF66A3",ring2:"#FF4D80",ring3:"#FF334D"};function qc(e){const t=/^#?([0-9a-f]{6})$/i.exec(e.trim());if(!t)return"255,255,255";const n=parseInt(t[1],16);return"".concat(n>>16&255,",").concat(n>>8&255,",").concat(255&n)}const Yc=e=>{let{level:t,size:n,colors:o}=e;const i=(0,r.useRef)(null),a=(0,r.useRef)(t);(0,r.useEffect)(()=>{a.current=t},[t]);const s=o?"".concat(o.core,"|").concat(o.ring1,"|").concat(o.ring2,"|").concat(o.ring3):"default";return(0,r.useEffect)(()=>{const e=i.current;if(!e)return;const t=e.getContext("2d");if(!t)return;const r="undefined"!=typeof window&&window.devicePixelRatio||1;e.width=n*r,e.height=n*r,t.scale(r,r);const l=null!=o?o:Zc,s=qc(l.core),c=[l.ring1,l.ring2,l.ring3].map(e=>qc(e));let d,u=0;const p=()=>{u+=.04,t.clearRect(0,0,n,n);const e=n/2,r=n/2,o=a.current,i=.227*n,l=.136*n+10*o,g=t.createRadialGradient(e,r,0,e,r,l);g.addColorStop(0,"rgba(255,255,255,".concat(.95,")")),g.addColorStop(.6,"rgba(".concat(s,",").concat(.6+.3*o,")")),g.addColorStop(1,"rgba(80,20,80,0)"),t.fillStyle=g,t.beginPath(),t.arc(e,r,l,0,2*Math.PI),t.fill();for(let n=0;n<3;n++){t.beginPath();for(let a=0;a<=120;a++){const l=a/120*Math.PI*2,s=i+8*n+(Math.sin(l*(2+n)+u*(1+.5*n))*(4+10*o
1)+Math.sin(l*(3+n)-.8*u)*(1.5+4*o)),c=e+Math.cos(l)*s,d=r+Math.sin(l)*s;0===a?t.moveTo(c,d):t.lineTo(c,d)}t.closePath(),t.strokeStyle="rgba(".concat(c[n],",").concat(.7-.18*n,")"),t.lineWidth=1.5,t.stroke()}d=requestAnimationFrame(p)};return p(),()=>cancelAnimationFrame(d)},[n,s]),(0,l.jsx)("canvas",{ref:i,style:{width:n,height:n},"aria-hidden":!0})},Kc=e=>{let{state:t,size:n=240,styleOverride:o,colors:i}=e;const a=function(){var e,t,n,r,o,i,a;const{persona:l,visual:s}=po(),c=null!==(e=null==s?void 0:s.blobStyle)&&void 0!==e?e:d.PF,u={aurora:Ec(Ec({},d.pm.aurora),null==(t=null==s?void 0:s.blobColors)?void 0:t.aurora),organic:Ec(Ec({},d.pm.organic),null==(n=null==s?void 0:s.blobColors)?void 0:n.organic),particle:Ec(Ec({},d.pm.particle),null==(r=null==s?void 0:s.blobColors)?void 0:r.particle),waveform:Ec(Ec({},d.pm.waveform),null==(o=null==s?void 0:s.blobColors)?void 0:o.waveform),ripple:Ec(Ec({},d.pm.ripple),null==(i=null==s?void 0:s.blobColors)?void 0:i.ripple),metaball:Ec(Ec({},d.pm.metaball),null==(a=null==s?void 0:s.blobColors)?void 0:a.metaball)};return{assistantName:l.assistantName||"Benny",voiceId:l.voiceId,blobStyle:c,blobColors:u[c],blobColorsAll:u}}(),s=null!=o?o:a.blobStyle,c=function(e){const[t,n]=(0,r.useState)(0),o=(0,r.useRef)(0),i=(0,r.useRef)(null),a=(0,r.useRef)(0);return(0,r.useEffect)(()=>{const t=()=>{a.current+=1;const r=a.current;let l=0,s=.18;switch(e){case"idle":case"muted":case"ended":l=.02+.02*Math.sin(.03*r),s=.08;break;case"connecting":l=.08+.06*Math.sin(.03*r),s=.06;break;case"listening":{const e=.45+.25*Math.sin(.06*r)+.15*Math.sin(.17*r+1.3)+.1*Math.sin(.31*r+2.4),t=.25*(Math.random()-.5);l=Math.max(.08,Math.min(1,e+t)),s=.25;break}case"thinking":l=.3+.22*Math.sin(.035*r),s=.06;break;case"tool":l=.5+.18*Math.sin(.12*r)+(Math.sin(.5*r)>.92?.08:0),s=.18;break;case"error":l=.4+.25*Math.sin(.05*r),s=.1;break;default:l=0}o.current=l,n(e=>e+(o.current-e)*s),i.current=requestAnimationFrame(t)};return i.current=requestAnimationFrame(t),()=>{null!=i.current&&cancelAnimationFrame(i.current)}},[e]),t}(t),u=null!=i?i:a.blobColorsAll[s];let p;switch(s){case"organic":p=(0,l.jsx)(Dc,{level:c,size:n,colors:u});break;case"particle":p=(0,l.jsx)(Wc,{level:c,size:n,colors:u});break;case"waveform":p=(0,l.jsx)(Yc,{level:c,size:n,colors:u});break;case"ripple":p=(0,l.jsx)(Qc,{level:c,size:n,colors:u});break;case"metaball":p=(0,l.jsx)(Tc,{level:c,size:n,colors:u});break;default:p=(0,l.jsx)(Lc,{level:c,size:n,colors:u})}return(0,l.jsx)("div",{style:{width:n,height:n,display:"grid",placeItems:"center",isolation:"aurora"===s?"isolate":void 0},"aria-label":"Voice blob (".concat(t,")"),role:"img",children:p})},Gc="linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.7) 50%, #000 90%, #000 100%)",Jc=e=>{let{blobState:t}=e;return(0,l.jsxs)("div",{style:{position:"absolute",left:0,right:0,bottom:0,zIndex:2,height:130,display:"flex",alignItems:"center",justifyContent:"center",pointerEvents:"none"},children:[(0,l.jsx)("div",{"aria-hidden":!0,style:{position:"absolute",inset:0,background:"var(--color-background, #FFFFFF)",WebkitMaskImage:Gc,maskImage:Gc}}),(0,l.jsx)("div",{style:{position:"relative",zIndex:1,width:100,height:100,display:"flex",alignItems:"center",justifyContent:"center"},children:(0,l.jsx)(Kc,{state:t,size:100})})]})},Xc=e=>{let{line:t}=e;const{themeColors:n}=(0,d.FG)(),r=n.textPrimary||"#111827";return"user"===t.role?(0,l.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",width:"100%"},children:(0,l.jsx)("div",{style:{maxWidth:"90%",background:"#f6f8fa",color:r,padding:"10px 14px",borderRadius:18,fontSize:16,lineHeight:1.5,wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:t.partial?.85:1},children:t.text})}):(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",width:"100%"},children:(0,l.jsx)("div",{style:{maxWidth:"100%",color:r,fontSize:16,lineHeight:1.5,wordBreak:"break-word",whiteSpace:"pre-wrap",opacity:t.partial?.85:1},children:t.text})})},_c=e=>{let{lines:t,widgetEvents:n,onLoginCompleted:o,onLoginFailed:i,pendingStatus:a,hasBottomDock:s}=e;const c=To(),d=(0,r.useMemo)(()=>({onLoginCompleted:o,onLoginFailed:i}),[o,i]),u=(0,r.useMemo)(()=>{const e=[];for(const n of t)e.push({kind:"line",key:"line:".concat(n.id),createdAt:n.createdAt,line:n});let r,o;for(const e of n)"data-widget-prompt-login"===e.type&&(void 0===r&&(r=e.createdAt),o=e);o&&void 0!==r&&e.push({kind:"widget",key:"widget:data-widget-prompt-login",createdAt:r,event:o});for(const t of n)"data-widget-prompt-login"!==t.type&&e.push({kind:"widget",key:"widget:".concat(t.id),createdAt:t.createdAt,event:t});return e.sort((e,t)=>
1e.createdAt-t.createdAt),e},[t,n]),p=null==a?void 0:a.trim();return(0,l.jsxs)(B,{style:{position:"relative",flex:"1 1 auto",minHeight:0,width:"100%",overflow:"hidden",background:"transparent"},children:[(0,l.jsx)(L,{style:{padding:"48px 18px 130px"},children:(0,l.jsxs)("div",{style:{width:"100%",maxWidth:768,margin:"0 auto",display:"flex",flexDirection:"column",gap:24},children:[0===u.length?p?null:(0,l.jsx)("div",{style:{color:"var(--voice-header-fg, #9CA3AF)",opacity:.5,fontSize:13,fontStyle:"italic",textAlign:"center",paddingTop:8},children:"Transcripts will appear here as you speak."}):u.map(e=>"line"===e.kind?(0,l.jsx)(Xc,{line:e.line},e.key):(0,l.jsx)("div",{style:{width:"100%"},children:(0,l.jsx)(va,{type:e.event.type,data:e.event.data,liveLoginCallbacks:d,collapseProductCardFeatures:!0})},e.key)),p?(0,l.jsx)("div",{style:{width:"100%",padding:"4px 2px"},children:(0,l.jsx)(un,{as:"p",style:{fontSize:15,lineHeight:"22px",margin:0,fontFamily:"inherit"},color:"var(--voice-header-fg, #6B7280)",highlightColor:"#FFFFFF",children:p})}):null]})}),!c&&(0,l.jsx)(R,{className:s?"tw:bottom-[146px]":void 0})]})};function $c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ed(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?$c(Object(n),!0).forEach(function(t){td(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):$c(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function td(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nd=[],rd=[],od=e=>{var t,n,o;let{conversationId:i,pdpStacklineSku:a,onEnded:s,onUserEndClick:c}=e;var u,p;const{visual:g}=po(),f=null!==(t=null==g?void 0:g.blobEnabled)&&void 0!==t&&t,{themeColors:h}=(0,d.FG)(),{themeFonts:m}=(0,d.vl)(),v=h.background||"#ffffff",y=h.textPrimary||h.primary||"#0d2340",x=h.buttonText||"#ffffff",b=null==m?void 0:m.body,w=b?"system"===b.format?b.url:'"'.concat(b.name,'", sans-serif'):void 0,[A,C]=(0,r.useState)(""),j=function(){const e=(0,r.useRef)(null),t=(0,r.useRef)(null),n=(0,r.useRef)(null),o=(0,r.useRef)(!1),i=(0,r.useCallback)(()=>{null!=n.current&&(clearInterval(n.current),n.current=null)},[]),a=(0,r.useCallback)(()=>{if(!e.current){const t=new Audio("data:audio/ogg;base64,T2dnUwACAAAAAAAAAABiO+FYAAAAAJxlqtkBHgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AU9nZ1MAAAAAAAAAAAAAYjvhWAEAAABGNoU9EUD///////////////////8HA3ZvcmJpcw0AAABMYXZmNTguMjkuMTAwAQAAAB8AAABlbmNvZGVyPUxhdmM1OC41NC4xMDAgbGlidm9yYmlzAQV2b3JiaXMlQkNWAQBAAAAkcxgqRqVzFoQQGkJQGeMcQs5r7BlCTBGCHDJMW8slc5AhpKBCiFsogdCQVQAAQAAAh0F4FISKQQghhCU9WJKDJz0IIYSIOXgUhGlBCCGEEEIIIYQQQgghhEU5aJKDJ0EIHYTjMDgMg+U4+ByERTlYEIMnQegghA9CuJqDrDkIIYQkNUhQgwY56ByEwiwoioLEMLgWhAQ1KIyC5DDI1IMLQoiag0k1+BqEZ0F4FoRpQQghhCRBSJCDBkHIGIRGQViSgwY5uBSEy0GoGoQqOQgfhCA0ZBUAkAAAoKIoiqIoChAasgoAyAAAEEBRFMdxHMmRHMmxHAsIDVkFAAABAAgAAKBIiqRIjuRIkiRZkiV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rWWvgB0dtWb5Y47sw1HEIUC1TMgPTtA8QCJQF8MK7TDjkCVjpA9Rm4TAeOlrFAFVCQehduc+QjooEOz+yJQ54AhNKNKH7Nd0W2MJcBxEQWmm+d+NCCsNQrexpQgAf6BAIzamBIkwD8QgNE7AGVtAcbggYoVN1WOVa2qFQERFcSIiIIYg0BBYhJ16KqqbgPodhLQdFuIVAHSKUAolJ5NACLkKx8xjwIYF9UNoFNRRI+uKkVszH5NAG4XsNcWhCW18rgg1RrT7RZyYvaRpoqApluIFyqAH5cdtCasJfdB2QQNuQWlzeIwJseQDuBUXAs5yN6YtNSR7bShSG4HlLVhcwzquvNB0RSapqsp+QuMHIag7gpetkx6DFPAwEC5sWyZ9BimgIGBcuNpYs5yjGWxyhVSFTmIRmIjxCZINEFsEApkgYP4RBJNEBtUVNM2lUo13aaVKJ2B+6W+SFWZ/5gegefl9QtPqZdVVab/Y0aAeHRGuOdK5eVFWkKvKrhTMBLPS71ugVnvlyGelzoD0K+kDqn59NXx6Abu6QoJPGdge4v2U3iyBYhHN8BOsQUzV+BFtgdACXCnlouLmtopYHvMnZ2CF5aL9k7dng3YNw4=");t.preload="auto",e.current=t}return e.current},[]),l=(0,r.useCallback)(()=>{if(!t.current){const e=new Audio("data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjYwLjE2LjEwMAAAAAAAAAAAAAAA//uQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAABOAACA+QAGCQwQEBMWGR0dICMmJiotMDMzNzo9PUBER0pKTVFUVFdaXWFhZGdqam5xdHd3e36BhISIi46OkZWYm5ueoqWlqKuusrK1uLu7v8LFyMjMz9LS1dnc39/i5unp7O/z9vb5/P8AAAAATGF2ZgAAAAAAAAAAAAAAAAAAAAAAJAQ4AAAAAAAAgPmFnXHRAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=");e.preload="auto",e.loop=!0,t.current=e}return t.current},[]),s=(0,r.useCallback)(()=>{i();const e=a();e.currentTime=0,e.volume=.6,e.play().catch(()=>{})},[i,a]),c=(0,r.useCallback)(()=>{if(o.current)return;o.current=!0,i();const e=l();e.currentTime=0,e.volume=0,e.play().catch(()=>{o.current=!1}),n.current=wc(e,0,.25,200,()=>{n.current=null})},[i,l]),d=(0,r.useCallback)(()=>{if(!o.current&&null==n.current)return;o.current=!1,i();const e=t.current;if(!e)return;const r=e.volume;if(r<=0)return e.pause(),void(e.currentTime=0);n.current=wc(e,r,0,350,()=>{n.current=null,e.pause(),e.currentTime=0})},[i]);return(0,r.useEffect)(()=>()=>{var n,r;i(),o.current=!1,null==(n=e.current)||n.pause(),null==(r=t.current)||r.pause()},[i]),{playEndCall:s,startToolLoop:c,stopToolLoop:d}}(),S=vc({conversationId:i,pdpStacklineSku:a,onEnded:(0,r.useCallback)(e=>{"ended_by_model"!==e.reason&&j.playEndCall(),s(e)},[s,j]),onEndCallInitiated:()=>j.playEndCall()}),k=null==(p=null==(u=S.lastStatusEvent)?void 0:u.data)?void 0:p.status,O="live"===S.phase&&(S.toolCallsInFlight>0||k)?k||"Thinkingâ¦":null,I="requesting-permission"===S.phase||"connecting"===S.phase?"Connectingâ¦":null,P="live"===S.phase&&S.toolCallsInFlight>0&&!S.isAssistantAudible;(0,r.useEffect)(()=>{P?j.startToolLoop():j.stopToolLoop()},[P,j]);const E=(0,r.useMemo)(()=>{return"error"===(e={phase:S.phase,muted:S.muted,isUserSpeaking:S.isUserSpeaking,hasStatus:!!k}).phase?"error":"ended"===e.phase?"ended":"requesting-permission"===e.phase||"connecting"===e.phase||"ending"===e.phase||"live"!==e.phase?"connecting":e.muted?"muted":e.hasStatus?"tool":e.isUserSpeaking?"listening":"idle";var e},[S.phase,S.muted,S.isUserSpeaking,k]),V="live"===(F=S.phase)?"live":"ending"===F?"ending":"connecting";var F;const B=(0,r.useCallback)(async()=>{await S.end("user_ended")},[S]),L=(0,r.useCallback)(()=>{const e=A.trim();e&&"live"===S.phase&&(S.sendText(e),C(""))},[A,S]),R=S.isAssistantAudible||S.isUserSpeaking||S.toolCallsInFlight>0;return(0,l.jsxs)("div",{style:ad,children:[(0,l.jsxs)("div",{style:ld,children:["live"===S.phase?(0,l.jsx)(_c,{lines:S.lines,widgetEvents:S.widgetEvents,pendingStatus:O,onLoginCompleted:S.notifyLoginCompleted,onLoginFailed:S.notifyLoginFailed,hasBottomDock:f}):I?(0,l.jsx)(_c,{lines:nd,widgetEvents:rd,pendingStatus:I}):null,f?(0,l.jsx)(Jc,{blobState:E}):null]}),(0,l.jsx)(Ac,{mode:V,value:A,onChange:C,onSubmit:L,muted:S.muted,onToggleMute:()=>S.setMuted(!S.muted),onEnd:B,active:R,toolActive:S.toolCallsInFlight>0,micDisabled:"live"!==S.phase}),(0,l.jsx)(hl,{open:"error"===S.phase,title:null!==(n=S.errorTitle)&&void 0!==n?n:"Voice mode unavailable",message:null!==(o=S.error)&&void 0!==o?o:"Could not start a call.",confirmText:"Reconnect",cancelText:"Start a new chat",backgroundColor:v,primaryColor:y,primaryForegroundColor:x,fontFamily:w,onConfirm:S.retry,onCancel:c})]})},id=e=>{let{conversationId:t,open:n,onClose:o,pdpStacklineSku:i,containerScoped:a=!1}=e;const{themeFonts:s}=(0,d.vl)(),[c,u]=(0,r.useState)(!1),p=r.useRef(void 0);(0,r.useEffect)(()=>()=>{void 0!==p.current&&clearTimeout(p.current)},[]);const g=(0,r.useCallback)(e=>{void 0===p.current&&(u(!0),p.current=setTimeout(()=>
1o(e),200))},[o]);if(!n)return null;if(!t)return null;const f=function(e){if(e)return"system"===e.format?e.url:'"'.concat(e.name,'", sans-serif')}(null==s?void 0:s.body),h=ed(a?{position:"absolute",inset:0,zIndex:100,background:"var(--color-background, #FFFFFF)",display:"flex",flexDirection:"column",borderRadius:"inherit",overflow:"hidden"}:{position:"fixed",inset:0,zIndex:100,background:"var(--color-background, #FFFFFF)",display:"flex",flexDirection:"column"},f?{fontFamily:f}:{}),m=ed(ed({},h),{},{opacity:c?0:1,transition:"opacity ".concat(200,"ms ease"),pointerEvents:c?"none":void 0});return(0,l.jsx)(go,{children:(0,l.jsx)("div",{style:m,role:"dialog","aria-modal":"true","aria-label":"Voice call",children:(0,l.jsx)(od,{conversationId:t,pdpStacklineSku:i,onEnded:e=>g({reason:e.reason,durationSec:e.durationSec,lines:e.lines,widgetEvents:e.widgetEvents}),onUserEndClick:()=>g({reason:"user_dismissed_error"})})})})},ad={display:"flex",flexDirection:"column",flex:1,minHeight:0,width:"100%",background:"transparent"},ld={position:"relative",flex:"1 1 auto",minHeight:0,width:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},sd="#FFBD32",cd="#F6F8FA",dd="#E8E8ED",ud="var(--bc-foreground, #000000)",pd="var(--bc-muted, rgba(0, 0, 0, 0.3))";function gd(e){let{color:t=sd}=e;return(0,l.jsx)("svg",{width:16,height:16,viewBox:"0 0 16 16",fill:t,style:{flexShrink:0},"aria-hidden":"true",children:(0,l.jsx)("path",{d:"M15.9773 6.07492C15.9519 5.98927 15.9029 5.9125 15.836 5.85339C15.769 5.79428 15.6867 5.75522 15.5986 5.7407L10.6386 4.98515L8.41638 0.274035C8.38041 0.192515 8.32151 0.12321 8.24687 0.074557C8.17222 0.0259036 8.08504 0 7.99593 0C7.90683 0 7.81965 0.0259036 7.745 0.074557C7.67035 0.12321 7.61146 0.192515 7.57549 0.274035L5.35327 4.98515L0.393265 5.7407C0.305129 5.75522 0.222865 5.79428 0.155895 5.85339C0.088925 5.9125 0.0399567 5.98927 0.0145984 6.07492C-0.012732 6.16181 -0.0161775 6.25445 0.00462334 6.34313C0.0254242 6.43181 0.0697048 6.51325 0.132821 6.57892L3.73371 10.2465L2.88393 15.4251C2.86874 15.5147 2.87808 15.6067 2.91094 15.6913C2.94381 15.776 2.99898 15.8502 3.0706 15.906C3.14023 15.9597 3.22403 15.9918 3.31168 15.9984C3.39934 16.0051 3.48702 15.9859 3.56393 15.9434L8.00038 13.498L12.4368 15.9434C12.5137 15.9859 12.6014 16.0051 12.6891 15.9984C12.7767 15.9918 12.8605 15.9597 12.9302 15.906C13.0018 15.8502 13.0569 15.776 13.0898 15.6913C13.1227 15.6067 13.132 15.5147 13.1168 15.4251L12.267 10.2465L15.859 6.5807C15.9225 6.51486 15.9669 6.43311 15.9878 6.34408C16.0086 6.25505 16.0049 6.16206 15.9773 6.07492Z"})})}function fd(e){let{rating:t}=e;const n=Math.max(0,Math.min(5,t)),r=Math.floor(n),o=21.33*r+16*(n-r),i=e=>(0,l.jsx)("div",{style:{display:"flex",gap:5.33},children:Array.from({length:5}).map((t,n)=>(0,l.jsx)(gd,{color:e},n))});return(0,l.jsxs)("div",{style:{position:"relative",display:"inline-flex",flexShrink:0},children:[i("#E8E8ED"),(0,l.jsx)("div",{style:{position:"absolute",top:0,left:0,width:o,overflow:"hidden"},children:i(sd)})]})}function hd(e){if(e>=1e6){const t=e/1e6;return"".concat(Number.isInteger(t)?t.toFixed(0):t.toFixed(1),"M")}if(e>=1e3){const t=e/1e3;return"".concat(Number.isInteger(t)?t.toFixed(0):t.toFixed(1),"K")}return e.toString()}function md(e){let{detail:t,fallbackUnitsSold:n}=e;const r=t.reviewsRating||t.reviewsAverageRating||0,o=t.reviewsCount||0,i=t.unitsSold||n||0;return r<=0&&i<=0?null:(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minHeight:24},children:[r>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(fd,{rating:r}),(0,l.jsxs)("span",{style:{fontSize:12,fontWeight:500,lineHeight:"16px",whiteSpace:"nowrap",color:ud},children:[Math.round(10*r)/10,o>0&&(0,l.jsxs)(l.Fragment,{children:[" from ",o.toLocaleString()," reviews"]})]})]}),i>0&&(0,l.jsxs)("span",{style:{background:cd,borderRadius:100,padding:"2px 8px",fontSize:10,fontWeight:500,lineHeight:"20px",whiteSpace:"nowrap",color:ud},children:[hd(i),"+ sold"]})]})}var vd=n(94513);function yd(e){const t=e.trim().toLowerCase();return t?t.endsWith("s")?t:/[^aeiou]y$/.test(t)?"".concat(t.slice(0,-1),"ies"):"".concat(t,"s"):t}
1function xd(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:2,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:4;if(e<=0)return t.length;const i=t=>t===r-1&&n>0?e-o-n:e;let a=0,l=0,s=0;for(const e of t){const t=0===l?e:o+e;if(l+t<=i(a))l+=t,s+=1;else if(0!==l){if(a+=1,a>=r)return s;if(e>i(a)&&a===r-1&&n>0)return s;l=e,s+=1}else l=e,s+=1}return s}function bd(e){let{label:t,selected:n,options:o,onSelect:i}=e;const a=(0,r.useRef)(null),s=(0,r.useRef)([]),c=(0,r.useRef)(null),[d,u]=(0,r.useState)(!1),[p,g]=(0,r.useState)(0),[f,h]=(0,r.useState)(null),[m,v]=(0,r.useState)(0),y=(0,r.useCallback)(()=>{const e=s.current.slice(0,o.length).map(e=>{var t;return null!==(t=null==e?void 0:e.offsetWidth)&&void 0!==t?t:0});e.some(e=>0===e)||h(t=>t&&t.length===e.length&&t.every((t,n)=>t===e[n])?t:e)},[o.length]);(0,r.useLayoutEffect)(()=>{y()},[y,o]),(0,r.useLayoutEffect)(()=>{var e,t;const n=null!==(e=null==(t=c.current)?void 0:t.offsetWidth)&&void 0!==e?e:0;n<=0||v(e=>Math.max(e,n+10))}),(0,r.useEffect)(()=>{const e=a.current;if(!e)return;if(g(e.clientWidth),"undefined"==typeof ResizeObserver)return;const t=new ResizeObserver(()=>{g(e.clientWidth),y()});return t.observe(e),()=>t.disconnect()},[y]);let x=o.length;if(f&&f.length===o.length&&p>0){const e=xd(p,f,0);x=e>=o.length?o.length:xd(p,f,m)}const b=Math.max(0,o.length-x),w=!d&&b>0,A=b>0;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,l.jsxs)("p",{style:{margin:0,fontSize:14,fontWeight:500,lineHeight:"24px",color:ud},children:[t,n?": ".concat(n):""]}),(0,l.jsxs)("div",{ref:a,style:{display:"flex",flexWrap:"wrap",alignItems:"center",gap:4},children:[o.map((e,t)=>{let{value:r,variant:o,isAvailable:a}=e;const c=r===n,d=!a,u=w&&t>=x;return(0,l.jsx)("button",{ref:e=>{s.current[t]=e},type:"button",disabled:c||!a,onClick:()=>o&&i(o),style:{display:u?"none":"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 12px",borderRadius:100,border:"1px solid ".concat(c?ud:"#DCDDDC"),background:"#fff",fontFamily:"inherit",fontSize:12,fontWeight:500,lineHeight:"20px",color:d?pd:ud,opacity:d?.4:1,cursor:c||!a?"default":"pointer",whiteSpace:"nowrap"},children:r},r)}),A&&(0,l.jsx)("button",{ref:c,type:"button",onClick:()=>u(e=>!e),style:{background:"none",border:"none",padding:"8px 4px",fontFamily:"inherit",fontSize:12,fontWeight:500,lineHeight:"20px",color:ud,textDecoration:"underline",cursor:"pointer",whiteSpace:"nowrap"},children:d?"Show less":"+".concat(b," more ").concat(yd(t))})]})]})}function wd(e){let{detail:t,onSelect:n}=e;const o=(0,r.useMemo)(()=>function(e){var t,n;const r=null!==(t=e.variants)&&void 0!==t?t:[];if(0===r.length)return[];const o=[];for(const t of Object.keys(null!==(i=e.variationNameValues)&&void 0!==i?i:{})){var i;o.includes(t)||o.push(t)}for(const e of r)for(const t of Object.keys(null!==(a=e.variationNameValues)&&void 0!==a?a:{})){var a;o.includes(t)||o.push(t)}const l=r.some(e=>"number"==typeof e.variantPosition),s=l?[...r].sort((e,t)=>{const n=e.variantPosition,r=t.variantPosition;return"number"==typeof n&&"number"==typeof r&&n!==r?n-r:"number"==typeof n&&"number"!=typeof r?-1:"number"!=typeof n&&"number"==typeof r?1:0}):r,c=(e,t)=>e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}),d=e=>/^\s*\d/.test(e),u=[];for(const e of o){const t=[];for(const r of s){const o=null==(n=r.variationNameValues)?void 0:n[e];o&&!t.includes(o)&&t.push(o)}if(t.length>1){const n=!l&&t.every(d)?[...t].sort(c):t;u.push({key:e,label:e,values:n})}}return u}(t),[t]);return 0===o.length?null:(0,l.jsx)(l.Fragment,{children:o.map(e=>{let{key:r,label:o,values:i}=e;var a;const s=null==(a=t.variationNameValues)?void 0:a[r],c=i.map(e=>{const n=((e,n)=>{var r;return null==(r=t.variants)?void 0:r.find(r=>{var o,i;return(null==(i=r.variationNameValues)?void 0:i[e])===n&&Object.entries(null!==(o=t.variationNameValues)&&void 0!==o?o:{}).every(t=>{let[n,o]=t;var i;return n===e||(null==(i=r.variationNameValues)?void 0:i[n])===o})})})(r,e);return{value:e,variant:n,isAvailable:!!n&&!1!==n.isAvailable&&n.availabilityStatus!==vd.Zi.OutOfStock}}).sort((e,t)=>
1Number(t.isAvailable)-Number(e.isAvailable));return(0,l.jsx)(bd,{label:o,selected:s,options:c,onSelect:n},r)})})}function Ad(e){var t;let{detail:n,onUnavailable:o}=e;const{commerce:i}=(0,Lt.Ox)(),{bag:a}=(0,na.T)(),[s,c]=(0,r.useState)("idle");(0,r.useEffect)(()=>{c("idle")},[n.stacklineSku]),(0,r.useEffect)(()=>{if("added"!==s)return;const e=setTimeout(()=>c("idle"),2e3);return()=>clearTimeout(e)},[s]);const d={stacklineSku:n.stacklineSku,title:n.title,retailerId:n.retailerId,retailerProductPageUrl:n.retailerProductPageUrl,quantity:1,retailerSku:n.retailerSku,brandId:n.brandId,retailPrice:n.retailPrice,isAvailable:n.isAvailable};if(!i||!i.canAddToCart(d)||"failed"===s)return null;const u="adding"===s?"Addingâ¦":"added"===s?"Added â":"Add to ".concat(a);return(0,l.jsx)("button",{type:"button",onClick:async()=>{if("adding"!==s){c("adding");try{const e=await i.addToCart(d);c(e.ok?"added":"failed"),e.ok||null==o||o()}catch(e){c("failed"),null==o||o()}}},disabled:"adding"===s,"aria-label":"Add ".concat(null!==(t=n.title)&&void 0!==t?t:"product"," to ").concat(a),"data-concierge-filled-action":"",style:{display:"inline-flex",alignItems:"center",justifyContent:"center",backgroundColor:ud,color:"#FFFFFF",border:"none",borderRadius:100,padding:"8px 16px",fontFamily:"inherit",fontSize:12,fontWeight:500,lineHeight:"20px",whiteSpace:"nowrap",flexShrink:0,cursor:"adding"===s?"default":"pointer",opacity:"adding"===s?.7:1},children:u})}function Cd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function jd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Cd(Object(n),!0).forEach(function(t){Sd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Cd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Sd(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function kd(e){try{(async function(e){const t=await(0,o.lw)();await(0,tl.u4)(nl.A.WEB_APP_ORGANIC_OPEN_RETAILER_PRODUCT_PAGE,jd(jd(jd(jd(jd(jd(jd(jd(jd(jd({organicType:"openRetailerProductPage",sku:e.stacklineSku,stacklineSku:e.stacklineSku},e.retailerSku?{retailerSku:e.retailerSku}:{}),null!=e.retailerId?{retailerId:e.retailerId}:{}),e.retailerName?{retailerName:e.retailerName}:{}),null!=e.retailPrice?{retailPrice:e.retailPrice}:{}),e.retailerProductPageUrl?{retailerProductPageUrl:e.retailerProductPageUrl}:{}),void 0===e.isAvailable?{}:{availabilityStatus:e.isAvailable?"InStock":"OutOfStock"}),t?{v_id:t}:{}),e.conversationId?{conversationId:e.conversationId}:{}),e.appId?{appId:e.appId}:{}),{},{source:"concierge_product_detail_view"})).catch(()=>{})})(e).catch(()=>{})}catch(e){}}function Od(e){return"$".concat(e.toFixed(2))}function Id(e){return!!e&&e>0&&e<1e5}function Pd(e){return Id(e)?"https://media.brandclub.com/retailer_logo/".concat(e,".webp"):null}function Ed(e){let{detail:t}=e;const{price:n,originalPrice:o,savingsPercent:i}=function(e){var t,n,r;const o=null!==(t=e.activeProductPromotion)&&void 0!==t?t:null==(r=e.productPromotions)?void 0:r.find(e=>e.isActive);if((null==o?void 0:o.isActive)&&o.promoPrice>0){const e=o.promoPrice,t=o.listPrice>e?o.listPrice:null;return{price:e,originalPrice:t,savingsPercent:o.discountPercentage?Math.round(100*o.discountPercentage):t?Math.round((t-e)/t*100):null}}return{price:null!==(n=e.retailPrice)&&void 0!==n?n:0,originalPrice:null,savingsPercent:null}}(t),{commerce:a}=(0,Lt.Ox)(),[s,c]=(0,r.useState)(!1);(0,r.useEffect)(()=>c(!1),[t.stacklineSku]);
1const d=!s&&!!a&&a.canAddToCart({stacklineSku:t.stacklineSku,retailerId:t.retailerId,retailerProductPageUrl:t.retailerProductPageUrl,retailerSku:t.retailerSku,isAvailable:t.isAvailable}),u=Id(t.retailerId),p=u?Pd(t.retailerId):t.brandId?(0,xr.LO)(t.brandId):null,g=(u?t.retailerName:t.brandName)||t.brandName||t.retailerName;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:8},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[p&&(0,l.jsx)("img",{src:p,alt:"","aria-hidden":"true",onError:e=>{e.currentTarget.style.display="none"},style:{width:24,height:24,borderRadius:"50%",objectFit:"contain",flexShrink:0}}),g&&(0,l.jsx)("span",{style:{fontSize:16,fontWeight:500,lineHeight:"20px",color:ud,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:g})]}),d?(0,l.jsx)(Ad,{detail:t,onUnavailable:()=>c(!0)}):t.retailerProductPageUrl&&(0,l.jsx)("a",{href:t.retailerProductPageUrl,target:"_blank",rel:"noreferrer",onClick:()=>kd({stacklineSku:t.stacklineSku,retailerSku:t.retailerSku,retailerId:t.retailerId,retailerName:t.retailerName,retailPrice:n,retailerProductPageUrl:t.retailerProductPageUrl,isAvailable:t.isAvailable}),style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 16px",borderRadius:100,background:ud,color:"#ffffff",fontFamily:"inherit",fontSize:12,fontWeight:500,lineHeight:"20px",textDecoration:"none",whiteSpace:"nowrap",flexShrink:0},children:"View"})]}),(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,paddingLeft:32},children:[(0,l.jsx)("span",{style:{fontSize:14,fontWeight:600,lineHeight:"20px",color:ud},children:Od(n)}),null!=o&&(0,l.jsx)("span",{style:{fontSize:10,fontWeight:400,lineHeight:"16px",color:pd,textDecoration:"line-through"},children:Od(o)}),null!=i&&i>0&&(0,l.jsxs)("span",{style:{background:cd,borderRadius:100,padding:"2px 8px",fontSize:10,fontWeight:500,lineHeight:"20px",whiteSpace:"nowrap",color:ud},children:[i,"% savings"]})]})]})}function Vd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vd(Object(n),!0).forEach(function(t){Bd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bd(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ld(e){let{title:t,detail:n}=e;const r={margin:0,fontSize:16,fontWeight:500,lineHeight:"24px",color:ud},o=null==n?void 0:n.retailerProductPageUrl;return n&&o?(0,l.jsx)("a",{href:o,target:"_blank",rel:"noreferrer",onClick:()=>kd({stacklineSku:n.stacklineSku,retailerSku:n.retailerSku,retailerId:n.retailerId,retailerName:n.retailerName,retailPrice:n.retailPrice,retailerProductPageUrl:o,isAvailable:n.isAvailable}),style:Fd(Fd({},r),{},{display:"block",textDecoration:"none",cursor:"pointer"}),children:t}):(0,l.jsx)("p",{style:r,children:t})}function Rd(){return(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,l.jsx)("path",{d:"M13.1907 4.51033C13.1217 4.43348 13.0228 4.39221 12.9211 4.39221H10.775V2.71784C10.775 2.51717 10.6114 2.35352 10.4107 2.35352H0.696354C0.495688 2.35352 0.332031 2.51717 0.332031 2.71784V12.0081C0.332031 12.2087 0.495688 12.3724 0.696354 12.3724H1.84768C2.01347 13.101 2.66526 13.6475 3.44508 13.6475C4.2249 13.6475 4.87675 13.101 5.04248 12.3724H10.4141C10.4362 12.3724 10.4597 12.3703 10.4796 12.3653C10.5016 12.3688 10.523 12.3724 10.545 12.3724H11.3192C11.485 13.101 12.1368 13.6475 12.9166 13.6475C13.6965 13.6475 14.3483 13.101 14.514 12.3724H15.301C15.5017 12.3724 15.6654 12.2087 15.6654 12.0081V7.36508C15.6654 7.274 15.6305 7.18647 15.5707 7.11887L13.1934 4.5088L13.1907 4.51033ZM3.44298 12.9189C2.9399 12.9189 2.53218
112.5112 2.53218 12.0081C2.53218 11.505 2.9399 11.0973 3.44298 11.0973C3.94607 11.0973 4.35379 11.505 4.35379 12.0081C4.35379 12.5112 3.94607 12.9189 3.44298 12.9189ZM10.0463 11.6438H5.03902C4.87323 10.9151 4.22144 10.3686 3.44162 10.3686C2.6618 10.3686 2.00995 10.9151 1.84421 11.6438H1.05722L1.0565 3.08218H10.0444V11.6438H10.0463ZM12.9154 12.9189C12.4123 12.9189 12.0046 12.5112 12.0046 12.0081C12.0046 11.505 12.4123 11.0973 12.9154 11.0973C13.4185 11.0973 13.8262 11.505 13.8262 12.0081C13.8262 12.5112 13.4185 12.9189 12.9154 12.9189ZM14.9334 11.6438H14.5107C14.345 10.9151 13.6932 10.3686 12.9133 10.3686C12.1335 10.3686 11.4817 10.9151 11.3159 11.6438H10.773V5.12072H12.7583L14.9315 7.50734V11.6444L14.9334 11.6438Z",fill:"currentColor"})})}function Td(){return(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 14.6667 14.6667",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,l.jsx)("path",{d:"M14.6667 10.7738L14.4868 10.1987L12.6464 10.7091L11.0588 5.64303C10.9424 5.27391 10.5289 5.06061 10.1369 5.17089L9.58954 5.32292L8.37383 1.44385C8.31795 1.26476 8.19109 1.11698 8.01662 1.02764C7.84256 0.937993 7.64212 0.917783 7.45144 0.971255L6.35273 1.27665L6.26445 1.30126L5.14569 1.61218L4.53516 1.78151L3.33916 2.11411L3.13287 1.45574C3.02747 1.11921 2.75476 0.848387 2.40348 0.730891L0.212481 0L0 0.565008L2.191 1.29606C2.3507 1.34937 2.47481 1.47255 2.52291 1.6256L2.72921 2.28397L2.72453 2.2853L4.32989 7.40751L4.3309 7.40719L5.47688 11.0642C4.80162 11.3711 4.3309 12.0168 4.3309 12.7688C4.3309 13.8153 5.23493 14.6667 6.34625 14.6667C7.45757 14.6667 8.36146 13.8153 8.36146 12.7688C8.36146 12.687 8.34659 12.6089 8.33583 12.5297L14.6667 10.7738ZM10.317 5.74558C10.3741 5.72882 10.4326 5.76076 10.4487 5.81306L12.0349 10.8748L8.15817 11.9522C8.15333 11.9426 8.14674 11.9341 8.14173 11.9247C8.08376 11.816 8.0161 11.7139 7.93803 11.6183C7.89651 11.5666 7.85392 11.5163 7.80739 11.4692C7.77883 11.4408 7.74943 11.414 7.71912 11.3872C7.65389 11.329 7.58499 11.2756 7.51215 11.2264C7.49294 11.2133 7.47514 11.199 7.4552 11.1866C7.35667 11.1249 7.25251 11.0714 7.1439 11.0272C7.12644 11.02 7.10807 11.0152 7.09027 11.0085C6.99715 10.9735 6.90076 10.9456 6.80162 10.9239C6.77148 10.9174 6.74191 10.9107 6.71143 10.9055C6.59235 10.885 6.47106 10.8707 6.34612 10.8707C6.2615 10.8707 6.17673 10.877 6.08896 10.8891L4.94524 7.23827L6.61433 6.77463L7.24909 8.80013L8.87377 8.34874L8.87794 8.34758L9.38133 8.20743L9.2325 7.73254C9.23216 7.73121 9.23166 7.72978 9.23126 7.7283L8.74652 6.18191L10.317 5.74558ZM8.59077 7.80245L7.67948 8.05566L7.22471 6.60501L8.13634 6.35177L8.59077 7.80245ZM5.92286 2.02092L6.24633 3.0528L5.64932 3.21869L5.32603 2.1868L5.92286 2.02092ZM4.71566 2.35645L5.06903 3.4843C5.10903 3.61226 5.19967 3.71782 5.32427 3.78154C5.40319 3.82196 5.48955 3.84249 5.57709 3.84249C5.62745 3.84249 5.67815 3.83564 5.72801 3.8218L6.52805 3.59937C6.80858 3.52149 6.96952 3.24331 6.88694 2.97897L6.5334 1.85144L7.63227 1.54604C7.66827 1.53612 7.69857 1.54668 7.71294 1.55405C7.7273 1.56137 7.7531 1.57899 7.76398 1.61352L8.97878 5.49042L4.76479 6.66145L3.51967 2.68867L4.71566 2.35645ZM6.34654 14.0671C5.58616 14.0671 4.96764 13.4846 4.96764 12.7686C4.96764 12.2147 5.33972 11.7441 5.85938 11.558L5.95577 11.5309C6.02291 11.5124 6.08364 11.4995 6.14235 11.4895C6.20949 11.4801 6.27664 11.4701 6.34655 11.4701C6.43392 11.4701 6.51875 11.4797 6.60163 11.4944C6.62743 11.499 6.65216 11.5063 6.67745 11.5122C6.73367 11.5254 6.78871 11.5409 6.842 11.5604C6.87022 11.5707 6.89771 11.5819 6.92486 11.594C6.97156 11.6145 7.0164 11.6382 7.06017 11.6633C7.0884 11.6797 7.11729 11.6952 7.14411 11.7135C7.17802 11.7363 7.20884 11.7627 7.24033 11.7883C7.4336 11.947 7.58368 12.1552 7.66152 12.4028L7.6987 12.5211C7.71532 12.6014 7.72535 12.6841 7.72535 12.7688C7.72535 13.4847 7.10681 14.0671 6.34654 14.0671ZM6.34654 11.8712C5.82112 11.8712 5.39351 12.2739 5.39351 12.7687C5.39351 13.2635 5.82112 13.6661 6.34654 13.6661C6.87212 13.6661 7.29975 13.2635 7.29975 12.7687C7.29975 12.2739 6.87213 11.8712 6.34654 11.8712ZM6.34654 13.0667C6.17192 13.0667 6.03001 12.9329 6.03001 12.7686C6.03001 12.6043 6.17191 12.4705 6.34654 12.4705C6.52117 12.4705 6.66324 12.6043 6.66324 12.7686C6.66324 12.9329 6.52117 13.0667 6.34654 13.0667Z",fill:"currentColor"})})}function Md(){return(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M10.1065 1.73766C12.6464 2.56444 14.5023 4.82836 14.7649 7.54851C15.1249 11.2831 12.3852 14.608 8.65062 14.9681C4.91603 15.3287 1.59111 12.5891 1.23102 8.85383C0.900427 5.42711 3.18088 2.31442 6.50515 1.5686C6.59101 1.5502 6.67873 1.56738 6.7511 1.61583C6.82286 1.66429 6.87192 1.73973 6.88664 1.82498C6.88848 1.82743 6.88848 1.8305 6.88909 1.83295C6.91792 1.99732 6.8112 2.15495 6.64805 2.18991C3.63232 2.86397 1.5647 5.68597 1.8646 8.79251C2.1909 12.178 5.20482 14.6609 8.58927 14.3346C11.9744 14.0083 14.4577 10.9949 14.1314 7.60993C13.8934 5.14309 12.2098 3.09091 9.90611 2.34195L10.1392 2.64065C10.2477 2.77865 10.2232 2.97921 10.0846 3.08716C9.94597 3.1951 9.74
1602 3.17057 9.63745 3.03196L8.83152 1.99909C8.8119 1.97517 8.79718 1.94941 8.78614 1.92119C8.734 1.78994 8.77448 1.63906 8.88611 1.55257C8.91003 1.53356 8.9364 1.51884 8.96339 1.5078L10.1815 1.02265C10.3446 0.957636 10.5305 1.03737 10.5949 1.20052C10.6605 1.36367 10.5808 1.5489 10.4176 1.61392L10.1065 1.73766ZM4.16641 6.45543C4.16703 6.40513 4.17807 6.35668 4.20076 6.31252L4.95762 4.79942C5.08765 4.53875 5.35445 4.37376 5.64579 4.37376H10.3759C10.6684 4.37376 10.9346 4.53875 11.0646 4.79942L11.8221 6.31252C11.8436 6.35668 11.8552 6.40513 11.8552 6.45543V11.3046C11.8546 11.5057 11.7755 11.6983 11.6332 11.84C11.4915 11.9823 11.2983 12.062 11.0971 12.062H4.92464C4.72408 12.062 4.53149 11.9823 4.38919 11.84C4.2469 11.6983 4.16716 11.5057 4.16716 11.3046L4.16641 6.45543ZM4.99994 6.1371L7.693 6.13649L7.69239 5.01041H5.6457C5.59541 5.01041 5.54941 5.03923 5.52671 5.08401L4.99994 6.1371ZM11.2185 6.77375H4.80367V11.3044C4.80367 11.3363 4.81594 11.3676 4.83863 11.3903C4.86194 11.4124 4.8926 11.4252 4.9245 11.4252H11.0977C11.1296 11.4252 11.1608 11.4124 11.1829 11.3903C11.2056 11.367 11.2185 11.3363 11.2185 11.3044L11.2185 6.77375ZM11.0222 6.13649L10.496 5.08399C10.4727 5.03922 10.4267 5.01039 10.3764 5.01039H8.3297L8.32909 6.13709L11.0222 6.13649ZM6.53018 7.41899C6.70559 7.41899 6.84788 7.5619 6.8485 7.73731C6.8485 7.9
11272 6.7062 8.05563 6.53018 8.05563H5.68376C5.50835 8.05563 5.36606 7.91272 5.36606 7.73731C5.36544 7.56128 5.50897 7.41899 5.68376 7.41899H6.53018Z",fill:"currentColor"})})}function Dd(e){let{detail:t}=e;var n,r;const o=!0===t.freeShipping,i=(null==(n=t.shippingEstimate)?void 0:n.trim())||void 0,a=(null==(r=t.returnsPolicy)?void 0:r.trim())||void 0;return o||null!=i||null!=a?(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[o&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(Rd,{}),(0,l.jsx)("span",{style:{fontSize:12,fontWeight:400,lineHeight:"16px",color:ud},children:"Free shipping"})]}),null!=i&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(Td,{}),(0,l.jsx)("span",{style:{fontSize:12,fontWeight:400,lineHeight:"16px",color:ud},children:i})]}),null!=a&&(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)(Md,{}),(0,l.jsx)("span",{style:{fontSize:12,fontWeight:400,lineHeight:"16px",color:ud},children:a})]})]}):null}function Nd(e){let{amount:t}=e;return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,l.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{flexShrink:0},children:(0,l.jsx)("path",{d:"M13.5517 0.260425C13.4846 0.260425 13.4208 0.286988 13.3744 0.334137C13.3272 0.38195 13.3013 0.445702 13.3013 0.512102C13.3013 1.58989 12.432 2.45708 11.3542 2.45708C11.325 2.45708 11.2964 2.46239 11.2685 2.47235C11.2546 2.477 11.2413 2.48364 11.2287 2.49095C11.2035 2.50556 11.1815 2.52481 11.163 2.54739C11.1537 2.55868 11.145 2.57064 11.1377 2.58325C11.1231 2.60849 11.1125 2.63638 11.1078 2.6656C11.1052 2.67954 11.1039 2.69415 11.1039 2.70876C11.1045 2.83029 11.1915 2.93389 11.311 2.95514C11.325 2.9578 11.3396 2.95912 11.3542 2.95912C12.432 2.95912 13.3013 3.82773 13.3013 4.90552H13.3006C13.3013 5.04365 13.4129 5.
115521 13.551 5.15588C13.6181 5.15654 13.6818 5.12998 13.729 5.08283C13.7761 5.03568 13.8033 4.97193 13.8033 4.90552C13.8033 3.82772 14.6706 2.95912 15.7483 2.95912H15.7477C15.8865 2.95979 15.9993 2.84756 16 2.70876C16 2.64169 15.9741 2.57794 15.9263 2.53013C15.8791 2.48298 15.8147 2.45642 15.7477 2.45709C14.6699 2.45709 13.8027 1.5898 13.8027 0.512108H13.8033C13.8033 0.445036 13.7768 0.380622 13.7296 0.333478C13.6825 0.286333 13.6181 0.259766 13.551 0.259766L13.5517 0.260425ZM13.5523 1.59057C13.7914 2.07535 14.1859 2.46915 14.67 2.70821C14.1859 2.94728 13.7907 3.34241 13.5523 3.82717C13.3133 3.3424 12.9188 2.94728 12.434 2.70821C12.9188 2.46915 13.3133 2.07468 13.5523 1.59057ZM5.83646 2.45653C5.83447 2.45653 5.83248 2.45719 5.83048 2.45719H1.7106C1.61032 2.45719 1.52001 2.51696 1.48016 2.60861L0.0212505 5.97353H0.0219146C0.0212505 5.97486 0.0212505 5.97619 0.0205864 5.97752C0.0146097 5.99412 0.00929705 6.01072 0.00664075 6.02865C0.0053126 6.03463 0.00464859 6.04127 0.00398445 6.04791C0.00199229 6.05654 0.000664004 6.06518 0 6.07381C0.000664075 6.08111 0.00199215 6.08842 0.00398445 6.09572C0.00464852 6.10369 0.00597664 6.11233 0.00730493 6.12029C0.00996123 6.13623 0.0146096 6.15084 0.0199222 6.16545C0.023906
17 6.17475 0.0285553 6.18338 0.0332037 6.19201C0.0391805 6.20397 0.0458211 6.21526 0.0537897 6.22588L0.0557819 6.22987L1.52603 8.06675H1.52536C1.5672 8.11921 1.62829 8.15242 1.6947 8.16039C1.76111 8.16769 1.82751 8.14777 1.87997 8.10593C1.98755 8.0196 2.00482 7.86155 1.91849 7.75397L0.774951 6.32481H4.45325L7.10686 14.2339L4.31045 10.7429L4.30978 10.7416C4.22345 10.634 4.06607 10.6167 3.95782 10.7031C3.85024 10.7901 3.83298 10.9474 3.9193 11.055L7.59704 15.6503V15.651C7.60036 15.653 7.60301 15.6557 7.60634 15.6583V15.659C7.61032 15.6623 7.61364 15.6656 7.61762 15.6689C7.62559 15.6762 7.63356 15.6829 7.6422 15.6895C7.64618 15.6935 7.65083 15.6975 7.65548 15.7015C7.66345 15.7068 7.67142 15.7114 7.68005 15.7154C7.68603 15.7181 7.692 15.7201 7.69798 15.7221L7.71392 15.73C7.7179 15.7307 7.72188 15.732 7.72587 15.7327C7.74048 15.7367 7.75509 15.74 7.77036 15.7413C7.77833 15.742 7.78564 15.742 7.7936 15.742C7.80157 15.742 7.80954 15.742 7.81751 15.7413C7.83212 15.7393 7.84673 15.7367 7.86068 15.7327C7.86532 15.732 7.86931 15.7307 7.87329 15.73C7.88392 15.7261 7.89454 15.7221 7.90517 15.7168C7.9065 15.7154 7.90783 15.7148 7.90915 15.7141C7.91779 15.7094 7.92576 15.7041 7.93372 15.6988C7.95099 15.6869 7.96693 15.6729 7.98087 15.6577C7.98419 15.655 7.98685 15.6523 7.98951 15.6497L15.5314 6.2284C15.5327 6.22707 15.5341 6.22508 15.5354 6.22308C15.5367 6.22043 15.5387 6.21777 15.54 6.21578C15.5533 6.19652 15.5646 6.17593 15.5726 6.15402C15.5732 6.15136 15.5739 6.14937 15.5739 6.14738C15.5812 6.12414 15.5852 6.10023 15.5852 6.07632C15.5859 6.07499 15.5859 6.07367 15.5865 6.07167C15.5865 6.06968 15.5859 6.06769 15.5859 6.06636C15.5859 6.06304 15.5859 6.06039 15.5852 6.05773V6.0471C15.5845 6.04511 15.5845 6.04312 15.5845 6.04113C15.5845 6.0398 15.5839 6.03847 15.5839 6.03714C15.5812 6.01855 15.5766 5.99995 15.5699 5.98269C15.5686 5.9787 15.5673 5.97538 15.5653 5.9714L14.8109 4.23283C14.785 4.17107 14.7352 4.1226 14.6728 4.09803C14.6103 4.07346 14.5406 4.07478 14.4795 4.10135C14.4184 4.12791 14.3699 4.17772 14.3454 4.24014C14.3215 4.30256 14.3228 4.37162 14.3494 4.43272L14.9503 5.81931H11.1305L10.1052 2.95717H10.4233C10.5607 2.95717 10.673 2.8456 10.673 2.70748C10.6736 2.64107 10.6471 2.57665 10.6006 2.52951C10.5534 2.48236 10.4897 2.4558 10.4233 2.45514H5.84055C5.83922 2.45514 5.83723 2.45514 5.83524 2.45447L5.83646 2.45653ZM1.87595 2.95922H5.47988L4.45654 5.82137H0.634875L1.87595 2.95922ZM6.01312 2.95922H9.5727L10.596 5.82137H4.9899L6.01312 2.95922ZM4.98181 6.32415H10.6058L7.79338 14.7062L4.98181 6.32415ZM11.1339 6.32415H14.8122L8.48104 14.2333L11.1339 6.32415ZM2.57467 7.43249C2.43587 7.43249 2.32298 7.54405 2.32232 7.68285C2.32232 8.76064 1.4557 9.62995 0.377772 9.62995C0.311364 9.62928 0.247613 9.65585 0.200459 9.70233C0.152645 9.74948 0.126082 9.81323 0.126082 9.87965C0.125418 9.94672 0.151981 10.0111 0.199794 10.0583C0.246943 10.1061 0.311359 10.132 0.377759 10.132C1.45555 10.132 2.32231 10.9993 2.32231 12.077C2.32231 12.144 2.34887 12.2078 2.39602 12.2556C2.44317 12.3027 2.50759 12.3293 2.57465 12.3286C2.64106 12.3286 2.70548 12.3021 2.75197 12.2549C2.79912 12.2078 2.82568 12.1434 2.82501 12.077C2.82501 10.9992 3.69362 10.132 4.77141 10.132C4.83848 10.132 4.90223 10.1048 4.94872 10.0576C4.99587 10.0105 5.02177 9.94671 5.02177 9.87965C5.02111 9.74218 4.90954 9.63062 4.77141 9.62996C3.69362 9.62996 2.82502 8.76069 2.82502 7.68285C2.82502 7.54473 2.71279 7.43315 2.57467 7.43249ZM2.57334 8.7613C2.8124 9.24608 3.20753 9.6412 3.6923 9.88026C3.20752 10.1193 2.8124 10.5138 2.57334 10.9979C2.33427 10.5138 1.93981 10.1187 1.45569 9.88026C1.93981 9.6412 2.33492 9.24607 2.57334 8.7613Z",fill:"currentColor"})}),(0,l.jsxs)("span",{style:{fontSize:12,fontWeight:400,lineHeight:"16px",color:ud},children:["Earn a ",Od(t)," reward on this purchase"]})]})}function zd(e){let{products:t}=e;const n=t.reduce((e,t)=>{var n;const r=Od(null!==(n=t.retailPrice)&&void 0!==n?n:0);return r.length>e.length?r:e},"");return(0,l.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:"16px"},children:t.map(e=>{var t;const r=Pd(e.retailerId),o=e.retailerName||"";return(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,l.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,minWidth:0},children:[r&&(0,l.jsx)("img",{src:r,alt:"","aria-hidden":"true",onError:e=>{e.currentTarget.style.display="none"},style:{width:20,height:20,borderRadius:"50%",objectFit:"contain",flexShrink:0}}),(0,l.jsx)("span",{style:{fontSize:16,fontWeight:500,lineHeight:"20px",color:ud,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:o})]}),(0,l.jsxs)("a",{href:e.retailerProductPageUrl,target:"_blank",rel:"noreferrer",onClick:()=>kd({stacklineSku:e.stacklineSku,retailerSku:e.retailerSku,retailerId:e.retailerId,retailerName:e.retailerName,retailPrice:e.retailPrice,retailerProductPageUrl:e.retailerProductPageUrl}),style:{display:"inline-grid",placeItems:"center",padding:"8px 16px",borderRadius:100,border:"1px solid #DCDDDC",background:"#fff",color:ud,fontFamily:"inherit",fontSize:12,fontWeight:500,lineHeight:"20px",textDecoration:"none",whiteSpace:"nowrap",flexShrink:0},children:[(0,l.jsxs)("span",{"aria-hidden":"true",style:{gridArea:"1 / 1",visibility:"hidden"},children:["View ⢠",n]}),(0,l.jsxs)("span",{style:{gridArea:"1 / 1"},children:["View ⢠",Od(null!==(t=e.retailPrice)&&void 0!==t?t:0)]})]})]}
1,e.stacklineSku)})})}function Wd(e){let{bullets:t}=e;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:"16px"},children:[(0,l.jsx)("p",{style:{margin:0,fontSize:16,fontWeight:500,lineHeight:"20.8px",color:ud},children:"Key features"}),(0,l.jsx)("ul",{style:{margin:0,padding:0,listStyle:"none",display:"flex",flexDirection:"column",gap:12},children:t.map((e,t)=>(0,l.jsxs)("li",{style:{display:"flex",alignItems:"flex-start",gap:16,padding:"0",fontSize:14,fontWeight:400,lineHeight:"20px",color:ud},children:[(0,l.jsx)("span",{"aria-hidden":"true",style:{flexShrink:0,height:20,display:"flex",alignItems:"center"},children:(0,l.jsx)("span",{style:{width:4,height:4,borderRadius:"50%",background:"currentColor"}})}),(0,l.jsx)("span",{style:{flex:1,fontSize:14,fontWeight:400,lineHeight:"20px"},children:e})]},t))})]})}function Ud(e){let{text:t}=e;return(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:"16px"},children:[(0,l.jsx)("p",{style:{margin:0,fontSize:16,fontWeight:500,lineHeight:"20.8px",color:ud},children:"Description"}),(0,l.jsx)("p",{style:{margin:0,fontSize:14,fontWeight:400,lineHeight:"20px",color:ud,whiteSpace:"pre-line"},children:t})]})}function Hd(e){let{onClick:t}=e;return(0,l.jsx)("button",{type:"button",onClick:t,"aria-label":"Close product details",style:{position:"absolute",top:16,right:16,display:"inline-flex",alignItems:"center",justifyContent:"center",width:36,height:36,padding:0,border:"1px solid #DCDDDC",borderRadius:100,background:"#ffffff",cursor:"pointer",transition:"background-color 150ms ease"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor="#F5F5F5"},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="#ffffff"},children:(0,l.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M8.06127 7.00013L12.7801 2.28108C13.0733 1.98814 13.0733 1.51283 12.7801 1.21989C12.4869 0.926703 12.0122 0.926703 11.719 1.21989L7.00013 5.93894L2.28103 1.21989C1.98785 0.926703 1.51307 0.926703 1.21989 1.21989C0.926705 1.51283 0.926705 1.98814 1.21989 2.28108L5.93899 7.00013L1.21989 11.7192C0.926705 12.0121 0.926705 12.4874 1.21989 12.7804C1.36648 12.9267 1.55859 13 1.75046 13C1.94232 13 2.13444 12.9267 2.28103 12.7801L7.00013 8.06106L11.719 12.7801C11.8656 12.9267 12.0577 13 12.2496 13C12.4414 13 12.6335 12.9267 12.7801 12.7801C13.0733 12.4872 13.0733 12.0119 12.7801 11.7189L8.06127 7.00013Z",fill:"#031425"})})})}function Qd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Zd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Qd(Object(n),!0).forEach(function(t){qd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Qd(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function qd(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Yd(e,t){if(!("number"!=typeof e||"number"!=typeof t||t<=e))return{isActive:!0,promoPrice:e,listPrice:t,discountPercentage:(t-e)/t,discountAmount:t-e,promoType:"",updatedTime:"","@promoUpdatedTime":""}}function Kd(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Gd(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Kd(Object(n),!0).forEach(function(t){Jd(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kd(Object(n)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Jd(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Xd(){return(0,l.jsx)("div",{style:{height:1,backgroundColor:dd,margin:"0 16px"}})}function _d(){var e,t;let{variant:n="sidebar"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var o;const{productPanelProduct:i,closeProductPanel:a,openProductPanel:s,apiBaseUrl:c}=(0,Lt.Ox)(),{themeColors:u}=(0,d.FG)(),p=null==u?void 0:u.textPrimary,g=Ct(),h=null!=i,m=null!==(e=null==i?void 0:i.stacklineSku)&&void 0!==e?e:null,v=null!==(t=null==i?void 0:i.parentStacklineSku)&&void 0!==t?t:null,[y,x]=(0,r.useState)(null);(0,r.useEffect)(()=>{if(!h)return;const e=e=>{"Escape"===e.key&&a()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[h,a]),(0,r.useEffect)(()=>{if(!v)return void x(null);const e=w.getCachedWithVariants(v,c);if(e)return void x(e);x(e=>(null==e?void 0:e.stacklineSku)===v?e:null);let t=!1;return(async()=>{try{const e=await(0,f.fk)(),n=await w.fetchWithVariantsCached({stacklineSku:v,headersToInject:e,apiBaseUrl:c});t||x(n)}catch(e){}})(),()=>{t=!0}},[v,c]);const b=y&&m?null==(o=y.variants)?void 0:o.find(e=>e.stacklineSku===m):void 0,A=(0,r.useMemo)(()=>function(e,t){var n,r,o,i,a,l,s;if(!e||!t)return e;const c=null==(l=t.offers)?void 0:l.find(e=>e.isPrimary),d=(u=t.offers,Math.max(...(null!=u?u:[]).map(e=>e.rewardAmount).filter(e=>"number"==typeof e),0));var u;const p=(null==(s=t.featureBullets)?void 0:s.length)?t.featureBullets:void 0;return Zd(Zd({},e),{},{stacklineSku:null!==(n=null==c?void 0:c.stacklineSku)&&void 0!==n?n:t.stacklineSku,title:t.title,imageUrl:t.imageUrl,retailPrice:t.retailPrice,compareAtPrice:t.compareAtPrice,retailerProductPageUrl:t.retailerProductPageUrl,retailerId:null==c?void 0:c.retailerId,retailerSku:null==c?void 0:c.retailerSku,retailerName:null==c?void 0:c.retailerName,isAvailable:null!==(r=t.isAvailable)&&void 0!==r?r:e.isAvailable,checkoutEligible:null!==(o=t.checkoutEligible)&&void 0!==o?o:e.checkoutEligible,whereToBuyFallback:null!==(i=t.whereToBuyFallback)&&void 0!==i?i:e.whereToBuyFallback,whereToBuyOfferRetailerIds:null!==(a=t.whereToBuyOfferRetailerIds)&&void 0!==a?a:e.whereToBuyOfferRetailerIds,featureBullets:null!=p?p:e.featureBullets,offers:t.offers,variationNameValues:t.variationNameValues,totalRewardAmount:d,hasRewards:d>0,activeProductPromotion:Yd(t.retailPrice,t.compareAtPrice)})}(y,b),[y,b]),C=(null==b?void 0:b.imageUrl)||(null==i?void 0:i.imageUrl)||(A?(0,xr.le)(A).src:void 0),j=(null==A?void 0:A.titleCleansed)||(null==A?void 0:A.title)||(null==i?void 0:i.title)||"",S=(0,r.useMemo)(()=>{if(!A)return[];const e=function(e,t){var n,r,o;return e?null!=e.parentStacklineSku?null!==(n=e.offers)&&void 0!==n?n:[]:null!==(r=null!==(o=null==t?void 0:t.offers)&&void 0!==o?o:e.offers)&&void 0!==r?r:[]:[]}(A,b).filter(e=>!e.isPrimary&&"number"==typeof e.retailPrice&&e.retailPrice>0);return function(e,t){var n;const r=!0===t.checkoutEligible,o=!0===t.whereToBuyFallback;if(r&&!o)return[];if(!t.whereToBuyOfferRetailerIds)return e;const i=new Set(t.whereToBuyOfferRetailerIds),a=e.filter(e=>null!=e.retailerId&&i.has(e.retailerId));if(a.length)return a;const l=r&&!1!==t.isAvailable&&(null!==(n=t.retailPrice)&&void 0!==n?n:0)>0;return o&&!l?e:[]}(e,A).sort((e,t)=>{var n,r;return(null!==(n=e.retailPrice)&&void 0!==n?n:0)-(null!==(r=t.retailPrice)&&void 0!==r?r:0)})},[A,b]),k="overlay"===n,O=k?{position:"absolute",inset:0,zIndex:1300,width:"100%",transform:h?"translateX(0)":"translateX(100%)",visibility:h?"visible":"hidden",transition:h?"transform 300ms cubic-bezier(0.32, 0.72, 0, 1)":"transform 300ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s 300ms",willChange:"transform"}:Gd(Gd({position:g?"fixed":"relative",zIndex:1300},g?{top:0,left:0}:{}),{}
1,{flexShrink:0,width:h?g?"100vw":404:0,borderLeft:h&&!g?"1px solid ".concat(dd):"none",transition:"width 300ms cubic-bezier(0.32, 0.72, 0, 1)",willChange:"width"});return(0,l.jsxs)("div",{role:"dialog","aria-modal":"false","aria-label":"Product details",style:Gd(Gd({},O),{},{height:"100%",overflow:"hidden",backgroundColor:"#ffffff",display:"flex",flexDirection:"column",fontFamily:"var(--bc-body-font, inherit)",WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",color:ud},p?{"--bc-foreground":p}:{}),children:[(0,l.jsxs)("div",{style:{flex:1,overflowY:"auto",overflowX:"hidden",overscrollBehavior:"contain",width:k?"100%":g?"100vw":404},children:[(0,l.jsx)("div",{style:{position:"relative",width:"100%",height:336,flexShrink:0,backgroundColor:"#ffffff",display:"flex",justifyContent:"center",alignItems:"flex-start",paddingTop:40},children:C&&(0,l.jsx)("img",{src:C,alt:j,style:{width:296,height:296,objectFit:"contain",mixBlendMode:"multiply"},onError:e=>{e.currentTarget.style.display="none"}})}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:"24px 16px"},children:[A&&(0,l.jsx)(md,{detail:A,fallbackUnitsSold:null==i?void 0:i.unitsSold}),j&&(0,l.jsx)(Ld,{title:j,detail:A}),A&&(0,l.jsx)(wd,{detail:A,onSelect:e=>{i&&s({stacklineSku:e.stacklineSku,parentStacklineSku:i.parentStacklineSku,imageUrl:e.imageUrl,title:e.title})}})]}),A&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xd,{}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,padding:"16px"},children:[(0,l.jsx)(Ed,{detail:A}),(0,l.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:16,paddingLeft:32},children:[(0,l.jsx)(Dd,{detail:A}),"number"==typeof A.totalRewardAmount&&A.totalRewardAmount>0&&(0,l.jsx)(Nd,{amount:A.totalRewardAmount})]})]})]}),S.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xd,{}),(0,l.jsx)(zd,{products:S})]}),(null==A?void 0:A.featureBullets)&&A.featureBullets.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xd,{}),(0,l.jsx)(Wd,{bullets:A.featureBullets})]}):(null==A?void 0:A.description)&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Xd,{}),(0,l.jsx)(Ud,{text:A.description})]}),!1]}),(0,l.jsx)(Hd,{onClick:a})]})}const $d=(0,n(96858).vt)(e=>({pendingQuery:null,pendingStacklineSku:null,pendingQueryId:null,setPendingQuery:(t,n)=>e({pendingQuery:t,pendingStacklineSku:n,pendingQueryId:"".concat(Date.now(),"-").concat(Math.random().toString(36).slice(2))}),clearPendingQuery:()=>e({pendingQuery:null,pendingStacklineSku:null,pendingQueryId:null})}));var eu=n(70806);function tu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function nu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?tu(Object(n),!0).forEach(function(t){ru(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):tu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ru(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const ou=e=>{var t;let{pageContext:n,widgetState:o,showMaximize:a=!0,isMaximized:s=!1,onMaximize:u,onMinimize:h,onVariantSelect:v,title:y,initialQuery:x,initialQueryStacklineSku:b,onInitialQueryProcessed:A,brandId:C,conciergePageUrl:j}=e;var S,k,O,I,P,E,V;const F=(0,Lt.Ox)(),B=(0,fs.O)(),L=(0,r.useRef)(F.conversationId),R=(0,r.useRef)(F.sharedConversationId),{data:T}=(0,g.CH)(F.apiBaseUrl),{data:M}=(0,i.pT)(F.apiBaseUrl);var D;D=null==(S=null==M?void 0:M.app)?void 0:S.channels,(0,r.useEffect)(()=>{try{(0,hs.J5)(D)}catch(e){}},[D]);const N=(0,d.gT)(),{themeColors:z}=(0,d.FG)();(0,eu.R)();const W=new URLSearchParams(window.location.search),U=(null==C?void 0:C.toString())||W.get("brandId")||(null==(O=null==(k=null==T?void 0:T.brandIds)?void 0:k[0])?void 0:O.toString())||null,H=W.get("appId")||(null==M?void 0:M.app.appId)||null,[Q,Z]=(0,r.useState)(""),q=(()=>{var e,t,n,o,i,a,l,s,c,d,u,p,g,f,h,m,v,y,x,b,w,A,C,j,S;const k=(0,r.useMemo)(()=>"true"===new URLSearchParams(window.location.search).get("isDev"),[]),O=(0,r.useMemo)(()=>new URLSearchParams(window.location.search).get("label")||"",[]),{data:I=null,isLoading:P}=(0,mt.I)({queryKey:["concierge-dev-options"],queryFn:()=>async function(){let{headersToInject:e,apiBaseUrl:t=Bn()}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{const n=Vn(Vn({},e),{},{"Content-Type":"application/json"}),r=await fetch("".concat(t,"/api-rewards/concierge/devOptions"),{method:"GET",headers:n});return r.ok?await r.json():(console.warn("Failed to fetch dev options from server, using local defaults"),null)}catch(e){return console.warn("Error fetching dev options:",e),null}}(),staleTime:3e5}),[E,V]=(0,r.useState)(!1),[F,B]=(0,r.useState)(null),[L,R]=(0,r.useState)(null),[T,M]=(0,r.useState)(null),[D,N]=(0,r.useState)(null),[z,W]=(0,r.useState)(null),[U,H]=(0,r.useState)(null),[Q,Z]=(0,r.useState)(null),[q,Y]=(0,r.useState)(null),[K,G]=(0,r.useState)(null),[J,X]=(0,r.useState)(null),[_,$]=(0,r.useState)(null),[ee,te]=(0,r.useState)(null),[ne,re]=(0,r.useState)(null),[oe,ie]=(0,r.useState)(null),[ae,le]=(0,r.useState)(null),[se,ce]=(0,r.useState)(null),[de,ue]=(0,r.useState)(null),[pe,ge]=(0,r.useState)(null),[fe,he]=(0,r.useState)(null),[me,ve]=(0,r.useState)(null),[ye,xe]=(0,r.useState)(null),[be,we]=(0,r.useState)(null),[Ae,Ce]=(0,r.useState)(null),[je,
1Se]=(0,r.useState)(null),[ke,Oe]=(0,r.useState)(null),Ie=null!==(e=null!=F?F:null==I?void 0:I.useTextRecall)&&void 0!==e&&e,Pe=null!==(t=null!=L?L:null==I?void 0:I.pageSize)&&void 0!==t?t:20,Ee=null!==(n=null!=T?T:null==I?void 0:I.rankingWeights)&&void 0!==n?n:{semanticWeight:.4,salesWeight:.15,contentWeight:.1,reviewWeight:.15,rewardWeight:.1,priceWeight:.1},Ve=null===(o=null!=D?D:null==I?void 0:I.useTargetedSectionTitles)||void 0===o||o,Fe=null===(i=null!=z?z:null==I?void 0:I.useTwoPhaseFiltering)||void 0===i||i,Be=null===(a=null!=U?U:null==I?void 0:I.useOutlierFiltering)||void 0===a||a,Le=null===(l=null!=Q?Q:null==I?void 0:I.ignoreRatings)||void 0===l||l,Re=null!==(s=null!=q?q:null==I?void 0:I.ratingThreshold)&&void 0!==s?s:2,Te=null!==(c=null!=K?K:null==I?void 0:I.llmModel)&&void 0!==c?c:"gpt-4o",Me=null!==(d=null!=J?J:null==I?void 0:I.llmModelLight)&&void 0!==d?d:"gpt-4o-mini",De=null!==(u=null!=_?_:null==I?void 0:I.searchTemperature)&&void 0!==u?u:.5,Ne=null!==(p=null!=ee?ee:null==I?void 0:I.maxPerBrand)&&void 0!==p?p:3,ze=null!==(g=null!=ne?ne:null==I?void 0:I.maxProductsForLLM)&&void 0!==g?g:50,We=null!==(f=null!=oe?oe:null==I?void 0:I.numSearchAngles)&&void 0!==f?f:6,Ue=null!==(h=null!=ae?ae:null==I?void 0:I.targetCategories)&&void 0!==h?h:4,He=null!==(m=null!=se?se:null==I?void 0:I.semanticThreshold)&&void 0!==m?m:.65,Qe=null!==(v=null!=de?de:null==I?void 0:I.productsPerSection)&&void 0!==v?v:10,Ze=null!==(y=null!=pe?pe:null==I?void 0:I.productsBuffer)&&void 0!==y?y:15,qe=null!==(x=null!=fe?fe:null==I?void 0:I.angleStrategy)&&void 0!==x?x:"auto",Ye=null!==(b=null!=me?me:null==I?void 0:I.availabilityFilter)&&void 0!==b?b:"apply",Ke=null===(w=null!=ye?ye:null==I?void 0:I.useOriginalQueryReranking)||void 0===w||w,Ge=null!==(A=null!=be?be:null==I?void 0:I.recatModel)&&void 0!==A?A:"",Je=null!==(C=null!=Ae?Ae:null==I?void 0:I.analyzeModel)&&void 0!==C?C:"",Xe=null!==(j=null!=je?je:null==I?void 0:I.planModel)&&void 0!==j?j:"",_e=null!==(S=null!=ke?ke:O||(null==I?void 0:I.promptLabel))&&void 0!==S?S:"",$e=(0,r.useCallback)((e,t)=>{M(n=>{const r=null!=n?n:Ee,o=Object.keys(r).filter(t=>t!==e),i=o.reduce((e,t)=>e+r[t],0),a=Math.max(0,1-t),l=us(us({},r),{},{[e]:t});return o.forEach(e=>{l[e]=i>0?r[e]/i*a:a/o.length}),l})},[Ee]),et=(0,r.useMemo)(()=>{if(k||O)return{useTextRecall:Ie,pageSize:Pe,rankingWeights:Ee,useTargetedSectionTitles:Ve,useTwoPhaseFiltering:Fe,useOutlierFiltering:Be,ignoreRatings:Le,ratingThreshold:Re,llmModel:Te,llmModelLight:Me,searchTemperature:De,maxPerBrand:Ne,maxProductsForLLM:ze,numSearchAngles:We,targetCategories:Ue,semanticThreshold:He,productsPerSection:Qe,productsBuffer:Ze,angleStrategy:qe,availabilityFilter:Ye,useOriginalQueryReranking:Ke,recatModel:Ge,analyzeModel:Je,planModel:Xe,promptLabel:_e}},[k,O,Ie,Pe,Ee,Ve,Fe,Be,Le,Re,Te,Me,De,Ne,ze,We,Ue,He,Qe,Ze,qe,Ye,Ke,Ge,Je,Xe,_e]);return{isDevMode:k,isLoading:P,devOptionsExpanded:E,setDevOptionsExpanded:V,useTextRecall:Ie,setUseTextRecall:B,pageSize:Pe,setPageSize:R,rankingWeights:Ee,setRankingWeights:M,handleWeightChange:$e,useTargetedSectionTitles:Ve,setUseTargetedSectionTitles:N,useTwoPhaseFiltering:Fe,setUseTwoPhaseFiltering:W,useOutlierFiltering:Be,setUseOutlierFiltering:H,ignoreRatings:Le,setIgnoreRatings:Z,ratingThreshold:Re,setRatingThreshold:Y,llmModel:Te,setLlmModel:G,llmModelLight:Me,setLlmModelLight:X,searchTemperature:De,setSearchTemperature:$,maxPerBrand:Ne,setMaxPerBrand:te,maxProductsForLLM:ze,setMaxProductsForLLM:re,numSearchAngles:We,setNumSearchAngles:ie,targetCategories:Ue,setTargetCategories:le,semanticThreshold:He,setSemanticThreshold:ce,productsPerSection:Qe,setProductsPerSection:ue,productsBuffer:Ze,setProductsBuffer:ge,angleStrategy:qe,setAngleStrategy:he,availabilityFilter:Ye,setAvailabilityFilter:ve,useOriginalQueryReranking:Ke,setUseOriginalQueryReranking:xe,recatModel:Ge,setRecatModel:we,analyzeModel:Je,setAnalyzeModel:Ce,planModel:Xe,setPlanModel:Se,promptLabel:_e,setPromptLabel:Oe,devOptions:et}})(),Y="shopify"===(null==(I=null==M?void 0:M.auth)?void 0:I.authType)&&null!==(t=null==(P=window.__BC_BOOTSTRAP__)?void 0:P.customerFirstName)&&void 0!==t?t:void 0,[K,G]=(0,r.useState)(void 0),J=null!=Y?Y:K;(0,r.useEffect)(()=>{const e=()=>{(0,f.u0)().then(e=>{var t,n;e.signedIn&&(null==(n=null==(t=e.userInfo)?void 0:t.attributes)?void 0:n.given_name)?G(e.userInfo.attributes.given_name):G(void 0)})};e();const t=f.Am.listen("auth",t=>{let{payload:{event:n}}=t;["signIn","signIn_Complete","signOut"].includes(n)&&e()});return()=>t()},[]);const X=(0,r.useCallback)(function(){var e,t,n;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var o;const i=null!==(e=null!==(t=null!==(n=function(e){if("undefined"==typeof window)return null;if(!(0,m.dv)(e))return null;const t=(0,m.GE)(e);return t?"".concat(window.location.origin).concat(t,"/concierge"):null}(null==(o=null==M?void 0:M.app)?void 0:o.servingSurface))&&void 0!==n?n:j)&&void 0!==t?t:null==T?void 0:T.canonicalConciergeUrl)&&void 0!==e?e:"".concat(window.location.origin,"/concierge"),a=new URL(i);return U&&a.searchParams.set("brandId",U),r.conversationId&&a.searchParams.set("conversationId",r.conversationId),r.sharedConversationId&&a.searchParams.set("sharedConversationId",r.sharedConversationId),a.toString()},[j,null==T?void 0:T.canonicalConciergeUrl,U,null==(E=null==M?void 0:M.app)?void 0:E.servingSurface]),_=(0,r.useCallback)(()=>{window.open(X(),"_blank","noopener,noreferrer")},[X]),$=(0,r.useCallback)(()=>{const e=X({conversationId:F.conversationId,sharedConversationId:F.sharedConversationId});window.open(e,"_blank","noopener,noreferrer")},[X,F.conversationId,F.sharedConversationId]),ee=(0,r.useRef)(()=>{}),te=(0,r.useRef)(()=>{}),ne=(0,r.useCallback)(()=>{ee.current(),te.current(),F.setIsActivelyStreaming(!1),F.clearStreamingState(),F.setConversationId(null),F.setSharedConversationId(null),F.setConversationHistory([]),F.setFollowUpQuestions([]),F.setConversationPageContext(null),F.setIsSharedView(!1),F.setSharedByUserName(void 0),F.setSharedAtMessageIndex(void 0),F.setSourceConversationId(void 0),F.setSourceCheckpointIndex(void 0)},[F]),re=(0,r.useRef)(null),oe=(0,r.useCallback)(()=>{var e;null==(e=re.current)||e.call(re),ne()},[ne]),ie=(0,r.useCallback)(e=>{var t;const n="user_dismissed_error"===(null==e?void 0:e.reason);console.info("[voice] widget call close landing decision",{reason:null==e?void 0:e.reason,landing:n?"fresh-chat":"stay-on-conversation"}),n&&(null==(t=re.current)||t.call(re),ne()),F.closeVoiceCall()},[F,ne]),ae=Bt(),le=null!=n?n:ae,se=(0,r.useRef)(null),ce=(0,r.useCallback)((e,t)=>e.pageType!==t.pageType||"pdp"===e.pageType&&"pdp"===t.pageType&&e.stackl
1ineSku!==t.stacklineSku,[]),[de,ue]=(0,r.useState)(null);(0,r.useEffect)(()=>{ue(null)},[F.conversationId]);const pe=(0,r.useRef)(!1),ge=(0,r.useCallback)((e,t)=>{var n,r;Z(t);const o=null!==(n=null==(r=null==e?void 0:e.message)?void 0:r.toLowerCase())&&void 0!==n?n:"";if(pe.current||"AbortError"===(null==e?void 0:e.name)||o.includes("abort"))return void(pe.current=!1);let i="unknown";o.includes("429")||o.includes("rate limit")?i="rate_limit":o.includes("400")||o.includes("bad request")?i="bad_request":o.includes("network")||o.includes("failed to fetch")?i="network":(o.includes("500")||o.includes("server"))&&(i="server"),ue({rate_limit:"I'm getting a lot of messages right now â nothing wrong with your question. Give it a few seconds and send it again.",bad_request:"Please enter a message before sending.",network:"Network error. Please check your connection and try again.",server:"Something went wrong on our end. Please try again.",unknown:"Something went wrong. Please try again."}[i])},[]),fe="undefined"!=typeof window&&"true"===new URLSearchParams(window.location.search).get("temporaryChat"),he=function(e){const{apiBaseUrl:t,conversationId:n,sharedConversationId:o,appId:i,devOptions:a,pdpStacklineSku:l,isOnChatWidget:s,temporaryChat:c,onError:d,onTripwire:u,onConversationIdGenerated:p,onServerQualified:g}=e,h=(0,r.useRef)(n);h.current=n;const m=(0,r.useRef)(o);m.current=o;const[v,y]=(0,r.useState)([]),[x,b]=(0,r.useState)("ready"),[w,A]=(0,r.useState)(null),[C,j]=(0,r.useState)(null),[S,k]=(0,r.useState)([]),[O,I]=(0,r.useState)(!1),P=(0,r.useRef)(null),E=(0,r.useRef)(null),V=(0,r.useRef)(function(){let e=0,t=!1;return{tryBegin:()=>t?null:(t=!0,e+=1,e),end(n){e===n&&(t=!1)},cancel(){e+=1,t=!1},isInFlight:()=>t}}());(0,r.useEffect)(()=>{"streaming"!==x&&A(null)},[x]),(0,r.useEffect)(()=>{k([]),I(!1),P.current=null},[n]),(0,r.useEffect)(()=>{if("ready"!==x)return;const e=[...v].reverse().find(e=>"assistant"===e.role);if(!(null==e?void 0:e.id))return;if(e.id===P.current)return;const t=function(e){var t,n;if(!e||"assistant"!==e.role)return[];const r=e.parts;if(Array.isArray(r)){for(const e of r)if("tool-result"===(null==e?void 0:e.type)&&"suggest_follow_ups"===(null==e?void 0:e.toolName)){const n=null==(t=e.result)?void 0:t.accepted;if(Array.isArray(n))return n.filter(e=>"string"==typeof e).slice(0,3)}const e=r.filter(e=>"data-follow-ups"===(null==e?void 0:e.type));if(e.length>0){var o;const t=e[e.length-1],r=null!==(o=null==(n=null==t?void 0:t.data)?void 0:n.questions)&&void 0!==o?o:null==t?void 0:t.questions;if(Array.isArray(r))return r.filter(e=>"string"==typeof e).slice(0,3)}}const i=e.followUpSuggestions;if(Array.isArray(i))return i.filter(e=>"string"==typeof e).slice(0,3);const a=e.metadata;return a&&"object"==typeof a&&Array.isArray(a.followUpSuggestions)?a.followUpSuggestions.filter(e=>"string"==typeof e).slice(0,3):[]}(e);0!==t.length&&(P.current=e.id,k(t),I(!1))},[x,v]);const F=(0,r.useCallback)(async e=>{I(!0),k([]);try{const n=await(0,f.fk)(),r=await async function(e){let{headersToInject:t,apiBaseUrl:n=Bn(),devOptions:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{const o=await fetch("".concat(n,"/api-rewards/concierge/conversation/").concat(e,"/follow-ups"),{method:"POST",headers:Vn(Vn({},t),{},{"Content-Type":"application/json"}),body:JSON.stringify({devOptions:r})});if(!o.ok)return[];const i=await o.json();return Array.isArray(i.questions)?i.questions:[]}catch(e){return[]}}(e,{headersToInject:n,apiBaseUrl:t,devOptions:{promptLabel:null==a?void 0:a.promptLabel}});if(h.current!==e)return;k(r)}catch(t){h.current===e&&k([])}finally{h.current===e&&I(!1)}},[t,a]),B=(0,r.useCallback)(()=>{var e;V.current.cancel(),null==(e=E.current)||e.abort(),E.current=null,I(!1),b("ready")},[]),L=(0,r.useCallback)(async e=>{var t;const n=null==(t=e.body)?void 0:t.getReader();if(!n)return;const r=new TextDecoder;let o="";const a=Is(),l=[],s=new Map,c=()=>{const e=[...l];s.forEach(t=>{t&&e.push({type:"text",text:t})}),y(t=>{const n=t.findIndex(e=>e.id===a),r={id:a,role:"assistant",parts:e};if(n>=0){const e=[...t];return e[n]=r,e}return[...t,r]})},d=(e,t)=>{switch(e){case"text-start":s.set(t.id,"");break;case"text-delta":s.set(t.id,(s.get(t.id)||"")+(t.delta||"")),c();break;case"text-end":{const e=s.get(t.id)||"";s.delete(t.id),e&&l.push({type:"text",text:e}),c();break}case"tool-call":l.push({type:"tool-call",toolCallId:t.toolCallId,toolName:t.toolName,args:t.args}),c();break;case"tool-result":l.push({type:"tool-result",toolCallId:t.toolCallId,toolName:t.toolName,result:t.result}),c();break;case"tripwire":{const e=t.reason||t.message;e&&(j(e),null==u||u(e));break}case"finish":break;default:if(e.startsWith("data-"))if("data-conversation-id"===e){const e=null==t?void 0:t.conversationId;e&&e!==h.current&&(h.current=e,(0,As.$o)(null!=i?i:void 0,e),null==p||p(e))}else if("data-concierge-qualified"===e){var n,r;null==g||g(null!==(n=null!==(r=null==t?void 0:t.conversationId)&&void 0!==r?r:h.current)&&void 0!==n?n:void 0)}else if("data-status"===e){var o;A(null!==(o=null==t?void 0:t.status)&&void 0!==o?o:null)}else if("data-tripwire"===e){const e=null==t?void 0:t.message;e&&(j(e),null==u||u(e))}else l.push({type:e,data:t}),c()}};try{let e=!1,t="",i="",a=0,l=0;for(;!e;){const{done:s,value:c}=await n.read();if(s){e=!0;break}a++,o+=r.decode(c,{stream:!0});const u=o.split("\n");o=u.pop()||"";for(const e of u)if(e.startsWith("event: "))t=e.slice(7).trim(),l=a;else if(e.startsWith("data: "))i=e.slice(6);else if(""===e&&t&&i){a!==l&&console.warn("[SSE] event split across chunks:",t,"(event in chunk ".concat(l,", data in chunk ").concat(a,")"));try{d(t,JSON.parse(i))}catch(e){}t="",i=""}}}finally{n.releaseLock()}},[p,g,u]),R=(0,r.useCallback)(async e=>{const n="string"==typeof e?e:e.text,r="string"==typeof e?void 0:e.files;if(!(n&&0!==n.trim().length||(null==r?void 0:r.length)))return;const o=V.current.tryBegin();if(null===o)return void console.log("".concat(ks," Dropped duplicate send while a turn is in flight"),{conversationId:h.current,promptPreview:Os(n)});const u=Os(n);console.log("".concat(ks," Send started"),{conversationId:h.current,sendToken:o,promptPreview:u}),j(null),k([]),I(!1),P.current=null;const p=n?[{type:"text",text:n}]:[];if(null==r?void 0:r.length)for(const e of r)p.push({type:"file",mediaType:e.mediaType,url:e.url});const g={id:Is(),role:"user",parts:p};
1y(e=>[...e,g]),b("submitted");const v=new AbortController;E.current=v;let x="ok";try{var w;const e=await(0,f.fk)(),o=(0,As.wd)(null!=i?i:void 0,null!==(w=h.current)&&void 0!==w?w:null),d=await fetch("".concat(t,"/api-rewards/concierge/agent/stream"),{method:"POST",headers:js(js({},e),{},{"Content-Type":"application/json",Accept:"text/event-stream"}),body:JSON.stringify(js(js(js(js(js({prompt:n,conversationId:h.current,sharedConversationId:m.current,appId:i,devOptions:a},l?{pdpStacklineSku:l}:{}),s?{isOnChatWidget:!0}:{}),c?{temporaryChat:!0}:{}),(null==r?void 0:r.length)?{fileParts:r}:{}),o?{conciergeTouchId:o}:{})),signal:v.signal});if(!d.ok)throw new Error("Stream request failed: ".concat(d.status," ").concat(d.statusText));b("streaming"),await L(d);const u=h.current;u&&!v.signal.aborted&&F(u)}catch(e){return"AbortError"===(null==e?void 0:e.name)?void(x="abort"):(x="error",console.error("".concat(ks," Stream error"),{conversationId:h.current,sendToken:o,promptPreview:u,error:e}),I(!1),null==d||d(e instanceof Error?e:new Error(String(e))),void b("error"))}finally{V.current.end(o),E.current=null,b(e=>"error"===e?e:"ready"),console.log("".concat(ks," Send finished"),{conversationId:h.current,sendToken:o,promptPreview:u,outcome:x})}},[t,i,a,l,s,c,d,L,F]),T=(0,r.useCallback)(()=>{y(e=>{const t=e.map(e=>e.role).lastIndexOf("user");return-1===t?e:e.slice(0,t)})},[]),M=(0,r.useCallback)(()=>{const e=[...v].reverse().find(e=>"user"===e.role);return e?(e.parts||[]).filter(e=>"text"===e.type&&"string"==typeof e.text).map(e=>e.text).join("").trim():""},[v]),D=(0,r.useCallback)(async()=>{const e=h.current;if(e)try{const n=await(0,f.fk)(),{prompt:r,fileParts:o}=await(async e=>{let{conversationId:t,headersToInject:n,apiBaseUrl:r=Bn()}=e;const o=Vn(Vn({},n),{},{"Content-Type":"application/json"}),i=await fetch("".concat(r,"/api-rewards/concierge/conversation/").concat(t,"/retry"),{method:"POST",headers:o});if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error||"HTTP ".concat(i.status))}return i.json()})({conversationId:e,headersToInject:n,apiBaseUrl:t});y(e=>{const t=e.map(e=>e.role).lastIndexOf("assistant");if(-1===t)return e;const n=e.slice(0,t).map(e=>e.role).lastIndexOf("user"),r=-1!==n?n:t;return e.slice(0,r)}),j(null),await R((null==o?void 0:o.length)?{text:r,files:o.map(e=>({type:"file",mediaType:e.mediaType,url:e.url}))}:r)}catch(e){console.error("[useConciergeChat] retryLastMessage failed:",e),null==d||d(e instanceof Error?e:new Error(String(e)))}},[t,d,R]),N=(0,r.useCallback)(async()=>{B();const e=M(),n=h.current;if(!n)return T(),j(null),e||null;try{const r=await(0,f.fk)(),{prompt:o}=await(async e=>{let{conversationId:t,headersToInject:n,apiBaseUrl:r=Bn()}=e;const o=Vn(Vn({},n),{},{"Content-Type":"application/json"}),i=await fetch("".concat(r,"/api-rewards/concierge/conversation/").concat(t,"/stop"),{method:"POST",headers:o});if(!i.ok){const e=await i.json().catch(()=>({}));throw new Error(e.error||"HTTP ".concat(i.status))}return i.json()})({conversationId:n,headersToInject:r,apiBaseUrl:t});return T(),j(null),(o||e||"").trim()||null}catch(e){return console.error("[useConciergeChat] cancelLatestTurn failed:",e),null==d||d(e instanceof Error?e:new Error(String(e))),null}},[t,M,d,B,T]),z="streaming"===x,W="submitted"===x;return{messages:v,setMessages:y,status:x,stop:B,sendMessage:R,retryLastMessage:D,cancelLatestTurn:N,isStreaming:z,isLoading:W,isWaiting:W||z,transientStatus:w,tripwireMessage:C,latestFollowUps:S,isLoadingFollowUps:O}}({apiBaseUrl:F.apiBaseUrl,conversationId:F.conversationId,sharedConversationId:F.sharedConversationId,appId:H,onServerQualified:e=>{B(null!=H?H:void 0,"mint",e)},devOptions:q.devOptions,pdpStacklineSku:"pdp"===(null==le?void 0:le.pageType)?le.stacklineSku:null,isOnChatWidget:!0,temporaryChat:fe,onError:e=>ge(e,Q),onTripwire:e=>{ue(e)},onConversationIdGenerated:e=>{F.setIsActivelyStreaming(!0),F.setConversationId(e),F.setSharedConversationId(null),F.setIsSharedView(!1),F.setSharedAtMessageIndex(void 0)}}),me=he.messages.length>0?he.messages:F.conversationHistory;(0,r.useEffect)(()=>{(null!=F.conversationId||me.length>0)&&null==F.conversationPageContext&&F.setConversationPageContext(le)},[le,F.conversationId,me.length,F.conversationPageContext,F.setConversationPageContext]),(0,r.useEffect)(()=>{const e=se.current,t=F.conversationPageContext;if(null===e)return se.current=le,void((null!=F.conversationId||me.length>0)&&null!=t&&ce(le,t)&&ne());ce(e,le)&&ne(),se.current=le},[le,F,ce,ne]);const ve=(0,r.useRef)(null),ye=(0,r.useRef)(null),xe=(0,r.useRef)(!0);(0,r.useEffect)(()=>{xe.current=0===me.length},[me.length]);const{trackConversationStart:be,trackPageContext:we}=(e=>{let{conversationId:t,pageContext:n,appId:o}=e;const i=(0,r.useRef)(null),a=(0,r.useRef)(null),l=(0,r.useCallback)((e,r,i)=>{if(!t)return;if(a.current===t)return;a.current=t;const l="undefined"!=typeof window?window.location.href:"",s=bs(bs(bs(bs({accessPoint:e,conversationId:t,pageUrl:l,appVersion:"v2"},r&&{query:ys(r)}),void 0!==i&&{isNewConversation:i}),(null==n?void 0:n.stacklineSku)&&{stacklineSku:n.stacklineSku}),o&&{appId:o});(0,tl.u4)(nl.A.CONCIERGE_CONVERSATION_ACCESS_POINT,s).catch(()=>{})},[t,null==n?void 0:n.stacklineSku,o]),s=(0,r.useCallback)(()=>
1{if(!t)return;const e="undefined"!=typeof window?window.location.href:"",r="undefined"!=typeof window?window.location.pathname:"/",a="".concat(t,":").concat(e);if(i.current===a)return;i.current=a;const l=vs(r),s=function(e){return"/"===e||""===e?"homepage":e.includes("/pdp/")||e.includes("/p/")?"pdp":e.includes("/brand/")?"brand":e.includes("/search")?"search":e.includes("/category/")?"category":e.includes("/brandclub")?"brandclub":"other"}(r),c=bs(bs({conversationId:t,pageUrl:e,pageName:l,pageType:s,appVersion:"v2"},(null==n?void 0:n.stacklineSku)&&{stacklineSku:n.stacklineSku}),o&&{appId:o});(0,tl.u4)(nl.A.CONCIERGE_PAGE_CONTEXT,c).catch(()=>{})},[t,null==n?void 0:n.stacklineSku,o]),c=(0,r.useCallback)((e,t,n)=>{l(e,t,n),s()},[l,s]);return(0,r.useEffect)(()=>{if(!t)return i.current=null,void(a.current=null);const e=()=>{s()};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},[t,s]),{trackConversationStart:c,trackConversationAccessPoint:l,trackPageContext:s}})({conversationId:F.conversationId,pageContext:le,appId:H}),Ae=(0,r.useRef)(null);(0,r.useEffect)(()=>{const e=F.conversationId,t=Ae.current;if(e&&e!==t&&ve.current){const{accessPoint:n,query:r}=ve.current;be(n,r,null===t),ye.current=e,ve.current=null}Ae.current=e},[F.conversationId,be]);const Ce=(0,r.useMemo)(()=>new Set(["search_bar","quick_prompts","follow_up_question"]),[]),je=(0,r.useCallback)((e,t)=>{if((!F.conversationId||ye.current!==F.conversationId)&&(ve.current&&Ce.has(e)?ve.current.query=t:ve.current={accessPoint:e,query:t},F.conversationId)){const{accessPoint:e,query:t}=ve.current,n=xe.current;be(e,t,n),ye.current=F.conversationId,ve.current=null}},[F.conversationId,be,Ce]),{isOpen:Se}=o,{pendingQuery:ke,pendingQueryId:Oe,clearPendingQuery:Ie}=$d(),Pe=(0,r.useRef)(!1);(0,r.useEffect)(()=>{const e=Pe.current;Pe.current=Se,e||!Se||ke||x||F.conversationId||F.sharedConversationId||(ve.current={accessPoint:"floating_button",query:""})},[Se,ke,x,F.conversationId,F.sharedConversationId]);const Ee=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(F.setIsActivelyStreaming(he.isStreaming||he.isLoading),he.isStreaming){const e=he.messages[he.messages.length-1];if("assistant"!==(null==e?void 0:e.role)||!Array.isArray(e.parts)||!e.parts.some(e=>{var t;return"text"!==e.type||(null==(t=e.text)?void 0:t.length)>0})){const t="assistant"===(null==e?void 0:e.role)?e.parts.filter(e=>"text"===e.type&&"text"in e).map(e=>e.text).join(""):"";F.setStreamingAIResponse(t)}}else he.isLoading||F.clearStreamingState()},[he.isStreaming,he.isLoading,he.messages]);const{shouldScrollOnNextMessageRef:Ve}=((e,t,n,o)=>{const i=(0,r.useRef)(null),a=(0,r.useRef)(null),l=(0,r.useRef)(!1),s=()=>{setTimeout(()=>{const e=i.current;if(!e)return;const t=e.scrollHeight-e.clientHeight;e.scrollTo({top:t,behavior:"smooth"})},300)};return(0,r.useEffect)(()=>{l.current&&e>0&&!o&&(s(),l.current=!1)},[e,o]),(0,r.useEffect)(()=>{t&&e>0&&!o&&s()},[t,n,e,o]),{chatWrapperRef:i,messagesEndRef:a,shouldScrollOnNextMessageRef:l,scrollToBottom:s}})(me.length,F.isActivelyStreaming,F.streamingAIResponse,0===me.length),Fe=(0,r.useCallback)(async(e,t)=>{Ve.current=!0,pe.current=!1,await he.sendMessage((null==t?void 0:t.length)?{text:e,files:t}:e)},[he,Ve]),Be=(0,r.useCallback)(()=>{pe.current=!0,he.stop()},[he]),Le=(0,r.useCallback)(()=>{var e;null==(e=he.setMessages)||e.call(he,[])},[he]);ee.current=Be,te.current=Le;const Re=function(e){let{appIdV2:t,apiBaseUrl:n,messages:o,onShown:i,onAccepted:a}=e;const l=(0,d.Wx)(),[s,c]=(0,r.useState)(null),[u,p]=(0,r.useState)(!1),[g,h]=(0,r.useState)(!1),m=(0,r.useRef)(!1),v=(null==l?void 0:l.version)||"v1",y=(0,r.useMemo)(()=>{if("undefined"==typeof window)return!1;const e=Fs.get(Bs(t));return"string"==typeof e&&e===v},[t,v]),x=y||u,b=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(!(null==l?void 0:l.enabled)||y||!t||!n)return;const e="".concat(t,"#").concat(v);if(b.current===e)return;b.current=e;let r=!1;return async function(e){let{apiBaseUrl:t,appIdV2:n,version:r}=e;if(!t)return!1;try{const e=await(0,f.fk)(),o="".concat(t,"/api-rewards/concierge/agreement/status?appIdV2=").concat(encodeURIComponent(n),"&version=").concat(encodeURIComponent(r)),i=await fetch(o,{method:"GET",headers:e});return!!i.ok&&!!(await i.json()).accepted}catch(e){return console.warn("[ConciergeAgreementGate] failed to read acceptance from DB",e),!1}}({apiBaseUrl:n,appIdV2:t,version:v}).then(e=>{r||e&&(Ls(t,v),p(!0))}),()=>{r=!0}},[null==l?void 0:l.enabled,y,t,n,v]);const w=(0,r.useRef)(!1);(0,r.useEffect)(()=>
1{!(null==l?void 0:l.enabled)||t||w.current||(w.current=!0,console.warn("[ConciergeAgreementGate] agreement enabled but appIdV2 is missing â acceptance will be cookie-only (no DB persistence/recovery). Check that BrandApp V2 bootstrap is available for this surface."))},[null==l?void 0:l.enabled,t]);const A=(0,r.useMemo)(()=>o.every(e=>"assistant"!==e.role),[o]),C=!!(null==l?void 0:l.enabled),j=C&&!x&&A,S=(0,r.useCallback)((e,r)=>!!j&&("auto-accept"===(null==l?void 0:l.template)?(Ls(t,v),t&&Rs({apiBaseUrl:n,appIdV2:t,version:v}),null==a||a(),h(!0),!1):(c({text:e,files:r}),!0)),[j,null==l?void 0:l.template,t,n,v,a]),k=(0,r.useCallback)(()=>{if(g)return h(!1),m.current=!1,null;Ls(t,v),t&&Rs({apiBaseUrl:n,appIdV2:t,version:v});const e=s;return c(null),m.current=!1,null==a||a(),e},[t,n,v,s,g,a]),O=(0,r.useCallback)(()=>{c(null),h(!1),m.current=!1},[]);return(0,r.useEffect)(()=>{const e=!!s||g;e&&!m.current&&(m.current=!0,null==i||i()),e||(m.current=!1)},[s,g,i]),{agreement:l,pending:s,shouldShowCard:!!s||g,isEnabled:C,hasAccepted:x,interceptSend:S,accept:k,reset:O}}({appIdV2:H,apiBaseUrl:F.apiBaseUrl,messages:me,onShown:(0,r.useCallback)(()=>{(0,tl.u4)(nl.A.CONCIERGE_AGREEMENT_SHOWN,nu({appVersion:"v2"},H&&{appId:H}))},[H]),onAccepted:(0,r.useCallback)(()=>{(0,tl.u4)(nl.A.CONCIERGE_AGREEMENT_ACCEPTED,nu({appVersion:"v2"},H&&{appId:H}))},[H])}),Te=(0,r.useCallback)(()=>{const e=Re.accept();e&&Fe(e.text,e.files)},[Re,Fe]);(0,r.useEffect)(()=>(re.current=Re.reset,()=>{re.current=null}),[Re.reset]);const Me=(0,r.useRef)(void 0),De=(0,r.useCallback)(async(e,t)=>{Me.current=t,Z(""),ue(null),Re.interceptSend(e,t)||await Fe(e,t)},[le,Fe,me.length,Re]),Ne=(0,r.useCallback)(()=>{const e=Q.trim(),t=Me.current;ue(null),(e||(null==t?void 0:t.length))&&De(e,t)},[Q,De]),ze=(0,r.useRef)(De);(0,r.useEffect)(()=>{ze.current=De},[De]);const We=(0,r.useCallback)(()=>{(async()=>{const e=await he.cancelLatestTurn();F.setIsActivelyStreaming(!1),F.clearStreamingState(),e&&Z(e)})()},[he,F]),{isLoadingConversationQuery:Ue,markConversationStale:Qe}=(e=>{let{conversationId:t,sharedConversationId:n,onConversationLoaded:o,onConversationNotFound:i,isActivelyStreaming:a=!1,conversationHistoryLength:l=0,apiBaseUrl:s,viewToken:d}=e;const u=(0,c.jE)(),p=(0,r.useRef)(null),g=(0,r.useRef)(null),h=(0,r.useRef)(null),[m,v]=(0,r.useState)(0),y=(0,r.useRef)(null),x=(0,r.useRef)(!1),[b,w]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),j=(0,r.useRef)(null),S=e=>{t?p.current=e:n&&(g.current=e)};(0,r.useEffect)(()=>{w(!1),C(!1),j.current=null},[t,n]),(0,r.useEffect)(()=>{const e=y.current;if(y.current=t,a)return void(t&&(p.current=t||"hardcoded"));if(x.current&&!a&&t===e)return void(t&&(p.current=t||"hardcoded"));const r=t||n||null,o=!!t&&t!==p.current,i=!!n&&n!==g.current;if(r&&(o||i)){if(l>0&&null===e)return void(t?p.current=t:n&&(g.current=n));if(h.current===r)return;h.current=r;const o=["conversation",t,n,m,Ln];if(null===e&&void 0===u.getQueryData(o))return;v(e=>e+1),u.invalidateQueries({queryKey:["conversation",t,n]})}else r&&null===e&&(t&&t===p.current||n&&n===g.current)&&(t?p.current=null:n&&(g.current=null),v(e=>e+1),u.invalidateQueries({queryKey:["conversation",t,n]}))},[t,n,u,a,l,m]),(0,r.useEffect)(()=>{x.current=a},[a]);const{data:k,isLoading:O,isSuccess:I,error:P}=(0,mt.I)({queryKey:["conversation",t,n,m,Ln],queryFn:async()=>{if(!t&&!n)return null;const e=await(0,f.fk)();return(async e=>{let{conversationId:t,sharedConversationId:n,headersToInject:r,apiBaseUrl:o=Bn(),viewToken:i}=e;if(!t&&!n)return null;try{const e=Vn(Vn({},r),{},{"Content-Type":"application/json"}),a=n?"".concat(o,"/api-rewards/concierge/conversation/shared/").concat(n,"/ui-messages"):"".concat(o,"/api-rewards/concierge/conversation/").concat(t,"/ui-messages"),l=i?"".concat(a,"?viewToken=").concat(encodeURIComponent(i)):a,s=await fetch(l,{method:"GET",headers:e});if(!s.ok){if(404===s.status)return null;if(403===s.status)return{messages:[],error:"unauthorized",redirect:(await s.json()).redirect};throw new Error("HTTP error! status: ".concat(s.status))}const c=await s.json();if(c.error)return console.error("Error loading conversation:",c.error),null;const d=(c.messages||[]).map(e=>{var t,n,r;const o=e.id||"msg-".concat(null!==(t=e.messageIndex)&&void 0!==t?t:Date.now()),i="user"===e.role?"user":"assistant",a=null!==(n=null==(r=e.content)?void 0:r.parts)&&void 0!==n?n:e.parts;return Vn(Vn(Vn(Vn({id:o,role:i,parts:(null==a?void 0:a.length)?a:[{type:"text",text:""}]},e.createdAt?{createdAt:e.createdAt}:{}),null!=e.messageIndex?{messageIndex:e.messageIndex}:{}),e.feedback?{feedback:e.feedback}:{}),Array.isArray(e.followUpSuggestions)?{followUpSuggestions:e.followUpSuggestions}:{})});return{conversationId:c.conversationId||t||void 0,status:c.status,messages:d,followUpQuestions:c.followUpQuestions||[],isSharedView:c.isSharedView,sharedConversationId:c.sharedConversationId||n||void 0,sharedAtMessageIndex:c.sharedAtMessageIndex,sharedByUserName:c.sharedByUserName,sourceConversationId:c.sourceConversationId,sourceCheckpointIndex:c.sourceCheckpointIndex}}catch(e){return console.error("Failed to load conversation:",e),null}})({conversationId:t,sharedConversationId:n,headersToInject:e,apiBaseUrl:s,viewToken:d})},enabled:(!!t&&t!==p.current||!!n&&n!==g.current)&&!a||b&&!A&&!!t&&!a,retry:!1,staleTime:1/0,refetchInterval:!(!b||A)&&3e3});(0,r.useEffect)(()=>{var e,r;if(k&&(t||n)){const l=t||n||(null==k?void 0:k.conversationId)||"hardcoded";if("unauthorized"===k.error){if(console.warn("Unauthorized to access conversation ".concat(l,", redirecting")),i(),S(l),h.current=null,"undefined"!=typeof window){var a;const e=null!==(a=window.__BC_ROUTE_PATH__)&&void 0!==a?a:"";window.history.pushState({},"","".concat(e.replace(/\/+$/,""),"/concierge"))}return}const s=(k.messages||[]).filter(e=>"user"===e.role||"assistant"===e.role).filter(e=>"user"===e.role||Array.isArray(e.parts)&&e.parts.length>0),c=k.followUpQuestions||[],d=k.status||"completed";if(s.length>0){const t={isSharedView:k.isSharedView,sharedConversationId:k.sharedConversationId,sharedAtMessageIndex:k.sharedAtMessageIndex,sharedByUserName:k.sharedByUserName,sourceConversationId:k.sourceConversationId,sourceCheckpointIndex:k.sourceCheckpointIndex};o(s,c,t),S(l),h.current=null;const n=s[s.length-1],i=!0===(null==(r=null==(e=null==n?void 0:n.id)?void 0:e.startsWith)?void 0:r.call(e,"voice-user-"));"user"!==(null==n?void 0:n.role)||i?(w(!1),C(!1),j.current=null):(j.current||(j.current=Date.now()),w(!0))}else"in_progress"===d?(o([],c,{isSharedView:k.isSharedView,sharedConversationId:k.sharedConversationId,sharedAtMessageIndex:k.sharedAtMessageIndex,sharedByUserName:k.sharedByUserName,sourceConversationId:k.sourceConversationId,sourceCheckpointIndex:k.sourceCheckpointIndex}),j.current||(j.current=Date.now()),w(!0),S(l),h.current=null):(console.warn("Conversation ".concat(l," not found, clearing URL")),i(),S(l),h.current=null)}else if(I&&null===k&&(t||n)&&(t?p.current!==t:g.current!==n)){const e=t||n;console.warn("Conversation ".concat(e," not found (null response), clearing URL")),i(),t?p.current=t:n&&(g.current=n),h.current=null}},[k,t,n,I]),(0,r.useEffect)(()=>{P&&(t||n)&&(console.error("Failed to load conversation:",P),i(),t?p.current=t:n&&(g.current=n),h.current=null)},[P,t,n]),(0,r.useEffect)(()=>
1{if(!b||A)return;const e=setTimeout(()=>{C(!0),w(!1)},18e4);return()=>clearTimeout(e)},[b,A]);const E=(0,r.useCallback)(()=>{w(!1),C(!1),j.current=null},[]),V=(0,r.useCallback)(()=>{p.current=null,g.current=null,v(e=>e+1)},[]);return{isLoadingConversationQuery:O,conversationLoadError:P,isPendingAssistantResponse:b,isPollingTimedOut:A,resetPendingState:E,markConversationStale:V}})({conversationId:F.conversationId,sharedConversationId:F.sharedConversationId,isActivelyStreaming:F.isActivelyStreaming,conversationHistoryLength:me.length,apiBaseUrl:F.apiBaseUrl,onConversationLoaded:(e,t,n)=>{var r,o;F.setConversationHistory(e),F.setFollowUpQuestions(t),null==(r=he.setMessages)||r.call(he,e),n?(F.setIsSharedView(null!==(o=n.isSharedView)&&void 0!==o&&o),F.setSharedConversationId(n.sharedConversationId||null),F.setSharedByUserName(n.sharedByUserName),F.setSharedAtMessageIndex(n.sharedAtMessageIndex),F.setSourceConversationId(n.sourceConversationId),F.setSourceCheckpointIndex(n.sourceCheckpointIndex)):(F.setSharedConversationId(null),F.setIsSharedView(!1),F.setSharedByUserName(void 0),F.setSharedAtMessageIndex(void 0),F.setSourceConversationId(void 0),F.setSourceCheckpointIndex(void 0))},onConversationNotFound:()=>{F.conversationId===L.current&&F.sharedConversationId===R.current||p.oR.error("Conversation not found."),F.setConversationId(null),F.setSharedConversationId(null),F.setConversationPageContext(null),F.setIsSharedView(!1),F.setSharedByUserName(void 0),F.setSharedAtMessageIndex(void 0),F.setSourceConversationId(void 0),F.setSourceCheckpointIndex(void 0)}});(0,r.useEffect)(()=>F.registerOnVoiceCallEnded(Qe),[F.registerOnVoiceCallEnded,Qe]),(0,r.useEffect)(()=>{if(!ke||!Oe||!Se)return;if(!Fe||"function"!=typeof Fe)return;if(Ee.current===Oe)return;Ee.current=Oe;const e=ke;Ie();const t=e,n=setTimeout(()=>{if(Se&&Fe&&"function"==typeof Fe)try{if(je("conversation_starter",e),Re.interceptSend(t))return;Fe(t)}catch(e){console.error("Error processing pending query:",e),p.oR.error("Failed to process search. Please try again."),Ee.current=null}else Ee.current=null},100);return()=>{clearTimeout(n)}},[Se,ke,Oe,Fe,Ie,je,Re]);const Ze=(0,r.useRef)(void 0);(0,r.useEffect)(()=>{const e=Ze.current;Ze.current=F.isSignedIn,!1===e&&F.isSignedIn&&(F.voiceCallOpen||setTimeout(()=>{Fe("I just signed in.")},300))},[F.isSignedIn,F.voiceCallOpen,Fe]);const qe=(0,r.useRef)(null),Ye=(0,r.useRef)(!1);(0,r.useEffect)(()=>{if(!x||!Se)return;if(!Fe||"function"!=typeof Fe)return;if(qe.current===x)return;if(Ye.current)return;Ye.current=!0;const e=x,t=e,n=setTimeout(()=>{if(Se&&Fe&&"function"==typeof Fe)try{if(je("conversation_starter",e),Re.interceptSend(t))return qe.current=e,void(null==A||A());Fe(t),qe.current=e,null==A||A()}catch(e){console.error("Error processing initial query:",e),p.oR.error("Failed to process search. Please try again.")}finally{Ye.current=!1}else Ye.current=!1},100);return()=>{clearTimeout(n),Ye.current=!1}},[Se,x,Fe,A,je,Re]);const[Ke,Ge]=(0,r.useState)(null),[Je,Xe]=(0,r.useState)(!1);(0,r.useEffect)(()=>{const e="pdp"===(null==le?void 0:le.pageType)?null==le?void 0:le.stacklineSku:void 0;if(Ge(null),Xe(!1),!e)return;let t=!1;return(async()=>{Xe(!0);try{const n=await(0,f.fk)(),r=await w.fetchV2ByStacklineSku({stacklineSku:e,headersToInject:n,apiBaseUrl:F.apiBaseUrl});!t&&r&&Ge(r)}catch(e){t||console.error("Error fetching pinned product:",e)}finally{t||Xe(!1)}})(),()=>{t=!0}},[null==le?void 0:le.pageType,null==le?void 0:le.stacklineSku,F.apiBaseUrl]);const _e=he.messages.length>0?he.messages:F.conversationHistory,$e=F.streamingAIResponse,et=(0,d.at)("concierge-panel",{preset:"vertical-expanded",mainBgColor:(0,d.vT)("transparent"),pillLayout:"vertical",pillShowIcon:!1,pillBorderRadius:100,pillBorderColor:(0,d.vT)("#F3F3F3"),pillBorderWidth:1,pillShadowEnabled:!0,pillBgColor:(0,d.vT)("#ffffff"),pillTextColor:(0,d.vT)("#181d56"),pillShadow:"0 4px 16px 0 rgba(0, 0, 0, 0.05)",pillContainerBgColor:(0,d.vT)("transparent"),pillContainerBorderRadius:12,inputBorderColor:(0,d.vT)("#F3F3F3"),inputBorderWidth:1,inputBorderRadius:20,inputMinHeight:116,inputShadowEnabled:!1,inputShadow:"8px 8px 14px 0 rgba(0, 0, 0, 0.03)"}),tt=(0,d.Rh)()(et.mainBgColor),nt=tt&&"transparent"!==tt&&""!==tt,rt=Re.shouldShowCard&&Re.agreement?(0,l.jsx)(Xs,{agreement:Re.agreement,themeColors:{textPrimary:z.textPrimary,primary:z.primary,buttonText:z.buttonText},pendingUserPrompt:null==(V=Re.pending)?void 0:V.text,onAgree:Te}
1):null,ot="pdp"===(null==le?void 0:le.pageType)?le.stacklineSku:void 0;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(p.l$,{}),(0,l.jsxs)("div",{className:"concierge-root",style:nu({position:"relative",display:"flex",flexDirection:"column",height:"100%",minHeight:0,maxHeight:"100%",overflow:"hidden",backgroundColor:nt?tt:void 0},z.textPrimary?{color:z.textPrimary}:{}),children:[(0,l.jsx)(d.lo,{showMaximize:a,isMaximized:s,onMaximize:$,onMinimize:h,onClose:o.close,onHistoryClick:_,onNewConversationClick:oe,showNewConversation:!0,newConversationIcon:(0,l.jsx)(He,{size:16}),title:y||N||(null==T?void 0:T.conciergeAgentName),bottomContent:(0,l.jsx)(gs,{pageContext:le,product:Ke,isLoading:Je})}),(0,l.jsxs)("div",{className:"concierge-body",style:{position:"relative",flex:1,minHeight:0,display:"flex",flexDirection:"column"},children:[(0,l.jsx)(cs,nu({},q)),(0,l.jsx)("div",{style:{display:"flex",flex:1,minHeight:0},children:(0,l.jsx)("div",{style:{display:"flex",flex:1,minWidth:0},children:(0,l.jsx)(es,{appName:null==T?void 0:T.appName,conciergeName:N||(null==T?void 0:T.conciergeAgentName),brandId:U,conversationId:F.conversationId,isEmbedded:!0,isOnChatWidget:!0,apiBaseUrl:F.apiBaseUrl,userFirstName:J,pageContext:le,conversationHistory:_e,followUpQuestions:F.followUpQuestions,latestFollowUps:he.latestFollowUps,isLoadingFollowUps:he.isLoadingFollowUps,isActivelyStreaming:F.isActivelyStreaming,transientStatus:he.transientStatus,streamingAIResponse:$e,isLoadingConversationQuery:Ue,handleSearch:De,onRetryLastMessage:he.retryLastMessage,streamErrorMessage:de,onStreamErrorRetry:Ne,onUpdateFeedback:(e,t)=>{F.setConversationHistory(n=>n.map((n,r)=>r===e?nu(nu({},n),{},{feedback:t||void 0}):n))},onVariantSelect:v,onTrackAccessPoint:je,onStop:We,searchInputValue:Q,setSearchInputValue:Z,isSharedView:F.isSharedView,sharedByUserName:F.sharedByUserName,sourceConversationId:F.sourceConversationId,sourceCheckpointIndex:F.sourceCheckpointIndex,onSupportEventsReconnect:Qe})})}),F.voiceCallOpen&&F.conversationId&&(0,l.jsx)(id,{open:!0,conversationId:F.conversationId,pdpStacklineSku:ot,onClose:ie,containerScoped:!0})]}),(0,l.jsx)(_d,{variant:"overlay"}),rt]})]})},iu=e=>(0,l.jsx)(ou,nu({},e)),au={height:0,keyboardInset:0};let lu=au;function su(){const e=(()=>{if("undefined"==typeof window)return{height:0,keyboardInset:0};const e=window.visualViewport;return e?{height:Math.round(e.height),keyboardInset:Math.max(0,Math.round(window.innerHeight-e.height-e.offsetTop))}:{height:window.innerHeight,keyboardInset:0}})();return e.height===lu.height&&e.keyboardInset===lu.keyboardInset||(lu=e),lu}const cu=()=>au,du=()=>{},uu=()=>du,pu=[150,350,700];function gu(e){if("undefined"==typeof window)return du;const t=window.visualViewport,n=[],r=()=>{for(const t of pu)n.push(window.setTimeout(e,t))};return null==t||t.addEventListener("resize",e),null==t||t.addEventListener("scroll",e),window.addEventListener("resize",e),window.addEventListener("orientationchange",e),window.addEventListener("focusin",r),()=>{for(const e of n)window.clearTimeout(e);null==t||t.removeEventListener("resize",e),null==t||t.removeEventListener("scroll",e),window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),window.removeEventListener("focusin",r)}}const fu=/(auto|scroll|overlay)/;function hu(e,t,n){const r=getComputedStyle(e);if(0!==n&&fu.test(r.overflowY)){const t=e.scrollHeight-e.clientHeight;if(t>1){if(n<0&&e.scrollTop>0)return!0;if(n>0&&e.scrollTop<t-1)return!0}}if(0!==t&&fu.test(r.overflowX)){const n=e.scrollWidth-e.clientWidth;if(n>1){if(t<0&&e.scrollLeft>0)return!0;if(t>0&&e.scrollLeft<n-1)return!0}}return!1}function mu(e){return 1===e.nodeType}function vu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function yu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?vu(Object(n),!0).forEach(function(t){xu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):vu(Object(n)).forEac
1h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function xu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const bu={alignment:"right",horizontal_padding:24,vertical_padding:24,z_index:6e3,hide_default_launcher:!1,custom_launcher_icon:""};function wu(){const e=(0,r.useSyncExternalStore)(e=>{const t=()=>e();return window.addEventListener("brandclub:settings:update",t),()=>window.removeEventListener("brandclub:settings:update",t)},()=>{var e;return"undefined"==typeof window?null:null==(e=window.brandclubSettings)?void 0:e.concierge},()=>null);return(0,r.useMemo)(()=>function(e){const t=yu(yu({},bu),e);return t.z_index=Math.max(t.z_index,bu.z_index),t}(e),[e])}function Au(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Cu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Au(Object(n),!0).forEach(function(t){ju(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Au(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function ju(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Su=e=>{let{widgetState:t,pageContext:n,showMaximize:o=!0,isMaximized:i=!1,onMaximize:a,onMinimize:s,title:c,isConciergeEnabled:d=!0,disablePortal:p=!1,initialQuery:g,initialQueryStacklineSku:f,onInitialQueryProcessed:h,brandId:m,conciergePageUrl:v}=e;const{isOpen:y,close:x}=t,b=(0,r.useRef)(null),[w,A]=(0,r.useState)("undefined"!=typeof window&&window.innerWidth<768),[C,j]=(0,r.useState)(!1),[S,k]=(0,r.useState)(y),O=wu(),{height:I,keyboardInset:P}=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return(0,r.useSyncExternalStore)(e?gu:uu,su,cu)}(y&&w),{voiceCallOpen:E,closeVoiceCall:V}=(0,Lt.Ox)(),F=(0,r.useRef)(E);F.current=E,(0,r.useEffect)(()=>{y&&(k(!0),j(!1))},[y]);const B=()=>{F.current&&V(),j(!0),setTimeout(()=>{x(),k(!1),j(!1)},250)};if((0,r.useEffect)(()=>{const e=()=>A(window.innerWidth<768);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{if(!S||C)return;const e=b.current;if(!e)return;const t=requestAnimationFrame(()=>e.focus({preventScroll:!0}));return()=>{cancelAnimationFrame(t);const n=e.getRootNode().querySelector("[data-concierge-launcher]");null==n||n.focus({preventScroll:!0})}},[S,C]),L=b,R=S&&!C,(0,r.useEffect)(()=>{if(!R)return;const e=L.current;if(!e)return;const t=t=>{t.ctrlKey||function(e,t,n,r){if(0===n&&0===r)return!1;let o=t;for(;o;){var i,a;if(o===e)break;if(mu(o)&&hu(o,n,r))return!1;o=null!==(i=null!==(a=o.parentNode)&&void 0!==a?a:o.host)&&void 0!==i?i:null}return!hu(e,n,r)}(e,t.target,t.deltaX,t.deltaY)&&t.preventDefault()};return e.addEventListener("wheel",t,{passive:!1}),()=>e.removeEventListener("wheel",t)},[L,R]),(0,r.useEffect)(()=>{const e=e=>{"Escape"===e.key&&y&&!C&&B()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[y,C]),(0,r.useEffect)(()=>{if(!y||w||i||C)return;const e=e=>{const t=e.composedPath();t.some(e=>{var t;return e instanceof HTMLElement&&((null==(t=e.classList)?void 0:t.contains("concierge-widget-container"))||"concierge-shadow-host"===e.id||"concierge-mount"===e.id)})||t.some(e=>e instanceof HTMLElement&&e.hasAttribute("data-concierge-launcher"))||B()};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y,w,i,C]),(0,r.useEffect)(()=>{const{body:e}=document;if(!y||!w&&!i)return void(e.style.overflow="");if(!w)return e.style.overflow="hidden",()=>{e.style.overflow=""};const t=window.scrollY,n={overflow:e.style.overflow,position:e.style.position,top:e.style.top,width:e.style.width};return e.style.overflow="hidden",e.style.position="fixed",e.style.top="-".concat(t,"px"),e.style.width="100%",()=>{e.style.overflow=n.overflow,e.style.position=n.position,e.style.top=n.top,e.style.width=n.width,window.scrollTo(0,t)}},[y,w,i]),!d||!S)return null;var L,R;const T=function(e){let{visibleHeight:t,keyboardInset:n}=e;const r=t?"".concat(Math.min(Math.round(.9*t),793),"px"):"min(".concat(90,"vh, ").concat(793,"px)");return{bottom:n,height:r,maxHeight:r}}({visibleHeight:I,keyboardInset:P}),M=(0,l.jsxs)(l.Fragment,{children:[(w||i)&&(0,l.jsx)("div",{className:"tw:fixed tw:inset-0 ".concat(C?"tw:animate-fade-out"
1:"tw:animate-fade-in"),style:{position:"fixed",inset:0,backgroundColor:i?"rgba(0, 0, 0, 0.6)":"rgba(0, 0, 0, 0.5)",zIndex:O.z_index-1},onClick:C?void 0:i?s:B}),w&&!i&&(0,l.jsx)("div",{"aria-hidden":!0,style:{position:"fixed",left:0,right:0,bottom:T.bottom-240,height:400,backgroundColor:"white",zIndex:O.z_index-1,pointerEvents:"none"}}),(0,l.jsx)("div",{ref:b,role:"dialog","aria-modal":!(!w&&!i)||void 0,"aria-label":c||"Concierge chat",tabIndex:-1,className:"concierge-widget-container tw:fixed tw:bg-white tw:shadow-2xl tw:flex tw:flex-col tw:overflow-hidden ".concat(C?i?"tw:animate-modal-collapse":w?"tw:animate-slide-down-mobile":"tw:animate-slide-down":i?"tw:animate-modal-expand":"tw:animate-slide-up"),style:Cu(Cu({},(()=>{if(w)return{position:"fixed",zIndex:O.z_index,bottom:T.bottom,right:0,left:0,height:T.height,maxHeight:T.maxHeight,width:"100%",minWidth:"100%",maxWidth:"100%",backgroundColor:"white",borderRadius:"16px 16px 0 0",boxShadow:"0 -25px 50px -12px rgb(0 0 0 / 0.25)",display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehavior:"contain",transition:"bottom 0.25s ease-out, height 0.25s ease-out"};if(i)return{position:"fixed",zIndex:O.z_index,top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"min(768px, 90vw)",height:"min(700px, 85vh)",maxWidth:"90vw",maxHeight:"85vh",backgroundColor:"white",borderRadius:"16px",boxShadow:"0 25px 50px -12px rgb(0 0 0 / 0.25)",display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehavior:"contain"};const e=O.vertical_padding+60+12,t="left"===O.alignment?{left:O.horizontal_padding,right:"auto"}:{right:O.horizontal_padding,left:"auto"};return Cu(Cu({position:"fixed",zIndex:O.z_index,bottom:e},t),{},{height:"".concat(793,"px"),maxHeight:"calc(100vh - ".concat(e+O.vertical_padding,"px)"),width:"430px",minWidth:"430px",maxWidth:"430px",backgroundColor:"white",borderRadius:"16px",boxShadow:"0 25px 50px -12px rgb(0 0 0 / 0.25)",display:"flex",flexDirection:"column",overflow:"hidden",overscrollBehavior:"contain"})})()),{},{outline:"none"}),children:(0,l.jsx)(iu,{widgetState:Cu(Cu({},t),{},{close:B}),pageContext:n,showMaximize:o,isMaximized:i,onMaximize:a,onMinimize:s,title:c,initialQuery:g,initialQueryStacklineSku:f,onInitialQueryProcessed:h,brandId:m,conciergePageUrl:v})}),(0,l.jsx)("style",{children:"\n @keyframes slide-up {\n from {\n opacity: 0;\n transform: translateY(1rem);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n @keyframes slide-down {\n from {\n opacity: 1;\n transform: translateY(0) scale(1);\n }\n to {\n opacity: 0;\n transform: translateY(1rem) scale(0.95);\n }\n }\n @keyframes slide-down-mobile {\n from {\n opacity: 1;\n transform: translateY(0);\n }\n to {\n opacity: 0;\n transform: translateY(100%);\n }\n }\n @keyframes modal-expand {\n from {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.9);\n }\n to {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n }\n @keyframes modal-collapse {\n from {\n opacity: 1;\n transform: translate(-50%, -50%) scale(1);\n }\n to {\n opacity: 0;\n transform: translate(-50%, -50%) scale(0.9);\n }\n }\n @keyframes fade-in {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n @keyframes fade-out {\n from {\n opacity: 1;\n }\n to {\n opacity: 0;\n }\n }\n .tw\\:animate-slide-up {\n animation: slide-up 0.3s ease-out forwards;\n }\n .tw\\:animate-slide-down {\n animation: slide-down 0.25s ease-in forwards;\n }\n .tw\\:animate-slide-down-mobile {\n animation: slide-down-mobile 0.25s ease-in forwards;\n }\n .tw\\:animate-modal-expand {\n animation: modal-expand 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;\n }\n .tw\\:animate-modal-collapse {\n animation: modal-collapse 0.25s ease-in forwards;\n }\n .tw\\:animate-fade-in {\n animation: fade-in 0.2s ease-out forwards;\n }\n .tw\\:animate-fade-out {\n animation: fade-out 0.2s ease-in forwards;\n }\n "})]});return p?M:(0,u.createPortal)(M,document.body)};function ku(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ou(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?ku(Object(n),!0).forEach(function(t){Iu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ku(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Iu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Pu="concierge_session_tracked";function Eu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{appName:t="",appId:n,widgetType:i="floating_button",enabled:a=!0,pageKey:l}=e,s=(0,r.useRef)(!1),c=(0,r.useRef)(null),d=(0,r.useRef)(null),u=(0,r.useCallback)(()=>{if("undefined"==typeof window)return!0;try{return"true"===sessionStorage.getItem(Pu)}catch(e){return!1}},[]),p=(0,r.useCallback)(()=>{if("undefined"!=typeof window)try{sessionStorage.setItem(Pu,"true")}catch(e){}},[]),g=(0,r.useCallback)(async()=>{if(!a||s.current)return;s.current=!0;const e=await(0,o.lw)()||"unknown",r=Ou({pageUrl:window.location.href,pageName:vs(window.location.pathname),widgetType:i,sessionId:e,appName:t||"unknown",appVersion:"v2"},n&&{appId:n});(0,tl.u4)(nl.A.CONCIERGE_WIDGET_IMPRESSION,r).catch(e=>{console.debug("[Concierge Tracking] Failed to track widget impression:",e)})},[a,i,t,n]),f=(0,r.useCallback)(async()=>{if(!a||u())return;p();const e=await(0,o.lw)()||"unknown",r=function(){if("undefined"==typeof window)return{};const e=new URLSearchParams(window.location.search);return{utmSource:e.get("utm_source")||void 0,utmMedium:e.get("utm_medium")||void 0,utmCampaign:e.get("utm_campaign")||void 0}}(),i=Ou(Ou({sessionId:e,appName:t||"unknown",referrer:document.referrer||"",deviceType:ms(),pageUrl:window.location.href,appVersion:"v2"},r),n&&{appId:n});(0,tl.u4)(nl.A.CONCIERGE_WIDGET_SESSION_START,i).catch(e=>{console.debug("[Concierge Tracking] Failed to track widget session start:",e)})},[a,t,n,u,p]);(0,r.useEffect)(()=>{if(a&&"undefined"!=typeof window)return c.current&&c.current.disconnect(),c.current=new IntersectionObserver(e=>{var t;const n=e[0];(null==n?void 0:n.isIntersecting)&&(g(),f(),null==(t=c.current)||t.disconnect())},{threshold:.5}),d.current&&c.current.observe(d.current),()=>{var e;null==(e=c.current)||e.disconnect()}},[a,g,f]);const h=(0,r.useRef)(l);return(0,r.useEffect)(()=>{a&&void 0!==l&&l!==h.current&&(h.current=l,s.current=!1,g())},[l,a,g]),{setTrackingRef:(0,r.useCallback)(e=>{d.current=e,e&&c.current&&c.current.observe(e)},[]),trackImmediate:(0,r.useCallback)(()=>{g(),f()},[g,f])}}function Vu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Fu(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Vu(Object(n),!0).forEach(function(t){Bu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Vu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Bu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const Lu=(e,t)=>{const{shadowColor:n,shadowOpacity:r,shadowBlur:o,shadowSpread:i,shadowOffsetY:a}=e,l=t(n)||"#000000",s=parseInt(l.slice(1,3),16),c=parseInt(l.slice(3,5),16),d=parseInt(l.slice(5,7),16);return"0 ".concat(a,"px ").concat(o,"px ").concat(i,"px rgba(").concat(s,", ").concat(c,", ").concat(d,", ").concat(r,")")},Ru=(e,t)=>{if(e)for(const[n,r]of Object.entries(t))e.style.setProperty(n,r,"important")},Tu=e=>t=>Ru(t,{width:"".concat(e,"px"),height:"".concat(e,"px"),"max-width":"none","max-height":"none","min-width":"0","min-height":"0"}),Mu="var(--bc-bottom-chrome, 0px)",Du=e=>{const{position:t,horizontalOffset:n,verticalOffset:r}=e,o={transition:"bottom 250ms cubic-bezier(0.16, 1, 0.3, 1), top 250ms cubic-bezier(0.16, 1, 0.3, 1)"};return t.startsWith("bottom")?o.bottom="calc(".concat(r,"px + ").concat(Mu,")"):o.top=r,t.endsWith("left")?o.left=n:o.right=n,o},Nu=e=>{let{size:t,color:n}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 22 21",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.4136 0.86523C15.6886 0.33825 16.2385 0 16.8436 0C17.5138 0 18.1155 0.41595 18.3528 1.04398L19.0641 2.92734C19.0641 2.92938 19.0641 2.93146 19.0678 2.93317C19.0678 2.93451 19.0711 2.93589 19.0711 2.93659L20.9545 3.6468C21.5836 3.88362 22 4.48481 22 5.15614C22 5.72264 21.7041 6.23893 21.2332 6.5287C21.728 7.70122 22 8.97786 22 10.3123C22 15.9902 17.0844 20.6245 11 20.6245C9.15053 20.6245 7.40432 20.1948 5.87502 19.4382C4.58938 20.0418 3.17629 20.3976 1.99379 20.6C1.34462 20.7111 0.687877 20.4375 0.309707 19.8975C-0.0684628 19.3574 -0.102773 18.6476 0.220347 18.078C0.739387 17.1527 1.07631 16.1081 1.29603 15.1692C0.467657 13.7204 0.00037716 12.067 0.00037716 10.3123
1C0.00037716 4.63434 4.91591 0 11 0C12.5709 0 14.0627 0.30902 15.4136 0.86523H15.4136ZM11 8.93732C11.7599 8.93732 12.375 9.55329 12.375 10.3123C12.375 11.0712 11.7599 11.6872 11 11.6872C10.2405 11.6872 9.62526 11.0712 9.62526 10.3123C9.62526 9.55329 10.2405 8.93732 11 8.93732ZM5.84414 8.93732C6.60342 8.93732 7.2189 9.55329 7.2189 10.3123C7.2189 11.0712 6.60342 11.6872 5.84414 11.6872C5.08425 11.6872 4.4689 11.0712 4.4689 10.3123C4.4689 9.55329 5.08426 8.93732 5.84414 8.93732ZM16.6201 1.52896C16.6547 1.43619 16.7439 1.375 16.8436 1.375C16.9434 1.375 17.0327 1.43619 17.0673 1.52896L17.7752 3.41269C17.8473 3.59763 17.9539 3.76535 18.0949 3.90524C18.236 4.04516 18.4009 4.15341 18.5864 4.22323L20.4702 4.93337C20.563 4.96843 20.6248 5.05712 20.6248 5.15612C20.6248 5.25512 20.563 5.3438 20.4702 5.37884L18.5864 6.08905C18.4009 6.15881 18.236 6.26712 18.0949 6.40704C17.9539 6.5469 17.8473 6.71466 17.7752 6.89956L17.0673 8.78329C17.0327 8.87609 16.9434 8.93731 16.8436 8.93731C16.7439 8.93731 16.6547 8.87609 16.6201 8.78329L15.912 6.89956C15.8401 6.71465 15.7332 6.5469 15.5925 6.40704C15.4514 6.26712 15.2865 6.15881 15.101 6.08905L13.2172 5.37884C13.1242 5.34381 13.0626 5.25512 13.0626 5.15612C13.0626 5.05712 13.1242 4.96844 13.2172 4.93337L15.101 4.22323C15.2865 4.15341 15.4514 4.04516 15.5925 3.90524C15.7332 3.76535 15.8399 3.59762 15.912 3.41269L16.6201 1.52896Z",fill:n})})},zu=e=>{let{size:t,color:n}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M7.56264 21.5063C6.13139 21.5588 5.16264 22.5338 4.30771 23.3938C4.13521 23.5663 3.96772 23.7376 3.78022 23.9138L1.49274 26.1938C0.592743 27.0938 -0.118508 27.805 0.0165053 28.7688C0.116505 29.4725 0.556503 29.98 0.927755 30.4088C1.77524 31.3288 2.42399 31.8088 3.03151 31.9563C3.03901 31.9563 3.04776 31.96 3.059 31.9638L3.1065 31.9713C3.1265 31.9713 3.1465 31.9788 3.1665 31.9838C3.259 31.9963 3.3465 32 3.43025 32C4.2815 32 4.85025 31.4362 5.45024 30.84C5.58649 30.7038 5.734 30.56 5.914 30.3875L6.91776 29.3875C7.50901 28.7963 8.10901 28.2 8.59274 27.7163C9.58023 26.74 11.2365 25.1125 10.1765 23.0213C9.729 22.0976 8.66151 21.4701 7.56525 21.5064L7.56264 21.5063ZM7.45889 26.5812L4.79639 29.2437C4.62014 29.4075 4.46388 29.5637 4.32015 29.7075C3.77639 30.2512 3.58391 30.4075 3.3964 30.3987C3.26015 30.3587 2.88514 30.1712 2.12016 29.3425C1.86016 29.0425 1.6364 28.7825 1.60392 28.5463C1.58017 28.37 2.23517 27.7188 2.62768 27.3263L4.89516 25.0625C5.07891 24.89 5.26265 24.7063 5.44641 24.5188C6.15766 23.8025 6.82641 23.1313 7.62139 23.1025C8.0739 23.0863 8.56515 23.3625 8.74888 23.73C9.20138 24.6263 8.67638 25.39 7.46889 26.5775L7.45889 26.5812Z",fill:n}),(0,l.jsx)("path",{d:"M24.2466 8.35035C24.3229 8.1341 24.4704 7.75411 24.3341 7.61411C24.1941 7.47786 23.8141 7.62161 23.5979 7.70161C21.5266 8.5491 20.0752 8.58161 17.9678 7.71411C16.9678 7.29035 16.9915 7.71411 17.3315 8.51411C18.1478 10.5741 18.1153 11.933 17.2715 14.0242C17.1915 14.2517 17.0353 14.6042 17.1553 14.7717L17.1715 14.788C17.344 14.908 17.6915 14.7517 17.919 14.6717C20.0103 13.8242 21.3739 13.7955 23.4291 14.6117C24.2491 14.9592 24.6454 14.9555 24.2291 13.9755C23.3616 11.868 23.3979 10.4168 24.2416 8.34536L24.2466 8.35035Z",fill:n}),(0,l.jsx)("path",{d:"M28.4786 2.65522C25.9474 0.460241 22.236 -0.435969 18.3285 0.200242C12.9622 0.871492 9.35871 5.45915 9.55871 11.3575C9.51871 14.325 10.43 16.9124 12.0425 18.8236L10.415 20.4511C10.1025 20.7636 10.1025 21.2711 10.415 21.5824C10.5712 21.7386 10.775 21.8186 10.9787 21.8186C11.1825 21.8186 11.3862 21.7386 11.5425 21.5824L13.1662 19.9586C14.5625 21.1386 16.3049 21.9186 18.3012 22.1786C19.1374 22.3149 19.9611 22.3824 20.7649 22.3824C23.7324 22.3824 26.4475 21.4661 28.4422 19.7511C30.7822 17.7399 31.9937 14.8325 31.9537 11.3413V11.205C32.0262 7.65011 30.8224 4.69146 28.475 2.65493L28.4786 2.65522ZM30.3574 11.3416V11.3541C30.3936 14.3578 29.3736 16.8405 27.4024 18.5365C25.2225 20.4114 21.9998 21.1602 18.5323 20.5914C14.0497 20.0077 11.086 16.2965 11.1585 11.3541V11.3141C11.006 7.04669 13.226 2.44404 18.5571 1.77658C19.3046 1.65658 20.0446 1.59658 20.7646 1.59658C23.3721 1.59658 25.7273 2.38033 27.427 3.86033C29.402 5.57531 30.4182 8.10298 30.3545 11.183V11.3392L30.3574 11.3416Z",fill:n})]})},Wu=e=>{let{size:t,color:n}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M5.5795 9.3888C5.25574 6.76006 4.58825 6.09254 1.95977 5.76907C1.73477 5.74157 1.73477 5.41656 1.95977 5.38907C4.58851 5.06531 5.25603 4.39907 5.5795 1.76934C5.607 1.54434 5.93201 1.54434 5.9595 1.76934C6.28326 4.39808 6.95075 5.0656 9.57923 5.38907C9.80423 5.41657 9.80423 5.74158 9.57923 5.76907C6.95049 6.09283 6.28297 6.75907 5.9595 9.3888C5.932 9.6138 5.60699 9.6138 5.5795 9.3888ZM30.0419 26.2315C27.4132 25.9077 26.7456 25.2402 26.4222 22.6117C26.3947 22.3867 26.0697 22.3867 26.0422 22.6117C25.7184 25.2405 25.0509 25.908 22.4224 26.2315C22.1974 26.259 22.1974 26.584 22.4224 26.6115C25.0512 26.9352 25.7187 27.6015 26.0422 30.2312C26.0697 30.4562 26.3947 30.4562 26.4222 30.2312C26.7459 27.6025 27.4134 26.9349 30.0419 26.6115C30.2669 26.584 30.2669 26.259 30.0419 26.2315ZM25.7982 15.0976C19.0368 14.2663 17.3208 12.5501 16.4907 5.79014C16.4194 5.21139 15.5832 5.21139 15.512 5.79014C14.6807 12.5515 12.9645 14.2675 6.20449 15.0976C5.62574 15.1689 5.62574 16.0051 6.20449 16.0763C12.9658 16.9076 14.6818 18.6238 15.512 25.3838C15.5832 25.9626 16.4194 25.9626 16.4907 25.3838C17.322 18.6225 19.0382 16.9065 25.7982 16.0763C26.3769 16.0051 26.3769 15.1689 25.7982 15.0976Z",fill:n})})},Uu=e=>{let{size:t,color:n}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 29 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M28.8011 15.6931C24.2989 14.0296 20.7487 10.4791 19.0802 5.97229C18.9735 5.68559 18.5718 5.68559 18.4652 5.97229C16.8017 10.4745 13.2511 14.0247 8.74432 15.6931C8.45762 15.7998 8.45762 16.2015 8.74432 16.3082C13.2465 17.9717 16.7967 21.5223 18.4652 26.0291C18.5718 26.3158 18.9735 26.3158 19.0802 26.0291C20.7437 21.5269 24.2943 17.9766 28.8011 16.3082C29.0878 16.2015 29.0878 15.7998 28.8011 15.6931Z",fill:n}),(0,l.jsx)("path",{d:"M10.1329 4.96561C7.87933 4.13385 6.10403 2.35869 5.2723 0.105011C5.22063 -0.0350037 5.01561 -0.0350037 4.96561 0.105011C4.13384 2.35858 2.35869 4.13388 0.105011 4.96561C-0.0350036 5.01728 -0.0350036 5.22231 0.105011 5.27231C2.35858 6.10408 4.13387 7.87924 4.96561 10.1329C5.01728 10.2729 5.2223 10.2729 5.2723 10.1329C6.10407 7.87934 7.87922 6.10404 10.1329 5.27231C10.2729 5.22064 10.2729 5.01562 10.1329 4.96561Z",fill:n}),(0,l.jsx)("path",{d:"M11.8735 28.4863C10.3716 27.9313 9.18983 26.7494 8.63479 25.2476C8.60145 25.1543 8.46477 25.1543 8.42977 25.2476C7.87472 26.7494 6.69291 27.9313 5.1911 28.4863C5.09776 28.5196 5.09776 28.6563 5.1911 28.6913C6.69291 29.2464 7.87472 30.4282 8.42977 31.93C8.4631 32.0233 8.59978 32.0233 8.63479 31.93C9.18983 30.4282 10.3716 29.2464 11.8735 28.6913C11.9668 28.658 11.9668 28.5213 11.8735 28.4863Z",fill:n})]})},Hu=e=>{let{size:t,color:n}=e;return(0,l.jsxs)("svg",{width:t,height:t,viewBox:"0 0 30 30",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M14.5 6C14.9669 6 15.3721 6.32312 15.4756 6.77832L16.3066 10.4336C16.5626 11.5589 17.4411 12.4374 18.5664 12.6934L22.2217 13.5244C22.6769 13.6279 23 14.0332 23 14.5C23 14.9669 22.6769 15.3721 22.2217 15.4756L18.5664 16.3066C17.4411 16.5626 16.5626 17.4411 16.3066 18.5664L15.4756 22.2217C15.3721 22.6769 14.9669 23 14.5 23C14.0332 23 13.6279 22.6769 13.5244 22.2217L12.6934 18.5664C12.4374 17.4411 11.5589 16.5626 10.4336 16.3066L6.77832 15.4756C6.32312 15.3721 6 14.9669 6 14.5C6 14.0332 6.32312 13.6279 6.77832 13.5244L10.4336 12.6934C11.5589 12.4374 12.4374 11.5589 12.6934 10.4336L13.5244 6.77832C13.6279 6.32312 14.0332 6 14.5 6ZM14.5 11.3848C14.0004 12.8485 12.8485 14.0004 11.3848 14.5C12.8485 14.9997 14.0004 16.1515 14.5 17.6152C14.9997 16.
11515 16.1515 14.9997 17.6152 14.5C16.1515 14.0004 14.9997 12.8485 14.5 11.3848Z",fill:n}),(0,l.jsx)("path",{d:"M4.24316 4.24316C9.90081 -1.41444 19.0738 -1.41444 24.7314 4.24316C30.1513 9.66312 30.3786 18.309 25.4141 24L29.707 28.293C30.0976 28.6835 30.0976 29.3165 29.707 29.707C29.3165 30.0976 28.6835 30.0976 28.293 29.707L24 25.4141C18.309 30.3786 9.66312 30.1513 4.24316 24.7314C-1.41444 19.0738 -1.41444 9.90081 4.24316 4.24316ZM23.3174 5.65723C18.4408 0.780632 10.5338 0.780632 5.65723 5.65723C0.780632 10.5338 0.780632 18.4408 5.65723 23.3174C10.5338 28.194 18.4408 28.194 23.3174 23.3174C28.194 18.4408 28.194 10.5338 23.3174 5.65723Z",fill:n})]})},Qu=e=>{let{size:t,color:n}=e;return(0,l.jsx)("svg",{width:t,height:t,viewBox:"0 0 26 33",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M11.2715 8.41504C11.7891 8.41504 12.209 8.83488 12.209 9.35254C12.2089 9.83275 11.8474 10.2276 11.3818 10.2822L11.375 10.29H11.2715C6.22032 10.29 2.12516 14.3854 2.125 19.4365C2.125 24.4878 6.22022 28.583 11.2715 28.583C16.3226 28.5828 20.418 24.4877 20.418 19.4365C20.4181 18.919 20.8379 18.499 21.3555 18.499C21.8729 18.4991 22.2928 18.9191 22.293 19.4365C22.293 22.1425 21.315 24.618 19.6963 26.5361L24.3086 31.1494C24.6758 31.5147 24.6761 32.108 24.3096 32.4736C23.944 32.8411 23.35 32.8421 22.9844 32.4746V32.4736L18.3711 27.8623C16.4528 29.4809 13.9771 30.458 11.2715 30.458C5.18454 30.4579 0.250088 25.5235 0.25 19.4365C0.25 13.3495 5.18448 8.41512 11.2715 8.41504ZM19.916 5.39355C20.019 4.80866 20.858 4.80851 20.9609 5.39355C21.3483 7.6173 23.0907 9.35979 25.3145 9.74707L25.418 9.77441C25.8975 9.95202 25.8628 10.6955 25.3145 10.792C23.1601 11.1673 21.4583 12.8141 21.002 14.9385L20.9609 15.1455C20.8644 15.694 20.1205 15.7284 19.9434 15.248L19.916 15.1455C19.5407 12.9911 17.8939 11.2883 15.7695 10.832L15.5625 10.792C14.9776 10.6891 14.9775 9.84999 15.5625 9.74707L15.7695 9.70605C17.8939 9.24964 19.5408 7.54786 19.916 5.39355ZM13.6172 0.588867C13.6954 0.136853 14.3476 0.137006 14.4258 0.588867L14.4736 0.816406C14.76 1.93339 15.6761 2.78969 16.8262 2.99023C17.2787 3.0684 17.2781 3.71945 16.8252 3.79688C15.5988 4.01107 14.6398 4.97179 14.4258 6.19824C14.3479 6.65089 13.695 6.65075 13.6172 6.19824C13.4032 4.97154 12.4435 4.01177 11.2168 3.79785V3.79688C10.7647 3.71866 10.7648 3.06837 11.2168 2.99023L11.4434 2.94141C12.5607 2.65526 13.4166 1.73913 13.6172 0.588867Z",fill:n})})},Zu=(e,t,n)=>{switch(e){case"search-sparkle":return(0,l.jsx)(zu,{size:t,color:n});case"three-sparkles":return(0,l.jsx)(Wu,{size:t,color:n});case"diamond-sparkles":return(0,l.jsx)(Uu,{size:t,color:n});case"search-star":return(0,l.jsx)(Hu,{size:t,color:n});case"search-sparkle-alt":return(0,l.jsx)(Qu,{size:t,color:n});default:return(0,l.jsx)(Nu,{size:t,color:n})}},qu=e=>{let{widgetState:t,isConciergeEnabled:n=!0,hideOnConciergePage:o=!1,isMaximized:a=!1,onSuggestedPillClick:s,currentPathname:c,appId:u,appName:p}=e;const{toggle:g,isOpen:f,close:h,open:m}=t,[v,y]=(0,r.useState)(!1),[x,b]=(0,r.useState)(!1),w=(0,r.useRef)(f),[A,C]=(0,r.useState)(null),j=(0,r.useRef)(null),S=(0,r.useCallback)(e=>{var t;if(null==(t=j.current)||t.disconnect(),j.current=null,!e)return;const n=()=>{const t=e.getBoundingClientRect().width;t<=0||C(e=>null!==e&&Math.abs(e-t)<.5?e:t)};if(n(),"undefined"!=typeof ResizeObserver){const t=new ResizeObserver(n);t.observe(e),j.current=t}},[]);(0,r.useEffect)(()=>()=>{var e;return null==(e=j.current)?void 0:e.disconnect()},[]);const[k,O]=(0,r.useState)(!1),I=(0,r.useCallback)(e=>{e?requestAnimationFrame(()=>O(!0)):O(!1)},[]),P=wu(),E=(0,d.Hr)(),V=(0,d.at)("floating-button",{}),F=V.featurePromptText||"Open Concierge",B=!u||!p,{data:L}=(0,i.pT)(void 0,{enabled:B}),R=null!=p?p:null==L?void 0:L.app.appName,T=null!=u?u:null==L?void 0:L.app.appId,{trackImmediate:M}=Eu({appName:R,appId:T,widgetType:"floating_button",enabled:n&&!P.hide_default_launcher&&!!R,pageKey:c});return(0,r.useEffect)(()=>{R&&n&&!P.hide_default_launcher&&M()},[R,n,P.hide_default_launcher,M]),(0,r.useCallback)((e,t,n)=>{(0,tl.u4)(nl.A.CONCIERGE_SUGGESTED_PILL_CLICKED,Fu({message:e,messageIndex:t,source:"minimized_floating_button",stackl
1ineSku:n,appVersion:"v2"},T&&{appId:T})),null==s||s(e,n),m()},[T,s,m]),(0,r.useEffect)(()=>{if(w.current&&!f){b(!0);const e=setTimeout(()=>{b(!1)},350);return()=>clearTimeout(e)}w.current=f},[f]),(0,r.useEffect)(()=>{const e=e=>{"Escape"===e.key&&f&&h()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[f,h]),a||o||!n||P.hide_default_launcher||!1===(null==E?void 0:E.conciergeIcon)?null:(0,l.jsx)(d.$o,{widgetId:"floating-button",displayName:"Floating Button",children:(e,t)=>{return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("style",{children:"\n @keyframes button-pop-in {\n 0% {\n opacity: 0;\n transform: scale(0.5);\n }\n 70% {\n opacity: 1;\n transform: scale(1.1);\n }\n 100% {\n opacity: 1;\n transform: scale(1);\n }\n }\n .concierge-button-animate-in {\n animation: button-pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;\n }\n "}),(0,l.jsxs)("div",{onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[!f&&V.featurePromptText&&!1!==(null==E?void 0:E.featureIconPrompts)&&(n=>{const r=t(e.featurePromptBgColor),o=t(e.featurePromptTextColor),i=e.fontFamilyCss&&"inherit"!==e.fontFamilyCss?e.fontFamilyCss:void 0,a=Math.min(null!=A?A:280,280),s=(null!==(n=e.featurePromptBorderWidth)&&void 0!==n?n:0)>0?"".concat(e.featurePromptBorderWidth,"px solid ").concat(t(e.featurePromptBorderColor)):"none",c=k&&null!==A;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("span",{ref:S,"aria-hidden":!0,style:{position:"fixed",top:-9999,left:-9999,visibility:"hidden",pointerEvents:"none",whiteSpace:"nowrap",padding:"10px 16px",boxSizing:"border-box",fontSize:"".concat(e.featurePromptFontSize,"px"),fontWeight:e.featurePromptFontWeight,fontFamily:i,border:s},children:V.featurePromptText}),(0,l.jsx)("div",{ref:I,role:"button",className:"concierge-focus-ring",onClick:()=>{m()},onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),m())},style:Fu(Fu(Fu({position:"fixed"},e.position.startsWith("bottom")?{bottom:"calc(".concat(e.verticalOffset+e.size+12,"px + ").concat(Mu,")")}:{top:e.verticalOffset+e.size+12}),e.position.endsWith("right")?{right:e.horizontalOffset}:{left:e.horizontalOffset}),{},{padding:"10px 16px",borderRadius:"".concat(e.featurePromptBorderRadius,"px"),border:s,boxSizing:"border-box",backgroundColor:r,color:o,fontSize:"".concat(e.featurePromptFontSize,"px"),fontWeight:e.featurePromptFontWeight,fontFamily:i,cursor:"pointer",boxShadow:"0 2px 12px rgba(0, 0, 0, 0.12)",zIndex:P.z_index-1,width:"".concat(c?a:0,"px"),textAlign:"left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",opacity:c?1:0,pointerEvents:c?"auto":"none",transition:"width ".concat(260,"ms ease-out, bottom 250ms cubic-bezier(0.16, 1, 0.3, 1)")}),"aria-hidden":!c,tabIndex:c?0:-1,"aria-label":F,"data-concierge-launcher":"",children:(0,l.jsx)("span",{style:{display:"block",opacity:c?1:0,transition:"opacity ".concat(160,"ms ease-out ").concat(260,"ms")},children:V.featurePromptText})})]})})(),(0,l.jsx)("button",{ref:(n=e.size,e=>Ru(e,{width:"".concat(n,"px"),height:"".concat(n,"px"),"max-width":"none","max-height":"none",padding:"0","box-sizing":"content-box"})),onClick:g,"data-concierge-launcher":"",className:"concierge-focus-ring".concat(x?" concierge-button-animate-in":""),style:Fu(Fu({position:"fixed"},Du(e)),{},{width:e.size,height:e.size,minWidth:e.size,minHeight:e.size,backgroundColor:t(v?e.backgroundColorHover:e.backgroundColor),borderRadius:"".concat(e.borderRadius,"%"),boxShadow:Lu(e,t),cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",zIndex:P.z_index,transition:x?"none":"transform ".concat(e.animationDuration,"ms ease, background-color ").concat(e.animationDuration,"ms ease"),border:e.borderWidth>0?"".concat(e.borderWidth,"px solid ").concat(t(e.borderColor)):"none",transform:!x&&v?"scale(".concat(e.hoverScale,")"):x?void 0:"scale(1)"}),"aria-label":f?"Close Concierge":F,children:f?(0,l.jsx)("svg",{width:"19",height:"11",viewBox:"0 0 19 11",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M1.25 1.25L9.1543 9.1543L17.0586 1.25",stroke:t(e.iconColor),strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round"})}):e.customIconUrl?(0,l.jsx)("img",{ref:Tu(e.iconSize),src:e.customIconUrl,alt:"",style:{width:e.iconSize,height:e.iconSize}}):P.custom_launcher_icon?(0,l.jsx)("img",{ref:Tu(e.iconSize),src:P.custom_launcher_icon,alt:"",style:{width:e.iconSize,height:e.iconSize}}):Zu(e.iconStyle,e.iconSize,t(e.iconColor))})]})]});var n}})};var Yu=n(66188),Ku=n(71336);function Gu(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Ju(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
1t%2?Gu(Object(n),!0).forEach(function(t){Xu(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Gu(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Xu(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const _u=new s.E,$u=e=>{let{widgetState:t,pageContext:n,showMaximize:o=!1,isMaximized:i=!1,onMaximize:a,onMinimize:s,title:c,isConciergeEnabled:u=!0,conciergeControlled:p=!1,hideOnConciergePage:g=!1,apiBaseUrl:f,initialQuery:h,initialQueryStacklineSku:v,onInitialQueryProcessed:y,brandId:x,conciergePageUrl:b,appId:w,appName:A,commerce:C}=e;const[j,S]=(0,r.useState)(null),{data:k}=(0,d.j1)(),O=(0,r.useMemo)(()=>(0,Ku.H)(k),[k]),I=(0,r.useCallback)(e=>{S(e)},[]),P=(0,r.useCallback)(()=>{S(null),null==y||y()},[y]),E=j||h,V=(0,r.useCallback)(()=>{const e=function(){var e,t,n;if("undefined"==typeof window)return null;const r=null!==(e=null==(t=window.__BC_BOOTSTRAP__)?void 0:t.authType)&&void 0!==e?e:null;if("no_auth"===r)return null;if("shopify"===r){const e=null==(n=window.__BC_BOOTSTRAP__)?void 0:n.customerAccountsVersion;return"".concat("classic"===e?"/account/login?return_url=":"/customer_authentication/login?return_to=").concat(encodeURIComponent("".concat(window.location.pathname).concat(window.location.search)))}return"".concat((0,m.hp)(),"/signin")}();e&&window.location.assign(e)},[]);return(0,l.jsxs)(Lt.Mi,{apiBaseUrl:f,requestSignIn:V,commerce:C,children:[(0,l.jsx)(qu,{widgetState:t,isConciergeEnabled:u,hideOnConciergePage:g,appId:w,appName:A,onSuggestedPillClick:I}),t.isOpen&&(0,l.jsx)(Yu.s,{themeCSS:O,children:(0,l.jsx)(Su,{widgetState:t,pageContext:n,showMaximize:o,isMaximized:i,onMaximize:a,onMinimize:s,title:c,isConciergeEnabled:u||p,disablePortal:!0,initialQuery:E,initialQueryStacklineSku:j?void 0:v,onInitialQueryProcessed:P,brandId:x,conciergePageUrl:b})})]})},ep=e=>{var t;return(0,l.jsx)(c.Ht,{client:null!==(t=e.queryClient)&&void 0!==t?t:_u,children:(0,l.jsx)($u,Ju({},e))})};var tp=n(94770),np=n(72042),rp=n(98125),op=n(30140),ip=n(49829),ap=n(54772);const lp=op.kx,sp=e=>{let{isConciergeEnabled:t,onQuestionClick:n,appName:o,appId:i}=e;const a=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const[n,o]=(0,r.useState)(null);return(0,r.useEffect)(()=>{const n=()=>{const t=document.querySelector(e);return t?(o(t),!0):(o(null),!1)};if(n()&&t)return;const r=new MutationObserver(()=>{n()&&t&&r.disconnect()});return r.observe(document.body,{childList:!0,subtree:!0}),()=>r.disconnect()},[e,t]),n}(".bc-concierge-suggested-questions"),s=(0,ap.o)(),{data:c}=(0,d.j1)(),p=(0,r.useMemo)(()=>(0,Ku.H)(c),[c]),{questions:g,isLoading:f}=bt({stacklineSku:s||void 0,apiBaseUrl:lp,enabled:t&&!!s}),{trackImmediate:h}=Eu({appName:o,appId:i,widgetType:"embedded",enabled:t&&!!s});return(0,r.useEffect)(()=>{a&&s&&t&&h()},[a,s,t,h]),t&&a&&s?(0,u.createPortal)((0,l.jsx)(Yu.s,{themeCSS:p,hostId:"conversation-starters-shadow-host",children:(0,l.jsx)(d.mR,{widgetId:"pdp-conversation-starters",displayName:"Conversation Starters",questions:g,isLoading:f,onQuestionClick:e=>{s&&n(e,s)}})}),a):null};var cp=n(98621);function dp(e){if(!e)return null;try{const t=new URL(e,window.location.origin),n=t.pathname.match(/\/products\/([^/?#]+)/);if(!n)return null;const r=t.searchParams.get("variant"),o=r&&/^\d+$/.test(r)?Number(r):null;return{handle:n[1],variantId:o}}catch(e){return null}}const up=e=>{var t;return null!==(t=e.dtcProductPageUrl)&&void 0!==t?t:e.retailerProductPageUrl},pp="_bcConciergeVisitorId";async function gp(e,t){const n=async e=>{try{const t=await e.json();return null==t?void 0:t.attributes}catch(e){return}},r=e=>!!e&&Object.entries(t).every(t=>{let[n,r]=t;return e[n]===r}),o=await n(e);if(o)return r(o);const i=await fetch("/cart.js",{headers:{accept:"application/json"},credentials:"same-origin"});return!!i.ok&&r(await n(i))}let fp;var hp=n(32128),mp=n(99014),vp=n(95810);function yp(e){var t;let{bootstrap:n,cartEnabled:o}=e;const i=(0,c.jE)(),{mutateAsync:a}=(0,hp.u6)(),l=(0,r.useRef)(a);l.current=a;const s=(0,r.useRef)([]);s.current=function(e){var t,n;return Object.values(null!==(t=null==e||null===(n=e.capabilities)||void 0===n?void 0:n.checkout)&&void 0!==t?t:{}).map(e=>e.retailerId)}(n);const d=function(e){let{checkoutRetailerIds:t,cartEnabled:n,storeKind:r,servingSurface:o}=e;return t.length>0?n?"brandclub":"none":"shopify"===r&&"shopify_app_proxy"===o?"shopify":"none"}({checkoutRetailerIds:s.current,cartEnabled:o,storeKind:"undefined"==typeof window?void 0:window.bcStoreKind,servingSurface:null==n||null===(t=n.app)||void 0===t?void 0:t.servingSurface}),u=(0,r.useMemo)(()=>function(e){let{queryClient:t,addItems:n,getCheckoutRetailerIds:r}=e;
1const o=(0,hp.mC)().queryKey,i=(0,cp.EN)(o),a=()=>{var e,n;return(0,mp.n3)(null!==(e=null===(n=t.getQueryData(o))||void 0===n?void 0:n.userRetailerShoppingCarts)&&void 0!==e?e:[])},l={provider:"brandclub",stampConciergeVisitor:async()=>{},stampConciergeAttribution:async()=>{},canAddToCart:e=>!1!==e.isAvailable&&!(!e.retailerSku||!e.stacklineSku)&&"number"==typeof e.retailerId&&r().includes(e.retailerId),async addToCart(e){if(!l.canAddToCart(e))return{ok:!1,error:"not_checkout_eligible"};const t=function(e){var t,n,r,o;return{brandId:null!==(t=e.brandId)&&void 0!==t?t:0,retailerSku:e.retailerSku,retailerId:e.retailerId,stacklineSku:e.stacklineSku,quantity:null!==(n=e.quantity)&&void 0!==n?n:1,retailPrice:null!==(r=e.retailPrice)&&void 0!==r?r:0,title:e.title,dtcProductPageUrl:null!==(o=e.retailerProductPageUrl)&&void 0!==o?o:e.dtcProductPageUrl}}(e);try{await n({action:"add",retailerId:t.retailerId,items:[t]})}catch(e){return console.error("[conciergeCommerce] add to bag failed:",e),{ok:!1,error:"cart_add_failed"}}return{ok:!0,itemCount:a()}},getCartState:()=>({itemCount:a()}),subscribe(e){let n=a();return t.getQueryCache().subscribe(t=>{if(t.query.queryHash!==i)return;const r=a();r!==n&&(n=r,e({itemCount:r}))})},refreshCart:async()=>{try{await t.fetchQuery((0,hp.mC)())}catch(e){console.error("[conciergeCommerce] could not load the bag:",e)}},goToCart:()=>vp.A.show(),goToCheckout:()=>vp.A.show()};return l}({queryClient:i,addItems:e=>l.current(e),getCheckoutRetailerIds:()=>s.current}),[i]);return(0,r.useEffect)(()=>{"brandclub"===d&&u.refreshCart()},[d,u]),"brandclub"===d?u:"shopify"===d?function(){if("undefined"!=typeof window){if(void 0===fp){const e=window.bcStoreKind;fp="shopify"===e?function(){var e;const t=null!==(e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).isSupportedSurface)&&void 0!==e?e:()=>!0;let n=null,r=null,o=null,i=null,a={itemCount:0};const l=new Set,s=async()=>{try{const t=await fetch("/cart.js",{headers:{accept:"application/json"},credentials:"same-origin"});if(!t.ok)return;const n=await t.json();"number"==typeof n.item_count&&(e={itemCount:n.item_count},a=e,l.forEach(e=>{try{e(a)}catch(e){}}))}catch(e){console.error("[shopifyCommerce] cart.js fetch failed:",e)}var e},c={provider:"shopify",stampConciergeVisitor:async e=>{const t=null==e?void 0:e.trim();if(!t)return;if(n===t)return;if((null==r?void 0:r.visitorId)===t)return r.promise;const o=(async()=>{try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify({attributes:{[pp]:t}})});if(!e.ok)return;await gp(e,{[pp]:t})&&(n=t)}catch(e){}finally{r=null}})();return r={visitorId:t,promise:o},o},stampConciergeAttribution:async e=>{var t,n;const r=null==(t=e.visitorId)?void 0:t.trim(),a=null==(n=e.touchId)?void 0:n.trim(),l={};if(r&&(l[pp]=r),a&&(l._bcConciergeTouchId=a),0===Object.keys(l).length)return;const s="".concat(null!=r?r:"","|").concat(null!=a?a:"");if(o===s)return;if((null==i?void 0:i.key)===s)return i.promise;const c=(async()=>{try{const e=await fetch("/cart/update.js",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify({attributes:l})});if(!e.ok)return;await gp(e,l)&&(o=s)}catch(e){}finally{i=null}})();return i={key:s,promise:c},c},canAddToCart(e){return t()&&"number"==typeof(n=e.retailerId)&&n>1e5&&null!==dp(up(e));var n},async addToCart(e){var t,n;const r=dp(up(e));if(!r)return{ok:!1,error:"no_product_handle"};let o;try{const e=await fetch("/products/".concat(r.handle,".js"),{headers:{accept:"application/json"},credentials:"same-origin"});if(!e.ok)return{ok:!1,error:"product_lookup_".concat(e.status)};o=await e.json()}catch(e){return console.error("[shopifyCommerce] product lookup failed:",e),{ok:!1,error:"product_lookup_failed"}}const i=null!==(t=o.variants)&&void 0!==t?t:[],l=r.variantId?i.find(e=>e.id===r.variantId):void 0,c=null!==(n=null!=l?l:i.find(e=>e.available))&&void 0!==n?n:i[0];if(!c)return{ok:!1,error:"no_variant"};try{var d;const t=await fetch("/cart/add.js",{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},credentials:"same-origin",body:JSON.stringify({items:[{id:c.id,quantity:null!==(d=e.quantity)&&void 0!==d?d:1}]})});if(!t.ok){let e="cart_add_".concat(t.status);try{const n=await t.json();(null==n?void 0:n.description)&&(e=n.description)}catch(e){}return{ok:!1,error:e}}}catch(e){return console.error("[shopifyCommerce] cart/add.js failed:",e),{ok:!1,error:"cart_add_failed"}}return await s(),{ok:!0,itemCount:a.itemCount}},getCartState:()=>a,subscribe:e=>(l.add(e),()=>l.delete(e)),refreshCart:s,goToCart:()=>window.location.assign("/cart"),goToCheckout:()=>window.location.assign("/checkout")};return c}():null,null==fp||fp.refreshCart()}return null!=fp?fp:void 0}}():void 0}var xp=n(39537),bp=n(95181),wp=n(8828);const Ap=op.kx,Cp=e=>{var t,n,s,c,d;let{mountSource:u="theme-script",showConcierge:p,cartEnabled:g=!0}=e;const{isOpen:f,open:h,close:m,toggle:v,isMaximized:y,setMaximized:x,pendingQuery:b,setPendingQuery:w,activeStacklineSku:A}=(0,tp.T)(),{data:C}=(0,np.sb)(),j=(0,o.qx)(),S=null!==(t=null==j?void 0:j.uniqueVisitorId)&&void 0!==t?t:void 0,k=(0,rp.N)(),[O,I]=(0,r.useState)(wp.JH),[P,E]=(0,r.useState)(()=>"pages-storefront"===u?(0,wp.mL)():void 0),{data:V}=(0,i.pT)(Ap),F=null==V?void 0:V.app.appId,B=yp({bootstrap:V,cartEnabled:g}),{data:L}=(0,mt.I)((e=>{let{isCatalogV2:t,storeKind:n,retailerSku:r}=e;return(0,xp.j)({queryKey:["concierge-retailer-sku-product",n,r],queryFn:e=>{let{signal:t}=e;if(!r)throw new Error("Failed to fetch concierge product context: missing retailerSku");return(0,bp.Nj)(r,n,t)},enabled:t&&!!r&&!!n,notifyOnChangeProps:["data"]})})(k)),R={isOpen:f,open:h,close:m,toggle:v,isMaximized:y,setMaximized:x};(0,r.useEffect)(()=>{S&&console.info("[ShopperOS Concierge] BC visitorId",S)},[S]);const T=(e=>{var t,n,r;const o={email:null!==(t=null==e?void 0:e.email)&&void 0!==t?t:"",phoneNumber:null!==(n=null==e?void 0:e.phoneNumber)&&void 0!==n?n:""};
1void 0!==(null==e?void 0:e.appId)&&(o.appId=e.appId),void 0!==(null==e?void 0:e.appConfigId)&&(o.appConfigId=e.appConfigId);const i=function(e){if(null==e)return;const t=e.trim().toLowerCase().replace(/\.$/,"");return t&&("shopperos.app"===t||t.endsWith(".shopperos.app"))?"*.shopperos.app":e}(null==e?void 0:e.domain);void 0!==i&&(o.domain=i),void 0!==(null==e?void 0:e.path)&&(o.path=e.path),void 0!==(null==e?void 0:e.themeName)&&(o.themeName=e.themeName),void 0!==(null==e?void 0:e.themeId)&&(o.themeId=e.themeId),void 0!==(null==e?void 0:e.visitorId)&&(o.visitorId=e.visitorId);const{treatments:l}=(0,a.v)({names:["brandclub_dtc_concierge"],attributes:o});return!!function(){if("undefined"==typeof window)return!1;const e=window.__BC_BOOTSTRAP__;return"shopify_app_proxy"===(null==e?void 0:e.servingSurface)}()||"on"===(null==(r=null==l?void 0:l.brandclub_dtc_concierge)?void 0:r.treatment)})({email:null==C?void 0:C.email,phoneNumber:null==C?void 0:C.phoneNumber,appId:op.vL,domain:window.location.hostname,path:window.location.pathname,themeName:null===(n=window.Shopify)||void 0===n||null===(n=n.theme)||void 0===n?void 0:n.name,themeId:null===(s=window.Shopify)||void 0===s||null===(s=s.theme)||void 0===s||null===(s=s.id)||void 0===s?void 0:s.toString(),visitorId:S}),M="theme-script"!==u,D=!("pages-storefront"===u&&(!1===p||!1===P))&&("app-proxy"===u?!1!==p:T),N=(e=>{var t,n,r;let{retailerProduct:o,currentProductContext:i,activeStacklineSku:a}=e;return null!==(t=null!==(n=null!==(r=null==o?void 0:o.stacklineSku)&&void 0!==r?r:i.stacklineSku)&&void 0!==n?n:a)&&void 0!==t?t:void 0})({retailerProduct:L,currentProductContext:k,activeStacklineSku:null!=A?A:void 0}),z=N?{pageType:"pdp",stacklineSku:N,source:O}:void 0;(0,r.useEffect)(()=>{const e=()=>{I((0,wp.JH)()),"pages-storefront"===u&&E((0,wp.mL)())};e(),window.addEventListener("bcProductMetaDataChanged",e);const t=window.setInterval(e,500);return()=>{window.removeEventListener("bcProductMetaDataChanged",e),window.clearInterval(t)}},[u]);const W=(0,r.useCallback)(()=>{x(!0)},[x]),U=(0,r.useCallback)(()=>{x(!1)},[x]),H=(0,r.useCallback)((e,t)=>{w({query:e,stacklineSku:t}),h()},[h,w]),Q=(0,r.useCallback)(()=>{w(null)},[w]);return M||D?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ep,{widgetState:R,pageContext:z,showMaximize:!0,isMaximized:y,onMaximize:W,onMinimize:U,isConciergeEnabled:D,conciergeControlled:M,hideOnConciergePage:!1,apiBaseUrl:Ap,queryClient:ip.q,appId:null==V?void 0:V.app.appId,appName:null==V?void 0:V.app.appName,initialQuery:null==b?void 0:b.query,initialQueryStacklineSku:null==b?void 0:b.stacklineSku,onInitialQueryProcessed:Q,brandId:null==V||null===(c=V.app.brandIds)||void 0===c?void 0:c[0],conciergePageUrl:null!==(d=null==V?void 0:V.app.canonicalConciergeUrl)&&void 0!==d?d:"".concat(op.kx,"/concierge"),commerce:B}),(0,l.jsx)(sp,{isConciergeEnabled:D,onQuestionClick:H,appName:null==V?void 0:V.app.appName,appId:F})]}):null}},50795(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=50795,e.exports=t}}]); 2//# sourceMappingURL=625.03902e7e.bc-checkout-shop-app.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.