PageSourceSearch

https://www.chraft.ai/_next/static/chunks/21181.b8c5578171b149d5.js

js chraft.ai collected 2026-10-05 11:56:51 UTC 4,450 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[21181],{21181:(e,t,n)=>{n.r(t),n.d(t,{default:()=>c});var l=n(95155),r=n(12115),a=n(65229),i=n(78803),s=n(3404),o=n(20063),u=n(22521);function c(e){var t,n,c,d,h,m,f;let{className:g=""}=e,{lang:b}=(0,i.o)(),x=(0,o.useRouter)(),[v,w]=(0,r.useState)(!1),[p,y]=(0,r.useState)(!1),[N,j]=(0,r.useState)(!0),[k,S]=(0,r.useState)(0),[A,E]=(0,r.useState)(!1),C=(null==(t=u.A.banner)?void 0:t.banners)||[],I=C.length>1,T=(0,r.useCallback)(()=>{var e;if(!(null==(e=u.A.banner)?void 0:e.enabled)||0===C.length)return[];try{let e=localStorage.getItem("hiddenBanners"),t=JSON.parse(e||"[]");return C.filter(e=>!t.includes(e.id))}catch(e){return console.warn("localStorage not available, showing all banners"),C}},[C]);if((0,r.useEffect)(()=>{var e;if(y(!0),!(null==(e=u.A.banner)?void 0:e.enabled)||0===C.length)return void w(!1);let t=setTimeout(()=>{w(T().length>0)},50);return()=>clearTimeout(t)},[C,T]),(0,r.useEffect)(()=>{var e;if(!(null==(e=u.A.banner)?void 0:e.autoRotate)||!I||A)return;let t=T();if(t.length<=1)return;let n=setInterval(()=>{S(e=>(e+1)%t.length)},u.A.banner.rotateInterval||5e3);return()=>clearInterval(n)},[I,A,T]),(0,r.useEffect)(()=>{let e=()=>{j(window.scrollY<=50)};e();let t=!1,n=()=>{t||(requestAnimationFrame(()=>{e(),t=!1}),t=!0)};return window.addEventListener("scroll",n,{passive:!0}),()=>{window.removeEventListener("scroll",n)}},[]),!p||!v||!(null==(n=u.A.banner)?void 0:n.enabled))return null;let P=T();if(0===P.length)return null;let _=P[k];if(!_)return null;let B=s.P.banner.banners.find(e=>e.id===_.id),J=(null==B||null==(c=B[b])?void 0:c.text)||(null==B||null==(d=B.en)?void 0:d.text)||"",O=(null==B||null==(h=B[b])?void 0:h.buttonText)||(null==B||null==(m=B.en)?void 0:m.buttonText)||"",L=(null==(f=s.P.banner.common[b])?void 0:f.close)||s.P.banner.common.en.close;return(0,l.jsx)("div",{className:"sticky top-0 w-full ".concat((()=>{switch(_.style){case"dark":return"bg-black/80 text-white";case"gold":return"bg-yellow-500 text-white";case"blue":return"bg-blue-600 text-white";case"green":return"bg-green-600 text-white";case"pink":return"bg-pink-600 text-white";case"indigo":return"bg-indigo-600 text-white";case"cyan":return"bg-cyan-600 text-white";default:return"bg-primary text-white"}})()," ").concat(g," z-[20] transition-all duration-300 ease-in-out ").concat(N?"translate-y-0":"-translate-y-full"),"data-top-banner":!0,children:(0,l.jsx)("div",{className:"container mx-auto px-3 sm:px-4 py-2 sm:py-2",children:(0,l.jsxs)("div",{className:"relative flex items-center justify-center min-h-[3rem] sm:min-h-0",children:[(0,l.jsxs)("div",{className:"text-center max-w-full pr-8",children:[(0,l.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-center gap-2 sm:gap-4",children:[(0,l.jsx)("span",{className:"text-xs sm:text-sm md:text-base font-medium px-2 leading-tight",children:J}),O&&(0,l.jsx)("button",{onClick:()=>{var e,t;let n=T()[k];if(!n)return;let l=s.P.banner.banners.find(e=>e.id===n.id),r=(null==l||null==(e=l[b])?void 0:e.buttonUrl)||(null==l||null==(t=l.en)?void 0:t.buttonUrl);r&&x.push(r)},className:"inline-flex items-center justify-center px-3 py-1.5 sm:px-4 sm:py-2 text-xs sm:text-sm font-medium text-gray-900 bg-white rounded-lg hover:bg-gray-50 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 whitespace-nowrap",children:O})]}),I&&P.length>1&&(0,l.jsx)("div",{className:"flex items-center justify-center gap-1.5 mt-2",children:P.map((e,t)=>(0,l.jsx)("button",{onClick:()=>{E(!0),S(t),setTimeout(()=>E(!1),2e3)},className:"h-1.5 rounded-full transition-all duration-300 ".concat(t===k?"w-6 bg-white":"w-1.5 bg-white/40 hover:bg-white/60"),"aria-label":"Go to banner ".concat(t+1)},t))})]}),(0,l.jsx)("button",{onClick:()=>{let e=T();if(0===e.length)return;let t=e[k];if(t)try{let n=JSON.parse(localStorage.getItem("hiddenBanners")||"[]");n.includes(t.id)||(n.push(t.id),localStorage.setItem("hiddenBanners",JSON.stringify(n)));let l=e.filter(e=>!n.includes(e.id));0===l.length?w(!1):S(0)}catch(e){console.error("Error hiding banner:",e)}}
1,className:"absolute right-0 top-1/2 -translate-y-1/2 p-1.5 sm:p-1 rounded-full hover:bg-white/10 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 touch-manipulation","aria-label":L,children:(0,l.jsx)(a.A,{className:"h-4 w-4 sm:h-5 sm:w-5"})})]})})})}}}]);

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.