import{v as R,r as M,u as G,d as H,R as r,B as N,C as $,A as X,F as j,L as B,E as q,G as z,J as F,K as J,O as K}from"./index-Kh0MIfaC.js";import{A as U,R as V,D as Z}from"./BlockContainer-CsMf_J54.js";import{H as Q}from"./Helmet-BYFlk3gY.js";function ne(T){var h,E,x,w,b,k,n,t,l,_,o;const{l:a}=R(),[e,d]=M.useState(),g=G();M.useEffect(()=>{A(a)},[a]);async function A(s){const i=await H.getAllEntries("message_alert",s);d(i[0])}const{isOpen:C,onClose:y}=U({defaultIsOpen:!0});return r.createElement(N,null,e?C?r.createElement($,{as:X,color:g.colors.White,backgroundColor:g.colors.Blue150,minW:"100%",direction:{base:"column",md:"row"},justify:{base:"center",md:"space-between"},align:{base:"center",md:"center"}},r.createElement($,{minW:"100%",as:j,flexDirection:"row",justifyContent:"space-between"},r.createElement(N,{minW:"100%",align:"center",paddingLeft:"32px",paddingRight:"32px",paddingTop:"8px",paddingBottom:"8px",maxWidth:"1200px"},r.createElement(N,{maxWidth:"1200px"},r.createElement(V,{data:e.message,lineHeight:"24px",fontSize:"16px",px:"0",mx:"0",display:"inline",addedClassName:"alertBanner"}),(h=e.url_path)!=null&&h.external?r.createElement(B,{as:"u",fontWeight:"medium",href:(x=(E=e.url_path)==null?void 0:E.link)==null?void 0:x.href,target:(w=e.url_path)!=null&&w.new_window?"_blank":"_self"}," ",(k=(b=e.url_path)==null?void 0:b.link)==null?void 0:k.title):r.createElement(B,{fontWeight:"medium",href:(t=(n=e.url_path)==null?void 0:n.link)==null?void 0:t.href,target:(l=e.url_path)!=null&&l.new_window?"_blank":""}," ",(o=(_=e.url_path)==null?void 0:_.link)==null?void 0:o.title))),r.createElement(N,{flexGrow:.03},r.createElement(q,{onClick:y})))):null:"")}var W={exports:{}};(function(T){(function(a){if(typeof e!="function"){var e=function(n){return n};e.nonNative=!0}const d=e("plaintext"),g=e("html"),A=e("comment"),C=/<(\w*)>/g,y=/<\/?([^\s\/>]+)/;function h(n,t,l){n=n||"",t=t||[],l=l||"";let _=x(t,l);return w(n,_)}function E(n,t){n=n||[],t=t||"";let l=x(n,t);return function(o){return w(o||"",l)}}h.init_streaming_mode=E;function x(n,t){return n=b(n),{allowable_tags:n,tag_replacement:t,state:d,tag_buffer:"",depth:0,in_quote_char:""}}function w(n,t){if(typeof n!="string")throw new TypeError("'html' parameter must be a string");let l=t.allowable_tags,_=t.tag_replacement,o=t.state,s=t.tag_buffer,i=t.depth,m=t.in_quote_char,p="";for(let f=0,D=n.length;f<D;f++){let u=n[f];if(o===d)switch(u){case"<":o=g,s+=u;break;default:p+=u;break}else if(o===g)switch(u){case"<":if(m)break;i++;break;case">":if(m)break;if(i){i--;break}m="",o=d,s+=">",l.has(k(s))?p+=s:p+=_,s="";break;case'"':case"'":u===m?m="":m=m||u,s+=u;break;case"-":s==="<!-"&&(o=A),s+=u;break;case" ":case`
`:if(s==="<"){o=d,p+="< ",s="";break}s+=u;break;default:s+=u;break}else if(o===A)switch(u){case">":s.slice(-2)=="--"&&(o=d),s="";break;default:s+=u;break}}return t.state=o,t.tag_buffer=s,t.depth=i,t.in_quote_char=m,p}function b(n){let t=new Set;if(typeof n=="string"){let l;for(;l=C.exec(n);)t.add(l[1])}else!e.nonNative&&typeof n[e.iterator]=="function"?t=new Set(n):typeof n.forEach=="function"&&n.forEach(t.add,t);return t}function k(n){let t=y.exec(n);return t?t[1].toLowerCase():null}T.exports?T.exports=h:a.striptags=h})(z)})(W);var Y=W.exports;const I=F(Y),O=160;function ae(T){var w,b,k,n,t,l,_,o,s;const{data:a,override:e,isArticle:d}=T,{l:g}=R();J();const A=()=>{const i=document.head,m=Array.from(i.childNodes),p=(c,S)=>{const L=c.name,P=S.name;return L==="description"&&P!=="description"?-1:P==="description"&&L!=="description"?1:0},f=m.filter(c=>c.nodeName==="META").sort(p),D=m.filter(c=>c.nodeName==="TITLE"),u=m.filter(c=>c.nodeName==="LINK");f.forEach(c=>i.removeChild(c)),D.forEach(c=>i.removeChild(c)),u.forEach(c=>i.removeChild(c)),u.forEach(c=>i.insertBefore(c,i.firstChild)),f.forEach(c=>i.insertBefore(c,i.firstChild)),D.forEach(c=>i.insertBefore(c,i.firstChild)),window&&(window.prerenderReady=!0)};M.useEffect(()=>{A()},[]);const C=i=>Z(i,"yyyy-MM-dd'T'HH:mm:ssXXX"),y=()=>{const i=a==null?void 0:a.meta_description;if(i)return i;if(e!=null&&e.article_body&&Array.isArray(e.article_body)){const m=e.article_body.map(p=>{var f;return((f=p==null?void 0:p.rte)==null?void 0:f.rich_text_editor)||(e==null?void 0:e.entry_summary)||""}).join(" ");return I(m).trim().slice(0,O)}return e!=null&&e.entry_summary?I(e.entry_summary).trim().slice(0,O):""},h=((w=a==null?void 0:a.meta_image)==null?void 0:w.url)||((b=e==null?void 0:e.main_image)==null?void 0:b.url)||((n=(k=e==null?void 0:e.headline_banner)==null?void 0:k.image)==null?void 0:n.url),E=(a==null?void 0:a.meta_page_title)||(e==null?void 0:e.title),x=M.useMemo(()=>{var p,f;const[i]=((p=e.article_details)==null?void 0:p.author)||[""],m=y();return{"@context":"https://schema.org","@type":"NewsArticle",headline:((f=e.article_details)==null?void 0:f.headline)||E,description:m,url:window.location.origin+e.url,image:h,datePublished:e.created_at,dateModified:e.updated_at,author:{"@type":"Person",name:(i==null?void 0:i.name)||"IAPP Staff"},publisher:{"@type":"Organization",name:"IAPP"}}},[a,e,h,E,y]);return r.createElement(Q,null,r.createElement("title",null,`${E}  | IAPP`),r.createElement("meta",{name:"description",content:y(),"data-rh":"true"}),((t=e==null?void 0:e.publish_details)==null?void 0:t.time)&&r.createElement("meta",{"http-equiv":"last-modified",content:C((l=e==null?void 0:e.publish_details)==null?void 0:l.time)}),r.createElement("link",{rel:"canonical",href:`${a==null?void 0:a.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:title",content:`${a==null?void 0:a.meta_page_title}`||`${(_=e==null?void 0:e.article_details)==null?void 0:_.headline}`}),r.createElement("meta",{property:"og:description",content:y()}),h&&r.createElement("meta",{property:"og:image",content:h}),r.createElement("meta",{property:"og:type",content:"article"}),r.createElement("meta",{property:"og:url",content:`${a==null?void 0:a.canonical_url}`||`https://iapp.org${e==null?void 0:e.url}`}),r.createElement("meta",{property:"og:locale",content:g&&K.includes(g)?`${g}`:"en_US"}),r.createElement("meta",{name:"twitter:card",content:"summary_large_image"}),r.createElement("meta",{name:"twitter:site",content:"@IAPP"}),r.createElement("meta",{name:"twitter:title",content:`${E}`}),r.createElement("meta",{name:"twitter:description",content:`${a==null?void 0:a.meta_description}`||`${e==null?void 0:e.news_blurb}`}),r.createElement("meta",{name:"twitter:image",content:((o=a==null?void 0:a.meta_image)==null?void 0:o.url)||((s=e==null?void 0:e.main_image)==null?void 0:s.url)}),r.createElement("meta",null),d&&r.createElement("script",{type:"application/ld+json"},JSON.stringify(x)))}export{ae as M,ne as a};