@apform-ui/core 1.9.0 → 1.9.1
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.
- package/dist/apform-ui.js +3 -3
- package/dist/apform-ui.umd.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/apform-ui.js
CHANGED
|
@@ -9337,7 +9337,7 @@ function BN(I) {
|
|
|
9337
9337
|
}
|
|
9338
9338
|
return "操作失败";
|
|
9339
9339
|
}
|
|
9340
|
-
const rw = /\/(?:schema-platform\/)?api\/ai\/documents\/([^/?#]+)\/file/i, LZ = /\.(mp4|webm|mov|m4v)(
|
|
9340
|
+
const rw = /\/(?:schema-platform\/)?api\/ai\/documents\/([^/?#]+)\/file/i, LZ = /\.(mp4|webm|mov|m4v)(?:\?|#|$|\s)/i, fw = /\.(png|jpe?g|gif|webp|bmp|svg)(?:\?|#|$|\s)/i, LC = /\.pdf(?:\?|#|$|\s)/i, tC = /\.(docx?|xlsx?|csv|txt|md)(?:\?|#|$|\s)/i, tZ = /(?:https?:\/\/[^\s"'<>\]]+|\/(?:schema-platform\/)?api\/ai\/documents\/[^/\s"'<>\]]+\/file)/gi;
|
|
9341
9341
|
function pg(I) {
|
|
9342
9342
|
const g = I.trim().match(rw);
|
|
9343
9343
|
if (g != null && g[1]) return g[1];
|
|
@@ -9353,7 +9353,7 @@ function Vg(I) {
|
|
|
9353
9353
|
const c = C || g;
|
|
9354
9354
|
return LC.test(c) || Z.includes("pdf") ? "pdf" : tC.test(c) || /word|sheet|excel|csv|text/.test(Z) ? "office" : "file";
|
|
9355
9355
|
}
|
|
9356
|
-
const d =
|
|
9356
|
+
const d = [g, C].filter(Boolean).join(" ").toLowerCase(), l = Z.toLowerCase();
|
|
9357
9357
|
return l.startsWith("video/") || LZ.test(d) ? "video" : l.startsWith("image/") || fw.test(d) ? "image" : l.includes("pdf") || LC.test(d) ? "pdf" : tC.test(d) || l.includes("word") || l.includes("sheet") || l.includes("excel") || l.includes("csv") || l.startsWith("text/") ? "office" : pg(g) && !LC.test(g) && !tC.test(g) && !LZ.test(g) ? "image" : "file";
|
|
9358
9358
|
}
|
|
9359
9359
|
function qI(I, g, C) {
|
|
@@ -9490,7 +9490,7 @@ function sN(I) {
|
|
|
9490
9490
|
};
|
|
9491
9491
|
});
|
|
9492
9492
|
}
|
|
9493
|
-
const wN = "1.9.
|
|
9493
|
+
const wN = "1.9.1", VN = "2.14.2", NN = "2026-08-27";
|
|
9494
9494
|
export {
|
|
9495
9495
|
IV as APP_ICON_NAMES,
|
|
9496
9496
|
HV as AVATAR_SIZE,
|
package/dist/apform-ui.umd.cjs
CHANGED
|
@@ -68,7 +68,7 @@ ${C}</tr>
|
|
|
68
68
|
`}strong({tokens:C}){return`<strong>${this.parser.parseInline(C)}</strong>`}em({tokens:C}){return`<em>${this.parser.parseInline(C)}</em>`}codespan({text:C}){return`<code>${WA(C,!0)}</code>`}br(C){return"<br>"}del({tokens:C}){return`<del>${this.parser.parseInline(C)}</del>`}link({href:C,title:I,tokens:g}){let A=this.parser.parseInline(g),i=$B(C);if(i===null)return A;C=i;let l='<a href="'+C+'"';return I&&(l+=' title="'+WA(I)+'"'),l+=">"+A+"</a>",l}image({href:C,title:I,text:g,tokens:A}){A&&(g=this.parser.parseInline(A,this.parser.textRenderer));let i=$B(C);if(i===null)return WA(g);C=i;let l=`<img src="${C}" alt="${WA(g)}"`;return I&&(l+=` title="${WA(I)}"`),l+=">",l}text(C){return"tokens"in C&&C.tokens?this.parser.parseInline(C.tokens):"escaped"in C&&C.escaped?C.text:WA(C.text)}},zs=class{strong({text:C}){return C}em({text:C}){return C}codespan({text:C}){return C}del({text:C}){return C}html({text:C}){return C}text({text:C}){return C}link({text:C}){return""+C}image({text:C}){return""+C}br(){return""}checkbox({raw:C}){return C}},iA=class Qu{constructor(I){CI(this,"options");CI(this,"renderer");CI(this,"textRenderer");this.options=I||dl,this.options.renderer=this.options.renderer||new xt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zs}static parse(I,g){return new Qu(g).parse(I)}static parseInline(I,g){return new Qu(g).parseInline(I)}parse(I){var A,i;this.renderer.parser=this;let g="";for(let l=0;l<I.length;l++){let e=I[l];if((i=(A=this.options.extensions)==null?void 0:A.renderers)!=null&&i[e.type]){let a=e,d=this.options.extensions.renderers[a.type].call({parser:this},a);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(a.type)){g+=d||"";continue}}let c=e;switch(c.type){case"space":{g+=this.renderer.space(c);break}case"hr":{g+=this.renderer.hr(c);break}case"heading":{g+=this.renderer.heading(c);break}case"code":{g+=this.renderer.code(c);break}case"table":{g+=this.renderer.table(c);break}case"blockquote":{g+=this.renderer.blockquote(c);break}case"list":{g+=this.renderer.list(c);break}case"checkbox":{g+=this.renderer.checkbox(c);break}case"html":{g+=this.renderer.html(c);break}case"def":{g+=this.renderer.def(c);break}case"paragraph":{g+=this.renderer.paragraph(c);break}case"text":{g+=this.renderer.text(c);break}default:{let a='Token with "'+c.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return g}parseInline(I,g=this.renderer){var i,l;this.renderer.parser=this;let A="";for(let e=0;e<I.length;e++){let c=I[e];if((l=(i=this.options.extensions)==null?void 0:i.renderers)!=null&&l[c.type]){let d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(c.type)){A+=d||"";continue}}let a=c;switch(a.type){case"escape":{A+=g.text(a);break}case"html":{A+=g.html(a);break}case"link":{A+=g.link(a);break}case"image":{A+=g.image(a);break}case"checkbox":{A+=g.checkbox(a);break}case"strong":{A+=g.strong(a);break}case"em":{A+=g.em(a);break}case"codespan":{A+=g.codespan(a);break}case"br":{A+=g.br(a);break}case"del":{A+=g.del(a);break}case"text":{A+=g.text(a);break}default:{let d='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(d),"";throw new Error(d)}}}return A}},ba=(is=class{constructor(C){CI(this,"options");CI(this,"block");this.options=C||dl}preprocess(C){return C}postprocess(C){return C}processAllTokens(C){return C}emStrongMask(C){return C}provideLexer(C=this.block){return C?AA.lex:AA.lexInline}provideParser(C=this.block){return C?iA.parse:iA.parseInline}},CI(is,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),CI(is,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),is),K1=class{constructor(...C){CI(this,"defaults",Hs());CI(this,"options",this.setOptions);CI(this,"parse",this.parseMarkdown(!0));CI(this,"parseInline",this.parseMarkdown(!1));CI(this,"Parser",iA);CI(this,"Renderer",xt);CI(this,"TextRenderer",zs);CI(this,"Lexer",AA);CI(this,"Tokenizer",Lt);CI(this,"Hooks",ba);this.use(...C)}walkTokens(C,I){var A,i;let g=[];for(let l of C)switch(g=g.concat(I.call(this,l)),l.type){case"table":{let e=l;for(let c of e.header)g=g.concat(this.walkTokens(c.tokens,I));for(let c of e.rows)for(let a of c)g=g.concat(this.walkTokens(a.tokens,I));break}case"list":{let e=l;g=g.concat(this.walkTokens(e.items,I));break}default:{let e=l;(i=(A=this.defaults.extensions)==null?void 0:A.childTokens)!=null&&i[e.type]?this.defaults.extensions.childTokens[e.type].forEach(c=>{let a=e[c].flat(1/0);g=g.concat(this.walkTokens(a,I))}):e.tokens&&(g=g.concat(this.walkTokens(e.tokens,I)))}}return g}use(...C){let I=this.defaults.extensions||{renderers:{},childTokens:{}};return C.forEach(g=>{let A={...g};if(A.async=this.defaults.async||A.async||!1,g.extensions&&(g.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let l=I.renderers[i.name];l?I.renderers[i.name]=function(...e){let c=i.renderer.apply(this,e);return c===!1&&(c=l.apply(this,e)),c}:I.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let l=I[i.level];l?l.unshift(i.tokenizer):I[i.level]=[i.tokenizer],i.start&&(i.level==="block"?I.startBlock?I.startBlock.push(i.start):I.startBlock=[i.start]:i.level==="inline"&&(I.startInline?I.startInline.push(i.start):I.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(I.childTokens[i.name]=i.childTokens)}),A.extensions=I),g.renderer){let i=this.defaults.renderer||new xt(this.defaults);for(let l in g.renderer){if(!(l in i))throw new Error(`renderer '${l}' does not exist`);if(["options","parser"].includes(l))continue;let e=l,c=g.renderer[e],a=i[e];i[e]=(...d)=>{let t=c.apply(i,d);return t===!1&&(t=a.apply(i,d)),t||""}}A.renderer=i}if(g.tokenizer){let i=this.defaults.tokenizer||new Lt(this.defaults);for(let l in g.tokenizer){if(!(l in i))throw new Error(`tokenizer '${l}' does not exist`);if(["options","rules","lexer"].includes(l))continue;let e=l,c=g.tokenizer[e],a=i[e];i[e]=(...d)=>{let t=c.apply(i,d);return t===!1&&(t=a.apply(i,d)),t}}A.tokenizer=i}if(g.hooks){let i=this.defaults.hooks||new ba;for(let l in g.hooks){if(!(l in i))throw new Error(`hook '${l}' does not exist`);if(["options","block"].includes(l))continue;let e=l,c=g.hooks[e],a=i[e];ba.passThroughHooks.has(l)?i[e]=d=>{if(this.defaults.async&&ba.passThroughHooksRespectAsync.has(l))return(async()=>{let Z=await c.call(i,d);return a.call(i,Z)})();let t=c.call(i,d);return a.call(i,t)}:i[e]=(...d)=>{if(this.defaults.async)return(async()=>{let Z=await c.apply(i,d);return Z===!1&&(Z=await a.apply(i,d)),Z})();let t=c.apply(i,d);return t===!1&&(t=a.apply(i,d)),t}}A.hooks=i}if(g.walkTokens){let i=this.defaults.walkTokens,l=g.walkTokens;A.walkTokens=function(e){let c=[];return c.push(l.call(this,e)),i&&(c=c.concat(i.call(this,e))),c}}this.defaults={...this.defaults,...A}}),this}setOptions(C){return this.defaults={...this.defaults,...C},this}lexer(C,I){return AA.lex(C,I??this.defaults)}parser(C,I){return iA.parse(C,I??this.defaults)}parseMarkdown(C){return(I,g)=>{let A={...g},i={...this.defaults,...A},l=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&A.async===!1)return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof I>"u"||I===null)return l(new Error("marked(): input parameter is undefined or null"));if(typeof I!="string")return l(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(I)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=C),i.async)return(async()=>{let e=i.hooks?await i.hooks.preprocess(I):I,c=await(i.hooks?await i.hooks.provideLexer(C):C?AA.lex:AA.lexInline)(e,i),a=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(a,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser(C):C?iA.parse:iA.parseInline)(a,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(l);try{i.hooks&&(I=i.hooks.preprocess(I));let e=(i.hooks?i.hooks.provideLexer(C):C?AA.lex:AA.lexInline)(I,i);i.hooks&&(e=i.hooks.processAllTokens(e)),i.walkTokens&&this.walkTokens(e,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(C):C?iA.parse:iA.parseInline)(e,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(e){return l(e)}}}onError(C,I){return g=>{if(g.message+=`
|
|
69
69
|
Please report this to https://github.com/markedjs/marked.`,C){let A="<p>An error occurred:</p><pre>"+WA(g.message+"",!0)+"</pre>";return I?Promise.resolve(A):A}if(I)return Promise.reject(g);throw g}}},Zl=new K1;function gI(C,I){return Zl.parse(C,I)}gI.options=gI.setOptions=function(C){return Zl.setOptions(C),gI.defaults=Zl.defaults,kB(gI.defaults),gI},gI.getDefaults=Hs,gI.defaults=dl;function F1(...C){return Zl.use(...C),gI.defaults=Zl.defaults,kB(gI.defaults),gI}gI.use=F1,gI.walkTokens=function(C,I){return Zl.walkTokens(C,I)},gI.parseInline=Zl.parseInline,gI.Parser=iA,gI.parser=iA.parse,gI.Renderer=xt,gI.TextRenderer=zs,gI.Lexer=AA,gI.lexer=AA.lex,gI.Tokenizer=Lt,gI.Hooks=ba,gI.parse=gI,gI.options,gI.setOptions,gI.walkTokens,gI.parseInline,iA.parse,AA.lex;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function AW(C,I){(I==null||I>C.length)&&(I=C.length);for(var g=0,A=Array(I);g<I;g++)A[g]=C[g];return A}function v1(C){if(Array.isArray(C))return C}function J1(C,I){var g=C==null?null:typeof Symbol<"u"&&C[Symbol.iterator]||C["@@iterator"];if(g!=null){var A,i,l,e,c=[],a=!0,d=!1;try{if(l=(g=g.call(C)).next,I!==0)for(;!(a=(A=l.call(g)).done)&&(c.push(A.value),c.length!==I);a=!0);}catch(t){d=!0,i=t}finally{try{if(!a&&g.return!=null&&(e=g.return(),Object(e)!==e))return}finally{if(d)throw i}}return c}}function z1(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
70
70
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k1(C,I){return v1(C)||J1(C,I)||L1(C,I)||z1()}function L1(C,I){if(C){if(typeof C=="string")return AW(C,I);var g={}.toString.call(C).slice(8,-1);return g==="Object"&&C.constructor&&(g=C.constructor.name),g==="Map"||g==="Set"?Array.from(C):g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g)?AW(C,I):void 0}}const iW=Object.entries,lW=Object.setPrototypeOf,x1=Object.isFrozen,T1=Object.getPrototypeOf,f1=Object.getOwnPropertyDescriptor;let VI=Object.freeze,SI=Object.seal,ve=Object.create,eW=typeof Reflect<"u"&&Reflect,ks=eW.apply,Ls=eW.construct;VI||(VI=function(I){return I}),SI||(SI=function(I){return I}),ks||(ks=function(I,g){for(var A=arguments.length,i=new Array(A>2?A-2:0),l=2;l<A;l++)i[l-2]=arguments[l];return I.apply(g,i)}),Ls||(Ls=function(I){for(var g=arguments.length,A=new Array(g>1?g-1:0),i=1;i<g;i++)A[i-1]=arguments[i];return new I(...A)});const ol=BI(Array.prototype.forEach),j1=BI(Array.prototype.lastIndexOf),cW=BI(Array.prototype.pop),Ga=BI(Array.prototype.push),Q1=BI(Array.prototype.splice),Je=Array.isArray,ha=BI(String.prototype.toLowerCase),xs=BI(String.prototype.toString),aW=BI(String.prototype.match),ra=BI(String.prototype.replace),dW=BI(String.prototype.indexOf),U1=BI(String.prototype.trim),O1=BI(Number.prototype.toString),E1=BI(Boolean.prototype.toString),tW=typeof BigInt>"u"?null:BI(BigInt.prototype.toString),ZW=typeof Symbol>"u"?null:BI(Symbol.prototype.toString),ZC=BI(Object.prototype.hasOwnProperty),ua=BI(Object.prototype.toString),TI=BI(RegExp.prototype.test),nl=P1(TypeError);function BI(C){return function(I){I instanceof RegExp&&(I.lastIndex=0);for(var g=arguments.length,A=new Array(g>1?g-1:0),i=1;i<g;i++)A[i-1]=arguments[i];return ks(C,I,A)}}function P1(C){return function(){for(var I=arguments.length,g=new Array(I),A=0;A<I;A++)g[A]=arguments[A];return Ls(C,g)}}function Qg(C,I){let g=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ha;if(lW&&lW(C,null),!Je(I))return C;let A=I.length;for(;A--;){let i=I[A];if(typeof i=="string"){const l=g(i);l!==i&&(x1(I)||(I[A]=l),i=l)}C[i]=!0}return C}function _1(C){for(let I=0;I<C.length;I++)ZC(C,I)||(C[I]=null);return C}function uC(C){const I=ve(null);for(const A of iW(C)){var g=k1(A,2);const i=g[0],l=g[1];ZC(C,i)&&(Je(l)?I[i]=_1(l):l&&typeof l=="object"&&l.constructor===Object?I[i]=uC(l):I[i]=l)}return I}function q1(C){switch(typeof C){case"string":return C;case"number":return O1(C);case"boolean":return E1(C);case"bigint":return tW?tW(C):"0";case"symbol":return ZW?ZW(C):"Symbol()";case"undefined":return ua(C);case"function":case"object":{if(C===null)return ua(C);const I=C,g=lA(I,"toString");if(typeof g=="function"){const A=g(I);return typeof A=="string"?A:ua(A)}return ua(C)}default:return ua(C)}}function lA(C,I){for(;C!==null;){const A=f1(C,I);if(A){if(A.get)return BI(A.get);if(typeof A.value=="function")return BI(A.value)}C=T1(C)}function g(){return null}return g}function $1(C){try{return TI(C,""),!0}catch{return!1}}const oW=VI(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Ts=VI(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),fs=VI(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),g3=VI(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),js=VI(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),I3=VI(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),nW=VI(["#text"]),sW=VI(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Qs=VI(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mW=VI(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Tt=VI(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),C3=SI(/{{[\w\W]*|^[\w\W]*}}/g),A3=SI(/<%[\w\W]*|^[\w\W]*%>/g),i3=SI(/\${[\w\W]*/g),l3=SI(/^data-[\-\w.\u00B7-\uFFFF]+$/),e3=SI(/^aria-[\-\w]+$/),bW=SI(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),c3=SI(/^(?:\w+script|data):/i),a3=SI(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),d3=SI(/^html$/i),t3=SI(/^[a-z][.\w]*(-[.\w]+)+$/i),GW=SI(/<[/\w!]/g),hW=SI(/<[/\w]/g),Z3=SI(/<\/no(script|embed|frames)/i),o3=SI(/\/>/i),BC={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},rW=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],n3=VI(Qg({},rW)),s3=(function(){const C={};return ol(rW,I=>{C[I]=SI(new RegExp("</"+I+"(?=[\\t\\n\\f\\r />])","i"))}),VI(C)})(),m3=function(){return typeof window>"u"?null:window},b3=function(I,g){if(typeof I!="object"||typeof I.createPolicy!="function")return null;let A=null;const i="data-tt-policy-suffix";g&&g.hasAttribute(i)&&(A=g.getAttribute(i));const l="dompurify"+(A?"#"+A:"");try{return I.createPolicy(l,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn("TrustedTypes policy "+l+" could not be created."),null}},uW=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},ri=function(I,g,A,i){return ZC(I,g)&&Je(I[g])?Qg(i.base?uC(i.base):{},I[g],i.transform):A},Us=function(I,g,A){const i=ZC(I,g)?I[g]:void 0;return i&&typeof i=="object"?uC(i):A()};function BW(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:m3();const I=$=>BW($);if(I.version="3.4.14",I.removed=[],!C||!C.document||C.document.nodeType!==BC.document||!C.Element)return I.isSupported=!1,I;let g=C.document;const A=g,i=A.currentScript;C.DocumentFragment;const l=C.HTMLTemplateElement,e=C.Node,c=C.Element,a=C.NodeFilter,d=C.NamedNodeMap;d===void 0&&(C.NamedNodeMap||C.MozNamedAttrMap),C.HTMLFormElement;const t=C.DOMParser,Z=C.trustedTypes,o=c.prototype,n=lA(o,"cloneNode"),s=lA(o,"remove"),b=lA(o,"nextSibling"),G=lA(o,"childNodes"),h=lA(o,"parentNode"),r=lA(o,"shadowRoot"),u=lA(o,"attributes"),B=e&&e.prototype?lA(e.prototype,"nodeType"):null,Y=e&&e.prototype?lA(e.prototype,"nodeName"):null,W=e&&e.prototype?lA(e.prototype,"ownerDocument"):null,w=function(D){return B?B(D):D.nodeType},N=function(D){return Y?Y(D):D.nodeName};if(typeof l=="function"){const $=g.createElement("template");$.content&&$.content.ownerDocument&&(g=$.content.ownerDocument)}let V,y="",p,R=!1,H=0;const S=function(){if(H>0)throw nl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(D){S(),H++;try{return V.createHTML(D)}finally{H--}},K=function(D){S(),H++;try{return V.createScriptURL(D)}finally{H--}},J=function(){return R||(p=b3(Z,i),R=!0),p},F=g,z=F.implementation,f=F.createNodeIterator,j=F.createDocumentFragment,E=F.getElementsByTagName,ig=A.importNode;let _=uW();I.isSupported=typeof iW=="function"&&typeof h=="function"&&z&&z.createHTMLDocument!==void 0;const sg=C3,fg=A3,eI=i3,Yg=l3,dg=e3,Vg=c3,Cg=a3,mg=t3;let Eg=bW,hg=null;const jg=Qg({},[...oW,...Ts,...fs,...js,...nW]);let Ng=null;const ZI=Qg({},[...sW,...Qs,...mW,...Tt]);let aI=Object.seal(ve(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wI=null,QA=null;const LI=Object.seal(ve(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let Vt=!0,pe=!0,w5=!1,V5=!0,el=!1,Xe=!0,Re=!1,Mu=!1,ls=null,es=null,Du=!1,ia=!1,cs=!1,as=!1,N5=!0,y5=!1;const p5="user-content-";let Ku=!0,Fu=!1,la={},ea=null;const X5=Qg({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let R5=null;const H5=Qg({},["audio","video","img","source","image","track"]);let S5=null;const M5=Qg({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ds="http://www.w3.org/1998/Math/MathML",ts="http://www.w3.org/2000/svg",UA="http://www.w3.org/1999/xhtml";let ca=UA,vu=!1,Ju=null;const Yeg=Qg({},[ds,ts,UA],xs),D5=VI(["mi","mo","mn","ms","mtext"]);let zu=Qg({},D5);const K5=VI(["annotation-xml"]);let ku=Qg({},K5);const weg=Qg({},["title","style","font","a","script"]);let Nt=null;const Veg=["application/xhtml+xml","text/html"],Neg="text/html";let uI=null,aa=null;const yeg=g.createElement("form"),F5=function(D){return D instanceof RegExp||D instanceof Function},Lu=function(){let D=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(aa&&aa===D)return;(!D||typeof D!="object")&&(D={}),D=uC(D),Nt=Veg.indexOf(D.PARSER_MEDIA_TYPE)===-1?Neg:D.PARSER_MEDIA_TYPE,uI=Nt==="application/xhtml+xml"?xs:ha,hg=ri(D,"ALLOWED_TAGS",jg,{transform:uI}),Ng=ri(D,"ALLOWED_ATTR",ZI,{transform:uI}),Ju=ri(D,"ALLOWED_NAMESPACES",Yeg,{transform:xs}),S5=ri(D,"ADD_URI_SAFE_ATTR",M5,{transform:uI,base:M5}),R5=ri(D,"ADD_DATA_URI_TAGS",H5,{transform:uI,base:H5}),ea=ri(D,"FORBID_CONTENTS",X5,{transform:uI}),wI=ri(D,"FORBID_TAGS",uC({}),{transform:uI}),QA=ri(D,"FORBID_ATTR",uC({}),{transform:uI}),la=ZC(D,"USE_PROFILES")?D.USE_PROFILES&&typeof D.USE_PROFILES=="object"?uC(D.USE_PROFILES):D.USE_PROFILES:!1,Vt=D.ALLOW_ARIA_ATTR!==!1,pe=D.ALLOW_DATA_ATTR!==!1,w5=D.ALLOW_UNKNOWN_PROTOCOLS||!1,V5=D.ALLOW_SELF_CLOSE_IN_ATTR!==!1,el=D.SAFE_FOR_TEMPLATES||!1,Xe=D.SAFE_FOR_XML!==!1,Re=D.WHOLE_DOCUMENT||!1,ia=D.RETURN_DOM||!1,cs=D.RETURN_DOM_FRAGMENT||!1,as=D.RETURN_TRUSTED_TYPE||!1,Du=D.FORCE_BODY||!1,N5=D.SANITIZE_DOM!==!1,y5=D.SANITIZE_NAMED_PROPS||!1,Ku=D.KEEP_CONTENT!==!1,Fu=D.IN_PLACE||!1,Eg=$1(D.ALLOWED_URI_REGEXP)?D.ALLOWED_URI_REGEXP:bW,ca=typeof D.NAMESPACE=="string"?D.NAMESPACE:UA,zu=Us(D,"MATHML_TEXT_INTEGRATION_POINTS",()=>Qg({},D5)),ku=Us(D,"HTML_INTEGRATION_POINTS",()=>Qg({},K5));const k=Us(D,"CUSTOM_ELEMENT_HANDLING",()=>ve(null));if(aI=ve(null),ZC(k,"tagNameCheck")&&F5(k.tagNameCheck)&&(aI.tagNameCheck=k.tagNameCheck),ZC(k,"attributeNameCheck")&&F5(k.attributeNameCheck)&&(aI.attributeNameCheck=k.attributeNameCheck),ZC(k,"allowCustomizedBuiltInElements")&&typeof k.allowCustomizedBuiltInElements=="boolean"&&(aI.allowCustomizedBuiltInElements=k.allowCustomizedBuiltInElements),SI(aI),el&&(pe=!1),cs&&(ia=!0),la&&(hg=Qg({},nW),Ng=ve(null),la.html===!0&&(Qg(hg,oW),Qg(Ng,sW)),la.svg===!0&&(Qg(hg,Ts),Qg(Ng,Qs),Qg(Ng,Tt)),la.svgFilters===!0&&(Qg(hg,fs),Qg(Ng,Qs),Qg(Ng,Tt)),la.mathMl===!0&&(Qg(hg,js),Qg(Ng,mW),Qg(Ng,Tt))),LI.tagCheck=null,LI.attributeCheck=null,ZC(D,"ADD_TAGS")&&(typeof D.ADD_TAGS=="function"?LI.tagCheck=D.ADD_TAGS:Je(D.ADD_TAGS)&&(hg===jg&&(hg=uC(hg)),Qg(hg,D.ADD_TAGS,uI))),ZC(D,"ADD_ATTR")&&(typeof D.ADD_ATTR=="function"?LI.attributeCheck=D.ADD_ATTR:Je(D.ADD_ATTR)&&(Ng===ZI&&(Ng=uC(Ng)),Qg(Ng,D.ADD_ATTR,uI))),ZC(D,"ADD_FORBID_CONTENTS")&&Je(D.ADD_FORBID_CONTENTS)&&(ea===X5&&(ea=uC(ea)),Qg(ea,D.ADD_FORBID_CONTENTS,uI)),Ku&&(hg["#text"]=!0),Re&&Qg(hg,["html","head","body"]),hg.table&&(Qg(hg,["tbody"]),delete wI.tbody),D.TRUSTED_TYPES_POLICY){if(typeof D.TRUSTED_TYPES_POLICY.createHTML!="function")throw nl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof D.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw nl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const U=V;V=D.TRUSTED_TYPES_POLICY;try{y=M("")}catch(ag){throw V=U,ag}}else D.TRUSTED_TYPES_POLICY===null?(V=void 0,y=""):(V===void 0&&(V=J()),V&&typeof y=="string"&&(y=M("")));VI&&VI(D),aa=D},v5=Qg({},[...Ts,...fs,...g3]),J5=Qg({},[...js,...I3]),peg=function(D,k,U){return k.namespaceURI===UA?D==="svg":k.namespaceURI===ds?D==="svg"&&(U==="annotation-xml"||zu[U]):!!v5[D]},Xeg=function(D,k,U){return k.namespaceURI===UA?D==="math":k.namespaceURI===ts?D==="math"&&ku[U]:!!J5[D]},Reg=function(D,k,U){return k.namespaceURI===ts&&!ku[U]||k.namespaceURI===ds&&!zu[U]?!1:!J5[D]&&(weg[D]||!v5[D])},Heg=function(D){let k=h(D);(!k||!k.tagName)&&(k={namespaceURI:ca,tagName:"template"});const U=ha(D.tagName),ag=ha(k.tagName);return Ju[D.namespaceURI]?D.namespaceURI===ts?peg(U,k,ag):D.namespaceURI===ds?Xeg(U,k,ag):D.namespaceURI===UA?Reg(U,k,ag):!!(Nt==="application/xhtml+xml"&&Ju[D.namespaceURI]):!1},cl=function(D){Ga(I.removed,{element:D});try{h(D).removeChild(D)}catch{if(s(D),!h(D))throw nl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},z5=function(D,k,U){try{D.removeAttributeNode(k)}catch{try{D.removeAttribute(U)}catch{}}},Zs=function(D){os(D);const k=G(D);if(k){const ag=[];ol(k,rg=>{Ga(ag,rg)}),ol(ag,rg=>{try{s(rg)}catch{}})}const U=u(D);if(U)for(let ag=U.length-1;ag>=0;--ag){const rg=U[ag],Sg=rg&&rg.name;typeof Sg=="string"&&z5(D,rg,Sg)}},He=function(D,k,U){if(!U)try{U=k.getAttributeNode(D)}catch{U=null}Ga(I.removed,{attribute:U||null,from:k});try{U?k.removeAttributeNode(U):k.removeAttribute(D)}catch{try{k.removeAttribute(D)}catch{}}if(D==="is")if(ia||cs)try{cl(k)}catch{}else try{k.setAttribute(D,"")}catch{}},Seg=function(D){const k=u(D);if(k)for(let U=k.length-1;U>=0;--U){const ag=k[U],rg=ag&&ag.name;typeof rg!="string"||Ng[uI(rg)]||z5(D,ag,rg)}},os=function(D){const k=[D];for(;k.length>0;){const U=k.pop();w(U)===BC.element&&Seg(U);const rg=G(U);if(rg)for(let Sg=rg.length-1;Sg>=0;--Sg)k.push(rg[Sg])}},k5=function(D,k){return Xe?D==="patchsrc"?!0:D==="for"&&k!=="label"&&k!=="output":!1},Meg=function(D){if(!Xe)return;const k=[D];for(;k.length>0;){const U=k.pop(),ag=w(U);if(ag===BC.processingInstruction||ag===BC.comment&&TI(hW,U.data)){try{s(U)}catch{}continue}if(ag===BC.element){const Sg=U,AI=uI(N(U));try{Sg.hasAttribute&&Sg.hasAttribute("patchsrc")&&Sg.removeAttribute("patchsrc"),Sg.hasAttribute&&Sg.hasAttribute("for")&&k5("for",AI)&&Sg.removeAttribute("for")}catch{}}const rg=G(U);if(rg)for(let Sg=rg.length-1;Sg>=0;--Sg)k.push(rg[Sg])}},L5=function(D){let k=null,U=null;if(Du)D="<remove></remove>"+D;else{const Sg=aW(D,/^[\r\n\t ]+/);U=Sg&&Sg[0]}Nt==="application/xhtml+xml"&&ca===UA&&(D='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+D+"</body></html>");const ag=V?M(D):D;if(ca===UA)try{k=new t().parseFromString(ag,Nt)}catch{}if(!k||!k.documentElement){k=z.createDocument(ca,"template",null);try{k.documentElement.innerHTML=vu?y:ag}catch{}}const rg=k.body||k.documentElement;return D&&U&&rg.insertBefore(g.createTextNode(U),rg.childNodes[0]||null),ca===UA?E.call(k,Re?"html":"body")[0]:Re?k.documentElement:rg},x5=function(D){const k=W?W(D):D.ownerDocument;return f.call(k||D,D,a.SHOW_ELEMENT|a.SHOW_COMMENT|a.SHOW_TEXT|a.SHOW_PROCESSING_INSTRUCTION|a.SHOW_CDATA_SECTION,null)},ns=function(D){return D=ra(D,sg," "),D=ra(D,fg," "),D=ra(D,eI," "),D},xu=function(D){var k;D.normalize();const U=W?W(D):D.ownerDocument,ag=f.call(U||D,D,a.SHOW_TEXT|a.SHOW_COMMENT|a.SHOW_CDATA_SECTION|a.SHOW_PROCESSING_INSTRUCTION,null);let rg=ag.nextNode();for(;rg;)rg.data=ns(rg.data),rg=ag.nextNode();const Sg=(k=D.querySelectorAll)===null||k===void 0?void 0:k.call(D,"template");Sg&&ol(Sg,AI=>{da(AI.content)&&xu(AI.content)})},ss=function(D){const k=Y?Y(D):null;return typeof k!="string"||uI(k)!=="form"?!1:typeof D.nodeName!="string"||typeof D.textContent!="string"||typeof D.removeChild!="function"||D.attributes!==u(D)||typeof D.removeAttribute!="function"||typeof D.setAttribute!="function"||typeof D.namespaceURI!="string"||typeof D.insertBefore!="function"||typeof D.hasChildNodes!="function"||D.nodeType!==B(D)||D.childNodes!==G(D)},da=function(D){if(!B||typeof D!="object"||D===null)return!1;try{return B(D)===BC.documentFragment}catch{return!1}},yt=function(D){if(!B||typeof D!="object"||D===null)return!1;try{return typeof B(D)=="number"}catch{return!1}};function OA($,D,k){$.length!==0&&ol($,U=>{U.call(I,D,k,aa)})}const Deg=function(D,k){return!!(Xe&&D.hasChildNodes()&&!yt(D.firstElementChild)&&TI(GW,D.textContent)&&TI(GW,D.innerHTML)||Xe&&D.namespaceURI===UA&&n3[k]&&(yt(D.firstElementChild)||typeof D.textContent=="string"&&TI(s3[k],D.textContent))||D.nodeType===BC.processingInstruction||Xe&&D.nodeType===BC.comment&&TI(hW,D.data))},ms=function(D,k){if(D instanceof RegExp)return TI(D,k);if(D instanceof Function){for(var U=arguments.length,ag=new Array(U>2?U-2:0),rg=2;rg<U;rg++)ag[rg-2]=arguments[rg];return!!D(k,...ag)}return!1},Keg=function(D,k,U){if(!wI[k]&&U5(k)&&ms(aI.tagNameCheck,k))return!1;if(Ku&&!ea[k]){const ag=h(D),rg=G(D);if(rg&&ag){const Sg=rg.length;for(let AI=Sg-1;AI>=0;--AI){const oI=D===U?n(rg[AI],!0):rg[AI];ag.insertBefore(oI,b(D))}}}return cl(D),!0},T5=function(D,k,U,ag){return D.length===0?k:k===U||k===ag?uC(k):k},f5=function(D,k){return D===k||h(D)!==null?!1:(Fu&&os(D),!0)},j5=function(D,k){if(OA(_.beforeSanitizeElements,D,null),f5(D,k))return!0;if(ss(D))return cl(D),!0;const U=uI(N(D));if(hg=T5(_.uponSanitizeElement,hg,jg,ls),OA(_.uponSanitizeElement,D,{tagName:U,allowedTags:hg}),f5(D,k))return!0;if(Deg(D,U))return cl(D),!0;if(wI[U]||!(LI.tagCheck instanceof Function&&LI.tagCheck(U))&&!hg[U]){const rg=Keg(D,U,k);return rg===!1&&OA(_.afterSanitizeElements,D,null),rg}if(w(D)===BC.element&&!Heg(D)||(U==="noscript"||U==="noembed"||U==="noframes")&&TI(Z3,D.innerHTML))return cl(D),!0;if(el&&D.nodeType===BC.text){const rg=ns(D.textContent);D.textContent!==rg&&(Ga(I.removed,{element:D.cloneNode()}),D.textContent=rg)}return OA(_.afterSanitizeElements,D,null),!1},Q5=function(D,k,U){if(QA[k]||k5(k,D)||N5&&(k==="id"||k==="name")&&(U in g||U in yeg))return!1;const ag=Ng[k]||LI.attributeCheck instanceof Function&&LI.attributeCheck(k,D);return pe&&TI(Yg,k)||Vt&&TI(dg,k)?!0:ag?S5[k]||TI(Eg,ra(U,Cg,""))||(k==="src"||k==="xlink:href"||k==="href")&&D!=="script"&&dW(U,"data:")===0&&R5[D]||w5&&!TI(Vg,ra(U,Cg,""))?!0:!U:U5(D)&&ms(aI.tagNameCheck,D)&&ms(aI.attributeNameCheck,k,D)||k==="is"&&aI.allowCustomizedBuiltInElements&&ms(aI.tagNameCheck,U)},Feg=Qg({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),U5=function(D){return!Feg[ha(D)]&&TI(mg,D)},veg=function(D,k,U,ag){if(V&&typeof Z=="object"&&typeof Z.getAttributeType=="function"&&!U)switch(Z.getAttributeType(D,k)){case"TrustedHTML":return M(ag);case"TrustedScriptURL":return K(ag)}return ag},Jeg=function(D,k,U,ag){try{U?D.setAttributeNS(U,k,ag):D.setAttribute(k,ag),ss(D)?cl(D):cW(I.removed)}catch{He(k,D)}},O5=function(D){OA(_.beforeSanitizeAttributes,D,null);const k=D.attributes;if(!k||ss(D))return;Ng=T5(_.uponSanitizeAttribute,Ng,ZI,es);const U={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Ng,forceKeepAttr:void 0};let ag=k.length;const rg=uI(D.nodeName);for(;ag--;){const Sg=k[ag],AI=Sg.name,oI=Sg.namespaceURI,hC=Sg.value,rC=uI(AI),fu=hC;let tC=AI==="value"?fu:U1(fu);if(U.attrName=rC,U.attrValue=tC,U.keepAttr=!0,U.forceKeepAttr=void 0,OA(_.uponSanitizeAttribute,D,U),tC=U.attrValue,y5&&(rC==="id"||rC==="name")&&dW(tC,p5)!==0&&(He(AI,D,Sg),tC=p5+tC),Xe&&TI(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,tC)){He(AI,D,Sg);continue}if(rC==="attributename"&&aW(tC,"href")){He(AI,D,Sg);continue}if(!U.forceKeepAttr){if(!U.keepAttr){He(AI,D,Sg);continue}if(!V5&&TI(o3,tC)){He(AI,D,Sg);continue}if(el&&(tC=ns(tC)),!Q5(rg,rC,tC)){He(AI,D,Sg);continue}tC=veg(rg,rC,oI,tC),tC!==fu&&Jeg(D,AI,oI,tC)}}OA(_.afterSanitizeAttributes,D,null)},bs=function(D){let k=null;const U=x5(D);for(OA(_.beforeSanitizeShadowDOM,D,null);k=U.nextNode();)if(OA(_.uponSanitizeShadowNode,k,null),j5(k,D),O5(k),da(k.content)&&bs(k.content),w(k)===BC.element){const ag=r(k);da(ag)&&(Tu(ag),bs(ag))}OA(_.afterSanitizeShadowDOM,D,null)},Tu=function(D){const k=[{node:D,shadow:null}];for(;k.length>0;){const U=k.pop();if(U.shadow){bs(U.shadow);continue}const ag=U.node,Sg=w(ag)===BC.element,AI=G(ag);if(AI)for(let oI=AI.length-1;oI>=0;--oI)k.push({node:AI[oI],shadow:null});if(Sg){const oI=Y?Y(ag):null;if(typeof oI=="string"&&uI(oI)==="template"){const hC=ag.content;da(hC)&&k.push({node:hC,shadow:null})}}if(Sg){const oI=r(ag);da(oI)&&k.push({node:null,shadow:oI},{node:oI,shadow:null})}}};return I.sanitize=function($){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=null,U=null,ag=null,rg=null;if(vu=!$,vu&&($="<!-->"),typeof $!="string"&&!yt($)&&($=q1($),typeof $!="string"))throw nl("dirty is not a string, aborting");if(!I.isSupported)return $;Mu?(hg=ls,Ng=es):Lu(D),(_.uponSanitizeElement.length>0||_.uponSanitizeAttribute.length>0)&&(hg=uC(hg)),_.uponSanitizeAttribute.length>0&&(Ng=uC(Ng)),I.removed=[];const Sg=Fu&&typeof $!="string"&&yt($);if(Sg){Meg($);const hC=N($);if(typeof hC=="string"){const rC=uI(hC);if(!hg[rC]||wI[rC])throw Zs($),nl("root node is forbidden and cannot be sanitized in-place")}if(ss($))throw Zs($),nl("root node is clobbered and cannot be sanitized in-place");try{Tu($)}catch(rC){throw Zs($),rC}}else if(yt($))k=L5("<!---->"),U=k.ownerDocument.importNode($,!0),U.nodeType===BC.element&&U.nodeName==="BODY"||U.nodeName==="HTML"?k=U:k.appendChild(U),Tu(U);else{if(!ia&&!el&&!Re&&$.indexOf("<")===-1)return V&&as?M($):$;if(k=L5($),!k)return ia?null:as?y:""}k&&Du&&cl(k.firstChild);const AI=Sg?$:k;try{const hC=x5(AI);for(;ag=hC.nextNode();)j5(ag,AI),O5(ag),da(ag.content)&&bs(ag.content)}catch(hC){throw Sg&&(Zs($),ol(I.removed,rC=>{rC.element&&os(rC.element)})),hC}if(Sg)return ol(I.removed,hC=>{hC.element&&os(hC.element)}),el&&xu($),$;if(ia){if(el&&xu(k),cs)for(rg=j.call(k.ownerDocument);k.firstChild;)rg.appendChild(k.firstChild);else rg=k;return(Ng.shadowroot||Ng.shadowrootmode)&&(rg=ig.call(A,rg,!0)),rg}let oI=Re?k.outerHTML:k.innerHTML;return Re&&hg["!doctype"]&&k.ownerDocument&&k.ownerDocument.doctype&&k.ownerDocument.doctype.name&&TI(d3,k.ownerDocument.doctype.name)&&(oI="<!DOCTYPE "+k.ownerDocument.doctype.name+`>
|
|
71
|
-
`+oI),el&&(oI=ns(oI)),V&&as?M(oI):oI},I.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lu($),Mu=!0,ls=hg,es=Ng},I.clearConfig=function(){aa=null,Mu=!1,ls=null,es=null,V=p,y=""},I.isValidAttribute=function($,D,k){aa||Lu({});const U=uI($),ag=uI(D);return Q5(U,ag,k)},I.addHook=function($,D){typeof D=="function"&&ZC(_,$)&&Ga(_[$],D)},I.removeHook=function($,D){if(ZC(_,$)){if(D!==void 0){const k=j1(_[$],D);return k===-1?void 0:Q1(_[$],k,1)[0]}return cW(_[$])}},I.removeHooks=function($){ZC(_,$)&&(_[$]=[])},I.removeAllHooks=function(){_=uW()},I}var Os=BW();const ft=typeof Os.sanitize=="function"?Os:Os.default;function G3(C){const I=C.trim();if(!I)return!1;const g=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return I.length<100&&g.some(A=>A.test(I))}function WW(C){if(!C)return[{type:"text",content:""}];const I=[],g=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let A=0,i,l=!1;for(;(i=g.exec(C))!==null;){const a=C.slice(A,i.index);if(a.trim()&&I.push({type:"text",content:a}),i[0].startsWith("<schema>"))I.push({type:"code",content:(i[4]||"").trim(),language:"json"}),l=!0;else if(i[1]!==void 0){const d=(i[1]||"text").trim()||"text",t=(i[2]||"").replace(/^\n/,"").replace(/\n$/,"");YW(I,d,t)}else YW(I,"text",(i[3]||"").trim());A=i.index+i[0].length}const e=C.slice(A);e.trim()&&(l&&G3(e)||I.push({type:"text",content:e}));const c=I.filter((a,d)=>a.type!=="text"||a.content.trim()?!0:d>0&&d<I.length-1);return c.length?c:[{type:"text",content:C}]}function YW(C,I,g){if(I.startsWith("artifact:")){const A=I.slice(9);C.push({type:"artifact",content:g,language:A,artifactType:A});return}C.push({type:"code",content:g,language:I})}function wW(C){if(!C)return"";const g=gI.parse(C,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>");return typeof window>"u"||typeof(ft==null?void 0:ft.sanitize)!="function"?g:ft.sanitize(g,{ADD_ATTR:["class"]})}const h3={class:"apf-message-parts"},r3=["innerHTML"],u3={class:"apf-artifact-head"},B3={class:"apf-artifact-badge"},W3={class:"apf-part-actions"},Y3=["onClick"],w3=["onClick"],V3={class:"apf-code-block"},N3={class:"apf-code-head"},y3={class:"apf-code-lang"},p3={class:"apf-part-actions"},X3=["onClick"],R3=["onClick"],H3={class:"apf-code-block"},VW=bg(m.defineComponent({__name:"MessageParts",props:{content:{}},setup(C){const I=C,g=m.computed(()=>WW(I.content||"").map(A));function A(a){if(!((a.language||"").toLowerCase()==="json"||a.artifactType==="json"||i(a.content)))return{...a,display:a.content,isJson:!1};try{const Z=JSON.parse(a.content);return{...a,language:a.language||"json",display:JSON.stringify(Z,null,2),isJson:!0}}catch{return{...a,display:a.content,isJson:!1}}}function i(a){const d=a.trim();return d.startsWith("{")&&d.endsWith("}")||d.startsWith("[")&&d.endsWith("]")}function l(a){return a.type==="artifact"?a.artifactType||"artifact":a.isJson?"json":a.language&&a.language!=="text"?a.language:"code"}function e(a){var d;a&&((d=navigator.clipboard)==null||d.writeText(a))}function c(a){const d=a.isJson||a.language==="json"?"json":a.language&&a.language!=="text"?a.language.replace(/[^a-z0-9]+/gi,""):"txt",t=new Blob([a.display],{type:"text/plain;charset=utf-8"}),Z=URL.createObjectURL(t),o=document.createElement("a");o.href=Z,o.download=`result.${d||"txt"}`,o.click(),URL.revokeObjectURL(Z)}return(a,d)=>(m.openBlock(),m.createElementBlock("div",h3,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(g.value,(t,Z)=>(m.openBlock(),m.createElementBlock(m.Fragment,{key:Z},[t.type==="text"?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-md-block",innerHTML:m.unref(wW)(t.content)},null,8,r3)):t.type==="artifact"?(m.openBlock(),m.createElementBlock("div",{key:1,class:m.normalizeClass(["apf-artifact-card",{"apf-json":t.isJson}])},[m.createElementVNode("div",u3,[m.createElementVNode("span",B3,"工件 · "+m.toDisplayString(l(t)),1),m.createElementVNode("div",W3,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:o=>e(t.display)},[...d[0]||(d[0]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Y3),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:o=>c(t)},[...d[1]||(d[1]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,w3)])]),m.createElementVNode("pre",V3,[m.createElementVNode("code",null,m.toDisplayString(t.display),1)])],2)):(m.openBlock(),m.createElementBlock("div",{key:2,class:m.normalizeClass(["apf-code-wrap",{"apf-json":t.isJson}])},[m.createElementVNode("div",N3,[m.createElementVNode("span",y3,m.toDisplayString(l(t)),1),m.createElementVNode("div",p3,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:o=>e(t.display)},[...d[2]||(d[2]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,X3),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:o=>c(t)},[...d[3]||(d[3]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,R3)])]),m.createElementVNode("pre",H3,[m.createElementVNode("code",null,m.toDisplayString(t.display),1)])],2))],64))),128))]))}}),[["__scopeId","data-v-ed1039e3"]]),S3={key:0,class:"apf-att-list"},M3=["aria-label","onClick"],D3=["src","alt"],K3=["aria-label","onClick"],F3={class:"apf-att-badge","aria-hidden":"true"},v3={class:"apf-att-meta"},J3={key:0},NW=bg(m.defineComponent({__name:"MessageAttachmentList",props:{attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=m.computed(()=>g.attachments.filter(al)),l=m.computed(()=>g.attachments.filter(c=>!al(c)));function e(c){A("preview",c)}return(c,a)=>{var d;return(d=C.attachments)!=null&&d.length?(m.openBlock(),m.createElementBlock("div",S3,[i.value.length?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["apf-image-grid",{"apf-multi":i.value.length>1}])},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:"apf-att-image","aria-label":`预览图片 ${t.filename}`,onClick:Z=>e(t)},[m.createElementVNode("img",{src:t.url,alt:t.filename,loading:"lazy"},null,8,D3)],8,M3))),128))],2)):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(l.value,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:"apf-att-file","aria-label":`${m.unref(De)(t)?"预览":m.unref(ps)(t)?"查看":"打开"} ${t.filename}`,onClick:Z=>e(t)},[m.createElementVNode("span",F3,m.toDisplayString(m.unref(Ft)(t)),1),m.createElementVNode("span",v3,[m.createElementVNode("strong",null,m.toDisplayString(t.filename),1),m.createElementVNode("small",null,[t.size?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createTextVNode(m.toDisplayString(m.unref(vt)(t.size)),1)],64)):m.createCommentVNode("",!0),m.unref(De)(t)?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createTextVNode(" · 点击预览")],64)):m.unref(ps)(t)?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createTextVNode(" · 点击查看")],64)):(m.openBlock(),m.createElementBlock(m.Fragment,{key:3},[m.createTextVNode(" · 点击打开")],64))]),t.excerpt?(m.openBlock(),m.createElementBlock("em",J3,m.toDisplayString(t.excerpt),1)):m.createCommentVNode("",!0)])],8,K3))),128))])):m.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a604161c"]]),z3={key:0,class:"apf-doc-list"},k3=["role","tabindex","aria-label","onClick","onKeydown"],L3={class:"apf-doc-body"},x3={class:"apf-doc-name"},T3={class:"apf-doc-summary"},f3={key:0,class:"apf-doc-meta"},j3={key:1,class:"apf-doc-hint"},yW=bg(m.defineComponent({__name:"DocumentSummaryList",props:{summaries:{},attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I;function i(c){var d;if(!((d=g.attachments)!=null&&d.length))return null;if(c.attachmentId){const t=g.attachments.find(Z=>Z.id===c.attachmentId);if(t)return t}const a=(c.filename||"").toLowerCase();return g.attachments.find(t=>(t.filename||"").toLowerCase()===a)||null}function l(c){const a=i(c);a&&A("preview",a)}function e(c){return i(c)!==null}return(c,a)=>{var d;return(d=C.summaries)!=null&&d.length?(m.openBlock(),m.createElementBlock("div",z3,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.summaries,t=>(m.openBlock(),m.createElementBlock("article",{key:t.documentId,class:m.normalizeClass(["apf-doc-card",{"apf-clickable":e(t)}]),role:e(t)?"button":void 0,tabindex:e(t)?0:void 0,"aria-label":e(t)?`预览 ${t.filename}`:void 0,onClick:Z=>l(t),onKeydown:[m.withKeys(Z=>l(t),["enter"]),m.withKeys(m.withModifiers(Z=>l(t),["prevent"]),["space"])]},[a[0]||(a[0]=m.createElementVNode("div",{class:"apf-doc-icon","aria-hidden":"true"},[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M4 2.5h5.2L12 5.3V13.5H4V2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),m.createElementVNode("path",{d:"M9.2 2.5V5.3H12",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})])],-1)),m.createElementVNode("div",L3,[m.createElementVNode("strong",x3,m.toDisplayString(t.filename),1),m.createElementVNode("p",T3,m.toDisplayString(t.summary),1),t.pageCount?(m.openBlock(),m.createElementBlock("span",f3,m.toDisplayString(t.pageCount)+" 页",1)):m.createCommentVNode("",!0),e(t)?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("span",j3,"无对应附件,请从附件列表打开"))])],42,k3))),128))])):m.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a91771a4"]]),Q3=["aria-label"],U3={class:"apf-preview-head"},O3={class:"apf-preview-title"},E3={class:"apf-preview-actions"},P3=["href"],_3=["src","alt"],q3={key:3,class:"apf-gallery-counter"},$3={key:1,class:"apf-preview-body apf-preview-body-pdf"},gk={key:2,class:"apf-preview-body apf-preview-body-degraded"},Ik={class:"apf-degraded-content"},Ck={class:"apf-degraded-badge"},Ak={class:"apf-degraded-filename"},ik={key:0,class:"apf-degraded-size"},lk={class:"apf-degraded-actions"},ek=["href"],ck=.5,ak=3,pW=.25,XW=bg(m.defineComponent({__name:"AttachmentPreviewModal",props:{modelValue:{type:Boolean},attachment:{},gallery:{}},emits:["update:modelValue","update:attachment"],setup(C,{emit:I}){const g=C,A=I,i=m.computed({get:()=>g.modelValue,set:p=>A("update:modelValue",p)});function l(p){return p.url||""}const e=m.computed(()=>g.attachment?al(g.attachment):!1),c=m.computed(()=>g.attachment?De(g.attachment):!1),a=m.computed(()=>{var R;return((R=g.gallery)!=null&&R.length?g.gallery:g.attachment?[g.attachment]:[]).filter(al)}),d=m.computed(()=>!a.value.length||!g.attachment?-1:a.value.findIndex(p=>{var R;return p.id===((R=g.attachment)==null?void 0:R.id)})),t=m.computed(()=>d.value>0),Z=m.computed(()=>d.value>=0&&d.value<a.value.length-1),o=m.ref(1),n=m.ref(null),s=m.ref(null),b=m.ref(null);function G(){i.value=!1}function h(){if(!t.value)return;const p=a.value[d.value-1];p&&A("update:attachment",p)}function r(){if(!Z.value)return;const p=a.value[d.value+1];p&&A("update:attachment",p)}function u(){o.value=Math.min(ak,+(o.value+pW).toFixed(2))}function B(){o.value=Math.max(ck,+(o.value-pW).toFixed(2))}function Y(){o.value=1}async function W(p){const R=l(p);if(R)try{const S=await(await fetch(R)).blob(),M=URL.createObjectURL(S),K=document.createElement("a");K.href=M,K.download=p.filename||"download",K.rel="noopener",document.body.appendChild(K),K.click(),K.remove(),URL.revokeObjectURL(M)}catch{const H=document.createElement("a");H.href=R,H.download=p.filename||"download",H.target="_blank",H.rel="noopener",document.body.appendChild(H),H.click(),H.remove()}}function w(p){if(i.value){if(p.key==="Escape"){p.preventDefault(),G();return}if(p.key==="ArrowLeft"&&t.value){p.preventDefault(),h();return}if(p.key==="ArrowRight"&&Z.value){p.preventDefault(),r();return}if(p.key==="+"||p.key==="="){e.value&&(p.preventDefault(),u());return}if(p.key==="-"){e.value&&(p.preventDefault(),B());return}if(p.key==="0"&&e.value){p.preventDefault(),Y();return}if(p.key==="Tab"&&n.value){const R=n.value.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(R.length===0)return;const H=R[0],S=R[R.length-1];p.shiftKey&&document.activeElement===H?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),H.focus())}}}m.watch(i,p=>{p?(b.value=document.activeElement,requestAnimationFrame(()=>{var R;return(R=s.value)==null?void 0:R.focus()}),document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),o.value=1,b.value&&(b.value.focus(),b.value=null))},{immediate:!0}),m.watch(()=>{var p;return(p=g.attachment)==null?void 0:p.id},()=>{o.value=1}),m.onUnmounted(()=>document.removeEventListener("keydown",w));function N(p){p.target===p.currentTarget&&G()}function V(p){p.stopPropagation()}function y(p){e.value&&(p.preventDefault(),p.deltaY<0?u():B())}return(p,R)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[i.value&&C.attachment?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-preview-mask",role:"dialog","aria-modal":"true","aria-label":`预览 ${C.attachment.filename}`,onClick:N},[m.createElementVNode("div",{ref_key:"panelRef",ref:n,class:m.normalizeClass(["apf-preview-panel",{"apf-preview-image":e.value,"apf-preview-pdf":c.value,"apf-preview-degraded":!e.value&&!c.value}]),onClick:V},[m.createElementVNode("header",U3,[m.createElementVNode("strong",O3,m.toDisplayString(C.attachment.filename),1),m.createElementVNode("div",E3,[e.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"缩小",onClick:B},"−"),m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"重置缩放",onClick:Y},m.toDisplayString(Math.round(o.value*100))+"% ",1),m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"放大",onClick:u},"+")],64)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("a",{key:1,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn"},m.toDisplayString(c.value?"新窗口打开":e.value?"打开原图":"打开原文件"),9,P3)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("button",{key:2,type:"button",class:"apf-preview-action-btn",onClick:R[0]||(R[0]=H=>W(C.attachment))}," 下载 ")):m.createCommentVNode("",!0),m.createElementVNode("button",{ref_key:"closeBtnRef",ref:s,type:"button",class:"apf-preview-action-btn","aria-label":"关闭预览",onClick:G}," 关闭 ",512)])]),e.value?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-preview-body apf-preview-body-image",onWheel:m.withModifiers(y,["prevent"])},[t.value?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",class:"apf-gallery-btn apf-gallery-prev","aria-label":"上一张图片",onClick:h}," ‹ ")):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("img",{key:1,src:l(C.attachment),alt:C.attachment.filename,class:"apf-preview-img",style:m.normalizeStyle({transform:`scale(${o.value})`})},null,12,_3)):m.createCommentVNode("",!0),Z.value?(m.openBlock(),m.createElementBlock("button",{key:2,type:"button",class:"apf-gallery-btn apf-gallery-next","aria-label":"下一张图片",onClick:r}," › ")):m.createCommentVNode("",!0),a.value.length>1?(m.openBlock(),m.createElementBlock("div",q3,m.toDisplayString(d.value+1)+" / "+m.toDisplayString(a.value.length),1)):m.createCommentVNode("",!0)],32)):c.value?(m.openBlock(),m.createElementBlock("div",$3,[l(C.attachment)?(m.openBlock(),m.createBlock(Xs,{key:0,url:l(C.attachment),title:C.attachment.filename,"min-height":"70vh"},null,8,["url","title"])):m.createCommentVNode("",!0)])):(m.openBlock(),m.createElementBlock("div",gk,[m.createElementVNode("div",Ik,[m.createElementVNode("span",Ck,m.toDisplayString(m.unref(Ft)(C.attachment)),1),m.createElementVNode("strong",Ak,m.toDisplayString(C.attachment.filename),1),C.attachment.size?(m.openBlock(),m.createElementBlock("p",ik,m.toDisplayString(m.unref(vt)(C.attachment.size)),1)):m.createCommentVNode("",!0),R[2]||(R[2]=m.createElementVNode("p",{class:"apf-degraded-hint"},"此格式暂不支持应用内预览",-1)),m.createElementVNode("div",lk,[l(C.attachment)?(m.openBlock(),m.createElementBlock("a",{key:0,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn apf-preview-action-primary"}," 打开原文件 ",8,ek)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",class:"apf-preview-action-btn apf-preview-action-primary",onClick:R[1]||(R[1]=H=>W(C.attachment))}," 下载 ")):m.createCommentVNode("",!0)])])]))],2)],8,Q3)):m.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-13cf1e3e"]]),dk={class:"apf-bubble-wrap"},tk={key:0,class:"apf-tip"},Zk={key:1,class:"apf-typing"},ok={key:2,class:"apf-result-wrap"},nk={key:3,class:"apf-inline-progress"},sk={key:0,class:"apf-result-actions"},mk={key:1,class:"apf-fail-actions"},bk={key:3,class:"apf-bubble apf-waiting-hint"},Gk={key:4,class:"apf-bubble apf-failed-hint"},hk={key:5,class:"apf-bubble apf-cancelled-hint"},rk=["aria-expanded"],uk={key:0,class:"apf-live-dot"},Bk={class:"apf-detail-collapse"},Wk={class:"apf-detail-collapse-inner"},Yk=["aria-expanded"],wk={class:"apf-detail-collapse"},Vk={class:"apf-detail-collapse-inner"},Nk={key:9,class:"apf-chip apf-chip-success"},yk={class:"apf-approval-head"},pk={key:0,class:"apf-approval-danger-tag"},Xk={class:"apf-approval-prompt"},Rk={class:"apf-approval-actions"},Hk=["disabled","onClick"],RW=bg(m.defineComponent({__name:"MessageBubble",props:{message:{},run:{},sending:{type:Boolean},brandMark:{},sessionMessages:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(!1),l=m.ref(null),e=m.computed(()=>{var K,J;const S=[...g.message.attachments||[]];if(!((K=g.sessionMessages)!=null&&K.length))return S;const M=g.sessionMessages.findIndex(F=>F.id===g.message.id);if(M<=0)return S;for(let F=M-1;F>=0;F--){const z=g.sessionMessages[F];if(z.role==="user"&&((J=z.attachments)!=null&&J.length)){for(const f of z.attachments)S.some(j=>j.id===f.id)||S.push(f);break}}return S}),c=m.computed(()=>e.value.filter(al));function a(S){l.value=S,i.value=!0,A("preview",S)}const d=m.computed(()=>g.message.role==="user"),t=m.computed(()=>g.message.role==="assistant");function Z(S){return{PENDING:"排队中",RUNNING:"正在处理",WAITING_INPUT:"等待你的确认",COMPLETED:"已完成",FAILED:"处理失败",CANCELLED:"已取消"}[S]||S}function o(S){return{RUNNING:"apf-chip-running",WAITING_INPUT:"apf-chip-waiting",COMPLETED:"apf-chip-success",FAILED:"apf-chip-failed",CANCELLED:"apf-chip-cancelled"}[S]||"apf-chip-cancelled"}const n=[{action:"approve",label:"确认继续",style:"primary"},{action:"reject",label:"需要修改",style:"danger"}],s=m.computed(()=>{var M,K;if(g.message.status!=="WAITING_INPUT")return null;const S=(M=g.run)==null?void 0:M.waiting;if(S){const J=(K=S.actions)!=null&&K.length?S.actions:n;return{prompt:S.prompt||"请确认后继续。",fields:S.fields||[],actions:J,dangerous:!!S.dangerous}}return{prompt:"请确认后继续。",fields:[],actions:n,dangerous:!1}}),b=m.computed(()=>g.message.content||""),G=m.computed(()=>{var S;return t.value&&g.message.status==="RUNNING"&&!b.value&&!((S=g.message.attachments)!=null&&S.length)}),h=m.computed(()=>{var S,M;return!!b.value||!!((S=g.message.documentSummaries)!=null&&S.length)||!!((M=g.message.attachments)!=null&&M.length)}),r=m.computed(()=>d.value?"apf-user":g.message.status==="WAITING_INPUT"?"apf-waiting":g.message.status==="FAILED"?"apf-failed":""),u=m.ref("");function B(S){A("resume",S,u.value||void 0),u.value=""}function Y(){var M;const S=b.value||g.message.content;S&&((M=navigator.clipboard)==null||M.writeText(S))}function W(){const S=b.value||g.message.content;if(!S)return;const M=new Blob([S],{type:"text/markdown;charset=utf-8"}),K=URL.createObjectURL(M),J=document.createElement("a");J.href=K,J.download="reply.md",J.click(),URL.revokeObjectURL(K)}function w(S){return S.error?"失败":S.result!==void 0?"已完成":"处理中"}const N=m.ref(!1),V=m.ref(!1),y=m.ref(!1),p=m.computed(()=>t.value&&g.message.status==="RUNNING"&&!!g.message.thinking);m.watch(()=>{var S;return[g.message.status,!!((S=g.message.thinking)!=null&&S.trim())]},([S,M])=>{if(!M){N.value=!1,V.value=!1;return}if(S==="RUNNING"){N.value=!0,V.value=!1;return}V.value||(N.value=!1)},{immediate:!0});function R(){N.value=!N.value,V.value=!0}function H(){y.value=!y.value}return(S,M)=>{var K,J,F,z,f;return m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["apf-message",[C.message.role,C.message.status&&t.value?`apf-st-${C.message.status}`:""]])},[t.value&&C.brandMark?(m.openBlock(),m.createBlock(m.resolveDynamicComponent(C.brandMark),{key:0,variant:"ai",size:"sm"})):m.createCommentVNode("",!0),m.createElementVNode("div",dk,[t.value&&C.message.tip?(m.openBlock(),m.createElementBlock("p",tk,m.toDisplayString(C.message.tip),1)):m.createCommentVNode("",!0),G.value?(m.openBlock(),m.createElementBlock("div",Zk,[...M[4]||(M[4]=[m.createElementVNode("span",{class:"apf-status-text"},"正在处理",-1),m.createElementVNode("span",{class:"apf-dots"},[m.createElementVNode("i"),m.createElementVNode("i"),m.createElementVNode("i")],-1)])])):h.value?(m.openBlock(),m.createElementBlock("div",ok,[m.createElementVNode("div",{class:m.normalizeClass(["apf-bubble apf-message-content",r.value])},[(K=C.message.attachments)!=null&&K.length?(m.openBlock(),m.createBlock(NW,{key:0,attachments:C.message.attachments,onPreview:a},null,8,["attachments"])):m.createCommentVNode("",!0),b.value?(m.openBlock(),m.createBlock(VW,{key:1,content:b.value},null,8,["content"])):m.createCommentVNode("",!0),(J=C.message.documentSummaries)!=null&&J.length?(m.openBlock(),m.createBlock(yW,{key:2,summaries:C.message.documentSummaries,attachments:e.value,onPreview:a},null,8,["summaries","attachments"])):m.createCommentVNode("",!0),t.value&&C.message.status==="RUNNING"&&b.value?(m.openBlock(),m.createElementBlock("p",nk,"仍在处理…")):m.createCommentVNode("",!0)],2),t.value&&C.message.status==="COMPLETED"?(m.openBlock(),m.createElementBlock("div",sk,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:Y},[...M[5]||(M[5]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])]),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:W},[...M[6]||(M[6]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),C.message.thinking||(F=C.message.toolCalls)!=null&&F.length?(m.openBlock(),m.createElementBlock("button",{key:0,class:"apf-text-link",type:"button",onClick:M[0]||(M[0]=j=>A("open-process"))},"处理信息")):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),t.value&&C.message.status==="FAILED"?(m.openBlock(),m.createElementBlock("div",mk,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"重试",onClick:M[1]||(M[1]=j=>A("retry"))},[...M[7]||(M[7]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M3.2 8a4.8 4.8 0 0 1 8.3-3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),m.createElementVNode("path",{d:"M12.8 8a4.8 4.8 0 0 1-8.3 3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),m.createElementVNode("path",{d:"M11.2 2.6v2.6h-2.6M4.8 13.4v-2.6h2.6",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])])):m.createCommentVNode("",!0)])):t.value&&C.message.status==="WAITING_INPUT"&&!h.value?(m.openBlock(),m.createElementBlock("div",bk,"请在下方确认后继续。")):t.value&&C.message.status==="FAILED"&&!h.value?(m.openBlock(),m.createElementBlock("div",Gk,"处理失败")):t.value&&C.message.status==="CANCELLED"&&!h.value?(m.openBlock(),m.createElementBlock("div",hk,"已取消")):m.createCommentVNode("",!0),m.createVNode(XW,{modelValue:i.value,"onUpdate:modelValue":M[2]||(M[2]=j=>i.value=j),attachment:l.value,"onUpdate:attachment":M[3]||(M[3]=j=>l.value=j),gallery:c.value},null,8,["modelValue","attachment","gallery"]),t.value&&((z=C.message.thinking)!=null&&z.trim())?(m.openBlock(),m.createElementBlock("div",{key:6,class:m.normalizeClass(["apf-detail-block",{open:N.value,streaming:p.value}])},[m.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":N.value,onClick:R},[M[8]||(M[8]=m.createElementVNode("span",{class:"apf-chevron"},null,-1)),M[9]||(M[9]=m.createElementVNode("span",null,"思考过程",-1)),p.value?(m.openBlock(),m.createElementBlock("span",uk)):m.createCommentVNode("",!0)],8,rk),m.createElementVNode("div",Bk,[m.createElementVNode("div",Wk,[m.createElementVNode("div",{class:m.normalizeClass(["apf-detail-content",{streaming:p.value}])},m.toDisplayString(C.message.thinking),3)])])],2)):m.createCommentVNode("",!0),t.value&&((f=C.message.toolCalls)!=null&&f.length)?(m.openBlock(),m.createElementBlock("div",{key:7,class:m.normalizeClass(["apf-detail-block",{open:y.value}])},[m.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":y.value,onClick:H},[M[10]||(M[10]=m.createElementVNode("span",{class:"apf-chevron"},null,-1)),m.createElementVNode("span",null,"处理步骤("+m.toDisplayString(C.message.toolCalls.length)+")",1)],8,Yk),m.createElementVNode("div",wk,[m.createElementVNode("div",Vk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.message.toolCalls,j=>(m.openBlock(),m.createElementBlock("div",{key:j.id||j.name,class:"apf-tool-row"},[m.createElementVNode("strong",null,m.toDisplayString(j.name),1),m.createElementVNode("span",{class:m.normalizeClass({"apf-err":!!j.error})},m.toDisplayString(w(j)),3)]))),128))])])],2)):m.createCommentVNode("",!0),t.value&&C.message.status!=="COMPLETED"&&C.message.status!=="CANCELLED"?(m.openBlock(),m.createElementBlock("span",{key:8,class:m.normalizeClass(["apf-chip",o(C.message.status)])},[M[11]||(M[11]=m.createElementVNode("i",null,null,-1)),m.createTextVNode(m.toDisplayString(Z(C.message.status)),1)],2)):t.value&&C.message.status==="COMPLETED"?(m.openBlock(),m.createElementBlock("span",Nk,[...M[12]||(M[12]=[m.createElementVNode("i",null,null,-1),m.createTextVNode("已完成",-1)])])):m.createCommentVNode("",!0),s.value?(m.openBlock(),m.createElementBlock("div",{key:10,class:m.normalizeClass(["apf-inline-approval",{"apf-dangerous-approval":s.value.dangerous}])},[m.createElementVNode("div",yk,[M[13]||(M[13]=m.createElementVNode("span",{class:"apf-approval-title"},"需要你的确认",-1)),s.value.dangerous?(m.openBlock(),m.createElementBlock("span",pk,"需谨慎")):m.createCommentVNode("",!0)]),m.createElementVNode("p",Xk,m.toDisplayString(s.value.prompt),1),m.createElementVNode("div",Rk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(s.value.actions,j=>(m.openBlock(),m.createElementBlock("button",{key:j.action,type:"button",class:m.normalizeClass(["apf-approval-btn",j.style==="danger"?"apf-approval-btn-danger":"apf-approval-btn-primary"]),disabled:C.sending,onClick:E=>B(j.action)},m.toDisplayString(j.label),11,Hk))),128))])],2)):m.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-ac1e899a"]]),Sk={key:0,class:"apf-skeleton-line"},Mk=bg(m.defineComponent({__name:"MessageList",props:{messages:{},loading:{type:Boolean},currentRun:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(null);m.watch(()=>g.messages.length,async()=>{await m.nextTick(),i.value&&(i.value.scrollTop=i.value.scrollHeight)},{flush:"post"}),m.watch(()=>g.messages.map(e=>`${e.id}:${e.status}:${(e.content||"").length}`).join("|"),async()=>{await m.nextTick(),i.value&&(i.value.scrollTop=i.value.scrollHeight)},{flush:"post"});function l(e){return!g.currentRun||!e.runtimeExecutionId?null:g.currentRun.runtimeExecutionId===e.runtimeExecutionId?g.currentRun:null}return(e,c)=>(m.openBlock(),m.createElementBlock("div",{ref_key:"container",ref:i,class:"apf-message-list"},[C.loading&&!C.messages.length?(m.openBlock(),m.createElementBlock("div",Sk,[...c[4]||(c[4]=[m.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"60%"}},null,-1),m.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"45%","margin-top":"var(--spacing-sm, 8px)"}},null,-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.messages,a=>(m.openBlock(),m.createBlock(RW,{key:a.id,message:a,run:l(a),sending:!!C.sending,"brand-mark":C.brandMark,"session-messages":C.messages,onResume:c[0]||(c[0]=(d,t)=>A("resume",d,t)),onCancel:c[1]||(c[1]=d=>A("cancel")),onRetry:c[2]||(c[2]=d=>A("retry")),onOpenProcess:d=>A("open-process",a),onPreview:c[3]||(c[3]=d=>A("preview",d))},null,8,["message","run","sending","brand-mark","session-messages","onOpenProcess"]))),128))],512))}}),[["__scopeId","data-v-0957f79a"]]),Dk={key:0,class:"apf-pending-list"},Kk=["src"],Fk={class:"apf-pending-name"},vk={key:1,class:"apf-pending-status"},Jk={key:2,class:"apf-pending-status apf-error"},zk=["onClick"],kk=["placeholder","disabled"],Lk={class:"apf-composer-footer"},xk={class:"apf-composer-tools"},Tk=["disabled"],fk=["disabled"],jk={class:"apf-composer-meta"},Qk={class:"apf-cap-row"},Uk={key:0,class:"apf-cap-chip"},Ok={key:1,class:"apf-cap-chip"},Ek={class:"apf-meta-right"},Pk=bg(m.defineComponent({__name:"Composer",props:{disabled:{type:Boolean},placeholder:{},supportedInputs:{},hitlCapable:{type:Boolean},wsStatus:{},wsLabel:{}},emits:["send","upload","remove-attachment","ws-click"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(""),l=m.ref(null),e=m.ref(null),c=m.ref([]),a=m.ref(!1),d=m.computed(()=>g.supportedInputs||["text"]),t=m.computed(()=>d.value.some(r=>r==="file"||r==="image"||r==="document")),Z=m.computed(()=>{if(g.disabled||a.value)return!1;const r=!!i.value.trim(),u=c.value.some(Y=>Y.status==="done"),B=c.value.some(Y=>Y.status==="uploading");return(r||u)&&!B});function o(){var r;g.disabled||!t.value||(r=e.value)==null||r.click()}function n(r){const u=r.target,B=u.files;if(B!=null&&B.length){for(const Y of Array.from(B))A("upload",Y);u.value=""}}function s(r){const u=c.value.find(B=>B.id===r);u!=null&&u.previewUrl&&URL.revokeObjectURL(u.previewUrl),c.value=c.value.filter(B=>B.id!==r),A("remove-attachment",r)}async function b(){if(!Z.value)return;const r=i.value.trim(),u=c.value.filter(B=>B.status==="done").map(B=>B.id);A("send",r,u),i.value="",c.value.forEach(B=>{B.previewUrl&&URL.revokeObjectURL(B.previewUrl)}),c.value=[],await m.nextTick(),l.value&&(l.value.style.height="auto")}function G(r){const u=r.target;u.style.height="auto",u.style.height=Math.min(u.scrollHeight,220)+"px"}function h(r){r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),b())}return m.onBeforeUnmount(()=>{c.value.forEach(r=>{r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})}),(r,u)=>(m.openBlock(),m.createElementBlock("form",{class:"apf-composer",onSubmit:m.withModifiers(b,["prevent"])},[m.createElementVNode("div",{class:m.normalizeClass(["apf-composer-field",{"apf-disabled":C.disabled}])},[c.value.length?(m.openBlock(),m.createElementBlock("div",Dk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.value,B=>(m.openBlock(),m.createElementBlock("div",{key:B.id,class:m.normalizeClass(["apf-pending-chip",B.status])},[B.previewUrl?(m.openBlock(),m.createElementBlock("img",{key:0,src:B.previewUrl,alt:"",class:"apf-pending-thumb"},null,8,Kk)):m.createCommentVNode("",!0),m.createElementVNode("span",Fk,m.toDisplayString(B.filename),1),B.status==="uploading"?(m.openBlock(),m.createElementBlock("span",vk,"上传中")):B.status==="error"?(m.openBlock(),m.createElementBlock("span",Jk,m.toDisplayString(B.error||"失败"),1)):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"apf-pending-remove",onClick:Y=>s(B.id)},"×",8,zk)],2))),128))])):m.createCommentVNode("",!0),m.withDirectives(m.createElementVNode("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":u[0]||(u[0]=B=>i.value=B),placeholder:C.placeholder||"输入消息…",disabled:C.disabled,onInput:G,onKeydown:h},null,40,kk),[[m.vModelText,i.value]]),m.createElementVNode("div",Lk,[m.createElementVNode("div",xk,[m.renderSlot(r.$slots,"tools",{},void 0,!0),m.createElementVNode("input",{ref_key:"fileInputRef",ref:e,type:"file",class:"apf-file-input",multiple:"",accept:"image/*,.pdf,.txt,.md,.csv,.json,.doc,.docx,.xls,.xlsx",onChange:n},null,544),t.value?(m.openBlock(),m.createElementBlock("button",{key:0,class:"apf-cap-btn",type:"button","aria-label":"添加文件",disabled:C.disabled||a.value,onClick:o},[...u[2]||(u[2]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M9.2 2.8 4.4 7.6a2.6 2.6 0 0 0 3.7 3.7l5.2-5.2a1.8 1.8 0 0 0-2.5-2.5L5.6 8.8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tk)):m.createCommentVNode("",!0)]),m.createElementVNode("button",{type:"submit",class:"apf-send-btn",disabled:!Z.value,title:"发送"},"↗",8,fk)])],2),m.createElementVNode("div",jk,[m.createElementVNode("div",Qk,[u[3]||(u[3]=m.createElementVNode("span",{class:"apf-cap-chip"},"文本",-1)),t.value?(m.openBlock(),m.createElementBlock("span",Uk,"文件")):m.createCommentVNode("",!0),C.hitlCapable?(m.openBlock(),m.createElementBlock("span",Ok,"需要确认")):m.createCommentVNode("",!0)]),m.createElementVNode("div",Ek,[C.wsStatus?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",class:m.normalizeClass(["apf-ws-status",C.wsStatus]),onClick:u[1]||(u[1]=B=>A("ws-click"))},[...u[4]||(u[4]=[m.createElementVNode("i",{class:"apf-ws-dot"},null,-1)])],2)):m.createCommentVNode("",!0),u[5]||(u[5]=m.createElementVNode("small",{class:"apf-hint"},"Enter 发送 · Shift+Enter 换行",-1))])])],32))}}),[["__scopeId","data-v-45ece43f"]]),_k={key:0,class:"apf-run-bar"},qk={class:"apf-row"},$k={key:0,class:"apf-elapsed"},gL={key:0,class:"apf-error-text"},HW=bg(m.defineComponent({__name:"RunStatusBar",props:{run:{},sending:{type:Boolean}},emits:["cancel"],setup(C,{emit:I}){const g=C,A=I,i=m.computed(()=>{var a;return((a=g.run)==null?void 0:a.status)||null});function l(a){return{RUNNING:"正在处理",COMPLETED:"已完成",FAILED:"处理失败",WAITING_INPUT:"等待你的确认",CANCELLED:"已取消"}[a]||a}function e(a){return{RUNNING:"apf-running",COMPLETED:"apf-success",FAILED:"apf-failed",WAITING_INPUT:"apf-waiting",CANCELLED:"apf-cancelled"}[a]||""}function c(){if(!g.run)return"";const a=new Date(g.run.startedAt).getTime(),d=g.run.finishedAt?new Date(g.run.finishedAt).getTime():Date.now(),t=Math.round((d-a)/1e3);return t<60?t+"s":Math.floor(t/60)+"m "+t%60+"s"}return(a,d)=>C.run?(m.openBlock(),m.createElementBlock("div",_k,[m.createElementVNode("div",qk,[m.createElementVNode("span",{class:m.normalizeClass(["apf-chip",e(i.value||"")])},[d[1]||(d[1]=m.createElementVNode("i",null,null,-1)),m.createTextVNode(m.toDisplayString(l(i.value||"")),1)],2),i.value==="RUNNING"||i.value==="WAITING_INPUT"?(m.openBlock(),m.createElementBlock("span",$k,m.toDisplayString(c()),1)):m.createCommentVNode("",!0),i.value==="RUNNING"?(m.openBlock(),m.createElementBlock("button",{key:1,class:"apf-btn-cancel",onClick:d[0]||(d[0]=t=>A("cancel"))},"停止")):m.createCommentVNode("",!0)]),C.run.errorMessage?(m.openBlock(),m.createElementBlock("p",gL,m.toDisplayString(C.run.errorMessage),1)):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)}}),[["__scopeId","data-v-33963f1d"]]),IL={class:"apf-header"},CL={key:0,class:"apf-danger-tag"},AL={class:"apf-prompt"},iL=["placeholder"],lL=["value"],eL=["placeholder"],cL={class:"apf-actions"},aL=["disabled","onClick"],dL=bg(m.defineComponent({__name:"ApprovalCard",props:{waiting:{},disabled:{type:Boolean}},emits:["resume"],setup(C,{emit:I}){const g=I,A=m.ref("");function i(l){g("resume",l,A.value||void 0),A.value=""}return(l,e)=>C.waiting?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["apf-approval-card",{"apf-dangerous":C.waiting.dangerous}])},[m.createElementVNode("div",IL,[e[3]||(e[3]=m.createElementVNode("span",{class:"apf-title"},"需要你的操作",-1)),C.waiting.dangerous?(m.openBlock(),m.createElementBlock("span",CL,"危险操作")):m.createCommentVNode("",!0)]),m.createElementVNode("p",AL,m.toDisplayString(C.waiting.prompt),1),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.waiting.fields,c=>(m.openBlock(),m.createElementBlock("div",{key:c.key,class:"apf-field"},[m.createElementVNode("label",null,m.toDisplayString(c.label),1),c.type==="textarea"?m.withDirectives((m.openBlock(),m.createElementBlock("textarea",{key:0,"onUpdate:modelValue":e[0]||(e[0]=a=>A.value=a),placeholder:"请输入"+c.label,rows:"2"},null,8,iL)),[[m.vModelText,A.value]]):c.type==="select"&&c.options.length?m.withDirectives((m.openBlock(),m.createElementBlock("select",{key:1,"onUpdate:modelValue":e[1]||(e[1]=a=>A.value=a)},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.options,a=>(m.openBlock(),m.createElementBlock("option",{key:a,value:a},m.toDisplayString(a),9,lL))),128))],512)),[[m.vModelSelect,A.value]]):m.withDirectives((m.openBlock(),m.createElementBlock("input",{key:2,"onUpdate:modelValue":e[2]||(e[2]=a=>A.value=a),placeholder:"请输入"+c.label},null,8,eL)),[[m.vModelText,A.value]])]))),128)),m.createElementVNode("div",cL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.waiting.actions,c=>(m.openBlock(),m.createElementBlock("button",{key:c.action,class:m.normalizeClass(["apf-btn",c.style==="danger"?"apf-btn-danger":"apf-btn-primary"]),disabled:C.disabled,onClick:a=>i(c.action)},m.toDisplayString(c.label),11,aL))),128))])],2)):m.createCommentVNode("",!0)}}),[["__scopeId","data-v-ca69b479"]]),tL={class:"apf-session-sidebar","aria-label":"会话列表"},ZL={class:"apf-session-sidebar__head"},oL={class:"apf-session-sidebar__list"},nL=["onClick"],sL={class:"apf-session-sidebar__item-title"},mL={key:0,class:"apf-session-sidebar__empty"},bL=bg(m.defineComponent({__name:"SessionSidebar",props:{sessions:{},activeId:{},loading:{type:Boolean},title:{}},emits:["select","create","delete"],setup(C,{emit:I}){const g=I;function A(i){if(!i)return"";const l=new Date(i),e=(Date.now()-l.getTime())/1e3;return e<60?"刚刚":e<3600?`${Math.floor(e/60)} 分钟前`:e<86400?`${Math.floor(e/3600)} 小时前`:l.toLocaleDateString("zh-CN")}return(i,l)=>{const e=m.resolveComponent("el-button"),c=m.resolveDirective("loading");return m.openBlock(),m.createElementBlock("aside",tL,[m.createElementVNode("div",ZL,[m.createElementVNode("strong",null,m.toDisplayString(C.title||"会话"),1),m.createVNode(e,{type:"primary",size:"small",onClick:l[0]||(l[0]=a=>g("create"))},{default:m.withCtx(()=>[...l[1]||(l[1]=[m.createTextVNode("新建",-1)])]),_:1})]),m.withDirectives((m.openBlock(),m.createElementBlock("div",oL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.sessions,a=>(m.openBlock(),m.createElementBlock("button",{key:a.id,type:"button",class:m.normalizeClass(["apf-session-sidebar__item",{"is-active":a.id===C.activeId}]),onClick:d=>g("select",a.id)},[m.createElementVNode("span",sL,m.toDisplayString(a.title||"未命名会话"),1),m.createElementVNode("small",null,m.toDisplayString(A(a.updatedAt||a.createdAt)),1),m.createVNode(e,{class:"apf-session-sidebar__delete",link:"",type:"danger",size:"small",onClick:m.withModifiers(d=>g("delete",a.id),["stop"])},{default:m.withCtx(()=>[...l[2]||(l[2]=[m.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])],10,nL))),128)),!C.loading&&!C.sessions.length?(m.openBlock(),m.createElementBlock("div",mL,"暂无会话")):m.createCommentVNode("",!0)])),[[c,C.loading]])])}}}),[["__scopeId","data-v-2a3b7a7c"]]),GL={key:0,class:"apf-processing-drawer__subtitle"},hL={class:"apf-processing-drawer__body"},rL=bg(m.defineComponent({__name:"ProcessingDrawer",props:{modelValue:{type:Boolean},run:{},title:{},subtitle:{},sending:{type:Boolean}},emits:["update:modelValue","cancel"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=m.resolveComponent("el-drawer");return m.openBlock(),m.createBlock(l,{"model-value":C.modelValue,title:C.title||"处理详情",size:"380px","append-to-body":"","onUpdate:modelValue":i[1]||(i[1]=e=>g("update:modelValue",e))},{default:m.withCtx(()=>[C.subtitle?(m.openBlock(),m.createElementBlock("p",GL,m.toDisplayString(C.subtitle),1)):m.createCommentVNode("",!0),C.run?(m.openBlock(),m.createBlock(m.unref(HW),{key:1,run:C.run,sending:C.sending??!1,onCancel:i[0]||(i[0]=e=>g("cancel"))},null,8,["run","sending"])):m.createCommentVNode("",!0),m.createElementVNode("div",hL,[m.renderSlot(A.$slots,"default",{},void 0,!0)])]),_:3},8,["model-value","title"])}}}),[["__scopeId","data-v-6036074a"]]),uL={class:"apf-conversation-header"},BL={class:"apf-conversation-header__identity"},WL={class:"apf-conversation-header__copy"},YL={class:"apf-conversation-header__label"},wL={class:"apf-conversation-header__actions"},VL={key:0,class:"apf-conversation-header__processing"},NL=bg(m.defineComponent({__name:"ConversationHeader",props:{title:{},label:{},hasMessages:{type:Boolean},processing:{type:Boolean}},emits:["changeAssistant","toggleDetails","create"],setup(C,{emit:I}){const g=I;return(A,i)=>(m.openBlock(),m.createElementBlock("header",uL,[m.createElementVNode("div",BL,[m.createElementVNode("div",WL,[m.createElementVNode("span",YL,m.toDisplayString(C.label||"正在使用"),1),m.createElementVNode("strong",null,m.toDisplayString(C.title||"选择一个智能体开始"),1)])]),m.createElementVNode("div",wL,[C.processing?(m.openBlock(),m.createElementBlock("span",VL,[...i[2]||(i[2]=[m.createElementVNode("i",null,null,-1),m.createElementVNode("span",null,"正在处理",-1)])])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"apf-conversation-header__btn",onClick:i[0]||(i[0]=l=>C.hasMessages?g("create"):g("changeAssistant"))},m.toDisplayString(C.hasMessages?"新建对话":"选择智能体"),1),C.hasMessages?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",class:"apf-conversation-header__btn",onClick:i[1]||(i[1]=l=>g("toggleDetails"))}," 处理详情 ")):m.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-d93df7f9"]]),yL={class:"apf-assistant-picker"},pL={key:0,class:"apf-assistant-picker__state"},XL={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},RL={key:2,class:"apf-assistant-picker__state"},HL=["onClick"],SL={class:"apf-assistant-picker__main"},ML={class:"apf-assistant-picker__icon-wrap"},DL={class:"apf-assistant-picker__info"},KL={class:"apf-assistant-picker__caps"},FL=bg(m.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(C,{emit:I}){const g=C,A=I;function i(a){var t,Z;const d=["文本"];return(t=a.supportedInputs)!=null&&t.includes("file")&&d.push("文件"),(Z=a.supportedInputs)!=null&&Z.includes("image")&&d.push("图片"),a.hitlCapable&&d.push("需要确认"),d}function l(a){return a.icon||"chat-dot-round"}function e(a){A("update:modelValue",a.id),A("select",a)}const c=m.computed(()=>!g.loading&&!g.error&&!g.items.length);return(a,d)=>(m.openBlock(),m.createElementBlock("div",yL,[C.loading?(m.openBlock(),m.createElementBlock("div",pL,[...d[0]||(d[0]=[m.createElementVNode("p",null,"正在加载智能体…",-1)])])):C.error?(m.openBlock(),m.createElementBlock("div",XL,[m.createElementVNode("p",null,m.toDisplayString(C.error),1)])):c.value?(m.openBlock(),m.createElementBlock("div",RL,[...d[1]||(d[1]=[m.createElementVNode("p",null,"暂无可用智能体",-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.items,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:m.normalizeClass(["apf-assistant-picker__item",{"is-active":C.modelValue===t.id}]),onClick:Z=>e(t)},[m.createElementVNode("div",SL,[m.createElementVNode("span",ML,[m.createVNode(m.unref(KI),{name:l(t),size:22},null,8,["name"])]),m.createElementVNode("span",DL,[m.createElementVNode("b",null,m.toDisplayString(t.name),1),m.createElementVNode("small",null,m.toDisplayString(t.description||"适合处理一类明确任务"),1),m.createElementVNode("span",KL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i(t),Z=>(m.openBlock(),m.createElementBlock("span",{key:Z,class:m.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":Z==="需要确认"}])},m.toDisplayString(Z),3))),128))])])]),m.createElementVNode("span",{class:m.normalizeClass(["apf-assistant-picker__choose",{"is-selected":C.modelValue===t.id}])},m.toDisplayString(C.modelValue===t.id?"已选择":"开始使用"),3)],10,HL))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),vL={class:"apf-model-picker"},JL=bg(m.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=m.resolveComponent("el-option"),e=m.resolveComponent("el-select");return m.openBlock(),m.createElementBlock("label",vL,[m.createVNode(e,{"model-value":C.modelValue||void 0,disabled:C.loading||!C.models.length,placeholder:"选择模型","onUpdate:modelValue":i[0]||(i[0]=c=>g("update:modelValue",c))},{default:m.withCtx(()=>[C.loading?(m.openBlock(),m.createBlock(l,{key:0,label:"正在加载模型…",value:"",disabled:""})):C.models.length?m.createCommentVNode("",!0):(m.openBlock(),m.createBlock(l,{key:1,label:"暂无可用模型",value:"",disabled:""})),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.models,c=>(m.openBlock(),m.createBlock(l,{key:c.id,label:`${c.name} · ${c.provider}`,value:c.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]),SW=Symbol("fg-toast");function zL(C){return{[SW]:C}}function kL(){const C=m.inject(SW);return{show(I,g="info",A){var i;(i=C==null?void 0:C.value)==null||i.show(I,g,A)},info(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"info",g)},success(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"success",g)},warning(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"warning",g)},error(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"error",g)}}}function LL(){async function C(A,i={}){const{title:l="确认操作",type:e="warning",confirmButtonText:c="确定",cancelButtonText:a="取消"}=i;try{return await HC.ElMessageBox.confirm(A,l,{confirmButtonText:c,cancelButtonText:a,type:e}),!0}catch{return!1}}async function I(A,i={}){return C(`此操作将永久删除${A},是否继续?`,{title:"确认删除",type:"warning",confirmButtonText:"确认删除",...i})}async function g(A,i={}){return C(A,{title:"确认操作",type:"warning",...i})}return{confirm:C,confirmDelete:I,confirmDanger:g}}function xL(){return{success(C,I={}){HC.ElMessage({message:C,type:"success",...I})},error(C,I={}){HC.ElMessage({message:C,type:"error",...I})},warning(C,I={}){HC.ElMessage({message:C,type:"warning",...I})},info(C,I={}){HC.ElMessage({message:C,type:"info",...I})}}}function TL(C,I=300){const g=m.ref(null);function A(...i){g.value&&clearTimeout(g.value),g.value=setTimeout(()=>{C(...i),g.value=null},I)}return m.onUnmounted(()=>{g.value&&clearTimeout(g.value)}),A}function fL(C,I){var c;const g=m.ref(1),A=m.ref((I==null?void 0:I.initialPageSize)??ys),i=m.computed(()=>{const a=C.value,d=(g.value-1)*A.value;return a.slice(d,d+A.value)}),l=m.computed(()=>C.value.length);function e(){g.value=1}return m.watch(A,()=>{g.value=1},{flush:"sync"}),m.watch(C,a=>{const d=Math.max(1,Math.ceil(a.length/A.value)||1);g.value>d&&(g.value=d)}),(c=I==null?void 0:I.resetOn)!=null&&c.length&&m.watch(I.resetOn,()=>{e()}),{currentPage:g,pageSize:A,pagedItems:i,total:l,resetPage:e}}function jL(C={}){const{timeout:I=15e3,silentError:g=!1}=C,A=m.ref(!1),i=m.ref(null),l=m.ref(!1),e=m.computed(()=>i.value!==null);let c=null,a=0;function d(){a++,a===1&&(A.value=!0,i.value=null,l.value=!1,c=setTimeout(()=>{l.value=!0},I))}function t(){a=Math.max(0,a-1),a===0&&(A.value=!1,l.value=!1,c&&(clearTimeout(c),c=null))}async function Z(n){d();try{return await n()}catch(s){return g||(i.value=s instanceof Error?s.message:"加载失败"),null}finally{t()}}function o(){a=0,A.value=!1,i.value=null,l.value=!1,c&&(clearTimeout(c),c=null)}return{loading:A,error:i,timedOut:l,hasError:e,withLoading:Z,reset:o}}function QL(C){const{containerRef:I,autoScroll:g=!0,behavior:A="smooth",offset:i=50}=C,l=m.ref(!0),e=m.ref(g);function c(){const n=I.value;if(!n)return!0;const{scrollTop:s,scrollHeight:b,clientHeight:G}=n;return b-s-G<i}async function a(n=!0){if(!n&&!e.value)return;await m.nextTick();const s=I.value;s&&s.scrollTo({top:s.scrollHeight,behavior:A})}function d(n){const s=I.value;s&&s.scrollTo({top:n,behavior:A})}function t(){e.value=!0}function Z(){e.value=!1}function o(){l.value=c(),l.value&&(e.value=!0)}return m.onMounted(()=>{const n=I.value;n&&(n.addEventListener("scroll",o),l.value=c())}),m.onUnmounted(()=>{const n=I.value;n&&n.removeEventListener("scroll",o)}),{scrollToBottom:a,scrollTo:d,isAtBottom:l,autoScrollEnabled:e,checkIfAtBottom:c,enableAutoScroll:t,disableAutoScroll:Z}}const Es=new Map;function UL(C){const{url:I,token:g,projectId:A,reconnectInterval:i=3e3,maxRetries:l=1/0}=C;let e=Es.get(I);e||(e={ws:null,status:m.ref("closed"),refCount:0,handlers:new Map,subscribedProjects:new Set,reconnectTimer:null,pingTimer:null,pongTimer:null,retries:0,reconnectInterval:i,maxRetries:l,intentionalClose:!1,token:g},Es.set(I,e)),e.refCount+=1,e.reconnectInterval=i,e.maxRetries=l,e.token=g;const c=[],a=e.status,d=()=>m.toValue(A);function t(){e&&(e.pingTimer&&clearInterval(e.pingTimer),e.pongTimer&&clearTimeout(e.pongTimer),e.pingTimer=null,e.pongTimer=null)}function Z(){e&&(t(),e.pingTimer=setInterval(()=>{!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN||(e.ws.send(JSON.stringify({action:"ping"})),e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=setTimeout(()=>{var B;(B=e==null?void 0:e.ws)==null||B.close()},6e4))},3e4))}function o(){if(!e||e.intentionalClose)return;if(e.retries>=e.maxRetries){e.status.value="error";return}const B=Math.min(e.reconnectInterval*2**e.retries,3e4);e.retries+=1,e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout(()=>{G()},B)}function n(B){if(!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN)return;const Y={action:"subscribe",project_id:B??null},W=typeof e.token=="function"?e.token():e.token;if(W&&(Y.token=W),!e.subscribedProjects.has(B??null)){if(B==null){e.ws.send(JSON.stringify(Y)),e.subscribedProjects.add(null);return}e.ws.send(JSON.stringify(Y)),e.subscribedProjects.add(B)}}function s(){if(!e)return;e.subscribedProjects.clear();const B=new Set;let Y=!1;for(const w of e.handlers.values())for(const N of w){const V=N.getProjectId();V==null?Y=!0:B.add(V)}const W=d();W==null?Y=!0:B.add(W),Y&&n(void 0);for(const w of B)n(w)}function b(B){if(!e)return;const Y=e.handlers.get(B.type);if(Y)for(const W of Y){const w=W.getProjectId();w!=null&&w!==B.project_id||W.handler(B.data)}}function G(){if(!e)return;if(e.ws&&(e.ws.readyState===WebSocket.OPEN||e.ws.readyState===WebSocket.CONNECTING)){e.ws.readyState===WebSocket.OPEN&&n(d());return}e.intentionalClose=!1,e.status.value="connecting";const B=new WebSocket(I);e.ws=B,B.onopen=()=>{e&&(e.status.value="open",e.retries=0,Z(),s())},B.onmessage=Y=>{if(e)try{const W=JSON.parse(String(Y.data));if(W.action==="pong"||W.type==="pong"){e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=null;return}typeof W.type=="string"&&b(W)}catch{}},B.onerror=()=>{e&&(e.status.value="error")},B.onclose=()=>{e&&(t(),e.ws=null,e.subscribedProjects.clear(),e.intentionalClose?e.status.value="closed":(e.status.value="closed",o()))}}function h(){if(e){for(const B of c)for(const Y of e.handlers.values())Y.delete(B);c.length=0}}function r(){var B;e&&(h(),e.refCount=Math.max(0,e.refCount-1),!(e.refCount>0)&&(e.intentionalClose=!0,e.reconnectTimer&&clearTimeout(e.reconnectTimer),t(),(B=e.ws)==null||B.close(),e.ws=null,e.status.value="closed",Es.delete(I),e=void 0))}function u(B,Y){var N;if(!e)return()=>{};let W=e.handlers.get(B);W||(W=new Set,e.handlers.set(B,W));const w={getProjectId:d,handler:Y};return W.add(w),c.push(w),((N=e.ws)==null?void 0:N.readyState)===WebSocket.OPEN&&n(d()),()=>{W==null||W.delete(w);const V=c.indexOf(w);V>=0&&c.splice(V,1)}}return G(),m.watch(d,B=>{var Y;((Y=e==null?void 0:e.ws)==null?void 0:Y.readyState)===WebSocket.OPEN&&n(B)}),m.onUnmounted(()=>{r()}),{status:a,connect:G,disconnect:r,on:u}}function OL(C){if(!C)return"操作失败";if(typeof C=="string")return C;if(C instanceof Error)return C.message||"操作失败";if(typeof C=="object"){const I=C;if(I.message)return I.message;if(I.errors&&typeof I.errors=="object"){const g=[];for(const A of Object.values(I.errors))Array.isArray(A)&&g.push(...A);if(g.length>0)return g.join(";")}if(I.code)return`错误码:${I.code}`}return"操作失败"}const EL=/\/(?:schema-platform\/)?api\/ai\/documents\/([^/?#]+)\/file/i,MW=/\.(mp4|webm|mov|m4v)(\?|#|$)/i,PL=/\.(png|jpe?g|gif|webp|bmp|svg)(\?|#|$)/i,Ps=/\.pdf(\?|#|$)/i,_s=/\.(docx?|xlsx?|csv|txt|md)(\?|#|$)/i,DW=/(?:https?:\/\/[^\s"'<>\]]+|\/(?:schema-platform\/)?api\/ai\/documents\/[^/\s"'<>\]]+\/file)/gi;function ze(C){const I=C.trim().match(EL);if(I!=null&&I[1])return I[1];if(/^[0-9a-f]{24}$/i.test(C.trim()))return C.trim()}function sl(C){const{url:I="",filename:g="",mimetype:A="",hint:i}=C;if(i==="video"||i==="videoUrl")return"video";if(i==="image"||i==="imageUrls")return"image";if(i==="text")return"text";if(i==="json")return"json";if(i==="document"||i==="documentIds"){const c=g||I;return Ps.test(c)||A.includes("pdf")?"pdf":_s.test(c)||/word|sheet|excel|csv|text/.test(A)?"office":"file"}const l=`${I} ${g}`.toLowerCase(),e=A.toLowerCase();return e.startsWith("video/")||MW.test(l)?"video":e.startsWith("image/")||PL.test(l)?"image":e.includes("pdf")||Ps.test(l)?"pdf":_s.test(l)||e.includes("word")||e.includes("sheet")||e.includes("excel")||e.includes("csv")||e.startsWith("text/")?"office":ze(I)&&!Ps.test(I)&&!_s.test(I)&&!MW.test(I)?"image":"file"}function ui(C,I,g){var i;const A=g.url||g.documentId||`${g.kind}:${((i=g.text)==null?void 0:i.slice(0,40))??g.id}`;!A||I.has(A)||(I.add(A),C.push(g))}function qs(C){const I=C.trim();if(!I)return null;const g=[I],A=I.match(/^```(?:json)?\s*([\s\S]*?)```$/i);A!=null&&A[1]&&g.unshift(A[1].trim());for(const i of g)if(!(i[0]!=="{"&&i[0]!=="["))try{const l=JSON.parse(i);if(l==null||typeof l!="object")continue;return{kind:"json",text:JSON.stringify(l,null,2)}}catch{}return null}function _L(C,I="art"){if(C==null)return[];const g=[],A=new Set;let i=0;const l=()=>`${I}-${++i}`;if(typeof C=="string"){const a=C.match(DW)??[];for(const d of a){const t=sl({url:d});ui(g,A,{id:l(),kind:t,url:d,documentId:ze(d),source:"text"})}if(!a.length&&C.trim()){const d=qs(C);ui(g,A,{id:l(),kind:(d==null?void 0:d.kind)??"text",text:(d==null?void 0:d.text)??C,label:d?"JSON 输出":"文本输出",source:"text"})}return g}if(typeof C!="object")return g;const e=C;typeof e.videoUrl=="string"&&e.videoUrl.trim()&&ui(g,A,{id:l(),kind:"video",url:e.videoUrl,documentId:ze(e.videoUrl),source:"videoUrl"});const c=(a,d,t)=>{if(Array.isArray(a))for(const Z of a){let o="";if(typeof Z=="string"?o=Z:Z&&typeof Z=="object"&&"url"in Z&&(o=String(Z.url??"")),!o.trim())continue;const n=sl({url:o,hint:t});ui(g,A,{id:l(),kind:n,url:o,documentId:ze(o),source:d})}};if(c(e.imageUrls,"imageUrls","image"),c(e.images,"images","image"),c(e.mediaUrls,"mediaUrls"),c(e.referenceImageUrls,"referenceImageUrls","image"),Array.isArray(e.documentIds))for(const a of e.documentIds)typeof a!="string"||!a.trim()||ui(g,A,{id:l(),kind:sl({url:a,hint:"document"}),documentId:a,url:void 0,label:`文档 ${a.slice(-6)}`,source:"documentIds"});typeof e.documentId=="string"&&e.documentId.trim()&&ui(g,A,{id:l(),kind:sl({url:e.documentId,hint:"document"}),documentId:e.documentId,label:`文档 ${e.documentId.slice(-6)}`,source:"documentId"});for(const a of["text","message","confirmMessage","prompt"]){const d=e[a];if(typeof d!="string"||!d.trim())continue;const t=d.match(DW)??[];for(const Z of t)ui(g,A,{id:l(),kind:sl({url:Z}),url:Z,documentId:ze(Z),source:a});if(!t.length&&(a==="text"||a==="message")){const Z=a==="text"?qs(d):null;ui(g,A,{id:l(),kind:(Z==null?void 0:Z.kind)??"text",text:(Z==null?void 0:Z.text)??d,label:Z?"JSON 输出":a==="text"?"文本输出":"确认提示",source:a})}}return g}function qL(C){return C.map((I,g)=>{const A=sl({url:I.url,filename:I.filename,mimetype:I.mimetype});return{id:I.id||`att-${g}`,kind:A,url:I.url,documentId:I.id,filename:I.filename,mimetype:I.mimetype,label:I.filename,source:"attachment"}})}const $L="1.9.0",gx="2.14.2",Ix="2026-08-27";/*! *****************************************************************************
|
|
71
|
+
`+oI),el&&(oI=ns(oI)),V&&as?M(oI):oI},I.setConfig=function(){let $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Lu($),Mu=!0,ls=hg,es=Ng},I.clearConfig=function(){aa=null,Mu=!1,ls=null,es=null,V=p,y=""},I.isValidAttribute=function($,D,k){aa||Lu({});const U=uI($),ag=uI(D);return Q5(U,ag,k)},I.addHook=function($,D){typeof D=="function"&&ZC(_,$)&&Ga(_[$],D)},I.removeHook=function($,D){if(ZC(_,$)){if(D!==void 0){const k=j1(_[$],D);return k===-1?void 0:Q1(_[$],k,1)[0]}return cW(_[$])}},I.removeHooks=function($){ZC(_,$)&&(_[$]=[])},I.removeAllHooks=function(){_=uW()},I}var Os=BW();const ft=typeof Os.sanitize=="function"?Os:Os.default;function G3(C){const I=C.trim();if(!I)return!1;const g=[/^(好的|已|我|现在|以上|这就是|这是|根据|基于)/,/^(表单|流程|Schema|JSON|数据)\s*(已|已经|已生成|已创建|已更新)/,/已(生成|创建|更新|完成|应用)(好|了)?/,/以上(就是|是)/,/请(查看|确认|检查|参考)/,/希望(这|这个)/];return I.length<100&&g.some(A=>A.test(I))}function WW(C){if(!C)return[{type:"text",content:""}];const I=[],g=/```([\w:+#.-]*)\r?\n([\s\S]*?)```|```([^\n`]*?)```|<schema>([\s\S]*?)<\/schema>/g;let A=0,i,l=!1;for(;(i=g.exec(C))!==null;){const a=C.slice(A,i.index);if(a.trim()&&I.push({type:"text",content:a}),i[0].startsWith("<schema>"))I.push({type:"code",content:(i[4]||"").trim(),language:"json"}),l=!0;else if(i[1]!==void 0){const d=(i[1]||"text").trim()||"text",t=(i[2]||"").replace(/^\n/,"").replace(/\n$/,"");YW(I,d,t)}else YW(I,"text",(i[3]||"").trim());A=i.index+i[0].length}const e=C.slice(A);e.trim()&&(l&&G3(e)||I.push({type:"text",content:e}));const c=I.filter((a,d)=>a.type!=="text"||a.content.trim()?!0:d>0&&d<I.length-1);return c.length?c:[{type:"text",content:C}]}function YW(C,I,g){if(I.startsWith("artifact:")){const A=I.slice(9);C.push({type:"artifact",content:g,language:A,artifactType:A});return}C.push({type:"code",content:g,language:I})}function wW(C){if(!C)return"";const g=gI.parse(C,{breaks:!0,gfm:!0}).replace(/<table>/g,'<div class="table-scroll"><table>').replace(/<\/table>/g,"</table></div>");return typeof window>"u"||typeof(ft==null?void 0:ft.sanitize)!="function"?g:ft.sanitize(g,{ADD_ATTR:["class"]})}const h3={class:"apf-message-parts"},r3=["innerHTML"],u3={class:"apf-artifact-head"},B3={class:"apf-artifact-badge"},W3={class:"apf-part-actions"},Y3=["onClick"],w3=["onClick"],V3={class:"apf-code-block"},N3={class:"apf-code-head"},y3={class:"apf-code-lang"},p3={class:"apf-part-actions"},X3=["onClick"],R3=["onClick"],H3={class:"apf-code-block"},VW=bg(m.defineComponent({__name:"MessageParts",props:{content:{}},setup(C){const I=C,g=m.computed(()=>WW(I.content||"").map(A));function A(a){if(!((a.language||"").toLowerCase()==="json"||a.artifactType==="json"||i(a.content)))return{...a,display:a.content,isJson:!1};try{const Z=JSON.parse(a.content);return{...a,language:a.language||"json",display:JSON.stringify(Z,null,2),isJson:!0}}catch{return{...a,display:a.content,isJson:!1}}}function i(a){const d=a.trim();return d.startsWith("{")&&d.endsWith("}")||d.startsWith("[")&&d.endsWith("]")}function l(a){return a.type==="artifact"?a.artifactType||"artifact":a.isJson?"json":a.language&&a.language!=="text"?a.language:"code"}function e(a){var d;a&&((d=navigator.clipboard)==null||d.writeText(a))}function c(a){const d=a.isJson||a.language==="json"?"json":a.language&&a.language!=="text"?a.language.replace(/[^a-z0-9]+/gi,""):"txt",t=new Blob([a.display],{type:"text/plain;charset=utf-8"}),Z=URL.createObjectURL(t),o=document.createElement("a");o.href=Z,o.download=`result.${d||"txt"}`,o.click(),URL.revokeObjectURL(Z)}return(a,d)=>(m.openBlock(),m.createElementBlock("div",h3,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(g.value,(t,Z)=>(m.openBlock(),m.createElementBlock(m.Fragment,{key:Z},[t.type==="text"?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-md-block",innerHTML:m.unref(wW)(t.content)},null,8,r3)):t.type==="artifact"?(m.openBlock(),m.createElementBlock("div",{key:1,class:m.normalizeClass(["apf-artifact-card",{"apf-json":t.isJson}])},[m.createElementVNode("div",u3,[m.createElementVNode("span",B3,"工件 · "+m.toDisplayString(l(t)),1),m.createElementVNode("div",W3,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:o=>e(t.display)},[...d[0]||(d[0]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,Y3),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:o=>c(t)},[...d[1]||(d[1]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,w3)])]),m.createElementVNode("pre",V3,[m.createElementVNode("code",null,m.toDisplayString(t.display),1)])],2)):(m.openBlock(),m.createElementBlock("div",{key:2,class:m.normalizeClass(["apf-code-wrap",{"apf-json":t.isJson}])},[m.createElementVNode("div",N3,[m.createElementVNode("span",y3,m.toDisplayString(l(t)),1),m.createElementVNode("div",p3,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:o=>e(t.display)},[...d[2]||(d[2]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])],8,X3),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:o=>c(t)},[...d[3]||(d[3]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"13",height:"13"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,R3)])]),m.createElementVNode("pre",H3,[m.createElementVNode("code",null,m.toDisplayString(t.display),1)])],2))],64))),128))]))}}),[["__scopeId","data-v-ed1039e3"]]),S3={key:0,class:"apf-att-list"},M3=["aria-label","onClick"],D3=["src","alt"],K3=["aria-label","onClick"],F3={class:"apf-att-badge","aria-hidden":"true"},v3={class:"apf-att-meta"},J3={key:0},NW=bg(m.defineComponent({__name:"MessageAttachmentList",props:{attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I,i=m.computed(()=>g.attachments.filter(al)),l=m.computed(()=>g.attachments.filter(c=>!al(c)));function e(c){A("preview",c)}return(c,a)=>{var d;return(d=C.attachments)!=null&&d.length?(m.openBlock(),m.createElementBlock("div",S3,[i.value.length?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["apf-image-grid",{"apf-multi":i.value.length>1}])},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i.value,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:"apf-att-image","aria-label":`预览图片 ${t.filename}`,onClick:Z=>e(t)},[m.createElementVNode("img",{src:t.url,alt:t.filename,loading:"lazy"},null,8,D3)],8,M3))),128))],2)):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(l.value,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:"apf-att-file","aria-label":`${m.unref(De)(t)?"预览":m.unref(ps)(t)?"查看":"打开"} ${t.filename}`,onClick:Z=>e(t)},[m.createElementVNode("span",F3,m.toDisplayString(m.unref(Ft)(t)),1),m.createElementVNode("span",v3,[m.createElementVNode("strong",null,m.toDisplayString(t.filename),1),m.createElementVNode("small",null,[t.size?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createTextVNode(m.toDisplayString(m.unref(vt)(t.size)),1)],64)):m.createCommentVNode("",!0),m.unref(De)(t)?(m.openBlock(),m.createElementBlock(m.Fragment,{key:1},[m.createTextVNode(" · 点击预览")],64)):m.unref(ps)(t)?(m.openBlock(),m.createElementBlock(m.Fragment,{key:2},[m.createTextVNode(" · 点击查看")],64)):(m.openBlock(),m.createElementBlock(m.Fragment,{key:3},[m.createTextVNode(" · 点击打开")],64))]),t.excerpt?(m.openBlock(),m.createElementBlock("em",J3,m.toDisplayString(t.excerpt),1)):m.createCommentVNode("",!0)])],8,K3))),128))])):m.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a604161c"]]),z3={key:0,class:"apf-doc-list"},k3=["role","tabindex","aria-label","onClick","onKeydown"],L3={class:"apf-doc-body"},x3={class:"apf-doc-name"},T3={class:"apf-doc-summary"},f3={key:0,class:"apf-doc-meta"},j3={key:1,class:"apf-doc-hint"},yW=bg(m.defineComponent({__name:"DocumentSummaryList",props:{summaries:{},attachments:{}},emits:["preview"],setup(C,{emit:I}){const g=C,A=I;function i(c){var d;if(!((d=g.attachments)!=null&&d.length))return null;if(c.attachmentId){const t=g.attachments.find(Z=>Z.id===c.attachmentId);if(t)return t}const a=(c.filename||"").toLowerCase();return g.attachments.find(t=>(t.filename||"").toLowerCase()===a)||null}function l(c){const a=i(c);a&&A("preview",a)}function e(c){return i(c)!==null}return(c,a)=>{var d;return(d=C.summaries)!=null&&d.length?(m.openBlock(),m.createElementBlock("div",z3,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.summaries,t=>(m.openBlock(),m.createElementBlock("article",{key:t.documentId,class:m.normalizeClass(["apf-doc-card",{"apf-clickable":e(t)}]),role:e(t)?"button":void 0,tabindex:e(t)?0:void 0,"aria-label":e(t)?`预览 ${t.filename}`:void 0,onClick:Z=>l(t),onKeydown:[m.withKeys(Z=>l(t),["enter"]),m.withKeys(m.withModifiers(Z=>l(t),["prevent"]),["space"])]},[a[0]||(a[0]=m.createElementVNode("div",{class:"apf-doc-icon","aria-hidden":"true"},[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M4 2.5h5.2L12 5.3V13.5H4V2.5Z",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"}),m.createElementVNode("path",{d:"M9.2 2.5V5.3H12",fill:"none",stroke:"currentColor","stroke-width":"1.3","stroke-linejoin":"round"})])],-1)),m.createElementVNode("div",L3,[m.createElementVNode("strong",x3,m.toDisplayString(t.filename),1),m.createElementVNode("p",T3,m.toDisplayString(t.summary),1),t.pageCount?(m.openBlock(),m.createElementBlock("span",f3,m.toDisplayString(t.pageCount)+" 页",1)):m.createCommentVNode("",!0),e(t)?m.createCommentVNode("",!0):(m.openBlock(),m.createElementBlock("span",j3,"无对应附件,请从附件列表打开"))])],42,k3))),128))])):m.createCommentVNode("",!0)}}}),[["__scopeId","data-v-a91771a4"]]),Q3=["aria-label"],U3={class:"apf-preview-head"},O3={class:"apf-preview-title"},E3={class:"apf-preview-actions"},P3=["href"],_3=["src","alt"],q3={key:3,class:"apf-gallery-counter"},$3={key:1,class:"apf-preview-body apf-preview-body-pdf"},gk={key:2,class:"apf-preview-body apf-preview-body-degraded"},Ik={class:"apf-degraded-content"},Ck={class:"apf-degraded-badge"},Ak={class:"apf-degraded-filename"},ik={key:0,class:"apf-degraded-size"},lk={class:"apf-degraded-actions"},ek=["href"],ck=.5,ak=3,pW=.25,XW=bg(m.defineComponent({__name:"AttachmentPreviewModal",props:{modelValue:{type:Boolean},attachment:{},gallery:{}},emits:["update:modelValue","update:attachment"],setup(C,{emit:I}){const g=C,A=I,i=m.computed({get:()=>g.modelValue,set:p=>A("update:modelValue",p)});function l(p){return p.url||""}const e=m.computed(()=>g.attachment?al(g.attachment):!1),c=m.computed(()=>g.attachment?De(g.attachment):!1),a=m.computed(()=>{var R;return((R=g.gallery)!=null&&R.length?g.gallery:g.attachment?[g.attachment]:[]).filter(al)}),d=m.computed(()=>!a.value.length||!g.attachment?-1:a.value.findIndex(p=>{var R;return p.id===((R=g.attachment)==null?void 0:R.id)})),t=m.computed(()=>d.value>0),Z=m.computed(()=>d.value>=0&&d.value<a.value.length-1),o=m.ref(1),n=m.ref(null),s=m.ref(null),b=m.ref(null);function G(){i.value=!1}function h(){if(!t.value)return;const p=a.value[d.value-1];p&&A("update:attachment",p)}function r(){if(!Z.value)return;const p=a.value[d.value+1];p&&A("update:attachment",p)}function u(){o.value=Math.min(ak,+(o.value+pW).toFixed(2))}function B(){o.value=Math.max(ck,+(o.value-pW).toFixed(2))}function Y(){o.value=1}async function W(p){const R=l(p);if(R)try{const S=await(await fetch(R)).blob(),M=URL.createObjectURL(S),K=document.createElement("a");K.href=M,K.download=p.filename||"download",K.rel="noopener",document.body.appendChild(K),K.click(),K.remove(),URL.revokeObjectURL(M)}catch{const H=document.createElement("a");H.href=R,H.download=p.filename||"download",H.target="_blank",H.rel="noopener",document.body.appendChild(H),H.click(),H.remove()}}function w(p){if(i.value){if(p.key==="Escape"){p.preventDefault(),G();return}if(p.key==="ArrowLeft"&&t.value){p.preventDefault(),h();return}if(p.key==="ArrowRight"&&Z.value){p.preventDefault(),r();return}if(p.key==="+"||p.key==="="){e.value&&(p.preventDefault(),u());return}if(p.key==="-"){e.value&&(p.preventDefault(),B());return}if(p.key==="0"&&e.value){p.preventDefault(),Y();return}if(p.key==="Tab"&&n.value){const R=n.value.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(R.length===0)return;const H=R[0],S=R[R.length-1];p.shiftKey&&document.activeElement===H?(p.preventDefault(),S.focus()):!p.shiftKey&&document.activeElement===S&&(p.preventDefault(),H.focus())}}}m.watch(i,p=>{p?(b.value=document.activeElement,requestAnimationFrame(()=>{var R;return(R=s.value)==null?void 0:R.focus()}),document.addEventListener("keydown",w)):(document.removeEventListener("keydown",w),o.value=1,b.value&&(b.value.focus(),b.value=null))},{immediate:!0}),m.watch(()=>{var p;return(p=g.attachment)==null?void 0:p.id},()=>{o.value=1}),m.onUnmounted(()=>document.removeEventListener("keydown",w));function N(p){p.target===p.currentTarget&&G()}function V(p){p.stopPropagation()}function y(p){e.value&&(p.preventDefault(),p.deltaY<0?u():B())}return(p,R)=>(m.openBlock(),m.createBlock(m.Teleport,{to:"body"},[i.value&&C.attachment?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-preview-mask",role:"dialog","aria-modal":"true","aria-label":`预览 ${C.attachment.filename}`,onClick:N},[m.createElementVNode("div",{ref_key:"panelRef",ref:n,class:m.normalizeClass(["apf-preview-panel",{"apf-preview-image":e.value,"apf-preview-pdf":c.value,"apf-preview-degraded":!e.value&&!c.value}]),onClick:V},[m.createElementVNode("header",U3,[m.createElementVNode("strong",O3,m.toDisplayString(C.attachment.filename),1),m.createElementVNode("div",E3,[e.value?(m.openBlock(),m.createElementBlock(m.Fragment,{key:0},[m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"缩小",onClick:B},"−"),m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"重置缩放",onClick:Y},m.toDisplayString(Math.round(o.value*100))+"% ",1),m.createElementVNode("button",{type:"button",class:"apf-preview-action-btn","aria-label":"放大",onClick:u},"+")],64)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("a",{key:1,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn"},m.toDisplayString(c.value?"新窗口打开":e.value?"打开原图":"打开原文件"),9,P3)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("button",{key:2,type:"button",class:"apf-preview-action-btn",onClick:R[0]||(R[0]=H=>W(C.attachment))}," 下载 ")):m.createCommentVNode("",!0),m.createElementVNode("button",{ref_key:"closeBtnRef",ref:s,type:"button",class:"apf-preview-action-btn","aria-label":"关闭预览",onClick:G}," 关闭 ",512)])]),e.value?(m.openBlock(),m.createElementBlock("div",{key:0,class:"apf-preview-body apf-preview-body-image",onWheel:m.withModifiers(y,["prevent"])},[t.value?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",class:"apf-gallery-btn apf-gallery-prev","aria-label":"上一张图片",onClick:h}," ‹ ")):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("img",{key:1,src:l(C.attachment),alt:C.attachment.filename,class:"apf-preview-img",style:m.normalizeStyle({transform:`scale(${o.value})`})},null,12,_3)):m.createCommentVNode("",!0),Z.value?(m.openBlock(),m.createElementBlock("button",{key:2,type:"button",class:"apf-gallery-btn apf-gallery-next","aria-label":"下一张图片",onClick:r}," › ")):m.createCommentVNode("",!0),a.value.length>1?(m.openBlock(),m.createElementBlock("div",q3,m.toDisplayString(d.value+1)+" / "+m.toDisplayString(a.value.length),1)):m.createCommentVNode("",!0)],32)):c.value?(m.openBlock(),m.createElementBlock("div",$3,[l(C.attachment)?(m.openBlock(),m.createBlock(Xs,{key:0,url:l(C.attachment),title:C.attachment.filename,"min-height":"70vh"},null,8,["url","title"])):m.createCommentVNode("",!0)])):(m.openBlock(),m.createElementBlock("div",gk,[m.createElementVNode("div",Ik,[m.createElementVNode("span",Ck,m.toDisplayString(m.unref(Ft)(C.attachment)),1),m.createElementVNode("strong",Ak,m.toDisplayString(C.attachment.filename),1),C.attachment.size?(m.openBlock(),m.createElementBlock("p",ik,m.toDisplayString(m.unref(vt)(C.attachment.size)),1)):m.createCommentVNode("",!0),R[2]||(R[2]=m.createElementVNode("p",{class:"apf-degraded-hint"},"此格式暂不支持应用内预览",-1)),m.createElementVNode("div",lk,[l(C.attachment)?(m.openBlock(),m.createElementBlock("a",{key:0,href:l(C.attachment),target:"_blank",rel:"noopener",class:"apf-preview-action-btn apf-preview-action-primary"}," 打开原文件 ",8,ek)):m.createCommentVNode("",!0),l(C.attachment)?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",class:"apf-preview-action-btn apf-preview-action-primary",onClick:R[1]||(R[1]=H=>W(C.attachment))}," 下载 ")):m.createCommentVNode("",!0)])])]))],2)],8,Q3)):m.createCommentVNode("",!0)]))}}),[["__scopeId","data-v-13cf1e3e"]]),dk={class:"apf-bubble-wrap"},tk={key:0,class:"apf-tip"},Zk={key:1,class:"apf-typing"},ok={key:2,class:"apf-result-wrap"},nk={key:3,class:"apf-inline-progress"},sk={key:0,class:"apf-result-actions"},mk={key:1,class:"apf-fail-actions"},bk={key:3,class:"apf-bubble apf-waiting-hint"},Gk={key:4,class:"apf-bubble apf-failed-hint"},hk={key:5,class:"apf-bubble apf-cancelled-hint"},rk=["aria-expanded"],uk={key:0,class:"apf-live-dot"},Bk={class:"apf-detail-collapse"},Wk={class:"apf-detail-collapse-inner"},Yk=["aria-expanded"],wk={class:"apf-detail-collapse"},Vk={class:"apf-detail-collapse-inner"},Nk={key:9,class:"apf-chip apf-chip-success"},yk={class:"apf-approval-head"},pk={key:0,class:"apf-approval-danger-tag"},Xk={class:"apf-approval-prompt"},Rk={class:"apf-approval-actions"},Hk=["disabled","onClick"],RW=bg(m.defineComponent({__name:"MessageBubble",props:{message:{},run:{},sending:{type:Boolean},brandMark:{},sessionMessages:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(!1),l=m.ref(null),e=m.computed(()=>{var K,J;const S=[...g.message.attachments||[]];if(!((K=g.sessionMessages)!=null&&K.length))return S;const M=g.sessionMessages.findIndex(F=>F.id===g.message.id);if(M<=0)return S;for(let F=M-1;F>=0;F--){const z=g.sessionMessages[F];if(z.role==="user"&&((J=z.attachments)!=null&&J.length)){for(const f of z.attachments)S.some(j=>j.id===f.id)||S.push(f);break}}return S}),c=m.computed(()=>e.value.filter(al));function a(S){l.value=S,i.value=!0,A("preview",S)}const d=m.computed(()=>g.message.role==="user"),t=m.computed(()=>g.message.role==="assistant");function Z(S){return{PENDING:"排队中",RUNNING:"正在处理",WAITING_INPUT:"等待你的确认",COMPLETED:"已完成",FAILED:"处理失败",CANCELLED:"已取消"}[S]||S}function o(S){return{RUNNING:"apf-chip-running",WAITING_INPUT:"apf-chip-waiting",COMPLETED:"apf-chip-success",FAILED:"apf-chip-failed",CANCELLED:"apf-chip-cancelled"}[S]||"apf-chip-cancelled"}const n=[{action:"approve",label:"确认继续",style:"primary"},{action:"reject",label:"需要修改",style:"danger"}],s=m.computed(()=>{var M,K;if(g.message.status!=="WAITING_INPUT")return null;const S=(M=g.run)==null?void 0:M.waiting;if(S){const J=(K=S.actions)!=null&&K.length?S.actions:n;return{prompt:S.prompt||"请确认后继续。",fields:S.fields||[],actions:J,dangerous:!!S.dangerous}}return{prompt:"请确认后继续。",fields:[],actions:n,dangerous:!1}}),b=m.computed(()=>g.message.content||""),G=m.computed(()=>{var S;return t.value&&g.message.status==="RUNNING"&&!b.value&&!((S=g.message.attachments)!=null&&S.length)}),h=m.computed(()=>{var S,M;return!!b.value||!!((S=g.message.documentSummaries)!=null&&S.length)||!!((M=g.message.attachments)!=null&&M.length)}),r=m.computed(()=>d.value?"apf-user":g.message.status==="WAITING_INPUT"?"apf-waiting":g.message.status==="FAILED"?"apf-failed":""),u=m.ref("");function B(S){A("resume",S,u.value||void 0),u.value=""}function Y(){var M;const S=b.value||g.message.content;S&&((M=navigator.clipboard)==null||M.writeText(S))}function W(){const S=b.value||g.message.content;if(!S)return;const M=new Blob([S],{type:"text/markdown;charset=utf-8"}),K=URL.createObjectURL(M),J=document.createElement("a");J.href=K,J.download="reply.md",J.click(),URL.revokeObjectURL(K)}function w(S){return S.error?"失败":S.result!==void 0?"已完成":"处理中"}const N=m.ref(!1),V=m.ref(!1),y=m.ref(!1),p=m.computed(()=>t.value&&g.message.status==="RUNNING"&&!!g.message.thinking);m.watch(()=>{var S;return[g.message.status,!!((S=g.message.thinking)!=null&&S.trim())]},([S,M])=>{if(!M){N.value=!1,V.value=!1;return}if(S==="RUNNING"){N.value=!0,V.value=!1;return}V.value||(N.value=!1)},{immediate:!0});function R(){N.value=!N.value,V.value=!0}function H(){y.value=!y.value}return(S,M)=>{var K,J,F,z,f;return m.openBlock(),m.createElementBlock("div",{class:m.normalizeClass(["apf-message",[C.message.role,C.message.status&&t.value?`apf-st-${C.message.status}`:""]])},[t.value&&C.brandMark?(m.openBlock(),m.createBlock(m.resolveDynamicComponent(C.brandMark),{key:0,variant:"ai",size:"sm"})):m.createCommentVNode("",!0),m.createElementVNode("div",dk,[t.value&&C.message.tip?(m.openBlock(),m.createElementBlock("p",tk,m.toDisplayString(C.message.tip),1)):m.createCommentVNode("",!0),G.value?(m.openBlock(),m.createElementBlock("div",Zk,[...M[4]||(M[4]=[m.createElementVNode("span",{class:"apf-status-text"},"正在处理",-1),m.createElementVNode("span",{class:"apf-dots"},[m.createElementVNode("i"),m.createElementVNode("i"),m.createElementVNode("i")],-1)])])):h.value?(m.openBlock(),m.createElementBlock("div",ok,[m.createElementVNode("div",{class:m.normalizeClass(["apf-bubble apf-message-content",r.value])},[(K=C.message.attachments)!=null&&K.length?(m.openBlock(),m.createBlock(NW,{key:0,attachments:C.message.attachments,onPreview:a},null,8,["attachments"])):m.createCommentVNode("",!0),b.value?(m.openBlock(),m.createBlock(VW,{key:1,content:b.value},null,8,["content"])):m.createCommentVNode("",!0),(J=C.message.documentSummaries)!=null&&J.length?(m.openBlock(),m.createBlock(yW,{key:2,summaries:C.message.documentSummaries,attachments:e.value,onPreview:a},null,8,["summaries","attachments"])):m.createCommentVNode("",!0),t.value&&C.message.status==="RUNNING"&&b.value?(m.openBlock(),m.createElementBlock("p",nk,"仍在处理…")):m.createCommentVNode("",!0)],2),t.value&&C.message.status==="COMPLETED"?(m.openBlock(),m.createElementBlock("div",sk,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"复制",onClick:Y},[...M[5]||(M[5]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("rect",{x:"5.5",y:"5.5",width:"8",height:"8",rx:"1.5",fill:"none",stroke:"currentColor","stroke-width":"1.4"}),m.createElementVNode("path",{d:"M3.5 10.5V3.5h7",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"})],-1)])]),m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"下载",onClick:W},[...M[6]||(M[6]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M8 2.5v7.2M5.2 7.5 8 10.3l2.8-2.8M3.5 13h9",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])]),C.message.thinking||(F=C.message.toolCalls)!=null&&F.length?(m.openBlock(),m.createElementBlock("button",{key:0,class:"apf-text-link",type:"button",onClick:M[0]||(M[0]=j=>A("open-process"))},"处理信息")):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0),t.value&&C.message.status==="FAILED"?(m.openBlock(),m.createElementBlock("div",mk,[m.createElementVNode("button",{class:"apf-icon-btn",type:"button","aria-label":"重试",onClick:M[1]||(M[1]=j=>A("retry"))},[...M[7]||(M[7]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M3.2 8a4.8 4.8 0 0 1 8.3-3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),m.createElementVNode("path",{d:"M12.8 8a4.8 4.8 0 0 1-8.3 3.2",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round"}),m.createElementVNode("path",{d:"M11.2 2.6v2.6h-2.6M4.8 13.4v-2.6h2.6",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])])])):m.createCommentVNode("",!0)])):t.value&&C.message.status==="WAITING_INPUT"&&!h.value?(m.openBlock(),m.createElementBlock("div",bk,"请在下方确认后继续。")):t.value&&C.message.status==="FAILED"&&!h.value?(m.openBlock(),m.createElementBlock("div",Gk,"处理失败")):t.value&&C.message.status==="CANCELLED"&&!h.value?(m.openBlock(),m.createElementBlock("div",hk,"已取消")):m.createCommentVNode("",!0),m.createVNode(XW,{modelValue:i.value,"onUpdate:modelValue":M[2]||(M[2]=j=>i.value=j),attachment:l.value,"onUpdate:attachment":M[3]||(M[3]=j=>l.value=j),gallery:c.value},null,8,["modelValue","attachment","gallery"]),t.value&&((z=C.message.thinking)!=null&&z.trim())?(m.openBlock(),m.createElementBlock("div",{key:6,class:m.normalizeClass(["apf-detail-block",{open:N.value,streaming:p.value}])},[m.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":N.value,onClick:R},[M[8]||(M[8]=m.createElementVNode("span",{class:"apf-chevron"},null,-1)),M[9]||(M[9]=m.createElementVNode("span",null,"思考过程",-1)),p.value?(m.openBlock(),m.createElementBlock("span",uk)):m.createCommentVNode("",!0)],8,rk),m.createElementVNode("div",Bk,[m.createElementVNode("div",Wk,[m.createElementVNode("div",{class:m.normalizeClass(["apf-detail-content",{streaming:p.value}])},m.toDisplayString(C.message.thinking),3)])])],2)):m.createCommentVNode("",!0),t.value&&((f=C.message.toolCalls)!=null&&f.length)?(m.openBlock(),m.createElementBlock("div",{key:7,class:m.normalizeClass(["apf-detail-block",{open:y.value}])},[m.createElementVNode("button",{type:"button",class:"apf-detail-summary","aria-expanded":y.value,onClick:H},[M[10]||(M[10]=m.createElementVNode("span",{class:"apf-chevron"},null,-1)),m.createElementVNode("span",null,"处理步骤("+m.toDisplayString(C.message.toolCalls.length)+")",1)],8,Yk),m.createElementVNode("div",wk,[m.createElementVNode("div",Vk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.message.toolCalls,j=>(m.openBlock(),m.createElementBlock("div",{key:j.id||j.name,class:"apf-tool-row"},[m.createElementVNode("strong",null,m.toDisplayString(j.name),1),m.createElementVNode("span",{class:m.normalizeClass({"apf-err":!!j.error})},m.toDisplayString(w(j)),3)]))),128))])])],2)):m.createCommentVNode("",!0),t.value&&C.message.status!=="COMPLETED"&&C.message.status!=="CANCELLED"?(m.openBlock(),m.createElementBlock("span",{key:8,class:m.normalizeClass(["apf-chip",o(C.message.status)])},[M[11]||(M[11]=m.createElementVNode("i",null,null,-1)),m.createTextVNode(m.toDisplayString(Z(C.message.status)),1)],2)):t.value&&C.message.status==="COMPLETED"?(m.openBlock(),m.createElementBlock("span",Nk,[...M[12]||(M[12]=[m.createElementVNode("i",null,null,-1),m.createTextVNode("已完成",-1)])])):m.createCommentVNode("",!0),s.value?(m.openBlock(),m.createElementBlock("div",{key:10,class:m.normalizeClass(["apf-inline-approval",{"apf-dangerous-approval":s.value.dangerous}])},[m.createElementVNode("div",yk,[M[13]||(M[13]=m.createElementVNode("span",{class:"apf-approval-title"},"需要你的确认",-1)),s.value.dangerous?(m.openBlock(),m.createElementBlock("span",pk,"需谨慎")):m.createCommentVNode("",!0)]),m.createElementVNode("p",Xk,m.toDisplayString(s.value.prompt),1),m.createElementVNode("div",Rk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(s.value.actions,j=>(m.openBlock(),m.createElementBlock("button",{key:j.action,type:"button",class:m.normalizeClass(["apf-approval-btn",j.style==="danger"?"apf-approval-btn-danger":"apf-approval-btn-primary"]),disabled:C.sending,onClick:E=>B(j.action)},m.toDisplayString(j.label),11,Hk))),128))])],2)):m.createCommentVNode("",!0)])],2)}}}),[["__scopeId","data-v-ac1e899a"]]),Sk={key:0,class:"apf-skeleton-line"},Mk=bg(m.defineComponent({__name:"MessageList",props:{messages:{},loading:{type:Boolean},currentRun:{},sending:{type:Boolean},brandMark:{}},emits:["resume","cancel","retry","open-process","preview"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(null);m.watch(()=>g.messages.length,async()=>{await m.nextTick(),i.value&&(i.value.scrollTop=i.value.scrollHeight)},{flush:"post"}),m.watch(()=>g.messages.map(e=>`${e.id}:${e.status}:${(e.content||"").length}`).join("|"),async()=>{await m.nextTick(),i.value&&(i.value.scrollTop=i.value.scrollHeight)},{flush:"post"});function l(e){return!g.currentRun||!e.runtimeExecutionId?null:g.currentRun.runtimeExecutionId===e.runtimeExecutionId?g.currentRun:null}return(e,c)=>(m.openBlock(),m.createElementBlock("div",{ref_key:"container",ref:i,class:"apf-message-list"},[C.loading&&!C.messages.length?(m.openBlock(),m.createElementBlock("div",Sk,[...c[4]||(c[4]=[m.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"60%"}},null,-1),m.createElementVNode("div",{class:"apf-skeleton",style:{height:"var(--icon-size-sm, 14px)",width:"45%","margin-top":"var(--spacing-sm, 8px)"}},null,-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.messages,a=>(m.openBlock(),m.createBlock(RW,{key:a.id,message:a,run:l(a),sending:!!C.sending,"brand-mark":C.brandMark,"session-messages":C.messages,onResume:c[0]||(c[0]=(d,t)=>A("resume",d,t)),onCancel:c[1]||(c[1]=d=>A("cancel")),onRetry:c[2]||(c[2]=d=>A("retry")),onOpenProcess:d=>A("open-process",a),onPreview:c[3]||(c[3]=d=>A("preview",d))},null,8,["message","run","sending","brand-mark","session-messages","onOpenProcess"]))),128))],512))}}),[["__scopeId","data-v-0957f79a"]]),Dk={key:0,class:"apf-pending-list"},Kk=["src"],Fk={class:"apf-pending-name"},vk={key:1,class:"apf-pending-status"},Jk={key:2,class:"apf-pending-status apf-error"},zk=["onClick"],kk=["placeholder","disabled"],Lk={class:"apf-composer-footer"},xk={class:"apf-composer-tools"},Tk=["disabled"],fk=["disabled"],jk={class:"apf-composer-meta"},Qk={class:"apf-cap-row"},Uk={key:0,class:"apf-cap-chip"},Ok={key:1,class:"apf-cap-chip"},Ek={class:"apf-meta-right"},Pk=bg(m.defineComponent({__name:"Composer",props:{disabled:{type:Boolean},placeholder:{},supportedInputs:{},hitlCapable:{type:Boolean},wsStatus:{},wsLabel:{}},emits:["send","upload","remove-attachment","ws-click"],setup(C,{emit:I}){const g=C,A=I,i=m.ref(""),l=m.ref(null),e=m.ref(null),c=m.ref([]),a=m.ref(!1),d=m.computed(()=>g.supportedInputs||["text"]),t=m.computed(()=>d.value.some(r=>r==="file"||r==="image"||r==="document")),Z=m.computed(()=>{if(g.disabled||a.value)return!1;const r=!!i.value.trim(),u=c.value.some(Y=>Y.status==="done"),B=c.value.some(Y=>Y.status==="uploading");return(r||u)&&!B});function o(){var r;g.disabled||!t.value||(r=e.value)==null||r.click()}function n(r){const u=r.target,B=u.files;if(B!=null&&B.length){for(const Y of Array.from(B))A("upload",Y);u.value=""}}function s(r){const u=c.value.find(B=>B.id===r);u!=null&&u.previewUrl&&URL.revokeObjectURL(u.previewUrl),c.value=c.value.filter(B=>B.id!==r),A("remove-attachment",r)}async function b(){if(!Z.value)return;const r=i.value.trim(),u=c.value.filter(B=>B.status==="done").map(B=>B.id);A("send",r,u),i.value="",c.value.forEach(B=>{B.previewUrl&&URL.revokeObjectURL(B.previewUrl)}),c.value=[],await m.nextTick(),l.value&&(l.value.style.height="auto")}function G(r){const u=r.target;u.style.height="auto",u.style.height=Math.min(u.scrollHeight,220)+"px"}function h(r){r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),b())}return m.onBeforeUnmount(()=>{c.value.forEach(r=>{r.previewUrl&&URL.revokeObjectURL(r.previewUrl)})}),(r,u)=>(m.openBlock(),m.createElementBlock("form",{class:"apf-composer",onSubmit:m.withModifiers(b,["prevent"])},[m.createElementVNode("div",{class:m.normalizeClass(["apf-composer-field",{"apf-disabled":C.disabled}])},[c.value.length?(m.openBlock(),m.createElementBlock("div",Dk,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.value,B=>(m.openBlock(),m.createElementBlock("div",{key:B.id,class:m.normalizeClass(["apf-pending-chip",B.status])},[B.previewUrl?(m.openBlock(),m.createElementBlock("img",{key:0,src:B.previewUrl,alt:"",class:"apf-pending-thumb"},null,8,Kk)):m.createCommentVNode("",!0),m.createElementVNode("span",Fk,m.toDisplayString(B.filename),1),B.status==="uploading"?(m.openBlock(),m.createElementBlock("span",vk,"上传中")):B.status==="error"?(m.openBlock(),m.createElementBlock("span",Jk,m.toDisplayString(B.error||"失败"),1)):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"apf-pending-remove",onClick:Y=>s(B.id)},"×",8,zk)],2))),128))])):m.createCommentVNode("",!0),m.withDirectives(m.createElementVNode("textarea",{ref_key:"textareaRef",ref:l,"onUpdate:modelValue":u[0]||(u[0]=B=>i.value=B),placeholder:C.placeholder||"输入消息…",disabled:C.disabled,onInput:G,onKeydown:h},null,40,kk),[[m.vModelText,i.value]]),m.createElementVNode("div",Lk,[m.createElementVNode("div",xk,[m.renderSlot(r.$slots,"tools",{},void 0,!0),m.createElementVNode("input",{ref_key:"fileInputRef",ref:e,type:"file",class:"apf-file-input",multiple:"",accept:"image/*,.pdf,.txt,.md,.csv,.json,.doc,.docx,.xls,.xlsx",onChange:n},null,544),t.value?(m.openBlock(),m.createElementBlock("button",{key:0,class:"apf-cap-btn",type:"button","aria-label":"添加文件",disabled:C.disabled||a.value,onClick:o},[...u[2]||(u[2]=[m.createElementVNode("svg",{viewBox:"0 0 16 16",width:"14",height:"14"},[m.createElementVNode("path",{d:"M9.2 2.8 4.4 7.6a2.6 2.6 0 0 0 3.7 3.7l5.2-5.2a1.8 1.8 0 0 0-2.5-2.5L5.6 8.8",fill:"none",stroke:"currentColor","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"})],-1)])],8,Tk)):m.createCommentVNode("",!0)]),m.createElementVNode("button",{type:"submit",class:"apf-send-btn",disabled:!Z.value,title:"发送"},"↗",8,fk)])],2),m.createElementVNode("div",jk,[m.createElementVNode("div",Qk,[u[3]||(u[3]=m.createElementVNode("span",{class:"apf-cap-chip"},"文本",-1)),t.value?(m.openBlock(),m.createElementBlock("span",Uk,"文件")):m.createCommentVNode("",!0),C.hitlCapable?(m.openBlock(),m.createElementBlock("span",Ok,"需要确认")):m.createCommentVNode("",!0)]),m.createElementVNode("div",Ek,[C.wsStatus?(m.openBlock(),m.createElementBlock("button",{key:0,type:"button",class:m.normalizeClass(["apf-ws-status",C.wsStatus]),onClick:u[1]||(u[1]=B=>A("ws-click"))},[...u[4]||(u[4]=[m.createElementVNode("i",{class:"apf-ws-dot"},null,-1)])],2)):m.createCommentVNode("",!0),u[5]||(u[5]=m.createElementVNode("small",{class:"apf-hint"},"Enter 发送 · Shift+Enter 换行",-1))])])],32))}}),[["__scopeId","data-v-45ece43f"]]),_k={key:0,class:"apf-run-bar"},qk={class:"apf-row"},$k={key:0,class:"apf-elapsed"},gL={key:0,class:"apf-error-text"},HW=bg(m.defineComponent({__name:"RunStatusBar",props:{run:{},sending:{type:Boolean}},emits:["cancel"],setup(C,{emit:I}){const g=C,A=I,i=m.computed(()=>{var a;return((a=g.run)==null?void 0:a.status)||null});function l(a){return{RUNNING:"正在处理",COMPLETED:"已完成",FAILED:"处理失败",WAITING_INPUT:"等待你的确认",CANCELLED:"已取消"}[a]||a}function e(a){return{RUNNING:"apf-running",COMPLETED:"apf-success",FAILED:"apf-failed",WAITING_INPUT:"apf-waiting",CANCELLED:"apf-cancelled"}[a]||""}function c(){if(!g.run)return"";const a=new Date(g.run.startedAt).getTime(),d=g.run.finishedAt?new Date(g.run.finishedAt).getTime():Date.now(),t=Math.round((d-a)/1e3);return t<60?t+"s":Math.floor(t/60)+"m "+t%60+"s"}return(a,d)=>C.run?(m.openBlock(),m.createElementBlock("div",_k,[m.createElementVNode("div",qk,[m.createElementVNode("span",{class:m.normalizeClass(["apf-chip",e(i.value||"")])},[d[1]||(d[1]=m.createElementVNode("i",null,null,-1)),m.createTextVNode(m.toDisplayString(l(i.value||"")),1)],2),i.value==="RUNNING"||i.value==="WAITING_INPUT"?(m.openBlock(),m.createElementBlock("span",$k,m.toDisplayString(c()),1)):m.createCommentVNode("",!0),i.value==="RUNNING"?(m.openBlock(),m.createElementBlock("button",{key:1,class:"apf-btn-cancel",onClick:d[0]||(d[0]=t=>A("cancel"))},"停止")):m.createCommentVNode("",!0)]),C.run.errorMessage?(m.openBlock(),m.createElementBlock("p",gL,m.toDisplayString(C.run.errorMessage),1)):m.createCommentVNode("",!0)])):m.createCommentVNode("",!0)}}),[["__scopeId","data-v-33963f1d"]]),IL={class:"apf-header"},CL={key:0,class:"apf-danger-tag"},AL={class:"apf-prompt"},iL=["placeholder"],lL=["value"],eL=["placeholder"],cL={class:"apf-actions"},aL=["disabled","onClick"],dL=bg(m.defineComponent({__name:"ApprovalCard",props:{waiting:{},disabled:{type:Boolean}},emits:["resume"],setup(C,{emit:I}){const g=I,A=m.ref("");function i(l){g("resume",l,A.value||void 0),A.value=""}return(l,e)=>C.waiting?(m.openBlock(),m.createElementBlock("div",{key:0,class:m.normalizeClass(["apf-approval-card",{"apf-dangerous":C.waiting.dangerous}])},[m.createElementVNode("div",IL,[e[3]||(e[3]=m.createElementVNode("span",{class:"apf-title"},"需要你的操作",-1)),C.waiting.dangerous?(m.openBlock(),m.createElementBlock("span",CL,"危险操作")):m.createCommentVNode("",!0)]),m.createElementVNode("p",AL,m.toDisplayString(C.waiting.prompt),1),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.waiting.fields,c=>(m.openBlock(),m.createElementBlock("div",{key:c.key,class:"apf-field"},[m.createElementVNode("label",null,m.toDisplayString(c.label),1),c.type==="textarea"?m.withDirectives((m.openBlock(),m.createElementBlock("textarea",{key:0,"onUpdate:modelValue":e[0]||(e[0]=a=>A.value=a),placeholder:"请输入"+c.label,rows:"2"},null,8,iL)),[[m.vModelText,A.value]]):c.type==="select"&&c.options.length?m.withDirectives((m.openBlock(),m.createElementBlock("select",{key:1,"onUpdate:modelValue":e[1]||(e[1]=a=>A.value=a)},[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(c.options,a=>(m.openBlock(),m.createElementBlock("option",{key:a,value:a},m.toDisplayString(a),9,lL))),128))],512)),[[m.vModelSelect,A.value]]):m.withDirectives((m.openBlock(),m.createElementBlock("input",{key:2,"onUpdate:modelValue":e[2]||(e[2]=a=>A.value=a),placeholder:"请输入"+c.label},null,8,eL)),[[m.vModelText,A.value]])]))),128)),m.createElementVNode("div",cL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.waiting.actions,c=>(m.openBlock(),m.createElementBlock("button",{key:c.action,class:m.normalizeClass(["apf-btn",c.style==="danger"?"apf-btn-danger":"apf-btn-primary"]),disabled:C.disabled,onClick:a=>i(c.action)},m.toDisplayString(c.label),11,aL))),128))])],2)):m.createCommentVNode("",!0)}}),[["__scopeId","data-v-ca69b479"]]),tL={class:"apf-session-sidebar","aria-label":"会话列表"},ZL={class:"apf-session-sidebar__head"},oL={class:"apf-session-sidebar__list"},nL=["onClick"],sL={class:"apf-session-sidebar__item-title"},mL={key:0,class:"apf-session-sidebar__empty"},bL=bg(m.defineComponent({__name:"SessionSidebar",props:{sessions:{},activeId:{},loading:{type:Boolean},title:{}},emits:["select","create","delete"],setup(C,{emit:I}){const g=I;function A(i){if(!i)return"";const l=new Date(i),e=(Date.now()-l.getTime())/1e3;return e<60?"刚刚":e<3600?`${Math.floor(e/60)} 分钟前`:e<86400?`${Math.floor(e/3600)} 小时前`:l.toLocaleDateString("zh-CN")}return(i,l)=>{const e=m.resolveComponent("el-button"),c=m.resolveDirective("loading");return m.openBlock(),m.createElementBlock("aside",tL,[m.createElementVNode("div",ZL,[m.createElementVNode("strong",null,m.toDisplayString(C.title||"会话"),1),m.createVNode(e,{type:"primary",size:"small",onClick:l[0]||(l[0]=a=>g("create"))},{default:m.withCtx(()=>[...l[1]||(l[1]=[m.createTextVNode("新建",-1)])]),_:1})]),m.withDirectives((m.openBlock(),m.createElementBlock("div",oL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.sessions,a=>(m.openBlock(),m.createElementBlock("button",{key:a.id,type:"button",class:m.normalizeClass(["apf-session-sidebar__item",{"is-active":a.id===C.activeId}]),onClick:d=>g("select",a.id)},[m.createElementVNode("span",sL,m.toDisplayString(a.title||"未命名会话"),1),m.createElementVNode("small",null,m.toDisplayString(A(a.updatedAt||a.createdAt)),1),m.createVNode(e,{class:"apf-session-sidebar__delete",link:"",type:"danger",size:"small",onClick:m.withModifiers(d=>g("delete",a.id),["stop"])},{default:m.withCtx(()=>[...l[2]||(l[2]=[m.createTextVNode(" 删除 ",-1)])]),_:1},8,["onClick"])],10,nL))),128)),!C.loading&&!C.sessions.length?(m.openBlock(),m.createElementBlock("div",mL,"暂无会话")):m.createCommentVNode("",!0)])),[[c,C.loading]])])}}}),[["__scopeId","data-v-2a3b7a7c"]]),GL={key:0,class:"apf-processing-drawer__subtitle"},hL={class:"apf-processing-drawer__body"},rL=bg(m.defineComponent({__name:"ProcessingDrawer",props:{modelValue:{type:Boolean},run:{},title:{},subtitle:{},sending:{type:Boolean}},emits:["update:modelValue","cancel"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=m.resolveComponent("el-drawer");return m.openBlock(),m.createBlock(l,{"model-value":C.modelValue,title:C.title||"处理详情",size:"380px","append-to-body":"","onUpdate:modelValue":i[1]||(i[1]=e=>g("update:modelValue",e))},{default:m.withCtx(()=>[C.subtitle?(m.openBlock(),m.createElementBlock("p",GL,m.toDisplayString(C.subtitle),1)):m.createCommentVNode("",!0),C.run?(m.openBlock(),m.createBlock(m.unref(HW),{key:1,run:C.run,sending:C.sending??!1,onCancel:i[0]||(i[0]=e=>g("cancel"))},null,8,["run","sending"])):m.createCommentVNode("",!0),m.createElementVNode("div",hL,[m.renderSlot(A.$slots,"default",{},void 0,!0)])]),_:3},8,["model-value","title"])}}}),[["__scopeId","data-v-6036074a"]]),uL={class:"apf-conversation-header"},BL={class:"apf-conversation-header__identity"},WL={class:"apf-conversation-header__copy"},YL={class:"apf-conversation-header__label"},wL={class:"apf-conversation-header__actions"},VL={key:0,class:"apf-conversation-header__processing"},NL=bg(m.defineComponent({__name:"ConversationHeader",props:{title:{},label:{},hasMessages:{type:Boolean},processing:{type:Boolean}},emits:["changeAssistant","toggleDetails","create"],setup(C,{emit:I}){const g=I;return(A,i)=>(m.openBlock(),m.createElementBlock("header",uL,[m.createElementVNode("div",BL,[m.createElementVNode("div",WL,[m.createElementVNode("span",YL,m.toDisplayString(C.label||"正在使用"),1),m.createElementVNode("strong",null,m.toDisplayString(C.title||"选择一个智能体开始"),1)])]),m.createElementVNode("div",wL,[C.processing?(m.openBlock(),m.createElementBlock("span",VL,[...i[2]||(i[2]=[m.createElementVNode("i",null,null,-1),m.createElementVNode("span",null,"正在处理",-1)])])):m.createCommentVNode("",!0),m.createElementVNode("button",{type:"button",class:"apf-conversation-header__btn",onClick:i[0]||(i[0]=l=>C.hasMessages?g("create"):g("changeAssistant"))},m.toDisplayString(C.hasMessages?"新建对话":"选择智能体"),1),C.hasMessages?(m.openBlock(),m.createElementBlock("button",{key:1,type:"button",class:"apf-conversation-header__btn",onClick:i[1]||(i[1]=l=>g("toggleDetails"))}," 处理详情 ")):m.createCommentVNode("",!0)])]))}}),[["__scopeId","data-v-d93df7f9"]]),yL={class:"apf-assistant-picker"},pL={key:0,class:"apf-assistant-picker__state"},XL={key:1,class:"apf-assistant-picker__state apf-assistant-picker__state--error"},RL={key:2,class:"apf-assistant-picker__state"},HL=["onClick"],SL={class:"apf-assistant-picker__main"},ML={class:"apf-assistant-picker__icon-wrap"},DL={class:"apf-assistant-picker__info"},KL={class:"apf-assistant-picker__caps"},FL=bg(m.defineComponent({__name:"AssistantPicker",props:{items:{},modelValue:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["update:modelValue","select"],setup(C,{emit:I}){const g=C,A=I;function i(a){var t,Z;const d=["文本"];return(t=a.supportedInputs)!=null&&t.includes("file")&&d.push("文件"),(Z=a.supportedInputs)!=null&&Z.includes("image")&&d.push("图片"),a.hitlCapable&&d.push("需要确认"),d}function l(a){return a.icon||"chat-dot-round"}function e(a){A("update:modelValue",a.id),A("select",a)}const c=m.computed(()=>!g.loading&&!g.error&&!g.items.length);return(a,d)=>(m.openBlock(),m.createElementBlock("div",yL,[C.loading?(m.openBlock(),m.createElementBlock("div",pL,[...d[0]||(d[0]=[m.createElementVNode("p",null,"正在加载智能体…",-1)])])):C.error?(m.openBlock(),m.createElementBlock("div",XL,[m.createElementVNode("p",null,m.toDisplayString(C.error),1)])):c.value?(m.openBlock(),m.createElementBlock("div",RL,[...d[1]||(d[1]=[m.createElementVNode("p",null,"暂无可用智能体",-1)])])):m.createCommentVNode("",!0),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.items,t=>(m.openBlock(),m.createElementBlock("button",{key:t.id,type:"button",class:m.normalizeClass(["apf-assistant-picker__item",{"is-active":C.modelValue===t.id}]),onClick:Z=>e(t)},[m.createElementVNode("div",SL,[m.createElementVNode("span",ML,[m.createVNode(m.unref(KI),{name:l(t),size:22},null,8,["name"])]),m.createElementVNode("span",DL,[m.createElementVNode("b",null,m.toDisplayString(t.name),1),m.createElementVNode("small",null,m.toDisplayString(t.description||"适合处理一类明确任务"),1),m.createElementVNode("span",KL,[(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(i(t),Z=>(m.openBlock(),m.createElementBlock("span",{key:Z,class:m.normalizeClass(["apf-assistant-picker__cap",{"is-confirm":Z==="需要确认"}])},m.toDisplayString(Z),3))),128))])])]),m.createElementVNode("span",{class:m.normalizeClass(["apf-assistant-picker__choose",{"is-selected":C.modelValue===t.id}])},m.toDisplayString(C.modelValue===t.id?"已选择":"开始使用"),3)],10,HL))),128))]))}}),[["__scopeId","data-v-f05e69c0"]]),vL={class:"apf-model-picker"},JL=bg(m.defineComponent({__name:"ModelPicker",props:{models:{},modelValue:{},loading:{type:Boolean}},emits:["update:modelValue"],setup(C,{emit:I}){const g=I;return(A,i)=>{const l=m.resolveComponent("el-option"),e=m.resolveComponent("el-select");return m.openBlock(),m.createElementBlock("label",vL,[m.createVNode(e,{"model-value":C.modelValue||void 0,disabled:C.loading||!C.models.length,placeholder:"选择模型","onUpdate:modelValue":i[0]||(i[0]=c=>g("update:modelValue",c))},{default:m.withCtx(()=>[C.loading?(m.openBlock(),m.createBlock(l,{key:0,label:"正在加载模型…",value:"",disabled:""})):C.models.length?m.createCommentVNode("",!0):(m.openBlock(),m.createBlock(l,{key:1,label:"暂无可用模型",value:"",disabled:""})),(m.openBlock(!0),m.createElementBlock(m.Fragment,null,m.renderList(C.models,c=>(m.openBlock(),m.createBlock(l,{key:c.id,label:`${c.name} · ${c.provider}`,value:c.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","disabled"])])}}}),[["__scopeId","data-v-483ae73d"]]),SW=Symbol("fg-toast");function zL(C){return{[SW]:C}}function kL(){const C=m.inject(SW);return{show(I,g="info",A){var i;(i=C==null?void 0:C.value)==null||i.show(I,g,A)},info(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"info",g)},success(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"success",g)},warning(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"warning",g)},error(I,g){var A;(A=C==null?void 0:C.value)==null||A.show(I,"error",g)}}}function LL(){async function C(A,i={}){const{title:l="确认操作",type:e="warning",confirmButtonText:c="确定",cancelButtonText:a="取消"}=i;try{return await HC.ElMessageBox.confirm(A,l,{confirmButtonText:c,cancelButtonText:a,type:e}),!0}catch{return!1}}async function I(A,i={}){return C(`此操作将永久删除${A},是否继续?`,{title:"确认删除",type:"warning",confirmButtonText:"确认删除",...i})}async function g(A,i={}){return C(A,{title:"确认操作",type:"warning",...i})}return{confirm:C,confirmDelete:I,confirmDanger:g}}function xL(){return{success(C,I={}){HC.ElMessage({message:C,type:"success",...I})},error(C,I={}){HC.ElMessage({message:C,type:"error",...I})},warning(C,I={}){HC.ElMessage({message:C,type:"warning",...I})},info(C,I={}){HC.ElMessage({message:C,type:"info",...I})}}}function TL(C,I=300){const g=m.ref(null);function A(...i){g.value&&clearTimeout(g.value),g.value=setTimeout(()=>{C(...i),g.value=null},I)}return m.onUnmounted(()=>{g.value&&clearTimeout(g.value)}),A}function fL(C,I){var c;const g=m.ref(1),A=m.ref((I==null?void 0:I.initialPageSize)??ys),i=m.computed(()=>{const a=C.value,d=(g.value-1)*A.value;return a.slice(d,d+A.value)}),l=m.computed(()=>C.value.length);function e(){g.value=1}return m.watch(A,()=>{g.value=1},{flush:"sync"}),m.watch(C,a=>{const d=Math.max(1,Math.ceil(a.length/A.value)||1);g.value>d&&(g.value=d)}),(c=I==null?void 0:I.resetOn)!=null&&c.length&&m.watch(I.resetOn,()=>{e()}),{currentPage:g,pageSize:A,pagedItems:i,total:l,resetPage:e}}function jL(C={}){const{timeout:I=15e3,silentError:g=!1}=C,A=m.ref(!1),i=m.ref(null),l=m.ref(!1),e=m.computed(()=>i.value!==null);let c=null,a=0;function d(){a++,a===1&&(A.value=!0,i.value=null,l.value=!1,c=setTimeout(()=>{l.value=!0},I))}function t(){a=Math.max(0,a-1),a===0&&(A.value=!1,l.value=!1,c&&(clearTimeout(c),c=null))}async function Z(n){d();try{return await n()}catch(s){return g||(i.value=s instanceof Error?s.message:"加载失败"),null}finally{t()}}function o(){a=0,A.value=!1,i.value=null,l.value=!1,c&&(clearTimeout(c),c=null)}return{loading:A,error:i,timedOut:l,hasError:e,withLoading:Z,reset:o}}function QL(C){const{containerRef:I,autoScroll:g=!0,behavior:A="smooth",offset:i=50}=C,l=m.ref(!0),e=m.ref(g);function c(){const n=I.value;if(!n)return!0;const{scrollTop:s,scrollHeight:b,clientHeight:G}=n;return b-s-G<i}async function a(n=!0){if(!n&&!e.value)return;await m.nextTick();const s=I.value;s&&s.scrollTo({top:s.scrollHeight,behavior:A})}function d(n){const s=I.value;s&&s.scrollTo({top:n,behavior:A})}function t(){e.value=!0}function Z(){e.value=!1}function o(){l.value=c(),l.value&&(e.value=!0)}return m.onMounted(()=>{const n=I.value;n&&(n.addEventListener("scroll",o),l.value=c())}),m.onUnmounted(()=>{const n=I.value;n&&n.removeEventListener("scroll",o)}),{scrollToBottom:a,scrollTo:d,isAtBottom:l,autoScrollEnabled:e,checkIfAtBottom:c,enableAutoScroll:t,disableAutoScroll:Z}}const Es=new Map;function UL(C){const{url:I,token:g,projectId:A,reconnectInterval:i=3e3,maxRetries:l=1/0}=C;let e=Es.get(I);e||(e={ws:null,status:m.ref("closed"),refCount:0,handlers:new Map,subscribedProjects:new Set,reconnectTimer:null,pingTimer:null,pongTimer:null,retries:0,reconnectInterval:i,maxRetries:l,intentionalClose:!1,token:g},Es.set(I,e)),e.refCount+=1,e.reconnectInterval=i,e.maxRetries=l,e.token=g;const c=[],a=e.status,d=()=>m.toValue(A);function t(){e&&(e.pingTimer&&clearInterval(e.pingTimer),e.pongTimer&&clearTimeout(e.pongTimer),e.pingTimer=null,e.pongTimer=null)}function Z(){e&&(t(),e.pingTimer=setInterval(()=>{!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN||(e.ws.send(JSON.stringify({action:"ping"})),e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=setTimeout(()=>{var B;(B=e==null?void 0:e.ws)==null||B.close()},6e4))},3e4))}function o(){if(!e||e.intentionalClose)return;if(e.retries>=e.maxRetries){e.status.value="error";return}const B=Math.min(e.reconnectInterval*2**e.retries,3e4);e.retries+=1,e.reconnectTimer&&clearTimeout(e.reconnectTimer),e.reconnectTimer=setTimeout(()=>{G()},B)}function n(B){if(!(e!=null&&e.ws)||e.ws.readyState!==WebSocket.OPEN)return;const Y={action:"subscribe",project_id:B??null},W=typeof e.token=="function"?e.token():e.token;if(W&&(Y.token=W),!e.subscribedProjects.has(B??null)){if(B==null){e.ws.send(JSON.stringify(Y)),e.subscribedProjects.add(null);return}e.ws.send(JSON.stringify(Y)),e.subscribedProjects.add(B)}}function s(){if(!e)return;e.subscribedProjects.clear();const B=new Set;let Y=!1;for(const w of e.handlers.values())for(const N of w){const V=N.getProjectId();V==null?Y=!0:B.add(V)}const W=d();W==null?Y=!0:B.add(W),Y&&n(void 0);for(const w of B)n(w)}function b(B){if(!e)return;const Y=e.handlers.get(B.type);if(Y)for(const W of Y){const w=W.getProjectId();w!=null&&w!==B.project_id||W.handler(B.data)}}function G(){if(!e)return;if(e.ws&&(e.ws.readyState===WebSocket.OPEN||e.ws.readyState===WebSocket.CONNECTING)){e.ws.readyState===WebSocket.OPEN&&n(d());return}e.intentionalClose=!1,e.status.value="connecting";const B=new WebSocket(I);e.ws=B,B.onopen=()=>{e&&(e.status.value="open",e.retries=0,Z(),s())},B.onmessage=Y=>{if(e)try{const W=JSON.parse(String(Y.data));if(W.action==="pong"||W.type==="pong"){e.pongTimer&&clearTimeout(e.pongTimer),e.pongTimer=null;return}typeof W.type=="string"&&b(W)}catch{}},B.onerror=()=>{e&&(e.status.value="error")},B.onclose=()=>{e&&(t(),e.ws=null,e.subscribedProjects.clear(),e.intentionalClose?e.status.value="closed":(e.status.value="closed",o()))}}function h(){if(e){for(const B of c)for(const Y of e.handlers.values())Y.delete(B);c.length=0}}function r(){var B;e&&(h(),e.refCount=Math.max(0,e.refCount-1),!(e.refCount>0)&&(e.intentionalClose=!0,e.reconnectTimer&&clearTimeout(e.reconnectTimer),t(),(B=e.ws)==null||B.close(),e.ws=null,e.status.value="closed",Es.delete(I),e=void 0))}function u(B,Y){var N;if(!e)return()=>{};let W=e.handlers.get(B);W||(W=new Set,e.handlers.set(B,W));const w={getProjectId:d,handler:Y};return W.add(w),c.push(w),((N=e.ws)==null?void 0:N.readyState)===WebSocket.OPEN&&n(d()),()=>{W==null||W.delete(w);const V=c.indexOf(w);V>=0&&c.splice(V,1)}}return G(),m.watch(d,B=>{var Y;((Y=e==null?void 0:e.ws)==null?void 0:Y.readyState)===WebSocket.OPEN&&n(B)}),m.onUnmounted(()=>{r()}),{status:a,connect:G,disconnect:r,on:u}}function OL(C){if(!C)return"操作失败";if(typeof C=="string")return C;if(C instanceof Error)return C.message||"操作失败";if(typeof C=="object"){const I=C;if(I.message)return I.message;if(I.errors&&typeof I.errors=="object"){const g=[];for(const A of Object.values(I.errors))Array.isArray(A)&&g.push(...A);if(g.length>0)return g.join(";")}if(I.code)return`错误码:${I.code}`}return"操作失败"}const EL=/\/(?:schema-platform\/)?api\/ai\/documents\/([^/?#]+)\/file/i,MW=/\.(mp4|webm|mov|m4v)(?:\?|#|$|\s)/i,PL=/\.(png|jpe?g|gif|webp|bmp|svg)(?:\?|#|$|\s)/i,Ps=/\.pdf(?:\?|#|$|\s)/i,_s=/\.(docx?|xlsx?|csv|txt|md)(?:\?|#|$|\s)/i,DW=/(?:https?:\/\/[^\s"'<>\]]+|\/(?:schema-platform\/)?api\/ai\/documents\/[^/\s"'<>\]]+\/file)/gi;function ze(C){const I=C.trim().match(EL);if(I!=null&&I[1])return I[1];if(/^[0-9a-f]{24}$/i.test(C.trim()))return C.trim()}function sl(C){const{url:I="",filename:g="",mimetype:A="",hint:i}=C;if(i==="video"||i==="videoUrl")return"video";if(i==="image"||i==="imageUrls")return"image";if(i==="text")return"text";if(i==="json")return"json";if(i==="document"||i==="documentIds"){const c=g||I;return Ps.test(c)||A.includes("pdf")?"pdf":_s.test(c)||/word|sheet|excel|csv|text/.test(A)?"office":"file"}const l=[I,g].filter(Boolean).join(" ").toLowerCase(),e=A.toLowerCase();return e.startsWith("video/")||MW.test(l)?"video":e.startsWith("image/")||PL.test(l)?"image":e.includes("pdf")||Ps.test(l)?"pdf":_s.test(l)||e.includes("word")||e.includes("sheet")||e.includes("excel")||e.includes("csv")||e.startsWith("text/")?"office":ze(I)&&!Ps.test(I)&&!_s.test(I)&&!MW.test(I)?"image":"file"}function ui(C,I,g){var i;const A=g.url||g.documentId||`${g.kind}:${((i=g.text)==null?void 0:i.slice(0,40))??g.id}`;!A||I.has(A)||(I.add(A),C.push(g))}function qs(C){const I=C.trim();if(!I)return null;const g=[I],A=I.match(/^```(?:json)?\s*([\s\S]*?)```$/i);A!=null&&A[1]&&g.unshift(A[1].trim());for(const i of g)if(!(i[0]!=="{"&&i[0]!=="["))try{const l=JSON.parse(i);if(l==null||typeof l!="object")continue;return{kind:"json",text:JSON.stringify(l,null,2)}}catch{}return null}function _L(C,I="art"){if(C==null)return[];const g=[],A=new Set;let i=0;const l=()=>`${I}-${++i}`;if(typeof C=="string"){const a=C.match(DW)??[];for(const d of a){const t=sl({url:d});ui(g,A,{id:l(),kind:t,url:d,documentId:ze(d),source:"text"})}if(!a.length&&C.trim()){const d=qs(C);ui(g,A,{id:l(),kind:(d==null?void 0:d.kind)??"text",text:(d==null?void 0:d.text)??C,label:d?"JSON 输出":"文本输出",source:"text"})}return g}if(typeof C!="object")return g;const e=C;typeof e.videoUrl=="string"&&e.videoUrl.trim()&&ui(g,A,{id:l(),kind:"video",url:e.videoUrl,documentId:ze(e.videoUrl),source:"videoUrl"});const c=(a,d,t)=>{if(Array.isArray(a))for(const Z of a){let o="";if(typeof Z=="string"?o=Z:Z&&typeof Z=="object"&&"url"in Z&&(o=String(Z.url??"")),!o.trim())continue;const n=sl({url:o,hint:t});ui(g,A,{id:l(),kind:n,url:o,documentId:ze(o),source:d})}};if(c(e.imageUrls,"imageUrls","image"),c(e.images,"images","image"),c(e.mediaUrls,"mediaUrls"),c(e.referenceImageUrls,"referenceImageUrls","image"),Array.isArray(e.documentIds))for(const a of e.documentIds)typeof a!="string"||!a.trim()||ui(g,A,{id:l(),kind:sl({url:a,hint:"document"}),documentId:a,url:void 0,label:`文档 ${a.slice(-6)}`,source:"documentIds"});typeof e.documentId=="string"&&e.documentId.trim()&&ui(g,A,{id:l(),kind:sl({url:e.documentId,hint:"document"}),documentId:e.documentId,label:`文档 ${e.documentId.slice(-6)}`,source:"documentId"});for(const a of["text","message","confirmMessage","prompt"]){const d=e[a];if(typeof d!="string"||!d.trim())continue;const t=d.match(DW)??[];for(const Z of t)ui(g,A,{id:l(),kind:sl({url:Z}),url:Z,documentId:ze(Z),source:a});if(!t.length&&(a==="text"||a==="message")){const Z=a==="text"?qs(d):null;ui(g,A,{id:l(),kind:(Z==null?void 0:Z.kind)??"text",text:(Z==null?void 0:Z.text)??d,label:Z?"JSON 输出":a==="text"?"文本输出":"确认提示",source:a})}}return g}function qL(C){return C.map((I,g)=>{const A=sl({url:I.url,filename:I.filename,mimetype:I.mimetype});return{id:I.id||`att-${g}`,kind:A,url:I.url,documentId:I.id,filename:I.filename,mimetype:I.mimetype,label:I.filename,source:"attachment"}})}const $L="1.9.1",gx="2.14.2",Ix="2026-08-27";/*! *****************************************************************************
|
|
72
72
|
Copyright (c) Microsoft Corporation.
|
|
73
73
|
|
|
74
74
|
Permission to use, copy, modify, and/or distribute this software for any
|
package/dist/index.d.ts
CHANGED
|
@@ -110,6 +110,6 @@ export type { TextPart } from './utils/textParser';
|
|
|
110
110
|
export { isImage, isPdf, isOffice, isPreviewable, fileKind, formatSize } from './utils/attachmentKind';
|
|
111
111
|
export { extractDocumentId, detectArtifactKind, normalizeNodeOutput, normalizeAttachments, tryParseJsonText, } from './utils/normalizeArtifact';
|
|
112
112
|
export { COLORS, CHART_COLORS, TEXT_COLORS, SPACING, BORDER_RADIUS, SHADOWS, DURATION, Z_INDEX, FONT_SIZE, CONTROL_HEIGHT, LAYOUT_HEIGHT, ICON_SIZE, PAGE, FORM, AVATAR_SIZE, } from './tokens';
|
|
113
|
-
export declare const SCHEMA_UI_VERSION = "1.9.
|
|
113
|
+
export declare const SCHEMA_UI_VERSION = "1.9.1";
|
|
114
114
|
export declare const EP_FORK_BASE = "2.14.2";
|
|
115
115
|
export declare const EP_FORK_DATE = "2026-08-27";
|