@emailmaker/emailmaker 1.0.109-alpha.2 → 1.0.109-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +2 -1
  2. package/asset-manifest.json +38 -36
  3. package/emailmaker-esm.js +1 -1
  4. package/emailmaker.d.ts +44 -1
  5. package/emailmaker.js +1 -1
  6. package/iframe/429.js +1 -1
  7. package/iframe/766.js +1 -1
  8. package/iframe/iframe-eblock.5f136dbd88b4aff20a4e.html +1 -0
  9. package/iframe/iframe.5f136dbd88b4aff20a4e.html +1 -0
  10. package/iframe/index.html +1 -1
  11. package/iframe/js/174.01401b47.js +1 -0
  12. package/iframe/js/525.e3d8308f.js +1 -0
  13. package/iframe/js/882.86c95d1e.js +1 -0
  14. package/iframe/sandbox-eblock.js +1 -1
  15. package/package.json +1 -1
  16. package/static/css/5102.cbdb59ca.chunk.css +2 -0
  17. package/static/css/{7282.739c0d6e.chunk.css → 7282.d5d7c046.chunk.css} +2 -2
  18. package/static/css/{main.3086b5d9.css → main.6b7ac1ef.css} +2 -2
  19. package/static/js/{1902.96d10b03.js → 1902.84af6230.js} +2 -2
  20. package/static/js/{9162.27f21a26.js → 2076.fa333dc2.js} +3 -3
  21. package/static/js/3628.25c1fb89.js +3 -0
  22. package/static/js/4298.df6cac3c.js +3 -0
  23. package/static/js/5102.eac304ab.js +2 -0
  24. package/static/js/5279.8904b618.js +2 -0
  25. package/static/js/{7282.0e0350e2.js → 7282.cf67c3fd.js} +3 -3
  26. package/static/js/8559.652fb850.js +2 -0
  27. package/static/js/8778.f3616411.js +2 -0
  28. package/static/js/{emailmaker_core.23ddf597.js → emailmaker_core.c2b562af.js} +3 -3
  29. package/iframe/iframe-eblock.fecd609b7217947f3d0a.html +0 -1
  30. package/iframe/iframe.fecd609b7217947f3d0a.html +0 -1
  31. package/iframe/js/174.d4af3f31.js +0 -1
  32. package/iframe/js/525.7b9b34e7.js +0 -1
  33. package/iframe/js/882.cbc0a3a7.js +0 -1
  34. package/static/css/5102.6eeeac5b.chunk.css +0 -2
  35. package/static/js/3628.e132c341.js +0 -3
  36. package/static/js/5102.af181f78.js +0 -2
  37. package/static/js/7126.139f5415.js +0 -3
  38. package/static/js/8017.2b02b271.js +0 -2
  39. package/static/js/8559.c810e5fe.js +0 -2
  40. package/static/js/8778.52a5c71c.js +0 -2
  41. /package/iframe/js/{174.d4af3f31.js.LICENSE.txt → 174.01401b47.js.LICENSE.txt} +0 -0
  42. /package/iframe/js/{525.7b9b34e7.js.LICENSE.txt → 525.e3d8308f.js.LICENSE.txt} +0 -0
  43. /package/iframe/js/{882.cbc0a3a7.js.LICENSE.txt → 882.86c95d1e.js.LICENSE.txt} +0 -0
  44. /package/static/js/{9162.27f21a26.js.LICENSE.txt → 2076.fa333dc2.js.LICENSE.txt} +0 -0
  45. /package/static/js/{3628.e132c341.js.LICENSE.txt → 3628.25c1fb89.js.LICENSE.txt} +0 -0
  46. /package/static/js/{7126.139f5415.js.LICENSE.txt → 4298.df6cac3c.js.LICENSE.txt} +0 -0
  47. /package/static/js/{7282.0e0350e2.js.LICENSE.txt → 7282.cf67c3fd.js.LICENSE.txt} +0 -0
  48. /package/static/js/{emailmaker_core.23ddf597.js.LICENSE.txt → emailmaker_core.c2b562af.js.LICENSE.txt} +0 -0
@@ -1,2 +0,0 @@
1
- "use strict";(globalThis.webpackChunkemail_maker=globalThis.webpackChunkemail_maker||[]).push([[8778],{78778:(e,t,a)=>{a.r(t),a.d(t,{default:()=>we});var l=a(1936),i=a(71715),n=a(97803),r=a(32101),s=a(6143),o=a(84226),c=a(51114),m=a(6691),u=a(22809),d=a(6403),g=a(93927),p=a(86331),h=a(47706),f=a(84075),A=a(50028),E=a(44004),v=a(60034),y=a(98173),w=a(78443),k=a(75301),I=a(22817),L=a(93506);function b(e,t){return{[e]:{Filter:t("Filter"),filter:t("filter"),Resize:t("Resize"),resize:t("resize"),Crop:t("Crop"),Width:t("Width"),width:t("width"),Height:t("Height"),height:t("height"),"Background color":t("Background color"),Cancel:t("Cancel"),Create:t("Create"),Objects:t("Objects"),Quality:t("Quality"),Save:t("Save"),"Loading Canvas":t("Loading Canvas"),"Loading Image":t("Loading Image"),"Loading State":t("Loading State"),"Processing Image":t("Processing Image"),Close:t("Close"),Apply:t("Apply"),Font:t("Font"),Color:t("Color"),Background:t("Background"),Image:t("Image"),Opacity:t("Opacity"),Outline:t("Outline"),Shadow:t("Shadow"),Gradient:t("Gradient"),Texture:t("Texture"),"Replace Image":t("Replace Image"),"Outline Color":t("Outline Color"),"Shadow Color":t("Shadow Color"),"Font Size":t("Font Size"),Radius:t("Radius"),"Brush Color":t("Brush Color"),"Brush Type":t("Brush Type"),"Brush Size":t("Brush Size"),History:t("History"),"Maintain aspect ratio":t("Maintain aspect ratio"),"New Text":t("New Text"),Size:t("Size"),Draw:t("Draw"),Text:t("Text"),Stickers:t("Stickers"),Frame:t("Frame"),Shapes:t("Shapes"),Corners:t("Corners"),corners:t("corners"),Done:t("Done"),"Applied Filters":t("Applied Filters"),"Resized Image":t("Resized Image"),"Cropped Image":t("Cropped Image"),"Added Drawing":t("Added Drawing"),"Added Text":t("Added Text"),"Added Shape":t("Added Shape"),"Added Sticker":t("Added Sticker"),"Added Frame":t("Added Frame"),"Merged Objects":t("Merged Objects"),"Rounded Corner":t("Rounded Corner"),"Replaced Background Image":t("Replaced Background Image"),"Added Image":t("Added Image"),Initial:t("Initial"),"Loaded State":t("Loaded State"),"Changed Style":t("Changed Style"),"Deleted object":t("Deleted object"),Merge:t("Merge"),Emoticons:t("Emoticons"),Doodles:t("Doodles"),Landmarks:t("Landmarks"),Bubbles:t("Bubbles"),Transportation:t("Transportation"),Beach:t("Beach"),PencilBrush:t("PencilBrush"),SprayBrush:t("SprayBrush"),CircleBrush:t("CircleBrush"),DiamondBrush:t("DiamondBrush"),VLineBrush:t("VLineBrush"),HLineBrush:t("HLineBrush"),SquareBrush:t("SquareBrush"),Square:t("Square"),square:t("square")}}}var R=a(5365),C=a(90176),S=a(53082),_=a(52853),B=a(2527),N=a(65185),O=a(20263),M=a(65893),x=a(50548);const D={text:{replaceDefault:!0,defaultCategory:"handwriting",items:[{family:"Montserrat Light",src:"customFonts/Montserrat-Light.woff2"},{family:"Montserrat Regular",src:"customFonts/Montserrat-Regular.woff2"},{family:"Montserrat Bold",src:"customFonts/Montserrat-Bold.woff2"},{family:"Montserrat Black",src:"customFonts/Montserrat-Black.woff2"},{family:"Roboto Light",src:"customFonts/Roboto-Light.woff2"},{family:"Roboto Regular",src:"customFonts/Roboto-Regular.woff2"},{family:"Roboto Bold",src:"customFonts/Roboto-Bold.woff2"},{family:"Roboto Black",src:"customFonts/Roboto-Black.woff2"},{family:"Lato Light",src:"customFonts/Lato-Light.woff2"},{family:"Lato Regular",src:"customFonts/Lato-Regular.woff2"},{family:"Lato Bold",src:"customFonts/Lato-Bold.woff2"},{family:"Lato Black",src:"customFonts/Lato-Black.woff2"},{family:"Rubik Light",src:"customFonts/Rubik-Light.woff2"},{family:"Rubik Regular",src:"customFonts/Rubik-Regular.woff2"},{family:"Rubik Bold",src:"customFonts/Rubik-Bold.woff2"},{family:"Rubik Black",src:"customFonts/Rubik-Black.woff2"},{family:"Bebas Neue Light",src:"customFonts/BebasNeueLight.woff2"},{family:"Bebas Neue Regular",src:"customFonts/BebasNeueRegular.woff2"},{family:"Bebas Neue Book",src:"customFonts/BebasNeueBook.woff2"},{family:"Bebas Neue Bold",src:"customFonts/BebasNeueBold.woff2"},{family:"Arial",src:"customFonts/ArialMT.woff2"},{family:"Arial Bold",src:"customFonts/Arial-BoldMT.woff2"}]}};function G(e,t){if("json"===e)return new Blob([t],{type:"application/json"});if("svg"===e)return new Blob([t],{type:"image/svg+xml"});const a=`image/${e}`;return((e,t="application/octet-stream")=>fetch(`data:${t};base64,${e}`).then(e=>e.blob()))(t=t.replace(/data:image\/([a-z]*)?;base64,/,""),a)}const U=l.createElement(p.A,{style:{fontSize:48},spin:!0}),T=({currentImageLink:e,newLink:t,onSave:n,uploadImageResultIsLoading:r})=>{const s=(0,B.p)(),[o,u]=(0,l.useState)(),[d,g]=(0,l.useState)(),{__:p}=(0,h.s9)();let f=(0,i.wA)();const A=(0,i.Pj)(),E=(0,i.d4)(y.C1),v=(0,i.d4)(w.sK),T=(0,i.d4)(I.yN),F=(0,l.useRef)(!1),[P,q]=(0,l.useState)(),z=(0,N.ml)(M.AZ.FILE_PROXY_EVENT_ID);(0,l.useEffect)(()=>{(async()=>{let t;try{const a=await fetch(e);t=await a.blob()}catch{if(t=await z.fire({url:e,project:T}).filter(e=>e instanceof Blob)[0],!t){const a=s.get(L.A9.em_token)||await O.di.getInstance(A,x.Y),l=await fetch(`https://app.emailmaker.ru/api/wp-json/cors-proxy/v1/get?url=${encodeURIComponent(e)}`,{headers:{authorization:`Bearer ${a}`}});t=await l.blob()}}if(t){let e=new FileReader;e.onload=()=>{null===P||void 0===P||P.tools.import.openBackgroundImage(o),e.result!==o&&(u(e.result),g(t.type))},e.readAsDataURL(t)}})().catch(e=>{})},[e,t,u,s,o,P,z,T,A]);const j=(0,l.useCallback)(()=>{u(null),g(null),f((0,k.BK)()),f((0,w.Os)()),f((0,w.Oo)(L.lx.UPLOAD_IMAGE_MODAL))},[f]),H=(0,l.useRef)();H.current=async function(e,t,a){const l=await G(a,e);n&&n(new File([l],t,{lastModified:(new Date).getTime(),type:l.type}))};const W=(0,l.useCallback)(e=>{if(e)if(F.current&&P);else{F.current=!0;const e=E.locale?E.locale.replace("_","-"):"ru-RU",t=E.theme===L.IJ?matchMedia(L.F3).matches?L.nd:L.T:E.theme;R.A.init({selector:"#pixie-editor",baseUrl:a.p+"assets/pixie",image:o,activeLanguage:e,languages:b(e,p),tools:D,ui:{menubar:{replaceDefaultItems:!0,items:[{type:"undoWidget",align:"left"},{type:"zoomWidget",align:"center",desktopOnly:!0},{type:"button",icon:l.createElement(S.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:e=>{e.togglePanel("history")}},{type:"button",icon:l.createElement(_.A,{style:{fontSize:20}}),align:"right",desktopOnly:!0,action:()=>j()}]},nav:{position:"top"},activeTheme:t,mode:"inline",forceOverlayModeOnMobile:!1},onSave:async function(e,t,a){H.current(e,t,a)}}).then(e=>{q(e)}).catch(e=>{})}},[E.theme,o,P,q,E.locale,p,j]),K=(0,l.useCallback)(()=>{null===P||void 0===P||P.tools.export.save(null===e||void 0===e?void 0:e.split("/").pop().split(".")[0],null===d||void 0===d?void 0:d.split("/")[1])},[P,e,d]);return l.createElement(c.A,{afterOpenChange:W,width:"100%",style:{maxWidth:"100%",minHeight:"100vh"},className:"image-editor-modal blocks-modal",centered:!0,closable:!1,zIndex:1100,mask:!1,open:v,footer:[l.createElement(C.Ay,{key:"Cancel",className:"em-analytics__profile-cancel",onClick:j},p("Cancel")),l.createElement(C.Ay,{key:"Ok",className:"em-analytics__profile-updapixiete",id:"save",type:"primary",onClick:K},p("Update"))]},r&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(m.A,{size:"large",indicator:U})),l.createElement("div",{id:"pixie-editor"}))},F=l.createElement(p.A,{style:{fontSize:48},spin:!0}),P=({currentImageLink:e,newLink:t,onSave:a,uploadImageResultIsLoading:i})=>l.createElement(l.Fragment,null,l.createElement("div",null,l.createElement("div",{className:"image-preview"},i&&l.createElement("div",{style:{position:"absolute",height:"100%",width:"100%",display:"flex",alignItems:"center",justifyContent:"center",background:"var(--colorBgLayout)",zIndex:10,opacity:.7}},l.createElement(m.A,{size:"large",indicator:F})),(t||e)&&l.createElement("img",{alt:"uploadedImage",src:t||e}))),l.createElement(T,{currentImageLink:e,newLink:t,onSave:a,uploadImageResultIsLoading:i}));var q=a(14516),z=a(7494),j=a(56893),H=a(236),W=a(54760),K=a(5674),V=a(71558),$=a(25672),Q=a(10026);const Z="blocks",Y=({setCurrentImageLink:e,setModalHeight:t,setModalWidth:a,setImageStockList:i,imageStockList:n,currentReq:r,setCurrentReq:c,inputRef:u,setStockLink:d,customRequest:g})=>{const[f,A]=(0,l.useState)(!1),[E,y]=(0,l.useState)(2),{__:w}=(0,h.s9)(),[k]=(0,v.Jg)(),[I]=(0,v.h4)();(0,l.useEffect)(()=>{""!==r.keywords&&L()},[r.color,r.orientation]);const L=async()=>{const e=await I({query:r,page:1});e.data.results.length>0&&(i(e.data.results),setTimeout(()=>{a(1060),t("84vh")},0))},[b,R]=(0,l.useState)(null),C=(e,t,a)=>{try{const l=new URL(e),i=l.pathname.split("/").filter(Boolean),n=i.pop()||"",r=i.join("/"),s=`https://${l.host}${r?"/"+r:""}`,o=`https://px2.racs.rest/${n}`,c=l.search?l.search.slice(1):"",m=c?`${c}&w=${t}&q=${a}`:"w=644&q=96";return`${o}?${`${m}&proxy_url=${s}`}`}catch(l){return e}};return l.createElement("div",{className:"stock-tab"},l.createElement(s.A,{onValuesChange:L,className:n.length>0?"serach-results":""},l.createElement(q.A,{gutter:24},l.createElement(z.A,{span:n.length>0?"":24},l.createElement(s.A.Item,{className:"stock-search-input"},l.createElement(o.A,{onKeyDown:e=>"Space"===e.code&&L(),onPressEnter:e=>L(),allowClear:!0,size:n.length>0?"medium":"large",placeholder:w("Search image"),value:r.keywords,onChange:e=>c(t=>({...t,keywords:e.target.value})),ref:u,spellCheck:"false",suffix:l.createElement($.A,{onClick:L,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})}))),n.length>0&&l.createElement(l.Fragment,null,l.createElement(z.A,null,l.createElement(j.Ay.Group,{defaultValue:"",onChange:e=>c(t=>({...t,orientation:e.target.value}))},l.createElement(H.A,{title:w("All"),placement:"top"},l.createElement(j.Ay.Button,{value:""},l.createElement(Q.A,{icon:"MixedView"}))),l.createElement(H.A,{title:w("Landscape"),placement:"top"},l.createElement(j.Ay.Button,{value:"landscape"},l.createElement(Q.A,{icon:"LandscapeView"}))),l.createElement(H.A,{title:w("Portrait"),placement:"top"},l.createElement(j.Ay.Button,{value:"portrait"},l.createElement(Q.A,{icon:"PortraitView"}))),l.createElement(H.A,{title:w("Squarish"),placement:"top"},l.createElement(j.Ay.Button,{value:"squarish"},l.createElement(Q.A,{icon:"SquareView"}))))),l.createElement(z.A,null,l.createElement(j.Ay.Group,{defaultValue:"",className:"stock-color-filter",onChange:e=>c(t=>({...t,color:e.target.value}))},l.createElement(H.A,{title:w("All"),placement:"top"},l.createElement(j.Ay.Button,{className:"all-colors",value:""},"All")),l.createElement(H.A,{title:w("Black"),placement:"top"},l.createElement(j.Ay.Button,{className:"black-color",value:"black"},"B")),l.createElement(H.A,{title:w("Black and White"),placement:"top"},l.createElement(j.Ay.Button,{className:"bw-color",value:"black_and_white"},"B&\xa7W")),l.createElement(H.A,{title:w("White"),placement:"top"},l.createElement(j.Ay.Button,{className:"white-color",value:"white"},"W")),l.createElement(H.A,{title:w("Orange"),placement:"top"},l.createElement(j.Ay.Button,{className:"orange-color",value:"orange"},"O")),l.createElement(H.A,{title:w("Red"),placement:"top"},l.createElement(j.Ay.Button,{className:"red-color",value:"red"},"R")),l.createElement(H.A,{title:w("Purple"),placement:"top"},l.createElement(j.Ay.Button,{className:"purple-color",value:"purple"},"P")),l.createElement(H.A,{title:w("Magenta"),placement:"top"},l.createElement(j.Ay.Button,{className:"magenta-color",value:"magenta"},"M")),l.createElement(H.A,{title:w("Green"),placement:"top"},l.createElement(j.Ay.Button,{className:"green-color",value:"green"},"G")),l.createElement(H.A,{title:w("Teal"),placement:"top"},l.createElement(j.Ay.Button,{className:"teal-color",value:"teal"},"T")),l.createElement(H.A,{title:w("Blue"),placement:"top"},l.createElement(j.Ay.Button,{className:"blue-color",value:"blue"},"Blue")))))),n.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},n.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(K.A,{dataLength:n&&n.length,next:async()=>{f||(A(!0),I({query:r,page:E}).then(e=>{i(t=>[...t,...e.data.results]),A(!1),y(e=>e+1)}).catch(()=>{A(!1)}))},hasMore:n,endMessage:l.createElement(W.A,{plain:!0},w("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:null},l.createElement(V.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},n.map(t=>l.createElement("div",{className:"list-item",key:t.id,onClick:()=>{return a=t.urls,l=t.links,i=t.id,k(l.download_location),R(i),setTimeout(()=>R(null),2e3),d(`${a.raw}&w=1200&q=96`),e(`${a.raw}&w=1200&q=96`),void g(`${a.raw}&w=1200&q=96`);var a,l,i}},l.createElement("img",{className:b===t.id?"loaded-image":"",width:"322px",src:C(t.urls.raw,644,96),alt:t.description,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("p",{className:"creator-info",onClick:e=>e.stopPropagation()},"Photo by"," ",l.createElement("a",{target:"_blank",href:`${t.user.links.html}?utm_source=${Z}&utm_medium=referral`,rel:"noreferrer"},t.user.name)," ","on"," ",l.createElement("a",{target:"_blank",href:`https://unsplash.com/?utm_source=${Z}&utm_medium=referral`,rel:"noreferrer"},"Unsplash")),b===t.id&&l.createElement(m.A,{className:"ant-spin",indicator:l.createElement(p.A,{spin:!0})}))))))))};var J=a(92828),X=a(86588),ee=a(91796),te=a(25228);const ae=({images:e,transitionDuration:t=1e3})=>{const[a,i]=(0,l.useState)([]);return(0,l.useEffect)(()=>{if(e.length>0){const t=e[e.length-1];i(e=>[...e,{src:t,opacity:0}]),setTimeout(()=>{i(e=>e.map((t,a)=>a===e.length-1?{...t,opacity:1}:t))},1e3)}},[e]),l.createElement("div",{className:"slideshow-container"},a.map((e,a)=>l.createElement("img",{key:a,src:`data:image/jpeg;base64, ${e.src}`,alt:`Slide ${a+1}`,className:"slideshow-image",style:{opacity:e.opacity,transition:`opacity ${t}ms linear`}})))};var le=a(54457),ie=a(942),ne=a(91480);const re=(0,l.memo)(({className:e,onClick:t})=>l.createElement("div",{className:`image-ai__arrow image-ai__arrow--next ${e||""}`,onClick:t},l.createElement(C.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--next",size:"large",icon:l.createElement(X.A,null)})));re.displayName="SampleNextArrow";const se=(0,l.memo)(({className:e,onClick:t})=>l.createElement("div",{className:`image-ai__arrow image-ai__arrow--prev ${e||""}`,onClick:t},l.createElement(C.Ay,{className:"image-ai__arrow-btn image-ai__arrow-btn--prev",size:"large",icon:l.createElement(ee.A,null)})));se.displayName="SamplePrevArrow";const oe=({setModalHeight:e,customRequest:t,aiTabRef:a,inputAiRef:i,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:c,setAiImageRequest:m,imageAiList:u,setImageAiList:g,isLoadingAi:A,setIsLoadingAi:E})=>{const{aiImageCounter:y,currentAiImgLimits:w,loadingDuringGeneration:k,requestStatus:I,handleGenerate:b,convertBase64ToFile:R,isShiftPressed:S,setIsShiftPressed:_,limitsInPlugin:B}=function({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:i,setIsImageUploaded:n,aiImageRequest:r,imageAiList:s,setImageAiList:o,isLoadingAi:c,setIsLoadingAi:m}){const{__:u}=(0,h.s9)(),g=(0,ie.rD)(),p=(0,d.hN)(),A=(0,ne.u)(),{emailId:E,blockId:y,projectId:w}=(0,f.g)(),[k]=(0,v.Mv)(),[I,{data:b=[]}]=(0,v.gg)(),R=(null===g||void 0===g?void 0:g.sendAIImageRequest)||k,C=(null===g||void 0===g?void 0:g.trigger)||I,S=(null===g||void 0===g?void 0:g.handleLimitUsageEmitter)||(0,N.ml)(M.AZ.ON_LIMIT_ID),[_,B]=(0,l.useState)(0),[O,x]=(0,l.useState)(null),[D,G]=(0,l.useState)(!1),[U,T]=(0,l.useState)(u("Evaluating the task")),[F,P]=(0,l.useState)(!1),q=E||y,{limits:z}=null!==g&&void 0!==g&&g.limits?g:{limits:{ai_img_limit:0}},{ai_img_limit:j}=z,H=j>0&&_>=j,W=!(!g.limits||!g.counters)&&L.EW.isPlugin,K=(0,l.useCallback)(()=>{S.fire({name:"AiImgCount",count:_+1})},[S,_]),V=(0,l.useMemo)(()=>!H&&(!W||0===j||_<j),[H,W,_,j]),$=(0,l.useCallback)(async()=>{T(u("Evaluating the task")),""===r||c||(m(!0),P(!0),o([]),A({event:"submit_form",action:"ai_image_generation",entity_id:E,project_id:w}),R({body:{project_id:w,request:"create-image",connection:"midjourney",message:r}}).then(({data:e,error:t})=>{if(t)throw t;if(401===e.data.status)throw new Error(L.ff);200===(null===e||void 0===e?void 0:e.data.status)?(null!==e&&void 0!==e&&e.data.task.id&&(T(e.data.task.message),x(e.data.task.id)),e.message&&p.success({id:"AI_IMAGE_SEND_SUCCESS",message:e.message,placement:"bottomRight",data:r}),C({task_id:null===e||void 0===e?void 0:e.data.task.id,entity_id:q})):(m(!1),P(!1),p.error({id:"AI_IMAGE_SEND_ERROR",message:(null===e||void 0===e?void 0:e.message)||u("Something went wrong, please try again"),placement:"bottomRight",data:r,innerException:e}))}).catch(e=>{m(!1),P(!1),(null!==e&&void 0!==e&&e.error||null!==e&&void 0!==e&&e.data)&&p.fromError("AI_IMAGE_SEND_ERROR",r,e.error||e)}))},[r,c,m,P,o,A,E,w,R,p,C,q,u]),Q=(0,l.useCallback)(()=>{V?(W&&(B(e=>e+1),K()),$()):W&&p.error({message:u("The usage limit has been exceeded"),description:u("The maximum number of requests for the current subscription period has been reached.\nSelect the appropriate plan to fulfil more requests"),placement:"bottomRight"})},[V,W,B,K,$,p,u]);(0,l.useEffect)(()=>{var e;W&&B((null===g||void 0===g||null===(e=g.counters)||void 0===e?void 0:e.ai_img_counter)||0)},[g,W]);const Z=(0,l.useCallback)(e=>{if(!i){n(!0);const a=e.match(/^data:image\/([A-Za-z-+/]+);base64,(.+)$/);if(!a)return;const l=a[1],i=a[2],r=atob(i),s=new Array(r.length);for(let e=0;e<r.length;e++)s[e]=r.charCodeAt(e);const o=new Uint8Array(s),c=new Blob([o],{type:`image/${l}`}),m=new File([c],"image.jpeg",{type:c.type});t({file:m})}},[i,n,t]),Y=(0,l.useCallback)(e=>{"error"!==e.status&&"Canceled"!==e.status?e.images?(T(e.status),100===e.progress&&(o(e.images),T(u("Evaluating the task")),x(null),P(!1))):(o([e.data]),m(!1)):(m(!1),P(!1),p.error({id:"AI_IMAGE_GET_ERROR",message:u("Something went wrong, please try again"),placement:"bottomRight",data:O}))},[o,T,u,m,e,O,p,P]);return(0,l.useEffect)(()=>{b.length>1&&Y(b[b.length-1])},[b,Y]),(0,l.useEffect)(()=>{(c||s.length>0)&&setTimeout(()=>{let t=550;a.current&&(t=a.current.offsetHeight+68),e(t)},0)},[a,b,s.length,c,e]),{aiImageCounter:_,setAiImageCounter:B,currentAiImgLimits:j,isFieldsDisabled:H,canGenerateImage:V,aiImageRequest:r,imageAiList:s,setImageAiList:o,isLoadingAi:c,setIsLoadingAi:m,loadingDuringGeneration:F,setLoadingDuringGeneration:P,requestStatus:U,setRequestStatus:T,handleGenerate:Q,handleLimitAiImgCount:K,convertBase64ToFile:Z,isShiftPressed:D,setIsShiftPressed:G,currentReqId:O,setCurrentReqId:x,limitsInPlugin:W}}({setModalHeight:e,customRequest:t,aiTabRef:a,isImageUploaded:n,setIsImageUploaded:r,aiImageRequest:c,imageAiList:u,setImageAiList:g,isLoadingAi:A,setIsLoadingAi:E}),{__:O}=(0,h.s9)(),[x,D]=(0,l.useState)(!1),G=(0,l.useCallback)(()=>D(!0),[]),U=(0,l.useCallback)(()=>D(!1),[]),T=(0,l.useCallback)(e=>m(e.target.value),[m]),F=(0,l.useCallback)(e=>{"Shift"===e.key?_(!0):"Enter"!==e.key||S||(e.preventDefault(),b())},[S,b,_]),P=(0,l.useCallback)(e=>{"Shift"===e.key&&_(!1)},[_]);return l.createElement("div",{className:"image-ai"},B&&l.createElement(le.A,{text:"images",counter:y,limits:w,wrapperStyles:{marginTop:-25}}),l.createElement(q.A,{gutter:24,className:"image-ai__row"},l.createElement(z.A,{span:24},l.createElement(s.A.Item,{style:{margin:0}},l.createElement("span",{className:"ant-input-affix-wrapper ant-input-affix-wrapper-lg image-ai__input-affix-wrapper"+(x?" ant-input-affix-wrapper-focused":"")},l.createElement(o.A.TextArea,{ref:i,onKeyDown:F,onKeyUp:P,onFocus:G,onBlur:U,autoSize:!0,allowClear:!0,className:"text-area-input-hybrid image-ai__textarea",placeholder:O("Generate image"),value:c,onChange:T,spellCheck:"false"}),l.createElement("span",{className:"ant-input-suffix image-ai__input-suffix"},A||k?l.createElement(p.A,{className:"input-icon image-ai__input-icon",spin:!0}):l.createElement(Q.A,{icon:"AI",className:"input-icon image-ai__input-icon",onClick:b})))))),(A||u.length>0)&&l.createElement(J.A,{dotPosition:"top",arrows:!0,nextArrow:l.createElement(re,null),prevArrow:l.createElement(se,null),className:"image-ai__carousel"},A&&l.createElement("div",{className:"image-ai__loading"},l.createElement("div",{className:"spin"},l.createElement(p.A,{style:{fontSize:48},spin:!0}),l.createElement("p",{className:"status"},I))),u.length>0&&u.map((e,t)=>l.createElement("div",{key:t,className:"image-ai__image-item"},l.createElement(ae,{images:u}),l.createElement("div",{className:"buttons"},u.length>0&&l.createElement(C.Ay,{onClick:()=>R(`data:image/jpeg;base64, ${e}`),icon:l.createElement(te.A,null)},O("Use this one")))))))},ce=({setNewLink:e,setCurrentImageLink:t,setModalHeight:a,setModalWidth:i,setImageGifList:n,imageGifList:r,currentReqGif:c,setCurrentReqGif:u,inputRef:d,setStockLink:g,customRequest:f})=>{const{__:A}=(0,h.s9)(),[E,y]=(0,l.useState)(null),[w,k]=(0,l.useState)(!1),[I,L]=(0,l.useState)(25),[b]=(0,v.eo)(),R=async()=>{var e,t;const l=await b({query:c,page:0});(null===l||void 0===l||null===(e=l.data)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.length)>0&&(n(l.data.data),setTimeout(()=>{a("84vh"),i(1060)},0))},C=l.createElement(p.A,{style:{fontSize:20},spin:!0});return l.createElement("div",{className:"stock-tab"},l.createElement(s.A,{onValuesChange:R,className:r.length>0?"serach-results":""},l.createElement(q.A,{gutter:24},l.createElement(z.A,{span:r.length>0?"":24},l.createElement(s.A.Item,{className:"stock-search-input"},l.createElement(o.A,{onKeyDown:e=>"Space"===e.code&&R(),onPressEnter:e=>R(),allowClear:!0,size:r.length>0?"medium":"large",placeholder:A("Search GIFs"),value:c.keywords,onChange:e=>u(t=>({...t,keywords:e.target.value})),ref:d,spellCheck:"false",suffix:l.createElement($.A,{onClick:R,className:"cards-search__search-icon, input-icon",style:{fontSize:"16px",cursor:"pointer"}})})))),r.length>0&&l.createElement("div",{className:"blocks-search__divider-wrapper"},l.createElement("div",{className:"ant-divider ant-divider-horizontal blocks-search__divider",role:"separator"}))),l.createElement("div",{className:"serach-output-wrapper",style:{marginRight:-10}},r.length>0&&l.createElement("div",{id:"scrollableDiv",style:{width:"100%",height:"calc(84vh - 148px)",overflow:"auto",paddingTop:24,paddingRight:14,paddingLeft:24,marginLeft:-24,lineHeight:"0",boxSizing:"unset"}},l.createElement(K.A,{dataLength:r&&r.length,next:async()=>{w||(k(!0),b({query:c,page:I}).then(e=>{n(t=>[...t,...e.data.data]),k(!1),L(e=>e+25)}).catch(()=>{k(!1)}))},hasMore:r,endMessage:l.createElement(W.A,{plain:!0},A("That`s all we could find.")," \ud83e\udd10"),scrollableTarget:"scrollableDiv",style:{overflow:"visible"},loader:l.createElement(m.A,{indicator:C})},l.createElement(V.A,{breakpointCols:{default:3},className:"my-masonry-grid",columnClassName:"my-masonry-grid_column"},r.map((e,a)=>l.createElement("div",{className:"list-item",key:e.id+a,onClick:()=>{return a=e.images.downsized.url,l=e.id,y(l),setTimeout(()=>{y(null)},2e3),g(`${a}`),t(`${a}`),void f(`${a}`);var a,l}},l.createElement("img",{className:E===e.id?"loaded-image":"",width:"322px",src:`${e.images.downsized.url}`,alt:e.title,onLoad:e=>e.target.parentNode.classList.add("loaded")}),l.createElement("a",{rel:"noreferrer",href:"https://giphy.com/",target:"_blank",onClick:e=>e.stopPropagation()},l.createElement("div",{className:"overlay-image",style:{backgroundImage:"url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAkCAYAAAB/up84AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABSBJREFUeNrsWjFv2zoQVoMW8BZ18xaN3qLRW9QtW9OtW92to98vaPoP3K1b1S1b3c2jvWlUNm3lw1s8Mpu3PAo4Iocr70jKlp0COuCQlpKPx/t43x1pv3h8fEwGeT5yNoTgeclLZvza6NgxXoNaGRktjE6MpjC2NVqh92bwt4HxBI1ro0s0dgN2tvD5a8a/9vkq0M+xYKdG81A7Gp6pyBjZddrnO6N36Hkbqyn8u4L3vYC0hjLHeAbPVhC4TwAK/ewNvLsEhyxgFXLK2l/D4tvnOVrUiPEh1k/JjvLYyWENdeTcKazBBr6AdY4AqBTmbkIzhO4gvMumYLxAYKzgPTvhBBajYNwCksHYhOyYiow1KONaKYlfO8bPEWyGEfi5Iu+Vjizg7EzB3xvwWTMxWkHG4mDnMF6BnSnYncLzHWGG4BqiwZkKQMC7I0cOVTCJhvRUKNgNCmCOxhNmrBEWzwGi0Y6rIihbsnOH/JgE2hshKrLZv4Px9yhj1twafRlid/UIGWvlFdlVLirIkIM12nETGLeO2tTPECBUZuT/a7JBMpSxUybYLjulUCN2iEpHQoyuGWZJUCa8R/VGSZvGB0iOdjAO9n8EtC2zUxICSIoW0ICTmA53DCDKQzWZg89XAXZ2B2iMavBnjDKpBX6B1tnAM5aqQgGhnU2D6GmHuqw7AkaOPmP/bsHpFC1kTLqVhglS6fFNgX1MCXUHO1zR1h5AFOoSc1jjmKx/An/1PoBQasBSoZZ3hpyaOrg0IW2sRkG8JsU8CaCaLckAhfi6AG0cmeuzkyMQMtL+SiySkY3oA/EgGeICK0UOZYQKVsQpDAjm2BpsaAGQLMKnMdok3yLtpKS70yT7OUBcm7UTHb5grk5y1Csrj40MqUbUpgW7NXo+RunckODkQvdXM37iwm7b1VA7lAaVB4jUUZOUIzNxfOougAwy3GUN0qWG2IJJ09V2NcvIFE8c54nQelEHFM6C6chUhI+WZjjffDQkrenPhqmlrAC9Naof/aLhXZeNNfMZOk+MtPOVRjNmTpfcCut0+biGZ3PBj1ywWTOfqV3v+yjLFuDPRs8Ddu05vLtmsuHQ0s73wehvR0t7aGkPevfCM5fcGr0MbOW9NSSFwF52cP5KcLIv+X4EUGbCemcOqpoz73/haE4CZNkRjAR20vwENXHRc2bWEMyQuUuGVe4hc6K6rBmg7pKN0XdGX7dts9E3Rr8afUATFl1PqgLAG6T3AoX1nSVtMP9l5r5FVyiu+D14/YssRHOheGVQYNMeinrhsMcV2WVPRR1rIRT4QmiA5r4G6oxp0y6ZzFh4LvhmB84MHz1xta9vWQMrcFR/3iF+7DmEu2YoyTshRbuMvGE9hnwGPQR1tdR04aCueKrqAIgiu/AqcCf1JXPhfuoYosGHn4Hgqa6AnCK4IfSkCa1eCJRxLGnn+mX0rfDOJok4AsQAUpwQlND2++HIgNiOVO1LVRIgtXDPs0bpunEU08vktHLMpoJS1/d9qEo6h6gAzq7RRaPV+QmBeICzUUh2fIHzk0s3HedXwkEy2ReQmjn4XDzDjqkN4D/J04/y/np5KbSrrtbwAyx+kTxdf9tfpvSZIW9O3FScHJAF8PEFc5F2lQzSi5wJheoG3U/t0xYOcgBAcOHuAkr7mY9ditoAiCz2q8uvEcD8gJpSDuGNl5hfnaTJ0/fpheMUr4CitHCO6fqdesj359xh1tWiqggfdUCmcz9ZivZ7+BnQM5P/BRgABx8sJWqTxoYAAAAASUVORK5CYII=)"}})),E===e.id&&l.createElement(m.A,{className:"ant-spin",indicator:l.createElement(p.A,{spin:!0})}))))))))};var me=a(81644),ue=a(41244),de=a(47794);const ge="IMG",pe="BACKGROUND",he="EDITOR",fe="UPLOAD",Ae="STOCK",Ee="GIF",ve="AI",{Dragger:ye}=n.A,we=()=>{var e,t;const a=(0,ie.rD)(),{__:n}=(0,h.s9)(),b=(0,i.wA)(),{projectId:R}=(0,f.g)(),[C,S]=(0,E.dS)(),[_]=(0,v.FQ)(),{modal:B}=r.A.useApp(),O=(0,d.hN)(),x=(0,i.d4)(y.B$),D=(0,i.d4)(y.C1),G=(0,i.d4)(w.cL),U=(0,i.d4)(k.js),T=(0,i.d4)(k.Ac),[F,q]=(0,l.useState)(""),[z,j]=(0,l.useState)(""),[H,W]=(0,l.useState)(""),[K,V]=(0,l.useState)(""),[$,Q]=(0,l.useState)(fe),[Z,J]=(0,l.useState)({width:"",height:"",size:"",format:""}),[X,ee]=(0,l.useState)("success"),[te,ae]=(0,l.useState)(!1),le=l.useRef(null),ne=l.useRef(null),re=l.useRef(null),se=l.useRef(null),we=l.useRef(null),ke=l.useRef(null),Ie=l.useRef(null),Le=l.useRef(null),be=l.useRef(null),[Re,Ce]=(0,l.useState)("auto"),[Se,_e]=(0,l.useState)(572),[Be,Ne]=(0,l.useState)(null),[Oe,Me]=(0,l.useState)(!1),[xe,De]=(0,l.useState)({keywords:"",color:"",orientation:""}),[Ge,Ue]=(0,l.useState)({keywords:""}),[Te,Fe]=(0,l.useState)([]),[Pe,qe]=(0,l.useState)([]),[ze,je]=(0,l.useState)([]),[He,We]=(0,l.useState)(!1),[Ke,Ve]=(0,l.useState)(""),[$e,Qe]=(0,l.useState)(!1),[Ze,Ye]=(0,l.useState)(0),Je=(0,i.d4)(I.yN),Xe=(0,N.ml)(M.AZ.FILE_PROXY_EVENT_ID);let et=!(x||(null===(e=D.id)||void 0===e?void 0:e.toString())!==(null===Je||void 0===Je||null===(t=Je.members)||void 0===t?void 0:t.owner.ID));const tt=async e=>{if(e)try{const t=await at(e);it({url:e}),t&&nt(t)&&rt({file:t})}catch(t){}},at=async e=>{try{const t=(await Xe.fire({url:e,project:Je})).filter(e=>e instanceof Blob)[0];if(t)return t;const a=`https://api.emailmaker.ru/tools/file-proxy.php?url=${encodeURIComponent(e)}`,l=await fetch(a);if(!l.ok)throw new Error(`Server returned ${l.status}`);const i=await l.blob();return new File([i],e.split("/").pop(),{type:i.type})}catch(t){}};document.onpaste=function(e){const t=e.clipboardData.items[0];if($===fe&&K){var l;if(0===(null===t||void 0===t||null===(l=t.type)||void 0===l?void 0:l.indexOf("image"))&&!1!==a.imageCenterLocalUploadEnabled){const e=t.getAsFile();nt(e);const a={file:e};j(""),rt(a)}0===t.type.indexOf("text")&&t.getAsString(e=>{"http"===e.slice(0,4)?(j(""),q(e),it({url:e})):"meta"===e.toString().slice(1,5)&&(j(""),q(e.toString().split('"')[1]),it({url:e.toString().split('"')[1]}))})}};const lt=(0,l.useMemo)(()=>({IMG:U,BACKGROUND:T}),[U,T]);(0,l.useEffect)(()=>{const e=e=>{let t=null;G.includes("UPLOAD_BACKGROUND_MODAL")?(t=pe,V(pe)):G.includes("UPLOAD_IMAGE_MODAL")&&(V(ge),t=ge),lt[t]&&(q(lt[t]),Q(e))};G===L.lx.UPLOAD_IMAGE_MODAL||G===L.lx.UPLOAD_BACKGROUND_MODAL?e(he):G===L.lx.UPLOAD_IMAGE_MODAL_AI||G===L.lx.UPLOAD_BACKGROUND_MODAL_AI?(et?(Qe(!0),Ye(2)):e(ve),setTimeout(()=>{var e;return null===(e=be.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):G===L.lx.UPLOAD_IMAGE_MODAL_UPLOAD||G===L.lx.UPLOAD_BACKGROUND_MODAL_UPLOAD?(e(fe),setTimeout(()=>{var e;return null===(e=ke.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):G===L.lx.UPLOAD_IMAGE_MODAL_STOCK||G===L.lx.UPLOAD_BACKGROUND_MODAL_STOCK?(et?(Qe(!0),Ye(3)):e(Ae),setTimeout(()=>{var e;return null===(e=Le.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):G===L.lx.UPLOAD_IMAGE_MODAL_GIF||G===L.lx.UPLOAD_BACKGROUND_MODAL_GIF?(et?(Qe(!0),Ye(3)):e(Ee),setTimeout(()=>{var e;return null===(e=Ie.current)||void 0===e?void 0:e.focus({cursor:"start"})},100)):G===L.lx.UPLOAD_IMAGE_MODAL_EDIT||G===L.lx.UPLOAD_BACKGROUND_MODAL_EDIT?(et?(Qe(!0),Ye(5)):e(he),b((0,w.Wz)(L.lx.IMAGE_EDITOR_MODAL))):V("")},[G,b,et,lt]);const it=(0,l.useCallback)(({url:e=F||""})=>{q(e),K===ge&&b((0,k.tm)(e)),K===pe&&b((0,k.e_)(e)),setTimeout(()=>{De({keywords:"",color:"",orientation:""}),Ue({keywords:""}),qe([]),Fe([]),V(""),Ve(""),We(!1),W(""),j(""),Q(fe)},200),b((0,w.Oo)()),b((0,w.Os)())},[F,b,K]);(0,l.useEffect)(()=>{const e=z||H;e?(0,ue.DI)(e).then(t=>{ee(t),_e(572),setTimeout(()=>{let e=0;ne.current&&(e=ne.current.offsetHeight+62),Ce(e)},0),it(e)}).catch(e=>{ee(e)}):ee("")},[z,H,it]),(0,l.useEffect)(()=>{F&&_(F).then(({data:e})=>{J({width:null===e||void 0===e?void 0:e.width,height:null===e||void 0===e?void 0:e.height,size:((null===e||void 0===e?void 0:e.fileSize)/1024).toFixed(2),format:null===e||void 0===e?void 0:e.format})})},[F,_]);(0,l.useEffect)(()=>{var e;""===xe.keywords&&(null===ke||void 0===ke||null===(e=ke.current)||void 0===e||e.focus({cursor:"start"}),qe([]),setTimeout(()=>{Ce("auto"),_e(572)},0))},[xe,qe,Ce,_e]);const nt=e=>{const t="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/webp"===e.type||"image/gif"===e.type||"image/svg+xml"===e.type;return t||O.error({id:"IMAGE_UPLOAD_WRONG_FORMAT",data:e,message:"Upload",description:"You can only upload JPG/JPEG/PNG/WEBP/GIF/SVG file!"}),t},rt=({file:e})=>{const t="image/svg+xml"===e.type,l="image/webp"===e.type,i=e=>{const t=new Image;t.src=URL.createObjectURL(e),t.onload=()=>{(async e=>{Me(!0);const t=e.file;try{"image/gif"!==t.type&&(e.file=await(0,A.A)(t,{maxSizeMB:a.compressMaxSize||.45,maxWidthOrHeight:a.compressMaxWidthOrHeight||2e3})),C(e).then(({error:e,data:a})=>{if(e)O.fromError("IMAGE_UPLOAD_ERROR",t,e);else{const e=(0,de.g0)(a);var l;e.error?O.error({id:"IMAGE_UPLOAD_ERROR",data:t,innerException:400===e.error.status?(null===a||void 0===a?void 0:a.data)||(null===a||void 0===a||null===(l=a[0])||void 0===l?void 0:l.data):void 0,message:e.error.code||n("Upload failed"),description:e.error.message||n("File upload failed with status 400")}):e.file_url&&(Ce("auto"),ae(!1),it({url:e.file_url}),O.success({id:"IMAGE_UPLOAD_SUCCESS",data:t,message:n("The image was successfully uploaded.")}))}}).catch(e=>{}).finally(()=>{Me(!1)})}catch(l){Me(!1)}})({user_id:D.id,folder:R,file:e})}};t?((e,t)=>{const a=new FileReader;a.onload=function(a){const l=a.target.result,i=new Blob([l],{type:"image/svg+xml;charset=utf-8"}),n=URL.createObjectURL(i),r=new Image;r.onload=function(){const a=document.createElement("canvas");a.width=2*r.width,a.height=2*r.height,a.getContext("2d").drawImage(r,0,0,a.width,a.height),a.toBlob(a=>{const l=new File([a],e.name.replace(".svg",".png"),{type:"image/png"});t(l),URL.revokeObjectURL(n)},"image/png")},r.src=n},a.readAsText(e)})(e,e=>i(e)):l?((e,t,a=90)=>{const l=new Image;l.src=URL.createObjectURL(e),l.onload=()=>{const e=document.createElement("canvas");e.width=l.width,e.height=l.height;const i=e.getContext("2d");i.imageSmoothingEnabled=!0,i.imageSmoothingQuality="high",i.drawImage(l,0,0,e.width,e.height),e.toBlob(e=>{const a=new File([e],"converted.jpg",{type:"image/jpeg"});t(a)},"image/jpeg",a/100)},l.onerror=e=>{t(null)}})(e,e=>i(e)):i(e)},st=e=>rt({file:e});let ot=[{label:n("Upload"),key:fe,children:l.createElement("div",{ref:le,style:{paddingBottom:24}},!1!==a.imageCenterLocalUploadEnabled&&l.createElement(ye,{showUploadList:!1,name:"Image",beforeUpload:nt,customRequest:rt,style:{marginBottom:10},multiple:!1,accept:"image/png, image/jpeg, image/jpg, image/webp, image/gif, image/svg+xml"},l.createElement("p",{className:"ant-upload-drag-icon"},l.createElement(g.A,null)),l.createElement("p",{className:"ant-upload-text"},n("Click to select, paste from the clipboard, or drag and drop")),l.createElement("p",{className:"ant-upload-hint"},n("Accepted formats: PNG, JPG, WEBP, SVG or GIF."))),l.createElement(s.A,{style:{padding:"0 2px 0 2px"}},l.createElement(s.A.Item,{validateStatus:X},l.createElement(o.A,{ref:ke,allowClear:!0,size:"large",placeholder:n("Paste image URL here"),value:z,onChange:e=>{const t=e.target.value;j(t),Be&&clearTimeout(Be);const a=setTimeout(()=>tt(t),1e3);Ne(a)},spellCheck:"false"}))))}];a.imageCenterStockEnabled&&!et&&ot.push({label:n("Stock"),key:Ae,children:l.createElement("div",{ref:re,style:{paddingBottom:24}},l.createElement(Y,{currentReq:xe,setCurrentReq:De,imageStockList:Pe,setImageStockList:qe,setModalWidth:_e,setModalHeight:Ce,setStockLink:W,setCurrentImageLink:q,inputRef:Le,customRequest:tt}))}),a.imageCenterGifEnabled&&!et&&ot.push({label:n("GIF"),key:Ee,children:l.createElement("div",{ref:se,style:{paddingBottom:24}},l.createElement(ce,{currentReqGif:Ge,setCurrentReqGif:Ue,imageGifList:Te,setImageGifList:Fe,setModalWidth:_e,setModalHeight:Ce,setStockLink:W,setCurrentImageLink:q,inputRef:Ie,customRequest:tt}))}),a.elementAIimageEnabled&&!et&&ot.push({label:n("AI"),key:ve,children:l.createElement("div",{ref:we,style:{paddingBottom:24}},l.createElement(oe,{setModalHeight:Ce,customRequest:rt,aiImageRequest:Ke,setAiImageRequest:Ve,imageAiList:ze,setImageAiList:je,isLoadingAi:He,setIsLoadingAi:We,aiTabRef:we,inputAiRef:be,isImageUploaded:te,setIsImageUploaded:ae}))}),a.imageCenterEditorEnabled&&ot.push({label:"",key:he,children:l.createElement("div",{ref:ne},l.createElement(P,{currentImageLink:F,newLink:z,imageSize:Z,onSave:st,uploadImageResultIsLoading:S.isLoading||!1}))});const ct=l.createElement(p.A,{style:{fontSize:32,margin:-16},spin:!0});return l.createElement(l.Fragment,null,l.createElement(c.A,{width:Se,className:"image-center blocks-modal",title:n("Image Center"),centered:!0,style:{minHeight:390},open:!!K,onOk:it,onCancel:()=>{b((0,w.Oo)()),setTimeout(()=>{q(""),j(""),qe([]),qe([]),De({keywords:"",color:"",orientation:""}),Ue({keywords:""}),Ce("auto"),!He&&Ve(""),_e(572),Q(fe)},200)},footer:$===he?l.createElement(l.Fragment,null):null},l.createElement(m.A,{spinning:Oe,indicator:ct},l.createElement(u.A,{activeKey:$,onChange:e=>{"GALLERY"===e?B.success({maskClosable:!0,centered:!0,title:n("Coming soon"),content:n("The feature is under development."),okText:n("Ok. I'll be waiting"),onOk:()=>{}}):e===he&&""===F?B.warning({maskClosable:!0,centered:!0,title:n(""),content:n("To preview and edit the uploaded image"),okText:n("Upload Image"),onOk:()=>{Q(fe)}}):(setTimeout(()=>{let t=0,a=0;var l;if(e===fe&&le.current)""===xe.keywords&&(null===(l=ke.current)||void 0===l||l.focus({cursor:"start"})),t=300,a=572;else if(e===he&&ne.current)t=ne.current.offsetHeight+62,a=572;else if(e===Ae&&re.current){var i;""===xe.keywords&&(null===(i=Le.current)||void 0===i||i.focus({cursor:"start"})),t=130,a=572,Pe.length>0&&(a=1060,t="84vh")}else if(e===Ee&&se.current){var n;""===xe.keywords&&(null===(n=Ie.current)||void 0===n||n.focus({cursor:"start"})),t=130,a=572,Te.length>0&&(a=1060,t="84vh")}else if(e===ve&&we.current){var r;if(""===Ke&&0===ze.length)null===(r=be.current)||void 0===r||r.focus({cursor:"start"}),t=130;else t=we.current.offsetHeight+82;a=572}Ce(t),_e(a)},0),Q(e))},items:ot,style:{height:Re,minHeight:130}}))),l.createElement(me.A,{open:$e,onCancel:()=>Qe(!1),initialSlide:Ze}))}}}]);
2
- //# sourceMappingURL=8778.52a5c71c.js.map