import{u as C,R as e,B as h,F as r,H as F,T as d,r as s,L as A,I as _,j as H,s as I,m as P,i as B,S as L}from"./index-BZu1nCCi.js";import{A as z}from"./AllAlert-B0bHW0sX.js";import{M as N}from"./Metadata-wnpQSZ9h.js";import{n as y,o as O,q as $,r as G,s as M,t as W,W as U,v as J,P as q,w as T,R as V,x as Y,T as Q,S as K,k as X,b as Z,y as ee}from"./BlockContainer-De7fb_Yp.js";import{L as te,A as ne}from"./AdBanner-CefS1ze_.js";import"./Helmet-CczeUPFm.js";import"./index.esm-fjVsHvrh.js";function re(t){const{data:n}=t,a=C();return e.createElement(h,{as:r,flexDirection:"column",justifyContent:"center",alignContent:"center",backgroundColor:"#4D4D4D",h:"255px",wrap:"wrap"},e.createElement(h,{my:10,mx:{lg:60,md:20,base:5},as:r,flexDirection:"column",justifyContent:"center",alignContent:"center",textAlign:"center",maxW:"826px"},e.createElement(F,{as:"h1",fontWeight:"700",fontSize:{base:"25px",md:"32px",lg:"40px"},lineHeight:{base:"74px",md:"74px",lg:"74px"},color:a.colors.White},n==null?void 0:n.headline),e.createElement(d,{fontWeight:"400",fontSize:{base:"16px",md:"20px",lg:"22px"},lineHeight:{base:"22px",md:"27px",lg:"30px"},color:a.colors.White},n==null?void 0:n.sub_text)))}const D=t=>{if(isNaN(t))return;const n={Jan:"Jan.",Feb:"Feb.",Mar:"March",Apr:"April",May:"May",Jun:"June",Jul:"July",Aug:"Aug.",Sep:"Sept.",Oct:"Oct.",Nov:"Nov.",Dec:"Dec."},a=(()=>{const o=new Date(t*1e3);return o.getFullYear()>1e4?new Date(t):o})().toUTCString().split(" ");return a.length>3?`${a[1]-0} ${n[a[2]]} ${a[3]}`:a.join(" ")},ae=({result:t})=>{var l;const[n,a]=s.useState(),o=C();return s.useEffect(()=>{t&&a(D(t.published_dtm))},[t]),t?e.createElement(r,{key:t.objectID,as:A,href:t.uri,border:`solid 1px ${o.colors.Grey70}`,p:"8px",justify:"space-between",borderRadius:"24px",w:{base:"100%",lg:"48.5%"},_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:"16px"},e.createElement(r,{direction:"column",gap:"8px",flex:1,m:"8px",justify:"center",textOverflow:"ellipsis"},e.createElement(r,{direction:"row",gap:"8px",flexWrap:"wrap"},t.category==="news_article"&&e.createElement(h,{color:o.colors.Green130,borderColor:o.colors.Green130,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(d,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL")),((l=t.tags)==null?void 0:l.includes("internal_class=analysis"))&&e.createElement(h,{color:`${o.colors.Blue130}`,borderColor:`${o.colors.Blue130}`,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"12px"},e.createElement(d,{letterSpacing:"3.5%",fontWeight:"600",fontSize:"14px",lineHeight:"1.188rem",fontFamily:"Open Sans, semi-bold"},"ANALYSIS"))),e.createElement(d,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},n),e.createElement(r,{textOverflow:"ellipsis"},e.createElement(d,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:3},t.name))),e.createElement(r,{h:"auto",flex:1,maxWidth:{lg:"160px",md:"160px",sm:"130px",base:"160px"}},t.category==="news_article"&&e.createElement(_,{alt:t.name,src:t.imageUri,fallbackSrc:y,fit:"cover",borderRadius:"0 16px 16px 0"}),t.category==="news_blurb"&&e.createElement(_,{alt:t.name,src:t.imageUri,fallbackSrc:y,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},oe=({result:t})=>{const{published_dtm:n}=t||{},a=s.useMemo(()=>D(n),[n]),{gated:o,type:l,original:c}=s.useMemo(()=>{const p=u=>(t.tags||[]).includes(u);return{gated:p("internal_class=member_gated"),type:p("internal_class=resource_article")?"Resource Article":void 0,original:p("internal_class=iapp_original")}},[t==null?void 0:t.tags]),m=C(),[x]=O(l);return t?e.createElement(r,{key:t.objectID,as:A,href:t.uri,border:`solid 1px ${m.colors.Grey30}`,p:"8px",justify:"space-between",borderRadius:"20px",w:{base:"100%",lg:"48.5%"},h:"174px",_hover:{textDecor:"none",boxShadow:"0px 24px 34px 0px rgba(0,0,0,0.07)"},role:"group",mb:{base:"20px",md:"16px",lg:"2%"},position:"relative"},o&&e.createElement(r,{position:"absolute",boxSize:"35px",justify:"center",align:"center",right:"8px",bgColor:"WhiteOpaque"},e.createElement(H,{faIcon:"fa-lock",color:"PrimaryGreen"})),e.createElement(r,{direction:"column",gap:"16px",flex:1,m:"8px",justify:"start"},e.createElement(r,{gap:".02em",flexWrap:"wrap",whiteSpace:"nowrap"},l&&e.createElement(r,{gap:"10px",mr:"10px",ml:"-16px",align:"center"},e.createElement(h,{w:"15px",h:"24px",bgColor:x}),e.createElement(d,{fontFamily:"Lato",fontWeight:"700",fontSize:".875rem",lineHeight:"1.05rem"},l)),c&&e.createElement(r,{whiteSpace:"nowrap",flex:1,maxW:"min-content",color:m.colors.Green130,borderColor:m.colors.Green130,border:"solid 1px",w:"max-content",borderRadius:"20px",textAlign:"center",px:"16px"},e.createElement(d,{letterSpacing:".035em",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem"},"IAPP ORIGINAL"))),a&&e.createElement(d,{color:"#4D4D4D",fontWeight:"600",fontSize:".875rem",lineHeight:"1.188rem",letterSpacing:".08em"},a),e.createElement(d,{fontWeight:"600",fontSize:"1rem",lineHeight:"1.688rem",_groupHover:{textDecor:"underline"},noOfLines:a?2:3,textOverflow:"ellipsis"},t.name)),e.createElement(r,{h:"100%",flex:.75,maxW:"25%",borderRadius:"0 15px 15px 0"},t.category==="news_article"&&e.createElement(_,{src:t.imageUri,fallbackSrc:y,fit:"cover",borderRadius:"0 15px 15px 0"}))):null},ie=()=>(s.useEffect(()=>{document.querySelectorAll(".rc-pagination-item").forEach(n=>{n.setAttribute("title","")})}),null),le=({ct:t})=>e.createElement(r,{gap:{md:"2.5%"},w:"100%",className:"non-overview-container"},t==="news_overview"&&e.createElement(r,{maxW:{base:"100%",md:"29%",lg:"22.5%"},flex:{base:0,md:1}}),e.createElement(T,null)),ce=({ct:t,tags:n,setTags:a,filters:o})=>t=="news_overview"||!o?e.createElement(e.Fragment,null):e.createElement(r,{display:{base:"none",md:"flex"},w:"100%",className:"non-overview-container"},e.createElement(W,{type:"entity",ct:t,tags:n,setTags:a,filters:o})),se=({cta:t,ct:n})=>n!=="news_overview"?e.createElement(e.Fragment,null):e.createElement(r,{border:t?"solid 1px #999999":"none",borderRadius:"20px",py:"27px",px:{base:"22px",lg:"38px"},maxW:{base:"100%",md:"29%",lg:"22.5%"},mt:"30px"},e.createElement(V,{fontSize:{base:".875rem",md:"1rem",lg:"1.125rem"},lineHeight:"1.563rem",letterSpacing:"-.02em",data:t,style:["card"],px:"initial"})),me=({ct:t,filters:n,setTags:a,tags:o,sortfilters:l,dates:c,setDates:m,sort:x,setSort:p,index:u})=>{const i=(n==null?void 0:n.filter(f=>f!=="sections"))??[];return e.createElement(r,{h:"auto",align:"center",flex:1,direction:{base:"column",md:"row"},className:"non-overview-container",width:"100%"},e.createElement(r,{flex:1,maxW:{md:"30%"},minW:{base:"100%",md:"initial"},align:"center",justify:"space-between",width:"100%",my:"25px"}," ",n&&e.createElement(W,{setTags:a,tags:o,type:"mobile",ct:t,filters:i,display:{base:"flex",md:"none"}}),(l==null?void 0:l.length)>0&&e.createElement(Y,{index:u,sort:x,setSort:p,sortFilters:l})),n&&e.createElement(r,{gap:"29px",flex:2,direction:{base:"row-reverse",md:"row"},w:{base:"100%",md:"auto"},align:"center"},e.createElement(Q,{dates:c,tags:o,setTags:a,setDates:m})))};function pe({cta:t,index:n,ct:a,filters:o,prefilter:l,sortfilters:c}){const[m,x]=s.useState([]),[p,u]=s.useState(),[i,f]=s.useState([]),[w,S]=s.useState(!0);s.useEffect(()=>{const g=setTimeout(()=>{S(!1)},500);return()=>clearTimeout(g)},[]);const b=(o==null?void 0:o.filter(g=>g!=="sections"))??[],E="https://search.iapp.org",v={debug:!1,alwaysSearchOnInitialLoad:!0,apiConnector:new $(E,n,{prefilter:l}),initialState:{resultsPerPage:16},searchQuery:{search_fields:{name:{weight:3}},filters:[]},result_fields:{name:{snippet:{size:100,fallback:!0}}}},j={ct:a,filters:o,setTags:x,tags:m,sortfilters:c,dates:i,setDates:f,sort:p,setSort:u,index:n};return e.createElement(G,{config:v},e.createElement(r,{direction:"column",pl:"42px",pr:"50px",className:["search-container",a].join(" ")},e.createElement(r,{direction:"column",mx:"auto",w:"100%",maxW:"1440px",gap:"30px"},e.createElement(r,{justifyContent:{base:"center",md:"space-between"},direction:{base:"column",md:"row"}},e.createElement(se,{cta:t,ct:a}),e.createElement(r,{direction:"column",width:"100%"},e.createElement(le,{ct:a}),e.createElement(ce,{ct:a,tags:m,setTags:x,filters:o}),e.createElement(r,{pl:{md:"2.5%"},direction:{base:"column",md:"row"},gap:"2.5%",w:"100%"},e.createElement(me,j)))),e.createElement(r,{gap:{md:"2.5%"},direction:{base:"column",md:"row"},maxW:a!=="news_overview"&&"980px",mx:a!=="news_overview"&&"auto"},a==="news_overview"&&e.createElement(r,{direction:"column",maxW:{md:"29%",lg:"22.5%"},minH:{md:"1000px"},gap:"37px",flex:1,visibility:{base:"hidden",md:"visible"}},e.createElement(r,{h:"100%",direction:"column",display:{base:"none",md:"initial"}},e.createElement(r,{p:"16px",border:"solid #00000010 1px"},e.createElement(M,{dates:i,setDates:f})),e.createElement(W,{type:"desktop",ct:a,tags:m,setTags:x,filters:b}))),e.createElement(r,{direction:"column",flex:1},e.createElement(r,{direction:"column"},e.createElement(r,{minH:"30px",h:"132%",direction:"column"},e.createElement(U,{mapContextToProps:({totalResults:g})=>({totalResults:g})},g=>{const{totalResults:k}=g;return w?e.createElement("div",null,"Loading..."):k>0?e.createElement(r,{as:J,columnGap:{base:"20px",md:"16px",lg:"2%"},flexWrap:"wrap",resultView:a==="news_overview"?ae:oe,titleField:"name",h:"inherit"}):e.createElement(r,{justifyContent:"center"},e.createElement(d,null,"No results found"))})),e.createElement(r,{py:{base:"36px",lg:"100px"},justify:"center"},e.createElement(q,null),e.createElement(ie,null))))),e.createElement(r,{py:{base:"36px",lg:"100px"},justify:"center",visibility:{lg:"hidden"}}))))}function de(){const[t,n]=s.useState();function a(o,l,c){o==="resources_overview"&&n('["category:resource_entry","tags:internal_class=resource_article"]'),o==="news_overview"&&n('["category:news_article","category:news_blurb"]'),!t&&l&&c&&n(`"tags:${encodeURIComponent(l)}=${encodeURIComponent(c)}"`)}return[t,a]}function we({ct:t,parent:n}){var w,S;const a=window.location.pathname,[o,l]=de(),{data:c,isLoading:m,isError:x,failureReason:p,isSuccess:u}=t!=null&&t.includes("overview")?I(t||"news_overview","leaderboard"):P(t,a,"en-us","leaderboard");if(s.useEffect(()=>{var b;u&&l(t,n==="subjects"?"subject":n,(b=c[0])==null?void 0:b.title)},[c]),m)return e.createElement(B,null);if(x)throw new Error("Error loading SearchPage: ",(p==null?void 0:p.message)||"unknown reason");const i=c[0];function f(b){const E=[];return b.split("-").map(v=>{E.push(v[0].toUpperCase()+v.slice(1))}),E.join(" ")}return e.createElement("main",{id:"main"},e.createElement(L,null),i&&e.createElement("div",null,i.seo&&e.createElement(N,{data:i.seo,override:i}),e.createElement(z,null),n&&e.createElement(te,{data:{title:`All ${f(n)}`,href:`/resources/${n}`}}),i.banner&&e.createElement(re,{data:i.banner}),i.section_hero_banner&&e.createElement(K,{data:i.section_hero_banner[0]}),((w=i.interior_section_header)==null?void 0:w.length)>0&&e.createElement(X,{data:i.interior_section_header[0]}),i.page_content&&e.createElement(Z,{data:i.page_content}),((S=i.leaderboard)==null?void 0:S.length)>0&&e.createElement(r,{m:"23px auto 0",px:{base:"16px",md:"32px",lg:"60px"},flex:1},e.createElement(ne,{data:i.leaderboard})),e.createElement(pe,{cta:i.call_to_action,index:t,prefilter:o,filters:i.search_filters,ct:t,sortfilters:ee(i)})))}export{we as default};