1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[466],{62211:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/ai-photosessiya",function(){return a(718)}])},74762:function(e,t,a){"use strict";a.d(t,{Z:function(){return ImageGeneration}});var l=a(85893);a(67294);var n=a(42444),o=a(20640),s=a.n(o),c=a(40477),d=a.n(c),m=a(39913),p=a(9274),h=a(83697),g=a(95539),x=a(45383);function ImageGeneration(e){let{canUseAsInput:t,canUpscale:a,canImageToUpscale:o,canVariations:c,canReload:f,showPrompt:v=!0,showUpscaledLabel:b=!0,images:_,setPrompt:j,setPromptTask:y,presetOptions:w=[],handleImageClick:N,handleDownloadClick:I,handleImageVariation:C,handleImageUpscale:E,handleImageDelete:T,handleImageReload:F,handleImageToVideo:P,handleImageToUpscale:S,useAsInput:U,canShare:L=!0}=e,copyPrompt=(e,t)=>{j(e);let a=!1;if(t&&y){let e=w.find(e=>e.label===t);e&&(y(e),a=!0)}s()(e),(0,g.Qm)(a?"ТекÑÑ Ð²ÑÑавлен в поле, пÑеÑÐµÑ \xab".concat(t,"\xbb вÑбÑан авÑомаÑиÑеÑки!"):"ТекÑÑ ÑкопиÑован в бÑÑÐµÑ Ð¾Ð±Ð¼ÐµÐ½Ð° и вÑÑавлен в поле Ð´Ð»Ñ Ð³ÐµÐ½ÐµÑаÑии!")},reloadImage=e=>{F(e)},deleteImage=e=>{let t=confirm("ÐÑ ÑвеÑенÑ, ÑÑо Ñ
оÑиÑе ÑдалиÑÑ ÑÑо изобÑажение?");t&&T(e.id)},downloadOne=e=>{I(e.image_name)},generateUpscale=e=>{E(e)},imageToVideo=e=>{P(e)},imageToUpscale=e=>{S(e)};return(0,l.jsx)(l.Fragment,{children:(0,l.jsx)("div",{id:"generation_block",className:"techwave_fn_image_generation_page",children:(0,l.jsx)("div",{className:"generation__page",children:(0,l.jsx)("div",{className:"generation_history",children:_.map((e,s)=>(0,l.jsxs)("div",{className:"fn__generation_item",children:[e.id&&e.image_url&&(0,l.jsx)("div",{className:"item_header",children:(0,l.jsxs)("div",{className:"item_icons",children:[L&&(0,l.jsx)(h.T,{type:"image",id:e.id,image:e.image_url,title:e.prompt}),t&&(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>U(e),"data-tooltip-id":"useAsInput-image-tooltip","data-tooltip-content":"ÐÑодолжиÑÑ ÑедакÑиÑоваÑÑ","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"useAsInput-image-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:(0,l.jsx)(p.fmQ,{size:16})})]})}),(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>imageToVideo(e),"data-tooltip-id":"image-to-video-tooltip","data-tooltip-content":"ÐживиÑÑ ÑоÑо","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"image-to-video-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.kb})]})}),o&&!e.upscaled&&(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>imageToUpscale(e),"data-tooltip-id":"upscale-image-tooltip","data-tooltip-content":"УлÑÑÑиÑÑ ÐºÐ°ÑеÑÑво ÑоÑо","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"upscale-image-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:(0,l.jsx)(m.Ia5,{size:16})})]})}),(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>downloadOne(e),"data-tooltip-id":"download-image-tooltip","data-tooltip-content":"СкаÑаÑÑ","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"download-image-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.UW})]})}),a&&!e.upscaled&&(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>generateUpscale(e),"data-tooltip-id":"upscale-image-tooltip","data-tooltip-content":"УлÑÑÑиÑÑ Ð´Ð¾ 4Ð","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"upscale-image-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.Ee})]})}),f&&(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>reloadImage(e),"data-tooltip-id":"repeat-image-tooltip","data-tooltip-content":"ÐовÑоÑиÑÑ Ð³ÐµÐ½ÐµÑаÑиÑ","data-tooltip-place":"top",children:[(0,l.jsx)("div",{children:(0,l.jsx)(n.u,{id:"repeat-image-tooltip"})}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.wA})]})}),(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>deleteImage(e),"data-tooltip-id":"delete-image-tooltip","data-tooltip-content":"УдалиÑÑ","data-tooltip-place":"top",children:[(0,l.jsx)(n.u,{id:"delete-image-tooltip"}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.HG})]})})]})}),(0,l.jsx)("div",{className:"item_list",children:(0,l.jsx)("ul",{className:"fn__generation_list",children:(0,l.jsx)("li",{className:"fn__gl_item",children:(0,l.jsx)("div",{className:"fn__gl__item",children:(0,l.jsx)("div",{className:"abs_item",children:e.image_url?(0,l.jsxs)(l.Fragment,{children:[e.deleted?(0,l.jsx)("img",{src:"deleted-image.jpg",alt:"*",className:"h-auto w-auto"}):e.image_url_before?(0,l.jsx)(d(),{firstImage:{imageUrl:e.image_url},secondImage:{imageUrl:e.image_url_before},delimiterIconStyles:{width:"50px",height:"50px",backgroundSize:"contain",backgroundPosition:"center center",backgroundRepeat:"no-repeat",borderRadius:"none",backgroundImage:"url(/assets/images/rows.svg)"}}):(0,l.jsx)("img",{className:"cursorZoom",src:e.image_url,alt:"",onClick:()=>N(e.image_url)}),b&&e.upscaled&&(0,l.jsx)("div",{className:"upscaled",children:(0,l.jsx)("img",{src:"/assets/images/4k.svg",alt:"4k"})})]}):(0,l.jsx)("div",{className:"just-loader-css"})})})})})}),v&&e.prompt&&(0,l.jsxs)("div",{className:"item_footer",style:{justifyContent:"flex-start",ga
1p:"12px",flexWrap:"wrap"},children:[(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right",children:(0,l.jsxs)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:()=>copyPrompt(e.prompt,e.prompt_addition),"data-tooltip-id":"copy-prompt-tooltip","data-tooltip-content":"СкопиÑоваÑÑ Ð¿ÑомÑ","data-tooltip-place":"top",children:[(0,l.jsx)("div",{children:(0,l.jsx)(n.u,{id:"copy-prompt-tooltip"})}),(0,l.jsx)("span",{className:"fn__icon_button",children:x.CK})]})}),e.prompt_addition&&(0,l.jsx)("span",{className:"inline-flex max-w-full shrink-0 rounded-full border border-primary px-3 py-1 text-sm font-semibold leading-tight text-primary",children:e.prompt_addition}),(0,l.jsx)("textarea",{className:"textarea item_footer__textarea min-w-[160px] flex-1",name:"prompt",id:e.id||s,defaultValue:e.prompt})]})]},e.id||s))})})})})}},67750:function(e,t,a){"use strict";a.d(t,{Z:function(){return ImageModal}});var l=a(85893);function ImageModal(e){let{imageUrl:t,onClose:a}=e;return(0,l.jsx)("div",{onClick:a,className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-50",children:(0,l.jsxs)("div",{className:"relative max-h-full max-w-full",children:[(0,l.jsx)("button",{onClick:a,className:"absolute right-2 top-2 flex h-10 w-10 items-center justify-center rounded-full bg-black/50 text-3xl leading-none text-white",children:(0,l.jsx)("span",{className:"transition-transform duration-300 ease-in-out hover:rotate-90",children:"\xd7"})}),(0,l.jsx)("img",{src:t,alt:"Image",className:"mx-auto h-full max-h-[90vh] max-w-full rounded-[8px] object-contain"})]})})}a(67294)},39507:function(e,t,a){"use strict";var l=a(85893),n=a(67294),o=a(44080),s=a(46125),c=a(85945),d=a(67421),m=a(42444),p=a(93967),h=a.n(p),g=a(67384),x=a(95233),f=a(12842),v=a(12746),b=a(20559),_=a(61144),j=a(3247);t.Z=e=>{let{imagePickerLabel:t="Свой Ñайл",uploadImageUrl:a,setUploadImageUrl:p,buttonClassName:y,id:w,setId:N}=e,{t:I}=(0,d.$G)(),C=(0,c.NL)(),E=(0,n.useRef)(null),[T,F]=(0,n.useState)(!1),[P,S]=(0,n.useState)(9),[U,L]=(0,n.useState)(1),[M,O]=(0,n.useState)(null),{isLoading:Z,handleUpload:D,selectedImage:R,selectedImageSrc:A,selectedImageType:q,setSelectedImage:B,imageGallery:X,handleImageInputChange:Q,handleImagePickerClick:W,handleImageDelete:$}=(0,x.T)(F),K=Array.isArray(X)?X:[],J=K.slice(0,P),loadMoreGallery=()=>{S(e=>{let t=Math.min(e+9,K.length);return L(a=>a>=e?Math.min(t,e+1):a),t})},loadNextImage=e=>{L(t=>Math.min(P,Math.max(t,e+2)))},pickImage=e=>{N(null==e?void 0:e.id),p(null==e?void 0:e.file_path),F(!1)},deleteImage=e=>{console.log("deleteImage",e);let t=confirm("ÐÑ ÑвеÑенÑ, ÑÑо Ñ
оÑиÑе ÑдалиÑÑ ÑÑо изобÑажение?");t&&$(e.id)},saveEditedImage=async e=>{var t;let a=await (0,j.f)(e),l=await (0,_.cT)(a,!1,void 0,void 0,void 0,!0),n=(null==l?void 0:null===(t=l.data)||void 0===t?void 0:t.file_path)?l.data:(null==l?void 0:l.file_path)?l:null;if(!(null==n?void 0:n.file_path))throw Error("Upload response does not contain file_path");p(n.file_path),N(n.id),await C.invalidateQueries(["myimages"]),F(!1)};return(0,n.useEffect)(()=>{R&&D().then(e=>{(null==e?void 0:e.data)&&(p(e.data.file_path),N(e.data.id),F(!1))})},[R]),(0,n.useEffect)(()=>{T&&(S(9),L(1),requestAnimationFrame(()=>{var e;return null===(e=E.current)||void 0===e?void 0:e.scrollTo({top:0})}))},[T]),(0,n.useEffect)(()=>{if(!T||P>=K.length)return;let e=requestAnimationFrame(()=>{let e=E.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight;t<=240&&loadMoreGallery()});return()=>cancelAnimationFrame(e)},[T,P,K.length]),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"relative h-full w-full min-w-[180px] flex-1 md:min-w-[200px]",children:[(0,l.jsxs)("button",{type:"button",name:"submit",className:h()("btn btn-outline-primary group relative flex h-full max-h-24 min-h-12 w-full items-center justify-end overflow-hidden rounded-lg text-right",y),style:{borderWidth:1},onClick:()=>{a?(B(void 0),pickImage(void 0)):F(!0)},children:[(0,l.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 flex h-full w-28 items-center pr-4",children:a?(0,l.jsx)("span",{className:"relative block h-full w-20 overflow-hidden bg-gray-100",children:(0,l.jsx)(v.Z,{withLoader:!0,priority:!0,src:null==a?void 0:a.toString(),alt:"Uploaded",className:"h-full w-full object-cover group-hover:bg-white"})}):(0,l.jsx)("i",{className:"ml-4 text-primary group-hover:text-secondary",children:"ââ"})}),(0,l.jsx)("div",{className:h()("relative z-10 flex min-w-0 flex-1 items-center justify-end",a&&"pl-28"),children:a?(0,l.jsxs)("span",{className:"flex shrink-0 items-center gap-2 whitespace-nowrap text-sm font-semibold",children:[(0,l.jsx)("span",{children:"СбÑоÑиÑÑ"}),(0,l.jsx)("span",{className:"text-xl font-normal leading-none",children:"â"})]}):t})]}),a&&(0,l.jsx)("button",{type:"button","aria-label":"ÐадÑиÑоваÑÑ Ð¸ повеÑнÑÑÑ ÑоÑогÑаÑиÑ",title:"РедакÑиÑоваÑÑ ÑоÑо","data-tooltip-id":"single-image-edit-tooltip","data-tooltip-content":"РедакÑиÑоваÑÑ","data-tooltip-place":"top",className:"absolute top-1/2 z-20 grid h-7 w-7 -translate-y-1/2 place-items-center rounded-full border border-primary bg-white text-primary shadow-[0_3px_10px_rgba(132,0,255,0.14)] transition hover:scale-105 hover:border-primary hover:bg-primary/5 hover:shadow-[0_6px_18px_rgba(132,0,255,0.32)]",style:{left:86},onClick:e=>{e.stopPropagation(),O({id:w,file_path:a})},children:(0,l.jsx)(g.zmo,{size:15})})]}),(0,l.jsx)(o.u,{appear:!0,show:!!T,as:n.Fragment,children:(0,l.jsxs)(s.V,{as:"div",open:T,onClose:()=>!M&&F(!1),children:[(0,l.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0"})}),(0,l.jsx)("div",{className:"artinki-picker-dialog-viewport fixed inset-0 z-[999] overflow-y-auto bg-[black]/60",children:(0,l.jsx)("div",{className:"artinki-picker-dialog-positioner flex min-h-screen items-center justify-center px-4",children:(0,l.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,l.jsxs)(s.V.Panel,{as:"div",className:"artinki-picker-dialog-panel panel my-8 w-full max-w-lg overflow-hidden rounded-lg border-0 p-0 text-black dark:text-white-dark",children:[(0,l.jsx)("div",{className:"mr-4 mt-4 flex items-center justify-end space-x-4",children:(0,l.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>F(!1),children:"X"})}),(0,l.jsxs)("div",{className:"p-5",children:[(0,l.jsx)("div",{children:(0,l.jsx)("input",{id:"input_file",type:"file",accept:"image/*",onChange:Q,className:"artinki-picker-file-input rtl:file-ml-5 form-input mt-2 w-full max-w-full p-0 file:border-0 file:bg-primary/90 file:px-4 file:py-2 file:font-semibold file:text-white file:hover:bg-primary ltr:file:mr-5"})}),R&&(0,l.jsxs)("div",{className:"mt-8 flex flex-col items-start justify-center",children:[(0,l.jsx)("div",{className:"relative h-80 w-full",children:(0,l.jsx)(v.Z,{withLoader:!0,priority:!0,src:A,alt:"Selected",className:"cursor-pointer rounded-lg object-cover",onClick:()=>F(!0)})}),(0,l.jsx)("button",{type:"button",className:"btn btn-primary mt-3",onClick:()=>D(),children:(0,l.jsx)(f.Z,{normalText:"ÐагÑÑзиÑÑ",loadingText:"ÐагÑÑзка....",isBtnLoading:Z})})]}),(null==X?void 0:X.length)>0&&(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)("div",{className:"single-image-picker-grid grid h-full max-h-[50vh] gap-4 overflow-y-auto",ref:E,onScroll:e=>{if(P>=K.length)return;let t=e.currentTarget,a=t.scrollHeight-t.scrollTop-t.clientHeight;a<=240&&loadMoreGallery()},children:J.map((e,t)=>(0,l.jsxs)("div",{className:h()("single-image-picker-item relative mt-[10px] min-w-0 cursor-pointer rounded-lg border-2",{"border-transparent":a!==(null==e?void 0:e.file_path),"border-primary":a===(null==e?void 0:e.file_path)}),onClick:()=>{pickImage(e)},children:[(0,l.jsx)("div",{className:"fn__icon_options medium_size align_right absolute right-[-10px] top-[-10px] z-10",children:(0,l.jsx)("div",{className:"fn__icon_button fn__icon_button_gray",onClick:t=>{t.stopPropagation(),deleteImage(e)},children:(0,l.jsx)("span",{className:"fn__icon_button",children:(0,l.jsx)(g.FH3,{size:16})})})}
1),t<U?(0,l.jsx)(v.Z,{withLoader:!0,priority:0===t,src:null==e?void 0:e.file_path,alt:"Image ".concat(t+1),className:"h-full w-full rounded-lg object-cover",lazyRoot:E,onLoadingComplete:()=>loadNextImage(t),onError:()=>loadNextImage(t)}):(0,l.jsx)("span",{className:"single-image-picker-placeholder","aria-hidden":"true"}),(0,l.jsx)("button",{type:"button","aria-label":"ÐадÑиÑоваÑÑ Ð¸ повеÑнÑÑÑ ÑоÑогÑаÑиÑ",title:"РедакÑиÑоваÑÑ ÑоÑо","data-tooltip-id":"single-image-edit-tooltip","data-tooltip-content":"РедакÑиÑоваÑÑ","data-tooltip-place":"top",className:"absolute z-20 flex h-8 w-8 items-center justify-center rounded-full border-2 border-white bg-white text-primary shadow-[0_4px_12px_rgba(15,23,42,0.2)] transition hover:scale-110 hover:border-primary hover:bg-primary hover:text-white hover:shadow-[0_6px_18px_rgba(132,0,255,0.32)]",style:{right:10,bottom:10},onClick:t=>{t.stopPropagation(),O(e)},children:(0,l.jsx)(g.zmo,{size:18})})]},null==e?void 0:e.file_path))})})]})]})})})})]})}),(0,l.jsx)(m.u,{id:"single-image-edit-tooltip"}),(0,l.jsx)(b.Z,{open:!!M,imageUrl:null==M?void 0:M.file_path,onClose:()=>O(null),onSave:saveEditedImage})]})}},87438:function(e,t,a){"use strict";var l=a(85893),n=a(67294),o=a(44080),s=a(46125),c=a(67421),d=a(93967),m=a.n(d);t.Z=e=>{var t;let{selectLabel:a="СÑилÑ",typeButtons:d=!0,selectedOption:p,options:h,onChange:g,color:x,buttonClassName:f,emptyIcon:v,filterButtons:b,defaultOptionsTypeFilter:_=null}=e,{t:j}=(0,c.$G)(),[y,w]=(0,n.useState)(!1),[N,I]=(0,n.useState)(0),[C,E]=(0,n.useState)(_),T=(0,n.useMemo)(()=>C?h.filter(e=>e.type===C):h,[C]),F=(0,n.useMemo)(()=>T.filter(e=>!!e.video).length,[T]);(0,n.useEffect)(()=>{y&&F>0&&I(1)},[y,C,F]);let loadNextVideo=e=>{I(t=>Math.min(F,Math.max(t,e+2)))},onSelectOptionAction=e=>{g(e),w(!1)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"h-full w-full min-w-[260px] flex-1",children:(0,l.jsxs)("button",{type:"button",name:"submit",className:m()("btn btn-outline-primary group relative h-full max-h-24 min-h-12 w-full justify-end overflow-hidden rounded-lg text-right lg:block",f),onClick:()=>{p?g(void 0):w(!0)},children:[(0,l.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-1 z-10 flex h-full w-full items-center pl-3 pr-4",children:(null==p?void 0:p.value)?(0,l.jsxs)("div",{className:"flex h-full items-center gap-2",children:[p.video?(0,l.jsx)("video",{src:p.video.toString(),className:"h-full w-12 rounded-md object-cover",muted:!0,loop:!0,autoPlay:!0,playsInline:!0}):(0,l.jsx)("img",{src:null===(t=p.image)||void 0===t?void 0:t.toString(),alt:"",className:"h-[100%] object-contain group-hover:bg-white"}),(0,l.jsx)("p",{className:"break-words text-left font-semibold text-primary group-hover:text-white dark:text-white",children:p.label})]}):v||(0,l.jsx)("i",{className:"text-primary group-hover:text-secondary",children:"ââ"})}),(0,l.jsx)("div",{children:(null==p?void 0:p.value)?"â":a})]})}),(0,l.jsx)(o.u,{appear:!0,show:!!y,as:n.Fragment,children:(0,l.jsxs)(s.V,{as:"div",open:y,onClose:()=>w(!1),children:[(0,l.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:(0,l.jsx)("div",{className:"fixed inset-0"})}),(0,l.jsx)("div",{className:"video-preset-dialog-viewport fixed inset-0 z-[999] overflow-y-auto bg-[black]/60",children:(0,l.jsx)("div",{className:"video-preset-dialog-positioner flex min-h-screen items-center justify-center px-4",children:(0,l.jsx)(o.u.Child,{as:n.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:(0,l.jsxs)(s.V.Panel,{as:"div",className:"video-preset-dialog-panel panel my-8 w-full max-w-lg overflow-hidden rounded-lg border-0 p-0 text-black dark:text-white-dark",children:[(0,l.jsx)("div",{className:"mr-4 mt-4 flex items-center justify-end space-x-4",children:(0,l.jsx)("button",{type:"button",className:"btn btn-primary",onClick:()=>w(!1),children:"X"})}),(0,l.jsx)("div",{className:"flex items-center justify-between px-5 pt-3",children:(0,l.jsx)("h5",{className:"text-xl font-bold dark:text-white",children:a})}),(0,l.jsxs)("div",{className:"p-5",children:[d&&(0,l.jsx)("div",{className:"flex flex-wrap items-center justify-start gap-2",children:b?b.map(e=>(0,l.jsx)("button",{onClick:()=>E(e.value),className:m()("btn",C===e.value?"btn-secondary":"btn-outline-secondary"),children:j(e.label)},e.value)):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("button",{onClick:()=>E(null),className:m()("btn",C?"btn-outline-secondary":"btn-secondary"),children:j("ÐÑе")}),(0,l.jsx)("button",{className:m()("btn","female"===C?"btn-secondary":"btn-outline-secondary"),onClick:()=>E("female"),children:j("ÐенÑкие")}),(0,l.jsx)("button",{onClick:()=>E("male"),className:m()("btn","male"===C?"btn-secondary":"btn-outline-secondary"),children:j("ÐÑжÑкие")}),x&&(0,l.jsx)("button",{onClick:()=>E("color"),className:m()("btn","color"===C?"btn-secondary":"btn-outline-secondary"),children:j("ЦвеÑ")})]})}),(null==T?void 0:T.length)>0&&(0,l.jsx)("div",{className:"mt-2",children:(0,l.jsx)("div",{className:"grid h-full max-h-[50vh] grid-cols-2 gap-4 overflow-y-auto md:grid-cols-3",children:T.map((e,t)=>(0,l.jsxs)("div",{className:"relative mt-[10px] min-w-0 cursor-pointer",onClick:()=>{onSelectOptionAction(e)},children:[(e.image||e.video)&&(0,l.jsx)("div",{className:m()("cursor-pointer rounded-lg border-2 transition-transform duration-200 hover:scale-105",{"border-transparent":(null==p?void 0:p.value)!==e.value,"border-primary":(null==p?void 0:p.value)===e.value}),children:e.video?t<N?(0,l.jsx)("video",{src:e.video,"aria-label":e.label,className:"aspect-square h-32 w-full rounded-2xl object-cover",muted:!0,loop:!0,autoPlay:!0,playsInl
1ine:!0,preload:"auto",onCanPlayThrough:()=>loadNextVideo(t),onError:()=>loadNextVideo(t)}):(0,l.jsx)("div",{className:"aspect-square h-32 w-full animate-pulse rounded-2xl bg-gray-100 dark:bg-gray-800","aria-label":"".concat(e.label,": Ð¾Ð¶Ð¸Ð´Ð°ÐµÑ Ð·Ð°Ð³ÑÑзки")}):(0,l.jsx)("img",{src:e.image,alt:"Image ".concat(t+1),className:"h-32 w-full rounded-2xl object-contain"})}),(0,l.jsx)("p",{className:"text-s mt-2 break-words text-center font-semibold",children:e.label})]},t))})})]})]})})})})]})})]})}},95233:function(e,t,a){"use strict";a.d(t,{T:function(){return useFile}});var l=a(67294),n=a(85945),o=a(48228),s=a(67848),c=a(61144),d=a(3247),m=a(95539);let useFile=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=(0,n.NL)(),[p,h]=(0,l.useState)(),[g,x]=(0,l.useState)([]),f=p&&URL.createObjectURL(p),v=p&&(p.type.includes("video")?"video":"image"),{mutateAsync:b,isLoading:_}=(0,o.D)(e=>(0,c.cT)(e,t),{onSuccess:()=>{h(void 0),a.invalidateQueries(["myimages"])},onError:e=>{}}),{mutateAsync:j,isLoading:y}=(0,o.D)(e=>(0,c.Pm)(e)),{data:w,isLoading:N,refetch:I}=(0,s.a)({queryKey:["myimages"],queryFn:()=>(0,c.xn)()});(0,l.useEffect)(()=>{x(null==w?void 0:w.data)},[null==w?void 0:w.data]);let handleUpload=async()=>{try{let e=await b(p);return await I(),(0,m.Ff)(e),e}catch(e){(0,m.Ff)(e)}},handleImageInputChange=async e=>{if(e.target.files){let t=await (0,d.f)(e.target.files[0]);h(t)}},handleImageDelete=async e=>{try{let t=await j(e);return await I(),(0,m.Ff)(t),t}catch(e){(0,m.Ff)(e)}};return{isLoading:_,handleUpload,selectedImage:p,setSelectedImage:h,selectedImageSrc:f,selectedImageType:v,imageGallery:g,setImageGallery:x,handleImageInputChange,handleImagePickerClick:()=>{e(!0)},handleImageDelete}}},718:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return Image}});var l=a(85893),n=a(67294),o=a(41664),s=a.n(o),c=a(11163),d=a(67421),m=a(67986),p=a(16093),h=a(39913),g=a(4868),x=a(39507),f=a(87438),v=a(67750),b=a(52405),_=a(10113),j=a(94879),y=a(12842),w=a(63337),N=a(90218),I=a(74762),C=a(5826),E=a(50365),T=a(61144),F=a(95539),P=a(7108),S=a(5265);let U=[{prompt:"90-е",image_url:"/assets/images/multi/90-2.webp",image_url_before:"/assets/images/multi/90-1.webp",image_name:"90-1.webp"},{prompt:"ÐоÑогой авÑо",image_url:"/assets/images/multi/f-avto-2.webp",image_url_before:"/assets/images/multi/f-avto-1.webp",image_name:"f-avto-1.webp"},{prompt:"ÐÐ¸Ð·Ð½ÐµÑ Ð¿Ð¾ÑÑÑеÑ",image_url:"/assets/images/multi/f-biz-2.webp",image_url_before:"/assets/images/multi/f-biz-1.webp",image_name:"f-biz-1.webp"},{prompt:"Ðа плÑже",image_url:"/assets/images/multi/nf2.jpg",image_url_before:"/assets/images/multi/nf1.jpg",image_name:"nf1.jpg"},{prompt:"Ð ÑпеÑ",image_url:"/assets/images/multi/rap2.jpg",image_url_before:"/assets/images/multi/rap1.jpg",image_name:"rap1.jpg"},{prompt:"Ðоп-ÑÑаÑ",image_url:"/assets/images/multi/pop2.jpg",image_url_before:"/assets/images/multi/pop1.jpg",image_name:"pop1.jpg"}];function Image(){var e,t,a,o,L,M;let O=(0,c.useRouter)(),{t:Z}=(0,d.$G)(),{enableAndImages:D}
1=(0,C._$)(S.mJ.IMAGE_GENERATION),[R,A]=(0,n.useState)(1),{data:q,isLoading:B,images:X,setImages:Q,prompt:W,setPrompt:$,promptTask:K,setPromptTask:J,aspectRatio:Y,setAspectRatio:ee,uploadImageId:et,setUploadImageId:ea,uploadImageUrl:ei,setUploadImageUrl:el,uploadImageEndId:en,setUploadImageEndId:eo,uploadImageEndUrl:es,setUploadImageEndUrl:er,handleSubmitMultiEditor:ec,handleImageReload:ed,handleImageDelete:em,isPostLoading:eu,handleImageToVideo:ep,handleImageToUpscale:eh,handleImageClick:eg,modalImageUrl:ex,setModalImageUrl:ef,handleCloseModal:ev}=(0,E.Kf)({type:"ai-photoshoot",page:R,exampleImages:U,taskList:P.Tm,taskDefault:!1,promptDefault:P.Gj});(0,n.useEffect)(()=>{$(localStorage.getItem("artinki:prompt:ai-photoshoot")||"")},[]);let handleDownloadClick=async e=>{await (0,T.YJ)(e)};return B?(0,l.jsx)(j.Z,{}):(0,l.jsxs)("div",{className:"container min-h-screen",children:[(0,l.jsxs)("div",{className:"rounded-lg bg-white dark:bg-black",children:[(0,l.jsxs)("div",{className:"mb-6 flex items-center gap-2 px-3 pt-2 lg:hidden",children:[(0,l.jsx)(s(),{href:"/dashboard",children:(0,l.jsx)("button",{type:"button",className:"btn items-center justify-center rounded-full border-0 p-2 lg:flex","aria-label":"ÐаÑбоÑд",children:(0,l.jsx)("svg",{stroke:"currentColor",fill:"#8400ff",strokeWidth:"0",viewBox:"0 0 24 24",height:"1em",width:"1em",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsx)("path",{d:"M4 13h6a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v8a1 1 0 0 0 1 1zm-1 7a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-4a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v4zm10 0a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v7zm1-10h6a1 1 0 0 0 1-1V4a1 1 0 0 0-1-1h-6a1 1 0 0 0-1 1v5a1 1 0 0 0 1 1z"})})})}),(0,l.jsx)("div",{className:"rounded-xl bg-gray-100 px-3 py-1 text-sm font-medium text-gray-700",children:"ФоÑоÑеÑÑÐ¸Ñ Ñ ÐÐ"})]}),(0,l.jsxs)("div",{className:"mb-4 hidden items-center justify-between px-2 py-7 dark:border-dark dark:text-white sm:block md:flex",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"mt-1 text-xl font-bold capitalize dark:text-white",children:"ФоÑоÑеÑÑÐ¸Ñ Ñ ÐÐ"}),(0,l.jsx)("p",{className:"md:text-s mt-2 text-xs font-semibold text-gray-500",children:"ÐейÑоÑоÑоÑеÑÑÐ¸Ñ â пÑевÑаÑайÑе обÑÑное ÑоÑо в \uD83D\uDCF8 пÑоÑеÑÑиоÑалÑнÑÑ ÑоÑоÑеÑÑиÑ"}),(0,l.jsx)("p",{className:"md:text-s text-xs font-semibold text-gray-500",children:"ÐоплоÑиÑе Ñ Ð¿Ð¾Ð¼Ð¾ÑÑÑ ÐРлÑбÑÑ ÑанÑÐ°Ð·Ð¸Ñ Ð² один клик!"})]}),(0,l.jsx)(w.Z,{})]}),!D&&(0,l.jsx)(N.Z,{}),(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 px-2 dark:border-dark xl:flex-row xl:items-center",children:[(0,l.jsxs)("div",{className:"flex w-full flex-col gap-2 xl:w-auto xl:min-w-[210px]",children:[(0,l.jsx)(x.Z,{imagePickerLabel:"ÐагÑÑзиÑÑ ÑоÑо",buttonClassName:ei?void 0:"hair-style-select-pulse",id:et,setId:ea,uploadImageUrl:ei,setUploadImageUrl:el}),(0,l.jsx)(x.Z,{imagePickerLabel:"Ðоп. ÑоÑо",id:en,setId:eo,uploadImageUrl:es,setUploadImageUrl:er})]}),(0,l.jsx)("div",{className:"photoshoot-double-control relative z-30 h-12 w-full xl:w-auto xl:min-w-[240px]",children:(0,l.jsx)(f.Z,{selectLabel:Z("ÐÑбÑаÑÑ ÑÑилÑ"),buttonClassName:K?void 0:"hair-style-select-pulse",emptyIcon:(0,l.jsx)(h.sws,{className:"h-5 w-5 text-primary transition-colors group-hover:text-white"}),selectedOption:K,options:P.Tm,onChange:e=>{J(e)}})}),(0,l.jsxs)("div",{className:"relative min-w-[240px] flex-1",children:[(0,l.jsx)("div",{className:"pointer-events-none absolute inset-y-0 left-0 z-10 flex items-center px-3",children:(0,l.jsx)("i",{className:"fas fa-wand-magic-sparkles text-primary"})}),(0,l.jsx)(p.Z,{id:"prompt",name:"prompt",required:!0,placeholder:"ÐпиÑиÑе ÑÑÐ¶ÐµÑ ÑоÑоÑеÑÑии или дополниÑелÑнÑе пожеланиÑ",className:"photoshoot-prompt-double hair-prompt-no-shadow btn btn-primary min-h-12 w-full resize-none rounded-lg bg-white py-3 pl-9 pr-3 text-left text-gray-700 placeholder-gray-400 focus:border-primary focus:outline-none focus:ring dark:!bg-dark dark:text-white",minRows:2,maxRows:5,value:W,disabled:eu,onChange:e=>{$(e.target.value)}})]}),(0,l.jsxs)("div",{className:"relative z-20 flex w-full flex-col gap-2 xl:w-[190px]",children:[(0,l.jsx)("button",{type:"button",onClick:()=>
1{if(!D)return O.push("/upgrade");localStorage.setItem("artinki:prompt:ai-photoshoot",W),ei?ec():alert("СнаÑала загÑÑзиÑе изобÑажение")},disabled:eu,name:"submit",className:"btn btn-primary h-12 w-full min-w-[180px] rounded-lg border-0 bg-gradient-to-r from-primary to-secondary px-4 py-2 text-white transition duration-300 ease-in-out hover:bg-secondary dark:border-dark",id:"image-generate",children:(0,l.jsx)(y.Z,{normalText:"Generate",loadingText:"Generating",isBtnLoading:eu})}),(0,l.jsx)(m.ZP,{isSearchable:!1,className:"artinki-select__min-width",classNamePrefix:"artinki-select",options:P.oh.map(e=>({label:e||"ÐÑÑ
однÑй ÑоÑмаÑ",value:e})),formatOptionLabel:e=>{let{value:t,label:a}=e,n=t.includes(":"),o=n&&t.replace(":","x");return(0,l.jsxs)("div",{className:"flex gap-2",children:[o&&(0,l.jsx)("img",{className:"h-5 w-5 rounded-full object-cover",src:"/assets/images/icons/aspect-ratio/".concat(o,".svg")}),(0,l.jsx)("div",{children:a})]})},onChange:e=>{let{value:t,label:a}=e;ee(t)},value:{value:Y,label:Y||"ÐÑÑ
однÑй ÑоÑмаÑ"}})]})]}),ex&&(0,l.jsx)(v.Z,{imageUrl:ex,onClose:ev})]}),(0,l.jsxs)("p",{className:"md:text-s ml-2 p-4 text-xs text-gray-500",children:[(0,l.jsx)("span",{className:"color_blue block font-bold",children:"ÐейÑоÑеÑÑ: \uD83C\uDF4C Nano Banana"}),(0,l.jsx)("span",{className:"block",children:"СÑоимоÑÑÑ 1 генеÑаÑии: 5 каÑÑинок"})]}),B?(0,l.jsx)(_.Z,{}):(0,l.jsx)("div",{className:"px-5 pt-8",children:X.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(I.Z,{canUseAsInput:!0,canImageToUpscale:!0,canVariations:!1,canReload:!1,images:X,setPrompt:$,setPromptTask:J,presetOptions:P.Tm,handleImageClick:eg,handleDownloadClick:handleDownloadClick,handleImageDelete:em,handleImageToVideo:ep,handleImageToUpscale:eh,useAsInput:e=>{$(e.prompt),el(e.image_url),(0,F.Qm)("ТекÑÑ Ð¸ изобÑажение вÑÑÐ°Ð²Ð»ÐµÐ½Ñ Ð² Ð¿Ð¾Ð»Ñ Ð´Ð»Ñ Ð³ÐµÐ½ÐµÑаÑии!")}}),(0,l.jsx)("div",{className:"mt-8",children:(0,l.jsx)("div",{className:"flex w-full flex-col justify-center",children:(0,l.jsx)(g.Z,{totalItems:null==q?void 0:null===(t=q.data)||void 0===t?void 0:null===(e=t.meta)||void 0===e?void 0:e.total,perPageItems:null==q?void 0:null===(o=q.data)||void 0===o?void 0:null===(a=o.meta)||void 0===a?void 0:a.perPage,handlePageClick:e=>{A((null==e?void 0:e.selected)+1)},activePage:null==q?void 0:null===(M=q.data)||void 0===M?void 0:null===(L=M.meta)||void 0===L?void 0:L.currentPage})})})]}):(0,l.jsx)(b.Z,{message:"СоздайÑе Ñвое пеÑвое изобÑажение"})})]})}},40477:function(e,t,a){var l;e.exports=(l=a(67294),(()=>{"use strict";var e={297:e=>{e.exports=l}},t={};function r(a){var l=t[a];if(void 0!==l)return l.exports;var n=t[a]={exports:{}};return e[a](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var a={};return(()=>{r.d(a,{default:()=>u});var e,t,l=r(297),n=r.n(l),i=function(){return(i=Object.assign||function(e){for(var t,a=1,l=arguments.length;a<l;a++)for(var n in t=arguments[a])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function u(e){var a,o,s,c,d,m=e.firstImage,p=e.secondImage,h=e.className,g=e.withResizeFeel,x=e.currentPercentPosition,f=e.onVisible,v=e.onReady,b=e.onChangePercentPosition,_=e.delimiterIconStyles,j=e.feelsOnlyTheDelimiter,y=void 0!==j&&j,w=e.delimiterColor,N=void 0===w?"#fff":w,I=e.onChangeMode,C=["before-after-slider"];h&&C.push(h);var E=(0,l.useRef)(null),T=(0,l.useRef)(null),F=(0,l.useState)(null),P=F[0],S=F[1],U=(0,l.useState)(x||50),L=U[0],M=U[1],O=(0,l.useState)(t.DEFAULT),Z=O[0],D=O[1],R=(o=(a=(0,l.useState)(!1))[0],s=a[1],c=(0,l.useRef)([!1,!1]),(0,l.useEffect)(function(){!o&&c.current.every(Boolean)&&P&&E.current&&s(!0)},[c.current,P,o,E.current]),(0,l.useEffect)(function(){o&&v&&v()},[o]),{onImageLoad:function(e){var t=function(e,t){for(var a=0,l=t.length,n=e.length;a<l;a++,n++)e[n]=t[a];return e}([],c.current);t[e]=!0,c.current=t},isReady:o}),A=R.onImageLoad,q=R.isReady,B=(0,l.useState)({top:0,left:0}),X=B[0],Q=B[1],W=(0,l.useState)(f&&"undefined"!=typeof window&&window.IntersectionObserver?new IntersectionObserver(function(e){W&&f&&e.forEach(function(e){e.intersectionRatio>.95&&(W.disconnect(),f())})},{threshold:[0,.95]}):null)[0];(0,l.useEffect)(function(){W&&q&&W.observe(E.current)},[q]),(0,l.useEffect)(function(){x&&P&&M(x>P?P:x<0?0:x)},[x,P]);var k=function(){E.current&&S(E.current.offsetWidth)},V=function(){z(t.DEFAULT)},z=function(e){D(e),I&&I(e)};(0,l.useEffect)(function(){return k(),T.current&&T.current.complete&&A(0),document.addEventListener("click",V),function(){document.removeEventListener("click",V)}},[]);var $=P?{width:P+"px"}:void 0,K=n().useMemo(function(){return i({backgroundColor:N},_||{})},[N,_]),J=n().useMemo(function(){return{left:L+"%",backgroundColor:N}},[L,N]),G=function(){(function(){if(E.current){var e=E.current.getBoundingClientRect();Q({top:e.top+pageYOffset,left:e.left+pageXOffset})}})(),z(t.MOVE)},H=function(e){if(Z===t.MOVE&&P){var a,l=((a=e.pageX-X.left)>P?P:a<0?0:a)/P*100;b?b(l):M(l)}};d=void 0===g||g,(0,l.useEffect)(function(){return d&&window.addEventListener("resize",k),function(){window.removeEventListener("resize",k)}},[]);var Y={onMouseDown:G,onTouchStart:G};return n().createElement("div",i({ref:E,className:C.join(" "),onMouseMove:function(e){return H(e)},onTouchMove:function(e){H(e.touches[0])},onTouchEnd:V,onTouchCancel:V},y?{}:Y),n().createElement("div",{className:"before-after-slider__first-photo-container"},n().createElement("img",{src:m.imageUrl,onLoad:function(){k(),A(0)},draggable:!1,alt:m.alt,ref:T})),!!P&&n().createElement(n().Fragment,null,n().createElement("div",{className:"before-after-slider__second-photo-container",style:{width:L+"%"}},n().createElement("img",{style:$,src:p.imageUrl,onLoad:function(){return A(1)},draggable:!1,alt:p.alt})),n().createElement("div",i({className:"before-after-slider__delimiter",style:J},y?Y:{}),n().createElement("div",null,n().createElement("div",{className:"before-after-slider__delimiter-icon",style:K})))))}(e=t||(t={})).MOVE="move",e.DEFAULT="default"})(),a.default})())}},function(e){e.O(0,[4738,6130,6053,3133,4838,3365,8845,6660,1876,7066,7848,2947,7630,9069,7986,6455,5733,8866,1358,5012,8258,8613,1978,8822,365,5126,9774,2888,179],function(){return e(e.s=62211)}),_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.