PageSourceSearch

https://assets.nomi.ai/_next/static/chunks/pages/nomis/[nomiId]/me…/[mediaItemUuid]/edit-8511bd0b0235aa54.js

js nomi.ai collected 2026-10-01 13:54:38 UTC 23,861 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="00455620-1085-45fc-9abe-eabd4771492b",e._sentryDebugIdIdentifier="sentry-dbid-00455620-1085-45fc-9abe-eabd4771492b")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5263],{3844:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(20648).A)("outline","photo","Photo",[["path",{d:"M15 8h.01",key:"svg-0"}],["path",{d:"M3 6a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3v-12",key:"svg-1"}],["path",{d:"M3 16l5 -5c.928 -.893 2.072 -.893 3 0l5 5",key:"svg-2"}],["path",{d:"M14 14l1 -1c.928 -.893 2.072 -.893 3 0l3 3",key:"svg-3"}]])},13658:(e,t,r)=>{"use strict";r.d(t,{$:()=>l});var i=r(86695),a=r(95515),n=r(61632),o=r(26514);let l=(0,a.P9)(e=>{let{w:t,h:r,miw:a,mih:l,...d}=(0,i.Y)("Space",null,e);return(0,o.jsx)(n.a,{...d,w:t,miw:a??t,h:r,mih:l??r})});l.displayName="@mantine/core/Space"},16871:(e,t,r)=>{"use strict";r.d(t,{v:()=>n});var i=r(46225),a=r(75834);function n(e){var t=(0,i.useRouter)();return(0,a.useCallback)(function(){if(window.history.length>1)return void t.back();t.replace(e)},[e,t])}},22035:(e,t,r)=>{"use strict";r.d(t,{C:()=>b});var i=r(34850),a=r(57715),n=r(11107),o=r(79303),l=r(35527),d=r(21923),s=r(86695),c=r(31372),u=r(95515),m=r(61632),h={root:"m_e5262200",indicator:"m_760d1fb1",processing:"m_885901b1"},p=r(26514);let g={position:"top-end",offset:0,showZero:!0},f=(0,n.V)((e,{color:t,position:r,offset:n,size:s,radius:c,zIndex:u,autoContrast:m})=>({root:{"--indicator-color":t?(0,o.r)(t,e):void 0,"--indicator-text-color":(0,d.v)(m,e)?(0,l.w5)({color:t,theme:e,autoContrast:m}):void 0,"--indicator-size":(0,i.D)(s),"--indicator-radius":void 0===c?void 0:(0,a.nJ)(c),"--indicator-z-index":u?.toString(),...function(e="top-end",t=0){let r={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},a="number"==typeof t?t:t.x,n="number"==typeof t?t:t.y,o=(0,i.D)(a),l=(0,i.D)(n),[d,s]=e.split("-");return"top"===d&&(r["--indicator-top"]=l,r["--indicator-translate-y"]="-50%"),"middle"===d&&(r["--indicator-top"]="50%",r["--indicator-translate-y"]="-50%"),"bottom"===d&&(r["--indicator-bottom"]=l,r["--indicator-translate-y"]="50%"),"start"===s&&(r["--indicator-left"]=o,r["--indicator-translate-x"]="-50%"),"center"===s&&(r["--indicator-left"]="50%",r["--indicator-translate-x"]="-50%"),"end"===s&&(r["--indicator-right"]=o,r["--indicator-translate-x"]="50%"),r}(r,n)}})),b=(0,u.P9)(e=>{let t=(0,s.Y)("Indicator",g,e),{classNames:r,className:i,style:a,styles:n,unstyled:o,vars:l,children:d,position:u,offset:b,inline:v,label:y,radius:w,color:Y,withBorder:E,disabled:I,processing:k,zIndex:x,autoContrast:A,maxValue:P,showZero:F,mod:D,attributes:M,..._}=t,C=(0,c.I)({name:"Indicator",classes:h,props:t,className:i,style:a,classNames:r,styles:n,unstyled:o,attributes:M,vars:l,varsResolver:f}),T=!F&&(0===y||"0"===y),q=void 0!==P&&"number"==typeof y&&y>P?`${P}+`:y;return(0,p.jsxs)(m.a,{...C("root"),mod:[{inline:v},D],..._,children:[!I&&!T&&(0,p.jsx)(m.a,{mod:{"with-label":!!y,"with-border":E,processing:k},...C("indicator"),children:q}),d]})});b.classes=h,b.varsResolver=f,b.displayName="@mantine/core/Indicator"},22338:(e,t,r)=>{"use strict";r.d(t,{A:()=>g});var i=r(26811),a=r(5567),n=r(38117),o=r(17384),l=r(24322),d=r.n(l),s=r(96456),c=r.n(s),u=r(53690),m=r(74913),h=r.n(m),p=r(16871);let g=function(e){var t=e.header,r=e.children,l=e.title,s=e.chatName,m=e.backHref,g=e.backBehavior,f=e.nomi,b=e.user,v=e.audioElementRef,y=e.footer,w=e.bodyElemRef,Y=(0,p.v)(m);return(0,i.FD)("div",{className:h().root,children:[(0,i.Y)(d(),{children:(0,i.Y)("title",{children:"".concat(l," | ").concat(s," | Nomi.ai")})}),(0,i.FD)("header",{className:h().header,children:["history"===(void 0===g?"link":g)?(0,i.Y)(a.M,{color:"bright",variant:"transparent","aria-label":"Go back",onClick:Y,children:(0,i.Y)(o.A,{size:24})}):(0,i.Y)(a.M,{color:"bright",variant:"transparent",component:c(),"aria-label":"Go back",href:m,children:(0,i.Y)(o.A,{size:24})}),t,f&&b&&v&&(0,i.Y)(n.s,{align:"center",display:{base:"block",md:"none"},children:(0,i.Y)(u.A,{nomi:f,user:b,audioElementRef:v})})]}),(0,i.Y)("main",{ref:w,className:h().body,children:r}),y&&(0,i.Y)("footer",{className:h().footer,children:y})]})}},24204:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(20648).A)("outline","phone-call","PhoneCall",[["path",{d:"M5 4h4l2 5l-2.5 1.5a11 11 0 0 0 5 5l1.5 -2.5l5 2v4a2 2 0 0 1 -2 2a16 16 0 0 1 -15 -15a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M15 7a2 2 0 0 1 2 2",key:"svg-1"}],["path",{d:"M15 3a6 6 0 0 1 6 6",key:"svg-2"}]])},36888:(e,t,r)=>{"use strict";function i(e,t){return t?"".concat(e,' Blocked term: "').concat(t,'".'):e}r.d(t,{M:()=>i})},41781:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(20648).A)("outline","video","Video",[["path",{d:"M15 10l4.553 -2.276a1 1 0 0 1 1.447 .894v6.764a1 1 0 0 1 -1.447 .894l-4.553 -2.276v-4",key:"svg-0"}],["path",{d:"M3 8a2 2 0 0 1 2 -2h8a2 2 0 0 1 2 2v8a2 2 0 0 1 -2 2h-8a2 2 0 0 1 -2 -2l0 -8",key:"svg-1"}]])},48649:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(20648).A)("outline","palette","Palette",[["path",{d:"M12 21a9 9 0 0 1 0 -18c4.97 0 9 3.582 9 8c0 1.06 -.474 2.078 -1.318 2.828c-.844 .75 -1.989 1.172 -3.182 1.172h-2.5a2 2 0 0 0 -1 3.75a1.3 1.3 0 0 1 -1 2.25",key:"svg-0"}],["path",{d:"M7.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M11.5 7.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}],["path",{d:"M15.5 10.5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-3"}]])},57980:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>em});var i=r(26811),a=r(76547),n=r(11488),o=r(38117),l=r(86861),d=r(23575),s=r(33989),c=r(5499),u=r(96456),m=r.n(u),h=r(46225),p=r(39128),g=r(98398),f=r(24742),b=r(99742),v=r(22338),y=r(36185),w=r(2530),Y=r(17862),E=r(70324),I=r(61632),k=r(46878),x=r(85361),A=r(20787),P=r(42762),F=r(23495),D=r(8951),M=r(50930),_=r(35362),C=r(96953),T=r(61790),q=r(85398),S=r(14063),z=r(75834),R=r(96675),B=r(38431),N=r(37669),U=r(11283),H=r(51569),V=r(36888),O=r(35269),W=r(76315),K=r(25407);let j=function(e){var t=e.label,r=e.referenceSrc,a=e.imageMaxWidth,o=e.imageMaxHeight;return(0,i.FD)("div",{style:{position:"relative"},role:"status","aria-live":"polite","aria-busy":"true",children:[r?(0,i.Y)(k._,{mx:"auto",w:"100%",maw:a,mah:o,fit:"contain",radius:"md",src:r,alt:"",style:{filter:"blur(2px)",opacity:.2}}):(0,i.Y)(x.t,{withBorder:!0,radius:"md",p:"md",w:"100%",maw:a,children:(0,i.Y)(n.o,{h:260})}),(0,i.Y)(n.o,{style:{position:"absolute",top:0,right:0,bottom:0,left:0},children:(0,i.FD)(A.B,{gap:"xs",align:"center",children:[(0,i.Y)(P.a,{size:"sm",type:"oval-dots"}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:t})]})})]})};var L=r(85784),G=r(83163),$=r(76267),Q=r(56555),X=r.n(Q);let J=function(e){var t,r=e.imageIndex,a=e.setImageIndex,d=e.items,s=e.user,c=e.nomi,u=e.mediaTags;if(null===r)return null;var m=d[r];if(!m)throw Error("Missing image comparison item at index ".concat(r));return m.mediaItem&&u?(0,i.Y)($.A,{mediaItem:m.mediaItem,mediaTags:u,nomi:c,onBackClick:function(){return a(null)},onNextClick:function(){a(function(e){var t;return null!==e&&1!==e&&(null==(t=d[1])?void 0:t.mediaItem)?1:e})},onPrevClick:function(){a(function(e){return null===e||0===e?e:0})},disableNextArrow:1===r||!(null==(t=d[1])?void 0:t.mediaItem),disablePrevArrow:0===r,trackingSource:"photo-album",user:s,viewInAlbumUrl:m.viewInAlbumUrl}):(0,i.Y)(L.a,{opened:!0,onClose:function(){return a(null)},withCloseButton:!0,title:(0,i.Y)(G.s,{children:"Edited image comparison viewer"}),closeButtonProps:{"aria-label":"Close image comparison viewer"},fullScreen:!0,classNames:{header:X().header,content:X().content,body:X().body},children:(0,i.FD)(o.s,{direction:"column",gap:"md",h:"100%",children:[(0,i.Y)(l.E,{ta:"center",c:"dimmed",fw:600,children:m.label}),(0,i.Y)(n.o,{flex:1,children:(0,i.FD)(o.s,{direction:"column",align:"center",gap:"md",children:[m.src&&(0,i.Y)(k._,{src:m.src,alt:"".concat(m.label," image"),style:{maxHeight:"60dvh",objectFit:"contain"}}),(0,i.Y)(P.a,{size:"sm",type:"oval-dots"}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:"Loading image actions..."})]})})]})})};var Z=r(39894),ee=r(79470),et=r(92036);let er=function(e){var t=e.setPrompt,r=e.promptElem,n=(0,Y._)((0,z.useState)(!1),2),o=n[0],d=n[1],s=(0,z.useId)();return(0,i.FD)("div",{children:[(0,i.FD)(A.B,{gap:4,mb:8,children:[(0,i.Y)(a.h,{order:5,children:"Instructions"}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",children:'Use natural language to de
1scribe both what to change and what to preserve (e.g., "change the dress color to red while keeping the pattern"). Be specific about the target element - detailed, multi-step instructions work better than short generic ones.'})]}),!o&&(0,i.Y)(Z.M,{component:"button",type:"button",onClick:function(){return d(!0)},fw:"bold","aria-controls":s,"aria-expanded":o,children:"See examples"}),(0,i.Y)(ee.S,{expanded:o,id:s,children:(0,i.FD)(A.B,{gap:"sm",children:[(0,i.Y)(l.E,{size:"lg",fw:"bold",children:"Examples:"}),(0,i.FD)(l.E,{children:["Make the image a charcoal sketch."," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Make the image a charcoal sketch."})]}),(0,i.FD)(l.E,{children:["Put the person on a beach with blue waves and a sunset"," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Put the person on a beach with blue waves and a sunset"})]}),(0,i.FD)(l.E,{children:["Give the person feather wings and make their hair white."," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Give the person feather wings and make their hair white"})]}),(0,i.FD)(l.E,{children:["Remove the text from the shirt"," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Remove the text from the shirt"})]}),(0,i.FD)(l.E,{children:["Turn into a demon"," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Turn into a demon"})]}),(0,i.FD)(l.E,{children:["Make the image more futuristic and the person goth"," ",(0,i.Y)(et.A,{promptElem:r,setPrompt:t,newPrompt:"Make the image more futuristic and the person goth"})]}),(0,i.Y)(Z.M,{fw:"bold",href:"https://nomi.ai/nomi-knowledge/guide-edit-and-transform-images-with-nomi/",target:"_blank",rel:"noreferrer",children:"For more examples and best practices, check out this guide"}),(0,i.Y)(Z.M,{component:"button",type:"button",onClick:function(){return d(!1)},fw:"bold","aria-controls":s,"aria-expanded":o,children:"Collapse Examples"})]})})]})};var ei=r(41348),ea=r(15631),en=r(8425),eo=(0,i.FD)(i.FK,{children:[(0,i.Y)("strong",{children:"Error: "}),"We can't process this prompt for image edits. Please try a different prompt."]});function el(e,t){return"loaded"===e.status?e.src:"loaded"===t.status?t.src:null}function ed(e,t){var r=new URLSearchParams({selectedMediaItemUuid:t,expanded:"1"});return"/nomis/".concat(e,"/photo-album?").concat(r.toString())}let es=function(e){var t,r,a=e.user,u=e.nomi,m=e.sourceMediaItem,h=(0,q.jE)(),p=(0,ei.A)(),f=(0,Y._)((0,z.useState)(null),2),b=f[0],v=f[1],L=(0,Y._)((0,z.useState)(null),2),G=L[0],$=L[1],Q=(0,Y._)((0,z.useState)(!1),2),X=Q[0],Z=Q[1],ee=(0,Y._)((0,z.useState)(null),2),et=ee[0],es=ee[1],ec=(0,T.U)("(max-width: ".concat(H.A.breakpoints.mdMax,"px)")),eu=(0,z.useRef)(null),em=(0,z.useRef)(null),eh=(0,z.useRef)(!1),ep=(0,z.useId)(),eg=g.Ay.getImageUrl(m.uuid,"webp"),ef=g.Ay.getImageUrl(m.uuid,"nl.webp"),eb=(0,K.S)(eg),ev=el((0,K.S)(ef),eb),ey=ev||"error"!==eb.status?null:eb.error,ew=(0,s.I)({queryKey:["imageEditRequests",b],queryFn:b?function(){return(0,y._)(function(){var e;return(0,E.YH)(this,function(t){switch(t.label){case 0:return[4,B.Ay.fetch(b)];case 1:if(!(e=t.sent()))throw Error("Image edit request ".concat(b," was not found"));return[2,e]}})})()}:c.hT,refetchInterval:function(e){var t,r=null==(t=e.state.data)?void 0:t.status;return!!b&&"Completed"!==r&&"Failed"!==r&&function(e){if(null===e)return 1500;var t=Date.now()-e,r=1500;t>=12e4?r=1e4:t>=3e4?r=6e3:t>=1e4&&(r=3e3);var i=.15*r;return Math.max(1e3,Math.round(r+(2*Math.random()-1)*i))}(G)}}),eY=ew.data,eE=null==eY?void 0:eY.status,eI="Completed"===eE,ek="Failed"===eE,ex=!!b&&!ek&&(ew.isPending||!eY||"Requested"===eE||"Processing"===eE);(0,z.useEffect)(function(){eh.current=!1},[b]),(0,z.useEffect)(function(){if(ex&&null!==G){var e=Date.now()-G,t=window.setTimeout(function(){Z(!0)},Math.max(0,3e4-e));return function(){window.clearTimeout(t)}}},[ex,G]);var eA=(0,s.I)({queryKey:["imageEditResultMediaItem",u.id,b],queryFn:eI&&b?function(){return(0,y._)(function(){var e;return(0,E.YH)(this,function(t){switch(t.label){case 0:return[4,U.Ay.fetchAll(u.id,{page:1,include:["EditedImagePhoto","EditedImageArt"]})];case 1:return[2,null!=(e=t.sent().mediaItems.find(function(e){return"EditedImage"===e.type&&e.imageEditRequest.uuid===b}))?e:null]}})})()}:c.hT,refetchInterval:function(e){return!!eI&&!e.state.data&&1500}}),eP=null!=(t=eA.data)?t:null,eF=eP?g.Ay.getImageUrl(eP.uuid,"webp"):null,eD=eP?g.Ay.getImageUrl(eP.uuid,"nl.webp"):null,eM=(0,K.S)(eF),e_=el((0,K.S)(eD),eM);(0,z.useEffect)(function(){var e;ec&&eI&&!eh.current&&(null==(e=em.current)||e.scrollIntoView({behavior:"smooth",block:"start"}),eh.current=!0)},[eI,ec]);var eC=(0,s.I)({queryKey:["mediaTags"],queryFn:N.A.getAll,staleTime:3e5}),eT=ed(u.id,m.uuid),eq=eP?ed(u.id,eP.uuid):"/nomis/".concat(u.id,"/photo-album"),eS=[{label:"Original",src:null!=ev?ev:ef,mediaItem:m,viewInAlbumUrl:eT},{label:"Edited",src:null!=e_?e_:eD,mediaItem:eP,viewInAlbumUrl:eq}],ez=!b||ek,eR=(0,C.m)({initialValues:{prompt:""},validateInputOnChange:!0,validate:{prompt:function(e){if(e.length<1)return"Please enter a prompt.";if(e.length>300)return!0;var t=(0,Y._)(e.split("///",2),2),r=t[0],i=t[1];return(null==r?void 0:r.trim())||(null==i?void 0:i.trim())?null:"Invalid prompt."}}}),eB=(0,S.n)({mutationFn:function(e){var t=e.prompt;return B.Ay.createFromMediaItem({sourceMediaItemUuid:m.uuid,textPrompt:t,nomiId:u.id})},onSettled:function(){return(0,y._)(function(){return(0,E.YH)(this,function(e){switch(e.label){case 0:return[4,h.invalidateQueries({queryKey:["nomis"]})];case 1:return e.sent(),[4,h.invalidateQueries({queryKey:["activeImageEditRequest","nomis",u.id]})];case 2:return e.sent(),[2]}})})()},onSuccess:function(e){return(0,y._)(function(){return(0,E.YH)(this,function(t){switch(t.label){case 0:return h.setQueryData(["imageEditRequests",e.uuid],e),v(e.uuid),$(Date.now()),Z(!1),es(null),[4,h.invalidateQueries({queryKey:["me","credit-balance"]})];case 1:return t.sent(),[2]}})})()},onError:function(e){var t,r,a,n;if(!(0,R.Dx)(e))return void(0,O.A)(e,{message:"Error editing a media item image",sourceMediaItemUuid:m.uuid,nomiId:u.id});switch(null==(a=e.response)||null==(r=a.data)||null==(t=r.error)?void 0:t.type){case"LimitExceeded":(0,W.A)({message:"You are running out of daily requests and credits. Please upgrade your account or purchase more credits. Thanks!",autoClose:!1,color:W.v.error});return;case"PlanNotAllowed":(0,W.A)({message:"Your plan is not allowed to use this feature. If you think this is an error, please contact support. Thanks!",autoClose:!1,color:W.v.error});return;case"ConcurrencyNotAllowed":(0,W.A)({message:"You can only create one image edit request per Nomi at a time. Please wait for your current request to finish.",autoClose:!1,color:W.v.error});return;case"PromptContainsForbiddenTerm":eR.setFieldError("prompt",(n=e.response.data.error.firstBlockTerm,(0,i.FD)(i.FK,{children:[(0,i.Y)("strong",{children:"Error: "}),(0,V.M)("This prompt contains a forbidden term, please edit your prompt and submit again.",n)]})));return;case"PromptBlockedByPolicy":eR.setFieldError("prompt",eo);return;case"InvalidPrompt":(0,W.A)({message:"Invalid Prompt",autoClose:!1,color:W.v.error});return;default:(0,W.A)({message:"We encountered an unexpected error when submitting your image edit request. Please try again or c
1ontact support.",autoClose:!1,color:W.v.error}),(0,O.A)(e,{sourceMediaItemUuid:m.uuid,nomiId:u.id})}}}),eN=function(){v(null),$(null),Z(!1),es(null)},eU=(0,ea.A)({user:a,requestType:"Image Edit"}),eH=eU.UsageLimitElement,eV=eU.ActionButton,eO="100dvh";return(0,i.FD)(I.a,{w:"100%",maw:{base:680,lg:980,xl:1180},m:"auto",pb:48,px:{base:"lg",md:0},pt:{base:24,md:0},children:[(0,i.Y)(l.E,{size:"md",fw:500,mb:"xs",maw:680,w:"100%",mx:"auto",children:"Edit or transform the image below. Add or remove objects, change concepts or aesthetics, completely transform your image, and much more!"}),(0,i.FD)(o.s,{direction:"column",gap:20,w:"100%",children:[ev&&!eI&&(0,i.Y)(k._,{mx:"auto",maw:380,radius:"md",src:ev,alt:"Source Image"}),ey&&(0,i.Y)(x.t,{withBorder:!0,radius:"md",p:"lg",role:"alert",children:(0,i.Y)(l.E,{ta:"center",children:"We couldn't load the source image. Please go back and try again."})}),b&&(0,i.FD)(x.t,{withBorder:!0,radius:"md",p:"lg",children:[ex&&(0,i.FD)(A.B,{align:"center",gap:"xs",role:"status","aria-live":"polite",children:[(0,i.Y)(n.o,{h:20,children:(0,i.Y)(P.a,{size:"sm",type:"oval-dots"})}),(0,i.Y)(l.E,{fw:600,children:X?"Hang tight, we are still working on your image.":"Transforming your image..."}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:X?"This is taking a bit longer than usual but should be done within a minute or two. Feel free to leave the page - you'll find the image in your gallery once it's ready.":"This usually takes 10-20 seconds."}),ew.isError&&(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:"We're having trouble checking the request status. We'll keep trying automatically."})]}),ek&&(0,i.FD)(A.B,{align:"center",gap:"xs",role:"alert",children:[(0,i.Y)(l.E,{fw:600,children:"We couldn't complete this image edit."}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:"Please try again with a different prompt."}),(0,i.Y)(d.$,{variant:"light",onClick:eN,children:"Try Again"})]}),eI&&eY&&(0,i.FD)(A.B,{align:"center",gap:"sm",children:[(0,i.Y)(l.E,{fw:600,children:"Your edited image is ready."}),(0,i.FD)(F.r,{cols:{base:1,lg:2},spacing:"md",w:"100%",children:[(0,i.FD)(A.B,{align:"center",gap:"xs",children:[(0,i.Y)(l.E,{size:"sm",fw:600,c:"dimmed",children:"Original"}),ev?(0,i.Y)(D.N,{onClick:function(){return es(0)},"aria-label":"Open original image larger","aria-haspopup":"dialog",title:"Open original image larger",style:{cursor:"pointer",display:"block"},children:(0,i.Y)(k._,{mx:"auto",w:"100%",maw:560,mah:eO,fit:"contain",radius:"md",src:ev,alt:"Source Image"})}):(0,i.Y)(j,{label:"Loading original image...",referenceSrc:e_,imageMaxWidth:560,imageMaxHeight:eO})]}),(0,i.FD)(A.B,{align:"center",gap:"xs",children:[(0,i.Y)(l.E,{size:"sm",fw:600,c:"dimmed",children:"Edited"}),(0,i.Y)("div",{ref:em,children:e_&&eP?(0,i.Y)(D.N,{onClick:function(){return es(1)},"aria-label":"Open edited image larger","aria-haspopup":"dialog",title:"Open edited image larger",style:{cursor:"pointer",display:"block"},children:(0,i.Y)(k._,{mx:"auto",w:"100%",maw:560,mah:eO,fit:"contain",radius:"md",src:e_,alt:"Edited Image"})}):(0,i.Y)(j,{label:"Loading edited image...",referenceSrc:ev,imageMaxWidth:560,imageMaxHeight:eO})})]})]}),eA.isError&&(0,i.Y)(l.E,{size:"sm",c:"red",ta:"center",role:"alert",children:"We couldn't load the edited image. It will still be available in your photo album."}),(0,i.Y)(l.E,{size:"sm",c:"dimmed",ta:"center",children:"Tap, click, or press Enter on either image to view it larger and switch between Original and Edited."}),(0,i.FD)(F.r,{cols:{base:1,sm:2},spacing:"sm",w:"100%",maw:740,children:[(0,i.Y)(d.$,{variant:"default",onClick:function(){eN(),window.requestAnimationFrame(function(){var e;null==(e=eu.current)||e.scrollIntoView({behavior:"smooth",block:"start"})})},children:"Re-edit Original"}),(0,i.Y)(d.$,{onClick:function(){if(!eP)throw Error("Cannot edit an image result before its media item loads");p.push("/nomis/".concat(u.id,"/media-items/").concat(eP.uuid,"/edit"))},loading:!eP,disabled:!eP,children:"Edit This Result"})]})]})]}
1),(0,i.Y)(J,{imageIndex:et,setImageIndex:es,items:eS,user:a,nomi:u,mediaTags:null!=(r=eC.data)?r:null}),ez&&(0,i.FD)(i.FK,{children:[(0,i.Y)("div",{ref:eu}),(0,i.FD)(A.B,{maw:680,w:"100%",mx:"auto",gap:"md",children:[(0,i.Y)(er,{promptElem:eR.getInputNode("prompt"),setPrompt:function(e){return eR.setFieldValue("prompt",e)}}),(0,i.FD)(o.s,{direction:"column",children:[(0,i.Y)(M.T,(0,w._)({label:"Prompt",size:"md",placeholder:"change the background to a library",mb:4,rows:4,"aria-label":"Image transform prompt","aria-describedby":ep},eR.getInputProps("prompt")),eR.key("prompt")),(0,i.FD)(l.E,{id:ep,size:"sm",ml:4,ta:"right",c:eR.errors.prompt?"red":"dimmed","aria-live":"polite",children:[300-eR.getValues().prompt.length," /"," ",300," characters left"]})]}),(0,i.Y)(_.c,{}),(0,i.FD)("div",{children:[eV&&(0,i.Y)(eV,{fullWidth:!0,radius:"xl",loading:eB.isPending||ex,requestText:"Transform Image",size:"lg",variant:"round",onRequest:function(){eR.validate().hasErrors||ex||(ek&&eN(),eB.mutate({prompt:eR.getValues().prompt}))},onRedirectSubscription:function(){p.push("/profile/subscription?source=ImageEditRequest")},onRedirectCredit:function(){p.push("/profile/credit?source=ImageEditRequest")}}),(0,i.FD)(l.E,{mt:"sm",mb:"xs",ta:"center",size:"sm",children:["Transformation cost ",B.DY," image request (or credit)."]}),(0,i.Y)(o.s,{justify:"center",align:"center",gap:4,children:eH&&(0,i.Y)(eH,{size:"sm",align:"center"})})]})]})]}),(0,i.Y)(en.Ay,{title:"Your image edit request hasn't been submitted!",unsavedChanges:ez&&eR.isDirty()&&(eB.isIdle||eB.isError),children:"If you leave without submitting your request, your changes will be lost."})]})]})};var ec=r(43728),eu=function(e){var t=e.user,r=(0,h.useRouter)(),u=(0,ec.CV)(),b=p.nH().safeParse(r.query.mediaItemUuid),y=(0,s.I)({queryKey:["mediaItem",b.data],queryFn:b.success?function(){return g.Ay.fetch(b.data)}:c.hT});if(!r.isReady||!u||b.success&&y.isPending)return(0,i.Y)(f.A,{});var w=y.data,Y=w&&"Video"!==w.type;return(0,i.Y)(v.A,{title:"Edit / Transform Image",header:(0,i.FD)(a.h,{order:3,children:[u.name," - Edit / Transform Image"]}),chatName:u.name,backHref:"/nomis/".concat(u.id),backBehavior:"history",children:b.success&&!y.isError&&Y?(0,i.Y)(es,{user:t,nomi:u,sourceMediaItem:w}):(0,i.Y)(n.o,{flex:1,px:"md",children:(0,i.FD)(o.s,{direction:"column",align:"center",gap:"sm",children:[(0,i.Y)(l.E,{ta:"center",c:"dimmed",children:(null==w?void 0:w.type)==="Video"?"Videos can't be used as the source for an image edit.":"We couldn't load that image."}),(0,i.Y)(d.$,{component:m(),href:"/nomis/".concat(u.id,"/photo-album"),variant:"light",children:"Open Photo Album"})]})})})};eu.getLayout=b.A.layoutBuilder;let em=eu},59787:(e,t,r)=>{"use strict";r.d(t,{A:()=>i});let i=(0,r(20648).A)("outline","bulb","Bulb",[["path",{d:"M3 12h1m8 -9v1m8 8h1m-15.4 -6.4l.7 .7m12.1 -.7l-.7 .7",key:"svg-0"}],["path",{d:"M9 16a5 5 0 1 1 6 0a3.5 3.5 0 0 0 -1 3a2 2 0 0 1 -4 0a3.5 3.5 0 0 0 -1 -3",key:"svg-1"}],["path",{d:"M9.7 17l4.6 0",key:"svg-2"}]])},74913:e=>{e.exports={root:"ChatSubPage_root__mNlGz",header:"ChatSubPage_header__fGTaa",body:"ChatSubPage_body__HEknn",footer
1:"ChatSubPage_footer__25kxr"}},92036:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var i=r(26811),a=r(39894);let n=function(e){var t=e.newPrompt,r=e.setPrompt,n=e.promptElem,o=function(){if(r(t),n){var e="current"in n?n.current:n;null==e||e.scrollIntoView({behavior:"smooth"}),null==e||e.focus()}};return(0,i.Y)(a.M,{size:"sm",onClick:function(){return o()},children:"Use this"})}},99614:(e,t,r)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/nomis/[nomiId]/media-items/[mediaItemUuid]/edit",function(){return r(57980)}])}},e=>{e.O(0,[7737,7353,7948,5446,3690,9742,6267,636,6593,8792],()=>e(e.s=99614)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.