PageSourceSearch

https://deep-image.ai/app/assets/ToolVirtualStaging-C5hJoBYc.js

js deep-image.ai collected 2026-09-25 14:08:17 UTC 11,047 bytes, 1 lines download raw bytes

1import{r as s,ct as ge,cu as $,j as e,h as me,n as ee,Q as he,he as pe,bh as S,dk as fe,dl as _e,k as K,e7 as Te,a_ as M,eI as V,cJ as U,cG as be,aO as xe,aN as H,a8 as w,cR as ye,R as te,hm as Ie,cV as ke,aK as Se,e8 as Ae}from"./index-DHT8ocXi.js";import{Z as ve,a9 as se,ad as je,aw as Ee,aa as q,aB as Re,aC as Ce,av as Oe,ba as Le,M as we,b1 as Ge,bb as Ne,b7 as Me,U as Ve,V as Pe,aI as Be,b2 as Je,k as P,m as B,l as Z,bc as Ue,a$ as He,aD as X,aq as Fe,as as We,bd as De,be as Qe,bf as ze,W as R,a3 as v,K as Ye,G as $e,aN as Ke,af as qe,ah as Ze}from"./RerollBtn-BPahoQdf.js";import{k as Xe,l as et,m as tt,J as F,B as st,j as L,q as at,W as it,D as ot}from"./routes-B59S94UY.js";import"./_baseClone-CLcwX-rf.js";import"./useHandlePaymentModalGA4Events-D4ZazDL-.js";const J=tt("Virtualstaging"),rt=({onPromptSelect:t,job:o})=>{const[n,a]=ve("visual-staging-prompt-id",null),f=n===L.id,_=s.useRef(!1),{data:l}=Xe("Virtualstaging"),g=et(l),m=se(),b=s.useCallback(r=>{const I=ge(J,"");let d,c=F(o)||I;if(_.current=c||!0,c=c&&String(c),c){const y=st.findBestMatch(c,r.map(({description:C})=>C));y.bestMatch.rating>.6?(d=r[y.bestMatchIndex],a(d.id)):($(J,c),d={...L,description:c},a(L.id))}d||(d=r.find(y=>y._id===n)),d?(m("setBackgroundGenerateOptions",{description:d?.description}),t&&t(d)):(a(null),t&&t(d))},[m,o,t,n,a]);s.useEffect(()=>{if(g&&g.length&&(!_.current||o&&_.current!==(F(o)||!0)))return b(g)},[g,o,b]);const x=r=>{const I=r.id===L.id;I||(m("setBackgroundGenerateOptions",{description:r.description}),r.group&&$(J,r.description)),f||(a(r._id),t&&t(r)),!I&&setTimeout(function(){window.scrollTo({top:0,behavior:"smooth"})},0)},j=()=>{m("setBackgroundGenerateOptions",{description:""}),t&&t(),a(null)};return e.jsx(at.Categories,{showFilter:!0,enableCustomPrompt:!0,selectedExampleId:n||void 0,examples:g,onSelect:x,onUnselect:j})},nt="tool-virtual-staging-editor-cache-key",lt={pointerEvents:"none"},ct={position:"absolute",pointerEvents:"none",fontWeight:500,fontSize:16,color:"white",bottom:16,height:"fit-content"},ut={height:"fit-content",background:"rgba(65,65,65,0.8)",filter:"drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25))",padding:12,lineHeight:1,borderRadius:8},dt={top:8,right:8,boxShadow:"0px 0px 8px 2px black"},gt={initial:{y:"150%"},animate:{y:0},exit:{y:"150%"}},mt=()=>{const{i18n:t}=me(),{hash:o}=ee(),n=he(),[a,f]=s.useState(),_=pe(S.TOOL_VIRTUAL_STAGING),{imageQuery:l,user:g}=Ee(S.TOOL_VIRTUAL_STAGING,!o),m=q(u=>u.isSendingRequest),b=se(),[x,j]=s.useState(),[r,I]=s.useState(!1),{mutateAsync:d,isLoading:c}=fe(a?.id||"",a?.app||""),y=q(u=>u.request.background.generate.description),C=s.useCallback(u=>{j(u)},[]),W=s.useCallback(()=>I(!0),[]),D=s.useCallback(()=>I(!1),[]),O=s.useMemo(()=>({shouldShowMaskHint:!x&&!r,isImageQueryValid:!l.isLoading&&l.data?.length}),[x,r,l.isLoading,l.data?.length]);s.useEffect(()=>{!a&&O.isImageQueryValid&&f(l.data?.[0])},[a,l.data,O.isImageQueryValid]),s.useEffect(()=>{b("setBackgroundGenerateOptions",{model_type:_e.QWEN})},[b]);const G=s.useCallback(()=>{f(void 0),E(void 0),n.replace(K(Te,t.language))},[n,t.language]),Q=s.useCallback(async()=>{await d(),G()},[d,G]);s.useEffect(()=>{if(o)return E(o),()=>{M.removeQueries(V.key(S.TOOL_VIRTUAL_STAGING))}},[]);const[h,E]=s.useState(),T=U(h),i=T.data,p=Re(i);Ce(p,T.isRefetching,T.refetch,i);const k=!!h&&(T.isLoading||T.isRefetching||!p.isCompleted&&!T.isError&&!!i||m)||l.isLoading&&l.fetchStatus!=="idle",[z,oe]=s.useState(),re=!!i?.has_children&&!z&&o,ne=ht({hide:!i?.relations?.parent&&!z,jobHash:h,setJobHash:E,setHasPrevJob:oe});s.useEffect(()=>{if(h&&i&&!y){const u=F(i);u&&b("setBackgroundGenerateDescription",u)}},[y,b,i,h]),s.useEffect(()=>{const u=M.getQueryData(V.key(S.TOOL_VIRTUAL_STAGING))?.[0],N=!!i?.storage_source&&u?.img_url!==i?.storage_source,Y=!!i?.result?.result_url&&u?.img_url!==i?.result?.result_url;if(N||Y){const de=Oe(i,S.TOOL_VIRTUAL_STAGING,{resultUrl:Y});f(de?.[0]||void 0)}},[b,i]);const le=s.useCallback(u=>{n.replace(K(be(u,Ae),t.language)),E(u)},[n,t.language]),A=s.useMemo(()=>{const u=i?.is_failed&&i.relations?.parent||h,N=i?.data?.background?.generate?.ip_image2||void 0;return{parentJobHash:u,maskImg:N}},[i,h]);s.useEffect(()=>{if(o)return E(o),()=>{M.removeQueries(V.key(S.TOOL_VIRTUAL_STAGING))}},[]),h&&T.isSuccess&&!T.data&&G();const ce=s.useMemo(()=>({enabled:!0,onMasksChange:C,initialMaskUrl:A.maskImg||void 0,initialIsMaskVisible:!h,onDrawStart:W,onDrawStop:D}),[C,A.maskImg,h,W,D]),ue=s.useMemo(()=>
1{if(a)return{initialHeight:a.metadata.height,initialWidth:a.metadata.width,bgImage:a.img_url,wrapperChildren:e.jsxs(e.Fragment,{children:[e.jsx(xe,{children:O.shouldShowMaskHint&&e.jsx("div",{style:lt,className:"position-absolute h-100 w-100 overflow-hidden d-flex justify-content-center",children:e.jsx(H.div,{...gt,style:ct,children:e.jsx("div",{className:"d-flex gap-3",style:ut,children:e.jsxs(e.Fragment,{children:[t.t("tools.virtual_staging.draw_area"),e.jsx(Le,{})]})})})})}),A.maskImg&&k&&!m?e.jsx(pt,{maskImg:A.maskImg}):null,e.jsx(w,{onClick:Q,disabled:c,icon:e.jsx(ye,{size:20}),variant:"tertiary",sizeVariant:"shorter",roundedVariant:"full",className:"position-absolute",style:dt})]})}},[a,O.shouldShowMaskHint,A.maskImg,k,m,Q,c,t]);return e.jsx(e.Fragment,{children:e.jsxs(we,{children:[e.jsx(Ge,{}),h?null:e.jsx(Ne,{children:e.jsx(Me,{postSlug:_.ghostBlogSlug})}),e.jsxs(Ve,{disabled:k,className:k?"tools-container--waiting":void 0,children:[(!o||!g)&&e.jsx(Pe,{h1:t.t("tools.virtual_staging.title"),h2:t.t("tools.virtual_staging.main_h2")}),e.jsx(Be,{}),e.jsx(Je.Error,{}),l.isError||T.isError?e.jsx(P,{type:Z.ERROR,variant:B.ERROR.WHITE_ON_TERTIARY,title:t.t("application.error_message.general"),children:null}):i?.is_failed?e.jsx(P,{type:Z.ERROR,variant:B.ERROR.WHITE_ON_TERTIARY,title:i.error_message??t.t("application.error_message.transform_part_1"),children:i.error_message?null:e.jsxs(e.Fragment,{children:[t.t("application.error_message.transform_part_2")," ",t.t("application.error_message.transform_part_3")]})}):!i&&T.isSuccess?e.jsx(P,{variant:B.INFO.GRAY,title:t.t("details.not_found"),children:null}):null,e.jsx(Ue,{jobState:p}),e.jsx(He,{isLoading:p.isProcessing||m?!1:k,children:i&&re?e.jsx(X,{imgThumbnail:i?.thumbnail_url,imgSource:p.imgSource,imgResult:p.imgResult,imageWidth:p.imgSourceWidth,imageHeight:p.imgSourceHeight,jobHash:i.hash,isCompleted:p.isCompleted,isLoading:k,hasResult:!!i.result}):l.isError||T.isError?e.jsx(X,{isCompleted:!0,isLoading:!1,hasResult:!1}):!l.data?.length&&!a&&!o||!g?e.jsx(Fe,{type:"image",title:t.t("tools.uploader_title"),imageApp:S.TOOL_VIRTUAL_STAGING,enableClipboardUpload:!0,clipboardUploadMaxFiles:1,footer:e.jsx(We,{variant:"inline",app:S.TOOL_VIRTUAL_STAGING})}):!!a&&e.jsx(ot,{isLoading:A.maskImg?!1:k,disabled:k,cacheKey:nt,buttonsBottom:e.jsx(ae,{JobsNavigation:ne,job:i,jobHash:h,jobState:p}),masking:ce,history:{showControls:!0,hideArrows:!0},stage:ue},a.img_url+A.maskImg)}),e.jsx(De,{jobState:p}),e.jsx(Qe,{jobState:p}),e.jsx(ze,{jobState:p}),e.jsx(ie,{job:i,masks:x,jobComputedValues:A,description:y,isLoading:k,hash:o,historyPushFunc:le,i18n:t}),e.jsx(rt,{job:i}),e.jsxs(R,{children:[e.jsx(R.Header,{children:"Virtual Staging AI – Transform Your Property Listings with AI-Powered Home Staging"}),e.jsx(R.Paragraph,{children:"Looking to enhance your real estate listings? Our AI-powered virtual staging tool helps you transform any space effortlessly. With just a few clicks, you can add or remove furniture, refine room aesthetics, and create stunning, photorealistic designs tailored to your buyers' preferences."}),e.jsx(R.Paragraph,{children:"AI Room Transformation: Instantly stage interiors and exteriors with our intuitive virtual home staging software. Cost-Effective & Fast: Unlike traditional staging, virtual staging is affordable and delivers results in minutes. Multiple Design Options: Create multiple interior visualizations, from modern minimalism to luxurious, high-end styles."}),e.jsx(R.Paragraph,{children:"Whether you're a real estate agent, photographer, or homeowner, virtual staging for real estate makes it easy to showcase the full potential of any property. Try it today and bring your listings to life with AI-powered staging!"})]})]})]})})},ae=te.memo(({JobsNavigation:t,job:o,jobHash:n,jobState:a})=>e.jsxs(e.Fragment,{children:[t,!!o?.result&&e.jsx(w,{variant:"tertiary",disabled:!n,style:{order:10},icon:e.jsx(Ie,{size:20}),onClick:()=>{Ye($e([n])).then()},sizeVariant:"short"}),a.imgSource&&a.imgResult&&e.jsx("div",{style:{order:9},children:e.jsx(Ke,{asButton:!0,imageBefore:a.imgSource,imageAfter:a.imgResult,imageWidth:a.imgSourceW
1idth,imageHeight:a.imgSourceHeight})})]}));ae.displayName="ButtonsBottomContent";const ie=te.memo(({job:t,masks:o,jobComputedValues:n,description:a,isLoading:f,hash:_,historyPushFunc:l,i18n:g})=>{const m=s.useMemo(()=>({parent_job_hash:n.parentJobHash,min_length:1024,background:{generate:{adapter_type:ke.INPAINTING,ip_image2:o?.imageDataUrl,blending_mask_blur_size:103}}}),[n.parentJobHash,o?.imageDataUrl]);return e.jsx(qe,{children:e.jsx("div",{className:"d-flex gap-4 justify-content-center",style:{flex:1},children:e.jsx(Ze,{mandatoryFields:["background.generate.description"],disabled:!o||f,keepImage:!!_,overrideProcessRequest:m,leftIcon:e.jsx(Se,{size:24}),text:g.t("tools.virtual_staging.inpaint"),historyPushFunc:l})})})});ie.displayName="ActionButtonsSection";const ht=({jobHash:t,setJobHash:o,setHasPrevJob:n,hide:a})=>{const[f,_]=s.useState([]),{hash:l}=ee(),g=U(t),m=c=>_(y=>[...y,c]),b=()=>_(c=>c.slice(0,-1)),x=s.useCallback(()=>f[f.length-1],[f]),j=()=>_([]),[r,I]=s.useState(),d=U(r);return s.useLayoutEffect(()=>{n(x())},[x,n]),s.useEffect(()=>{const c=g.data?.relations?.parent;c!==r&&I(c)},[g.data?.relations?.parent,r]),s.useEffect(()=>{j()},[l]),!l||a?null:e.jsxs(e.Fragment,{children:[e.jsx(w,{style:{order:-2},disabled:!d.data||!r||!t,onClick:()=>{m(t),o(r)},icon:"<-",sizeVariant:"short"}),e.jsx(w,{style:{order:-1},disabled:!x(),onClick:()=>{o(x()),b()},icon:"->",sizeVariant:"short"})]})},yt=je(it(mt,S.TOOL_VIRTUAL_STAGING),{cacheKey:"enhance-tool-virtual-staging-context-state",cacheWhitelist:["request.background.generate.model_type"]}),pt=({maskImg:t})=>e.jsx(H.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{duration:.3,ease:"easeIn"},style:{position:"absolute",width:"100%",height:"100%",overflow:"hidden"},children:e.jsx(H.div,{style:{position:"absolute",width:"100%",height:"100%",maskImage:`url(${t})`,WebkitMaskImage:`url(${t})`,maskSize:"cover",WebkitMaskSize:"cover",opacity:.85},animate:{background:[`linear-gradient(0deg, ${v.colorSecondary} 0%, ${v.colorTertiary} 100%)`,`linear-gradient(180deg, ${v.colorBlueLight} 0%, ${v.colorSecondary} 100%)`,`linear-gradient(270deg, ${v.colorTertiary} 0%, ${v.colorBlueLight} 100%)`,`linear-gradient(360deg, ${v.colorSecondary} 0%, ${v.colorTertiary} 100%)`],scale:[1,1.02,1],filter:["hue-rotate(0deg)","hue-rotate(180deg)","hue-rotate(360deg)"]},transition:{duration:6,repeat:1/0,ease:"linear"}})});export{yt as default};

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.