(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,233896,e=>{"use strict";let t,a;var o=e.i(902875),n=e.i(247865),r=e.i(725287),l=e.i(581014),i=e.i(438335),d=e.i(16838),s=e.i(650561),c=e.i(528600),u=e.i(546446),m=e.i(849177),b=e.i(5397),p=e.i(204782);let h=/\/libtrc\/([^/]+)\/loader\.js/,f=e=>{let t=e.match(h);return t?.[1]??null},g="tb_loader_script",x=`${g}_fb`,w=(t="",a=!1,()=>({pushTaboolaCommand:(0,n.useCallback)((e,o,n)=>{window._taboola=window._taboola||[],o!==t&&(""===t||a||(window._taboola.push({notify:"newPageLoad"}),a=!0),t=o,a=!1),window._taboola.push({[n]:"auto",url:o}),window._taboola.push(e),window._taboola.push({flush:!0})},[])}));var _=e.i(176540);let v=({showTaboola:e=!0,globalPageProps:t,...a})=>{let{user:n}=(0,c.useUser)(),r=(0,u.useAtomValue)(m.adsDisabledAtom),l=(0,p.default)(),{article:i}=t||{},d=(0,_.default)(i);return n.isUserPremium||r||!l||!e||d?null:(0,o.jsx)(y,{...a})},y=({taboolaId:e,taboolaUiMode:t,placementName:a,title:c="",pageType:m,taboolaType:p,loaderUrl:h})=>{let _=(0,n.useRef)(null),[v,y]=(0,n.useState)("pending"),C=(0,r.usePathname)(),{isTaboolaLoaded:j}=(e=>{let[t,a]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let o,n;if(t)return;if(document.getElementById(g)||document.getElementById(x))return void a(!0);window._taboola=window._taboola||[],window.performance&&"function"==typeof window.performance.mark&&window.performance.mark("tbl_ic");let r=(o=f(e))?`https://static.qovani.com/libtrc/tr5?type=pixel&publisher=${encodeURIComponent(o)}`:null;r&&(new Image().src=r);let l=(e,t,o)=>{let n=document.createElement("script");n.src=t,n.id=e,n.async=!0,n.onload=()=>{a(!0)},n.onerror=()=>{n.parentNode?.removeChild(n),o?l(x,o,null):console.error("Failed to load Taboola script.")},document.body.appendChild(n)};l(g,e,(n=f(e))?`//static.tblcontent.com/libtrc/${n}/loader.privacy.js`:null)},[t,e]),{isTaboolaLoaded:t}})(h),{pushTaboolaCommand:N}=w(),T=(0,u.useAtomValue)(b.showAdminHeaderAtom),k=(0,l.useTranslations)("Taboola"),B=c||k("sponsoredContent"),A=(0,n.useMemo)(()=>{let e=(0,i.getPublicURL)();return`${e}${C||""}`},[C]),E="empty"!==v,P=(0,n.useMemo)(()=>{let t="taboola-below-content-thumbnails---video"===e||"taboola-below-content-thumbnails-video"===e;return{container:E?"generic"!==p?"wx-media-object gradient-overlay thirdparty-feed border":t?"gap-2 py-0 md:rounded-md max-sm:rounded-none":"gap-2":"hidden",headerContainer:t?"mx-4 px-0 pt-6 max-sm:border-t max-sm:border-gray-200":"",header:t?"text-[20px] font-semibold":"text-xl font-semibold"}},[e,p,E]);return((0,n.useEffect)(()=>{j&&"pending"===v&&N({mode:t,container:e,placement:a,target_type:"mix"},A,m)},[j,v,N,e,t,a,A,m]),(0,n.useEffect)(()=>{let e=_.current;if(!e||!j)return;let t=new MutationObserver((t,a)=>{try{e.hasChildNodes()?(y("populated"),a.disconnect()):"pending"!==v&&(y("empty"),a.disconnect())}catch(e){console.warn("Error in TaboolaBlockClient content observer",e)}});return t.observe(e,{childList:!0}),e.hasChildNodes()&&(y("populated"),t.disconnect()),()=>t.disconnect()},[j,v]),j)?"invisible"===p?(0,o.jsx)("div",{id:e,ref:_}):(0,o.jsxs)("section",{className:"@container",children:[(0,o.jsx)(d.DebugCollector,{componentName:"TaboolaBlockClient",data:{props:{taboolaId:e,taboolaUiMode:t,placementName:a,title:c,resolvedTitle:B,taboolaType:p,pageType:m,pageUrl:A,taboolaContentState:v,shouldShow:E}},enabled:T}),"generic"===p?(0,o.jsxs)(s.Card,{className:P.container,children:[E&&(0,o.jsx)(s.CardHeader,{className:P.headerContainer,children:(0,o.jsx)("h2",{className:P.header,children:B})}),(0,o.jsx)(s.CardContent,{children:(0,o.jsx)("div",{id:e,className:"bg-none",ref:_})})]}):(0,o.jsxs)("div",{className:P.container,children:[E&&(0,o.jsx)("header",{"aria-label":"Taboola",className:"panel-heading mb-2",children:(0,o.jsx)("h2",{"data-testid":"taboolaHeading",className:"text-lg font-medium",children:B})}),(0,o.jsx)("div",{id:e,className:"flex min-h-[300px] w-full items-center justify-center",ref:_})]})]}):null};e.s(["TaboolaBlockClient",0,v,"TaboolaBlockView",0,y,"default",0,v],233896)},898137,function(e){e.n(e.i(233896))},176540,e=>{"use strict";e.s(["default",0,function(e){return!!e?.category&&"atmosphere"===function(e){if(!e?.value)return;let{value:t}=e;if("string"==typeof t)return t.split("/")[0];let a=t.pathSegments?.[0]?.segment;return"string"==typeof a&&a.length>0?a:"string"==typeof t.id&&t.id.length>0?t.id.split("/")[0]:void 0}(e.category)}],176540)},650561,e=>{"use strict";var t=e.i(902875),a=e.i(632137);e.s(["Card",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,a.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl py-6",e),...o})},"CardContent",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,a.cn)("px-6",e),...o})},"CardHeader",0,function({className:e,...o}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,a.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...o})}])}]);