astrbot_plugin_imagestudio/web/assets/index-D3hLsIA0.js

58 行
660 KiB
JavaScript

var Tw=Object.defineProperty;var qw=(e,n,o)=>n in e?Tw(e,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):e[n]=o;var mc=(e,n,o)=>qw(e,typeof n!="symbol"?n+"":n,o);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))r(d);new MutationObserver(d=>{for(const v of d)if(v.type==="childList")for(const p of v.addedNodes)p.tagName==="LINK"&&p.rel==="modulepreload"&&r(p)}).observe(document,{childList:!0,subtree:!0});function o(d){const v={};return d.integrity&&(v.integrity=d.integrity),d.referrerPolicy&&(v.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?v.credentials="include":d.crossOrigin==="anonymous"?v.credentials="omit":v.credentials="same-origin",v}function r(d){if(d.ep)return;d.ep=!0;const v=o(d);fetch(d.href,v)}})();/**
* @vue/shared v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function nv(e){const n=Object.create(null);for(const o of e.split(","))n[o]=1;return o=>o in n}const zt={},gr=[],zn=()=>{},km=()=>!1,ju=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Vu=e=>e.startsWith("onUpdate:"),Pa=Object.assign,ov=(e,n)=>{const o=e.indexOf(n);o>-1&&e.splice(o,1)},Ow=Object.prototype.hasOwnProperty,Dt=(e,n)=>Ow.call(e,n),at=Array.isArray,yr=e=>ws(e)==="[object Map]",Ir=e=>ws(e)==="[object Set]",Ap=e=>ws(e)==="[object Date]",_t=e=>typeof e=="function",ua=e=>typeof e=="string",yn=e=>typeof e=="symbol",Wt=e=>e!==null&&typeof e=="object",hm=e=>(Wt(e)||_t(e))&&_t(e.then)&&_t(e.catch),$m=Object.prototype.toString,ws=e=>$m.call(e),Dw=e=>ws(e).slice(8,-1),Cm=e=>ws(e)==="[object Object]",iv=e=>ua(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,os=nv(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ku=e=>{const n=Object.create(null);return(o=>n[o]||(n[o]=e(o)))},Ww=/-\w/g,mn=Ku(e=>e.replace(Ww,n=>n.slice(1).toUpperCase())),Uw=/\B([A-Z])/g,si=Ku(e=>e.replace(Uw,"-$1").toLowerCase()),Sm=Ku(e=>e.charAt(0).toUpperCase()+e.slice(1)),gc=Ku(e=>e?`on${Sm(e)}`:""),Gn=(e,n)=>!Object.is(e,n),Su=(e,...n)=>{for(let o=0;o<e.length;o++)e[o](...n)},Im=(e,n,o,r=!1)=>{Object.defineProperty(e,n,{configurable:!0,enumerable:!1,writable:r,value:o})},Gu=e=>{const n=parseFloat(e);return isNaN(n)?e:n},Fw=e=>{const n=ua(e)?Number(e):NaN;return isNaN(n)?e:n};let Mp;const zu=()=>Mp||(Mp=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function ga(e){if(at(e)){const n={};for(let o=0;o<e.length;o++){const r=e[o],d=ua(r)?Gw(r):ga(r);if(d)for(const v in d)n[v]=d[v]}return n}else if(ua(e)||Wt(e))return e}const jw=/;(?![^(]*\))/g,Vw=/:([^]+)/,Kw=/\/\*[^]*?\*\//g;function Gw(e){const n={};return e.replace(Kw,"").split(jw).forEach(o=>{if(o){const r=o.split(Vw);r.length>1&&(n[r[0].trim()]=r[1].trim())}}),n}function de(e){let n="";if(ua(e))n=e;else if(at(e))for(let o=0;o<e.length;o++){const r=de(e[o]);r&&(n+=r+" ")}else if(Wt(e))for(const o in e)e[o]&&(n+=o+" ");return n.trim()}const zw="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Hw=nv(zw);function Pm(e){return!!e||e===""}function Qw(e,n){if(e.length!==n.length)return!1;let o=!0;for(let r=0;o&&r<e.length;r++)o=oi(e[r],n[r]);return o}function oi(e,n){if(e===n)return!0;let o=Ap(e),r=Ap(n);if(o||r)return o&&r?e.getTime()===n.getTime():!1;if(o=yn(e),r=yn(n),o||r)return e===n;if(o=at(e),r=at(n),o||r)return o&&r?Qw(e,n):!1;if(o=Wt(e),r=Wt(n),o||r){if(!o||!r)return!1;const d=Object.keys(e).length,v=Object.keys(n).length;if(d!==v)return!1;for(const p in e){const y=e.hasOwnProperty(p),b=n.hasOwnProperty(p);if(y&&!b||!y&&b||!oi(e[p],n[p]))return!1}}return String(e)===String(n)}function rv(e,n){return e.findIndex(o=>oi(o,n))}const xm=e=>!!(e&&e.__v_isRef===!0),s=e=>ua(e)?e:e==null?"":at(e)||Wt(e)&&(e.toString===$m||!_t(e.toString))?xm(e)?s(e.value):JSON.stringify(e,Am,2):String(e),Am=(e,n)=>xm(n)?Am(e,n.value):yr(n)?{[`Map(${n.size})`]:[...n.entries()].reduce((o,[r,d],v)=>(o[yc(r,v)+" =>"]=d,o),{})}:Ir(n)?{[`Set(${n.size})`]:[...n.values()].map(o=>yc(o))}:yn(n)?yc(n):Wt(n)&&!at(n)&&!Cm(n)?String(n):n,yc=(e,n="")=>{var o;return yn(e)?`Symbol(${(o=e.description)!=null?o:n})`:e};/**
* @vue/reactivity v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Va;class Jw{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&&Va&&(Va.active?(this.parent=Va,this.index=(Va.scopes||(Va.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=Va;try{return Va=this,n()}finally{Va=o}}}on(){++this._on===1&&(this.prevScope=Va,Va=this)}off(){if(this._on>0&&--this._on===0){if(Va===this)Va=this.prevScope;else{let n=Va;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,r;for(o=0,r=this.effects.length;o<r;o++)this.effects[o].stop();for(this.effects.length=0,o=0,r=this.cleanups.length;o<r;o++)this.cleanups[o]();if(this.cleanups.length=0,this.scopes){for(o=0,r=this.scopes.length;o<r;o++)this.scopes[o].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!n){const d=this.parent.scopes.pop();d&&d!==this&&(this.parent.scopes[this.index]=d,d.index=this.index)}this.parent=void 0}}}function Yw(){return Va}let Xt;const bc=new WeakSet;class Mm{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,Va&&(Va.active?Va.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,bc.has(this)&&(bc.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||Bm(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Rp(this),Em(this);const n=Xt,o=gn;Xt=this,gn=!0;try{return this.fn()}finally{Nm(this),Xt=n,gn=o,this.flags&=-3}}stop(){if(this.flags&1){for(let n=this.deps;n;n=n.nextDep)dv(n);this.deps=this.depsTail=void 0,Rp(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?bc.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Dc(this)&&this.run()}get dirty(){return Dc(this)}}let Rm=0,is,rs;function Bm(e,n=!1){if(e.flags|=8,n){e.next=rs,rs=e;return}e.next=is,is=e}function sv(){Rm++}function uv(){if(--Rm>0)return;if(rs){let n=rs;for(rs=void 0;n;){const o=n.next;n.next=void 0,n.flags&=-9,n=o}}let e;for(;is;){let n=is;for(is=void 0;n;){const o=n.next;if(n.next=void 0,n.flags&=-9,n.flags&1)try{n.trigger()}catch(r){e||(e=r)}n=o}}if(e)throw e}function Em(e){for(let n=e.deps;n;n=n.nextDep)n.version=-1,n.prevActiveLink=n.dep.activeLink,n.dep.activeLink=n}function Nm(e){let n,o=e.depsTail,r=o;for(;r;){const d=r.prevDep;r.version===-1?(r===o&&(o=d),dv(r),Xw(r)):n=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=d}e.deps=n,e.depsTail=o}function Dc(e){for(let n=e.deps;n;n=n.nextDep)if(n.dep.version!==n.version||n.dep.computed&&(Lm(n.dep.computed)||n.dep.version!==n.version))return!0;return!!e._dirty}function Lm(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===vs)||(e.globalVersion=vs,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Dc(e))))return;e.flags|=2;const n=e.dep,o=Xt,r=gn;Xt=e,gn=!0;try{Em(e);const d=e.fn(e._value);(n.version===0||Gn(d,e._value))&&(e.flags|=128,e._value=d,n.version++)}catch(d){throw n.version++,d}finally{Xt=o,gn=r,Nm(e),e.flags&=-3}}function dv(e,n=!1){const{dep:o,prevSub:r,nextSub:d}=e;if(r&&(r.nextSub=d,e.prevSub=void 0),d&&(d.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let v=o.computed.deps;v;v=v.nextDep)dv(v,!0)}!n&&!--o.sc&&o.map&&o.map.delete(o.key)}function Xw(e){const{prevDep:n,nextDep:o}=e;n&&(n.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=n,e.nextDep=void 0)}let gn=!0;const Tm=[];function Hn(){Tm.push(gn),gn=!1}function Qn(){const e=Tm.pop();gn=e===void 0?!0:
* @vue/runtime-core v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function ks(e,n,o,r){try{return r?e(...r):e()}catch(d){Qu(d,n,o)}}function Zl(e,n,o,r){if(_t(e)){const d=ks(e,n,o,r);return d&&hm(d)&&d.catch(v=>{Qu(v,n,o)}),d}if(at(e)){const d=[];for(let v=0;v<e.length;v++)d.push(Zl(e[v],n,o,r));return d}}function Qu(e,n,o,r=!0){const d=n?n.vnode:null,{errorHandler:v,throwUnhandledErrorInProduction:p}=n&&n.appContext.config||zt;if(n){let y=n.parent;const b=n.proxy,h=`https://vuejs.org/error-reference/#runtime-${o}`;for(;y;){const w=y.ec;if(w){for(let C=0;C<w.length;C++)if(w[C](e,b,h)===!1)return}y=y.parent}if(v){Hn(),ks(v,null,10,[e,b,h]),Qn();return}}Ck(e,o,d,r,p)}function Ck(e,n,o,r=!0,d=!1){if(d)throw e;console.error(e)}const il=[];let jn=-1;const br=[];let li=null,mr=0;const Km=Promise.resolve();let Eu=null;function sa(e){const n=Eu||Km;return e?n.then(this?e.bind(this):e):n}function Sk(e){let n=jn+1,o=il.length;for(;n<o;){const r=n+o>>>1,d=il[r],v=ps(d);v<e||v===e&&d.flags&2?n=r+1:o=r}return n}function gv(e){if(!(e.flags&1)){const n=ps(e),o=il[il.length-1];!o||!(e.flags&2)&&n>=ps(o)?il.push(e):il.splice(Sk(n),0,e),e.flags|=1,Gm()}}function Gm(){Eu||(Eu=Km.then(Hm))}function Ik(e){at(e)?br.push(...e):li&&e.id===-1?li.splice(mr+1,0,e):e.flags&1||(br.push(e),e.flags|=1),Gm()}function Ep(e,n,o=jn+1){for(;o<il.length;o++){const r=il[o];if(r&&r.flags&2){if(e&&r.id!==e.uid)continue;il.splice(o,1),o--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function zm(e){if(br.length){const n=[...new Set(br)].sort((o,r)=>ps(o)-ps(r));if(br.length=0,li){li.push(...n);return}for(li=n,mr=0;mr<li.length;mr++){const o=li[mr];o.flags&4&&(o.flags&=-2),o.flags&8||o(),o.flags&=-2}li=null,mr=0}}const ps=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Hm(e){try{for(jn=0;jn<il.length;jn++){const n=il[jn];n&&!(n.flags&8)&&(n.flags&4&&(n.flags&=-2),ks(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2))}}finally{for(;jn<il.length;jn++){const n=il[jn];n&&(n.flags&=-2)}jn=-1,il.length=0,zm(),Eu=null,(il.length||br.length)&&Hm()}}let Ya=null,Qm=null;function Nu(e){const n=Ya;return Ya=e,Qm=e&&e.type.__scopeId||null,n}function ta(e,n=Ya,o){if(!n||e._n)return e;const r=(...d)=>{r._d&&qu(-1);const v=Nu(n);let p;try{p=e(...d)}finally{Nu(v),r._d&&qu(1)}return p};return r._n=!0,r._c=!0,r._d=!0,r}function Ie(e,n){if(Ya===null)return e;const o=td(Ya),r=e.dirs||(e.dirs=[]);for(let d=0;d<n.length;d++){let[v,p,y,b=zt]=n[d];v&&(_t(v)&&(v={mounted:v,updated:v}),v.deep&&yo(p),r.push({dir:v,instance:o,value:p,oldValue:void 0,arg:y,modifiers:b}))}return e}function Bi(e,n,o,r){const d=e.dirs,v=n&&n.dirs;for(let p=0;p<d.length;p++){const y=d[p];v&&(y.oldValue=v[p].value);let b=y.dir[r];b&&(Hn(),Zl(b,o,8,[e.el,y,e,n]),Qn())}}function Pk(e,n){if(rl){let o=rl.provides;const r=rl.parent&&rl.parent.provides;r===o&&(o=rl.provides=Object.create(r)),o[e]=n}}function Iu(e,n,o=!1){const r=ed();if(r||wr){let d=wr?wr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(d&&e in d)return d[e];if(arguments.length>1)return o&&_t(n)?n.call(r&&r.proxy):n}}const xk=Symbol.for("v-scx"),Ak=()=>Iu(xk);function dt(e,n,o){return Jm(e,n,o)}function Jm(e,n,o=zt){const{immediate:r,deep:d,flush:v,once:p}=o,y=Pa({},o),b=n&&r||!n&&v!=="post";let h;if(bs){if(v==="sync"){const P=Ak();h=P.__watcherHandles||(P.__watcherHandles=[])}else if(!b){const P=()=>{};return P.stop=zn,P.resume=zn,P.pause=zn,P}}const w=rl;y.call=(P,N,L)=>Zl(P,w,N,L);let C=!1;v==="post"?y.scheduler=P=>{_l(P,w&&w.suspense)}:v!=="sync"&&(C=!0,y.scheduler=(P,N)=>{N?P():gv(P)}),y.augmentJob=P=>{n&&(P.flags|=4),C&&(P.flags|=2,w&&(P.id=w.uid,P.i=w))};const M=$k(e,n,y);return bs&&(h?h.push(M):b&&M()),M}function Mk(e,n,o){const r=this.proxy,d=ua(e)?e.includes(".")?Ym(r,e):()=>r[e]:e.bind(r,r);let v;_t(n)?v=n:(v=n.handler,o=n);const p=hs(this),y=Jm(d,v.bind(r),o);return p(),y}function Ym(e,n){const o=n.split(".");return()=>{let r=e;for(let d=0;d<o.length&&r;d++)r=r[o[d]];return r}}const Rk=Symbol("_vte"),Xm=e=>e.__isTeleport,Ql=Symbol("_leaveCb"),Yr=Symbol("_enterCb");function Zm(){const e={isMounted:!1,isLeaving:!1,isUnmounting:!1,leavingV
* @vue/runtime-dom v3.5.39
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let Qc;const Hp=typeof window<"u"&&window.trustedTypes;if(Hp)try{Qc=Hp.createPolicy("vue",{createHTML:e=>e})}catch{}const Mg=Qc?e=>Qc.createHTML(e):e=>e,Rh="http://www.w3.org/2000/svg",Bh="http://www.w3.org/1998/Math/MathML",fo=typeof document<"u"?document:null,Qp=fo&&fo.createElement("template"),Eh={insert:(e,n,o)=>{n.insertBefore(e,o||null)},remove:e=>{const n=e.parentNode;n&&n.removeChild(e)},createElement:(e,n,o,r)=>{const d=n==="svg"?fo.createElementNS(Rh,e):n==="mathml"?fo.createElementNS(Bh,e):o?fo.createElement(e,{is:o}):fo.createElement(e);return e==="select"&&r&&r.multiple!=null&&d.setAttribute("multiple",r.multiple),d},createText:e=>fo.createTextNode(e),createComment:e=>fo.createComment(e),setText:(e,n)=>{e.nodeValue=n},setElementText:(e,n)=>{e.textContent=n},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>fo.querySelector(e),setScopeId(e,n){e.setAttribute(n,"")},insertStaticContent(e,n,o,r,d,v){const p=o?o.previousSibling:n.lastChild;if(d&&(d===v||d.nextSibling))for(;n.insertBefore(d.cloneNode(!0),o),!(d===v||!(d=d.nextSibling)););else{Qp.innerHTML=Mg(r==="svg"?`<svg>${e}</svg>`:r==="mathml"?`<math>${e}</math>`:e);const y=Qp.content;if(r==="svg"||r==="mathml"){const b=y.firstChild;for(;b.firstChild;)y.appendChild(b.firstChild);y.removeChild(b)}n.insertBefore(y,o)}return[p?p.nextSibling:n.firstChild,o?o.previousSibling:n.lastChild]}},Zo="transition",Xr="animation",$r=Symbol("_vtc"),Rg={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},Bg=Pa({},eg,Rg),Nh=e=>(e.displayName="Transition",e.props=Bg,e),Ba=Nh((e,{slots:n})=>Ah(Ek,Eg(e),n)),Ni=(e,n=[])=>{at(e)?e.forEach(o=>o(...n)):e&&e(...n)},Jp=e=>e?at(e)?e.some(n=>n.length>1):e.length>1:!1;function Eg(e){const n={};for(const V in e)V in Rg||(n[V]=e[V]);if(e.css===!1)return n;const{name:o="v",type:r,duration:d,enterFromClass:v=`${o}-enter-from`,enterActiveClass:p=`${o}-enter-active`,enterToClass:y=`${o}-enter-to`,appearFromClass:b=v,appearActiveClass:h=p,appearToClass:w=y,leaveFromClass:C=`${o}-leave-from`,leaveActiveClass:M=`${o}-leave-active`,leaveToClass:P=`${o}-leave-to`}=e,N=Lh(d),L=N&&N[0],H=N&&N[1],{onBeforeEnter:G,onEnter:Q,onEnterCancelled:ee,onLeave:ve,onLeaveCancelled:ne,onBeforeAppear:ge=G,onAppear:Z=Q,onAppearCancelled:O=ee}=n,E=(V,ye,te,ae)=>{V._enterCancelled=ae,ti(V,ye?w:y),ti(V,ye?h:p),te&&te()},k=(V,ye)=>{V._isLeaving=!1,ti(V,C),ti(V,P),ti(V,M),ye&&ye()},F=V=>(ye,te)=>{const ae=V?Z:Q,z=()=>E(ye,V,te);Ni(ae,[ye,z]),Yp(()=>{ti(ye,V?b:v),Fn(ye,V?w:y),Jp(ae)||Xp(ye,r,L,z)})};return Pa(n,{onBeforeEnter(V){Ni(G,[V]),Fn(V,v),Fn(V,p)},onBeforeAppear(V){Ni(ge,[V]),Fn(V,b),Fn(V,h)},onEnter:F(!1),onAppear:F(!0),onLeave(V,ye){V._isLeaving=!0;const te=()=>k(V,ye);Fn(V,C),V._enterCancelled?(Fn(V,M),Jc(V)):(Jc(V),Fn(V,M)),Yp(()=>{V._isLeaving&&(ti(V,C),Fn(V,P),Jp(ve)||Xp(V,r,H,te))}),Ni(ve,[V,te])},onEnterCancelled(V){E(V,!1,void 0,!0),Ni(ee,[V])},onAppearCancelled(V){E(V,!0,void 0,!0),Ni(O,[V])},onLeaveCancelled(V){k(V),Ni(ne,[V])}})}function Lh(e){if(e==null)return null;if(Wt(e))return[Cc(e.enter),Cc(e.leave)];{const n=Cc(e);return[n,n]}}function Cc(e){return Fw(e)}function Fn(e,n){n.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[$r]||(e[$r]=new Set)).add(n)}function ti(e,n){n.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[$r];o&&(o.delete(n),o.size||(e[$r]=void 0))}function Yp(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let Th=0;function Xp(e,n,o,r){const d=e._endId=++Th,v=()=>{d===e._endId&&r()};if(o!=null)return setTimeout(v,o);const{type:p,timeout:y,propCount:b}=Ng(e,n);if(!p)return r();const h=p+"end";let w=0;const C=()=>{e.removeEventListener(h,M),v()},M=P=>{P.target===e&&++w>=b&&C()};setTimeout(()=>{w<b&&C()},y+1),e.addEventListener(h,M)}function Ng(e,n){const o=window.getComputedStyle(e),r=N=>(o[N]||"").split(", "),d=r(`${Zo}Delay`),v=r(`${Zo}Duration`),p=Zp(d,v
`)}function p(M,P){const N=Array.from(new Set(P.replace(/,/g,",").split(/[\n,]/).map(L=>L.trim()).filter(Boolean)));r("update:modelValue",{...o.modelValue,[M]:N})}function y(M,P){r("update:modelValue",{...o.modelValue,[M]:P})}const b=A(()=>d("group_allowlist").length),h=A(()=>d("user_allowlist").length),w=A(()=>d("adult_group_allowlist").length),C=A(()=>d("adult_user_allowlist").length);return(M,P)=>(u(),c("section",uA,[P[24]||(P[24]=wv('<div class="intro" data-v-8371303e><span data-v-8371303e>AstrBot 聊天指令</span><strong data-v-8371303e>群聊与用户白名单</strong><p data-v-8371303e>每行填写一个平台提供的群聊 ID 或用户 ID,也支持用逗号分隔。白名单为空时不会放行对应条件。</p></div><div class="rules" data-v-8371303e><article data-v-8371303e><b data-v-8371303e>快速角色 / 角色工作流</b><strong data-v-8371303e>群聊命中 + 用户命中</strong><p data-v-8371303e>两个白名单必须同时命中才允许使用,避免群内未授权成员启动完整工作流。</p></article><article data-v-8371303e><b data-v-8371303e>单图生成</b><strong data-v-8371303e>群聊命中 或 用户命中</strong><p data-v-8371303e>任意一个白名单命中即可使用;用户白名单也可以在私聊中放行单图。</p></article></div>',2)),t("div",dA,[t("label",null,[t("span",null,[P[10]||(P[10]=rt("群聊白名单 ",-1)),t("em",null,s(b.value)+" 项",1)]),t("textarea",{value:v("group_allowlist"),disabled:e.disabled,rows:"10",placeholder:`每行一个群聊 ID
例如:123456789`,onInput:P[0]||(P[0]=N=>p("group_allowlist",N.target.value))},null,40,cA),P[11]||(P[11]=t("small",null,"用于判断命令所在群聊是否获得授权。",-1))]),t("label",null,[t("span",null,[P[12]||(P[12]=rt("用户白名单 ",-1)),t("em",null,s(h.value)+" 项",1)]),t("textarea",{value:v("user_allowlist"),disabled:e.disabled,rows:"10",placeholder:`每行一个用户 ID
例如:987654321`,onInput:P[1]||(P[1]=N=>p("user_allowlist",N.target.value))},null,40,vA),P[13]||(P[13]=t("small",null,"使用 AstrBot 事件返回的平台用户 ID,不使用昵称。",-1))])]),P[25]||(P[25]=t("div",{class:"adult-intro"},[t("div",null,[t("span",null,"成人内容独立授权"),t("strong",null,"必须同时通过内容审核与成人白名单")]),t("p",null,"这些名单不会放宽恐怖主义、高危暴力、现实伤害或其他禁止内容。群聊内要求成人群聊与成人用户同时命中;私聊要求成人用户命中。")],-1)),t("div",fA,[t("label",null,[t("span",null,[P[14]||(P[14]=rt("成人内容群聊白名单 ",-1)),t("em",null,s(w.value)+" 项",1)]),t("textarea",{value:v("adult_group_allowlist"),disabled:e.disabled,rows:"6",placeholder:"每行一个允许成人路由的群聊 ID",onInput:P[2]||(P[2]=N=>p("adult_group_allowlist",N.target.value))},null,40,pA),P[15]||(P[15]=t("small",null,"仅影响通过审核的 adult_allowed 内容。",-1))]),t("label",null,[t("span",null,[P[16]||(P[16]=rt("成人内容用户白名单 ",-1)),t("em",null,s(C.value)+" 项",1)]),t("textarea",{value:v("adult_user_allowlist"),disabled:e.disabled,rows:"6",placeholder:"每行一个允许成人路由的用户 ID",onInput:P[3]||(P[3]=N=>p("adult_user_allowlist",N.target.value))},null,40,mA),P[17]||(P[17]=t("small",null,"不会继承普通用户白名单,必须单独授权。",-1))])]),t("div",gA,[t("label",null,[P[18]||(P[18]=t("span",null,"用户并发上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.user_concurrency_limit||2),disabled:e.disabled,onInput:P[4]||(P[4]=N=>y("user_concurrency_limit",Number(N.target.value)))},null,40,yA)]),t("label",null,[P[19]||(P[19]=t("span",null,"群聊并发上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.group_concurrency_limit||5),disabled:e.disabled,onInput:P[5]||(P[5]=N=>y("group_concurrency_limit",Number(N.target.value)))},null,40,bA)]),t("label",null,[P[20]||(P[20]=t("span",null,"用户每日生成上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.daily_user_generation_limit||30),disabled:e.disabled,onInput:P[6]||(P[6]=N=>y("daily_user_generation_limit",Number(N.target.value)))},null,40,_A)]),t("label",null,[P[21]||(P[21]=t("span",null,"群聊每日生成上限",-1)),t("input",{type:"number",min:"1",value:Number(e.modelValue.daily_group_generation_limit||100),disabled:e.disabled,onInput:P[7]||(P[7]=N=>y("daily_group_generation_limit",Number(N.target.value)))},null,40,wA)]),t("label",kA,[t("input",{type:"checkbox",checked:e.modelValue.allow_2k!==!1,disabled:e.disabled,onChange:P[8]||(P[8]=N=>y("allow_2k",N.target.checked))},null,40,hA),P[22]||(P[22]=t("span",null,"允许聊天使用 2K",-1))]),t("label",$A,[t("input",{type:"checkbox",checked:e.modelValue.allow_4k===!0,disabled:e.disabled,onChange:P[9]||(P[9]=N=>y("allow_4k",N.target.checked))},null,40,CA),P[23]||(P[23]=t("span",null,"允许聊天使用 4K",-1))])])]))}}),IA=Lt(SA,[["__scopeId","data-v-8371303e"]]),PA={class:"governance"},xA={class:"preview-card"},AA=["disabled"],MA={class:"preview-choice"},RA={key:1,class:"preview-error"},BA={key:2,class:"preview-result"},EA={class:"card"},NA={class:"switch"},LA=["checked","disabled"],TA={class:"route-pair source-pair"},qA=["value","disabled"],OA=["value"],DA=["value"],WA=["value","disabled"],UA=["value"],FA=["value"],jA={class:"grid"},VA=["value","disabled"],KA={class:"entries"},GA=["checked","disabled","onChange"],zA={class:"card"},HA={class:"switch"},QA=["checked","disabled"],JA={class:"route-pair source-pair"},YA=["value","disabled"],XA=["value"],ZA=["value"],eM=["value","disabled"],tM=["value"],aM=["value"],lM={class:"grid"},nM=["value","disabled"],oM={class:"card routing"},iM={class:"switch"},rM=["checked","disabled"],sM={class:"route-pair"},uM=["value","disabled"],dM=["value"],cM=["value","disabled"],vM=["value"],fM={class:"entries"},pM=["checked","disabled","onChange"],mM={class:"card"},gM={class:"switch"},yM=["checked","disabled"],bM={class:"route-pair source-pair"},_M=["value","disabled
`)}function nc(a){const l=kt.value,i=Ye.value;return{source:"standalone_web_workflow_chat",ui_node_id:lt.value,ui_node_title:l.title,ui_node_phase:l.phase,ui_node_status:l.status,profile_id:i.profileId,profile_name:i.name,workflow_id:i.workflowId,source_language:"auto",target_prompt_language:"en",translation_mode:"backend_llm",user_instruction:a,persona_split_fields_ready:Hs.value,persona_split_fields_total:zs.value,selected_material_ids:Kd(),selected_draft_image_ids:Pl.value.filter(Al).map(f=>f.image_id),candidate_feedback:va.value}}function J_(a){var m;const l=a.interpretation;if(!l)return"候选反馈已保存。";const i=[],f=[["喜欢",l.liked],["拒绝",l.rejected],["严格拒绝",l.strict_rejected]];for(const[g,$]of f)$.length&&i.push(`${g} ${$.map(T=>T.display_code).join("、")}`);return(m=l.final)!=null&&m.display_code&&i.push(`待定稿 ${l.final.display_code}`),l.positive_patch&&i.push("已生成正向调整"),l.negative_patch&&i.push("已生成负向约束"),l.material_intent&&i.push(`素材意图:${l.material_intent}`),i.length?i.join(";"):"下一轮调整要求已保存。"}async function Uf(a){var i,f,m;const l=It.value;if(!Sa.value||!l||l.legacy||!l.candidates.length)return"not_applicable";if(Ks.value)return Re.value="该轮次已经确认;如需继续修改,请先从当前节点创建分支。","blocked";nt.value=!0,Re.value="",oa.value="";try{const g=await Ae(W.roundFeedback(l.round.round_id),{feedback_text:a,idempotency_key:`web-round-feedback-text-${l.round.round_id}-${Date.now()}`});zo(l.round.node_id,g);const $=J_(g);return oa.value=`${$} 点击“开始新一轮”后会使用这些反馈。`,Ve.value=$,$o.value=a,Co.value=(f=(i=g.interpretation)==null?void 0:i.metadata)!=null&&f.model_route?`候选反馈 / ${String(g.interpretation.metadata.model_route)}`:`候选反馈 / ${((m=g.interpretation)==null?void 0:m.source)||"确定性解释"}`,ha.value="","saved"}catch(g){return Re.value=`候选反馈理解失败:${ze(g)}`,Ve.value=Re.value,"failed"}finally{nt.value=!1}}async function Y_(){const a=ha.value.trim();if(!a||nt.value||await Uf(a)!=="not_applicable")return;if(Sa.value&&!Uo.value.route){Ve.value="当前节点和后端默认均未提供生图路由,请先显式覆盖或前往设置配置。";return}await fu({promptPatch:lc(a),metadata:nc(a)})&&($o.value=a,Co.value=`${kt.value.title} / ${Cd.value||"后端自动"}`)}function Ff(){!Wa.value||!qa(Wa.value)||(Rs.value="generation",Ml("imageViewer"),ic(),Ao.value=!0)}function cu(a){const l=(a?Bd.value.find(i=>i.image_id===a):null)??En.value;!l||!qa(l)||(Oa.value=!1,wt.value=l.image_id,Ff())}function jf(){Pl.value.length<2||(Oa.value=!0)}function X_(a){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:"当前节点已锁定或工作流已封存,请先创建可编辑分支"}[a]||a.replace(/_/g," ")}function vu(a,l){const i=ze(a),f=a instanceof Qa?Ue(a.details,"required_action"):"";return f?`${i};建议操作:${X_(f)}。`:`${l}:${i}`}async function Z_(){var i;const a=It.value;if(!a||a.legacy||!Sa.value)return;const l=a.round.round_id;el.value=!0,Pn.value="";try{const f=await Be(W.round(l));if(((i=It.value)==null?void 0:i.round.round_id)!==l)return;zo(f.round.node_id,f,{select:!0}),rn.value=f,mi.value=!0}catch(f){Re.value=vu(f,"交叉审查轮次加载失败")}finally{el.value=!1}}function e1(){el.value||(mi.value=!1,Pn.value="")}function t1(a){var i;const l=(i=a.image)==null?void 0:i.image_id;l&&cu(l)}function oc(a){zo(a.round.node_id,a,{select:!0}),rn.val
${m.trim()}`).join(`
`)}function m1(a){const l=Mi(a),i=(...g)=>{for(const $ of g){const T=l.find(re=>ai(re.node_key)===$);if(T!=null&&T.selected_image_id)return T.selected_image_id}return""},f={avatar:i("headshot"),persona_image:i("design_sheet","turnaround"),standing:i("full_body"),pv:i("style_lock")},m=Object.entries(f).filter(([,g])=>!g).map(([g])=>g);if(m.length){const g={avatar:"头像(头像草稿)",persona_image:"人设图(设定图或三视图)",standing:"立绘(全身设定)",pv:"PV 图(高清修复与统一风格)"};return Ve.value=`档案卡还缺少已明确采用的资产:${m.map($=>g[$]).join("、")}。请回到对应节点确认一张候选图。`,null}return f}function g1(a){if(!(a instanceof Qa))return`档案卡封存失败:${ze(a)}`;const l=[],i=a.details.incomplete_node_keys;Array.isArray(i)&&i.length&&l.push(`未完成节点:${i.map(String).join("、")}`);const f=Ue(a.details,"asset_role");f&&l.push(`资产角色:${f}`);const m=Ue(a.details,"active_branch")||Ue(a.details,"branch_name");m&&l.push(`当前分支:${m}`);const g=Ue(a.details,"status");g&&l.push(`工作流状态:${g}`);const $=l.length?`(${l.join(";")})`:"";return`档案卡封存失败:${a.message}${$}`}async function y1(){const a=Ye.value;if(!a||nt.value)return;const l=ea("建立档案卡");if(l){Ve.value=l;return}if(!a.workflowId||!a.profileId){Ve.value="请先保存角色并创建详细角色工作流,再建立档案卡。";return}const i=a.workflowId,f=Mt.value[i],m=(f==null?void 0:f.current_branch)||"main",g=m1(i);if(!g)return;const $=p1(a);if(!$){Ve.value="档案卡缺少人设文档,请先完成角色设定拆解。";return}const T={idempotency_key:`web-profile-card-${i}-${au(m)}`,persona_document:$,assets:g,metadata:{source:"standalone_web_profile_card",schema_version:"character_profile_card_v1",profile_id:a.profileId,profile_name:a.name,workflow_id:i,branch_name:m,selected_material_ids:Kd()}};nt.value=!0,Ve.value="";try{const re=await Ae(W.workflowFinalizeCard(i),T);Ar.value={...Ar.value,[a.profileId]:[re,...(Ar.value[a.profileId]??[]).filter(Me=>Me.card_id!==re.card_id)]},Cn.value=re.created_at,await pu(a,i,"archive");const[fe]=await Promise.allSettled([Be(W.profileCards(a.profileId)),Od(),tl(),pl()]);fe.status==="fulfilled"&&(Ar.value={...Ar.value,[a.profileId]:fe.value}),Ln("archive"),Ve.value=`档案卡已原子封存:${yl(re.card_id)} / ${re.branch_name},4 类必填资产均已入库。`}catch(re){Ve.value=g1(re)}finally{nt.value=!1}}async function sc(a){const l=Ye.value,i=l==null?void 0:l.workflowId;if(!i||cl.value)return;const f=a==="start"?"启动":a==="cancel"?"取消":"归档";if(a==="start"&&!js.value){$a.value="请先在第一个节点导入粗略人设;导入成功后工作流会自动启动。";return}if(!(a!=="start"&&!window.confirm(`确定${f}当前工作流吗?`))){cl.value=!0,$a.value="";try{const m=a==="start"?W.workflowStart(i):a==="cancel"?W.workflowCancel(i):W.workflowArchive(i),g=await Ae(m);Mt.value={...Mt.value,[i]:g},$a.value=`工作流已${f}`}catch(m){$a.value=ze(m)}finally{cl.value=!1}}}async function b1(){var l;const a=(l=Ye.value)==null?void 0:l.workflowId;if(a){cl.value=!0;try{pi.value=await Be(W.workflowReview(a)),$a.value="整体审查已完成"}catch(i){$a.value=ze(i)}finally{cl.value=!1}}}async function Jf(){var i;const a=(i=vt.value)==null?void 0:i.node_id;if(!a)return;cl.value=!0;const l=await Zd(a,!0);$a.value=l?"依赖上下文已刷新":_.value,cl.value=!1}function Hr(a){return fl.value?`${a}暂不可用:${lo.value}`:Bn.value?`${a}已被锁定:${jo.value}`:""}function _1(a){return`branch_${(a.node_key||a.node_id).replace(/[^a-zA-Z0-9_-]+/g,"_").slice(0,28)}_${Date.now().toString(36)}`}async function Yf(a,l,i,f={}){const m=await Ae(W.workflowSwitchBranch(l),{branch_name:i}),g=await Be(W.workflowNodes(l)),$=g.filter(fe=>fe.branch_name===m.current_branch);Pt.value={...Pt.value,[l]:g},Mt.value={...Mt.value,[l]:m},Ai(a,m,$.length?$:g);const T=(f.copiedFromNodeId?$.find(fe=>Ue(fe.metadata,"copied_from_node_id")===f.copiedFromNodeId):void 0)??(f.preferredUiNodeId?$.
`)}}function mu(a,l,i,f,m){return{id:a,title:l,prompt:i,negative:f,weight_suggestions:[{label:"identity",value:1.25,reason:"keep character identity stable"},{label:"style",value:.85,reason:"avoid overfitting style over identity"}],inherits:m,status:"ready"}}function E1(a){const l=Il.value,i=v.map((f,m)=>{const g=l.find($=>$.category===f.category);return{id:`rule_${f.category}_${m+1}`,category:f.category,material_id:Vd(g==null?void 0:g.id),material_label:(g==null?void 0:g.label)??"",material_group:(g==null?void 0:g.group)??(g==null?void 0:g.category)??"",material_prompt:(g==null?void 0:g.prompt)??"",material_colors:(g==null?void 0:g.colors)??[],bind_to_stages:ep(f.category),inheritance_rule:g?`${f.category} only affects explicitly bound downstream stages.`:"do not use reference unless user explicitly selects one",reference_strength:g?tp(f.category):"弱",required:!!(g&&["风格","服装"].includes(f.category)),status:g?"ready":"pending"}});return{profile_id:a.profileId,profile_name:a.name,selected_material_ids:Kd(),rules:i}}function ep(a){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:"修复入库"}]}[a]??[{stage_id:"body-sheet",stage_title:"全身与设定图"}]}function tp(a){return a==="风格"||a==="服装"?"强":a==="构图"?"中":"弱"}async function N1(){var i;const a=Ye.value;if(!a||Yn.value)return;const l=ea("保存快照");if(l){$n.value=l;return}if(!a.workflowId){$n.value="请先生成档案并创建后端工作流,再保存快照。";return}Yn.value=!0,$n.value="";try{const f=await Ae(W.workflowHistory(a.workflowId),{action:"save_version",title:`${a.name} / ${((i=kt.value)==null?void 0:i.title)??"工作流快照"}`,node_id:Ho(lt.value,a),include_nodes:!0,metadata:{source:"standalone_web",ui_node_id:lt.value,profile_id:a.profileId,profile_name:a.name,profile_status:a.status}});Cn.value=f.created_at}catch(f){$n.value=`保存快照失败:${ze(f)}`}finally{Yn.value=!1}}function Ho(a,l){if(!l.workflowId)return;const f=Mi(l.workflowId).find(g=>fn(g)===a);if(f)return f.node_id;const m=l.workflowNodeIds??[];if(a!=="brief-import"&&a==="persona-split")return m[0]}function Mi(a){var f;const l=Pt.value[a]??[],i=(f=Mt.value[a])==null?void 0:f.current_branch;return i?l.filter(m=>m.branch_name===i):l}function L1(a){const l=Qs.value;if(l&&(!a||l.node_id===a))return[l.image_id];if(!a)return[];const i=(aa.value[a]??[]).find(f=>{var m;return f.image_id===((m=Rn.value.find(g=>g.node_id===a))==null?void 0:m.selected_image_id)});return i&&Al(i)?[i.image_id]:[]}function Al(a){const l="metadata"in a&&a.metadata&&typeof a.metadata=="object"?a.metadata:{},i=l.mock===!0||l.mock===1||l.mock==="true",f=Object.prototype.hasOwnProperty.call(l,"provider_error")&&l.provider_error!=null,m=l.fallback_used===!0||l.degraded===!0;return!i&&!f&&!m}async function T1(){if(!qv.value||on.value)return;const a=ea("生成档案");if(a){vi.value=a;return}Ki.value+=1;const l=U1(et.value,Ki.value);on.value=!0,vi.value="";try{const i=await Ae(W.quickProfileDraft,q1(l,et.value,jt.value)),f={...l,name:i.profile_preview.name||l.name,style:i.profile_preview.style_prompt||l.style,negative:i.profile_preview.negative_prompt||l.negative},m=await Ae(W.quickProfileDraftSave,O1(f,et.value,jt.value,i)),$={...D1(m,f),status:"文本档案已保存"};ul.value=[$,...ul.value.filter(T=>T.id!==$.id)],Vt.value=[m.profile,...Vt.value.filter(T=>T.profile_id!==m.profile.profile_id)],fa.value={...fa.value,[m.profile.profile_id]:m.workflow?[m.workflow]:[]},nu($),yt.value="quickProfile"
<svg xmlns="http://www.w3.org/2000/svg" width="${ht}" height="${je}" viewBox="0 0 ${ht} ${je}" preserveAspectRatio="xMidYMid meet">
<defs>
<linearGradient id="bg" x1="0" y1="0" x2="1" y2="1">
<stop offset="0%" stop-color="${g}" />
<stop offset="58%" stop-color="${$}" />
<stop offset="100%" stop-color="#111827" />
</linearGradient>
<radialGradient id="halo" cx="72%" cy="22%" r="55%">
<stop offset="0%" stop-color="${T}" stop-opacity="0.82" />
<stop offset="100%" stop-color="${T}" stop-opacity="0" />
</radialGradient>
<pattern id="grid" width="${Ot}" height="${Ot}" patternUnits="userSpaceOnUse">
<path d="M${Ot} 0H0V${Ot}" fill="none" stroke="#ffffff" stroke-opacity="0.13" stroke-width="2" />
</pattern>
</defs>
<rect width="${ht}" height="${je}" fill="url(#bg)" />
<rect width="${ht}" height="${je}" fill="url(#grid)" />
<circle cx="${qn}" cy="${Yo}" r="${On}" fill="url(#halo)" />
<circle cx="${Xo}" cy="${Dn}" r="${B}" fill="#ffffff" opacity="0.11" />
<rect x="${Jt}" y="${Jt}" width="${jl}" height="${ja}" rx="${ll}" fill="#ffffff" opacity="0.14" />
<rect x="${wa}" y="${wa}" width="${ml}" height="${Vl}" rx="${Math.round(ll*.72)}" fill="#0f172a" opacity="0.24" />
<text x="${wa+Math.round($t*.035)}" y="${Ia}" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${ka}" font-weight="700">IMAGESTUDIO · 未生成 ${re}</text>
<text x="${wa+Math.round($t*.035)}" y="${nl}" fill="#ffffff" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${D}" font-weight="800">${fe}</text>
<text x="${wa+Math.round($t*.035)}" y="${Ua}" fill="#ffffff" opacity="0.78" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${pt}">${Me}</text>
<text x="${De}" y="${Ia+Math.round($t*.02)}" text-anchor="middle" fill="#ffffff" opacity="0.86" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Fa}" font-weight="900">${re}</text>
<text x="${ht-Jt}" y="${je-Math.round(Jt*.35)}" text-anchor="end" fill="#ffffff" opacity="0.72" font-family="Inter, Microsoft YaHei, sans-serif" font-size="${Math.max(18,Math.round($t*.027))}" font-weight="800">${Oe}</text>
</svg>`;return`data:image/svg+xml;charset=UTF-8,${encodeURIComponent(Nt)}`}function Ip(a){return a.replace(/[&<>"']/g,l=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"})[l]??l)}function al(a){return"title"in a&&a.title?a.title:a.node_id||a.workflow_id||a.profile_id||yl(a.image_id)}function qa(a){return Fl(a.thumbnail_url)||Fl(a.image_url)}function Fl(a){const l=String(a||"").trim();if(!l)return"";const i=Pw(l);if(!i)return l;const f=pe.value[l];if(f)return f;if(!me.has(l)){const m=xw(l,i).finally(()=>{me.delete(l)});me.set(l,m)}return Cu()==="plugin-bridge"?"":l}function Pw(a){var l;try{const i=new URL(a,window.location.origin);return i.pathname.endsWith("/media/fetch")&&((l=i.searchParams.get("token"))==null?void 0:l.trim())||""}catch{return""}}async function xw(a,l){try{const i=await Be(W.mediaPayload,{token:l}),f=String(i.body_base64||"");if(!f)return;const m=f.replace(/-/g,"+").replace(/_/g,"/"),g=m.padEnd(Math.ceil(m.length/4)*4,"="),$=window.atob(g),T=new Uint8Array($.length);for(let fe=0;fe<$.length;fe+=1)T[fe]=$.charCodeAt(fe);const re=URL.createObjectURL(new Blob([T],{type:i.content_type||"application/octet-stream"}));xe.add(re),pe.value={...pe.value,[a]:re}}catch(i){console.warn("ImageStudio media bridge failed",i)}}function Aw(a){if(a.status==="confirmed_unsupported")return!1;if(a.dialect==="openai_images"||a.dialect==="comfyui")return!0;const l=a.capabilities||{};return!!(l.text_to_image||l.image_generation||l.workflow_graph||Object.keys(l).some(i=>["text_to_image","image_generation","workflow_graph"].includes(i)))}function Mw(a,l,i){return Math.max(l,Math.min(i,a))}function Rw(){try{const a=localStorage.getItem(Wl.theme);(a==="light"||a==="dark")&&(xn.value=a),Po.value=localStorage.getItem(Wl.primary)||Po.value,xo.value=localStorage.getItem(Wl.accent)||xo.value;const l=localStorage.getItem(Wl.navigationPinned);un.value=l===null||l==="true",ql.value=Pp(localStorage.getItem(Wl.readNotifications)),Qi.value=Pp(localStorage.getItem(Wl.dismissedNotifications))}catch{}zi.value=un.value}function Bw(){try{localStorage.setItem(Wl.theme,xn.value),localStorage.setItem(Wl.primary,Po.value),localStorage.setItem(Wl.accent,xo.value),localStorage.setItem(Wl.navigationPinned,String(un.value)),localStorage.setItem(Wl.readNotifications,JSON.stringify(ql.value)),localStorage.setItem(Wl.dismissedNotifications,JSON.stringify(Qi.value))}catch{}}function Pp(a){if(!a)return[];try{const l=JSON.parse(a);return Array.isArray(l)?l.filter(i=>typeof i=="string"):[]}catch{return[]}}function uo(a,l){const i=pc(a);return i?`rgba(${i.r}, ${i.g}, ${i.b}, ${l})`:`rgba(118, 104, 232, ${l})`}function vc(a,l,i){const f=pc(a),m=pc(l);if(!f||!m)return a;const g=Math.min(1,Math.max(0,i));return`#${fc(f.r*(1-g)+m.r*g)}${fc(f.g*(1-g)+m.g*g)}${fc(f.b*(1-g)+m.b*g)}`}function fc(a){return Math.round(a).toString(16).padStart(2,"0")}function pc(a){const l=a.replace("#","");return/^[0-9a-fA-F]{6}$/.test(l)?{r:Number.parseInt(l.slice(0,2),16),g:Number.parseInt(l.slice(2,4),16),b:Number.parseInt(l.slice(4,6),16)}:null}function Ue(a,l){const i=a==null?void 0:a[l];return typeof i=="string"?i:""}function Ew(a){return!ma(a)||typeof a.task_id!="string"?null:{task_id:a.task_id,task_type:typeof a.task_type=="string"?a.task_type:"generation",status:typeof a.status=="string"?a.status:"created",progress:typeof a.progress=="number"?a.progress:0,created_at:typeof a.created_at=="string"?a.created_at:"",updated_at:typeof a.updated_at=="string"?a.updated_at:"",profile_id:typeof a.profile_id=="string"?a.profile_id:null,workflow_id:typeof a.workflow_id=="string"?a.workflow_id:null,node_id:typeof a.node_id=="string"?a.node_id:null,model_route:typeof a.model_route=="string"?a.model_route:null,idempotency_key:typeof a.idempotency_key=="string"?a.idempotency_key:null,request:ma(a.request)?a.request:void 0,result:ma(a.result)?a.result:void 0,metadata:ma(a.metadata)?a.metadata:void 0,error_message:typeof a.error_message=="string"?a.error_message:null}}function Nw(a){return!!a}function ma(a){return!!(a&&typeof a=="object"&&!Array.isArray(a))}function Lw(a){return bl(a,
身份:近未来港区巡查员\r
性格:冷静、可靠、行动快\r
外观:黑色短发,青绿色眼睛\r
服装:轻机能外套、短靴、发光臂章\r
避雷:低质量、结构错误`},null,512),[[Qe,nn.value]])]),t("aside",T9,[t("header",null,[t("div",null,[l[165]||(l[165]=t("span",null,"识别预览",-1)),t("strong",null,s(Xg.value)+" / "+s(fd.value.length),1)]),t("em",null,s(Xi.value?`${Xi.value.length} 字`:"待粘贴"),1)]),t("dl",null,[(u(!0),c(X,null,oe(fd.value,B=>(u(),c("div",{key:B.key,class:de({pending:Xi.value&&!B.recognized})},[t("dt",null,[rt(s(B.label)+" ",1),t("span",null,s(B.recognized?"已识别":"待整理"),1)]),t("dd",null,s(B.value||"粘贴文本后显示"),1)],2))),128))])])]),t("footer",null,[t("span",null,s(Xi.value?"识别结果会先填入问卷,仍可在问卷里继续微调。":"等待外部角色卡文本。"),1),t("button",{type:"button",onClick:l[36]||(l[36]=B=>_a("externalProfileImport"))},"取消"),t("button",{type:"button",disabled:!Xi.value,onClick:V1}," 识别并填入问卷 ",8,q9)])])])):K("",!0)]),_:1}),ct(Ba,{name:"viewer-fade"},{default:ta(()=>[kn.value?(u(),c("div",O9,[t("section",D9,[t("header",null,[l[166]||(l[166]=t("div",null,[t("span",null,"快速角色"),t("strong",null,"创建角色档案问卷")],-1)),t("button",{type:"button",title:"关闭",onClick:l[37]||(l[37]=B=>_a("personaQuestionnaire"))},"×")]),t("div",W9,[t("label",null,[l[167]||(l[167]=t("span",null,"角色核心",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[38]||(l[38]=B=>et.value.roleCore=B),rows:"3",placeholder:"角色名、身份、核心定位,可以只写一句。"},null,512),[[Qe,et.value.roleCore]])]),t("label",U9,[l[169]||(l[169]=t("span",null,"性别表现",-1)),Ie(t("select",{"onUpdate:modelValue":l[39]||(l[39]=B=>et.value.genderPresentation=B)},[...l[168]||(l[168]=[t("option",{value:""},"未指定",-1),t("option",{value:"female"},"女性 / Female",-1),t("option",{value:"male"},"男性 / Male",-1),t("option",{value:"androgynous"},"中性 / Androgynous",-1),t("option",{value:"nonbinary"},"非二元 / Nonbinary",-1)])],512),[[Ka,et.value.genderPresentation]])]),t("label",F9,[l[170]||(l[170]=t("span",null,"年龄阶段",-1)),Ie(t("input",{"onUpdate:modelValue":l[40]||(l[40]=B=>et.value.ageStage=B),type:"text",placeholder:"例如 adult、young adult、middle-aged"},null,512),[[Qe,et.value.ageStage]])]),t("label",j9,[l[171]||(l[171]=t("span",null,"物种 / 种族",-1)),Ie(t("input",{"onUpdate:modelValue":l[41]||(l[41]=B=>et.value.species=B),type:"text",placeholder:"例如 human、elf、android"},null,512),[[Qe,et.value.species]])]),t("label",V9,[l[172]||(l[172]=t("span",null,"体型",-1)),Ie(t("input",{"onUpdate:modelValue":l[42]||(l[42]=B=>et.value.bodyType=B),type:"text",placeholder:"例如 slim、athletic、muscular"},null,512),[[Qe,et.value.bodyType]])]),t("label",null,[l[173]||(l[173]=t("span",null,"显著特征",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[43]||(l[43]=B=>et.value.distinctiveFeatures=B),rows:"3",placeholder:"伤疤、异色瞳、义体、角、纹身或固定视觉记忆点。"},null,512),[[Qe,et.value.distinctiveFeatures]])]),t("label",null,[l[174]||(l[174]=t("span",null,"性格关键词",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[44]||(l[44]=B=>et.value.personality=B),rows:"3",placeholder:"外显性格、内在矛盾、行动方式。"},null,512),[[Qe,et.value.personality]])]),t("label",null,[l[175]||(l[175]=t("span",null,"外观特征",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[45]||(l[45]=B=>et.value.appearance=B),rows:"3",placeholder:"发色、发型、眼睛、五官和视觉记忆点。"},null,512),[[Qe,et.value.appearance]])]),t("label",null,[l[176]||(l[176]=t("span",null,"服装与配饰",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[46]||(l[46]=B=>et.value.outfit=B),rows:"3",placeholder:"服装风格、配饰、武器或随身物。"},null,512),[[Qe,et.value.outfit]])]),t("label",null,[l[177]||(l[177]=t("span",null,"常用场景",-1)),Ie(t("textarea",{"onUpdate:modelValue":l[47]||(l[47]=B=>et.value.scene=B),rows:"3",placeholder:"常驻地点、画面背景、适合出现的环境。"},null,512),[[Qe,et.value.scene]])]),t("label",null,[l[178]||(l[178]=t("span",null,"避雷内容",-1)),Ie(t("textarea",{"onUpd