1import{j as e,d as W,u as F,l as E,r as x,N as T}from"./vendor-react-DfYGAhtm.js";import{m as o,t as y,aL as O,H as D,aR as K,g as N}from"./index-DsBgCU7r.js";import{aK as Y,aL as X,ag as q,ah as G,ai as Q,aj as V,ak as J,q as Z}from"./vendor-icons-1odZwi-b.js";import{M as ee}from"./mascot-header-BIwJJ2kn.js";import{u as te,c as re,C}from"./blogApi-B-tmEZPp.js";import{M as ne,a as se,b as ie,c as oe,d as ae}from"./socialLinks-W7seOJ8a.js";import{a,h,a9 as le,o as B,T as c,i as M,L as m,F as j,S as ce,H as S,n as de,B as he}from"./vendor-ui-DA_r9yXk.js";import"./vendor-state-BsBVN-fX.js";import"./vendor-forms-BP-7CbAP.js";import"./contentfulPreview-UQGJUROZ.js";const R=t=>{const i=t.target;if(!i)return;const r=i.fields?.file?.url;if(typeof r=="string")return r.startsWith("//")?`https:${r}`:r},pe=t=>{const{data:i,nodeType:n}=t;if(n==="hyperlink"||n==="asset-hyperlink"){const s=i.uri;if(typeof s=="string")return s;const r=i.href;return typeof r=="string"?r:R(i)}if(n==="entry-hyperlink"){const s=i.uri;if(typeof s=="string")return s;const r=i.href;if(typeof r=="string")return r}},ue=t=>
1{if(t.nodeType==="embedded-asset-block")return R(t.data)},xe=t=>{const n=t.data.target?.fields,s=n?.description;if(typeof s=="string"&&s)return s;const r=n?.title;return typeof r=="string"&&r?r:""},me=t=>typeof t=="object"&&t!==null&&"type"in t&&typeof t.type=="string",v=t=>t.nodeType==="text"&&typeof t.value=="string"?t.value:t.content?.length?t.content.map(v).join(""):"",I={1:{base:"2xl",md:"4xl"},2:{base:"xl",md:"2xl"},3:{base:"lg",md:"xl"},4:{base:"md",md:"lg"},5:{base:"sm",md:"md"},6:{base:"xs",md:"sm"}},ge=t=>{const i=/^heading-(\d)$/.exec(t);if(!i)return;const n=Number(i[1]);return n>=1&&n<=6?n:void 0},fe=(t,i)=>{let n=t;return i.forEach((s,r)=>{switch(s.type){case"bold":n=e.jsx("strong",{children:n},`m-${r}-bold`);break;case"italic":n=e.jsx("em",{children:n},`m-${r}-italic`);break;case"underline":n=e.jsx(a,{as:"u",display:"inline",children:n},`m-${r}-underline`);break;case"code":n=e.jsx(a,{as:"code",display:"inline",px:1,py:.5,borderRadius:"sm",bg:o.gray[100],fontFamily:"mono",fontSize:"0.9em",children:n},`m-${r}-code`);break;case"superscript":n=e.jsx(c,{as:"sup",display:"inline",fontSize:"0.75em",children:n},`m-${r}-sup`);break;case"subscript":n=e.jsx(c,{as:"sub",display:"inline",fontSize:"0.75em",children:n},`m-${r}-sub`);break;case"strikethrough":n=e.jsx(c,{as:"s",display:"inline",children:n},`m-${r}-strike`);break}}),n},ye=({node:t,variant:i})=>{if(t.nodeType==="text"){const n=t.value??"",s=(t.marks??[]).filter(me);return n===""&&s.length===0?null:e.jsx(e.Fragment,{children:fe(n,s)})}if(t.nodeType==="hyperlink"||t.nodeType==="asset-hyperlink"||t.nodeType==="entry-hyperlink"){const n=pe(t),s=t.content?.length?e.jsx(b,{nodes:t.content,variant:i}):null;if(!n)return e.jsx(c,{as:"span",children:s});const r=/^https?:\/\//i.test(n);return e.jsx(m,{href:n,color:o.orange[500],fontWeight:"semibold",textDecoration:"underline",textUnderlineOffset:"2px",...r?{target:"_blank",rel:"noopener noreferrer"}:{},children:s})}if(t.nodeType==="embedded-entry-inline"){const n=t.content?.length?e.jsx(b,{nodes:t.content,variant:i}):null;return n?e.jsx("span",{children:n}):null}return null},b=({nodes:t,variant:i})=>e.jsx(e.Fragment,{children:t.map((n,s)=>e.jsx(ye,{node:n,variant:i},s))}),je=t=>({color:o.text.info,lineHeight:t==="hero"?"1.75":"1.8",fontSize:t==="hero"?{base:"md",md:"lg"}:"md",whiteSpace:"pre-line",mb:t==="body"?3:0}),be=({node:t,variant:i})=>!t.content?.length||!v(t).trim()?null:e.jsx(c,{as:"p",...je(i),children:e.jsx(b,{nodes:t.content,variant:i})}),ke=({node:t,variant:i})=>{const n=ge(t.nodeType);if(n===void 0||!t.content?.length||!v(t).trim())return null;const r=I[n]??I[2],p=`h${n}`;return e.jsx(M,{as:p,color:o.text.label,fontSize:r,fontWeight:"bold",lineHeight:"short",mt:i==="body"?6:4,mb:2,children:e.jsx(b,{nodes:t.content,variant:i})})},d=({node:t,variant:i})=>{const n=t.nodeType;if(n==="document"&&t.content?.length)return e.jsx(h,{gap:i==="hero"?4:1,align:"stretch",children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))});if(n==="paragraph")return e.jsx(be,{node:t,variant:i});if(n.startsWith("heading-"))return e.jsx(ke,{node:t,variant:i});if(n==="unordered-list"&&t.content?.length)return e.jsx(a,{as:"ul",pl:6,my:3,css:{listStyleType:"disc",listStylePosition:"outside"},children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))});if(n==="ordered-list"&&t.content?.length)return e.jsx(a,{as:"ol",pl:6,my:3,css:{listStyleType:"decimal",listStylePosition:"outside"},children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))});if(n==="list-item"&&t.content?.length)return e.jsx(a,{as:"li",mb:1,children:e.jsx(h,{gap:1,align:"stretch",children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))})});if(n==="blockquote"&&t.content?.length)return e.jsx(a,{my:4,py:3,pl:4,borderLeft:"4px solid",borderColor:o.orange[400],bg:o.gray[50],borderRadius:"sm",children:e.jsx(h,{gap:2,children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))})});if(n==="hr")return e.jsx(le,{my:6,borderColor:o.border.primary});if(n==="embedded-asset-block"){const s=ue(t);return s?e.jsx(a,{my:4,children:e.jsx(B,{src:s,alt:xe(t),borderRadius:"md",w:"100%",maxH:"480px",objectFit:"contain",loading:"lazy"})}):null}if(n==="embedded-entry-block"){const s=t.content?.length?e.jsx(h,{gap:2,children:t.content.map((r,p)=>e.jsx(d,{node:r,variant:i},p))}):null;return s?e.jsx(a,{my:4,p:4,borderRadius:"md",borderWidth:"1px",borderColor:o.border.primary,bg:o.gray[50],children:s}):null}if(n==="table"&&t.content?.length)return e.jsx(a,{overflowX:"auto",my:4,children:e.jsx(a,{as:"table",w:"100%",css:{borderCollapse:"collapse"},children:e.jsx(a,{as:"tbody",children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))})})});if(n==="table-row"&&t.content?.length)return e.jsx(a,{as:"tr",children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))});if(n==="table-cell"||n==="table-header-cell"){const s=n==="table-header-cell",r=s?"th":"td";return e.jsx(a,{as:r,borderWidth:"1px",borderColor:o.border.primary,p:2,fontWeight:s?"semibold":"normal",textAlign:"left",verticalAlign:"top",children:t.content?.length?e.jsx(h,{gap:1,children:t.content.map((p,k)=>e.jsx(d,{node:p,variant:i},k))}):null})}return t.content?.length?e.jsx(e.Fragment,{children:t.content.map((s,r)=>e.jsx(d,{node:s,variant:i},r))}):null},L=({root:t,variant:i="body"})=>!t||t.nodeType!=="document"||!t.content||t.content.length===0?null:e.jsx(a,{w:"100%",children:e.jsx(d,{node:t,variant:i})}),we={},z=t=>t.replace(/\/+$/,""),Se=({pathname:t,search:i})=>{const s=we.VITE_PUBLIC_APP_URL?.trim();return s?`${z(s)}${t}${i}`:typeof window>"u"?"":`${window.location.origin}${t}${i}`},_e=({href:t,baseOrigin:i})=>{const n=z(i);try{return new URL(t,`${n}/`).href}catch{return`${n}/`}},A={name:"Myka",role:"Editorial team"},_=({onBack:t})=>e.jsx(he,{type:"button",variant:"ghost",size:"sm",colorPalette:"gray",onClick:t,alignSelf:"flex-start",mb:2,"aria-label":"Back to dashboard",children:e.jsxs(j,{as:"span",align:"center",gap:2,children:[e.jsx(Z,{size:18,"aria-hidden":!0}),e.jsx(c,{as:"span",fontSize:"sm",fontWeight:"semibold",children:"Back"})]})}),$e=()=>{const t=W(),i=F(),{blogId:n}=E(),s=te(),{data:r,isLoading:p,isError:k}=re(n,s),l=x.useMemo(()=>Se({pathname:i.pathname,search:i.search}),[i.pathname,i.search]),g=x.useMemo(()=>
1{if(!r?.emphasis)return"";const u=r.emphasis.trim();return u.length<=200?u:`${u.slice(0,197)}...`},[r]),f=x.useMemo(()=>{if(!r||!l)return"";try{const u=new URL(l).origin;return _e({href:r.heroImage.url,baseOrigin:u})}catch{return""}},[r,l]),H=x.useMemo(()=>{if(typeof navigator>"u"||typeof navigator.share!="function"||!l)return!1;if(typeof navigator.canShare=="function")try{return navigator.canShare({url:l})}catch{return!0}return!0},[l]),w=x.useCallback(()=>{t("/home")},[t]),$=x.useCallback(async()=>{if(!l){y.error("Unable to copy link in this environment.");return}try{await navigator.clipboard.writeText(l),y.success("Link copied to clipboard")}catch{y.error("Could not copy link. Try copying from the address bar.")}},[l]),U=x.useCallback(async()=>{if(!(!r||!l))try{await navigator.share({title:r.title,text:g||r.emphasis,url:l})}catch(u){if(u.name==="AbortError")return;y.error("Could not open the share sheet.")}},[r,g,l]);if(!n)return e.jsx(T,{to:"/home",replace:!0});if(p)return e.jsx(a,{w:"100%",py:{base:6,md:10},children:e.jsxs(a,{w:"100%",maxW:"760px",mx:"auto",px:{base:4,md:0},children:[e.jsx(_,{onBack:w}),e.jsx(j,{w:"100%",minH:"200px",align:"center",justify:"center",py:12,children:e.jsx(ce,{size:"lg",color:o.orange[500]})})]})});if(k||!r)return s.isPreview?e.jsxs(a,{w:"100%",py:{base:6,md:10},children:[e.jsx(C,{}),e.jsxs(a,{w:"100%",maxW:"760px",mx:"auto",px:{base:4,md:0},pt:6,children:[e.jsx(_,{onBack:w}),e.jsxs(c,{color:o.text.info,fontSize:"sm",mt:4,children:["This draft could not be loaded. If the entry is unpublished, the backend preview API may not be enabled yet â share"," ",e.jsx(c,{as:"span",fontWeight:"semibold",children:"docs/contentful-preview-backend-handoff.md"})," ","with the API team."]})]})]}):e.jsx(T,{to:"/home",replace:!0});const P=O(r.createdAt,{options:{month:"short",day:"numeric",year:"numeric"}});return e.jsxs(a,{w:"100%",py:{base:6,md:10},children:[s.isPreview?e.jsx(C,{}):null,e.jsxs(D,{prioritizeSeoTags:!0,children:[e.jsx("title",{children:`${r.title} | Myka`}),e.jsx("meta",{name:"description",content:g}),e.jsx("link",{rel:"canonical",href:l}),e.jsx("meta",{property:"og:type",content:"article"}),e.jsx("meta",{property:"og:title",content:r.title}),e.jsx("meta",{property:"og:description",content:g}),e.jsx("meta",{property:"og:url",content:l}),f?e.jsx("meta",{property:"og:image",content:f}):null,e.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),e.jsx("meta",{name:"twitter:title",content:r.title}),e.jsx("meta",{name:"twitter:description",content:g}),f?e.jsx("meta",{name:"twitter:image",content:f}):null]}),e.jsx(a,{w:"100%",maxW:"760px",mx:"auto",px:{base:4,md:0},children:e.jsxs(h,{gap:8,children:[e.jsx(a,{w:"100%",children:e.jsx(_,{onBack:w})}),e.jsxs(h,{gap:2,textAlign:"center",children:[e.jsx(j,{justify:"center",align:"center",gap:2,flexWrap:"wrap",children:e.jsx(c,{color:o.text.orange,fontSize:"xs",fontWeight:"medium",children:P})}),e.jsx(M,{color:o.text.label,fontSize:{base:"2xl",md:"4xl"},children:r.title}),e.jsx(c,{color:o.text.info,fontSize:{base:"sm",md:"md"},children:r.emphasis})]}),e.jsx(a,{w:"100%",children:e.jsx(B,{src:r.heroImage.url,alt:r.heroImage.title||r.title,borderRadius:"md",w:"100%",h:{base:"220px",md:"400px"},objectFit:"cover",draggable:!1,loading:"eager"})}),e.jsxs(h,{gap:6,children:[e.jsx(L,{root:r.heroText,variant:"hero"}),e.jsx(L,{root:r.paragraphs,variant:"body"})]}),e.jsx(a,{w:"100%",pt:2,children:e.jsx(a,{borderTop:`1px solid ${o.border.primary}`,pt:4,children:e.jsxs(j,{align:"center",justify:"space-between",gap:4,wrap:"wrap",children:[e.jsxs(S,{gap:3,children:[e.jsx(K,{imageSrc:ee,initial:"M"}),e.jsxs(a,{children:[e.jsx(c,{fontWeight:"semibold",color:o.text.label,children:A.name}),e.jsx(c,{fontSize:"sm",color:o.text.info,children:A.role})]})]}),e.jsxs(S,{gap:2,children:[H?e.jsx(de,{"aria-label":"Share article",variant:"outline",size:"sm",type:"button",onClick:()=>{U()},children:e.jsx(Y,{size:18})}):null,e.jsx(N,{type:"button",buttonType:"outline",size:"sm",text:"Copy link",icon:e.jsx(X,{size:15}),iconPosition:"left",onClick:()=>{$()}}),e.jsxs(S,{gap:3,css:{"& a > svg":{display:"block",width:"20px",height:"20px"}},children:[e.jsx(m,{href:ne,target:"_blank",rel:"noopener noreferrer","aria-label":"Myka on X",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0,color:o.gray[600],_hover:{color:o.navy[500],textDecoration:"none"},children:e.jsx(q,{"aria-hidden":!0})}),e.jsx(m,{href:se,target:"_blank",rel:"noopener noreferrer","aria-label":"Myka on LinkedIn",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0,color:o.gray[600],_hover:{color:o.navy[500],textDecoration:"none"},children:e.jsx(G,{"aria-hidden":!0})}),e.jsx(m,{href:ie,target:"_blank",rel:"noopener noreferrer","aria-label":"Myka on Facebook",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0,color:o.gray[600],_hover:{color:o.navy[500],textDecoration:"none"},children:e.jsx(Q,{"aria-hidden":!0})}),e.jsx(m,{href:oe,target:"_blank",rel:"noopener noreferrer","aria-label":"Myka on Instagram",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0,color:o.gray[600],_hover:{color:o.navy[500],textDecoration:"none"},children:e.jsx(V,{"aria-hidden":!0})}),e.jsx(m,{href:ae,target:"_blank",rel:"noopener noreferrer","aria-label":"Myka on TikTok",display:"inline-flex",alignItems:"center",justifyContent:"center",lineHeight:0,color:o.gray[600],_hover:{color:o.navy[500],textDecoration:"none"},children:e.jsx(J,{"aria-hidden":!0})})]})]})]})})})]})})]})};export{$e as default};
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.