1import{y as B,u as w,t as L,J as S,$ as F}from"./DRREkx-t.js";import{u as A}from"./BMq9mDWV.js";function C(e){if(e?.url)return{type:"image",picture:{source:{src:e.url,alt:e.alt||e.title||""}}}}function G(e){return B(e)}function D(e){return e.filter(t=>!G(t))}const J=4,Q=9,K="insightsResearch",U="insightsResearch",W=e=>e*2+1,v=[{field:"categoryTopics",filterKey:"topic",label:"All topics:",allOptionLabel:"All topics"},{field:"categoryNewsTypes",filterKey:"topic",label:"All topics:",allOptionLabel:"All topics"},{field:"categoryIndustries",filterKey:"industry",label:"All industries:",allOptionLabel:"All industries"},{field:"categoryRegions",filterKey:"region",label:"All regions:",allOptionLabel:"All regions"},{field:"categoryInsightsTypes",filterKey:"insights-type",label:"All types:",allOptionLabel:"All types"},{field:"categoryWebinarTypes",filterKey:"webinar-type",label:"All webinar types:",allOptionLabel:"All webinar types"},{field:"categoryEventTypes",filterKey:"event-type",label:"All event types:",allOptionLabel:"All event types"}],H={insightsResearch:["categoryTopics","categoryInsightsTypes","categoryIndustries","categoryRegions"],newsroom:["categoryTopics","categoryNewsTypes"],blockchainBasics:["categoryTopics"],countryGuides:["categoryRegions"],customerStories:["categoryIndustries","categoryRegions"]};function k(e){const t=e?H[e]:void 0;if(!t)return v;const s=new Set(t);return v.filter(({field:r})=>s.has(r))}const h=(e,t)=>t===e,b=e=>h("insightsResearch",e),E=e=>h("countryGuides",e),N=e=>h("newsroom",e),P=e=>h("webinars",e),g=e=>h("events",e);function _(e,t){return e?.sectionHandle||t||U}function X(e,t,s){return k(s).some(n=>n.field===t)?e?.[t]??[]:[]}const O=(e,t)=>k(t).flatMap(({field:s})=>e?.[s]||[]);function M(e,t){const s=t instanceof Set?t:new Set(t);if(s.size===0)return e;const r=[],n=[];for(const i of e)i?.slug&&s.has(i.slug)?r.push(i):n.push(i);return[...Array.from(s).map(i=>r.find(a=>a?.slug===i)).filter(i=>!!i),...n]}function R(e,t={}){const{style:s="green",linkBuilder:r}=t;return e.map(n=>({text:n?.title??"",style:s,...r?{link:{url:r(n)}}:{}}))}function I(e,t){const s={};for(const{field:r,filterKey:n}of k(t))s[n]=[...s[n]??[],...e?.[r]??[]];return s}function $(e,t,s){const r=new Map;for(const n of e){const o=n.categoryGroups?.[t]??[];for(const i of o)i?.slug&&i?.title&&!r.has(i.slug)&&r.set(i.slug,i.title)}return[{label:s,key:""},...Array.from(r.entries()).map(([n,o])=>({label:o,key:n})).sort((n,o)=>n.label.localeCompare(o.label))]}function ee(e){const t=[],s=new Set;for(const{filterKey:r,label:n,allOptionLabel:o}of v){if(s.has(r))continue;s.add(r);const i=$(e,r,L(o));i.length<=1||t.push({type:"select",key:r,label:L(n),labelId:`${r}Label`,options:i,preselectedValue:""})}return t}function te(){const e=new Set(v.map(t=>t.filterKey));return Object.fromEntries(Array.from(e,t=>[t,""]))}function se(e,t={}){for(const[s,r]of Object.entries(t)){if(!r)continue;if(!(e?.[s]??[]).some(i=>i?.slug===r))return!1}return!0}function ne(e,t){const s=t?.trim().toLowerCase();return s?(e?.toLowerCase()??"").includes(s):!0}function x(e,t){const{excludeId:s,limit:r}=t,n=new Set,o=[];for(const i of e)for(const a of i??[]){if(!a)continue;const l=a.id;if(!(s!=null&&l===s)&&!G(a)&&!n.has(l)&&(n.add(l),o.push(a),o.length>=r))return o}return o}async function re({channel:e,categorySlugs:t,limit:s=4,explicitArticles:r=[],excludeId:n}){const o=x([r],{excludeId:n,limit:s});if(o.length>=s)return o;const i=w(),a=W(s);let l=[];t.length>0&&(l=(await i.runWithContext(()=>A("articles",{channel:e,categories:t,limit:a})))?.value??[]);const p=x([o,l],{excludeId:n,limit:s});if(p.length>=s)return p;const d=(await i.runWithContext(()=>A("articles",{channel:e,limit:a})))?.value??[];return x([p,d],{excludeId:n,limit:s})}async function oe(e,t){const s=w();let r=[],n=0;const o=100;let i=!0;for(;i;){const l=(await s.runWithContext(()=>A("articles",{channel:e,limit:o,offset:n})))?.value??[];r=r.concat(D(l)),l.length<o?i=!1:n+=o}return r}async function ie({authorSlugs:e,channel:t=K}){const s=w();let r=[],n=0;const o=100;let i=!0;for(;i;){const l=(await s.runWithContext(()=>A("articles",{channel:t,entries:e,limit:o,offset:n})))?.value??[];r=r.concat(D(l)),l.length<o?i=!1:n+=o}return r}function le(e,t){const s=[...e];return E(t)&&s.sort((r,n)=>(r.title??"").localeCompare(n.title??"")),s}function ae(e,t){return e.map(s=>{const r=_(s,t);return{id:s.id,categoryGroups:I(s,r),searchText:s.title??"",listingCard:j(s,{channelSelect:t})}})}function j(e,t={}){const{filterKey:s,fallbackAuthorName:r="Elliptic"}=t,n=_(e,t.channelSelect),o=e.__typename==="external_Entry",i=e.authorSelect?.[0],a=O(e,n),l=b(n)||N(n),p=b(n)&&i,m=E(n)?1:2;let d,c=a;const y=g(n)?e.date:e.postDate;if(P(n)){const f=e.categoryWebinarTypes?.[0];f?.title&&(d={style:"dark",text:f.title},c=c.filter(u=>u.slug!==f.slug))}else if(g(n)){const f=e.categoryEventTypes?.[0];f?.title&&(d={style:"dark",text:f.title},c=c.filter(u=>u.slug!==f.slug))}return{link:{url:o?e.externalUrl?.url:`/${e.uri}/`,type:o?"external":"internal",target:o?"_blank":"_self"},asset:e.asset?.[0]?new S(e.asset[0]):void 0,articleTags:{postDate:l?y:void 0,tag:d,tagsBlock:{tags:R(c.slice(0,m)),expandable:!1}},categories:a,categoryGroups:I(e,n),filterKey:s,headline:e.title,author:p?{name:i.title??r,position:i.plainText??void 0,asset:C(i.image?.[0])}:void 0,eventInfo:g(n)&&e.date?{dateFrom:e.date,dateTo:e.date2,location:e.plainText}:void 0}}function ce(e,t={}){const{fallbackAuthorName:s,prioritySlugs:r=[],authorVariant:n="full"}=t,o=_(e,t.channelSelect),i=e.__typename==="external_Entry",a=M(O(e,o),r),l=e.authorSelect?.[0],p=b(o)||N(o),m=b(o)&&l,d=E(o)?1:2;let c,y=a;const f=g(o)?e.date:e.postDate;if(P(o)){const u=e.categoryWebinarTypes?.[0];u?.title&&(c={style:"dark",text:u.title},y=y.filter(T=>T.slug!==u.slug))}else if(g(o)){const u=e.categoryEventTypes?.[0];u?.title?(c={style:"dark",text:u.title},y=y.filter(T=>T.slug!==u.slug)):c={style:"dark",text:L("Upcoming")}}return{link:{url:i?e.externalUrl?.url:`/${e.uri}/`,type:i?"external":"internal",target:i?"_blank":"_self"},asset:e.asset?.[0]?new S(e.asset[0]):void 0,articleTags:{postDate:p?f:void 0,tag:c,tagsBlock:{tags:R(y.slice(0,d)),expandable:!1}},categoryGroups:I(e,o),title:e.title??"",author:m?{name:l.title??s??"",position:n==="full"?l.plainText??"":void 0,asset:n==="full"?C(l.image?.[0]):void 0}:void 0,eventInfo:g(o)&&e.date?{dateFrom:e.date,dateTo:e.date2,location:e.plainText}:void 0}}function V(e){if(!e)return;let t="";if(e.title){const r=e.title.split(" ");t=(r[0].toLowerCase()==="dr."||r[0].toLowerCase()==="dr")&&r.length>1?r[1]:r[0]}const s=t?t.toLowerCase().endsWith("s")?"'":"'s":"";return{name:e.title,position:e.plainText??void 0,asset:C(e.image?.[0]),variant:"large",linkedinLink:e.externalLink?.url?{url:e.externalLink.url,type:"external",target:"_blank"}:void 0,authorLink:e.uri?{url:`/${e.uri}/`}:void 0,authorLinkText:t?`${t}${s} insights`:void 0}}function ue(e){if(!(!e||!Array.isArray(e)||e.length===0))return e.map(V).filter(t=>t!==void 0)}class fe extends F{format(t){return{text:t.headingTextBlock?.rawHtml?.replace(/<\/?p>/g,"")??"",type:t.headingType,style:t.headingStyle,animated:t.animated??!1}}}function q(e){return!e||!e.buttonLink?[]:e.buttonType==="video"?[{type:e.buttonType??"video",posterImage:{src:e.poster[0]?.url??"",alt:e.poster[0]?.alt||e.poster[0]?.title||""},text:e.videoUrl?.label??"",videoUrl:e.videoUrl?.url??""}]:e.buttonLink.map(t=>{if(t)return{type:e.buttonType??"primary",link:Y(t),text:t.text??void 0}})}function Y(e){const t=e.__typename.split("_"),s=t[1]?t[1].toLowerCase():"",r=e.linkUrl==="popupStaticTemplate"||s==="video",n=r?"popup":void 0,o=r?"action":s==="url"||e.target==="_blank"?"external":"internal";return{text:e.text??"",type:o,entryType:s,url:e.linkUrl??"",target:e.target??"_self",action:n,ariaLabel:e.ariaLabel??"",link:e.linkUrl??""}}class pe extends F{format(t){return!t||t.length===0?void 0:{buttons:t.flatMap(n=>n?q(n):[]).filter(n=>!!n)}}}export{pe as B,U as D,J as F,fe as H,Q as L,P as a,g as b,R as c,C as d,O as e,re as f,X as g,N as h,b as i,E as j,ie as k,ae as l,ee as m,D as
1n,oe as o,ce as p,I as q,ue as r,le as s,te as t,se as u,ne as v,q as w};
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.