PageSourceSearch

https://app.simplified.com/static/js/9801.9f2794bb.chunk.js

js simplified.com collected 2026-09-24 09:26:22 UTC 106,306 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunksimplified_web=self.webpackChunksimplified_web||[]).push([[9801],{434170:(e,t,i)=>{i.r(t),i.d(t,{default:()=>F});var o=i(683017),a=i(90583),n=i(587383),r=i(692877),s=i(772929),l=i(323887),c=i(926284),d=i(354161),u=i(732259),h=i(282887),p=i(553218),g=i(448921),m=i(853587),v=i(436455),C=i(741065),f=i(270858),E=i(179822),x=i(773414),T=i(349798),_=i(104399),S=i(778145),b=i(412997),w=i(53909),R=i(408499),k=i(313773),y=i(919941),j=i(203517),A=i(501271),P=i(997383),I=i(659840),L=i(228993);const F=e=>{let{handlerRef:t,setIsFinishLoading:i}=e;const[F,O]=(0,o.useState)(""),[B,M]=(0,o.useState)({total_Generations:"4"}),[D,N]=(0,n.k)(!1),{t:G}=(0,R.$)(["tools","media-editor"]),H=(0,r.S)({base:!0,md:!0,lg:!1}),z=(0,I.k6)(),U=parseInt((0,_.getQueryParam)("step",z.location.search),10)||_.SCREEN_VIEW_STEP.INITIAL,V=(0,o.useMemo)(()=>a.zfW.map(e=>({...e,label:G(`size_name.${e.id}`,{ns:"media-editor"}),name:G(`size_name.${e.id}`,{ns:"media-editor"})})),[G]),[K,Z]=(0,o.useState)(a.zfW[0]),W=(0,o.useCallback)(e=>{Z(e||null),t.current.workareaHandler.changeSize(null===e||void 0===e?void 0:e.width,null===e||void 0===e?void 0:e.height),t.current.canvas.centerObject(t.current.activeEditPhotoImage),t.current.canvas.centerObject(t.current.workarea),t.current.objectHandler.fitObjectToCanvas(t.current.activeEditPhotoImage),t.current.canvas.clipPath=new j.fabric.Rect({width:t.current.workarea.getScaledWidth(),height:t.current.workarea.getScaledHeight(),top:t.current.workarea.top,left:t.current.workarea.left}),t.current.canvas.requestRenderAll()},[t]),$=(0,o.useCallback)(e=>{K&&W({...K,width:Number(e),height:Number(null===K||void 0===K?void 0:K.height)})},[W,K]),X=(0,o.useCallback)(e=>{K&&W({...K,width:Number(null===K||void 0===K?void 0:K.width),height:Number(e)})},[W,K]);(0,o.useEffect)(()=>{W(K)},[K]);const J=e=>{const t=z.location.pathname,i=new URLSearchParams(z.location.search);i.set("step",e),z.push({pathname:t,search:i.toString()})};function Y(){if(!F.length)return void(0,a.CFj)({description:G("magic_expand_msg.title_no_urls"),title:G("magic_expand_msg.description_no_prompt"),status:"info"});i(!0),N.on();let e=t.current.getEditPhotoCanvasAsDataURL(),o=t.current.createMagicExpandMask();const n=(0,_.base64ToFile)(e,"base_image.jpg","image/jpg"),r=(0,_.base64ToFile)(o,"mask_image.jpg","image/jpg");let s="",l="";Promise.allSettled([(0,k.B6$)(n,"temporary"),(0,k.B6$)(r,"temporary")]).then(e=>{const o=e.map((e,t)=>"fulfilled"===e.status?e.value:(console.error("Failed:",e.reason),null));o.length>0&&2===o.length&&(s=o[0],l=o[1]),(0,k.$_P)({image_url:s,mask_url:l,prompt:F,count:Number(B.total_Generations)}).then(async e=>{try{var o,n,r,s,l;const c=await(0,y.Cp)(e.data.task_id,()=>{});if(null===c||void 0===c||null===(o=c.response)||void 0===o||null===(n=o.detail)||void 0===n||!n.task_id)return;const d=await(0,y.Cp)(c.response.detail.task_id,()=>{});i(!1);const u=null===d||void 0===d||null===(r=d.response)||void 0===r||null===(s=r.detail)||void 0===s||null===(l=s.data)||void 0===l?void 0:l.urls;if(!(u.length>0))return void(0,a.CFj)({description:G("magic_expand_msg.title_no_urls"),title:G("magic_expand_msg.description_no_urls"),status:"info"});t.current.magicExpandResults=u,await t.current.changeSrc(u[0],!1),N.off(),H&&J(_.SCREEN_VIEW_STEP.LAST.toString())}catch(c){(0,A.iM)(c),i(!1),N.off()}}).catch(e=>{(0,A.iM)(e),i(!1),N.off()})})}return(0,L.jsx)(L.Fragment,{children:H?(0,L.jsx)(h.g,{spacing:2,children:U===_.SCREEN_VIEW_STEP.INITIAL?(0,L.jsxs)(L.Fragment,{children:[V&&(0,L.jsx)(a.HW7,{t:G,items:V,value:null!==K&&void 0!==K&&K.id?K:void 0,onChange:W,isClearable:!0,isDisabled:!1}),(0,L.jsxs)(p.U,{spacing:2,children:[(0,L.jsx)(g.B,{size:"sm",children:(0,L.jsxs)(m.Y2,{onChange:$,value:(null===K||void 0===K?void 0:K.width)||0,precision:0,step:1,min:1,isDisabled:!1,children:[(0,L.jsx)(v.Z,{children:(0,L.jsx)(S.FaArrowsAltH,{})}),(0,L.jsx)(m.zu,{pl:8})]})}),(0,L.jsx)(C.x,{as:"span",fontSize:"sm",children:"x"}),(0,L.jsx)(g.B,{size:"sm",children:(0,L.jsxs)(m.Y2,{onChange:X,value:(null===K||void 0===K?void 0:K.height)||0,precision:0,step:1,min:1,size:"sm",children:[(0,L.jsx)(v.Z,{children:(0,L.jsx)(S.FaArrowsAltV,{})}),(0,L.jsx)(m.zu,{pl:8})]})})]})]}):U===_.SCREEN_VIEW_STEP.MID?(0,L.jsx)(a.aSg,{onChangeLayerPosition:e=>{const i=t.current.activeEditPhotoImage;
1t.current.changeObjectPosition(e,i),t.current.canvas.requestRenderAll()}}):U===_.SCREEN_VIEW_STEP.FINAL?(0,L.jsxs)(h.g,{w:"full",spacing:4,children:[(0,L.jsx)(w.Z,{generativeFillText:F,setGenerativeFillText:O,onModal:!1}),(0,L.jsx)(P.Z,{total_Generations:B.total_Generations,onSuggestionSelection:M}),(0,L.jsxs)(x.h,{w:"full",children:[(0,L.jsx)(T.z,{w:"full",onClick:()=>J(_.SCREEN_VIEW_STEP.MID.toString()),children:G("back",{ns:"tools"})}),(0,L.jsx)(T.z,{w:"full",variant:"ai",onClick:Y,isLoading:D,isDisabled:!F.length,spinner:(0,L.jsx)(a.eFW,{}),children:G("generate")})]})]}):U===_.SCREEN_VIEW_STEP.LAST&&t.current.magicExpandResults?(0,L.jsxs)(h.g,{spacing:2,children:[(0,L.jsx)(f.x,{display:"flex",flexWrap:"wrap",gap:4,alignSelf:"center",justifyContent:"center",children:t.current.magicExpandResults.map(e=>(0,L.jsx)(f.x,{width:"150px",height:"114px",cursor:"pointer",borderRadius:"lg",overflow:"hidden",outline:"1px solid",outlineColor:e===t.current.activeEditPhotoImage.src?"common.primary_400":"transparent",onClick:()=>t.current.changeSrc(e,!1),children:(0,L.jsx)(E.E,{width:"150px",height:"114px",src:e,objectFit:"contain"})},e))}),(0,L.jsxs)(x.h,{w:"full",mb:2,children:[(0,L.jsx)(T.z,{w:"full",onClick:()=>J(_.SCREEN_VIEW_STEP.INITIAL.toString()),leftIcon:(0,L.jsx)(S.FaSyncAlt,{}),children:G("reset")}),(0,L.jsx)(T.z,{w:"full",variant:"ai",onClick:Y,isLoading:D,leftIcon:(0,L.jsx)(b.T$Z,{}),isDisabled:!F.length,spinner:(0,L.jsx)(a.eFW,{}),children:G("generate")})]})]}):""}):(0,L.jsx)(L.Fragment,{children:(0,L.jsxs)(s.U,{variant:"outline",mt:4,allowMultiple:!0,defaultIndex:[0,2],children:[(0,L.jsxs)(l.Q,{children:[(0,L.jsxs)(c.K,{children:[G("magic_expand_prop_size"),(0,L.jsx)(d.X,{})]}),(0,L.jsx)(u.H,{children:(0,L.jsxs)(h.g,{spacing:"1.5rem",children:[V&&(0,L.jsx)(a.HW7,{t:G,items:V,value:null!==K&&void 0!==K&&K.id?K:void 0,onChange:W,isClearable:!0,isDisabled:!1}),(0,L.jsxs)(p.U,{spacing:2,children:[(0,L.jsx)(g.B,{size:"sm",children:(0,L.jsxs)(m.Y2,{onChange:$,value:(null===K||void 0===K?void 0:K.width)||0,precision:0,step:1,min:1,isDisabled:!1,children:[(0,L.jsx)(v.Z,{children:(0,L.jsx)(S.FaArrowsAltH,{})}),(0,L.jsx)(m.zu,{pl:8})]})}),(0,L.jsx)(C.x,{as:"span",fontSize:"sm",children:"x"}),(0,L.jsx)(g.B,{size:"sm",children:(0,L.jsxs)(m.Y2,{onChange:X,value:(null===K||void 0===K?void 0:K.height)||0,precision:0,step:1,min:1,size:"sm",children:[(0,L.jsx)(v.Z,{children:(0,L.jsx)(S.FaArrowsAltV,{})}),(0,L.jsx)(m.zu,{pl:8})]})}),(0,L.jsx)(C.x,{as:"span",fontSize:"sm",children:"pixels"})]})]})})]}),(0,L.jsxs)(l.Q,{children:[(0,L.jsxs)(c.K,{children:[G("magic_expand_prom_position"),(0,L.jsx)(d.X,{})]}),(0,L.jsx)(u.H,{children:(0,L.jsx)(a.aSg,{onChangeLayerPosition:e=>{const i=t.current.activeEditPhotoImage;t.current.changeObjectPosition(e,i),t.current.canvas.requestRenderAll()}})})]}),(0,L.jsxs)(l.Q,{children:[(0,L.jsxs)(c.K,{children:[G("enter_prompt")," ",(0,L.jsx)(d.X,{})]}),(0,L.jsx)(u.H,{children:(0,L.jsxs)(h.g,{spacing:"1.5rem",children:[(0,L.jsx)(w.Z,{generativeFillText:F,setGenerativeFillText:O,onModal:!1}),(0,L.jsx)(P.Z,{total_Generations:B.total_Generations,onSuggestionSelection:M}),(0,L.jsx)(f.x,{display:"flex",flexWrap:"wrap",gap:4,alignSelf:"center",justifyContent:"center",children:t.current.magicExpandResults.map(e=>(0,L.jsx)(f.x,{width:"150px",height:"114px",cursor:"pointer",borderRadius:"lg",overflow:"hidden",outline:"1px solid",outlineColor:e===t.current.activeEditPhotoImage.src?"common.primary_400":"transparent",onClick:()=>t.current.changeSrc(e,!1),children:(0,L.jsx)(E.E,{width:"150px",height:"114px",src:e,objectFit:"contain"})},e))}),(0,L.jsxs)(x.h,{w:"full",children:[(0,L.jsx)(T.z,{w:"full",onClick:function(){O(""),M({total_Generations:"4"}),Z(a.zfW[0])},children:G("reset")}),(0,L.jsx)(T.z,{w:"full",variant:"ai",onClick:Y,isLoading:D,isDisabled:!F.length,spinner:(0,L.jsx)(a.eFW,{}),children:G("generate")})]})]})})]})]})})})}},53909:(e,t,i)=>{i.d(t,{Z:()=>l});i(683017);var o=i(3641),a=i(819135),n=i(68530),r=i(408499),s=i(228993);const l=e=>{let{generativeFillText:t,setGenerativeFillText:i}=e;const{t:l}=(0,r.$)(["tools"]);return(0,s.jsxs)(o.NI,{children:[(0,s.jsx)(a.l,{children:l("describe_your_image",{ns:"tools"})}),(0,s.jsx)(n.g,{placeholder:l("example_of_generate",{ns:"tools"}),value:t,onChange:e=>i(e.target.value)})]})}},858732:(e,t,i)=>{i.d(t,{b:()=>d});var o=i(104399),a=i(791048),n=i(683017),r=i(293538);const s={"@type":"Organization",name:"Simplified",legalName:"TLDR Technologies,Inc. (DBA, Simplified)",url:"https://simplified.com",duns:"1185
156846",taxID:"85-3663807",logo:"https://lp.simplified.com/607f32d6309ca31d63c6724d/641ad20290cc7201c8b804f5_simlified-logo.svg",sameAs:["https://www.instagram.com/simplified.ai.writer/","https://www.facebook.com/simplifiedhq/","https://twitter.com/sosimplified","https://www.linkedin.com/company/simplifiedhq","https://www.tiktok.com/@simplified.ai","https://www.youtube.com/@simplified_ai_writer","https://www.pinterest.com/simplifiedhq/"],address:{"@type":"PostalAddress",addressCountry:"US",addressRegion:"CA",addressLocality:"COVINA",streetAddress:"440 N BARRANCA AVE #9646",postalCode:"91723"},areaServed:["United States","Canada","New Zealand","Ireland","United Kingdom","Australia","Japan","South Africa","Spain","Austria","Netherland","India","France","Germany","Switzerland","Portugal","Malaysia","South Korea","Indonesia","Italy","Turkey","Poland","Saudi Arabia","United Arab Emirates","Qatar","Oman","Bahrain","Bangladesh","Singapore","China","Taiwan","Sweden","Finland","Denmark","Netherland","Norway","Brazil","Columbia","Mexico"],email:"[email protected]",founder:["Koustubha Deshpande","Ajay Yadav "],foundingLocation:"San Francisco Bay Area, California, United States",foundingDate:"2020-10-19",contactPoint:{"@type":"ContactPoint",telephone:" +1 510-969-9646",contactType:"customer service",areaServed:["US","CA","AU","UK","NZ","IN","IE"]}},l={"@context":"https://schema.org","@type":"Organization",name:"Simplified",url:"https://simplified.com",legalName:"TLDR Technologies,Inc. (DBA, Simplified)",logo:"https://lp.simplified.com/siteimages/all/simplified-logo.svg",sameAs:["https://www.instagram.com/simplifiedhq/","https://www.facebook.com/sosimplified/","https://www.linkedin.com/company/sosimplified/","https://www.tiktok.com/@simplifiedhq/","https://twitter.com/sosimplified/","https://www.youtube.com/c/sosimplified"],areaServed:["United States","Canada","Mexico","United Kingdom","Germany","France","Italy","Spain","Netherlands","Belgium","Switzerland","Austria","Denmark","Sweden","Norway","Finland","Ireland","Australia","New Zealand","Japan","South Korea","China","India","Brazil","Argentina","Chile","Colombia","Peru","South Africa","Saudi Arabia","United Arab Emirates","Egypt","Israel","Turkey","Russia","Singapore","Malaysia","Indonesia","Thailand","Vietnam","Philippines","Hong Kong","Taiwan","Portugal","Greece","Poland","Hungary","Czech Republic","Romania","Bulgaria","Croatia","Slovenia","Slovakia","Lithuania","Latvia","Estonia","Ukraine","Belarus","Kazakhstan","Uzbekistan","Pakistan","Bangladesh","Sri Lanka","Myanmar","Nepal","Maldives","Qatar","Bahrain","Kuwait","Oman","Jordan","Lebanon","Morocco","Tunisia","Algeria","Kenya","Nigeria","Ghana","Uganda","Tanzania","Afghanistan","Albania","Algeria","Andorra","Angola","Antigua and Barbuda","Armenia","Azerbaijan","Bahamas","Barbados","Belarus","Belize","Benin","Bhutan","Bolivia","Bosnia and Herzegovina","Botswana","Brunei","Bulgaria","Burkina Faso","Burundi","Cambodia","Cameroon","Cape Verde","Central African Republic","Chad","Comoros","Congo, Democratic Republic of the","Congo, Republic of the","Costa Rica","Croatia","Cuba","Cyprus","Czech Republic","Djibouti","Dominica","Dominican Republic","Ecuador","El Salvador","Equatorial Guinea","Eritrea","Eswatini","Ethiopia","Fiji","Gabon","Gambia","Georgia","Ghana","Greece","Grenada","Guatemala","Guinea","Guinea-Bissau","Guyana","Haiti","Honduras","Hungary","Iceland","Iran","Iraq","Jamaica","Jordan","Kazakhstan","Kenya","Kiribati","Korea, North","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Lesotho","Liberia","Libya","Liechtenstein","Lithuania","Luxembourg","Madagascar","Malawi","Maldives","Mali","Malta","Marshall Islands","Mauritania","Mauritius","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Morocco","Mozambique","Myanmar","Namibia","Nauru","Nepal","Nicaragua","Niger","Nigeria","North Macedonia","Norway","Oman","Pakistan","Palau","Panama","Papua New Guinea","Paraguay","Poland","Portugal","Qatar","Romania","Rwanda","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","Samoa","San Marino","Sao Tome and Principe","Senegal","Serbia","Seychelles","Sierra Leone","Singapore","Slovakia","Slovenia","Solomon Islands","Somalia","South Sudan","Sri Lanka","Sudan","Suriname","Syria","Tajikistan","Tanzania","Timor-Leste","Togo","Tonga","Trinidad and Tobago","Tunisia","Turkmenistan","Tuvalu","Uganda","Ukraine","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Yemen","Zambia","Zimbabwe"],email:"[email protected]",founder:[{"@type":"Person",name:"Koustubha Deshpande",sameAs:"https://www.linkedin.com/in/koustubhadeshpande/",email:"[email protected]",jobTitle:"Founder of Simplified",address:{"@type":"PostalAddress",addressCountry:"US",addressRegion:"CA",addressLocality:"Covina",streetAddress:"440 N Barranca Ave #9646",postalCode:"91723"}},{"@type":"Person",name:"Ajay Yadav",sameAs:"https://www.linkedin.com/in/yadavajay/",email:"[email protected]",jobTitle:"Co-Founder of Simplified",address:{"@type":"PostalAddress",addressCountry:"US",addressRegion:"CA",addressLocality:"Covina",streetAddress:"440 N Barranca Ave #9646",postalCode:"91723"}}],foundingLocation:"San Francisco Bay Area, California, United States",foundingDate:"2020-10-19",address:{"@type":"PostalAddress",addressCountry:"US",addressRegion:"CA",addressLocality:"Covina",streetAddress:"440 N Barranca Ave #9646",postalCode:"91723"}
1,taxId:"85-3663807",duns:"118556846",contactPoint:{"@type":"ContactPoint",telephone:"+1 510-969-9646",contactType:"customer service",areaServed:["US","CA","MX","GB","DE","FR","IT","ES","NL","BE","CH","AT","DK","SE","NO","FI","IE","AU","NZ","JP","KR","CN","IN","BR","AR","CL","CO","PE","ZA","SA","AE","EG","IL","TR","RU","SG","MY","ID","TH","VN","PH","HK","TW","PT","GR","PL","HU","CZ","RO","BG","HR","SI","SK","LT","LV","EE","UA","BY","KZ","UZ","PK","BD","LK","MM","NP","MV","QA","BH","KW","OM","JO","LB","MA","TN","DZ","KE","NG","GH","UG","TZ","AF","AL","AD","AO","AG","AM","AZ","BS","BB","BZ","BJ","BT","BO","BA","BW","BN","BF","BI","KH","CM","CV","CF","TD","KM","CD","CG","CR","CU","CY","DJ","DM","DO","EC","SV","GQ","ER","SZ","ET","FJ","GA","GM","GE","GD","GT","GN","GW","GY","HT","HN","IS","IR","IQ","JM","KI","KP","XK","KG","LA","LS","LR","LY","LI","LU","MG","MW","ML","MT","MH","MR","MU","FM","MD","MC","MN","ME","MZ","NA","NR","NI","NE","MK","PW","PA","PG","PY","RW","KN","LC","VC","WS","SM","ST","SN","RS","SC","SL","SB","SO","SS","SD","SR","SY","TJ","TL","TG","TO","TT","TM","TV","UY","VU","VA","VE","YE","ZM"]}};var c=i(228993);const d=e=>{var t,i,d,u,h;let{pageSEOResData:p,asPath:g}=e;const m=(0,a.find)(null===p||void 0===p?void 0:p.seo,{type:"SEO"}),v=(0,a.find)(null===p||void 0===p?void 0:p.content,{type:"Hero"}),[C,f]=(0,n.useState)(!1),E=`https://simplified.com${g}`,{title:x="Simplified: An Easy to Use All-In-One App For Modern Marketing Teams",description:T="Simplified is the time saving, all in one app that your modern marketing team can use for collaboration. Millions of free images, videos, and audio clips. Thousands of designer templates. Long and short-form content writing in 30+ languages. Content Calendar to schedule and publish posts to social media. Free Forever!",og_image_url:_="https://assets.simplified.co/images/default-design-og.png",og_video_url:S="",keywords:b=""}=(null===m||void 0===m?void 0:m.value)||{};(0,n.useEffect)(()=>{const e=window.location.host;return e&&!o.ALLOWED_HOST_TO_INDEX_TEMPLATE_PAGES.includes(e)&&f(!0),()=>{}},[]);const w=E.includes(o.VIDEO_EDITOR_ROOT_LP)?o.VIDEO_EDITOR_ROOT_LP:g.includes(o.GRAPHIC_DESIGN_ROOT_LP)?o.GRAPHIC_DESIGN_ROOT_LP:null,R=[{"@type":"ListItem",position:1,item:{"@id":"https://simplified.com",name:"Homepage"}},{"@type":"ListItem",position:2,item:{"@id":`https://simplified.com${w}`,name:`Simplified ${E.includes(o.VIDEO_EDITOR_ROOT_LP)?"Video Editor":g.includes(o.GRAPHIC_DESIGN_ROOT_LP)?"Graphic Design":null}`}},{"@type":"ListItem",position:3,item:{"@id":`https://simplified.com${w}/tools`,name:"Simplified AI magic tools"}},{"@type":"ListItem",position:4,item:{"@id":E,name:(null===p||void 0===p?void 0:p.title)||"AI magic tools"}}];let k=!0;C&&(k=!1);const y=k?"index,follow":"noindex,nofollow";return(0,c.jsx)(c.Fragment,{children:(0,c.jsxs)(r.q,{children:[(0,c.jsx)("title",{children:x}),(0,c.jsx)("meta",{name:"description",content:T}),(0,c.jsx)("meta",{name:"robots",content:y}),(0,c.jsx)("link",{rel:"canonical",href:E}),(0,c.jsx)("meta",{property:"og:type",content:"website"}),(0,c.jsx)("meta",{property:"og:url",content:E}),(0,c.jsx)("meta",{property:"og:title",content:x}),(0,c.jsx)("meta",{property:"og:description",content:T}),(0,c.jsx)("meta",{property:"og:image",content:_}),(0,c.jsx)("meta",{property:"og:image:alt",content:x}),(0,c.jsx)("meta",{name:"keywords",content:b}),(0,c.jsx)("script",{type:"application/ld+json",children:`\n            {\n              "@context": "https://schema.org",\n              "@type": "Product",\n              "url": "${E}",\n              "name": "${null===v||void 0===v||null===(t=v.value)||void 0===t?void 0:t.title}",\n              "description": "${null===v||void 0===v||null===(i=v.value)||void 0===i?void 0:i.description}",\n              "image": ["${_}"],\n              "brand": \n                ${JSON.stringify(s)}\n              ,\n              "offers": {\n                "@type": "AggregateOffer",\n                "offerCount": 4,\n                "lowPrice": "0.00",\n                "highPrice": "15.00",\n                "priceCurrency": "USD",\n                "availability": "https://schema.org/InStock",\n                "url": "${E||o.AI_IMAGES_URL_ENDPOINT}",\n                "description": "${null===v||void 0===v||null===(d=v.value)||void 0===d?void 0:d.title} ${null===v||void 0===v||null===(u=v.value)||void 0===u?void 0:u.description}",\n                "seller": {\n                  "@type": "Organization",\n                  "name": "Simplified"\n                }\n              }\n            }\n          `}),(0,c.jsx)("script",{type:"application/ld+json",children:`\n            {\n              "@context": "https://schema.org",\n              "@type": "WebPage",\n              "url": "${E}",\n              "name": "${x}",\n              "headline": "${x}",\n              "description": "${null===v||void 0===v||null===(h=v.value)||void 0===h?void 0:h.description}",\n              "inLanguage": "en",\n              "keywords": "${b.split(",")}",\n              "publisher":  ${JSON.stringify(l)},\n              "breadcrumb": {\n                "@type": "BreadcrumbList",\n                "itemListElement": ${JSON.stringify(R)}\n              }\n            }\n          `})]})})}},356675:(e,t,i)=>{i.d(t,{Z:()=>T});var o=i(683017),a=i(764293),n=i(408499),r=i(783786),s=i(351839),l=i(741065),c=i(773414),d=i(553218),u=i(349798),h=i(841176),p=i(90583),g=i(104399),m=i(318885),v=i(293538),C=i(465521),f=i(839292),E=i(659840),x=i(228993);const T=(0,a.$j)(e=>({appPermissionChecks:e.permissions.appPermissionChecks}),e=>({}))(e=>
1{let{title:t,iconBackground:i,icon:T,children:_,position:S="sticky",showBackButton:b=!1,fromPath:w,setFromPath:R,showQuickToolQuota:k}=e;const{t:y}=(0,n.$)(["tools","common","billing","addons","navbar"]),j=(0,E.k6)(),A=(0,a.I0)(),P=(0,a.v9)(e=>{var t,i;return null===(t=e.auth)||void 0===t||null===(i=t.payload)||void 0===i?void 0:i.user}),I=(0,a.v9)(e=>e.auth.isAuthenticated),L=(0,o.useCallback)(()=>{j.push(h.ym,{from:j.location})},[j]),F=(0,o.useCallback)(e=>{A((0,r.z1)(e))},[A]),O=(0,o.useCallback)(()=>{j.push(h.Wb,{from:j.location})},[j]),B=(0,o.useCallback)(()=>{j.push(h.AL)},[j]);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(v.q,{children:(0,x.jsxs)("title",{children:[t," ",y("tab_titles.magic_tools",{ns:"common"})]})}),(0,x.jsxs)(s.k,{position:S,top:"0",zIndex:"105",alignItems:"center",justifyContent:"space-between",paddingY:2,paddingX:4,bgColor:"base_level_3",w:"full",h:g.DEFAULT_NAVBAR_HEIGHT,children:[(0,x.jsxs)(s.k,{alignItems:"center",children:[b&&(0,x.jsx)(p.xEo,{onClick:()=>{const e=(0,f._A)(j.location.search),t=(0,f.uI)(w)?w:null,i=e||t;if(i)return j.push(i),void(null===R||void 0===R||R(null));j.length>1?j.goBack():j.push(h.AL)},mr:4,tooltipLabel:y("go_back",{ns:"common"}),variant:"secondary",fontSize:"sm"}),(0,x.jsx)(s.k,{alignItems:"center",justifyContent:"center",borderRadius:"lg",background:i,color:"white",fontSize:"lg",p:2,children:T}),(0,x.jsx)(l.x,{marginLeft:3,color:"content_inactive",fontSize:["md","md","md","md"],fontWeight:"500",textTransform:"capitalize",children:t})]}),(0,x.jsxs)(s.k,{align:"center",children:[_,(0,x.jsxs)(c.h,{spacing:3,size:"sm",alignItems:"center",children:[!b&&(0,x.jsx)(p.OZY,{variant:"ghost",user:P,translations:{light:y("theme.light",{ns:"navbar"}),dark:y("theme.dark",{ns:"navbar"}),auto:y("theme.auto",{ns:"navbar"}),switchTheme:y("theme.switch_theme",{ns:"navbar"})},onThemeChange:F}),I?b?(0,x.jsxs)(d.U,{mr:2,children:[k&&(0,x.jsx)(C.Z,{}),(0,x.jsx)(m.Z,{})]}):(0,x.jsx)(u.z,{onClick:B,children:y("to_dashboard")}):(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(u.z,{onClick:L,children:y("sign_in")}),(0,x.jsx)(u.z,{variant:"solid",onClick:O,children:y("sign_up")})]})]})]})]})]})})},730843:(e,t,i)=>{i.d(t,{Du:()=>n,Hi:()=>h,K$:()=>c,Ss:()=>a,UW:()=>l,Vy:()=>r,XV:()=>s,_3:()=>u,si:()=>p,xN:()=>d});var o=i(957392);const a={start:"start",customize:"customize",customize_advance:"customize_advance",result:"result"},n={color:"color",gradient:"gradient",image:"image"},r=["#F5A623","#F8E71C","#8B572A","#7ED321","#417505","#BD10E0","#9013FE","#4A90E2","#50E3C2","#B8E986","#000000","#4A4A4A","#9B9B9B","#FFFFFF"],s=["linear-gradient(135deg, #7928ca, #ff0080)","linear-gradient(135deg, #fec206, #ff62a7)","linear-gradient(135deg, #667eea, #764ba2)","linear-gradient(120deg, #f6d365, #fda085)","linear-gradient(120deg, #e0c3fc, #8ec5fc)","linear-gradient(90deg, #4facfe, #00f2fe)","linear-gradient(90deg, #ffecd2, #fcb69f)","linear-gradient(120deg, #a1c4fd, #c2e9fb)","linear-gradient(135deg, #f5f7fa, #c3cfe2)","linear-gradient(180deg, #fddb92, #d1fdff)","linear-gradient(180deg, #fad0c4, #ffd1ff)","linear-gradient(180deg, #a8edea, #fed6e3)","linear-gradient(180deg, #ff9a9e 0%, #fecfef 99%, #fecfef 100%)","linear-gradient(180deg, #30cfd0, #330867)","linear-gradient(180deg, #fbc2eb, #a6c1ee)","linear-gradient(120deg, #fccb90, #d57eeb)","linear-gradient(90deg, #ff8177 0%, #ff8c7f 21%, #f99185 52%, #b12a5b 100%)","linear-gradient(180deg, #fdcbf1 0%, #fdcbf1 10%, #e6dee9 100%)","linear-gradient(120deg, #f093fb, #f5576c)","linear-gradient(90deg, #fa709a, #fee140)","linear-gradient(90deg, #43e97b, #38f9d7)","linear-gradient(180deg, #cfd9df, #e2ebf0)","linear-gradient(135deg, #fdfcfb, #e2d1c3)","linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%)","linear-gradient(120deg, #84fab0, #8fd3f4)","linear-gradient(180deg, #a18cd1, #fbc2eb)","linear-gradient(180deg, #9890e3, #b1f4cf)","linear-gradient(120deg, #d4fc79, #96e6a1)","linear-gradient(120deg, #a6c0fe, #f68084)","linear-gradient(135deg, #fec206 2.24%, #59c3ff 50.72%, #ff62a7 96.25%)"],l={dark:"dark",light:"light"},c={[l.dark]:{background:"#1E1E1E",color:"#fff",messageLinkColor:"#1da1f2"},[l.light]:{background:"#fff",color:"#000",messageLinkColor:"#1da1f2"}},d=[{id:"1",card:{themeColor:l.dark,cornerRadius:1,shadow:1,width:1.3,scale:1.2},background:{type:n.gradient,value:"linear-gradient(135deg, #fec206, #ff62a7)"}},{id:"2",card:{themeColor:l.light,cornerRadius:1,shadow:1,width:1.3,scale:1.2},background:{type:n.gradient,value:"linear-gradient(135deg, #fec206, #ff62a7)"}}],u={themeColor:l.dark,cornerRadius:1,shadow:1,width:1.3,scale:1.2},h={type:n.gradient,value:"linear-gradient(135deg, #fec206, #ff62a7)"},p={name:"Simplified",nickname:"@sosimplified",avatarUrl:"https://tldrprod.s3.amazonaws.com/usetldr/111399/planner/accounts/287.jpg",message:"We just surpassed 1,000,000 registered users on Simplified\ud83c\udf89  Thank y
1ou for your support!! \u2764\ufe0f\n\n\ud83d\udc49 Let us know in the comments what your favorite part of Simplified is! https://t.co/Q8GgvM7m3E",provider:o.TWITTER,tweetUrl:"https://twitter.com/sosimplified/status/1527046408313790464"}},399731:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Nt});var o=i(356675),a=i(778145),n=i(692877),r=i(270858),s=i(828865),l=i(11254),c=i(351839),d=i(179822),u=i(135201),h=i(683017),p=i(408499),g=i(764293),m=i(444974),v=i(203517),C=i(24455),f=i(379274),E=i(104399),x=i(494965),T=i(241604),_=i(868413),S=i(239839),b=i(804843);const w=i.p+"static/media/transparentBg.52ea1e4953acc8461316.png";var R=i(926592),k=i(727333),y=i(631481),j=i(422937);const{floor:A,min:P}=Math;class I extends b.Z{constructor(e){var t;super(e),t=this,this.initialize=e=>{const{canvas:t}=this,{imageJSON:i}=e;v.fabric.Image.fromURL(i.src,async o=>{const a=P(t.width/o.width,t.height/o.height),n=A(o.width*a),r=A(o.height*a);o.set({...i,angle:0,scaleX:a,scaleY:a,selectable:!0,erasable:!0,hoverCursor:"grab",width:o.width,height:o.height,filters:[],originalSrc:i.src,...i.cropX&&{cropX:0},...i.cropY&&{cropY:0},...i.cropWidth&&{cropWidth:0},...i.cropHeight&&{cropHeight:0}}),i.eraser&&v.fabric.Eraser.fromObject(i.eraser,e=>{o.set({eraser:e})}),t.freeDrawingBrush=new v.fabric.EraserBrush(t),t.freeDrawingBrush.width=10,t.freeDrawingCursor="none",t.selection=!1,t.backgroundColor="transparent",this.workareaHandler.changeSize(n,r),t.add(o);const s=new v.fabric.StaticCanvas("cursor",{width:t.width,height:t.height}),l=new v.fabric.Circle(S.Ws);s.add(l),s.renderAll(),s.centerObject(l),t.centerObject(o),t.centerObject(this.workarea),t.clipPath=new v.fabric.Rect({width:this.workarea.width,height:this.workarea.height,top:this.workarea.top,left:this.workarea.left}),t.renderAll(),this.editPhotoHoverCircle=l,this.editPhotoStaticCanvas=s,this.activeEditPhotoImage=o,this.staticCanvas=s,!e.isSmallScreen&&this.interactionHandler.grab(),this.zoomHandler.zoomToFit(),this.setReloadHash(Date.now()),await this.workareaHandler.setImagePattern(this.workarea,{src:w,repeat:"repeat"},!1),e.existingTool?(this.activeQuickTool=e.existingTool,e.onClickTool&&await e.onClickTool(e.existingTool.type,!1)):Array.isArray(this.editPhotoStack)&&this.editPhotoStack.push(t.toJSON(S.aU)),e.onInitialized&&await e.onInitialized()},{crossOrigin:"anonymous"})},this.updateHistory=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{canvas:i,activeTool:o,generativeFillResults:a,magicRemoveResults:n,magicExpandResults:r}=t;t.editPhotoStack.push(i.toJSON(S.aU)),e?(t.activeToolStack.push(o),t.generativeFillResultsStack.push(a),t.magicRemoveResultsStack.push(n),t.magicExpandResultsStack.push(r),t.editPhotoStep+=1):t.activeToolStack[0]=o,t.isHaveSelection=[E.EditPhotoToolTypes.MAGIC,E.EditPhotoToolTypes.GENERATIVE_FILL].includes(o)&&!!i.getObjects().find(e=>e.type===R.$Mu),t.setReloadHash(Date.now())},this.changeDrawingMode=e=>{const{canvas:t,activeTool:i}=this;t.isDrawingMode=e;const o=t.freeDrawingBrush.width;t.freeDrawingBrush=i===E.EditPhotoToolTypes.ERASER?new v.fabric.EraserBrush(t):new v.fabric.PencilBrush(t),t.freeDrawingBrush.color=[E.EditPhotoToolTypes.MAGIC,E.EditPhotoToolTypes.GENERATIVE_FILL].includes(i)?"rgba(255, 173, 0, 0.5)":"",t.freeDrawingBrush.width=o},this.openAutoFocusTool=async()=>{if(await this.onClickRemoveBackground(!0,!0,!1,E.EditPhotoToolTypes.AUTO_FOCUS,!1),!this.removeBackgroundResults.length)return;(await this.addBgRemovedImage()).visible=!0,this.activeEditPhotoImage.filters.length||(this.activeEditPhotoImage.set({filters:[new v.fabric.Image.filters.Blur({blur:.5})]}),this.activeEditPhotoImage.applyFilters()),this.canvas.renderAll(),this.activeTool=E.EditPhotoToolTypes.AUTO_FOCUS,this.changeDrawingMode(!1)},this.openReplaceBackgroundOrFlairTool=async e=>{if(await this.onClickRemoveBackground(!0,!0,!0,e,!1),!this.removeBackgroundResults.length)return;this.activeTool=e,this.changeDrawingMode(!1);var t,i,o;e===E.EditPhotoToolTypes.FLAIR?(this.interactionHandler.selection(),this.activeEditPhotoImage.set({...S.m_,selectable:!0}),this.activeEditPhotoImage.setControlsVisibility(R.$HO),this.canvas.setActiveObject(this.activeEditPhotoImage)):((0,y.WI)((0,j.EI)(E.IMAGES_SLIDER_PANEL)),null!==(t=this.workarea)&&void 0!==t&&null!==(i=t.fill)&&void 0!==i&&null!==(o=i.src)&&void 0!==o&&o.includes("transparent")&&this.workareaHandler.setBackgroun
1d(this.workarea,null,"#F5A623",null))},this.changeActiveTool=async function(e){let i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!t.activeEditPhotoImage||!t.canvas)return;const{canvas:o,activeEditPhotoImage:a}=t,n=E.EditPhotoToolTypes;if(t.activeTool=e,!e)return t.generativeFillResults=[],t.magicRemoveResults=[],t.magicExpandResults=[],t.removePaths(),void t.interactionHandler.grab();const r=new Set([n.REPLACE_BACKGROUND,n.FLAIR]);new Set([n.BACKGROUND_REMOVER,n.MAGIC_EXPAND]).has(e)||t.changeDrawingMode(!0),r.has(e)?await t.openReplaceBackgroundOrFlairTool(e):e===n.AUTO_FOCUS?await t.openAutoFocusTool():e===n.GENERATIVE_FILL?a.generativeFillMask="":e===n.MAGIC_EXPAND&&(t.interactionHandler.selection(),t.activeEditPhotoImage.set({...S.m_,selectable:!0}),t.activeEditPhotoImage.setControlsVisibility(R.$HO),t.canvas.setActiveObject(t.activeEditPhotoImage)),t.updateHistory(i)},this.centerEditPhotoCursor=()=>{const{editPhotoStaticCanvas:e,editPhotoHoverCircle:t}=this;e.centerObject(t)},this.changeBrushSize=e=>{const{canvas:t,editPhotoStaticCanvas:i,editPhotoHoverCircle:o}=this;o.set({...!o.visible&&{visible:!0},radius:e/2}),t.freeDrawingBrush.width=e,this.centerEditPhotoCursor(),i.renderAll()},this.changeBlurAmount=e=>{var t;const{canvas:i,activeEditPhotoImage:o}=this;null!==(t=o.filters)&&void 0!==t&&t.length&&(o.filters[0].blur=e/100,o.applyFilters(),i.renderAll())},this.toggleVisibilityEditPhotoCursor=()=>{const{editPhotoStaticCanvas:e,editPhotoHoverCircle:t}=this;t.set({visible:!t.visible}),e.renderAll()},this.onPathCreated=()=>{this.updateHistory()},this.updateEditPhotoWorkArea=async()=>{var e,t;const[i,o,a]=this.canvas.getObjects();this.workarea=i,this.activeEditPhotoImage=o,a&&(this.bgRemovedImage=a),null!==(e=i.fill)&&void 0!==e&&null!==(t=e.src)&&void 0!==t&&t.includes("transparent")&&await this.workareaHandler.setImagePattern(this.workarea,{src:w,repeat:"repeat"},!1)},this.loadEditPhotoCanvasFromJSON=e=>{const{canvas:t,activeTool:i,setReloadHash:o}=this;t.loadFromJSON(e,async()=>{this.isHaveSelection=[E.EditPhotoToolTypes.MAGIC,E.EditPhotoToolTypes.GENERATIVE_FILL].includes(i)&&!!t.getObjects().find(e=>e.type===R.$Mu),await this.updateEditPhotoWorkArea(),t.renderAll(),o(Date.now())})},this.setEditPhotoFromStack=()=>{const{editPhotoStack:e,editPhotoStep:t}=this;this.activeTool=this.activeToolStack[t],this.generativeFillResults=this.generativeFillResultsStack[t],this.magicRemoveResults=this.magicRemoveResultsStack[t],this.magicExpandResults=this.magicExpandResultsStack[t],this.changeDrawingMode(!!this.activeTool&&![E.EditPhotoToolTypes.AUTO_FOCUS,E.EditPhotoToolTypes.REPLACE_BACKGROUND].includes(this.activeTool)),this.loadEditPhotoCanvasFromJSON(e[t])},this.undoEditPhoto=()=>{this.editPhotoStep-=1,this.setEditPhotoFromStack()},this.redoEditPhoto=()=>{this.editPhotoStep+=1,this.setEditPhotoFromStack()},this.removePaths=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];const{canvas:i}=t;i.getObjects().filter(e=>e.type===R.$Mu).forEach(e=>i.remove(e)),e&&t.updateHistory()},this.changeSrc=async function(e,i){let o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const{activeEditPhotoImage:n,canvas:r}=t;if(await(0,k.Oz)(n,e,a),!a){const e=A(n.width*n.scaleX),i=A(n.height*n.scaleY);t.workareaHandler.changeSize(e,i),r.centerObject(n),r.centerObject(t.workarea)}i&&(n.eraser=null),t.activeTool===E.EditPhotoToolTypes.MAGIC_EXPAND&&(t.interactionHandler.selection(),t.activeEditPhotoImage.set({...S.m_,selectable:!0}),t.activeEditPhotoImage.setControlsVisibility(R.$HO),t.canvas.setActiveObject(t.activeEditPhotoImage)),t.removePaths(o),r.renderAll()},this.reset=()=>{this.editPhotoStep=0,this.editPhotoStack=[this.editPhotoStack[0]],this.activeToolStack=[this.activeToolStack[0]],this.setEditPhotoFromStack()},this.createMask=()=>{const{canvas:e,activeTool:t,activeEditPhotoImage:i,workarea:o}=this,a=e.getObjects().filter(e=>e.type===R.$Mu);if(![E.EditPhotoToolTypes.MAGIC,E.EditPhotoToolTypes.GENERATIVE_FILL].includes(t)||!a.length)return;const n=a.map(e=>v.fabric.util.object.clone(e));
1n.forEach(e=>{e.set({stroke:"rgba(0, 0, 0, 1)",prevLeft:e.left-this.workarea.left,prevTop:e.top-this.workarea.top})});const r=new v.fabric.Group(n,{left:o.left,top:o.top,width:i.width,height:i.height,scaleX:i.scaleX,scaleY:i.scaleY});r.forEachObject(e=>{e.set({left:-r.width/2+e.prevLeft/r.scaleX,top:-r.height/2+e.prevTop/r.scaleY,scaleX:1/r.scaleX,scaleY:1/r.scaleY})}),r.scale(1);const s=r.toDataURL();return"data:,"!==s?s:void 0},this.addBgRemovedImage=async()=>{const{canvas:e,activeEditPhotoImage:t,removeBackgroundResults:i}=this;if(!i.length)return;const o=i.find(e=>e===t.src)||i[0];return new Promise(i=>{v.fabric.Image.fromURL(o,a=>{a.set({...t.toJSON(S.aU),src:o,visible:!1}),e.add(a),this.bgRemovedImage=a,this.setReloadHash(Date.now()),i(a)},{crossOrigin:"anonymous"})})},this.getEditPhotoCanvasAsDataURL=()=>{const{canvas:e,activeEditPhotoImage:t}=this;return new v.fabric.Group(e.getObjects()).toDataURL({multiplier:1/t.scaleX,format:"jpg"}).replace(/^data:image\/(png|jpg);base64,/,"")},this.createMagicExpandMask=()=>{const{canvas:e,activeEditPhotoImage:t}=this,i=new v.fabric.Group(e.getObjects()),o=v.fabric.util.object.clone(i);return o.getObjects().forEach((e,t)=>{e.type===E.FABRIC_IMAGE_ELEMENT&&o.add(new v.fabric.Rect({...e,type:"rect",fill:"rgb(0, 0, 0, 1)",backgroundColor:"rgb(0, 0, 0, 1)"}))}),o.toDataURL({format:"jpg",multiplier:1/t.scaleX}).replace(/^data:image\/(png|jpg);base64,/,"")},this.initialOption=e,this.handlerName="EditPhotoHandler",this.activeTool="",this.isHaveSelection=!1,this.editPhotoStack=[],this.activeToolStack=[""],this.generativeFillResults=[],this.generativeFillResultsStack=[[]],this.magicRemoveResults=[],this.magicRemoveResultsStack=[[]],this.magicExpandResults=[],this.magicExpandResultsStack=[[]],this.removeBackgroundResults=[],this.editPhotoStep=0,this.setReloadHash=e.setReloadHash,this.onClickRemoveBackground=e.onClickRemoveBackground,this.initialize(e),this.canvas.on({"path:created":this.onPathCreated})}}var L=i(789333),F=i.n(L),O=i(480050),B=i.n(O),M=i(313773),D=i(919941),N=i(90583),G=i(501271),H=i(664991),z=i(298249),U=i(741065),V=i(773414),K=i(878818),Z=i(349798),W=i(902352),$=i(39821),X=i(170882),J=i(366354),Y=i(412997),Q=i(228993);const q=e=>{let{handlerRef:t,onClickStartOver:i,onClickFinishEditPhoto:o,onClickCancelEditPhoto:n,onClickBack:l,activeTool:d,isSmallScreen:u}=e;const{t:h}=(0,p.$)(["common","tools"]),g=t.current.activeQuickTool;return(0,Q.jsxs)(c.k,{height:E.DEFAULT_NAVBAR_HEIGHT,width:"full",alignItems:"center",justifyContent:"space-between",paddingY:2,paddingX:4,backgroundColor:"base_level_3",boxShadow:"md",children:[(0,Q.jsxs)(c.k,{align:"center",w:"full",children:[(0,Q.jsx)(c.k,{alignItems:"center",justifyContent:"center",width:8,height:8,borderRadius:"sm",background:u?"transparent":"common.red_berry",color:"white",fontSize:"lg",onClick:()=>{u&&(d?l():n())},children:u?(0,Q.jsx)(a.FaChevronLeft,{}):g?(0,Q.jsx)(g.PageNavIcon,{}):(0,Q.jsx)(z.J,{as:Y.T$Z})}),!u&&(0,Q.jsx)(U.x,{marginLeft:3,color:"content_inactive",fontWeight:"bold",children:h("edit_photo",{ns:"tools"})}),(0,Q.jsxs)(V.h,{size:"sm",isAttached:!0,marginLeft:3,children:[(0,Q.jsx)(K.u,{hasArrow:!0,placement:"bottom",label:h("undo",{ns:"common"}),children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaUndo,{}),size:"sm",fontSize:"lg",mr:1,onClick:t.current.undoEditPhoto,disabled:0===t.current.editPhotoStep,...u&&{bg:"transparent",_disabled:{bg:"transparent",opacity:.5},_hover:{bg:"transparent"},_active:{bg:"transparent"}}})}),(0,Q.jsx)(K.u,{hasArrow:!0,placement:"bottom",label:h("redo",{ns:"common"}),children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaRedo,{}),size:"sm",fontSize:"lg",onClick:t.current.redoEditPhoto,disabled:t.current.editPhotoStep===t.current.editPhotoStack.length-1,...u&&{bg:"transparent",_disabled:{bg:"transparent",opacity:.5},_hover:{bg:"transparent"},_active:{bg:"transparent"}}})})]}),!u&&(0,Q.jsx)(Z.z,{size:"sm",ml:"auto",leftIcon:(0,Q.jsx)(a.FaSyncAlt,{}),onClick:i,disabled:0===t.current.editPhotoStep,children:h("start_over",{ns:"tools"})})]}),u?(0,Q.jsxs)(c.k,{children:[(0,Q.jsx)(Z.z,{size:"sm",leftIcon:(0,Q.jsx)(a.FaCheck,{}),onClick:o,variant:"outlined",children:h("finish")}),(0,Q.jsxs)($.v,{children:[(0,Q.jsx)(X.j,{as:s.h,icon:(0,Q.jsx)(a.FaEllipsisV,{}),size:"sm",bgColor:"transparent",_hover:{bgColor:"transparent"},_active:{bgColor:"transparent"},_focus:{bgColor:"none"}}),(0,Q.jsxs)(J.q,{as:c.k,direction:"column",alignItems:"flex-start",width:"fit-content",minWidth:"fit-content",bgColor:"base_level_2",children:[(0,Q.jsx)(Z.z,{size:"sm",leftIcon:(0,Q.jsx)(a.FaSyncAlt,{}),onClick:i,variant:"outlined",disabled:0===t.current.editPhotoStep,children:h("start_over",{ns:"tools"})}),(0,Q.jsx)(Z.z,{size:"sm",leftIcon:(0,Q.jsx)(a.FaTimes,{}),onClick:n,variant:"outlined",children:h("cancel")})]})]})]}):(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(W.i,{my:4,mx:4,orientation:"vertical"}),(0,Q.jsx)(r.x,{children:(0,Q.jsxs)(V.h,{size:"sm",children:[(0,Q.jsx)(Z.z,{size:"sm",onClick:n,children:h("cancel",{ns:"common"})}),(0,Q.jsx)(Z.z,{size:"sm",leftIcon:(0,Q.jsx)(a.FaCheck,{}),onClick:o,colorScheme:"primary",variant:"solid",children:h("finish")})]})})]})]})};var ee=i(769761),te=i(776839),ie=i(889223),oe=i(855143);const ae=e=>{let{handlerRef:t,zoomValue:i}=e;const{t:o}=(0,p.$)(["studio"]),n=(0,h.useMemo)(()=>parseInt((100*i).toFixed(2),10),[i]);return(0,Q.jsxs)(r.x,{width:"100%",height:"40px",backgroundColor:"base_level_3",display:"flex",alignItems:"center",justifyContent:"flex-end",children:[(0,Q.jsx)(W.i,{orientation:"vertical",mx:1}),(0,Q.jsxs)(V.h,{isAttached:!0,children:[(0,Q.jsx)(K.u,{placement:"top",hasArrow:!0,label:o("zoom_out"),children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaSearchMinus,{}),size:"sm",variant:"ghost",onClick:()=>t.current.zoomHandler.zoomOut()})}),(0,Q.jsxs)($.v,{placement:"top-end",isLazy:!0,children:[(0,Q.jsx)(K.u,{hasArrow:!0,placement:"top",label:o("zoom_percentage"),children:(0,Q.jsx)(X.j,{as:Z.z,variant:"ghost",size:"sm",children:`${n}%`})}),(0,Q.jsx)(J.q,{minW:"100px",children:(0,Q.jsx)(ee._,{type:"radio",children:oe.T.map(e=>(0,Q.jsx)(h.Fragment,{children:null===e.value?(0,Q.jsx)(te.R,{}):(0,Q.jsx)(ie.i,{value:e.label,onClick:()=>{(e=>{const{zoomToFit:i,zoomToFill:o,zoomToPercentage:a}=t.current.zoomHandler;"fit"===e?i():"fill"===e?o():a(e)})(e.value)},children:e.label})},e.value))})})]}),(0,Q.jsx)(K.u,{placement:"top",hasArrow:!0,label:o("zoom_in"),children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaSearchPlus,{}),size:"sm",variant:"ghost",onClick:()=>t.current.zoomHandler.zoomIn()})})]}),(0,Q.jsx)(W.i,{orientation:"vertical",mx:1}),(0,Q.jsx)(K.u,{hasArrow:!0,placement:"top",label:o("fit"),children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaExpand,{}),size:"sm",variant:"ghost",onClick:()=>t.current.zoomHandler.zoomToFit()})})]})};var ne,re,se,le;function ce(){return ce=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},ce.apply(null,arguments)}function de(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",ce({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"
1currentColor",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,ne||(ne=h.createElement("path",{d:"M17.0532 16.5923H7.68374L11.9746 12.4014L6.41706 6.87903L2.03764 11.2388C1.30429 12.0681 1.33382 13.3355 2.12729 14.129L4.52741 16.5923H2.30026C1.91143 16.5923 1.59643 16.9073 1.59643 17.2962C1.59643 17.685 1.91143 18 2.30026 18H17.0532C17.4421 18 17.7571 17.685 17.7571 17.2962C17.7571 16.9073 17.4421 16.5923 17.0532 16.5923Z",fill:"currentColor"})),re||(re=h.createElement("path",{d:"M3.08639 6.98485C3.16374 7.2088 3.48436 7.20423 3.55538 6.97782C3.96319 5.67669 4.83225 4.91942 6.27577 4.43919C6.50077 4.3643 6.50042 4.04473 6.27542 3.9702C4.83436 3.49208 4.00749 2.74677 3.57507 1.40837C3.50089 1.17915 3.1785 1.17774 3.10362 1.40696C2.65749 2.77454 1.85171 3.51106 0.413465 3.97688C0.188113 4.05001 0.185301 4.36887 0.409246 4.44552C1.83202 4.93384 2.63639 5.68407 3.08639 6.9845V6.98485Z",fill:"currentColor"})),se||(se=h.createElement("path",{d:"M9.84232 4.58508C9.81138 4.77493 9.64861 4.91485 9.4563 4.91731C9.4549 4.91731 9.45314 4.91731 9.45173 4.91731C9.26154 4.91731 9.09771 4.78196 9.06255 4.59422C9.04357 4.49227 9.02247 4.3963 8.99962 4.30454L7.76247 5.54169L7.41583 5.88622L12.9818 11.4173L14.0969 10.3279L16.3912 7.98645C17.2526 7.10719 17.2388 5.69672 16.3603 4.83469L13.9535 2.4736C13.4676 1.99688 12.8183 1.78805 12.189 1.84536C12.2438 1.91391 12.2762 2.0004 12.2762 2.09286C12.2762 2.27672 12.1496 2.43633 11.971 2.47817C11.2468 2.64833 10.7831 2.86067 10.4684 3.16618C10.1447 3.48012 9.952 3.91782 9.84302 4.58508H9.84232Z",fill:"currentColor"})),le||(le=h.createElement("path",{d:"M7.34414 2.17863C8.49129 2.51507 9.07313 3.04804 9.36316 4.12874C9.38637 4.21523 9.51012 4.21417 9.53156 4.12734C9.80438 3.02519 10.4045 2.50312 11.5566 2.17652C11.6406 2.15261 11.6406 2.03343 11.5566 2.00917C10.4094 1.68081 9.8093 1.14222 9.53508 0.0657362C9.51293 -0.0214514 9.38918 -0.0218029 9.36668 0.0657362C9.09106 1.12394 8.49024 1.6882 7.34484 2.01199C7.26117 2.03554 7.26047 2.15472 7.34414 2.17898V2.17863Z",fill:"currentColor"})))}const ue=h.forwardRef(de);i.p;var he;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},pe.apply(null,arguments)}function ge(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,he||(he=h.createElement("path",{d:"M18 14.6907V16.5234C18 17.3391 17.3391 18 16.5234 18H14.6542L14.2443 17.3155C14.1525 17.1566 13.9936 17.0483 13.8122 17.0209L13.0054 16.8989C12.4646 16.817 11.9422 16.6437 11.4599 16.3867L9.32484 15.2497C9.00738 15.0845 8.90262 14.6812 9.09949 14.3821C9.31992 14.0474 9.73863 13.9039 10.1176 14.033L12.478 14.8648L9.23098 9.24961C9.01793 8.88117 9.15117 8.40762 9.53016 8.20582C9.89121 8.01352 10.3412 8.1559 10.5458 8.50992L11.8582 10.7796C11.6452 10.4112 11.7784 9.93762 12.1574 9.73582C12.5184 9.54352 12.9684 9.6859 13.173 10.0399L13.3151 10.2857C13.102 9.91723 13.2353 9.44367 13.6143 9.24187C13.9753 9.04957 14.4253 9.19195 14.6299 9.54598L14.772 9.79172C14.5589 9.42328 14.6921 8.94973 15.0711 8.74793C15.4322 8.55562 15.8822 8.69801 16.0868 9.05203L17.2663 11.0918C17.5532 11.5882 17.7318 12.1437 17.7866 12.7146L17.9617 14.4889C17.9684 14.5571 17.981 14.6246 17.9993 14.6904L18 14.6907ZM10.6534 12.8317H1.83305C0.821953 12.8317 0 12.0097 0 10.9986V1.83305C0 0.821953 0.821953 0 1.83305 0H12.8317C13.8428 0 14.6647 0.821953 14.6647 1.83305V8.33977C14.5431 8.42555 14.4376 8.52996 14.3529 8.64914C14.2295 8.61117 14.1001 8.59113 13.9679 8.59113C13.7373 8.59113 13.5098 8.6523 13.3095 8.76832C13.1414 8.8657 13.0029 8.99437 12.8967 9.14344C12.7733 9.10547 12.6432 9.08543 12.5111 9.08543C12.5009 9.08543 12.491 9.08613 12.4808 9.08648C12.4088 8.78273 12.1328 8.50465 11.8216 8.54367C11.7584 8.55176 11.6954 8.56055 11.6325 8.56863C11.7977 8.4498 11.964 8.33203 12.1314 8.21602C12.407 8.02477 12.5402 7.70344 12.4045 7.38176C12.279 7.08434 11.9377 6.89801 11.6167 6.99504C11.0394 7.16977 10.4657 7.35715 9.89613 7.55578C9.89191 7.55578 9.88805 7.55543 9.88383 7.55543C9.79066 7.55543 9.69785 7.56598 9.60715 7.58566C9.6184 7.57688 9.63 7.56809 9.6416 7.5593C9.84797 7.39723 9.87223 7.04848 9.77977 6.82945C9.6859 6.60727 9.42891 6.39 9.16945 6.41883C7.77586 6.57422 6.38824 6.78305 5.01188 7.05059C4.66805 7.11738 4.44023 7.54734 4.54535 7.87219C4.66383 8.23816 4.99887 8.41043 5.36695 8.33871C5.75051 8.26418 6.13512 8.19457 6.52043 8.12883C5.74312 8.66777 4.98094 9.24609 4.34777 9.95308C4.12418 10.2027 4.08586 10.5585 4.29539 10.8302C4.50563 11.1023 4.85543 11.154 5.15707 11.0021C5.70691 10.7255 6.26238 10.4597 6.82348 10.2062C7.10402 10.0796 7.38633 9.9566 7.66898 9.83496C7.70344 9.82055 7.72277 9.81211 7.72805 9.80965C7.75652 9.7977 7.78465 9.78574 7.81313 9.77414C7.87395 9.74883 7.93477 9.72352 7.99594 9.6982C8.13621 9.64055 8.27684 9.58359 8.41746 9.52734C8.3598 9.71191 8.37738 9.92953 8.47441 10.08C8.62488 10.3134 8.88961 10.4435 9.16348 10.4003C9.1677 10.4305 9.17332 10.4597 9.18246 10.4875C9.24258 10.6731 9.37336 10.8285 9.54316 10.9121L10.6534 12.832V12.8317ZM5.57859 2.79703C5.57859 2.86664 5.62219 2.92957 5.68723 2.95348L6.50637 3.26004L6.81293 4.07918C6.83684 4.14422 6.89977 4.18781 6.96938 4.18781C7.03898 4.18781 7.10191 4.14422 7.12582 4.07918L7.43238 3.26004L8.25152 2.95348C8.31656 2.92957 8.36016 2.86664 8.36016 2.79703C8.36016 2.72742 8.31656 2.66449 8.25152 2.64059L7.43238 2.33402L7.12582 1.51488C7.10191 1.44984 7.03898 1.40625 6.96938 1.40625C6.89977 1.40625 6.83684 1.44984 6.81293 1.51488L6.50637 2.33402L5.68723 2.64059C5.62219 2.66449 5.57859 2.72742 5.57859 2.79703ZM3.72727 6.11051L4.18781 4.88285L5.41547 4.4223C5.5132 4.38539 5.57859 4.29187 5.57859 4.18746C5.57859 4.08305 5.51355 3.98988 5.41547 3.95262L4.18781 3.49207L3.72727 2.26441C3.69035 2.16668 3.59684 2.10129 3.49242 2.10129C3.38801 2.10129 3.29484 2.16633 3.25758 2.26441L2.79703 3.49207L1.56938 3.95262C1.47164 3.98953 1.40625 4.08305 1.40625 4.18746C1.40625 4.29187 1.47129 4.38504 1.56938 4.4223L2.79703 4.88285L3.25758 6.11051C3.29449 6.20824 3.38801 6.27363 3.49242 6.27363C3.59684 6.27363 3.69 6.20859 3.72727 6.11051Z",fill:"currentColor"})))}const me=h.forwardRef(ge);i.p;var ve,Ce,fe,Ee,xe;function Te(){return Te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Te.apply(null,arguments)}function _e(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",Te({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"
1currentColor",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,ve||(ve=h.createElement("path",{d:"M6.34184 3.01605L7.56949 3.4766L8.03004 4.70426C8.06695 4.80199 8.16047 4.86738 8.26488 4.86738C8.3693 4.86738 8.46246 4.80234 8.49973 4.70426L8.96027 3.4766L10.1879 3.01605C10.2857 2.97914 10.3511 2.88562 10.3511 2.78121C10.3511 2.6768 10.286 2.58363 10.1879 2.54637L8.96027 2.08582L8.49973 0.858163C8.46281 0.760428 8.3693 0.695038 8.26488 0.695038C8.16047 0.695038 8.0673 0.760077 8.03004 0.858163L7.56949 2.08582L6.34184 2.54637C6.2441 2.58328 6.17871 2.6768 6.17871 2.78121C6.17871 2.88562 6.24375 2.97879 6.34184 3.01605Z",fill:"currentColor"})),Ce||(Ce=h.createElement("path",{d:"M17.4196 6.3116C17.3619 6.25394 17.274 6.23812 17.1995 6.27187L16.2654 6.69621L15.3313 6.27187C15.2568 6.23812 15.1689 6.25394 15.1112 6.3116C15.0536 6.36925 15.0378 6.45714 15.0715 6.53167L15.4958 7.46578L15.0715 8.39988C15.0378 8.47441 15.0536 8.5623 15.1112 8.61996C15.1689 8.67761 15.2568 8.69343 15.3313 8.65968L16.2654 8.23535L17.1995 8.65968C17.274 8.69343 17.3619 8.67761 17.4196 8.61996C17.4772 8.5623 17.4931 8.47441 17.4593 8.39988L17.035 7.46578L17.4593 6.53167C17.4931 6.45714 17.4772 6.36925 17.4196 6.3116Z",fill:"currentColor"})),fe||(fe=h.createElement("path",{d:"M10.4597 1.54723L11.2788 1.85379L11.5854 2.67293C11.6093 2.73797 11.6722 2.78156 11.7419 2.78156C11.8115 2.78156 11.8744 2.73797 11.8983 2.67293L12.2049 1.85379L13.024 1.54723C13.089 1.52332 13.1326 1.46039 13.1326 1.39078C13.1326 1.32117 13.089 1.25824 13.024 1.23434L12.2049 0.927773L11.8983 0.108633C11.8744 0.0435937 11.8115 0 11.7419 0C11.6722 0 11.6093 0.0435937 11.5854 0.108633L11.2788 0.927773L10.4597 1.23434C10.3947 1.25824 10.3511 1.32117 10.3511 1.39078C10.3511 1.46039 10.3947 1.52332 10.4597 1.54723Z",fill:"currentColor"})),Ee||(Ee=h.createElement("path",{d:"M17.6934 1.05609L16.9415 0.306559C16.535 -0.0998468 15.8745 -0.0998468 15.4659 0.306559L8.73809 7.03441C8.33169 7.44082 8.33169 8.1014 8.73809 8.50992L9.49009 9.26191C9.89649 9.66832 10.5571 9.66832 10.9656 9.26191L17.6934 2.53195C18.0999 2.12554 18.0999 1.46496 17.6934 1.05644V1.05609ZM14.4274 4.07672L13.9212 3.57047L16.2028 1.28883L16.7091 1.79508L14.4274 4.07672Z",fill:"currentColor"})),xe||(xe=h.createElement("path",{d:"M11.314 9.60926C11.0225 9.8993 10.6369 10.0582 10.2273 10.0582C9.81773 10.0582 9.43172 9.89859 9.14238 9.60926L8.39039 8.85727C7.79273 8.25645 7.79344 7.28297 8.39039 6.68566L9.90844 5.16762H1.83305C0.821953 5.16762 0 5.98957 0 7.00066V16.1663C0 17.1773 0.821953 17.9993 1.83305 17.9993H12.832C13.8431 17.9993 14.6651 17.1773 14.6651 16.1663V7.00102C14.6651 6.77918 14.6254 6.56613 14.5529 6.36926L11.314 9.60926ZM3.20801 7.00102C3.96738 7.00102 4.58297 7.6166 4.58297 8.37598C4.58297 9.13535 3.96738 9.75094 3.20801 9.75094C2.44863 9.75094 1.83305 9.13535 1.83305 8.37598C1.83305 7.6166 2.44863 7.00102 3.20801 7.00102ZM12.7519 15.8003C12.6345 16.0267 12.3996 16.167 12.1447 16.167H2.5207C2.25703 16.167 2.01656 16.0151 1.90195 15.7774C1.78734 15.5398 1.81898 15.2561 1.98492 15.05L3.81797 12.7586C3.94699 12.5954 4.14738 12.5009 4.35375 12.5009C4.56012 12.5009 4.7577 12.5954 4.88953 12.7586L5.64855 13.7067L8.14043 10.0519C8.26629 9.86274 8.48145 9.75129 8.7075 9.75129C8.93355 9.75129 9.1459 9.86309 9.27457 10.0519L12.7118 15.0929C12.8549 15.3021 12.8693 15.5742 12.7519 15.8003Z",fill:"currentColor"})))}const Se=h.forwardRef(_e);i.p;var be,we,Re,ke,ye,je;function Ae(){return Ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Ae.apply(null,arguments)}function Pe(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",Ae({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"currentColor",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,be||(be=h.createElement("path",{d:"M2.01844 15.9998L1.99969 15.6914C1.99875 15.6572 1.99734 15.623 1.99734 15.5878C1.99734 15.5062 1.99828 15.4247 1.99969 15.3431V11.9995H0V15.9994C0 17.1042 0.894844 17.9995 2.00016 17.9995H2.97797C2.97 17.992 2.96156 17.985 2.95359 17.9775C2.41078 17.4605 2.09766 16.7962 2.01844 15.9994V15.9998Z",fill:"currentColor"})),we||(we=h.createElement("path",{d:"M2.00016 2.00016H6V0H2.00016C0.894844 0 0 0.894844 0 2.00016V6H2.00016V2.00016Z",fill:"currentColor"})),Re||(Re=h.createElement("path",{d:"M15.9998 15.3464C16.0012 15.4266 16.0017 15.5067 16.0022 15.5878C16.0022 15.6225 16.0008 15.6563 15.9998 15.6905L15.9811 16.0003C15.9019 16.7972 15.5892 17.4614 15.0459 17.9784C15.038 17.9859 15.0295 17.993 15.0215 18.0005H15.9994C17.1042 18.0005 17.9995 17.1056 17.9995 16.0003V12.0005H15.9994V15.3469L15.9998 15.3464Z",fill:"currentColor"})),ke||(ke=h.createElement("path",{d:"M15.9998 0H12V2.00016H15.9998V6H18V2.00016C18 0.895312 17.1052 0 15.9998 0Z",fill:"currentColor"})),ye||(ye=h.createElement("path",{d:"M6.35112 9.16735C7.05378 9.86954 7.913 10.2258 8.90534 10.2258C9.89768 10.2258 10.7574 9.86954 11.46 9.16735C12.1622 8.46516 12.5185 7.60547 12.5185 6.61313C12.5185 5.62079 12.1622 4.7611 11.46 4.05891C10.7574 3.35672 9.89815 3.00047 8.90581 3.00047C7.91346 3.00047 7.05378 3.35672 6.35159 4.05891C5.6494 4.7611 5.29315 5.62079 5.29315 6.61313C5.29315 7.60547 5.6494 8.46516 6.35159 9.16782L6.35112 9.16735Z",fill:"currentColor"})),je||(je=h.createElement("path",{d:"M15.2269 14.5341C15.2067 14.2416 15.1654 13.9228 15.1054 13.5862C15.0445 13.2469 14.9662 12.9262 14.8725 12.6333C14.7754 12.3305 14.6437 12.0314 14.4806 11.7445C14.3114 11.4469 14.1126 11.1881 13.89 10.9748C13.657 10.7517 13.3715 10.5727 13.0415 10.4419C12.7125 10.3116 12.3483 10.2459 11.9583 10.2459C11.805 10.2459 11.6569 10.3087 11.3709 10.4948C11.1951 10.6097 10.9889 10.7423 10.7592 10.8891C10.5628 11.0142 10.2965 11.1314 9.96795 11.2378C9.64732 11.3414 9.32154 11.3944 8.99998 11.3944C8.67842 11.3944 8.3531 11.3419 8.03201 11.2378C7.70342 11.1319 7.43717 11.0142 7.24123 10.8891C7.01342 10.7437 6.80763 10.6111 6.62904 10.4944C6.34357 10.3083 6.19498 10.2455 6.04217 10.2455C5.65216 10.2455 5.28795 10.3116 4.95888 10.4419C4.62888 10.5727 4.34342 10.7517 4.10998 10.9748C3.88732 11.1881 3.68857 11.4473 3.51935 11.7445C3.3567 12.0314 3.22451 12.33 3.12748 12.6333C3.03373 12.9262 2.95545 13.2469 2.89451 13.5862C2.83404 13.9223 2.79326 14.2416 2.7731 14.5345C2.75342 14.8214 2.7431 15.1195 2.7431 15.4205C2.7431 16.2033 2.99201 16.8375 3.48279 17.3048C3.96748 17.7661 4.6092 18 5.3892 18H12.6117C13.3917 18 14.0329 17.7661 14.5176 17.3048C15.0084 16.8375 15.2573 16.2037 15.2573 15.4205C15.2573 15.1181 15.247 14.82 15.2269 14.5345V14.5341Z",fill:"currentColor"})))}const Ie=h.forwardRef(Pe);i.p;var Le,Fe;function Oe(){return Oe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},Oe.apply(null,arguments)}function Be(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",Oe({xmlns:"http://www.w3.org/2000/svg",width:18,height:18,viewBox:"0 0 18 18",fill:"
1currentColor",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,Le||(Le=h.createElement("path",{d:"M15.1815 4.42266H15.1654V2.81848C15.1654 1.26422 13.9011 0 12.3469 0H2.81848C1.26422 0 0 1.26422 0 2.81848V10.7585C0 12.3128 1.26422 13.577 2.81848 13.577H2.83465V15.1812C2.83465 16.7354 4.09887 17.9996 5.65313 17.9996H15.1812C16.7354 17.9996 17.9996 16.7354 17.9996 15.1812V7.24113C17.9996 5.68688 16.7354 4.42266 15.1812 4.42266H15.1815ZM2.81848 12.3469C1.94273 12.3469 1.23047 11.6346 1.23047 10.7589V2.81848C1.23047 1.94273 1.94273 1.23047 2.81848 1.23047H12.3465C13.2223 1.23047 13.9345 1.94273 13.9345 2.81848V10.7585C13.9345 11.6343 13.2223 12.3465 12.3465 12.3465H2.81848V12.3469ZM16.7695 15.1815C16.7695 16.0573 16.0573 16.7695 15.1815 16.7695H5.65313C4.77738 16.7695 4.06512 16.0573 4.06512 15.1815V13.5773H12.3465C13.9008 13.5773 15.165 12.3131 15.165 10.7589V5.65348H15.1812C16.0569 5.65348 16.7692 6.36574 16.7692 7.24149V15.1815H16.7695Z",fill:"currentColor"})),Fe||(Fe=h.createElement("path",{d:"M13.1312 10.2565V3.32086C13.1312 2.55586 12.5093 1.93359 11.744 1.93359H3.42108C2.65608 1.93359 2.03381 2.55551 2.03381 3.32086V10.2565C2.03381 11.0215 2.65573 11.6438 3.42108 11.6438H11.744C12.509 11.6438 13.1312 11.0218 13.1312 10.2565ZM4.4617 3.32086C5.03616 3.32086 5.50198 3.78668 5.50198 4.36113C5.50198 4.93559 5.03616 5.40141 4.4617 5.40141C3.88725 5.40141 3.42143 4.93559 3.42143 4.36113C3.42143 3.78668 3.88725 3.32086 4.4617 3.32086ZM11.6835 9.9791C11.5946 10.1503 11.417 10.2565 11.224 10.2565H3.94139C3.74206 10.2565 3.55995 10.1415 3.47311 9.96187C3.38627 9.78187 3.41018 9.56742 3.53604 9.41133L4.92331 7.67742C5.02069 7.55402 5.17256 7.4823 5.32866 7.4823C5.48475 7.4823 5.63417 7.55367 5.73401 7.67742L6.30846 8.39496L8.19424 5.62922C8.28952 5.48613 8.45229 5.40176 8.6235 5.40176C8.79471 5.40176 8.95502 5.48613 9.05276 5.62922L11.6536 9.44402C11.7619 9.60223 11.7728 9.80824 11.6839 9.97945L11.6835 9.9791Z",fill:"currentColor"})))}const Me=h.forwardRef(Be);i.p;var De,Ne,Ge;function He(){return He=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},He.apply(null,arguments)}function ze(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",He({width:72,height:73,viewBox:"0 0 72 73",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,De||(De=h.createElement("rect",{y:.25,width:72,height:72,rx:8,fill:"#DB2D4C"})),Ne||(Ne=h.createElement("g",{clipPath:"url(#clip0_655_480)"},h.createElement("path",{d:"M43.4219 36.25H16V20C16 17.9289 17.6789 16.25 19.75 16.25H20.4922C20.7969 16.25 21.0703 16.4375 21.1875 16.7188L22.8047 20.7578C23.0547 21.3828 23.9453 21.3828 24.1953 20.7578L25.8125 16.7188C25.9219 16.4375 26.2031 16.25 26.5078 16.25H27.9922C28.2969 16.25 28.5703 16.4375 28.6875 16.7188C28.6875 16.7188 29.6844 19.2031 30.1328 20.3156C30.2445 20.5938 30.3477 20.875 30.4547 21.1555C31.1984 23.1055 33.0859 24.4914 35.2977 24.4914C35.4555 24.4914 35.6117 24.4828 35.7664 24.4695C35.8453 24.4766 35.925 24.4805 36.0055 24.4805C36.2633 24.4805 36.4656 24.6977 36.4664 24.9555C36.4664 24.9594 36.4664 24.9641 36.4664 24.968C36.4703 25.3898 36.3102 25.8 35.9984 26.0844C35.4781 26.5586 35.1664 27.2352 35.1617 27.9703C35.1516 29.3938 36.3625 30.5555 37.7859 30.5672C40.8984 30.5922 43.4227 33.132 43.4227 36.25H43.4219ZM46 19.7281C46 24.2094 49.568 27.857 54.0172 27.9852L54.2609 27.9891C49.7797 27.9891 46.1328 31.5563 46.0039 36.0063L46 36.25C46 31.6875 42.3016 27.9891 37.7391 27.9891C42.3016 27.9891 46 24.2906 46 19.7281ZM51.6523 16.25C51.6523 18.6086 53.5297 20.5281 55.8719 20.5961L56 20.5977C53.6414 20.5977 51.7219 22.475 51.6539 24.8172L51.6523 24.9453C51.6523 22.5438 49.7055 20.5977 47.3047 20.5977C49.7063 20.5977 51.6523 18.6508 51.6523 16.25ZM39.0437 18.8594C39.0437 20.5102 40.3578 21.8539 41.9977 21.9016L42.0875 21.9031C40.4367 21.9031 39.093 23.2172 39.0453 24.857L39.0437 24.9469C39.0437 23.2656 37.6813 21.9031 36 21.9031C37.6813 21.9031 39.0437 20.5406 39.0437 18.8594ZM46 38.75V41.25C46 44.0078 43.7578 46.25 41 46.25H36V51.25C36 54.0078 33.7578 56.25 31 56.25C28.2422 56.25 26 54.0078 26 51.25V46.25H21C18.2422 46.25 16 44.0078 16 41.25V38.75H46ZM32.25 51.25C32.25 50.5594 31.6906 50 31 50C30.3094 50 29.75 50.5594 29.75 51.25C29.75 51.9406 30.3094 52.5 31 52.5C31.6906 52.5 32.25 51.9406 32.25 51.25Z",fill:"white"}))),Ge||(Ge=h.createElement("defs",null,h.createElement("clipPath",{id:"clip0_655_480"},h.createElement("rect",{width:40,height:40,fill:"white",transform:"translate(16 16.25)"})))))}const Ue=h.forwardRef(ze),Ve=(i.p,"https://assets.simplified.co/images/magic-photo-edit"),Ke="color",Ze="gradient",We="image",$e=[{id:1,titleKey:"color",type:Ke,imageSrc:`${Ve}/cactus-color.webp`},{id:2,titleKey:"gradient",type:Ze,imageSrc:`${Ve}/cactus-gradient.webp`},{id:3,titleKey:"image",type:We,imageSrc:`${Ve}/cactus-image.webp`}],Xe={[E.EditPhotoToolTypes.BACKGROUND_REMOVER]:"remove_bg",[E.EditPhotoToolTypes.ERASER]:"eraser",[E.EditPhotoToolTypes.MAGIC]:"magic_remove",[E.EditPhotoToolTypes.GENERATIVE_FILL]:"generative_fill",[E.EditPhotoToolTypes.AUTO_FOCUS]:"auto_focus",[E.EditPhotoToolTypes.REPLACE_BACKGROUND]:"replace_bg",[E.EditPhotoToolTypes.FLAIR]:"flair",[E.EditPhotoToolTypes.MAGIC_EXPAND]:"magic_expand"},Je={[Xe[E.EditPhotoToolTypes.REPLACE_BACKGROUND]]:"replace-background",[Xe[E.EditPhotoToolTypes.MAGIC]]:"magic-remove",[Xe[E.EditPhotoToolTypes.GENERATIVE_FILL]]:"generative-fill",[Xe[E.EditPhotoToolTypes.ERASER]]:"eraser"},Ye=[{id:1,titleKey:Xe[E.EditPhotoToolTypes.BACKGROUND_REMOVER],imageSrc:`${Ve}
1/Remove-Background.webp`,type:E.EditPhotoToolTypes.BACKGROUND_REMOVER,background:E.TOOL_MAGIC_REMOVE_BACKGROUND},{id:2,titleKey:Xe[E.EditPhotoToolTypes.ERASER],imageSrc:`${Ve}/Eraser.webp`,type:E.EditPhotoToolTypes.ERASER,pagePath:E.ERASER_TOOL,pageTitleKey:"eraser_tool",pageDescriptionKey:"eraser_desc",PageNavIcon:ue,background:E.TOOL_ERASER_BACKGROUND},{id:3,titleKey:Xe[E.EditPhotoToolTypes.MAGIC],imageSrc:`${Ve}/Magic-Remove.webp`,type:E.EditPhotoToolTypes.MAGIC,pagePath:E.MAGIC_REMOVE_TOOL,pageTitleKey:"magic_remove",pageDescriptionKey:"magic_remove_desc",PageNavIcon:me,background:E.TOOL_MAGIC_REMOVE_BACKGROUND},{id:4,titleKey:Xe[E.EditPhotoToolTypes.GENERATIVE_FILL],imageSrc:`${Ve}/Magic-Touchup.webp`,type:E.EditPhotoToolTypes.GENERATIVE_FILL,pagePath:E.GENERATIVE_FILL_TOOL,pageTitleKey:"generative_fill",pageDescriptionKey:"generative_fill_desc",PageNavIcon:Se,background:E.TOOL_GENERATIVE_FILL_BACKGROUND},{id:5,titleKey:Xe[E.EditPhotoToolTypes.AUTO_FOCUS],imageSrc:`${Ve}/Auto-Focus.webp`,type:E.EditPhotoToolTypes.AUTO_FOCUS,pagePath:E.AUTO_FOCUS_TOOL,pageTitleKey:"auto_focus",pageDescriptionKey:"auto_focus_desc",PageNavIcon:Ie,background:E.TOOL_GENERATIVE_FILL_BACKGROUND},{id:6,titleKey:Xe[E.EditPhotoToolTypes.REPLACE_BACKGROUND],imageSrc:`${Ve}/Replace-Background.webp`,type:E.EditPhotoToolTypes.REPLACE_BACKGROUND,pagePath:E.REPLACE_BACKGROUND_TOOL,pageTitleKey:"replace_bg",pageDescriptionKey:"replace_bg_desc",PageNavIcon:Me,background:E.TOOL_REPLACE_BACKGROUND},{id:7,titleKey:Xe[E.EditPhotoToolTypes.MAGIC_EXPAND],imageSrc:`${Ve}/ai-magic-expand.webp`,type:E.EditPhotoToolTypes.MAGIC_EXPAND,pagePath:E.REPLACE_BACKGROUND_TOOL,pageTitleKey:"magic_expand",pageDescriptionKey:"magic_expand_desc",PageNavIcon:Ue,background:E.TOOL_REPLACE_BACKGROUND}],Qe=[E.EditPhotoToolTypes.GENERATIVE_FILL,E.EditPhotoToolTypes.MAGIC,E.EditPhotoToolTypes.FLAIR,E.EditPhotoToolTypes.MAGIC_EXPAND];var qe=i(90678);const et=e=>{let{title:t,onClickClose:i,onClickBack:o,containerProps:n}=e;return(0,Q.jsxs)(c.k,{w:"full",justifyContent:"space-between",...n,children:[(0,Q.jsx)(s.h,{"aria-label":t,icon:(0,Q.jsx)(a.FaChevronLeft,{}),size:"sm",fontSize:"lg",bgColor:"transparent !important",_hover:{bgColor:"transparent"},_active:{bgColor:"transparent"},onClick:o,visibility:o?"visible":"hidden"}),(0,Q.jsx)(qe.X,{textAlign:"center",as:"h1",fontSize:"sm",fontWeight:500,lineHeight:"18px",py:2,children:t}),(0,Q.jsx)(s.h,{"aria-label":t,icon:(0,Q.jsx)(a.FaTimes,{}),size:"sm",fontSize:"lg",bgColor:"transparent !important",_hover:{bgColor:"transparent"},_active:{bgColor:"transparent"},onClick:i})]})},tt=e=>{let{thumbnail:t,t:i,onClickRemoveBackground:o,onClickTool:a}=e;return(0,Q.jsxs)(c.k,{minW:"95px",width:"95px",height:"117px",textAlign:"center",cursor:"pointer",onClick:async()=>{t.type===E.EditPhotoToolTypes.BACKGROUND_REMOVER&&await o(),a(t.type)},flexDirection:"column",justifyContent:"space-between",position:"relative",children:[(0,Q.jsx)(d.E,{width:"95px",height:"95px",alt:t.titleKey,src:t.imageSrc,borderRadius:"lg"}),(0,Q.jsx)(U.x,{whiteSpace:"nowrap",fontSize:"xs",color:"content_inactive",children:i(t.titleKey)})]})},it=e=>{let{activeTool:t,onClickBack:i,onClickTool:o,onClickRemoveBackground:a,onClickCancelEditPhoto:n,isSmallScreen:s}=e;const{t:l}=(0,p.$)(["tools"]),[d,u]=(0,h.useState)(!1);return(0,Q.jsx)(r.x,{width:"100%",height:s?"100%":"unset",bg:"base_level_3",borderRadius:s?"none":"lg",padding:"12px 0",children:s?(0,Q.jsxs)(c.k,{direction:"column",alignItems:"center",rowGap:4,overflow:"hidden",children:[(0,Q.jsx)(et,{title:l("edit_photo"),onClickClose:n,containerProps:{px:4}}),(0,Q.jsx)(c.k,{width:"100%",columnGap:6,overflowX:"auto",paddingBottom:"12px",children:Ye.map(e=>(0,Q.jsx)(tt,{thumbnail:e,t:l,onClickTool:o,onClickRemoveBackground:a},e.id))})]}):(0,Q.jsx)(N.hGH,{showHeaderDivider:!t&&!d,showBackButtonWhenDisabled:!0,showDivider:!1,childrenWithMarginTop:!1,title:l(t?Xe[t]:"edit_photo"),collapse:d||!!t,onToggleCollapse:()=>u(!d),childrenStyle:{display:"flex",flexWrap:"wrap",gap:4,padding:4,paddingTop:0},disabled:!!t,onClickBack:i,children:Ye.map(e=>{if(e.type!==E.EditPhotoToolTypes.MAGIC_EXPAND||!s)return(0,Q.jsx)(tt,{thumbnail:e,t:l,onClickTool:o,onClickRemoveBackgroun
1d:a},e.id)})})})};var ot=i(295903);const at=e=>({isEraser:e===E.EditPhotoToolTypes.ERASER,isGenerativeFill:e===E.EditPhotoToolTypes.GENERATIVE_FILL,isAutoFocus:e===E.EditPhotoToolTypes.AUTO_FOCUS,isMagicRemove:e===E.EditPhotoToolTypes.MAGIC,isReplaceBackground:e===E.EditPhotoToolTypes.REPLACE_BACKGROUND,isFlair:e===E.EditPhotoToolTypes.FLAIR,isRemoveBackground:e===E.EditPhotoToolTypes.BACKGROUND_REMOVER,isMagicExpand:e===E.EditPhotoToolTypes.MAGIC_EXPAND});var nt=i(730843),rt=i(767437);const st=e=>{let{type:t,handlerRef:i,t:o}=e;switch(t){case Ke:return(0,Q.jsx)(N.nu$,{t:o,colorList:nt.Vy,onColorClick:e=>i.current.workareaHandler.setBackground(i.current.workarea,null,e,null)});case Ze:return(0,Q.jsx)(N.GTG,{hideHeader:!0,sectionIsOpen:!0,withoutPadding:!0,onColorClick:(e,t)=>i.current.workareaHandler.setBackground(i.current.workarea,(0,E.toCustomGradientObject)(t),null,null)});case We:return(0,Q.jsx)(rt.Z,{withoutDrag:!0,marginRight:"-2px",showRecents:!1,showDivider:!1,onItemClick:e=>i.current.workareaHandler.setBackground(i.current.workarea,e.payload,null,e.payload)});default:return null}},lt=e=>{let{activeReplaceBackgroundType:t,onClickThumbnail:i,isSmallScreen:o}=e;const{t:a}=(0,p.$)(["common"]);return(0,Q.jsx)(r.x,{sx:{display:"flex",flexWrap:"wrap",gap:4,alignSelf:"center"},children:$e.map(e=>(0,Q.jsxs)(c.k,{width:"95px",height:"117px",textAlign:"center",cursor:"pointer",onClick:()=>i(e.type),flexDirection:"column",justifyContent:"space-between",children:[(0,Q.jsx)(d.E,{width:"95px",height:"95px",alt:e.titleKey,src:e.imageSrc,borderRadius:"lg",objectFit:"cover",sx:t!==e.type||o?{}:{outline:"1px solid #FFAD00"}}),(0,Q.jsx)(U.x,{whiteSpace:"nowrap",fontSize:"xs",color:t!==e.type||o?"common.dust":"common.primary_400",children:a(e.titleKey,{ns:"common"})})]},e.id))})};var ct,dt=i(53909);function ut(){return ut=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var o in i)({}).hasOwnProperty.call(i,o)&&(e[o]=i[o])}return e},ut.apply(null,arguments)}function ht(e,t){let{title:i,titleId:o,...a}=e;return h.createElement("svg",ut({width:18,height:18,viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",ref:t,"aria-labelledby":o},a),i?h.createElement("title",{id:o},i):null,ct||(ct=h.createElement("g",{id:"Icon/AI-Magic-A-Outline"},h.createElement("g",{id:"Shape"},h.createElement("path",{d:"M9.0376 4.10069C8.62301 4.10069 8.28379 4.43991 8.28379 4.8545V6.36212C8.28379 6.77671 8.62301 7.11593 9.0376 7.11593C9.4522 7.11593 9.79141 6.77671 9.79141 6.36212V4.8545C9.79141 4.43614 9.45597 4.10069 9.0376 4.10069Z",fill:"#1E1E1E"}),h.createElement("path",{d:"M11.7023 9.66758L13.0064 10.4214C13.3683 10.6287 13.4889 11.0885 13.2816 11.4503C13.1421 11.6916 12.8896 11.8272 12.6295 11.8272C12.5014 11.8272 12.3695 11.7933 12.2526 11.7255L10.9485 10.9717C10.5905 10.7644 10.4661 10.3045 10.6734 9.94272C10.8807 9.58466 11.3405 9.46028 11.7023 9.66758Z",fill:"#1E1E1E"}),h.createElement("path",{d:"M7.13048 7.02925L5.82638 6.27544C5.46456 6.06814 5.00473 6.19252 4.79743 6.55058C4.59014 6.91241 4.71451 7.37223 5.07257 7.57953L6.37667 8.33334C6.49351 8.40118 6.62542 8.4351 6.75357 8.4351C7.01364 8.4351 7.26616 8.29941 7.40562 8.0582C7.61291 7.69637 7.4923 7.23654 7.13048 7.02925Z",fill:"#1E1E1E"}),h.createElement("path",{d:"M10.9485 7.02926L12.2526 6.27545C12.6107 6.06438 13.0743 6.18876 13.2816 6.55059C13.4889 6.90865 13.3682 7.37224 13.0064 7.57954L11.7023 8.33335C11.5817 8.40119 11.4536 8.43511 11.3254 8.43511C11.0654 8.43511 10.8128 8.29943 10.6734 8.05821C10.4661 7.70015 10.5867 7.23656 10.9485 7.02926Z",fill:"#1E1E1E"}),h.createElement("path",{d:"M6.37666 9.66759L5.07257 10.4214C4.71074 10.6287 4.59013 11.0923 4.79743 11.4504C4.93688 11.6916 5.18941 11.8273 5.44947 11.8273C5.57762 11.8273 5.70577 11.7933 5.82638 11.7255L7.13047 10.9717C7.4923 10.7644 7.61291 10.3008 7.40561 9.94273C7.19831 9.5809 6.73849 9.45653 6.37666 9.66759Z",fill:"#1E1E1E"}),h.createElement("path",{d:"M9.79141 9.00045C9.79141 9.41677 9.45392 9.75426 9.0376 9.75426C8.62129 9.75426 8.28379 9.41677 8.28379 9.00045C8.28379 8.58413 8.62129 8.24664 9.0376 8.24664C9.45392 8.24664 9.79141 8.58413 9.79141 9.00045Z",fill:"#1E1E1E"}),h.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M15.8445 3.76527L10.1683 0.489966C9.47105 0.086678 8.60417 0.086678 7.90689 0.489966L2.23447 3.76527C1.5372 4.16855 1.10376 4.91859 1.10376 5.72517V12.2758C1.10376 13.0823 1.5372 13.8324 2.23447 14.2357L7.90689 17.511C8.25365 17.7107 8.64563 17.8125 9.03761 17.8125C9.42959 
117.8125 9.8178 17.7107 10.1683 17.511L15.8407 14.2357C16.538 13.8324 16.9715 13.0823 16.9715 12.2758V5.72517C16.9752 4.91859 16.5418 4.16855 15.8445 3.76527ZM15.4676 12.2758C15.4676 12.5434 15.3244 12.7959 15.0907 12.9278L9.79519 15.9845V11.6388C9.79519 11.2242 9.45597 10.885 9.04138 10.885C8.62678 10.885 8.28757 11.2242 8.28757 11.6388V15.9883L2.98828 12.9278C2.7546 12.7921 2.61138 12.5434 2.61138 12.2758V5.72517C2.61138 5.45757 2.7546 5.20504 2.98828 5.07313L8.6607 1.79782C8.77754 1.72998 8.90946 1.69606 9.03761 1.69606C9.16576 1.69606 9.29767 1.72998 9.41451 1.79782L15.0869 5.07313C15.3206 5.20881 15.4638 5.45757 15.4638 5.72517V12.2758H15.4676Z",fill:"#1E1E1E"})))))}const pt=h.forwardRef(ht);i.p;var gt=i(659840);const mt=e=>{let{activeTool:t,handlerRef:i,onClickMainButton:o,isGenerativeFillFirstStepDone:n,generativeFillText:r,setGenerativeFillText:s,generativeFillResults:l,magicRemoveResults:c,isSmallScreen:d,activeReplaceBackgroundType:u,setGenerativeFillFistStepDone:h}=e;const{t:g}=(0,p.$)(["tools","common"]),m=(0,gt.k6)(),{isEraser:v,isGenerativeFill:C,isAutoFocus:f,isMagicRemove:x,isReplaceBackground:T,isFlair:_,isRemoveBackground:S,isMagicExpand:b}=at(t),w=e=>{const t=m.location.pathname,i=new URLSearchParams(m.location.search);i.set("step",e),m.push({pathname:t,search:i.toString()})},R=parseInt((0,E.getQueryParam)("step",m.location.search),10)||E.SCREEN_VIEW_STEP.INITIAL,k=e=>{e<E.SCREEN_VIEW_STEP.INITIAL||e>E.SCREEN_VIEW_STEP.LAST?w(E.SCREEN_VIEW_STEP.INITIAL.toString()):w(e.toString())};return v||f||S||T&&u&&d||(C||b&&!d)&&(!d||(null===l||void 0===l||!l.length))||x&&(!d||(null===c||void 0===c||!c.length))?(0,Q.jsxs)(V.h,{children:[(x||C)&&(0,Q.jsx)(Z.z,{w:"100%",leftIcon:(0,Q.jsx)(a.FaSyncAlt,{}),onClick:()=>{n?s(""):(i.current.removePaths(),C&&s(""))},disabled:n?!r:!i.current.isHaveSelection,children:g("reset",{ns:"common"})}),(0,Q.jsx)(Z.z,{w:"100%",colorScheme:"primary",variant:"solid",leftIcon:n?(0,Q.jsx)(pt,{}):x||v||f||S?(0,Q.jsx)(a.FaAirFreshener,{}):(0,Q.jsx)(a.FaHandPointUp,{}),disabled:_?!!r:C?!i.current.isHaveSelection||n&&!r:!S&&!i.current.isHaveSelection&&!v&&!f&&!T,onClick:()=>{C&&!n?(h&&h(!0),i.current.changeDrawingMode(!1)):o()},children:x?g("remove",{ns:"common"}):n?g("generate",{ns:"common"}):C?g("select_area",{ns:"tools"}):g("done",{ns:"common"})})]}):b&&d&&0===R?(0,Q.jsx)(Z.z,{onClick:()=>k(R+1),variant:"solid",children:g("next",{ns:"tools"})}):b&&2!==R&&3!==R?(0,Q.jsxs)(V.h,{children:[(0,Q.jsx)(Z.z,{w:"100%",onClick:()=>k(R-1),children:g("back",{ns:"tools"})}),(0,Q.jsx)(Z.z,{w:"100%",variant:"solid",onClick:()=>k(R+1),children:g("next",{ns:"tools"})})]}):null},vt=e=>{let{generativeFillResults:t,handlerRef:i,onClickMainButton:o}=e;const{t:a}=(0,p.$)(["common"]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(r.x,{display:"flex",flexWrap:"wrap",gap:4,alignSelf:"center",justifyContent:"center",children:t.map(e=>(0,Q.jsx)(r.x,{width:"150px",height:"114px",cursor:"pointer",borderRadius:"lg",overflow:"hidden",outline:"1px solid",outlineColor:e===i.current.activeEditPhotoImage.src?"common.primary_400":"transparent",onClick:()=>i.current.changeSrc(e),children:(0,Q.jsx)(d.E,{width:"150px",height:"114px",src:e,objectFit:"contain"})},e))}),(0,Q.jsx)(Z.z,{w:"100%",colorScheme:"primary",variant:"solid",leftIcon:(0,Q.jsx)(pt,{}),onClick:()=>o(),minH:"40px",children:a("generate_more",{ns:"common"})})]})};var Ct=i(375628);const ft=e=>{let{handlerRef:t}=e;const{t:i}=(0,p.$)(["tools"]),[o]=(0,Ct.dQ)("colors",["common.primary_400"]);return(0,Q.jsx)(c.k,{flexWrap:"wrap",gap:4,alignSelf:"center",justifyContent:"center",children:t.current.removeBackgroundResults.map((e,a)=>{var n,s,l,u;return(0,Q.jsxs)(c.k,{width:"150px",height:"154px",cursor:"pointer",direction:"column",justifyContent:"space-between",children:[(0,Q.jsxs)(r.x,{width:"150px",height:"114px",cursor:"pointer",borderRadius:"lg",overflow:"hidden",position:"relative",outline:`1px solid ${e===(null===t||void 0===t||null===(n=t.current)||void 0===n||null===(s=n.activeEditPhotoImage)||void 0===s?void 0:s.src)?o:"transparent"}`,onClick:()=>t.current.changeSrc(e,!0),children:[(0,Q.jsx)(d.E,{width:"150px",height:"114px",src:w,objectFit:"cover"}),(0,Q.jsx)(d.E,{position:"absolute",width:"150px",height:"114px",src:e,objectFit:"contain",inset:0})]},e),(0,Q.jsx)(U.x,{fontWeight:500,textAlign:"center",color:e===(null===t||void 0===t||null===(l=t.current)||void 0===l||null===(u=l.activeEditPhotoImage)||void 0===u?void 0:u.src)?"content_inactive":"content_disabled",children:i(a?"magic_crop":"keep_original")})]},e)})})},Et=e=>{let{magicRemoveResults:t,handlerRef:i,onClickMainButton:o}=e;const{t:a}=(0,p.$)(["common"]);return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(r.x,{display:"flex",flexWrap:"wrap",gap:4,alignSelf:"center",justifyContent:"center",children:t.map(e=>{var t,o;return(0,Q.jsx)(r.x,{width:"150px",height:"114px",cursor:"pointer",borderRadius:"lg",overflow:"hidden",outline:"1px solid",outlineColor:e===(null===(t=i.current)||void 0===t||null===(o=t.activeEditPhotoImage)||void 0===o?void 0:o.src)?"common.primary_400":"transparent",onClick:()=>i.current.changeSrc(e),children:(0,Q.jsx)(d.E,{width:"150px",height:"114px",src:e,objectFit:"contain"})},e)})}),(0,Q.jsx)(Z.z,{w:"100%",colorScheme:"primary",variant:"solid",leftIcon:(0,Q.jsx)(pt,{}),onClick:()=>o(),minH:"40px",children:a("generate_more",{ns:"common"})})]})};var xt=i(434170);const Tt=e=>{var t;let{activeTool:i,handlerRef:o,brushSize:a,onChangeBrushSize:n,blurAmount:r,onChangeBlurAmount:s,onClickMainButton:l,generativeFillText:d,setGenerativeFillText:u,generativeFillResults:h,magicRemoveResults:g,onClickBack:m,activeReplaceBackgroun
1dType:v,setActiveReplaceBackgroundType:C,isGenerativeFillFirstStepDone:f,setGenerativeFillFistStepDone:x,isSmallScreen:T,setIsFinishLoading:_}=e;const{t:S}=(0,p.$)(["studio","workspace","tools","common"]),{isEraser:b,isGenerativeFill:w,isAutoFocus:k,isMagicRemove:y,isReplaceBackground:j,isRemoveBackground:A,isMagicExpand:P}=at(i),I=(0,gt.k6)(),L=parseInt((0,E.getQueryParam)("step",null===(t=I.location)||void 0===t?void 0:t.search),10)||E.SCREEN_VIEW_STEP.INITIAL;return(0,Q.jsxs)(c.k,{direction:"column",rowGap:L===E.SCREEN_VIEW_STEP.FINAL?2:4,w:"inherit",height:"100%",children:[T&&(0,Q.jsx)(et,{title:b?S("eraser",{ns:"tools"}):y?S("select_area_to_remove",{ns:"tools"}):k?S("amount_of_blur",{ns:"tools"}):j?S("select_style",{ns:"tools"}):w&&f?S("enter_prompt",{ns:"tools"}):w?S("select_area_to_touchup",{ns:"tools"}):P?L===E.SCREEN_VIEW_STEP.INITIAL?S("magic_expand_prop_size",{ns:"tools"}):L===E.SCREEN_VIEW_STEP.MID?S("magic_expand_prom_position",{ns:"tools"}):L===E.SCREEN_VIEW_STEP.FINAL?S("enter_prompt",{ns:"tools"}):L===E.SCREEN_VIEW_STEP.LAST?S("select_results",{ns:"tools"}):"":"",onClickClose:m,onClickBack:j&&v||w&&(f||h.length)||y&&g.length?()=>{j&&v?C(""):w?h.length?(o.current.generativeFillResults=[],o.current.setReloadHash(Date.now())):f&&(o.current.changeDrawingMode(!0),x&&x(!1)):y&&g.length&&(o.current.magicRemoveResults=[],o.current.setReloadHash(Date.now()))}:void 0}),!b&&!k&&(!w||f||T&&null!==h&&void 0!==h&&h.length)&&(!y||T&&null!==g&&void 0!==g&&g.length)?(T?j&&!v:j)?(0,Q.jsx)(lt,{activeReplaceBackgroundType:v,onClickThumbnail:C,isSmallScreen:T}):A?(0,Q.jsx)(ft,{handlerRef:o}):P?(0,Q.jsx)(xt.default,{handlerRef:o,setIsFinishLoading:_}):null:(0,Q.jsx)(N.D6y,{hideIndicator:!0,showInputbox:!0,domain:R.ppI,title:k?S("size",{ns:"common"}):S("brush_size",{ns:"tools"}),values:k?r:a,onUpdate:k?s:n,onChange:k?s:n}),T&&(0,Q.jsxs)(Q.Fragment,{children:[j&&v&&(0,Q.jsx)(st,{type:v,handlerRef:o,t:S}),w&&f&&!h.length&&(0,Q.jsx)(dt.Z,{generativeFillText:d,setGenerativeFillText:u}),w&&!!h.length&&(0,Q.jsx)(vt,{generativeFillResults:h,handlerRef:o,onClickMainButton:l}),y&&!!g.length&&(0,Q.jsx)(Et,{magicRemoveResults:g,handlerRef:o,onClickMainButton:l})]}),(0,Q.jsx)(mt,{activeTool:i,handlerRef:o,onClickMainButton:l,isGenerativeFillFirstStepDone:f,generativeFillText:d,setGenerativeFillText:u,isSmallScreen:T,activeReplaceBackgroundType:v,setGenerativeFillFistStepDone:x,generativeFillResults:h,magicRemoveResults:g})]})},_t=(0,h.lazy)(()=>Promise.resolve().then(i.bind(i,434170))),St=()=>(0,Q.jsxs)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",children:[(0,Q.jsx)(ot.O,{height:"20px",my:2}),(0,Q.jsx)(ot.O,{height:"20px",my:2}),(0,Q.jsx)(ot.O,{height:"20px",my:2})]}),bt=e=>{let{activeTool:t,handlerRef:i,brushSize:o,onChangeBrushSize:n,blurAmount:s,onChangeBlurAmount:l,onClickMainButton:c,generativeFillText:d,setGenerativeFillText:u,generativeFillResults:g,magicRemoveResults:m,activeReplaceBackgroundType:v,setActiveReplaceBackgroundType:C,isGenerativeFillFirstStepDone:f,setGenerativeFillFistStepDone:E,setIsFinishLoading:x}=e;const{t:T}=(0,p.$)(["studio","workspace","tools","common"]),[_,S]=(0,h.useState)(!1),[b,w]=(0,h.useState)(!1),[R,k]=(0,h.useState)(!1),[y,j]=(0,h.useState)(!1),{isGenerativeFill:A,isReplaceBackground:P,isFlair:I,isMagicRemove:L,isMagicExpand:F}=at(t);(0,h.useEffect)(()=>{t||(E(!1),S(!1),w(!1),j(!1),C(Ke))},[t,C,E]);const O=(0,h.useMemo)(()=>$e.find(e=>e.type===v),[v]);return t?(0,Q.jsxs)(Q.Fragment,{children:[F&&(0,Q.jsx)(h.Suspense,{fallback:(0,Q.jsx)(St,{}),children:(0,Q.jsx)(_t,{handlerRef:i,setIsFinishLoading:x})}),!I&&!F&&(0,Q.jsx)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",marginTop:4,children:(0,Q.jsx)(N.hGH,{showHeaderDivider:!f,showDivider:!1,childrenWithMarginTop:!1,title:A?T("select_area_to_touchup",{ns:"tools"}):P?T("video_select_subtitles_style",{ns:"tools"}):T("layer.properties"),collapse:f,onToggleCollapse:()=>{A&&i.current.changeDrawingMode(f),E(!f)},childrenStyle:{display:"flex",gap:4,padding:4,paddingTop:0,flexDirection:"column"}
1,children:(0,Q.jsx)(Tt,{activeReplaceBackgroundType:v,setActiveReplaceBackgroundType:C,onClickBack:c,activeTool:t,handlerRef:i,brushSize:o,onChangeBrushSize:n,blurAmount:s,onChangeBlurAmount:l,onClickMainButton:c,generativeFillText:d,setGenerativeFillText:u,generativeFillResults:g,magicRemoveResults:m,isGenerativeFillFirstStepDone:f,setGenerativeFillFistStepDone:E,setIsFinishLoading:x})})}),(A||I)&&(0,Q.jsx)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",marginTop:4,children:(0,Q.jsxs)(N.hGH,{showHeaderDivider:!_,showDivider:!1,childrenWithMarginTop:!1,title:T("enter_prompt",{ns:"tools"}),collapse:_,onToggleCollapse:()=>S(!_),childrenStyle:{display:"flex",gap:4,padding:4,paddingTop:0,flexDirection:"column"},children:[(0,Q.jsx)(dt.Z,{generativeFillText:d,setGenerativeFillText:u}),(0,Q.jsx)(mt,{isGenerativeFillFirstStepDone:!0,activeTool:t,handlerRef:i,onClickMainButton:c,generativeFillText:d,setGenerativeFillText:u})]})}),!!g.length&&(0,Q.jsx)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",marginTop:4,children:(0,Q.jsx)(N.hGH,{showHeaderDivider:!b,showDivider:!1,childrenWithMarginTop:!1,title:T("select_results",{ns:"tools"}),collapse:b,onToggleCollapse:()=>w(!b),childrenStyle:{display:"flex",gap:4,padding:4,paddingTop:0,flexDirection:"column"},children:(0,Q.jsx)(vt,{generativeFillResults:g,handlerRef:i,onClickMainButton:c})})}),!!m.length&&(0,Q.jsx)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",marginTop:4,children:(0,Q.jsx)(N.hGH,{showHeaderDivider:!R,showDivider:!1,childrenWithMarginTop:!1,title:T("select_results",{ns:"tools"}),collapse:R,onToggleCollapse:()=>k(!R),childrenStyle:{display:"flex",gap:4,padding:4,paddingTop:0,flexDirection:"column"},children:(0,Q.jsx)(Et,{magicRemoveResults:m,handlerRef:i,onClickMainButton:c})})}),P&&v&&(0,Q.jsx)(r.x,{width:"100%",bg:"base_level_3",borderRadius:"lg",padding:"12px 0",marginTop:4,children:(0,Q.jsxs)(N.hGH,{showHeaderDivider:!y,showDivider:!1,childrenWithMarginTop:!1,title:`${T("select",{ns:"common"})} ${T((null===O||void 0===O?void 0:O.titleKey)||"")}`,collapse:y,onToggleCollapse:()=>j(!y),childrenStyle:{display:"flex",flexDirection:"column",padding:"0 16px 16px 16px",gap:4,...v===We&&{minHeight:"384px"}},children:[(0,Q.jsx)(st,{type:v,handlerRef:i,t:T}),(0,Q.jsx)(Z.z,{w:"full",marginLeft:"auto",colorScheme:"primary",variant:"solid",leftIcon:(0,Q.jsx)(a.FaAirFreshener,{}),onClick:c,children:T("done",{ns:"common"})})]})})]}):null},wt=e=>{let{activeTool:t,handlerRef:i,brushSize:o,onChangeBrushSize:a,blurAmount:n,onChangeBlurAmount:r,onClickMainButton:s,generativeFillText:l,setGenerativeFillText:c,generativeFillResults:d,magicRemoveResults:u,onClickBack:h,activeReplaceBackgroundType:p,setActiveReplaceBackgroundType:g,isGenerativeFillFirstStepDone:m,setGenerativeFillFistStepDone:v,drawerHeight:C=200,setIsFinishLoading:f}=e;return(0,Q.jsx)(N.dys,{isOpen:!!t,onClose:h,showDrawerHeaderCloseButton:!1,drawerBodyChildren:t?(0,Q.jsx)(Tt,{isSmallScreen:!0,activeTool:t,handlerRef:i,activeReplaceBackgroundType:p,setActiveReplaceBackgroundType:g,brushSize:o,onChangeBrushSize:a,blurAmount:n,onChangeBlurAmount:r,onClickMainButton:s,generativeFillText:l,setGenerativeFillText:c,generativeFillResults:d,magicRemoveResults:u,onClickBack:h,isGenerativeFillFirstStepDone:m,setGenerativeFillFistStepDone:v,setIsFinishLoading:f}):null,drawerHeaderProps:{bg:"base_level_3",borderTop:"1px solid",borderColor:"content_alpha_100",borderRadius:"8px 8px 0 0"},drawerBodyProps:{bgColor:"base_level_3"},drawerProps:{blockScrollOnMount:!1},drawerContentProps:{boxShadow:"none",height:C}})};var Rt=i(946214),kt=i(129944);const yt=e=>{let{activeTool:t="bg_remover",t:i}=e;return(0,Rt.createPortal)((0,Q.jsx)(kt.M,{position:"absolute",left:0,top:0,pointerEvents:"none",zIndex:"modal",bgColor:"base_level_2_alpha",h:"full",w:"full",children:(0,Q.jsx)(N.jni,{loadingStatus:i(`quick_tools.loading.${t}`,{ns:"loading-messages"}),t:i,progress:null})}),document.body)};var jt=i(369843),At=i(282542),Pt=i(747676);const It=e=>{var t,i,o,s,l,d;let{id:u,isFixed:C=!1,onFinish:x,onSave:T}=e;const _=(0,g.I0)(),b=(0,gt.k6)(),w=(0,f.TH)(),{t:y}=(0,p.$)(["studio","workspace","tools","common","loading-messages"]),j=(0,n.S)({base:!0,md:!0,lg:!1}),{isAuthenticated:A,user:P,editPhotoTool:L,aiGenerationQuota:O}=(0,g.v9)(e=>{var t,i,o,a;return{isAuthenticated:e.auth.isAuthenticated,editPhotoTool:e.editor.editPhotoTool,auth:e.auth,user:null===(t=e.auth)||void 0===t||null===(i=t.payload)||void 0===i?void 0:i.user,mobileAp
1p:e.mobileApp,selectedAppSubscription:e.apps[E.PRODUCTS.DESIGN]||e.apps[E.PRODUCTS.ALL],aiGenerationQuota:null===(o=e.apps.common)||void 0===o||null===(a=o.features)||void 0===a?void 0:a.find(e=>e.feature_code===E.FeatureCodes.COIN),canChangeSubscription:e.permissions.workspacePermissionChecks}}),[z,U]=(0,h.useState)(!1),[V,K]=(0,h.useState)(1),[Z,W]=(0,h.useState)(null),[$,X]=(0,h.useState)(10),[J,Y]=(0,h.useState)(50),[ee,te]=(0,h.useState)(!1),[,ie]=(0,h.useState)(Date.now()),[oe,ne]=(0,h.useState)(!1),[re,se]=(0,h.useState)(""),[le,ce]=(0,h.useState)(""),[de,ue]=(0,h.useState)(!1),he=parseInt((0,E.getQueryParam)("step",b.location.search),10)||E.SCREEN_VIEW_STEP.INITIAL,pe=(0,h.useMemo)(()=>Ye.find(e=>e.pagePath===w.pathname||e.type===(null===L||void 0===L?void 0:L.existingTool)),[w.pathname,L]),{path:ge}=(0,gt.$B)(),me=(0,h.useRef)(),ve=(0,h.useRef)(),{current:Ce}=(0,h.useRef)(new AbortController),fe=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];X(10),K(1),me.current&&me.current.reset(),e&&(0,E.analyticsTrackEvent)("startOverEditPhoto")},Ee=e=>{X(e),me.current.changeBrushSize(e)},xe=e=>{Y(e),me.current.changeBlurAmount(e)},Te=async function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(Qe.includes(e)&&(null===O||void 0===O?void 0:O.current_usage)>=(null===O||void 0===O?void 0:O.usage_limit))return void Se();const i=!me.current.removeBackgroundResults.length;i&&ne(!0),await me.current.changeActiveTool(e,t),i&&ne(!1),(0,E.analyticsTrackEvent)(`editPhoto.${e}.open`)},_e=(0,h.useCallback)(()=>{_((0,At.HJ)({addonCategory:E.AddonCategories.COIN,addonType:E.ONE_TIME_ADDON,product:E.PRODUCTS.DESIGN,hideToggleSwitch:!0}))},[_]),Se=()=>{_e()},be=async function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:E.EditPhotoToolTypes.BACKGROUND_REMOVER,a=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];if(!me.current.activeEditPhotoImage)return;if(!A)return void U(!0);const n={};switch(o){case E.EditPhotoToolTypes.AUTO_FOCUS:n.firstTitle=y("auto_focusing",{ns:"studio"}),n.secondDescription=y("editor.auto_focus_success",{ns:"workspace"}),n.errorDescription=y("editor.auto_focus_error_msg",{ns:"workspace"});break;case E.EditPhotoToolTypes.REPLACE_BACKGROUND:n.firstTitle=y("replacing_bg",{ns:"studio"}),n.secondDescription=y("editor.replace_bg_success",{ns:"workspace"}),n.errorDescription=y("editor.replace_bg_error_msg",{ns:"workspace"});break;default:n.firstTitle=y("removing_bg",{ns:"studio"}),n.secondDescription=y("editor.remove_bg_success",{ns:"workspace"}),n.errorDescription=y("editor.remove_bg_error_msg",{ns:"workspace"})}if(me.current.removeBackgroundResults.length){const e=me.current.removeBackgroundResults.find(e=>e===me.current.activeEditPhotoImage.src)||me.current.removeBackgroundResults[0];return i&&await me.current.changeSrc(e,!0),e}e&&ne(!0);const r=me.current.activeEditPhotoImage.originalSrc||me.current.activeEditPhotoImage.getSrc();try{var s,l,c;const o=await B().post(M.Rxf,{image_url:r,magic_crop:!0},!A&&{headers:{Authorization:""}},{cancelToken:Ce.signal});t&&(0,N.CFj)({description:y("context_menu.please_Wait",{ns:"studio"}),title:n.firstTitle,status:"info"});const v=await(0,D.Cp)(o.data.task_id,()=>{});if((null===v||void 0===v||null===(s=v.response)||void 0===s?void 0:s.status)===E.CeleryTaskStatesType.SUCCESS){var d,u,h,p,g,m;const o=null===v||void 0===v||null===(d=v.response)||void 0===d||null===(u=d.detail)||void 0===u?void 0:u.url;me.current.removeBackgroundResults=[null===v||void 0===v||null===(h=v.response)||void 0===h||null===(p=h.detail)||void 0===p?void 0:p.url,null===v||void 0===v||null===(g=v.response)||void 0===g||null===(m=g.detail)||void 0===m?void 0:m.cropped_url],i&&await me.current.changeSrc(o,!0,a),e&&ne(!1),t&&(0,N.CFj)({description:n.secondDescription,title:y("success",{ns:"common"}),status:"success"}),t&&(ge===E.STATIC_STORY_DETAIL_NAME_PATH||ge===E.STATIC_STORY_DETAIL_PATH?(0,E.analyticsTrackEvent)("designEditor.RemovedBackgroun
1d"):ge===E.ANIMATED_STORY_DETAIL_NAME_PATH||ge===E.ANIMATED_STORY_DETAIL_PATH?(0,E.analyticsTrackEvent)("videoEditor.RemovedBackground"):(0,E.analyticsTrackEvent)("gt.RemovedBackground")),_((0,Pt.oJ)(E.FeatureCodes.COIN))}else e&&ne(!1),t&&(0,N.CFj)({description:n.errorDescription,title:y("editor.remove_bg_error_title",{ns:"workspace"}),status:"error"});return null===v||void 0===v||null===(l=v.response)||void 0===l||null===(c=l.detail)||void 0===c?void 0:c.url}catch(C){var v;e&&ne(!1),(null===C||void 0===C||null===(v=C.response)||void 0===v?void 0:v.status)===E.HTTP_STATUS_QUOTA_EXHAUSTED_429?t&&(0,G.iM)(C):t&&(0,N.CFj)({description:y("try_other_image",{ns:"tools"}),title:y("error",{ns:"common"}),status:"error"})}},we=()=>{_((0,m.vs)({isOpen:!1,originalUrl:void 0})),(0,E.analyticsTrackEvent)("cancelEditPhoto"),me.current.interactionHandler.selection()},Re=e=>{var t;(null===e||void 0===e||null===(t=e.response)||void 0===t?void 0:t.status)===E.HTTP_STATUS_QUOTA_EXHAUSTED_429?Se():(0,N.CFj)({description:(0,E.parseDjangoError)(e)||y("try_other_image",{ns:"tools"}),title:y("error",{ns:"common"}),status:"error"})},ke=e=>{K(e)},ye=()=>{if(me.current.activeTool===E.EditPhotoToolTypes.MAGIC_EXPAND){me.current.canvas.getObjects().forEach(e=>{e.id!==R.KU9&&me.current.canvas.remove(e)});const e=me.current.initialOption;me.current.initialize({...e,imageJSON:me.current.activeEditPhotoImage.toJSON()})}me.current.activeTool===E.EditPhotoToolTypes.MAGIC_EXPAND&&j&&b.replace(w.pathname),me.current.changeActiveTool(""),re&&se("")},je=async()=>{switch(Z){case E.EditPhotoToolTypes.ERASER:case E.EditPhotoToolTypes.AUTO_FOCUS:case E.EditPhotoToolTypes.REPLACE_BACKGROUND:le&&ce(""),ye();break;case E.EditPhotoToolTypes.MAGIC:await(async()=>{if(!A)return void U(!0);ne(!0);const{activeEditPhotoImage:e,createMask:t,isHaveSelection:i,changeSrc:o}=me.current,a=e.magicRemoveMask&&!i?e.magicRemoveMask:await t(),n=e.originalSrc||e.getSrc();if(!a||!n)return(0,N.CFj)({description:y(a?n?"image_or_mask_not_exist":"image_not_exist":"mask_not_exist",{ns:"tools"}),title:y("error",{ns:"common"}),status:"error"}),void ne(!1);try{var r,s,l,c,d,u;const t=await B().post(M.cI7,{mask_url:a,image_url:n});if(null===t||void 0===t||null===(r=t.data)||void 0===r||!r.task_id)return void ne(!1);const i=await(0,D.Cp)(t.data.task_id,()=>{});if(null===i||void 0===i||null===(s=i.response)||void 0===s||null===(l=s.detail)||void 0===l||!l.task_id)return void ne(!1);const o=await(0,D.Cp)(i.response.detail.task_id,()=>{}),m=null===o||void 0===o||null===(c=o.response)||void 0===c||null===(d=c.detail)||void 0===d||null===(u=d.data)||void 0===u?void 0:u.urls;var h,p,g;if(!m)return ne(!1),void(null!==o&&void 0!==o&&null!==(h=o.response)&&void 0!==h&&null!==(p=h.detail)&&void 0!==p&&null!==(g=p.data)&&void 0!==g&&g.error&&(0,N.CFj)({description:o.response.detail.data.error,title:y("error",{ns:"common"}),status:"error"}));ne(!1),me.current.magicRemoveResults=m,await me.current.changeSrc(m[0]),e.magicRemoveMask=a,ne(!1)}catch(m){ne(!1),Re(m)}})();break;case E.EditPhotoToolTypes.GENERATIVE_FILL:await(async()=>{if(!A)return void U(!0);ne(!0);const{activeEditPhotoImage:e,createMask:t,isHaveSelection:i,changeSrc:o}=me.current,a=e.generativeFillMask&&!i?e.generativeFillMask:await t(),n=e.originalSrc||e.getSrc();if(!a||!n)return(0,N.CFj)({description:y(a?n?"image_or_mask_not_exist":"image_not_exist":"mask_not_exist",{ns:"tools"}),title:y("error",{ns:"common"}),status:"error"}),void ne(!1);try{var r,s,l,c,d,u;const t=await B().post(M.CGr,{mask_url:a,image_url:n,prompt:re});if(null===t||void 0===t||null===(r=t.data)||void 0===r||!r.task_id)return void ne(!1);const i=await(0,D.Cp)(t.data.task_id,()=>{});if(null===i||void 0===i||null===(s=i.response)||void 0===s||null===(l=s.detail)||void 0===l||!l.task_id)return void ne(!1);const m=await(0,D.Cp)(i.response.detail.task_id,()=>{}),v=null===m||void 0===m||null===(c=m.response)||void 0===c||null===(d=c.detail)||void 0===d||null===(u=d.data)||void 0===u?void 0:u.urls;var h,p,g;if(!v)return ne(!1),void(null!==m&&void 0!==m&&null!==(h=m.response)&&void 0!==h&&null!==(p=h.detail)&&void 0!==p&&null!==(g=p.data)&&void 0!==g&&g.error&&(0,N.CFj)({description:m.response.detail.data.error,title:y("error",{ns:"common"}),status:"error"}));ne(!1),me.current.generativeFillResults=v,await o(v[0]),e.generativeFillMask=a}catch(m){ne(!1),Re(m)}})();break;case E.EditPhotoToolTypes.FLAIR:await(async()=>{try{var e,t;if(!A)return void U(!0);ne(!0);const i=await me.current.getEditPhotoCanvasAsDataURL(),o=await B().post(M.eHi,{image_base64:i,prompt:re});if(null===o||void 0===o||null===(e=o.data)||void 0===e||!e.task_id)return void ne(!1);const a=await(0,D.Cp)(o.data.task_id,()=>{});if(null===a||void 0===a||null===(t=a.data)||void 0===t||!t.urls)return void ne(!1)}catch(i){Re(i)}finally{ne(!1)}})();break;case E.EditPhotoToolTypes.BACKGROUND_REMOVER:ye()}(0,E.analyticsTrackEvent)(`editPhoto.${Z}.done`)},Ae=(0,h.useCallback)(()=>{F()(ve.current,()=>{Pe(ve.current)})},[]),Pe=e=>{if(!e)return;const t=e.children[0],i=t.offsetWidth,o=t.offsetHeight;me.current.eventHandler.resize(i,o)};(0,h.useEffect)(()=>{const{isOpen:e,imageJSON:t}=L;if(!e||!t)return;if((null===t||void 0===t?void 0:t.type)!==E.FABRIC_IMAGE_ELEMENT)return(0,N.CFj)({description:y("try_other_image",{ns:"tools"}),title:y("error"),status:"error"}),void _((0,m.vs)({isOpen:!1,originalUrl:void 0}));v.fabric.Object.prototype.strokeUniform=!1;const i=ve.current.children[0],o={width:i.offsetWidth,height:i.offsetHeight},a=new v.fabric.Canvas(S.Q8.id,{...S.Uo,...o});
1me.current=new I({...o,canvas:a,workareaOption:{...o,layout:R.kqW},container:i,activeSelectionOption:S.m_,onZoom:ke,onClickRemoveBackground:be,setReloadHash:ie,imageJSON:t,onClickTool:Te,existingTool:pe,isSmallScreen:j,...S.Q8}),localStorage.getItem(E.IS_DEBUG_MODE_LOCAL_STORAGE_KEY)&&(window.editPhotohandler=me.current),Pe(ve.current),Ae(),te(!0)},[Ae,L.isOpen]),(0,h.useEffect)(()=>{L.isOpen||(fe(!1),te(!1),v.fabric.Object.prototype.strokeUniform=!0)},[L.isOpen]),(0,h.useEffect)(()=>{var e,t;(null===(e=me.current)||void 0===e?void 0:e.activeTool)===E.EditPhotoToolTypes.MAGIC_EXPAND&&j&&(e=>{const t=b.location.pathname,i=new URLSearchParams(b.location.search);i.set("step",e),b.push({pathname:t,search:i.toString()})})(E.SCREEN_VIEW_STEP.INITIAL),W(null===(t=me.current)||void 0===t?void 0:t.activeTool)},[null===(t=me.current)||void 0===t?void 0:t.activeTool]);const Ie=(0,h.useMemo)(()=>{var e,t;return((e,t,i,o,a,n,r)=>{if(!e)return 0;if(!t)return 230;if(t===E.EditPhotoToolTypes.BACKGROUND_REMOVER)return 300;if(t===E.EditPhotoToolTypes.MAGIC_EXPAND){const e=parseInt(r,10);return e===E.SCREEN_VIEW_STEP.MID?300:e===E.SCREEN_VIEW_STEP.FINAL?330:e===E.SCREEN_VIEW_STEP.LAST?380:250}return i?i===Ke?290:i===Ze?330:i===We?380:300:null!==o&&void 0!==o&&o.length||null!==a&&void 0!==a&&a.length?270:n?260:210})(j,Z,le,null===(e=me.current)||void 0===e?void 0:e.generativeFillResults,null===(t=me.current)||void 0===t?void 0:t.magicRemoveResults,de,he)},[le,Z,de,j,he]);if(!L.isOpen||L.id!==u)return null;const Le=e=>{var t,i;const o=(0,E.getRedirectBaseURL)(),a=new URLSearchParams({redirect:`${null===pe||void 0===pe?void 0:pe.pagePath}`,source:null===(t=me.current)||void 0===t||null===(i=t.activeEditPhotoImage)||void 0===i?void 0:i.getSrc()}).toString();window.location.replace(`${o}${e}?${a}`)};return(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsxs)(r.x,{position:C?"fixed":"absolute",inset:"0",zIndex:"modal",width:"100vw",height:"100vh",backgroundColor:"base_level_1",overflow:"hidden",children:[oe&&(0,Q.jsx)(yt,{activeTool:Z||"generic",t:y}),ee&&(0,Q.jsx)(q,{handlerRef:me,onClickStartOver:fe,onClickFinishEditPhoto:()=>{var e,t;if(0===me.current.editPhotoStep)return void we();ne(!0);const{canvas:i,activeEditPhotoImage:o,workarea:a}=me.current,n=new v.fabric.Group(i.getObjects());if(null!==(e=a.fill)&&void 0!==e&&null!==(t=e.src)&&void 0!==t&&t.includes("transparent")&&(a.fill=null),T){const e=n.toDataURL({...o.scaleX&&{multiplier:1/o.scaleX},format:"png"});ne(!1),o.set({eraser:null});const t=L.originalUrl;_((0,m.vs)({isOpen:!1,imageJSON:o.toJSON(S.aU),originalUrl:void 0})),me.current.interactionHandler.selection(),(0,E.analyticsTrackEvent)("finishEditPhoto"),T({data:e,name:"image.png",mimeType:"image/png"},t,L.customData)}else(0,H.aX)({obj:n,scale:o.scaleX,id:o.id},async(e,t)=>{const i=o.originalSrc||o.src;let a=!0;me.current.activeTool===E.EditPhotoToolTypes.MAGIC_EXPAND&&(a=!1),await(0,k.Oz)(o,e,a),o.assetId&&(0,H.Kv)(o.assetId),ne(!1),o.set({assetId:t,originalSrc:i,eraser:null}),_((0,m.vs)({isOpen:!1,imageJSON:o.toJSON(S.aU),originalUrl:void 0})),me.current.interactionHandler.selection(),(0,E.analyticsTrackEvent)("finishEditPhoto"),x&&x(e,"image/png")})},onClickCancelEditPhoto:we,onClickBack:ye,activeTool:Z,isSmallScreen:j}),(0,Q.jsxs)(c.k,{w:"100%",h:Ie?`calc(100% - 94px - ${Ie-50}px)`:"calc(100% - 94px)",justifyContent:"space-between",columnGap:"24px",padding:"24px",ref:ve,...j&&{flexDirection:"column"},children:[(0,Q.jsxs)(r.x,{w:"100%",h:"100%",bg:"base_level_2",borderRadius:"lg",position:"relative",margin:"auto",children:[(0,Q.jsx)("canvas",{id:"edit-photo"}),(0,Q.jsx)("canvas",{id:"cursor",style:{position:"absolute",inset:0,pointerEvents:"none",zIndex:1}})]}),j?(0,Q.jsx)(wt,{activeTool:Z,handlerRef:me,brushSize:$,onChangeBrushSize:Ee,blurAmount:J,onChangeBlurAmount:xe,onClickMainButton:je,generativeFillText:re,setGenerativeFillText:se,generativeFillResults:(null===(l=me.current)||void 0===l?void 0:l.generativeFillResults)||[],magicRemoveResults:(null===(d=me.current)||void 0===d?void 0:d.magicRemoveResults)||[],onClickBack:ye,activeReplaceBackgroun
1dType:le,setActiveReplaceBackgroundType:ce,isGenerativeFillFirstStepDone:de,setGenerativeFillFistStepDone:ue,drawerHeight:Ie,setIsFinishLoading:ne}):(0,Q.jsxs)(r.x,{width:"350px",minW:"350px",overflow:"auto",children:[pe&&null!==(i=me.current)&&void 0!==i&&i.activeToolStack[0]||!pe?(0,Q.jsx)(it,{activeTool:Z,onClickBack:ye,onClickTool:Te,onClickRemoveBackground:be,onClickCancelEditPhoto:we}):null,(0,Q.jsx)(bt,{activeTool:Z,handlerRef:me,brushSize:$,onChangeBrushSize:Ee,blurAmount:J,onChangeBlurAmount:xe,onClickMainButton:je,generativeFillText:re,setGenerativeFillText:se,generativeFillResults:(null===(o=me.current)||void 0===o?void 0:o.generativeFillResults)||[],magicRemoveResults:(null===(s=me.current)||void 0===s?void 0:s.magicRemoveResults)||[],activeReplaceBackgroundType:le,setActiveReplaceBackgroundType:ce,isGenerativeFillFirstStepDone:de,setGenerativeFillFistStepDone:ue,setIsFinishLoading:ne})]})]}),ee&&!j&&(0,Q.jsx)(ae,{handlerRef:me,zoomValue:V}),j&&(0,Q.jsx)(r.x,{width:"100%",height:`calc(100% - ${E.DEFAULT_NAVBAR_HEIGHT})`,position:"absolute",top:E.DEFAULT_NAVBAR_HEIGHT,display:Z?"none":"block",children:!Z&&(0,Q.jsx)(N.dys,{isOpen:!Z,onClose:we,showDrawerHeaderCloseButton:!1,drawerBodyChildren:(0,Q.jsx)(it,{activeTool:Z,onClickBack:ye,onClickTool:Te,onClickRemoveBackground:be,isSmallScreen:j,onClickCancelEditPhoto:we}),drawerHeaderProps:{bg:"base_level_3",borderTop:"1px solid",borderColor:"content_alpha_100",borderRadius:"8px 8px 0 0"},drawerBodyProps:{bgColor:"base_level_3"},drawerProps:{blockScrollOnMount:!1},drawerContentProps:{height:Ie}})})]}),z&&(0,Q.jsx)(N.yiy,{imageTextPrimary:y("modal.edit_photo",{ns:"common"}),imageTextSecondary:y("modal.tool",{ns:"common"}),image:jt.r1,onClose:()=>U(!1),children:(0,Q.jsx)(N.L44,{title:y("converter_heading",{ns:"tools"}),primaryButtonText:y("sign_in",{ns:"tools"}),secondaryButtonText:y("sign_up",{ns:"tools"}),onPrimaryAction:()=>Le(E.LOGIN),onSecondaryAction:()=>Le(E.REGISTER_PATH),routerType:E.ROUTER_VARIANT_TYPES.next,subtitle:y("edit_photo_lock_desc",{ns:"tools"}),featureList:[{icon:a.FaMoneyBillWave,title:y("edit_photo_feature_1",{ns:"tools"}),info:y("edit_photo_feature_1_desc",{ns:"tools"})},{icon:a.FaImages,title:y("edit_photo_feature_2",{ns:"tools"}),info:y("edit_photo_feature_2_desc",{ns:"tools"})},{icon:a.FaDraftingCompass,title:y("edit_photo_feature_3",{ns:"tools"}),info:y("edit_photo_feature_3_desc",{ns:"tools"})}]})})]})};var Lt=i(993372),Ft=i(569416),Ot=i(57439),Bt=i(858732);const Mt={position:"relative",display:"flex",alignItems:"center",justifyContent:"center",boxShadow:"sm",borderRadius:"lg",mb:20},Dt={bgGradient:"repeating-conic(#fff 0deg 90deg,#cccccc 0 180deg)",backgroundSize:"2rem 2rem"},Nt=()=>{var e;const{t:t,i18n:i}=(0,p.$)(["tools","common","accounts","billing","similar-tools","navbar","addons"]),b=(0,g.I0)(),w=(0,f.TH)(),R=(0,gt.k6)(),[k,y]=(0,x.Z)("editPhotoResult"),[j,A]=(0,x.Z)("editPhotoDownload"),{isAuthenticated:P}=(0,g.v9)(e=>e.auth),I=(0,g.v9)(e=>e.editor.editPhotoTool.isOpen),L=(0,n.S)({base:!0,md:!1}),[F,O]=(0,h.useState)(!1),[B,D]=(0,h.useState)(!1),[G,H]=(0,h.useState)(null),[z,U]=(0,h.useState)(null),[V,K]=(0,Ot.Z)("fromPath"),Z=(0,h.useMemo)(()=>{switch(w.pathname){case E.GENERATIVE_FILL_TOOL:return E.QuickToolsCreditsKeys.GENERATIVE_FILL;case E.ERASER_TOOL:return E.QuickToolsCreditsKeys.BACKGROUND_REMOVER;case E.MAGIC_REMOVE_TOOL:return E.QuickToolsCreditsKeys.MAGIC_REMOVE;case E.REPLACE_BACKGROUND_TOOL:return E.QuickToolsCreditsKeys.BACKGROUND_REMOVER;default:return null}},[w.pathname]),W=(0,E.useFetchCredits)(Z),$=(0,h.useMemo)(()=>new URLSearchParams(w.search),[w.search]),X=(0,h.useMemo)(()=>Ye.find(e=>e.pagePath===w.pathname),[w.pathname]),{uppy:J,uppyNote:Y}=(0,E.useGrowthToolFilePicker)({id:"edit-photo",restrictions:{maxFileSize:(0,E.getImageMaxSize)(),allowedFileTypes:(0,E.getImageAllowedFileTypes)()},t:t,i18next:i}),q=((0,E.getImageMaxSize)()/1048576).toFixed(0),ee=`${Y} ${t("file_size",{ns:"tools",maxSize:q,unit:t("mb",{ns:"common"})})}`,te=(0,h.useCallback)(e=>{v.fabric.Image.fromURL(e,e=>{e.type===E.FABRIC_IMAGE_ELEMENT&&b((0,m.vs)({isOpen:!0,imageJSON:e.toJSON(S.aU)}))})},[b]),ie=(0,h.useCallback)(()=>{te(z||G)},[z,G,te]),oe=(0,h.useCallback)(()=>{P?((0,u.saveAs)(z,"simplified.png"),(0,N.CFj)({description:t("downloading_progress"),title:t("downloading"),status:"success"}),(0,E.analyticsTrackEvent)("gt.imageDownloaded")):(O(!0),A("trigger"))},[O,A,P,z,t]),ae=(0,h.useCallback)(()=>{H(null),U(null),y(null)},[H,U,y]);(0,h.useCallback)(()=>{b((0,At.HJ)({addonCategory:E.AddonCategories.COIN,product:E.PRODUCTS.DESIGN,addonType:E.ONE_TIME_ADDON,hideToggleSwitch:!0}))},[b]);(0,h.useEffect)(()=>
1{if($&&$.get("source")){K($.get("from")),H($.get("source"));const e=encodeURI($.get("source"));(0,E.updateAddressBarUrl)(R.location.pathname);const t=setTimeout(()=>{te(e)},300);return()=>clearTimeout(t)}},[$,H,te]),(0,h.useEffect)(()=>{const e=e=>{e.length&&D(!0)},i=()=>{J.getFiles().length||D(!1)},o=e=>{J.removeFile(e.id),H(e.meta.uploadedAssetUrl),te(e.meta.uploadedAssetUrl)},a=e=>{J.removeFile(e.id)},n=()=>{const{info:e}=J.getState(),i=[...e].pop();null!==i&&void 0!==i&&i.message&&["error","warning"].includes(i.type)&&(0,N.CFj)({description:i.message,title:t("error",{ns:"common"}),status:"error"})};return J.on("files-added",e).on("file-removed",i).on("upload-success",o).on("upload-error",a).on("info-visible",n),()=>{J.off("files-added",e).off("file-removed",i).off("upload-success",o).off("upload-error",a).off("info-visible",n)}},[J]),(0,h.useEffect)(()=>{P?(localStorage.removeItem("path"),"trigger"===j&&((0,E.triggerDownload)(k),A(null),(0,E.analyticsTrackEvent)("gt.imageDownloaded"))):localStorage.setItem("path",w.pathname)},[P]),(0,h.useEffect)(()=>{k&&U(k)},[]),(0,E.useWillUnmount)(()=>{b((0,m.vs)({isOpen:!1,imageJSON:null}))});const ne=[{icon:a.FaPenAlt,label:t("edit_photo"),onClick:ie,isDisabled:!z&&!G,ariaLabel:"edit",variant:"solid",px:L?void 0:8,leftIcon:!L&&(0,Q.jsx)(a.FaPencilAlt,{})},{icon:a.FaDownload,label:t("download",{ns:"common"}),onClick:oe,isDisabled:!z,ariaLabel:"download",variant:L?"ghost":void 0,px:L?void 0:8,leftIcon:!L&&(0,Q.jsx)(a.FaDownload,{})}],re=[{onClick:ae,label:t("reset",{ns:"common"}),ariaLabel:"reset",icon:a.FaSyncAlt,variant:"ghost",isDisabled:B||!(z||G)}],[se,le]=(0,h.useState)(null),ce=(de=null===X||void 0===X?void 0:X.titleKey,Je.hasOwnProperty(de)?Je[de]:E.EditPhotoToolTypes.ERASER);var de;return(0,h.useEffect)(()=>((async()=>{try{const e=await(0,M.iW0)(ce);le(e.data)}catch(e){le(e.toString())}})(),()=>{}),[ce,le]),(0,Q.jsxs)(Q.Fragment,{children:[(null===se||void 0===se||null===(e=se.seo)||void 0===e?void 0:e.length)>0&&(0,Q.jsx)(Bt.b,{asPath:w.pathname,pageSEOResData:se}),(0,Q.jsx)(r.x,{display:I?"none":"contents",children:(0,Q.jsx)(Ft.A,{showSidebar:!1,showHelpIcon:!1,customNavbar:(0,Q.jsx)(o.Z,{title:t((null===X||void 0===X?void 0:X.titleKey)||"eraser"),icon:null!==X&&void 0!==X&&X.PageNavIcon?(0,Q.jsx)(X.PageNavIcon,{}):(0,Q.jsx)(Q.Fragment,{}),iconBackground:"common.red_berry",showBackButton:P,fromPath:V,setFromPath:K,showQuickToolQuota:E.FeatureCodes.COIN}),showHeaderFooter:!0,parentContainerProps:{overflow:I?"auto":"visible"},sidebarContainerProps:{overflow:void 0},bgColor:"base_level_2",children:(0,Q.jsxs)(N.kts,{t:t,onSimilarToolsCardClick:e=>{(0,E.navigateToRoute)(e)},headingColor:"content_active",cmsContentData:se,currentToolKey:(null===X||void 0===X?void 0:X.pageTitleKey)||"eraser",isAuthenticated:P,children:[(0,Q.jsx)(N.JBs,{quickButtons:!L&&(0,Q.jsx)(Q.Fragment,{children:(0,Q.jsx)(s.h,{icon:(0,Q.jsx)(a.FaSyncAlt,{}),onClick:ae,isRound:!0,isDisabled:B||!(z||G),bg:"base_level_3"})}),asideButtons:(z||G)&&(0,Q.jsx)(N.q$D,{primaryOptions:ne}),generationCostInfo:(0,Q.jsx)(N._Og,{creditsData:W,t:t}),children:(0,Q.jsx)(r.x,{sx:Mt,children:z||G?(0,Q.jsxs)(r.x,{flex:"1",position:"relative",backgroundColor:"base_level_1",borderRadius:"lg",children:[(0,Q.jsx)(l.o,{ratio:7/4,children:(0,Q.jsx)(c.k,{alignItems:"center",justifyContent:"center",children:(0,Q.jsx)(d.E,{src:z||G,sx:z?{...Dt}:{},maxWidth:"full",maxHeight:"full",width:"auto",height:"auto"})})}),B&&(0,Q.jsx)(T.Z,{children:(0,Q.jsx)(C.Z,{})})]}):(0,Q.jsx)(r.x,{flex:"1",backgroundColor:L?"base_level_2":"base_alpha_200",borderRadius:"lg",children:(0,Q.jsx)(l.o,{ratio:L?4/3:2.5,children:J&&Y?(0,Q.jsx)(_.Z,{uppy:J,note:ee,isLoading:B}):(0,Q.jsx)(T.Z,{children:(0,Q.jsx)(C.Z,{})})})})})}),(G||z)&&(0,Q.jsx)(N.Nu,{actionButtons:(0,Q.jsx)(N.q$D,{primaryOptions:ne,resetOptions:re})})]})})}),F&&(0,Q.jsx)(N.XLS,{t:t,imageTextPrimary:t("modal.eraser",{ns:"common"}),imageTextSecondary:t("modal.tool",{ns:"common"}),image:jt.r1,onHide:()=>O(!1),isSignupView:!0,title:t("converter_heading"),subtitle:t("eraser_lock_desc"),featureList:[{icon:a.FaMoneyBillWave,title:t("eraser_feature_1"),info:t("eraser_feature_1_desc")},{icon:a.FaImages,title:t("eraser_feature_2"),info:t("eraser_feature_2_desc")},{icon:a.FaDraftingCompass,title:t("eraser_feature_3"),info:t("eraser_feature_3_desc")}],onViewPlansHandler:()=>{b((0,At.$$)({product:E.PRODUCTS.DESIGN})),O(!1)}}),(0,Q.jsx)(Lt.Z,{}),(0,Q.jsx)(It,{onFinish:async e=>{U(e),y(e),b((0,Pt.oJ)(E.FeatureCodes.COIN))}})]})}}}]);
2//# sourceMappingURL=9801.9f2794bb.chunk.js.map

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.