1!function(){try{var t="u">typeof window?window:"u">typeof global?global:"u">typeof globalThis?globalThis:"u">typeof self?self:{},e=(new t.Error).stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="6f923770-70eb-43bc-8304-bc56ac0d0254",t._sentryDebugIdIdentifier="sentry-dbid-6f923770-70eb-43bc-8304-bc56ac0d0254")}catch(t){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2329],{2609:()=>{},17224:(t,e,a)=>{"use strict";a.r(e),a.d(e,{__N_SSG:()=>tU,default:()=>tL});var r,s,n=a(66352),o=a(60703),i=a(95132),l=a(86843),b=a.n(l),d=a(97082),c=a(45521),h=a(34418),u=a(95708),m=a(588),p=a(53220),f=a(89848),x=a(51524),g=a(98679),w=a(94067),j=a(67049),y=a(34531),v=a(74605),_=a(72276),k=a(98488),N=a(94749),C=a(42060),$=a(53240),E=a(46182),S=a(75910),U=a(18017),L=a.n(U),A=a(56664);let z=({path:t})=>{let e=(0,A.useRouter)(),a=(0,C.K)(),r=(0,_.FB)(a||"ab"),{locale:s}=e,{$tl:o}=(0,m.W)();return(0,n.jsxs)(b(),{children:[(0,n.jsx)("title",{children:o("headshot.generator.title")}),(0,n.jsx)("meta",{name:"description",content:o("headshot.generator.description")}),(0,n.jsx)("meta",{name:"keywords",content:o("headshot.generator.kw")}),(0,n.jsx)("meta",{property:"og:title",content:o("headshot.generator.og.title")}),(0,n.jsx)("meta",{property:"og:description",content:o("headshot.generator.og.description")}),(0,n.jsx)("meta",{property:"og:type",content:"website"}),(0,n.jsx)("meta",{property:"og:url",content:`https://${r}${"en"===s?"":`/${s}`}${t||e.asPath}`}),(0,n.jsx)("meta",{property:"og:image",content:o("headshot.generator.img.url")}),(0,n.jsx)("meta",{property:"og:image:alt",content:o("headshot.generator.og.img.alt")}),(0,n.jsx)("meta",{property:"twitter:title",content:o("headshot.generator.twitter.title")}),(0,n.jsx)("meta",{property:"twitter:description",content:o("headshot.generator.twitter.description")})]})};var I=a(30193);let R=["https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/use-cases_1.jpg","https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/use-cases_2.jpg","https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/use-cases_3.jpg","https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/use-cases_4.jpg"],q=()=>{let{$tl:t}=(0,m.W)(),e=(0,C.K)();N.Cp[e][$.i0.AiHeadShot];let a=(0,i.useCallback)(()=>{window.scrollTo({top:0,behavior:"smooth"})},[]),r=(0,i.useMemo)(()=>[{title:t("headshot.generator.what.h2.1"),content:t("headshot.generator.what.content.1"),url:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/what2_1.jpg"},{title:t("headshot.generator.what.h2.2"),content:t("headshot.generator.what.content.2"),url:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/what2_2.jpg"}],[t]),s=(0,i.useMemo)(()=>[{title:t("headshot.generator.why1.title.1"),content:t("headshot.generator.why1.content.1")},{title:t("headshot.generator.why1.title.2"),content:t("headshot.generator.why1.content.2")},{title:t("headshot.generator.why1.title.3"),content:t("headshot.generator.why1.content.3")}],[t]),o=(0,i.useMemo)(()=>[{step:t("headshot.generator.how2.title.1"),content:t("headshot.generator.how2.content.1"),src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/Howto_1.jpg"},{step:t("headshot.generator.how2.title.2"),content:t("headshot.generator.how2.content.2"),src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/Howto_2.jpg"},{step:t("headshot.generator.how2.title.3"),content:t("headshot.generator.how2.content.3"),src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/Howto_3.jpg"}],[t]),l=(0,i.useMemo)(()=>[{name:t("headshot.generator.review1.name.1"),content:t("headshot.generator.review1.content.1")},{name:t("headshot.generator.review1.name.2"),content:t("headshot.generator.review1.content.2")},{name:t("headshot.generator.review1.name.3"),content:t("headshot.generator.review1.content.3")}],[t]),b=(0,i.useMemo)(()=>[{q:t("headshot.generator.faq.h3.1"),a:t("headshot.generator.faq.content.1"),defaultOpen:!0},{q:t("headshot.generator.faq.h3.2"),a:t("headshot.generator.faq.content.2"),defaultOpen:!0},{q:t("headshot.generator.faq.h3.3"),a:t("headshot.generator.faq.content.3")},{q:t("headshot.generator.faq.h3.4"),a:t("headshot.generator.faq.content.4")},{q:t("headshot.generator.faq.h3.5"),a:t("headshot.generator.faq.content.5")},{q:t("headshot.generator.faq.h3.6"),a:t("headshot.generator.faq.content.6")}
1,{q:t("headshot.generator.faq.h3.7"),a:t("headshot.generator.faq.content.7")}],[t]),d=(0,i.useMemo)(()=>[{tab:t("headshot.generator.what5.scene.1"),title:t("headshot.generator.what5.scene.1.title"),content:t("headshot.generator.what5.scene.1.content")},{tab:t("headshot.generator.what5.scene.2"),title:t("headshot.generator.what5.scene.2.title"),content:t("headshot.generator.what5.scene.2.content")},{tab:t("headshot.generator.what5.scene.3"),title:t("headshot.generator.what5.scene.3.title"),content:t("headshot.generator.what5.scene.3.content")},{tab:t("headshot.generator.what5.scene.4"),title:t("headshot.generator.what5.scene.4.title"),content:t("headshot.generator.what5.scene.4.content")}].map((e,a)=>({...e,image:R[a],imageAlt:t("headshot.generator.img.alt.1")})),[t]);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(I.H,{type:I.wo.what1,whatList:r,imgAlt:t("headshot.generator.img.alt.1"),uploadBtn:t("headshot.generator.what5.button"),onClick:a,className:"tb-py-6"}),(0,n.jsx)(I.Ls,{items:d,title:t("headshot.generator.what5.h2"),uploadText:t("headshot.generator.what5.button"),onUploadClick:a,downloadText:t("gen.dl.buttom")}),(0,n.jsx)(I.g5,{items:s,title:t("headshot.generator.why1.h2"),uploadText:t("headshot.generator.what5.button"),onUploadClick:a}),(0,n.jsx)(I.eF,{howList:o,title:t("headshot.generator.how2.h2"),uploadText:t("headshot.generator.what5.button"),onUploadClick:a}),(0,n.jsx)(I.F1,{title:t("headshot.generator.tools.h2")}),(0,n.jsxs)("div",{className:"tb-w-full tb-bg-[#f5f7fa]",children:[(0,n.jsx)(I.gs,{title:t("headshot.generator.review1.h2"),reviews:l}),(0,n.jsx)(I.PU,{title:t("headshot.generator.faq.h2"),faqList:b})]}),(0,n.jsx)(I.Rk,{title:t("headshot.endofpage.content"),uploadText:t("headshot.generator.what5.button"),onUploadClick:a})]})};var M=a(30812),O=a(552);let D=({isInited:t,isLogin:e,usageCount:a,quality:r,creditsCost:s,disabled:o,loading:l,onGenerate:b,onLogin:d})=>{let{$tl:c}=(0,m.W)(),h=(0,i.useMemo)(()=>{if(!t)return null;if(e){let t=c(1===s?"gen.credit":"gen.credits");return(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:`${r}: <span class="tb-text-[#ff6a3b]">${s}</span> ${t}`}})}return a>0?(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:c(a>1?"gen.lim.uses":"gen.lim.use",{span:()=>`<span class="tb-text-[#ff6a3b]">${a}</span>`,n:()=>""})}}):c("gen.login.for.more",{span:t=>(0,n.jsx)("span",{role:"button",className:"tb-cursor-pointer tb-text-[#ff6a3b]",onClick:d,children:t})})},[s,t,e,d,r,a,c]);return(0,n.jsxs)("div",{className:"tb-flex tb-min-h-[41px] tb-items-center tb-justify-between tb-gap-5",children:[(0,n.jsx)("span",{className:"tb-min-w-0 tb-flex-1 tb-text-sm tb-font-medium tb-leading-normal tb-text-black/60",children:h||"\xa0"}),(0,n.jsxs)(M.$,{type:"button",size:"auto",disabled:o,className:"tb-h-[41px] tb-shrink-0 tb-gap-1 tb-rounded-full tb-bg-[#ff6a3b] tb-px-5 tb-py-2.5 tb-text-sm tb-font-semibold tb-text-white hover:tb-bg-[#ff6a3b]/90",onClick:b,children:[(0,n.jsx)(O.A,{className:"tb-size-5 tb-shrink-0","aria-hidden":!0}),c("gen.btn.generate")]})]})};var T=a(81362),P=a(2786);let W=({value:t,options:e,disabled:a,onChange:r})=>{let{$tl:s}=(0,m.W)(),[o,l]=(0,i.useState)(!1),b=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!o)return;let t=t=>{b.current?.contains(t.target)||l(!1)};return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[o]),(0,i.useEffect)(()=>{a&&l(!1)},[a]),(0,n.jsxs)("div",{ref:b,className:"tb-relative tb-flex tb-items-center tb-gap-2",children:[(0,n.jsx)("span",{className:"tb-text-xs tb-text-black",children:s("hs.resolution")}),(0,n.jsxs)("button",{type:"button",disabled:a,"aria-expanded":o,"aria-haspopup":"listbox",className:(0,P.cn)("tb-flex tb-h-6 tb-items-center tb-gap-2 tb-rounded-lg tb-border tb-border-solid tb-border-[#ff6a3b] tb-bg-[rgba(255,106,59,0.08)] tb-px-3 tb-text-xs tb-font-medium tb-leading-[1.2] tb-text-[#ff6a3b]",a&&"tb-cursor-not-allowed tb-opacity-50"),onClick:()=>l(t=>!t),children:[(0,n.jsx)("span",{className:"tb-w-4 tb-text-center",children:t}),(0,n.jsx)(T.A,{fill:"none",width:10,className:(0,P.cn)("tb-text-[#ff6a3b]",o&&"tb-rotate-180")}
1)]}),o&&(0,n.jsx)("div",{role:"listbox",className:"tb-absolute tb-right-0 tb-top-[calc(100%+4px)] tb-z-20 tb-flex tb-flex-col tb-gap-2 tb-rounded-xl tb-bg-white tb-p-1 tb-shadow-[0px_2px_4px_rgba(0,0,0,0.1)]",children:e.map(e=>(0,n.jsx)("button",{type:"button",role:"option","aria-selected":t===e.value,className:(0,P.cn)("tb-flex tb-h-6 tb-w-[52px] tb-items-center tb-justify-center tb-rounded-lg tb-px-3 tb-text-xs tb-font-medium tb-leading-[1.2] tb-text-black/80",t===e.value?"tb-bg-[#e6e9ec]":"tb-bg-white"),onClick:()=>{r(e.value),l(!1)},children:e.value},e.value))})]})};var H=a(13554),K=a.n(H),F=a(73488),V=a(14113);a(44475),a(2609);var B=a(58407);let G=[{src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/hero-image.jpg",altKey:"headshot.generator.img.alt.1"},{src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/hero-image-2.jpg",altKey:"headshot.generator.img.alt.1"},{src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/hero-image-3.jpg",altKey:"headshot.generator.img.alt.1"},{src:"https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/hero-image-4.jpg",altKey:"headshot.generator.img.alt.1"}],J=({resultImage:t,processing:e,onDownload:a})=>{let r,{$tl:s}=(0,m.W)();return r=e?(0,n.jsxs)("div",{className:"tb-absolute tb-inset-0 tb-flex tb-flex-col tb-items-center tb-justify-center tb-p-6 tb-text-center",children:[(0,n.jsx)("span",{className:"tb-size-9 tb-animate-spin tb-rounded-full tb-border-[3px] tb-border-[#ff6a3b] tb-border-r-transparent"}),(0,n.jsxs)("strong",{className:"tb-mt-4 tb-text-base tb-font-semibold tb-text-[#222]",children:[s("general.processing"),"..."]}),(0,n.jsx)("span",{className:"tb-mt-1 tb-text-xs tb-text-black/40",children:s("hs.loding")})]}):t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(K(),{src:t,alt:"AI headshot result",loading:"eager",width:620,height:424,priority:!0,unoptimized:t.startsWith("http"),className:"tb-absolute tb-inset-0 tb-size-full tb-object-contain",sizes:"620px"}),(0,n.jsxs)(M.$,{type:"button",size:"sm",className:"tb-absolute tb-bottom-3 tb-right-3 tb-h-8 tb-gap-1 tb-rounded-full tb-bg-black/60 tb-px-3 tb-text-xs tb-font-semibold tb-text-white hover:tb-bg-black/75",onClick:a,children:[(0,n.jsx)(B.A,{className:"tb-size-4 tb-fill-none"}),s("general.trigger.button")]})]}):(0,n.jsx)(F.RC,{modules:[V.Ij,V._R],effect:"fade",fadeEffect:{crossFade:!0},slidesPerView:1,loop:!0,autoplay:{delay:2500,pauseOnMouseEnter:!0,disableOnInteraction:!1},className:"tb-size-full [&_.swiper-wrapper]:tb-h-full [&_.swiper-slide]:tb-flex [&_.swiper-slide]:tb-h-full [&_.swiper-slide]:tb-items-center [&_.swiper-slide]:tb-justify-center",children:G.map(({src:t,altKey:e},a)=>(0,n.jsx)(F.qr,{children:(0,n.jsx)(K(),{src:t,alt:s(e),loading:0===a?"eager":"lazy",width:620,height:424,priority:0===a,unoptimized:t.startsWith("http"),className:"tb-block tb-max-h-full tb-max-w-full tb-object-contain",sizes:"620px"})},t))}),(0,n.jsx)("div",{className:(0,P.cn)("tb-relative tb-size-full tb-min-w-0 tb-max-w-full tb-overflow-hidden tb-bg-white",e||t?"tb-border tb-border-solid tb-border-black/10 tb-rounded-[20px]":"tb-border-0"),children:r})};var X=a(77086),Z=a(97162),Q=a(86362),Y=a(49104),tt=a.n(Y);let te=new Map,ta=function({enabled:t,scope:e,itemIds:a,itemRefs:r,onExpose:s}){let n=(0,i.useRef)(new Set),o=(0,i.useRef)([]),l=(0,i.useRef)(void 0),b=(0,i.useRef)(""),d=(0,i.useRef)(s);d.current=s;let c=a.join(",");(0,i.useEffect)(()=>{if(!t||!a.length){t||(b.current="");return}b.current!==c&&(n.current=new Set,b.current=c),o.current=[];let s=()=>{let t,a,r;if(!o.current.length)return;let s=o.current;o.current=[],t=`${e}:${s.join(",")}`,a=Date.now(),(void 0===(r=te.get(t))||!(a-r<1500))&&(te.set(t,a),1)&&d.current(s)},i=new IntersectionObserver(t=>{t.forEach(t=>{if(!t.isIntersecting)return;let e=t.target.dataset.styleId;!e||n.current.has(e)||(n.current.add(e),o.current.push(e),window.clearTimeout(l.current),l.current=window.setTimeout(s,800))})},{threshold:.5}),h=!1,u=0,m=0,p=()=>{if(h)return;let t=0;a.forEach(e=>{let a=r.current[e];a&&(i.observe(a),t+=1)}),t<a.length&&m<60&&(m+=1,u=window.requestAnimationFrame(p))};return u=window.requestAnimationFrame(p),()=>{h=!0,window.cancelAnimationFrame(u),i.disconnect(),window.clearTimeout(l.current),s()}},[t,a,r,c,e])},tr="https://public.static.meitudata.com/pixocial/airbrush-web/ai-headshot/Headshot.mp4",ts="__more__",tn=({tenant:t,open:e,categories:a,selectedId:r,adjustLink:s,onOpenChange:o,onSelect:l,onTryMore:b,onExpose:
1d})=>{let{$tl:c}=(0,m.W)(),[h,u]=(0,i.useState)(""),[p,f]=(0,i.useState)(!1),x=tt()?.[`${t}-root`]||"",g=(0,i.useRef)({}),w=(0,i.useRef)(null);(0,i.useEffect)(()=>{e&&(u(a[0]?.id||""),f(!1))},[a,e]);let j=(0,i.useMemo)(()=>a.find(t=>t.id===h)||a[0],[h,a]),y=(0,i.useMemo)(()=>j?.children.map(t=>t.id)||[],[j]);return(0,i.useEffect)(()=>{let t=p?ts:h;if(!t)return;let e=window.setTimeout(()=>{let e=w.current?.querySelector(`[data-tab-id="${CSS.escape(t)}"]`);e?.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})},200);return()=>window.clearTimeout(e)},[p,h]),ta({enabled:e&&!p&&y.length>0,scope:`dialog:${j?.id||"default"}`,itemIds:y,itemRefs:g,onExpose:d}),(0,n.jsxs)(X.l,{open:e,title:(0,n.jsx)("span",{className:"tb-block tb-pr-12 tb-text-left tb-text-xl tb-font-semibold tb-text-[#222] tb-p-6 tb-pb-0",children:c("hs.choose.style")}),footer:!1,onOpenChange:o,maskClassName:`${x} tb-bg-black/60 tb-backdrop-blur-none`,contentStyle:`${x} tb-flex tb-h-[580px] tb-max-h-[80vh] tb-w-[326px] tb-flex-col tb-gap-4 tb-overflow-hidden tb-rounded-[20px] tb-bg-white tb-p-0 md:tb-h-[670px] ${p?"md:tb-w-[448px]":"md:tb-w-[696px]"}`,closeClassName:"tb-top-6 tb-right-6",closeIcon:(0,n.jsx)("span",{className:"tb-flex tb-items-center tb-justify-center tb-rounded-full tb-bg-[#f5f7fa] tb-p-2 tb-text-[#222]",children:(0,n.jsx)(Q.A,{className:"tb-size-[22px]"})}),children:[(0,n.jsxs)("div",{ref:w,className:"no-scrollbar tb-flex tb-shrink-0 tb-items-center tb-gap-2 tb-overflow-x-auto tb-px-6",children:[a.map(t=>(0,n.jsx)("button",{type:"button","data-tab-id":t.id,className:(0,P.cn)("tb-shrink-0 tb-rounded-[99px] tb-border-0 tb-bg-transparent tb-px-4 tb-py-2 tb-text-sm tb-font-semibold tb-text-black",!p&&j?.id===t.id&&"tb-bg-[#edf0f6]"),onClick:()=>{u(t.id),f(!1)},children:t.name},t.id)),(0,n.jsx)("button",{type:"button","data-tab-id":ts,className:(0,P.cn)("tb-shrink-0 tb-rounded-[99px] tb-border-0 tb-bg-transparent tb-px-4 tb-py-2 tb-text-sm tb-font-semibold tb-text-black",p&&"tb-bg-[#edf0f6]"),onClick:()=>f(!0),children:c("gen.btn.more")})]}),p?(0,n.jsxs)("div",{className:"tb-flex tb-min-h-0 tb-flex-1 tb-flex-col tb-items-center tb-justify-center tb-text-center tb-pb-4",children:[(0,n.jsx)("div",{className:"tb-aspect-[278/156] tb-h-[155px] md:tb-h-[224px] tb-overflow-hidden tb-rounded-xl tb-bg-[#dfdfdf]","aria-hidden":!0,children:(0,n.jsx)("video",{src:tr,autoPlay:!0,muted:!0,playsInline:!0,loop:!0,controls:!1,className:"tb-size-full tb-object-cover"})}),(0,n.jsx)("h3",{className:"tb-mt-5 tb-text-lg tb-font-semibold tb-text-[#222]",children:c("hs.dl.ttl")}),(0,n.jsx)("p",{className:"tb-mt-2 tb-max-w-[420px] tb-text-sm tb-leading-6 tb-text-black/50",children:c("hs.dl.text")}),(0,n.jsxs)("div",{className:"tb-mt-5 tb-flex tb-w-full tb-max-w-[278px] tb-flex-col tb-items-center tb-gap-3",children:[(0,n.jsx)(M.$,{type:"button",className:"tb-h-12 tb-w-full tb-rounded-[31px] tb-bg-[#ff6a3b] tb-text-base tb-font-medium hover:tb-bg-[#ff6a3b]/90",onClick:b,children:c("gen.mdl.tin")}),(0,n.jsxs)("div",{className:"tb-flex tb-w-full tb-items-center tb-justify-center tb-gap-3",children:[(0,n.jsx)("span",{className:"tb-h-px tb-min-w-0 tb-flex-1 tb-bg-[rgba(0,0,0,0.12)]"}),(0,n.jsx)("span",{className:"tb-shrink-0 tb-text-sm tb-font-medium tb-text-black/80",children:c("gen.dl.popup.or")}),(0,n.jsx)("span",{className:"tb-h-px tb-min-w-0 tb-flex-1 tb-bg-[rgba(0,0,0,0.12)]"})]}),(0,n.jsx)(Z.A,{className:"tb-gap-8",position:"ai-headshot-generator",type:"limit",adjustLink:s,showQRCode:!1,showDesktopIcons:!0,showMobileIcons:!1,showWebEditor:!1})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"tb-flex tb-flex-wrap tb-shrink-0 tb-items-center tb-gap-x-4 tb-gap-y-2 tb-rounded-xl tb-bg-[rgba(255,106,59,0.1)] tb-px-4 tb-py-2.5 tb-mx-6",children:[(0,n.jsx)("span",{className:"tb-w-fit tb-max-w-full tb-grow tb-shrink-0 tb-text-xs tb-font-normal tb-leading-normal tb-text-black/80",children:c("hs.dl.text")}),(0,n.jsx)("div",{className:"tb-ml-auto tb-flex tb-shrink-0 tb-justify-end",children:(0,n.jsx)(M.$,{type:"button",size:"sm",className:"tb-h-auto tb-shrink-0 tb-rounded-full tb-bg-[#ff6a3b] tb-px-3 tb-py-1 tb-text-xs tb-font-medium tb-text-white hover:tb-bg-[#ff6a3b]/90",onClick:b,children:c("gen.mdl.tin")})})]}),(0,n.jsx)("div",{className:"no-scrollbar tb-min-h-0 tb-px-6 tb-flex-1 tb-pb-4 tb-overflow-y-auto",children:j?.children.length?(0,n.jsx)("div",{className:"tb-grid tb-grid-cols-2 tb-gap-3 md:tb-grid-cols-5",children:j.children.map(t=>(0,n.jsxs)("button",{ref:e=>{g.current[t.id]=e},type:"button","data-style-id":t.id,className:(0,P.cn)("tb-relative tb-aspect-[3/4] tb-overflow-hidden tb-rou
1nded-lg tb-border-2 tb-border-solid tb-bg-[#f2f5f9] tb-p-0",r===t.id?"tb-border-[#ff6a3b]":"tb-border-transparent"),onClick:()=>l(t),children:[(0,n.jsx)("img",{src:t.posterUrl,alt:t.name,className:"tb-size-full tb-object-cover",loading:"lazy"}),(0,n.jsxs)("span",{className:"tb-absolute tb-inset-x-0 tb-bottom-0 tb-hidden tb-h-14 tb-items-end tb-justify-center tb-pb-2 md:tb-flex",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"tb-rounded-b-[6px] tb-pointer-events-none tb-absolute tb-inset-0 tb-bg-gradient-to-t tb-from-[rgba(0,0,0,0.45)] tb-via-[rgba(0,0,0,0.2)] tb-to-transparent tb-backdrop-blur-[16px] [-webkit-mask-image:linear-gradient(to_top,black_0%,black_55%,transparent_100%)] [mask-image:linear-gradient(to_top,black_0%,black_55%,transparent_100%)]"}),(0,n.jsx)("span",{className:"tb-relative tb-z-[1] tb-block tb-w-full tb-truncate tb-px-2 tb-text-center tb-text-[10px] tb-font-medium tb-leading-normal tb-text-white",children:t.name})]})]},t.id))}):(0,n.jsx)("div",{className:"tb-flex tb-h-full tb-items-center tb-justify-center tb-text-sm tb-text-black/40",children:"No styles available."})},`content-${h}`)]})]})};var to=a(65934);let ti=5,tl=({items:t,slotCount:e=ti,selectedId:a,loading:r,disabled:s,onSelect:o,onAll:l,onExpose:b})=>{let{$tl:d}=(0,m.W)(),c=r||0===t.length,h=s||c,u=e+1,p=(0,i.useRef)({}),f=(0,i.useMemo)(()=>t.map(t=>t.id),[t]);return ta({enabled:!r&&t.length>0,scope:"home",itemIds:f,itemRefs:p,onExpose:b}),(0,n.jsxs)("section",{children:[(0,n.jsx)("div",{className:"tb-mb-2 tb-text-sm tb-font-semibold tb-leading-normal tb-text-[#222] md:tb-mb-3 md:tb-text-base",children:d("hs.choose.style")}),(0,n.jsxs)("div",{className:"tb-grid tb-w-full tb-gap-2",style:{gridTemplateColumns:`repeat(${u}, minmax(0, 1fr))`},children:[c?Array.from({length:e},(t,e)=>(0,n.jsx)(to.E,{className:"tb-aspect-[98/131] tb-w-full tb-min-w-0 tb-rounded-xl"},e)):t.map(t=>(0,n.jsxs)("button",{ref:e=>{p.current[t.id]=e},type:"button",disabled:s,"data-style-id":t.id,className:(0,P.cn)("tb-relative tb-aspect-[98/131] tb-w-full tb-min-w-0 tb-overflow-hidden tb-rounded-xl tb-border-2 tb-border-solid tb-bg-[#f2f5f9] tb-p-0",a===t.id?"tb-border-[#ff6a3b]":"tb-border-transparent",s?"tb-cursor-not-allowed tb-opacity-60":"tb-cursor-pointer"),onClick:()=>o(t),children:[(0,n.jsx)("img",{src:t.posterUrl,alt:t.name,className:"tb-block tb-h-full tb-w-full tb-object-cover"}),(0,n.jsxs)("span",{className:"tb-absolute tb-inset-x-0 tb-bottom-0 tb-hidden tb-h-8 tb-items-end tb-justify-center tb-pb-2 md:tb-flex",children:[(0,n.jsx)("span",{"aria-hidden":!0,className:"tb-pointer-events-none tb-absolute tb-inset-0 tb-bg-gradient-to-t tb-from-[rgba(0,0,0,0.45)] tb-via-[rgba(0,0,0,0.2)] tb-to-transparent tb-backdrop-blur-[16px] [-webkit-mask-image:linear-gradient(to_top,black_0%,black_55%,transparent_100%)] [mask-image:linear-gradient(to_top,black_0%,black_55%,transparent_100%)]"}),(0,n.jsx)("span",{className:"tb-relative tb-z-[1] tb-block tb-w-full tb-truncate tb-px-2 tb-text-center tb-text-[10px] tb-font-medium tb-leading-normal tb-text-white",children:t.name})]})]},t.id)),(0,n.jsxs)("button",{type:"button",disabled:h,className:(0,P.cn)("tb-relative tb-aspect-[98/131] tb-w-full tb-min-w-0 tb-overflow-hidden tb-rounded-xl tb-border-0 tb-bg-[#f2f5f9] tb-text-[#222]",h?"tb-cursor-not-allowed tb-opacity-60":"tb-cursor-pointer"),onClick:l,children:[(0,n.jsx)("span",{className:"tb-absolute tb-left-1/2 tb-top-1/2 tb-flex tb-size-6 -tb-translate-x-1/2 -tb-translate-y-1/2 tb-items-center tb-justify-center tb-text-sm tb-leading-none md:tb-size-9 md:tb-text-base","aria-hidden":!0,children:"â¢â¢â¢"}),(0,n.jsx)("span",{className:"tb-absolute tb-inset-x-0 tb-bottom-0 tb-p-2 tb-text-center tb-text-[10px] tb-font-medium tb-leading-normal",children:d("gen.all")})]})]})]})};var tb=a(92547);function td(){return(td=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t}).apply(null,arguments)}let tc=function(t){return i.createElement("svg",td({preserveAspectRatio:"none",overflow:"visible",style:{display:"block"},width:"1em",height:"1em",viewBox:"0 0 18 18",xmlns:"http://www.w3.org/2000/svg",fill:"
1currentColor"},t),r||(r=i.createElement("g",{id:"replace",clipPath:"url(#clip0_0_318)"},i.createElement("path",{id:"Vector",d:"M9 18C13.9706 18 18 13.9706 18 9C18 4.02943 13.9706 0 9 0C4.02943 0 0 4.02943 0 9C0 13.9706 4.02943 18 9 18Z"}),i.createElement("path",{id:"Vector_2",d:"M12.182 12.182C11.3677 12.9963 10.2427 13.5 9 13.5C6.51472 13.5 4.5 11.4853 4.5 9C4.5 6.51472 6.51472 4.5 9 4.5C10.2427 4.5 11.3677 5.00368 12.182 5.81803C12.5965 6.23253 13.5 7.25 13.5 7.25M11.25 7.25H13.5V5",stroke:"white",strokeWidth:1.2,strokeLinecap:"round",strokeLinejoin:"round"}))),s||(s=i.createElement("defs",null,i.createElement("clipPath",{id:"clip0_0_318"},i.createElement("rect",{width:18,height:18})))))},th="/_next/static/media/spinner.e1b0d493.png",tu=({value:t,disabled:e,isDragging:a,uploadControl:r,onDragOver:s,onDragLeave:o,onDrop:i,onPaste:l})=>{let{$tl:b}=(0,m.W)(),d="empty"===t.status,c="uploading"===t.status,h=!!t.previewUrl&&!c,u={onDragOver:t=>{e?t.preventDefault():s(t)},onDragLeave:t=>{e||o(t)},onDrop:t=>{e?t.preventDefault():i(t)},onPaste:t=>{e||l(t)}};return h?(0,n.jsxs)("div",{className:"tb-relative tb-w-full",...u,children:[r,(0,n.jsxs)("div",{className:(0,P.cn)("tb-relative tb-flex tb-h-14 tb-items-start tb-gap-3 md:tb-hidden",e?"tb-cursor-not-allowed tb-opacity-70":"tb-cursor-pointer"),children:[(0,n.jsxs)("div",{className:"tb-relative tb-size-14 tb-shrink-0",children:[(0,n.jsx)("img",{src:t.previewUrl,alt:"Uploaded headshot source",className:"tb-size-full tb-rounded-xl tb-object-cover"}),(0,n.jsx)("span",{className:"tb-pointer-events-none tb-absolute -tb-right-1 -tb-top-1 tb-z-[2] tb-flex tb-size-4 tb-items-center tb-justify-center",children:(0,n.jsx)(tc,{className:"tb-size-4","aria-hidden":!0})})]}),(0,n.jsx)("div",{className:"tb-flex tb-h-14 tb-min-w-0 tb-flex-1 tb-items-center tb-justify-center tb-overflow-hidden tb-rounded-xl tb-bg-[#f2f5f9] tb-px-5",children:(0,n.jsx)("span",{className:"tb-text-sm tb-text-black/60",children:b("hs.1im")})})]}),(0,n.jsxs)("div",{className:(0,P.cn)("tb-relative tb-hidden tb-h-40 tb-w-full tb-items-center tb-justify-center tb-overflow-hidden tb-rounded-[20px] tb-bg-[#f2f5f9] md:tb-flex",e?"tb-cursor-not-allowed tb-opacity-70":"tb-cursor-pointer"),children:[(0,n.jsx)("img",{src:t.previewUrl,alt:"Uploaded headshot source",className:"tb-h-full tb-max-w-full tb-object-cover"}),(0,n.jsx)("span",{className:"tb-pointer-events-none tb-absolute tb-right-3 tb-top-3 tb-z-[2] tb-flex tb-size-[18px] tb-items-center tb-justify-center",children:(0,n.jsx)(tc,{className:"tb-size-[18px]","aria-hidden":!0})})]}),a&&(0,n.jsx)("div",{className:"tb-pointer-events-none tb-absolute tb-inset-0 tb-z-[5] tb-rounded-xl tb-bg-[rgba(255,106,59,0.16)] md:tb-rounded-[20px]"})]}):(0,n.jsxs)("div",{className:(0,P.cn)("tb-relative tb-flex tb-w-full tb-items-center tb-justify-center tb-overflow-hidden",c&&"tb-h-14 tb-rounded-xl tb-bg-[#f2f5f9] md:tb-h-40 md:tb-rounded-[20px]",d&&"tb-rounded-xl tb-border-2 tb-border-dashed tb-border-[#ff6a3b] tb-bg-[rgba(255,106,59,0.05)] tb-px-5 tb-py-2 md:tb-h-40 md:tb-rounded-[20px]",e?"tb-cursor-not-allowed tb-opacity-70":"tb-cursor-pointer",!e&&c&&"tb-cursor-default"),...u,children:[!c&&r,a&&(0,n.jsx)("div",{className:"tb-pointer-events-none tb-absolute tb-inset-0 tb-z-[5] tb-rounded-xl tb-bg-[rgba(255,106,59,0.16)] md:tb-rounded-[20px]"}),c?(0,n.jsxs)("div",{className:"tb-flex tb-flex-col tb-items-center tb-justify-center tb-gap-2 tb-px-2",children:[(0,n.jsx)("img",{src:th,alt:"","aria-hidden":!0,className:"tb-size-4 tb-animate-spin tb-object-contain"}),(0,n.jsx)("span",{className:"tb-text-sm tb-font-medium tb-leading-normal tb-text-black/60",children:b("gen.text.uploading")})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"tb-flex tb-items-center tb-justify-center tb-gap-2 md:tb-hidden",children:[(0,n.jsx)(tb.A,{className:"tb-size-6 tb-text-[#ff6a3b]"}),(0,n.jsx)("span",{className:"tb-text-base tb-font-semibold tb-text-[#ff6a3b]",children:b("gen.upld")})]}),(0,n.jsxs)("div",{className:"tb-hidden tb-w-full tb-flex-col tb-items-center tb-gap-4 tb-text-center md:tb-flex",children:[(0,n.jsxs)("span",{className:"tb-flex tb-items-center tb-justify-center tb-gap-2 tb-overflow-hidden tb-rou
1nded-full tb-bg-[#ff6a3b] tb-px-6 tb-py-2 tb-text-lg tb-font-semibold tb-leading-normal tb-text-white",children:[(0,n.jsx)(tb.A,{className:"tb-size-6"}),b("gen.upld")]}),(0,n.jsxs)("div",{className:"tb-flex tb-w-full tb-flex-col tb-items-center tb-gap-2",children:[(0,n.jsx)("strong",{className:"tb-text-lg tb-font-medium tb-leading-normal tb-text-[#ff6a3b]",children:b("hs.upload.drop")}),(0,n.jsx)("span",{className:"tb-text-xs tb-font-normal tb-leading-normal tb-text-black/40",children:b("hs.img.rule")})]})]})]})]})},tm=({tenant:t,open:e,onCancel:a,onRetry:r})=>{let{$tl:s}=(0,m.W)(),o=tt()?.[`${t}-root`]||"";return(0,n.jsx)(X.l,{open:e,title:(0,n.jsx)("span",{className:"tb-block tb-text-left tb-text-[22px] tb-font-semibold tb-leading-7 tb-text-black/80",children:s("gen.upload.failed.image.title")}),maskClassName:`${o} tb-bg-black/60 tb-backdrop-blur-none`,contentStyle:`${o} tb-w-[336px] md:tb-w-[580px] tb-gap-4 tb-rounded-[20px] tb-bg-white tb-p-6 md:tb-p-8`,footerClassName:"tb-gap-3 mobile:tb-flex-col-reverse mobile:tb-gap-3 mobile:tb-space-x-0",footer:{cancelBtn:(0,n.jsx)(M.$,{type:"button",className:"tb-h-12 tb-w-full tb-rounded-full tb-border tb-border-solid tb-border-black/20 tb-bg-white tb-text-sm tb-font-semibold tb-text-[#222] hover:tb-bg-black/5",children:s("general.button.cancel")}),okBtn:(0,n.jsx)(M.$,{type:"button",className:"tb-h-12 tb-w-full tb-rounded-full tb-bg-[#ff6a3b] tb-text-sm tb-font-semibold tb-text-white",onClick:r,children:s("img.enhncr.button.upload.another")})},onCancel:a,onOk:r,onOpenChange:t=>{t||a()},children:(0,n.jsxs)("div",{className:"tb-font-normal tb-leading-6 tb-text-black/60",children:[(0,n.jsx)("p",{className:"tb-text-[rgba(241,181,0,1)]",children:s("open.eyes.failed.img.cnt.1")}),(0,n.jsx)("p",{children:s("open.eyes.failed.img.cnt.2")})]})})},tp=t=>t?t.startsWith("hs_")?t:`hs_${t}`:"",tf={en:"name",es:"name_es",fr:"name_fr",de:"name_gr",it:"name_it",pt:"name_pt",ru:"name_ru"};function tx(t,e){let a=t[tf[e]||"name"];return"string"==typeof a&&a.length>0?a:"string"==typeof t.name?t.name:""}let tg="ai_headshot_task_state",tw=["image/jpeg","image/jpg","image/png","image/webp","image/gif"],tj=[{value:j.K3.Value1K,credits:1},{value:j.K3.Value2K,credits:2},{value:j.K3.Value4K,credits:4}],ty={status:"empty",remoteUrl:"",previewUrl:""},tv=(t,e)=>`${t}::${e}`,t_=(0,o.A)(()=>{let{$tl:t}=(0,m.W)(),{isLogin:e,openLoginDialog:a}=(0,d.Jd)(),{toast:r}=(0,c.Ay)(),s=(0,i.useRef)(null),o=(0,C.K)(),l=(0,i.useMemo)(()=>N.Cp[o][$.i0.AiHeadShot],[o]),U=(0,g.Ay)(),{report:I}=(0,S.e)(),{guardDownload:R}=(0,f.A)(),{downloadToast:M}=(0,x.A)(),{getTaskTransferId:O}=(0,w.A)(),{categories:T,homeStyles:P,loading:H,error:K}=function(){let{locale:t="en"}=(0,A.useRouter)(),[e,a]=(0,i.useState)([]),[r,s]=(0,i.useState)(!0),[n,o]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return s(!0),o(!1),j.fG.getStyles().then(({data:e})=>{t||a(Array.isArray(e?.categories)?e.categories:[])}).catch(e=>{console.error("[ai-headshot] getStyles failed",e),t||(a([]),o(!0))}).finally(()=>{t||s(!1)}),()=>{t=!0}},[]);let l=(0,i.useMemo)(()=>Array.isArray(e)?e.flatMap(e=>{if("string"!=typeof e?.id)return[];let a=Array.isArray(e.children)?e.children.map(e=>(function(t,e){if("string"!=typeof t.id||"string"!=typeof t.posterUrl)return null;let a=tx(t,e);return a?{id:t.id,name:a,posterUrl:t.posterUrl,tags:Array.isArray(t.tags)?t.tags.filter(t=>"string"==typeof t):[]}:null})(e,t)).filter(t=>null!==t):[];return[{id:e.id,name:tx(e,t),children:a}]}):[],[t,e]),b=(0,i.useMemo)(()=>l.flatMap(t=>t.children.filter(t=>t.tags.includes("home"))),[l]);return{categories:l,homeStyles:b,loading:r,error:n}}(),[F,V]=(0,i.useState)(ty),[B,X]=(0,i.useState)(),[Z,Q]=(0,i.useState)(j.K3.Value1K),[Y,tt]=(0,i.useState)(!1),[te,ta]=(0,i.useState)(!1),[ts,to]=(0,i.useState)(!1),[ti,tb]=(0,i.useState)(""),[td,tc]=(0,i.useState)({}),th=(0,i.useRef)(void 0),tf=(0,i.useRef)(""),t_=(0,i.useRef)(Z),tk=(0,i.useRef)(""),tN=(0,i.useRef)(0),tC=(0,i.useRef)(0),t$=(0,i.useRef)("click"),tE=(0,i.useRef)(""),tS=(0,i.useRef)(void 0),tU=tj.find(t=>t.value===Z)?.credits||1,{isReady:tL,isInited:tA,usageCount:tz,handleCreditsGuard:tI,syncGuardReportOptions:tR,refreshRef:tq}=(0,p.Ay)({type:p.By.Image,moduleName:$.i0.AiHeadShot,creditsCost:tU,onGuestLimitReached:a},j.fG),tM=U?4:5,tO=(0,i.useMemo)(()=>{let t=P.slice(0,tM);return!B||t.some(t=>t.id===B.id)?t:[B,...t].slice(0,tM)},[P,B,tM]),tD=(0,i.useCallback)(()=>{V(t=>({...t,status:t.remoteUrl?"ready":"empty"}))},[]),tT=(0,i.useCallback)(async t=>{let{data:e}=await j.hX.checkFaceNum({url:t});return 1===e},[]),tP=(0,i.useCallback)(async(e,a)=>{let s=++tC.current,n=(0,_.lE)(),o="";if(tk.current=n,I("import_media_start",{from_tab:"ai-headshot-generator",type:a,task_id:n,picture_number:1}),V(t=>({...t,status:"uploading"})),!tw.includes(e.type)){I("import_media_failed",{from_tab:"ai-headshot-generator",type:a,reason:"format",task_id:n,picture_number:1});let e=$.oW[E.tg.format];r(e?`${t(e.title)} ${t(e.description)}`:t("gen.pop.fs.proces.reupload")),tD();return}if(e.size>0xa00000){I("import_media_failed",{from_tab:"ai-headshot-generator",type:a,reason:"size",task_id:n,picture_number:1});let e=$.oW[E.tg.size];r(e?`${t(e.title)} ${t(e.description)}`:t("gen.pop.fs.proces.reupload")),tD();return}try{let t=await (0,y.Dz)(e);o=t.url;let r=t.width>4096||t.height>4096?await (0,y.w4)(t.file,4096,4096):t.file,i=Date.now(),l=await (0,y.rx)(r),{data:{nsfw:b}}=await j.lN.check({imageUrl:l});if(b)throw Error("restricted");if(!await tT(l))throw Error("face");if(tC.current!==s)return void URL.revokeObjectURL(o);tE.current&&URL.revokeObjectURL(tE.current),tE.current=t.url,o="",V({status:"ready",remoteUrl:l,previewUrl:t.url}),tb(""),tc({}),tS.current?.(),tS.current=void 0,sessionStorage.removeItem(tg);let d=new URL(window.location.href);d.searchParams.delete("r"),window.history.replaceState({},"",d.toString()),I("import_media_success",{from_tab:"ai-headshot-generator",type:a,task_id:n,picture_number:1,uploading_time:Date.now()-i})}catch(i){if(o&&URL.revokeObjectURL(o),tC.current!==s)return;let e=i instanceof Error?i.message:"";tD(),I("import_media_failed",{from_tab:"ai-headshot-generator",type:a,reason:e,task_id:n,picture_number:1}),"face"===e?ta(!0):r(t("gen.pop.fs.proces.reupload"))}},[t,tT,I,tD,r]);(0,i.useEffect)(()=>{!B&&P[0]&&X(P[0])},[P,B]),(0,i.useEffect)(()=>{K&&r("Styles could not be loaded. Please refresh and try again.")},[K,r]),(0,i.useEffect)(()=>{th.current=B},[B]),(0,i.useEffect)(()=>{tf.current=F.remoteUrl},[F.remoteUrl]),(0,i.useEffect)(()=>{t_.current=Z},[Z]);let tW=(0,i.useCallback)(()=>{t$.current="click",I("import_media_click",{from_tab:"ai-headshot-generator",type:"click"})},[I]),tH=(0,i.useCallback)(()=>
1{document.getElementById("headshot-upload")?.click()},[]),tK=(0,i.useCallback)((t,e)=>{t$.current="drag",I("import_media_click",{from_tab:"ai-headshot-generator",type:"drag"}),e(t)},[I]),tF=(0,i.useCallback)((t,e)=>{t$.current="paste",I("import_media_click",{from_tab:"ai-headshot-generator",type:"paste"}),e(t)},[I]),tV=(0,i.useCallback)(t=>{X(t),tt(!1);let e=F.remoteUrl?tv(F.remoteUrl,t.id):"";tb(e&&td[e]||""),I("material_click",{from_tab:"ai-headshot-generator",style_id:tp(t.id),task_id:tk.current})},[I,td,F.remoteUrl]),tB=(0,i.useCallback)(t=>{t.length&&I("material_exposure",{from_tab:"ai-headshot-generator",task_id:tk.current,style_id:t.map(tp).join(",")})},[I]),tG=(0,i.useCallback)(()=>{if(!e){tt(!1),a();return}window.open("/editor","_blank","noopener,noreferrer")},[e,a]),tJ=(0,i.useCallback)(t=>{t.preventDefault(),t.returnValue=!0},[]),tX=(0,i.useCallback)((e,a)=>{if(e.status!==j.eN.Pending){if(a(),tS.current=void 0,window.removeEventListener("beforeunload",tJ),to(!1),e.status===j.eN.Success&&e.resultUrl){let t=e.resultUrl,a=th.current?.id||"",r=tf.current;r&&a&&tc(e=>({...e,[tv(r,a)]:t})),tb(t),sessionStorage.removeItem(tg),I("edit_func_success",{edit_func:"ai-headshot-generator",task_id:e.taskId,style_id:tp(a),quality:t_.current,credits:tj.find(t=>t.value===t_.current)?.credits||1,loading_time:tN.current?Date.now()-tN.current:void 0}),I("result_exposure",{from_tab:"ai-headshot-generator",task_id:e.taskId,style_id:tp(a),quality:t_.current,picture_number:1})}else r(e.errorMessage||t("gen.pop.fs.st.tryagain")),I("edit_func_failed",{edit_func:"ai-headshot-generator",task_id:e.taskId,reason:e.errorCode||e.errorMessage||"unknown"});tq.current?.()}},[t,tJ,tq,I,r]),tZ=(0,i.useCallback)(e=>{tS.current?.(),tS.current=j.fG.eventStream(e,tX,{onError:()=>{tS.current?.(),tS.current=void 0,window.removeEventListener("beforeunload",tJ),to(!1),r(t("gen.pop.fs.st.tryagain"))}})},[t,tX,tJ,r]),tQ=(0,i.useCallback)(async()=>{if(ts||"ready"!==F.status||!F.remoteUrl||!B)return;let e=tp(B.id);if(tR({styleId:e,quality:Z,credits:tU}),await tI()){tb(""),to(!0),tN.current=Date.now(),I("edit_func_use",{edit_func:"ai-headshot-generator",task_id:tk.current,style_id:e,quality:Z,credits:tU}),I("material_check",{from_tab:"ai-headshot-generator",task_id:tk.current,style_id:e,quality:Z});try{let t=await O(),{data:e}=await j.fG.createTask({sourceUrl:F.remoteUrl,styleId:B.id,quality:Z},{headers:{transfer_id:t}});tk.current=e.taskId;let a=new URL(window.location.href);a.searchParams.set("r",e.taskId),window.history.replaceState({},"",a.toString()),sessionStorage.setItem(tg,JSON.stringify({sourceUrl:F.remoteUrl,style:B,quality:Z})),tZ(e.taskId),window.addEventListener("beforeunload",tJ),tq.current?.()}catch(e){to(!1),r(t("gen.pop.fs.st.tryagain")),I("edit_func_failed",{edit_func:"ai-headshot-generator",task_id:tk.current,reason:e instanceof Error?e.message:"create_task_failed"})}}},[t,tU,O,tI,tJ,ts,Z,tq,I,B,tZ,tR,r,F]),tY=(0,i.useCallback)(()=>{ti&&(I("media_save",{edit_func:"ai-headshot-generator",task_id:tk.current,style_id:tp(B?.id||""),quality:Z,picture_number:1}),R(()=>{(0,v.RG)(ti,"ai-headshot",o,()=>{M($.i0.AiHeadShot)})}))},[M,R,Z,I,ti,B?.id,o]);(0,i.useEffect)(()=>{let t=new URL(window.location.href).searchParams.get("r");if(tk.current=t||"",!t)return void sessionStorage.removeItem(tg);try{let t=sessionStorage.getItem(tg);if(t){let e=JSON.parse(t);V({status:"ready",remoteUrl:e.sourceUrl,previewUrl:e.sourceUrl}),X({...e.style,tags:Array.isArray(e.style.tags)?e.style.tags:[]}),Q(e.quality)}}catch{sessionStorage.removeItem(tg)}to(!0),tZ(t),window.addEventListener("beforeunload",tJ)},[]),(0,i.useEffect)(()=>()=>{tS.current?.(),window.removeEventListener("beforeunload",tJ),tE.current&&URL.revokeObjectURL(tE.current)},[tJ]),(0,i.useEffect)(()=>{I("edit_func_enter",{edit_func:"ai-headshot-generator",ref:new URLSearchParams(location.search).get("from_page")})},[I]),(0,i.useEffect)(()=>{let t=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&(I(`${U?"download_exposure":"download_exposure_store"}`,{position:"ai-headshot-generator"}),t.disconnect())})});return s.current&&t.observe(s.current),()=>t.disconnect()},[U,I]);let t0=!tL||H||ts||"ready"!==F.status||!B;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(b(),{children:[(0,n.jsx)("link",{rel:"prefetch",as:"video",href:tr}),G.map(({src:t})=>(0,n.jsx)("link",{rel:"prefetch",as:"image",href:t},t))]}),(0,n.jsxs)("div",{className:L().root,children:[(0,n.jsx)(z,{}),(0,n.jsx)(tn,{tenant:o,open:Y,categories:T,selectedId:B?.id,adjustLink:l,onOpenChange:tt,onSelect:tV,onTryMore:tG,onExpose:tB}),(0,n.jsx)(tm,{tenant:o,open:te,onCancel:()=>ta(!1),onRetry:()=>{ta(!1),tH()}}),(0,n.jsxs)("div",{className:L().main,children:[(0,n.jsx)("div",{className:"tb-mx-auto tb-max-w-[1332px] tb-px-5 md:tb-px-[54px]",children:(0,n.jsx)(k.A,{})}),(0,n.jsxs)("div",{className:"tb-flex tb-flex-col md:tb-gap-10",children:[(0,n.jsxs)("div",{className:"tb-order-3 tb-mx-auto tb-flex tb-w-full tb-max-w-[1200px] tb-flex-col tb-gap-2 tb-px-5 tb-pb-0 tb-pt-6 tb-text-center md:tb-order-1 md:tb-w-[calc(100%-40px)] md:tb-gap-4 md:tb-px-0 md:tb-pt-10 md:tb-text-left",children:[(0,n.jsx)("h1",{className:"tb-m-0 tb-block tb-text-2xl tb-font-bold tb-leading-[1.2] tb-text-[#222] md:tb-text-[36px]",dangerouslySetInnerHTML:{__html:t("headshot.generator.intro.h1")}}),(0,n.jsx)("p",{className:"tb-m-0 tb-font-normal tb-leading-normal tb-text-black/60 tb-text-base",children:t("headshot.generator.intro.content")})]}),(0,n.jsxs)("div",{className:"tb-order-1 tb-mx-auto tb-flex tb-w-full tb-max-w-[1200px] tb-flex-col tb-gap-4 tb-px-5 tb-pt-2 md:tb-order-2 md:tb-w-[calc(100%-40px)] md:tb-flex-row md:tb-gap-20 md:tb-px-0 md:tb-pb-20 md:tb-pt-0",children:[(0,n.jsx)("div",{className:"tb-order-1 tb-aspect-[350/239] tb-min-w-0 tb-w-full tb-overflow-hidden md:tb-order-2 md:tb-aspect-auto md:tb-h-[424px] md:tb-max-w-[620px] md:tb-flex-1 md:tb-basis-0",children:(0,n.jsx)(J,{resultImage:ti,processing:ts,onDownload:tY})}),(0,n.jsxs)("div",{className:"tb-order-2 tb-flex tb-min-w-0 tb-w-full tb-flex-col tb-gap-4 md:tb-order-1 md:tb-max-w-[500px] md:tb-flex-1 md:tb-basis-0 md:tb-gap-5",children:[(0,n.jsx)(tl,{items:tO,slotCount:tM,selectedId:B?.id,loading:H,disabled:ts,onSelect:tV,onAll:()=>tt(!0),onExpose:tB}),(0,n.jsxs)("div",{className:"tb-flex tb-items-center tb-justify-between tb-gap-3 tb-text-xs",children:[(0,n.jsx)("span",{className:"tb-font-medium tb-text-black",children:"\uD83C\uDF4C Nano Banana 2"}),(0,n.jsxs)("div",{className:"tb-hidden tb-items-center tb-gap-2 md:tb-flex",children:[(0,n.jsx)("span",{className:"tb-text-black",children:t("hs.resolution")}),tj.map(t=>(0,n.jsx)("button",{type:"button",disabled:ts,className:Z===t.value?"tb-flex tb-h-6 tb-w-[52px] tb-items-center tb-justify-center tb-rounded-lg tb-border tb-border-solid tb-border-[#ff6a3b] tb-bg-[rgba(255,106,59,0.08)] tb-px-3 tb-text-xs tb-font-medium tb-leading-[1.2] tb-text-[#ff6a3b]":"tb-flex tb-h-6 tb-w-[52px] tb-items-center tb-justify-center tb-rounded-lg tb-border-0 tb-bg-[#f2f5f9] tb-px-3 tb-text-xs tb-font-medium tb-leading-[1.2] tb-text-black/80",onClick:()=>Q(t.value),children:t.value},t.value))]}),(0,n.jsx)("div",{className:"md:tb-hidden",children:(0,n.jsx)(W,{value:Z,options:tj,disabled:ts,onChange:Q})})]}),(0,n.jsx)(u.Z,{accept:tw,autoUpload:!1,disabled:ts,pasteUrl:!1,btnText:t("img.rbg.upload.button"),toolEnumVal:$.i0.AiHeadShot,onFile:t=>tP(t,t$.current),customRender:t=>
1{let e=(0,i.cloneElement)(t.Input,{id:"headshot-upload",disabled:ts||"uploading"===F.status,"aria-label":F.previewUrl?"Upload another image":"Upload an image",className:"tb-absolute tb-inset-0 tb-z-[1] tb-size-full tb-cursor-inherit tb-opacity-0 disabled:tb-cursor-not-allowed",onClick:tW});return(0,n.jsx)(tu,{value:F,disabled:ts,isDragging:t.isDragging,uploadControl:e,onDragOver:t.dropEvents.onDragOver,onDragLeave:t.dropEvents.onDragLeave,onDrop:e=>tK(e,t.dropEvents.onDrop),onPaste:e=>tF(e,t.handlePaste)})}}),(0,n.jsx)(D,{isInited:tA,isLogin:e,usageCount:tz,quality:Z,creditsCost:tU,disabled:t0,loading:ts,onGenerate:tQ,onLogin:a})]})]}),(0,n.jsx)("div",{ref:s,className:"tb-order-2 tb-mx-auto tb-w-full tb-max-w-[350px] tb-px-0 md:tb-order-3 md:tb-max-w-none",children:(0,n.jsx)(h.VW,{position:"ai-headshot-generator",alink:l})})]})]}),(0,n.jsx)(q,{})]})]})});var tk=a(54273),tN=a(42473),tC=a(35473),t$=a(28811);let tE="/ai-headshot-generator";function tS(){let t=(0,tN.A)(),e=(t=>{let e=(0,t$.iy)(),a=`https://${e}`,{locale:r,locales:s,defaultLocale:o}=(0,A.useRouter)(),i=[{"@context":"https://schema.org/","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:"1",name:"Home",item:"https://airbrush.com/"},{"@type":"ListItem",position:"2",name:t("headshot.generator.structure.breadcrumblist.name"),item:`https://${e}/ai-headshot-generator`}]},{"@context":"https://schema.org/","@type":"Organization",url:"https://airbrush.com/",logo:"https://public.static.meitudata.com/pixocial/airbrush-web/mig/Airbrush-logo-150150-size.png",name:"Airbrush",image:"https://public.static.meitudata.com/pixocial/airbrush-web/mig/Cover_Airbrush-Homepage.jpg",brand:{"@type":"Organization"},legalName:"Pixocial Technology (Singapore) Ltd. Pte"},{"@context":"https://schema.org/","@type":"WebSite",name:t("headshot.generator.structure.website.name"),url:`https://${e}/ai-headshot-generator`,sameAs:["https://www.facebook.com/airbrushappofficial","https://twitter.com/AirBrushApp","https://www.pinterest.com/airbrushofficial/","https://www.tiktok.com/@airbrushofficial","https://www.instagram.com/airbrushofficial/"],headline:t("headshot.generator.structure.website.headline"),description:t("headshot.generator.structure.website.description"),image:t("headshot.generator.structure.website.image")}];return(0,n.jsxs)(b(),{children:[i.map((t,e)=>(0,n.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(t)}},`schema-${e}`)),(0,n.jsx)("link",{rel:"canonical",href:`${a}${r===o?"":`/${r}`}${tE}`}),s.map(t=>(0,n.jsx)("link",{rel:"alternate",hrefLang:t,href:`${a}${t===o?"":`/${t}`}${tE}`},t)),(0,n.jsx)("link",{rel:"alternate",hrefLang:"x-default",href:`${a}${s?.includes?.("en")?"":`/${r}`}${tE}`})]})})(t);return(0,n.jsxs)("div",{className:"mb-[2rem]",children:[e,(0,n.jsx)(t_,{$tl:t,report:tC.z8,tenant:$.b1.ab})]})}tS.LocaleRoot=tk.A;var tU=!0;let tL=tS},18017:t=>{t.exports={root:"styles_root__kV998",main:"styles_main___pEs7"}},73682:(t,e,a)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-headshot-generator",function(){return a(17224)}])},81362:(t,e,a)=>{"use strict";a.d(e,{A:()=>o});var r,s=a(95132);function n(){return(n=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var a=arguments[e];for(var r in a)({}).hasOwnProperty.call(a,r)&&(t[r]=a[r])}return t}).apply(null,arguments)}let o=function(t){return s.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",viewBox:"0 0 8 6",fill:"currentColor"},t),r||(r=s.createElement("path",{d:"M7 1.5L4 4.5L1 1.5",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))}}},t=>{t.O(0,[504,3739,3488,7800,4113,3433,6387,8234,9643,6965,4418,5954,173,1224,6037,636,6593,8792],()=>t(t.s=73682)),_N_E=t.O()}]);
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.