1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3639],{65718:function(e,t,n){n.r(t),n.d(t,{PrimaryButton:function(){return a},PrimaryButtonFullWidth:function(){return s},PrimaryButtonSmall:function(){return i},SecondaryButton:function(){return o},SecondaryButtonFullWidth:function(){return l},SecondaryButtonSmall:function(){return c},StudioPrimaryButton:function(){return d},StudioPrimaryButtonSmall:function(){return m},StudioSecondaryButtonSmall:function(){return x},TextButton:function(){return u}});var r=n(51403);function a(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"bg-primary bg-opacity-50 cursor-not-allowed":"cursor-pointer border-primary bg-primary hover:bg-slate-800"," font-inter border text-sm md:text-base -tracking-[0.006em] md:-tracking-[0.011em] text-white font-medium antialiased rounded-lg py-2.5 px-6 md:px-8 flex items-center group ").concat(null==e?void 0:e.classes),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function i(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"bg-primary bg-opacity-50 cursor-not-allowed":"cursor-pointer border-primary bg-primary hover:bg-slate-800"," border text-xs md:text-sm font-[450] antialiased rounded-lg py-2 px-4 md:-tracking-[0.006em] font-inter text-white flex items-center justify-center group\n ").concat(null==e?void 0:e.classes,"\n "),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function s(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"border-primary bg-primary opacity-50 cursor-not-allowed":"border-primary bg-primary hover:bg-slate-800","\n w-full border font-inter text-sm md:text-base -tracking-[0.006em] md:-tracking-[0.011em] text-white font-medium antialiased rounded-lg py-2.5 md:py-2.5 px-6 md:px-8 flex items-center justify-center group ").concat(null==e?void 0:e.classes),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function o(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-white"," font-inter text-sm md:text-base -tracking-[0.006em] md:-tracking-[0.011em] border border-primary text-primary font-medium antialiased rounded-lg py-2.5 px-6 md:px-8 flex items-center justify-center group ").concat(null==e?void 0:e.classes),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function l(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-white"," w-full font-inter text-sm md:text-base -tracking-[0.006em] md:-tracking-[0.011em] border border-primary text-primary font-medium antialiased rounded-lg py-2.5 md:py-2.5 px-6 md:px-8 ").concat(null==e?void 0:e.classes),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function c(e){return(0,r.jsx)("button",{className:"".concat((null==e?void 0:e.disabled)?"opacity-50 cursor-not-allowed":"hover:bg-primary hover:text-white"," border border-primary font-inter text-xs md:text-sm text-primary antialiased rounded-lg py-2 px-8 md:-tracking-[0.006em] font-medium ").concat(null==e?void 0:e.classes),onClick:null==e?void 0:e.onClick,dangerouslySetInnerHTML:{__html:null==e?void 0:e.text},disabled:null==e?void 0:e.disabled})}function u(e){return(0,r.jsx)("p",{className:"bg-clip-text box-decoration-clone font-inter text-transparent bg-gradient-to-r from-gradient-start-color to-gradient-end-color text-xs md:text-sm md:-tracking-[0.006em] font-bold antialiased cursor-pointer whitespace-nowrap",onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function d(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"cursor-not-allowed bg-slate-300":"cursor-pointer studio-primary-gradient"," font-inter text-sm md:text-base -tracking-[0.006em] md:-tracking-[0.011em] text-white font-medium antialiased rounded-lg py-2.5 px-6 md:px-8 flex items-center justify-center group ").concat(null==e?void 0:e.classes),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function m(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"cursor-not-allowed bg-slate-300":"cursor-pointer studio-primary-gradient"," text-xs md:text-sm font-medium antialiased rounded-lg py-2 px-8 md:-tracking-[0.006em] font-inter text-white flex items-center justify-center group\n ").concat(null==e?void 0:e.classes,"\n "),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}function x(e){return(0,r.jsx)("button",{className:"".concat(e.disabled?"cursor-not-allowed bg-slate-300":"cursor-pointer studio-primary-gradient"," flex items-center justify-center text-xs md:text-sm font-medium antialiased rounded-lg py-2 px-8 md:-tracking-[0.006em] font-inter group\n ").concat(null==e?void 0:e.classes,"\n "),onClick:e.onClick,dangerouslySetInnerHTML:{__html:e.text},disabled:e.disabled})}n(16660)},89299:function(e,t,n){n.d(t,{Z:function(){return u}});var r=n(51403),a=n(2356),i=n.n(a),s=n(43857);function o(e,t){if(!t.faq||0===t.faq.length)return null;for(var n=t.faqLocalePrefix?t.faqLocalePrefix:t.localeSlug,r=t.faqAppPrefix?t.faqAppPrefix:"",a=[],i=1;i<=t.faq.length;i++)a.push({"@type":"Question",name:e("".concat(n,":").concat(r,"FAQ_QUESTION_").concat(i)),acceptedA
1nswer:{"@type":"Answer",text:e("".concat(n,":").concat(r,"FAQ_ANSWER_").concat(i))}});return{"@context":"https://schema.org","@type":"FAQPage",mainEntity:a}}function l(e,t){if(!t.howItWorksSteps||0===t.howItWorksSteps.length)return null;for(var n=[],r=1;r<=t.howItWorksSteps.length;r++)n.push({"@type":"HowToStep",name:e("".concat(t.localeSlug,":HOW_IT_WORKS_STEP_").concat(r,"_TITLE")),text:e("".concat(t.localeSlug,":HOW_IT_WORKS_STEP_").concat(r,"_DESCRIPTION"))});return{"@context":"https://schema.org","@type":"HowTo",name:e("".concat(t.localeSlug,":HOW_IT_WORKS_SECTION_TITLE")),step:n}}function c(e){return{"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://magicstudio.com/"},{"@type":"ListItem",position:2,name:e,item:"https://magicstudio.com/".concat(e,"/")}]}}var u=function(e){var t=e.appConfig,n=e.noIndex,a=(0,s.Z)().t;return(0,r.jsxs)(i(),{children:[(0,r.jsx)("title",{children:a(t.pageTitle)}),n&&(0,r.jsx)("meta",{name:"robots",content:"noindex"}),(0,r.jsx)("meta",{name:"title",content:a(t.metaTitle)}),(0,r.jsx)("meta",{name:"description",content:a(t.metaDescription)},"description"),(0,r.jsx)("meta",{property:"og:site_name",content:"Magic Studio"},"og:site_name"),(0,r.jsx)("meta",{property:"og:type",content:"website"},"og:type"),(0,r.jsx)("meta",{property:"og:url",content:t.metaUrl},"og:url"),(0,r.jsx)("meta",{property:"og:title",content:a(t.ogTitle)},"og:title"),(0,r.jsx)("meta",{property:"og:description",content:a(t.ogDescription)},"og:description"),(0,r.jsx)("meta",{property:"og:image",content:t.metaImageUrl},"og:image"),(0,r.jsx)("meta",{name:"twitter:card",content:"summary_large_image"},"twitter:card"),(0,r.jsx)("meta",{name:"twitter:site",content:"@MagicStudio"},"twitter:site"),(0,r.jsx)("meta",{name:"twitter:url",content:t.metaUrl},"twitter:url"),(0,r.jsx)("meta",{name:"twitter:title",content:a(t.twitterTitle)},"twitter:title"),(0,r.jsx)("meta",{name:"twitter:description",content:a(t.twitterDescription)},"twitter:description"),(0,r.jsx)("meta",{name:"twitter:image",content:t.metaImageUrl},"twitter:image"),(0,r.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:function(e,t){var n=t.enabledStructuredSchema;if(!n||0===n.length)return null;var r=[],a=!0,i=!1,s=void 0;try{for(var u,d=n[Symbol.iterator]();!(a=(u=d.next()).done);a=!0){var m=u.value;try{switch(m){case"FAQ":var x=o(e,t);x&&r.push(x);break;case"HOW_TO":var p=l(e,t);p&&r.push(p);break;
1case"BREAD_CRUMB_LIST":r.push(c(t.appName))}}catch(f){console.error(f)}}}catch(h){i=!0,s=h}finally{try{a||null==d.return||d.return()}finally{if(i)throw s}}return{__html:JSON.stringify(r)}}(a,t)})]})}},50100:function(e,t,n){n.d(t,{Z:function(){return i}});var r=n(51403),a=n(8403);function i(e){var t=e.size,n=e.global;return(0,r.jsxs)("div",{className:"flex flex-col items-center ".concat(n?my-20:""," "),children:[(0,r.jsx)("p",{className:"text-xs md:text-sm font-normal text-primary antialiased mb-4",children:e.text}),(0,r.jsx)(a.Z,{size:void 0===t?160:t,lineWeight:5,speed:2,color:"#0A1727"})]})}},6256:function(e,t,n){n.d(t,{Z:function(){return Y}});var r=n(20550),a=n(69170),i=n(2081),s=n(51403),o=n(2672),l=n(43857),c=n(9669),u=n.n(c),d=n(16660),m=n(31424),x=n(10426),p=n(33597),f=n(90597),h=n(4258),g=n(85931),v=n(16330),b=n(58589),y=n(63510),j=n(67145),_=n(21439),k=n.n(_),w=n(92925),N=n(14342),T=n(39307),E=n(18895),S=n(80394),C=n(74706),I=n(70994),L=n(65718),A=n(34166),O=n(88026);function R(e){var t=(0,l.Z)().t,n=(0,d.useRef)(null);return(0,A.Z)(n,e.onCancel),(0,s.jsx)("div",{className:"font-inter block transition-opacity ease-linear overflow-y-auto overflow-x-hidden w-full h-full inset-0 fixed z-40 bg-neutral-900 bg-opacity-90",children:(0,s.jsx)("div",{className:"h-full md:h-modal transition-transform relative z-50 w-auto max-w-md md:my-8 mx-auto flex items-center",children:(0,s.jsxs)("div",{ref:n,className:"relative max-h-full bg-white overflow-hidden bg-clip-padding shadow-lg rounded-lg w-full flex flex-col justify-start items-center",children:[(0,s.jsx)("div",{className:(0,O.Z)("bg-gradient-to-r from-".concat(e.app,"-gradient-start via-").concat(e.app,"-gradient-middle to-").concat(e.app,"-gradient-end h-2 w-full"))}),(0,s.jsx)("div",{className:"py-8 overflow-y-auto lg:px-12 px-6 flex flex-col items-center w-full relative",children:(0,s.jsxs)("div",{className:"text-primary max-w-sm w-full flex flex-col items-center mt-4 md:mt-8",children:[(0,s.jsxs)("div",{className:"mb-4 relative -rotate-12",children:[(0,s.jsx)("i",{className:"isax isax-rotate-left text-3xl text-primary"}),(0,s.jsx)("i",{className:(0,O.Z)("icon-sparkles absolute -top-3 -left-5 text-electric-violet opacity-50 rotate-45 text-sm")}),(0,s.jsx)("i",{className:(0,O.Z)("icon-sparkles absolute -bottom-1 -right-4 text-electric-violet opacity-50 rotate-90 text-sm")})]}),(0,s.jsx)("p",{className:"antialiased text-primary text-lg md:text-xl font-bold -tracking-[0.013rem] md:-tracking-[0.011em]",children:t("common:RESET_MODAL_TITLE")}),(0,s.jsx)("p",{className:"text-sm md:text-base font-normal antialiased mt-2 font-inter leading-5 md:leading-6 -tracking-[0.0125em] md:-tracking-[0.015em]",children:t("common:RESET_MODAL_SUBTITLE")}),(0,s.jsxs)("div",{className:"flex flex-row justify-center mt-8 w-full",children:[(0,s.jsx)(L.SecondaryButtonFullWidth,{text:t("common:RESET_MODAL_SECONDARY_CTA"),onClick:e.onCancel}),(0,s.jsx)(L.PrimaryButtonFullWidth,{text:t("common:RESET_MODAL_PRIMARY_CTA"),onClick:e.onConfirm,classes:"ml-4"})]})]})})]})})})}var M=n(50100),F=n(43281),B=n(29094),D="rgba(189, 255, 1, 0.75)",U=function(e){var t="transparent",n=document.createElement("canvas"),r=n.getContext("2d",{willReadFrequently:!0});n.width=e.naturalWidth,n.height=e.naturalHeight,r.drawImage(e,0,0);for(var a=r.getImageData(0,0,n.width,n.height).data,i=0,s=0,o=0;o<a.length;o+=4){a[o];var l=a[o+1],c=a[o+2];c>l?i++:l>c&&s++}return i>s?t="#00C637":s>i&&(t="#0038FF"),t},Z=function(e){var t=e.width,n=e.height-64;return e.width>=1024?t=e.width-320:n-=280,{width:t,height:n}},P=function(e,t,n){var r=512,a=512;n.width<1024&&(r=n.width,a=n.height-280);var i=e,s=t,o=e/t;return o>1?(i>r&&(i=r,s=r/o),s>a&&(s=a,i=a*o)):(s>a&&(s=a,i=a*o),i>r&&(i=r,s=r/o)),{width:i,height:s}},W=function(e){var t=new Image;return new Promise(function(n,r){t.onload=function(){n(t)},t.crossOrigin="anonymous",t.onerror=r,t.src=e})};function H(e){return(0,s.jsxs)("div",{className:" w-max top-full left-1/2 -translate-x-1/2 mt-1 bg-primary text-white font-medium rounded-lg py-2 px-4 text-xs md:absolute md:group-hover:flex md:items-center hidden h-8 font-inter antialiased",children:[e.text&&(0,s.jsx)("span",{children:e.text}),e.shorcutKey&&(0,s.jsx)("span",{className:"".concat(e.text?"ml-4":""," font-medium"),children:e.shorcutKey})]})}function Y(e){var t,n,_=function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D;if(t.length){var a=(null===(n=eH.current)||void 0===n?void 0:n.state.scale)||1;e.lineCap="round",e.lineJoin="round",e.strokeStyle=r,e.lineWidth=eK/a,e.beginPath(),e.moveTo(t[0].x,t[0].y);for(var i=1;i<t.length;i++)e.lineTo(t[i].x,t[i].y);e.stroke()}}
1,A=(0,T.T)(),O=A.originalFile,Y=A.setOriginalFile,z=(A.fileDataURLWithoutBg,A.setFileDataURLWithoutBg),K=A.processedImage,J=A.setProcessedImage,q=A.shouldRoute,G=(A.editMaskImage,A.setEditMaskImage),X=(0,d.useState)("background-remover"===e.app||"backgroundblur"===e.app?"refine":"default"),V=X[0],Q=X[1],$=(0,d.useState)("restore"),ee=$[0],et=$[1],en=(0,d.useState)("auto"),er=en[0],ea=en[1],ei=(0,d.useState)(!1),es=ei[0],eo=ei[1],el=(0,d.useState)(!1),ec=(el[0],el[1]),eu=(0,d.useState)(void 0),ed=eu[0],em=eu[1],ex=(0,d.useState)(void 0),ep=ex[0],ef=ex[1],eh=(0,d.useState)(e.url?e.url:null),eg=eh[0],ev=eh[1],eb=(0,d.useState)(null),ey=eb[0],ej=eb[1],e_=(0,d.useState)(""),ek=e_[0],ew=e_[1],eN=(0,d.useState)([]),eT=eN[0],eE=eN[1],eS=(0,d.useState)([]),eC=eS[0],eI=eS[1],eL=(0,d.useState)({x:-1,y:-1}),eA=eL[0],eO=eA.x,eR=eA.y,eM=eL[1],eF=(0,d.useState)(1),eB=eF[0],eD=eF[1],eU=(0,d.useState)(1),eZ=eU[0],eP=eU[1],eW=(0,w.Z)(),eH=(0,d.useRef)(),eY=eW.width<1024,ez=(0,d.useState)(eY?10:30),eK=ez[0],eJ=ez[1],eq=(0,d.useState)([]),eG=eq[0],eX=eq[1],eV=(0,d.useState)(0),eQ=eV[0],e$=eV[1],e0=(0,c.useRouter)(),e1=(0,d.useState)(null),e2=e1[0],e5=e1[1],e4=(0,d.useState)([]),e3=e4[0],e6=e4[1],e8=(0,d.useState)([]),e9=e8[0],e7=e8[1],te=(0,d.useState)([]),tt=te[0],tn=te[1],tr=(0,d.useState)(null),ta=tr[0],ti=tr[1],ts=(0,d.useState)(!1),to=ts[0],tl=ts[1],tc=(0,d.useState)(!1),tu=tc[0],td=tc[1],tm=(0,d.useState)(!1),tx=tm[0],tp=tm[1],tf=(0,d.useState)(!1),th=tf[0],tg=tf[1],tv=(0,d.useState)(!1),tb=tv[0],ty=tv[1],tj=(0,d.useState)(!0),t_=(tj[0],tj[1]),tk=e.app,tw=(0,l.Z)().t,tN=(0,d.useRef)([]),tT=function(){"refine"===V?"background-remover"===tk||"backgroundblur"===tk?(J(null),Y(null),z(null),G(null)):(em(null),Q("default")):(J(null),Y(null),z(null),G(null))},tE=(t=(0,r.Z)(function(e,t){var n,r,a,s,o,l;return(0,i.__generator)(this,function(i){for(r=(n=document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),n.width=e.naturalWidth,n.height=e.naturalHeight,r.drawImage(e,0,0),a=r.getImageData(0,0,n.width,n.height),r.drawImage(t,0,0),s=r.getImageData(0,0,n.width,n.height),o=0;o<a.data.length;o+=4)a.data[o+3]=s.data[o];return r.putImageData(a,0,0),[2,n.toDataURL()]})}),function(e,n){return t.apply(this,arguments)}),tS=(n=(0,r.Z)(function(e){var t,n,r,a,s,o,l,c,d,m;return(0,i.__generator)(this,function(r){switch(r.label){case 0:return n=O.name,[4,(0,I.Z)(O,n)];case 1:if(!(a=r.sent().url))return(0,S.c)("error_occured",{error_message:"url is empty",source_tool:tk,error_function:"autoSegmentationFileEmpty"},[B.C.MS_ANALYTICS]),J(null),z(null),Y(null),G(null),u().push("/".concat(tk,"?error=upload_failed")),[2];return[4,(0,E.SU)(a,[],!1)];case 2:if(s=r.sent(),ew(a),s.error)return(0,S.c)("error_occured",{error_message:s.error,source_tool:tk,error_function:"autoSegmentation"},[B.C.MS_ANALYTICS]),J(null),z(null),Y(null),G(null),u().push("/".concat(tk,"?error=upload_failed")),[2];return l=(o=null==s?void 0:null===(t=s.data)||void 0===t?void 0:t.results)[0].image,G(o[0].image),[4,W(l)];case 3:return[4,tE(e,r.sent())];case 4:return[4,W(r.sent())];case 5:return ev(r.sent()),[2]}})}),function(e){return n.apply(this,arguments)}),tC=function(e){ed&&_(ed,e,"erase"===ee?"rgba(255, 1, 1, 0.75)":D)};(0,d.useEffect)(function(){eT.length>0&&tC(eT),tN.current=(0,a.Z)(eT)},[eT]);var tI=function(e){e!==es&&eo(e)},tL=(0,d.useCallback)(function(e){var t,n=eH.current;if(n&&eg){var r=Z(eW),a=r.width,i=r.height,s=ey.width,o=ey.height,l={x:(.5*a-n.state.positionX)/(s*n.state.scale),y:(.5*i-n.state.positionY)/(o*n.state.scale)};null===(t=eH.current)||void 0===t||t.setTransform(.5*a-s*e*l.x,.5*i-o*e*l.y,e,200,"easeOutQuad"),eP(e)}},[eW,eg]);(0,d.useCallback)(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:200;if(eB&&eg&&eW&&eH.current){var t,n=eH.current,r=Z(eW),a=r.width,i=r.height,s=Math.max(eg.width,eg.height);n.setTransform((a-s*eB)/2,(i-s*eB)/2,eB,e,"easeOutQuad"),eP(eB)}},[eB,eg,eW]);var tA,tO,tR,tM=function(e,t){eE(function(n){return(0,a.Z)(n).concat([{x:e,y:t}])})},tF=function(e){eM({x:e.clientX,y:e.clientY})},tB=function(e){var t;tM(e.offsetX,e.offsetY)},tD=(tA=(0,r.Z)(function(){var e;return(0,i.__generator)(this,function(t){switch(t.label){case 0:if(!(e=null==ed?void 0:ed.canvas))return[2];return[4,tU()];case 1:return t.sent(),e.removeEventListener("mousemove",tB),window.removeEventListener("mouseup",tD),[2]}})}),function(){return tA.apply(this,arguments)}),tU=(tO=(0,r.Z)(function(){var t,n,r,s,o,l;return(0,i.__generator)(this,function(n){switch(n.label){case 0:return tl(!0),t="erase"===ee?"black":"white",[4,W(eG[eG.length-1])];case 1:return[4,tz(n.sent(),[{pts:tN.current,color:t}])];case 2:return[4,W(s=n.sent())];case 3:return[4,tE(ey,n.sent())];case 4:return l=n.sent(),e6(function(e){return(0,a.Z)(e).concat([{img:l,mode:er},])}),eX(function(e){return(0,a.Z)(e).concat([s])}),e5(l),"brush"===er&&(eI(function(e){return(0,a.Z)(e).concat([{pts:(0,a.Z)(tN.current),color:"erase"===ee?"black":"white"},])}),eE([])),tl(!1),(0,S.c)("manually_background_removed",{selection_type:ee,selection_mode:er,file_name:O.name,source_tool:e.app},[B.C.MS_ANALYTICS]),[2]}})}),function(){return tO.apply(this,arguments)}),tZ=function(e){var t=null==ed?void 0:ed.canvas;t&&(t.addEventListener("mousemove",tB),t.addEventListener("mouseup",tD),tM(e.offsetX,e.offsetY))},tP=function(e){e.preventDefault(),e.stopPropagation();var t,n=null==ed?void 0:ed.canvas;if(n){var r=(null===(t=eH.current)||void 0===t?void 0:t.state.scale)||1,a=n.getBoundingClientRect();tM((e.touches[0].clientX-a.x)/r,(e.touches[0].clientY-a.y)/r)}},tW=function(e){e.preventDefault(),e.stopPropagation();var t,n=null==ed?void 0:ed.canvas;if(n){var r=(null===(t=eH.current)||void 0===t?void 0:t.state.scale)||1,a=n.getBoundingClientRect();tM((e.touches[0].clientX-a.x)/r,(e.touches[0].clientY-a.y)/r)}},tH=(0,d.useCallback)(function(){if(e3.length>0){var e=(0,a.Z)(e3);if("brush"===e.pop().mode)eI(function(e){var t=e.slice();return t.splice(t.length-1,1),t});else{var t=tt.slice(),n=tt[tt.length-1].length;t.splice(tt.length-1,1),e9.splice(e9.length-n,n),e$(function(e){return e-n}),tn(t)}e.length>0?(e5(e[e.length-1].img),eX(function(e){var t=e.slice();return t.splice(t.length-1,1),t}),e6(e)):t$()}},[e3]),tY=function(e){var t=ey.width,n=ey.height,r=e.offsetX,i=e.offsetY;e7(function(e){return(0,a.Z)(e).concat([[{x:r,y:i},],])}),r>=0&&r<=t&&i>=0&&i<=n&&(ed.globalAlpha=.4,ed.beginPath(),ed.arc(r,i,10/eZ,0,2*Math.PI),ed.fillStyle="erase"===ee?"#F15858":"#32ff7e",ed.fill(),ed.globalAlpha=1,ed.beginPath(),ed.arc(r,i,5/eZ,0,2*Math.PI),ed.fillStyle="erase"===ee?"#F15858":"#32ff7e",ed.fill())},tz=(tR=(0,r.Z)(function(e,t){var n,r,a;return(0,i.__generator)(this,function(a){return tJ(r=(n=document.createElement("canvas")).getContext("2d")),tq(r,e),t.map(function(e){return _(r,e.pts,e.color)}),[2,n.toDataURL()]})}),function(e,t){return tR.apply(this,arguments)});(0,d.useEffect)(function(){var e=null==ed?void 0:ed.canvas;if(e&&!th)return"auto"===er&&e.addEventListener("click",tY,!1),"brush"===er&&(e.addEventListener("mousemove",tF),e.addEventListener("touchstart",tW),e.addEventListener("touchmove",tP),e.addEventListener("touchend",tD),e.addEventListener("mouseenter",function(e){eM({x:e.clientX,y:e.clientY}),tI(!0)}),e.addEventListener("mouseleave",function(){tI(!1)}),e.onmouseenter=function(e){eM({x:e.clientX,y:e.clientY}),tI(!0)},e.onmouseleave=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return tI(!1),[2]})}),e.onmousedown=tZ,e.focus()),function(){"brush"===er&&(e.removeEventListener("mousemove",tB),e.removeEventListener("mouseleave",tD),e.removeEventListener("mousemove",tF),e.removeEventListener("mouseup",tD),e.removeEventListener("touchstart",tW),e.removeEventListener("touchmove",tP),e.removeEventListener("touchend",tD),e.onmouseenter=null,e.onmouseleave=null,e.onmousedown=null),"auto"===er&&e.removeEventListener("click",tY)}},[ed,er,ee,eG,e2,e3,eK,e9,th,eZ,]),(0,d.useEffect)(function(){if(!O&&q){"background-remover"===tk||"backgroundblur"===tk?e0.push("/".concat(tk,"/editor")):e0.push("/".concat(tk));return}var e=new Image;e.src=URL.createObjectURL(O),e.crossOrigin="anonymous",e.onload=function(){var t=P(e.naturalWi
1dth,e.naturalHeight,eW);e.width=t.width,e.height=t.height,ej(e),tS(e)},e.onerror=function(){u().push("/".concat(tk))}},[O]);var tK,tJ=function(e){e.canvas.width=ey.naturalWidth,e.canvas.height=ey.naturalHeight,e.canvas.style.width=ey.width+"px",e.canvas.style.height=ey.height+"px",e.scale(ey.naturalWidth/ey.width,ey.naturalHeight/ey.height)},tq=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"source-over",r=arguments.length>3?arguments[3]:void 0,a=P(t.naturalWidth,t.naturalHeight,eW);if(e.imageSmoothingEnabled=!0,e.imageSmoothingQuality="high",!tu&&"hidden"!==r&&"destination-in"===n){e.globalAlpha=.5;var i=U(ey);e.fillStyle=i,e.fillRect(0,0,a.width,a.height)}e.globalCompositeOperation=n,e.globalAlpha=1,e.drawImage(t,0,0,a.width,a.height),e.globalCompositeOperation="source-over"};(0,d.useEffect)(function(){if(0!==e9.length){ta&&clearTimeout(ta);var t=setTimeout(function(){for(var t,n=(t=(0,r.Z)(function(){var t,n,r,s,o,l,c;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return tp(!1),[4,(0,E.SU)(ek,tt,!1)];case 1:if((n=i.sent()).error)return tp(!0),setTimeout(function(){return tl(!1)},1e3),[2];return(0,S.c)("manually_background_removed",{selection_type:ee,selection_mode:er,source_tool:e.app,file_name:O.name},[B.C.MS_ANALYTICS]),s=(r=null==n?void 0:null===(t=n.data)||void 0===t?void 0:t.results)[0].image,G(r[0].image),[4,W(s)];case 2:if(o=i.sent(),!(eC.length>0))return[3,5];return[4,tz(o,eC)];case 3:return[4,W(i.sent())];case 4:o=i.sent(),i.label=5;case 5:return[4,tE(ey,o)];case 6:return e5(c=i.sent()),e6(function(e){return(0,a.Z)(e).concat([{img:c,mode:er},])}),eX(function(e){return(0,a.Z)(e).concat([s])}),tl(!1),[2]}})}),function(){return t.apply(this,arguments)}),s=[],o=eQ;o<e9.length;o++){var l={x:e9[o][0].x/ey.width,y:e9[o][0].y/ey.height,include:"restore"===ee};s.push(l)}s.length>0&&(tt[tt.length]=s,tt.length>0&&(tl(!0),n(),tn(tt),e$(e9.length)))},1e3);return ti(t),function(){return clearTimeout(t)}}},[e9]);var tG,tX=(tK=(0,r.Z)(function(){var e,t;return(0,i.__generator)(this,function(e){switch(e.label){case 0:return[4,W(ep.canvas.toDataURL("image/png"))];case 1:return ev(t=e.sent()),"background-remover"===tk||"backgroundblur"===tk?J(null==t?void 0:t.src):Q("default"),em(null),ec(!0),[2]}})}),function(){return tK.apply(this,arguments)}),tV=(tG=(0,r.Z)(function(){return(0,i.__generator)(this,function(e){return J(null==eg?void 0:eg.src),[2]})}),function(){return tG.apply(this,arguments)});(0,d.useEffect)(function(){K&&("background-remover"===tk||"backgroundblur"===tk?u().push("/".concat(tk,"/editor")):u().push("/product-photos/add"))},[K]);var tQ=function(){var e,t=Z(eW),n=t.width,a=t.height,s=n/ey.width,o=a/ey.height;s<1||o<1?eD(Math.min(s,o)):eD(1),tJ(ed),tJ(ep),tq(ed,ey),tq(ep,ey);var l=(e=(0,r.Z)(function(){var e;return(0,i.__generator)(this,function(t){switch(t.label){case 0:return[4,W(e2)];case 1:return tq(ed,e=t.sent(),"destination-in"),tq(ep,e,"destination-in","hidden"),[2]}})}),function(){return e.apply(this,arguments)});e2&&l()};(0,d.useEffect)(function(){ed&&tQ()},[ed,ey,e2,ee,e3,eG,tu,]);var t$=function(){e5(null),tN.current=[],eX([]),eI([]),e6([]),et("restore"),ea("auto"),e7([]),e$(0),tl(!1),tn([])};(0,d.useEffect)(function(){var e=localStorage.getItem("tips");try{e=e?JSON.parse(e):{}}catch(t){e={}}t_(e)},[]);var t0=eY?eW.width:512,t1=Z(eW),t2=(0,d.useCallback)(function(e){"a"===e.key&&tg(!1),"d"===e.key&&tg(!0),"z"===e.key&&tH(),"s"===e.key&&et("restore"),"e"===e.key&&et("erase")},[e3]);return(0,d.useEffect)(function(){return document.addEventListener("keydown",t2),function(){document.removeEventListener("keydown",t2)}},[t2]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"min-h-screen w-full h-full overflow-hidden antialiased",children:(0,s.jsxs)("div",{className:"z-20 inset-x top-0 absolute w-full h-full flex flex-col bg-white",children:[(0,s.jsx)("div",{className:"w-full fixed bg-white z-10 top-0 shadow-container",children:(0,s.jsxs)("div",{className:"h-16 flex flex-row items-center justify-between py-3 px-4 max-w-7xl mx-auto",children:[(0,s.jsx)("div",{className:"flex-1",children:(0,s.jsxs)("button",{className:"flex items-center",onClick:tT,children:[(0,s.jsx)("i",{className:"isax isax-arrow-left text-xl mr-2"}),(0,s.jsx)("p",{className:"text-sm antialiased text-primary hidden sm:block",children:tw("".concat((0,C.k)(e.app),":NAV_BACK"))})]})}),"refine"===V&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"hidden lg:flex mx-auto w-fit roun
1ded-lg cursor-pointer text-sm absolute left-[50%] -translate-x-[50%] justify-center items-center",children:[(0,s.jsxs)("div",{className:"flex flex-row items-center justify-center mr-5 border rounded-lg",children:[(0,s.jsxs)("div",{className:"relative group px-5 h-8 flex items-center ".concat(th?"":"bg-primary rounded-l-lg text-white"),onClick:function(){return tg(!1)},children:[th?(0,s.jsx)(m.M,{className:"text-base text-primary"}):(0,s.jsx)(x.B,{className:"text-base text-white"}),(0,s.jsx)(H,{text:tw("".concat((0,C.k)(e.app),":TOOLTIP_EDIT")),shorcutKey:"A"})]}),(0,s.jsxs)("div",{className:"relative group px-5 h-8 flex items-center ".concat(th?"bg-primary rounded-r-lg text-white":""),onClick:function(){tg(!0)},children:[th?(0,s.jsx)(b.q,{className:"text-base text-white"}):(0,s.jsx)(y.m,{className:"text-base text-primary"}),(0,s.jsx)(H,{text:tw("".concat((0,C.k)(e.app),":TOOLTIP_MOVE")),shorcutKey:"D"})]})]}),(0,s.jsx)("div",{className:"flex justify-center items-center border-l pl-5",children:(0,s.jsxs)("div",{className:"flex flex-col ",children:[(0,s.jsx)("p",{className:" text-xxs font-medium text-primary mb-2 font-inter",children:tw("".concat((0,C.k)(e.app),":ZOOM_TITLE"))}),(0,s.jsx)(F.Z,{label:tw("".concat((0,C.k)(e.app),":ZOOM_TITLE")),min:100*eB,max:500,value:100*(eZ||eB||1),onChange:function(e){return tL(e/100)},width:"w-full"})]})}),e3.length>0&&(0,s.jsxs)("div",{className:"ml-5 pl-5 flex border-l",children:[(0,s.jsxs)("div",{className:"".concat(e3.length>0?"flex items-center justify-center":"hidden"," mr-5 w-9 sm:w-10 h-9 sm:h-10 rounded-lg lg:hover:bg-[#f4f4f4] bg-transparent antialiased pointer-events-auto group relative cursor-pointer"),onClick:tH,children:[(0,s.jsx)("i",{className:"isax isax-rotate-left sm:text-lg text-primary"}),(0,s.jsx)(H,{text:tw("".concat((0,C.k)(e.app),":TOOLTIP_UNDO")),shorcutKey:"Z"})]}),(0,s.jsx)("div",{className:"flex items-center justify-center w-9 sm:w-10 h-9 sm:h-10 rounded-lg antialiased pointer-events-auto select-none lg:hover:bg-[#f4f4f4] cursor-pointer group relative",onClick:function(){td(function(e){return!e})},children:tu?(0,s.jsxs)("div",{children:[(0,s.jsx)("i",{className:"isax isax-eye4 sm:text-lg text-primary"}),(0,s.jsx)(H,{text:tw("".concat((0,C.k)(e.app),":TOOLTIP_OVERLAY"))})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("i",{className:"isax isax-eye-slash5 sm:text-lg text-primary"}),(0,s.jsx)(H,{text:tw("".concat((0,C.k)(e.app),":TOOLTIP_TRANSPARENT"))})]})})]})]}),(0,s.jsxs)("div",{className:"flex lg:hidden mx-auto w-fit rounded-lg text-sm justify-center items-center",children:[(0,s.jsxs)("div",{className:"flex flex-row items-center justify-center mr-3 border rounded-md cursor-pointer text-xs",children:[(0,s.jsx)("div",{className:"px-3 py-1.5 flex items-center ".concat(th?"":"bg-primary rounded-l-md text-white"),onClick:function(){return tg(!1)},children:th?(0,s.jsx)(m.M,{className:"text-base text-primary"}):(0,s.jsx)(x.B,{className:"text-base text-white"})}),(0,s.jsx)("div",{className:"px-3 py-1.5 flex items-center ".concat(th?"bg-primary rounded-r-md text-white":""),onClick:function(){tg(!0)},children:th?(0,s.jsx)(b.q,{className:"text-base text-white"}):(0,s.jsx)(y.m,{className:"text-base text-primary"})})]}),(0,s.jsx)("div",{className:"flex justify-center items-center",children:(0,s.jsxs)("div",{className:"flex flex-row border rounded-md ",children:[(0,s.jsx)("div",{className:"px-2 py-1.5 flex items-center cursor-pointer",onClick:function(){tL(parseFloat(eZ||eB||1,10)+.2)},children:(0,s.jsx)("i",{className:"isax isax-add text-primary text-base"})}),(0,s.jsx)("div",{className:"px-2 py-1.5 border-l flex items-center cursor-pointer",onClick:function(){tL(parseFloat(eZ||eB||1,10)-.2)},children:(0,s.jsx)("i",{className:"isax isax-minus text-primary text-base"})})]})}),e3.length>0&&(0,s.jsxs)("div",{className:"ml-3 flex",children:[(0,s.jsx)("button",{className:"".concat(e3.length>0?"flex items-center justify-center":"hidden"," mr-3 w-7 h-7 rounded-lg lg:hover:bg-[#f4f4f4] bg-transparent antialiased pointer-events-auto"),onClick:tH,children:(0,s.jsx)("i",{className:"isax isax-rotate-left sm:text-lg text-primary"})}),(0,s.jsx)("button",{className:"flex items-center justify-center w-7 h-7 rounded-lg antialiased pointer-events-auto select-none ".concat(tu?"bg-[#f4f4f4]":"bg-transparent"),onClick:function(){td(function(e){return!e})},children:(0,s.jsx)("i",{className:"isax isax-eye sm:text-lg text-primary"})})]})]})]})]})}),(0,s.jsx)("div",{className:"bg-white w-full h-full lg:h-full",children:(0,s.jsxs)("div",{className:"pt-16 pb-[280px] h-full lg:pb-0",children:[(0,s.jsx)("div",{className:"hidden overflow-y-auto lg:block w-80 h-full fixed border-r border-[rgba(10, 23, 39, 0.06)] shadow-container",children:"default"===V?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"py-6 px-7 border-b text-base font-semibold text-primary antialiased -tracking-[0.011rem] font-inter",children:tw("".concat((0,C.k)(e.app),":REVIEW_TITLE"))}),(0,s.jsxs)("div",{className:"mt-8 px-7 flex flex-col",children:[(0,s.jsx)("p",{className:"text-primary antialiased text-sm font-normal mb-3 font-inter -tracking-[0.015em]",children:tw("".concat((0,C.k)(e.app),":NEXT_CREATE_PRODUCT_TITLE"))}),(0,s.jsx)(L.PrimaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":NEXT_CREATE_PRODUCT_CTA")),onClick:tV,disabled:!eg}),(0,s.jsx)("p",{className:"text-primary antialiased text-sm font-normal mb-3 mt-8 font-inter -tracking-[0.015em]",children:tw("".concat((0,C.k)(e.app),":REFINE_TITLE"))}),(0,s.jsx)(L.SecondaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":REFINE_SUBJECT_CTA")),onClick:function(){return Q("refine")},disabled:!eg})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"py-6 px-7 border-b text-base font-semibold text-primary antialiased -tracking-[0.011rem] font-inter",children:tw("".concat((0,C.k)(e.app),":REFINE_SUBJECT_TITLE"))}),(0,s.jsxs)("div",{className:"pt-8 px-7 relative",children:[e3.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("div",{className:"flex flex-row mb-8 items-center flex-wrap",children:[(0,s.jsx)("p",{className:"text-primary text-sm font-semibold flex-1 flex items-center",children:"auto"===er?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.x,{className:"text-base text-primary mr-2"}),(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":AUTO_MODE_TITLE"))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.u,{className:"text-base text-primary mr-2"}),(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":MANUAL_MODE_TITLE"))})]})}),(0,s.jsx)("p",{className:"cursor-pointer text-xs font-bold text-[#B63AF0] uppercase shrink-0",onClick:function(){return ea("auto"===er?"brush":"auto")},children:tw("auto"===er?"".concat((0,C.k)(e.app),":SWITCH_TO_MANUA
1L"):"".concat((0,C.k)(e.app),":SWITCH_TO_AUTO"))})]}),(0,s.jsxs)("div",{className:"flex items-center cursor-pointer",children:[(0,s.jsxs)("div",{className:"".concat("restore"===ee?"ring-2 ring-[#B63AF0] text-primary font-semibold":"text-primary ring-primary-light font-medium ring-1"," ring-inset px-5 py-2 rounded-full justify-center items-center flex text-sm relative group"),onClick:function(){et("restore")},children:["restore"===ee?(0,s.jsx)(v.b,{className:"text-base text-primary"}):(0,s.jsx)(g.g,{className:"text-base text-primary"}),(0,s.jsx)("span",{className:"ml-2",children:tw("".concat((0,C.k)(e.app),":RESTORE_TOGGLE"))}),(0,s.jsx)(H,{shorcutKey:"S"})]}),(0,s.jsxs)("div",{className:"".concat("erase"===ee?"ring-2 ring-[#B63AF0] text-primary font-semibold":"text-primary ring-primary-light font-medium ring-1"," ring-inset px-5 py-2 rounded-full justify-center font-normal items-center flex ml-3 text-sm group relative"),onClick:function(){et("erase")},children:["erase"===ee?(0,s.jsx)(f.g,{className:"text-base text-primary"}):(0,s.jsx)(p.n,{className:"text-base text-primary"}),(0,s.jsx)("span",{className:"ml-2",children:tw("".concat((0,C.k)(e.app),":ERASE_TOGGLE"))}),(0,s.jsx)(H,{shorcutKey:"E"})]})]}),"brush"===er&&(0,s.jsxs)("div",{className:"flex flex-col mt-5",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-primary mb-2 font-inter antialiased -tracking-[0.015em]",children:tw("".concat((0,C.k)(e.app),":BRUSH_SLIDER_TITLE"))}),(0,s.jsx)(F.Z,{label:"Brush",min:10,max:200,value:eK,onChange:function(e){return eJ(e)},width:"w-full"})]})]})}),(0,s.jsx)("p",{className:"mt-5 text-sm text-primary font-normal",children:tw("auto"===er?"".concat((0,C.k)(e.app),":AUTO_MODE_DESCRIPTION"):"".concat((0,C.k)(e.app),":MANUAL_MODE_DESCRIPTION"))}),(0,s.jsxs)("div",{children:[(0,s.jsx)(L.PrimaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":CONFIRM_SUBJECT_CTA")),onClick:tX,classes:"mt-7"}),(0,s.jsx)(L.SecondaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":RESET_IMAGE_WEB_CTA")),onClick:function(){return ty(!0)},classes:"mt-4"})]})]}):(0,s.jsxs)("div",{className:"flex flex-col relative",children:[(0,s.jsx)("p",{className:"text-primary text-sm font-semibold mb-5 font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MARK_SUBJECT_TITLE"))}),(0,s.jsx)("p",{className:"text-sm text-primary font-normal font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MARK_SUBJECT_SUBTITLE"))}),(0,s.jsx)("div",{className:"mt-12 w-fit rounded-2xl overflow-hidden hidden md:block",children:(0,s.jsx)(k(),{loop:!0,path:"https://".concat("meta.magicstudio.com/assets","/lottie/mark-points-demo.json"),play:!0,speed:.8})})]}),th&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center absolute mt-8 -ml-7 px-7 h-full w-full top-0 bottom-0 z-10 bg-white opacity-95",children:[(0,s.jsx)("p",{className:"text-sm text-primary font-semibold font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_TITLE"))}),(0,s.jsx)("p",{className:"text-sm text-primary font-normal font-inter -tracking-[0.015em] antialiased mt-2",children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_SUBTITLE"))}),(0,s.jsx)("p",{className:" cursor-pointer text-xs font-bold text-[#B63AF0] mt-6 font-inter -tracking-[0.015em] antialiased uppercase",onClick:function(){return tg(!1)},children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_CTA"))})]})]})]})}),(0,s.jsx)("div",{className:"flex-grow lg:pl-80 h-full w-full ".concat(to?"pointer-events-none touch-none":""," ").concat(eY?"relative":""),children:(0,s.jsx)("div",{className:"h-full mx-auto lg:relative",children:ey&&eg&&"refine"===V?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"".concat(to?"absolute":"hidden"," inset-x-0 top-1 z-20 max-w-fit mx-auto rounded-lg"),children:(0,s.jsxs)("div",{className:"max-w-lg flex flex-col items-center bg-gradient-to-tr to-product-photos-gradient-end via-product-photos-gradient-middle from-product-photos-gradient-start rounded-lg px-4 py-2 mx-4 text-center",children:[(0,s.jsx)("p",{className:"text-white antialiased text-xs md:text-sm mb-1 font-inter -tracking-[0.015em] font-medium",children:tw(tx?"".concat((0,C.k)(e.app),":REFINE_SUBJECT_ERROR"):"".concat((0,C.k)(e.app),":REFINE_SUBJECT_LOADER"))}),(0,s.jsx)(o.Z,{color:"#ffffff",size:35})]})}),(0,s.jsx)(N.d$,{ref:function(e){e&&(eH.current=e)},panning:{disabled:!th,velocityDisabled:!0},wheel:{step:.05},centerZoomedOut:!0,alignmentAnimation:{disabled:!0},centerOnInit:!0,limitToBounds:!1,initialScale:eB,minScale:eB,onZoom:function(e){eP(e.state.scale)},doubleClick:{disabled:!0},children:(0,s.jsxs)(N.Uv,{wrapperStyle:{width:"100%",height:"100%",margin:"auto",backgroundImage:"radial-gradient(circle, #CED1D4 1px, transparent 1px)",backgroundSize:"15px 15px"},contentStyle:{opacity:"default"===V?"0":"1",backgroundColor:"white"},contentClass:"".concat(to?"pointer-events-none animate-pulse-in-out":""," ").concat(tu?"transparent-grid":""," "),children:[(0,s.jsx)("canvas",{id:"originalImageCanvasContext",ref:function(e){if(e&&!ed){var t=e.getContext("2d",{willReadFrequently:!0});t&&em(t)}},className:"\n ".concat(th?"cursor-grab":"auto"===er?"erase"===ee?"cursor-pointer-subtract":"cursor-pointer-add":"cursor-none","\n m-auto ").concat("brush"===er?"":"z-10")}),(0,s.jsx)("canvas",{id:"proceesedImageCanvasContext",ref:function(e){if(e&&!ep){var t=e.getContext("2d",{willReadFrequently:!0});t&&ef(t)}},className:"opacity-0 m-auto absolute top-0 left-0 pointer-events-none touch-none"}),(0,s.jsx)("div",{className:"pointer-events-none touch-none absolute flex top-0 left-0 ".concat(tu?"opacity-0":"opacity-30"),children:(0,s.jsx)("div",{style:{backgroundImage:"url(".concat(null==ey?void 0:ey.src,")"),backgroundRepeat:"no-repeat",width:ey.width,height:ey.height,backgroundSize:"contain"},className:"m-auto"})})]})}),es&&!th&&"brush"===er&&"refine"===V&&(0,s.jsx)("div",{className:"sm:block fixed z-10 rounded-full pointer-events-none border ".concat("erase"===ee?"border-erase-color bg-erase-color":"border-brush-color bg-brush-color"," "),style:{width:"".concat(eK,"px"),height:"".concat(eK,"px"),left:"".concat(eO,"px"),top:"".concat(eR,"px"),transform:"translate(-50%, -50%)"}})]}):eg?(0,s.jsx)("div",{className:"absolute top-0 left-0 flex items-center w-full h-full",children:(0,s.jsx)("div",{className:"flex items-center justify-center transparent-grid mx-auto my-auto",children:(0,s.jsx)("img",{src:null==eg?void 0:eg.src,alt:"resized",style:{maxWidth:eY?t1.width:t0,maxHeight:eY?t1.height:t0}})})}):(0,s.jsx)("div",{className:"flex flex-col items-center justify-center h-login-page-desktop mx-4",children:(0,s.jsx)(M.Z,{text:tw("".concat((0,C.k)(e.app),":SETTING_UP_IMAGE"))})})})}),(0,s.jsx)("div",{className:"flex flex-col lg:hidden overflow-y-hidden fixed bottom-0 w-full bg-white shadow-container rounded-t-2xl py-4 px-4",children:(0,s.jsx)("div",{className:" w-full flex flex-col justify-center ",children:"default"===V?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-sm font-semibold text-primary antialiased",children:tw("".concat((0,C.k)(e.app),":REVIEW_TITLE"))}),(0,s.jsxs)("div",{className:"mt-6 flex flex-col",children:[(0,s.jsx)(L.PrimaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":NEXT_CREATE_PRODUCT_CTA")),onClick:tV,disabled:!eg}),(0,s.jsx)(L.SecondaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":REFINE_SUBJECT_CTA")),classes:"mt-4",onClick:function(){return Q("refine")},disabled:!eg})]})]}):(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",{className:"text-sm font-semibold text-primary",children:[e3.length>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:"Refine Product Image"}),(0,s.jsx)("div",{className:"mt-5 flex flex-col justify-center cursor-pointer",children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsxs)("div",{className:"flex flex-row mb-4 items-center flex-wrap",children:[(0,s.jsx)("p",{className:"text-primary text-sm font-semibold flex-1 flex",children:"auto"===er?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(h.x,{className:"text-base text-primary mr-2"}),(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":AUTO_MODE_TITLE"))})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(j.u,{className:"text-base text-primary mr-2"}),(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":MANUAL_MODE_TITLE"))})]})}),(0,s.jsx)("p",{className:"cursor-pointer text-xs font-bold text-[#B63AF0] uppercase shrink-0",onClick:function(){return ea("auto"===er?"brush":"auto")},children:tw("auto"===er?"".concat((0,C.k)(e.app),":SWITCH_TO_MANUA
1L"):"".concat((0,C.k)(e.app),":SWITCH_TO_AUTO"))})]}),(0,s.jsxs)("div",{className:"flex items-end cursor-pointer",children:[(0,s.jsx)("div",{className:"".concat("restore"===ee?" ring-2 ring-[#B63AF0] text-primary font-semibold":"ring-1 text-primary ring-primary-light font-medium"," ring-inset px-5 py-2 rounded-full justify-center items-center flex text-xs font-inter antialiased -tracking-[0.015em]"),onClick:function(){et("restore")},children:(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":RESTORE_TOGGLE"))})}),(0,s.jsx)("div",{className:"".concat("erase"===ee?" ring-2 ring-[#B63AF0] text-primary font-semibold":"ring-1 text-primary ring-primary-light font-medium"," px-5 py-2 rounded-full justify-center font-normal items-center flex ml-3 text-xs font-inter antialiased -tracking-[0.015em]"),onClick:function(){et("erase")},children:(0,s.jsx)("span",{children:tw("".concat((0,C.k)(e.app),":ERASE_TOGGLE"))})}),"brush"===er&&(0,s.jsxs)("div",{className:"flex flex-col ml-4",children:[(0,s.jsx)("p",{className:"text-xs font-medium text-primary mb-2 font-inter antialiased -tracking-[0.015em]",children:tw("".concat((0,C.k)(e.app),":BRUSH_SLIDER_TITLE"))}),(0,s.jsx)(F.Z,{label:"Brush",min:10,max:200,value:eK,onChange:function(e){return eJ(e)},width:"w-full"})]})]})]})}),(0,s.jsx)("p",{className:"mt-4 text-sm text-primary font-normal",children:tw("auto"===er?"".concat((0,C.k)(e.app),":AUTO_MODE_DESCRIPTION"):"".concat((0,C.k)(e.app),":MANUAL_MODE_DESCRIPTION"))})]})}),(0,s.jsxs)("div",{className:"mt-4 flex flex-row items-center",children:[(0,s.jsx)(L.PrimaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":CONFIRM_SUBJECT_CTA")),onClick:tX}),(0,s.jsx)(L.SecondaryButtonFullWidth,{text:tw("".concat((0,C.k)(e.app),":RESET_IMAGE_MOBILE_CTA")),onClick:function(){return ty(!0)},classes:"ml-4 w-fit"})]})]}):(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("p",{className:"text-primary text-sm font-semibold mb-5 font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MARK_SUBJECT_TITLE"))}),(0,s.jsxs)("div",{className:"flex flex-row",children:[(0,s.jsx)("p",{className:"text-sm text-primary font-normal font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MARK_SUBJECT_SUBTITLE"))}),(0,s.jsx)("div",{className:"w-40 overflow-hidden rounded-lg ml-4 shrink-0",children:(0,s.jsx)(k(),{loop:!0,path:"https://".concat("meta.magicstudio.com/assets","/lottie/mark-points-demo.json"),play:!0,speed:.8})})]})]}),th&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center absolute -ml-4 px-4 h-full w-full top-0 bottom-0 z-10 bg-white opacity-95",children:[(0,s.jsx)("p",{className:"text-sm text-primary font-semibold font-inter -tracking-[0.015em] antialiased",children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_TITLE"))}),(0,s.jsx)("p",{className:"text-sm text-primary font-normal font-inter -tracking-[0.015em] antialiased mt-2",children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_SUBTITLE"))}),(0,s.jsx)("p",{className:" cursor-pointer text-xs font-bold text-[#B63AF0] mt-6 font-inter -tracking-[0.02em] antialiased uppercase",onClick:function(){return tg(!1)},children:tw("".concat((0,C.k)(e.app),":MOVE_MODE_CTA"))})]})]})})})})]})})]})}),tb&&(0,s.jsx)(R,{onConfirm:function(){t$(),ty(!1)},onCancel:function(){return ty(!1)},app:"product-photos"})]})}},43281:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(51403);function a(e){var t=((e.max||100)-(e.min||0))/100;return(0,r.jsx)("div",{className:"inline-flex items-center py-1 w-full",children:(0,r.jsx)("input",{style:{WebkitAppearance:"none"},className:"appearance-none rounded-lg h-1.5 bg-slate-200 ".concat(e.width?e.width:"w-36"," cursor-pointer"),type:"range",step:t,min:e.min,max:e.max,value:e.value,onChange:function(t){t.preventDefault(),t.stopPropagation(),e.onChange(parseInt(t.currentTarget.value,10))}})})}},34166:function(e,t,n){n.d(t,{Z:function(){return a}});var r=n(16660);function a(e,t){(0,r.useEffect)(function(){var n=function(n){e.current&&!e.current.contains(n.target)&&t(!1)};return document.addEventListener("click",n,!0),function(){document.removeEventListener("click",n,!0)}},[e])}},74706:function(e,t,n){function r(e){return"magiceraser"===e?"magic_eraser":"background-remover"===e?"background_eraser":"image-upscaler"===e?"image_enlarger":void 0}function a(e){return"magiceraser"===e?"magic-eraser":"background-remover"===e?"background-remover":"image-upscaler"===e?"image-upscaler":"ai-image-generator"===e?"ai-image-generator":"photobooth"===e?"photo-booth":"product-photos"===e?"product-photos":"backgroundblur"===e?"background-blur":void 0}n.d(t,{A:function(){return r},k:function(){return a}})},70994:function(e,t,n){n.d(t,{Z:function(){return u}});var r,a=n(20550),i=n(2081),s=n(18895),o=n(29094),l=n(80394),c=(r=(0,a.Z)(function(e){var t,n,r;return(0,i.__generator)(this,function(a){switch(a.label){case 0:return t="",[4,(0,s.eA)(e)];case 1:return(n=a.sent()).error&&(0,l.c)("error_occured",{error_message:uploadFileResp.error,source_tool:"product-photos",error_function:"uploadFileToCustomServer"},[o.C.MS_ANALYTICS]),n.data&&(t=null==n?void 0:null===(r=n.data)||void 0===r?void 0:r.url),[2,t]}})}),function(e){return r.apply(this,arguments)});function u(e,t){return d.apply(this,arguments)}function d(){return(d=(0,a.Z)(function(e,t){var n,r,a,u,d,m,x,p,f,h,g;return(0,i.__generator)(this,function(i){switch(i.label){case 0:return a="",u=0,[4,(0,s.tE)(t)];case 1:if((d=i.sent()).error)return[2,d];return m=new Date().getTime(),[4,(0,s.wg)(e,null==d?void 0:null===(n=d.data)||void 0===n?void 0:n.url,null==d?void 0:null===(r=d.data)||void 0===r?void 0:r.fields,"image/*")];case 2:if(x=i.sent(),u=(new Date().getTime()-m)/1e3,!x.error)return[3,4];return(0,l.c)("error_occured",{error_message:x.error,source_tool:"product-photos",error_function:"uploadFileToS3"},[o.C.MS_ANALYTICS]),[4,c(e)];case 3:return a=i.sent(),[3,5];case 4:a=(null==d?void 0:null===(f=d.data)||void 0===f?void 0:f.base_url)+"/"+(null==d?void 0:null===(h=d.data)||void 0===h?void 0:null===(g=h.fields)||void 0===g?void 0:g.key),i.label=5;case 5:return[2,{url:a,totalTime:u}]}})})).apply(this,arguments)}}}]);
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.