peerpigeon 1.0.3 โ 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -1
- package/dist/peerpigeon-browser.js +439 -6
- package/dist/peerpigeon-browser.js.map +3 -3
- package/docs/BINARY_IMPLEMENTATION_SUMMARY.md +304 -0
- package/docs/BINARY_MESSAGES.md +332 -0
- package/docs/STREAMING_API.md +542 -0
- package/docs/STREAMING_IMPLEMENTATION_SUMMARY.md +286 -0
- package/examples/binary-message-demo.html +496 -0
- package/examples/browser-2/EXPRESS_SOLUTION.md +183 -0
- package/examples/browser-2/ICE_DEBUG.md +171 -0
- package/examples/browser-2/IMPLEMENTATION.md +218 -0
- package/examples/browser-2/QUICK_START.md +149 -0
- package/examples/browser-2/README.md +303 -0
- package/examples/browser-2/dist/assets/index-Cck_6WJV.css +1 -0
- package/examples/browser-2/dist/assets/index-D8-cNlWQ.js +57 -0
- package/examples/browser-2/dist/index.html +32 -0
- package/examples/browser-2/dist/peerpigeon-browser.js +12483 -0
- package/examples/browser-2/index.html +2 -1
- package/examples/browser-2/package-lock.json +1276 -0
- package/examples/browser-2/package.json +5 -3
- package/examples/browser-2/public/peerpigeon-browser.js +12483 -0
- package/examples/browser-2/src/App.vue +7 -4
- package/examples/browser-2/src/components/CryptoView.vue +4 -4
- package/examples/browser-2/src/components/TestingView.vue +794 -0
- package/examples/browser-2/src/main.js +7 -1
- package/examples/browser-2/src/router.js +63 -0
- package/examples/browser-2/src/stores/peerpigeon.js +68 -7
- package/examples/browser-2/vite.config.js +15 -1
- package/examples/stream-file-transfer-demo.html +935 -0
- package/package.json +2 -2
- package/src/ConnectionManager.js +30 -0
- package/src/PeerConnection.js +409 -4
- package/src/PeerPigeonMesh.js +120 -1
- package/src/SignalingClient.js +12 -5
- package/src/browser-entry.js +5 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const a of i)if(a.type==="childList")for(const r of a.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&o(r)}).observe(document,{childList:!0,subtree:!0});function n(i){const a={};return i.integrity&&(a.integrity=i.integrity),i.referrerPolicy&&(a.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?a.credentials="include":i.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function o(i){if(i.ep)return;i.ep=!0;const a=n(i);fetch(i.href,a)}})();/**
|
|
2
|
+
* @vue/shared v3.5.22
|
|
3
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
|
+
* @license MIT
|
|
5
|
+
**/function Kn(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const xe={},Qt=[],dt=()=>{},di=()=>!1,Qs=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Hn=e=>e.startsWith("onUpdate:"),We=Object.assign,Bn=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Na=Object.prototype.hasOwnProperty,Ee=(e,t)=>Na.call(e,t),me=Array.isArray,Xt=e=>Es(e)==="[object Map]",os=e=>Es(e)==="[object Set]",fo=e=>Es(e)==="[object Date]",ye=e=>typeof e=="function",Ue=e=>typeof e=="string",pt=e=>typeof e=="symbol",Re=e=>e!==null&&typeof e=="object",fi=e=>(Re(e)||ye(e))&&ye(e.then)&&ye(e.catch),pi=Object.prototype.toString,Es=e=>pi.call(e),Oa=e=>Es(e).slice(8,-1),gi=e=>Es(e)==="[object Object]",jn=e=>Ue(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,cs=Kn(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Xs=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},Va=/-\w/g,ot=Xs(e=>e.replace(Va,t=>t.slice(1).toUpperCase())),Ua=/\B([A-Z])/g,Vt=Xs(e=>e.replace(Ua,"-$1").toLowerCase()),Zs=Xs(e=>e.charAt(0).toUpperCase()+e.slice(1)),cn=Xs(e=>e?`on${Zs(e)}`:""),At=(e,t)=>!Object.is(e,t),Is=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},vi=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Fs=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let po;const en=()=>po||(po=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Gn(e){if(me(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],i=Ue(o)?Ba(o):Gn(o);if(i)for(const a in i)t[a]=i[a]}return t}else if(Ue(e)||Re(e))return e}const Fa=/;(?![^(]*\))/g,Ka=/:([^]+)/,Ha=/\/\*[^]*?\*\//g;function Ba(e){const t={};return e.replace(Ha,"").split(Fa).forEach(n=>{if(n){const o=n.split(Ka);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Se(e){let t="";if(Ue(e))t=e;else if(me(e))for(let n=0;n<e.length;n++){const o=Se(e[n]);o&&(t+=o+" ")}else if(Re(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}const ja="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",Ga=Kn(ja);function mi(e){return!!e||e===""}function za(e,t){if(e.length!==t.length)return!1;let n=!0;for(let o=0;n&&o<e.length;o++)n=Ts(e[o],t[o]);return n}function Ts(e,t){if(e===t)return!0;let n=fo(e),o=fo(t);if(n||o)return n&&o?e.getTime()===t.getTime():!1;if(n=pt(e),o=pt(t),n||o)return e===t;if(n=me(e),o=me(t),n||o)return n&&o?za(e,t):!1;if(n=Re(e),o=Re(t),n||o){if(!n||!o)return!1;const i=Object.keys(e).length,a=Object.keys(t).length;if(i!==a)return!1;for(const r in e){const l=e.hasOwnProperty(r),d=t.hasOwnProperty(r);if(l&&!d||!l&&d||!Ts(e[r],t[r]))return!1}}return String(e)===String(t)}function zn(e,t){return e.findIndex(n=>Ts(n,t))}const bi=e=>!!(e&&e.__v_isRef===!0),E=e=>Ue(e)?e:e==null?"":me(e)||Re(e)&&(e.toString===pi||!ye(e.toString))?bi(e)?E(e.value):JSON.stringify(e,hi,2):String(e),hi=(e,t)=>bi(t)?hi(e,t.value):Xt(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,i],a)=>(n[dn(o,a)+" =>"]=i,n),{})}:os(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>dn(n))}:pt(t)?dn(t):Re(t)&&!me(t)&&!gi(t)?String(t):t,dn=(e,t="")=>{var n;return pt(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
|
|
6
|
+
* @vue/reactivity v3.5.22
|
|
7
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
8
|
+
* @license MIT
|
|
9
|
+
**/let je;class yi{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=je,!t&&je&&(this.index=(je.scopes||(je.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].pause();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].resume();for(t=0,n=this.effects.length;t<n;t++)this.effects[t].resume()}}run(t){if(this._active){const n=je;try{return je=this,t()}finally{je=n}}}on(){++this._on===1&&(this.prevScope=je,je=this)}off(){this._on>0&&--this._on===0&&(je=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n<o;n++)this.effects[n].stop();for(this.effects.length=0,n=0,o=this.cleanups.length;n<o;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,o=this.scopes.length;n<o;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!t){const i=this.parent.scopes.pop();i&&i!==this&&(this.parent.scopes[this.index]=i,i.index=this.index)}this.parent=void 0}}}function wi(e){return new yi(e)}function Si(){return je}function Wa(e,t=!1){je&&je.cleanups.push(e)}let Le;const fn=new WeakSet;class Di{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,je&&je.active&&je.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,fn.has(this)&&(fn.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||$i(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,go(this),Ci(this);const t=Le,n=it;Le=this,it=!0;try{return this.fn()}finally{_i(this),Le=t,it=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)qn(t);this.deps=this.depsTail=void 0,go(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?fn.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Cn(this)&&this.run()}get dirty(){return Cn(this)}}let ki=0,ds,fs;function $i(e,t=!1){if(e.flags|=8,t){e.next=fs,fs=e;return}e.next=ds,ds=e}function Wn(){ki++}function Jn(){if(--ki>0)return;if(fs){let t=fs;for(fs=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;ds;){let t=ds;for(ds=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function Ci(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function _i(e){let t,n=e.depsTail,o=n;for(;o;){const i=o.prevDep;o.version===-1?(o===n&&(n=i),qn(o),Ja(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=i}e.deps=t,e.depsTail=n}function Cn(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ei(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ei(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===ys)||(e.globalVersion=ys,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Cn(e))))return;e.flags|=2;const t=e.dep,n=Le,o=it;Le=e,it=!0;try{Ci(e);const i=e.fn(e._value);(t.version===0||At(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{Le=n,it=o,_i(e),e.flags&=-3}}function qn(e,t=!1){const{dep:n,prevSub:o,nextSub:i}=e;if(o&&(o.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let a=n.computed.deps;a;a=a.nextDep)qn(a,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ja(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let it=!0;const Ti=[];function Dt(){Ti.push(it),it=!1}function kt(){const e=Ti.pop();it=e===void 0?!0:e}function go(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=Le;Le=void 0;try{t()}finally{Le=n}}}let ys=0;class qa{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Yn{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(!Le||!it||Le===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Le)n=this.activeLink=new qa(Le,this),Le.deps?(n.prevDep=Le.depsTail,Le.depsTail.nextDep=n,Le.depsTail=n):Le.deps=Le.depsTail=n,xi(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=Le.depsTail,n.nextDep=void 0,Le.depsTail.nextDep=n,Le.depsTail=n,Le.deps===n&&(Le.deps=o)}return n}trigger(t){this.version++,ys++,this.notify(t)}notify(t){Wn();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Jn()}}}function xi(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)xi(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const Ks=new WeakMap,jt=Symbol(""),_n=Symbol(""),ws=Symbol("");function Ge(e,t,n){if(it&&Le){let o=Ks.get(e);o||Ks.set(e,o=new Map);let i=o.get(n);i||(o.set(n,i=new Yn),i.map=o,i.key=n),i.track()}}function yt(e,t,n,o,i,a){const r=Ks.get(e);if(!r){ys++;return}const l=d=>{d&&d.trigger()};if(Wn(),t==="clear")r.forEach(l);else{const d=me(e),v=d&&jn(n);if(d&&n==="length"){const p=Number(o);r.forEach((f,y)=>{(y==="length"||y===ws||!pt(y)&&y>=p)&&l(f)})}else switch((n!==void 0||r.has(void 0))&&l(r.get(n)),v&&l(r.get(ws)),t){case"add":d?v&&l(r.get("length")):(l(r.get(jt)),Xt(e)&&l(r.get(_n)));break;case"delete":d||(l(r.get(jt)),Xt(e)&&l(r.get(_n)));break;case"set":Xt(e)&&l(r.get(jt));break}}Jn()}function Ya(e,t){const n=Ks.get(e);return n&&n.get(t)}function Wt(e){const t=Ce(e);return t===e?t:(Ge(t,"iterate",ws),nt(e)?t:t.map(Be))}function tn(e){return Ge(e=Ce(e),"iterate",ws),e}const Qa={__proto__:null,[Symbol.iterator](){return pn(this,Symbol.iterator,Be)},concat(...e){return Wt(this).concat(...e.map(t=>me(t)?Wt(t):t))},entries(){return pn(this,"entries",e=>(e[1]=Be(e[1]),e))},every(e,t){return vt(this,"every",e,t,void 0,arguments)},filter(e,t){return vt(this,"filter",e,t,n=>n.map(Be),arguments)},find(e,t){return vt(this,"find",e,t,Be,arguments)},findIndex(e,t){return vt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return vt(this,"findLast",e,t,Be,arguments)},findLastIndex(e,t){return vt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return vt(this,"forEach",e,t,void 0,arguments)},includes(...e){return gn(this,"includes",e)},indexOf(...e){return gn(this,"indexOf",e)},join(e){return Wt(this).join(e)},lastIndexOf(...e){return gn(this,"lastIndexOf",e)},map(e,t){return vt(this,"map",e,t,void 0,arguments)},pop(){return as(this,"pop")},push(...e){return as(this,"push",e)},reduce(e,...t){return vo(this,"reduce",e,t)},reduceRight(e,...t){return vo(this,"reduceRight",e,t)},shift(){return as(this,"shift")},some(e,t){return vt(this,"some",e,t,void 0,arguments)},splice(...e){return as(this,"splice",e)},toReversed(){return Wt(this).toReversed()},toSorted(e){return Wt(this).toSorted(e)},toSpliced(...e){return Wt(this).toSpliced(...e)},unshift(...e){return as(this,"unshift",e)},values(){return pn(this,"values",Be)}};function pn(e,t,n){const o=tn(e),i=o[t]();return o!==e&&!nt(e)&&(i._next=i.next,i.next=()=>{const a=i._next();return a.done||(a.value=n(a.value)),a}),i}const Xa=Array.prototype;function vt(e,t,n,o,i,a){const r=tn(e),l=r!==e&&!nt(e),d=r[t];if(d!==Xa[t]){const f=d.apply(e,a);return l?Be(f):f}let v=n;r!==e&&(l?v=function(f,y){return n.call(this,Be(f),y,e)}:n.length>2&&(v=function(f,y){return n.call(this,f,y,e)}));const p=d.call(r,v,o);return l&&i?i(p):p}function vo(e,t,n,o){const i=tn(e);let a=n;return i!==e&&(nt(e)?n.length>3&&(a=function(r,l,d){return n.call(this,r,l,d,e)}):a=function(r,l,d){return n.call(this,r,Be(l),d,e)}),i[t](a,...o)}function gn(e,t,n){const o=Ce(e);Ge(o,"iterate",ws);const i=o[t](...n);return(i===-1||i===!1)&&Zn(n[0])?(n[0]=Ce(n[0]),o[t](...n)):i}function as(e,t,n=[]){Dt(),Wn();const o=Ce(e)[t].apply(e,n);return Jn(),kt(),o}const Za=Kn("__proto__,__v_isRef,__isVue"),Ri=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(pt));function er(e){pt(e)||(e=String(e));const t=Ce(this);return Ge(t,"has",e),t.hasOwnProperty(e)}class Li{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,a=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return a;if(n==="__v_raw")return o===(i?a?cr:Ii:a?Mi:Ai).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const r=me(t);if(!i){let d;if(r&&(d=Qa[n]))return d;if(n==="hasOwnProperty")return er}const l=Reflect.get(t,n,Ve(t)?t:o);if((pt(n)?Ri.has(n):Za(n))||(i||Ge(t,"get",n),a))return l;if(Ve(l)){const d=r&&jn(n)?l:l.value;return i&&Re(d)?Tn(d):d}return Re(l)?i?Tn(l):qe(l):l}}class Pi extends Li{constructor(t=!1){super(!1,t)}set(t,n,o,i){let a=t[n];if(!this._isShallow){const d=Nt(a);if(!nt(o)&&!Nt(o)&&(a=Ce(a),o=Ce(o)),!me(t)&&Ve(a)&&!Ve(o))return d||(a.value=o),!0}const r=me(t)&&jn(n)?Number(n)<t.length:Ee(t,n),l=Reflect.set(t,n,o,Ve(t)?t:i);return t===Ce(i)&&(r?At(o,a)&&yt(t,"set",n,o):yt(t,"add",n,o)),l}deleteProperty(t,n){const o=Ee(t,n);t[n];const i=Reflect.deleteProperty(t,n);return i&&o&&yt(t,"delete",n,void 0),i}has(t,n){const o=Reflect.has(t,n);return(!pt(n)||!Ri.has(n))&&Ge(t,"has",n),o}ownKeys(t){return Ge(t,"iterate",me(t)?"length":jt),Reflect.ownKeys(t)}}class tr extends Li{constructor(t=!1){super(!0,t)}set(t,n){return!0}deleteProperty(t,n){return!0}}const sr=new Pi,nr=new tr,or=new Pi(!0);const En=e=>e,Ps=e=>Reflect.getPrototypeOf(e);function ir(e,t,n){return function(...o){const i=this.__v_raw,a=Ce(i),r=Xt(a),l=e==="entries"||e===Symbol.iterator&&r,d=e==="keys"&&r,v=i[e](...o),p=n?En:t?Hs:Be;return!t&&Ge(a,"iterate",d?_n:jt),{next(){const{value:f,done:y}=v.next();return y?{value:f,done:y}:{value:l?[p(f[0]),p(f[1])]:p(f),done:y}},[Symbol.iterator](){return this}}}}function As(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function ar(e,t){const n={get(i){const a=this.__v_raw,r=Ce(a),l=Ce(i);e||(At(i,l)&&Ge(r,"get",i),Ge(r,"get",l));const{has:d}=Ps(r),v=t?En:e?Hs:Be;if(d.call(r,i))return v(a.get(i));if(d.call(r,l))return v(a.get(l));a!==r&&a.get(i)},get size(){const i=this.__v_raw;return!e&&Ge(Ce(i),"iterate",jt),i.size},has(i){const a=this.__v_raw,r=Ce(a),l=Ce(i);return e||(At(i,l)&&Ge(r,"has",i),Ge(r,"has",l)),i===l?a.has(i):a.has(i)||a.has(l)},forEach(i,a){const r=this,l=r.__v_raw,d=Ce(l),v=t?En:e?Hs:Be;return!e&&Ge(d,"iterate",jt),l.forEach((p,f)=>i.call(a,v(p),v(f),r))}};return We(n,e?{add:As("add"),set:As("set"),delete:As("delete"),clear:As("clear")}:{add(i){!t&&!nt(i)&&!Nt(i)&&(i=Ce(i));const a=Ce(this);return Ps(a).has.call(a,i)||(a.add(i),yt(a,"add",i,i)),this},set(i,a){!t&&!nt(a)&&!Nt(a)&&(a=Ce(a));const r=Ce(this),{has:l,get:d}=Ps(r);let v=l.call(r,i);v||(i=Ce(i),v=l.call(r,i));const p=d.call(r,i);return r.set(i,a),v?At(a,p)&&yt(r,"set",i,a):yt(r,"add",i,a),this},delete(i){const a=Ce(this),{has:r,get:l}=Ps(a);let d=r.call(a,i);d||(i=Ce(i),d=r.call(a,i)),l&&l.call(a,i);const v=a.delete(i);return d&&yt(a,"delete",i,void 0),v},clear(){const i=Ce(this),a=i.size!==0,r=i.clear();return a&&yt(i,"clear",void 0,void 0),r}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=ir(i,e,t)}),n}function Qn(e,t){const n=ar(e,t);return(o,i,a)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?o:Reflect.get(Ee(n,i)&&i in o?n:o,i,a)}const rr={get:Qn(!1,!1)},lr={get:Qn(!1,!0)},ur={get:Qn(!0,!1)};const Ai=new WeakMap,Mi=new WeakMap,Ii=new WeakMap,cr=new WeakMap;function dr(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function fr(e){return e.__v_skip||!Object.isExtensible(e)?0:dr(Oa(e))}function qe(e){return Nt(e)?e:Xn(e,!1,sr,rr,Ai)}function Ni(e){return Xn(e,!1,or,lr,Mi)}function Tn(e){return Xn(e,!0,nr,ur,Ii)}function Xn(e,t,n,o,i){if(!Re(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const a=fr(e);if(a===0)return e;const r=i.get(e);if(r)return r;const l=new Proxy(e,a===2?o:n);return i.set(e,l),l}function Mt(e){return Nt(e)?Mt(e.__v_raw):!!(e&&e.__v_isReactive)}function Nt(e){return!!(e&&e.__v_isReadonly)}function nt(e){return!!(e&&e.__v_isShallow)}function Zn(e){return e?!!e.__v_raw:!1}function Ce(e){const t=e&&e.__v_raw;return t?Ce(t):e}function Ss(e){return!Ee(e,"__v_skip")&&Object.isExtensible(e)&&vi(e,"__v_skip",!0),e}const Be=e=>Re(e)?qe(e):e,Hs=e=>Re(e)?Tn(e):e;function Ve(e){return e?e.__v_isRef===!0:!1}function K(e){return Oi(e,!1)}function pr(e){return Oi(e,!0)}function Oi(e,t){return Ve(e)?e:new gr(e,t)}class gr{constructor(t,n){this.dep=new Yn,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:Ce(t),this._value=n?t:Be(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||nt(t)||Nt(t);t=o?t:Ce(t),At(t,n)&&(this._rawValue=t,this._value=o?t:Be(t),this.dep.trigger())}}function He(e){return Ve(e)?e.value:e}const vr={get:(e,t,n)=>t==="__v_raw"?e:He(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return Ve(i)&&!Ve(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function Vi(e){return Mt(e)?e:new Proxy(e,vr)}function mr(e){const t=me(e)?new Array(e.length):{};for(const n in e)t[n]=hr(e,n);return t}class br{constructor(t,n,o){this._object=t,this._key=n,this._defaultValue=o,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return Ya(Ce(this._object),this._key)}}function hr(e,t,n){const o=e[t];return Ve(o)?o:new br(e,t,n)}class yr{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Yn(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=ys-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&Le!==this)return $i(this,!0),!0}get value(){const t=this.dep.track();return Ei(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function wr(e,t,n=!1){let o,i;return ye(e)?o=e:(o=e.get,i=e.set),new yr(o,i,n)}const Ms={},Bs=new WeakMap;let Ht;function Sr(e,t=!1,n=Ht){if(n){let o=Bs.get(n);o||Bs.set(n,o=[]),o.push(e)}}function Dr(e,t,n=xe){const{immediate:o,deep:i,once:a,scheduler:r,augmentJob:l,call:d}=n,v=X=>i?X:nt(X)||i===!1||i===0?wt(X,1):wt(X);let p,f,y,k,N=!1,A=!1;if(Ve(e)?(f=()=>e.value,N=nt(e)):Mt(e)?(f=()=>v(e),N=!0):me(e)?(A=!0,N=e.some(X=>Mt(X)||nt(X)),f=()=>e.map(X=>{if(Ve(X))return X.value;if(Mt(X))return v(X);if(ye(X))return d?d(X,2):X()})):ye(e)?t?f=d?()=>d(e,2):e:f=()=>{if(y){Dt();try{y()}finally{kt()}}const X=Ht;Ht=p;try{return d?d(e,3,[k]):e(k)}finally{Ht=X}}:f=dt,t&&i){const X=f,ue=i===!0?1/0:i;f=()=>wt(X(),ue)}const oe=Si(),Y=()=>{p.stop(),oe&&oe.active&&Bn(oe.effects,p)};if(a&&t){const X=t;t=(...ue)=>{X(...ue),Y()}}let G=A?new Array(e.length).fill(Ms):Ms;const J=X=>{if(!(!(p.flags&1)||!p.dirty&&!X))if(t){const ue=p.run();if(i||N||(A?ue.some((be,fe)=>At(be,G[fe])):At(ue,G))){y&&y();const be=Ht;Ht=p;try{const fe=[ue,G===Ms?void 0:A&&G[0]===Ms?[]:G,k];G=ue,d?d(t,3,fe):t(...fe)}finally{Ht=be}}}else p.run()};return l&&l(J),p=new Di(f),p.scheduler=r?()=>r(J,!1):J,k=X=>Sr(X,!1,p),y=p.onStop=()=>{const X=Bs.get(p);if(X){if(d)d(X,4);else for(const ue of X)ue();Bs.delete(p)}},t?o?J(!0):G=p.run():r?r(J.bind(null,!0),!0):p.run(),Y.pause=p.pause.bind(p),Y.resume=p.resume.bind(p),Y.stop=Y,Y}function wt(e,t=1/0,n){if(t<=0||!Re(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,Ve(e))wt(e.value,t,n);else if(me(e))for(let o=0;o<e.length;o++)wt(e[o],t,n);else if(os(e)||Xt(e))e.forEach(o=>{wt(o,t,n)});else if(gi(e)){for(const o in e)wt(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&wt(e[o],t,n)}return e}/**
|
|
10
|
+
* @vue/runtime-core v3.5.22
|
|
11
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
12
|
+
* @license MIT
|
|
13
|
+
**/function xs(e,t,n,o){try{return o?e(...o):e()}catch(i){sn(i,t,n)}}function gt(e,t,n,o){if(ye(e)){const i=xs(e,t,n,o);return i&&fi(i)&&i.catch(a=>{sn(a,t,n)}),i}if(me(e)){const i=[];for(let a=0;a<e.length;a++)i.push(gt(e[a],t,n,o));return i}}function sn(e,t,n,o=!0){const i=t?t.vnode:null,{errorHandler:a,throwUnhandledErrorInProduction:r}=t&&t.appContext.config||xe;if(t){let l=t.parent;const d=t.proxy,v=`https://vuejs.org/error-reference/#runtime-${n}`;for(;l;){const p=l.ec;if(p){for(let f=0;f<p.length;f++)if(p[f](e,d,v)===!1)return}l=l.parent}if(a){Dt(),xs(a,null,10,[e,d,v]),kt();return}}kr(e,n,i,o,r)}function kr(e,t,n,o=!0,i=!1){if(i)throw e;console.error(e)}const Qe=[];let ut=-1;const Zt=[];let xt=null,qt=0;const Ui=Promise.resolve();let js=null;function zt(e){const t=js||Ui;return e?t.then(this?e.bind(this):e):t}function $r(e){let t=ut+1,n=Qe.length;for(;t<n;){const o=t+n>>>1,i=Qe[o],a=Ds(i);a<e||a===e&&i.flags&2?t=o+1:n=o}return t}function eo(e){if(!(e.flags&1)){const t=Ds(e),n=Qe[Qe.length-1];!n||!(e.flags&2)&&t>=Ds(n)?Qe.push(e):Qe.splice($r(t),0,e),e.flags|=1,Fi()}}function Fi(){js||(js=Ui.then(Hi))}function Cr(e){me(e)?Zt.push(...e):xt&&e.id===-1?xt.splice(qt+1,0,e):e.flags&1||(Zt.push(e),e.flags|=1),Fi()}function mo(e,t,n=ut+1){for(;n<Qe.length;n++){const o=Qe[n];if(o&&o.flags&2){if(e&&o.id!==e.uid)continue;Qe.splice(n,1),n--,o.flags&4&&(o.flags&=-2),o(),o.flags&4||(o.flags&=-2)}}}function Ki(e){if(Zt.length){const t=[...new Set(Zt)].sort((n,o)=>Ds(n)-Ds(o));if(Zt.length=0,xt){xt.push(...t);return}for(xt=t,qt=0;qt<xt.length;qt++){const n=xt[qt];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}xt=null,qt=0}}const Ds=e=>e.id==null?e.flags&2?-1:1/0:e.id;function Hi(e){try{for(ut=0;ut<Qe.length;ut++){const t=Qe[ut];t&&!(t.flags&8)&&(t.flags&4&&(t.flags&=-2),xs(t,t.i,t.i?15:14),t.flags&4||(t.flags&=-2))}}finally{for(;ut<Qe.length;ut++){const t=Qe[ut];t&&(t.flags&=-2)}ut=-1,Qe.length=0,Ki(),js=null,(Qe.length||Zt.length)&&Hi()}}let et=null,Bi=null;function Gs(e){const t=et;return et=e,Bi=e&&e.type.__scopeId||null,t}function bt(e,t=et,n){if(!t||e._n)return e;const o=(...i)=>{o._d&&Js(-1);const a=Gs(t);let r;try{r=e(...i)}finally{Gs(a),o._d&&Js(1)}return r};return o._n=!0,o._c=!0,o._d=!0,o}function ae(e,t){if(et===null)return e;const n=rn(et),o=e.dirs||(e.dirs=[]);for(let i=0;i<t.length;i++){let[a,r,l,d=xe]=t[i];a&&(ye(a)&&(a={mounted:a,updated:a}),a.deep&&wt(r),o.push({dir:a,instance:n,value:r,oldValue:void 0,arg:l,modifiers:d}))}return e}function Ft(e,t,n,o){const i=e.dirs,a=t&&t.dirs;for(let r=0;r<i.length;r++){const l=i[r];a&&(l.oldValue=a[r].value);let d=l.dir[o];d&&(Dt(),gt(d,n,8,[e.el,l,e,t]),kt())}}const _r=Symbol("_vte"),Er=e=>e.__isTeleport,Tr=Symbol("_leaveCb");function to(e,t){e.shapeFlag&6&&e.component?(e.transition=t,to(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function ji(e,t){return ye(e)?We({name:e.name},t,{setup:e}):e}function Gi(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const zs=new WeakMap;function ps(e,t,n,o,i=!1){if(me(e)){e.forEach((N,A)=>ps(N,t&&(me(t)?t[A]:t),n,o,i));return}if(gs(o)&&!i){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&ps(e,t,n,o.component.subTree);return}const a=o.shapeFlag&4?rn(o.component):o.el,r=i?null:a,{i:l,r:d}=e,v=t&&t.r,p=l.refs===xe?l.refs={}:l.refs,f=l.setupState,y=Ce(f),k=f===xe?di:N=>Ee(y,N);if(v!=null&&v!==d){if(bo(t),Ue(v))p[v]=null,k(v)&&(f[v]=null);else if(Ve(v)){v.value=null;const N=t;N.k&&(p[N.k]=null)}}if(ye(d))xs(d,l,12,[r,p]);else{const N=Ue(d),A=Ve(d);if(N||A){const oe=()=>{if(e.f){const Y=N?k(d)?f[d]:p[d]:d.value;if(i)me(Y)&&Bn(Y,a);else if(me(Y))Y.includes(a)||Y.push(a);else if(N)p[d]=[a],k(d)&&(f[d]=p[d]);else{const G=[a];d.value=G,e.k&&(p[e.k]=G)}}else N?(p[d]=r,k(d)&&(f[d]=r)):A&&(d.value=r,e.k&&(p[e.k]=r))};if(r){const Y=()=>{oe(),zs.delete(e)};Y.id=-1,zs.set(e,Y),Ze(Y,n)}else bo(e),oe()}}}function bo(e){const t=zs.get(e);t&&(t.flags|=8,zs.delete(e))}en().requestIdleCallback;en().cancelIdleCallback;const gs=e=>!!e.type.__asyncLoader,zi=e=>e.type.__isKeepAlive;function xr(e,t){Wi(e,"a",t)}function Rr(e,t){Wi(e,"da",t)}function Wi(e,t,n=ze){const o=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(nn(t,o,n),n){let i=n.parent;for(;i&&i.parent;)zi(i.parent.vnode)&&Lr(o,t,n,i),i=i.parent}}function Lr(e,t,n,o){const i=nn(t,e,o,!0);Rs(()=>{Bn(o[t],i)},n)}function nn(e,t,n=ze,o=!1){if(n){const i=n[e]||(n[e]=[]),a=t.__weh||(t.__weh=(...r)=>{Dt();const l=Ls(n),d=gt(t,n,e,r);return l(),kt(),d});return o?i.unshift(a):i.push(a),a}}const $t=e=>(t,n=ze)=>{(!$s||e==="sp")&&nn(e,(...o)=>t(...o),n)},Pr=$t("bm"),Ut=$t("m"),Ar=$t("bu"),Mr=$t("u"),Ir=$t("bum"),Rs=$t("um"),Nr=$t("sp"),Or=$t("rtg"),Vr=$t("rtc");function Ur(e,t=ze){nn("ec",e,t)}const Fr="components";function ho(e,t){return Hr(Fr,e,!0,t)||e}const Kr=Symbol.for("v-ndc");function Hr(e,t,n=!0,o=!1){const i=et||ze;if(i){const a=i.type;{const l=Ll(a,!1);if(l&&(l===t||l===ot(t)||l===Zs(ot(t))))return a}const r=yo(i[e]||a[e],t)||yo(i.appContext[e],t);return!r&&o?a:r}}function yo(e,t){return e&&(e[t]||e[ot(t)]||e[Zs(ot(t))])}function Pe(e,t,n,o){let i;const a=n,r=me(e);if(r||Ue(e)){const l=r&&Mt(e);let d=!1,v=!1;l&&(d=!nt(e),v=Nt(e),e=tn(e)),i=new Array(e.length);for(let p=0,f=e.length;p<f;p++)i[p]=t(d?v?Hs(Be(e[p])):Be(e[p]):e[p],p,void 0,a)}else if(typeof e=="number"){i=new Array(e);for(let l=0;l<e;l++)i[l]=t(l+1,l,void 0,a)}else if(Re(e))if(e[Symbol.iterator])i=Array.from(e,(l,d)=>t(l,d,void 0,a));else{const l=Object.keys(e);i=new Array(l.length);for(let d=0,v=l.length;d<v;d++){const p=l[d];i[d]=t(e[p],p,d,a)}}else i=[];return i}const xn=e=>e?ga(e)?rn(e):xn(e.parent):null,vs=We(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=>xn(e.parent),$root:e=>xn(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>qi(e),$forceUpdate:e=>e.f||(e.f=()=>{eo(e.update)}),$nextTick:e=>e.n||(e.n=zt.bind(e.proxy)),$watch:e=>cl.bind(e)}),vn=(e,t)=>e!==xe&&!e.__isScriptSetup&&Ee(e,t),Br={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:i,props:a,accessCache:r,type:l,appContext:d}=e;let v;if(t[0]!=="$"){const k=r[t];if(k!==void 0)switch(k){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return a[t]}else{if(vn(o,t))return r[t]=1,o[t];if(i!==xe&&Ee(i,t))return r[t]=2,i[t];if((v=e.propsOptions[0])&&Ee(v,t))return r[t]=3,a[t];if(n!==xe&&Ee(n,t))return r[t]=4,n[t];Rn&&(r[t]=0)}}const p=vs[t];let f,y;if(p)return t==="$attrs"&&Ge(e.attrs,"get",""),p(e);if((f=l.__cssModules)&&(f=f[t]))return f;if(n!==xe&&Ee(n,t))return r[t]=4,n[t];if(y=d.config.globalProperties,Ee(y,t))return y[t]},set({_:e},t,n){const{data:o,setupState:i,ctx:a}=e;return vn(i,t)?(i[t]=n,!0):o!==xe&&Ee(o,t)?(o[t]=n,!0):Ee(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(a[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,propsOptions:a,type:r}},l){let d,v;return!!(n[l]||e!==xe&&l[0]!=="$"&&Ee(e,l)||vn(t,l)||(d=a[0])&&Ee(d,l)||Ee(o,l)||Ee(vs,l)||Ee(i.config.globalProperties,l)||(v=r.__cssModules)&&v[l])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ee(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function wo(e){return me(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let Rn=!0;function jr(e){const t=qi(e),n=e.proxy,o=e.ctx;Rn=!1,t.beforeCreate&&So(t.beforeCreate,e,"bc");const{data:i,computed:a,methods:r,watch:l,provide:d,inject:v,created:p,beforeMount:f,mounted:y,beforeUpdate:k,updated:N,activated:A,deactivated:oe,beforeDestroy:Y,beforeUnmount:G,destroyed:J,unmounted:X,render:ue,renderTracked:be,renderTriggered:fe,errorCaptured:Q,serverPrefetch:O,expose:ee,inheritAttrs:q,components:z,directives:le,filters:he}=t;if(v&&Gr(v,o,null),r)for(const j in r){const ve=r[j];ye(ve)&&(o[j]=ve.bind(n))}if(i){const j=i.call(n,n);Re(j)&&(e.data=qe(j))}if(Rn=!0,a)for(const j in a){const ve=a[j],we=ye(ve)?ve.bind(n,n):ye(ve.get)?ve.get.bind(n,n):dt,De=!ye(ve)&&ye(ve.set)?ve.set.bind(n):dt,Me=ce({get:we,set:De});Object.defineProperty(o,j,{enumerable:!0,configurable:!0,get:()=>Me.value,set:Te=>Me.value=Te})}if(l)for(const j in l)Ji(l[j],o,n,j);if(d){const j=ye(d)?d.call(n):d;Reflect.ownKeys(j).forEach(ve=>{Ns(ve,j[ve])})}p&&So(p,e,"c");function V(j,ve){me(ve)?ve.forEach(we=>j(we.bind(n))):ve&&j(ve.bind(n))}if(V(Pr,f),V(Ut,y),V(Ar,k),V(Mr,N),V(xr,A),V(Rr,oe),V(Ur,Q),V(Vr,be),V(Or,fe),V(Ir,G),V(Rs,X),V(Nr,O),me(ee))if(ee.length){const j=e.exposed||(e.exposed={});ee.forEach(ve=>{Object.defineProperty(j,ve,{get:()=>n[ve],set:we=>n[ve]=we,enumerable:!0})})}else e.exposed||(e.exposed={});ue&&e.render===dt&&(e.render=ue),q!=null&&(e.inheritAttrs=q),z&&(e.components=z),le&&(e.directives=le),O&&Gi(e)}function Gr(e,t,n=dt){me(e)&&(e=Ln(e));for(const o in e){const i=e[o];let a;Re(i)?"default"in i?a=ft(i.from||o,i.default,!0):a=ft(i.from||o):a=ft(i),Ve(a)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>a.value,set:r=>a.value=r}):t[o]=a}}function So(e,t,n){gt(me(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function Ji(e,t,n,o){let i=o.includes(".")?la(n,o):()=>n[o];if(Ue(e)){const a=t[e];ye(a)&&It(i,a)}else if(ye(e))It(i,e.bind(n));else if(Re(e))if(me(e))e.forEach(a=>Ji(a,t,n,o));else{const a=ye(e.handler)?e.handler.bind(n):t[e.handler];ye(a)&&It(i,a,e)}}function qi(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:r}}=e.appContext,l=a.get(t);let d;return l?d=l:!i.length&&!n&&!o?d=t:(d={},i.length&&i.forEach(v=>Ws(d,v,r,!0)),Ws(d,t,r)),Re(t)&&a.set(t,d),d}function Ws(e,t,n,o=!1){const{mixins:i,extends:a}=t;a&&Ws(e,a,n,!0),i&&i.forEach(r=>Ws(e,r,n,!0));for(const r in t)if(!(o&&r==="expose")){const l=zr[r]||n&&n[r];e[r]=l?l(e[r],t[r]):t[r]}return e}const zr={data:Do,props:ko,emits:ko,methods:us,computed:us,beforeCreate:Je,created:Je,beforeMount:Je,mounted:Je,beforeUpdate:Je,updated:Je,beforeDestroy:Je,beforeUnmount:Je,destroyed:Je,unmounted:Je,activated:Je,deactivated:Je,errorCaptured:Je,serverPrefetch:Je,components:us,directives:us,watch:Jr,provide:Do,inject:Wr};function Do(e,t){return t?e?function(){return We(ye(e)?e.call(this,this):e,ye(t)?t.call(this,this):t)}:t:e}function Wr(e,t){return us(Ln(e),Ln(t))}function Ln(e){if(me(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Je(e,t){return e?[...new Set([].concat(e,t))]:t}function us(e,t){return e?We(Object.create(null),e,t):t}function ko(e,t){return e?me(e)&&me(t)?[...new Set([...e,...t])]:We(Object.create(null),wo(e),wo(t??{})):t}function Jr(e,t){if(!e)return t;if(!t)return e;const n=We(Object.create(null),e);for(const o in t)n[o]=Je(e[o],t[o]);return n}function Yi(){return{app:null,config:{isNativeTag:di,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 qr=0;function Yr(e,t){return function(o,i=null){ye(o)||(o=We({},o)),i!=null&&!Re(i)&&(i=null);const a=Yi(),r=new WeakSet,l=[];let d=!1;const v=a.app={_uid:qr++,_component:o,_props:i,_container:null,_context:a,_instance:null,version:Al,get config(){return a.config},set config(p){},use(p,...f){return r.has(p)||(p&&ye(p.install)?(r.add(p),p.install(v,...f)):ye(p)&&(r.add(p),p(v,...f))),v},mixin(p){return a.mixins.includes(p)||a.mixins.push(p),v},component(p,f){return f?(a.components[p]=f,v):a.components[p]},directive(p,f){return f?(a.directives[p]=f,v):a.directives[p]},mount(p,f,y){if(!d){const k=v._ceVNode||Ie(o,i);return k.appContext=a,y===!0?y="svg":y===!1&&(y=void 0),e(k,p,y),d=!0,v._container=p,p.__vue_app__=v,rn(k.component)}},onUnmount(p){l.push(p)},unmount(){d&&(gt(l,v._instance,16),e(null,v._container),delete v._container.__vue_app__)},provide(p,f){return a.provides[p]=f,v},runWithContext(p){const f=Gt;Gt=v;try{return p()}finally{Gt=f}}};return v}}let Gt=null;function Ns(e,t){if(ze){let n=ze.provides;const o=ze.parent&&ze.parent.provides;o===n&&(n=ze.provides=Object.create(o)),n[e]=t}}function ft(e,t,n=!1){const o=pa();if(o||Gt){let i=Gt?Gt._context.provides:o?o.parent==null||o.ce?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&ye(t)?t.call(o&&o.proxy):t}}function Qr(){return!!(pa()||Gt)}const Qi={},Xi=()=>Object.create(Qi),Zi=e=>Object.getPrototypeOf(e)===Qi;function Xr(e,t,n,o=!1){const i={},a=Xi();e.propsDefaults=Object.create(null),ea(e,t,i,a);for(const r in e.propsOptions[0])r in i||(i[r]=void 0);n?e.props=o?i:Ni(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Zr(e,t,n,o){const{props:i,attrs:a,vnode:{patchFlag:r}}=e,l=Ce(i),[d]=e.propsOptions;let v=!1;if((o||r>0)&&!(r&16)){if(r&8){const p=e.vnode.dynamicProps;for(let f=0;f<p.length;f++){let y=p[f];if(on(e.emitsOptions,y))continue;const k=t[y];if(d)if(Ee(a,y))k!==a[y]&&(a[y]=k,v=!0);else{const N=ot(y);i[N]=Pn(d,l,N,k,e,!1)}else k!==a[y]&&(a[y]=k,v=!0)}}}else{ea(e,t,i,a)&&(v=!0);let p;for(const f in l)(!t||!Ee(t,f)&&((p=Vt(f))===f||!Ee(t,p)))&&(d?n&&(n[f]!==void 0||n[p]!==void 0)&&(i[f]=Pn(d,l,f,void 0,e,!0)):delete i[f]);if(a!==l)for(const f in a)(!t||!Ee(t,f))&&(delete a[f],v=!0)}v&&yt(e.attrs,"set","")}function ea(e,t,n,o){const[i,a]=e.propsOptions;let r=!1,l;if(t)for(let d in t){if(cs(d))continue;const v=t[d];let p;i&&Ee(i,p=ot(d))?!a||!a.includes(p)?n[p]=v:(l||(l={}))[p]=v:on(e.emitsOptions,d)||(!(d in o)||v!==o[d])&&(o[d]=v,r=!0)}if(a){const d=Ce(n),v=l||xe;for(let p=0;p<a.length;p++){const f=a[p];n[f]=Pn(i,d,f,v[f],e,!Ee(v,f))}}return r}function Pn(e,t,n,o,i,a){const r=e[n];if(r!=null){const l=Ee(r,"default");if(l&&o===void 0){const d=r.default;if(r.type!==Function&&!r.skipFactory&&ye(d)){const{propsDefaults:v}=i;if(n in v)o=v[n];else{const p=Ls(i);o=v[n]=d.call(null,t),p()}}else o=d;i.ce&&i.ce._setProp(n,o)}r[0]&&(a&&!l?o=!1:r[1]&&(o===""||o===Vt(n))&&(o=!0))}return o}const el=new WeakMap;function ta(e,t,n=!1){const o=n?el:t.propsCache,i=o.get(e);if(i)return i;const a=e.props,r={},l=[];let d=!1;if(!ye(e)){const p=f=>{d=!0;const[y,k]=ta(f,t,!0);We(r,y),k&&l.push(...k)};!n&&t.mixins.length&&t.mixins.forEach(p),e.extends&&p(e.extends),e.mixins&&e.mixins.forEach(p)}if(!a&&!d)return Re(e)&&o.set(e,Qt),Qt;if(me(a))for(let p=0;p<a.length;p++){const f=ot(a[p]);$o(f)&&(r[f]=xe)}else if(a)for(const p in a){const f=ot(p);if($o(f)){const y=a[p],k=r[f]=me(y)||ye(y)?{type:y}:We({},y),N=k.type;let A=!1,oe=!0;if(me(N))for(let Y=0;Y<N.length;++Y){const G=N[Y],J=ye(G)&&G.name;if(J==="Boolean"){A=!0;break}else J==="String"&&(oe=!1)}else A=ye(N)&&N.name==="Boolean";k[0]=A,k[1]=oe,(A||Ee(k,"default"))&&l.push(f)}}const v=[r,l];return Re(e)&&o.set(e,v),v}function $o(e){return e[0]!=="$"&&!cs(e)}const so=e=>e==="_"||e==="_ctx"||e==="$stable",no=e=>me(e)?e.map(ct):[ct(e)],tl=(e,t,n)=>{if(t._n)return t;const o=bt((...i)=>no(t(...i)),n);return o._c=!1,o},sa=(e,t,n)=>{const o=e._ctx;for(const i in e){if(so(i))continue;const a=e[i];if(ye(a))t[i]=tl(i,a,o);else if(a!=null){const r=no(a);t[i]=()=>r}}},na=(e,t)=>{const n=no(t);e.slots.default=()=>n},oa=(e,t,n)=>{for(const o in t)(n||!so(o))&&(e[o]=t[o])},sl=(e,t,n)=>{const o=e.slots=Xi();if(e.vnode.shapeFlag&32){const i=t._;i?(oa(o,t,n),n&&vi(o,"_",i,!0)):sa(t,o)}else t&&na(e,t)},nl=(e,t,n)=>{const{vnode:o,slots:i}=e;let a=!0,r=xe;if(o.shapeFlag&32){const l=t._;l?n&&l===1?a=!1:oa(i,t,n):(a=!t.$stable,sa(t,i)),r=t}else t&&(na(e,t),r={default:1});if(a)for(const l in i)!so(l)&&r[l]==null&&delete i[l]},Ze=hl;function ol(e){return il(e)}function il(e,t){const n=en();n.__VUE__=!0;const{insert:o,remove:i,patchProp:a,createElement:r,createText:l,createComment:d,setText:v,setElementText:p,parentNode:f,nextSibling:y,setScopeId:k=dt,insertStaticContent:N}=e,A=(m,b,C,U=null,H=null,F=null,se=void 0,Z=null,_=!!b.dynamicChildren)=>{if(m===b)return;m&&!rs(m,b)&&(U=c(m),Te(m,H,F,!0),m=null),b.patchFlag===-2&&(_=!1,b.dynamicChildren=null);const{type:u,ref:$,shapeFlag:W}=b;switch(u){case an:oe(m,b,C,U);break;case Ot:Y(m,b,C,U);break;case Os:m==null&&G(b,C,U,se);break;case $e:z(m,b,C,U,H,F,se,Z,_);break;default:W&1?ue(m,b,C,U,H,F,se,Z,_):W&6?le(m,b,C,U,H,F,se,Z,_):(W&64||W&128)&&u.process(m,b,C,U,H,F,se,Z,_,te)}$!=null&&H?ps($,m&&m.ref,F,b||m,!b):$==null&&m&&m.ref!=null&&ps(m.ref,null,F,m,!0)},oe=(m,b,C,U)=>{if(m==null)o(b.el=l(b.children),C,U);else{const H=b.el=m.el;b.children!==m.children&&v(H,b.children)}},Y=(m,b,C,U)=>{m==null?o(b.el=d(b.children||""),C,U):b.el=m.el},G=(m,b,C,U)=>{[m.el,m.anchor]=N(m.children,b,C,U,m.el,m.anchor)},J=({el:m,anchor:b},C,U)=>{let H;for(;m&&m!==b;)H=y(m),o(m,C,U),m=H;o(b,C,U)},X=({el:m,anchor:b})=>{let C;for(;m&&m!==b;)C=y(m),i(m),m=C;i(b)},ue=(m,b,C,U,H,F,se,Z,_)=>{b.type==="svg"?se="svg":b.type==="math"&&(se="mathml"),m==null?be(b,C,U,H,F,se,Z,_):O(m,b,H,F,se,Z,_)},be=(m,b,C,U,H,F,se,Z)=>{let _,u;const{props:$,shapeFlag:W,transition:ie,dirs:w}=m;if(_=m.el=r(m.type,F,$&&$.is,$),W&8?p(_,m.children):W&16&&Q(m.children,_,null,U,H,mn(m,F),se,Z),w&&Ft(m,null,U,"created"),fe(_,m,m.scopeId,se,U),$){for(const g in $)g!=="value"&&!cs(g)&&a(_,g,null,$[g],F,U);"value"in $&&a(_,"value",null,$.value,F),(u=$.onVnodeBeforeMount)&<(u,U,m)}w&&Ft(m,null,U,"beforeMount");const S=al(H,ie);S&&ie.beforeEnter(_),o(_,b,C),((u=$&&$.onVnodeMounted)||S||w)&&Ze(()=>{u&<(u,U,m),S&&ie.enter(_),w&&Ft(m,null,U,"mounted")},H)},fe=(m,b,C,U,H)=>{if(C&&k(m,C),U)for(let F=0;F<U.length;F++)k(m,U[F]);if(H){let F=H.subTree;if(b===F||ca(F.type)&&(F.ssContent===b||F.ssFallback===b)){const se=H.vnode;fe(m,se,se.scopeId,se.slotScopeIds,H.parent)}}},Q=(m,b,C,U,H,F,se,Z,_=0)=>{for(let u=_;u<m.length;u++){const $=m[u]=Z?Rt(m[u]):ct(m[u]);A(null,$,b,C,U,H,F,se,Z)}},O=(m,b,C,U,H,F,se)=>{const Z=b.el=m.el;let{patchFlag:_,dynamicChildren:u,dirs:$}=b;_|=m.patchFlag&16;const W=m.props||xe,ie=b.props||xe;let w;if(C&&Kt(C,!1),(w=ie.onVnodeBeforeUpdate)&<(w,C,b,m),$&&Ft(b,m,C,"beforeUpdate"),C&&Kt(C,!0),(W.innerHTML&&ie.innerHTML==null||W.textContent&&ie.textContent==null)&&p(Z,""),u?ee(m.dynamicChildren,u,Z,C,U,mn(b,H),F):se||ve(m,b,Z,null,C,U,mn(b,H),F,!1),_>0){if(_&16)q(Z,W,ie,C,H);else if(_&2&&W.class!==ie.class&&a(Z,"class",null,ie.class,H),_&4&&a(Z,"style",W.style,ie.style,H),_&8){const S=b.dynamicProps;for(let g=0;g<S.length;g++){const I=S[g],ge=W[I],ne=ie[I];(ne!==ge||I==="value")&&a(Z,I,ge,ne,H,C)}}_&1&&m.children!==b.children&&p(Z,b.children)}else!se&&u==null&&q(Z,W,ie,C,H);((w=ie.onVnodeUpdated)||$)&&Ze(()=>{w&<(w,C,b,m),$&&Ft(b,m,C,"updated")},U)},ee=(m,b,C,U,H,F,se)=>{for(let Z=0;Z<b.length;Z++){const _=m[Z],u=b[Z],$=_.el&&(_.type===$e||!rs(_,u)||_.shapeFlag&198)?f(_.el):C;A(_,u,$,null,U,H,F,se,!0)}},q=(m,b,C,U,H)=>{if(b!==C){if(b!==xe)for(const F in b)!cs(F)&&!(F in C)&&a(m,F,b[F],null,H,U);for(const F in C){if(cs(F))continue;const se=C[F],Z=b[F];se!==Z&&F!=="value"&&a(m,F,Z,se,H,U)}"value"in C&&a(m,"value",b.value,C.value,H)}},z=(m,b,C,U,H,F,se,Z,_)=>{const u=b.el=m?m.el:l(""),$=b.anchor=m?m.anchor:l("");let{patchFlag:W,dynamicChildren:ie,slotScopeIds:w}=b;w&&(Z=Z?Z.concat(w):w),m==null?(o(u,C,U),o($,C,U),Q(b.children||[],C,$,H,F,se,Z,_)):W>0&&W&64&&ie&&m.dynamicChildren?(ee(m.dynamicChildren,ie,C,H,F,se,Z),(b.key!=null||H&&b===H.subTree)&&ia(m,b,!0)):ve(m,b,C,$,H,F,se,Z,_)},le=(m,b,C,U,H,F,se,Z,_)=>{b.slotScopeIds=Z,m==null?b.shapeFlag&512?H.ctx.activate(b,C,U,se,_):he(b,C,U,H,F,se,_):M(m,b,_)},he=(m,b,C,U,H,F,se)=>{const Z=m.component=_l(m,U,H);if(zi(m)&&(Z.ctx.renderer=te),El(Z,!1,se),Z.asyncDep){if(H&&H.registerDep(Z,V,se),!m.el){const _=Z.subTree=Ie(Ot);Y(null,_,b,C),m.placeholder=_.el}}else V(Z,m,b,C,H,F,se)},M=(m,b,C)=>{const U=b.component=m.component;if(ml(m,b,C))if(U.asyncDep&&!U.asyncResolved){j(U,b,C);return}else U.next=b,U.update();else b.el=m.el,U.vnode=b},V=(m,b,C,U,H,F,se)=>{const Z=()=>{if(m.isMounted){let{next:W,bu:ie,u:w,parent:S,vnode:g}=m;{const st=aa(m);if(st){W&&(W.el=g.el,j(m,W,se)),st.asyncDep.then(()=>{m.isUnmounted||Z()});return}}let I=W,ge;Kt(m,!1),W?(W.el=g.el,j(m,W,se)):W=g,ie&&Is(ie),(ge=W.props&&W.props.onVnodeBeforeUpdate)&<(ge,S,W,g),Kt(m,!0);const ne=_o(m),Ae=m.subTree;m.subTree=ne,A(Ae,ne,f(Ae.el),c(Ae),m,H,F),W.el=ne.el,I===null&&bl(m,ne.el),w&&Ze(w,H),(ge=W.props&&W.props.onVnodeUpdated)&&Ze(()=>lt(ge,S,W,g),H)}else{let W;const{el:ie,props:w}=b,{bm:S,m:g,parent:I,root:ge,type:ne}=m,Ae=gs(b);Kt(m,!1),S&&Is(S),!Ae&&(W=w&&w.onVnodeBeforeMount)&<(W,I,b),Kt(m,!0);{ge.ce&&ge.ce._def.shadowRoot!==!1&&ge.ce._injectChildStyle(ne);const st=m.subTree=_o(m);A(null,st,C,U,m,H,F),b.el=st.el}if(g&&Ze(g,H),!Ae&&(W=w&&w.onVnodeMounted)){const st=b;Ze(()=>lt(W,I,st),H)}(b.shapeFlag&256||I&&gs(I.vnode)&&I.vnode.shapeFlag&256)&&m.a&&Ze(m.a,H),m.isMounted=!0,b=C=U=null}};m.scope.on();const _=m.effect=new Di(Z);m.scope.off();const u=m.update=_.run.bind(_),$=m.job=_.runIfDirty.bind(_);$.i=m,$.id=m.uid,_.scheduler=()=>eo($),Kt(m,!0),u()},j=(m,b,C)=>{b.component=m;const U=m.vnode.props;m.vnode=b,m.next=null,Zr(m,b.props,U,C),nl(m,b.children,C),Dt(),mo(m),kt()},ve=(m,b,C,U,H,F,se,Z,_=!1)=>{const u=m&&m.children,$=m?m.shapeFlag:0,W=b.children,{patchFlag:ie,shapeFlag:w}=b;if(ie>0){if(ie&128){De(u,W,C,U,H,F,se,Z,_);return}else if(ie&256){we(u,W,C,U,H,F,se,Z,_);return}}w&8?($&16&&L(u,H,F),W!==u&&p(C,W)):$&16?w&16?De(u,W,C,U,H,F,se,Z,_):L(u,H,F,!0):($&8&&p(C,""),w&16&&Q(W,C,U,H,F,se,Z,_))},we=(m,b,C,U,H,F,se,Z,_)=>{m=m||Qt,b=b||Qt;const u=m.length,$=b.length,W=Math.min(u,$);let ie;for(ie=0;ie<W;ie++){const w=b[ie]=_?Rt(b[ie]):ct(b[ie]);A(m[ie],w,C,null,H,F,se,Z,_)}u>$?L(m,H,F,!0,!1,W):Q(b,C,U,H,F,se,Z,_,W)},De=(m,b,C,U,H,F,se,Z,_)=>{let u=0;const $=b.length;let W=m.length-1,ie=$-1;for(;u<=W&&u<=ie;){const w=m[u],S=b[u]=_?Rt(b[u]):ct(b[u]);if(rs(w,S))A(w,S,C,null,H,F,se,Z,_);else break;u++}for(;u<=W&&u<=ie;){const w=m[W],S=b[ie]=_?Rt(b[ie]):ct(b[ie]);if(rs(w,S))A(w,S,C,null,H,F,se,Z,_);else break;W--,ie--}if(u>W){if(u<=ie){const w=ie+1,S=w<$?b[w].el:U;for(;u<=ie;)A(null,b[u]=_?Rt(b[u]):ct(b[u]),C,S,H,F,se,Z,_),u++}}else if(u>ie)for(;u<=W;)Te(m[u],H,F,!0),u++;else{const w=u,S=u,g=new Map;for(u=S;u<=ie;u++){const Xe=b[u]=_?Rt(b[u]):ct(b[u]);Xe.key!=null&&g.set(Xe.key,u)}let I,ge=0;const ne=ie-S+1;let Ae=!1,st=0;const is=new Array(ne);for(u=0;u<ne;u++)is[u]=0;for(u=w;u<=W;u++){const Xe=m[u];if(ge>=ne){Te(Xe,H,F,!0);continue}let rt;if(Xe.key!=null)rt=g.get(Xe.key);else for(I=S;I<=ie;I++)if(is[I-S]===0&&rs(Xe,b[I])){rt=I;break}rt===void 0?Te(Xe,H,F,!0):(is[rt-S]=u+1,rt>=st?st=rt:Ae=!0,A(Xe,b[rt],C,null,H,F,se,Z,_),ge++)}const lo=Ae?rl(is):Qt;for(I=lo.length-1,u=ne-1;u>=0;u--){const Xe=S+u,rt=b[Xe],uo=b[Xe+1],co=Xe+1<$?uo.el||uo.placeholder:U;is[u]===0?A(null,rt,C,co,H,F,se,Z,_):Ae&&(I<0||u!==lo[I]?Me(rt,C,co,2):I--)}}},Me=(m,b,C,U,H=null)=>{const{el:F,type:se,transition:Z,children:_,shapeFlag:u}=m;if(u&6){Me(m.component.subTree,b,C,U);return}if(u&128){m.suspense.move(b,C,U);return}if(u&64){se.move(m,b,C,te);return}if(se===$e){o(F,b,C);for(let W=0;W<_.length;W++)Me(_[W],b,C,U);o(m.anchor,b,C);return}if(se===Os){J(m,b,C);return}if(U!==2&&u&1&&Z)if(U===0)Z.beforeEnter(F),o(F,b,C),Ze(()=>Z.enter(F),H);else{const{leave:W,delayLeave:ie,afterLeave:w}=Z,S=()=>{m.ctx.isUnmounted?i(F):o(F,b,C)},g=()=>{F._isLeaving&&F[Tr](!0),W(F,()=>{S(),w&&w()})};ie?ie(F,S,g):g()}else o(F,b,C)},Te=(m,b,C,U=!1,H=!1)=>{const{type:F,props:se,ref:Z,children:_,dynamicChildren:u,shapeFlag:$,patchFlag:W,dirs:ie,cacheIndex:w}=m;if(W===-2&&(H=!1),Z!=null&&(Dt(),ps(Z,null,C,m,!0),kt()),w!=null&&(b.renderCache[w]=void 0),$&256){b.ctx.deactivate(m);return}const S=$&1&&ie,g=!gs(m);let I;if(g&&(I=se&&se.onVnodeBeforeUnmount)&<(I,b,m),$&6)h(m.component,C,U);else{if($&128){m.suspense.unmount(C,U);return}S&&Ft(m,null,b,"beforeUnmount"),$&64?m.type.remove(m,b,C,te,U):u&&!u.hasOnce&&(F!==$e||W>0&&W&64)?L(u,b,C,!1,!0):(F===$e&&W&384||!H&&$&16)&&L(_,b,C),U&&re(m)}(g&&(I=se&&se.onVnodeUnmounted)||S)&&Ze(()=>{I&<(I,b,m),S&&Ft(m,null,b,"unmounted")},C)},re=m=>{const{type:b,el:C,anchor:U,transition:H}=m;if(b===$e){D(C,U);return}if(b===Os){X(m);return}const F=()=>{i(C),H&&!H.persisted&&H.afterLeave&&H.afterLeave()};if(m.shapeFlag&1&&H&&!H.persisted){const{leave:se,delayLeave:Z}=H,_=()=>se(C,F);Z?Z(m.el,F,_):_()}else F()},D=(m,b)=>{let C;for(;m!==b;)C=y(m),i(m),m=C;i(b)},h=(m,b,C)=>{const{bum:U,scope:H,job:F,subTree:se,um:Z,m:_,a:u}=m;Co(_),Co(u),U&&Is(U),H.stop(),F&&(F.flags|=8,Te(se,m,b,C)),Z&&Ze(Z,b),Ze(()=>{m.isUnmounted=!0},b)},L=(m,b,C,U=!1,H=!1,F=0)=>{for(let se=F;se<m.length;se++)Te(m[se],b,C,U,H)},c=m=>{if(m.shapeFlag&6)return c(m.component.subTree);if(m.shapeFlag&128)return m.suspense.next();const b=y(m.anchor||m.el),C=b&&b[_r];return C?y(C):b};let P=!1;const B=(m,b,C)=>{m==null?b._vnode&&Te(b._vnode,null,null,!0):A(b._vnode||null,m,b,null,null,null,C),b._vnode=m,P||(P=!0,mo(),Ki(),P=!1)},te={p:A,um:Te,m:Me,r:re,mt:he,mc:Q,pc:ve,pbc:ee,n:c,o:e};return{render:B,hydrate:void 0,createApp:Yr(B)}}function mn({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Kt({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function al(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function ia(e,t,n=!1){const o=e.children,i=t.children;if(me(o)&&me(i))for(let a=0;a<o.length;a++){const r=o[a];let l=i[a];l.shapeFlag&1&&!l.dynamicChildren&&((l.patchFlag<=0||l.patchFlag===32)&&(l=i[a]=Rt(i[a]),l.el=r.el),!n&&l.patchFlag!==-2&&ia(r,l)),l.type===an&&l.patchFlag!==-1&&(l.el=r.el),l.type===Ot&&!l.el&&(l.el=r.el)}}function rl(e){const t=e.slice(),n=[0];let o,i,a,r,l;const d=e.length;for(o=0;o<d;o++){const v=e[o];if(v!==0){if(i=n[n.length-1],e[i]<v){t[o]=i,n.push(o);continue}for(a=0,r=n.length-1;a<r;)l=a+r>>1,e[n[l]]<v?a=l+1:r=l;v<e[n[a]]&&(a>0&&(t[o]=n[a-1]),n[a]=o)}}for(a=n.length,r=n[a-1];a-- >0;)n[a]=r,r=t[r];return n}function aa(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:aa(t)}function Co(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}const ll=Symbol.for("v-scx"),ul=()=>ft(ll);function It(e,t,n){return ra(e,t,n)}function ra(e,t,n=xe){const{immediate:o,deep:i,flush:a,once:r}=n,l=We({},n),d=t&&o||!t&&a!=="post";let v;if($s){if(a==="sync"){const k=ul();v=k.__watcherHandles||(k.__watcherHandles=[])}else if(!d){const k=()=>{};return k.stop=dt,k.resume=dt,k.pause=dt,k}}const p=ze;l.call=(k,N,A)=>gt(k,p,N,A);let f=!1;a==="post"?l.scheduler=k=>{Ze(k,p&&p.suspense)}:a!=="sync"&&(f=!0,l.scheduler=(k,N)=>{N?k():eo(k)}),l.augmentJob=k=>{t&&(k.flags|=4),f&&(k.flags|=2,p&&(k.id=p.uid,k.i=p))};const y=Dr(e,t,l);return $s&&(v?v.push(y):d&&y()),y}function cl(e,t,n){const o=this.proxy,i=Ue(e)?e.includes(".")?la(o,e):()=>o[e]:e.bind(o,o);let a;ye(t)?a=t:(a=t.handler,n=t);const r=Ls(this),l=ra(i,a.bind(o),n);return r(),l}function la(e,t){const n=t.split(".");return()=>{let o=e;for(let i=0;i<n.length&&o;i++)o=o[n[i]];return o}}const dl=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ot(t)}Modifiers`]||e[`${Vt(t)}Modifiers`];function fl(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||xe;let i=n;const a=t.startsWith("update:"),r=a&&dl(o,t.slice(7));r&&(r.trim&&(i=n.map(p=>Ue(p)?p.trim():p)),r.number&&(i=n.map(Fs)));let l,d=o[l=cn(t)]||o[l=cn(ot(t))];!d&&a&&(d=o[l=cn(Vt(t))]),d&>(d,e,6,i);const v=o[l+"Once"];if(v){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,gt(v,e,6,i)}}const pl=new WeakMap;function ua(e,t,n=!1){const o=n?pl:t.emitsCache,i=o.get(e);if(i!==void 0)return i;const a=e.emits;let r={},l=!1;if(!ye(e)){const d=v=>{const p=ua(v,t,!0);p&&(l=!0,We(r,p))};!n&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}return!a&&!l?(Re(e)&&o.set(e,null),null):(me(a)?a.forEach(d=>r[d]=null):We(r,a),Re(e)&&o.set(e,r),r)}function on(e,t){return!e||!Qs(t)?!1:(t=t.slice(2).replace(/Once$/,""),Ee(e,t[0].toLowerCase()+t.slice(1))||Ee(e,Vt(t))||Ee(e,t))}function _o(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[a],slots:r,attrs:l,emit:d,render:v,renderCache:p,props:f,data:y,setupState:k,ctx:N,inheritAttrs:A}=e,oe=Gs(e);let Y,G;try{if(n.shapeFlag&4){const X=i||o,ue=X;Y=ct(v.call(ue,X,p,f,k,y,N)),G=l}else{const X=t;Y=ct(X.length>1?X(f,{attrs:l,slots:r,emit:d}):X(f,null)),G=t.props?l:gl(l)}}catch(X){ms.length=0,sn(X,e,1),Y=Ie(Ot)}let J=Y;if(G&&A!==!1){const X=Object.keys(G),{shapeFlag:ue}=J;X.length&&ue&7&&(a&&X.some(Hn)&&(G=vl(G,a)),J=es(J,G,!1,!0))}return n.dirs&&(J=es(J,null,!1,!0),J.dirs=J.dirs?J.dirs.concat(n.dirs):n.dirs),n.transition&&to(J,n.transition),Y=J,Gs(oe),Y}const gl=e=>{let t;for(const n in e)(n==="class"||n==="style"||Qs(n))&&((t||(t={}))[n]=e[n]);return t},vl=(e,t)=>{const n={};for(const o in e)(!Hn(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function ml(e,t,n){const{props:o,children:i,component:a}=e,{props:r,children:l,patchFlag:d}=t,v=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&d>=0){if(d&1024)return!0;if(d&16)return o?Eo(o,r,v):!!r;if(d&8){const p=t.dynamicProps;for(let f=0;f<p.length;f++){const y=p[f];if(r[y]!==o[y]&&!on(v,y))return!0}}}else return(i||l)&&(!l||!l.$stable)?!0:o===r?!1:o?r?Eo(o,r,v):!0:!!r;return!1}function Eo(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let i=0;i<o.length;i++){const a=o[i];if(t[a]!==e[a]&&!on(n,a))return!0}return!1}function bl({vnode:e,parent:t},n){for(;t;){const o=t.subTree;if(o.suspense&&o.suspense.activeBranch===e&&(o.el=e.el),o===e)(e=t.vnode).el=n,t=t.parent;else break}}const ca=e=>e.__isSuspense;function hl(e,t){t&&t.pendingBranch?me(e)?t.effects.push(...e):t.effects.push(e):Cr(e)}const $e=Symbol.for("v-fgt"),an=Symbol.for("v-txt"),Ot=Symbol.for("v-cmt"),Os=Symbol.for("v-stc"),ms=[];let tt=null;function x(e=!1){ms.push(tt=e?null:[])}function yl(){ms.pop(),tt=ms[ms.length-1]||null}let ks=1;function Js(e,t=!1){ks+=e,e<0&&tt&&t&&(tt.hasOnce=!0)}function da(e){return e.dynamicChildren=ks>0?tt||Qt:null,yl(),ks>0&&tt&&tt.push(e),e}function R(e,t,n,o,i,a){return da(s(e,t,n,o,i,a,!0))}function wl(e,t,n,o,i){return da(Ie(e,t,n,o,i,!0))}function qs(e){return e?e.__v_isVNode===!0:!1}function rs(e,t){return e.type===t.type&&e.key===t.key}const fa=({key:e})=>e??null,Vs=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?Ue(e)||Ve(e)||ye(e)?{i:et,r:e,k:t,f:!!n}:e:null);function s(e,t=null,n=null,o=0,i=null,a=e===$e?0:1,r=!1,l=!1){const d={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&fa(t),ref:t&&Vs(t),scopeId:Bi,slotScopeIds:null,children:n,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:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:et};return l?(oo(d,n),a&128&&e.normalize(d)):n&&(d.shapeFlag|=Ue(n)?8:16),ks>0&&!r&&tt&&(d.patchFlag>0||a&6)&&d.patchFlag!==32&&tt.push(d),d}const Ie=Sl;function Sl(e,t=null,n=null,o=0,i=null,a=!1){if((!e||e===Kr)&&(e=Ot),qs(e)){const l=es(e,t,!0);return n&&oo(l,n),ks>0&&!a&&tt&&(l.shapeFlag&6?tt[tt.indexOf(e)]=l:tt.push(l)),l.patchFlag=-2,l}if(Pl(e)&&(e=e.__vccOpts),t){t=Dl(t);let{class:l,style:d}=t;l&&!Ue(l)&&(t.class=Se(l)),Re(d)&&(Zn(d)&&!me(d)&&(d=We({},d)),t.style=Gn(d))}const r=Ue(e)?1:ca(e)?128:Er(e)?64:Re(e)?4:ye(e)?2:0;return s(e,t,n,o,i,r,a,!0)}function Dl(e){return e?Zn(e)||Zi(e)?We({},e):e:null}function es(e,t,n=!1,o=!1){const{props:i,ref:a,patchFlag:r,children:l,transition:d}=e,v=t?kl(i||{},t):i,p={__v_isVNode:!0,__v_skip:!0,type:e.type,props:v,key:v&&fa(v),ref:t&&t.ref?n&&a?me(a)?a.concat(Vs(t)):[a,Vs(t)]:Vs(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==$e?r===-1?16:r|16:r,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:d,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&es(e.ssContent),ssFallback:e.ssFallback&&es(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return d&&o&&to(p,d.clone(p)),p}function T(e=" ",t=0){return Ie(an,null,e,t)}function bn(e,t){const n=Ie(Os,null,e);return n.staticCount=t,n}function de(e="",t=!1){return t?(x(),wl(Ot,null,e)):Ie(Ot,null,e)}function ct(e){return e==null||typeof e=="boolean"?Ie(Ot):me(e)?Ie($e,null,e.slice()):qs(e)?Rt(e):Ie(an,null,String(e))}function Rt(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:es(e)}function oo(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(me(t))n=16;else if(typeof t=="object")if(o&65){const i=t.default;i&&(i._c&&(i._d=!1),oo(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!Zi(t)?t._ctx=et:i===3&&et&&(et.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ye(t)?(t={default:t,_ctx:et},n=32):(t=String(t),o&64?(n=16,t=[T(t)]):n=8);e.children=t,e.shapeFlag|=n}function kl(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const i in o)if(i==="class")t.class!==o.class&&(t.class=Se([t.class,o.class]));else if(i==="style")t.style=Gn([t.style,o.style]);else if(Qs(i)){const a=t[i],r=o[i];r&&a!==r&&!(me(a)&&a.includes(r))&&(t[i]=a?[].concat(a,r):r)}else i!==""&&(t[i]=o[i])}return t}function lt(e,t,n,o=null){gt(e,t,7,[n,o])}const $l=Yi();let Cl=0;function _l(e,t,n){const o=e.type,i=(t?t.appContext:e.appContext)||$l,a={uid:Cl++,vnode:e,type:o,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new yi(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),ids:t?t.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:ta(o,i),emitsOptions:ua(o,i),emit:null,emitted:null,propsDefaults:xe,inheritAttrs:o.inheritAttrs,ctx:xe,data:xe,props:xe,attrs:xe,slots:xe,refs:xe,setupState:xe,setupContext:null,suspense:n,suspenseId:n?n.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=fl.bind(null,a),e.ce&&e.ce(a),a}let ze=null;const pa=()=>ze||et;let Ys,An;{const e=en(),t=(n,o)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(o),a=>{i.length>1?i.forEach(r=>r(a)):i[0](a)}};Ys=t("__VUE_INSTANCE_SETTERS__",n=>ze=n),An=t("__VUE_SSR_SETTERS__",n=>$s=n)}const Ls=e=>{const t=ze;return Ys(e),e.scope.on(),()=>{e.scope.off(),Ys(t)}},To=()=>{ze&&ze.scope.off(),Ys(null)};function ga(e){return e.vnode.shapeFlag&4}let $s=!1;function El(e,t=!1,n=!1){t&&An(t);const{props:o,children:i}=e.vnode,a=ga(e);Xr(e,o,a,t),sl(e,i,n||t);const r=a?Tl(e,t):void 0;return t&&An(!1),r}function Tl(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Br);const{setup:o}=n;if(o){Dt();const i=e.setupContext=o.length>1?Rl(e):null,a=Ls(e),r=xs(o,e,0,[e.props,i]),l=fi(r);if(kt(),a(),(l||e.sp)&&!gs(e)&&Gi(e),l){if(r.then(To,To),t)return r.then(d=>{xo(e,d)}).catch(d=>{sn(d,e,0)});e.asyncDep=r}else xo(e,r)}else va(e)}function xo(e,t,n){ye(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Re(t)&&(e.setupState=Vi(t)),va(e)}function va(e,t,n){const o=e.type;e.render||(e.render=o.render||dt);{const i=Ls(e);Dt();try{jr(e)}finally{kt(),i()}}}const xl={get(e,t){return Ge(e,"get",""),e[t]}};function Rl(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,xl),slots:e.slots,emit:e.emit,expose:t}}function rn(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Vi(Ss(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in vs)return vs[n](e)},has(t,n){return n in t||n in vs}})):e.proxy}function Ll(e,t=!0){return ye(e)?e.displayName||e.name:e.name||t&&e.__name}function Pl(e){return ye(e)&&"__vccOpts"in e}const ce=(e,t)=>wr(e,t,$s);function ma(e,t,n){try{Js(-1);const o=arguments.length;return o===2?Re(t)&&!me(t)?qs(t)?Ie(e,null,[t]):Ie(e,t):Ie(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):o===3&&qs(n)&&(n=[n]),Ie(e,t,n))}finally{Js(1)}}const Al="3.5.22";/**
|
|
14
|
+
* @vue/runtime-dom v3.5.22
|
|
15
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
16
|
+
* @license MIT
|
|
17
|
+
**/let Mn;const Ro=typeof window<"u"&&window.trustedTypes;if(Ro)try{Mn=Ro.createPolicy("vue",{createHTML:e=>e})}catch{}const ba=Mn?e=>Mn.createHTML(e):e=>e,Ml="http://www.w3.org/2000/svg",Il="http://www.w3.org/1998/Math/MathML",ht=typeof document<"u"?document:null,Lo=ht&&ht.createElement("template"),Nl={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?ht.createElementNS(Ml,e):t==="mathml"?ht.createElementNS(Il,e):n?ht.createElement(e,{is:n}):ht.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>ht.createTextNode(e),createComment:e=>ht.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ht.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,a){const r=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{Lo.innerHTML=ba(o==="svg"?`<svg>${e}</svg>`:o==="mathml"?`<math>${e}</math>`:e);const l=Lo.content;if(o==="svg"||o==="mathml"){const d=l.firstChild;for(;d.firstChild;)l.appendChild(d.firstChild);l.removeChild(d)}t.insertBefore(l,n)}return[r?r.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Ol=Symbol("_vtc");function Vl(e,t,n){const o=e[Ol];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const Po=Symbol("_vod"),Ul=Symbol("_vsh"),Fl=Symbol(""),Kl=/(?:^|;)\s*display\s*:/;function Hl(e,t,n){const o=e.style,i=Ue(n);let a=!1;if(n&&!i){if(t)if(Ue(t))for(const r of t.split(";")){const l=r.slice(0,r.indexOf(":")).trim();n[l]==null&&Us(o,l,"")}else for(const r in t)n[r]==null&&Us(o,r,"");for(const r in n)r==="display"&&(a=!0),Us(o,r,n[r])}else if(i){if(t!==n){const r=o[Fl];r&&(n+=";"+r),o.cssText=n,a=Kl.test(n)}}else t&&e.removeAttribute("style");Po in e&&(e[Po]=a?o.display:"",e[Ul]&&(o.display="none"))}const Ao=/\s*!important$/;function Us(e,t,n){if(me(n))n.forEach(o=>Us(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=Bl(e,t);Ao.test(n)?e.setProperty(Vt(o),n.replace(Ao,""),"important"):e[o]=n}}const Mo=["Webkit","Moz","ms"],hn={};function Bl(e,t){const n=hn[t];if(n)return n;let o=ot(t);if(o!=="filter"&&o in e)return hn[t]=o;o=Zs(o);for(let i=0;i<Mo.length;i++){const a=Mo[i]+o;if(a in e)return hn[t]=a}return t}const Io="http://www.w3.org/1999/xlink";function No(e,t,n,o,i,a=Ga(t)){o&&t.startsWith("xlink:")?n==null?e.removeAttributeNS(Io,t.slice(6,t.length)):e.setAttributeNS(Io,t,n):n==null||a&&!mi(n)?e.removeAttribute(t):e.setAttribute(t,a?"":pt(n)?String(n):n)}function Oo(e,t,n,o,i){if(t==="innerHTML"||t==="textContent"){n!=null&&(e[t]=t==="innerHTML"?ba(n):n);return}const a=e.tagName;if(t==="value"&&a!=="PROGRESS"&&!a.includes("-")){const l=a==="OPTION"?e.getAttribute("value")||"":e.value,d=n==null?e.type==="checkbox"?"on":"":String(n);(l!==d||!("_value"in e))&&(e.value=d),n==null&&e.removeAttribute(t),e._value=n;return}let r=!1;if(n===""||n==null){const l=typeof e[t];l==="boolean"?n=mi(n):n==null&&l==="string"?(n="",r=!0):l==="number"&&(n=0,r=!0)}try{e[t]=n}catch{}r&&e.removeAttribute(i||t)}function Pt(e,t,n,o){e.addEventListener(t,n,o)}function jl(e,t,n,o){e.removeEventListener(t,n,o)}const Vo=Symbol("_vei");function Gl(e,t,n,o,i=null){const a=e[Vo]||(e[Vo]={}),r=a[t];if(o&&r)r.value=o;else{const[l,d]=zl(t);if(o){const v=a[t]=ql(o,i);Pt(e,l,v,d)}else r&&(jl(e,l,r,d),a[t]=void 0)}}const Uo=/(?:Once|Passive|Capture)$/;function zl(e){let t;if(Uo.test(e)){t={};let o;for(;o=e.match(Uo);)e=e.slice(0,e.length-o[0].length),t[o[0].toLowerCase()]=!0}return[e[2]===":"?e.slice(3):Vt(e.slice(2)),t]}let yn=0;const Wl=Promise.resolve(),Jl=()=>yn||(Wl.then(()=>yn=0),yn=Date.now());function ql(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;gt(Yl(o,n.value),t,5,[o])};return n.value=e,n.attached=Jl(),n}function Yl(e,t){if(me(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const Fo=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ql=(e,t,n,o,i,a)=>{const r=i==="svg";t==="class"?Vl(e,o,r):t==="style"?Hl(e,n,o):Qs(t)?Hn(t)||Gl(e,t,n,o,a):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Xl(e,t,o,r))?(Oo(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&No(e,t,o,r,a,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!Ue(o))?Oo(e,ot(t),o,a,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),No(e,t,o,r))};function Xl(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Fo(t)&&ye(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Fo(t)&&Ue(n)?!1:t in e}const ts=e=>{const t=e.props["onUpdate:modelValue"]||!1;return me(t)?n=>Is(t,n):t};function Zl(e){e.target.composing=!0}function Ko(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const St=Symbol("_assign"),ke={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[St]=ts(i);const a=o||i.props&&i.props.type==="number";Pt(e,t?"change":"input",r=>{if(r.target.composing)return;let l=e.value;n&&(l=l.trim()),a&&(l=Fs(l)),e[St](l)}),n&&Pt(e,"change",()=>{e.value=e.value.trim()}),t||(Pt(e,"compositionstart",Zl),Pt(e,"compositionend",Ko),Pt(e,"change",Ko))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:a}},r){if(e[St]=ts(r),e.composing)return;const l=(a||e.type==="number")&&!/^0\d/.test(e.value)?Fs(e.value):e.value,d=t??"";l!==d&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===d)||(e.value=d))}},Ke={deep:!0,created(e,t,n){e[St]=ts(n),Pt(e,"change",()=>{const o=e._modelValue,i=Cs(e),a=e.checked,r=e[St];if(me(o)){const l=zn(o,i),d=l!==-1;if(a&&!d)r(o.concat(i));else if(!a&&d){const v=[...o];v.splice(l,1),r(v)}}else if(os(o)){const l=new Set(o);a?l.add(i):l.delete(i),r(l)}else r(ha(e,a))})},mounted:Ho,beforeUpdate(e,t,n){e[St]=ts(n),Ho(e,t,n)}};function Ho(e,{value:t,oldValue:n},o){e._modelValue=t;let i;if(me(t))i=zn(t,o.props.value)>-1;else if(os(t))i=t.has(o.props.value);else{if(t===n)return;i=Ts(t,ha(e,!0))}e.checked!==i&&(e.checked=i)}const Oe={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const i=os(t);Pt(e,"change",()=>{const a=Array.prototype.filter.call(e.options,r=>r.selected).map(r=>n?Fs(Cs(r)):Cs(r));e[St](e.multiple?i?new Set(a):a:a[0]),e._assigning=!0,zt(()=>{e._assigning=!1})}),e[St]=ts(o)},mounted(e,{value:t}){Bo(e,t)},beforeUpdate(e,t,n){e[St]=ts(n)},updated(e,{value:t}){e._assigning||Bo(e,t)}};function Bo(e,t){const n=e.multiple,o=me(t);if(!(n&&!o&&!os(t))){for(let i=0,a=e.options.length;i<a;i++){const r=e.options[i],l=Cs(r);if(n)if(o){const d=typeof l;d==="string"||d==="number"?r.selected=t.some(v=>String(v)===String(l)):r.selected=zn(t,l)>-1}else r.selected=t.has(l);else if(Ts(Cs(r),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Cs(e){return"_value"in e?e._value:e.value}function ha(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const eu=["ctrl","shift","alt","meta"],tu={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)=>eu.some(n=>e[`${n}Key`]&&!t.includes(n))},jo=(e,t)=>{const n=e._withMods||(e._withMods={}),o=t.join(".");return n[o]||(n[o]=(i,...a)=>{for(let r=0;r<t.length;r++){const l=tu[t[r]];if(l&&l(i,t))return}return e(i,...a)})},su={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},Go=(e,t)=>{const n=e._withKeys||(e._withKeys={}),o=t.join(".");return n[o]||(n[o]=i=>{if(!("key"in i))return;const a=Vt(i.key);if(t.some(r=>r===a||su[r]===a))return e(i)})},nu=We({patchProp:Ql},Nl);let zo;function ou(){return zo||(zo=ol(nu))}const iu=(...e)=>{const t=ou().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=ru(o);if(!i)return;const a=t._component;!ye(a)&&!a.render&&!a.template&&(a.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const r=n(i,!1,au(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),r},t};function au(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function ru(e){return Ue(e)?document.querySelector(e):e}/*!
|
|
18
|
+
* pinia v2.3.1
|
|
19
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
20
|
+
* @license MIT
|
|
21
|
+
*/let ya;const ln=e=>ya=e,wa=Symbol();function In(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var bs;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(bs||(bs={}));function lu(){const e=wi(!0),t=e.run(()=>K({}));let n=[],o=[];const i=Ss({install(a){ln(i),i._a=a,a.provide(wa,i),a.config.globalProperties.$pinia=i,o.forEach(r=>n.push(r)),o=[]},use(a){return this._a?n.push(a):o.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const Sa=()=>{};function Wo(e,t,n,o=Sa){e.push(t);const i=()=>{const a=e.indexOf(t);a>-1&&(e.splice(a,1),o())};return!n&&Si()&&Wa(i),i}function Jt(e,...t){e.slice().forEach(n=>{n(...t)})}const uu=e=>e(),Jo=Symbol(),wn=Symbol();function Nn(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,o)=>e.set(o,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const o=t[n],i=e[n];In(i)&&In(o)&&e.hasOwnProperty(n)&&!Ve(o)&&!Mt(o)?e[n]=Nn(i,o):e[n]=o}return e}const cu=Symbol();function du(e){return!In(e)||!e.hasOwnProperty(cu)}const{assign:Tt}=Object;function fu(e){return!!(Ve(e)&&e.effect)}function pu(e,t,n,o){const{state:i,actions:a,getters:r}=t,l=n.state.value[e];let d;function v(){l||(n.state.value[e]=i?i():{});const p=mr(n.state.value[e]);return Tt(p,a,Object.keys(r||{}).reduce((f,y)=>(f[y]=Ss(ce(()=>{ln(n);const k=n._s.get(e);return r[y].call(k,k)})),f),{}))}return d=Da(e,v,t,n,o,!0),d}function Da(e,t,n={},o,i,a){let r;const l=Tt({actions:{}},n),d={deep:!0};let v,p,f=[],y=[],k;const N=o.state.value[e];!a&&!N&&(o.state.value[e]={}),K({});let A;function oe(Q){let O;v=p=!1,typeof Q=="function"?(Q(o.state.value[e]),O={type:bs.patchFunction,storeId:e,events:k}):(Nn(o.state.value[e],Q),O={type:bs.patchObject,payload:Q,storeId:e,events:k});const ee=A=Symbol();zt().then(()=>{A===ee&&(v=!0)}),p=!0,Jt(f,O,o.state.value[e])}const Y=a?function(){const{state:O}=n,ee=O?O():{};this.$patch(q=>{Tt(q,ee)})}:Sa;function G(){r.stop(),f=[],y=[],o._s.delete(e)}const J=(Q,O="")=>{if(Jo in Q)return Q[wn]=O,Q;const ee=function(){ln(o);const q=Array.from(arguments),z=[],le=[];function he(j){z.push(j)}function M(j){le.push(j)}Jt(y,{args:q,name:ee[wn],store:ue,after:he,onError:M});let V;try{V=Q.apply(this&&this.$id===e?this:ue,q)}catch(j){throw Jt(le,j),j}return V instanceof Promise?V.then(j=>(Jt(z,j),j)).catch(j=>(Jt(le,j),Promise.reject(j))):(Jt(z,V),V)};return ee[Jo]=!0,ee[wn]=O,ee},X={_p:o,$id:e,$onAction:Wo.bind(null,y),$patch:oe,$reset:Y,$subscribe(Q,O={}){const ee=Wo(f,Q,O.detached,()=>q()),q=r.run(()=>It(()=>o.state.value[e],z=>{(O.flush==="sync"?p:v)&&Q({storeId:e,type:bs.direct,events:k},z)},Tt({},d,O)));return ee},$dispose:G},ue=qe(X);o._s.set(e,ue);const fe=(o._a&&o._a.runWithContext||uu)(()=>o._e.run(()=>(r=wi()).run(()=>t({action:J}))));for(const Q in fe){const O=fe[Q];if(Ve(O)&&!fu(O)||Mt(O))a||(N&&du(O)&&(Ve(O)?O.value=N[Q]:Nn(O,N[Q])),o.state.value[e][Q]=O);else if(typeof O=="function"){const ee=J(O,Q);fe[Q]=ee,l.actions[Q]=O}}return Tt(ue,fe),Tt(Ce(ue),fe),Object.defineProperty(ue,"$state",{get:()=>o.state.value[e],set:Q=>{oe(O=>{Tt(O,Q)})}}),o._p.forEach(Q=>{Tt(ue,r.run(()=>Q({store:ue,app:o._a,pinia:o,options:l})))}),N&&a&&n.hydrate&&n.hydrate(ue.$state,N),v=!0,p=!0,ue}/*! #__NO_SIDE_EFFECTS__ */function gu(e,t,n){let o,i;const a=typeof t=="function";o=e,i=a?n:t;function r(l,d){const v=Qr();return l=l||(v?ft(wa,null):null),l&&ln(l),l=ya,l._s.has(o)||(a?Da(o,t,i,l):pu(o,i,l)),l._s.get(o)}return r.$id=o,r}const vu=(e=5e3)=>new Promise((t,n)=>{const o=Date.now(),i=100,a=()=>{var r;(r=window.PeerPigeon)!=null&&r.PeerPigeonMesh?(console.log("โ
PeerPigeon loaded successfully"),t(window.PeerPigeon)):Date.now()-o>e?(console.error("โ PeerPigeon failed to load within timeout"),n(new Error("PeerPigeon library not available"))):setTimeout(a,i)};a()}),Ct=gu("peerpigeon",()=>{const e=K(null),t=K(!1),n=K(!1),o=K("ws://localhost:3000"),i=K(""),a=K("global"),r=K("global"),l=K(!1),d=K(!0),v=qe(new Map),p=qe(new Map),f=qe({connectedCount:0,maxPeers:4,minPeers:2,autoConnect:!0,autoDiscovery:!0,evictionStrategy:!0,xorRouting:!0}),y=K([]),k=qe(new Map),N=qe({localStream:null,remoteStreams:new Map,audioEnabled:!1,videoEnabled:!1,devices:[]}),A=qe(new Map),oe=qe({}),Y=qe(new Map),G=qe({}),J=K([]),X=qe({enabled:!1,initialized:!1,publicKey:"",peerKeys:new Map}),ue=K([]),be=K([]),fe=K(new Set),Q=ce(()=>Array.from(v.values()).filter(w=>w.connected)),O=ce(()=>f.connectedCount<f.maxPeers),ee=async(w={})=>{try{M("Waiting for PeerPigeon library to load...","info");let S;try{S=await vu()}catch(I){console.error("โ PeerPigeon not available:",I),M("PeerPigeon library not found - using mock","error"),S=null}console.log("๐ PeerPigeon availability:",{available:!!S,PeerPigeonMesh:!!(S!=null&&S.PeerPigeonMesh),keys:S?Object.keys(S):[]});const g=S==null?void 0:S.PeerPigeonMesh;if(g){console.log("๐ Initializing real PeerPigeonMesh with options:",{networkName:a.value,maxPeers:f.maxPeers,autoConnect:!0,autoDiscovery:f.autoDiscovery});const I={enableWebDHT:!0,enableCrypto:!0,enableDistributedStorage:!0,networkName:a.value,allowGlobalFallback:d.value,maxPeers:f.maxPeers,minPeers:f.minPeers,autoConnect:!0,autoDiscovery:f.autoDiscovery,evictionStrategy:f.evictionStrategy,xorRouting:f.xorRouting,...w};e.value=Ss(new g(I)),console.log("โ
PeerPigeonMesh instance created (marked as raw)")}else{console.error("โ PeerPigeonMesh not found! Using mock implementation."),M("Using mock PeerPigeon implementation","warning");const I=class{constructor(ne){this.options=ne,this.peerId="mock-peer-"+Math.random().toString(36).substr(2,9),this.eventListeners=new Map,this.networkName=ne.networkName||"global",this.originalNetworkName=this.networkName,this.isInFallbackMode=!1,this.allowGlobalFallback=ne.allowGlobalFallback!==!1}async init(){return M("Mock mesh initialized","success"),!0}async connect(ne){return M(`Mock connected to ${ne}`,"success"),!0}disconnect(){M("Mock disconnected","info")}addEventListener(ne,Ae){this.eventListeners.has(ne)||this.eventListeners.set(ne,[]),this.eventListeners.get(ne).push(Ae)}sendMessage(ne){return M(`Mock broadcast: ${JSON.stringify(ne)}`,"info"),"mock-message-id-"+Date.now()}sendDirectMessage(ne,Ae){return M(`Mock direct to ${ne}: ${JSON.stringify(Ae)}`,"info"),"mock-message-id-"+Date.now()}getStatus(){return{connectedCount:0,maxPeers:f.maxPeers,minPeers:f.minPeers,autoDiscovery:f.autoDiscovery,evictionStrategy:f.evictionStrategy,xorRouting:f.xorRouting,networkName:this.networkName,originalNetworkName:this.originalNetworkName,isInFallbackMode:this.isInFallbackMode,allowGlobalFallback:this.allowGlobalFallback}}setNetworkName(ne){return this.networkName=ne||"global",this.originalNetworkName=this.networkName,this.isInFallbackMode=!1,M(`Mock network changed to: ${this.networkName}`,"info"),this.networkName}getNetworkName(){return this.networkName}getOriginalNetworkName(){return this.originalNetworkName}isUsingGlobalFallback(){return this.isInFallbackMode}setAllowGlobalFallback(ne){return this.allowGlobalFallback=ne,M(`Mock global fallback ${ne?"enabled":"disabled"}`,"info"),this.allowGlobalFallback}async startMedia(ne){return M(`Mock media started: ${JSON.stringify(ne)}`,"info"),null}async stopMedia(){M("Mock media stopped","info")}async dhtPut(ne,Ae,st){return M(`Mock DHT PUT: ${ne}`,"info"),!0}async dhtGet(ne,Ae){return M(`Mock DHT GET: ${ne}`,"info"),null}getDHTStats(){return{entries:0,peers:0}}get distributedStorage(){return{store:async(ne,Ae,st)=>(M(`Mock storage STORE: ${ne}`,"info"),!0),retrieve:async(ne,Ae)=>(M(`Mock storage RETRIEVE: ${ne}`,"info"),null),getStats:async()=>({items:0,size:0})}}get cryptoManager(){return{init:async()=>!0,getPublicKey:()=>"mock-public-key"}}},ge={enableWebDHT:!0,enableCrypto:!0,enableDistributedStorage:!0,networkName:a.value,allowGlobalFallback:d.value,maxPeers:f.maxPeers,minPeers:f.minPeers,autoConnect:!0,autoDiscovery:f.autoDiscovery,evictionStrategy:f.evictionStrategy,xorRouting:f.xorRouting,...w};e.value=Ss(new I(ge))}return le(),await e.value.init(),t.value=!0,i.value=e.value.peerId,e.value.getNetworkName&&(a.value=e.value.getNetworkName(),r.value=e.value.getOriginalNetworkName(),l.value=e.value.isUsingGlobalFallback()),e.value.cryptoManager&&(await e.value.cryptoManager.init(),X.enabled=!0,X.initialized=!0,X.publicKey=e.value.cryptoManager.getPublicKey()),M(`Mesh initialized successfully in network: ${a.value}`,"success"),!0}catch(S){throw M(`Failed to initialize mesh: ${S.message}`,"error"),S}},q=async w=>{if(!e.value||!t.value)throw new Error("Mesh not initialized");try{return o.value=w,await e.value.connect(w),n.value=!0,M(`Connected to signaling server: ${w}`,"success"),!0}catch(S){throw M(`Failed to connect to signaling server: ${S.message}`,"error"),S}},z=()=>{e.value&&(e.value.disconnect(),n.value=!1,v.clear(),p.clear(),f.connectedCount=0,M("Disconnected from mesh","info"))},le=()=>{e.value&&(e.value.addEventListener("statusChanged",w=>{M(`Status: ${w.type} - ${w.message||""}`,"info"),w.type==="network"&&(a.value=w.networkName||a.value,l.value=w.fallbackMode||!1,M(`Network status: ${w.message}`,w.fallbackMode?"warning":"info")),w.type==="setting"&&(w.setting==="networkName"?a.value=w.value:w.setting==="allowGlobalFallback"&&(d.value=w.value)),he()}),e.value.addEventListener("peerConnected",w=>{console.log("๐ค PEER CONNECTED EVENT:",w);const S={id:w.peerId,connected:!0,connectionTime:new Date,status:"connected"};v.set(w.peerId,S),he(),M(`Peer connected: ${w.peerId.substring(0,8)}...`,"success")}),e.value.addEventListener("peerDisconnected",w=>{console.log("๐ PEER DISCONNECTED EVENT:",w);const S=v.get(w.peerId);S&&(S.connected=!1,S.status="disconnected",S.disconnectionTime=new Date,S.disconnectionReason=w.reason),he(),M(`Peer disconnected: ${w.peerId.substring(0,8)}... (${w.reason})`,"warning")}),e.value.addEventListener("peerDiscovered",w=>{console.log("๐ PEER DISCOVERED EVENT:",w),p.set(w.peerId,{id:w.peerId,discoveryTime:new Date,status:"discovered"}),M(`Peer discovered: ${w.peerId.substring(0,8)}...`,"info")}),e.value.addEventListener("messageReceived",w=>{var g;const S={id:w.messageId||Date.now().toString(),content:w.message||w.content,from:w.from,timestamp:new Date,type:w.subtype||"broadcast",fromPeerId:((g=w.from)==null?void 0:g.substring(0,8))+"..."||"unknown"};w.subtype==="direct"?(k.has(w.from)||k.set(w.from,[]),k.get(w.from).push(S)):y.value.push(S),M(`Message received from ${S.fromPeerId}: ${JSON.stringify(S.content)}`,"info")}),e.value.addEventListener("localStreamStarted",w=>{N.localStream=w.stream,M("Local media stream started","success")}),e.value.addEventListener("localStreamStopped",()=>{N.localStream=null,M("Local media stream stopped","info")}),e.value.addEventListener("remoteStream",w=>{N.remoteStreams.set(w.peerId,{stream:w.stream,peerId:w.peerId,startTime:new Date}),M(`Remote stream received from ${w.peerId.substring(0,8)}...`,"success")}),e.value.addEventListener("remoteStreamEnded",w=>{N.remoteStreams.delete(w.peerId),M(`Remote stream ended from ${w.peerId.substring(0,8)}...`,"info")}),e.value.addEventListener("dhtValueChanged",w=>{A.set(w.key,{value:w.newValue,timestamp:new Date,version:w.version}),M(`DHT value changed: ${w.key}`,"info")}),e.value.addEventListener("storageDataStored",w=>{M(`Storage data stored: ${w.key}`,"success")}),e.value.addEventListener("storageDataUpdated",w=>{M(`Storage data updated: ${w.key} (version ${w.version})`,"info")}),e.value.addEventListener("cryptoReady",()=>{X.initialized=!0,M("Crypto system ready","success")}),e.value.addEventListener("peerKeyAdded",w=>{X.peerKeys.set(w.peerId,w.publicKey),M(`Peer key added: ${w.peerId.substring(0,8)}...`,"success")}))},he=()=>{if(!e.value)return;const w=e.value.getStatus();f.connectedCount=w.connectedCount,f.maxPeers=w.maxPeers,f.minPeers=w.minPeers,f.autoDiscovery=w.autoDiscovery,f.evictionStrategy=w.evictionStrategy,f.xorRouting=w.xorRouting},M=(w,S="info")=>{const g={timestamp:new Date,message:w,level:S,id:Date.now()+Math.random()};ue.value.push(g),ue.value.length>100&&ue.value.shift()};return{mesh:e,isInitialized:t,isConnected:n,signalingUrl:o,peerId:i,networkName:a,originalNetworkName:r,isInFallbackMode:l,allowGlobalFallback:d,peers:v,discoveredPeers:p,networkStatus:f,messages:y,directMessages:k,mediaState:N,dhtData:A,dhtStats:oe,storageData:Y,storageStats:G,cryptoKeys:J,cryptoState:X,debugLogs:ue,debugModules:be,enabledModules:fe,connectedPeersList:Q,canAcceptMorePeers:O,initMesh:ee,connectToSignaling:q,disconnect:z,sendBroadcastMessage:w=>{if(!e.value||!n.value)throw new Error("Not connected to mesh");const S=e.value.sendMessage(w),g={id:S,content:w,from:i.value,timestamp:new Date,type:"broadcast",fromPeerId:"You"};return y.value.push(g),M(`Broadcast message sent: ${JSON.stringify(w)}`,"success"),S},sendDirectMessage:(w,S)=>{if(!e.value||!n.value)throw new Error("Not connected to mesh");const g=e.value.sendDirectMessage(w,S),I={id:g,content:S,from:i.value,to:w,timestamp:new Date,type:"direct",fromPeerId:"You"};return k.has(w)||k.set(w,[]),k.get(w).push(I),M(`Direct message sent to ${w.substring(0,8)}...: ${JSON.stringify(S)}`,"success"),g},startMedia:async(w={})=>{if(!e.value)throw new Error("Mesh not initialized");const S=await e.value.startMedia(w);return N.audioEnabled=S.getAudioTracks().length>0,N.videoEnabled=S.getVideoTracks().length>0,S},stopMedia:async()=>{e.value&&(await e.value.stopMedia(),N.audioEnabled=!1,N.videoEnabled=!1)},dhtPut:async(w,S,g={})=>{if(!e.value)throw new Error("Mesh not initialized");const I=await e.value.dhtPut(w,S,g);return I&&(A.set(w,{value:S,timestamp:new Date,local:!0}),M(`DHT put: ${w}`,"success")),I},dhtGet:async(w,S={})=>{if(!e.value)throw new Error("Mesh not initialized");const g=await e.value.dhtGet(w,S);return g!==null&&(A.set(w,{value:g,timestamp:new Date,local:!1}),M(`DHT get: ${w}`,"success")),g},getDHTStats:()=>e.value?e.value.getDHTStats():{},storageStore:async(w,S,g={})=>{var ge;if(!((ge=e.value)!=null&&ge.distributedStorage))throw new Error("Distributed storage not available");const I=await e.value.distributedStorage.store(w,S,g);return Y.set(w,{value:S,options:g,timestamp:new Date,local:!0}),I},storageRetrieve:async(w,S={})=>{var I;if(!((I=e.value)!=null&&I.distributedStorage))throw new Error("Distributed storage not available");const g=await e.value.distributedStorage.retrieve(w,S);return g!==null&&Y.set(w,{value:g,timestamp:new Date,local:!1}),g},getStorageStats:async()=>{var w;return(w=e.value)!=null&&w.distributedStorage?await e.value.distributedStorage.getStats():{}},getDebugModules:()=>{var w;return(w=e.value)!=null&&w.debugLogger?e.value.debugLogger.getModules():["PeerPigeonMesh","ConnectionManager","GossipManager","WebDHT","CryptoManager","MediaManager"]},enableDebugModule:w=>{var S;fe.value.add(w),(S=e.value)!=null&&S.debugLogger&&e.value.debugLogger.enable(w),M(`Debug enabled for module: ${w}`,"info")},disableDebugModule:w=>{var S;fe.value.delete(w),(S=e.value)!=null&&S.debugLogger&&e.value.debugLogger.disable(w),M(`Debug disabled for module: ${w}`,"info")},clearDebugLogs:()=>{ue.value=[]},addDebugLog:M,setNetworkName:w=>{if(e.value&&e.value.setNetworkName){const S=e.value.setNetworkName(w);return a.value=S,r.value=e.value.getOriginalNetworkName(),l.value=e.value.isUsingGlobalFallback(),M(`Network changed to: ${S}`,"success"),S}else return a.value=w||"global",r.value=a.value,l.value=!1,M(`Network name set: ${a.value}`,"info"),a.value},getNetworkInfo:()=>({currentNetwork:a.value,originalNetwork:r.value,isInFallbackMode:l.value,allowGlobalFallback:d.value}),setAllowGlobalFallback:w=>{if(e.value&&e.value.setAllowGlobalFallback){const S=e.value.setAllowGlobalFallback(w);return d.value=S,M(`Global fallback ${w?"enabled":"disabled"}`,"success"),S}else return d.value=w,M(`Global fallback setting: ${w}`,"info"),d.value},forceReturnToOriginalNetwork:async()=>{e.value&&e.value._tryReturnToOriginalNetwork?(await e.value._tryReturnToOriginalNetwork(),a.value=e.value.getNetworkName(),l.value=e.value.isUsingGlobalFallback(),M("Attempted to return to original network","info")):M("Force return to original network not available","warning")},initializeCrypto:async()=>{try{return X.initialized=!0,M("Crypto system initialized","success"),!0}catch(w){return M(`Crypto initialization failed: ${w.message}`,"error"),!1}},cryptoGenerateKey:async(w,S,g)=>{try{const I={id:Date.now().toString(),name:g,type:w,size:S,algorithm:w,usage:["encrypt","decrypt","sign","verify"],extractable:!0,created:Date.now(),fingerprint:Math.random().toString(36).substring(2)};return J.value.push(I),M(`Generated ${w} key: ${g}`,"success"),I}catch(I){return M(`Key generation failed: ${I.message}`,"error"),null}},cryptoImportKey:async(w,S)=>{try{const g={id:Date.now().toString(),name:S,type:"imported",algorithm:"RSA",usage:["encrypt","decrypt"],extractable:!0,created:Date.now(),fingerprint:Math.random().toString(36).substring(2)};return J.value.push(g),M(`Imported key: ${S}`,"success"),!0}catch(g){return M(`Key import failed: ${g.message}`,"error"),!1}},cryptoEncrypt:async(w,S,g)=>{try{const I=btoa(JSON.stringify(w));return M(`Data encrypted with key: ${S}`,"success"),I}catch(I){return M(`Encryption failed: ${I.message}`,"error"),null}},cryptoDecrypt:async(w,S)=>{try{const g=JSON.parse(atob(w));return M(`Data decrypted with key: ${S}`,"success"),g}catch(g){return M(`Decryption failed: ${g.message}`,"error"),null}},cryptoSign:async(w,S,g)=>{try{const I=btoa(w+S+Date.now());return M(`Data signed with key: ${S}`,"success"),I}catch(I){return M(`Signing failed: ${I.message}`,"error"),null}},cryptoVerify:async(w,S,g)=>{try{return M(`Signature verified with key: ${g}`,"success"),!0}catch(I){return M(`Verification failed: ${I.message}`,"error"),!1}},cryptoKeyExchange:async(w,S,g)=>{try{const I={keyId:Date.now().toString(),peerId:w,method:S,purpose:g,created:Date.now()};return M(`Key exchange initiated: ${S}`,"success"),I}catch(I){return M(`Key exchange failed: ${I.message}`,"error"),null}},cryptoRefreshKeys:async()=>{M("Key store refreshed","info")},cryptoExportKey:async w=>{const S=J.value.find(g=>g.id===w);return S?(M(`Key exported: ${S.name}`,"success"),{...S,privateKey:"mock-private-key"}):null},cryptoDeleteKey:async w=>{const S=J.value.findIndex(g=>g.id===w);if(S!==-1){const g=J.value.splice(S,1)[0];return M(`Key deleted: ${g.name}`,"info"),!0}return!1}}}),_t=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},mu={id:"app"},bu={class:"header"},hu={class:"container"},yu={class:"header-content"},wu={class:"status-bar"},Su={key:0,class:"status-item"},Du={class:"network-display"},ku={key:0,class:"fallback-indicator"},$u={key:1,class:"status-item"},Cu={class:"status-item"},_u={class:"connection-controls"},Eu={class:"input-group"},Tu=["disabled"],xu={class:"input-group"},Ru=["disabled"],Lu=["disabled"],Pu={class:"nav-tabs"},Au={class:"container"},Mu={class:"tabs"},Iu={class:"main-content"},Nu={class:"container"},Ou={__name:"App",setup(e){const t=Ct(),n=ce(()=>t.isInitialized),o=ce(()=>t.isConnected),i=ce({get:()=>t.signalingUrl,set:p=>t.signalingUrl=p}),a=ce({get:()=>t.networkName,set:p=>t.setNetworkName(p)}),r=ce(()=>t.peerId),l=ce(()=>t.networkStatus),d=async()=>{try{a.value&&a.value.trim()&&t.setNetworkName(a.value.trim()),await t.connectToSignaling(i.value)}catch(p){console.error("Connection failed:",p),alert(`Connection failed: ${p.message}`)}},v=()=>{t.disconnect()};return Ut(async()=>{try{const p={};a.value&&a.value.trim()&&(p.networkName=a.value.trim()),await t.initMesh(p)}catch(p){console.error("Failed to initialize mesh:",p),alert(`Failed to initialize mesh: ${p.message}`)}}),(p,f)=>{const y=ho("router-link"),k=ho("router-view");return x(),R("div",mu,[s("header",bu,[s("div",hu,[s("div",yu,[f[8]||(f[8]=s("div",{class:"logo"},[s("span",{class:"logo-icon"},"๐ฆ"),s("h1",null,"PeerPigeon Vue 3 Demo")],-1)),s("div",wu,[s("div",{class:Se(["status-item",{connected:o.value,disconnected:!o.value}])},[f[2]||(f[2]=s("span",{class:"status-dot"},null,-1)),T(" "+E(o.value?"Connected":"Disconnected"),1)],2),a.value?(x(),R("div",Su,[f[3]||(f[3]=s("strong",null,"Network:",-1)),s("span",Du,E(a.value),1),He(t).isInFallbackMode?(x(),R("span",ku,"Fallback")):de("",!0)])):de("",!0),r.value?(x(),R("div",$u,[f[4]||(f[4]=s("strong",null,"ID:",-1)),T(" "+E(r.value.substring(0,8))+"... ",1)])):de("",!0),s("div",Cu,[f[5]||(f[5]=s("strong",null,"Peers:",-1)),T(" "+E(l.value.connectedCount)+"/"+E(l.value.maxPeers),1)])]),s("div",_u,[s("div",Eu,[f[6]||(f[6]=s("label",{for:"network-input"},"Network:",-1)),ae(s("input",{id:"network-input","onUpdate:modelValue":f[0]||(f[0]=N=>a.value=N),placeholder:"global",class:"network-input",disabled:o.value,title:"Network name (e.g., 'gaming', 'work', 'family')"},null,8,Tu),[[ke,a.value]])]),s("div",xu,[f[7]||(f[7]=s("label",{for:"url-input"},"Signaling Server:",-1)),ae(s("input",{id:"url-input","onUpdate:modelValue":f[1]||(f[1]=N=>i.value=N),placeholder:"ws://localhost:3000",class:"url-input",disabled:o.value},null,8,Ru),[[ke,i.value]])]),o.value?(x(),R("button",{key:1,onClick:v,class:"btn btn-secondary"}," Disconnect ")):(x(),R("button",{key:0,onClick:d,disabled:!n.value,class:"btn btn-primary"},E(n.value?"Connect":"Initializing..."),9,Lu))])])])]),s("nav",Pu,[s("div",Au,[s("div",Mu,[Ie(y,{to:"/network",class:"tab"},{default:bt(()=>[...f[9]||(f[9]=[s("span",{class:"tab-icon"},"๐",-1),T(" Network ",-1)])]),_:1}),Ie(y,{to:"/messaging",class:"tab"},{default:bt(()=>[...f[10]||(f[10]=[s("span",{class:"tab-icon"},"๐ฌ",-1),T(" Messaging ",-1)])]),_:1}),Ie(y,{to:"/media",class:"tab"},{default:bt(()=>[...f[11]||(f[11]=[s("span",{class:"tab-icon"},"๐ฅ",-1),T(" Media ",-1)])]),_:1}),Ie(y,{to:"/dht",class:"tab"},{default:bt(()=>[...f[12]||(f[12]=[s("span",{class:"tab-icon"},"๐๏ธ",-1),T(" DHT ",-1)])]),_:1}),Ie(y,{to:"/storage",class:"tab"},{default:bt(()=>[...f[13]||(f[13]=[s("span",{class:"tab-icon"},"๐ฆ",-1),T(" Storage ",-1)])]),_:1}),Ie(y,{to:"/crypto",class:"tab"},{default:bt(()=>[...f[14]||(f[14]=[s("span",{class:"tab-icon"},"๐",-1),T(" Crypto ",-1)])]),_:1}),Ie(y,{to:"/debug",class:"tab"},{default:bt(()=>[...f[15]||(f[15]=[s("span",{class:"tab-icon"},"๐",-1),T(" Debug ",-1)])]),_:1}),Ie(y,{to:"/testing",class:"tab"},{default:bt(()=>[...f[16]||(f[16]=[s("span",{class:"tab-icon"},"๐งช",-1),T(" Testing ",-1)])]),_:1})])])]),s("main",Iu,[s("div",Nu,[Ie(k)])])])}}},Vu=_t(Ou,[["__scopeId","data-v-6dc5b01c"]]);/*!
|
|
22
|
+
* vue-router v4.6.3
|
|
23
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
24
|
+
* @license MIT
|
|
25
|
+
*/const Yt=typeof document<"u";function ka(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function Uu(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&ka(e.default)}const _e=Object.assign;function Sn(e,t){const n={};for(const o in t){const i=t[o];n[o]=at(i)?i.map(e):e(i)}return n}const hs=()=>{},at=Array.isArray;function qo(e,t){const n={};for(const o in e)n[o]=o in t?t[o]:e[o];return n}const $a=/#/g,Fu=/&/g,Ku=/\//g,Hu=/=/g,Bu=/\?/g,Ca=/\+/g,ju=/%5B/g,Gu=/%5D/g,_a=/%5E/g,zu=/%60/g,Ea=/%7B/g,Wu=/%7C/g,Ta=/%7D/g,Ju=/%20/g;function io(e){return e==null?"":encodeURI(""+e).replace(Wu,"|").replace(ju,"[").replace(Gu,"]")}function qu(e){return io(e).replace(Ea,"{").replace(Ta,"}").replace(_a,"^")}function On(e){return io(e).replace(Ca,"%2B").replace(Ju,"+").replace($a,"%23").replace(Fu,"%26").replace(zu,"`").replace(Ea,"{").replace(Ta,"}").replace(_a,"^")}function Yu(e){return On(e).replace(Hu,"%3D")}function Qu(e){return io(e).replace($a,"%23").replace(Bu,"%3F")}function Xu(e){return Qu(e).replace(Ku,"%2F")}function _s(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const Zu=/\/$/,ec=e=>e.replace(Zu,"");function Dn(e,t,n="/"){let o,i={},a="",r="";const l=t.indexOf("#");let d=t.indexOf("?");return d=l>=0&&d>l?-1:d,d>=0&&(o=t.slice(0,d),a=t.slice(d,l>0?l:t.length),i=e(a.slice(1))),l>=0&&(o=o||t.slice(0,l),r=t.slice(l,t.length)),o=oc(o??t,n),{fullPath:o+a+r,path:o,query:i,hash:_s(r)}}function tc(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function Yo(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function sc(e,t,n){const o=t.matched.length-1,i=n.matched.length-1;return o>-1&&o===i&&ss(t.matched[o],n.matched[i])&&xa(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function ss(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function xa(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(!nc(e[n],t[n]))return!1;return!0}function nc(e,t){return at(e)?Qo(e,t):at(t)?Qo(t,e):e===t}function Qo(e,t){return at(t)?e.length===t.length&&e.every((n,o)=>n===t[o]):e.length===1&&e[0]===t}function oc(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),o=e.split("/"),i=o[o.length-1];(i===".."||i===".")&&o.push("");let a=n.length-1,r,l;for(r=0;r<o.length;r++)if(l=o[r],l!==".")if(l==="..")a>1&&a--;else break;return n.slice(0,a).join("/")+"/"+o.slice(r).join("/")}const Et={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let Vn=function(e){return e.pop="pop",e.push="push",e}({}),kn=function(e){return e.back="back",e.forward="forward",e.unknown="",e}({});function ic(e){if(!e)if(Yt){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^\/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),ec(e)}const ac=/^[^#]+#/;function rc(e,t){return e.replace(ac,"#")+t}function lc(e,t){const n=document.documentElement.getBoundingClientRect(),o=e.getBoundingClientRect();return{behavior:t.behavior,left:o.left-n.left-(t.left||0),top:o.top-n.top-(t.top||0)}}const un=()=>({left:window.scrollX,top:window.scrollY});function uc(e){let t;if("el"in e){const n=e.el,o=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?o?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=lc(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function Xo(e,t){return(history.state?history.state.position-t:-1)+e}const Un=new Map;function cc(e,t){Un.set(e,t)}function dc(e){const t=Un.get(e);return Un.delete(e),t}function fc(e){return typeof e=="string"||e&&typeof e=="object"}function Ra(e){return typeof e=="string"||typeof e=="symbol"}let Ne=function(e){return e[e.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",e[e.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",e[e.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",e[e.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",e[e.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",e}({});const La=Symbol("");Ne.MATCHER_NOT_FOUND+"",Ne.NAVIGATION_GUARD_REDIRECT+"",Ne.NAVIGATION_ABORTED+"",Ne.NAVIGATION_CANCELLED+"",Ne.NAVIGATION_DUPLICATED+"";function ns(e,t){return _e(new Error,{type:e,[La]:!0},t)}function mt(e,t){return e instanceof Error&&La in e&&(t==null||!!(e.type&t))}const pc=["params","query","hash"];function gc(e){if(typeof e=="string")return e;if(e.path!=null)return e.path;const t={};for(const n of pc)n in e&&(t[n]=e[n]);return JSON.stringify(t,null,2)}function vc(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let o=0;o<n.length;++o){const i=n[o].replace(Ca," "),a=i.indexOf("="),r=_s(a<0?i:i.slice(0,a)),l=a<0?null:_s(i.slice(a+1));if(r in t){let d=t[r];at(d)||(d=t[r]=[d]),d.push(l)}else t[r]=l}return t}function Zo(e){let t="";for(let n in e){const o=e[n];if(n=Yu(n),o==null){o!==void 0&&(t+=(t.length?"&":"")+n);continue}(at(o)?o.map(i=>i&&On(i)):[o&&On(o)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function mc(e){const t={};for(const n in e){const o=e[n];o!==void 0&&(t[n]=at(o)?o.map(i=>i==null?null:""+i):o==null?o:""+o)}return t}const bc=Symbol(""),ei=Symbol(""),ao=Symbol(""),Pa=Symbol(""),Fn=Symbol("");function ls(){let e=[];function t(o){return e.push(o),()=>{const i=e.indexOf(o);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Lt(e,t,n,o,i,a=r=>r()){const r=o&&(o.enterCallbacks[i]=o.enterCallbacks[i]||[]);return()=>new Promise((l,d)=>{const v=y=>{y===!1?d(ns(Ne.NAVIGATION_ABORTED,{from:n,to:t})):y instanceof Error?d(y):fc(y)?d(ns(Ne.NAVIGATION_GUARD_REDIRECT,{from:t,to:y})):(r&&o.enterCallbacks[i]===r&&typeof y=="function"&&r.push(y),l())},p=a(()=>e.call(o&&o.instances[i],t,n,v));let f=Promise.resolve(p);e.length<3&&(f=f.then(v)),f.catch(y=>d(y))})}function $n(e,t,n,o,i=a=>a()){const a=[];for(const r of e)for(const l in r.components){let d=r.components[l];if(!(t!=="beforeRouteEnter"&&!r.instances[l]))if(ka(d)){const v=(d.__vccOpts||d)[t];v&&a.push(Lt(v,n,o,r,l,i))}else{let v=d();a.push(()=>v.then(p=>{if(!p)throw new Error(`Couldn't resolve component "${l}" at "${r.path}"`);const f=Uu(p)?p.default:p;r.mods[l]=p,r.components[l]=f;const y=(f.__vccOpts||f)[t];return y&&Lt(y,n,o,r,l,i)()}))}}return a}function hc(e,t){const n=[],o=[],i=[],a=Math.max(t.matched.length,e.matched.length);for(let r=0;r<a;r++){const l=t.matched[r];l&&(e.matched.find(v=>ss(v,l))?o.push(l):n.push(l));const d=e.matched[r];d&&(t.matched.find(v=>ss(v,d))||i.push(d))}return[n,o,i]}/*!
|
|
26
|
+
* vue-router v4.6.3
|
|
27
|
+
* (c) 2025 Eduardo San Martin Morote
|
|
28
|
+
* @license MIT
|
|
29
|
+
*/let yc=()=>location.protocol+"//"+location.host;function Aa(e,t){const{pathname:n,search:o,hash:i}=t,a=e.indexOf("#");if(a>-1){let r=i.includes(e.slice(a))?e.slice(a).length:1,l=i.slice(r);return l[0]!=="/"&&(l="/"+l),Yo(l,"")}return Yo(n,e)+o+i}function wc(e,t,n,o){let i=[],a=[],r=null;const l=({state:y})=>{const k=Aa(e,location),N=n.value,A=t.value;let oe=0;if(y){if(n.value=k,t.value=y,r&&r===N){r=null;return}oe=A?y.position-A.position:0}else o(k);i.forEach(Y=>{Y(n.value,N,{delta:oe,type:Vn.pop,direction:oe?oe>0?kn.forward:kn.back:kn.unknown})})};function d(){r=n.value}function v(y){i.push(y);const k=()=>{const N=i.indexOf(y);N>-1&&i.splice(N,1)};return a.push(k),k}function p(){if(document.visibilityState==="hidden"){const{history:y}=window;if(!y.state)return;y.replaceState(_e({},y.state,{scroll:un()}),"")}}function f(){for(const y of a)y();a=[],window.removeEventListener("popstate",l),window.removeEventListener("pagehide",p),document.removeEventListener("visibilitychange",p)}return window.addEventListener("popstate",l),window.addEventListener("pagehide",p),document.addEventListener("visibilitychange",p),{pauseListeners:d,listen:v,destroy:f}}function ti(e,t,n,o=!1,i=!1){return{back:e,current:t,forward:n,replaced:o,position:window.history.length,scroll:i?un():null}}function Sc(e){const{history:t,location:n}=window,o={value:Aa(e,n)},i={value:t.state};i.value||a(o.value,{back:null,current:o.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function a(d,v,p){const f=e.indexOf("#"),y=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+d:yc()+e+d;try{t[p?"replaceState":"pushState"](v,"",y),i.value=v}catch(k){console.error(k),n[p?"replace":"assign"](y)}}function r(d,v){a(d,_e({},t.state,ti(i.value.back,d,i.value.forward,!0),v,{position:i.value.position}),!0),o.value=d}function l(d,v){const p=_e({},i.value,t.state,{forward:d,scroll:un()});a(p.current,p,!0),a(d,_e({},ti(o.value,d,null),{position:p.position+1},v),!1),o.value=d}return{location:o,state:i,push:l,replace:r}}function Dc(e){e=ic(e);const t=Sc(e),n=wc(e,t.state,t.location,t.replace);function o(a,r=!0){r||n.pauseListeners(),history.go(a)}const i=_e({location:"",base:e,go:o,createHref:rc.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}let Bt=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.Group=2]="Group",e}({});var Fe=function(e){return e[e.Static=0]="Static",e[e.Param=1]="Param",e[e.ParamRegExp=2]="ParamRegExp",e[e.ParamRegExpEnd=3]="ParamRegExpEnd",e[e.EscapeNext=4]="EscapeNext",e}(Fe||{});const kc={type:Bt.Static,value:""},$c=/[a-zA-Z0-9_]/;function Cc(e){if(!e)return[[]];if(e==="/")return[[kc]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(k){throw new Error(`ERR (${n})/"${v}": ${k}`)}let n=Fe.Static,o=n;const i=[];let a;function r(){a&&i.push(a),a=[]}let l=0,d,v="",p="";function f(){v&&(n===Fe.Static?a.push({type:Bt.Static,value:v}):n===Fe.Param||n===Fe.ParamRegExp||n===Fe.ParamRegExpEnd?(a.length>1&&(d==="*"||d==="+")&&t(`A repeatable param (${v}) must be alone in its segment. eg: '/:ids+.`),a.push({type:Bt.Param,value:v,regexp:p,repeatable:d==="*"||d==="+",optional:d==="*"||d==="?"})):t("Invalid state to consume buffer"),v="")}function y(){v+=d}for(;l<e.length;){if(d=e[l++],d==="\\"&&n!==Fe.ParamRegExp){o=n,n=Fe.EscapeNext;continue}switch(n){case Fe.Static:d==="/"?(v&&f(),r()):d===":"?(f(),n=Fe.Param):y();break;case Fe.EscapeNext:y(),n=o;break;case Fe.Param:d==="("?n=Fe.ParamRegExp:$c.test(d)?y():(f(),n=Fe.Static,d!=="*"&&d!=="?"&&d!=="+"&&l--);break;case Fe.ParamRegExp:d===")"?p[p.length-1]=="\\"?p=p.slice(0,-1)+d:n=Fe.ParamRegExpEnd:p+=d;break;case Fe.ParamRegExpEnd:f(),n=Fe.Static,d!=="*"&&d!=="?"&&d!=="+"&&l--,p="";break;default:t("Unknown state");break}}return n===Fe.ParamRegExp&&t(`Unfinished custom RegExp for param "${v}"`),f(),r(),i}const si="[^/]+?",_c={sensitive:!1,strict:!1,start:!0,end:!0};var Ye=function(e){return e[e._multiplier=10]="_multiplier",e[e.Root=90]="Root",e[e.Segment=40]="Segment",e[e.SubSegment=30]="SubSegment",e[e.Static=40]="Static",e[e.Dynamic=20]="Dynamic",e[e.BonusCustomRegExp=10]="BonusCustomRegExp",e[e.BonusWildcard=-50]="BonusWildcard",e[e.BonusRepeatable=-20]="BonusRepeatable",e[e.BonusOptional=-8]="BonusOptional",e[e.BonusStrict=.7000000000000001]="BonusStrict",e[e.BonusCaseSensitive=.25]="BonusCaseSensitive",e}(Ye||{});const Ec=/[.+*?^${}()[\]/\\]/g;function Tc(e,t){const n=_e({},_c,t),o=[];let i=n.start?"^":"";const a=[];for(const v of e){const p=v.length?[]:[Ye.Root];n.strict&&!v.length&&(i+="/");for(let f=0;f<v.length;f++){const y=v[f];let k=Ye.Segment+(n.sensitive?Ye.BonusCaseSensitive:0);if(y.type===Bt.Static)f||(i+="/"),i+=y.value.replace(Ec,"\\$&"),k+=Ye.Static;else if(y.type===Bt.Param){const{value:N,repeatable:A,optional:oe,regexp:Y}=y;a.push({name:N,repeatable:A,optional:oe});const G=Y||si;if(G!==si){k+=Ye.BonusCustomRegExp;try{`${G}`}catch(X){throw new Error(`Invalid custom RegExp for param "${N}" (${G}): `+X.message)}}let J=A?`((?:${G})(?:/(?:${G}))*)`:`(${G})`;f||(J=oe&&v.length<2?`(?:/${J})`:"/"+J),oe&&(J+="?"),i+=J,k+=Ye.Dynamic,oe&&(k+=Ye.BonusOptional),A&&(k+=Ye.BonusRepeatable),G===".*"&&(k+=Ye.BonusWildcard)}p.push(k)}o.push(p)}if(n.strict&&n.end){const v=o.length-1;o[v][o[v].length-1]+=Ye.BonusStrict}n.strict||(i+="/?"),n.end?i+="$":n.strict&&!i.endsWith("/")&&(i+="(?:/|$)");const r=new RegExp(i,n.sensitive?"":"i");function l(v){const p=v.match(r),f={};if(!p)return null;for(let y=1;y<p.length;y++){const k=p[y]||"",N=a[y-1];f[N.name]=k&&N.repeatable?k.split("/"):k}return f}function d(v){let p="",f=!1;for(const y of e){(!f||!p.endsWith("/"))&&(p+="/"),f=!1;for(const k of y)if(k.type===Bt.Static)p+=k.value;else if(k.type===Bt.Param){const{value:N,repeatable:A,optional:oe}=k,Y=N in v?v[N]:"";if(at(Y)&&!A)throw new Error(`Provided param "${N}" is an array but it is not repeatable (* or + modifiers)`);const G=at(Y)?Y.join("/"):Y;if(!G)if(oe)y.length<2&&(p.endsWith("/")?p=p.slice(0,-1):f=!0);else throw new Error(`Missing required param "${N}"`);p+=G}}return p||"/"}return{re:r,score:o,keys:a,parse:l,stringify:d}}function xc(e,t){let n=0;for(;n<e.length&&n<t.length;){const o=t[n]-e[n];if(o)return o;n++}return e.length<t.length?e.length===1&&e[0]===Ye.Static+Ye.Segment?-1:1:e.length>t.length?t.length===1&&t[0]===Ye.Static+Ye.Segment?1:-1:0}function Ma(e,t){let n=0;const o=e.score,i=t.score;for(;n<o.length&&n<i.length;){const a=xc(o[n],i[n]);if(a)return a;n++}if(Math.abs(i.length-o.length)===1){if(ni(o))return 1;if(ni(i))return-1}return i.length-o.length}function ni(e){const t=e[e.length-1];return e.length>0&&t[t.length-1]<0}const Rc={strict:!1,end:!0,sensitive:!1};function Lc(e,t,n){const o=Tc(Cc(e.path),n),i=_e(o,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Pc(e,t){const n=[],o=new Map;t=qo(Rc,t);function i(f){return o.get(f)}function a(f,y,k){const N=!k,A=ii(f);A.aliasOf=k&&k.record;const oe=qo(t,f),Y=[A];if("alias"in f){const X=typeof f.alias=="string"?[f.alias]:f.alias;for(const ue of X)Y.push(ii(_e({},A,{components:k?k.record.components:A.components,path:ue,aliasOf:k?k.record:A})))}let G,J;for(const X of Y){const{path:ue}=X;if(y&&ue[0]!=="/"){const be=y.record.path,fe=be[be.length-1]==="/"?"":"/";X.path=y.record.path+(ue&&fe+ue)}if(G=Lc(X,y,oe),k?k.alias.push(G):(J=J||G,J!==G&&J.alias.push(G),N&&f.name&&!ai(G)&&r(f.name)),Ia(G)&&d(G),A.children){const be=A.children;for(let fe=0;fe<be.length;fe++)a(be[fe],G,k&&k.children[fe])}k=k||G}return J?()=>{r(J)}:hs}function r(f){if(Ra(f)){const y=o.get(f);y&&(o.delete(f),n.splice(n.indexOf(y),1),y.children.forEach(r),y.alias.forEach(r))}else{const y=n.indexOf(f);y>-1&&(n.splice(y,1),f.record.name&&o.delete(f.record.name),f.children.forEach(r),f.alias.forEach(r))}}function l(){return n}function d(f){const y=Ic(f,n);n.splice(y,0,f),f.record.name&&!ai(f)&&o.set(f.record.name,f)}function v(f,y){let k,N={},A,oe;if("name"in f&&f.name){if(k=o.get(f.name),!k)throw ns(Ne.MATCHER_NOT_FOUND,{location:f});oe=k.record.name,N=_e(oi(y.params,k.keys.filter(J=>!J.optional).concat(k.parent?k.parent.keys.filter(J=>J.optional):[]).map(J=>J.name)),f.params&&oi(f.params,k.keys.map(J=>J.name))),A=k.stringify(N)}else if(f.path!=null)A=f.path,k=n.find(J=>J.re.test(A)),k&&(N=k.parse(A),oe=k.record.name);else{if(k=y.name?o.get(y.name):n.find(J=>J.re.test(y.path)),!k)throw ns(Ne.MATCHER_NOT_FOUND,{location:f,currentLocation:y});oe=k.record.name,N=_e({},y.params,f.params),A=k.stringify(N)}const Y=[];let G=k;for(;G;)Y.unshift(G.record),G=G.parent;return{name:oe,path:A,params:N,matched:Y,meta:Mc(Y)}}e.forEach(f=>a(f));function p(){n.length=0,o.clear()}return{addRoute:a,resolve:v,removeRoute:r,clearRoutes:p,getRoutes:l,getRecordMatcher:i}}function oi(e,t){const n={};for(const o of t)o in e&&(n[o]=e[o]);return n}function ii(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:Ac(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function Ac(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const o in e.components)t[o]=typeof n=="object"?n[o]:n;return t}function ai(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function Mc(e){return e.reduce((t,n)=>_e(t,n.meta),{})}function Ic(e,t){let n=0,o=t.length;for(;n!==o;){const a=n+o>>1;Ma(e,t[a])<0?o=a:n=a+1}const i=Nc(e);return i&&(o=t.lastIndexOf(i,o-1)),o}function Nc(e){let t=e;for(;t=t.parent;)if(Ia(t)&&Ma(e,t)===0)return t}function Ia({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function ri(e){const t=ft(ao),n=ft(Pa),o=ce(()=>{const d=He(e.to);return t.resolve(d)}),i=ce(()=>{const{matched:d}=o.value,{length:v}=d,p=d[v-1],f=n.matched;if(!p||!f.length)return-1;const y=f.findIndex(ss.bind(null,p));if(y>-1)return y;const k=li(d[v-2]);return v>1&&li(p)===k&&f[f.length-1].path!==k?f.findIndex(ss.bind(null,d[v-2])):y}),a=ce(()=>i.value>-1&&Kc(n.params,o.value.params)),r=ce(()=>i.value>-1&&i.value===n.matched.length-1&&xa(n.params,o.value.params));function l(d={}){if(Fc(d)){const v=t[He(e.replace)?"replace":"push"](He(e.to)).catch(hs);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>v),v}return Promise.resolve()}return{route:o,href:ce(()=>o.value.href),isActive:a,isExactActive:r,navigate:l}}function Oc(e){return e.length===1?e[0]:e}const Vc=ji({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:ri,setup(e,{slots:t}){const n=qe(ri(e)),{options:o}=ft(ao),i=ce(()=>({[ui(e.activeClass,o.linkActiveClass,"router-link-active")]:n.isActive,[ui(e.exactActiveClass,o.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const a=t.default&&Oc(t.default(n));return e.custom?a:ma("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},a)}}}),Uc=Vc;function Fc(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function Kc(e,t){for(const n in t){const o=t[n],i=e[n];if(typeof o=="string"){if(o!==i)return!1}else if(!at(i)||i.length!==o.length||o.some((a,r)=>a!==i[r]))return!1}return!0}function li(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ui=(e,t,n)=>e??t??n,Hc=ji({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const o=ft(Fn),i=ce(()=>e.route||o.value),a=ft(ei,0),r=ce(()=>{let v=He(a);const{matched:p}=i.value;let f;for(;(f=p[v])&&!f.components;)v++;return v}),l=ce(()=>i.value.matched[r.value]);Ns(ei,ce(()=>r.value+1)),Ns(bc,l),Ns(Fn,i);const d=K();return It(()=>[d.value,l.value,e.name],([v,p,f],[y,k,N])=>{p&&(p.instances[f]=v,k&&k!==p&&v&&v===y&&(p.leaveGuards.size||(p.leaveGuards=k.leaveGuards),p.updateGuards.size||(p.updateGuards=k.updateGuards))),v&&p&&(!k||!ss(p,k)||!y)&&(p.enterCallbacks[f]||[]).forEach(A=>A(v))},{flush:"post"}),()=>{const v=i.value,p=e.name,f=l.value,y=f&&f.components[p];if(!y)return ci(n.default,{Component:y,route:v});const k=f.props[p],N=k?k===!0?v.params:typeof k=="function"?k(v):k:null,oe=ma(y,_e({},N,t,{onVnodeUnmounted:Y=>{Y.component.isUnmounted&&(f.instances[p]=null)},ref:d}));return ci(n.default,{Component:oe,route:v})||oe}}});function ci(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const Bc=Hc;function jc(e){const t=Pc(e.routes,e),n=e.parseQuery||vc,o=e.stringifyQuery||Zo,i=e.history,a=ls(),r=ls(),l=ls(),d=pr(Et);let v=Et;Yt&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const p=Sn.bind(null,c=>""+c),f=Sn.bind(null,Xu),y=Sn.bind(null,_s);function k(c,P){let B,te;return Ra(c)?(B=t.getRecordMatcher(c),te=P):te=c,t.addRoute(te,B)}function N(c){const P=t.getRecordMatcher(c);P&&t.removeRoute(P)}function A(){return t.getRoutes().map(c=>c.record)}function oe(c){return!!t.getRecordMatcher(c)}function Y(c,P){if(P=_e({},P||d.value),typeof c=="string"){const C=Dn(n,c,P.path),U=t.resolve({path:C.path},P),H=i.createHref(C.fullPath);return _e(C,U,{params:y(U.params),hash:_s(C.hash),redirectedFrom:void 0,href:H})}let B;if(c.path!=null)B=_e({},c,{path:Dn(n,c.path,P.path).path});else{const C=_e({},c.params);for(const U in C)C[U]==null&&delete C[U];B=_e({},c,{params:f(C)}),P.params=f(P.params)}const te=t.resolve(B,P),pe=c.hash||"";te.params=p(y(te.params));const m=tc(o,_e({},c,{hash:qu(pe),path:te.path})),b=i.createHref(m);return _e({fullPath:m,hash:pe,query:o===Zo?mc(c.query):c.query||{}},te,{redirectedFrom:void 0,href:b})}function G(c){return typeof c=="string"?Dn(n,c,d.value.path):_e({},c)}function J(c,P){if(v!==c)return ns(Ne.NAVIGATION_CANCELLED,{from:P,to:c})}function X(c){return fe(c)}function ue(c){return X(_e(G(c),{replace:!0}))}function be(c,P){const B=c.matched[c.matched.length-1];if(B&&B.redirect){const{redirect:te}=B;let pe=typeof te=="function"?te(c,P):te;return typeof pe=="string"&&(pe=pe.includes("?")||pe.includes("#")?pe=G(pe):{path:pe},pe.params={}),_e({query:c.query,hash:c.hash,params:pe.path!=null?{}:c.params},pe)}}function fe(c,P){const B=v=Y(c),te=d.value,pe=c.state,m=c.force,b=c.replace===!0,C=be(B,te);if(C)return fe(_e(G(C),{state:typeof C=="object"?_e({},pe,C.state):pe,force:m,replace:b}),P||B);const U=B;U.redirectedFrom=P;let H;return!m&&sc(o,te,B)&&(H=ns(Ne.NAVIGATION_DUPLICATED,{to:U,from:te}),Me(te,te,!0,!1)),(H?Promise.resolve(H):ee(U,te)).catch(F=>mt(F)?mt(F,Ne.NAVIGATION_GUARD_REDIRECT)?F:De(F):ve(F,U,te)).then(F=>{if(F){if(mt(F,Ne.NAVIGATION_GUARD_REDIRECT))return fe(_e({replace:b},G(F.to),{state:typeof F.to=="object"?_e({},pe,F.to.state):pe,force:m}),P||U)}else F=z(U,te,!0,b,pe);return q(U,te,F),F})}function Q(c,P){const B=J(c,P);return B?Promise.reject(B):Promise.resolve()}function O(c){const P=D.values().next().value;return P&&typeof P.runWithContext=="function"?P.runWithContext(c):c()}function ee(c,P){let B;const[te,pe,m]=hc(c,P);B=$n(te.reverse(),"beforeRouteLeave",c,P);for(const C of te)C.leaveGuards.forEach(U=>{B.push(Lt(U,c,P))});const b=Q.bind(null,c,P);return B.push(b),L(B).then(()=>{B=[];for(const C of a.list())B.push(Lt(C,c,P));return B.push(b),L(B)}).then(()=>{B=$n(pe,"beforeRouteUpdate",c,P);for(const C of pe)C.updateGuards.forEach(U=>{B.push(Lt(U,c,P))});return B.push(b),L(B)}).then(()=>{B=[];for(const C of m)if(C.beforeEnter)if(at(C.beforeEnter))for(const U of C.beforeEnter)B.push(Lt(U,c,P));else B.push(Lt(C.beforeEnter,c,P));return B.push(b),L(B)}).then(()=>(c.matched.forEach(C=>C.enterCallbacks={}),B=$n(m,"beforeRouteEnter",c,P,O),B.push(b),L(B))).then(()=>{B=[];for(const C of r.list())B.push(Lt(C,c,P));return B.push(b),L(B)}).catch(C=>mt(C,Ne.NAVIGATION_CANCELLED)?C:Promise.reject(C))}function q(c,P,B){l.list().forEach(te=>O(()=>te(c,P,B)))}function z(c,P,B,te,pe){const m=J(c,P);if(m)return m;const b=P===Et,C=Yt?history.state:{};B&&(te||b?i.replace(c.fullPath,_e({scroll:b&&C&&C.scroll},pe)):i.push(c.fullPath,pe)),d.value=c,Me(c,P,B,b),De()}let le;function he(){le||(le=i.listen((c,P,B)=>{if(!h.listening)return;const te=Y(c),pe=be(te,h.currentRoute.value);if(pe){fe(_e(pe,{replace:!0,force:!0}),te).catch(hs);return}v=te;const m=d.value;Yt&&cc(Xo(m.fullPath,B.delta),un()),ee(te,m).catch(b=>mt(b,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_CANCELLED)?b:mt(b,Ne.NAVIGATION_GUARD_REDIRECT)?(fe(_e(G(b.to),{force:!0}),te).then(C=>{mt(C,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_DUPLICATED)&&!B.delta&&B.type===Vn.pop&&i.go(-1,!1)}).catch(hs),Promise.reject()):(B.delta&&i.go(-B.delta,!1),ve(b,te,m))).then(b=>{b=b||z(te,m,!1),b&&(B.delta&&!mt(b,Ne.NAVIGATION_CANCELLED)?i.go(-B.delta,!1):B.type===Vn.pop&&mt(b,Ne.NAVIGATION_ABORTED|Ne.NAVIGATION_DUPLICATED)&&i.go(-1,!1)),q(te,m,b)}).catch(hs)}))}let M=ls(),V=ls(),j;function ve(c,P,B){De(c);const te=V.list();return te.length?te.forEach(pe=>pe(c,P,B)):console.error(c),Promise.reject(c)}function we(){return j&&d.value!==Et?Promise.resolve():new Promise((c,P)=>{M.add([c,P])})}function De(c){return j||(j=!c,he(),M.list().forEach(([P,B])=>c?B(c):P()),M.reset()),c}function Me(c,P,B,te){const{scrollBehavior:pe}=e;if(!Yt||!pe)return Promise.resolve();const m=!B&&dc(Xo(c.fullPath,0))||(te||!B)&&history.state&&history.state.scroll||null;return zt().then(()=>pe(c,P,m)).then(b=>b&&uc(b)).catch(b=>ve(b,c,P))}const Te=c=>i.go(c);let re;const D=new Set,h={currentRoute:d,listening:!0,addRoute:k,removeRoute:N,clearRoutes:t.clearRoutes,hasRoute:oe,getRoutes:A,resolve:Y,options:e,push:X,replace:ue,go:Te,back:()=>Te(-1),forward:()=>Te(1),beforeEach:a.add,beforeResolve:r.add,afterEach:l.add,onError:V.add,isReady:we,install(c){c.component("RouterLink",Uc),c.component("RouterView",Bc),c.config.globalProperties.$router=h,Object.defineProperty(c.config.globalProperties,"$route",{enumerable:!0,get:()=>He(d)}),Yt&&!re&&d.value===Et&&(re=!0,X(i.location).catch(te=>{}));const P={};for(const te in Et)Object.defineProperty(P,te,{get:()=>d.value[te],enumerable:!0});c.provide(ao,h),c.provide(Pa,Ni(P)),c.provide(Fn,d);const B=c.unmount;D.add(c),c.unmount=function(){D.delete(c),D.size<1&&(v=Et,le&&le(),le=null,d.value=Et,re=!1,j=!1),B()}}};function L(c){return c.reduce((P,B)=>P.then(()=>O(B)),Promise.resolve())}return h}const Gc={class:"network-view"},zc={class:"namespace-section"},Wc={class:"namespace-info"},Jc={class:"current-network"},qc={class:"network-badge"},Yc={class:"network-name"},Qc={key:0,class:"fallback-indicator"},Xc={key:0,class:"original-network"},Zc={class:"namespace-controls"},ed={class:"network-switch"},td=["disabled"],sd=["disabled"],nd={class:"quick-networks"},od=["onClick","disabled"],id={class:"fallback-setting"},ad={class:"checkbox-label"},rd={class:"status-grid"},ld={class:"status-card"},ud={class:"status-card-content"},cd={class:"status-value"},dd={class:"status-meta"},fd={class:"status-card"},pd={class:"status-card-content"},gd={class:"status-value"},vd={class:"status-card"},md={class:"status-card-content"},bd={class:"status-value"},hd={class:"status-card"},yd={class:"status-card-content"},wd={class:"status-value"},Sd={class:"config-section"},Dd={class:"config-grid"},kd={class:"config-item"},$d={class:"config-item"},Cd=["max"],_d={class:"config-item"},Ed={class:"config-item"},Td={class:"peers-section"},xd={class:"section-title"},Rd={class:"peers-list"},Ld={key:0,class:"empty-state"},Pd={class:"peer-header"},Ad={class:"peer-id"},Md={class:"peer-details"},Id={class:"peer-detail"},Nd={key:0,class:"peer-detail"},Od={key:1,class:"peer-detail"},Vd={class:"peer-actions"},Ud=["onClick","disabled"],Fd=["onClick","disabled"],Kd={key:0,class:"peers-section"},Hd={class:"peers-list"},Bd={class:"peer-header"},jd={class:"peer-id"},Gd={class:"peer-details"},zd={class:"peer-detail"},Wd={class:"peer-actions"},Jd=["onClick","disabled"],qd={class:"stats-section"},Yd={class:"stats-grid"},Qd={class:"stat-item"},Xd={class:"stat-item"},Zd={class:"stat-item"},ef={class:"stat-item"},tf={__name:"NetworkView",setup(e){const t=Ct(),n=K(3),o=K(2),i=K(null),a=K(null),r=K("00:00:00"),l=K(""),d=["global","gaming","work","family","test"],v=ce(()=>t.networkStatus);ce(()=>t.peers);const p=ce(()=>t.discoveredPeers),f=ce(()=>t.connectedPeersList),y=ce(()=>t.canAcceptMorePeers),k=ce(()=>t.peerId),N=ce(()=>t.isConnected),A=()=>{l.value.trim()&&(t.setNetworkName(l.value.trim()),t.addDebugLog(`Network set to: ${l.value.trim()}`,"success"),l.value="")},oe=M=>{t.setNetworkName(M),t.addDebugLog(`Quick switch to network: ${M}`,"success")},Y=()=>{t.setAllowGlobalFallback(t.allowGlobalFallback)},G=()=>{t.mesh&&(t.mesh.setMaxPeers(n.value),t.addDebugLog(`Max peers updated to ${n.value}`))},J=()=>{t.mesh&&(t.mesh.setMinPeers(o.value),t.addDebugLog(`Min peers updated to ${o.value}`))},X=()=>{if(t.mesh){const M=!v.value.autoDiscovery;t.mesh.setAutoDiscovery(M),t.addDebugLog(`Auto discovery ${M?"enabled":"disabled"}`)}},ue=()=>{if(t.mesh){const M=!v.value.evictionStrategy;t.mesh.setEvictionStrategy(M),t.addDebugLog(`Eviction strategy ${M?"enabled":"disabled"}`)}},be=()=>{t.addDebugLog("Peer list refreshed")},fe=M=>{t.sendDirectMessage(M,{type:"ping",timestamp:Date.now()}),t.addDebugLog(`Ping sent to ${M.substring(0,8)}...`)},Q=M=>{t.mesh&&t.addDebugLog(`Disconnect requested for ${M.substring(0,8)}...`)},O=M=>{t.mesh&&(t.mesh.connectToPeer(M),t.addDebugLog(`Connection attempt to ${M.substring(0,8)}...`))},ee=M=>M?M.toLocaleTimeString():"Unknown",q=()=>{const M=v.value.connectedCount,V=v.value.minPeers,j=v.value.maxPeers;return M===0?"Isolated":M<V?"Poor":M>=V&&M<j?"Good":M===j?"Excellent":"Unknown"},z=()=>{const M=q();return{"health-isolated":M==="Isolated","health-poor":M==="Poor","health-good":M==="Good","health-excellent":M==="Excellent"}},le=()=>{if(t.mesh&&t.mesh.getEnvironmentReport){const M=t.mesh.getEnvironmentReport();return`${M.environment} (WebRTC: ${M.webrtcSupported?"Yes":"No"})`}return"Browser (WebRTC: Yes)"},he=()=>{if(i.value&&N.value){const V=new Date-i.value,j=Math.floor(V/36e5),ve=Math.floor(V%36e5/6e4),we=Math.floor(V%6e4/1e3);r.value=`${j.toString().padStart(2,"0")}:${ve.toString().padStart(2,"0")}:${we.toString().padStart(2,"0")}`}else r.value="00:00:00"};return ce(()=>N.value,M=>{M?i.value=new Date:i.value=null}),Ut(()=>{n.value=v.value.maxPeers,o.value=v.value.minPeers,a.value=setInterval(he,1e3)}),Rs(()=>{a.value&&clearInterval(a.value)}),(M,V)=>(x(),R("div",Gc,[V[35]||(V[35]=s("div",{class:"section-header"},[s("h2",null,"๐ Network Overview"),s("p",null,"Monitor mesh network topology, peer connections, and network health")],-1)),s("div",zc,[V[5]||(V[5]=s("h3",null,"Network Namespace",-1)),s("div",Wc,[s("div",Jc,[s("div",qc,[s("span",Yc,E(He(t).networkName),1),He(t).isInFallbackMode?(x(),R("span",Qc,"Fallback Mode")):de("",!0)]),He(t).isInFallbackMode?(x(),R("div",Xc," Original: "+E(He(t).originalNetworkName),1)):de("",!0)]),s("div",Zc,[s("div",ed,[ae(s("input",{"onUpdate:modelValue":V[0]||(V[0]=j=>l.value=j),type:"text",placeholder:"Enter network name (e.g., 'gaming', 'work')",class:"network-input",disabled:N.value},null,8,td),[[ke,l.value]]),s("button",{onClick:A,disabled:!l.value.trim()||N.value,class:"btn btn-primary btn-sm"}," Switch ",8,sd)]),s("div",nd,[(x(),R($e,null,Pe(d,j=>s("button",{key:j,onClick:ve=>oe(j),disabled:N.value||He(t).networkName===j,class:Se(["btn","btn-outline","btn-xs",{active:He(t).networkName===j}])},E(j),11,od)),64))]),s("div",id,[s("label",ad,[ae(s("input",{type:"checkbox","onUpdate:modelValue":V[1]||(V[1]=j=>He(t).allowGlobalFallback=j),onChange:Y},null,544),[[Ke,He(t).allowGlobalFallback]]),V[4]||(V[4]=T(" Allow global fallback ",-1))])])])])]),s("div",rd,[s("div",ld,[V[7]||(V[7]=s("div",{class:"status-card-icon"},"๐ฅ",-1)),s("div",ud,[V[6]||(V[6]=s("h3",null,"Connected Peers",-1)),s("div",cd,E(v.value.connectedCount)+"/"+E(v.value.maxPeers),1),s("div",dd,E(y.value?"Can accept more":"At capacity"),1)])]),s("div",fd,[V[10]||(V[10]=s("div",{class:"status-card-icon"},"๐",-1)),s("div",pd,[V[8]||(V[8]=s("h3",null,"Discovered Peers",-1)),s("div",gd,E(p.value.size),1),V[9]||(V[9]=s("div",{class:"status-meta"},"Available to connect",-1))])]),s("div",vd,[V[13]||(V[13]=s("div",{class:"status-card-icon"},"โ๏ธ",-1)),s("div",md,[V[11]||(V[11]=s("h3",null,"Auto Discovery",-1)),s("div",bd,E(v.value.autoDiscovery?"ON":"OFF"),1),V[12]||(V[12]=s("div",{class:"status-meta"},"Automatic peer discovery",-1))])]),s("div",hd,[V[16]||(V[16]=s("div",{class:"status-card-icon"},"๐",-1)),s("div",yd,[V[14]||(V[14]=s("h3",null,"XOR Routing",-1)),s("div",wd,E(v.value.xorRouting?"ON":"OFF"),1),V[15]||(V[15]=s("div",{class:"status-meta"},"Distance-based routing",-1))])])]),s("div",Sd,[V[21]||(V[21]=s("h3",null,"Network Configuration",-1)),s("div",Dd,[s("div",kd,[V[17]||(V[17]=s("label",null,"Max Peers",-1)),ae(s("input",{"onUpdate:modelValue":V[2]||(V[2]=j=>n.value=j),type:"number",min:"1",max:"50",onChange:G,class:"config-input"},null,544),[[ke,n.value,void 0,{number:!0}]])]),s("div",$d,[V[18]||(V[18]=s("label",null,"Min Peers",-1)),ae(s("input",{"onUpdate:modelValue":V[3]||(V[3]=j=>o.value=j),type:"number",min:"0",max:n.value-1,onChange:J,class:"config-input"},null,40,Cd),[[ke,o.value,void 0,{number:!0}]])]),s("div",_d,[V[19]||(V[19]=s("label",null,"Auto Discovery",-1)),s("button",{onClick:X,class:Se(["toggle-btn",{active:v.value.autoDiscovery}])},E(v.value.autoDiscovery?"ON":"OFF"),3)]),s("div",Ed,[V[20]||(V[20]=s("label",null,"Eviction Strategy",-1)),s("button",{onClick:ue,class:Se(["toggle-btn",{active:v.value.evictionStrategy}])},E(v.value.evictionStrategy?"ON":"OFF"),3)])])]),s("div",Td,[s("div",xd,[s("h3",null,"Connected Peers ("+E(f.value.length)+")",1),s("button",{onClick:be,class:"btn btn-secondary"},"Refresh")]),s("div",Rd,[f.value.length===0?(x(),R("div",Ld,[...V[22]||(V[22]=[s("div",{class:"empty-icon"},"๐",-1),s("p",null,"No peers connected yet",-1),s("p",{class:"empty-meta"},"Connect to the signaling server to discover peers",-1)])])):de("",!0),(x(!0),R($e,null,Pe(f.value,j=>(x(),R("div",{key:j.id,class:"peer-card"},[s("div",Pd,[s("div",Ad,[V[23]||(V[23]=s("span",{class:"peer-icon"},"๐ค",-1)),T(" "+E(j.id.substring(0,16))+"... ",1)]),s("div",{class:Se(["peer-status",j.status])},E(j.status),3)]),s("div",Md,[s("div",Id,[V[24]||(V[24]=s("strong",null,"Connected:",-1)),T(" "+E(ee(j.connectionTime)),1)]),j.disconnectionTime?(x(),R("div",Nd,[V[25]||(V[25]=s("strong",null,"Disconnected:",-1)),T(" "+E(ee(j.disconnectionTime)),1)])):de("",!0),j.disconnectionReason?(x(),R("div",Od,[V[26]||(V[26]=s("strong",null,"Reason:",-1)),T(" "+E(j.disconnectionReason),1)])):de("",!0)]),s("div",Vd,[s("button",{onClick:ve=>fe(j.id),class:"btn btn-sm btn-primary",disabled:!j.connected}," Ping ",8,Ud),s("button",{onClick:ve=>Q(j.id),class:"btn btn-sm btn-danger",disabled:!j.connected}," Disconnect ",8,Fd)])]))),128))])]),p.value.size>0?(x(),R("div",Kd,[s("h3",null,"Discovered Peers ("+E(p.value.size)+")",1),s("div",Hd,[(x(!0),R($e,null,Pe(Array.from(p.value.values()),j=>(x(),R("div",{key:j.id,class:"peer-card discovered"},[s("div",Bd,[s("div",jd,[V[27]||(V[27]=s("span",{class:"peer-icon"},"๐",-1)),T(" "+E(j.id.substring(0,16))+"... ",1)]),V[28]||(V[28]=s("div",{class:"peer-status discovered"}," discovered ",-1))]),s("div",Gd,[s("div",zd,[V[29]||(V[29]=s("strong",null,"Discovered:",-1)),T(" "+E(ee(j.discoveryTime)),1)])]),s("div",Wd,[s("button",{onClick:ve=>O(j.id),class:"btn btn-sm btn-primary",disabled:!y.value}," Connect ",8,Jd)])]))),128))])])):de("",!0),s("div",qd,[V[34]||(V[34]=s("h3",null,"Network Statistics",-1)),s("div",Yd,[s("div",Qd,[V[30]||(V[30]=s("strong",null,"Your Peer ID:",-1)),s("code",null,E(k.value),1)]),s("div",Xd,[V[31]||(V[31]=s("strong",null,"Network Health:",-1)),s("span",{class:Se(z())},E(q()),3)]),s("div",Zd,[V[32]||(V[32]=s("strong",null,"Connection Time:",-1)),T(" "+E(r.value),1)]),s("div",ef,[V[33]||(V[33]=s("strong",null,"Environment:",-1)),T(" "+E(le()),1)])])])]))}},sf=_t(tf,[["__scopeId","data-v-a91e145c"]]),nf={class:"messaging-view"},of={class:"messaging-layout"},af={class:"broadcast-section"},rf={class:"message-composer"},lf={class:"composer-controls"},uf=["onKeydown"],cf={class:"composer-actions"},df=["disabled"],ff={class:"messages-container"},pf={class:"messages-header"},gf={class:"messages-list"},vf={key:0,class:"empty-state"},mf={class:"message-header"},bf={class:"message-sender"},hf={class:"message-time"},yf={class:"message-type"},wf={class:"message-content"},Sf={class:"direct-section"},Df={class:"peer-selector"},kf=["value"],$f={key:0,class:"message-composer"},Cf={class:"composer-header"},_f={class:"composer-controls"},Ef=["onKeydown"],Tf={class:"composer-actions"},xf=["disabled"],Rf={class:"conversations"},Lf={key:0,class:"empty-state"},Pf={class:"conversation-header"},Af={class:"message-count"},Mf={class:"conversation-messages"},If={class:"message-header"},Nf={class:"message-sender"},Of={class:"message-time"},Vf={class:"message-content"},Uf={key:0,class:"more-messages"},Ff={class:"stats-section"},Kf={class:"stats-grid"},Hf={class:"stat-item"},Bf={class:"stat-item"},jf={class:"stat-item"},Gf={class:"stat-item"},zf={__name:"MessagingView",setup(e){const t=Ct(),n=K(""),o=K(""),i=K("");K("");const a=K(!1),r=ce(()=>t.messages),l=ce(()=>t.directMessages),d=ce(()=>t.connectedPeersList),v=ce(()=>t.isConnected),p=ce(()=>[...r.value].reverse()),f=ce(()=>{const Q=[];for(const[O,ee]of l.value)Q.push({peerId:O,messages:ee,lastMessage:ee[ee.length-1]});return Q.sort((O,ee)=>new Date(ee.lastMessage.timestamp)-new Date(O.lastMessage.timestamp))}),y=ce(()=>r.value.filter(Q=>Q.type==="broadcast").length),k=ce(()=>{let Q=0;for(const O of l.value.values())Q+=O.length;return Q}),N=ce(()=>{const Q=r.value.filter(ee=>ee.fromPeerId==="You").length;let O=0;for(const ee of l.value.values())O+=ee.filter(q=>q.fromPeerId==="You").length;return Q+O}),A=()=>{if(!(!n.value.trim()||!v.value))try{t.sendBroadcastMessage(n.value.trim()),n.value="",t.addDebugLog("Broadcast message sent successfully","success")}catch(Q){t.addDebugLog(`Failed to send broadcast: ${Q.message}`,"error")}},oe=()=>{if(!(!o.value.trim()||!i.value||!v.value))try{t.sendDirectMessage(i.value,o.value.trim()),o.value="",t.addDebugLog(`Direct message sent to ${i.value.substring(0,8)}...`,"success")}catch(Q){t.addDebugLog(`Failed to send direct message: ${Q.message}`,"error")}},Y=()=>{t.messages=[],t.addDebugLog("Broadcast messages cleared","info")},G=Q=>new Date(Q).toLocaleTimeString(),J=Q=>typeof Q=="string"?Q:JSON.stringify(Q,null,2),X=()=>{const Q={type:"ping",timestamp:Date.now(),source:"vue-demo"};t.sendBroadcastMessage(Q),t.addDebugLog("Ping sent to all peers","info")},ue=()=>{var O;const Q={type:"system_info",timestamp:Date.now(),userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,online:navigator.onLine,connectionType:((O=navigator.connection)==null?void 0:O.effectiveType)||"unknown",peerId:t.peerId.substring(0,8)+"...",connectedPeers:t.networkStatus.connectedCount};t.sendBroadcastMessage(Q),t.addDebugLog("System info broadcast sent","info")},be=()=>{[{type:"text",content:"Simple text message"},{type:"json",data:{key:"value",number:42,array:[1,2,3]}},{type:"binary_info",size:1024,encoding:"base64"},{type:"event",event:"user_action",action:"click",target:"button"}].forEach((O,ee)=>{setTimeout(()=>{t.sendBroadcastMessage(O)},ee*500)}),t.addDebugLog("Test messages sent","info")},fe=()=>{a.value=!a.value,t.addDebugLog(`Message filtering ${a.value?"enabled":"disabled"}`,"info")};return(Q,O)=>(x(),R("div",nf,[O[28]||(O[28]=s("div",{class:"section-header"},[s("h2",null,"๐ฌ Messaging System"),s("p",null,"Send broadcast messages via gossip protocol and direct peer-to-peer messages")],-1)),s("div",of,[s("div",af,[O[7]||(O[7]=s("h3",null,"๐ Broadcast Messages (Gossip Protocol)",-1)),O[8]||(O[8]=s("p",{class:"section-description"}," Messages sent via gossip protocol reach all peers in the network, not just direct connections. They propagate with TTL (Time To Live) and path tracking to prevent loops. ",-1)),s("div",rf,[O[5]||(O[5]=s("div",{class:"composer-header"},[s("span",{class:"composer-icon"},"๐ข"),s("span",null,"Broadcast to all peers")],-1)),s("div",lf,[ae(s("textarea",{"onUpdate:modelValue":O[0]||(O[0]=ee=>n.value=ee),placeholder:"Type your message to broadcast to all peers...",class:"message-input",rows:"3",onKeydown:Go(jo(A,["ctrl"]),["enter"])},null,40,uf),[[ke,n.value]]),s("div",cf,[s("button",{onClick:A,disabled:!n.value.trim()||!v.value,class:"btn btn-primary"},[...O[3]||(O[3]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Send Broadcast ",-1)])],8,df),O[4]||(O[4]=s("span",{class:"shortcut-hint"},"Ctrl+Enter",-1))])])]),s("div",ff,[s("div",pf,[s("h4",null,"Recent Broadcasts ("+E(r.value.length)+")",1),s("button",{onClick:Y,class:"btn btn-secondary btn-sm"}," Clear ")]),s("div",gf,[r.value.length===0?(x(),R("div",vf,[...O[6]||(O[6]=[s("div",{class:"empty-icon"},"๐ญ",-1),s("p",null,"No broadcast messages yet",-1),s("p",{class:"empty-meta"},"Send a message or wait for messages from other peers",-1)])])):de("",!0),(x(!0),R($e,null,Pe(p.value,ee=>(x(),R("div",{key:ee.id,class:Se(["message-item",{"own-message":ee.fromPeerId==="You"}])},[s("div",mf,[s("span",bf,E(ee.fromPeerId),1),s("span",hf,E(G(ee.timestamp)),1),s("span",yf,E(ee.type),1)]),s("div",wf,[s("pre",null,E(J(ee.content)),1)])],2))),128))])])]),s("div",Sf,[O[16]||(O[16]=s("h3",null,"๐ Direct Messages",-1)),O[17]||(O[17]=s("p",{class:"section-description"}," Send messages directly to specific peers. Messages are routed through the mesh network. ",-1)),s("div",Df,[O[10]||(O[10]=s("label",null,"Select target peer:",-1)),ae(s("select",{"onUpdate:modelValue":O[1]||(O[1]=ee=>i.value=ee),class:"peer-select"},[O[9]||(O[9]=s("option",{value:""},"Choose a peer...",-1)),(x(!0),R($e,null,Pe(d.value,ee=>(x(),R("option",{key:ee.id,value:ee.id},E(ee.id.substring(0,16))+"... ("+E(ee.status)+") ",9,kf))),128))],512),[[Oe,i.value]])]),i.value?(x(),R("div",$f,[s("div",Cf,[O[11]||(O[11]=s("span",{class:"composer-icon"},"๐",-1)),s("span",null,"Direct message to "+E(i.value.substring(0,16))+"...",1)]),s("div",_f,[ae(s("textarea",{"onUpdate:modelValue":O[2]||(O[2]=ee=>o.value=ee),placeholder:"Type your direct message...",class:"message-input",rows:"3",onKeydown:Go(jo(oe,["ctrl"]),["enter"])},null,40,Ef),[[ke,o.value]]),s("div",Tf,[s("button",{onClick:oe,disabled:!o.value.trim()||!i.value||!v.value,class:"btn btn-primary"},[...O[12]||(O[12]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Send Direct ",-1)])],8,xf),O[13]||(O[13]=s("span",{class:"shortcut-hint"},"Ctrl+Enter",-1))])])])):de("",!0),s("div",Rf,[O[15]||(O[15]=s("div",{class:"conversations-header"},[s("h4",null,"Conversations")],-1)),f.value.length===0?(x(),R("div",Lf,[...O[14]||(O[14]=[s("div",{class:"empty-icon"},"๐ฌ",-1),s("p",null,"No direct messages yet",-1),s("p",{class:"empty-meta"},"Select a peer and send a direct message",-1)])])):de("",!0),(x(!0),R($e,null,Pe(f.value,ee=>(x(),R("div",{key:ee.peerId,class:"conversation"},[s("div",Pf,[s("h5",null,E(ee.peerId.substring(0,16))+"...",1),s("span",Af,"("+E(ee.messages.length)+")",1)]),s("div",Mf,[(x(!0),R($e,null,Pe(ee.messages.slice(-5),q=>(x(),R("div",{key:q.id,class:Se(["message-item","direct",{"own-message":q.fromPeerId==="You"}])},[s("div",If,[s("span",Nf,E(q.fromPeerId),1),s("span",Of,E(G(q.timestamp)),1)]),s("div",Vf,[s("pre",null,E(J(q.content)),1)])],2))),128)),ee.messages.length>5?(x(),R("div",Uf," + "+E(ee.messages.length-5)+" more messages ",1)):de("",!0)])]))),128))])])]),s("div",Ff,[O[22]||(O[22]=s("h3",null,"๐ Messaging Statistics",-1)),s("div",Kf,[s("div",Hf,[O[18]||(O[18]=s("strong",null,"Total Broadcasts:",-1)),s("span",null,E(y.value),1)]),s("div",Bf,[O[19]||(O[19]=s("strong",null,"Total Direct Messages:",-1)),s("span",null,E(k.value),1)]),s("div",jf,[O[20]||(O[20]=s("strong",null,"Active Conversations:",-1)),s("span",null,E(f.value.length),1)]),s("div",Gf,[O[21]||(O[21]=s("strong",null,"Messages Sent:",-1)),s("span",null,E(N.value),1)])])]),s("div",{class:"advanced-section"},[O[27]||(O[27]=s("h3",null,"๐ง Advanced Messaging",-1)),s("div",{class:"advanced-controls"},[s("button",{onClick:X,class:"btn btn-secondary"},[...O[23]||(O[23]=[s("span",{class:"btn-icon"},"๐",-1),T(" Ping All Peers ",-1)])]),s("button",{onClick:ue,class:"btn btn-secondary"},[...O[24]||(O[24]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Broadcast System Info ",-1)])]),s("button",{onClick:be,class:"btn btn-secondary"},[...O[25]||(O[25]=[s("span",{class:"btn-icon"},"๐งช",-1),T(" Test Message Types ",-1)])]),s("button",{onClick:fe,class:"btn btn-secondary"},[...O[26]||(O[26]=[s("span",{class:"btn-icon"},"๐",-1),T(" Toggle Message Filtering ",-1)])])])])]))}},Wf=_t(zf,[["__scopeId","data-v-3666197d"]]),Jf={class:"media-view"},qf={class:"media-controls"},Yf={class:"controls-grid"},Qf={class:"control-group"},Xf={class:"control-buttons"},Zf=["disabled"],ep=["disabled"],tp=["disabled"],sp=["disabled"],np={class:"control-group"},op={class:"control-buttons"},ip=["disabled"],ap={class:"btn-icon"},rp=["disabled"],lp={class:"btn-icon"},up={class:"control-group"},cp={class:"device-selectors"},dp=["value"],fp=["value"],pp={class:"streams-container"},gp={class:"stream-section"},vp={class:"local-stream-container"},mp={key:0,class:"stream-overlay"},bp={key:1,class:"stream-info"},hp={class:"stream-stats"},yp={class:"stat"},wp={class:"stat"},Sp={class:"stream-section"},Dp={key:0,class:"empty-streams"},kp={key:1,class:"remote-streams-grid"},$p={class:"stream-info"},Cp={class:"peer-info"},_p={class:"stream-stats"},Ep={class:"stream-time"},Tp={class:"stats-section"},xp={class:"stats-grid"},Rp={class:"stat-card"},Lp={class:"stat-content"},Pp={class:"stat-value"},Ap={class:"stat-meta"},Mp={class:"stat-card"},Ip={class:"stat-content"},Np={class:"stat-value"},Op={class:"stat-card"},Vp={class:"stat-content"},Up={class:"stat-value"},Fp={class:"stat-meta"},Kp={class:"stat-card"},Hp={class:"stat-content"},Bp={class:"stat-value"},jp={class:"advanced-section"},Gp={class:"advanced-features"},zp={class:"feature-group"},Wp={class:"quality-controls"},Jp={class:"feature-group"},qp={class:"audio-controls"},Yp={class:"feature-group"},Qp={class:"screen-controls"},Xp=["disabled"],Zp=["disabled"],eg={class:"feature-group"},tg={class:"recording-controls"},sg=["disabled"],ng=["disabled"],og=["disabled"],ig={__name:"MediaView",setup(e){const t=Ct(),n=K(null),o=K(new Map),i=K(""),a=K(""),r=K([]),l=K([]),d=K("medium"),v=K(!0),p=K(!0),f=K(!1),y=K(!1),k=K(null),N=K(null),A=ce(()=>t.mediaState),oe=ce(()=>t.isConnected),Y=ce(()=>r.value.length+l.value.length),G=ce(()=>"RTCPeerConnection"in window?"Supported":"Not Supported"),J=async()=>{try{await t.startMedia({video:!0,audio:!1}),O()}catch(re){t.addDebugLog(`Failed to start video: ${re.message}`,"error")}},X=async()=>{try{await t.startMedia({video:!1,audio:!0})}catch(re){t.addDebugLog(`Failed to start audio: ${re.message}`,"error")}},ue=async()=>{try{await t.startMedia({video:!0,audio:!0}),O()}catch(re){t.addDebugLog(`Failed to start media: ${re.message}`,"error")}},be=async()=>{try{await t.stopMedia(),n.value&&(n.value.srcObject=null)}catch(re){t.addDebugLog(`Failed to stop media: ${re.message}`,"error")}},fe=()=>{t.mesh&&(t.mesh.toggleVideo(),t.addDebugLog(`Video ${A.value.videoEnabled?"disabled":"enabled"}`))},Q=()=>{t.mesh&&(t.mesh.toggleAudio(),t.addDebugLog(`Audio ${A.value.audioEnabled?"disabled":"enabled"}`))},O=async()=>{await zt(),n.value&&A.value.localStream&&(n.value.srcObject=A.value.localStream)},ee=(re,D)=>{if(re){o.value.set(D,re);const h=A.value.remoteStreams.get(D);h&&h.stream&&(re.srcObject=h.stream)}},q=async()=>{try{const re=await navigator.mediaDevices.enumerateDevices();r.value=re.filter(D=>D.kind==="videoinput"),l.value=re.filter(D=>D.kind==="audioinput"),t.addDebugLog(`Found ${re.length} media devices`,"info")}catch(re){t.addDebugLog(`Failed to enumerate devices: ${re.message}`,"error")}},z=async()=>{if(i.value&&A.value.localStream)try{await be(),await t.startMedia({video:{deviceId:i.value},audio:A.value.audioEnabled}),O()}catch(re){t.addDebugLog(`Failed to change video device: ${re.message}`,"error")}},le=async()=>{if(a.value&&A.value.localStream)try{await be(),await t.startMedia({video:A.value.videoEnabled,audio:{deviceId:a.value}}),O()}catch(re){t.addDebugLog(`Failed to change audio device: ${re.message}`,"error")}},he=async()=>{if(A.value.localStream&&A.value.videoEnabled){const re=V();try{await A.value.localStream.getVideoTracks()[0].applyConstraints(re),t.addDebugLog(`Video quality updated to ${d.value}`,"info")}catch(D){t.addDebugLog(`Failed to update video quality: ${D.message}`,"error")}}},M=async()=>{if(A.value.localStream&&A.value.audioEnabled){const re={echoCancellation:v.value,noiseSuppression:p.value};try{await A.value.localStream.getAudioTracks()[0].applyConstraints(re),t.addDebugLog("Audio settings updated","info")}catch(D){t.addDebugLog(`Failed to update audio settings: ${D.message}`,"error")}}},V=()=>{const re={low:{width:320,height:240},medium:{width:640,height:480},high:{width:1280,height:720},ultra:{width:1920,height:1080}};return re[d.value]||re.medium},j=async()=>{var re,D,h,L;try{const c=await navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0});if(A.value.localStream){const P=c.getVideoTracks()[0],B=(L=(h=(D=(re=t.mesh)==null?void 0:re.connectionManager)==null?void 0:D.getAllConnections().find(te=>{var pe;return(pe=te.peerConnection)==null?void 0:pe.getSenders}))==null?void 0:h.peerConnection)==null?void 0:L.getSenders().find(te=>{var pe;return((pe=te.track)==null?void 0:pe.kind)==="video"});B&&await B.replaceTrack(P)}f.value=!0,t.addDebugLog("Screen sharing started","success"),c.getVideoTracks()[0].onended=()=>{f.value=!1,t.addDebugLog("Screen sharing ended","info")}}catch(c){t.addDebugLog(`Failed to start screen share: ${c.message}`,"error")}},ve=async()=>{var re,D,h,L;try{if(A.value.videoEnabled){const P=(await navigator.mediaDevices.getUserMedia({video:!0,audio:!1})).getVideoTracks()[0],B=(L=(h=(D=(re=t.mesh)==null?void 0:re.connectionManager)==null?void 0:D.getAllConnections().find(te=>{var pe;return(pe=te.peerConnection)==null?void 0:pe.getSenders}))==null?void 0:h.peerConnection)==null?void 0:L.getSenders().find(te=>{var pe;return((pe=te.track)==null?void 0:pe.kind)==="video"});B&&await B.replaceTrack(P)}f.value=!1,t.addDebugLog("Screen sharing stopped","info")}catch(c){t.addDebugLog(`Failed to stop screen share: ${c.message}`,"error")}},we=()=>{if(!A.value.localStream){t.addDebugLog("No local stream to record","error");return}try{const re=[];N.value=new MediaRecorder(A.value.localStream),N.value.ondataavailable=D=>{D.data.size>0&&re.push(D.data)},N.value.onstop=()=>{k.value=new Blob(re,{type:"video/webm"}),y.value=!1,t.addDebugLog("Recording stopped","info")},N.value.start(),y.value=!0,t.addDebugLog("Recording started","success")}catch(re){t.addDebugLog(`Failed to start recording: ${re.message}`,"error")}},De=()=>{N.value&&y.value&&N.value.stop()},Me=()=>{if(k.value){const re=URL.createObjectURL(k.value),D=document.createElement("a");D.style.display="none",D.href=re,D.download=`peerpigeon-recording-${Date.now()}.webm`,document.body.appendChild(D),D.click(),document.body.removeChild(D),URL.revokeObjectURL(re),t.addDebugLog("Recording downloaded","success")}},Te=re=>{if(!re)return"00:00";const h=Math.floor((new Date-re)/1e3),L=Math.floor(h/60),c=h%60;return`${L.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`};return It(()=>A.value.localStream,re=>{re&&n.value&&(n.value.srcObject=re)}),It(()=>A.value.remoteStreams,re=>{for(const[D,h]of re){const L=o.value.get(D);L&&h.stream&&(L.srcObject=h.stream)}},{deep:!0}),Ut(async()=>{await q(),navigator.mediaDevices.addEventListener("devicechange",q)}),Rs(()=>{navigator.mediaDevices.removeEventListener("devicechange",q),y.value&&De()}),(re,D)=>(x(),R("div",Jf,[D[47]||(D[47]=s("div",{class:"section-header"},[s("h2",null,"๐ฅ Media Streaming"),s("p",null,"Stream audio and video between peers in real-time using WebRTC")],-1)),s("div",qf,[D[15]||(D[15]=s("h3",null,"๐น Local Media Controls",-1)),s("div",Yf,[s("div",Qf,[D[9]||(D[9]=s("h4",null,"Camera & Microphone",-1)),s("div",Xf,[s("button",{onClick:J,disabled:!oe.value||A.value.videoEnabled,class:"btn btn-primary"},[...D[5]||(D[5]=[s("span",{class:"btn-icon"},"๐น",-1),T(" Start Video ",-1)])],8,Zf),s("button",{onClick:X,disabled:!oe.value||A.value.audioEnabled,class:"btn btn-primary"},[...D[6]||(D[6]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Start Audio ",-1)])],8,ep),s("button",{onClick:ue,disabled:!oe.value||A.value.audioEnabled&&A.value.videoEnabled,class:"btn btn-success"},[...D[7]||(D[7]=[s("span",{class:"btn-icon"},"๐ฌ",-1),T(" Start Both ",-1)])],8,tp),s("button",{onClick:be,disabled:!A.value.localStream,class:"btn btn-danger"},[...D[8]||(D[8]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Stop All ",-1)])],8,sp)])]),s("div",np,[D[10]||(D[10]=s("h4",null,"Stream Controls",-1)),s("div",op,[s("button",{onClick:fe,disabled:!A.value.localStream,class:"btn btn-secondary"},[s("span",ap,E(A.value.videoEnabled?"๐น":"โ"),1),T(" "+E(A.value.videoEnabled?"Disable Video":"Enable Video"),1)],8,ip),s("button",{onClick:Q,disabled:!A.value.localStream,class:"btn btn-secondary"},[s("span",lp,E(A.value.audioEnabled?"๐ค":"๐"),1),T(" "+E(A.value.audioEnabled?"Mute Audio":"Unmute Audio"),1)],8,rp)])]),s("div",up,[D[14]||(D[14]=s("h4",null,"Device Selection",-1)),s("div",cp,[ae(s("select",{"onUpdate:modelValue":D[0]||(D[0]=h=>i.value=h),onChange:z,class:"device-select"},[D[11]||(D[11]=s("option",{value:""},"Select Camera...",-1)),(x(!0),R($e,null,Pe(r.value,h=>(x(),R("option",{key:h.deviceId,value:h.deviceId},E(h.label||`Camera ${h.deviceId.slice(0,8)}...`),9,dp))),128))],544),[[Oe,i.value]]),ae(s("select",{"onUpdate:modelValue":D[1]||(D[1]=h=>a.value=h),onChange:le,class:"device-select"},[D[12]||(D[12]=s("option",{value:""},"Select Microphone...",-1)),(x(!0),R($e,null,Pe(l.value,h=>(x(),R("option",{key:h.deviceId,value:h.deviceId},E(h.label||`Microphone ${h.deviceId.slice(0,8)}...`),9,fp))),128))],544),[[Oe,a.value]]),s("button",{onClick:q,class:"btn btn-secondary btn-sm"},[...D[13]||(D[13]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh Devices ",-1)])])])])])]),s("div",pp,[s("div",gp,[D[19]||(D[19]=s("h3",null,"๐บ Your Stream",-1)),s("div",vp,[s("video",{ref_key:"localVideo",ref:n,autoplay:"",muted:"",playsinline:"",class:Se(["media-stream local-stream",{active:A.value.localStream}])},null,2),A.value.localStream?de("",!0):(x(),R("div",mp,[...D[16]||(D[16]=[s("div",{class:"overlay-content"},[s("span",{class:"overlay-icon"},"๐ท"),s("p",null,"No local stream"),s("p",{class:"overlay-meta"},"Start your camera or microphone to see your stream here")],-1)])])),A.value.localStream?(x(),R("div",bp,[s("div",hp,[s("span",yp,[D[17]||(D[17]=s("span",{class:"stat-icon"},"๐น",-1)),T(" "+E(A.value.videoEnabled?"Video ON":"Video OFF"),1)]),s("span",wp,[D[18]||(D[18]=s("span",{class:"stat-icon"},"๐ค",-1)),T(" "+E(A.value.audioEnabled?"Audio ON":"Audio OFF"),1)])])])):de("",!0)])]),s("div",Sp,[s("h3",null,"๐ก Remote Streams ("+E(A.value.remoteStreams.size)+")",1),A.value.remoteStreams.size===0?(x(),R("div",Dp,[...D[20]||(D[20]=[s("div",{class:"empty-icon"},"๐บ",-1),s("p",null,"No remote streams",-1),s("p",{class:"empty-meta"},"Remote streams from other peers will appear here",-1)])])):(x(),R("div",kp,[(x(!0),R($e,null,Pe(A.value.remoteStreams,([h,L])=>(x(),R("div",{key:h,class:"remote-stream-container"},[s("video",{ref_for:!0,ref:c=>ee(c,h),autoplay:"",playsinline:"",class:"media-stream remote-stream"},null,512),s("div",$p,[s("div",Cp,[D[21]||(D[21]=s("span",{class:"peer-icon"},"๐ค",-1)),T(" "+E(h.substring(0,12))+"... ",1)]),s("div",_p,[s("span",Ep,E(Te(L.startTime)),1)])])]))),128))]))])]),s("div",Tp,[D[32]||(D[32]=s("h3",null,"๐ Media Statistics",-1)),s("div",xp,[s("div",Rp,[D[23]||(D[23]=s("div",{class:"stat-icon"},"๐น",-1)),s("div",Lp,[D[22]||(D[22]=s("h4",null,"Local Stream",-1)),s("div",Pp,E(A.value.localStream?"Active":"Inactive"),1),s("div",Ap," Video: "+E(A.value.videoEnabled?"ON":"OFF")+", Audio: "+E(A.value.audioEnabled?"ON":"OFF"),1)])]),s("div",Mp,[D[26]||(D[26]=s("div",{class:"stat-icon"},"๐ก",-1)),s("div",Ip,[D[24]||(D[24]=s("h4",null,"Remote Streams",-1)),s("div",Np,E(A.value.remoteStreams.size),1),D[25]||(D[25]=s("div",{class:"stat-meta"},"Connected peer streams",-1))])]),s("div",Op,[D[28]||(D[28]=s("div",{class:"stat-icon"},"๐๏ธ",-1)),s("div",Vp,[D[27]||(D[27]=s("h4",null,"Available Devices",-1)),s("div",Up,E(Y.value),1),s("div",Fp,E(r.value.length)+" cameras, "+E(l.value.length)+" mics ",1)])]),s("div",Kp,[D[31]||(D[31]=s("div",{class:"stat-icon"},"๐",-1)),s("div",Hp,[D[29]||(D[29]=s("h4",null,"WebRTC Status",-1)),s("div",Bp,E(G.value),1),D[30]||(D[30]=s("div",{class:"stat-meta"},"Real-time communication",-1))])])])]),s("div",jp,[D[46]||(D[46]=s("h3",null,"๐ง Advanced Media Features",-1)),s("div",Gp,[s("div",zp,[D[35]||(D[35]=s("h4",null,"Stream Quality",-1)),s("div",Wp,[D[34]||(D[34]=s("label",null,"Video Quality:",-1)),ae(s("select",{"onUpdate:modelValue":D[2]||(D[2]=h=>d.value=h),onChange:he,class:"quality-select"},[...D[33]||(D[33]=[s("option",{value:"low"},"Low (320x240)",-1),s("option",{value:"medium"},"Medium (640x480)",-1),s("option",{value:"high"},"High (1280x720)",-1),s("option",{value:"ultra"},"Ultra (1920x1080)",-1)])],544),[[Oe,d.value]])])]),s("div",Jp,[D[38]||(D[38]=s("h4",null,"Audio Settings",-1)),s("div",qp,[s("label",null,[ae(s("input",{type:"checkbox","onUpdate:modelValue":D[3]||(D[3]=h=>v.value=h),onChange:M},null,544),[[Ke,v.value]]),D[36]||(D[36]=T(" Echo Cancellation ",-1))]),s("label",null,[ae(s("input",{type:"checkbox","onUpdate:modelValue":D[4]||(D[4]=h=>p.value=h),onChange:M},null,544),[[Ke,p.value]]),D[37]||(D[37]=T(" Noise Suppression ",-1))])])]),s("div",Yp,[D[41]||(D[41]=s("h4",null,"Screen Sharing",-1)),s("div",Qp,[s("button",{onClick:j,disabled:f.value,class:"btn btn-secondary"},[...D[39]||(D[39]=[s("span",{class:"btn-icon"},"๐ฅ๏ธ",-1),T(" Start Screen Share ",-1)])],8,Xp),s("button",{onClick:ve,disabled:!f.value,class:"btn btn-secondary"},[...D[40]||(D[40]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Stop Screen Share ",-1)])],8,Zp)])]),s("div",eg,[D[45]||(D[45]=s("h4",null,"Recording",-1)),s("div",tg,[s("button",{onClick:we,disabled:y.value,class:"btn btn-secondary"},[...D[42]||(D[42]=[s("span",{class:"btn-icon"},"โบ๏ธ",-1),T(" Start Recording ",-1)])],8,sg),s("button",{onClick:De,disabled:!y.value,class:"btn btn-secondary"},[...D[43]||(D[43]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Stop Recording ",-1)])],8,ng),s("button",{onClick:Me,disabled:!k.value,class:"btn btn-secondary"},[...D[44]||(D[44]=[s("span",{class:"btn-icon"},"๐พ",-1),T(" Download ",-1)])],8,og)])])])])]))}},ag=_t(ig,[["__scopeId","data-v-ac27a8d6"]]),rg={class:"dht-view"},lg={class:"dht-operations"},ug={class:"operation-tabs"},cg={key:0,class:"operation-panel"},dg={class:"form-group"},fg={class:"form-group"},pg={class:"form-group"},gg=["disabled"],vg={key:1,class:"operation-panel"},mg={class:"form-group"},bg={class:"form-group"},hg=["disabled"],yg={key:0,class:"result-panel"},wg={class:"result-content"},Sg={key:2,class:"operation-panel"},Dg={class:"form-group"},kg={class:"subscription-controls"},$g=["disabled"],Cg=["disabled"],_g={class:"subscriptions-list"},Eg={key:0,class:"empty-state"},Tg={key:1,class:"subscription-items"},xg={class:"subscription-key"},Rg=["onClick"],Lg={key:3,class:"operation-panel"},Pg={class:"form-group"},Ag={class:"form-group"},Mg=["disabled"],Ig={class:"stored-data"},Ng={class:"section-title"},Og={key:0,class:"empty-data"},Vg={key:1,class:"data-grid"},Ug={class:"data-header"},Fg={class:"data-key"},Kg={class:"data-badges"},Hg={key:0,class:"badge badge-local"},Bg={key:1,class:"badge badge-remote"},jg={key:2,class:"badge badge-subscribed"},Gg={class:"data-meta"},zg={class:"data-timestamp"},Wg={key:0,class:"data-version"},Jg={class:"data-content"},qg={class:"data-actions"},Yg=["onClick"],Qg=["onClick"],Xg=["onClick"],Zg=["onClick"],ev={key:0,class:"notifications"},tv={class:"notifications-list"},sv={class:"notification-header"},nv={class:"notification-key"},ov={class:"notification-time"},iv={class:"notification-content"},av={class:"stats-section"},rv={class:"stats-grid"},lv={class:"stat-card"},uv={class:"stat-content"},cv={class:"stat-value"},dv={class:"stat-card"},fv={class:"stat-content"},pv={class:"stat-value"},gv={class:"stat-card"},vv={class:"stat-content"},mv={class:"stat-value"},bv={class:"stat-card"},hv={class:"stat-content"},yv={class:"stat-value"},wv={key:0,class:"dht-stats-detail"},Sv={class:"stats-json"},Dv={__name:"DHTView",setup(e){const t=Ct(),n=K("put"),o=K(""),i=K(""),a=K(null),r=K(""),l=K(null),d=K(!1),v=K(""),p=K(""),f=K(""),y=K(new Set),k=K([]),N=ce(()=>t.dhtData),A=ce(()=>t.getDHTStats()),oe=ce(()=>t.isConnected),Y=ce(()=>Array.from(N.value.values()).filter(D=>D.local).length),G=ce(()=>Array.from(N.value.values()).filter(D=>!D.local).length),J=async()=>{try{let D;try{D=JSON.parse(i.value)}catch{D=i.value}const h={};a.value&&a.value>0&&(h.ttl=a.value),await t.dhtPut(o.value,D,h)&&(t.addDebugLog(`DHT PUT successful: ${o.value}`,"success"),o.value="",i.value="",a.value=null)}catch(D){t.addDebugLog(`DHT PUT failed: ${D.message}`,"error")}},X=async()=>{try{const D={forceRefresh:d.value},h=await t.dhtGet(r.value,D);l.value=h,h!==null?t.addDebugLog(`DHT GET successful: ${r.value}`,"success"):t.addDebugLog(`DHT GET returned null for key: ${r.value}`,"warning")}catch(D){t.addDebugLog(`DHT GET failed: ${D.message}`,"error"),l.value=null}},ue=async()=>{try{t.mesh&&(await t.mesh.dhtSubscribe(v.value),y.value.add(v.value),t.addDebugLog(`Subscribed to DHT key: ${v.value}`,"success"),v.value="")}catch(D){t.addDebugLog(`DHT SUBSCRIBE failed: ${D.message}`,"error")}},be=async()=>{try{t.mesh&&(await t.mesh.dhtUnsubscribe(v.value),y.value.delete(v.value),t.addDebugLog(`Unsubscribed from DHT key: ${v.value}`,"success"),v.value="")}catch(D){t.addDebugLog(`DHT UNSUBSCRIBE failed: ${D.message}`,"error")}},fe=async()=>{try{let D;try{D=JSON.parse(f.value)}catch{D=f.value}t.mesh&&await t.mesh.dhtUpdate(p.value,D)&&(t.addDebugLog(`DHT UPDATE successful: ${p.value}`,"success"),p.value="",f.value="")}catch(D){t.addDebugLog(`DHT UPDATE failed: ${D.message}`,"error")}},Q=D=>y.value.has(D),O=async D=>{try{t.mesh&&(await t.mesh.dhtUnsubscribe(D),y.value.delete(D),t.addDebugLog(`Unsubscribed from DHT key: ${D}`,"success"))}catch(h){t.addDebugLog(`DHT UNSUBSCRIBE failed: ${h.message}`,"error")}},ee=async D=>{try{t.mesh&&(await t.mesh.dhtSubscribe(D),y.value.add(D),t.addDebugLog(`Subscribed to DHT key: ${D}`,"success"))}catch(h){t.addDebugLog(`DHT SUBSCRIBE failed: ${h.message}`,"error")}},q=async D=>{await O(D)},z=async()=>{for(const D of N.value.keys())await le(D);t.addDebugLog("Refreshed all DHT data","info")},le=async D=>{try{await t.dhtGet(D,{forceRefresh:!0})!==null&&t.addDebugLog(`Refreshed DHT key: ${D}`,"success")}catch(h){t.addDebugLog(`Failed to refresh DHT key ${D}: ${h.message}`,"error")}},he=()=>{t.dhtData.clear(),t.addDebugLog("Cleared local DHT data","info")},M=async D=>{try{await navigator.clipboard.writeText(D),t.addDebugLog(`Copied key to clipboard: ${D}`,"success")}catch{t.addDebugLog("Failed to copy to clipboard","error")}},V=()=>{k.value=[],t.addDebugLog("Cleared DHT notifications","info")},j=D=>new Date(D).toLocaleTimeString(),ve=async()=>{const D={theme:"dark",language:"en",notifications:!0,autoConnect:!0,maxPeers:5};await t.dhtPut("user:preferences",D),t.addDebugLog("Stored user preferences in DHT","success")},we=async()=>{const D={value:0,lastUpdated:Date.now(),updatedBy:t.peerId.substring(0,8)+"..."};await t.dhtPut("shared:counter",D),t.mesh&&(await t.mesh.dhtSubscribe("shared:counter"),y.value.add("shared:counter")),t.addDebugLog("Created shared counter in DHT","success")},De=async()=>{const D={userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,online:navigator.onLine,timestamp:Date.now(),peerId:t.peerId.substring(0,8)+"...",connectedPeers:t.networkStatus.connectedCount};await t.dhtPut("system:info",D),t.addDebugLog("Stored system info in DHT","success")},Me=async()=>{const h=[];t.addDebugLog("Starting DHT stress test with 10 operations...","info");for(let c=0;c<10;c++){const P=`test:stress:${c}`,B={index:c,data:Array(100).fill(0).map(()=>Math.random()),timestamp:Date.now()},te=performance.now();try{await t.dhtPut(P,B);const pe=performance.now();h.push(pe-te)}catch(pe){t.addDebugLog(`Stress test operation ${c} failed: ${pe.message}`,"error")}}const L=h.reduce((c,P)=>c+P,0)/h.length;t.addDebugLog(`DHT stress test completed. Average time: ${L.toFixed(2)}ms`,"success")},Te=async()=>{const D="demo:replication",h={message:"This data should be replicated across all peers",timestamp:Date.now(),source:t.peerId.substring(0,8)+"..."};await t.dhtPut(D,h),t.mesh&&(await t.mesh.dhtSubscribe(D),y.value.add(D)),t.addDebugLog("Stored replication demo data. Other peers should receive this automatically.","success")},re=D=>{const h={id:Date.now()+Math.random(),key:D.key,oldValue:D.oldValue,newValue:D.newValue,timestamp:new Date};k.value.push(h),k.value.length>20&&k.value.shift(),t.addDebugLog(`DHT value changed: ${D.key}`,"info")};return Ut(()=>{t.mesh&&t.mesh.addEventListener("dhtValueChanged",re)}),(D,h)=>(x(),R("div",rg,[h[68]||(h[68]=s("div",{class:"section-header"},[s("h2",null,"๐๏ธ Distributed Hash Table (WebDHT)"),s("p",null,"Store and retrieve data across the mesh network with automatic replication and pub/sub")],-1)),s("div",lg,[h[34]||(h[34]=s("h3",null,"๐ DHT Operations",-1)),s("div",ug,[s("button",{onClick:h[0]||(h[0]=L=>n.value="put"),class:Se(["tab-btn",{active:n.value==="put"}])}," PUT (Store) ",2),s("button",{onClick:h[1]||(h[1]=L=>n.value="get"),class:Se(["tab-btn",{active:n.value==="get"}])}," GET (Retrieve) ",2),s("button",{onClick:h[2]||(h[2]=L=>n.value="subscribe"),class:Se(["tab-btn",{active:n.value==="subscribe"}])}," SUBSCRIBE ",2),s("button",{onClick:h[3]||(h[3]=L=>n.value="update"),class:Se(["tab-btn",{active:n.value==="update"}])}," UPDATE ",2)]),n.value==="put"?(x(),R("div",cg,[h[16]||(h[16]=s("h4",null,"๐ค Store Data in DHT",-1)),h[17]||(h[17]=s("p",{class:"operation-description"}," Store key-value pairs in the distributed hash table. Data is automatically replicated across peers. ",-1)),s("div",dg,[h[12]||(h[12]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":h[4]||(h[4]=L=>o.value=L),placeholder:"e.g., user:settings, app:config, shared:counter",class:"form-input"},null,512),[[ke,o.value]])]),s("div",fg,[h[13]||(h[13]=s("label",null,"Value (JSON):",-1)),ae(s("textarea",{"onUpdate:modelValue":h[5]||(h[5]=L=>i.value=L),placeholder:'{"theme": "dark", "language": "en"}',rows:"4",class:"form-textarea"},null,512),[[ke,i.value]])]),s("div",pg,[h[14]||(h[14]=s("label",null,"TTL (seconds, optional):",-1)),ae(s("input",{"onUpdate:modelValue":h[6]||(h[6]=L=>a.value=L),type:"number",placeholder:"Leave empty for no expiration",class:"form-input"},null,512),[[ke,a.value,void 0,{number:!0}]])]),s("button",{onClick:J,disabled:!o.value||!i.value||!oe.value,class:"btn btn-primary"},[...h[15]||(h[15]=[s("span",{class:"btn-icon"},"๐พ",-1),T(" Store in DHT ",-1)])],8,gg)])):de("",!0),n.value==="get"?(x(),R("div",vg,[h[22]||(h[22]=s("h4",null,"๐ฅ Retrieve Data from DHT",-1)),h[23]||(h[23]=s("p",{class:"operation-description"}," Retrieve values by key from the distributed hash table. Data is fetched from available peers. ",-1)),s("div",mg,[h[18]||(h[18]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":h[7]||(h[7]=L=>r.value=L),placeholder:"Enter key to retrieve",class:"form-input"},null,512),[[ke,r.value]])]),s("div",bg,[s("label",null,[ae(s("input",{type:"checkbox","onUpdate:modelValue":h[8]||(h[8]=L=>d.value=L)},null,512),[[Ke,d.value]]),h[19]||(h[19]=T(" Force refresh from network ",-1))])]),s("button",{onClick:X,disabled:!r.value||!oe.value,class:"btn btn-primary"},[...h[20]||(h[20]=[s("span",{class:"btn-icon"},"๐",-1),T(" Retrieve from DHT ",-1)])],8,hg),l.value?(x(),R("div",yg,[h[21]||(h[21]=s("h5",null,"Result:",-1)),s("pre",wg,E(JSON.stringify(l.value,null,2)),1)])):de("",!0)])):de("",!0),n.value==="subscribe"?(x(),R("div",Sg,[h[27]||(h[27]=s("h4",null,"๐ Subscribe to Key Changes",-1)),h[28]||(h[28]=s("p",{class:"operation-description"}," Subscribe to real-time notifications when a key's value changes in the DHT. ",-1)),s("div",Dg,[h[24]||(h[24]=s("label",null,"Key to subscribe:",-1)),ae(s("input",{"onUpdate:modelValue":h[9]||(h[9]=L=>v.value=L),placeholder:"Enter key to watch for changes",class:"form-input"},null,512),[[ke,v.value]])]),s("div",kg,[s("button",{onClick:ue,disabled:!v.value||Q(v.value)||!oe.value,class:"btn btn-success"},[...h[25]||(h[25]=[s("span",{class:"btn-icon"},"๐",-1),T(" Subscribe ",-1)])],8,$g),s("button",{onClick:be,disabled:!v.value||!Q(v.value)||!oe.value,class:"btn btn-warning"},[...h[26]||(h[26]=[s("span",{class:"btn-icon"},"๐",-1),T(" Unsubscribe ",-1)])],8,Cg)]),s("div",_g,[s("h5",null,"Active Subscriptions ("+E(y.value.size)+"):",1),y.value.size===0?(x(),R("div",Eg," No active subscriptions ")):(x(),R("div",Tg,[(x(!0),R($e,null,Pe(Array.from(y.value),L=>(x(),R("div",{key:L,class:"subscription-item"},[s("span",xg,E(L),1),s("button",{onClick:c=>O(L),class:"btn btn-sm btn-danger"}," Remove ",8,Rg)]))),128))]))])])):de("",!0),n.value==="update"?(x(),R("div",Lg,[h[32]||(h[32]=s("h4",null,"๐ Update Existing Data",-1)),h[33]||(h[33]=s("p",{class:"operation-description"}," Update existing data in the DHT and notify all subscribers of the change. ",-1)),s("div",Pg,[h[29]||(h[29]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":h[10]||(h[10]=L=>p.value=L),placeholder:"Key to update",class:"form-input"},null,512),[[ke,p.value]])]),s("div",Ag,[h[30]||(h[30]=s("label",null,"New Value (JSON):",-1)),ae(s("textarea",{"onUpdate:modelValue":h[11]||(h[11]=L=>f.value=L),placeholder:'{"updated": true, "timestamp": 1234567890}',rows:"4",class:"form-textarea"},null,512),[[ke,f.value]])]),s("button",{onClick:fe,disabled:!p.value||!f.value||!oe.value,class:"btn btn-primary"},[...h[31]||(h[31]=[s("span",{class:"btn-icon"},"๐",-1),T(" Update in DHT ",-1)])],8,Mg)])):de("",!0)]),s("div",Ig,[s("div",Ng,[s("h3",null,"๐พ Stored Data ("+E(N.value.size)+")",1),s("div",{class:"data-controls"},[s("button",{onClick:z,class:"btn btn-secondary"},[...h[35]||(h[35]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh All ",-1)])]),s("button",{onClick:he,class:"btn btn-danger"},[...h[36]||(h[36]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Clear Local ",-1)])])])]),N.value.size===0?(x(),R("div",Og,[...h[37]||(h[37]=[s("div",{class:"empty-icon"},"๐ญ",-1),s("p",null,"No data stored yet",-1),s("p",{class:"empty-meta"},"Store some data using the PUT operation above",-1)])])):(x(),R("div",Vg,[(x(!0),R($e,null,Pe(Array.from(N.value.entries()),([L,c])=>(x(),R("div",{key:L,class:"data-item"},[s("div",Ug,[s("h4",Fg,E(L),1),s("div",Kg,[c.local?(x(),R("span",Hg,"Local")):(x(),R("span",Bg,"Remote")),Q(L)?(x(),R("span",jg,"Subscribed")):de("",!0)])]),s("div",Gg,[s("span",zg,E(j(c.timestamp)),1),c.version?(x(),R("span",Wg,"v"+E(c.version),1)):de("",!0)]),s("div",Jg,[s("pre",null,E(JSON.stringify(c.value,null,2)),1)]),s("div",qg,[s("button",{onClick:P=>M(L),class:"btn btn-sm btn-secondary"},[...h[38]||(h[38]=[s("span",{class:"btn-icon"},"๐",-1),T(" Copy Key ",-1)])],8,Yg),s("button",{onClick:P=>le(L),class:"btn btn-sm btn-secondary"},[...h[39]||(h[39]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh ",-1)])],8,Qg),Q(L)?(x(),R("button",{key:1,onClick:P=>q(L),class:"btn btn-sm btn-warning"},[...h[41]||(h[41]=[s("span",{class:"btn-icon"},"๐",-1),T(" Unsubscribe ",-1)])],8,Zg)):(x(),R("button",{key:0,onClick:P=>ee(L),class:"btn btn-sm btn-success"},[...h[40]||(h[40]=[s("span",{class:"btn-icon"},"๐",-1),T(" Subscribe ",-1)])],8,Xg))])]))),128))]))]),k.value.length>0?(x(),R("div",ev,[h[47]||(h[47]=s("h3",null,"๐ Recent Change Notifications",-1)),s("div",tv,[(x(!0),R($e,null,Pe(k.value.slice().reverse(),L=>(x(),R("div",{key:L.id,class:"notification-item"},[s("div",sv,[s("span",nv,E(L.key),1),s("span",ov,E(j(L.timestamp)),1)]),s("div",iv,[h[42]||(h[42]=s("strong",null,"Old:",-1)),h[43]||(h[43]=T()),s("code",null,E(JSON.stringify(L.oldValue)),1),h[44]||(h[44]=s("br",null,null,-1)),h[45]||(h[45]=s("strong",null,"New:",-1)),h[46]||(h[46]=T()),s("code",null,E(JSON.stringify(L.newValue)),1)])]))),128))]),s("button",{onClick:V,class:"btn btn-secondary btn-sm"}," Clear Notifications ")])):de("",!0),s("div",av,[h[61]||(h[61]=s("h3",null,"๐ DHT Statistics",-1)),s("div",rv,[s("div",lv,[h[50]||(h[50]=s("div",{class:"stat-icon"},"๐๏ธ",-1)),s("div",uv,[h[48]||(h[48]=s("h4",null,"Local Data",-1)),s("div",cv,E(Y.value),1),h[49]||(h[49]=s("div",{class:"stat-meta"},"Keys stored locally",-1))])]),s("div",dv,[h[53]||(h[53]=s("div",{class:"stat-icon"},"๐",-1)),s("div",fv,[h[51]||(h[51]=s("h4",null,"Remote Data",-1)),s("div",pv,E(G.value),1),h[52]||(h[52]=s("div",{class:"stat-meta"},"Keys from other peers",-1))])]),s("div",gv,[h[56]||(h[56]=s("div",{class:"stat-icon"},"๐",-1)),s("div",vv,[h[54]||(h[54]=s("h4",null,"Subscriptions",-1)),s("div",mv,E(y.value.size),1),h[55]||(h[55]=s("div",{class:"stat-meta"},"Active key watchers",-1))])]),s("div",bv,[h[59]||(h[59]=s("div",{class:"stat-icon"},"๐",-1)),s("div",hv,[h[57]||(h[57]=s("h4",null,"Notifications",-1)),s("div",yv,E(k.value.length),1),h[58]||(h[58]=s("div",{class:"stat-meta"},"Change notifications received",-1))])])]),A.value?(x(),R("div",wv,[h[60]||(h[60]=s("h4",null,"Detailed DHT Statistics:",-1)),s("pre",Sv,E(JSON.stringify(A.value,null,2)),1)])):de("",!0)]),s("div",{class:"quick-actions"},[h[67]||(h[67]=s("h3",null,"โก Quick Actions",-1)),s("div",{class:"action-buttons"},[s("button",{onClick:ve,class:"btn btn-secondary"},[...h[62]||(h[62]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Store User Preferences ",-1)])]),s("button",{onClick:we,class:"btn btn-secondary"},[...h[63]||(h[63]=[s("span",{class:"btn-icon"},"๐ข",-1),T(" Create Shared Counter ",-1)])]),s("button",{onClick:De,class:"btn btn-secondary"},[...h[64]||(h[64]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Store System Info ",-1)])]),s("button",{onClick:Me,class:"btn btn-secondary"},[...h[65]||(h[65]=[s("span",{class:"btn-icon"},"๐งช",-1),T(" DHT Stress Test ",-1)])]),s("button",{onClick:Te,class:"btn btn-secondary"},[...h[66]||(h[66]=[s("span",{class:"btn-icon"},"๐",-1),T(" Test Replication ",-1)])])])])]))}},kv=_t(Dv,[["__scopeId","data-v-0c00bd67"]]),$v={class:"storage-view"},Cv={class:"storage-operations"},_v={class:"operation-tabs"},Ev={key:0,class:"operation-panel"},Tv={class:"form-group"},xv={class:"form-group"},Rv={class:"form-group"},Lv={class:"option-checkboxes"},Pv={class:"checkbox-label"},Av={class:"checkbox-label"},Mv={class:"checkbox-label"},Iv={class:"checkbox-label"},Nv={key:0,class:"form-group"},Ov={class:"form-group"},Vv=["disabled"],Uv={key:1,class:"operation-panel"},Fv={class:"form-group"},Kv={class:"form-group"},Hv={class:"option-checkboxes"},Bv={class:"checkbox-label"},jv={class:"checkbox-label"},Gv=["disabled"],zv={key:0,class:"result-panel"},Wv={class:"result-content"},Jv={key:2,class:"operation-panel"},qv={class:"form-group"},Yv={class:"form-group"},Qv={class:"form-group"},Xv={class:"option-checkboxes"},Zv={class:"checkbox-label"},em={class:"checkbox-label"},tm={class:"checkbox-label"},sm=["disabled"],nm={key:3,class:"operation-panel"},om={class:"access-section"},im={class:"form-group"},am={class:"form-group"},rm=["value"],lm={class:"access-controls"},um=["disabled"],cm=["disabled"],dm={class:"stored-data"},fm={class:"section-title"},pm={key:0,class:"empty-data"},gm={key:1,class:"data-grid"},vm={class:"data-header"},mm={class:"data-key"},bm={class:"data-badges"},hm={key:0,class:"badge badge-local"},ym={key:1,class:"badge badge-remote"},wm={key:2,class:"badge badge-public"},Sm={key:3,class:"badge badge-private"},Dm={key:4,class:"badge badge-immutable"},km={key:5,class:"badge badge-crdt"},$m={class:"data-meta"},Cm={class:"data-timestamp"},_m={key:0,class:"data-version"},Em={key:1,class:"data-ttl"},Tm={class:"data-content"},xm={class:"data-actions"},Rm=["onClick"],Lm=["onClick"],Pm=["onClick"],Am=["onClick"],Mm=["onClick"],Im={class:"stats-section"},Nm={class:"stats-grid"},Om={class:"stat-card"},Vm={class:"stat-content"},Um={class:"stat-value"},Fm={class:"stat-card"},Km={class:"stat-content"},Hm={class:"stat-value"},Bm={class:"stat-card"},jm={class:"stat-content"},Gm={class:"stat-value"},zm={class:"stat-card"},Wm={class:"stat-content"},Jm={class:"stat-value"},qm={key:0,class:"storage-stats-detail"},Ym={class:"stats-json"},Qm={__name:"StorageView",setup(e){const t=Ct(),n=K("store"),o=K(""),i=K(""),a=K({isPublic:!1,isImmutable:!1,enableCRDT:!1,replicate:!0,encryptionLevel:"standard",ttl:null}),r=K(""),l=K(null),d=K({forceRefresh:!1,includeMetadata:!1}),v=K(""),p=K(""),f=K({createIfNotExists:!1,mergeData:!1,incrementVersion:!0}),y=K(""),k=K(""),N=ce(()=>t.storageData),A=ce(()=>t.storageStats),oe=ce(()=>t.connectedPeersList),Y=ce(()=>t.isConnected),G=ce(()=>Array.from(N.value.values()).filter(L=>L.local).length),J=ce(()=>Array.from(N.value.values()).filter(L=>!L.local).length),X=ce(()=>Array.from(N.value.values()).filter(L=>{var c;return!((c=L.options)!=null&&c.isPublic)}).length),ue=ce(()=>Array.from(N.value.values()).filter(L=>{var c;return(c=L.options)==null?void 0:c.isPublic}).length),be=async()=>{try{let L;try{L=JSON.parse(i.value)}catch{L=i.value}const c={...a.value};c.ttl&&c.ttl<=0&&delete c.ttl,await t.storageStore(o.value,L,c)&&(t.addDebugLog(`Storage STORE successful: ${o.value}`,"success"),o.value="",i.value="",a.value={isPublic:!1,isImmutable:!1,enableCRDT:!1,replicate:!0,encryptionLevel:"standard",ttl:null})}catch(L){t.addDebugLog(`Storage STORE failed: ${L.message}`,"error")}},fe=async()=>{try{const L={...d.value},c=await t.storageRetrieve(r.value,L);l.value=c,c!==null?t.addDebugLog(`Storage RETRIEVE successful: ${r.value}`,"success"):t.addDebugLog(`Storage RETRIEVE returned null for key: ${r.value}`,"warning")}catch(L){t.addDebugLog(`Storage RETRIEVE failed: ${L.message}`,"error"),l.value=null}},Q=async()=>{var L;try{let c;try{c=JSON.parse(p.value)}catch{c=p.value}(L=t.mesh)!=null&&L.distributedStorage&&await t.mesh.distributedStorage.update(v.value,c,f.value)&&(t.addDebugLog(`Storage UPDATE successful: ${v.value}`,"success"),v.value="",p.value="")}catch(c){t.addDebugLog(`Storage UPDATE failed: ${c.message}`,"error")}},O=async()=>{var L;try{(L=t.mesh)!=null&&L.distributedStorage&&(await t.mesh.distributedStorage.grantAccess(y.value,k.value),t.addDebugLog(`Access granted to ${k.value.substring(0,8)}... for key: ${y.value}`,"success"))}catch(c){t.addDebugLog(`Failed to grant access: ${c.message}`,"error")}},ee=async()=>{var L;try{(L=t.mesh)!=null&&L.distributedStorage&&(await t.mesh.distributedStorage.revokeAccess(y.value,k.value),t.addDebugLog(`Access revoked from ${k.value.substring(0,8)}... for key: ${y.value}`,"success"))}catch(c){t.addDebugLog(`Failed to revoke access: ${c.message}`,"error")}},q=async()=>{var L;for(const c of N.value.keys())await z(c);(L=t.mesh)!=null&&L.distributedStorage&&(t.storageStats=await t.getStorageStats()),t.addDebugLog("Refreshed all storage data","info")},z=async L=>{try{await t.storageRetrieve(L,{forceRefresh:!0})!==null&&t.addDebugLog(`Refreshed storage key: ${L}`,"success")}catch(c){t.addDebugLog(`Failed to refresh storage key ${L}: ${c.message}`,"error")}},le=()=>{t.storageData.clear(),t.addDebugLog("Cleared local storage data","info")},he=async L=>{try{await navigator.clipboard.writeText(L),t.addDebugLog(`Copied key to clipboard: ${L}`,"success")}catch{t.addDebugLog("Failed to copy to clipboard","error")}},M=(L,c)=>{v.value=L,p.value=JSON.stringify(c.value,null,2),n.value="update",t.addDebugLog(`Editing data: ${L}`,"info")},V=L=>{y.value=L,n.value="access",t.addDebugLog(`Viewing access control for: ${L}`,"info")},j=async L=>{var c;if(confirm(`Are you sure you want to delete "${L}"?`))try{(c=t.mesh)!=null&&c.distributedStorage&&(await t.mesh.distributedStorage.delete(L),t.storageData.delete(L),t.addDebugLog(`Deleted storage key: ${L}`,"success"))}catch(P){t.addDebugLog(`Failed to delete storage key ${L}: ${P.message}`,"error")}},ve=()=>{const L={};for(const[pe,m]of N.value)L[pe]={value:m.value,timestamp:m.timestamp,options:m.options,local:m.local};const c=JSON.stringify(L,null,2),P=new Blob([c],{type:"application/json"}),B=URL.createObjectURL(P),te=document.createElement("a");te.href=B,te.download=`peerpigeon-storage-${Date.now()}.json`,document.body.appendChild(te),te.click(),document.body.removeChild(te),URL.revokeObjectURL(B),t.addDebugLog("Storage data exported","success")},we=L=>new Date(L).toLocaleTimeString(),De=async()=>{const L={name:"Alice Smith",email:"alice@example.com",avatar:"https://avatars.dicebear.com/api/avataaars/alice.svg",preferences:{theme:"dark",notifications:!0,language:"en"},created:Date.now(),lastUpdated:Date.now()};await t.storageStore("user:profile",L,{isPublic:!1,isImmutable:!1,enableCRDT:!1,replicate:!0}),t.addDebugLog("Created user profile in storage","success")},Me=async()=>{const L={title:"Shared Document",content:"This is a shared document that supports collaborative editing.",authors:[t.peerId.substring(0,8)+"..."],created:Date.now(),lastModified:Date.now(),version:1};await t.storageStore("doc:shared",L,{isPublic:!0,isImmutable:!1,enableCRDT:!0,replicate:!0}),t.addDebugLog("Created shared document in storage","success")},Te=async()=>{const L={appName:"PeerPigeon Vue Demo",version:"1.0.0",features:{messaging:!0,media:!0,dht:!0,storage:!0,crypto:!0},limits:{maxPeers:10,maxMessageSize:1048576,maxStorageSize:104857600},created:Date.now()};await t.storageStore("config:app",L,{isPublic:!0,isImmutable:!0,enableCRDT:!1,replicate:!0}),t.addDebugLog("Created config file in storage","success")},re=async()=>{const L={document:"collaborative-demo",participants:[t.peerId.substring(0,8)+"..."],content:{title:"Collaborative Demo",sections:[{id:1,author:t.peerId.substring(0,8)+"...",content:"This section was created by the first participant.",timestamp:Date.now()}]},metadata:{created:Date.now(),lastModified:Date.now(),crdtVersion:1}};await t.storageStore("collab:demo",L,{isPublic:!0,isImmutable:!1,enableCRDT:!0,replicate:!0}),t.addDebugLog("Created collaboration demo in storage","success")},D=async()=>{const L={secret:"This is sensitive information",keys:["key1","key2","key3"],metadata:{classification:"confidential",owner:t.peerId.substring(0,8)+"...",created:Date.now()}};await t.storageStore("test:encryption",L,{isPublic:!1,isImmutable:!1,enableCRDT:!1,replicate:!0,encryptionLevel:"high"}),t.addDebugLog("Created encryption test data in storage","success")},h=async()=>{const L={message:"This data requires explicit access permissions",level:"restricted",owner:t.peerId.substring(0,8)+"...",created:Date.now(),accessLog:[]};await t.storageStore("access:restricted",L,{isPublic:!1,isImmutable:!1,enableCRDT:!1,replicate:!0}),t.addDebugLog("Created access control demo data in storage","success")};return Ut(async()=>{try{t.storageStats=await t.getStorageStats()}catch(L){console.warn("Failed to load storage stats:",L)}}),(L,c)=>(x(),R("div",$v,[c[91]||(c[91]=s("div",{class:"section-header"},[s("h2",null,"๐ฆ Distributed Storage Layer"),s("p",null,"Encrypted, access-controlled storage with CRDT support for collaborative editing")],-1)),s("div",Cv,[c[60]||(c[60]=s("h3",null,"๐พ Storage Operations",-1)),s("div",_v,[s("button",{onClick:c[0]||(c[0]=P=>n.value="store"),class:Se(["tab-btn",{active:n.value==="store"}])}," STORE ",2),s("button",{onClick:c[1]||(c[1]=P=>n.value="retrieve"),class:Se(["tab-btn",{active:n.value==="retrieve"}])}," RETRIEVE ",2),s("button",{onClick:c[2]||(c[2]=P=>n.value="update"),class:Se(["tab-btn",{active:n.value==="update"}])}," UPDATE ",2),s("button",{onClick:c[3]||(c[3]=P=>n.value="access"),class:Se(["tab-btn",{active:n.value==="access"}])}," ACCESS CONTROL ",2)]),n.value==="store"?(x(),R("div",Ev,[c[33]||(c[33]=s("h4",null,"๐พ Store Data",-1)),c[34]||(c[34]=s("p",{class:"operation-description"}," Store data with encryption, access control, and optional immutability. Data is automatically distributed across the mesh. ",-1)),s("div",Tv,[c[22]||(c[22]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":c[4]||(c[4]=P=>o.value=P),placeholder:"e.g., user:profile, doc:shared, config:app",class:"form-input"},null,512),[[ke,o.value]])]),s("div",xv,[c[23]||(c[23]=s("label",null,"Value (JSON):",-1)),ae(s("textarea",{"onUpdate:modelValue":c[5]||(c[5]=P=>i.value=P),placeholder:'{"name": "Alice", "email": "alice@example.com"}',rows:"6",class:"form-textarea"},null,512),[[ke,i.value]])]),s("div",Rv,[c[28]||(c[28]=s("label",null,"Storage Options:",-1)),s("div",Lv,[s("label",Pv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[6]||(c[6]=P=>a.value.isPublic=P)},null,512),[[Ke,a.value.isPublic]]),c[24]||(c[24]=T(" Public (not encrypted, anyone can read) ",-1))]),s("label",Av,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[7]||(c[7]=P=>a.value.isImmutable=P)},null,512),[[Ke,a.value.isImmutable]]),c[25]||(c[25]=T(" Immutable (cannot be modified after creation) ",-1))]),s("label",Mv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[8]||(c[8]=P=>a.value.enableCRDT=P)},null,512),[[Ke,a.value.enableCRDT]]),c[26]||(c[26]=T(" Enable CRDT (collaborative editing support) ",-1))]),s("label",Iv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[9]||(c[9]=P=>a.value.replicate=P)},null,512),[[Ke,a.value.replicate]]),c[27]||(c[27]=T(" Replicate across mesh ",-1))])])]),a.value.isPublic?de("",!0):(x(),R("div",Nv,[c[30]||(c[30]=s("label",null,"Encryption Level:",-1)),ae(s("select",{"onUpdate:modelValue":c[10]||(c[10]=P=>a.value.encryptionLevel=P),class:"form-select"},[...c[29]||(c[29]=[s("option",{value:"standard"},"Standard Encryption",-1),s("option",{value:"high"},"High Security",-1),s("option",{value:"group"},"Group Encryption",-1)])],512),[[Oe,a.value.encryptionLevel]])])),s("div",Ov,[c[31]||(c[31]=s("label",null,"TTL (seconds, optional):",-1)),ae(s("input",{"onUpdate:modelValue":c[11]||(c[11]=P=>a.value.ttl=P),type:"number",placeholder:"Leave empty for no expiration",class:"form-input"},null,512),[[ke,a.value.ttl,void 0,{number:!0}]])]),s("button",{onClick:be,disabled:!o.value||!i.value||!Y.value,class:"btn btn-primary"},[...c[32]||(c[32]=[s("span",{class:"btn-icon"},"๐พ",-1),T(" Store Data ",-1)])],8,Vv)])):de("",!0),n.value==="retrieve"?(x(),R("div",Uv,[c[41]||(c[41]=s("h4",null,"๐ฅ Retrieve Data",-1)),c[42]||(c[42]=s("p",{class:"operation-description"}," Retrieve encrypted data with automatic decryption based on your access permissions. ",-1)),s("div",Fv,[c[35]||(c[35]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":c[12]||(c[12]=P=>r.value=P),placeholder:"Enter key to retrieve",class:"form-input"},null,512),[[ke,r.value]])]),s("div",Kv,[c[38]||(c[38]=s("label",null,"Retrieve Options:",-1)),s("div",Hv,[s("label",Bv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[13]||(c[13]=P=>d.value.forceRefresh=P)},null,512),[[Ke,d.value.forceRefresh]]),c[36]||(c[36]=T(" Force refresh from network ",-1))]),s("label",jv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[14]||(c[14]=P=>d.value.includeMetadata=P)},null,512),[[Ke,d.value.includeMetadata]]),c[37]||(c[37]=T(" Include metadata ",-1))])])]),s("button",{onClick:fe,disabled:!r.value||!Y.value,class:"btn btn-primary"},[...c[39]||(c[39]=[s("span",{class:"btn-icon"},"๐",-1),T(" Retrieve Data ",-1)])],8,Gv),l.value?(x(),R("div",zv,[c[40]||(c[40]=s("h5",null,"Retrieved Data:",-1)),s("pre",Wv,E(JSON.stringify(l.value,null,2)),1)])):de("",!0)])):de("",!0),n.value==="update"?(x(),R("div",Jv,[c[50]||(c[50]=s("h4",null,"๐ Update Existing Data",-1)),c[51]||(c[51]=s("p",{class:"operation-description"}," Update data you own or contribute to CRDT-enabled collaborative documents. ",-1)),s("div",qv,[c[43]||(c[43]=s("label",null,"Key:",-1)),ae(s("input",{"onUpdate:modelValue":c[15]||(c[15]=P=>v.value=P),placeholder:"Key to update",class:"form-input"},null,512),[[ke,v.value]])]),s("div",Yv,[c[44]||(c[44]=s("label",null,"New Value (JSON):",-1)),ae(s("textarea",{"onUpdate:modelValue":c[16]||(c[16]=P=>p.value=P),placeholder:'{"name": "Alice Smith", "updated": true}',rows:"6",class:"form-textarea"},null,512),[[ke,p.value]])]),s("div",Qv,[c[48]||(c[48]=s("label",null,"Update Options:",-1)),s("div",Xv,[s("label",Zv,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[17]||(c[17]=P=>f.value.createIfNotExists=P)},null,512),[[Ke,f.value.createIfNotExists]]),c[45]||(c[45]=T(" Create if doesn't exist ",-1))]),s("label",em,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[18]||(c[18]=P=>f.value.mergeData=P)},null,512),[[Ke,f.value.mergeData]]),c[46]||(c[46]=T(" Merge with existing data ",-1))]),s("label",tm,[ae(s("input",{type:"checkbox","onUpdate:modelValue":c[19]||(c[19]=P=>f.value.incrementVersion=P)},null,512),[[Ke,f.value.incrementVersion]]),c[47]||(c[47]=T(" Increment version ",-1))])])]),s("button",{onClick:Q,disabled:!v.value||!p.value||!Y.value,class:"btn btn-primary"},[...c[49]||(c[49]=[s("span",{class:"btn-icon"},"๐",-1),T(" Update Data ",-1)])],8,sm)])):de("",!0),n.value==="access"?(x(),R("div",nm,[c[58]||(c[58]=s("h4",null,"๐ Access Control",-1)),c[59]||(c[59]=s("p",{class:"operation-description"}," Grant or revoke access to your private data for specific peers. ",-1)),s("div",om,[c[57]||(c[57]=s("h5",null,"Grant Access",-1)),s("div",im,[c[52]||(c[52]=s("label",null,"Data Key:",-1)),ae(s("input",{"onUpdate:modelValue":c[20]||(c[20]=P=>y.value=P),placeholder:"Key to grant access to",class:"form-input"},null,512),[[ke,y.value]])]),s("div",am,[c[54]||(c[54]=s("label",null,"Peer ID:",-1)),ae(s("select",{"onUpdate:modelValue":c[21]||(c[21]=P=>k.value=P),class:"form-select"},[c[53]||(c[53]=s("option",{value:""},"Select a peer...",-1)),(x(!0),R($e,null,Pe(oe.value,P=>(x(),R("option",{key:P.id,value:P.id},E(P.id.substring(0,16))+"... ("+E(P.status)+") ",9,rm))),128))],512),[[Oe,k.value]])]),s("div",lm,[s("button",{onClick:O,disabled:!y.value||!k.value||!Y.value,class:"btn btn-success"},[...c[55]||(c[55]=[s("span",{class:"btn-icon"},"โ
",-1),T(" Grant Access ",-1)])],8,um),s("button",{onClick:ee,disabled:!y.value||!k.value||!Y.value,class:"btn btn-danger"},[...c[56]||(c[56]=[s("span",{class:"btn-icon"},"โ",-1),T(" Revoke Access ",-1)])],8,cm)])])])):de("",!0)]),s("div",dm,[s("div",fm,[s("h3",null,"๐ Stored Data ("+E(N.value.size)+")",1),s("div",{class:"data-controls"},[s("button",{onClick:q,class:"btn btn-secondary"},[...c[61]||(c[61]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh All ",-1)])]),s("button",{onClick:ve,class:"btn btn-secondary"},[...c[62]||(c[62]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Export ",-1)])]),s("button",{onClick:le,class:"btn btn-danger"},[...c[63]||(c[63]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Clear Local ",-1)])])])]),N.value.size===0?(x(),R("div",pm,[...c[64]||(c[64]=[s("div",{class:"empty-icon"},"๐ญ",-1),s("p",null,"No data stored yet",-1),s("p",{class:"empty-meta"},"Store some data using the STORE operation above",-1)])])):(x(),R("div",gm,[(x(!0),R($e,null,Pe(Array.from(N.value.entries()),([P,B])=>{var te,pe,m,b,C;return x(),R("div",{key:P,class:"data-item"},[s("div",vm,[s("h4",mm,E(P),1),s("div",bm,[B.local?(x(),R("span",hm,"Local")):(x(),R("span",ym,"Remote")),(te=B.options)!=null&&te.isPublic?(x(),R("span",wm,"Public")):(x(),R("span",Sm,"Private")),(pe=B.options)!=null&&pe.isImmutable?(x(),R("span",Dm,"Immutable")):de("",!0),(m=B.options)!=null&&m.enableCRDT?(x(),R("span",km,"CRDT")):de("",!0)])]),s("div",$m,[s("span",Cm,E(we(B.timestamp)),1),B.version?(x(),R("span",_m,"v"+E(B.version),1)):de("",!0),(b=B.options)!=null&&b.ttl?(x(),R("span",Em,"TTL: "+E(B.options.ttl)+"s",1)):de("",!0)]),s("div",Tm,[s("pre",null,E(JSON.stringify(B.value,null,2)),1)]),s("div",xm,[s("button",{onClick:U=>he(P),class:"btn btn-sm btn-secondary"},[...c[65]||(c[65]=[s("span",{class:"btn-icon"},"๐",-1),T(" Copy Key ",-1)])],8,Rm),s("button",{onClick:U=>z(P),class:"btn btn-sm btn-secondary"},[...c[66]||(c[66]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh ",-1)])],8,Lm),B.local&&!((C=B.options)!=null&&C.isImmutable)?(x(),R("button",{key:0,onClick:U=>M(P,B),class:"btn btn-sm btn-primary"},[...c[67]||(c[67]=[s("span",{class:"btn-icon"},"โ๏ธ",-1),T(" Edit ",-1)])],8,Pm)):de("",!0),B.local?(x(),R("button",{key:1,onClick:U=>V(P),class:"btn btn-sm btn-info"},[...c[68]||(c[68]=[s("span",{class:"btn-icon"},"๐",-1),T(" Access ",-1)])],8,Am)):de("",!0),B.local?(x(),R("button",{key:2,onClick:U=>j(P),class:"btn btn-sm btn-danger"},[...c[69]||(c[69]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Delete ",-1)])],8,Mm)):de("",!0)])])}),128))]))]),s("div",Im,[c[83]||(c[83]=s("h3",null,"๐ Storage Statistics",-1)),s("div",Nm,[s("div",Om,[c[72]||(c[72]=s("div",{class:"stat-icon"},"๐พ",-1)),s("div",Vm,[c[70]||(c[70]=s("h4",null,"Local Data",-1)),s("div",Um,E(G.value),1),c[71]||(c[71]=s("div",{class:"stat-meta"},"Items stored locally",-1))])]),s("div",Fm,[c[75]||(c[75]=s("div",{class:"stat-icon"},"๐",-1)),s("div",Km,[c[73]||(c[73]=s("h4",null,"Remote Data",-1)),s("div",Hm,E(J.value),1),c[74]||(c[74]=s("div",{class:"stat-meta"},"Items from other peers",-1))])]),s("div",Bm,[c[78]||(c[78]=s("div",{class:"stat-icon"},"๐",-1)),s("div",jm,[c[76]||(c[76]=s("h4",null,"Private Items",-1)),s("div",Gm,E(X.value),1),c[77]||(c[77]=s("div",{class:"stat-meta"},"Encrypted data",-1))])]),s("div",zm,[c[81]||(c[81]=s("div",{class:"stat-icon"},"๐",-1)),s("div",Wm,[c[79]||(c[79]=s("h4",null,"Public Items",-1)),s("div",Jm,E(ue.value),1),c[80]||(c[80]=s("div",{class:"stat-meta"},"Unencrypted data",-1))])])]),A.value?(x(),R("div",qm,[c[82]||(c[82]=s("h4",null,"Detailed Storage Statistics:",-1)),s("pre",Ym,E(JSON.stringify(A.value,null,2)),1)])):de("",!0)]),s("div",{class:"quick-actions"},[c[90]||(c[90]=s("h3",null,"โก Quick Storage Actions",-1)),s("div",{class:"action-buttons"},[s("button",{onClick:De,class:"btn btn-secondary"},[...c[84]||(c[84]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Create User Profile ",-1)])]),s("button",{onClick:Me,class:"btn btn-secondary"},[...c[85]||(c[85]=[s("span",{class:"btn-icon"},"๐",-1),T(" Create Shared Document ",-1)])]),s("button",{onClick:Te,class:"btn btn-secondary"},[...c[86]||(c[86]=[s("span",{class:"btn-icon"},"โ๏ธ",-1),T(" Create Config File ",-1)])]),s("button",{onClick:re,class:"btn btn-secondary"},[...c[87]||(c[87]=[s("span",{class:"btn-icon"},"๐ฅ",-1),T(" Demo Collaboration ",-1)])]),s("button",{onClick:D,class:"btn btn-secondary"},[...c[88]||(c[88]=[s("span",{class:"btn-icon"},"๐",-1),T(" Test Encryption ",-1)])]),s("button",{onClick:h,class:"btn btn-secondary"},[...c[89]||(c[89]=[s("span",{class:"btn-icon"},"๐",-1),T(" Demo Access Control ",-1)])])])])]))}},Xm=_t(Qm,[["__scopeId","data-v-5babeb99"]]),Zm={class:"crypto-view"},eb={class:"crypto-operations"},tb={class:"operation-tabs"},sb={key:0,class:"operation-panel"},nb={class:"key-generation"},ob={class:"form-group"},ib={key:0,class:"form-group"},ab={key:1,class:"form-group"},rb={class:"form-group"},lb=["disabled"],ub={class:"key-import"},cb={class:"form-group"},db={class:"form-group"},fb=["disabled"],pb={key:1,class:"operation-panel"},gb={class:"encrypt-section"},vb={class:"form-group"},mb={class:"form-group"},bb=["value"],hb={class:"form-group"},yb=["disabled"],wb={key:0,class:"result-panel"},Sb={class:"result-content"},Db={class:"decrypt-section"},kb={class:"form-group"},$b={class:"form-group"},Cb=["value"],_b=["disabled"],Eb={key:0,class:"result-panel"},Tb={class:"result-content"},xb={key:2,class:"operation-panel"},Rb={class:"sign-section"},Lb={class:"form-group"},Pb={class:"form-group"},Ab=["value"],Mb={class:"form-group"},Ib=["disabled"],Nb={key:0,class:"result-panel"},Ob={class:"result-content"},Vb={class:"verify-section"},Ub={class:"form-group"},Fb={class:"form-group"},Kb={class:"form-group"},Hb=["value"],Bb=["disabled"],jb={key:0,class:"result-panel"},Gb={class:"result-icon"},zb={key:3,class:"operation-panel"},Wb={class:"exchange-section"},Jb={class:"form-group"},qb=["value"],Yb={class:"form-group"},Qb={class:"form-group"},Xb=["disabled"],Zb={class:"shared-secrets"},eh={key:0,class:"empty-secrets"},th={key:1,class:"secrets-list"},sh={class:"secret-header"},nh={class:"secret-badges"},oh={class:"badge badge-method"},ih={class:"badge badge-status"},ah={class:"secret-details"},rh={class:"secret-peer"},lh={class:"secret-created"},uh={class:"secret-key"},ch={class:"secret-actions"},dh=["onClick"],fh=["onClick"],ph={class:"key-management-display"},gh={class:"section-title"},vh={key:0,class:"empty-keys"},mh={key:1,class:"keys-grid"},bh={class:"key-header"},hh={class:"key-name"},yh={class:"key-badges"},wh={class:"badge badge-type"},Sh={key:0,class:"badge badge-usage"},Dh={key:1,class:"badge badge-usage"},kh={key:2,class:"badge badge-extractable"},$h={class:"key-details"},Ch={class:"key-id"},_h={class:"key-algorithm"},Eh={key:0,class:"key-size"},Th={class:"key-created"},xh={class:"key-fingerprint"},Rh={class:"fingerprint"},Lh={class:"key-actions"},Ph=["onClick"],Ah=["onClick"],Mh=["onClick"],Ih=["onClick"],Nh={class:"crypto-stats"},Oh={class:"stats-grid"},Vh={class:"stat-card"},Uh={class:"stat-content"},Fh={class:"stat-value"},Kh={class:"stat-card"},Hh={class:"stat-content"},Bh={class:"stat-value"},jh={class:"stat-card"},Gh={class:"stat-content"},zh={class:"stat-value"},Wh={class:"stat-card"},Jh={class:"stat-content"},qh={class:"stat-value"},Yh={__name:"CryptoView",setup(e){const t=Ct(),n=K("keys"),o=K({type:"RSA",size:2048,name:""}),i=K(!1),a=K(""),r=K(""),l=K(""),d=K(""),v=K({algorithm:"RSA-OAEP"}),p=K(""),f=K(""),y=K(""),k=K(""),N=K(""),A=K(""),oe=K({hashAlg:"SHA-256"}),Y=K(""),G=K(""),J=K(""),X=K(""),ue=K(null),be=K(""),fe=K({method:"ECDH",purpose:""}),Q=K([]),O=K(0),ee=K(0),q=ce(()=>t.cryptoKeys),z=ce(()=>t.connectedPeersList),le=ce(()=>q.value.filter(_=>_.usage.includes("encrypt")||_.usage.includes("decrypt"))),he=ce(()=>q.value.filter(_=>_.usage.includes("sign"))),M=ce(()=>q.value.filter(_=>_.usage.includes("verify"))),V=async()=>{i.value=!0;try{await t.cryptoGenerateKey(o.value.type,o.value.size,o.value.name)&&(t.addDebugLog(`Generated ${o.value.type} key pair: ${o.value.name}`,"success"),o.value.name="")}catch(_){t.addDebugLog(`Key generation failed: ${_.message}`,"error")}finally{i.value=!1}},j=async()=>{try{await t.cryptoImportKey(a.value,r.value)&&(t.addDebugLog(`Imported key: ${r.value}`,"success"),a.value="",r.value="")}catch(_){t.addDebugLog(`Key import failed: ${_.message}`,"error")}},ve=async()=>{try{const _=await t.cryptoEncrypt(l.value,d.value,v.value);_&&(p.value=_,O.value++,t.addDebugLog("Encryption successful","success"))}catch(_){t.addDebugLog(`Encryption failed: ${_.message}`,"error")}},we=async()=>{try{const _=await t.cryptoDecrypt(f.value,y.value);_&&(k.value=_,t.addDebugLog("Decryption successful","success"))}catch(_){t.addDebugLog(`Decryption failed: ${_.message}`,"error")}},De=async()=>{try{const _=await t.cryptoSign(N.value,A.value,oe.value);_&&(Y.value=_,ee.value++,t.addDebugLog("Data signing successful","success"))}catch(_){t.addDebugLog(`Signing failed: ${_.message}`,"error")}},Me=async()=>{try{const _=await t.cryptoVerify(G.value,J.value,X.value);ue.value=_,ee.value++;const u=_?"Signature verification successful":"Signature verification failed",$=_?"success":"warning";t.addDebugLog(u,$)}catch(_){ue.value=!1,t.addDebugLog(`Signature verification error: ${_.message}`,"error")}},Te=async()=>{try{const _=await t.cryptoKeyExchange(be.value,fe.value.method,fe.value.purpose);_&&(Q.value.push({id:Date.now().toString(),peerId:be.value,method:fe.value.method,purpose:fe.value.purpose,keyId:_.keyId,status:"active",created:Date.now()}),t.addDebugLog(`Key exchange initiated with ${be.value.substring(0,8)}...`,"success"),be.value="",fe.value.purpose="")}catch(_){t.addDebugLog(`Key exchange failed: ${_.message}`,"error")}},re=_=>{d.value=_.keyId,n.value="encrypt",t.addDebugLog(`Using shared secret for encryption: ${_.purpose}`,"info")},D=_=>{const u=Q.value.findIndex($=>$.id===_);u!==-1&&(Q.value.splice(u,1),t.addDebugLog("Shared secret revoked","info"))},h=async()=>{try{await t.cryptoRefreshKeys(),t.addDebugLog("Key store refreshed","success")}catch(_){t.addDebugLog(`Failed to refresh keys: ${_.message}`,"error")}},L=()=>{const _={keys:q.value.filter(w=>w.extractable),exported:Date.now(),version:"1.0"},u=JSON.stringify(_,null,2),$=new Blob([u],{type:"application/json"}),W=URL.createObjectURL($),ie=document.createElement("a");ie.href=W,ie.download=`peerpigeon-keys-${Date.now()}.json`,document.body.appendChild(ie),ie.click(),document.body.removeChild(ie),URL.revokeObjectURL(W),t.addDebugLog("Keys exported","success")},c=()=>{confirm("Are you sure you want to clear all keys? This cannot be undone.")&&(t.cryptoKeys.splice(0),t.addDebugLog("All keys cleared","warning"))},P=async _=>{try{const u=await t.cryptoExportKey(_.id);if(u){const $=JSON.stringify(u,null,2),W=new Blob([$],{type:"application/json"}),ie=URL.createObjectURL(W),w=document.createElement("a");w.href=ie,w.download=`${_.name}-${Date.now()}.json`,document.body.appendChild(w),w.click(),document.body.removeChild(w),URL.revokeObjectURL(ie),t.addDebugLog(`Exported key: ${_.name}`,"success")}}catch(u){t.addDebugLog(`Key export failed: ${u.message}`,"error")}},B=async _=>{try{await navigator.clipboard.writeText(_),t.addDebugLog("Key ID copied to clipboard","success")}catch{t.addDebugLog("Failed to copy to clipboard","error")}},te=async _=>{try{await navigator.clipboard.writeText(_),t.addDebugLog("Copied to clipboard","success")}catch{t.addDebugLog("Failed to copy to clipboard","error")}},pe=_=>{t.addDebugLog(`Key Details: ${JSON.stringify(_,null,2)}`,"info")},m=async _=>{if(confirm("Are you sure you want to delete this key?"))try{await t.cryptoDeleteKey(_),t.addDebugLog("Key deleted","success")}catch(u){t.addDebugLog(`Key deletion failed: ${u.message}`,"error")}},b=_=>new Date(_).toLocaleTimeString(),C=async()=>{const _=[{type:"RSA",size:2048,name:"test-rsa-2048"},{type:"ECDSA",size:256,name:"test-ecdsa-p256"},{type:"Ed25519",size:null,name:"test-ed25519"},{type:"AES",size:256,name:"test-aes-256"}];for(const u of _)try{await t.cryptoGenerateKey(u.type,u.size,u.name)}catch($){console.warn(`Failed to generate ${u.name}:`,$)}t.addDebugLog("Generated test key suite","success")},U=async()=>{const _="This is a test message for encryption demonstration.",u=le.value[0];if(!u){t.addDebugLog("No encryption keys available for test","warning");return}try{const $=await t.cryptoEncrypt(_,u.id,{algorithm:"RSA-OAEP"});if(!$)return;const ie=await t.cryptoDecrypt($,u.id)===_,w=ie?"Encryption test passed":"Encryption test failed";t.addDebugLog(w,ie?"success":"error"),O.value+=2}catch($){t.addDebugLog(`Encryption test failed: ${$.message}`,"error")}},H=async()=>{const _="This is a test message for signing demonstration.",u=he.value[0],$=M.value[0];if(!u||!$){t.addDebugLog("No signing/verification keys available for test","warning");return}try{const W=await t.cryptoSign(_,u.id,{hashAlg:"SHA-256"});if(!W)return;const ie=await t.cryptoVerify(_,W,$.id),w=ie?"Signing test passed":"Signing test failed";t.addDebugLog(w,ie?"success":"error"),ee.value+=2}catch(W){t.addDebugLog(`Signing test failed: ${W.message}`,"error")}},F=async()=>{if(t.addDebugLog("Key exchange demo - requires connected peers","info"),z.value.length===0){t.addDebugLog("No connected peers available for key exchange demo","warning");return}const _=z.value[0];try{await Te(_.id,"ECDH","demo-exchange")}catch(u){t.addDebugLog(`Key exchange demo failed: ${u.message}`,"error")}},se=async()=>{t.addDebugLog("Running cryptographic benchmarks...","info");const _=performance.now();try{await t.cryptoGenerateKey("AES",256,"benchmark-key");const u="Benchmark test data";for(let ie=0;ie<10;ie++){const w=le.value.find(S=>S.name==="benchmark-key");w&&await t.cryptoEncrypt(u,w.id,{algorithm:"AES-GCM"})}const $=performance.now(),W=Math.round($-_);t.addDebugLog(`Benchmark completed in ${W}ms`,"success")}catch(u){t.addDebugLog(`Benchmark failed: ${u.message}`,"error")}},Z=async()=>{const _=[];try{window.crypto&&window.crypto.subtle?_.push("โ
Web Crypto API"):_.push("โ Web Crypto API");const u=["RSA-OAEP","AES-GCM","ECDSA","Ed25519"];for(const $ of u)try{_.push(`โ
${$}`)}catch{_.push(`โ ${$}`)}t.addDebugLog(`Crypto Support:
|
|
30
|
+
${_.join(`
|
|
31
|
+
`)}`,"info")}catch(u){t.addDebugLog(`Crypto validation failed: ${u.message}`,"error")}};return Ut(async()=>{try{await t.initializeCrypto()}catch(_){console.warn("Failed to initialize crypto:",_)}}),(_,u)=>(x(),R("div",Zm,[u[118]||(u[118]=s("div",{class:"section-header"},[s("h2",null,"๐ Cryptographic Features"),s("p",null,"Key management, encryption/decryption, and secure peer communications")],-1)),s("div",eb,[u[88]||(u[88]=s("h3",null,"๐ Cryptographic Operations",-1)),s("div",tb,[s("button",{onClick:u[0]||(u[0]=$=>n.value="keys"),class:Se(["tab-btn",{active:n.value==="keys"}])}," KEY MANAGEMENT ",2),s("button",{onClick:u[1]||(u[1]=$=>n.value="encrypt"),class:Se(["tab-btn",{active:n.value==="encrypt"}])}," ENCRYPT/DECRYPT ",2),s("button",{onClick:u[2]||(u[2]=$=>n.value="signatures"),class:Se(["tab-btn",{active:n.value==="signatures"}])}," SIGNATURES ",2),s("button",{onClick:u[3]||(u[3]=$=>n.value="exchange"),class:Se(["tab-btn",{active:n.value==="exchange"}])}," KEY EXCHANGE ",2)]),n.value==="keys"?(x(),R("div",sb,[u[39]||(u[39]=s("h4",null,"๐ Key Management",-1)),u[40]||(u[40]=s("p",{class:"operation-description"}," Generate, import, export, and manage cryptographic keys. PeerPigeon supports multiple key types and algorithms. ",-1)),s("div",nb,[u[34]||(u[34]=s("h5",null,"Generate New Key Pair",-1)),s("div",ob,[u[27]||(u[27]=s("label",null,"Key Type:",-1)),ae(s("select",{"onUpdate:modelValue":u[4]||(u[4]=$=>o.value.type=$),class:"form-select"},[...u[26]||(u[26]=[s("option",{value:"RSA"},"RSA (Asymmetric)",-1),s("option",{value:"ECDSA"},"ECDSA (Elliptic Curve)",-1),s("option",{value:"Ed25519"},"Ed25519 (Edwards Curve)",-1),s("option",{value:"AES"},"AES (Symmetric)",-1)])],512),[[Oe,o.value.type]])]),o.value.type==="RSA"?(x(),R("div",ib,[u[29]||(u[29]=s("label",null,"Key Size:",-1)),ae(s("select",{"onUpdate:modelValue":u[5]||(u[5]=$=>o.value.size=$),class:"form-select"},[...u[28]||(u[28]=[s("option",{value:"2048"},"2048 bits",-1),s("option",{value:"3072"},"3072 bits",-1),s("option",{value:"4096"},"4096 bits",-1)])],512),[[Oe,o.value.size]])])):de("",!0),o.value.type==="AES"?(x(),R("div",ab,[u[31]||(u[31]=s("label",null,"Key Length:",-1)),ae(s("select",{"onUpdate:modelValue":u[6]||(u[6]=$=>o.value.size=$),class:"form-select"},[...u[30]||(u[30]=[s("option",{value:"128"},"128 bits",-1),s("option",{value:"192"},"192 bits",-1),s("option",{value:"256"},"256 bits",-1)])],512),[[Oe,o.value.size]])])):de("",!0),s("div",rb,[u[32]||(u[32]=s("label",null,"Key Name/Label:",-1)),ae(s("input",{"onUpdate:modelValue":u[7]||(u[7]=$=>o.value.name=$),placeholder:"e.g., my-signing-key, backup-key",class:"form-input"},null,512),[[ke,o.value.name]])]),s("button",{onClick:V,disabled:!o.value.name||i.value,class:"btn btn-primary"},[u[33]||(u[33]=s("span",{class:"btn-icon"},"๐",-1)),T(" "+E(i.value?"Generating...":"Generate Key Pair"),1)],8,lb)]),s("div",ub,[u[38]||(u[38]=s("h5",null,"Import Existing Key",-1)),s("div",cb,[u[35]||(u[35]=s("label",null,"Key Data (PEM/JWK format):",-1)),ae(s("textarea",{"onUpdate:modelValue":u[8]||(u[8]=$=>a.value=$),placeholder:`-----BEGIN PRIVATE KEY-----
|
|
32
|
+
...
|
|
33
|
+
-----END PRIVATE KEY-----`,rows:"8",class:"form-textarea"},null,512),[[ke,a.value]])]),s("div",db,[u[36]||(u[36]=s("label",null,"Key Name:",-1)),ae(s("input",{"onUpdate:modelValue":u[9]||(u[9]=$=>r.value=$),placeholder:"imported-key",class:"form-input"},null,512),[[ke,r.value]])]),s("button",{onClick:j,disabled:!a.value||!r.value,class:"btn btn-secondary"},[...u[37]||(u[37]=[s("span",{class:"btn-icon"},"๐ฅ",-1),T(" Import Key ",-1)])],8,fb)])])):de("",!0),n.value==="encrypt"?(x(),R("div",pb,[u[56]||(u[56]=s("h4",null,"๐ Encryption & Decryption",-1)),u[57]||(u[57]=s("p",{class:"operation-description"}," Encrypt and decrypt data using various algorithms. Supports both symmetric and asymmetric encryption. ",-1)),s("div",gb,[u[49]||(u[49]=s("h5",null,"Encrypt Data",-1)),s("div",vb,[u[41]||(u[41]=s("label",null,"Data to Encrypt:",-1)),ae(s("textarea",{"onUpdate:modelValue":u[10]||(u[10]=$=>l.value=$),placeholder:"Enter text or JSON data to encrypt",rows:"4",class:"form-textarea"},null,512),[[ke,l.value]])]),s("div",mb,[u[43]||(u[43]=s("label",null,"Encryption Key:",-1)),ae(s("select",{"onUpdate:modelValue":u[11]||(u[11]=$=>d.value=$),class:"form-select"},[u[42]||(u[42]=s("option",{value:""},"Select a key...",-1)),(x(!0),R($e,null,Pe(le.value,$=>(x(),R("option",{key:$.id,value:$.id},E($.name)+" ("+E($.type)+") ",9,bb))),128))],512),[[Oe,d.value]])]),s("div",hb,[u[45]||(u[45]=s("label",null,"Algorithm:",-1)),ae(s("select",{"onUpdate:modelValue":u[12]||(u[12]=$=>v.value.algorithm=$),class:"form-select"},[...u[44]||(u[44]=[s("option",{value:"RSA-OAEP"},"RSA-OAEP",-1),s("option",{value:"AES-GCM"},"AES-GCM",-1),s("option",{value:"AES-CBC"},"AES-CBC",-1)])],512),[[Oe,v.value.algorithm]])]),s("button",{onClick:ve,disabled:!l.value||!d.value,class:"btn btn-primary"},[...u[46]||(u[46]=[s("span",{class:"btn-icon"},"๐",-1),T(" Encrypt Data ",-1)])],8,yb),p.value?(x(),R("div",wb,[u[48]||(u[48]=s("h6",null,"Encrypted Result:",-1)),s("pre",Sb,E(p.value),1),s("button",{onClick:u[13]||(u[13]=$=>te(p.value)),class:"btn btn-sm btn-secondary"},[...u[47]||(u[47]=[s("span",{class:"btn-icon"},"๐",-1),T(" Copy ",-1)])])])):de("",!0)]),s("div",Db,[u[55]||(u[55]=s("h5",null,"Decrypt Data",-1)),s("div",kb,[u[50]||(u[50]=s("label",null,"Encrypted Data:",-1)),ae(s("textarea",{"onUpdate:modelValue":u[14]||(u[14]=$=>f.value=$),placeholder:"Paste encrypted data here",rows:"4",class:"form-textarea"},null,512),[[ke,f.value]])]),s("div",$b,[u[52]||(u[52]=s("label",null,"Decryption Key:",-1)),ae(s("select",{"onUpdate:modelValue":u[15]||(u[15]=$=>y.value=$),class:"form-select"},[u[51]||(u[51]=s("option",{value:""},"Select a key...",-1)),(x(!0),R($e,null,Pe(le.value,$=>(x(),R("option",{key:$.id,value:$.id},E($.name)+" ("+E($.type)+") ",9,Cb))),128))],512),[[Oe,y.value]])]),s("button",{onClick:we,disabled:!f.value||!y.value,class:"btn btn-primary"},[...u[53]||(u[53]=[s("span",{class:"btn-icon"},"๐",-1),T(" Decrypt Data ",-1)])],8,_b),k.value?(x(),R("div",Eb,[u[54]||(u[54]=s("h6",null,"Decrypted Result:",-1)),s("pre",Tb,E(k.value),1)])):de("",!0)])])):de("",!0),n.value==="signatures"?(x(),R("div",xb,[u[73]||(u[73]=s("h4",null,"โ๏ธ Digital Signatures",-1)),u[74]||(u[74]=s("p",{class:"operation-description"}," Create and verify digital signatures to ensure data integrity and authenticity. ",-1)),s("div",Rb,[u[66]||(u[66]=s("h5",null,"Sign Data",-1)),s("div",Lb,[u[58]||(u[58]=s("label",null,"Data to Sign:",-1)),ae(s("textarea",{"onUpdate:modelValue":u[16]||(u[16]=$=>N.value=$),placeholder:"Enter data to create a digital signature",rows:"4",class:"form-textarea"},null,512),[[ke,N.value]])]),s("div",Pb,[u[60]||(u[60]=s("label",null,"Signing Key:",-1)),ae(s("select",{"onUpdate:modelValue":u[17]||(u[17]=$=>A.value=$),class:"form-select"},[u[59]||(u[59]=s("option",{value:""},"Select a signing key...",-1)),(x(!0),R($e,null,Pe(he.value,$=>(x(),R("option",{key:$.id,value:$.id},E($.name)+" ("+E($.type)+") ",9,Ab))),128))],512),[[Oe,A.value]])]),s("div",Mb,[u[62]||(u[62]=s("label",null,"Hash Algorithm:",-1)),ae(s("select",{"onUpdate:modelValue":u[18]||(u[18]=$=>oe.value.hashAlg=$),class:"form-select"},[...u[61]||(u[61]=[s("option",{value:"SHA-256"},"SHA-256",-1),s("option",{value:"SHA-384"},"SHA-384",-1),s("option",{value:"SHA-512"},"SHA-512",-1)])],512),[[Oe,oe.value.hashAlg]])]),s("button",{onClick:De,disabled:!N.value||!A.value,class:"btn btn-primary"},[...u[63]||(u[63]=[s("span",{class:"btn-icon"},"โ๏ธ",-1),T(" Sign Data ",-1)])],8,Ib),Y.value?(x(),R("div",Nb,[u[65]||(u[65]=s("h6",null,"Digital Signature:",-1)),s("pre",Ob,E(Y.value),1),s("button",{onClick:u[19]||(u[19]=$=>te(Y.value)),class:"btn btn-sm btn-secondary"},[...u[64]||(u[64]=[s("span",{class:"btn-icon"},"๐",-1),T(" Copy Signature ",-1)])])])):de("",!0)]),s("div",Vb,[u[72]||(u[72]=s("h5",null,"Verify Signature",-1)),s("div",Ub,[u[67]||(u[67]=s("label",null,"Original Data:",-1)),ae(s("textarea",{"onUpdate:modelValue":u[20]||(u[20]=$=>G.value=$),placeholder:"Enter the original data",rows:"4",class:"form-textarea"},null,512),[[ke,G.value]])]),s("div",Fb,[u[68]||(u[68]=s("label",null,"Signature:",-1)),ae(s("textarea",{"onUpdate:modelValue":u[21]||(u[21]=$=>J.value=$),placeholder:"Paste the signature to verify",rows:"3",class:"form-textarea"},null,512),[[ke,J.value]])]),s("div",Kb,[u[70]||(u[70]=s("label",null,"Verification Key:",-1)),ae(s("select",{"onUpdate:modelValue":u[22]||(u[22]=$=>X.value=$),class:"form-select"},[u[69]||(u[69]=s("option",{value:""},"Select a public key...",-1)),(x(!0),R($e,null,Pe(M.value,$=>(x(),R("option",{key:$.id,value:$.id},E($.name)+" ("+E($.type)+") ",9,Hb))),128))],512),[[Oe,X.value]])]),s("button",{onClick:Me,disabled:!G.value||!J.value||!X.value,class:"btn btn-primary"},[...u[71]||(u[71]=[s("span",{class:"btn-icon"},"โ
",-1),T(" Verify Signature ",-1)])],8,Bb),ue.value!==null?(x(),R("div",jb,[s("div",{class:Se(["verification-result",ue.value?"valid":"invalid"])},[s("span",Gb,E(ue.value?"โ
":"โ"),1),s("span",null,E(ue.value?"Signature Valid":"Signature Invalid"),1)],2)])):de("",!0)])])):de("",!0),n.value==="exchange"?(x(),R("div",zb,[u[86]||(u[86]=s("h4",null,"๐ค Key Exchange",-1)),u[87]||(u[87]=s("p",{class:"operation-description"}," Securely exchange keys with peers using Diffie-Hellman key exchange and establish shared secrets. ",-1)),s("div",Wb,[u[81]||(u[81]=s("h5",null,"Initiate Key Exchange",-1)),s("div",Jb,[u[76]||(u[76]=s("label",null,"Target Peer:",-1)),ae(s("select",{"onUpdate:modelValue":u[23]||(u[23]=$=>be.value=$),class:"form-select"},[u[75]||(u[75]=s("option",{value:""},"Select a peer...",-1)),(x(!0),R($e,null,Pe(z.value,$=>(x(),R("option",{key:$.id,value:$.id},E($.id.substring(0,16))+"... ("+E($.status)+") ",9,qb))),128))],512),[[Oe,be.value]])]),s("div",Yb,[u[78]||(u[78]=s("label",null,"Key Exchange Method:",-1)),ae(s("select",{"onUpdate:modelValue":u[24]||(u[24]=$=>fe.value.method=$),class:"form-select"},[...u[77]||(u[77]=[s("option",{value:"ECDH"},"ECDH (Elliptic Curve Diffie-Hellman)",-1),s("option",{value:"DH"},"DH (Classical Diffie-Hellman)",-1),s("option",{value:"X25519"},"X25519 (Curve25519)",-1)])],512),[[Oe,fe.value.method]])]),s("div",Qb,[u[79]||(u[79]=s("label",null,"Exchange Purpose:",-1)),ae(s("input",{"onUpdate:modelValue":u[25]||(u[25]=$=>fe.value.purpose=$),placeholder:"e.g., secure-channel, file-encryption",class:"form-input"},null,512),[[ke,fe.value.purpose]])]),s("button",{onClick:Te,disabled:!be.value||!fe.value.purpose,class:"btn btn-primary"},[...u[80]||(u[80]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Initiate Exchange ",-1)])],8,Xb)]),s("div",Zb,[u[85]||(u[85]=s("h5",null,"Established Shared Secrets",-1)),Q.value.length===0?(x(),R("div",eh,[...u[82]||(u[82]=[s("div",{class:"empty-icon"},"๐",-1),s("p",null,"No shared secrets established",-1)])])):(x(),R("div",th,[(x(!0),R($e,null,Pe(Q.value,$=>(x(),R("div",{key:$.id,class:"secret-item"},[s("div",sh,[s("h6",null,E($.purpose),1),s("div",nh,[s("span",oh,E($.method),1),s("span",ih,E($.status),1)])]),s("div",ah,[s("div",rh,"Peer: "+E($.peerId.substring(0,16))+"...",1),s("div",lh,"Created: "+E(b($.created)),1),s("div",uh,"Key: "+E($.keyId),1)]),s("div",ch,[s("button",{onClick:W=>re($),class:"btn btn-sm btn-primary"},[...u[83]||(u[83]=[s("span",{class:"btn-icon"},"๐",-1),T(" Use for Encryption ",-1)])],8,dh),s("button",{onClick:W=>D($.id),class:"btn btn-sm btn-danger"},[...u[84]||(u[84]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Revoke ",-1)])],8,fh)])]))),128))]))])])):de("",!0)]),s("div",ph,[s("div",gh,[s("h3",null,"๐๏ธ Key Store ("+E(q.value.length)+")",1),s("div",{class:"key-controls"},[s("button",{onClick:h,class:"btn btn-secondary"},[...u[89]||(u[89]=[s("span",{class:"btn-icon"},"๐",-1),T(" Refresh ",-1)])]),s("button",{onClick:L,class:"btn btn-secondary"},[...u[90]||(u[90]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Export ",-1)])]),s("button",{onClick:c,class:"btn btn-danger"},[...u[91]||(u[91]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Clear All ",-1)])])])]),q.value.length===0?(x(),R("div",vh,[...u[92]||(u[92]=[s("div",{class:"empty-icon"},"๐",-1),s("p",null,"No keys in store",-1),s("p",{class:"empty-meta"},"Generate or import keys using the operations above",-1)])])):(x(),R("div",mh,[(x(!0),R($e,null,Pe(q.value,$=>(x(),R("div",{key:$.id,class:"key-item"},[s("div",bh,[s("h4",hh,E($.name),1),s("div",yh,[s("span",wh,E($.type),1),$.usage.includes("sign")?(x(),R("span",Sh,"Signing")):de("",!0),$.usage.includes("encrypt")?(x(),R("span",Dh,"Encryption")):de("",!0),$.extractable?(x(),R("span",kh,"Extractable")):de("",!0)])]),s("div",$h,[s("div",Ch,"ID: "+E($.id.substring(0,16))+"...",1),s("div",_h,"Algorithm: "+E($.algorithm),1),$.size?(x(),R("div",Eh,"Size: "+E($.size)+" bits",1)):de("",!0),s("div",Th,"Created: "+E(b($.created)),1)]),s("div",xh,[u[93]||(u[93]=s("label",null,"Fingerprint:",-1)),s("code",Rh,E($.fingerprint),1)]),s("div",Lh,[$.extractable?(x(),R("button",{key:0,onClick:W=>P($),class:"btn btn-sm btn-secondary"},[...u[94]||(u[94]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Export ",-1)])],8,Ph)):de("",!0),s("button",{onClick:W=>B($.id),class:"btn btn-sm btn-secondary"},[...u[95]||(u[95]=[s("span",{class:"btn-icon"},"๐",-1),T(" Copy ID ",-1)])],8,Ah),s("button",{onClick:W=>pe($),class:"btn btn-sm btn-info"},[...u[96]||(u[96]=[s("span",{class:"btn-icon"},"๐",-1),T(" Details ",-1)])],8,Mh),s("button",{onClick:W=>m($.id),class:"btn btn-sm btn-danger"},[...u[97]||(u[97]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Delete ",-1)])],8,Ih)])]))),128))]))]),s("div",Nh,[u[110]||(u[110]=s("h3",null,"๐ Cryptographic Statistics",-1)),s("div",Oh,[s("div",Vh,[u[100]||(u[100]=s("div",{class:"stat-icon"},"๐",-1)),s("div",Uh,[u[98]||(u[98]=s("h4",null,"Total Keys",-1)),s("div",Fh,E(q.value.length),1),u[99]||(u[99]=s("div",{class:"stat-meta"},"In key store",-1))])]),s("div",Kh,[u[103]||(u[103]=s("div",{class:"stat-icon"},"๐",-1)),s("div",Hh,[u[101]||(u[101]=s("h4",null,"Encryption Ops",-1)),s("div",Bh,E(O.value),1),u[102]||(u[102]=s("div",{class:"stat-meta"},"Total performed",-1))])]),s("div",jh,[u[106]||(u[106]=s("div",{class:"stat-icon"},"โ๏ธ",-1)),s("div",Gh,[u[104]||(u[104]=s("h4",null,"Signatures",-1)),s("div",zh,E(ee.value),1),u[105]||(u[105]=s("div",{class:"stat-meta"},"Created & verified",-1))])]),s("div",Wh,[u[109]||(u[109]=s("div",{class:"stat-icon"},"๐ค",-1)),s("div",Jh,[u[107]||(u[107]=s("h4",null,"Key Exchanges",-1)),s("div",qh,E(Q.value.length),1),u[108]||(u[108]=s("div",{class:"stat-meta"},"Active sessions",-1))])])])]),s("div",{class:"quick-actions"},[u[117]||(u[117]=s("h3",null,"โก Quick Cryptographic Actions",-1)),s("div",{class:"action-buttons"},[s("button",{onClick:C,class:"btn btn-secondary"},[...u[111]||(u[111]=[s("span",{class:"btn-icon"},"๐",-1),T(" Generate Test Keys ",-1)])]),s("button",{onClick:U,class:"btn btn-secondary"},[...u[112]||(u[112]=[s("span",{class:"btn-icon"},"๐",-1),T(" Test Encryption ",-1)])]),s("button",{onClick:H,class:"btn btn-secondary"},[...u[113]||(u[113]=[s("span",{class:"btn-icon"},"โ๏ธ",-1),T(" Test Signing ",-1)])]),s("button",{onClick:F,class:"btn btn-secondary"},[...u[114]||(u[114]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Demo Key Exchange ",-1)])]),s("button",{onClick:se,class:"btn btn-secondary"},[...u[115]||(u[115]=[s("span",{class:"btn-icon"},"โฑ๏ธ",-1),T(" Benchmark Performance ",-1)])]),s("button",{onClick:Z,class:"btn btn-secondary"},[...u[116]||(u[116]=[s("span",{class:"btn-icon"},"โ
",-1),T(" Validate Support ",-1)])])])])]))}},Qh=_t(Yh,[["__scopeId","data-v-54778daf"]]),Xh={class:"debug-view"},Zh={class:"debug-controls"},ey={class:"control-tabs"},ty={key:0,class:"control-panel"},sy={class:"logging-config"},ny={class:"form-group"},oy={class:"module-controls"},iy={class:"module-grid"},ay={class:"module-header"},ry={class:"module-name"},ly={class:"module-controls"},uy={class:"toggle-label"},cy=["onUpdate:modelValue","onChange"],dy=["onUpdate:modelValue","onChange","disabled"],fy={key:1,class:"control-panel"},py={class:"monitoring-config"},gy={class:"form-group"},vy={class:"monitoring-toggles"},my={class:"checkbox-label"},by={class:"checkbox-label"},hy={class:"checkbox-label"},yy={class:"checkbox-label"},wy={class:"monitoring-actions"},Sy=["disabled"],Dy=["disabled"],ky={key:2,class:"control-panel"},$y={class:"performance-config"},Cy={class:"profiling-controls"},_y={class:"profiling-actions"},Ey=["disabled"],Ty=["disabled"],xy={key:3,class:"control-panel"},Ry={class:"debug-logs"},Ly={class:"section-title"},Py={class:"log-controls"},Ay={class:"log-filters"},My={class:"log-actions"},Iy={class:"btn-icon"},Ny={key:0,class:"empty-logs"},Oy={class:"empty-meta"},Vy={key:1,class:"log-entries"},Uy={class:"log-header"},Fy={class:"log-timestamp"},Ky={class:"log-level"},Hy={key:0,class:"log-module"},By={class:"log-message"},jy={key:0,class:"log-data"},Gy={class:"system-dashboard"},zy={class:"dashboard-grid"},Wy={class:"status-card"},Jy={class:"status-content"},qy={class:"status-meta"},Yy={class:"status-card"},Qy={class:"status-content"},Xy={class:"status-meta"},Zy={class:"status-card"},e1={class:"status-content"},t1={class:"status-value"},s1={class:"status-meta"},n1={class:"status-card"},o1={class:"status-content"},i1={key:0,class:"monitoring-charts"},a1={class:"chart-placeholder"},r1={class:"chart-info"},l1={__name:"DebugView",setup(e){const t=Ct(),n=K("logging"),o=K(null),i=K(!0),a=K("all"),r=K(""),l=K(!1),d=K(!1),v=K(null),p=K(null),f=K([]),y=K({globalLevel:"info"}),k=K({interval:5e3,networkActivity:!0,memoryUsage:!0,peerMetrics:!0,eventTracking:!0}),N=K([{name:"Network",enabled:!0,level:"info"},{name:"Storage",enabled:!0,level:"info"},{name:"Crypto",enabled:!0,level:"info"},{name:"DHT",enabled:!0,level:"info"},{name:"Messaging",enabled:!0,level:"info"},{name:"Media",enabled:!0,level:"info"},{name:"WebRTC",enabled:!1,level:"debug"},{name:"SignalingClient",enabled:!1,level:"debug"},{name:"PeerConnection",enabled:!1,level:"debug"},{name:"EventEmitter",enabled:!1,level:"verbose"}]),A=K({overall:"healthy",lastCheck:Date.now()}),oe=K({status:"good",connectedPeers:0}),Y=K({used:0,total:0,percentage:0}),G=K({status:"good",averageLatency:0}),J=ce(()=>t.debugLogs),X=ce(()=>{let S=J.value;if(a.value!=="all"){const g={error:0,warning:1,info:2,debug:3,verbose:4},I=g[a.value];S=S.filter(ge=>g[ge.level]<=I)}if(r.value){const g=r.value.toLowerCase();S=S.filter(I=>I.message.toLowerCase().includes(g)||I.module&&I.module.toLowerCase().includes(g))}return S}),ue=()=>{var S;(S=t.mesh)!=null&&S.debugLogger&&t.mesh.debugLogger.setGlobalLevel(y.value.globalLevel),t.addDebugLog(`Global log level set to: ${y.value.globalLevel}`,"info")},be=(S,g)=>{var I;(I=t.mesh)!=null&&I.debugLogger&&(g?t.mesh.debugLogger.enableModule(S):t.mesh.debugLogger.disableModule(S)),t.addDebugLog(`Module ${S}: ${g?"enabled":"disabled"}`,"info")},fe=(S,g)=>{var I;(I=t.mesh)!=null&&I.debugLogger&&t.mesh.debugLogger.setModuleLevel(S,g),t.addDebugLog(`Module ${S} level set to: ${g}`,"info")},Q=()=>{N.value.forEach(S=>{S.enabled=!0,be(S.name,!0)})},O=()=>{N.value.forEach(S=>{S.enabled=!1,be(S.name,!1)})},ee=()=>{y.value.globalLevel="info",N.value.forEach(S=>{S.enabled=["Network","Storage","Crypto","DHT","Messaging","Media"].includes(S.name),S.level="info"}),ue(),t.addDebugLog("Logging configuration reset to defaults","info")},q=()=>{l.value&&(j(),V())},z=()=>{t.addDebugLog(`Network monitoring: ${k.value.networkActivity?"enabled":"disabled"}`,"info")},le=()=>{t.addDebugLog(`Memory monitoring: ${k.value.memoryUsage?"enabled":"disabled"}`,"info")},he=()=>{t.addDebugLog(`Peer metrics: ${k.value.peerMetrics?"enabled":"disabled"}`,"info")},M=()=>{t.addDebugLog(`Event tracking: ${k.value.eventTracking?"enabled":"disabled"}`,"info")},V=()=>{l.value=!0,p.value=Date.now(),v.value=setInterval(()=>{we()},k.value.interval),t.addDebugLog("System monitoring started","success")},j=()=>{l.value=!1,v.value&&(clearInterval(v.value),v.value=null),t.addDebugLog("System monitoring stopped","info")},ve=()=>{f.value=[],t.addDebugLog("Monitoring data cleared","info")},we=()=>{const S={timestamp:Date.now(),memoryUsage:G.memory?{used:Math.round(G.memory.usedJSHeapSize/1024/1024),total:Math.round(G.memory.totalJSHeapSize/1024/1024)}:{used:0,total:0},connectedPeers:t.connectedPeersList.length,networkLatency:Math.random()*100+20,cpuUsage:Math.random()*50+10};f.value.push(S),f.value.length>100&&f.value.shift(),De(S)},De=S=>{Y.value={used:S.memoryUsage.used,total:S.memoryUsage.total,percentage:S.memoryUsage.total>0?Math.round(S.memoryUsage.used/S.memoryUsage.total*100):0},oe.value={status:S.connectedPeers>0?"good":"warning",connectedPeers:S.connectedPeers},G.value={status:S.networkLatency<100?"good":"warning",averageLatency:Math.round(S.networkLatency)},A.value={overall:oe.value.status==="good"&&G.value.status==="good"?"healthy":"warning",lastCheck:Date.now()}},Me=()=>{d.value=!0,t.addDebugLog("Performance profiling started","info"),N.value.forEach(S=>{["Network","WebRTC","PeerConnection"].includes(S.name)&&(S.enabled=!0,S.level="debug",be(S.name,!0),fe(S.name,"debug"))})},Te=()=>{d.value=!1,t.addDebugLog("Performance profiling stopped","info")},re=()=>{const S={timestamp:Date.now(),monitoringData:f.value.slice(-20),systemStatus:A.value,memoryUsage:Y.value,networkHealth:oe.value,performance:G.value,logSummary:{total:J.value.length,errors:J.value.filter(Ae=>Ae.level==="error").length,warnings:J.value.filter(Ae=>Ae.level==="warning").length}},g=JSON.stringify(S,null,2),I=new Blob([g],{type:"application/json"}),ge=URL.createObjectURL(I),ne=document.createElement("a");ne.href=ge,ne.download=`peerpigeon-performance-report-${Date.now()}.json`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(ge),t.addDebugLog("Performance report generated and downloaded","success")},D=async()=>{t.addDebugLog("Running network benchmark...","info");const S=G.now();for(let ge=0;ge<10;ge++)await new Promise(ne=>setTimeout(ne,10)),t.connectedPeersList.length>0&&t.addDebugLog(`Benchmark message ${ge+1}/10`,"debug");const g=G.now(),I=Math.round(g-S);t.addDebugLog(`Network benchmark completed in ${I}ms`,"success")},h=async()=>{t.addDebugLog("Running crypto benchmark...","info");const S=G.now();for(let ge=0;ge<5;ge++)await new Promise(ne=>setTimeout(ne,20)),t.addDebugLog(`Crypto operation ${ge+1}/5`,"debug");const g=G.now(),I=Math.round(g-S);t.addDebugLog(`Crypto benchmark completed in ${I}ms`,"success")},L=async()=>{t.addDebugLog("Running storage benchmark...","info");const S=G.now();for(let ge=0;ge<15;ge++)await t.storageStore(`benchmark:test-${ge}`,{data:`test-data-${ge}`,timestamp:Date.now()}),await new Promise(ne=>setTimeout(ne,5));const g=G.now(),I=Math.round(g-S);t.addDebugLog(`Storage benchmark completed in ${I}ms`,"success")},c=async()=>{t.addDebugLog("Running full benchmark suite...","info"),await D(),await h(),await L(),t.addDebugLog("Full benchmark suite completed","success")},P=async()=>{var I,ge;t.addDebugLog("Running system health check...","info");const S=[{name:"Mesh Connection",status:t.isConnected?"pass":"fail"},{name:"WebRTC Support",status:window.RTCPeerConnection?"pass":"fail"},{name:"WebSocket Support",status:window.WebSocket?"pass":"fail"},{name:"Crypto API",status:window.crypto&&window.crypto.subtle?"pass":"fail"},{name:"Storage Manager",status:(I=t.mesh)!=null&&I.distributedStorage?"pass":"fail"},{name:"Debug Logger",status:(ge=t.mesh)!=null&&ge.debugLogger?"pass":"fail"}];S.forEach(ne=>{const Ae=ne.status==="pass"?"success":"error";t.addDebugLog(`Health Check - ${ne.name}: ${ne.status.toUpperCase()}`,Ae)});const g=S.filter(ne=>ne.status==="pass").length;t.addDebugLog(`Health check completed: ${g}/${S.length} checks passed`,g===S.length?"success":"warning")},B=()=>{var g;t.addDebugLog("Validating system configuration...","info");const S={mesh:!!t.mesh,peerId:!!t.peerId,signalingServer:t.signalingServer||"default",debugLogging:!!((g=t.mesh)!=null&&g.debugLogger)};t.addDebugLog(`Configuration validation:
|
|
34
|
+
${JSON.stringify(S,null,2)}`,"info")},te=async()=>{var S;t.addDebugLog("Testing connectivity...","info");try{(S=t.mesh)!=null&&S.signalingClient?t.addDebugLog("Signaling server: Connected","success"):t.addDebugLog("Signaling server: Not connected","warning");const g=t.connectedPeersList.length;t.addDebugLog(`Peer connections: ${g} active`,g>0?"success":"warning"),t.addDebugLog("Connectivity test completed","info")}catch(g){t.addDebugLog(`Connectivity test failed: ${g.message}`,"error")}},pe=()=>{const S={timestamp:Date.now(),system:{userAgent:navigator.userAgent,platform:navigator.platform,language:navigator.language,onLine:navigator.onLine},peerpigeon:{version:"1.0.0",peerId:t.peerId,isConnected:t.isConnected,connectedPeers:t.connectedPeersList.length,storageItems:t.storageData.size,cryptoKeys:t.cryptoKeys.length},logs:{total:J.value.length,recent:J.value.slice(-50)},monitoring:{isActive:l.value,dataPoints:f.value.length,systemStatus:A.value}},g=JSON.stringify(S,null,2),I=new Blob([g],{type:"application/json"}),ge=URL.createObjectURL(I),ne=document.createElement("a");ne.href=ge,ne.download=`peerpigeon-diagnostic-report-${Date.now()}.json`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(ge),t.addDebugLog("Diagnostic report generated and downloaded","success")},m=()=>{const S={exported:Date.now(),totalLogs:J.value.length,logs:J.value},g=JSON.stringify(S,null,2),I=new Blob([g],{type:"application/json"}),ge=URL.createObjectURL(I),ne=document.createElement("a");ne.href=ge,ne.download=`peerpigeon-debug-logs-${Date.now()}.json`,document.body.appendChild(ne),ne.click(),document.body.removeChild(ne),URL.revokeObjectURL(ge),t.addDebugLog("Debug logs exported","success")},b=()=>{confirm("Are you sure you want to reset the system? This will clear all data and restart.")&&(t.addDebugLog("System reset initiated...","warning"),j(),t.debugLogs.splice(0),t.storageData.clear(),t.cryptoKeys.splice(0),f.value=[],ee(),t.addDebugLog("System reset completed","info"))},C=()=>{i.value=!i.value,i.value&&F()},U=()=>{t.debugLogs.splice(0),t.addDebugLog("Debug logs cleared","info")},H=()=>{m()},F=()=>{zt(()=>{o.value&&(o.value.scrollTop=o.value.scrollHeight)})},se=S=>new Date(S).toLocaleTimeString(),Z=S=>new Date(S).toLocaleTimeString(),_=()=>{const S=["error","warning","info","debug","verbose"],g=["Network","Storage","Crypto","DHT"];S.forEach((I,ge)=>{setTimeout(()=>{const ne=g[ge%g.length];t.addDebugLog(`Test ${I} message from ${ne}`,I,ne)},ge*200)})},u=()=>{t.addDebugLog("Simulated error: Connection timeout","error","Network"),t.addDebugLog("Retrying connection...","warning","Network"),setTimeout(()=>{t.addDebugLog("Connection retry successful","success","Network")},1e3)},$=async()=>{t.addDebugLog("Starting stress test...","warning");for(let S=0;S<50;S++)setTimeout(()=>{t.addDebugLog(`Stress test operation ${S+1}/50`,"debug")},S*50);setTimeout(()=>{t.addDebugLog("Stress test completed","success")},50*50+100)},W=()=>{re()},ie=()=>{y.value.globalLevel="verbose",ue(),N.value.forEach(S=>{S.enabled=!0,S.level="verbose",be(S.name,!0),fe(S.name,"verbose")}),t.addDebugLog("Verbose logging enabled for all modules","info")},w=()=>{const S={timestamp:Date.now(),mesh:{isConnected:t.isConnected,peerId:t.peerId,connectedPeers:t.connectedPeersList.length},storage:{itemCount:t.storageData.size,keys:Array.from(t.storageData.keys())},crypto:{keyCount:t.cryptoKeys.length},system:{memoryUsage:Y.value,performance:G.value,networkHealth:oe.value},debug:{logCount:J.value.length,isMonitoring:l.value,moduleStates:N.value}};t.addDebugLog(`System Snapshot:
|
|
35
|
+
${JSON.stringify(S,null,2)}`,"info")};return It(J,()=>{i.value&&F()},{deep:!0}),Ut(()=>{(k.value.networkActivity||k.value.memoryUsage)&&V(),we(),t.addDebugLog("Debug view initialized","info")}),Rs(()=>{v.value&&clearInterval(v.value)}),(S,g)=>(x(),R("div",Xh,[g[81]||(g[81]=s("div",{class:"section-header"},[s("h2",null,"๐ Debug & Monitoring"),s("p",null,"System diagnostics, logging, performance monitoring, and debugging tools")],-1)),s("div",Zh,[g[54]||(g[54]=s("h3",null,"๐๏ธ Debug Controls",-1)),s("div",ey,[s("button",{onClick:g[0]||(g[0]=I=>n.value="logging"),class:Se(["tab-btn",{active:n.value==="logging"}])}," LOGGING ",2),s("button",{onClick:g[1]||(g[1]=I=>n.value="monitoring"),class:Se(["tab-btn",{active:n.value==="monitoring"}])}," MONITORING ",2),s("button",{onClick:g[2]||(g[2]=I=>n.value="performance"),class:Se(["tab-btn",{active:n.value==="performance"}])}," PERFORMANCE ",2),s("button",{onClick:g[3]||(g[3]=I=>n.value="diagnostics"),class:Se(["tab-btn",{active:n.value==="diagnostics"}])}," DIAGNOSTICS ",2)]),n.value==="logging"?(x(),R("div",ty,[g[20]||(g[20]=s("h4",null,"๐ Logging Configuration",-1)),g[21]||(g[21]=s("p",{class:"panel-description"}," Configure debug logging levels and modules. Control what information is captured and displayed. ",-1)),s("div",sy,[s("div",ny,[g[13]||(g[13]=s("label",null,"Global Log Level:",-1)),ae(s("select",{"onUpdate:modelValue":g[4]||(g[4]=I=>y.value.globalLevel=I),onChange:ue,class:"form-select"},[...g[12]||(g[12]=[bn('<option value="error" data-v-30d66a77>Error</option><option value="warning" data-v-30d66a77>Warning</option><option value="info" data-v-30d66a77>Info</option><option value="debug" data-v-30d66a77>Debug</option><option value="verbose" data-v-30d66a77>Verbose</option>',5)])],544),[[Oe,y.value.globalLevel]])]),s("div",oy,[g[16]||(g[16]=s("h5",null,"Module-Specific Logging:",-1)),s("div",iy,[(x(!0),R($e,null,Pe(N.value,I=>(x(),R("div",{key:I.name,class:"module-item"},[s("div",ay,[s("span",ry,E(I.name),1),s("span",{class:Se(["module-status",{enabled:I.enabled}])},E(I.enabled?"ON":"OFF"),3)]),s("div",ly,[s("label",uy,[ae(s("input",{type:"checkbox","onUpdate:modelValue":ge=>I.enabled=ge,onChange:ge=>be(I.name,I.enabled)},null,40,cy),[[Ke,I.enabled]]),g[14]||(g[14]=T(" Enable ",-1))]),ae(s("select",{"onUpdate:modelValue":ge=>I.level=ge,onChange:ge=>fe(I.name,I.level),disabled:!I.enabled,class:"form-select-sm"},[...g[15]||(g[15]=[bn('<option value="error" data-v-30d66a77>Error</option><option value="warning" data-v-30d66a77>Warning</option><option value="info" data-v-30d66a77>Info</option><option value="debug" data-v-30d66a77>Debug</option><option value="verbose" data-v-30d66a77>Verbose</option>',5)])],40,dy),[[Oe,I.level]])])]))),128))])]),s("div",{class:"logging-actions"},[s("button",{onClick:Q,class:"btn btn-primary"},[...g[17]||(g[17]=[s("span",{class:"btn-icon"},"โ
",-1),T(" Enable All ",-1)])]),s("button",{onClick:O,class:"btn btn-secondary"},[...g[18]||(g[18]=[s("span",{class:"btn-icon"},"โ",-1),T(" Disable All ",-1)])]),s("button",{onClick:ee,class:"btn btn-secondary"},[...g[19]||(g[19]=[s("span",{class:"btn-icon"},"๐",-1),T(" Reset Config ",-1)])])])])])):de("",!0),n.value==="monitoring"?(x(),R("div",fy,[g[31]||(g[31]=s("h4",null,"๐ System Monitoring",-1)),g[32]||(g[32]=s("p",{class:"panel-description"}," Monitor system performance, network activity, and resource usage in real-time. ",-1)),s("div",py,[s("div",gy,[g[23]||(g[23]=s("label",null,"Monitoring Interval:",-1)),ae(s("select",{"onUpdate:modelValue":g[5]||(g[5]=I=>k.value.interval=I),onChange:q,class:"form-select"},[...g[22]||(g[22]=[s("option",{value:"1000"},"1 second",-1),s("option",{value:"5000"},"5 seconds",-1),s("option",{value:"10000"},"10 seconds",-1),s("option",{value:"30000"},"30 seconds",-1)])],544),[[Oe,k.value.interval]])]),s("div",vy,[s("label",my,[ae(s("input",{type:"checkbox","onUpdate:modelValue":g[6]||(g[6]=I=>k.value.networkActivity=I),onChange:z},null,544),[[Ke,k.value.networkActivity]]),g[24]||(g[24]=T(" Network Activity Monitoring ",-1))]),s("label",by,[ae(s("input",{type:"checkbox","onUpdate:modelValue":g[7]||(g[7]=I=>k.value.memoryUsage=I),onChange:le},null,544),[[Ke,k.value.memoryUsage]]),g[25]||(g[25]=T(" Memory Usage Tracking ",-1))]),s("label",hy,[ae(s("input",{type:"checkbox","onUpdate:modelValue":g[8]||(g[8]=I=>k.value.peerMetrics=I),onChange:he},null,544),[[Ke,k.value.peerMetrics]]),g[26]||(g[26]=T(" Peer Connection Metrics ",-1))]),s("label",yy,[ae(s("input",{type:"checkbox","onUpdate:modelValue":g[9]||(g[9]=I=>k.value.eventTracking=I),onChange:M},null,544),[[Ke,k.value.eventTracking]]),g[27]||(g[27]=T(" Event Tracking ",-1))])]),s("div",wy,[s("button",{onClick:V,disabled:l.value,class:"btn btn-success"},[...g[28]||(g[28]=[s("span",{class:"btn-icon"},"โถ๏ธ",-1),T(" Start Monitoring ",-1)])],8,Sy),s("button",{onClick:j,disabled:!l.value,class:"btn btn-danger"},[...g[29]||(g[29]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Stop Monitoring ",-1)])],8,Dy),s("button",{onClick:ve,class:"btn btn-secondary"},[...g[30]||(g[30]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Clear Data ",-1)])])])])])):de("",!0),n.value==="performance"?(x(),R("div",ky,[g[42]||(g[42]=s("h4",null,"โก Performance Analysis",-1)),g[43]||(g[43]=s("p",{class:"panel-description"}," Analyze performance bottlenecks, measure operation timing, and optimize system performance. ",-1)),s("div",$y,[s("div",Cy,[g[36]||(g[36]=s("h5",null,"Performance Profiling:",-1)),s("div",_y,[s("button",{onClick:Me,disabled:d.value,class:"btn btn-primary"},[...g[33]||(g[33]=[s("span",{class:"btn-icon"},"๐ฏ",-1),T(" Start Profiling ",-1)])],8,Ey),s("button",{onClick:Te,disabled:!d.value,class:"btn btn-danger"},[...g[34]||(g[34]=[s("span",{class:"btn-icon"},"โน๏ธ",-1),T(" Stop Profiling ",-1)])],8,Ty),s("button",{onClick:re,class:"btn btn-info"},[...g[35]||(g[35]=[s("span",{class:"btn-icon"},"๐",-1),T(" Generate Report ",-1)])])])]),s("div",{class:"benchmark-controls"},[g[41]||(g[41]=s("h5",null,"System Benchmarks:",-1)),s("div",{class:"benchmark-actions"},[s("button",{onClick:D,class:"btn btn-secondary"},[...g[37]||(g[37]=[s("span",{class:"btn-icon"},"๐",-1),T(" Network Benchmark ",-1)])]),s("button",{onClick:h,class:"btn btn-secondary"},[...g[38]||(g[38]=[s("span",{class:"btn-icon"},"๐",-1),T(" Crypto Benchmark ",-1)])]),s("button",{onClick:L,class:"btn btn-secondary"},[...g[39]||(g[39]=[s("span",{class:"btn-icon"},"๐พ",-1),T(" Storage Benchmark ",-1)])]),s("button",{onClick:c,class:"btn btn-primary"},[...g[40]||(g[40]=[s("span",{class:"btn-icon"},"๐",-1),T(" Full Benchmark Suite ",-1)])])])])])])):de("",!0),n.value==="diagnostics"?(x(),R("div",xy,[g[52]||(g[52]=s("h4",null,"๐ง System Diagnostics",-1)),g[53]||(g[53]=s("p",{class:"panel-description"}," Run diagnostic tests, validate system health, and troubleshoot issues. ",-1)),s("div",{class:"diagnostics-config"},[s("div",{class:"health-check"},[g[47]||(g[47]=s("h5",null,"System Health Check:",-1)),s("div",{class:"health-actions"},[s("button",{onClick:P,class:"btn btn-primary"},[...g[44]||(g[44]=[s("span",{class:"btn-icon"},"โค๏ธ",-1),T(" Run Health Check ",-1)])]),s("button",{onClick:B,class:"btn btn-secondary"},[...g[45]||(g[45]=[s("span",{class:"btn-icon"},"โ
",-1),T(" Validate Config ",-1)])]),s("button",{onClick:te,class:"btn btn-secondary"},[...g[46]||(g[46]=[s("span",{class:"btn-icon"},"๐",-1),T(" Test Connectivity ",-1)])])])]),s("div",{class:"troubleshooting"},[g[51]||(g[51]=s("h5",null,"Troubleshooting Tools:",-1)),s("div",{class:"trouble-actions"},[s("button",{onClick:pe,class:"btn btn-info"},[...g[48]||(g[48]=[s("span",{class:"btn-icon"},"๐",-1),T(" Diagnostic Report ",-1)])]),s("button",{onClick:m,class:"btn btn-secondary"},[...g[49]||(g[49]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Export Debug Logs ",-1)])]),s("button",{onClick:b,class:"btn btn-warning"},[...g[50]||(g[50]=[s("span",{class:"btn-icon"},"๐",-1),T(" Reset System ",-1)])])])])])])):de("",!0)]),s("div",Ry,[s("div",Ly,[s("h3",null,"๐ Debug Logs ("+E(J.value.length)+")",1),s("div",Py,[s("div",Ay,[ae(s("select",{"onUpdate:modelValue":g[10]||(g[10]=I=>a.value=I),class:"form-select-sm"},[...g[55]||(g[55]=[bn('<option value="all" data-v-30d66a77>All Levels</option><option value="error" data-v-30d66a77>Errors Only</option><option value="warning" data-v-30d66a77>Warnings+</option><option value="info" data-v-30d66a77>Info+</option><option value="debug" data-v-30d66a77>Debug+</option><option value="verbose" data-v-30d66a77>Verbose</option>',6)])],512),[[Oe,a.value]]),ae(s("input",{"onUpdate:modelValue":g[11]||(g[11]=I=>r.value=I),placeholder:"Search logs...",class:"form-input-sm"},null,512),[[ke,r.value]])]),s("div",My,[s("button",{onClick:C,class:Se(["btn","btn-sm",i.value?"btn-primary":"btn-secondary"])},[s("span",Iy,E((i.value,"๐")),1),g[56]||(g[56]=T(" Auto-scroll ",-1))],2),s("button",{onClick:U,class:"btn btn-sm btn-danger"},[...g[57]||(g[57]=[s("span",{class:"btn-icon"},"๐๏ธ",-1),T(" Clear ",-1)])]),s("button",{onClick:H,class:"btn btn-sm btn-secondary"},[...g[58]||(g[58]=[s("span",{class:"btn-icon"},"๐ค",-1),T(" Export ",-1)])])])])]),s("div",{class:"log-display",ref_key:"logDisplay",ref:o},[X.value.length===0?(x(),R("div",Ny,[g[59]||(g[59]=s("div",{class:"empty-icon"},"๐ญ",-1)),g[60]||(g[60]=s("p",null,"No logs to display",-1)),s("p",Oy,E(a.value==="all"?"No debug logs yet":`No logs matching filter: ${a.value}`),1)])):(x(),R("div",Vy,[(x(!0),R($e,null,Pe(X.value,I=>(x(),R("div",{key:I.id,class:Se(["log-entry",`log-${I.level}`])},[s("div",Uy,[s("span",Fy,E(se(I.timestamp)),1),s("span",Ky,E(I.level.toUpperCase()),1),I.module?(x(),R("span",Hy,E(I.module),1)):de("",!0)]),s("div",By,E(I.message),1),I.data?(x(),R("div",jy,[s("details",null,[g[61]||(g[61]=s("summary",null,"Additional Data",-1)),s("pre",null,E(JSON.stringify(I.data,null,2)),1)])])):de("",!0)],2))),128))]))],512)]),s("div",Gy,[g[73]||(g[73]=s("h3",null,"๐ System Status Dashboard",-1)),s("div",zy,[s("div",Wy,[g[63]||(g[63]=s("div",{class:"status-icon"},"๐ฅ๏ธ",-1)),s("div",Jy,[g[62]||(g[62]=s("h4",null,"System Status",-1)),s("div",{class:Se(["status-value",A.value.overall])},E(A.value.overall),3),s("div",qy,"Last checked: "+E(Z(A.value.lastCheck)),1)])]),s("div",Yy,[g[65]||(g[65]=s("div",{class:"status-icon"},"๐",-1)),s("div",Qy,[g[64]||(g[64]=s("h4",null,"Network Health",-1)),s("div",{class:Se(["status-value",oe.value.status])},E(oe.value.status),3),s("div",Xy,E(oe.value.connectedPeers)+" peers connected",1)])]),s("div",Zy,[g[67]||(g[67]=s("div",{class:"status-icon"},"๐พ",-1)),s("div",e1,[g[66]||(g[66]=s("h4",null,"Memory Usage",-1)),s("div",t1,E(Y.value.used)+"MB",1),s("div",s1,E(Y.value.percentage)+"% of "+E(Y.value.total)+"MB",1)])]),s("div",n1,[g[70]||(g[70]=s("div",{class:"status-icon"},"โก",-1)),s("div",o1,[g[68]||(g[68]=s("h4",null,"Performance",-1)),s("div",{class:Se(["status-value",G.value.status])},E(G.value.averageLatency)+"ms",3),g[69]||(g[69]=s("div",{class:"status-meta"},"Average latency",-1))])])]),f.value.length>0?(x(),R("div",i1,[g[72]||(g[72]=s("h4",null,"Performance Charts",-1)),s("div",a1,[s("div",r1,[g[71]||(g[71]=s("p",null,"๐ Real-time performance data visualization would be displayed here",-1)),s("p",null,"Data points: "+E(f.value.length),1),s("p",null,"Monitoring since: "+E(Z(p.value)),1)])])])):de("",!0)]),s("div",{class:"quick-debug-actions"},[g[80]||(g[80]=s("h3",null,"โก Quick Debug Actions",-1)),s("div",{class:"action-buttons"},[s("button",{onClick:_,class:"btn btn-secondary"},[...g[74]||(g[74]=[s("span",{class:"btn-icon"},"๐",-1),T(" Generate Test Logs ",-1)])]),s("button",{onClick:u,class:"btn btn-warning"},[...g[75]||(g[75]=[s("span",{class:"btn-icon"},"โ ๏ธ",-1),T(" Simulate Error ",-1)])]),s("button",{onClick:$,class:"btn btn-danger"},[...g[76]||(g[76]=[s("span",{class:"btn-icon"},"๐ฅ",-1),T(" Stress Test ",-1)])]),s("button",{onClick:W,class:"btn btn-info"},[...g[77]||(g[77]=[s("span",{class:"btn-icon"},"๐",-1),T(" Performance Profile ",-1)])]),s("button",{onClick:ie,class:"btn btn-primary"},[...g[78]||(g[78]=[s("span",{class:"btn-icon"},"๐",-1),T(" Enable Verbose Logging ",-1)])]),s("button",{onClick:w,class:"btn btn-secondary"},[...g[79]||(g[79]=[s("span",{class:"btn-icon"},"๐ธ",-1),T(" System Snapshot ",-1)])])])])]))}},u1=_t(l1,[["__scopeId","data-v-30d66a77"]]),c1={class:"testing-view"},d1={class:"card"},f1={class:"button-grid"},p1=["disabled"],g1=["disabled"],v1=["disabled"],m1={class:"card"},b1={class:"input-grid"},h1={class:"input-group"},y1={class:"input-group"},w1={class:"input-group"},S1={class:"card"},D1={key:0,class:"empty-state"},k1={class:"result-header"},$1={class:"result-icon"},C1={class:"result-name"},_1={class:"result-time"},E1={class:"result-details"},T1={key:0,class:"result-error"},x1={class:"card"},R1={key:0,class:"utility-results"},L1={key:1,class:"empty-state"},P1={class:"card"},A1={class:"metrics-grid"},M1={class:"metric-item"},I1={class:"metric-value"},N1={class:"metric-item"},O1={class:"metric-value"},V1={class:"metric-item"},U1={class:"metric-value"},F1={class:"metric-item"},K1={class:"metric-value"},H1={class:"metric-item"},B1={class:"metric-value"},j1={class:"metric-item"},G1={class:"metric-value"},z1={__name:"TestingView",setup(e){const t=Ct(),n=K(""),o=K(50),i=K(100),a=K([]),r=K(""),l=K({messagesSent:0,messagesReceived:0,dhtOperations:0,duration:0,testStartTime:null,testEndTime:null,responseTimes:[]}),d=ce(()=>a.value.length===0?0:(a.value.filter(z=>z.status==="success").length/a.value.length*100).toFixed(1)),v=ce(()=>{const q=l.value.responseTimes;return q.length===0?0:(q.reduce((le,he)=>le+he,0)/q.length).toFixed(2)}),p=K(null),f=(q,z,le="info",he=null)=>{a.value.push({name:q,details:z,status:le,error:he,timestamp:Date.now()}),zt(()=>{p.value&&(p.value.scrollTop=p.value.scrollHeight)})},y=q=>({success:"โ
",error:"โ",warning:"โ ๏ธ",info:"โน๏ธ"})[q]||"โน๏ธ",k=q=>new Date(q).toLocaleTimeString(),N=q=>q<1e3?`${q}ms`:`${(q/1e3).toFixed(2)}s`,A=()=>{if(!n.value){f("Peer ID Validation","Please enter a peer ID to validate","warning");return}const q=n.value.length>=8,z=`
|
|
36
|
+
Peer ID: ${n.value}
|
|
37
|
+
Length: ${n.value.length} characters
|
|
38
|
+
Valid: ${q?"Yes":"No"}
|
|
39
|
+
Expected: At least 8 characters
|
|
40
|
+
`.trim();r.value=z,f("Peer ID Validation",z,q?"success":"error")},oe=async()=>{if(!t.mesh){f("Performance Test","Mesh not initialized","error");return}f("Performance Test",`Starting test with ${o.value} messages...`,"info");const q="x".repeat(i.value),z=Date.now();let le=0,he=0;const M=[];l.value.testStartTime=z;for(let De=0;De<o.value;De++){const Me=Date.now();try{await t.sendBroadcastMessage(`${q} #${De+1}`)?(le++,l.value.messagesSent++,M.push(Date.now()-Me)):he++,De%10===0&&De>0&&await new Promise(re=>setTimeout(re,10))}catch{he++}}const V=Date.now(),j=V-z;l.value.testEndTime=V,l.value.duration=j,l.value.responseTimes=M;const ve=(le/j*1e3).toFixed(2),we=`
|
|
41
|
+
Duration: ${j}ms
|
|
42
|
+
Success: ${le}/${o.value}
|
|
43
|
+
Failed: ${he}
|
|
44
|
+
Rate: ${ve} msg/sec
|
|
45
|
+
Avg Response: ${v.value}ms
|
|
46
|
+
`.trim();f("Performance Test",we,le>he?"success":"warning")},Y=async()=>{if(!t.mesh){f("Stress Test","Mesh not initialized","error");return}f("Stress Test","Starting stress test...","info");const q=[],z=Date.now();for(let we=0;we<20;we++)q.push(t.dhtPut(`stress-test-${we}`,{value:we,timestamp:Date.now()}).then(()=>(l.value.dhtOperations++,{success:!0})).catch(De=>({error:De.message})));for(let we=0;we<50;we++)try{await t.sendBroadcastMessage(`Stress test message #${we+1}`)?(l.value.messagesSent++,q.push(Promise.resolve({success:!0}))):q.push(Promise.resolve({error:"Failed to send"}))}catch(De){q.push(Promise.resolve({error:De.message}))}const le=await Promise.allSettled(q),M=Date.now()-z,V=le.filter(we=>{var De;return we.status==="fulfilled"&&((De=we.value)==null?void 0:De.success)}).length,j=le.length-V,ve=`
|
|
47
|
+
Duration: ${M}ms
|
|
48
|
+
Operations: ${le.length}
|
|
49
|
+
Successful: ${V}
|
|
50
|
+
Failed: ${j}
|
|
51
|
+
Success Rate: ${(V/le.length*100).toFixed(1)}%
|
|
52
|
+
`.trim();f("Stress Test",ve,V>j?"success":"warning")},G=async()=>{const q="invalid-peer-id-12345";try{await t.sendDirectMessage(q,"Test message"),f("Invalid Peer Test","Message sent to invalid peer (unexpected)","warning")}catch(z){f("Invalid Peer Test",`Handled gracefully: ${z.message}`,"success")}},J=async()=>{const q=[{type:"undefined",value:void 0},{type:"null",value:null},{type:"function",value:()=>{}},{type:"symbol",value:Symbol("test")}],z=[];for(const le of q)try{const he=await t.sendBroadcast(le.value);z.push(`${le.type}: ${he?"Sent":"Failed"}`)}catch(he){z.push(`${le.type}: Error handled - ${he.message}`)}f("Malformed Message Test",z.join(`
|
|
53
|
+
`),"success")},X=async()=>{try{const q="x".repeat(1e5),z=Date.now();await t.dhtPut("large-data-test",q);const le=await t.dhtGet("large-data-test"),he=Date.now(),M=le===q,V=`
|
|
54
|
+
Data size: 100KB
|
|
55
|
+
Duration: ${he-z}ms
|
|
56
|
+
Success: ${M}
|
|
57
|
+
`.trim();f("DHT Limits Test",V,M?"success":"error")}catch(q){f("DHT Limits Test",`Limit enforced: ${q.message}`,"success")}},ue=()=>{const q={testResults:a.value,performanceMetrics:l.value,debugLogs:t.debugLogs,messages:t.messages,networkStatus:t.networkStatus,timestamp:new Date().toISOString()};Q(q,`peerpigeon-logs-${Date.now()}.json`),f("Export","Logs exported successfully","success")},be=()=>{const q={results:a.value,metrics:l.value,successRate:d.value,avgResponseTime:v.value,timestamp:new Date().toISOString()};Q(q,`peerpigeon-test-results-${Date.now()}.json`),f("Export","Test results exported successfully","success")},fe=()=>{Q(l.value,`peerpigeon-metrics-${Date.now()}.json`),f("Export","Metrics exported successfully","success")},Q=(q,z)=>{const le=JSON.stringify(q,null,2),he=new Blob([le],{type:"application/json"}),M=URL.createObjectURL(he),V=document.createElement("a");V.href=M,V.download=z,V.click(),URL.revokeObjectURL(M)},O=()=>{a.value=[],r.value=""},ee=()=>{l.value={messagesSent:0,messagesReceived:0,dhtOperations:0,duration:0,testStartTime:null,testEndTime:null,responseTimes:[]}};return(q,z)=>(x(),R("div",c1,[z[19]||(z[19]=s("div",{class:"view-header"},[s("h2",null,"๐งช PeerPigeon API Testing"),s("p",null,"Comprehensive test suite for validating all PeerPigeon features")],-1)),s("div",d1,[z[3]||(z[3]=s("h3",null,"โก Quick Tests",-1)),s("div",f1,[s("button",{onClick:A,class:"btn btn-primary"}," ๐ Validate Peer ID "),s("button",{onClick:oe,class:"btn btn-primary",disabled:!He(t).isConnected}," ๐ Performance Test ",8,p1),s("button",{onClick:Y,class:"btn btn-primary",disabled:!He(t).isConnected}," โก Stress Test ",8,g1),s("button",{onClick:G,class:"btn btn-secondary"}," โ Test Invalid Peer "),s("button",{onClick:J,class:"btn btn-secondary"}," โ ๏ธ Test Malformed Message "),s("button",{onClick:X,class:"btn btn-secondary",disabled:!He(t).isConnected}," ๐ Test DHT Limits ",8,v1)])]),s("div",m1,[z[7]||(z[7]=s("h3",null,"โ๏ธ Test Configuration",-1)),s("div",b1,[s("div",h1,[z[4]||(z[4]=s("label",{for:"test-peer-id"},"Test Peer ID:",-1)),ae(s("input",{id:"test-peer-id","onUpdate:modelValue":z[0]||(z[0]=le=>n.value=le),type:"text",placeholder:"Enter peer ID to validate"},null,512),[[ke,n.value]])]),s("div",y1,[z[5]||(z[5]=s("label",{for:"test-message-count"},"Message Count:",-1)),ae(s("input",{id:"test-message-count","onUpdate:modelValue":z[1]||(z[1]=le=>o.value=le),type:"number",min:"1",max:"1000"},null,512),[[ke,o.value,void 0,{number:!0}]])]),s("div",w1,[z[6]||(z[6]=s("label",{for:"test-message-size"},"Message Size (chars):",-1)),ae(s("input",{id:"test-message-size","onUpdate:modelValue":z[2]||(z[2]=le=>i.value=le),type:"number",min:"1",max:"10000"},null,512),[[ke,i.value,void 0,{number:!0}]])])])]),s("div",S1,[z[9]||(z[9]=s("h3",null,"๐ Test Results",-1)),s("div",{class:"test-results-header"},[s("button",{onClick:O,class:"btn btn-tertiary"}," ๐๏ธ Clear Results "),s("button",{onClick:be,class:"btn btn-tertiary"}," ๐ฅ Export Results ")]),s("div",{class:"test-results",ref_key:"testResultsContainer",ref:p},[a.value.length===0?(x(),R("div",D1," No test results yet. Run a test to see results here. ")):de("",!0),(x(!0),R($e,null,Pe(a.value,(le,he)=>(x(),R("div",{key:he,class:Se(["test-result-item",le.status])},[s("div",k1,[s("span",$1,E(y(le.status)),1),s("span",C1,E(le.name),1),s("span",_1,E(k(le.timestamp)),1)]),s("div",E1,[s("pre",null,E(le.details),1)]),le.error?(x(),R("div",T1,[z[8]||(z[8]=s("strong",null,"Error:",-1)),T(" "+E(le.error),1)])):de("",!0)],2))),128))],512)]),s("div",x1,[z[10]||(z[10]=s("h3",null,"๐ง Utility Results",-1)),r.value?(x(),R("div",R1,[s("pre",null,E(r.value),1)])):(x(),R("div",L1," Utility test results will appear here "))]),s("div",P1,[z[17]||(z[17]=s("h3",null,"๐ Performance Metrics",-1)),s("div",A1,[s("div",M1,[z[11]||(z[11]=s("span",{class:"metric-label"},"Messages Sent:",-1)),s("span",I1,E(l.value.messagesSent),1)]),s("div",N1,[z[12]||(z[12]=s("span",{class:"metric-label"},"Messages Received:",-1)),s("span",O1,E(l.value.messagesReceived),1)]),s("div",V1,[z[13]||(z[13]=s("span",{class:"metric-label"},"DHT Operations:",-1)),s("span",U1,E(l.value.dhtOperations),1)]),s("div",F1,[z[14]||(z[14]=s("span",{class:"metric-label"},"Test Duration:",-1)),s("span",K1,E(N(l.value.duration)),1)]),s("div",H1,[z[15]||(z[15]=s("span",{class:"metric-label"},"Success Rate:",-1)),s("span",B1,E(d.value)+"%",1)]),s("div",j1,[z[16]||(z[16]=s("span",{class:"metric-label"},"Avg Response Time:",-1)),s("span",G1,E(v.value)+"ms",1)])]),s("button",{onClick:ee,class:"btn btn-tertiary"}," ๐ Reset Metrics ")]),s("div",{class:"card"},[z[18]||(z[18]=s("h3",null,"๐ Export Options",-1)),s("div",{class:"button-grid"},[s("button",{onClick:ue,class:"btn btn-primary"}," ๐ Export All Logs "),s("button",{onClick:be,class:"btn btn-primary"}," ๐ Export Test Results "),s("button",{onClick:fe,class:"btn btn-primary"}," ๐ Export Metrics ")])])]))}},W1=_t(z1,[["__scopeId","data-v-6bb642a0"]]),J1=[{path:"/",redirect:"/network"},{path:"/network",name:"Network",component:sf},{path:"/messaging",name:"Messaging",component:Wf},{path:"/media",name:"Media",component:ag},{path:"/dht",name:"DHT",component:kv},{path:"/storage",name:"Storage",component:Xm},{path:"/crypto",name:"Crypto",component:Qh},{path:"/debug",name:"Debug",component:u1},{path:"/testing",name:"Testing",component:W1}],q1=jc({history:Dc(),routes:J1}),ro=iu(Vu),Y1=lu();ro.use(Y1);ro.use(q1);ro.mount("#app");
|