PageSourceSearch

https://mymixtapez.com/assets/ArticlePage-Co7ZZOoa.js

js mymixtapez.com collected 2026-10-02 03:08:21 UTC 90,298 bytes, 4 lines download raw bytes

vendor: 8,113 bytes, lines 1-2
1import{j as e,u as te,b as wr,c as Qe}from"./vendor-query-Bkm-AnxV.js";import{r as I,L as ce,d as zr,e as Hr}from"./vendor-react-BnwK1D2k.js";import{c as me,s as O,u as Br,A as Ze,b as ge,O as rr,r as ue,d as Ie,N as Wr,e as qr,g as vr,f as Gr,h as Kr,t as Fe,i as bt,T as yt,F as wt,j as Vr,k as Yr,l as Xr,S as Qr,m as Zr}from"./index-DoQntO5o.js";import{B as Jr}from"./BreadcrumbNav-D3AqjYkD.js";import{Y as es,Z as rt,P as ts,o as rs,T as Je,F as Nr,p as ze,q as et,r as _r,I as St,s as tt,L as Et,t as jr,u as ss,v as as,D as ns,w as os,A as is,x as ls,y as cs,h as ds,X as Rt,i as ms,z as Tr,J as Sr,K as us,N as ps}from"./vendor-icons-rmnQtO5I.js";import{N as sr}from"./NewsCard-e2O8xJyu.js";import{S as fs}from"./vendor-ui-DZdGTq1A.js";import{trackArticleRead as hs}from"./ForYouFeed-DElRg5ab.js";import{g as gs}from"./authors-TBeQvGAA.js";import"./vendor-charts-It_sMlt-.js";import"./vendor-supabase-TCxDE-Il.js";/*! @license DOMPurify 3.4.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.3/LICENSE */function ar(r,a){(a==null||a>r.length)&&(a=r.length);for(var t=0,n=Array(a);t<a;t++)n[t]=r[t];return n}function xs(r){if(Array.isArray(r))return r}function bs(r,a){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,l,i,c,d=[],g=!0,w=!1;try{if(i=(t=t.call(r)).next,a!==0)for(;!(g=(n=i.call(t)).done)&&(d.push(n.value),d.length!==a);g=!0);}catch(h){w=!0,l=h}finally{try{if(!g&&t.return!=null&&(c=t.return(),Object(c)!==c))return}finally{if(w)throw l}}return d}}function ys(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ws(r,a){return xs(r)||bs(r,a)||vs(r,a)||ys()}function vs(r,a){if(r){if(typeof r=="string")return ar(r,a);var t={}.toString.call(r).slice(8,-1);return t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set"?Array.from(r):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ar(r,a):void 0}}const Er=Object.entries,nr=Object.setPrototypeOf,Ns=Object.isFrozen,_s=Object.getPrototypeOf,js=Object.getOwnPropertyDescriptor;let Z=Object.freeze,se=Object.seal,Ce=Object.create,Ar=typeof Reflect<"u"&&Reflect,At=Ar.apply,kt=Ar.construct;Z||(Z=function(a){return a});se||(se=function(a){return a});At||(At=function(a,t){for(var n=arguments.length,l=new Array(n>2?n-2:0),i=2;i<n;i++)l[i-2]=arguments[i];return a.apply(t,l)});kt||(kt=function(a){for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return new a(...n)});const Se=H(Array.prototype.forEach),Ts=H(Array.prototype.lastIndexOf),or=H(Array.prototype.pop),Ee=H(Array.prototype.push),Ss=H(Array.prototype.splice),Q=Array.isArray,Ue=H(String.prototype.toLowerCase),vt=H(String.prototype.toString),ir=H(String.prototype.match),Ae=H(String.prototype.replace),lr=H(String.prototype.indexOf),Es=H(String.prototype.trim),As=H(Number.prototype.toString),ks=H(Boolean.prototype.toString),cr=typeof BigInt>"u"?null:H(BigInt.prototype.toString),dr=typeof Symbol>"u"?null:H(Symbol.prototype.toString),F=H(Object.prototype.hasOwnProperty),$e=H(Object.prototype.toString),Y=H(RegExp.prototype.test),Ye=Cs(TypeError);function H(r){return function(a){a instanceof RegExp&&(a.lastIndex=0);for(var t=arguments.length,n=new Array(t>1?t-1:0),l=1;l<t;l++)n[l-1]=arguments[l];return At(r,a,n)}}function Cs(r){return function(){for(var a=arguments.length,t=new Array(a),n=0;n<a;n++)t[n]=arguments[n];return kt(r,t)}}function S(r,a){let t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ue;if(nr&&nr(r,null),!Q(a))return r;let n=a.length;for(;n--;){let l=a[n];if(typeof l=="string"){const i=t(l);i!==l&&(Ns(a)||(a[n]=i),l=i)}r[l]=!0}return r}function Rs(r){for(let a=0;a<r.length;a++)F(r,a)||(r[a]=null);return r}function ee(r){const a=Ce(null);for(const n of Er(r)){var t=ws(n,2);const l=t[0],i=t[1];F(r,l)&&(Q(i)?a[l]=Rs(i):i&&typeof i=="object"&&i.constructor===Object?a[l]=ee(i):a[l]=i)}return a}function Is(r){switch(typeof r){case"string":return r;case"number":return As(r);case"boolean":return ks(r);case"bigint":return cr?cr(r):"0";case"symbol":return dr?dr(r):"Symbol()";case"undefined":return $e(r);case"function":case"object":{if(r===null)return $e(r);const a=r,t=Re(a,"toString");if(typeof t=="function"){const n=t(a);return typeof n=="string"?n:$e(n)}return $e(r)}default:return $e(r)}}function Re(r,a){for(;r!==null;){const n=js(r,a);if(n){if(n.get)return H(n.get);if(typeof n.value=="function")return H(n.value)}r=_s(r)}function t(){return null}return t}function Os(r){try{return Y(r,""),!0}catch{return!1}}const mr=Z(["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"]),Nt=Z(["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"]),_t=Z(["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"]),Ds=Z(["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"]),jt=Z(["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"]),Ls=Z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ur=Z(["#text"]),pr=Z(["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","
2spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Tt=Z(["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"]),fr=Z(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","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"]),Xe=Z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ms=se(/{{[\w\W]*|^[\w\W]*}}/g),Ps=se(/<%[\w\W]*|^[\w\W]*%>/g),Fs=se(/\${[\w\W]*/g),$s=se(/^data-[\-\w.\u00B7-\uFFFF]+$/),Us=se(/^aria-[\-\w]+$/),hr=se(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),zs=se(/^(?:\w+script|data):/i),Hs=se(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Bs=se(/^html$/i),Ws=se(/^[a-z][.\w]*(-[.\w]+)+$/i),ke={element:1,text:3,progressingInstruction:7,comment:8,document:9},qs=function(){return typeof window>"u"?null:window},Gs=function(a,t){if(typeof a!="object"||typeof a.createPolicy!="function")return null;let n=null;const l="data-tt-policy-suffix";t&&t.hasAttribute(l)&&(n=t.getAttribute(l));const i="dompurify"+(n?"#"+n:"");try{return a.createPolicy(i,{createHTML(c){return c},createScriptURL(c){return c}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},gr=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function kr(){let r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:qs();const a=b=>kr(b);if(a.version="3.4.3",a.removed=[],!r||!r.document||r.document.nodeType!==ke.document||!r.Element)return a.isSupported=!1,a;let t=r.document;const n=t,l=n.currentScript,i=r.DocumentFragment,c=r.HTMLTemplateElement,d=r.Node,g=r.Element,w=r.NodeFilter,h=r.NamedNodeMap,j=h===void 0?r.NamedNodeMap||r.MozNamedAttrMap:h,N=r.HTMLFormElement,_=r.DOMParser,f=r.trustedTypes,y=g.prototype,$=Re(y,"cloneNode"),x=Re(y,"remove"),C=Re(y,"nextSibling"),P=Re(y,"childNodes"),E=Re(y,"parentNode");if(typeof c=="function"){const b=t.createElement("template");b.content&&b.content.ownerDocument&&(t=b.content.ownerDocument)}let T,D="";const M=t,X=M.implementation,m=M.createNodeIterator,k=M.createDocumentFragment,pe=M.getElementsByTagName,xe=n.importNode;let p=gr();a.isSupported=typeof Er=="function"&&typeof E=="function"&&X&&X.createHTMLDocument!==void 0;const A=Ms,v=Ps,L=Fs,W=$s,fe=Us,He=zs,Oe=Hs,ve=Ws;let Ot=hr,q=null;const Dt=S({},[...mr,...Nt,..._t,...jt,...ur]);let V=null;const Lt=S({},[...pr,...Tt,...fr,...Xe]);
vendor: 13,028 bytes, lines 2-3
2let U=Object.seal(Ce(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}})),De=null,Be=null;const he=Object.seal(Ce(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Mt=!0,st=!0,Pt=!1,Ft=!0,be=!1,Le=!0,ye=!1,at=!1,nt=!1,Ne=!1,We=!1,qe=!1,$t=!0,Ut=!1;const zt="user-content-";let ot=!0,Me=!1,_e={},oe=null;const it=S({},["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 Ht=null;const Bt=S({},["audio","video","img","source","image","track"]);let lt=null;const Wt=S({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ge="http://www.w3.org/1998/Math/MathML",Ke="http://www.w3.org/2000/svg",ie="http://www.w3.org/1999/xhtml";let je=ie,ct=!1,dt=null;const Dr=S({},[Ge,Ke,ie],vt);let mt=S({},["mi","mo","mn","ms","mtext"]),ut=S({},["annotation-xml"]);const Lr=S({},["title","style","font","a","script"]);let Pe=null;const Mr=["application/xhtml+xml","text/html"],Pr="text/html";let B=null,Te=null;const Fr=t.createElement("form"),qt=function(s){return s instanceof RegExp||s instanceof Function},pt=function(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Te&&Te===s)return;(!s||typeof s!="object")&&(s={}),s=ee(s),Pe=Mr.indexOf(s.PARSER_MEDIA_TYPE)===-1?Pr:s.PARSER_MEDIA_TYPE,B=Pe==="application/xhtml+xml"?vt:Ue,q=F(s,"ALLOWED_TAGS")&&Q(s.ALLOWED_TAGS)?S({},s.ALLOWED_TAGS,B):Dt,V=F(s,"ALLOWED_ATTR")&&Q(s.ALLOWED_ATTR)?S({},s.ALLOWED_ATTR,B):Lt,dt=F(s,"ALLOWED_NAMESPACES")&&Q(s.ALLOWED_NAMESPACES)?S({},s.ALLOWED_NAMESPACES,vt):Dr,lt=F(s,"ADD_URI_SAFE_ATTR")&&Q(s.ADD_URI_SAFE_ATTR)?S(ee(Wt),s.ADD_URI_SAFE_ATTR,B):Wt,Ht=F(s,"ADD_DATA_URI_TAGS")&&Q(s.ADD_DATA_URI_TAGS)?S(ee(Bt),s.ADD_DATA_URI_TAGS,B):Bt,oe=F(s,"FORBID_CONTENTS")&&Q(s.FORBID_CONTENTS)?S({},s.FORBID_CONTENTS,B):it,De=F(s,"FORBID_TAGS")&&Q(s.FORBID_TAGS)?S({},s.FORBID_TAGS,B):ee({}),Be=F(s,"FORBID_ATTR")&&Q(s.FORBID_ATTR)?S({},s.FORBID_ATTR,B):ee({}),_e=F(s,"USE_PROFILES")?s.USE_PROFILES&&typeof s.USE_PROFILES=="object"?ee(s.USE_PROFILES):s.USE_PROFILES:!1,Mt=s.ALLOW_ARIA_ATTR!==!1,st=s.ALLOW_DATA_ATTR!==!1,Pt=s.ALLOW_UNKNOWN_PROTOCOLS||!1,Ft=s.ALLOW_SELF_CLOSE_IN_ATTR!==!1,be=s.SAFE_FOR_TEMPLATES||!1,Le=s.SAFE_FOR_XML!==!1,ye=s.WHOLE_DOCUMENT||!1,Ne=s.RETURN_DOM||!1,We=s.RETURN_DOM_FRAGMENT||!1,qe=s.RETURN_TRUSTED_TYPE||!1,nt=s.FORCE_BODY||!1,$t=s.SANITIZE_DOM!==!1,Ut=s.SANITIZE_NAMED_PROPS||!1,ot=s.KEEP_CONTENT!==!1,Me=s.IN_PLACE||!1,Ot=Os(s.ALLOWED_URI_REGEXP)?s.ALLOWED_URI_REGEXP:hr,je=typeof s.NAMESPACE=="string"?s.NAMESPACE:ie,mt=F(s,"MATHML_TEXT_INTEGRATION_POINTS")&&s.MATHML_TEXT_INTEGRATION_POINTS&&typeof s.MATHML_TEXT_INTEGRATION_POINTS=="object"?ee(s.MATHML_TEXT_INTEGRATION_POINTS):S({},["mi","mo","mn","ms","mtext"]),ut=F(s,"HTML_INTEGRATION_POINTS")&&s.HTML_INTEGRATION_POINTS&&typeof s.HTML_INTEGRATION_POINTS=="object"?ee(s.HTML_INTEGRATION_POINTS):S({},["annotation-xml"]);const o=F(s,"CUSTOM_ELEMENT_HANDLING")&&s.CUSTOM_ELEMENT_HANDLING&&typeof s.CUSTOM_ELEMENT_HANDLING=="object"?ee(s.CUSTOM_ELEMENT_HANDLING):Ce(null);if(U=Ce(null),F(o,"tagNameCheck")&&qt(o.tagNameCheck)&&(U.tagNameCheck=o.tagNameCheck),F(o,"attributeNameCheck")&&qt(o.attributeNameCheck)&&(U.attributeNameCheck=o.attributeNameCheck),F(o,"allowCustomizedBuiltInElements")&&typeof o.allowCustomizedBuiltInElements=="boolean"&&(U.allowCustomizedBuiltInElements=o.allowCustomizedBuiltInElements),be&&(st=!1),We&&(Ne=!0),_e&&(q=S({},ur),V=Ce(null),_e.html===!0&&(S(q,mr),S(V,pr)),_e.svg===!0&&(S(q,Nt),S(V,Tt),S(V,Xe)),_e.svgFilters===!0&&(S(q,_t),S(V,Tt),S(V,Xe)),_e.mathMl===!0&&(S(q,jt),S(V,fr),S(V,Xe))),he.tagCheck=null,he.attributeCheck=null,F(s,"ADD_TAGS")&&(typeof s.ADD_TAGS=="function"?he.tagCheck=s.ADD_TAGS:Q(s.ADD_TAGS)&&(q===Dt&&(q=ee(q)),S(q,s.ADD_TAGS,B))),F(s,"ADD_ATTR")&&(typeof s.ADD_ATTR=="function"?he.attributeCheck=s.ADD_ATTR:Q(s.ADD_ATTR)&&(V===Lt&&(V=ee(V)),S(V,s.ADD_ATTR,B))),F(s,"ADD_URI_SAFE_ATTR")&&Q(s.ADD_URI_SAFE_ATTR)&&S(lt,s.ADD_URI_SAFE_ATTR,B),F(s,"FORBID_CONTENTS")&&Q(s.FORBID_CONTENTS)&&(oe===it&&(oe=ee(oe)),S(oe,s.FORBID_CONTENTS,B)),F(s,"ADD_FORBID_CONTENTS")&&Q(s.ADD_FORBID_CONTENTS)&&(oe===it&&(oe=ee(oe)),S(oe,s.ADD_FORBID_CONTENTS,B)),ot&&(q["#text"]=!0),ye&&S(q,["html","head","body"]),q.table&&(S(q,["tbody"]),delete De.tbody),s.TRUSTED_TYPES_POLICY){if(typeof s.TRUSTED_TYPES_POLICY.createHTML!="function")throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof s.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Ye('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=s.TRUSTED_TYPES_POLICY,D=T.createHTML("")}else T===void 0&&(T=Gs(f,l)),T!==null&&typeof D=="string"&&(D=T.createHTML(""));Z&&Z(s),Te=s},Gt=S({},[...Nt,..._t,...Ds]),Kt=S({},[...jt,...Ls]),$r=function(s){let o=E(s);(!o||!o.tagName)&&(o={namespaceURI:je,tagName:"template"});const u=Ue(s.tagName),R=Ue(o.tagName);return dt[s.namespaceURI]?s.namespaceURI===Ke?o.namespaceURI===ie?u==="svg":o.namespaceURI===Ge?u==="svg"&&(R==="annotation-xml"||mt[R]):!!Gt[u]:s.namespaceURI===Ge?o.namespaceURI===ie?u==="math":o.namespaceURI===Ke?u==="math"&&ut[R]:!!Kt[u]:s.namespaceURI===ie?o.namespaceURI===Ke&&!ut[R]||o.namespaceURI===Ge&&!mt[R]?!1:!Kt[u]&&(Lr[u]||!Gt[u]):!!(Pe==="application/xhtml+xml"&&dt[s.namespaceURI]):!1},ae=function(s){Ee(a.removed,{element:s});try{E(s).removeChild(s)}catch{x(s)}},we=function(s,o){try{Ee(a.removed,{attribute:o.getAttributeNode(s),from:o})}catch{Ee(a.removed,{attribute:null,from:o})}if(o.removeAttribute(s),s==="is")if(Ne||We)try{ae(o)}catch{}else try{o.setAttribute(s,"")}catch{}},Vt=function(s){let o=null,u=null;if(nt)s="<remove></remove>"+s;else{const z=ir(s,/^[\r\n\t ]+/);u=z&&z[0]}Pe==="application/xhtml+xml"&&je===ie&&(s='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+s+"</body></html>");const R=T?T.createHTML(s):s;if(je===ie)try{o=new _().parseFromString(R,Pe)}catch{}if(!o||!o.documentElement){o=X.createDocument(je,"template",null);try{o.documentElement.innerHTML=ct?D:R}catch{}}const G=o.body||o.documentElement;return s&&u&&G.insertBefore(t.createTextNode(u),G.childNodes[0]||null),je===ie?pe.call(o,ye?"html":"body")[0]:ye?o.documentElement:G},Yt=function(s){return m.call(s.ownerDocument||s,s,w.SHOW_ELEMENT|w.SHOW_COMMENT|w.SHOW_TEXT|w.SHOW_PROCESSING_INSTRUCTION|w.SHOW_CDATA_SECTION,null)},ft=function(s){return s instanceof N&&(typeof s.nodeName!="string"||typeof s.textContent!="string"||typeof s.removeChild!="function"||!(s.attributes instanceof j)||typeof s.removeAttribute!="function"||typeof s.setAttribute!="function"||typeof s.namespaceURI!="string"||typeof s.insertBefore!="function"||typeof s.hasChildNodes!="function")},ht=function(s){return typeof d=="function"&&s instanceof d};function de(b,s,o){Se(b,u=>{u.call(a,s,o,Te)})}const Xt=function(s){let o=null;if(de(p.beforeSanitizeElements,s,null),ft(s))return ae(s),!0;const u=B(s.nodeName);if(de(p.uponSanitizeElement,s,{tagName:u,allowedTags:q}),Le&&s.hasChildNodes()&&!ht(s.firstElementChild)&&Y(/<[/\w!]/g,s.innerHTML)&&Y(/<[/\w!]/g,s.textContent)||Le&&s.namespaceURI===ie&&u==="style"&&ht(s.firstElementChild)||s.nodeType===ke.progressingInstruction||Le&&s.nodeType===ke.comment&&Y(/<[/\w]/g,s.data))return ae(s),!0;if(De[u]||!(he.tagCheck instanceof Function&&he.tagCheck(u))&&!q[u]){if(!De[u]&&Zt(u)&&(U.tagNameCheck instanceof RegExp&&Y(U.tagNameCheck,u)||U.tagNameCheck instanceof Function&&U.tagNameCheck(u)))return!1;if(ot&&!oe[u]){const R=E(s)||s.parentNode,G=P(s)||s.childNodes;if(G&&R){const z=G.length;for(let J=z-1;J>=0;--J){const re=$(G[J],!0);R.insertBefore(re,C(s))}}}return ae(s),!0}return s instanceof g&&!$r(s)||(u==="noscript"||u==="noembed"||u==="noframes")&&Y(/<\/no(script|embed|frames)/i,s.innerHTML)?(ae(s),!0):(be&&s.nodeType===ke.text&&(o=s.textContent,Se([A,v,L],R=>{o=Ae(o,R," ")}),s.textContent!==o&&(Ee(a.removed,{element:s.cloneNode()}),s.textContent=o)),de(p.afterSanitizeElements,s,null),!1)},Qt=function(s,o,u){if(Be[o]||$t&&(o==="id"||o==="name")&&(u in t||u in Fr))return!1;const R=V[o]||he.attributeCheck instanceof Function&&he.attributeCheck(o,s);if(!(st&&!Be[o]&&Y(W,o))){if(!(Mt&&Y(fe,o))){if(!R||Be[o]){if(!(Zt(s)&&(U.tagNameCheck instanceof RegExp&&Y(U.tagNameCheck,s)||U.tagNameCheck instanceof Function&&U.tagNameCheck(s))&&(U.attributeNameCheck instanceof RegExp&&Y(U.attributeNameCheck,o)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(o,s))||o==="is"&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&Y(U.tagNameCheck,u)||U.tagNameCheck instanceof Function&&U.tagNameCheck(u))))return!1}else if(!lt[o]){if(!Y(Ot,Ae(u,Oe,""))){if(!((o==="src"||o==="xlink:href"||o==="href")&&s!=="script"&&lr(u,"data:")===0&&Ht[s])){if(!(Pt&&!Y(He,Ae(u,Oe,"")))){if(u)return!1}}}}}}return!0},Ur=S({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Zt=function(s){return!Ur[Ue(s)]&&Y(ve,s)},Jt=function(s){de(p.beforeSanitizeAttributes,s,null);const o=s.attributes;if(!o||ft(s))return;const u={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:V,forceKeepAttr:void 0};let R=o.length;for(;R--;){const G=o[R],z=G.name,J=G.namespaceURI,re=G.value,ne=B(z),xt=re;let K=z==="value"?xt:Es(xt);if(u.attrName=ne,u.attrValue=K,u.keepAttr=!0,u.forceKeepAttr=void 0,de(p.uponSanitizeAttribute,s,u),K=u.attrValue,Ut&&(ne==="id"||ne==="name")&&lr(K,zt)!==0&&(we(z,s),K=zt+K),Le&&Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,K)){we(z,s);continue}if(ne==="attributename"&&ir(K,"href")){we(z,s);continue}if(u.forceKeepAttr)continue;if(!u.keepAttr){we(z,s);continue}if(!Ft&&Y(/\/>/i,K)){we(z,s);continue}be&&Se([A,v,L],tr=>{K=Ae(K,tr," ")});const er=B(s.nodeName);if(!Qt(er,ne,K)){we(z,s);continue}if(T&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!J)switch(f.getAttributeType(er,ne)){case"TrustedHTML":{K=T.createHTML(K);break}case"TrustedScriptURL":{K=T.createScriptURL(K);break}}if(K!==xt)try{J?s.setAttributeNS(J,z,K):s.setAttribute(z,K),ft(s)?ae(s):or(a.removed)}catch{we(z,s)}}de(p.afterSanitizeAttributes,s,null)},gt=function(s){let o=null;const u=Yt(s);for(de(p.beforeSanitizeShadowDOM,s,null);o=u.nextNode();)de(p.uponSanitizeShadowNode,o,null),Xt(o),Jt(o),o.content instanceof i&&gt(o.content);de(p.afterSanitizeShadowDOM,s,null)},Ve=function(s){if(s.nodeType===ke.element&&s.shadowRoot instanceof i){const R=s.shadowRoot;Ve(R),gt(R)}const o=s.childNodes;if(!o)return;const u=[];Se(o,R=>{Ee(u,R)});for(const R of u)Ve(R)};return a.sanitize=function(b){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=null,u=null,R=null,G=null;if(ct=!b,ct&&(b="<!-->"),typeof b!="string"&&!ht(b)&&(b=Is(b),typeof b!="string"))throw Ye("dirty is not a string, aborting");if(!a.isSupported)return b;if(at||pt(s),a.removed=[],typeof b=="string"&&(Me=!1),Me){const re=b.nodeName;if(typeof re=="string"){const ne=B(re);if(!q[ne]||De[ne])throw Ye("root node is forbidden and cannot be sanitized in-place")}Ve(b)}else if(b instanceof d)o=Vt("<!---->"),u=o.ownerDocument.importNode(b,!0),u.nodeType===ke.element&&u.nodeName==="BODY"||u.nodeName==="HTML"?o=u:o.appendChild(u),Ve(u);else{if(!Ne&&!be&&!ye&&b.indexOf("<")===-1)return T&&qe?T.createHTML(b):b;if(o=Vt(b),!o)return Ne?null:qe?D:""}o&&nt&&ae(o.firstChild);const z=Yt(Me?b:o);for(;R=z.nextNode();)Xt(R),Jt(R),R.content instanceof i&&gt(R.content);if(Me)return b;if(Ne){if(be){o.normalize();let re=o.innerHTML;Se([A,v,L],ne=>{re=Ae(re,ne," ")}),o.innerHTML=re}if(We)for(G=k.call(o.ownerDocument);o.firstChild;)G.appendChild(o.firstChild);else G=o;return(V.shadowroot||V.shadowrootmode)&&(G=xe.call(n,G,!0)),G}let J=ye?o.outerHTML:o.innerHTML;return ye&&q["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Y(Bs,o.ownerDocument.doctype.name)&&(J="<!DOCTYPE "+o.ownerDocument.doctype.name+`>
3`+J),be&&Se([A,v,L],re=>{J=Ae(J,re," ")}),T&&qe?T.createHTML(J):J},a.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};pt(b),at=!0},a.clearConfig=function(){Te=null,at=!1},a.isValidAttribute=function(b,s,o){Te||pt({});const u=B(b),R=B(s);return Qt(u,R,o)},a.addHook=function(b,s){typeof s=="function"&&Ee(p[b],s)},a.removeHook=function(b,s){if(s!==void 0){const o=Ts(p[b],s);return o===-1?void 0:Ss(p[b],o,1)[0]}return or(p[b])},a.removeHooks=function(b){p[b]=[]},a.removeAllHooks=function(){p=gr()},a}var Ks=kr();function Vs(r,a,t=6){if(!r||!a.length)return r;let n=r,l=0;const i=[...a].sort((d,g)=>g.name.length-d.name.length),c=new Set;for(const d of i){if(l>=t)break;
3if(d.name.length<3)continue;const g=`/artist/${d.slug}`,w=Xs(d.name),h=new RegExp(`<a\\s+[^>]*href=["']https?://(?:www\\.)?(?:instagram\\.com|twitter\\.com|x\\.com)/[^"']*["'][^>]*>([^<]*${w}[^<]*)</a>`,"gi");n=n.replace(h,(N,_)=>{const f=_.replace(/\s*\(@?\w+\)/g,"").trim()||d.name;return l++,`<a href="${g}" class="internal-artist-link">${f}</a>`});const j=new RegExp(`(?<!<a[^>]*>(?:[^<]*))(<strong>)(${w})(</strong>)`,"gi");if(n=n.replace(j,(N,_,f,y)=>{if(l>=t)return N;const $=n.indexOf(N),x=n.slice(Math.max(0,$-500),$),C=x.lastIndexOf("<a "),P=x.lastIndexOf("</a>");return C>P?N:(c.add(d.slug),l++,`<a href="${g}" class="internal-artist-link">${_}${f}${y}</a>`)}),!c.has(d.slug)&&l<t){const N=new RegExp(`(>)([^<]*?)(\\b${w}\\b)([^<]*?<)`,"i"),_=n.match(N);if(_&&_.index!==void 0){const f=n.slice(Math.max(0,_.index-500),_.index),y=f.lastIndexOf("<a "),$=f.lastIndexOf("</a>");(y<=$||y===-1)&&(n=n.replace(N,`$1$2<a href="${g}" class="internal-artist-link">$3</a>$4`),c.add(d.slug),l++)}}}return n=Ys(n),n}function Ys(r){return r.replace(/<a\s+([^>]*href=["'](https?:\/\/[^"']+)["'][^>]*)>/gi,(a,t,n)=>/rel=["'][^"']*nofollow/i.test(t)?a:/rel=["']/i.test(t)?`<a ${t.replace(/rel=["']([^"']*)["']/i,(i,c)=>`rel="${c} nofollow"`)}>`:`<a ${t} rel="nofollow noopener noreferrer">`)}function Xs(r){return r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function le({className:r,...a}){return e.jsx("div",{className:me("animate-pulse rounded-md bg-muted",r),...a})}const xr=({video:r,onPlay:a,playing:t})=>t?e.jsx("div",{className:`rounded-lg overflow-hidden border border-border bg-card ${r.isShort?"aspect-[9/16]":"aspect-video"}`,children:e.jsx("iframe",{src:`https://www.youtube.com/embed/${r.videoId}?autoplay=1&rel=0`,title:r.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full",loading:"lazy"})}):e.jsxs("button",{onClick:a,className:"w-full text-left group rounded-lg border border-border bg-card overflow-hidden hover:border-primary/30 transition-colors cursor-pointer",children:[e.jsxs("div",{className:"relative",children:[e.jsx("div",{className:r.isShort?"aspect-[9/16]":"aspect-video",children:e.jsx("img",{src:r.thumbnail,alt:r.title,className:"w-full h-full object-cover",loading:"lazy"})}),e.jsx("div",{className:"absolute inset-0 bg-background/20 group-hover:bg-background/10 transition-colors flex items-center justify-center",children:e.jsx("div",{className:"w-9 h-9 rounded-full bg-destructive/90 flex items-center justify-center group-hover:scale-110 transition-transform shadow-md",children:e.jsx(ts,{className:"h-4 w-4 text-white ml-0.5",fill:"currentColor"})})}),r.isShort&&e.jsxs("div",{className:"absolute top-1.5 left-1.5 bg-destructive/90 text-white text-[9px] font-bold tracking-wider px-1.5 py-0.5 rounded-sm flex items-center gap-0.5",children:[e.jsx(rt,{className:"h-2.5 w-2.5",fill:"currentColor"}),"SHORT"]})]}),e.jsxs("div",{className:"p-2.5",children:[e.jsx("p",{className:"font-display text-[11px] font-semibold tracking-wide line-clamp-2 leading-snug",children:r.title}),r.channelTitle&&e.jsx("p",{className:"font-accent text-[10px] text-muted-foreground tracking-wider mt-1",children:r.channelTitle})]})]}),Qs=({articleTitle:r,cachedVideoId:a})=>{const[t,n]=I.useState(null),[l,i]=I.useState(null),c=new Set(["the","and","with","for","from","new","has","his","her","are","was","just","now","its","out","all","how","why","who","what","says","gets","goes","hits","set","big","top","hot","first","major","after","before","into","over","back","been","about","this","that","been","will","could","would","should","music","news","video","exclusive","culture","lifestyle","sports","fashion","sneakers","gossip"]),d=r.replace(/[^a-zA-Z0-9\s'-]/g,"").split(/\s+/).filter(x=>x.length>2&&!c.has(x.toLowerCase())).slice(0,5).join(" "),g=(...x)=>{const C=new Set,P=[];for(const E of x)for(const T of E??[])!T?.videoId||C.has(T.videoId)||(C.add(T.videoId),P.push(T));return P},w=(x,C)=>{const P=x.toLowerCase();return C.reduce((E,T)=>E+(P.includes(T.toLowerCase())?1:0),0)},{data:h,isLoading:j}
3=te({queryKey:["youtube-cache",d],queryFn:async()=>{const x=d.split(" ").filter(m=>m.length>2),C=[`${d}||12`,`${d} hip hop||12`],P=await Promise.all(C.map(async m=>{const{data:k}=await O.from("youtube_cache").select("videos").eq("search_key",m).maybeSingle();return k?.videos??[]})),E=g(...P.map(m=>m.filter(k=>!k.isShort)));if(E.length>=3)return{videos:E};let T=[];try{const{data:m,error:k}=await O.functions.invoke("youtube-videos",{body:{search:d,maxResults:12,context:"article"}});if(k)throw k;T=g((m?.videos??[]).filter(pe=>!pe.isShort))}catch(m){console.error("Failed to fetch article-specific videos",m)}const D=g(E,T);if(D.length>=3)return{videos:D};const{data:M}=await O.from("youtube_cache").select("videos, search_key, fetched_at").not("search_key","ilike","%|short").order("fetched_at",{ascending:!1}).limit(12),X=g(...(M??[]).map(m=>({videos:m.videos,score:w(m.search_key,x)})).filter(m=>m.score>0).sort((m,k)=>k.score-m.score).map(m=>(m.videos??[]).filter(k=>!k.isShort)));return X.length>0?{videos:g(D,X)}:{videos:g(D,...(M??[]).slice(0,2).map(m=>(m.videos??[]).filter(k=>!k.isShort)))}},enabled:d.length>0,staleTime:1e3*60*30}),{data:N,isLoading:_}=te({queryKey:["youtube-shorts-cache",d],queryFn:async()=>{const x=d.split(" ").filter(m=>m.length>2),C=[`${d}||12|short`,`${d} hip hop||12|short`],P=await Promise.all(C.map(async m=>{const{data:k}=await O.from("youtube_cache").select("videos").eq("search_key",m).maybeSingle();return k?.videos??[]})),E=g(...P.map(m=>m.map(k=>({...k,isShort:!0}))));if(E.length>=4)return{videos:E};let T=[];try{const{data:m,error:k}=await O.functions.invoke("youtube-videos",{body:{search:d,maxResults:12,videoDuration:"short",context:"article"}});if(k)throw k;T=g((m?.videos??[]).map(pe=>({...pe,isShort:!0})))}catch(m){console.error("Failed to fetch article-specific shorts",m)}const D=g(E,T);if(D.length>=4)return{videos:D};const{data:M}=await O.from("youtube_cache").select("videos, search_key, fetched_at").ilike("search_key","%|short").order("fetched_at",{ascending:!1}).limit(12),X=g(...(M??[]).map(m=>({videos:m.videos,score:w(m.search_key,x)})).filter(m=>m.score>0).sort((m,k)=>k.score-m.score).map(m=>(m.videos??[]).map(k=>({...k,isShort:!0}))));return X.length>0?{videos:g(D,X)}:{videos:g(D,...(M??[]).slice(0,2).map(m=>(m.videos??[]).map(k=>({...k,isShort:!0}))))}},enabled:d.length>0,staleTime:1e3*60*30}),f=[];if(a&&f.push({videoId:a,title:r,thumbnail:`https://img.youtube.com/vi/${a}/hqdefault.jpg`}),h?.videos)for(const x of h.videos){if(f.length>=3)break;f.some(C=>C.videoId===x.videoId)||f.push(x)}const y=[];if(N?.videos)for(const x of N.videos){if(y.length>=4)break;f.some(C=>C.videoId===x.videoId)||y.push({...x,isShort:!0})}return!a&&(j||_)?e.jsxs("div",{className:"my-8 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(le,{className:"h-3.5 w-3.5 rounded"}),e.jsx(le,{className:"h-3 w-24"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:[0,1,2].map(x=>e.jsxs("div",{className:"rounded-lg overflow-hidden border border-border bg-card",children:[e.jsx(le,{className:"aspect-video w-full"}),e.jsxs("div",{className:"p-2.5 space-y-1.5",children:[e.jsx(le,{className:"h-3 w-3/4"}),e.jsx(le,{className:"h-2.5 w-1/3"})]})]},x))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(le,{className:"h-3.5 w-3.5 rounded"}),e.jsx(le,{className:"h-3 w-20"})]}),e.jsx("div",{className:"flex gap-3 overflow-hidden",children:[0,1,2,3].map(x=>e.jsxs("div",{className:"w-28 shrink-0 rounded-lg overflow-hidden border border-border bg-card",children:[e.jsx(le,{className:"aspect-[9/16] w-full"}),e.jsxs("div",{className:"p-2 space-y-1",children:[e.jsx(le,{className:"h-2.5 w-full"}),e.jsx(le,{className:"h-2 w-2/3"})]})]},x))})]})]}):f.length===0&&y.length===0?null:e.jsxs("div",{className:"my-8 space-y-6",children:[f.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(es,{className:"h-3.5 w-3.5 text-destructive"}),e.jsx("span",{className:"font-display text-[10px] font-bold tracking-[0.15em] text-muted-foreground",children:"RELATED VIDEOS"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:f.map((x,C)=>e.jsx(xr,{video:x,playing:t===C,onPlay:()=>{n(C),i(null)}},x.videoId))})]}),y.length>0&&e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(rt,{className:"h-3.5 w-3.5 text-destructive",fill:"
3currentColor"}),e.jsx("span",{className:"font-display text-[10px] font-bold tracking-[0.15em] text-muted-foreground",children:"SHORTS"})]}),e.jsx("div",{className:"flex gap-3 overflow-x-auto pb-2 scrollbar-hide",children:y.map((x,C)=>e.jsx("div",{className:"w-32 sm:w-36 shrink-0",children:e.jsx(xr,{video:x,playing:l===C,onPlay:()=>{i(C),n(null)}})},x.videoId))})]})]})},Zs=({relatedArticles:r})=>{const{data:a}=Br(),t=(a||[]).slice(0,5);return e.jsxs("aside",{className:"hidden xl:flex flex-col gap-6",children:[e.jsx(Ze,{size:"half-page"}),t.length>0&&e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-primary to-primary/80 px-4 py-3 flex items-center gap-2",children:[e.jsx(rs,{className:"h-4 w-4 text-primary-foreground"}),e.jsx("h3",{className:"font-display text-sm font-bold text-primary-foreground tracking-[0.15em]",children:"TRENDING"})]}),e.jsx("div",{className:"divide-y divide-border",children:t.map((n,l)=>e.jsxs(ce,{to:`/article/${n.slug}`,className:"flex items-center gap-2.5 p-3 hover:bg-secondary/30 transition-all group",children:[e.jsx("span",{className:"font-display text-2xl font-black text-border/60 w-7 text-center shrink-0 group-hover:text-primary/30 transition-colors",children:String(l+1).padStart(2,"0")}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:`font-accent text-[9px] tracking-[0.1em] font-semibold uppercase ${ge(n.categories?.slug)}`,children:n.categories?.name||"NEWS"}),e.jsx("h4",{className:"font-display text-[12px] font-semibold leading-snug mt-0.5 group-hover:text-primary transition-colors line-clamp-2",children:n.title})]}),e.jsx(rr,{src:ue(n.image_url),alt:n.title,className:"w-12 h-12 object-cover rounded-lg shrink-0 ring-1 ring-border"})]},n.id))})]}),r&&r.length>0&&e.jsxs("div",{className:"bg-card rounded-xl border border-border overflow-hidden",children:[e.jsx("div",{className:"px-4 py-3 border-b border-border",children:e.jsx("h3",{className:"font-display text-sm font-bold tracking-[0.12em]",children:"RELATED STORIES"})}),e.jsx("div",{className:"divide-y divide-border",children:r.map(n=>e.jsxs(ce,{to:`/article/${n.slug}`,className:"flex gap-3 p-3 hover:bg-secondary/30 transition-all group",children:[e.jsx(rr,{src:ue(n.image_url),alt:n.title,className:"w-20 h-14 object-cover rounded-lg shrink-0 ring-1 ring-border"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-display text-[12px] font-semibold leading-snug group-hover:text-primary transition-colors line-clamp-2",children:n.title}),e.jsx("span",{className:"font-accent text-[10px] text-muted-foreground tracking-wider mt-1 block",children:Ie(n.published_at||n.created_at)})]})]},n.id))})]}),e.jsx(Wr,{}),e.jsx(qr,{placement:"article_sidebar",size:"compact"})]})},Js="wumldpctdupoijfqcuzo",ea=`https://${Js}.supabase.co/functions/v1/share-meta`;function Cr(r){return`${ea}?slug=${encodeURIComponent(r)}`}const ta=[{type:"fire",emoji:"🔥",label:"Fire"},{type:"skull",emoji:"💀",label:"Dead"},{type:"crown",emoji:"👑",label:"King"},{type:"hundred",emoji:"💯",label:"Real"}],ra=({articleId:r,articleTitle:a,articleSlug:t})=>{const[n,l]=I.useState({}),[i,c]=I.useState(new Set),[d,g]=I.useState(0),[w,h]=I.useState(!1),[j,N]=I.useState(null),_=vr(),f=`${window.location.origin}/article/${t}`,y=Cr(t);I.useEffect(()=>{(async()=>{const[L,W,fe]=await Promise.all([O.rpc("get_reaction_counts",{p_article_id:r}),O.rpc("get_user_reactions",{p_article_id:r,p_fingerprint:_}),O.from("article_views").select("view_count").eq("article_id",r).maybeSingle()]),He={};for(const ve of L.data||[])He[ve.reaction_type]=Number(ve.count);l(He);const Oe=new Set;for(const ve of W.data||[])Oe.add(ve.reaction_type);c(Oe),g(fe.data?.view_count||0)})(),Promise.resolve(O.rpc("increment_article_views",{p_article_id:r})).catch(()=>{})},[r,_]);const $=I.useCallback(async v=>{if(i.has(v))return;N(v),setTimeout(()=>N(null),600),l(W=>({...W,[v]:(W[v]||0)+1})),c(W=>new Set(W).add(v));const{error:L}=await O.from("article_reactions").insert({article_id:r,reaction_type:v,fingerprint:_});L&&(l(W=>({...W,[v]:Math.max(0,(W[v]||1)-1)})),c(W=>{const fe=new Set(W);return fe.delete(v),fe}))},[r,_,i]),x=(v,L)=>{window.open(v,"_blank",L?`noopener,noreferrer,${L}`:"noopener,noreferrer")},C=()=>{const v=`${a} — @mymixtapez`;x(`https://twitter.com/intent/tweet?text=${encodeURIComponent(v)}&url=${encodeURIComponent(y)}`)},P=()=>{x(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(y)}`,"width=600,height=400")},E=()=>{const v=`${a} ${y}`;x(`https://wa.me/?text=${encodeURIComponent(v)}`)},T=()=>{x(`https://www.reddit.com/submit?url=${encodeURIComponent(y)}&title=${encodeURIComponent(a)}`)},D=()=>{x(`https://t.me/share/url?url=${encodeURIComponent(y)}&text=${encodeURIComponent(a)}`)},M=()=>{window.open(`sms:?body=${encodeURIComponent(`${a} ${y}`)}`,"_self")},X=()=>{navigator.clipboard?.writeText(f),h(!0),setTimeout(()=>h(!1),2e3),x("https://www.instagram.com/mymixtapez/")},m=()=>{x(`https://www.threads.net/intent/post?text=${encodeURIComponent(`${a} ${y}`)}`)},k=()=>{navigator.clipboard?.writeText(f),h(!0),setTimeout(()=>h(!1),2e3),x("https://www.tiktok.com/@mymixtapez")},pe=async()=>
3{if(navigator.share)try{await navigator.share({title:a,url:f})}catch{}},xe=async()=>{await navigator.clipboard?.writeText(f),h(!0),setTimeout(()=>h(!1),2e3)},p=v=>v>=1e6?(v/1e6).toFixed(1)+"M":v>=1e3?(v/1e3).toFixed(1)+"K":v.toString(),A="flex items-center gap-1.5 px-4 py-2 rounded-full border border-border bg-card transition-all font-accent text-[11px] tracking-wider";return e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:ta.map(v=>{const L=i.has(v.type),W=n[v.type]||0;return e.jsxs("button",{onClick:()=>$(v.type),disabled:L,title:v.label,className:`flex items-center gap-1.5 px-3.5 py-2 rounded-full border transition-all text-sm ${L?"border-primary/40 bg-primary/10 scale-105":"border-border bg-card hover:border-primary/30 hover:bg-primary/5 hover:scale-105"} ${j===v.type?"animate-[bounce_0.5s_ease-out]":""}`,children:[e.jsx("span",{className:`text-lg ${j===v.type?"animate-[spin_0.3s_ease-out]":""}`,children:v.emoji}),W>0&&e.jsx("span",{className:"font-accent text-[11px] tracking-wider text-muted-foreground",children:p(W)})]},v.type)})}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("button",{onClick:C,className:`${A} hover:bg-[#1DA1F2]/10 hover:border-[#1DA1F2]/30`,"aria-label":"Share on Twitter",children:[e.jsx(Je,{className:"h-3.5 w-3.5"}),"TWEET"]}),e.jsxs("button",{onClick:P,className:`${A} hover:bg-[#1877F2]/10 hover:border-[#1877F2]/30`,"aria-label":"Share on Facebook",children:[e.jsx(Nr,{className:"h-3.5 w-3.5"}),"SHARE"]}),e.jsxs("button",{onClick:E,className:`${A} hover:bg-[#25D366]/10 hover:border-[#25D366]/30`,"aria-label":"Share on WhatsApp",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),"WHATSAPP"]}),e.jsxs("button",{onClick:T,className:`${A} hover:bg-[#FF4500]/10 hover:border-[#FF4500]/30`,"aria-label":"Share on Reddit",children:[e.jsx(et,{className:"h-3.5 w-3.5"}),"REDDIT"]}),e.jsxs("button",{onClick:D,className:`${A} hover:bg-[#0088cc]/10 hover:border-[#0088cc]/30`,"aria-label":"Share on Telegram",children:[e.jsx(_r,{className:"h-3.5 w-3.5"}),"TELEGRAM"]}),e.jsxs("button",{onClick:M,className:`${A} hover:bg-secondary`,"aria-label":"Share via Text",children:[e.jsx(ze,{className:"h-3.5 w-3.5"}),"TEXT"]}),e.jsxs("button",{onClick:X,className:`${A} hover:bg-[#E1306C]/10 hover:border-[#E1306C]/30`,"aria-label":"Share on Instagram",title:"Copies link & opens @mymixtapez",children:[e.jsx(St,{className:"h-3.5 w-3.5"}),"INSTAGRAM"]}),e.jsxs("button",{onClick:k,className:`${A} hover:bg-[#00f2ea]/10 hover:border-[#00f2ea]/30`,"aria-label":"Share on TikTok",title:"Copies link & opens @mymixtapez",children:[e.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 01-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 01-2.88 2.5 2.89 2.89 0 01-2.89-2.89 2.89 2.89 0 012.89-2.89c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 00-.79-.05A6.34 6.34 0 003.15 15.2a6.34 6.34 0 006.34 6.34 6.34 6.34 0 006.34-6.34V9.42a8.16 8.16 0 004.76 1.52v-3.4a4.85 4.85 0 01-1-.85z"})}),"TIKTOK"]}
3),e.jsxs("button",{onClick:m,className:`${A} hover:bg-[#000000]/10 hover:border-[#000000]/30`,"aria-label":"Share on Threads",children:[e.jsx("svg",{className:"h-3.5 w-3.5",viewBox:"0 0 24 24",fill:"currentColor",children:e.jsx("path",{d:"M12.186 24h-.007C5.461 23.956.057 18.51 0 11.757 0 5.27 5.383 0 12.014 0c6.487 0 11.693 5.107 11.986 11.558.28 6.178-4.652 11.603-10.814 12.378v-8.71h2.928l.56-3.594h-3.488v-2.33c0-.983.482-1.942 2.026-1.942h1.567V4.126s-1.422-.243-2.782-.243c-2.838 0-4.693 1.72-4.693 4.836v2.742H6.369v3.594h2.935V24z"})}),"THREADS"]}),e.jsxs("button",{onClick:xe,className:`${A} hover:bg-secondary`,"aria-label":"Copy article link",children:[w?e.jsx(tt,{className:"h-3.5 w-3.5 text-green-500"}):e.jsx(Et,{className:"h-3.5 w-3.5"}),w?"COPIED!":"COPY LINK"]}),typeof navigator<"u"&&navigator.share&&e.jsxs("button",{onClick:pe,className:`${A} hover:bg-primary/10 hover:border-primary/30`,"aria-label":"Share",children:[e.jsx(jr,{className:"h-3.5 w-3.5"}),"MORE"]}),d>0&&e.jsxs("span",{className:"font-accent text-[11px] tracking-wider text-muted-foreground ml-auto",children:["👁 ",p(d)," views"]})]})]})},sa=({rating:r})=>{const a=r>=8?"text-emerald-400":r>=6?"text-amber-400":r>=4?"text-orange-400":"text-red-400",t=r>=8?"bg-emerald-400/10":r>=6?"bg-amber-400/10":r>=4?"bg-orange-400/10":"bg-red-400/10";return e.jsx("div",{className:`flex items-center justify-center w-16 h-16 rounded-full border-2 ${a} ${t} border-current`,children:e.jsx("span",{className:`font-display text-xl font-bold ${a}`,children:r.toFixed(1)})})},aa=({articleId:r})=>{const{data:a}=te({queryKey:["ai-review",r],queryFn:async()=>{const{data:t,error:n}=await O.from("ai_reviews").select("*").eq("article_id",r).maybeSingle();if(n)throw n;return t}});return a?e.jsxs("div",{className:"my-8 bg-gradient-to-br from-primary/5 via-card to-card border border-primary/20 rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-primary/15 via-transparent to-transparent px-5 py-3 flex items-center justify-between border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ss,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"font-display text-sm font-bold tracking-[0.12em]",children:"AI REVIEW"}),e.jsx("span",{className:"font-accent text-[9px] tracking-wider text-muted-foreground bg-secondary px-2 py-0.5 rounded-full",children:"POWERED BY AI"})]}),a.verdict&&e.jsx("span",{className:"font-display text-[11px] font-bold tracking-[0.15em] text-primary bg-primary/10 px-3 py-1 rounded-full",children:a.verdict.toUpperCase()})]}),e.jsx("div",{className:"p-5",children:e.jsxs("div",{className:"flex items-start gap-5",children:[e.jsx(sa,{rating:Number(a.overall_rating)}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"font-body text-sm text-foreground leading-relaxed mb-3",children:a.summary}),a.lyric_analysis&&e.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[e.jsx(as,{className:"h-3.5 w-3.5 text-muted-foreground mt-0.5 shrink-0"}),e.jsx("p",{className:"font-body text-xs text-muted-foreground",children:a.lyric_analysis})]}),a.production_notes&&e.jsxs("div",{className:"flex items-start gap-2 mb-2",children:[e.jsx(ns,{className:"h-3.5 w-3.5 text-muted-foreground mt-0.5 shrink-0"}),e.jsx("p",{className:"font-body text-xs text-muted-foreground",children:a.production_notes})]}),a.standout_tracks&&a.standout_tracks.length>0&&e.jsxs("div",{className:"flex items-start gap-2 mt-3",children:[e.jsx(os,{className:"h-3.5 w-3.5 text-primary mt-0.5 shrink-0"}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:a.standout_tracks.map(t=>e.jsx("span",{className:"font-accent text-[9px] tracking-wider bg-primary/10 text-primary px-2 py-0.5 rounded-full",children:t},t))})]}),a.comparison&&e.jsx("p",{className:"font-body text-xs text-muted-foreground italic mt-3 border-l-2 border-primary/30 pl-3",children:a.comparison})]})]})})]}):null},na=({articleId:r})=>{const a=wr(),t=Gr(),[n,l]=I.useState(null),{data:i}=te({queryKey:["community-verdict",r],queryFn:async()=>{const{data:f,error:y}=await O.from("community_verdicts").select("*").eq("article_id",r).maybeSingle();if(y)throw y;return f}}),{data:c}=te({queryKey:["verdict-votes",i?.id],queryFn:async()=>{const{data:f,error:y}=await O.rpc("get_verdict_votes",{p_verdict_id:i.id});if(y)throw y;return f},enabled:!!i?.id}),{data:d}=te({queryKey:["user-verdict-vote",i?.id,t],queryFn:async()=>{const{data:f,error:y}=await O.rpc("get_user_verdict_vote",{p_verdict_id:i.id,p_fingerprint:t});if(y)throw y;return f==null?null:{option_index:f}},enabled:!!i?.id}),g=Qe({mutationFn:async f=>{const{error:y}=await O.from("community_votes").insert({verdict_id:i.id,fingerprint:t,option_index:f});if(y)throw y},onSuccess:()=>{a.invalidateQueries({queryKey:["verdict-votes",i?.id]}),a.invalidateQueries({queryKey:["user-verdict-vote",i?.id,t]})}});if(!i)return null;const w=i.hot_take_options||[],h=c?.reduce((f,y)=>f+Number(y.vote_count),0)||0,j=!!d,N=j||n!==null,_=f=>{j||(l(f),g.mutate(f))};return e.jsxs("div",{className:"my-8 bg-card border border-border rounded-xl overflow-hidden",children:[e.jsxs("div",{className:"bg-gradient-to-r from-orange-500/15 via-trans
3parent to-transparent px-5 py-3 flex items-center gap-2.5 border-b border-border",children:[e.jsx(rt,{className:"h-4 w-4 text-orange-400"}),e.jsx("span",{className:"font-display text-sm font-bold tracking-[0.12em]",children:"COMMUNITY PULSE"}),e.jsx("span",{className:"font-accent text-[9px] tracking-wider text-muted-foreground bg-secondary px-2 py-0.5 rounded-full",children:"HOT TAKE"})]}),e.jsxs("div",{className:"p-5",children:[e.jsxs("h3",{className:"font-display text-base font-bold tracking-wide mb-4 leading-snug",children:[e.jsx(ze,{className:"h-4 w-4 inline mr-2 text-muted-foreground"}),i.ai_question]}),e.jsx("div",{className:"space-y-2.5",children:w.map((f,y)=>{const $=c?.find(E=>E.option_index===y)?.vote_count||0,x=h>0?Math.round(Number($)/h*100):0,C=d?.option_index===y||n===y,P=N&&x===Math.max(...w.map((E,T)=>{const D=c?.find(M=>M.option_index===T)?.vote_count||0;return h>0?Math.round(Number(D)/h*100):0}));return e.jsxs("button",{onClick:()=>_(y),disabled:j,className:`w-full text-left rounded-lg border transition-all relative overflow-hidden ${C?"border-primary bg-primary/5":j?"border-border bg-secondary/30":"border-border hover:border-primary/40 hover:bg-secondary/50"}`,children:[N&&e.jsx("div",{className:`absolute inset-y-0 left-0 transition-all duration-700 ${P?"bg-primary/10":"bg-secondary/50"}`,style:{width:`${x}%`}}),e.jsxs("div",{className:"relative flex items-center justify-between px-4 py-3",children:[e.jsxs("div",{className:"flex items-center gap-2.5",children:[C&&e.jsx(tt,{className:"h-3.5 w-3.5 text-primary shrink-0"}),e.jsx("span",{className:`font-body text-sm ${C?"font-semibold text-foreground":"text-secondary-foreground"}`,children:f})]}),N&&e.jsxs("span",{className:`font-display text-xs font-bold tabular-nums ${P?"text-primary":"text-muted-foreground"}`,children:[x,"%"]})]})]},y)})}),h>0&&e.jsxs("p",{className:"font-accent text-[10px] tracking-wider text-muted-foreground mt-3 text-center",children:[h.toLocaleString()," VOTES"]})]})]})},oa=(r,a)=>{const t=new Map;r.forEach(c=>t.set(c.id,{...c,replies:[],isMine:a.has(c.id)}));const n=[];r.forEach(c=>{const d=t.get(c.id);c.parent_id&&t.has(c.parent_id)?t.get(c.parent_id).replies.push(d):n.push(d)});const l=c=>c.upvotes-c.downvotes;n.sort((c,d)=>l(d)-l(c)||+new Date(d.created_at)-+new Date(c.created_at));const i=c=>{c.replies.sort((d,g)=>+new Date(d.created_at)-+new Date(g.created_at)),c.replies.forEach(i)};return n.forEach(i),n};function ia(r){const a=wr(),t=vr(),n=te({queryKey:["comments",r],enabled:!!r,queryFn:async()=>{const{data:h,error:j}=await O.rpc("get_article_comments",{p_article_id:r});if(j)throw j;return h??[]},staleTime:3e4}),l=te({queryKey:["my-comment-ids",r,t],enabled:!!r,queryFn:async()=>{const{data:h,error:j}=await O.rpc("get_my_comment_ids",{p_article_id:r,p_fingerprint:t});if(j)throw j;return new Set(h?.map(N=>N.comment_id)??[])},staleTime:3e4}),i=te({queryKey:["comment-votes",r,t],enabled:!!r,queryFn:async()=>{const{data:h,error:j}=await O.rpc("get_user_comment_votes",{p_article_id:r,p_fingerprint:t});if(j)throw j;const N={};return h?.forEach(_=>N[_.comment_id]=_.vote_type),N},staleTime:3e4}),c=n.data?oa(n.data,l.data??new Set):[],d=Qe({mutationFn:async h=>{if(!r)throw new Error("no article");const{data:j,error:N}=await O.from("comments").insert({article_id:r,parent_id:h.parent_id??null,fingerprint:t,display_name:h.display_name?.trim()||null,content:h.content.trim()}).select("id").single();if(N)throw N;return j},onSuccess:()=>{a.invalidateQueries({queryKey:["comments",r]}),a.invalidateQueries({queryKey:["my-comment-ids",r,t]})}}),g=Qe({mutationFn:async h=>{const{data:j,error:N}=await O.rpc("cast_comment_vote",{p_comment_id:h.commentId,p_fingerprint:t,p_vote_type:h.type});if(N)throw N;return j},onSuccess:()=>{a.invalidateQueries({queryKey:["comments",r]}),a.invalidateQueries({queryKey:["comment-votes",r,t]})}}),w=Qe({mutationFn:async h=>{const{error:j}=await O.rpc("flag_comment",{p_comment_id:h,p_fingerprint:t});if(j)throw j},onSuccess:()=>a.invalidateQueries({queryKey:["comments",r]})});return{tree:c,flatCount:n.data?.length??0,isLoading:n.isLoading,userVotes:i.data??{},fingerprint:t,post:d,vote:g,flag:w}}const la=Kr("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),Ct=I.forwardRef(({className:r,variant:a,size:t,asChild:n=!1,...l},i)=>
3{const c=n?fs:"button";return e.jsx(c,{className:me(la({variant:a,size:t,className:r})),ref:i,...l})});Ct.displayName="Button";const Rr=I.forwardRef(({className:r,...a},t)=>e.jsx("textarea",{className:me("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...a}));Rr.displayName="Textarea";const Ir=I.forwardRef(({className:r,type:a,...t},n)=>e.jsx("input",{type:a,className:me("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",r),ref:n,...t}));Ir.displayName="Input";const br=2e3,ca=r=>{const a=(Date.now()-+new Date(r))/1e3;return a<60?"just now":a<3600?`${Math.floor(a/60)}m ago`:a<86400?`${Math.floor(a/3600)}h ago`:a<604800?`${Math.floor(a/86400)}d ago`:new Date(r).toLocaleDateString()},da=r=>{let a=0;for(let t=0;t<r.length;t++)a=a*31+r.charCodeAt(t)|0;return`hsl(${Math.abs(a)%360} 65% 55%)`},ma=r=>r.display_name?.trim()||`user_${r.id.replace(/-/g,"").slice(0,6)}`,Or=({onSubmit:r,onCancel:a,placeholder:t,compact:n,isSubmitting:l})=>{const[i,c]=I.useState(""),[d,g]=I.useState(""),w=br-i.length,h=i.trim().length>0&&w>=0;return e.jsxs("div",{className:"space-y-2",children:[!n&&e.jsx(Ir,{placeholder:"Display name (optional)",value:d,onChange:j=>g(j.target.value.slice(0,40)),maxLength:40,className:"bg-background"}),e.jsx(Rr,{placeholder:t,value:i,onChange:j=>c(j.target.value),rows:n?2:3,maxLength:br,className:"bg-background resize-y"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("span",{className:me("text-[11px] font-body",w<100?"text-primary":"text-muted-foreground"),children:[w," chars left"]}),e.jsxs("div",{className:"flex gap-2",children:[a&&e.jsx(Ct,{size:"sm",variant:"ghost",onClick:a,children:"Cancel"}),e.jsx(Ct,{size:"sm",disabled:!h||l,onClick:async()=>{await r(i,d),c(""),g("")},children:l?"Posting...":n?"Reply":"Post comment"})]})]})]})},It=I.memo(({node:r,depth:a,userVotes:t,onVote:n,onReply:l,onFlag:i,replyingTo:c,setReplyingTo:d,postReply:g,isPosting:w})=>{const h=t[r.id],j=r.upvotes-r.downvotes,N=ma(r);return e.jsx("div",{className:me("group",a>0&&"border-l-2 border-border pl-3 sm:pl-4"),children:e.jsxs("div",{className:"flex gap-3 py-3",children:[e.jsx("div",{className:"shrink-0 w-8 h-8 rounded-full flex items-center justify-center text-[11px] font-bold text-white font-accent",style:{backgroundColor:da(r.id)},"aria-hidden":!0,children:N.slice(r.display_name?0:5,r.display_name?2:7).toUpperCase()}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap text-[12px]",children:[e.jsx("span",{className:"font-accent font-bold tracking-wide",children:N}),r.isMine&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-primary/15 text-primary text-[10px] uppercase tracking-wider",children:"You"}),e.jsx("span",{className:"text-muted-foreground",children:"·"}),e.jsx("span",{className:"text-muted-foreground",children:ca(r.created_at)})]}),e.jsx("p",{className:"mt-1 text-sm text-foreground/90 whitespace-pre-wrap break-words font-body leading-relaxed",children:r.content}),e.jsxs("div",{className:"mt-2 flex items-center gap-1 text-muted-foreground",children:[e.jsx("button",{onClick:()=>n(r.id,"up"),"aria-label":"Upvote",className:me("p-1 rounded hover:text-primary hover:bg-primary/10 transition-colors",h==="up"&&"text-primary"),children:e.jsx(is,{className:"h-4 w-4",fill:h==="up"?"currentColor":"none"})}),e.jsx("span",{className:me("text-xs font-bold tabular-nums min-w-[20px] text-center",h==="up"&&"text-primary",h==="down"&&"text-muted-foreground"),children:j}),e.jsx("button",{onClick:()=>n(r.id,"down"),"aria-label":"Downvote",className:me("p-1 rounded hover:text-foreground hover:bg-muted transition-colors",h==="down"&&"text-foreground"),children:e.jsx(ls,{className:"h-4 w-4",fill:h==="down"?"currentColor":"none"})}),e.jsxs("button",{onClick:()=>l(r.id),className:"ml-2 inline-flex items-center gap-1 px-2 py-1 rounded hover:text-foreground hover:bg-muted text-xs transition-colors",children:[e.jsx(ze,{className:"h-3.5 w-3.5"})," Reply"]}),!r.isMine&&e.jsx("button",{onClick:()=>i(r.id),"aria-label":"Report comment",className:"ml-auto p-1 rounded hover:text-primary hover:bg-primary/10 transition-colors opacity-0 group-hover:opacity-100",children:e.jsx(cs,{className:"h-3.5 w-3.5"})})]}),c===r.id&&e.jsx("div",{className:"mt-3",children:e.jsx(Or,{compact:!0,isSubmitting:w,placeholder:`Reply to ${N}...`,onSubmit:async(_,f)=>{await g(r.id,_,f)},onCancel:()=>d(null)})}),r.replies.length>0&&e.jsx("div",{className:"mt-2",children:r.replies.map(_=>e.jsx(It,{node:_,depth:Math.min(a+1,3),userVotes:t,onVote:n,onReply:l,onFlag:i,replyingTo:c,setReplyingTo:d,postReply:g,isPosting:w},_.id))})]})]})})});It.displayName="CommentItem";const ua=({articleId:r})=>{const{tree:a,flatCount:t,isLoading:n,userVotes:l,post:i,vote:c,flag:d}=ia(r),[g,w]=I.useState(null),h=async(_,f,y=null)=>{try{await i.mutateAsync({content:_,display_name:f,parent_id:y}
3),w(null),Fe({title:"Posted",description:"Your comment is live."})}catch($){Fe({title:"Couldn't post",description:$?.message?.includes("rate")?"Slow down — too many recent posts.":"Try again in a moment.",variant:"destructive"})}},j=async(_,f)=>{const $=l[_]===f?"none":f;try{await c.mutateAsync({commentId:_,type:$})}catch(x){Fe({title:"Vote failed",description:x?.message??"Try again.",variant:"destructive"})}},N=async _=>{try{await d.mutateAsync(_),Fe({title:"Reported",description:"Thanks — we'll review it."})}catch{Fe({title:"Couldn't report",variant:"destructive"})}};return e.jsxs("section",{className:"my-10","aria-label":"Comments",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(et,{className:"h-5 w-5 text-primary"}),e.jsxs("h2",{className:"headline-section",children:["Discussion ",t>0&&e.jsxs("span",{className:"text-muted-foreground",children:["(",t,")"]})]})]}),e.jsx("div",{className:"glow-line w-16 mb-6"}),e.jsxs("div",{className:"bg-card border border-border rounded-lg p-4 mb-6",children:[e.jsx(Or,{isSubmitting:i.isPending,placeholder:"Share your take... (anonymous, no signup needed)",onSubmit:(_,f)=>h(_,f,null)}),e.jsx("p",{className:"mt-2 text-[11px] text-muted-foreground font-body",children:"Be respectful. Spam, hate, and harassment will be removed."})]}),n?e.jsx("div",{className:"text-sm text-muted-foreground py-8 text-center font-body",children:"Loading comments..."}):a.length===0?e.jsx("div",{className:"text-sm text-muted-foreground py-10 text-center font-body border border-dashed border-border rounded-lg",children:"Be the first to comment."}):e.jsx("div",{className:"divide-y divide-border",children:a.map(_=>e.jsx(It,{node:_,depth:0,userVotes:l,onVote:j,onReply:f=>w(g===f?null:f),onFlag:N,replyingTo:g,setReplyingTo:w,postReply:(f,y,$)=>h(y,$,f),isPosting:i.isPending},_.id))})]})},pa=({nextArticle:r})=>{const[a,t]=I.useState(!1),[n,l]=I.useState(!1);return I.useEffect(()=>{if(!r||n)return;const i=()=>{const c=window.scrollY/(document.documentElement.scrollHeight-window.innerHeight);t(c>.35)};return window.addEventListener("scroll",i,{passive:!0}),()=>window.removeEventListener("scroll",i)},[r,n]),!r||n||!a?null:e.jsx("div",{className:"fixed bottom-0 left-0 right-0 z-50 animate-in slide-in-from-bottom duration-300",children:e.jsx("div",{className:"bg-card/95 backdrop-blur-md border-t border-border shadow-[0_-4px_20px_rgba(0,0,0,0.3)]",children:e.jsxs("div",{className:"container flex items-center gap-3 py-3",children:[e.jsx("span",{className:"font-accent text-[10px] tracking-[0.15em] text-muted-foreground shrink-0 hidden sm:block",children:"READ NEXT"}),e.jsxs(ce,{to:`/article/${r.slug}`,className:"flex items-center gap-3 flex-1 min-w-0 group",children:[e.jsx("img",{src:ue(r.image_url),alt:r.title,className:"w-12 h-12 object-cover rounded-lg shrink-0 ring-1 ring-border"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h4",{className:"font-display text-[13px] font-semibold leading-snug group-hover:text-primary transition-colors line-clamp-1",children:r.title}),e.jsx("span",{className:"font-accent text-[10px] text-primary tracking-wider uppercase",children:r.categories?.name||"News"})]}),e.jsx(ds,{className:"h-4 w-4 text-muted-foreground group-hover:text-primary transition-colors shrink-0"})]}),e.jsx("button",{onClick:()=>l(!0),className:"p-1.5 rounded-full hover:bg-secondary/50 transition-colors shrink-0","aria-label":"Dismiss",children:e.jsx(Rt,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})})})},yr="mmz_exit_popup_dismissed",fa=3,ha=()=>{const[r,a]=I.useState(!1),[t,n]=I.useState(""),[l,i]=I.useState(!1),c=I.useCallback(()=>{a(!1),localStorage.setItem(yr,String(Date.now()))},[]);I.useEffect(()=>{if(window.innerWidth<768)return;const w=localStorage.getItem(yr);if(w&&(Date.now()-Number(w))/864e5<fa)return;let h=!1;const j=_=>{_.clientY<=5&&!h&&(h=!0,a(!0))},N=setTimeout(()=>{document.addEventListener("mouseleave",j)},15e3);return()=>{clearTimeout(N),document.removeEventListener("mouseleave",j)}},[]);const d=async g=>{if(g.preventDefault(),!!t){i(!0);try{const{error:w}=await O.rpc("subscribe_newsletter",{p_email:t});w?bt.error("Failed to subscribe."):bt.success("You're in! Welcome to the culture. 🔥"),c()}catch{bt.error("Something went wrong.")}finally{i(!1)}}};return r?e.jsxs("div",{className:"fixed inset-0 z-[100] flex items-center justify-center p-4",onClick:c,children:[e.jsx("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm"}),e.jsxs("div",{className:"relative bg-card border border-border rounded-2xl p-8 max-w-md w-full shadow-2xl animate-in zoom-in-95 fade-in duration-200",onClick:g=>g.stopPropagation(),children:[e.jsx("button",{onClick:c,className:"absolute top-4 right-4 p-1.5 rounded-full hover:bg-secondary/50 transition-colors","aria-label":"Close",children:e.jsx(Rt,{className:"h-4 w-4 text-muted-foreground"})}),e.jsxs("div",{className:"text-center mb-6",children:[e.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1.5 bg-primary/15 rounded-full mb-4",children:[e.jsx(rt,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{className:"font-accent text-[10px] tracking-[0.15em] text-primary font-semibold",children:"DON'T MISS OUT"})]}),e.jsx("h3",{className:"font-display text-2xl font-bold tracking-[0.08em] mb-2",children:"WAIT — THE CULTURE NEEDS YOU"}),e.jsx("p",{className:"font-body text-sm text-muted-foreground leading-relaxed",children:"Get breaking hip-hop news, album drops & exclusive stories delivered daily. Join 50K+ fans."})]}),e.jsxs("form",{onSubmit:d,className:"space-y-3",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ms,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx("input",{type:"email",value:t,onChange:g=>n(g.target.value),placeholder:"[email protected]",required:!0,className:"w-full bg-background border border-border rounded-lg pl-10 pr-4 py-3 text-sm font-body text-foreground placeholder:text-muted-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 transition-all"})]}),e.jsx("button",{type:"submit",disabled:l,className:"w-full font-display text-[12px] tracking-[0.2em] font-semibold py-3.5 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-all disabled:opacity-50 hover:shadow-[var(--shadow-glow)]",children:l?"SUBSCRIBING...":"SUBSCRIBE FREE →"})]}),e.jsx("button",{onClick:c,className:"w-full mt-3 font-accent text-[10px] tracking-[0.1em] text-muted-foreground hover:text-foreground transition-colors py-1",children:"NO THANKS, I'LL MISS THE NEWS"})]})]}):null},ga=({articles:r})=>{if(!r||r.length===0)return null;const a=r.slice(0,3);return e.jsxs("div",{className:"my-10 py-6 px-5 bg-gradient-to-r from-primary/5 via-card to-primary/5 rounded-xl border border-primary/15",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("div",{className:"h-px flex-1 bg-gradient-to-r from-transparent to-primary/20"}),e.jsx("span",{className:"font-display text-[11px] tracking-[0.2em] font-bold text-primary",children:"KEEP READING"}),e.jsx("div",{className:"h-px flex-1 bg-gradient-to-l from-transparent to-primary/20"})]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3",children:a.map(t=>e.jsxs(ce,{to:`/article/${t.slug}`,className:"flex sm:flex-col gap-3 group",children:[e.jsx("img",{src:ue(t.image_url),alt:t.title,className:"w-20 h-14 sm:w-full sm:h-24 object-cover rounded-lg ring-1 ring-border",loading:"lazy"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("span",{className:`font-accent text-[9px] tracking-[0.1em] font-semibold uppercase ${ge(t.categories?.slug)}`,children:t.categories?.name||"NEWS"}),e.jsx("h4",{className:"font-display text-[12px] font-semibold leading-snug mt-0.5 group-hover:text-primary transition-colors line-clamp-2",children:t.title}),e.jsx("span",{className:"font-accent text-[9px] text-muted-foreground tracking-wider mt-1 block",children:Ie(t.published_at||t.created_at)})]})]},t.id))}),e.jsx("div",{className:"mt-4 text-center",children:e.jsxs(ce,{to:"/",className:"inline-flex items-center gap-1.5 font-accent text-[10px] tracking-[0.15em] text-primary hover:text-primary/80 transition-colors font-semibold",children:["VIEW ALL STORIES ",e.jsx(Tr,{className:"h-3 w-3"})]})})]})},xa=({articles:r,categoryName:a,categorySlug:t})=>{if(!r||r.length===0)return null;const[n,...l]=r.slice(0,4),i=l.slice(0,3);return e.jsxs("section",{"aria-label":"Read next",className:"my-10 border-y-2 border-primary/30 bg-gradient-to-br from-primary/5 via-card to-card py-8 px-4 sm:px-6 -mx-4 sm:-mx-6 md:mx-0 md:rounded-lg md:px-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),e.jsx("span",{className:"font-accent text-[11px] tracking-[0.2em] text-primary font-bold uppercase",children:"Read Next"})]}),t&&e.jsxs(ce,{to:`/category/${t}`,className:"font-accent text-[10px] tracking-[0.15em] text-muted-foreground hover:text-primary transition-colors uppercase",children:["More ",a," →"]})]}),e.jsx(ce,{to:`/article/${n.slug}`,className:"group block mb-5 focus:outline-none focus:ring-2 focus:ring-primary rounded-md overflow-hidden",children:e.jsxs("div",{className:"grid md:grid-cols-[1.4fr_1fr] gap-5 items-center",children:[e.jsx("div",{className:"aspect-[16/10] md:aspect-[5/3] overflow-hidden rounded-md bg-muted",children:e.jsx("img",{src:ue(n.image_url,600),alt:n.title,loading:"lazy",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("span",{className:"inline-block font-accent text-[10px] tracking-[0.18em] font-bold uppercase mb-2 px-2 py-1 rounded",style:{color:ge(n.categories?.slug),backgroundColor:`${ge(n.categories?.slug)}15`},children:n.categories?.name||"News"}),e.jsx("h3",{className:"font-display text-xl md:text-2xl font-bold leading-tight mb-2 group-hover:text-primary transition-colors line-clamp-3",children:n.title}),n.excerpt&&e.jsx("p",{className:"font-body text-sm text-muted-foreground line-clamp-2 mb-3",children:n.excerpt}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-muted-foreground font-accent tracking-wide",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Sr,{className:"h-3 w-3"}),Ie(n.published_at||n.created_at)]}),e.jsxs("span",{className:"flex items-center gap-1 text-primary font-bold ml-auto group-hover:translate-x-1 transition-transform",children:["Read story ",e.jsx(Tr,{className:"h-3 w-3"})]})]})]})]})}),i.length>0&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 pt-5 border-t border-border/50",children:i.map(c=>e.jsxs(ce,{to:`/article/${c.slug}`,className:"group flex gap-3 items-start focus:outline-none focus:ring-2 focus:ring-primary rounded-md p-1 -m-1",children:[e.jsx("div",{className:"w-20 h-20 flex-shrink-0 overflow-hidden rounded bg-muted",children:e.jsx("img",{src:ue(c.image_url,200),alt:c.title,loading:"lazy",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("span",{className:"font-accent text-[9px] tracking-[0.15em] font-bold uppercase block mb-1",style:{color:ge(c.categories?.slug)},children:c.categories?.name||"News"}),e.jsx("h4",{className:"font-display text-sm font-bold leading-tight line-clamp-3 group-hover:text-primary transition-colors",children:c.title})]})]},c.id))})]})},ba=({articleTitle:r,articleSlug:a})=>{const[t,n]=I.useState(!1),[l,i]=I.useState(!1),c=`${window.location.origin}/article/${a}
3`,d=Cr(a),g=typeof navigator<"u"&&!!navigator.share;I.useEffect(()=>{if(!l)return;const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}},[l]);const w=(m,k)=>{window.open(m,"_blank",k?`noopener,noreferrer,${k}`:"noopener,noreferrer")},h=()=>w(`https://x.com/intent/post?text=${encodeURIComponent(r)}&url=${encodeURIComponent(d)}&via=mymixtapez`),j=()=>w(`https://www.facebook.com/sharer/sharer.php?u=${encodeURIComponent(d)}`,"width=600,height=400"),N=()=>w(`https://wa.me/?text=${encodeURIComponent(`${r} ${d}`)}`),_=()=>w(`https://www.reddit.com/submit?url=${encodeURIComponent(d)}&title=${encodeURIComponent(r)}`),f=()=>w(`https://t.me/share/url?url=${encodeURIComponent(d)}&text=${encodeURIComponent(r)}`),y=()=>window.open(`sms:?body=${encodeURIComponent(`${r} ${d}`)}`,"_self"),$=()=>w(`https://www.threads.net/intent/post?text=${encodeURIComponent(`${r} ${d}`)}`),x=async()=>{try{await navigator.clipboard?.writeText(c)}catch{}n(!0),setTimeout(()=>n(!1),2e3)},C=()=>{x(),w("https://www.instagram.com/mymixtapez/")},P=()=>{x(),w("https://www.tiktok.com/@mymixtapez")},E=async()=>{if(navigator.share)try{await navigator.share({title:r,url:c})}catch{}},T=({className:m="h-5 w-5"})=>e.jsx("svg",{className:m,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 01-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 01-2.88 2.5 2.89 2.89 0 01-2.89-2.89 2.89 2.89 0 012.89-2.89c.28 0 .54.04.79.1v-3.5a6.37 6.37 0 00-.79-.05A6.34 6.34 0 003.15 15.2a6.34 6.34 0 006.34 6.34 6.34 6.34 0 006.34-6.34V9.42a8.16 8.16 0 004.76 1.52v-3.4a4.85 4.85 0 01-1-.85z"})}),D=({className:m="h-5 w-5"})=>e.jsx("svg",{className:m,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:e.jsx("path",{d:"M12.186 24h-.007C5.461 23.956.057 18.51 0 11.757 0 5.27 5.383 0 12.014 0c6.487 0 11.693 5.107 11.986 11.558.28 6.178-4.652 11.603-10.814 12.378v-8.71h2.928l.56-3.594h-3.488v-2.33c0-.983.482-1.942 2.026-1.942h1.567V4.126s-1.422-.243-2.782-.243c-2.838 0-4.693 1.72-4.693 4.836v2.742H6.369v3.594h2.935V24z"})}),M="flex items-center justify-center w-11 h-11 rounded-full bg-card border border-border active:scale-95 transition-transform",X=[{label:"Instagram",onClick:C,icon:e.jsx(St,{className:"h-5 w-5 text-white"}),bg:"bg-[linear-gradient(45deg,#f09433_0%,#e6683c_25%,#dc2743_50%,#cc2366_75%,#bc1888_100%)] border-transparent"},{label:"X / Twitter",onClick:h,icon:e.jsx(Je,{className:"h-5 w-5 text-white"}),bg:"bg-black border-transparent"},{label:"TikTok",onClick:P,icon:e.jsx(T,{className:"h-5 w-5 text-white"}),bg:"bg-black border-transparent"},{label:"Facebook",onClick:j,icon:e.jsx(Nr,{className:"h-5 w-5 text-white",fill:"currentColor"}),bg:"bg-[#1877F2] border-transparent"},{label:"WhatsApp",onClick:N,icon:e.jsx(ze,{className:"h-5 w-5 text-white"}),bg:"bg-[#25D366] border-transparent"},{label:"Messages",onClick:y,icon:e.jsx(et,{className:"h-5 w-5 text-white"}),bg:"bg-[#34C759] border-transparent"},{label:"Reddit",onClick:_,icon:e.jsx(et,{className:"h-5 w-5 text-white"}),bg:"bg-[#FF4500] border-transparent"},{label:"Telegram",onClick:f,icon:e.jsx(_r,{className:"h-5 w-5 text-white"}),bg:"bg-[#229ED9] border-transparent"},{label:"Threads",onClick:$,icon:e.jsx(D,{className:"h-5 w-5 text-white"}),bg:"bg-black border-transparent"},{label:t?"Copied!":"Copy link",onClick:x,icon:t?e.jsx(tt,{className:"h-5 w-5 text-white"}):e.jsx(Et,{className:"h-5 w-5 text-white"}),bg:t?"bg-green-500 border-transparent":"bg-foreground border-transparent"}];return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed bottom-20 left-1/2 -translate-x-1/2 z-40 xl:hidden",children:e.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1.5 rounded-full bg-background/95 backdrop-blur-md border border-border shadow-lg",children:[g?e.jsx("button",{onClick:E,className:M,"aria-label":"Share",children:e.jsx(jr,{className:"h-4.5 w-4.5"})}):e.jsx("button",{onClick:h,className:M,"aria-label":"Share on X",children:e.jsx(Je,{className:"h-4.5 w-4.5"})}),e.jsx("button",{onClick:C,className:M,"aria-label":"Share on Instagram",children:e.jsx(St,{className:"h-4.5 w-4.5"})}),e.jsx("button",{onClick:h,className:M,"aria-label":"Share on X",children:e.jsx(Je,{className:"h-4.5 w-4.5"})}),e.jsx("button",{onClick:x,className:M,"aria-label":"Copy link",children:t?e.jsx(tt,{className:"h-4.5 w-4.5 text-green-500"}):e.jsx(Et,{className:"h-4.5 w-4.5"})}),e.jsx("button",{onClick:()=>i(!0),className:M,"aria-label":"More share options",children:e.jsx(us,{className:"h-4.5 w-4.5"})})]})}
3),l&&e.jsxs("div",{className:"fixed inset-0 z-[60] xl:hidden",role:"dialog","aria-modal":"true","aria-label":"Share",children:[e.jsx("div",{className:"absolute inset-0 bg-background/70 backdrop-blur-sm animate-fade-in",onClick:()=>i(!1)}),e.jsxs("div",{className:"absolute bottom-0 left-0 right-0 bg-background border-t border-border rounded-t-2xl shadow-2xl pb-[env(safe-area-inset-bottom)] animate-slide-up",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 pt-4 pb-2",children:[e.jsx("h3",{className:"font-display text-base font-semibold",children:"Share article"}),e.jsx("button",{onClick:()=>i(!1),"aria-label":"Close",className:"p-1.5 rounded-full hover:bg-secondary",children:e.jsx(Rt,{className:"h-5 w-5"})})]}),e.jsx("div",{className:"px-3 pb-5 pt-2",children:e.jsx("div",{className:"grid grid-cols-4 gap-2",children:X.map(m=>e.jsxs("button",{onClick:()=>{m.onClick(),!m.label.toLowerCase().startsWith("copy")&&!m.label.startsWith("Copied")&&i(!1)},className:"flex flex-col items-center gap-1.5 py-3 px-1 rounded-xl hover:bg-secondary active:scale-95 transition-all",children:[e.jsx("span",{className:`flex items-center justify-center w-12 h-12 rounded-full border ${m.bg} shadow-sm`,children:m.icon}),e.jsx("span",{className:"font-accent text-[10px] tracking-wide text-muted-foreground text-center leading-tight",children:m.label})]},m.label))})})]})]})]})},ya=({image:r,title:a})=>{const[t,n]=I.useState(r),[l,i]=I.useState(!1);return e.jsxs("div",{className:"w-full h-[40vh] md:h-[50vh] relative overflow-hidden",children:[l?e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-primary/20 via-card to-secondary flex items-center justify-center",children:e.jsx("span",{className:"font-display text-4xl font-bold tracking-[0.15em] text-foreground/20 uppercase max-w-lg text-center leading-tight",children:a})}):e.jsx("img",{src:t,alt:a,className:"w-full h-full object-cover object-top",onError:()=>{l||(i(!0),n(Zr()))}}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-background via-background/40 to-transparent"}),e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-background/50 to-transparent"})]})},Ra=()=>{const{slug:r}=zr(),a=Hr(),{data:t,isLoading:n}=te({queryKey:["article",r],queryFn:async()=>{const{data:p,error:A}=await O.from("articles").select("*, categories(name, slug, color)").eq("slug",r).maybeSingle();if(A)throw A;return p},enabled:!!r});I.useEffect(()=>{t?.id&&hs(t.id,t.categories?.slug)},[t?.id,t?.categories?.slug]);const{data:l}=te({queryKey:["related-articles",t?.category_id,t?.id],queryFn:async()=>{const{data:p,error:A}=await O.from("articles").select("*, categories(name, slug, color)").not("published_at","is",null).eq("category_id",t.category_id).neq("id",t.id).order("published_at",{ascending:!1}).limit(6);if(A)throw A;return p},enabled:!!t?.category_id&&!!t?.id}),{data:i}=te({queryKey:["discover-articles",t?.category_id,t?.id],queryFn:async()=>{const{data:p,error:A}=await O.from("articles").select("*, categories(name, slug, color)").not("published_at","is",null).neq("category_id",t.category_id).neq("id",t.id).order("published_at",{ascending:!1}).limit(4);if(A)throw A;return p},enabled:!!t?.category_id&&!!t?.id}),{data:c}=te({queryKey:["article-artists",t?.id],queryFn:async()=>{const{data:p,error:A}=await O.from("article_artists").select("artists(name, slug)").eq("article_id",t.id);if(A)throw A;return(p||[]).map(v=>v.artists).filter(Boolean)},enabled:!!t?.id}),{data:d}=te({queryKey:["all-artists-for-linking"],queryFn:async()=>{const{data:p,error:A}=await O.from("artists").select("name, slug").order("name");if(A)throw A;return p||[]},staleTime:60*60*1e3,gcTime:60*60*1e3}),g=t?.content?.includes("<p>")||t?.content?.includes("<a ")||!1,w=I.useMemo(()=>{if(!g||!t?.content)return t?.content||"";const p=c||[],A=new Set(p.map(L=>L.slug)),v=(d||[]).filter(L=>!A.has(L.slug));return Vs(t.content,[...p,...v])},[t?.content,g,c,d]);if(n)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(yt,{}),e.jsx("main",{id:"main-content",className:"container py-10",children:e.jsxs("div",{className:"max-w-3xl mx-auto 
3space-y-4 animate-pulse",children:[e.jsx("div",{className:"h-6 bg-secondary rounded w-24"}),e.jsx("div",{className:"h-10 bg-secondary rounded w-full"}),e.jsx("div",{className:"h-64 bg-secondary rounded-xl"}),e.jsx("div",{className:"h-4 bg-secondary rounded w-full"}),e.jsx("div",{className:"h-4 bg-secondary rounded w-3/4"})]})}),e.jsx(wt,{})]});if(!t)return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(yt,{}),e.jsxs("main",{id:"main-content",className:"container py-20 text-center",children:[e.jsx("h1",{className:"headline-section mb-4",children:"ARTICLE NOT FOUND"}),e.jsx("p",{className:"font-body text-muted-foreground mb-6",children:"This story may have been removed or doesn't exist."}),e.jsx(ce,{to:"/",className:"font-display text-[12px] tracking-[0.15em] font-semibold px-8 py-3 bg-primary text-primary-foreground rounded-lg hover:bg-primary/90 transition-colors",children:"BACK TO HOME"})]}),e.jsx(wt,{})]});const h=ge(t.categories?.slug),j=Ie(t.published_at||t.created_at),N=ue(t.image_url,1200),_=Vr(t.image_url),f=Yr(t.image_url),y=Xr(t.image_url),$=g?[]:t.content?.split(`
4`).filter(p=>p.trim())||[],x=(t.content||"").replace(/<[^>]+>/g," ").split(/\s+/).filter(Boolean).length,C=Math.max(1,Math.ceil(x/220)),P=x<300,E=gs(t.id),T=(c||[]).map(p=>p.name),D=t.excerpt?t.excerpt:T.length>0?`Read about ${T.slice(0,2).join(" & ")} — ${t.title}. Breaking hip-hop news and culture from MyMixtapez.`:`${t.title} — breaking hip-hop news, album reviews, and culture updates from MyMixtapez.`,M=T.join(", "),X=[t.categories?.name||"hip hop",M,"hip hop news","rap","music",...t.title.split(" ").slice(0,4)].filter(Boolean).join(", "),m="https://mymixtapez.com",k=[{"@context":"https://schema.org","@type":"NewsArticle",headline:t.title.slice(0,110),alternativeHeadline:t.excerpt||"",description:D,image:[y,N,f,_],datePublished:t.published_at||t.created_at,dateModified:t.updated_at||t.created_at,wordCount:x,author:{"@type":"Person",name:E.name,jobTitle:E.role,url:`${m}/about#${E.slug}`,worksFor:{"@type":"Organization",name:"MyMixtapez",url:m},...E.sameAs&&E.sameAs.length>0?{sameAs:E.sameAs}:{}},publisher:{"@type":"Organization",name:"MyMixtapez",url:m,logo:{"@type":"ImageObject",url:`${m}/og-image.png`,width:1200,height:630}},mainEntityOfPage:{"@type":"WebPage","@id":`${m}/article/${t.slug}`},articleSection:t.categories?.name||"News",keywords:X,inLanguage:"en-US",isAccessibleForFree:!0,...T.length>0?{about:T.map(p=>({"@type":"MusicGroup",name:p}))}:{},speakable:{"@type":"SpeakableSpecification",cssSelector:["[itemprop='headline']","[itemprop='description']"]}}],xe=(t.is_trending||t.is_featured)&&!P?`https://wumldpctdupoijfqcuzo.supabase.co/functions/v1/web-story?slug=${t.slug}`:void 0;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Qr,{title:t.title,description:D,canonical:`/article/${t.slug}`,ogImage:N,portraitImage:_,squareImage:f,ogType:"article",keywords:X,noindex:P,article:{publishedTime:t.published_at||t.created_at,modifiedTime:t.updated_at||t.created_at,section:t.categories?.name||"News",author:E.name,tags:[t.categories?.name||"News","Hip-Hop","Rap",...T]},breadcrumbs:[{name:"Home",url:"/"},{name:t.categories?.name||"News",url:`/category/${t.categories?.slug||"news"}`},{name:t.title,url:`/article/${t.slug}`}],jsonLd:k,amphtml:xe}),e.jsx(yt,{}),e.jsx("div",{className:"container pt-2",children:e.jsx(Ze,{size:"leaderboard"})}),e.jsx(ya,{image:N,title:t.title}),e.jsxs("main",{id:"main-content",className:"container -mt-32 relative z-10 pb-8",children:[e.jsxs("button",{onClick:()=>a(-1),className:"flex items-center gap-1.5 font-accent text-[11px] tracking-[0.15em] text-muted-foreground hover:text-foreground transition-colors mb-4 group",children:[e.jsx(ps,{className:"h-3.5 w-3.5 group-hover:-translate-x-0.5 transition-transform"}),"BACK"]}),e.jsx(Jr,{items:[{label:"Home",href:"/"},{label:t.categories?.name||"News",href:`/category/${t.categories?.slug||"news"}`},{label:t.title}]}),e.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-[1fr_300px] gap-10",children:[e.jsxs("article",{itemScope:!0,itemType:"https://schema.org/NewsArticle",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-4",children:[e.jsx("span",{className:`category-label px-3 py-1 rounded-sm ${h} bg-primary/15`,itemProp:"articleSection",children:t.categories?.name?.toUpperCase()||"NEWS"}),e.jsxs("time",{className:"flex items-center gap-1.5 font-accent text-[11px] text-muted-foreground tracking-wider",dateTime:t.published_at||t.created_at,itemProp:"datePublished",children:[e.jsx(Sr,{className:"h-3 w-3"}),j]}),e.jsxs("span",{className:"font-accent text-[11px] text-muted-foreground tracking-wider",children:["•  ",C," min read"]}),e.jsxs("span",{className:"font-accent text-[11px] text-muted-foreground tracking-wider",children:["•  By ",e.jsxs("span",{className:"text-foreground font-semibold",itemProp:"author",itemScope:!0,itemType:"https://schema.org/Person",children:[e.jsx("span",{itemProp:"name",children:E.name}),e.jsx("meta",{itemProp:"jobTitle",content:E.role})]})]})]}),xe&&e.jsxs("a",{href:xe,target:"_blank",rel:"noopener",className:"inline-flex items-center gap-2 mb-4 px-3 py-1.5 rounded-full bg-primary/15 border border-primary/30 hover:bg-primary/25 transition-colors font-accent text-[11px] tracking-[0.15em] uppercase text-primary","aria-label":"View this 
4story as a Google Web Story",children:[e.jsx("span",{"aria-hidden":!0,children:"▶"})," View Web Story"]}),e.jsx("h1",{className:"headline-display mb-5",itemProp:"headline",children:t.title}),t.excerpt&&e.jsx("p",{className:"font-body text-lg text-muted-foreground mb-6 leading-relaxed border-l-[3px] border-primary pl-5",itemProp:"description",children:t.excerpt}),N&&e.jsx("div",{className:"mb-8 rounded-xl overflow-hidden border border-border",children:e.jsx("img",{src:N,alt:t.title,className:"w-full h-auto object-cover",itemProp:"image",loading:"eager"})}),e.jsx("meta",{itemProp:"author",content:E.name}),e.jsx("meta",{itemProp:"publisher",content:"MyMixtapez"}),t.image_url&&e.jsx("meta",{itemProp:"image",content:N}),e.jsx("div",{className:"mb-8 pb-6 border-b border-border",children:e.jsx(ra,{articleId:t.id,articleTitle:t.title,articleSlug:t.slug})}),g?(()=>{const p=Ks.sanitize(w,{ALLOWED_TAGS:["p","a","em","strong","blockquote","br","ul","ol","li","h2","h3","h4","img","figure","figcaption"],ALLOWED_ATTR:["href","target","rel","src","alt","class","loading","width","height"]});if(!(p.length>1500))return e.jsx("div",{className:"article-body font-body text-[15px] text-secondary-foreground leading-[1.8]",itemProp:"articleBody",dangerouslySetInnerHTML:{__html:p}});const v=p.split(/(<\/p>)/i),L=Math.floor(v.length*.75),W=v.slice(0,L).join(""),fe=v.slice(L).join("");return e.jsxs("div",{itemProp:"articleBody",children:[e.jsx("div",{className:"article-body font-body text-[15px] text-secondary-foreground leading-[1.8]",dangerouslySetInnerHTML:{__html:W}}),e.jsx("div",{className:"article-body font-body text-[15px] text-secondary-foreground leading-[1.8]",dangerouslySetInnerHTML:{__html:fe}})]})})():e.jsx("div",{className:"space-y-6",itemProp:"articleBody",children:$.map((p,A)=>e.jsx("div",{className:"contents",children:e.jsx("p",{className:"font-body text-[15px] text-secondary-foreground leading-[1.8]",children:p.split(/(@\w+)/g).map((v,L)=>v.startsWith("@")?e.jsx("span",{className:"text-primary font-semibold",children:v},L):e.jsx("span",{children:v},L))})},A))}),e.jsx("div",{className:"my-8 p-5 rounded-xl border border-border bg-card/50",children:e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-primary/20 flex items-center justify-center flex-shrink-0",children:e.jsx("span",{className:"font-display text-lg font-bold text-primary",children:E.name.charAt(0)})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-display text-sm font-bold tracking-wide",children:E.name}),e.jsx("p",{className:"font-accent text-[11px] tracking-[0.1em] text-primary mb-2",children:E.role}),e.jsx("p",{className:"font-body text-[13px] text-muted-foreground leading-relaxed",children:E.bio})]})]})}),e.jsx(xa,{articles:l||[],categoryName:t.categories?.name,categorySlug:t.categories?.slug}),e.jsx(Ze,{size:"in-article"}),e.jsx(ga,{articles:i||[]}),e.jsx(aa,{articleId:t.id}),e.jsx(na,{articleId:t.id}),e.jsx(ua,{articleId:t.id}),e.jsx(Qs,{articleTitle:t.title,cachedVideoId:t.youtube_video_id})]}),e.jsx("div",{className:"hidden xl:block",children:e.jsx("div",{className:"sticky top-24",children:e.jsx(Zs,{relatedArticles:l})})})]})]}),e.jsx("div",{className:"container",children:e.jsx(Ze,{size:"multiplex"})}),l&&l.length>0&&e.jsxs("section",{className:"container pb-8","aria-label":"Related stories",children:[e.jsx("div",{className:"divider-editorial mb-10"}),e.jsxs("div",{className:"flex items-end justify-between mb-8",children:[e.jsxs("div",{children:[e.jsx("span",{className:"section-label block mb-1",children:"Keep Reading"}),e.jsx("h2",{className:"headline-section",children:"Related Stories"}),e.jsx("div",{className:"glow-line w-16 mt-2"})]}),t.categories?.slug&&e.jsxs(ce,{to:`/category/${t.categories.slug}`,className:"font-accent text-[11px] tracking-[0.15em] text-primary hover:text-primary/80 transition-colors",children:["MORE ",t.categories.name?.toUpperCase()," →"]})]}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-3 gap-5",children:l.map(p=>e.jsx(sr,{image:ue(p.image_url,400),category:p.categories?.name?.toUpperCase()||"NEWS",categoryColor:ge(p.categories?.slug),title:p.title,excerpt:p.excerpt||"",time:Ie(p.published_at||p.created_at),slug:p.slug,size:"medium"},p.id))})]}),i&&i.length>0&&e.jsxs("section",{className:"container pb-8",children:[e.jsx("div",{className:"divider-editorial mb-10"}),e.jsxs("div",{className:"mb-8",children:[e.jsx("span",{className:"section-label block mb-1",children:"Explore More"}),e.jsx("h2",{className:"headline-section",children:"You Might Also Like"}),e.jsx("div",{className:"glow-line w-16 mt-2"})]}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:i.map(p=>e.jsx(sr,{image:ue(p.image_url,300),category:p.categories?.name?.toUpperCase()||"NEWS",categoryColor:ge(p.categories?.slug),title:p.title,excerpt:"",time:Ie(p.published_at||p.created_at),slug:p.slug,size:"small"},p.id))})]}),e.jsx(ba,{articleTitle:t.title,articleSlug:t.slug}),e.jsx(pa,{nextArticle:l?.[0]||null}),e.jsx(ha,{}),e.jsx(wt,{})]})};export{Ra 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.