1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2433],{34311:function(e,t,i){(window.__NEXT_P=window.__NEXT_P||[]).push(["/salla/app",function(){return i(58445)}])},57209:function(e,t,i){"use strict";var n=i(85893),r=i(46641),o=i(10290),l=i(20931),a=i(46916),d=i(67294),s=i(85518),c=i(5405),p=i(98388);let u=c.ZP.div.withConfig({componentId:"sc-b4631d56-0"})(['background-color:var(--shade-2);&:hover{background-color:var(--shade);}[data-theme="light"] &{background-color:var(--shade-2);&:hover{background-color:var(--shade-2);opacity:0.8;}}']),h=c.ZP.div.withConfig({componentId:"sc-b4631d56-1"})(["border:1px solid var(--shade);&:hover{border-color:var(--shade-2);}"]);t.Z=e=>{let{value:t,onChange:i,className:c,classNameColorWrapper:x}=e,m=(0,a.Z)()===l.H7.AR.value?l.H7.AR.dir:l.H7.EN.dir,g=d.useRef(),[f,v]=d.useState(Boolean),w=()=>v(!f),b=(0,p.m6)("flex items-center justify-between gap-3 relative p-3 rounded-lg cursor-pointer transition-all duration-200",c),y=(0,p.m6)("xl:w-8 xl:h-8 w-6 h-6 rounded-lg cursor-pointer",x);return(0,n.jsxs)(u,{className:b,ref:g,onClick:w,children:[(0,n.jsx)(h,{className:y,style:{background:t}}),(0,n.jsx)("span",{className:"text-ph-color text-sm",children:t}),f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"fixed top-0 right-0 bottom-0 left-0 z-50",onClick:w}),(0,n.jsx)(r.Z,{target:null==g?void 0:g.current,addToRight:m===l.H7.EN.dir||!s.tq,top:s.tq,onDismiss:w,children:(0,n.jsx)("div",{style:{zIndex:9999},id:"reactColorPicker-no-alpha",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(o.Z,{color:t,onChange:e=>i(e)})})})]})]})}},64348:function(e,t,i){"use strict";i.d(t,{T2:function(){return o},Vr:function(){return l}});var n,r,o,l,a=i(85893),d=i(67294),s=i(5405),c=i(87251),p=i(34567);let u=s.ZP.div.withConfig({componentId:"sc-93d33d41-0"})(['background:#202020;border-radius:16px;padding:32px 24px;width:100%;height:100%;display:flex;align-items:center;justify-content:center;@keyframes gradient{0%{background:#202020;}50%{background:#1a1a1a;}}[data-theme="light"] &{background:var(--shade-2);@keyframes gradient{0%{background:var(--shade-2);}50%{background:var(--shade);}}}']),h=s.ZP.div.withConfig({componentId:"sc-93d33d41-1"})(["display:flex;flex-direction:column;align-items:center;text-align:center;gap:24px;max-width:360px;width:100%;"]),x=(0,s.F4)(["0%{opacity:0.35;transform:scale(0.9);}50%{opacity:0.7;transform:scale(1);}100%{opacity:0.35;transform:scale(0.9);}"]),m=(0,s.F4)(["from{transform:rotate(0deg);}to{transform:rotate(360deg);}"]),g=s.ZP.div.withConfig({componentId:"sc-93d33d41-2"})(["position:relative;width:64px;height:64px;display:flex;align-items:center;justify-content:center;"]),f=s.ZP.div.withConfig({componentId:"sc-93d33d41-3"})(["position:absolute;width:140px;height:140px;border-radius:50%;background:radial-gradient( circle,rgba(207,210,213,0.2) 0%,rgba(207,210,213,0) 70% );filter:blur(8px);animation:"," 2s ease-in-out infinite;"],x),v=s.ZP.div.withConfig({componentId:"sc-93d33d41-4"})(["position:absolute;width:64px;height:64px;animation:"," 3s linear infinite;"],m),w=s.ZP.span.withConfig({componentId:"sc-93d33d41-5"})(["position:absolute;width:10px;height:8px;border-radius:12px;background:rgba(207,210,213,0.55);top:calc(50% - 4px);left:calc(50% - 4px);transform:",";animation-delay:",';[data-theme="light"] &{background:rgba(0,0,0,1);}'],e=>{let{angle:t}=e;return"rotate(".concat(t,"deg) translate(0, -36px)")},e=>{let{delay:t}=e;return"".concat(t,"s")}),b=s.ZP.span.withConfig({componentId:"sc-93d33d41-6"})(["font-size:20px;font-weight:600;color:var(--ph-color);z-index:1;"]),y=s.ZP.p.withConfig({componentId:"sc-93d33d41-7"})(["font-size:14px;font-weight:500;color:var(--ph-color);"]),j=s.ZP.div.withConfig({componentId:"sc-93d33d41-8"})(['font-size:12px;font-weight:500;line-height:20px;color:var(--text-shade-2);span{color:var(--ph-color);font-weight:600;}[data-theme="light"] &{color:var(--ph-color);}']);(n=o||(o={})).IMAGE="image",n.VIDEO="video",n.AUDIO="audio",n.MIXED="mixed",n.PRODUCT_PHOTOSHOOT="product_photoshoot",n.VIRTUAL_TRY_ON="virtual_try_on",n.AI_INFLUENCER="ai_influencer",(r=l||(l={})).IN_QUEUE="inqueue",r.PROCESSING="processing",r.COMPLETED="completed",r.FAILED="failed",t.ZP=e=>{let{created_at:t,estimatedProcessingTime:i,status:n="inqueue",onComplete:r,generationType:o,customStatusLabel:l,customDescription:s,showCustomStatusLabel:x=!0}=e,m=(0,c.Z)(),[I,C]=(0,d.useState)(0),_=(0,d.useRef)(0),S=(0,d.useRef)(),Z=(0,d.useMemo)(()=>i?i/60:5,[i]),k=(0,d.useMemo)(()=>Array.from({length:16}),[]),P=(0,d.useMemo)(()=>{var e,t;return x?l||((null===(e=m.generationProcess)||void 0===e?void 0:e.statusLabels)||{})[n]||(null===(t=m.queueMessage)||void 0===t?void 0:t.inQueue)||"In Queue":null},[m,n,l]),E=e=>{_.current=e,C(e)};return(0,d.useEffect)(()=>{let e=6e4*Z;if(t){let i=new Date(t+"Z").getTime(),n=Date.now()-i;if(isNaN(i)||n<-36e5||n<0){let t=Date.now(),i=()=>{let n=Math.min((Date.now()-t)/e*100,99);E(n),n<99&&(S.current=requestAnimationFrame(i))};return S.current=requestAnimationFrame(i),()=>{S.current&&cancelAnimationFrame(S.current)}}let r=Math.min(n,2*e),o=r/e*100,l=Math.min(o,99);if(o>=99){E(99);return}let a=_.current;if(a>=l){let t=e-r,i=Date.now(),n=()=>{let e=Math.min(a+(99-a)*Math.min((Date.now()-i)/t,1),99);E(e),e<99&&(S.current=requestAnimationFrame(n))};S.current=requestAnimationFrame(n)}else{let t=l-a,i=Math.min(2e3,t/100*e),n=Date.now(),o=()=>{let d;let s=Date.now()-n,c=Math.min(s/i,1);E(d=c<1?a+t*c:Math.min(l+(99-l)*Math.min((s-i)/(e-r),1),99)),d<99&&(S.current=requestAnimationFrame(o))};
1S.current=requestAnimationFrame(o)}}else{let t=Date.now(),i=()=>{let n=Math.min((Date.now()-t)/e*100,99);E(n),n<99&&(S.current=requestAnimationFrame(i))};S.current=requestAnimationFrame(i)}return()=>{S.current&&cancelAnimationFrame(S.current)}},[t,Z]),(0,a.jsx)(u,{className:"border border-[#92929240] loading-container",children:(0,a.jsxs)(h,{children:[(0,a.jsxs)(g,{children:[(0,a.jsx)(f,{}),(0,a.jsx)(v,{children:k.map((e,t)=>{let i=360/k.length*t;return(0,a.jsx)(w,{angle:i,delay:.08*t},"dot-".concat(t))})}),(0,a.jsx)(b,{children:Math.min(99,Math.max(0,Math.round(I)))})]}),x&&(0,a.jsx)(p.ZP,{visible:!0,animation:"slideUp",duration:300,delay:100,children:(0,a.jsx)(y,{children:P})},P),(0,a.jsx)(j,{className:"loading-description",children:s?(0,a.jsx)("p",{dangerouslySetInnerHTML:{__html:s}}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("p",{className:"mb-1",dangerouslySetInnerHTML:{__html:m.generationProcess.generating(o,Z)}}),(0,a.jsx)("p",{dangerouslySetInnerHTML:{__html:m.generationProcess.pleaseWait}})]})})]})})}},83345:function(e,t,i){"use strict";var n=i(85893);i(67294);var r=i(46321),o=i(20931);t.Z=e=>{let{isAtLeftEnd:t=!1,isAtRightEnd:i=!1,leftButtonId:l,rightButtonId:a,language:d="",customClassName:s="",arrowSize:c="12px",buttonSize:p="w-6 h-6",buttonBgColor:u="bg-shade-2",onLeftClick:h,onRightClick:x}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-2 ".concat(d===o.H7.AR.value?"flex-row-reverse":""," ").concat(s),children:[(0,n.jsx)("div",{className:"cursor-pointer ".concat(p," rounded-md ").concat(u," flex items-center justify-center ").concat(t?"opacity-50":""),id:l,onClick:h,children:(0,n.jsx)(r.Z,{src:"/icons/arrow-left.svg",width:c,height:c,fill:"var(--white-80-color)"})}),(0,n.jsx)("div",{className:"cursor-pointer ".concat(p," rounded-md ").concat(u," flex items-center justify-center ").concat(i?"opacity-50":""),id:a,onClick:x,children:(0,n.jsx)(r.Z,{src:"/icons/arrow-right.svg",width:c,height:c,fill:"var(--white-80-color)"})})]})}},46641:function(e,t,i){"use strict";var n=i(85893),r=i(67294),o=i(73935);t.Z=e=>{let{target:t,addToLeft:i,addToRight:l,top:a,placement:d,offsetX:s=0,offsetY:c=10,margin:p=10,onDismiss:u,children:h}=e,x=r.useRef(null),[m,g]=r.useState({position:"absolute",visibility:"hidden"}),f=r.useCallback(()=>{let e,i;let n=x.current;if(!t||!n)return;let r=t.getBoundingClientRect(),o=n.getBoundingClientRect(),u=window.innerWidth,h=window.innerHeight;if(d)switch(d){case"top-left":case"top":e=r.top-o.height-c,i=r.left+s;break;case"top-right":e=r.top-o.height-c,i=r.right-o.width-s;break;case"bottom-left":default:e=r.bottom+c,i=r.left+s;break;case"bottom-right":e=r.bottom+c,i=r.right-o.width-s;break;case"left":e=r.top+c,i=r.left-o.width-s;break;case"right":e=r.top+c,i=r.right+s}else a?(e=r.top-o.height-c)<p&&(e=Math.max(p,r.top-o.height-c)):(e=r.bottom+c)+o.height>h-p&&(e=Math.max(p,Math.min(r.top-o.height-c,h-o.height-p))),i=l?r.right-o.width-s:r.left+s;g({position:"absolute",left:i=Math.max(p,Math.min(i,u-o.width-p)),top:e=Math.max(p,Math.min(e,h-o.height-p)),visibility:"visible",zIndex:999999})},[t,i,l,a,d,s,c,p]);return r.useLayoutEffect(()=>{f()},[f]),r.useLayoutEffect(()=>{let e=x.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(()=>f());return t.observe(e),()=>t.disconnect()},[f]),r.useEffect(()=>{let e=()=>f(),t=()=>f();return window.addEventListener("resize",e,{passive:!0}),window.addEventListener("orientationchange",e,{passive:!0}),window.addEventListener("scroll",t,{passive:!0}),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e),window.removeEventListener("scroll",t)}},[f]),r.useEffect(()=>{if(!u)return;let e=e=>{let i=x.current,n=e.target;if(!i||!n)return;let r=i.contains(n),o=!!t&&t.contains(n);r||o||u()};return document.addEventListener("pointerdown",e,{capture:!0}),()=>{document.removeEventListener("pointerdown",e,{capture:!0})}},[u,t]),o.createPortal((0,n.jsx)("div",{ref:x,style:m,children:h}),document.body)}},10290:function(e,t,i){"use strict";var n=i(85893),r=i(94115);i(67294);var o=i(38257),l=i(10847);t.Z=e=>{let{color:t,onChange:i}=e;return(0,n.jsx)("div",{style:{touchAction:"none",overscrollBehavior:"contain"},children:(0,n.jsx)(o.xS,{style:{backgroundColor:"".concat(l.theme.extend.colors.primary," !important")},color:t,onChange:e=>i((0,r.f)(e.rgb.r,e.rgb.g,e.rgb.b,e.rgb.a)),alpha:!1})})}},60568:function(e,t,i){"use strict";var n=i(67294),r=i(20931);t.Z=function(e,t,i){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r.mQ.LTR,l=arguments.length>
14&&void 0!==arguments[4]?arguments[4]:300,[a,d]=(0,n.useState)(!1),[s,c]=(0,n.useState)(!0),[p,u]=(0,n.useState)(!1),[h,x]=(0,n.useState)(!1),m=(0,n.useRef)(l),g=(0,n.useRef)(i),f=(0,n.useRef)(o);(0,n.useEffect)(()=>{m.current=l,g.current=i,f.current=o},[l,i,o]);let v=()=>{let e=document.querySelector("#".concat(g.current));e&&(e.scrollWidth>e.offsetWidth?x(!0):x(!1))},w=()=>{let e=document.querySelector("#".concat(g.current));e&&(f.current===r.mQ.LTR?(c(e.scrollLeft<=0),u(Math.abs(e.scrollLeft)+e.offsetWidth+1>=e.scrollWidth)):(c(Math.abs(e.scrollLeft)+e.offsetWidth+1>=e.scrollWidth),u(0===e.scrollLeft)))},b=(0,n.useCallback)(e=>{let t=document.querySelector("#".concat(g.current));t&&(t.scrollWidth>t.offsetWidth&&t.scrollTo({left:t.scrollLeft+m.current,behavior:"smooth"}),e.preventDefault())},[]),y=(0,n.useCallback)(e=>{let t=document.querySelector("#".concat(g.current));t&&(t.scrollWidth>t.offsetWidth&&t.scrollTo({left:t.scrollLeft-m.current,behavior:"smooth"}),e.preventDefault())},[]);return n.useLayoutEffect(()=>{let{rightBtn:i,leftBtn:n}=(()=>{let i=document.querySelector("#".concat(e)),n=document.querySelector("#".concat(t));return i&&(i.removeEventListener("click",b),i.addEventListener("click",b)),n&&(n.removeEventListener("click",y),n.addEventListener("click",y)),{rightBtn:i,leftBtn:n}})();return v(),requestAnimationFrame(()=>{w()}),()=>{i&&i.removeEventListener("click",b),n&&n.removeEventListener("click",y)}},[a]),n.useEffect(()=>{if(!h)return;let i=()=>{let i=document.querySelector("#".concat(e)),n=document.querySelector("#".concat(t));i&&(i.removeEventListener("click",b),i.addEventListener("click",b)),n&&(n.removeEventListener("click",y),n.addEventListener("click",y))};i();let n=setTimeout(()=>{i()},100);return requestAnimationFrame(()=>{i()}),()=>{clearTimeout(n);let i=document.querySelector("#".concat(e)),r=document.querySelector("#".concat(t));i&&i.removeEventListener("click",b),r&&r.removeEventListener("click",y)}},[h,a,b,y,e,t]),{isAtLeftEnd:s,isAtRightEnd:p,setIsAtRightEnd:u,setIsAtLeftEnd:c,isScrollable:h,handleScroll:w,checkScrollState:v,reinitializeSlider:()=>{d(!a)}}}},58445:function(e,t,i){"use strict";i.r(t),i.d(t,{MainLayout:function(){return e$},__N_SSP:function(){return eB},default:function(){return eO}});var n=i(85893),r=i(67294),o=i(11163),l=i(5405),a=i(25675),d=i.n(a),s=i(46321),c=i(30933),p=i(39573),u=i(30035),h=i(46933),x=i(82821),m=i(91369),g=i(91167),f=i(17679),v=i(46916),w=i(20931);let b=l.ZP.div.withConfig({componentId:"sc-c1175b95-0"})(["width:360px;height:100%;overflow-y:auto;padding:24px 0px;@media (max-width:1024px){width:100%;height:auto;max-height:50vh;padding:16px 0px;}@media (max-width:640px){padding:12px 0px;max-height:40vh;}"]),y=l.ZP.div.withConfig({componentId:"sc-c1175b95-1"})(["display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:24px;@media (max-width:640px){margin-bottom:16px;gap:4px;}"]),j=l.ZP.h2.withConfig({componentId:"sc-c1175b95-2"})(["font-weight:500;font-size:16px;color:var(--ph-color);margin:0;"]),I=l.ZP.div.attrs({className:"hiddenScrollBar"}).withConfig({componentId:"sc-c1175b95-3"})(["display:flex;flex-wrap:wrap;gap:8px;background:var(--eerie-black);border-radius:16px;padding:16px;height:calc(100vh - 175px);overflow-y:auto;@media (max-width:1024px){height:auto;max-height:calc(50vh - 80px);padding:12px;}@media (max-width:640px){flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;max-height:none;padding:8px;gap:6px;height:auto;}"]),C=l.ZP.div.withConfig({componentId:"sc-c1175b95-4"})(["background:var(--eerie-black);border-radius:16px;@media (max-width:640px){overflow:hidden;}@media (min-width:641px){& > div > div{display:block !important;overflow:visible !important;}}"]),_=(0,l.ZP)(p.E).withConfig({componentId:"sc-c1175b95-5"})(["pointer-events:",';&:not([data-selected="true"]){opacity:',";}@media (max-width:640px){flex-shrink:0;}"],e=>e.$disabled?"none":"auto",e=>e.$atLeastOneSelected?.5:1),S=l.ZP.div.withConfig({componentId:"sc-c1175b95-6"})(["border-radius:16px;padding:12px;cursor:",";transition:all 0.3s ease;background:var(--eerie-black);pointer-events:",";position:relative;z-index:10;"],e=>e.$disabled?"not-allowed":"pointer",e=>e.$disabled?"none":"auto"),Z=l.ZP.div.withConfig({componentId:"sc-c1175b95-7"})(["width:100%;aspect-ratio:1/1;width:132px;border-radius:8px;overflow:hidden;background:var(--shade-2);margin-bottom:8px;position:relative;@media (max-width:640px){width:100px;margin-bottom:6px;}"]),k=l.ZP.h3.withConfig({componentId:"sc-c1175b95-8"})(["font-weight:500;font-size:12px;color:var(--ph-color);margin-top:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100px;"]);l.ZP.p.withConfig({componentId:"sc-c1175b95-9"})(["font-size:12px;color:var(--text-shade-2);margin-top:4px;direction:rtl;text-align:right;"]),l.ZP.div.withConfig({componentId:"sc-c1175b95-10"})(["display:flex;align-items:center;justify-content:center;padding:40px;color:var(--text-shade-2);"]);let P=l.ZP.div.withConfig({componentId:"sc-c1175b95-11"})(["display:flex;align-items:center;justify-content:center;padding:40px;color:var(--error-color,#ef4444);"]),E=l.ZP.div.withConfig({componentId:"sc-c1175b95-12"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;padding:60px 20px;text-align:center;color:var(--text-shade-2);"]),T=l.ZP.div.withConfig({componentId:"sc-c1175b95-13"})(["margin-bottom:16px;opacity:0.5;"]),M=l.ZP.p.withConfig({componentId:"sc-c1175b95-14"})(["font-size:14px;color:var(--text-shade-2);margin:0;"]),L=l.ZP.div.withConfig({componentId:"sc-c1175b95-15"})(["border-radius:16px;width:160px;height:212px;background:var(--eerie-black);position:relative;z-index:10;@media (max-width:640px){width:120px;height:172px;}"]),N=(0,l.ZP)(m.Z.SkeletonCard).withConfig({componentId:"sc-c1175b95-16"})(["width:100%;height:100%;border-radius:8px;"]);(0,l.ZP)(m.Z.SkeletonText).withConfig({componentId:"sc-c1175b95-17"})(["width:80%;height:12px;margin-top:12px;border-radius:4px;"]);let z=()=>(0,n.jsx)(L,{children:(0,n.jsx)(N,{})});var R=e=>{let{selectedProductId:t,onProductSelect:i,isGenerating:o=!1}=e,l=r.useRef(null),{data:a,isLoading:m,error:L,fetchNextPage:N,hasNextPage:R,isFetchingNextPage:A,isFetching:F,refetch:B}=(0,c.L)(void 0,{refetchInterval:e=>{let t=!e.state.data||0===e.state.data.pages.flatMap(e=>(null==e?void 0:e.data)||[]).length;e.state.error;let i=!e.state.isLoading&&!e.state.isFetching;return!t||e.state.error?(l.current=null,!1):!!i&&((null===l.current&&(l.current=Date.now()),Date.now()-l.current>=3e4)?(l.current=null,!1):2e3)}}),$=(0,v.Z)()===w.H7.AR.value?w.H7.AR.dir:w.H7.EN.dir,D=(null==a?void 0:a.pages.flatMap(e=>(null==e?void 0:e.data)||[]))||[],O=r.useRef(i);r.useEffect(()=>{O.current=i},[i]);let U=r.useRef(null),q=r.useRef(null);return r.useEffect(()=>{if(t&&a&&!m&&!F&&!L){let e=D.find(e=>String(e.id)===String(t)),i=a!==q.current;if(i&&(q.current=a),e){if(U.current!==t||i){let i=U.current!==t;U.current=t,O.current(e,void 0,i)}}else null!==U.current&&(U.current=null,O.current(null,void 0,!0))}},[D,t,m,F,L,a]),(0,n.jsxs)(b,{children:[(0,n.jsxs)(y,{children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(s.Z,{src:"/icons/box.svg",width:"24px",height:"24px",fill:"var(--ph-color)"}),(0,n.jsx)(j,{children:"Ù
ÙØªØ¬Ø§Øª"})]}),(0,n.jsx)(p.E,{$isSelected:!0,radius:"8px",$afterBg:"var(--eerie-black)",padding:"1px",children:(0,n.jsx)(g.Z,{size:"small",type:"accent",style:{padding:"4px 12px",borderRadius:"8px"},onClick:()=>B(),disabled:F,children:(0,n.jsx)("span",{className:"text-ph-color text-sm",children:F?"Ø¬Ø§Ø±Ù Ø§ÙØªØØ¯ÙØ«...":"ØªØØ¯ÙØ« اÙÙ
ÙØªØ¬Ø§Øª"})})})]}),m?(0,n.jsx)(C,{children:(0,n.jsx)(I,{children:Array.from({length:8}).map((e,t)=>(0,n.jsx)(z,{},"skeleton-".concat(t)))})}):L?(0,n.jsx)(P,{children:"ØØ¯Ø« خطأ Ø£Ø«ÙØ§Ø¡ تØÙ
Ù٠اÙÙ
ÙØªØ¬Ø§Øª"}):0===D.length?(0,n.jsx)(C,{children:(0,n.jsxs)(E,{children:[(0,n.jsx)(T,{children:(0,n.jsx)(s.Z,{src:"/icons/box.svg",width:"24px",height:"24px",fill:"var(--text-shade-2)"})}),(0,n.jsx)(M,{children:"ÙØ§ ØªÙØ¬Ø¯ Ù
ÙØªØ¬Ø§Øª Ù
ØªØ§ØØ©"})]})}):(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(C,{children:(0,n.jsx)(f.Z,{direction:$,className:"hiddenScrollBar",containerClassName:"hiddenScrollBar",children:(0,n.jsxs)(I,{children:[D.map(e=>(0,n.jsx)(_,{$afterBg:"transparent","data-selected":t===e.id,$disabled:o,$atLeastOneSelected:!!D.some(e=>e.id===t)&&D.length>1,children:(0,n.jsxs)(S,{$disabled:o,onClick:()=>{o||i(e)},children:[(0,n.jsx)(Z,{children:(0,n.jsx)(d(),{src:e.thumbnail||e.main_image,alt:e.name,fill:!0,style:{objectFit:"cover",objectPosition:"top"}})}),(0,n.jsx)(k,{title:e.name,children:e.name})]})},e.id)),!F&&R&&(0,n.jsx)(u.Z,{onTrigger:N,loading:A||F,hasMore:R,threshold:.5,rootMargin:"50px"}),A&&(0,n.jsx)(h.Z,{className:"w-full flex items-center justify-center py-4",children:(0,n.jsx)(x.Z,{size:"small",className:"loader"})})]})})})})]})};l.ZP.div.withConfig({componentId:"sc-a3cdccd5-0"})(["direction:rtl;"]),l.ZP.h3.withConfig({componentId:"sc-a3cdccd5-1"})(['font-family:"Cairo",sans-serif;font-weight:600;font-size:16px;color:#ffffff;margin:0 0 16px 0;direction:rtl;@media (max-width:640px){font-size:14px;margin:0 0 12px 0;}']);let A=l.ZP.textarea.withConfig({componentId:"sc-a3cdccd5-2"})(["width:100%;min-height:136px;background:var(--eerie-black);border:2px solid transparent;border-radius:12px;padding:16px;font-size:12px;color:var(--ph-color);direction:rtl;resize:vertical;transition:all 0.3s ease;appearance:none;-webkit-appearance:none;-moz-appearance:none;-ms-appearance:none;-o-appearance:none;resize:none;&:focus{outline:none;border-color:var(--secondary-color);}&::placeholder{color:var(--text-shade-2);}"]);var F=i(64348),B=i(15692),$=e=>{var t;let{executionId:i}=e,{data:r}=(0,B.m)(i,{enabled:!!i,refetchInterval:e=>{var t,i;let n=null===(i=e.state.data)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:t.status;return"completed"!==n&&"failed"!==n&&2e3}}),o=(()=>{var e;if(!(null==r?void 0:null===(e=r.data)||void 0===e?void 0:e.status))return F.Vr.IN_QUEUE;
1switch(r.data.status.toLowerCase()){case"pending":case"queued":case"in_queue":return F.Vr.IN_QUEUE;case"processing":case"running":default:return F.Vr.PROCESSING;case"completed":case"success":return F.Vr.COMPLETED;case"failed":case"error":return F.Vr.FAILED}})(),l=(null==r?void 0:null===(t=r.data)||void 0===t?void 0:t.created_at)||new Date().toISOString();return(0,n.jsx)(F.ZP,{generationType:F.T2.IMAGE,status:o,created_at:l,estimatedProcessingTime:120,customDescription:"ÙØ¯ ÙØ³ØªØºØ±Ù Ø¥ÙØ´Ø§Ø¡ Ø§ÙØµÙرة Ù
ا ÙØµÙ Ø¥Ù٠دÙÙÙØªÙÙ.",showCustomStatusLabel:!0})},D=i(12840),O=i(57209),U=i(6491);let q=e=>{let{selectedProduct:t,selectedMode:i,selectedSubOption:n}=e;return(0,r.useMemo)(()=>!!t&&!!i&&("TEMPLATES"===i||("CUSTOM"===i?null!==n&&n.trim().length>0:("STUDIO"===i||"MODEL"===i)&&null!==n)),[t,i,n])};var H=i(68027),W=i(580),G=i(83345),V=i(60568);let Q=l.ZP.div.withConfig({componentId:"sc-5f0be76b-0"})(["display:flex;flex-wrap:wrap;gap:12px;margin-bottom:32px;"]),Y=l.ZP.div.withConfig({componentId:"sc-5f0be76b-1"})(["background:#fff;border-radius:12px;cursor:pointer;transition:all 0.3s ease;width:216px;height:216px;border:2px solid ",";&:hover{border-color:var(--secondary-color);transform:translateY(-2px);}"],e=>e.$isSelected?"var(--secondary-color)":"var(--eerie-black)"),X=l.ZP.div.withConfig({componentId:"sc-5f0be76b-2"})(["position:relative;width:100%;height:100%;aspect-ratio:16/9;border-radius:10px;overflow:hidden;position:relative;"]),J=l.ZP.h3.withConfig({componentId:"sc-5f0be76b-3"})(["font-weight:600;font-size:12px;color:var(--custom-white);position:absolute;bottom:16px;left:8px;right:8px;text-align:center;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;max-width:100%;@media (max-width:640px){font-size:11px;bottom:12px;left:6px;right:6px;}"]),K=l.ZP.div.withConfig({componentId:"sc-5f0be76b-4"})(["position:absolute;bottom:0;left:0;right:0;width:216px;height:64px;background:linear-gradient( 180deg,rgba(0,0,0,0) 15.62%,rgba(12,12,12,0.8) 100% );"]);l.ZP.p.withConfig({componentId:"sc-5f0be76b-5"})(["font-weight:400;font-size:12px;color:var(--text-shade-2);margin:0;direction:rtl;text-align:right;line-height:1.5;"]);let ee=l.ZP.div.withConfig({componentId:"sc-5f0be76b-6"})(["position:absolute;top:8px;right:8px;z-index:2;opacity:",';transition:all 0.3s ease;pointer-events:none;[dir="rtl"] &{left:8px;right:auto;}'],e=>e.$isSelected?1:0);l.ZP.div.withConfig({componentId:"sc-44d971ba-0"})(["direction:rtl;"]),l.ZP.h3.withConfig({componentId:"sc-44d971ba-1"})(["font-weight:600;font-size:16px;color:var(--custom-white);margin:0 0 16px 0;direction:rtl;@media (max-width:640px){font-size:14px;margin:0 0 12px 0;}"]),l.ZP.div.withConfig({componentId:"sc-44d971ba-2"})(["display:grid;grid-template-columns:repeat(auto-fill,minmax(147px,1fr));gap:16px;@media (max-width:1200px){grid-template-columns:repeat(2,1fr);}@media (max-width:768px){grid-template-columns:1fr;}"]);let et=l.ZP.div.withConfig({componentId:"sc-44d971ba-3"})(["background:#121212;border-radius:12px;cursor:pointer;transition:all 0.3s ease;border:2px solid ",";&:hover{border-color:var(--secondary-color);}"],e=>e.$isSelected?"var(--secondary-color)":"transparent"),ei=l.ZP.div.withConfig({componentId:"sc-44d971ba-4"})(["width:100%;aspect-ratio:1;border-radius:10px;overflow:hidden;background:var(--shade-2);position:relative;"]),en=l.ZP.div.withConfig({componentId:"sc-44d971ba-5"})(["position:absolute;top:8px;right:8px;z-index:2;opacity:",';transition:all 0.3s ease;pointer-events:none;[dir="rtl"] &{left:8px;right:auto;}'],e=>e.$isSelected?1:0);l.ZP.div.withConfig({componentId:"sc-43589fce-0"})(["direction:rtl;"]),l.ZP.h3.withConfig({componentId:"sc-43589fce-1"})(['font-family:"Cairo",sans-serif;font-weight:600;font-size:16px;color:#ffffff;margin:0 0 16px 0;direction:rtl;@media (max-width:640px){font-size:14px;margin:0 0 12px 0;}']);let er=l.ZP.div.withConfig({componentId:"sc-43589fce-2"})(["display:flex;flex-wrap:wrap;gap:12px;"]),eo=l.ZP.div.withConfig({componentId:"sc-43589fce-3"})(["position:relative;background:#fff;border-radius:12px;cursor:pointer;transition:all 0.3s ease;width:216px;height:216px;border:2px solid ",";&:hover{border-color:var(--secondary-color);transform:translateY(-2px);}"],e=>e.$isSelected?"var(--secondary-color)":"var(--eerie-black)"),el=l.ZP.div.withConfig({componentId:"sc-43589fce-4"})(["width:100%;height:100%;aspect-ratio:1/1;border-radius:10px;overflow:hidden;position:relative;"]);l.ZP.div.withConfig({componentId:"sc-43589fce-5"})(["position:absolute;bottom:0;left:0;right:0;width:216px;height:64px;background:linear-gradient( 180deg,rgba(0,0,0,0) 15.62%,rgba(12,12,12,0.8) 100% );"]),l.ZP.h4.withConfig({componentId:"sc-43589fce-6"})(["position:absolute;bottom:12px;left:12px;right:12px;font-weight:600;font-size:12px;color:var(--custom-white);text-align:center;@media (max-width:640px){font-size:11px;bottom:8px;left:8px;right:8px;}"]);let ea=l.ZP.div.withConfig({componentId:"sc-43589fce-7"})(["position:absolute;top:8px;right:8px;z-index:2;opacity:",';transition:all 0.3s ease;pointer-events:none;[dir="rtl"] &{left:8px;right:auto;}'],e=>e.$isSelected?1:0);var ed=i(215);let es=l.ZP.div.attrs({className:"hiddenScrollBar"}).withConfig({componentId:"sc-6cda3310-0"})(["flex:1;padding:32px;overflow-y:auto;@media (max-width:1024px){padding:24px 16px;}@media (max-width:640px){padding:16px 12px;padding-bottom:100px;}& .loading-container{background:transparent;border:none;}& .loading-description{font-size:14px;}"]),ec=l.ZP.div.withConfig({componentId:"sc-6cda3310-1"})(["display:flex;align-items:center;gap:12px;"]),ep=l.ZP.h2.withConfig({componentId:"sc-6cda3310-2"})(["font-weight:500;font-size:14px;color:var(--ph-color);@media (max-width:640px){font-size:12px;}"]),eu=l.ZP.div.withConfig({componentId:"sc-6cda3310-3"})(["margin-bottom:32px;"]),eh=l.ZP.div.withConfig({componentId:"sc-6cda3310-4"})(["display:flex;gap:12px;margin-top:16px;flex-wrap:nowrap;min-width:max-content;& > *{transition:transform 0.6s cubic-bezier(0.34,1.56,0.64,1),opacity 0.3s ease;flex-shrink:0;}"]),ex=l.ZP.div.withConfig({componentId:"sc-6cda3310-5"})(["width:88px;height:88px;border-radius:8px;overflow:hidden;background:#121212;position:relative;cursor:pointer;border:2px solid ",";transition:all 0.2s ease;&:hover{border-color:var(--secondary-color);opacity:0.9;}"],e=>e.$isSelected?"var(--secondary-color)":"transparent"),em=l.ZP.div.withConfig({componentId:"sc-6cda3310-6"})(['position:absolute;top:4px;right:4px;z-index:2;pointer-events:none;[dir="rtl"] &{left:4px;right:auto;}']),eg=l.ZP.div.withConfig({componentId:"sc-6cda3310-7"})(["position:fixed;bottom:32px;left:32px;display:flex;gap:12px;z-index:10;@media (max-width:640px){bottom:16px;left:16px;right:16px;}"]),ef=l.ZP.button.withConfig({componentId:"sc-6cda3310-8"})(["background:var(--secondary-color);color:var(--custom-white);font-size:16px;padding:16px 24px;border-radius:12px;border:none;cursor:pointer;transition:all 0.3s ease;@media (max-width:640px){font-size:14px;padding:12px 20px;}&:hover:not(:disabled){background:var(--secondary-color);transform:translateY(-2px);}&:disabled{opacity:0.5;cursor:not-allowed;}"]),ev=l.ZP.button.withConfig({componentId:"sc-6cda3310-9"})(["background:var(--eerie-black);color:var(--custom-white);font-size:16px;padding:16px 24px;border-radius:12px;cursor:pointer;transition:all 0.3s ease;width:100%;position:relative;z-index:10;@media (max-width:640px){font-size:14px;padding:12px 20px;}&:hover{background:rgba(255,255,255,0.05);border-color:rgba(255,255,255,0.2);transform:translateY(-2px);}"]),ew=l.ZP.div.attrs({className:"hiddenScrollBar"}).withConfig({componentId:"sc-6cda3310-10"})(["position:relative;min-height:calc(100vh - 200px);@media (max-width:640px){min-height:100%;}"]),eb=l.ZP.div.withConfig({componentId:"sc-6cda3310-11"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;padding:64px 32px;max-width:1200px;margin:0 auto;@media (max-width:640px){padding:32px 16px;}"]),ey=l.ZP.h1.withConfig({componentId:"sc-6cda3310-12"})(["font-weight:700;font-size:32px;line-height:1.4;color:var(--secondary-color-3);margin:0 0 16px 0;text-align:center;@media (max-width:1024px){font-size:24px;}@media (max-width:640px){font-size:20px;margin:0 0 12px 0;}"]),ej=l.ZP.p.withConfig({componentId:"sc-6cda3310-13"})(["font-weight:400;font-size:16px;line-height:1.6;color:#ffffff;margin:0 0 48px 0;text-align:center;max-width:800px;@media (max-width:640px){font-size:14px;margin:0 0 32px 0;}"]),eI=l.ZP.div.withConfig({componentId:"sc-6cda3310-14"})(["display:grid;grid-template-columns:repeat(3,1fr);gap:24px;width:100%;max-width:1200px;@media (max-width:1024px){grid-template-columns:1fr;}"]),eC=l.ZP.div.withConfig({componentId:"sc-6cda3310-15"})(["background:#121212;border-radius:16px;padding:16px;display:flex;flex-direction:column;"]),e_=l.ZP.div.withConfig({componentId:"sc-6cda3310-16"})(['width:32px;height:32px;background:var(--secondary-color-3);border-radius:8px;display:flex;align-items:center;justify-content:center;font-weight:500;font-size:16px;color:#132631;margin-bottom:16px;align-self:flex-end;position:absolute;top:8px;left:8px;@media (max-width:640px){width:28px;height:28px;font-size:14px;top:6px;left:6px;}[dir="rtl"] &{right:8px;left:auto;@media (max-width:640px){right:6px;left:auto;}}']),eS=l.ZP.div.withConfig({componentId:"sc-6cda3310-17"})(["width:100%;border-radius:8px;overflow:hidden;margin-bottom:16px;position:relative;& img{width:100%;height:100%;object-fit:cover;}"]),eZ=l.ZP.h3.withConfig({componentId:"sc-6cda3310-18"})(["font-weight:700;font-size:16px;color:var(--ph-color);margin-bottom:8px;@media (max-width:640px){font-size:14px;margin-bottom:6px;}"]),ek=l.ZP.p.withConfig({componentId:"sc-6cda3310-19"})(["font-weight:500;font-size:12px;color:var(--text-shade-2);line-height:18px;@media (max-width:640px){font-size:11px;line-height:16px;}"]),eP=l.ZP.div.withConfig({componentId:"sc-6cda3310-20"})(["display:flex;flex-wrap:wrap;gap:12px;align-items:flex-start;"]),eE=l.ZP.div.withConfig({componentId:"sc-6cda3310-21"})(["display:flex;flex-direction:column;gap:8px;"]),eT=l.ZP.div.withConfig({componentId:"sc-6cda3310-22"})(["position:relative;background:var(--eerie-black);border-radius:12px;cursor:pointer;transition:all 0.3s ease;height:216px;aspect-ratio:",";border:2px solid ",";&:hover{border-color:var(--secondary-color);transform:translateY(-2px);}"],e=>e.$aspectRatio.replace(":","/"),e=>e.$isSelected?"var(--secondary-color)":"transparent"),eM=l.ZP.h4.withConfig({componentId:"sc-6cda3310-23"})(["font-size:12px;color:var(--custom-white);text-align:center;margin:0;@media (max-width:640px){font-size:11px;}"]),eL=l.ZP.div.withConfig({componentId:"sc-6cda3310-24"})(["width:100%;height:100%;border-radius:10px;overflow:hidden;position:relative;background:linear-gradient( 180deg,rgba(0,0,0,0) 44.69%,rgba(0,0,0,0.584808) 85.12%,rgba(0,0,0,0.8) 100% );"]),eN=r.memo(e=>{let{imageUrl:t,productName:i,index:o,isSelected:l,onClick:a}=e,c=(0,r.useCallback)(()=>{a(o)},[a,o]);return(0,n.jsxs)(ex,{$isSelected:l,onClick:c,children:[(0,n.jsx)(d(),{src:t,alt:"".concat(i," - Image ").concat(o+1),fill:!0,style:{objectFit:"cover",objectPosition:"top"}}),l&&(0,n.jsx)(em,{children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})})]})});var ez=r.memo(e=>{var t,i,o,l,a;let{selectedProduct:c,selectedImage:u,workflowStep:m,selectedMode:g,selectedSubOption:b,generatedImage:y,executionId:j,isGenerating:I,onModeSelect:C,onSubOptionSelect:_,onGenerate:S,onReset:Z,onDownload:k,isLoadingProducts:P=!1,resultId:E,autoSelectFirstTemplate:T=!1}=e,M=(0,v.Z)(),L=M===w.H7.AR.value?w.H7.AR.dir:w.H7.EN.dir,N=(0,r.useRef)(null),z=(0,r.useRef)(null),R=(0,V.Z)("productImagesRightBtn","productImagesLeftBtn","productImagesScroll",L),B=(0,V.Z)("firstThreeTemplatesRightBtn","firstThreeTemplatesLeftBtn","firstThreeTemplatesScroll",L),ex=(0,V.Z)("remainingTemplatesRightBtn","remainingTemplatesLeftBtn","remainingTemplatesScroll",L),em=(0,r.useRef)(null),{availableImages:ez,selectedImageIndex:eR,selectedImageUrl:eA,setSelectedImageIndex:eF}=(0,U._)(c,u),eB=(0,r.useMemo)(()=>{var e,t;if(!c||null===eR)return null;let i=ez[eR];if(!i)return null;let n=null===(e=c.images)||void 0===e?void 0:e.find(e=>e.url===i);if(null==n?void 0:n.id)return n.id;if(i===c.thumbnail||i===c.main_image){let e=null===(t=c.images)||void 0===t?void 0:t.find(e=>e.url===c.main_image||e.is_main);return(null==e?void 0:e.id)||null}return null},[c,eR,ez]),[e$,eD]=(0,r.useState)(null),[eO,eU]=(0,r.useState)(null),[eq,eH]=(0,r.useState)({}
1),[eW,eG]=(0,r.useState)(!1),[eV,eQ]=(0,r.useState)(""),eY=(0,r.useRef)(null);(0,r.useEffect)(()=>{var e;let t=null!==(e=null==c?void 0:c.id)&&void 0!==e?e:null,i=eY.current;t!==i&&null!==i&&(eD(null),eU(null),eH({}),eG(!1),eQ(""),Z()),eY.current=t},[null==c?void 0:c.id,Z]);let{data:eX,isLoading:eJ,fetchNextPage:eK,hasNextPage:e0,isFetchingNextPage:e1}=(0,W.S)(),e2=(0,r.useCallback)(e=>{if(!e0||e1)return;let t=N.current;if(!t)return;let{scrollLeft:i,scrollWidth:n,offsetWidth:r}=t;n-((L===w.H7.AR.dir?Math.abs(i):i)+r)<=200&&(em.current&&clearTimeout(em.current),em.current=setTimeout(()=>{eK()},300))},[e0,e1,L,eK]);(0,r.useEffect)(()=>()=>{em.current&&clearTimeout(em.current)},[]);let e6=(0,r.useMemo)(()=>{var e;return(null==eX?void 0:null===(e=eX.pages)||void 0===e?void 0:e.flatMap(e=>(null==e?void 0:e.data)||[]))||[]},[eX]),e3=(0,r.useMemo)(()=>e6.slice(0,2),[e6]),e4=(0,r.useMemo)(()=>e6.slice(2),[e6]);(0,r.useEffect)(()=>{if(T&&c&&e6.length>0&&!e$&&!eO&&!eJ){let e=e6[0];if(e&&e.variants&&e.variants.length>0){let t=e.variants[0];eD(e.id),eU(t.id),C("TEMPLATES"),_(t.id.toString())}}},[T,c,e6,e$,eO,eJ,C,_]);let e5=(0,r.useMemo)(()=>e4.flatMap(e=>(e.variants||[]).filter(e=>"image"===e.expected_output_type).map(t=>{var i;return{...t,templateId:e.id,templateName:"string"==typeof e.display_name?e.display_name:(null===(i=e.display_name)||void 0===i?void 0:i.ar)||e.name}})),[e4]);(0,r.useEffect)(()=>{if(ez.length>0){let e=setTimeout(()=>{R.checkScrollState(),R.reinitializeSlider()},100);return()=>clearTimeout(e)}},[ez.length]),(0,r.useEffect)(()=>{if(e3.length>0){let e=setTimeout(()=>{B.checkScrollState(),B.reinitializeSlider()},100);return()=>clearTimeout(e)}},[e3.length]),(0,r.useEffect)(()=>{if(e5.length>0){let e=setTimeout(()=>{ex.checkScrollState(),ex.reinitializeSlider()},100);return()=>clearTimeout(e)}},[e5.length]);let e8=(0,r.useMemo)(()=>e$&&e6.find(e=>e.id===e$)||null,[e$,e6]),e9=(0,r.useMemo)(()=>(null==e8?void 0:e8.variants)?e8.variants.filter(e=>{var t;return!(null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"}))}):[],[e8]),e7=(0,r.useMemo)(()=>null!=e8&&!!e8.variants&&e8.variants.some(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})}),[e8]),te=(0,r.useMemo)(()=>{var e;
1if(!e7||!(null==e8?void 0:e8.variants))return null;let t=e8.variants.find(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})});return(null==t?void 0:null===(e=t.inputs)||void 0===e?void 0:e.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"}))||null},[e8,e7]),tt=(0,r.useMemo)(()=>{if(!e7||!(null==e8?void 0:e8.variants))return null;let e=e8.variants.find(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})});return(null==e?void 0:e.id)||null},[e8,e7]),ti=(0,r.useMemo)(()=>{if(!eO)return null;let e=e9.find(e=>e.id===eO);return e||(e=e5.find(e=>e.id===eO)),e||null},[eO,e9,e5]);(0,r.useMemo)(()=>{var e;return ti?null===(e=ti.inputs)||void 0===e?void 0:e.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="color_picker"}):null},[ti]);let tn=(0,r.useMemo)(()=>{var e,t;
1if(e7&&(null==e8?void 0:e8.variants)){let e=e8.variants.find(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})});if(e){let i=null===(t=e.inputs)||void 0===t?void 0:t.find(e=>"aspect_ratio"===e.slug);if(i)return i}}if(!eO)return null;let i=e9.find(e=>e.id===eO);return i||(i=e5.find(e=>e.id===eO)),i&&(null===(e=i.inputs)||void 0===e?void 0:e.find(e=>"aspect_ratio"===e.slug))||null},[eO,e9,e5,e7,e8]),tr=(0,r.useMemo)(()=>{var e,t,i,n;if(e7&&(null==e8?void 0:e8.variants)){let e=e8.variants.find(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})});if(e)return(null===(i=e.inputs)||void 0===i?void 0:i.find(e=>{var t,i,n;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="file"&&(null===(n=e.validation_rules)||void 0===n?void 0:null===(i=n.accepted_resource_types)||void 0===i?void 0:i.includes("app_product_image"))}))||(null===(n=e.inputs)||void 0===n?void 0:n.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="file"}))||null}return ti&&((null===(e=ti.inputs)||void 0===e?void 0:e.find(e=>{var t,i,n;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="file"&&(null===(n=e.validation_rules)||void 0===n?void 0:null===(i=n.accepted_resource_types)||void 0===i?void 0:i.includes("app_product_image"))}))||(null===(t=ti.inputs)||void 0===t?void 0:t.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="file"})))||null},[ti,e7,e8]),to=(0,r.useCallback)(e=>{var t,i,n;let r=e9.find(t=>t.id===e),o=null==r?void 0:null===(t=r.inputs)||void 0===t?void 0:t.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="color_picker"});return o?(null===(i=eq[e])||void 0===i?void 0:i[o.slug])||(null===(n=o.default_value)||void 0===n?void 0:n.value)||"#000000":null},[e9,eq]),tl=(0,r.useCallback)((e,t,i)=>{eH(n=>({...n,[e]:{...n[e],[t.slug]:i}}))},[]),ta=(0,r.useMemo)(()=>{var e;return e8?"string"==typeof e8.display_name?e8.display_name:(null===(e=e8.display_name)||void 0===e?void 0:e.ar)||e8.name:""},[e8]),td=q({selectedProduct:c,selectedMode:g,selectedSubOption:b}),ts=(0,r.useMemo)(()=>{if(!te)return!1;let e=eV.trim(),t=te.validation_rules;if(!t)return e.length>0;if(t.required){if(0===e.length)return!1}else if(0===e.length)return!1;return(!(e.length>0)||void 0===t.min_length||!(e.length<t.min_length))&&(void 0===t.max_length||!(e.length>t.max_length))},[te,eV]),tc=(0,r.useMemo)(()=>e7?c&&null!==eB&&null!==e$&&ts:"TEMPLATES"===g?td&&c&&null!==eB&&null!==eO:td,[td,e7,c,eB,e$,eV,g,eO,ts,te]),tp=(0,r.useRef)(!1),tu=(0,r.useRef)(!1);(0,r.useEffect)(()=>{c&&!tp.current&&(tp.current=!0)},[c]),(0,r.useEffect)(()=>{g&&(tu.current=!0)},[g]),(0,r.useEffect)(()=>{("GENERATING"===m||"RESULT"===m)&&eG(!1)},[m]),(0,r.useEffect)(()=>{eO&&ti&&eH(e=>{var t,i,n,r;let o=e[eO]||{},l=!1,a={...o},d=null===(t=ti.inputs)||void 0===t?void 0:t.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="color_picker"});!d||d.slug in o||(a[d.slug]=(null===(n=d.default_value)||void 0===n?void 0:n.value)||"#000000",l=!0);let s=null===(i=ti.inputs)||void 0===i?void 0:i.find(e=>"aspect_ratio"===e.slug);if(s&&!(s.slug in o)){let e=null===(r=s.options)||void 0===r?void 0:r.find(e=>e.is_default);e&&(a[s.slug]=e.value,l=!0)}return l?{...e,[eO]:a}:e})},[eO,ti]),(0,r.useEffect)(()=>{if(!e7||!e8||!tt)return;let e=e8.variants.find(e=>{var t;return null===(t=e.inputs)||void 0===t?void 0:t.some(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="textarea"})});e&&eH(t=>{var i,n;let r=t[tt]||{},o=!1,l={...r},a=null===(i=e.inputs)||void 0===i?void 0:i.find(e=>"aspect_ratio"===e.slug);if(a&&!(a.slug in r)){let e=null===(n=a.options)||void 0===n?void 0:n.find(e=>e.is_default);e&&(l[a.slug]=e.value,o=!0)}return o?{...t,[tt]:l}:t})},[e7,e8,tt]);let th=(0,r.useCallback)(e=>{if(eF(e),z.current){let e=z.current;w.H7.AR.dir,requestAnimationFrame(()=>{e.scrollTo({left:0,behavior:"smooth"})})}},[eF,L]);(0,r.useCallback)(e=>{_(e)},[_]);let tx=(0,r.useCallback)(e=>{eD(e),eU(null),eG(!1),eQ(""),C("TEMPLATES"),_(e.toString())},[C,_]),tm=(0,r.useCallback)(()=>{eD(null),eU(null),eG(!1),C("TEMPLATES"),_("")},[C,_]),tg=(0,r.useCallback)(e=>{eU(e),eG(!1),_(e.toString())},[_]),tf=(0,r.useCallback)(e=>{eU(e),eD(null),eG(!1),C("TEMPLATES"),_(e.toString())},[C,_]),tv=(0,r.useCallback)(()=>
1{if(eW){if(e7&&tt&&te){if(c&&eB){var e;let t={};eV.trim()&&(t[te.slug]=eV.trim()),(null===(e=eq[tt])||void 0===e?void 0:e[(null==tn?void 0:tn.slug)||""])&&(t[(null==tn?void 0:tn.slug)||""]=eq[tt][(null==tn?void 0:tn.slug)||""]),S({templateId:tt,productImageId:eB,productImageInputSlug:null==tr?void 0:tr.slug,fieldValues:t})}return}if(eO&&c&&ti&&eB){let e=Object.entries(eq[eO]||{}).reduce((e,t)=>{var i;let[n,r]=t,o=null===(i=ti.inputs)||void 0===i?void 0:i.find(e=>e.slug===n);return o&&(e[o.slug]=r),e},{});S({templateId:eO,productImageId:eB,productImageInputSlug:null==tr?void 0:tr.slug,fieldValues:e})}else S();return}if(tn){eG(!0);return}if(e7&&tt&&te){if(c&&eB){let e={};eV.trim()&&(e[te.slug]=eV.trim()),S({templateId:tt,productImageId:eB,productImageInputSlug:null==tr?void 0:tr.slug,fieldValues:e})}return}if(eO){if(eO&&c&&ti&&eB){let e=Object.entries(eq[eO]||{}).reduce((e,t)=>{var i;let[n,r]=t,o=null===(i=ti.inputs)||void 0===i?void 0:i.find(e=>e.slug===n);return o&&(e[o.slug]=r),e},{});S({templateId:eO,productImageId:eB,productImageInputSlug:null==tr?void 0:tr.slug,fieldValues:e})}else S()}},[eO,tr,tn,eW,c,ti,eB,e7,tt,te,eV,eq,S]),tw=(0,r.useCallback)(()=>{eD(null),eU(null),eH({}),eG(!1),eQ(""),Z()},[Z]),tb=(0,r.useCallback)(()=>{eG(!1)},[]);return P?(0,n.jsx)(es,{children:(0,n.jsx)(F.ZP,{generationType:F.T2.IMAGE,status:F.Vr.PROCESSING,customDescription:"ÙØÙ ÙØ³ØØ¨ Ù
ÙØªØ¬Ø§ØªÙ Ù
Ù Ù
ØªØ¬Ø±Ù ÙØªØ¬ÙØ²ÙØ§ ÙÙØ§Ø³ØªØ®Ø¯Ø§Ù
",showCustomStatusLabel:!1})}):"GENERATING"===m?(0,n.jsx)(es,{children:(0,n.jsx)($,{executionId:j})}):"RESULT"===m&&y?(0,n.jsx)(es,{children:(0,n.jsx)(D.Z,{imageUrl:y,onReset:tw,onDownload:k,imageId:null!=eB?eB:void 0,productId:null!==(a=null==c?void 0:c.id)&&void 0!==a?a:void 0,executionNodeResultId:null!=E?E:void 0})}):(0,n.jsxs)(es,{children:[(0,n.jsx)(ew,{className:"".concat(c?"":"flex"),children:c?(0,n.jsx)(n.Fragment,{children:eW&&tn&&"CONFIGURING"===m?(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,className:"w-full flex items-center",children:(0,n.jsxs)("div",{style:{width:"100%",overflow:"hidden"},children:[(0,n.jsxs)(ec,{children:[(0,n.jsx)(s.Z,{src:"/icons/maximize-2.svg",width:"20px",height:"20px",fill:"var(--ph-color)"}),(0,n.jsx)(ep,{children:"string"==typeof tn.display_name?tn.display_name:(null===(t=tn.display_name)||void 0===t?void 0:t.ar)||"Ø§ÙØ®Ø·ÙØ© 3: اختر أبعاد Ø§ÙØµÙرة اÙÙÙØ§Ø¦ÙØ©"})]}),(0,n.jsx)("div",{style:{marginTop:"24px",width:"100%",overflow:"hidden"},children:(0,n.jsx)(f.Z,{direction:L,className:"relative hiddenScrollBar w-full",containerClassName:"hiddenScrollBar overflow-x-auto",id:"aspectRatioScroll",children:(0,n.jsx)(eP,{style:{flexWrap:"nowrap",minWidth:"max-content"},children:(()=>{var e;let t=e7&&tt?tt:eO;return null===(e=tn.options)||void 0===e?void 0:e.map(e=>{var i,r,o,l;let a=e.value,c=(null===(i=eq[t])||void 0===i?void 0:i[tn.slug])===a||!(null===(r=eq[t])||void 0===r?void 0:r[tn.slug])&&e.is_default,p=a.includes(":")?a:"1:1";return(0,n.jsxs)(eE,{children:[(0,n.jsx)(eT,{$isSelected:c,$aspectRatio:p,onClick:()=>{eH(e=>({...e,[t]:{...e[t],[tn.slug]:a}}))},children:(0,n.jsxs)(eL,{children:[eA?(0,n.jsx)(d(),{src:eA,alt:"string"==typeof e.display_label?e.display_label:(null===(o=e.display_label)||void 0===o?void 0:o.ar)||e.value,fill:!0,style:{objectFit:"cover"}}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",background:"#1a1a1a",display:"flex",alignItems:"center",justifyContent:"center",color:"#888"},children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ±Ø©"}),(0,n.jsx)(ea,{$isSelected:c,children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})})]})}),(0,n.jsx)(eM,{children:"string"==typeof e.display_label?e.display_label:(null===(l=e.display_label)||void 0===l?void 0:l.ar)||e.value})]},e.value)})})()})})})]})}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsxs)(ec,{children:[(0,n.jsx)(s.Z,{src:"/icons/gallery.svg",width:"20px",height:"20px",fill:"var(--ph-color)"}),(0,n.jsx)(ep,{children:"Ø§ÙØ®Ø·ÙØ© 1: ØØ¯Ø¯ ØµÙØ±Ø© اÙÙ
ÙØªØ¬"})]}),R.isScrollable&&(0,n.jsx)(G.Z,{isAtLeftEnd:R.isAtLeftEnd,isAtRightEnd:R.isAtRightEnd,leftButtonId:"productImagesLeftBtn",rightButtonId:"productImagesRightBtn",language:M})]})}),(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:100,children:(0,n.jsx)(eu,{children:(0,n.jsx)(f.Z,{direction:L,className:"relative overflow-x-scroll hiddenScrollBar",containerClassName:"hiddenScrollBar",elementRef:z,id:"productImagesScroll",onScroll:R.handleScroll,onCanScroll:e=>{e&&R.reinitializeSlider()},children:(0,n.jsx)(eh,{children:(()=>{let e=[...ez];if(null!==eR&&eR>=0){let t=e[eR];e.splice(eR,1),e.unshift(t)}return e.map((e,t)=>{let i=ez.indexOf(e);return(0,n.jsx)(eN,{imageUrl:e,productName:c.name,index:i,isSelected:eR===i,onClick:th},"".concat(e,"-").concat(i))})})()})})})}),(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:200,animateO
1nMount:!tp.current,children:(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,n.jsxs)(ec,{children:[(0,n.jsx)(s.Z,{src:"/icons/camera-02.svg",width:"20px",height:"20px",stroke:"var(--ph-color)"}),(0,n.jsx)(ep,{children:"Ø§ÙØ®Ø·ÙØ© 2: اختر طرÙÙØ© عرض اÙÙ
ÙØªØ¬"})]}),B.isScrollable&&(0,n.jsx)(G.Z,{isAtLeftEnd:B.isAtLeftEnd,isAtRightEnd:B.isAtRightEnd,leftButtonId:"firstThreeTemplatesLeftBtn",rightButtonId:"firstThreeTemplatesRightBtn",language:M})]})}),(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:250,animateOnMount:!tp.current,children:eJ?(0,n.jsx)("div",{style:{color:"#888",marginTop:"24px"},children:"جار٠تØÙ
Ù٠اÙÙÙØ§Ùب..."}):(0,n.jsx)(f.Z,{direction:L,className:"relative overflow-x-scroll hiddenScrollBar",containerClassName:"hiddenScrollBar pt-2",id:"firstThreeTemplatesScroll",onScroll:B.handleScroll,onCanScroll:e=>{e&&B.reinitializeSlider()},children:(0,n.jsxs)(Q,{style:{flexWrap:"nowrap",minWidth:"max-content",marginTop:16},children:[e3.map(e=>{var t,i,r,o,l,a;return(0,n.jsx)(Y,{$isSelected:e$===e.id,onClick:()=>tx(e.id),style:{flexShrink:0},children:(0,n.jsxs)(X,{children:[(null===(i=e.variants)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.thumbnail_url)||(null===(o=e.variants)||void 0===o?void 0:null===(r=o[0])||void 0===r?void 0:r.preview_image_url)?(0,n.jsx)(d(),{src:e.variants[0].thumbnail_url||e.variants[0].preview_image_url,alt:"string"==typeof e.display_name?e.display_name:(null===(l=e.display_name)||void 0===l?void 0:l.ar)||"",fill:!0,style:{objectFit:"cover",objectPosition:"top"}}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",background:"#1a1a1a",display:"flex",alignItems:"center",justifyContent:"center",color:"#888"},children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ±Ø©"}),(0,n.jsx)(ee,{$isSelected:e$===e.id,children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})}),(0,n.jsx)(K,{}),(0,n.jsx)(J,{children:"string"==typeof e.display_name?e.display_name:(null===(a=e.display_name)||void 0===a?void 0:a.ar)||e.name})]})},e.id)}),e4.length>0&&(0,n.jsx)(Y,{$isSelected:"TEMPLATES"===g&&!e$,onClick:tm,style:{flexShrink:0,backgroundColor:"#fff"},children:(0,n.jsxs)(X,{children:[(0,n.jsx)("img",{src:"/images/Frame 1410116625.png",alt:"ÙÙØ§Ùب Ø¬Ø§ÙØ²Ø©",style:{width:"100%",height:"100%",objectFit:"cover",objectPosition:"top"}}),(0,n.jsx)(ee,{$isSelected:"TEMPLATES"===g&&!e$,children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})}),(0,n.jsx)(K,{}),(0,n.jsx)(J,{children:"ÙÙØ§Ùب Ø¬Ø§ÙØ²Ø©"})]})})]})})}),e$&&(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:300,children:(0,n.jsxs)("div",{style:{width:"100%",overflow:"hidden"},children:[(0,n.jsx)(ec,{children:(0,n.jsx)(ep,{children:e7&&te?"string"==typeof te.display_name?te.display_name:(null===(i=te.display_name)||void 0===i?void 0:i.ar)||ta||"اختر Ù
ØªØºÙØ± اÙÙØ§Ùب":ta||"اختر Ù
ØªØºÙØ± اÙÙØ§Ùب"})}),e7&&te?(0,n.jsx)("div",{style:{marginTop:"16px"},children:(0,n.jsx)(A,{value:eV,onChange:e=>eQ(e.target.value),placeholder:"string"==typeof te.placeholder?te.placeholder:(null===(o=te.placeholder)||void 0===o?void 0:o.ar)||(null===(l=te.display_name)||void 0===l?void 0:l.ar)||"Ø§ÙØªØ¨ اÙÙØµ ÙÙØ§..."})}):0===e9.length?(0,n.jsx)("div",{style:{color:"#888",marginTop:"16px"},children:"ÙØ§ ØªÙØ¬Ø¯ Ù
ØªØºÙØ±Ø§Øª Ù
ØªØ§ØØ©"}):(0,n.jsx)("div",{style:{marginTop:"16px",width:"100%",overflow:"hidden"},children:(0,n.jsx)(f.Z,{direction:L,className:"relative hiddenScrollBar w-full",containerClassName:"hiddenScrollBar overflow-x-auto",id:"templateVariantsScroll",children:(0,n.jsx)(er,{className:"mt-4",style:{flexWrap:"nowrap",minWidth:"max-content",gap:"12px"},children:e9.map(e=>{var t;let i=null===(t=e.inputs)||void 0===t?void 0:t.find(e=>{var t;return(null===(t=e.input_type)||void 0===t?void 0:t.input_type)==="color_picker"}),r=to(e.id);return(0,n.jsxs)(eo,{$isSelected:eO===e.id,onClick:()=>tg(e.id),style:i&&r?{backgroundColor:r}:{backgroundColor:"#fff"},children:[(0,n.jsxs)(el,{children:[e.thumbnail_url||e.preview_image_url?(0,n.jsx)(d(),{src:e.thumbnail_url||e.preview_image_url,alt:"Variant ".concat(e.id),fill:!0,style:{objectFit:"cover"}}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",background:"#1a1a1a",display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:"12px"},children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ±Ø©"}),(0,n.jsx)(ea,{$isSelected:eO===e.id,children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})})]}),i&&r&&(0,n.jsx)("div",{style:{position:"absolute",top:"8px",right:"8px",zIndex:3},onClick:e=>e.stopPropagation(),children:(0,n.jsx)(O.Z,{value:r,className:"p-1.5 !bg-transparent !bg-[linear-gradient(0deg,_rgba(255,_255,_255,_0.05),_rgba(255,_255,_255,_0.05)),linear-gradient(0deg,_rgba(26,_26,_26,_0.5),_rgba(26,_26,_26,_0.5))]",classNameColorWrapper:"xl:w-4 xl:h-4 w-3 h-3 rounded ",onChange:t=>tl(e.id,i,t)})})]},e.id)})})})})]})}),e5.length>0&&"TEMPLATES"===g&&!e$&&(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:300,children:(0,n.jsxs)("div",{style:{marginTop:"32px"},children:[(0,n.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"16
1px"},children:[(0,n.jsx)(ec,{children:(0,n.jsx)(ep,{children:"اÙÙ
Ø²ÙØ¯ Ù
٠اÙÙÙØ§Ùب"})}),ex.isScrollable&&(0,n.jsx)(G.Z,{isAtLeftEnd:ex.isAtLeftEnd,isAtRightEnd:ex.isAtRightEnd,leftButtonId:"remainingTemplatesLeftBtn",rightButtonId:"remainingTemplatesRightBtn",language:M})]}),eJ?(0,n.jsx)("div",{style:{color:"#888",marginTop:"16px"},children:"جار٠تØÙ
Ù٠اÙÙÙØ§Ùب..."}):(0,n.jsxs)("div",{style:{position:"relative",marginTop:"16px"},children:[(0,n.jsx)(f.Z,{direction:L,className:"relative overflow-x-scroll hiddenScrollBar",containerClassName:"hiddenScrollBar",elementRef:N,id:"remainingTemplatesScroll",onScroll:e=>{e2(e),ex.handleScroll()},onCanScroll:e=>{e&&ex.reinitializeSlider()},children:(0,n.jsx)("div",{style:{display:"flex",gap:"12px"},children:e5.map(e=>(0,n.jsx)(et,{$isSelected:eO===e.id,onClick:()=>tf(e.id),style:{width:"147px",flexShrink:0},children:(0,n.jsxs)(ei,{children:[e.thumbnail_url||e.preview_image_url?(0,n.jsx)(d(),{src:e.thumbnail_url||e.preview_image_url,alt:e.templateName||"Variant ".concat(e.id),fill:!0,style:{objectFit:"cover"}}):(0,n.jsx)("div",{style:{width:"100%",height:"100%",background:"#1a1a1a",display:"flex",alignItems:"center",justifyContent:"center",color:"#888"},children:"ÙØ§ ØªÙØ¬Ø¯ ØµÙØ±Ø©"}),(0,n.jsx)(en,{$isSelected:eO===e.id,children:(0,n.jsx)(s.Z,{src:"/icons/tick-circle-gradient-fill.svg",width:"16px",height:"16px"})})]})},e.id))})}),e1&&(0,n.jsxs)("div",{style:{position:"absolute",bottom:"-50px",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",gap:"8px",color:"#888",fontSize:"14px"},children:[(0,n.jsx)("div",{className:"loader",style:{width:"16px",height:"16px",border:"2px solid #888",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 0.6s linear infinite"}}),(0,n.jsx)("span",{children:"جار٠تØÙ
Ù٠اÙÙ
Ø²ÙØ¯ Ù
٠اÙÙÙØ§Ùب..."})]})]})]})})]})}):(0,n.jsx)(H.Z,{animation:"fade",duration:400,className:"w-full flex items-center justify-center",children:(0,n.jsxs)(eb,{children:[(0,n.jsx)(ey,{children:"Ø£ÙØ´Ø¦ ØµÙØ±Ùا Ø£ÙØ¶Ù ÙÙ
ÙØªØ¬Ù باستخداÙ
Ø§ÙØ°Ùاء Ø§ÙØ§ØµØ·ÙاعÙ"}),(0,n.jsx)(ej,{children:"استخدÙ
ØµÙØ± Ù
ÙØªØ¬Ù Ø§ÙØØ§ÙÙ ÙÙ
رجع ÙØ¥Ùشاء ØµÙØ± Ø¬Ø¯ÙØ¯Ø© جذابة ÙØ¹Ø§ÙÙØ© Ø§ÙØ¬Ùدة Ù
ع Ø§ÙØÙØ§Ø¸ عÙÙ ØªÙØ§ØµÙ٠اÙÙ
ÙØªØ¬ Ø§ÙØÙÙÙÙØ©."}),(0,n.jsxs)(eI,{children:[(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:100,children:(0,n.jsx)(p.E,{radius:"16px",$afterBg:"var(--eerie-black)",padding:"1px",children:(0,n.jsxs)(eC,{children:[(0,n.jsxs)(eS,{children:[(0,n.jsx)(e_,{children:"1"}),(0,n.jsx)("img",{src:"/images/onboarding-step-1.png",alt:"ØØ¯Ø¯ ØµÙØ±Ø© اÙÙ
ÙØªØ¬",style:{width:"100%",height:"100%",objectFit:"cover"}})]}),(0,n.jsx)(eZ,{children:"ØØ¯Ø¯ ØµÙØ±Ø© اÙÙ
ÙØªØ¬"}),(0,n.jsx)(ek,{children:"اختر Ø¥ØØ¯Ù ØµÙØ± Ù
ÙØªØ¬Ù Ø§ÙØØ§ÙÙØ© ÙØ§Ø³ØªØ®Ø¯Ø§Ù
ÙØ§ ÙÙ
رجع."})]})})}),(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:200,children:(0,n.jsx)(p.E,{radius:"16px",$afterBg:"var(--eerie-black)",padding:"1px",children:(0,n.jsxs)(eC,{children:[(0,n.jsxs)(eS,{children:[(0,n.jsx)(e_,{children:"2"}),(0,n.jsx)("img",{src:"/images/onboarding-step-2.png",alt:"اختر ÙØ¶Ø¹ Ø§ÙØµÙرة",style:{width:"100%",height:"100%",objectFit:"cover"}})]}),(0,n.jsx)(eZ,{children:"اختر ÙØ¶Ø¹ Ø§ÙØµÙرة"}),(0,n.jsx)(ek,{children:"اختر Ø§ÙØ´ÙÙ Ø§ÙØ°Ù ÙØ¬Ø¨ Ø£Ù ÙØ¨Ø¯Ù عÙÙÙ Ù
ÙØªØ¬Ù - Ø§ÙØ§Ø³ØªÙدÙ٠أ٠اÙÙÙ
ÙØ°Ø¬ أ٠اÙÙ
Ø´ÙØ¯ اÙÙ
خصص."})]})})}),(0,n.jsx)(H.Z,{animation:"slideUp",duration:300,delay:300,children:(0,n.jsx)(p.E,{radius:"16px",$afterBg:"var(--eerie-black)",padding:"1px",children:(0,n.jsxs)(eC,{children:[(0,n.jsxs)(eS,{children:[(0,n.jsx)("img",{src:"/images/onboarding-step-3.png",alt:"تÙÙÙØ¯ ØµÙØ±Ø© Ø¬Ø¯ÙØ¯Ø©",style:{width:"100%",height:"100%",objectFit:"cover"}}),(0,n.jsx)("div",{className:"absolute top-0 left-0 w-full h-full p-[17px]",children:(0,n.jsx)(ed.Z,{className:"w-full h-full",afterClassName:"bg-white",handlerClassName:"w-[32px] h-[32px] bg-secondary",svgOptions:{color:"#FFFFFF",width:"12px",height:"12px"},sample:{before:"/images/onboarding-next-image.png",after:"/images/onboarding-prev-image.png"}})}),(0,n.jsx)(e_,{children:"3"})]}),(0,n.jsx)(eZ,{children:"تÙÙÙØ¯ ØµÙØ±Ø© Ø¬Ø¯ÙØ¯Ø©"}),(0,n.jsx)(ek,{children:"ÙÙÙÙ
Ø§ÙØ°Ùاء Ø§ÙØ§ØµØ·ÙØ§Ø¹Ù Ø¨Ø¥ÙØ´Ø§Ø¡ ØµÙØ±Ø© Ø¬Ø¯ÙØ¯Ø© Ù
ع Ø§ÙØÙØ§Ø¸ عÙÙ Ø§ÙØ´ÙÙ ÙØ§ÙØ£ÙÙØ§Ù ÙØ§ÙØªÙØ§ØµÙÙ ÙÙ
ÙØªØ¬Ù."})]})})})]})]})})}),c&&(0,n.jsx)(eg,{children:(0,n.jsxs)(H.Z,{animation:"slideUp",duration:300,delay:400,className:"flex items-center gap-4 w-full md:w-auto",children:[eW&&tn&&"CONFIGURING"===m&&(0,n.jsx)(p.E,{$isSelected:!0,radius:"12px",$afterBg:"var(--eerie-black)",padding:"1px",children:(0,n.jsx)(ev,{onClick:tb,children:"Ø§ÙØ±Ø¬Ùع"})}),(0,n.jsx)(ef,{disabled:!tc||I,onClick:e=>{e.preventDefault(),e.stopPropagation(),tv()},className:"flex-1 md:flex-none",children:I?(0,n.jsx)(h.Z,{children:(0,n.jsx)(x.Z,{className:"loader",size:"small"})}):"تÙÙÙØ¯ Ø§ÙØµÙرة"})]})})]})}),eR=i(31481),eA=i(10397),eF=i(47713),eB=!0;let e$=l.ZP.div.withConfig({componentId:"sc-47afa238-0"})(["display:flex;flex-direction:row;padding-right:32px;@media (max-width:1024px){flex-direction:column;padding-right:0;padding:0 16px;}@media (max-width:640px){padding:0 12px;}"]),eD=l.ZP.div.withConfig({componentId:"sc-47afa238-1"})(["flex:1;display:flex;overflow:auto;gap:24px;@media (max-width:1024px){flex-direction:column;gap:16px;}@media (max-width:640px){gap:12px;}"]);var eO=()=>{let e=(0,o.useRouter)(),t=r.useContext(eA.pm),i=null==t?void 0:t.user,{selectedProduct:l,workflowStep:a,selectedMode:d,selectedSubOption:s,generatedImage:p,executionId:u,resultId:h,isGenerating:x,handleProductSelect:m,handleModeSelect:g,handleSubOptionSelect:f,handleGenerate:v,handleReset:w,handleDownload:b}=(0,eR.y)(),{isLoading:y}=(0,c.L)(),j=(0,r.useMemo)(()=>null==l?void 0:l.id,[null==l?void 0:l.id]);return(0,r.useEffect)(()=>
1{if((null==t||!t.isFetchingUserData)&&(null==i?void 0:i.id)&&(null==i?void 0:i.user_should_change_password)){let t=(0,eF.kM)(e.pathname,"change-password"),i="".concat(t,"?redirectTo=").concat(encodeURIComponent(e.asPath));e.push(i).catch(()=>{window.location.href="".concat(window.location.origin).concat(i)})}},[i,e,null==t?void 0:t.isFetchingUserData]),(0,n.jsx)(e$,{children:(0,n.jsxs)(eD,{children:[(0,n.jsx)(R,{selectedProductId:j,onProductSelect:(e,t,i)=>{null!==e&&m(e,t,i)},isGenerating:x}),(0,n.jsx)(ez,{selectedProduct:l,workflowStep:a,selectedMode:d,selectedSubOption:s,generatedImage:p,executionId:u,resultId:h,isGenerating:x,onModeSelect:g,onSubOptionSelect:f,onGenerate:v,onReset:w,onDownload:b,isLoadingProducts:y})]})})}}},function(e){e.O(0,[38257,25675,27166,92888,49774,40179],function(){return e(e.s=34311)}),_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.