@blueking/ai-blueking 0.3.3 → 0.3.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.
@@ -21096,7 +21096,7 @@ const E_ = {
21096
21096
  e("update:model", ...arguments);
21097
21097
  },
21098
21098
  "onUpdate:isShow"() {
21099
- e("update:isShow", ...arguments);
21099
+ e("update:isShow", ...arguments), e("showDialog", ...arguments);
21100
21100
  },
21101
21101
  ...n.$attrs
21102
21102
  });
@@ -340,4 +340,4 @@ function print() { __p += __j.call(arguments, '') }
340
340
  </button>
341
341
  </div>
342
342
  `}}var Fse=(t,e)=>{Pf&&(e.onSuccess&&Pf.on("success",e.onSuccess),e.onError&&Pf.on("error",e.onError)),t.renderer.rules.code_block=zk(t.renderer.rules.code_block,e),t.renderer.rules.fence=zk(t.renderer.rules.fence,e)};const Bse=Gi(Fse);var $T=(t=>(t.Assistant="assistant",t.Cite="cite",t.System="system",t.User="user",t))($T||{}),Td=(t=>(t.Error="error",t.Loading="loading",t.Success="success",t))(Td||{});const Gse=oo(nn({__name:"ai-avatar",props:{size:{default:36}},setup(t){const e=t,n=gn(()=>({minWidth:`${e.size}px`,maxWidth:`${e.size}px`,minHeight:`${e.size}px`,maxHeight:`${e.size}px`,padding:`${e.size*.208}px ${e.size*.222}px ${e.size*.194}px ${e.size*.18}px`})),r=gn(()=>({fontSize:`${e.size*.611}px`}));return(i,o)=>(gt(),Pt("span",{style:Li(n.value),class:"message-photo ai"},[pt("i",{style:Li(r.value),class:"ai-blueking-icon ai-blueking-ai"},null,4)],4))}}),[["__scopeId","data-v-c3781e8b"]]),jse={key:0,class:"ai-cite-container"},zse={class:"message-content-container"},Yse={class:"message-content user"},Hse={key:0,class:"time-message user"},Qse=["innerHTML"],Vse={class:"message-photo user"},$se=["src"],Wse={class:"message-content ai"},qse={key:0,class:"time-message ai"},Jse={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},Kse=[pt("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],Zse={key:3,class:"message-wrap"},Xse=["innerHTML"],ele=nn({__name:"render-message",props:{message:{},userPhoto:{default:$I}},setup(t){const e=new Lse({html:!0,highlight:function(l,s){if(s&&UP.getLanguage(s))try{return UP.highlight(l,{language:s}).value}catch{}return""}}).use(Bse,{iconClass:"ai-blueking-icon ai-blueking-copy",buttonClass:"ai-blueking-copy-button"}),n=t,r=gn(()=>{var s;const l={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(s=n.message)!=null&&s.status?l[n.message.status]:""}),i=gn(()=>n.message.content?e.render(n.message.content):""),o=gn(()=>{const l=gf(n.message.time),s=gf();return n.message.time?s.isSame(l,"year")?l.format("MM-DD HH:mm:ss"):l.format("YYYY-MM-DD HH:mm:ss"):""});return(l,s)=>(gt(),Pt("li",{class:da([l.message.role,"message-main"])},[l.message.cite?(gt(),Pt("div",jse,[We(GD,{text:l.message.cite},null,8,["text"])])):Wn("v-if",!0),pt("div",zse,[l.message.role===ut($T).User?(gt(),Pt(sn,{key:0},[pt("p",Yse,[o.value?(gt(),Pt("span",Hse,ur(o.value),1)):Wn("v-if",!0),pt("span",{class:"markdown-message",innerHTML:i.value},null,8,Qse)]),pt("span",Vse,[pt("img",{src:l.userPhoto},null,8,$se)])],64)):(gt(),Pt(sn,{key:1},[We(Gse),pt("p",Wse,[o.value?(gt(),Pt("span",qse,ur(o.value),1)):Wn("v-if",!0),r.value?(gt(),Pt("i",{key:1,class:da(r.value)},null,2)):Wn("v-if",!0),l.message.status===ut(Td).Loading?(gt(),Pt("svg",Jse,Kse)):Wn("v-if",!0),l.message.status===ut(Td).Error?(gt(),Pt("span",Zse,ur(l.message.content),1)):(gt(),Pt("span",{key:4,innerHTML:i.value,class:da({"markdown-message":!0,loading:l.message.status===ut(Td).Loading})},null,10,Xse))])],64))])],2))}}),tle={class:"prompt-list"},nle={class:"search-group"},rle=["onClick"],ile={class:"prompt-content"},ole=oo(nn({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(t,{emit:e}){const n=t,r=e,i=Ww,o=ud,{selectedText:l,lockSelectedText:s}=FS(),u=mn(""),d=mn(40),p=mn(),_=mn(!1),g=gn(()=>{var $;return(($=n.prompts)==null?void 0:$.filter(ue=>ue.content.includes(u.value)))||[]}),m=gn(()=>{var $;return n.placeholder?n.placeholder:($=n.prompts)!=null&&$.length?rn("您可以键入 “/” 查看更多Prompt"):rn("请输入")}),S=$=>{r("update:value",$)},E=()=>{var $;n.value==="/"&&(($=n.prompts)!=null&&$.length)?O():K()},v=()=>{ma(()=>{var ue;const $=(ue=p.value)==null?void 0:ue.$el.querySelector("textarea");($==null?void 0:$.scrollHeight)>40&&n.value?d.value=$.scrollHeight<=300?$.scrollHeight:300:d.value=40})},h=$=>{r("update:value",$.content),r("choose-prompt",$),K(),k()},N=($,ue)=>{ue.key==="Enter"&&!ue.shiftKey&&(ue.preventDefault(),r("enter"))},A=()=>{S("")},k=()=>{var ue;const $=(ue=p.value)==null?void 0:ue.$el.querySelector("textarea");$==null||$.focus()},C=()=>{l.value&&(s.value=!0)},O=()=>{_.value=!0},K=()=>{_.value=!1};return Rr(()=>n.value,()=>{v(),E()}),_r(k),($,ue)=>(gt(),Pi(ut(uS),{width:"calc(100% - 118px)","ext-cls":"empty-padding",arrow:!1,"is-show":_.value,"popover-delay":0,boundary:"parent",placement:"bottom",theme:"light",trigger:"manual"},{content:ts(()=>{var Z;return[pt("div",null,[pr((gt(),Pt("section",tle,[We(ut(IS),{class:"input-search",modelValue:u.value,"onUpdate:modelValue":ue[0]||(ue[0]=ie=>u.value=ie),behavior:"simplicity",clearable:""},null,8,["modelValue"]),pt("section",nle,[(gt(!0),Pt(sn,null,Np(g.value,(ie,se)=>pr((gt(),Pt("span",{class:"group-prompt",key:se,onClick:le=>h(ie)},[pt("span",ile,ur(ie.content),1)],8,rle)),[[ut(o),{content:ie.content,placement:"right",theme:"light",width:300,boundary:"parent"}]])),128)),(Z=g.value)!=null&&Z.length?Wn("v-if",!0):(gt(),Pi(ut(pZ),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[ut(i),K]])])]}),default:ts(()=>[pt("section",{style:Li({"--text-height":d.value+"px"}),class:"send-prompt-container"},[We(ut(IS),{ref_key:"inputRef",ref:p,class:"send-prompt",autosize:!1,clearable:!0,"model-value":$.value,"native-attributes":{autofocus:"autofocus"},placeholder:m.value,row:"1",type:"textarea",onFocus:C,onInput:S,onKeydown:N},null,8,["model-value","placeholder"]),$.value?(gt(),Pi(ut(A_),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:A})):Wn("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-3354f392"]]),ale={class:"ai-shortcuts"},sle=oo(nn({__name:"render-shortcuts",props:{shortcuts:{}},emits:["select"],setup(t,{emit:e}){const n=e,r=i=>{n("select",i)};return(i,o)=>(gt(),Pt("ul",ale,[(gt(!0),Pt(sn,null,Np(i.shortcuts,l=>(gt(),Pi(ut(LD),{class:"ai-blueking-shortcut",key:l.label,theme:"info",onClick:s=>r(l)},{default:ts(()=>[ba(ur(l.label),1)]),_:2},1032,["onClick"]))),128))]))}}),[["__scopeId","data-v-266e17ca"]]),lle=(t=>(Sp("data-v-fd57f18d"),t=t(),bp(),t))(()=>pt("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[pt("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),cle=oo(nn({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(t,{emit:e}){const n=e,r=()=>{n("stop")};return(i,o)=>i.isShow?(gt(),Pt("span",{key:0,class:"ai-blueking-render-stop",onClick:r},[lle,ba(" "+ur(ut(rn)("终止生成")),1)])):Wn("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),ule={key:0,class:"time-wrapper"},dle={class:"time-message"},ple=oo(nn({__name:"render-time",props:{message:{}},setup(t){const e=t,n=gn(()=>{var l;const r=gf(e.message.time),i=gf(),o={0:rn("日"),1:rn("一"),2:rn("二"),3:rn("三"),4:rn("四"),5:rn("五"),6:rn("六")};return!e.message.time||(l=window.showTimes)!=null&&l.some(s=>Math.abs(r.diff(s,"minute"))<10&&s!==e.message.time)?"":(window.showTimes=[...window.showTimes||[],e.message.time],i.isSame(r,"day")?r.format("HH:mm:ss"):i.subtract(1,"day").isSame(r,"week")?rn("昨天")+" "+r.format("HH:mm:ss"):i.isSame(r,"week")?rn("本周")+o[r.day()]+" "+r.format("HH:mm:ss"):i.subtract(1,"week").isSame(r,"week")?rn("上周")+o[r.day()]+" "+r.format("HH:mm:ss"):i.isSame(r,"year")?r.format("MM-DD HH:mm:ss"):r.format("YYYY-MM-DD HH:mm:ss"))});return(r,i)=>n.value?(gt(),Pt("section",ule,[pt("span",dle,ur(n.value),1)])):Wn("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),Yk=t=>(Sp("data-v-830cceda"),t=t(),bp(),t),_le={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},fle=[Yk(()=>pt("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],mle={class:"ai-operation"},gle={class:"ai-operation-input-wrapper"},Ele={class:"ai-cite-tips"},Sle={class:"ai-operation-input"},ble=Yk(()=>pt("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),vle=oo(nn({__name:"render-content",props:{messages:{},prompts:{},loading:{type:Boolean},background:{default:"#f5f7fa"},userPhoto:{},placeholder:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean,default:!0},alert:{}},emits:["ai-click","send","choose-prompt","scroll-load","stop"],setup(t,{expose:e,emit:n}){const r=t,i=n,o=ud,l=mn(""),{selectedText:s,clearSelection:u}=FS(),{isShow:d}=BD(),p=cee,_=()=>{ma(()=>{const C=document.querySelector(".ai-blueking-messages");C.scrollTop=C.scrollHeight})},g=pee(C=>{if(r.scrollLoading||r.scrollLoadingEnd)return;C.target.scrollTop<200&&i("scroll-load")}),m=()=>{if(l.value){if(r.loading){FD({theme:"warning",message:rn("内容正在执行中,请执行完成后再发送")});return}i("send",{content:l.value,cite:s.value}),l.value="",s.value=""}},S=C=>{i("choose-prompt",C)},E=()=>{i("stop")},v=C=>{const O=C.target;if(O!=null&&O.classList.contains("ai-blueking-angle-up")){const K=O==null?void 0:O.parentElement;K!=null&&K.classList.contains("closed")?K==null||K.classList.remove("closed"):K==null||K.classList.add("closed")}O!=null&&O.classList.contains("ai-clickable")&&i("ai-click",O.dataset.ai)},h=()=>{_(),document.addEventListener("click",v)},N=()=>{window.showTimes=[],document.removeEventListener("click",v)},A=C=>{l.value=C},k=C=>{const O=C.prompt.replace("{{ SELECTED_TEXT }}",s.value);if(r.loading){FD({theme:"warning",message:rn("内容正在执行中,请执行完成后再发送")});return}i("send",{content:C.label,cite:s.value,prompt:O}),s.value=""};return Rr(()=>r.messages,()=>{const C=document.querySelector(".ai-blueking-messages");(C==null?void 0:C.scrollTop)+(C==null?void 0:C.clientHeight)+100>=(C==null?void 0:C.scrollHeight)&&_()},{deep:!0}),_r(h),$r(N),e({setInputMessage:A}),(C,O)=>(gt(),Pt("section",{style:Li({background:C.background}),class:"ai-content"},[C.alert?(gt(),Pi(ut(_q),{key:0,title:C.alert,theme:"warning",closable:""},null,8,["title"])):Wn("v-if",!0),pt("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:O[0]||(O[0]=(...K)=>ut(g)&&ut(g)(...K))},[C.scrollLoading?(gt(),Pt("svg",_le,fle)):Wn("v-if",!0),(gt(!0),Pt(sn,null,Np(C.messages,K=>(gt(),Pt(sn,{key:K.content},[We(ple,{class:"render-message",message:K},null,8,["message"]),We(ele,{class:"render-message",message:K,"user-photo":C.userPhoto},null,8,["message","user-photo"])],64))),128))],32),pt("section",mle,[pt("section",{class:"ai-operation-tools",onMousedown:O[1]||(O[1]=Wr(()=>{},["prevent"]))},[We(vee),We(cle,{"is-show":C.loading,onStop:E},null,8,["is-show"])],32),pt("section",gle,[ut(s)?(gt(),Pt("div",{key:0,class:da(["ai-cite-container",{"is-back-show":!ut(d)}]),onMousedown:O[2]||(O[2]=Wr(()=>{},["prevent"]))},[We(GD,{"show-close-icon":!0,text:ut(s),onClose:ut(u)},null,8,["text","onClose"]),pt("span",Ele,ur(ut(rn)("想对选中的文本做什么")),1),We(sle,{shortcuts:ut(p),onSelect:k},null,8,["shortcuts"])],34)):Wn("v-if",!0),pt("section",Sle,[We(ole,{value:l.value,"onUpdate:value":O[3]||(O[3]=K=>l.value=K),placeholder:C.placeholder,prompts:C.prompts,onChoosePrompt:S,onEnter:m},null,8,["value","placeholder","prompts"]),pr((gt(),Pi(ut(Uq),{class:"ai-operation-button",disabled:C.loading||!l.value,size:"large",theme:"primary",onClick:m},{default:ts(()=>[ble,ba(" "+ur(ut(rn)("发送")),1)]),_:1},8,["disabled"])),[[ut(o),{content:ut(rn)("内容正在执行中,请执行完成后再发送"),disabled:!C.loading}]])])])])],4))}}),[["__scopeId","data-v-830cceda"]]),hle={class:"ai-modal-header-icon"},Tle=oo(nn({__name:"render-modal",props:{headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)"},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0})},sizeLimit:{default:()=>({height:320,width:400})},logo:{default:"ai-blueking-icon ai-blueking-ai"},name:{},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0})},models:{},model:{}},emits:["clear","close","choose-model"],setup(t,{emit:e}){const n=t,r=e,i=ud,o={height:window.innerHeight,width:window.innerWidth},l={isMove:!1,type:"",clientX:0,clientY:0},s=()=>{var V,j,P,D;const le=(W,ge)=>W===void 0?ge:W;return{top:le((V=n.startPosition)==null?void 0:V.top,o.height-n.sizeLimit.height),bottom:le((j=n.startPosition)==null?void 0:j.bottom,0),left:le((P=n.startPosition)==null?void 0:P.left,0),right:le((D=n.startPosition)==null?void 0:D.right,o.width-n.sizeLimit.width)}},u=mn(s()),d=gn(()=>u.value.top<=n.positionLimit.top&&u.value.bottom<=n.positionLimit.bottom),p=le=>{r("choose-model",le)},_=le=>{l.isMove=!0,l.type="move",l.clientX=le.clientX,l.clientY=le.clientY},g=le=>{l.isMove=!0,l.type="rightDrag",l.clientX=le.clientX},m=le=>{l.isMove=!0,l.type="leftDrag",l.clientX=le.clientX},S=le=>{l.isMove=!0,l.type="topDrag",l.clientY=le.clientY},E=le=>{l.isMove=!0,l.type="bottomDrag",l.clientY=le.clientY},v=le=>{l.isMove=!0,l.type="topLeftDrag",l.clientY=le.clientY,l.clientX=le.clientX},h=le=>{l.isMove=!0,l.type="topRightDrag",l.clientY=le.clientY,l.clientX=le.clientX},N=le=>{l.isMove=!0,l.type="bottomLeftDrag",l.clientY=le.clientY,l.clientX=le.clientX},A=le=>{l.isMove=!0,l.type="bottomRightDrag",l.clientY=le.clientY,l.clientX=le.clientX},k=()=>{l.isMove=!1},C=(le,V)=>{["move","leftDrag"].includes(l.type)&&(u.value.left+=le),["move","rightDrag"].includes(l.type)&&(u.value.right-=le),["move","topDrag"].includes(l.type)&&(u.value.top+=V),["move","bottomDrag"].includes(l.type)&&(u.value.bottom-=V),["topLeftDrag"].includes(l.type)&&(u.value.left+=le,u.value.top+=V),["topRightDrag"].includes(l.type)&&(u.value.right-=le,u.value.top+=V),["bottomLeftDrag"].includes(l.type)&&(u.value.left+=le,u.value.bottom-=V),["bottomRightDrag"].includes(l.type)&&(u.value.right-=le,u.value.bottom-=V)},O=(le,V)=>{const{top:j,bottom:P,left:D,right:W}=u.value;(o.width-D-W<n.sizeLimit.width||D<n.positionLimit.left||W<n.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(l.type)&&(u.value.left-=le),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(l.type)&&(u.value.right+=le)),(o.height-j-P<n.sizeLimit.height||j<n.positionLimit.top||P<n.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(l.type)&&(u.value.top-=V),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(l.type)&&(u.value.bottom+=V))},K=le=>{if(!l.isMove)return;le.preventDefault();const V=le.clientX-l.clientX,j=le.clientY-l.clientY;C(V,j),O(V,j),l.clientX=le.clientX,l.clientY=le.clientY},$=()=>{o.height=window.innerHeight,o.width=window.innerWidth,u.value=s()},ue=()=>{u.value.top=n.positionLimit.top,u.value.bottom=n.positionLimit.bottom},Z=()=>{u.value.top=o.height-n.sizeLimit.height,u.value.bottom=n.positionLimit.bottom},ie=()=>{r("clear")},se=()=>{r("close")};return rg(()=>{window.addEventListener("mousemove",K,!0),window.addEventListener("mouseup",k),window.addEventListener("resize",$)}),$r(()=>{window.removeEventListener("mousemove",K,!0),window.removeEventListener("mouseup",k),window.removeEventListener("resize",$)}),(le,V)=>(gt(),Pt("section",{style:Li({top:u.value.top+"px",bottom:u.value.bottom+"px",left:u.value.left+"px",right:u.value.right+"px"}),class:"ai-modal"},[pt("header",{style:Li({background:le.headBackground}),class:"ai-modal-header",onMousedown:Wr(_,["stop"])},[pt("span",hle,[pt("i",{class:da(le.logo)},null,2),ba(" "+ur(le.name||ut(rn)("小鲸"))+" ",1),le.models?(gt(),Pi(ut(PD),{key:0,class:"ai-modal-header-models","model-value":le.model,size:"small",onChange:p},{default:ts(()=>[(gt(!0),Pt(sn,null,Np(le.models,j=>(gt(),Pi(ut(PD).Option,{key:j.id,name:j.name,value:j.id},null,8,["name","value"]))),128))]),_:1},8,["model-value"])):Wn("v-if",!0)]),pt("span",null,[d.value?pr((gt(),Pt("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:Z},null,512)),[[ut(i),{content:ut(rn)("向下收缩"),distance:20}]]):pr((gt(),Pt("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:ue},null,512)),[[ut(i),{content:ut(rn)("向上扩展"),distance:20}]]),pr(pt("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:ie},null,512),[[ut(i),{content:ut(rn)("清空聊天记录"),distance:20}]]),pr(pt("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:se},null,512),[[ut(i),{content:ut(rn)("关闭"),distance:20}]])])],36),iF(le.$slots,"default",{},void 0),pt("span",{class:"drag-line left",onMousedown:Wr(m,["stop"])},null,32),pt("span",{class:"drag-line right",onMousedown:Wr(g,["stop"])},null,32),pt("span",{class:"drag-line top",onMousedown:Wr(S,["stop"])},null,32),pt("span",{class:"drag-line bottom",onMousedown:Wr(E,["stop"])},null,32),pt("span",{class:"drag-line top-left-corner",onMousedown:Wr(v,["stop"])},null,32),pt("span",{class:"drag-line top-right-corner",onMousedown:Wr(h,["stop"])},null,32),pt("span",{class:"drag-line bottom-left-corner",onMousedown:Wr(N,["stop"])},null,32),pt("span",{class:"drag-line bottom-right-corner",onMousedown:Wr(A,["stop"])},null,32)],4))}}),[["__scopeId","data-v-01d5a54a"]]),yle=(t=>(Sp("data-v-d5e26041"),t=t(),bp(),t))(()=>pt("i",{class:"ai-blueking-icon ai-blueking-ai"},null,-1)),Cle={class:"popup-text"},Ile=oo(nn({__name:"render-popup",emits:["click"],setup(t,{emit:e}){const{isIconVisible:n,iconPosition:r}=FS(),i=e,o=()=>{i("click"),n.value=!1};return(l,s)=>ut(n)?(gt(),Pt("div",{key:0,style:Li(ut(r)),class:"ai-blueking-render-popup",onMousedown:s[0]||(s[0]=Wr(()=>{},["prevent"]))},[pt("div",{class:"popup-content",onClick:o},[yle,pt("span",Cle,ur(ut(rn)("问小鲸")),1)])],36)):Wn("v-if",!0)}}),[["__scopeId","data-v-d5e26041"]]),Nle=nn({__name:"ai-blueking",props:{messages:{},prompts:{},loading:{type:Boolean},headBackground:{},background:{},positionLimit:{},sizeLimit:{},startPosition:{},userPhoto:{},name:{},placeholder:{},logo:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean},alert:{},models:{},model:{},isShow:{type:Boolean}},emits:["clear","close","scroll-load","stop","ai-click","update:model","choose-prompt","send","update:isShow"],setup(t,{expose:e,emit:n}){const r=n,i=mn(),o=E=>{var v;(v=i.value)==null||v.setInputMessage(E)},l=()=>{r("update:isShow",!0)},s=()=>{r("clear")},u=()=>{r("update:isShow",!1),r("close")},d=E=>{r("update:model",E)},p=E=>{r("send",E)},_=()=>{r("stop")},g=()=>{r("scroll-load")},m=E=>{r("ai-click",E)},S=E=>{r("choose-prompt",E)};return e({setInputMessage:o}),(E,v)=>(gt(),Pt(sn,null,[pr(We(Tle,{"head-background":E.headBackground,logo:E.logo,model:E.model,models:E.models,name:E.name,"position-limit":E.positionLimit,"size-limit":E.sizeLimit,"start-position":E.startPosition,onChooseModel:d,onClear:s,onClose:u},{default:ts(()=>[We(vle,{ref_key:"contentRef",ref:i,alert:E.alert,background:E.background,loading:E.loading,messages:E.messages,placeholder:E.placeholder,prompts:E.prompts,"scroll-loading":E.scrollLoading,"scroll-loading-end":E.scrollLoadingEnd,"user-photo":E.userPhoto,onAiClick:m,onChoosePrompt:S,onScrollLoad:g,onSend:p,onStop:_},null,8,["alert","background","loading","messages","placeholder","prompts","scroll-loading","scroll-loading-end","user-photo"])]),_:1},8,["head-background","logo","model","models","name","position-limit","size-limit","start-position"]),[[kp,E.isShow]]),We(Ile,{onClick:l})],64))}});(function(){var t='<svg xmlns="http://www.w3.org/2000/svg" data-name="ai-blueking" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="ai-blueking-check-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-26.3 606.3l-181-181L350 444l135.8 135.8L712 353.5l45.3 45.3-271.6 271.5z"/></symbol><symbol id="ai-blueking-close-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm158.4 561.1l-45.3 45.3L512 557.3 398.9 670.4l-45.3-45.3L466.7 512 353.6 398.9l45.3-45.3L512 466.7l113.1-113.1 45.3 45.3L557.3 512l113.1 113.1z"/></symbol><symbol id="ai-blueking-warning-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 640h-64v-64h64v64zm0-128h-64V320h64v256z"/></symbol><symbol id="ai-blueking-help-document" viewBox="0 0 64 64"><path d="M32 4C16.5 4 4 16.5 4 32c0 3.6.7 7.1 2 10.4V56c0 1.1.9 2 2 2h13.6C36 63.7 52.3 56.8 58 42.4S56.8 11.7 42.4 6C39.1 4.7 35.6 4 32 4zm0 52c-3.3 0-6.6-.7-9.6-2H10V41.6c-5.3-12.2.3-26.3 12.4-31.6s26.3.3 31.6 12.4-.3 26.3-12.4 31.6c-3 1.3-6.3 2-9.6 2z"/><circle cx="31.3" cy="42.1" r="3"/><path d="M32.1 18.9c5 0 8.3 2.8 8.3 6.9 0 2.6-1.3 4.5-3.8 6s-3 2.2-3 3.9v.9H29v-1c-.2-2.8.7-4.4 3.2-5.8 2.3-1.4 3-2.2 3-3.8s-1.3-2.8-3.3-2.8c-1.8-.1-3.3 1.2-3.5 3v.2h-4.8c0-4.4 3.1-7.5 8.5-7.5z"/></g></symbol><symbol id="ai-blueking-angle-up" viewBox="0 0 32 32"><path fill="#63656e" d="M16 11.5l7 7-1.5 1.5-5.5-5.5-5.5 5.5L9 18.5l7-7z"/></symbol><symbol id="ai-blueking-copy" viewBox="0 0 64 64"><path d="M54 8H18c-1.1 0-2 .9-2 2v6h-6c-1.1 0-2 .9-2 2v36c0 1.1.9 2 2 2h36c1.1 0 2-.9 2-2v-6h6c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM44 44v8H12V20h32v24zm8 0h-4V18c0-1.1-.9-2-2-2H20v-4h32v32z"/><path d="M17.2 26.2h21v4h-21zM17 34h21v4H17zM17 42h21v4H17z"/></symbol><symbol id="ai-blueking-cc-jump-link" viewBox="0 0 1024 1024"><path d="M864 128H496v64h291.2L361.6 617.6l44.8 44.8L832 236.8V528h64V160c0-17.6-14.4-32-32-32z"/><path d="M832 704v128H192V192h126.4v-64H160c-17.6 0-32 14.4-32 32v704c0 17.6 14.4 32 32 32h704c17.6 0 32-14.4 32-32V704h-64z"/></symbol><symbol id="ai-blueking-loading-2" viewBox="0 0 1024 1024"><path d="M195.2 195.2a64 64 0 000 90.56l44.8 45.28A64 64 0 00331.04 240l-45.28-44.8a64 64 0 00-90.56 0z" opacity=".1"/><path d="M128 576h64a64 64 0 000-128h-64a64 64 0 000 128z" opacity=".15"/><path d="M285.76 828.8l45.28-44.8A64 64 0 00240 692.96l-44.8 45.28a64 64 0 0090.56 90.56z" opacity=".3"/><path d="M576 896v-64a64 64 0 00-128 0v64a64 64 0 00128 0z" opacity=".45"/><path d="M828.8 828.8a64 64 0 000-90.56L784 692.96A64 64 0 00692.96 784l45.28 45.28a64 64 0 0090.56-.48z" opacity=".6"/><path d="M896 448h-64a64 64 0 000 128h64a64 64 0 000-128z" opacity=".75"/><path d="M738.24 195.2L692.96 240A64 64 0 00784 331.04l45.28-45.28a64 64 0 10-90.56-90.56z" opacity=".9"/><path d="M448 128v64a64 64 0 00128 0v-64a64 64 0 00-128 0z"/></g></symbol><symbol id="ai-blueking-ai" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M928 96v448l-1.211-.014C910.455 758.791 730.989 928 512 928 282.25 928 96 741.75 96 512S282.25 96 512 96h416zM488.911 320H379.544L256 672h84.05l23.292-71.909h137.215L523.342 672h87.088L488.911 320zM736 320h-79.494v352H736V320zm-303.797 66.88l47.594 148.343h-95.696l48.102-148.343z"/></symbol><symbol id="ai-blueking-fasong" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M924.55 113.365c0-.09-.088-.09-.088-.18a30.217 30.217 0 00-7.78-9.684 31.929 31.929 0 00-10.606-5.918c-.089 0-.177-.09-.266-.09-1.502-.537-3.093-.806-4.685-1.075-.442-.09-.884-.27-1.414-.27-1.503-.179-2.917-.179-4.42-.09-.618 0-1.149-.089-1.768 0-4.242.27-8.485 1.525-12.375 3.498L113.792 485.577c-7.514 3.677-13.26 10.312-15.911 18.382-.796 2.242-1.15 4.663-1.415 6.994-.795 4.753-.618 9.685.884 14.347 2.475 8.16 8.044 14.885 15.558 18.741l194.734 103.836c4.685 2.51 9.812 3.766 15.115 3.766 11.757.09 22.541-6.367 28.287-16.768 8.397-15.513 2.475-34.791-13.083-43.13l-142.316-75.86 572.358-288.014L418.93 634.516c-.265.27-.354.628-.619.897-8.662 5.739-14.32 15.423-14.32 26.542v234.123a32.598 32.598 0 009.547 22.686c6.01 6.008 14.143 9.236 22.54 9.146v.09c17.68 0 32-14.257 32-31.832V675.405l381.07-444.127-79.202 585.802-200.921-97.917c-15.823-7.712-34.828-1.255-42.872 14.526-3.712 7.622-4.243 16.41-1.503 24.48s8.575 14.615 16.177 18.202l238.754 116.48c4.42 2.151 9.193 3.227 14.144 3.227.176 0 .353-.09.53-.09.53 0 1.15.18 1.68.18 15.91.09 29.435-11.657 31.733-27.618l99.003-731.782c2.21-7.532 1.767-15.871-2.122-23.403z"/></symbol><symbol id="ai-blueking-shangxialashen-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 64L352 251.52l127.168-.672.928 223.968h.352l.832 298.656-127.168.736L513.792 960 672 772.448l-127.136.704-.928-320h-.384l-.8-202.656 127.168-.704z"/></symbol><symbol id="ai-blueking-shangxiajuhe" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 384L352 192l317.92 1.77L510.24 384zm1.44 256l158.24 192L352 830.23 511.68 640zM128 480h768v64H128z"/></symbol><symbol id="ai-blueking-shanchu-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M832 259.2L764.8 192 512 444.8 259.2 192 192 259.2 444.8 512 192 764.8l67.2 67.2L512 579.2 764.8 832l67.2-67.2L579.2 512z"/></symbol><symbol id="ai-blueking-saoba" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M566.857 64C607.253 64 640 92.654 640 128v96h256c35.346 0 64 28.654 64 64v96c0 35.346-28.654 64-64 64h-5.818v332.453l21.56 102.356c7.284 34.587-14.848 68.532-49.436 75.817a64 64 0 01-13.19 1.374H175.262c-35.346 0-64-28.654-64-64a64 64 0 011.436-13.484l21.12-97.989V448H128c-35.346 0-64-28.654-64-64v-96c0-35.346 28.654-64 64-64h256v-96c0-35.346 32.747-64 73.143-64h109.714zm259.325 384H197.818v343.346l-1.436 6.665L175.262 896H320V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h145.115l-21.559-102.356-1.374-6.524V448zM896 288H128v96h768v-96zM566.857 128H457.143v96h109.714v-96z"/></symbol><symbol id="ai-blueking-quanquan" viewBox="0 0 1024 1024"><path fill="#3A84FF" d="M512 64.129c-9.343-.661-18.345 3.338-27.005 11.998-2.666 2.667-4.831 6.165-6.495 10.495-1.664 4.33-2.496 7.498-2.496 9.503v4c0 10.004 2.997 18.003 8.991 23.997 3.328 4.01 7.327 6.847 11.999 8.511 4.671 1.664 8.34 2.496 11.006 2.496h4c68.003 0 130.993 16.83 188.97 50.49 57.978 33.66 103.807 79.49 137.489 137.488 33.681 57.999 50.511 121.16 50.49 189.483-.021 68.322-16.851 131.313-50.49 188.97-33.64 57.657-79.469 103.316-137.489 136.976-58.02 33.66-121.18 50.49-189.482 50.49-68.301 0-131.292-16.83-188.97-50.49-57.68-33.66-103.338-79.319-136.977-136.976-33.639-57.657-50.469-120.818-50.49-189.482 0-10.005-3.669-18.676-11.007-26.013-2.666-3.328-6.164-5.824-10.494-7.487-4.33-1.664-7.498-2.496-9.503-2.496h-4c-10.004 0-18.334 3.338-24.99 10.015-4.01 4.01-6.846 8.18-8.51 12.51-1.664 4.33-2.496 7.498-2.496 9.503v4c0 60.665 11.828 118.663 35.484 173.996 23.656 55.332 55.482 102.996 95.477 142.991 39.996 39.996 87.66 71.822 142.992 95.478 55.332 23.656 113.33 35.483 173.996 35.483 60.665 0 118.664-11.827 173.996-35.483 55.332-23.656 102.996-55.482 142.992-95.478 39.995-39.995 71.82-87.659 95.477-142.991 23.656-55.333 35.484-113.331 35.484-173.996 0-60.665-11.828-118.664-35.484-173.996-23.656-55.333-55.482-102.997-95.477-142.992-39.996-39.996-87.66-71.821-142.992-95.477C630.664 75.989 572.666 64.16 512 64.16v-.032z"/></symbol><symbol id="ai-blueking-xiangxia-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M176 617.6l92.8-89.6 182.4 179.2V112h121.6v595.2L755.2 528l92.8 89.6L512 944 176 617.6z" clip-rule="evenodd"/></symbol><symbol id="ai-blueking-tingzhi" viewBox="0 0 1024 1024"><path fill="#fdd" d="M256 256h512v512H256V256z"/><path fill="#ea3636" d="M128 128v768h768V128H128zm640 640H256V256h512v512z"/></symbol></svg>';document.body?document.body.insertAdjacentHTML("afterbegin",t):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",t)})})();class Ole{constructor(e,n,r,i,o){zs(this,"controllerMap");zs(this,"handleEnd");zs(this,"handleError");zs(this,"handleReceiveMessage");zs(this,"handleStart");zs(this,"url");this.url=e,this.handleStart=n,this.handleReceiveMessage=r,this.handleEnd=i,this.handleError=o,this.controllerMap={}}stop(e){var n,r;return(r=(n=this.controllerMap[e])==null?void 0:n.abort)==null||r.call(n),this.handleEnd(e)}async stream(e,n,r){const i=new AbortController;this.controllerMap[n]=i,fetch(this.url,{method:"post",signal:i.signal,headers:{"Content-Type":"application/json",...r},mode:"cors",credentials:"include",body:JSON.stringify(e)}).then(async o=>{const l=o.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:s,done:u}=await l.read();if(!o.ok){this.handleError(s||o.statusText,o.status,n);break}if(u){this.handleEnd(n);break}s.toString().split(`
343
- `).forEach(p=>{const _=p.replace("data:","").trim();if(dee(_)){const{event:g,content:m,result:S,code:E,message:v}=JSON.parse(_);if(S===!1||o.status!==200){this.handleError(v,E,n);return}switch(g){case"text":this.handleReceiveMessage(m,n);break;case"done":this.handleEnd(n);break;case"error":this.handleError(v,E,n);break}}})}catch(s){(s==null?void 0:s.code)!==20&&this.handleError(s.message,s.code,n);break}}).catch(o=>{(o==null?void 0:o.code)!==20&&this.handleError(o.message,o.code,n)}),await this.handleStart(n)}}t6({prefix:"ai-blueking"});const Rle={name:"AiBlueking",render(t){return t("div",{style:{width:"100%"}})},props:{messages:{default:()=>[],type:Array},prompts:{default:()=>[],type:Array},loading:{default:!1,type:Boolean},headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)",type:String},background:{default:"#f5f7fa",type:String},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0}),type:Object},sizeLimit:{default:()=>({height:320,width:400}),type:Object},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0}),type:Object},userPhoto:{default:$I,type:String},logo:{default:"ai-blueking-icon ai-blueking-ai",type:String},name:{default:"",type:String},placeholder:{default:"",type:String},scrollLoading:{default:!1,type:Boolean},scrollLoadingEnd:{default:!0,type:Boolean},alert:{default:"",type:String},models:{default:void 0,type:Array},model:{default:"",type:String},isShow:{type:Boolean}},data(){return{app:null,unWatchStack:[]}},watch:{messages:{handler(){setTimeout(()=>{const t=document.querySelector(".ai-blueking-messages");(t==null?void 0:t.scrollTop)+(t==null?void 0:t.clientHeight)+100>=(t==null?void 0:t.scrollHeight)&&(t.scrollTop=t.scrollHeight)},10)},deep:!0}},created(){const t=this.$emit.bind(this);let e=null;const n=this;this.app=Fp({render(){return e=this,Kt(Nle,{messages:JSON.parse(JSON.stringify(n.messages)),prompts:n.prompts,loading:n.loading,headBackground:n.headBackground,background:n.background,positionLimit:n.positionLimit,sizeLimit:n.sizeLimit,userPhoto:n.userPhoto,logo:n.logo,name:n.name,placeholder:n.placeholder,startPosition:n.startPosition,scrollLoading:n.scrollLoading,scrollLoadingEnd:n.scrollLoadingEnd,alert:n.alert,models:n.models,model:n.model,isShow:n.isShow,onClear(){t("clear",...arguments)},onClose(){t("close",...arguments)},onSend(){t("send",...arguments)},onChoosePrompt(){t("choose-prompt",...arguments)},onStop(){t("stop",...arguments)},onScrollLoad(){t("scroll-load",...arguments)},onAiClick(){t("ai-click",...arguments)},"onUpdate:model"(){t("update:model",...arguments)},"onUpdate:isShow"(){t("update:isShow",...arguments)},...n.$attrs})}}),this.unWatchStack=Object.keys(this.$props).map(r=>this.$watch(r,()=>{e.$forceUpdate()},{deep:!0})),this.setInputMessage=r=>{e.setInputMessage(r)}},mounted(){var t;(t=this.app)==null||t.mount(this.$el)},beforeDestroy(){var t;this.unWatchStack.forEach(e=>e==null?void 0:e()),(t=this.app)==null||t.unmount()}};return Yr.ChatHelper=Ole,Yr.MessageStatus=Td,Yr.RoleType=$T,Yr.default=Rle,Object.defineProperties(Yr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Yr}({});
343
+ `).forEach(p=>{const _=p.replace("data:","").trim();if(dee(_)){const{event:g,content:m,result:S,code:E,message:v}=JSON.parse(_);if(S===!1||o.status!==200){this.handleError(v,E,n);return}switch(g){case"text":this.handleReceiveMessage(m,n);break;case"done":this.handleEnd(n);break;case"error":this.handleError(v,E,n);break}}})}catch(s){(s==null?void 0:s.code)!==20&&this.handleError(s.message,s.code,n);break}}).catch(o=>{(o==null?void 0:o.code)!==20&&this.handleError(o.message,o.code,n)}),await this.handleStart(n)}}t6({prefix:"ai-blueking"});const Rle={name:"AiBlueking",render(t){return t("div",{style:{width:"100%"}})},props:{messages:{default:()=>[],type:Array},prompts:{default:()=>[],type:Array},loading:{default:!1,type:Boolean},headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)",type:String},background:{default:"#f5f7fa",type:String},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0}),type:Object},sizeLimit:{default:()=>({height:320,width:400}),type:Object},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0}),type:Object},userPhoto:{default:$I,type:String},logo:{default:"ai-blueking-icon ai-blueking-ai",type:String},name:{default:"",type:String},placeholder:{default:"",type:String},scrollLoading:{default:!1,type:Boolean},scrollLoadingEnd:{default:!0,type:Boolean},alert:{default:"",type:String},models:{default:void 0,type:Array},model:{default:"",type:String},isShow:{type:Boolean}},data(){return{app:null,unWatchStack:[]}},watch:{messages:{handler(){setTimeout(()=>{const t=document.querySelector(".ai-blueking-messages");(t==null?void 0:t.scrollTop)+(t==null?void 0:t.clientHeight)+100>=(t==null?void 0:t.scrollHeight)&&(t.scrollTop=t.scrollHeight)},10)},deep:!0}},created(){const t=this.$emit.bind(this);let e=null;const n=this;this.app=Fp({render(){return e=this,Kt(Nle,{messages:JSON.parse(JSON.stringify(n.messages)),prompts:n.prompts,loading:n.loading,headBackground:n.headBackground,background:n.background,positionLimit:n.positionLimit,sizeLimit:n.sizeLimit,userPhoto:n.userPhoto,logo:n.logo,name:n.name,placeholder:n.placeholder,startPosition:n.startPosition,scrollLoading:n.scrollLoading,scrollLoadingEnd:n.scrollLoadingEnd,alert:n.alert,models:n.models,model:n.model,isShow:n.isShow,onClear(){t("clear",...arguments)},onClose(){t("close",...arguments)},onSend(){t("send",...arguments)},onChoosePrompt(){t("choose-prompt",...arguments)},onStop(){t("stop",...arguments)},onScrollLoad(){t("scroll-load",...arguments)},onAiClick(){t("ai-click",...arguments)},"onUpdate:model"(){t("update:model",...arguments)},"onUpdate:isShow"(){t("update:isShow",...arguments),t("showDialog",...arguments)},...n.$attrs})}}),this.unWatchStack=Object.keys(this.$props).map(r=>this.$watch(r,()=>{e.$forceUpdate()},{deep:!0})),this.setInputMessage=r=>{e.setInputMessage(r)}},mounted(){var t;(t=this.app)==null||t.mount(this.$el)},beforeDestroy(){var t;this.unWatchStack.forEach(e=>e==null?void 0:e()),(t=this.app)==null||t.unmount()}};return Yr.ChatHelper=Ole,Yr.MessageStatus=Td,Yr.RoleType=$T,Yr.default=Rle,Object.defineProperties(Yr,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),Yr}({});
@@ -259,4 +259,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
259
259
  {{ SELECTED_TEXT }}
260
260
  '''
261
261
  `},{label:"解释",prompt:`You are a professional explainer. Please provide a detailed explanation of "{{ SELECTED_TEXT }}". Your explanation should include: 1) basic meaning and conceptual explanation; 2) practical applications or use cases; 3) if it's a technical term, please provide relevant technical background; 4) where appropriate, provide specific examples to aid understanding. Use clear and accessible language to ensure non-experts can understand. If the word/phrase has multiple meanings, please list the main definitions. Keep your response concise and clear while ensuring completeness and accuracy of information.`}],KL=e=>{const t=document.cookie.match(new RegExp(`(^| )${e}=([^;]*)(;|$)`));return t?t[2]:""},XL=e=>{try{return JSON.parse(e),!0}catch{return!1}},qL=(e,t=200)=>{let n=!0;return function(r){if(!n)return!1;n=!1,setTimeout(()=>{e(r),n=!0},t)}},_L=KL("blueking_language")||"zh-cn",eP={小鲸:"BK GPT",向下收缩:"shrink down",向上扩展:"expand upward",清空聊天记录:"Empty chat records",关闭:"close","内容正在执行中,请执行完成后再发送":"The content is being executed, please send it after the execution is completed.",发送:"Send","您可以键入 “/” 查看更多Prompt":'You can type "/" to see more Prompts',请输入:"Please input",返回最新:"Latest",终止生成:"Stop",向上滚动加载更多记录:"Scroll up to load more records",日:" sunday",一:" monday",二:" tuesday",三:" wednesday",四:" thursday",五:" friday",六:" saturday",昨天:"yesterday",本周:"this week",上周:"last week",复制成功:"Copy success",您选择的文本内容:"The text content you selected",问小鲸:"Ask BK GPT",想对选中的文本做什么:"What do you want to do with the selected text?"},tt=e=>_L!=="en"?e:eP[e]||e,tP={class:"ai-cite"},nP={class:"ai-cite-text"},rP={class:"ai-cite-tips"},iP=b.defineComponent({__name:"ai-cite",props:{text:{},showCloseIcon:{type:Boolean}},emits:["close"],setup(e){return(t,n)=>b.withDirectives((b.openBlock(),b.createElementBlock("section",tP,[b.createElementVNode("span",nP,b.toDisplayString(t.text),1),b.createElementVNode("span",rP,b.toDisplayString(b.unref(tt)("您选择的文本内容")),1),t.showCloseIcon?(b.openBlock(),b.createElementBlock("i",{key:0,class:"ai-blueking-icon ai-blueking-close-circle-fill",onClick:n[0]||(n[0]=r=>t.$emit("close"))})):b.createCommentVNode("v-if",!0)],512)),[[b.vShow,t.text]])}}),wn=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Dv=wn(iP,[["__scopeId","data-v-3fd96961"]]),oP=(e=>(b.pushScopeId("data-v-a8d839da"),e=e(),b.popScopeId(),e))(()=>b.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-xiangxia-2"},null,-1)),aP=wn(b.defineComponent({__name:"render-back",setup(e){const{isShow:t,scrollToBottom:n}=Pv();return(r,i)=>b.unref(t)?(b.openBlock(),b.createElementBlock("span",{key:0,class:"ai-blueking-render-back",onClick:i[0]||(i[0]=(...o)=>b.unref(n)&&b.unref(n)(...o))},[oP,b.createTextVNode(" "+b.toDisplayString(b.unref(tt)("返回最新")),1)])):b.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-a8d839da"]]);var ju=(e=>(e.Assistant="assistant",e.Cite="cite",e.System="system",e.User="user",e))(ju||{}),ya=(e=>(e.Error="error",e.Loading="loading",e.Success="success",e))(ya||{});const lP=wn(b.defineComponent({__name:"ai-avatar",props:{size:{default:36}},setup(e){const t=e,n=b.computed(()=>({minWidth:`${t.size}px`,maxWidth:`${t.size}px`,minHeight:`${t.size}px`,maxHeight:`${t.size}px`,padding:`${t.size*.208}px ${t.size*.222}px ${t.size*.194}px ${t.size*.18}px`})),r=b.computed(()=>({fontSize:`${t.size*.611}px`}));return(i,o)=>(b.openBlock(),b.createElementBlock("span",{style:b.normalizeStyle(n.value),class:"message-photo ai"},[b.createElementVNode("i",{style:b.normalizeStyle(r.value),class:"ai-blueking-icon ai-blueking-ai"},null,4)],4))}}),[["__scopeId","data-v-c3781e8b"]]),sP={key:0,class:"ai-cite-container"},cP={class:"message-content-container"},uP={class:"message-content user"},dP={key:0,class:"time-message user"},fP=["innerHTML"],pP={class:"message-photo user"},gP=["src"],bP={class:"message-content ai"},vP={key:0,class:"time-message ai"},mP={key:2,width:"18",height:"18",class:"loading-message","aria-hidden":"true"},yP=[b.createElementVNode("use",{"xlink:href":"#ai-blueking-quanquan"},null,-1)],hP={key:3,class:"message-wrap"},AP=["innerHTML"],wP=b.defineComponent({__name:"render-message",props:{message:{},userPhoto:{default:Bu}},setup(e){const t=new tm({html:!0,highlight:function(l,a){if(a&&Eu.getLanguage(a))try{return Eu.highlight(l,{language:a}).value}catch{}return""}}).use(nm,{iconClass:"ai-blueking-icon ai-blueking-copy",buttonClass:"ai-blueking-copy-button"}),n=e,r=b.computed(()=>{var a;const l={error:"ai-blueking-icon ai-blueking-warning-circle-fill",loading:"",success:""};return(a=n.message)!=null&&a.status?l[n.message.status]:""}),i=b.computed(()=>n.message.content?t.render(n.message.content):""),o=b.computed(()=>{const l=_t(n.message.time),a=_t();return n.message.time?a.isSame(l,"year")?l.format("MM-DD HH:mm:ss"):l.format("YYYY-MM-DD HH:mm:ss"):""});return(l,a)=>(b.openBlock(),b.createElementBlock("li",{class:b.normalizeClass([l.message.role,"message-main"])},[l.message.cite?(b.openBlock(),b.createElementBlock("div",sP,[b.createVNode(Dv,{text:l.message.cite},null,8,["text"])])):b.createCommentVNode("v-if",!0),b.createElementVNode("div",cP,[l.message.role===b.unref(ju).User?(b.openBlock(),b.createElementBlock(b.Fragment,{key:0},[b.createElementVNode("p",uP,[o.value?(b.openBlock(),b.createElementBlock("span",dP,b.toDisplayString(o.value),1)):b.createCommentVNode("v-if",!0),b.createElementVNode("span",{class:"markdown-message",innerHTML:i.value},null,8,fP)]),b.createElementVNode("span",pP,[b.createElementVNode("img",{src:l.userPhoto},null,8,gP)])],64)):(b.openBlock(),b.createElementBlock(b.Fragment,{key:1},[b.createVNode(lP),b.createElementVNode("p",bP,[o.value?(b.openBlock(),b.createElementBlock("span",vP,b.toDisplayString(o.value),1)):b.createCommentVNode("v-if",!0),r.value?(b.openBlock(),b.createElementBlock("i",{key:1,class:b.normalizeClass(r.value)},null,2)):b.createCommentVNode("v-if",!0),l.message.status===b.unref(ya).Loading?(b.openBlock(),b.createElementBlock("svg",mP,yP)):b.createCommentVNode("v-if",!0),l.message.status===b.unref(ya).Error?(b.openBlock(),b.createElementBlock("span",hP,b.toDisplayString(l.message.content),1)):(b.openBlock(),b.createElementBlock("span",{key:4,innerHTML:i.value,class:b.normalizeClass({"markdown-message":!0,loading:l.message.status===b.unref(ya).Loading})},null,10,AP))])],64))])],2))}}),IP={class:"prompt-list"},kP={class:"search-group"},xP=["onClick"],MP={class:"prompt-content"},jP=wn(b.defineComponent({__name:"render-send",props:{prompts:{},placeholder:{},value:{}},emits:["update:value","enter","choose-prompt"],setup(e,{emit:t}){const n=e,r=t,i=Hb,o=fa,{selectedText:l,lockSelectedText:a}=Mu(),s=b.ref(""),c=b.ref(40),u=b.ref(),d=b.ref(!1),v=b.computed(()=>{var $;return(($=n.prompts)==null?void 0:$.filter(re=>re.content.includes(s.value)))||[]}),f=b.computed(()=>{var $;return n.placeholder?n.placeholder:($=n.prompts)!=null&&$.length?tt("您可以键入 “/” 查看更多Prompt"):tt("请输入")}),g=$=>{r("update:value",$)},p=()=>{var $;n.value==="/"&&(($=n.prompts)!=null&&$.length)?B():Y()},k=()=>{b.nextTick(()=>{var re;const $=(re=u.value)==null?void 0:re.$el.querySelector("textarea");($==null?void 0:$.scrollHeight)>40&&n.value?c.value=$.scrollHeight<=300?$.scrollHeight:300:c.value=40})},h=$=>{r("update:value",$.content),r("choose-prompt",$),Y(),E()},z=($,re)=>{re.key==="Enter"&&!re.shiftKey&&(re.preventDefault(),r("enter"))},J=()=>{g("")},E=()=>{var re;const $=(re=u.value)==null?void 0:re.$el.querySelector("textarea");$==null||$.focus()},T=()=>{l.value&&(a.value=!0)},B=()=>{d.value=!0},Y=()=>{d.value=!1};return b.watch(()=>n.value,()=>{k(),p()}),b.onMounted(E),($,re)=>(b.openBlock(),b.createBlock(b.unref(Xc),{width:"calc(100% - 118px)","ext-cls":"empty-padding",arrow:!1,"is-show":d.value,"popover-delay":0,boundary:"parent",placement:"bottom",theme:"light",trigger:"manual"},{content:b.withCtx(()=>{var F;return[b.createElementVNode("div",null,[b.withDirectives((b.openBlock(),b.createElementBlock("section",IP,[b.createVNode(b.unref(fu),{class:"input-search",modelValue:s.value,"onUpdate:modelValue":re[0]||(re[0]=se=>s.value=se),behavior:"simplicity",clearable:""},null,8,["modelValue"]),b.createElementVNode("section",kP,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(v.value,(se,ee)=>b.withDirectives((b.openBlock(),b.createElementBlock("span",{class:"group-prompt",key:ee,onClick:V=>h(se)},[b.createElementVNode("span",MP,b.toDisplayString(se.content),1)],8,xP)),[[b.unref(o),{content:se.content,placement:"right",theme:"light",width:300,boundary:"parent"}]])),128)),(F=v.value)!=null&&F.length?b.createCommentVNode("v-if",!0):(b.openBlock(),b.createBlock(b.unref(q6),{key:0,class:"exception-wrap-item exception-part",scene:"part",type:"search-empty"}))])])),[[b.unref(i),Y]])])]}),default:b.withCtx(()=>[b.createElementVNode("section",{style:b.normalizeStyle({"--text-height":c.value+"px"}),class:"send-prompt-container"},[b.createVNode(b.unref(fu),{ref_key:"inputRef",ref:u,class:"send-prompt",autosize:!1,clearable:!0,"model-value":$.value,"native-attributes":{autofocus:"autofocus"},placeholder:f.value,row:"1",type:"textarea",onFocus:T,onInput:g,onKeydown:z},null,8,["model-value","placeholder"]),$.value?(b.openBlock(),b.createBlock(b.unref(bl),{key:0,class:"show-clear-only-hover bk-input--clear-icon clear-icon",onClick:J})):b.createCommentVNode("v-if",!0)],4)]),_:1},8,["is-show"]))}}),[["__scopeId","data-v-3354f392"]]),CP={class:"ai-shortcuts"},NP=wn(b.defineComponent({__name:"render-shortcuts",props:{shortcuts:{}},emits:["select"],setup(e,{emit:t}){const n=t,r=i=>{n("select",i)};return(i,o)=>(b.openBlock(),b.createElementBlock("ul",CP,[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(i.shortcuts,l=>(b.openBlock(),b.createBlock(b.unref(Cv),{class:"ai-blueking-shortcut",key:l.label,theme:"info",onClick:a=>r(l)},{default:b.withCtx(()=>[b.createTextVNode(b.toDisplayString(l.label),1)]),_:2},1032,["onClick"]))),128))]))}}),[["__scopeId","data-v-266e17ca"]]),SP=(e=>(b.pushScopeId("data-v-fd57f18d"),e=e(),b.popScopeId(),e))(()=>b.createElementVNode("svg",{width:"10",height:"10",class:"ai-blueking-render-stop-icon","aria-hidden":"true"},[b.createElementVNode("use",{"xlink:href":"#ai-blueking-tingzhi"})],-1)),TP=wn(b.defineComponent({__name:"render-stop",props:{isShow:{type:Boolean}},emits:["stop"],setup(e,{emit:t}){const n=t,r=()=>{n("stop")};return(i,o)=>i.isShow?(b.openBlock(),b.createElementBlock("span",{key:0,class:"ai-blueking-render-stop",onClick:r},[SP,b.createTextVNode(" "+b.toDisplayString(b.unref(tt)("终止生成")),1)])):b.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-fd57f18d"]]),OP={key:0,class:"time-wrapper"},LP={class:"time-message"},PP=wn(b.defineComponent({__name:"render-time",props:{message:{}},setup(e){const t=e,n=b.computed(()=>{var l;const r=_t(t.message.time),i=_t(),o={0:tt("日"),1:tt("一"),2:tt("二"),3:tt("三"),4:tt("四"),5:tt("五"),6:tt("六")};return!t.message.time||(l=window.showTimes)!=null&&l.some(a=>Math.abs(r.diff(a,"minute"))<10&&a!==t.message.time)?"":(window.showTimes=[...window.showTimes||[],t.message.time],i.isSame(r,"day")?r.format("HH:mm:ss"):i.subtract(1,"day").isSame(r,"week")?tt("昨天")+" "+r.format("HH:mm:ss"):i.isSame(r,"week")?tt("本周")+o[r.day()]+" "+r.format("HH:mm:ss"):i.subtract(1,"week").isSame(r,"week")?tt("上周")+o[r.day()]+" "+r.format("HH:mm:ss"):i.isSame(r,"year")?r.format("MM-DD HH:mm:ss"):r.format("YYYY-MM-DD HH:mm:ss"))});return(r,i)=>n.value?(b.openBlock(),b.createElementBlock("section",OP,[b.createElementVNode("span",LP,b.toDisplayString(n.value),1)])):b.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-55c9a119"]]),Qv=e=>(b.pushScopeId("data-v-830cceda"),e=e(),b.popScopeId(),e),DP={key:0,width:"18",height:"18",class:"scroll-loading-icon","aria-hidden":"true"},QP=[Qv(()=>b.createElementVNode("use",{"xlink:href":"#ai-blueking-loading-2"},null,-1))],zP={class:"ai-operation"},JP={class:"ai-operation-input-wrapper"},EP={class:"ai-cite-tips"},GP={class:"ai-operation-input"},BP=Qv(()=>b.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-fasong"},null,-1)),ZP=wn(b.defineComponent({__name:"render-content",props:{messages:{},prompts:{},loading:{type:Boolean},background:{default:"#f5f7fa"},userPhoto:{},placeholder:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean,default:!0},alert:{}},emits:["ai-click","send","choose-prompt","scroll-load","stop"],setup(e,{expose:t,emit:n}){const r=e,i=n,o=fa,l=b.ref(""),{selectedText:a,clearSelection:s}=Mu(),{isShow:c}=Pv(),u=UL,d=()=>{b.nextTick(()=>{const T=document.querySelector(".ai-blueking-messages");T.scrollTop=T.scrollHeight})},v=qL(T=>{if(r.scrollLoading||r.scrollLoadingEnd)return;T.target.scrollTop<200&&i("scroll-load")}),f=()=>{if(l.value){if(r.loading){Lv({theme:"warning",message:tt("内容正在执行中,请执行完成后再发送")});return}i("send",{content:l.value,cite:a.value}),l.value="",a.value=""}},g=T=>{i("choose-prompt",T)},p=()=>{i("stop")},k=T=>{const B=T.target;if(B!=null&&B.classList.contains("ai-blueking-angle-up")){const Y=B==null?void 0:B.parentElement;Y!=null&&Y.classList.contains("closed")?Y==null||Y.classList.remove("closed"):Y==null||Y.classList.add("closed")}B!=null&&B.classList.contains("ai-clickable")&&i("ai-click",B.dataset.ai)},h=()=>{d(),document.addEventListener("click",k)},z=()=>{window.showTimes=[],document.removeEventListener("click",k)},J=T=>{l.value=T},E=T=>{const B=T.prompt.replace("{{ SELECTED_TEXT }}",a.value);if(r.loading){Lv({theme:"warning",message:tt("内容正在执行中,请执行完成后再发送")});return}i("send",{content:T.label,cite:a.value,prompt:B}),a.value=""};return b.watch(()=>r.messages,()=>{const T=document.querySelector(".ai-blueking-messages");(T==null?void 0:T.scrollTop)+(T==null?void 0:T.clientHeight)+100>=(T==null?void 0:T.scrollHeight)&&d()},{deep:!0}),b.onMounted(h),b.onBeforeUnmount(z),t({setInputMessage:J}),(T,B)=>(b.openBlock(),b.createElementBlock("section",{style:b.normalizeStyle({background:T.background}),class:"ai-content"},[T.alert?(b.openBlock(),b.createBlock(b.unref(_3),{key:0,title:T.alert,theme:"warning",closable:""},null,8,["title"])):b.createCommentVNode("v-if",!0),b.createElementVNode("ul",{class:"ai-messages ai-blueking-messages",onScrollPassive:B[0]||(B[0]=(...Y)=>b.unref(v)&&b.unref(v)(...Y))},[T.scrollLoading?(b.openBlock(),b.createElementBlock("svg",DP,QP)):b.createCommentVNode("v-if",!0),(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(T.messages,Y=>(b.openBlock(),b.createElementBlock(b.Fragment,{key:Y.content},[b.createVNode(PP,{class:"render-message",message:Y},null,8,["message"]),b.createVNode(wP,{class:"render-message",message:Y,"user-photo":T.userPhoto},null,8,["message","user-photo"])],64))),128))],32),b.createElementVNode("section",zP,[b.createElementVNode("section",{class:"ai-operation-tools",onMousedown:B[1]||(B[1]=b.withModifiers(()=>{},["prevent"]))},[b.createVNode(aP),b.createVNode(TP,{"is-show":T.loading,onStop:p},null,8,["is-show"])],32),b.createElementVNode("section",JP,[b.unref(a)?(b.openBlock(),b.createElementBlock("div",{key:0,class:b.normalizeClass(["ai-cite-container",{"is-back-show":!b.unref(c)}]),onMousedown:B[2]||(B[2]=b.withModifiers(()=>{},["prevent"]))},[b.createVNode(Dv,{"show-close-icon":!0,text:b.unref(a),onClose:b.unref(s)},null,8,["text","onClose"]),b.createElementVNode("span",EP,b.toDisplayString(b.unref(tt)("想对选中的文本做什么")),1),b.createVNode(NP,{shortcuts:b.unref(u),onSelect:E},null,8,["shortcuts"])],34)):b.createCommentVNode("v-if",!0),b.createElementVNode("section",GP,[b.createVNode(jP,{value:l.value,"onUpdate:value":B[3]||(B[3]=Y=>l.value=Y),placeholder:T.placeholder,prompts:T.prompts,onChoosePrompt:g,onEnter:f},null,8,["value","placeholder","prompts"]),b.withDirectives((b.openBlock(),b.createBlock(b.unref(k5),{class:"ai-operation-button",disabled:T.loading||!l.value,size:"large",theme:"primary",onClick:f},{default:b.withCtx(()=>[BP,b.createTextVNode(" "+b.toDisplayString(b.unref(tt)("发送")),1)]),_:1},8,["disabled"])),[[b.unref(o),{content:b.unref(tt)("内容正在执行中,请执行完成后再发送"),disabled:!T.loading}]])])])])],4))}}),[["__scopeId","data-v-830cceda"]]),HP={class:"ai-modal-header-icon"},VP=wn(b.defineComponent({__name:"render-modal",props:{headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)"},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0})},sizeLimit:{default:()=>({height:320,width:400})},logo:{default:"ai-blueking-icon ai-blueking-ai"},name:{},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0})},models:{},model:{}},emits:["clear","close","choose-model"],setup(e,{emit:t}){const n=e,r=t,i=fa,o={height:window.innerHeight,width:window.innerWidth},l={isMove:!1,type:"",clientX:0,clientY:0},a=()=>{var U,G,Z,H;const V=(te,ve)=>te===void 0?ve:te;return{top:V((U=n.startPosition)==null?void 0:U.top,o.height-n.sizeLimit.height),bottom:V((G=n.startPosition)==null?void 0:G.bottom,0),left:V((Z=n.startPosition)==null?void 0:Z.left,0),right:V((H=n.startPosition)==null?void 0:H.right,o.width-n.sizeLimit.width)}},s=b.ref(a()),c=b.computed(()=>s.value.top<=n.positionLimit.top&&s.value.bottom<=n.positionLimit.bottom),u=V=>{r("choose-model",V)},d=V=>{l.isMove=!0,l.type="move",l.clientX=V.clientX,l.clientY=V.clientY},v=V=>{l.isMove=!0,l.type="rightDrag",l.clientX=V.clientX},f=V=>{l.isMove=!0,l.type="leftDrag",l.clientX=V.clientX},g=V=>{l.isMove=!0,l.type="topDrag",l.clientY=V.clientY},p=V=>{l.isMove=!0,l.type="bottomDrag",l.clientY=V.clientY},k=V=>{l.isMove=!0,l.type="topLeftDrag",l.clientY=V.clientY,l.clientX=V.clientX},h=V=>{l.isMove=!0,l.type="topRightDrag",l.clientY=V.clientY,l.clientX=V.clientX},z=V=>{l.isMove=!0,l.type="bottomLeftDrag",l.clientY=V.clientY,l.clientX=V.clientX},J=V=>{l.isMove=!0,l.type="bottomRightDrag",l.clientY=V.clientY,l.clientX=V.clientX},E=()=>{l.isMove=!1},T=(V,U)=>{["move","leftDrag"].includes(l.type)&&(s.value.left+=V),["move","rightDrag"].includes(l.type)&&(s.value.right-=V),["move","topDrag"].includes(l.type)&&(s.value.top+=U),["move","bottomDrag"].includes(l.type)&&(s.value.bottom-=U),["topLeftDrag"].includes(l.type)&&(s.value.left+=V,s.value.top+=U),["topRightDrag"].includes(l.type)&&(s.value.right-=V,s.value.top+=U),["bottomLeftDrag"].includes(l.type)&&(s.value.left+=V,s.value.bottom-=U),["bottomRightDrag"].includes(l.type)&&(s.value.right-=V,s.value.bottom-=U)},B=(V,U)=>{const{top:G,bottom:Z,left:H,right:te}=s.value;(o.width-H-te<n.sizeLimit.width||H<n.positionLimit.left||te<n.positionLimit.right)&&(["move","leftDrag","topLeftDrag","bottomLeftDrag"].includes(l.type)&&(s.value.left-=V),["move","rightDrag","topRightDrag","bottomRightDrag"].includes(l.type)&&(s.value.right+=V)),(o.height-G-Z<n.sizeLimit.height||G<n.positionLimit.top||Z<n.positionLimit.bottom)&&(["move","topDrag","topRightDrag","topLeftDrag"].includes(l.type)&&(s.value.top-=U),["move","bottomDrag","bottomLeftDrag","bottomRightDrag"].includes(l.type)&&(s.value.bottom+=U))},Y=V=>{if(!l.isMove)return;V.preventDefault();const U=V.clientX-l.clientX,G=V.clientY-l.clientY;T(U,G),B(U,G),l.clientX=V.clientX,l.clientY=V.clientY},$=()=>{o.height=window.innerHeight,o.width=window.innerWidth,s.value=a()},re=()=>{s.value.top=n.positionLimit.top,s.value.bottom=n.positionLimit.bottom},F=()=>{s.value.top=o.height-n.sizeLimit.height,s.value.bottom=n.positionLimit.bottom},se=()=>{r("clear")},ee=()=>{r("close")};return b.onBeforeMount(()=>{window.addEventListener("mousemove",Y,!0),window.addEventListener("mouseup",E),window.addEventListener("resize",$)}),b.onBeforeUnmount(()=>{window.removeEventListener("mousemove",Y,!0),window.removeEventListener("mouseup",E),window.removeEventListener("resize",$)}),(V,U)=>(b.openBlock(),b.createElementBlock("section",{style:b.normalizeStyle({top:s.value.top+"px",bottom:s.value.bottom+"px",left:s.value.left+"px",right:s.value.right+"px"}),class:"ai-modal"},[b.createElementVNode("header",{style:b.normalizeStyle({background:V.headBackground}),class:"ai-modal-header",onMousedown:b.withModifiers(d,["stop"])},[b.createElementVNode("span",HP,[b.createElementVNode("i",{class:b.normalizeClass(V.logo)},null,2),b.createTextVNode(" "+b.toDisplayString(V.name||b.unref(tt)("小鲸"))+" ",1),V.models?(b.openBlock(),b.createBlock(b.unref(Sv),{key:0,class:"ai-modal-header-models","model-value":V.model,size:"small",onChange:u},{default:b.withCtx(()=>[(b.openBlock(!0),b.createElementBlock(b.Fragment,null,b.renderList(V.models,G=>(b.openBlock(),b.createBlock(b.unref(Sv).Option,{key:G.id,name:G.name,value:G.id},null,8,["name","value"]))),128))]),_:1},8,["model-value"])):b.createCommentVNode("v-if",!0)]),b.createElementVNode("span",null,[c.value?b.withDirectives((b.openBlock(),b.createElementBlock("i",{key:0,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxiajuhe",onClick:F},null,512)),[[b.unref(i),{content:b.unref(tt)("向下收缩"),distance:20}]]):b.withDirectives((b.openBlock(),b.createElementBlock("i",{key:1,class:"ai-header-tool ai-blueking-icon ai-blueking-shangxialashen-2",onClick:re},null,512)),[[b.unref(i),{content:b.unref(tt)("向上扩展"),distance:20}]]),b.withDirectives(b.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-saoba",onClick:se},null,512),[[b.unref(i),{content:b.unref(tt)("清空聊天记录"),distance:20}]]),b.withDirectives(b.createElementVNode("i",{class:"ai-header-tool ai-blueking-icon ai-blueking-shanchu-2",onClick:ee},null,512),[[b.unref(i),{content:b.unref(tt)("关闭"),distance:20}]])])],36),b.renderSlot(V.$slots,"default",{},void 0,!0),b.createElementVNode("span",{class:"drag-line left",onMousedown:b.withModifiers(f,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line right",onMousedown:b.withModifiers(v,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line top",onMousedown:b.withModifiers(g,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line bottom",onMousedown:b.withModifiers(p,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line top-left-corner",onMousedown:b.withModifiers(k,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line top-right-corner",onMousedown:b.withModifiers(h,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line bottom-left-corner",onMousedown:b.withModifiers(z,["stop"])},null,32),b.createElementVNode("span",{class:"drag-line bottom-right-corner",onMousedown:b.withModifiers(J,["stop"])},null,32)],4))}}),[["__scopeId","data-v-01d5a54a"]]),RP=(e=>(b.pushScopeId("data-v-d5e26041"),e=e(),b.popScopeId(),e))(()=>b.createElementVNode("i",{class:"ai-blueking-icon ai-blueking-ai"},null,-1)),YP={class:"popup-text"},$P=wn(b.defineComponent({__name:"render-popup",emits:["click"],setup(e,{emit:t}){const{isIconVisible:n,iconPosition:r}=Mu(),i=t,o=()=>{i("click"),n.value=!1};return(l,a)=>b.unref(n)?(b.openBlock(),b.createElementBlock("div",{key:0,style:b.normalizeStyle(b.unref(r)),class:"ai-blueking-render-popup",onMousedown:a[0]||(a[0]=b.withModifiers(()=>{},["prevent"]))},[b.createElementVNode("div",{class:"popup-content",onClick:o},[RP,b.createElementVNode("span",YP,b.toDisplayString(b.unref(tt)("问小鲸")),1)])],36)):b.createCommentVNode("v-if",!0)}}),[["__scopeId","data-v-d5e26041"]]),FP=b.defineComponent({__name:"ai-blueking",props:{messages:{},prompts:{},loading:{type:Boolean},headBackground:{},background:{},positionLimit:{},sizeLimit:{},startPosition:{},userPhoto:{},name:{},placeholder:{},logo:{},scrollLoading:{type:Boolean},scrollLoadingEnd:{type:Boolean},alert:{},models:{},model:{},isShow:{type:Boolean}},emits:["clear","close","scroll-load","stop","ai-click","update:model","choose-prompt","send","update:isShow"],setup(e,{expose:t,emit:n}){const r=n,i=b.ref(),o=p=>{var k;(k=i.value)==null||k.setInputMessage(p)},l=()=>{r("update:isShow",!0)},a=()=>{r("clear")},s=()=>{r("update:isShow",!1),r("close")},c=p=>{r("update:model",p)},u=p=>{r("send",p)},d=()=>{r("stop")},v=()=>{r("scroll-load")},f=p=>{r("ai-click",p)},g=p=>{r("choose-prompt",p)};return t({setInputMessage:o}),(p,k)=>(b.openBlock(),b.createElementBlock(b.Fragment,null,[b.withDirectives(b.createVNode(VP,{"head-background":p.headBackground,logo:p.logo,model:p.model,models:p.models,name:p.name,"position-limit":p.positionLimit,"size-limit":p.sizeLimit,"start-position":p.startPosition,onChooseModel:c,onClear:a,onClose:s},{default:b.withCtx(()=>[b.createVNode(ZP,{ref_key:"contentRef",ref:i,alert:p.alert,background:p.background,loading:p.loading,messages:p.messages,placeholder:p.placeholder,prompts:p.prompts,"scroll-loading":p.scrollLoading,"scroll-loading-end":p.scrollLoadingEnd,"user-photo":p.userPhoto,onAiClick:f,onChoosePrompt:g,onScrollLoad:v,onSend:u,onStop:d},null,8,["alert","background","loading","messages","placeholder","prompts","scroll-loading","scroll-loading-end","user-photo"])]),_:1},8,["head-background","logo","model","models","name","position-limit","size-limit","start-position"]),[[b.vShow,p.isShow]]),b.createVNode($P,{onClick:l})],64))}});(function(){var e='<svg xmlns="http://www.w3.org/2000/svg" data-name="ai-blueking" xmlns:xlink="http://www.w3.org/1999/xlink" style="position:absolute;width:0;height:0;visibility:hidden"><symbol id="ai-blueking-check-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm-26.3 606.3l-181-181L350 444l135.8 135.8L712 353.5l45.3 45.3-271.6 271.5z"/></symbol><symbol id="ai-blueking-close-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm158.4 561.1l-45.3 45.3L512 557.3 398.9 670.4l-45.3-45.3L466.7 512 353.6 398.9l45.3-45.3L512 466.7l113.1-113.1 45.3 45.3L557.3 512l113.1 113.1z"/></symbol><symbol id="ai-blueking-warning-circle-fill" viewBox="0 0 1024 1024"><path fill="#737987" d="M512 64C264.6 64 64 264.6 64 512s200.6 448 448 448 448-200.6 448-448S759.4 64 512 64zm32 640h-64v-64h64v64zm0-128h-64V320h64v256z"/></symbol><symbol id="ai-blueking-help-document" viewBox="0 0 64 64"><path d="M32 4C16.5 4 4 16.5 4 32c0 3.6.7 7.1 2 10.4V56c0 1.1.9 2 2 2h13.6C36 63.7 52.3 56.8 58 42.4S56.8 11.7 42.4 6C39.1 4.7 35.6 4 32 4zm0 52c-3.3 0-6.6-.7-9.6-2H10V41.6c-5.3-12.2.3-26.3 12.4-31.6s26.3.3 31.6 12.4-.3 26.3-12.4 31.6c-3 1.3-6.3 2-9.6 2z"/><circle cx="31.3" cy="42.1" r="3"/><path d="M32.1 18.9c5 0 8.3 2.8 8.3 6.9 0 2.6-1.3 4.5-3.8 6s-3 2.2-3 3.9v.9H29v-1c-.2-2.8.7-4.4 3.2-5.8 2.3-1.4 3-2.2 3-3.8s-1.3-2.8-3.3-2.8c-1.8-.1-3.3 1.2-3.5 3v.2h-4.8c0-4.4 3.1-7.5 8.5-7.5z"/></g></symbol><symbol id="ai-blueking-angle-up" viewBox="0 0 32 32"><path fill="#63656e" d="M16 11.5l7 7-1.5 1.5-5.5-5.5-5.5 5.5L9 18.5l7-7z"/></symbol><symbol id="ai-blueking-copy" viewBox="0 0 64 64"><path d="M54 8H18c-1.1 0-2 .9-2 2v6h-6c-1.1 0-2 .9-2 2v36c0 1.1.9 2 2 2h36c1.1 0 2-.9 2-2v-6h6c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM44 44v8H12V20h32v24zm8 0h-4V18c0-1.1-.9-2-2-2H20v-4h32v32z"/><path d="M17.2 26.2h21v4h-21zM17 34h21v4H17zM17 42h21v4H17z"/></symbol><symbol id="ai-blueking-cc-jump-link" viewBox="0 0 1024 1024"><path d="M864 128H496v64h291.2L361.6 617.6l44.8 44.8L832 236.8V528h64V160c0-17.6-14.4-32-32-32z"/><path d="M832 704v128H192V192h126.4v-64H160c-17.6 0-32 14.4-32 32v704c0 17.6 14.4 32 32 32h704c17.6 0 32-14.4 32-32V704h-64z"/></symbol><symbol id="ai-blueking-loading-2" viewBox="0 0 1024 1024"><path d="M195.2 195.2a64 64 0 000 90.56l44.8 45.28A64 64 0 00331.04 240l-45.28-44.8a64 64 0 00-90.56 0z" opacity=".1"/><path d="M128 576h64a64 64 0 000-128h-64a64 64 0 000 128z" opacity=".15"/><path d="M285.76 828.8l45.28-44.8A64 64 0 00240 692.96l-44.8 45.28a64 64 0 0090.56 90.56z" opacity=".3"/><path d="M576 896v-64a64 64 0 00-128 0v64a64 64 0 00128 0z" opacity=".45"/><path d="M828.8 828.8a64 64 0 000-90.56L784 692.96A64 64 0 00692.96 784l45.28 45.28a64 64 0 0090.56-.48z" opacity=".6"/><path d="M896 448h-64a64 64 0 000 128h64a64 64 0 000-128z" opacity=".75"/><path d="M738.24 195.2L692.96 240A64 64 0 00784 331.04l45.28-45.28a64 64 0 10-90.56-90.56z" opacity=".9"/><path d="M448 128v64a64 64 0 00128 0v-64a64 64 0 00-128 0z"/></g></symbol><symbol id="ai-blueking-ai" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M928 96v448l-1.211-.014C910.455 758.791 730.989 928 512 928 282.25 928 96 741.75 96 512S282.25 96 512 96h416zM488.911 320H379.544L256 672h84.05l23.292-71.909h137.215L523.342 672h87.088L488.911 320zM736 320h-79.494v352H736V320zm-303.797 66.88l47.594 148.343h-95.696l48.102-148.343z"/></symbol><symbol id="ai-blueking-fasong" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M924.55 113.365c0-.09-.088-.09-.088-.18a30.217 30.217 0 00-7.78-9.684 31.929 31.929 0 00-10.606-5.918c-.089 0-.177-.09-.266-.09-1.502-.537-3.093-.806-4.685-1.075-.442-.09-.884-.27-1.414-.27-1.503-.179-2.917-.179-4.42-.09-.618 0-1.149-.089-1.768 0-4.242.27-8.485 1.525-12.375 3.498L113.792 485.577c-7.514 3.677-13.26 10.312-15.911 18.382-.796 2.242-1.15 4.663-1.415 6.994-.795 4.753-.618 9.685.884 14.347 2.475 8.16 8.044 14.885 15.558 18.741l194.734 103.836c4.685 2.51 9.812 3.766 15.115 3.766 11.757.09 22.541-6.367 28.287-16.768 8.397-15.513 2.475-34.791-13.083-43.13l-142.316-75.86 572.358-288.014L418.93 634.516c-.265.27-.354.628-.619.897-8.662 5.739-14.32 15.423-14.32 26.542v234.123a32.598 32.598 0 009.547 22.686c6.01 6.008 14.143 9.236 22.54 9.146v.09c17.68 0 32-14.257 32-31.832V675.405l381.07-444.127-79.202 585.802-200.921-97.917c-15.823-7.712-34.828-1.255-42.872 14.526-3.712 7.622-4.243 16.41-1.503 24.48s8.575 14.615 16.177 18.202l238.754 116.48c4.42 2.151 9.193 3.227 14.144 3.227.176 0 .353-.09.53-.09.53 0 1.15.18 1.68.18 15.91.09 29.435-11.657 31.733-27.618l99.003-731.782c2.21-7.532 1.767-15.871-2.122-23.403z"/></symbol><symbol id="ai-blueking-shangxialashen-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 64L352 251.52l127.168-.672.928 223.968h.352l.832 298.656-127.168.736L513.792 960 672 772.448l-127.136.704-.928-320h-.384l-.8-202.656 127.168-.704z"/></symbol><symbol id="ai-blueking-shangxiajuhe" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M510.24 384L352 192l317.92 1.77L510.24 384zm1.44 256l158.24 192L352 830.23 511.68 640zM128 480h768v64H128z"/></symbol><symbol id="ai-blueking-shanchu-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M832 259.2L764.8 192 512 444.8 259.2 192 192 259.2 444.8 512 192 764.8l67.2 67.2L512 579.2 764.8 832l67.2-67.2L579.2 512z"/></symbol><symbol id="ai-blueking-saoba" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M566.857 64C607.253 64 640 92.654 640 128v96h256c35.346 0 64 28.654 64 64v96c0 35.346-28.654 64-64 64h-5.818v332.453l21.56 102.356c7.284 34.587-14.848 68.532-49.436 75.817a64 64 0 01-13.19 1.374H175.262c-35.346 0-64-28.654-64-64a64 64 0 011.436-13.484l21.12-97.989V448H128c-35.346 0-64-28.654-64-64v-96c0-35.346 28.654-64 64-64h256v-96c0-35.346 32.747-64 73.143-64h109.714zm259.325 384H197.818v343.346l-1.436 6.665L175.262 896H320V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h96V704c0-17.673 14.327-32 32-32 17.673 0 32 14.327 32 32v192h145.115l-21.559-102.356-1.374-6.524V448zM896 288H128v96h768v-96zM566.857 128H457.143v96h109.714v-96z"/></symbol><symbol id="ai-blueking-quanquan" viewBox="0 0 1024 1024"><path fill="#3A84FF" d="M512 64.129c-9.343-.661-18.345 3.338-27.005 11.998-2.666 2.667-4.831 6.165-6.495 10.495-1.664 4.33-2.496 7.498-2.496 9.503v4c0 10.004 2.997 18.003 8.991 23.997 3.328 4.01 7.327 6.847 11.999 8.511 4.671 1.664 8.34 2.496 11.006 2.496h4c68.003 0 130.993 16.83 188.97 50.49 57.978 33.66 103.807 79.49 137.489 137.488 33.681 57.999 50.511 121.16 50.49 189.483-.021 68.322-16.851 131.313-50.49 188.97-33.64 57.657-79.469 103.316-137.489 136.976-58.02 33.66-121.18 50.49-189.482 50.49-68.301 0-131.292-16.83-188.97-50.49-57.68-33.66-103.338-79.319-136.977-136.976-33.639-57.657-50.469-120.818-50.49-189.482 0-10.005-3.669-18.676-11.007-26.013-2.666-3.328-6.164-5.824-10.494-7.487-4.33-1.664-7.498-2.496-9.503-2.496h-4c-10.004 0-18.334 3.338-24.99 10.015-4.01 4.01-6.846 8.18-8.51 12.51-1.664 4.33-2.496 7.498-2.496 9.503v4c0 60.665 11.828 118.663 35.484 173.996 23.656 55.332 55.482 102.996 95.477 142.991 39.996 39.996 87.66 71.822 142.992 95.478 55.332 23.656 113.33 35.483 173.996 35.483 60.665 0 118.664-11.827 173.996-35.483 55.332-23.656 102.996-55.482 142.992-95.478 39.995-39.995 71.82-87.659 95.477-142.991 23.656-55.333 35.484-113.331 35.484-173.996 0-60.665-11.828-118.664-35.484-173.996-23.656-55.333-55.482-102.997-95.477-142.992-39.996-39.996-87.66-71.821-142.992-95.477C630.664 75.989 572.666 64.16 512 64.16v-.032z"/></symbol><symbol id="ai-blueking-xiangxia-2" viewBox="0 0 1024 1024"><path fill-rule="evenodd" d="M176 617.6l92.8-89.6 182.4 179.2V112h121.6v595.2L755.2 528l92.8 89.6L512 944 176 617.6z" clip-rule="evenodd"/></symbol><symbol id="ai-blueking-tingzhi" viewBox="0 0 1024 1024"><path fill="#fdd" d="M256 256h512v512H256V256z"/><path fill="#ea3636" d="M128 128v768h768V128H128zm640 640H256V256h512v512z"/></symbol></svg>';document.body?document.body.insertAdjacentHTML("afterbegin",e):document.addEventListener("DOMContentLoaded",function(){document.body.insertAdjacentHTML("afterbegin",e)})})();class WP{constructor(t,n,r,i,o){Pr(this,"controllerMap");Pr(this,"handleEnd");Pr(this,"handleError");Pr(this,"handleReceiveMessage");Pr(this,"handleStart");Pr(this,"url");this.url=t,this.handleStart=n,this.handleReceiveMessage=r,this.handleEnd=i,this.handleError=o,this.controllerMap={}}stop(t){var n,r;return(r=(n=this.controllerMap[t])==null?void 0:n.abort)==null||r.call(n),this.handleEnd(t)}async stream(t,n,r){const i=new AbortController;this.controllerMap[n]=i,fetch(this.url,{method:"post",signal:i.signal,headers:{"Content-Type":"application/json",...r},mode:"cors",credentials:"include",body:JSON.stringify(t)}).then(async o=>{const l=o.body.pipeThrough(new window.TextDecoderStream).getReader();for(;;)try{const{value:a,done:s}=await l.read();if(!o.ok){this.handleError(a||o.statusText,o.status,n);break}if(s){this.handleEnd(n);break}a.toString().split(`
262
- `).forEach(u=>{const d=u.replace("data:","").trim();if(XL(d)){const{event:v,content:f,result:g,code:p,message:k}=JSON.parse(d);if(g===!1||o.status!==200){this.handleError(k,p,n);return}switch(v){case"text":this.handleReceiveMessage(f,n);break;case"done":this.handleEnd(n);break;case"error":this.handleError(k,p,n);break}}})}catch(a){(a==null?void 0:a.code)!==20&&this.handleError(a.message,a.code,n);break}}).catch(o=>{(o==null?void 0:o.code)!==20&&this.handleError(o.message,o.code,n)}),await this.handleStart(n)}}ZM({prefix:"ai-blueking"});const UP={name:"AiBlueking",render(e){return e("div",{style:{width:"100%"}})},props:{messages:{default:()=>[],type:Array},prompts:{default:()=>[],type:Array},loading:{default:!1,type:Boolean},headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)",type:String},background:{default:"#f5f7fa",type:String},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0}),type:Object},sizeLimit:{default:()=>({height:320,width:400}),type:Object},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0}),type:Object},userPhoto:{default:Bu,type:String},logo:{default:"ai-blueking-icon ai-blueking-ai",type:String},name:{default:"",type:String},placeholder:{default:"",type:String},scrollLoading:{default:!1,type:Boolean},scrollLoadingEnd:{default:!0,type:Boolean},alert:{default:"",type:String},models:{default:void 0,type:Array},model:{default:"",type:String},isShow:{type:Boolean}},data(){return{app:null,unWatchStack:[]}},watch:{messages:{handler(){setTimeout(()=>{const e=document.querySelector(".ai-blueking-messages");(e==null?void 0:e.scrollTop)+(e==null?void 0:e.clientHeight)+100>=(e==null?void 0:e.scrollHeight)&&(e.scrollTop=e.scrollHeight)},10)},deep:!0}},created(){const e=this.$emit.bind(this);let t=null;const n=this;this.app=b.createApp({render(){return t=this,b.h(FP,{messages:JSON.parse(JSON.stringify(n.messages)),prompts:n.prompts,loading:n.loading,headBackground:n.headBackground,background:n.background,positionLimit:n.positionLimit,sizeLimit:n.sizeLimit,userPhoto:n.userPhoto,logo:n.logo,name:n.name,placeholder:n.placeholder,startPosition:n.startPosition,scrollLoading:n.scrollLoading,scrollLoadingEnd:n.scrollLoadingEnd,alert:n.alert,models:n.models,model:n.model,isShow:n.isShow,onClear(){e("clear",...arguments)},onClose(){e("close",...arguments)},onSend(){e("send",...arguments)},onChoosePrompt(){e("choose-prompt",...arguments)},onStop(){e("stop",...arguments)},onScrollLoad(){e("scroll-load",...arguments)},onAiClick(){e("ai-click",...arguments)},"onUpdate:model"(){e("update:model",...arguments)},"onUpdate:isShow"(){e("update:isShow",...arguments)},...n.$attrs})}}),this.unWatchStack=Object.keys(this.$props).map(r=>this.$watch(r,()=>{t.$forceUpdate()},{deep:!0})),this.setInputMessage=r=>{t.setInputMessage(r)}},mounted(){var e;(e=this.app)==null||e.mount(this.$el)},beforeDestroy(){var e;this.unWatchStack.forEach(t=>t==null?void 0:t()),(e=this.app)==null||e.unmount()}};lt.ChatHelper=WP,lt.MessageStatus=ya,lt.RoleType=ju,lt.default=UP,Object.defineProperties(lt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
262
+ `).forEach(u=>{const d=u.replace("data:","").trim();if(XL(d)){const{event:v,content:f,result:g,code:p,message:k}=JSON.parse(d);if(g===!1||o.status!==200){this.handleError(k,p,n);return}switch(v){case"text":this.handleReceiveMessage(f,n);break;case"done":this.handleEnd(n);break;case"error":this.handleError(k,p,n);break}}})}catch(a){(a==null?void 0:a.code)!==20&&this.handleError(a.message,a.code,n);break}}).catch(o=>{(o==null?void 0:o.code)!==20&&this.handleError(o.message,o.code,n)}),await this.handleStart(n)}}ZM({prefix:"ai-blueking"});const UP={name:"AiBlueking",render(e){return e("div",{style:{width:"100%"}})},props:{messages:{default:()=>[],type:Array},prompts:{default:()=>[],type:Array},loading:{default:!1,type:Boolean},headBackground:{default:"linear-gradient(267deg, #2dd1f4 0%, #1482ff 95%)",type:String},background:{default:"#f5f7fa",type:String},positionLimit:{default:()=>({top:0,bottom:0,left:0,right:0}),type:Object},sizeLimit:{default:()=>({height:320,width:400}),type:Object},startPosition:{default:()=>({top:window.innerHeight-560,bottom:0,left:window.innerWidth-400,right:0}),type:Object},userPhoto:{default:Bu,type:String},logo:{default:"ai-blueking-icon ai-blueking-ai",type:String},name:{default:"",type:String},placeholder:{default:"",type:String},scrollLoading:{default:!1,type:Boolean},scrollLoadingEnd:{default:!0,type:Boolean},alert:{default:"",type:String},models:{default:void 0,type:Array},model:{default:"",type:String},isShow:{type:Boolean}},data(){return{app:null,unWatchStack:[]}},watch:{messages:{handler(){setTimeout(()=>{const e=document.querySelector(".ai-blueking-messages");(e==null?void 0:e.scrollTop)+(e==null?void 0:e.clientHeight)+100>=(e==null?void 0:e.scrollHeight)&&(e.scrollTop=e.scrollHeight)},10)},deep:!0}},created(){const e=this.$emit.bind(this);let t=null;const n=this;this.app=b.createApp({render(){return t=this,b.h(FP,{messages:JSON.parse(JSON.stringify(n.messages)),prompts:n.prompts,loading:n.loading,headBackground:n.headBackground,background:n.background,positionLimit:n.positionLimit,sizeLimit:n.sizeLimit,userPhoto:n.userPhoto,logo:n.logo,name:n.name,placeholder:n.placeholder,startPosition:n.startPosition,scrollLoading:n.scrollLoading,scrollLoadingEnd:n.scrollLoadingEnd,alert:n.alert,models:n.models,model:n.model,isShow:n.isShow,onClear(){e("clear",...arguments)},onClose(){e("close",...arguments)},onSend(){e("send",...arguments)},onChoosePrompt(){e("choose-prompt",...arguments)},onStop(){e("stop",...arguments)},onScrollLoad(){e("scroll-load",...arguments)},onAiClick(){e("ai-click",...arguments)},"onUpdate:model"(){e("update:model",...arguments)},"onUpdate:isShow"(){e("update:isShow",...arguments),e("showDialog",...arguments)},...n.$attrs})}}),this.unWatchStack=Object.keys(this.$props).map(r=>this.$watch(r,()=>{t.$forceUpdate()},{deep:!0})),this.setInputMessage=r=>{t.setInputMessage(r)}},mounted(){var e;(e=this.app)==null||e.mount(this.$el)},beforeDestroy(){var e;this.unWatchStack.forEach(t=>t==null?void 0:t()),(e=this.app)==null||e.unmount()}};lt.ChatHelper=WP,lt.MessageStatus=ya,lt.RoleType=ju,lt.default=UP,Object.defineProperties(lt,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blueking/ai-blueking",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "AI 小鲸",
5
5
  "license": "MIT",
6
6
  "author": "Tencent BlueKing",