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