1import{db as $,q as G,E as a,dc as O,bw as A,D,j as t,w as n,d as N,r as p,k as U,b as w,aw as z,bZ as J,dd as F,ax as Q,f as M,au as V,a as Y,L as _}from"../index-Cd7uS7_0.js";import{a as H}from"./contentTypes-kfwh_edF.js";import{q as Z,S as K,A as X}from"./AlgoliaSearchWrapper-JnDP5Q82.js";import{M as ee}from"./MainTitle-feMSkQSK.js";import{I as te,F as re}from"./InfiniteSearchResults-Dzpk-S0a.js";import oe from"./index-Bt1rYN5e.js";import{M as x}from"./MenuItemPresenter-Do0C32p5.js";import{P as ne}from"./Placeholder-CvjQT_U6.js";import"./useGtm-Bs3NyBCU.js";import"./RadioGroup-B9T58RA-.js";import"./formControlState-Dq1zat_P.js";import"./useFormControl-Hr7dsUo2.js";import"./SwitchBase-DXHiuV_4.js";import"./StarringYou-boKCPyqz.js";import"./useAlgoliaEvents-CjwESzRT.js";import"./StraightUpPresenter-D0r0p0EE.js";import"./LazyLoad-G98MJZer.js";import"./composeClasses-RkmlhA83.js";import"./ImageOnLoad-CdeXzQ6J.js";import"./Skeleton-BY0GL8RX.js";const ae=()=>{const{loadModuleMenu:e}=$(),{moduleMenu:r}=G(o=>o.ModuleMenuSlice);return{moduleMenu:r,loadModuleMenu:e}},ie=a("div")(({theme:e})=>({padding:"0 16px",[e.breakpoints.up("mobile")]:{marginTop:27},[e.breakpoints.up("tablet")]:{marginTop:30}})),se=a("div")(({theme:e})=>({height:68,display:"flex",justifyContent:"end",position:"relative",[e.breakpoints.up("mobile")]:{position:"absolute",right:14,top:20},[e.breakpoints.up("tablet")]:{position:"absolute",top:25,right:24}})),le=a("button")(({theme:e})=>({fontSize:e.typography.pxToRem(16),fontWeight:500,color:e.palette.text.primary,background:"none",border:"none",padding:0,cursor:"pointer",transition:"all 0.2s ease-in-out","&:hover":{color:e.palette.primary.main},[e.breakpoints.up("mobile")]:{fontSize:e.typography.pxToRem(20)}})),C=a("div")(({theme:e})=>({maxWidth:338,margin:"0 auto",[e.breakpoints.up("mobile")]:{width:506,maxWidth:"none"},[e.breakpoints.up("tablet")]:{width:632,maxWidth:"none"}})),q=a("div")(({theme:e})=>({display:"grid",gridTemplateColumns:"1fr 1fr",gridColumnGap:13,gridRowGap:18,[e.breakpoints.up("mobile")]:{gridColumnGap:20,gridRowGap:27},[e.breakpoints.up("tablet")]:{gridColumnGap:24,gridRowGap:35}})),pe=a("button")(({theme:e})=>({height:33,borderRadius:16.5,fontSize:e.typography.pxToRem(12),fontFamily:"Inter",fontWeight:500,textTransform:"none",transition:"transform 0.6s cubic-bezier(0.22, 1, 0.36, 1)",color:e.palette.primary.main,background:"none",border:"none",padding:0,cursor:"pointer",[e.breakpoints.up("mobile")]:{height:50,borderRadius:25,fontSize:e.typography.pxToRem(22.5)},[e.breakpoints.up("tablet")]:{height:62,borderRadius:31,fontSize:e.typography.pxToRem(28),"&:hover":{transform:"scale(1.1)"}},"&:nth-of-type(8n + 1)":{backgroundColor:e.palette.searchTerms.yellow},"&:nth-of-type(8n + 2)":{backgroundColor:e.palette.searchTerms.blue},"&:nth-of-type(8n + 3)":{backgroundColor:e.palette.searchTerms.green},"&:nth-of-type(8n + 4)":{backgroundColor:e.palette.searchTerms.pink},"&:nth-of-type(8n + 5)":{backgroundColor:e.palette.searchTerms.red},"&:nth-of-type(8n + 6)":{backgroundColor:e.palette.searchTerms.yellow},"&:nth-of-type(8n + 7)":{backgroundColor:e.palette.searchTerms.violin},"&:nth-of-type(8n)":{backgroundColor:e.palette.searchTerms.orange}})),ce=a("div")(({theme:e})=>({position:"relative",marginBottom:20,[e.breakpoints.up("mobile")]:{marginTop:13,marginBottom:30},[e.breakpoints.up("tablet")]:{marginTop:16,marginBottom:38}})),ue=a(O)(({theme:e})=>({position:"absolute",left:14,top:"50%",transform:"translateY(-50%)",fontSize:e.typography.pxToRem(24),[e.breakpoints.up("mobile")]:{fontSize:e.typography.pxToRem(30),left:24},[e.breakpoints.up("tablet")]:{fontSize:e.typography.pxToRem(38),left:30}})),de=a("input")(({theme:e})=>({backgroundClip:"padding-box",width:"100%",height:40,borderRadius:20,borderWidth:2,borderStyle:"solid",borderColor:A(e.palette.primary.main,.15),padding:"0 53px 0 53px",fontSize:e.typography.pxToRem(17),caretColor:e.palette.secondary.main,color:e.palette.text.primary,"&:focus":{outline:"none"},[e.breakpoints.up("mobile")]:{height:60,borderRadius:30,borderWidth:3,fontSize:e.typography.pxToRem(26),paddingLeft:80},[e.breakpoints.up("tablet")]:{height:75,borderRadius:37.5,borderWidth:4,fontSize:e.typography.pxToRem(32),paddingLeft:100}})),he=a("button")(({theme:e})=>({position:"absolute",right:0,top:"50%",padding:12,transform:"translateY(-50%)",background:"none",border:"none",cursor:"pointer",transition:"all 0.2s ease-in-out","&:hover":{opacity:.7},[e.breakpoints.up("mobile")]:{right:6},[e.breakpoints.up("tablet")]:{right:12}})),ge=a(D)(({theme:e})=>({backgroundColor:"#F2F2F2",borderRadius:"100%",padding:5,fontSize:e.typography.pxToRem(20),color:e.palette.text.primary,display:"flex",alignItems:"center",justifyContent:"center",transition:"all 0.2s ease-in-out","&:hover":{color:e.palette.primary.main},[e.breakpoints.up("mobile")]:{fontSize:e.typography.pxToRem(24)},[e.breakpoints.up("tablet")]:{fontSize:e.typography.pxToRem(28)}})),v=({handleDialogClose:e})=>t.jsx(se,{children:t.jsx(le,{color:"inherit","aria-label":"close",onClick:e,size:"large",children:"Done"})});v.propTypes={handleDialogClose:n.func.isRequired};const B=({searchTerm:e,handleOnChange:r,handleReset:o})=>t.jsx(C,{children:t.jsxs(ce,{children:[t.jsx(ue,{fontSize:"large"}
1),t.jsx(de,{type:"text",value:e,onChange:r,placeholder:"Search",autoFocus:!0}),t.jsx(he,{color:"inherit","aria-label":"close",onClick:o,size:"large",children:t.jsx(ge,{fontSize:"inherit"})})]})});B.propTypes={searchTerm:n.string.isRequired,handleOnChange:n.func.isRequired,handleReset:n.func.isRequired};const I=({menuItem:e,onSearchTermClick:r})=>t.jsx(pe,{onClick:()=>r(x.linkTo(e)),type:"button",children:x.linkText(e)},x.name(e));I.propTypes={menuItem:x.shape(),onSearchTermClick:n.func};const me=a(ne)(({theme:e})=>({height:33,borderRadius:"16.5px",[e.breakpoints.up("mobile")]:{height:50,borderRadius:"25px"},[e.breakpoints.up("tablet")]:{height:62,borderRadius:"31px"}})),fe=Array.from({length:8}),be=()=>t.jsx(C,{"data-testid":"SearchTermsSkeleton",children:t.jsx(q,{children:fe.map((e,r)=>t.jsx(me,{variant:"rounded",width:"100%"},r))})}),P=({onSearchTermClick:e})=>{const{loadModuleMenu:r,moduleMenu:o}=ae(),{func:d,isFinished:h}=N(r);return p.useEffect(()=>{d("search-pills").catch(c=>{U.logError(`SearchTerms.jsx - loadModuleMenuWithLoader() - Error: Could not load module menu: ${c}`)})},[]),!h||!o?t.jsx(be,{}):t.jsx(C,{children:t.jsx(q,{children:o?.menuItems?.map((c,i)=>t.jsx(I,{menuItem:c,onSearchTermClick:e},`${x.name(c)}-${i}`))})})};P.propTypes={onSearchTermClick:n.func.isRequired};const ye=a(Q)(({theme:e})=>({marginBottom:"20px",[e.breakpoints.up("mobile")]:{marginBottom:"40px"}})),W=p.memo(({initialUiState:e,searchTerm:r,setSearchTerm:o,defaultFilters:d,defaultSortBy:h})=>{const{location:c,history:i}=w(),{clearAllFiltersByPath:u}=z(),g=p.useRef(!0),{setIndexUiState:m}=Z(),S=p.useRef(null),k=s=>{const l=F.parse(c.search,{ignoreQueryPrefix:!0});s?l.term=s:delete l.term;const j=Object.keys(l).length?`?${F.stringify(l)}`:"",L=`${window.location.pathname}${j}`;window.history.replaceState({},"",decodeURIComponent(L))},R=()=>{g.current?i.goBack():i.replace(M.rootPath())},f=()=>{u({path:M.searchPath()}),o(""),m(()=>({...e,configure:{...e.configure,facetFilters:d},sortBy:h,query:"",page:0}))},T=()=>{R(),f()},b=s=>{const{value:l}=s.target;o(l),m(j=>({...j,query:l,page:0}))},y=()=>{S.current.resetFilters(),f()},E=s=>{o(s),m(l=>({...l,query:s,page:0}))};return p.useEffect(()=>{k(r)},[r]),p.useEffect(()=>{i.length<=1&&(g.current=!1);const s=i.listen(()=>{i.length<=1?g.current=!1:g.current=!0});return()=>s()},[i]),t.jsx(t.Fragment,{children:t.jsx(J,{fullScreen:!0,open:!0,children:t.jsx(ie,{children:t.jsx(K,{headerSlot:t.jsx(v,{handleDialogClose:T}),inputSlot:t.jsx(B,{searchTerm:r,handleOnChange:b,handleReset:y}),filtersSlot:t.jsx(ye,{children:t.jsx(re,{ref:S,hidden:!r,configure:e?.configure})}),emptySearchSlot:t.jsx(P,{onSearchTermClick:E}),searchResultsSkeletonSlot:t.jsx(oe,{}),resultsSlot:te,initialQueryObject:e,isSearch:!0})})})})});W.propTypes={initialUiState:n.shape({configure:n.shape({})}).isRequired,searchTerm:n.string.isRequired,setSearchTerm:n.func.isRequired,defaultFilters:n.arrayOf(n.arrayOf(n.string)).isRequired,defaultSortBy:n.string.isRequired};const Ge=()=>{const{query:{term:e},location:r}=w(),{settings:{algolia:o}}=V(),{currentUserLoaded:d}=Y(),{createInitialUiStateFromSingle:h,filterValues:c,hasFacetFilterValues:i}=z(),[u,g]=p.useState(e||""),m=`Search results for personalized ${u} eCards from JibJab.`,{contentTypeFiltersForPath:S,numberOfPeopleFiltersForPath:k,sortFilterSelectedForPath:R}=c(r.pathname),f=p.useMemo(()=>[H.flatMap(y=>y.value)],[]),T=i(r.pathname),b=p.useMemo(()=>{if(!d)return;const y=T?[...S,...k]:f;return h(o.indexName,{query:{query:u,facetFilters:y},sortBy:R})},[d,h]);return t.jsxs(t.Fragment,{children:[b?t.jsx(X,{proxy:!1,context:"search",initialUiState:b,children:t.jsx(W,{initialUiState:b[o.indexName],searchTerm:u,setSearchTerm:g,defaultFilters:f,defaultSortBy:o.indexName})}):null,t.jsx(ee,{title:`Funny eCards - Send Custom Greeting Cards Online w/ JibJab! - ${u} eCard Search Results`}),t.jsxs(_,{children:[t.jsx("meta",{name:"robots",content:"noindex"}),t.jsx("meta",{name:"keywords",content:`${u}, eCards, funny, search`}),t.jsx("meta",{name:"description",content:m}),t.jsx("meta",{name:"og:title",content:`${u} eCard Search Results`}),t.jsx("meta",{name:"og:description",content:m})]})]})};export{Ge as default};
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.