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