import{A as C,a4 as M,B as s,j as t,T as S,D as o,a5 as v}from"./main-crazy-owls-work.js";import{$ as b}from"./useSocialTemplates-Dcb3t5jQ.js";import{u as I,a as P}from"./useMemoDebounce-BIwvA9Mb.js";import{u as j}from"./useUpdateSocialTemplates-BBEsnaqI.js";import{T as A}from"./TwitterPreview-D78I6Y8z.js";import{T as x,p as h}from"./TemplateDocLink-C5Om0X4f.js";import{I as k}from"./index-Bm9W7Nqt.js";import{M as $}from"./AiPromptConfigModal-BrZd34tw.js";import{p as D}from"./optionsHelper-B_8X5Dll.js";import{s as F}from"./index-C903bx6G.js";import{C as r}from"./index-9x8aFyWV.js";import{F as n}from"./index-DLeF0Q26.js";import{S as N}from"./index-CV7ZrOqa.js";import{S as z}from"./index-Uj_IJMNj.js";import{C as g,R as B}from"./row-DAt4Bs0l.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"./EllipsisOutlined-7nGPDvd9.js";import"./Dropdown-D0863Mnh.js";import"./move-ULSkkuK6.js";import"./mediaQueryUtil-BSyvLspT.js";globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(a,i){return this.cache.has(a)?this.cache.get(a):(this.cache.set(a,i),i)}};const{Title:d}=S;function ct(){const{token:a}=C.useToken(),[i,f]=M(b),{isTemplatesUpdateSuccessfully:u,updateSocialTemplates:T}=j(),[w,y]=F.useMessage();I(async()=>{const{status:e}=await T(i);u&&e&&P(w,e)},400,[i]);const p=(e,m)=>{f(l=>v(l,c=>{e==="postingType"&&l.twitter.postingType==="isPromptImage"&&m!=="isPromptImage"&&(c.twitter.promptImage=""),c.twitter[e]=m}))};return s(B,{gutter:20,children:[y,t(g,{span:14,children:s(r,{size:"small",style:{backgroundColor:a.colorFillAlter},children:[s(d,{level:4,children:[" ",o("X (Twitter) Template Settings")," "]}),t(x,{platform:"X (Twitter)"}),s(r,{children:[t(r.Meta,{description:o("Custom message settings."),title:o("Custom Message")}),t("div",{children:t($,{onChange:e=>p("content",e),rows:5,style:{minWidth:200},value:i.twitter.content})})]}),t(r,{style:{marginTop:10},children:s(n,{gap:20,justify:"space-between",children:[t(r.Meta,{description:o("Post styling and type setup."),title:o("Posting type")}),t("div",{children:t(N,{onChange:e=>p("postingType",e),options:D,style:{minWidth:200},value:i.twitter.postingType})})]})}),i.twitter.postingType==="isPromptImage"&&t(r,{style:{marginTop:10},children:s(n,{gap:20,justify:"space-between",children:[t(r.Meta,{description:o("Select an AI prompt for image generation."),title:o("Prompt Name")}),t("div",{children:t(k,{onChange:e=>p("promptImage",e),value:i.twitter.promptImage})})]})}),t(r,{style:{marginTop:10},children:s(n,{gap:20,justify:"space-between",children:[t(r.Meta,{description:`Twitter restricts the length of a tweet to ${h.twitter.description.length} characters. If you enable this option, the first ${h.twitter.description.length} characters of your personalized message will be shared; if not, the limit prevents the tweet from being shared.`,title:o("Trim Message")}),t("div",{children:t(z,{checked:i.twitter.trimMessage,onChange:e=>p("trimMessage",e)})})]})})]})}),s(g,{span:10,children:[s(d,{level:5,children:[" ",o("Preview")," "]}),t(A,{message:i.twitter.content,type:i.twitter.postingType})]})]})}export{ct as default};
