Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

18.8 KB
Raw Blame
"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([["3643"],{65977:function(e,t,l){l.d(t,{Z:()=>i});var a=l(58786);let i=(0,a.aZ)({name:"Add",render:()=>(0,a.h)("svg",{width:"512",height:"512",viewBox:"0 0 512 512",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,a.h)("path",{d:"M256 112V400M400 256H112",stroke:"currentColor","stroke-width":"32","stroke-linecap":"round","stroke-linejoin":"round"}))})},20099:function(e,t,l){l.d(t,{Z:()=>s});var a=l(58786),i=l(97756);let n=Object.assign(Object.assign({},l(56946).Z.props),{trigger:String,xScrollable:Boolean,onScroll:Function,contentClass:String,contentStyle:[Object,String],size:Number,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),s=(0,a.aZ)({name:"Scrollbar",props:n,setup(){let e=(0,a.iH)(null);return Object.assign(Object.assign({},{scrollTo:(...t)=>{var l;null==(l=e.value)||l.scrollTo(t[0],t[1])},scrollBy:(...t)=>{var l;null==(l=e.value)||l.scrollBy(t[0],t[1])}}),{scrollbarInstRef:e})},render(){return(0,a.h)(i.Z,Object.assign({ref:"scrollbarInstRef"},this.$props),this.$slots)}})},54538:function(e,t,l){l.d(t,{DP:()=>w,Ew:()=>u,I5:()=>p,JI:()=>h,L3:()=>c,Nh:()=>y,UY:()=>g,WJ:()=>f,nn:()=>_});var a=l(76882),i=l(34541),n=l(58786);let{t:s}=a.ZP.global,r={fetchOptions:{loading:s("template.ai.loading.message"),successMessage:!0}};async function o(e,t){try{await i.e.post("/email_template/create",{temp_name:t,add_type:2,chat_id:e,html_content:""})}catch(e){throw console.warn(e),e}}async function c(e){await d(e),await v(e)}async function u(e){try{let t=`AI_temp_${new Date().getTime()}`,l=await i.e.post("/askai/chat/create_chat",{domain:e,add_type:99,temp_name:t},r);return await o(l.chatId,t),l.chatId}catch(e){return console.warn(e),null}}async function d(e){let{modelList:t,currentModel:l,currentModelTitle:a}=e;try{t.value=await i.e.post("/askai/supplier/models"),t.value.length&&(l.value=t.value[0],a.value=t.value[0].title)}catch(e){console.warn(e)}}async function v(e){let{chatId:t,chatInfo:l,currentModel:a,modelList:n,currentModelTitle:s,chatRecord:r,usageRecord:o}=e;try{if(l.value=await i.e.post("/askai/chat/info",{chatId:t.value}),l.value.modelId&&n.value.length){let e=n.value.find(e=>e.modelId==l.value.modelId);e&&(a.value=e,s.value=e.title)}for(let e=0;e<l.value.messages.length;e++){let t=`${l.value.messages[e].content}_+_${r.value.size}`;"user"==l.value.messages[e].role&&(r.value.set(t,m(l.value.messages[e+1].content)),o.value.set(t,l.value.messages[e+1].usage))}}catch(e){console.warn(e)}}async function p(e){let{chatId:t,isChat:l}=e;try{await i.e.post("/askai/chat/stop",{chatId:t.value},r),l.value=!1}catch(e){console.warn(e)}}async function f(e,t){let{scrollable:l,generateShow:a,chatId:r,currentModel:o,questionContent:c,chatRecord:u,currentChatRecordKey:d,scrollWrapperRef:v,chatScrollRef:p,isChat:f,usageRecord:h,useSpinTax:g,spinTaxLength:w}=e;if(f.value||!c.value||t&&(t.isComposing||229===t.keyCode)||t&&function(e,t){if(e.shiftKey&&"Enter"===e.key){e.preventDefault();let l=e.target,a=l.selectionStart,i=l.selectionEnd;return t.value=t.value.substring(0,a)+"\n"+t.value.substring(i),l.selectionStart=l.selectionEnd=a+1,!0}}(t,c))return;let _=`${c.value}_+_${u.value.size}`;u.value.set(_,[]),d.value=_;let b=c.value;c.value="";let S=[],k="",x=0;g.value&&(b+=`  ${s("template.ai.spintax.instruction",{count:w.value})}`);try{l.value=!0,a.value=!0,f.value=!0,(0,n.Y3)(()=>p.value.scrollTo({left:0,top:v.value.offsetHeight})),await i.e.post("/askai/chat/chat",{chatId:r.value,supplierName:o.value.supplierName,modelId:o.value.modelId,content:b,is_text:"false"},{fetchOptions:{cancelResInterceptor:!0},responseType:"text",onDownloadProgress:e=>{a.value=!1;try{let a=e.event.target.responseText,i=a.slice(x);x=a.length;var t=function(e){let t=e.split("\n"),l=[];for(let e of t){let t=e.trim();if(t.startsWith("data:")){let e=t.slice(5).trim();e&&l.push(e)}}return l}(i);for(let e=0;e<t.length;e++)t[e]&&(k+=JSON.parse(t[e]).content);u.value.set(_,m(k)),l.value&&setTimeout(()=>p.value.scrollTo({left:0,top:v.value.offsetHeight}),200)}catch(e){console.warn(e)}}}),l.value=!0,p.value.scrollTo({left:0,top:v.value.offsetHeight}),f.value=!1,y(e,e=>{h.value.set(_,e)})}catch(e){console.warn(e)}finally{a.value=!1,k="",x=0}}function m(e){let t=/```[\s\S]*?(?:```|$)/g,l=e.match(t)||[],a=e.split(t),i=[],n=Math.max(a.length,l.length);for(let e=0;e<n;e++)e<a.length&&""!==a[e].trim()&&i.push(a[e]),e<l.length&&i.push(l[e]);return i}function h(e){return e.replace(/```html/g,"").replace(/```$/gm,"")}function g(e){return e.replace(/<<<<<<<\s+SEARCH[\s\S]*?=======([\s\S]*?)>>>>>>>\s+REPLACE/g,"$1")}function w(e){let t=e.match(/<title>(.*?)<\/title>/i);return t?t[1]:""}async function y(e,t){let{chatId:l,previewCode:a,previewTit:n}=e;try{let e=await i.e.post("/askai/chat/get_html",{chatId:l.value});a.value=e.html_content,n.value=w(a.value),t&&t(e.last_usage)}catch(e){console.warn(e)}}async function _(e){let{previewCode:t,chatId:l}=e;try{await i.e.post("/askai/chat/modify_html",{chatId:l.value,content:t.value},r),y(e)}catch(e){console.warn(e)}}},88253:function(e,t,l){l.d(t,{Z:()=>r});var a=l(60579),i=l(58786),n=l(6768);let s=(0,i.aZ)({__name:"index",props:(0,i.Vf)({language:{type:String,default:"html"},theme:{type:String,default:"vs-dark"},options:{type:Object,default:()=>({})}},{value:{default:""},valueModifiers:{}}),emits:(0,i.Vf)(["save"],["update:value"]),setup(e,t){let{expose:l,emit:s}=t,r=(0,i.tT)(e,"value"),o=(0,i.iH)(null),c=null,u=(0,i.iH)(!1);n.Z.config({paths:{vs:`${location.origin}/static/plugin/monaco`}});let d=async()=>{if(o.value&&!c)try{u.value=!0;let t=await n.Z.init();(c=t.editor.create(o.value,{value:r.value,language:e.language,theme:e.theme,minimap:{enabled:!1},automaticLayout:!0,scrollBeyondLastLine:!1,fontSize:14,tabSize:2,wordWrap:"on",...e.options})).onDidChangeModelContent(()=>{r.value=(null==c?void 0:c.getValue())||""}),c.addCommand(t.KeyMod.CtrlCmd|t.KeyCode.KeyS,function(){s("save")})}finally{u.value=!1}},v=()=>{c&&(c.dispose(),c=null)};return(0,i.YP)(()=>r.value,e=>{c&&e!==c.getValue()&&c.setValue(e)}),(0,i.bv)(()=>{d()}),(0,i.Jd)(()=>{v()}),l({getEditor:()=>c}),(e,t)=>{let l=a.Z;return(0,i.wg)(),(0,i.j4)(l,{class:"h-full",show:(0,i.SU)(u)},{default:(0,i.w5)(()=>[(0,i._)("div",{ref_key:"containerRef",ref:o,class:"monaco-editor-container"},null,512)]),_:1},8,["show"])}}}),r=(0,l(41748).default)(s,[["__scopeId","data-v-72ffe419"]])},24877:function(e,t,l){l.r(t),l.d(t,{default:()=>ew});var a=l(58786),i=l(54470),n=l(27046),s=l(51048),r=l(88701),o=l(71309);let c="0!important",u="-1px!important";function d(e){return(0,o.cM)(`${e}-type`,[(0,o.c)("& +",[(0,o.cB)("button",{},[(0,o.cM)(`${e}-type`,[(0,o.cE)("border",{borderLeftWidth:c}),(0,o.cE)("state-border",{left:u})])])])])}function v(e){return(0,o.cM)(`${e}-type`,[(0,o.c)("& +",[(0,o.cB)("button",[(0,o.cM)(`${e}-type`,[(0,o.cE)("border",{borderTopWidth:c}),(0,o.cE)("state-border",{top:u})])])])])}let p=(0,o.cB)("button-group",`
 flex-wrap: nowrap;
 display: inline-flex;
 position: relative;
`,[(0,o.u4)("vertical",{flexDirection:"row"},[(0,o.u4)("rtl",[(0,o.cB)("button",[(0,o.c)("&:first-child:not(:last-child)",`
 margin-right: ${c};
 border-top-right-radius: ${c};
 border-bottom-right-radius: ${c};
 `),(0,o.c)("&:last-child:not(:first-child)",`
 margin-left: ${c};
 border-top-left-radius: ${c};
 border-bottom-left-radius: ${c};
 `),(0,o.c)("&:not(:first-child):not(:last-child)",`
 margin-left: ${c};
 margin-right: ${c};
 border-radius: ${c};
 `),d("default"),(0,o.cM)("ghost",[d("primary"),d("info"),d("success"),d("warning"),d("error")])])])]),(0,o.cM)("vertical",{flexDirection:"column"},[(0,o.cB)("button",[(0,o.c)("&:first-child:not(:last-child)",`
 margin-bottom: ${c};
 margin-left: ${c};
 margin-right: ${c};
 border-bottom-left-radius: ${c};
 border-bottom-right-radius: ${c};
 `),(0,o.c)("&:last-child:not(:first-child)",`
 margin-top: ${c};
 margin-left: ${c};
 margin-right: ${c};
 border-top-left-radius: ${c};
 border-top-right-radius: ${c};
 `),(0,o.c)("&:not(:first-child):not(:last-child)",`
 margin: ${c};
 border-radius: ${c};
 `),v("default"),(0,o.cM)("ghost",[v("primary"),v("info"),v("success"),v("warning"),v("error")])])])]),f=(0,a.aZ)({name:"ButtonGroup",props:{size:{type:String,default:void 0},vertical:Boolean},setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:l}=(0,i.ZP)(e);return(0,n.Z)("-button-group",p,t),(0,a.JJ)(r.J,e),{rtlEnabled:(0,s.V)("ButtonGroup",l,t),mergedClsPrefix:t}},render(){let{mergedClsPrefix:e}=this;return(0,a.h)("div",{class:[`${e}-button-group`,this.rtlEnabled&&`${e}-button-group--rtl`,this.vertical&&`${e}-button-group--vertical`],role:"group"},this.$slots)}});var m=l(15496),h=l(29283),g=l(23685),w=l(8490),y=l(73084),_=l(57869),b=l(20099),S=l(49942),k=l(31708),x=l(54538),$=l(64919),U=l(41982),H=l(94821);let I={key:0,class:"code-area"},Z={class:"code-tool"},z={class:"tools"},C=["innerHTML"],D=["innerHTML"],M=(0,a.aZ)({__name:"MarkdownRender",props:{content:{},chatRecordKey:{}},emits:["codeRender"],setup(e,t){let{emit:l}=t,{copy:i,copied:n}=(0,H.VPI)(),s=(0,a.f3)("modelStore"),{currentChatRecordKey:r,previewCode:o}=s,c=(0,a.iH)(),u=(0,a.iH)(""),d=(0,a.iH)(""),v=(0,$.Z)({html:!0,linkify:!0,typographer:!0,langPrefix:"language-",highlight:function(e,t){if(u.value=t,t&&U.Z.getLanguage(t))try{return U.Z.highlight(t,e).value}catch{}return v.utils.escapeHtml(e)}});function p(){r.value=e.chatRecordKey,(0,a.Y3)(()=>o.value=(0,x.JI)(e.content))}function f(){i(e.content)}return d.value=v.render((0,x.UY)(e.content)),(0,a.YP)(()=>e.content,t=>{d.value=v.render(t),u.value&&l("codeRender",{code:e.content,key:e.chatRecordKey})},{immediate:!0}),(e,t)=>((0,a.wg)(),(0,a.iD)("div",null,[(0,a.SU)(u)?((0,a.wg)(),(0,a.iD)("div",I,[(0,a._)("div",Z,[(0,a._)("span",null,(0,a.zw)((0,a.SU)(u)),1),(0,a._)("div",z,[(0,a._)("div",{class:"tool-item",onClick:f},[t[1]||(t[1]=(0,a._)("i",{class:"i-material-symbols:chrome-restore-rounded text-5"},null,-1)),(0,a._)("span",null,(0,a.zw)((0,a.SU)(n)?e.$t("template.ai.buttons.copied"):e.$t("template.ai.buttons.copy")),1)]),(0,a._)("div",{class:"tool-item",onClick:p},[t[2]||(t[2]=(0,a._)("i",{class:"i-mingcute:eye-2-fill text-5"},null,-1)),(0,a._)("span",null,(0,a.zw)(e.$t("template.ai.buttons.view")),1)]),(0,a._)("div",{class:"tool-item",onClick:t[0]||(t[0]=e=>(0,a.SU)(x.nn)((0,a.SU)(s)))},[t[3]||(t[3]=(0,a._)("i",{class:"i-ic:baseline-save text-5"},null,-1)),(0,a._)("span",null,(0,a.zw)(e.$t("template.ai.buttons.apply")),1)])])]),(0,a._)("div",{innerHTML:(0,a.SU)(d)},null,8,C)])):((0,a.wg)(),(0,a.iD)("div",{key:1,ref_key:"codeRef",ref:c,innerHTML:(0,a.SU)(d)},null,8,D))]))}});var W=l(41748);let T=(0,W.default)(M,[["__scopeId","data-v-6701046f"]]);var j=l(88253),R=l(65965);let P={class:"wrapper"},L={class:"page-tit"},E={class:"tit-content"},J={class:"ai-container"},q={class:"chat-area"},B={key:0,class:"answer-container"},Y={class:"ask-content"},K={class:"text"},O={class:"ask-content"},N={class:"text"},V={class:"answer-content"},A={class:"pic"},G={class:"text-4 text-[var(--color-primary-hover-1)]"},F={class:"text"},Q={class:"answer-tool"},X=["onClick"],ee={class:"tool-item"},et={key:0,class:"flex justify-start items-center gap-2.5"},el={class:"fw-bold"},ea={class:"question-card-content"},ei={class:"question-tools"},en={class:"flex justify-start gap-10px"},es={class:"w-160px"},er={class:"flex justify-start items-center"},eo={class:"send-btn"},ec={class:"view-area"},eu={style:{height:"calc(100vh - 165px)"}},ed={class:"h-10 flex justify-between items-center gap-2.5 mb-5"},ev={class:"flex justify-start items-center gap-2.5"},ep={key:0},ef={class:"text-4 fw-bold"},em=["innerHTML"],eh=["srcdoc"],eg=(0,a.aZ)({__name:"index",setup(e){let t=(0,k.s6)(),l=(0,R.tv)(),i=function(){let e=(0,a.iH)([]),t=(0,a.iH)(""),l=(0,a.iH)(""),i=(0,a.iH)(""),n=(0,a.iH)({domain:"",chatId:"",create_time:0,files:[],messages:[],modelId:"",prompt:"",supplierName:"",title:"",update_time:0}),s=(0,a.iH)(""),r=(0,a.iH)([]),o=(0,a.iH)({modelId:"",supplierName:"",capability:[],title:"",status:!1,max_tokens:0}),c=(0,a.iH)(""),u=(0,a.iH)([]),d=(0,a.iH)(""),v=(0,a.iH)(!1),p=(0,a.iH)(new Map),f=(0,a.iH)(new Map),m=(0,a.iH)(!1),h=(0,a.iH)(),g=(0,a.iH)(),w=(0,a.iH)(!0),y=(0,a.iH)("");return{domainList:e,sourceDomain:t,chatId:l,questionContent:i,chatInfo:n,currentChatRecordKey:s,modelList:r,currentModel:o,currentModelTitle:c,answerContent:u,previewCode:d,generateShow:v,chatRecord:p,usageRecord:f,isChat:m,chatScrollRef:h,scrollWrapperRef:g,scrollable:w,previewTit:y,useSpinTax:(0,a.iH)(!1),spinTaxLength:(0,a.iH)(50)}}();(0,a.JJ)("modelStore",i);let{chatId:n,modelList:s,currentModelTitle:r,previewCode:o,questionContent:c,chatRecord:u,currentChatRecordKey:d,currentModel:v,isChat:p,chatScrollRef:$,scrollWrapperRef:U,scrollable:H,chatInfo:I,previewTit:Z,usageRecord:z,useSpinTax:C,spinTaxLength:D}=i,M=(0,R.yj)(),W=(0,a.iH)("view");function eg(e,t){v.value=t}function ew(e){e.key==d.value&&(o.value=(0,x.UY)((0,x.JI)(e.code)),Z.value=(0,x.DP)(o.value))}function ey(e){e.deltaY<0&&(H.value=!1)}async function e_(){await (0,x.nn)(i),t.temp_subject=Z.value,l.push({path:"/market/task/edit",query:{chat_id:I.value.chatId}})}return n.value=M.params.chatId,(0,x.Nh)(i),(0,x.L3)(i),(0,a.bv)(()=>{!function e(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,a=t||null,i=l;if(!(i>=6)){if(a&&(clearTimeout(t),a=null),U.value.offsetHeight){$.value.scrollTo({left:0,top:U.value.offsetHeight}),i++;return}i++,a=setTimeout(()=>{e(a,i)},100)}}()}),(e,t)=>{let l=S.ZP,n=b.Z,d=_.ZP,v=y.Z,k=w.Z,H=g.Z,M=h.Z,R=m.ZP;return(0,a.wg)(),(0,a.iD)("div",P,[(0,a._)("div",L,[(0,a._)("span",E,(0,a.zw)(e.$t("template.ai.title")),1)]),(0,a._)("div",J,[(0,a._)("div",q,[(0,a._)("div",{ref:"answerRef",class:"answer",onWheel:ey},[(0,a.Wm)(d,{class:"answer-card",bordered:!1,"content-style":{height:"100%"}},{default:(0,a.w5)(()=>[(0,a.Wm)(n,{ref_key:"chatScrollRef",ref:$,trigger:"none",class:"h-full p-16px"},{default:(0,a.w5)(()=>[0==(0,a.SU)(u).size?((0,a.wg)(),(0,a.iD)("div",B,[(0,a._)("div",Y,[t[11]||(t[11]=(0,a._)("div",{class:"pic"},[(0,a._)("i",{class:"i-material-symbols:account-circle text-6 text-[var(--color-primary-hover-1)]"})],-1)),(0,a._)("div",K,(0,a.zw)(e.$t("template.ai.greeting")),1)])])):(0,a.kq)("",!0),(0,a._)("div",{ref_key:"scrollWrapperRef",ref:U},[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,a.SU)(u),n=>((0,a.wg)(),(0,a.iD)("div",{key:n[0],class:"answer-container"},[(0,a._)("div",O,[t[12]||(t[12]=(0,a._)("div",{class:"pic"},[(0,a._)("i",{class:"i-material-symbols:account-circle text-6 text-[var(--color-primary-hover-1)]"})],-1)),(0,a._)("div",N,(0,a.zw)(n[0].split("_+_")[0]),1)]),(0,a._)("div",V,[(0,a._)("div",A,[(0,a._)("span",G,(0,a.zw)(e.$t("template.ai.brandName")),1)]),(0,a._)("div",F,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)(n[1],(e,t)=>((0,a.wg)(),(0,a.j4)(T,{key:t,content:(0,a.SU)(x.UY)(e),"chat-record-key":n[0],class:"mb-4",onCodeRender:ew},null,8,["content","chat-record-key"]))),128))]),(0,a._)("div",Q,[(0,a._)("div",{class:"tool-item",onClick:e=>{c.value=n[0].toString().split("_+_")[0],(0,x.WJ)(i)}},[t[13]||(t[13]=(0,a._)("i",{class:"i-ri:refresh-line text-5"},null,-1)),(0,a._)("span",null,(0,a.zw)(e.$t("template.ai.buttons.regenerate")),1)],8,X),(0,a.Wm)(l,{trigger:"hover"},{trigger:(0,a.w5)(()=>[(0,a._)("div",ee,[t[14]||(t[14]=(0,a._)("i",{class:"i-ri:information-2-fill text-5"},null,-1)),(0,a._)("span",null,(0,a.zw)(e.$t("template.ai.buttons.info")),1)])]),default:(0,a.w5)(()=>[(0,a.SU)(z).get(n[0])?((0,a.wg)(),(0,a.iD)("div",et,[((0,a.wg)(!0),(0,a.iD)(a.HY,null,(0,a.Ko)((0,a.SU)(z).get(n[0]),(e,t)=>((0,a.wg)(),(0,a.iD)("div",{key:t},[(0,a._)("span",el,(0,a.zw)(t)+": ",1),(0,a._)("span",null,(0,a.zw)(e),1)]))),128))])):(0,a.kq)("",!0)]),_:2},1024)])])]))),128))],512)]),_:1},512)]),_:1})],544),(0,a.Wm)(d,{class:"question-card",bordered:!1},{default:(0,a.w5)(()=>[(0,a._)("div",ea,[(0,a.Wm)(v,{value:(0,a.SU)(c),"onUpdate:value":t[0]||(t[0]=e=>(0,a.dq)(c)?c.value=e:null),type:"textarea",class:"question-input",autosize:{minRows:4},placeholder:e.$t("template.ai.welcomeMessage",{domain:(0,a.SU)(I).domain}),onKeydown:t[1]||(t[1]=(0,a.D2)(e=>(0,a.SU)(x.WJ)((0,a.SU)(i),e),["enter"]))},null,8,["value","placeholder"]),(0,a._)("div",ei,[(0,a._)("div",en,[(0,a._)("div",es,[(0,a.Wm)(k,{value:(0,a.SU)(r),"onUpdate:value":[t[2]||(t[2]=e=>(0,a.dq)(r)?r.value=e:null),eg],options:(0,a.SU)(s),"consistent-menu-width":!1,"label-field":"title","value-field":"title"},null,8,["value","options"])]),(0,a._)("div",er,[(0,a.Wm)(H,{checked:(0,a.SU)(C),"onUpdate:checked":t[3]||(t[3]=e=>(0,a.dq)(C)?C.value=e:null),style:{"flex-shrink":"0"}},{default:(0,a.w5)(()=>t[15]||(t[15]=[(0,a.Uk)(" Spintax ")])),_:1,__:[15]},8,["checked"]),(0,a.Wm)(M,{value:(0,a.SU)(D),"onUpdate:value":t[4]||(t[4]=e=>(0,a.dq)(D)?D.value=e:null),placeholder:"",class:"w-50px","show-button":!1,style:{"flex-shrink":"0"},disabled:!(0,a.SU)(C)},null,8,["value","disabled"])])]),(0,a._)("div",eo,[(0,a.SU)(p)?((0,a.wg)(),(0,a.iD)("i",{key:1,class:"i-svg-spinners:pulse-2 text-8 text-[var(--color-primary-1)] hover-text-[var(--color-primary-hover-1)]",onClick:t[6]||(t[6]=e=>(0,a.SU)(x.I5)((0,a.SU)(i)))})):((0,a.wg)(),(0,a.iD)("i",{key:0,class:"i-icon-park-twotone:arrow-circle-up text-8 text-[var(--color-primary-1)] hover-text-[var(--color-primary-hover-1)]",onClick:t[5]||(t[5]=e=>(0,a.SU)(x.WJ)((0,a.SU)(i)))}))])])])]),_:1})]),(0,a._)("div",ec,[(0,a.Wm)(d,{style:{height:"100%"}},{default:(0,a.w5)(()=>[(0,a._)("div",eu,[(0,a._)("div",ed,[(0,a._)("div",ev,[(0,a.Wm)(f,{size:"small"},{default:(0,a.w5)(()=>[(0,a.Wm)(R,{type:"view"==(0,a.SU)(W)?"primary":"default",onClick:t[7]||(t[7]=e=>W.value="view")},{icon:(0,a.w5)(()=>t[16]||(t[16]=[(0,a._)("i",{class:"i-mingcute:eye-2-fill text-5"},null,-1)])),default:(0,a.w5)(()=>[(0,a.Uk)(" "+(0,a.zw)(e.$t("template.ai.buttons.view")),1)]),_:1},8,["type"]),(0,a.Wm)(R,{type:"edit"==(0,a.SU)(W)?"primary":"default",onClick:t[8]||(t[8]=e=>W.value="edit")},{icon:(0,a.w5)(()=>t[17]||(t[17]=[(0,a._)("i",{class:"i-tdesign:code text-5"},null,-1)])),default:(0,a.w5)(()=>[(0,a.Uk)(" "+(0,a.zw)(e.$t("template.ai.buttons.edit")),1)]),_:1},8,["type"])]),_:1}),"edit"==(0,a.SU)(W)?((0,a.wg)(),(0,a.iD)("span",ep,(0,a.zw)(e.$t("template.ai.tips.saveShortcut")),1)):(0,a.kq)("",!0)]),(0,a._)("span",ef,(0,a.zw)((0,a.SU)(Z)),1),(0,a.Wm)(R,{style:{width:"134px"},type:"primary",disabled:!(0,a.SU)(o),onClick:e_},{icon:(0,a.w5)(()=>t[18]||(t[18]=[(0,a._)("i",{class:"i-mingcute:mail-send-fill"},null,-1)])),default:(0,a.w5)(()=>[(0,a.Uk)(" "+(0,a.zw)(e.$t("template.ai.send")),1)]),_:1},8,["disabled"])]),(0,a.Wm)(n,{style:{height:"calc(100% - 40px)"}},{default:(0,a.w5)(()=>["view"==(0,a.SU)(W)&&(0,a.SU)(p)?((0,a.wg)(),(0,a.iD)("div",{key:0,innerHTML:(0,a.SU)(o)},null,8,em)):"view"!=(0,a.SU)(W)||(0,a.SU)(p)?((0,a.wg)(),(0,a.j4)(j.Z,{key:2,value:(0,a.SU)(o),"onUpdate:value":t[9]||(t[9]=e=>(0,a.dq)(o)?o.value=e:null),style:{height:"calc(100vh - 217px)"},onSave:t[10]||(t[10]=e=>(0,a.SU)(x.nn)((0,a.SU)(i)))},null,8,["value"])):((0,a.wg)(),(0,a.iD)("iframe",{key:1,srcdoc:(0,a.SU)(o),frameborder:"0",class:"w-100%",style:{height:"calc(100vh - 224px)"}},null,8,eh))]),_:1})])]),_:1})])])])}}}),ew=(0,W.default)(eg,[["__scopeId","data-v-7548b2ef"]])}}]);