PageSourceSearch

https://niceai.ai/assets/index-742c243f.js

js niceai.ai collected 2026-10-05 13:09:35 UTC 28,332 bytes, 1 lines download raw bytes

1import{m as e,u as t,ac as a,r as n,x as o,y as l,o as i,ap as s,a as r,s as u,H as c,bJ as d,b as p,c as m,e as v,A as f,as as h,B as g,d as y,F as w,j as b,k as x,t as C,aM as k,g as A,aq as S,_ as I,ab as j,n as B,aa as T,G as L,w as U,ad as D,ae as R,a2 as F,l as E,f as O,ag as N,v as _,ah as M,am as V,ai as P,aj as H,ak as Z,al as W,aL as J,aC as Y,p as q,aD as G,q as z,aF as Q,aK as X,cD as K}from"./index-6328e560.js";import{u as $,i as ee}from"./higherOrderFunction-b982c070.js";import{f as te}from"./liteApps-919c82c9.js";import{G as ae,i as ne}from"./streamChat-985a3f85.js";import{u as oe}from"./useImageDownloader-e330c60a.js";import{w as le}from"./withholdingPoints-175d4abc.js";import{F as ie}from"./FeedbackModal-97ab56ba.js";import{P as se}from"./PointsDisplay-a17d0ea8.js";import{_ as re}from"./ai_dislike-496b61a5.js";import{M as ue,H as ce}from"./index-22c8c39f.js";import{m as de}from"./index-64c1ba77.js";import{t as pe,k as me}from"./texmath-39b8c9e7.js";import{g as ve,a as fe}from"./fileSizeFormat-c0ed93fe.js";import{F as he}from"./FileInfoCard-7f5e3beb.js";import{p as ge}from"./purify.es-e47c1681.js";import{u as ye}from"./useIconRender-686992cb.js";import{a as we,_ as be}from"./aiGpt.vue_vue_type_script_setup_true_lang-e5ee28a0.js";import{_ as xe}from"./right_arror-cdfff59a.js";import{_ as Ce}from"./chat_stop-f24b9fe1.js";import{_ as ke}from"./disable_submit-fbf8956a.js";import{u as Ae}from"./use-theme-vars-59287942.js";import{V as Se}from"./vue3-lottie.es-2c02510b.js";import{C as Ie}from"./chat_record_top_loading-11bc4d61.js";import"./index-d17a5b6b.js";import"./history_close-5fbe00c8.js";import"./file_remove-73268860.js";import"./pdf-b773d2d0.js";const je={key:0,class:"max-w-1/2 border-amber-900"},Be={key:0},Te={key:0},Le={key:0},Ue=["innerHTML"],De=["onClick"],Re=["innerHTML"],Fe={key:1,class:"flex items-center ai-reply-bottom-tools-box"},Ee={key:1},Oe={key:0,class:"markdown-body-grey w-fit",style:{"--color-fg-default":"#082033","line-break":"anywhere"}},Ne=["href"],_e=["innerHTML"],Me=I(e({__name:"Text",props:{inversion:{type:Boolean},error:{type:Boolean},text:{},loading:{type:Boolean},asRawText:{type:Boolean},chat:{},thinkingContent:{},answerList:{},showCompare:{type:Boolean},requestOptions:{},fileUrl:{},fileName:{},fileSize:{}},setup(e){function I(e){const t=function(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}(e),a=t.replace(/\n/g,"<br>");return ge.sanitize(a,{ALLOWED_TAGS:["br","a"],ALLOWED_ATTR:["href","title","target","rel"]})}t().params;const j=e,{isMobile:B}=a(),T=n(),L=new ue({html:!1,linkify:!0,highlight(e,t){if(!(!t||!ce.getLanguage(t))){const a=t??"";return R(ce.highlight(e,{language:a}).value,a)}return R(ce.highlightAuto(e).value,"")}});L.use(de,{attrs:{target:"_blank",rel:"noopener"}}),L.use(pe,{engine:me,delimiters:["dollars","brackets"],blockRegex:/^\[(.*?)\]$/gs,macros:{"\\R":"\\mathbb{R}","\\Z":"\\mathbb{Z}"}});const U=o((()=>{var e,t;return["text-wrap","min-w-[20px]","rounded-md",B.value?"p-2":"px-3 py-2",j.inversion?"bg-[#d2f9d1]":"bg-[#f4f6f8]",j.inversion?"dark:bg-[#a1dc95]":"dark:bg-[#1e1e20]",j.inversion?"message-request":"message-reply",(null==(e=j.chat)?void 0:e.link)?"message-request-grey":"",(null==(t=j.chat)?void 0:t.text)?"":"message-request-no-content",{"text-red-500":j.error}]})),D=o((()=>{var e;return null==(e=null==j?void 0:j.chat)?void 0:e.answerList[0].answer}));function R(e,t){return`<pre class="code-block-wrapper"><div class="code-block-header"><span class="code-block-header__lang">${t}</span><span class="code-block-header__copy">${l("chat.copyCode")}</span></div><code class="hljs code-block-body ${t}">${e}</code></pre>`}function F(){if(T.value){T.value.querySelectorAll(".code-block-header__copy").forEach((e=>{e.addEventListener("click",(()=>{var t,a;const n=null==(a=null==(t=e.parentElement)?void 0:t.nextElementSibling)?void 0:a.textContent;n&&S(n).then((()=>{e.textContent=l("chat.copied"),setTimeout((()=>{e.textContent=l("chat.copyCode")}),1e3)}))}))}))}}i((()=>{F()})),s((()=>{F()})),r((()=>{T.value&&T.value.querySelectorAll(".code-block-header__copy").forEach((e=>{e.removeEventListener("click",(()=>{}))}))}));const E=u();o((()=>E.modelListBaseData.Advanced));const O=c();const N=n(!1);function _(){N.value=!N.value}function M(e){if(!(e=e.trim()))return"";return/^https?:\/\//i.test(e)||(e="https://"+e),e}oe();const V=d();return(e,t)=>{var a,n,o,i,s,r,u,c;return p(),m("div",{class:x(["flex flex-col w-full",[e.inversion?"items-end":""]])},[e.inversion&&j.fileUrl?(p(),m("div",je,["PIC"===v(ve)(null==(a=j.chat)?void 0:a.fileUrl)?(p(),f(v(h),{key:0,class:"max-h-[200px]",src:j.fileUrl,alt:""},null,8,["src"])):(p(),f(he,{key:1,"show-remove":!1,item:{fileType:v(fe)(j.fileUrl),fileName:j.fileName,size:j.fileSize}},null,8,["item"]))])):g("",!0),y("div",{class:x(["text-black",U.value])},[y("div",{ref_key:"textRef",ref:T,class:"leading-relaxed break-words"},[e.inversion?(p(),m("div",Ee,[(null==(i=j.chat)?void 0:i.link)&&(null==(s=j.chat)?void 0:s.text)?(p(),m("div",Oe,[y("a",{href:M(null==(r=j.chat)?void 0:r.text),target:"_blank"},C(null==(u=j.chat)?void 0:u.text),9,Ne)])):g("",!0),!(null==(c=j.chat)?void 0:c.link)&&e.text?(p(),m("div",{key:1,class:"markdown-body w-fit",style:{"--color-fg-default":"#082033","line-break":"anywhere"},innerHTML:I(e.text)},null,8,_e)):g("",!0)])):(p(),m("div",Be,[(p(),m("div",Te,[Array.isArray(D.value)?(p(),m("div",Le,[(p(!0),m(w,null,b(D.value,(e=>{var a;return p(),m("div",{class:"render-block",key:1e4*Math.random()},["text"===e.type?(p(),m("div",{key:0,class:x(["markdown-body",{"markdown-body-generate":null==(a=j.chat)?void 0:a.loading}]),innerHTML:v(L).render(e.content)},null,10,Ue)):(p(),m("div",{key:1,onClick:t=>{return a=e.content,V.updateSetting({html:a}),void V.updateSetting({codePanelCollapsed:!1});var a},class:"code-inner-card flex items-center cursor-pointer"},[t[2]||(t[2]=y("img",{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAG0ElEQVR4AeyaPWwcRRTH/7sFH4oFLoA0IDkxFYgEQWVXNIldwUVIVAkkElIQaQwOlDhuEc4pRRBISAaSCgn5oLLjJpXdkS+gIjEImoQmgkQYilve7+ZevN6sFd/tXqJbe+W3Mztf+37z3ryZ2yRWzlWrJ4Pj9eTw2EwyN3YyWbE06Qs5mVwwPefGZ5LDOVitoruA93+S1P5paiVpatZa1JRoSP1yJXpRUi2RZg18JQ98HfBYPalHkeas06BJv/8NAb6/nkylQe4AtyqamlDFrqipE2btumO1gDE9FV5YwXSCpQpXC9hMv87sVFRNbKnOEoxjrGtw/ROYTNku/wZXm6rFZt3Xuhyg77oZay1WpK1gXbWvvbHC3tV+rnwyFFceMQO4DZyZkMo9blu4cibNAN03C+94WNrztHTgJenoK9LkWEgPjkgjz0o7H8to1qPHngOPDEsfvyF9eyykwAK97/kAD/DUq9JXb0unD0mU94iVYdUzYKwGxJSd47Bs623t2+U/pJkFafGndkE7GX5SLcvTr1fgpQPjurgrVsNNr/8lNX5oE1lydln68JsAC/TMvBW2/5gAJoN+jIHFyberS0lKBUa5Tw8Ft7z9r/TZeemtLyQmAW0BApi8y+LPaxOy8/EwGUwCE4XFWQ6M6+2LpqUBo5Qrh7LvngkglLt7ZmFdecrpg+sjTAJe4Nb2cb19kbQ04I9srQK
1H4sCSohhBiRTrehnPabll3uBuf3A01NAWaPoxLtDuKaFFd/dSgIHC/VxJ3NnV2fNMyGHFkMu/A3Z7NWxdabDPbVlcuxG2LdZ1fu/NlxYGZvYB5pW+9sgjuCf11/6UmAzKNhKsfMmiN/W+BMhTPv29xGSM2n7NmJR3K4WBHRYFUBRA8ohb99LvPN1brrSB8RZvjbUZd8cjocRdPjx1fi8EPGCnp1E7WPhrUYw9lPVGHotQd2WTwEu/0Nrc2pYBlmRr+9oOJOlJpRwJLTu/FwJ+wRRj5ommbD+sQ1RAIdbbbjtI8Fx7WUJpDiPUZYXJ4fRFG9rjJUwa7bEw4xPAPLC559C2UykE7NbFMqxRDhKAs5ZR0pUBEBgsBkhWmJyjdr4G3PvQn0D3+umwN/PMe6h/YMAcFFCAKEqKAM4+CjTPBB0i7ZydtpbNZVE8K3gG9bSjP/3OLkkApyM+wY869xzynUohCw8/EV531aJwyK3dcUWebtjR0mGItrhmVvAMYGl3ub3efTIZw4XJI1oTO3B7L+8kLQTM+uVlaSvwjKAUKUqSliW3/is2UiHgYq9+ML0LAeNeqJ3nXr4W8+ros5H4UvCxs+0GHgol3XpOIeDrf4eXdwoVeuXfB9oHjDwglgnLiLq8ZZQ/YrpUxT4AeIDZ/dT6QXlKWxircXpi2/H9lm0K4Zlyti7aAEX/PCCPzh6tadepFLKwR2c/UfnLAQTE3ZLPO/yY9/0WUBf2X8rZm2njUBw6sp7DxPAOn2jynUohYPZVoLCOC4oDCAjuh0JYC6v4fsv+6sJWRDl7M+1ojzAhHFOZBECB9wMH7WnTjRQCZi3NXQiv5dsVsICjOACu2Dn7dsVvZN9vHZaU/Zdy9ma+kDAaFqQvywI3xwP4kgI041JOu26kEDAv5HyLlXFjQIF40z7rAIDStNlrZ27SewlfOGlDPybBj6kAMj51nMBIu5XCwFj5jH2YQwHyKAs4z1iDyWBdYinKNhKClccC+nm7paueU+srZ7purWbzucLAvKphbo0iuBxuTUo5wrmalCBEupF4PeNgUW/3jv2oYDzK8B4v7zYtBZiX82MBpVAuDe2/cGr2Lw7ulrTPCkGKssUfuYcvnYxDwGJclghpqO3+XhowyrhSQBNdgcRiCC5L8MlTFVj6MAYeQeAjSJFS5uPm9e20rDRgXoxyx+zzLOsYQNyRrYWoSz1rFDjyLvueCx8HeCYAYlWECWCiyoTlHaUCMyCBiwibdvE0JHk+6XIw4YPA5Di9grB3Y1WCHltU2bC8pXRgBkVwTd9WsBRlLnwpAc4DlZfTjn2ZbQ1re3mZac+AXUnAsZR/qgGIaIvbc8riefo7yespw8Lev+y058CuMBBYECCAcXtgeV62vZZ6b9vL9L4B9xKik7G3gTuZrb5rawrHivSrtsoV6SL/9fDiVuFVot/iSLJNYWsgG2sjXo3VkHRTVb9s6c5PRl/G59+LbiaJjqjiV5RoGsSY27njUcP8+xT5KkrU1DTWha0FTGbheDRBBflKSaJT8x9EJ5zpDjAFVETSEZm/89zXEomlegBDpjnWAVOB6Rfej3a1wKWGwffNthUFQzXQ/dFIu1pLVeuv/wEAAP//vdvMRgAAAAZJREFUAwBWWfy8Qbd/OQAAAABJRU5ErkJggg==",alt:""},null,-1)),y("span",null,C(v(l)("Artifact.Tap to open the webpage")),1)],8,De))])})),128))])):(p(),m("div",{key:1,class:x(["markdown-body",{"markdown-body-generate":null==(n=j.chat)?void 0:n.loading}]),innerHTML:I(D.value)},null,10,Re))])),(null==(o=null==j?void 0:j.chat)?void 0:o.isFinish)?(p(),m("div",Fe,[y("img",{onClick:t[0]||(t[0]=e=>async function(){var e,t,a;try{if(Array.isArray(null==(e=null==j?void 0:j.chat)?void 0:e.answerList[0].answer)){const e=null==(t=null==j?void 0:j.chat)?void 0:t.answerList[0].answer.map((e=>e.content)).join("\n");await S(e||"")}else{const e=null==(a=null==j?void 0:j.chat)?void 0:a.answerList[0].answer;await S(e||"")}O.success(l("chat.copied"))}catch{O.error(l("mj.copyFail"))}}()),src:k,class:""}),y("img",{onClick:_,class:"",src:re})])):g("",!0)]))],512)],2),A(ie,{show:N.value,"data-type":"chat","onUpdate:show":t[1]||(t[1]=e=>N.value=!1)},null,8,["show"])],2)}}}),[["__scopeId","data-v-22fe1811"]]),Ve=I(e({__name:"index",props:{dateTime:{},text:{},inversion:{type:Boolean},error:{type:Boolean},loading:{type:Boolean},chat:{},index:{},thinkingContent:{},thinking:{type:Boolean},isReasoning:{type:Boolean},modeValue:{},isFinish:{type:Boolean},answerList:{},showCompare:{type:Boolean},requestOptions:{},fileUrl:{},fileName:{},fileSize:{}},emits:["regenerate","delete"],setup(e,{emit:t}){const i=j();o((()=>i.getActiveAgentBot));const s=e;a();const{iconRender:r}=ye();c();const u=n(),d=n(s.inversion),v=n();o((()=>{const e=[{label:l("chat.copy"),key:"copyText",icon:r({icon:"ri:file-copy-2-line"})},{label:l("common.delete"),key:"delete",icon:r({icon:"ri:delete-bin-line"})}];return s.inversion||(e.unshift({label:d.value?l("chat.preview"):l("chat.showRawText"),key:"toggleRenderType",icon:r({icon:d.value?"ic:outline-code-off":"ic:outline-code"})}),e.unshift({label:l("mj.tts"),key:"tts",icon:r({icon:"mdi:tts"})})),e}));const f=n(!1);return n(!1),(e,t)=>(p(),m("div",{ref_key:"messageRef",ref:v,class:x(["flex w-full mb-6 overflow-hidden",[{"flex-row-reverse":e.inversion}]])},[y("div",{class:x(["w-full overflow-hidden text-sm",[e.inversion?"items-end":"items-start"]])},[y("div",{class:x(["w-full flex items-end gap-1 mt-2",[e.inversion?"flex-row-reverse":"flex-row"]])},[A(Me,{answerList:s.answerList,class:x([e.inversion?"":"w-full"]),ref_key:"textRef",ref:u,inversion:e.inversion,error:e.error,text:e.text,loading:e.loading,"as-raw-text":d.value,chat:e.chat,"thinking-content":e.thinkingContent,showCompare:e.showCompare,requestOptions:e.requestOptions,fileUrl:e.fileUrl,fileName:e.fileName,fileSize:e.fileSize},null,8,["answerList","class","inversion","error","text","loading","as-raw-text","chat","thinking-content","showCompare","requestOptions","fileUrl","fileName","fileSize"])],2)],2),A(ie,{show:f.value,"data-type":"chat","onUpdate:show":t[0]||(t[0]=e=>f.value=!1)},null,8,["show"])],2))}}),[["__scopeId","data-v-4f0d44ac"]]);const Pe={class:""},He={class:"w-full flex flex-col"}
1,Ze={id:"submit-btn",class:"absolute bottom-0 flex justify-end input-bottom"},We={class:"right-arr-img right-arr-img-not-allow cursor-not-allowed",src:ke,alt:""},Je=I(e({__name:"aiGptInput",props:{mode:{},modelValue:{},disabled:{type:Boolean},searchOptions:{},renderOption:{type:Function},stopController:{},taskStatus:{},referenceUploadStatus:{},allowControl:{type:Boolean}},emits:["update:modelValue","export","handleClear","submit"],setup(e,{emit:s}){Ae();const{iconRender:u}=ye();t();const d=T(),f=j();L();const h=s,w=e,b=n(),C=n({fileBase64:[],isLoad:0,isShow:!1,showMic:!1,micStart:!1}),{isMobile:k}=a();o((()=>k.value?l("chat.placeholderMobile"):l("chat.placeholder")));const{uuid:A,agentBotId:S,agentBotSessionId:I,needRequest:Y}=t().params,q=d.active,G=new M(null==q?1002:q),z=n(G.getGptConfig());o((()=>d.getChatByUuid(A)));const Q=n(null),X=n(!1),K=e=>{"Enter"!==e.key||!e.isComposing&&!X.value?e.shiftKey&&"Enter"===e.key?(e.preventDefault(),(e=>{const t=Q.value,a=t.selectionStart,n=t.selectionEnd;oe.value=oe.value.substring(0,a)+e+oe.value.substring(n),setTimeout((()=>{t.focus(),t.setSelectionRange(a+e.length,a+e.length),ke()}),0)})("\n")):"Enter"===e.key&&(e.preventDefault(),w.allowControl&&be()):e.preventDefault()},ee=()=>{X.value=!0},te=()=>{X.value=!1};i((()=>{Q.value&&Q.value.addEventListener("keydown",K),ke()})),r((()=>{Q.value&&Q.value.removeEventListener("keydown",K)})),U((()=>R.myData),(()=>z.value=G.getGptConfig()),{deep:!0}),U((()=>P.myData.act),(e=>"saveChat"==e&&(z.value=G.getGptConfig())),{deep:!0});const ne=c(),oe=o({get:()=>w.modelValue,set(e){h("update:modelValue",e),ke()}});i((()=>{A&&(oe.value=fe.chatLastUserInputValue),I&&(oe.value=fe.botLastUserInputValue)})),r((()=>{oe.value&&(A&&fe.updateSetting({chatLastUserInputValue:oe.value}),I&&fe.updateSetting({botLastUserInputValue:oe.value}))}));const ie=e=>{if(D(R.myData.model)){const t=new FormData;t.append("file",e),ne.info(l("mj.uploading")),C.value.isLoad=1,ae("/v1/upload",t).then((e=>{C.value.isLoad=0,e.url?(ne.info(l("mj.uploadSuccess")),e.url.indexOf("http")>-1?C.value.fileBase64.push(e.url):C.value.fileBase64.push(location.origin+e.url)):e.error&&ne.error(e.error)})).catch((e=>{C.value.isLoad=0,ne.error(l("mj.uploadFail")+(e.message??JSON.stringify(e)))}))}else{if(H(e.name))return Z("mp3",e),void P.setMyData({act:"gpt.whisper",actData:{file:e,prompt:"whisper"}});W(e).then((e=>{b.value.value="",C.value.fileBase64.findIndex((t=>t==e))>-1?ne.error(l("mj.noReUpload")):C.value.fileBase64.push(e)})).catch((e=>ne.error(e)))}};o((()=>D(R.myData.model)?"*/*":"image/jpeg, image/jpg, image/png, image/gif, .mp3, .mp4, .mpeg, .mpga, .m4a, .wav, .webm"));const se=e=>{if(e.preventDefault(),e.stopPropagation(),!e.dataTransfer||0==e.dataTransfer.files.length)return;const t=e.dataTransfer.files;ie(t[0])},re=e=>{let t=V(e);t.length>0&&ie(t[0])};l("mj.micWhisper"),u({icon:"ri:openai-fill"}),l("mj.micAsr"),u({icon:"ri:chrome-line"}),n(!1);const ue=n(!1),ce=n(!1),de=()=>{ue.value=!0},pe=()=>{ue.value=!1},me=()=>{B((()=>{ce.value=!0}))},ve=()=>{ue.value||B((()=>{ce.value=!1}))},fe=F();o((()=>fe.modeName)),n(null);const he=n([]),ge=n(!0);const we=c(),be=$((()=>{var e,t,a,n;const o=Q.value;if(0!==oe.value.trim().length){if("createImg"===w.mode){if(h("submit"),oe.value="",!o)return;o.style.height="auto",o.style.overflowY="hidden"}if("chat"===w.mode){if(!le("text",fe.consumePoints,fe.modelOwner))return;const e=he.value.map((e=>e.url)).join(",");let t={prompt:oe.value.trim(),fileUrl:e,fileSize:he.value.map((e=>e.size)).join(","),fileName:he.value.map((e=>e.fileName)).join(",")};if(P.setMyData({act:"gpt.submit",actData:t}),he.value=[],oe.value="",!o)return;return o.style.height="auto",o.style.overflowY="hidden",!1}if("agentBot"===w.mode){if(!le("text",null==(t=null==(e=null==f?void 0:f.activeAgentBot)?void 0:e.agentInfo)?void 0:t.consumePoints,null==(n=null==(a=null==f?void 0:f.activeAgentBot)?void 0:a.agentInfo)?void 0:n.modelOwner))return;let l={content:oe.value.trim(),botId:S,sessionId:I===J.DEFAULT_SESSION_ID?"":I};if(P.setMyData({act:"gpt.submitAgentBot",actData:l}),oe.value="",!o)return;o.style.height="auto",o.style.overflowY="hidden"}}else we.warning("The input content cannot be empty.")}));function ke(){const e=Q.value;if(!e)return;if(""===oe.value)return e.style.height="auto",void(e.style.overflowY="hidden");e.style.height="auto";const t=e.scrollHeight,a=Math.min(t,150);e.style.height=a+"px",e.style.overflowY=t>150?"auto":"hidden"}return(e,t)=>(p(),m("div",Pe,[y("div",{onMouseenter:me,onMouseout:ve,class:x(["flex flex-col myinputs border-[2px] transition duration-300 ease-in-out hover:border-[#478DFF]",[v(k)?"":"chat-footer ",ue.value?"border-[#478DFF]!":""]]),onDrop:se,onPaste:re},[g("",!0),y("div",He,[y("form",{onSubmit:t[3]||(t[3]=E(((...e)=>v(be)&&v(be)(...e)),["prevent"]))},[O(y("textarea",{id:"textarea",ref_key:"textareaRef",ref:Q,"onUpdate:modelValue":t[0]||(t[0]=e=>oe.value=e),placeholder:"",onFocus:de,onBlur:pe,onCompositionstart:ee,onCompositionend:te,rows:"1",class:"flex-1 w-full h-full border-0 resize-none no-focus-outline",onInput:ke},null,544),[[N,oe.value]]),y("div",Ze,[O(y("div",null,[O(y("div",{type:"submit",onClick:t[1]||(t[1]=(...e)=>v(be)&&v(be)(...e)),class:"cursor-pointer flex justify-center items-center"},t[4]||(t[4]=[y("img",{class:"right-arr-img",src:xe},null,-1)]),512),[[_,ge.value&&!v(P).myData.isAnswering]]),O(y("img",{class:"right-arr-img cursor-pointer",onClick:t[2]||(t[2]=e=>(v(P).setMyData({act:"abort",isAnswering:!1}),w.stopController.abort())),src:Ce,alt:""},null,512),[[_,ge.value&&v(P).myData.isAnswering]])],512),[[_,e.allowControl]]),O(y("img",We,null,512),[[_,!e.allowControl]])])],32)])],34)]))}}),[["__scopeId","data-v-a8d27890"]]),Ye={class:"flex-1 overflow-hidden"},qe={class:"flex items-center justify-between top-tool-box bg-[#ffffff]"},Ge={key:0,class:"new-panel flex-1 flex justify-center items-center h-full"},ze={key:1,class:"chat-index-list-box"},Qe={class:"chat-index-list-top-loading flex justify-center"},Xe={class:"w-full max-w-4/5 m-auto"},Ke=I(e({__name:"index",props:{baseImgUrl:{type:String},currentAppInfo:{type:Object},referenceUploadStatus:{type:String},needBaseImgUrl:{type:Boolean,default:!0},otherChatItemList:{type:Array,default:[]},startImgOrVideoSrc:{type:String,default:""},storeFormData:{type:Object},allowControl:{type:Boolean,default:!0}},emits:["userSubmit"],setup(e,{expose:s,emit:u}){const d=e;let h=new AbortController;const k=t(),S=Y();c();const I=q(),j=T(),{isMobile:L}=a(),{addChat:D,updateChat:R,updateChatSome:E,getChatByUuidAndIndex:N}=function(){const e=T();return{addChat:(t,a)=>{e.addChatByUuid(t,a)},updateChat:(t,a,n)=>{e.updateChatByUuid(t,a,n)},updateChatSome:(t,a,n)=>{e.updateChatSomeByUuid(t,a,n)},getChatByUuidAndIndex:(t,a)=>e.getChatByUuidAndIndex(t,a),updateChatMoreAnswer:(t,a,n,o)=>{e.updateChatMoreAnswerByUuidAndAnswerIndex(t,a,n,o)}}}(),{scrollRef:M,scrollToBottom:V,scrollToBottomIfAtBottom:H,isScrollRefCurrentInBottom:Z,isScrollRefCurrentInTop:W,scrollToCompareBoxTop:J}=function(){const e=n(null);return{scrollRef:e,scrollToBottom:async()=>
1{if(await B(),e.value){const t=e.value.clientHeight,a=e.value.scrollHeight;e.value.scrollTop=a-t}},scrollToTop:async()=>{await B(),e.value&&(e.value.scrollTop=0)},scrollToBottomIfAtBottom:async()=>{if(await B(),e.value){const t=100;e.value.scrollHeight-e.value.scrollTop-e.value.clientHeight<=t&&(e.value.scrollTop=e.value.scrollHeight)}},isScrollRefCurrentInBottom:async()=>(await B(),!!e.value&&e.value.scrollTop+e.value.clientHeight>=e.value.scrollHeight-50),isScrollRefCurrentInTop:async()=>(await B(),!!e.value&&e.value.scrollTop<=150)}}();!function(){const e=c(),t=T(),a=o((()=>t.usingContext))}();const{uuid:K,needRequest:$}=k.params,ee=o((()=>j.getChatByUuid(K)));o((()=>ee.value.filter((e=>!e.inversion&&!!e.conversationOptions))));const te=n(""),ae=n(!1);n(null);const ne=we();G(ne);const oe=z();o((()=>oe.isChat)),ee.value.forEach(((e,t)=>{(null==e?void 0:e.loading)&&E(+K,t,{loading:!1})})),U((()=>ee.value),(e=>{H()}));const le=n([...d.otherChatItemList]);U((()=>d.otherChatItemList),(()=>{le.value=[...d.otherChatItemList]}),{deep:!0,immediate:!0});const ie=n("pending"),re=n(""),ue=u;function ce(){let e=te.value;0!==e.trim().length&&(ue("userSubmit",e),V())}function de(){ae.value}function pe(){ae.value||S.warning({title:l("chat.clearChat"),content:l("chat.clearChatConfirm"),positiveText:l("common.yes"),negativeText:l("common.no"),onPositiveClick:()=>{j.clearChatByUuid(+K)}})}s({generateAIBubbleStructure:function(e="success",t="aiText",a="aiImg"){return{status:e,inversion:!1,error:!1,dateTime:(new Date).toISOString().split("T")[0],text:"",hasReceiveMessage:!0,onlineType:"normal",aiImg:a,answerList:[{modelId:"1911971993789140993",modelOwner:"Basic",modelValue:"gpt-4.1-nano-2025-04-14",thinking:"",answer:t,aiImg:a,modelImage:"",createTime:1751004119,modelName:"GPT 4.1 Nano",onlineType:"normal",hasReceiveMessage:!0,userQuestionOptions:{model:"",content:"",sessionType:"",fileUrl:"",onlineType:"",modelId:"",sessionId:"",questionId:""},isReasoning:!1,onThinking:!1,isFinish:!0}]}},setChatItemInRecord:function(e){le.value.push(e)},resetAll:function(){le.value=[],re.value="",ie.value="pending"}}),o((()=>L.value?l("chat.placeholderMobile"):l("chat.placeholder")));const me=o((()=>ae.value||!te.value||""===te.value.trim())),ve=o((()=>{let e=["p-4"];return L.value&&(e=["sticky","left-0","bottom-0","right-0","p-2","pr-3"]),e}));i((()=>{})),r((()=>{ae.value&&h.abort(),P.setMyData({isLoader:!1})}));const fe=o((()=>P.myData.local));U((()=>P.myData.act),(e=>{"draw"==e&&V(),"scrollToBottom"==e&&V(),"scrollToBottomIfAtBottom"==e&&H(),"scrollToCompareBoxTop"==e&&J(),"gpt.submit"!=e&&"gpt.resubmit"!=e||(ae.value=!0),"stopLoading"==e&&(ae.value=!1)})),n({inputme:!0}),U((()=>ae.value),(e=>P.setMyData({isLoader:e}))),n([]),n("");const he=F();o((()=>he.modelName)),n(!1);const ge=Q((function(){W().then((e=>{!j.isLoadingRecordPage&&e&&j.currentSessionChatRecordRequestPage.pageNum<j.currentSessionChatRecordRequestPage.totalPages&&j.reloadChatOnline(K)}))}),100);function ye(){I.replace({path:"/studio/artifacts"})}return(t,a)=>(p(),m(w,null,[y("div",{class:x(["flex flex-col w-full max-h-[100vh] chat-content",[v(L)?"":"chat-content-noMobile"]])},[y("main",Ye,[y("div",qe,[y("div",{onClick:ye,class:"cursor-pointer flex items-center pl-[15px] pr-[15px] back-btn"},[a[3]||(a[3]=y("img",{class:"back_icon",src:X},null,-1)),y("div",null,C(v(l)("Artifact.title")),1)]),A(se,{"show-type":"base"})]),y("div",{id:"scrollRef",ref_key:"scrollRef",ref:M,onScroll:a[0]||(a[0]=(...e)=>v(ge)&&v(ge)(...e)),class:"overflow-hidden overflow-y-auto"},[y("div",{id:"image-wrapper",class:x(["w-full h-full max-w-4/5 m-auto mb-0 dark:bg-[#101014]",[v(L)?"p-2":"p-4 pb-4"]])},[0===le.value.length?(p(),m("div",Ge)):(p(),m("div",ze,[y("div",Qe,[O(A(v(Se),{animationData:v(Ie)},null,8,["animationData"]),[[_,v(j).isLoadingRecordPage]])]),(p(!0),m(w,null,b(le.value,((e,t)=>(p(),f(v(Ve),{key:t+String(1e5*Math.random()),"date-time":null==e?void 0:e.dateTime,text:null==e?void 0:e.text,answerList:null==e?void 0:e.answerList,inversion:e.inversion,error:e.error,loading:e.loading,chat:e,index:t,thinkingContent:e.reasoningContent,thinking:e.thinking,"is-reasoning":e.isReasoning,modeValue:e.modeValue,isFinish:e.isFinish,showCompare:t===ee.value.length-1,requestOptions:e.requestOptions,fileUrl:e.fileUrl,fileName:e.fileName,fileSize:e.fileSize},null,8,["date-time","text","answerList","inversion","error","loading","chat","
1index","thinkingContent","thinking","is-reasoning","modeValue","isFinish","showCompare","requestOptions","fileUrl","fileName","fileSize"])))),128))]))],2)],544)]),"draw"!==fe.value?(p(),m("footer",{key:0,class:x([ve.value,"footer-content mt-1"])},[y("div",Xe,[A(Je,{"allow-control":d.allowControl,mode:"createImg",taskStatus:ie.value,referenceUploadStatus:e.referenceUploadStatus,currentAppInfo:e.currentAppInfo,onSubmit:ce,onHandleClear:pe,onExport:de,modelValue:te.value,"onUpdate:modelValue":a[1]||(a[1]=e=>te.value=e),disabled:me.value,stopController:v(h)},null,8,["allow-control","taskStatus","referenceUploadStatus","currentAppInfo","modelValue","disabled","stopController"])])],2)):g("",!0)],2),A(be,{onFinished:a[2]||(a[2]=e=>ae.value=!1),controller:v(h)},null,8,["controller"])],64))}}),[["__scopeId","data-v-55d0b155"]]),$e={class:"remove-bg relative"},et={class:"lite-app-sense-content flex justify-center items-center"},tt=I(e({__name:"index",props:{currentAppInfo:{type:Object}},setup(e){const a=t(),s=q(),u=n(null),c=d(),v=n([]);i((()=>{var e,t,o,i,r,d,p,m;if(u.value=c.formData,c.clearFormData(),a.params.recordId)te({sessionId:a.params.recordId}).then((e=>{if(e.data.length>0){const t=K(e.data);t.forEach((e=>{e.answerList&&e.answerList.length>0&&e.answerList.forEach((e=>{if(e.answer&&"string"==typeof e.answer){const t=h(e.answer);e.answer=t;const a=t.find((e=>"html"===e.type));a&&c.updateSetting({html:a.content})}}))})),v.value=t}}));else{v.value.push({status:"success",inversion:!0,error:!1,link:!1,dateTime:(new Date).toISOString().split("T")[0],text:null==(e=u.value)?void 0:e.inputValue,hasReceiveMessage:!0,onlineType:"normal",aiImg:""}),v.value.push({dateTime:(new Date).toLocaleString(),answer:l("mj.thinking"),text:l("mj.thinking"),question:"",loading:!0,inversion:!1,error:!1,requestOptions:{prompt:"",options:{}},agentBotSessionId:"",model:"SSSS",answerList:[{answer:l("mj.thinking"),modelName:"",thinking:"",isFinish:!1,loading:!0}]});if(x(n({liteAppId:null==(t=u.value)?void 0:t.appInfo.liteAppId,textContent:null==(o=u.value)?void 0:o.inputValue,sessionId:null==(i=u.value)?void 0:i.sessionId,textInput:null==(r=u.value)?void 0:r.inputValue}).value),!(null==(d=u.value)?void 0:d.appInfo.liteAppId))return s.replace({path:"/studio/artifacts"}),void(null==(p=a.params)||p.type);null==(m=a.params)||m.type}}));const f=n([]);function h(e){const t=[],a="```html";let n=0;for(;n<e.length;){const o=e.indexOf(a,n);if(-1===o){const a=e.substring(n).trim();a&&t.push({type:"text",content:a});break}const l=e.substring(n,o).trim();l&&t.push({type:"text",content:l});const i=o+7,s=e.indexOf("```",i);let r;if(c.codePanelCollapsed&&c.updateSetting({codePanelCollapsed:!1}),-1===s){r=e.substring(i).trim(),t.push({type:"html",content:r});break}r=e.substring(i,s).trim(),t.push({type:"html",content:r}),n=s+3}return t}function g(e){const t=v.value.find((e=>!0===e.loading));t&&t.answerList&&t.answerList[0]&&(t.answerList[0].answer=e)}U([()=>f.value],(([e],[t])=>{var a;if(g(h(e.join(""))),e.length>0){const t=h(e.join(""));t.find((e=>"html"===e.type))&&c.updateSetting({html:null==(a=t.find((e=>"html"===e.type)))?void 0:a.content})}}),{deep:!0,immediate:!0});const w=n(),b=o((()=>c.inputAllowControl));function x(e){c.updateSetting({inputAllowControl:!1}),w.value=new AbortController,ne({onMessage:e=>{var t;e.text&&f.value.push(e.text),e.isFinish&&(v.value.find((e=>"html"===e.type))&&c.updateSetting({html:null==(t=v.value.find((e=>"html"===e.type)))?void 0:t.content}),f.value.push(e.text),function(){const e=v.value.find((e=>!0===e.loading));g(h(f.value.join(""))),e&&e.loading&&(e.loading=!1,e.isFinish=!0),f.value=[]}(),c.updateSetting({inputAllowControl:!0}))},onError:e=>{c.updateSetting({inputAllowControl:!0}),Z("onError",e),JSON.stringify(e.reason?JSON.parse(e.reason):e,null,2),ee(e)?f.value.push("\n\n> ⚠️ **"+l("mj.abortTask")+"**\n\n"):f.value.push("\n\n> ⚠️ **"+l("mj.networkTimeOut")+"**\n\n")},signal:w.value.signal,kid:""},e)}const C=n(null),k=n("pending");n("pending");const S=n("");n(""),n(null),n(null),n(null),n(0),n(!1),i((()=>{})),r((()=>{}));const I=n(!1);function j(e){var t,a,o,i;if(!le("text",null==(t=u.value)?void 0:t.appInfo.consumePoints,null==(a=u.value)?void 0:a.appInfo.modelOwner))return;v.value.push({dateTime:(new Date).toISOString().split("T")[0],text:e,inversion:!0,error:!1,conversationOptions:"",f
1ileUrl:"",fileName:"",fileSize:"",requestOptions:{prompt:e,options:""}}),v.value.push({dateTime:(new Date).toLocaleString(),answer:l("mj.thinking"),text:l("mj.thinking"),question:"",loading:!0,inversion:!1,error:!1,requestOptions:{prompt:"",options:{}},agentBotSessionId:"",model:"SSSS",answerList:[{answer:l("mj.thinking"),modelName:"",thinking:"",isFinish:!1,loading:!0}]});x(n({liteAppId:null==(o=u.value)?void 0:o.appInfo.liteAppId,textContent:e,sessionId:null==(i=u.value)?void 0:i.sessionId}).value)}return n(null),oe(),Y(),(e,t)=>{var a;return p(),m("div",$e,[y("div",et,[A(Ke,{allowControl:b.value,onUserSubmit:j,storeFormData:u.value,"current-app-info":null==(a=u.value)?void 0:a.appInfo,"other-chat-item-list":v.value,ref_key:"baseChatRef",ref:C,referenceUploadStatus:k.value,baseImgUrl:S.value},null,8,["allowControl","storeFormData","current-app-info","other-chat-item-list","referenceUploadStatus","baseImgUrl"])]),A(ie,{show:I.value,"data-type":"chat","onUpdate:show":t[0]||(t[0]=e=>I.value=!1)},null,8,["show"])])}}}),[["__scopeId","data-v-2b124f97"]]);export{tt as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.