import{d as Dt,j as a,L as Ot,C as Ct,R as vt,r as te,B as It,v as tn,c as Ue,S as nn,V as Fe,a5 as an}from"./index-CJ26T8nM.js";import{C as Et}from"./card-DVvLGBob.js";import{S as rn}from"./skeleton-ChCpNj_n.js";import{I as on}from"./image-CQmPIf3M.js";import{R as sn}from"./rotate-ccw-BCfA_rsI.js";import{S as ln}from"./ShareCard-6kcvHs6G.js";import{b as cn}from"./useBlogData-D958aAFA.js";import{B as un}from"./BreadcrumbNavigation-DO0Fhgk5.js";import{A as mn}from"./arrow-left-CfPT7QuA.js";import{C as fn}from"./calendar-BCDwj0F4.js";import{C as dn}from"./clock-C5b7Nd5i.js";/*! @license DOMPurify 3.3.1 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.1/LICENSE */const{entries:Mt,setPrototypeOf:At,isFrozen:pn,getPrototypeOf:gn,getOwnPropertyDescriptor:hn}=Object;let{freeze:N,seal:I,create:Ye}=Object,{apply:Xe,construct:Ve}=typeof Reflect<"u"&&Reflect;N||(N=function(r){return r});I||(I=function(r){return r});Xe||(Xe=function(r,l){for(var t=arguments.length,u=new Array(t>2?t-2:0),c=2;c<t;c++)u[c-2]=arguments[c];return r.apply(l,u)});Ve||(Ve=function(r){for(var l=arguments.length,t=new Array(l>1?l-1:0),u=1;u<l;u++)t[u-1]=arguments[u];return new r(...t)});const Ee=y(Array.prototype.forEach),Tn=y(Array.prototype.lastIndexOf),xt=y(Array.prototype.pop),se=y(Array.prototype.push),_n=y(Array.prototype.splice),xe=y(String.prototype.toLowerCase),He=y(String.prototype.toString),ze=y(String.prototype.match),ie=y(String.prototype.replace),En=y(String.prototype.indexOf),An=y(String.prototype.trim),P=y(Object.prototype.hasOwnProperty),S=y(RegExp.prototype.test),le=xn(TypeError);function y(s){return function(r){r instanceof RegExp&&(r.lastIndex=0);for(var l=arguments.length,t=new Array(l>1?l-1:0),u=1;u<l;u++)t[u-1]=arguments[u];return Xe(s,r,t)}}function xn(s){return function(){for(var r=arguments.length,l=new Array(r),t=0;t<r;t++)l[t]=arguments[t];return Ve(s,l)}}function m(s,r){let l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:xe;At&&At(s,null);let t=r.length;for(;t--;){let u=r[t];if(typeof u=="string"){const c=l(u);c!==u&&(pn(r)||(r[t]=c),u=c)}s[u]=!0}return s}function bn(s){for(let r=0;r<s.length;r++)P(s,r)||(s[r]=null);return s}function F(s){const r=Ye(null);for(const[l,t]of Mt(s))P(s,l)&&(Array.isArray(t)?r[l]=bn(t):t&&typeof t=="object"&&t.constructor===Object?r[l]=F(t):r[l]=t);return r}function ce(s,r){for(;s!==null;){const t=hn(s,r);if(t){if(t.get)return y(t.get);if(typeof t.value=="function")return y(t.value)}s=gn(s)}function l(){return null}return l}const bt=N(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Be=N(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),We=N(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Sn=N(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Ge=N(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Nn=N(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),St=N(["#text"]),Nt=N(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),$e=N(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),yt=N(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ae=N(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),yn=I(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Rn=I(/<%[\w\W]*|[\w\W]*%>/gm),wn=I(/\$\{[\w\W]*/gm),Ln=I(/^data-[\-\w.\u00B7-\uFFFF]+$/),Dn=I(/^aria-[\-\w]+$/),Pt=I(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),On=I(/^(?:\w+script|data):/i),Cn=I(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),jt=I(/^html$/i),vn=I(/^[a-z][.\w]*(-[.\w]+)+$/i);var Rt=Object.freeze({__proto__:null,ARIA_ATTR:Dn,ATTR_WHITESPACE:Cn,CUSTOM_ELEMENT:vn,DATA_ATTR:Ln,DOCTYPE_NAME:jt,ERB_EXPR:Rn,IS_ALLOWED_URI:Pt,IS_SCRIPT_OR_DATA:On,MUSTACHE_EXPR:yn,TMPLIT_EXPR:wn});const ue={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},In=function(){return typeof window>"u"?null:window},Mn=function(r,l){if(typeof r!="object"||typeof r.createPolicy!="function")return null;let t=null;const u="data-tt-policy-suffix";l&&l.hasAttribute(u)&&(t=l.getAttribute(u));const c="dompurify"+(t?"#"+t:"");try{return r.createPolicy(c,{createHTML(R){return R},createScriptURL(R){return R}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},wt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function kt(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:In();const r=i=>kt(i);if(r.version="3.3.1",r.removed=[],!s||!s.document||s.document.nodeType!==ue.document||!s.Element)return r.isSupported=!1,r;let{document:l}=s;const t=l,u=t.currentScript,{DocumentFragment:c,HTMLTemplateElement:R,Node:v,Element:w,NodeFilter:T,NamedNodeMap:C=s.NamedNodeMap||s.MozNamedAttrMap,HTMLFormElement:j,DOMParser:H,trustedTypes:L}=s,M=w.prototype,G=ce(M,"cloneNode"),D=ce(M,"remove"),$=ce(M,"nextSibling"),Ut=ce(M,"childNodes"),me=ce(M,"parentNode");if(typeof R=="function"){const i=l.createElement("template");i.content&&i.content.ownerDocument&&(l=i.content.ownerDocument)}let x,ne="";const{implementation:be,createNodeIterator:Ft,createDocumentFragment:Ht,getElementsByTagName:zt}=l,{importNode:Bt}=t;let b=wt();r.isSupported=typeof Mt=="function"&&typeof me=="function"&&be&&be.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:Se,ERB_EXPR:Ne,TMPLIT_EXPR:ye,DATA_ATTR:Wt,ARIA_ATTR:Gt,IS_SCRIPT_OR_DATA:$t,ATTR_WHITESPACE:qe,CUSTOM_ELEMENT:Yt}=Rt;let{IS_ALLOWED_URI:Ke}=Rt,h=null;const Ze=m({},[...bt,...Be,...We,...Ge,...St]);let _=null;const Je=m({},[...Nt,...$e,...yt,...Ae]);let d=Object.seal(Ye(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ae=null,Re=null;const V=Object.seal(Ye(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Qe=!0,we=!0,et=!1,tt=!0,q=!1,fe=!0,Y=!1,Le=!1,De=!1,K=!1,de=!1,pe=!1,nt=!0,at=!1;const Xt="user-content-";let Oe=!0,re=!1,Z={},k=null;const Ce=m({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let rt=null;const ot=m({},["audio","video","img","source","image","track"]);let ve=null;const st=m({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ge="http://www.w3.org/1998/Math/MathML",he="http://www.w3.org/2000/svg",z="http://www.w3.org/1999/xhtml";let J=z,Ie=!1,Me=null;const Vt=m({},[ge,he,z],He);let Te=m({},["mi","mo","mn","ms","mtext"]),_e=m({},["annotation-xml"]);const qt=m({},["title","style","font","a","script"]);let oe=null;const Kt=["application/xhtml+xml","text/html"],Zt="text/html";let g=null,Q=null;const Jt=l.createElement("form"),it=function(e){return e instanceof RegExp||e instanceof Function},Pe=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Q&&Q===e)){if((!e||typeof e!="object")&&(e={}),e=F(e),oe=Kt.indexOf(e.PARSER_MEDIA_TYPE)===-1?Zt:e.PARSER_MEDIA_TYPE,g=oe==="application/xhtml+xml"?He:xe,h=P(e,"ALLOWED_TAGS")?m({},e.ALLOWED_TAGS,g):Ze,_=P(e,"ALLOWED_ATTR")?m({},e.ALLOWED_ATTR,g):Je,Me=P(e,"ALLOWED_NAMESPACES")?m({},e.ALLOWED_NAMESPACES,He):Vt,ve=P(e,"ADD_URI_SAFE_ATTR")?m(F(st),e.ADD_URI_SAFE_ATTR,g):st,rt=P(e,"ADD_DATA_URI_TAGS")?m(F(ot),e.ADD_DATA_URI_TAGS,g):ot,k=P(e,"FORBID_CONTENTS")?m({},e.FORBID_CONTENTS,g):Ce,ae=P(e,"FORBID_TAGS")?m({},e.FORBID_TAGS,g):F({}),Re=P(e,"FORBID_ATTR")?m({},e.FORBID_ATTR,g):F({}),Z=P(e,"USE_PROFILES")?e.USE_PROFILES:!1,Qe=e.ALLOW_ARIA_ATTR!==!1,we=e.ALLOW_DATA_ATTR!==!1,et=e.ALLOW_UNKNOWN_PROTOCOLS||!1,tt=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,q=e.SAFE_FOR_TEMPLATES||!1,fe=e.SAFE_FOR_XML!==!1,Y=e.WHOLE_DOCUMENT||!1,K=e.RETURN_DOM||!1,de=e.RETURN_DOM_FRAGMENT||!1,pe=e.RETURN_TRUSTED_TYPE||!1,De=e.FORCE_BODY||!1,nt=e.SANITIZE_DOM!==!1,at=e.SANITIZE_NAMED_PROPS||!1,Oe=e.KEEP_CONTENT!==!1,re=e.IN_PLACE||!1,Ke=e.ALLOWED_URI_REGEXP||Pt,J=e.NAMESPACE||z,Te=e.MATHML_TEXT_INTEGRATION_POINTS||Te,_e=e.HTML_INTEGRATION_POINTS||_e,d=e.CUSTOM_ELEMENT_HANDLING||{},e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(d.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&it(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(d.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(d.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),q&&(we=!1),de&&(K=!0),Z&&(h=m({},St),_=[],Z.html===!0&&(m(h,bt),m(_,Nt)),Z.svg===!0&&(m(h,Be),m(_,$e),m(_,Ae)),Z.svgFilters===!0&&(m(h,We),m(_,$e),m(_,Ae)),Z.mathMl===!0&&(m(h,Ge),m(_,yt),m(_,Ae))),e.ADD_TAGS&&(typeof e.ADD_TAGS=="function"?V.tagCheck=e.ADD_TAGS:(h===Ze&&(h=F(h)),m(h,e.ADD_TAGS,g))),e.ADD_ATTR&&(typeof e.ADD_ATTR=="function"?V.attributeCheck=e.ADD_ATTR:(_===Je&&(_=F(_)),m(_,e.ADD_ATTR,g))),e.ADD_URI_SAFE_ATTR&&m(ve,e.ADD_URI_SAFE_ATTR,g),e.FORBID_CONTENTS&&(k===Ce&&(k=F(k)),m(k,e.FORBID_CONTENTS,g)),e.ADD_FORBID_CONTENTS&&(k===Ce&&(k=F(k)),m(k,e.ADD_FORBID_CONTENTS,g)),Oe&&(h["#text"]=!0),Y&&m(h,["html","head","body"]),h.table&&(m(h,["tbody"]),delete ae.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw le('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');x=e.TRUSTED_TYPES_POLICY,ne=x.createHTML("")}else x===void 0&&(x=Mn(L,u)),x!==null&&typeof ne=="string"&&(ne=x.createHTML(""));N&&N(e),Q=e}},lt=m({},[...Be,...We,...Sn]),ct=m({},[...Ge,...Nn]),Qt=function(e){let n=me(e);(!n||!n.tagName)&&(n={namespaceURI:J,tagName:"template"});const o=xe(e.tagName),f=xe(n.tagName);return Me[e.namespaceURI]?e.namespaceURI===he?n.namespaceURI===z?o==="svg":n.namespaceURI===ge?o==="svg"&&(f==="annotation-xml"||Te[f]):!!lt[o]:e.namespaceURI===ge?n.namespaceURI===z?o==="math":n.namespaceURI===he?o==="math"&&_e[f]:!!ct[o]:e.namespaceURI===z?n.namespaceURI===he&&!_e[f]||n.namespaceURI===ge&&!Te[f]?!1:!ct[o]&&(qt[o]||!lt[o]):!!(oe==="application/xhtml+xml"&&Me[e.namespaceURI]):!1},U=function(e){se(r.removed,{element:e});try{me(e).removeChild(e)}catch{D(e)}},X=function(e,n){try{se(r.removed,{attribute:n.getAttributeNode(e),from:n})}catch{se(r.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e==="is")if(K||de)try{U(n)}catch{}else try{n.setAttribute(e,"")}catch{}},ut=function(e){let n=null,o=null;if(De)e="<remove></remove>"+e;else{const p=ze(e,/^[\r\n\t ]+/);o=p&&p[0]}oe==="application/xhtml+xml"&&J===z&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const f=x?x.createHTML(e):e;if(J===z)try{n=new H().parseFromString(f,oe)}catch{}if(!n||!n.documentElement){n=be.createDocument(J,"template",null);try{n.documentElement.innerHTML=Ie?ne:f}catch{}}const A=n.body||n.documentElement;return e&&o&&A.insertBefore(l.createTextNode(o),A.childNodes[0]||null),J===z?zt.call(n,Y?"html":"body")[0]:Y?n.documentElement:A},mt=function(e){return Ft.call(e.ownerDocument||e,e,T.SHOW_ELEMENT|T.SHOW_COMMENT|T.SHOW_TEXT|T.SHOW_PROCESSING_INSTRUCTION|T.SHOW_CDATA_SECTION,null)},je=function(e){return e instanceof j&&(typeof e.nodeName!="string"||typeof e.textContent!="string"||typeof e.removeChild!="function"||!(e.attributes instanceof C)||typeof e.removeAttribute!="function"||typeof e.setAttribute!="function"||typeof e.namespaceURI!="string"||typeof e.insertBefore!="function"||typeof e.hasChildNodes!="function")},ft=function(e){return typeof v=="function"&&e instanceof v};function B(i,e,n){Ee(i,o=>{o.call(r,e,n,Q)})}const dt=function(e){let n=null;if(B(b.beforeSanitizeElements,e,null),je(e))return U(e),!0;const o=g(e.nodeName);if(B(b.uponSanitizeElement,e,{tagName:o,allowedTags:h}),fe&&e.hasChildNodes()&&!ft(e.firstElementChild)&&S(/<[/\w!]/g,e.innerHTML)&&S(/<[/\w!]/g,e.textContent)||e.nodeType===ue.progressingInstruction||fe&&e.nodeType===ue.comment&&S(/<[/\w]/g,e.data))return U(e),!0;if(!(V.tagCheck instanceof Function&&V.tagCheck(o))&&(!h[o]||ae[o])){if(!ae[o]&&gt(o)&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,o)||d.tagNameCheck instanceof Function&&d.tagNameCheck(o)))return!1;if(Oe&&!k[o]){const f=me(e)||e.parentNode,A=Ut(e)||e.childNodes;if(A&&f){const p=A.length;for(let O=p-1;O>=0;--O){const W=G(A[O],!0);W.__removalCount=(e.__removalCount||0)+1,f.insertBefore(W,$(e))}}}return U(e),!0}return e instanceof w&&!Qt(e)||(o==="noscript"||o==="noembed"||o==="noframes")&&S(/<\/no(script|embed|frames)/i,e.innerHTML)?(U(e),!0):(q&&e.nodeType===ue.text&&(n=e.textContent,Ee([Se,Ne,ye],f=>{n=ie(n,f," ")}),e.textContent!==n&&(se(r.removed,{element:e.cloneNode()}),e.textContent=n)),B(b.afterSanitizeElements,e,null),!1)},pt=function(e,n,o){if(nt&&(n==="id"||n==="name")&&(o in l||o in Jt))return!1;if(!(we&&!Re[n]&&S(Wt,n))){if(!(Qe&&S(Gt,n))){if(!(V.attributeCheck instanceof Function&&V.attributeCheck(n,e))){if(!_[n]||Re[n]){if(!(gt(e)&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,e)||d.tagNameCheck instanceof Function&&d.tagNameCheck(e))&&(d.attributeNameCheck instanceof RegExp&&S(d.attributeNameCheck,n)||d.attributeNameCheck instanceof Function&&d.attributeNameCheck(n,e))||n==="is"&&d.allowCustomizedBuiltInElements&&(d.tagNameCheck instanceof RegExp&&S(d.tagNameCheck,o)||d.tagNameCheck instanceof Function&&d.tagNameCheck(o))))return!1}else if(!ve[n]){if(!S(Ke,ie(o,qe,""))){if(!((n==="src"||n==="xlink:href"||n==="href")&&e!=="script"&&En(o,"data:")===0&&rt[e])){if(!(et&&!S($t,ie(o,qe,"")))){if(o)return!1}}}}}}}return!0},gt=function(e){return e!=="annotation-xml"&&ze(e,Yt)},ht=function(e){B(b.beforeSanitizeAttributes,e,null);const{attributes:n}=e;if(!n||je(e))return;const o={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:_,forceKeepAttr:void 0};let f=n.length;for(;f--;){const A=n[f],{name:p,namespaceURI:O,value:W}=A,ee=g(p),ke=W;let E=p==="value"?ke:An(ke);if(o.attrName=ee,o.attrValue=E,o.keepAttr=!0,o.forceKeepAttr=void 0,B(b.uponSanitizeAttribute,e,o),E=o.attrValue,at&&(ee==="id"||ee==="name")&&(X(p,e),E=Xt+E),fe&&S(/((--!?|])>)|<\/(style|title|textarea)/i,E)){X(p,e);continue}if(ee==="attributename"&&ze(E,"href")){X(p,e);continue}if(o.forceKeepAttr)continue;if(!o.keepAttr){X(p,e);continue}if(!tt&&S(/\/>/i,E)){X(p,e);continue}q&&Ee([Se,Ne,ye],_t=>{E=ie(E,_t," ")});const Tt=g(e.nodeName);if(!pt(Tt,ee,E)){X(p,e);continue}if(x&&typeof L=="object"&&typeof L.getAttributeType=="function"&&!O)switch(L.getAttributeType(Tt,ee)){case"TrustedHTML":{E=x.createHTML(E);break}case"TrustedScriptURL":{E=x.createScriptURL(E);break}}if(E!==ke)try{O?e.setAttributeNS(O,p,E):e.setAttribute(p,E),je(e)?U(e):xt(r.removed)}catch{X(p,e)}}B(b.afterSanitizeAttributes,e,null)},en=function i(e){let n=null;const o=mt(e);for(B(b.beforeSanitizeShadowDOM,e,null);n=o.nextNode();)B(b.uponSanitizeShadowNode,n,null),dt(n),ht(n),n.content instanceof c&&i(n.content);B(b.afterSanitizeShadowDOM,e,null)};return r.sanitize=function(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=null,o=null,f=null,A=null;if(Ie=!i,Ie&&(i="<!-->"),typeof i!="string"&&!ft(i))if(typeof i.toString=="function"){if(i=i.toString(),typeof i!="string")throw le("dirty is not a string, aborting")}else throw le("toString is not a function");if(!r.isSupported)return i;if(Le||Pe(e),r.removed=[],typeof i=="string"&&(re=!1),re){if(i.nodeName){const W=g(i.nodeName);if(!h[W]||ae[W])throw le("root node is forbidden and cannot be sanitized in-place")}}else if(i instanceof v)n=ut("<!---->"),o=n.ownerDocument.importNode(i,!0),o.nodeType===ue.element&&o.nodeName==="BODY"||o.nodeName==="HTML"?n=o:n.appendChild(o);else{if(!K&&!q&&!Y&&i.indexOf("<")===-1)return x&&pe?x.createHTML(i):i;if(n=ut(i),!n)return K?null:pe?ne:""}n&&De&&U(n.firstChild);const p=mt(re?i:n);for(;f=p.nextNode();)dt(f),ht(f),f.content instanceof c&&en(f.content);if(re)return i;if(K){if(de)for(A=Ht.call(n.ownerDocument);n.firstChild;)A.appendChild(n.firstChild);else A=n;return(_.shadowroot||_.shadowrootmode)&&(A=Bt.call(t,A,!0)),A}let O=Y?n.outerHTML:n.innerHTML;return Y&&h["!doctype"]&&n.ownerDocument&&n.ownerDocument.doctype&&n.ownerDocument.doctype.name&&S(jt,n.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+n.ownerDocument.doctype.name+`>
`+O),q&&Ee([Se,Ne,ye],W=>{O=ie(O,W," ")}),x&&pe?x.createHTML(O):O},r.setConfig=function(){let i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe(i),Le=!0},r.clearConfig=function(){Q=null,Le=!1},r.isValidAttribute=function(i,e,n){Q||Pe({});const o=g(i),f=g(e);return pt(o,f,n)},r.addHook=function(i,e){typeof e=="function"&&se(b[i],e)},r.removeHook=function(i,e){if(e!==void 0){const n=Tn(b[i],e);return n===-1?void 0:_n(b[i],n,1)[0]}return xt(b[i])},r.removeHooks=function(i){b[i]=[]},r.removeAllHooks=function(){b=wt()},r}var Pn=kt();const Lt=s=>!s||!s.includes("StorySparkle")?s:s.split(/(StorySparkle)/g).map((l,t)=>l==="StorySparkle"?a.jsx(Ct,{variant:"inline"},t):a.jsx(vt.Fragment,{children:l},t)),jn=({src:s,alt:r,width:l,height:t,caption:u})=>{const[c,R]=te.useState(!0),[v,w]=te.useState(!1),[T,C]=te.useState(0),j=2,H=te.useCallback(()=>{R(!1),w(!1)},[]),L=te.useCallback(()=>{R(!1),w(!0)},[]),M=te.useCallback(()=>{if(T<j){C($=>$+1),R(!0),w(!1);const D=new Image;D.onload=H,D.onerror=L,D.src=`${s}?t=${Date.now()}`}},[s,T,j,H,L]);if(v)return a.jsxs("figure",{className:"mb-6 flex flex-col items-center",children:[a.jsxs("div",{className:"flex flex-col items-center justify-center bg-muted rounded-lg p-8 min-h-[200px]",children:[a.jsx(on,{className:"h-12 w-12 text-muted-foreground mb-4"}),a.jsx("p",{className:"text-sm text-muted-foreground mb-4 text-center",children:"Image failed to load"}),T<j&&a.jsxs(It,{variant:"outline",size:"sm",onClick:M,className:"flex items-center gap-2",children:[a.jsx(sn,{className:"h-4 w-4"}),"Retry (",T+1,"/",j+1,")"]})]}),u&&a.jsx("figcaption",{className:"text-sm text-muted-foreground mt-2 text-center italic",children:u})]});const G=l&&l!=="auto"||t&&t!=="auto";return a.jsxs("figure",{className:"mb-6 flex flex-col items-center",children:[a.jsxs("div",{className:"relative w-full",style:G?void 0:{aspectRatio:"16 / 9",maxWidth:"100%"},children:[c&&a.jsx(rn,{className:"absolute inset-0 rounded-lg w-full h-full"}),a.jsx("img",{src:T>0?`${s}?t=${Date.now()}`:s,alt:r,width:G?void 0:1200,height:G?void 0:675,loading:"lazy",decoding:"async",onLoad:H,onError:L,className:`rounded-lg shadow-md transition-opacity ${c?"opacity-0":"opacity-100"}`,style:{width:l&&l!=="auto"?l:"100%",height:t&&t!=="auto"?t:"auto",aspectRatio:G?void 0:"16 / 9",objectFit:"cover",maxWidth:"100%"}})]}),u&&a.jsx("figcaption",{className:"text-sm text-muted-foreground mt-2 text-center italic",children:u})]})},kn=({content:s})=>{const{getLocalizedPath:r}=Dt(),l=(t,u)=>{switch(t.type){case"paragraph":return a.jsx("p",{className:"mb-4 leading-relaxed",children:Lt(t.data.text||"")},u);case"heading":const c=`h${t.data.level||2}`;return a.jsx(c,{className:`font-bold mb-4 ${t.data.level===1?"text-3xl":t.data.level===2?"text-2xl":t.data.level===3?"text-xl":"text-lg"}`,children:Lt(t.data.text||"")},u);case"image":return a.jsx(jn,{src:t.data.url,alt:t.data.alt||"",width:t.data.width,height:t.data.height,caption:t.data.caption},u);case"youtube":return a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"aspect-video",children:a.jsx("iframe",{src:`https://www.youtube.com/embed/${t.data.videoId}`,title:t.data.title||"YouTube video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full rounded-lg"})}),t.data.title&&a.jsx("p",{className:"text-sm text-muted-foreground mt-2 text-center",children:t.data.title})]},u);case"quote":return a.jsxs(Et,{className:"border-l-4 border-nature-coral bg-nature-yellow/10 p-6 mb-6",children:[a.jsxs("blockquote",{className:"text-lg italic",children:['"',t.data.text,'"']}),t.data.author&&a.jsxs("cite",{className:"block text-sm text-muted-foreground mt-2",children:["— ",t.data.author]})]},u);case"list":const R=t.data.style==="ordered"?"ol":"ul";return a.jsx(R,{className:`mb-4 ml-6 ${t.data.style==="ordered"?"list-decimal":"list-disc"}`,children:t.data.items.map((v,w)=>a.jsx("li",{className:"mb-1",children:v},w))},u);case"rich-text":return a.jsx("div",{className:"mb-4 leading-relaxed",dangerouslySetInnerHTML:{__html:Pn.sanitize(t.data.html||"",{ALLOWED_TAGS:["b","i","u","br","p","a","strong","em","h1","h2","h3","h4","ul","ol","li","span","div","blockquote"],ALLOWED_ATTR:["href","target","rel","class","style"]})}},u);case"button":{const v=t.data.label||"Click here",w=t.data.url||"",T=t.data.variant||"primary",C=t.data.align||"center",j=T==="primary"?"bg-nature-coral text-white hover:bg-nature-coral/90":T==="secondary"?"bg-nature-green text-white hover:bg-nature-green/90":T==="outline"?"border-2 border-nature-coral text-nature-coral bg-transparent hover:bg-nature-coral/10":"bg-transparent text-nature-coral hover:bg-nature-coral/10",H=C==="left"?"justify-start":C==="right"?"justify-end":"justify-center",L=`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-semibold uppercase tracking-wide h-11 px-8 transition-all duration-300 hover:scale-[1.02] active:scale-[0.98] ${j}`,M=w.startsWith("/");return a.jsx("div",{className:`mb-6 flex ${H}`,children:M?a.jsx(Ot,{to:r(w),className:L,children:v}):a.jsx("a",{href:w,target:"_blank",rel:"noopener noreferrer",className:L,children:v})},u)}case"link":return a.jsx(Et,{className:"p-4 mb-6 border border-nature-green/20",children:a.jsxs("a",{href:t.data.url,target:"_blank",rel:"noopener noreferrer",className:"block hover:bg-nature-green/5 transition-colors rounded",children:[a.jsx("h4",{className:"font-semibold text-nature-green mb-1",children:t.data.title}),t.data.description&&a.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:t.data.description}),a.jsx("p",{className:"text-xs text-muted-foreground",children:t.data.url})]})},u);default:return null}};return a.jsx("div",{className:"prose prose-lg max-w-none",children:s.blocks.map((t,u)=>l(t,u))})},Un=s=>!s||!s.includes("StorySparkle")?s:s.split(/(StorySparkle)/g).map((l,t)=>l==="StorySparkle"?a.jsx(Ct,{variant:"inline"},t):a.jsx(vt.Fragment,{children:l},t)),Kn=()=>{const{slug:s}=tn(),{t:r}=Ue("blog"),{t:l}=Ue("newsletter"),{t}=Ue("navbar"),{getLocalizedPath:u}=Dt(),{post:c,loading:R,error:v}=cn(s||""),w=typeof window<"u"&&window.location.pathname.includes("/blog/newsletter/"),T=c?.categories?.some(D=>D?.slug==="newsletter")??!1,C=w||T,j=C?l("title"):"Blog",H=C?"/blog/newsletter":"/blog",L=C?`/blog/newsletter/${c?.slug}`:`/blog/${c?.slug}`,M=C?l("backToNewsletter"):r("backToBlog");if(R)return a.jsx("div",{className:"min-h-screen bg-gradient-to-b from-teal-100 via-yellow-200 to-red-300",children:a.jsx("div",{className:"container mx-auto px-4 py-8",children:a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-6"}),a.jsx("div",{className:"h-12 bg-gray-200 rounded w-3/4 mb-4"}),a.jsx("div",{className:"aspect-[16/9] bg-gray-200 rounded mb-6 w-full"}),a.jsx("div",{className:"space-y-4",children:[...Array(5)].map((D,$)=>a.jsx("div",{className:"h-4 bg-gray-200 rounded"},$))})]})})});if(v||!c)return a.jsx("div",{className:"min-h-screen bg-gradient-to-b from-teal-100 via-yellow-200 to-red-300",children:a.jsxs("div",{className:"container mx-auto px-4 py-8 text-center",children:[a.jsx("h1",{className:"text-2xl font-bold mb-4",children:"Post Not Found"}),a.jsx(Ot,{to:u(H),children:a.jsxs(It,{children:[a.jsx(mn,{className:"mr-2 h-4 w-4"}),M]})})]})});const G=c.published_at?new Date(c.published_at).toLocaleDateString():"";return a.jsxs("div",{className:C?"min-h-screen bg-gradient-to-b from-amber-50 via-white to-amber-50/40":"min-h-screen bg-gradient-to-b from-teal-100 via-yellow-200 to-red-300",children:[a.jsx(nn,{title:c.seo_title||`${c.title} | StorySparkle Blog`,description:c.seo_description||c.excerpt,canonical:u(L),ogImage:c.featured_image}),a.jsxs("article",{className:"container mx-auto px-4 py-8",children:[a.jsx(un,{items:[{name:t("home"),path:"/"},{name:t("blog"),path:"/blog"},...C?[{name:j,path:"/blog/newsletter"}]:[],{name:c.title,path:L}]}),a.jsxs("header",{className:"mb-8",children:[a.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[c.categories?.map(D=>a.jsx(Fe,{variant:"outline",style:{borderColor:D.color},children:D.name},D.id)),c.is_featured&&a.jsx(Fe,{className:"bg-nature-coral",children:"Featured"})]}),a.jsx("h1",{className:"text-4xl font-bold mb-6",children:Un(c.title)}),c.featured_image&&a.jsx("img",{src:c.featured_image,alt:c.title,width:1200,height:675,fetchPriority:"high",decoding:"async",className:"rounded-xl shadow-md mb-8 w-full object-cover",style:{aspectRatio:"16 / 9",height:"auto"}}),a.jsxs("div",{className:"flex flex-wrap items-center gap-6 text-sm text-muted-foreground mb-6",children:[c.author?.username&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(an,{className:"h-4 w-4"}),r("byAuthor",{author:c.author.username})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(fn,{className:"h-4 w-4"}),r("publishedOn",{date:G})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dn,{className:"h-4 w-4"}),r("readingTime",{minutes:c.reading_time_minutes})]})]})]}),a.jsx("div",{className:"max-w-4xl mx-auto",children:a.jsx(kn,{content:c.content})}),a.jsx("footer",{className:"mt-12 pt-8 border-t",children:a.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-start lg:items-center gap-4",children:[a.jsx(ln,{heading:r("sharing.title"),subheading:r("sharing.description"),title:c.title,description:c.excerpt,url:`${window.location.origin}${u(`/blog/${c.slug}`)}`}),c.tags&&c.tags.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold mb-2",children:r("tags")}),a.jsx("div",{className:"flex flex-wrap gap-2",children:c.tags.map((D,$)=>a.jsx(Fe,{variant:"secondary",children:D},$))})]})]})})]})]})};export{Kn as default};
//# sourceMappingURL=BlogPostPage-DOHFGJFo.js.map