1import{o as e,r as t}from"./rolldown-runtime-C0FnF6B9.js";import{t as n}from"./react-DiVRNtpo.js";import{G as r,W as i}from"./graphql-U6clWOA2.js";import{t as a}from"./jsx-runtime-BdxMnOeJ.js";import{t as o}from"./clsx-DB0hHKMi.js";import{t as s}from"./close-DlKhCayZ.js";import{t as c}from"./useIntl-BMnY2Ciq.js";var l=e(n(),1),u={root:`_root_16xwb_2`,themeUnfi:`_themeUnfi_16xwb_17`,themeDot:`_themeDot_16xwb_21`,themeChex:`_themeChex_16xwb_36`,banner:`_banner_16xwb_51`,bannerContent:`_bannerContent_16xwb_65`,bannerLink:`_bannerLink_16xwb_73`,bannerCloseButton:`_bannerCloseButton_16xwb_88`,backdrop:`_backdrop_16xwb_116`,dialog:`_dialog_16xwb_126`,closeButton:`_closeButton_16xwb_138`,header:`_header_16xwb_167`,headerIntro:`_headerIntro_16xwb_171`,badge:`_badge_16xwb_175`,title:`_title_16xwb_188`,body:`_body_16xwb_196`,bodyText:`_bodyText_16xwb_200`,customDialog:`_customDialog_16xwb_207`,customContent:`_customContent_16xwb_218`,screenshot:`_screenshot_16xwb_222`,sectionTitle:`_sectionTitle_16xwb_231`,detail:`_detail_16xwb_243`,detailHeading:`_detailHeading_16xwb_250`,orderedList:`_orderedList_16xwb_259`,detailRow:`_detailRow_16xwb_268`,stepNumber:`_stepNumber_16xwb_274`,detailText:`_detailText_16xwb_289`,footer:`_footer_16xwb_295`,kbLine:`_kbLine_16xwb_304`,kbLink:`_kbLink_16xwb_312`,footerActions:`_footerActions_16xwb_325`,btnPrimary:`_btnPrimary_16xwb_330`},d=t({default:()=>g}),f=a(),p={unfi:u.themeUnfi,dot:u.themeDot,chex:u.themeChex},m=/\[([^\]\n]+)\](?:\((https?:\/\/[^)\s]+)\))?/g;function h(e){let t=e.bannerText??``,n=new Map(e.bannerLinks.map(e=>[e.text.trim().toLowerCase(),e.url])),r=[],i=0;for(let e of t.matchAll(m)){let[a,o,s]=e,c=e.index??0,l=o.trim(),d=s??n.get(l.toLowerCase());d&&(c>i&&r.push(t.slice(i,c)),r.push((0,f.jsx)(`a`,{href:d,target:`_blank`,rel:`noopener noreferrer`,className:u.bannerLink,children:l},`${l}-${d}-${c}`)),i=c+a.length)}return i<t.length&&r.push(t.slice(i)),r.length>0?r:[t]}function g({isOpen:e,onClose:t,message:n,theme:a=`unfi`}){let d=c(),m=o(u.root,p[a]);if((0,l.useEffect)(()=>{if(!e)return;let n=e=>{e.key===`Escape`&&t()};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t]),!e)return null;if(n.messageType===r.Banner)return(0,f.jsxs)(`div`,{className:o(m,u.banner),role:`status`,"data-testid":`in-app-message-banner`,"data-theme":a,children:[(0,f.jsx)(`div`,{className:u.bannerContent,children:h(n).map((e,t)=>(0,f.jsx)(l.Fragment,{children:e},t))}),(0,f.jsx)(`button`,{type:`button`,onClick:t,className:u.bannerCloseButton,"aria-label":d.formatMessage({id:`app.unfi.banner.close_aria`,defaultMessage:`Dismiss banner`,description:`Aria label for in-app banner close button`}),children:(0,f.jsx)(s,{width:14,height:14,"aria-hidden":!0})})]});if(n.contentMode===i.CustomHtml&&n.customHtml)return(0,f.jsx)(`div`,{className:o(m,u.backdrop),role:`presentation`,"data-testid":`in-app-message-modal`,"data-theme":a,children:(0,f.jsxs)(`div`,{className:u.customDialog,role:`dialog`,"aria-modal":`true`,"aria-label":n.title,children:[(0,f.jsx)(`button`,{type:`button`,onClick:t,className:u.closeButton,"aria-label":d.formatMessage({id:`app.unfi.whats_new.close_aria`,defaultMessage:`Close guide`,description:`Aria label for whats-new guide close button`}),children:(0,f.jsx)(s,{width:16,height:16,"aria-hidden":!0})}),(0,f.jsx)(`div`,{className:u.customContent,dangerouslySetInnerHTML:{__html:n.customHtml}})]})});let g=n.steps??[],_=!!n.ctaUrl;return(0,f.jsx)(`div`,{className:o(m,u.backdrop),role:`presentation`,"data-testid":`in-app-message-modal`,"data-theme":a,children:(0,f.jsxs)(`div`,{className:u.dialog,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`unfi-whats-new-title`,children:[(0,f.jsx)(`button`,{type:`button`,onClick:t,className:u.closeButton,"aria-label":d.formatMessage({id:`app.unfi.whats_new.close_aria`,defaultMessage:`Close guide`,description:`Aria label for whats-new guide close button`}),children:(0,f.jsx)(s,{width:16,height:16,"aria-hidden":!0})}),(0,f.jsxs)(`div`,{className:`${u.header} ${u.headerIntro}`,children:[n.badge&&(0,f.jsx)(`span`,{className:u.badge,children:n.badge}),(0,f.jsx)(`h2`,{id:`unfi-whats-new-title`,className:u.title,children:n.title})]}),(0,f.jsxs)(`div`,{className:u.body,children:[n.body&&(0,f.jsx)(`p`,{className:u.bodyText,children:n.body}),g.length>0&&(0,f.jsx)(`div`,{className:u.detail,children:(0,f.jsx)(`ol`,{className:u.orderedList,children:g.map((e,t)=>(0,f.jsxs)(`li`,{className:u.detailRow,children:[(0,f.jsx)(`span`,{className:u.stepNumber,children:t+1}),(0,f.jsx)(`span`,{className:u.detailText,children:e})]},t))})})]}),(0,f.jsxs)(`div`,{className:u.footer,children:[_&&(0,f.jsx)(`p`,{className:u.kbLine,children:(0,f.jsx)(`a`,{href:n.ctaUrl??void 0,target:`_blank`,rel:`noopener noreferrer`,className:u.kbLink,children:n.ctaLabel||d.formatMessage({id:`app.unfi.whats_new.learn_more`,defaultMessage:`Learn more`,description:`Default CTA link label for in-app message`})})}),(0,f.jsx)(`div`,{className:u.footerActions,children:(0,f.jsx)(`button`,{type:`button`,onClick:t,className:u.btnPrimary,children:d.formatMessage({id:`app.unfi.whats_new.got_it`,defaultMessage:`Got it`,description:`Whats-new guide dismiss button`})})})]})]})})}export{d as n,g as t};
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.