ehatool 6.0.0.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. ehatool/VERSION +1 -0
  2. ehatool/__init__.py +4 -0
  3. ehatool/acceptance.py +92 -0
  4. ehatool/brt27.py +105 -0
  5. ehatool/brt27_sim.py +114 -0
  6. ehatool/calibration.py +111 -0
  7. ehatool/can_sniff.py +162 -0
  8. ehatool/cia402.py +31 -0
  9. ehatool/cli.py +541 -0
  10. ehatool/console.py +31 -0
  11. ehatool/device/__init__.py +4 -0
  12. ehatool/device/can.py +201 -0
  13. ehatool/device/can_discovery.py +387 -0
  14. ehatool/device/can_discovery.toml +19 -0
  15. ehatool/device/io.py +20 -0
  16. ehatool/devices.py +187 -0
  17. ehatool/diagnostics.py +58 -0
  18. ehatool/diagnostics.toml +208 -0
  19. ehatool/discovery.py +95 -0
  20. ehatool/display.toml +127 -0
  21. ehatool/ecat.py +520 -0
  22. ehatool/ecat.toml +17 -0
  23. ehatool/ecat_probe.py +401 -0
  24. ehatool/ecat_probe.toml +14 -0
  25. ehatool/eha_od.json +5871 -0
  26. ehatool/experiment.py +576 -0
  27. ehatool/image.py +70 -0
  28. ehatool/info.py +121 -0
  29. ehatool/info.toml +41 -0
  30. ehatool/install_host.py +243 -0
  31. ehatool/install_host.toml +27 -0
  32. ehatool/link.py +811 -0
  33. ehatool/link.toml +18 -0
  34. ehatool/live.py +112 -0
  35. ehatool/motor.py +86 -0
  36. ehatool/od.py +200 -0
  37. ehatool/odrive.py +450 -0
  38. ehatool/output.py +208 -0
  39. ehatool/ram_load.py +62 -0
  40. ehatool/scope.py +50 -0
  41. ehatool/sil.py +260 -0
  42. ehatool/update.py +320 -0
  43. ehatool/usb_discovery.py +164 -0
  44. ehatool/usb_discovery.toml +16 -0
  45. ehatool/web/__init__.py +28 -0
  46. ehatool/web/brt_sim.py +130 -0
  47. ehatool/web/canbus.py +95 -0
  48. ehatool/web/devices.py +216 -0
  49. ehatool/web/experiments.py +226 -0
  50. ehatool/web/job_params.py +208 -0
  51. ehatool/web/layout.toml +61 -0
  52. ehatool/web/longrun.py +430 -0
  53. ehatool/web/polling.py +41 -0
  54. ehatool/web/recipes/bench.toml +18 -0
  55. ehatool/web/records.py +333 -0
  56. ehatool/web/requests.py +254 -0
  57. ehatool/web/server.py +1051 -0
  58. ehatool/web/session.py +1552 -0
  59. ehatool/web/static/THIRD_PARTY_LICENSES.txt +133 -0
  60. ehatool/web/static/assets/ehapower-logo-Cr84XeX3.png +0 -0
  61. ehatool/web/static/assets/ehapower-mark-Con0OjPM.png +0 -0
  62. ehatool/web/static/assets/index-CdLvwKa-.css +1 -0
  63. ehatool/web/static/assets/index-DiLUQD1i.js +134 -0
  64. ehatool/web/static/index.html +16 -0
  65. ehatool/web/streams.py +64 -0
  66. ehatool/web/workspaces.py +124 -0
  67. ehatool/workflows/__init__.py +4 -0
  68. ehatool/workflows/cancheck.py +394 -0
  69. ehatool/workflows/cancheck.toml +9 -0
  70. ehatool/workflows/checks.py +43 -0
  71. ehatool/workflows/usbcheck.py +212 -0
  72. ehatool-6.0.0.dev0.dist-info/METADATA +38 -0
  73. ehatool-6.0.0.dev0.dist-info/RECORD +77 -0
  74. ehatool-6.0.0.dev0.dist-info/WHEEL +5 -0
  75. ehatool-6.0.0.dev0.dist-info/entry_points.txt +2 -0
  76. ehatool-6.0.0.dev0.dist-info/licenses/LICENSE +21 -0
  77. ehatool-6.0.0.dev0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,134 @@
1
+ var Vp=Object.defineProperty;var Dp=(e,t,s)=>t in e?Vp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s;var $o=(e,t,s)=>Dp(e,typeof t!="symbol"?t+"":t,s);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))n(l);new MutationObserver(l=>{for(const a of l)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&n(c)}).observe(document,{childList:!0,subtree:!0});function s(l){const a={};return l.integrity&&(a.integrity=l.integrity),l.referrerPolicy&&(a.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?a.credentials="include":l.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(l){if(l.ep)return;l.ep=!0;const a=s(l);fetch(l.href,a)}})();/**
2
+ * @vue/shared v3.5.46
3
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
+ * @license MIT
5
+ **/function Rr(e){const t=Object.create(null);for(const s of e.split(","))t[s]=1;return s=>s in t}const Ct={},Sl=[],Cn=()=>{},id=()=>!1,ia=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),aa=e=>e.startsWith("onUpdate:"),es=Object.assign,Vr=(e,t)=>{const s=e.indexOf(t);s>-1&&e.splice(s,1)},Lp=Object.prototype.hasOwnProperty,ht=(e,t)=>Lp.call(e,t),Ge=Array.isArray,sl=e=>fo(e)==="[object Map]",Bn=e=>fo(e)==="[object Set]",ju=e=>fo(e)==="[object Date]",et=e=>typeof e=="function",Lt=e=>typeof e=="string",Ys=e=>typeof e=="symbol",$t=e=>e!==null&&typeof e=="object",ad=e=>($t(e)||et(e))&&et(e.then)&&et(e.catch),rd=Object.prototype.toString,fo=e=>rd.call(e),Ip=e=>fo(e).slice(8,-1),ud=e=>fo(e)==="[object Object]",ra=e=>Lt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ro=Rr(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Up=1e4,ua=e=>{let t=Object.create(null),s=0;return(n=>{const l=t[n];return l!==void 0?l:(++s>Up&&(t=Object.create(null),s=1),t[n]=e(n))})},Fp=/-\w/g,Cs=ua(e=>e.replace(Fp,t=>t.slice(1).toUpperCase())),zp=/\B([A-Z])/g,rl=ua(e=>e.replace(zp,"-$1").toLowerCase()),ca=ua(e=>e.charAt(0).toUpperCase()+e.slice(1)),Ba=ua(e=>e?`on${ca(e)}`:""),Sn=(e,t)=>!Object.is(e,t),Ni=(e,...t)=>{for(let s=0;s<e.length;s++)e[s](...t)},cd=(e,t,s,n=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:n,value:s})},ui=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Ru;const da=()=>Ru||(Ru=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Rl(e){if(Ge(e)){const t={};for(let s=0;s<e.length;s++){const n=e[s],l=Lt(n)?Kp(n):Rl(n);if(l)for(const a in l)t[a]=l[a]}return t}else if(Lt(e)||$t(e))return e}const Hp=/;(?![^(]*\))/g,Bp=/:([^]+)/,Wp=/"(?:[^"\\]|\\[^])*"|'(?:[^'\\]|\\[^])*'|\\[^]|\/\*[^]*?\*\//g;function Kp(e){const t={};return e.replace(Wp,s=>s.startsWith("/*")?"":s).split(Hp).forEach(s=>{if(s){const n=s.split(Bp);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function Ve(e){let t="";if(Lt(e))t=e;else if(Ge(e))for(let s=0;s<e.length;s++){const n=Ve(e[s]);n&&(t+=n+" ")}else if($t(e))for(const s in e)e[s]&&(t+=s+" ");return t.trim()}const Gp="itemscope,allowfullscreen,disablepictureinpicture,disableremoteplayback,formnovalidate,ismap,nomodule,novalidate,playsinline,readonly",qp=Rr(Gp);function dd(e){return!!e||e===""}function Jp(e,t,s){if(e.length!==t.length)return!1;let n=!0;for(let l=0;n&&l<e.length;l++)n=cn(e[l],t[l],s);return n}function Vu(e,t,s){if(e.size!==t.size)return!1;const n=Array.from(t),l=new Uint8Array(n.length);for(const a of e){let c=-1;for(let u=0;u<n.length;u++)if(!l[u]&&cn(a,n[u],s)){c=u;break}if(c<0)return!1;l[c]=1}return!0}function Yp(e,t,s){let n=sl(e),l=sl(t);if(n||l||(n=Bn(e),l=Bn(t),n||l))return n&&l?Vu(e,t,s):!1;const a=Object.keys(e).length,c=Object.keys(t).length;if(a!==c)return!1;for(const u in e){const i=ht(e,u),v=ht(t,u);if(i&&!v||!i&&v||!cn(e[u],t[u],s))return!1}return Lu(e)===Lu(t)}function Du(e,t,s,n){s||(s=[new Map,new Map]);const[l,a]=s;if(l.has(e)||a.has(t))return l.get(e)===t&&a.get(t)===e;l.set(e,t),a.set(t,e);const c=n(e,t,s);return l.delete(e),a.delete(t),c}function cn(e,t,s){if(e===t)return!0;let n=ju(e),l=ju(t);return n||l?n&&l?e.getTime()===t.getTime():!1:(n=Ys(e),l=Ys(t),n||l?e===t:(n=Ge(e),l=Ge(t),n||l?n&&l?Du(e,t,s,Jp):!1:(n=$t(e),l=$t(t),n||l?!n||!l?!1:Du(e,t,s,Yp):String(e)===String(t))))}function Dr(e,t){return e.findIndex(s=>cn(s,t))}function Lu(e){return Object.getPrototypeOf(e)===null&&e[Symbol.toPrimitive]==null&&typeof e.toString!="function"&&typeof e.valueOf!="function"?fo(e):String(e)}const fd=e=>!!(e&&e.__v_isRef===!0),f=e=>Lt(e)?e:e==null?"":Ge(e)||$t(e)&&(e.toString===rd||!et(e.toString))?fd(e)?f(e.value):JSON.stringify(e,pd,2):String(e),pd=(e,t)=>fd(t)?pd(e,t.value):sl(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((s,[n,l],a)=>(s[Wa(n,a)+" =>"]=l,s),{})}:Bn(t)?{[`Set(${t.size})`]:[...t.values()].map(s=>Wa(s))}:Ys(t)?Wa(t):$t(t)&&!Ge(t)&&!ud(t)?String(t):t,Wa=(e,t="")=>{var s;return Ys(e)?`Symbol(${(s=e.description)!=null?s:t})`:e};/**
6
+ * @vue/reactivity v3.5.46
7
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
8
+ * @license MIT
9
+ **/let cs;class Zp{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&cs&&(cs.active?(this.parent=cs,this.index=(cs.scopes||(cs.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,s;if(this.scopes){const n=this.scopes.slice();for(t=0,s=n.length;t<s;t++)n[t].pause()}for(t=0,s=this.effects.length;t<s;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,s;if(this.scopes){const l=this.scopes.slice();for(t=0,s=l.length;t<s;t++)l[t].resume()}const n=this.effects.slice();for(t=0,s=n.length;t<s;t++)n[t].resume()}}run(t){if(this._active){const s=cs;try{return cs=this,t()}finally{cs=s}}}on(){++this._on===1&&(this.prevScope=cs,cs=this)}off(){if(this._on>0&&--this._on===0){if(cs===this)cs=this.prevScope;else{let t=cs;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let s,n;for(s=0,n=this.effects.length;s<n;s++)this.effects[s].stop();for(this.effects.length=0,s=0,n=this.cleanups.length;s<n;s++)this.cleanups[s]();if(this.cleanups.length=0,this.scopes){const l=this.scopes.slice();for(s=0,n=l.length;s<n;s++)l[s].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const l=this.parent.scopes.pop();l&&l!==this&&(this.parent.scopes[this.index]=l,l.index=this.index)}this.parent=void 0}}}function Qp(){return cs}let Ot;const Ka=new WeakSet;class md{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,cs&&(cs.active?cs.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Ka.has(this)&&(Ka.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||hd(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Iu(this),bd(this);const t=Ot,s=un;Ot=this,un=!0;try{return this.fn()}finally{gd(this),Ot=t,un=s,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Ur(t);this.deps=this.depsTail=void 0,Iu(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Ka.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ur(this)&&this.run()}get dirty(){return ur(this)}}let vd=0,Vo,Do;function hd(e,t=!1){if(e.flags|=8,t){e.next=Do,Do=e;return}e.next=Vo,Vo=e}function Lr(){vd++}function Ir(){if(--vd>0)return;if(Do){let t=Do;for(Do=void 0;t;){const s=t.next;t.next=void 0,t.flags&=-9,t=s}}let e;for(;Vo;){let t=Vo;for(Vo=void 0;t;){const s=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(n){e||(e=n)}t=s}}if(e)throw e}function bd(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function gd(e){let t,s=e.depsTail,n=s;for(;n;){const l=n.prevDep;n.version===-1?(n===s&&(s=l),Ur(n),Xp(n)):t=n,n.dep.activeLink=n.prevActiveLink,n.prevActiveLink=void 0,n=l}e.deps=t,e.depsTail=s}function ur(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(_d(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function _d(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Yo)||(e.globalVersion=Yo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!ur(e))))return;e.flags|=2;const t=e.dep,s=Ot,n=un;Ot=e,un=!0;try{bd(e);const l=e.fn(e._value);(t.version===0||Sn(l,e._value))&&(e.flags|=128,e._value=l,t.version++)}catch(l){throw t.version++,l}finally{Ot=s,un=n,gd(e),e.flags&=-3}}function Ur(e,t=!1){const{dep:s,prevSub:n,nextSub:l}=e;if(n&&(n.nextSub=l,e.prevSub=void 0),l&&(l.prevSub=n,e.nextSub=void 0),s.subs===e&&(s.subs=n,!n&&s.computed)){s.computed.flags&=-5;for(let a=s.computed.deps;a;a=a.nextDep)Ur(a,!0)}!t&&!--s.sc&&s.map&&s.map.delete(s.key)}function Xp(e){const{prevDep:t,nextDep:s}=e;t&&(t.nextDep=s,e.prevDep=void 0),s&&(s.prevDep=t,e.nextDep=void 0)}let un=!0;const yd=[];function An(){yd.push(un),un=!1}function Tn(){const e=yd.pop();un=e===void 0?!0:e}function Iu(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const s=Ot;Ot=void 0;try{t()}finally{Ot=s}}}let Yo=0;class em{constructor(t,s){this.sub=t,this.dep=s,this.version=s.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Fr{constructor(t){this.computed=t,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(t){if(!Ot||!un||Ot===this.computed)return;let s=this.activeLink;if(s===void 0||s.sub!==Ot)s=this.activeLink=new em(Ot,this),Ot.deps?(s.prevDep=Ot.depsTail,Ot.depsTail.nextDep=s,Ot.depsTail=s):Ot.deps=Ot.depsTail=s,kd(s);else if(s.version===-1&&(s.version=this.version,s.nextDep)){const n=s.nextDep;n.prevDep=s.prevDep,s.prevDep&&(s.prevDep.nextDep=n),s.prevDep=Ot.depsTail,s.nextDep=void 0,Ot.depsTail.nextDep=s,Ot.depsTail=s,Ot.deps===s&&(Ot.deps=n)}return s}trigger(t){this.version++,Yo++,this.notify(t)}notify(t){Lr();try{for(let s=this.subs;s;s=s.prevSub)s.sub.notify()&&s.sub.dep.notify()}finally{Ir()}}}function kd(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let n=t.deps;n;n=n.nextDep)kd(n)}const s=e.dep.subs;s!==e&&(e.prevSub=s,s&&(s.nextSub=e)),e.dep.subs=e}}const Ii=new WeakMap,Tl=Symbol(""),cr=Symbol(""),Zo=Symbol("");function ps(e,t,s){if(un&&Ot){let n=Ii.get(e);n||Ii.set(e,n=new Map);let l=n.get(s);l||(n.set(s,l=new Fr),l.map=n,l.key=s),l.track()}}function Dn(e,t,s,n,l,a){const c=Ii.get(e);if(!c){Yo++;return}const u=i=>{i&&i.trigger()};if(Lr(),t==="clear")c.forEach(u);else{const i=Ge(e),v=i&&ra(s);if(i&&s==="length"){const b=Number(n);c.forEach((_,k)=>{(k==="length"||k===Zo||!Ys(k)&&k>=b)&&u(_)})}else switch((s!==void 0||c.has(void 0))&&u(c.get(s)),v&&u(c.get(Zo)),t){case"add":i?v&&u(c.get("length")):(u(c.get(Tl)),sl(e)&&u(c.get(cr)));break;case"delete":i||(u(c.get(Tl)),sl(e)&&u(c.get(cr)));break;case"set":sl(e)&&u(c.get(Tl));break}}Ir()}function tm(e,t){const s=Ii.get(e);return s&&s.get(t)}function Ql(e){const t=kt(e);return t===e||(ps(t,"iterate",Zo),Is(e))?t:On(e)?nl(e)?t.map(s=>ol(Zs(s))):t.map(ol):t.map(Zs)}function fa(e){return ps(e=kt(e),"iterate",Zo),e}function wn(e,t){return On(e)?ol(nl(e)?Zs(t):t):Zs(t)}const sm={__proto__:null,[Symbol.iterator](){return Ga(this,Symbol.iterator,e=>wn(this,e))},concat(...e){return Ql(this).concat(...e.map(t=>Ge(t)?Ql(t):t))},entries(){return Ga(this,"entries",e=>(e[1]=wn(this,e[1]),e))},every(e,t){return jn(this,"every",e,t,void 0,arguments)},filter(e,t){return jn(this,"filter",e,t,s=>s.map(n=>wn(this,n)),arguments)},find(e,t){return jn(this,"find",e,t,s=>wn(this,s),arguments)},findIndex(e,t){return jn(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return jn(this,"findLast",e,t,s=>wn(this,s),arguments)},findLastIndex(e,t){return jn(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return jn(this,"forEach",e,t,void 0,arguments)},includes(...e){return qa(this,"includes",e)},indexOf(...e){return qa(this,"indexOf",e)},join(e){return Ql(this).join(e)},lastIndexOf(...e){return qa(this,"lastIndexOf",e)},map(e,t){return jn(this,"map",e,t,void 0,arguments)},pop(){return xo(this,"pop")},push(...e){return xo(this,"push",e)},reduce(e,...t){return Fu(this,"reduce",e,t)},reduceRight(e,...t){return Fu(this,"reduceRight",e,t)},shift(){return xo(this,"shift")},some(e,t){return jn(this,"some",e,t,void 0,arguments)},splice(...e){return xo(this,"splice",e)},toReversed(){return Ql(this).toReversed()},toSorted(e){return Ql(this).toSorted(e)},toSpliced(...e){return Ql(this).toSpliced(...e)},unshift(...e){return xo(this,"unshift",e)},values(){return Ga(this,"values",e=>wn(this,e))}};function Ga(e,t,s){const n=fa(e),l=n[t],a=l.call(n);if(n!==e&&!Is(e)){if(a[Symbol.toStringTag]==="Array Iterator"){const c=Object.create(Object.getPrototypeOf(a));return c.next=()=>Uu(a.next(),s),l!==wd[t]&&Object.defineProperties(c,{return:{get(){const u=a.return;return typeof u=="function"?u.bind(a):u}},throw:{get(){const u=a.throw;return typeof u=="function"?u.bind(a):u}}}),c}a._next=a.next,a.next=()=>Uu(a._next(),s)}return a}function Uu(e,t){return e.done||(e.value=t(e.value)),e}const wd=Array.prototype;function jn(e,t,s,n,l,a){const c=fa(e),u=c!==e&&!Is(e),i=c[t];if(i!==wd[t]){const _=i.apply(e,a);return u?Zs(_):_}let v=s;c!==e&&(u?v=function(_,k){return s.call(this,wn(e,_),k,e)}:s.length>2&&(v=function(_,k){return s.call(this,_,k,e)}));const b=i.call(c,v,n);return u&&l?l(b):b}function Fu(e,t,s,n){const l=fa(e),a=l!==e&&!Is(e);let c=s,u=!1;l!==e&&(a?(u=n.length===0,c=function(v,b,_){return u&&(u=!1,v=wn(e,v)),s.call(this,v,wn(e,b),_,e)}):s.length>3&&(c=function(v,b,_){return s.call(this,v,b,_,e)}));const i=l[t](c,...n);return u?wn(e,i):i}function qa(e,t,s){const n=kt(e);ps(n,"iterate",Zo);const l=n[t](...s);return(l===-1||l===!1)&&pa(s[0])?(s[0]=kt(s[0]),n[t](...s)):l}function xo(e,t,s=[]){An(),Lr();const n=kt(e)[t].apply(e,s);return Ir(),Tn(),n}const nm=Rr("__proto__,__v_isRef,__isVue"),$d=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ys));function lm(e){Ys(e)||(e=String(e));const t=kt(this);return ps(t,"has",e),t.hasOwnProperty(e)}class xd{constructor(t=!1,s=!1){this._isReadonly=t,this._isShallow=s}get(t,s,n){if(s==="__v_skip")return t.__v_skip;const l=this._isReadonly,a=this._isShallow;if(s==="__v_isReactive")return!l;if(s==="__v_isReadonly")return l;if(s==="__v_isShallow")return a;if(s==="__v_raw")return n===(l?a?mm:Td:a?Ad:Cd).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(n)?t:void 0;const c=Ge(t);if(!l){let i;if(c&&(i=sm[s]))return i;if(s==="hasOwnProperty")return lm}const u=Reflect.get(t,s,It(t)?t:n);if((Ys(s)?$d.has(s):nm(s))||(l||ps(t,"get",s),a))return u;if(It(u)){const i=c&&ra(s)?u:u.value;return l&&$t(i)?fr(i):i}return $t(u)?l?fr(u):Dt(u):u}}class Sd extends xd{constructor(t=!1){super(!1,t)}set(t,s,n,l){let a=t[s];const c=Ge(t)&&ra(s);if(!this._isShallow){const v=On(a);if(!Is(n)&&!On(n)&&(a=kt(a),n=kt(n)),!c&&It(a)&&!It(n))return v||(a.value=n),!0}const u=c?Number(s)<t.length:ht(t,s),i=Reflect.set(t,s,n,It(t)?t:l);return t===kt(l)&&i&&(u?Sn(n,a)&&Dn(t,"set",s,n):Dn(t,"add",s,n)),i}deleteProperty(t,s){const n=ht(t,s);t[s];const l=Reflect.deleteProperty(t,s);return l&&n&&Dn(t,"delete",s,void 0),l}has(t,s){const n=Reflect.has(t,s);return(!Ys(s)||!$d.has(s))&&ps(t,"has",s),n}ownKeys(t){return ps(t,"iterate",Ge(t)?"length":Tl),Reflect.ownKeys(t)}}class om extends xd{constructor(t=!1){super(!0,t)}set(t,s){return!0}deleteProperty(t,s){return!0}}const im=new Sd,am=new om,rm=new Sd(!0);const dr=e=>e,$i=e=>Reflect.getPrototypeOf(e);function um(e,t,s){return function(...n){const l=this.__v_raw,a=kt(l),c=sl(a),u=e==="entries"||e===Symbol.iterator&&c,i=e==="keys"&&c,v=l[e](...n),b=s?dr:t?ol:Zs;return!t&&ps(a,"iterate",i?cr:Tl),es(Object.create(v),{next(){const{value:_,done:k}=v.next();return k?{value:_,done:k}:{value:u?[b(_[0]),b(_[1])]:b(_),done:k}}})}}function xi(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function cm(e,t){const s={get(l){const a=this.__v_raw,c=kt(a),u=kt(l);e||(Sn(l,u)&&ps(c,"get",l),ps(c,"get",u));const{has:i}=$i(c),v=t?dr:e?ol:Zs;if(i.call(c,l))return v(a.get(l));if(i.call(c,u))return v(a.get(u));a!==c&&a.get(l)},get size(){const l=this.__v_raw;return!e&&ps(kt(l),"iterate",Tl),l.size},has(l){const a=this.__v_raw,c=kt(a),u=kt(l);return e||(Sn(l,u)&&ps(c,"has",l),ps(c,"has",u)),l===u?a.has(l):a.has(l)||a.has(u)},forEach(l,a){const c=this,u=c.__v_raw,i=kt(u),v=t?dr:e?ol:Zs;return!e&&ps(i,"iterate",Tl),u.forEach((b,_)=>l.call(a,v(b),v(_),c))}};return es(s,e?{add:xi("add"),set:xi("set"),delete:xi("delete"),clear:xi("clear")}:{add(l){const a=kt(this),c=$i(a),u=kt(l),i=!t&&!Is(l)&&!On(l)?u:l;return c.has.call(a,i)||Sn(l,i)&&c.has.call(a,l)||Sn(u,i)&&c.has.call(a,u)||(a.add(i),Dn(a,"add",i,i)),this},set(l,a){!t&&!Is(a)&&!On(a)&&(a=kt(a));const c=kt(this),{has:u,get:i}=$i(c);let v=u.call(c,l);v||(l=kt(l),v=u.call(c,l));const b=i.call(c,l);return c.set(l,a),v?Sn(a,b)&&Dn(c,"set",l,a):Dn(c,"add",l,a),this},delete(l){const a=kt(this),{has:c,get:u}=$i(a);let i=c.call(a,l);i||(l=kt(l),i=c.call(a,l)),u&&u.call(a,l);const v=a.delete(l);return i&&Dn(a,"delete",l,void 0),v},clear(){const l=kt(this),a=l.size!==0,c=l.clear();return a&&Dn(l,"clear",void 0,void 0),c}}),["keys","values","entries",Symbol.iterator].forEach(l=>{s[l]=um(l,e,t)}),s}function zr(e,t){const s=cm(e,t);return(n,l,a)=>l==="__v_isReactive"?!e:l==="__v_isReadonly"?e:l==="__v_isShallow"?t:l==="__v_raw"?n:Reflect.get(ht(s,l)&&l in n?s:n,l,a)}const dm={get:zr(!1,!1)},fm={get:zr(!1,!0)},pm={get:zr(!0,!1)};const Cd=new WeakMap,Ad=new WeakMap,Td=new WeakMap,mm=new WeakMap;function vm(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Dt(e){return On(e)?e:Hr(e,!1,im,dm,Cd)}function hm(e){return Hr(e,!1,rm,fm,Ad)}function fr(e){return Hr(e,!0,am,pm,Td)}function Hr(e,t,s,n,l){if(!$t(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const a=l.get(e);if(a)return a;const c=vm(Ip(e));if(c===0)return e;const u=new Proxy(e,c===2?n:s);return l.set(e,u),u}function nl(e){return On(e)?nl(e.__v_raw):!!(e&&e.__v_isReactive)}function On(e){return!!(e&&e.__v_isReadonly)}function Is(e){return!!(e&&e.__v_isShallow)}function pa(e){return e?!!e.__v_raw:!1}function kt(e){const t=e&&e.__v_raw;return t?kt(t):e}function Ps(e){return!ht(e,"__v_skip")&&Object.isExtensible(e)&&cd(e,"__v_skip",!0),e}const Zs=e=>$t(e)?Dt(e):e,ol=e=>$t(e)?fr(e):e;function It(e){return e?e.__v_isRef===!0:!1}function _e(e){return Od(e,!1)}function ul(e){return Od(e,!0)}function Od(e,t){return It(e)?e:new bm(e,t)}class bm{constructor(t,s){this.dep=new Fr,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=s?t:kt(t),this._value=s?t:Zs(t),this.__v_isShallow=s}get value(){return this.dep.track(),this._value}set value(t){const s=this._rawValue,n=this.__v_isShallow||Is(t)||On(t);t=n?t:kt(t),Sn(t,s)&&(this._rawValue=t,this._value=n?t:Zs(t),this.dep.trigger())}}function d(e){return It(e)?e.value:e}const gm={get:(e,t,s)=>t==="__v_raw"?e:d(Reflect.get(e,t,s)),set:(e,t,s,n)=>{const l=e[t];return It(l)&&!It(s)?(l.value=s,!0):Reflect.set(e,t,s,n)}};function Ed(e){return nl(e)?e:new Proxy(e,gm)}class _m{constructor(t,s,n){this._object=t,this._defaultValue=n,this.__v_isRef=!0,this._value=void 0,this._key=Ys(s)?s:String(s),this._raw=kt(t);let l=!0,a=t;if(!Ge(t)||Ys(this._key)||!ra(this._key))do l=!pa(a)||Is(a);while(l&&(a=a.__v_raw));this._shallow=l}get value(){let t=this._object[this._key];return this._shallow&&(t=d(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&It(this._raw[this._key])){const s=this._object[this._key];if(It(s)){s.value=t;return}}this._object[this._key]=t}get dep(){return tm(this._raw,this._key)}}class ym{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function km(e,t,s){return It(e)?e:et(e)?new ym(e):$t(e)&&arguments.length>1?wm(e,t,s):_e(e)}function wm(e,t,s){return new _m(e,t,s)}class $m{constructor(t,s,n){this.fn=t,this.setter=s,this._value=void 0,this.dep=new Fr(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!s,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&Ot!==this)return hd(this,!0),!0}get value(){const t=this.dep.track();return _d(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function xm(e,t,s=!1){let n,l;return et(e)?n=e:(n=e.get,l=e.set),new $m(n,l,s)}const Si={},Ui=new WeakMap;let kl;function Sm(e,t=!1,s=kl){if(s){let n=Ui.get(s);n||Ui.set(s,n=[]),n.push(e)}}function Cm(e,t,s=Ct){const{immediate:n,deep:l,once:a,scheduler:c,augmentJob:u,call:i}=s,v=N=>l?N:Is(N)||l===!1||l===0?Ln(N,1):Ln(N);let b,_,k,$,L=!1,V=!1;if(It(e)?(_=()=>e.value,L=Is(e)):nl(e)?(_=()=>v(e),L=!0):Ge(e)?(V=!0,L=e.some(N=>nl(N)||Is(N)),_=()=>e.map(N=>{if(It(N))return N.value;if(nl(N))return v(N);if(et(N))return i?i(N,2):N()})):et(e)?t?_=i?()=>i(e,2):e:_=()=>{if(k){An();try{k()}finally{Tn()}}const N=kl;kl=b;try{return i?i(e,3,[$]):e($)}finally{kl=N}}:_=Cn,t&&l){const N=_,B=l===!0?1/0:l;_=()=>Ln(N(),B)}const j=Qp(),q=()=>{b.stop(),j&&j.active&&Vr(j.effects,b)};if(a&&t){const N=t;t=(...B)=>{try{return N(...B)}finally{q()}}}let z=V?new Array(e.length).fill(Si):Si;const K=N=>{if(!(!(b.flags&1)||!b.dirty&&!N))if(t){const B=b.run();if(N||l||L||(V?B.some((H,ce)=>Sn(H,z[ce])):Sn(B,z))){const H=kl;An();try{k&&k(),kl=b;const ce=[B,z===Si?void 0:V&&z[0]===Si?[]:z,$];z=B,i?i(t,3,ce):t(...ce)}finally{kl=H,Tn()}}}else b.run()};return u&&u(K),b=new md(_),b.scheduler=c?()=>c(K,!1):K,$=N=>Sm(N,!1,b),k=b.onStop=()=>{const N=Ui.get(b);if(N){if(i)i(N,4);else for(const B of N)B();Ui.delete(b)}},t?n?K(!0):z=b.run():c?c(K.bind(null,!0),!0):b.run(),q.pause=b.pause.bind(b),q.resume=b.resume.bind(b),q.stop=q,q}function Ln(e,t=1/0,s){if(t<=0||!$t(e)||e.__v_skip||(s=s||new Map,(s.get(e)||0)>=t))return e;if(s.set(e,t),t--,It(e))Ln(e.value,t,s);else if(Ge(e))for(let n=0;n<e.length;n++)Ln(e[n],t,s);else if(Bn(e)||sl(e))e.forEach(n=>{Ln(n,t,s)});else if(ud(e)){for(const n in e)Ln(e[n],t,s);for(const n of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,n)&&Ln(e[n],t,s)}return e}/**
10
+ * @vue/runtime-core v3.5.46
11
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
12
+ * @license MIT
13
+ **/function ci(e,t,s,n){try{return n?e(...n):e()}catch(l){ma(l,t,s)}}function dn(e,t,s,n){if(et(e)){const l=ci(e,t,s,n);return l&&ad(l)&&l.catch(a=>{ma(a,t,s,void 0,!0)}),l}if(Ge(e)){const l=[];for(let a=0;a<e.length;a++)l.push(dn(e[a],t,s,n));return l}}function ma(e,t,s,n=!0,l=!1){const a=t?t.vnode:null,{errorHandler:c,throwUnhandledErrorInProduction:u}=t&&t.appContext.config||Ct;if(t){let i=t.parent;const v=t.proxy,b=`https://vuejs.org/error-reference/#runtime-${s}`;for(;i;){const _=i.ec;if(_&&!i.isUnmounted&&(!l||i.scope.active)){for(let k=0;k<_.length;k++)if(_[k](e,v,b)===!1)return}i=i.parent}if(c){An(),ci(c,null,10,[e,v,b]),Tn();return}}Am(e,s,a,n,u)}function Am(e,t,s,n=!0,l=!1){if(l)throw e;console.error(e)}const xs=[];let nn=-1;const $n=[];let el=null,eo=0;const Pd=Promise.resolve();let Fi=null;function Qo(e){const t=Fi||Pd;return e?t.then(this?e.bind(this):e):t}function Tm(e){let t=nn+1,s=xs.length;for(;t<s;){const n=t+s>>>1,l=xs[n],a=Xo(l);a<e||a===e&&l.flags&2?t=n+1:s=n}return t}function Br(e){if(!(e.flags&1)){const t=Xo(e),s=xs[xs.length-1];!s||!(e.flags&2)&&t>=Xo(s)?xs.push(e):xs.splice(Tm(t),0,e),e.flags|=1,Md()}}function Md(){Fi||(Fi=Pd.then(Rd))}function Om(e){if(!Ge(e))el&&e.id===-1?el.splice(eo+1,0,e):e.flags&1||($n.push(e),e.flags|=1);else for(let t=0;t<e.length;t++)$n.push(e[t]);Md()}function Nd(e,t,s,n=nn+1){for(;n<xs.length;n++){const l=xs[n];if(l&&l.flags&2){if(e&&l.id!==e.uid||t!==void 0&&!(l.id>=t))continue;xs.splice(n,1),n=e?n-1:nn,l.flags&4&&(l.flags&=-2),l(),l.flags&4||(l.flags&=-2)}}}function jd(e,t,s=0){if($n.length){let n=$n,l=0;if(t){n=[];for(let c=0;c<$n.length;c++){const u=$n[c];(u.i!==void 0?!u.i||u.i.uid<s:t.has(u))?$n[l++]=u:n.push(u)}}const a=[...new Set(n)].sort((c,u)=>Xo(c)-Xo(u));if($n.length=l,el){for(let c=0;c<a.length;c++)el.push(a[c]);return}for(el=a,eo=0;eo<el.length;eo++){const c=el[eo];c.flags&4&&(c.flags&=-2),c.flags&8||c(),c.flags&=-2}el=null,eo=0}}let Ja=!1;function Em(e,t){if(Ja){e();return}const s=t===void 0?void 0:new Set($n);e(),Ja=!0;try{Nd(void 0,t),jd(void 0,s,t)}finally{Ja=!1}}const Xo=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Rd(e){try{for(nn=0;nn<xs.length;nn++){const t=xs[nn];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),ci(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;nn<xs.length;nn++){const t=xs[nn];t&&(t.flags&=-2)}nn=-1,xs.length=0,jd(),Fi=null,(xs.length||$n.length)&&Rd()}}let Vs=null,Vd=null;function zi(e){const t=Vs;return Vs=e,Vd=e&&e.type.__scopeId||null,t}function Dd(e,t=Vs,s){if(!t||e._n)return e;const n=(...l)=>{n._d&&Wi(-1);const a=zi(t),c=Ol.length;let u;try{u=e(...l)}finally{for(let i=Ol.length;i>c;i--)uf();zi(a),n._d&&Wi(1)}return u};return n._n=!0,n._c=!0,n._d=!0,n}function we(e,t){if(Vs===null)return e;const s=ga(Vs),n=e.dirs||(e.dirs=[]);for(let l=0;l<t.length;l++){let[a,c,u,i=Ct]=t[l];a&&(et(a)&&(a={mounted:a,updated:a}),a.deep&&Ln(c),n.push({dir:a,instance:s,value:c,oldValue:void 0,arg:u,modifiers:i}))}return e}function _l(e,t,s,n){let l=e;if(n==="beforeMount")e._mount=e;else if(n==="beforeUpdate"){const u=t&&t._mount;u&&(u._latest=e,e._mount=u)}else if(n==="mounted"){const u=e._latest;e._mount=e._latest=void 0,u&&(l=u,u._mount=void 0)}const a=l.dirs,c=t&&t.dirs;for(let u=0;u<a.length;u++){let i=a[u];c?i.oldValue=c[u].value:n==="mounted"&&i.oldValue!==void 0&&(i=es({},i,{oldValue:void 0}));let v=i.dir[n];v&&(An(),dn(v,s,8,[e.el,i,l,t]),Tn())}}function Pm(e,t){if(vs){let s=vs.provides;const n=vs.parent&&vs.parent.provides;n===s&&(s=vs.provides=Object.create(n)),s[e]=t}}function ji(e,t,s=!1){const n=Ev();if(n||no){let l=no?no._context.provides:n?n.parent==null||n.ce?n.vnode.appContext&&n.vnode.appContext.provides:n.parent.provides:void 0;if(l&&e in l)return l[e];if(arguments.length>1)return s&&et(t)?t.call(n&&n.proxy):t}}const Mm=Symbol.for("v-scx"),Nm=()=>ji(Mm);function it(e,t,s){return Ld(e,t,s)}function Ld(e,t,s=Ct){const{immediate:n,deep:l,flush:a,once:c}=s,u=es({},s),i=t&&n||!t&&a!=="post";let v;if(li){if(a==="sync"){const $=Nm();v=$.__watcherHandles||($.__watcherHandles=[])}else if(!i){const $=()=>{};return $.stop=Cn,$.resume=Cn,$.pause=Cn,$}}const b=vs;u.call=($,L,V)=>dn($,b,L,V);let _=!1;a==="post"?u.scheduler=$=>{$.i=b,$s($,b&&b.suspense)}:a!=="sync"&&(_=!0,u.scheduler=($,L)=>{L?$():Br($)}),u.augmentJob=$=>{t&&($.flags|=4),_&&($.flags|=2,b&&($.id=b.uid,$.i=b))};const k=Cm(e,t,u);return li&&(v?v.push(k):i&&k()),k}function jm(e,t,s){const n=this.proxy,l=Lt(e)?e.includes(".")?Id(n,e):()=>n[e]:e.bind(n,n);let a;et(t)?a=t:(a=t.handler,s=t);const c=di(this),u=Ld(l,a.bind(n),s);return c(),u}function Id(e,t){const s=t.split(".");return()=>{let n=e;for(let l=0;l<s.length&&n;l++)n=n[s[l]];return n}}const Rm=Symbol("_vte"),va=e=>e.__isTeleport,Ya=Symbol("_leaveCb");function Vm(e){let t=e[0];if(e.length>1){for(const s of e)if(s.type!==fn){t=s;break}}return t}function Ud(e){if(!Wr(e))return va(e.type)&&e.children?Vm(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:s}=e;if(s){if(t&16)return s[0];if(t&32&&et(s.default))return s.default()}}function Lo(e,t){if(e.shapeFlag&6&&e.component){e.transition=t;const s=e.component.subTree;Lo(va(s.type)&&Ud(s)||s,t)}else if(e.shapeFlag&128){const s=e.suspense;if(s){const n=s.isHydrating?s.pendingBranch:s.activeBranch;n&&Lo(n,t.clone(n))}else e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)}else if(e.transition=t,e.type===le&&Ge(e.children)){const s=Jd(e.children,!1);s&&Lo(s,t)}}function pr(e){if(e.component)return pr(e.component.subTree);if(e.type===le){const t=Ge(e.children)&&Jd(e.children,!1);return t?pr(t):void 0}if(e.type!==fn)return e}function Bt(e,t){return et(e)?es({name:e.name},t,{setup:e}):e}function Fd(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}function zu(e,t){let s;return!!((s=Object.getOwnPropertyDescriptor(e,t))&&!s.configurable)}const Hi=new WeakMap;function Io(e,t,s,n,l=!1){if(Ge(e)){e.forEach((V,j)=>Io(V,t&&(Ge(t)?t[j]:t),s,n,l));return}if(Uo(n)&&!l){n.shapeFlag&512&&n.type.__asyncResolved&&n.component.subTree.component&&Io(e,t,s,n.component.subTree);return}const a=n.shapeFlag&4?ga(n.component):n.el,c=l?null:a,{i:u,r:i}=e,v=t&&t.r,b=u.refs===Ct?u.refs={}:u.refs,_=u.setupState,k=kt(_),$=_===Ct?id:V=>zu(b,V)?!1:ht(k,V),L=(V,j)=>!(j&&zu(b,j));if(v!=null&&v!==i){if(Hu(t),Lt(v))b[v]=null,$(v)&&(_[v]=null);else if(It(v)){const V=t;L(v,V.k)&&(v.value=null),V.k&&(b[V.k]=null)}}if(et(i))ci(i,u,12,[c,b]);else{const V=Lt(i),j=It(i);if(V||j){const q=()=>{if(e.f){const z=V?$(i)?_[i]:b[i]:L()||!e.k?i.value:b[e.k];if(l)Ge(z)&&Vr(z,a);else if(Ge(z))z.includes(a)||z.push(a);else if(V)b[i]=[a],$(i)&&(_[i]=b[i]);else{const K=[a];L(i,e.k)&&(i.value=K),e.k&&(b[e.k]=K)}}else V?(b[i]=c,$(i)&&(_[i]=c)):j&&(L(i,e.k)&&(i.value=c),e.k&&(b[e.k]=c))};if(c){const z=()=>{q(),Hi.delete(e)};z.id=-1,Hi.set(e,z),$s(z,s)}else Hu(e),q()}}}function Hu(e){const t=Hi.get(e);t&&(t.flags|=8,Hi.delete(e))}da().requestIdleCallback;da().cancelIdleCallback;const Uo=e=>!!e.type.__asyncLoader,Wr=e=>e.type.__isKeepAlive;function Dm(e,t){zd(e,"a",t)}function Lm(e,t){zd(e,"da",t)}function zd(e,t,s=vs){const n=e.__wdc||(e.__wdc=()=>{let l=s;for(;l;){if(l.isDeactivated)return;l=l.parent}return e()});if(ei(t,n,s),s){let l=s.parent;for(;l&&l.parent;)Wr(l.parent.vnode)&&Im(n,t,s,l),l=l.parent}}function Im(e,t,s,n){const l=ei(t,e,n,!0),a=ei("um",()=>Vr(n[t],l),s);a.flags=16}function ei(e,t,s=vs,n=!1){if(s){const l=s[e]||(s[e]=[]),a=t.__weh||(t.__weh=(...c)=>{An();const u=di(s),i=dn(t,s,e,c);return u(),Tn(),i});return n?l.unshift(a):l.push(a),a}}const Wn=e=>(t,s=vs)=>{(!li||e==="sp")&&ei(e,(...n)=>t(...n),s)},Um=Wn("bm"),Fs=Wn("m"),Fm=Wn("bu"),zm=Wn("u"),cl=Wn("bum"),Hm=Wn("um"),Bm=Wn("sp"),Wm=Wn("rtg"),Km=Wn("rtc");function Gm(e,t=vs){ei("ec",e,t)}const qm="components",Hd=Symbol.for("v-ndc");function Bd(e){return Lt(e)?Jm(qm,e,!1)||e:e||Hd}function Jm(e,t,s=!0,n=!1){const l=Vs||vs;if(l){const a=l.type;{const u=Rv(a,!1);if(u&&(u===t||u===Cs(t)||u===ca(Cs(t))))return a}const c=Bu(l[e]||a[e],t)||Bu(l.appContext[e],t);return!c&&n?a:c}}function Bu(e,t){return e&&(e[t]||e[Cs(t)]||e[ca(Cs(t))])}function Ue(e,t,s,n){let l;const a=s,c=Ge(e);if(c||Lt(e)){const u=c&&nl(e);let i=!1,v=!1;u&&(i=!Is(e),v=On(e),e=fa(e)),l=new Array(e.length);for(let b=0,_=e.length;b<_;b++)l[b]=t(i?v?ol(Zs(e[b])):Zs(e[b]):e[b],b,void 0,a)}else if(typeof e=="number")if(!Number.isInteger(e)||e<0)l=[];else{l=new Array(e);for(let u=0;u<e;u++)l[u]=t(u+1,u,void 0,a)}else if($t(e))if(e[Symbol.iterator])l=Array.from(e,(u,i)=>t(u,i,void 0,a));else{const u=Object.keys(e);l=new Array(u.length);for(let i=0,v=u.length;i<v;i++){const b=u[i];l[i]=t(e[b],b,i,a)}}else l=[];return l}const mr=e=>e?pf(e)?ga(e):mr(e.parent):null,Fo=es(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>mr(e.parent),$root:e=>mr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Kd(e),$forceUpdate:e=>e.f||(e.f=()=>{Br(e.update)}),$nextTick:e=>e.n||(e.n=Qo.bind(e.proxy)),$watch:e=>jm.bind(e)}),Za=(e,t)=>e!==Ct&&!e.__isScriptSetup&&ht(e,t),Ym={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:s,setupState:n,data:l,props:a,accessCache:c,type:u,appContext:i}=e;if(t[0]!=="$"){const k=c[t];if(k!==void 0)switch(k){case 1:return n[t];case 2:return l[t];case 4:return s[t];case 3:return a[t]}else{if(Za(n,t))return c[t]=1,n[t];if(l!==Ct&&ht(l,t))return c[t]=2,l[t];if(ht(a,t))return c[t]=3,a[t];if(s!==Ct&&ht(s,t))return c[t]=4,s[t];vr&&(c[t]=0)}}const v=Fo[t];let b,_;if(v)return t==="$attrs"&&ps(e.attrs,"get",""),v(e);if((b=u.__cssModules)&&(b=b[t]))return b;if(s!==Ct&&ht(s,t))return c[t]=4,s[t];if(_=i.config.globalProperties,ht(_,t))return _[t]},set({_:e},t,s){const{data:n,setupState:l,ctx:a}=e;return Za(l,t)?(l[t]=s,!0):n!==Ct&&ht(n,t)?(n[t]=s,!0):ht(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=s,!0)},has({_:{data:e,setupState:t,accessCache:s,ctx:n,appContext:l,props:a,type:c}},u){let i;return!!(s[u]||e!==Ct&&u[0]!=="$"&&ht(e,u)||Za(t,u)||ht(a,u)||ht(n,u)||ht(Fo,u)||ht(l.config.globalProperties,u)||(i=c.__cssModules)&&i[u])},defineProperty(e,t,s){return s.get!=null?e._.accessCache[t]=0:ht(s,"value")&&this.set(e,t,s.value,null),Reflect.defineProperty(e,t,s)}};function Wu(e){return Ge(e)?e.reduce((t,s)=>(t[s]=null,t),{}):e}let vr=!0;function Zm(e){const t=Kd(e),s=e.proxy,n=e.ctx;vr=!1,t.beforeCreate&&Ku(t.beforeCreate,e,"bc");const{data:l,computed:a,methods:c,watch:u,provide:i,inject:v,created:b,beforeMount:_,mounted:k,beforeUpdate:$,updated:L,activated:V,deactivated:j,beforeDestroy:q,beforeUnmount:z,destroyed:K,unmounted:N,render:B,renderTracked:H,renderTriggered:ce,errorCaptured:fe,serverPrefetch:Ne,expose:re,inheritAttrs:E,components:U,directives:de,filters:$e}=t;if(v&&Qm(v,n,null),c)for(const ee in c){const Oe=c[ee];et(Oe)&&(n[ee]=Oe.bind(s))}if(l){const ee=l.call(s,s);$t(ee)&&(e.data=Dt(ee))}if(vr=!0,a)for(const ee in a){const Oe=a[ee],je=et(Oe)?Oe.bind(s,s):et(Oe.get)?Oe.get.bind(s,s):Cn,ie=!et(Oe)&&et(Oe.set)?Oe.set.bind(s):Cn,S=ge({get:je,set:ie});Object.defineProperty(n,ee,{enumerable:!0,configurable:!0,get:()=>S.value,set:C=>S.value=C})}if(u)for(const ee in u)Wd(u[ee],n,s,ee);if(i){const ee=et(i)?i.call(s):i;Reflect.ownKeys(ee).forEach(Oe=>{Pm(Oe,ee[Oe])})}b&&Ku(b,e,"c");function g(ee,Oe){Ge(Oe)?Oe.forEach(je=>ee(je.bind(s))):Oe&&ee(Oe.bind(s))}if(g(Um,_),g(Fs,k),g(Fm,$),g(zm,L),g(Dm,V),g(Lm,j),g(Gm,fe),g(Km,H),g(Wm,ce),g(cl,z),g(Hm,N),g(Bm,Ne),Ge(re))if(re.length){const ee=e.exposed||(e.exposed={});re.forEach(Oe=>{Object.defineProperty(ee,Oe,{get:()=>s[Oe],set:je=>s[Oe]=je,enumerable:!0})})}else e.exposed||(e.exposed={});B&&e.render===Cn&&(e.render=B),E!=null&&(e.inheritAttrs=E),U&&(e.components=U),de&&(e.directives=de),Ne&&Fd(e)}function Qm(e,t,s=Cn){Ge(e)&&(e=hr(e));for(const n in e){const l=e[n];let a;$t(l)?"default"in l?a=ji(l.from||n,l.default,!0):a=ji(l.from||n):a=ji(l),It(a)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>a.value,set:c=>a.value=c}):t[n]=a}}function Ku(e,t,s){dn(Ge(e)?e.map(n=>n.bind(t.proxy)):e.bind(t.proxy),t,s)}function Wd(e,t,s,n){let l=n.includes(".")?Id(s,n):()=>s[n];if(Lt(e)){const a=t[e];et(a)&&it(l,a)}else if(et(e))it(l,e.bind(s));else if($t(e))if(Ge(e))e.forEach(a=>Wd(a,t,s,n));else{const a=et(e.handler)?e.handler.bind(s):t[e.handler];et(a)&&it(l,a,e)}}function Kd(e){const t=e.type,{mixins:s,extends:n}=t,{mixins:l,optionsCache:a,config:{optionMergeStrategies:c}}=e.appContext,u=a.get(t);let i;return u?i=u:!l.length&&!s&&!n?i=t:(i={},l.length&&l.forEach(v=>Bi(i,v,c,!0)),Bi(i,t,c)),$t(t)&&a.set(t,i),i}function Bi(e,t,s,n=!1){const{mixins:l,extends:a}=t;a&&Bi(e,a,s,!0),l&&l.forEach(c=>Bi(e,c,s,!0));for(const c in t)if(!(n&&c==="expose")){const u=Xm[c]||s&&s[c];e[c]=u?u(e[c],t[c]):t[c]}return e}const Xm={data:Gu,props:qu,emits:qu,methods:Eo,computed:Eo,beforeCreate:ws,created:ws,beforeMount:ws,mounted:ws,beforeUpdate:ws,updated:ws,beforeDestroy:ws,beforeUnmount:ws,destroyed:ws,unmounted:ws,activated:ws,deactivated:ws,errorCaptured:ws,serverPrefetch:ws,components:Eo,directives:Eo,watch:tv,provide:Gu,inject:ev};function Gu(e,t){return t?e?function(){return es(et(e)?e.call(this,this):e,et(t)?t.call(this,this):t)}:t:e}function ev(e,t){return Eo(hr(e),hr(t))}function hr(e){if(Ge(e)){const t={};for(let s=0;s<e.length;s++)t[e[s]]=e[s];return t}return e}function ws(e,t){return e?[...new Set([].concat(e,t))]:t}function Eo(e,t){return e?es(Object.create(null),e,t):t}function qu(e,t){return e?Ge(e)&&Ge(t)?[...new Set([...e,...t])]:es(Object.create(null),Wu(e),Wu(t??{})):t}function tv(e,t){if(!e)return t;if(!t)return e;const s=es(Object.create(null),e);for(const n in t)s[n]=ws(e[n],t[n]);return s}function Gd(){return{app:null,config:{isNativeTag:id,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 sv=0;function nv(e,t){return function(n,l=null){et(n)||(n=es({},n)),l!=null&&!$t(l)&&(l=null);const a=Gd(),c=new WeakSet,u=[];let i=!1;const v=a.app={_uid:sv++,_component:n,_props:l,_container:null,_context:a,_instance:null,version:Dv,get config(){return a.config},set config(b){},use(b,..._){return c.has(b)||(b&&et(b.install)?(c.add(b),b.install(v,..._)):et(b)&&(c.add(b),b(v,..._))),v},mixin(b){return a.mixins.includes(b)||a.mixins.push(b),v},component(b,_){return _?(a.components[b]=_,v):a.components[b]},directive(b,_){return _?(a.directives[b]=_,v):a.directives[b]},mount(b,_,k){if(!i){const $=v._ceVNode||st(n,l);return $.appContext=a,k===!0?k="svg":k===!1&&(k=void 0),e($,b,k),i=!0,v._container=b,b.__vue_app__=v,ga($.component)}},onUnmount(b){u.push(b)},unmount(){i&&(dn(u,v._instance,16),e(null,v._container),delete v._container.__vue_app__)},provide(b,_){return a.provides[b]=_,v},runWithContext(b){const _=no;no=v;try{return b()}finally{no=_}}};return v}}let no=null;const lv=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Cs(t)}Modifiers`]||e[`${rl(t)}Modifiers`];function ov(e,t,...s){if(e.isUnmounted)return;const n=e.vnode.props||Ct;let l=s;const a=t.startsWith("update:"),c=a&&lv(n,t.slice(7));c&&(c.trim&&(l=s.map(b=>Lt(b)?b.trim():b)),c.number&&(l=l.map(ui)));let u,i=n[u=Ba(t)]||n[u=Ba(Cs(t))];!i&&a&&(i=n[u=Ba(rl(t))]),i&&dn(i,e,6,l);const v=n[u+"Once"];if(v){if(!e.emitted)e.emitted={};else if(e.emitted[u])return;e.emitted[u]=!0,dn(v,e,6,l)}}const iv=new WeakMap;function qd(e,t,s=!1){const n=s?iv:t.emitsCache,l=n.get(e);if(l!==void 0)return l;const a=e.emits;let c={},u=!1;if(!et(e)){const i=v=>{const b=qd(v,t,!0);b&&(u=!0,es(c,b))};!s&&t.mixins.length&&t.mixins.forEach(i),e.extends&&i(e.extends),e.mixins&&e.mixins.forEach(i)}return!a&&!u?($t(e)&&n.set(e,null),null):(Ge(a)?a.forEach(i=>c[i]=null):es(c,a),$t(e)&&n.set(e,c),c)}function ha(e,t){return!e||!ia(t)?!1:(t=t.slice(2),t=t==="Once"?t:t.replace(/Once$/,""),ht(e,t[0].toLowerCase()+t.slice(1))||ht(e,rl(t))||ht(e,t))}function Ju(e){const{type:t,vnode:s,proxy:n,withProxy:l,propsOptions:[a],slots:c,attrs:u,emit:i,render:v,renderCache:b,props:_,data:k,setupState:$,ctx:L,inheritAttrs:V}=e,j=zi(e);let q,z;try{if(s.shapeFlag&4){const N=l||n,B=N;q=xn(v.call(B,N,b,_,$,k,L)),z=u}else{const N=t;q=xn(N.length>1?N(_,{attrs:u,slots:c,emit:i}):N(_,null)),z=t.props?u:av(u)}}catch(N){Ol.length=0,ma(N,e,1),q=st(fn)}let K=q;if(z&&V!==!1){const N=Object.keys(z),{shapeFlag:B}=K;N.length&&B&7&&(a&&N.some(aa)&&(z=rv(z,a)),K=oo(K,z,!1,!0))}if(s.dirs&&(K=oo(K,null,!1,!0),K.dirs=K.dirs?K.dirs.concat(s.dirs):s.dirs),s.transition){const N=va(K.type)&&Ud(K)||K;Lo(N,s.transition)}return q=K,zi(j),q}function Jd(e,t=!0){let s;for(let n=0;n<e.length;n++){const l=e[n];if(si(l)){if(l.type!==fn||l.children==="v-if"){if(s)return;s=l}}else return}return s}const av=e=>{let t;for(const s in e)(s==="class"||s==="style"||ia(s))&&((t||(t={}))[s]=e[s]);return t},rv=(e,t)=>{const s={};for(const n in e)(!aa(n)||!(n.slice(9)in t))&&(s[n]=e[n]);return s};function uv(e,t,s){const{props:n,children:l,component:a}=e,{props:c,children:u,patchFlag:i}=t,v=a.emitsOptions;if(t.dirs||t.transition)return!0;if(s&&i>=0){if(i&1024)return!0;if(i&16)return n?Yu(n,c,v):!!c;if(i&8){const b=t.dynamicProps;for(let _=0;_<b.length;_++){const k=b[_];if(Yd(c,n,k)&&!ha(v,k))return!0}}}else return(l||u)&&(!u||!u.$stable)?!0:n===c?!1:n?c?Yu(n,c,v):!0:!!c;return!1}function Yu(e,t,s){const n=Object.keys(t);if(n.length!==Object.keys(e).length)return!0;for(let l=0;l<n.length;l++){const a=n[l];if(!ht(e,a)||Yd(t,e,a)&&!ha(s,a))return!0}return!1}function Yd(e,t,s){const n=e[s],l=t[s];return s==="style"&&$t(n)&&$t(l)?!cn(n,l):n!==l}function cv({vnode:e,parent:t,suspense:s},n){for(;t;){const l=t.subTree;if(l.suspense&&l.suspense.activeBranch===e&&(l.suspense.vnode.el=l.el=n,e=l),l===e)(e=t.vnode).el=n,t=t.parent;else break}s&&s.activeBranch===e&&(s.vnode.el=n)}const Zd={},Qd=()=>Object.create(Zd),Xd=e=>Object.getPrototypeOf(e)===Zd;function dv(e,t,s,n=!1){const l={},a=Qd();e.propsDefaults=Object.create(null),ef(e,t,l,a);for(const c in e.propsOptions[0])c in l||(l[c]=void 0);s?e.props=n?l:hm(l):e.type.props?e.props=l:e.props=a,e.attrs=a}function fv(e,t,s,n){const{props:l,attrs:a,vnode:{patchFlag:c}}=e,u=kt(l),[i]=e.propsOptions;let v=!1;if((n||c>0)&&!(c&16)){if(c&8){const b=e.vnode.dynamicProps;for(let _=0;_<b.length;_++){let k=b[_];if(ha(e.emitsOptions,k))continue;const $=t[k];if(i)if(ht(a,k))$!==a[k]&&(a[k]=$,v=!0);else{const L=Cs(k);l[L]=br(i,u,L,$,e,!1)}else $!==a[k]&&(a[k]=$,v=!0)}}}else{ef(e,t,l,a)&&(v=!0);let b;for(const _ in u)(!t||!ht(t,_)&&((b=rl(_))===_||!ht(t,b)))&&(i?s&&(s[_]!==void 0||s[b]!==void 0)&&(l[_]=br(i,u,_,void 0,e,!0)):delete l[_]);if(a!==u)for(const _ in a)(!t||!ht(t,_))&&(delete a[_],v=!0)}v&&Dn(e.attrs,"set","")}function ef(e,t,s,n){const[l,a]=e.propsOptions;let c=!1,u;if(t)for(let i in t){if(Ro(i))continue;const v=t[i];let b;l&&ht(l,b=Cs(i))?!a||!a.includes(b)?s[b]=v:(u||(u={}))[b]=v:ha(e.emitsOptions,i)||(!(i in n)||v!==n[i])&&(n[i]=v,c=!0)}if(a){const i=kt(s),v=u||Ct;for(let b=0;b<a.length;b++){const _=a[b];s[_]=br(l,i,_,v[_],e,!ht(v,_))}}return c}function br(e,t,s,n,l,a){const c=e[s];if(c!=null){const u=ht(c,"default");if(u&&n===void 0){const i=c.default;if(c.type!==Function&&!c.skipFactory&&et(i)){const{propsDefaults:v}=l;if(s in v)n=v[s];else{const b=di(l);n=v[s]=i.call(null,t),b()}}else n=i;l.ce&&l.ce._setProp(s,n)}c[0]&&(a&&!u?n=!1:c[1]&&(n===""||n===rl(s))&&(n=!0))}return n}const pv=new WeakMap;function tf(e,t,s=!1){const n=s?pv:t.propsCache,l=n.get(e);if(l)return l;const a=e.props,c={},u=[];let i=!1;if(!et(e)){const b=_=>{i=!0;const[k,$]=tf(_,t,!0);es(c,k),$&&u.push(...$)};!s&&t.mixins.length&&t.mixins.forEach(b),e.extends&&b(e.extends),e.mixins&&e.mixins.forEach(b)}if(!a&&!i)return $t(e)&&n.set(e,Sl),Sl;if(Ge(a))for(let b=0;b<a.length;b++){const _=Cs(a[b]);Zu(_)&&(c[_]=Ct)}else if(a)for(const b in a){const _=Cs(b);if(Zu(_)){const k=a[b],$=c[_]=Ge(k)||et(k)?{type:k}:es({},k),L=$.type;let V=!1,j=!0;if(Ge(L))for(let q=0;q<L.length;++q){const z=L[q],K=et(z)&&z.name;if(K==="Boolean"){V=!0;break}else K==="String"&&(j=!1)}else V=et(L)&&L.name==="Boolean";$[0]=V,$[1]=j,(V||ht($,"default"))&&u.push(_)}}const v=[c,u];return $t(e)&&n.set(e,v),v}function Zu(e){return e[0]!=="$"&&!Ro(e)}const Kr=e=>e==="_"||e==="_ctx"||e==="$stable",Gr=e=>Ge(e)?e.map(xn):[xn(e)],mv=(e,t,s)=>{if(t._n)return t;const n=Dd((...l)=>Gr(t(...l)),s);return n._c=!1,n},sf=(e,t,s)=>{const n=e._ctx;for(const l in e){if(Kr(l))continue;const a=e[l];if(et(a))t[l]=mv(l,a,n);else if(a!=null){const c=Gr(a);t[l]=()=>c}}},nf=(e,t)=>{const s=Gr(t);e.slots.default=()=>s},lf=(e,t,s)=>{for(const n in t)(s||!Kr(n))&&(e[n]=t[n])},vv=(e,t,s)=>{const n=e.slots=Qd();if(e.vnode.shapeFlag&32){const l=t._;l?(lf(n,t,s),s&&cd(n,"_",l,!0)):sf(t,n)}else t&&nf(e,t)},hv=(e,t,s)=>{const{vnode:n,slots:l}=e;let a=!0,c=Ct;if(n.shapeFlag&32){const u=t._;u?s&&u===1?a=!1:lf(l,t,s):(a=!t.$stable,sf(t,l)),c=t}else t&&(nf(e,t),c={default:1});if(a)for(const u in l)!Kr(u)&&c[u]==null&&delete l[u]},$s=wv;function bv(e){return gv(e)}function gv(e,t){const s=da();s.__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:c,createText:u,createComment:i,setText:v,setElementText:b,parentNode:_,nextSibling:k,setScopeId:$=Cn,insertStaticContent:L}=e,V=(A,D,J,pe=null,me=null,ve=null,Ae=void 0,Te=null,xe=!!D.dynamicChildren)=>{if(A===D)return;A&&!So(A,D)&&(pe=se(A),C(A,me,ve,!0),A=null),D.patchFlag===-2&&(xe=!1,D.dynamicChildren=null),D.dynamicChildren&&A&&A.dynamicChildren&&A.dynamicChildren.hasOnce&&(D.dynamicChildren===Sl&&(D.dynamicChildren=[]),D.dynamicChildren.hasOnce=!0);const{type:ae,ref:De,shapeFlag:oe}=D;switch(ae){case ba:j(A,D,J,pe);break;case fn:q(A,D,J,pe);break;case Ri:A==null&&z(D,J,pe,Ae);break;case le:U(A,D,J,pe,me,ve,Ae,Te,xe);break;default:oe&1?B(A,D,J,pe,me,ve,Ae,Te,xe):oe&6?de(A,D,J,pe,me,ve,Ae,Te,xe):(oe&64||oe&128)&&ae.process(A,D,J,pe,me,ve,Ae,Te,xe,Z)}De!=null&&me?Io(De,A&&A.ref,ve,D||A,!D):De==null&&A&&A.ref!=null&&Io(A.ref,null,ve,A,!0)},j=(A,D,J,pe)=>{if(A==null)n(D.el=u(D.children),J,pe);else{const me=D.el=A.el;D.children!==A.children&&v(me,D.children)}},q=(A,D,J,pe)=>{A==null?n(D.el=i(D.children||""),J,pe):D.el=A.el},z=(A,D,J,pe)=>{[A.el,A.anchor]=L(A.children,D,J,pe,A.el,A.anchor)},K=({el:A,anchor:D},J,pe)=>{let me;for(;A&&A!==D;)me=k(A),n(A,J,pe),A=me;n(D,J,pe)},N=({el:A,anchor:D})=>{let J;for(;A&&A!==D;)J=k(A),l(A),A=J;l(D)},B=(A,D,J,pe,me,ve,Ae,Te,xe)=>{if(D.type==="svg"?Ae="svg":D.type==="math"&&(Ae="mathml"),A==null)H(D,J,pe,me,ve,Ae,Te,xe);else{const ae=A.el&&A.el._isVueCE?A.el:null;try{ae&&ae._beginPatch(),Ne(A,D,me,ve,Ae,Te,xe)}finally{ae&&ae._endPatch()}}},H=(A,D,J,pe,me,ve,Ae,Te)=>{let xe,ae;const{props:De,shapeFlag:oe,transition:Le,dirs:Ce}=A;if(xe=A.el=c(A.type,ve,De&&De.is,De),oe&8?b(xe,A.children):oe&16&&fe(A.children,xe,null,pe,me,Qa(A,ve),Ae,Te),Ce&&_l(A,null,pe,"created"),ce(xe,A,A.scopeId,Ae,pe),De){for(const Be in De)Be!=="value"&&!Ro(Be)&&a(xe,Be,null,De[Be],ve,pe);"value"in De&&a(xe,"value",null,De.value,ve),(ae=De.onVnodeBeforeMount)&&_n(ae,pe,A)}Ce&&_l(A,null,pe,"beforeMount");const he=_v(me,Le);he?Le.beforeEnter(xe):Le&&!Le.persisted&&(xe[kv]=!0),n(xe,D,J),((ae=De&&De.onVnodeMounted)||he||Ce)&&$s(()=>{try{ae&&_n(ae,pe,A),he&&Le.enter(xe),Ce&&_l(A,null,pe,"mounted")}finally{}},me)},ce=(A,D,J,pe,me)=>{if(J&&$(A,J),pe)for(let ve=0;ve<pe.length;ve++)$(A,pe[ve]);if(me){let ve=me.subTree;if(D===ve||rf(ve.type)&&(ve.ssContent===D||ve.ssFallback===D)){const Ae=me.vnode;ce(A,Ae,Ae.scopeId,Ae.slotScopeIds,me.parent)}}},fe=(A,D,J,pe,me,ve,Ae,Te,xe=0)=>{for(let ae=xe;ae<A.length;ae++){const De=A[ae]=Te?Vn(A[ae]):xn(A[ae]);V(null,De,D,J,pe,me,ve,Ae,Te)}},Ne=(A,D,J,pe,me,ve,Ae)=>{const Te=D.el=A.el;let{patchFlag:xe,dynamicChildren:ae,dirs:De}=D;xe|=A.patchFlag&16;const oe=A.props||Ct,Le=D.props||Ct;let Ce;if(J&&yl(J,!1),(Ce=Le.onVnodeBeforeUpdate)&&_n(Ce,J,D,A),De&&_l(D,A,J,"beforeUpdate"),J&&yl(J,!0),ae&&(!A.dynamicChildren||A.dynamicChildren.length!==ae.length)&&(xe=0,Ae=!1,ae=null),(oe.innerHTML&&Le.innerHTML==null||oe.textContent&&Le.textContent==null)&&b(Te,""),ae?re(A.dynamicChildren,ae,Te,J,pe,Qa(D,me),ve):Ae||Oe(A,D,Te,null,J,pe,Qa(D,me),ve,!1),xe>0){if(xe&16)E(Te,oe,Le,J,me);else if(xe&2&&oe.class!==Le.class&&a(Te,"class",null,Le.class,me),xe&4&&a(Te,"style",oe.style,Le.style,me),xe&8){const he=D.dynamicProps;for(let Be=0;Be<he.length;Be++){const G=he[Be],X=oe[G],ue=Le[G];(ue!==X||G==="value")&&a(Te,G,X,ue,me,J)}}xe&1&&A.children!==D.children&&b(Te,D.children)}else!Ae&&ae==null&&E(Te,oe,Le,J,me);((Ce=Le.onVnodeUpdated)||De)&&$s(()=>{Ce&&_n(Ce,J,D,A),De&&_l(D,A,J,"updated")},pe)},re=(A,D,J,pe,me,ve,Ae)=>{for(let Te=0;Te<D.length;Te++){const xe=A[Te],ae=D[Te],De=xe.el||zo(xe),oe=De&&(xe.type===le||!So(xe,ae)||xe.shapeFlag&198)?_(De):J;V(xe,ae,oe,null,pe,me,ve,Ae,!0)}},E=(A,D,J,pe,me)=>{if(D!==J){if(D!==Ct)for(const ve in D)!Ro(ve)&&!(ve in J)&&a(A,ve,D[ve],null,me,pe);for(const ve in J){if(Ro(ve))continue;const Ae=J[ve],Te=D[ve];Ae!==Te&&ve!=="value"&&a(A,ve,Te,Ae,me,pe)}"value"in J&&a(A,"value",D.value,J.value,me)}},U=(A,D,J,pe,me,ve,Ae,Te,xe)=>{const ae=D.el=A?A.el:u(""),De=D.anchor=A?A.anchor:u("");let{patchFlag:oe,dynamicChildren:Le,slotScopeIds:Ce}=D;Ce&&(Te=Te?Te.concat(Ce):Ce),A==null?(n(ae,J,pe),n(De,J,pe),fe(D.children||[],J,De,me,ve,Ae,Te,xe)):oe>0&&oe&64&&Le&&A.dynamicChildren&&A.dynamicChildren.length===Le.length?(re(A.dynamicChildren,Le,J,me,ve,Ae,Te),(D.key!=null||me&&D===me.subTree)&&of(A,D,!0)):Oe(A,D,J,De,me,ve,Ae,Te,xe)},de=(A,D,J,pe,me,ve,Ae,Te,xe)=>{D.slotScopeIds=Te,A==null?D.shapeFlag&512?me.ctx.activate(D,J,pe,Ae,xe):$e(D,J,pe,me,ve,Ae,xe):I(A,D,xe)},$e=(A,D,J,pe,me,ve,Ae)=>{const Te=A.component=Ov(A,pe,me);if(Wr(A)&&(Te.ctx.renderer=Z),Pv(Te,!1,Ae),Te.asyncDep){if(me&&me.registerDep(Te,g,Ae,ve),!A.el){const xe=Te.subTree=st(fn);q(null,xe,D,J),A.placeholder=xe.el}}else g(Te,A,D,J,me,ve,Ae)},I=(A,D,J)=>{const pe=D.component=A.component;if(uv(A,D,J))if(pe.asyncDep&&!pe.asyncResolved){D.el=A.el,D.placeholder=A.placeholder,ee(pe,D,J);return}else pe.next=D,pe.update();else D.el=A.el,D.placeholder=A.placeholder,pe.vnode=D},g=(A,D,J,pe,me,ve,Ae)=>{const Te=()=>{if(A.isMounted){let{next:oe,bu:Le,u:Ce,parent:he,vnode:Be}=A;{const pt=af(A);if(pt){oe&&(oe.el=Be.el,ee(A,oe,Ae)),pt.asyncDep.then(()=>{const lt=()=>{A.job.flags&8||(me&&me.pendingBranch?$s(lt,me):ae())};lt.flags=48,$s(lt,me)});return}}let G=oe,X;yl(A,!1),oe?(oe.el=Be.el,ee(A,oe,Ae)):oe=Be,Le&&Ni(Le),(X=oe.props&&oe.props.onVnodeBeforeUpdate)&&_n(X,he,oe,Be),yl(A,!0);const ue=Ju(A),qe=A.subTree;A.subTree=ue,V(qe,ue,_(qe.el||zo(qe)),se(qe),A,me,ve),oe.el=ue.el,G===null&&cv(A,ue.el),Ce&&$s(Ce,me),(X=oe.props&&oe.props.onVnodeUpdated)&&$s(()=>_n(X,he,oe,Be),me)}else{let oe;const{el:Le,props:Ce}=D,{bm:he,m:Be,parent:G,root:X,type:ue}=A,qe=Uo(D);yl(A,!1),he&&Ni(he),!qe&&(oe=Ce&&Ce.onVnodeBeforeMount)&&_n(oe,G,D),yl(A,!0);{X.ce&&X.ce._hasShadowRoot()&&X.ce._injectChildStyle(ue,A.parent?A.parent.type:void 0);const pt=A.subTree=Ju(A);V(null,pt,J,pe,A,me,ve),D.el=pt.el}if(Be&&$s(Be,me),!qe&&(oe=Ce&&Ce.onVnodeMounted)){const pt=D;$s(()=>_n(oe,G,pt),me)}(D.shapeFlag&256||G&&Uo(G.vnode)&&G.vnode.shapeFlag&256)&&A.a&&$s(A.a,me),A.isMounted=!0,D=J=pe=null}};A.scope.on();const xe=A.effect=new md(Te);A.scope.off();const ae=A.update=xe.run.bind(xe),De=A.job=xe.runIfDirty.bind(xe);De.i=A,De.id=A.uid,xe.scheduler=()=>Br(De),yl(A,!0),ae()},ee=(A,D,J)=>{D.component=A;const pe=A.vnode.props;A.vnode=D,A.next=null,fv(A,D.props,pe,J),hv(A,D.children,J),An(),Nd(A),Tn()},Oe=(A,D,J,pe,me,ve,Ae,Te,xe=!1)=>{const ae=A&&A.children,De=A?A.shapeFlag:0,oe=D.children,{patchFlag:Le,shapeFlag:Ce}=D;if(Le>0){if(Le&128){ie(ae,oe,J,pe,me,ve,Ae,Te,xe);return}else if(Le&256){je(ae,oe,J,pe,me,ve,Ae,Te,xe);return}}Ce&8?(De&16&&be(ae,me,ve),oe!==ae&&b(J,oe)):De&16?Ce&16?ie(ae,oe,J,pe,me,ve,Ae,Te,xe):be(ae,me,ve,!0):(De&8&&b(J,""),Ce&16&&fe(oe,J,pe,me,ve,Ae,Te,xe))},je=(A,D,J,pe,me,ve,Ae,Te,xe)=>{A=A||Sl,D=D||Sl;const ae=A.length,De=D.length,oe=Math.min(ae,De);let Le;for(Le=0;Le<oe;Le++){const Ce=D[Le]=xe?Vn(D[Le]):xn(D[Le]);V(A[Le],Ce,J,null,me,ve,Ae,Te,xe)}ae>De?be(A,me,ve,!0,!1,oe):fe(D,J,pe,me,ve,Ae,Te,xe,oe)},ie=(A,D,J,pe,me,ve,Ae,Te,xe)=>{let ae=0;const De=D.length;let oe=A.length-1,Le=De-1;for(;ae<=oe&&ae<=Le;){const Ce=A[ae],he=D[ae]=xe?Vn(D[ae]):xn(D[ae]);if(So(Ce,he))V(Ce,he,J,null,me,ve,Ae,Te,xe);else break;ae++}for(;ae<=oe&&ae<=Le;){const Ce=A[oe],he=D[Le]=xe?Vn(D[Le]):xn(D[Le]);if(So(Ce,he))V(Ce,he,J,null,me,ve,Ae,Te,xe);else break;oe--,Le--}if(ae>oe){if(ae<=Le){const Ce=Le+1,he=Ce<De?D[Ce].el:pe;for(;ae<=Le;)V(null,D[ae]=xe?Vn(D[ae]):xn(D[ae]),J,he,me,ve,Ae,Te,xe),ae++}}else if(ae>Le)for(;ae<=oe;)C(A[ae],me,ve,!0),ae++;else{const Ce=ae,he=ae,Be=new Map;for(ae=he;ae<=Le;ae++){const tt=D[ae]=xe?Vn(D[ae]):xn(D[ae]);tt.key!=null&&Be.set(tt.key,ae)}let G,X=0;const ue=Le-he+1;let qe=!1,pt=0;const lt=new Array(ue);for(ae=0;ae<ue;ae++)lt[ae]=0;for(ae=Ce;ae<=oe;ae++){const tt=A[ae];if(X>=ue){C(tt,me,ve,!0);continue}let jt;if(tt.key!=null)jt=Be.get(tt.key);else for(G=he;G<=Le;G++)if(lt[G-he]===0&&So(tt,D[G])){jt=G;break}jt===void 0?C(tt,me,ve,!0):(lt[jt-he]=ae+1,jt>=pt?pt=jt:qe=!0,V(tt,D[jt],J,null,me,ve,Ae,Te,xe),X++)}const St=qe?yv(lt):Sl;for(G=St.length-1,ae=ue-1;ae>=0;ae--){const tt=he+ae,jt=D[tt],Kn=D[tt+1],pn=tt+1<De?Kn.el||zo(Kn):pe;lt[ae]===0?V(null,jt,J,pn,me,ve,Ae,Te,xe):qe&&(G<0||ae!==St[G]?S(jt,J,pn,2):G--)}}},S=(A,D,J,pe,me=null)=>{const{el:ve,type:Ae,transition:Te,children:xe,shapeFlag:ae}=A;if(ae&6){S(A.component.subTree,D,J,pe);return}if(ae&128){A.suspense.move(D,J,pe);return}if(ae&64){Ae.move(A,D,J,Z);return}if(Ae===le){n(ve,D,J);for(let oe=0;oe<xe.length;oe++)S(xe[oe],D,J,pe);n(A.anchor,D,J);return}if(Ae===Ri){K(A,D,J);return}if(pe!==2&&ae&1&&Te)if(pe===0)Te.persisted&&!ve[Ya]?n(ve,D,J):(Te.beforeEnter(ve),n(ve,D,J),$s(()=>Te.enter(ve),me));else{const{leave:oe,delayLeave:Le,afterLeave:Ce}=Te,he=()=>{A.ctx.isUnmounted?l(ve):n(ve,D,J)},Be=()=>{const G=ve._isLeaving||!!ve[Ya];ve._isLeaving&&ve[Ya](!0),Te.persisted&&!G?he():oe(ve,()=>{he(),Ce&&Ce()})};Le?Le(ve,he,Be):Be()}else n(ve,D,J)},C=(A,D,J,pe=!1,me=!1)=>{const{type:ve,props:Ae,ref:Te,children:xe,dynamicChildren:ae,shapeFlag:De,patchFlag:oe,dirs:Le,cacheIndex:Ce,memo:he}=A;if((oe===-2||ae&&ae.hasOnce)&&(me=!1),Te!=null&&(An(),Io(Te,null,J,A,!0),Tn()),Ce!=null&&(!A.ctx||A.ctx===D)&&(D.renderCache[Ce]=void 0),De&256&&D.ctx.deactivate(A))return;const Be=De&1&&Le,G=!Uo(A);let X;if(G&&(X=Ae&&Ae.onVnodeBeforeUnmount)&&_n(X,D,A),De&6)O(A.component,J,pe);else{if(De&128){A.suspense.unmount(J,pe);return}Be&&_l(A,null,D,"beforeUnmount"),De&64?A.type.remove(A,D,J,Z,pe):ae&&!ae.hasOnce&&(ve!==le||oe>0&&oe&64)?be(ae,D,J,!1,!0):(ve===le&&oe&384||!me&&De&16)&&be(xe,D,J),pe&&F(A)}const ue=he!=null&&Ce==null;(G&&(X=Ae&&Ae.onVnodeUnmounted)||Be||ue)&&$s(()=>{X&&_n(X,D,A),Be&&_l(A,null,D,"unmounted"),ue&&(A.el=null)},J)},F=A=>{const{type:D,el:J,anchor:pe,transition:me}=A,ve=D===le;if(ve&&!me){x(J,pe);return}if(D===Ri){N(A),me&&!me.persisted&&me.afterLeave&&me.afterLeave();return}const Ae=ve?pr(A):A,Te=()=>{ve?_(J)&&x(J,pe):l(J),me&&!me.persisted&&me.afterLeave&&me.afterLeave()};if(Ae&&Ae.shapeFlag&1&&me&&!me.persisted){const{leave:xe,delayLeave:ae}=me,De=Ae.el,oe=()=>xe(De,Te);ae?ae(De,Te,oe):oe()}else Te()},x=(A,D)=>{let J;for(;A!==D;)J=k(A),l(A),A=J;l(D)},O=(A,D,J)=>{const{bum:pe,scope:me,job:ve,subTree:Ae,um:Te,m:xe,a:ae}=A;Qu(xe),Qu(ae),pe&&Ni(pe),me.stop(),ve?(ve.flags|=8,C(Ae,A,D,J)):Ae&&(Ae.transition=A.vnode.transition,C(Ae,A,D,J)),Te&&$s(Te,D);const De=()=>{A.isUnmounted=!0};De.flags=16,$s(De,D)},be=(A,D,J,pe=!1,me=!1,ve=0)=>{for(let Ae=ve;Ae<A.length;Ae++)C(A[Ae],D,J,pe,me)},se=A=>{if(A.shapeFlag&6)return se(A.component.subTree);if(A.shapeFlag&128)return A.suspense.next();const D=k(A.anchor||A.el),J=D&&D[Rm];return J?k(J):D},ft=(A,D,J)=>{const pe=A&&D._vnode?void 0:A&&A.component?A.component.uid:Tv();Em(()=>{A==null?D._vnode&&C(D._vnode,null,null,!0):V(D._vnode||null,A,D,null,null,null,J),D._vnode=A},pe)},Z={p:V,um:C,m:S,r:F,mt:$e,mc:fe,pc:Oe,pbc:re,n:se,o:e};return{render:ft,hydrate:void 0,createApp:nv(ft)}}function Qa({type:e,props:t},s){return s==="svg"&&e==="foreignObject"||s==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:s}function yl({effect:e,job:t},s){s?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function _v(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function of(e,t,s=!1){const n=e.children,l=t.children;if(Ge(n)&&Ge(l))for(let a=0;a<n.length;a++){const c=n[a];let u=l[a];u.shapeFlag&1&&!u.dynamicChildren&&((u.patchFlag<=0||u.patchFlag===32)&&(u=l[a]=Vn(l[a]),u.el=c.el),!s&&u.patchFlag!==-2&&of(c,u)),u.type===ba&&(u.patchFlag===-1&&(u=l[a]=Vn(u)),u.el=c.el),u.type===fn&&!u.el&&(u.el=c.el)}}function yv(e){const t=e.slice(),s=[0];let n,l,a,c,u;const i=e.length;for(n=0;n<i;n++){const v=e[n];if(v!==0){if(l=s[s.length-1],e[l]<v){t[n]=l,s.push(n);continue}for(a=0,c=s.length-1;a<c;)u=a+c>>1,e[s[u]]<v?a=u+1:c=u;v<e[s[a]]&&(a>0&&(t[n]=s[a-1]),s[a]=n)}}for(a=s.length,c=s[a-1];a-- >0;)s[a]=c,c=t[c];return s}function af(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:af(t)}function Qu(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function zo(e){if(e.placeholder)return e.placeholder;const t=e.component;if(t)return zo(t.subTree);const s=e.suspense;return s&&s.activeBranch?zo(s.activeBranch):null}const rf=e=>e.__isSuspense,kv=Symbol("_deferredEnter");function wv(e,t){t&&t.pendingBranch?Ge(e)?t.effects.push(...e):t.effects.push(e):Om(e)}const le=Symbol.for("v-fgt"),ba=Symbol.for("v-txt"),fn=Symbol.for("v-cmt"),Ri=Symbol.for("v-stc"),Ol=[];let Ds=null;function p(e=!1){Ol.push(Ds=e?null:[])}function uf(){Ol.pop(),Ds=Ol[Ol.length-1]||null}let ti=1;function Wi(e,t=!1){ti+=e,e<0&&Ds&&t&&(Ds.hasOnce=!0)}function cf(e){return e.dynamicChildren=ti>0?Ds||Sl:null,uf(),ti>0&&Ds&&Ds.push(e),e}function h(e,t,s,n,l,a){return cf(o(e,t,s,n,l,a,!0))}function vt(e,t,s,n,l){return cf(st(e,t,s,n,l,!0))}function si(e){return e?e.__v_isVNode===!0:!1}function So(e,t){return e.type===t.type&&e.key===t.key}const df=({key:e})=>e??null,Vi=({ref:e,ref_key:t,ref_for:s})=>(typeof e=="number"&&(e=""+e),e!=null?Lt(e)||It(e)||et(e)?{i:Vs,r:e,k:t,f:!!s}:e:null);function o(e,t=null,s=null,n=0,l=null,a=e===le?0:1,c=!1,u=!1){const i={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&df(t),ref:t&&Vi(t),scopeId:Vd,slotScopeIds:null,children:s,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:a,patchFlag:n,dynamicProps:l,dynamicChildren:null,appContext:null,ctx:Vs};return u?(Ki(i,s),a&128&&e.normalize(i)):s&&(i.shapeFlag|=Lt(s)?8:16),ti>0&&!c&&Ds&&(i.patchFlag>0||a&6)&&i.patchFlag!==32&&Ds.push(i),i}const st=$v;function $v(e,t=null,s=null,n=0,l=null,a=!1){if((!e||e===Hd)&&(e=fn),si(e)){const u=oo(e,t,!0);return s&&Ki(u,s),ti>0&&!a&&Ds&&(u.shapeFlag&6?Ds[Ds.indexOf(e)]=u:Ds.push(u)),u.patchFlag=-2,u}if(Vv(e)&&(e=e.__vccOpts),t){t=xv(t);let{class:u,style:i}=t;u&&!Lt(u)&&(t.class=Ve(u)),$t(i)&&(pa(i)&&!Ge(i)&&(i=es({},i)),t.style=Rl(i))}const c=Lt(e)?1:rf(e)?128:va(e)?64:$t(e)?4:et(e)?2:0;return o(e,t,s,n,l,c,a,!0)}function xv(e){return e?pa(e)?es({},e):Xd(e)?es({},e[vf]||e):e:null}function oo(e,t,s=!1,n=!1){const{props:l,ref:a,patchFlag:c,children:u,transition:i}=e,v=t?Cv(l||{},t):l,b={__v_isVNode:!0,__v_skip:!0,type:e.type,props:v,key:v&&df(v),ref:t&&t.ref?s&&a?Ge(a)?a.concat(Vi(t)):[a,Vi(t)]:Vi(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:u,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==le?c===-1?16:c|16:c,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:i,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&oo(e.ssContent),ssFallback:e.ssFallback&&oo(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce,cacheIndex:e.cacheIndex};return i&&n&&Lo(b,i.clone(b)),b}function Y(e=" ",t=0){return st(ba,null,e,t)}function Sv(e,t){const s=st(Ri,null,e);return s.staticCount=t,s}function R(e="",t=!1){return t?(p(),vt(fn,null,e)):st(fn,null,e)}function xn(e){return e==null||typeof e=="boolean"?st(fn):Ge(e)?st(le,null,e.slice()):si(e)?Vn(e):st(ba,null,String(e))}function Vn(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:oo(e)}function Ki(e,t){let s=0;const{shapeFlag:n}=e;if(t==null)t=null;else if(Ge(t))s=16;else if(typeof t=="object")if(n&65){const l=t.default;l&&(l._c&&(l._d=!1),Ki(e,l()),l._c&&(l._d=!0));return}else{s=32;const l=t._;!l&&!Xd(t)?t._ctx=Vs:l===3&&Vs&&(Vs.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else if(et(t)){if(n&65){Ki(e,{default:t});return}t={default:t,_ctx:Vs},s=32}else t=String(t),n&64?(s=16,t=[Y(t)]):s=8;e.children=t,e.shapeFlag|=s}function Cv(...e){const t={};for(let s=0;s<e.length;s++){const n=e[s];for(const l in n)if(l==="class")t.class!==n.class&&(t.class=Ve([t.class,n.class]));else if(l==="style")t.style=Rl([t.style,n.style]);else if(ia(l)){const a=t[l],c=n[l];c&&a!==c&&!(Ge(a)&&a.includes(c))?t[l]=a?[].concat(a,c):c:c==null&&a==null&&!aa(l)&&(t[l]=c)}else l!==""&&(t[l]=n[l])}return t}function _n(e,t,s,n=null){dn(e,t,7,[s,n])}const Av=Gd();let ff=0;function Tv(){return ff}function Ov(e,t,s){const n=e.type,l=(t?t.appContext:e.appContext)||Av,a={uid:ff++,vnode:e,type:n,parent:t,appContext:l,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new Zp(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(l.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:tf(n,l),emitsOptions:qd(n,l),emit:null,emitted:null,propsDefaults:Ct,inheritAttrs:n.inheritAttrs,ctx:Ct,data:Ct,props:Ct,attrs:Ct,slots:Ct,refs:Ct,setupState:Ct,setupContext:null,suspense:s,suspenseId:s?s.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 a.ctx={_:a},a.root=t?t.root:a,a.emit=ov.bind(null,a),e.ce&&e.ce(a),a}let vs=null;const Ev=()=>vs||Vs;let Gi,ni;{const e=da(),t=(s,n)=>{let l;return(l=e[s])||(l=e[s]=[]),l.push(n),a=>{l.length>1?l.forEach(c=>c(a)):l[0](a)}};Gi=t("__VUE_INSTANCE_SETTERS__",s=>vs=s),ni=t("__VUE_SSR_SETTERS__",s=>li=s)}const di=e=>{const t=vs;return Gi(e),e.scope.on(),()=>{e.scope.off(),Gi(t)}},Xu=()=>{vs&&vs.scope.off(),Gi(null)};function pf(e){return e.vnode.shapeFlag&4}let li=!1;function Pv(e,t=!1,s=!1){t&&ni(t);const{props:n,children:l}=e.vnode,a=pf(e);dv(e,n,a,t),vv(e,l,s||t);const c=a?Mv(e,t):void 0;return t&&ni(!1),c}function Mv(e,t){const s=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Ym);const{setup:n}=s;if(n){An();const l=e.setupContext=n.length>1?jv(e):null,a=di(e),c=ci(n,e,0,[e.props,l]),u=ad(c);if(Tn(),a(),(u||e.sp)&&!Uo(e)&&Fd(e),u){if(c.then(Xu,Xu),t)return c.then(i=>{ni(!0);try{ec(e,i,t)}finally{ni(!1)}}).catch(i=>{ma(i,e,0,void 0,!0),e.ssrRender=(v,b)=>b("<!---->")});e.asyncDep=c}else ec(e,c)}else mf(e)}function ec(e,t,s){et(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:$t(t)&&(e.setupState=Ed(t)),mf(e)}function mf(e,t,s){const n=e.type;e.render||(e.render=n.render||Cn);{const l=di(e);An();try{Zm(e)}finally{Tn(),l()}}}const vf=Symbol(),Nv={get(e,t){return ps(e,"get",""),t===vf?e:e[t]}};function jv(e){const t=s=>{e.exposed=s||{}};return{attrs:new Proxy(e.attrs,Nv),slots:e.slots,emit:e.emit,expose:t}}function ga(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Ed(Ps(e.exposed)),{get(t,s){if(s in t)return t[s];if(s in Fo)return Fo[s](e)},has(t,s){return s in t||s in Fo}})):e.proxy}function Rv(e,t=!0){return et(e)?e.displayName||e.name:e.name||t&&e.__name}function Vv(e){return et(e)&&"__vccOpts"in e}const ge=(e,t)=>xm(e,t,li);function gr(e,t,s){try{Wi(-1);const n=arguments.length;return n===2?$t(t)&&!Ge(t)?si(t)?st(e,null,[t]):st(e,t):st(e,null,t):(n>3?s=Array.prototype.slice.call(arguments,2):n===3&&si(s)&&(s=[s]),st(e,t,s))}finally{Wi(1)}}const Dv="3.5.46";/**
14
+ * @vue/runtime-dom v3.5.46
15
+ * (c) 2018-present Yuxi (Evan) You and Vue contributors
16
+ * @license MIT
17
+ **/let _r;const tc=typeof window<"u"&&window.trustedTypes;if(tc)try{_r=tc.createPolicy("vue",{createHTML:e=>e})}catch{}const hf=_r?e=>_r.createHTML(e):e=>e,Lv="http://www.w3.org/2000/svg",Iv="http://www.w3.org/1998/Math/MathML",Rn=typeof document<"u"?document:null,sc=Rn&&Rn.createElement("template"),Uv={insert:(e,t,s)=>{t.insertBefore(e,s||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,s,n)=>{const l=t==="svg"?Rn.createElementNS(Lv,e):t==="mathml"?Rn.createElementNS(Iv,e):s?Rn.createElement(e,{is:s}):Rn.createElement(e);return e==="select"&&n&&n.multiple!=null&&l.setAttribute("multiple",n.multiple),l},createText:e=>Rn.createTextNode(e),createComment:e=>Rn.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Rn.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,s,n,l,a){const c=s?s.previousSibling:t.lastChild;if(l&&(l===a||l.nextSibling))for(;t.insertBefore(l.cloneNode(!0),s),!(l===a||!(l=l.nextSibling)););else{sc.innerHTML=hf(n==="svg"?`<svg>${e}</svg>`:n==="mathml"?`<math>${e}</math>`:e);const u=sc.content;if(n==="svg"||n==="mathml"){const i=u.firstChild;for(;i.firstChild;)u.appendChild(i.firstChild);u.removeChild(i)}t.insertBefore(u,s)}return[c?c.nextSibling:t.firstChild,s?s.previousSibling:t.lastChild]}},Fv=Symbol("_vtc");function zv(e,t,s){const n=e[Fv];n&&(t=(t?[t,...n]:[...n]).join(" ")),t==null?e.removeAttribute("class"):s?e.setAttribute("class",t):e.className=t}const qi=Symbol("_vod"),bf=Symbol("_vsh"),qr={name:"show",beforeMount(e,{value:t},{transition:s}){e[qi]=e.style.display==="none"?"":e.style.display,s&&t?s.beforeEnter(e):Co(e,t)},mounted(e,{value:t},{transition:s}){s&&t&&s.enter(e)},updated(e,{value:t,oldValue:s},{transition:n}){!t!=!s&&(n?t?(n.beforeEnter(e),Co(e,!0),n.enter(e)):n.leave(e,()=>{Co(e,!1)}):Co(e,t))},beforeUnmount(e,{value:t}){Co(e,t)}};function Co(e,t){e.style.display=t?e[qi]:"none",e[bf]=!t}const Hv=Symbol(""),Bv=/(?:^|;)\s*display\s*:/;function Wv(e,t,s){const n=e.style,l=Lt(s);let a=!1;if(s&&!l){if(t)if(Lt(t))for(const c of t.split(";")){const u=c.slice(0,c.indexOf(":")).trim();s[u]==null&&Po(n,u,"")}else for(const c in t)s[c]==null&&Po(n,c,"");for(const c in s){c==="display"&&(a=!0);const u=s[c];u!=null?Gv(e,c,!Lt(t)&&t?t[c]:void 0,u)||Po(n,c,u):Po(n,c,"")}}else if(l){if(t!==s){const c=n[Hv];c&&(s+=";"+c),n.cssText=s,a=Bv.test(s)}}else t&&e.removeAttribute("style");qi in e&&((!l||t!==s)&&(e[qi]=a?n.display:""),e[bf]&&(n.display="none"))}const Ci=/\s*!important$/;function Po(e,t,s){if(Ge(s))s.forEach(n=>Po(e,t,n));else if(s==null&&(s=""),t.startsWith("--"))Ci.test(s)?e.setProperty(t,s.replace(Ci,""),"important"):e.setProperty(t,s);else{const n=Kv(e,t);Ci.test(s)?e.setProperty(rl(n),s.replace(Ci,""),"important"):e[n]=s}}const nc=["Webkit","Moz","ms"],Xa={};function Kv(e,t){const s=Xa[t];if(s)return s;let n=Cs(t);if(n!=="filter"&&n in e)return Xa[t]=n;n=ca(n);for(let l=0;l<nc.length;l++){const a=nc[l]+n;if(a in e)return Xa[t]=a}return t}function Gv(e,t,s,n){return e.tagName==="TEXTAREA"&&(t==="width"||t==="height")&&Lt(n)&&s===n}const lc="http://www.w3.org/1999/xlink";function oc(e,t,s,n,l,a=qp(t)){n&&t.startsWith("xlink:")?s==null?e.removeAttributeNS(lc,t.slice(6,t.length)):e.setAttributeNS(lc,t,s):s==null||a&&!dd(s)?e.removeAttribute(t):e.setAttribute(t,a?"":Ys(s)?String(s):s)}function ic(e,t,s,n,l){if(t==="innerHTML"||t==="textContent"){s!=null&&(e[t]=t==="innerHTML"?hf(s):s);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const u=a==="OPTION"?e.getAttribute("value")||"":e.value,i=s==null?e.type==="checkbox"?"on":"":String(s);(u!==i||!("_value"in e))&&(e.value=i),s==null&&e.removeAttribute(t),e._value=s;return}let c=!1;if(s===""||s==null){const u=typeof e[t];u==="boolean"?s=dd(s):s==null&&u==="string"?(s="",c=!0):u==="number"&&(s=0,c=!0)}try{e[t]=s}catch{}c&&e.removeAttribute(l||t)}function In(e,t,s,n){e.addEventListener(t,s,n)}function qv(e,t,s,n){e.removeEventListener(t,s,n)}const ac=Symbol("_vei");function Jv(e,t,s,n,l=null){const a=e[ac]||(e[ac]={}),c=a[t];if(n&&c)c.value=n;else{const[u,i]=Qv(t);if(n){const v=a[t]=t1(n,l);In(e,u,v,i)}else c&&(qv(e,u,c,i),a[t]=void 0)}}const Yv=/(Once|Passive|Capture)$/,Zv=/^on:?(?:Once|Passive|Capture)$/;function Qv(e){let t,s;for(;(s=e.match(Yv))&&!Zv.test(e);)t||(t={}),e=e.slice(0,e.length-s[1].length),t[s[1].toLowerCase()]=!0;return[e[2]===":"?e.slice(3):rl(e.slice(2)),t]}let er=0;const Xv=Promise.resolve(),e1=()=>er||(Xv.then(()=>er=0),er=Date.now());function t1(e,t){const s=n=>{if(!n._vts)n._vts=Date.now();else if(n._vts<=s.attached)return;const l=s.value;if(Ge(l)){const a=n.stopImmediatePropagation;n.stopImmediatePropagation=()=>{a.call(n),n._stopped=!0};const c=l.slice(),u=[n];for(let i=0;i<c.length&&!n._stopped;i++){const v=c[i];v&&dn(v,t,5,u)}}else dn(l,t,5,[n])};return s.value=e,s.attached=e1(),s}const rc=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,s1=(e,t,s,n,l,a)=>{const c=l==="svg";t==="class"?zv(e,n,c):t==="style"?Wv(e,s,n):ia(t)?aa(t)||Jv(e,t,s,n,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):n1(e,t,n,c))?(ic(e,t,n),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&oc(e,t,n,c,a,t!=="value")):e._isVueCE&&(l1(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!Lt(n)))?ic(e,Cs(t),n,a,t):(t==="true-value"?e._trueValue=n:t==="false-value"&&(e._falseValue=n),oc(e,t,n,c))};function n1(e,t,s,n){if(n)return!!(t==="innerHTML"||t==="textContent"||t in e&&rc(t)&&et(s));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const l=e.tagName;if(l==="IMG"||l==="VIDEO"||l==="CANVAS"||l==="SOURCE")return!1}return rc(t)&&Lt(s)?!1:t in e}function l1(e,t){const s=e._def.props;if(!s)return!1;const n=Cs(t);return Array.isArray(s)?s.some(l=>Cs(l)===n):Object.keys(s).some(l=>Cs(l)===n)}const il=e=>{const t=e.props["onUpdate:modelValue"]||!1;return Ge(t)?s=>Ni(t,s):t};function o1(e){e.target.composing=!0}function uc(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Ls=Symbol("_assign"),Ai=Symbol("_initialValue");function tr(e,t,s){return t&&(e=e.trim()),s&&(e=ui(e)),e}const Re={created(e,{modifiers:{lazy:t,trim:s,number:n}},l){e.parentNode&&(e.type==="text"?e[Ai]=e.defaultValue.replace(/[\r\n]/g,""):e.type==="textarea"&&(e[Ai]=e.defaultValue.replace(/\r\n?/g,`
18
+ `))),e[Ls]=il(l);const a=n||l.props&&l.props.type==="number";In(e,t?"change":"input",c=>{c.target.composing||e[Ls](tr(e.value,s,a))}),(s||a)&&In(e,"change",()=>{e.value=tr(e.value,s,a)}),t||(In(e,"compositionstart",o1),In(e,"compositionend",uc),In(e,"change",uc))},mounted(e,{value:t,modifiers:{trim:s,number:n}}){const l=t??"",a=e[Ai];delete e[Ai],a!==void 0&&(e.type==="text"||e.type==="textarea")&&e.value!==a?e[Ls](tr(e.value,s,n)):e.value=l},beforeUpdate(e,{value:t,oldValue:s,modifiers:{lazy:n,trim:l,number:a}},c){if(e[Ls]=il(c),e.composing)return;const u=(a||e.type==="number")&&!/^0\d/.test(e.value)?ui(e.value):e.value,i=t??"";if(u===i)return;const v=e.getRootNode();(v instanceof Document||v instanceof ShadowRoot)&&v.activeElement===e&&e.type!=="range"&&(n&&t===s||l&&e.value.trim()===i)||(e.value=i)}},Fn={deep:!0,created(e,t,s){e[Ls]=il(s),In(e,"change",()=>{const n=e._modelValue,l=io(e),a=e.checked,c=e[Ls];if(Ge(n)){const u=Dr(n,l),i=u!==-1;if(a&&!i)c(n.concat(l));else if(!a&&i){const v=[...n];v.splice(u,1),c(v)}}else if(Bn(n)){const u=new Set(n);a?u.add(l):u.delete(l),c(u)}else c(gf(e,a))})},mounted:cc,beforeUpdate(e,t,s){e[Ls]=il(s),cc(e,t,s)}};function cc(e,{value:t,oldValue:s},n){e._modelValue=t;let l;if(Ge(t))l=Dr(t,n.props.value)>-1;else if(Bn(t))l=t.has(n.props.value);else{if(t===s)return;l=cn(t,gf(e,!0))}e.checked!==l&&(e.checked=l)}const i1={created(e,{value:t},s){e.checked=cn(t,s.props.value),e[Ls]=il(s),In(e,"change",()=>{e[Ls](io(e))})},beforeUpdate(e,{value:t,oldValue:s},n){e[Ls]=il(n),t!==s&&(e.checked=cn(t,n.props.value))}},hs={deep:!0,created(e,{value:t,modifiers:{number:s}},n){e._modelValue=t,In(e,"change",()=>{const l=Array.prototype.filter.call(e.options,i=>i.selected).map(i=>s?ui(io(i)):io(i)),a=e.multiple,c=a?Bn(e._modelValue)?new Set(l):l:l[0],u=e._pendingValue=[a,a?Ge(c)?l.slice():l:c];try{e[Ls](c)}finally{Qo(()=>{e._pendingValue===u&&(e._pendingValue=void 0)})}}),e[Ls]=il(n)},mounted(e,{value:t,modifiers:{number:s}}){dc(e,t,s)},beforeUpdate(e,{value:t},s){e._modelValue=t,e[Ls]=il(s)},updated(e,{value:t,modifiers:{number:s}}){const n=e._pendingValue;e._pendingValue=void 0,(!n||n[0]!==e.multiple||!a1(t,n[1],n[0]))&&dc(e,t,s)}};function a1(e,t,s){if(!s||Ge(e))return cn(e,t);if(Bn(e)){if(e.size!==t.length)return!1;for(const n of t)if(!e.has(n))return!1;return!0}return!1}function dc(e,t,s=!1){const n=e.multiple,l=Ge(t);if(!(n&&!l&&!Bn(t))){for(let a=0,c=e.options.length;a<c;a++){const u=e.options[a],i=io(u);if(n)if(l){const v=typeof i;v==="string"||v==="number"?u.selected=t.some(b=>String(b)===String(i)):u.selected=Dr(t,i)>-1}else u.selected=t.has(i)||s&&typeof i=="string"&&t.has(ui(i));else if(cn(io(u),t)){e.selectedIndex!==a&&(e.selectedIndex=a);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function io(e){return"_value"in e?e._value:e.value}function gf(e,t){const s=t?"_trueValue":"_falseValue";return s in e?e[s]:t}const r1=["ctrl","shift","alt","meta"],u1={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>r1.some(s=>e[`${s}Key`]&&!t.includes(s))},Cl=(e,t)=>{if(!e)return e;const s=e._withMods||(e._withMods={}),n=t.join(".");return s[n]||(s[n]=((l,...a)=>{for(let c=0;c<t.length;c++){const u=u1[t[c]];if(u&&u(l,t))return}return e(l,...a)}))},c1={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Un=(e,t)=>{const s=e._withKeys||(e._withKeys={}),n=t.join(".");return s[n]||(s[n]=(l=>{if(!("key"in l))return;const a=rl(l.key);if(t.some(c=>c===a||c1[c]===a))return e(l)}))},d1=es({patchProp:s1},Uv);let fc;function f1(){return fc||(fc=bv(d1))}const p1=((...e)=>{const t=f1().createApp(...e),{mount:s}=t;return t.mount=n=>{const l=v1(n);if(!l)return;const a=t._component;!et(a)&&!a.render&&!a.template&&(a.template=l.innerHTML),l.nodeType===1&&(l.textContent="");const c=s(l,!1,m1(l));return l instanceof Element&&(l.removeAttribute("v-cloak"),l.setAttribute("data-v-app","")),c},t});function m1(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function v1(e){return Lt(e)?document.querySelector(e):e}/**
19
+ * @license lucide-vue-next v0.460.0 - ISC
20
+ *
21
+ * This source code is licensed under the ISC license.
22
+ * See the LICENSE file in the root directory of this source tree.
23
+ */const h1=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
24
+ * @license lucide-vue-next v0.460.0 - ISC
25
+ *
26
+ * This source code is licensed under the ISC license.
27
+ * See the LICENSE file in the root directory of this source tree.
28
+ */var Ti={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
29
+ * @license lucide-vue-next v0.460.0 - ISC
30
+ *
31
+ * This source code is licensed under the ISC license.
32
+ * See the LICENSE file in the root directory of this source tree.
33
+ */const b1=({size:e,strokeWidth:t=2,absoluteStrokeWidth:s,color:n,iconNode:l,name:a,class:c,...u},{slots:i})=>gr("svg",{...Ti,width:e||Ti.width,height:e||Ti.height,stroke:n||Ti.stroke,"stroke-width":s?Number(t)*24/Number(e):t,class:["lucide",`lucide-${h1(a??"icon")}`],...u},[...l.map(v=>gr(...v)),...i.default?[i.default()]:[]]);/**
34
+ * @license lucide-vue-next v0.460.0 - ISC
35
+ *
36
+ * This source code is licensed under the ISC license.
37
+ * See the LICENSE file in the root directory of this source tree.
38
+ */const bs=(e,t)=>(s,{slots:n})=>gr(b1,{...s,iconNode:t,name:e},n);/**
39
+ * @license lucide-vue-next v0.460.0 - ISC
40
+ *
41
+ * This source code is licensed under the ISC license.
42
+ * See the LICENSE file in the root directory of this source tree.
43
+ */const g1=bs("ActivityIcon",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/**
44
+ * @license lucide-vue-next v0.460.0 - ISC
45
+ *
46
+ * This source code is licensed under the ISC license.
47
+ * See the LICENSE file in the root directory of this source tree.
48
+ */const _1=bs("ArchiveIcon",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
49
+ * @license lucide-vue-next v0.460.0 - ISC
50
+ *
51
+ * This source code is licensed under the ISC license.
52
+ * See the LICENSE file in the root directory of this source tree.
53
+ */const y1=bs("ClipboardCheckIcon",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"m9 14 2 2 4-4",key:"df797q"}]]);/**
54
+ * @license lucide-vue-next v0.460.0 - ISC
55
+ *
56
+ * This source code is licensed under the ISC license.
57
+ * See the LICENSE file in the root directory of this source tree.
58
+ */const k1=bs("FlaskConicalIcon",[["path",{d:"M10 2v7.527a2 2 0 0 1-.211.896L4.72 20.55a1 1 0 0 0 .9 1.45h12.76a1 1 0 0 0 .9-1.45l-5.069-10.127A2 2 0 0 1 14 9.527V2",key:"pzvekw"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/**
59
+ * @license lucide-vue-next v0.460.0 - ISC
60
+ *
61
+ * This source code is licensed under the ISC license.
62
+ * See the LICENSE file in the root directory of this source tree.
63
+ */const w1=bs("GaugeIcon",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/**
64
+ * @license lucide-vue-next v0.460.0 - ISC
65
+ *
66
+ * This source code is licensed under the ISC license.
67
+ * See the LICENSE file in the root directory of this source tree.
68
+ */const $1=bs("LayoutDashboardIcon",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
69
+ * @license lucide-vue-next v0.460.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const x1=bs("OctagonAlertIcon",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
74
+ * @license lucide-vue-next v0.460.0 - ISC
75
+ *
76
+ * This source code is licensed under the ISC license.
77
+ * See the LICENSE file in the root directory of this source tree.
78
+ */const S1=bs("OctagonXIcon",[["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z",key:"2d38gg"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
79
+ * @license lucide-vue-next v0.460.0 - ISC
80
+ *
81
+ * This source code is licensed under the ISC license.
82
+ * See the LICENSE file in the root directory of this source tree.
83
+ */const C1=bs("PanelLeftIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
84
+ * @license lucide-vue-next v0.460.0 - ISC
85
+ *
86
+ * This source code is licensed under the ISC license.
87
+ * See the LICENSE file in the root directory of this source tree.
88
+ */const A1=bs("PanelRightIcon",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}]]);/**
89
+ * @license lucide-vue-next v0.460.0 - ISC
90
+ *
91
+ * This source code is licensed under the ISC license.
92
+ * See the LICENSE file in the root directory of this source tree.
93
+ */const T1=bs("SlidersHorizontalIcon",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
94
+ * @license lucide-vue-next v0.460.0 - ISC
95
+ *
96
+ * This source code is licensed under the ISC license.
97
+ * See the LICENSE file in the root directory of this source tree.
98
+ */const O1=bs("TimerIcon",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
99
+ * @license lucide-vue-next v0.460.0 - ISC
100
+ *
101
+ * This source code is licensed under the ISC license.
102
+ * See the LICENSE file in the root directory of this source tree.
103
+ */const pc=bs("TriangleAlertIcon",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
104
+ * @license lucide-vue-next v0.460.0 - ISC
105
+ *
106
+ * This source code is licensed under the ISC license.
107
+ * See the LICENSE file in the root directory of this source tree.
108
+ */const mc=bs("UnplugIcon",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);/**
109
+ * @license lucide-vue-next v0.460.0 - ISC
110
+ *
111
+ * This source code is licensed under the ISC license.
112
+ * See the LICENSE file in the root directory of this source tree.
113
+ */const E1=bs("WrenchIcon",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
114
+ * @license lucide-vue-next v0.460.0 - ISC
115
+ *
116
+ * This source code is licensed under the ISC license.
117
+ * See the LICENSE file in the root directory of this source tree.
118
+ */const P1=bs("XIcon",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function Ji(e,t){const s=URL.createObjectURL(e),n=document.createElement("a");n.href=s,n.download=t,n.click(),setTimeout(()=>URL.revokeObjectURL(s),1e3)}var od;const Jr=((od=document.querySelector('meta[name="eha-token"]'))==null?void 0:od.content)??"";let Yi=null;function M1(e){Yi=e}class Zi extends Error{constructor(t,s){super(s),this.status=t}get notExecuted(){return this.status>=400&&this.status<500}}async function He(e,t,s){const n={"x-eha-token":Jr};s!==void 0&&(n["content-type"]="application/json"),Yi!==null&&(n["x-eha-client"]=String(Yi));let l;try{l=await fetch(t,{method:e,headers:n,cache:"no-store",body:s===void 0?void 0:JSON.stringify(s)})}catch{throw new Zi(0,"无法连接工作台服务;确认 ehatool web 仍在运行")}if(!l.ok){let a=`请求失败(${l.status})`;try{const c=await l.json();a=c.detail??c.error??a}catch{}throw l.status===403&&(a="服务已重启或令牌无效:刷新页面"),new Zi(l.status,a)}return l.json()}async function Yr(e,t){const s=await fetch(e,{headers:{"x-eha-token":Jr}});if(!s.ok)throw new Zi(s.status,`下载失败(${s.status})`);Ji(await s.blob(),t)}let Di=null;function Ho(e){Di&&Di.readyState===WebSocket.OPEN&&Di.send(JSON.stringify(e))}function N1(e,t){let s=500;const n=()=>{const l=location.protocol==="https:"?"wss":"ws",a=new WebSocket(`${l}://${location.host}/api/live?token=${encodeURIComponent(Jr)}`);Di=a,a.onmessage=c=>{let u;try{u=JSON.parse(c.data)}catch{return}e(u),u.type==="hello"&&(s=500,t("open"))},a.onclose=c=>{if(Yi=null,c.code===4403){t("rejected");return}t("closed"),setTimeout(n,s),s=Math.min(s*2,5e3)}};n()}function _f(e,t,s,n){const l=e[e.length-1];let a=0;for(;a<t.length&&e.length&&t[a]<=l;)a++;const c=n&&a<t.length&&e.length>0;c&&e.push((l+t[a])/2);for(let v=a;v<t.length;v++)e.push(t[v]);const u=(e[e.length-1]??0)-s;let i=0;for(;i<e.length&&e[i]<u;)i++;return i&&e.splice(0,i),{next:a,gap:c,cut:i}}function yf(e,t,s){const n=(e[e.length-1]??0)-s;let l=0,a=e.length;for(;l<a&&e[l]<n-t;)l++;for(;a>l&&e[a-1]>n;)a--;return{times:e.slice(l,a).map(c=>c-n),i0:l,i1:a}}class _a{constructor(t,s){$o(this,"t",[]);$o(this,"series");this.count=t,this.span=s,this.series=Array.from({length:t},()=>[])}push(t,s,n=!1){var u;const{next:l,gap:a,cut:c}=_f(this.t,t,this.span,n);if(a)for(const i of this.series)i.push(null);for(let i=l;i<t.length;i++)for(let v=0;v<this.count;v++)this.series[v].push((u=s[i])==null?void 0:u[v]);if(c)for(const i of this.series)i.splice(0,c)}view(t,s=0){const{times:n,i0:l,i1:a}=yf(this.t,t,s);return[n,...this.series.map(c=>c.slice(l,a))]}copy(){const t=new _a(this.count,this.span);return t.t=this.t.slice(),t.series=this.series.map(s=>s.slice()),t}clear(){this.t=[],this.series=Array.from({length:this.count},()=>[])}}class Zr{constructor(t=60){$o(this,"t",[]);$o(this,"values",[]);this.span=t}push(t,s,n=!1){const{next:l,gap:a,cut:c}=_f(this.t,t,this.span,n);a&&this.values.push(null);for(let u=l;u<t.length;u++)this.values.push(s[u]);c&&this.values.splice(0,c)}view(t,s,n){const{times:l,i0:a,i1:c}=yf(this.t,t,s),u=this.values.slice(a,c);return[l,...n.map(i=>u.map(v=>v===null?null:v[i]))]}copy(){const t=new Zr(this.span);return t.t=this.t.slice(),t.values=this.values.slice(),t}}const r=Dt({socket:"connecting",client:null,toolVersion:"",device:{name:"EHA"},model:null,od:[],byName:{},errors:[],layout:[],commands:[],manualModes:[],step:{modes:[],defaults:{},limits:{},longrun_modes:[]},poll:{},pollPages:{},pageObjects:null,now:Date.now()/1e3,scopePicks:[],connected:!1,openedAt:null,identity:null,state:{},readAt:{},source:{},missing:[],link:{ok:!0,since:0,error:""},scope:null,sampleSources:[],displayDrops:0,job:null,events:[],stepRuns:[],runCount:0,liveStep:[],manualRows:[],manualTick:0,lastStep:null,brt27:{node:1,period_us:0,count:0,bitrate:0},silJob:null,silRows:[],console:[],calibration:null,selected:null,inspector:!0,popover:!1,paramsQuery:"",page:"overview",scopeFrozen:null});function vc(e){var s;const t=[...new Set(e)].sort();t.join()!==((s=r.pageObjects)==null?void 0:s.join())&&(r.pageObjects=t)}let Oi;function j1(){Oi==null||Oi();const e=ul(typeof document>"u"||document.visibilityState!=="hidden"),t=()=>{e.value=document.visibilityState!=="hidden"};typeof document<"u"&&document.addEventListener("visibilitychange",t);const s=it(()=>{const n=r.page==="params"?r.pageObjects??r.od.map(a=>a.name):r.pollPages[r.page]??[],l=r.connected&&r.inspector&&r.selected?[r.selected]:[];return JSON.stringify([r.client,e.value?[...new Set([...n,...l])].sort():[]])},n=>{const[l,a]=JSON.parse(n);l!==null&&Ho({type:"subscribe",objects:a})},{immediate:!0});Oi=()=>{s(),typeof document<"u"&&document.removeEventListener("visibilitychange",t)}}function zt(e){r.selected=e,r.inspector=!0}const ya=ul(new _a(0,60)),El=ul(0),is=ul(0),Qr=ul(null),oi=ul(new Map),Xr=ul(0);function yr(){r.scopeFrozen=r.scopeFrozen===null?Date.now():null,Qr.value=r.scopeFrozen===null?null:ya.value.copy(),El.value++}function kf(e){ya.value=new _a((e==null?void 0:e.length)??0,60),Qr.value=null,r.scopeFrozen=null,is.value=0,El.value++}function Qi(e){var s,n;const t=r.openedAt!==((e==null?void 0:e.opened_at)??null);if(!e||t?(r.calibration=null,r.stepRuns=[],r.runCount=0,r.liveStep=Ps([]),r.manualRows=Ps([]),r.manualTick++,r.lastStep=null,r.scopePicks=[],r.scopeFrozen=null,r.scope=null,r.sampleSources=[],r.displayDrops=0,oi.value=new Map,Xr.value++,r.selected=null,r.popover=!1,kf(null),t&&r.od.length&&$f().catch(()=>{})):((s=e.job)==null?void 0:s.id)!==((n=r.job)==null?void 0:n.id)&&(r.manualRows=Ps([]),r.manualTick++),r.connected=e!==null,r.openedAt=(e==null?void 0:e.opened_at)??null,!e){r.identity=null,r.state={},r.job=null,r.readAt={},r.source={},r.missing=[],r.poll={},r.events=[],r.link={ok:!0,since:0,error:""};return}r.identity=e.identity,r.state=e.state,r.readAt=e.read_at,r.source=e.source,r.missing=e.missing??[],r.poll=e.poll??{},r.link=e.link,r.job=e.job,r.calibration=e.calibration??null,r.events=e.events,wf(e.scope)}function wf(e){var s;const t=((s=r.scope)==null?void 0:s.objects.join())??"";r.scope=e,((e==null?void 0:e.objects.join())??"")!==t&&kf((e==null?void 0:e.objects)??null)}function kr(e){var t,s,n,l;switch(e.type){case"display_loss":r.displayDrops+=e.count;break;case"hello":r.client=e.client,r.toolVersion=e.tool_version,((t=r.silJob)==null?void 0:t.id)!==((s=e.sil_job)==null?void 0:s.id)&&(r.silRows=Ps([])),r.silJob=e.sil_job??null,M1(e.client),Qi(e.session);for(const a of e.history??[])kr(a);break;case"session":Qi(e.session);for(const a of e.history??[])kr(a);break;case"state":r.state=e.state,r.readAt=e.read_at,r.source=e.source,r.missing=e.missing??[],r.link=e.link,e.poll&&(r.poll=e.poll);break;case"scope":{if(!r.scope||r.scope.objects.join()!==e.objects.join())break;r.scope.gaps=e.gaps,ya.value.push(e.t,e.values,!!e.display_dropped),r.scopeFrozen===null&&El.value++;break}case"samples":{const a=r.sampleSources.findIndex(i=>i.id===e.id);let c=oi.value.get(e.id);(!c||a>=0&&r.sampleSources[a].started!==e.started)&&(c=new Zr(60),oi.value.set(e.id,c));const u={id:e.id,source:e.source,time_base:e.time_base,started:e.started,objects:e.objects,gaps:e.gaps,samples:e.samples};a<0?r.sampleSources.push(u):r.sampleSources[a]=u,c.push(e.t,e.values,!!e.display_dropped),Xr.value++;break}case"job":R1(e.job);break;case"job_progress":r.job&&r.job.id===e.id&&(r.job.progress=e.progress);break;case"longrun_cycle":r.job&&r.job.id===e.id&&r.job.progress&&(r.job.progress.cycles=[...r.job.progress.cycles??[],e.summary].slice(-2e3),r.job.progress.free_bytes=e.free_bytes);break;case"job_log":r.job&&r.job.id===e.id&&(r.job.log.push(e.text),["longrun","record"].includes(r.job.kind)&&r.job.log.length>500&&r.job.log.splice(0,r.job.log.length-500));break;case"step_rows":r.job&&r.job.id===e.id&&(r.liveStep=Ps(r.liveStep.concat(e.display_dropped?e.rows.map((a,c)=>c?a:{...a,display_gap:1}):e.rows)));break;case"manual_rows":if(r.job&&r.job.id===e.id){const a=r.manualRows.concat(e.display_dropped?e.rows.map((c,u)=>u?c:{...c,display_gap:1}):e.rows);r.manualRows=Ps(a.length>6e3?a.slice(a.length-6e3):a),r.manualTick++}break;case"sil_job":((n=e.job)==null?void 0:n.state)==="running"&&((l=r.silJob)==null?void 0:l.id)!==e.job.id&&(r.silRows=Ps([])),r.silJob=e.job;break;case"sil_rows":r.silJob&&r.silJob.id===e.id&&(r.silRows=Ps(r.silRows.concat(e.display_dropped?e.rows.map((a,c)=>c?a:{...a,display_gap:1}):e.rows)));break;case"console":r.console.push(e.line),r.console.length>2e3&&r.console.splice(0,r.console.length-2e3);break;case"event":r.events.push({t:e.t,kind:e.kind,text:e.text}),r.events.length>200&&r.events.splice(0,r.events.length-200);break}}function R1(e){var s;const t=r.job;r.job=e,e&&(e.state==="running"&&(!t||t.id!==e.id)&&(r.liveStep=Ps([]),(e.kind==="manual"||e.kind==="observe")&&(r.manualRows=Ps([]),r.manualTick++),e.kind==="calibrate"&&(r.calibration=null)),e.state!=="running"&&(e.kind==="calibrate"&&e.state==="done"&&e.result&&(r.calibration=e.result),e.kind==="step"&&(r.lastStep=Ps(e)),e.kind==="step"&&(e.params.mode??"motor_speed")==="motor_speed"&&((s=e.result)!=null&&s.rows)&&!r.stepRuns.some(n=>n.id===e.id)&&(r.runCount++,r.stepRuns.push(Ps({id:e.id,rows:e.result.rows,metrics:e.result.metrics,params:e.params,gains:e.result.gains??{},record:e.result.record,end:e.end})),r.liveStep=Ps([]))))}async function $f(){const e=await He("GET","/api/od");r.device=e.device,r.model=e.model??null,r.layout=e.layout,r.pollPages=e.poll_pages??{},r.commands=e.commands,r.manualModes=e.manual_modes??[],r.step=e.step,r.brt27=e.brt27,r.od=e.objects,r.byName=Object.fromEntries(e.objects.map(t=>[t.name,t])),r.errors=e.errors}async function V1(){await $f(),setInterval(()=>{r.now=Date.now()/1e3},1e3),j1(),N1(kr,e=>{r.socket=e,e!=="open"&&(r.client=null)})}function D1(e){const t=r.poll[e],s=r.readAt[e];if(!t||!s)return 0;const n=r.now-s;return n>2*t?n:0}async function L1(){try{Qi(await He("GET","/api/session"))}catch{Qi(null)}}function Xt(){var e;return((e=r.job)==null?void 0:e.state)==="running"}function an(){return r.connected&&r.link.ok&&r.client!==null&&!Xt()}const I1={u8:[0,255],i8:[-128,127],u16:[0,65535],i16:[-32768,32767],u32:[0,4294967295],i32:[-2147483648,2147483647]};function Ml(e,t){const s=t.trim();if(s==="")return{error:"没有输入"};if(e.type==="f32"){const c=Number(s);return Number.isFinite(c)?hc(e,c):{error:"不是有限的数"}}const n=/^[-+]?0x[0-9a-f]+$/i.test(s)?parseInt(s,16):/^[-+]?\d+$/.test(s)?parseInt(s,10):NaN;if(!Number.isInteger(n))return{error:"须为整数(可用 0x 前缀)"};const[l,a]=I1[e.type];return n<l||n>a?{error:`超出 ${e.type} 的范围`}:e.values&&!e.values.includes(n)?{error:`只接受 ${e.values.join("、")}`}:hc(e,n)}function hc(e,t){return e.min!==void 0&&t<e.min?{error:`小于下限 ${e.min}`}:e.max!==void 0&&t>e.max?{error:`大于上限 ${e.max}`}:{value:t}}function Xi(e,t){return e.type==="f32"?Math.fround(t):Math.trunc(t)}function ll(e,t,s){return Xi(e,t)===Xi(e,s)}function ms(e,t){if(t==null)return"—";if(typeof t!="number"||!e||e.type!=="f32")return String(t);const s=Math.fround(t);for(let n=1;n<=9;n++){const l=Number(t.toPrecision(n)).toString();if(Math.fround(Number(l))===s)return l}return String(t)}function Al(e,t){var a;const s=ms(e,t);if(typeof t!="number"||!Number.isFinite(t))return s;let n=s;if((e==null?void 0:e.display)==="version")n=`${t>>>16}.${t>>>8&255}.${t&255}`;else if((e==null?void 0:e.display)==="revision")n=`${t>>>16}.${t&65535}`;else if(e&&(e.display==="hex"||e.display==="signature"||e.object_ref||e.bits)){const c=Number(e.type.slice(1))/4;if(n=`0x${t.toString(16).toUpperCase().padStart(c,"0")}`,e.display==="signature"){const u=[0,8,16,24].map(i=>t>>>i&255);u.every(i=>i>=32&&i<=126)&&(n+=` · "${String.fromCharCode(...u)}"`)}else if(e.object_ref&&t!==0&&(t&255)===0)n+=` · 0x${(t>>>16).toString(16).toUpperCase().padStart(4,"0")}:${t>>>8&255}`;else if(e.bits){const u=e.bits.filter((i,v)=>i&&t>>>v&1);u.length&&(n+=` · ${u.join("、")}`)}}else(e==null?void 0:e.type)==="f32"&&t!==0&&(Math.abs(t)<1e-4||Math.abs(t)>=1e6)?n=Number(s).toExponential():Number.isInteger(t)&&Math.abs(t)>=1e4&&(n=t.toLocaleString("en-US",{maximumFractionDigits:0}));const l=(a=e==null?void 0:e.display_values)==null?void 0:a[String(t)];return l?`${l}(${n})`:n}function Js(e){var t;return((t=e.desc)==null?void 0:t.split(/[,;。:(]/)[0].trim())||e.name}function ea(e){return e?{NotReadyToSwitchOn:"驱动初始化中",SwitchOnDisabled:"驱动未使能",ReadyToSwitchOn:"准备接通",SwitchedOn:"已接通,运行未使能",OperationEnabled:"运行已使能",QuickStopActive:"快停状态",FaultReactionActive:"正在处理故障",Fault:"故障"}[e]??e:"未读取"}function U1(e){return e?{"Boot-up":"启动",Stopped:"已停止",Operational:"运行态","Pre-operational":"预运行态"}[e]??e:"未收到"}function xf(e,t){return(t==null?void 0:t.kind)==="record"&&t.state==="running"?"正在记录设备反馈":e?`正在发送控制数据(${{calibrate:"电机标定",step:"阶跃试验",run:"定时转速运行",manual:"手动控制",usbcheck:"USB 检查",cancheck:"CAN 检查",hostloss:"失联检查",longrun:"长时运行",observe:"EtherCAT 观察"}[e]??e})`:"没有发送控制数据"}function F1(e,t,s,n=!1){return n?"设备不提供":typeof e!="number"?"未读取":Array.isArray(t)?t.length?t.join("、"):s:e===0?s:`0x${e.toString(16).toUpperCase()}`}function ii(e){return`0x${e.index.toString(16).toUpperCase().padStart(4,"0")}${e.sub?":"+e.sub:""}`}function ta(e,t){const s={values:{},unknown:[],errors:[]};let n="";return e.split(/\r?\n/).forEach((l,a)=>{const c=l.replace(/#.*$/,"").trim();if(!c)return;const u=/^\[([^\]]+)\]$/.exec(c);if(u){n=u[1].trim();return}if(n!=="params")return;const i=/^([A-Za-z_][A-Za-z0-9_]*)\s*=\s*([-+]?(?:0x[0-9a-fA-F]+|\d+(?:\.\d*)?(?:[eE][-+]?\d+)?|\.\d+(?:[eE][-+]?\d+)?))$/.exec(c);if(!i){s.errors.push(`第 ${a+1} 行无法识别`);return}if(!t.has(i[1])){s.unknown.push(i[1]);return}i[1]in s.values&&s.errors.push(`第 ${a+1} 行重复定义 ${i[1]}`),s.values[i[1]]=i[2]}),s}function z1(e){let t="";for(const s of e.split(/\r?\n/)){const n=s.replace(/#.*$/,"").trim(),l=/^\[([^\]]+)\]$/.exec(n);if(l){t=l[1].trim();continue}const a=t==="device"?/^product_code\s*=\s*(0x[0-9a-fA-F]+|\d+)$/.exec(n):null;if(a)return Number(a[1])}return null}function H1(e,t){const s=z1(e);if(s===null)return"参数文件没有记录产品码,无法确认属于这台设备,不写入设备";if(t===void 0||s===t)return null;const n=l=>`0x${l.toString(16).toUpperCase().padStart(8,"0")}`;return`参数文件属于产品 ${n(s)},设备为 ${n(t)},不写入设备`}function B1(e,t=""){const s=Object.fromEntries(Object.entries(e).map(([b,_])=>{const k=/^[-+]?0x[0-9a-f]+$/i.test(_.trim())?parseInt(_,16):Number(_);if(!_.trim()||!Number.isFinite(k))throw new Error(`${b} 不是有限的数`);return[b,Math.abs(k)>Number.MAX_SAFE_INTEGER?k.toExponential():String(k)]})),n=t.includes(`\r
119
+ `)?`\r
120
+ `:`
121
+ `,l=t?t.trimEnd().split(/\r?\n/):["# EHA 参数文件","[params]"],a=new Set,c=[];let u="",i=!1;const v=()=>{for(const[b,_]of Object.entries(s))a.has(b)||(c.push(`${b} = ${_}`),a.add(b))};for(const b of l){const _=/^\s*\[([^\]]+)\]/.exec(b);_&&(u==="params"&&v(),u=_[1].trim(),i||(i=u==="params"));const k=u==="params"?/^(\s*([A-Za-z_][A-Za-z0-9_]*)\s*=\s*)[^#]*(#.*)?$/.exec(b):null;k&&k[2]in s?(c.push(`${k[1]}${s[k[2]]}${k[3]?` ${k[3]}`:""}`),a.add(k[2])):c.push(b)}return i||c.push("","[params]"),v(),c.join(n)+n}function W1(e,t,s){const n=new Set([...Object.keys(t),...Object.keys(s)]);return e.filter(l=>n.has(l.name)).flatMap(l=>{const a=t[l.name],c=s[l.name],u=a===void 0?null:Ml(l,String(a)),i=c===void 0?null:Ml(l,String(c));return u&&i&&"value"in u&&"value"in i&&Number.isFinite(Xi(l,u.value))&&Number.isFinite(Xi(l,i.value))&&ll(l,u.value,i.value)?[]:[{name:l.name,left:a,right:c}]})}const K1={class:"bus"},G1={class:"row"},q1=["disabled"],J1={class:"caption","aria-live":"polite"},Y1={key:0,class:"status-critical","aria-live":"polite"},Z1={key:0,class:"list"},Q1=["onUpdate:modelValue","aria-label"],X1={class:"num"},eh={class:"mono"},th={class:"mono"},sh={class:"right num"},nh=["title"],lh={class:"mono"},oh={class:"right num"},ih={class:"right"},ah=["onClick"],rh={key:1,class:"secondary"},uh={key:0,class:"status-warning"},ch={class:"row"},dh={class:"row"},fh=["disabled"],ph={key:1,class:"status-warning"},mh={key:2,class:"list"},vh={class:"num"},hh={class:"mono"},bh={class:"secondary"},gh=Bt({__name:"CanBus",props:{adapter:{},bitrate:{},dataBitrate:{}},emits:["pick"],setup(e,{emit:t}){const s=e,n=t,l=_e([]),a=_e(0),c=Dt({}),u=_e(""),i=_e(!1),v=_e(null),b=_e(""),_=_e(""),k=["OperationEnabled","QuickStopActive"],$=ge(()=>l.value.filter(N=>c[N.node]&&k.includes(N.state)).map(N=>N.node));async function L(){_.value="",b.value="侦听中…";try{const N=await He("POST","/api/canbus/listen",{adapter:s.adapter,bitrate:s.bitrate,data_bitrate:s.dataBitrate,seconds:1});l.value=N.nodes,a.value=N.now}catch(N){_.value=N.message}finally{b.value=""}}const V=ge(()=>l.value.map(N=>N.node).filter(N=>c[N])),j=ge(()=>ta(u.value.includes("[params]")?u.value:`[params]
122
+ ${u.value}`,new Set(r.od.map(N=>N.name))));async function q(){_.value="",v.value=null,b.value="写入中…";try{v.value=(await He("POST","/api/canbus/write",{adapter:s.adapter,bitrate:s.bitrate,data_bitrate:s.dataBitrate,nodes:V.value,values:j.value.values,save:i.value})).results}catch(N){_.value=N.message}finally{b.value=""}}const z={written:["已写入","status-ok"],saved:["已保存","status-ok"],rejected:["拒绝","status-critical"],unknown:["结果未知","status-warning"],skipped:["未执行","secondary"]},K=(N,B=4)=>typeof N=="number"?"0x"+N.toString(16).toUpperCase().padStart(B,"0"):"—";return(N,B)=>(p(),h("div",K1,[o("div",G1,[o("button",{disabled:!!b.value,onClick:L},"侦听 1 s",8,q1),o("span",J1,"侦听不向总线发帧(适配器照常应答 ACK)。"+f(b.value)+f(a.value?`上次侦听结束于 ${new Date(a.value*1e3).toLocaleTimeString()}`:""),1),_.value?(p(),h("span",Y1,f(_.value),1)):R("",!0)]),l.value.length?(p(),h("table",Z1,[B[2]||(B[2]=o("thead",null,[o("tr",null,[o("th"),o("th",null,"节点"),o("th",null,"状态字 0x6041"),o("th",null,"故障 0x603F"),o("th",{class:"right"},"位置"),o("th",null,"驱动状态 · 心跳状态"),o("th",null,"EMCY"),o("th",{class:"right"},"距侦听结束"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(l.value,H=>(p(),h("tr",{key:H.node},[o("td",null,[we(o("input",{type:"checkbox","onUpdate:modelValue":ce=>c[H.node]=ce,"aria-label":`选中节点 ${H.node}`},null,8,Q1),[[Fn,c[H.node]]])]),o("td",X1,f(H.node),1),o("td",eh,f(K(H.values.statusword)),1),o("td",th,f(K(H.values.error_code)),1),o("td",sh,f(H.values.position_actual_um!=null?(H.values.position_actual_um/1e3).toFixed(3)+" mm":"—"),1),o("td",{title:[H.state,H.heartbeat].filter(Boolean).join(" · ")},f(d(ea)(H.state))+" · "+f(d(U1)(H.heartbeat)),9,nh),o("td",lh,f(H.emcy!=null?K(H.emcy):"—"),1),o("td",oh,f((a.value-H.seen).toFixed(2))+" s",1),o("td",ih,[o("button",{class:"plain",onClick:ce=>n("pick",H.node)},"连接此节点",8,ah)])]))),128))])])):a.value?(p(),h("p",rh,"1 s 内没有收到任何节点的帧(速率、接线与终端电阻)。")):R("",!0),l.value.length?(p(),h(le,{key:2},[B[6]||(B[6]=o("h3",null,"成组写参数",-1)),we(o("textarea",{"onUpdate:modelValue":B[0]||(B[0]=H=>u.value=H),rows:"4",placeholder:"名称 = 值,每行一个;也可以粘贴参数页导出的文件","aria-label":"要写入的参数"},null,512),[[Re,u.value]]),j.value.unknown.length||j.value.errors.length?(p(),h("p",uh,f([...j.value.unknown.map(H=>`没有对象 ${H}`),...j.value.errors].join(";")),1)):R("",!0),o("div",ch,[o("label",dh,[we(o("input",{type:"checkbox","onUpdate:modelValue":B[1]||(B[1]=H=>i.value=H)},null,512),[[Fn,i.value]]),B[3]||(B[3]=Y(" 全部写入成功后保存(0x1010)",-1))]),B[4]||(B[4]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:!V.value.length||!Object.keys(j.value.values).length||!!b.value||j.value.errors.length>0,onClick:q},"写入 "+f(V.value.length)+" 个节点",9,fh)]),$.value.length?(p(),h("p",ph,"节点 "+f($.value.join("、"))+" 报告正在运行,写入会立即影响运动。",1)):R("",!0),v.value?(p(),h("table",mh,[B[5]||(B[5]=o("thead",null,[o("tr",null,[o("th",null,"节点"),o("th",null,"对象"),o("th",null,"结果"),o("th",null,"说明")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(v.value,H=>(p(),h(le,{key:H.node},[(p(!0),h(le,null,Ue(H.rows,(ce,fe)=>{var Ne,re;return p(),h("tr",{key:H.node+ce.name},[o("td",vh,f(fe===0?H.node:""),1),o("td",hh,f(ce.name),1),o("td",{class:Ve((Ne=z[ce.status])==null?void 0:Ne[1])},f(((re=z[ce.status])==null?void 0:re[0])??ce.status),3),o("td",bh,f(ce.text),1)])}),128))],64))),128))])])):R("",!0)],64)):R("",!0)]))}}),Wt=(e,t)=>{const s=e.__vccOpts||e;for(const[n,l]of t)s[n]=l;return s},_h=Wt(gh,[["__scopeId","data-v-f9209763"]]),yh={class:"row line"},kh={class:"field"},wh={class:"field"},$h=["disabled"],xh={key:1,role:"log",class:"log"},Sh={class:"row line"},Ch={class:"field"},Ah={class:"field"},Th={class:"field"},Oh={class:"field"},Eh={class:"field"},Ph={class:"row line"},Mh=["disabled"],Nh={key:2,role:"log",class:"log"},jh=["disabled"],Rh={class:"row line"},Vh={class:"field"},Dh={class:"field"},Lh={class:"field"},Ih={class:"field"},Uh={class:"row line"},Fh={class:"field"},zh={class:"field"},Hh={class:"field"},Bh={class:"field"},Wh={class:"row line"},Kh=["disabled"],Gh=["disabled"],qh={key:3,class:"status-critical",role:"alert"},Jh={key:4,role:"log",class:"log"},Yh={class:"row line"},Zh=["disabled"],Qh=["value"],Xh=["disabled"],eb=["disabled"],tb={key:5,class:"status-critical"},sb={key:6,class:"caption"},nb=Bt({__name:"DevTools",setup(e){const t=_e(localStorage.getItem("eha.image")??""),s=_e(4444),n=_e([]),l=_e(null),a=_e(!1),c=_e([]),u=_e(""),i=_e(null),v=_e(""),b=_e(null),_=_e(""),k=_e(),$=Dt({adapter:localStorage.getItem("eha.brt27")??"",...r.brt27,busy:!1,log:[],ok:null}),L=Dt({adapter:$.adapter,bitrate:$.bitrate,node:$.node,count:$.count,period_us:$.period_us,swing:0,hz:.5,seconds:10}),V=_e(null),j=_e(!1),q=_e(""),z=ge(()=>{var I,g;return((I=V.value)==null?void 0:I.state)==="running"||((g=V.value)==null?void 0:g.state)==="stopping"}),K=ge(()=>{var I;return{running:"发送中",stopping:"正在停止",stopped:"已停止",done:"已完成",failed:"失败"}[((I=V.value)==null?void 0:I.state)??"done"]});let N=0,B=!1;async function H(){if(!B){B=!0;try{if(V.value=(await He("GET","/api/brt27/sim")).job,q.value="",z.value&&V.value){const{rate:I,sensor_node:g,...ee}=V.value.params;Object.assign(L,ee,{bitrate:I,node:g})}}catch(I){q.value=I.message}finally{B=!1}}}async function ce(I){const g=V.value;if(!(I&&!g)){j.value=!0,q.value="";try{V.value=(await He(I?"DELETE":"POST","/api/brt27/sim",I?{started_at:g.started_at}:{...L})).job,I||localStorage.setItem("eha.brt27",L.adapter)}catch(ee){q.value=ee.message}finally{j.value=!1}}}async function fe(){localStorage.setItem("eha.brt27",$.adapter),$.busy=!0,$.log=[],$.ok=null;try{const I=await He("POST","/api/brt27/setup",{adapter:$.adapter,bitrate:$.bitrate,node:$.node,count:$.count,period_us:$.period_us});$.log=I.log,$.ok=I.ok}catch(I){$.log=[I.message],$.ok=!1}finally{$.busy=!1}}async function Ne(){localStorage.setItem("eha.image",t.value),l.value=null,n.value=[],a.value=!0;try{const I=await He("POST","/api/ram-load",{image:t.value,openocd_port:s.value});n.value=I.log,l.value={ok:I.ok,text:I.ok?"已加载并运行;设备重新枚举后再连接":"未加载"}}catch(I){l.value={ok:!1,text:I.message}}finally{a.value=!1}}async function re(){try{const I=await He("GET","/api/console");c.value=I.ports,i.value=I.open,u.value||(u.value=I.open??I.ports[I.ports.length-1]??"")}catch(I){_.value=I.message}}async function E(){_.value="";try{const I=await He("POST","/api/console",{port:i.value?null:u.value});i.value=I.open}catch(I){_.value=I.message}}const U=ge(()=>{const I=b.value??r.console,g=v.value.trim();return(g?I.filter(ee=>ee.includes(g)):I).slice(-500)});function de(){b.value=b.value?null:[...r.console]}function $e(){Ji(new Blob([r.console.join(`
123
+ `)+`
124
+ `],{type:"text/plain"}),`console-${new Date().toISOString().replace(/[:.]/g,"-")}.log`)}return it(()=>r.console.length,async()=>{const I=k.value;if(!I||b.value)return;const g=I.scrollHeight-I.scrollTop-I.clientHeight<40;await Qo(),g&&(I.scrollTop=I.scrollHeight)}),Fs(()=>{re(),H(),N=window.setInterval(H,1e3)}),cl(()=>window.clearInterval(N)),(I,g)=>{var ee,Oe,je,ie;return p(),h("div",null,[g[41]||(g[41]=o("h3",null,"RAM 加载(经已运行的 OpenOCD)",-1)),g[42]||(g[42]=o("p",{class:"caption"},"依次检查 JTAG IDCODE、reset halt 后 Core 0 mstatus、Core 1 仍处于 HALT、加载并读回校验,任一不满足即不运行。加载会复位芯片,当前连接随之断开。",-1)),o("div",yh,[o("label",kh,[g[19]||(g[19]=Y("RAM 镜像 ",-1)),we(o("input",{class:"path","onUpdate:modelValue":g[0]||(g[0]=S=>t.value=S),placeholder:"~/…/build/hpm-integrated-ram/output/eha-firmware.bin"},null,512),[[Re,t.value]])]),o("label",wh,[g[20]||(g[20]=Y("端口 ",-1)),we(o("input",{class:"num port",type:"number","onUpdate:modelValue":g[1]||(g[1]=S=>s.value=S)},null,512),[[Re,s.value,void 0,{number:!0}]])]),o("button",{disabled:!t.value||a.value||((ee=d(r).job)==null?void 0:ee.state)==="running",onClick:Ne},f(a.value?"加载中…":"加载"),9,$h)]),l.value?(p(),h("p",{key:0,class:Ve(l.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(l.value.text),3)):R("",!0),n.value.length?(p(),h("pre",xh,f(n.value.join(`
125
+ `)),1)):R("",!0),g[43]||(g[43]=o("h3",null,"BRT27 位移传感器设置(经 PC 的 CAN 适配器)",-1)),g[44]||(g[44]=o("p",{class:"caption"},"适配器接内部传感器 CAN(J8)。依次切到查询模式、设回传周期、把当前位置写为缩回端计数、切到主动回传 0xAA, 再侦听位置帧核对;设置掉电保存。模拟器(ehatool brt27-sim)不应答设置命令,这一步只能对实物做。",-1)),o("div",Sh,[o("label",Ch,[g[21]||(g[21]=Y("适配器 ",-1)),we(o("input",{"onUpdate:modelValue":g[2]||(g[2]=S=>$.adapter=S),placeholder:"slcan:/dev/cu.usbmodem<序号>"},null,512),[[Re,$.adapter]])]),o("label",Ah,[g[22]||(g[22]=Y("速率 ",-1)),we(o("input",{class:"port",type:"number","onUpdate:modelValue":g[3]||(g[3]=S=>$.bitrate=S)},null,512),[[Re,$.bitrate,void 0,{number:!0}]])]),o("label",Th,[g[23]||(g[23]=Y("节点 ",-1)),we(o("input",{class:"port",type:"number","onUpdate:modelValue":g[4]||(g[4]=S=>$.node=S)},null,512),[[Re,$.node,void 0,{number:!0}]])]),o("label",Oh,[g[24]||(g[24]=Y("缩回端计数 ",-1)),we(o("input",{class:"port",type:"number","onUpdate:modelValue":g[5]||(g[5]=S=>$.count=S)},null,512),[[Re,$.count,void 0,{number:!0}]])]),o("label",Eh,[g[25]||(g[25]=Y("回传周期 ",-1)),we(o("input",{class:"port",type:"number","onUpdate:modelValue":g[6]||(g[6]=S=>$.period_us=S)},null,512),[[Re,$.period_us,void 0,{number:!0}]]),g[26]||(g[26]=o("span",{class:"unit"},"µs",-1))])]),o("div",Ph,[g[27]||(g[27]=o("span",{class:"caption"},"在杆已缩回时写入当前位置。",-1)),o("button",{disabled:!$.adapter||$.busy,onClick:fe},f($.busy?"设置中…":"设置传感器并保存缩回端"),9,Mh),$.ok!==null?(p(),h("span",{key:0,class:Ve($.ok?"caption":"status-critical")},f($.ok?"已设置":"未完成"),3)):R("",!0)]),$.log.length?(p(),h("pre",Nh,f($.log.join(`
126
+ `)),1)):R("",!0),g[45]||(g[45]=o("h3",null,"BRT27 位移模拟(经 PC 的 CAN 适配器)",-1)),g[46]||(g[46]=o("p",{class:"caption"},"适配器接内部传感器 CAN(J8),按传感器位置帧发送,不应答设置命令。模拟位置独立于电机运动,验证控制器位移接收与标定时须使用虚拟电机构建。关闭或切换本页后继续发送,到时或点击停止后停发;停发后控制器按 0x2235 判定位移超时。",-1)),o("fieldset",{class:"sim-fields",disabled:z.value||j.value},[o("div",Rh,[o("label",Vh,[g[28]||(g[28]=Y("适配器 ",-1)),we(o("input",{"onUpdate:modelValue":g[7]||(g[7]=S=>L.adapter=S),placeholder:"slcan:/dev/cu.usbmodem<序号>"},null,512),[[Re,L.adapter]])]),o("label",Dh,[g[29]||(g[29]=Y("速率 ",-1)),we(o("input",{class:"port",type:"number",min:"1","onUpdate:modelValue":g[8]||(g[8]=S=>L.bitrate=S)},null,512),[[Re,L.bitrate,void 0,{number:!0}]]),g[30]||(g[30]=o("span",{class:"unit"},"bit/s",-1))]),o("label",Lh,[g[31]||(g[31]=Y("节点 ",-1)),we(o("input",{class:"port",type:"number",min:"1",max:"255","onUpdate:modelValue":g[9]||(g[9]=S=>L.node=S)},null,512),[[Re,L.node,void 0,{number:!0}]])]),o("label",Ih,[g[32]||(g[32]=Y("中心计数 ",-1)),we(o("input",{class:"port",type:"number",min:"0","onUpdate:modelValue":g[10]||(g[10]=S=>L.count=S)},null,512),[[Re,L.count,void 0,{number:!0}]])])]),o("div",Uh,[o("label",Fh,[g[33]||(g[33]=Y("摆幅 ",-1)),we(o("input",{class:"port",type:"number",min:"0","onUpdate:modelValue":g[11]||(g[11]=S=>L.swing=S)},null,512),[[Re,L.swing,void 0,{number:!0}]]),g[34]||(g[34]=o("span",{class:"unit"},"计数",-1))]),o("label",zh,[g[35]||(g[35]=Y("摆动频率 ",-1)),we(o("input",{class:"port",type:"number",min:"0",step:"any","onUpdate:modelValue":g[12]||(g[12]=S=>L.hz=S)},null,512),[[Re,L.hz,void 0,{number:!0}]]),g[36]||(g[36]=o("span",{class:"unit"},"Hz",-1))]),o("label",Hh,[g[37]||(g[37]=Y("回传周期 ",-1)),we(o("input",{class:"port",type:"number",min:"50",max:"65535","onUpdate:modelValue":g[13]||(g[13]=S=>L.period_us=S)},null,512),[[Re,L.period_us,void 0,{number:!0}]]),g[38]||(g[38]=o("span",{class:"unit"},"µs",-1))]),o("label",Bh,[g[39]||(g[39]=Y("发送时长 ",-1)),we(o("input",{class:"port",type:"number",min:"0",step:"any","onUpdate:modelValue":g[14]||(g[14]=S=>L.seconds=S)},null,512),[[Re,L.seconds,void 0,{number:!0}]]),g[40]||(g[40]=o("span",{class:"unit"},"s,0 为持续发送",-1))])])],8,jh),o("div",Wh,[o("button",{disabled:!L.adapter||z.value||j.value,onClick:g[15]||(g[15]=S=>ce(!1))},"开始模拟",8,Kh),o("button",{disabled:!z.value||j.value,onClick:g[16]||(g[16]=S=>ce(!0))},f(j.value&&z.value?"正在停止…":"停止模拟"),9,Gh),V.value?(p(),h("span",{key:0,class:Ve(V.value.state==="failed"?"status-critical":"caption"),"aria-live":"polite"},f(K.value)+" · "+f(V.value.params.adapter)+" · 已运行 "+f(V.value.elapsed_s.toFixed(1))+" s",3)):R("",!0)]),q.value||(Oe=V.value)!=null&&Oe.error?(p(),h("p",qh,f(q.value||((je=V.value)==null?void 0:je.error)),1)):R("",!0),(ie=V.value)!=null&&ie.log.length?(p(),h("pre",Jh,f(V.value.log.join(`
127
+ `)),1)):R("",!0),g[47]||(g[47]=o("h3",null,"控制台(调试口 UART,只读)",-1)),o("div",Yh,[o("button",{onClick:re},"刷新端口"),we(o("select",{"onUpdate:modelValue":g[17]||(g[17]=S=>u.value=S),"aria-label":"UART 端口",disabled:!!i.value},[(p(!0),h(le,null,Ue(c.value,S=>(p(),h("option",{key:S,value:S},f(S),9,Qh))),128))],8,Zh),[[hs,u.value]]),o("button",{disabled:!u.value&&!i.value,onClick:E},f(i.value?`关闭 ${i.value}`:"打开"),9,Xh),we(o("input",{"onUpdate:modelValue":g[18]||(g[18]=S=>v.value=S),placeholder:"筛选","aria-label":"筛选控制台"},null,512),[[Re,v.value]]),o("button",{onClick:de},f(b.value?"继续":"暂停"),1),o("button",{disabled:!d(r).console.length,onClick:$e},"导出",8,eb)]),_.value?(p(),h("p",tb,f(_.value),1)):R("",!0),b.value?(p(),h("p",sb,"已暂停显示,接收不停。")):R("",!0),o("pre",{ref_key:"view",ref:k,role:"log",class:"log console"},f(U.value.join(`
128
+ `)),513)])}}}),Sf=Wt(nb,[["__scopeId","data-v-26f9c605"]]),lb={class:"connect"},ob={class:"connect-heading"},ib=["disabled"],ab={key:0,class:"secondary"},rb={key:1,class:"caption"},ub=["href"],cb={key:2,class:"card"},db={class:"workspaces"},fb=["href"],pb={class:"caption"},mb=["disabled","onClick"],vb={key:3,class:"status-critical","aria-live":"assertive"},hb={key:4,class:"caption","aria-live":"polite"},bb={class:"card"},gb={key:0,class:"list"},_b={class:"mono"},yb={class:"mono"},kb={class:"secondary"},wb={class:"right"},$b=["disabled","onClick"],xb=["disabled","onClick"],Sb={key:1,class:"secondary"},Cb={class:"row"},Ab={class:"field"},Tb=["disabled"],Ob=["disabled"],Eb={class:"card"},Pb={class:"row"},Mb={class:"field"},Nb={id:"can-adapters"},jb=["value"],Rb={class:"row"},Vb={class:"field"},Db={class:"field"},Lb={class:"field"},Ib={class:"row actions"},Ub=["disabled"],Fb=["disabled"],zb=["aria-expanded","disabled"],Hb=["disabled"],Bb={key:0,class:"caption"},Wb={key:1,class:"list"},Kb={class:"num"},Gb={class:"mono"},qb={class:"right"},Jb=["disabled","onClick"],Yb={class:"card"},Zb={class:"row"},Qb={class:"field"},Xb={id:"ecat-interfaces"},e0=["value"],t0={class:"field"},s0={class:"row"},n0={class:"row actions"},l0=["disabled"],o0=["disabled"],i0=["disabled"],a0={key:0,class:"list"},r0={class:"num"},u0={class:"mono"},c0={class:"right"},d0=["disabled","onClick"],f0={class:"card"},p0=Bt({__name:"ConnectView",props:{newWorkspace:{type:Boolean},destination:{default:"overview"}},setup(e){const t=e,s=_e([]),n=_e("");async function l(){s.value=await He("GET","/api/workspaces")}async function a(re){i.value=!0,v.value="";try{await He("DELETE",`/api/workspaces/${new URL(re).port}`),await l()}catch(E){v.value=E.message}finally{i.value=!1}}const c=_e([]),u=_e([]),i=_e(!1),v=_e(""),b=_e(""),_=_e(""),k=Dt({adapter:"",bitrate:0,data_bitrate:0,node:1}),$=Dt({ifname:"",slave:"",dc:!1}),L=_e(!1);it(()=>r.byName.can_bitrate,()=>{var re,E;r.byName.can_bitrate&&(k.bitrate=Number(r.byName.can_bitrate.default),k.data_bitrate=Number(((re=r.byName.can_data_bitrate)==null?void 0:re.default)??0),k.node=Number(((E=r.byName.can_node_id)==null?void 0:E.default)??1))},{immediate:!0});const V=ge(()=>c.value.filter(re=>re.via==="usb")),j=ge(()=>c.value.filter(re=>re.via==="can"&&re.role==="adapter")),q=ge(()=>c.value.filter(re=>re.via==="ecat"&&re.role!=="device"&&re.state!=="excluded"&&re.state!=="down")),z=ge(()=>c.value.filter(re=>re.via==="can"&&re.role==="device"&&`${re.interface}:${re.channel}`===k.adapter)),K=ge(()=>c.value.filter(re=>re.via==="ecat"&&re.role==="device"&&re.ifname===$.ifname)),N={candidate:"未核对身份",identified:"已核对身份",unverified:"未能核对身份",other_product:"其他产品",busy:"被占用",permission:"无权限",unavailable:"不可用",observed:"已观察到通信",responded:"有从站应答",quiet:"未见 EtherCAT 帧",down:"链路断开",excluded:"已排除",partial:"扫描不完整",empty:"无设备",unknown:"身份未知",scanned:"已扫描",unobserved:"尚未观察",ok:"完成",ambiguous:"多个候选",denied:"访问被拒绝"},B=re=>re?N[re]??re:"—",H=re=>re.state==="identified";async function ce(){i.value=!0,v.value=b.value="";try{const re=await He("GET","/api/devices");c.value=re.devices,u.value=re.issues,!k.adapter&&j.value.length===1&&(k.adapter=`${j.value[0].interface}:${j.value[0].channel}`),!$.ifname&&q.value.length===1&&($.ifname=q.value[0].ifname),t.newWorkspace&&await l()}catch(re){v.value=re.message}finally{i.value=!1}}async function fe(re,E){i.value=!0,v.value="",b.value=re==="probe"?"正在探测…":"正在读取身份…";try{const U=await He("POST",`/api/devices/${re}`,E),de=$e=>$e.via===E.via&&(E.via==="usb"?$e.port===E.port:E.via==="can"?`${$e.interface}:${$e.channel}`===E.adapter:$e.ifname===E.ifname);c.value=[...c.value.filter($e=>!de($e)),...U.devices],u.value=[...u.value.filter($e=>$e.via!==E.via),...U.issues],b.value=`${re==="probe"?"探测":"识别"}结束,${B(U.status)}。`}catch(U){v.value=U.message,b.value=""}finally{i.value=!1}}async function Ne(re){if(i.value)return;i.value=!0,v.value=b.value="",n.value="";const E=t.newWorkspace?window.open("about:blank","_blank"):null;E&&(E.opener=null);try{if(t.newWorkspace){const U=await He("POST","/api/workspaces",{connection:re,page:t.destination});n.value=U.url,E&&E.location.replace(U.url),await l().catch(()=>{})}else await He("POST","/api/session",re),await L1()}catch(U){E==null||E.close(),v.value=U.message,t.newWorkspace&&!U.notExecuted&&(v.value+=";创建结果未知,请从已打开的工作台核对。",await l().catch(()=>{}))}finally{i.value=!1}}return Fs(ce),(re,E)=>(p(),h("div",lb,[o("div",ob,[(p(),vt(Bd(e.destination==="experiments"?"h2":"h1"),null,{default:Dd(()=>[Y(f(e.newWorkspace?"在新标签连接设备":"连接设备"),1)]),_:1})),o("button",{onClick:ce,disabled:i.value},"刷新列表",8,ib)]),e.newWorkspace?(p(),h("p",ab,"所选设备会在独立工作台中连接,之后可在新标签里运行试验。")):R("",!0),n.value?(p(),h("p",rb,[E[18]||(E[18]=Y("工作台已就绪。",-1)),o("a",{href:n.value,target:"_blank",rel:"noopener"},"打开新标签",8,ub)])):R("",!0),e.newWorkspace&&s.value.length?(p(),h("section",cb,[E[19]||(E[19]=o("h2",null,"已打开的工作台",-1)),o("ul",db,[(p(!0),h(le,null,Ue(s.value,U=>{var de;return p(),h("li",{key:U.url},[o("a",{href:`${U.url}#${e.destination}`,target:"_blank",rel:"noopener"},[Y(f(((de=U.identity)==null?void 0:de.port)||"尚未连接设备")+" ",1),o("span",pb,f(U.url),1)],8,fb),U.can_close?(p(),h("button",{key:0,disabled:i.value,onClick:$e=>a(U.url)},"关闭空闲工作台",8,mb)):R("",!0)])}),128))])])):R("",!0),E[44]||(E[44]=o("p",{class:"secondary"},"刷新只做被动枚举。探测和识别作用于下方明确选中的端口、适配器或网卡。",-1)),v.value?(p(),h("p",vb,f(v.value),1)):R("",!0),b.value?(p(),h("p",hb,f(b.value),1)):R("",!0),o("section",bb,[E[22]||(E[22]=o("h2",null,"USB",-1)),V.value.length?(p(),h("table",gb,[E[20]||(E[20]=o("thead",null,[o("tr",null,[o("th",null,"端口"),o("th",null,"序列号"),o("th",null,"状态"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(V.value,U=>(p(),h("tr",{key:U.port},[o("td",_b,f(U.port),1),o("td",yb,f(U.serial??"—"),1),o("td",kb,f(B(U.state)),1),o("td",wb,[o("button",{disabled:i.value,onClick:de=>fe("identify",{via:"usb",port:U.port})},"识别",8,$b),o("button",{class:"primary",disabled:i.value,onClick:de=>Ne({via:"usb",port:U.port})},"连接",8,xb)])]))),128))])])):(p(),h("p",Sb,f(i.value?"正在枚举…":"没有找到 EHA USB 设备,可填写端口。"),1)),o("div",Cb,[o("label",Ab,[E[21]||(E[21]=Y("端口 ",-1)),we(o("input",{class:"path mono","onUpdate:modelValue":E[0]||(E[0]=U=>_.value=U),placeholder:"/dev/cu.usbmodem…"},null,512),[[Re,_.value,void 0,{trim:!0}]])]),o("button",{disabled:i.value||!_.value,onClick:E[1]||(E[1]=U=>fe("identify",{via:"usb",port:_.value}))},"识别端口",8,Tb),o("button",{disabled:i.value||!_.value,onClick:E[2]||(E[2]=U=>Ne({via:"usb",port:_.value}))},"连接端口",8,Ob)]),E[23]||(E[23]=o("p",{class:"caption"},"识别会临时独占打开所选串口,读取标准设备身份;连接会持续占用该串口。",-1))]),o("section",Eb,[E[32]||(E[32]=o("h2",null,"CAN(CANopen)",-1)),o("div",Pb,[o("label",Mb,[E[24]||(E[24]=Y("适配器 ",-1)),we(o("input",{class:"path mono","onUpdate:modelValue":E[3]||(E[3]=U=>k.adapter=U),list:"can-adapters",placeholder:"接口:通道,例如 slcan:/dev/cu.usbmodem…"},null,512),[[Re,k.adapter,void 0,{trim:!0}]])]),o("datalist",Nb,[(p(!0),h(le,null,Ue(j.value,U=>(p(),h("option",{key:`${U.interface}:${U.channel}`,value:`${U.interface}:${U.channel}`},f(U.name??"")+" · "+f(B(U.state)),9,jb))),128))])]),o("div",Rb,[o("label",Vb,[E[25]||(E[25]=Y("仲裁段 ",-1)),we(o("input",{class:"num",type:"number",min:"1","onUpdate:modelValue":E[4]||(E[4]=U=>k.bitrate=U)},null,512),[[Re,k.bitrate,void 0,{number:!0}]]),E[26]||(E[26]=o("span",{class:"unit"},"bit/s",-1))]),o("label",Db,[E[27]||(E[27]=Y("数据段 ",-1)),we(o("input",{class:"num",type:"number",min:"0","onUpdate:modelValue":E[5]||(E[5]=U=>k.data_bitrate=U)},null,512),[[Re,k.data_bitrate,void 0,{number:!0}]]),E[28]||(E[28]=o("span",{class:"unit"},"bit/s(0 为经典 CAN)",-1))]),o("label",Lb,[E[29]||(E[29]=Y("节点 ",-1)),we(o("input",{class:"num node",type:"number",min:"1",max:"127","onUpdate:modelValue":E[6]||(E[6]=U=>k.node=U)},null,512),[[Re,k.node,void 0,{number:!0}]])])]),E[33]||(E[33]=o("p",{class:"caption"},"探测会按以上速率向节点 1–127 发送 SDO 读取请求,最多约 40 s;识别只读取所填节点。操作前先侦听其他 SDO 主站,发现争用即停止。请在本工具可独占访问的总线上使用。",-1)),o("div",Ib,[o("button",{disabled:i.value||!k.adapter,onClick:E[7]||(E[7]=U=>fe("probe",{via:"can",...k}))},"探测全部节点",8,Ub),o("button",{disabled:i.value||!k.adapter,onClick:E[8]||(E[8]=U=>fe("identify",{via:"can",...k}))},"识别节点",8,Fb),o("button",{"aria-expanded":L.value,disabled:!k.adapter||i.value,onClick:E[9]||(E[9]=U=>L.value=!L.value)},"总线视图",8,zb),E[30]||(E[30]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:i.value||!k.adapter,onClick:E[10]||(E[10]=U=>Ne({via:"can",...k}))},"连接节点",8,Hb)]),E[34]||(E[34]=o("p",{class:"caption"},"连接后先读 0x1018 身份,随后默认只侦听 TPDO;完整版本与其他对象在设备状态面板显式开启 SDO 访问后读取。",-1)),j.value.length?R("",!0):(p(),h("p",Bb,"未枚举到适配器,可填写已安装后端的接口和通道。")),z.value.length?(p(),h("table",Wb,[E[31]||(E[31]=o("thead",null,[o("tr",null,[o("th",null,"节点"),o("th",null,"设备"),o("th",null,"序列号"),o("th",null,"状态"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(z.value,U=>(p(),h("tr",{key:U.node},[o("td",Kb,f(U.node),1),o("td",null,f(U.name??"—"),1),o("td",Gb,f(U.serial??"—"),1),o("td",null,f(B(U.state)),1),o("td",qb,[o("button",{disabled:i.value||!H(U),onClick:de=>{k.node=U.node,Ne({via:"can",...k})}},"连接",8,Jb)])]))),128))])])):R("",!0),L.value&&k.adapter?(p(),vt(_h,{key:k.adapter,adapter:k.adapter,bitrate:k.bitrate,"data-bitrate":k.data_bitrate,onPick:E[11]||(E[11]=U=>k.node=U)},null,8,["adapter","bitrate","data-bitrate"])):R("",!0)]),o("section",Yb,[E[40]||(E[40]=o("h2",null,"EtherCAT",-1)),o("div",Zb,[o("label",Qb,[E[35]||(E[35]=Y("网卡 ",-1)),we(o("input",{class:"path mono","onUpdate:modelValue":E[12]||(E[12]=U=>$.ifname=U),list:"ecat-interfaces",placeholder:"例如 enN 或 ethN"},null,512),[[Re,$.ifname,void 0,{trim:!0}]])]),o("datalist",Xb,[(p(!0),h(le,null,Ue(q.value,U=>(p(),h("option",{key:U.ifname,value:U.ifname},f(B(U.state))+f(U.count!=null?` · ${U.count} 个从站`:""),9,e0))),128))]),o("label",t0,[E[36]||(E[36]=Y("从站序号 ",-1)),we(o("input",{class:"num node",type:"number",min:"0","onUpdate:modelValue":E[13]||(E[13]=U=>$.slave=U),placeholder:"唯一时可空"},null,512),[[Re,$.slave]])])]),o("label",s0,[we(o("input",{type:"checkbox","onUpdate:modelValue":E[14]||(E[14]=U=>$.dc=U)},null,512),[[Fn,$.dc]]),E[37]||(E[37]=Y(" 启用 DC SYNC0(1 ms,进入 OP 时配置)",-1))]),E[41]||(E[41]=o("p",{class:"caption"},"需要原始网卡权限。探测发送 EtherCAT BRD 读取应答数量;识别会初始化整个所选网段至 PREOP 并读取各从站身份,打断该网段其他主站的运行。",-1)),o("div",n0,[o("button",{disabled:i.value||!$.ifname,onClick:E[15]||(E[15]=U=>fe("probe",{via:"ecat",ifname:$.ifname}))},"探测网段",8,l0),o("button",{disabled:i.value||!$.ifname,onClick:E[16]||(E[16]=U=>fe("identify",{via:"ecat",ifname:$.ifname}))},"初始化网段并识别",8,o0),E[38]||(E[38]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:i.value||!$.ifname,onClick:E[17]||(E[17]=U=>Ne({via:"ecat",...$}))},"初始化网段并连接",8,i0)]),E[42]||(E[42]=o("p",{class:"caption"},"连接同样会初始化整个网段至 PREOP,之后以邮箱 SDO 读写;运动或观察时进入 OP。勾选 DC 后,观察曲线采用设备返回的 DC 时刻;手动控制和阶跃记录仍采用实际的主机接收时间。",-1)),K.value.length?(p(),h("table",a0,[E[39]||(E[39]=o("thead",null,[o("tr",null,[o("th",null,"从站"),o("th",null,"设备"),o("th",null,"序列号"),o("th",null,"状态"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(K.value,U=>(p(),h("tr",{key:U.slave},[o("td",r0,f(U.slave),1),o("td",null,f(U.name??"—"),1),o("td",u0,f(U.serial??"—"),1),o("td",null,f(B(U.state)),1),o("td",c0,[o("button",{disabled:i.value||!H(U),onClick:de=>{$.slave=String(U.slave),Ne({via:"ecat",...$})}},"初始化并连接",8,d0)])]))),128))])])):R("",!0)]),(p(!0),h(le,null,Ue(u.value,U=>(p(),h("p",{key:`${U.via}:${U.message}`,class:"caption"},f(U.via)+":"+f(U.message),1))),128)),o("details",f0,[E[43]||(E[43]=o("summary",null,"开发工具(不需要已连接的设备)",-1)),st(Sf)])]))}}),wr=Wt(p0,[["__scopeId","data-v-94e4c19d"]]);function ut(e){if(r.missing.includes(e))return{text:"设备不提供",stale:!1};const t=r.readAt[e];if(!t)return{text:"尚未读取",stale:!1};const s=Math.max(0,r.now-t),n=r.source[e],l=!r.connected||!r.link.ok||r.socket==="closed"||r.socket==="rejected"||D1(e)>0;return{text:`${new Date(t*1e3).toLocaleTimeString()} · ${s.toFixed(1)} s 前${n?` · ${n}`:""}${l?" · 已陈旧":""}`,stale:l}}function Nl(e,t,s="SDO 读取",n=Date.now()/1e3){r.state[e]=t,n===null?delete r.readAt[e]:r.readAt[e]=n,r.source[e]=s}const m0={id:"object-inspector",class:"inspector","aria-label":"对象检查器"},v0={class:"name"},h0={class:"caption mono"},b0={class:"meta num"},g0={class:"unit"},_0={key:0,class:"caption num"},y0={class:"caption"},k0={class:"row"},w0=["disabled"],$0=["disabled"],x0=["disabled"],S0={key:1,class:"status-critical"},C0={class:"num"},A0=["title"],T0={class:"desc"},O0={key:1,class:"empty secondary"},E0=Bt({__name:"Inspector",setup(e){const t=ge(()=>r.selected?r.byName[r.selected]:void 0),s=_e("");async function n(){const v=t.value,b=r.openedAt;if(!(!v||!r.connected)){s.value="";try{const _=await He("GET",`/api/objects/${v.name}`);if(t.value!==v||r.openedAt!==b)return;Nl(v.name,_.value)}catch(_){t.value===v&&r.openedAt===b&&(s.value=_.message)}}}it(()=>[r.selected,r.openedAt],()=>{s.value=""});const l=ge(()=>t.value?r.state[t.value.name]:void 0),a=ge(()=>{var v;return((v=t.value)==null?void 0:v.access)==="rw"&&t.value.pdo!=="rx"&&!r.commands.includes(t.value.name)&&!r.layout.some(b=>b.managed&&b.names.includes(t.value.name))});function c(){t.value&&(r.paramsQuery=t.value.name,r.page="params")}function u(){t.value&&!r.scopePicks.includes(t.value.name)&&r.scopePicks.push(t.value.name),r.page="control"}function i(){t.value&&navigator.clipboard.writeText(`${t.value.name} = ${ms(t.value,l.value)}`)}return(v,b)=>(p(),h("aside",m0,[t.value?(p(),h(le,{key:0},[o("div",v0,f(d(Js)(t.value)),1),o("div",h0,f(t.value.name),1),o("div",b0,f(d(ii)(t.value))+" · "+f(t.value.type)+f(t.value.unit?" · "+t.value.unit:""),1),o("div",{class:Ve(["value num",{"stale-reading":d(ut)(t.value.name).stale}])},[Y(f(d(Al)(t.value,l.value)),1),o("span",g0,f(t.value.unit),1)],2),d(Al)(t.value,l.value)!==d(ms)(t.value,l.value)?(p(),h("div",_0,"原始值 "+f(d(ms)(t.value,l.value)),1)):R("",!0),o("div",y0,f(d(r).connected?d(ut)(t.value.name).text:"对象字典 · 未连接设备"),1),o("div",k0,[o("button",{onClick:n,disabled:!d(r).connected},"读取",8,w0),o("button",{onClick:i,disabled:l.value===void 0},"复制原始值",8,$0),a.value?(p(),h("button",{key:0,onClick:c},f(d(r).connected?"在参数页编辑":"编辑参数文件"),1)):R("",!0),d(r).state.via==="usb"?(p(),h("button",{key:1,disabled:d(r).scopePicks.includes(t.value.name),title:"加到“控制与示波”页的示波候选",onClick:u},"绘图",8,x0)):R("",!0)]),s.value?(p(),h("div",S0,f(s.value),1)):R("",!0),o("dl",null,[b[5]||(b[5]=o("dt",null,"访问",-1)),o("dd",null,f(t.value.access==="rw"?"可写":"只读")+f(t.value.pdo?`,可映射(${t.value.pdo==="rx"?"主站写":"主站读"})`:""),1),t.value.access==="rw"?(p(),h(le,{key:0},[b[0]||(b[0]=o("dt",null,"何时可写",-1)),o("dd",null,f(t.value.disabled_only?"只在驱动未运行时":"任何时候")+f(t.value.developer?";需开发者模式":""),1),b[1]||(b[1]=o("dt",null,"保存",-1)),o("dd",null,f(t.value.persist?"随 0x1010 保存到 Flash":"不保存,复位后恢复"),1)],64)):R("",!0),t.value.values?(p(),h(le,{key:1},[b[2]||(b[2]=o("dt",null,"取值",-1)),o("dd",null,f(t.value.values.map(_=>d(Al)(t.value,_)).join("、")),1)],64)):t.value.min!==void 0||t.value.max!==void 0?(p(),h(le,{key:2},[b[3]||(b[3]=o("dt",null,"范围",-1)),o("dd",C0,f(t.value.min??"—")+" … "+f(t.value.max??"—"),1)],64)):R("",!0),t.value.default!==void 0?(p(),h(le,{key:3},[b[4]||(b[4]=o("dt",null,"出厂默认",-1)),o("dd",{class:"num",title:`原始值 ${d(ms)(t.value,t.value.default)}`},f(d(Al)(t.value,t.value.default)),9,A0)],64)):R("",!0)]),o("p",T0,f(t.value.desc),1)],64)):(p(),h("div",O0,"选择一个数值查看详情"))]))}}),P0=Wt(E0,[["__scopeId","data-v-e4915525"]]);function Cf(){const e=_e(""),t=Dt({});it(()=>r.openedAt,()=>{e.value="";for(const l of Object.keys(t))delete t[l]},{flush:"sync"});async function s(l,a){const c=r.openedAt,u=()=>r.connected&&r.openedAt===c;e.value=l,t[l]=null;try{const i=await a(c,u);i&&u()&&(t[l]=i)}catch(i){u()&&(t[l]={ok:!1,text:i.message})}finally{r.openedAt===c&&(e.value="")}}function n(l,a,c){return s(l,async u=>{var v;const i=await He("POST",`/api/actions/${a}`,{...c,opened_at:u});return i.ok===!1?{ok:!1,text:i.message??((v=i.abort)==null?void 0:v.meaning_zh)??"未受理"}:{ok:!0,text:i.message??"已受理"}})}return{pending:e,results:t,perform:s,action:n}}function Es(e=""){var l;if(!r.connected)return"未连接设备";if(!r.link.ok)return"链路中断,设备当前状态未确认";if(r.client===null)return"等待与服务建立连接";if(r.missing.includes(e))return"设备不提供此对象";const t=e==="store_parameters",s=Xt()&&((l=r.job)==null?void 0:l.kind)!=="record";if(e&&r.state.via==="can"&&!r.state.sdo_poll&&!s)return"CAN 只侦听,请先在设备状态中开启 SDO 访问";if(Xt()){const a=r.job;if(!t)return"任务运行中,请先停止任务";if(a.kind!=="record")return"控制任务运行中不能保存参数,请先停止任务"}const n=r.byName[e];return n!=null&&n.disabled_only&&r.state.running===!0?"驱动运行中不受理,请先停止":n!=null&&n.developer&&r.state.developer===!1?"需要开发者模式,请先进入":""}const M0={class:"toolbar"},N0={class:"leading"},j0=["aria-expanded","aria-label","title"],R0={key:0,class:"identity"},V0={key:0,class:"secondary num"},D0={key:1,class:"identity secondary"},L0={key:0,class:"center"},I0=["aria-expanded"],U0=["title"],F0={class:"secondary"},z0={key:2,class:"num"},H0={key:3},B0={key:4,class:"limited",title:"statusword 位 11:指令被软限位、速度、力、行程包络或电机转速上限限幅"},W0={key:2,class:"dev"},K0={class:"popover-heading"},G0={class:"plain",popovertarget:"device-status-panel",popovertargetaction:"hide","aria-label":"关闭设备状态",autofocus:""},q0={class:"caption mono"},J0={class:"caption"},Y0={key:0},Z0={class:"status-critical"},Q0={key:1},X0={class:"secondary"},eg={class:"secondary"},tg={class:"row"},sg=["disabled"],ng={class:"caption"},lg={key:2},og={class:"row"},ig=["disabled"],ag={class:"row"},rg={class:"caption"},ug=["disabled"],cg={class:"num"},dg={key:0,class:"status-warning"},fg={class:"caption mono"},pg={class:"trailing"},mg={key:0,class:"caption reason",id:"stop-reason"},vg=["disabled","aria-expanded","aria-label","title"],hg=["disabled","title"],bg={key:1,class:"stop-result status-critical","aria-live":"assertive"},gg=Bt({__name:"Toolbar",props:{sidebarOpen:{type:Boolean}},emits:["toggleSidebar"],setup(e,{expose:t,emit:s}){const n=s,l=_e(),a=_e(),c=_e(),u=_e({top:"0px",left:"0px"}),{pending:i,results:v,action:b}=Cf(),_=ge(()=>!!i.value),k=ge(()=>v.status??null),$=_e(""),L=ge(()=>r.connected||r.page==="params"),V=ge(()=>r.identity?r.identity.serial_number.toString(16).toUpperCase().padStart(8,"0"):""),j=ge(()=>(r.state.error_code??0)!==0),q=ge(()=>!r.link.ok||r.state.faulted?"critical":j.value||r.state.latched?"warning":"normal"),z=ge(()=>r.state.stop??{kind:"disabled",label:"停止",reason:"未连接",description:"未连接设备"}),K=ge(()=>`0x${(r.state.error_code??0).toString(16).toUpperCase().padStart(4,"0")}`),N=ge(()=>r.link.since?Math.max(0,Math.round(Date.now()/1e3-r.link.since)):0),B=I=>I.split(/[+-]/)[0],H=ge(()=>{var I;return!!((I=r.identity)!=null&&I.version)&&!!r.toolVersion&&B(r.identity.version)!==B(r.toolVersion)}),ce=I=>r.readAt[I]?`${Math.max(0,Date.now()/1e3-r.readAt[I]).toFixed(1)} s 前`:"—";it(()=>r.openedAt,()=>{$.value=""},{flush:"sync"});async function fe(I,g={}){_.value||!r.connected||r.openedAt===null||await b("status",I,g)}async function Ne(){const I=r.state.stop;if(!(!I||I.kind==="disabled")){$.value="";try{const g=await He("POST","/api/stop",{kind:I.kind,opened_at:I.opened_at,job_id:I.job_id});r.connected&&r.openedAt===I.opened_at&&g.action==="takeover"&&!g.result.ok&&($.value=g.result.message||"未确认断电")}catch(g){r.connected&&r.openedAt===I.opened_at&&($.value=g.message)}}}async function re(){if(Xt()){$.value="任务运行中,先停止";return}const I=r.openedAt;!r.connected||I===null||await He("DELETE","/api/session",{opened_at:I}).catch(g=>{r.connected&&r.openedAt===I&&($.value=g.message)})}function E(){var ee;const I=(ee=a.value)==null?void 0:ee.getBoundingClientRect();if(!I)return;const g=Math.min(400,window.innerWidth-24);u.value={top:`${Math.min(I.bottom+8,Math.max(12,window.innerHeight-80))}px`,left:`${Math.max(12,Math.min(I.left+I.width/2-g/2,window.innerWidth-g-12))}px`}}function U(I){r.popover=I.newState==="open",r.popover&&E()}function de(){const I=c.value;if(!(I!=null&&I.isConnected))return;const g=I.matches(":popover-open");r.popover&&r.connected&&!g&&I.showPopover(),(!r.popover||!r.connected)&&g&&I.hidePopover()}it(()=>r.popover&&r.connected,de,{flush:"post"}),Fs(()=>{de(),window.addEventListener("resize",E)}),cl(()=>window.removeEventListener("resize",E));function $e(){var I;(I=l.value)==null||I.focus()}return t({doStop:Ne,stop:z,focusSidebarToggle:$e}),(I,g)=>{var ee,Oe,je,ie,S,C,F,x;return p(),h("header",M0,[o("div",N0,[o("button",{ref_key:"sidebarToggle",ref:l,class:"plain sidebar-toggle","aria-expanded":e.sidebarOpen,"aria-controls":"page-sidebar","aria-label":e.sidebarOpen?"隐藏侧边栏":"显示侧边栏",title:e.sidebarOpen?"隐藏侧边栏":"显示侧边栏",onClick:g[0]||(g[0]=O=>n("toggleSidebar"))},[st(d(C1),{size:17,"aria-hidden":"true"})],8,j0),d(r).connected?(p(),h("div",R0,[o("strong",null,f(d(r).identity?d(r).device.name:"设备身份未确认"),1),d(r).identity?(p(),h("span",V0,"· "+f(V.value)+" · "+f({usb:"USB",can:"CAN",ecat:"EtherCAT"}[d(r).state.via]??""),1)):R("",!0)])):(p(),h("div",D0,"未连接设备")),d(r).connected?(p(),h("button",{key:2,class:"plain",title:"断开设备","aria-label":"断开设备",onClick:re},[st(d(mc),{size:15})])):R("",!0),o("button",{class:"plain",onClick:g[1]||(g[1]=O=>{d(r).page="connect",d(r).popover=!1})},"其他设备")]),d(r).connected?(p(),h("div",L0,[o("button",{ref_key:"statusToggle",ref:a,class:Ve(["capsule",q.value]),popovertarget:"device-status-panel","aria-expanded":d(r).popover,"aria-haspopup":"dialog","aria-controls":"device-status-panel","aria-label":"设备状态"},[d(r).link.ok?(p(),h(le,{key:1},[q.value==="critical"?(p(),vt(d(x1),{key:0,size:14,"aria-hidden":"true"})):q.value==="warning"?(p(),vt(d(pc),{key:1,size:14,"aria-hidden":"true"})):R("",!0),o("span",{title:d(r).state.state},f(d(ea)(d(r).state.state)),9,U0),o("span",F0,"· "+f(d(r).state.mode_text??"模式未读取"),1),j.value?(p(),h("span",z0,f(K.value)+" "+f(((ee=d(r).state.diagnostic)==null?void 0:ee.name)??""),1)):d(r).state.latched?(p(),h("span",H0,"保护锁存")):R("",!0),d(r).state.limited&&d(r).state.running?(p(),h("span",B0,"限幅")):R("",!0)],64)):(p(),h(le,{key:0},[st(d(mc),{size:14,"aria-hidden":"true"}),o("span",null,f(d(r).link.lost?"连接已断开":"设备无应答")+" · "+f(N.value)+" s",1)],64)),d(r).state.developer?(p(),h("span",W0,"开发者")):R("",!0)],10,I0),o("div",{id:"device-status-panel",ref_key:"statusPanel",ref:c,class:"popover",popover:"auto",role:"dialog","aria-labelledby":"device-status-title",style:Rl({"--panel-top":u.value.top,"--panel-left":u.value.left}),onBeforetoggle:U},[o("div",K0,[g[6]||(g[6]=o("h2",{id:"device-status-title"},"设备状态",-1)),o("button",G0,[st(d(P1),{size:16,"aria-hidden":"true"})])]),o("section",null,[g[7]||(g[7]=o("div",{class:"label"},"驱动状态",-1)),o("div",null,[Y(f(d(ea)(d(r).state.state))+" ",1),o("span",q0,f(d(r).state.state),1)]),o("div",J0,"状态字读取于 "+f(ce("statusword")),1)]),d(r).link.ok?R("",!0):(p(),h("section",Y0,[g[8]||(g[8]=o("div",{class:"label"},"链路",-1)),o("div",Z0,f(d(r).link.error),1),d(r).link.lost?(p(),h("button",{key:0,onClick:re},"断开")):R("",!0)])),j.value||d(r).state.latched?(p(),h("section",Q0,[g[9]||(g[9]=o("div",{class:"label"},"故障与保护",-1)),o("div",{class:Ve(q.value==="critical"?"status-critical":"status-warning")},f(K.value)+" "+f((Oe=d(r).state.diagnostic)==null?void 0:Oe.name),3),o("div",X0,f((je=d(r).state.diagnostic)==null?void 0:je.description_zh),1),o("div",eg,f((ie=d(r).state.diagnostic)==null?void 0:ie.meaning_zh),1),o("div",tg,[o("button",{disabled:_.value||d(Xt)()||!d(r).link.ok,onClick:g[2]||(g[2]=O=>fe("ack"))},"确认保护/故障",8,sg),k.value?(p(),h("span",{key:0,class:Ve(k.value.ok?"":"status-critical"),"aria-live":"polite"},f(k.value.text),3)):R("",!0)]),g[10]||(g[10]=o("div",{class:"caption"},"取得控制权(驱动须未运行)后发故障复位,再断电;不改模式。",-1))])):R("",!0),o("section",null,[g[11]||(g[11]=o("div",{class:"label"},"固件属主 0x2005",-1)),o("div",null,[Y(f(d(r).state.owner_text??"未知")+" ",1),o("span",ng,"读取于 "+f(ce("control_owner")),1)]),g[12]||(g[12]=o("div",{class:"label"},"本服务",-1)),o("div",null,f(d(xf)(d(r).state.sending,d(r).job)),1)]),d(r).state.via==="can"?(p(),h("section",lg,[g[14]||(g[14]=o("div",{class:"label"},"CAN SDO 轮询",-1)),o("div",og,[o("span",null,f(d(r).state.sdo_poll?"开启":"关闭(只侦听 TPDO)"),1),g[13]||(g[13]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:_.value||d(Xt)(),onClick:g[3]||(g[3]=O=>fe("sdo_poll",{on:!d(r).state.sdo_poll}))},f(d(r).state.sdo_poll?"关闭":"开启"),9,ig)]),g[15]||(g[15]=o("div",{class:"caption"},"设备只有一个 SDO 服务通道;总线上有其他主机访问本节点时不开启。",-1))])):R("",!0),o("section",null,[g[17]||(g[17]=o("div",{class:"label"},"开发者模式 0x2009",-1)),o("div",ag,[o("span",null,f(d(r).state.developer?"开启":"关闭(用户模式)"),1),o("span",rg,"读取于 "+f(ce("developer_mode")),1),g[16]||(g[16]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:_.value||d(Xt)()||!d(r).link.ok,onClick:g[4]||(g[4]=O=>fe("developer",{on:!d(r).state.developer}))},f(d(r).state.developer?"退出":"进入"),9,ug)]),g[18]||(g[18]=o("div",{class:"caption"},"只在驱动未运行时可切换,复位后回到用户模式。",-1))]),o("section",null,[g[20]||(g[20]=o("div",{class:"label"},"版本",-1)),o("div",cg,"固件 "+f(((S=d(r).identity)==null?void 0:S.version)||(((C=d(r).identity)==null?void 0:C.slot)===255?"非槽开发镜像,版本未知":"未知"))+f((F=d(r).identity)!=null&&F.debug?"(调试版本)":"")+" · 工具 "+f(d(r).toolVersion),1),H.value?(p(),h("div",dg,[st(d(pc),{size:13,"aria-hidden":"true"}),g[19]||(g[19]=Y(" 固件与工具不是同一版本,对象字典可能不一致",-1))])):R("",!0),o("div",fg,f((x=d(r).identity)==null?void 0:x.port),1)])],36)])):R("",!0),o("div",pg,[z.value.kind==="disabled"&&d(r).connected?(p(),h("span",mg,f(z.value.reason),1)):R("",!0),o("button",{id:"inspector-toggle",class:"plain",disabled:!L.value,"aria-expanded":L.value&&d(r).inspector,"aria-controls":"object-inspector","aria-label":L.value&&d(r).inspector?"隐藏检查器":"显示检查器",title:L.value&&d(r).inspector?"隐藏检查器":"显示检查器",onClick:g[5]||(g[5]=O=>d(r).inspector=!d(r).inspector)},[st(d(A1),{size:17})],8,vg),o("button",{class:Ve(z.value.kind!=="disabled"?"stop-active":""),disabled:z.value.kind==="disabled","aria-describedby":"stop-reason",title:`${z.value.description??z.value.reason??"停止任务"}(⌘.)。急停由现场硬件回路提供`,onClick:Ne},[st(d(S1),{size:15,"aria-hidden":"true"}),Y(" "+f(z.value.label),1)],10,hg)]),$.value?(p(),h("span",bg,f($.value),1)):R("",!0)])}}}),_g=Wt(gg,[["__scopeId","data-v-d813cbaf"]]),yg="/assets/ehapower-logo-Cr84XeX3.png",kg={class:"page"},wg={class:"card"},$g={class:"brand"},xg=["src"],Sg={class:"version"},Cg={class:"num"},Ag=Bt({__name:"AboutPage",setup(e){return(t,s)=>(p(),h("div",kg,[s[3]||(s[3]=o("h1",null,"关于羿海动力",-1)),o("section",wg,[o("div",$g,[o("img",{src:d(yg),alt:"EHAPOWER 羿海动力",width:"640",height:"273"},null,8,xg)]),s[1]||(s[1]=o("h2",null,"合肥羿海动力科技有限责任公司",-1)),s[2]||(s[2]=o("p",{class:"description"},"专注于一体化电液执行系统(EHA)的研发与产业化。",-1)),o("dl",Sg,[s[0]||(s[0]=o("dt",null,"工具包与工作台版本",-1)),o("dd",Cg,f(d(r).toolVersion||"尚未读取"),1)])])]))}}),Tg=Wt(Ag,[["__scopeId","data-v-85e2a356"]]);function fi(e,t){var l;let s=0;const n=[];for(const a of e){if(typeof a.error_code!="number")continue;const c=a.error_code;if(c&&c!==s){const u=`0x${c.toString(16).toUpperCase().padStart(4,"0")}`;n.push({t:a.t,label:`${((l=t.find(i=>i.code===c))==null?void 0:l.name)??u} · ${a.t.toFixed(3)} s`})}s=c}return n}function eu(e,t){const s=e.map(()=>[]);for(let n=0;n<e[0].length;n++){if(n&&t[n]){s[0].push((Number(e[0][n-1])+Number(e[0][n]))/2);for(const l of s.slice(1))l.push(null)}e.forEach((l,a)=>s[a].push(l[n]))}return s}const Og=!0,ts="u-",Eg="uplot",Pg=ts+"hz",Mg=ts+"vt",Ng=ts+"title",jg=ts+"wrap",Rg=ts+"under",Vg=ts+"over",Dg=ts+"axis",xl=ts+"off",Lg=ts+"select",Ig=ts+"cursor-x",Ug=ts+"cursor-y",Fg=ts+"cursor-pt",zg=ts+"legend",Hg=ts+"live",Bg=ts+"inline",Wg=ts+"series",Kg=ts+"marker",bc=ts+"label",Gg=ts+"value",Mo="width",No="height",Ao="top",gc="bottom",Xl="left",sr="right",tu="#000",_c=tu+"0",nr="mousemove",yc="mousedown",lr="mouseup",kc="mouseenter",wc="mouseleave",$c="dblclick",qg="resize",Jg="scroll",xc="change",sa="dppxchange",su="--",po=typeof window<"u",$r=po?document:null,lo=po?window:null,Yg=po?navigator:null;let yt,Ei;function xr(){let e=devicePixelRatio;yt!=e&&(yt=e,Ei&&Cr(xc,Ei,xr),Ei=matchMedia(`(min-resolution: ${yt-.001}dppx) and (max-resolution: ${yt+.001}dppx)`),Pl(xc,Ei,xr),lo.dispatchEvent(new CustomEvent(sa)))}function Rs(e,t){if(t!=null){let s=e.classList;!s.contains(t)&&s.add(t)}}function Sr(e,t){let s=e.classList;s.contains(t)&&s.remove(t)}function Nt(e,t,s){e.style[t]=s+"px"}function sn(e,t,s,n){let l=$r.createElement(e);return t!=null&&Rs(l,t),s!=null&&s.insertBefore(l,n),l}function Gs(e,t){return sn("div",e,t)}const Sc=new WeakMap;function yn(e,t,s,n,l){let a="translate("+t+"px,"+s+"px)",c=Sc.get(e);a!=c&&(e.style.transform=a,Sc.set(e,a),t<0||s<0||t>n||s>l?Rs(e,xl):Sr(e,xl))}const Cc=new WeakMap;function Ac(e,t,s){let n=t+s,l=Cc.get(e);n!=l&&(Cc.set(e,n),e.style.background=t,e.style.borderColor=s)}const Tc=new WeakMap;function Oc(e,t,s,n){let l=t+""+s,a=Tc.get(e);l!=a&&(Tc.set(e,l),e.style.height=s+"px",e.style.width=t+"px",e.style.marginLeft=n?-t/2+"px":0,e.style.marginTop=n?-s/2+"px":0)}const nu={passive:!0},Zg={...nu,capture:!0};function Pl(e,t,s,n){t.addEventListener(e,s,n?Zg:nu)}function Cr(e,t,s,n){t.removeEventListener(e,s,nu)}po&&xr();function ln(e,t,s,n){let l;s=s||0,n=n||t.length-1;let a=n<=2147483647;for(;n-s>1;)l=a?s+n>>1:Us((s+n)/2),t[l]<e?s=l:n=l;return e-t[s]<=t[n]-e?s:n}function Af(e){return(s,n,l)=>{let a=-1,c=-1;for(let u=n;u<=l;u++)if(e(s[u])){a=u;break}for(let u=l;u>=n;u--)if(e(s[u])){c=u;break}return[a,c]}}const Tf=e=>e!=null,Of=e=>e!=null&&e>0,ka=Af(Tf),Qg=Af(Of);function Xg(e,t,s,n=0,l=!1){let a=l?Qg:ka,c=l?Of:Tf;[t,s]=a(e,t,s);let u=e[t],i=e[t];if(t>-1)if(n==1)u=e[t],i=e[s];else if(n==-1)u=e[s],i=e[t];else for(let v=t;v<=s;v++){let b=e[v];c(b)&&(b<u?u=b:b>i&&(i=b))}return[u??At,i??-At]}function wa(e,t,s,n){let l=Mc(e),a=Mc(t);e==t&&(l==-1?(e*=s,t/=s):(e/=s,t*=s));let c=s==10?zn:Ef,u=l==1?Us:qs,i=a==1?qs:Us,v=u(c(Qt(e))),b=i(c(Qt(t))),_=ao(s,v),k=ao(s,b);return s==10&&(v<0&&(_=Tt(_,-v)),b<0&&(k=Tt(k,-b))),n||s==2?(e=_*l,t=k*a):(e=jf(e,_),t=$a(t,k)),[e,t]}function lu(e,t,s,n){let l=wa(e,t,s,n);return e==0&&(l[0]=0),t==0&&(l[1]=0),l}const ou=.1,Ec={mode:3,pad:ou},Bo={pad:0,soft:null,mode:0},e_={min:Bo,max:Bo};function na(e,t,s,n){return xa(s)?Pc(e,t,s):(Bo.pad=s,Bo.soft=n?0:null,Bo.mode=n?3:0,Pc(e,t,e_))}function gt(e,t){return e??t}function t_(e,t,s){for(t=gt(t,0),s=gt(s,e.length-1);t<=s;){if(e[t]!=null)return!0;t++}return!1}function Pc(e,t,s){let n=s.min,l=s.max,a=gt(n.pad,0),c=gt(l.pad,0),u=gt(n.hard,-At),i=gt(l.hard,At),v=gt(n.soft,At),b=gt(l.soft,-At),_=gt(n.mode,0),k=gt(l.mode,0),$=t-e,L=zn($),V=Ss(Qt(e),Qt(t)),j=zn(V),q=Qt(j-L);($<1e-24||q>10)&&($=0,(e==0||t==0)&&($=1e-24,_==2&&v!=At&&(a=0),k==2&&b!=-At&&(c=0)));let z=$||V||1e3,K=zn(z),N=ao(10,Us(K)),B=z*($==0?e==0?.1:1:a),H=Tt(jf(e-B,N/10),24),ce=e>=v&&(_==1||_==3&&H<=v||_==2&&H>=v)?v:At,fe=Ss(u,H<ce&&e>=ce?ce:on(ce,H)),Ne=z*($==0?t==0?.1:1:c),re=Tt($a(t+Ne,N/10),24),E=t<=b&&(k==1||k==3&&re>=b||k==2&&re<=b)?b:-At,U=on(i,re>E&&t<=E?E:Ss(E,re));return fe==U&&fe==0&&(U=100),[fe,U]}const s_=new Intl.NumberFormat(po?Yg.language:"en-US"),iu=e=>s_.format(e),zs=Math,Li=zs.PI,Qt=zs.abs,Us=zs.floor,Zt=zs.round,qs=zs.ceil,on=zs.min,Ss=zs.max,ao=zs.pow,Mc=zs.sign,zn=zs.log10,Ef=zs.log2,n_=(e,t=1)=>zs.sinh(e)*t,or=(e,t=1)=>zs.asinh(e/t),At=1/0;function Nc(e){return(zn((e^e>>31)-(e>>31))|0)+1}function Ar(e,t,s){return on(Ss(e,t),s)}function Pf(e){return typeof e=="function"}function dt(e){return Pf(e)?e:()=>e}const l_=()=>{},Mf=e=>e,Nf=(e,t)=>t,o_=e=>null,jc=e=>!0,Rc=(e,t)=>e==t,i_=/\.\d*?(?=9{6,}|0{6,})/gm,jl=e=>{if(Vf(e)||al.has(e))return e;const t=`${e}`,s=t.match(i_);if(s==null)return e;let n=s[0].length-1;if(t.indexOf("e-")!=-1){let[l,a]=t.split("e");return+`${jl(l)}e${a}`}return Tt(e,n)};function wl(e,t){return jl(Tt(jl(e/t))*t)}function $a(e,t){return jl(qs(jl(e/t))*t)}function jf(e,t){return jl(Us(jl(e/t))*t)}function Tt(e,t=0){if(Vf(e))return e;let s=10**t,n=e*s*(1+Number.EPSILON);return Zt(n)/s}const al=new Map;function Rf(e){return((""+e).split(".")[1]||"").length}function ai(e,t,s,n){let l=[],a=n.map(Rf);for(let c=t;c<s;c++){let u=Qt(c),i=Tt(ao(e,c),u);for(let v=0;v<n.length;v++){let b=e==10?+`${n[v]}e${c}`:n[v]*i,_=(c>=0?0:u)+(c>=a[v]?0:a[v]),k=e==10?b:Tt(b,_);l.push(k),al.set(k,_)}}return l}const Wo={},au=[],ro=[null,null],tl=Array.isArray,Vf=Number.isInteger,a_=e=>e===void 0;function Vc(e){return typeof e=="string"}function xa(e){let t=!1;if(e!=null){let s=e.constructor;t=s==null||s==Object}return t}function r_(e){return e!=null&&typeof e=="object"}const u_=Object.getPrototypeOf(Uint8Array),Df="__proto__";function uo(e,t=xa){let s;if(tl(e)){let n=e.find(l=>l!=null);if(tl(n)||t(n)){s=Array(e.length);for(let l=0;l<e.length;l++)s[l]=uo(e[l],t)}else s=e.slice()}else if(e instanceof u_)s=e.slice();else if(t(e)){s={};for(let n in e)n!=Df&&(s[n]=uo(e[n],t))}else s=e;return s}function Jt(e){let t=arguments;for(let s=1;s<t.length;s++){let n=t[s];for(let l in n)l!=Df&&(xa(e[l])?Jt(e[l],uo(n[l])):e[l]=uo(n[l]))}return e}const c_=0,d_=1,f_=2;function p_(e,t,s){for(let n=0,l,a=-1;n<t.length;n++){let c=t[n];if(c>a){for(l=c-1;l>=0&&e[l]==null;)e[l--]=null;for(l=c+1;l<s&&e[l]==null;)e[a=l++]=null}}}function m_(e,t){if(b_(e)){let c=e[0].slice();for(let u=1;u<e.length;u++)c.push(...e[u].slice(1));return g_(c[0])||(c=h_(c)),c}let s=new Set;for(let c=0;c<e.length;c++){let i=e[c][0],v=i.length;for(let b=0;b<v;b++)s.add(i[b])}let n=[Array.from(s).sort((c,u)=>c-u)],l=n[0].length,a=new Map;for(let c=0;c<l;c++)a.set(n[0][c],c);for(let c=0;c<e.length;c++){let u=e[c],i=u[0];for(let v=1;v<u.length;v++){let b=u[v],_=Array(l).fill(void 0),k=t?t[c][v]:d_,$=[];for(let L=0;L<b.length;L++){let V=b[L],j=a.get(i[L]);V===null?k!=c_&&(_[j]=V,k==f_&&$.push(j)):_[j]=V}p_(_,$,l),n.push(_)}}return n}const v_=typeof queueMicrotask>"u"?e=>Promise.resolve().then(e):queueMicrotask;function h_(e){let t=e[0],s=t.length,n=Array(s);for(let a=0;a<n.length;a++)n[a]=a;n.sort((a,c)=>t[a]-t[c]);let l=[];for(let a=0;a<e.length;a++){let c=e[a],u=Array(s);for(let i=0;i<s;i++)u[i]=c[n[i]];l.push(u)}return l}function b_(e){let t=e[0][0],s=t.length;for(let n=1;n<e.length;n++){let l=e[n][0];if(l.length!=s)return!1;if(l!=t){for(let a=0;a<s;a++)if(l[a]!=t[a])return!1}}return!0}function g_(e,t=100){const s=e.length;if(s<=1)return!0;let n=0,l=s-1;for(;n<=l&&e[n]==null;)n++;for(;l>=n&&e[l]==null;)l--;if(l<=n)return!0;const a=Ss(1,Us((l-n+1)/t));for(let c=e[n],u=n+a;u<=l;u+=a){const i=e[u];if(i!=null){if(i<=c)return!1;c=i}}return!0}const Lf=["January","February","March","April","May","June","July","August","September","October","November","December"],If=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];function Uf(e){return e.slice(0,3)}const __=If.map(Uf),y_=Lf.map(Uf),k_={MMMM:Lf,MMM:y_,WWWW:If,WWW:__};function To(e){return(e<10?"0":"")+e}function w_(e){return(e<10?"00":e<100?"0":"")+e}const $_={YYYY:e=>e.getFullYear(),YY:e=>(e.getFullYear()+"").slice(2),MMMM:(e,t)=>t.MMMM[e.getMonth()],MMM:(e,t)=>t.MMM[e.getMonth()],MM:e=>To(e.getMonth()+1),M:e=>e.getMonth()+1,DD:e=>To(e.getDate()),D:e=>e.getDate(),WWWW:(e,t)=>t.WWWW[e.getDay()],WWW:(e,t)=>t.WWW[e.getDay()],HH:e=>To(e.getHours()),H:e=>e.getHours(),h:e=>{let t=e.getHours();return t==0?12:t>12?t-12:t},AA:e=>e.getHours()>=12?"PM":"AM",aa:e=>e.getHours()>=12?"pm":"am",a:e=>e.getHours()>=12?"p":"a",mm:e=>To(e.getMinutes()),m:e=>e.getMinutes(),ss:e=>To(e.getSeconds()),s:e=>e.getSeconds(),fff:e=>w_(e.getMilliseconds())};function ru(e,t){t=t||k_;let s=[],n=/\{([a-z]+)\}|[^{]+/gi,l;for(;l=n.exec(e);)s.push(l[0][0]=="{"?$_[l[1]]:l[0]);return a=>{let c="";for(let u=0;u<s.length;u++)c+=typeof s[u]=="string"?s[u]:s[u](a,t);return c}}const x_=new Intl.DateTimeFormat().resolvedOptions().timeZone;function S_(e,t){let s;return t=="UTC"||t=="Etc/UTC"?s=new Date(+e+e.getTimezoneOffset()*6e4):t==x_?s=e:(s=new Date(e.toLocaleString("en-US",{timeZone:t})),s.setMilliseconds(e.getMilliseconds())),s}const Ff=e=>e%1==0,la=[1,2,2.5,5],C_=ai(10,-32,0,la),zf=ai(10,0,32,la),A_=zf.filter(Ff),$l=C_.concat(zf),uu=`
129
+ `,Hf="{YYYY}",Dc=uu+Hf,Bf="{M}/{D}",jo=uu+Bf,Pi=jo+"/{YY}",Wf="{aa}",T_="{h}:{mm}",to=T_+Wf,Lc=uu+to,Ic=":{ss}",wt=null;function Kf(e){let t=e*1e3,s=t*60,n=s*60,l=n*24,a=l*30,c=l*365,i=(e==1?ai(10,0,3,la).filter(Ff):ai(10,-3,0,la)).concat([t,t*5,t*10,t*15,t*30,s,s*5,s*10,s*15,s*30,n,n*2,n*3,n*4,n*6,n*8,n*12,l,l*2,l*3,l*4,l*5,l*6,l*7,l*8,l*9,l*10,l*15,a,a*2,a*3,a*4,a*6,c,c*2,c*5,c*10,c*25,c*50,c*100]);const v=[[c,Hf,wt,wt,wt,wt,wt,wt,1],[l*28,"{MMM}",Dc,wt,wt,wt,wt,wt,1],[l,Bf,Dc,wt,wt,wt,wt,wt,1],[n,"{h}"+Wf,Pi,wt,jo,wt,wt,wt,1],[s,to,Pi,wt,jo,wt,wt,wt,1],[t,Ic,Pi+" "+to,wt,jo+" "+to,wt,Lc,wt,1],[e,Ic+".{fff}",Pi+" "+to,wt,jo+" "+to,wt,Lc,wt,1]];function b(_){return(k,$,L,V,j,q)=>{let z=[],K=j>=c,N=j>=a&&j<c,B=_(L),H=Tt(B*e,3),ce=ir(B.getFullYear(),K?0:B.getMonth(),N||K?1:B.getDate()),fe=Tt(ce*e,3);if(N||K){let Ne=N?j/a:0,re=K?j/c:0,E=H==fe?H:Tt(ir(ce.getFullYear()+re,ce.getMonth()+Ne,1)*e,3),U=new Date(Zt(E/e)),de=U.getFullYear(),$e=U.getMonth();for(let I=0;E<=V;I++){let g=ir(de+re*I,$e+Ne*I,1),ee=g-_(Tt(g*e,3));E=Tt((+g+ee)*e,3),E<=V&&z.push(E)}}else{let Ne=j>=l?l:j,re=Us(L)-Us(H),E=fe+re+$a(H-fe,Ne);z.push(E);let U=_(E),de=U.getHours()+U.getMinutes()/s+U.getSeconds()/n,$e=j/n,I=k.axes[$]._space,g=q/I;for(;E=Tt(E+j,e==1?0:3),!(E>V);)if($e>1){let ee=Us(Tt(de+$e,6))%24,ie=_(E).getHours()-ee;ie>1&&(ie=-1),E-=ie*n,de=(de+$e)%24;let S=z[z.length-1];Tt((E-S)/j,3)*g>=.7&&z.push(E)}else z.push(E)}return z}}return[i,v,b]}const[O_,E_,P_]=Kf(1),[M_,N_,j_]=Kf(.001);ai(2,-53,53,[1]);function Uc(e,t){return e.map(s=>s.map((n,l)=>l==0||l==8||n==null?n:t(l==1||s[8]==0?n:s[1]+n)))}function Fc(e,t){return(s,n,l,a,c)=>{let u=t.find(L=>c>=L[0])||t[t.length-1],i,v,b,_,k,$;return n.map(L=>{let V=e(L),j=V.getFullYear(),q=V.getMonth(),z=V.getDate(),K=V.getHours(),N=V.getMinutes(),B=V.getSeconds(),H=j!=i&&u[2]||q!=v&&u[3]||z!=b&&u[4]||K!=_&&u[5]||N!=k&&u[6]||B!=$&&u[7]||u[1];return i=j,v=q,b=z,_=K,k=N,$=B,H(V)})}}function R_(e,t){let s=ru(t);return(n,l,a,c,u)=>l.map(i=>s(e(i)))}function ir(e,t,s){return new Date(e,t,s)}function zc(e,t){return t(e)}const V_="{YYYY}-{MM}-{DD} {h}:{mm}{aa}";function Hc(e,t){return(s,n,l,a)=>a==null?su:t(e(n))}function D_(e,t){let s=e.series[t];return s.width?s.stroke(e,t):s.points.width?s.points.stroke(e,t):null}function L_(e,t){return e.series[t].fill(e,t)}const I_={show:!0,live:!0,isolate:!1,mount:l_,markers:{show:!0,width:2,stroke:D_,fill:L_,dash:"solid"},idx:null,idxs:null,values:[]};function U_(e,t){let s=e.cursor.points,n=Gs(),l=s.size(e,t);Nt(n,Mo,l),Nt(n,No,l);let a=l/-2;Nt(n,"marginLeft",a),Nt(n,"marginTop",a);let c=s.width(e,t,l);return c&&Nt(n,"borderWidth",c),n}function F_(e,t){let s=e.series[t].points;return s._fill||s._stroke}function z_(e,t){let s=e.series[t].points;return s._stroke||s._fill}function H_(e,t){return e.series[t].points.size}const ar=[0,0];function B_(e,t,s){return ar[0]=t,ar[1]=s,ar}function Mi(e,t,s,n=!0){return l=>{l.button==0&&(!n||l.target==t)&&s(l)}}function rr(e,t,s,n=!0){return l=>{(!n||l.target==t)&&s(l)}}const W_={show:!0,x:!0,y:!0,lock:!1,move:B_,points:{one:!1,show:U_,size:H_,width:0,stroke:z_,fill:F_},bind:{mousedown:Mi,mouseup:Mi,click:Mi,dblclick:Mi,mousemove:rr,mouseleave:rr,mouseenter:rr},drag:{setScale:!0,x:!0,y:!1,dist:0,uni:null,click:(e,t)=>{t.stopPropagation(),t.stopImmediatePropagation()},_x:!1,_y:!1},focus:{dist:(e,t,s,n,l)=>n-l,prox:-1,bias:0},hover:{skip:[void 0],prox:null,bias:0},left:-10,top:-10,idx:null,dataIdx:null,idxs:null,event:null},Gf={show:!0,stroke:"rgba(0,0,0,0.07)",width:2},cu=Jt({},Gf,{filter:Nf}),qf=Jt({},cu,{size:10}),Jf=Jt({},Gf,{show:!1}),du='12px system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"',Yf="bold "+du,Zf=1.5,Bc={show:!0,scale:"x",stroke:tu,space:50,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Yf,side:2,grid:cu,ticks:qf,border:Jf,font:du,lineGap:Zf,rotate:0},K_="Value",G_="Time",Wc={show:!0,scale:"x",auto:!1,sorted:1,min:At,max:-At,idxs:[]};function q_(e,t,s,n,l){return t.map(a=>a==null?"":iu(a))}function J_(e,t,s,n,l,a,c){let u=[],i=al.get(l)||0;s=c?s:Tt($a(s,l),i);for(let v=s;v<=n;v=Tt(v+l,i))u.push(Object.is(v,-0)?0:v);return u}function Tr(e,t,s,n,l,a,c){const u=[],i=e.scales[e.axes[t].scale].log,v=i==10?zn:Ef,b=Us(v(s));l=ao(i,b),i==10&&(l=$l[ln(l,$l)]);let _=s,k=l*i;i==10&&(k=$l[ln(k,$l)]);do u.push(_),_=_+l,i==10&&!al.has(_)&&(_=Tt(_,al.get(l))),_>=k&&(l=_,k=l*i,i==10&&(k=$l[ln(k,$l)]));while(_<=n);return u}function Y_(e,t,s,n,l,a,c){let i=e.scales[e.axes[t].scale].asinh,v=n>i?Tr(e,t,Ss(i,s),n,l):[i],b=n>=0&&s<=0?[0]:[];return(s<-i?Tr(e,t,Ss(i,-n),-s,l):[i]).reverse().map(k=>-k).concat(b,v)}const Qf=/./,Z_=/[12357]/,Q_=/[125]/,Kc=/1/,Or=(e,t,s,n)=>e.map((l,a)=>t==4&&l==0||a%n==0&&s.test(l.toExponential()[l<0?1:0])?l:null);function X_(e,t,s,n,l){let a=e.axes[s],c=a.scale,u=e.scales[c],i=e.valToPos,v=a._space,b=i(10,c),_=i(9,c)-b>=v?Qf:i(7,c)-b>=v?Z_:i(5,c)-b>=v?Q_:Kc;if(_==Kc){let k=Qt(i(1,c)-b);if(k<v)return Or(t.slice().reverse(),u.distr,_,qs(v/k)).reverse()}return Or(t,u.distr,_,1)}function ey(e,t,s,n,l){let a=e.axes[s],c=a.scale,u=a._space,i=e.valToPos,v=Qt(i(1,c)-i(2,c));return v<u?Or(t.slice().reverse(),3,Qf,qs(u/v)).reverse():t}function ty(e,t,s,n){return n==null?su:t==null?"":iu(t)}const Gc={show:!0,scale:"y",stroke:tu,space:30,gap:5,alignTo:1,size:50,labelGap:0,labelSize:30,labelFont:Yf,side:3,grid:cu,ticks:qf,border:Jf,font:du,lineGap:Zf,rotate:0};function sy(e,t){let s=3+(e||1)*2;return Tt(s*t,3)}function ny(e,t){let{scale:s,idxs:n}=e.series[0],l=e._data[0],a=e.valToPos(l[n[0]],s,!0),c=e.valToPos(l[n[1]],s,!0),u=Qt(c-a),i=e.series[t],v=u/(i.points.space*yt);return n[1]-n[0]<=v}const qc={scale:null,auto:!0,sorted:0,min:At,max:-At},Xf=(e,t,s,n,l)=>l,Jc={show:!0,auto:!0,sorted:0,gaps:Xf,alpha:1,facets:[Jt({},qc,{scale:"x"}),Jt({},qc,{scale:"y"})]},Yc={scale:"y",auto:!0,sorted:0,show:!0,spanGaps:!1,gaps:Xf,alpha:1,points:{show:ny,filter:null},values:null,min:At,max:-At,idxs:[],path:null,clip:null};function ly(e,t,s,n,l){return s/10}const ep={time:Og,auto:!0,distr:1,log:10,asinh:1,min:null,max:null,dir:1,ori:0},oy=Jt({},ep,{time:!1,ori:1}),Zc={};function tp(e,t){let s=Zc[e];return s||(s={key:e,plots:[],sub(n){s.plots.push(n)},unsub(n){s.plots=s.plots.filter(l=>l!=n)},pub(n,l,a,c,u,i,v){for(let b=0;b<s.plots.length;b++)s.plots[b]!=l&&s.plots[b].pub(n,l,a,c,u,i,v)}},e!=null&&(Zc[e]=s)),s}const co=1,Er=2;function Vl(e,t,s){const n=e.mode,l=e.series[t],a=n==2?e._data[t]:e._data,c=e.scales,u=e.bbox;let i=a[0],v=n==2?a[1]:a[t],b=n==2?c[l.facets[0].scale]:c[e.series[0].scale],_=n==2?c[l.facets[1].scale]:c[l.scale],k=u.left,$=u.top,L=u.width,V=u.height,j=e.valToPosH,q=e.valToPosV;return b.ori==0?s(l,i,v,b,_,j,q,k,$,L,V,Ca,mo,Ta,np,op):s(l,i,v,b,_,q,j,$,k,V,L,Aa,vo,mu,lp,ip)}function fu(e,t){let s=0,n=0,l=gt(e.bands,au);for(let a=0;a<l.length;a++){let c=l[a];c.series[0]==t?s=c.dir:c.series[1]==t&&(c.dir==1?n|=1:n|=2)}return[s,n==1?-1:n==2?1:n==3?2:0]}function iy(e,t,s,n,l){let a=e.mode,c=e.series[t],u=a==2?c.facets[1].scale:c.scale,i=e.scales[u];return l==-1?i.min:l==1?i.max:i.distr==3?i.dir==1?i.min:i.max:0}function Hn(e,t,s,n,l,a){return Vl(e,t,(c,u,i,v,b,_,k,$,L,V,j)=>{let q=c.pxRound;const z=v.dir*(v.ori==0?1:-1),K=v.ori==0?mo:vo;let N,B;z==1?(N=s,B=n):(N=n,B=s);let H=q(_(u[N],v,V,$)),ce=q(k(i[N],b,j,L)),fe=q(_(u[B],v,V,$)),Ne=q(k(a==1?b.max:b.min,b,j,L)),re=new Path2D(l);return K(re,fe,Ne),K(re,H,Ne),K(re,H,ce),re})}function Sa(e,t,s,n,l,a){let c=null;if(e.length>0){c=new Path2D;const u=t==0?Ta:mu;let i=s;for(let _=0;_<e.length;_++){let k=e[_];if(k[1]>k[0]){let $=k[0]-i;$>0&&u(c,i,n,$,n+a),i=k[1]}}let v=s+l-i,b=10;v>0&&u(c,i,n-b/2,v,n+a+b)}return c}function ay(e,t,s){let n=e[e.length-1];n&&n[0]==t?n[1]=s:e.push([t,s])}function pu(e,t,s,n,l,a,c){let u=[],i=e.length;for(let v=l==1?s:n;v>=s&&v<=n;v+=l)if(t[v]===null){let _=v,k=v;if(l==1)for(;++v<=n&&t[v]===null;)k=v;else for(;--v>=s&&t[v]===null;)k=v;let $=a(e[_]),L=k==_?$:a(e[k]),V=_-l;$=c<=0&&V>=0&&V<i?a(e[V]):$;let q=k+l;L=c>=0&&q>=0&&q<i?a(e[q]):L,L>=$&&u.push([$,L])}return u}function Qc(e){return e==0?Mf:e==1?Zt:t=>wl(t,e)}function sp(e){let t=e==0?Ca:Aa,s=e==0?(l,a,c,u,i,v)=>{l.arcTo(a,c,u,i,v)}:(l,a,c,u,i,v)=>{l.arcTo(c,a,i,u,v)},n=e==0?(l,a,c,u,i)=>{l.rect(a,c,u,i)}:(l,a,c,u,i)=>{l.rect(c,a,i,u)};return(l,a,c,u,i,v=0,b=0)=>{v==0&&b==0?n(l,a,c,u,i):(v=on(v,u/2,i/2),b=on(b,u/2,i/2),t(l,a+v,c),s(l,a+u,c,a+u,c+i,v),s(l,a+u,c+i,a,c+i,b),s(l,a,c+i,a,c,b),s(l,a,c,a+u,c,v),l.closePath())}}const Ca=(e,t,s)=>{e.moveTo(t,s)},Aa=(e,t,s)=>{e.moveTo(s,t)},mo=(e,t,s)=>{e.lineTo(t,s)},vo=(e,t,s)=>{e.lineTo(s,t)},Ta=sp(0),mu=sp(1),np=(e,t,s,n,l,a)=>{e.arc(t,s,n,l,a)},lp=(e,t,s,n,l,a)=>{e.arc(s,t,n,l,a)},op=(e,t,s,n,l,a,c)=>{e.bezierCurveTo(t,s,n,l,a,c)},ip=(e,t,s,n,l,a,c)=>{e.bezierCurveTo(s,t,l,n,c,a)};function ap(e){return(t,s,n,l,a)=>Vl(t,s,(c,u,i,v,b,_,k,$,L,V,j)=>{let{pxRound:q,points:z}=c,K,N;v.ori==0?(K=Ca,N=np):(K=Aa,N=lp);const B=Tt(z.width*yt,3);let H=(z.size-z.width)/2*yt,ce=Tt(H*2,3),fe=new Path2D,Ne=new Path2D,{left:re,top:E,width:U,height:de}=t.bbox;Ta(Ne,re-ce,E-ce,U+ce*2,de+ce*2);const $e=I=>{if(i[I]!=null){let g=q(_(u[I],v,V,$)),ee=q(k(i[I],b,j,L));K(fe,g+H,ee),N(fe,g,ee,H,0,Li*2)}};if(a)a.forEach($e);else for(let I=n;I<=l;I++)$e(I);return{stroke:B>0?fe:null,fill:fe,clip:Ne,flags:co|Er}})}function rp(e){return(t,s,n,l,a,c)=>{n!=l&&(a!=n&&c!=n&&e(t,s,n),a!=l&&c!=l&&e(t,s,l),e(t,s,c))}}const ry=rp(mo),uy=rp(vo);function up(e){const t=gt(e==null?void 0:e.alignGaps,0);return(s,n,l,a)=>Vl(s,n,(c,u,i,v,b,_,k,$,L,V,j)=>{[l,a]=ka(i,l,a);let q=c.pxRound,z=de=>q(_(de,v,V,$)),K=de=>q(k(de,b,j,L)),N,B;v.ori==0?(N=mo,B=ry):(N=vo,B=uy);const H=v.dir*(v.ori==0?1:-1),ce={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:co},fe=ce.stroke;let Ne=!1;if(a-l>=V*4){let de=F=>s.posToVal(F,v.key,!0),$e=null,I=null,g,ee,Oe,je=z(u[H==1?l:a]),ie=z(u[l]),S=z(u[a]),C=de(H==1?ie+1:S-1);for(let F=H==1?l:a;F>=l&&F<=a;F+=H){let x=u[F],be=(H==1?x<C:x>C)?je:z(x),se=i[F];be==je?se!=null?(ee=se,$e==null?(N(fe,be,K(ee)),g=$e=I=ee):ee<$e?$e=ee:ee>I&&(I=ee)):se===null&&(Ne=!0):($e!=null&&B(fe,je,K($e),K(I),K(g),K(ee)),se!=null?(ee=se,N(fe,be,K(ee)),$e=I=g=ee):($e=I=null,se===null&&(Ne=!0)),je=be,C=de(je+H))}$e!=null&&$e!=I&&Oe!=je&&B(fe,je,K($e),K(I),K(g),K(ee))}else for(let de=H==1?l:a;de>=l&&de<=a;de+=H){let $e=i[de];$e===null?Ne=!0:$e!=null&&N(fe,z(u[de]),K($e))}let[E,U]=fu(s,n);if(c.fill!=null||E!=0){let de=ce.fill=new Path2D(fe),$e=c.fillTo(s,n,c.min,c.max,E),I=K($e),g=z(u[l]),ee=z(u[a]);H==-1&&([ee,g]=[g,ee]),N(de,ee,I),N(de,g,I)}if(!c.spanGaps){let de=[];Ne&&de.push(...pu(u,i,l,a,H,z,t)),ce.gaps=de=c.gaps(s,n,l,a,de),ce.clip=Sa(de,v.ori,$,L,V,j)}return U!=0&&(ce.band=U==2?[Hn(s,n,l,a,fe,-1),Hn(s,n,l,a,fe,1)]:Hn(s,n,l,a,fe,U)),ce})}function cy(e){const t=gt(e.align,1),s=gt(e.ascDesc,!1),n=gt(e.alignGaps,0),l=gt(e.extend,!1);return(a,c,u,i)=>Vl(a,c,(v,b,_,k,$,L,V,j,q,z,K)=>{[u,i]=ka(_,u,i);let N=v.pxRound,{left:B,width:H}=a.bbox,ce=ie=>N(L(ie,k,z,j)),fe=ie=>N(V(ie,$,K,q)),Ne=k.ori==0?mo:vo;const re={stroke:new Path2D,fill:null,clip:null,band:null,gaps:null,flags:co},E=re.stroke,U=k.dir*(k.ori==0?1:-1);let de=fe(_[U==1?u:i]),$e=ce(b[U==1?u:i]),I=$e,g=$e;l&&t==-1&&(g=B,Ne(E,g,de)),Ne(E,$e,de);for(let ie=U==1?u:i;ie>=u&&ie<=i;ie+=U){let S=_[ie];if(S==null)continue;let C=ce(b[ie]),F=fe(S);t==1?Ne(E,C,de):Ne(E,I,F),Ne(E,C,F),de=F,I=C}let ee=I;l&&t==1&&(ee=B+H,Ne(E,ee,de));let[Oe,je]=fu(a,c);if(v.fill!=null||Oe!=0){let ie=re.fill=new Path2D(E),S=v.fillTo(a,c,v.min,v.max,Oe),C=fe(S);Ne(ie,ee,C),Ne(ie,g,C)}if(!v.spanGaps){let ie=[];ie.push(...pu(b,_,u,i,U,ce,n));let S=v.width*yt/2,C=s||t==1?S:-S,F=s||t==-1?-S:S;ie.forEach(x=>{x[0]+=C,x[1]+=F}),re.gaps=ie=v.gaps(a,c,u,i,ie),re.clip=Sa(ie,k.ori,j,q,z,K)}return je!=0&&(re.band=je==2?[Hn(a,c,u,i,E,-1),Hn(a,c,u,i,E,1)]:Hn(a,c,u,i,E,je)),re})}function Xc(e,t,s,n,l,a,c=At){if(e.length>1){let u=null;for(let i=0,v=1/0;i<e.length;i++)if(t[i]!==void 0){if(u!=null){let b=Qt(e[i]-e[u]);b<v&&(v=b,c=Qt(s(e[i],n,l,a)-s(e[u],n,l,a)))}u=i}}return c}function dy(e){e=e||Wo;const t=gt(e.size,[.6,At,1]),s=e.align||0,n=e.gap||0;let l=e.radius;l=l==null?[0,0]:typeof l=="number"?[l,0]:l;const a=dt(l),c=1-t[0],u=gt(t[1],At),i=gt(t[2],1),v=gt(e.disp,Wo),b=gt(e.each,$=>{}),{fill:_,stroke:k}=v;return($,L,V,j)=>Vl($,L,(q,z,K,N,B,H,ce,fe,Ne,re,E)=>{let U=q.pxRound,de=s,$e=n*yt,I=u*yt,g=i*yt,ee,Oe;N.ori==0?[ee,Oe]=a($,L):[Oe,ee]=a($,L);const je=N.dir*(N.ori==0?1:-1);let ie=N.ori==0?Ta:mu,S=N.ori==0?b:(he,Be,G,X,ue,qe,pt)=>{b(he,Be,G,ue,X,pt,qe)},C=gt($.bands,au).find(he=>he.series[0]==L),F=C!=null?C.dir:0,x=q.fillTo($,L,q.min,q.max,F),O=U(ce(x,B,E,Ne)),be,se,ft,Z=re,Je=U(q.width*yt),A=!1,D=null,J=null,pe=null,me=null;_!=null&&(Je==0||k!=null)&&(A=!0,D=_.values($,L,V,j),J=new Map,new Set(D).forEach(he=>{he!=null&&J.set(he,new Path2D)}),Je>0&&(pe=k.values($,L,V,j),me=new Map,new Set(pe).forEach(he=>{he!=null&&me.set(he,new Path2D)})));let{x0:ve,size:Ae}=v;if(ve!=null&&Ae!=null){de=1,z=ve.values($,L,V,j),ve.unit==2&&(z=z.map(G=>$.posToVal(fe+G*re,N.key,!0)));let he=Ae.values($,L,V,j);Ae.unit==2?se=he[0]*re:se=H(he[0],N,re,fe)-H(0,N,re,fe),Z=Xc(z,K,H,N,re,fe,Z),ft=Z-se+$e}else Z=Xc(z,K,H,N,re,fe,Z),ft=Z*c+$e,se=Z-ft;ft<1&&(ft=0),Je>=se/2&&(Je=0),ft<5&&(U=Mf);let Te=ft>0,xe=Z-ft-(Te?Je:0);se=U(Ar(xe,g,I)),be=(de==0?se/2:de==je?0:se)-de*je*((de==0?$e/2:0)+(Te?Je/2:0));const ae={stroke:null,fill:null,clip:null,band:null,gaps:null,flags:0},De=A?null:new Path2D;let oe=null;if(C!=null)oe=$.data[C.series[1]];else{let{y0:he,y1:Be}=v;he!=null&&Be!=null&&(K=Be.values($,L,V,j),oe=he.values($,L,V,j))}let Le=ee*se,Ce=Oe*se;for(let he=je==1?V:j;he>=V&&he<=j;he+=je){let Be=K[he];if(Be==null)continue;if(oe!=null){let tt=oe[he]??0;if(Be-tt==0)continue;O=ce(tt,B,E,Ne)}let G=N.distr!=2||v!=null?z[he]:he,X=H(G,N,re,fe),ue=ce(gt(Be,x),B,E,Ne),qe=U(X-be),pt=U(Ss(ue,O)),lt=U(on(ue,O)),St=pt-lt;if(Be!=null){let tt=Be<0?Ce:Le,jt=Be<0?Le:Ce;A?(Je>0&&pe[he]!=null&&ie(me.get(pe[he]),qe,lt+Us(Je/2),se,Ss(0,St-Je),tt,jt),D[he]!=null&&ie(J.get(D[he]),qe,lt+Us(Je/2),se,Ss(0,St-Je),tt,jt)):ie(De,qe,lt+Us(Je/2),se,Ss(0,St-Je),tt,jt),S($,L,he,qe-Je/2,lt,se+Je,St)}}return Je>0?ae.stroke=A?me:De:A||(ae._fill=q.width==0?q._fill:q._stroke??q._fill,ae.width=0),ae.fill=A?J:De,ae})}function fy(e,t){const s=gt(t==null?void 0:t.alignGaps,0);return(n,l,a,c)=>Vl(n,l,(u,i,v,b,_,k,$,L,V,j,q)=>{[a,c]=ka(v,a,c);let z=u.pxRound,K=ee=>z(k(ee,b,j,L)),N=ee=>z($(ee,_,q,V)),B,H,ce;b.ori==0?(B=Ca,ce=mo,H=op):(B=Aa,ce=vo,H=ip);const fe=b.dir*(b.ori==0?1:-1);let Ne=K(i[fe==1?a:c]),re=Ne,E=[],U=[];for(let ee=fe==1?a:c;ee>=a&&ee<=c;ee+=fe)if(v[ee]!=null){let je=i[ee],ie=K(je);E.push(re=ie),U.push(N(v[ee]))}const de={stroke:e(E,U,B,ce,H,z),fill:null,clip:null,band:null,gaps:null,flags:co},$e=de.stroke;let[I,g]=fu(n,l);if(u.fill!=null||I!=0){let ee=de.fill=new Path2D($e),Oe=u.fillTo(n,l,u.min,u.max,I),je=N(Oe);ce(ee,re,je),ce(ee,Ne,je)}if(!u.spanGaps){let ee=[];ee.push(...pu(i,v,a,c,fe,K,s)),de.gaps=ee=u.gaps(n,l,a,c,ee),de.clip=Sa(ee,b.ori,L,V,j,q)}return g!=0&&(de.band=g==2?[Hn(n,l,a,c,$e,-1),Hn(n,l,a,c,$e,1)]:Hn(n,l,a,c,$e,g)),de})}function py(e){return fy(my,e)}function my(e,t,s,n,l,a){const c=e.length;if(c<2)return null;const u=new Path2D;if(s(u,e[0],t[0]),c==2)n(u,e[1],t[1]);else{let i=Array(c),v=Array(c-1),b=Array(c-1),_=Array(c-1);for(let k=0;k<c-1;k++)b[k]=t[k+1]-t[k],_[k]=e[k+1]-e[k],v[k]=b[k]/_[k];i[0]=v[0];for(let k=1;k<c-1;k++)v[k]===0||v[k-1]===0||v[k-1]>0!=v[k]>0?i[k]=0:(i[k]=3*(_[k-1]+_[k])/((2*_[k]+_[k-1])/v[k-1]+(_[k]+2*_[k-1])/v[k]),isFinite(i[k])||(i[k]=0));i[c-1]=v[c-2];for(let k=0;k<c-1;k++)l(u,e[k]+_[k]/3,t[k]+i[k]*_[k]/3,e[k+1]-_[k]/3,t[k+1]-i[k+1]*_[k]/3,e[k+1],t[k+1])}return u}const Pr=new Set;function ed(){for(let e of Pr)e.syncRect(!0)}po&&(Pl(qg,lo,ed),Pl(Jg,lo,ed,!0),Pl(sa,lo,()=>{as.pxRatio=yt}));const vy=up(),hy=ap();function td(e,t,s,n){return(n?[e[0],e[1]].concat(e.slice(2)):[e[0]].concat(e.slice(1))).map((a,c)=>Mr(a,c,t,s))}function by(e,t){return e.map((s,n)=>n==0?{}:Jt({},t,s))}function Mr(e,t,s,n){return Jt({},t==0?s:n,e)}function cp(e,t,s){return t==null?ro:[t,s]}const gy=cp;function _y(e,t,s){return t==null?ro:na(t,s,ou,!0)}function dp(e,t,s,n){return t==null?ro:wa(t,s,e.scales[n].log,!1)}const yy=dp;function fp(e,t,s,n){return t==null?ro:lu(t,s,e.scales[n].log,!1)}const ky=fp;function wy(e,t,s,n,l){let a=Ss(Nc(e),Nc(t)),c=t-e,u=ln(l/n*c,s);do{let i=s[u],v=n*i/c;if(v>=l&&a+(i<5?al.get(i):0)<=17)return[i,v]}while(++u<s.length);return[0,0]}function sd(e){let t,s;return e=e.replace(/(\d+)px/,(n,l)=>(t=Zt((s=+l)*yt))+"px"),[e,t,s]}function $y(e){e.show&&[e.font,e.labelFont].forEach(t=>{let s=Tt(t[2]*yt,1);t[0]=t[0].replace(/[0-9.]+px/,s+"px"),t[1]=s})}function as(e,t,s){const n={mode:gt(e.mode,1)},l=n.mode;function a(m,y,T,M){let W=y.valToPct(m);return M+T*(y.dir==-1?1-W:W)}function c(m,y,T,M){let W=y.valToPct(m);return M+T*(y.dir==-1?W:1-W)}function u(m,y,T,M){return y.ori==0?a(m,y,T,M):c(m,y,T,M)}n.valToPosH=a,n.valToPosV=c;let i=!1;n.status=0;const v=n.root=Gs(Eg);if(e.id!=null&&(v.id=e.id),Rs(v,e.class),e.title){let m=Gs(Ng,v);m.textContent=e.title}const b=sn("canvas"),_=n.ctx=b.getContext("2d"),k=Gs(jg,v);Pl("click",k,m=>{m.target===L&&(Et!=Gl||Vt!=ql)&&us.click(n,m)},!0);const $=n.under=Gs(Rg,k);k.appendChild(b);const L=n.over=Gs(Vg,k);e=uo(e);const V=+gt(e.pxAlign,1),j=Qc(V);(e.plugins||[]).forEach(m=>{m.opts&&(e=m.opts(n,e)||e)});const q=e.ms||.001,z=n.series=l==1?td(e.series||[],Wc,Yc,!1):by(e.series||[null],Jc),K=n.axes=td(e.axes||[],Bc,Gc,!0),N=n.scales={},B=n.bands=e.bands||[];B.forEach(m=>{m.fill=dt(m.fill||null),m.dir=gt(m.dir,-1)});const H=l==2?z[1].facets[0].scale:z[0].scale,ce={axes:kp,series:Qe},fe=(e.drawOrder||["axes","series"]).map(m=>ce[m]);function Ne(m){const y=m.distr==3?T=>zn(T>0?T:m.clamp(n,T,m.min,m.max,m.key)):m.distr==4?T=>or(T,m.asinh):m.distr==100?T=>m.fwd(T):T=>T;return T=>{let M=y(T),{_min:W,_max:Q}=m,ye=Q-W;return(M-W)/ye}}function re(m){let y=N[m];if(y==null){let T=(e.scales||Wo)[m]||Wo;if(T.from!=null){re(T.from);let M=Jt({},N[T.from],T,{key:m});M.valToPct=Ne(M),N[m]=M}else{y=N[m]=Jt({},m==H?ep:oy,T),y.key=m;let M=y.time,W=y.range,Q=tl(W);if((m!=H||l==2&&!M)&&(Q&&(W[0]==null||W[1]==null)&&(W={min:W[0]==null?Ec:{mode:1,hard:W[0],soft:W[0]},max:W[1]==null?Ec:{mode:1,hard:W[1],soft:W[1]}},Q=!1),!Q&&xa(W))){let ye=W;W=(Se,Ee,Ie)=>Ee==null?ro:na(Ee,Ie,ye)}y.range=dt(W||(M?gy:m==H?y.distr==3?yy:y.distr==4?ky:cp:y.distr==3?dp:y.distr==4?fp:_y)),y.auto=dt(Q?!1:y.auto),y.clamp=dt(y.clamp||ly),y._min=y._max=null,y.valToPct=Ne(y)}}}re("x"),re("y"),l==1&&z.forEach(m=>{re(m.scale)}),K.forEach(m=>{re(m.scale)});for(let m in e.scales)re(m);const E=N[H],U=E.distr;let de,$e;E.ori==0?(Rs(v,Pg),de=a,$e=c):(Rs(v,Mg),de=c,$e=a);const I={};for(let m in N){let y=N[m];(y.min!=null||y.max!=null)&&(I[m]={min:y.min,max:y.max},y.min=y.max=null)}const g=e.tzDate||(m=>new Date(Zt(m/q))),ee=e.fmtDate||ru,Oe=q==1?P_(g):j_(g),je=Fc(g,Uc(q==1?E_:N_,ee)),ie=Hc(g,zc(V_,ee)),S=[],C=n.legend=Jt({},I_,e.legend),F=n.cursor=Jt({},W_,{drag:{y:l==2}},e.cursor),x=C.show,O=F.show,be=C.markers;C.idxs=S,be.width=dt(be.width),be.dash=dt(be.dash),be.stroke=dt(be.stroke),be.fill=dt(be.fill);let se,ft,Z,Je=[],A=[],D,J=!1,pe={};if(C.live){const m=z[1]?z[1].values:null;J=m!=null,D=J?m(n,1,0):{_:0};for(let y in D)pe[y]=su}if(x)if(se=sn("table",zg,v),Z=sn("tbody",null,se),C.mount(n,se),J){ft=sn("thead",null,se,Z);let m=sn("tr",null,ft);sn("th",null,m);for(var me in D)sn("th",bc,m).textContent=me}else Rs(se,Bg),C.live&&Rs(se,Hg);const ve={show:!0},Ae={show:!1};function Te(m,y){if(y==0&&(J||!C.live||l==2))return ro;let T=[],M=sn("tr",Wg,Z,Z.childNodes[y]);Rs(M,m.class),m.show||Rs(M,xl);let W=sn("th",null,M);if(be.show){let Se=Gs(Kg,W);if(y>0){let Ee=be.width(n,y);Ee&&(Se.style.border=Ee+"px "+be.dash(n,y)+" "+be.stroke(n,y)),Se.style.background=be.fill(n,y)}}let Q=Gs(bc,W);m.label instanceof HTMLElement?Q.appendChild(m.label):Q.textContent=m.label,y>0&&(be.show||(Q.style.color=m.width>0?be.stroke(n,y):be.fill(n,y)),ae("click",W,Se=>{if(F._lock)return;En(Se);let Ee=z.indexOf(m);if((Se.ctrlKey||Se.metaKey)!=C.isolate){let Ie=z.some((Fe,ze)=>ze>0&&ze!=Ee&&Fe.show);z.forEach((Fe,ze)=>{ze>0&&vn(ze,Ie?ze==Ee?ve:Ae:ve,!0,qt.setSeries)})}else vn(Ee,{show:!m.show},!0,qt.setSeries)},!1),Pn&&ae(kc,W,Se=>{F._lock||(En(Se),vn(z.indexOf(m),Yl,!0,qt.setSeries))},!1));for(var ye in D){let Se=sn("td",Gg,M);Se.textContent="--",T.push(Se)}return[M,T]}const xe=new Map;function ae(m,y,T,M=!0){const W=xe.get(y)||{},Q=F.bind[m](n,y,T,M);Q&&(Pl(m,y,W[m]=Q),xe.set(y,W))}function De(m,y,T){const M=xe.get(y)||{};for(let W in M)(m==null||W==m)&&(Cr(W,y,M[W]),delete M[W]);m==null&&xe.delete(y)}let oe=0,Le=0,Ce=0,he=0,Be=0,G=0,X=Be,ue=G,qe=Ce,pt=he,lt=0,St=0,tt=0,jt=0;n.bbox={};let Kn=!1,pn=!1,Qs=!1,Hs=!1,As=!1,gs=!1;function Gn(m,y,T){(T||m!=n.width||y!=n.height)&&pi(m,y),Hl(!1),Qs=!0,pn=!0,Bl()}function pi(m,y){n.width=oe=Ce=m,n.height=Le=he=y,Be=G=0,mi(),Dl();let T=n.bbox;lt=T.left=wl(Be*yt,.5),St=T.top=wl(G*yt,.5),tt=T.width=wl(Ce*yt,.5),jt=T.height=wl(he*yt,.5)}const Ea=3;function dl(){let m=!1,y=0;for(;!m;){y++;let T=_p(y),M=yp(y);m=y==Ea||T&&M,m||(pi(n.width,n.height),pn=!0)}}function Pa({width:m,height:y}){Gn(m,y)}n.setSize=Pa;function mi(){let m=!1,y=!1,T=!1,M=!1;K.forEach((W,Q)=>{if(W.show&&W._show){let{side:ye,_size:Se}=W,Ee=ye%2,Ie=W.label!=null?W.labelSize:0,Fe=Se+Ie;Fe>0&&(Ee?(Ce-=Fe,ye==3?(Be+=Fe,M=!0):T=!0):(he-=Fe,ye==0?(G+=Fe,m=!0):y=!0))}}),Xs[0]=m,Xs[1]=T,Xs[2]=y,Xs[3]=M,Ce-=Bs[1]+Bs[3],Be+=Bs[3],he-=Bs[2]+Bs[0],G+=Bs[0]}function Dl(){let m=Be+Ce,y=G+he,T=Be,M=G;function W(Q,ye){switch(Q){case 1:return m+=ye,m-ye;case 2:return y+=ye,y-ye;case 3:return T-=ye,T+ye;case 0:return M-=ye,M+ye}}K.forEach((Q,ye)=>{if(Q.show&&Q._show){let Se=Q.side;Q._pos=W(Se,Q._size),Q.label!=null&&(Q._lpos=W(Se,Q.labelSize))}})}if(F.dataIdx==null){let m=F.hover,y=m.skip=new Set(m.skip??[]);y.add(void 0);let T=m.prox=dt(m.prox),M=m.bias??(m.bias=0);F.dataIdx=(W,Q,ye,Se)=>{if(Q==0)return ye;let Ee=ye,Ie=T(W,Q,ye,Se)??At,Fe=Ie>=0&&Ie<At,ze=E.ori==0?Ce:he,Xe=F.left,_t=t[0],bt=t[Q];if(y.has(bt[ye])){Ee=null;let rt=null,Ze=null,Ke;if(M==0||M==-1)for(Ke=ye;rt==null&&Ke-- >0;)y.has(bt[Ke])||(rt=Ke);if(M==0||M==1)for(Ke=ye;Ze==null&&Ke++<bt.length;)y.has(bt[Ke])||(Ze=Ke);if(rt!=null||Ze!=null)if(Fe){let Mt=rt==null?-1/0:de(_t[rt],E,ze,0),Ut=Ze==null?1/0:de(_t[Ze],E,ze,0),os=Xe-Mt,xt=Ut-Xe;os<=xt?os<=Ie&&(Ee=rt):xt<=Ie&&(Ee=Ze)}else Ee=Ze==null?rt:rt==null?Ze:ye-rt<=Ze-ye?rt:Ze}else Fe&&Qt(Xe-de(_t[ye],E,ze,0))>Ie&&(Ee=null);return Ee}}const En=m=>{F.event=m};F.idxs=S,F._lock=!1;let Yt=F.points;Yt.show=dt(Yt.show),Yt.size=dt(Yt.size),Yt.stroke=dt(Yt.stroke),Yt.width=dt(Yt.width),Yt.fill=dt(Yt.fill);const mt=n.focus=Jt({},e.focus||{alpha:.3},F.focus),Pn=mt.prox>=0,ds=Pn&&Yt.one;let Ts=[],qn=[],Jn=[];function Ll(m,y){let T=Yt.show(n,y);if(T instanceof HTMLElement)return Rs(T,Fg),Rs(T,m.class),yn(T,-10,-10,Ce,he),L.insertBefore(T,Ts[y]),T}function vi(m,y){if(l==1||y>0){let T=l==1&&N[m.scale].time,M=m.value;m.value=T?Vc(M)?Hc(g,zc(M,ee)):M||ie:M||ty,m.label=m.label||(T?G_:K_)}if(ds||y>0){m.width=m.width==null?1:m.width,m.paths=m.paths||vy||o_,m.fillTo=dt(m.fillTo||iy),m.pxAlign=+gt(m.pxAlign,V),m.pxRound=Qc(m.pxAlign),m.stroke=dt(m.stroke||null),m.fill=dt(m.fill||null),m._stroke=m._fill=m._paths=m._focus=null;let T=sy(Ss(1,m.width),1),M=m.points=Jt({},{size:T,width:Ss(1,T*.2),stroke:m.stroke,space:T*2,paths:hy,_stroke:null,_fill:null},m.points);M.show=dt(M.show),M.filter=dt(M.filter),M.fill=dt(M.fill),M.stroke=dt(M.stroke),M.paths=dt(M.paths),M.pxAlign=m.pxAlign}if(x){let T=Te(m,y);Je.splice(y,0,T[0]),A.splice(y,0,T[1]),C.values.push(null)}if(O){S.splice(y,0,null);let T=null;ds?y==0&&(T=Ll(m,y)):y>0&&(T=Ll(m,y)),Ts.splice(y,0,T),qn.splice(y,0,0),Jn.splice(y,0,0)}ls("addSeries",y)}function Il(m,y){y=y??z.length,m=l==1?Mr(m,y,Wc,Yc):Mr(m,y,{},Jc),z.splice(y,0,m),vi(z[y],y)}n.addSeries=Il;function hi(m){if(z.splice(m,1),x){C.values.splice(m,1),A.splice(m,1);let y=Je.splice(m,1)[0];De(null,y.firstChild),y.remove()}O&&(S.splice(m,1),Ts.splice(m,1)[0].remove(),qn.splice(m,1),Jn.splice(m,1)),ls("delSeries",m)}n.delSeries=hi;const Xs=[!1,!1,!1,!1];function Ma(m,y){if(m._show=m.show,m.show){let T=m.side%2,M=N[m.scale];M==null&&(m.scale=T?z[1].scale:H,M=N[m.scale]);let W=M.time;m.size=dt(m.size),m.space=dt(m.space),m.rotate=dt(m.rotate),tl(m.incrs)&&m.incrs.forEach(ye=>{!al.has(ye)&&al.set(ye,Rf(ye))}),m.incrs=dt(m.incrs||(M.distr==2?A_:W?q==1?O_:M_:$l)),m.splits=dt(m.splits||(W&&M.distr==1?Oe:M.distr==3?Tr:M.distr==4?Y_:J_)),m.stroke=dt(m.stroke),m.grid.stroke=dt(m.grid.stroke),m.ticks.stroke=dt(m.ticks.stroke),m.border.stroke=dt(m.border.stroke);let Q=m.values;m.values=tl(Q)&&!tl(Q[0])?dt(Q):W?tl(Q)?Fc(g,Uc(Q,ee)):Vc(Q)?R_(g,Q):Q||je:Q||q_,m.filter=dt(m.filter||(M.distr>=3&&M.log==10?X_:M.distr==3&&M.log==2?ey:Nf)),m.font=sd(m.font),m.labelFont=sd(m.labelFont),m._size=m.size(n,null,y,0),m._space=m._rotate=m._incrs=m._found=m._splits=m._values=null,m._size>0&&(Xs[y]=!0,m._el=Gs(Dg,k))}}function fl(m,y,T,M){let[W,Q,ye,Se]=T,Ee=y%2,Ie=0;return Ee==0&&(Se||Q)&&(Ie=y==0&&!W||y==2&&!ye?Zt(Bc.size/3):0),Ee==1&&(W||ye)&&(Ie=y==1&&!Q||y==3&&!Se?Zt(Gc.size/2):0),Ie}const bi=n.padding=(e.padding||[fl,fl,fl,fl]).map(m=>dt(gt(m,fl))),Bs=n._padding=bi.map((m,y)=>m(n,y,Xs,0));let Kt,Rt=null,Ht=null;const Ul=l==1?z[0].idxs:null;let Os=null,pl=!1;function ho(m,y){if(t=m??[],n.data=n._data=t,l==2){Kt=0;for(let T=1;T<z.length;T++)Kt+=t[T][0].length}else{t.length==0&&(n.data=n._data=t=[[]]),Os=t[0],Kt=Os.length;let T=t;if(U==2){T=t.slice();let M=T[0]=Array(Kt);for(let W=0;W<Kt;W++)M[W]=W}n._data=t=T}if(Hl(!0),ls("setData"),U==2&&(Qs=!0),y!==!1){let T=E;T.auto(n,pl)?Fl():Zn(H,T.min,T.max),Hs=Hs||F.left>=0,gs=!0,Bl()}}n.setData=ho;function Fl(){pl=!0;let m,y;l==1&&(Kt>0?(Rt=Ul[0]=0,Ht=Ul[1]=Kt-1,m=t[0][Rt],y=t[0][Ht],U==2?(m=Rt,y=Ht):m==y&&(U==3?[m,y]=wa(m,m,E.log,!1):U==4?[m,y]=lu(m,m,E.log,!1):E.time?y=m+Zt(86400/q):[m,y]=na(m,y,ou,!0))):(Rt=Ul[0]=m=null,Ht=Ul[1]=y=null)),Zn(H,m,y)}let ml,Mn,zl,P,w,ne,ke,Pe,Me,We;function ot(m,y,T,M,W,Q){m??(m=_c),T??(T=au),M??(M="butt"),W??(W=_c),Q??(Q="round"),m!=ml&&(_.strokeStyle=ml=m),W!=Mn&&(_.fillStyle=Mn=W),y!=zl&&(_.lineWidth=zl=y),Q!=w&&(_.lineJoin=w=Q),M!=ne&&(_.lineCap=ne=M),T!=P&&_.setLineDash(P=T)}function at(m,y,T,M){y!=Mn&&(_.fillStyle=Mn=y),m!=ke&&(_.font=ke=m),T!=Pe&&(_.textAlign=Pe=T),M!=Me&&(_.textBaseline=Me=M)}function Ye(m,y,T,M,W=0){if(M.length>0&&m.auto(n,pl)&&(y==null||y.min==null)){let Q=gt(Rt,0),ye=gt(Ht,M.length-1),Se=T.min==null?Xg(M,Q,ye,W,m.distr==3):[T.min,T.max];m.min=on(m.min,T.min=Se[0]),m.max=Ss(m.max,T.max=Se[1])}}const ct={min:null,max:null};function rs(){for(let M in N){let W=N[M];I[M]==null&&(W.min==null||I[H]!=null&&W.auto(n,pl))&&(I[M]=ct)}for(let M in N){let W=N[M];I[M]==null&&W.from!=null&&I[W.from]!=null&&(I[M]=ct)}I[H]!=null&&Hl(!0);let m={};for(let M in I){let W=I[M];if(W!=null){let Q=m[M]=uo(N[M],r_);if(W.min!=null)Jt(Q,W);else if(M!=H||l==2)if(Kt==0&&Q.from==null){let ye=Q.range(n,null,null,M);Q.min=ye[0],Q.max=ye[1]}else Q.min=At,Q.max=-At}}if(Kt>0){z.forEach((M,W)=>{if(l==1){let Q=M.scale,ye=I[Q];if(ye==null)return;let Se=m[Q];if(W==0){let Ee=Se.range(n,Se.min,Se.max,Q);Se.min=Ee[0],Se.max=Ee[1],Rt=ln(Se.min,t[0]),Ht=ln(Se.max,t[0]),Ht-Rt>1&&(t[0][Rt]<Se.min&&Rt++,t[0][Ht]>Se.max&&Ht--),M.min=Os[Rt],M.max=Os[Ht]}else M.show&&M.auto&&Ye(Se,ye,M,t[W],M.sorted);M.idxs[0]=Rt,M.idxs[1]=Ht}else if(W>0&&M.show&&M.auto){let[Q,ye]=M.facets,Se=Q.scale,Ee=ye.scale,[Ie,Fe]=t[W],ze=m[Se],Xe=m[Ee];ze!=null&&Ye(ze,I[Se],Q,Ie,Q.sorted),Xe!=null&&Ye(Xe,I[Ee],ye,Fe,ye.sorted),M.min=ye.min,M.max=ye.max}});for(let M in m){let W=m[M],Q=I[M];if(W.from==null&&(Q==null||Q.min==null)){let ye=W.range(n,W.min==At?null:W.min,W.max==-At?null:W.max,M);W.min=ye[0],W.max=ye[1]}}}for(let M in m){let W=m[M];if(W.from!=null){let Q=m[W.from];if(Q.min==null)W.min=W.max=null;else{let ye=W.range(n,Q.min,Q.max,M);W.min=ye[0],W.max=ye[1]}}}let y={},T=!1;for(let M in m){let W=m[M],Q=N[M];if(Q.min!=W.min||Q.max!=W.max){Q.min=W.min,Q.max=W.max;let ye=Q.distr;Q._min=ye==3?zn(Q.min):ye==4?or(Q.min,Q.asinh):ye==100?Q.fwd(Q.min):Q.min,Q._max=ye==3?zn(Q.max):ye==4?or(Q.max,Q.asinh):ye==100?Q.fwd(Q.max):Q.max,y[M]=T=!0}}if(T){z.forEach((M,W)=>{l==2?W>0&&y.y&&(M._paths=null):y[M.scale]&&(M._paths=null)});for(let M in y)Qs=!0,ls("setScale",M);O&&F.left>=0&&(Hs=gs=!0)}for(let M in I)I[M]=null}function te(m){let y=Ar(Rt-1,0,Kt-1),T=Ar(Ht+1,0,Kt-1);for(;m[y]==null&&y>0;)y--;for(;m[T]==null&&T<Kt-1;)T++;return[y,T]}function Qe(){if(Kt>0){let m=z.some(y=>y._focus)&&We!=mt.alpha;m&&(_.globalAlpha=We=mt.alpha),z.forEach((y,T)=>{if(T>0&&y.show&&(nt(T,!1),nt(T,!0),y._paths==null)){let M=We;We!=y.alpha&&(_.globalAlpha=We=y.alpha);let W=l==2?[0,t[T][0].length-1]:te(t[T]);y._paths=y.paths(n,T,W[0],W[1]),We!=M&&(_.globalAlpha=We=M)}}),z.forEach((y,T)=>{if(T>0&&y.show){let M=We;We!=y.alpha&&(_.globalAlpha=We=y.alpha),y._paths!=null&&Gt(T,!1);{let W=y._paths!=null?y._paths.gaps:null,Q=y.points.show(n,T,Rt,Ht,W),ye=y.points.filter(n,T,Q,W);(Q||ye)&&(y.points._paths=y.points.paths(n,T,Rt,Ht,ye),Gt(T,!0))}We!=M&&(_.globalAlpha=We=M),ls("drawSeries",T)}}),m&&(_.globalAlpha=We=1)}}function nt(m,y){let T=y?z[m].points:z[m];T._stroke=T.stroke(n,m),T._fill=T.fill(n,m)}function Gt(m,y){let T=y?z[m].points:z[m],{stroke:M,fill:W,clip:Q,flags:ye,_stroke:Se=T._stroke,_fill:Ee=T._fill,_width:Ie=T.width}=T._paths;Ie=Tt(Ie*yt,3);let Fe=null,ze=Ie%2/2;y&&Ee==null&&(Ee=Ie>0?"#fff":Se);let Xe=T.pxAlign==1&&ze>0;if(Xe&&_.translate(ze,ze),!y){let _t=lt-Ie/2,bt=St-Ie/2,rt=tt+Ie,Ze=jt+Ie;Fe=new Path2D,Fe.rect(_t,bt,rt,Ze)}y?bo(Se,Ie,T.dash,T.cap,Ee,M,W,ye,Q):vl(m,Se,Ie,T.dash,T.cap,Ee,M,W,ye,Fe,Q),Xe&&_.translate(-ze,-ze)}function vl(m,y,T,M,W,Q,ye,Se,Ee,Ie,Fe){let ze=!1;Ee!=0&&B.forEach((Xe,_t)=>{if(Xe.series[0]==m){let bt=z[Xe.series[1]],rt=t[Xe.series[1]],Ze=(bt._paths||Wo).band;tl(Ze)&&(Ze=Xe.dir==1?Ze[0]:Ze[1]);let Ke,Mt=null;bt.show&&Ze&&t_(rt,Rt,Ht)?(Mt=Xe.fill(n,_t)||Q,Ke=bt._paths.clip):Ze=null,bo(y,T,M,W,Mt,ye,Se,Ee,Ie,Fe,Ke,Ze),ze=!0}}),ze||bo(y,T,M,W,Q,ye,Se,Ee,Ie,Fe)}const mn=co|Er;function bo(m,y,T,M,W,Q,ye,Se,Ee,Ie,Fe,ze){ot(m,y,T,M,W),(Ee||Ie||ze)&&(_.save(),Ee&&_.clip(Ee),Ie&&_.clip(Ie)),ze?(Se&mn)==mn?(_.clip(ze),Fe&&_.clip(Fe),_i(W,ye),gi(m,Q,y)):Se&Er?(_i(W,ye),_.clip(ze),gi(m,Q,y)):Se&co&&(_.save(),_.clip(ze),Fe&&_.clip(Fe),_i(W,ye),_.restore(),gi(m,Q,y)):(_i(W,ye),gi(m,Q,y)),(Ee||Ie||ze)&&_.restore()}function gi(m,y,T){T>0&&(y instanceof Map?y.forEach((M,W)=>{_.strokeStyle=ml=W,_.stroke(M)}):y!=null&&m&&_.stroke(y))}function _i(m,y){y instanceof Map?y.forEach((T,M)=>{_.fillStyle=Mn=M,_.fill(T)}):y!=null&&m&&_.fill(y)}function gp(m,y,T,M){let W=K[m],Q;if(M<=0)Q=[0,0];else{let ye=W._space=W.space(n,m,y,T,M),Se=W._incrs=W.incrs(n,m,y,T,M,ye);Q=wy(y,T,Se,M,ye)}return W._found=Q}function Na(m,y,T,M,W,Q,ye,Se,Ee,Ie){let Fe=ye%2/2;V==1&&_.translate(Fe,Fe),ot(Se,ye,Ee,Ie,Se),_.beginPath();let ze,Xe,_t,bt,rt=W+(M==0||M==3?-Q:Q);T==0?(Xe=W,bt=rt):(ze=W,_t=rt);for(let Ze=0;Ze<m.length;Ze++)y[Ze]!=null&&(T==0?ze=_t=m[Ze]:Xe=bt=m[Ze],_.moveTo(ze,Xe),_.lineTo(_t,bt));_.stroke(),V==1&&_.translate(-Fe,-Fe)}function _p(m){let y=!0;return K.forEach((T,M)=>{if(!T.show)return;let W=N[T.scale];if(W.min==null){T._show&&(y=!1,T._show=!1,Hl(!1));return}else T._show||(y=!1,T._show=!0,Hl(!1));let Q=T.side,ye=Q%2,{min:Se,max:Ee}=W,[Ie,Fe]=gp(M,Se,Ee,ye==0?Ce:he);if(Fe==0)return;let ze=W.distr==2,Xe=T._splits=T.splits(n,M,Se,Ee,Ie,Fe,ze),_t=W.distr==2?Xe.map(Ke=>Os[Ke]):Xe,bt=W.distr==2?Os[Xe[1]]-Os[Xe[0]]:Ie,rt=T._values=T.values(n,T.filter(n,_t,M,Fe,bt),M,Fe,bt);T._rotate=Q==2?T.rotate(n,rt,M,Fe):0;let Ze=T._size;T._size=qs(T.size(n,rt,M,m)),Ze!=null&&T._size!=Ze&&(y=!1)}),y}function yp(m){let y=!0;return bi.forEach((T,M)=>{let W=T(n,M,Xs,m);W!=Bs[M]&&(y=!1),Bs[M]=W}),y}function kp(){for(let m=0;m<K.length;m++){let y=K[m];if(!y.show||!y._show)continue;let T=y.side,M=T%2,W,Q,ye=y.stroke(n,m),Se=T==0||T==3?-1:1,[Ee,Ie]=y._found;if(y.label!=null){let ys=y.labelGap*Se,js=Zt((y._lpos+ys)*yt);at(y.labelFont[0],ye,"center",T==2?Ao:gc),_.save(),M==1?(W=Q=0,_.translate(js,Zt(St+jt/2)),_.rotate((T==3?-Li:Li)/2)):(W=Zt(lt+tt/2),Q=js);let gl=Pf(y.label)?y.label(n,m,Ee,Ie):y.label;_.fillText(gl,W,Q),_.restore()}if(Ie==0)continue;let Fe=N[y.scale],ze=M==0?tt:jt,Xe=M==0?lt:St,_t=y._splits,bt=Fe.distr==2?_t.map(ys=>Os[ys]):_t,rt=Fe.distr==2?Os[_t[1]]-Os[_t[0]]:Ee,Ze=y.ticks,Ke=y.border,Mt=Ze.show?Ze.size:0,Ut=Zt(Mt*yt),os=Zt((y.alignTo==2?y._size-Mt-y.gap:y.gap)*yt),xt=y._rotate*-Li/180,Ft=j(y._pos*yt),Ms=(Ut+os)*Se,_s=Ft+Ms;Q=M==0?_s:0,W=M==1?_s:0;let Ws=y.font[0],en=y.align==1?Xl:y.align==2?sr:xt>0?Xl:xt<0?sr:M==0?"center":T==3?sr:Xl,bn=xt||M==1?"middle":T==2?Ao:gc;at(Ws,ye,en,bn);let Ns=y.font[1]*y.lineGap,Ks=_t.map(ys=>j(u(ys,Fe,ze,Xe))),tn=y._values;for(let ys=0;ys<tn.length;ys++){let js=tn[ys];if(js!=null){M==0?W=Ks[ys]:Q=Ks[ys],js=""+js;let gl=js.indexOf(`
130
+ `)==-1?[js]:js.split(/\n/gm);for(let ks=0;ks<gl.length;ks++){let Nu=gl[ks];xt?(_.save(),_.translate(W,Q+ks*Ns),_.rotate(xt),_.fillText(Nu,0,0),_.restore()):_.fillText(Nu,W,Q+ks*Ns)}}}Ze.show&&Na(Ks,Ze.filter(n,bt,m,Ie,rt),M,T,Ft,Ut,Tt(Ze.width*yt,3),Ze.stroke(n,m),Ze.dash,Ze.cap);let gn=y.grid;gn.show&&Na(Ks,gn.filter(n,bt,m,Ie,rt),M,M==0?2:1,M==0?St:lt,M==0?jt:tt,Tt(gn.width*yt,3),gn.stroke(n,m),gn.dash,gn.cap),Ke.show&&Na([Ft],[1],M==0?1:0,M==0?1:2,M==1?St:lt,M==1?jt:tt,Tt(Ke.width*yt,3),Ke.stroke(n,m),Ke.dash,Ke.cap)}ls("drawAxes")}function Hl(m){z.forEach((y,T)=>{T>0&&(y._paths=null,m&&(l==1?(y.min=null,y.max=null):y.facets.forEach(M=>{M.min=null,M.max=null})))})}let yi=!1,ja=!1,go=[];function wp(){ja=!1;for(let m=0;m<go.length;m++)ls(...go[m]);go.length=0}function Bl(){yi||(v_(vu),yi=!0)}function $p(m,y=!1){yi=!0,ja=y,m(n),vu(),y&&go.length>0&&queueMicrotask(wp)}n.batch=$p;function vu(){if(Kn&&(rs(),Kn=!1),Qs&&(dl(),Qs=!1),pn){if(Nt($,Xl,Be),Nt($,Ao,G),Nt($,Mo,Ce),Nt($,No,he),Nt(L,Xl,Be),Nt(L,Ao,G),Nt(L,Mo,Ce),Nt(L,No,he),Nt(k,Mo,oe),Nt(k,No,Le),b.width=Zt(oe*yt),b.height=Zt(Le*yt),K.forEach(({_el:m,_show:y,_size:T,_pos:M,side:W})=>{if(m!=null)if(y){let Q=W===3||W===0?T:0,ye=W%2==1;Nt(m,ye?"left":"top",M-Q),Nt(m,ye?"width":"height",T),Nt(m,ye?"top":"left",ye?G:Be),Nt(m,ye?"height":"width",ye?he:Ce),Sr(m,xl)}else Rs(m,xl)}),ml=Mn=zl=w=ne=ke=Pe=Me=P=null,We=1,ko(!0),Be!=X||G!=ue||Ce!=qe||he!=pt){Hl(!1);let m=Ce/qe,y=he/pt;if(O&&!Hs&&F.left>=0){F.left*=m,F.top*=y,Wl&&yn(Wl,Zt(F.left),0,Ce,he),Kl&&yn(Kl,0,Zt(F.top),Ce,he);for(let T=0;T<Ts.length;T++){let M=Ts[T];M!=null&&(qn[T]*=m,Jn[T]*=y,yn(M,qs(qn[T]),qs(Jn[T]),Ce,he))}}if(Pt.show&&!As&&Pt.left>=0&&Pt.width>0){Pt.left*=m,Pt.width*=m,Pt.top*=y,Pt.height*=y;for(let T in Ua)Nt(Jl,T,Pt[T])}X=Be,ue=G,qe=Ce,pt=he}ls("setSize"),pn=!1}oe>0&&Le>0&&(_.clearRect(0,0,b.width,b.height),ls("drawClear"),fe.forEach(m=>m()),ls("draw")),Pt.show&&As&&(ki(Pt),As=!1),O&&Hs&&(bl(null,!0,!1),Hs=!1),C.show&&C.live&&gs&&(La(),gs=!1),i||(i=!0,n.status=1,ls("ready")),pl=!1,yi=!1}n.redraw=(m,y)=>{Qs=y||!1,m!==!1?Zn(H,E.min,E.max):Bl()};function Ra(m,y){let T=N[m];if(T.from==null){if(Kt==0){let M=T.range(n,y.min,y.max,m);y.min=M[0],y.max=M[1]}if(y.min>y.max){let M=y.min;y.min=y.max,y.max=M}if(Kt>1&&y.min!=null&&y.max!=null&&y.max-y.min<1e-16)return;m==H&&T.distr==2&&Kt>0&&(y.min=ln(y.min,t[0]),y.max=ln(y.max,t[0]),y.min==y.max&&y.max++),I[m]=y,Kn=!0,Bl()}}n.setScale=Ra;let Va,Da,Wl,Kl,hu,bu,Gl,ql,gu,_u,Et,Vt,Yn=!1;const us=F.drag;let ss=us.x,ns=us.y;O&&(F.x&&(Va=Gs(Ig,L)),F.y&&(Da=Gs(Ug,L)),E.ori==0?(Wl=Va,Kl=Da):(Wl=Da,Kl=Va),Et=F.left,Vt=F.top);const Pt=n.select=Jt({show:!0,over:!0,left:0,width:0,top:0,height:0},e.select),Jl=Pt.show?Gs(Lg,Pt.over?L:$):null;function ki(m,y){if(Pt.show){for(let T in m)Pt[T]=m[T],T in Ua&&Nt(Jl,T,m[T]);y!==!1&&ls("setSelect")}}n.setSelect=ki;function xp(m){if(z[m].show)x&&Sr(Je[m],xl);else if(x&&Rs(Je[m],xl),O){let T=ds?Ts[0]:Ts[m];T!=null&&yn(T,-10,-10,Ce,he)}}function Zn(m,y,T){Ra(m,{min:y,max:T})}function vn(m,y,T,M){y.focus!=null&&Op(m),y.show!=null&&z.forEach((W,Q)=>{Q>0&&(m==Q||m==null)&&(W.show=y.show,xp(Q),l==2?(Zn(W.facets[0].scale,null,null),Zn(W.facets[1].scale,null,null)):Zn(W.scale,null,null),Bl())}),T!==!1&&ls("setSeries",m,y),M&&wo("setSeries",n,m,y)}n.setSeries=vn;function Sp(m,y){Jt(B[m],y)}function Cp(m,y){m.fill=dt(m.fill||null),m.dir=gt(m.dir,-1),y=y??B.length,B.splice(y,0,m)}function Ap(m){m==null?B.length=0:B.splice(m,1)}n.addBand=Cp,n.setBand=Sp,n.delBand=Ap;function Tp(m,y){z[m].alpha=y,O&&Ts[m]!=null&&(Ts[m].style.opacity=y),x&&Je[m]&&(Je[m].style.opacity=y)}let Nn,Qn,hl;const Yl={focus:!0};function Op(m){if(m!=hl){let y=m==null,T=mt.alpha!=1;z.forEach((M,W)=>{if(l==1||W>0){let Q=y||W==0||W==m;M._focus=y?null:Q,T&&Tp(W,Q?1:mt.alpha)}}),hl=m,T&&Bl()}}x&&Pn&&ae(wc,se,m=>{F._lock||(En(m),hl!=null&&vn(null,Yl,!0,qt.setSeries))});function hn(m,y,T){let M=N[y];T&&(m=m/yt-(M.ori==1?G:Be));let W=Ce;M.ori==1&&(W=he,m=W-m),M.dir==-1&&(m=W-m);let Q=M._min,ye=M._max,Se=m/W,Ee=Q+(ye-Q)*Se,Ie=M.distr;return Ie==3?ao(10,Ee):Ie==4?n_(Ee,M.asinh):Ie==100?M.bwd(Ee):Ee}function Ep(m,y){let T=hn(m,H,y);return ln(T,t[0],Rt,Ht)}n.valToIdx=m=>ln(m,t[0]),n.posToIdx=Ep,n.posToVal=hn,n.valToPos=(m,y,T)=>N[y].ori==0?a(m,N[y],T?tt:Ce,T?lt:0):c(m,N[y],T?jt:he,T?St:0),n.setCursor=(m,y,T)=>{Et=m.left,Vt=m.top,bl(null,y,T)};function yu(m,y){Nt(Jl,Xl,Pt.left=m),Nt(Jl,Mo,Pt.width=y)}function ku(m,y){Nt(Jl,Ao,Pt.top=m),Nt(Jl,No,Pt.height=y)}let _o=E.ori==0?yu:ku,yo=E.ori==1?yu:ku;function Pp(){if(x&&C.live)for(let m=l==2?1:0;m<z.length;m++){if(m==0&&J)continue;let y=C.values[m],T=0;for(let M in y)A[m][T++].firstChild.nodeValue=y[M]}}function La(m,y){if(m!=null&&(m.idxs?m.idxs.forEach((T,M)=>{S[M]=T}):a_(m.idx)||S.fill(m.idx),C.idx=S[0]),x&&C.live){for(let T=0;T<z.length;T++)(T>0||l==1&&!J)&&Mp(T,S[T]);Pp()}gs=!1,y!==!1&&ls("setLegend")}n.setLegend=La;function Mp(m,y){let T=z[m],M=m==0&&U==2?Os:t[m],W;J?W=T.values(n,m,y)??pe:(W=T.value(n,y==null?null:M[y],m,y),W=W==null?pe:{_:W}),C.values[m]=W}function bl(m,y,T){gu=Et,_u=Vt,[Et,Vt]=F.move(n,Et,Vt),F.left=Et,F.top=Vt,O&&(Wl&&yn(Wl,Zt(Et),0,Ce,he),Kl&&yn(Kl,0,Zt(Vt),Ce,he));let M,W=Rt>Ht;Nn=At,Qn=null;let Q=E.ori==0?Ce:he,ye=E.ori==1?Ce:he;if(Et<0||Kt==0||W){M=F.idx=null;for(let Se=0;Se<z.length;Se++){let Ee=Ts[Se];Ee!=null&&yn(Ee,-10,-10,Ce,he)}Pn&&vn(null,Yl,!0,m==null&&qt.setSeries),C.live&&(S.fill(M),gs=!0)}else{let Se,Ee,Ie;l==1&&(Se=E.ori==0?Et:Vt,Ee=hn(Se,H),M=F.idx=ln(Ee,t[0],Rt,Ht),Ie=de(t[0][M],E,Q,0));let Fe=-10,ze=-10,Xe=0,_t=0,bt=!0,rt="",Ze="";for(let Ke=l==2?1:0;Ke<z.length;Ke++){let Mt=z[Ke],Ut=S[Ke],os=Ut==null?null:l==1?t[Ke][Ut]:t[Ke][1][Ut],xt=F.dataIdx(n,Ke,M,Ee),Ft=xt==null?null:l==1?t[Ke][xt]:t[Ke][1][xt];if(gs=gs||Ft!=os||xt!=Ut,S[Ke]=xt,Ke>0&&Mt.show){let Ms=xt==null?-10:xt==M?Ie:de(l==1?t[0][xt]:t[Ke][0][xt],E,Q,0),_s=Ft==null?-10:$e(Ft,l==1?N[Mt.scale]:N[Mt.facets[1].scale],ye,0);if(Pn&&Ft!=null){let Ws=E.ori==1?Et:Vt,en=Qt(mt.dist(n,Ke,xt,_s,Ws));if(en<Nn){let bn=mt.bias;if(bn!=0){let Ns=hn(Ws,Mt.scale),Ks=Ft>=0?1:-1,tn=Ns>=0?1:-1;tn==Ks&&(tn==1?bn==1?Ft>=Ns:Ft<=Ns:bn==1?Ft<=Ns:Ft>=Ns)&&(Nn=en,Qn=Ke)}else Nn=en,Qn=Ke}}if(gs||ds){let Ws,en;E.ori==0?(Ws=Ms,en=_s):(Ws=_s,en=Ms);let bn,Ns,Ks,tn,gn,ys,js=!0,gl=Yt.bbox;if(gl!=null){js=!1;let ks=gl(n,Ke);Ks=ks.left,tn=ks.top,bn=ks.width,Ns=ks.height}else Ks=Ws,tn=en,bn=Ns=Yt.size(n,Ke);if(ys=Yt.fill(n,Ke),gn=Yt.stroke(n,Ke),ds)Ke==Qn&&Nn<=mt.prox&&(Fe=Ks,ze=tn,Xe=bn,_t=Ns,bt=js,rt=ys,Ze=gn);else{let ks=Ts[Ke];ks!=null&&(qn[Ke]=Ks,Jn[Ke]=tn,Oc(ks,bn,Ns,js),Ac(ks,ys,gn),yn(ks,qs(Ks),qs(tn),Ce,he))}}}}if(ds){let Ke=mt.prox,Mt=hl==null?Nn<=Ke:Nn>Ke||Qn!=hl;if(gs||Mt){let Ut=Ts[0];Ut!=null&&(qn[0]=Fe,Jn[0]=ze,Oc(Ut,Xe,_t,bt),Ac(Ut,rt,Ze),yn(Ut,qs(Fe),qs(ze),Ce,he))}}}if(Pt.show&&Yn)if(m!=null){let[Se,Ee]=qt.scales,[Ie,Fe]=qt.match,[ze,Xe]=m.cursor.sync.scales,_t=m.cursor.drag;if(ss=_t._x,ns=_t._y,ss||ns){let{left:bt,top:rt,width:Ze,height:Ke}=m.select,Mt=m.scales[ze].ori,Ut=m.posToVal,os,xt,Ft,Ms,_s,Ws=Se!=null&&Ie(Se,ze),en=Ee!=null&&Fe(Ee,Xe);Ws&&ss?(Mt==0?(os=bt,xt=Ze):(os=rt,xt=Ke),Ft=N[Se],Ms=de(Ut(os,ze),Ft,Q,0),_s=de(Ut(os+xt,ze),Ft,Q,0),_o(on(Ms,_s),Qt(_s-Ms))):_o(0,Q),en&&ns?(Mt==1?(os=bt,xt=Ze):(os=rt,xt=Ke),Ft=N[Ee],Ms=$e(Ut(os,Xe),Ft,ye,0),_s=$e(Ut(os+xt,Xe),Ft,ye,0),yo(on(Ms,_s),Qt(_s-Ms))):yo(0,ye)}else Fa()}else{let Se=Qt(gu-hu),Ee=Qt(_u-bu);if(E.ori==1){let Xe=Se;Se=Ee,Ee=Xe}ss=us.x&&Se>=us.dist,ns=us.y&&Ee>=us.dist;let Ie=us.uni;Ie!=null?ss&&ns&&(ss=Se>=Ie,ns=Ee>=Ie,!ss&&!ns&&(Ee>Se?ns=!0:ss=!0)):us.x&&us.y&&(ss||ns)&&(ss=ns=!0);let Fe,ze;ss&&(E.ori==0?(Fe=Gl,ze=Et):(Fe=ql,ze=Vt),_o(on(Fe,ze),Qt(ze-Fe)),ns||yo(0,ye)),ns&&(E.ori==1?(Fe=Gl,ze=Et):(Fe=ql,ze=Vt),yo(on(Fe,ze),Qt(ze-Fe)),ss||_o(0,Q)),!ss&&!ns&&(_o(0,0),yo(0,0))}if(us._x=ss,us._y=ns,m==null){if(T){if(Mu!=null){let[Se,Ee]=qt.scales;qt.values[0]=Se!=null?hn(E.ori==0?Et:Vt,Se):null,qt.values[1]=Ee!=null?hn(E.ori==1?Et:Vt,Ee):null}wo(nr,n,Et,Vt,Ce,he,M)}if(Pn){let Se=T&&qt.setSeries,Ee=mt.prox;hl==null?Nn<=Ee&&vn(Qn,Yl,!0,Se):Nn>Ee?vn(null,Yl,!0,Se):Qn!=hl&&vn(Qn,Yl,!0,Se)}}gs&&(C.idx=M,La()),y!==!1&&ls("setCursor")}let Xn=null;Object.defineProperty(n,"rect",{get(){return Xn==null&&ko(!1),Xn}});function ko(m=!1){m?Xn=null:(Xn=L.getBoundingClientRect(),ls("syncRect",Xn))}function wu(m,y,T,M,W,Q,ye){F._lock||Yn&&m!=null&&m.movementX==0&&m.movementY==0||(Ia(m,y,T,M,W,Q,ye,!1,m!=null),m!=null?bl(null,!0,!0):bl(y,!0,!1))}function Ia(m,y,T,M,W,Q,ye,Se,Ee){if(Xn==null&&ko(!1),En(m),m!=null)T=m.clientX-Xn.left,M=m.clientY-Xn.top;else{if(T<0||M<0){Et=-10,Vt=-10;return}let[Ie,Fe]=qt.scales,ze=y.cursor.sync,[Xe,_t]=ze.values,[bt,rt]=ze.scales,[Ze,Ke]=qt.match,Mt=y.axes[0].side%2==1,Ut=E.ori==0?Ce:he,os=E.ori==1?Ce:he,xt=Mt?Q:W,Ft=Mt?W:Q,Ms=Mt?M:T,_s=Mt?T:M;if(bt!=null?T=Ze(Ie,bt)?u(Xe,N[Ie],Ut,0):-10:T=Ut*(Ms/xt),rt!=null?M=Ke(Fe,rt)?u(_t,N[Fe],os,0):-10:M=os*(_s/Ft),E.ori==1){let Ws=T;T=M,M=Ws}}Ee&&(y==null||y.cursor.event.type==nr)&&((T<=1||T>=Ce-1)&&(T=wl(T,Ce)),(M<=1||M>=he-1)&&(M=wl(M,he))),Se?(hu=T,bu=M,[Gl,ql]=F.move(n,T,M)):(Et=T,Vt=M)}const Ua={width:0,height:0,left:0,top:0};function Fa(){ki(Ua,!1)}let $u,xu,Su,Cu;function Au(m,y,T,M,W,Q,ye){Yn=!0,ss=ns=us._x=us._y=!1,Ia(m,y,T,M,W,Q,ye,!0,!1),m!=null&&(ae(lr,$r,Tu,!1),wo(yc,n,Gl,ql,Ce,he,null));let{left:Se,top:Ee,width:Ie,height:Fe}=Pt;$u=Se,xu=Ee,Su=Ie,Cu=Fe}function Tu(m,y,T,M,W,Q,ye){Yn=us._x=us._y=!1,Ia(m,y,T,M,W,Q,ye,!1,!0);let{left:Se,top:Ee,width:Ie,height:Fe}=Pt,ze=Ie>0||Fe>0,Xe=$u!=Se||xu!=Ee||Su!=Ie||Cu!=Fe;if(ze&&Xe&&ki(Pt),us.setScale&&ze&&Xe){let _t=Se,bt=Ie,rt=Ee,Ze=Fe;if(E.ori==1&&(_t=Ee,bt=Fe,rt=Se,Ze=Ie),ss&&Zn(H,hn(_t,H),hn(_t+bt,H)),ns)for(let Ke in N){let Mt=N[Ke];Ke!=H&&Mt.from==null&&Mt.min!=At&&Zn(Ke,hn(rt+Ze,Ke),hn(rt,Ke))}Fa()}else F.lock&&(F._lock=!F._lock,bl(y,!0,m!=null));m!=null&&(De(lr,$r),wo(lr,n,Et,Vt,Ce,he,null))}function Np(m,y,T,M,W,Q,ye){if(F._lock)return;En(m);let Se=Yn;if(Yn){let Ee=!0,Ie=!0,Fe=10,ze,Xe;E.ori==0?(ze=ss,Xe=ns):(ze=ns,Xe=ss),ze&&Xe&&(Ee=Et<=Fe||Et>=Ce-Fe,Ie=Vt<=Fe||Vt>=he-Fe),ze&&Ee&&(Et=Et<Gl?0:Ce),Xe&&Ie&&(Vt=Vt<ql?0:he),bl(null,!0,!0),Yn=!1}Et=-10,Vt=-10,S.fill(null),bl(null,!0,!0),Se&&(Yn=Se)}function Ou(m,y,T,M,W,Q,ye){F._lock||(En(m),Fl(),Fa(),m!=null&&wo($c,n,Et,Vt,Ce,he,null))}function Eu(){K.forEach($y),Gn(n.width,n.height,!0)}Pl(sa,lo,Eu);const Zl={};Zl.mousedown=Au,Zl.mousemove=wu,Zl.mouseup=Tu,Zl.dblclick=Ou,Zl.setSeries=(m,y,T,M)=>{let W=qt.match[2];T=W(n,y,T),T!=-1&&vn(T,M,!0,!1)},O&&(ae(yc,L,Au),ae(nr,L,wu),ae(kc,L,m=>{En(m),ko(!1)}),ae(wc,L,Np),ae($c,L,Ou),Pr.add(n),n.syncRect=ko);const wi=n.hooks=e.hooks||{};function ls(m,y,T){ja?go.push([m,y,T]):m in wi&&wi[m].forEach(M=>{M.call(null,n,y,T)})}(e.plugins||[]).forEach(m=>{for(let y in m.hooks)wi[y]=(wi[y]||[]).concat(m.hooks[y])});const Pu=(m,y,T)=>T,qt=Jt({key:null,setSeries:!1,filters:{pub:jc,sub:jc},scales:[H,z[1]?z[1].scale:null],match:[Rc,Rc,Pu],values:[null,null]},F.sync);qt.match.length==2&&qt.match.push(Pu),F.sync=qt;const Mu=qt.key,za=tp(Mu);function wo(m,y,T,M,W,Q,ye){qt.filters.pub(m,y,T,M,W,Q,ye)&&za.pub(m,y,T,M,W,Q,ye)}za.sub(n);function jp(m,y,T,M,W,Q,ye){qt.filters.sub(m,y,T,M,W,Q,ye)&&Zl[m](null,y,T,M,W,Q,ye)}n.pub=jp;function Rp(){za.unsub(n),Pr.delete(n),xe.clear(),Cr(sa,lo,Eu),v.remove(),se==null||se.remove(),ls("destroy")}n.destroy=Rp;function Ha(){ls("init",e,t),ho(t||e.data,!1),I[H]?Ra(H,I[H]):Fl(),As=Pt.show&&(Pt.width>0||Pt.height>0),Hs=gs=!0,Gn(e.width,e.height)}return z.forEach(vi),K.forEach(Ma),s?s instanceof HTMLElement?(s.appendChild(v),Ha()):s(n,Ha):Ha(),n}as.assign=Jt;as.fmtNum=iu;as.rangeNum=na;as.rangeLog=wa;as.rangeAsinh=lu;as.orient=Vl;as.pxRatio=yt;as.join=m_;as.fmtDate=ru,as.tzDate=S_;as.sync=tp;{as.addGap=ay,as.clipGaps=Sa;let e=as.paths={points:ap};e.linear=up,e.stepped=cy,e.bars=dy,e.spline=py}const xy={class:"chart-wrap"},Sy={class:"chart-bar"},Cy={key:0,class:"caption"},Ay={key:0,class:"caption status-critical","aria-live":"polite"},Ty={class:"list"},Oy={class:"right"},Ey=Bt({__name:"Chart",props:{series:{},data:{type:Function},tick:{},syncKey:{},height:{},timeLabel:{},timeUnit:{},markers:{type:Function},frozenAt:{}},setup(e){const t=e,s=ge(()=>t.timeUnit??"s"),n=_e(),l=_e(!1);let a=null,c=null;const u=[window.matchMedia("(prefers-color-scheme: dark)"),window.matchMedia("(prefers-contrast: more)")];function i(j){return getComputedStyle(document.documentElement).getPropertyValue(j).trim()}function v(j){var K;const q=j.ctx,z=devicePixelRatio;q.save(),q.font=`${11*z}px ${i("--font")}`;for(let N=0;N<j.data[0].length;N++){let B=j.data.length>1;for(let fe=1;fe<j.data.length;fe++)if(j.data[fe][N]!==null){B=!1;break}if(!B)continue;const H=j.data[0][N],ce=j.valToPos(H,"x",!0);ce<j.bbox.left||ce>j.bbox.left+j.bbox.width||(q.strokeStyle=i("--text-secondary"),q.fillStyle=i("--text-secondary"),q.beginPath(),q.moveTo(ce,j.bbox.top+j.bbox.height-8*z),q.lineTo(ce,j.bbox.top+j.bbox.height),q.stroke(),q.fillText(`缺口 ${H.toFixed(3)} ${s.value}`,ce+3*z,j.bbox.top+j.bbox.height-10*z))}for(const N of((K=t.markers)==null?void 0:K.call(t))??[]){const B=j.valToPos(N.t,"x",!0);B<j.bbox.left||B>j.bbox.left+j.bbox.width||(q.strokeStyle=i("--critical"),q.lineWidth=z,q.beginPath(),q.moveTo(B,j.bbox.top),q.lineTo(B,j.bbox.top+j.bbox.height),q.stroke(),q.fillStyle=i("--critical"),q.fillText(N.label,B+4*z,j.bbox.top+12*z))}t.series.length<=4&&t.series.forEach((N,B)=>{const H=j.data[B+1]??[];let ce=H.length-1;for(;ce>=0&&H[ce]==null;)ce--;ce<0||N.dash||(q.fillStyle=i("--text-secondary"),q.textAlign="right",q.fillText(N.label,j.bbox.left+j.bbox.width-4*z,j.valToPos(H[ce],"y",!0)-4*z))}),q.restore()}function b(){if(a==null||a.destroy(),a=null,!n.value||l.value)return;const j={stroke:i("--chart-axis"),grid:{stroke:i("--chart-grid"),width:1},ticks:{stroke:i("--chart-grid")},font:"11px "+i("--font")},q={width:n.value.clientWidth||600,height:t.height??180,legend:{show:!0,live:!0},cursor:{sync:{key:t.syncKey},drag:{x:!0,y:!1}},scales:{x:{time:!1}},axes:[{...j,label:t.timeLabel??`t / ${s.value}`},{...j,size:60}],hooks:{draw:[v]},series:[{label:"t",value:(z,K)=>K==null?"—":`${K.toFixed(3)} ${s.value}`},...t.series.map(z=>({label:z.label+(z.unit?` / ${z.unit}`:""),stroke:i(`--series-${z.slot}`),width:2,dash:z.dash?[6,4]:void 0,points:{show:!1},value:(K,N)=>N==null?"—":Number(N.toPrecision(6)).toString()}))]};a=new as(q,t.data(),n.value)}function _(){l.value?k.value++:a==null||a.setData(t.data())}const k=_e(0),$=ge(()=>{var N;k.value,t.tick;const j=t.data(),q=((N=j[0])==null?void 0:N.length)??0,z=Math.max(1,Math.ceil(q/200)),K=[];for(let B=0;B<q;B+=z)K.push(j.map(H=>H[B]));return K});function L(j){return j==null?"—":Number(j.toPrecision(6)).toString()}function V(){l.value=!l.value,requestAnimationFrame(b)}return Fs(()=>{b(),c=new ResizeObserver(()=>{a&&n.value&&a.setSize({width:n.value.clientWidth,height:t.height??180})}),c.observe(n.value);for(const j of u)j.addEventListener("change",b)}),cl(()=>{c==null||c.disconnect();for(const j of u)j.removeEventListener("change",b);a==null||a.destroy()}),it(()=>t.tick,_),it(()=>JSON.stringify([t.series,t.timeLabel,t.timeUnit,t.syncKey]),b),(j,q)=>(p(),h("div",xy,[o("div",Sy,[e.frozenAt?(p(),h("span",Cy,"已冻结("+f(new Date(e.frozenAt).toLocaleTimeString())+"),接收不停",1)):R("",!0),q[0]||(q[0]=o("span",{class:"spacer"},null,-1)),o("button",{class:"plain caption",onClick:V},f(l.value?"曲线":"数值表"),1)]),e.markers&&e.markers().length?(p(),h("p",Ay,f(e.markers().map(z=>z.label).join(";")),1)):R("",!0),we(o("div",{ref_key:"host",ref:n,class:"chart"},null,512),[[qr,!l.value]]),l.value?(p(),h("div",{key:1,class:"table-wrap",style:Rl({maxHeight:(e.height??180)+40+"px"})},[o("table",Ty,[o("thead",null,[o("tr",null,[o("th",Oy,"t / "+f(s.value),1),(p(!0),h(le,null,Ue(e.series,z=>(p(),h("th",{key:z.label,class:"right"},f(z.label)+f(z.unit?" / "+z.unit:""),1))),128))])]),o("tbody",null,[(p(!0),h(le,null,Ue($.value,(z,K)=>(p(),h("tr",{key:K},[(p(!0),h(le,null,Ue(z,(N,B)=>(p(),h("td",{key:B,class:"right num"},f(L(N)),1))),128))]))),128))])])],4)):R("",!0)]))}}),rn=Wt(Ey,[["__scopeId","data-v-ed5782ef"]]),Py={class:"card"},My=["disabled"],Ny=["disabled"],jy={key:0,class:"caption"},Ry={class:"row"},Vy={class:"field"},Dy=["value"],Ly={class:"field"},Iy=["value"],Uy={class:"field"},Fy=["max"],zy={class:"caption"},Hy={class:"channels"},By=["value"],Wy={key:0,class:"caption"},Ky={key:2,class:"caption","aria-live":"polite"},Gy=Bt({__name:"FeedbackHistory",setup(e){const t=_e(""),s=_e(5),n=_e(0);it(s,()=>{n.value=Math.min(n.value,60-s.value)});const l=_e(null),a=_e([]),c=_e(""),u=_e(!1),i=ge(()=>r.sampleSources.find(K=>K.id===t.value)),v=K=>({usb_pdo:"USB TxPDO",can_pdo:"CAN 控制应答",can_tpdo:"CAN TPDO 侦听",ecat_pdo:"EtherCAT PDO",usb_sdo:"USB SDO 顺序读取",can_sdo:"CAN SDO 顺序读取",ecat_sdo:"EtherCAT SDO 顺序读取"})[K]??K,b=K=>K==="dc"?"DC 时间":"主机接收时间";it(()=>r.openedAt,()=>{t.value="",l.value=null,c.value=""}),it(()=>r.sampleSources.map(K=>K.id).join(),()=>{var K,N;i.value||(t.value=((K=r.sampleSources.find(B=>!B.source.endsWith("_sdo")))==null?void 0:K.id)??((N=r.sampleSources[0])==null?void 0:N.id)??"")},{immediate:!0}),it(t,()=>{var K;l.value=null,n.value=0,c.value="",a.value=(((K=i.value)==null?void 0:K.objects)??[]).filter(N=>["position_actual_um","velocity_actual_um_s","force_actual_n","motor_speed_rpm"].includes(N))},{immediate:!0}),it(()=>{var K;return(K=i.value)==null?void 0:K.started},()=>{l.value=null,n.value=0});const _=ge(()=>{var K;return((K=l.value)==null?void 0:K.window)??oi.value.get(t.value)}),k=ge(()=>`${t.value}:${l.value?l.value.at:Xr.value}:${n.value}:${s.value}`);function $(){const K=oi.value.get(t.value);l.value=l.value||!K?null:{at:Date.now(),window:K.copy()}}const L=ge(()=>{var N,B;const K=new Map;for(const H of((N=i.value)==null?void 0:N.objects)??[]){const ce=((B=r.byName[H])==null?void 0:B.unit)??"";K.set(ce,[...K.get(ce)??[],H])}return[...K].flatMap(([H,ce])=>Array.from({length:Math.ceil(ce.length/6)},(fe,Ne)=>({unit:H,names:ce.slice(Ne*6,Ne*6+6).filter(re=>a.value.includes(re))}))).filter(H=>H.names.length)});function V(K){return K.names.map(N=>({label:r.byName[N]?Js(r.byName[N]):N,unit:K.unit,slot:i.value.objects.filter(B=>{var H;return(((H=r.byName[B])==null?void 0:H.unit)??"")===K.unit}).indexOf(N)%6+1}))}function j(K){const N=_.value;return!N||!i.value?K.map(()=>[]).concat([[]]):N.view(s.value,n.value,K)}function q(){const K=_.value,N=i.value;if(!K||!N)return[];const B=(K.t[K.t.length-1]??0)-n.value;return fi(K.t.map((H,ce)=>{var fe;return{t:H-B,error_code:(fe=K.values[ce])==null?void 0:fe.error_code}}),r.errors).filter(H=>H.t>=-s.value&&H.t<=0)}async function z(){var B,H;if(!i.value||u.value)return;u.value=!0,c.value="";const K=r.openedAt,N=i.value.id;try{const ce=await He("POST","/api/scope/save",{opened_at:K,source:N,seconds:30});r.openedAt===K&&((B=i.value)==null?void 0:B.id)===N&&(c.value=`已保存最近 30 s,记录 ${ce.record}`)}catch(ce){r.openedAt===K&&((H=i.value)==null?void 0:H.id)===N&&(c.value=ce.message)}finally{u.value=!1}}return(K,N)=>(p(),h("section",Py,[o("h2",null,[N[5]||(N[5]=Y("已采集反馈",-1)),N[6]||(N[6]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!i.value,onClick:$},f(l.value?"继续":"冻结"),9,My),o("button",{disabled:!i.value||u.value,onClick:z},f(u.value?"保存中…":"保存最近 30 s"),9,Ny)]),i.value?(p(),h(le,{key:1},[o("div",Ry,[o("label",Vy,[N[7]||(N[7]=Y("来源 ",-1)),we(o("select",{"onUpdate:modelValue":N[0]||(N[0]=B=>t.value=B)},[(p(!0),h(le,null,Ue(d(r).sampleSources,B=>(p(),h("option",{key:B.id,value:B.id},f(v(B.source))+" · "+f(b(B.time_base)),9,Dy))),128))],512),[[hs,t.value]])]),o("label",Ly,[N[8]||(N[8]=Y("窗口 ",-1)),we(o("select",{"onUpdate:modelValue":N[1]||(N[1]=B=>s.value=B)},[(p(),h(le,null,Ue([1,2,5,10,30,60],B=>o("option",{key:B,value:B},f(B)+" s",9,Iy)),64))],512),[[hs,s.value,void 0,{number:!0}]])]),o("label",Uy,[N[9]||(N[9]=Y("回看 ",-1)),we(o("input",{type:"range","onUpdate:modelValue":N[2]||(N[2]=B=>n.value=B),min:"0",max:60-s.value,step:"0.1"},null,8,Fy),[[Re,n.value,void 0,{number:!0}]]),Y(" "+f(n.value.toFixed(1))+" s",1)]),o("button",{class:"plain",onClick:N[3]||(N[3]=B=>n.value=0)},"最新")]),o("p",zy,f(v(i.value.source))+" · "+f(b(i.value.time_base))+" · 接收 "+f(i.value.samples)+" 个样本 · 已知缺口 "+f(i.value.gaps)+" 处。保存读取服务当前缓冲,冻结和回看只影响显示。",1),o("details",null,[N[10]||(N[10]=o("summary",null,"显示通道",-1)),o("div",Hy,[(p(!0),h(le,null,Ue(i.value.objects,B=>(p(),h("label",{key:B},[we(o("input",{type:"checkbox",value:B,"onUpdate:modelValue":N[4]||(N[4]=H=>a.value=H)},null,8,By),[[Fn,a.value]]),Y(" "+f(d(r).byName[B]?d(Js)(d(r).byName[B]):B),1)]))),128))])]),a.value.length?R("",!0):(p(),h("p",Wy,"展开“显示通道”选择需要绘制的读数。")),(p(!0),h(le,null,Ue(L.value,B=>{var H;return p(),vt(rn,{key:t.value+B.names.join(),series:V(B),data:()=>j(B.names),tick:k.value,markers:q,"sync-key":t.value,"frozen-at":(H=l.value)==null?void 0:H.at,height:170,"time-label":`t / s(${b(i.value.time_base)},相对窗口末端)`},null,8,["series","data","tick","sync-key","frozen-at","time-label"])}),128))],64)):(p(),h("p",jy,"尚未收到可绘制的反馈。CAN 侦听 TPDO,USB 在控制时收到 TxPDO,EtherCAT 在控制或观察时收到 PDO;状态轮询也按来源保留。")),c.value?(p(),h("p",Ky,f(c.value),1)):R("",!0)]))}}),pp=Wt(Gy,[["__scopeId","data-v-cc5621e2"]]);function qy(e){var s,n;const t=(n=(s=e.desc)==null?void 0:s.match(/(?:通信)?复位后生效/))==null?void 0:n[0];return t?{kind:"adopt-later",text:`已写入并读回,${e.persist?"保存并":""}${t}`}:(e.index&65280)===8960?{kind:"adopt-later",text:"已写入并读回,驱动未运行时采用"}:{kind:"written",text:"已写入并读回"}}function Jy(e){const t=e;return t&&typeof t.status=="number"&&t.status>=400&&t.status<500?t.message??"请求被拒绝":null}async function Yy(e,t,s,n,l,a){var b,_;const c={};for(const k of e){const $=Ml(t[k],s[k]);if("error"in $)return a(k,{kind:"rejected",text:`未写入:${$.error}`}),[];c[k]=$.value}let u=!1;for(const k of e){let $;try{$=await l.read(k)}catch(L){for(const V of e)a(V,V===k?{kind:"rejected",text:`预读失败:${L.message};本批未写入`}:{kind:"skipped",text:"本批未写入(预读失败)"});return[]}n[k]!==void 0&&$!==n[k]&&(a(k,{kind:"changed",text:`设备值已变为 ${ms(t[k],$)},核对后再写`}),u=!0),n[k]=$}if(u)return[];const i=[];let v=!1;for(const k of e){if(v){a(k,{kind:"skipped",text:"未执行"});continue}const $=t[k];a(k,{kind:"sending",text:"发送中"});try{const L=await l.write(k,c[k]);L.status==="written"&&L.readback!=null&&ll($,c[k],L.readback)?(a(k,qy($)),i.push(k)):L.status==="written"?(a(k,{kind:"unknown",text:`读回 ${ms($,L.readback)},与写入不一致`}),v=!0):L.status==="rejected"?(a(k,{kind:"rejected",text:`未写入:${((b=L.abort)==null?void 0:b.description_zh)??""}。${((_=L.abort)==null?void 0:_.meaning_zh)??""}`}),v=!0):(a(k,{kind:"unknown",text:`结果未知(${L.message??""});读回 ${ms($,L.readback)},未重发`}),v=!0)}catch(L){const V=Jy(L);a(k,V?{kind:"rejected",text:`未执行:${V}`}:{kind:"unknown",text:`结果未知:${L.message};未重发`}),v=!0}}return i}function ri(){return Dt({drafts:{},status:{},base:{},writing:!1})}function Ko(e){var s,n,l;const t=r.byName[e];if(!t||t.access!=="rw"||t.pdo==="rx")return"只读";if(r.commands.includes(e))return"具名操作";if(!r.connected)return"未连接设备";if(r.missing.includes(e))return"设备不提供(固件比工具包旧)";if(!r.link.ok)return"链路中断";if(r.state.via==="can"&&!r.state.sdo_poll)return"CAN 只侦听:先在状态面板开启 SDO 访问";if(Xt()){if(((s=r.job)==null?void 0:s.kind)!=="record"&&((n=r.job)==null?void 0:n.origin)!==r.client)return"运动期间仅发起任务的页面可以改参数";if(!["manual","observe","run","step","calibrate","longrun","record"].includes(((l=r.job)==null?void 0:l.kind)??""))return"任务运行中";if(t.disabled_only)return"驱动运行中不可写,先停止"}return t.disabled_only&&r.state.running?"驱动运行中不可写,先停止":t.developer&&!r.state.developer?"需要开发者模式(状态胶囊中进入)":""}function mp(){return r.connected?`设备属主:${r.state.owner_text??"尚未读取"}。${r.state.running?"写入运行中可写参数会影响当前运动。":"写入的参数会影响后续运动。"}`:"未连接设备"}function oa(e,t,s){t in e.base||(e.base[t]=r.state[t]),e.drafts[t]=s,delete e.status[t]}function Oa(e,t){delete e.drafts[t],delete e.base[t]}function vp(e,t,s){for(const n of s){const l=t[n];if(l===void 0)continue;const a=Ml(r.byName[n],l),c=r.state[n];"value"in a&&typeof c=="number"&&ll(r.byName[n],a.value,c)?(Oa(e,n),delete e.status[n]):Ko(n)||oa(e,n,l)}}function Go(e,t){const s=Object.keys(e.drafts).filter(n=>(e.drafts[n]??"")!=="");return t?t.filter(n=>s.includes(n)):s}function qo(e){if(!r.connected||r.openedAt!==e)throw new Zi(409,"设备会话已切换,本批操作已结束")}function Zy(e,t,s,n){if(e.drafts[t]!==n){s.kind==="written"||s.kind==="adopt-later"?(t in e.drafts&&(e.base[t]=r.state[t]),e.status[t]={kind:"skipped",text:`本次提交 ${n} ${s.text};当前草稿未写入`}):e.status[t]={...s,text:`${s.text}(本次提交 ${n};当前草稿未写入)`};return}if(e.status[t]=s,s.kind==="written"||s.kind==="adopt-later"){Oa(e,t);const l=e.status[t];setTimeout(()=>{e.status[t]===l&&delete e.status[t]},s.kind==="written"?2e3:6e3)}}async function hp(e,t){if(e.writing)return;const s=Object.fromEntries(t.map(a=>[a,e.drafts[a]])),n={...e.base},l=r.openedAt;for(const a of t)delete e.status[a];e.writing=!0;try{await Yy(t,r.byName,s,n,{read:async a=>{qo(l);const c=await He("GET",`/api/objects/${a}`);return qo(l),Nl(a,c.value),c.value},write:async(a,c)=>{qo(l);const u=await He("PUT",`/api/objects/${a}`,{value:c,opened_at:l});if(!r.connected||r.openedAt!==l)throw new Error("设备会话已切换,请重新核对原设备的写入结果");return u.readback!==void 0&&u.readback!==null&&Nl(a,u.readback,"SDO 写后读回"),u}},(a,c)=>Zy(e,a,c,s[a]))}finally{for(const a of t)e.drafts[a]===s[a]&&a in n&&(e.base[a]=n[a]);e.writing=!1}}function so(e){for(const t of Object.keys(e.drafts))Oa(e,t);for(const t of Object.keys(e.status))delete e.status[t]}async function Nr(e,t){if(r.state.via==="can"&&!r.state.sdo_poll)return;const s=r.openedAt;for(const n of t)if(!r.missing.includes(n))try{qo(s);const l=await He("GET",`/api/objects/${n}`);qo(s),Nl(n,l.value)}catch(l){if(e.status[n]={kind:"unknown",text:l.message},l.status!==422)break}}const Qy={class:"list"},Xy={class:"right"},e2={key:0},t2={key:1},s2=["onClick","onKeydown"],n2={class:"caption mono"},l2={key:0},o2=["title"],i2={class:"secondary"},a2={key:0},r2={key:0,class:"draft-dot","aria-hidden":"true"},u2=["disabled","title","placeholder","aria-label","value","data-draft","onInput","onKeydown"],c2={key:0,"aria-hidden":"true"},d2={key:1,class:"caption"},f2={class:"sr-only","aria-live":"polite"},p2={key:0,class:"row foot"},m2=["disabled"],v2={key:0,class:"caption"},h2=["disabled"],b2=["disabled"],g2=Bt({__name:"ObjectTable",props:{names:{},readonly:{type:Boolean},model:{},visible:{},foot:{type:Boolean,default:!0},imported:{},fileValues:{}},setup(e){const t=e,s=t.model??ri(),n=_e(!1),l=ge(()=>t.names.map($=>r.byName[$]).filter($=>$&&(!t.visible||t.visible.has($.name)))),a=ge(()=>Go(s,t.names)),c=ge(()=>a.value.some($=>u($)));function u($){if(t.readonly)return"只读";if(t.fileValues!==void 0){const L=r.byName[$];return!L||L.access!=="rw"||L.pdo==="rx"?"只读":r.commands.includes($)?"具名操作":""}return Ko($)}const i=$=>!u($);function v($){if(t.fileValues===void 0)return r.state[$];const L=t.fileValues[$];if(L===void 0)return;const V=Ml(r.byName[$],L);return"value"in V?V.value:L}function b($,L){Oa(s,$),L.value="",L.blur()}async function _(){await hp(s,r.od.map($=>$.name).filter($=>a.value.includes($)))}async function k(){n.value=!0;try{await Nr(s,t.names)}finally{n.value=!1}}return Fs(()=>{t.foot&&t.fileValues===void 0&&r.connected&&r.link.ok&&k()}),it(()=>t.imported,$=>{$&&!t.readonly&&t.fileValues===void 0&&vp(s,$,t.names)},{immediate:!0}),($,L)=>(p(),h(le,null,[o("table",Qy,[o("thead",null,[o("tr",null,[L[3]||(L[3]=o("th",null,"参数",-1)),o("th",Xy,f(e.fileValues===void 0?"设备值":"文件值"),1),L[4]||(L[4]=o("th",null,"单位",-1)),e.readonly?R("",!0):(p(),h("th",e2,f(e.fileValues===void 0?"草稿":"文件草稿"),1)),e.fileValues===void 0?(p(),h("th",t2,"读取时间")):R("",!0),L[5]||(L[5]=o("th",null,"状态",-1))])]),o("tbody",null,[(p(!0),h(le,null,Ue(l.value,V=>{var j;return p(),h("tr",{key:V.name,class:Ve(["clickable",{selected:d(r).selected===V.name}]),tabindex:"0",onClick:q=>d(zt)(V.name),onKeydown:Un(Cl(q=>d(zt)(V.name),["self"]),["enter"])},[o("td",null,[o("div",null,f(d(Js)(V)),1),o("div",n2,f(d(ii)(V))+" "+f(V.name),1)]),o("td",{class:Ve(["right num",{"stale-reading":e.fileValues===void 0&&d(ut)(V.name).stale}])},[e.fileValues===void 0&&d(r).missing.includes(V.name)?(p(),h("span",l2,"—")):(p(),h("span",{key:1,title:`原始值 ${d(ms)(V,v(V.name))}`},f(d(Al)(V,v(V.name))),9,o2))],2),o("td",i2,f(V.unit),1),e.readonly?R("",!0):(p(),h("td",a2,[d(s).drafts[V.name]?(p(),h("span",r2)):R("",!0),o("input",{class:"num draft",disabled:!i(V.name),title:u(V.name),placeholder:i(V.name)?"新值":"","aria-label":`${d(Js)(V)} 的新值`,value:d(s).drafts[V.name]??"","data-draft":d(s).drafts[V.name]?1:void 0,onInput:q=>d(oa)(d(s),V.name,q.target.value),onKeydown:[Un(Cl(q=>b(V.name,q.target),["stop"]),["esc"]),L[0]||(L[0]=Un(Cl(()=>{},["prevent"]),["enter"]))],onClick:L[1]||(L[1]=Cl(()=>{},["stop"]))},null,40,u2)])),e.fileValues===void 0?(p(),h("td",{key:1,class:Ve(["caption",{"stale-reading":d(ut)(V.name).stale}])},f(d(ut)(V.name).text),3)):R("",!0),o("td",{class:Ve(["state",{"status-critical":["rejected","unknown","changed"].includes(((j=d(s).status[V.name])==null?void 0:j.kind)??"")}])},[d(s).status[V.name]?(p(),h(le,{key:0},[d(s).status[V.name].kind==="written"||d(s).status[V.name].kind==="adopt-later"?(p(),h("span",c2,"✓ ")):R("",!0),Y(f(d(s).status[V.name].text),1)],64)):u(V.name)&&u(V.name)!=="只读"?(p(),h("span",d2,f(u(V.name)),1)):R("",!0)],2)],42,s2)}),128))])]),o("div",f2,f(Object.values(d(s).status).map(V=>V.text).join(";")),1),e.foot&&e.fileValues===void 0?(p(),h("div",p2,[o("button",{onClick:k,disabled:!d(r).connected||d(s).writing||n.value},"读取",8,m2),L[6]||(L[6]=o("span",{class:"spacer"},null,-1)),e.readonly?R("",!0):(p(),h(le,{key:0},[a.value.length?(p(),h("span",v2,f(a.value.length)+" 项未写入"+f(c.value?";有草稿所在行当前不可写":""),1)):R("",!0),o("button",{onClick:L[2]||(L[2]=V=>d(so)(d(s))),disabled:!a.value.length||d(s).writing},"放弃草稿",8,h2),o("button",{class:"primary",onClick:_,disabled:!a.value.length||d(s).writing||c.value},"写入",8,b2)],64))])):R("",!0),e.foot&&e.fileValues===void 0&&!e.readonly&&a.value.length?(p(),h("p",{key:1,class:Ve(["caption",{"status-warning":d(r).state.running}])},f(d(mp)()),3)):R("",!0)],64))}}),kn=Wt(g2,[["__scopeId","data-v-7c0f98c5"]]),_2={class:"joblog"},y2={key:0},k2=["value","max"],w2={key:2,class:"caption"},$2={key:3,class:"status-critical"},x2={role:"log",class:"log"},S2=Bt({__name:"JobLog",props:{job:{}},setup(e){const t=e,s=ge(()=>{const l=t.job.firmware_progress;if(!l)return"";if(l.stage==="reset")return"复位请求已提交,完成情况以任务结果和后续设备反馈为准";const a=l.label??"镜像";return l.stage==="verify"?`校验${a}`:l.written!==void 0&&l.total!==void 0?`写入${a} · ${l.percent}%(${l.written} / ${l.total} 字节)`:`写入${a}${l.total!==void 0?`(镜像 ${l.total} 字节)`:""}`}),n=ge(()=>{const l=t.job.firmware_progress;return!l||t.job.state!=="running"?"":l.stage==="reset"||l.cancellable===!1?"复位请求已提交,不能撤回。":"可在工具栏“放弃升级”,当前协议请求返回后结束后续步骤。已经发送的写入不能撤回。"});return(l,a)=>{var c;return p(),h("div",_2,[s.value?(p(),h("p",y2,f(s.value),1)):R("",!0),((c=e.job.firmware_progress)==null?void 0:c.stage)==="write"&&e.job.firmware_progress.written!==void 0&&e.job.firmware_progress.total?(p(),h("progress",{key:1,value:e.job.firmware_progress.written,max:e.job.firmware_progress.total,"aria-label":"镜像写入进度"},null,8,k2)):R("",!0),n.value?(p(),h("p",w2,f(n.value),1)):R("",!0),e.job.note?(p(),h("p",$2,"⚠ "+f(e.job.note),1)):R("",!0),o("pre",x2,f(e.job.log.join(`
131
+ `))+f(e.job.log.length?`
132
+ `:"")+f(e.job.end??"进行中…")+f(e.job.error?":"+e.job.error:""),1)])}}}),Jo=Wt(S2,[["__scopeId","data-v-3b58c065"]]);function bp(e){const t=_e(5);it(t,()=>{is.value=Math.min(is.value,60-t.value)});async function s(a,c){e.value=null;const u=r.openedAt;try{const i=await He("POST","/api/scope",{opened_at:u,objects:a,divider:c});return r.openedAt!==u?!1:(wf(i),!0)}catch(i){return r.openedAt===u&&(e.value={ok:!1,text:i.message}),!1}}async function n(){const a=r.openedAt;try{const c=await He("POST","/api/scope/save",{opened_at:a,seconds:30});r.openedAt===a&&(e.value={ok:!0,text:`已保存记录 ${c.record}`})}catch(c){r.openedAt===a&&(e.value={ok:!1,text:c.message})}}function l(a,c=!1){return()=>{var b;const u=Qr.value??ya.value,i=((b=r.scope)==null?void 0:b.objects)??[],v=u.view(t.value,is.value);return[v[0],...a.map(_=>{const k=i.indexOf(_);return(k<0?void 0:v[k+1])??(c?v[0].map(()=>null):[])})]}}return{configure:s,saveScope:n,span:t,data:l}}const C2={class:"page"},A2={class:"card"},T2=["disabled"],O2=["disabled","title"],E2={key:0,class:"status-warning"},P2={key:1,class:"status-warning"},M2={key:2,class:"caption"},N2={class:"segmented",role:"radiogroup","aria-label":"模式"},j2=["aria-checked","disabled","onClick"],R2={key:3,class:"caption"},V2={key:4,class:"caption"},D2={key:5,class:"caption"},L2={key:6,class:"caption"},I2={key:7,class:"caption"},U2={class:"row form"},F2=["disabled","onUpdate:modelValue","onKeydown"],z2={class:"unit"},H2=["disabled"],B2={key:8,class:"caption"},W2={key:9,class:"row"},K2=["min","max","disabled","aria-label"],G2={key:10,class:"row"},q2={class:"field"},J2=["disabled"],Y2={class:"unit"},Z2=["disabled"],Q2=["disabled"],X2={key:13,class:"caption"},ek={key:14,class:"caption"},tk={class:"card"},sk={key:0,class:"card"},nk={key:0,class:"caption"},lk={class:"row"},ok={class:"field"},ik=["max"],ak={class:"row"},rk=["aria-label","onClick"],uk=["disabled"],ck={class:"field"},dk=["value"],fk=["disabled"],pk=["disabled"],mk={key:0,class:"caption"},vk={key:1,class:"pick"},hk=["onClick"],bk={class:"caption"},gk={key:2,class:"caption"},_k=Bt({__name:"ControlPage",setup(e){var Be;const t={position_mm:G=>G.position_actual_um/1e3,velocity_mm_s:G=>G.velocity_actual_um_s/1e3,force_n:G=>G.force_actual_n,motor_rpm:G=>G.motor_speed_rpm},s={position_mm:G=>G.position_um==null?null:G.position_um/1e3,velocity_mm_s:G=>G.velocity_um_s==null?null:G.velocity_um_s/1e3,force_n:G=>G.force_n??null,motor_rpm:G=>G.motor_rpm??null},n={csv:"velocity_mm_s",motor_speed:"motor_rpm"},l=ge(()=>r.od.filter(G=>G.index>=8736&&G.index<=8745).map(G=>G.name)),a=_e("csv"),c=ge(()=>{var G;return((G=r.job)==null?void 0:G.kind)==="manual"&&r.job.state==="running"}),u=ge({get:()=>c.value?String(r.job.params.mode):a.value,set:G=>{a.value=G}}),i=ge(()=>r.manualModes.find(G=>G.key===u.value)??{key:u.value,label:u.value,fields:[]}),v=ge(()=>i.value.fields[0]??{key:"velocity_mm_s",label:"速度",unit:"mm/s"}),b=Dt({position_mm:0,velocity_mm_s:0,force_n:0,motor_rpm:0,stiffness_n_mm:20,damping_n_s_mm:2}),_=Dt({csv:5,motor_speed:60}),k=ge(()=>{var G;return((G=r.job)==null?void 0:G.kind)==="observe"&&r.job.state==="running"}),$=ge(()=>r.job&&["manual","observe"].includes(r.job.kind)?r.job:null),L=ge(()=>{var G;return((G=r.manualRows.at(-1))==null?void 0:G.time_source)==="dc"?"dc":"host"}),V=ge(()=>{var G;return c.value&&r.client!==null&&((G=r.job)==null?void 0:G.origin)===r.client}),j=ge(()=>{var G,X;return((G=$.value)==null?void 0:G.last_sent)??((X=r.manualRows.at(-1))==null?void 0:X.sent)??null}),q=ge(()=>V.value&&j.value!==null);function z(G){const X=j.value;if(X)return G==="position_mm"?X.position_um==null?void 0:X.position_um/1e3:G==="velocity_mm_s"?X.velocity_um_s==null?void 0:X.velocity_um_s/1e3:X[G]}let K=null;it([()=>{var G;return c.value?(G=r.job)==null?void 0:G.id:null},j,V],([G,X])=>{if(!G){K=null;return}if(a.value=u.value,!(!X||V.value&&K===G)){for(const ue of i.value.fields){const qe=z(ue.key);qe!==void 0&&(b[ue.key]=qe)}K=G}},{immediate:!0});const N=_e(null),B=_e(!1),H=ge(()=>!!(r.state.faulted||r.state.latched)),ce=ge(()=>Number(r.state.abort_connection_option)===0),fe=Dt({min:0,max:100,vmax:50});function Ne(G,X){if(String(G).trim()==="")return N.value={ok:!1,text:`${X}不能为空,没有发送`},null;const ue=Number(G);return Number.isFinite(ue)?ue:(N.value={ok:!1,text:`${X}须为有限的数,没有发送`},null)}function re(){N.value=null;const G={};for(const X of i.value.fields){const ue=Ne(b[X.key],X.label);if(ue===null)return null;G[X.key]=ue}return G}async function E(G){if(G.currentTarget.blur(),B.value)return;const X=re();if(X){if(H.value){N.value={ok:!1,text:"设备有故障或锁存保护,请在顶部设备状态中查明原因并确认,再开始控制"};return}B.value=!0;try{await He("POST","/api/jobs",{kind:"manual",opened_at:r.openedAt,params:{mode:u.value,ack:!1,initial:X}})}catch(ue){N.value={ok:!1,text:ue.message}}finally{B.value=!1}}}async function U(){if(!B.value){N.value=null,B.value=!0;try{await He("POST","/api/jobs",{kind:"observe",opened_at:r.openedAt,params:{ack:!1}})}catch(G){N.value={ok:!1,text:G.message}}finally{B.value=!1}}}async function de(){const G=r.job;!G||G.state!=="running"||!["manual","observe"].includes(G.kind)||await He("POST","/api/stop",{kind:"cancel",opened_at:r.openedAt,job_id:G.id}).catch(X=>{N.value={ok:!1,text:X.message}})}function $e(){var X;if(!q.value)return;const G=re();G&&Ho({type:"target",opened_at:r.openedAt,job_id:(X=r.job)==null?void 0:X.id,values:G})}let I=0,g;function ee(){var ue;const G=performance.now(),X=(ue=r.job)==null?void 0:ue.id;window.clearTimeout(g),G-I>=50?(I=G,$e()):g=window.setTimeout(()=>{var qe;((qe=r.job)==null?void 0:qe.id)===X&&(I=performance.now(),$e())},50-(G-I))}const Oe=ge(()=>n[u.value]??null);let je,ie=!1,S=null,C=null;function F(G){if(!Oe.value||!q.value||ie)return;N.value=null;const X=Ne(_[u.value],"点动速度");if(X===null)return;if(X<0){N.value={ok:!1,text:"点动速度须为非负数,没有发送"};return}ie=!0,S=r.job.id,C=Oe.value;const ue={[C]:G*X},qe=()=>{var pt;if(((pt=r.job)==null?void 0:pt.id)!==S||!q.value){x();return}Ho({type:"target",opened_at:r.openedAt,job_id:S,values:ue,jog:!0})};qe(),je=window.setInterval(qe,100)}function x(){var G;ie&&(ie=!1,window.clearInterval(je),C&&((G=r.job)==null?void 0:G.id)===S&&V.value&&(b[C]=0,Ho({type:"target",opened_at:r.openedAt,job_id:S,values:{[C]:0}})),S=null,C=null)}it(q,G=>{G||(window.clearTimeout(g),x())}),it(()=>{var G;return(G=r.job)==null?void 0:G.id},()=>{window.clearTimeout(g),x()},{flush:"sync"});function O(G,X){G.currentTarget.setPointerCapture(G.pointerId),F(X)}const be={ArrowUp:1,ArrowRight:1,ArrowDown:-1,ArrowLeft:-1};function se(G){!(G.key in be)||!Oe.value||!q.value||G.target instanceof HTMLElement&&G.target.matches("input, select, textarea")||(G.preventDefault(),G.repeat||F(be[G.key]))}function ft(G){G.key in be&&x()}Fs(async()=>{window.addEventListener("keydown",se),window.addEventListener("keyup",ft),window.addEventListener("blur",x);for(const[G,X]of[["min","soft_position_min_um"],["max","soft_position_max_um"],["vmax","velocity_limit_um_s"]])try{fe[G]=(await He("GET",`/api/objects/${X}`)).value/1e3}catch{}}),cl(()=>{x(),window.clearTimeout(g),window.removeEventListener("keydown",se),window.removeEventListener("keyup",ft),window.removeEventListener("blur",x)});const Z=ge(()=>{var X;const G=$.value;return(G==null?void 0:G.kind)==="manual"?((X=r.manualModes.find(ue=>ue.key===G.params.mode))==null?void 0:X.fields[0])??v.value:v.value}),Je=ge(()=>[{label:"实际",slot:1,unit:Z.value.unit},...k.value?[]:[{label:"已发送目标",slot:1,dash:!0,unit:Z.value.unit}]]);function A(){var ue;const G=r.manualRows,X=((ue=G[G.length-1])==null?void 0:ue.t)??0;return fi(G.map(qe=>({t:qe.t-X,error_code:qe.error_code})),r.errors)}function D(){const G=r.manualRows;if(!G.length)return Je.value.map(()=>[]).concat([[]]);const X=G[G.length-1].t;let ue=G.length-1;for(;ue>0&&G[ue-1].t>=X-20;)ue--;const qe=G.slice(ue),pt=t[Z.value.key],lt=s[Z.value.key],St=[qe.map(tt=>tt.t-X),qe.map(pt)];return k.value||St.push(qe.map(tt=>lt(tt.sent))),eu(St,qe.map(tt=>!!tt.display_gap))}const J=_e([...((Be=r.scope)==null?void 0:Be.objects)??[]]),pe=_e(null);it(()=>r.scopePicks.slice(),G=>{if(!G.length)return;const X=[...new Set([...J.value,...G])];J.value=X.slice(0,8),pe.value={ok:X.length<=8,text:X.length>8?"设备最多采集 8 路,超出的对象没有加入;先移除不需要的通道。":"已加入示波候选,点击“开始示波”或“替换示波通道”后采集。"},r.scopePicks=[]},{immediate:!0});const me=_e(1),ve=_e(""),Ae=ge(()=>{const G=ve.value.trim().toLowerCase();return r.od.filter(X=>!J.value.includes(X.name)&&(!G||X.name.includes(G)||(X.desc??"").toLowerCase().includes(G)||ii(X).toLowerCase().includes(G))).slice(0,12)});function Te(G){J.value.length<8&&J.value.push(G),ve.value=""}const{configure:xe,saveScope:ae,span:De,data:oe}=bp(pe);async function Le(G){await xe(G?J.value:[],me.value)&&(r.scopePicks=[])}const Ce=ge(()=>{var qe,pt;const G=((qe=r.scope)==null?void 0:qe.objects)??[],X=new Map;for(const lt of G){const St=((pt=r.byName[lt])==null?void 0:pt.unit)??"";X.set(St,[...X.get(St)??[],lt])}const ue=[];for(const[lt,St]of X)for(let tt=0;tt<St.length;tt+=6)ue.push({unit:lt,names:St.slice(tt,tt+6)});return ue});function he(G){return G.names.map(X=>{var ue;return{label:r.byName[X]?Js(r.byName[X]):X,slot:(((ue=r.scope)==null?void 0:ue.objects.indexOf(X))??0)%6+1,unit:G.unit}})}return(G,X)=>(p(),h("div",C2,[X[30]||(X[30]=o("h1",null,"控制与示波",-1)),o("section",A2,[o("h2",null,[X[16]||(X[16]=Y("手动控制 ",-1)),X[17]||(X[17]=o("span",{class:"spacer"},null,-1)),d(r).state.via==="ecat"&&!c.value&&!k.value?(p(),h("button",{key:0,disabled:!d(an)()||B.value,onClick:U},"EtherCAT 观察",8,T2)):R("",!0),k.value?(p(),h("button",{key:1,onClick:de},"结束观察")):R("",!0),!c.value&&!k.value?(p(),h("button",{key:2,class:"primary",disabled:!d(an)()||ce.value||B.value,title:ce.value?"0x6007 = 0":"",onClick:E},f(B.value?"正在请求…":"开始控制"),9,O2)):c.value?(p(),h("button",{key:3,class:"stop-active",onClick:de},"结束控制")):R("",!0)]),ce.value?(p(),h("p",E2,"⚠ 设备的失联反应 0x6007 = 0(不处理):页面离开后设备会一直执行最后的目标,因此不能开始手动控制。")):R("",!0),H.value?(p(),h("p",P2,[X[18]||(X[18]=Y("设备有故障或锁存保护。查明原因后,在顶部设备状态中“确认保护/故障”,再开始控制。",-1)),o("button",{class:"plain",onClick:X[0]||(X[0]=ue=>d(r).popover=!0)},"查看设备状态")])):R("",!0),d(r).state.via==="ecat"&&!c.value&&!k.value?(p(),h("p",M2,"EtherCAT 控制或观察会进入 OP,驱动未运行时取得控制权;观察只发控制字 0,结束后退回 PREOP。")):R("",!0),o("div",N2,[(p(!0),h(le,null,Ue(d(r).manualModes,ue=>(p(),h("button",{key:ue.key,role:"radio","aria-checked":u.value===ue.key,class:Ve({on:u.value===ue.key}),disabled:c.value||ue.key==="motor_speed"&&!d(r).state.developer,onClick:qe=>u.value=ue.key},f(ue.label),11,j2))),128))]),c.value&&!V.value?(p(),h("p",R2,"本页当前只查看已发送目标,请在发起控制的页面修改;可按“结束控制”或工具栏停止。")):(p(),h("p",V2,"目标在回车或“发送”时发出;标签页隐藏或关闭时请求停止(快停后断电)。切换工作台页面会保持控制,窗口失焦时点动归零。")),V.value&&!j.value?(p(),h("p",D2,"正在取得控制权并使能,首次发送后可修改目标;启动进度见下方日志。")):c.value&&!d(r).manualRows.length?(p(),h("p",L2,"控制数据已发送,等待首个过程数据反馈;最新设备反馈见顶部状态。")):R("",!0),!c.value&&(u.value==="csp"||u.value==="impedance")?(p(),h("p",I2,"开始控制时先保持设备实际位置;使能后再发送新的位置目标。")):R("",!0),o("div",U2,[(p(!0),h(le,null,Ue(i.value.fields,ue=>(p(),h("label",{key:ue.key,class:"field"},[Y(f(ue.key===v.value.key?`目标${ue.label}`:ue.label)+" ",1),we(o("input",{class:"num",type:"number",step:"any",disabled:c.value&&!q.value,"onUpdate:modelValue":qe=>b[ue.key]=qe,onKeydown:Un(Cl($e,["prevent"]),["enter"])},null,40,F2),[[Re,b[ue.key],void 0,{number:!0}]]),o("span",z2,f(ue.unit),1)]))),128)),o("button",{disabled:!q.value,onClick:$e},"发送",8,H2),(p(!0),h(le,null,Ue(d(r).state.status_bits??[],ue=>(p(),h("span",{key:ue,class:"tag"},f(ue),1))),128))]),c.value&&j.value?(p(),h("p",B2,[X[19]||(X[19]=Y("已发送目标:",-1)),(p(!0),h(le,null,Ue(i.value.fields,ue=>(p(),h("span",{key:ue.key},f(ue.label)+" "+f(z(ue.key)??"—")+" "+f(ue.unit)+" ",1))),128))])):R("",!0),u.value==="csp"||u.value==="csv"?(p(),h("div",W2,[we(o("input",{class:"slider",type:"range",min:u.value==="csp"?fe.min:-fe.vmax,max:u.value==="csp"?fe.max:fe.vmax,step:"0.1",disabled:!q.value,"onUpdate:modelValue":X[1]||(X[1]=ue=>b[v.value.key]=ue),onInput:ee,onChange:$e,"aria-label":`${i.value.label}目标滑块`},null,40,K2),[[Re,b[v.value.key],void 0,{number:!0}]])])):R("",!0),Oe.value?(p(),h("div",G2,[o("label",q2,[X[20]||(X[20]=Y("点动速度 ",-1)),we(o("input",{class:"num",type:"number",min:"0",step:"any",disabled:c.value&&!V.value,"onUpdate:modelValue":X[2]||(X[2]=ue=>_[u.value]=ue)},null,8,J2),[[Re,_[u.value],void 0,{number:!0}]]),o("span",Y2,f(v.value.unit),1)]),o("button",{disabled:!q.value,onPointerdown:X[3]||(X[3]=ue=>O(ue,-1)),onPointerup:x,onPointercancel:x,onLostpointercapture:x,onKeydown:X[4]||(X[4]=Un(Cl(ue=>F(-1),["prevent"]),["space"])),onKeyup:Un(x,["space"]),onBlur:x},"◀ 按住反向",40,Z2),o("button",{disabled:!q.value,onPointerdown:X[5]||(X[5]=ue=>O(ue,1)),onPointerup:x,onPointercancel:x,onLostpointercapture:x,onKeydown:X[6]||(X[6]=Un(Cl(ue=>F(1),["prevent"]),["space"])),onKeyup:Un(x,["space"]),onBlur:x},"按住正向 ▶",40,Q2),X[21]||(X[21]=o("span",{class:"caption"},"也可按住方向键(焦点不在输入框时)",-1))])):R("",!0),N.value?(p(),h("p",{key:11,class:Ve(N.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(N.value.text),3)):R("",!0),$.value?(p(),vt(Jo,{key:12,job:$.value},null,8,["job"])):R("",!0),d(r).state.via==="can"?(p(),h("p",X2,"手动控制曲线使用 CAN 过程数据和主机接收时间。其他主站控制时,可在“长时”页选择“只记录”采集反馈。")):d(r).state.via==="ecat"?(p(),h("p",ek,"这里显示手动控制或 OP 观察收到的 TxPDO。任意对象按设备时刻同步采样的示波流由 USB 提供。")):R("",!0),(p(),vt(rn,{key:L.value,series:Je.value,data:D,tick:d(r).manualTick,markers:A,"sync-key":L.value,height:200,"time-label":`t / s(${L.value==="dc"?"DC 时刻":"主机接收时间"},相对最新样本)`},null,8,["series","tick","sync-key","time-label"]))]),o("section",tk,[X[22]||(X[22]=o("h2",null,"外环增益",-1)),X[23]||(X[23]=o("p",{class:"caption"},"运行中可写,写入会立即影响当前运动。停机条件和访问权限见各行。",-1)),st(kn,{names:l.value},null,8,["names"])]),st(pp),d(r).state.via==="usb"?(p(),h("section",sk,[o("h2",null,[X[25]||(X[25]=Y("USB 设备示波 ",-1)),d(r).scope?(p(),h("span",nk,f(d(r).scope.rate_hz)+" Hz · 设备时刻 · 丢帧 "+f(d(r).scope.gaps),1)):R("",!0),X[26]||(X[26]=o("span",{class:"spacer"},null,-1)),we(o("select",{"onUpdate:modelValue":X[7]||(X[7]=ue=>It(De)?De.value=ue:null),"aria-label":"显示窗口"},[...X[24]||(X[24]=[o("option",{value:1},"1 s",-1),o("option",{value:2},"2 s",-1),o("option",{value:5},"5 s",-1),o("option",{value:10},"10 s",-1),o("option",{value:30},"30 s",-1),o("option",{value:60},"60 s",-1)])],512),[[hs,d(De),void 0,{number:!0}]]),o("button",{onClick:X[8]||(X[8]=(...ue)=>d(yr)&&d(yr)(...ue))},f(d(r).scopeFrozen?"继续":"冻结"),1),d(r).scope?(p(),h("button",{key:1,onClick:X[9]||(X[9]=(...ue)=>d(ae)&&d(ae)(...ue))},"保存最近 30 s")):R("",!0)]),o("div",lk,[o("label",ok,[X[27]||(X[27]=Y("回看 ",-1)),we(o("input",{type:"range","onUpdate:modelValue":X[10]||(X[10]=ue=>It(is)?is.value=ue:null),min:"0",max:60-d(De),step:"0.1"},null,8,ik),[[Re,d(is),void 0,{number:!0}]]),Y(" "+f(d(is).toFixed(1))+" s",1)]),o("button",{class:"plain",onClick:X[11]||(X[11]=ue=>is.value=0)},"最新")]),o("div",ak,[(p(!0),h(le,null,Ue(J.value,ue=>(p(),h("span",{key:ue,class:"tag"},[Y(f(ue)+" ",1),o("button",{class:"plain","aria-label":`移除 ${ue}`,onClick:qe=>J.value=J.value.filter(pt=>pt!==ue)},"×",8,rk)]))),128)),we(o("input",{"onUpdate:modelValue":X[12]||(X[12]=ue=>ve.value=ue),placeholder:"添加对象(名称、说明或地址)","aria-label":"添加示波对象",disabled:J.value.length>=8},null,8,uk),[[Re,ve.value]]),o("label",ck,[X[28]||(X[28]=Y("采样 ",-1)),we(o("select",{"onUpdate:modelValue":X[13]||(X[13]=ue=>me.value=ue)},[(p(),h(le,null,Ue([1,2,5,10,20,50,100],ue=>o("option",{key:ue,value:ue},f(1e3/ue)+" Hz",9,dk)),64))],512),[[hs,me.value,void 0,{number:!0}]])]),X[29]||(X[29]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!J.value.length||!d(r).connected||!d(r).link.ok||d(Xt)(),onClick:X[14]||(X[14]=ue=>Le(!0))},f(d(r).scope?"替换示波通道":"开始示波"),9,fk),d(r).scope?(p(),h("button",{key:0,disabled:d(Xt)(),onClick:X[15]||(X[15]=ue=>Le(!1))},"停止示波",8,pk)):R("",!0)]),d(Xt)()?(p(),h("p",mk,"现有示波继续采集;先结束任务,再更换或停止采样配置。")):R("",!0),ve.value?(p(),h("ul",vk,[(p(!0),h(le,null,Ue(Ae.value,ue=>(p(),h("li",{key:ue.name},[o("button",{class:"plain",onClick:qe=>Te(ue.name)},[Y(f(ue.name)+" ",1),o("span",bk,f(d(ii)(ue))+" "+f(d(Js)(ue)),1)],8,hk)]))),128))])):R("",!0),d(r).scope?(p(),h("p",gk,"设备上的示波配置:"+f(d(r).scope.objects.join("、"))+"。设备只有一组示波配置,电机页的示波也用它。",1)):R("",!0),pe.value?(p(),h("p",{key:3,class:Ve(pe.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(pe.value.text),3)):R("",!0),(p(!0),h(le,null,Ue(Ce.value,ue=>(p(),vt(rn,{key:ue.unit+ue.names.join(),series:he(ue),data:d(oe)(ue.names),tick:`${d(El)}:${d(is)}:${d(De)}`,"sync-key":"device",height:150,"frozen-at":d(r).scopeFrozen,"time-label":"t / s(设备时刻,相对最新样本)"},null,8,["series","data","tick","frozen-at"]))),128))])):R("",!0)]))}}),yk=Wt(_k,[["__scopeId","data-v-b404f0ae"]]);function fs(e,t,s=3){const n=typeof(e==null?void 0:e.overshoot_pct)=="number"&&Number.isFinite(e.overshoot_pct),l=e!=null&&e.invalid?`无效:${e.invalid}`:n?"有效":"无阶跃指标",a={available:n,valid:n&&!(e!=null&&e.invalid),validity:l,overshoot:"—",rise:"—",settling:"—",steady:"—"};if(!n||!e)return a;const c=(u,i,v)=>typeof u=="number"&&Number.isFinite(u)?`${u.toFixed(i)}${v}`:"—";return a.overshoot=c(e.overshoot_pct,1,"%"),a.steady=c(e.steady_error,s,t?` ${t}`:""),e.rise_s!==void 0&&(a.rise=e.rise_s==null||Number.isNaN(e.rise_s)?"未达到 90%":c(e.rise_s*1e3,1," ms")),e.settling_s!==void 0&&(a.settling=e.settling_s==null||Number.isNaN(e.settling_s)?"未进入带宽":c(e.settling_s*1e3,1," ms")),a}const kk={class:"page"},wk={class:"card"},$k={class:"row"},xk={class:"segmented",role:"radiogroup","aria-label":"来源"},Sk=["aria-checked","disabled"],Ck=["aria-checked"],Ak=["aria-expanded"],Tk=["value"],Ok={key:0,class:"source-device"},Ek={class:"row form"},Pk={class:"field"},Mk={class:"unit"},Nk={class:"field"},jk={class:"unit"},Rk={class:"field"},Vk=["min","max"],Dk={class:"field"},Lk=["min","max"],Ik={key:0,class:"field"},Uk={class:"field"},Fk={class:"field"},zk={class:"field",title:"阶跃后半程对仿真活塞施加的外力(仿真构建与 SIL)"},Hk={class:"field",title:"调节时间的绝对带宽;空为阶跃量的 2%"},Bk={class:"unit"},Wk={class:"row form"},Kk={class:"field grow"},Gk={class:"row form"},qk={class:"field grow"},Jk={class:"row form"},Yk={class:"field grow"},Zk={class:"field grow"},Qk={class:"row"},Xk={key:1,class:"caption","aria-live":"polite"},ew=["disabled"],tw={key:3,class:"caption",role:"status"},sw={key:4,class:"status-warning",role:"status"},nw={key:0,class:"caption"},lw={key:1,class:"status-warning"},ow={key:2,class:"list"},iw={class:"right num"},aw={class:"right num"},rw={class:"right num"},uw={class:"right num"},cw={key:3,class:"list"},dw={class:"num"},fw={class:"right num"},pw={class:"right num"},mw={class:"right num"},vw={class:"right num"},hw=Bt({__name:"ExperimentsPage",setup(e){const t=r.step.defaults,s=_e(r.connected||window.location.hash==="#experiments"?"device":"sil"),n=_e(!1),l=Dt({mode:"csp",start:50,target:70,settle:t.settle,seconds:t.seconds,rate:t.rate,stiffness:t.stiffness,damping:t.damping,push:t.push,band:"",set:"",model:"",sweep:"",sil:localStorage.getItem("eha.sil")??""}),a=I=>r.step.modes.find(g=>g.key===I),c=ge(()=>a(l.mode)??r.step.modes[0]),u=I=>r.step.limits[I]??[void 0,void 0],i=_e(null);function v(){return{mode:l.mode,start:l.start,target:l.target,settle:l.settle,seconds:l.seconds,rate:l.rate,stiffness:l.stiffness,damping:l.damping,push:l.push,band:l.band===""?null:Number(l.band),set:l.set.split(/[\n,]/).map(I=>I.trim()).filter(Boolean)}}async function b(I){I.currentTarget.blur(),i.value=null;const g=r.openedAt;if(s.value==="device"&&(r.state.faulted||r.state.latched)){i.value={ok:!1,text:"设备有故障或锁存保护,请先在设备状态面板中确认保护/故障,再运行试验"};return}try{s.value==="sil"?(localStorage.setItem("eha.sil",l.sil),await He("POST","/api/sil",{...v(),model:l.model,sweep:l.sweep,sil:l.sil||null})):await He("POST","/api/jobs",{kind:"step",opened_at:g,params:{...v(),ack:!1}})}catch(ee){i.value={ok:!1,text:ee.message}}}async function _(){const I=r.silJob;if(I)try{await He("POST","/api/sil/stop",{id:I.id})}catch(g){i.value={ok:!1,text:g.message}}}const k=ge(()=>{var I;return((I=r.job)==null?void 0:I.kind)==="step"&&r.job.state==="running"?r.job:r.lastStep}),$=ge(()=>s.value==="sil"?r.silJob:k.value),L=ge(()=>{var I;return s.value==="sil"?((I=r.silJob)==null?void 0:I.state)==="running":Xt()}),V=ge(()=>{var I,g;return s.value==="sil"&&!!((g=(I=$.value)==null?void 0:I.params)!=null&&g.sweep)}),j=ge(()=>{var I,g;return a((g=(I=$.value)==null?void 0:I.params)==null?void 0:g.mode)??c.value}),q=ge(()=>{var I;return s.value==="sil"?r.silRows:((I=$.value)==null?void 0:I.state)==="running"?r.liveStep:[]}),z=ge(()=>{var I,g;return q.value.length?q.value:((g=(I=$.value)==null?void 0:I.result)==null?void 0:g.rows)??[]}),K=_e(null),N=_e(""),B=_e(!1);it([s,()=>{var I;return(I=$.value)==null?void 0:I.id},()=>{var I;return(I=$.value)==null?void 0:I.state},()=>{var I,g;return(g=(I=$.value)==null?void 0:I.result)==null?void 0:g.record}],async(I,g,ee)=>{var ie,S;let Oe=!0;if(ee(()=>{Oe=!1}),K.value=null,N.value="",B.value=!1,s.value!=="sil"||V.value||!((S=(ie=$.value)==null?void 0:ie.result)!=null&&S.record)||$.value.state==="running")return;const je=$.value.result.samples;if(!(typeof je=="number"?z.value.length>=je:z.value.length>0)){B.value=!0;try{const[C]=await He("POST","/api/records/compare",{items:[{id:$.value.result.record}]});Oe&&(K.value=C)}catch(C){Oe&&(N.value=`曲线读取失败:${C.message}。可在“记录”页打开本次记录。`)}finally{Oe&&(B.value=!1)}}},{immediate:!0});const H=ge(()=>{var I,g,ee;return[{label:`实际(${(I=j.value)==null?void 0:I.label})`,slot:1,unit:(g=j.value)==null?void 0:g.unit},{label:"已发送目标",slot:1,dash:!0,unit:(ee=j.value)==null?void 0:ee.unit}]}),ce=ge(()=>{var I,g,ee;return`${s.value}:${(I=$.value)==null?void 0:I.id}:${(g=$.value)==null?void 0:g.state}:${z.value.length}:${((ee=K.value)==null?void 0:ee.t.length)??"-"}`});function fe(){var ee,Oe;if(K.value){const je=K.value;return[je.t.map(ie=>ie-je.settle),je.y,je.target]}const I=z.value,g=Number(((Oe=(ee=$.value)==null?void 0:ee.params)==null?void 0:Oe.settle)??l.settle);return!I.length||!j.value?[[],[],[]]:eu([I.map(je=>je.t_s-g),I.map(je=>je[j.value.track]),I.map(je=>je.target)],I.map(je=>!!je.display_gap))}const Ne=ge(()=>{var I,g,ee,Oe;return $.value&&$.value.state!=="running"&&(((g=(I=$.value.result)==null?void 0:I.restored)==null?void 0:g.length)??0)<(((Oe=(ee=$.value.params)==null?void 0:ee.set)==null?void 0:Oe.length)??0)}),re=ge(()=>{var I,g,ee;return fs((g=(I=$.value)==null?void 0:I.result)==null?void 0:g.metrics,((ee=j.value)==null?void 0:ee.unit)??"")}),E=ge(()=>{var I,g;return(((g=(I=$.value)==null?void 0:I.result)==null?void 0:g.members)??[]).map(ee=>{var Oe;return{...ee,display:fs(ee.metrics,((Oe=j.value)==null?void 0:Oe.unit)??"")}})}),U=ge(()=>{var I,g;return((I=K.value)==null?void 0:I.time_base)??((g=z.value[0])==null?void 0:g.time_source)??(s.value==="sil"?"cycles":"host")}),de=ge(()=>`t / s(从阶跃起,${{host:"主机接收时间",cycles:"SIL 周期时间",dc:"DC 时间"}[U.value]??U.value})`);function $e(){var Oe,je;const I=K.value,g=(I==null?void 0:I.settle)??Number(((je=(Oe=$.value)==null?void 0:Oe.params)==null?void 0:je.settle)??l.settle),ee=I?(I.markers??[]).map(ie=>({t:ie.t-g,error_code:ie.error_code})):z.value.map(ie=>({t:ie.t_s-g,error_code:ie.error_code}));return fi(ee,r.errors)}return(I,g)=>{var ee,Oe,je,ie,S,C,F,x,O,be;return p(),h("div",kk,[g[42]||(g[42]=o("h1",null,"试验",-1)),o("section",wk,[g[41]||(g[41]=o("h2",null,"阶跃试验",-1)),o("div",$k,[o("div",xk,[o("button",{role:"radio","aria-checked":s.value==="device",class:Ve({on:s.value==="device"}),disabled:!d(r).connected,onClick:g[0]||(g[0]=se=>s.value="device")},"当前设备",10,Sk),o("button",{role:"radio","aria-checked":s.value==="sil",class:Ve({on:s.value==="sil"}),onClick:g[1]||(g[1]=se=>s.value="sil")},"SIL 仿真",10,Ck)]),o("button",{"aria-expanded":n.value,onClick:g[2]||(g[2]=se=>n.value=!n.value)},f(n.value?"收起设备选择":"选择其他试验设备"),9,Ak),we(o("select",{"onUpdate:modelValue":g[3]||(g[3]=se=>l.mode=se),"aria-label":"模式"},[(p(!0),h(le,null,Ue(d(r).step.modes,se=>(p(),h("option",{key:se.key,value:se.key},f(se.label),9,Tk))),128))],512),[[hs,l.mode]])]),n.value?(p(),h("div",Ok,[st(wr,{"new-workspace":"",destination:"experiments"})])):R("",!0),o("div",Ek,[o("label",Pk,[g[18]||(g[18]=Y("起始 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[4]||(g[4]=se=>l.start=se)},null,512),[[Re,l.start,void 0,{number:!0}]]),o("span",Mk,f((ee=c.value)==null?void 0:ee.unit),1)]),o("label",Nk,[g[19]||(g[19]=Y("目标 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[5]||(g[5]=se=>l.target=se)},null,512),[[Re,l.target,void 0,{number:!0}]]),o("span",jk,f((Oe=c.value)==null?void 0:Oe.unit),1)]),o("label",Rk,[g[20]||(g[20]=Y("保持 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1",min:u("settle")[0],max:u("settle")[1],"onUpdate:modelValue":g[6]||(g[6]=se=>l.settle=se)},null,8,Vk),[[Re,l.settle,void 0,{number:!0}]]),g[21]||(g[21]=o("span",{class:"unit"},"s",-1))]),o("label",Dk,[g[22]||(g[22]=Y("记录 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1",min:u("seconds")[0],max:u("seconds")[1],"onUpdate:modelValue":g[7]||(g[7]=se=>l.seconds=se)},null,8,Lk),[[Re,l.seconds,void 0,{number:!0}]]),g[23]||(g[23]=o("span",{class:"unit"},"s",-1))]),l.mode==="csp"||l.mode==="impedance"?(p(),h("label",Ik,[g[24]||(g[24]=Y("插补 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[8]||(g[8]=se=>l.rate=se)},null,512),[[Re,l.rate,void 0,{number:!0}]]),g[25]||(g[25]=o("span",{class:"unit"},"mm/s",-1))])):R("",!0),l.mode==="impedance"?(p(),h(le,{key:1},[o("label",Uk,[g[26]||(g[26]=Y("刚度 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[9]||(g[9]=se=>l.stiffness=se)},null,512),[[Re,l.stiffness,void 0,{number:!0}]]),g[27]||(g[27]=o("span",{class:"unit"},"N/mm",-1))]),o("label",Fk,[g[28]||(g[28]=Y("阻尼 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[10]||(g[10]=se=>l.damping=se)},null,512),[[Re,l.damping,void 0,{number:!0}]]),g[29]||(g[29]=o("span",{class:"unit"},"N·s/mm",-1))])],64)):R("",!0),o("label",zk,[g[30]||(g[30]=Y("外力 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[11]||(g[11]=se=>l.push=se)},null,512),[[Re,l.push,void 0,{number:!0}]]),g[31]||(g[31]=o("span",{class:"unit"},"N",-1))]),o("label",Hk,[g[32]||(g[32]=Y("带宽 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":g[12]||(g[12]=se=>l.band=se),placeholder:"2%"},null,512),[[Re,l.band]]),o("span",Bk,f((je=c.value)==null?void 0:je.unit),1)])]),o("div",Wk,[o("label",Kk,[g[33]||(g[33]=Y("临时参数 ",-1)),we(o("input",{class:"wide","onUpdate:modelValue":g[13]||(g[13]=se=>l.set=se),placeholder:"名称=值,逗号分隔;试验前写入,结束后写回原值"},null,512),[[Re,l.set]])])]),s.value==="sil"?(p(),h(le,{key:1},[o("div",Gk,[o("label",qk,[g[34]||(g[34]=Y("SIL 程序 ",-1)),we(o("input",{class:"wide","onUpdate:modelValue":g[14]||(g[14]=se=>l.sil=se),placeholder:"空则取环境变量 EHA_SIL,或当前目录下的 build/host/eha_sil"},null,512),[[Re,l.sil]])])]),o("div",Jk,[o("label",Yk,[g[35]||(g[35]=Y("模型失配 ",-1)),we(o("input",{class:"wide","onUpdate:modelValue":g[15]||(g[15]=se=>l.model=se),placeholder:"例如 tau_s=0.02,area_mm2=900(只改对象,不改控制器所信的参数)"},null,512),[[Re,l.model]])]),o("label",Zk,[g[36]||(g[36]=Y("参数扫描 ",-1)),we(o("input",{class:"wide","onUpdate:modelValue":g[16]||(g[16]=se=>l.sweep=se),placeholder:"例如 position_kp=400,600,800(并行,不实时显示)"},null,512),[[Re,l.sweep]])])])],64)):R("",!0),o("div",Qk,[i.value?(p(),h("span",{key:0,class:Ve(i.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(i.value.text),3)):L.value&&V.value?(p(),h("span",Xk,"扫描中:"+f((ie=$.value)==null?void 0:ie.params.sweep)+",各取值的 SIL 进程并行,结束后列出结果。",1)):R("",!0),g[37]||(g[37]=o("span",{class:"spacer"},null,-1)),s.value==="sil"&&((S=d(r).silJob)==null?void 0:S.state)==="running"?(p(),h("button",{key:2,onClick:_},"停止 SIL")):R("",!0),o("button",{class:"primary",disabled:L.value||s.value==="device"&&!d(an)(),onClick:b},"运行",8,ew)]),V.value?R("",!0):(p(),vt(rn,{key:s.value,series:H.value,data:fe,tick:ce.value,markers:$e,"sync-key":`experiment-${U.value}`,height:230,"time-label":de.value},null,8,["series","tick","sync-key","time-label"])),B.value?(p(),h("p",tw,"正在从记录读取曲线…")):R("",!0),N.value?(p(),h("p",sw,[Y(f(N.value)+" ",1),o("button",{onClick:g[17]||(g[17]=se=>d(r).page="records")},"查看记录")])):R("",!0),$.value&&$.value.state!=="running"?(p(),h(le,{key:5},[o("p",{class:Ve($.value.state==="done"?"caption":"status-critical")},f($.value.end)+f($.value.error?":"+$.value.error:"")+f((C=$.value.result)!=null&&C.record?`;已存为记录 ${$.value.result.record}`:""),3),(x=(F=$.value.result)==null?void 0:F.restored)!=null&&x.length?(p(),h("p",nw,"临时参数 "+f($.value.result.restored.join("、"))+" 已写回试验前的值。",1)):R("",!0),Ne.value?(p(),h("p",lw,"临时参数 "+f($.value.params.set.join("、"))+" 中有没有写回或不能确定的(任务未正常结束,原因见上);到参数页读取当前值核对。",1)):R("",!0),(O=$.value.result)!=null&&O.metrics?(p(),h("table",ow,[g[38]||(g[38]=o("thead",null,[o("tr",null,[o("th",{class:"right"},"超调"),o("th",{class:"right"},"10–90% 上升"),o("th",{class:"right"},"调节"),o("th",{class:"right"},"稳态误差"),o("th",null,"有效性")])],-1)),o("tbody",null,[o("tr",null,[o("td",iw,f(re.value.overshoot),1),o("td",aw,f(re.value.rise),1),o("td",rw,f(re.value.settling),1),o("td",uw,f(re.value.steady),1),o("td",{class:Ve(re.value.valid?"":"status-warning")},f(re.value.validity),3)])])])):R("",!0),(be=$.value.result)!=null&&be.members?(p(),h("table",cw,[g[39]||(g[39]=o("thead",null,[o("tr",null,[o("th",null,"取值"),o("th",{class:"right"},"超调"),o("th",{class:"right"},"上升"),o("th",{class:"right"},"调节"),o("th",{class:"right"},"稳态误差"),o("th",null,"结果")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(E.value,se=>(p(),h("tr",{key:se.value},[o("td",dw,f($.value.result.sweep)+" = "+f(se.value),1),o("td",fw,f(se.display.overshoot),1),o("td",pw,f(se.display.rise),1),o("td",mw,f(se.display.settling),1),o("td",vw,f(se.display.steady),1),o("td",{class:Ve(se.error||!se.display.valid?"status-warning":"")},f(se.error??se.display.validity),3)]))),128))])])):R("",!0),g[40]||(g[40]=o("p",{class:"caption"},"在“记录”中可以与其他试验叠加对比、换带宽重算指标。",-1))],64)):R("",!0)])])}}}),bw=Wt(hw,[["__scopeId","data-v-193be104"]]);function gw(e,t,s){return e.filter(n=>n.persist&&(n.name in t||n.name in s)).filter(n=>typeof t[n.name]!="number"||typeof s[n.name]!="number"||!ll(n,t[n.name],s[n.name])).map(n=>({name:n.name,before:t[n.name],after:s[n.name]}))}function _w(e,t,s){const n=new Set(s);return{addresses:e.filter(t),missing:e.filter(l=>!t(l)&&!n.has(l))}}function yw(e,t){return t==null||Number.isNaN(t)||e.min==null&&e.max==null?"未判定":e.min!=null&&t<e.min||e.max!=null&&t>e.max?"不通过":"通过"}function nd(e){return e.includes("不通过")?"不通过":e.length&&e.every(t=>t==="通过")?"通过":"未判定"}const ld=ul(null);function kw(e){const t=_e(!0),s=new Set,n=ge(()=>{var _;return((_=r.identity)==null?void 0:_.serial_number)==null?"":r.identity.serial_number.toString(16).toUpperCase().padStart(8,"0")}),l=ge(()=>!!e.serial&&r.connected&&!!n.value&&n.value!==e.serial);cl(()=>{t.value=!1;for(const _ of s)_()});function a(_,k){return t.value&&r.connected&&!!n.value&&r.openedAt===_&&e.started===k&&!l.value}function c(_){return e.started===_.started&&e.serial===_.assemblySerial}function u(_){if(!n.value)throw new Error("设备身份未知,请等待连接识别完成后再开始或继续装配");if(!t.value||!r.connected||r.openedAt===null||r.openedAt!==_.openedAt||n.value!==_.deviceSerial||!c(_))throw new Error("设备连接或装配会话已切换,本次操作已结束,请核对当前设备")}function i(){const _={openedAt:r.openedAt,started:e.started,deviceSerial:n.value,assemblySerial:e.serial};return u(_),_}function v(_){if(u(_),!_.assemblySerial)throw new Error("请先开始本台装配,再进行读取或操作");if(!a(_.openedAt,_.started))throw new Error("当前设备与本次装配序列号不同,请接回原设备或开始新的一台")}function b(){const _=i();return v(_),_}return{active:t,cancelJobWaits:s,serial:n,mismatch:l,currentAssembly:a,sameAssembly:c,requireConnection:u,connectionContext:i,requireAssembly:v,assemblyContext:b}}const ww={class:"page"},$w={class:"row bar"},xw={class:"field"},Sw=["value","disabled"],Cw={class:"field"},Aw={class:"field"},Tw={class:"caption"},Ow=["disabled"],Ew={key:0,class:"status-warning",role:"alert"},Pw={key:1,class:"status-critical",role:"alert"},Mw={key:3,class:"caption","aria-live":"polite"},Nw=["inert"],jw={class:"steps"},Rw=["disabled","onClick"],Vw={class:"n"},Dw={class:"card work"},Lw=["disabled"],Iw={key:0,class:"status-warning"},Uw={key:1,class:"caption"},Fw={class:"kv"},zw={class:"caption"},Hw={class:"caption"},Bw={key:0,class:"status-warning"},Ww=["onUpdate:modelValue"],Kw={class:"row line"},Gw={class:"caption"},qw={class:"row line"},Jw={class:"field"},Yw={class:"row line"},Zw={class:"field"},Qw={class:"field"},Xw=["disabled"],e$={class:"row",role:"radiogroup","aria-label":"看到的动作"},t$=["value"],s$=["disabled"],n$={key:0,class:"status-ok"},l$={class:"status-warning"},o$=["onClick"],i$={class:"row line"},a$=["disabled"],r$={class:"field"},u$={class:"caption"},c$={class:"list"},d$=["onUpdate:modelValue","disabled","aria-label"],f$={class:"right num"},p$={class:"right num"},m$={class:"right num"},v$=["disabled","onClick"],h$={class:"row line"},b$=["disabled"],g$={key:0,class:"caption"},_$={class:"row line"},y$=["disabled"],k$={class:"field"},w$=["onUpdate:modelValue"],$$={class:"field"},x$=["onUpdate:modelValue","disabled"],S$={class:"field"},C$=["value","disabled","onInput"],A$=["disabled","onClick"],T$={class:"caption"},O$={class:"row"},E$=["disabled","onClick"],P$={key:0,class:"status-warning"},M$={class:"row line"},N$=["disabled"],j$={class:"field"},R$={class:"row line"},V$={class:"kv"},D$={class:"num"},L$={class:"field"},I$={class:"row line"},U$={class:"field"},F$={class:"field"},z$={class:"nest",viewBox:"0 0 600 70",role:"img","aria-label":"限位嵌套:机械端止、硬限位、软限位"},H$=["x","width"],B$=["x","width"],W$=["x","width"],K$={class:"caption"},G$={key:0,class:"status-warning"},q$={class:"row line"},J$={class:"row line"},Y$={class:"sub"},Z$=["disabled"],Q$={class:"caption"},X$=["disabled"],ex={key:0,class:"caption"},tx={key:1,class:"caption"},sx=["disabled"],nx={key:0,class:"caption"},lx={key:2,class:"list"},ox={class:"mono"},ix={class:"num"},ax={class:"num"},rx=["disabled","onClick"],ux={class:"row"},cx=["disabled"],dx={key:0},fx={key:0},px={class:"row"},mx={key:0,class:"list"},vx={class:"right num"},hx={class:"row line"},bx=["disabled"],gx={key:1,class:"caption"},Oo="eha.assembly",_x=Bt({__name:"AssemblyPage",setup(e){var ho,Fl,ml,Mn,zl;const t=["上电前","几何与方向","位移标定","压力标定","误差预算","限位","增益","保存与验收"],s=()=>({current:1,references:{position:"",pressure_a:"",pressure_b:"",error_budget:"",limits:""},s2:{x_mm:50,rpm:100,seconds:.5,before:null,during:null,after:null,observed:"",result:null,temporary_zero:null},s3:{points:[{x:0,c:null},{x:100,c:null},{x:50,c:null}],result:null},s4:{a:[{mpa:0,raw:null},{mpa:10,raw:null}],b:[{mpa:0,raw:null},{mpa:10,raw:null}],result:{a:null,b:null}},s6:{end_min_mm:null,end_max_mm:null,relief_mpa:null},s8:{diff:null,comparison:null,hostloss:null,steps:{},sign:{},loaded:!1,drive_check:!1},resetAt:null,resetResult:null,archived:null});let n={},l="";try{n=JSON.parse(localStorage.getItem(Oo)??"null")??{}}catch{l="已保存的装配进度无法读取,请重新核对本台设备。"}const a=s(),c=n.work??{},u=Dt({serial:"",scanned:"",started:0,recipe:"",operator:"",steps:{},records:[],checks:[!1,!1,!1,!1],...n,work:{...a,...c,references:{...a.references,...c.references},s2:{...a.s2,...c.s2},s3:{...a.s3,...c.s3},s4:{...a.s4,...c.s4,result:{...a.s4.result,...(ho=c.s4)==null?void 0:ho.result}},s6:{...a.s6,...c.s6},s8:{...a.s8,...c.s8}}});Array.isArray((Fl=u.steps[8])==null?void 0:Fl.calculations)&&(u.steps[8].calculations={criteria:u.steps[8].calculations}),it(u,()=>localStorage.setItem(Oo,JSON.stringify(u)),{deep:!0});const i=u.work;function v(){const P=i.resetResult,w=i.s8.comparison;return!!P&&["accepted","unknown"].includes(P.status)&&P.opened_at!=null&&P.serial===u.serial&&!!w&&w.serial===u.serial&&w.requested_at===P.requested_at&&w.requested_at===i.resetAt&&w.opened_at!=null&&w.opened_at!==P.opened_at}v()||(i.s8.diff=null,i.s8.comparison=null,((ml=u.steps[8])==null?void 0:ml.verdict)==="通过"&&Object.assign(u.steps[8],{verdict:"未判定",note:"旧进度缺少有效的复位请求与重连读回记录,请重新核对"})),it(ld,P=>{!P||u.serial!==P.serial||u.started!==P.started||i.resetAt!==P.result.requested_at||(i.resetResult=P.result,P.result.status==="rejected"&&(i.s8.diff=null,i.s8.comparison=null,delete u.steps[8]))},{immediate:!0,flush:"sync"});const b=_e([]),_=ge(()=>b.value.find(P=>P.id===u.recipe)),k=ge(()=>{var P;return((P=_.value)==null?void 0:P.steps)??[1,2,3,4,5,6,7,8]}),{active:$,cancelJobWaits:L,serial:V,mismatch:j,currentAssembly:q,sameAssembly:z,requireConnection:K,connectionContext:N,requireAssembly:B,assemblyContext:H}=kw(u),ce=_e(l?{ok:!1,text:l}:null),fe=_e(""),Ne=ge(()=>_.value?k.value.find(P=>{var w;return((w=u.steps[P])==null?void 0:w.verdict)==="不通过"}):void 0),re=P=>Ne.value===void 0||P<=Ne.value;async function E(){const P=N();if(ce.value=null,u.scanned.trim()&&u.scanned.trim().toUpperCase()!==V.value){ce.value={ok:!1,text:`填写的序列号 ${u.scanned} 与设备报告的 ${V.value} 不同;核对设备后再开始`};return}let w;try{w=(await He("POST","/api/actions/export",{opened_at:P.openedAt})).text}catch(ne){K(P),ce.value={ok:!1,text:`标定前参数快照未取得:${ne.message}`}}K(P),Object.assign(u,{serial:P.deviceSerial,started:Date.now()/1e3,steps:{},records:[],checks:[!1,!1,!1,!1],before:w,snapshot:void 0}),Object.assign(i,s(),{current:k.value[0]});for(const ne of Object.values(J))for(const ke of Object.keys(ne.drafts))delete ne.drafts[ke]}const U=P=>typeof P=="number"&&Number.isFinite(P)&&!Number.isInteger(P)?Number(P.toPrecision(5)):P;function de(P,w,ne={},ke){var Pe;if(!V.value){ce.value={ok:!1,text:"设备身份未知,无法记录装配结论"};return}u.steps[P]=JSON.parse(JSON.stringify({verdict:w,readings:{...((Pe=u.steps[P])==null?void 0:Pe.readings)??{},...ne},note:ke,...Ae(P),recorded_at:Date.now()/1e3}))}const $e=P=>ms(r.byName[P],r.state[P]),I=P=>{var w;return((w=r.byName[P])==null?void 0:w.unit)??""},g=P=>Number(r.state[P]);async function ee(P,w=H(),ne=()=>!0){const ke={};for(const Pe of P){B(w);const Me=await He("GET",`/api/objects/${Pe}`);if(B(w),!ne())return ke;Nl(Pe,Me.value,Me.source??"SDO 读取(时间未记录)",Me.read_at??null),ke[Pe]=Me.value}return B(w),ke}async function Oe(P,w,ne){const ke=await ee(P,w,ne),Pe=Object.fromEntries(Object.entries(ke).map(([Me,We])=>[Me,typeof We=="number"?We:NaN]));return ne()&&Object.assign(r.state,Pe),Pe}async function je(P,w={},ne=H()){var Pe;B(ne);const ke=await He("POST",`/api/actions/${P}`,{...w,opened_at:ne.openedAt});if(B(ne),ke.ok===!1)throw new Error(ke.message??((Pe=ke.abort)==null?void 0:Pe.meaning_zh)??"设备未受理本次操作");return ke}async function ie(P,w=1,ne=H()){fe.value="取值中…";try{const ke=await je("sample",{objects:P,seconds:w},ne);return Object.fromEntries(Object.entries(ke.stats).map(([Pe,Me])=>[Pe,{...Me,source:"SDO 取样",started_at:ke.started_at??null,finished_at:ke.finished_at??null}]))}finally{$.value&&z(ne)&&(fe.value="")}}async function S(P,w,ne=H()){B(ne);const ke=await He("POST",`/api/calibration/${P}`,w);return B(ne),ke}async function C(P){const w=u.started,ne=u.serial;ce.value=null;try{await P()}catch(ke){$.value&&u.started===w&&u.serial===ne&&(ce.value={ok:!1,text:ke.message})}}const F=(P,w=1)=>P==null||Number.isNaN(P)?"—":P.toFixed(w);async function x(P,w,ne=H()){var Me;if(B(ne),r.state.faulted||r.state.latched)throw new Error("设备有故障或锁存保护,请先在设备状态面板中确认保护/故障,再开始运行");const{id:ke}=await He("POST","/api/jobs",{kind:P,opened_at:ne.openedAt,params:{...w,ack:!1}});B(ne),fe.value="运行中…";try{(((Me=r.job)==null?void 0:Me.id)!==ke||r.job.state==="running")&&await new Promise((We,ot)=>{const at=()=>{Ye(),L.delete(at),ot(new Error("装配页已离开或设备会话已切换,请核对设备任务状态"))},Ye=it(()=>[r.job,r.openedAt,r.connected,u.started,u.serial],([ct])=>{try{B(ne)}catch{at();return}(ct==null?void 0:ct.id)===ke&&ct.state!=="running"&&(Ye(),L.delete(at),We())},{deep:!0});L.add(at)})}finally{$.value&&z(ne)&&(fe.value="")}B(ne);const Pe=r.job;if(Pe.state!=="done")throw new Error(`${Pe.end}${Pe.error?":"+Pe.error:""}`);return Pe}const O=()=>je("developer",{on:!0}),be=["0x2311"],se={2:["0x2200","0x2201","0x2202","0x2203","0x2231"],3:["0x2230","0x2231","0x2232"],4:["0x2240","0x2241","0x2242","0x2243","0x2244","0x2245","0x2246","0x2247","0x2248"],5:["0x224B"],6:["0x607D:1","0x607D:2","0x2213","0x2214","0x2210","0x2215","0x6080","0x6072","0x6076","0x2311","0x2216","0x2212","0x6085","0x6065","0x6066"],7:["0x2220","0x2221","0x2222","0x2223","0x2224","0x2225","0x2226","0x2227","0x2228","0x2229"]};function ft(P){var ke;const[w,ne]=P.split(":");return(ke=r.od.find(Pe=>Pe.index===Number(w)&&(Pe.sub??0)===Number(ne??0)))==null?void 0:ke.name}const Z=P=>_w(se[P],w=>!!ft(w),be),Je=P=>Z(P).addresses.map(ft).filter(w=>!!w),A=P=>Z(P).missing,D=P=>ft(P)??P,J=Object.fromEntries(Object.keys(se).map(P=>[P,ri()])),pe=P=>Go(J[P],Je(P)).length,me=P=>!!se[P]&&Je(P).some(w=>r.byName[w].developer)&&!r.state.developer;function ve(P,w){for(const[ne,ke]of Object.entries(w))oa(J[P],ne,String(ke))}function Ae(P){var Pe;const w=Object.fromEntries((se[P]?Je(P):[]).map(Me=>{var We,ot;return[Me,{value:r.state[Me]??null,read_at:((We=r.readAt)==null?void 0:We[Me])??null,source:((ot=r.source)==null?void 0:ot[Me])??"未记录读取来源"}]})),ne={inputs:{},observations:{},calculations:{},parameters:w},ke=Me=>Me?{...Me,input:void 0}:null;return P===1&&Object.assign(ne,{inputs:{checks:u.checks},observations:{params_source:r.state.params_source??null,param_check:r.state.param_check??null,sim_real_sensors:r.state.sim_real_sensors??null}}),P===2&&Object.assign(ne,{inputs:{approximate_position_mm:i.s2.x_mm,rpm:i.s2.rpm,seconds:i.s2.seconds,observed:i.s2.observed},observations:{before:i.s2.before,during:i.s2.during,after:i.s2.after},calculations:{direction:i.s2.result,temporary_zero:i.s2.temporary_zero}}),P===3&&Object.assign(ne,{inputs:{reference:i.references.position||null,positions_mm:i.s3.points.map(Me=>Me.x)},observations:{points:i.s3.points},calculations:ke(i.s3.result)}),P===4&&Object.assign(ne,{inputs:{reference_a:i.references.pressure_a||null,reference_b:i.references.pressure_b||null,pressures_a_mpa:i.s4.a.map(Me=>Me.mpa),pressures_b_mpa:i.s4.b.map(Me=>Me.mpa)},observations:{a:i.s4.a,b:i.s4.b,param_check:r.state.param_check??null},calculations:{a:ke(i.s4.result.a),b:ke(i.s4.result.b)}}),P===5&&Object.assign(ne,{inputs:{reference:i.references.error_budget||null},observations:Object.fromEntries(Dl.map(Me=>[Me,r.state[Me]??null]))}),P===6&&Object.assign(ne,{inputs:{...i.s6,reference:i.references.limits||null},observations:{position_error_um:r.state.position_error_um??null,param_check:r.state.param_check??null},calculations:mt.value}),P===7&&Object.assign(ne,{inputs:{judgement:"人工判定",records:u.records}}),P===8&&Object.assign(ne,{inputs:{criteria:((Pe=_.value)==null?void 0:Pe.criteria)??[]},observations:{params_before_reset:u.snapshot??null,reset_requested_at:i.resetAt,reset_result:i.resetResult,reset_comparison:i.s8.comparison,differences:i.s8.diff,hostloss:i.s8.hostloss,steps:i.s8.steps,drive_check:Bs.value?i.s8.drive_check:null},calculations:{criteria:Rt.value}}),JSON.parse(JSON.stringify(ne))}const Te=["液压回路已排气","机构可安全运动全行程","急停可用","限位为保守值"],xe=ge(()=>{var P;return((P=r.byName.sim_real_sensors)==null?void 0:P.bits)??[]}),ae=_e([]),De=ri();async function oe(){var w;const P=H();if(delete u.steps[1],await ee(["params_source","param_check","sim_real_sensors"].filter(ne=>r.byName[ne]),P),B(P),(w=_.value)!=null&&w.params_text){const ne=ta(_.value.params_text,new Set(r.od.map(ke=>ke.name)));ae.value=Object.entries(ne.values).map(([ke,Pe])=>({name:ke,text:Pe}))}de(1,u.checks.every(Boolean)?"通过":"待人工",{参数来源:$e("params_source"),一致性:$e("param_check")})}function Le(){for(const P of ae.value)oa(De,P.name,P.text)}async function Ce(){const P=H(),{openedAt:w,started:ne}=P,ke=i.s2.x_mm,Pe=()=>q(w,ne)&&i.s2.x_mm===ke;i.s2.temporary_zero=null,delete u.steps[2];const Me=await ie(["position_raw_count"],.3,P);if(!Pe()||(await ee([D("0x2230"),D("0x2232")],P),!Pe()))return;const We={count:Math.round(Me.position_raw_count.mean),x_um:ke*1e3,um_per_count:g(D("0x2230")),reversed:g(D("0x2232"))},ot=await S("reference",We,P);Pe()&&(i.s2.temporary_zero={input:We,raw_stats:Me.position_raw_count,result:ot,calculated_at:Date.now()/1e3},ve(2,{[D("0x2231")]:ot.reference_count}))}const he=["position_actual_um","pressure_a_mpa","pressure_b_mpa"];async function Be(){const P=H(),{rpm:w,seconds:ne}=i.s2;delete u.steps[2],Object.assign(i.s2,{before:null,during:null,after:null,observed:"",result:null});const ke=await ie(he,.3,P);B(P),i.s2.before=ke;const Pe=await x("run",{rpm:w,seconds:ne},P);B(P),i.s2.during=Pe.result;const Me=await ie(he,.3,P);B(P),i.s2.after=Me,await ee(["position_error_um","pressure_a_error_mpa","pressure_b_error_mpa",D("0x2202"),D("0x2203")],P)}const G=P=>{var ne;return!i.s2.before||!i.s2.after?0:((P==="position_actual_um"||(ne=i.s2.during)==null?void 0:ne[`${P}_max`])??i.s2.after[P].mean)-i.s2.before[P].mean};async function X(){const P=H();delete u.steps[2];const w=await S("direction",{rpm:i.s2.rpm,observed:i.s2.observed,motor_reversed:g(D("0x2202")),position_delta_um:G("position_actual_um"),position_error_um:g("position_error_um"),pressure_a_delta:G("pressure_a_mpa"),pressure_b_delta:G("pressure_b_mpa"),pressure_a_error:g("pressure_a_error_mpa"),pressure_b_error:g("pressure_b_error_mpa"),positive_channel:g(D("0x2203"))},P);B(P),i.s2.result=w,qe()}const ue={motor_reversed:"电机方向",position_reversed:"位移方向",pressure_positive_channel:"正向压力腔"};function qe(){const P=i.s2.result;if(!P)return;const w=Object.keys(P.suggest).length,ne=Object.keys(ue).filter(Pe=>!P.checked.includes(Pe)),ke=w||pe(2)||ne.length?"待人工":"通过";de(2,ke,{运行:`${i.s2.rpm} rpm × ${i.s2.seconds} s`,看到:i.s2.observed,位置测得:P.measured,位置变化_um:Math.round(G("position_actual_um")),A腔升高_MPa:G("pressure_a_mpa"),B腔升高_MPa:G("pressure_b_mpa")},w?Object.values(P.suggest).map(Pe=>Pe[1]).join(";"):pe(2)?"有草稿没有写入":ne.length?`没有判断:${ne.map(Pe=>ue[Pe]).join("、")}(没有看到动作、变化不超过误差或两腔同时变化)`:void 0)}const pt=()=>JSON.stringify(i.s3.points);let lt=0;function St(){lt++,delete u.steps[3]}function tt(){i.s3.result=null,St()}it(()=>i.s3.points,tt,{deep:!0,flush:"sync"}),it(()=>[J[3].drafts,J[3].writing,r.openedAt],St,{deep:!0,flush:"sync"}),((Mn=i.s3.result)==null?void 0:Mn.input)!==pt()&&tt();async function jt(P){const w=H(),ne=i.s3.points[P],ke=ne.x,Pe=r.openedAt,Me=u.started;ne.c=null,tt();const We=lt,ot=(await ie(["position_raw_count"],1,w)).position_raw_count;q(Pe,Me)&&lt===We&&i.s3.points[P]===ne&&ne.x===ke&&(ne.c=ot)}async function Kn(){const P=H(),[w,ne,ke]=i.s3.points,Pe=pt(),Me=r.openedAt,We=u.started;tt();const ot=lt,at=await S("position",{x1_um:w.x*1e3,c1:Math.round(w.c.mean),x2_um:ne.x*1e3,c2:Math.round(ne.c.mean),...ke.c?{x3_um:ke.x*1e3,c3:Math.round(ke.c.mean)}:{}},P);!q(Me,We)||lt!==ot||pt()!==Pe||(i.s3.result={...at,input:Pe},ve(3,{[D("0x2230")]:i.s3.result.um_per_count,[D("0x2232")]:i.s3.result.reversed,[D("0x2231")]:i.s3.result.reference_count}))}async function pn(){if(!$.value)return;const P=H(),w=i.s3.result,ne=i.s3.points[2],ke=pt(),Pe=r.openedAt,Me=u.started,We=lt,ot=()=>q(Pe,Me)&&lt===We&&i.s3.result===w&&pt()===ke&&!J[3].writing&&!pe(3);if(de(3,"待人工",{},"正在核对设备参数"),!w||w.input!==ke||!ne.c||pe(3)||J[3].writing){de(3,"待人工",{},!w||w.input!==ke?"请按当前取值重新计算":ne.c?"参数写入尚未完成":"还没有复核点");return}const at=[D("0x2230"),D("0x2231"),D("0x2232"),"position_error_um"],Ye=await Oe(at,P,ot);if(!ot())return;const ct=[w.um_per_count,w.reference_count,w.reversed];if(at.slice(0,3).some((nt,Gt)=>!r.byName[nt]||!Number.isFinite(Ye[nt])||!ll(r.byName[nt],ct[Gt],Ye[nt]))){de(3,"待人工",{},"设备标定参数与本次计算不一致,请核对并写入后重试");return}const{check_error_um:rs}=await S("position_check",{um_per_count:Ye[at[0]],reference_count:Ye[at[1]],reversed:Ye[at[2]],count:Math.round(ne.c.mean),x_um:ne.x*1e3},P);if(!ot())return;const te=Ye.position_error_um,Qe=!Number.isFinite(rs)||!Number.isFinite(te)||te<0?"待人工":Math.abs(rs)<=te?"通过":"不通过";de(3,Qe,{每计数_um:Ye[at[0]],反向:Ye[at[2]],零点:Ye[at[1]],复核误差_um:rs,测量误差_um:te},Qe==="待人工"?"复核结果或测量误差无效,请重新读取":void 0)}const Qs=["a","b"],Hs=P=>JSON.stringify(i.s4[P]);let As=0;function gs(){As++,delete u.steps[4]}function Gn(P){i.s4.result[P]=null,gs()}for(const P of Qs)it(()=>i.s4[P],()=>Gn(P),{deep:!0,flush:"sync"}),((zl=i.s4.result[P])==null?void 0:zl.input)!==Hs(P)&&Gn(P);it(()=>[J[4].drafts,J[4].writing,r.openedAt],gs,{deep:!0,flush:"sync"});function pi(P,w,ne){const ke=ne.target.value,Pe=Number(ke);i.s4[P][w].raw=ke.trim()&&Number.isInteger(Pe)?{mean:Pe,std:null,n:0,source:"人工输入"}:null}async function Ea(P,w){const ne=H(),ke=i.s4[P][w],Pe=r.openedAt,Me=u.started;ke.raw=null,Gn(P);const We=As,ot=(await ie([`pressure_${P}_raw`],1,ne))[`pressure_${P}_raw`];q(Pe,Me)&&As===We&&i.s4[P][w]===ke&&(ke.raw=ot)}function dl(P,w){const ne=P==="a"?8768:8772,ke=Pe=>D(`0x${(ne+Pe).toString(16).toUpperCase()}`);return{[ke(0)]:w.raw_min,[ke(1)]:w.raw_max,[ke(2)]:w.mpa_at_min,[ke(3)]:w.mpa_at_max}}async function Pa(P){const w=H(),[ne,ke]=i.s4[P],Pe=Hs(P),Me=r.openedAt,We=u.started;Gn(P);const ot=As;fe.value="计算中…";let at;try{at=await S("pressure",{raw1:Math.round(ne.raw.mean),mpa1:ne.mpa,raw2:Math.round(ke.raw.mean),mpa2:ke.mpa},w)}finally{$.value&&z(w)&&(fe.value="")}!q(Me,We)||As!==ot||Hs(P)!==Pe||(i.s4.result[P]={...at,input:Pe},ve(4,dl(P,at)))}async function mi(){var at;if(!$.value)return;const P=H(),w=r.openedAt,ne=u.started,ke=As,Pe=()=>q(w,ne)&&As===ke&&!J[4].writing&&!pe(4);if(de(4,"待人工",{},"正在核对设备参数"),Qs.some(Ye=>!i.s4.result[Ye]||i.s4.result[Ye].input!==Hs(Ye))){de(4,"待人工",{},"请先填写或采样 A、B 两腔的两点数据,并分别计算");return}if(pe(4)||J[4].writing){de(4,"待人工",{},"参数写入尚未完成");return}const Me=Object.assign({},...Qs.map(Ye=>dl(Ye,i.s4.result[Ye]))),We=await Oe([...Object.keys(Me),"param_check"],P,Pe);if(!Pe())return;if(Object.entries(Me).some(([Ye,ct])=>!r.byName[Ye]||!Number.isFinite(We[Ye])||!ll(r.byName[Ye],ct,We[Ye]))){de(4,"待人工",{},"设备压力标定参数与两点数据不一致,请核对并写入后重试");return}const ot=We.param_check;de(4,ot===0?"通过":"未判定",{一致性:ot,A:dl("a",i.s4.result.a),B:dl("b",i.s4.result.b)},Number.isFinite(ot)?ot?(at=r.byName.param_check)==null?void 0:at.desc:void 0:"设备未返回有效的 0x2028")}const Dl=["position_error_um","velocity_error_um_s","pressure_a_error_mpa","pressure_b_error_mpa","force_error_n"];async function En(){const P=H();delete u.steps[5],await ee(Dl,P),B(P),de(5,pe(5)?"待人工":"通过",Object.fromEntries(Dl.map(w=>[w,r.state[w]])),pe(5)?"有草稿没有写入":void 0)}function Yt(P){const w=D(P),ne=J[6].drafts[w];return ne!==void 0&&ne!==""?Number(ne):g(w)}const mt=ge(()=>{const P=We=>Yt(We)/1e3,w=r.state.position_error_um!==void 0,ne=w?g("position_error_um")/1e3:0,ke={soft:[P("0x607D:1"),P("0x607D:2")],hard:[P("0x2213"),P("0x2214")],end:[i.s6.end_min_mm??NaN,i.s6.end_max_mm??NaN],err:ne,known:w},Pe=i.s6.end_min_mm!=null&&i.s6.end_max_mm!=null&&i.s6.relief_mpa!=null&&w,Me=[{text:`软限位在硬限位之内,各留测量误差 ${ne.toFixed(3)} mm`,ok:ke.soft[0]-ne>=ke.hard[0]&&ke.soft[1]+ne<=ke.hard[1]},{text:"硬限位在机械端止之内,各留测量误差",ok:ke.hard[0]-ne>=ke.end[0]&&ke.hard[1]+ne<=ke.end[1]},{text:`压力上限 ${D("0x2212")} 低于安全阀设定`,ok:Yt("0x2212")<(i.s6.relief_mpa??NaN)}];return{...ke,ready:Pe,checks:Me}}),Pn=ge(()=>{const P=mt.value,w=[...P.end,...P.hard,...P.soft].filter(Number.isFinite),ne=Math.min(...w),ke=Math.max(...w);return{lo:ne,w:ke-ne||1}}),ds=P=>Number.isFinite(P)?10+(P-Pn.value.lo)/Pn.value.w*580:0;async function Ts(){var Pe;const P=H();delete u.steps[6],await ee(["param_check","position_error_um"],P),B(P);const w=g("param_check"),ne=mt.value,ke=!ne.ready||pe(6)?"待人工":w===0&&ne.checks.every(Me=>Me.ok)?"通过":"不通过";de(6,ke,{一致性:$e("param_check"),机械端止_mm:`${i.s6.end_min_mm??"—"}–${i.s6.end_max_mm??"—"}`,安全阀_MPa:i.s6.relief_mpa},ne.ready?pe(6)?"有草稿没有写入":w?(Pe=r.byName.param_check)==null?void 0:Pe.desc:void 0:"先填机械端止与安全阀设定,并读取测量误差")}async function qn(){const P=H(),w=r.od.filter(ke=>ke.persist&&!r.missing.includes(ke.name)).map(ke=>ke.name);i.s8.diff=null,i.s8.comparison=null,delete u.steps[8];const ne=await ee(w,P);B(P),u.snapshot=Object.fromEntries(w.map(ke=>[ke,Number(ne[ke])])),await je("save",{},P)}async function Jn(){var Pe;const P=H(),w=Date.now()/1e3;i.resetAt=w,i.s8.diff=null,i.s8.comparison=null,delete u.steps[8],i.resetResult={status:"pending",message:"复位请求处理中,完成情况需重连核对",serial:P.deviceSerial,opened_at:P.openedAt,requested_at:w},localStorage.setItem(Oo,JSON.stringify(u));let ne;try{ne=await He("POST","/api/actions/reset",{opened_at:P.openedAt})}catch(Me){ne={status:Me.status>=400&&Me.status<500?"rejected":"unknown",message:Me.message}}const ke={status:ne.status??(ne.ok?"accepted":"unknown"),message:ne.message??"复位响应未说明结果,请重连核对",serial:P.deviceSerial,opened_at:P.openedAt,requested_at:w};if(ld.value={serial:P.assemblySerial,started:P.started,result:ke},!$.value||!z(P)||i.resetAt!==w)try{const Me=JSON.parse(localStorage.getItem(Oo)??"null");(Me==null?void 0:Me.serial)===P.assemblySerial&&Me.started===P.started&&((Pe=Me.work)==null?void 0:Pe.resetAt)===w&&(Me.work.resetResult=ke,localStorage.setItem(Oo,JSON.stringify(Me)))}catch{}}const Ll=ge(()=>!!u.snapshot&&!!i.resetResult&&["accepted","unknown"].includes(i.resetResult.status)&&i.resetResult.opened_at!=null&&i.resetResult.requested_at===i.resetAt&&i.resetResult.serial===u.serial&&r.connected&&!!V.value&&V.value===u.serial&&r.openedAt!=null&&r.openedAt!==i.resetResult.opened_at);async function vi(){var Me;const P=H();if(!Ll.value)throw new Error(((Me=i.resetResult)==null?void 0:Me.status)==="rejected"?"本次复位请求已被拒绝,不能作为复位后比较;请核对后重新发起":!i.resetResult||i.resetResult.opened_at==null?"缺少本次复位请求的连接记录,请重新发起复位并重连后核对":"请等待复位响应,并在连接页重新连接同一台设备后再读回比较");const w=u.snapshot,ne=i.resetResult,ke=Object.keys(w??{});i.s8.diff=null,i.s8.comparison=null,delete u.steps[8];const Pe=await ee(ke,P);B(P),!(u.snapshot!==w||i.resetResult!==ne||!Ll.value)&&(i.s8.diff=gw(r.od,w??{},Object.fromEntries(ke.map(We=>[We,Number(Pe[We])]))),i.s8.comparison={serial:P.deviceSerial,requested_at:ne.requested_at,opened_at:P.openedAt,read_at:Date.now()/1e3,values:Pe})}const Il={csp:{amount:2,positional:!0,needsLoad:!1},csv:{amount:3,positional:!1,needsLoad:!1},impedance:{amount:1,positional:!0,needsLoad:!0},cst:{amount:.05,positional:!1,needsLoad:!0}},hi=P=>{var w;return((w=r.step.modes.find(ne=>ne.key===P))==null?void 0:w.unit)??""},Xs=P=>{var w;return((w=r.step.modes.find(ne=>ne.key===P))==null?void 0:w.label)??P};function Ma(P){const w=Il[P],ne=i.s8.sign[P]??1;return P==="cst"?`额定力的 ${ne>0?"+":"−"}5%`:`${ne>0?"+":"−"}${w.amount} ${hi(P)}`}async function fl(P){const w=H();delete i.s8.steps[P],delete u.steps[8];const ne=Il[P],ke=i.s8.sign[P]??1,Pe=i.s8.loaded,Me=r.openedAt,We=u.started;if(await ee(["position_actual_um","rated_force_mn"].filter(rs=>r.byName[rs]),w),!q(Me,We))return;const ot=g("position_actual_um")/1e3,at=P==="cst"?ne.amount*g("rated_force_mn")/1e3:ne.amount,Ye=ne.positional?{mode:P,start:ot,target:ot+ke*at,settle:1,seconds:1.5,rate:10}:{mode:P,start:0,target:ke*at,settle:1,seconds:1.5},ct=await x("step",Ye,w);q(Me,We)&&(i.s8.steps[P]={metrics:ct.result.metrics,reached:ct.result.target_reached,record:ct.result.record,params:ct.params,load_confirmed:Pe,started_at:ct.started,finished_at:ct.finished??null},i.s8.sign[P]=-ke,u.records.push(ct.result.record))}async function bi(){const P=H();i.s8.hostloss=null,delete u.steps[8];const w=await x("hostloss",{},P);B(P),i.s8.hostloss=w.result}const Bs=ge(()=>{var P;return((P=r.byName.max_force_permille)==null?void 0:P.access)==="ro"}),Kt=ge(()=>{const P=g("max_force_permille"),w=g("rated_force_mn");return Number.isFinite(P)&&Number.isFinite(w)?P*w/1e6:NaN}),Rt=ge(()=>{var P;return(((P=_.value)==null?void 0:P.criteria)??[]).map(w=>{var Me,We;const[ne,ke]=w.item.split("."),Pe=(We=(Me=i.s8.steps[ne])==null?void 0:Me.metrics)==null?void 0:We[ke];return{...w,value:Pe,verdict:yw(w,Pe)}})});function Ht(){var Me,We,ot,at;const P=i.s8,w=Object.keys(Il).map(Ye=>{const ct=P.steps[Ye];if(!(ct!=null&&ct.record)||!ct.metrics)return"未判定";const rs=fs(ct.metrics,hi(Ye));return ct.metrics.invalid?"不通过":rs.available?Ye==="csp"&&!ct.reached?"不通过":"通过":"未判定"}),ne=v(),Pe=[P.diff&&ne?P.diff.length?"不通过":((Me=i.resetResult)==null?void 0:Me.status)==="accepted"?"通过":"未判定":"未判定",P.hostloss?P.hostloss.ok?"通过":"不通过":"未判定",...w,...Rt.value.map(Ye=>Ye.verdict)];de(8,nd(Pe),{复位请求响应:((We=i.resetResult)==null?void 0:We.message)??"未记录",重连读回差异:ne?((ot=P.diff)==null?void 0:ot.length)??"未比较":"未比较",失联:P.hostloss?`${P.hostloss.state},0x${P.hostloss.error.toString(16).toUpperCase()}(${P.hostloss.expected})`:"未检查",驱动器电流限核对:Bs.value?P.drive_check?"已核对":"未检查":"不适用",CSP到位位10:P.steps.csp?P.steps.csp.reached?"置位":"未置位":"未检查",...Object.fromEntries(Object.entries(P.steps).map(([Ye,ct])=>{var rs,te;return[`${Xs(Ye)}阶跃`,`超调 ${F((rs=ct.metrics)==null?void 0:rs.overshoot_pct,1)}%,调节 ${((te=ct.metrics)==null?void 0:te.settling_s)==null?"未进入带宽":F(ct.metrics.settling_s*1e3,0)+" ms"}`]})),...Object.fromEntries(Rt.value.map(Ye=>[Ye.label??Ye.item,`${U(Ye.value)??"—"}(${Ye.verdict})`]))},ne&&((at=i.resetResult)==null?void 0:at.status)==="unknown"?"复位请求结果未知;已在同设备新连接读回,尚未确认复位":void 0)}async function Ul(){var te,Qe;const P=H(),w=r.openedAt,ne=u.started,ke=lt,Pe=As,Me=()=>q(w,ne)&&lt===ke&&As===Pe;if(!Me()||k.value.includes(3)&&(i.s3.result||u.steps[3])&&(await pn(),!Me())||k.value.includes(4)&&(i.s4.result.a||i.s4.result.b||u.steps[4])&&(await mi(),!Me()))return;(Object.keys(i.s8.steps).length||i.s8.hostloss||i.s8.diff)&&Ht();const We=(await je("export",{},P)).text;if(!Me())return;const ot=ta(We,new Set(r.od.map(nt=>nt.name)));function at(nt,Gt){var vl;((vl=u.steps[nt])==null?void 0:vl.verdict)==="通过"&&(ot.errors.length||Object.entries(Gt).some(([mn,bo])=>!r.byName[mn]||!Number.isFinite(Number(ot.values[mn]))||!ll(r.byName[mn],bo,Number(ot.values[mn]))))&&de(nt,"待人工",{},"存档参数与本步核对的标定参数不一致或缺项,请重新核对")}i.s3.result&&at(3,{[D("0x2230")]:i.s3.result.um_per_count,[D("0x2231")]:i.s3.result.reference_count,[D("0x2232")]:i.s3.result.reversed}),i.s4.result.a&&i.s4.result.b&&at(4,Object.assign({},...Qs.map(nt=>dl(nt,i.s4.result[nt]))));const Ye=k.value.map(nt=>({n:nt,title:t[nt-1],...u.steps[nt]??{...Ae(nt),verdict:"未判定",readings:{}}})),ct=nd(Ye.map(nt=>nt.verdict==="待人工"?"未判定":nt.verdict)),rs=await He("POST","/api/archive",{serial:u.serial,recipe:((te=_.value)==null?void 0:te.name)??"单台调试",operator:u.operator,firmware:((Qe=r.identity)==null?void 0:Qe.version)??"",tool_version:r.toolVersion,identity:r.identity,params_before:u.before,params_after:We,steps:Ye,records:u.records,verdict:ct,manual:Te.filter((nt,Gt)=>u.checks[Gt]),references:i.references});Me()&&(i.archived=rs.record)}Fs(async()=>{const P=r.openedAt;b.value=await He("GET","/api/recipes").catch(()=>[]),$.value&&r.connected&&r.openedAt===P&&!u.serial&&await C(E)});const Os=P=>P==="通过"?"status-ok":P==="不通过"?"status-critical":P?"status-warning":"secondary",pl=ge(()=>g("firmware_slot")===255);return(P,w)=>{var ne,ke,Pe,Me,We,ot,at,Ye,ct,rs;return p(),h("div",ww,[w[97]||(w[97]=o("h1",null,"装配",-1)),o("div",$w,[o("label",xw,[w[36]||(w[36]=Y("配方 ",-1)),we(o("select",{"onUpdate:modelValue":w[0]||(w[0]=te=>u.recipe=te),"aria-label":"配方"},[w[35]||(w[35]=o("option",{value:""},"单台调试(全部步骤)",-1)),(p(!0),h(le,null,Ue(b.value,te=>(p(),h("option",{key:te.id,value:te.id,disabled:!!te.error},f(te.name??te.id)+f(te.error?"(无法读取)":""),9,Sw))),128))],512),[[hs,u.recipe]])]),o("label",Cw,[w[37]||(w[37]=Y("序列号 ",-1)),we(o("input",{"onUpdate:modelValue":w[1]||(w[1]=te=>u.scanned=te),placeholder:"扫码或输入;空则取设备报告的","aria-label":"扫码或输入序列号"},null,512),[[Re,u.scanned]])]),o("label",Aw,[w[38]||(w[38]=Y("操作员 ",-1)),we(o("input",{"onUpdate:modelValue":w[2]||(w[2]=te=>u.operator=te),placeholder:"姓名或工号"},null,512),[[Re,u.operator]])]),o("span",Tw,"本次 "+f(u.serial||"—"),1),w[39]||(w[39]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:w[3]||(w[3]=te=>C(E)),disabled:!d(r).connected||!d(V)||d(Xt)()},"开始新的一台",8,Ow)]),d(r).connected&&!d(V)?(p(),h("p",Ew,"设备身份未知,请等待识别完成后再开始或继续装配。")):R("",!0),d(j)?(p(),h("p",Pw,"当前设备序列号 "+f(d(V))+" 与本次标定开始时("+f(u.serial)+")不同,不能继续;接回原设备,或开始新的一台。",1)):R("",!0),ce.value?(p(),h("p",{key:2,class:Ve(ce.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(ce.value.text),3)):R("",!0),fe.value?(p(),h("p",Mw,f(fe.value),1)):R("",!0),o("div",{class:Ve(["layout",{off:d(j)||!d(r).connected||!d(V)}]),inert:d(j)||!d(r).connected||!d(V)||void 0},[o("ol",jw,[(p(!0),h(le,null,Ue(k.value,te=>{var Qe,nt;return p(),h("li",{key:te},[o("button",{class:Ve(["plain",{on:d(i).current===te}]),disabled:!re(te),onClick:Gt=>d(i).current=te},[o("span",Vw,f(te),1),Y(f(t[te-1]),1),w[40]||(w[40]=o("span",{class:"spacer"},null,-1)),o("span",{class:Ve(Os((Qe=u.steps[te])==null?void 0:Qe.verdict))},f(((nt=u.steps[te])==null?void 0:nt.verdict)??""),3)],10,Rw)])}),128))]),o("section",Dw,[o("h2",null,[Y(f(d(i).current)+" "+f(t[d(i).current-1])+" ",1),w[41]||(w[41]=o("span",{class:"spacer"},null,-1)),se[d(i).current]&&me(d(i).current)?(p(),h("button",{key:0,disabled:!d(an)(),onClick:w[4]||(w[4]=te=>C(async()=>{await O()}))},"进入开发者模式",8,Lw)):R("",!0)]),se[d(i).current]&&A(d(i).current).length?(p(),h("p",Iw,"对象字典中没有 "+f(A(d(i).current).join("、"))+":工具包与本页不一致。",1)):R("",!0),(ne=u.steps[d(i).current])!=null&&ne.note?(p(),h("p",Uw,"上次记录:"+f((ke=u.steps[d(i).current])==null?void 0:ke.verdict)+","+f((Pe=u.steps[d(i).current])==null?void 0:Pe.note),1)):R("",!0),d(i).current===1?(p(),h(le,{key:2},[o("dl",Fw,[w[43]||(w[43]=o("dt",null,"固件",-1)),o("dd",null,"运行槽 "+f(d(r).state.slot_text??"—")+",槽 A "+f(d(r).state.firmware_slot_a_version_text??"—")+",槽 B "+f(d(r).state.firmware_slot_b_version_text??"—"),1),w[44]||(w[44]=o("dt",null,"参数来源 0x2025",-1)),o("dd",null,[Y(f($e("params_source")),1),o("span",zw,"("+f((Me=d(r).byName.params_source)==null?void 0:Me.desc)+")",1)]),w[45]||(w[45]=o("dt",null,"一致性 0x2028",-1)),o("dd",{class:Ve(g("param_check")?"status-warning":"")},[Y(f($e("param_check")),1),o("span",Hw,"("+f((We=d(r).byName.param_check)==null?void 0:We.desc)+")",1)],2),w[46]||(w[46]=o("dt",null,"测量来源 0x2F02",-1)),o("dd",null,[(p(!0),h(le,null,Ue(xe.value,(te,Qe)=>(p(),h("span",{key:te},"位 "+f(Qe)+" "+f(te)+" = "+f(g("sim_real_sensors")>>Qe&1)+" ",1))),128)),w[42]||(w[42]=o("span",{class:"caption"},"仿真构建中置位的用实物、其余用对象模型;非仿真构建不看本对象,全部为实物。",-1))])]),g("sim_real_sensors")&1?(p(),h("p",Bw,"位移改用实物(0x2F02 位 0 = 1):位置不随电机运动变化,只在虚拟电机构建上这样用。")):R("",!0),w[49]||(w[49]=o("h3",null,"上电前确认(人工)",-1)),(p(),h(le,null,Ue(Te,(te,Qe)=>o("label",{key:te,class:"row"},[we(o("input",{type:"checkbox","onUpdate:modelValue":nt=>u.checks[Qe]=nt},null,8,Ww),[[Fn,u.checks[Qe]]]),Y(" "+f(te),1)])),64)),o("div",Kw,[w[47]||(w[47]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",onClick:w[5]||(w[5]=te=>C(oe))},"读取并记录")]),ae.value.length?(p(),h(le,{key:1},[o("h3",null,"配方参数("+f((ot=_.value)==null?void 0:ot.params)+")",1),o("div",{class:"row"},[o("button",{onClick:Le},"列为草稿"),w[48]||(w[48]=o("span",{class:"caption"},"逐项核对后写入。",-1))]),st(kn,{names:ae.value.map(te=>te.name),model:d(De)},null,8,["names","model"])],64)):R("",!0)],64)):d(i).current===2?(p(),h(le,{key:3},[o("p",Gw,"未标定时位置可能落在软限外,包络只允许朝内运动;先按杆的大致位置写临时零点 "+f(D("0x2231"))+"。方向判断比较运行前后的位置变化与运行中的压力升高,各与测量误差比较。 仿真构建中位移与压力来自模型,方向判断恒为一致,“建议修改”只能在实物上出现。",1),o("div",qw,[o("label",Jw,[w[50]||(w[50]=Y("杆的大致位置 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":w[6]||(w[6]=te=>d(i).s2.x_mm=te)},null,512),[[Re,d(i).s2.x_mm,void 0,{number:!0}]]),w[51]||(w[51]=o("span",{class:"unit"},"mm",-1))]),o("button",{onClick:w[7]||(w[7]=te=>C(Ce))},"取计数并算临时零点")]),o("div",Yw,[o("label",Zw,[w[52]||(w[52]=Y("转速 ",-1)),we(o("input",{class:"num",type:"number","onUpdate:modelValue":w[8]||(w[8]=te=>d(i).s2.rpm=te)},null,512),[[Re,d(i).s2.rpm,void 0,{number:!0}]]),w[53]||(w[53]=o("span",{class:"unit"},"rpm",-1))]),o("label",Qw,[w[54]||(w[54]=Y("时长 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1","onUpdate:modelValue":w[9]||(w[9]=te=>d(i).s2.seconds=te)},null,512),[[Re,d(i).s2.seconds,void 0,{number:!0}]]),w[55]||(w[55]=o("span",{class:"unit"},"s",-1))]),o("button",{class:"primary",disabled:!d(an)(),onClick:w[10]||(w[10]=te=>C(Be))},"低速短时运行",8,Xw)]),d(i).s2.after?(p(),h(le,{key:0},[o("p",null,"位置变化 "+f(F(G("position_actual_um")/1e3,3))+" mm(误差 "+f(F(g("position_error_um")/1e3,3))+"),运行中 A 腔升高 "+f(F(G("pressure_a_mpa"),3))+" MPa、B 腔 "+f(F(G("pressure_b_mpa"),3))+" MPa(误差 "+f(F(g("pressure_a_error_mpa"),3))+")",1),o("div",e$,[w[56]||(w[56]=o("span",null,"看到活塞:",-1)),(p(),h(le,null,Ue(["伸出","缩回","没动"],te=>o("label",{key:te,class:"row"},[we(o("input",{type:"radio",value:te,"onUpdate:modelValue":w[11]||(w[11]=Qe=>d(i).s2.observed=Qe)},null,8,t$),[[i1,d(i).s2.observed]]),Y(" "+f(te),1)])),64)),o("button",{disabled:!d(i).s2.observed,onClick:w[12]||(w[12]=te=>C(X))},"判断",8,s$)]),d(i).s2.result?(p(),h(le,{key:0},[o("p",null,"位置测得:"+f(d(i).s2.result.measured)+";已判断:"+f(d(i).s2.result.checked.map(te=>ue[te]).join("、")||"无"),1),!Object.keys(d(i).s2.result.suggest).length&&d(i).s2.result.checked.length===3?(p(),h("p",n$,"方向与参数一致。")):R("",!0),(p(!0),h(le,null,Ue(d(i).s2.result.suggest,(te,Qe)=>(p(),h("div",{key:Qe,class:"row"},[o("span",l$,"建议修改 "+f(Qe)+":"+f(te[1]),1),te[0]!==null?(p(),h("button",{key:0,onClick:nt=>ve(2,{[Qe]:te[0]})},"列为草稿("+f(te[0])+")",9,o$)):R("",!0)]))),128))],64)):R("",!0)],64)):R("",!0),st(kn,{names:Je(2),model:d(J)[2]},null,8,["names","model"]),o("div",i$,[w[57]||(w[57]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!d(i).s2.result,onClick:qe},"写入后记录本步",8,a$)])],64)):d(i).current===3?(p(),h(le,{key:4},[o("label",r$,[w[58]||(w[58]=Y("量具或标准资料 ",-1)),we(o("input",{"onUpdate:modelValue":w[13]||(w[13]=te=>d(i).references.position=te),placeholder:"名称、编号、规格或资料版本"},null,512),[[Re,d(i).references.position]])]),o("p",u$,"在两个已知位置读原始计数(各取 1 s 均值),第三个位置复核,误差不超过位置测量最大误差为通过。换算式见 "+f(D("0x2231"))+":"+f((at=d(r).byName[D("0x2231")])==null?void 0:at.desc)+" 位移来自模型时,原始计数按控制器自己的标定反算,只能验证流程与计算;0x2F02 位 0 = 1 并以 ehatool brt27-sim 给出已知计数时可验证接收与换算。",1),o("table",c$,[w[60]||(w[60]=o("thead",null,[o("tr",null,[o("th"),o("th",null,"已知位置"),o("th",{class:"right"},"计数均值"),o("th",{class:"right"},"标准差"),o("th",{class:"right"},"样本"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(d(i).s3.points,(te,Qe)=>{var nt,Gt,vl;return p(),h("tr",{key:Qe},[o("td",null,f(["第一点","第二点","复核点"][Qe]),1),o("td",null,[we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":mn=>te.x=mn,disabled:!!fe.value,"aria-label":`${["第一点","第二点","复核点"][Qe]}已知位置`},null,8,d$),[[Re,te.x,void 0,{number:!0}]]),w[59]||(w[59]=Y(" mm",-1))]),o("td",f$,f(F((nt=te.c)==null?void 0:nt.mean,1)),1),o("td",p$,f(F((Gt=te.c)==null?void 0:Gt.std,1)),1),o("td",m$,f(((vl=te.c)==null?void 0:vl.n)??"—"),1),o("td",null,[o("button",{disabled:!!fe.value,onClick:mn=>C(()=>jt(Qe))},"取值",8,v$)])])}),128))])]),o("div",h$,[o("button",{class:"primary",disabled:!!fe.value||!d(i).s3.points[0].c||!d(i).s3.points[1].c,onClick:w[14]||(w[14]=te=>C(Kn))},"计算并列为草稿",8,b$),d(i).s3.result?(p(),h("span",g$,[Y("每计数 "+f(F(d(i).s3.result.um_per_count,4))+" µm,"+f(d(i).s3.result.reversed?"计数增大对应缩回":"计数增大对应伸出")+",零点 "+f(d(i).s3.result.reference_count),1),d(i).s3.result.check_error_um!=null?(p(),h(le,{key:0},[Y(";复核误差 "+f(F(d(i).s3.result.check_error_um,0))+" µm",1)],64)):R("",!0)])):R("",!0)]),st(kn,{names:Je(3),model:d(J)[3]},null,8,["names","model"]),o("div",_$,[w[61]||(w[61]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!!fe.value||!d(i).s3.result,onClick:w[15]||(w[15]=te=>C(pn))},"写入后记录本步",8,y$)])],64)):d(i).current===4?(p(),h(le,{key:5},[w[67]||(w[67]=o("p",{class:"caption"},"A、B 腔各填两点的压力和原始值:可手填传感器出厂数据,或在已知压力(标准表、卸压后的零压)下取原始值。分别计算后核对下表;斜率是否为正以设备的 0x2028 为准。 压力来自模型时只能验证流程与计算。",-1)),(p(),h(le,null,Ue(["a","b"],te=>o("div",{key:te},[o("h3",null,f(te.toUpperCase())+" 腔",1),o("label",k$,[w[62]||(w[62]=Y("标准表或出厂资料 ",-1)),we(o("input",{"onUpdate:modelValue":Qe=>d(i).references[`pressure_${te}`]=Qe,placeholder:"名称、编号、规格或资料版本"},null,8,w$),[[Re,d(i).references[`pressure_${te}`]]])]),(p(!0),h(le,null,Ue(d(i).s4[te],(Qe,nt)=>(p(),h("div",{key:nt,class:"row line"},[o("label",$$,[w[63]||(w[63]=Y("压力 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":Gt=>Qe.mpa=Gt,disabled:!!fe.value},null,8,x$),[[Re,Qe.mpa,void 0,{number:!0}]]),w[64]||(w[64]=o("span",{class:"unit"},"MPa",-1))]),o("label",S$,[w[65]||(w[65]=Y("原始值 ",-1)),o("input",{class:"num",type:"number",step:"1",value:Qe.raw?Math.round(Qe.raw.mean):"",disabled:!!fe.value,onInput:Gt=>pi(te,nt,Gt)},null,40,C$)]),o("button",{disabled:!!fe.value,onClick:Gt=>C(()=>Ea(te,nt))},"取原始值",8,A$),o("span",T$,f(Qe.raw?Qe.raw.n?`均值 ${F(Qe.raw.mean,1)},标准差 ${F(Qe.raw.std,1)},${Qe.raw.n} 个`:"人工输入":""),1)]))),128)),o("div",O$,[o("button",{disabled:!!fe.value||!d(i).s4[te][0].raw||!d(i).s4[te][1].raw,onClick:Qe=>C(()=>Pa(te))},"计算并列为草稿",8,E$),d(i).s4.result[te]&&!d(i).s4.result[te].slope_ok?(p(),h("span",P$,"压力随原始值下降:写入后 0x2028 会报斜率不为正。")):R("",!0)])])),64)),st(kn,{names:Je(4),model:d(J)[4]},null,8,["names","model"]),w[68]||(w[68]=o("p",{class:"caption"},"设备当前值已与两点计算一致时,可放弃相同草稿,直接读取核对并记录。",-1)),o("div",M$,[w[66]||(w[66]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!!fe.value,onClick:w[16]||(w[16]=te=>C(mi))},"读回参数与 0x2028 并记录",8,N$)])],64)):d(i).current===5?(p(),h(le,{key:6},[o("label",j$,[w[69]||(w[69]=Y("传感器手册或标准资料 ",-1)),we(o("input",{"onUpdate:modelValue":w[17]||(w[17]=te=>d(i).references.error_budget=te),placeholder:"名称、规格或资料版本"},null,512),[[Re,d(i).references.error_budget]])]),w[71]||(w[71]=o("p",{class:"caption"},"传感器的满量程与精度由型号的设备描述给出,不在现场填写;有密封摩擦估计时写入未建模的力,再读设备给出的各测量最大误差,供下一步设定限位。",-1)),st(kn,{names:Je(5),model:d(J)[5]},null,8,["names","model"]),o("div",R$,[w[70]||(w[70]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:w[18]||(w[18]=te=>C(En))},"读取最大误差并记录")]),o("dl",V$,[(p(),h(le,null,Ue(Dl,te=>(p(),h(le,{key:te},[o("dt",null,f(d(r).byName[te]?d(Js)(d(r).byName[te]):te),1),o("dd",D$,f($e(te))+" "+f(I(te)),1)],64))),64))])],64)):d(i).current===6?(p(),h(le,{key:7},[o("label",L$,[w[72]||(w[72]=Y("量具与安全阀资料 ",-1)),we(o("input",{"onUpdate:modelValue":w[19]||(w[19]=te=>d(i).references.limits=te),placeholder:"名称、编号、规格或资料版本"},null,512),[[Re,d(i).references.limits]])]),o("div",I$,[o("label",U$,[w[73]||(w[73]=Y("机械端止 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":w[20]||(w[20]=te=>d(i).s6.end_min_mm=te),"aria-label":"机械端止下端"},null,512),[[Re,d(i).s6.end_min_mm,void 0,{number:!0}]]),w[74]||(w[74]=Y("–",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":w[21]||(w[21]=te=>d(i).s6.end_max_mm=te),"aria-label":"机械端止上端"},null,512),[[Re,d(i).s6.end_max_mm,void 0,{number:!0}]]),w[75]||(w[75]=o("span",{class:"unit"},"mm",-1))]),o("label",F$,[w[76]||(w[76]=Y("安全阀设定 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":w[22]||(w[22]=te=>d(i).s6.relief_mpa=te)},null,512),[[Re,d(i).s6.relief_mpa,void 0,{number:!0}]]),w[77]||(w[77]=o("span",{class:"unit"},"MPa",-1))]),o("button",{onClick:w[23]||(w[23]=te=>C(()=>ee([...Je(6),"position_error_um"])))},"读取当前值")]),(p(),h("svg",z$,[Number.isFinite(mt.value.end[0]+mt.value.end[1])?(p(),h("rect",{key:0,x:ds(mt.value.end[0]),y:"8",width:Math.max(0,ds(mt.value.end[1])-ds(mt.value.end[0])),height:"54",rx:"4",class:"end"},null,8,H$)):R("",!0),o("rect",{x:ds(mt.value.hard[0]),y:"20",width:Math.max(0,ds(mt.value.hard[1])-ds(mt.value.hard[0])),height:"30",rx:"4",class:"hard"},null,8,B$),o("rect",{x:ds(mt.value.soft[0]),y:"28",width:Math.max(0,ds(mt.value.soft[1])-ds(mt.value.soft[0])),height:"14",rx:"3",class:"soft"},null,8,W$)])),o("p",K$,"外框机械端止 "+f(F(mt.value.end[0],3))+"–"+f(F(mt.value.end[1],3))+" mm,中框硬限位 "+f(F(mt.value.hard[0],3))+"–"+f(F(mt.value.hard[1],3))+" mm,内框软限位 "+f(F(mt.value.soft[0],3))+"–"+f(F(mt.value.soft[1],3))+" mm(有草稿时按草稿)。",1),mt.value.known?R("",!0):(p(),h("p",G$,"还没有读取位置测量最大误差,裕量按 0 显示。")),(p(!0),h(le,null,Ue(mt.value.checks,te=>(p(),h("p",{key:te.text,class:Ve(te.ok?"status-ok":"status-warning")},f(te.ok?"满足":"不满足")+":"+f(te.text),3))),128)),w[79]||(w[79]=o("p",{class:"caption"},"速度、力与快停减速度的一致性由设备检查(0x2028),写入后读取。",-1)),st(kn,{names:Je(6),model:d(J)[6]},null,8,["names","model"]),o("div",q$,[w[78]||(w[78]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:w[24]||(w[24]=te=>C(Ts))},"写入后读 0x2028 并记录")])],64)):d(i).current===7?(p(),h(le,{key:8},[w[81]||(w[81]=o("p",{class:"caption"},"依次整定 CSV、CSP、CST:在试验页做小幅阶跃与叠加对比;CST 与阻抗需要负载或对顶。出现超调、振荡或超速故障时先降增益。",-1)),o("div",J$,[o("button",{onClick:w[25]||(w[25]=te=>d(r).page="experiments")},"打开试验页"),w[80]||(w[80]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:w[26]||(w[26]=te=>de(7,"待人工",{},"整定未完成"))},"记录:未完成"),o("button",{onClick:w[27]||(w[27]=te=>de(7,"通过",{},"人工判定整定完成"))},"记录:整定完成")]),st(kn,{names:Je(7),model:d(J)[7]},null,8,["names","model"])],64)):d(i).current===8?(p(),h(le,{key:9},[o("ol",Y$,[o("li",null,[w[82]||(w[82]=Y("读全部可保存参数作为快照并保存到 Flash:",-1)),o("button",{disabled:d(Xt)(),onClick:w[28]||(w[28]=te=>C(qn))},"快照并保存",8,Z$),o("span",Q$,f(u.snapshot?`已快照 ${Object.keys(u.snapshot).length} 项`:""),1)]),o("li",null,[w[83]||(w[83]=Y("复位(回到用户模式),设备重新枚举后在连接页重新连接:",-1)),o("button",{disabled:!u.snapshot||d(Xt)(),onClick:w[29]||(w[29]=te=>C(Jn))},"复位",8,X$),d(i).resetAt?(p(),h("span",ex,f(((Ye=d(i).resetResult)==null?void 0:Ye.message)??"曾请求复位,响应未记录;请重连核对"),1)):R("",!0),pl.value?(p(),h("p",tx,"设备运行非槽开发镜像,复位后可能不再运行它(RAM 加载的镜像会丢失),开发者模式丢失,按复位后运行的固件载入已保存参数。")):R("",!0)]),o("li",null,[w[84]||(w[84]=Y("重新连接后读回比较:",-1)),o("button",{disabled:!Ll.value,onClick:w[30]||(w[30]=te=>C(vi))},"读回比较",8,sx),((ct=d(i).resetResult)==null?void 0:ct.status)==="unknown"?(p(),h("span",nx,"复位未确认;重连读回仅记录参数,不能证明复位完成。")):R("",!0),d(i).s8.diff?(p(),h("span",{key:1,class:Ve(d(i).s8.diff.length?"status-critical":"status-ok")},f(d(i).s8.diff.length?`${d(i).s8.diff.length} 项不同`:"与保存前快照一致"),3)):R("",!0),(rs=d(i).s8.diff)!=null&&rs.length?(p(),h("table",lx,[o("tbody",null,[(p(!0),h(le,null,Ue(d(i).s8.diff,te=>(p(),h("tr",{key:te.name},[o("td",ox,f(te.name),1),o("td",ix,f(te.before),1),o("td",ax,f(te.after),1)]))),128))])])):R("",!0)]),o("li",null,[w[86]||(w[86]=Y("验收阶跃(小幅,方向每次交替): ",-1)),(p(),h(le,null,Ue(Il,(te,Qe)=>o("button",{key:Qe,disabled:!d(an)()||te.needsLoad&&!d(i).s8.loaded,onClick:nt=>C(()=>fl(Qe))},f(Xs(Qe))+" "+f(Ma(Qe)),9,rx)),64)),o("label",ux,[we(o("input",{type:"checkbox","onUpdate:modelValue":w[31]||(w[31]=te=>d(i).s8.loaded=te)},null,512),[[Fn,d(i).s8.loaded]]),w[85]||(w[85]=Y(" 已有负载或对顶(CST 与阻抗需要)",-1))]),o("ul",null,[(p(!0),h(le,null,Ue(d(i).s8.steps,(te,Qe)=>{var nt,Gt;return p(),h("li",{key:Qe},f(Xs(Qe))+":超调 "+f(F((nt=te.metrics)==null?void 0:nt.overshoot_pct,1))+"%,调节 "+f(((Gt=te.metrics)==null?void 0:Gt.settling_s)==null?"未进入带宽":F(te.metrics.settling_s*1e3,0)+" ms")+f(te.reached!==null&&te.reached!==void 0?`,到位位 10 ${te.reached?"置位":"未置位"}`:"")+"(记录 "+f(te.record)+")",1)}),128))])]),o("li",null,[w[87]||(w[87]=Y("失联反应(零速,不运动;0x6007 = 0 时不做):",-1)),o("button",{disabled:!d(an)(),onClick:w[32]||(w[32]=te=>C(bi))},"检查",8,cx),d(i).s8.hostloss?(p(),h("span",{key:0,class:Ve(d(i).s8.hostloss.ok?"status-ok":"status-critical")},f(d(i).s8.hostloss.ok?"符合":"不符合")+":"+f(d(i).s8.hostloss.state)+",0x603F = 0x"+f(d(i).s8.hostloss.error.toString(16).toUpperCase().padStart(4,"0"))+";期望 "+f(d(i).s8.hostloss.expected),3)):R("",!0)]),Bs.value?(p(),h("li",dx,[w[89]||(w[89]=Y("驱动器电流限(外置驱动器):连接驱动器自身的 USB,运行 ",-1)),w[90]||(w[90]=o("code",null,"ehatool odrive verify",-1)),w[91]||(w[91]=Y(" 读回 ",-1)),w[92]||(w[92]=o("code",null,"current_lim",-1)),w[93]||(w[93]=Y(",核对它不低于 0x6072 只读值",-1)),Number.isFinite(Kt.value)?(p(),h("span",fx,"("+f($e("max_force_permille"))+" = "+f(F(Kt.value,0))+" N)",1)):R("",!0),w[94]||(w[94]=Y("折算的电流。换算与判据在工具中,取对象字典与设备描述的值;力上限只在 CST 与阻抗中经压力环钳位,电流限与溢流阀是其余模式的上限。 ",-1)),o("label",px,[we(o("input",{type:"checkbox","onUpdate:modelValue":w[33]||(w[33]=te=>d(i).s8.drive_check=te)},null,512),[[Fn,d(i).s8.drive_check]]),w[88]||(w[88]=Y(" 已读回并核对",-1))])])):R("",!0)]),Rt.value.length?(p(),h("table",mx,[w[95]||(w[95]=o("thead",null,[o("tr",null,[o("th",null,"配方判据"),o("th",{class:"right"},"数值"),o("th",null,"判定")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(Rt.value,te=>(p(),h("tr",{key:te.item},[o("td",null,f(te.label??te.item),1),o("td",vx,f(U(te.value)??"—"),1),o("td",{class:Ve(Os(te.verdict))},f(te.verdict),3)]))),128))])])):R("",!0),o("div",hx,[o("button",{onClick:Ht},"记录本步"),w[96]||(w[96]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:!u.serial,onClick:w[34]||(w[34]=te=>C(Ul))},"存验收档案",8,bx)]),d(i).archived?(p(),h("p",gx,"已存为 "+f(d(i).archived)+":在“记录”中下载 summary.html 打印。",1)):R("",!0)],64)):R("",!0)])],10,Nw)])}}}),yx=Wt(_x,[["__scopeId","data-v-7908cf22"]]),kx=["open"],wx={class:"row"},$x=["disabled"],xx={key:0,class:"status-warning","aria-live":"polite"},Sx={key:1,class:"events"},Cx={class:"list"},Ax={class:"num"},Tx=Bt({__name:"RecordEvents",props:{record:{},initiallyOpen:{type:Boolean}},setup(e){const t=e,s=_e(!1),n=_e(!1),l=_e([]),a=_e("");let c=0;async function u(){const _=++c,k=t.record;n.value=!0,a.value="";try{const $=await He("GET",`/api/records/${k}/events`);_===c&&(l.value=$)}catch($){_===c&&(a.value=$.message)}finally{_===c&&(n.value=!1)}}async function i(){try{await Yr(`/api/records/${t.record}/events.csv`,`${t.record}-events.csv`)}catch(_){a.value=_.message}}it(()=>t.record,()=>{c++,l.value=[],a.value="",s.value&&u()});function v(_){s.value=_.target.open,s.value&&u()}const b=_=>({job:"任务",log:"日志",state:"状态",fault:"故障",write:"写入",link:"链路"})[_]??_;return(_,k)=>(p(),h("details",{open:e.initiallyOpen,onToggle:v},[k[3]||(k[3]=o("summary",null,"持久化事件日志",-1)),o("div",wx,[k[0]||(k[0]=o("span",{class:"caption"},"显示最近 500 条,完整事件保存在 events.csv。",-1)),k[1]||(k[1]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:n.value,onClick:u},f(n.value?"读取中…":"刷新事件"),9,$x),o("button",{onClick:i},"下载全部事件")]),a.value?(p(),h("p",xx,f(a.value),1)):R("",!0),l.value.length?(p(),h("div",Sx,[o("table",Cx,[k[2]||(k[2]=o("thead",null,[o("tr",null,[o("th",null,"时间"),o("th",null,"类型"),o("th",null,"事件")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(l.value,($,L)=>(p(),h("tr",{key:L},[o("td",Ax,f(new Date(Number($.t)*1e3).toLocaleString()),1),o("td",null,f(b($.kind)),1),o("td",null,f($.text),1)]))),128))])])])):R("",!0)],40,kx))}}),jr=Wt(Tx,[["__scopeId","data-v-7d0c1ae4"]]),Ox={class:"page"},Ex={class:"card"},Px={class:"row"},Mx={class:"segmented",role:"radiogroup","aria-label":"方式"},Nx=["aria-checked"],jx=["aria-checked"],Rx={class:"caption"},Vx={key:0,class:"row form"},Dx={class:"field"},Lx={key:1,class:"row form"},Ix=["value"],Ux={class:"field"},Fx={class:"unit"},zx={class:"field"},Hx={class:"unit"},Bx={class:"field"},Wx={class:"field"},Kx={key:0,class:"field"},Gx={class:"field"},qx=["onUpdate:modelValue","aria-label"],Jx=["value"],Yx={class:"field"},Zx=["onUpdate:modelValue","aria-label"],Qx={class:"unit"},Xx={class:"field"},e3=["onUpdate:modelValue","aria-label"],t3={key:0,class:"field"},s3=["onUpdate:modelValue"],n3={class:"field"},l3=["onUpdate:modelValue"],o3={class:"field"},i3=["onUpdate:modelValue"],a3=["disabled","onClick","aria-label"],r3=["disabled"],u3={class:"row form"},c3=["disabled"],d3={class:"kv"},f3={class:"num"},p3={class:"caption"},m3={class:"num"},v3={class:"caption"},h3={key:0,class:"status-critical"},b3={key:1,class:"status-warning"},g3={key:2,class:"status-warning"},_3={class:"row form"},y3={class:"field"},k3={class:"caption"},w3={key:0,class:"status-critical","aria-live":"polite"},$3=["disabled"],x3={key:0,class:"card"},S3={class:"caption"},C3={class:"kv"},A3={class:"num"},T3={class:"num"},O3={class:"num"},E3={class:"num"},P3={class:"num"},M3={key:0,class:"caption"},N3={key:1,class:"caption"},j3={key:1,class:"card"},R3={class:"caption"},V3=Bt({__name:"LongRunPage",setup(e){const t=r.step.defaults,s=ge(()=>r.step.modes.filter(ie=>r.step.longrun_modes.includes(ie.key))),n=_e("longrun"),l=Dt({mode:"csv",start:0,target:3,settle:t.settle,seconds:t.seconds,rate:t.rate,stiffness:t.stiffness,damping:t.damping,hours:1,minutes:0}),a=_e("step"),c=()=>({mode:"csv",target:3,seconds:1,rate:t.rate,stiffness:t.stiffness,damping:t.damping}),u=Dt([c()]),i=ie=>r.step.modes.find(S=>S.key===ie),v=ge(()=>i(l.mode)),b=ge(()=>l.hours*3600+l.minutes*60),_=_e(null),k=_e(!1),$=_e(!1),L=_e(""),V=_e(null),j=_e(null),q=ge(()=>!!(r.state.faulted||r.state.latched));async function z(){var ie;V.value=((ie=await He("GET","/api/records/space").catch(()=>null))==null?void 0:ie.free_bytes)??null}async function K(){const ie=r.openedAt;if(!(ie===null||Xt())){_.value=null,k.value=!0,L.value="";try{const S=(await He("GET","/api/objects/abort_connection_option")).value,C=(await He("GET","/api/objects/quick_stop_option")).value;if(r.openedAt!==ie)return;_.value={openedAt:ie,abort:S,quick:C}}catch(S){r.openedAt===ie&&(L.value=S.message)}finally{k.value=!1}}}async function N(){if($.value)return;const ie=_.value;if(n.value==="longrun"&&(!ie||ie.openedAt!==r.openedAt||ie.abort===0||q.value))return;L.value="";const S=n.value==="record"?{duration_s:b.value}:{...a.value==="profile"?{profile:u.map(x=>({...x}))}:l,duration_s:b.value,accept:[ie.abort,ie.quick],ack:!1},C=r.openedAt,F=n.value;$.value=!0;try{await He("POST","/api/jobs",{kind:F,opened_at:C,params:S})}catch(x){L.value=x.message}finally{$.value=!1}}const B=ge(()=>_.value!==null&&_.value.openedAt===r.openedAt);it(()=>r.openedAt,()=>{_.value=null,K()},{immediate:!0});const H=ge(()=>{var ie,S;return((ie=r.job)==null?void 0:ie.kind)==="longrun"||((S=r.job)==null?void 0:S.kind)==="record"?r.job:null}),ce=ge(()=>{var ie,S;return((S=(ie=H.value)==null?void 0:ie.progress)==null?void 0:S.cycles)??[]}),fe=ge(()=>H.value?Math.max(0,(H.value.finished??r.now)-H.value.started):0),Ne=ie=>`${Math.floor(ie/3600)} h ${Math.floor(ie%3600/60)} min ${Math.floor(ie%60)} s`,re=ie=>ie==null?"—":`${(ie/1e9).toFixed(1)} GB`,E=ge(()=>ce.value[ce.value.length-1]),U=ge(()=>{var ie,S,C;return i(((ie=E.value)==null?void 0:ie.mode)??((C=(S=H.value)==null?void 0:S.params)==null?void 0:C.mode))}),de=ge(()=>{var ie,S,C;return`${(ie=H.value)==null?void 0:ie.id}:${((S=E.value)==null?void 0:S.cycle)??0}:${((C=E.value)==null?void 0:C.segment)??1}`}),$e=ge(()=>[...new Set(ce.value.map(ie=>{var S,C;return ie.mode??((C=(S=H.value)==null?void 0:S.params)==null?void 0:C.mode)}))]);function I(ie){return ce.value.filter(S=>{var C,F;return(S.mode??((F=(C=H.value)==null?void 0:C.params)==null?void 0:F.mode))===ie})}function g(ie,S){var C,F;return[{label:`${((C=i(ie))==null?void 0:C.label)??ie} · ${S==="overshoot_pct"?"超调":"最大跟随误差"}`,slot:S==="overshoot_pct"?1:2,unit:S==="overshoot_pct"?"%":(F=i(ie))==null?void 0:F.unit}]}function ee(ie,S){const C=I(ie);return[C.map(F=>F.t_s/60),C.map(F=>F[S]??null)]}const Oe=ge(()=>{var ie;return(ie=r.byName.abort_connection_option)==null?void 0:ie.desc}),je=ge(()=>{var ie;return(ie=r.byName.quick_stop_option)==null?void 0:ie.desc});return Fs(async()=>{await z();const ie=await He("GET","/api/records").catch(()=>[]);j.value=ie.find(S=>S.kind==="longrun"||S.kind==="recording")??null}),(ie,S)=>{var C,F,x,O,be,se,ft,Z,Je,A,D,J,pe,me,ve,Ae,Te,xe,ae,De;return p(),h("div",Ox,[S[51]||(S[51]=o("h1",null,"长时运行",-1)),o("section",Ex,[o("div",Px,[o("div",Mx,[o("button",{role:"radio","aria-checked":n.value==="longrun",class:Ve({on:n.value==="longrun"}),onClick:S[0]||(S[0]=oe=>n.value="longrun")},"长时运行",10,Nx),o("button",{role:"radio","aria-checked":n.value==="record",class:Ve({on:n.value==="record"}),onClick:S[1]||(S[1]=oe=>n.value="record")},"只记录",10,jx)]),o("span",Rx,f(n.value==="longrun"?"循环运行所选计划,每段记录摘要;故障或保护时另存之前 30 s 的控制周期数据与之后 30 s 经 SDO 读取的数据。":"不取得控制权:设备由别的主站驱动,这里只读取并记录(CAN 只侦听时解本节点的 TPDO)。"),1)]),n.value==="longrun"?(p(),h("div",Vx,[o("label",Dx,[S[13]||(S[13]=Y("运行计划 ",-1)),we(o("select",{"onUpdate:modelValue":S[2]||(S[2]=oe=>a.value=oe)},[...S[12]||(S[12]=[o("option",{value:"step"},"重复阶跃",-1),o("option",{value:"profile"},"运行剖面",-1)])],512),[[hs,a.value]])])])):R("",!0),n.value==="longrun"&&a.value==="step"?(p(),h("div",Lx,[we(o("select",{"onUpdate:modelValue":S[3]||(S[3]=oe=>l.mode=oe),"aria-label":"模式"},[(p(!0),h(le,null,Ue(s.value,oe=>(p(),h("option",{key:oe.key,value:oe.key},f(oe.label),9,Ix))),128))],512),[[hs,l.mode]]),o("label",Ux,[S[14]||(S[14]=Y("起始 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":S[4]||(S[4]=oe=>l.start=oe)},null,512),[[Re,l.start,void 0,{number:!0}]]),o("span",Fx,f((C=v.value)==null?void 0:C.unit),1)]),o("label",zx,[S[15]||(S[15]=Y("目标 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":S[5]||(S[5]=oe=>l.target=oe)},null,512),[[Re,l.target,void 0,{number:!0}]]),o("span",Hx,f((F=v.value)==null?void 0:F.unit),1)]),o("label",Bx,[S[16]||(S[16]=Y("保持 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1","onUpdate:modelValue":S[6]||(S[6]=oe=>l.settle=oe)},null,512),[[Re,l.settle,void 0,{number:!0}]]),S[17]||(S[17]=o("span",{class:"unit"},"s",-1))]),o("label",Wx,[S[18]||(S[18]=Y("记录 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1","onUpdate:modelValue":S[7]||(S[7]=oe=>l.seconds=oe)},null,512),[[Re,l.seconds,void 0,{number:!0}]]),S[19]||(S[19]=o("span",{class:"unit"},"s",-1))]),l.mode==="csp"||l.mode==="impedance"?(p(),h("label",Kx,[S[20]||(S[20]=Y("插补 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":S[8]||(S[8]=oe=>l.rate=oe)},null,512),[[Re,l.rate,void 0,{number:!0}]]),S[21]||(S[21]=o("span",{class:"unit"},"mm/s",-1))])):R("",!0)])):R("",!0),n.value==="longrun"&&a.value==="profile"?(p(),h(le,{key:2},[S[31]||(S[31]=o("p",{class:"caption"},"按列表顺序循环。每段可持续至 7 天,包含位置插补,位置目标为绝对位置。模式改变时先快停断电,再使能下一段。CST 与阻抗需要合适的负载或对顶。",-1)),(p(!0),h(le,null,Ue(u,(oe,Le)=>{var Ce;return p(),h("div",{key:Le,class:"row form"},[o("label",Gx,[Y("第 "+f(Le+1)+" 段 ",1),we(o("select",{"onUpdate:modelValue":he=>oe.mode=he,"aria-label":`第 ${Le+1} 段模式`},[(p(!0),h(le,null,Ue(s.value,he=>(p(),h("option",{key:he.key,value:he.key},f(he.label),9,Jx))),128))],8,qx),[[hs,oe.mode]])]),o("label",Yx,[S[22]||(S[22]=Y("目标 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":he=>oe.target=he,"aria-label":`第 ${Le+1} 段目标`},null,8,Zx),[[Re,oe.target,void 0,{number:!0}]]),o("span",Qx,f((Ce=i(oe.mode))==null?void 0:Ce.unit),1)]),o("label",Xx,[S[23]||(S[23]=Y("持续 ",-1)),we(o("input",{class:"num",type:"number",min:"0.1",max:"604800",step:"any","onUpdate:modelValue":he=>oe.seconds=he,"aria-label":`第 ${Le+1} 段持续时间`},null,8,e3),[[Re,oe.seconds,void 0,{number:!0}]]),S[24]||(S[24]=o("span",{class:"unit"},"s",-1))]),oe.mode==="csp"||oe.mode==="impedance"?(p(),h("label",t3,[S[25]||(S[25]=Y("插补 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":he=>oe.rate=he},null,8,s3),[[Re,oe.rate,void 0,{number:!0}]]),S[26]||(S[26]=o("span",{class:"unit"},"mm/s",-1))])):R("",!0),oe.mode==="impedance"?(p(),h(le,{key:1},[o("label",n3,[S[27]||(S[27]=Y("刚度 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":he=>oe.stiffness=he},null,8,l3),[[Re,oe.stiffness,void 0,{number:!0}]]),S[28]||(S[28]=o("span",{class:"unit"},"N/mm",-1))]),o("label",o3,[S[29]||(S[29]=Y("阻尼 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":he=>oe.damping=he},null,8,i3),[[Re,oe.damping,void 0,{number:!0}]]),S[30]||(S[30]=o("span",{class:"unit"},"N·s/mm",-1))])],64)):R("",!0),o("button",{disabled:u.length<=1,onClick:he=>u.splice(Le,1),"aria-label":`移除第 ${Le+1} 段`},"移除",8,a3)])}),128)),o("button",{disabled:u.length>=64,onClick:S[9]||(S[9]=oe=>u.push(c()))},"添加一段",8,r3)],64)):R("",!0),n.value==="longrun"?(p(),h(le,{key:3},[o("div",u3,[S[32]||(S[32]=o("strong",null,"失联后的设备反应",-1)),S[33]||(S[33]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:d(Xt)()||k.value,onClick:K},f(k.value?"读取中…":"重新读取失联配置"),9,c3)]),o("dl",d3,[S[34]||(S[34]=o("dt",null,"失联反应 0x6007",-1)),o("dd",f3,[Y(f(((x=_.value)==null?void 0:x.abort)??"未读取"),1),o("span",p3,"("+f(Oe.value)+")",1)]),S[35]||(S[35]=o("dt",null,"快停选项 0x605A",-1)),o("dd",m3,[Y(f(((O=_.value)==null?void 0:O.quick)??"未读取"),1),o("span",v3,"("+f(je.value)+")",1)])]),((be=_.value)==null?void 0:be.abort)===0?(p(),h("p",h3,"0x6007 = 0:服务失效后设备继续执行最后目标。请先在参数页设置失联反应,再重新读取配置。")):R("",!0),((se=_.value)==null?void 0:se.abort)===3&&((ft=_.value)==null?void 0:ft.quick)===6?(p(),h("p",b3,"服务失效后设备会快停并通电零速保持,可能持续保持到有人处理。需要失联后断电时,先在参数页修改并重新读取配置。")):R("",!0),S[36]||(S[36]=o("p",{class:"caption"},"开始后设备会使能并反复运动,关闭页面后继续运行。到达时长、故障或保护、反馈停更、记录写入出错、磁盘不足或点击停止时请求快停后断电。服务持有系统防休眠断言,合上笔记本盖子仍会休眠。",-1)),q.value?(p(),h("p",g3,"设备有故障或锁存保护:请先在工具栏中“确认保护/故障”,再开始长时运行。")):R("",!0)],64)):R("",!0),o("div",_3,[o("label",y3,[S[37]||(S[37]=Y("时长 ",-1)),we(o("input",{class:"num",type:"number",min:"0","onUpdate:modelValue":S[10]||(S[10]=oe=>l.hours=oe),"aria-label":"时长(小时)"},null,512),[[Re,l.hours,void 0,{number:!0}]]),S[38]||(S[38]=o("span",{class:"unit"},"h",-1)),we(o("input",{class:"num",type:"number",min:"0",max:"59","onUpdate:modelValue":S[11]||(S[11]=oe=>l.minutes=oe),"aria-label":"时长(分钟)"},null,512),[[Re,l.minutes,void 0,{number:!0}]]),S[39]||(S[39]=o("span",{class:"unit"},"min",-1))]),o("span",k3,"记录目录可用 "+f(re(V.value))+";低于 1 GB 即收尾。",1),S[40]||(S[40]=o("span",{class:"spacer"},null,-1)),L.value?(p(),h("span",w3,f(L.value),1)):R("",!0),o("button",{class:"primary",disabled:$.value||!d(an)()||b.value<=0||n.value==="longrun"&&(!B.value||((Z=_.value)==null?void 0:Z.abort)===0||q.value),onClick:N},f(n.value==="longrun"?"开始长时运行(使能并运动)":"开始记录"),9,$3)]),S[41]||(S[41]=o("p",{class:"caption"},"台架电机(限流电源、无制动电阻)循环正反转会把能量回馈到母线、触发过压,不跑长时运行;数小时的运行只在虚拟电机构建上进行。设备不报告电机后端是哪一种。",-1))]),H.value?(p(),h("section",x3,[o("h2",null,[Y(f(H.value.kind==="longrun"?"长时运行":"只记录")+":"+f(H.value.state==="running"?"进行中":H.value.end)+" ",1),S[42]||(S[42]=o("span",{class:"spacer"},null,-1)),o("span",S3,"记录 "+f(((Je=H.value.progress)==null?void 0:Je.record)??"—"),1)]),o("dl",C3,[S[46]||(S[46]=o("dt",null,"已运行",-1)),o("dd",A3,f(Ne(fe.value))+" / "+f(Ne(Number(H.value.params.duration_s))),1),H.value.kind==="longrun"?(p(),h(le,{key:0},[S[43]||(S[43]=o("dt",null,"循环",-1)),o("dd",T3,f(((A=E.value)==null?void 0:A.cycle)??0),1)],64)):(p(),h(le,{key:1},[S[44]||(S[44]=o("dt",null,"已记录",-1)),o("dd",O3,f(((D=H.value.progress)==null?void 0:D.rows)??0)+" 行",1)],64)),S[47]||(S[47]=o("dt",null,"可用磁盘",-1)),o("dd",E3,f(re((J=H.value.progress)==null?void 0:J.free_bytes)),1),S[48]||(S[48]=o("dt",null,"防休眠",-1)),o("dd",null,f((pe=H.value.progress)!=null&&pe.keep_awake?"已持有(合盖与系统强制休眠仍可能中断)":"未持有(系统未提供或未授予)"),1),E.value?(p(),h(le,{key:2},[S[45]||(S[45]=o("dt",null,"最近一段",-1)),o("dd",P3,"第 "+f(E.value.cycle)+" 循环,第 "+f(E.value.segment??1)+" 段 · "+f((me=U.value)==null?void 0:me.label)+",超调 "+f(((ve=E.value.overshoot_pct)==null?void 0:ve.toFixed(1))??"—")+"%,最大跟随误差 "+f(((Ae=E.value.max_error)==null?void 0:Ae.toFixed(3))??"—")+" "+f((Te=U.value)==null?void 0:Te.unit)+",板温 "+f(((ae=(xe=E.value.power_stage_temp_c)==null?void 0:xe.toFixed)==null?void 0:ae.call(xe,1))??"—")+" °C,母线 "+f(E.value.dc_link_voltage_mv!=null?(E.value.dc_link_voltage_mv/1e3).toFixed(2):"—")+" V",1)],64)):R("",!0)]),H.value.kind==="longrun"&&ce.value.length?(p(),h(le,{key:0},[ce.value.length>=2e3?(p(),h("p",M3,"曲线只显示最近 2000 段;全部摘要在记录的 cycles-*.csv 中。")):R("",!0),(p(!0),h(le,null,Ue($e.value,oe=>(p(),h(le,{key:String(oe)},[st(rn,{series:g(oe,"overshoot_pct"),data:()=>ee(oe,"overshoot_pct"),tick:de.value,"sync-key":"longrun",height:150,"time-unit":"min","time-label":"t / min(从开始起)"},null,8,["series","data","tick"]),st(rn,{series:g(oe,"max_error"),data:()=>ee(oe,"max_error"),tick:de.value,"sync-key":"longrun",height:150,"time-unit":"min","time-label":"t / min(从开始起)"},null,8,["series","data","tick"])],64))),128))],64)):R("",!0),H.value.state==="running"?(p(),h("p",N3,"关闭本页面后任务继续。"+f(H.value.kind==="record"?"“停止记录”结束采集,设备的运动仍由当前控制主站负责。":"按工具栏的“停止”请求快停后断电,停止结果以任务日志和设备反馈为准。")+"重新打开页面即可看到进度。",1)):R("",!0),st(Jo,{job:H.value},null,8,["job"]),(De=H.value.progress)!=null&&De.record?(p(),vt(jr,{key:2,record:H.value.progress.record},null,8,["record"])):R("",!0)])):j.value?(p(),h("section",j3,[o("h2",null,[Y("最近一次:"+f(j.value.kind==="longrun"?"长时运行":"只记录"),1),S[49]||(S[49]=o("span",{class:"spacer"},null,-1)),o("span",R3,"记录 "+f(j.value.id),1)]),o("p",{class:Ve(j.value.complete?"caption":"status-warning")},f(j.value.end??(j.value.state==="running"?"进行中(另一个服务?)":"—"))+f(j.value.cycles!=null?`;${j.value.cycles} 个循环`:""),3),S[50]||(S[50]=o("p",{class:"caption"},"文件在“记录”中下载。",-1)),st(jr,{record:j.value.id},null,8,["record"])])):R("",!0)])}}}),D3=Wt(V3,[["__scopeId","data-v-df428e3c"]]),L3={class:"page"},I3={class:"card"},U3={class:"row line"},F3=["disabled","title"],z3={class:"row line"},H3=["disabled","title"],B3={class:"row line"},W3=["disabled","title"],K3={class:"row line"},G3=["disabled","title"],q3={key:0,class:"caption"},J3={key:1,class:"caption"},Y3={key:2,class:"status-warning"},Z3={class:"card"},Q3={class:"caption"},X3={class:"row line"},e4={class:"field"},t4=["disabled"],s4={key:0,class:"caption"},n4={class:"caption"},l4={key:0,class:"card"},o4={class:"caption"},i4={class:"row line"},a4={class:"field"},r4={key:0,class:"row"},u4=["disabled"],c4=["disabled","title"],d4={key:0,class:"caption"},f4={key:1,class:"caption"},p4={key:2,class:"caption"},m4={key:3,class:"status-critical"},v4={key:4,class:"caption"},h4={key:5,class:"status-critical"},b4={key:1,class:"card"},g4={key:0,class:"caption"},_4={key:1,class:"caption"},y4={class:"row"},k4={key:0,class:"row"},w4=["disabled"],$4={key:1,class:"status-critical"},x4={key:2,class:"caption"},S4={key:3,class:"status-warning"},C4={class:"card"},A4={class:"row line"},T4={class:"field"},O4=["disabled"],E4=["disabled","title"],P4={key:0,class:"caption"},M4={key:1,class:"caption"},N4={key:2,class:"status-critical"},j4=Bt({__name:"MaintenancePage",setup(e){const{pending:t,results:s,perform:n,action:l}=Cf(),a=ge(()=>!Es()&&!t.value),c={save:"store_parameters",reset:"device_reset",developer:"developer_mode",restore_defaults:"restore_defaults"},u=(E="")=>t.value?"正在处理上一项操作":Es(c[E]??E),i=Dt({value:null});async function v(){const E=i.value;u("can_node_id")||E===null||!Number.isInteger(E)||E<1||E>127||await n("node",async(U,de)=>{var ee,Oe;const $e=await He("PUT","/api/objects/can_node_id",{value:E,opened_at:U});if(!de())return;if($e.status!=="written"||!$e.equal)return{ok:!1,text:$e.status==="unknown"?`节点号写入结果未知,未继续保存和复位。${$e.message??""}`:$e.status==="written"?"节点号读回不一致,未继续保存和复位":((ee=$e.abort)==null?void 0:ee.meaning_zh)??`没有写入(${$e.status})`};const I=await He("POST","/api/actions/save",{opened_at:U});if(!de())return;if(I.ok===!1)return{ok:!1,text:I.message??((Oe=I.abort)==null?void 0:Oe.meaning_zh)??"保存未受理"};const g=await He("POST","/api/actions/reset",{opened_at:U});return g.ok===!1?{ok:!1,text:g.message??"复位未受理"}:{ok:!0,text:`已写入 ${E} 并保存。${g.message??"已请求设备复位,重新连接后核对。"}`}})}const b=_e(localStorage.getItem("eha.build")??""),_=_e(!0),k=_e(!1),$=_e(null),L=_e(""),V=_e(null),j=_e(!1),q=ge(()=>$.value!==null&&L.value===b.value&&V.value===r.openedAt);async function z(E,U,de={}){u(U)||await l(E,U,de)}async function K(E,U,de){a.value&&await n(E,async $e=>{await He("POST","/api/jobs",{kind:U,opened_at:$e,params:de})})}async function N(){const E=b.value,U=r.openedAt;if(!(!E||j.value)){localStorage.setItem("eha.build",E),$.value=null,j.value=!0,s.preview=null;try{const de=await He("POST","/api/firmware/preview",{build:E});if(b.value!==E||r.openedAt!==U)return;$.value=de,L.value=E,V.value=U}catch(de){r.connected&&r.openedAt===U&&b.value===E&&(s.preview={ok:!1,text:de.message})}finally{j.value=!1}}}function B(E){var de;if(u())return u();const U=r.state.firmware_slot;return E==="install"&&typeof U=="number"&&U!==255?"首次安装要求设备运行非槽开发镜像":E!=="install"&&U===255?"设备运行非槽开发镜像,请使用首次安装":E!=="install"&&r.state.firmware_confirmed===0?"当前固件仍在试运行,确认后才能再次升级":q.value?E!=="install"&&!((de=$.value)!=null&&de.target)?"尚未确定可写入的目标槽":"":"请先预览本次构建目录中的镜像"}function H(E){B(E)||K(E,E,E==="foe"?{build:b.value}:{build:b.value,reset:_.value})}function ce(E){K(E,E,E==="cancheck"?{ack:!1,rates:k.value}:{ack:!1})}it([b,()=>r.openedAt],()=>{$.value=null}),Fs(()=>{const E=r.openedAt;r.missing.includes("can_node_id")||He("GET","/api/objects/can_node_id").then(U=>{r.connected&&r.openedAt===E&&Nl("can_node_id",U.value)}).catch(()=>{}),b.value&&N()});const fe=E=>{var U;return((U=r.job)==null?void 0:U.kind)===E?r.job:null},Ne=ge(()=>Number(r.state.firmware_slot)===255),re=ge(()=>{var E;return((E=$.value)==null?void 0:E.target)??"—"});return(E,U)=>{var de,$e,I,g,ee,Oe,je,ie,S,C,F,x;return p(),h("div",L3,[U[24]||(U[24]=o("h1",null,"维护",-1)),o("section",I3,[U[12]||(U[12]=o("h2",null,"参数与复位",-1)),o("div",U3,[o("button",{disabled:!!u("save"),title:u("save"),onClick:U[0]||(U[0]=O=>z("save","save"))},"保存到 Flash",8,F3),o("span",{class:Ve(((de=d(s).save)==null?void 0:de.ok)===!1?"status-critical":"caption"),"aria-live":"polite"},f(u("save")||(($e=d(s).save)==null?void 0:$e.text)||"保存设备上当前全部可持久参数(0x1010),包括不是本页写入的改动。"),3)]),o("div",z3,[o("button",{disabled:!!u("reset"),title:u("reset"),onClick:U[1]||(U[1]=O=>z("reset","reset"))},"复位并断开连接",8,H3),o("span",{class:Ve(((I=d(s).reset)==null?void 0:I.ok)===!1?"status-critical":"caption"),"aria-live":"polite"},f(u("reset")||((g=d(s).reset)==null?void 0:g.text)||"0x2006;驱动运行中不受理。未保存参数与开发者模式丢失,设备重新枚举后再连接。"),3)]),o("div",B3,[o("button",{disabled:!!u("developer"),title:u("developer"),onClick:U[2]||(U[2]=O=>z("dev","developer",{on:!d(r).state.developer}))},f(d(r).state.developer?"退出开发者模式":"进入开发者模式"),9,W3),o("span",{class:Ve(((ee=d(s).dev)==null?void 0:ee.ok)===!1?"status-critical":"caption"),"aria-live":"polite"},f(u("developer")||((Oe=d(s).dev)==null?void 0:Oe.text)||"0x2009;只在驱动未运行时可切换,复位后回到用户模式。"),3)]),o("div",K3,[o("button",{class:"destructive",disabled:!!u("restore_defaults"),title:u("restore_defaults"),onClick:U[3]||(U[3]=O=>z("restore","restore_defaults"))},"恢复出厂默认(复位后生效)",8,G3),o("span",{class:Ve(((je=d(s).restore)==null?void 0:je.ok)===!1?"status-critical":"caption"),"aria-live":"polite"},f(u("restore_defaults")||((ie=d(s).restore)==null?void 0:ie.text)||"0x1011;包含整机标定与硬限,需要开发者模式。复位前若再保存,会把当前值重新存入。"),3)]),d(r).state.running===void 0?(p(),h("p",q3,"尚未读到驱动状态,命令是否受理以设备应答为准。")):R("",!0),d(r).state.developer===void 0?(p(),h("p",J3,"尚未读到开发者模式,恢复出厂是否受理以设备应答为准。")):R("",!0),Ne.value?(p(),h("p",Y3,"设备运行非槽开发镜像(不在应用槽中,0x2020 = 255):复位后可能不再运行它,RAM 加载的镜像随之丢失。")):R("",!0)]),o("section",Z3,[U[14]||(U[14]=o("h2",null,"CAN 节点号",-1)),o("p",Q3,"出厂节点号都是 "+f((S=d(r).byName.can_node_id)==null?void 0:S.default)+",同一总线上会冲突:逐台单独连接,写 0x2001、保存、复位,再接入总线。 0x2001 停机可写,复位后生效。当前 "+f(d(r).state.can_node_id??"—")+"。",1),o("div",X3,[o("label",e4,[U[13]||(U[13]=Y("新节点号 ",-1)),we(o("input",{class:"num",type:"number",min:"1",max:"127","onUpdate:modelValue":U[4]||(U[4]=O=>i.value=O)},null,512),[[Re,i.value,void 0,{number:!0}]])]),o("button",{disabled:!!u("can_node_id")||!Number.isInteger(i.value)||i.value==null||i.value<1||i.value>127,onClick:v},"写入节点号、保存并复位",8,t4),d(s).node?(p(),h("span",{key:0,class:Ve(d(s).node.ok?"caption":"status-critical"),"aria-live":"polite"},f(d(s).node.text),3)):R("",!0)]),u("can_node_id")?(p(),h("p",s4,f(u("can_node_id")),1)):R("",!0),o("p",n4,"保存全部可持久参数,包括其他页面写入的改动。复位后连接断开,CAN 主站须按新节点号访问。"+f(Ne.value?"设备运行非槽开发镜像,复位后可能不再运行它(RAM 加载的镜像会丢失)。":""),1)]),d(r).state.via==="usb"||d(r).state.via==="ecat"?(p(),h("section",l4,[o("h2",null,f(d(r).state.via==="ecat"?"FoE 固件升级":"USB 固件升级"),1),o("p",o4,"运行槽 "+f(d(r).state.slot_text??"—")+";槽 A "+f(d(r).state.firmware_slot_a_version_text??"—")+",槽 B "+f(d(r).state.firmware_slot_b_version_text??"—")+"。 写入非运行槽并核对槽版本,复位后新镜像试运行,约 10 s 后自行确认;确认前复位 3 次会回到原镜像。"+f(d(r).state.via==="ecat"?"FoE 不核对复位后的重连与运行槽,连接随之结束。":""),1),o("div",i4,[o("label",a4,[U[15]||(U[15]=Y("构建目录 ",-1)),we(o("input",{class:"path","onUpdate:modelValue":U[5]||(U[5]=O=>b.value=O),placeholder:"~/…/eha-firmware/build/hpm-integrated",onChange:N},null,544),[[Re,b.value]])]),d(r).state.via==="usb"?(p(),h("label",r4,[we(o("input",{type:"checkbox","onUpdate:modelValue":U[6]||(U[6]=O=>_.value=O)},null,512),[[Fn,_.value]]),U[16]||(U[16]=Y(" 写入后复位",-1))])):R("",!0),U[17]||(U[17]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!b.value||j.value,onClick:N},f(j.value?"读取镜像中…":"预览镜像"),9,u4),o("button",{class:"primary",disabled:!!B(d(r).state.via==="ecat"?"foe":"update"),title:B(d(r).state.via==="ecat"?"foe":"update"),onClick:U[7]||(U[7]=O=>H(d(r).state.via==="ecat"?"foe":"update"))},"写入槽 "+f(re.value)+f(d(r).state.via==="ecat"||_.value?" 并复位":""),9,c4)]),B(d(r).state.via==="ecat"?"foe":"update")?(p(),h("p",d4,f(B(d(r).state.via==="ecat"?"foe":"update")),1)):R("",!0),q.value?(p(),h("p",f4,"将写入槽 "+f(re.value)+":"+f(((C=$.value)==null?void 0:C.images[re.value])??"—")+"。"+f(d(r).state.via==="ecat"?"写入并核对槽版本后复位;之后连接结束,重连与运行槽在这里不核对。":_.value?"校验槽版本后复位,等待设备从新槽运行。":"写入并核对槽版本后保持当前运行槽。")+"写入中断时设备保留原镜像。",1)):R("",!0),d(r).state.firmware_slot===void 0||d(r).state.firmware_confirmed===void 0?(p(),h("p",p4,"运行槽或确认状态尚未读取,升级是否受理以设备应答为准。")):R("",!0),U[18]||(U[18]=o("p",{class:"caption"},"复位提交前可在工具栏“放弃升级”,等当前写入请求返回后结束后续步骤。已经发送的写入无法撤回,复位请求一经提交只能等待设备反馈。",-1)),d(s).preview?(p(),h("p",m4,f(d(s).preview.text),1)):R("",!0),Ne.value?(p(),h("p",v4,"设备运行非槽开发镜像时不能升级;首次安装在下方“开发”中。")):R("",!0),d(s).update||d(s).foe?(p(),h("p",h4,f((d(s).update??d(s).foe).text),1)):R("",!0),fe("update")??fe("foe")?(p(),vt(Jo,{key:6,job:fe("update")??fe("foe")},null,8,["job"])):R("",!0)])):R("",!0),d(r).state.via==="usb"||d(r).state.via==="can"?(p(),h("section",b4,[o("h2",null,f(d(r).state.via==="can"?"CAN 联调检查":"USB 联调检查"),1),d(r).state.via==="usb"?(p(),h("p",g4,"逐项检查标识、中止码、开发者模式、过程数据控制与快停、上位机失联、CSP 目标准入、示波流与运行诊断。检查中会使能和运动,并改写示波配置。")):(p(),h("p",_4,"SDO、NMT、心跳、PDO、SYNC、EMCY、主机心跳;检查中会使能和运动(模式 −2)。“逐个切换速率”会每次保存参数并复位,结束时写回开始时的速率并保存。")),o("div",y4,[d(r).state.via==="can"?(p(),h("label",k4,[we(o("input",{type:"checkbox","onUpdate:modelValue":U[8]||(U[8]=O=>k.value=O)},null,512),[[Fn,k.value]]),U[19]||(U[19]=Y(" 逐个切换速率",-1))])):R("",!0),o("button",{disabled:!a.value||!!d(r).state.faulted||!!d(r).state.latched,onClick:U[9]||(U[9]=O=>ce(d(r).state.via==="can"?"cancheck":"usbcheck"))},"开始检查(使能并运动"+f(d(r).state.via==="can"&&k.value?"、保存并复位":"")+")",9,w4),d(s).usbcheck||d(s).cancheck?(p(),h("span",$4,f((d(s).usbcheck??d(s).cancheck).text),1)):R("",!0)]),u()?(p(),h("p",x4,f(u()),1)):R("",!0),d(r).state.faulted||d(r).state.latched?(p(),h("p",S4,"先在工具栏中“确认保护/故障”,再开始检查。")):R("",!0),fe("usbcheck")??fe("cancheck")?(p(),vt(Jo,{key:4,job:fe("usbcheck")??fe("cancheck")},null,8,["job"])):R("",!0)])):R("",!0),o("details",C4,[U[23]||(U[23]=o("summary",null,"开发",-1)),d(r).state.via==="usb"?(p(),h(le,{key:0},[U[21]||(U[21]=o("h3",null,"首次安装(设备须运行非槽开发镜像)",-1)),o("div",A4,[o("label",T4,[U[20]||(U[20]=Y("构建目录 ",-1)),we(o("input",{class:"path","onUpdate:modelValue":U[10]||(U[10]=O=>b.value=O),onChange:N},null,544),[[Re,b.value]])]),o("button",{disabled:!b.value||j.value,onClick:N},f(j.value?"读取镜像中…":"预览镜像"),9,O4),o("button",{disabled:!!B("install"),title:B("install"),onClick:U[11]||(U[11]=O=>H("install"))},"写入 bootloader 与槽 A"+f(_.value?" 并复位":""),9,E4)]),B("install")?(p(),h("p",P4,f(B("install")),1)):R("",!0),q.value?(p(),h("p",M4,"bootloader:"+f(((F=$.value)==null?void 0:F.images.boot)??"—")+";槽 A:"+f(((x=$.value)==null?void 0:x.images.A)??"—")+"。先写槽 A,设备核对镜像头后再写 bootloader;bootloader 区只在运行非槽开发镜像时可写,首次安装没有可回退镜像。",1)):R("",!0),U[22]||(U[22]=o("p",{class:"caption"},"可在当前写入请求返回后放弃后续步骤。放弃不会撤回已经写入的 bootloader 或槽 A 数据,首次安装没有可回退镜像。复位请求提交后不能撤回。",-1)),d(s).install?(p(),h("p",N4,f(d(s).install.text),1)):R("",!0),fe("install")?(p(),vt(Jo,{key:3,job:fe("install")},null,8,["job"])):R("",!0)],64)):R("",!0),st(Sf)])])}}}),R4=Wt(j4,[["__scopeId","data-v-157a93a1"]]),V4={class:"page"},D4={key:0,class:"status-critical","aria-live":"assertive"},L4={class:"card"},I4={class:"row"},U4=["disabled"],F4={key:0,class:"num"},z4={class:"secondary"},H4={class:"card"},B4=["disabled"],W4={key:0,class:"row"},K4={class:"caption"},G4={class:"list result"},q4={key:0},J4=["onClick","onKeydown"],Y4={class:"caption mono"},Z4={class:"right num"},Q4={class:"row"},X4=["disabled"],eS=["disabled","title"],tS={key:1,class:"card"},sS={key:0,class:"caption"},nS=["disabled"],lS=["disabled"],oS={class:"row"},iS={class:"field"},aS=["max"],rS={key:0,class:"caption status-warning"},uS={class:"card"},cS={class:"row form"},dS={class:"field"},fS={key:0,class:"field"},pS={class:"field"},mS={key:1,class:"field"},vS={class:"field"},hS=["max"],bS=["disabled"],gS={key:0,class:"list"},_S={class:"right num"},yS={class:"right num"},kS={class:"num"},wS={class:"right num"},$S={class:"right num"},xS={class:"right num"},SS={class:"right num"},CS=["onClick"],AS={key:1,class:"row"},TS={class:"card"},OS={class:"row"},ES=["disabled","title"],PS={key:1,class:"caption"},MS=["disabled","title"],NS={key:0,class:"caption"},jS={key:1,class:"caption"},RS={key:2,class:"status-warning"},VS={key:3,class:"card"},DS={class:"caption"},LS={key:0,class:"status-critical"},IS={class:"log"},US="https://github.com/EHAPower/eha-firmware/blob/main/.agents/skills/eha-firmware/SKILL.md#电机台架",FS=Bt({__name:"MotorPage",setup(e){const t=["target_motor_speed_rpm","motor_speed_rpm","motor_iq_a","dc_link_voltage_mv"],s=["motor_speed_kp","motor_speed_ki"];function n(){var S;r.paramsQuery=((S=r.layout.find(C=>C.names.includes("motor_pole_pairs")))==null?void 0:S.name)??"0x23",r.page="params"}const l=_e("step"),a=Dt({start:0,target:300,settle:1,seconds:1.5}),c=Dt({target:60,seconds:3}),u=ge(()=>l.value==="step"?a:c),i=_e(null),v=Dt({scope:null,save:null,reset:null,restore:null,job:null}),b=_e(null);it(()=>r.openedAt,()=>{for(const S of Object.keys(v))v[S]=null;b.value=null}),it(()=>r.calibration,()=>{b.value=null,v.restore=null});async function _(S,C,F){var O;if((O=F==null?void 0:F.currentTarget)==null||O.blur(),v.job=null,r.state.faulted||r.state.latched){v.job={ok:!1,text:"设备有故障或锁存保护,请在顶部设备状态中查明并复位后重试。"};return}const x=r.openedAt;try{await He("POST","/api/jobs",{kind:S,opened_at:x,params:{...C,ack:!1}})}catch(be){r.openedAt===x&&(v.job={ok:!1,text:be.message})}}function k(S){const C=[["目标转速",u.value.target],["运行时长",u.value.seconds]];l.value==="step"&&C.push(["起始转速",a.start],["阶跃前保持",a.settle]);for(const[x,O]of C)if(String(O).trim()===""||!Number.isFinite(Number(O))){v.job={ok:!1,text:`${x}须填写有限数值,尚未发起运行`};return}const F=l.value==="step"?{...a}:{rpm:c.target,seconds:c.seconds};return _(l.value,F,S)}async function $(){if(!r.calibration)return;const S=r.calibration,C=r.openedAt;v.restore={ok:!0,text:"恢复中…"};try{const F=await He("POST","/api/actions/restore",{opened_at:C,values:S.before});if(r.openedAt!==C||r.calibration!==S)return;b.value=F.results,v.restore=F.ok?{ok:!0,text:"已恢复原值(尚未保存)"}:{ok:!1,text:"部分未恢复,见上表读回"}}catch(F){r.openedAt===C&&r.calibration===S&&(v.restore={ok:!1,text:F.message})}}async function L(S){if(Es("store_parameters"))return;const C=r.openedAt;try{const F=await He("POST","/api/actions/save",{opened_at:C});if(r.openedAt!==C)return;v[S]=F.ok===!1?{ok:!1,text:F.message??"保存未受理"}:{ok:!0,text:"已保存到 Flash"}}catch(F){r.openedAt===C&&(v[S]={ok:!1,text:F.message})}}async function V(){if(Es("device_reset"))return;const S=r.openedAt;try{const C=await He("POST","/api/actions/reset",{opened_at:S});if(r.openedAt!==S)return;v.reset=C.ok===!1?{ok:!1,text:C.message??"复位未受理"}:{ok:!0,text:C.message??"已请求复位,设备重新枚举后断开并重新连接"}}catch(C){r.openedAt===S&&(v.reset={ok:!1,text:C.message})}}const j=ge(()=>r.scope!==null&&r.scope.objects.join()===t.join()),{configure:q,saveScope:z,span:K,data:N}=bp(km(v,"scope"));function B(S){return q(S?t:[],1)}function H(){yr()}function ce(S){return N(S,!0)}const fe=[{label:"实际转速",slot:1,unit:"rpm"},{label:"设备目标 0x2010",slot:1,dash:!0,unit:"rpm"}],Ne=[{label:"iq",slot:2,unit:"A"}],re=[{label:"母线电压",slot:3,unit:"mV"}],E=S=>S%6+1,U=ge(()=>{var C,F;const S=r.stepRuns.slice(-6).map(x=>{var be;const O=r.stepRuns.indexOf(x);return{label:`#${O+1}`,rows:x.rows,settle:Number(x.params.settle),slot:E(O),timeBase:String(((be=x.rows[0])==null?void 0:be.time_source)??"host")}});return((C=r.job)==null?void 0:C.kind)==="step"&&(r.job.params.mode??"motor_speed")==="motor_speed"&&r.liveStep.length&&S.push({label:`#${r.runCount+1}(运行中)`,rows:r.liveStep,settle:Number(r.job.params.settle),slot:E(r.runCount),timeBase:String(((F=r.liveStep[0])==null?void 0:F.time_source)??"host")}),S}),de=ge(()=>{const S=new Map;for(const C of U.value)S.set(C.timeBase,[...S.get(C.timeBase)??[],C]);return[...S].flatMap(([C,F])=>Array.from({length:Math.ceil(F.length/3)},(x,O)=>({timeBase:C,runs:F.slice(O*3,O*3+3)})))});function $e(S){return S.flatMap(C=>[{label:`${C.label} 实际转速`,slot:C.slot,unit:"rpm"},{label:`${C.label} 已发送目标`,slot:C.slot,unit:"rpm",dash:!0}])}const I=ge(()=>`${r.stepRuns.length}:${r.liveStep.length}`);function g(S){const C=S.map(F=>eu([F.rows.map(x=>x.t_s-F.settle),F.rows.map(x=>x.motor_rpm),F.rows.map(x=>x.target)],F.rows.map(x=>!!x.display_gap)));return as.join(C)}function ee(S){return S.flatMap(C=>fi(C.rows.map(F=>({t:F.t_s-C.settle,error_code:F.error_code})),r.errors).map(F=>({...F,label:`${C.label} ${F.label}`})))}const Oe=S=>({host:"主机接收时间",cycles:"SIL 周期时间",dc:"DC 时间"})[S]??S;function je(S){const C=Number(S.params.settle);return S.rows.some(F=>F.t_s>=C&&F.statusword&2048)}async function ie(S){if(S.record)try{await Yr(`/api/records/${S.record}/samples.csv`,`${S.record}.csv`)}catch(C){v.job={ok:!1,text:C.message}}}return Fs(async()=>{const S=r.openedAt;try{const C=await He("GET","/api/objects/encoder_counts_per_rev");r.connected&&r.openedAt===S&&Nl("encoder_counts_per_rev",C.value)}catch{}}),(S,C)=>{var F;return p(),h("div",V4,[C[62]||(C[62]=o("h1",null,"电机",-1)),o("p",{class:"secondary"},[C[19]||(C[19]=Y("换电机后的标定与速度环整定。步骤说明见 ",-1)),o("a",{href:US,target:"_blank"},"eha-firmware 技能“电机台架”"),C[20]||(C[20]=Y("。",-1))]),o("div",{class:"row params-link"},[o("button",{onClick:n},"编辑电机与编码器参数"),C[21]||(C[21]=o("span",{class:"caption"},"铭牌、编码器与保护阈值在参数页设置;需开发者模式且驱动未运行。",-1))]),v.job?(p(),h("p",D4,f(v.job.text),1)):R("",!0),o("section",L4,[C[25]||(C[25]=o("h2",null,"编码器检查",-1)),o("div",I4,[o("span",{class:Ve({stale:d(ut)("motor_encoder_count").stale})},[C[22]||(C[22]=Y("计数 ",-1)),o("button",{class:"plain num big",onClick:C[0]||(C[0]=x=>d(zt)("motor_encoder_count"))},f(d(ms)(d(r).byName.motor_encoder_count,d(r).state.motor_encoder_count)),1)],2),o("button",{disabled:typeof d(r).state.motor_encoder_count!="number",onClick:C[1]||(C[1]=x=>i.value=Number(d(r).state.motor_encoder_count))},"从这里开始计",8,U4),i.value!==null?(p(),h("span",F4,[Y("本次转动 "+f(Number(d(r).state.motor_encoder_count)-i.value)+" ",1),o("span",z4,[C[23]||(C[23]=Y("(每圈 ",-1)),o("button",{class:"plain num",onClick:C[2]||(C[2]=x=>d(zt)("encoder_counts_per_rev"))},f(d(r).state.encoder_counts_per_rev??"—"),1),C[24]||(C[24]=Y(")",-1))])])):R("",!0)]),o("p",{class:Ve(["caption",{stale:d(ut)("motor_encoder_count").stale}])},f(d(ut)("motor_encoder_count").text),3),o("p",{class:Ve(["caption",{stale:d(ut)("encoder_counts_per_rev").stale}])},"每圈计数 "+f(d(ut)("encoder_counts_per_rev").text),3),C[26]||(C[26]=o("p",{class:"caption"},"手转轴一圈,计数应变化约一圈的计数;不变说明编码器信号没有到达 MCU,先查接线,不改参数。",-1))]),o("section",H4,[o("h2",null,[C[27]||(C[27]=Y("自动标定",-1)),C[28]||(C[28]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:!d(an)(),onClick:C[3]||(C[3]=x=>_("calibrate",{timeout:10},x))},"转动电机并标定",8,B4)]),C[36]||(C[36]=o("p",{class:"caption"},"先设好每圈计数 0x2301、对齐电流 0x2307 与保护阈值。",-1)),C[37]||(C[37]=o("p",{class:"caption"},"标定会转动电机约 3 s,并把测得的极对数、线电阻、线电感写入 RAM;绝对式编码器还会更新零点与方向。当前会话保留标定前的原值,可在结果中恢复。",-1)),((F=d(r).job)==null?void 0:F.kind)==="calibrate"?(p(),h("div",W4,[o("span",{class:Ve({stale:d(ut)("motor_calibration_state").stale})},[C[29]||(C[29]=Y("标定状态 ",-1)),o("button",{class:"plain num",title:"在检查器中查看各值的含义",onClick:C[4]||(C[4]=x=>d(zt)("motor_calibration_state"))},"0x230D = "+f(d(r).state.motor_calibration_state??"—"),1),C[30]||(C[30]=Y()),o("span",K4,f(d(ut)("motor_calibration_state").text),1)],2),o("span",{class:Ve(d(r).job.state==="failed"?"status-critical":"")},f(d(r).job.end??"运行中")+" "+f(d(r).job.error??""),3)])):R("",!0),d(r).calibration?(p(),h(le,{key:1},[o("table",G4,[o("thead",null,[o("tr",null,[C[31]||(C[31]=o("th",null,"参数",-1)),C[32]||(C[32]=o("th",{class:"right"},"原值",-1)),C[33]||(C[33]=o("th",{class:"right"},"测得值",-1)),b.value?(p(),h("th",q4,"恢复后读回")):R("",!0)])]),o("tbody",null,[(p(!0),h(le,null,Ue(d(r).calibration.after,(x,O)=>{var be;return p(),h("tr",{key:O,class:"clickable",tabindex:"0",onClick:se=>d(zt)(String(O)),onKeydown:Un(se=>d(zt)(String(O)),["enter"])},[o("td",null,[Y(f(d(r).byName[O]?d(Js)(d(r).byName[O]):O)+" ",1),o("span",Y4,f(O),1)]),o("td",Z4,f(d(ms)(d(r).byName[O],d(r).calibration.before[O])),1),o("td",{class:Ve(["right num",x!==d(r).calibration.before[O]?"changed":""])},f(d(ms)(d(r).byName[O],x)),3),b.value?(p(),h("td",{key:0,class:Ve(["num",(be=b.value[O])!=null&&be.equal?"":"status-critical"])},f(b.value[O]?d(ms)(d(r).byName[O],b.value[O].readback):"—"),3)):R("",!0)],40,J4)}),128))])]),o("div",Q4,[C[34]||(C[34]=o("span",{class:"caption"},"测得值已写入设备 RAM,尚未保存。",-1)),C[35]||(C[35]=o("span",{class:"spacer"},null,-1)),v.restore?(p(),h("span",{key:0,class:Ve(v.restore.ok?"caption":"status-critical"),"aria-live":"polite"},f(v.restore.text),3)):R("",!0),o("button",{disabled:!d(an)(),onClick:$},"恢复原值",8,X4),o("button",{disabled:!!d(Es)("store_parameters"),title:d(Es)("store_parameters"),onClick:C[5]||(C[5]=x=>L("restore"))},"保存到 Flash",8,eS)])],64)):R("",!0)]),d(r).state.via==="usb"?(p(),h("section",tS,[o("h2",null,[C[39]||(C[39]=Y("示波 ",-1)),d(r).scope?(p(),h("span",sS,f(d(r).scope.rate_hz)+" Hz · 设备时刻 · 丢帧 "+f(d(r).scope.gaps),1)):R("",!0),C[40]||(C[40]=o("span",{class:"spacer"},null,-1)),we(o("select",{"onUpdate:modelValue":C[6]||(C[6]=x=>It(K)?K.value=x:null),"aria-label":"显示窗口"},[...C[38]||(C[38]=[o("option",{value:1},"1 s",-1),o("option",{value:2},"2 s",-1),o("option",{value:5},"5 s",-1),o("option",{value:10},"10 s",-1),o("option",{value:30},"30 s",-1)])],512),[[hs,d(K),void 0,{number:!0}]]),o("button",{onClick:H},f(d(r).scopeFrozen?"继续":"冻结"),1),d(r).scope?(p(),h("button",{key:1,onClick:C[7]||(C[7]=(...x)=>d(z)&&d(z)(...x))},"保存最近 30 s")):R("",!0),j.value?(p(),h("button",{key:3,disabled:d(Xt)(),onClick:C[9]||(C[9]=x=>B(!1))},"停止示波",8,lS)):(p(),h("button",{key:2,disabled:!d(r).connected||!d(r).link.ok||d(Xt)(),onClick:C[8]||(C[8]=x=>B(!0))},"开始示波",8,nS))]),o("div",oS,[o("label",iS,[C[41]||(C[41]=Y("回看 ",-1)),we(o("input",{type:"range","onUpdate:modelValue":C[10]||(C[10]=x=>It(is)?is.value=x:null),min:"0",max:60-d(K),step:"0.1"},null,8,aS),[[Re,d(is),void 0,{number:!0}]]),Y(" "+f(d(is).toFixed(1))+" s",1)]),o("button",{class:"plain",onClick:C[11]||(C[11]=x=>is.value=0)},"最新")]),d(r).scope&&!j.value?(p(),h("p",rS,"设备上的示波正在采集其他对象;“开始示波”会替换为 0x2010、0x2011、0x2014、0x6079 四路。")):R("",!0),v.scope?(p(),h("p",{key:1,class:Ve(v.scope.ok?"caption":"status-critical"),"aria-live":"polite"},f(v.scope.text),3)):R("",!0),st(rn,{series:fe,data:ce(["motor_speed_rpm","target_motor_speed_rpm"]),tick:`${d(El)}:${d(is)}:${d(K)}`,"sync-key":"device",height:170,"frozen-at":d(r).scopeFrozen,"time-label":"t / s(设备时刻,相对最新样本)"},null,8,["data","tick","frozen-at"]),st(rn,{series:Ne,data:ce(["motor_iq_a"]),tick:`${d(El)}:${d(is)}:${d(K)}`,"sync-key":"device",height:110,"frozen-at":d(r).scopeFrozen,"time-label":"t / s(设备时刻)"},null,8,["data","tick","frozen-at"]),st(rn,{series:re,data:ce(["dc_link_voltage_mv"]),tick:`${d(El)}:${d(is)}:${d(K)}`,"sync-key":"device",height:110,"frozen-at":d(r).scopeFrozen,"time-label":"t / s(设备时刻)"},null,8,["data","tick","frozen-at"])])):(p(),vt(pp,{key:2})),o("section",uS,[C[55]||(C[55]=o("h2",null,"转速运行与整定",-1)),C[56]||(C[56]=o("p",{class:"caption"},"速度环增益只能在驱动未运行时写入:停机改增益,再跑一次阶跃,新曲线叠在前几次上。试验期间自行进出开发者模式。",-1)),st(kn,{names:s}),o("div",cS,[o("label",dS,[C[43]||(C[43]=Y("运行方式 ",-1)),we(o("select",{"onUpdate:modelValue":C[12]||(C[12]=x=>l.value=x)},[...C[42]||(C[42]=[o("option",{value:"step"},"转速阶跃",-1),o("option",{value:"run"},"有界转速运行",-1)])],512),[[hs,l.value]])]),l.value==="step"?(p(),h("label",fS,[C[44]||(C[44]=Y("起始 ",-1)),we(o("input",{class:"num",type:"number","onUpdate:modelValue":C[13]||(C[13]=x=>a.start=x)},null,512),[[Re,a.start,void 0,{number:!0}]]),C[45]||(C[45]=o("span",{class:"unit"},"rpm",-1))])):R("",!0),o("label",pS,[C[46]||(C[46]=Y("目标转速 ",-1)),we(o("input",{class:"num",type:"number","onUpdate:modelValue":C[14]||(C[14]=x=>u.value.target=x)},null,512),[[Re,u.value.target,void 0,{number:!0}]]),C[47]||(C[47]=o("span",{class:"unit"},"rpm",-1))]),l.value==="step"?(p(),h("label",mS,[C[48]||(C[48]=Y("阶跃前保持 ",-1)),we(o("input",{class:"num",type:"number",step:"0.1","onUpdate:modelValue":C[15]||(C[15]=x=>a.settle=x)},null,512),[[Re,a.settle,void 0,{number:!0}]]),C[49]||(C[49]=o("span",{class:"unit"},"s",-1))])):R("",!0),o("label",vS,[Y(f(l.value==="step"?"阶跃后记录":"运行时长")+" ",1),we(o("input",{class:"num",type:"number",step:"0.1",min:"0.1",max:l.value==="run"?60:void 0,"onUpdate:modelValue":C[16]||(C[16]=x=>u.value.seconds=x)},null,8,hS),[[Re,u.value.seconds,void 0,{number:!0}]]),C[50]||(C[50]=o("span",{class:"unit"},"s",-1))]),C[51]||(C[51]=o("span",{class:"spacer"},null,-1)),o("button",{class:"primary",disabled:!d(an)(),onClick:k},f(l.value==="step"?"运行转速阶跃":"运行目标转速"),9,bS)]),C[57]||(C[57]=o("p",{class:"caption"},"首次使能先对齐约 1.3 s,再跟随转速。到时快停后断电,有界转速运行最长 60 s。",-1)),(p(!0),h(le,null,Ue(de.value,(x,O)=>(p(),vt(rn,{key:x.timeBase+O,series:$e(x.runs),data:()=>g(x.runs),tick:I.value,"sync-key":`motor-${x.timeBase}`,height:220,markers:()=>ee(x.runs),"time-label":`t / s(从阶跃起,${Oe(x.timeBase)})`},null,8,["series","data","tick","sync-key","markers","time-label"]))),128)),d(r).stepRuns.length?(p(),h("table",gS,[C[52]||(C[52]=o("thead",null,[o("tr",null,[o("th",null,"#"),o("th",{class:"right"},"kp"),o("th",{class:"right"},"ki"),o("th",null,"阶跃"),o("th",{class:"right"},"超调"),o("th",{class:"right"},"10–90% 上升"),o("th",{class:"right"},"调节"),o("th",{class:"right"},"稳态误差"),o("th",null,"结束"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(d(r).stepRuns,(x,O)=>(p(),h("tr",{key:x.id},[o("td",null,[o("span",{class:"swatch",style:Rl({background:`var(--series-${E(O)})`}),"aria-hidden":"true"},null,4),Y("#"+f(O+1),1)]),o("td",_S,f(d(ms)(d(r).byName.motor_speed_kp,x.gains.kp)),1),o("td",yS,f(d(ms)(d(r).byName.motor_speed_ki,x.gains.ki)),1),o("td",kS,f(x.params.start)+" → "+f(x.params.target),1),o("td",wS,f(d(fs)(x.metrics,"rpm",2).overshoot),1),o("td",$S,f(d(fs)(x.metrics,"rpm",2).rise),1),o("td",xS,f(d(fs)(x.metrics,"rpm",2).settling),1),o("td",SS,f(d(fs)(x.metrics,"rpm",2).steady),1),o("td",{class:Ve(!d(fs)(x.metrics,"rpm",2).valid||x.end!=="完成"||je(x)?"status-warning":"")},[Y(f(x.end),1),d(fs)(x.metrics,"rpm",2).valid?R("",!0):(p(),h(le,{key:0},[Y(";"+f(d(fs)(x.metrics,"rpm",2).validity),1)],64)),je(x)?(p(),h(le,{key:1},[Y(";指令被限幅(位 11)")],64)):R("",!0)],2),o("td",null,[x.record?(p(),h("button",{key:0,onClick:be=>ie(x)},"CSV",8,CS)):R("",!0)])]))),128))])])):R("",!0),d(r).stepRuns.length?(p(),h("div",AS,[C[53]||(C[53]=o("span",{class:"caption"},"调节时间按阶跃量 2% 的带宽计算。指令被限幅时(例如仿真活塞到了软限位,行程包络只允许朝内运动),指标不反映速度环本身。",-1)),C[54]||(C[54]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:C[17]||(C[17]=x=>d(r).stepRuns=[])},"清除叠加")])):R("",!0)]),o("section",TS,[C[59]||(C[59]=o("h2",null,"保存与复位",-1)),o("div",OS,[o("button",{disabled:!!d(Es)("store_parameters"),title:d(Es)("store_parameters"),onClick:C[18]||(C[18]=x=>L("save"))},"保存到 Flash",8,ES),v.save?(p(),h("span",{key:0,class:Ve(v.save.ok?"caption":"status-critical"),"aria-live":"polite"},f(v.save.text),3)):(p(),h("span",PS,"保存设备上当前全部可持久参数,包括不是本页写入的改动。")),C[58]||(C[58]=o("span",{class:"spacer"},null,-1)),v.reset?(p(),h("span",{key:2,class:Ve(v.reset.ok?"caption":"status-critical"),"aria-live":"polite"},f(v.reset.text),3)):R("",!0),o("button",{disabled:!!d(Es)("device_reset"),title:d(Es)("device_reset"),onClick:V},"复位设备",8,MS)]),d(Es)("store_parameters")?(p(),h("p",NS,"保存参数 "+f(d(Es)("store_parameters")),1)):R("",!0),d(Es)("device_reset")?(p(),h("p",jS,"复位设备 "+f(d(Es)("device_reset")),1)):R("",!0),Number(d(r).state.firmware_slot)===255?(p(),h("p",RS,"设备运行非槽开发镜像。复位后可能不再运行它(RAM 加载的镜像会丢失),未保存参数与开发者模式随之丢失,连接断开。")):R("",!0)]),d(r).job?(p(),h("section",VS,[o("h2",null,[C[60]||(C[60]=Y("最近任务",-1)),C[61]||(C[61]=o("span",{class:"spacer"},null,-1)),o("span",DS,f(d(r).job.kind)+" · "+f(d(r).job.end??"运行中"),1)]),d(r).job.note?(p(),h("p",LS,f(d(r).job.note),1)):R("",!0),o("pre",IS,f(d(r).job.log.join(`
133
+ `))+f(d(r).job.error?`
134
+ `+d(r).job.error:""),1)])):R("",!0)])}}}),zS=Wt(FS,[["__scopeId","data-v-2ff46ca1"]]),HS={class:"page"},BS={class:"grid"},WS={class:"card"},KS={class:"caption"},GS=["onClick"],qS={class:"caption"},JS={class:"num"},YS={key:0,class:"caption"},ZS={class:"num"},QS={class:"mono"},XS={class:"card"},e8=["title"],t8={class:"caption"},s8={class:"caption"},n8={class:"caption"},l8={class:"caption"},o8={key:0,class:"caption"},i8={class:"caption"},a8={class:"card"},r8={class:"caption"},u8=["onClick"],c8={class:"caption"},d8={key:0,class:"status-warning"},f8={class:"card"},p8=["onClick"],m8={class:"caption"},v8={key:0,class:"status-warning"},h8={key:1,class:"status-warning"},b8={class:"card wide"},g8={class:"diag"},_8=["onClick"],y8={class:"caption"},k8={class:"num"},w8={class:"unit"},$8={class:"caption"},x8={class:"caption"},S8={class:"caption"},C8={class:"card wide"},A8={class:"events"},T8={class:"num caption"},O8=Bt({__name:"OverviewPage",setup(e){const t=u=>Al(r.byName[u],r.state[u]),s=["control_load_pct","core1_load_pct","drive_cycle_max_us","core1_loop_max_us","chip_temperature_c","power_stage_temp_c","dc_link_voltage_mv","sync0_missed_count","ipc_read_failures","core1_init_error"],n=ge(()=>r.identity?r.openedAt===null?"连接时间未知":`本次连接时读取(${new Date(r.openedAt*1e3).toLocaleTimeString()})`:"设备身份未确认"),l=ge(()=>({2:"参数区不可用,当前按出厂默认运行。请检查存储并重新配置、保存。",4:"已保存参数的格式与当前固件不兼容,请重新配置并保存。",5:"部分参数已回退至出厂默认,请核对后重新保存。"})[Number(r.state.params_source)]??""),a=ge(()=>{const u=r.state.param_check;return typeof u!="number"||u===0?"":[2,4,5].includes(u)?"整机标定或硬限参数不一致,请在装配页核对后再使能。":"参数集不一致,请在参数页核对后再使能。"});function c(u,i,v){return F1(r.state[u],r.state[i],v,r.missing.includes(u))}return(u,i)=>{var v,b,_,k,$,L,V;return p(),h("div",HS,[i[32]||(i[32]=o("h1",null,"概览",-1)),o("div",BS,[o("section",WS,[i[17]||(i[17]=o("h2",null,"设备与固件",-1)),o("dl",null,[i[12]||(i[12]=o("dt",null,"产品",-1)),o("dd",null,[Y(f(d(r).device.name)+" · ",1),o("button",{class:"plain num",onClick:i[0]||(i[0]=j=>d(zt)("product_code"))},"产品码 "+f(d(r).identity?`0x${d(r).identity.product_code.toString(16).toUpperCase()}`:"未确认"),1),i[11]||(i[11]=Y(" · ",-1)),o("button",{class:"plain num",onClick:i[1]||(i[1]=j=>d(zt)("revision"))},"修订 "+f(d(r).identity?`0x${d(r).identity.revision.toString(16).toUpperCase()}`:"未确认"),1)]),i[13]||(i[13]=o("dt",null,"序列号",-1)),o("dd",null,[o("button",{class:"plain num",onClick:i[2]||(i[2]=j=>d(zt)("serial_number"))},f(((v=d(r).identity)==null?void 0:v.serial_number.toString(16).toUpperCase().padStart(8,"0"))??"未确认"),1),o("div",KS,f(n.value),1)]),(p(),h(le,null,Ue(["firmware_slot","firmware_confirmed","firmware_debug","firmware_slot_a_version","firmware_slot_b_version"],j=>(p(),h(le,{key:j},[o("dt",null,f(d(r).byName[j]?d(Js)(d(r).byName[j]):j),1),o("dd",{class:Ve({stale:d(ut)(j).stale})},[o("button",{class:"plain num",onClick:q=>d(zt)(j)},f(t(j)),9,GS),o("div",qS,f(d(ut)(j).text),1)],2)],64))),64)),i[14]||(i[14]=o("dt",null,"运行固件",-1)),o("dd",JS,[Y(f(((b=d(r).identity)==null?void 0:b.version)||(((_=d(r).identity)==null?void 0:_.slot)===255?"非槽开发镜像,版本未知":"尚未读取")),1),(k=d(r).identity)!=null&&k.version_source?(p(),h("span",YS,"("+f(d(r).identity.version_source)+")",1)):R("",!0)]),i[15]||(i[15]=o("dt",null,"工具包",-1)),o("dd",ZS,f(d(r).toolVersion),1),i[16]||(i[16]=o("dt",null,"端口",-1)),o("dd",QS,f(($=d(r).identity)==null?void 0:$.port),1)])]),o("section",XS,[i[23]||(i[23]=o("h2",null,"驱动",-1)),o("dl",null,[i[18]||(i[18]=o("dt",null,"状态",-1)),o("dd",{class:Ve({stale:d(ut)("statusword").stale})},[o("button",{class:"plain",title:d(r).state.state,onClick:i[3]||(i[3]=j=>d(zt)("statusword"))},f(d(ea)(d(r).state.state)),9,e8),o("div",t8,f(d(ut)("statusword").text),1)],2),i[19]||(i[19]=o("dt",null,"模式",-1)),o("dd",{class:Ve({stale:d(ut)("modes_of_operation").stale})},[o("button",{class:"plain",onClick:i[4]||(i[4]=j=>d(zt)("modes_of_operation"))},f(d(r).state.mode_text??"模式未读取"),1),o("div",s8,f(d(ut)("modes_of_operation").text),1)],2),i[20]||(i[20]=o("dt",null,"状态字 0x6041",-1)),o("dd",{class:Ve({stale:d(ut)("statusword").stale})},[o("button",{class:"plain num",onClick:i[5]||(i[5]=j=>d(zt)("statusword"))},f(t("statusword")),1),(p(!0),h(le,null,Ue(d(r).state.status_bits??[],j=>(p(),h("span",{key:j,class:"tag"},f(j),1))),128)),o("div",n8,f(d(ut)("statusword").text),1)],2),i[21]||(i[21]=o("dt",null,"故障 0x603F",-1)),o("dd",{class:Ve({"status-critical":Number(d(r).state.error_code),stale:d(ut)("error_code").stale})},[o("button",{class:"plain num",onClick:i[6]||(i[6]=j=>d(zt)("error_code"))},f(d(r).missing.includes("error_code")?"设备不提供":d(r).state.error_code==null?"未读取":d(r).state.error_code?`0x${d(r).state.error_code.toString(16).toUpperCase().padStart(4,"0")} ${((L=d(r).state.diagnostic)==null?void 0:L.name)??""}`:"无"),1),o("div",l8,f(d(ut)("error_code").text),1),Number(d(r).state.error_code)?(p(),h("div",o8,f((V=d(r).state.diagnostic)==null?void 0:V.description_zh),1)):R("",!0)],2),i[22]||(i[22]=o("dt",null,"转速",-1)),o("dd",{class:Ve({stale:d(ut)("motor_speed_rpm").stale})},[o("button",{class:"plain num",onClick:i[7]||(i[7]=j=>d(zt)("motor_speed_rpm"))},f(t("motor_speed_rpm"))+" rpm",1),o("div",i8,f(d(ut)("motor_speed_rpm").text),1)],2)])]),o("section",a8,[i[26]||(i[26]=o("h2",null,"属主与失联",-1)),o("dl",null,[i[24]||(i[24]=o("dt",null,"固件属主 0x2005",-1)),o("dd",{class:Ve({stale:d(ut)("control_owner").stale})},[o("button",{class:"plain",onClick:i[8]||(i[8]=j=>d(zt)("control_owner"))},f(d(r).state.owner_text??"未读取"),1),o("div",r8,f(d(ut)("control_owner").text),1)],2),i[25]||(i[25]=o("dt",null,"本服务",-1)),o("dd",null,f(d(xf)(d(r).state.sending,d(r).job)),1),(p(),h(le,null,Ue(["abort_connection_option","quick_stop_option","command_timeout_ms"],j=>{var q;return p(),h(le,{key:j},[o("dt",null,f(d(r).byName[j]?d(Js)(d(r).byName[j]):j),1),o("dd",{class:Ve({stale:d(ut)(j).stale})},[o("button",{class:"plain num",onClick:z=>d(zt)(j)},f(t(j))+f((q=d(r).byName[j])!=null&&q.unit?" "+d(r).byName[j].unit:""),9,u8),o("div",c8,f(d(ut)(j).text),1)],2)],64)}),64))]),Number(d(r).state.abort_connection_option)===0?(p(),h("p",d8,"0x6007 = 0,上位机失联时设备会继续执行最后目标。请先在参数页设置失联反应,再开始手动控制。")):R("",!0)]),o("section",f8,[i[27]||(i[27]=o("h2",null,"参数集",-1)),o("dl",null,[(p(),h(le,null,Ue(["params_source","param_check"],j=>(p(),h(le,{key:j},[o("dt",null,f(j==="params_source"?"来源 0x2025":"一致性 0x2028"),1),o("dd",{class:Ve({"status-warning":j==="param_check"&&Number(d(r).state.param_check),stale:d(ut)(j).stale})},[o("button",{class:"plain num",onClick:q=>d(zt)(j)},f(t(j)),9,p8),o("div",m8,f(d(ut)(j).text),1)],2)],64))),64))]),l.value?(p(),h("p",v8,f(l.value),1)):R("",!0),a.value?(p(),h("p",h8,f(a.value),1)):R("",!0)]),o("section",b8,[i[30]||(i[30]=o("h2",null,"运行诊断",-1)),o("div",g8,[(p(),h(le,null,Ue(s,j=>{var q;return o("button",{key:j,class:Ve(["cell",{stale:d(ut)(j).stale}]),onClick:z=>d(zt)(j)},[o("span",y8,f(d(r).byName[j]?d(Js)(d(r).byName[j]):j),1),o("span",k8,[Y(f(t(j)),1),o("span",w8,f((q=d(r).byName[j])==null?void 0:q.unit),1)]),o("span",$8,f(d(ut)(j).text),1)],10,_8)}),64)),o("button",{class:Ve(["cell",{stale:d(ut)("reset_cause").stale}]),onClick:i[9]||(i[9]=j=>d(zt)("reset_cause"))},[i[28]||(i[28]=o("span",{class:"caption"},"复位原因",-1)),o("span",null,f(c("reset_cause","reset_cause_text","上电复位")),1),o("span",x8,f(d(ut)("reset_cause").text),1)],2),o("button",{class:Ve(["cell",{stale:d(ut)("can_error_state").stale}]),onClick:i[10]||(i[10]=j=>d(zt)("can_error_state"))},[i[29]||(i[29]=o("span",{class:"caption"},"对外 CAN",-1)),o("span",null,f(c("can_error_state","can_error_text","无错误标志")),1),o("span",S8,f(d(ut)("can_error_state").text),1)],2)])]),o("section",C8,[i[31]||(i[31]=o("h2",null,[Y("本次会话的事件"),o("span",{class:"spacer"}),o("span",{class:"caption"},"主机观察,设备诊断历史 0x10F3 尚未实现")],-1)),o("ol",A8,[(p(!0),h(le,null,Ue(d(r).events.slice().reverse().slice(0,40),(j,q)=>(p(),h("li",{key:q,class:Ve(j.kind==="fault"?"status-critical":"")},[o("span",T8,f(new Date(j.t*1e3).toLocaleTimeString()),1),Y(" "+f(j.text),1)],2))),128))])])])])}}}),E8=Wt(O8,[["__scopeId","data-v-c432b1fa"]]),P8={class:"page"},M8={class:"row bar"},N8=["disabled"],j8={key:0,class:"caption"},R8={key:1,class:"caption"},V8={class:"row bar"},D8=["disabled"],L8=["disabled"],I8=["disabled"],U8=["disabled"],F8=["disabled"],z8={key:1,class:"card"},H8={class:"caption"},B8={class:"row"},W8=["disabled"],K8=["disabled"],G8={class:"caption"},q8={key:0,class:"list"},J8={class:"right"},Y8={key:0},Z8={class:"mono"},Q8={class:"right num"},X8={class:"right num"},e6={key:0,class:"caption"},t6={key:0,class:"caption"},s6={key:2,class:"secondary"},n6={key:3,class:"writebar"},l6=["disabled"],o6=["disabled"],i6={key:3,class:"list diff"},a6={class:"right"},r6={class:"mono"},u6={class:"right num"},c6={class:"right num"},d6=Bt({__name:"ParamsPage",setup(e){const t=ri(),s=ri(),n=_e(r.connected?"device":"file"),l=_e(""),a=_e("all"),c=_e(null),u=_e(!1),i=_e(),v=_e(),b=_e(!1),_=_e(!1),k=_e({}),$=_e("eha-params.toml"),L=_e(""),V=_e(""),j=_e({}),q=_e(""),z=ge(()=>n.value==="device"?t:s),K=ge(()=>Go(s)),N=ge(()=>Go(z.value)),B=ge(()=>r.od.map(F=>F.name).filter(F=>N.value.includes(F))),H=ge(()=>N.value.some(F=>Ko(F)));function ce(F){const x=r.byName[F],O=l.value.trim().toLowerCase();if(O&&!(x.name.includes(O)||(x.desc??"").toLowerCase().includes(O)||ii(x).toLowerCase().includes(O)||r.layout.some(be=>be.name.toLowerCase().includes(O)&&be.names.includes(F))))return!1;if(a.value==="writable")return r.layout.some(be=>be.managed&&be.names.includes(F))?!1:n.value==="file"?x.access==="rw"&&x.pdo!=="rx"&&!r.commands.includes(F):Ko(F)!=="只读"&&Ko(F)!=="具名操作";if(a.value==="persist")return!!x.persist;if(a.value==="changed"){const be=n.value==="device"?r.state[F]:k.value[F],se=be===void 0?null:Ml(x,String(be));return x.default!==void 0&&se!==null&&("error"in se||!ll(x,x.default,se.value))}return a.value==="drafts"?!!z.value.drafts[F]:!0}const fe=ge(()=>new Set(r.od.map(F=>F.name).filter(ce))),Ne=ge(()=>r.layout.map(F=>({...F,count:F.names.filter(x=>fe.value.has(x)).length}))),re=ge(()=>V.value==="file"?j.value:Object.fromEntries(Object.keys(k.value).map(F=>{var x;return[F,V.value==="device"?r.state[F]:(x=r.byName[F])==null?void 0:x.default]}))),E=ge(()=>V.value?W1(r.od,k.value,re.value):[]),U=ge(()=>({defaults:"出厂默认",file:q.value,device:"设备值","":""})[V.value]);it(()=>r.paramsQuery,F=>{F&&(l.value=F,a.value="all",r.paramsQuery="")},{immediate:!0}),it(()=>r.openedAt,()=>{so(t),r.connected||(n.value="file",V.value==="device"&&(V.value=""))}),it(()=>r.connected&&n.value==="device"?[...fe.value]:[],F=>vc(F),{immediate:!0});async function de(){if(!(!r.connected||n.value!=="device")){_.value=!0;try{await Nr(t,[...fe.value])}finally{_.value=!1}}}async function $e(){n.value==="device"&&r.connected&&await hp(t,B.value)}async function I(){const F=r.openedAt;if(!(!r.connected||F===null)){c.value=null;try{const x=await He("POST","/api/actions/export",{opened_at:F});if(!r.connected||r.openedAt!==F)return;Ji(new Blob([x.text],{type:"application/toml"}),x.name),c.value={ok:!0,text:`已导出设备参数 ${x.name}`}}catch(x){r.connected&&r.openedAt===F&&(c.value={ok:!1,text:x.message})}}}function g(F){let x=!0;for(const[O,be]of Object.entries(F)){const se=Ml(r.byName[O],be);("error"in se||r.byName[O].type==="f32"&&!Number.isFinite(Math.fround(se.value)))&&(s.status[O]={kind:"rejected",text:"error"in se?se.error:"超出 f32 的存储范围"},x=!1)}return x||(c.value={ok:!1,text:"参数文件含非法值,请按所在行的说明修改。"}),x}function ee(){const F={...k.value,...Object.fromEntries(K.value.map(x=>[x,s.drafts[x]]))};g(F)&&(k.value=F,so(s),c.value={ok:!0,text:"文件草稿已应用,可导出参数文件。"})}function Oe(){k.value=Object.fromEntries(r.od.filter(F=>F.persist&&F.default!==void 0).map(F=>[F.name,String(F.default)])),$.value="eha-defaults.toml",L.value="",so(s),n.value="file",V.value="",c.value={ok:!0,text:"已按对象字典创建出厂默认参数文件。"}}function je(){if(K.value.length||!g(k.value))return;const F=B1(k.value,L.value);Ji(new Blob([F],{type:"application/toml"}),$.value),L.value=F,c.value={ok:!0,text:`已导出 ${$.value}`}}async function ie(F,x=!1){var se;const O=F.target,be=(se=O.files)==null?void 0:se[0];if(O.value="",!(!be||t.writing||b.value)){b.value=!0,c.value=null;try{const ft=await be.text(),Z=ta(ft,new Set(r.od.map(D=>D.name)));if(Z.errors.length){c.value={ok:!1,text:Z.errors.join(";")};return}let Je=!0;x?(j.value=Z.values,q.value=be.name,V.value="file"):(L.value=ft,k.value=Z.values,$.value=be.name,so(s),n.value="file",V.value="",a.value="all",Je=g(Z.values));const A=Z.unknown.length?`;${Z.unknown.length} 个未知对象保留在原文件中`:"";Je&&(c.value={ok:!0,text:`已读入 ${be.name} 的 ${Object.keys(Z.values).length} 项参数${A}`})}catch(ft){c.value={ok:!1,text:`读取参数文件失败:${ft.message}`}}finally{b.value=!1}}}async function S(){if(!r.connected||n.value!=="file")return;if(r.state.via==="can"&&!r.state.sdo_poll){c.value={ok:!1,text:"CAN 当前只侦听 TPDO,请先在设备状态面板开启 SDO 访问再读取比较。"};return}_.value=!0;const F=r.openedAt;try{await Nr(t,Object.keys(k.value)),r.connected&&r.openedAt===F&&(V.value="device")}finally{_.value=!1}}function C(){var x;if(!r.connected||K.value.length||!g(k.value))return;const F=L.value?H1(L.value,(x=r.identity)==null?void 0:x.product_code):null;if(F){c.value={ok:!1,text:F};return}n.value="device",vp(t,k.value,r.layout.filter(O=>!O.managed).flatMap(O=>O.names)),a.value="drafts",c.value={ok:!0,text:`已列出 ${Go(t).length} 项设备草稿;写入前请核对设备值、属主和运动影响。`}}return cl(()=>vc([])),(F,x)=>(p(),h("div",P8,[x[21]||(x[21]=o("h1",null,"参数",-1)),o("div",M8,[o("button",{class:Ve({primary:n.value==="device"}),disabled:!d(r).connected,onClick:x[0]||(x[0]=O=>n.value="device")},"设备参数",10,N8),o("button",{class:Ve({primary:n.value==="file"}),onClick:x[1]||(x[1]=O=>n.value="file")},"参数文件与对象字典",2),d(r).connected?n.value==="device"?(p(),h("span",R8,f(d(r).state.developer?"开发者模式:整机出厂参数可写":"用户模式:开发者级对象只读"),1)):R("",!0):(p(),h("span",j8,"连接设备前可浏览对象字典、编辑与比较本机参数文件。"))]),o("div",V8,[we(o("input",{class:"search","onUpdate:modelValue":x[2]||(x[2]=O=>l.value=O),placeholder:"搜索名称、说明、地址或分组","aria-label":"搜索参数"},null,512),[[Re,l.value]]),we(o("select",{"onUpdate:modelValue":x[3]||(x[3]=O=>a.value=O),"aria-label":"筛选"},[...x[11]||(x[11]=[Sv('<option value="all" data-v-3de8c084>全部对象</option><option value="writable" data-v-3de8c084>只看可写</option><option value="persist" data-v-3de8c084>只看可保存</option><option value="changed" data-v-3de8c084>与出厂默认不同</option><option value="drafts" data-v-3de8c084>只看草稿</option>',5)])],512),[[hs,a.value]]),x[12]||(x[12]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:x[4]||(x[4]=O=>{var be;return(be=i.value)==null?void 0:be.click()}),disabled:d(t).writing||b.value},"打开参数文件",8,D8),o("input",{ref_key:"fileInput",ref:i,type:"file",accept:".toml,text/plain",hidden:"",onChange:x[5]||(x[5]=O=>ie(O))},null,544),n.value==="device"?(p(),h(le,{key:0},[o("button",{onClick:de,disabled:!d(r).connected||d(t).writing||_.value},f(_.value?"读取中…":"读取当前列表"),9,L8),o("button",{onClick:I,disabled:!d(r).connected||!d(r).link.ok},"导出设备参数",8,I8)],64)):(p(),h(le,{key:1},[o("button",{onClick:Oe,disabled:K.value.length>0},"从出厂默认新建",8,U8),o("button",{onClick:je,disabled:K.value.length>0||!Object.keys(k.value).length},"导出当前文件",8,F8)],64))]),c.value?(p(),h("p",{key:0,class:Ve(c.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(c.value.text),3)):R("",!0),n.value==="file"?(p(),h("section",z8,[o("h2",null,[Y(f($.value),1),x[13]||(x[13]=o("span",{class:"spacer"},null,-1)),o("span",H8,f(Object.keys(k.value).length)+" 项",1)]),o("div",B8,[o("button",{onClick:x[6]||(x[6]=O=>V.value="defaults")},"与出厂默认比较"),o("button",{onClick:x[7]||(x[7]=O=>{var be;return(be=v.value)==null?void 0:be.click()})},"与另一文件比较"),o("input",{ref_key:"compareInput",ref:v,type:"file",accept:".toml,text/plain",hidden:"",onChange:x[8]||(x[8]=O=>ie(O,!0))},null,544),o("button",{disabled:!d(r).connected||_.value,onClick:S},"读取设备并比较",8,W8),x[14]||(x[14]=o("span",{class:"spacer"},null,-1)),o("button",{disabled:!d(r).connected||K.value.length>0,onClick:C},"列为设备草稿",8,K8)]),V.value?(p(),h(le,{key:0},[o("p",G8,"当前文件与"+f(U.value)+"比较,共 "+f(E.value.length)+" 项差异"+f(V.value==="defaults"||V.value==="device"?"(仅比较文件包含的对象)":"")+"。",1),E.value.length?(p(),h("table",q8,[o("thead",null,[o("tr",null,[x[15]||(x[15]=o("th",null,"参数",-1)),x[16]||(x[16]=o("th",{class:"right"},"当前文件",-1)),o("th",J8,f(U.value),1),V.value==="device"?(p(),h("th",Y8,"读取时间")):R("",!0)])]),o("tbody",null,[(p(!0),h(le,null,Ue(E.value,O=>(p(),h("tr",{key:O.name},[o("td",Z8,f(O.name),1),o("td",Q8,f(O.left??"未包含"),1),o("td",X8,f(O.right??(V.value==="device"?"尚未读取":"未包含")),1),V.value==="device"?(p(),h("td",e6,f(d(ut)(O.name).text),1)):R("",!0)]))),128))])])):R("",!0)],64)):R("",!0)])):R("",!0),(p(!0),h(le,null,Ue(Ne.value,O=>we((p(),h("section",{key:O.name,class:"card"},[o("h2",null,[Y(f(O.name),1),x[17]||(x[17]=o("span",{class:"spacer"},null,-1)),O.managed?(p(),h("span",t6,"由专用页面管理,这里只读")):R("",!0)]),(p(),vt(kn,{key:n.value,names:O.names,readonly:O.managed,model:z.value,visible:fe.value,foot:!1,"file-values":n.value==="file"?k.value:void 0},null,8,["names","readonly","model","visible","file-values"]))])),[[qr,O.count]])),128)),fe.value.size?R("",!0):(p(),h("p",s6,"没有匹配的对象。")),N.value.length?(p(),h("div",n6,[o("span",null,f(N.value.length)+" 项"+f(n.value==="file"?"文件草稿":"未写入")+f(n.value==="device"&&H.value?";有草稿所在行当前不可写":""),1),o("button",{class:"plain",onClick:x[9]||(x[9]=O=>u.value=!u.value)},f(u.value?"隐藏差异":"查看差异"),1),x[20]||(x[20]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:x[10]||(x[10]=O=>d(so)(z.value)),disabled:z.value.writing},"放弃全部草稿",8,l6),n.value==="file"?(p(),h("button",{key:0,class:"primary",onClick:ee},"应用到参数文件")):(p(),h("button",{key:1,class:"primary",onClick:$e,disabled:d(t).writing||b.value||H.value||!d(r).connected},"按顺序写入设备",8,o6)),n.value==="device"?(p(),h("p",{key:2,class:Ve(["impact caption",{"status-warning":d(r).state.running}])},f(d(mp)()),3)):R("",!0),u.value?(p(),h("table",i6,[o("thead",null,[o("tr",null,[x[18]||(x[18]=o("th",null,"对象",-1)),o("th",a6,f(n.value==="file"?"文件值":"设备值"),1),x[19]||(x[19]=o("th",{class:"right"},"草稿",-1))])]),o("tbody",null,[(p(!0),h(le,null,Ue(B.value,O=>(p(),h("tr",{key:O},[o("td",r6,f(O),1),o("td",u6,f(n.value==="file"?k.value[O]??"未包含":d(Al)(d(r).byName[O],d(r).state[O])),1),o("td",c6,f(z.value.drafts[O]),1)]))),128))])])):R("",!0)])):R("",!0)]))}}),f6=Wt(d6,[["__scopeId","data-v-3de8c084"]]),p6={class:"page"},m6={class:"row bar"},v6=["value"],h6=["value"],b6={class:"field"},g6={class:"field"},_6={class:"button"},y6={key:1,class:"status-critical"},k6={key:2,class:"card"},w6={class:"field"},$6={key:0,class:"status-warning"},x6={key:1,class:"list"},S6={class:"right num"},C6={class:"right num"},A6={class:"right num"},T6={class:"right num"},O6={class:"card"},E6={key:1,class:"list"},P6=["checked","aria-label","onChange"],M6=["aria-expanded","aria-label","onClick"],N6={class:"num"},j6={key:0,class:"caption"},R6={class:"num right"},V6={class:"right"},D6=["onClick"],L6=["onClick"],I6=["onClick"],U6=["onChange"],F6=["value"],z6=["disabled","checked","aria-label","onChange"],H6={colspan:"3",class:"secondary"},B6={class:"right"},W6=["onClick"],K6={key:2,class:"secondary"},G6={key:3,class:"card"},q6={class:"mono"},J6={key:0,class:"caption"},Y6={key:1},Z6={key:3,class:"caption"},Q6={key:4,class:"status-critical"},X6={key:0,class:"status-warning"},e5=Bt({__name:"RecordsPage",setup(e){const t=_e([]),s=_e(""),n=_e(""),l=Dt({kind:"all",source:"all",device:"all",from:"",to:"",text:""}),a=Dt({}),c=_e([]),u=_e(""),i=_e([]),v=_e(null),b=_e(null),_=_e(null),k=_e("");async function $(x){var O,be;if(b.value=x,_.value=null,k.value="",x.kind==="acceptance")try{const se=await He("GET",`/api/records/${x.id}/steps.json`);((O=b.value)==null?void 0:O.id)===x.id&&(_.value=se)}catch(se){((be=b.value)==null?void 0:be.id)===x.id&&(k.value=se.message)}}const L=x=>JSON.stringify(x,null,2);function V(x){var ft;if(x.kind==="sweep"&&((ft=x.members)!=null&&ft.some(Z=>Z.parameter_snapshot)))return"各取值的参数快照见下方成员";const O=x.parameter_snapshot;if(!O)return"未记录参数快照";const be=Object.values(O.read_at??{}).filter(Z=>typeof Z=="number"&&Number.isFinite(Z)),se=be.length&&x.time?Math.max(0,x.time-Math.min(...be)):null;return`${O.source??"来源未知"},${Object.keys(O.values??{}).length} 项${O.complete?"":",部分参数未取得"}${se==null?",读取时间未知":`,最早读取距保存 ${se.toFixed(1)} s`}`}async function j(){try{t.value=await He("GET","/api/records")}catch(x){n.value=x.message}}const q=ge(()=>[...new Set(t.value.map(x=>x.source).filter(Boolean))]),z=x=>{var O;return((O=x.identity)==null?void 0:O.serial_number)!=null?x.identity.serial_number.toString(16).toUpperCase().padStart(8,"0"):""},K=ge(()=>[...new Set(t.value.map(z).filter(Boolean))]),N=x=>new Date(`${x}T00:00:00`).getTime()/1e3,B=ge(()=>t.value.filter(x=>{if(l.kind!=="all"&&x.kind!==l.kind||l.source!=="all"&&x.source!==l.source||l.device!=="all"&&z(x)!==l.device||l.from&&!(x.time>=N(l.from))||l.to&&!(x.time<N(l.to)+86400))return!1;const O=l.text.trim().toLowerCase();return!(O&&!JSON.stringify([x.id,x.experiment,x.set,x.sweep,x.model]).toLowerCase().includes(O))})),H=x=>({step:"阶跃",sweep:"参数扫描",scope:"示波",longrun:"长时运行",recording:"只记录",acceptance:"验收档案"})[x]??x;function ce(x){const O=x.experiment,be=x.time?new Date(x.time*1e3).toLocaleTimeString():x.id;return`${x.source??"?"} · ${O==null?void 0:O.mode} ${O==null?void 0:O.start}→${O==null?void 0:O.target}${x.set&&x.set!=="-"?` · ${x.set}`:""} · ${be}`}const fe=x=>x.files??[],Ne=(x,O)=>c.value.some(be=>be.id===x&&be.file===O);function re(x,O,be){Ne(x,be)?c.value=c.value.filter(se=>!(se.id===x&&se.file===be)):c.value.length<6&&c.value.push({id:x,file:be,label:O})}function E(x){var be;const O=x.experiment;return x.kind==="longrun"&&((be=x.profile)!=null&&be.length)?`运行剖面 ${x.profile.length} 段`+(x.cycles!=null?`,${x.cycles} 个循环`:""):x.kind==="longrun"?`${O==null?void 0:O.mode} ${O==null?void 0:O.start} ↔ ${O==null?void 0:O.target}`+(x.cycles!=null?`,${x.cycles} 个循环`:""):x.kind==="step"||x.kind==="sweep"?`${O==null?void 0:O.mode} ${O==null?void 0:O.start} → ${O==null?void 0:O.target}`+(x.kind==="sweep"?`,扫描 ${x.sweep}`:"")+(x.model?`,模型 ${x.model}`:""):(x.objects??[]).join("、")}const U=(x,O=3,be=1)=>x==null||Number.isNaN(x)?"—":(x*be).toFixed(O);async function de(){v.value=null;try{const x=[...c.value],O=await He("POST","/api/records/compare",{items:x.map(({id:be,file:se})=>({id:be,file:se})),band:u.value===""?null:Number(u.value)});i.value=O.map((be,se)=>({...be,label:x[se].label})),je.value=++Oe}catch(x){v.value={ok:!1,text:x.message}}}it(c,()=>{i.value=[]},{deep:!0});const $e=ge(()=>[...new Set(i.value.map(x=>x.time_base))]),I=x=>({host:"主机时间",cycles:"SIL 周期时间",dc:"DC 时间"})[x]??x,g=ge(()=>{const x=new Map;return i.value.forEach((O,be)=>{const se=JSON.stringify([O.unit,O.time_base]);x.has(se)||x.set(se,{key:se,unit:O.unit,timeBase:O.time_base,items:[]}),x.get(se).items.push({record:O,slot:be%6+1})}),[...x.values()].flatMap(O=>Array.from({length:Math.ceil(O.items.length/3)},(be,se)=>({...O,key:`${O.key}:${se}`,items:O.items.slice(se*3,se*3+3)})))});function ee(x){return x.items.flatMap(({record:O,slot:be})=>[{label:`${O.label??O.id} · 实际`,slot:be,unit:x.unit},{label:`${O.label??O.id} · 已发送目标`,slot:be,unit:x.unit,dash:!0}])}let Oe=0;const je=_e(0);function ie(x){const O=x.items.map(({record:be})=>[be.t.map(se=>se-be.settle),be.y,be.target]);return as.join(O)}function S(x){return x.items.flatMap(({record:O})=>fi((O.markers??[]).map(be=>({t:be.t-O.settle,error_code:be.error_code})),r.errors).map(be=>({...be,label:`${O.label??O.id} ${be.label}`})))}async function C(x){var be;const O=(be=x.target.files)==null?void 0:be[0];if(x.target.value="",!!O)try{const se=await He("POST","/api/records/import",{name:O.name,text:await O.text()});v.value={ok:!0,text:`已导入为记录 ${se.record}`},await j()}catch(se){v.value={ok:!1,text:se.message}}}async function F(x,O){try{await Yr(`/api/records/${x}/${O}`,`${x}-${O}`)}catch(be){n.value=be.message}}return Fs(j),(x,O)=>{var be,se,ft;return p(),h("div",p6,[O[28]||(O[28]=o("h1",null,"记录",-1)),o("div",m6,[we(o("select",{"onUpdate:modelValue":O[0]||(O[0]=Z=>l.kind=Z),"aria-label":"类型"},[...O[10]||(O[10]=[o("option",{value:"all"},"全部类型",-1),o("option",{value:"step"},"阶跃",-1),o("option",{value:"sweep"},"参数扫描",-1),o("option",{value:"scope"},"示波",-1)])],512),[[hs,l.kind]]),we(o("select",{"onUpdate:modelValue":O[1]||(O[1]=Z=>l.source=Z),"aria-label":"来源"},[O[11]||(O[11]=o("option",{value:"all"},"全部来源",-1)),(p(!0),h(le,null,Ue(q.value,Z=>(p(),h("option",{key:Z,value:Z},f(Z),9,v6))),128))],512),[[hs,l.source]]),we(o("select",{"onUpdate:modelValue":O[2]||(O[2]=Z=>l.device=Z),"aria-label":"设备"},[O[12]||(O[12]=o("option",{value:"all"},"全部设备",-1)),(p(!0),h(le,null,Ue(K.value,Z=>(p(),h("option",{key:Z,value:Z},f(Z),9,h6))),128))],512),[[hs,l.device]]),o("label",b6,[O[13]||(O[13]=Y("从 ",-1)),we(o("input",{type:"date","onUpdate:modelValue":O[3]||(O[3]=Z=>l.from=Z),"aria-label":"起始日期"},null,512),[[Re,l.from]])]),o("label",g6,[O[14]||(O[14]=Y("到 ",-1)),we(o("input",{type:"date","onUpdate:modelValue":O[4]||(O[4]=Z=>l.to=Z),"aria-label":"结束日期"},null,512),[[Re,l.to]])]),we(o("input",{"onUpdate:modelValue":O[5]||(O[5]=Z=>l.text=Z),placeholder:"筛选(模式、参数)","aria-label":"筛选记录"},null,512),[[Re,l.text]]),o("button",{onClick:j},"刷新"),O[16]||(O[16]=o("span",{class:"spacer"},null,-1)),o("label",_6,[O[15]||(O[15]=Y("导入 CLI 的 CSV",-1)),o("input",{type:"file",accept:".csv,text/csv",hidden:"",onChange:C},null,32)])]),v.value?(p(),h("p",{key:0,class:Ve(v.value.ok?"caption":"status-critical"),"aria-live":"polite"},f(v.value.text),3)):R("",!0),n.value?(p(),h("p",y6,f(n.value),1)):R("",!0),c.value.length?(p(),h("section",k6,[o("h2",null,[Y("对比("+f(c.value.length)+" 条) ",1),O[18]||(O[18]=o("span",{class:"spacer"},null,-1)),o("label",w6,[O[17]||(O[17]=Y("带宽 ",-1)),we(o("input",{class:"num",type:"number",step:"any","onUpdate:modelValue":O[6]||(O[6]=Z=>u.value=Z),placeholder:"2%","aria-label":"调节时间带宽",onChange:O[7]||(O[7]=Z=>i.value.length&&de())},null,544),[[Re,u.value,void 0,{lazy:!0}]])]),o("button",{class:"primary",onClick:de},"叠加对比"),o("button",{onClick:O[8]||(O[8]=Z=>{c.value=[],i.value=[]})},"清除")]),$e.value.length>1?(p(),h("p",$6,"这些记录的时间基不同("+f($e.value.map(I).join("、"))+"),已分图显示。主机时间含主机抖动,SIL 为理想周期,只宜比较形状。",1)):R("",!0),(p(!0),h(le,null,Ue(g.value,Z=>(p(),h("div",{key:Z.key},[o("h3",null,f(Z.unit||"无单位")+" · "+f(I(Z.timeBase)),1),st(rn,{series:ee(Z),data:()=>ie(Z),tick:je.value,markers:()=>S(Z),"sync-key":`records-${Z.timeBase}`,height:260,"time-label":"t / s(从阶跃起)"},null,8,["series","data","tick","markers","sync-key"])]))),128)),i.value.length?(p(),h("table",x6,[O[19]||(O[19]=o("thead",null,[o("tr",null,[o("th",null,"记录"),o("th",null,"来源"),o("th",{class:"right"},"超调"),o("th",{class:"right"},"10–90% 上升"),o("th",{class:"right"},"调节"),o("th",{class:"right"},"稳态误差"),o("th",null,"有效性")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(i.value,(Z,Je)=>(p(),h("tr",{key:Z.id+(Z.file??"")},[o("td",null,[o("span",{class:"swatch",style:Rl({background:`var(--series-${Je%6+1})`})},null,4),Y(f(Z.label),1)]),o("td",null,f(Z.driver)+" · "+f(I(Z.time_base)),1),o("td",S6,f(d(fs)(Z.metrics,Z.unit).overshoot),1),o("td",C6,f(d(fs)(Z.metrics,Z.unit).rise),1),o("td",A6,f(d(fs)(Z.metrics,Z.unit).settling),1),o("td",T6,f(d(fs)(Z.metrics,Z.unit).steady),1),o("td",{class:Ve(d(fs)(Z.metrics,Z.unit).valid?"":"status-warning")},f(d(fs)(Z.metrics,Z.unit).validity),3)]))),128))])])):R("",!0)])):R("",!0),o("section",O6,[s.value?(p(),vt(jr,{key:s.value,record:s.value,"initially-open":""},null,8,["record"])):R("",!0),B.value.length?(p(),h("table",E6,[O[22]||(O[22]=o("thead",null,[o("tr",null,[o("th"),o("th",null,"时间"),o("th",null,"类型"),o("th",null,"来源"),o("th",null,"内容"),o("th",null,"结束"),o("th",{class:"right"},"样本"),o("th")])],-1)),o("tbody",null,[(p(!0),h(le,null,Ue(B.value,Z=>{var Je;return p(),h(le,{key:Z.id},[o("tr",null,[o("td",null,[Z.kind==="step"&&Z.samples?(p(),h("input",{key:0,type:"checkbox",checked:Ne(Z.id),"aria-label":`选中 ${Z.id} 对比`,onChange:A=>re(Z.id,ce(Z))},null,40,P6)):Z.kind==="sweep"?(p(),h("button",{key:1,class:"plain","aria-expanded":!!a[Z.id],"aria-label":`展开 ${Z.id} 的各取值`,onClick:A=>a[Z.id]=!a[Z.id]},f(a[Z.id]?"▾":"▸"),9,M6)):R("",!0)]),o("td",N6,f(Z.time?new Date(Z.time*1e3).toLocaleString():Z.id),1),o("td",null,f(H(Z.kind)),1),o("td",null,f(Z.source??"—")+f(z(Z)?" · "+z(Z):""),1),o("td",null,[Y(f(E(Z)),1),((Je=Z.metrics)==null?void 0:Je.overshoot_pct)!=null?(p(),h("span",j6,";超调 "+f(U(Z.metrics.overshoot_pct,1))+"%",1)):R("",!0)]),o("td",{class:Ve(Z.complete===!1?"status-warning":"")},f(Z.end??(Z.state==="running"?"进行中":"—"))+f(Z.complete===!1&&Z.state!=="interrupted"?"(不完整)":""),3),o("td",R6,f(Z.samples),1),o("td",V6,[o("button",{onClick:A=>$(Z)},"详情",8,D6),fe(Z).includes("events.csv")?(p(),h("button",{key:0,onClick:A=>s.value=Z.id},"查看事件",8,L6)):R("",!0),["step","scope"].includes(Z.kind)&&Z.samples?(p(),h("button",{key:1,onClick:A=>F(Z.id,"samples.csv")},"CSV",8,I6)):R("",!0),fe(Z).length?(p(),h("select",{key:2,"aria-label":"下载文件",onChange:A=>{const D=A.target;D.value&&F(Z.id,D.value),D.value=""}},[O[20]||(O[20]=o("option",{value:""},"下载…",-1)),(p(!0),h(le,null,Ue(fe(Z),A=>(p(),h("option",{key:A,value:A},f(A),9,F6))),128))],40,U6)):R("",!0)])]),(p(!0),h(le,null,Ue(a[Z.id]?Z.members:[],A=>{var D;return p(),h("tr",{key:Z.id+A.file,class:"member"},[o("td",null,[o("input",{type:"checkbox",disabled:!!A.error,checked:Ne(Z.id,A.file),"aria-label":`选中 ${A.file} 对比`,onChange:J=>re(Z.id,`${ce(Z)} · ${Z.sweep}=${A.value}`,A.file)},null,40,z6)]),o("td",H6,f(Z.sweep)+" = "+f(A.value),1),o("td",null,f(((D=A.metrics)==null?void 0:D.overshoot_pct)!=null?`超调 ${U(A.metrics.overshoot_pct,1)}%`:""),1),o("td",{class:Ve(A.error?"status-warning":"")},f(A.error??"完成"),3),O[21]||(O[21]=o("td",null,null,-1)),o("td",B6,[A.error?R("",!0):(p(),h("button",{key:0,onClick:J=>F(Z.id,A.file)},"CSV",8,W6))])])}),128))],64)}),128))])])):(p(),h("p",K6,"没有记录。")),O[23]||(O[23]=o("p",{class:"caption"},"最多同时对比 6 条。",-1))]),b.value?(p(),h("section",G6,[o("h2",null,[O[24]||(O[24]=Y("记录详情",-1)),O[25]||(O[25]=o("span",{class:"spacer"},null,-1)),o("button",{onClick:O[9]||(O[9]=Z=>b.value=null)},"关闭")]),o("p",q6,f(b.value.id),1),o("p",null,"工具包 "+f(b.value.tool_version||"未记录")+" · 固件版本 "+f(b.value.firmware_version||((be=b.value.identity)==null?void 0:be.version)||"未记录")+" · 固件标识 "+f(b.value.firmware||"未记录"),1),o("p",null,f(V(b.value)),1),(se=b.value.parameter_snapshot)!=null&&se.note?(p(),h("p",J6,f(b.value.parameter_snapshot.note),1)):R("",!0),b.value.parameter_snapshot?(p(),h("details",Y6,[O[26]||(O[26]=o("summary",null,"参数与逐项读取时间",-1)),o("pre",null,f(L(b.value.parameter_snapshot)),1)])):R("",!0),b.value.kind==="sweep"?(p(!0),h(le,{key:2},Ue(b.value.members,Z=>(p(),h("details",{key:Z.file},[o("summary",null,f(b.value.sweep)+" = "+f(Z.value)+" · "+f(V(Z)),1),o("pre",null,f(L(Z.parameter_snapshot??"历史成员未记录参数快照")),1)]))),128)):R("",!0),b.value.kind==="scope"&&b.value.scope?(p(),h("p",Z6,[b.value.scope.last_sample_received_at?(p(),h(le,{key:0},[Y("最近样本接收于 "+f(new Date(b.value.scope.last_sample_received_at*1e3).toLocaleString())+"。",1)],64)):R("",!0),b.value.scope.cumulative_gaps!=null?(p(),h(le,{key:1},[Y("保存时段内有 "+f(b.value.scope.gaps)+" 处采样缺口,采集期间累计 "+f(b.value.scope.cumulative_gaps)+" 处。",1)],64)):b.value.scope.gaps!=null?(p(),h(le,{key:2},[Y("采集期间累计 "+f(b.value.scope.gaps)+" 处缺口,历史记录未区分保存时段。",1)],64)):R("",!0)])):R("",!0),k.value?(p(),h("p",Q6,f(k.value),1)):R("",!0),_.value?(p(),h(le,{key:5},[(ft=b.value.missing_records)!=null&&ft.length?(p(),h("p",X6,"引用曲线未找到 "+f(b.value.missing_records.join("、")),1)):R("",!0),o("details",null,[O[27]||(O[27]=o("summary",null,"量具与标准资料",-1)),o("pre",null,f(L(b.value.references??"历史档案未记录")),1)]),(p(!0),h(le,null,Ue(_.value,Z=>(p(),h("details",{key:Z.n},[o("summary",null,f(Z.n)+" "+f(Z.title)+" · "+f(Z.verdict??"未判定"),1),o("p",null,f(Z.note),1),o("pre",null,f(L({inputs:Z.inputs??"历史档案未记录输入",observations:Z.observations??"历史档案未记录原始统计",calculations:Z.calculations??"未记录计算结果",readings:Z.readings,parameters:Z.parameters??"历史档案未记录本步参数"})),1)]))),128))],64)):R("",!0)])):R("",!0)])}}}),t5=Wt(e5,[["__scopeId","data-v-e1d5be55"]]),s5="/assets/ehapower-mark-Con0OjPM.png",n5={class:"app"},l5={class:"body"},o5={id:"page-sidebar",class:"sidebar","aria-label":"页面"},i5=["aria-current","onClick"],a5=["aria-current"],r5=["aria-current"],u5=["src"],c5={key:0,class:"banner critical",role:"alert"},d5={key:1,class:"banner critical",role:"alert"},f5={key:2,class:"banner",role:"status"},p5={key:3,class:"banner",role:"status"},m5=Bt({__name:"App",setup(e){const t=_e(),s=_e(),n=_e(!0),l=_e(""),a=window.matchMedia("(max-width: 1100px)"),c=_e(a.matches);function u(){var L;if(c.value=a.matches,!c.value)return;const $=(L=document.activeElement)==null?void 0:L.closest("#page-sidebar, #object-inspector");n.value=!1,r.inspector=!1,$&&Qo(()=>{var V;return(V=t.value)==null?void 0:V.focusSidebarToggle()})}function i($){r.page=$,c.value&&(n.value=!1,Qo(()=>{var L;return(L=s.value)==null?void 0:L.focus({preventScroll:!0})}))}function v(){var $;n.value=!1,($=t.value)==null||$.focusSidebarToggle()}const b=[{key:"overview",label:"概览",icon:$1},{key:"motor",label:"电机",icon:w1},{key:"control",label:"控制与示波",icon:g1},{key:"params",label:"参数",icon:T1},{key:"experiments",label:"试验",icon:k1},{key:"assembly",label:"装配",icon:y1},{key:"longrun",label:"长时",icon:O1},{key:"maintenance",label:"维护",icon:E1}];function _(){document.visibilityState==="hidden"&&Ho({type:"visibility",hidden:!0})}function k($){var j,q,z,K;const L=(j=t.value)==null?void 0:j.stop;if($.metaKey&&$.key==="."){$.preventDefault(),L&&L.kind!=="disabled"&&((q=t.value)==null||q.doStop());return}if($.key!=="Escape"||$.defaultPrevented)return;const V=document.activeElement;if(V instanceof HTMLElement&&V.matches("input, select, textarea")){$.preventDefault(),V.blur();return}if(!document.querySelector(":popover-open")){if(r.popover){r.popover=!1;return}if(c.value&&n.value){$.preventDefault(),v();return}if(c.value&&r.inspector&&(r.connected||r.page==="params")){r.inspector=!1,(z=document.getElementById("inspector-toggle"))==null||z.focus();return}(L==null?void 0:L.kind)==="cancel"&&((K=t.value)==null||K.doStop())}}return Fs(()=>{u(),a.addEventListener("change",u),V1().then(()=>{window.location.hash==="#experiments"&&(r.page="experiments")}).catch($=>{l.value=$.message}),window.addEventListener("keydown",k),document.addEventListener("visibilitychange",_)}),cl(()=>{a.removeEventListener("change",u),window.removeEventListener("keydown",k),document.removeEventListener("visibilitychange",_)}),($,L)=>(p(),h("div",n5,[(p(),vt(_g,{key:d(r).openedAt??"disconnected",ref_key:"toolbar",ref:t,"sidebar-open":n.value,onToggleSidebar:L[0]||(L[0]=V=>n.value=!n.value)},null,8,["sidebar-open"])),o("div",l5,[n.value&&c.value?(p(),h("button",{key:0,class:"sidebar-scrim","aria-label":"关闭侧边栏",tabindex:"-1",onClick:v})):R("",!0),we(o("nav",o5,[(p(),h(le,null,Ue(b,V=>o("button",{key:V.key,class:Ve(["nav",{active:d(r).page===V.key}]),"aria-current":d(r).page===V.key,onClick:j=>i(V.key)},[(p(),vt(Bd(V.icon),{size:16})),Y(" "+f(V.label),1)],10,i5)),64)),L[5]||(L[5]=o("span",{class:"spacer"},null,-1)),o("button",{class:Ve(["nav",{active:d(r).page==="records"}]),"aria-current":d(r).page==="records",onClick:L[1]||(L[1]=V=>i("records"))},[st(d(_1),{size:16}),L[3]||(L[3]=Y(" 记录",-1))],10,a5),o("button",{class:Ve(["nav",{active:d(r).page==="about"}]),"aria-current":d(r).page==="about",onClick:L[2]||(L[2]=V=>i("about"))},[o("img",{class:"brand-icon",src:d(s5),alt:"","aria-hidden":"true",width:"20",height:"20"},null,8,u5),L[4]||(L[4]=Y(" 关于羿海动力",-1))],10,r5)],512),[[qr,n.value]]),o("main",{ref_key:"main",ref:s,class:"main",tabindex:"-1"},[l.value?(p(),h("div",c5,f(l.value),1)):d(r).socket==="rejected"?(p(),h("div",d5,[L[6]||(L[6]=Y("服务已重启或令牌失效,请刷新页面。",-1)),d(r).connected?(p(),h(le,{key:0},[Y("设备当前状态与任务结果尚未确认。")],64)):R("",!0)])):d(r).socket==="closed"?(p(),h("div",f5,[L[7]||(L[7]=Y("与服务的连接已断开,正在重连…",-1)),d(r).connected?(p(),h(le,{key:0},[Y("设备当前状态与任务结果尚未确认。")],64)):R("",!0)])):R("",!0),d(r).displayDrops?(p(),h("div",p5,"页面跟不上推送,已跳过 "+f(d(r).displayDrops)+" 批显示数据。各来源的服务端缓冲继续采集。",1)):R("",!0),d(r).page==="about"?(p(),vt(Tg,{key:4})):d(r).page==="connect"?(p(),vt(wr,{key:5,"new-workspace":""})):d(r).page==="records"?(p(),vt(t5,{key:6})):d(r).page==="experiments"?(p(),vt(bw,{key:7})):d(r).page==="params"?(p(),vt(f6,{key:8})):d(r).connected?(p(),h(le,{key:9},[d(r).page==="overview"?(p(),vt(E8,{key:0})):d(r).page==="motor"?(p(),vt(zS,{key:1})):d(r).page==="control"?(p(),vt(yk,{key:2})):d(r).page==="assembly"?(p(),vt(yx,{key:3})):d(r).page==="longrun"?(p(),vt(D3,{key:4})):d(r).page==="maintenance"?(p(),vt(R4,{key:5})):R("",!0)],64)):(p(),vt(wr,{key:10}))],512),d(r).inspector&&(d(r).connected||d(r).page==="params")?(p(),vt(P0,{key:d(r).openedAt??void 0})):R("",!0)])]))}}),v5=Wt(m5,[["__scopeId","data-v-f5cc5bde"]]);p1(v5).mount("#app");