import{A as b,a4 as w,D as t,B as i,j as e,T as f,a5 as P}from"./main-crazy-owls-work.js";import{$ as S}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as x,a as A}from"./useMemoDebounce-BIwvA9Mb.js";import{u as j}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{I as F}from"./InstagramPreview-DO9elVxn.js";import{T as k,p as m}from"./TemplateDocLink-C5Om0X4f.js";import{I as N}from"./index-Bm9W7Nqt.js";import{M as d}from"./AiPromptConfigModal-BrZd34tw.js";import{s as $}from"./index-C903bx6G.js";import{R as B,C as h}from"./row-DAt4Bs0l.js";import{C as o}from"./index-9x8aFyWV.js";import{F as p}from"./index-DLeF0Q26.js";import{S as D}from"./index-CV7ZrOqa.js";import{S as W}from"./index-Uj_IJMNj.js";import"./PreviewCard-DAT49Z9x.js";import"./emotion-react.browser.esm-Y_LRzwGN.js";import"./index-B1hhaeCD.js";import"./index-DbMzUBXN.js";import"./AntIconWrapper-CV4oO3YH.js";import"./index-D66C40IV.js";import"./Input-DrlF5Epd.js";import"./EyeOutlined-BpDfhdMV.js";import"./context-DxDN2Q9A.js";import"./mediaQueryUtil-BSyvLspT.js";import"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,s){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,s),s)}};const{Title:u}=f;function le(){const{token:r}=b.useToken(),[s,y]=w(S),{isTemplatesUpdateSuccessfully:T,updateSocialTemplates:I}=j(),[v,C]=$.useMessage();x(async()=>{const{status:a}=await I(s);T&&a&&A(v,a)},400,[s]);const n=(a,l)=>{y(c=>P(c,g=>{a==="postingType"&&c.instagram.postingType==="isPromptImage"&&l!=="isPromptImage"&&(g.instagram.promptImage=""),g.instagram[a]=l}))},M=[{label:t("Feature image"),value:"isFeaturedImage"},{label:t("Product Image"),value:"isProductImage"},{label:t("All images"),value:"isAllImages"},{label:t("Prompt Image"),value:"isPromptImage"}];return i(o,{style:{backgroundColor:r.colorFillAlter},children:[C,i(B,{gutter:20,children:[i(h,{span:14,children:[i(u,{level:4,children:[t("Instagram Template Settings")," "]}),e(k,{platform:"Instagram"}),i(o,{children:[e(o.Meta,{description:t("Custom message settings."),title:t("Custom Message")}),e("div",{children:e(d,{onChange:a=>n("content",a),rows:5,style:{minWidth:200},value:s.instagram.content,wordCount:m.instagram.description.length})})]}),i(o,{style:{marginTop:10},children:[i(p,{gap:20,justify:"space-between",children:[e(o.Meta,{description:t("Post styling and type setup."),title:t("Posting type")}),e("div",{children:e(D,{onChange:a=>n("postingType",a),options:M,style:{minWidth:200},value:s.instagram.postingType})})]}),e("div",{className:"pt-2",children:e(f.Text,{type:"secondary",children:t("Instagram media images must be 1.91:1 to 4:5 aspect ratio, 320-1440px resolution (recommended 1080px), and under 8MB.")})})]}),s.instagram.postingType==="isPromptImage"&&e(o,{style:{marginTop:10},children:i(p,{gap:20,justify:"space-between",children:[e(o.Meta,{description:t("Select an AI prompt for image generation."),title:t("Prompt Name")}),e("div",{children:e(N,{onChange:a=>n("promptImage",a),value:s.instagram.promptImage})})]})}),i(o,{style:{marginTop:10},children:[e(o.Meta,{description:t("Your comment"),title:t("First comment")}),e("div",{children:e(d,{onChange:a=>n("comment",a),rows:1,style:{minWidth:200},value:s.instagram.comment,wordCount:m.instagram.comment.length})})]}),e(o,{style:{marginTop:10},children:i(p,{gap:20,justify:"space-between",children:[e(o.Meta,{description:`Instagram restricts the length of a post to ${m.instagram.description.length} characters. If you enable this option, the first ${m.instagram.description.length} characters of your personalized message will be shared; if not, the limit prevents the post from being shared.`,title:t("Trim Message")}),e("div",{children:e(W,{checked:s.instagram.trimMessage,onChange:a=>n("trimMessage",a)})})]})})]}),i(h,{span:10,children:[i(u,{level:5,children:[" ",t("Preview")," "]}),e(F,{message:s.instagram.content,type:s.instagram.postingType})]})]})]})}export{le as default};
