PageSourceSearch

https://www.interflora.co.uk/assets/uk_prd_IFCT-9173_PDP-Tabbed-Mo…/static/chunks/8166.6e82e3ba6b11a148.js

js interflora.co.uk collected 2026-10-01 12:17:44 UTC 23,101 bytes, 1 lines download raw bytes

1!function(){try{var e="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="cd98e28c-4882-41d1-80c4-369392ac63fc",e._sentryDebugIdIdentifier="sentry-dbid-cd98e28c-4882-41d1-80c4-369392ac63fc")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8166],{25765:(e,t,i)=>{i.d(t,{A:()=>o});var a=i(6029),n=i(63428),r=i(51242);let s=(0,i(80575).n9)()(e=>({noResults:{textAlign:"center"},hide:{display:"none"},show:{display:"block"},blogArticleGallery:{gridTemplateColumns:"repeat(1, 1fr)",[e.breakpoints.up("sm")]:{gridTemplateColumns:"repeat(1, 1fr)"},[e.breakpoints.up("md")]:{gridTemplateColumns:"repeat(2, 1fr)"},[e.breakpoints.up("lg")]:{gridTemplateColumns:"repeat(3, 1fr)"}}})),o=e=>{let{items:t,isInspiration:i,show:o=!0}=e,{classes:l}=s();return(0,a.jsx)("div",{className:o?l.show:l.hide,children:(null==t?void 0:t.length)?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(r.A,{breakpoints:{extraSmall:12,small:12,medium:6,large:4},ItemComponent:n.A,componentProps:{showDescription:!0},initialVisibleItems:i?12:null==t?void 0:t.length,hasAlgoliaResults:!0,items:t,isInspiration:!!i,className:l.blogArticleGallery})}):!i&&(0,a.jsx)("p",{className:l.noResults,children:"Sorry there are no articles that match the selected category"})})}},29958:(e,t,i)=>{i.d(t,{A:()=>x});var a=i(6029),n=i(42246),r=i(55729),s=i(91202),o=i(87192),l=i(58585),u=i(80575),c=i(13939);let d=(0,u.n9)()(e=>({modal:{"& .MuiDialog-paper":{padding:"20px",[e.breakpoints.up("md")]:{width:"100%",maxWidth:"796px",maxHeight:"92vh",left:0,padding:"initial"},[e.breakpoints.up("lg")]:{maxWidth:"1009px"},[e.breakpoints.up("xl")]:{maxWidth:"1336px"}},"& header":{alignItems:"center","& h3":Object.assign(Object.assign(Object.assign({},e.typography.small_regular),e.typographySpacing.none),{[e.breakpoints.up("md")]:Object.assign(Object.assign({paddingLeft:"136px"},e.typography.large_regular),{marginTop:c.YK.small})}),"& > div":{[e.breakpoints.up("md")]:{paddingRight:c.YK.large,paddingTop:c.YK.small}},[e.breakpoints.up("md")]:{marginBottom:c.YK.medium}}},content:Object.assign(Object.assign(Object.assign({},e.typography.small_regular),e.typographySpacing.small_regular_lg),{marginBottom:c.YK.small,color:e.isFlyingFlowers?c.Tj.black[700]:c.Tj.grey.grey6,[e.breakpoints.up("md")]:{paddingLeft:"136px",paddingRight:"136px",marginBottom:c.YK.medium},"& span":Object.assign({},e.typography.small_bold),[e.breakpoints.down("xl")]:{"-webkit-text-size-adjust":"100%"}}),domesticContent:{marginBottom:c.YK.large},productGrid:{display:"flex",justifyContent:"center",marginBottom:c.YK.medium,"& a":{maxWidth:"160px",[e.breakpoints.up("lg")]:{maxWidth:"248px"}},"& > :not(:last-child)":{marginRight:c.YK.small,[e.breakpoints.up("lg")]:{marginRight:"44px"}},"& .MuiPaper-root":{padding:"initial"},[e.breakpoints.up("md")]:{marginBottom:c.YK.large,paddingLeft:"136px",paddingRight:"136px"}},actionsContainer:{display:"flex",flexDirection:"column-reverse",marginBottom:c.YK.medium,[e.breakpoints.up("md")]:{justifyContent:"center",flexDirection:"row","& > :first-child":{marginRight:e.isFlyingFlowers?c.YK.small:c.YK.medium,marginBottom:"initial"},marginBottom:c.YK.medium}},swapButton:{display:"flex",flexDirection:"column",marginBottom:c.YK.medium,[e.breakpoints.up("md")]:{justifyContent:"center",flexDirection:"row-reverse","& > :first-child":{marginLeft:c.YK.medium,marginBottom:"initial"}}},cancelButton:{"&.MuiButtonBase-root.MuiButton-root":{[e.breakpoints.down("xl")]:{paddingLeft:e.isFlyingFlowers?"19px !important":29,paddingRight:e.isFlyingFlowers?"22px !important":29}}},viewAllButton:{marginBottom:c.YK.small,[e.breakpoints.up("md")]:{marginBottom:"initial"}},mobileStyle:{marginBottom:c.YK.small,[e.breakpoints.up("md")]:Object.assign({},e.typographySpacing.none)},noProducts:{marginBottom:c.YK.xxl},singleProduct:{display:"flex",marginBottom:c.YK.medium,"& .MuiPaper-root":{padding:"initial"},"& .MuiCard-root":{width:"160px",margin:"0 auto",[e.breakpoints.up("md")]:{width:"248px"}},[e.breakpoints.up("md")]:{marginBottom:c.YK.large,paddingLeft:"136px",paddingRight:"136px"}},alertContent:{marginBottom:c.YK.medium,border:e.isFlyingFlowers?`2px solid ${c.ER.warning.base} !important`:`1px solid ${c.ZV.warning.dark} !important`,[e.breakpoints.up("md")]:{marginLeft:"136px",marginRight:"136px",marginBottom:c.YK.medium},"& .MuiIcon-root":{fontSize:"20px",color:e.isFlyingFlowers?c.ER.warning.base:c.ZV.warning.dark},"& > :first-child":{paddingTop:"3px"}},alertMessage:Object.assign(Object.assign({},e.typography.small_regular),{paddingTop:0}),buttonWidth:{width:"100%",[e.breakpoints.up("md")]:{width:e.isFlyingFlowers?"352px":"335px"}},productName:{},basketButtonSpace:{marginBottom:c.YK.large}}));var p=i(50212),g=i(86604),m=i(76481),y=i(53304),h=i(79973),b=i(81278),f=i(25559);let x=e=>{let{open:t,setOpen:i=()=>{},productName:u="",products:c,changeDeliveryDate:x,changeAddress:v,viewAllAvailableGifts:j,handleOnClose:S,totalProductsCount:k,handleBasketLineItem:w,isFromBasketUpdate:C,deliveryDate:I,isFromCartError:T=!1}=e,{isFlyingFlowers:A}=(0,r.useContext)(m.Z0),{classes:B}=d(),N=(0,n.A)(),R=!(0,s.Ub)({query:`(min-width: ${N.breakpoints.values.sm}px)`}),O=(0,s.Ub)({query:`(min-width: ${N.breakpoints.values.md}px)`}),_=(0,s.Ub)({query:`(min-width: ${N.breakpoints.values.lg}px)`}),[q,F]=(0,r.useState)(c),[P,D]=(0,r.useState)(),E=(0,s.Ub)({query:`(max-width: ${N.breakpoints.values.md}px)`}),K=(0,s.Ub)({query:`(min-width: ${N.breakpoints.values.md}px)`}),M=(0,b.useRouter)(),Y=R?k<=2:k<=3,$=e=>{w&&I&&w(e,I)};(0,r.useEffect)(()=>{let{device:e}=(0,m.ZM)(K,E);e&&D(e);let t=()=>{let{device:e}=(0,m.ZM)(K,E);e&&D(e)};return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}},[K,E,_,O]),(0,r.useEffect)(()=>{let e=c;!O&&(null==e?void 0:e.length)&&(e=e.slice(0,2));let t=null==e?void 0:e.some(e=>{var t;return!!(null==(t=e.images[0])?void 0:t.secondaryBadge)}),i=0;
1t&&P&&(null==e||e.forEach(e=>{var t,a,n;let r=null==(n=null==(a=null==(t=e.images[0])?void 0:t.secondaryBadge)?void 0:a.title)?void 0:n.split(" ").join("").length;r&&r>i&&(i=r)}),i=(0,m.hF)(P,i),e=null==e?void 0:e.map(e=>Object.assign(Object.assign({},e),{hasProductBadge:t,heightOfBadge:i}))),F(e)},[K,P,O,c,E]);let L=(0,a.jsxs)(a.Fragment,{children:[T?(0,a.jsx)(o.A,{title:"Go to basket",variant:(0,g.eM)("Go to basket"),thin:!0,onClick:()=>{M.push("/basket")},icon:A?"close":void 0,className:(0,p.A)(B.buttonWidth,B.cancelButton,B.mobileStyle)}):null,(0,a.jsx)(a.Fragment,{children:k?(0,a.jsxs)(a.Fragment,{children:[C?null:(0,a.jsx)(o.A,{title:"Cancel - Choose another date",variant:(0,g.eM)("Cancel - Choose another date"),thin:!0,onClick:x,icon:A?"close":void 0,className:(0,p.A)(B.buttonWidth,B.cancelButton)}),Y?null:(0,a.jsx)(o.A,{className:(0,p.A)(B.viewAllButton,C?"":B.buttonWidth),title:"View all available gifts",variant:(0,g.eM)("View all available gifts"),thin:!0,onClick:j,icon:A?"check":void 0})]}):!T&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(o.A,{title:"Change delivery address",variant:(0,g.eM)("Change delivery address"),thin:!0,onClick:v}),(0,a.jsx)(o.A,{className:B.viewAllButton,title:"Choose a different date",variant:(0,g.eM)("Choose a different date"),thin:!0,onClick:x})]})})]}),U="",W="";T?(W=f.yf.modalTitle,U=f.yf.productContent):(null==q?void 0:q.length)?A?(W=f.Kl.modalTitle,U=f.Kl.productContent.replace("${productName}",u)):(W=f.j_.modalTitle,U=f.j_.productContent.replace("${productName}
1",u)):(W=f.un.modalTitle,U=f.un.productContent);let V=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:(0,p.A)(B.content,(null==q?void 0:q.length)?"":B.noProducts,T?B.basketButtonSpace:""),dangerouslySetInnerHTML:{__html:U}}),C&&(null==q?void 0:q.length)?(0,a.jsx)(h.default,{type:"alertInfo",message:(0,a.jsxs)("div",{className:B.alertMessage,children:["Selecting one of the products below will remove the"," ",(0,a.jsx)("span",{className:B.productName,children:u})," from your basket."]}),className:B.alertContent}):null,(null==q?void 0:q.length)?(0,a.jsx)("div",{className:(0,p.A)(1===q.length?B.singleProduct:B.productGrid),children:null==q?void 0:q.map((e,t)=>(0,a.jsx)(y.Ay,{product:e,imageCarousel:!0,cardDisplayType:"SIMPLE",index:t,isFromBasket:C,handleBasketLineItem:$,isFromUnavailableSuggest:!0},`unavailable_suggestion_product_${e.sku}`))}):null,(0,a.jsx)("div",{className:B.actionsContainer,children:L})]});return(0,a.jsx)(l.A,{title:W,open:t,setOpen:i,maxWidth:_?"lg":"md",fullScreen:R,fullWidth:!0,className:B.modal,onClose:S,children:V})}},43244:(e,t,i)=>{i.d(t,{A:()=>h});var a=i(6029),n=i(55729),r=i(8078),s=i(84618),o=i(95645),l=i(27185),u=i(58259),c=i(21413),d=i(1917),p=i(72129),g=i(34337),m=i(76481);let y=(0,r.w)("MSN7PVPZHU","f037769b4af6584a8df5d03dd4837e16"),h=({children:e,indexName:t,initialUiState:i,isPreserveState:r=!0})=>{let o=`prd_${t}`.replace("prd_prd","prd"),{getCustomer:l}=(0,n.useContext)(m.Z0),u=(0,n.useRef)(null);return(0,a.jsxs)(s.G,{searchClient:y,indexName:o,initialUiState:{[o]:i},future:{preserveSharedStateOnUnmount:r},insights:!0,children:[(0,a.jsx)(w,{middlewareRef:u,getCustomer:l}),i&&(0,a.jsx)(b,{initialUiState:i}),e]})},b=e=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(j,{}),(0,a.jsx)(v,{sortBy:e.initialUiState.sortBy}),Object.keys(e.initialUiState?.refinementList??{}).map(e=>(0,a.jsx)(x,{attribute:e},e)),Object.entries(e.initialUiState?.numericMenu??{}).map(([e,t])=>(0,a.jsx)(f,{attribute:e,value:t},e))]}),f=({attribute:e,value:t})=>((0,o.w)({attribute:e,items:[{label:"",start:parseInt(t.split(":")[0]),end:parseInt(t.split(":")[1])}]}),null),x=({attribute:e})=>((0,l.J)({attribute:e}),null),v=({sortBy:e})=>((0,u.l)({items:[{value:e,label:""}]}),null),j=()=>((0,c.W)({}),null),S=[],k=new Set,w=({middlewareRef:e,getCustomer:t})=>{let{addMiddlewares:i}=(0,d.J)(),a=(0,n.useRef)(t);return(0,n.useEffect)(()=>{a.current=t},[t]),(0,n.useEffect)(()=>{try{e.current||void 0===globalThis.window||(e.current=(0,p.k)({insightsClient:g.Ay,onEvent:(e,t)=>{try{let i=`${e.insightsMethod}:${e.payload?.eventName}:${e.payload?.index}:${JSON.stringify(e.payload||"")}`;a.current&&a.current?.loading===!1&&a.current?.data?k.has(i)?console.log("Duplicate event detected, skipping:",i):(t("setAuthenticatedUserToken",a.current?.data?.customer?.id),k.add(i),t(e.insightsMethod,e.payload)):S.some(e=>e.key===i)?console.log("Event already queued, skipping:",i):(S.push({event:e,aaInstance:t,key:i}),console.log("Queued event:",e))}catch(e){console.error("Error in Algolia onEvent handler:",e)}}}),i(e.current))}catch(e){console.error("Error in AlgoliaMiddleware useEffect:",e)}},[i,e]),(0,n.useEffect)(()=>{try{a.current&&a.current?.loading===!1&&a.current?.data&&S.length>0&&(S.forEach(({event:e,key:t})=>{try{if(k.has(t))return void console.log("Duplicate event on flush, skipping:",t);(0,g.Ay)("setAuthenticatedUserToken",a.current?.data?.customer?.id),(0,g.Ay)(e.insightsMethod,e.payload),k.add(t)}catch(e){console.error("Error flushing Algolia event:",e)}}),S.length=0)}catch(e){console.error("Error in Algolia flush useEffect:",e)}},[t?.loading,t?.data]),null}},78166:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Y});var a=i(6029),n=i(55729),r=i(81278),s=i(83431),o=i(8151),l=i(83778),u=i(50350),c=i(43244),d=i(30620),p=i(29958),g=i(19834),m=i(58952),y=i(1917),h=i(34775),b=i(48555),f=i(58975),x=i(34337),v=i(76481);(0,x.Ay)("init",{appId:"MSN7PVPZHU",apiKey:"f037769b4af6584a8df5d03dd4837e16",useCookie:!0});let j=e=>{let{queryType:t,activeSearchTab:i,sortConfig:s,setTotalProductsCount:o,facetDetails:l,spotlightBanner:u,scrollTo:c,showRecommendedFacetsInSearch:j}=e,S=(0,r.useRouter)(),{shorthand:k}=(0,n.useContext)(v.Z0),{items:w,results:C}=(0,m.q)(),{indexUiState:I,status:T}=(0,y.J)(),{index:A,hitsPerPage:B,page:N,offset:R,length:O}=C,_=JSON.stringify(I.refinementList||{}),q=JSON.stringify(I.numericMenu||{}
1),F=B||O+R,P=(0,n.useContext)(h.A),[D,E]=(0,n.useState)(!1),[K,M]=(0,n.useState)(!1),[Y,$]=(0,n.useState)(!1),[L,U]=(0,n.useState)(1),[W,V]=(0,n.useState)({}),Z="idle"===T&&!!I.configure,G=w.map(e=>e.key).join(","),z=(0,n.useMemo)(()=>w.map(e=>({...e.data,objectId:e.objectID,position:e.__position,queryId:e.__queryID,queryType:t,indexName:A})).filter(Boolean),[G,t,A]);(0,n.useEffect)(()=>{z?.length>=0&&o(C?.nbHits)},[z?.length,C?.nbHits,o]),(0,n.useEffect)(()=>{Z&&!D&&(z?.length===0?(P?.pccPath?.("no_products_available"),"GuidedNav"===t&&M(!0)):P?.pccPath?.("products_available"),E(!0))},[Z]);let J=(0,n.useRef)({});(0,n.useEffect)(()=>{J.current={isFromPLP:!0,activeSearchTab:i,sortBy:A,sessionCurrentPageNo:N,sessionCurrentPageSize:F,sessionRefinementList:_,sessionNumericMenu:q,sessionQuery:(0,b.l)(S.query)}},[i,A,q,N,F,_,S.query]);let H=(0,n.useCallback)((e,t,i,a)=>{sessionStorage.setItem("productScrollIntoView",e),Object.entries(J.current).filter(e=>!!e[1]).forEach(([e,t])=>{sessionStorage.setItem(e,t.toString())});let n=parseInt(a);(0,x.Ay)("clickedObjectIDsAfterSearch",{eventName:"Product Clicked",index:`prd_product_${k}`,queryID:t,objectIDs:[i],positions:[n]}),(0,x.Ay)("convertedObjectIDsAfterSearch",{eventName:"IF Product Converted",index:`prd_product_${k}`,queryID:t,objectIDs:[i]})},[]),Q=(0,n.useCallback)(e=>{P?.favouritingProductItem(e)},[P]),X=(0,n.useRef)(!1),ee=(0,n.useCallback)(()=>{let e=sessionStorage.getItem("guidedNavigationValues");if(!e)return{};let t=JSON.parse(e);return{...t,date:t.date?(0,f.A)(t.date):null}},[]),et=(0,n.useCallback)(()=>{M(!1),U(2),V(ee()),$(!0)},[ee]),ei=(0,n.useCallback)(()=>{M(!1),U(1),V(ee()),$(!0)},[ee]);return(0,n.useEffect)(()=>{!X.current&&c&&z&&setTimeout(()=>{let e=document.getElementById(c);e?e.scrollIntoView():window.scrollTo(0,0),X.current=!0},500)},[z,c]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.A,{products:z,sortConfig:s,facetDetails:l,spotlightBanner:u,onProductClick:H,show:"Inspiration"!==i,sendFavouritingProductAnalytics:Q,showRecommendedFacetsInSearch:j,activeSearchTab:i,isFromSearchResultsPage:!0}),(0,a.jsx)(p.A,{open:K,handleOnClose:()=>M(!1),setOpen:M,totalProductsCount:0,changeAddress:et,changeDeliveryDate:ei}),(0,a.jsx)(g.default,{isOpenControlled:Y,setOpenControlled:$,initialStep:L,initialInfo:W})]})};var S=i(25765);let k=e=>{let{queryType:t,activeSearchTab:i,defaultIndexInspiration:r,setTotalInspirationsCount:s}=e,{items:o,results:l}=(0,m.q)(),u=l?.nbHits,[c,d]=(0,n.useState)([]);return(0,n.useEffect)(()=>{let e=o||[];e?.length>=0&&(s(u),d(e.map(e=>({...e.data,objectId:e.objectID,position:e.__position,queryId:e.__queryID,queryType:t,indexName:r})).filter(Boolean)))},[r,s,o,u,t]),(0,a.jsx)(S.A,{items:c,isInspiration:!0,show:"Inspiration"===i})};var w=i(80575),C=i(13939);let I={paddingTop:C.YK.xs,paddingBottom:C.YK.xs,paddingLeft:C.YK.small,paddingRight:C.YK.small},T=(0,w.n9)()(e=>({tabLabel:Object.assign(Object.assign({},e.typography.xxs_regular),{[e.breakpoints.up("sm")]:Object.assign({},e.typography.small_regular)}),tab:Object.assign(Object.assign({width:"fit-content",background:C.Tj.grey.grey2,color:e.isFlyingFlowers?C.Tj.grey.grey6:C.Tj.black[700]},I),{textWrap:"nowrap",borderRadius:e.isFlyingFlowers?C.YK.xs:0}),activeTab:{background:e.isFlyingFlowers?C.Tj.lazyLime[300]:C.Tj.primary.gold1}}));var A=i(50212);let B=e=>{let{label:t,count:i,isSelected:n=!1}=e,{classes:r}=T();return t?(0,a.jsx)("div",{className:(0,A.A)(r.tab,n&&r.activeTab),children:(0,a.jsxs)("div",{className:r.tabLabel,children:[t," (",i,")"]})}):(0,a.jsx)(a.Fragment,{})},N=(0,w.n9)()(e=>({tabContainer:{display:"flex",width:"100%",flexWrap:"wrap",marginBottom:C.YK.large,[e.breakpoints.up("sm")]:{marginBottom:C.YK.xxl},"& li:not(:last-child)":{marginRight:C.YK.small}},inspirationView:{[e.breakpoints.up("sm")]:{marginBottom:"78px"}},buttonCursor:{cursor:"pointer"},totalResults:Object.assign(Object.assign({},e.typography.small_bold),{color:e.isFlyingFlowers?C.Tj.black[700]:void 0,textWrap:"nowrap",marginBottom:C.YK.large,[e.breakpoints.up("sm")]:Object.assign(Object.assign(Object.assign({},e.typography.large_bold),e.typographySpacing.none),{whiteSpace:"nowrap",marginBottom:0,paddingTop:"4px"})}),tabsResultContainer:{display:"flex",flexDirection:"column",alignItems:"center",[e.breakpoints.up("sm")]:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start"}}}
1));var R=i(73312);let O=({updateActiveSearchTab:e,totalProductsCount:t,totalInspirationsCount:i,activeSearchTab:r})=>{let{classes:s}=N(),{isFlyingFlowers:o}=(0,n.useContext)(v.Z0),l=o?"Gifts":"Products",{nbHits:u}=(0,R.h)(),c=[{label:l,isSelected:r===l,count:t},{label:"Inspiration",isSelected:"Inspiration"===r,count:i}],[d,p]=(0,n.useState)(c);return(0,n.useEffect)(()=>{p(e=>e.map(e=>e.label===l?Object.assign(Object.assign({},e),{count:t,isSelected:r===l}):Object.assign(Object.assign({},e),{count:i,isSelected:"Inspiration"===r})))},[t,i,r,l]),(0,n.useEffect)(()=>{let a=u.some(e=>""===e.query);if(!(u.length<2)&&!a){if("Inspiration"===r)return void sessionStorage.removeItem("activeSearchTab");t>0?e(l):0===t&&i>0&&e("Inspiration")}},[t,i,e,l,u,r]),(0,a.jsxs)("div",{className:s.tabsResultContainer,children:[(0,a.jsx)("ul",{className:(0,A.A)(s.tabContainer,"Inspiration"===r?s.inspirationView:""),children:d.filter(e=>e.label===l&&t>0||"Inspiration"===e.label&&i>0).map(t=>(0,a.jsx)("li",{children:(0,a.jsx)("button",{className:s.buttonCursor,onClick:()=>e(t.label),children:(0,a.jsx)(B,Object.assign({},t))})},t.label))},d.map(e=>e.label).join("-")),"Inspiration"===r&&0!==i&&(0,a.jsxs)("div",{className:s.totalResults,children:[i," items"]})]})};var _=i(84912),q=i(80920),F=i(10911),P=i(91202),D=i(42246);let E=["isFromPDP","loadAll","productScrollIntoView","sessionCurrentPageSize","sessionFilters","sessionNumericMenu","sessionQuery","sessionRefinementList","sortBy","activeSearchTab"],K={occasions:[],filters:"",query:"",pageSize:12,initialUiState:{},scrollTo:"",key:""},M=(e,t)=>{let{shorthand:i}=(0,n.useContext)(v.Z0),a=e?"inspiration":"product";return t?`prd_${a}_intl_${i}`:`prd_${a}_${i}`},Y=e=>{let{meta:t,uiType:i,spotlightBanner:d,showRecommendedFacetsInSearch:p}=e,g=(0,r.useRouter)(),m=(0,n.useRef)(""),y=(0,n.useRef)(""),b=(0,n.useRef)(""),f=(0,n.useRef)(""),x=(0,n.useRef)(""),S=(0,n.useRef)(""),w=(0,n.useRef)(""),C=(0,l.A_)(u.Mj),[I,T]=(0,n.use
1State)(null),{isFlyingFlowers:A}=(0,n.useContext)(v.Z0),B=A?"Gifts":"Products",[N,R]=(0,n.useState)(B),[Y,$]=(0,n.useState)(0),[L,U]=(0,n.useState)(0),{isOverseas:W}=g.query,V="true"===W,Z=(0,D.A)(),G=!(0,P.Ub)({query:`(min-width: ${Z.breakpoints.values.sm}px)`}),z=M(!1,V),J=M(!0,V),H=(0,n.useContext)(h.A),Q=(e=>{let t=new URLSearchParams;for(let[i,a]of Object.entries(e))if(null!=a)if(Array.isArray(a))for(let e of a)t.append(i,String(e));else t.append(i,String(a));return t.toString()})(g.query),X=(0,n.useCallback)(async()=>{let{date:e,city:t,county:i,postalCode:a,occasion:n,isSameDay:r,addressLine2:o=""}=g.query,l=e&&(0,v.pv)(e.toString());if(i||t){try{let e=await C({input:{deliveryDate:(0,s.A)(l,"yyyy-MM-dd"),city:t,county:i,postalCode:a,addressLine2:o,occasion:n,overseasCountry:!A&&V}}),u=e.data.giftFinderRotations.rotations.map(e=>`rotation:${e.rotation}`).join(" OR ")||"rotation:null",c=e.data.giftFinderRotations.rotations.flatMap(e=>e.specialIndicators).map(e=>`specialIndicator:${e}`).join(" OR "),d=l?`daysAvailable:${(0,s.A)(l,"EEEE")}`:"",p=new Date(l.toString()).getTime(),g=`deliveryFromTimeStamp <= ${p}`,m=`deliveryToTimeStamp >= ${p}`,y=l?new Date(l.toString()).getTime():"",h=[`phaseOutDateRangeTimeStamp != ${y}`],b=[`unavailableDateRangeTimeStamp != ${y}`],f=n?[n]:["PCC Other"],x="("+[u,c,d,"true"===r?"sameDay:true":"",g,m,h,b,"NOT isAlternativeProduct:true"].filter(Boolean).join(") AND (")+")";return{...K,initialUiState:{refinementList:{occasions:f}},occasions:f,queryType:"GuidedNav",filters:x,key:Q}}catch(e){console.log(`There was an issue retrieving rotations: ${e}`)}return null}},[C,g.query,Q]),ee=(0,n.useCallback)(async()=>{let{date:e,occasion:t,city:i,county:a,postalCode:n,addressLine2:r}=g.query;return e&&m.current!==e||t&&y.current!==t||i&&f.current!==i||a&&x.current!==a||n&&b.current!==n||r&&w.current!==r?(m.current=e,y.current=t,f.current=i,x.current=a,b.current=n,w.current=r,await X()):null},[X,g.query]),et=(0,n.useCallback)(async()=>{let{date:e,occasion:t,city:i,county:a,postalCode:n,addressLine2:r}=g.query;if(e||t||i||a||n||r)return S.current="",await ee();if(g.query.query&&S.current!==g.query.query){S.current=g.query.query,m.current="",y.current="",f.current="",x.current="",b.current="",w.current="";let e=sessionStorage?.getItem("activeSearchTab")||B;return e&&R(e),{...K,queryType:"Search",query:g.query.query.toString(),filters:"NOT isAlternativeProduct:true",key:Q}}return null},[B,Q,g.query,ee]),ei=(0,n.useMemo)(()=>[{value:`${z}`,label:"Recommended"},{value:`${z}_price_asc`,label:"Price low - high"},{value:`${z}_price_desc`,label:"Price high - low"}],[z]),ea={GuidedNav:["giftchecker"],Search:["search"]}[I?.queryType]||void 0,en=(0,n.useRef)(!0);(0,n.useEffect)(()=>{!async function(){let e=g.isReady?await et():null;if(en.current&&g.isReady){if(en.current=!1,Q===sessionStorage?.getItem("sessionQuery")){let t=g.query.occasion?.toString(),i=Number.parseInt(sessionStorage?.getItem("sessionCurrentPageSize")),a=sessionStorage?.getItem("sessionRefinementList"),n=sessionStorage?.getItem("sessionNumericMenu"),r=sessionStorage?.getItem("sortBy"),s=sessionStorage?.getItem("productScrollIntoView"),o=i||12,l=a&&JSON.parse(a)||(t?{occasions:[t]}:void 0),u=n&&JSON.parse(n)||void 0,c={...r&&{sortBy:r},...l&&{refinementList:l},...u&&{numericMenu:u}};T(()=>({...e,initialUiState:c,pageSize:o,scrollTo:s}))}else e&&T(e);(0,v.fD)(E)}else e&&T(e)}()},[z,g.isReady,g.query,et,Q]);let er=(0,n.useCallback)((e,t)=>{"sortBy"==e?H.facetSortBy(t):H.facetFilters(e,t)},[H]);return(0,q.D)(e),(0,a.jsx)(a.Fragment,{children:I&&(0,a.jsxs)(a.Fragment,{children:[I?.queryType==="Search"&&(0,a.jsx)(O,{activeSearchTab:N,updateActiveSearchTab:R,totalProductsCount:Y,totalInspirationsCount:L}),(0,a.jsxs)(c.A,{indexName:z,initialUiState:I.initialUiState,children:[(0,a.jsx)(F.A,{}),(0,a.jsx)(o.Z,{clickAnalytics:!0,distinct:!0,filters:I.filters||"",hitsPerPage:I.pageSize,ruleContexts:ea,query:I.query??void 0,analyticsTags:[I?.queryType.toLowerCase()==="search"?"search":"postcode-checker",G?"mobile":"desktop"]}),(0,a.jsx)(_.l,{length:I.pageSize,setLength:e=>T(t=>({...t,pageSize:e})),children:(0,a.jsx)(j,{componentId:t.deliveryId,componentType:i,sortConfig:ei,queryType:I.queryType,activeSearchTab:N,defaultIndexName:z,setTotalProductsCount:$,spotlightBanner:d,facetDetails:er,scrollTo:I.scrollTo,showRecommendedFacetsInSearch:p})})]},I.key),I?.queryType==="Search"&&(0,a.jsxs)(c.A,{indexName:J,children:[(0,a.jsx)(F.A,{}),(0,a.jsx)(o.Z,{clickAnalytics:!0,hitsPerPage:12,distinct:!0,filters:I.filters||"",ruleContexts:ea,query:I.query??void 0,analyticsTags:[G?"mobile":"desktop"]}),(0,a.jsx)(k,{componentId:t.deliveryId,componentType:i,sortConfig:ei,queryType:I.queryType,activeSearchTab:N,defaultIndexInspiration:J,setTotalInspirationsCount:U})]})]})})}}}]);

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.