55 行
492 KiB
JavaScript
55 行
492 KiB
JavaScript
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/GalleryPage-_hEv4t9o.js","assets/GalleryPage-BYYx2bqw.css","assets/LogsPage-BCu3j0AQ.js","assets/LogsPage-BUeTyehJ.css","assets/ProfilesPage-DXTRaKak.js","assets/ProfilesPage-B0WTnM4e.css","assets/SettingsPage-BIIghPr-.js","assets/SettingsPage-BR5nrF_4.css","assets/WorkflowCompareDialog-BZ20cDz0.js","assets/WorkflowCompareDialog-BI_xR1pa.css","assets/WorkflowBranchPanel-CSON-lvz.js","assets/WorkflowBranchPanel-nMe9nW01.css","assets/WorkflowCandidatePool-xlud6FG4.js","assets/WorkflowCandidatePool-CHJiY32s.css","assets/WorkflowComposer-Do_KBQYI.js","assets/WorkflowComposer-D0-o7edc.css","assets/WorkflowDependencyContextCard-BstMEtF2.js","assets/WorkflowDependencyContextCard-WHidWt7d.css","assets/WorkflowGenerationReviewDialog-C-mMw0Sw.js","assets/WorkflowGenerationReviewDialog-Dde3QtRN.css","assets/WorkflowMaterialDrawer-PrMqZX_5.js","assets/WorkflowMaterialDrawer-CzNrrMeI.css","assets/WorkflowRoundPanel-DYHetF0L.js","assets/WorkflowRoundPanel-DxGu9gjD.css"])))=>i.map(i=>d[i]);
|
||
var Uh=Object.defineProperty;var Fh=(t,n,o)=>n in t?Uh(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var Ac=(t,n,o)=>Fh(t,typeof n!="symbol"?n+"":n,o);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))i(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const g of d.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&i(g)}).observe(document,{childList:!0,subtree:!0});function o(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function i(u){if(u.ep)return;u.ep=!0;const d=o(u);fetch(u.href,d)}})();/**
|
||
* @vue/shared v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function vf(t){const n=Object.create(null);for(const o of t.split(","))n[o]=1;return o=>o in n}const It={},hi=[],Kl=()=>{},Mm=()=>!1,nd=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),ld=t=>t.startsWith("onUpdate:"),fa=Object.assign,pf=(t,n)=>{const o=t.indexOf(n);o>-1&&t.splice(o,1)},jh=Object.prototype.hasOwnProperty,wt=(t,n)=>jh.call(t,n),qe=Array.isArray,ki=t=>xs(t)==="[object Map]",Ei=t=>xs(t)==="[object Set]",Lp=t=>xs(t)==="[object Date]",Ke=t=>typeof t=="function",Yt=t=>typeof t=="string",_l=t=>typeof t=="symbol",ht=t=>t!==null&&typeof t=="object",Rm=t=>(ht(t)||Ke(t))&&Ke(t.then)&&Ke(t.catch),Em=Object.prototype.toString,xs=t=>Em.call(t),Kh=t=>xs(t).slice(8,-1),Nm=t=>xs(t)==="[object Object]",mf=t=>Yt(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,ms=vf(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),od=t=>{const n=Object.create(null);return(o=>n[o]||(n[o]=t(o)))},Vh=/-\w/g,gl=od(t=>t.replace(Vh,n=>n.slice(1).toUpperCase())),Gh=/\B([A-Z])/g,ur=od(t=>t.replace(Gh,"-$1").toLowerCase()),Tm=od(t=>t.charAt(0).toUpperCase()+t.slice(1)),Mc=od(t=>t?`on${Tm(t)}`:""),jl=(t,n)=>!Object.is(t,n),Ou=(t,...n)=>{for(let o=0;o<t.length;o++)t[o](...n)},Bm=(t,n,o,i=!1)=>{Object.defineProperty(t,n,{configurable:!0,enumerable:!1,writable:i,value:o})},rd=t=>{const n=parseFloat(t);return isNaN(n)?t:n},zh=t=>{const n=Yt(t)?Number(t):NaN;return isNaN(n)?t:n};let qp;const id=()=>qp||(qp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ca(t){if(qe(t)){const n={};for(let o=0;o<t.length;o++){const i=t[o],u=Yt(i)?Jh(i):ca(i);if(u)for(const d in u)n[d]=u[d]}return n}else if(Yt(t)||ht(t))return t}const Hh=/;(?![^(]*\))/g,Qh=/:([^]+)/,Yh=/\/\*[^]*?\*\//g;function Jh(t){const n={};return t.replace(Yh,"").split(Hh).forEach(o=>{if(o){const i=o.split(Qh);i.length>1&&(n[i[0].trim()]=i[1].trim())}}),n}function fe(t){let n="";if(Yt(t))n=t;else if(qe(t))for(let o=0;o<t.length;o++){const i=fe(t[o]);i&&(n+=i+" ")}else if(ht(t))for(const o in t)t[o]&&(n+=o+" ");return n.trim()}const Xh="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Zh=vf(Xh);function Lm(t){return!!t||t===""}function ek(t,n){if(t.length!==n.length)return!1;let o=!0;for(let i=0;o&&i<t.length;i++)o=rr(t[i],n[i]);return o}function rr(t,n){if(t===n)return!0;let o=Lp(t),i=Lp(n);if(o||i)return o&&i?t.getTime()===n.getTime():!1;if(o=_l(t),i=_l(n),o||i)return t===n;if(o=qe(t),i=qe(n),o||i)return o&&i?ek(t,n):!1;if(o=ht(t),i=ht(n),o||i){if(!o||!i)return!1;const u=Object.keys(t).length,d=Object.keys(n).length;if(u!==d)return!1;for(const g in t){const _=t.hasOwnProperty(g),h=n.hasOwnProperty(g);if(_&&!h||!_&&h||!rr(t[g],n[g]))return!1}}return String(t)===String(n)}function gf(t,n){return t.findIndex(o=>rr(o,n))}const qm=t=>!!(t&&t.__v_isRef===!0),p=t=>Yt(t)?t:t==null?"":qe(t)||ht(t)&&(t.toString===Em||!Ke(t.toString))?qm(t)?p(t.value):JSON.stringify(t,Dm,2):String(t),Dm=(t,n)=>qm(n)?Dm(t,n.value):ki(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((o,[i,u],d)=>(o[Rc(i,d)+" =>"]=u,o),{})}:Ei(n)?{[`Set(${n.size})`]:[...n.values()].map(o=>Rc(o))}:_l(n)?Rc(n):ht(n)&&!qe(n)&&!Nm(n)?String(n):n,Rc=(t,n="")=>{var o;return _l(t)?`Symbol(${(o=t.description)!=null?o:n})`:t};/**
|
||
* @vue/reactivity v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let Ra;class tk{constructor(n=!1){this.detached=n,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!n&&Ra&&(Ra.active?(this.parent=Ra,this.index=(Ra.scopes||(Ra.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].pause();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let n,o;if(this.scopes)for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].resume();for(n=0,o=this.effects.length;n<o;n++)this.effects[n].resume()}}run(n){if(this._active){const o=Ra;try{return Ra=this,n()}finally{Ra=o}}}on(){++this._on===1&&(this.prevScope=Ra,Ra=this)}off(){if(this._on>0&&--this._on===0){if(Ra===this)Ra=this.prevScope;else{let n=Ra;for(;n;){if(n.prevScope===this){n.prevScope=this.prevScope;break}n=n.prevScope}}this.prevScope=void 0}}stop(n){if(this._active){this._active=!1;let o,i;for(o=0,i=this.effects.length;o<i;o++)this.effects[o].stop();for(this.effects.length=0,o=0,i=this.cleanups.length;o<i;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,i=this.scopes.length;o<i;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!n){const u=this.parent.scopes.pop();u&&u!==this&&(this.parent.scopes[this.index]=u,u.index=this.index)}this.parent=void 0}}}function ak(){return Ra}let Rt;const Ec=new WeakSet;class Om{constructor(n){this.fn=n,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Ra&&(Ra.active?Ra.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ec.has(this)&&(Ec.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Um(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Dp(this),Fm(this);const n=Rt,o=yl;Rt=this,yl=!0;try{return this.fn()}finally{jm(this),Rt=n,yl=o,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)bf(n);this.deps=this.depsTail=void 0,Dp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ec.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Xc(this)&&this.run()}get dirty(){return Xc(this)}}let Wm=0,gs,ys;function Um(t,n=!1){if(t.flags|=8,n){t.next=ys,ys=t;return}t.next=gs,gs=t}function yf(){Wm++}function _f(){if(--Wm>0)return;if(ys){let n=ys;for(ys=void 0;n;){const o=n.next;n.next=void 0,n.flags&=-9,n=o}}let t;for(;gs;){let n=gs;for(gs=void 0;n;){const o=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(i){t||(t=i)}n=o}}if(t)throw t}function Fm(t){for(let n=t.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function jm(t){let n,o=t.depsTail,i=o;for(;i;){const u=i.prevDep;i.version===-1?(i===o&&(o=u),bf(i),nk(i)):n=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=u}t.deps=n,t.depsTail=o}function Xc(t){for(let n=t.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(Km(n.dep.computed)||n.dep.version!==n.version))return!0;return!!t._dirty}function Km(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===hs)||(t.globalVersion=hs,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!Xc(t))))return;t.flags|=2;const n=t.dep,o=Rt,i=yl;Rt=t,yl=!0;try{Fm(t);const u=t.fn(t._value);(n.version===0||jl(u,t._value))&&(t.flags|=128,t._value=u,n.version++)}catch(u){throw n.version++,u}finally{Rt=o,yl=i,jm(t),t.flags&=-3}}function bf(t,n=!1){const{dep:o,prevSub:i,nextSub:u}=t;if(i&&(i.nextSub=u,t.prevSub=void 0),u&&(u.prevSub=i,t.nextSub=void 0),o.subs===t&&(o.subs=i,!i&&o.computed)){o.computed.flags&=-5;for(let d=o.computed.deps;d;d=d.nextDep)bf(d,!0)}!n&&!--o.sc&&o.map&&o.map.delete(o.key)}function nk(t){const{prevDep:n,nextDep:o}=t;n&&(n.nextDep=o,t.prevDep=void 0),o&&(o.prevDep=n,t.nextDep=void 0)}let yl=!0;const Vm=[];function Vl(){Vm.push(yl),yl=!1}function Gl(){const t=Vm.pop();yl=t===void 0?!0:t}function Dp(t){const{cleanup:n}=t;if(t.cleanup=void 0,n){const o=Rt;Rt=void 0;try{n()}finally{Rt=o}}}let hs=0;class lk{constructor(n,o){this.sub=n,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class wf{constructor(n){this.computed=n,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(n){if(!Rt||!yl||Rt===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Rt)o=this.activeLink=new lk(Rt,this),Rt.deps?(o.prevDep=Rt.depsTail,Rt.depsTail.nextDep=o,Rt.depsTail=o):Rt.deps=Rt.depsTail=o,Gm(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const i=o.nextDep;i.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=i),o.prevDep=Rt.depsTail,o.nextDep=void 0,Rt.depsTail.nextDep=o,Rt.depsTail=o,Rt.deps===o&&(Rt.deps=i)}return o}trigger(n){this.version++,hs++,this.notify(n)}notify(n){yf();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{_f()}}}function Gm(t){if(t.dep.sc++,t.sub.flags&4){const n=t.dep.computed;if(n&&!t.dep.subs){n.flags|=20;for(let i=n.deps;i;i=i.nextDep)Gm(i)}const o=t.dep.subs;o!==t&&(t.prevSub=o,o&&(o.nextSub=t)),t.dep.subs=t}}const Zc=new WeakMap,Wr=Symbol(""),ef=Symbol(""),ks=Symbol("");function La(t,n,o){if(yl&&Rt){let i=Zc.get(t);i||Zc.set(t,i=new Map);let u=i.get(o);u||(i.set(o,u=new wf),u.map=i,u.key=o),u.track()}}function _o(t,n,o,i,u,d){const g=Zc.get(t);if(!g){hs++;return}const _=h=>{h&&h.trigger()};if(yf(),n==="clear")g.forEach(_);else{const h=qe(t),R=h&&mf(o);if(h&&o==="length"){const S=Number(i);g.forEach((B,T)=>{(T==="length"||T===ks||!_l(T)&&T>=S)&&_(B)})}else switch((o!==void 0||g.has(void 0))&&_(g.get(o)),R&&_(g.get(ks)),n){case"add":h?R&&_(g.get("length")):(_(g.get(Wr)),ki(t)&&_(g.get(ef)));break;case"delete":h||(_(g.get(Wr)),ki(t)&&_(g.get(ef)));break;case"set":ki(t)&&_(g.get(Wr));break}}_f()}function gi(t){const n=mt(t);return n===t?n:(La(n,"iterate",ks),Vn(t)?n:n.map(bl))}function sd(t){return La(t=mt(t),"iterate",ks),t}function Ul(t,n){return ho(t)?Pi(Ur(t)?bl(n):n):bl(n)}const ok={__proto__:null,[Symbol.iterator](){return Nc(this,Symbol.iterator,t=>Ul(this,t))},concat(...t){return gi(this).concat(...t.map(n=>qe(n)?gi(n):n))},entries(){return Nc(this,"entries",t=>(t[1]=Ul(this,t[1]),t))},every(t,n){return vo(this,"every",t,n,void 0,arguments)},filter(t,n){return vo(this,"filter",t,n,o=>o.map(i=>Ul(this,i)),arguments)},find(t,n){return vo(this,"find",t,n,o=>Ul(this,o),arguments)},findIndex(t,n){return vo(this,"findIndex",t,n,void 0,arguments)},findLast(t,n){return vo(this,"findLast",t,n,o=>Ul(this,o),arguments)},findLastIndex(t,n){return vo(this,"findLastIndex",t,n,void 0,arguments)},forEach(t,n){return vo(this,"forEach",t,n,void 0,arguments)},includes(...t){return Tc(this,"includes",t)},indexOf(...t){return Tc(this,"indexOf",t)},join(t){return gi(this).join(t)},lastIndexOf(...t){return Tc(this,"lastIndexOf",t)},map(t,n){return vo(this,"map",t,n,void 0,arguments)},pop(){return rs(this,"pop")},push(...t){return rs(this,"push",t)},reduce(t,...n){return Op(this,"reduce",t,n)},reduceRight(t,...n){return Op(this,"reduceRight",t,n)},shift(){return rs(this,"shift")},some(t,n){return vo(this,"some",t,n,void 0,arguments)},splice(...t){return rs(this,"splice",t)},toReversed(){return gi(this).toReversed()},toSorted(t){return gi(this).toSorted(t)},toSpliced(...t){return gi(this).toSpliced(...t)},unshift(...t){return rs(this,"unshift",t)},values(){return Nc(this,"values",t=>Ul(this,t))}};function Nc(t,n,o){const i=sd(t),u=i[n]();return i!==t&&!Vn(t)&&(u._next=u.next,u.next=()=>{const d=u._next();return d.done||(d.value=o(d.value)),d}),u}const rk=Array.prototype;function vo(t,n,o,i,u,d){const g=sd(t),_=g!==t&&!Vn(t),h=g[n];if(h!==rk[n]){const B=h.apply(t,d);return _?bl(B):B}let R=o;g!==t&&(_?R=function(B,T){return o.call(this,Ul(t,B),T,t)}:o.length>2&&(R=function(B,T){return o.call(this,B,T,t)}));const S=h.call(g,R,i);return _&&u?u(S):S}function Op(t,n,o,i){const u=sd(t),d=u!==t&&!Vn(t);let g=o,_=!1;u!==t&&(d?(_=i.length===0,g=function(R,S,B){return _&&(_=!1,R=Ul(t,R)),o.call(this,R,Ul(t,S),B,t)}):o.length>3&&(g=function(R,S,B){return o.call(this,R,S,B,t)}));const h=u[n](g,...i);return _?Ul(t,h):h}function Tc(t,n,o){const i=mt(t);La(i,"iterate",ks);const u=i[n](...o);return(u===-1||u===!1)&&Cf(o[0])?(o[0]=mt(o[0]),i[n](...o)):u}function rs(t,n,o=[]){Vl(),yf();const i=mt(t)[n].apply(t,o);return _f(),Gl(),i}const ik=vf("__proto__,__v_isRef,__isVue"),zm=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(_l));function sk(t){_l(t)||(t=String(t));const n=mt(this);return La(n,"has",t),n.hasOwnProperty(t)}class Hm{constructor(n=!1,o=!1){this._isReadonly=n,this._isShallow=o}get(n,o,i){if(o==="__v_skip")return n.__v_skip;const u=this._isReadonly,d=this._isShallow;if(o==="__v_isReactive")return!u;if(o==="__v_isReadonly")return u;if(o==="__v_isShallow")return d;if(o==="__v_raw")return i===(u?d?_k:Xm:d?Jm:Ym).get(n)||Object.getPrototypeOf(n)===Object.getPrototypeOf(i)?n:void 0;const g=qe(n);if(!u){let h;if(g&&(h=ok[o]))return h;if(o==="hasOwnProperty")return sk}const _=Reflect.get(n,o,Ua(n)?n:i);if((_l(o)?zm.has(o):ik(o))||(u||La(n,"get",o),d))return _;if(Ua(_)){const h=g&&mf(o)?_:_.value;return u&&ht(h)?af(h):h}return ht(_)?u?af(_):kf(_):_}}class Qm extends Hm{constructor(n=!1){super(!1,n)}set(n,o,i,u){let d=n[o];const g=qe(n)&&mf(o);if(!this._isShallow){const R=ho(d);if(!Vn(i)&&!ho(i)&&(d=mt(d),i=mt(i)),!g&&Ua(d)&&!Ua(i))return R||(d.value=i),!0}const _=g?Number(o)<n.length:wt(n,o),h=Reflect.set(n,o,i,Ua(n)?n:u);return n===mt(u)&&h&&(_?jl(i,d)&&_o(n,"set",o,i):_o(n,"add",o,i)),h}deleteProperty(n,o){const i=wt(n,o);n[o];const u=Reflect.deleteProperty(n,o);return u&&i&&_o(n,"delete",o,void 0),u}has(n,o){const i=Reflect.has(n,o);return(!_l(o)||!zm.has(o))&&La(n,"has",o),i}ownKeys(n){return La(n,"iterate",qe(n)?"length":Wr),Reflect.ownKeys(n)}}class uk extends Hm{constructor(n=!1){super(!0,n)}set(n,o){return!0}deleteProperty(n,o){return!0}}const dk=new Qm,ck=new uk,fk=new Qm(!0);const tf=t=>t,Ru=t=>Reflect.getPrototypeOf(t);function vk(t,n,o){return function(...i){const u=this.__v_raw,d=mt(u),g=ki(d),_=t==="entries"||t===Symbol.iterator&&g,h=t==="keys"&&g,R=u[t](...i),S=o?tf:n?Pi:bl;return!n&&La(d,"iterate",h?ef:Wr),fa(Object.create(R),{next(){const{value:B,done:T}=R.next();return T?{value:B,done:T}:{value:_?[S(B[0]),S(B[1])]:S(B),done:T}}})}}function Eu(t){return function(...n){return t==="delete"?!1:t==="clear"?void 0:this}}function pk(t,n){const o={get(u){const d=this.__v_raw,g=mt(d),_=mt(u);t||(jl(u,_)&&La(g,"get",u),La(g,"get",_));const{has:h}=Ru(g),R=n?tf:t?Pi:bl;if(h.call(g,u))return R(d.get(u));if(h.call(g,_))return R(d.get(_));d!==g&&d.get(u)},get size(){const u=this.__v_raw;return!t&&La(mt(u),"iterate",Wr),u.size},has(u){const d=this.__v_raw,g=mt(d),_=mt(u);return t||(jl(u,_)&&La(g,"has",u),La(g,"has",_)),u===_?d.has(u):d.has(u)||d.has(_)},forEach(u,d){const g=this,_=g.__v_raw,h=mt(_),R=n?tf:t?Pi:bl;return!t&&La(h,"iterate",Wr),_.forEach((S,B)=>u.call(d,R(S),R(B),g))}};return fa(o,t?{add:Eu("add"),set:Eu("set"),delete:Eu("delete"),clear:Eu("clear")}:{add(u){const d=mt(this),g=Ru(d),_=mt(u),h=!n&&!Vn(u)&&!ho(u)?_:u;return g.has.call(d,h)||jl(u,h)&&g.has.call(d,u)||jl(_,h)&&g.has.call(d,_)||(d.add(h),_o(d,"add",h,h)),this},set(u,d){!n&&!Vn(d)&&!ho(d)&&(d=mt(d));const g=mt(this),{has:_,get:h}=Ru(g);let R=_.call(g,u);R||(u=mt(u),R=_.call(g,u));const S=h.call(g,u);return g.set(u,d),R?jl(d,S)&&_o(g,"set",u,d):_o(g,"add",u,d),this},delete(u){const d=mt(this),{has:g,get:_}=Ru(d);let h=g.call(d,u);h||(u=mt(u),h=g.call(d,u)),_&&_.call(d,u);const R=d.delete(u);return h&&_o(d,"delete",u,void 0),R},clear(){const u=mt(this),d=u.size!==0,g=u.clear();return d&&_o(u,"clear",void 0,void 0),g}}),["keys","values","entries",Symbol.iterator].forEach(u=>{o[u]=vk(u,t,n)}),o}function hf(t,n){const o=pk(t,n);return(i,u,d)=>u==="__v_isReactive"?!t:u==="__v_isReadonly"?t:u==="__v_raw"?i:Reflect.get(wt(o,u)&&u in i?o:i,u,d)}const mk={get:hf(!1,!1)},gk={get:hf(!1,!0)},yk={get:hf(!0,!1)};const Ym=new WeakMap,Jm=new WeakMap,Xm=new WeakMap,_k=new WeakMap;function bk(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function kf(t){return ho(t)?t:$f(t,!1,dk,mk,Ym)}function wk(t){return $f(t,!1,fk,gk,Jm)}function af(t){return $f(t,!0,ck,yk,Xm)}function $f(t,n,o,i,u){if(!ht(t)||t.__v_raw&&!(n&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const d=u.get(t);if(d)return d;const g=bk(Kh(t));if(g===0)return t;const _=new Proxy(t,g===2?i:o);return u.set(t,_),_}function Ur(t){return ho(t)?Ur(t.__v_raw):!!(t&&t.__v_isReactive)}function ho(t){return!!(t&&t.__v_isReadonly)}function Vn(t){return!!(t&&t.__v_isShallow)}function Cf(t){return t?!!t.__v_raw:!1}function mt(t){const n=t&&t.__v_raw;return n?mt(n):t}function hk(t){return!wt(t,"__v_skip")&&Object.isExtensible(t)&&Bm(t,"__v_skip",!0),t}const bl=t=>ht(t)?kf(t):t,Pi=t=>ht(t)?af(t):t;function Ua(t){return t?t.__v_isRef===!0:!1}function $(t){return kk(t,!1)}function kk(t,n){return Ua(t)?t:new $k(t,n)}class $k{constructor(n,o){this.dep=new wf,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?n:mt(n),this._value=o?n:bl(n),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(n){const o=this._rawValue,i=this.__v_isShallow||Vn(n)||ho(n);n=i?n:mt(n),jl(n,o)&&(this._rawValue=n,this._value=i?n:bl(n),this.dep.trigger())}}function se(t){return Ua(t)?t.value:t}const Ck={get:(t,n,o)=>n==="__v_raw"?t:se(Reflect.get(t,n,o)),set:(t,n,o,i)=>{const u=t[n];return Ua(u)&&!Ua(o)?(u.value=o,!0):Reflect.set(t,n,o,i)}};function Zm(t){return Ur(t)?t:new Proxy(t,Ck)}class Sk{constructor(n,o,i){this.fn=n,this.setter=o,this._value=void 0,this.dep=new wf(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=hs-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Rt!==this)return Um(this,!0),!0}get value(){const n=this.dep.track();return Km(this),n&&(n.version=this.dep.version),this._value}set value(n){this.setter&&this.setter(n)}}function Ik(t,n,o=!1){let i,u;return Ke(t)?i=t:(i=t.get,u=t.set),new Sk(i,u,o)}const Nu={},Vu=new WeakMap;let Dr;function Pk(t,n=!1,o=Dr){if(o){let i=Vu.get(o);i||Vu.set(o,i=[]),i.push(t)}}function xk(t,n,o=It){const{immediate:i,deep:u,once:d,scheduler:g,augmentJob:_,call:h}=o,R=ue=>u?ue:Vn(ue)||u===!1||u===0?bo(ue,1):bo(ue);let S,B,T,X,G=!1,K=!1;if(Ua(t)?(B=()=>t.value,G=Vn(t)):Ur(t)?(B=()=>R(t),G=!0):qe(t)?(K=!0,G=t.some(ue=>Ur(ue)||Vn(ue)),B=()=>t.map(ue=>{if(Ua(ue))return ue.value;if(Ur(ue))return R(ue);if(Ke(ue))return h?h(ue,2):ue()})):Ke(t)?n?B=h?()=>h(t,2):t:B=()=>{if(T){Vl();try{T()}finally{Gl()}}const ue=Dr;Dr=S;try{return h?h(t,3,[X]):t(X)}finally{Dr=ue}}:B=Kl,n&&u){const ue=B,de=u===!0?1/0:u;B=()=>bo(ue(),de)}const ye=ak(),me=()=>{S.stop(),ye&&ye.active&&pf(ye.effects,S)};if(d&&n){const ue=n;n=(...de)=>{const De=ue(...de);return me(),De}}let te=K?new Array(t.length).fill(Nu):Nu;const Ae=ue=>{if(!(!(S.flags&1)||!S.dirty&&!ue))if(n){const de=S.run();if(ue||u||G||(K?de.some((De,ne)=>jl(De,te[ne])):jl(de,te))){T&&T();const De=Dr;Dr=S;try{const ne=[de,te===Nu?void 0:K&&te[0]===Nu?[]:te,X];te=de,h?h(n,3,ne):n(...ne)}finally{Dr=De}}}else S.run()};return _&&_(Ae),S=new Om(B),S.scheduler=g?()=>g(Ae,!1):Ae,X=ue=>Pk(ue,!1,S),T=S.onStop=()=>{const ue=Vu.get(S);if(ue){if(h)h(ue,4);else for(const de of ue)de();Vu.delete(S)}},n?i?Ae(!0):te=S.run():g?g(Ae.bind(null,!0),!0):S.run(),me.pause=S.pause.bind(S),me.resume=S.resume.bind(S),me.stop=me,me}function bo(t,n=1/0,o){if(n<=0||!ht(t)||t.__v_skip||(o=o||new Map,(o.get(t)||0)>=n))return t;if(o.set(t,n),n--,Ua(t))bo(t.value,n,o);else if(qe(t))for(let i=0;i<t.length;i++)bo(t[i],n,o);else if(Ei(t)||ki(t))t.forEach(i=>{bo(i,n,o)});else if(Nm(t)){for(const i in t)bo(t[i],n,o);for(const i of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,i)&&bo(t[i],n,o)}return t}/**
|
||
* @vue/runtime-core v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/function As(t,n,o,i){try{return i?t(...i):t()}catch(u){Ms(u,n,o)}}function zn(t,n,o,i){if(Ke(t)){const u=As(t,n,o,i);return u&&Rm(u)&&u.catch(d=>{Ms(d,n,o)}),u}if(qe(t)){const u=[];for(let d=0;d<t.length;d++)u.push(zn(t[d],n,o,i));return u}}function Ms(t,n,o,i=!0){const u=n?n.vnode:null,{errorHandler:d,throwUnhandledErrorInProduction:g}=n&&n.appContext.config||It;if(n){let _=n.parent;const h=n.proxy,R=`https://vuejs.org/error-reference/#runtime-${o}`;for(;_;){const S=_.ec;if(S){for(let B=0;B<S.length;B++)if(S[B](t,h,R)===!1)return}_=_.parent}if(d){Vl(),As(d,null,10,[t,h,R]),Gl();return}}Ak(t,o,u,i,g)}function Ak(t,n,o,i=!0,u=!1){if(u)throw t;console.error(t)}const Ja=[];let Wl=-1;const $i=[];let or=null,wi=0;const eg=Promise.resolve();let Gu=null;function ya(t){const n=Gu||eg;return t?n.then(this?t.bind(this):t):n}function Mk(t){let n=Wl+1,o=Ja.length;for(;n<o;){const i=n+o>>>1,u=Ja[i],d=$s(u);d<t||d===t&&u.flags&2?n=i+1:o=i}return n}function Sf(t){if(!(t.flags&1)){const n=$s(t),o=Ja[Ja.length-1];!o||!(t.flags&2)&&n>=$s(o)?Ja.push(t):Ja.splice(Mk(n),0,t),t.flags|=1,tg()}}function tg(){Gu||(Gu=eg.then(ng))}function Rk(t){qe(t)?$i.push(...t):or&&t.id===-1?or.splice(wi+1,0,t):t.flags&1||($i.push(t),t.flags|=1),tg()}function Wp(t,n,o=Wl+1){for(;o<Ja.length;o++){const i=Ja[o];if(i&&i.flags&2){if(t&&i.id!==t.uid)continue;Ja.splice(o,1),o--,i.flags&4&&(i.flags&=-2),i(),i.flags&4||(i.flags&=-2)}}}function ag(t){if($i.length){const n=[...new Set($i)].sort((o,i)=>$s(o)-$s(i));if($i.length=0,or){or.push(...n);return}for(or=n,wi=0;wi<or.length;wi++){const o=or[wi];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}or=null,wi=0}}const $s=t=>t.id==null?t.flags&2?-1:1/0:t.id;function ng(t){try{for(Wl=0;Wl<Ja.length;Wl++){const n=Ja[Wl];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),As(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;Wl<Ja.length;Wl++){const n=Ja[Wl];n&&(n.flags&=-2)}Wl=-1,Ja.length=0,ag(),Gu=null,(Ja.length||$i.length)&&ng()}}let Wa=null,lg=null;function zu(t){const n=Wa;return Wa=t,lg=t&&t.type.__scopeId||null,n}function ra(t,n=Wa,o){if(!n||t._n)return t;const i=(...u)=>{i._d&&Yu(-1);const d=zu(n);let g;try{g=t(...u)}finally{zu(d),i._d&&Yu(1)}return g};return i._n=!0,i._c=!0,i._d=!0,i}function xe(t,n){if(Wa===null)return t;const o=vd(Wa),i=t.dirs||(t.dirs=[]);for(let u=0;u<n.length;u++){let[d,g,_,h=It]=n[u];d&&(Ke(d)&&(d={mounted:d,updated:d}),d.deep&&bo(g),i.push({dir:d,instance:o,value:g,oldValue:void 0,arg:_,modifiers:h}))}return t}function Er(t,n,o,i){const u=t.dirs,d=n&&n.dirs;for(let g=0;g<u.length;g++){const _=u[g];d&&(_.oldValue=d[g].value);let h=_.dir[i];h&&(Vl(),zn(h,o,8,[t.el,_,t,n]),Gl())}}function Ek(t,n){if(Oa){let o=Oa.provides;const i=Oa.parent&&Oa.parent.provides;i===o&&(o=Oa.provides=Object.create(i)),o[t]=n}}function Wu(t,n,o=!1){const i=fd();if(i||Si){let u=Si?Si._context.provides:i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(u&&t in u)return u[t];if(arguments.length>1)return o&&Ke(n)?n.call(i&&i.proxy):n}}const Nk=Symbol.for("v-scx"),Tk=()=>Wu(Nk);function ct(t,n,o){return og(t,n,o)}function og(t,n,o=It){const{immediate:i,deep:u,flush:d,once:g}=o,_=fa({},o),h=n&&i||!n&&d!=="post";let R;if(xi){if(d==="sync"){const X=Tk();R=X.__watcherHandles||(X.__watcherHandles=[])}else if(!h){const X=()=>{};return X.stop=Kl,X.resume=Kl,X.pause=Kl,X}}const S=Oa;_.call=(X,G,K)=>zn(X,S,G,K);let B=!1;d==="post"?_.scheduler=X=>{un(X,S&&S.suspense)}:d!=="sync"&&(B=!0,_.scheduler=(X,G)=>{G?X():Sf(X)}),_.augmentJob=X=>{n&&(X.flags|=4),B&&(X.flags|=2,S&&(X.id=S.uid,X.i=S))};const T=xk(t,n,_);return xi&&(R?R.push(T):h&&T()),T}function Bk(t,n,o){const i=this.proxy,u=Yt(t)?t.includes(".")?rg(i,t):()=>i[t]:t.bind(i,i);let d;Ke(n)?d=n:(d=n.handler,o=n);const g=Es(this),_=og(u,d.bind(i),o);return g(),_}function rg(t,n){const o=n.split(".");return()=>{let i=t;for(let u=0;u<o.length&&i;u++)i=i[o[u]];return i}}const Lk=Symbol("_vte"),ig=t=>t.__isTeleport,jn=Symbol("_leaveCb"),is=Symbol("_enterCb");function sg(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingVNodes:new Map};return Ni(()=>{t.isMounted=!0}),jr(()=>{t.isUnmounting=!0}),t}const On=[Function,Array],ug={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:On,onEnter:On,onAfterEnter:On,onEnterCancelled:On,onBeforeLeave:On,onLeave:On,onAfterLeave:On,onLeaveCancelled:On,onBeforeAppear:On,onAppear:On,onAfterAppear:On,onAppearCancelled:On},dg=t=>{const n=t.subTree;return n.component?dg(n.component):n},qk={name:"BaseTransition",props:ug,setup(t,{slots:n}){const o=fd(),i=sg();return()=>{const u=n.default&&If(n.default(),!0),d=u&&u.length?cg(u):o.subTree?H():void 0;if(!d)return;const g=mt(t),{mode:_}=g;if(i.isLeaving)return Bc(d);const h=Up(d);if(!h)return Bc(d);let R=Cs(h,g,i,o,B=>R=B);h.type!==Da&&Fr(h,R);let S=o.subTree&&Up(o.subTree);if(S&&S.type!==Da&&!Or(S,h)&&dg(o).type!==Da){let B=Cs(S,g,i,o);if(Fr(S,B),_==="out-in"&&h.type!==Da)return i.isLeaving=!0,B.afterLeave=()=>{i.isLeaving=!1,o.job.flags&8||o.update(),delete B.afterLeave,S=void 0},Bc(d);_==="in-out"&&h.type!==Da?B.delayLeave=(T,X,G)=>{const K=fg(i,S);K[String(S.key)]=S,T[jn]=()=>{X(),T[jn]=void 0,delete R.delayedLeave,S=void 0},R.delayedLeave=()=>{G(),delete R.delayedLeave,S=void 0}}:S=void 0}else S&&(S=void 0);return d}}};function cg(t){let n=t[0];if(t.length>1){for(const o of t)if(o.type!==Da){n=o;break}}return n}const Dk=qk;function fg(t,n){const{leavingVNodes:o}=t;let i=o.get(n.type);return i||(i=Object.create(null),o.set(n.type,i)),i}function Cs(t,n,o,i,u){const{appear:d,mode:g,persisted:_=!1,onBeforeEnter:h,onEnter:R,onAfterEnter:S,onEnterCancelled:B,onBeforeLeave:T,onLeave:X,onAfterLeave:G,onLeaveCancelled:K,onBeforeAppear:ye,onAppear:me,onAfterAppear:te,onAppearCancelled:Ae}=n,ue=String(t.key),de=fg(o,t),De=(J,W)=>{J&&zn(J,i,9,W)},ne=(J,W)=>{const D=W[1];De(J,W),qe(J)?J.every(q=>q.length<=1)&&D():J.length<=1&&D()},oe={mode:g,persisted:_,beforeEnter(J){let W=h;if(!o.isMounted)if(d)W=ye||h;else return;J[jn]&&J[jn](!0);const D=de[ue];D&&Or(t,D)&&D.el[jn]&&D.el[jn](),De(W,[J])},enter(J){if(de[ue]===t)return;let W=R,D=S,q=B;if(!o.isMounted)if(d)W=me||R,D=te||S,q=Ae||B;else return;let Ne=!1;J[is]=it=>{Ne||(Ne=!0,it?De(q,[J]):De(D,[J]),oe.delayedLeave&&oe.delayedLeave(),J[is]=void 0)};const Ye=J[is].bind(null,!1);W?ne(W,[J,Ye]):Ye()},leave(J,W){const D=String(t.key);if(J[is]&&J[is](!0),o.isUnmounting)return W();De(T,[J]);let q=!1;J[jn]=Ye=>{q||(q=!0,W(),Ye?De(K,[J]):De(G,[J]),J[jn]=void 0,de[D]===t&&delete de[D])};const Ne=J[jn].bind(null,!1);de[D]=t,X?ne(X,[J,Ne]):Ne()},clone(J){const W=Cs(J,n,o,i,u);return u&&u(W),W}};return oe}function Bc(t){if(Rs(t))return t=ir(t),t.children=null,t}function Up(t){if(!Rs(t))return ig(t.type)&&t.children?cg(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:n,children:o}=t;if(o){if(n&16)return o[0];if(n&32&&Ke(o.default))return o.default()}}function Fr(t,n){t.shapeFlag&6&&t.component?(t.transition=n,Fr(t.component.subTree,n)):t.shapeFlag&128?(t.ssContent.transition=n.clone(t.ssContent),t.ssFallback.transition=n.clone(t.ssFallback)):t.transition=n}function If(t,n=!1,o){let i=[],u=0;for(let d=0;d<t.length;d++){let g=t[d];const _=o==null?g.key:String(o)+String(g.key!=null?g.key:d);g.type===Q?(g.patchFlag&128&&u++,i=i.concat(If(g.children,n,_))):(n||g.type!==Da)&&i.push(_!=null?ir(g,{key:_}):g)}if(u>1)for(let d=0;d<i.length;d++)i[d].patchFlag=-2;return i}function Hn(t,n){return Ke(t)?fa({name:t.name},n,{setup:t}):t}function Ok(){const t=fd();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function Pf(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function Fp(t,n){let o;return!!((o=Object.getOwnPropertyDescriptor(t,n))&&!o.configurable)}const Hu=new WeakMap;function _s(t,n,o,i,u=!1){if(qe(t)){t.forEach((K,ye)=>_s(K,n&&(qe(n)?n[ye]:n),o,i,u));return}if(Ci(i)&&!u){i.shapeFlag&512&&i.type.__asyncResolved&&i.component.subTree.component&&_s(t,n,o,i.component.subTree);return}const d=i.shapeFlag&4?vd(i.component):i.el,g=u?null:d,{i:_,r:h}=t,R=n&&n.r,S=_.refs===It?_.refs={}:_.refs,B=_.setupState,T=mt(B),X=B===It?Mm:K=>Fp(S,K)?!1:wt(T,K),G=(K,ye)=>!(ye&&Fp(S,ye));if(R!=null&&R!==h){if(jp(n),Yt(R))S[R]=null,X(R)&&(B[R]=null);else if(Ua(R)){const K=n;G(R,K.k)&&(R.value=null),K.k&&(S[K.k]=null)}}if(Ke(h)){Vl();try{As(h,_,12,[g,S])}finally{Gl()}}else{const K=Yt(h),ye=Ua(h);if(K||ye){const me=()=>{if(t.f){const te=K?X(h)?B[h]:S[h]:G()||!t.k?h.value:S[t.k];if(u)qe(te)&&pf(te,d);else if(qe(te))te.includes(d)||te.push(d);else if(K)S[h]=[d],X(h)&&(B[h]=S[h]);else{const Ae=[d];G(h,t.k)&&(h.value=Ae),t.k&&(S[t.k]=Ae)}}else K?(S[h]=g,X(h)&&(B[h]=g)):ye&&(G(h,t.k)&&(h.value=g),t.k&&(S[t.k]=g))};if(g){const te=()=>{me(),Hu.delete(t)};te.id=-1,Hu.set(t,te),un(te,o)}else jp(t),me()}}}function jp(t){const n=Hu.get(t);n&&(n.flags|=8,Hu.delete(t))}const Kp=t=>t.nodeType===8;id().requestIdleCallback;id().cancelIdleCallback;function Wk(t,n){if(Kp(t)&&t.data==="["){let o=1,i=t.nextSibling;for(;i;){if(i.nodeType===1){if(n(i)===!1)break}else if(Kp(i))if(i.data==="]"){if(--o===0)break}else i.data==="["&&o++;i=i.nextSibling}}else n(t)}const Ci=t=>!!t.type.__asyncLoader;function Wn(t){Ke(t)&&(t={loader:t});const{loader:n,loadingComponent:o,errorComponent:i,delay:u=200,hydrate:d,timeout:g,suspensible:_=!0,onError:h}=t;let R=null,S,B=0;const T=()=>(B++,R=null,X()),X=()=>{let G;return R||(G=R=n().catch(K=>{if(K=K instanceof Error?K:new Error(String(K)),h)return new Promise((ye,me)=>{h(K,()=>ye(T()),()=>me(K),B+1)});throw K}).then(K=>G!==R&&R?R:(K&&(K.__esModule||K[Symbol.toStringTag]==="Module")&&(K=K.default),S=K,K)))};return Hn({name:"AsyncComponentWrapper",__asyncLoader:X,__asyncHydrate(G,K,ye){let me=!1;(K.bu||(K.bu=[])).push(()=>me=!0);const te=()=>{me||ye()},Ae=d?()=>{const ue=d(te,de=>Wk(G,de));ue&&(K.bum||(K.bum=[])).push(ue)}:te;S?Ae():X().then(()=>!K.isUnmounted&&Ae())},get __asyncResolved(){return S},setup(){const G=Oa;if(Pf(G),S)return()=>Tu(S,G);const K=de=>{R=null,Ms(de,G,13,!i)};if(_&&G.suspense||xi)return X().then(de=>()=>Tu(de,G)).catch(de=>(K(de),()=>i?We(i,{error:de}):null));const ye=$(!1),me=$(),te=$(!!u);let Ae,ue;return xf(()=>{Ae!=null&&clearTimeout(Ae),ue!=null&&clearTimeout(ue)}),u&&(ue=setTimeout(()=>{G.isUnmounted||(te.value=!1)},u)),g!=null&&(Ae=setTimeout(()=>{if(!G.isUnmounted&&!ye.value&&!me.value){const de=new Error(`Async component timed out after ${g}ms.`);K(de),me.value=de}},g)),X().then(()=>{G.isUnmounted||(ye.value=!0,G.parent&&Rs(G.parent.vnode)&&G.parent.update())}).catch(de=>{if(G.isUnmounted){R=null;return}K(de),me.value=de}),()=>{if(ye.value&&S)return Tu(S,G);if(me.value&&i)return We(i,{error:me.value});if(o&&!te.value)return Tu(o,G)}}})}function Tu(t,n){const{ref:o,props:i,children:u,ce:d}=n.vnode,g=We(t,i,u);return g.ref=o,g.ce=d,delete n.vnode.ce,g}const Rs=t=>t.type.__isKeepAlive;function Uk(t,n){vg(t,"a",n)}function Fk(t,n){vg(t,"da",n)}function vg(t,n,o=Oa){const i=t.__wdc||(t.__wdc=()=>{let u=o;for(;u;){if(u.isDeactivated)return;u=u.parent}return t()});if(ud(n,i,o),o){let u=o.parent;for(;u&&u.parent;)Rs(u.parent.vnode)&&jk(i,n,o,u),u=u.parent}}function jk(t,n,o,i){const u=ud(n,t,i,!0);xf(()=>{pf(i[n],u)},o)}function ud(t,n,o=Oa,i=!1){if(o){const u=o[t]||(o[t]=[]),d=n.__weh||(n.__weh=(...g)=>{Vl();const _=Es(o),h=zn(n,o,t,g);return _(),Gl(),h});return i?u.unshift(d):u.push(d),d}}const ko=t=>(n,o=Oa)=>{(!xi||t==="sp")&&ud(t,(...i)=>n(...i),o)},Kk=ko("bm"),Ni=ko("m"),Vk=ko("bu"),pg=ko("u"),jr=ko("bum"),xf=ko("um"),Gk=ko("sp"),zk=ko("rtg"),Hk=ko("rtc");function Qk(t,n=Oa){ud("ec",t,n)}const Yk=Symbol.for("v-ndc");function re(t,n,o,i){let u;const d=o,g=qe(t);if(g||Yt(t)){const _=g&&Ur(t);let h=!1,R=!1;_&&(h=!Vn(t),R=ho(t),t=sd(t)),u=new Array(t.length);for(let S=0,B=t.length;S<B;S++)u[S]=n(h?R?Pi(bl(t[S])):bl(t[S]):t[S],S,void 0,d)}else if(typeof t=="number"){u=new Array(t);for(let _=0;_<t;_++)u[_]=n(_+1,_,void 0,d)}else if(ht(t))if(t[Symbol.iterator])u=Array.from(t,(_,h)=>n(_,h,void 0,d));else{const _=Object.keys(t);u=new Array(_.length);for(let h=0,R=_.length;h<R;h++){const S=_[h];u[h]=n(t[S],S,h,d)}}else u=[];return u}function Vp(t,n,o={},i,u){if(Wa.ce||Wa.parent&&Ci(Wa.parent)&&Wa.parent.ce){const R=Object.keys(o).length>0;return n!=="default"&&(o.name=n),m(),Ct(Q,null,[We("slot",o,i&&i())],R?-2:64)}let d=t[n];d&&d._c&&(d._d=!1),m();const g=d&&mg(d(o)),_=o.key||g&&g.key,h=Ct(Q,{key:(_&&!_l(_)?_:`_${n}`)+(!g&&i?"_fb":"")},g||(i?i():[]),g&&t._===1?64:-2);return d&&d._c&&(d._d=!0),h}function mg(t){return t.some(n=>Is(n)?!(n.type===Da||n.type===Q&&!mg(n.children)):!0)?t:null}const nf=t=>t?Bg(t)?vd(t):nf(t.parent):null,bs=fa(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>nf(t.parent),$root:t=>nf(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>yg(t),$forceUpdate:t=>t.f||(t.f=()=>{Sf(t.update)}),$nextTick:t=>t.n||(t.n=ya.bind(t.proxy)),$watch:t=>Bk.bind(t)}),Lc=(t,n)=>t!==It&&!t.__isScriptSetup&&wt(t,n),Jk={get({_:t},n){if(n==="__v_skip")return!0;const{ctx:o,setupState:i,data:u,props:d,accessCache:g,type:_,appContext:h}=t;if(n[0]!=="$"){const T=g[n];if(T!==void 0)switch(T){case 1:return i[n];case 2:return u[n];case 4:return o[n];case 3:return d[n]}else{if(Lc(i,n))return g[n]=1,i[n];if(u!==It&&wt(u,n))return g[n]=2,u[n];if(wt(d,n))return g[n]=3,d[n];if(o!==It&&wt(o,n))return g[n]=4,o[n];lf&&(g[n]=0)}}const R=bs[n];let S,B;if(R)return n==="$attrs"&&La(t.attrs,"get",""),R(t);if((S=_.__cssModules)&&(S=S[n]))return S;if(o!==It&&wt(o,n))return g[n]=4,o[n];if(B=h.config.globalProperties,wt(B,n))return B[n]},set({_:t},n,o){const{data:i,setupState:u,ctx:d}=t;return Lc(u,n)?(u[n]=o,!0):i!==It&&wt(i,n)?(i[n]=o,!0):wt(t.props,n)||n[0]==="$"&&n.slice(1)in t?!1:(d[n]=o,!0)},has({_:{data:t,setupState:n,accessCache:o,ctx:i,appContext:u,props:d,type:g}},_){let h;return!!(o[_]||t!==It&&_[0]!=="$"&&wt(t,_)||Lc(n,_)||wt(d,_)||wt(i,_)||wt(bs,_)||wt(u.config.globalProperties,_)||(h=g.__cssModules)&&h[_])},defineProperty(t,n,o){return o.get!=null?t._.accessCache[n]=0:wt(o,"value")&&this.set(t,n,o.value,null),Reflect.defineProperty(t,n,o)}};function Gp(t){return qe(t)?t.reduce((n,o)=>(n[o]=null,n),{}):t}let lf=!0;function Xk(t){const n=yg(t),o=t.proxy,i=t.ctx;lf=!1,n.beforeCreate&&zp(n.beforeCreate,t,"bc");const{data:u,computed:d,methods:g,watch:_,provide:h,inject:R,created:S,beforeMount:B,mounted:T,beforeUpdate:X,updated:G,activated:K,deactivated:ye,beforeDestroy:me,beforeUnmount:te,destroyed:Ae,unmounted:ue,render:de,renderTracked:De,renderTriggered:ne,errorCaptured:oe,serverPrefetch:J,expose:W,inheritAttrs:D,components:q,directives:Ne,filters:Ye}=n;if(R&&Zk(R,i,null),g)for(const ft in g){const tt=g[ft];Ke(tt)&&(i[ft]=tt.bind(o))}if(u){const ft=u.call(o,o);ht(ft)&&(t.data=kf(ft))}if(lf=!0,d)for(const ft in d){const tt=d[ft],va=Ke(tt)?tt.bind(o,o):Ke(tt.get)?tt.get.bind(o,o):Kl,at=!Ke(tt)&&Ke(tt.set)?tt.set.bind(o):Kl,pa=M({get:va,set:at});Object.defineProperty(i,ft,{enumerable:!0,configurable:!0,get:()=>pa.value,set:Et=>pa.value=Et})}if(_)for(const ft in _)gg(_[ft],i,o,ft);if(h){const ft=Ke(h)?h.call(o):h;Reflect.ownKeys(ft).forEach(tt=>{Ek(tt,ft[tt])})}S&&zp(S,t,"c");function ot(ft,tt){qe(tt)?tt.forEach(va=>ft(va.bind(o))):tt&&ft(tt.bind(o))}if(ot(Kk,B),ot(Ni,T),ot(Vk,X),ot(pg,G),ot(Uk,K),ot(Fk,ye),ot(Qk,oe),ot(Hk,De),ot(zk,ne),ot(jr,te),ot(xf,ue),ot(Gk,J),qe(W))if(W.length){const ft=t.exposed||(t.exposed={});W.forEach(tt=>{Object.defineProperty(ft,tt,{get:()=>o[tt],set:va=>o[tt]=va,enumerable:!0})})}else t.exposed||(t.exposed={});de&&t.render===Kl&&(t.render=de),D!=null&&(t.inheritAttrs=D),q&&(t.components=q),Ne&&(t.directives=Ne),J&&Pf(t)}function Zk(t,n,o=Kl){qe(t)&&(t=of(t));for(const i in t){const u=t[i];let d;ht(u)?"default"in u?d=Wu(u.from||i,u.default,!0):d=Wu(u.from||i):d=Wu(u),Ua(d)?Object.defineProperty(n,i,{enumerable:!0,configurable:!0,get:()=>d.value,set:g=>d.value=g}):n[i]=d}}function zp(t,n,o){zn(qe(t)?t.map(i=>i.bind(n.proxy)):t.bind(n.proxy),n,o)}function gg(t,n,o,i){let u=i.includes(".")?rg(o,i):()=>o[i];if(Yt(t)){const d=n[t];Ke(d)&&ct(u,d)}else if(Ke(t))ct(u,t.bind(o));else if(ht(t))if(qe(t))t.forEach(d=>gg(d,n,o,i));else{const d=Ke(t.handler)?t.handler.bind(o):n[t.handler];Ke(d)&&ct(u,d,t)}}function yg(t){const n=t.type,{mixins:o,extends:i}=n,{mixins:u,optionsCache:d,config:{optionMergeStrategies:g}}=t.appContext,_=d.get(n);let h;return _?h=_:!u.length&&!o&&!i?h=n:(h={},u.length&&u.forEach(R=>Qu(h,R,g,!0)),Qu(h,n,g)),ht(n)&&d.set(n,h),h}function Qu(t,n,o,i=!1){const{mixins:u,extends:d}=n;d&&Qu(t,d,o,!0),u&&u.forEach(g=>Qu(t,g,o,!0));for(const g in n)if(!(i&&g==="expose")){const _=e1[g]||o&&o[g];t[g]=_?_(t[g],n[g]):n[g]}return t}const e1={data:Hp,props:Qp,emits:Qp,methods:cs,computed:cs,beforeCreate:Qa,created:Qa,beforeMount:Qa,mounted:Qa,beforeUpdate:Qa,updated:Qa,beforeDestroy:Qa,beforeUnmount:Qa,destroyed:Qa,unmounted:Qa,activated:Qa,deactivated:Qa,errorCaptured:Qa,serverPrefetch:Qa,components:cs,directives:cs,watch:a1,provide:Hp,inject:t1};function Hp(t,n){return n?t?function(){return fa(Ke(t)?t.call(this,this):t,Ke(n)?n.call(this,this):n)}:n:t}function t1(t,n){return cs(of(t),of(n))}function of(t){if(qe(t)){const n={};for(let o=0;o<t.length;o++)n[t[o]]=t[o];return n}return t}function Qa(t,n){return t?[...new Set([].concat(t,n))]:n}function cs(t,n){return t?fa(Object.create(null),t,n):n}function Qp(t,n){return t?qe(t)&&qe(n)?[...new Set([...t,...n])]:fa(Object.create(null),Gp(t),Gp(n??{})):n}function a1(t,n){if(!t)return n;if(!n)return t;const o=fa(Object.create(null),t);for(const i in n)o[i]=Qa(t[i],n[i]);return o}function _g(){return{app:null,config:{isNativeTag:Mm,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let n1=0;function l1(t,n){return function(i,u=null){Ke(i)||(i=fa({},i)),u!=null&&!ht(u)&&(u=null);const d=_g(),g=new WeakSet,_=[];let h=!1;const R=d.app={_uid:n1++,_component:i,_props:u,_container:null,_context:d,_instance:null,version:q1,get config(){return d.config},set config(S){},use(S,...B){return g.has(S)||(S&&Ke(S.install)?(g.add(S),S.install(R,...B)):Ke(S)&&(g.add(S),S(R,...B))),R},mixin(S){return d.mixins.includes(S)||d.mixins.push(S),R},component(S,B){return B?(d.components[S]=B,R):d.components[S]},directive(S,B){return B?(d.directives[S]=B,R):d.directives[S]},mount(S,B,T){if(!h){const X=R._ceVNode||We(i,u);return X.appContext=d,T===!0?T="svg":T===!1&&(T=void 0),t(X,S,T),h=!0,R._container=S,S.__vue_app__=R,vd(X.component)}},onUnmount(S){_.push(S)},unmount(){h&&(zn(_,R._instance,16),t(null,R._container),delete R._container.__vue_app__)},provide(S,B){return d.provides[S]=B,R},runWithContext(S){const B=Si;Si=R;try{return S()}finally{Si=B}}};return R}}let Si=null;const o1=(t,n)=>n==="modelValue"||n==="model-value"?t.modelModifiers:t[`${n}Modifiers`]||t[`${gl(n)}Modifiers`]||t[`${ur(n)}Modifiers`];function r1(t,n,...o){if(t.isUnmounted)return;const i=t.vnode.props||It;let u=o;const d=n.startsWith("update:"),g=d&&o1(i,n.slice(7));g&&(g.trim&&(u=o.map(S=>Yt(S)?S.trim():S)),g.number&&(u=o.map(rd)));let _,h=i[_=Mc(n)]||i[_=Mc(gl(n))];!h&&d&&(h=i[_=Mc(ur(n))]),h&&zn(h,t,6,u);const R=i[_+"Once"];if(R){if(!t.emitted)t.emitted={};else if(t.emitted[_])return;t.emitted[_]=!0,zn(R,t,6,u)}}const i1=new WeakMap;function bg(t,n,o=!1){const i=o?i1:n.emitsCache,u=i.get(t);if(u!==void 0)return u;const d=t.emits;let g={},_=!1;if(!Ke(t)){const h=R=>{const S=bg(R,n,!0);S&&(_=!0,fa(g,S))};!o&&n.mixins.length&&n.mixins.forEach(h),t.extends&&h(t.extends),t.mixins&&t.mixins.forEach(h)}return!d&&!_?(ht(t)&&i.set(t,null),null):(qe(d)?d.forEach(h=>g[h]=null):fa(g,d),ht(t)&&i.set(t,g),g)}function dd(t,n){return!t||!nd(n)?!1:(n=n.slice(2),n=n==="Once"?n:n.replace(/Once$/,""),wt(t,n[0].toLowerCase()+n.slice(1))||wt(t,ur(n))||wt(t,n))}function Yp(t){const{type:n,vnode:o,proxy:i,withProxy:u,propsOptions:[d],slots:g,attrs:_,emit:h,render:R,renderCache:S,props:B,data:T,setupState:X,ctx:G,inheritAttrs:K}=t,ye=zu(t);let me,te;try{if(o.shapeFlag&4){const ue=u||i,de=ue;me=Fl(R.call(de,ue,S,B,X,T,G)),te=_}else{const ue=n;me=Fl(ue.length>1?ue(B,{attrs:_,slots:g,emit:h}):ue(B,null)),te=n.props?_:s1(_)}}catch(ue){ws.length=0,Ms(ue,t,1),me=We(Da)}let Ae=me;if(te&&K!==!1){const ue=Object.keys(te),{shapeFlag:de}=Ae;ue.length&&de&7&&(d&&ue.some(ld)&&(te=u1(te,d)),Ae=ir(Ae,te,!1,!0))}return o.dirs&&(Ae=ir(Ae,null,!1,!0),Ae.dirs=Ae.dirs?Ae.dirs.concat(o.dirs):o.dirs),o.transition&&Fr(Ae,o.transition),me=Ae,zu(ye),me}const s1=t=>{let n;for(const o in t)(o==="class"||o==="style"||nd(o))&&((n||(n={}))[o]=t[o]);return n},u1=(t,n)=>{const o={};for(const i in t)(!ld(i)||!(i.slice(9)in n))&&(o[i]=t[i]);return o};function d1(t,n,o){const{props:i,children:u,component:d}=t,{props:g,children:_,patchFlag:h}=n,R=d.emitsOptions;if(n.dirs||n.transition)return!0;if(o&&h>=0){if(h&1024)return!0;if(h&16)return i?Jp(i,g,R):!!g;if(h&8){const S=n.dynamicProps;for(let B=0;B<S.length;B++){const T=S[B];if(wg(g,i,T)&&!dd(R,T))return!0}}}else return(u||_)&&(!_||!_.$stable)?!0:i===g?!1:i?g?Jp(i,g,R):!0:!!g;return!1}function Jp(t,n,o){const i=Object.keys(n);if(i.length!==Object.keys(t).length)return!0;for(let u=0;u<i.length;u++){const d=i[u];if(wg(n,t,d)&&!dd(o,d))return!0}return!1}function wg(t,n,o){const i=t[o],u=n[o];return o==="style"&&ht(i)&&ht(u)?!rr(i,u):i!==u}function c1({vnode:t,parent:n,suspense:o},i){for(;n;){const u=n.subTree;if(u.suspense&&u.suspense.activeBranch===t&&(u.suspense.vnode.el=u.el=i,t=u),u===t)(t=n.vnode).el=i,n=n.parent;else break}o&&o.activeBranch===t&&(o.vnode.el=i)}const hg={},kg=()=>Object.create(hg),$g=t=>Object.getPrototypeOf(t)===hg;function f1(t,n,o,i=!1){const u={},d=kg();t.propsDefaults=Object.create(null),Cg(t,n,u,d);for(const g in t.propsOptions[0])g in u||(u[g]=void 0);o?t.props=i?u:wk(u):t.type.props?t.props=u:t.props=d,t.attrs=d}function v1(t,n,o,i){const{props:u,attrs:d,vnode:{patchFlag:g}}=t,_=mt(u),[h]=t.propsOptions;let R=!1;if((i||g>0)&&!(g&16)){if(g&8){const S=t.vnode.dynamicProps;for(let B=0;B<S.length;B++){let T=S[B];if(dd(t.emitsOptions,T))continue;const X=n[T];if(h)if(wt(d,T))X!==d[T]&&(d[T]=X,R=!0);else{const G=gl(T);u[G]=rf(h,_,G,X,t,!1)}else X!==d[T]&&(d[T]=X,R=!0)}}}else{Cg(t,n,u,d)&&(R=!0);let S;for(const B in _)(!n||!wt(n,B)&&((S=ur(B))===B||!wt(n,S)))&&(h?o&&(o[B]!==void 0||o[S]!==void 0)&&(u[B]=rf(h,_,B,void 0,t,!0)):delete u[B]);if(d!==_)for(const B in d)(!n||!wt(n,B))&&(delete d[B],R=!0)}R&&_o(t.attrs,"set","")}function Cg(t,n,o,i){const[u,d]=t.propsOptions;let g=!1,_;if(n)for(let h in n){if(ms(h))continue;const R=n[h];let S;u&&wt(u,S=gl(h))?!d||!d.includes(S)?o[S]=R:(_||(_={}))[S]=R:dd(t.emitsOptions,h)||(!(h in i)||R!==i[h])&&(i[h]=R,g=!0)}if(d){const h=mt(o),R=_||It;for(let S=0;S<d.length;S++){const B=d[S];o[B]=rf(u,h,B,R[B],t,!wt(R,B))}}return g}function rf(t,n,o,i,u,d){const g=t[o];if(g!=null){const _=wt(g,"default");if(_&&i===void 0){const h=g.default;if(g.type!==Function&&!g.skipFactory&&Ke(h)){const{propsDefaults:R}=u;if(o in R)i=R[o];else{const S=Es(u);i=R[o]=h.call(null,n),S()}}else i=h;u.ce&&u.ce._setProp(o,i)}g[0]&&(d&&!_?i=!1:g[1]&&(i===""||i===ur(o))&&(i=!0))}return i}const p1=new WeakMap;function Sg(t,n,o=!1){const i=o?p1:n.propsCache,u=i.get(t);if(u)return u;const d=t.props,g={},_=[];let h=!1;if(!Ke(t)){const S=B=>{h=!0;const[T,X]=Sg(B,n,!0);fa(g,T),X&&_.push(...X)};!o&&n.mixins.length&&n.mixins.forEach(S),t.extends&&S(t.extends),t.mixins&&t.mixins.forEach(S)}if(!d&&!h)return ht(t)&&i.set(t,hi),hi;if(qe(d))for(let S=0;S<d.length;S++){const B=gl(d[S]);Xp(B)&&(g[B]=It)}else if(d)for(const S in d){const B=gl(S);if(Xp(B)){const T=d[S],X=g[B]=qe(T)||Ke(T)?{type:T}:fa({},T),G=X.type;let K=!1,ye=!0;if(qe(G))for(let me=0;me<G.length;++me){const te=G[me],Ae=Ke(te)&&te.name;if(Ae==="Boolean"){K=!0;break}else Ae==="String"&&(ye=!1)}else K=Ke(G)&&G.name==="Boolean";X[0]=K,X[1]=ye,(K||wt(X,"default"))&&_.push(B)}}const R=[g,_];return ht(t)&&i.set(t,R),R}function Xp(t){return t[0]!=="$"&&!ms(t)}const Af=t=>t==="_"||t==="_ctx"||t==="$stable",Mf=t=>qe(t)?t.map(Fl):[Fl(t)],m1=(t,n,o)=>{if(n._n)return n;const i=ra((...u)=>Mf(n(...u)),o);return i._c=!1,i},Ig=(t,n,o)=>{const i=t._ctx;for(const u in t){if(Af(u))continue;const d=t[u];if(Ke(d))n[u]=m1(u,d,i);else if(d!=null){const g=Mf(d);n[u]=()=>g}}},Pg=(t,n)=>{const o=Mf(n);t.slots.default=()=>o},xg=(t,n,o)=>{for(const i in n)(o||!Af(i))&&(t[i]=n[i])},g1=(t,n,o)=>{const i=t.slots=kg();if(t.vnode.shapeFlag&32){const u=n._;u?(xg(i,n,o),o&&Bm(i,"_",u,!0)):Ig(n,i)}else n&&Pg(t,n)},y1=(t,n,o)=>{const{vnode:i,slots:u}=t;let d=!0,g=It;if(i.shapeFlag&32){const _=n._;_?o&&_===1?d=!1:xg(u,n,o):(d=!n.$stable,Ig(n,u)),g=n}else n&&(Pg(t,n),g={default:1});if(d)for(const _ in u)!Af(_)&&g[_]==null&&delete u[_]},un=k1;function _1(t){return b1(t)}function b1(t,n){const o=id();o.__VUE__=!0;const{insert:i,remove:u,patchProp:d,createElement:g,createText:_,createComment:h,setText:R,setElementText:S,parentNode:B,nextSibling:T,setScopeId:X=Kl,insertStaticContent:G}=t,K=(I,E,P,z=null,j=null,U=null,ve=void 0,ie=null,Z=!!E.dynamicChildren)=>{if(I===E)return;I&&!Or(I,E)&&(z=kt(I),Et(I,j,U,!0),I=null),E.patchFlag===-2&&(Z=!1,E.dynamicChildren=null);const{type:Y,ref:Ce,shapeFlag:ee}=E;switch(Y){case cd:ye(I,E,P,z);break;case Da:me(I,E,P,z);break;case Uu:I==null&&te(E,P,z,ve);break;case Q:q(I,E,P,z,j,U,ve,ie,Z);break;default:ee&1?de(I,E,P,z,j,U,ve,ie,Z):ee&6?Ne(I,E,P,z,j,U,ve,ie,Z):(ee&64||ee&128)&&Y.process(I,E,P,z,j,U,ve,ie,Z,F)}Ce!=null&&j?_s(Ce,I&&I.ref,U,E||I,!E):Ce==null&&I&&I.ref!=null&&_s(I.ref,null,U,I,!0)},ye=(I,E,P,z)=>{if(I==null)i(E.el=_(E.children),P,z);else{const j=E.el=I.el;E.children!==I.children&&R(j,E.children)}},me=(I,E,P,z)=>{I==null?i(E.el=h(E.children||""),P,z):E.el=I.el},te=(I,E,P,z)=>{[I.el,I.anchor]=G(I.children,E,P,z,I.el,I.anchor)},Ae=({el:I,anchor:E},P,z)=>{let j;for(;I&&I!==E;)j=T(I),i(I,P,z),I=j;i(E,P,z)},ue=({el:I,anchor:E})=>{let P;for(;I&&I!==E;)P=T(I),u(I),I=P;u(E)},de=(I,E,P,z,j,U,ve,ie,Z)=>{if(E.type==="svg"?ve="svg":E.type==="math"&&(ve="mathml"),I==null)De(E,P,z,j,U,ve,ie,Z);else{const Y=I.el&&I.el._isVueCE?I.el:null;try{Y&&Y._beginPatch(),J(I,E,j,U,ve,ie,Z)}finally{Y&&Y._endPatch()}}},De=(I,E,P,z,j,U,ve,ie)=>{let Z,Y;const{props:Ce,shapeFlag:ee,transition:Se,dirs:Be}=I;if(Z=I.el=g(I.type,U,Ce&&Ce.is,Ce),ee&8?S(Z,I.children):ee&16&&oe(I.children,Z,null,z,j,qc(I,U),ve,ie),Be&&Er(I,null,z,"created"),ne(Z,I,I.scopeId,ve,z),Ce){for(const st in Ce)st!=="value"&&!ms(st)&&d(Z,st,null,Ce[st],U,z);"value"in Ce&&d(Z,"value",null,Ce.value,U),(Y=Ce.onVnodeBeforeMount)&&ql(Y,z,I)}Be&&Er(I,null,z,"beforeMount");const Qe=w1(j,Se);Qe&&Se.beforeEnter(Z),i(Z,E,P),((Y=Ce&&Ce.onVnodeMounted)||Qe||Be)&&un(()=>{try{Y&&ql(Y,z,I),Qe&&Se.enter(Z),Be&&Er(I,null,z,"mounted")}finally{}},j)},ne=(I,E,P,z,j)=>{if(P&&X(I,P),z)for(let U=0;U<z.length;U++)X(I,z[U]);if(j){let U=j.subTree;if(E===U||Eg(U.type)&&(U.ssContent===E||U.ssFallback===E)){const ve=j.vnode;ne(I,ve,ve.scopeId,ve.slotScopeIds,j.parent)}}},oe=(I,E,P,z,j,U,ve,ie,Z=0)=>{for(let Y=Z;Y<I.length;Y++){const Ce=I[Y]=ie?yo(I[Y]):Fl(I[Y]);K(null,Ce,E,P,z,j,U,ve,ie)}},J=(I,E,P,z,j,U,ve)=>{const ie=E.el=I.el;let{patchFlag:Z,dynamicChildren:Y,dirs:Ce}=E;Z|=I.patchFlag&16;const ee=I.props||It,Se=E.props||It;let Be;if(P&&Nr(P,!1),(Be=Se.onVnodeBeforeUpdate)&&ql(Be,P,E,I),Ce&&Er(E,I,P,"beforeUpdate"),P&&Nr(P,!0),Y&&(!I.dynamicChildren||I.dynamicChildren.length!==Y.length)&&(Z=0,ve=!1,Y=null),(ee.innerHTML&&Se.innerHTML==null||ee.textContent&&Se.textContent==null)&&S(ie,""),Y?W(I.dynamicChildren,Y,ie,P,z,qc(E,j),U):ve||tt(I,E,ie,null,P,z,qc(E,j),U,!1),Z>0){if(Z&16)D(ie,ee,Se,P,j);else if(Z&2&&ee.class!==Se.class&&d(ie,"class",null,Se.class,j),Z&4&&d(ie,"style",ee.style,Se.style,j),Z&8){const Qe=E.dynamicProps;for(let st=0;st<Qe.length;st++){const ut=Qe[st],Pt=ee[ut],Dt=Se[ut];(Dt!==Pt||ut==="value")&&d(ie,ut,Pt,Dt,j,P)}}Z&1&&I.children!==E.children&&S(ie,E.children)}else!ve&&Y==null&&D(ie,ee,Se,P,j);((Be=Se.onVnodeUpdated)||Ce)&&un(()=>{Be&&ql(Be,P,E,I),Ce&&Er(E,I,P,"updated")},z)},W=(I,E,P,z,j,U,ve)=>{for(let ie=0;ie<E.length;ie++){const Z=I[ie],Y=E[ie],Ce=Z.el&&(Z.type===Q||!Or(Z,Y)||Z.shapeFlag&198)?B(Z.el):P;K(Z,Y,Ce,null,z,j,U,ve,!0)}},D=(I,E,P,z,j)=>{if(E!==P){if(E!==It)for(const U in E)!ms(U)&&!(U in P)&&d(I,U,E[U],null,j,z);for(const U in P){if(ms(U))continue;const ve=P[U],ie=E[U];ve!==ie&&U!=="value"&&d(I,U,ie,ve,j,z)}"value"in P&&d(I,"value",E.value,P.value,j)}},q=(I,E,P,z,j,U,ve,ie,Z)=>{const Y=E.el=I?I.el:_(""),Ce=E.anchor=I?I.anchor:_("");let{patchFlag:ee,dynamicChildren:Se,slotScopeIds:Be}=E;Be&&(ie=ie?ie.concat(Be):Be),I==null?(i(Y,P,z),i(Ce,P,z),oe(E.children||[],P,Ce,j,U,ve,ie,Z)):ee>0&&ee&64&&Se&&I.dynamicChildren&&I.dynamicChildren.length===Se.length?(W(I.dynamicChildren,Se,P,j,U,ve,ie),(E.key!=null||j&&E===j.subTree)&&Ag(I,E,!0)):tt(I,E,P,Ce,j,U,ve,ie,Z)},Ne=(I,E,P,z,j,U,ve,ie,Z)=>{E.slotScopeIds=ie,I==null?E.shapeFlag&512?j.ctx.activate(E,P,z,ve,Z):Ye(E,P,z,j,U,ve,Z):it(I,E,Z)},Ye=(I,E,P,z,j,U,ve)=>{const ie=I.component=M1(I,z,j);if(Rs(I)&&(ie.ctx.renderer=F),R1(ie,!1,ve),ie.asyncDep){if(j&&j.registerDep(ie,ot,ve),!I.el){const Z=ie.subTree=We(Da);me(null,Z,E,P),I.placeholder=Z.el}}else ot(ie,I,E,P,j,U,ve)},it=(I,E,P)=>{const z=E.component=I.component;if(d1(I,E,P))if(z.asyncDep&&!z.asyncResolved){ft(z,E,P);return}else z.next=E,z.update();else E.el=I.el,z.vnode=E},ot=(I,E,P,z,j,U,ve)=>{const ie=()=>{if(I.isMounted){let{next:ee,bu:Se,u:Be,parent:Qe,vnode:st}=I;{const Ot=Mg(I);if(Ot){ee&&(ee.el=st.el,ft(I,ee,ve)),Ot.asyncDep.then(()=>{un(()=>{I.isUnmounted||Y()},j)});return}}let ut=ee,Pt;Nr(I,!1),ee?(ee.el=st.el,ft(I,ee,ve)):ee=st,Se&&Ou(Se),(Pt=ee.props&&ee.props.onVnodeBeforeUpdate)&&ql(Pt,Qe,ee,st),Nr(I,!0);const Dt=Yp(I),ba=I.subTree;I.subTree=Dt,K(ba,Dt,B(ba.el),kt(ba),I,j,U),ee.el=Dt.el,ut===null&&c1(I,Dt.el),Be&&un(Be,j),(Pt=ee.props&&ee.props.onVnodeUpdated)&&un(()=>ql(Pt,Qe,ee,st),j)}else{let ee;const{el:Se,props:Be}=E,{bm:Qe,m:st,parent:ut,root:Pt,type:Dt}=I,ba=Ci(E);Nr(I,!1),Qe&&Ou(Qe),!ba&&(ee=Be&&Be.onVnodeBeforeMount)&&ql(ee,ut,E),Nr(I,!0);{Pt.ce&&Pt.ce._hasShadowRoot()&&Pt.ce._injectChildStyle(Dt,I.parent?I.parent.type:void 0);const Ot=I.subTree=Yp(I);K(null,Ot,P,z,I,j,U),E.el=Ot.el}if(st&&un(st,j),!ba&&(ee=Be&&Be.onVnodeMounted)){const Ot=E;un(()=>ql(ee,ut,Ot),j)}(E.shapeFlag&256||ut&&Ci(ut.vnode)&&ut.vnode.shapeFlag&256)&&I.a&&un(I.a,j),I.isMounted=!0,E=P=z=null}};I.scope.on();const Z=I.effect=new Om(ie);I.scope.off();const Y=I.update=Z.run.bind(Z),Ce=I.job=Z.runIfDirty.bind(Z);Ce.i=I,Ce.id=I.uid,Z.scheduler=()=>Sf(Ce),Nr(I,!0),Y()},ft=(I,E,P)=>{E.component=I;const z=I.vnode.props;I.vnode=E,I.next=null,v1(I,E.props,z,P),y1(I,E.children,P),Vl(),Wp(I),Gl()},tt=(I,E,P,z,j,U,ve,ie,Z=!1)=>{const Y=I&&I.children,Ce=I?I.shapeFlag:0,ee=E.children,{patchFlag:Se,shapeFlag:Be}=E;if(Se>0){if(Se&128){at(Y,ee,P,z,j,U,ve,ie,Z);return}else if(Se&256){va(Y,ee,P,z,j,U,ve,ie,Z);return}}Be&8?(Ce&16&&_a(Y,j,U),ee!==Y&&S(P,ee)):Ce&16?Be&16?at(Y,ee,P,z,j,U,ve,ie,Z):_a(Y,j,U,!0):(Ce&8&&S(P,""),Be&16&&oe(ee,P,z,j,U,ve,ie,Z))},va=(I,E,P,z,j,U,ve,ie,Z)=>{I=I||hi,E=E||hi;const Y=I.length,Ce=E.length,ee=Math.min(Y,Ce);let Se;for(Se=0;Se<ee;Se++){const Be=E[Se]=Z?yo(E[Se]):Fl(E[Se]);K(I[Se],Be,P,null,j,U,ve,ie,Z)}Y>Ce?_a(I,j,U,!0,!1,ee):oe(E,P,z,j,U,ve,ie,Z,ee)},at=(I,E,P,z,j,U,ve,ie,Z)=>{let Y=0;const Ce=E.length;let ee=I.length-1,Se=Ce-1;for(;Y<=ee&&Y<=Se;){const Be=I[Y],Qe=E[Y]=Z?yo(E[Y]):Fl(E[Y]);if(Or(Be,Qe))K(Be,Qe,P,null,j,U,ve,ie,Z);else break;Y++}for(;Y<=ee&&Y<=Se;){const Be=I[ee],Qe=E[Se]=Z?yo(E[Se]):Fl(E[Se]);if(Or(Be,Qe))K(Be,Qe,P,null,j,U,ve,ie,Z);else break;ee--,Se--}if(Y>ee){if(Y<=Se){const Be=Se+1,Qe=Be<Ce?E[Be].el:z;for(;Y<=Se;)K(null,E[Y]=Z?yo(E[Y]):Fl(E[Y]),P,Qe,j,U,ve,ie,Z),Y++}}else if(Y>Se)for(;Y<=ee;)Et(I[Y],j,U,!0),Y++;else{const Be=Y,Qe=Y,st=new Map;for(Y=Qe;Y<=Se;Y++){const Wt=E[Y]=Z?yo(E[Y]):Fl(E[Y]);Wt.key!=null&&st.set(Wt.key,Y)}let ut,Pt=0;const Dt=Se-Qe+1;let ba=!1,Ot=0;const Ea=new Array(Dt);for(Y=0;Y<Dt;Y++)Ea[Y]=0;for(Y=Be;Y<=ee;Y++){const Wt=I[Y];if(Pt>=Dt){Et(Wt,j,U,!0);continue}let yt;if(Wt.key!=null)yt=st.get(Wt.key);else for(ut=Qe;ut<=Se;ut++)if(Ea[ut-Qe]===0&&Or(Wt,E[ut])){yt=ut;break}yt===void 0?Et(Wt,j,U,!0):(Ea[yt-Qe]=Y+1,yt>=Ot?Ot=yt:ba=!0,K(Wt,E[yt],P,null,j,U,ve,ie,Z),Pt++)}const Yn=ba?h1(Ea):hi;for(ut=Yn.length-1,Y=Dt-1;Y>=0;Y--){const Wt=Qe+Y,yt=E[Wt],Na=E[Wt+1],ma=Wt+1<Ce?Na.el||Rg(Na):z;Ea[Y]===0?K(null,yt,P,ma,j,U,ve,ie,Z):ba&&(ut<0||Y!==Yn[ut]?pa(yt,P,ma,2):ut--)}}},pa=(I,E,P,z,j=null)=>{const{el:U,type:ve,transition:ie,children:Z,shapeFlag:Y}=I;if(Y&6){pa(I.component.subTree,E,P,z);return}if(Y&128){I.suspense.move(E,P,z);return}if(Y&64){ve.move(I,E,P,F);return}if(ve===Q){i(U,E,P);for(let ee=0;ee<Z.length;ee++)pa(Z[ee],E,P,z);i(I.anchor,E,P);return}if(ve===Uu){Ae(I,E,P);return}if(z!==2&&Y&1&&ie)if(z===0)ie.persisted&&!U[jn]?i(U,E,P):(ie.beforeEnter(U),i(U,E,P),un(()=>ie.enter(U),j));else{const{leave:ee,delayLeave:Se,afterLeave:Be}=ie,Qe=()=>{I.ctx.isUnmounted?u(U):i(U,E,P)},st=()=>{const ut=U._isLeaving||!!U[jn];U._isLeaving&&U[jn](!0),ie.persisted&&!ut?Qe():ee(U,()=>{Qe(),Be&&Be()})};Se?Se(U,Qe,st):st()}else i(U,E,P)},Et=(I,E,P,z=!1,j=!1)=>{const{type:U,props:ve,ref:ie,children:Z,dynamicChildren:Y,shapeFlag:Ce,patchFlag:ee,dirs:Se,cacheIndex:Be,memo:Qe}=I;if(ee===-2&&(j=!1),ie!=null&&(Vl(),_s(ie,null,P,I,!0),Gl()),Be!=null&&(E.renderCache[Be]=void 0),Ce&256){E.ctx.deactivate(I);return}const st=Ce&1&&Se,ut=!Ci(I);let Pt;if(ut&&(Pt=ve&&ve.onVnodeBeforeUnmount)&&ql(Pt,E,I),Ce&6)Lt(I.component,P,z);else{if(Ce&128){I.suspense.unmount(P,z);return}st&&Er(I,null,E,"beforeUnmount"),Ce&64?I.type.remove(I,E,P,F,z):Y&&!Y.hasOnce&&(U!==Q||ee>0&&ee&64)?_a(Y,E,P,!1,!0):(U===Q&&ee&384||!j&&Ce&16)&&_a(Z,E,P),z&&dn(I)}const Dt=Qe!=null&&Be==null;(ut&&(Pt=ve&&ve.onVnodeUnmounted)||st||Dt)&&un(()=>{Pt&&ql(Pt,E,I),st&&Er(I,null,E,"unmounted"),Dt&&(I.el=null)},P)},dn=I=>{const{type:E,el:P,anchor:z,transition:j}=I;if(E===Q){Qn(P,z);return}if(E===Uu){ue(I);return}const U=()=>{u(P),j&&!j.persisted&&j.afterLeave&&j.afterLeave()};if(I.shapeFlag&1&&j&&!j.persisted){const{leave:ve,delayLeave:ie}=j,Z=()=>ve(P,U);ie?ie(I.el,U,Z):Z()}else U()},Qn=(I,E)=>{let P;for(;I!==E;)P=T(I),u(I),I=P;u(E)},Lt=(I,E,P)=>{const{bum:z,scope:j,job:U,subTree:ve,um:ie,m:Z,a:Y}=I;Zp(Z),Zp(Y),z&&Ou(z),j.stop(),U&&(U.flags|=8,Et(ve,I,E,P)),ie&&un(ie,E),un(()=>{I.isUnmounted=!0},E)},_a=(I,E,P,z=!1,j=!1,U=0)=>{for(let ve=U;ve<I.length;ve++)Et(I[ve],E,P,z,j)},kt=I=>{if(I.shapeFlag&6)return kt(I.component.subTree);if(I.shapeFlag&128)return I.suspense.next();const E=T(I.anchor||I.el),P=E&&E[Lk];return P?T(P):E};let qt=!1;const ae=(I,E,P)=>{let z;I==null?E._vnode&&(Et(E._vnode,null,null,!0),z=E._vnode.component):K(E._vnode||null,I,E,null,null,null,P),E._vnode=I,qt||(qt=!0,Wp(z),ag(),qt=!1)},F={p:K,um:Et,m:pa,r:dn,mt:Ye,mc:oe,pc:tt,pbc:W,n:kt,o:t};return{render:ae,hydrate:void 0,createApp:l1(ae)}}function qc({type:t,props:n},o){return o==="svg"&&t==="foreignObject"||o==="mathml"&&t==="annotation-xml"&&n&&n.encoding&&n.encoding.includes("html")?void 0:o}function Nr({effect:t,job:n},o){o?(t.flags|=32,n.flags|=4):(t.flags&=-33,n.flags&=-5)}function w1(t,n){return(!t||t&&!t.pendingBranch)&&n&&!n.persisted}function Ag(t,n,o=!1){const i=t.children,u=n.children;if(qe(i)&&qe(u))for(let d=0;d<i.length;d++){const g=i[d];let _=u[d];_.shapeFlag&1&&!_.dynamicChildren&&((_.patchFlag<=0||_.patchFlag===32)&&(_=u[d]=yo(u[d]),_.el=g.el),!o&&_.patchFlag!==-2&&Ag(g,_)),_.type===cd&&(_.patchFlag===-1&&(_=u[d]=yo(_)),_.el=g.el),_.type===Da&&!_.el&&(_.el=g.el)}}function h1(t){const n=t.slice(),o=[0];let i,u,d,g,_;const h=t.length;for(i=0;i<h;i++){const R=t[i];if(R!==0){if(u=o[o.length-1],t[u]<R){n[i]=u,o.push(i);continue}for(d=0,g=o.length-1;d<g;)_=d+g>>1,t[o[_]]<R?d=_+1:g=_;R<t[o[d]]&&(d>0&&(n[i]=o[d-1]),o[d]=i)}}for(d=o.length,g=o[d-1];d-- >0;)o[d]=g,g=n[g];return o}function Mg(t){const n=t.subTree.component;if(n)return n.asyncDep&&!n.asyncResolved?n:Mg(n)}function Zp(t){if(t)for(let n=0;n<t.length;n++)t[n].flags|=8}function Rg(t){if(t.placeholder)return t.placeholder;const n=t.component;return n?Rg(n.subTree):null}const Eg=t=>t.__isSuspense;function k1(t,n){n&&n.pendingBranch?qe(t)?n.effects.push(...t):n.effects.push(t):Rk(t)}const Q=Symbol.for("v-fgt"),cd=Symbol.for("v-txt"),Da=Symbol.for("v-cmt"),Uu=Symbol.for("v-stc"),ws=[];let Sn=null;function m(t=!1){ws.push(Sn=t?null:[])}function $1(){ws.pop(),Sn=ws[ws.length-1]||null}let Ss=1;function Yu(t,n=!1){Ss+=t,t<0&&Sn&&n&&(Sn.hasOnce=!0)}function Ng(t){return t.dynamicChildren=Ss>0?Sn||hi:null,$1(),Ss>0&&Sn&&Sn.push(t),t}function y(t,n,o,i,u,d){return Ng(l(t,n,o,i,u,d,!0))}function Ct(t,n,o,i,u){return Ng(We(t,n,o,i,u,!0))}function Is(t){return t?t.__v_isVNode===!0:!1}function Or(t,n){return t.type===n.type&&t.key===n.key}const Tg=({key:t})=>t??null,Fu=({ref:t,ref_key:n,ref_for:o})=>(typeof t=="number"&&(t=""+t),t!=null?Yt(t)||Ua(t)||Ke(t)?{i:Wa,r:t,k:n,f:!!o}:t:null);function l(t,n=null,o=null,i=0,u=null,d=t===Q?0:1,g=!1,_=!1){const h={__v_isVNode:!0,__v_skip:!0,type:t,props:n,key:n&&Tg(n),ref:n&&Fu(n),scopeId:lg,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:d,patchFlag:i,dynamicProps:u,dynamicChildren:null,appContext:null,ctx:Wa};return _?(Ju(h,o),d&128&&t.normalize(h)):o&&(h.shapeFlag|=Yt(o)?8:16),Ss>0&&!g&&Sn&&(h.patchFlag>0||d&6)&&h.patchFlag!==32&&Sn.push(h),h}const We=C1;function C1(t,n=null,o=null,i=0,u=null,d=!1){if((!t||t===Yk)&&(t=Da),Is(t)){const _=ir(t,n,!0);return o&&Ju(_,o),Ss>0&&!d&&Sn&&(_.shapeFlag&6?Sn[Sn.indexOf(t)]=_:Sn.push(_)),_.patchFlag=-2,_}if(B1(t)&&(t=t.__vccOpts),n){n=S1(n);let{class:_,style:h}=n;_&&!Yt(_)&&(n.class=fe(_)),ht(h)&&(Cf(h)&&!qe(h)&&(h=fa({},h)),n.style=ca(h))}const g=Yt(t)?1:Eg(t)?128:ig(t)?64:ht(t)?4:Ke(t)?2:0;return l(t,n,o,i,u,g,d,!0)}function S1(t){return t?Cf(t)||$g(t)?fa({},t):t:null}function ir(t,n,o=!1,i=!1){const{props:u,ref:d,patchFlag:g,children:_,transition:h}=t,R=n?P1(u||{},n):u,S={__v_isVNode:!0,__v_skip:!0,type:t.type,props:R,key:R&&Tg(R),ref:n&&n.ref?o&&d?qe(d)?d.concat(Fu(n)):[d,Fu(n)]:Fu(n):d,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:_,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:n&&t.type!==Q?g===-1?16:g|16:g,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:h,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&ir(t.ssContent),ssFallback:t.ssFallback&&ir(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return h&&i&&Fr(S,h.clone(S)),S}function Kn(t=" ",n=0){return We(cd,null,t,n)}function I1(t,n){const o=We(Uu,null,t);return o.staticCount=n,o}function H(t="",n=!1){return n?(m(),Ct(Da,null,t)):We(Da,null,t)}function Fl(t){return t==null||typeof t=="boolean"?We(Da):qe(t)?We(Q,null,t.slice()):Is(t)?yo(t):We(cd,null,String(t))}function yo(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:ir(t)}function Ju(t,n){let o=0;const{shapeFlag:i}=t;if(n==null)n=null;else if(qe(n))o=16;else if(typeof n=="object")if(i&65){const u=n.default;u&&(u._c&&(u._d=!1),Ju(t,u()),u._c&&(u._d=!0));return}else{o=32;const u=n._;!u&&!$g(n)?n._ctx=Wa:u===3&&Wa&&(Wa.slots._===1?n._=1:(n._=2,t.patchFlag|=1024))}else if(Ke(n)){if(i&65){Ju(t,{default:n});return}n={default:n,_ctx:Wa},o=32}else n=String(n),i&64?(o=16,n=[Kn(n)]):o=8;t.children=n,t.shapeFlag|=o}function P1(...t){const n={};for(let o=0;o<t.length;o++){const i=t[o];for(const u in i)if(u==="class")n.class!==i.class&&(n.class=fe([n.class,i.class]));else if(u==="style")n.style=ca([n.style,i.style]);else if(nd(u)){const d=n[u],g=i[u];g&&d!==g&&!(qe(d)&&d.includes(g))?n[u]=d?[].concat(d,g):g:g==null&&d==null&&!ld(u)&&(n[u]=g)}else u!==""&&(n[u]=i[u])}return n}function ql(t,n,o,i=null){zn(t,n,7,[o,i])}const x1=_g();let A1=0;function M1(t,n,o){const i=t.type,u=(n?n.appContext:t.appContext)||x1,d={uid:A1++,vnode:t,type:i,parent:n,appContext:u,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new tk(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(u.provides),ids:n?n.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Sg(i,u),emitsOptions:bg(i,u),emit:null,emitted:null,propsDefaults:It,inheritAttrs:i.inheritAttrs,ctx:It,data:It,props:It,attrs:It,slots:It,refs:It,setupState:It,setupContext:null,suspense:o,suspenseId:o?o.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return d.ctx={_:d},d.root=n?n.root:d,d.emit=r1.bind(null,d),t.ce&&t.ce(d),d}let Oa=null;const fd=()=>Oa||Wa;let Xu,sf;{const t=id(),n=(o,i)=>{let u;return(u=t[o])||(u=t[o]=[]),u.push(i),d=>{u.length>1?u.forEach(g=>g(d)):u[0](d)}};Xu=n("__VUE_INSTANCE_SETTERS__",o=>Oa=o),sf=n("__VUE_SSR_SETTERS__",o=>xi=o)}const Es=t=>{const n=Oa;return Xu(t),t.scope.on(),()=>{t.scope.off(),Xu(n)}},em=()=>{Oa&&Oa.scope.off(),Xu(null)};function Bg(t){return t.vnode.shapeFlag&4}let xi=!1;function R1(t,n=!1,o=!1){n&&sf(n);const{props:i,children:u}=t.vnode,d=Bg(t);f1(t,i,d,n),g1(t,u,o||n);const g=d?E1(t,n):void 0;return n&&sf(!1),g}function E1(t,n){const o=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,Jk);const{setup:i}=o;if(i){Vl();const u=t.setupContext=i.length>1?T1(t):null,d=Es(t),g=As(i,t,0,[t.props,u]),_=Rm(g);if(Gl(),d(),(_||t.sp)&&!Ci(t)&&Pf(t),_){if(g.then(em,em),n)return g.then(h=>{tm(t,h)}).catch(h=>{Ms(h,t,0)});t.asyncDep=g}else tm(t,g)}else Lg(t)}function tm(t,n,o){Ke(n)?t.type.__ssrInlineRender?t.ssrRender=n:t.render=n:ht(n)&&(t.setupState=Zm(n)),Lg(t)}function Lg(t,n,o){const i=t.type;t.render||(t.render=i.render||Kl);{const u=Es(t);Vl();try{Xk(t)}finally{Gl(),u()}}}const N1={get(t,n){return La(t,"get",""),t[n]}};function T1(t){const n=o=>{t.exposed=o||{}};return{attrs:new Proxy(t.attrs,N1),slots:t.slots,emit:t.emit,expose:n}}function vd(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(Zm(hk(t.exposed)),{get(n,o){if(o in n)return n[o];if(o in bs)return bs[o](t)},has(n,o){return o in n||o in bs}})):t.proxy}function B1(t){return Ke(t)&&"__vccOpts"in t}const M=(t,n)=>Ik(t,n,xi);function L1(t,n,o){try{Yu(-1);const i=arguments.length;return i===2?ht(n)&&!qe(n)?Is(n)?We(t,null,[n]):We(t,n):We(t,null,n):(i>3?o=Array.prototype.slice.call(arguments,2):i===3&&Is(o)&&(o=[o]),We(t,n,o))}finally{Yu(1)}}const q1="3.5.39";/**
|
||
* @vue/runtime-dom v3.5.39
|
||
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
||
* @license MIT
|
||
**/let uf;const am=typeof window<"u"&&window.trustedTypes;if(am)try{uf=am.createPolicy("vue",{createHTML:t=>t})}catch{}const qg=uf?t=>uf.createHTML(t):t=>t,D1="http://www.w3.org/2000/svg",O1="http://www.w3.org/1998/Math/MathML",mo=typeof document<"u"?document:null,nm=mo&&mo.createElement("template"),W1={insert:(t,n,o)=>{n.insertBefore(t,o||null)},remove:t=>{const n=t.parentNode;n&&n.removeChild(t)},createElement:(t,n,o,i)=>{const u=n==="svg"?mo.createElementNS(D1,t):n==="mathml"?mo.createElementNS(O1,t):o?mo.createElement(t,{is:o}):mo.createElement(t);return t==="select"&&i&&i.multiple!=null&&u.setAttribute("multiple",i.multiple),u},createText:t=>mo.createTextNode(t),createComment:t=>mo.createComment(t),setText:(t,n)=>{t.nodeValue=n},setElementText:(t,n)=>{t.textContent=n},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>mo.querySelector(t),setScopeId(t,n){t.setAttribute(n,"")},insertStaticContent(t,n,o,i,u,d){const g=o?o.previousSibling:n.lastChild;if(u&&(u===d||u.nextSibling))for(;n.insertBefore(u.cloneNode(!0),o),!(u===d||!(u=u.nextSibling)););else{nm.innerHTML=qg(i==="svg"?`<svg>${t}</svg>`:i==="mathml"?`<math>${t}</math>`:t);const _=nm.content;if(i==="svg"||i==="mathml"){const h=_.firstChild;for(;h.firstChild;)_.appendChild(h.firstChild);_.removeChild(h)}n.insertBefore(_,o)}return[g?g.nextSibling:n.firstChild,o?o.previousSibling:n.lastChild]}},tr="transition",ss="animation",Ai=Symbol("_vtc"),Dg={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Og=fa({},ug,Dg),U1=t=>(t.displayName="Transition",t.props=Og,t),Ya=U1((t,{slots:n})=>L1(Dk,Wg(t),n)),Tr=(t,n=[])=>{qe(t)?t.forEach(o=>o(...n)):t&&t(...n)},lm=t=>t?qe(t)?t.some(n=>n.length>1):t.length>1:!1;function Wg(t){const n={};for(const q in t)q in Dg||(n[q]=t[q]);if(t.css===!1)return n;const{name:o="v",type:i,duration:u,enterFromClass:d=`${o}-enter-from`,enterActiveClass:g=`${o}-enter-active`,enterToClass:_=`${o}-enter-to`,appearFromClass:h=d,appearActiveClass:R=g,appearToClass:S=_,leaveFromClass:B=`${o}-leave-from`,leaveActiveClass:T=`${o}-leave-active`,leaveToClass:X=`${o}-leave-to`}=t,G=F1(u),K=G&&G[0],ye=G&&G[1],{onBeforeEnter:me,onEnter:te,onEnterCancelled:Ae,onLeave:ue,onLeaveCancelled:de,onBeforeAppear:De=me,onAppear:ne=te,onAppearCancelled:oe=Ae}=n,J=(q,Ne,Ye,it)=>{q._enterCancelled=it,nr(q,Ne?S:_),nr(q,Ne?R:g),Ye&&Ye()},W=(q,Ne)=>{q._isLeaving=!1,nr(q,B),nr(q,X),nr(q,T),Ne&&Ne()},D=q=>(Ne,Ye)=>{const it=q?ne:te,ot=()=>J(Ne,q,Ye);Tr(it,[Ne,ot]),om(()=>{nr(Ne,q?h:d),Ol(Ne,q?S:_),lm(it)||rm(Ne,i,K,ot)})};return fa(n,{onBeforeEnter(q){Tr(me,[q]),Ol(q,d),Ol(q,g)},onBeforeAppear(q){Tr(De,[q]),Ol(q,h),Ol(q,R)},onEnter:D(!1),onAppear:D(!0),onLeave(q,Ne){q._isLeaving=!0;const Ye=()=>W(q,Ne);Ol(q,B),q._enterCancelled?(Ol(q,T),df(q)):(df(q),Ol(q,T)),om(()=>{q._isLeaving&&(nr(q,B),Ol(q,X),lm(ue)||rm(q,i,ye,Ye))}),Tr(ue,[q,Ye])},onEnterCancelled(q){J(q,!1,void 0,!0),Tr(Ae,[q])},onAppearCancelled(q){J(q,!0,void 0,!0),Tr(oe,[q])},onLeaveCancelled(q){W(q),Tr(de,[q])}})}function F1(t){if(t==null)return null;if(ht(t))return[Dc(t.enter),Dc(t.leave)];{const n=Dc(t);return[n,n]}}function Dc(t){return zh(t)}function Ol(t,n){n.split(/\s+/).forEach(o=>o&&t.classList.add(o)),(t[Ai]||(t[Ai]=new Set)).add(n)}function nr(t,n){n.split(/\s+/).forEach(i=>i&&t.classList.remove(i));const o=t[Ai];o&&(o.delete(n),o.size||(t[Ai]=void 0))}function om(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let j1=0;function rm(t,n,o,i){const u=t._endId=++j1,d=()=>{u===t._endId&&i()};if(o!=null)return setTimeout(d,o);const{type:g,timeout:_,propCount:h}=Ug(t,n);if(!g)return i();const R=g+"end";let S=0;const B=()=>{t.removeEventListener(R,T),d()},T=X=>{X.target===t&&++S>=h&&B()};setTimeout(()=>{S<h&&B()},_+1),t.addEventListener(R,T)}function Ug(t,n){const o=window.getComputedStyle(t),i=G=>(o[G]||"").split(", "),u=i(`${tr}Delay`),d=i(`${tr}Duration`),g=im(u,d),_=i(`${ss}Delay`),h=i(`${ss}Duration`),R=im(_,h);let S=null,B=0,T=0;n===tr?g>0&&(S=tr,B=g,T=d.length):n===ss?R>0&&(S=ss,B=R,T=h.length):(B=Math.max(g,R),S=B>0?g>R?tr:ss:null,T=S?S===tr?d.length:h.length:0);const X=S===tr&&/\b(?:transform|all)(?:,|$)/.test(i(`${tr}Property`).toString());return{type:S,timeout:B,propCount:T,hasTransform:X}}function im(t,n){for(;t.length<n.length;)t=t.concat(t);return Math.max(...n.map((o,i)=>sm(o)+sm(t[i])))}function sm(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function df(t){return(t?t.ownerDocument:document).body.offsetHeight}function K1(t,n,o){const i=t[Ai];i&&(n=(n?[n,...i]:[...i]).join(" ")),n==null?t.removeAttribute("class"):o?t.setAttribute("class",n):t.className=n}const um=Symbol("_vod"),Fg=Symbol("_vsh"),V1=Symbol(""),G1=/(?:^|;)\s*display\s*:/;function z1(t,n,o){const i=t.style,u=Yt(o);let d=!1;if(o&&!u){if(n)if(Yt(n))for(const g of n.split(";")){const _=g.slice(0,g.indexOf(":")).trim();o[_]==null&&fs(i,_,"")}else for(const g in n)o[g]==null&&fs(i,g,"");for(const g in o){g==="display"&&(d=!0);const _=o[g];_!=null?Q1(t,g,!Yt(n)&&n?n[g]:void 0,_)||fs(i,g,_):fs(i,g,"")}}else if(u){if(n!==o){const g=i[V1];g&&(o+=";"+g),i.cssText=o,d=G1.test(o)}}else n&&t.removeAttribute("style");um in t&&(t[um]=d?i.display:"",t[Fg]&&(i.display="none"))}const dm=/\s*!important$/;function fs(t,n,o){if(qe(o))o.forEach(i=>fs(t,n,i));else if(o==null&&(o=""),n.startsWith("--"))t.setProperty(n,o);else{const i=H1(t,n);dm.test(o)?t.setProperty(ur(i),o.replace(dm,""),"important"):t[i]=o}}const cm=["Webkit","Moz","ms"],Oc={};function H1(t,n){const o=Oc[n];if(o)return o;let i=gl(n);if(i!=="filter"&&i in t)return Oc[n]=i;i=Tm(i);for(let u=0;u<cm.length;u++){const d=cm[u]+i;if(d in t)return Oc[n]=d}return n}function Q1(t,n,o,i){return t.tagName==="TEXTAREA"&&(n==="width"||n==="height")&&Yt(i)&&o===i}const fm="http://www.w3.org/1999/xlink";function vm(t,n,o,i,u,d=Zh(n)){i&&n.startsWith("xlink:")?o==null?t.removeAttributeNS(fm,n.slice(6,n.length)):t.setAttributeNS(fm,n,o):o==null||d&&!Lm(o)?t.removeAttribute(n):t.setAttribute(n,d?"":_l(o)?String(o):o)}function pm(t,n,o,i,u){if(n==="innerHTML"||n==="textContent"){o!=null&&(t[n]=n==="innerHTML"?qg(o):o);return}const d=t.tagName;if(n==="value"&&d!=="PROGRESS"&&!d.includes("-")){const _=d==="OPTION"?t.getAttribute("value")||"":t.value,h=o==null?t.type==="checkbox"?"on":"":String(o);(_!==h||!("_value"in t))&&(t.value=h),o==null&&t.removeAttribute(n),t._value=o;return}let g=!1;if(o===""||o==null){const _=typeof t[n];_==="boolean"?o=Lm(o):o==null&&_==="string"?(o="",g=!0):_==="number"&&(o=0,g=!0)}try{t[n]=o}catch{}g&&t.removeAttribute(u||n)}function wo(t,n,o,i){t.addEventListener(n,o,i)}function Y1(t,n,o,i){t.removeEventListener(n,o,i)}const mm=Symbol("_vei");function J1(t,n,o,i,u=null){const d=t[mm]||(t[mm]={}),g=d[n];if(i&&g)g.value=i;else{const[_,h]=e0(n);if(i){const R=d[n]=n0(i,u);wo(t,_,R,h)}else g&&(Y1(t,_,g,h),d[n]=void 0)}}const X1=/(Once|Passive|Capture)$/,Z1=/^on:?(?:Once|Passive|Capture)$/;function e0(t){let n,o;for(;(o=t.match(X1))&&!Z1.test(t);)n||(n={}),t=t.slice(0,t.length-o[1].length),n[o[1].toLowerCase()]=!0;return[t[2]===":"?t.slice(3):ur(t.slice(2)),n]}let Wc=0;const t0=Promise.resolve(),a0=()=>Wc||(t0.then(()=>Wc=0),Wc=Date.now());function n0(t,n){const o=i=>{if(!i._vts)i._vts=Date.now();else if(i._vts<=o.attached)return;const u=o.value;if(qe(u)){const d=i.stopImmediatePropagation;i.stopImmediatePropagation=()=>{d.call(i),i._stopped=!0};const g=u.slice(),_=[i];for(let h=0;h<g.length&&!i._stopped;h++){const R=g[h];R&&zn(R,n,5,_)}}else zn(u,n,5,[i])};return o.value=t,o.attached=a0(),o}const gm=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,l0=(t,n,o,i,u,d)=>{const g=u==="svg";n==="class"?K1(t,i,g):n==="style"?z1(t,o,i):nd(n)?ld(n)||J1(t,n,o,i,d):(n[0]==="."?(n=n.slice(1),!0):n[0]==="^"?(n=n.slice(1),!1):o0(t,n,i,g))?(pm(t,n,i),!t.tagName.includes("-")&&(n==="value"||n==="checked"||n==="selected")&&vm(t,n,i,g,d,n!=="value")):t._isVueCE&&(r0(t,n)||t._def.__asyncLoader&&(/[A-Z]/.test(n)||!Yt(i)))?pm(t,gl(n),i,d,n):(n==="true-value"?t._trueValue=i:n==="false-value"&&(t._falseValue=i),vm(t,n,i,g))};function o0(t,n,o,i){if(i)return!!(n==="innerHTML"||n==="textContent"||n in t&&gm(n)&&Ke(o));if(n==="spellcheck"||n==="draggable"||n==="translate"||n==="autocorrect"||n==="sandbox"&&t.tagName==="IFRAME"||n==="form"||n==="list"&&t.tagName==="INPUT"||n==="type"&&t.tagName==="TEXTAREA")return!1;if(n==="width"||n==="height"){const u=t.tagName;if(u==="IMG"||u==="VIDEO"||u==="CANVAS"||u==="SOURCE")return!1}return gm(n)&&Yt(o)?!1:n in t}function r0(t,n){const o=t._def.props;if(!o)return!1;const i=gl(n);return Array.isArray(o)?o.some(u=>gl(u)===i):Object.keys(o).some(u=>gl(u)===i)}const jg=new WeakMap,Kg=new WeakMap,Zu=Symbol("_moveCb"),ym=Symbol("_enterCb"),i0=t=>(delete t.props.mode,t),s0=i0({name:"TransitionGroup",props:fa({},Og,{tag:String,moveClass:String}),setup(t,{slots:n}){const o=fd(),i=sg();let u,d;return pg(()=>{if(!u.length)return;const g=t.moveClass||`${t.name||"v"}-move`;if(!f0(u[0].el,o.vnode.el,g)){u=[];return}u.forEach(u0),u.forEach(d0);const _=u.filter(c0);df(o.vnode.el),_.forEach(h=>{const R=h.el,S=R.style;Ol(R,g),S.transform=S.webkitTransform=S.transitionDuration="";const B=R[Zu]=T=>{T&&T.target!==R||(!T||T.propertyName.endsWith("transform"))&&(R.removeEventListener("transitionend",B),R[Zu]=null,nr(R,g))};R.addEventListener("transitionend",B)}),u=[]}),()=>{const g=mt(t),_=Wg(g);let h=g.tag||Q;if(u=[],d)for(let R=0;R<d.length;R++){const S=d[R];S.el&&S.el instanceof Element&&!S.el[Fg]&&(u.push(S),Fr(S,Cs(S,_,i,o)),jg.set(S,Vg(S.el)))}d=n.default?If(n.default()):[];for(let R=0;R<d.length;R++){const S=d[R];S.key!=null&&Fr(S,Cs(S,_,i,o))}return We(h,null,d)}}}),Bu=s0;function u0(t){const n=t.el;n[Zu]&&n[Zu](),n[ym]&&n[ym]()}function d0(t){Kg.set(t,Vg(t.el))}function c0(t){const n=jg.get(t),o=Kg.get(t),i=n.left-o.left,u=n.top-o.top;if(i||u){const d=t.el,g=d.style,_=d.getBoundingClientRect();let h=1,R=1;return d.offsetWidth&&(h=_.width/d.offsetWidth),d.offsetHeight&&(R=_.height/d.offsetHeight),(!Number.isFinite(h)||h===0)&&(h=1),(!Number.isFinite(R)||R===0)&&(R=1),Math.abs(h-1)<.01&&(h=1),Math.abs(R-1)<.01&&(R=1),g.transform=g.webkitTransform=`translate(${i/h}px,${u/R}px)`,g.transitionDuration="0s",t}}function Vg(t){const n=t.getBoundingClientRect();return{left:n.left,top:n.top}}function f0(t,n,o){const i=t.cloneNode(),u=t[Ai];u&&u.forEach(_=>{_.split(/\s+/).forEach(h=>h&&i.classList.remove(h))}),o.split(/\s+/).forEach(_=>_&&i.classList.add(_)),i.style.display="none";const d=n.nodeType===1?n:n.parentNode;d.appendChild(i);const{hasTransform:g}=Ug(i);return d.removeChild(i),g}const sr=t=>{const n=t.props["onUpdate:modelValue"]||!1;return qe(n)?o=>Ou(n,o):n};function v0(t){t.target.composing=!0}function _m(t){const n=t.target;n.composing&&(n.composing=!1,n.dispatchEvent(new Event("input")))}const Gn=Symbol("_assign");function bm(t,n,o){return n&&(t=t.trim()),o&&(t=rd(t)),t}const je={created(t,{modifiers:{lazy:n,trim:o,number:i}},u){t[Gn]=sr(u);const d=i||u.props&&u.props.type==="number";wo(t,n?"change":"input",g=>{g.target.composing||t[Gn](bm(t.value,o,d))}),(o||d)&&wo(t,"change",()=>{t.value=bm(t.value,o,d)}),n||(wo(t,"compositionstart",v0),wo(t,"compositionend",_m),wo(t,"change",_m))},mounted(t,{value:n}){t.value=n??""},beforeUpdate(t,{value:n,oldValue:o,modifiers:{lazy:i,trim:u,number:d}},g){if(t[Gn]=sr(g),t.composing)return;const _=(d||t.type==="number")&&!/^0\d/.test(t.value)?rd(t.value):t.value,h=n??"";if(_===h)return;const R=t.getRootNode();(R instanceof Document||R instanceof ShadowRoot)&&R.activeElement===t&&t.type!=="range"&&(i&&n===o||u&&t.value.trim()===h)||(t.value=h)}},ed={deep:!0,created(t,n,o){t[Gn]=sr(o),wo(t,"change",()=>{const i=t._modelValue,u=Mi(t),d=t.checked,g=t[Gn];if(qe(i)){const _=gf(i,u),h=_!==-1;if(d&&!h)g(i.concat(u));else if(!d&&h){const R=[...i];R.splice(_,1),g(R)}}else if(Ei(i)){const _=new Set(i);d?_.add(u):_.delete(u),g(_)}else g(Gg(t,d))})},mounted:wm,beforeUpdate(t,n,o){t[Gn]=sr(o),wm(t,n,o)}};function wm(t,{value:n,oldValue:o},i){t._modelValue=n;let u;if(qe(n))u=gf(n,i.props.value)>-1;else if(Ei(n))u=n.has(i.props.value);else{if(n===o)return;u=rr(n,Gg(t,!0))}t.checked!==u&&(t.checked=u)}const u3={created(t,{value:n},o){t.checked=rr(n,o.props.value),t[Gn]=sr(o),wo(t,"change",()=>{t[Gn](Mi(t))})},beforeUpdate(t,{value:n,oldValue:o},i){t[Gn]=sr(i),n!==o&&(t.checked=rr(n,i.props.value))}},Xa={deep:!0,created(t,{value:n,modifiers:{number:o}},i){const u=Ei(n);wo(t,"change",()=>{const d=Array.prototype.filter.call(t.options,g=>g.selected).map(g=>o?rd(Mi(g)):Mi(g));t[Gn](t.multiple?u?new Set(d):d:d[0]),t._assigning=!0,ya(()=>{t._assigning=!1})}),t[Gn]=sr(i)},mounted(t,{value:n}){hm(t,n)},beforeUpdate(t,n,o){t[Gn]=sr(o)},updated(t,{value:n}){t._assigning||hm(t,n)}};function hm(t,n){const o=t.multiple,i=qe(n);if(!(o&&!i&&!Ei(n))){for(let u=0,d=t.options.length;u<d;u++){const g=t.options[u],_=Mi(g);if(o)if(i){const h=typeof _;h==="string"||h==="number"?g.selected=n.some(R=>String(R)===String(_)):g.selected=gf(n,_)>-1}else g.selected=n.has(_);else if(rr(Mi(g),n)){t.selectedIndex!==u&&(t.selectedIndex=u);return}}!o&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Mi(t){return"_value"in t?t._value:t.value}function Gg(t,n){const o=n?"_trueValue":"_falseValue";return o in t?t[o]:n}const p0=["ctrl","shift","alt","meta"],m0={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,n)=>p0.some(o=>t[`${o}Key`]&&!n.includes(o))},ze=(t,n)=>{if(!t)return t;const o=t._withMods||(t._withMods={}),i=n.join(".");return o[i]||(o[i]=((u,...d)=>{for(let g=0;g<n.length;g++){const _=m0[n[g]];if(_&&_(u,n))return}return t(u,...d)}))},g0={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Qt=(t,n)=>{const o=t._withKeys||(t._withKeys={}),i=n.join(".");return o[i]||(o[i]=(u=>{if(!("key"in u))return;const d=ur(u.key);if(n.some(g=>g===d||g0[g]===d))return t(u)}))},y0=fa({patchProp:l0},W1);let km;function _0(){return km||(km=_1(y0))}const b0=((...t)=>{const n=_0().createApp(...t),{mount:o}=n;return n.mount=i=>{const u=h0(i);if(!u)return;const d=n._component;!Ke(d)&&!d.render&&!d.template&&(d.template=u.innerHTML),u.nodeType===1&&(u.textContent="");const g=o(u,!1,w0(u));return u instanceof Element&&(u.removeAttribute("v-cloak"),u.setAttribute("data-v-app","")),g},n});function w0(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function h0(t){return Yt(t)?document.querySelector(t):t}const k0="modulepreload",$0=function(t){return"/api/v1/plugins/extensions/astrbot_plugin_imagestudio/web/"+t},$m={},Un=function(n,o,i){let u=Promise.resolve();if(o&&o.length>0){let g=function(R){return Promise.all(R.map(S=>Promise.resolve(S).then(B=>({status:"fulfilled",value:B}),B=>({status:"rejected",reason:B}))))};document.getElementsByTagName("link");const _=document.querySelector("meta[property=csp-nonce]"),h=(_==null?void 0:_.nonce)||(_==null?void 0:_.getAttribute("nonce"));u=g(o.map(R=>{if(R=$0(R),R in $m)return;$m[R]=!0;const S=R.endsWith(".css"),B=S?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${R}"]${B}`))return;const T=document.createElement("link");if(T.rel=S?"stylesheet":k0,S||(T.as="script"),T.crossOrigin="",T.href=R,h&&T.setAttribute("nonce",h),document.head.appendChild(T),S)return new Promise((X,G)=>{T.addEventListener("load",X),T.addEventListener("error",()=>G(new Error(`Unable to preload CSS for ${R}`)))})}))}function d(g){const _=new Event("vite:preloadError",{cancelable:!0});if(_.payload=g,window.dispatchEvent(_),!_.defaultPrevented)throw g}return u.then(g=>{for(const _ of g||[])_.status==="rejected"&&d(_.reason);return n().catch(d)})},C0=["data-expanded","data-pinned"],S0={class:"brand"},I0={class:"brand-copy"},P0={class:"icon-nav","aria-label":"工作台页面"},x0={class:"nav-scroll"},A0={class:"nav-group-label"},M0={class:"nav-group-items"},R0=["title","aria-label","aria-current","onClick"],E0={class:"nav-glyph","aria-hidden":"true"},N0={class:"nav-copy"},T0={class:"nav-label"},B0=["aria-pressed","title"],L0={"aria-hidden":"true"},q0={class:"rail-pin-label"},D0=Hn({__name:"AppNavigationRail",props:{items:{},activeKey:{},pluginVersion:{},expanded:{type:Boolean},pinned:{type:Boolean}},emits:["select","reveal","scheduleHide","togglePinned"],setup(t,{emit:n}){const o=t,i=n;function u(){o.pinned||i("scheduleHide")}const d=[{key:"workspace",label:"工作台"},{key:"assets",label:"资产"},{key:"system",label:"系统"}],g=M(()=>d.map(_=>({..._,items:o.items.filter(h=>h.group===_.key)})).filter(_=>_.items.length));return(_,h)=>(m(),y("aside",{class:"rail","aria-label":"ImageStudio navigation","data-expanded":o.expanded,"data-pinned":o.pinned,onMouseenter:h[1]||(h[1]=R=>i("reveal")),onMouseleave:u,onFocusin:h[2]||(h[2]=R=>i("reveal")),onFocusout:u},[l("div",S0,[h[4]||(h[4]=l("span",{class:"brand-mark"},"IS",-1)),l("div",I0,[h[3]||(h[3]=l("strong",null,"ImageStudio",-1)),l("small",null,"角色与生成工作台 · "+p(o.pluginVersion||"v3"),1)])]),l("nav",P0,[l("div",x0,[(m(!0),y(Q,null,re(g.value,R=>(m(),y("section",{key:R.key,class:"nav-group"},[l("span",A0,p(R.label),1),l("div",M0,[(m(!0),y(Q,null,re(R.items,S=>(m(),y("button",{key:S.key,type:"button",class:fe({active:o.activeKey===S.key}),title:`${S.label}:${S.description}`,"aria-label":S.label,"aria-current":o.activeKey===S.key?"page":void 0,onClick:B=>i("select",S)},[l("span",E0,p(S.icon),1),l("span",N0,[l("strong",T0,p(S.label),1),l("small",null,p(S.description),1)])],10,R0))),128))])]))),128))])]),l("button",{type:"button",class:fe(["rail-pin",{active:o.pinned}]),"aria-pressed":o.pinned,title:o.pinned?"切换为自动收起导航":"固定展开导航",onClick:h[0]||(h[0]=R=>i("togglePinned"))},[l("span",L0,p(o.pinned?"●":"○"),1),l("span",q0,p(o.pinned?"取消固定":"固定导航"),1)],10,B0)],40,C0))}});function Ns(t,n=()=>!0){let o;function i(_){o=void 0,!(_.button!==0||_.target!==_.currentTarget)&&(o={pointerId:_.pointerId,x:_.clientX,y:_.clientY,moved:!1})}function u(_){!o||o.pointerId!==_.pointerId||o.moved||Math.hypot(_.clientX-o.x,_.clientY-o.y)>6&&(o.moved=!0)}function d(_){const h=o;if(o=void 0,!h||h.pointerId!==_.pointerId||h.moved||_.target!==_.currentTarget||!n())return;const R=window.getSelection();R&&!R.isCollapsed||t()}function g(){o=void 0}return{pointerDown:i,pointerMove:u,pointerUp:d,pointerCancel:g}}const O0=["onKeydown"],W0=["aria-busy"],U0={class:"confirm-dialog-eyebrow"},F0=["disabled"],j0=["disabled"],K0=Hn({__name:"ConfirmDialog",props:{open:{type:Boolean},title:{},detail:{},confirmLabel:{},cancelLabel:{default:"取消"},busy:{type:Boolean},danger:{type:Boolean}},emits:["confirm","cancel"],setup(t,{emit:n}){const o=t,i=n,u=Ok(),d=`${u}-title`,g=`${u}-detail`,_=$(null),h=$(null);let R=null;function S(){o.busy||i("cancel")}function B(){o.busy||i("confirm")}const T=Ns(S,()=>!o.busy);function X(){var ye;return Array.from(((ye=_.value)==null?void 0:ye.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(me=>!me.hasAttribute("hidden"))}function G(ye){var de,De,ne;if(ye.key!=="Tab")return;const me=X();if(!me.length){ye.preventDefault(),(de=_.value)==null||de.focus();return}const te=me[0],Ae=me[me.length-1],ue=document.activeElement;ye.shiftKey&&(ue===te||!((De=_.value)!=null&&De.contains(ue)))?(ye.preventDefault(),Ae.focus()):!ye.shiftKey&&(ue===Ae||!((ne=_.value)!=null&&ne.contains(ue)))&&(ye.preventDefault(),te.focus())}function K(){const ye=R;R=null,ye!=null&&ye.isConnected&&ye.focus()}return ct(()=>o.open,(ye,me)=>{ye?(R=document.activeElement instanceof HTMLElement?document.activeElement:null,ya(()=>{var te;return(te=h.value)==null?void 0:te.focus()})):me&&ya(K)},{immediate:!0}),jr(K),(ye,me)=>(m(),Ct(Ya,{name:"confirm-dialog-fade"},{default:ra(()=>[o.open?(m(),y("div",{key:0,class:"confirm-dialog-backdrop",role:"presentation",onPointerdown:me[0]||(me[0]=(...te)=>se(T).pointerDown&&se(T).pointerDown(...te)),onPointermove:me[1]||(me[1]=(...te)=>se(T).pointerMove&&se(T).pointerMove(...te)),onPointerup:me[2]||(me[2]=(...te)=>se(T).pointerUp&&se(T).pointerUp(...te)),onPointercancel:me[3]||(me[3]=(...te)=>se(T).pointerCancel&&se(T).pointerCancel(...te)),onKeydown:Qt(ze(S,["stop","prevent"]),["esc"])},[l("section",{ref_key:"dialogRef",ref:_,class:fe(["confirm-dialog-card",{danger:o.danger}]),role:"dialog","aria-modal":"true","aria-labelledby":d,"aria-describedby":g,"aria-busy":o.busy,tabindex:"-1",onKeydown:G},[l("span",U0,p(o.danger?"危险操作":"确认操作"),1),l("h2",{id:d},p(o.title),1),l("p",{id:g},p(o.detail),1),l("footer",null,[l("button",{ref_key:"cancelButton",ref:h,type:"button",disabled:o.busy,onClick:S},p(o.cancelLabel),9,F0),l("button",{type:"button",class:"confirm-dialog-submit",disabled:o.busy,onClick:B},p(o.busy?"处理中…":o.confirmLabel),9,j0)])],42,W0)],40,O0)):H("",!0)]),_:1}))}}),Kr=(t,n)=>{const o=t.__vccOpts||t;for(const[i,u]of n)o[i]=u;return o},V0=Kr(K0,[["__scopeId","data-v-66c20184"]]),G0={class:"empty-state",role:"status","aria-live":"polite"},z0={key:0,class:"empty-state-actions"},H0=Hn({__name:"EmptyState",props:{title:{},detail:{}},setup(t){return(n,o)=>(m(),y("section",G0,[l("strong",null,p(t.title),1),l("span",null,p(t.detail),1),n.$slots.actions||n.$slots.default?(m(),y("div",z0,[Vp(n.$slots,"actions",{},()=>[Vp(n.$slots,"default",{},void 0,!0)])])):H("",!0)]))}}),Uc=Kr(H0,[["__scopeId","data-v-6a09d442"]]),Q0=["aria-label"],Y0={class:"image-viewer-actions"},J0={"aria-live":"polite"},X0=["src","alt"],Z0=.5,e$=4,Cm=.12,Sm=.15,t$=2.2,a$=Hn({__name:"ImagePreviewDialog",props:{open:{type:Boolean},title:{},src:{}},emits:["close"],setup(t,{emit:n}){const o=t,i=n,u=$(1),d=$({x:0,y:0}),g=$(!1),_=$({pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}),h=$(null);let R=null;const S=M(()=>`${Math.round(u.value*100)}%`),B=M(()=>`translate3d(${d.value.x}px, ${d.value.y}px, 0) scale(${u.value})`);ct(()=>[o.open,o.src],([W])=>{G(),W?(R=document.activeElement instanceof HTMLElement?document.activeElement:null,ya(()=>{var D;return(D=de()[0])==null?void 0:D.focus()})):ya(ne)},{immediate:!0}),Ni(()=>window.addEventListener("keydown",oe)),jr(()=>window.removeEventListener("keydown",oe));function T(){g.value=!1,i("close")}const X=Ns(T);function G(){u.value=1,d.value={x:0,y:0},g.value=!1,_.value={pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}}function K(W){u.value=J(Number((u.value+W).toFixed(2)),Z0,e$),u.value<=1&&(d.value={x:0,y:0})}function ye(W){K(W.deltaY<0?Cm:-Cm)}function me(){if(u.value>1){G();return}u.value=t$,d.value={x:0,y:0}}function te(W){u.value<=1||(g.value=!0,_.value={pointerId:W.pointerId,x:W.clientX,y:W.clientY,offsetX:d.value.x,offsetY:d.value.y},W.currentTarget instanceof HTMLElement&&W.currentTarget.setPointerCapture(W.pointerId))}function Ae(W){!g.value||W.pointerId!==_.value.pointerId||(d.value={x:_.value.offsetX+W.clientX-_.value.x,y:_.value.offsetY+W.clientY-_.value.y})}function ue(W){!g.value||W.pointerId!==_.value.pointerId||(g.value=!1,W.currentTarget instanceof HTMLElement&&W.currentTarget.hasPointerCapture(W.pointerId)&&W.currentTarget.releasePointerCapture(W.pointerId))}function de(){var W;return Array.from(((W=h.value)==null?void 0:W.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])'))??[]).filter(D=>!D.hasAttribute("hidden"))}function De(W){var Ye;if(W.key!=="Tab")return;const D=de();if(!D.length){W.preventDefault(),(Ye=h.value)==null||Ye.focus();return}const q=D[0],Ne=D[D.length-1];W.shiftKey&&document.activeElement===q?(W.preventDefault(),Ne.focus()):!W.shiftKey&&document.activeElement===Ne&&(W.preventDefault(),q.focus())}function ne(){const W=R;R=null,W!=null&&W.isConnected&&W.focus()}function oe(W){o.open&&W.key==="Escape"&&T()}function J(W,D,q){return Math.max(D,Math.min(q,W))}return(W,D)=>(m(),Ct(Ya,{name:"viewer-fade"},{default:ra(()=>[t.open?(m(),y("div",{key:0,class:"image-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":`${t.title||"图片"}预览`,onPointerdown:D[2]||(D[2]=(...q)=>se(X).pointerDown&&se(X).pointerDown(...q)),onPointermove:D[3]||(D[3]=(...q)=>se(X).pointerMove&&se(X).pointerMove(...q)),onPointerup:D[4]||(D[4]=(...q)=>se(X).pointerUp&&se(X).pointerUp(...q)),onPointercancel:D[5]||(D[5]=(...q)=>se(X).pointerCancel&&se(X).pointerCancel(...q)),onWheel:ze(ye,["prevent"])},[l("section",{ref_key:"dialogRef",ref:h,class:"image-viewer-card","data-overlay-root":"imageViewer",tabindex:"-1",onKeydown:De},[l("header",null,[l("div",null,[D[6]||(D[6]=l("span",null,"图片预览",-1)),l("strong",null,p(t.title||"未命名图片"),1)]),l("div",Y0,[l("button",{type:"button",title:"缩小","aria-label":"缩小",onClick:D[0]||(D[0]=q=>K(-Sm))},"-"),l("span",J0,p(S.value),1),l("button",{type:"button",title:"放大","aria-label":"放大",onClick:D[1]||(D[1]=q=>K(Sm))},"+"),l("button",{type:"button",title:"重置",onClick:G},"重置"),l("button",{type:"button",title:"关闭",onClick:T},"关闭")])]),l("div",{class:fe(["image-viewer-stage",{dragging:g.value}]),onDblclick:me,onPointerdown:te,onPointermove:Ae,onPointerup:ue,onPointercancel:ue,onPointerleave:ue},[t.src?(m(),y("img",{key:0,src:t.src,alt:t.title||"图片预览",style:ca({transform:B.value}),draggable:"false"},null,12,X0)):H("",!0)],34)],544)],40,Q0)):H("",!0)]),_:1}))}}),zg=Kr(a$,[["__scopeId","data-v-62786811"]]),n$=["onKeydown"],l$={id:"material-category-create-title"},o$=["disabled"],r$={class:"materials-category-create-body"},i$=["value","placeholder"],s$=["value"],u$={key:0,class:"materials-category-create-error",role:"alert"},d$=["disabled"],c$=["disabled"],f$=Hn({__name:"MaterialCategoryCreateDialog",props:{open:{type:Boolean},title:{},isAccessoryGroup:{type:Boolean},parentLabel:{},endpointLabel:{},busy:{type:Boolean},error:{},draftName:{},draftNote:{}},emits:["update:draftName","update:draftNote","submit","close"],setup(t,{emit:n}){const o=t,i=n,u=$(null);ct(()=>o.open,S=>{S&&ya(()=>{var B,T;(B=u.value)==null||B.focus(),(T=u.value)==null||T.select()})},{immediate:!0});function d(){o.busy||i("close")}const g=Ns(d,()=>!o.busy);function _(S){i("update:draftName",S.target.value)}function h(S){i("update:draftNote",S.target.value)}function R(){!o.busy&&o.draftName.trim()&&i("submit")}return(S,B)=>(m(),Ct(Ya,{name:"viewer-fade"},{default:ra(()=>[o.open?(m(),y("div",{key:0,class:"image-viewer-backdrop materials-category-create-backdrop","data-overlay-root":"materialCategoryCreate",role:"presentation",onPointerdown:B[0]||(B[0]=(...T)=>se(g).pointerDown&&se(g).pointerDown(...T)),onPointermove:B[1]||(B[1]=(...T)=>se(g).pointerMove&&se(g).pointerMove(...T)),onPointerup:B[2]||(B[2]=(...T)=>se(g).pointerUp&&se(g).pointerUp(...T)),onPointercancel:B[3]||(B[3]=(...T)=>se(g).pointerCancel&&se(g).pointerCancel(...T)),onKeydown:Qt(ze(d,["stop","prevent"]),["esc"])},[l("form",{class:"materials-category-create-card","data-overlay-root":"materialCategoryCreate",role:"dialog","aria-modal":"true","aria-labelledby":"material-category-create-title",onSubmit:ze(R,["prevent"])},[l("header",null,[l("div",null,[B[4]||(B[4]=l("span",null,"素材分类",-1)),l("strong",l$,p(o.title),1)]),l("button",{type:"button",title:"关闭",disabled:o.busy,onClick:d},"×",8,o$)]),l("section",r$,[l("label",null,[B[5]||(B[5]=l("span",null,"分类名称",-1)),l("input",{ref_key:"nameInput",ref:u,"data-material-category-name":"",type:"text",maxlength:"24",value:o.draftName,placeholder:o.isAccessoryGroup?"例如:头饰、眼镜、武器":"例如:场景、动作、道具",onInput:_},null,40,i$)]),l("label",null,[B[6]||(B[6]=l("span",null,"备注",-1)),l("textarea",{rows:"4",maxlength:"120",value:o.draftNote,placeholder:"可选,写给后端或团队看的分类说明。",onInput:h},null,40,s$)]),l("dl",null,[l("div",null,[B[7]||(B[7]=l("dt",null,"创建类型",-1)),l("dd",null,p(o.isAccessoryGroup?"配饰子类":"素材主分类"),1)]),l("div",null,[B[8]||(B[8]=l("dt",null,"父级分类",-1)),l("dd",null,p(o.parentLabel),1)]),l("div",null,[B[9]||(B[9]=l("dt",null,"后端接口",-1)),l("dd",null,p(o.endpointLabel),1)])])]),o.error?(m(),y("p",u$,p(o.error),1)):H("",!0),l("footer",null,[l("button",{type:"button",disabled:o.busy,onClick:d},"取消",8,d$),l("button",{type:"submit",disabled:!o.draftName.trim()||o.busy},p(o.busy?"创建中":"确认添加"),9,c$)])],32)],40,n$)):H("",!0)]),_:1}))}}),Rf=[{value:"global_style",label:"全局风格"},{value:"background",label:"背景场景"},{value:"pose",label:"姿势动作"},{value:"identity",label:"角色身份"},{value:"head",label:"头部"},{value:"hair",label:"头发"},{value:"face",label:"面部"},{value:"ears",label:"耳部"},{value:"neck",label:"颈部"},{value:"upper_body",label:"上半身"},{value:"arms",label:"手臂"},{value:"hands",label:"手部"},{value:"waist",label:"腰部"},{value:"hips",label:"胯部"},{value:"upper_legs",label:"大腿"},{value:"lower_legs",label:"小腿"},{value:"feet",label:"脚部"}],v$=new Map(Rf.map(t=>[t.value,t.label]));function p$(t){const n=String(t??"").trim();return v$.get(n)??n}const m$=new Map([["top","上装"],["bottom","下装"],["dress","连衣裙"],["shoes","鞋履"],["accessory","配饰"],["style","风格"],["composition","构图"],["outfit","服装"]]);function Ii(t){const n=String(t??"").trim();return m$.get(n.toLowerCase())??n}const g$=["onKeydown"],y$=["aria-label"],_$={class:"materials-detail-card-preview"},b$=["src","alt"],w$={key:1,class:"material-preview-empty"},h$={key:0,class:"detail-tabs","aria-label":"素材结构详情"},k$={key:1},$$={key:2,class:"structured-panel"},C$={key:3,class:"structured-panel"},S$={class:"profile-editor"},I$={class:"wide"},P$={class:"check"},x$={class:"check"},A$={class:"advanced-editor"},M$={key:0},R$={class:"profile-badges"},E$={key:4,class:"structured-panel"},N$={key:5,class:"structured-panel"},T$={key:0},B$=Hn({__name:"MaterialDetailDialog",props:{open:{type:Boolean},item:{},rows:{},material:{}},emits:["close","saveProfile"],setup(t,{emit:n}){const o=t,i=n,u=$(null),d=$("summary"),g=M(()=>{var W,D;return de((D=(W=o.material)==null?void 0:W.metadata)==null?void 0:D.raw_analysis)}),_=M(()=>{var W,D;return de((D=(W=o.material)==null?void 0:W.metadata)==null?void 0:D.normalized_asset_profile)}),h=M(()=>{var W,D;return de((D=(W=o.material)==null?void 0:W.metadata)==null?void 0:D.generation_capsules)}),R=M(()=>{var W,D,q,Ne;return Array.isArray((D=(W=o.material)==null?void 0:W.metadata)==null?void 0:D.material_schema_history)?(Ne=(q=o.material)==null?void 0:q.metadata)==null?void 0:Ne.material_schema_history:[]}),S=$("other"),B=$("other"),T=$(""),X=$(""),G=$(0),K=$(!1),ye=$(!1),me=$(""),te=$("");ct(()=>o.open,W=>{W&&(d.value="summary",ya(()=>{var D;return(D=u.value)==null?void 0:D.focus()}))},{immediate:!0}),ct(_,W=>{S.value=String(W.category||"other"),B.value=String(W.role||"other"),T.value=Array.isArray(W.body_slots)?W.body_slots.map(String).join(", "):"",X.value=String(W.wear_layer||""),G.value=Number(W.confidence||0),K.value=W.user_locked===!0,ye.value=W.stackable===!0,me.value=ne(W),te.value=""},{immediate:!0});function Ae(){i("close")}const ue=Ns(Ae);function de(W){return W&&typeof W=="object"&&!Array.isArray(W)?W:{}}function De(W){return Array.isArray(W)?W.map(String):[]}function ne(W){return JSON.stringify(W??{},null,2)}function oe(){i("saveProfile",{..._.value,category:S.value,role:B.value,body_slots:T.value.split(/[,,]/).map(W=>W.trim()).filter(Boolean),wear_layer:X.value||null,confidence:Math.min(Math.max(G.value,0),1),user_locked:K.value,stackable:ye.value,confirmed:!0})}function J(){try{const W=JSON.parse(me.value);if(!W||typeof W!="object"||Array.isArray(W))throw new Error("必须是 JSON 对象");te.value="",i("saveProfile",W)}catch(W){te.value=W instanceof Error?W.message:String(W)}}return(W,D)=>(m(),Ct(Ya,{name:"viewer-fade"},{default:ra(()=>[o.open&&o.item?(m(),y("div",{key:0,class:"image-viewer-backdrop materials-detail-backdrop","data-overlay-root":"materialDetail",role:"presentation",onPointerdown:D[13]||(D[13]=(...q)=>se(ue).pointerDown&&se(ue).pointerDown(...q)),onPointermove:D[14]||(D[14]=(...q)=>se(ue).pointerMove&&se(ue).pointerMove(...q)),onPointerup:D[15]||(D[15]=(...q)=>se(ue).pointerUp&&se(ue).pointerUp(...q)),onPointercancel:D[16]||(D[16]=(...q)=>se(ue).pointerCancel&&se(ue).pointerCancel(...q)),onKeydown:Qt(ze(Ae,["stop","prevent"]),["esc"])},[l("section",{class:"materials-detail-card","data-overlay-root":"materialDetail",role:"dialog","aria-modal":"true","aria-label":`${o.item.label} 素材详情`},[l("figure",_$,[o.item.imageUrl?(m(),y("img",{key:0,src:o.item.imageUrl,alt:o.item.label},null,8,b$)):(m(),y("span",w$,"无缩略图")),l("figcaption",null,[l("span",null,p([o.item.category,o.item.subcategory].filter(Boolean).join(" / ")),1),l("strong",null,p(o.item.label),1)])]),l("aside",{class:fe(["materials-detail-card-info",{"has-tabs":o.material}])},[l("header",null,[l("div",null,[D[17]||(D[17]=l("span",null,"后端素材库",-1)),l("strong",null,p(o.item.label)+" / 素材详情",1)]),l("button",{ref_key:"closeButton",ref:u,type:"button",title:"关闭",onClick:Ae},"×",512)]),o.material?(m(),y("nav",h$,[l("button",{class:fe({active:d.value==="summary"}),onClick:D[0]||(D[0]=q=>d.value="summary")},"基础信息",2),l("button",{class:fe({active:d.value==="raw"}),onClick:D[1]||(D[1]=q=>d.value="raw")},"原始识别",2),l("button",{class:fe({active:d.value==="profile"}),onClick:D[2]||(D[2]=q=>d.value="profile")},"标准属性",2),l("button",{class:fe({active:d.value==="capsules"}),onClick:D[3]||(D[3]=q=>d.value="capsules")},"生图胶囊",2),l("button",{class:fe({active:d.value==="history"}),onClick:D[4]||(D[4]=q=>d.value="history")},"版本历史",2)])):H("",!0),d.value==="summary"?(m(),y("dl",k$,[(m(!0),y(Q,null,re(o.rows,q=>(m(),y("div",{key:q.label},[l("dt",null,p(q.label),1),l("dd",null,p(q.value),1)]))),128))])):d.value==="raw"?(m(),y("section",$$,[l("header",null,[D[18]||(D[18]=l("strong",null,"RawAnalysis",-1)),l("span",null,p(String(g.value.schema_version||"Legacy")),1)]),D[19]||(D[19]=l("p",null,"保留视觉模型完整结构化返回、属性来源和置信度,便于重新标准化。",-1)),l("pre",null,p(ne(g.value)),1)])):d.value==="profile"?(m(),y("section",C$,[l("header",null,[D[20]||(D[20]=l("strong",null,"NormalizedAssetProfile",-1)),l("span",null,p(String(_.value.category||"other")),1)]),l("div",S$,[l("label",null,[D[21]||(D[21]=l("span",null,"标准分类",-1)),xe(l("select",{"onUpdate:modelValue":D[5]||(D[5]=q=>S.value=q)},[(m(),y(Q,null,re(["identity","hair","headwear","face_accessory","jewelry","top","bottom","dress","suit","outerwear","underwear","hosiery","footwear","prop","pose","background","style","other"],q=>l("option",{key:q},p(q),1)),64))],512),[[Xa,S.value]])]),l("label",null,[D[22]||(D[22]=l("span",null,"角色",-1)),xe(l("select",{"onUpdate:modelValue":D[6]||(D[6]=q=>B.value=q)},[(m(),y(Q,null,re(["identity","garment","accessory","prop","pose","background","style","other"],q=>l("option",{key:q},p(q),1)),64))],512),[[Xa,B.value]])]),l("label",I$,[D[23]||(D[23]=l("span",null,"身体槽位(逗号分隔)",-1)),xe(l("input",{"onUpdate:modelValue":D[7]||(D[7]=q=>T.value=q)},null,512),[[je,T.value]])]),l("label",null,[D[25]||(D[25]=l("span",null,"穿着层级",-1)),xe(l("select",{"onUpdate:modelValue":D[8]||(D[8]=q=>X.value=q)},[D[24]||(D[24]=l("option",{value:""},"无",-1)),(m(),y(Q,null,re(["skin","inner","base","middle","outer","overlay","accessory","prop"],q=>l("option",{key:q},p(q),1)),64))],512),[[Xa,X.value]])]),l("label",null,[D[26]||(D[26]=l("span",null,"总体置信度",-1)),xe(l("input",{"onUpdate:modelValue":D[9]||(D[9]=q=>G.value=q),type:"number",min:"0",max:"1",step:"0.01"},null,512),[[je,G.value,void 0,{number:!0}]])]),l("label",P$,[xe(l("input",{"onUpdate:modelValue":D[10]||(D[10]=q=>K.value=q),type:"checkbox"},null,512),[[ed,K.value]]),D[27]||(D[27]=Kn(" 锁定人工修正",-1))]),l("label",x$,[xe(l("input",{"onUpdate:modelValue":D[11]||(D[11]=q=>ye.value=q),type:"checkbox"},null,512),[[ed,ye.value]]),D[28]||(D[28]=Kn(" 允许叠加",-1))]),l("button",{type:"button",onClick:oe},"保存标准属性")]),l("details",A$,[D[29]||(D[29]=l("summary",null,"高级 JSON 编辑(属性值、置信度、来源状态、锁定项)",-1)),xe(l("textarea",{"onUpdate:modelValue":D[12]||(D[12]=q=>me.value=q),rows:"14"},null,512),[[je,me.value]]),te.value?(m(),y("p",M$,p(te.value),1)):H("",!0),l("button",{type:"button",onClick:J},"校验并保存完整档案")]),l("div",R$,[l("b",null,p(String(_.value.role||"other")),1),l("b",null,p(String(_.value.wear_layer||"无层级")),1),(m(!0),y(Q,null,re(Array.isArray(_.value.body_slots)?_.value.body_slots:[],q=>(m(),y("b",{key:String(q)},p(se(p$)(q)),1))),128))]),l("pre",null,p(ne(_.value)),1)])):d.value==="capsules"?(m(),y("section",E$,[D[30]||(D[30]=l("header",null,[l("strong",null,"Generation Capsule"),l("span",null,"Compact / Standard / Detailed")],-1)),(m(),y(Q,null,re(["compact","standard","detailed"],q=>l("article",{key:q},[l("b",null,p(q),1),l("p",null,p(De(de(h.value[q]).prompt_parts).join(",")||"暂无提示词"),1)])),64))])):(m(),y("section",N$,[l("header",null,[D[31]||(D[31]=l("strong",null,"识别与标准化版本",-1)),l("span",null,p(R.value.length)+" 个历史版本",1)]),D[32]||(D[32]=l("p",null,"重新识别与批量重新标准化不会覆盖已确认结构;历史版本可用于人工对比。",-1)),(m(!0),y(Q,null,re(R.value,(q,Ne)=>(m(),y("article",{key:Ne},[l("b",null,p(String(de(q).archived_at||`版本 ${Ne+1}`)),1),l("p",null,p(String(de(de(q).normalized_asset_profile).category||"other"))+" · "+p(String(de(de(q).normalized_asset_profile).role||"other")),1),l("pre",null,p(ne(q)),1)]))),128)),R.value.length?H("",!0):(m(),y("p",T$,"暂无历史版本。"))]))],2)],8,y$)],40,g$)):H("",!0)]),_:1}))}}),L$=Kr(B$,[["__scopeId","data-v-a76a2721"]]),q$=/^\d{4}-\d{2}-\d{2}[ T]\d{2}:\d{2}:\d{2}(?:\.\d+)?$/,D$=new Set(["completed","succeeded","failed","cancelled","dead_letter","superseded"]);function Ge(t){return String(t||"").trim().toLowerCase()}function Dl(t){return{running:"运行中",degraded:"降级",stopped:"已停止",loading:"加载中",created:"已创建",pending:"等待中",queued:"排队中",completed:"已完成",succeeded:"已成功",failed:"失败",cancelled:"已取消",dead_letter:"死信",retrying:"重试执行中",superseded:"已被重试替代"}[Ge(t)]??t}function Fc(t){const n=Ge(t);return["failed","dead_letter","cancelled"].includes(n)?"is-bad":["running","queued","created","pending","retrying"].includes(n)?"is-warn":["completed","succeeded"].includes(n)?"is-good":"is-idle"}function go(t){const n=Number.isFinite(t)&&t>0?t:0;return n<1024?`${n} B`:n<1024*1024?`${(n/1024).toFixed(1)} KB`:n<1024*1024*1024?`${(n/1024/1024).toFixed(1)} MB`:`${(n/1024/1024/1024).toFixed(1)} GB`}function O$(t){const n=Number(t.totals.estimated_cost),o=t.currency||"USD";try{return`${new Intl.NumberFormat("zh-CN",{style:"currency",currency:o,minimumFractionDigits:n<1?4:2,maximumFractionDigits:n<1?6:2}).format(n)} 估算`}catch{return`${o} ${n.toFixed(n<1?6:2)} 估算`}}function po(t){if(!t)return"-";const n=ml(t);if(!n)return t;const o=new Date(n);return Number.isNaN(o.getTime())?t:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(o)}function ml(t){const n=String(t||"").trim(),o=q$.test(n)?`${n.replace(" ","T")}Z`:n,i=Date.parse(o);return Number.isFinite(i)?i:0}function jc(t){const n=ml(t.created_at);if(!n)return"-";const o=Ge(t.status),u=D$.has(o)?ml(t.updated_at):0,d=Math.max(0,Math.round(((u||Date.now())-n)/1e3)),g=Im(d),_=W$(t);return _?`${g} / 上限 ${Im(_)}`:g}function W$(t){var d,g;const n=(d=t.request)==null?void 0:d.timeout_seconds,o=(g=t.metadata)==null?void 0:g.timeout_seconds,u=Number(n??o);if(!(!Number.isFinite(u)||u<=0))return Math.round(u)}function Im(t){const n=Math.max(0,Math.round(t));if(n<60)return n<1?"刚刚":`${n} 秒`;const o=Math.round(n/60);if(o<60)return`${o} 分钟`;const i=Math.floor(o/60),u=o%60;return u?`${i} 小时 ${u} 分钟`:`${i} 小时`}function rn(t){return t.length>10?`${t.slice(0,6)}...${t.slice(-4)}`:t}function Lu(t){const n=Number(t.progress);return Number.isFinite(n)?Math.max(0,Math.min(100,n)):0}function cf(t){return/^storage:\/\/[a-z0-9_-]+(?:\/[^?#]*)?$/i.test(t.trim())}function Hg(t){return t.trim().split(/[?#]/,1)[0].replace(/\/+$/,"").split("/").pop()??""}function U$(t){return cf(t)&&/\.(png|jpe?g|gif|webp)$/i.test(Hg(t))}const F$=["aria-label","aria-describedby","aria-busy"],j$=["aria-label","disabled"],K$=["id"],V$=["src"],G$={key:1,class:"material-upload-placeholder"},z$={key:2},H$={class:"material-upload-fields"},Q$=["value"],Y$=["value"],J$={class:"material-upload-note"},X$={key:0,class:"operation-warning"},Z$={key:1,class:"operation-error",role:"alert"},eC=["disabled"],tC=["disabled"],aC=["disabled"],nC=["id"],lC=["value"],oC={key:0,class:"operation-warning"},rC={key:1,class:"operation-error",role:"alert"},iC=["disabled"],sC=["disabled"],uC=["id"],dC={key:0,class:"asset-pack-summary","aria-live":"polite"},cC={key:0},fC={key:1},vC={key:2,class:"operation-warning"},pC={key:1,class:"operation-error",role:"alert"},mC=["disabled"],gC=["disabled"],yC=["disabled"],_C=["id"],bC={class:"wardrobe-target"},wC={key:0,class:"operation-error",role:"alert"},hC=["disabled"],kC=["disabled"],$C=Hn({__name:"MaterialOperationDialog",props:{mode:{},categories:{},material:{},profileId:{},profileName:{},defaultCategoryId:{},busy:{type:Boolean},error:{},assetPackPlan:{}},emits:["close","upload","register","planAssetPack","executeAssetPack","importWardrobe"],setup(t,{emit:n}){const o=t,i=n,u=$("storage://materials/"),d=$(""),g=$(""),_=$(""),h=$(""),R=$(""),S=$(0),B=$("file"),T=$(""),X=$(""),G=$(!1),K=$(null),ye=$("storage://materials/"),me=$("top"),te=$(""),Ae=$(null),ue=$(null),de=M(()=>{const ae=new Map(o.categories.map(F=>[F.category_id,F]));return[...o.categories].sort((F,He)=>ot(F.name)-ot(He.name)||F.sort_order-He.sort_order||F.name.localeCompare(He.name,"zh-CN")).map(F=>{var He;return{value:F.category_id,label:F.parent_id?`${Ii(((He=ae.get(F.parent_id))==null?void 0:He.name)??"未分类")} / ${Ii(F.name)}`:Ii(F.name)}})}),De=M(()=>o.mode==="upload-image"?"添加并识别素材":o.mode==="register-uri"?"登记素材 URI":o.mode==="asset-pack"?"导入素材包":"导入角色衣橱"),ne=M(()=>{var F;const ae=ye.value.trim();return((F=o.assetPackPlan)==null?void 0:F.package_uri)===ae?o.assetPackPlan:null}),oe=M(()=>{var ae;return!!((ae=ne.value)!=null&&ae.manifest.valid&&ne.value.execution_enabled)}),J=M(()=>te.value||o.error),W=M(()=>`material-operation-${o.mode}-description`);ct(()=>o.mode,()=>{te.value="",o.mode==="upload-image"?(ft(),g.value=it()):o.mode==="register-uri"?(u.value="storage://materials/",d.value="",g.value=it()):o.mode==="asset-pack"?ye.value="storage://materials/":me.value="top",D()},{immediate:!0}),ct(()=>o.categories,()=>{o.categories.some(ae=>ae.category_id===g.value)||(g.value=it())},{deep:!0}),Ni(()=>{document.addEventListener("keydown",Ye),D()}),jr(()=>{document.removeEventListener("keydown",Ye)});async function D(){var ae;await ya(),(ae=Ae.value)==null||ae.focus()}function q(){o.busy||i("close")}const Ne=Ns(q,()=>!o.busy);function Ye(ae){var E;if(ae.key==="Escape"){if(o.busy)return;ae.preventDefault(),q();return}if(ae.key!=="Tab")return;const F=(E=ue.value)==null?void 0:E.querySelectorAll('button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])');if(!(F!=null&&F.length))return;const He=F[0],I=F[F.length-1];ae.shiftKey&&document.activeElement===He?(ae.preventDefault(),I.focus()):!ae.shiftKey&&document.activeElement===I&&(ae.preventDefault(),He.focus())}function it(){var ae;return o.defaultCategoryId&&o.categories.some(F=>F.category_id===o.defaultCategoryId)?o.defaultCategoryId:((ae=o.categories[0])==null?void 0:ae.category_id)??""}function ot(ae){const F=["风格","构图","服装","鞋袜","配饰"],He=F.indexOf(ae.trim());return He<0?F.length:He}function ft(){_.value="",h.value="",R.value="",S.value=0,d.value="",T.value="",X.value="",B.value="file",G.value=!1,K.value&&(K.value.value="")}function tt(){var ae;(ae=K.value)==null||ae.click()}function va(ae){var I;const He=(I=ae.currentTarget.files)==null?void 0:I[0];He&&Et(He,"file")}function at(ae){var He,I;if(o.mode!=="upload-image")return;const F=(I=Array.from(((He=ae.clipboardData)==null?void 0:He.items)??[]).find(E=>E.kind==="file"&&E.type.startsWith("image/")))==null?void 0:I.getAsFile();F&&(ae.preventDefault(),Et(F,"paste"))}function pa(ae){var He;G.value=!1;const F=Array.from(((He=ae.dataTransfer)==null?void 0:He.files)??[]).find(I=>I.type.startsWith("image/"));F&&Et(F,"drop")}async function Et(ae,F){if(te.value="",!ae.type.startsWith("image/")){te.value="请选择 PNG、JPG、GIF 或 WEBP 图片。";return}if(ae.size>20*1024*1024){te.value="图片不能超过 20 MB。";return}try{_.value=await dn(ae),h.value=ae.name||`clipboard-${Date.now()}.${ae.type.split("/")[1]||"png"}`,R.value=ae.type,S.value=ae.size,B.value=F,d.value.trim()||(d.value=h.value.replace(/\.[^.]+$/,""))}catch{te.value="读取图片失败,请重新选择。"}}function dn(ae){return new Promise((F,He)=>{const I=new FileReader;I.onload=()=>typeof I.result=="string"?F(I.result):He(new Error("invalid result")),I.onerror=()=>He(I.error),I.readAsDataURL(ae)})}function Qn(){const ae=d.value.trim();if(!_.value){te.value="请粘贴图片或选择本地图片。";return}if(!ae){te.value="请填写素材名称。";return}if(!g.value){te.value="请选择素材部件或分类。";return}te.value="",i("upload",{image_data_url:_.value,display_name:ae,category_id:g.value,filename:h.value,content_type:R.value,size_bytes:S.value,upload_source:B.value,metadata:{body_slot:T.value||void 0,note:X.value.trim()||void 0}})}function Lt(){const ae=u.value.trim(),F=d.value.trim();if(!cf(ae)){te.value="素材 URI 必须以 storage:// 开头。";return}const He=Hg(ae);if(!U$(ae)){te.value="素材 URI 必须指向 PNG、JPG、JPEG、GIF 或 WEBP 文件。";return}if(!F){te.value="请填写素材名称。";return}if(!g.value){te.value="请选择素材分类。";return}te.value="",i("register",{image_uri:ae,display_name:F,category_id:g.value,filename:He})}function _a(){const ae=ye.value.trim();if(!cf(ae)){te.value="素材包 URI 必须以 storage:// 开头。";return}te.value="",i("planAssetPack",{package_uri:ae})}function kt(){const ae=ne.value;if(!ae||!oe.value){te.value="请先完成有效的 dry-run 预检查。";return}te.value="",i("executeAssetPack",{package_uri:ae.package_uri})}function qt(){const ae=me.value.trim();if(!o.profileId||!o.material){te.value="需要选中已落库角色和已确认素材。";return}if(o.material.recognition_status!=="confirmed"){te.value="只有已确认素材可以导入衣橱。";return}if(!ae){te.value="请选择或填写衣橱分类。";return}te.value="",i("importWardrobe",{wardrobe_category:ae})}return(ae,F)=>{var He,I,E;return m(),y("div",{class:"material-operation-backdrop","data-overlay-root":"materialOperation",role:"presentation",onPointerdown:F[12]||(F[12]=(...P)=>se(Ne).pointerDown&&se(Ne).pointerDown(...P)),onPointermove:F[13]||(F[13]=(...P)=>se(Ne).pointerMove&&se(Ne).pointerMove(...P)),onPointerup:F[14]||(F[14]=(...P)=>se(Ne).pointerUp&&se(Ne).pointerUp(...P)),onPointercancel:F[15]||(F[15]=(...P)=>se(Ne).pointerCancel&&se(Ne).pointerCancel(...P))},[l("section",{ref_key:"dialogRef",ref:ue,class:"material-operation-dialog","data-overlay-root":"materialOperation",role:"dialog","aria-modal":"true","aria-label":`${De.value}素材操作对话框`,"aria-describedby":W.value,"aria-busy":t.busy},[l("header",null,[l("div",null,[F[16]||(F[16]=l("span",null,"素材真实操作",-1)),l("strong",null,p(De.value),1)]),l("button",{type:"button",title:"关闭","aria-label":`关闭${De.value}`,disabled:t.busy,onClick:q},"×",8,j$)]),t.mode==="upload-image"?(m(),y("form",{key:0,"aria-label":"添加并识别素材表单",onSubmit:ze(Qn,["prevent"]),onPaste:at},[l("p",{id:W.value,class:"operation-notice"}," 选择素材部件后,可直接粘贴截图、拖入图片或从本地选择文件。保存后会自动调用素材视觉识别。 ",8,K$),l("input",{ref_key:"uploadFileInputRef",ref:K,class:"upload-file-input",type:"file",accept:"image/png,image/jpeg,image/gif,image/webp",onChange:va},null,544),l("button",{type:"button",class:fe(["material-upload-dropzone",{active:G.value,ready:_.value}]),onClick:tt,onDragenter:F[0]||(F[0]=ze(P=>G.value=!0,["prevent"])),onDragover:F[1]||(F[1]=ze(P=>G.value=!0,["prevent"])),onDragleave:F[2]||(F[2]=ze(P=>G.value=!1,["prevent"])),onDrop:ze(pa,["prevent"])},[_.value?(m(),y("img",{key:0,src:_.value,alt:"待添加素材预览"},null,8,V$)):(m(),y("span",G$,[...F[17]||(F[17]=[l("b",null,"粘贴、拖入或选择图片",-1),l("small",null,"PNG / JPG / GIF / WEBP,最大 20 MB",-1)])])),h.value?(m(),y("em",z$,p(h.value)+" · "+p(se(go)(S.value)),1)):H("",!0)],34),l("div",H$,[l("label",null,[F[18]||(F[18]=l("span",null,"素材名称",-1)),xe(l("input",{ref_key:"firstInputRef",ref:Ae,"onUpdate:modelValue":F[3]||(F[3]=P=>d.value=P),type:"text",maxlength:"120",placeholder:"例如:黑色短款机能外套"},null,512),[[je,d.value]])]),l("label",null,[F[20]||(F[20]=l("span",null,"素材部件(分类)",-1)),xe(l("select",{"onUpdate:modelValue":F[4]||(F[4]=P=>g.value=P)},[F[19]||(F[19]=l("option",{value:"",disabled:""},"请选择部件",-1)),(m(!0),y(Q,null,re(de.value,P=>(m(),y("option",{key:P.value,value:P.value},p(P.label),9,Q$))),128))],512),[[Xa,g.value]])]),l("label",null,[F[22]||(F[22]=l("span",null,"身体槽位(可选)",-1)),xe(l("select",{"onUpdate:modelValue":F[5]||(F[5]=P=>T.value=P)},[F[21]||(F[21]=l("option",{value:""},"交给识别模型判断",-1)),(m(!0),y(Q,null,re(se(Rf),P=>(m(),y("option",{key:P.value,value:P.value},p(P.label),9,Y$))),128))],512),[[Xa,T.value]])]),l("label",J$,[F[23]||(F[23]=l("span",null,"补充识别要求(可选)",-1)),xe(l("input",{"onUpdate:modelValue":F[6]||(F[6]=P=>X.value=P),type:"text",maxlength:"240",placeholder:"例如:重点提取袖口、材质与叠穿层级"},null,512),[[je,X.value]])])]),de.value.length?H("",!0):(m(),y("p",X$,"请先创建一个素材分类。")),J.value?(m(),y("p",Z$,p(J.value),1)):H("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:q},"取消",8,eC),l("button",{type:"button",disabled:t.busy,onClick:tt},"选择图片",8,tC),l("button",{type:"submit",disabled:t.busy||!_.value||!de.value.length},p(t.busy?"保存并识别中":"添加并识别"),9,aC)])],32)):t.mode==="register-uri"?(m(),y("form",{key:1,"aria-label":"登记素材 URI 表单",onSubmit:ze(Lt,["prevent"])},[l("p",{id:W.value,class:"operation-notice"}," 这里只登记 AstrBot 插件存储中的现有文件引用,不会从浏览器上传文件字节。 ",8,nC),l("label",null,[F[24]||(F[24]=l("span",null,"storage:// URI",-1)),xe(l("input",{ref_key:"firstInputRef",ref:Ae,"onUpdate:modelValue":F[7]||(F[7]=P=>u.value=P),type:"text",autocomplete:"off","aria-label":"素材 storage URI",placeholder:"storage://materials/coat.png"},null,512),[[je,u.value]])]),l("label",null,[F[25]||(F[25]=l("span",null,"素材名称",-1)),xe(l("input",{"onUpdate:modelValue":F[8]||(F[8]=P=>d.value=P),type:"text",maxlength:"120","aria-label":"素材名称",placeholder:"深蓝机能外套"},null,512),[[je,d.value]])]),l("label",null,[F[27]||(F[27]=l("span",null,"素材分类",-1)),xe(l("select",{"onUpdate:modelValue":F[9]||(F[9]=P=>g.value=P),"aria-label":"素材分类"},[F[26]||(F[26]=l("option",{value:"",disabled:""},"请选择分类",-1)),(m(!0),y(Q,null,re(de.value,P=>(m(),y("option",{key:P.value,value:P.value},p(P.label),9,lC))),128))],512),[[Xa,g.value]])]),de.value.length?H("",!0):(m(),y("p",oC,"请先在素材页创建一个后端分类。")),J.value?(m(),y("p",rC,p(J.value),1)):H("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:q},"取消",8,iC),l("button",{type:"submit",disabled:t.busy||!de.value.length},p(t.busy?"登记中":"登记 URI"),9,sC)])],32)):t.mode==="asset-pack"?(m(),y("form",{key:2,"aria-label":"素材包导入表单",onSubmit:ze(_a,["prevent"])},[l("p",{id:W.value,class:"operation-notice"}," 先执行 metadata-only dry-run,查看清单摘要;预检查通过后才能确认导入。 ",8,uC),l("label",null,[F[28]||(F[28]=l("span",null,"素材包 storage:// URI",-1)),xe(l("input",{ref_key:"firstInputRef",ref:Ae,"onUpdate:modelValue":F[10]||(F[10]=P=>ye.value=P),type:"text",autocomplete:"off","aria-label":"素材包 storage URI",placeholder:"storage://materials/my-pack"},null,512),[[je,ye.value]])]),ne.value?(m(),y("section",dC,[l("header",null,[F[29]||(F[29]=l("strong",null,"dry-run 摘要",-1)),l("span",{class:fe(ne.value.manifest.valid?"good":"bad")},p(ne.value.manifest.valid?"清单有效":"清单无效"),3)]),l("dl",null,[l("div",null,[F[30]||(F[30]=l("dt",null,"素材包",-1)),l("dd",null,p(ne.value.manifest.name||ne.value.package_uri),1)]),l("div",null,[F[31]||(F[31]=l("dt",null,"文件",-1)),l("dd",null,p(ne.value.files)+" 个 / "+p(se(go)(ne.value.bytes)),1)]),l("div",null,[F[32]||(F[32]=l("dt",null,"素材",-1)),l("dd",null,p(ne.value.manifest.materials)+" 条",1)]),l("div",null,[F[33]||(F[33]=l("dt",null,"样式",-1)),l("dd",null,p(ne.value.manifest.styles)+" 条",1)])]),ne.value.manifest.errors.length?(m(),y("ul",cC,[(m(!0),y(Q,null,re(ne.value.manifest.errors,P=>(m(),y("li",{key:`${P.code}-${P.message}`},p(P.code)+":"+p(P.message),1))),128))])):H("",!0),(He=ne.value.unsupported_features)!=null&&He.length?(m(),y("ul",fC,[(m(!0),y(Q,null,re(ne.value.unsupported_features,P=>(m(),y("li",{key:P.code},p(P.code)+":"+p(P.message),1))),128))])):H("",!0),ne.value.execution_enabled?H("",!0):(m(),y("p",vC," 当前摘要不允许执行导入,请先修正清单错误或不支持的条目。 "))])):H("",!0),J.value?(m(),y("p",pC,p(J.value),1)):H("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:q},"取消",8,mC),l("button",{type:"submit",disabled:t.busy},p(t.busy?"检查中":"dry-run 预检查"),9,gC),l("button",{type:"button",disabled:t.busy||!oe.value,onClick:kt},p(t.busy?"执行中":"确认导入"),9,yC)])],32)):(m(),y("form",{key:3,"aria-label":"角色衣橱导入表单",onSubmit:ze(qt,["prevent"])},[l("p",{id:W.value,class:"operation-notice"}," 将当前已确认素材导入当前选中角色的衣橱,不会复制或伪造素材记录。 ",8,_C),l("dl",bC,[l("div",null,[F[34]||(F[34]=l("dt",null,"角色",-1)),l("dd",null,p(t.profileName||"未选择"),1)]),l("div",null,[F[35]||(F[35]=l("dt",null,"素材",-1)),l("dd",null,p(((I=t.material)==null?void 0:I.display_name)||"未选择"),1)]),l("div",null,[F[36]||(F[36]=l("dt",null,"素材状态",-1)),l("dd",null,p(((E=t.material)==null?void 0:E.recognition_status)||"-"),1)])]),l("label",null,[F[37]||(F[37]=l("span",null,"wardrobe_category",-1)),xe(l("input",{ref_key:"firstInputRef",ref:Ae,"onUpdate:modelValue":F[11]||(F[11]=P=>me.value=P),list:"wardrobe-category-options",type:"text",maxlength:"48","aria-label":"衣橱分类"},null,512),[[je,me.value]]),F[38]||(F[38]=I1('<datalist id="wardrobe-category-options" data-v-9870de78><option value="top" data-v-9870de78></option><option value="bottom" data-v-9870de78></option><option value="outerwear" data-v-9870de78></option><option value="dress" data-v-9870de78></option><option value="shoes" data-v-9870de78></option><option value="socks" data-v-9870de78></option><option value="accessory" data-v-9870de78></option><option value="headwear" data-v-9870de78></option></datalist>',1))]),J.value?(m(),y("p",wC,p(J.value),1)):H("",!0),l("footer",null,[l("button",{type:"button",disabled:t.busy,onClick:q},"取消",8,hC),l("button",{type:"submit",disabled:t.busy||!t.profileId||!t.material},p(t.busy?"导入中":"导入衣橱"),9,kC)])],32))],8,F$)],32)}}}),CC=Kr($C,[["__scopeId","data-v-9870de78"]]),qu=Hn({__name:"MetricCardGrid",props:{cards:{},sectionClass:{type:[Boolean,null,String,Object,Array],default:""},cardClass:{type:[Boolean,null,String,Object,Array],default:""}},setup(t){const n=t;return(o,i)=>(m(),y("section",{class:fe(n.sectionClass)},[(m(!0),y(Q,null,re(n.cards,u=>(m(),y("article",{key:u.label,class:fe(["metric-card",u.state,n.cardClass])},[l("span",null,p(u.label),1),l("strong",null,p(u.value),1),l("small",null,p(u.hint),1)],2))),128))],2))}}),SC=["role","aria-busy"],IC=["aria-label","disabled"],PC=Hn({__name:"StateCard",props:{tone:{},title:{},detail:{},actionLabel:{default:""},busy:{type:Boolean,default:!1}},emits:["action"],setup(t,{emit:n}){const o=t,i=n;function u(){o.busy||i("action")}return(d,g)=>(m(),y("section",{class:fe(["state-card",t.tone]),role:t.tone==="bad"?"alert":"status","aria-live":"polite","aria-busy":t.busy},[l("strong",null,p(t.title),1),l("span",null,p(t.detail),1),t.actionLabel?(m(),y("button",{key:0,type:"button","aria-label":t.actionLabel,disabled:t.busy,onClick:u},p(t.actionLabel),9,IC)):H("",!0)],10,SC))}}),Br=Kr(PC,[["__scopeId","data-v-23152ac6"]]),xC="/api/v1/plugins/extensions/astrbot_plugin_imagestudio",N={uiBootstrap:"ui/bootstrap",uiActions:"ui/actions",dashboardSummary:"dashboard/summary",contract:"contract",profiles:"profiles",profile:t=>`profiles/${t}`,profileArchive:t=>`profiles/${t}/archive`,quickProfileDraft:"profiles/quick-draft",quickProfileDocumentImport:"profiles/quick-draft/from-document",quickProfileDraftSave:"profiles/quick-draft/save",profileWorkflows:t=>`profiles/${t}/workflows`,profileCards:t=>`profiles/${t}/profile-cards`,profileCard:t=>`profile-cards/${t}`,workflow:t=>`workflows/${t}`,workflowStart:t=>`workflows/${t}/start`,workflowCancel:t=>`workflows/${t}/cancel`,workflowArchive:t=>`workflows/${t}/archive`,workflowExecuteCharacter:t=>`workflows/${t}/execute-character`,workflowFinalizeCard:t=>`workflows/${t}/finalize-card`,workflowNodes:t=>`workflows/${t}/nodes`,workflowBranches:t=>`workflows/${t}/branches`,workflowSwitchBranch:t=>`workflows/${t}/switch-branch`,workflowHistory:t=>`workflows/${t}/history`,node:t=>`nodes/${t}`,nodeDependencyContext:t=>`nodes/${t}/dependency-context`,nodeMaterialBindings:t=>`nodes/${t}/material-bindings`,nodeRounds:t=>`nodes/${t}/rounds`,round:t=>`rounds/${t}`,roundFeedback:t=>`rounds/${t}/feedback`,roundNext:t=>`rounds/${t}/next`,roundConfirm:t=>`rounds/${t}/confirm`,roundGenerationCrossReview:t=>`rounds/${t}/generation-cross-review`,roundGenerationCrossReviewRegenerate:t=>`rounds/${t}/generation-cross-review/regenerate`,roundGenerationCrossReviewApprove:t=>`rounds/${t}/generation-cross-review/approve`,nodeGenerate:t=>`nodes/${t}/generate`,nodeRetry:t=>`nodes/${t}/retry`,nodeComplete:t=>`nodes/${t}/complete`,nodeMarkCompleted:t=>`nodes/${t}/mark-completed`,nodeSelectImage:t=>`nodes/${t}/select-image`,nodeAdoptImage:t=>`nodes/${t}/adopt-image`,reviewPolicy:"review/policy",reviewPolicyValidate:"review/policy/validate",reviewPolicySave:"review/policy/save",promptsExpand:"prompts/expand",promptGovernancePreview:"prompts/governance-preview",nodeReview:t=>`nodes/${t}/review`,nodeImages:t=>`nodes/${t}/images`,workflowReview:t=>`workflows/${t}/review`,images:"images",image:t=>`images/${t}`,imageSelect:t=>`images/${t}/select`,imageUnselect:t=>`images/${t}/unselect`,imageArchive:t=>`images/${t}/archive`,imageSafeDelete:t=>`images/${t}/safe-delete`,imageDelete:t=>`images/${t}`,jobs:"jobs",job:t=>`jobs/${t}`,jobDelete:t=>`jobs/${t}`,jobCancel:t=>`jobs/${t}/cancel`,jobRetry:t=>`jobs/${t}/retry`,jobRetryFailed:"jobs/failed/retry",jobClearFailed:"jobs/failed/clear",jobClearTerminal:"jobs/terminal/clear",jobDeadLetterRetry:"jobs/dead-letter/retry",jobDeadLetterMoveFailed:"jobs/dead-letter/move-failed",costUsage:"costs/usage",costGuard:"costs/guard",runtimeModels:"models/runtime",settingsSchema:"settings/schema",settingsCurrent:"settings/current",settingsValidate:"settings/validate",settingsDiff:"settings/diff",settingsSave:"settings/save",settingsReload:"settings/reload",settingsExport:"settings/export",settingsImport:"settings/import",settingsSnapshots:"settings/snapshots",settingsSnapshot:t=>`settings/snapshots/${t}`,settingsRollback:"settings/rollback",backups:"backups",backup:t=>`backups/${t}`,backupRestore:t=>`backups/${t}/restore`,storageStatus:"storage/status",storageMigrate:"storage/migrate",mediaSign:"media/sign",mediaPayload:"media/payload",mediaIndex:"media/index",mediaOrphans:"media/orphans",materialCategories:"material-categories",materialCategory:t=>`material-categories/${t}`,materials:"materials",materialUpload:"materials/upload",material:t=>`materials/${t}`,materialRecognize:t=>`materials/${t}/recognize`,materialReRecognize:t=>`materials/${t}/re-recognize`,materialConfirm:t=>`materials/${t}/confirm`,advancedMaterialImports:"advanced-material-imports",advancedMaterialImportUpload:"advanced-material-imports/upload",advancedMaterialStyleSetUpload:"advanced-material-imports/style-set/upload",advancedMaterialImport:t=>`advanced-material-imports/${t}`,advancedMaterialImportDelete:t=>`advanced-material-imports/${t}`,advancedMaterialImportRetry:t=>`advanced-material-imports/${t}/retry`,advancedMaterialStyleSourceRetry:(t,n)=>`advanced-material-imports/${t}/style-sources/${n}/retry`,advancedMaterialStyleSourceExclude:(t,n)=>`advanced-material-imports/${t}/style-sources/${n}/exclude`,advancedMaterialStyleConsensus:t=>`advanced-material-imports/${t}/style-consensus`,advancedMaterialStyleValidationCaseRetry:(t,n)=>`advanced-material-imports/${t}/style-validation-cases/${n}/retry`,advancedMaterialValidationAttempts:t=>`advanced-material-imports/${t}/validation-attempts`,advancedMaterialAttemptAccept:(t,n)=>`advanced-material-imports/${t}/attempts/${n}/accept`,advancedMaterialAttemptReject:(t,n)=>`advanced-material-imports/${t}/attempts/${n}/reject`,advancedMaterials:"advanced-materials",advancedMaterial:t=>`advanced-materials/${t}`,materialCatalog:"material-catalog",assetImportPack:"assets/import-pack",wardrobe:t=>`profiles/${t}/wardrobe`,wardrobeImportMaterial:t=>`profiles/${t}/wardrobe/import-material`,wardrobeItems:t=>`profiles/${t}/wardrobe/items`,wardrobeItem:(t,n)=>`profiles/${t}/wardrobe/items/${n}`,wardrobeLegacyItem:(t,n)=>`profiles/${t}/wardrobe/${n}`,wardrobeMatch:t=>`profiles/${t}/wardrobe/match`,wardrobeTemplates:t=>`profiles/${t}/wardrobe-templates`,wardrobeTemplate:(t,n)=>`profiles/${t}/wardrobe-templates/${n}`,wardrobeTemplateApply:(t,n)=>`profiles/${t}/wardrobe-templates/${n}/apply`,materialAnalytics:"materials/analytics",materialRenormalizeBatch:"materials/renormalize-batch",materialRenormalize:t=>`materials/${t}/renormalize`,privateCompanionDailyOutfit:"integrations/private-companion/daily-outfit",privateCompanionToken:"integrations/private-companion/token",privateCompanionTokenRotate:"integrations/private-companion/token/rotate",integrationEventLogs:"integrations/logs",apiDiscoveryDialects:"api-discovery/dialects",apiDiscoveryProbeProvider:"api-discovery/probe-provider",apiDiscoveryProbeModel:"api-discovery/probe-model",apiDiscoveryCapabilities:"api-discovery/capabilities",apiDiscoveryManualOverride:"api-discovery/manual-override",apiDiscoveryValidateRenderPlan:"api-discovery/validate-render-plan",generationLogs:"logs/generation",workflowLogs:"logs/workflows",errorLogs:"logs/errors",integrationLogs:"logs/integrations",auditLogs:"security/audit-logs",eventStream:"events/stream",webManifest:"web/manifest"},AC=900,MC=AC*1e3,RC="__imagestudio_method",EC="__imagestudio_body",NC=2500,TC=1200,BC=15e3,LC=3e4,qC=/(?:^|\/)(?:generate|retry|review|execute-character|expand|governance-preview|probe-provider|probe-model|recognize|re-recognize|renormalize|renormalize-batch|import-pack|migrate|restore)(?:\/|$)/;class qa extends Error{constructor(o,i,u={}){super(i);Ac(this,"code");Ac(this,"details");this.name="ApiClientError",this.code=o,this.details=u}}async function Pe(t,n){return pd(t,{method:"GET",query:n})}async function $e(t,n){return pd(t,{method:"POST",body:n})}async function Lr(t,n){return pd(t,{method:"PUT",body:n})}async function ju(t,n){return pd(t,{method:"DELETE",body:n})}function Du(){const t=typeof window>"u"?void 0:window.AstrBotPluginPage;return t&&(typeof t.apiGet=="function"||typeof t.apiPost=="function")?"plugin-bridge":"direct-fetch"}async function pd(t,n={}){const o=await WC();if(o){const g=await DC(o,t,n);if(g===void 0)throw new qa("invalid_api_response","AstrBot Plugin Page bridge returned no response",{endpoint:t,method:n.method??"GET",transport:"plugin-bridge"});return Pm(g)}const i=KC(t,n.query);let u;try{u=await fetch(i,{method:n.method??"GET",headers:n.body===void 0?void 0:{"Content-Type":"application/json"},body:n.body===void 0?void 0:JSON.stringify(n.body)})}catch(g){throw new qa("network_unreachable","无法连接 ImageStudio 后端接口",{endpoint:t,transport:"direct-fetch",url:i,reason:g instanceof Error?g.message:String(g)})}const d=await UC(u,t,i);if(!u.ok&&!ff(d)&&!Qg(d))throw new qa("http_error",`接口请求失败(HTTP ${u.status})`,{endpoint:t,transport:"direct-fetch",url:i,status:u.status,status_text:u.statusText});return Pm(d)}async function DC(t,n,o){const i=o.method??"GET";if(typeof t.ready=="function")try{await Kc(Promise.resolve(t.ready()),TC,"AstrBot Plugin Page bridge readiness timed out")}catch{}if(i==="GET"&&typeof t.apiGet=="function")return Kc(t.apiGet(n,jC(o.query)),BC,"AstrBot Plugin Page GET request timed out");if(i==="POST"&&typeof t.apiPost=="function"){const u=OC(n);return Kc(t.apiPost(n,o.body),u,`AstrBot Plugin Page POST request timed out after ${Math.round(u/1e3)} seconds`)}if(i==="PUT"&&typeof t.apiPut=="function")return t.apiPut(n,o.body);if(i==="PATCH"&&typeof t.apiPatch=="function")return t.apiPatch(n,o.body);if(i==="DELETE"&&typeof t.apiDelete=="function")return t.apiDelete(n);if(["PUT","PATCH","DELETE"].includes(i)&&typeof t.apiPost=="function")return t.apiPost(n,{[RC]:i,[EC]:i==="DELETE"?{}:o.body===void 0?{}:o.body});throw new qa("bridge_method_unavailable",`AstrBot Plugin Page bridge does not support ${i}`,{endpoint:n,method:i,transport:"plugin-bridge"})}function OC(t){return qC.test(t)?MC:LC}async function WC(){if(typeof window>"u")return;if(window.AstrBotPluginPage)return window.AstrBotPluginPage;if(window.parent===window)return;const t=Date.now()+NC;for(;Date.now()<t;)if(await new Promise(n=>window.setTimeout(n,100)),window.AstrBotPluginPage)return window.AstrBotPluginPage}function Kc(t,n,o){return new Promise((i,u)=>{const d=window.setTimeout(()=>u(new qa("bridge_timeout",o)),n);t.then(g=>{window.clearTimeout(d),i(g)},g=>{window.clearTimeout(d),u(g)})})}function Pm(t){let n=t;for(let o=0;o<4;o+=1){if(ff(n)){if(!n.ok)throw new qa(n.error_code,n.message,n.details??{});n=n.data;continue}if(Qg(n)){if(n.status==="error"){if(ff(n.data)){n=n.data;continue}throw new qa(n.error_code||"astrbot_bridge_error",n.message||n.error||"AstrBot Plugin Page bridge request failed",n.details??FC(n.data))}n=n.data;continue}return n}throw new qa("invalid_api_response","API response wrapper nesting is too deep")}async function UC(t,n,o){const i=t.headers.get("content-type")??"";if(!(i.includes("application/json")||i.includes("+json"))){const d=(await t.text()).slice(0,240);throw new qa("invalid_api_response","接口返回了非 JSON 响应",{endpoint:n,transport:"direct-fetch",url:o,status:t.status,status_text:t.statusText,content_type:i,preview:d})}try{return await t.json()}catch(d){throw new qa("invalid_api_response","接口返回格式不正确",{endpoint:n,transport:"direct-fetch",url:o,status:t.status,status_text:t.statusText,content_type:i,reason:d instanceof Error?d.message:String(d)})}}function ff(t){return!t||typeof t!="object"||!("ok"in t)||typeof t.ok!="boolean"?!1:t.ok?"data"in t:"error_code"in t&&"message"in t}function Qg(t){return!t||typeof t!="object"||!("status"in t)?!1:t.status==="error"||t.status==="ok"&&"data"in t}function FC(t){return t&&typeof t=="object"?{bridge_data:t}:{}}function jC(t){if(!t)return;const n={};for(const[o,i]of Object.entries(t))i!==void 0&&(n[o]=i);return n}function KC(t,n){const o=t.replace(/^\/+/,""),i=new URL(`${xC}/${o}`,window.location.origin);for(const[u,d]of Object.entries(n??{}))d!==void 0&&i.searchParams.set(u,String(d));return`${i.pathname}${i.search}`}const VC=new Set(["standard","advanced","advanced-import"]);function GC(t){return t&&VC.has(t)?t:"standard"}function ar(t){switch(td(t)){case"pending_recognition":case"recognition_queued":case"style_source_recognition_queued":return{label:"等待识别",detail:"源图已保存,等待视觉模型提取特征。",tone:"idle",busy:!0};case"recognizing":case"recognizing_style_sources":return{label:"正在识别",detail:"正在提取关键词、提示词和视觉特征。",tone:"active",busy:!0};case"style_source_review_required":return{label:"待处理样本",detail:"部分样本识别未完成;可单独重试失败项或排除后继续。",tone:"warn",busy:!1};case"style_consensus_queued":case"style_consensus_running":return{label:"正在交叉归纳",detail:"正在对全部有效样本和逐图报告进行共性与差异分析。",tone:"active",busy:!0};case"style_consensus_failed":return{label:"交叉归纳失败",detail:"逐图结果仍已保留,可重新发起交叉归纳。",tone:"bad",busy:!1};case"pending_validation":case"ready_for_validation":return{label:"等待验证",detail:"识别完成,可以生成第一张还原度验证图。",tone:"warn",busy:!1};case"validating":case"validation_queued":return{label:"正在验证",detail:"验证图已入队,完成后可对照源图审核。",tone:"active",busy:!0};case"validation_partial_failed":return{label:"部分验证失败",detail:"已完成的验证图会保留,只需单独重试失败场景。",tone:"warn",busy:!1};case"pending_review":case"awaiting_review":return{label:"等待审核",detail:"请比较源图与验证图,决定封存或继续调整。",tone:"warn",busy:!1};case"accepted":return{label:"已封存",detail:"已作为高优先级进阶素材入库。",tone:"good",busy:!1};case"rejected":case"adjustment_required":return{label:"待调整",detail:"上一轮未通过,可补充描述重新验证。",tone:"warn",busy:!1};case"failed":case"validation_failed":case"recognition_failed":return{label:"处理失败",detail:"可以查看失败原因并重试当前阶段。",tone:"bad",busy:!1};case"cancelled":return{label:"已取消",detail:"当前导入任务已取消。",tone:"idle",busy:!1};case"archived":return{label:"已归档",detail:"当前导入记录已归档。",tone:"idle",busy:!1};default:return{label:t||"未知状态",detail:"后端返回了尚未识别的状态。",tone:"idle",busy:!1}}}function us(t){switch(td(t)){case"queued":return{label:"已入队",detail:"验证任务正在等待执行。",tone:"idle",busy:!0};case"running":return{label:"生成中",detail:"正在生成本轮还原度验证图。",tone:"active",busy:!0};case"succeeded":case"completed":case"awaiting_review":return{label:"待审核",detail:"验证图已生成,请判断还原度。",tone:"warn",busy:!1};case"accepted":return{label:"已采纳",detail:"本轮验证图已经封存入库。",tone:"good",busy:!1};case"rejected":return{label:"未采纳",detail:"本轮已保留,可基于反馈继续调整。",tone:"warn",busy:!1};case"failed":return{label:"生成失败",detail:"检查错误后可再次发起验证。",tone:"bad",busy:!1};case"cancelled":return{label:"已取消",detail:"本轮验证任务已取消。",tone:"idle",busy:!1};default:return{label:t||"未知状态",detail:"后端返回了尚未识别的状态。",tone:"idle",busy:!1}}}function zC(t){return[...t].sort((n,o)=>{const i=+(td(o.status)==="active")-+(td(n.status)==="active");if(i)return i;const u=Number(o.priority||0)-Number(n.priority||0);return u||Ri(o.accepted_at||o.updated_at)-Ri(n.accepted_at||n.updated_at)})}function HC(t){return[...t].sort((n,o)=>Ri(o.updated_at)-Ri(n.updated_at))}function QC(t){return[...t].sort((n,o)=>Number(o.attempt_number||0)-Number(n.attempt_number||0)||Ri(o.created_at)-Ri(n.created_at))}function yi(t){if(!t||typeof t!="object")return"";const n=t,o=String(n.message||n.detail||n.reason||"").trim();if(o)return o;const i=String(n.code||n.error_code||"").trim();return i?`错误代码:${i}`:""}function Vc(t,n){if(!t||typeof t!="object")return null;const o=t;for(const i of n){const u=o[i];if(u&&typeof u=="object"&&!Array.isArray(u))return u}return null}function vs(t){if(Array.isArray(t))return t;if(!t||typeof t!="object")return[];const n=t;return Array.isArray(n.items)?n.items:n.data&&typeof n.data=="object"?vs(n.data):[]}function td(t){return String(t||"").trim().toLowerCase()}function Ri(t){const n=Date.parse(String(t||""));return Number.isFinite(n)?n:0}const YC={class:"advanced-material-page"},JC={key:1,class:"advanced-material-banner",role:"status"},XC={class:"advanced-material-metrics","aria-label":"进阶素材状态"},ZC={class:"advanced-material-library-layout"},e2={class:"advanced-material-panel advanced-material-library-panel"},t2={class:"advanced-section-header"},a2={class:"advanced-material-filter-panel","aria-label":"进阶素材筛选"},n2={class:"advanced-material-filter-tabs",role:"tablist","aria-label":"素材分类"},l2=["onClick"],o2={class:"advanced-material-filter-controls"},r2={key:0,class:"advanced-material-skeleton"},i2={key:1,class:"advanced-material-card-grid"},s2=["onClick"],u2={class:"advanced-material-card-images"},d2=["src","alt"],c2={key:1},f2=["src","alt"],v2={key:1},p2={class:"advanced-material-card-copy"},m2={class:"advanced-material-card-tags"},g2={key:2,class:"advanced-material-empty"},y2={class:"advanced-material-panel advanced-import-queue"},_2={class:"advanced-section-header compact"},b2=["disabled"],w2={key:0,class:"advanced-import-list"},h2=["onClick"],k2={key:1,class:"advanced-material-empty compact"},$2={key:3,class:"advanced-material-import-layout"},C2={class:"advanced-material-panel advanced-upload-panel"},S2={class:"advanced-section-header"},I2={class:"advanced-upload-grid"},P2=["onKeydown"],x2={key:0,class:"advanced-style-upload-grid"},A2=["src","alt"],M2=["disabled","aria-label","onClick"],R2=["disabled","aria-label","onClick"],E2=["aria-label","onClick"],N2={key:0,class:"advanced-style-upload-add"},T2=["src"],B2={key:2,class:"advanced-upload-placeholder"},L2={key:3},q2=["multiple"],D2=["value"],O2={key:0,class:"advanced-style-mode-note"},W2={class:"advanced-upload-actions"},U2={key:0,class:"advanced-style-upload-count"},F2=["disabled"],j2=["disabled"],K2={class:"advanced-material-panel advanced-import-queue"},V2={class:"advanced-section-header compact"},G2=["disabled"],z2={key:0,class:"advanced-import-list"},H2=["onClick"],Q2={key:1,class:"advanced-material-empty compact"},Y2={key:4,class:"advanced-material-panel advanced-review-panel"},J2={class:"advanced-review-header"},X2={class:"advanced-review-header-actions"},Z2=["disabled"],eS={key:0,class:"advanced-review-loading"},tS={key:0,class:"advanced-inline-error"},aS=["disabled"],nS={key:1,class:"advanced-style-workbench"},lS={class:"advanced-style-stage"},oS={class:"advanced-style-stage-header"},rS={class:"advanced-style-analysis-mode"},iS=["disabled"],sS={class:"advanced-style-source-grid"},uS={class:"advanced-style-source-image"},dS=["src","alt","onClick","onKeydown"],cS={key:1},fS={class:"advanced-style-source-copy"},vS={key:0},pS={key:0,class:"advanced-style-source-actions"},mS=["disabled","onClick"],gS=["disabled","onClick"],yS=["disabled","onClick"],_S={key:0,class:"advanced-style-stage-tip"},bS={key:1,class:"advanced-style-reference-picker"},wS={class:"advanced-style-reference-head"},hS={class:"advanced-style-reference-toggle"},kS=["disabled"],$S={key:0,class:"advanced-style-reference-grid"},CS=["disabled","onClick"],SS=["src","alt"],IS={key:1},PS={key:0},xS={class:"advanced-style-stage"},AS={class:"advanced-style-stage-header"},MS={key:0,class:"advanced-style-confidence"},RS={key:0,class:"advanced-style-consensus-grid"},ES={key:0},NS={key:0},TS={key:0},BS={key:1,class:"advanced-style-source-flags"},LS={key:0},qS={key:0},DS={key:2,class:"advanced-style-stage-empty"},OS={class:"advanced-style-stage"},WS={key:0,class:"advanced-style-validation-grid"},US={class:"advanced-style-validation-image"},FS=["src","alt","onClick","onKeydown"],jS={key:1},KS={class:"advanced-style-validation-copy"},VS={key:0,class:"advanced-applied-adjustment"},GS={key:1,class:"advanced-style-fidelity"},zS={key:2,class:"advanced-style-review-trust"},HS={key:3,class:"advanced-style-review-summary"},QS={key:4},YS=["disabled","onClick"],JS={key:1,class:"advanced-style-stage-empty"},XS={key:2,class:"advanced-recognition-summary"},ZS={key:0},eI={key:3,class:"advanced-comparison-grid"},tI=["src","alt"],aI={key:1},nI=["src","alt"],lI={key:1},oI={class:"advanced-review-controls"},rI={key:0,class:"advanced-adjustment-grid"},iI={class:"advanced-adjustment-field"},sI={class:"advanced-adjustment-field"},uI={key:1,class:"advanced-adjustment-field"},dI={key:2,class:"advanced-decision-fields"},cI={class:"advanced-accept-confirm"},fI={class:"advanced-review-actions"},vI=["disabled"],pI=["disabled"],mI=["disabled"],gI={key:2},yI={key:4,class:"advanced-attempt-history",open:""},_I={key:0},bI={key:0,class:"advanced-attempt-history-images"},wI=["src","alt","onClick","onKeydown"],hI={key:1},kI=["src","alt","onClick","onKeydown"],xm=20*1024*1024,Gc=2,_i=8,$I=4500,CI=Hn({__name:"AdvancedMaterialImportPage",props:{mode:{},categories:{},canManage:{type:Boolean,default:!0}},emits:["navigate","changed"],setup(t,{emit:n}){const o=t,i=n,u=$([]),d=$([]),g=$([]),_=$(""),h=$(null),R=$(!1),S=$(!1),B=$(!1),T=$(""),X=$(""),G=$(""),K=$(""),ye=$({}),me=$(!1),te=$(""),Ae=$(""),ue=$(null),de=$(null),De=$(""),ne=$("file"),oe=$([]),J=$(""),W=$(""),D=$(""),q=$(""),Ne=$(""),Ye=$(85),it=$(!1),ot=$(!0),ft=$("text_only"),tt=$(""),va=$(""),at=$(""),pa=$(0),Et=$("");let dn=0;const Qn=new Set,Lt=M(()=>(Array.isArray(o.categories)?o.categories:[]).filter(w=>w&&typeof w=="object").filter(w=>!w.parent_id&&w.category_type!=="accessory_group").slice().sort((w,v)=>Number(w.sort_order||0)-Number(v.sort_order||0)||String(w.name||"").localeCompare(String(v.name||""),"zh-CN"))),_a=M(()=>Lt.value.find(w=>w.category_id===W.value)??null),kt=M(()=>An(_a.value)),qt=w=>!["accepted","archived"].includes($t(w.status)),ae=M(()=>HC(u.value.filter(qt))),F=M(()=>zC(d.value)),He=M(()=>[{id:"",label:"全部",count:F.value.length},...Lt.value.map(w=>({id:w.category_id,label:Ii(w.name),count:F.value.filter(v=>v.category_id===w.category_id).length}))]),I=M(()=>{const w=Et.value.trim().toLowerCase();return F.value.filter(v=>va.value&&v.category_id!==va.value||at.value&&$t(v.status)!==at.value||Number(pa.value)>0&&Number(v.priority||0)<Number(pa.value)?!1:w?[v.display_name,v.prompt,v.negative_prompt,...Array.isArray(v.tags)?v.tags:[]].filter(Boolean).join(" ").toLowerCase().includes(w):!0)});function E(){va.value="",at.value="",pa.value=0,Et.value=""}const P=M(()=>{var w;return((w=h.value)==null?void 0:w.import_id)===_.value?h.value:u.value.find(v=>v.import_id===_.value)??null}),z=M(()=>QC(g.value)),j=M(()=>{var v;const w=(v=P.value)==null?void 0:v.current_attempt_id;return z.value.find(L=>L.attempt_id===w)??z.value[0]??null}),U=M(()=>en(P.value)),ve=M(()=>{var w;return[...((w=P.value)==null?void 0:w.sources)??[]].sort((v,L)=>Number(v.sort_order||0)-Number(L.sort_order||0))}),ie=M(()=>ve.value.filter(w=>!w.excluded)),Z=M(()=>ie.value.filter(w=>["recognized","completed","succeeded"].includes($t(w.status)))),Y=M(()=>{var Me,A;const w=((Me=ee.value)==null?void 0:Me.representative_source_ids)??[],v=new Set(Z.value.map(we=>we.source_id)),L=w.find(we=>v.has(we));if(L)return L;const le=Z.value.find(we=>we.is_primary);return(le==null?void 0:le.source_id)||((A=Z.value[0])==null?void 0:A.source_id)||""}),Ce=M(()=>{if(!ot.value)return"";const w=tt.value;return w&&Z.value.some(v=>v.source_id===w)?w:Y.value}),ee=M(()=>{var w;return((w=P.value)==null?void 0:w.consensus)??null}),Se=M(()=>{var L,le,Me;const w=(le=(L=j.value)==null?void 0:L.validation_cases)!=null&&le.length?j.value.validation_cases:((Me=P.value)==null?void 0:Me.validation_cases)??[],v={portrait:0,fullbody:1,novel_scene:2};return[...w].sort((A,we)=>(v[A.scenario]??99)-(v[we.scenario]??99))}),Be=M(()=>{var w;return ar(((w=P.value)==null?void 0:w.status)??"")}),Qe=M(()=>{var w;return us(((w=j.value)==null?void 0:w.status)??"")}),st=M(()=>u.value.filter(w=>ar(w.status).busy).length),ut=M(()=>u.value.filter(w=>["pending_review","awaiting_review","rejected","adjustment_required"].includes($t(w.status))).length),Pt=M(()=>u.value.filter(w=>["failed","recognition_failed","validation_failed"].includes($t(w.status))).length),Dt=M(()=>!!(o.canManage&&(kt.value?oe.value.length>=Gc&&oe.value.length<=_i:de.value&&De.value)&&J.value.trim()&&W.value&&!T.value)),ba=M(()=>{const w=P.value;return!w||!o.canManage||T.value||U.value||["accepted","archived","cancelled","recognition_queued","recognizing","pending_recognition","validation_queued","validating","awaiting_review"].includes($t(w.status))?!1:!!(w.recognition_prompt&&!Qe.value.busy)}),Ot=M(()=>{const w=j.value;return!w||!o.canManage||T.value?!1:U.value?Se.value.length===3&&Se.value.every(v=>["succeeded","completed","pending_review","awaiting_review"].includes($t(v.status))&&!!wl(v)):["succeeded","completed","pending_review","awaiting_review"].includes($t(w.status))&&!!Ql(w)}),Ea=M(()=>De.value),Yn=M(()=>{var w,v;return!!(U.value&&o.canManage&&Z.value.length>=Gc&&!["queued","running"].includes($t(((w=ee.value)==null?void 0:w.status)??""))&&!["ready_for_validation","validating","validation_partial_failed","awaiting_review","accepted","cancelled","archived"].includes($t(((v=P.value)==null?void 0:v.status)??""))&&!T.value)}),Wt=M(()=>!!(U.value&&(!ee.value||["failed","cancelled"].includes($t(ee.value.status)))));ct(()=>o.categories,()=>{!W.value&&Lt.value.length&&(W.value=Lt.value[0].category_id)},{immediate:!0}),ct(kt,(w,v)=>{if(w!==v){if(w&&de.value&&De.value){oe.value=[{id:kl(de.value),file:de.value,dataUrl:De.value,source:ne.value}],de.value=null,De.value="";return}if(!w&&oe.value.length){const[L,...le]=oe.value;de.value=L.file,De.value=L.dataUrl,ne.value=L.source,oe.value=[],le.length&&(K.value="当前分类只支持单图,已保留第一张图片。")}}}),ct(()=>o.mode,w=>{G.value="",K.value="",w==="advanced"&&!_.value&&ae.value.length&&aa(ae.value[0].import_id)}),ct(_,()=>{cr(),D.value="",q.value="",Ne.value="",Ye.value=85,it.value=!1}),Ni(async()=>{await yt(),dn=window.setInterval(()=>{document.visibilityState==="visible"&&fn()&&!me.value&&!S.value&&!B.value&&!T.value&&Na()},$I)}),jr(()=>{dn&&window.clearInterval(dn);for(const w of Qn)URL.revokeObjectURL(w);Qn.clear()});async function yt(w=!1){w||(S.value=!0),w||(G.value="");try{const[v,L]=await Promise.all([o.canManage?Pe(N.advancedMaterialImports,{page:1,page_size:100}):Promise.resolve({items:[]}),Pe(N.advancedMaterials,{page:1,page_size:100})]);u.value=vs(v).map(ia).filter(qt),d.value=vs(L).map(xn),await Jl([...u.value,...d.value]),_.value?u.value.some(Me=>Me.import_id===_.value)?await cn(_.value,!0):(_.value="",h.value=null,ae.value.length&&await aa(ae.value[0].import_id)):ae.value.length&&await aa(ae.value[0].import_id)}catch(v){w||(G.value=ge(v))}finally{w||(S.value=!1)}}async function Na(){if(!me.value){me.value=!0;try{const w=_.value,v=Vr();if(w&&v){await cn(w,!0);const L=h.value;L&&(u.value=Bi(u.value,L)),v&&!Vr()&&await yt(!0);return}await ma()}catch{}finally{me.value=!1}}}async function ma(){if(!o.canManage)return;const w=await Pe(N.advancedMaterialImports,{page:1,page_size:100}),v=vs(w).map(ia).filter(qt);u.value=el(u.value,v).filter(qt);const L=u.value.find(le=>le.import_id===_.value);h.value&&L?h.value=Ba(h.value,{...h.value,...L,sources:h.value.sources,consensus:h.value.consensus,validation_cases:h.value.validation_cases}):_.value&&!L&&(_.value="",h.value=null,ae.value.length&&await aa(ae.value[0].import_id)),await Jl(u.value)}async function aa(w){X.value="",_.value=w,R.value=!1,await cn(w)}async function dr(){const w=P.value;if(!(!w||T.value||w.accepted_material_id)){if(X.value!==w.import_id){X.value=w.import_id,K.value="再次点击“确认删除导入”将取消残留任务,并删除该导入、样本、验证轮次和独立文件。",G.value="";return}T.value="delete-import",G.value="",K.value="";try{await ju(N.advancedMaterialImportDelete(w.import_id));const v=w.display_name;_.value="",h.value=null,g.value=[],X.value="",await yt(!0),K.value=`已删除进阶导入“${v}”。`,i("changed")}catch(v){G.value=ge(v)}finally{T.value=""}}}async function cn(w,v=!1){v||(B.value=!0);try{const[L,le]=await Promise.all([Pe(N.advancedMaterialImport(w)),Pe(N.advancedMaterialValidationAttempts(w))]),Me=L&&typeof L=="object"?L:{},A=Vc(L,["import","item"])??L,we=ia({...A,sources:Array.isArray(Me.sources)?Me.sources:A.sources,consensus:Me.consensus&&typeof Me.consensus=="object"?Me.consensus:A.consensus,validation_cases:Array.isArray(Me.validation_cases)?Me.validation_cases:A.validation_cases}),Te=vs(le).map(mn);h.value=Ba(h.value,we),g.value=Hl(g.value,Te),await Jl([h.value,...h.value.sources??[],...h.value.validation_cases??[],...g.value,...g.value.flatMap(dt=>dt.validation_cases??[])])}catch(L){v||(G.value=ge(L))}finally{v||(B.value=!1)}}function $o(){var w;o.canManage&&!T.value&&((w=ue.value)==null||w.click())}async function Jn(w){const v=Array.from(w.target.files??[]);v.length&&await In(v,"file"),w.target.value=""}async function Ut(w){var L;const v=Array.from(((L=w.clipboardData)==null?void 0:L.items)??[]).filter(le=>le.kind==="file"&&le.type.startsWith("image/")).map(le=>le.getAsFile()).filter(le=>!!le);v.length&&(w.preventDefault(),await In(v,"paste"))}async function Za(w){var L;const v=Array.from(((L=w.dataTransfer)==null?void 0:L.files)??[]).filter(le=>le.type.startsWith("image/"));v.length&&await In(v,"drop")}async function In(w,v){if(!kt.value){await Nt(w[0],v);return}G.value="",K.value="";const L=new Set(oe.value.map(Me=>kl(Me.file))),le=w.filter(Me=>{if(!Me.type.startsWith("image/")||Me.size>xm)return!1;const A=kl(Me);return L.has(A)?!1:(L.add(A),!0)}).slice(0,Math.max(0,_i-oe.value.length));if(!le.length){G.value=oe.value.length>=_i?`画风样本最多上传 ${_i} 张。`:"没有可添加的图片;请检查格式、20 MB 大小限制或重复文件。";return}try{const Me=await Promise.all(le.map(async A=>({id:kl(A),file:A,dataUrl:await Li(A),source:v})));oe.value=[...oe.value,...Me],J.value.trim()||(J.value=`${So(Me[0].file.name)||"未命名"}画风组`),le.length<w.length&&(K.value=`已添加 ${le.length} 张;重复、格式异常、超限或超过 8 张的图片已跳过。`)}catch(Me){G.value=ge(Me)}}async function Nt(w,v){if(G.value="",K.value="",!w.type.startsWith("image/")){G.value="请选择 PNG、JPEG、WebP 等图片文件。";return}if(w.size>xm){G.value="单张素材不能超过 20 MB。";return}try{De.value=await Li(w),de.value=w,ne.value=v,J.value.trim()||(J.value=So(w.name)||"进阶素材")}catch(L){G.value=ge(L)}}function Ft(){de.value=null,De.value="",oe.value=[],J.value="",ne.value="file"}function Co(w){T.value||(oe.value=oe.value.filter(v=>v.id!==w))}function Xn(w,v){if(T.value)return;const L=oe.value.findIndex(we=>we.id===w),le=L+v;if(L<0||le<0||le>=oe.value.length)return;const Me=[...oe.value],[A]=Me.splice(L,1);Me.splice(le,0,A),oe.value=Me}async function Ti(){if(Dt.value){T.value="upload",G.value="",K.value="";try{if(kt.value){const Me={display_name:J.value.trim(),category_id:W.value,images:oe.value.map((Te,dt)=>({client_source_id:Te.id,image_data_url:Te.dataUrl,filename:Te.file.name||`style-source-${dt+1}.png`,...Te.file.type.trim()?{content_type:Te.file.type.trim()}:{},size_bytes:Te.file.size,upload_source:Te.source,sort_order:dt,is_primary:dt===0})),metadata:{pipeline:"advanced_style_consensus_validation",workflow_kind:"style_set"}},A=await $e(N.advancedMaterialStyleSetUpload,Me),we=ia(Vc(A,["import","item"])??A);K.value=`${Me.images.length} 张画风样本已拆分入队,将并行识别并在完成后交叉分析。`,Ft(),await yt(!0),we.import_id&&await aa(we.import_id),i("changed");return}if(!de.value)return;const w=de.value.type.trim(),v={image_data_url:De.value,display_name:J.value.trim(),category_id:W.value,filename:de.value.name||"advanced-material.png",...w?{content_type:w}:{},size_bytes:de.value.size,upload_source:ne.value,metadata:{pipeline:"advanced_material_fidelity_validation"}},L=await $e(N.advancedMaterialImportUpload,v),le=ia(Vc(L,["import","item"])??L);K.value="进阶素材已加入识别与还原度验证队列。完成后可在这里对照源图审核。",Ft(),await yt(!0),le.import_id&&await aa(le.import_id),i("changed")}catch(w){G.value=ge(w)}finally{T.value=""}}}async function Bs(){const w=P.value;if(!(!w||T.value)){T.value="retry",G.value="",K.value="";try{await $e(N.advancedMaterialImportRetry(w.import_id),{}),K.value="重试任务已加入队列。",await yt(!0),i("changed")}catch(v){G.value=ge(v)}finally{T.value=""}}}async function Zn(w){const v=P.value;if(!(!v||T.value)){T.value=`source-retry:${w.source_id}`,G.value="",K.value="";try{await $e(N.advancedMaterialStyleSourceRetry(v.import_id,w.source_id),{}),K.value=`样本 ${w.sort_order+1} 已重新加入独立识别队列。`,await cn(v.import_id,!0)}catch(L){G.value=ge(L)}finally{T.value=""}}}async function nt(w,v=!0){const L=P.value;if(!(!L||T.value||w.is_primary)){T.value=`source-exclude:${w.source_id}`,G.value="",K.value="";try{await $e(N.advancedMaterialStyleSourceExclude(L.import_id,w.source_id),{excluded:v}),K.value=v?`样本 ${w.sort_order+1} 已从交叉分析中排除。`:`样本 ${w.sort_order+1} 已恢复;如识别失败可单独重试。`,await cn(L.import_id,!0)}catch(le){G.value=ge(le)}finally{T.value=""}}}async function Pn(){const w=P.value;if(!(!w||!Yn.value)){T.value="style-consensus",G.value="",K.value="";try{const v=Ce.value;await $e(N.advancedMaterialStyleConsensus(w.import_id),{included_source_ids:Z.value.map(L=>L.source_id),analysis_strategy:ft.value,validation_reference_enabled:ot.value,...ot.value&&v?{validation_reference_source_id:v}:{}}),K.value=ot.value?"画风交叉分析已入队;验证轮将附带 1 张风格参考图。":"画风交叉分析已入队;验证轮保持纯文本迁移。",await cn(w.import_id,!0)}catch(v){G.value=ge(v)}finally{T.value=""}}}async function Ta(w){const v=P.value;if(!(!v||T.value)){T.value=`case-retry:${w.case_id}`,G.value="",K.value="";try{await $e(N.advancedMaterialStyleValidationCaseRetry(v.import_id,w.case_id),{}),K.value=`${wa(w.scenario)}已重新加入独立生图队列。`,await cn(v.import_id,!0)}catch(L){G.value=ge(L)}finally{T.value=""}}}async function Tt(){const w=P.value;if(!(!w||!ba.value)){T.value="validation",G.value="",K.value="";try{await $e(N.advancedMaterialValidationAttempts(w.import_id),{adjustment_text:D.value.trim()||void 0}),K.value="还原度验证图已加入生成队列。",D.value="",await yt(!0),i("changed")}catch(v){G.value=ge(v)}finally{T.value=""}}}async function Fa(){const w=P.value,v=j.value,L=D.value.trim(),le=q.value.trim();if(!(!w||!v||!Ot.value)){if(!L&&!le){G.value=U.value?"请至少填写画风修正或下一轮验证内容。":"请先说明验证图与源图的差异,以及下一轮需要怎样调整。";return}T.value="reject",G.value="",K.value="";try{const Me=Ce.value,A={adjustment_text:U.value?void 0:L,style_adjustment_text:U.value&&L||void 0,validation_instruction:U.value&&le||void 0,fidelity_score:Ye.value/100,decision_notes:Ne.value.trim()||void 0,reuse_validation_scenarios:U.value&&!le||void 0,...U.value?{validation_reference_enabled:ot.value,...ot.value&&Me?{validation_reference_source_id:Me}:{}}:{}};await $e(N.advancedMaterialAttemptReject(w.import_id,v.attempt_id),A),K.value="本轮反馈已保存,调整后的下一轮验证图已加入队列。",D.value="",q.value="",Ne.value="",it.value=!1,await yt(!0),i("changed")}catch(Me){G.value=ge(Me)}finally{T.value=""}}}async function zl(){const w=P.value,v=j.value;if(!(!w||!v||!Ot.value||!it.value)){T.value="accept",G.value="",K.value="";try{const L={fidelity_score:Ye.value/100,decision_notes:Ne.value.trim()||void 0};await $e(N.advancedMaterialAttemptAccept(w.import_id,v.attempt_id),L),K.value="验证结果已封存,素材已进入高优先级进阶素材库。",it.value=!1,await yt(!0),i("changed")}catch(L){G.value=ge(L)}finally{T.value=""}}}function fn(){var w;return u.value.some(v=>ar(v.status).busy)||g.value.some(v=>us(v.status).busy)||ie.value.some(v=>["uploaded","recognition_queued","recognizing","queued","running"].includes($t(v.status)))||["queued","running"].includes($t(((w=ee.value)==null?void 0:w.status)??""))||Se.value.some(v=>["queued","running","validating"].includes($t(v.status)))}function Vr(){var w,v;return!!(ar(((w=P.value)==null?void 0:w.status)??"").busy||g.value.some(L=>us(L.status).busy)||ie.value.some(L=>["uploaded","recognition_queued","recognizing","queued","running"].includes($t(L.status)))||["queued","running"].includes($t(((v=ee.value)==null?void 0:v.status)??""))||Se.value.some(L=>["queued","running","validating"].includes($t(L.status))))}function Bi(w,v){const L=w.findIndex(Me=>Me.import_id===v.import_id);if(L<0)return[v,...w];const le=[...w];return le[L]=Ba(w[L],v),le}function el(w,v){const L=new Map(w.map(le=>[le.import_id,le]));return v.map(le=>Ba(L.get(le.import_id)??null,le))}function Hl(w,v){const L=new Map(w.map(le=>[le.attempt_id,le]));return v.map(le=>Ba(L.get(le.attempt_id)??null,le))}function Ba(w,v){if(!w)return v;const L=w,le=v,Me={...v};for(const[A,we]of Object.entries(L)){if(!A.endsWith("_url"))continue;const Te=A.replace(/_url$/,"_uri"),dt=String(L[Te]||""),Gt=String(le[Te]||"");dt&&dt===Gt&&we&&(Me[A]=we)}return Me}function _t(w){return vn(w.source_thumbnail_uri,w.source_image_uri,w.source_thumbnail_url,w.source_image_url)}function tl(w){return vn(w.validation_thumbnail_uri,w.validation_image_uri,w.validation_thumbnail_url,w.validation_image_url)}function Ql(w){return vn(w.validation_thumbnail_uri,w.validation_image_uri,w.validation_thumbnail_url,w.validation_image_url)}function Yl(w){return vn(w.source_thumbnail_uri,w.source_image_uri,w.thumbnail_uri,w.image_uri,w.source_thumbnail_url,w.source_image_url,w.thumbnail_url,w.image_url)}function wl(w){return vn(w.validation_thumbnail_uri,w.validation_image_uri,w.validation_thumbnail_url,w.validation_image_url)}function al(w){return vn(w.source_image_uri,w.source_image_url,w.source_thumbnail_uri,w.source_thumbnail_url)}function nl(w){return vn(w.validation_image_uri,w.validation_image_url,w.validation_thumbnail_uri,w.validation_thumbnail_url)}function ja(w){return vn(w.validation_image_uri,w.validation_image_url,w.validation_thumbnail_uri,w.validation_thumbnail_url)}function Vt(w,v){const L=String(w||"").trim();L&&(te.value=L,Ae.value=v)}function cr(){te.value="",Ae.value=""}function vn(...w){for(const v of w){const L=String(v||"").trim();if(L){if(ye.value[L])return ye.value[L];if(/^(?:https?:|data:|blob:|\/)/i.test(L))return L}}return""}async function Jl(w){const v=new Set,L=new Set;for(const we of w){if(!we||typeof we!="object")continue;const Te=we;for(const[dt,Gt]of Object.entries(Te))if(dt.endsWith("_uri")&&typeof Gt=="string"&&Gt.startsWith("storage://")&&v.add(Gt),dt.endsWith("_url")&&typeof Gt=="string"&&Gr(Gt)){const $l=String(Te[dt.replace(/_url$/,"_uri")]||"");(!$l||!$l.startsWith("storage://"))&&L.add(Gt)}}await Promise.allSettled([...L].map(we=>fr(we)));const le=[...v].filter(we=>!ye.value[we]);if(!le.length)return;const Me=await Promise.allSettled(le.map(async we=>({uri:we,result:await Pe(N.mediaSign,{uri:we})}))),A={};for(const we of Me){if(we.status!=="fulfilled"||!we.value.result.url)continue;const Te=await fr(we.value.result.url);A[we.value.uri]=Te||we.value.result.url}Object.keys(A).length&&(ye.value={...ye.value,...A})}async function fr(w){if(ye.value[w])return ye.value[w];const v=Gr(w);if(!v)return w;try{const L=await Pe(N.mediaPayload,{token:v}),le=String(L.body_base64||"").replace(/-/g,"+").replace(/_/g,"/");if(!le)return w;const Me=le.padEnd(Math.ceil(le.length/4)*4,"="),A=window.atob(Me),we=new Uint8Array(A.length);for(let dt=0;dt<A.length;dt+=1)we[dt]=A.charCodeAt(dt);const Te=URL.createObjectURL(new Blob([we],{type:L.content_type||"application/octet-stream"}));return Qn.add(Te),ye.value={...ye.value,[w]:Te},Te}catch{return w}}function Gr(w){var v;try{const L=new URL(w,window.location.origin);return L.pathname.endsWith("/media/fetch")&&((v=L.searchParams.get("token"))==null?void 0:v.trim())||""}catch{return""}}function hl(w){var v;return Ii(((v=o.categories.find(L=>L.category_id===w))==null?void 0:v.name)||"未分类")}function pn(w){return yi(w==null?void 0:w.error)}function Re(w){return yi(w==null?void 0:w.error)}function Jt(w){if(!w)return"-";const v=new Date(w);return Number.isNaN(v.getTime())?w:v.toLocaleString("zh-CN",{hour12:!1})}function ia(w){var L;const v=w&&typeof w=="object"?w:{};return{...v,import_id:String(v.import_id||""),display_name:String(v.display_name||"未命名进阶素材"),status:String(v.status||"pending_recognition"),recognition_tags:Array.isArray(v.recognition_tags)?v.recognition_tags.map(String):[],recognition_result:v.recognition_result&&typeof v.recognition_result=="object"?v.recognition_result:{},workflow_kind:String(v.workflow_kind||((L=v.metadata)==null?void 0:L.workflow_kind)||"single"),sources:Array.isArray(v.sources)?v.sources.map(Xl):[],consensus:v.consensus&&typeof v.consensus=="object"?zr(v.consensus):null,validation_cases:Array.isArray(v.validation_cases)?v.validation_cases.map(vr):[],error:v.error&&typeof v.error=="object"?v.error:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{},created_at:String(v.created_at||""),updated_at:String(v.updated_at||v.created_at||"")}}function mn(w){const v=w&&typeof w=="object"?w:{};return{...v,attempt_id:String(v.attempt_id||""),import_id:String(v.import_id||""),attempt_number:Number(v.attempt_number||0),status:String(v.status||"queued"),usage:v.usage&&typeof v.usage=="object"?v.usage:{},error:v.error&&typeof v.error=="object"?v.error:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{},validation_cases:Array.isArray(v.validation_cases)?v.validation_cases.map(vr):[],created_at:String(v.created_at||""),updated_at:String(v.updated_at||v.created_at||"")}}function Xl(w){const v=w&&typeof w=="object"?w:{};return{...v,source_id:String(v.source_id||""),sort_order:Number(v.sort_order||0),is_primary:!!v.is_primary,excluded:!!(v.excluded||v.excluded_at||$t(v.status)==="excluded"),status:String(v.status||"uploaded"),recognition_tags:Array.isArray(v.recognition_tags)?v.recognition_tags.map(String):[],recognition_result:v.recognition_result&&typeof v.recognition_result=="object"?v.recognition_result:{},error:v.error&&typeof v.error=="object"?v.error:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{}}}function zr(w){const v=w&&typeof w=="object"?w:{},L=v.result&&typeof v.result=="object"?v.result:{};return{...v,status:String(v.status||"queued"),version_id:v.version_id||v.consensus_id||null,version_number:Number(v.version_number||v.revision||0),consensus_style:v.consensus_style&&typeof v.consensus_style=="object"?v.consensus_style:L.consensus_style&&typeof L.consensus_style=="object"?L.consensus_style:[],variable_style_features:Array.isArray(v.variable_style_features)?v.variable_style_features:Array.isArray(L.variable_style_features)?L.variable_style_features:[],source_content_features:Array.isArray(v.source_content_features)||v.source_content_features&&typeof v.source_content_features=="object"?v.source_content_features:Array.isArray(L.source_content_features)||L.source_content_features&&typeof L.source_content_features=="object"?L.source_content_features:[],content_leakage_exclusions:(Array.isArray(v.content_leakage_exclusions)?v.content_leakage_exclusions:Array.isArray(L.content_leakage_exclusions)?L.content_leakage_exclusions:[]).map(String),outlier_source_ids:(Array.isArray(v.outlier_source_ids)?v.outlier_source_ids:Array.isArray(L.outlier_source_ids)?L.outlier_source_ids:[]).map(String),representative_source_ids:(Array.isArray(v.representative_source_ids)?v.representative_source_ids:Array.isArray(L.representative_source_ids)?L.representative_source_ids:[]).map(String),consensus_confidence:Number(v.consensus_confidence??L.consensus_confidence??0),generation_capsules:v.generation_capsules&&typeof v.generation_capsules=="object"?v.generation_capsules:L.generation_capsules&&typeof L.generation_capsules=="object"?L.generation_capsules:{},error:v.error&&typeof v.error=="object"?v.error:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{}}}function vr(w){const v=w&&typeof w=="object"?w:{};return{...v,case_id:String(v.case_id||""),scenario:String(v.scenario||v.case_key||"novel_scene"),status:String(v.status||"queued"),input_image_count:Number(v.input_image_count||0),fidelity_score:v.fidelity_score==null?null:Number(v.fidelity_score),style_scores:v.style_scores&&typeof v.style_scores=="object"?v.style_scores:v.style_review&&typeof v.style_review=="object"?v.style_review:{},content_novelty:v.content_novelty&&typeof v.content_novelty=="object"?v.content_novelty:{},error:v.error&&typeof v.error=="object"?v.error:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{}}}function xn(w){const v=w&&typeof w=="object"?w:{};return{...v,material_id:String(v.material_id||""),import_id:String(v.import_id||""),accepted_attempt_id:String(v.accepted_attempt_id||""),display_name:String(v.display_name||"未命名进阶素材"),tags:Array.isArray(v.tags)?v.tags.map(String):[],priority:Number(v.priority||0),status:String(v.status||"active"),capsule:v.capsule&&typeof v.capsule=="object"?v.capsule:{},metadata:v.metadata&&typeof v.metadata=="object"?v.metadata:{},created_at:String(v.created_at||""),updated_at:String(v.updated_at||v.created_at||"")}}function Li(w){return new Promise((v,L)=>{const le=new FileReader;le.onload=()=>v(String(le.result||"")),le.onerror=()=>L(le.error||new Error("读取图片失败")),le.readAsDataURL(w)})}function So(w){return w.replace(/\.[^.]+$/,"").trim()}function kl(w){return`${w.name}:${w.size}:${w.lastModified}`}function An(w){var L;if(!w)return!1;const v=String(((L=w.metadata)==null?void 0:L.frontend_group)||w.name||"").trim().toLowerCase();return v==="风格"||v==="style"}function en(w){var L,le;const v=String((w==null?void 0:w.workflow_kind)||((L=w==null?void 0:w.metadata)==null?void 0:L.workflow_kind)||"").trim().toLowerCase();return v==="style_set"||v==="advanced_style_set"||((le=w==null?void 0:w.metadata)==null?void 0:le.style_set)===!0}function Io(w){return w.excluded?"已排除":{uploaded:"等待识别",recognition_queued:"已入队",recognizing:"识别中",recognized:"识别完成",completed:"识别完成",succeeded:"识别完成",failed:"识别失败",cancelled:"已取消"}[$t(w.status)]||w.status||"未知状态"}function Po(w){if(w.excluded)return"idle";const v=$t(w.status);return["recognized","completed","succeeded"].includes(v)?"good":["failed","cancelled"].includes(v)?"bad":["recognizing","running"].includes(v)?"active":"idle"}function wa(w){return{portrait:"异角色头像",fullbody:"异角色全身",novel_scene:"异场景动态构图"}[w]||w||"验证场景"}function ll(w){return{queued:"已入队",running:"生成中",validating:"生成中",succeeded:"待审核",completed:"待审核",awaiting_review:"待审核",pending_review:"待审核",failed:"生成失败",cancelled:"已取消",accepted:"已采纳",rejected:"未采纳"}[$t(w)]||w||"未知状态"}function Zl(w){var L;const v=Number(w.fidelity_score??((L=w.style_review)==null?void 0:L.fidelity_score));return Number.isFinite(v)?Math.max(0,Math.min(100,Math.round(v*100))):null}function pr(w){const v=w.style_review&&typeof w.style_review=="object"?w.style_review:{},L=v.score_calibration&&typeof v.score_calibration=="object"?v.score_calibration:{},le=Number(L.dimension_coverage),Me=!!(L.review_inconsistent||L.dimension_consistency_capped),A=Array.isArray(v.semantic_risks)&&v.semantic_risks.length>0;return Me||A?"????????????????":Number.isFinite(le)?`????? ? ???? ${Math.round(le*100)}%`:"?????"}function ol(w){const v=w.style_review&&typeof w.style_review=="object"?w.style_review:w.style_scores&&typeof w.style_scores=="object"?w.style_scores:{},L=Array.isArray(v.mismatches)?v.mismatches.map(String).filter(Boolean):[];return L.length?`主要偏差:${L.slice(0,2).join(";")}`:String(v.description||"").trim()}function Le(w){return Array.isArray(w)?w.map(Sa).filter(Boolean):!w||typeof w!="object"?[]:Object.entries(w).flatMap(([v,L])=>{if(Array.isArray(L))return L.map(Sa).filter(Boolean);const le=Sa(L);return le?[`${v}:${le}`]:[]})}function Sa(w){if(typeof w=="string")return w.trim();if(!w||typeof w!="object")return"";const v=w;return String(v.trait||v.label||v.description||v.value||"").trim()}function rl(w){var L;const v=ve.value.findIndex(le=>le.source_id===w);return v<0?w:(L=ve.value[v])!=null&&L.is_primary?"主参考图":`样本 ${v+1}`}function $t(w){return String(w||"").trim().toLowerCase()}function ge(w){return w instanceof Error?w.message||"请求失败":String(w||"请求失败")}return(w,v)=>{var L,le,Me;return m(),y("section",YC,[G.value||K.value?(m(),y("div",{key:0,class:fe(["advanced-material-banner",G.value?"bad":"good"]),role:"status"},[l("div",null,[l("strong",null,p(G.value?"操作未完成":"操作已提交"),1),l("span",null,p(G.value||K.value),1)]),l("button",{type:"button","aria-label":"关闭提示",onClick:v[0]||(v[0]=A=>{G.value="",K.value=""})},"×")],2)):H("",!0),t.canManage?H("",!0):(m(),y("div",JC,[...v[28]||(v[28]=[l("div",null,[l("strong",null,"当前账号为只读权限"),l("span",null,"可以查看已封存进阶素材,但导入记录、验证轮次和封存操作需要素材管理权限。")],-1)])])),t.mode==="advanced"?(m(),y(Q,{key:2},[l("section",XC,[l("article",null,[v[29]||(v[29]=l("span",null,"已封存进阶素材",-1)),l("strong",null,p(F.value.length),1),v[30]||(v[30]=l("small",null,"在自动检索与角色拼装中优先于普通素材",-1))]),l("article",null,[v[31]||(v[31]=l("span",null,"处理中",-1)),l("strong",null,p(st.value),1),v[32]||(v[32]=l("small",null,"识别与验证在独立队列执行",-1))]),l("article",null,[v[33]||(v[33]=l("span",null,"等待人工审核",-1)),l("strong",null,p(ut.value),1),v[34]||(v[34]=l("small",null,"需要比较源图与验证图",-1))]),l("article",null,[v[35]||(v[35]=l("span",null,"异常任务",-1)),l("strong",null,p(Pt.value),1),v[36]||(v[36]=l("small",null,"保留错误信息,可单独重试",-1))])]),l("section",ZC,[l("article",e2,[l("header",t2,[l("div",null,[v[37]||(v[37]=l("span",null,"高优先级封存库",-1)),l("h3",null,p(I.value.length)+" 条进阶素材",1),v[38]||(v[38]=l("p",null,"源图、验证图和最终提示词被独立封存,不进入普通图库或工作流候选池。",-1))]),l("button",{type:"button",class:"primary",onClick:v[1]||(v[1]=A=>i("navigate","advanced-import"))},"+ 新建进阶导入")]),l("section",a2,[l("div",n2,[(m(!0),y(Q,null,re(He.value,A=>(m(),y("button",{key:A.id||"all",type:"button",class:fe({active:va.value===A.id}),onClick:we=>va.value=A.id},[Kn(p(A.label)+" ",1),l("span",null,p(A.count),1)],10,l2))),128))]),l("div",o2,[l("label",null,[v[39]||(v[39]=l("span",null,"搜索",-1)),xe(l("input",{"onUpdate:modelValue":v[2]||(v[2]=A=>Et.value=A),type:"search",placeholder:"名称、标签或提示词"},null,512),[[je,Et.value]])]),l("label",null,[v[41]||(v[41]=l("span",null,"状态",-1)),xe(l("select",{"onUpdate:modelValue":v[3]||(v[3]=A=>at.value=A)},[...v[40]||(v[40]=[l("option",{value:""},"全部状态",-1),l("option",{value:"active"},"有效",-1),l("option",{value:"archived"},"已归档",-1)])],512),[[Xa,at.value]])]),l("label",null,[v[43]||(v[43]=l("span",null,"最低优先级",-1)),xe(l("select",{"onUpdate:modelValue":v[4]||(v[4]=A=>pa.value=A)},[...v[42]||(v[42]=[l("option",{value:0},"不限",-1),l("option",{value:50},"≥ 50",-1),l("option",{value:80},"≥ 80",-1),l("option",{value:100},"100",-1)])],512),[[Xa,pa.value,void 0,{number:!0}]])]),l("button",{type:"button",onClick:E},"清除筛选")])]),S.value&&!F.value.length?(m(),y("div",r2,[(m(),y(Q,null,re(4,A=>l("span",{key:A})),64))])):I.value.length?(m(),y("div",i2,[(m(!0),y(Q,null,re(I.value,A=>(m(),y("button",{key:A.material_id,type:"button",class:"advanced-material-card",onClick:we=>aa(A.import_id)},[l("span",u2,[l("span",null,[_t(A)?(m(),y("img",{key:0,src:_t(A),alt:`${A.display_name} 源图`},null,8,d2)):(m(),y("i",c2,"源图"))]),l("span",null,[tl(A)?(m(),y("img",{key:0,src:tl(A),alt:`${A.display_name} 验证图`},null,8,f2)):(m(),y("i",v2,"验证图"))])]),l("span",p2,[l("small",null,"进阶素材 · "+p(hl(A.category_id)),1),l("strong",null,p(A.display_name),1),l("em",null,p(A.prompt||"已封存高优先级生成胶囊"),1)]),l("span",m2,[l("b",null,"优先级 "+p(A.priority),1),(m(!0),y(Q,null,re(A.tags.slice(0,2),we=>(m(),y("b",{key:we},p(we),1))),128))])],8,s2))),128))])):(m(),y("div",g2,[v[44]||(v[44]=l("strong",null,"还没有封存的进阶素材",-1)),v[45]||(v[45]=l("p",null,"导入一张参考图,经过识别、验证生图和人工还原度审核后才会进入这里。",-1)),l("button",{type:"button",class:"primary",onClick:v[5]||(v[5]=A=>i("navigate","advanced-import"))},"开始第一次进阶导入")]))]),l("aside",y2,[l("header",_2,[v[46]||(v[46]=l("div",null,[l("span",null,"验证流水线"),l("h3",null,"最近导入")],-1)),l("button",{type:"button",disabled:S.value,onClick:v[6]||(v[6]=A=>yt())},p(S.value?"刷新中":"刷新"),9,b2)]),ae.value.length?(m(),y("div",w2,[(m(!0),y(Q,null,re(ae.value,A=>(m(),y("button",{key:A.import_id,type:"button",class:fe(["advanced-import-list-item",{active:_.value===A.import_id}]),onClick:we=>aa(A.import_id)},[l("span",{class:fe(["status-dot",se(ar)(A.status).tone])},null,2),l("span",null,[l("strong",null,p(A.display_name),1),l("small",null,p(se(ar)(A.status).label)+" · "+p(Jt(A.updated_at)),1)])],10,h2))),128))])):(m(),y("div",k2,[...v[47]||(v[47]=[l("p",null,"暂无导入记录。",-1)])]))])])],64)):(m(),y("section",$2,[l("article",C2,[l("header",S2,[v[48]||(v[48]=l("div",null,[l("span",null,"进阶素材导入"),l("h3",null,"上传源图并验证还原度"),l("p",null,"视觉模型先提取关键词和提示词,再由生图模型生成独立验证图;只有人工确认后才会封存。")],-1)),l("button",{type:"button",onClick:v[7]||(v[7]=A=>i("navigate","advanced"))},"返回进阶素材库")]),l("div",I2,[l("div",{class:"advanced-upload-dropzone",tabindex:"0",onClick:$o,onKeydown:[Qt(ze($o,["prevent"]),["enter"]),Qt(ze($o,["prevent"]),["space"])],onPaste:Ut,onDragover:v[9]||(v[9]=ze(()=>{},["prevent"])),onDrop:ze(Za,["prevent"])},[kt.value&&oe.value.length?(m(),y("div",x2,[(m(!0),y(Q,null,re(oe.value,(A,we)=>(m(),y("figure",{key:A.id},[l("img",{src:A.dataUrl,alt:`画风样本 ${we+1}`},null,8,A2),l("figcaption",null,[l("strong",null,p(we===0?"主参考":`样本 ${we+1}`),1),l("small",null,p(A.file.name),1)]),l("div",{class:"advanced-style-upload-actions",onClick:v[8]||(v[8]=ze(()=>{},["stop"]))},[l("button",{type:"button",disabled:we===0,"aria-label":`将样本 ${we+1} 前移`,title:"前移;移到首位即设为主参考",onClick:ze(Te=>Xn(A.id,-1),["stop"])},"←",8,M2),l("button",{type:"button",disabled:we===oe.value.length-1,"aria-label":`将样本 ${we+1} 后移`,title:"后移",onClick:ze(Te=>Xn(A.id,1),["stop"])},"→",8,R2),l("button",{type:"button","aria-label":`移除样本 ${we+1}`,title:"移除",onClick:ze(Te=>Co(A.id),["stop"])},"×",8,E2)])]))),128)),oe.value.length<_i?(m(),y("span",N2,[...v[49]||(v[49]=[l("b",null,"+",-1),l("small",null,"继续添加",-1)])])):H("",!0)])):!kt.value&&Ea.value?(m(),y("img",{key:1,src:Ea.value,alt:"待导入素材预览"},null,8,T2)):(m(),y("span",B2,[l("b",null,p(kt.value?"粘贴、拖入或选择 2~8 张画风样本":"粘贴、拖入或选择图片"),1),l("small",null,"PNG / JPEG / WebP,单张不超过 20 MB"+p(kt.value?";推荐 3~6 张":""),1)])),!kt.value&&de.value?(m(),y("em",L2,p(de.value.name)+" · "+p((de.value.size/1024/1024).toFixed(2))+" MB",1)):H("",!0),l("input",{ref_key:"fileInput",ref:ue,type:"file",accept:"image/*",multiple:kt.value,hidden:"",onChange:Jn},null,40,q2)],40,P2),l("form",{class:"advanced-upload-form",onSubmit:ze(Ti,["prevent"])},[l("label",null,[v[50]||(v[50]=l("span",null,"素材名称",-1)),xe(l("input",{"onUpdate:modelValue":v[10]||(v[10]=A=>J.value=A),type:"text",maxlength:"120",placeholder:"例如:银白冬季斗篷"},null,512),[[je,J.value]])]),l("label",null,[v[52]||(v[52]=l("span",null,"素材分类",-1)),xe(l("select",{"onUpdate:modelValue":v[11]||(v[11]=A=>W.value=A)},[v[51]||(v[51]=l("option",{value:"",disabled:""},"选择现有分类",-1)),(m(!0),y(Q,null,re(Lt.value,A=>(m(),y("option",{key:A.category_id,value:A.category_id},p(se(Ii)(A.name)),9,D2))),128))],512),[[Xa,W.value]]),kt.value?(m(),y("small",O2,"风格分类启用多图交叉提取;每张图独立并行识别,验证阶段不传任何源图。")):H("",!0)]),l("dl",null,[l("div",null,[v[53]||(v[53]=l("dt",null,"处理方式",-1)),l("dd",null,p(kt.value?"并行逐图识别 → 多图交叉分析 → 三场景纯文本验证 → 人工封存":"视觉识别 → 验证生图 → 人工对照 → 独立封存"),1)]),v[54]||(v[54]=l("div",null,[l("dt",null,"存储隔离"),l("dd",null,"源图和验证轮次不会进入普通素材库、图库或角色候选池")],-1)),l("div",null,[l("dt",null,p(kt.value?"迁移验证":"检索优先级"),1),l("dd",null,p(kt.value?"使用完全不同的角色、场景和构图,只用提示词验证画风泛化能力":"封存后在自动检索中优先于普通素材,显式选择仍以用户选择为准"),1)])]),l("div",W2,[kt.value?(m(),y("span",U2,p(oe.value.length)+"/"+p(_i)+" 张",1)):H("",!0),l("button",{type:"button",disabled:!de.value&&!oe.value.length||!!T.value,onClick:Ft},"清空",8,F2),l("button",{type:"submit",class:"primary",disabled:!Dt.value},p(T.value==="upload"?"提交中":kt.value?"并行识别画风样本":"提交识别与验证"),9,j2)])],32)])]),l("aside",K2,[l("header",V2,[v[55]||(v[55]=l("div",null,[l("span",null,"继续处理"),l("h3",null,"最近导入")],-1)),l("button",{type:"button",disabled:S.value,onClick:v[12]||(v[12]=A=>yt())},"刷新",8,G2)]),ae.value.length?(m(),y("div",z2,[(m(!0),y(Q,null,re(ae.value,A=>(m(),y("button",{key:A.import_id,type:"button",class:fe(["advanced-import-list-item",{active:_.value===A.import_id}]),onClick:we=>aa(A.import_id)},[l("span",{class:fe(["status-dot",se(ar)(A.status).tone])},null,2),l("span",null,[l("strong",null,p(A.display_name),1),l("small",null,p(se(ar)(A.status).label),1)])],10,H2))),128))])):(m(),y("div",Q2,[...v[56]||(v[56]=[l("p",null,"提交后的识别和验证任务会显示在这里。",-1)])]))])])),P.value?(m(),y("section",Y2,[l("header",J2,[l("div",null,[v[57]||(v[57]=l("span",null,"还原度验证工作台",-1)),l("h3",null,p(P.value.display_name),1),l("p",null,p(hl(P.value.category_id))+" · 导入于 "+p(Jt(P.value.created_at)),1)]),l("div",X2,[l("button",{type:"button",onClick:v[13]||(v[13]=A=>R.value=!R.value)},p(R.value?"收起工作台":"展开工作台"),1),l("div",{class:fe(["advanced-status-chip",Be.value.tone])},[v[58]||(v[58]=l("i",null,null,-1)),l("span",null,[l("strong",null,p(Be.value.label),1),l("small",null,p(Be.value.detail),1)])],2),t.canManage&&!P.value.accepted_material_id?(m(),y("button",{key:0,type:"button",class:"danger",disabled:!!T.value,onClick:dr},p(T.value==="delete-import"?"删除中":X.value===P.value.import_id?"确认删除导入":"删除导入"),9,Z2)):H("",!0)])]),B.value?(m(),y("div",eS,"正在读取识别结果与验证轮次…")):R.value?(m(),y(Q,{key:1},[pn(P.value)||Re(j.value)?(m(),y("div",tS,[l("div",null,[v[59]||(v[59]=l("strong",null,"任务错误",-1)),l("span",null,p(Re(j.value)||pn(P.value)),1)]),["failed","recognition_failed","validation_failed","style_consensus_failed"].includes($t(P.value.status))?(m(),y("button",{key:0,type:"button",disabled:!!T.value,onClick:Bs},p(T.value==="retry"?"重试中":"重试当前阶段"),9,aS)):H("",!0)])):H("",!0),U.value?(m(),y("section",nS,[l("article",lS,[l("header",oS,[l("div",null,[v[60]||(v[60]=l("span",null,"01 · 并行识别",-1)),l("h4",null,"画风样本 "+p(Z.value.length)+"/"+p(ie.value.length||ve.value.length)+" 已完成",1),v[61]||(v[61]=l("p",null,"每张图片拥有独立任务、计时器和错误;失败不会中断其他样本。",-1))]),l("label",rS,[v[63]||(v[63]=l("span",null,"交叉归纳",-1)),xe(l("select",{"onUpdate:modelValue":v[14]||(v[14]=A=>ft.value=A),disabled:!!T.value},[...v[62]||(v[62]=[l("option",{value:"text_only"},"纯文本(推荐,避免视觉超时)",-1),l("option",{value:"vision_assisted"},"带图归纳(更强视觉复核)",-1)])],8,iS),[[Xa,ft.value]])]),Yn.value?(m(),y("button",{key:0,type:"button",class:"primary",onClick:Pn},p(T.value==="style-consensus"?"入队中":"交叉分析有效样本"),1)):H("",!0)]),l("div",sS,[(m(!0),y(Q,null,re(ve.value,(A,we)=>(m(),y("article",{key:A.source_id,class:fe({excluded:A.excluded})},[l("div",uS,[Yl(A)?(m(),y("img",{key:0,src:Yl(A),alt:`画风样本 ${we+1}`,role:"button",tabindex:"0",title:"点击查看大图",onClick:Te=>Vt(al(A),A.is_primary?"主参考图":`画风样本 ${we+1}`),onKeydown:[Qt(ze(Te=>Vt(al(A),A.is_primary?"主参考图":`画风样本 ${we+1}`),["prevent"]),["enter"]),Qt(ze(Te=>Vt(al(A),A.is_primary?"主参考图":`画风样本 ${we+1}`),["prevent"]),["space"])]},null,40,dS)):(m(),y("span",cS,"源图准备中"))]),l("div",fS,[l("span",{class:fe(["status-dot",Po(A)])},null,2),l("strong",null,p(A.is_primary?"主参考图":`样本 ${we+1}`),1),l("small",null,p(Io(A)),1),l("p",null,p(A.recognition_prompt||"等待视觉模型完成独立画风分析。"),1),se(yi)(A.error)?(m(),y("em",vS,p(se(yi)(A.error)),1)):H("",!0)]),t.canManage&&Wt.value?(m(),y("div",pS,[$t(A.status)==="failed"?(m(),y("button",{key:0,type:"button",disabled:!!T.value,onClick:Te=>Zn(A)},p(T.value===`source-retry:${A.source_id}`?"入队中":"单独重试"),9,mS)):H("",!0),!A.is_primary&&!A.excluded?(m(),y("button",{key:1,type:"button",disabled:!!T.value,onClick:Te=>nt(A)},p(T.value===`source-exclude:${A.source_id}`?"处理中":"排除"),9,gS)):H("",!0),!A.is_primary&&A.excluded?(m(),y("button",{key:2,type:"button",disabled:!!T.value,onClick:Te=>nt(A,!1)},p(T.value===`source-exclude:${A.source_id}`?"处理中":"恢复"),9,yS)):H("",!0)])):H("",!0)],2))),128))]),Z.value.length<Gc?(m(),y("p",_S,"至少需要 2 张有效样本才能交叉分析;失败样本可以单独重试或排除。")):H("",!0),Yn.value||t.canManage?(m(),y("div",bS,[l("div",wS,[v[65]||(v[65]=l("strong",null,"验证参考图",-1)),l("label",hS,[xe(l("input",{"onUpdate:modelValue":v[15]||(v[15]=A=>ot.value=A),type:"checkbox",disabled:!!T.value},null,8,kS),[[ed,ot.value]]),v[64]||(v[64]=l("span",null,"第一轮验证附带 1 张源图作风格参考",-1))])]),v[66]||(v[66]=l("p",{class:"advanced-style-stage-tip"},"参考图只提供线稿/配色/眼型等风格语法;不会复制人物身份、服装、姿势或场景。头像/全身/异场景共用同一张。",-1)),ot.value?(m(),y("div",$S,[(m(!0),y(Q,null,re(Z.value,(A,we)=>(m(),y("button",{key:`ref:${A.source_id}`,type:"button",class:fe(["advanced-style-reference-card",{active:Ce.value===A.source_id}]),disabled:!!T.value,onClick:Te=>tt.value=A.source_id},[Yl(A)?(m(),y("img",{key:0,src:Yl(A),alt:`参考样本 ${we+1}`},null,8,SS)):(m(),y("span",IS,"样本 "+p(we+1),1)),l("small",null,p(A.is_primary?"主参考":`样本 ${we+1}`),1)],10,CS))),128)),Z.value.length?H("",!0):(m(),y("small",PS,"至少完成 2 张识别后可选择参考图。"))])):H("",!0)])):H("",!0)]),l("article",xS,[l("header",AS,[l("div",null,[v[67]||(v[67]=l("span",null,"02 · 交叉分析",-1)),l("h4",null,"统一画风指纹"+p((L=ee.value)!=null&&L.revision?` · 第 ${ee.value.revision} 版`:""),1),v[68]||(v[68]=l("p",null,"共同画风进入胶囊,可变项降权,人物、服装和场景进入内容污染排除。",-1))]),((le=ee.value)==null?void 0:le.consensus_confidence)!=null?(m(),y("b",MS,"置信度 "+p(Math.round(Number(ee.value.consensus_confidence)*100))+"%",1)):H("",!0)]),ee.value?(m(),y("div",RS,[l("section",null,[v[69]||(v[69]=l("span",null,"核心共同画风",-1)),l("ul",null,[(m(!0),y(Q,null,re(Le(ee.value.consensus_style),A=>(m(),y("li",{key:A},p(A),1))),128)),Le(ee.value.consensus_style).length?H("",!0):(m(),y("li",ES,"交叉任务完成后显示稳定共同特征。"))])]),l("section",null,[v[70]||(v[70]=l("span",null,"可变或弱特征",-1)),l("ul",null,[(m(!0),y(Q,null,re(ee.value.variable_style_features.map(Sa).filter(Boolean),A=>(m(),y("li",{key:A},p(A),1))),128)),ee.value.variable_style_features.length?H("",!0):(m(),y("li",NS,"暂无可变特征。"))])]),l("section",null,[v[71]||(v[71]=l("span",null,"内容污染排除",-1)),l("ul",null,[(m(!0),y(Q,null,re(ee.value.content_leakage_exclusions,A=>(m(),y("li",{key:A},p(A),1))),128)),ee.value.content_leakage_exclusions.length?H("",!0):(m(),y("li",TS,"等待模型分离人物、服装、姿势和场景。"))])])])):H("",!0),ee.value?(m(),y("div",BS,[l("span",null,[v[72]||(v[72]=Kn("代表样本 ",-1)),(m(!0),y(Q,null,re(ee.value.representative_source_ids,A=>(m(),y("b",{key:`representative:${A}`},p(rl(A)),1))),128)),ee.value.representative_source_ids.length?H("",!0):(m(),y("small",LS,"自动选择中"))]),l("span",null,[v[73]||(v[73]=Kn("疑似离群 ",-1)),(m(!0),y(Q,null,re(ee.value.outlier_source_ids,A=>(m(),y("em",{key:`outlier:${A}`},p(rl(A)),1))),128)),ee.value.outlier_source_ids.length?H("",!0):(m(),y("small",qS,"无"))])])):(m(),y("div",DS,"逐图识别达到至少两张后,可启动交叉分析。"))]),l("article",OS,[v[74]||(v[74]=l("header",{class:"advanced-style-stage-header"},[l("div",null,[l("span",null,"03 · 纯文本迁移验证"),l("h4",null,"近域、中域与跨场景案例"),l("p",null,"只发送统一画风提示词,不携带源图;默认使用同一新角色逐级改变构图与场景,文字调整会直接写入下一轮提示词。")]),l("b",{class:"advanced-style-text-only"},"0 张参考图")],-1)),Se.value.length?(m(),y("div",WS,[(m(!0),y(Q,null,re(Se.value,A=>{var we,Te,dt,Gt;return m(),y("article",{key:A.case_id},[l("div",US,[wl(A)?(m(),y("img",{key:0,src:wl(A),alt:wa(A.scenario),role:"button",tabindex:"0",title:"点击查看大图",onClick:$l=>Vt(nl(A),`${P.value.display_name} / ${wa(A.scenario)}`),onKeydown:[Qt(ze($l=>Vt(nl(A),`${P.value.display_name} / ${wa(A.scenario)}`),["prevent"]),["enter"]),Qt(ze($l=>Vt(nl(A),`${P.value.display_name} / ${wa(A.scenario)}`),["prevent"]),["space"])]},null,40,FS)):(m(),y("span",jS,p(ll(A.status)),1))]),l("div",KS,[l("span",null,p(wa(A.scenario)),1),l("strong",null,p(ll(A.status)),1),l("p",null,p(A.content_prompt||"后端将规划与源样本不同、但便于对照的验证角色与场景。"),1),(we=A.metadata)!=null&&we.validation_instruction?(m(),y("small",VS,"已应用文字调整:"+p(A.metadata.validation_instruction),1)):H("",!0),Zl(A)!=null?(m(),y("small",GS,"自动还原度:"+p(Zl(A))+"%",1)):H("",!0),Zl(A)!=null?(m(),y("small",zS,p(pr(A)),1)):H("",!0),ol(A)?(m(),y("small",HS,p(ol(A)),1)):H("",!0),l("small",null,p(Number(A.input_image_count||((Te=A.metadata)==null?void 0:Te.input_image_count)||0)>0||(dt=A.metadata)!=null&&dt.reference_image_applied?"风格参考图验证":"纯文本验证")+" · "+p(Number(A.input_image_count||((Gt=A.metadata)==null?void 0:Gt.input_image_count)||0))+" 张参考图 · 种子 "+p(A.seed||"自动"),1),se(yi)(A.error)?(m(),y("em",QS,p(se(yi)(A.error)),1)):H("",!0)]),$t(A.status)==="failed"?(m(),y("button",{key:0,type:"button",disabled:!!T.value,onClick:$l=>Ta(A)},p(T.value===`case-retry:${A.case_id}`?"入队中":"单独重试"),9,YS)):H("",!0)])}),128))])):(m(),y("div",JS,"完成交叉分析后会同时生成头像、全身和异场景三项验证。"))])])):(m(),y("div",XS,[l("article",null,[v[75]||(v[75]=l("span",null,"识别提示词",-1)),l("p",null,p(P.value.recognition_prompt||"视觉模型识别完成后会显示在这里。"),1)]),l("article",null,[v[76]||(v[76]=l("span",null,"负向约束",-1)),l("p",null,p(P.value.recognition_negative_prompt||"暂无负向约束。"),1)]),l("article",null,[v[77]||(v[77]=l("span",null,"识别标签",-1)),l("div",null,[(m(!0),y(Q,null,re(P.value.recognition_tags,A=>(m(),y("b",{key:A},p(A),1))),128)),P.value.recognition_tags.length?H("",!0):(m(),y("small",ZS,"等待识别"))])])])),U.value?H("",!0):(m(),y("div",eI,[l("figure",null,[l("div",null,[_t(P.value)?(m(),y("img",{key:0,src:_t(P.value),alt:`${P.value.display_name} 源图`,role:"button",tabindex:"0",title:"点击查看大图",onClick:v[16]||(v[16]=A=>Vt(al(P.value),`${P.value.display_name} / 源图`)),onKeydown:[v[17]||(v[17]=Qt(ze(A=>Vt(al(P.value),`${P.value.display_name} / 源图`),["prevent"]),["enter"])),v[18]||(v[18]=Qt(ze(A=>Vt(al(P.value),`${P.value.display_name} / 源图`),["prevent"]),["space"]))]},null,40,tI)):(m(),y("span",aI,"源图正在准备"))]),v[78]||(v[78]=l("figcaption",null,[l("strong",null,"源图"),l("small",null,"独立保存的识别依据")],-1))]),l("figure",null,[l("div",null,[j.value&&Ql(j.value)?(m(),y("img",{key:0,src:Ql(j.value),alt:`${P.value.display_name} 验证图`,role:"button",tabindex:"0",title:"点击查看大图",onClick:v[19]||(v[19]=A=>Vt(ja(j.value),`${P.value.display_name} / 第 ${j.value.attempt_number} 轮验证图`)),onKeydown:[v[20]||(v[20]=Qt(ze(A=>Vt(ja(j.value),`${P.value.display_name} / 第 ${j.value.attempt_number} 轮验证图`),["prevent"]),["enter"])),v[21]||(v[21]=Qt(ze(A=>Vt(ja(j.value),`${P.value.display_name} / 第 ${j.value.attempt_number} 轮验证图`),["prevent"]),["space"]))]},null,40,nI)):(m(),y("span",lI,p(Qe.value.busy?"验证图生成中":"尚未生成验证图"),1))]),l("figcaption",null,[l("strong",null,"验证图 · 第 "+p(((Me=j.value)==null?void 0:Me.attempt_number)||0)+" 轮",1),l("small",null,p(j.value?Qe.value.label:"等待首轮验证"),1)])])])),l("div",oI,[U.value?(m(),y("div",rI,[l("label",iI,[v[79]||(v[79]=l("span",null,"画风修正(选填)",-1)),xe(l("textarea",{"onUpdate:modelValue":v[22]||(v[22]=A=>D.value=A),rows:"4",maxlength:"2000",placeholder:"例如:加强干净细线与两阶赛璐璐阴影,降低暖色滤镜;高光更锐利。"},null,512),[[je,D.value]]),l("small",null,p(D.value.length)+"/2000 · 只修改画风共识与胶囊;未填写验证内容时沿用相同场景和种子做 A/B 对比。",1)]),l("label",sI,[v[80]||(v[80]=l("span",null,"下一轮验证内容(选填)",-1)),xe(l("textarea",{"onUpdate:modelValue":v[23]||(v[23]=A=>q.value=A),rows:"4",maxlength:"2000",placeholder:"例如:女性角色,全身,萌袖卫衣、泡泡袜和运动鞋,白发蓝瞳猫耳;三个案例保持同一角色。"},null,512),[[je,q.value]]),l("small",null,p(q.value.length)+"/2000 · 会直接写入三个生图提示词,并为新内容使用新的随机种子,不再复用旧场景。",1)])])):(m(),y("label",uI,[l("span",null,p(Ot.value?"不还原时,说明下一轮怎样调整":"验证描述补充(可选)"),1),xe(l("textarea",{"onUpdate:modelValue":v[24]||(v[24]=A=>D.value=A),rows:"4",maxlength:"2000",placeholder:"例如:斗篷应更长,领口是银色毛边;保持原图的蓝灰配色,不要改变材质。"},null,512),[[je,D.value]]),l("small",null,p(D.value.length)+"/2000 · 描述会叠加在识别提示词上,并保留每一轮历史。",1)])),Ot.value?(m(),y("div",dI,[l("label",null,[l("span",null,"主观还原度 "+p(Ye.value)+"%",1),xe(l("input",{"onUpdate:modelValue":v[25]||(v[25]=A=>Ye.value=A),type:"range",min:"0",max:"100",step:"1"},null,512),[[je,Ye.value,void 0,{number:!0}]])]),l("label",null,[v[81]||(v[81]=l("span",null,"审核备注(可选)",-1)),xe(l("input",{"onUpdate:modelValue":v[26]||(v[26]=A=>Ne.value=A),type:"text",maxlength:"500",placeholder:"记录接受或拒绝本轮的理由"},null,512),[[je,Ne.value]])]),l("label",cI,[xe(l("input",{"onUpdate:modelValue":v[27]||(v[27]=A=>it.value=A),type:"checkbox"},null,512),[[ed,it.value]]),l("span",null,p(U.value?"我已检查近域、中域和跨场景结果,确认画风可以脱离源图迁移并封存。":"我已并排比较源图与验证图,确认可以封存为进阶素材。"),1)])])):H("",!0),l("div",fI,[ba.value&&!Ot.value?(m(),y("button",{key:0,type:"button",class:"primary",disabled:!!T.value,onClick:Tt},p(T.value==="validation"?"入队中":j.value?"重新生成验证图":"生成首轮验证图"),9,vI)):H("",!0),Ot.value?(m(),y(Q,{key:1},[l("button",{type:"button",class:"warn",disabled:!!T.value||!D.value.trim()&&!q.value.trim(),onClick:Fa},p(T.value==="reject"?"提交中":U.value?"应用文字调整并生成下一轮":"不够还原,按描述重试"),9,pI),l("button",{type:"button",class:"primary",disabled:!!T.value||!it.value,onClick:zl},p(T.value==="accept"?"封存中":U.value?"确认迁移能力并封存":"确认还原并封存"),9,mI)],64)):H("",!0),Be.value.busy?(m(),y("span",gI,"任务已在后台执行,离开页面不会中断;本页会自动刷新状态。")):H("",!0)])]),z.value.length?(m(),y("details",yI,[l("summary",null,"验证轮次历史 · "+p(z.value.length)+" 轮",1),l("div",null,[(m(!0),y(Q,null,re(z.value,A=>{var we;return m(),y("article",{key:A.attempt_id},[l("span",{class:fe(["status-dot",se(us)(A.status).tone])},null,2),l("div",null,[l("strong",null,"第 "+p(A.attempt_number)+" 轮 · "+p(se(us)(A.status).label),1),l("p",null,p(A.adjustment_text||"使用识别结果生成首轮验证图"),1),l("small",null,p(A.provider_id||"自动路由")+" / "+p(A.provider_model||A.model_route||"默认生图模型")+" · "+p(Jt(A.updated_at)),1),Re(A)?(m(),y("em",_I,p(Re(A)),1)):H("",!0)]),(we=A.validation_cases)!=null&&we.length?(m(),y("div",bI,[(m(!0),y(Q,null,re(A.validation_cases,Te=>(m(),y("figure",{key:Te.case_id},[wl(Te)?(m(),y("img",{key:0,src:wl(Te),alt:`第 ${A.attempt_number} 轮 ${wa(Te.scenario)}`,role:"button",tabindex:"0",title:"点击查看大图",onClick:dt=>Vt(nl(Te),`${P.value.display_name} / 第 ${A.attempt_number} 轮 / ${wa(Te.scenario)}`),onKeydown:[Qt(ze(dt=>Vt(nl(Te),`${P.value.display_name} / 第 ${A.attempt_number} 轮 / ${wa(Te.scenario)}`),["prevent"]),["enter"]),Qt(ze(dt=>Vt(nl(Te),`${P.value.display_name} / 第 ${A.attempt_number} 轮 / ${wa(Te.scenario)}`),["prevent"]),["space"])]},null,40,wI)):(m(),y("span",hI,p(ll(Te.status)),1)),l("figcaption",null,p(wa(Te.scenario)),1)]))),128))])):Ql(A)?(m(),y("img",{key:1,src:Ql(A),alt:`第 ${A.attempt_number} 轮验证图`,role:"button",tabindex:"0",title:"点击查看大图",onClick:Te=>Vt(ja(A),`${P.value.display_name} / 第 ${A.attempt_number} 轮验证图`),onKeydown:[Qt(ze(Te=>Vt(ja(A),`${P.value.display_name} / 第 ${A.attempt_number} 轮验证图`),["prevent"]),["enter"]),Qt(ze(Te=>Vt(ja(A),`${P.value.display_name} / 第 ${A.attempt_number} 轮验证图`),["prevent"]),["space"])]},null,40,kI)):H("",!0)])}),128))])])):H("",!0)],64)):H("",!0)])):H("",!0),We(zg,{open:!!te.value,title:Ae.value,src:te.value,onClose:cr},null,8,["open","title","src"])])}}}),SI=Kr(CI,[["__scopeId","data-v-9bd15942"]]),ps=[{key:"overview",label:"概览",icon:"□",module:"overview",group:"workspace",description:"查看运行状态与核心指标"},{key:"generate",label:"生成",icon:"+",module:"generate",group:"workspace",description:"创建图片并配置生成参数"},{key:"queue",label:"队列",icon:"≡",module:"queue",group:"workspace",description:"管理等待中和进行中的任务"},{key:"performance",label:"性能",icon:"%",module:"performance",group:"system",description:"分析服务性能与资源使用"},{key:"gallery",label:"图库",icon:"▧",module:"images",group:"assets",description:"浏览和管理生成结果"},{key:"profiles",label:"角色",icon:"◇",module:"profiles",group:"assets",description:"管理角色档案与角色设定"},{key:"materials",label:"素材",icon:"◫",module:"images",group:"assets",description:"整理生成时使用的参考素材"},{key:"settings",label:"设置",icon:"◎",module:"settings",group:"system",description:"配置服务与插件选项"},{key:"logs",label:"日志",icon:"!",module:"logs",group:"system",description:"检查运行记录与异常信息"}],II=["overview","generate","queue","materials","profiles","gallery","performance","settings","logs"],PI=II.map(t=>ps.find(n=>n.key===t)).filter(t=>!!t);function Ts(t){var n;return["ungenerated","quick","profile_card"].includes(t.profile_category??"")?t.profile_category:t.generation_kind==="quick"?"quick":t.generation_kind==="profile_card"||t.generation_kind==="detailed"&&(t.detailed_workflow_state==="archived"||((n=t.metadata)==null?void 0:n.source)==="sample")?"profile_card":"ungenerated"}function d3(t){return{ungenerated:"未生成",quick:"快速角色",profile_card:"档案卡"}[Ts(t)]}function c3(t){return{ungenerated:"只有文本设定",quick:"头像、半身、立绘与设定图",profile_card:"已封存的完整角色资产"}[Ts(t)]}function f3(t){const n=Ts(t);return n==="profile_card"?"good":n==="quick"?"warn":"idle"}function v3(t){const n={in_progress:"详细工作流进行中",ready_to_archive:"等待建立档案卡",archived:"工作流已封存"};return t.detailed_workflow_state?n[t.detailed_workflow_state]:""}function p3(t){return Ts(t)==="profile_card"&&t.detailed_workflow_state==="archived"}function Yg(t){return String(t||"unknown").trim().toLocaleLowerCase()}function m3(t){const n=Yg(t);return{active:"启用中",ready:"可用",enabled:"已启用",draft:"草稿",archived:"已归档",disabled:"已停用",pending:"待完善",running:"进行中",review:"待审核",completed:"已完成",confirmed:"已确认",sample:"预览",failed:"失败",error:"异常",unknown:"未知"}[n]??t??"未知"}function g3(t){const n=Yg(t);return["active","ready","enabled","completed","confirmed"].includes(n)?"good":["draft","pending","running","review"].includes(n)?"warn":["failed","error","disabled"].includes(n)?"bad":"idle"}function y3(t){return t.name.trim().slice(0,1).toLocaleUpperCase()||"?"}function xI(t,n){var i;const o=(i=t.metadata)==null?void 0:i[n];return typeof o=="string"?o.trim():""}function _3(t){const n=xI(t,"source");return n==="sample"?"预览示例":n==="import"?"外部导入":n==="quick_profile"?"快速问卷建档":n||"后端档案"}function b3(t){if(!t)return"-";const n=new Date(t);return Number.isNaN(n.getTime())?t:new Intl.DateTimeFormat("zh-CN",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hour12:!1}).format(n)}function w3(t){return{identity:"角色定位",personality:"性格特征",gender_presentation:"性别表现",age_stage:"年龄阶段",species:"物种 / 种族",body_type:"体型",distinctive_features:"显著特征",identity_lock:"角色一致性锁",identity_lock_hash:"一致性锁摘要",source:"档案来源",system_key:"系统标识",tags:"标签",aliases:"别名"}[t]??t.replaceAll("_"," ")}function h3(t){if(Array.isArray(t))return t.map(n=>String(n)).join("、")||"-";if(typeof t=="object")try{return JSON.stringify(t)}catch{return String(t)}return String(t)}function k3(t){return/^(?:https?:|data:|blob:|\/)/i.test(String(t||"").trim())}function AI(){return{roleCore:"近未来港区巡查员,负责夜间巡逻和异常记录。",genderPresentation:"female",ageStage:"adult",species:"human",bodyType:"athletic",distinctiveFeatures:"发光臂章,青绿色眼睛",personality:"冷静、可靠、行动快,外冷内热。",appearance:"黑色短发,青绿色眼睛,轻机能外套。",outfit:"短靴、发光臂章、便携通讯设备。",scene:"星港、雨夜街区、巡查终端、航灯背景。",avoid:"过度复杂、低清晰度、肢体结构错误。",worldview:"",background:"",heightBuild:"",bodyFeatures:"",likes:"",dislikes:"",habits:"",relationships:"",storyHooks:"",generationStyle:"",shotPreference:"",mood:"",extraNotes:""}}function MI(){return{roleCore:"",genderPresentation:"",ageStage:"",species:"",bodyType:"",distinctiveFeatures:"",personality:"",appearance:"",outfit:"",scene:"",avoid:"",worldview:"",background:"",heightBuild:"",bodyFeatures:"",likes:"",dislikes:"",habits:"",relationships:"",storyHooks:"",generationStyle:"",shotPreference:"",mood:"",extraNotes:""}}function RI(t){const n=new Set;if(!t)return{...MI(),recognizedKeys:[]};const o=Ku(t,["姓名","名字","角色名","名称","name","character name"]),i=Ku(t,["身份","职业","定位","种族","role","identity","occupation"]),u=Ku(t,["角色核心","人设","简介","设定","介绍","profile","summary","description","brief"]),d=Jg(t,["角色","身份","职业","来自","负责","name","role"]),g=NI([o,i,u]).join(",")||d||t.slice(0,220);g&&n.add("roleCore");const _=zt(t,["性别","性别表现","性别呈现","gender","gender presentation","sex"],["男性","女性","男生","女生","男","女","male","female","androgynous","nonbinary"],""),h=zt(t,["年龄","年龄段","年龄阶段","age","age stage"],["少年","少女","青年","成年","中年","老年","teen","young adult","adult","middle-aged","elderly"],""),R=zt(t,["种族","物种","族群","species","race"],["人类","精灵","兽人","机械","机器人","仿生人","human","elf","android","robot"],""),S=zt(t,["体型","身材","身体类型","body type","build"],["纤细","匀称","健壮","高挑","娇小","丰满","slim","athletic","muscular","petite","curvy"],""),B=zt(t,["显著特征","标志特征","视觉记忆点","记忆点","distinctive features","signature features"],["伤疤","痣","纹身","义体","异色瞳","角","尾巴","scar","tattoo","heterochromia"],""),T=zt(t,["性格","人格","个性","personality","trait","traits"],["冷静","开朗","温和","敏锐","可靠","慢热","强势","沉稳","活泼","内向","外向"],"性格关键词待从原文继续整理"),X=zt(t,["外观","外貌","长相","发色","发型","眼睛","瞳色","appearance","look","hair","eyes"],["发","眼","身高","体型","肤色","瞳","长发","短发","刘海"],"外观特征待从原文继续整理"),G=zt(t,["服装","衣着","穿着","配饰","outfit","clothing","accessory","accessories"],["外套","裙","靴","制服","配饰","项链","手套","披风","夹克","耳饰"],"服装与配饰待从原文继续整理"),K=zt(t,["场景","背景","世界观","日常","scene","background","world","setting"],["城市","港区","学院","战场","雨夜","实验室","森林","房间","街区"],"常用场景待补充"),ye=zt(t,["避雷","禁用","负面","不要","negative","avoid"],["不要","避免","禁止","低质量","崩坏","血腥","恐怖"],"低质量、结构错误、过度复杂、与角色设定冲突"),me=zt(t,["世界观","时代","地点","setting","world","worldview"],["现代","赛博","奇幻","末世","校园","古风","星际","王国","都市"],""),te=zt(t,["背景","经历","过去","身世","background","history","backstory"],["曾经","出生","来自","经历","过去","现在","目前"],""),Ae=zt(t,["身高","身材","体型","height","build","body type"],["cm","厘米","高挑","娇小","纤细","健壮","匀称","丰满"],""),ue=zt(t,["记忆点","特征","伤疤","纹身","义体","body feature","mark"],["伤疤","痣","纹身","义体","异色瞳","尖耳","机械","尾巴","角"],""),de=zt(t,["喜好","喜欢","爱好","likes","hobby","hobbies"],["喜欢","擅长","热爱","收藏","常喝","常吃"],""),De=zt(t,["不喜欢","讨厌","害怕","dislikes","fear","fears"],["不喜欢","讨厌","害怕","排斥","恐惧"],""),ne=zt(t,["习惯","生活习惯","日常","habit","routine"],["习惯","总是","经常","每天","熬夜","洁癖"],""),oe=zt(t,["关系","同伴","亲友","敌人","relationship","relationships"],["朋友","同伴","家人","敌人","导师","搭档","组织"],""),J=zt(t,["目标","秘密","故事钩子","主线","goal","secret","plot"],["目标","秘密","寻找","保护","复仇","调查","逃亡"],""),W=zt(t,["画风","美术风格","style","art style"],["插画","厚涂","赛璐璐","写实","电影感","水彩","像素"],""),D=zt(t,["镜头","构图","视角","shot","composition"],["头像","半身","全身","立绘","正面","侧面","俯视","仰视"],""),q=zt(t,["氛围","情绪","气质","mood","atmosphere"],["明亮","压抑","柔和","危险","神圣","冷峻","温暖","孤独"],""),Ne=zt(t,["补充","备注","其他","note","notes"],["补充","备注","另外","其他"],"");for(const[Ye,it]of Object.entries({genderPresentation:_,ageStage:h,species:R,bodyType:S,distinctiveFeatures:B,personality:T,appearance:X,outfit:G,scene:K,avoid:ye,worldview:me,background:te,heightBuild:Ae,bodyFeatures:ue,likes:de,dislikes:De,habits:ne,relationships:oe,storyHooks:J,generationStyle:W,shotPreference:D,mood:q,extraNotes:Ne}))it.recognized&&n.add(Ye);return{roleCore:g,genderPresentation:EI(_.value),ageStage:h.value,species:R.value,bodyType:S.value,distinctiveFeatures:B.value,personality:T.value,appearance:X.value,outfit:G.value,scene:K.value,avoid:ye.value,worldview:me.value,background:te.value,heightBuild:Ae.value,bodyFeatures:ue.value,likes:de.value,dislikes:De.value,habits:ne.value,relationships:oe.value,storyHooks:J.value,generationStyle:W.value,shotPreference:D.value,mood:q.value,extraNotes:Ne.value,recognizedKeys:Array.from(n)}}function EI(t){const n=t.trim().toLocaleLowerCase();return n?["男","男性","男生","male","man","boy"].some(o=>n.includes(o))?"male":["女","女性","女生","female","woman","girl"].some(o=>n.includes(o))?"female":["非二元","nonbinary","non-binary"].some(o=>n.includes(o))?"nonbinary":["中性","androgynous"].some(o=>n.includes(o))?"androgynous":n:""}function zt(t,n,o,i){const u=Ku(t,n);if(u)return{value:u,recognized:!0};const d=Jg(t,o);return d?{value:d,recognized:!0}:{value:i,recognized:!1}}function Ku(t,n){const o=t.split(/\r?\n/).map(d=>d.trim()).filter(Boolean),i=n.map(TI).join("|"),u=new RegExp(`^\\s*(?:[-*•]|\\d+[.)、])?\\s*(?:["'“”\\[【])?(?:${i})(?:["'“”\\]】])?\\s*[::=]\\s*(.+)$`,"i");for(const d of o){const g=d.match(u);if(g!=null&&g[1])return Ps(g[1])}return null}function Jg(t,n){return t.split(/\r?\n/).map(u=>u.trim()).filter(Boolean).filter(u=>n.some(d=>u.toLowerCase().includes(d.toLowerCase()))).map(u=>Ps(u.replace(/^\s*(?:[-*•]|[0-9]+[.)、])\s*/,""))).filter(Boolean).slice(0,3).join(";")}function NI(t){const n=new Set;return t.map(o=>o?Ps(o):"").filter(o=>!o||n.has(o)?!1:(n.add(o),!0))}function Ps(t){return t.replace(/^[\s"'“”`【】[\]]+/,"").replace(/[\s"'“”`,,;;]+$/,"").trim()}function TI(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const BI={half_body:"upper_body",expression_sheet:"turnaround",pose_sheet:"design_sheet",final_pack:"profile_card"};function lr(t){return BI[t]??t}const LI={profile_brief:"persona-split",prompt_plan:"prompt-plan",material_bind:"material-bind",headshot:"portrait-01",upper_body:"portrait-02",lower_body:"lower-body",full_body:"fullbody-01",turnaround:"sheet-split",design_sheet:"detail-hands-01",style_lock:"hires-fix",profile_card:"archive"},qI={fast_profile:"persona-split",fast_candidates:"portrait-01",fast_final:"archive"};function zc(t){const n=lr(t);return LI[n]??qI[t]}const Am=[{id:"persona-split",canonicalNodeKey:"profile_brief",title:"LLM 拆解设定",detail:"把已导入的人设拆成身份、性格、外观、服装和稳定性约束。",badge:"LLM",phase:"设定拆解"},{id:"prompt-plan",canonicalNodeKey:"prompt_plan",title:"提示词规划",detail:"为头像、半身、全身和设定图规划正向提示词、负向提示词与继承规则。",badge:"Prompt",phase:"提示词规划"},{id:"material-bind",canonicalNodeKey:"material_bind",title:"参考素材绑定",detail:"绑定风格、构图、服装、鞋袜和配饰参考,并写入后续节点。",badge:"Material",phase:"素材绑定"},{id:"portrait-01",canonicalNodeKey:"headshot",title:"头像草稿",detail:"生成并确认角色五官、发型、眼睛和基础表情。",badge:"Image",phase:"头像"},{id:"portrait-02",canonicalNodeKey:"upper_body",title:"上半身像",detail:"在头像锚点基础上生成上半身服装、姿态和轮廓。",badge:"Image",phase:"上半身"},{id:"lower-body",canonicalNodeKey:"lower_body",title:"下半身像",detail:"确认腰胯、腿部比例、鞋袜与下半身服装细节。",badge:"Image",phase:"下半身"},{id:"fullbody-01",canonicalNodeKey:"full_body",title:"全身设定",detail:"生成完整服装、身体比例、鞋袜和主要配饰。",badge:"Image",phase:"全身"},{id:"sheet-split",canonicalNodeKey:"turnaround",title:"三视图",detail:"生成正面、侧面和背面视图,并保持体型与服装结构一致。",badge:"Sheet",phase:"三视图"},{id:"detail-hands-01",canonicalNodeKey:"design_sheet",title:"设定图",detail:"汇总表情、姿势、手部、配饰和可复用设计细节。",badge:"Sheet",phase:"设定图"},{id:"hires-fix",canonicalNodeKey:"style_lock",title:"高清修复与统一风格",detail:"统一角色身份和画面风格,并完成高清修复。",badge:"Hires",phase:"风格锁定"},{id:"archive",canonicalNodeKey:"profile_card",title:"建立角色档案卡",detail:"校验并封存头像、人设文档、人设图、立绘、PV 图与完整工作流记录。",badge:"Archive",phase:"档案卡"}];function ad(t){return typeof t=="string"?t.trim():""}function DI(t){const n=[["override",t.overrideRoute],["round",t.roundRoute],["node",t.nodeRoute],["assignment",t.assignmentRoute],["profile",t.profileRoute],["system",t.systemRoute]];for(const[o,i]of n){const u=ad(i);if(u)return{route:u,source:o,explicitOverride:o==="override"}}return{route:"",source:"backend",explicitOverride:!1}}function Hc(t){const n=ad(t);return n?{model_route:n}:{}}function OI(t,n){const o=ad(t).toLowerCase(),u={portrait:"headshot",avatar:"headshot",half_body:"upper_body",halfbody:"upper_body",standing:"full_body",fullbody:"full_body",three_view:"turnaround",three_views:"turnaround",character_sheet:"design_sheet",expression_sheet:"design_sheet",pose_sheet:"design_sheet",hires_fix:"style_lock"}[o]||o,d={headshot:"portrait_generation",upper_body:"halfbody_generation",lower_body:"fullbody_generation",full_body:"fullbody_generation",turnaround:"sheet_generation",design_sheet:"sheet_generation",style_lock:"hires_fix"};return d[u]?d[u]:ad(n).toLowerCase()==="generation"?u:""}function Xg(t){return typeof t=="string"?t.trim().toLowerCase():""}function Zg(t,n){const o=Xg(t);return o==="archived"||o==="cancelled"||!!(n!=null&&n.final_archive_history_id||n!=null&&n.sealed_at)}function WI(t,n,o){return Xg(t)==="selected"||Zg(n,o)}function sn(t,n){const o=new Set;return t.filter(i=>{const u=n(i);return o.has(u)?!1:(o.add(u),!0)})}function qr(t){return sn(t,n=>n)}const UI=["data-theme"],FI={class:"workbench","aria-label":"ImageStudio workspace"},jI={class:"topbar"},KI={class:"active-heading"},VI={class:"search-box","data-overlay-root":"search"},GI=["aria-expanded","aria-activedescendant","onKeydown"],zI={key:0,id:"global-search-results",class:"search-results",role:"listbox"},HI=["id","aria-selected","onMouseenter","onMousedown"],QI={key:0},YI={class:"top-actions"},JI=["aria-checked","title"],XI={class:"notification-wrap","data-overlay-root":"notifications"},ZI=["aria-expanded"],eP={key:0},tP={class:"notification-popover"},aP={key:0},nP=["aria-expanded"],lP={class:"log-wrap","data-overlay-root":"logs"},oP=["aria-expanded"],rP={key:0,id:"log-popover",class:"log-popover","data-overlay-root":"logs"},iP={key:"empty",class:"empty-row"},sP=["title"],uP=["disabled"],dP={key:0,id:"palette-panel",class:"palette-panel","data-overlay-root":"palette"},cP=["onClick"],fP={key:0,id:"notification-panel",class:"notification-panel","data-overlay-root":"notifications"},vP={class:"filter-tabs"},pP=["aria-pressed","onClick"],mP=["src"],gP={key:1},yP=["onClick"],_P={key:"empty",class:"empty-row"},bP={key:1,class:"generate-page","data-module":"generate"},wP={class:"generate-hero"},hP={class:"generate-mode-actions","aria-label":"生成模式入口"},kP=["aria-pressed","onClick"],$P={key:0,class:"image-generation-workspace"},CP={class:"image-generation-canvas"},SP={class:"image-preview-panel"},IP={key:0,class:"image-preview-list"},PP=["onClick"],xP={class:"preview-thumb"},AP=["src","alt"],MP={key:1},RP={key:1,class:"image-preview-empty"},EP={class:"image-display-panel"},NP={class:"image-stage"},TP=["title"],BP=["src","alt"],LP={key:1,class:"image-stage-empty"},qP={class:"image-info-card"},DP={class:"image-chat-intro"},OP={class:"prompt-mode-switch",role:"radiogroup","aria-label":"提示词处理方式"},WP=["aria-pressed"],UP=["aria-pressed"],FP={class:"image-composer"},jP={class:"image-composer-input"},KP=["onKeydown"],VP={key:0,class:"image-composer-hint","aria-hidden":"true"},GP={class:"image-last-request"},zP={class:"image-composer-toolbar"},HP={class:"image-composer-left"},QP=["disabled"],YP={class:"model-select-control",title:"选择生图模型"},JP=["disabled"],XP=["value"],ZP={key:0,class:"model-state",role:"status","aria-live":"polite"},ex={key:1,class:"model-state model-state-error",role:"alert"},tx={class:"image-composer-right"},ax=["title","disabled"],nx={key:1,class:"quick-profile-workspace"},lx={class:"quick-profile-layout"},ox={class:"quick-profile-surface quick-profile-library"},rx={class:"quick-profile-section-header"},ix={class:"quick-profile-library-list"},sx=["data-profile-card-id","onClick"],ux={class:"quick-profile-library-thumb"},dx=["src","alt"],cx={class:"quick-profile-library-copy"},fx={class:"quick-profile-library-meta"},vx={class:"quick-profile-surface quick-profile-detail"},px={class:"quick-profile-profile-card"},mx=["title"],gx=["src","alt"],yx={key:1,class:"quick-profile-image-empty"},_x={class:"quick-profile-profile-field name"},bx={class:"quick-profile-profile-field identity"},wx={class:"quick-profile-profile-field style"},hx={class:"quick-profile-profile-field summary"},kx={class:"quick-profile-surface quick-profile-image-panel"},$x={class:"quick-profile-section-header"},Cx={class:"quick-profile-hero-image"},Sx=["title"],Ix=["src","alt"],Px={key:1,class:"quick-profile-image-empty"},xx={class:"quick-profile-image-types"},Ax=["onClick"],Mx=["src","alt"],Rx={key:1,class:"quick-profile-image-empty"},Ex={class:"quick-profile-surface quick-profile-material-zone"},Nx={class:"quick-profile-section-header"},Tx={class:"quick-profile-material-strip"},Bx=["data-material-category","aria-expanded","onClick"],Lx=["src","alt"],qx={key:1,class:"quick-profile-empty-media-mark"},Dx={class:"quick-profile-material-copy"},Ox={class:"quick-profile-material-picker-header"},Wx={key:0,class:"quick-profile-material-picker-groups","aria-label":"配饰分类"},Ux=["onClick"],Fx=["data-material-reference-id","onClick"],jx={class:"quick-profile-material-picker-media"},Kx=["src","alt"],Vx={key:1,class:"quick-profile-empty-media-mark"},Gx={class:"quick-profile-material-picker-copy"},zx={key:0},Hx={class:"quick-profile-material-picker-copy"},Qx={class:"quick-profile-surface quick-profile-command-zone"},Yx={class:"quick-profile-section-header"},Jx={class:"quick-profile-command-list"},Xx={class:"quick-profile-command-top"},Zx={class:"feature-badge"},eA=["disabled"],tA=["disabled"],aA=["onClick"],nA={key:3,class:"feature-action"},lA={key:0,class:"generation-notice",role:"status","aria-live":"polite"},oA={key:1,class:"generation-error",role:"alert"},rA={key:0,class:"image-viewer-backdrop quick-profile-detail-backdrop",role:"dialog","aria-modal":"true","aria-label":"角色设定详情"},iA={class:"quick-profile-detail-card","data-overlay-root":"quickProfileDetail"},sA=["src","alt"],uA={key:1,class:"quick-profile-image-empty"},dA={class:"quick-profile-detail-card-info"},cA=["aria-label"],fA={class:"quick-profile-viewer-card","data-overlay-root":"imageViewer"},vA=["src","alt"],pA={class:"quick-profile-viewer-info"},mA={key:2,class:"workflow-workspace"},gA={class:"generate-status-grid workflow-status-grid"},yA={class:"workflow-layout"},_A={class:"workflow-surface workflow-node-flow"},bA={class:"workflow-section-header"},wA={class:"workflow-node-list"},hA=["disabled","onClick"],kA={class:"workflow-group-index"},$A={class:"workflow-group-copy"},CA={class:"workflow-node-progress","aria-hidden":"true"},SA={class:"workflow-node-meta"},IA={key:0,class:"workflow-subnode-list"},PA=["aria-label","onClick"],xA={class:"workflow-subnode-index"},AA={class:"workflow-subnode-copy"},MA={key:0,"aria-hidden":"true"},RA={class:"workflow-surface workflow-preview-panel"},EA={class:"workflow-section-header"},NA={key:0,class:"workflow-preview-tools workflow-preview-tools-split"},TA={key:1,class:"workflow-preview-tools workflow-preview-tools-import"},BA={key:2,class:"workflow-preview-tools workflow-preview-tools-import"},LA={key:3,class:"workflow-preview-tools"},qA=["disabled"],DA=["disabled"],OA={key:4,class:"workflow-preview-tools workflow-preview-tools-import"},WA={key:0,class:"workflow-profile-import-stage"},UA={class:"workflow-profile-import-card select"},FA={class:"workflow-profile-import-list"},jA=["data-profile-card-id","onClick"],KA={class:"workflow-profile-import-profile-field name"},VA={class:"workflow-profile-import-profile-field identity"},GA={class:"workflow-profile-import-profile-field style"},zA={class:"workflow-profile-import-profile-field summary"},HA={class:"workflow-profile-import-current"},QA={key:1,class:"workflow-persona-split-stage"},YA={class:"workflow-persona-split-fields"},JA={key:2,class:"workflow-prompt-plan-stage"},XA={class:"workflow-prompt-plan-list"},ZA={class:"workflow-prompt-plan-guard"},eM={key:3,class:"workflow-material-bind-stage"},tM=["disabled","data-material-category","aria-expanded","onClick"],aM={class:"workflow-material-bind-copy"},nM={class:"workflow-material-bind-stages"},lM={class:"quick-profile-material-picker-header"},oM={key:0,class:"quick-profile-material-picker-groups","aria-label":"配饰分类"},rM=["onClick"],iM=["data-material-reference-id","onClick"],sM={class:"quick-profile-material-picker-media"},uM=["src","alt"],dM={key:1,class:"quick-profile-empty-media-mark"},cM={class:"quick-profile-material-picker-copy"},fM={key:0},vM={key:1},pM={class:"quick-profile-material-picker-copy"},mM={key:5,class:"workflow-preview-stage"},gM=["title"],yM=["src","alt"],_M={class:"workflow-preview-caption"},bM={key:0},wM={key:1,class:"image-stage-empty"},hM={key:6,class:"workflow-draft-board"},kM={class:"workflow-draft-grid"},$M=["disabled","aria-pressed","onClick"],CM={class:"workflow-draft-thumb"},SM=["src","alt"],IM={key:1},PM={key:2},xM={class:"workflow-draft-copy"},AM={class:"workflow-candidate-actions"},MM=["disabled","onClick"],RM=["disabled","onClick"],EM=["disabled","onClick"],NM=["disabled","aria-pressed","onClick"],TM={class:"workflow-section-header"},BM={class:"workflow-detail-scroll"},LM={key:0,class:"workflow-persona-split-summary detail"},qM={key:1,class:"workflow-node-info"},DM={key:2,class:"workflow-lock-notice progression"},OM={key:3,class:"workflow-lock-notice"},WM={key:4,class:"workflow-lock-notice"},UM={class:"workflow-actions"},FM={key:0},jM={key:1},KM={key:2},VM={key:3},GM={key:4},zM={class:"workflow-lifecycle"},HM=["disabled"],QM=["disabled"],YM=["disabled"],JM=["disabled"],XM=["disabled"],ZM={key:0,class:"workflow-lifecycle-detail"},eR={class:"workflow-action-grid"},tR={class:"feature-badge"},aR=["disabled","onClick"],nR={key:1,class:"feature-action"},lR={key:0,class:"image-viewer-backdrop external-profile-import-backdrop",role:"dialog","aria-modal":"true","aria-label":"导入外部角色卡"},oR={class:"external-profile-import-card","data-overlay-root":"externalProfileImport"},rR={class:"external-profile-import-body"},iR={class:"external-profile-import-file-row"},sR={class:"secondary-file-picker"},uR={key:0},dR={key:1},cR={key:2},fR={class:"external-profile-import-source"},vR={class:"external-profile-import-preview","aria-live":"polite"},pR=["disabled"],mR={key:0,class:"image-viewer-backdrop persona-questionnaire-backdrop",role:"dialog","aria-modal":"true","aria-label":"创建角色档案问卷"},gR={class:"persona-questionnaire-card","data-overlay-root":"personaQuestionnaire"},yR={class:"persona-questionnaire-body"},_R={class:"compact"},bR={class:"compact"},wR={class:"compact"},hR={class:"compact"},kR={class:"wide"},$R={class:"persona-questionnaire-footer-actions"},CR={class:"questionnaire-mode-switch",role:"group","aria-label":"问卷复杂度"},SR=["disabled"],IR={key:3,class:"materials-page","data-module":"images"},PR={class:"materials-hero"},xR={key:0,class:"materials-hero-actions"},AR=["disabled"],MR={key:1,class:"materials-hero-actions"},RR={class:"materials-view-tabs","aria-label":"素材库视图"},ER=["aria-pressed"],NR=["aria-pressed"],TR=["aria-pressed"],BR={class:"materials-workbench"},LR={class:"materials-main-column"},qR={class:"panel materials-library-panel"},DR={class:"materials-library-header-actions"},OR={class:"materials-filter-strip","aria-label":"素材分类筛选"},WR=["title","aria-pressed","onClick"],UR=["title"],FR={class:"materials-semantic-filters","aria-label":"素材语义筛选"},jR=["value"],KR=["value"],VR={key:0,class:"materials-subfilter-strip","aria-label":"配饰子分类筛选"},GR=["aria-pressed","onClick"],zR={key:1,class:"skeleton-list materials-skeleton-list"},HR={key:2,class:"materials-library-grid"},QR=["onClick"],YR={class:"materials-library-thumb"},JR=["src","alt"],XR={class:"materials-library-copy"},ZR={class:"materials-library-tags"},eE={class:"materials-side-column"},tE={class:"panel materials-actions-panel"},aE={class:"materials-action-grid"},nE=["disabled","onClick"],lE={key:4,class:"queue-page"},oE={class:"queue-hero"},rE={class:"queue-hero-actions"},iE=["disabled"],sE={class:"queue-workbench"},uE={class:"panel queue-board-panel"},dE={class:"queue-filter-tabs",role:"tablist","aria-label":"队列筛选"},cE=["aria-selected","onClick"],fE={key:0,class:"skeleton-list queue-skeleton-list"},vE={key:1,class:"queue-task-list"},pE=["onClick"],mE={class:"queue-task-status"},gE={class:"queue-task-main"},yE={class:"progress-track","aria-hidden":"true"},_E={class:"queue-task-meta"},bE={key:2,class:"empty-state"},wE={class:"queue-side-column"},hE={class:"panel queue-detail-panel"},kE={class:"panel queue-actions-panel"},$E={class:"queue-action-grid"},CE=["disabled","onClick"],SE={class:"overview-strip","data-module":"overview"},IE={class:"welcome-copy"},PE={class:"dashboard-layout"},xE={class:"main-column"},AE={class:"panel monitor-panel performance-summary-panel","data-module":"monitor"},ME={class:"panel queue-panel","data-module":"queue"},RE=["disabled"],EE={key:1,class:"skeleton-list"},NE={key:2,class:"queue-list"},TE={class:"queue-main"},BE={class:"progress-track"},LE={class:"row-actions","aria-label":"任务操作"},qE=["aria-label","onClick"],DE=["aria-label","disabled","onClick"],OE={class:"panel suggestions-panel","data-module":"suggestions"},WE={key:0,class:"suggestion-grid"},UE=["onClick"],FE={class:"monitor-column","data-module":"images"},jE={class:"panel images-panel side-images-panel"},KE={key:1,class:"side-image-list"},VE={key:2,class:"side-image-list"},GE={class:"thumb"},zE=["src","alt"],HE={key:1},QE={key:3,class:"empty-state"},YE={key:9,class:"performance-detail-page","data-module":"performance"},JE={class:"detail-hero"},XE=["disabled"],ZE={class:"performance-detail-grid"},e3={class:"panel performance-breakdown"},t3={class:"panel performance-breakdown"},a3={class:"panel performance-breakdown"},Ht="配饰",bi="全部",n3=12e3,Qc=1600,l3=34,o3=138,Yc="ImageStudio Single Image",ds="standalone_single_image",Jc="__none__",Cn="character_gradual",Fn="character_fast",r3="character_gradual_sequential_v1",i3=Hn({__name:"App",setup(t){const n=Wn(()=>Un(()=>import("./GalleryPage-_hEv4t9o.js"),__vite__mapDeps([0,1]))),o=Wn(()=>Un(()=>import("./LogsPage-BCu3j0AQ.js"),__vite__mapDeps([2,3]))),i=Wn(()=>Un(()=>import("./ProfilesPage-DXTRaKak.js"),__vite__mapDeps([4,5]))),u=Wn(()=>Un(()=>import("./SettingsPage-BIIghPr-.js"),__vite__mapDeps([6,7]))),d=Wn(()=>Un(()=>import("./WorkflowCompareDialog-BZ20cDz0.js"),__vite__mapDeps([8,9]))),g=Wn(()=>Un(()=>import("./WorkflowBranchPanel-CSON-lvz.js"),__vite__mapDeps([10,11]))),_=Wn(()=>Un(()=>import("./WorkflowCandidatePool-xlud6FG4.js"),__vite__mapDeps([12,13]))),h=Wn(()=>Un(()=>import("./WorkflowComposer-Do_KBQYI.js"),__vite__mapDeps([14,15]))),R=Wn(()=>Un(()=>import("./WorkflowDependencyContextCard-BstMEtF2.js"),__vite__mapDeps([16,17]))),S=Wn(()=>Un(()=>import("./WorkflowGenerationReviewDialog-C-mMw0Sw.js"),__vite__mapDeps([18,19]))),B=Wn(()=>Un(()=>import("./WorkflowMaterialDrawer-PrMqZX_5.js"),__vite__mapDeps([20,21]))),T=Wn(()=>Un(()=>import("./WorkflowRoundPanel-DYHetF0L.js"),__vite__mapDeps([22,23]))),X=new Set(["draft","planned","queued","running","active","processing"]),G=new Set(["succeeded","success","completed"]),K=[{key:"image",label:"图片生成",detail:"提示词、模型、素材和结果"},{key:"quickProfile",label:"快速角色",detail:"角色草稿、素材和衣橱"},{key:"workflow",label:"角色工作流",detail:"多节点流程、队列和审核"}],ye={image:["new-generation","prompt-compose","node-generate","model-route","material-pick","queue-control","review-select","gallery-archive"],quickProfile:["quick-profile","prompt-compose","material-pick","wardrobe-match","daily-outfit","gallery-archive"],workflow:["workflow-create","node-generate","model-route","material-pick","wardrobe-match","queue-control","review-select","gallery-archive"]},me=[{id:"material-category-style",category:"风格",colors:["#3f7edc","#d65b7f","#2ec4b6"]},{id:"material-category-composition",category:"构图",colors:["#7168f0","#2fbda8","#f5c542"]},{id:"material-category-clothing",category:"服装",colors:["#2f7a60","#111827","#d2a23a"]},{id:"material-category-footwear",category:"鞋袜",colors:["#111827","#64748b","#2fbda8"]},{id:"material-category-accessory",category:"配饰",colors:["#0f766e","#38bdf8","#f8fafc"]}],te=["眼部","头部","手部","胸前","颈部","腰部","脸部","臂部"],Ae=me.map((e,a)=>({category_id:`cat_imagestudio_${e.category}`,name:e.category,parent_id:null,category_type:"material",sort_order:(a+1)*10,metadata:{source:"imagestudio_frontend",frontend_group:e.category}})),ue=te.map((e,a)=>({category_id:`cat_imagestudio_accessory_${e}`,name:e,parent_id:`cat_imagestudio_${Ht}`,category_type:"accessory_group",sort_order:(a+1)*10,metadata:{source:"imagestudio_frontend",parent_category:Ht}})),de=[{title:"生成图片",description:"进入生成流程入口",keywords:["生成","图片","prompt","生图"],nav:"generate",module:"generate"},{title:"查看队列",description:"检查等待、运行和失败任务",keywords:["队列","任务","等待","失败","重试"],nav:"queue",module:"queue"},{title:"最近图片",description:"查看最新生成结果",keywords:["最近","图片","图库","缩略图"],nav:"gallery",module:"images"},{title:"模型设置",description:"检查模型站点和调用配置",keywords:["模型","provider","配置","站点"],nav:"settings",module:"settings"},{title:"数据库设置",description:"检查存储和数据库连接",keywords:["数据库","存储","sqlite","postgres"],nav:"settings",module:"settings"},{title:"日志审计",description:"查看错误、生成和系统事件",keywords:["日志","错误","审计","事件"],nav:"logs",module:"logs"},{title:"今日成本",description:"检查生成调用和成本提醒",keywords:["成本","费用","调用","统计"],nav:"performance",module:"performance"},{title:"性能监控",description:"查看服务、队列、调用和存储详情",keywords:["性能","监控","worker","运行","存储"],nav:"performance",module:"performance"},{title:"素材库",description:"查看素材和衣橱相关入口",keywords:["素材","衣橱","角色","材料"],nav:"materials",module:"images"}],De=[{name:"星图紫青",primary:"#7168f0",accent:"#2fbda8"},{name:"极光蓝青",primary:"#3f7edc",accent:"#2ec4b6"},{name:"松石玫红",primary:"#209b8d",accent:"#d65b7f"},{name:"墨绿金盏",primary:"#2f7a60",accent:"#d2a23a"}],ne=$(null),oe=$(pv()),J=$(null),W=$(null),D=$([]),q=$([]),Ne=$(null),Ye=$([]),it=$([]),ot=$([]),ft=$([]),tt=$([]),va=$(null),at=$(null),pa=$([]),Et=$(null),dn=$([]),Qn=$([]),Lt=$([]),_a=$(null),kt=$([]),qt=$({}),ae=$({}),F=$({}),He=$(""),I=$({}),E=$({}),P=$({}),z=$(E_()),j=$(q_()),U=$("image"),ve=$(!1),ie=$(!1),Z=$(""),Y=$(""),Ce=$(""),ee=$("direct"),Se=$(!1),Be=$(""),Qe=$(""),st=$([]),ut=$({}),Pt=new Map,Dt=new Set,ba=new Map,Ot=$(!1),Ea=$(""),Yn=$(null),Wt=$(""),yt=$("active"),Na=$(""),ma=$(""),aa=$(""),dr=$(""),cn=$(""),$o=$(0),Jn=$(""),Ut=$(""),Za=$(""),In=$(null),Nt=$(!1),Ft=$(""),Co=$(null),Xn=$(!1),Ti=$(!1),Bs=$(!1),Zn=$("avatar"),nt=$("brief-import"),Pn=$(""),Ta=$([]),Tt=$(""),Fa=$({}),zl=$(!1),fn=$(""),Vr=$(""),Bi=$(""),el=$({name:"",identity:"",genderPresentation:"",ageStage:"",species:"",bodyType:"",distinctiveFeatures:"",personality:"",hairColor:"",hairstyle:"",eyeColor:"",clothing:"",style:"",negative:""}),Hl=$(""),Ba=$({}),_t=$(""),tl=$(bi),Ql=$(null),Yl=$(!1),wl=$(!1),al=$(""),nl=$(""),ja=$(""),Vt=$(!1),cr=$(!1),vn=$(!1),Jl=$(""),fr=$(""),Gr=$(!1),hl=$(""),pn=$("simple"),Re=$(AI()),Jt=$([]),ia=$([]),mn=$([]),Xl=$(D_()),zr=$("avatar"),vr=$(""),xn=$({}),Li=$(0),So=$(!1),kl=$(""),An=$(""),en=$(""),Io=$(!1),Po=$(""),wa=$(!1),ll=$(""),Zl=$(""),pr=$(!1),ol=$(""),Le=$(!1),Sa=$(!1),rl=$(""),$t=$(null),ge=$(""),w=$(!1),v=$(""),L=$(""),le=$(""),Me=$({}),A=$({}),we=$(""),Te=$(""),dt=$({}),Gt=$({}),$l=$({}),qi=$(""),Hr=$(""),vt=$(""),md=$(""),il=$(""),Qr=$(4),Di=$(""),Oi=$(""),mr=$(!1),sl=$(null),Ka=$(!1),Cl=$(""),Ls=$(!1),ul=$(null),qs=$(!1),Ds=$(!1),ha=$(""),gr=$(""),eo=$(""),xo=$([]),pt=$({}),Wi=$({}),Xt=$({}),rt=$({}),jt=$({}),ey=[{key:"roleCore",label:"角色核心"},{key:"genderPresentation",label:"性别表现"},{key:"ageStage",label:"年龄阶段"},{key:"species",label:"物种 / 种族"},{key:"bodyType",label:"体型"},{key:"distinctiveFeatures",label:"显著特征"},{key:"personality",label:"性格关键词"},{key:"appearance",label:"外观特征"},{key:"outfit",label:"服装与配饰"},{key:"scene",label:"常用场景"},{key:"avoid",label:"避雷内容"}],Os=$("draft"),Ws=$(""),gd=$(!1),Yr=$(!1),Mn=$(0),Ef=$(null),Sl=$("dark"),Ao=$(De[0].primary),Mo=$(De[0].accent),Us=$(!1),Fs=$(!1),js=$(!1),Ro=$(!1),Ks=$("generation"),to=$(1),Eo=$({x:0,y:0}),yr=$(!1),_r=$({pointerId:-1,x:0,y:0,offsetX:0,offsetY:0}),Jr=$(!0),dl=$(!0);let Ui,Xr,br,Vs=0,Gs="",Fi;const ji=$("all"),Rn=$([]),Zr=$([]),ao=$(!1),yd=$(!1),_d=$(!1),gn=$(!1),zs=$(!1),Hs=$(!1),bd=$(!1),Il=$(!1),wd=$(!1),Ki=$(!1),yn=$(""),Qs=$(""),Vi=$(""),ka=$(""),Kt=$(""),hd=$(""),tn=$(""),En=$(""),Nn=$(null),No=$(""),Pl=$(""),To=$(""),wr=$(!1),kd=$(""),ei=$(""),Tn={theme:"imagestudio.navigation.theme",primary:"imagestudio.navigation.primary",accent:"imagestudio.navigation.accent",navigationPinned:"imagestudio.navigation.pinned.v2",readNotifications:"imagestudio.navigation.readNotifications",dismissedNotifications:"imagestudio.navigation.dismissedNotifications"},Nf=["search","palette","notifications","logs","imageViewer","materialPicker","materialDetail","materialCategoryCreate","materialOperation","personaQuestionnaire","quickProfileDetail","externalProfileImport"],cl=[{nodeKey:"quick_avatar",title:"快速头像",detail:"五官、表情与发型",aspectRatio:"1:1",sortOrder:10},{nodeKey:"quick_bust",title:"快速半身像",detail:"上半身服装与姿态",aspectRatio:"3:4",sortOrder:20},{nodeKey:"quick_stand",title:"快速立绘",detail:"全身比例与完整服装",aspectRatio:"2:3",sortOrder:30},{nodeKey:"quick_sheet",title:"快速设定图",detail:"多视角与细节拆分",aspectRatio:"16:9",sortOrder:40}];let ti,Ys,Js=0;const $d=new Map,Cd=new Map,Tf=M(()=>ao.value||gn.value||zs.value||Hs.value),Bf=M(()=>oe.value.state),ty=M(()=>oe.value.state!=="connected"),ai=M(()=>Jl.value.trim()),Sd=M(()=>RI(ai.value)),Id=M(()=>ey.map(e=>({...e,value:Sd.value[e.key],recognized:Sd.value.recognizedKeys.includes(e.key)}))),ay=M(()=>Id.value.filter(e=>e.recognized).length),ny=M(()=>ps.find(e=>e.key===z.value)??ps[0]),Bo=M(()=>{var a;const e=(a=J.value)==null?void 0:a.queue;return e?e.pending+e.running+e.failed+e.dead_letter:0}),Ia=M(()=>{var a;return(a=Ne.value)!=null&&a.items.length?Ne.value.items:ly.value}),Pd=M(()=>Ia.value.slice(0,6)),ly=M(()=>{var e;return((e=J.value)==null?void 0:e.recent_jobs.map(Dh).filter(Oh))??[]}),oy=M(()=>new Map(Jt.value.map(e=>[e.profile_id,e]))),ry=M(()=>{const e=[...Object.values(pt.value),...Object.values(Xt.value).flat()];return new Map(sn(e,a=>a.workflow_id).map(a=>[a.workflow_id,a]))}),iy=M(()=>{const e=Object.values(rt.value).flat();return new Map(sn(e,a=>a.node_id).map(a=>[a.node_id,a]))}),Lo=M(()=>D.value.slice(0,8)),hr=M(()=>{const e=st.value.filter(hn),a=new Set;return e.filter(r=>a.has(r.image_id)?!1:(a.add(r.image_id),!0)).slice(0,10)}),Lf=M(()=>[...Jo([...st.value,...Object.values(jt.value).flat(),...q.value.map(os),...Lo.value.map(os)]).filter(hn)].sort((a,r)=>ml(r.created_at)-ml(a.created_at)).map(a=>({...a,image_url:Ln(a.image_url),thumbnail_url:Ln(a.thumbnail_url)}))),Pa=M(()=>hr.value.length?hr.value.find(e=>e.image_id===Z.value)??hr.value[0]:null),sy=M(()=>{const e=Pa.value;return e?[{label:"状态",value:e.status},{label:"来源",value:e.source},{label:"工作流",value:e.workflow_id||"-"},{label:"节点",value:e.node_id||"-"},{label:"角色",value:e.profile_id||"-"},{label:"模型",value:e.model},{label:"尺寸",value:e.size},{label:"Seed",value:e.seed},{label:"耗时",value:e.duration},{label:"提示词",value:e.prompt},{label:"时间",value:po(e.created_at)}]:[{label:"来源",value:"等待生成"},{label:"状态",value:"暂无图片"},{label:"提示",value:"左侧生成结果会在这里显示"}]}),uy=M(()=>`translate3d(${Eo.value.x}px, ${Eo.value.y}px, 0) scale(${to.value})`),qf=M(()=>{var s;const e=ta((s=at.value)==null?void 0:s.config.generation)?at.value.config.generation:void 0,a=Array.isArray(e==null?void 0:e.adapters)?e.adapters:e!=null&&e.provider?[e.provider]:[],r=he(e,"default_model");return a.flatMap(c=>{if(!ta(c)||c.enabled===!1)return[];const f=he(c,"id")||he(c,"provider_id"),b=he(c,"model_id");if(!f||!b||b==="auto-discovery")return[];const C=dn.value.find(V=>V.provider_id===f&&V.model_id===b&&Th(V)),O=he(c,"route_name")||(b===r?r:f);return[{value:`${f}/${b}`,label:b,provider:he(c,"name")||he(c,"display_name")||f,status:(C==null?void 0:C.status)||"configured",routeName:O}]})}),qo=M(()=>{const e=new Set;return qf.value.filter(a=>e.has(a.value)?!1:(e.add(a.value),!0))}),ni=M(()=>qo.value.find(e=>e.value===Wt.value)??qo.value[0]),xd=M(()=>bd.value?"同步中":qf.value.length?"":oe.value.state!=="connected"?"等待后端连接":kd.value?"模型目录读取失败":"尚未配置生图模型"),_n=M(()=>me.reduce((e,a)=>{const r=Ba.value[a.category],s=Do.value.find(c=>c.id===r&&c.category===a.category);return s&&e.push(s),e},[])),Ad=M(()=>Do.value.find(e=>e.id===Hl.value)??_n.value[0]??null),dy=M(()=>{const e=_n.value.length;return e?`${e} 个已选`:"未使用"}),cy=M(()=>{const e=Lt.value.map(a=>[a.category_id,a.name]);return new Map(e)}),fy=M(()=>j.value==="standard"?"角色参考素材工作台":j.value==="advanced"?"高还原度进阶素材库":"进阶素材识别与验证"),vy=M(()=>j.value==="standard"?"集中管理参考图、识别结果、分类、素材包导入和角色衣橱绑定,后续角色工作流会从这里读取可确认素材。":j.value==="advanced"?"只展示经过源图与验证图人工对照、明确封存的高优先级素材;数据和图片与普通素材严格隔离。":"导入源图后自动识别并生成验证图,可根据还原度多轮调整描述,确认满意后再封存入库。"),Md=M(()=>kt.value.filter(e=>vu(e)==="advanced"&&Ge(e.status)!=="archived").map(ib)),Df=M(()=>{var e;return sn([...Md.value,...(((e=_a.value)==null?void 0:e.items)??[]).filter(a=>Ge(a.recognition_status)==="confirmed")],a=>a.material_id)}),py=M(()=>Df.value.map(sb).filter(e=>!!e)),Do=M(()=>[...py.value].sort((e,a)=>+!!a.advanced-+!!e.advanced||Number(a.priority||0)-Number(e.priority||0))),Gi=M(()=>{var a;return(((a=_a.value)==null?void 0:a.items)??[]).map((r,s)=>fb(r))}),Rd=M(()=>{var e;return ma.value||((e=Oo.value[0])==null?void 0:e.id)||""}),kr=M(()=>{var c,f;const e=Gi.value,a=((c=Wo.value)==null?void 0:c.categoryIds)??[],r=a.length?e.filter(b=>a.includes(b.categoryId)):[];return(((f=Wo.value)==null?void 0:f.label)!==Ht||!aa.value?r:r.filter(b=>b.subcategory===aa.value)).filter(b=>(!dr.value||b.bodySlots.includes(dr.value))&&(!cn.value||b.wearLayer===cn.value)&&b.confidence>=$o.value)}),li=M(()=>kr.value.length?kr.value.find(e=>e.id===Jn.value)??kr.value[0]:null),zi=M(()=>{var a;const e=li.value;return!e||e.source!=="backend"?null:((a=_a.value)==null?void 0:a.items.find(r=>r.material_id===e.id))??null}),Of=M(()=>Lt.value.filter(e=>!e.parent_id&&e.category_type!=="accessory_group")),my=M(()=>{const e=Of.value.filter(a=>fu(a.name)===Ht).map(a=>a.category_id);return e.length?Lt.value.filter(a=>a.parent_id&&e.includes(a.parent_id)):[]}),Oo=M(()=>{const e=Gi.value,a=new Map;for(const c of e)a.set(c.categoryId,(a.get(c.categoryId)??0)+1);const r=new Map;for(const c of Of.value){const f=fu(c.name);r.set(f,[...r.get(f)??[],c])}return Array.from(r.entries()).map(([c,f])=>{const b=db(f),C=b.map(V=>V.category_id),O=C.reduce((V,ce)=>V+(a.get(ce)??0),0);return{id:b[0].category_id,label:c,categoryIds:C,count:O,detail:cb(c),endpoint:b.map(V=>N.materialCategory(V.category_id)).join(" / "),tone:O?"good":"idle",source:"backend"}}).sort((c,f)=>Nv(c.label)-Nv(f.label))}),Wo=M(()=>Oo.value.find(e=>e.id===ma.value)??Oo.value[0]??null),gy=M(()=>{var a,r;const e=(a=Xs.value.find(s=>s.id===aa.value))==null?void 0:a.categoryId;return e||(((r=Wo.value)==null?void 0:r.categoryIds.find(s=>Lt.value.some(c=>c.category_id===s)))??"")}),$r=M(()=>Oo.value.find(e=>e.label===Ht)??null),Xs=M(()=>{var r;if(((r=Wo.value)==null?void 0:r.label)!==Ht)return[];const e=Wo.value.categoryIds;if(!e.length)return[];const a=new Map;for(const s of Gi.value.filter(c=>e.includes(c.categoryId))){const c=s.subcategory||"其他";a.set(c,(a.get(c)??0)+1)}return my.value.map(s=>({id:s.name,label:s.name,count:a.get(s.name)??0,categoryId:s.category_id,source:"backend"}))}),Zs=M(()=>{var e;return((e=Wo.value)==null?void 0:e.label)===Ht}),yy=M(()=>Zs.value?"添加配饰子类":"添加素材分类"),_y=M(()=>{var e;return Zs.value?((e=$r.value)==null?void 0:e.source)==="backend"?$r.value.label:"配饰父分类尚未落库":"无,作为主分类创建"}),by=M(()=>N.materialCategories),wy=M(()=>{var f;const e=Gi.value,a=((f=_a.value)==null?void 0:f.total)??0,r=e.filter(b=>Ge(b.status)==="confirmed").length,s=e.filter(b=>!["confirmed","archived"].includes(Ge(b.status))).length,c=_n.value.length;return[{label:"素材总量",value:String(a||e.length),hint:oe.value.state!=="connected"?"等待后端连接":a?"来自后端素材库":"后端素材库为空",state:e.length?"good":"idle"},{label:"分类",value:String(Oo.value.length),hint:"风格、构图、服装、鞋袜、配饰等",state:Oo.value.length?"good":"idle"},{label:"待确认",value:String(s),hint:r?`${r} 条已确认`:"登记 URI 后需要识别或确认的素材",state:s&&a?"warn":"idle"},{label:"已选参考",value:String(c),hint:c?"会进入角色素材绑定":"默认不使用参考",state:c?"good":"idle"}]}),hy=M(()=>{const e=li.value;return e?[{label:"名称",value:e.label},{label:"分类",value:e.category},{label:"子分类",value:e.subcategory||"-"},{label:"状态",value:e.statusText},{label:"来源",value:"后端素材库"},{label:"标签",value:e.tags.length?e.tags.join("、"):"-"},{label:"正向词",value:e.prompt||"-"},{label:"负向词",value:e.negativePrompt||"-"},{label:"接口",value:e.endpoint},{label:"更新时间",value:e.updatedAt}]:[{label:"状态",value:"暂无素材"},{label:"提示",value:oe.value.state==="connected"?"后端素材会在这里显示详情。":"连接后端后显示素材详情。"}]}),Wf=M(()=>{var ce,pe;const e=(ce=ne.value)==null?void 0:ce.permissions,a=(pe=ne.value)==null?void 0:pe.feature_flags,r=!!(e!=null&&e.can_manage_materials),s=!!(a!=null&&a.material_library),c=li.value,f=(c==null?void 0:c.source)==="backend"?c:null,b=zi.value,C=Ee.value,O=Nt.value,V=!!(a!=null&&a.wardrobe&&r&&(C!=null&&C.profileId)&&b&&Ge(b.recognition_status)==="confirmed"&&!O);return[{id:"refresh",title:"刷新素材库",detail:"重新读取分类和素材列表。",badge:"GET",endpoint:`${N.materialCategories} / ${N.materials}`,action:Il.value?"同步中":"刷新",tone:"primary",enabled:!Il.value},{id:"upload",title:"登记素材 URI",detail:"登记已有 storage:// 图片、名称和分类;不会伪装成浏览器文件上传。",badge:"URI",endpoint:N.materialUpload,action:O&&In.value==="register-uri"?"登记中":"打开表单",tone:s&&r?"accent":"neutral",enabled:!!(s&&r&&!O)},{id:"create-category",title:"添加分类",detail:"打开添加卡片,提交后写入后端分类表。",badge:"Category",endpoint:N.materialCategories,action:Xn.value?"创建中":"打开",tone:r?"accent":"neutral",enabled:!!(r&&!Xn.value)},{id:"recognize",title:"识别当前素材",detail:"调用素材 VLM 工作流,回填提示词、标签和识别状态。",badge:"VLM",endpoint:f?N.materialRecognize(f.id):N.materialRecognize(":materialId"),action:Za.value==="recognize"?"识别中":"识别",tone:f?"accent":"neutral",enabled:!!(s&&r&&f&&!Za.value)},{id:"re-recognize",title:"重新识别",detail:"保留素材记录,重新跑一次识别链路。",badge:"Retry",endpoint:f?N.materialReRecognize(f.id):N.materialReRecognize(":materialId"),action:Za.value==="re-recognize"?"重跑中":"重识别",tone:f?"warn":"neutral",enabled:!!(s&&r&&f&&!Za.value)},{id:"confirm",title:"确认入库",detail:"把当前识别结果确认成可绑定素材。",badge:"Confirm",endpoint:f?N.materialConfirm(f.id):N.materialConfirm(":materialId"),action:Za.value==="confirm"?"确认中":"确认",tone:f?"primary":"neutral",enabled:!!(s&&r&&f&&!Za.value)},{id:"asset-pack",title:"导入素材包",detail:"接收素材包 URI,支持 dry-run 预检查再执行导入。",badge:"Pack",endpoint:N.assetImportPack,action:O&&In.value==="asset-pack"?"处理中":"预检查",tone:s&&r?"accent":"neutral",enabled:!!(s&&r&&!O)},{id:"wardrobe",title:"导入角色衣橱",detail:"将确认素材并入当前角色衣橱,用于穿搭匹配。",badge:"Wardrobe",endpoint:C!=null&&C.profileId?N.wardrobeImportMaterial(C.profileId):N.wardrobeImportMaterial(":profileId"),action:O&&In.value==="wardrobe"?"导入中":"选择分类",tone:V?"accent":"neutral",enabled:V},{id:"workflow-bind",title:"进入素材绑定",detail:"回到角色工作流的参考素材绑定节点,保存到后端工作流。",badge:"Workflow",endpoint:C!=null&&C.workflowId?N.workflow(C.workflowId):N.node(":material_bind_node_id"),action:"打开节点",tone:C!=null&&C.workflowId?"primary":"neutral",enabled:!!(C!=null&&C.workflowId),nav:"generate",module:"generate"}]}),eu=M(()=>Do.value.filter(e=>e.category===_t.value)),Uf=M(()=>[bi,...qr(Do.value.filter(e=>e.category===Ht).map(e=>e.group??"其他"))]),Ed=M(()=>_t.value!==Ht||tl.value===bi?eu.value:eu.value.filter(e=>(e.group??"其他")===tl.value)),Ff=M(()=>{const e=Ed.value.length,a=eu.value.length;return _t.value===Ht&&tl.value!==bi?`${e} / ${a} 项`:`${a} 项`}),tu=M(()=>_t.value===Ht&&tl.value!==bi),jf=M(()=>{var e;return((e=Ql.value)==null?void 0:e.category)===_t.value?`${Ql.value.category}添加入口已预留`:"跳转到素材库添加"}),et=M(()=>{const e=el.value,a=e.name.trim()||"未命名角色",r=e.personality.trim(),s=[a,e.identity.trim(),e.genderPresentation.trim()?`gender presentation: ${e.genderPresentation.trim()}`:"",e.ageStage.trim()?`age stage: ${e.ageStage.trim()}`:"",e.species.trim()?`species: ${e.species.trim()}`:"",r?`personality: ${r}`:""].filter(Boolean).join(", "),c=[e.hairColor.trim()?`${e.hairColor.trim()} hair`:"",e.hairstyle.trim(),e.eyeColor.trim()?`${e.eyeColor.trim()} eyes`:"",e.bodyType.trim()?`body type: ${e.bodyType.trim()}`:"",e.distinctiveFeatures.trim(),e.clothing.trim(),..._n.value.map(f=>f.prompt)].filter(Boolean).join(", ");return{name:a,basePrompt:s,appearancePrompt:c,stylePrompt:e.style.trim(),negativePrompt:e.negative.trim()}}),ky=M(()=>uo(11,et.value.name,et.value.appearancePrompt,["#7168f0","#2fbda8","#f5c542"],[1,1])),$y=M(()=>[{label:"基础",value:et.value.basePrompt},{label:"一致性",value:[el.value.genderPresentation,el.value.ageStage,el.value.species,el.value.bodyType,el.value.distinctiveFeatures].filter(Boolean).join(" / ")||"未设置"},{label:"外观",value:et.value.appearancePrompt},{label:"风格",value:et.value.stylePrompt||"-"},{label:"负面",value:et.value.negativePrompt||"-"}]),Cy=M(()=>({id:"unsaved-draft",...el.value,status:"未保存草稿",updatedAt:"尚未进入角色档案",materialId:Hl.value,colors:["#7168f0","#2fbda8","#f5c542"]})),Uo=M(()=>hh([...mn.value,...ia.value])),Hi=M(()=>Jt.value),St=M(()=>Xl.value===Jc?null:Hi.value.find(e=>e.profile_id===Xl.value)??Hi.value[0]??null),Kf=M(()=>{const e=St.value;return e&&(xn.value[e.profile_id]||e.avatar_image_uri)||""}),Nd=M(()=>{var a;const e=(a=St.value)==null?void 0:a.profile_id;return e?qt.value[e]??[]:[]}),Sy=M(()=>{var a;const e=(a=St.value)==null?void 0:a.profile_id;return e?ae.value[e]??"":""}),Iy=M(()=>{var a;const e=(a=St.value)==null?void 0:a.profile_id;return e?P.value[e]??"":""}),Py=M(()=>{var a;const e=(a=St.value)==null?void 0:a.profile_id;return e?E.value[e]??"":""}),xy=M(()=>{var e;return!!((e=St.value)!=null&&e.profile_id&&F.value[St.value.profile_id])}),Vf=M(()=>{var e;return sn([...Md.value,...((e=_a.value)==null?void 0:e.items)??[],...Object.values(I.value)],a=>a.material_id)}),Ay=M(()=>{var e,a,r;return oe.value.state!=="connected"||!((e=ne.value)!=null&&e.feature_flags.wardrobe)||((r=(a=St.value)==null?void 0:a.metadata)==null?void 0:r.source)==="sample"?null:ne.value.permissions}),My=M(()=>{var f;const e=St.value;if(!e)return[];if(Ts(e)==="ungenerated")return[];const a=e.base_prompt||e.description||e.name,r=e.appearance_prompt||e.description||"角色外观待补充",s=e.style_prompt||"角色设定插画",c=Kf.value;if(((f=e.metadata)==null?void 0:f.source)!=="sample"){const b=[],C=Xt.value[e.profile_id]??[],O=Hv(C);!O&&/^(?:https?:|data:|blob:|\/)/i.test(c)&&b.push({id:"avatar",label:"头像",detail:"角色档案头像",status:"ready",imageUrl:c,aspectRatio:[1,1],prompt:`${e.name}, portrait, ${r}`,createdAt:e.updated_at,source:"角色档案头像(无快速角色批次)"});const V=[...O?[O]:[],...C.filter(ce=>ce.workflow_type!==Fn)];for(const ce of V)for(const pe of rt.value[ce.workflow_id]??[]){const Ve=jt.value[pe.node_id]??[];Ve.forEach((Oe,Xe)=>{const ke=Ca(Oe);ke&&b.push({id:Oe.image_id,label:Ve.length>1?`${Mu(pe)} ${Xe+1}`:Mu(pe),detail:pe.description||ce.display_name,status:Oe.status||pe.status,imageUrl:ke,aspectRatio:Ry(Oe.size),prompt:Oe.prompt||pe.prompt,createdAt:Oe.created_at,source:ce.display_name})})}return sn(b,ce=>ce.id)}return[{id:"avatar",label:"头像",detail:"五官、表情与发型",status:"ready",imageUrl:c||uo(81,`${e.name} 头像`,r,["#7168f0","#2fbda8","#f5c542"],[1,1]),aspectRatio:[1,1],prompt:`${e.name}, portrait, ${r}`,createdAt:e.updated_at,source:"角色档案"},{id:"bust",label:"半身像",detail:"服装、姿态与轮廓",status:"pending",imageUrl:uo(82,`${e.name} 半身像`,r,["#3f7edc","#2ec4b6","#d65b7f"],[3,4]),aspectRatio:[3,4],prompt:`${e.name}, upper body character reference, ${r}`,createdAt:e.updated_at,source:"角色档案预览"},{id:"stand",label:"立绘",detail:"全身比例与服装细节",status:"pending",imageUrl:uo(83,`${e.name} 立绘`,a,["#2f7a60","#111827","#d2a23a"],[2,3]),aspectRatio:[2,3],prompt:`${e.name}, full body character design, ${a}`,createdAt:e.updated_at,source:"角色档案预览"},{id:"sheet",label:"设定图",detail:"多角度与视觉规范",status:"pending",imageUrl:uo(84,`${e.name} 设定图`,s,["#475569","#7168f0","#f5c542"],[16,9]),aspectRatio:[16,9],prompt:`${e.name}, character design sheet, ${s}`,createdAt:e.updated_at,source:"角色档案预览"}]});function Ry(e){const a=e.match(/(\d+)\s*[x×]\s*(\d+)/i);return a?[Math.max(1,Number(a[1])),Math.max(1,Number(a[2]))]:[4,5]}const Ey=M(()=>{var a,r;const e=(a=St.value)==null?void 0:a.profile_id;return e?((r=Xt.value[e])==null?void 0:r.length)??0:0}),Ny=M(()=>{var f,b;const e=(f=St.value)==null?void 0:f.profile_id,a=e?qt.value[e]:void 0;if(a)return a.length;const r=((b=St.value)==null?void 0:b.metadata)??{},s=r.material_ids;return Array.isArray(s)?s.length:na(r.material_id)?1:0}),Ty=M(()=>{var a;const e=(a=St.value)==null?void 0:a.profile_id;return e?(Xt.value[e]??[]).reduce((r,s)=>{var c;return r+(((c=rt.value[s.workflow_id])==null?void 0:c.length)??0)},0):0}),Ee=M(()=>Uo.value.find(e=>e.id===Os.value)??Uo.value[0]??Cy.value),xl=M(()=>{var a;const e=(a=Ee.value)==null?void 0:a.workflowId;return e?Mr(e):[]}),sa=M(()=>{var a;const e=(a=Ee.value)==null?void 0:a.workflowId;return e?pt.value[e]:void 0}),By=M(()=>{const e=sa.value;if(!e)return[];const a=Me.value[e.workflow_id]??[];return a.some(r=>r.branch_name==="main")?a:[{branch_id:"branch_virtual_main",workflow_id:e.workflow_id,branch_name:"main",base_branch_name:null,base_node_id:null,status:e.current_branch==="main"?"active":"available",metadata:{},created_at:e.created_at,updated_at:e.updated_at},...a]}),Ly=M(()=>{var a;const e=(a=sa.value)==null?void 0:a.workflow_id;return e?Object.fromEntries((rt.value[e]??[]).map(r=>[r.node_id,r.title||r.node_key])):{}}),qy=M(()=>{var a;const e=(a=Ue.value)==null?void 0:a.node_id;return e?A.value[e]??null:null}),Dy=M(()=>{var e;return!!(oe.value.state==="connected"&&((e=ne.value)!=null&&e.permissions.can_write)&&sa.value)}),au=M(()=>mc(sa.value)),Gf=M(()=>!0),Cr=M(()=>{const e=Ee.value,a=e.quickCharacterWorkflowId,r=a?rt.value[a]??[]:[],s=!!e.profileId;return[{id:"avatar",nodeKey:"quick_avatar",label:"头像",detail:"五官、表情、发型",state:"1:1",aspectRatio:[1,1],placeholder:ky.value,prompt:`${et.value.name}, face reference, ${et.value.basePrompt}, ${et.value.appearancePrompt}`},{id:"bust",nodeKey:"quick_bust",label:"半身像",detail:"上半身服装与姿态",state:"3:4",aspectRatio:[3,4],placeholder:uo(12,`${et.value.name} 半身像`,et.value.appearancePrompt,["#3f7edc","#2ec4b6","#d65b7f"],[3,4]),prompt:`${et.value.name}, upper body character reference, ${et.value.appearancePrompt}`},{id:"stand",nodeKey:"quick_stand",label:"立绘",detail:"全身比例与轮廓",state:"2:3",aspectRatio:[2,3],placeholder:uo(13,`${et.value.name} 立绘`,et.value.basePrompt,["#2f7a60","#111827","#d2a23a"],[2,3]),prompt:`${et.value.name}, full body character standing pose, ${et.value.basePrompt}, ${et.value.stylePrompt}`},{id:"sheet",nodeKey:"quick_sheet",label:"设定图",detail:"多角度与细节拆分",state:"16:9",aspectRatio:[16,9],placeholder:uo(14,`${et.value.name} 设定图`,et.value.stylePrompt,["#475569","#7168f0","#f5c542"],[16,9]),prompt:`${et.value.name}, character design sheet, multi angle, outfit details, ${et.value.stylePrompt}`}].map(f=>{var O;const b=r.find(V=>V.node_key===f.nodeKey),C=b?Td(b,jt.value[b.node_id]??[]):void 0;return{id:f.id,label:f.label,detail:f.detail,state:f.state,imageUrl:C?Ca(C):s?"":f.placeholder,aspectRatio:f.aspectRatio,prompt:(C==null?void 0:C.prompt)||f.prompt,createdAt:(C==null?void 0:C.created_at)||e.updatedAt,source:C?"快速角色 / 已生成":s?"快速角色 / 尚未生成":"快速角色 / 预览",model:C==null?void 0:C.model,workflowId:a,batchId:a?he((O=pt.value[a])==null?void 0:O.metadata,"quick_character_batch_id"):""}})});function Td(e,a){const r=a.filter(hn);if(e.selected_image_id){const s=r.find(c=>c.image_id===e.selected_image_id);if(s)return s}return[...r].sort((s,c)=>ml(c.created_at)-ml(s.created_at))[0]}const $a=M(()=>Cr.value.find(e=>e.id===Zn.value)??Cr.value[0]),Fo=M(()=>Cr.value.find(e=>e.id==="bust")??$a.value),Oy=M(()=>{var r;const[e,a]=((r=$a.value)==null?void 0:r.aspectRatio)??[4,3];return{"--quick-profile-target-ratio":`${e} / ${a}`}}),Wy=M(()=>{var r;const[e,a]=((r=$a.value)==null?void 0:r.aspectRatio)??[4,3];return e>a?"landscape":"portrait"}),zf=M(()=>{var r;const[e,a]=((r=Fo.value)==null?void 0:r.aspectRatio)??[3,4];return{"--quick-profile-target-ratio":`${e} / ${a}`}}),Uy=M(()=>{var a;const e=$a.value;return e?[{label:"类型",value:`${e.label} / ${e.state}`},{label:"说明",value:e.detail},{label:"模型",value:e.model||((a=ni.value)==null?void 0:a.label)||"未选择模型"},{label:"生成批次",value:e.batchId||"-"},{label:"来源",value:e.source},{label:"生成时间",value:po(e.createdAt)},{label:"提示词",value:e.prompt},{label:"负面提示词",value:et.value.negativePrompt||"-"}]:[]}),Hf=M(()=>{var c,f;const e=(c=ne.value)==null?void 0:c.feature_flags,a=(f=ne.value)==null?void 0:f.permissions,r=!!(a!=null&&a.can_write),s=!!(a!=null&&a.can_manage_materials);return[{id:"persona",title:"生成角色图片",badge:"Persona",detail:"按当前角色设定一次生成头像、半身像、立绘和设定图。",endpoint:Ee.value.profileId?N.profileWorkflows(Ee.value.profileId):N.quickProfileDraft,state:E.value[Ee.value.profileId??""]?"生成中":Ee.value.profileId?"四图批量生成":"请先保存角色",tone:"primary",action:"一键生成",enabled:!!(r&&Ee.value.profileId)},{id:"save",title:"保存角色",badge:"Profile",detail:"把当前人设预览归档为可复用角色。",endpoint:N.quickProfileDraftSave,state:r?"可写入":"只读",tone:r?"accent":"neutral",action:"保存档案",enabled:r,nav:"profiles",module:"suggestions"},{id:"material",title:"整理素材集",badge:"Material",detail:"把已选参考整理为角色专属素材包。",endpoint:N.materials,state:e!=null&&e.material_library?"已开启":"未开启",tone:e!=null&&e.material_library?"accent":"neutral",action:"整理素材",enabled:!!(e!=null&&e.material_library&&s),nav:"materials",module:"images"},{id:"wardrobe",title:"衣橱匹配",badge:"Wardrobe",detail:"按当前人设匹配一次性服装与配饰候选。",endpoint:N.wardrobeMatch(":profileId"),state:e!=null&&e.wardrobe?"已开启":"未开启",tone:e!=null&&e.wardrobe?"primary":"neutral",action:"匹配候选",enabled:!!(e!=null&&e.wardrobe&&s),nav:"materials",module:"images"},{id:"daily",title:"每日穿搭",badge:"Outfit",detail:"按日期、场景和状态生成长期穿搭方案。",endpoint:N.privateCompanionDailyOutfit,state:e!=null&&e.private_companion_integration?"已开启":"未开启",tone:e!=null&&e.private_companion_integration?"warn":"neutral",action:"生成方案",enabled:!!(e!=null&&e.private_companion_integration)},{id:"workflow",title:"进入工作流",badge:"Flow",detail:"把当前粗略人设转入工作流继续细化。",endpoint:N.profileWorkflows(":profileId"),state:e!=null&&e.workspace?"已开启":"未开启",tone:e!=null&&e.workspace?"primary":"neutral",action:"细化人设",enabled:!!(e!=null&&e.workspace&&r&&Ee.value.profileId)}]});function Fy(e){return{Persona:"人设",Profile:"档案",Material:"素材",Wardrobe:"衣橱",Outfit:"穿搭",Flow:"工作流"}[e]??e}function nu(e){return{persona:"生成",save:"保存",material:"整理",wardrobe:"匹配",daily:"生成",workflow:"细化"}[e.id]??e.action}const no=M(()=>{const e=new Map([...xl.value].sort((a,r)=>a.sort_order-r.sort_order).map(a=>[pl(a),a]));return[ph(),...Am.map((a,r)=>{const s=e.get(a.id);return s?gh(s,r):mh(a,r)})]}),jy=[{id:"profile-prep",step:"01",title:"前期人设准备",detail:"导入粗略人设,拆解设定,并完成提示词规划和参考素材绑定。",badge:"Prep",previewNodeId:"material-bind",nodeIds:["brief-import","persona-split","prompt-plan","material-bind"]},{id:"portrait-draft",step:"02",title:"头像草稿",detail:"确认五官、发型、上半身服装和角色气质;确定后主预览显示头像草稿。",badge:"Draft",previewNodeId:"portrait-03",nodeIds:["portrait-01","portrait-02","portrait-03"]},{id:"body-sheet",step:"03",title:"全身与设定图",detail:"补齐全身比例、鞋袜配饰、细节补图和角色设定图。",badge:"Sheet",previewNodeId:"fullbody-01",nodeIds:["fullbody-01","sheet-split","detail-hands-01","detail-accessory-01","detail-accessory-02"]},{id:"review-archive",step:"04",title:"修复入库",detail:"高清修复、统一风格,并保存为可复用角色版本。",badge:"Fix",previewNodeId:"hires-fix",nodeIds:["hires-fix","archive"]}],oi=M(()=>{const e=new Map(no.value.map(a=>[a.id,a]));return jy.map(a=>{const r=a.nodeIds.map(V=>e.get(V)).filter(V=>!!V),s=r.filter(V=>V.status==="done").length,c=r.find(V=>V.status==="running"||V.status==="review"),f=r.find(V=>V.status!=="done"),b=c??f??r[r.length-1],C=Ih(a.id,r,!!xl.value.length),O=c??C.find(V=>V.status!=="done"&&!so(V.id))??[...C].reverse().find(V=>!so(V.id))??C[0];return{...a,previewNodeId:(O==null?void 0:O.id)??"",nodes:C,allNodeCount:r.length,visibleNodeCount:C.length,status:kh(r),progress:$h(r),eta:(b==null?void 0:b.eta)??(b==null?void 0:b.duration)??"已完成",summary:C.length?`${s} / ${r.length} 小节点`:`未展开 / ${r.length} 小节点`,outputCount:(b==null?void 0:b.outputCount)??"等待产物"}}).filter(a=>a.nodes.length>0)}),Ky=M(()=>oi.value.reduce((e,a)=>e+a.visibleNodeCount,0)),Bd=M(()=>oi.value.find(e=>e.nodeIds.includes(nt.value))??oi.value[0]),Vy=M(()=>{var e,a;return((e=Bd.value)==null?void 0:e.title)??((a=Je.value)==null?void 0:a.title)??"节点预览"}),Je=M(()=>no.value.find(e=>e.id===nt.value)??no.value[0]),Ue=M(()=>{const e=nt.value;return xl.value.find(a=>pl(a)===e)??null}),Ld=M(()=>{var a;const e=(a=Ue.value)==null?void 0:a.node_id;return e?dt.value[e]??[]:[]}),lt=M(()=>{var s;const e=(s=Ue.value)==null?void 0:s.node_id;if(!e)return null;const a=Ld.value,r=Gt.value[e];return a.find(c=>c.round.round_id===r)??a[0]??null}),ri=M(()=>{var a;const e=(a=Ue.value)==null?void 0:a.node_id;return e?$l.value[e]??"":""}),Gy=M(()=>{var a;const e=lt.value;return!e||e.legacy?"":he(e.round.prompt_snapshot,"model_route")||((a=e.candidates.find(r=>r.candidate.model_route))==null?void 0:a.candidate.model_route)||""}),Qf=M(()=>{var e,a;return OI((e=Ue.value)==null?void 0:e.node_key,(a=Ue.value)==null?void 0:a.node_type)}),zy=M(()=>{var a;const e=ta((a=at.value)==null?void 0:a.config.model_assignments)?at.value.config.model_assignments:void 0;return Qf.value?he(e,Qf.value):""}),Hy=M(()=>{var a,r;const e=(a=Ee.value)==null?void 0:a.profileId;return e&&((r=Jt.value.find(s=>s.profile_id===e))==null?void 0:r.default_model_route)||""}),Qy=M(()=>{var a;const e=ta((a=at.value)==null?void 0:a.config.generation)?at.value.config.generation:void 0;return he(e,"default_model")}),jo=M(()=>{var e;return DI({overrideRoute:ri.value,roundRoute:Gy.value,nodeRoute:(e=Ue.value)==null?void 0:e.model_route,assignmentRoute:zy.value,profileRoute:Hy.value,systemRoute:Qy.value})}),qd=M(()=>wu(jo.value.route)),Yf=M(()=>({override:"本次覆盖",round:"继承父轮次",node:"节点默认",assignment:"模型分工",profile:"角色默认",system:"系统默认",backend:"后端自动"})[jo.value.source]),Yy=M(()=>{var c,f;const e=ta((c=at.value)==null?void 0:c.config.model_assignments)?at.value.config.model_assignments:void 0,a=ta((f=at.value)==null?void 0:f.config.prompt_governance)?at.value.config.prompt_governance:void 0,r=ta(a==null?void 0:a.translation)?a.translation:void 0,s=he(r,"model_route")||he(e,"prompt_planning");return s?wu(s):"未配置(后端规则)"}),Jf=M(()=>{const e=[],a=new Set;for(const s of qo.value){const c=dc(s);!c||a.has(c)||(a.add(c),e.push({value:c,label:`${s.provider} / ${s.label}`}))}const r=ri.value;return r&&!a.has(r)&&e.unshift({value:r,label:wu(r)}),e}),Xf=M(()=>{var r;const e=ta((r=at.value)==null?void 0:r.config.model_assignments)?at.value.config.model_assignments:void 0,a=Array.isArray(e==null?void 0:e.generation_cross_review_routes)?e.generation_cross_review_routes.map(String):[];return qr([...a,he(e,"generation_cross_review_primary"),he(e,"generation_cross_review_secondary")].filter(Boolean))}),Jy=M(()=>{var a;const e=sl.value??lt.value;return e&&(he(e.round.prompt_snapshot,"model_route")||((a=e.candidates.slice().sort((r,s)=>r.candidate.candidate_index-s.candidate.candidate_index).find(r=>r.candidate.model_route))==null?void 0:a.candidate.model_route))||""}),Zf=M(()=>{const e=Jy.value;return qr([...Jf.value.map(r=>r.value),...Qn.value.filter(r=>r.modality==="image_generation").map(r=>r.route),...Xf.value].filter(r=>!!r&&r!==e)).map(r=>({value:r,label:wu(r)||r}))}),Xy=M(()=>{const e=new Set(Zf.value.map(a=>a.value));return Xf.value.filter(a=>e.has(a))}),ev=M(()=>{var a;return lr(((a=Ue.value)==null?void 0:a.node_key)||nt.value)==="headshot"?"cover":"contain"}),Ko=M(()=>{var e;return((e=lt.value)==null?void 0:e.candidates)??[]}),Zy=M(()=>{var a,r;const e=he((a=Ue.value)==null?void 0:a.metadata,"active_round_id");return e||(((r=Ld.value.find(s=>as(s.round.status)))==null?void 0:r.round.round_id)??"")}),e_=M(()=>Object.fromEntries(Ko.value.map(e=>{var a,r,s,c;return[e.candidate_id,Ln((a=e.image)==null?void 0:a.thumbnail_url)||Ln((r=e.image)==null?void 0:r.image_url)||Ln((s=e.image)==null?void 0:s.thumbnail_uri)||Ln((c=e.image)==null?void 0:c.image_uri)]}))),t_=M(()=>{var e;return((e=Ko.value.find(a=>a.is_final))==null?void 0:e.candidate_id)??""}),tv=M(()=>{const e=lt.value;if(!e||!Tt.value||!["completed","partial_success","awaiting_selection"].includes(Ge(e.round.status)))return!1;const a=e.candidates.filter(r=>r.candidate_id===Tt.value);return a.length===1&&ns(a[0])}),a_=M(()=>[Di.value,Oi.value].filter(Boolean)),ua=M(()=>{var e,a;return((e=sa.value)==null?void 0:e.workflow_type)===Cn&&((a=Ue.value)==null?void 0:a.node_type)==="generation"}),lu=M(()=>{var e,a;return!!((e=lt.value)!=null&&e.read_only)||Sr.value||Ge(((a=Ue.value)==null?void 0:a.status)??"")==="selected"}),av=M(()=>Ap(nt.value)),an=M(()=>!!av.value),lo=M(()=>{const e=av.value;return e?`请先完成上一节点「${e.title}」,完成并确认后会自动解锁当前节点。`:""}),nv=M(()=>{var e,a;return Zg((e=sa.value)==null?void 0:e.status,(a=sa.value)==null?void 0:a.metadata)}),Sr=M(()=>{var e;return Ge(((e=Ue.value)==null?void 0:e.status)??"")==="selected"||nv.value}),Al=M(()=>{var e,a,r;return WI((e=Ue.value)==null?void 0:e.status,(a=sa.value)==null?void 0:a.status,(r=sa.value)==null?void 0:r.metadata)}),Dd=M(()=>an.value||Al.value),ou=M(()=>{var e;return Dd.value||!!((e=sl.value)!=null&&e.read_only)}),n_=M(()=>{const e=lt.value;return!!(ua.value&&e&&!e.legacy&&e.candidates.some(a=>ns(a)))}),oo=M(()=>an.value||Sr.value||ua.value&&lu.value),l_=M(()=>Object.entries(Fa.value).filter(([,e])=>e.kind==="liked").map(([e])=>e)),o_=M(()=>l_.value.length>=3),lv=M(()=>{const e=lt.value;return!!(ua.value&&e&&!e.legacy&&e.candidates.length)}),Od=M(()=>Ko.value.filter(e=>ts(e.candidate_id)==="liked"&&ns(e)).length),r_=M(()=>{if(Al.value||an.value)return!1;const e=lt.value;if(!e)return!!jo.value.route;if(e.legacy||e.read_only||!e.candidates.length)return!1;const a=Od.value;return a>=1&&a<=3||!!fn.value.trim()}),i_=M(()=>{if(Al.value||an.value)return"";const e=lt.value;if(!e)return jo.value.route?`第一轮会使用当前节点提示词与${Yf.value}:${qd.value}。`:"当前节点和后端默认均未提供生图路由,请先在下方显式覆盖或前往设置配置。";if(e.legacy||e.read_only)return"历史兼容轮次只读,不能继续生成。";if(!e.candidates.length)return"当前轮次候选尚未就绪,请等待同步完成。";const a=Od.value;return fn.value.trim()?a?`点击后会先保存对话反馈,再以 ${a} 张喜欢候选创建下一轮。`:"点击后会先保存对话反馈;保存结果必须包含 1–3 张成功且喜欢的候选。":a?`将以 ${a} 张成功且喜欢的候选创建下一轮。`:"请先把 1–3 张生成成功的候选标记为“喜欢”,再开始下一轮。"}),s_=M(()=>Df.value),u_=M(()=>{var e;return((e=ul.value)==null?void 0:e.material_bindings.selected_material_ids)??[]}),Wd=M(()=>{var e;return!!((e=ul.value)!=null&&e.writable&&!Al.value&&!an.value)}),d_=M(()=>{var a,r;return he((r=(a=ul.value)==null?void 0:a.lock)==null?void 0:r.details,"required_action")==="create_branch"||Al.value}),Ud=M(()=>{var e,a,r;return an.value?lo.value:Al.value?`${Vo.value} 当前素材绑定保持可查看;创建分支后才能修改。`:(e=ul.value)!=null&&e.writable?"":((r=(a=ul.value)==null?void 0:a.lock)==null?void 0:r.message)||"当前节点素材绑定为只读状态。"}),c_=M(()=>{const e=lt.value;return e&&!e.legacy?e.round.display_code:""}),Vo=M(()=>{var a,r;const e=Ue.value;return e?nv.value?`工作流已经封存,节点「${((a=Je.value)==null?void 0:a.title)??e.title}」仅可查看。要继续修改,请先创建可编辑分支。`:`节点「${((r=Je.value)==null?void 0:r.title)??e.title}」已经确认采用并锁定。要修改这里,请先从当前节点创建分支。`:""}),Fd=M(()=>{var e;return((e=Je.value)==null?void 0:e.id)==="brief-import"}),Qi=M(()=>{var e;return((e=Je.value)==null?void 0:e.id)==="persona-split"}),jd=M(()=>{var e;return((e=Je.value)==null?void 0:e.id)==="prompt-plan"}),Kd=M(()=>{var e;return((e=Je.value)==null?void 0:e.id)==="material-bind"}),f_=M(()=>Fd.value||Qi.value||jd.value||Kd.value),Yi=M(()=>{const e=Ee.value,a=_n.value.map(s=>s.label).join("、"),r=Je.value;return[{id:"identity",title:"身份与性格",detail:"给后续提示词规划提供角色核心和行为约束。",fields:[$n("name","角色名",e.name,"用于所有节点保持角色一致。"),$n("identity","身份定位",e.identity,"职业、阵营、处境或世界观身份。"),$n("personality","性格关键词",e.personality,"外显性格、内在矛盾和行动方式。")]},{id:"appearance",title:"外观锚点",detail:"锁定头像、半身和全身节点必须继承的识别特征。",fields:[$n("hair_color","发色",e.hairColor,"头发主色,避免后续节点漂移。"),$n("hairstyle","发型",e.hairstyle,"长度、刘海、轮廓和辨识度。"),$n("eye_color","眼睛",e.eyeColor,"瞳色、眼神和表情基调。"),$n("body_feature","身形/记忆点",(r==null?void 0:r.lockedItems)??"","身高、体型、伤疤、义体等复杂问卷字段。")]},{id:"outfit",title:"服装与素材",detail:"拆成服装、配饰、参考素材和风格锁定项。",fields:[$n("clothing","服装轮廓",e.clothing,"上衣、鞋袜、材质和层次。"),$n("materials","参考素材",a,"当前已选素材会作为后续节点参考。"),$n("style","风格锁定",e.style,"画风、镜头、光照、世界观氛围。")]},{id:"guard",title:"约束与负面项",detail:"用于减少跑偏、冲突和不想要的设计方向。",fields:[$n("negative","禁用项",e.negative,"负面词、避雷内容和结构约束。"),$n("conflict","冲突检查",(r==null?void 0:r.decision)||"暂无冲突","字段确认后可进入提示词规划。"),$n("prompt","节点提示词",(r==null?void 0:r.prompt)??"","后端 LLM 拆解后写回的节点 prompt。")]}]}),ru=M(()=>Yi.value.reduce((e,a)=>e+a.fields.length,0)),iu=M(()=>Yi.value.reduce((e,a)=>e+a.fields.filter(r=>r.status==="ready").length,0)),v_=M(()=>{const e=Je.value;return[{label:"字段",value:`${iu.value}/${ru.value}`,hint:"已拆解字段"},{label:"节点",value:Rr((e==null?void 0:e.status)??"waiting"),hint:(e==null?void 0:e.phase)??"persona-split"},{label:"来源",value:Ee.value.status,hint:Ee.value.updatedAt}]}),ov=M(()=>{const e=Ee.value,a=e.negative||et.value.negativePrompt||"low quality, blurry, bad anatomy",r=[e.name,e.identity,e.personality,ui(e),e.style].filter(Boolean).join(", ");return[{id:"portrait",title:"头像节点",target:"headshot",prompt:`${r}, face reference, clear eyes, recognizable hairstyle`,negative:a,inherits:["角色名","发色","发型","眼睛","五官识别"],weight:"身份 1.25 / 风格 0.85",status:"可写入"},{id:"bust",title:"半身节点",target:"half_body",prompt:`${r}, upper body, outfit silhouette, calm pose`,negative:a,inherits:["五官识别","发型","上身服装","姿态"],weight:"身份 1.2 / 服装 1.05",status:"可写入"},{id:"fullbody",title:"全身节点",target:"full_body",prompt:`${r}, full body standing pose, complete outfit, shoes and accessories`,negative:a,inherits:["身份","身体比例","服装","鞋袜","配饰"],weight:"比例 1.15 / 配饰 0.9",status:"可写入"},{id:"sheet",title:"设定图节点",target:"expression_sheet / pose_sheet",prompt:`${r}, character design sheet, multi angle, expression and pose references`,negative:a,inherits:["身份","服装","风格","表情","姿势"],weight:"一致性 1.3 / 细节 1.05",status:"可写入"}]}),p_=M(()=>[{label:"负面提示词",value:Ee.value.negative||et.value.negativePrompt||"-",status:"ready"},{label:"语言策略",value:"中文输入由后端 LLM 自动翻译并合并为英文提示词,不丢弃专名和禁用项。",status:"ready"},{label:"权重建议",value:"身份特征和发眼锚点优先,服装/配饰中等权重,风格低于身份。",status:"ready"}]),m_=M(()=>me.map(e=>{const a=vl(e.category);return{category:e.category,selectedLabel:(a==null?void 0:a.label)??"不使用参考",selectedPrompt:(a==null?void 0:a.prompt)??"默认不注入参考素材,只有显式选择后才进入后端素材绑定。",stages:sp(e.category),strength:a?up(e.category):"弱",required:!!(a&&["风格","服装"].includes(e.category)),colors:(a==null?void 0:a.colors)??e.colors}})),g_=M(()=>{var a;const e=Je.value;return ua.value&&((a=lt.value)!=null&&a.candidates.length)?`${e.title} / ${lt.value.round.display_code} / 可按编号记录喜欢、拒绝、严格拒绝、待定稿和下一轮调整。`:`${e.title} / ${e.phase} / 自动识别节点上下文,交由后端 LLM 翻译为英文提示词注入。`}),Vd=M(()=>Jo(xl.value.flatMap(a=>jt.value[a.node_id]??[])).filter(a=>a.workflow_id===Ee.value.workflowId&&xl.value.some(r=>r.node_id===a.node_id))),Bn=M(()=>{var s,c,f;if(ua.value&<.value)return Ko.value.flatMap(b=>{var V;if(!b.image)return[];const C=os(b.image),O=[b.candidate.provider_id,b.candidate.provider_model].filter(Boolean).join("/");return[{...C,title:b.display_code,model:O||b.candidate.model_route||C.model,status:Wb(b.candidate.generation_status),source:`${((V=lt.value)==null?void 0:V.round.display_code)??"Round"} / ${b.display_code}`,metadata:{...b.image.metadata??{},candidate_id:b.candidate_id,candidate_display_code:b.display_code,round_id:b.round_id}}]});const e=new Map(Vd.value.map(b=>[b.image_id,b]));return((c=(s=Je.value)==null?void 0:s.imageIds)!=null&&c.length?Je.value.imageIds:(f=Je.value)!=null&&f.imageId?[Je.value.imageId]:[]).map(b=>e.get(b)).filter(b=>!!b)}),Ml=M(()=>Bn.value.find(e=>xt(e)===Pn.value)??null),bn=M(()=>{const e=new Map(Bn.value.map(a=>[xt(a),a]));return Ta.value.map(a=>e.get(a)).filter(a=>!!a)}),y_=M(()=>Bn.value.find(e=>xt(e)===Tt.value)??null),su=M(()=>{const e=y_.value;return e&&hn(e)?e:null}),__=M(()=>bn.value.map((e,a)=>{var r,s;return{id:e.image_id,displayCode:he(e.metadata,"candidate_display_code")||he(e.metadata,"display_code")||`${((r=Je.value)==null?void 0:r.round)||((s=Je.value)==null?void 0:s.title)||"候选"}-${String(a+1).padStart(2,"0")}`,title:Ga(e),src:Ca(e),model:e.model,status:e.status}})),b_=M(()=>{const e=Je.value;return e?[{label:"阶段",value:e.phase??"-"},{label:"进度",value:`${e.progress??0}%`},{label:"队列",value:e.queue??"-"},{label:"尝试",value:e.attempt??"-"},{label:"预计",value:e.eta??"-"},{label:"依赖",value:e.dependsOn??"-"},{label:"轮次",value:e.round??"-"},{label:"锁定项",value:e.lockedItems??"-"},{label:"本轮结论",value:e.decision??"-"},{label:"输入",value:e.input??"-"},{label:"产物",value:e.result??e.outputCount??"-"},{label:"状态",value:Rr(e.status)},{label:"模型",value:e.model},{label:"耗时",value:e.duration},{label:"说明",value:e.detail},{label:"提示词",value:e.prompt}]:[]}),rv=M(()=>{var Fe,oa,Aa,qn,Ma,ln,Dn,Tl,Zo,Bl;const e=(Fe=ne.value)==null?void 0:Fe.feature_flags,a=(oa=ne.value)==null?void 0:oa.permissions,r=!!(a!=null&&a.can_write),s=!!(a!=null&&a.can_retry_tasks),c=!!(e!=null&&e.workspace&&r),f=Ee.value,b=f==null?void 0:f.workflowId,C=b?pt.value[b]:void 0,O=!!((C==null?void 0:C.status)==="completed"||(Aa=C==null?void 0:C.metadata)!=null&&Aa.final_archive_history_id),V=!!(c&&b),ce=!!(c&&(f!=null&&f.profileId)),pe=Al.value,Ve=an.value,Oe=!!(r&&!pe&&!Ve),Xe=!!(r&&!Sr.value&&!Ve),ke=Je.value,Ze=(qn=Bd.value)==null?void 0:qn.id,At=ta((ln=(Ma=Ue.value)==null?void 0:Ma.metadata)==null?void 0:ln.prompt_plan),la=ta((Tl=(Dn=Ue.value)==null?void 0:Dn.metadata)==null?void 0:Tl.material_bindings),za=f?Ow(Yo("hires-fix",f)):[],bt=(Zo=su.value)!=null&&Zo.image_id&&(!ua.value||tv.value)?su.value.image_id:void 0,Ha=wa.value?"保存中":ll.value?"保存失败":Zl.value?po(Zl.value):b?"可保存":"先生成档案",xa={id:"version",title:"保存快照",detail:ll.value||"把当前工作流、节点和选中角色卡摘要写入后端 workflow_history。",badge:"Save",state:Ha,tone:b?"accent":"neutral",action:wa.value?"保存中":"保存快照",enabled:!!(V&&!wa.value),actionKey:"workflowSaveVersion"},da={id:"branch-from-node",title:"从此节点创建分支",detail:v.value||Vo.value||"当前节点已锁定,修改会进入新的工作流分支。",badge:"Branch",state:w.value?"创建中":le.value?`切换 ${le.value}`:(Bl=Ue.value)!=null&&Bl.branch_name?`基于 ${Ue.value.branch_name}`:"等待后端节点",tone:"warn",action:w.value?"创建中":"创建分支",enabled:!!(V&&Ue.value&&!w.value&&!le.value),actionKey:"workflowCreateBranchFromNode"},x=pe?[da,xa]:[xa];return Ve?[{id:"progression-lock",title:"节点尚未解锁",detail:lo.value,badge:"Lock",state:"等待上一节点",tone:"neutral",action:"等待解锁",enabled:!1,actionKey:"workflowNodeGenerate"}]:Sr.value?[da,xa]:Ze==="profile-prep"?(ke==null?void 0:ke.id)==="brief-import"?[{id:"new-profile",title:"创建角色档案",detail:"打开问卷,新建粗略人设并作为工作流输入。",badge:"Profile",state:"问卷入口",tone:"primary",action:"填写问卷",enabled:!0,actionKey:"personaQuestionnaire"},{id:"external-profile",title:"导入外部角色卡",detail:"粘贴外部人设文本,自动识别并填入角色档案问卷。",badge:"Paste",state:"文本识别",tone:"accent",action:"粘贴导入",enabled:!0,actionKey:"externalProfileImport"},{id:"split-next",title:"进入设定拆解",detail:Po.value||`使用当前选中的 ${f.name} 通过后端工作流进入 LLM 拆解。`,badge:"Next",state:Io.value?"拆解中":b?"已落库":f.profileId?"可创建工作流":"先生成档案",tone:"primary",action:Io.value?"拆解中":"拆解",enabled:!!(ce&&!Io.value),actionKey:"workflowPersonaSplit"},xa]:(ke==null?void 0:ke.id)==="persona-split"?[{id:"split-run",title:"重新拆解设定",detail:"用当前角色档案重新生成结构化字段。",badge:"LLM",state:r?"可拆解":"只读",tone:"primary",action:"拆解",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeGenerate"},{id:"field-review",title:"确认字段",detail:"检查身份、外观、服装、配饰和禁用项。",badge:"Check",state:`${iu.value}/${ru.value}`,tone:"accent",action:"确认",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeComplete"},{id:"prompt-next",title:"进入提示词规划",detail:"把结构化字段转入提示词矩阵。",badge:"Next",state:"下一节点",tone:"primary",action:"规划",enabled:!0,actionKey:"workflowPromptPlanNext"},...x]:(ke==null?void 0:ke.id)==="prompt-plan"?[{id:"prompt-build",title:"生成提示词矩阵",detail:"生成头像、半身、全身和设定图提示词。",badge:"Prompt",state:"6 条提示词",tone:"primary",action:"生成",enabled:!!(Oe&&!Le.value),actionKey:"workflowPromptPlanSave"},{id:"negative-check",title:"校验负面词",detail:"检查负面提示词、权重和冲突项。",badge:"Guard",state:"待校验",tone:"warn",action:"校验",enabled:!!(Oe&&!Le.value),actionKey:"workflowPromptPlanSave"},{id:"prompt-confirm",title:"确认提示词规划",detail:At?"确认当前提示词矩阵并完成本节点,随后解锁素材绑定。":"请先保存提示词矩阵,再确认并解锁下一节点。",badge:"Next",state:At?"可确认":"等待保存",tone:"accent",action:"确认并解锁",enabled:!!(At&&Oe&&!Le.value),actionKey:"workflowPromptPlanComplete"},...x]:[{id:"material-bind",title:"绑定参考素材",detail:"把风格、构图、服装、鞋袜和配饰写入节点参数。",badge:"Material",state:"5 类参考",tone:"primary",action:"绑定",enabled:!!(Oe&&!Le.value),actionKey:"workflowMaterialBindSave"},{id:"open-materials",title:"打开素材库",detail:"补充或替换当前角色参考素材。",badge:"Library",state:"素材入口",tone:"accent",action:"素材",enabled:!0,nav:"materials",module:"images"},{id:"draft-next",title:"确认素材绑定",detail:la?"确认当前素材绑定并完成本节点,随后解锁头像草稿。":"请先保存素材绑定,再确认并解锁头像草稿。",badge:"Next",state:la?"可确认":"等待保存",tone:"primary",action:"确认并解锁",enabled:!!(la&&Oe&&!Le.value),actionKey:"workflowMaterialBindComplete"},...x]:Ze==="portrait-draft"?[{id:"portrait-generate",title:"生成头像草稿",detail:"按当前轮次生成头像和半身候选。",badge:"Draft",state:(ke==null?void 0:ke.round)??"草稿轮次",tone:"primary",action:"生成",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeGenerate"},{id:"portrait-compare",title:"对比候选",detail:"平铺当前选中的草稿进行大图对比。",badge:"Compare",state:`${bn.value.length} 已选`,tone:"accent",action:"对比",enabled:bn.value.length>1,actionKey:"workflowCompare"},{id:"portrait-retry",title:"再跑一轮",detail:"保留锁定元素,创建下一轮头像草稿节点。",badge:"Retry",state:s?"可重试":"无权限",tone:s?"warn":"neutral",action:"重试",enabled:!!(s&&!pe&&!Le.value),actionKey:"workflowNodeRetry"},{id:"portrait-review",title:"审查当前节点",detail:"读取后端同提示词多模型审查结果,记录候选评分和问题。",badge:"Review",state:bn.value.length?`${bn.value.length} 张候选`:"待候选",tone:"accent",action:"审查",enabled:!!(Xe&&!Le.value),actionKey:"workflowNodeReview"},{id:"portrait-adopt",title:"确认采用",detail:bt?"采用当前定稿的头像/半身候选,锁定本节点并交接到下一流程。":"请先在候选卡片上标记一张真实后端图片为定稿。",badge:"Adopt",state:bt?"可采用":"待候选",tone:"primary",action:"采用",enabled:!!(Xe&&bt&&!Le.value),actionKey:"workflowReviewAdopt"},...x]:Ze==="body-sheet"?[{id:"body-generate",title:"生成设定图",detail:"生成全身、手部、配饰或拆分设定图。",badge:"Sheet",state:(ke==null?void 0:ke.title)??"设定图",tone:"primary",action:"生成",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeGenerate"},{id:"detail-fix",title:"细节补图",detail:"针对手部、鞋袜、配饰等局部继续补图。",badge:"Fix",state:(ke==null?void 0:ke.outputCount)??"待产物",tone:"accent",action:"补图",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeGenerate"},{id:"body-retry",title:"重跑当前设定",detail:"保留人设锁定项,重跑当前设定图节点。",badge:"Retry",state:s?"可重试":"无权限",tone:s?"warn":"neutral",action:"重试",enabled:!!(s&&!pe&&!Le.value),actionKey:"workflowNodeRetry"},{id:"body-review",title:"审查当前节点",detail:"按当前设定图节点拉取后端审查结果,确认可用候选和异常项。",badge:"Review",state:bn.value.length?`${bn.value.length} 张候选`:"待候选",tone:"accent",action:"审查",enabled:!!(Xe&&!Le.value),actionKey:"workflowNodeReview"},{id:"body-adopt",title:"确认采用",detail:bt?"采用当前定稿的设定图候选,锁定本节点并放入高清修复桶。":"请先在候选卡片上标记一张真实后端图片为定稿。",badge:"Adopt",state:bt?"可采用":"待候选",tone:"primary",action:"采用",enabled:!!(Xe&&bt&&!Le.value),actionKey:"workflowReviewAdopt"},...x]:[{id:"hires",title:"高清修复与统一风格",detail:"对选中结果进行高清修复和统一风格。",badge:"Fix",state:(ke==null?void 0:ke.title)??"修复节点",tone:"accent",action:"修复",enabled:!!(Oe&&!Le.value),actionKey:"workflowNodeGenerate"},{id:"hires-adopt",title:"确认修复结果",detail:bt?"采用当前定稿修复图,锁定修复节点并交接到入库。":"请先完成高清修复并将一张真实后端图片标记为定稿。",badge:"Adopt",state:bt?"可采用":"待成品",tone:"primary",action:"采用",enabled:!!(Xe&&nt.value==="hires-fix"&&bt&&!Le.value),actionKey:"workflowReviewAdopt"},{id:"archive",title:"入库",detail:"把最终结果保存为可复用角色版本。",badge:"Archive",state:O?"已入库":`${za.length} 张成品`,tone:"accent",action:"入库",enabled:!!(r&&(f!=null&&f.workflowId)&&za.length&&!O&&!Le.value),actionKey:"workflowArchiveFinal"},...x]});function w_(e){return{Save:"保存",Branch:"分支",Profile:"档案",Paste:"导入",Next:"下一步",LLM:"LLM",Check:"确认",Prompt:"提示词",Guard:"校验",Material:"素材",Library:"素材库",Draft:"草稿",Compare:"对比",Retry:"重跑",Review:"审查",Adopt:"采用",Sheet:"设定图",Fix:"修复",Pick:"选图",Archive:"入库",Gallery:"图库"}[e]??e}function iv(e){return{version:"保存","branch-from-node":"分支","new-profile":"建档","external-profile":"导入","split-next":"拆解","split-run":"拆解","field-review":"确认","prompt-next":"规划","prompt-build":"生成","negative-check":"校验","material-next":"绑定","material-bind":"绑定","open-materials":"素材","draft-next":"草稿","portrait-generate":"生成","portrait-compare":"对比","portrait-retry":"重跑","portrait-review":"审查","portrait-adopt":"采用","body-generate":"生成","detail-fix":"补图","body-retry":"重跑","body-review":"审查","body-adopt":"采用","hires-adopt":"采用",review:"审核",hires:"修复",archive:"入库"}[e.id]??e.action}const ga=M(()=>Ia.value.filter(e=>["failed","dead_letter","cancelled"].includes(Ge(e.status)))),ro=M(()=>Ia.value.filter(e=>["running","queued","created","pending","retrying"].includes(Ge(e.status)))),Go=M(()=>Ia.value.filter(e=>["completed","succeeded","superseded"].includes(Ge(e.status)))),io=M(()=>[...ga.value,...Go.value]),h_=M(()=>[{key:"active",label:"运行中",count:ro.value.length},{key:"failed",label:"需处理",count:ga.value.length},{key:"done",label:"已完成",count:Go.value.length},{key:"all",label:"全部",count:Ia.value.length}]),zo=M(()=>yt.value==="active"?ro.value:yt.value==="failed"?ga.value:yt.value==="done"?Go.value:Ia.value),Rl=M(()=>zo.value.length?zo.value.find(e=>e.task_id===Na.value)??zo.value[0]:null),k_=M(()=>{var e,a,r,s,c,f,b;return[{label:"队列总量",value:String(Ia.value.length),hint:`运行 ${((e=J.value)==null?void 0:e.queue.running)??ro.value.length} / 等待 ${((a=J.value)==null?void 0:a.queue.pending)??0} / 终态 ${io.value.length}`,state:Ia.value.length>20?"warn":Ia.value.length>0?"good":"idle"},{label:"正在处理",value:String(ro.value.length||((r=J.value)==null?void 0:r.queue.running)||0),hint:ro.value[0]?Xo(ro.value[0]):"当前没有运行中的任务",state:ro.value.length?"good":"idle"},{label:"异常任务",value:String(ga.value.length||((s=J.value)==null?void 0:s.queue.failed)||0),hint:`死信 ${((c=J.value)==null?void 0:c.queue.dead_letter)??0}`,state:ga.value.length||(((f=J.value)==null?void 0:f.queue.dead_letter)??0)>0?"bad":"good"},{label:"今日吞吐",value:String(((b=J.value)==null?void 0:b.today_generation_count)??0),hint:"生成请求统计",state:"good"}]}),$_=M(()=>{const e=Rl.value;if(!e)return[{label:"任务",value:"未选中"},{label:"状态",value:"队列空闲"},{label:"提示",value:"新的生成任务会在这里显示详情"}];const a=Mp(e),r=[{label:"任务摘要",value:a.summary},{label:"业务类型",value:a.category},{label:"状态",value:Dl(e.status)},{label:"模型路由",value:e.model_route||"-"},{label:"进度",value:`${Lu(e)}%`},{label:"耗时 / 后端时限",value:jc(e)},{label:"角色",value:a.profileName||"未关联角色"},{label:"工作流",value:a.workflowName||"未关联工作流"},{label:"节点",value:a.nodeName||"未关联节点"},{label:"创建",value:po(e.created_at)},{label:"更新",value:po(e.updated_at)},{label:"错误",value:e.error_message||"-"},{label:"任务 ID",value:e.task_id},{label:"后端类型",value:e.task_type||"-"}];return e.profile_id&&r.push({label:"角色 ID",value:e.profile_id}),e.workflow_id&&r.push({label:"工作流 ID",value:e.workflow_id}),e.node_id&&r.push({label:"节点 ID",value:e.node_id}),e.idempotency_key&&r.push({label:"幂等键",value:e.idempotency_key}),r}),Ji=M(()=>{var b,C,O,V;const e=!!((b=ne.value)!=null&&b.permissions.can_write),a=!!((C=ne.value)!=null&&C.permissions.can_retry_tasks),r=e&&a,s=Rl.value,c=s?N.job(s.task_id):N.jobs,f=En.value;return[{id:"refresh",title:"刷新队列",detail:"重新拉取任务列表、Dashboard 摘要和最新错误。",badge:"GET",endpoint:N.jobs,action:gn.value||f==="refresh"?"同步中":"刷新",tone:"good",enabled:!gn.value&&!f},{id:"retry",title:"重试选中任务",detail:r?s?ga.value.some(ce=>ce.task_id===s.task_id)?"立即使用原请求创建并执行新任务;原任务会保留为已被重试替代。":"当前选中的任务不是失败、取消或死信状态。":"请先在任务列表中选择一条异常记录。":"当前账号缺少任务重试权限。",badge:"POST",endpoint:s?N.jobRetry(s.task_id):N.jobDeadLetterRetry,action:f==="retry"?"执行中":"立即重试",tone:"warn",enabled:!!(!f&&s&&e&&a&&ga.value.some(ce=>ce.task_id===s.task_id))},{id:"retry-all-failed",title:"一键重试全部失败任务",detail:r?ga.value.length?`当前检测到 ${ga.value.length} 条失败、取消或死信记录;将逐条创建替代任务,旧记录会标记为已被重试替代。`:"当前没有可重试的失败、取消或死信记录。":"当前账号缺少任务重试权限。",badge:"BATCH",endpoint:N.jobRetryFailed,action:f==="retry-all-failed"?"批量处理中":"一键重试全部",tone:"warn",enabled:!!(!f&&e&&a&&ga.value.length>0)},{id:"cancel",title:"取消运行任务",detail:"对 running / queued / pending 任务发送取消请求。",badge:"POST",endpoint:s?N.jobCancel(s.task_id):c,action:f==="cancel"?"取消中":"取消",tone:"bad",enabled:!!(!f&&s&&e&&ro.value.some(ce=>ce.task_id===s.task_id))},{id:"delete",title:"删除选中终态记录",detail:r?s?io.value.some(ce=>ce.task_id===s.task_id)?"删除选中的异常或已完成任务记录,并释放节点对旧任务的引用;不会删除图库图片。":"运行中、排队中和重试中的任务不能删除。":"请先选择一条异常或已完成记录。":"当前账号缺少任务清理权限。",badge:"DELETE",endpoint:s?N.jobDelete(s.task_id):N.jobs,action:f==="delete"?"删除中":"删除记录",tone:"bad",enabled:!!(!f&&s&&e&&a&&io.value.some(ce=>ce.task_id===s.task_id))},{id:"clear-failed",title:"清理异常记录",detail:r?ga.value.length?`当前检测到 ${ga.value.length} 条失败、取消或死信记录,单次最多清理 100 条。`:"当前没有失败、取消或死信记录,无需清理。":"当前账号缺少任务清理权限。",badge:"CLEAN",endpoint:N.jobClearFailed,action:f==="clear-failed"?"清理中":"清理异常",tone:"bad",enabled:!!(!f&&e&&a&&ga.value.length>0)},{id:"clear-completed",title:"清理已完成记录",detail:r?Go.value.length?`当前检测到 ${Go.value.length} 条已完成、成功或已替代记录;生成图片会保留。`:"当前没有已完成记录,无需清理。":"当前账号缺少任务清理权限。",badge:"DONE",endpoint:N.jobClearTerminal,action:f==="clear-completed"?"清理中":"清理完成项",tone:"idle",enabled:!!(!f&&e&&a&&Go.value.length>0)},{id:"clear-terminal",title:"清理全部终态记录",detail:r?io.value.length?`当前共有 ${io.value.length} 条终态记录;运行中、排队中和重试中的任务不会删除。`:"当前没有可清理的终态记录。":"当前账号缺少任务清理权限。",badge:"ALL",endpoint:N.jobClearTerminal,action:f==="clear-terminal"?"清理中":"清理终态",tone:"bad",enabled:!!(!f&&e&&a&&io.value.length>0)},{id:"dead-letter-retry",title:"重试死信任务",detail:"顺序创建并执行最多 5 个替代任务,避免无人消费的假排队。",badge:"DLQ",endpoint:N.jobDeadLetterRetry,action:f==="dead-letter-retry"?"处理中":"重试死信",tone:"warn",enabled:!!(!f&&e&&a&&(((O=J.value)==null?void 0:O.queue.dead_letter)??0)>0)},{id:"failed-to-dead-letter",title:"失败移入死信",detail:"批量把失败任务移入死信队列,避免重复污染普通失败列表。",badge:"DLQ",endpoint:N.jobDeadLetterMoveFailed,action:f==="failed-to-dead-letter"?"移动中":"移入死信",tone:"idle",enabled:!!(!f&&e&&a&&(((V=J.value)==null?void 0:V.queue.failed)??ga.value.length)>0)}]}),C_=M(()=>{const e=Ao.value,a=Mo.value,r="#d65b7f",s="#d2a23a",c="#667085";return{"--primary":e,"--accent":a,"--primary-soft":co(e,.15),"--primary-strong":co(e,.32),"--accent-soft":co(a,.15),"--accent-strong":co(a,.34),"--rail-start":Ic(e,"#ffffff",.12),"--rail-mid":Ic(e,a,.16),"--rail-end":Ic(e,"#111827",.18),"--danger":r,"--danger-soft":co(r,.14),"--danger-strong":co(r,.34),"--warn":s,"--warn-soft":co(s,.16),"--warn-strong":co(s,.34),"--neutral":c,"--neutral-soft":co(c,.14)}}),Gd=M(()=>{var f,b,C,O,V,ce,pe,Ve,Oe;const e=((f=J.value)==null?void 0:f.plugin_status)??"stopped",a=(b=W.value)==null?void 0:b.totals,r=Number((a==null?void 0:a.estimated_cost)??0)>0,s=_d.value?"读取中":Vi.value?"读取失败":r&&W.value?O$(W.value):"未配置可信价格",c=a?`真实用量 ${a.task_count} 次 / ${a.image_count} 张 / ${a.total_tokens} tokens${r?";后端估算":";不按零成本展示"}`:Vi.value||"等待今日用量接口";return[{label:"服务状态",value:Dl(e),hint:yn.value?"连接异常":"Dashboard summary",state:e==="running"?"good":e==="degraded"?"warn":"bad"},{label:"队列压力",value:String(Bo.value),hint:`等待 ${((C=J.value)==null?void 0:C.queue.pending)??0} / 失败 ${((O=J.value)==null?void 0:O.queue.failed)??0}`,state:Bo.value>20?"warn":"good"},{label:"运行任务",value:String(((V=J.value)==null?void 0:V.queue.running)??ro.value.length),hint:"当前执行负载",state:(((ce=J.value)==null?void 0:ce.queue.running)??0)>0?"good":"idle"},{label:"今日调用",value:String(((pe=J.value)==null?void 0:pe.today_generation_count)??0),hint:"生成请求统计",state:"good"},{label:"今日成本",value:s,hint:c,state:Vi.value?"warn":r?"good":"idle"},{label:"存储占用",value:go(((Ve=J.value)==null?void 0:Ve.storage.total_bytes)??0),hint:`图片 ${go(((Oe=J.value)==null?void 0:Oe.storage.images_bytes)??0)}`,state:"good"}]}),S_=M(()=>Gd.value.filter(e=>["服务状态","队列压力","存储占用"].includes(e.label))),Ir=M(()=>{const e=Ws.value.trim().toLowerCase();return e?de.filter(a=>[a.title,a.description,...a.keywords].join(" ").toLowerCase().includes(e)).slice(0,6):de.slice(0,5)}),sv=M(()=>Yr.value),Xi=M(()=>{var a,r,s;const e=[];for(const c of Ia.value){const f=Ge(c.status);["completed","succeeded"].includes(f)&&e.push({id:`job-completed-${c.task_id}`,type:"completed",title:"生图任务已完成",detail:Xo(c),createdAt:c.updated_at||c.created_at}),["failed","dead_letter","cancelled"].includes(f)&&e.push({id:`job-failed-${c.task_id}`,type:"failed",title:"任务需要处理",detail:c.error_message||Xo(c),createdAt:c.updated_at||c.created_at})}for(const c of Ye.value){const f=Ge(c.status);["completed","succeeded"].includes(f)&&e.push({id:`generation-completed-${c.task_id}`,type:"completed",title:"生成日志已完成",detail:`${c.task_id} / ${c.progress}%`,createdAt:c.updated_at||c.created_at})}for(const c of it.value.slice(0,6))e.push({id:`error-${c.source}-${c.id}`,type:"failed",title:c.source||"错误日志",detail:c.error_message||c.status,createdAt:c.created_at});return(((a=J.value)==null?void 0:a.queue.dead_letter)??0)>0&&e.push({id:"queue-dead-letter",type:"warning",title:"死信队列有待处理任务",detail:`${((r=J.value)==null?void 0:r.queue.dead_letter)??0} 个任务等待重试或归档`,createdAt:ei.value}),((s=J.value)==null?void 0:s.plugin_status)==="degraded"&&e.push({id:"system-degraded",type:"system",title:"服务处于降级状态",detail:"部分接口可能暂时不可用",createdAt:ei.value}),Wh(e).filter(c=>!Zr.value.includes(c.id)).sort((c,f)=>ml(f.createdAt)-ml(c.createdAt)).slice(0,12)}),uv=M(()=>Xi.value.filter(e=>ji.value==="all"||e.type===ji.value)),zd=M(()=>Xi.value.filter(e=>!Rn.value.includes(e.id)).length),dv=M(()=>Xi.value.slice(0,3)),Hd=M(()=>{var a,r,s,c,f,b;const e=[];return(ga.value.length||(((a=J.value)==null?void 0:a.queue.failed)??0)>0||(((r=J.value)==null?void 0:r.queue.dead_letter)??0)>0)&&e.push({id:"retry-failed",tone:"retry",title:"处理失败任务",detail:`${ga.value.length||((s=J.value)==null?void 0:s.queue.failed)||0} 条任务可能需要重试或查看错误原因`,action:"查看队列",nav:"queue",module:"queue"}),it.value.length&&e.push({id:"read-errors",tone:"confirm",title:"确认最新错误",detail:((c=it.value[0])==null?void 0:c.error_message)||"错误日志已有新条目",action:"打开日志",nav:"logs",module:"logs"}),(((f=J.value)==null?void 0:f.today_generation_count)??0)>40&&e.push({id:"cost-watch",tone:"cost",title:"今日调用偏高",detail:"建议检查模型路由和批量生成成本",action:"查看监控",nav:"performance",module:"performance"}),(b=ne.value)!=null&&b.feature_flags.api_discovery||e.push({id:"config-discovery",tone:"config",title:"能力档案检查未开启",detail:"这里仅做 metadata-only 元数据检查,不会发送真实生图探测请求。",action:"检查设置",nav:"settings",module:"settings"}),!Ia.value.length&&!yn.value&&e.push({id:"continue-flow",tone:"flow",title:"队列空闲",detail:"可以开始新的角色图或素材生成",action:"进入生成",nav:"generate",module:"generate"}),e.slice(0,4)}),I_=M(()=>{var f,b;const e=(f=ne.value)==null?void 0:f.permissions,a=(b=ne.value)==null?void 0:b.feature_flags,r=!!(e!=null&&e.can_write),s=!!(e!=null&&e.can_retry_tasks),c=!!(e!=null&&e.can_manage_materials);return[{id:"new-generation",group:"创建入口",title:"新建图片任务",detail:"从提示词、角色或节点继续生成,最终提交到任务队列。",badge:"核心入口",endpoint:N.nodeGenerate(":nodeId"),state:r?"可接入":"只读权限",tone:r?"primary":"neutral",action:"待排布表单",enabled:r},{id:"quick-profile",group:"创建入口",title:"快速角色草稿",detail:"先生成角色基础信息,再进入角色工作流补图。",badge:"角色起步",endpoint:N.quickProfileDraft,state:a!=null&&a.quick_profile?"已开启":"未开启",tone:a!=null&&a.quick_profile?"accent":"neutral",action:"放入角色入口",enabled:!!(a!=null&&a.quick_profile&&r),nav:"profiles",module:"suggestions"},{id:"workflow-create",group:"创建入口",title:"角色工作流",detail:"按角色保存多节点流程,支持启动、取消、归档和续跑。",badge:"流程",endpoint:N.profileWorkflows(":profileId"),state:a!=null&&a.workspace?"已开启":"未开启",tone:a!=null&&a.workspace?"primary":"neutral",action:"整理工作流",enabled:!!(a!=null&&a.workspace&&r),nav:"profiles",module:"suggestions"},{id:"prompt-compose",group:"创作控制",title:"提示词组合",detail:"组合基础、外观、风格、负面词和本次生成描述。",badge:"Prompt",endpoint:"local/prompt-composer",state:"待排布",tone:"primary",action:"做成主输入区",enabled:!0},{id:"node-generate",group:"创作控制",title:"节点生成与重试",detail:"对单个节点发起生成、失败重试、标记完成或补选结果。",badge:"节点",endpoint:`${N.nodeGenerate(":nodeId")} / ${N.nodeRetry(":nodeId")}`,state:s?"可重试":"无重试权限",tone:s?"accent":"neutral",action:"接入队列操作",enabled:s,nav:"queue",module:"queue"},{id:"model-route",group:"创作控制",title:"模型路由与能力档案",detail:"读取 provider 能力档案并执行 metadata-only 元数据检查,不触发真实生图。",badge:"模型",endpoint:N.apiDiscoveryCapabilities,state:a!=null&&a.api_discovery?"已开启":"未开启",tone:a!=null&&a.api_discovery?"primary":"warn",action:"放入参数侧栏",enabled:!!(a!=null&&a.api_discovery),nav:"settings",module:"settings"},{id:"material-pick",group:"资源资产",title:"素材库引用",detail:"从素材库选择参考图、导入素材包,并触发识别或确认。",badge:"素材",endpoint:N.materials,state:a!=null&&a.material_library?"已开启":"未开启",tone:a!=null&&a.material_library?"accent":"neutral",action:"做成选择器",enabled:!!(a!=null&&a.material_library&&c),nav:"materials",module:"images"},{id:"wardrobe-match",group:"资源资产",title:"衣橱搭配",detail:"把素材导入角色衣橱,匹配服装、配件和组合。",badge:"衣橱",endpoint:N.wardrobeMatch(":profileId"),state:a!=null&&a.wardrobe?"已开启":"未开启",tone:a!=null&&a.wardrobe?"accent":"neutral",action:"并入素材面板",enabled:!!(a!=null&&a.wardrobe&&c),nav:"materials",module:"images"},{id:"daily-outfit",group:"资源资产",title:"私伴每日穿搭",detail:"根据私伴集成生成每日穿搭建议,再转为素材或生成任务。",badge:"集成",endpoint:N.privateCompanionDailyOutfit,state:a!=null&&a.private_companion_integration?"已开启":"未开启",tone:a!=null&&a.private_companion_integration?"primary":"neutral",action:"保留为扩展卡",enabled:!!(a!=null&&a.private_companion_integration)},{id:"queue-control",group:"执行结果",title:"队列调度",detail:"查看等待、运行、失败、死信任务,并支持取消、重试和归档。",badge:"队列",endpoint:N.jobs,state:`${Bo.value} 个任务`,tone:Bo.value>0?"warn":"accent",action:"查看队列",enabled:!0,nav:"queue",module:"queue"},{id:"review-select",group:"执行结果",title:"结果审核与选图",detail:"对节点结果做审核、选择、取消选择、采用或归档。",badge:"审核",endpoint:N.nodeReview(":nodeId"),state:r?"可接入":"只读权限",tone:r?"primary":"neutral",action:"放到结果区",enabled:r},{id:"gallery-archive",group:"执行结果",title:"图库与历史",detail:"查看最近结果、节点图片、工作流历史和已归档图片。",badge:"图库",endpoint:N.image(":imageId"),state:`${Lo.value.length} 张最近结果`,tone:Lo.value.length?"accent":"neutral",action:"打开图库",enabled:!0,nav:"gallery",module:"images"}]}),cv=M(()=>K.find(e=>e.key===U.value)??K[0]),fv=M(()=>{const e=new Set(ye[U.value]);return I_.value.filter(a=>e.has(a.id))}),P_=M(()=>{var r,s,c,f,b,C,O,V,ce;const e=fv.value.filter(pe=>pe.enabled).length,a=fv.value.length;return U.value==="quickProfile"?[{label:"当前页面",value:"快速角色",hint:"草稿、素材和衣橱入口"},{label:"角色草稿",value:(r=ne.value)!=null&&r.feature_flags.quick_profile?"开启":"未开",hint:"用于快速生成角色基础信息"},{label:"素材能力",value:(s=ne.value)!=null&&s.feature_flags.material_library?"开启":"未开",hint:"参考图和素材识别会放在这里"},{label:"可用卡片",value:String(e),hint:`共 ${a} 项功能`}]:U.value==="workflow"?[{label:"当前页面",value:"角色工作流",hint:"多节点流程和续跑入口"},{label:"工作流",value:(c=ne.value)!=null&&c.feature_flags.workspace?"开启":"未开",hint:"支持启动、取消、归档和续跑"},{label:"当前队列",value:String(Bo.value),hint:`运行 ${((f=J.value)==null?void 0:f.queue.running)??0} / 失败 ${((b=J.value)==null?void 0:b.queue.failed)??0}`},{label:"可用卡片",value:String(e),hint:`共 ${a} 项功能`}]:[{label:"当前页面",value:"图片生成",hint:"提示词、模型、素材和结果"},{label:"写入权限",value:(C=ne.value)!=null&&C.permissions.can_write?"可写":"只读",hint:(O=ne.value)!=null&&O.permissions.can_retry_tasks?"可重试任务":"无重试权限"},{label:"当前队列",value:String(Bo.value),hint:`运行 ${((V=J.value)==null?void 0:V.queue.running)??0} / 失败 ${((ce=J.value)==null?void 0:ce.queue.failed)??0}`},{label:"最近结果",value:String(Lo.value.length),hint:"图库与审核区可复用这些结果"}]}),x_=M(()=>{var e,a,r,s;return[{label:"Pending",value:((e=J.value)==null?void 0:e.queue.pending)??0},{label:"Running",value:((a=J.value)==null?void 0:a.queue.running)??0},{label:"Failed",value:((r=J.value)==null?void 0:r.queue.failed)??0},{label:"Dead",value:((s=J.value)==null?void 0:s.queue.dead_letter)??0}]}),A_=M(()=>{var e,a,r,s;return[{label:"总占用",value:go(((e=J.value)==null?void 0:e.storage.total_bytes)??0)},{label:"图片",value:go(((a=J.value)==null?void 0:a.storage.images_bytes)??0)},{label:"素材",value:go(((r=J.value)==null?void 0:r.storage.materials_bytes)??0)},{label:"临时",value:go(((s=J.value)==null?void 0:s.storage.temp_bytes)??0)}]}),M_=()=>{if(U.value!=="quickProfile"||Ro.value)return;const e=Cr.value;if(e.length<2)return;const a=e.findIndex(s=>s.id===Zn.value),r=a>=0?(a+1)%e.length:0;Zn.value=e[r].id},vv=()=>{Ys!==void 0&&(window.clearInterval(Ys),Ys=void 0)},R_=()=>{vv(),Ys=window.setInterval(M_,6500)};Ni(()=>{Lh(),window.history.scrollRestoration="manual",window.scrollTo({top:0,left:0,behavior:"auto"}),document.addEventListener("pointerdown",pp,!0),document.addEventListener("pointermove",mp,!0),document.addEventListener("pointerup",gp,!0),document.addEventListener("pointercancel",yp,!0),document.addEventListener("pointermove",$v,!0),document.addEventListener("keydown",_p),document.addEventListener("visibilitychange",ii),window.addEventListener("focus",ii),window.addEventListener("online",ii),dl.value||cu(n3),R_(),Zi(),j_()}),jr(()=>{document.removeEventListener("pointerdown",pp,!0),document.removeEventListener("pointermove",mp,!0),document.removeEventListener("pointerup",gp,!0),document.removeEventListener("pointercancel",yp,!0),document.removeEventListener("pointermove",$v,!0),document.removeEventListener("keydown",_p),document.removeEventListener("visibilitychange",ii),window.removeEventListener("focus",ii),window.removeEventListener("online",ii),ac(),vv(),Ui!==void 0&&window.clearInterval(Ui),br!==void 0&&window.clearTimeout(br),uu();for(const e of Dt)URL.revokeObjectURL(e);Dt.clear()}),ct([Sl,Ao,Mo,dl,Rn,Zr],qh,{deep:!0}),ct(Ir,e=>{Mn.value=e.length?Math.min(Mn.value,e.length-1):0}),ct(hr,e=>{if(!e.length){Z.value="";return}e.some(a=>a.image_id===Z.value)||(Z.value=e[0].image_id)},{immediate:!0}),ct(qo,e=>{if(!e.length){Wt.value="";return}e.some(a=>a.value===Wt.value)||(Wt.value=e[0].value)},{immediate:!0}),ct(Cr,e=>{if(!e.length){Zn.value="";return}e.some(a=>a.id===Zn.value)||(Zn.value=e[0].id)},{immediate:!0}),ct(no,e=>{if(!e.length){nt.value="";return}e.some(a=>a.id===nt.value)||(nt.value=e[0].id)},{immediate:!0}),ct(()=>{var e;return[oe.value.state,(e=sa.value)==null?void 0:e.workflow_id]},([e,a])=>{e!=="connected"||!a||Me.value[a]||ci(a)},{immediate:!0}),ct(()=>{var e;return[oe.value.state,(e=Ue.value)==null?void 0:e.node_id]},([e,a])=>{Te.value="",!(e!=="connected"||!a)&&fc(a)},{immediate:!0}),ct(()=>{var e;return[oe.value.state,(e=Ue.value)==null?void 0:e.node_id,ua.value]},([e,a,r])=>{jv(),vt.value="",il.value="",!(e!=="connected"||!a||!r)&&vc(a)},{immediate:!0}),ct(()=>{var e;return[(e=Ue.value)==null?void 0:e.node_id,lt.value]},([e,a])=>{if(!mr.value)return;const r=sl.value;if(!e||!a||!r||a.round.node_id!==r.round.node_id){mr.value=!1,sl.value=null,Cl.value="";return}a.round.round_id===r.round.round_id&&(sl.value=a)}),ct(Bn,e=>{const a=new Set(e.map(xt));a.has(Pn.value)||(Pn.value=""),Ta.value=Ta.value.filter(r=>a.has(r)),a.has(Tt.value)||(Tt.value=""),Fa.value=Object.fromEntries(Object.entries(Fa.value).filter(([r])=>a.has(r))),Ta.value.length<2&&(zl.value=!1)},{immediate:!0}),ct(Lf,e=>{if(!e.length){Y.value="";return}e.some(a=>a.image_id===Y.value)||(Y.value=e[0].image_id)},{immediate:!0}),ct([Ia,zo],()=>{var e;if(!Ia.value.length){Na.value="";return}Ia.value.some(a=>a.task_id===Na.value)||(Na.value=((e=zo.value[0])==null?void 0:e.task_id)??Ia.value[0].task_id)},{immediate:!0}),ct(Oo,e=>{if(!e.length){ma.value="";return}e.some(a=>a.id===ma.value)||(ma.value=e[0].id)},{immediate:!0}),ct(Xs,e=>{if(!e.length){aa.value="";return}e.some(a=>a.id===aa.value)||(aa.value=e[0].id)},{immediate:!0}),ct(kr,e=>{if(!e.length){Jn.value="";return}e.some(a=>a.id===Jn.value)||(Jn.value=e[0].id)},{immediate:!0}),ct(Hi,e=>{if(!e.length){Xl.value="";return}Xl.value!==Jc&&(e.some(a=>a.profile_id===Xl.value)||oc(e[0].profile_id))},{immediate:!0}),ct(St,e=>{e&&(bv(e),Xd(e))},{immediate:!0}),ct(Ee,e=>{e!=null&&e.profileId&&Gv(e)}),ct(Zn,()=>{ya(()=>{var e;(e=document.querySelector(".quick-profile-image-types button.active"))==null||e.scrollIntoView({block:"nearest",behavior:"smooth"})})});function E_(){const e=new URLSearchParams(window.location.search).get("view");return ps.some(a=>a.key===e)?e:"overview"}function pv(){const e=Du();return{state:"checking",label:"连接中",title:"正在检测后端连接",detail:e==="plugin-bridge"?"正在通过 AstrBot 插件桥读取 ui/bootstrap。":"正在通过同源 API 读取 ui/bootstrap。",transport:e,checkedAt:""}}function N_(){oe.value=pv()}function T_(e){const a=Du();oe.value={state:"connected",label:"后端已连接",title:"后端已连接",detail:a==="plugin-bridge"?"已通过 AstrBot 插件桥调用后端,写入动作会进入工作流并落库。":`已通过同源 API ${e.api_base} 调用后端,写入动作会进入工作流并落库。`,transport:a,checkedAt:new Date().toISOString()}}function B_(e){const a=Du(),r=a==="direct-fetch"&&L_(e);oe.value={state:r?"preview":"error",label:r?"预览模式":"连接异常",title:r?"当前未连接真实插件后端":"后端连接异常",detail:r?"当前页面只跑在前端预览里,没有拿到 ImageStudio 后端 API;需要在 AstrBot 插件页或真实 API 代理下验收落库。":mv(e),transport:a,checkedAt:new Date().toISOString()}}function L_(e){return e instanceof qa?["invalid_api_response","network_unreachable","http_error"].includes(e.code):!0}function mv(e){return e instanceof qa?e.code==="invalid_api_response"?"接口返回了页面内容或非 JSON 数据,不是 ImageStudio API 响应。":e.code==="network_unreachable"?"无法连接 ImageStudio 后端接口。":e.message||"ImageStudio 后端接口请求失败。":e instanceof Error?e.message.includes("Unexpected token")?"接口返回了页面内容或非 JSON 数据,不是 ImageStudio API 响应。":e.message.includes("Failed to fetch")||e.message.includes("NetworkError")?"无法连接 ImageStudio 后端接口。":e.message||"加载失败":"加载失败"}function Bt(e){var a;return oe.value.state==="checking"?`${e}需要先完成后端连接检测。`:oe.value.state!=="connected"?`${e}需要连接 ImageStudio 后端后才能落库。${oe.value.detail}`:(a=ne.value)!=null&&a.permissions.can_write?"":`${e}需要后端写入权限。`}async function Zi(){uu(),await gv(),oe.value.state==="connected"&&(await Promise.all([Va(),fl(),V_(),Jd(),wn()]),await Promise.all([Qd(),nn(),Yd()]),ei.value=new Date().toISOString())}function q_(){return GC(new URLSearchParams(window.location.search).get("materialView"))}function D_(){var e;return((e=new URLSearchParams(window.location.search).get("profile"))==null?void 0:e.trim())??""}async function O_(){await Promise.all([gv(),Jd()]),ei.value=new Date().toISOString()}function W_(e,a,r){return new Promise((s,c)=>{const f=window.setTimeout(()=>c(new Error(r)),a);e.then(b=>{window.clearTimeout(f),s(b)},b=>{window.clearTimeout(f),c(b)})})}async function gv(){N_();try{ne.value=await W_(Pe(N.uiBootstrap),6e3,"AstrBot 插件桥连接超时,正在自动重试。"),T_(ne.value),Vs=0,uu()}catch(e){ne.value=null,B_(e),yv()}}function uu(){Xr!==void 0&&(window.clearTimeout(Xr),Xr=void 0)}function yv(){if(Xr!==void 0||oe.value.state==="connected")return;const e=Math.min(1e3*2**Math.min(Vs,4),15e3);Vs+=1,Xr=window.setTimeout(()=>{if(Xr=void 0,document.hidden){yv();return}Zi()},e)}function ii(){var e,a;if(!document.hidden){if(oe.value.state==="connected"){const r=(e=lt.value)==null?void 0:e.round.round_id;r&&as(((a=lt.value)==null?void 0:a.round.status)??"")&&ku(r,!0);return}oe.value.state!=="checking"&&(Vs=0,uu(),Zi())}}async function Va(){ao.value=!0,yn.value="";const e=K_();try{const a=await Pe(N.dashboardSummary);J.value=a;const r=await Promise.allSettled(a.recent_images.slice(0,8).map(s=>Pe(N.image(s.image_id))));D.value=r.filter(s=>s.status==="fulfilled").map(s=>s.value).filter(hn)}catch(a){yn.value=Ie(a),D.value=[]}finally{await e,ao.value=!1}}async function Qd(){if(oe.value.state!=="connected"){q.value=[],Qs.value="";return}yd.value=!0,Qs.value="";try{const a=[];let r=1,s=0;do{const c=await Pe(N.images,{include_archived:!0,page:r,page_size:100});if(a.push(...c.items.filter(hn)),s=c.total,!c.items.length)break;r+=1}while(a.length<s);q.value=sn(a,c=>c.image_id)}catch(e){q.value=[],Qs.value=`完整图库读取失败:${Ie(e)}`}finally{yd.value=!1}}async function U_(){await Promise.all([Va(),Qd()]),ei.value=new Date().toISOString()}async function F_(){var a,r,s,c;const e=Ce.value.trim();if(!(!e||Se.value)){Se.value=!0;try{const f=await $e(N.promptGovernancePreview,{prompt:e,entrypoint:"web",translation_consent:!0,selection:"translated",model_route:bu()}),b=String(f.selected_prompt||((a=f.translation)==null?void 0:a.translated_text)||"").trim();if(!b||((r=f.translation)==null?void 0:r.status)==="unavailable_fallback"||((s=f.translation)==null?void 0:s.status)==="failed_fallback")throw new Error(((c=f.translation)==null?void 0:c.error)||"未找到可用的提示词扩写模型");Ce.value=b}catch(f){Ea.value=`提示词扩写失败:${Ie(f)}`}finally{Se.value=!1}}}function j_(){Ui!==void 0&&window.clearInterval(Ui);const e=async()=>{var a;if(!(oe.value.state!=="connected"||document.hidden))try{const r=await Pe(N.eventStream,{limit:20}),s=((a=r.events.at(-1))==null?void 0:a.event_id)??"";if(!s||s===Gs)return;const c=!!Gs,f=c?r.events.findIndex(Ve=>Ve.event_id===Gs):-1,b=c?r.events.slice(f>=0?f+1:-1):[];if(Gs=s,!c)return;const C=b.map(Ve=>String(Ve.event_type||"")),O=C.some(Ve=>Ve.startsWith("generation.")),V=C.some(Ve=>Ve.startsWith("workflow.")),ce=[];O&&ce.push(fl()),(O||V)&&["overview","performance"].includes(z.value)&&ce.push(Va());const pe=lt.value;O&&pe&&as(pe.round.status)&&ce.push(ku(pe.round.round_id,!0)),z.value==="gallery"&&O&&ce.push(Qd()),z.value==="logs"&&(O||V)&&ce.push(nn()),await Promise.allSettled(ce)}catch{}};e(),Ui=window.setInterval(e,5e3)}async function K_(){_d.value=!0,Vi.value="";try{W.value=await Pe(N.costUsage,{days:1})}catch(e){W.value=null,Vi.value=`今日用量读取失败:${Ie(e)}`}finally{_d.value=!1}}async function fl(){gn.value=!0,En.value||(ka.value="");try{Ne.value=await G_()}catch(e){ka.value=Ie(e)}finally{gn.value=!1}}async function nn(){var e;if(oe.value.state!=="connected"){Ye.value=[],ot.value=[],it.value=[],ft.value=[],tt.value=[],No.value="";return}zs.value=!0,No.value="";try{const a=(e=ne.value)!=null&&e.permissions.can_manage_config?Pe(N.auditLogs,{limit:100}):Promise.resolve([]),[r,s,c,f,b]=await Promise.all([Pe(N.generationLogs,{limit:100}),Pe(N.workflowLogs,{limit:100}),Pe(N.errorLogs,{limit:100}),Pe(N.integrationLogs,{limit:100}),a]);Ye.value=r,ot.value=s,it.value=c,ft.value=f,tt.value=b}catch(a){No.value=Ie(a)}finally{zs.value=!1}}async function V_(){bd.value=!0,kd.value="";const[e,a]=await Promise.allSettled([Pe(N.apiDiscoveryCapabilities),Pe(N.runtimeModels)]);dn.value=e.status==="fulfilled"?e.value:[],Qn.value=a.status==="fulfilled"?a.value.items??[]:[],e.status==="rejected"&&(kd.value=Ie(e.reason)),bd.value=!1}async function G_(){const a=await Pe(N.jobs,{page:1,page_size:100}),r=Math.ceil(a.total/100);if(r<=1)return a;const s=await Promise.all(Array.from({length:r-1},(f,b)=>Pe(N.jobs,{page:b+2,page_size:100}))),c=sn([a,...s].flatMap(f=>f.items),f=>f.task_id);return{...a,items:c,page:1,page_size:c.length}}async function Yd(){var e;if(oe.value.state!=="connected"){va.value=null,at.value=null,pa.value=[],Et.value=null,Pl.value="";return}Hs.value=!0,Pl.value="";try{const a=(e=ne.value)!=null&&e.permissions.can_manage_config?Pe(N.settingsSnapshots,{limit:20}):Promise.resolve([]),[r,s,c]=await Promise.all([Pe(N.settingsSchema),Pe(N.settingsCurrent),a]);va.value=r,at.value=s,pa.value=c}catch(a){Pl.value=Ie(a)}finally{Hs.value=!1}}async function z_(e){wr.value=!0,Pl.value="",To.value="";try{Et.value=await $e(N.settingsValidate,{config:e}),To.value=Et.value.valid?"配置校验通过。":"配置校验未通过,请检查错误项。"}catch(a){Pl.value=Ie(a)}finally{wr.value=!1}}async function H_(e){var a;wr.value=!0,Pl.value="",To.value="";try{const r=await $e(N.settingsValidate,{config:e});if(Et.value=r,!r.valid){To.value="配置校验未通过,未执行保存。";return}const s=await $e(N.settingsSave,{config:e});at.value={config_path:((a=at.value)==null?void 0:a.config_path)??"",config:s.config},To.value="配置已保存并生成快照。",await Yd()}catch(r){Pl.value=Ie(r)}finally{wr.value=!1}}async function Q_(){var e;wr.value=!0,Pl.value="",To.value="";try{const a=await $e(N.settingsReload);at.value={config_path:((e=at.value)==null?void 0:e.config_path)??"",config:a.config},To.value="已从配置文件重新载入。"}catch(a){Pl.value=Ie(a)}finally{wr.value=!1}}async function wn(){var e;Il.value=!0,Kt.value="",Za.value||(Ut.value="");try{const[a,r,s]=await Promise.all([Pe(N.materialCategories),Pe(N.materials,{page:1,page_size:100}),_v()]),c=await Y_(r);Lt.value=a,_a.value=c,kt.value=s,!Bs.value&&((e=ne.value)!=null&&e.permissions.can_manage_materials)&&(Bs.value=!0,lh(a))}catch(a){Lt.value=[],_a.value=null,kt.value=[],Kt.value=Ie(a)}finally{Il.value=!1}}async function _v(){try{const e=await Pe(N.materialCatalog,{page:1,page_size:200});return(Array.isArray(e)?e:e.items??[]).filter(r=>Ge(r.status)!=="archived").sort((r,s)=>+(vu(s)==="advanced")-+(vu(r)==="advanced")||Number(s.priority||0)-Number(r.priority||0))}catch{return[]}}async function Y_(e){const a=Math.max(1,e.page_size),r=Math.ceil(e.total/a);if(r<=1)return e;const s=await Promise.all(Array.from({length:r-1},(f,b)=>Pe(N.materials,{page:b+2,page_size:a}))),c=sn([e,...s].flatMap(f=>f.items),f=>f.material_id);return{...e,items:c,page:1,page_size:c.length}}async function Jd(){wd.value=!0,hd.value="";try{const e=await Pe(N.profiles,{page:1,page_size:100}),r=(await J_(e)).items.filter(s=>{var c;return((c=s.metadata)==null?void 0:c.system_key)!==ds});Jt.value=r,ia.value=r.map((s,c)=>Kw(s,void 0,void 0,c))}catch(e){Jt.value=[],ia.value=[],hd.value=Ie(e)}finally{wd.value=!1}}async function J_(e){const a=Math.max(1,e.page_size),r=Math.ceil(e.total/a);if(r<=1)return e;const s=await Promise.all(Array.from({length:r-1},(f,b)=>Pe(N.profiles,{page:b+2,page_size:a}))),c=sn([e,...s].flatMap(f=>f.items),f=>f.profile_id);return{...e,items:c,page:1,page_size:c.length}}async function bv(e){var s;const a=++Js,r=wv(e.profile_id);if(Ki.value=!0,await X_(e),oe.value.state!=="connected"||((s=e.metadata)==null?void 0:s.source)==="sample"||Xt.value[e.profile_id]){a===Js&&(Ki.value=!1);return}try{const c=await Pe(N.profileWorkflows(e.profile_id));if(!du(e.profile_id,r))return;Xt.value={...Xt.value,[e.profile_id]:c};const f=await Promise.allSettled(c.map(pe=>Pe(N.workflow(pe.workflow_id))));if(!du(e.profile_id,r))return;const b=f.filter(pe=>pe.status==="fulfilled").map(pe=>pe.value);if(b.length){if(await xr(b.flatMap(pe=>pe.nodes)),!du(e.profile_id,r))return;pt.value={...pt.value,...Object.fromEntries(b.map(pe=>[pe.workflow.workflow_id,pe.workflow]))},rt.value={...rt.value,...Object.fromEntries(b.map(pe=>[pe.workflow.workflow_id,pe.nodes]))}}const O=c.filter(vi).find(pe=>pe.workflow_type===Cn),V=Hv(c.filter(pe=>!["cancelled","archived"].includes(Ge(pe.status)))),ce=c.find(pe=>pe.workflow_type==="quick_profile");ia.value=ia.value.map(pe=>pe.profileId===e.profile_id?{...pe,workflowId:O==null?void 0:O.workflow_id,quickCharacterWorkflowId:V==null?void 0:V.workflow_id,quickProfileWorkflowId:ce==null?void 0:ce.workflow_id,status:O?"详细工作流就绪":V?"快速角色已生成":ce?"快速档案已落库":pe.status}:pe)}catch{if(!du(e.profile_id,r))return;Xt.value={...Xt.value,[e.profile_id]:[]}}finally{a===Js&&(Ki.value=!1)}}function wv(e){const a=($d.get(e)??0)+1;return $d.set(e,a),a}function du(e,a){return $d.get(e)===a}function hv(e){wv(e),Js+=1,Ki.value=!1}async function X_(e){var r;const a=((r=e.avatar_image_uri)==null?void 0:r.trim())??"";if(!(!a||xn.value[e.profile_id])){if(/^(?:https?:|data:|blob:)/i.test(a)){xn.value={...xn.value,[e.profile_id]:a};return}if(!(!a.startsWith("storage://")||oe.value.state!=="connected"))try{const s=await Pe(N.mediaSign,{uri:a});xn.value={...xn.value,[e.profile_id]:s.url}}catch{}}}async function Xd(e,a=!1){var c,f;const r=e.profile_id;if(oe.value.state!=="connected"||!((c=ne.value)!=null&&c.feature_flags.wardrobe)||((f=e.metadata)==null?void 0:f.source)==="sample"){es(r),qt.value={...qt.value,[r]:[]};return}if(!a&&Object.hasOwn(qt.value,r))return;const s=kv(r);ec(r,!0),ae.value={...ae.value,[r]:""};try{const b=await Pe(N.wardrobe(r));if(!Zd(r,s))return;qt.value={...qt.value,[r]:b},await Z_(b)}catch(b){if(!Zd(r,s))return;ae.value={...ae.value,[r]:Ie(b)}}finally{Zd(r,s)&&ec(r,!1)}}function kv(e){const a=(Cd.get(e)??0)+1;return Cd.set(e,a),a}function Zd(e,a){return Cd.get(e)===a}function es(e){kv(e),ec(e,!1)}function ec(e,a){F.value={...F.value,[e]:a}}async function Z_(e){var f;const a=new Set([...Md.value.map(b=>b.material_id),...(((f=_a.value)==null?void 0:f.items)??[]).map(b=>b.material_id),...Object.keys(I.value)]),r=qr(e.map(b=>b.material_id).filter(b=>!a.has(b)));if(!r.length)return;const c=(await Promise.allSettled(r.map(b=>Pe(b.startsWith("advmat_")?N.advancedMaterial(b):N.material(b))))).filter(b=>b.status==="fulfilled").map(b=>b.value);c.length&&(I.value={...I.value,...Object.fromEntries(c.map(b=>[b.material_id,b]))})}function Zt(e,a=(r=>(r=ps.find(s=>s.key===e))==null?void 0:r.module)()??"overview"){z.value=e;const s=new URL(window.location.href);s.searchParams.set("view",e),window.history.replaceState({},"",`${s.pathname}${s.search}`),ya(()=>lb(a))}function eb(e){Zt(e.key,e.module)}function si(e){j.value=e;const a=new URL(window.location.href);a.searchParams.set("view","materials"),a.searchParams.set("materialView",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}async function tb(){ei.value=new Date().toISOString(),kt.value=await _v()}function ab(e){Y.value=e.image_id,Z.value=e.image_id,Ce.value=e.prompt;const a=qo.value.find(r=>r.value===e.model||r.label===e.model);a&&(Wt.value=a.value),U.value="image",Zt("generate","generate")}function tc(){ac(),Jr.value=!0}function nb(){if(dl.value=!dl.value,dl.value){tc();return}cu(Qc)}function $v(e){if(!(dl.value||window.matchMedia("(max-width: 900px)").matches)){if(e.clientX<=l3){tc();return}Jr.value&&e.clientX>=o3&&ti===void 0&&cu(Qc)}}function cu(e=Qc){dl.value||(ac(),ti=window.setTimeout(()=>{Jr.value=!1,ti=void 0},e))}function ac(){ti!==void 0&&(window.clearTimeout(ti),ti=void 0)}function Cv(e){Ws.value=e.title,Mn.value=0,gd.value=!1,Yr.value=!1,Zt(e.nav,e.module)}function lb(e){var c;const a=document.querySelector(`[data-module="${e}"]`);if(!a)return;const r=((c=document.querySelector(".topbar"))==null?void 0:c.getBoundingClientRect().height)??0,s=window.scrollY+a.getBoundingClientRect().top-r-18;window.scrollTo({top:Math.max(0,s),behavior:"smooth"})}function ob(){Sl.value=Sl.value==="dark"?"light":"dark"}function ui(e){return[e.genderPresentation?`gender presentation: ${e.genderPresentation}`:"",e.ageStage?`age stage: ${e.ageStage}`:"",e.species?`species: ${e.species}`:"",e.bodyType?`body type: ${e.bodyType}`:"",e.hairColor?`${e.hairColor} hair`:"",e.hairstyle,e.eyeColor?`${e.eyeColor} eyes`:"",e.distinctiveFeatures,e.clothing].filter(Boolean).join(", ")}function rb(e){return`${e.name},${e.identity},personality: ${e.personality}`}function Sv(e){return{"--profile-color-a":e[0],"--profile-color-b":e[1],"--profile-color-c":e[2]}}function vl(e){const a=Ba.value[e];return a?Do.value.find(r=>r.id===a&&r.category===e)??null:null}function Iv(e){return Ba.value[e.category]===e.id}function nc(e){const a=(e==null?void 0:e.trim())??"";return!a||a.startsWith("qp-material-")||a.startsWith("sample:")?"":a}function lc(){return qr(_n.value.map(e=>nc(e.id)).filter(Boolean))}function di(e,a=0){return e.imageUrl??""}function Pv(e){return e.group??e.category}function xv(e){tl.value=e}function Av(e){if(_t.value===e&&wp("materialPicker")){ea("materialPicker");return}kn("materialPicker"),_t.value=e,e!==Ht&&(tl.value=bi)}function Mv(e){Ba.value={...Ba.value,[e.category]:e.id},Hl.value=e.id,ea("materialPicker")}function Rv(e){var r;const a=Do.value.find(s=>s.id===Hl.value);Ba.value={...Ba.value,[e]:""},(!a||a.category===e)&&(Hl.value=((r=_n.value[0])==null?void 0:r.id)??""),ea("materialPicker")}function fu(e){return{Style:"风格",Composition:"构图",Outfit:"服装",Top:"服装",Bottom:"服装",Dress:"服装",Shoes:"鞋袜",Accessory:"配饰"}[e]??e}function ib(e){var c;const a=new Date().toISOString(),r=vu(e),s=Number(e.priority||((c=e.metadata)==null?void 0:c.material_priority)||0);return{material_id:e.material_id,category_id:e.category_id??null,display_name:e.display_name,image_uri:e.image_uri??null,thumbnail_uri:e.thumbnail_uri??null,image_url:e.image_url||e.image_uri||null,thumbnail_url:e.thumbnail_url||e.thumbnail_uri||null,prompt:e.prompt??null,negative_prompt:e.negative_prompt??null,tags:Array.isArray(e.tags)?e.tags:[],recognition_status:"confirmed",metadata:{...e.metadata,material_type:r,advanced_material:r==="advanced",catalog_priority:s,source_image_uri:e.image_uri??null},created_at:String(e.created_at||a),updated_at:String(e.updated_at||e.created_at||a)}}function vu(e){var a;return String(e.library_kind||e.material_type||((a=e.metadata)==null?void 0:a.library_kind)||"standard")}function sb(e,a){var O,V,ce,pe,Ve,Oe;const r=Lt.value.find(Xe=>Xe.category_id===e.category_id),s=r!=null&&r.parent_id?Lt.value.find(Xe=>Xe.category_id===r.parent_id):void 0,c=fu((s==null?void 0:s.name)||(r==null?void 0:r.name)||""),f=me.find(Xe=>Xe.category===c);if(!f)return null;const b=na((O=e.metadata)==null?void 0:O.subcategory)||na((V=e.metadata)==null?void 0:V.group)||na((ce=e.metadata)==null?void 0:ce.accessory_group),C=s?r==null?void 0:r.name:b;return{id:e.material_id,label:e.display_name||rn(e.material_id),category:c,group:C||void 0,prompt:e.prompt??"",colors:ub(e.metadata,f.colors),imageUrl:Ln(e.thumbnail_url)||Ln(e.image_url),source:"backend",advanced:((pe=e.metadata)==null?void 0:pe.advanced_material)===!0||((Ve=e.metadata)==null?void 0:Ve.material_type)==="advanced",priority:Number(((Oe=e.metadata)==null?void 0:Oe.catalog_priority)||0)}}function ub(e,a){const r=e.colors;return Array.isArray(r)&&r.length>=3&&r.slice(0,3).every(s=>typeof s=="string")?[String(r[0]),String(r[1]),String(r[2])]:a}function db(e){return[...e].sort((a,r)=>Ev(a)-Ev(r))}function Ev(e){return e.category_id.startsWith("cat_imagestudio_")?0:e.category_id.startsWith("cat_default_")?1:2}function Nv(e){const a=["风格","构图","服装","鞋袜","配饰"],r=a.indexOf(fu(e));return r<0?a.length:r}function cb(e){return{风格:"画风、渲染和色彩基准",构图:"头像、半身、全身和动态参考",服装:"衣服结构、层次和材质",鞋袜:"鞋型、袜型和下身比例参考",配饰:"头部、手部、胸前、腰部等局部物件"}[e]??"素材分类"}function fb(e,a){var f,b,C,O;const r=e.category_id?cy.value.get(e.category_id):"",s=na((f=e.metadata)==null?void 0:f.subcategory)||na((b=e.metadata)==null?void 0:b.group)||na((C=e.metadata)==null?void 0:C.accessory_group)||"其他",c=(O=e.metadata)!=null&&O.normalized_asset_profile&&typeof e.metadata.normalized_asset_profile=="object"&&!Array.isArray(e.metadata.normalized_asset_profile)?e.metadata.normalized_asset_profile:{};return{id:e.material_id,label:e.display_name||rn(e.material_id),category:r||"未分类",categoryId:e.category_id||"uncategorized",subcategory:s,prompt:e.prompt??"",negativePrompt:e.negative_prompt??"",tags:e.tags??[],status:e.recognition_status||"uploaded",statusText:pu(e.recognition_status),endpoint:N.material(e.material_id),imageUrl:Ln(e.thumbnail_url)||Ln(e.image_url),source:"backend",colors:["#64748b","#2ec4b6","#7168f0"],updatedAt:po(e.updated_at||e.created_at),semanticCategory:String(c.category||"other"),bodySlots:Array.isArray(c.body_slots)?c.body_slots.map(String):[],wearLayer:String(c.wear_layer||""),confidence:Number(c.confidence||0),profileConfirmed:c.confirmed===!0}}function pu(e){return{uploaded:"URI 已登记",pending:"待识别",pending_recognition:"待识别",pending_confirm:"待确认",recognizing:"识别中",recognized:"已识别",confirmed:"已确认",failed:"识别失败",archived:"已归档"}[Ge(e)]??(e||"待识别")}function vb(e){const a=Ge(e);return["failed"].includes(a)?"is-bad":["pending","pending_recognition","pending_confirm","uploaded","recognizing","recognized"].includes(a)?"is-warn":["confirmed"].includes(a)?"is-good":"is-idle"}function pb(e){ma.value!==e&&(ma.value=e,aa.value="")}function mb(e){$r.value&&(ma.value=$r.value.id),aa.value=e}function Ho(e,a={}){var s;eo.value=e==="upload-image"&&a.workflowTargetNodeId||"",eo.value||(xo.value=[]),Kt.value="",Ut.value="",Ft.value="",Co.value=null;const r=Bt(e==="upload-image"?"添加并识别素材":e==="register-uri"?"登记素材 URI":e==="asset-pack"?"导入素材包":"导入角色衣橱");if(r){eo.value="",xo.value=[],Kt.value=r;return}if(!((s=ne.value)!=null&&s.permissions.can_manage_materials)){eo.value="",xo.value=[],Kt.value="该操作需要素材管理权限。";return}In.value=e,kn("materialOperation")}function Tv(){var a;if(Kt.value="",Ut.value="",ja.value="",Xn.value)return;const e=Bt("添加素材分类");if(e){Kt.value=e;return}if(!((a=ne.value)!=null&&a.permissions.can_manage_materials)){Kt.value="添加素材分类需要素材管理权限。";return}al.value="",nl.value="",kn("materialCategoryCreate"),wl.value=!0,ya(()=>{var r;(r=document.querySelector("[data-material-category-name]"))==null||r.focus()})}async function gb(){var c,f;if(Kt.value="",Ut.value="",ja.value="",Xn.value)return;const e=Bt("添加素材分类");if(e){ja.value=e;return}if(!((c=ne.value)!=null&&c.permissions.can_manage_materials)){ja.value="添加素材分类需要素材管理权限。";return}const a=Zs.value,r=al.value.trim();if(!r)return;const s=a&&((f=$r.value)==null?void 0:f.source)==="backend"?$r.value.id:null;if(a&&!s){ja.value="配饰父分类尚未落库,请先刷新素材库。";return}Xn.value=!0;try{const b=await $e(N.materialCategories,{name:r,parent_id:s,category_type:a?"accessory_group":"material",sort_order:Lt.value.length*10+10,metadata:{source:"imagestudio_frontend",created_from:"materials_page",parent_category:a?Ht:void 0,note:nl.value.trim()||void 0}});Ut.value=a?`配饰子分类「${b.name}」已落库。`:`素材分类「${b.name}」已落库。`,ea("materialCategoryCreate"),await wn(),a?(ma.value=s??ma.value,aa.value=b.name):ma.value=b.category_id}catch(b){ja.value=`添加分类失败:${Ie(b)}`}finally{Xn.value=!1}}function Bv(){if(!Ee.value.workflowId){Ut.value="当前角色还没有已开启的详细工作流,请先从角色页面确认开启。";return}window.confirm("确认进入当前角色的详细工作流素材绑定节点?")&&(ve.value=!0,ie.value=!0,U.value="workflow",nt.value="material-bind",Zt("generate","generate"))}function Lv(e){Ql.value={category:e,requestedAt:new Date().toISOString()},ea("materialPicker"),Zt("materials","images");const a=new URL(window.location.href);a.searchParams.set("materialAction","add"),a.searchParams.set("materialCategory",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}function oc(e){if(!e){Xl.value=Jc;const r=new URL(window.location.href);r.searchParams.delete("profile"),window.history.replaceState({},"",`${r.pathname}${r.search}`);return}if(!Hi.value.some(r=>r.profile_id===e))return;Xl.value=e,zr.value="avatar";const a=new URL(window.location.href);a.searchParams.set("profile",e),window.history.replaceState({},"",`${a.pathname}${a.search}`)}function qv(){var e,a;return oe.value.state!=="connected"?"角色衣橱需要连接 ImageStudio 后端。":(e=ne.value)!=null&&e.feature_flags.wardrobe?ne.value.permissions.can_manage_materials?!St.value||((a=St.value.metadata)==null?void 0:a.source)==="sample"?"请选择真实后端角色档案。":"":"当前账号没有素材管理权限。":"角色衣橱功能尚未开启。"}async function yb(e,a){const r=St.value;if(!r||He.value)return;const s=qv();if(s){ae.value={...ae.value,[r.profile_id]:s};return}const c=Vf.value.find(b=>b.material_id===e),f=a.trim();if(!c||Ge(c.recognition_status)!=="confirmed"||!f){ae.value={...ae.value,[r.profile_id]:"只能将已确认素材添加到有效衣橱分类。"};return}if(Nd.value.some(b=>b.material_id===e)){ae.value={...ae.value,[r.profile_id]:"该素材已经在当前角色衣橱中。"};return}es(r.profile_id),He.value=`add:${e}`,ae.value={...ae.value,[r.profile_id]:""};try{const b=await $e(N.wardrobeItems(r.profile_id),{material_id:e,wardrobe_category:f});es(r.profile_id),qt.value={...qt.value,[r.profile_id]:[b,...(qt.value[r.profile_id]??[]).filter(C=>C.wardrobe_item_id!==b.wardrobe_item_id)]},I.value={...I.value,[c.material_id]:c}}catch(b){ae.value={...ae.value,[r.profile_id]:`添加衣橱素材失败:${Ie(b)}`}}finally{He.value=""}}async function _b(e){const a=St.value;if(!a||He.value)return;const r=qv();if(r){ae.value={...ae.value,[a.profile_id]:r};return}if(Nd.value.some(s=>s.wardrobe_item_id===e)){es(a.profile_id),He.value=`remove:${e}`,ae.value={...ae.value,[a.profile_id]:""};try{await ju(N.wardrobeItem(a.profile_id,e)),es(a.profile_id),qt.value={...qt.value,[a.profile_id]:(qt.value[a.profile_id]??[]).filter(s=>s.wardrobe_item_id!==e)}}catch(s){ae.value={...ae.value,[a.profile_id]:`移除衣橱素材失败:${Ie(s)}`}}finally{He.value=""}}}function bb(){const e=St.value;e&&Xd(e,!0)}async function wb(){const e=Ee.value;if(!e.profileId){en.value="",An.value="请先保存角色档案,再生成角色图片。";return}await Dv(e)}async function Dv(e){var pe,Ve,Oe;const a=e.profileId;if(!a||E.value[a])return;const r=Bt("生成快速角色");if(r){en.value="",An.value=r,P.value={...P.value,[a]:r};return}E.value={...E.value,[a]:"quick"},P.value={...P.value,[a]:""},An.value="",en.value=`已加入生成队列,正在准备 ${cl.length} 张角色图片。`;let s="";const c=new Date().toISOString(),f=hb(a),b=f,C=`workflow_${mu(a)}_character_fast_${mu(f)}`,O=rc(e),V=_n.value.map(Xe=>Xe.prompt).filter(Boolean),ce=kb();try{if(!ce)throw new Error("未配置 quick_generation 统一生图路由,请先在设置 / 模型分工中选择快速角色模型");const Xe=await $u(e,Fn,{forceNew:!0,workflowId:C,metadata:{quick_character_batch_id:f,batch_started_at:c,identity_fields:O,model_route:ce}});let ke=Xe.workflow;s=ke.workflow_id;let Ze=Xe.nodes;["active","running"].includes(Ge(ke.status))||(ke=await $e(N.workflowStart(ke.workflow_id)),pt.value={...pt.value,[ke.workflow_id]:ke}),await xr(Ze);const At=[],la=new Map,za=[];for(const be of cl){const _e=Ze.find(gt=>gt.node_key===be.nodeKey);if(!_e)throw new Error(`快速角色缺少生成节点:${be.title}`);za.push({spec:be,node:_e})}const bt=async(be,_e="")=>{const{spec:gt,node:on}=be,Mt=await $e(N.nodeGenerate(on.node_id),{prompt_patch:$b(e,gt.nodeKey,O,V),prompt_processing_mode:"direct",translation_consent:!1,count:1,aspect_ratio:gt.aspectRatio,...ce?{model_route:ce}:{},..._e?{input_images:[{image_id:_e}]}:{},idempotency_key:`web-quick-${ke.workflow_id}-${b}-${gt.nodeKey}`,metadata:{source:"standalone_web_quick_character",profile_id:a,profile_name:e.name,workflow_id:ke.workflow_id,workflow_type:Fn,quick_character_batch_id:f,batch_started_at:c,identity_fields:O,quick_character_target:gt.nodeKey,anchor_image_id:_e||void 0,node_title:gt.title,task_summary:`快速角色 / ${e.name} / ${gt.title.replace(/^快速/,"")}`}}),fo=await cc(Mt.images??[]);if(!fo.length){const Bp=Mt.task_id?`任务 ${rn(Mt.task_id)},状态 ${Dl(Mt.task_status||Mt.node_status)}`:`节点状态 ${Dl(Mt.node_status)}`;throw new Error(`没有返回可用图片(${Bp}),请在队列查看具体错误并重试`)}return jt.value={...jt.value,[on.node_id]:Jo([...jt.value[on.node_id]??[],...fo])},At.push(...fo),la.set(gt.nodeKey,fo),{spec:gt,node:on,images:fo,taskId:Mt.task_id||""}},Ha=za.find(({spec:be})=>be.nodeKey==="quick_avatar");if(!Ha)throw new Error("快速角色缺少头像锚点节点");en.value="正在生成头像锚点;完成后将并行提交半身像、立绘和设定图。";let xa;try{xa=await bt(Ha)}catch(be){throw new Error(`快速头像:${Ie(be)}`)}const da=xa.images[0];if(!da)throw new Error("头像锚点没有返回可用图片");const x=za.filter(({spec:be})=>be.nodeKey!=="quick_avatar");en.value=`头像锚点已完成,正在并行提交其余 ${x.length} 个一致性任务。`;let Fe=0;const oa=await Promise.allSettled(x.map(async be=>{try{return await bt(be,da.image_id)}catch(_e){throw new Error(`${be.spec.title}:${Ie(_e)}`)}finally{Fe+=1,en.value=`头像锚点已锁定,其余任务已返回 ${Fe}/${x.length}。`}})),Aa=[];oa.forEach(be=>{if(be.status==="rejected"){Aa.push(Ie(be.reason));return}const{spec:_e,node:gt,images:on}=be.value;jt.value={...jt.value,[gt.node_id]:Jo([...jt.value[gt.node_id]??[],...on])},la.set(_e.nodeKey,on)}),Ze=await Pe(N.workflowNodes(ke.workflow_id)),await xr(Ze);const qn=Jo(cl.flatMap(be=>{const _e=Ze.find(gt=>gt.node_key===be.nodeKey);return _e?jt.value[_e.node_id]??[]:[]})),Ma=cl.filter(be=>{const _e=Ze.find(on=>on.node_key===be.nodeKey),gt=_e?jt.value[_e.node_id]??[]:[];return!!(_e&&Td(_e,gt))}).map(be=>be.nodeKey),ln=cl.filter(be=>{const _e=Ze.find(gt=>gt.node_key===be.nodeKey);return!!(_e&&["created","pending","queued","running","retrying"].includes(Ge(_e.status)))}).map(be=>be.nodeKey),Dn=Ma.length===cl.length,Tl=Dn?"completed":ln.length?"running":"failed";ke=(await Pe(N.workflow(ke.workflow_id))).workflow;const Bl={current_node_id:((pe=Ze.find(be=>be.node_key==="quick_sheet"))==null?void 0:pe.node_id)??((Ve=Ze.at(-1))==null?void 0:Ve.node_id),metadata:{...ke.metadata??{},source:"standalone_web_quick_character",quick_character_schema:"character_fast_v2",quick_character_batch_id:f,batch_started_at:c,identity_fields:O,model_route:ce,anchor_image_id:da.image_id,quick_character_anchor_first:!0,generated_target_keys:Ma,quick_character_parallel:!0,quick_character_operation_id:b,quick_character_pending_target_keys:ln,quick_character_failure:Aa.length&&!ln.length?Aa.join(";"):null}};Ge(ke.status)!==Tl&&(Bl.status=Tl),ke=await Lr(N.workflow(ke.workflow_id),Bl),rt.value={...rt.value,[ke.workflow_id]:Ze},pt.value={...pt.value,[ke.workflow_id]:ke},Xt.value={...Xt.value,[a]:[ke,...(Xt.value[a]??[]).filter(be=>be.workflow_id!==ke.workflow_id)]};const er=Ze.find(be=>be.node_key==="quick_avatar"),Ll=((Oe=la.get("quick_avatar"))==null?void 0:Oe[0])??(er?Td(er,jt.value[er.node_id]??[]):void 0);if(Ll){const be=await Lr(N.profile(a),{avatar_image_uri:Ll.image_uri});Jt.value=Jt.value.map(_e=>_e.profile_id===a?be:_e),xn.value={...xn.value,[a]:Ca(Ll)}}Dn&&zv(a,Fn);const k=be=>be.id===e.id||be.profileId===a?{...be,quickCharacterWorkflowId:ke.workflow_id,status:Dn?"快速角色已生成":ln.length?`快速角色生成中 ${Ma.length}/4`:`快速角色部分完成 ${Ma.length}/4`,updatedAt:"刚刚"}:be;if(mn.value=mn.value.map(k),ia.value=ia.value.map(k),Ll&&(zr.value=Ll.image_id),Dn)en.value=`四个独立任务均已完成,共 ${qn.length} 张角色图片已保存。`,An.value="";else if(ln.length)en.value=`四个独立任务均已提交:已完成 ${Ma.length} 个,仍在后端处理 ${ln.length} 个。可以离开页面,稍后在队列查看。`,An.value=Aa.length?`部分页面请求已超时或断开,但对应后端任务仍在运行:${Aa.join(";")}`:"";else{const be=Aa.join(";")||"部分节点没有返回可用图片";en.value=`四个独立任务均已结束:成功 ${Ma.length} 个,失败 ${cl.length-Ma.length} 个。成功结果已保留。`,An.value=`快速角色部分生成失败:${be}`,P.value={...P.value,[a]:An.value}}await Promise.allSettled([Va(),fl(),nn()])}catch(Xe){const ke=`快速角色生成失败:${Ie(Xe)}`;if(s)try{const Ze=await Pe(N.workflow(s)),At=await Lr(N.workflow(s),{status:"failed",metadata:{...Ze.workflow.metadata??{},quick_character_batch_id:f,batch_started_at:c,identity_fields:O,model_route:ce,quick_character_failure:ke}});pt.value={...pt.value,[s]:At}}catch{}en.value="生成任务已停止,可前往队列查看失败记录并手动重试。",An.value=ke,P.value={...P.value,[a]:ke}}finally{E.value={...E.value,[a]:""}}}function hb(e){return`quick-${mu(e)}-${Date.now().toString(36)}-${Math.random().toString(16).slice(2,10)}`}function mu(e){return e.replace(/[^a-zA-Z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"profile"}function kb(){var r,s;const e=ta((r=at.value)==null?void 0:r.config.model_assignments)?at.value.config.model_assignments:void 0,a=ta((s=at.value)==null?void 0:s.config.generation)?at.value.config.generation:void 0;return he(e,"quick_generation")||he(a,"default_model")||bu()}function rc(e){const a=e.profileId?Jt.value.find(r=>r.profile_id===e.profileId):void 0;return dp({name:e.name,identity:e.identity,appearance:(a==null?void 0:a.appearance_prompt)||ui(e),gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,clothing:e.clothing})}function $b(e,a,r=rc(e),s=_n.value.map(c=>c.prompt)){const c={quick_avatar:"square avatar, close-up portrait, clear face, stable hair and eye details",quick_bust:"half-body character reference, upper-body clothing, natural posture",quick_stand:"full-body standing character illustration, complete outfit, accurate body proportions",quick_sheet:"character design sheet, multiple views, outfit details, material callouts"},f=e.profileId?Jt.value.find(C=>C.profile_id===e.profileId):void 0;return["same single character in every image","preserve exact gender presentation, age, species, face identity, body type, hair, eyes and distinctive features",Object.entries(r).map(([C,O])=>`${C.replaceAll("_"," ")}: ${O}`).join(", "),f==null?void 0:f.base_prompt,f==null?void 0:f.appearance_prompt,e.name,e.identity,e.personality,ui(e),e.style,c[a],...s].filter(Boolean).join(", ")}async function ic(e){var c;const a=St.value;if(!a||E.value[a.profile_id])return;const r=Bt(e==="quick"?"生成快速角色":"创建详细工作流");if(r||((c=a.metadata)==null?void 0:c.source)==="sample"){P.value={...P.value,[a.profile_id]:r||"预览角色不能创建真实工作流。"};return}const s=Uo.value.find(f=>f.id===a.profile_id||f.profileId===a.profile_id);if(!(s!=null&&s.profileId)){P.value={...P.value,[a.profile_id]:"当前角色还没有可用的后端档案标识。"};return}if(e==="quick"){await Dv(s);return}hv(a.profile_id),E.value={...E.value,[a.profile_id]:e},P.value={...P.value,[a.profile_id]:""};try{const f=await $u(s,Cn);sc(a.profile_id,"workflow"),nt.value=fi(f.workflow,f.nodes)}catch(f){P.value={...P.value,[a.profile_id]:`详细工作流创建失败:${Ie(f)}`}}finally{E.value[a.profile_id]===e&&(E.value={...E.value,[a.profile_id]:""})}}async function Cb(){var c;const e=St.value;if(!e)return;if(!e.detailed_workflow_state){ic("detailed");return}if(E.value[e.profile_id])return;const a="detailed",r=Cn;let s=!1;E.value={...E.value,[e.profile_id]:a},P.value={...P.value,[e.profile_id]:""};try{let f=Xt.value[e.profile_id],b=f==null?void 0:f.find(C=>C.workflow_type===r&&vi(C));if(b||(f=await Pe(N.profileWorkflows(e.profile_id)),b=f.find(C=>C.workflow_type===r&&vi(C)),Xt.value={...Xt.value,[e.profile_id]:f}),!b)s=!0;else{let C=rt.value[b.workflow_id];if(!C){const V=await Pe(N.workflow(b.workflow_id));b=V.workflow,C=V.nodes,pt.value={...pt.value,[b.workflow_id]:b},rt.value={...rt.value,[b.workflow_id]:C}}const O=Uo.value.find(V=>V.id===e.profile_id||V.profileId===e.profile_id);O&&Ar(O,b,C),sc(e.profile_id,"workflow"),nt.value=fi(b,C)}}catch(f){P.value={...P.value,[e.profile_id]:`工作流打开失败:${Ie(f)}`}}finally{E.value[e.profile_id]===a&&(E.value={...E.value,[e.profile_id]:""})}s&&((c=St.value)==null?void 0:c.profile_id)===e.profile_id&&ic(a)}async function Sb(){var r;const e=St.value;if(!e||vr.value||((r=e.metadata)==null?void 0:r.source)==="sample")return;const a=Bt("删除角色档案");if(a){P.value={...P.value,[e.profile_id]:a};return}if(window.confirm(`确认删除角色「${e.name}」?角色档案将从列表移除,已有图片仍保留在图库中。`)){vr.value=e.profile_id;try{await ju(N.profile(e.profile_id));const s=new Set((Xt.value[e.profile_id]??[]).map(f=>f.workflow_id)),c=new Set([...s].flatMap(f=>(rt.value[f]??[]).map(b=>b.node_id)));Jt.value=Jt.value.filter(f=>f.profile_id!==e.profile_id),ia.value=ia.value.filter(f=>f.profileId!==e.profile_id),mn.value=mn.value.filter(f=>f.profileId!==e.profile_id),Xt.value=gu(Xt.value,e.profile_id),xn.value=gu(xn.value,e.profile_id),E.value=gu(E.value,e.profile_id),P.value=gu(P.value,e.profile_id),pt.value=Object.fromEntries(Object.entries(pt.value).filter(([f])=>!s.has(f))),rt.value=Object.fromEntries(Object.entries(rt.value).filter(([f])=>!s.has(f))),jt.value=Object.fromEntries(Object.entries(jt.value).filter(([f])=>!c.has(f))),oc(""),await Promise.allSettled([Va(),nn()])}catch(s){P.value={...P.value,[e.profile_id]:`删除角色失败:${Ie(s)}`}}finally{vr.value=""}}}function gu(e,a){return Object.fromEntries(Object.entries(e).filter(([r])=>r!==a))}function Ib(e){var r;const a=(r=St.value)==null?void 0:r.profile_id;a&&sc(a,e)}function Pb(e){if(e!=="workflow"){ve.value=!1,ie.value=!1,U.value=e;return}ve.value=!0,ie.value=!1,U.value="workflow";const a=sa.value;nt.value=a?fi(a,xl.value):"brief-import"}async function xb(){const e=Ee.value;if(!e.profileId){ol.value="请先保存角色档案,再开启详细工作流。";return}pr.value=!0,ol.value="";try{const a=await $u(e,Cn);Ar(e,a.workflow,a.nodes),ve.value=!0,ie.value=!0,U.value="workflow",nt.value=fi(a.workflow,a.nodes)}catch(a){ol.value=`详细工作流打开失败:${Ie(a)}`}finally{pr.value=!1}}function sc(e,a){const r=Uo.value.find(s=>s.id===e||s.profileId===e);r&&yu(r),ve.value=a==="workflow",ie.value=a==="workflow",U.value=a,Zt("generate","generate")}function Ab(){U.value="quickProfile",Zt("generate","generate"),ya(pi)}function Mb(){U.value="quickProfile",Zt("generate","generate"),ya(np)}function Rb(){Zt("materials","images")}function yu(e){Os.value=e.id,Po.value="",ll.value="",ol.value="",ge.value="",el.value={name:e.name,identity:e.identity,genderPresentation:e.genderPresentation,ageStage:e.ageStage,species:e.species,bodyType:e.bodyType,distinctiveFeatures:e.distinctiveFeatures,personality:e.personality,hairColor:e.hairColor,hairstyle:e.hairstyle,eyeColor:e.eyeColor,clothing:e.clothing,style:e.style,negative:e.negative},Ba.value={},Hl.value="";const a=Do.value.find(r=>r.id===e.materialId);if(a&&(Ba.value={...Ba.value,[a.category]:a.id},Hl.value=a.id),e.profileId&&(e.workflowId||e.quickCharacterWorkflowId))Gv(e);else if(e.profileId){const r=Jt.value.find(s=>s.profile_id===e.profileId);r&&bv(r)}}function Ov(e){Cr.value.some(a=>a.id===e)&&(Zn.value=e)}function xt(e){return he(e.metadata,"candidate_id")||e.image_id}function Eb(){Pn.value="",Ta.value=[],Tt.value="",Fa.value={},zl.value=!1}function El(e){var b;const a=no.value.find(C=>C.id===e);if(!a)return;nt.value=a.id,Eb(),so(a.id)&&(_t.value="");const r=xl.value.find(C=>pl(C)===a.id),c=((b=a.imageIds)!=null&&b.length?a.imageIds:[a.imageId]).filter(C=>Vd.value.some(O=>O.image_id===C)),f=r==null?void 0:r.selected_image_id;Ge((r==null?void 0:r.status)??"")==="selected"&&f&&c.includes(f)&&(Tt.value=f)}function Wv(e){if(Bn.value.some(a=>xt(a)===e)){if(oo.value){ge.value=an.value?lo.value:`${Vo.value} 已确认采用的节点不能更换选图。`;return}Pn.value=e,Ta.value=Ta.value.includes(e)?Ta.value.filter(a=>a!==e):[...Ta.value,e]}}function Nb(e){Bn.value.some(a=>xt(a)===e)&&(Pn.value=e)}function Tb(e){var r,s;const a=(s=(r=Ko.value.find(c=>c.candidate_id===e))==null?void 0:r.image)==null?void 0:s.image_id;a&&Cu(a)}function Bb(e){const a=Tt.value;if(e)Uv(e);else{if(oo.value)return;Tt.value=""}Tt.value!==a&&Lb(a)}async function Lb(e){const a=lt.value;if(!a||a.legacy||a.read_only)return;const r=Tt.value;Di.value=r||e,vt.value="";try{const s=await $e(N.roundFeedback(a.round.round_id),{updates:[],draft_final_candidate_id:r||null,idempotency_key:`web-round-draft-final-${a.round.round_id}-${r||"clear"}-${Date.now()}`});Qo(a.round.node_id,s)}catch(s){Tt.value=e,vt.value=`待定稿候选保存失败:${Ie(s)}`}finally{Di.value=""}}function Uv(e){if(!Bn.value.some(s=>xt(s)===e))return;if(oo.value){ge.value=an.value?lo.value:`${Vo.value} 已确认采用的节点不能更换选图。`;return}const a=Ko.value.find(s=>s.candidate_id===e);if(a&&!ns(a)){vt.value="只有生成成功并返回图片的候选才能定稿。";return}const r=ts(e);if(["rejected","strict_rejected"].includes(r)){vt.value="已拒绝的候选不能定稿;请先取消拒绝反馈。";return}Tt.value=Tt.value===e?"":e,Pn.value=e}async function _u(e,a,r){var O;if(!Bn.value.some(V=>xt(V)===e)||oo.value)return;const s=(O=Fa.value[e])==null?void 0:O.kind,c=s===a?"neutral":a;if(c==="liked"&&s!=="liked"&&o_.value){vt.value="同一轮最多保留 3 个喜欢候选;请先取消一个已喜欢候选。";return}const f=Fa.value;Fa.value={...f,[e]:{kind:c,note:r}};const b=lt.value;if(!(!b||b.legacy||!b.candidates.find(V=>V.candidate_id===e))){Di.value=e,vt.value="";try{const V={updates:[{candidate_id:e,preference_status:c,...r!=null&&r.trim()?{reason:r.trim()}:{}}]},ce=await $e(N.roundFeedback(b.round.round_id),V);Qo(b.round.node_id,ce)}catch(V){Fa.value=f,vt.value=`候选反馈保存失败:${Ie(V)}`}finally{Di.value=""}}}function ts(e){var a;return((a=Fa.value[e])==null?void 0:a.kind)??"neutral"}async function qb(){const e=Ee.value,a=lt.value,r=Tt.value;if(!(e!=null&&e.workflowId)||!a||!r||Oi.value)return!1;if(lu.value)return vt.value="该节点已经确认;如需改选,请先从当前节点创建分支。",!1;const s=a.candidates.filter(c=>c.candidate_id===r);if(!tv.value||s.length!==1||!ns(s[0]))return vt.value="最终确认必须严格选择一张生成成功的候选。",!1;Oi.value=r,vt.value="";try{const c=await $e(N.roundConfirm(a.round.round_id),{candidate_id:r,idempotency_key:`web-round-confirm-${a.round.round_id}-${r}`});Qo(a.round.node_id,c),il.value=`已确认 ${s[0].display_code}`,ge.value=`${s[0].display_code} 已确认为本节点最终候选。`;const f=he(c.next_node??void 0,"node_key");return await Pu(e,e.workflowId,f?zc(f):void 0),!0}catch(c){return vt.value=`最终确认失败:${Ie(c)}`,ge.value=vt.value,!1}finally{Oi.value=""}}async function uc(){var r;const e=Ce.value.trim();if(!e||Ot.value)return;if(!ni.value){Ea.value="请先在设置中配置并确认一个生图模型。";return}const a=Bt("图片生成");if(a){Ea.value=a;return}Ot.value=!0,Ea.value="",Be.value=e,Qe.value=((r=ni.value)==null?void 0:r.label)??Wt.value;try{const s=await Db(),c=await $e(N.nodeGenerate(s.nodeId),{prompt_patch:e,prompt_processing_mode:ee.value,translation_consent:ee.value==="llm",model_route:bu(),count:1,aspect_ratio:"1:1",idempotency_key:`web-single-${Date.now()}-${Math.random().toString(16).slice(2)}`,metadata:{source:"standalone_web",workflow_id:s.workflowId}}),f=await cc(c.images??[]);f[0]&&(Z.value=f[0].image_id),Ce.value="",await Promise.allSettled([Va(),fl(),nn()])}catch(s){Ea.value=`生成失败:${Ie(s)}`}finally{Ot.value=!1}}async function Db(){if(Yn.value)return Yn.value;const e=await Pe(N.profiles,{keyword:Yc,page:1,page_size:10});let a=e.items.find(b=>{var C;return((C=b.metadata)==null?void 0:C.system_key)===ds})??e.items.find(b=>b.name===Yc);a||(a=await $e(N.profiles,{name:Yc,description:"System profile used by the standalone image generation workspace.",default_model_route:bu(),metadata:{source:"standalone_web",system_key:ds}}));let s=(await Pe(N.profileWorkflows(a.profile_id))).find(b=>b.workflow_type==="single_image"),c=[];if(s)c=await Pe(N.workflowNodes(s.workflow_id));else{const b=await $e(N.profileWorkflows(a.profile_id),{workflow_type:"single_image",display_name:"ImageStudio Single Image Flow",status:"draft",metadata:{source:"standalone_web",system_key:ds}});s=b.workflow,c=b.nodes}const f=c.find(b=>b.node_key==="virtual_single_image")??c[0];if(!f)throw new Error("单图工作流缺少可生成节点");return Yn.value={profileId:a.profile_id,workflowId:s.workflow_id,nodeId:f.node_id},Yn.value}function dc(e){if(!e)return"";if(e.routeName)return e.routeName;const a=dn.value.find(s=>`${s.provider_id}/${s.model_id}`===e.value),r=he(a==null?void 0:a.capabilities,"route_name")||he(a==null?void 0:a.probe_result,"route_name")||he(a==null?void 0:a.capabilities,"model_route");return r||(e.status==="fallback"?"":e.value)}function bu(){return dc(ni.value)}function wu(e){const a=e.trim();if(!a)return"";const r=Qn.value.find(c=>c.route===a);if(r)return`${r.name||r.provider_id} / ${r.model||r.provider_id}`;const s=qo.value.find(c=>c.value===a||dc(c)===a);return s?`${s.provider} / ${s.label}`:a}function Ob(e){var c;const a=(c=Ue.value)==null?void 0:c.node_id;if(!a)return;const r=e.trim(),s={...$l.value};r?s[a]=r:delete s[a],$l.value=s}async function cc(e){var s;const a=await Promise.all(e.map(async c=>{try{return await Pe(N.image(c.image_id))}catch{return c}})),r=a.filter(hn);if(a.length&&!r.length){const c=a[0];throw new qa("provider_fallback_rejected","图像提供方生成失败;后端返回的 mock/降级占位图已被拒绝。",{image_id:c.image_id,provider_error:(s=c.metadata)==null?void 0:s.provider_error})}return r.map(os)}function Fv(e,a){const r=sn(a,c=>c.branch_name);if(r.some(c=>c.branch_name==="main"))return r;const s=pt.value[e];return[{branch_id:"branch_virtual_main",workflow_id:e,branch_name:"main",base_branch_name:null,base_node_id:null,status:(s==null?void 0:s.current_branch)==="main"?"active":"available",metadata:{},created_at:(s==null?void 0:s.created_at)??"",updated_at:(s==null?void 0:s.updated_at)??""},...r]}async function ci(e){if(!e)return[];L.value=e,v.value="";try{const a=Fv(e,await Pe(N.workflowBranches(e)));return Me.value={...Me.value,[e]:a},a}catch(a){return v.value=`分支列表加载失败:${Ie(a)}`,Me.value[e]??[]}finally{L.value===e&&(L.value="")}}async function fc(e,a=!1){var s;if(!e)return null;const r=A.value[e];if(r&&!a)return r;we.value=e,Te.value="";try{const c=await Pe(N.nodeDependencyContext(e));return A.value={...A.value,[e]:c},c}catch(c){return((s=Ue.value)==null?void 0:s.node_id)===e&&(Te.value=`依赖上下文加载失败:${Ie(c)}`),null}finally{we.value===e&&(we.value="")}}function as(e){return X.has(Ge(e))}function ns(e){return G.has(Ge(e.candidate.generation_status))}function Wb(e){return{planned:"已规划",queued:"排队中",running:"生成中",succeeded:"已成功",success:"已成功",completed:"已成功",failed:"失败",cancelled:"已取消"}[Ge(e)]||e||"未知"}function hu(e,a){var f;a&&(Pn.value="",Ta.value=[],zl.value=!1),Fa.value=Object.fromEntries(e.candidates.flatMap(b=>{const C=Ge(b.preference_status);return["liked","rejected","strict_rejected"].includes(C)?[[b.candidate_id,{kind:C,note:b.preference_reason||void 0}]]:[]}));const r=((f=e.candidates.find(b=>b.is_final))==null?void 0:f.candidate_id)??"",s=he(e.round.feedback_snapshot,"draft_final_candidate_id"),c=r||(e.candidates.some(b=>b.candidate_id===s)?s:"");Tt.value=c}function Qo(e,a,r={}){var C;const s=dt.value[e]??[],c=[a,...s.filter(O=>O.round.round_id!==a.round.round_id)].sort((O,V)=>V.round.round_number-O.round.round_number),f=Gt.value[e],b=r.select||!f?a.round.round_id:f;dt.value={...dt.value,[e]:c},Gt.value={...Gt.value,[e]:b},((C=Ue.value)==null?void 0:C.node_id)===e&&b===a.round.round_id&&hu(a,f!==b)}function jv(){br!==void 0&&(window.clearTimeout(br),br=void 0)}function Pr(e=lt.value){if(jv(),!e||!as(e.round.status)||document.hidden)return;const a=e.round.round_id;br=window.setTimeout(()=>{var r;br=void 0,((r=lt.value)==null?void 0:r.round.round_id)===a&&ku(a,!0)},4e3)}async function ku(e,a=!1){if(!e||Hr.value===e)return null;Hr.value=e,a||(vt.value="");try{const r=await Pe(N.round(e));return Qo(r.round.node_id,r),Pr(r),r}catch(r){return a||(vt.value=`轮次加载失败:${Ie(r)}`),a&&Pr(lt.value),null}finally{Hr.value===e&&(Hr.value="")}}async function vc(e,a=!1){var r,s,c,f,b;if(!e)return[];if(!a&&dt.value[e]){const C=dt.value[e],O=Gt.value[e],V=C.find(ce=>ce.round.round_id===O)??C[0]??null;return((r=Ue.value)==null?void 0:r.node_id)===e&&V&&hu(V,!0),Pr(V),C}qi.value=e,vt.value="";try{const O=(await Pe(N.nodeRounds(e),{include_legacy:!0})).items??[],V=Gt.value[e],ce=he((s=Ue.value)==null?void 0:s.metadata,"active_round_id"),pe=(V&&O.some(Oe=>Oe.round.round_id===V)?V:"")||(ce&&O.some(Oe=>Oe.round.round_id===ce)?ce:"")||((c=O[0])==null?void 0:c.round.round_id)||"";dt.value={...dt.value,[e]:O},Gt.value={...Gt.value,[e]:pe};const Ve=O.find(Oe=>Oe.round.round_id===pe)??null;return((f=Ue.value)==null?void 0:f.node_id)===e&&Ve&&hu(Ve,V!==pe),Pr(Ve),O}catch(C){return((b=Ue.value)==null?void 0:b.node_id)===e&&(vt.value=`轮次列表加载失败:${Ie(C)}`),dt.value[e]??[]}finally{qi.value===e&&(qi.value="")}}function Ub(e){var c;const a=(c=Ue.value)==null?void 0:c.node_id;if(!a)return;const r=(dt.value[a]??[]).find(f=>f.round.round_id===e);if(!r)return;const s=Gt.value[a];Gt.value={...Gt.value,[a]:e},hu(r,s!==e),Pr(r),as(r.round.status)&&ku(e)}function Fb(){const e=sa.value,a=Ue.value;if(!e||!a)return null;const r=lt.value;return{workflow_id:e.workflow_id,branch_name:a.branch_name||e.current_branch||"main",node_id:a.node_id,round_id:r&&!r.legacy?r.round.round_id:null,return_view:"generate"}}async function Kv(){var s;const e=Ue.value,a=Fb();if(!e||!a||!ua.value)return ha.value="当前节点不是可绑定素材的详细角色图像节点。",null;const r=e.node_id;qs.value=!0,ha.value="";try{const c=await Pe(N.nodeMaterialBindings(r),{workflow_id:a.workflow_id,branch_name:a.branch_name,node_id:a.node_id,round_id:a.round_id||void 0,return_view:a.return_view});return((s=Ue.value)==null?void 0:s.node_id)!==r?null:(ul.value=c,c)}catch(c){return ha.value=`节点素材加载失败:${Ie(c)}`,null}finally{qs.value=!1}}async function jb(){if(ha.value="",gr.value="",ul.value=null,Ls.value=!0,oe.value.state!=="connected"){ha.value="后端尚未连接,当前无法读取节点素材。";return}await Promise.allSettled([Kv(),wn()]),Kt.value&&!ha.value&&(ha.value=`素材库加载失败:${Kt.value}`)}function Kb(){qs.value||Ds.value||Nt.value||(Ls.value=!1,ha.value="",gr.value="",eo.value="",xo.value=[])}async function Vb(){gr.value="",await Promise.allSettled([Kv(),wn()]),Kt.value&&!ha.value&&(ha.value=`素材库加载失败:${Kt.value}`)}async function Vv(e,a=(r=>(r=Ue.value)==null?void 0:r.node_id)()||""){const s=ul.value;if(!a||!s||s.node_id!==a)return ha.value="节点素材上下文已经变化,请重新打开抽屉后再保存。",!1;if(!Wd.value)return ha.value=Ud.value,!1;const c={selected_material_ids:Array.from(new Set(e.map(f=>f.trim()).filter(Boolean))),navigation_context:s.navigation_context};Ds.value=!0,ha.value="",gr.value="";try{const f=await Lr(N.nodeMaterialBindings(a),c);return ul.value=f,gr.value=`已保存 ${f.material_bindings.selected_material_ids.length} 项当前节点素材覆盖。历史轮次快照未变更。`,await fc(a,!0),!0}catch(f){return ha.value=`节点素材保存失败:${Ie(f)}`,!1}finally{Ds.value=!1}}function Gb(e){var r,s;const a=((r=Ue.value)==null?void 0:r.node_id)||"";if(!a||!Wd.value){ha.value=Ud.value||"当前节点素材不可修改。";return}if(!((s=ne.value)!=null&&s.permissions.can_manage_materials)){ha.value="上传并确认新素材需要素材管理权限;仍可选择已有的已确认素材。";return}xo.value=Array.from(new Set(e.map(c=>c.trim()).filter(Boolean))),Ho("upload-image",{workflowTargetNodeId:a})}async function zb(){Ls.value=!1,eo.value="",xo.value=[],await rp()}async function Hb(e){Qr.value=e;const a=fn.value.trim();lv.value&&a&&await Qv(a)!=="saved"||await Iu()}function Qb(e){const a=Ko.value.find(r=>r.candidate_id===e);a&&(vt.value=`${a.display_code} 未生成成功。当前稳定接口按轮次重试;请保留需要的反馈后点击“开始新一轮”。`)}async function Gv(e){if(!e.profileId)return;const a=Array.from(new Set([e.workflowId,e.quickCharacterWorkflowId].filter(s=>!!s)));if(!a.length)return;const r=a.filter(s=>{var c;return!((c=rt.value[s])!=null&&c.length)});if(!r.length){e.workflowId&&await ci(e.workflowId);return}pr.value=!0,ol.value="";try{const s=await Promise.all(r.map(f=>Pe(N.workflow(f))));rt.value={...rt.value,...Object.fromEntries(s.map(f=>[f.workflow.workflow_id,f.nodes]))},pt.value={...pt.value,...Object.fromEntries(s.map(f=>[f.workflow.workflow_id,f.workflow]))},await Promise.all([xr(s.flatMap(f=>f.nodes)),e.workflowId?ci(e.workflowId):Promise.resolve([])]);const c=s.find(f=>f.workflow.workflow_type===Cn);c&&Ar(e,c.workflow,c.nodes)}catch(s){ol.value=`工作流加载失败:${Ie(s)}`}finally{pr.value=!1}}async function $u(e,a=Cn,r={}){if(!e.profileId)throw new Error("角色卡还没有后端 profile_id");const s=r.forceNew?`${e.profileId}:${a}:${r.workflowId||he(r.metadata,"quick_character_batch_id")}`:`${e.profileId}:${a}`,c=ba.get(s);if(c)return c;const f=Yb(e,a,r);ba.set(s,f);try{return await f}finally{ba.get(s)===f&&ba.delete(s)}}async function Yb(e,a,r={}){if(!e.profileId)throw new Error("角色卡还没有后端 profile_id");const s=await Pe(N.profileWorkflows(e.profileId));let c=s,f=r.forceNew?void 0:s.find(C=>C.workflow_id===e.workflowId&&C.workflow_type===a&&vi(C))??s.find(C=>C.workflow_type===a&&vi(C)),b=[];if(f){const C=await Pe(N.workflow(f.workflow_id));f=C.workflow,b=C.nodes}else{hv(e.profileId);try{const C=await $e(N.profileWorkflows(e.profileId),{workflow_id:r.workflowId||Zb(e.profileId,a,s),workflow_type:a,display_name:`${e.name} ${a===Fn?"快速角色":"详细角色工作流"}`,status:"draft",metadata:{source:"standalone_web",generation_kind:a===Fn?"quick":"detailed",quick_profile_workflow_id:e.quickProfileWorkflowId,...r.metadata??{}}});f=C.workflow,b=C.nodes}catch(C){if(r.forceNew)throw C;const O=await Pe(N.profileWorkflows(e.profileId));c=O;const V=O.find(pe=>pe.workflow_type===a&&vi(pe));if(!V)throw C;const ce=await Pe(N.workflow(V.workflow_id));if(!Xb(ce.nodes,a))throw C;f=ce.workflow,b=ce.nodes}}if(a===Fn&&(b=await Jb(f.workflow_id,b)),rt.value={...rt.value,[f.workflow_id]:b},pt.value={...pt.value,[f.workflow_id]:f},Xt.value={...Xt.value,[e.profileId]:[f,...c.filter(C=>C.workflow_id!==f.workflow_id)]},await Promise.all([xr(b),a===Cn?ci(f.workflow_id):Promise.resolve([])]),a===Cn)Ar(e,f,b);else{const C=O=>O.id===e.id||O.profileId===e.profileId?{...O,quickCharacterWorkflowId:f.workflow_id,status:"快速角色已准备"}:O;mn.value=mn.value.map(C),ia.value=ia.value.map(C)}return a===Cn&&zv(e.profileId,a),{workflow:f,nodes:b}}async function Jb(e,a){const r=[...a];for(const s of cl){if(r.some(f=>f.node_key===s.nodeKey))continue;const c=await $e(N.workflowNodes(e),{node_key:s.nodeKey,title:s.title,description:s.detail,step_name:s.nodeKey,node_type:"generation",status:"draft",branch_name:"main",sort_order:s.sortOrder,metadata:{template:"character_fast_v2",quick_character_target:s.nodeKey}});r.push(c)}return r.sort((s,c)=>s.sort_order-c.sort_order)}function Xb(e,a){const r=new Set(e.map(s=>lr(s.node_key)));return a===Fn?cl.every(s=>r.has(s.nodeKey)):["profile_brief","prompt_plan","material_bind","profile_card"].every(s=>r.has(s))}function Zb(e,a,r){const s=r.filter(c=>c.workflow_type===a).length+1;return`workflow_${e}_${a}_${s}`}function zv(e,a){const r=a===Fn?"quick":"detailed";Jt.value=Jt.value.map(s=>s.profile_id!==e?s:{...s,generation_kind:s.generation_kind==="detailed"?"detailed":r})}async function xr(e){const a=await Promise.all(e.map(async r=>{try{const s=await Pe(N.nodeImages(r.node_id));if(r.selected_image_id&&!s.some(c=>c.image_id===r.selected_image_id))try{s.unshift(await Pe(N.image(r.selected_image_id)))}catch{}return[r.node_id,Jo(s.filter(hn).map(os))]}catch{return[r.node_id,jt.value[r.node_id]??[]]}}));jt.value={...jt.value,...Object.fromEntries(a)}}function Ar(e,a,r){const s=c=>c.id!==e.id&&c.profileId!==e.profileId?c:{...c,workflowId:a.workflow_id,workflowNodeIds:r.map(f=>f.node_id),status:a.status==="completed"?"工作流已拆解":"工作流就绪"};mn.value=mn.value.map(s),ia.value=ia.value.map(s)}function pc(e){return e.workflow_type==="character_gradual"||e.workflow_type==="character_fast"}function mc(e){var r;if(!e||e.workflow_type!==Cn)return!1;const a=(r=e.metadata)==null?void 0:r.character_execution;return!ta(a)||a.import_confirmed===!1?!1:a.import_confirmed===!0||a.executor==="character_workflow"}function fi(e,a){if(!mc(e))return"brief-import";const r=a.filter(f=>f.branch_name===e.current_branch).sort((f,b)=>f.sort_order-b.sort_order),s=r.find(f=>!["completed","selected","skipped"].includes(Ge(f.status))),c=r.at(-1);return s||c?pl(s??c):"brief-import"}function Hv(e){return[...e].filter(a=>a.workflow_type===Fn&&!["archived","cancelled"].includes(Ge(a.status))).sort((a,r)=>{const s=he(a.metadata,"batch_started_at")||a.created_at,c=he(r.metadata,"batch_started_at")||r.created_at;return ml(c)-ml(s)})[0]}function vi(e){const a=Ge(e.status);return!pc(e)||["cancelled","archived"].includes(a)?!1:e.workflow_type!==Fn||a!=="completed"}function gc(e){const a=Je.value,r=Ee.value,s=Yi.value.flatMap(b=>b.fields.filter(C=>C.value&&C.value!=="待补充").map(C=>`${b.title}/${C.label}: ${C.value}`)).slice(0,18),c=_n.value.map(b=>`${b.label}: ${b.prompt}`),f=bn.value.filter(hn).map(b=>`${Ga(b)} / ${b.status}`);return["[ImageStudio node-aware workflow injection]","Task: understand the user's source-language instruction, translate it into concise English image-generation prompt language, then merge it into the selected workflow node.","Keep character names, locked identity traits, and explicit user constraints. Do not drop negative constraints.","Target prompt language: English","Source language: auto-detect",`User instruction: ${e}`,`Node: ${a.title}`,`Node phase: ${a.phase}`,`Node status: ${Rr(a.status)}`,`Node existing prompt: ${a.prompt||"-"}`,`Node locked items: ${a.lockedItems||"-"}`,`Node decision: ${a.decision||"-"}`,`Character: ${r.name}`,`Identity: ${r.identity}`,`Personality: ${r.personality}`,`Appearance: ${ui(r)}`,`Style: ${r.style||"-"}`,`Negative prompt: ${r.negative||"-"}`,`Structured persona fields: ${s.length?s.join(" | "):"-"}`,`Selected materials: ${c.length?c.join(" | "):"-"}`,`Selected drafts: ${f.length?f.join(" | "):"-"}`].join(`
|
||
`)}function yc(e){const a=Je.value,r=Ee.value;return{source:"standalone_web_workflow_chat",ui_node_id:nt.value,ui_node_title:a.title,ui_node_phase:a.phase,ui_node_status:a.status,profile_id:r.profileId,profile_name:r.name,workflow_id:r.workflowId,source_language:"auto",target_prompt_language:"en",translation_mode:"backend_llm",user_instruction:e,persona_split_fields_ready:iu.value,persona_split_fields_total:ru.value,selected_material_ids:lc(),selected_draft_image_ids:bn.value.filter(hn).map(s=>s.image_id),candidate_feedback:Fa.value}}function ew(e){var c;const a=e.interpretation;if(!a)return"候选反馈已保存。";const r=[],s=[["喜欢",a.liked],["拒绝",a.rejected],["严格拒绝",a.strict_rejected]];for(const[f,b]of s)b.length&&r.push(`${f} ${b.map(C=>C.display_code).join("、")}`);return(c=a.final)!=null&&c.display_code&&r.push(`待定稿 ${a.final.display_code}`),a.positive_patch&&r.push("已生成正向调整"),a.negative_patch&&r.push("已生成负向约束"),a.material_intent&&r.push(`素材意图:${a.material_intent}`),r.length?r.join(";"):"下一轮调整要求已保存。"}async function Qv(e){var r,s,c;const a=lt.value;if(!ua.value||!a||a.legacy||!a.candidates.length)return"not_applicable";if(lu.value)return vt.value="该轮次已经确认;如需继续修改,请先从当前节点创建分支。","blocked";Le.value=!0,vt.value="",il.value="";try{const f=await $e(N.roundFeedback(a.round.round_id),{feedback_text:e,idempotency_key:`web-round-feedback-text-${a.round.round_id}-${Date.now()}`});Qo(a.round.node_id,f);const b=ew(f);return il.value=`${b} 点击“开始新一轮”后会使用这些反馈。`,ge.value=b,Vr.value=e,Bi.value=(s=(r=f.interpretation)==null?void 0:r.metadata)!=null&&s.model_route?`候选反馈 / ${String(f.interpretation.metadata.model_route)}`:`候选反馈 / ${((c=f.interpretation)==null?void 0:c.source)||"确定性解释"}`,fn.value="","saved"}catch(f){return vt.value=`候选反馈理解失败:${Ie(f)}`,ge.value=vt.value,"failed"}finally{Le.value=!1}}async function tw(){const e=fn.value.trim();if(!e||Le.value||await Qv(e)!=="not_applicable")return;if(ua.value&&!jo.value.route){ge.value="当前节点和后端默认均未提供生图路由,请先显式覆盖或前往设置配置。";return}await Iu({promptPatch:gc(e),metadata:yc(e)})&&(Vr.value=e,Bi.value=`${Je.value.title} / ${qd.value||"后端自动"}`)}function Yv(){!Pa.value||!Ca(Pa.value)||(Ks.value="generation",kn("imageViewer"),bc(),Ro.value=!0)}function Cu(e){const a=(e?Vd.value.find(r=>r.image_id===e):null)??Ml.value;!a||!Ca(a)||(zl.value=!1,Z.value=a.image_id,Yv())}function Jv(){bn.value.length<2||(zl.value=!0)}function aw(e){return{configure_distinct_generation_cross_review_routes:"请在设置页配置至少一个与主候选不同的生图模型",configure_image_generation_route:"请先配置并启用可用的生图模型路由",regenerate_primary_candidate_with_configured_route:"主候选缺少可复用的模型路由,请先重新生成主候选",retry_or_remove_failed_review_candidate:"当前审查轮次存在失败候选,请重试失败项后再继续",select_review_candidates:"请至少勾选一个需要重新生成的审查候选",open_active_cross_review:"该节点已有进行中的交叉审查,请打开当前审查轮次",create_branch:"当前节点已锁定或工作流已封存,请先创建可编辑分支"}[e]||e.replace(/_/g," ")}function Su(e,a){const r=Ie(e),s=e instanceof qa?he(e.details,"required_action"):"";return s?`${r};建议操作:${aw(s)}。`:`${a}:${r}`}async function nw(){var r;const e=lt.value;if(!e||e.legacy||!ua.value)return;const a=e.round.round_id;Ka.value=!0,Cl.value="";try{const s=await Pe(N.round(a));if(((r=lt.value)==null?void 0:r.round.round_id)!==a)return;Qo(s.round.node_id,s,{select:!0}),sl.value=s,mr.value=!0}catch(s){vt.value=Su(s,"交叉审查轮次加载失败")}finally{Ka.value=!1}}function lw(){Ka.value||(mr.value=!1,Cl.value="")}function ow(e){var r;const a=(r=e.image)==null?void 0:r.image_id;a&&Cu(a)}function _c(e){Qo(e.round.node_id,e,{select:!0}),sl.value=e,Pr(e)}async function Xv(e){var c;const a=Ee.value,r=e.round.workflow_id||(a==null?void 0:a.workflowId);if(await vc(e.round.node_id,!0),!a||!r)return;const s=he(e.next_node??void 0,"node_key");if(await Pu(a,r,s?zc(s):void 0),!s&&((c=e.approval)!=null&&c.restoration_node_id)){const f=Mr(r).find(b=>{var C;return b.node_id===((C=e.approval)==null?void 0:C.restoration_node_id)});f&&El(pl(f))}}async function rw(e){const a=sl.value;if(!(!a||Ka.value||ou.value)){Ka.value=!0,Cl.value="";try{const r=await $e(N.roundGenerationCrossReview(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-${e.decision}-${a.round.round_id}-${e.candidate_id}`});if(_c(r),e.decision==="review"){il.value=`${r.round.display_code} 已加入生成式交叉审查队列。`;return}il.value="已跳过生成式交叉审查并确认采用该候选。",mr.value=!1,await Xv(r)}catch(r){Cl.value=Su(r,"交叉审查提交失败")}finally{Ka.value=!1}}}async function iw(e){const a=sl.value;if(!(!a||Ka.value||ou.value)){Ka.value=!0,Cl.value="";try{const r=await $e(N.roundGenerationCrossReviewRegenerate(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-regenerate-${a.round.round_id}-${e.candidate_ids.slice().sort().join("-")}`});_c(r),il.value=`${r.round.display_code} 已入队,仅重新生成所选候选。`}catch(r){Cl.value=Su(r,"交叉审查重生成失败")}finally{Ka.value=!1}}}async function sw(e){const a=sl.value;if(!(!a||Ka.value||ou.value)){Ka.value=!0,Cl.value="";try{const r=await $e(N.roundGenerationCrossReviewApprove(a.round.round_id),{...e,idempotency_key:e.idempotency_key||`web-generation-cross-review-approve-${a.round.round_id}-${e.candidate_id}`});_c(r),il.value="交叉审查候选已明确采用,并已交接到高清修复(XF)节点。",mr.value=!1,await Xv(r)}catch(r){Cl.value=Su(r,"交叉审查采用失败")}finally{Ka.value=!1}}}function Zv(e){var a;e&&Ov(e),(a=$a.value)!=null&&a.imageUrl&&(Ks.value="quickProfile",kn("imageViewer"),bc(),Ro.value=!0)}function ep(){Ro.value=!1,yr.value=!1}function bc(){to.value=1,Eo.value={x:0,y:0}}function uw(e){to.value=Bh(Number((to.value+e).toFixed(2)),.5,4),to.value<=1&&(Eo.value={x:0,y:0})}function dw(e){uw(e.deltaY<0?.12:-.12)}function cw(){if(to.value>1){bc();return}to.value=2.2,Eo.value={x:0,y:0}}function fw(e){to.value<=1||(yr.value=!0,_r.value={pointerId:e.pointerId,x:e.clientX,y:e.clientY,offsetX:Eo.value.x,offsetY:Eo.value.y},e.currentTarget instanceof HTMLElement&&e.currentTarget.setPointerCapture(e.pointerId))}function vw(e){!yr.value||e.pointerId!==_r.value.pointerId||(Eo.value={x:_r.value.offsetX+e.clientX-_r.value.x,y:_r.value.offsetY+e.clientY-_r.value.y})}function wc(e){!yr.value||e.pointerId!==_r.value.pointerId||(yr.value=!1,e.currentTarget instanceof HTMLElement&&e.currentTarget.hasPointerCapture(e.pointerId)&&e.currentTarget.releasePointerCapture(e.pointerId))}function tp(){kn("search"),gd.value=!0,Yr.value=!0,Mn.value=0}function ap(e){if(!Ir.value.length)return;const a=Ir.value.length;Mn.value=(Mn.value+e+a)%a}function pw(){const e=Ir.value[Mn.value];e&&Cv(e)}function pi(){kn("personaQuestionnaire"),kl.value="",Vt.value=!0}function np(){kn("externalProfileImport"),hl.value="",fr.value="",vn.value=!0,ya(()=>{var e;(e=document.querySelector("[data-profile-import-input]"))==null||e.focus()})}function mw(){kn("quickProfileDetail"),cr.value=!0}function gw(e){Jn.value=e,kn("materialDetail"),Yl.value=!0}async function yw(e){if(e.enabled){if(e.actionKey==="personaQuestionnaire"){pi();return}if(e.actionKey==="workflowCompare"){Jv();return}if(e.actionKey==="externalProfileImport"){np();return}if(e.actionKey==="workflowPersonaSplit"){await Iw();return}if(e.actionKey==="workflowSaveVersion"){await Dw();return}if(e.actionKey==="workflowCreateBranchFromNode"){await rp();return}if(e.actionKey==="workflowNodeGenerate"){e.id==="hires"&&nt.value!=="hires-fix"&&(El("hires-fix"),await ya()),await Iu();return}if(e.actionKey==="workflowNodeRetry"){await Iu({retry:!0});return}if(e.actionKey==="workflowNodeComplete"){await Pw();return}if(e.actionKey==="workflowNodeReview"){await Ew();return}if(e.actionKey==="workflowReviewAdopt"){await Bw();return}if(e.actionKey==="workflowPromptPlanSave"){await xw();return}if(e.actionKey==="workflowPromptPlanComplete"){await Mw();return}if(e.actionKey==="workflowPromptPlanNext"){El("prompt-plan");return}if(e.actionKey==="workflowMaterialBindSave"){await Aw();return}if(e.actionKey==="workflowMaterialBindComplete"){await Rw();return}if(e.actionKey==="workflowArchiveFinal"){await hw();return}e.nav&&e.module&&Zt(e.nav,e.module)}}function _w(e){const a=e.profileId?Jt.value.find(s=>s.profile_id===e.profileId):void 0;return[["角色名",(a==null?void 0:a.name)||e.name],["身份定位",e.identity],["性格",e.personality],["性别表现",e.genderPresentation],["年龄阶段",e.ageStage],["物种/种族",e.species],["体型",e.bodyType],["显著特征",e.distinctiveFeatures],["基础设定",(a==null?void 0:a.base_prompt)||""],["外观",(a==null?void 0:a.appearance_prompt)||ui(e)],["发色",e.hairColor],["发型",e.hairstyle],["瞳色",e.eyeColor],["服装",e.clothing],["风格",(a==null?void 0:a.style_prompt)||e.style],["规避项",(a==null?void 0:a.negative_prompt)||e.negative]].filter(s=>{var c;return!!((c=s[1])!=null&&c.trim())}).map(([s,c])=>`## ${s}
|
||
${c.trim()}`).join(`
|
||
|
||
`)}function bw(e){const a=Mr(e),r=(...f)=>{for(const b of f){const C=a.find(O=>lr(O.node_key)===b);if(C!=null&&C.selected_image_id)return C.selected_image_id}return""},s={avatar:r("headshot"),persona_image:r("design_sheet","turnaround"),standing:r("full_body"),pv:r("style_lock")},c=Object.entries(s).filter(([,f])=>!f).map(([f])=>f);if(c.length){const f={avatar:"头像(头像草稿)",persona_image:"人设图(设定图或三视图)",standing:"立绘(全身设定)",pv:"PV 图(高清修复与统一风格)"};return ge.value=`档案卡还缺少已明确采用的资产:${c.map(b=>f[b]).join("、")}。请回到对应节点确认一张候选图。`,null}return s}function ww(e){if(!(e instanceof qa))return`档案卡封存失败:${Ie(e)}`;const a=[],r=e.details.incomplete_node_keys;Array.isArray(r)&&r.length&&a.push(`未完成节点:${r.map(String).join("、")}`);const s=he(e.details,"asset_role");s&&a.push(`资产角色:${s}`);const c=he(e.details,"active_branch")||he(e.details,"branch_name");c&&a.push(`当前分支:${c}`);const f=he(e.details,"status");f&&a.push(`工作流状态:${f}`);const b=a.length?`(${a.join(";")})`:"";return`档案卡封存失败:${e.message}${b}`}async function hw(){const e=Ee.value;if(!e||Le.value)return;const a=Bt("建立档案卡");if(a){ge.value=a;return}if(!e.workflowId||!e.profileId){ge.value="请先保存角色并创建详细角色工作流,再建立档案卡。";return}const r=e.workflowId,s=pt.value[r],c=(s==null?void 0:s.current_branch)||"main",f=bw(r);if(!f)return;const b=_w(e);if(!b){ge.value="档案卡缺少人设文档,请先完成角色设定拆解。";return}const C={idempotency_key:`web-profile-card-${r}-${mu(c)}`,persona_document:b,assets:f,metadata:{source:"standalone_web_profile_card",schema_version:"character_profile_card_v1",profile_id:e.profileId,profile_name:e.name,workflow_id:r,branch_name:c,selected_material_ids:lc()}};Le.value=!0,ge.value="";try{const O=await $e(N.workflowFinalizeCard(r),C);Wi.value={...Wi.value,[e.profileId]:[O,...(Wi.value[e.profileId]??[]).filter(ce=>ce.card_id!==O.card_id)]},Zl.value=O.created_at,await Pu(e,r,"archive");const[V]=await Promise.allSettled([Pe(N.profileCards(e.profileId)),Jd(),Va(),nn()]);V.status==="fulfilled"&&(Wi.value={...Wi.value,[e.profileId]:V.value}),El("archive"),ge.value=`档案卡已原子封存:${rn(O.card_id)} / ${O.branch_name},4 类必填资产均已入库。`}catch(O){ge.value=ww(O)}finally{Le.value=!1}}async function hc(e){const a=Ee.value,r=a==null?void 0:a.workflowId;if(!r||Sa.value)return;const s=e==="start"?"启动":e==="cancel"?"取消":"归档";if(e==="start"&&!au.value){rl.value="请先在第一个节点导入粗略人设;导入成功后工作流会自动启动。";return}if(!(e!=="start"&&!window.confirm(`确定${s}当前工作流吗?`))){Sa.value=!0,rl.value="";try{const c=e==="start"?N.workflowStart(r):e==="cancel"?N.workflowCancel(r):N.workflowArchive(r),f=await $e(c);pt.value={...pt.value,[r]:f},rl.value=`工作流已${s}`}catch(c){rl.value=Ie(c)}finally{Sa.value=!1}}}async function kw(){var a;const e=(a=Ee.value)==null?void 0:a.workflowId;if(e){Sa.value=!0;try{$t.value=await Pe(N.workflowReview(e)),rl.value="整体审查已完成"}catch(r){rl.value=Ie(r)}finally{Sa.value=!1}}}async function lp(){var r;const e=(r=Ue.value)==null?void 0:r.node_id;if(!e)return;Sa.value=!0;const a=await fc(e,!0);rl.value=a?"依赖上下文已刷新":Te.value,Sa.value=!1}function ls(e){return an.value?`${e}暂不可用:${lo.value}`:Al.value?`${e}已被锁定:${Vo.value}`:""}function $w(e){return`branch_${(e.node_key||e.node_id).replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,28)}_${Date.now().toString(36)}`}async function op(e,a,r,s={}){const c=await $e(N.workflowSwitchBranch(a),{branch_name:r}),f=await Pe(N.workflowNodes(a)),b=f.filter(V=>V.branch_name===c.current_branch);rt.value={...rt.value,[a]:f},pt.value={...pt.value,[a]:c},Ar(e,c,b.length?b:f);const C=(s.copiedFromNodeId?b.find(V=>he(V.metadata,"copied_from_node_id")===s.copiedFromNodeId):void 0)??(s.preferredUiNodeId?b.find(V=>pl(V)===s.preferredUiNodeId):void 0),O=C?pl(C):fi(c,b.length?b:f);return no.value.some(V=>V.id===O)&&El(O),await Promise.all([xr(b.length?b:f),ci(a)]),c}async function Cw(e){var f;const a=Ee.value,r=a==null?void 0:a.workflowId;if(!a||!r||le.value||e===((f=sa.value)==null?void 0:f.current_branch))return;const s=Bt("切换工作流分支");if(s){v.value=s;return}le.value=e,v.value="";const c=nt.value;try{await op(a,r,e,{preferredUiNodeId:c}),ge.value=`已切换到分支 ${e}。`}catch(b){v.value=`切换分支失败:${Ie(b)}`}finally{le.value=""}}async function rp(){var f,b;const e=Ee.value,a=Ue.value;if(!(e!=null&&e.workflowId)||!a||w.value||le.value)return;const r=Bt("创建工作流分支");if(r){v.value=r,ge.value=r;return}w.value=!0,v.value="",ge.value="";const s=e.workflowId,c=((f=Je.value)==null?void 0:f.title)??a.title;try{const C=await $e(N.workflowBranches(s),{branch_name:$w(a),base_branch_name:a.branch_name||((b=pt.value[s])==null?void 0:b.current_branch)||"main",base_node_id:a.node_id,copy_nodes:!0,metadata:{source:"standalone_web",ui_node_id:nt.value,ui_node_title:c,reason:"edit_locked_completed_node"}});Me.value={...Me.value,[s]:Fv(s,[...Me.value[s]??[],C])},le.value=C.branch_name,await op(e,s,C.branch_name,{preferredUiNodeId:nt.value,copiedFromNodeId:a.node_id}),ge.value=`已从「${c}」创建分支 ${C.branch_name},现在可以在新分支继续修改。`}catch(C){v.value=`创建分支失败:${Ie(C)}`,ge.value=v.value}finally{w.value=!1,le.value=""}}async function Sw(e={}){const a=Ee.value,r=Ue.value;if(!a||!r||Le.value)return!1;const s=ls(e.retry?"新建重试轮次":"新建生成轮次");if(s)return vt.value=`${s};请先创建分支。`,!1;Le.value=!0,md.value=r.node_id,vt.value="",il.value="";try{const c=Je.value,f=fn.value.trim(),b=e.promptPatch??(f?gc(f):(c==null?void 0:c.prompt)||et.value.basePrompt),C=lt.value,O=C&&!C.legacy&&C.candidates.length?C:null;if(!O&&!jo.value.route)return vt.value="当前节点和后端默认均未提供生图路由,请先在下方显式覆盖或前往设置配置。",ge.value=vt.value,!1;if(O){const pe=Od.value;if(pe<1||pe>3)return vt.value="开始下一轮前,请先把 1–3 张生成成功的候选标记为“喜欢”。",ge.value=vt.value,!1}const V=`${Date.now()}-${Math.random().toString(16).slice(2)}`,ce=O?await $e(N.roundNext(O.round.round_id),{count:Qr.value,...Hc(ri.value),idempotency_key:`web-round-next-${O.round.round_id}-${V}`}):await $e(N.nodeRounds(r.node_id),{round_kind:"primary",count:Qr.value,prompt_patch:b,...Hc(ri.value),aspect_ratio:xp(c),idempotency_key:`web-round-${r.node_id}-${V}`,metadata:{source:"standalone_web_round",ui_node_id:nt.value,requested_count:Qr.value,...f?yc(f):{},...e.metadata??{}}});return Qo(r.node_id,ce,{select:!0}),il.value=O?`已根据 ${O.round.display_code} 的反馈加入下一轮生成队列`:"已加入生成队列",ge.value=`轮次 ${ce.round.display_code} 已加入生成队列。`,fn.value="",Pr(ce),await Promise.allSettled([fl(),nn()]),!0}catch(c){return vt.value=`轮次提交失败:${Ie(c)}`,ge.value=vt.value,!1}finally{Le.value=!1,md.value=""}}async function Iu(e={}){const a=Ee.value;if(!a||Le.value)return!1;if(ua.value)return Sw(e);const r=Bt(e.retry?"节点重跑":"节点生成");if(r)return ge.value=r,!1;const s=Yo(nt.value,a);if(!s)return ge.value="当前节点还没有绑定后端 node_id",!1;const c=ls(e.retry?"节点重跑":"节点生成");if(c)return ge.value=c,!1;Le.value=!0,ge.value="";try{const f=Je.value,b=fn.value.trim(),O={prompt_patch:e.promptPatch??(b?gc(b):(f==null?void 0:f.prompt)||et.value.basePrompt),...Hc(ri.value),count:wh(f),aspect_ratio:xp(f),idempotency_key:`web-workflow-${s}-${Date.now()}-${Math.random().toString(16).slice(2)}`,metadata:{source:"standalone_web",ui_node_id:nt.value,...b?yc(b):{},...e.metadata??{}}},V=e.retry?N.nodeRetry(s):N.nodeGenerate(s),ce=await $e(V,O),pe=await cc(ce.images??[]);if(jt.value={...jt.value,[s]:Jo([...pe,...jt.value[s]??[]])},st.value=Jo([...pe,...st.value]).slice(0,12),pe[0]&&(Z.value=pe[0].image_id),a.workflowId){const Ve=await Pe(N.workflowNodes(a.workflowId));rt.value={...rt.value,[a.workflowId]:Ve}}return fn.value="",await Promise.allSettled([Va(),fl(),nn()]),!0}catch(f){return ge.value=`${e.retry?"节点重试":"节点生成"}失败:${Ie(f)}`,!1}finally{Le.value=!1}}async function Iw(){const e=Ee.value;if(!e||Io.value)return;const a=Bt("设定拆解");if(a){Po.value=a;return}if(!e.profileId){Po.value="请先通过“生成档案”保存到后端,再进入设定拆解。";return}const r=sa.value;if(mc(r)){nt.value=fi(r,xl.value);return}Io.value=!0,Po.value="";try{const{workflow:s}=await $u(e,Cn),c=await $e(N.workflowExecuteCharacter(s.workflow_id));rt.value={...rt.value,[s.workflow_id]:c.nodes},pt.value={...pt.value,[s.workflow_id]:c.workflow},Ar(e,c.workflow,c.nodes),El("persona-split")}catch(s){Po.value=`后端拆解失败:${Ie(s)}`}finally{Io.value=!1}}async function Pw(){await kc(nt.value,"prompt-plan","确认字段","字段已确认,提示词规划节点已解锁。")}async function kc(e,a,r,s){const c=Ee.value;if(!c||Le.value)return;const f=Bt(r);if(f){ge.value=f;return}if(so(e)){ge.value=lo.value;return}const b=Yo(e,c);if(!b){ge.value="当前节点还没有绑定后端 node_id";return}const C=ls(r);if(C){ge.value=C;return}Le.value=!0,ge.value="";try{const O=await $e(N.nodeComplete(b));if(c.workflowId){const V=rt.value[c.workflowId]??[];rt.value={...rt.value,[c.workflowId]:V.map(ce=>ce.node_id===O.node_id?O:ce)}}ge.value=s,El(a)}catch(O){ge.value=`${r}失败:${Ie(O)}`}finally{Le.value=!1}}async function xw(){var c;const e=Ee.value;if(!e||Le.value)return;const a=Bt("提示词规划");if(a){ge.value=a;return}const r=Yo("prompt-plan",e);if(!r){ge.value="当前工作流缺少后端提示词规划节点 prompt_plan。";return}const s=ls("提示词规划");if(s){ge.value=s;return}Le.value=!0,ge.value="";try{const f=Lw(e),b=await Lr(N.node(r),{prompt:f.prompt_context,negative_prompt:f.negative_prompt,metadata:{...((c=Mr(e.workflowId??"").find(C=>C.node_id===r))==null?void 0:c.metadata)??{},prompt_plan:f,prompt_plan_schema_version:"2026-07-09.prompt-plan-schema.v1",ui_node_id:"prompt-plan",source:"standalone_web_prompt_plan"}});ip(e.workflowId,b),ge.value="提示词规划已写入后端 prompt_plan 节点。"}catch(f){ge.value=`提示词规划失败:${Ie(f)}`}finally{Le.value=!1}}async function Aw(){var c;const e=Ee.value;if(!e||Le.value)return;const a=Bt("素材绑定");if(a){ge.value=a;return}const r=Yo("material-bind",e);if(!r){ge.value="当前工作流缺少后端素材绑定节点 material_bind。";return}const s=ls("素材绑定");if(s){ge.value=s;return}Le.value=!0,ge.value="";try{const f=qw(e),b=await Lr(N.node(r),{metadata:{...((c=Mr(e.workflowId??"").find(C=>C.node_id===r))==null?void 0:c.metadata)??{},material_bindings:f,material_binding_schema_version:"2026-07-09.material-binding-schema.v1",ui_node_id:"material-bind",source:"standalone_web_material_bind"}});ip(e.workflowId,b),ge.value=f.selected_material_ids.length?`素材绑定已落库:${f.selected_material_ids.length} 类真实后端参考。`:"素材绑定已落库:默认不使用参考。"}catch(f){ge.value=`素材绑定失败:${Ie(f)}`}finally{Le.value=!1}}async function Mw(){await kc("prompt-plan","material-bind","确认提示词规划","提示词规划已确认,素材绑定节点已解锁。")}async function Rw(){await kc("material-bind","portrait-01","确认素材绑定","素材绑定已确认,头像草稿节点已解锁。")}async function Ew(){var s,c;const e=Ee.value;if(!e||Le.value)return;const a=Bt("节点审查");if(a){ge.value=a;return}if(an.value){ge.value=`节点审查暂不可用:${lo.value}`;return}const r=Yo(nt.value,e);if(!r){ge.value="当前节点还没有绑定后端 node_id";return}Le.value=!0,ge.value="";try{const f=await Pe(N.nodeReview(r));e.workflowId&&await $e(N.workflowHistory(e.workflowId),{action:"node_review",title:`${e.name} / ${Je.value.title} 审查`,node_id:r,image_id:he(f.summary,"selected_image_id")||((s=Ml.value)==null?void 0:s.image_id),include_nodes:!0,metadata:{source:"standalone_web_node_review",ui_node_id:nt.value,review_passed:f.passed,warning_count:f.warnings.length,error_count:f.errors.length,stage_review:f.stage_review}});const b=Array.isArray((c=f.stage_review)==null?void 0:c.candidates)?f.stage_review.candidates.length:0;ge.value=f.passed?`审查通过:${b} 个候选。`:`审查未通过:${f.errors.length} 个错误,${f.warnings.length} 个提醒。`}catch(f){ge.value=`节点审查失败:${Ie(f)}`}finally{Le.value=!1}}function Nw(e,a,r,s){const c=Mr(e).slice().sort((C,O)=>C.sort_order-O.sort_order),f=c.find(C=>C.node_id===r),b=f?c.find(C=>C.sort_order>f.sort_order):void 0;return b?{uiNodeId:pl(b),backendNodeId:b.node_id}:{uiNodeId:void 0,backendNodeId:void 0}}function Tw(e){return e==="hires-fix"?"hires_fix_input":e==="archive"?"archive_input":"next_stage_input"}async function Pu(e,a,r){const{workflow:s,nodes:c}=await Pe(N.workflow(a)),f=c.filter(b=>b.branch_name===s.current_branch);rt.value={...rt.value,[a]:c},pt.value={...pt.value,[a]:s},await xr(f.length?f:c),Ar(e,s,f.length?f:c),r&&no.value.some(b=>b.id===r)&&El(r)}async function Bw(){var b;const e=Ee.value;if(!e||Le.value)return;if(ua.value&<.value){await qb();return}const a=Bt("确认采用");if(a){ge.value=a;return}if(!e.workflowId){ge.value="请先生成角色档案并创建后端工作流,再确认采用。";return}if(an.value){ge.value=`确认采用暂不可用:${lo.value}`;return}if(Sr.value){ge.value=`${Vo.value} 已确认采用的节点不能重复采用。`;return}const r=Yo(nt.value,e);if(!r){ge.value="当前节点还没有绑定后端 node_id。";return}const s=su.value;if(!s||!hn(s)){ge.value="请先将一张真实后端候选图标记为定稿,再确认采用。";return}if(!(jt.value[r]??[]).some(C=>C.image_id===s.image_id)){ge.value="当前选中的图片不属于此后端节点,请重新选择节点内候选图。";return}const f=Nw(e.workflowId,nt.value,r);Le.value=!0,ge.value="";try{const C=await $e(N.nodeAdoptImage(r),{image_id:s.image_id,title:`${e.name} / ${Je.value.title} 确认采用`,metadata:{source:"standalone_web_stage_review_confirm",schema_version:"2026-07-09.stage-review-confirm.v1",profile_id:e.profileId,profile_name:e.name,workflow_id:e.workflowId,branch_name:((b=pt.value[e.workflowId])==null?void 0:b.current_branch)??"main",ui_review_node_id:`${nt.value}-review`,source_ui_node_id:nt.value,source_backend_node_id:r,next_ui_node_id:f.uiNodeId,next_backend_node_id:f.backendNodeId,handoff_bucket:f.uiNodeId,handoff_role:Tw(f.uiNodeId),selected_draft_image_ids:bn.value.filter(hn).map(O=>O.image_id),candidate_feedback:Fa.value}});Zl.value=C.created_at,await Pu(e,e.workflowId,f.uiNodeId),ge.value=f.uiNodeId?`已确认采用,当前节点已锁定并交接到「${yh(f.uiNodeId)}」。`:"已确认采用,当前节点已锁定。",await Promise.allSettled([Va(),nn()])}catch(C){ge.value=`确认采用失败:${Ie(C)}`}finally{Le.value=!1}}function ip(e,a){if(!e)return;const r=rt.value[e]??[];rt.value={...rt.value,[e]:r.map(s=>s.node_id===a.node_id?a:s)}}function Lw(e){const a=Yi.value.flatMap(f=>f.fields.filter(b=>b.value&&b.value!=="待补充").map(b=>`${b.label}: ${b.value}`)),r=[e.name,e.identity,e.personality,ui(e),e.style,a.slice(0,8).join(", ")].filter(Boolean).join(", "),s=e.negative||et.value.negativePrompt||"low quality, blurry, bad anatomy",c=[xu("portrait","头像节点",`${r}, face reference, clear eyes, recognizable hairstyle`,s,["name","hair","eyes","face identity"]),xu("bust","半身节点",`${r}, upper body, outfit silhouette, calm pose`,s,["face identity","hair","upper outfit"]),xu("fullbody","全身节点",`${r}, full body standing pose, complete outfit, shoes and accessories`,s,["face identity","body proportion","outfit"]),xu("sheet","设定图节点",`${r}, character design sheet, multi angle, expression and pose references`,s,["identity","outfit","style"])];return{profile_id:e.profileId,profile_name:e.name,negative_prompt:s,items:c,guard_checks:[{label:"负面词",value:s,status:"ready"},{label:"权重建议",value:"身份特征和发眼锚点优先,服装/配饰作为中等权重继承。",status:"ready"}],prompt_context:c.map(f=>f.prompt).join(`
|
||
`)}}function xu(e,a,r,s,c){return{id:e,title:a,prompt:r,negative:s,weight_suggestions:[{label:"identity",value:1.25,reason:"keep character identity stable"},{label:"style",value:.85,reason:"avoid overfitting style over identity"}],inherits:c,status:"ready"}}function qw(e){const a=_n.value,r=me.map((s,c)=>{const f=a.find(b=>b.category===s.category);return{id:`rule_${s.category}_${c+1}`,category:s.category,material_id:nc(f==null?void 0:f.id),material_label:(f==null?void 0:f.label)??"",material_group:(f==null?void 0:f.group)??(f==null?void 0:f.category)??"",material_prompt:(f==null?void 0:f.prompt)??"",material_colors:(f==null?void 0:f.colors)??[],bind_to_stages:sp(s.category),inheritance_rule:f?`${s.category} only affects explicitly bound downstream stages.`:"do not use reference unless user explicitly selects one",reference_strength:f?up(s.category):"弱",required:!!(f&&["风格","服装"].includes(s.category)),status:f?"ready":"pending"}});return{profile_id:e.profileId,profile_name:e.name,selected_material_ids:lc(),rules:r}}function sp(e){return{风格:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}],构图:[{stage_id:"portrait-draft",stage_title:"头像草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],服装:[{stage_id:"halfbody-draft",stage_title:"半身草稿"},{stage_id:"body-sheet",stage_title:"全身与设定图"}],鞋袜:[{stage_id:"body-sheet",stage_title:"全身与设定图"}],配饰:[{stage_id:"body-sheet",stage_title:"全身与设定图"},{stage_id:"review-archive",stage_title:"修复入库"}]}[e]??[{stage_id:"body-sheet",stage_title:"全身与设定图"}]}function up(e){return e==="风格"||e==="服装"?"强":e==="构图"?"中":"弱"}async function Dw(){var r;const e=Ee.value;if(!e||wa.value)return;const a=Bt("保存快照");if(a){ll.value=a;return}if(!e.workflowId){ll.value="请先生成档案并创建后端工作流,再保存快照。";return}wa.value=!0,ll.value="";try{const s=await $e(N.workflowHistory(e.workflowId),{action:"save_version",title:`${e.name} / ${((r=Je.value)==null?void 0:r.title)??"工作流快照"}`,node_id:Yo(nt.value,e),include_nodes:!0,metadata:{source:"standalone_web",ui_node_id:nt.value,profile_id:e.profileId,profile_name:e.name,profile_status:e.status}});Zl.value=s.created_at}catch(s){ll.value=`保存快照失败:${Ie(s)}`}finally{wa.value=!1}}function Yo(e,a){if(!a.workflowId)return;const s=Mr(a.workflowId).find(f=>pl(f)===e);if(s)return s.node_id;const c=a.workflowNodeIds??[];if(e!=="brief-import"&&e==="persona-split")return c[0]}function Mr(e){var s;const a=rt.value[e]??[],r=(s=pt.value[e])==null?void 0:s.current_branch;return r?a.filter(c=>c.branch_name===r):a}function Ow(e){const a=su.value;if(a&&(!e||a.node_id===e))return[a.image_id];if(!e)return[];const r=(jt.value[e]??[]).find(s=>{var c;return s.image_id===((c=xl.value.find(f=>f.node_id===e))==null?void 0:c.selected_image_id)});return r&&hn(r)?[r.image_id]:[]}function hn(e){const a="metadata"in e&&e.metadata&&typeof e.metadata=="object"?e.metadata:{},r=a.mock===!0||a.mock===1||a.mock==="true",s=Object.prototype.hasOwnProperty.call(a,"provider_error")&&a.provider_error!=null,c=a.fallback_used===!0||a.degraded===!0;return!r&&!s&&!c}async function Ww(){if(!Gf.value||So.value)return;const e=Bt("生成档案");if(e){kl.value=e;return}Li.value+=1;const a=Vw(Re.value,Li.value);So.value=!0,kl.value="";try{const r=await $e(N.quickProfileDraft,Uw(a,Re.value,pn.value)),s={...a,name:r.profile_preview.name||a.name,style:r.profile_preview.style_prompt||a.style,negative:r.profile_preview.negative_prompt||a.negative},c=await $e(N.quickProfileDraftSave,Fw(s,Re.value,pn.value,r)),b={...jw(c,s),status:"文本档案已保存"};mn.value=[b,...mn.value.filter(C=>C.id!==b.id)],Jt.value=[c.profile,...Jt.value.filter(C=>C.profile_id!==c.profile.profile_id)],Xt.value={...Xt.value,[c.profile.profile_id]:c.workflow?[c.workflow]:[]},yu(b),U.value="quickProfile",ea("personaQuestionnaire"),ya(()=>{var C;(C=document.querySelector(`[data-profile-card-id="${b.id}"]`))==null||C.scrollIntoView({block:"nearest",behavior:"smooth"})})}catch(r){kl.value=`后端生成或保存失败:${Ie(r)}`}finally{So.value=!1}}function Uw(e,a,r){return{questionnaire:{...$c(a,r),name:e.name,identity:e.identity,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,personality:e.personality.split(/[,,。;;\n]/).map(s=>s.trim()).filter(Boolean),hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,style:e.style,clothing_keywords:e.clothing.split(/[,,。;;\n]/).map(s=>s.trim()).filter(Boolean)},metadata:{source:"standalone_web_questionnaire",questionnaire_mode:r}}}function Fw(e,a,r,s){const c=$c(a,r),f=(s==null?void 0:s.profile_preview)??{name:e.name,base_prompt:[e.name,e.identity,e.personality?`personality: ${e.personality}`:""].filter(Boolean).join(", "),appearance_prompt:[e.hairColor,e.hairstyle,e.eyeColor,e.clothing].filter(Boolean).join(", "),style_prompt:e.style,negative_prompt:e.negative};return{draft_id:s==null?void 0:s.draft_id,draft:s,profile_preview:f,description:`${e.identity}。${e.personality}`,questionnaire:c,metadata:{source:"quick_profile_questionnaire",questionnaire_mode:r,material_id:nc(e.materialId)||void 0,identity:e.identity,personality:e.personality,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,raw_appearance:c.appearance,identity_fields:rc(e),hair_color:e.hairColor,hairstyle:e.hairstyle,eye_color:e.eyeColor,clothing:e.clothing,worldview:c.worldview,height_build:c.height_build,generation_style:c.generation_style},create_workflow:!1}}function $c(e,a){return dp({mode:a,role_core:e.roleCore,gender_presentation:e.genderPresentation,age_stage:e.ageStage,species:e.species,body_type:e.bodyType,distinctive_features:e.distinctiveFeatures,personality:e.personality,appearance:e.appearance,outfit:e.outfit,scene:e.scene,avoid:e.avoid,worldview:e.worldview,background:e.background,height_build:e.heightBuild,body_features:e.bodyFeatures,likes:e.likes,dislikes:e.dislikes,habits:e.habits,relationships:e.relationships,story_hooks:e.storyHooks,generation_style:e.generationStyle,shot_preference:e.shotPreference,mood:e.mood,extra_notes:e.extraNotes})}function dp(e){return Object.fromEntries(Object.entries(e).map(([a,r])=>[a,r.trim()]).filter(([,a])=>!!a))}function jw(e,a){var c,f;const r=e.profile,s=r.metadata??{};return{...a,id:r.profile_id,profileId:r.profile_id,workflowId:e.workflow&&pc(e.workflow)?e.workflow.workflow_id:void 0,quickProfileWorkflowId:(c=e.workflow)==null?void 0:c.workflow_id,workflowNodeIds:e.workflow&&pc(e.workflow)?(f=e.nodes)==null?void 0:f.map(b=>b.node_id):void 0,name:r.name||a.name,identity:na(s.identity)||a.identity,genderPresentation:Nl(s,"gender_presentation")||a.genderPresentation,ageStage:Nl(s,"age_stage")||a.ageStage,species:Nl(s,"species")||a.species,bodyType:Nl(s,"body_type")||a.bodyType,distinctiveFeatures:Nl(s,"distinctive_features")||a.distinctiveFeatures,personality:cp(r.base_prompt)||a.personality,hairColor:na(s.hair_color)||a.hairColor,hairstyle:na(s.hairstyle)||a.hairstyle,eyeColor:na(s.eye_color)||a.eyeColor,clothing:na(s.clothing)||a.clothing,style:r.style_prompt||a.style,negative:r.negative_prompt||a.negative,status:e.workflow?"已落库":"已保存",updatedAt:"刚刚"}}function Kw(e,a,r,s){const c=e.metadata??{},f=na(c.material_id),b=Do.value.find(C=>C.id===f);return{id:e.profile_id,profileId:e.profile_id,workflowId:a==null?void 0:a.workflow_id,quickProfileWorkflowId:r==null?void 0:r.workflow_id,workflowNodeIds:void 0,name:e.name,identity:na(c.identity)||e.description||"后端角色档案",genderPresentation:Nl(c,"gender_presentation"),ageStage:Nl(c,"age_stage"),species:Nl(c,"species"),bodyType:Nl(c,"body_type"),distinctiveFeatures:Nl(c,"distinctive_features"),personality:cp(e.base_prompt)||"待细化",hairColor:na(c.hair_color)||"待细化",hairstyle:na(c.hairstyle)||e.appearance_prompt||"待细化",eyeColor:na(c.eye_color)||"待细化",clothing:na(c.clothing)||e.appearance_prompt||"待细化",style:e.style_prompt||"待细化",negative:e.negative_prompt||"low quality, blurry, bad anatomy",status:a?a.status==="completed"?"工作流已拆解":"工作流就绪":r?"快速档案已落库":e.status,updatedAt:po(e.updated_at),materialId:f,colors:(b==null?void 0:b.colors)??fp(s+31)}}function na(e){return typeof e=="string"?e.trim():""}function Nl(e,a){const r=na(e[a]);if(r)return r;const s=ta(e.identity_fields)?e.identity_fields:void 0;if(s){const f=na(s[a]);if(f)return f}const c=ta(e.identity_lock)?e.identity_lock:void 0;return c?na(c[a]):""}function cp(e){const a="personality:",r=e??"",s=r.toLowerCase().indexOf(a);return s<0?"":r.slice(s+a.length).trim()}function Vw(e,a){const r=Gw(e.roleCore,a),s=r.identity==="角色身份待细化"&&[e.background,e.worldview].map(b=>b.trim()).filter(Boolean).join(",")||r.identity,c=[e.appearance,e.heightBuild,e.bodyFeatures].map(b=>b.trim()).filter(Boolean).join(","),f=Ad.value;return{id:`profile-local-${Date.now()}-${a}`,name:r.name,identity:s,genderPresentation:e.genderPresentation.trim(),ageStage:e.ageStage.trim(),species:e.species.trim(),bodyType:e.bodyType.trim(),distinctiveFeatures:e.distinctiveFeatures.trim(),personality:[e.personality,e.likes,e.dislikes].map(b=>b.trim()).filter(Boolean).join(";")||"性格待细化",hairColor:Cc(c,["发色","头发","发"],"发色待细化"),hairstyle:Cc(c,["发型","短发","长发","马尾","刘海"],c||"发型待细化"),eyeColor:Cc(c,["瞳色","眼睛","眼"],"瞳色待细化"),clothing:e.outfit.trim()||"服装与配饰待细化",style:zw(e),negative:e.avoid.trim()||"低质量、结构错误、过度复杂",status:"新建档案",updatedAt:"刚刚",materialId:(f==null?void 0:f.id)??"",colors:(f==null?void 0:f.colors)??fp(a)}}function Gw(e,a){const r=e.split(/[,,。;;\n]/).map(b=>Ps(b)).filter(Boolean),s=r[0]??"",c=s&&s.length<=16?s:`新角色 ${String(a).padStart(2,"0")}`,f=(s===c?r.slice(1).join(","):r.join(","))||(s&&s!==c?s:"角色身份待细化");return{name:c,identity:f}}function Cc(e,a,r){const s=e.trim();return s?s.split(/[,,。;;\n]/).map(f=>Ps(f)).filter(Boolean).find(f=>a.some(b=>f.includes(b)))??r:r}function zw(e){const a=[e.worldview,e.scene,e.generationStyle,e.shotPreference,e.mood].map(r=>r.trim()).filter(Boolean);return a.length?`${a.join(",")},角色设定插画,清晰轮廓,高可读设计`:"角色设定插画,清晰轮廓,高可读设计"}function fp(e){const a=[["#3f7edc","#2ec4b6","#f5c542"],["#2f7a60","#d2a23a","#e0f2fe"],["#d65b7f","#209b8d","#f4f4f5"]];return a[e%a.length]}async function Hw(e){var c,f;const a=e.target instanceof HTMLInputElement?e.target:null,r=(c=a==null?void 0:a.files)==null?void 0:c[0];if(!r)return;const s=r.name;if(!/\.(md|markdown|txt)$/i.test(s)){hl.value="仅支持 .md、.markdown 或 .txt 文件",a.value="";return}Gr.value=!0,hl.value="",fr.value=s;try{const b=await r.text(),C=await $e(N.quickProfileDocumentImport,{filename:s,content:b,questionnaire:$c(Re.value,pn.value)}),O={role_core:"roleCore",gender_presentation:"genderPresentation",age_stage:"ageStage",species:"species",body_type:"bodyType",distinctive_features:"distinctiveFeatures",personality:"personality",appearance:"appearance",outfit:"outfit",scene:"scene",avoid:"avoid",worldview:"worldview",background:"background",height_build:"heightBuild",body_features:"bodyFeatures",likes:"likes",dislikes:"dislikes",habits:"habits",relationships:"relationships",story_hooks:"storyHooks",generation_style:"generationStyle",shot_preference:"shotPreference",mood:"mood",extra_notes:"extraNotes"},V={...Re.value};for(const[pe,Ve]of Object.entries(C.questionnaire||{})){const Oe=O[pe];Oe&&typeof Ve=="string"&&Ve.trim()&&(V[Oe]=Ve)}Re.value=V,(C.unresolved_fields||[]).some(pe=>["worldview","background","relationships","story_hooks","extra_notes"].includes(pe))&&(pn.value="advanced"),Jl.value=b;const ce=(f=C.warnings)==null?void 0:f.filter(Boolean).join(";");hl.value=ce||(C.llm_used===!1?"未配置文本模型,已保留原文,请手动整理。":""),ea("externalProfileImport"),pi()}catch(b){hl.value=b instanceof Error?b.message:"文档识别失败"}finally{Gr.value=!1,a&&(a.value="")}}function Qw(){if(!Jl.value.trim())return;const a=Sd.value;Re.value={roleCore:a.roleCore,genderPresentation:a.genderPresentation,ageStage:a.ageStage,species:a.species,bodyType:a.bodyType,distinctiveFeatures:a.distinctiveFeatures,personality:a.personality,appearance:a.appearance,outfit:a.outfit,scene:a.scene,avoid:a.avoid,worldview:a.worldview,background:a.background,heightBuild:a.heightBuild,bodyFeatures:a.bodyFeatures,likes:a.likes,dislikes:a.dislikes,habits:a.habits,relationships:a.relationships,storyHooks:a.storyHooks,generationStyle:a.generationStyle,shotPreference:a.shotPreference,mood:a.mood,extraNotes:a.extraNotes},a.recognizedKeys.some(r=>["worldview","background","heightBuild","bodyFeatures","likes","dislikes","habits","relationships","storyHooks","generationStyle","shotPreference","mood","extraNotes"].includes(r))&&(pn.value="advanced"),ea("externalProfileImport"),pi()}function vp(e){var s;const a=e.target instanceof Element?e.target:null,r=(s=a==null?void 0:a.closest("[data-overlay-root]"))==null?void 0:s.dataset.overlayRoot;return hp(r)?r:null}function pp(e){e.button===0&&(Fi={pointerId:e.pointerId,x:e.clientX,y:e.clientY,startedOutside:vp(e)===null,moved:!1})}function mp(e){const a=Fi;!a||a.pointerId!==e.pointerId||a.moved||Math.hypot(e.clientX-a.x,e.clientY-a.y)>6&&(a.moved=!0)}function gp(e){const a=Fi;if(Fi=void 0,!a||a.pointerId!==e.pointerId||a.moved||!a.startedOutside||vp(e)!==null)return;const r=window.getSelection();r&&!r.isCollapsed||kn()}function yp(){Fi=void 0}function Yw(e){var s;if(e.key!=="Escape")return;const a=e.target instanceof Element?e.target:null,r=(s=a==null?void 0:a.closest("[data-overlay-root]"))==null?void 0:s.dataset.overlayRoot;if(hp(r)){ea(r);return}kn()}function _p(e){if(e.key==="Escape"){Yw(e);return}const a=e.target instanceof HTMLElement?e.target:null,r=!!(a!=null&&a.closest("input, textarea, select, [contenteditable='true']")),s=(e.ctrlKey||e.metaKey)&&e.key.toLowerCase()==="k",c=e.key==="/"&&!e.ctrlKey&&!e.metaKey&&!e.altKey&&!r;!s&&!c||(e.preventDefault(),tp(),ya(()=>{var f;return(f=Ef.value)==null?void 0:f.focus()}))}function Sc(e){const a=!wp(e);kn(e),bp(e,a)}function kn(e){for(const a of Nf)a!==e&&ea(a)}function ea(e){bp(e,!1)}function bp(e,a){e==="search"&&(gd.value=a,Yr.value=a),e==="palette"&&(Us.value=a),e==="notifications"&&(Fs.value=a),e==="logs"&&(js.value=a),e==="imageViewer"&&(Ro.value=a,a||(yr.value=!1)),e==="materialPicker"&&!a&&(_t.value=""),e==="materialDetail"&&(Yl.value=a),e==="materialCategoryCreate"&&(wl.value=a,!a&&!Xn.value&&(ja.value="")),e==="materialOperation"&&!a&&!Nt.value&&(In.value=null,Ft.value="",Co.value=null,eo.value="",xo.value=[]),e==="personaQuestionnaire"&&(Vt.value=a),e==="quickProfileDetail"&&(cr.value=a),e==="externalProfileImport"&&(vn.value=a)}function wp(e){return e==="search"?Yr.value:e==="palette"?Us.value:e==="notifications"?Fs.value:e==="imageViewer"?Ro.value:e==="materialPicker"?!!_t.value:e==="materialDetail"?Yl.value:e==="materialCategoryCreate"?wl.value:e==="materialOperation"?!!In.value:e==="personaQuestionnaire"?Vt.value:e==="quickProfileDetail"?cr.value:e==="externalProfileImport"?vn.value:js.value}function hp(e){return Nf.includes(e)}function Jw(e){Ao.value=e.primary,Mo.value=e.accent}function Xw(e){Rn.value.includes(e)||(Rn.value=[...Rn.value,e])}function Zw(){Rn.value=qr([...Rn.value,...Xi.value.map(e=>e.id)])}function eh(){const e=Xi.value.filter(a=>Rn.value.includes(a.id)).map(a=>a.id);Zr.value=qr([...Zr.value,...e])}function th(e){Zt(e.nav,e.module)}function kp(e){Na.value=e.task_id;const a=Ge(e.status);yt.value=["failed","dead_letter","cancelled"].includes(a)?"failed":["completed","succeeded","superseded"].includes(a)?"done":"active",Zt("queue","queue")}function ah(e){var r,s;const a=Ge(e.status);return!!(["failed","dead_letter","cancelled"].includes(a)&&((r=ne.value)!=null&&r.permissions.can_write)&&((s=ne.value)!=null&&s.permissions.can_retry_tasks)&&!En.value)}async function nh(e){kp(e),await ya();const a=Ji.value.find(r=>r.id==="retry");if(!(a!=null&&a.enabled)){tn.value="当前任务状态或权限不允许重试。";return}await Au(a)}async function lh(e=Lt.value){var r;if(Ti.value||!((r=ne.value)!=null&&r.permissions.can_manage_materials))return;Ti.value=!0;const a=new Set(e.map(s=>s.category_id));try{const s=[];for(const c of Ae){if(a.has(c.category_id))continue;const f=await $e(N.materialCategories,c);s.push(f),a.add(f.category_id)}for(const c of ue){if(a.has(c.category_id))continue;const f=c.parent_id;if(f&&!a.has(f))continue;const b=await $e(N.materialCategories,c);s.push(b),a.add(b.category_id)}s.length&&(Ut.value=`默认素材分类已落库:${s.length} 个。`,await wn())}catch(s){Kt.value=`默认分类落库失败:${Ie(s)}`}finally{Ti.value=!1}}async function oh(e){if(Nt.value)return;const a=eo.value,r=Bt("添加并识别素材");if(r){Ft.value=r;return}Nt.value=!0,Ft.value="",Kt.value="";let s=null,c=null,f=!1;try{s=await $e(N.materialUpload,{...e,metadata:{...e.metadata,source:"imagestudio_frontend",registration_mode:"browser_image_upload"}}),ma.value=e.category_id,Jn.value=s.material_id;try{const b=await $e(N.materialRecognize(s.material_id),{});if(a){const C=Ge(b.recognition_status);if(C==="pending_confirm")c=await $e(N.materialConfirm(b.material_id),{display_name:b.display_name,prompt:b.prompt,negative_prompt:b.negative_prompt,tags:b.tags});else if(C==="confirmed")c=b;else throw new Error(`识别状态为 ${pu(b.recognition_status)},尚不能绑定;请稍后在素材库确认后重试。`)}Ut.value=a?`素材「${b.display_name}」已识别并确认,正在绑定当前节点。`:`素材「${b.display_name}」已添加并完成识别,当前状态:${pu(b.recognition_status)}。`}catch(b){if(a)throw b;Kt.value=`素材「${s.display_name}」已保存,但自动识别失败:${Ie(b)}。可在素材详情中重新识别。`}if(await wn(),ma.value=e.category_id,Jn.value=s.material_id,a){if(!c||Ge(c.recognition_status)!=="confirmed")throw new Error("素材尚未确认,不能写入节点绑定。");const b=xo.value;if(!await Vv([...b,c.material_id],a))throw new Error(ha.value||"节点绑定保存失败");gr.value=`素材「${c.display_name}」已识别、确认并绑定到当前节点。`}f=!0}catch(b){s&&await wn(),Ft.value=s&&a?`素材已保存,但未能完成当前节点绑定:${Ie(b)}`:`添加素材失败:${Ie(b)}`}finally{Nt.value=!1,f&&ea("materialOperation")}}async function rh(e){if(Nt.value)return;const a=Bt("登记素材 URI");if(a){Ft.value=a;return}Nt.value=!0,Ft.value="";let r=!1;try{const s=await $e(N.materialUpload,{...e,metadata:{source:"imagestudio_frontend",registration_mode:"storage_reference_only"}});await wn(),ma.value=e.category_id,Jn.value=s.material_id,Ut.value=`素材 URI「${s.display_name}」已登记,当前状态:${pu(s.recognition_status)}。`,r=!0}catch(s){Ft.value=`登记素材 URI 失败:${Ie(s)}`}finally{Nt.value=!1,r&&ea("materialOperation")}}async function ih(e){const a=zi.value;if(!a||Nt.value)return;const r=Bt("保存素材标准属性");if(r){Ut.value=r;return}Nt.value=!0,Ut.value="";try{await Lr(N.material(a.material_id),{normalized_asset_profile:e}),await wn(),Ut.value=`素材「${a.display_name}」的标准属性已保存。`}catch(s){Ut.value=`保存标准属性失败:${Ie(s)}`}finally{Nt.value=!1}}async function sh(e){if(Nt.value)return;const a=Bt("预检查素材包");if(a){Ft.value=a;return}Nt.value=!0,Ft.value="",Co.value=null;try{Co.value=await $e(N.assetImportPack,{package_uri:e.package_uri,dry_run:!0})}catch(r){Ft.value=`素材包 dry-run 失败:${Ie(r)}`}finally{Nt.value=!1}}async function uh(e){if(Nt.value)return;const a=Co.value;if(!a||a.package_uri!==e.package_uri||!a.execution_enabled){Ft.value="请先完成有效的 dry-run 预检查。";return}const r=Bt("导入素材包");if(r){Ft.value=r;return}Nt.value=!0,Ft.value="";let s=!1;try{const c=await $e(N.assetImportPack,{package_uri:e.package_uri,dry_run:!1});await wn(),Ut.value=`素材包已导入:新增 ${c.applied.created} 条,更新 ${c.applied.updated} 条。`,s=!0}catch(c){Ft.value=`素材包导入失败:${Ie(c)}`}finally{Nt.value=!1,s&&ea("materialOperation")}}async function dh(e){if(Nt.value)return;const a=Ee.value,r=zi.value;if(!(a!=null&&a.profileId)||!r||Ge(r.recognition_status)!=="confirmed"){Ft.value="需要选中已落库角色和已确认的真实后端素材。";return}const s=Bt("导入角色衣橱");if(s){Ft.value=s;return}Nt.value=!0,Ft.value="";let c=!1;try{const f=await $e(N.wardrobeImportMaterial(a.profileId),{material_id:r.material_id,wardrobe_category:e.wardrobe_category});Ut.value=`素材「${r.display_name}」已导入角色「${a.name}」衣橱(${f.wardrobe_category})。`;const b=Jt.value.find(C=>C.profile_id===a.profileId);b&&await Xd(b,!0),c=!0}catch(f){Ft.value=`导入角色衣橱失败:${Ie(f)}`}finally{Nt.value=!1,c&&ea("materialOperation")}}async function $p(e){if(Za.value||!e.enabled)return;if(Kt.value="",Ut.value="",e.id==="workflow-bind"){Bv();return}if(e.id==="create-category"){Tv();return}if(e.id==="upload"){Ho("register-uri");return}if(e.id==="asset-pack"){Ho("asset-pack");return}if(e.id==="wardrobe"){Ho("wardrobe");return}if(e.id==="refresh"){Za.value=e.id,await wn(),Za.value="",Ut.value="素材库已刷新。";return}const a=li.value;if(!a||a.source!=="backend"){Kt.value="需要先选中一条真实后端素材。";return}Za.value=e.id;try{let r=null;e.id==="recognize"?(r=await $e(N.materialRecognize(a.id),{}),Ut.value=`素材「${r.display_name}」已提交识别。`):e.id==="re-recognize"?(r=await $e(N.materialReRecognize(a.id),{}),Ut.value=`素材「${r.display_name}」已重新识别。`):e.id==="confirm"?(r=await $e(N.materialConfirm(a.id),{display_name:a.label,prompt:a.prompt,negative_prompt:a.negativePrompt,tags:a.tags}),Ut.value=`素材「${r.display_name}」已确认入库。`):Kt.value=`不支持的素材操作:${e.id}`,r&&(Jn.value=r.material_id),await wn()}catch(r){Kt.value=`${e.title}失败:${Ie(r)}`}finally{Za.value=""}}async function Au(e){if(En.value||Nn.value||!e.enabled&&e.id!=="refresh")return;const a=Rl.value,r=ch(e.id,a);if(r){Nn.value=r;return}await Cp(e.id,a==null?void 0:a.task_id)}function ch(e,a){if(e==="delete"&&a)return{id:"delete",taskId:a.task_id,title:"删除终态队列记录",detail:`将删除「${Xo(a)}」的队列记录,并释放节点对旧任务的引用。已经生成的图库图片不会删除。`,confirmLabel:"确认删除"};if(e==="clear-failed"){const r=ga.value.length;return{id:"clear-failed",title:"清理异常记录",detail:r>100?`当前共有 ${r} 条失败、取消或死信记录,本次最多清理 100 条。`:`将清理当前 ${r} 条失败、取消或死信记录。`,confirmLabel:"确认清理"}}if(e==="clear-completed"){const r=Go.value.length;return{id:"clear-completed",title:"清理已完成记录",detail:r>100?`当前共有 ${r} 条已完成、成功或已替代记录,本次最多清理 100 条。生成图片会保留。`:`将清理当前 ${r} 条已完成、成功或已替代记录;生成图片会保留。`,confirmLabel:"确认清理"}}if(e==="clear-terminal"){const r=io.value.length;return{id:"clear-terminal",title:"清理全部终态记录",detail:r>100?`当前共有 ${r} 条终态记录,本次最多清理 100 条。运行中、排队中和重试中的任务不会删除。`:`将清理当前 ${r} 条终态记录;运行中、排队中和重试中的任务不会删除。`,confirmLabel:"确认清理终态"}}return null}function fh(){En.value||(Nn.value=null)}async function vh(){const e=Nn.value;if(!(!e||En.value))try{await Cp(e.id,e.taskId)}finally{Nn.value===e&&(Nn.value=null)}}async function Cp(e,a){var f,b;if(En.value)return;if(ka.value="",tn.value="",e==="refresh"){En.value=e;try{await Promise.allSettled([Va(),fl(),nn()]),tn.value="队列已刷新。"}finally{En.value=""}return}const r=Ji.value.find(C=>C.id===e),s=a?Ia.value.find(C=>C.task_id===a)??null:Rl.value,c=!!((f=ne.value)!=null&&f.permissions.can_write&&((b=ne.value)!=null&&b.permissions.can_retry_tasks));if(["delete","retry-all-failed","clear-failed","clear-completed","clear-terminal"].includes(e)&&!c){ka.value="当前账号缺少任务清理权限,请刷新页面后重试。";return}if(e==="delete"&&(!s||!io.value.some(C=>C.task_id===s.task_id))){ka.value="目标任务已不存在或状态已经变化,只有失败、取消、死信和已完成记录可以删除。";return}if(e==="retry-all-failed"&&ga.value.length===0){ka.value="当前已经没有可重试的失败、取消或死信记录。";return}if(e==="clear-failed"&&ga.value.length===0){ka.value="当前已经没有可清理的异常记录。";return}if(e==="clear-completed"&&Go.value.length===0){ka.value="当前已经没有可清理的已完成记录。";return}if(e==="clear-terminal"&&io.value.length===0){ka.value="当前已经没有可清理的终态记录。";return}En.value=e;try{if(e==="retry"){if(!s)return;const C=await $e(N.jobRetry(s.task_id),{});Na.value=C.task_id,tn.value=`替代任务 ${rn(C.task_id)} 已执行,状态:${Dl(C.status)}。`}else if(e==="retry-all-failed"){const C=await $e(N.jobRetryFailed,{limit:100});tn.value=mi(C,"失败任务已批量重试")}else if(e==="cancel"){if(!s)return;const C=await $e(N.jobCancel(s.task_id),{});Na.value=C.task_id,tn.value=`任务 ${rn(C.task_id)} 已取消。`}else if(e==="delete"){if(!s)return;await ju(N.jobDelete(s.task_id)),Na.value===s.task_id&&(Na.value=""),tn.value=`「${Xo(s)}」的队列记录已删除。`}else if(e==="clear-failed"){const C=await $e(N.jobClearFailed,{limit:100});tn.value=mi(C,"异常任务记录已清理")}else if(e==="clear-completed"){const C=await $e(N.jobClearTerminal,{limit:100,statuses:["completed","succeeded","superseded"]});tn.value=mi(C,"已完成任务记录已清理")}else if(e==="clear-terminal"){const C=await $e(N.jobClearTerminal,{limit:100});tn.value=mi(C,"终态任务记录已清理")}else if(e==="dead-letter-retry"){const C=await $e(N.jobDeadLetterRetry,{limit:5});tn.value=mi(C,"死信任务已重新执行")}else if(e==="failed-to-dead-letter"){const C=await $e(N.jobDeadLetterMoveFailed,{limit:50});tn.value=mi(C,"失败任务已移入死信")}await Promise.allSettled([Va(),fl(),nn()])}catch(C){const O=C instanceof qa?he(C.details,"replacement_task_id"):"";O?(Na.value=O,ka.value=`${(r==null?void 0:r.title)??"队列操作"}失败:${Ie(C)};失败的替代任务 ${rn(O)} 已保留。`,await Promise.allSettled([Va(),fl(),nn()])):ka.value=`${(r==null?void 0:r.title)??"队列操作"}失败:${Ie(C)}`}finally{En.value=""}}function mi(e,a){const r=Number(e.total),s=Array.isArray(e.errors)?e.errors.length:0,c=Number.isFinite(r)?r:0,f=ta(e.remaining_by_status)?e.remaining_by_status:void 0,b=f?Object.values(f).reduce((V,ce)=>{const pe=Number(ce);return V+(Number.isFinite(pe)?pe:0)},0):0,C=s?`,${s} 条处理失败`:"",O=b>0?`;仍有 ${b} 条,可继续清理`:"";return`${a} ${c} 条${C}${O}。`}function Sp(e){return{all:"全部",completed:"完成",failed:"失败",warning:"警告",system:"系统"}[e]}function Rr(e){return{done:"已完成",running:"生成中",waiting:"待开始",review:"待审核"}[e]}function $n(e,a,r,s){const c=r.trim();return{key:e,label:a,value:c||"待补充",hint:s,status:c&&c!=="-"&&c!=="待补充"?"ready":"pending"}}function ph(){var a,r;const e=au.value;return{id:"brief-import",step:"01",title:"导入粗略人设",detail:"选择已落库角色卡作为角色工作流输入。",status:e?"done":"waiting",badge:"Profile",model:"Backend profile",duration:e?"已导入":"待开始",imageId:"",prompt:et.value.basePrompt,phase:"输入",progress:e?100:0,queue:((a=Ee.value)==null?void 0:a.profileId)??"-",attempt:e?"1 / 1":"0 / 1",eta:e?"已完成":"待开始",input:((r=Ee.value)==null?void 0:r.name)??"-",result:e?"角色人设已导入,设定拆解节点已解锁":"等待导入当前角色人设",dependsOn:"无",outputCount:"1 张角色卡"}}function mh(e,a){var r;return{id:e.id,step:String(a+2).padStart(2,"0"),title:e.title,detail:e.detail,status:"waiting",badge:e.badge,model:"等待工作流创建",duration:"待解锁",imageId:"",prompt:e.detail,phase:e.phase,progress:0,queue:"尚未入队",attempt:"0 / 1",eta:"待解锁",input:"等待上一节点完成",result:"节点尚未解锁",dependsOn:a===0?"01 导入粗略人设":((r=Am[a-1])==null?void 0:r.title)??"上一节点",outputCount:"等待产物",round:e.canonicalNodeKey}}function gh(e,a){var b,C;const r=jt.value[e.node_id]??[],c=(e.selected_image_id?r.find(O=>O.image_id===e.selected_image_id):null)??r[0],f=e.metadata??{};return{id:pl(e),step:String(a+2).padStart(2,"0"),title:Mu(e),detail:e.description||Ip(e),status:Pp(e.status,e),badge:_h(e),model:e.model_route||((b=ni.value)==null?void 0:b.label)||"Backend workflow",duration:he(f,"duration")||(e.status==="completed"?"已完成":"待运行"),imageId:(c==null?void 0:c.image_id)??"",imageIds:r.map(O=>O.image_id),prompt:e.prompt||Ip(e),phase:e.step_name||e.node_key,progress:bh(e.status),queue:he(f,"last_task_id")||he(f,"queue")||"-",attempt:he(f,"attempt")||"-",eta:e.status==="running"||e.status==="queued"?"运行中":e.status==="completed"?"已完成":"待开始",input:he(f,"input")||((C=Ee.value)==null?void 0:C.name)||"-",result:he(f,"result")||(r.length?`${r.length} 张候选图`:Rr(Pp(e.status,e))),dependsOn:he(f,"depends_on")||"-",outputCount:r.length?`${r.length} 张`:"等待产物",round:e.step_name||e.node_key,lockedItems:he(f,"locked_items")||"-",decision:he(f,"decision")||"-"}}function pl(e){return zc(e.node_key)??`backend-${e.node_key||e.node_id}`}function yh(e){const a=no.value.find(s=>s.id===e);if(a)return a.title;const r=oi.value.find(s=>s.id===e);return r?r.title:e}function Mu(e){const a={profile_brief:"LLM 拆解设定",prompt_plan:"提示词规划",material_bind:"参考素材绑定",headshot:"头像草稿",upper_body:"半身草稿",lower_body:"下半身草稿",full_body:"全身设定",turnaround:"表情与转面设定图",design_sheet:"姿势与细节设定图",style_lock:"高清修复与统一风格",profile_card:"入库",fast_profile:"LLM 拆解设定",fast_candidates:"快速候选图",fast_final:"最终角色图"},r=lr(e.node_key);return a[r]||a[e.node_key]||e.title}function Ip(e){return e.description||e.node_key.replace(/_/g," ")}function _h(e){const a=lr(e.node_key);return a.includes("profile")||a.includes("brief")?a==="profile_card"?"Archive":"LLM":a.includes("final")||a.includes("pack")?"Archive":e.node_type==="generation"?"Image":e.node_type}function Pp(e,a){const r=Ge(e);return r==="selected"||r==="skipped"?"done":r==="completed"?a&&a.node_type==="generation"&&lr(a.node_key)!=="profile_card"?"review":"done":r==="running"||r==="queued"?"running":r==="failed"?"review":"waiting"}function bh(e){const a=Ge(e);return a==="completed"||a==="selected"?100:a==="running"?68:a==="queued"?18:0}function wh(e){return e&&(e.id.includes("portrait")||e.id.includes("body")||e.id.includes("sheet"))?4:1}function xp(e){return e?e.id.includes("fullbody")||e.id.includes("body")?"3:4":e.id.includes("sheet")?"4:3":"1:1":"1:1"}function Jo(e){return sn(e,a=>a.image_id)}function hh(e){return sn(e,a=>a.profileId||a.id)}function kh(e){return e.some(a=>a.status==="running")?"running":e.some(a=>a.status==="review")?"review":e.length&&e.every(a=>a.status==="done")?"done":"waiting"}function $h(e){if(!e.length)return 0;const a=e.reduce((r,s)=>r+(s.progress??0),0);return Math.round(a/e.length)}function Ap(e){const a=no.value,r=a.findIndex(s=>s.id===e);if(!(r<=0))return a.slice(0,r).find(s=>!Ch(s))}function Ch(e){var f,b,C,O;if(e.id==="brief-import")return au.value;const a=xl.value.find(V=>pl(V)===e.id);if(!a)return!1;const r=Ge(a.status);if(r==="selected"||r==="skipped"||r==="completed"&&(a.node_type==="planning"||a.node_type==="reference_binding"||lr(a.node_key)==="profile_card"))return!0;const s=(b=(f=sa.value)==null?void 0:f.metadata)==null?void 0:b.character_execution;return ta(s)&&s.progression_version!==r3?a.node_key==="prompt_plan"?((C=a.metadata)==null?void 0:C.prompt_plan)!=null:a.node_key==="material_bind"?((O=a.metadata)==null?void 0:O.material_bindings)!=null:!1:!1}function so(e){return!!Ap(e)}function Sh(e){return!!(e.nodes.length&&e.nodes.every(a=>so(a.id)))}function Ih(e,a,r){return a}function Xo(e){return Mp(e).summary}function Ph(e){return`${e.model_route||"未指定模型"} · ${Ep(e.task_type)} · ${rn(e.task_id)}`}function Mp(e){var Fe,oa,Aa,qn;const a=(Fe=e.request)==null?void 0:Fe.metadata,r=ta(a)?a:void 0,s=he(e.metadata,"task_summary")||he(r,"task_summary"),c=e.profile_id||he(r,"profile_id")||he(e.metadata,"profile_id"),f=e.workflow_id||he(r,"workflow_id"),b=e.node_id||he(r,"node_id"),C=c?oy.value.get(c):void 0,O=c?ia.value.find(Ma=>Ma.profileId===c):void 0,V=f?ry.value.get(f):void 0,ce=b?iy.value.get(b):void 0,pe=((oa=C==null?void 0:C.metadata)==null?void 0:oa.system_key)===ds,Ve=he(e.metadata,"profile_name")||he(r,"profile_name"),Oe=pe?"":Ve||(C==null?void 0:C.name)||(O==null?void 0:O.name)||"",Xe=Ah(e,r,ce),ke=he(r,"ui_node_id"),Ze=he(r,"source")||he(e.metadata,"source"),At=he(e.metadata,"workflow_type")||he(r,"workflow_type")||(V==null?void 0:V.workflow_type)||"",la=he(e.metadata,"node_key")||he(r,"node_key"),za=he(e.metadata,"node_title")||he(r,"node_title");let bt=Ep(e.task_type);Xe||At===Fn||(Aa=e.idempotency_key)!=null&&Aa.startsWith("web-quick-")?bt="快速角色":At===Cn||ke||Ze==="standalone_web_workflow"?bt="角色工作流":(At==="single_image"||pe||(qn=e.idempotency_key)!=null&&qn.startsWith("web-single-"))&&(bt="单图生成");const Ha=Xe?Mh(Xe):za?xh(za):ce?Mu(ce):ke?Rp(ke):la?Rp(la):bt==="单图生成"?"图片生成":"",xa=he(e.metadata,"workflow_name")||he(r,"workflow_name")||(V==null?void 0:V.display_name)||(f?`${bt}工作流`:""),da=[bt];Oe&&da.push(Oe),Ha&&!(bt==="单图生成"&&Ha==="图片生成")&&da.push(Ha);const x=he(e.metadata,"title");return da.length===1&&x&&da.push(x),da.length===1&&xa&&xa!==`${bt}工作流`&&da.push(xa),{category:bt,profileName:Oe,workflowName:xa,nodeName:Ha,summary:s||da.join(" / ")||`任务 ${rn(e.task_id)}`}}function xh(e){return e.replace(/^快速(?=头像|半身像|立绘|设定图)/,"")}function Ah(e,a,r){var b;const c=[he(a,"quick_character_target"),he(e.metadata,"quick_character_target"),he(r==null?void 0:r.metadata,"quick_character_target"),(r==null?void 0:r.node_key)||""].find(C=>cl.some(O=>O.nodeKey===C));if(c)return c;const f=e.idempotency_key||"";return((b=cl.find(C=>f.endsWith(`-${C.nodeKey}`)))==null?void 0:b.nodeKey)||""}function Mh(e){return{quick_avatar:"头像",quick_bust:"半身像",quick_stand:"立绘",quick_sheet:"设定图"}[e]||e.replace(/^quick_/,"").replace(/_/g," ")}function Rp(e){return{"brief-import":"导入粗略人设","persona-split":"LLM 拆解设定","prompt-plan":"提示词规划","material-bind":"素材绑定","portrait-01":"头像草稿 01","portrait-02":"头像草稿 02","portrait-03":"头像草稿 03","portrait-04":"头像定稿","body-sheet":"全身设定","expression-sheet":"表情设定图","pose-sheet":"姿势设定图","hires-fix":"高清修复",archive:"角色入库"}[e]||e.replace(/^backend-/,"").replace(/[-_]/g," ")}function Ep(e){return{generation:"图片生成",image_generation:"图片生成",prompt_expansion:"提示词扩写",material_recognition:"素材识别"}[Ge(e)]||e||"后台任务"}function os(e){const a=Rh(e)?e:null,r=a==null?void 0:a.width,s=a==null?void 0:a.height,c=r&&s?`${r}x${s}`:"-",f=(a==null?void 0:a.model_route)||(a==null?void 0:a.model_used)||"后端返回",b=(a==null?void 0:a.positive_prompt)||"后端最近图片,等待补充原始提示词",C=a!=null&&a.is_archived?"已归档":"已生成";return{...e,title:Ga(e),prompt:b,model:f,size:c,seed:a!=null&&a.seed?String(a.seed):rn(e.image_id),duration:"-",status:C,source:a!=null&&a.task_id?`任务 ${rn(a.task_id)}`:"图库最近图片"}}function Rh(e){return"positive_prompt"in e||"is_archived"in e}function uo(e,a,r,s,c=[4,3]){const[f,b,C]=s,O=String(e).padStart(2,"0"),V=Np(a),ce=Np(r.length>34?`${r.slice(0,34)}...`:r),[pe,Ve]=c,Oe=pe>0&&Ve>0?pe/Ve:4/3,Xe=Oe>=1?1200:Math.round(1200*Oe),ke=Oe>=1?Math.round(1200/Oe):1200,Ze=Math.min(Xe,ke),At=Math.round(Ze*.08),la=Math.round(At*1.38),za=Math.round(Ze*.045),bt=Math.max(42,Math.round(Ze*.065)),Ha=Math.round(ke-At*1.55),xa=Math.min(ke-At*.75,Ha+Math.round(Ze*.07)),da=Math.round(At+Ze*.075),x=Math.max(42,Math.round(Ze*.078)),Fe=Math.max(20,Math.round(Ze*.034)),oa=Math.max(22,Math.round(Ze*.035)),Aa=Math.max(74,Math.round(Ze*.13)),qn=Xe-At*2,Ma=ke-At*2,ln=Xe-la*2,Dn=ke-la*2,Tl=Math.round(Xe*.72),Zo=Math.round(ke*.22),Bl=Math.round(Ze*.46),er=Math.round(Xe*.22),Ll=Math.round(ke*.69),k=Math.round(Ze*.24),be=Math.round(Xe-At*1.4),_e=`${pe}:${Ve}`,gt=`
|
||
<svg xmlns="http://www.w3.org/2000/svg" width="${Xe}" height="${ke}" viewBox="0 0 ${Xe} ${ke}" preserveAspectRatio="xMidYMid meet">
|
||
<defs>
|
||
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
|
||
<stop offset="0%" stop-color="${f}" />
|
||
<stop offset="58%" stop-color="${b}" />
|
||
<stop offset="100%" stop-color="#111827" />
|
||
</linearGradient>
|
||
<radialGradient id="halo" cx="72%" cy="22%" r="55%">
|
||
<stop offset="0%" stop-color="${C}" stop-opacity="0.82" />
|
||
<stop offset="100%" stop-color="${C}" stop-opacity="0" />
|
||
</radialGradient>
|
||
<pattern id="grid" width="${bt}" height="${bt}" patternUnits="userSpaceOnUse">
|
||
<path d="M${bt} 0H0V${bt}" fill="none" stroke="#ffffff" stroke-opacity="0.13" stroke-width="2" />
|
||
</pattern>
|
||
</defs>
|
||
<rect width="${Xe}" height="${ke}" fill="url(#bg)" />
|
||
<rect width="${Xe}" height="${ke}" fill="url(#grid)" />
|
||
<circle cx="${Tl}" cy="${Zo}" r="${Bl}" fill="url(#halo)" />
|
||
<circle cx="${er}" cy="${Ll}" r="${k}" fill="#ffffff" opacity="0.11" />
|
||
<rect x="${At}" y="${At}" width="${qn}" height="${Ma}" rx="${za}" fill="#ffffff" opacity="0.14" />
|
||
<rect x="${la}" y="${la}" width="${ln}" height="${Dn}" rx="${Math.round(za*.72)}" fill="#0f172a" opacity="0.24" />
|
||
<text x="${la+Math.round(Ze*.035)}" y="${da}" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${oa}" font-weight="700">IMAGESTUDIO · 未生成 ${O}</text>
|
||
<text x="${la+Math.round(Ze*.035)}" y="${Ha}" fill="#ffffff" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${x}" font-weight="800">${V}</text>
|
||
<text x="${la+Math.round(Ze*.035)}" y="${xa}" fill="#ffffff" opacity="0.78" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Fe}">${ce}</text>
|
||
<text x="${be}" y="${da+Math.round(Ze*.02)}" text-anchor="middle" fill="#ffffff" opacity="0.86" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Aa}" font-weight="900">${O}</text>
|
||
<text x="${Xe-At}" y="${ke-Math.round(At*.35)}" text-anchor="end" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Math.max(18,Math.round(Ze*.027))}" font-weight="800">${_e}</text>
|
||
</svg>`;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(gt)}`}function Np(e){return e.replace(/[&<>"']/g,a=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[a]??a)}function Ga(e){return"title"in e&&e.title?e.title:e.node_id||e.workflow_id||e.profile_id||rn(e.image_id)}function Ca(e){return Ln(e.thumbnail_url)||Ln(e.image_url)}function Ln(e){const a=String(e||"").trim();if(!a)return"";const r=Eh(a);if(!r)return a;const s=ut.value[a];if(s)return s;if(!Pt.has(a)){const c=Nh(a,r).finally(()=>{Pt.delete(a)});Pt.set(a,c)}return Du()==="plugin-bridge"?"":a}function Eh(e){var a;try{const r=new URL(e,window.location.origin);return r.pathname.endsWith("/media/fetch")&&((a=r.searchParams.get("token"))==null?void 0:a.trim())||""}catch{return""}}async function Nh(e,a){try{const r=await Pe(N.mediaPayload,{token:a}),s=String(r.body_base64||"");if(!s)return;const c=s.replace(/-/g,"+").replace(/_/g,"/"),f=c.padEnd(Math.ceil(c.length/4)*4,"="),b=window.atob(f),C=new Uint8Array(b.length);for(let V=0;V<b.length;V+=1)C[V]=b.charCodeAt(V);const O=URL.createObjectURL(new Blob([C],{type:r.content_type||"application/octet-stream"}));Dt.add(O),ut.value={...ut.value,[e]:O}}catch(r){console.warn("ImageStudio media bridge failed",r)}}function Th(e){if(e.status==="confirmed_unsupported")return!1;if(e.dialect==="openai_images"||e.dialect==="comfyui")return!0;const a=e.capabilities||{};return!!(a.text_to_image||a.image_generation||a.workflow_graph||Object.keys(a).some(r=>["text_to_image","image_generation","workflow_graph"].includes(r)))}function Bh(e,a,r){return Math.max(a,Math.min(r,e))}function Lh(){try{const e=localStorage.getItem(Tn.theme);(e==="light"||e==="dark")&&(Sl.value=e),Ao.value=localStorage.getItem(Tn.primary)||Ao.value,Mo.value=localStorage.getItem(Tn.accent)||Mo.value;const a=localStorage.getItem(Tn.navigationPinned);dl.value=a===null||a==="true",Rn.value=Tp(localStorage.getItem(Tn.readNotifications)),Zr.value=Tp(localStorage.getItem(Tn.dismissedNotifications))}catch{}Jr.value=dl.value}function qh(){try{localStorage.setItem(Tn.theme,Sl.value),localStorage.setItem(Tn.primary,Ao.value),localStorage.setItem(Tn.accent,Mo.value),localStorage.setItem(Tn.navigationPinned,String(dl.value)),localStorage.setItem(Tn.readNotifications,JSON.stringify(Rn.value)),localStorage.setItem(Tn.dismissedNotifications,JSON.stringify(Zr.value))}catch{}}function Tp(e){if(!e)return[];try{const a=JSON.parse(e);return Array.isArray(a)?a.filter(r=>typeof r=="string"):[]}catch{return[]}}function co(e,a){const r=xc(e);return r?`rgba(${r.r}, ${r.g}, ${r.b}, ${a})`:`rgba(118, 104, 232, ${a})`}function Ic(e,a,r){const s=xc(e),c=xc(a);if(!s||!c)return e;const f=Math.min(1,Math.max(0,r));return`#${Pc(s.r*(1-f)+c.r*f)}${Pc(s.g*(1-f)+c.g*f)}${Pc(s.b*(1-f)+c.b*f)}`}function Pc(e){return Math.round(e).toString(16).padStart(2,"0")}function xc(e){const a=e.replace("#","");return/^[0-9a-fA-F]{6}$/.test(a)?{r:Number.parseInt(a.slice(0,2),16),g:Number.parseInt(a.slice(2,4),16),b:Number.parseInt(a.slice(4,6),16)}:null}function he(e,a){const r=e==null?void 0:e[a];return typeof r=="string"?r:""}function Dh(e){return!ta(e)||typeof e.task_id!="string"?null:{task_id:e.task_id,task_type:typeof e.task_type=="string"?e.task_type:"generation",status:typeof e.status=="string"?e.status:"created",progress:typeof e.progress=="number"?e.progress:0,created_at:typeof e.created_at=="string"?e.created_at:"",updated_at:typeof e.updated_at=="string"?e.updated_at:"",profile_id:typeof e.profile_id=="string"?e.profile_id:null,workflow_id:typeof e.workflow_id=="string"?e.workflow_id:null,node_id:typeof e.node_id=="string"?e.node_id:null,model_route:typeof e.model_route=="string"?e.model_route:null,idempotency_key:typeof e.idempotency_key=="string"?e.idempotency_key:null,request:ta(e.request)?e.request:void 0,result:ta(e.result)?e.result:void 0,metadata:ta(e.metadata)?e.metadata:void 0,error_message:typeof e.error_message=="string"?e.error_message:null}}function Oh(e){return!!e}function ta(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function Wh(e){return sn(e,a=>a.id)}function Ie(e){return mv(e)}return(e,a)=>{var r,s,c,f,b,C,O,V,ce,pe,Ve,Oe,Xe,ke,Ze,At,la,za,bt,Ha,xa,da;return m(),y("main",{class:fe(["navigation-shell",{"rail-collapsed":!Jr.value}]),"aria-label":"ImageStudio workbench","data-theme":Sl.value,style:ca(C_.value)},[We(D0,{items:se(PI),"active-key":z.value,"plugin-version":((r=ne.value)==null?void 0:r.plugin_version)??"v3",expanded:Jr.value,pinned:dl.value,onSelect:eb,onReveal:tc,onScheduleHide:a[0]||(a[0]=x=>cu()),onTogglePinned:nb},null,8,["items","active-key","plugin-version","expanded","pinned"]),l("section",FI,[l("header",jI,[l("div",KI,[l("span",null,p(ny.value.label),1),l("h1",null,p(((s=ne.value)==null?void 0:s.display_name)??"ImageStudio 星图导航"),1)]),l("div",VI,[a[95]||(a[95]=l("span",{"aria-hidden":"true"},"⌕",-1)),xe(l("input",{ref_key:"searchInputRef",ref:Ef,"aria-label":"Search ImageStudio","onUpdate:modelValue":a[1]||(a[1]=x=>Ws.value=x),type:"search",role:"combobox","aria-autocomplete":"list","aria-controls":"global-search-results","aria-expanded":sv.value,"aria-activedescendant":Ir.value.length?`global-search-option-${Mn.value}`:void 0,placeholder:"搜索生成、队列、图库、设置(Ctrl K)",onFocus:tp,onInput:a[2]||(a[2]=x=>{Yr.value=!0,Mn.value=0}),onKeydown:[a[3]||(a[3]=Qt(ze(x=>ap(1),["prevent"]),["down"])),a[4]||(a[4]=Qt(ze(x=>ap(-1),["prevent"]),["up"])),Qt(ze(pw,["prevent"]),["enter"]),a[5]||(a[5]=Qt(x=>ea("search"),["escape"]))]},null,40,GI),[[je,Ws.value]]),sv.value?(m(),y("div",zI,[(m(!0),y(Q,null,re(Ir.value,(x,Fe)=>(m(),y("button",{key:x.title,id:`global-search-option-${Fe}`,type:"button",role:"option",class:fe({active:Mn.value===Fe}),"aria-selected":Mn.value===Fe,onMouseenter:oa=>Mn.value=Fe,onMousedown:ze(oa=>Cv(x),["prevent"])},[l("strong",null,p(x.title),1),l("small",null,p(x.description),1)],42,HI))),128)),Ir.value.length?H("",!0):(m(),y("p",QI,"没有匹配结果"))])):H("",!0)]),l("div",YI,[l("button",{type:"button",class:"theme-switch",role:"switch","aria-checked":Sl.value==="dark",title:Sl.value==="dark"?"切换日间":"切换夜间",onClick:ob},[l("span",{class:fe({active:Sl.value==="light"}),"aria-label":"日间"},[...a[96]||(a[96]=[l("i",{class:"ui-icon icon-sun","aria-hidden":"true"},null,-1)])],2),l("span",{class:fe({active:Sl.value==="dark"}),"aria-label":"夜间"},[...a[97]||(a[97]=[l("i",{class:"ui-icon icon-moon","aria-hidden":"true"},null,-1)])],2)],8,JI),l("div",XI,[l("button",{type:"button",class:"icon-button",title:"通知","aria-expanded":Fs.value,"aria-controls":"notification-panel",onClick:a[6]||(a[6]=x=>Sc("notifications"))},[a[98]||(a[98]=l("span",{class:"ui-icon icon-bell","aria-hidden":"true"},null,-1)),zd.value?(m(),y("b",eP,p(zd.value),1)):H("",!0)],8,ZI),l("div",tP,[a[99]||(a[99]=l("strong",null,"通知概览",-1)),l("ul",null,[(m(!0),y(Q,null,re(dv.value,(x,Fe)=>(m(),y("li",{key:x.id,style:ca({"--card-index":Fe})},[l("span",{class:fe(["dot",x.type])},null,2),l("span",null,p(x.title),1)],4))),128)),dv.value.length?H("",!0):(m(),y("li",aP,"暂无通知"))])])]),l("button",{type:"button",class:"icon-button",title:"调色盘","data-overlay-root":"palette","aria-expanded":Us.value,"aria-controls":"palette-panel",onClick:a[7]||(a[7]=x=>Sc("palette"))},[...a[100]||(a[100]=[l("span",{class:"ui-icon icon-palette","aria-hidden":"true"},null,-1)])],8,nP),l("div",lP,[l("button",{type:"button",class:"icon-button",title:"日志","aria-expanded":js.value,"aria-controls":"log-popover",onClick:a[8]||(a[8]=x=>Sc("logs"))},[...a[101]||(a[101]=[l("span",{class:"ui-icon icon-file","aria-hidden":"true"},null,-1)])],8,oP),We(Ya,{name:"overlay-pop"},{default:ra(()=>[js.value?(m(),y("div",rP,[l("header",null,[l("div",null,[a[102]||(a[102]=l("span",null,"日志",-1)),l("strong",null,p(No.value?"需要重试":`${Ye.value.length+it.value.length} 条`),1)]),l("button",{type:"button",onClick:nn},"刷新")]),No.value?(m(),Ct(Br,{key:0,tone:"bad",title:"日志加载失败",detail:No.value},null,8,["detail"])):(m(),Ct(Bu,{key:1,tag:"ul",name:"card-list",class:"log-list"},{default:ra(()=>[(m(!0),y(Q,null,re(it.value.slice(0,4),(x,Fe)=>(m(),y("li",{key:`${x.source}-${x.id}`,style:ca({"--card-index":Fe})},[a[103]||(a[103]=l("span",{class:"dot failed"},null,-1)),l("span",null,p(x.error_message||x.source),1)],4))),128)),(m(!0),y(Q,null,re(Ye.value.slice(0,Math.max(0,4-it.value.length)),(x,Fe)=>(m(),y("li",{key:x.task_id,style:ca({"--card-index":Fe})},[a[104]||(a[104]=l("span",{class:"dot completed"},null,-1)),l("span",null,p(x.task_id)+" / "+p(se(Dl)(x.status)),1)],4))),128)),!it.value.length&&!Ye.value.length?(m(),y("li",iP,"暂无日志")):H("",!0)]),_:1}))])):H("",!0)]),_:1})]),l("div",{class:fe(["backend-status-chip",Bf.value]),title:oe.value.detail,"aria-live":"polite"},[a[105]||(a[105]=l("span",{"aria-hidden":"true"},null,-1)),l("strong",null,p(oe.value.label),1)],10,sP),l("button",{type:"button",class:"refresh-button",disabled:Tf.value,onClick:Zi},p(Tf.value?"同步中":"刷新"),9,uP)])]),ty.value?(m(),y("div",{key:0,class:fe(["backend-connection-banner",Bf.value]),role:"status","aria-live":"polite"},[l("div",null,[l("strong",null,p(oe.value.title),1),l("span",null,p(oe.value.detail),1)]),l("button",{type:"button",onClick:Zi},"重新检测")],2)):H("",!0),We(Ya,{name:"panel-drop"},{default:ra(()=>[Us.value?(m(),y("section",dP,[l("div",null,[(m(),y(Q,null,re(De,x=>l("button",{key:x.name,type:"button",onClick:Fe=>Jw(x)},[l("span",{class:"swatch",style:ca({background:x.primary})},null,4),l("span",{class:"swatch",style:ca({background:x.accent})},null,4),Kn(" "+p(x.name),1)],8,cP)),64))]),l("label",null,[a[106]||(a[106]=l("span",null,"主色",-1)),xe(l("input",{"onUpdate:modelValue":a[9]||(a[9]=x=>Ao.value=x),type:"color"},null,512),[[je,Ao.value]])]),l("label",null,[a[107]||(a[107]=l("span",null,"副色",-1)),xe(l("input",{"onUpdate:modelValue":a[10]||(a[10]=x=>Mo.value=x),type:"color"},null,512),[[je,Mo.value]])])])):H("",!0)]),_:1}),We(Ya,{name:"panel-drop"},{default:ra(()=>[Fs.value?(m(),y("section",fP,[l("header",null,[l("div",null,[a[108]||(a[108]=l("span",null,"消息中心",-1)),l("h2",null,p(zd.value)+" 条未读",1)]),l("div",{class:"inline-actions"},[l("button",{type:"button",onClick:Zw},"全部已读"),l("button",{type:"button",onClick:eh},"清空已读")])]),l("div",vP,[(m(),y(Q,null,re(["all","completed","failed","warning","system"],x=>l("button",{key:x,type:"button",class:fe({active:ji.value===x}),"aria-pressed":ji.value===x,onClick:Fe=>ji.value=x},p(Sp(x)),11,pP)),64))]),We(Bu,{tag:"ul",name:"card-list",class:"notification-list"},{default:ra(()=>[(m(!0),y(Q,null,re(uv.value,(x,Fe)=>(m(),y("li",{key:x.id,class:fe({unread:!Rn.value.includes(x.id)}),style:ca({"--card-index":Fe})},[l("div",{class:fe(["notification-thumb",x.type])},[x.thumbnailUrl?(m(),y("img",{key:0,src:x.thumbnailUrl,alt:""},null,8,mP)):(m(),y("span",gP,p(Sp(x.type).slice(0,1)),1))],2),l("div",null,[l("strong",null,p(x.title),1),l("small",null,p(x.detail),1),l("time",null,p(se(po)(x.createdAt)),1)]),l("button",{type:"button",onClick:oa=>Xw(x.id)},p(Rn.value.includes(x.id)?"已读":"标记"),9,yP)],6))),128)),uv.value.length?H("",!0):(m(),y("li",_P,"暂无通知"))]),_:1})])):H("",!0)]),_:1}),z.value==="generate"?(m(),y("section",bP,[l("header",wP,[l("div",null,[a[109]||(a[109]=l("span",null,"生成工作台",-1)),l("h2",null,p(cv.value.label),1),l("p",null,p(cv.value.detail),1)]),l("div",hP,[(m(),y(Q,null,re(K,x=>l("button",{key:x.key,type:"button",class:fe(["generate-mode-button",{active:U.value===x.key}]),"aria-pressed":U.value===x.key,onClick:Fe=>Pb(x.key)},p(x.label),11,kP)),64))])]),We(Ya,{name:"panel-drop",mode:"out-in"},{default:ra(()=>{var x,Fe,oa,Aa,qn,Ma,ln,Dn,Tl,Zo,Bl,er,Ll;return[(m(),y("section",{key:U.value,class:"generate-mode-page"},[U.value==="image"?(m(),y("section",$P,[l("section",CP,[l("aside",SP,[l("header",null,[l("div",null,[a[110]||(a[110]=l("span",null,"生成预览",-1)),l("h2",null,p(hr.value.length)+" 张",1)])]),hr.value.length?(m(),y("div",IP,[(m(!0),y(Q,null,re(hr.value,k=>{var be;return m(),y("button",{key:k.image_id,type:"button",class:fe(["image-preview-card",{active:((be=Pa.value)==null?void 0:be.image_id)===k.image_id}]),onClick:_e=>Z.value=k.image_id},[l("span",xP,[Ca(k)?(m(),y("img",{key:0,src:Ca(k),alt:Ga(k)},null,8,AP)):(m(),y("span",MP,"IMG"))]),l("span",null,[l("strong",null,p(Ga(k)),1),l("small",null,p(k.model)+" / "+p(se(po)(k.created_at)),1)])],10,PP)}),128))])):(m(),y("div",RP,[...a[111]||(a[111]=[l("strong",null,"暂无生成预览",-1),l("span",null,"通过自然语言发起生成后,结果会进入这里。",-1)])]))]),l("section",EP,[l("div",NP,[Pa.value&&Ca(Pa.value)?(m(),y("button",{key:0,type:"button",class:"image-stage-button",title:`打开 ${Ga(Pa.value)}`,onClick:Yv},[l("img",{src:Ca(Pa.value),alt:Ga(Pa.value)},null,8,BP)],8,TP)):(m(),y("div",LP,[...a[112]||(a[112]=[l("strong",null,"等待图片",-1),l("span",null,"左侧选择的结果会在这里放大显示。",-1)])]))]),l("aside",qP,[l("header",null,[a[113]||(a[113]=l("span",null,"图片信息",-1)),l("strong",null,p(Pa.value?Ga(Pa.value):"未选择"),1)]),l("dl",null,[(m(!0),y(Q,null,re(sy.value,k=>(m(),y("div",{key:k.label},[l("dt",null,p(k.label),1),l("dd",null,p(k.value),1)]))),128))])])])]),l("form",{class:"image-chat-panel",onSubmit:ze(uc,["prevent"])},[l("div",DP,[a[114]||(a[114]=l("strong",null,"对话框",-1)),l("small",null,p(ee.value==="direct"?"原文会直接发送给生图模型,不经过 LLM 改写。":"先由设置中选定的文本 LLM 扩写,再发送给生图模型。"),1),l("div",OP,[l("button",{type:"button",class:fe({active:ee.value==="direct"}),"aria-pressed":ee.value==="direct",onClick:a[11]||(a[11]=k=>ee.value="direct")},"直接发送",10,WP),l("button",{type:"button",class:fe({active:ee.value==="llm"}),"aria-pressed":ee.value==="llm",onClick:a[12]||(a[12]=k=>ee.value="llm")},"LLM 扩写",10,UP)])]),l("div",FP,[l("div",jP,[xe(l("textarea",{"onUpdate:modelValue":a[13]||(a[13]=k=>Ce.value=k),rows:"3","aria-label":"描述想生成的图片",onKeydown:[Qt(ze(uc,["ctrl","prevent"]),["enter"]),Qt(ze(uc,["meta","prevent"]),["enter"])]},null,40,KP),[[je,Ce.value]]),Ce.value.trim()?H("",!0):(m(),y("div",VP,[a[116]||(a[116]=l("p",null,[l("strong",null,"例如:"),l("span",null,"生成一张雨夜霓虹街头的半身角色图,黑色短发,电影感,高细节。")],-1)),l("p",null,[a[115]||(a[115]=l("strong",null,"最近请求:",-1)),l("span",GP,p(Be.value?`${Be.value} / ${Qe.value||"未选择模型"}`:"暂无"),1)])]))]),l("div",zP,[l("div",HP,[l("button",{type:"button",class:"composer-icon-button",disabled:!Ce.value.trim()||Se.value,title:"扩写提示词","aria-label":"扩写提示词",onClick:F_},[...a[117]||(a[117]=[l("span",{"aria-hidden":"true"},"✨",-1)])],8,QP),l("button",{type:"button",class:"composer-icon-button",title:"打开模型设置","aria-label":"打开模型设置",onClick:a[14]||(a[14]=k=>Zt("settings","settings"))},[...a[118]||(a[118]=[l("span",{"aria-hidden":"true"},"◌",-1)])]),l("label",YP,[a[119]||(a[119]=l("span",{"aria-hidden":"true"},"⚡",-1)),xe(l("select",{"onUpdate:modelValue":a[15]||(a[15]=k=>Wt.value=k),disabled:!qo.value.length},[(m(!0),y(Q,null,re(qo.value,k=>(m(),y("option",{key:k.value,value:k.value},p(k.provider)+" / "+p(k.label),9,XP))),128))],8,JP),[[Xa,Wt.value]])]),Ot.value?(m(),y("span",ZP,"生成中")):Ea.value?(m(),y("span",ex,p(Ea.value),1)):xd.value?(m(),y("button",{key:2,type:"button",class:"model-state model-state-link",onClick:a[16]||(a[16]=k=>Zt("settings","settings"))},p(xd.value),1)):H("",!0)]),l("div",tx,[a[120]||(a[120]=l("span",{class:"composer-shortcut",title:"提交快捷键"},"Ctrl ↵",-1)),l("button",{type:"submit",class:"composer-send-button",title:ee.value==="direct"?"直接发送给生图模型":"交给 LLM 扩写并生成",disabled:!Ce.value.trim()||Ot.value||!ni.value},p(Ot.value?"...":"↑"),9,ax)])])])],32)])):U.value==="quickProfile"?(m(),y("section",nx,[l("section",lx,[l("aside",ox,[l("header",rx,[a[121]||(a[121]=l("div",null,[l("span",null,"全部角色档案")],-1)),l("em",null,p(Ee.value.status),1)]),l("div",ix,[l("button",{type:"button",class:"quick-profile-library-add-card",onClick:pi},[...a[122]||(a[122]=[l("span",{class:"quick-profile-library-add-icon"},"+",-1),l("span",{class:"quick-profile-library-copy"},[l("strong",null,"添加档案"),l("small",null,"新建角色卡"),l("em",null,"填写问卷后加入档案列表")],-1)])]),(m(!0),y(Q,null,re(Uo.value,(k,be)=>(m(),y("button",{key:k.id,type:"button","data-profile-card-id":k.id,class:fe({active:Os.value===k.id}),onClick:_e=>yu(k)},[l("span",ux,[l("img",{src:uo(be+41,k.name,k.identity,k.colors),alt:k.name},null,8,dx)]),l("span",cx,[l("strong",null,p(k.name),1),l("small",null,p(k.identity),1),l("em",null,p(k.personality),1)]),l("span",fx,p(k.updatedAt),1)],10,sx))),128))])]),l("article",vx,[a[128]||(a[128]=l("header",{class:"quick-profile-section-header"},[l("div",null,[l("span",null,"角色预览")]),l("em",null,"只读档案")],-1)),l("button",{type:"button",class:"quick-profile-curl-button",title:"打开角色设定详情","aria-label":"打开角色设定详情",onClick:mw},[...a[123]||(a[123]=[l("span",null,"详情",-1)])]),l("section",px,[l("figure",{class:"quick-profile-profile-portrait",style:ca(zf.value)},[l("button",{type:"button",class:"quick-profile-portrait-button",title:`打开 ${Fo.value.label}`,onClick:a[17]||(a[17]=k=>Zv(Fo.value.id))},[Fo.value.imageUrl?(m(),y("img",{key:0,src:Fo.value.imageUrl,alt:Fo.value.label},null,8,gx)):(m(),y("span",yx,"尚未生成"))],8,mx)],4),l("div",_x,[a[124]||(a[124]=l("span",null,"姓名",-1)),l("strong",null,p(et.value.name),1)]),l("div",bx,[a[125]||(a[125]=l("span",null,"身份",-1)),l("p",null,p(el.value.identity),1)]),l("div",wx,[a[126]||(a[126]=l("span",null,"风格",-1)),l("p",null,p(et.value.stylePrompt||((x=Ad.value)==null?void 0:x.label)),1)]),l("div",hx,[a[127]||(a[127]=l("span",null,"设定简介",-1)),l("p",null,p(et.value.basePrompt),1),l("small",null,p(et.value.appearancePrompt),1)])])]),l("aside",kx,[l("header",$x,[l("div",null,[l("span",null,p($a.value.detail),1),l("strong",null,p($a.value.label),1)]),a[129]||(a[129]=l("em",null,"角色图片",-1))]),l("figure",Cx,[We(Ya,{name:"quick-profile-image-swap"},{default:ra(()=>[(m(),y("button",{key:$a.value.id,type:"button",class:"quick-profile-hero-button",title:`打开 ${$a.value.label}`,onClick:a[18]||(a[18]=k=>Zv())},[$a.value.imageUrl?(m(),y("img",{key:0,src:$a.value.imageUrl,alt:$a.value.label},null,8,Ix)):(m(),y("span",Px,"点击“一键生成”创建角色图片"))],8,Sx))]),_:1})]),l("div",xx,[(m(!0),y(Q,null,re(Cr.value,k=>(m(),y("button",{key:k.id,type:"button",class:fe({active:Zn.value===k.id}),onClick:be=>Ov(k.id)},[l("span",null,[k.imageUrl?(m(),y("img",{key:0,src:k.imageUrl,alt:k.label},null,8,Mx)):(m(),y("span",Rx,"待生成"))]),l("strong",null,p(k.label),1),l("small",null,p(k.detail),1),l("em",null,p(k.state),1)],10,Ax))),128))])]),l("section",Ex,[l("header",Nx,[a[130]||(a[130]=l("div",null,[l("span",null,"参考素材")],-1)),l("em",null,p(dy.value),1)]),l("div",Tx,[(m(),y(Q,null,re(me,(k,be)=>{var _e,gt,on;return l("div",{key:k.id,class:"quick-profile-material-slot"},[l("button",{type:"button","data-overlay-root":"materialPicker","data-material-category":k.category,class:fe(["quick-profile-material-card",{active:!!vl(k.category),expanded:_t.value===k.category}]),"aria-expanded":_t.value===k.category,onClick:Mt=>Av(k.category)},[l("span",{class:fe(["quick-profile-material-media",{empty:!vl(k.category)}])},[vl(k.category)&&di(vl(k.category),be)?(m(),y("img",{key:0,src:di(vl(k.category),be),alt:((_e=vl(k.category))==null?void 0:_e.label)??k.category},null,8,Lx)):(m(),y("span",qx,"无缩略图"))],2),l("span",Dx,[l("small",null,p(k.category),1),l("strong",null,p(((gt=vl(k.category))==null?void 0:gt.label)??"不使用参考"),1),l("em",null,p(((on=vl(k.category))==null?void 0:on.prompt)??"点击选择或添加素材参考"),1)])],10,Bx),We(Ya,{name:"material-picker-pop"},{default:ra(()=>[_t.value===k.category?(m(),y("aside",{key:0,class:fe(["quick-profile-material-picker",{accessory:k.category===Ht,filtered:tu.value}]),"data-overlay-root":"materialPicker"},[l("header",Ox,[l("div",null,[l("span",null,p(k.category)+"参考",1),a[131]||(a[131]=l("strong",null,"选择素材",-1))]),l("small",null,p(Ff.value),1)]),k.category===Ht?(m(),y("div",Wx,[(m(!0),y(Q,null,re(Uf.value,Mt=>(m(),y("button",{key:Mt,type:"button",class:fe({active:tl.value===Mt}),onClick:fo=>xv(Mt)},p(Mt),11,Ux))),128))])):H("",!0),We(Bu,{tag:"div",name:"material-choice-scale",class:fe(["quick-profile-material-picker-list",{accessory:k.category===Ht,filtered:tu.value}])},{default:ra(()=>[l("button",{key:"none",type:"button","data-material-action":"none",class:fe(["quick-profile-material-picker-choice","none",{active:!vl(_t.value)}]),onClick:a[19]||(a[19]=Mt=>Rv(_t.value))},[...a[132]||(a[132]=[l("span",{class:"quick-profile-material-none-icon"},"无",-1),l("span",{class:"quick-profile-material-picker-copy"},[l("strong",null,"不使用"),l("em",null,"取消这个素材参考")],-1)])],2),(m(!0),y(Q,null,re(Ed.value,(Mt,fo)=>(m(),y("button",{key:Mt.id,type:"button","data-material-reference-id":Mt.id,class:fe(["quick-profile-material-picker-choice",{active:Iv(Mt)}]),onClick:Bp=>Mv(Mt)},[l("span",jx,[di(Mt,fo)?(m(),y("img",{key:0,src:di(Mt,fo),alt:Mt.label},null,8,Kx)):(m(),y("span",Vx,"无缩略图"))]),l("span",Gx,[_t.value===Ht?(m(),y("small",zx,p(Pv(Mt)),1)):H("",!0),l("strong",null,p(Mt.label),1),l("em",null,p(Mt.prompt),1)])],10,Fx))),128)),l("button",{key:"add",type:"button","data-material-action":"add",class:"quick-profile-material-picker-choice add",onClick:a[20]||(a[20]=Mt=>Lv(_t.value))},[a[133]||(a[133]=l("span",{class:"quick-profile-material-add-icon"},"+",-1)),l("span",Hx,[l("strong",null,"添加"+p(_t.value)+"素材",1),l("em",null,p(jf.value),1)])])]),_:1},8,["class"])],2)):H("",!0)]),_:2},1024)])}),64))])]),l("section",Qx,[l("header",Yx,[a[134]||(a[134]=l("div",null,[l("span",null,"功能按钮")],-1)),l("em",null,p(Hf.value.length)+" 项",1)]),l("div",Jx,[(m(!0),y(Q,null,re(Hf.value,k=>(m(),y("article",{key:k.id,class:fe(["quick-profile-command-card",k.tone,{disabled:!k.enabled}])},[l("div",Xx,[l("span",Zx,p(Fy(k.badge)),1)]),l("strong",null,p(k.title),1),l("p",null,p(k.detail),1),k.id==="persona"?(m(),y("button",{key:0,type:"button",disabled:!k.enabled,onClick:wb},p(nu(k)),9,eA)):k.id==="workflow"?(m(),y("button",{key:1,type:"button",disabled:!k.enabled,onClick:xb},p(nu(k)),9,tA)):k.nav&&k.module?(m(),y("button",{key:2,type:"button",onClick:be=>Zt(k.nav,k.module)},p(nu(k)),9,aA)):(m(),y("span",nA,p(nu(k)),1))],2))),128))]),en.value?(m(),y("p",lA,p(en.value),1)):H("",!0),An.value?(m(),y("p",oA,p(An.value),1)):H("",!0)])]),We(Ya,{name:"viewer-fade"},{default:ra(()=>[cr.value?(m(),y("div",rA,[l("section",iA,[l("figure",{class:"quick-profile-detail-card-portrait",style:ca(zf.value)},[Fo.value.imageUrl?(m(),y("img",{key:0,src:Fo.value.imageUrl,alt:et.value.name},null,8,sA)):(m(),y("span",uA,"尚未生成角色图片")),l("figcaption",null,[a[135]||(a[135]=l("span",null,"角色设定",-1)),l("strong",null,p(et.value.name),1)])],4),l("aside",dA,[l("header",null,[l("div",null,[l("span",null,p(Ee.value.status),1),l("strong",null,p(et.value.name)+" / 设定详情",1)]),l("button",{type:"button",title:"关闭",onClick:a[21]||(a[21]=k=>ea("quickProfileDetail"))},"×")]),l("dl",null,[(m(!0),y(Q,null,re($y.value,k=>(m(),y("div",{key:k.label},[l("dt",null,p(k.label),1),l("dd",null,p(k.value),1)]))),128))])])])])):H("",!0)]),_:1}),We(Ya,{name:"viewer-fade"},{default:ra(()=>[Ro.value&&Ks.value==="quickProfile"&&$a.value?(m(),y("div",{key:0,class:"image-viewer-backdrop quick-profile-viewer-backdrop",role:"dialog","aria-modal":"true","aria-label":`${$a.value.label} 详情`},[l("section",fA,[l("div",{class:fe(["quick-profile-viewer-media",{dragging:yr.value,zoomed:to.value>1}]),style:ca(Oy.value),onWheel:ze(dw,["prevent"]),onDblclick:cw,onPointerdown:fw,onPointermove:vw,onPointerup:wc,onPointercancel:wc,onPointerleave:wc},[l("div",{class:fe(["quick-profile-viewer-frame",Wy.value]),style:ca({transform:uy.value})},[l("img",{src:$a.value.imageUrl,alt:$a.value.label,draggable:"false"},null,8,vA)],6)],38),l("aside",pA,[l("header",null,[l("div",null,[l("span",null,p($a.value.state),1),l("strong",null,p(et.value.name)+" / "+p($a.value.label),1)]),l("button",{type:"button",title:"关闭",onClick:ep},"关闭")]),l("dl",null,[(m(!0),y(Q,null,re(Uy.value,k=>(m(),y("div",{key:k.label},[l("dt",null,p(k.label),1),l("dd",null,p(k.value),1)]))),128))])])])],8,cA)):H("",!0)]),_:1})])):(m(),y("section",mA,[l("section",gA,[(m(!0),y(Q,null,re(P_.value,k=>(m(),y("article",{key:k.label},[l("span",null,p(k.label),1),l("strong",null,p(k.value),1),l("small",null,p(k.hint),1)]))),128))]),sa.value?(m(),Ct(se(g),{key:0,branches:By.value,"current-branch":sa.value.current_branch||"main","node-labels":Ly.value,loading:L.value===sa.value.workflow_id,"busy-branch":le.value,error:v.value,disabled:!Dy.value,onRefresh:a[22]||(a[22]=k=>ci(sa.value.workflow_id)),onSwitch:Cw},null,8,["branches","current-branch","node-labels","loading","busy-branch","error","disabled"])):H("",!0),ua.value&&Ue.value?(m(),Ct(se(T),{key:1,rounds:Ld.value,"selected-round-id":((Fe=lt.value)==null?void 0:Fe.round.round_id)||"","active-round-id":Zy.value,"requested-count":Qr.value,loading:qi.value===Ue.value.node_id||!!Hr.value,busy:md.value===Ue.value.node_id||Le.value,disabled:oe.value.state!=="connected","read-only":lu.value,"can-create-round":r_.value,"create-hint":i_.value,error:vt.value,message:il.value,onRefresh:a[23]||(a[23]=k=>vc(Ue.value.node_id,!0)),onSelectRound:Ub,onStartRound:Hb,"onUpdate:requestedCount":a[24]||(a[24]=k=>Qr.value=k)},null,8,["rounds","selected-round-id","active-round-id","requested-count","loading","busy","disabled","read-only","can-create-round","create-hint","error","message"])):H("",!0),l("section",yA,[l("aside",_A,[l("header",bA,[l("div",null,[a[136]||(a[136]=l("span",null,"节点流程",-1)),l("strong",null,p(oi.value.length)+" 大 / "+p(Ky.value)+" 小",1)]),l("em",null,p(Rr(Je.value.status)),1)]),l("div",wA,[(m(!0),y(Q,null,re(oi.value,k=>{var be;return m(),y("article",{key:k.id,class:fe(["workflow-node-group",k.status,{active:((be=Bd.value)==null?void 0:be.id)===k.id,locked:Sh(k)}])},[l("button",{type:"button",class:"workflow-group-card",disabled:!k.previewNodeId,onClick:_e=>El(k.previewNodeId)},[l("span",kA,p(k.step),1),l("span",$A,[l("small",null,p(Rr(k.status))+" / "+p(k.badge),1),l("strong",null,p(k.title),1),l("em",null,p(k.detail),1),l("span",CA,[l("i",{style:ca({width:`${k.progress}%`})},null,4)]),l("span",SA,[l("b",null,p(k.summary),1),l("b",null,p(k.outputCount),1),l("b",null,p(k.eta),1)])])],8,hA),k.nodes.length?(m(),y("div",IA,[(m(!0),y(Q,null,re(k.nodes,(_e,gt)=>(m(),y("button",{key:_e.id,type:"button",class:fe(["workflow-subnode-card",_e.status,{active:Je.value.id===_e.id,locked:so(_e.id)}]),"aria-label":so(_e.id)?`${_e.title},未解锁,可查看`:_e.title,onClick:on=>El(_e.id)},[l("span",xA,p(String(gt+1).padStart(2,"0")),1),l("span",AA,[l("small",null,[so(_e.id)?(m(),y("span",MA,"⌁")):H("",!0),Kn(" 节点 "+p(String(gt+1).padStart(2,"0"))+" / "+p(so(_e.id)?"未解锁":Rr(_e.status)),1)]),l("strong",null,p(_e.title),1),l("em",null,p(_e.outputCount??_e.eta??_e.duration),1)])],10,PA))),128))])):H("",!0)],2)}),128))])]),l("section",RA,[l("header",EA,[l("div",null,[a[137]||(a[137]=l("span",null,"主预览",-1)),l("strong",null,p(Vy.value),1)]),Qi.value?(m(),y("div",NA,[l("em",null,p(iu.value)+" / "+p(ru.value)+" 字段",1)])):jd.value?(m(),y("div",TA,[l("em",null,p(ov.value.length)+" 条提示词",1)])):Kd.value?(m(),y("div",BA,[l("em",null,p(_n.value.length)+" 类参考",1)])):Fd.value?(m(),y("div",OA,[...a[138]||(a[138]=[l("em",null,"人设导入工作台",-1)])])):(m(),y("div",LA,[l("em",null,p(bn.value.length)+" 对比 / "+p(Bn.value.length)+" 候选",1),ua.value?(m(),y("button",{key:0,type:"button",class:"workflow-review-trigger",disabled:!n_.value||Ka.value,onClick:nw},p(Ka.value?"加载审查…":"生成式交叉审查"),9,qA)):H("",!0),ua.value?(m(),y("button",{key:1,type:"button",class:"workflow-material-trigger",onClick:jb}," 节点素材 ")):H("",!0),l("button",{type:"button",class:"workflow-compare-trigger",disabled:bn.value.length<2,onClick:Jv}," 平铺对比 ",8,DA)]))]),Fd.value?(m(),y("section",WA,[l("article",{class:"workflow-profile-import-card create"},[l("button",{type:"button",class:"workflow-profile-import-create-action",title:"打开角色档案问卷","aria-label":"打开角色档案问卷",onClick:pi}," + "),a[139]||(a[139]=l("div",{class:"workflow-profile-import-copy"},[l("span",null,"新建"),l("strong",null,"新建粗略人设"),l("p",null,"从空白问卷开始,填写角色核心、性格、外观、服装、场景和规避项,然后作为本工作流的基础档案。")],-1))]),l("article",UA,[l("header",null,[a[140]||(a[140]=l("div",null,[l("span",null,"已有角色卡"),l("strong",null,"选择当前角色卡作为幕布输入")],-1)),l("em",null,p(Uo.value.length)+" 张",1)]),l("div",FA,[(m(!0),y(Q,null,re(Uo.value,(k,be)=>(m(),y("button",{key:k.id,type:"button","data-profile-card-id":k.id,class:fe({active:Os.value===k.id}),onClick:_e=>yu(k)},[l("span",{class:"workflow-profile-import-profile-portrait",style:ca(Sv(k.colors)),"aria-hidden":"true"},null,4),l("span",KA,[a[141]||(a[141]=l("small",null,"姓名",-1)),l("strong",null,p(k.name),1)]),l("span",VA,[a[142]||(a[142]=l("small",null,"身份",-1)),l("strong",null,p(k.identity),1)]),l("span",GA,[a[143]||(a[143]=l("small",null,"风格",-1)),l("strong",null,p(k.style||"未设定"),1)]),l("span",zA,[a[144]||(a[144]=l("small",null,"设定简介",-1)),l("strong",null,p(rb(k)),1),l("em",null,p(k.status)+" / "+p(k.updatedAt),1)])],10,jA))),128))])]),l("aside",HA,[a[148]||(a[148]=l("span",null,"当前导入",-1)),l("strong",null,p(Ee.value.name),1),l("p",null,p(Ee.value.identity),1),l("dl",null,[l("div",null,[a[145]||(a[145]=l("dt",null,"风格",-1)),l("dd",null,p(Ee.value.style||((oa=Ad.value)==null?void 0:oa.label)),1)]),l("div",null,[a[146]||(a[146]=l("dt",null,"素材",-1)),l("dd",null,p(_n.value.length)+" 类参考",1)]),l("div",null,[a[147]||(a[147]=l("dt",null,"状态",-1)),l("dd",null,p(Ee.value.status),1)])])])])):Qi.value?(m(),y("section",QA,[(m(!0),y(Q,null,re(Yi.value,k=>(m(),y("section",{key:k.id,class:"workflow-persona-split-group"},[l("header",null,[l("div",null,[l("span",null,p(k.title),1),l("strong",null,p(k.detail),1)]),l("em",null,p(k.fields.filter(be=>be.status==="ready").length)+" / "+p(k.fields.length),1)]),l("div",YA,[(m(!0),y(Q,null,re(k.fields,be=>(m(),y("article",{key:be.key,class:fe(["workflow-persona-split-field",be.status])},[l("span",null,p(be.label),1),l("strong",null,p(be.value),1),l("small",null,p(be.hint),1),l("em",null,p(be.status==="ready"?"已拆解":"待补充"),1)],2))),128))])]))),128)),a[149]||(a[149]=l("aside",{class:"workflow-persona-split-note"},[l("span",null,"后续流向"),l("strong",null,"确认字段后进入提示词规划"),l("p",null,"这些字段会作为头像、半身、全身、设定图和风格锁定节点的共同输入。真实后端返回更细字段后,可以继续映射到这里。")],-1))])):jd.value?(m(),y("section",JA,[l("section",XA,[(m(!0),y(Q,null,re(ov.value,k=>(m(),y("article",{key:k.id,class:"workflow-prompt-plan-card"},[l("header",null,[l("div",null,[l("span",null,p(k.target),1),l("strong",null,p(k.title),1)]),l("em",null,p(k.status),1)]),l("p",null,p(k.prompt),1),l("dl",null,[l("div",null,[a[150]||(a[150]=l("dt",null,"继承字段",-1)),l("dd",null,[(m(!0),y(Q,null,re(k.inherits,be=>(m(),y("span",{key:be},p(be),1))),128))])]),l("div",null,[a[151]||(a[151]=l("dt",null,"权重建议",-1)),l("dd",null,p(k.weight),1)]),l("div",null,[a[152]||(a[152]=l("dt",null,"负面词",-1)),l("dd",null,p(k.negative),1)])])]))),128))]),l("aside",ZA,[(m(!0),y(Q,null,re(p_.value,k=>(m(),y("article",{key:k.label},[l("span",null,p(k.label),1),l("strong",null,p(k.value),1),l("em",null,p(k.status==="ready"?"已准备":"待处理"),1)]))),128))])])):Kd.value?(m(),y("section",eM,[(m(!0),y(Q,null,re(m_.value,(k,be)=>(m(),y("article",{key:k.category,class:"workflow-material-bind-card","data-overlay-root":"materialPicker"},[l("button",{type:"button",class:"workflow-material-bind-main",disabled:Dd.value,"data-material-category":k.category,"aria-expanded":_t.value===k.category,onClick:_e=>Av(k.category)},[l("span",{class:"workflow-material-bind-swatch",style:ca(Sv(k.colors)),"aria-hidden":"true"},null,4),l("span",aM,[l("small",null,p(k.category)+" / "+p(k.strength)+"参考",1),l("strong",null,p(k.selectedLabel),1),l("em",null,p(k.selectedPrompt),1)]),l("b",null,p(k.required?"强制继承":"可选"),1)],8,tM),l("div",nM,[(m(!0),y(Q,null,re(k.stages,_e=>(m(),y("span",{key:_e.stage_id},p(_e.stage_title),1))),128))]),We(Ya,{name:"material-picker-pop"},{default:ra(()=>[_t.value===k.category?(m(),y("aside",{key:0,class:fe(["quick-profile-material-picker","workflow-material-picker",{accessory:k.category===Ht,filtered:tu.value}]),"data-overlay-root":"materialPicker"},[l("header",lM,[l("div",null,[l("span",null,p(k.category)+"参考",1),a[153]||(a[153]=l("strong",null,"选择素材",-1))]),l("small",null,p(Ff.value),1)]),k.category===Ht?(m(),y("div",oM,[(m(!0),y(Q,null,re(Uf.value,_e=>(m(),y("button",{key:_e,type:"button",class:fe({active:tl.value===_e}),onClick:gt=>xv(_e)},p(_e),11,rM))),128))])):H("",!0),We(Bu,{tag:"div",name:"material-choice-scale",class:fe(["quick-profile-material-picker-list",{accessory:k.category===Ht,filtered:tu.value}])},{default:ra(()=>[l("button",{key:"none",type:"button","data-material-action":"none",class:fe(["quick-profile-material-picker-choice","none",{active:!vl(_t.value)}]),onClick:a[25]||(a[25]=_e=>Rv(_t.value))},[...a[154]||(a[154]=[l("span",{class:"quick-profile-material-none-icon"},"无",-1),l("span",{class:"quick-profile-material-picker-copy"},[l("strong",null,"不使用"),l("em",null,"默认不注入这个参考")],-1)])],2),(m(!0),y(Q,null,re(Ed.value,(_e,gt)=>(m(),y("button",{key:_e.id,type:"button","data-material-reference-id":_e.id,class:fe(["quick-profile-material-picker-choice",{active:Iv(_e)}]),onClick:on=>Mv(_e)},[l("span",sM,[di(_e,gt)?(m(),y("img",{key:0,src:di(_e,gt),alt:_e.label},null,8,uM)):(m(),y("span",dM,"无缩略图"))]),l("span",cM,[_e.advanced?(m(),y("small",fM,"进阶素材 · 高优先级")):_t.value===Ht?(m(),y("small",vM,p(Pv(_e)),1)):H("",!0),l("strong",null,p(_e.label),1),l("em",null,p(_e.prompt),1)])],10,iM))),128)),l("button",{key:"add",type:"button","data-material-action":"add",class:"quick-profile-material-picker-choice add",onClick:a[26]||(a[26]=_e=>Lv(_t.value))},[a[155]||(a[155]=l("span",{class:"quick-profile-material-add-icon"},"+",-1)),l("span",pM,[l("strong",null,"添加"+p(_t.value)+"素材",1),l("em",null,p(jf.value),1)])])]),_:1},8,["class"])],2)):H("",!0)]),_:2},1024)]))),128))])):ua.value?(m(),Ct(se(_),{key:4,candidates:Ko.value,"round-display-code":((Aa=lt.value)==null?void 0:Aa.round.display_code)||"","round-status":((qn=lt.value)==null?void 0:qn.round.status)||"","focused-candidate-id":Pn.value,"compared-candidate-ids":Ta.value,"final-candidate-id":Tt.value,"confirmed-candidate-id":t_.value,"feedback-by-candidate-id":Fa.value,"image-url-by-candidate-id":e_.value,"busy-candidate-ids":a_.value,"max-compared":5,"max-liked":3,"image-fit":ev.value,loading:!!Hr.value||qi.value===((Ma=Ue.value)==null?void 0:Ma.node_id),busy:!!Oi.value,disabled:oe.value.state!=="connected","read-only":!!((ln=lt.value)!=null&&ln.read_only),confirmed:se(Ge)(((Dn=lt.value)==null?void 0:Dn.round.status)||"")==="confirmed"||Sr.value,error:vt.value,"empty-text":"当前轮次还没有候选;提交后各候选会独立更新。",onFocus:Nb,onPreview:Tb,onToggleCompare:Wv,onSetFeedback:_u,onSetFinal:Bb,onRetry:Qb},null,8,["candidates","round-display-code","round-status","focused-candidate-id","compared-candidate-ids","final-candidate-id","confirmed-candidate-id","feedback-by-candidate-id","image-url-by-candidate-id","busy-candidate-ids","image-fit","loading","busy","disabled","read-only","confirmed","error"])):(m(),y("div",mM,[Ml.value?(m(),y("button",{key:0,type:"button",class:"workflow-preview-main",title:`打开 ${Ga(Ml.value)}`,onClick:a[27]||(a[27]=k=>Cu(Ml.value.image_id))},[Ca(Ml.value)?(m(),y("img",{key:0,src:Ca(Ml.value),alt:Ga(Ml.value)},null,8,yM)):H("",!0),l("span",_M,[Kn(" 当前聚焦 / "+p(Ga(Ml.value))+" ",1),Tt.value===xt(Ml.value)?(m(),y("b",bM,"已定稿")):H("",!0)])],8,gM)):(m(),y("div",wM,[l("strong",null,p(Bn.value.length?"选择候选图":"等待节点结果"),1),l("span",null,p(Bn.value.length?"点击下方候选进行聚焦或加入对比。":"节点生成完成后,候选会显示在这里。"),1)]))])),!f_.value&&!ua.value?(m(),y("section",hM,[a[156]||(a[156]=l("header",null,[l("span",null,"候选池"),l("em",null,"点击候选加入对比;喜欢、拒绝与定稿彼此独立")],-1)),l("div",kM,[(m(!0),y(Q,null,re(Bn.value,(k,be)=>(m(),y("article",{key:k.image_id,class:fe({active:Ta.value.includes(xt(k)),focused:Pn.value===xt(k),final:Tt.value===xt(k)})},[l("button",{type:"button",class:"workflow-draft-select",disabled:oo.value,"aria-pressed":Ta.value.includes(xt(k)),onClick:_e=>Wv(xt(k))},[l("span",CM,[Ca(k)?(m(),y("img",{key:0,src:Ca(k),alt:Ga(k)},null,8,SM)):H("",!0),l("em",null,p(String(be+1).padStart(2,"0")),1),Ta.value.includes(xt(k))?(m(),y("strong",IM,"对比")):H("",!0),Tt.value===xt(k)?(m(),y("b",PM,"定稿")):H("",!0)]),l("span",xM,[l("strong",null,"候选 "+p(String(be+1).padStart(2,"0")),1),l("small",null,p(k.model)+" / "+p(k.status),1)])],8,$M),l("div",AM,[l("button",{type:"button",class:fe({active:ts(xt(k))==="liked"}),disabled:oo.value,onClick:_e=>_u(xt(k),"liked")}," 喜欢 ",10,MM),l("button",{type:"button",class:fe({active:ts(xt(k))==="rejected"}),disabled:oo.value,onClick:_e=>_u(xt(k),"rejected")}," 拒绝 ",10,RM),l("button",{type:"button",class:fe({active:ts(xt(k))==="strict_rejected"}),disabled:oo.value,onClick:_e=>_u(xt(k),"strict_rejected")}," 严格拒绝 ",10,EM),l("button",{type:"button",class:fe(["workflow-candidate-final",{active:Tt.value===xt(k)}]),disabled:oo.value,"aria-pressed":Tt.value===xt(k),onClick:_e=>Uv(xt(k))},p(Tt.value===xt(k)?"取消定稿":"定稿"),11,NM)])],2))),128))])])):H("",!0)]),l("aside",{class:fe(["workflow-surface workflow-detail-panel",{"persona-split":Qi.value}])},[l("header",TM,[a[157]||(a[157]=l("div",null,[l("span",null,"节点详情"),l("strong",null,"参数与提示词")],-1)),l("em",null,p(Je.value.badge),1)]),l("div",BM,[Qi.value?(m(),y("article",LM,[l("header",null,[l("div",null,[a[158]||(a[158]=l("span",null,"LLM 拆解设定",-1)),l("strong",null,p(Ee.value.name),1)]),l("em",null,p(Je.value.badge),1)]),l("p",null,p(Je.value.detail),1),l("dl",null,[(m(!0),y(Q,null,re(v_.value,k=>(m(),y("div",{key:k.label},[l("dt",null,p(k.label),1),l("dd",null,p(k.value),1),l("small",null,p(k.hint),1)]))),128))])])):(m(),y("dl",qM,[(m(!0),y(Q,null,re(b_.value,k=>(m(),y("div",{key:k.label},[l("dt",null,p(k.label),1),l("dd",null,p(k.value),1)]))),128))])),an.value?(m(),y("section",DM,[a[159]||(a[159]=l("span",null,"未解锁 · 可查看",-1)),l("strong",null,p(Je.value.title),1),l("p",null,p(lo.value),1)])):Sr.value?(m(),y("section",OM,[a[160]||(a[160]=l("span",null,"已锁定",-1)),l("strong",null,p(Je.value.title),1),l("p",null,p(Vo.value),1)])):Al.value?(m(),y("section",WM,[a[161]||(a[161]=l("span",null,"待确认",-1)),l("strong",null,p(Je.value.title),1),l("p",null,p(Vo.value),1)])):H("",!0),Ue.value?(m(),Ct(se(R),{key:5,context:qy.value,loading:we.value===Ue.value.node_id,error:Te.value,locked:Al.value||an.value,onRefresh:lp},null,8,["context","loading","error","locked"])):H("",!0),l("section",UM,[l("header",null,[a[162]||(a[162]=l("span",null,"工作流操作",-1)),Le.value||w.value?(m(),y("em",FM,"执行中")):ge.value||v.value?(m(),y("em",jM,p(ge.value||v.value),1)):pr.value?(m(),y("em",KM,"加载中")):ol.value?(m(),y("em",VM,p(ol.value),1)):(m(),y("em",GM,p(rv.value.length)+" 项",1))]),l("div",zM,[l("span",null,p(rl.value||"生命周期"),1),l("button",{disabled:Sa.value||!((Tl=Ee.value)!=null&&Tl.workflowId)||!au.value,title:"导入粗略人设后自动启动",onClick:a[28]||(a[28]=k=>hc("start"))},"启动",8,HM),l("button",{disabled:Sa.value||!((Zo=Ee.value)!=null&&Zo.workflowId),onClick:a[29]||(a[29]=k=>hc("cancel"))},"取消",8,QM),l("button",{disabled:Sa.value||!((Bl=Ee.value)!=null&&Bl.workflowId),onClick:a[30]||(a[30]=k=>hc("archive"))},"归档",8,YM),l("button",{disabled:Sa.value||!((er=Ee.value)!=null&&er.workflowId),onClick:kw},"整体审查",8,JM),l("button",{disabled:Sa.value||!Ue.value,onClick:lp},"节点依赖",8,XM)]),$t.value?(m(),y("pre",ZM,p(JSON.stringify($t.value,null,2)),1)):H("",!0),l("div",eR,[(m(!0),y(Q,null,re(rv.value,k=>(m(),y("article",{key:k.id,class:fe(["workflow-action-card",k.tone,{disabled:!k.enabled}])},[l("div",null,[l("span",tR,p(w_(k.badge)),1)]),l("strong",null,p(k.title),1),l("p",null,p(k.detail),1),k.actionKey||k.nav&&k.module?(m(),y("button",{key:0,type:"button",disabled:!k.enabled,onClick:be=>yw(k)},p(iv(k)),9,aR)):(m(),y("span",nR,p(iv(k)),1))],2))),128))])])])],2)]),We(se(h),{prompt:fn.value,"context-summary":g_.value,"node-title":Je.value.title,"node-phase":Je.value.phase,"has-round-candidates":!!(ua.value&&((Ll=lt.value)!=null&&Ll.candidates.length)),"last-prompt":Vr.value,"last-model":Bi.value,"model-override":ri.value,"effective-image-model":qd.value,"effective-image-source":Yf.value,"text-model":Yy.value,"model-options":Jf.value,"model-status-message":jo.value.route?"":xd.value,disabled:Dd.value,busy:Le.value,"submit-disabled":!lv.value&&ua.value&&!jo.value.route,"onUpdate:prompt":a[31]||(a[31]=k=>fn.value=k),"onUpdate:modelOverride":Ob,onSubmit:tw,onOpenSettings:a[32]||(a[32]=k=>Zt("settings","settings")),onOpenMaterials:a[33]||(a[33]=k=>Zt("materials","images"))},null,8,["prompt","context-summary","node-title","node-phase","has-round-candidates","last-prompt","last-model","model-override","effective-image-model","effective-image-source","text-model","model-options","model-status-message","disabled","busy","submit-disabled"])])),We(Ya,{name:"viewer-fade"},{default:ra(()=>[vn.value?(m(),y("div",lR,[l("section",oR,[l("header",null,[a[163]||(a[163]=l("div",null,[l("span",null,"外部角色卡"),l("strong",null,"粘贴文本并识别为角色档案")],-1)),l("button",{type:"button",title:"关闭",onClick:a[34]||(a[34]=k=>ea("externalProfileImport"))},"×")]),l("div",rR,[l("div",iR,[l("label",sR,[a[164]||(a[164]=l("span",null,"从文档导入",-1)),l("input",{type:"file",accept:".md,.markdown,.txt,text/markdown,text/plain",onChange:Hw},null,32)]),fr.value?(m(),y("em",uR,p(fr.value),1)):H("",!0),Gr.value?(m(),y("small",dR,"正在让文本模型整理角色档案…")):hl.value?(m(),y("small",cR,p(hl.value),1)):H("",!0)]),l("label",fR,[a[165]||(a[165]=l("span",null,"原始文本",-1)),xe(l("textarea",{"onUpdate:modelValue":a[35]||(a[35]=k=>Jl.value=k),"data-profile-import-input":"",rows:"14",placeholder:`姓名:星港绘理\r
|
||
身份:近未来港区巡查员\r
|
||
性格:冷静、可靠、行动快\r
|
||
外观:黑色短发,青绿色眼睛\r
|
||
服装:轻机能外套、短靴、发光臂章\r
|
||
避雷:低质量、结构错误`},null,512),[[je,Jl.value]])]),l("aside",vR,[l("header",null,[l("div",null,[a[166]||(a[166]=l("span",null,"识别预览",-1)),l("strong",null,p(ay.value)+" / "+p(Id.value.length),1)]),l("em",null,p(ai.value?`${ai.value.length} 字`:"待粘贴"),1)]),l("dl",null,[(m(!0),y(Q,null,re(Id.value,k=>(m(),y("div",{key:k.key,class:fe({pending:ai.value&&!k.recognized})},[l("dt",null,[Kn(p(k.label)+" ",1),l("span",null,p(k.recognized?"已识别":"待整理"),1)]),l("dd",null,p(k.value||"粘贴文本后显示"),1)],2))),128))])])]),l("footer",null,[l("span",null,p(ai.value?"识别结果会先填入问卷,仍可在问卷里继续微调。":"等待外部角色卡文本。"),1),l("button",{type:"button",onClick:a[36]||(a[36]=k=>ea("externalProfileImport"))},"取消"),l("button",{type:"button",disabled:!ai.value,onClick:Qw}," 识别并填入问卷 ",8,pR)])])])):H("",!0)]),_:1}),We(Ya,{name:"viewer-fade"},{default:ra(()=>[Vt.value?(m(),y("div",mR,[l("section",gR,[l("header",null,[a[167]||(a[167]=l("div",null,[l("span",null,"快速角色"),l("strong",null,"创建角色档案问卷")],-1)),l("button",{type:"button",title:"关闭",onClick:a[37]||(a[37]=k=>ea("personaQuestionnaire"))},"×")]),l("div",yR,[l("label",null,[a[168]||(a[168]=l("span",null,"角色核心",-1)),xe(l("textarea",{"onUpdate:modelValue":a[38]||(a[38]=k=>Re.value.roleCore=k),rows:"3",placeholder:"角色名、身份、核心定位,可以只写一句。"},null,512),[[je,Re.value.roleCore]])]),l("label",_R,[a[170]||(a[170]=l("span",null,"性别表现",-1)),xe(l("select",{"onUpdate:modelValue":a[39]||(a[39]=k=>Re.value.genderPresentation=k)},[...a[169]||(a[169]=[l("option",{value:""},"未指定",-1),l("option",{value:"female"},"女性 / Female",-1),l("option",{value:"male"},"男性 / Male",-1),l("option",{value:"androgynous"},"中性 / Androgynous",-1),l("option",{value:"nonbinary"},"非二元 / Nonbinary",-1)])],512),[[Xa,Re.value.genderPresentation]])]),l("label",bR,[a[171]||(a[171]=l("span",null,"年龄阶段",-1)),xe(l("input",{"onUpdate:modelValue":a[40]||(a[40]=k=>Re.value.ageStage=k),type:"text",placeholder:"例如 adult、young adult、middle-aged"},null,512),[[je,Re.value.ageStage]])]),l("label",wR,[a[172]||(a[172]=l("span",null,"物种 / 种族",-1)),xe(l("input",{"onUpdate:modelValue":a[41]||(a[41]=k=>Re.value.species=k),type:"text",placeholder:"例如 human、elf、android"},null,512),[[je,Re.value.species]])]),l("label",hR,[a[173]||(a[173]=l("span",null,"体型",-1)),xe(l("input",{"onUpdate:modelValue":a[42]||(a[42]=k=>Re.value.bodyType=k),type:"text",placeholder:"例如 slim、athletic、muscular"},null,512),[[je,Re.value.bodyType]])]),l("label",null,[a[174]||(a[174]=l("span",null,"显著特征",-1)),xe(l("textarea",{"onUpdate:modelValue":a[43]||(a[43]=k=>Re.value.distinctiveFeatures=k),rows:"3",placeholder:"伤疤、异色瞳、义体、角、纹身或固定视觉记忆点。"},null,512),[[je,Re.value.distinctiveFeatures]])]),l("label",null,[a[175]||(a[175]=l("span",null,"性格关键词",-1)),xe(l("textarea",{"onUpdate:modelValue":a[44]||(a[44]=k=>Re.value.personality=k),rows:"3",placeholder:"外显性格、内在矛盾、行动方式。"},null,512),[[je,Re.value.personality]])]),l("label",null,[a[176]||(a[176]=l("span",null,"外观特征",-1)),xe(l("textarea",{"onUpdate:modelValue":a[45]||(a[45]=k=>Re.value.appearance=k),rows:"3",placeholder:"发色、发型、眼睛、五官和视觉记忆点。"},null,512),[[je,Re.value.appearance]])]),l("label",null,[a[177]||(a[177]=l("span",null,"服装与配饰",-1)),xe(l("textarea",{"onUpdate:modelValue":a[46]||(a[46]=k=>Re.value.outfit=k),rows:"3",placeholder:"服装风格、配饰、武器或随身物。"},null,512),[[je,Re.value.outfit]])]),l("label",null,[a[178]||(a[178]=l("span",null,"常用场景",-1)),xe(l("textarea",{"onUpdate:modelValue":a[47]||(a[47]=k=>Re.value.scene=k),rows:"3",placeholder:"常驻地点、画面背景、适合出现的环境。"},null,512),[[je,Re.value.scene]])]),l("label",null,[a[179]||(a[179]=l("span",null,"避雷内容",-1)),xe(l("textarea",{"onUpdate:modelValue":a[48]||(a[48]=k=>Re.value.avoid=k),rows:"3",placeholder:"不想要的设计方向、负面词和禁用元素。"},null,512),[[je,Re.value.avoid]])]),pn.value==="advanced"?(m(),y(Q,{key:0},[l("label",null,[a[180]||(a[180]=l("span",null,"世界观",-1)),xe(l("textarea",{"onUpdate:modelValue":a[49]||(a[49]=k=>Re.value.worldview=k),rows:"3",placeholder:"现代、赛博、奇幻、末世、校园、古风、星际等。"},null,512),[[je,Re.value.worldview]])]),l("label",null,[a[181]||(a[181]=l("span",null,"背景经历",-1)),xe(l("textarea",{"onUpdate:modelValue":a[50]||(a[50]=k=>Re.value.background=k),rows:"3",placeholder:"所属组织、过往经历、当前处境。"},null,512),[[je,Re.value.background]])]),l("label",null,[a[182]||(a[182]=l("span",null,"身高 / 身材",-1)),xe(l("textarea",{"onUpdate:modelValue":a[51]||(a[51]=k=>Re.value.heightBuild=k),rows:"3",placeholder:"身高范围、体型、姿态气质、肤色。"},null,512),[[je,Re.value.heightBuild]])]),l("label",null,[a[183]||(a[183]=l("span",null,"身体记忆点",-1)),xe(l("textarea",{"onUpdate:modelValue":a[52]||(a[52]=k=>Re.value.bodyFeatures=k),rows:"3",placeholder:"伤疤、痣、纹身、义体、异色瞳等。"},null,512),[[je,Re.value.bodyFeatures]])]),l("label",null,[a[184]||(a[184]=l("span",null,"喜好",-1)),xe(l("textarea",{"onUpdate:modelValue":a[53]||(a[53]=k=>Re.value.likes=k),rows:"3",placeholder:"颜色、食物、饮品、兴趣、常去地点。"},null,512),[[je,Re.value.likes]])]),l("label",null,[a[185]||(a[185]=l("span",null,"排斥 / 害怕",-1)),xe(l("textarea",{"onUpdate:modelValue":a[54]||(a[54]=k=>Re.value.dislikes=k),rows:"3",placeholder:"不喜欢、害怕、排斥或会回避的东西。"},null,512),[[je,Re.value.dislikes]])]),l("label",null,[a[186]||(a[186]=l("span",null,"生活习惯",-1)),xe(l("textarea",{"onUpdate:modelValue":a[55]||(a[55]=k=>Re.value.habits=k),rows:"3",placeholder:"熬夜、洁癖、收集癖、整理装备等。"},null,512),[[je,Re.value.habits]])]),l("label",null,[a[187]||(a[187]=l("span",null,"关系",-1)),xe(l("textarea",{"onUpdate:modelValue":a[56]||(a[56]=k=>Re.value.relationships=k),rows:"3",placeholder:"重要关系人、同伴、敌对关系、想保护的人。"},null,512),[[je,Re.value.relationships]])]),l("label",null,[a[188]||(a[188]=l("span",null,"故事钩子",-1)),xe(l("textarea",{"onUpdate:modelValue":a[57]||(a[57]=k=>Re.value.storyHooks=k),rows:"3",placeholder:"未完成目标、秘密、可延展的事件线索。"},null,512),[[je,Re.value.storyHooks]])]),l("label",null,[a[189]||(a[189]=l("span",null,"画风方向",-1)),xe(l("textarea",{"onUpdate:modelValue":a[58]||(a[58]=k=>Re.value.generationStyle=k),rows:"3",placeholder:"赛璐璐、厚涂、电影感、设定集、轻小说插画等。"},null,512),[[je,Re.value.generationStyle]])]),l("label",null,[a[190]||(a[190]=l("span",null,"镜头偏好",-1)),xe(l("textarea",{"onUpdate:modelValue":a[59]||(a[59]=k=>Re.value.shotPreference=k),rows:"3",placeholder:"头像、半身、全身、立绘、设定图、多角度。"},null,512),[[je,Re.value.shotPreference]])]),l("label",null,[a[191]||(a[191]=l("span",null,"氛围",-1)),xe(l("textarea",{"onUpdate:modelValue":a[60]||(a[60]=k=>Re.value.mood=k),rows:"3",placeholder:"明亮、压抑、柔和、危险、神圣、孤独等。"},null,512),[[je,Re.value.mood]])]),l("label",kR,[a[192]||(a[192]=l("span",null,"补充备注",-1)),xe(l("textarea",{"onUpdate:modelValue":a[61]||(a[61]=k=>Re.value.extraNotes=k),rows:"3",placeholder:"其他需要保留给后端工作流的补充设定。"},null,512),[[je,Re.value.extraNotes]])])],64)):H("",!0)]),l("footer",null,[l("span",null,p(kl.value||"生成后会调用后端保存角色档案、创建 quick_profile 工作流,并自动选中角色卡。"),1),l("div",$R,[l("div",CR,[l("button",{type:"button",class:fe({active:pn.value==="simple"}),onClick:a[62]||(a[62]=k=>pn.value="simple")}," 简单问卷 ",2),l("button",{type:"button",class:fe({active:pn.value==="advanced"}),onClick:a[63]||(a[63]=k=>pn.value="advanced")}," 复杂问卷 ",2)]),l("button",{type:"button",disabled:!Gf.value||So.value,onClick:Ww},p(So.value?"保存中":"生成档案"),9,SR)])])])])):H("",!0)]),_:1})]))]}),_:1})])):z.value==="profiles"?(m(),Ct(se(i),{key:2,"data-module":"profiles",profiles:Hi.value,"selected-id":((c=St.value)==null?void 0:c.profile_id)??"","selected-profile":St.value,"selected-avatar-url":Kf.value,"image-targets":My.value,"selected-image-id":zr.value,loading:wd.value||Ki.value,error:oe.value.state==="connected"?hd.value:"","backend-connected":oe.value.state==="connected","can-write":!!((f=ne.value)!=null&&f.permissions.can_write),"material-count":Ny.value,"selected-workflows-count":Ey.value,"workflow-node-count":Ty.value,"wardrobe-items":Nd.value,"wardrobe-materials":Vf.value,"material-categories":Lt.value,"wardrobe-permissions":Ay.value,"wardrobe-loading":xy.value,"wardrobe-busy":!!He.value,"wardrobe-error":Sy.value,"generation-busy":Py.value,"generation-error":Iy.value,deleting:vr.value===((b=St.value)==null?void 0:b.profile_id),onSelect:oc,onSelectImage:a[64]||(a[64]=x=>zr.value=x),onRetry:O_,onCreate:Ab,onImport:Mb,onEdit:a[65]||(a[65]=x=>Ib("quickProfile")),onGenerate:a[66]||(a[66]=x=>ic("quick")),onWorkflow:Cb,onDelete:Sb,onMaterials:Rb,onWardrobeRetry:bb,onWardrobeAdd:yb,onWardrobeRemove:_b},null,8,["profiles","selected-id","selected-profile","selected-avatar-url","image-targets","selected-image-id","loading","error","backend-connected","can-write","material-count","selected-workflows-count","workflow-node-count","wardrobe-items","wardrobe-materials","material-categories","wardrobe-permissions","wardrobe-loading","wardrobe-busy","wardrobe-error","generation-busy","generation-error","deleting"])):z.value==="materials"?(m(),y("section",IR,[l("header",PR,[l("div",null,[a[193]||(a[193]=l("span",null,"素材库",-1)),l("h2",null,p(fy.value),1),l("p",null,p(vy.value),1)]),j.value==="standard"?(m(),y("div",xR,[l("button",{type:"button",disabled:Il.value,onClick:a[67]||(a[67]=x=>$p(Wf.value[0]))},p(Il.value?"同步中":"刷新素材"),9,AR),l("button",{type:"button",onClick:Bv},"进入素材绑定")])):(m(),y("div",MR,[l("button",{type:"button",onClick:a[68]||(a[68]=x=>si("advanced"))},"查看进阶素材"),l("button",{type:"button",onClick:a[69]||(a[69]=x=>si("advanced-import"))},"新建进阶导入")]))]),l("nav",RR,[l("button",{type:"button",class:fe({active:j.value==="standard"}),"aria-pressed":j.value==="standard",onClick:a[70]||(a[70]=x=>si("standard"))},[...a[194]||(a[194]=[l("strong",null,"普通素材库",-1),l("small",null,"快速识别与直接确认",-1)])],10,ER),l("button",{type:"button",class:fe({active:j.value==="advanced"}),"aria-pressed":j.value==="advanced",onClick:a[71]||(a[71]=x=>si("advanced"))},[...a[195]||(a[195]=[l("strong",null,"进阶素材库",-1),l("small",null,"验证通过的高优先级素材",-1)])],10,NR),l("button",{type:"button",class:fe({active:j.value==="advanced-import"}),"aria-pressed":j.value==="advanced-import",onClick:a[72]||(a[72]=x=>si("advanced-import"))},[...a[196]||(a[196]=[l("strong",null,"进阶导入",-1),l("small",null,"识别、验证生图与多轮调整",-1)])],10,TR)]),j.value==="standard"?(m(),y(Q,{key:0},[We(qu,{cards:wy.value,"section-class":"materials-status-grid"},null,8,["cards"]),Kt.value||Ut.value?(m(),Ct(Br,{key:0,class:"materials-page-message",tone:Kt.value?"bad":"good",title:Kt.value?"素材接口提示":"素材操作完成",detail:Kt.value||Ut.value,"action-label":"重新加载",busy:Il.value,onAction:wn},null,8,["tone","title","detail","busy"])):H("",!0),l("section",BR,[l("div",LR,[l("section",qR,[l("header",null,[l("div",null,[a[197]||(a[197]=l("span",null,"素材列表",-1)),l("h2",null,p(kr.value.length)+" 条素材",1)]),l("div",DR,[l("em",null,p(Il.value?"同步中":oe.value.state==="connected"?"后端素材":"后端未连接"),1),l("button",{type:"button",class:"materials-primary-add",onClick:a[73]||(a[73]=x=>Ho("upload-image"))},[...a[198]||(a[198]=[l("span",null,"+",-1),Kn(" 添加素材 ",-1)])])])]),l("div",OR,[(m(!0),y(Q,null,re(Oo.value,x=>(m(),y("button",{key:x.id,type:"button",class:fe(["materials-category-chip",x.tone,{active:Rd.value===x.id}]),title:`${x.label} / ${x.detail} / ${x.endpoint}`,"aria-pressed":Rd.value===x.id,onClick:Fe=>pb(x.id)},[l("strong",null,p(x.label),1),l("b",null,p(x.count),1)],10,WR))),128)),l("button",{type:"button",class:"materials-category-chip add",title:((C=Wo.value)==null?void 0:C.label)===Ht?"打开添加配饰子类卡片 / POST material-categories":"打开添加分类卡片 / POST material-categories",onClick:Tv},[l("strong",null,p(((O=Wo.value)==null?void 0:O.label)===Ht?"添加子类":"添加分类"),1),a[199]||(a[199]=l("b",null,"+",-1))],8,UR)]),l("div",FR,[l("label",null,[a[201]||(a[201]=l("span",null,"身体槽位",-1)),xe(l("select",{"onUpdate:modelValue":a[74]||(a[74]=x=>dr.value=x)},[a[200]||(a[200]=l("option",{value:""},"全部槽位",-1)),(m(!0),y(Q,null,re(se(Rf),x=>(m(),y("option",{key:x.value,value:x.value},p(x.label),9,jR))),128))],512),[[Xa,dr.value]])]),l("label",null,[a[203]||(a[203]=l("span",null,"穿着层级",-1)),xe(l("select",{"onUpdate:modelValue":a[75]||(a[75]=x=>cn.value=x)},[a[202]||(a[202]=l("option",{value:""},"全部层级",-1)),(m(),y(Q,null,re(["skin","inner","base","middle","outer","overlay","accessory","prop"],x=>l("option",{key:x,value:x},p(x),9,KR)),64))],512),[[Xa,cn.value]])]),l("label",null,[a[205]||(a[205]=l("span",null,"最低置信度",-1)),xe(l("select",{"onUpdate:modelValue":a[76]||(a[76]=x=>$o.value=x)},[...a[204]||(a[204]=[l("option",{value:0},"不限",-1),l("option",{value:.6},"≥ 0.60 可参与生成",-1),l("option",{value:.8},"≥ 0.80 高置信",-1)])],512),[[Xa,$o.value,void 0,{number:!0}]])]),l("button",{type:"button",onClick:a[77]||(a[77]=x=>{dr.value="",cn.value="",$o.value=0})},"清除筛选")]),Xs.value.length?(m(),y("div",VR,[a[206]||(a[206]=l("span",null,"配饰子类",-1)),(m(!0),y(Q,null,re(Xs.value,x=>{var Fe;return m(),y("button",{key:x.id,type:"button",class:fe({active:Rd.value===((Fe=$r.value)==null?void 0:Fe.id)&&aa.value===x.id}),"aria-pressed":aa.value===x.id,onClick:oa=>mb(x.id)},[l("strong",null,p(x.label),1),l("b",null,p(x.count),1)],10,GR)}),128))])):H("",!0),Il.value&&!Gi.value.length?(m(),y("div",zR,[(m(),y(Q,null,re(6,x=>l("span",{key:x})),64))])):kr.value.length?(m(),y("div",HR,[(m(!0),y(Q,null,re(kr.value,x=>{var Fe;return m(),y("button",{key:x.id,type:"button",class:fe(["materials-library-card",vb(x.status),{active:((Fe=li.value)==null?void 0:Fe.id)===x.id}]),onClick:oa=>gw(x.id)},[l("span",YR,[l("img",{src:x.imageUrl,alt:x.label},null,8,JR)]),l("span",XR,[l("small",null,p(x.category)+" / "+p(x.statusText),1),l("strong",null,p(x.label),1),l("em",null,p(x.prompt||"等待识别后写入提示词"),1)]),l("span",ZR,[(m(!0),y(Q,null,re(x.tags.slice(0,3),oa=>(m(),y("b",{key:oa},p(oa),1))),128))])],10,QR)}),128))])):(m(),Ct(Uc,{key:3,title:"暂无素材",detail:"登记 storage:// 素材 URI 或导入素材包后,后端素材记录会显示在这里。"},{actions:ra(()=>[l("button",{type:"button",onClick:a[78]||(a[78]=x=>Ho("upload-image"))},"添加素材"),l("button",{type:"button",onClick:a[79]||(a[79]=x=>Ho("register-uri"))},"登记素材 URI"),l("button",{type:"button",onClick:a[80]||(a[80]=x=>Ho("asset-pack"))},"导入素材包")]),_:1}))])]),l("aside",eE,[l("section",tE,[a[207]||(a[207]=l("header",null,[l("div",null,[l("span",null,"后端动作"),l("h2",null,"素材接入点")])],-1)),l("div",aE,[(m(!0),y(Q,null,re(Wf.value,x=>(m(),y("button",{key:x.id,type:"button",class:fe(["materials-action-card",x.tone]),disabled:!x.enabled,onClick:Fe=>$p(x)},[l("span",null,p(x.badge),1),l("strong",null,p(x.title),1),l("small",null,p(x.detail),1),l("em",null,p(x.action),1),l("i",null,p(x.endpoint),1)],10,nE))),128))])])])]),We(f$,{open:wl.value,title:yy.value,"is-accessory-group":Zs.value,"parent-label":_y.value,"endpoint-label":by.value,busy:Xn.value,error:ja.value,"draft-name":al.value,"draft-note":nl.value,"onUpdate:draftName":a[81]||(a[81]=x=>al.value=x),"onUpdate:draftNote":a[82]||(a[82]=x=>nl.value=x),onSubmit:gb,onClose:a[83]||(a[83]=x=>ea("materialCategoryCreate"))},null,8,["open","title","is-accessory-group","parent-label","endpoint-label","busy","error","draft-name","draft-note"]),We(L$,{open:Yl.value,item:li.value,rows:hy.value,material:zi.value,onSaveProfile:ih,onClose:a[84]||(a[84]=x=>ea("materialDetail"))},null,8,["open","item","rows","material"])],64)):(m(),Ct(SI,{key:1,mode:j.value,categories:Lt.value,"can-manage":!!((V=ne.value)!=null&&V.permissions.can_manage_materials),onNavigate:si,onChanged:tb},null,8,["mode","categories","can-manage"]))])):z.value==="queue"?(m(),y("section",lE,[l("header",oE,[a[208]||(a[208]=l("div",null,[l("span",null,"任务队列"),l("h2",null,"生成调度工作台"),l("p",null,"集中查看图片生成、快速角色和角色工作流节点的任务状态,失败任务会浮到处理区。")],-1)),l("div",rE,[l("button",{type:"button",disabled:gn.value,onClick:a[85]||(a[85]=x=>Au(Ji.value[0]))},p(gn.value?"同步中":"刷新队列"),9,iE),l("button",{type:"button",onClick:a[86]||(a[86]=x=>Zt("generate","generate"))},"新建生成")])]),We(qu,{cards:k_.value,"section-class":"queue-status-grid"},null,8,["cards"]),ka.value||tn.value?(m(),Ct(Br,{key:0,class:"queue-page-error",tone:ka.value?"bad":"good",title:ka.value?"队列接口提示":"队列操作完成",detail:ka.value||tn.value,"action-label":"重新加载",busy:gn.value,onAction:a[87]||(a[87]=x=>Au(Ji.value[0]))},null,8,["tone","title","detail","busy"])):H("",!0),l("section",sE,[l("article",uE,[l("header",null,[l("div",null,[a[209]||(a[209]=l("span",null,"任务列表",-1)),l("h2",null,p(zo.value.length)+" 条任务",1)]),l("div",dE,[(m(!0),y(Q,null,re(h_.value,x=>(m(),y("button",{key:x.key,type:"button",role:"tab",class:fe({active:yt.value===x.key}),"aria-selected":yt.value===x.key,onClick:Fe=>yt.value=x.key},[l("span",null,p(x.label),1),l("b",null,p(x.count),1)],10,cE))),128))])]),gn.value&&!Ia.value.length?(m(),y("div",fE,[(m(),y(Q,null,re(5,x=>l("span",{key:x})),64))])):zo.value.length?(m(),y("div",vE,[(m(!0),y(Q,null,re(zo.value,x=>{var Fe;return m(),y("button",{key:x.task_id,type:"button",class:fe(["queue-task-card",se(Fc)(x.status),{active:((Fe=Rl.value)==null?void 0:Fe.task_id)===x.task_id}]),onClick:oa=>Na.value=x.task_id},[l("span",mE,p(se(Dl)(x.status)),1),l("span",gE,[l("strong",null,p(Xo(x)),1),l("small",null,p(Ph(x)),1),l("i",yE,[l("span",{style:ca({width:`${se(Lu)(x)}%`})},null,4)])]),l("span",_E,[l("b",null,p(se(Lu)(x))+"%",1),l("small",null,p(se(jc)(x)),1)])],10,pE)}),128))])):(m(),y("div",bE,[...a[210]||(a[210]=[l("strong",null,"当前筛选下没有任务",-1),l("span",null,"切换筛选或新建生成任务后,这里会显示后端队列记录。",-1)])]))]),l("aside",wE,[l("section",hE,[l("header",null,[l("div",null,[a[211]||(a[211]=l("span",null,"任务详情",-1)),l("h2",null,p(Rl.value?Xo(Rl.value):"未选中"),1)]),Rl.value?(m(),y("span",{key:0,class:fe(["status-pill",se(Fc)(Rl.value.status)])},p(se(Dl)(Rl.value.status)),3)):H("",!0)]),l("dl",null,[(m(!0),y(Q,null,re($_.value,x=>(m(),y("div",{key:x.label},[l("dt",null,p(x.label),1),l("dd",null,p(x.value),1)]))),128))])]),l("section",kE,[a[212]||(a[212]=l("header",null,[l("div",null,[l("span",null,"处理动作"),l("h2",null,"后端接入点")])],-1)),l("div",$E,[(m(!0),y(Q,null,re(Ji.value,x=>(m(),y("button",{key:x.id,type:"button",class:fe(["queue-action-card",x.tone]),disabled:!x.enabled,onClick:Fe=>Au(x)},[l("span",null,p(x.badge),1),l("strong",null,p(x.title),1),l("small",null,p(x.detail),1),l("em",null,p(x.action),1)],10,CE))),128))])])])])])):z.value==="gallery"?(m(),Ct(se(n),{key:5,images:Lf.value,"selected-id":Y.value,loading:ao.value||yd.value,error:Qs.value,"backend-connected":oe.value.state==="connected",onSelect:a[88]||(a[88]=x=>Y.value=x),onRefresh:U_,onCreate:a[89]||(a[89]=x=>Zt("generate","generate")),onReuse:ab},null,8,["images","selected-id","loading","error","backend-connected"])):z.value==="settings"?(m(),Ct(se(u),{key:6,schema:va.value,current:at.value,snapshots:pa.value,validation:Et.value,loading:Hs.value,busy:wr.value,error:Pl.value,message:To.value,"backend-connected":oe.value.state==="connected","can-manage":!!((ce=ne.value)!=null&&ce.permissions.can_manage_config),"plugin-version":((pe=ne.value)==null?void 0:pe.plugin_version)??"v3","model-count":dn.value.length,onRefresh:Yd,onValidate:z_,onSave:H_,onReload:Q_},null,8,["schema","current","snapshots","validation","loading","busy","error","message","backend-connected","can-manage","plugin-version","model-count"])):z.value==="logs"?(m(),Ct(se(o),{key:7,generation:Ye.value,workflows:ot.value,errors:it.value,integrations:ft.value,audit:tt.value,loading:zs.value,error:No.value,"backend-connected":oe.value.state==="connected","can-audit":!!((Ve=ne.value)!=null&&Ve.permissions.can_manage_config),onRefresh:nn},null,8,["generation","workflows","errors","integrations","audit","loading","error","backend-connected","can-audit"])):z.value!=="performance"?(m(),y(Q,{key:8},[l("section",SE,[l("div",IE,[l("span",null,p(((Oe=ne.value)==null?void 0:Oe.dashboard_user)??"AstrBot"),1),a[213]||(a[213]=l("h2",null,"星图导航工作台",-1)),a[214]||(a[214]=l("p",null,"生成、队列、图库和运行监控都在同一屏聚合。",-1))]),(m(!0),y(Q,null,re(Gd.value.slice(0,3),x=>(m(),y("article",{key:x.label,class:fe(["signal-card",x.state])},[l("span",null,p(x.label),1),l("strong",null,p(x.value),1),l("small",null,p(x.hint),1)],2))),128)),l("button",{type:"button",class:"quick-create",onClick:a[90]||(a[90]=x=>Zt("generate","generate"))},[...a[215]||(a[215]=[l("span",{"aria-hidden":"true"},"+",-1),Kn(" 新建生成 ",-1)])])]),l("section",PE,[l("div",xE,[l("section",AE,[l("header",null,[l("div",null,[a[216]||(a[216]=l("span",null,"性能监控",-1)),l("h2",null,p(yn.value?"需要重试":se(Dl)(((Xe=J.value)==null?void 0:Xe.plugin_status)??"loading")),1)]),l("button",{type:"button",onClick:a[91]||(a[91]=x=>Zt("performance","performance"))},"详情")]),yn.value?(m(),Ct(Br,{key:0,tone:"bad",title:"监控加载失败",detail:yn.value,"action-label":"重试",busy:ao.value,onAction:Va},null,8,["detail","busy"])):H("",!0),We(qu,{cards:S_.value,"section-class":"summary-metric-grid"},null,8,["cards"])]),l("section",ME,[l("header",null,[l("div",null,[a[217]||(a[217]=l("span",null,"当前队列",-1)),l("h2",null,p(Bo.value)+" 个任务",1)]),l("button",{type:"button",disabled:gn.value,onClick:fl},p(gn.value?"加载中":"更新"),9,RE)]),ka.value?(m(),Ct(Br,{key:0,tone:"bad",title:"队列加载失败",detail:ka.value,"action-label":"重试",busy:gn.value,onAction:fl},null,8,["detail","busy"])):gn.value&&!Pd.value.length?(m(),y("div",EE,[(m(),y(Q,null,re(3,x=>l("span",{key:x})),64))])):Pd.value.length?(m(),y("ul",NE,[(m(!0),y(Q,null,re(Pd.value,x=>(m(),y("li",{key:x.task_id},[l("div",TE,[l("strong",null,p(Xo(x)),1),l("small",null,p(x.model_route||"未指定模型")+" / 耗时 "+p(se(jc)(x)),1),l("div",BE,[l("span",{style:ca({width:`${se(Lu)(x)}%`})},null,4)])]),l("span",{class:fe(["status-pill",se(Fc)(x.status)])},p(se(Dl)(x.status)),3),l("div",LE,[l("button",{type:"button",title:"查看任务详情","aria-label":`查看任务 ${se(rn)(x.task_id)} 详情`,onClick:Fe=>kp(x)}," □ ",8,qE),l("button",{type:"button",title:"重试任务","aria-label":`重试任务 ${se(rn)(x.task_id)}`,disabled:!ah(x),onClick:Fe=>nh(x)}," ↻ ",8,DE)])]))),128))])):(m(),Ct(Uc,{key:3,title:"队列暂时空闲",detail:"新的生成任务会在这里显示进度、模型和等待时间。"}))]),l("section",OE,[l("header",null,[l("div",null,[a[218]||(a[218]=l("span",null,"智能工作建议",-1)),l("h2",null,p(Hd.value.length?"可继续处理":"当前平稳"),1)])]),Hd.value.length?(m(),y("div",WE,[(m(!0),y(Q,null,re(Hd.value,x=>(m(),y("button",{key:x.id,type:"button",class:fe(["suggestion-card",x.tone]),onClick:Fe=>th(x)},[l("span",null,p(x.action),1),l("strong",null,p(x.title),1),l("small",null,p(x.detail),1)],10,UE))),128))])):(m(),Ct(Uc,{key:1,class:"calm",title:"没有需要立即处理的建议",detail:"失败、待确认、成本提醒和可继续流程会自动浮到这里。"}))])]),l("aside",FE,[l("section",jE,[l("header",null,[l("div",null,[a[219]||(a[219]=l("span",null,"最近图片",-1)),l("h2",null,p(Lo.value.length)+" 张结果",1)]),l("button",{type:"button",onClick:a[92]||(a[92]=x=>Zt("gallery","images"))},"图库")]),yn.value?(m(),Ct(Br,{key:0,tone:"bad",title:"图片摘要不可用",detail:yn.value},null,8,["detail"])):ao.value&&!Lo.value.length?(m(),y("div",KE,[(m(),y(Q,null,re(3,x=>l("span",{key:x,class:"image-skeleton"})),64))])):Lo.value.length?(m(),y("div",VE,[(m(!0),y(Q,null,re(Lo.value,x=>(m(),y("article",{key:x.image_id,class:"side-image-card"},[l("div",GE,[Ca(x)?(m(),y("img",{key:0,src:Ca(x),alt:Ga(x)},null,8,zE)):(m(),y("span",HE,"IMG"))]),l("strong",null,p(Ga(x)),1)]))),128))])):(m(),y("div",QE,[...a[220]||(a[220]=[l("strong",null,"暂无最近图片",-1),l("span",null,"完成的生成结果会在这里显示缩略图和名称。",-1)])]))])])])],64)):(m(),y("section",YE,[l("header",JE,[a[221]||(a[221]=l("div",null,[l("span",null,"性能详情"),l("h2",null,"运行、队列和存储监控"),l("p",null,"首页侧栏只保留必要指标,完整拆分集中在这里。")],-1)),l("button",{type:"button",disabled:ao.value,onClick:Va},p(ao.value?"同步中":"刷新监控"),9,XE)]),yn.value?(m(),Ct(Br,{key:0,class:"detail-error",tone:"bad",title:"监控详情加载失败",detail:yn.value,"action-label":"重试",busy:ao.value,onAction:Va},null,8,["detail","busy"])):H("",!0),We(qu,{cards:Gd.value,"section-class":"performance-metric-grid","card-class":"detail-card"},null,8,["cards"]),l("section",ZE,[l("article",e3,[l("header",null,[l("div",null,[a[222]||(a[222]=l("span",null,"队列拆分",-1)),l("h2",null,p(Bo.value)+" 个任务",1)])]),l("dl",null,[(m(!0),y(Q,null,re(x_.value,x=>(m(),y("div",{key:x.label},[l("dt",null,p(x.label),1),l("dd",null,p(x.value),1)]))),128))])]),l("article",t3,[l("header",null,[l("div",null,[a[223]||(a[223]=l("span",null,"存储拆分",-1)),l("h2",null,p(se(go)(((ke=J.value)==null?void 0:ke.storage.total_bytes)??0)),1)])]),l("dl",null,[(m(!0),y(Q,null,re(A_.value,x=>(m(),y("div",{key:x.label},[l("dt",null,p(x.label),1),l("dd",null,p(x.value),1)]))),128))])]),l("article",a3,[l("header",null,[l("div",null,[a[224]||(a[224]=l("span",null,"接口状态",-1)),l("h2",null,p(yn.value?"异常":"可读"),1)])]),l("dl",null,[l("div",null,[a[225]||(a[225]=l("dt",null,"Dashboard",-1)),l("dd",null,p(yn.value?"失败":"正常"),1)]),l("div",null,[a[226]||(a[226]=l("dt",null,"Jobs",-1)),l("dd",null,p(ka.value?"失败":"正常"),1)]),l("div",null,[a[227]||(a[227]=l("dt",null,"Logs",-1)),l("dd",null,p(No.value?"失败":"正常"),1)])])])])])),We(zg,{open:!!(Ro.value&&Ks.value==="generation"&&Pa.value&&Ca(Pa.value)),title:Pa.value?Ga(Pa.value):"",src:Pa.value?Ca(Pa.value):"",onClose:ep},null,8,["open","title","src"]),We(se(d),{open:zl.value,title:Je.value.title,candidates:__.value,onClose:a[93]||(a[93]=x=>zl.value=!1),onPreview:Cu},null,8,["open","title","candidates"]),We(se(S),{open:mr.value,detail:sl.value,busy:Ka.value,"read-only":ou.value,error:Cl.value,"model-route-options":Zf.value,"default-model-routes":Xy.value,"image-fit":ev.value,onClose:lw,onPreview:ow,onDecide:rw,onRegenerate:iw,onApprove:sw},null,8,["open","detail","busy","read-only","error","model-route-options","default-model-routes","image-fit"]),We(se(B),{open:Ls.value,"node-title":((Ze=ul.value)==null?void 0:Ze.node_title)||Je.value.title,"branch-name":((At=ul.value)==null?void 0:At.branch_name)||((la=sa.value)==null?void 0:la.current_branch)||"main","round-label":c_.value,materials:s_.value,categories:Lt.value,"selected-material-ids":u_.value,writable:Wd.value,"can-create-branch":d_.value,loading:qs.value||Il.value,saving:Ds.value,uploading:Nt.value&&!!eo.value,"lock-message":Ud.value,error:ha.value,message:gr.value,onClose:Kb,onRefresh:Vb,onSave:Vv,onUpload:Gb,onCreateBranch:zb},null,8,["open","node-title","branch-name","round-label","materials","categories","selected-material-ids","writable","can-create-branch","loading","saving","uploading","lock-message","error","message"]),In.value?(m(),Ct(CC,{key:10,mode:In.value,categories:Lt.value,material:zi.value,"profile-id":((za=Ee.value)==null?void 0:za.profileId)??"","profile-name":((bt=Ee.value)==null?void 0:bt.name)??"","default-category-id":gy.value,busy:Nt.value,error:Ft.value,"asset-pack-plan":Co.value,onClose:a[94]||(a[94]=x=>ea("materialOperation")),onUpload:oh,onRegister:rh,onPlanAssetPack:sh,onExecuteAssetPack:uh,onImportWardrobe:dh},null,8,["mode","categories","material","profile-id","profile-name","default-category-id","busy","error","asset-pack-plan"])):H("",!0),We(V0,{open:!!Nn.value,title:((Ha=Nn.value)==null?void 0:Ha.title)??"",detail:((xa=Nn.value)==null?void 0:xa.detail)??"","confirm-label":((da=Nn.value)==null?void 0:da.confirmLabel)??"确认",busy:!!(Nn.value&&En.value===Nn.value.id),danger:!0,onConfirm:vh,onCancel:fh},null,8,["open","title","detail","confirm-label","busy"])])],14,UI)}}});b0(i3).mount("#app");export{Qt as $,k3 as A,y3 as B,f3 as C,d3 as D,xI as E,Q as F,ca as G,g3 as H,zg as I,m3 as J,Ct as K,Ts as L,p3 as M,v3 as N,c3 as O,_3 as P,b3 as Q,h3 as R,w3 as S,Ya as T,Ni as U,ed as V,Ii as W,I1 as X,u3 as Y,ze as Z,Kr as _,l as a,jr as a0,H as b,y as c,Hn as d,xe as e,Kn as f,po as g,We as h,$ as i,M as j,N as k,ju as l,Ge as m,fe as n,m as o,$e as p,ya as q,re as r,Pe as s,p as t,se as u,je as v,ct as w,ra as x,Xa as y,Ns as z};
|