| 123456789101112 |
- import{bV as C,au as st,Z as A,a1 as V,ay as z,a7 as D,aV as rt,a5 as T,a6 as k,a9 as be,n as u,d as Oe,S as Ve,Q as Ne,$ as ge,T as t,aC as it,f as U,b4 as ut,ap as lt,bw as O,b5 as ct,ac as dt,c as Y,h as pe,j as ft,dP as pt,dQ as vt,a0 as f,a8 as ht,b3 as ve,c6 as te,aP as $e,a2 as he,c5 as Re,a3 as mt,dR as De}from"./index-8a67e3df.js";import{d as me}from"./dayjs-919e6097.js";import{_ as Me}from"./index.vue_vue_type_script_setup_true_lang-d980f666.js";import{S as yt}from"./state-f52d1a34.js";import{_ as K}from"./index.vue_vue_type_script_setup_true_lang-fe30c327.js";import{b as Z,g as L}from"./utils-cec4b140.js";import{_ as ye,D as $}from"./index-a5661619.js";function xe(s){"@babel/helpers - typeof";return xe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},xe(s)}var gt=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,ze={name:"JsonString",props:{jsonValue:{type:String,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var e=this.jsonValue,r=gt.test(e),o;return this.expand?(o={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},r?(e='<a href="'.concat(e,'" target="_blank" class="jv-link">').concat(e,"</a>"),o.innerHTML='"'.concat(e.toString(),'"')):o.innerText='"'.concat(e.toString(),'"')):o={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},C("span",{},[this.canExtend&&C("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),C("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),C("span",o)])}};ze.__file="src/Components/types/json-string.vue";var Le={name:"JsonUndefined",functional:!0,props:{jsonValue:{type:Object,default:null}},render:function(){return C("span",{class:{"jv-item":!0,"jv-undefined":!0},innerText:this.jsonValue===null?"null":"undefined"})}};Le.__file="src/Components/types/json-undefined.vue";var He={name:"JsonNumber",functional:!0,props:{jsonValue:{type:Number,required:!0}},render:function(){var e=Number.isInteger(this.jsonValue);return C("span",{class:{"jv-item":!0,"jv-number":!0,"jv-number-integer":e,"jv-number-float":!e},innerText:this.jsonValue.toString()})}};He.__file="src/Components/types/json-number.vue";var Ie={name:"JsonBoolean",functional:!0,props:{jsonValue:Boolean},render:function(){return C("span",{class:{"jv-item":!0,"jv-boolean":!0},innerText:this.jsonValue.toString()})}};Ie.__file="src/Components/types/json-boolean.vue";var Fe={name:"JsonObject",props:{jsonValue:{type:Object,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},expand:Boolean,sort:Boolean,previewMode:Boolean},data:function(){return{value:{}}},computed:{ordered:function(){var e=this;if(!this.sort)return this.value;var r={};return Object.keys(this.value).sort().forEach(function(o){r[o]=e.value[o]}),r}},watch:{jsonValue:function(e){this.setValue(e)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(e){var r=this;setTimeout(function(){r.value=e},0)},toggle:function(){this.$emit("update:expand",!this.expand),this.dispatchEvent()},dispatchEvent:function(){try{this.$el.dispatchEvent(new Event("resized"))}catch{var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(){var e=[];if(!this.previewMode&&!this.keyName&&e.push(C("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),e.push(C("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"{"})),this.expand){for(var r in this.ordered)if(this.ordered.hasOwnProperty(r)){var o=this.ordered[r];e.push(C(_e,{key:r,style:{display:this.expand?void 0:"none"},sort:this.sort,keyName:r,depth:this.depth+1,value:o,previewMode:this.previewMode}))}}return!this.expand&&Object.keys(this.value).length&&e.push(C("span",{style:{display:this.expand?"none":void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal object content (keys: ".concat(Object.keys(this.ordered).join(", "),")"),innerText:"..."})),e.push(C("span",{class:{"jv-item":!0,"jv-object":!0},innerText:"}"})),C("span",e)}};Fe.__file="src/Components/types/json-object.vue";var Ue={name:"JsonArray",props:{jsonValue:{type:Array,required:!0},keyName:{type:String,default:""},depth:{type:Number,default:0},sort:Boolean,expand:Boolean,previewMode:Boolean},data:function(){return{value:[]}},watch:{jsonValue:function(e){this.setValue(e)}},mounted:function(){this.setValue(this.jsonValue)},methods:{setValue:function(e){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;o===0&&(this.value=[]),setTimeout(function(){e.length>o&&(r.value.push(e[o]),r.setValue(e,o+1))},0)},toggle:function(){this.$emit("update:expand",!this.expand);try{this.$el.dispatchEvent(new Event("resized"))}catch{var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(){var e=this,r=[];return!this.previewMode&&!this.keyName&&r.push(C("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),r.push(C("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"["})),this.expand&&this.value.forEach(function(o,x){r.push(C(_e,{key:x,style:{display:e.expand?void 0:"none"},sort:e.sort,depth:e.depth+1,value:o,previewMode:e.previewMode}))}),!this.expand&&this.value.length&&r.push(C("span",{style:{display:void 0},class:{"jv-ellipsis":!0},onClick:this.toggle,title:"click to reveal ".concat(this.value.length," hidden items"),innerText:"..."})),r.push(C("span",{class:{"jv-item":!0,"jv-array":!0},innerText:"]"})),C("span",r)}};Ue.__file="src/Components/types/json-array.vue";var Je={name:"JsonFunction",functional:!0,props:{jsonValue:{type:Function,required:!0}},render:function(){return C("span",{class:{"jv-item":!0,"jv-function":!0},attrs:{title:this.jsonValue.toString()},innerHTML:"<function>"})}};Je.__file="src/Components/types/json-function.vue";var qe={name:"JsonDate",inject:["timeformat"],functional:!0,props:{jsonValue:{type:Date,required:!0}},render:function(){var e=this.jsonValue,r=this.timeformat;return C("span",{class:{"jv-item":!0,"jv-string":!0},innerText:'"'.concat(r(e),'"')})}};qe.__file="src/Components/types/json-date.vue";var bt=/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,Ge={name:"JsonString",props:{jsonValue:{type:RegExp,required:!0}},data:function(){return{expand:!0,canExtend:!1}},mounted:function(){this.$refs.itemRef.offsetHeight>this.$refs.holderRef.offsetHeight&&(this.canExtend=!0)},methods:{toggle:function(){this.expand=!this.expand}},render:function(){var e=this.jsonValue,r=bt.test(e),o;return this.expand?(o={class:{"jv-item":!0,"jv-string":!0},ref:"itemRef"},r?(e='<a href="'.concat(e,'" target="_blank" class="jv-link">').concat(e,"</a>"),o.innerHTML="".concat(e.toString())):o.innerText="".concat(e.toString())):o={class:{"jv-ellipsis":!0},onClick:this.toggle,innerText:"..."},C("span",{},[this.canExtend&&C("span",{class:{"jv-toggle":!0,open:this.expand},onClick:this.toggle}),C("span",{class:{"jv-holder-node":!0},ref:"holderRef"}),C("span",o)])}};Ge.__file="src/Components/types/json-regexp.vue";var _e={name:"JsonBox",inject:["expandDepth","keyClick"],props:{value:{type:[Object,Array,String,Number,Boolean,Function,Date],default:null},keyName:{type:String,default:""},sort:Boolean,depth:{type:Number,default:0},previewMode:Boolean},data:function(){return{expand:!0}},mounted:function(){this.expand=this.previewMode||!(this.depth>=this.expandDepth)},methods:{toggle:function(){this.expand=!this.expand;try{this.$el.dispatchEvent(new Event("resized"))}catch{var e=document.createEvent("Event");e.initEvent("resized",!0,!1),this.$el.dispatchEvent(e)}}},render:function(){var e=this,r=[],o;this.value===null||this.value===void 0?o=Le:Array.isArray(this.value)?o=Ue:Object.prototype.toString.call(this.value)==="[object Date]"?o=qe:this.value.constructor===RegExp?o=Ge:xe(this.value)==="object"?o=Fe:typeof this.value=="number"?o=He:typeof this.value=="string"?o=ze:typeof this.value=="boolean"?o=Ie:typeof this.value=="function"&&(o=Je);var x=this.keyName&&this.value&&(Array.isArray(this.value)||xe(this.value)==="object"&&Object.prototype.toString.call(this.value)!=="[object Date]");return!this.previewMode&&x&&r.push(C("span",{class:{"jv-toggle":!0,open:!!this.expand},onClick:this.toggle})),this.keyName&&r.push(C("span",{class:{"jv-key":!0},onClick:function(){e.keyClick(e.keyName)},innerText:"".concat(this.keyName,":")})),r.push(C(o,{class:{"jv-push":!0},jsonValue:this.value,keyName:this.keyName,sort:this.sort,depth:this.depth,expand:this.expand,previewMode:this.previewMode,"onUpdate:expand":function(v){e.expand=v}})),C("div",{class:{"jv-node":!0,"jv-key-node":!!this.keyName&&!x,toggle:!this.previewMode&&x}},r)}};_e.__file="src/Components/json-box.vue";var xt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function _t(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var Ye={exports:{}};(function(s,e){(function(o,x){s.exports=x()})(xt,function(){return function(){var r={686:function(n,v,a){a.d(v,{default:function(){return de}});var h=a(279),g=a.n(h),_=a(370),P=a.n(_),E=a(817),M=a.n(E);function j(c){try{return document.execCommand(c)}catch{return!1}}var R=function(l){var i=M()(l);return j("cut"),i},w=R;function B(c){var l=document.documentElement.getAttribute("dir")==="rtl",i=document.createElement("textarea");i.style.fontSize="12pt",i.style.border="0",i.style.padding="0",i.style.margin="0",i.style.position="absolute",i.style[l?"right":"left"]="-9999px";var m=window.pageYOffset||document.documentElement.scrollTop;return i.style.top="".concat(m,"px"),i.setAttribute("readonly",""),i.value=c,i}var ae=function(l){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},m="";if(typeof l=="string"){var d=B(l);i.container.appendChild(d),m=M()(d),j("copy"),d.remove()}else m=M()(l),j("copy");return m},Q=ae;function J(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?J=function(i){return typeof i}:J=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},J(c)}var oe=function(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=l.action,m=i===void 0?"copy":i,d=l.container,b=l.target,N=l.text;if(m!=="copy"&&m!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(b!==void 0)if(b&&J(b)==="object"&&b.nodeType===1){if(m==="copy"&&b.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(m==="cut"&&(b.hasAttribute("readonly")||b.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(N)return Q(N,{container:d});if(b)return m==="cut"?w(b):Q(b,{container:d})},se=oe;function H(c){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?H=function(i){return typeof i}:H=function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},H(c)}function re(c,l){if(!(c instanceof l))throw new TypeError("Cannot call a class as a function")}function q(c,l){for(var i=0;i<l.length;i++){var m=l[i];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(c,m.key,m)}}function je(c,l,i){return l&&q(c.prototype,l),i&&q(c,i),c}function ie(c,l){if(typeof l!="function"&&l!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(l&&l.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),l&&I(c,l)}function I(c,l){return I=Object.setPrototypeOf||function(m,d){return m.__proto__=d,m},I(c,l)}function F(c){var l=ce();return function(){var m=G(c),d;if(l){var b=G(this).constructor;d=Reflect.construct(m,arguments,b)}else d=m.apply(this,arguments);return ue(this,d)}}function ue(c,l){return l&&(H(l)==="object"||typeof l=="function")?l:le(c)}function le(c){if(c===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return c}function ce(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch{return!1}}function G(c){return G=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},G(c)}function X(c,l){var i="data-clipboard-".concat(c);if(l.hasAttribute(i))return l.getAttribute(i)}var ne=function(c){ie(i,c);var l=F(i);function i(m,d){var b;return re(this,i),b=l.call(this),b.resolveOptions(d),b.listenClick(m),b}return je(i,[{key:"resolveOptions",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof d.action=="function"?d.action:this.defaultAction,this.target=typeof d.target=="function"?d.target:this.defaultTarget,this.text=typeof d.text=="function"?d.text:this.defaultText,this.container=H(d.container)==="object"?d.container:document.body}},{key:"listenClick",value:function(d){var b=this;this.listener=P()(d,"click",function(N){return b.onClick(N)})}},{key:"onClick",value:function(d){var b=d.delegateTarget||d.currentTarget,N=this.action(b)||"copy",ee=se({action:N,container:this.container,target:this.target(b),text:this.text(b)});this.emit(ee?"success":"error",{action:N,text:ee,trigger:b,clearSelection:function(){b&&b.focus(),document.activeElement.blur(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(d){return X("action",d)}},{key:"defaultTarget",value:function(d){var b=X("target",d);if(b)return document.querySelector(b)}},{key:"defaultText",value:function(d){return X("text",d)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(d){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return Q(d,b)}},{key:"cut",value:function(d){return w(d)}},{key:"isSupported",value:function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],b=typeof d=="string"?[d]:d,N=!!document.queryCommandSupported;return b.forEach(function(ee){N=N&&!!document.queryCommandSupported(ee)}),N}}]),i}(g()),de=ne},828:function(n){var v=9;if(typeof Element<"u"&&!Element.prototype.matches){var a=Element.prototype;a.matches=a.matchesSelector||a.mozMatchesSelector||a.msMatchesSelector||a.oMatchesSelector||a.webkitMatchesSelector}function h(g,_){for(;g&&g.nodeType!==v;){if(typeof g.matches=="function"&&g.matches(_))return g;g=g.parentNode}}n.exports=h},438:function(n,v,a){var h=a(828);function g(E,M,j,R,w){var B=P.apply(this,arguments);return E.addEventListener(j,B,w),{destroy:function(){E.removeEventListener(j,B,w)}}}function _(E,M,j,R,w){return typeof E.addEventListener=="function"?g.apply(null,arguments):typeof j=="function"?g.bind(null,document).apply(null,arguments):(typeof E=="string"&&(E=document.querySelectorAll(E)),Array.prototype.map.call(E,function(B){return g(B,M,j,R,w)}))}function P(E,M,j,R){return function(w){w.delegateTarget=h(w.target,M),w.delegateTarget&&R.call(E,w)}}n.exports=_},879:function(n,v){v.node=function(a){return a!==void 0&&a instanceof HTMLElement&&a.nodeType===1},v.nodeList=function(a){var h=Object.prototype.toString.call(a);return a!==void 0&&(h==="[object NodeList]"||h==="[object HTMLCollection]")&&"length"in a&&(a.length===0||v.node(a[0]))},v.string=function(a){return typeof a=="string"||a instanceof String},v.fn=function(a){var h=Object.prototype.toString.call(a);return h==="[object Function]"}},370:function(n,v,a){var h=a(879),g=a(438);function _(j,R,w){if(!j&&!R&&!w)throw new Error("Missing required arguments");if(!h.string(R))throw new TypeError("Second argument must be a String");if(!h.fn(w))throw new TypeError("Third argument must be a Function");if(h.node(j))return P(j,R,w);if(h.nodeList(j))return E(j,R,w);if(h.string(j))return M(j,R,w);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function P(j,R,w){return j.addEventListener(R,w),{destroy:function(){j.removeEventListener(R,w)}}}function E(j,R,w){return Array.prototype.forEach.call(j,function(B){B.addEventListener(R,w)}),{destroy:function(){Array.prototype.forEach.call(j,function(B){B.removeEventListener(R,w)})}}}function M(j,R,w){return g(document.body,j,R,w)}n.exports=_},817:function(n){function v(a){var h;if(a.nodeName==="SELECT")a.focus(),h=a.value;else if(a.nodeName==="INPUT"||a.nodeName==="TEXTAREA"){var g=a.hasAttribute("readonly");g||a.setAttribute("readonly",""),a.select(),a.setSelectionRange(0,a.value.length),g||a.removeAttribute("readonly"),h=a.value}else{a.hasAttribute("contenteditable")&&a.focus();var _=window.getSelection(),P=document.createRange();P.selectNodeContents(a),_.removeAllRanges(),_.addRange(P),h=_.toString()}return h}n.exports=v},279:function(n){function v(){}v.prototype={on:function(a,h,g){var _=this.e||(this.e={});return(_[a]||(_[a]=[])).push({fn:h,ctx:g}),this},once:function(a,h,g){var _=this;function P(){_.off(a,P),h.apply(g,arguments)}return P._=h,this.on(a,P,g)},emit:function(a){var h=[].slice.call(arguments,1),g=((this.e||(this.e={}))[a]||[]).slice(),_=0,P=g.length;for(_;_<P;_++)g[_].fn.apply(g[_].ctx,h);return this},off:function(a,h){var g=this.e||(this.e={}),_=g[a],P=[];if(_&&h)for(var E=0,M=_.length;E<M;E++)_[E].fn!==h&&_[E].fn._!==h&&P.push(_[E]);return P.length?g[a]=P:delete g[a],this}},n.exports=v,n.exports.TinyEmitter=v}},o={};function x(n){if(o[n])return o[n].exports;var v=o[n]={exports:{}};return r[n](v,v.exports,x),v.exports}return function(){x.n=function(n){var v=n&&n.__esModule?function(){return n.default}:function(){return n};return x.d(v,{a:v}),v}}(),function(){x.d=function(n,v){for(var a in v)x.o(v,a)&&!x.o(n,a)&&Object.defineProperty(n,a,{enumerable:!0,get:v[a]})}}(),function(){x.o=function(n,v){return Object.prototype.hasOwnProperty.call(n,v)}}(),x(686)}().default})})(Ye);var jt=_t(Ye.exports),kt=function(e,r){var o=Date.now(),x;return function(){for(var n=arguments.length,v=new Array(n),a=0;a<n;a++)v[a]=arguments[a];Date.now()-o<r&&x&&clearTimeout(x),x=setTimeout(function(){e.apply(void 0,v)},r),o=Date.now()}},Se={name:"JsonViewer",components:{JsonBox:_e},props:{value:{type:[Object,Array,String,Number,Boolean,Function],required:!0},expanded:{type:Boolean,default:!1},expandDepth:{type:Number,default:1},copyable:{type:[Boolean,Object],default:!1},sort:{type:Boolean,default:!1},boxed:{type:Boolean,default:!1},theme:{type:String,default:"light"},timeformat:{type:Function,default:function(e){return e.toLocaleString()}},previewMode:{type:Boolean,default:!1}},provide:function(){return{expandDepth:this.expandDepth,timeformat:this.timeformat,keyClick:this.keyClick}},data:function(){return{copied:!1,expandableCode:!1,expandCode:this.expanded}},emits:["onKeyClick"],computed:{jvClass:function(){return"jv-container jv-"+this.theme+(this.boxed?" boxed":"")},copyText:function(){var e=this.copyable,r=e.copyText,o=e.copiedText,x=e.timeout,n=e.align;return{copyText:r||"copy",copiedText:o||"copied!",timeout:x||2e3,align:n}}},watch:{value:function(){this.onResized()}},mounted:function(){var e=this;if(this.debounceResized=kt(this.debResized.bind(this),200),this.boxed&&this.$refs.jsonBox&&(this.onResized(),this.$refs.jsonBox.$el.addEventListener("resized",this.onResized,!0)),this.copyable){var r=new jt(this.$refs.clip,{text:function(){return JSON.stringify(e.value,null,2)}});r.on("success",function(o){e.onCopied(o)})}},methods:{onResized:function(){this.debounceResized()},debResized:function(){var e=this;this.$nextTick(function(){e.$refs.jsonBox&&(e.$refs.jsonBox.$el.clientHeight>=250?e.expandableCode=!0:e.expandableCode=!1)})},keyClick:function(e){this.$emit("onKeyClick",e)},onCopied:function(e){var r=this;this.copied||(this.copied=!0,setTimeout(function(){r.copied=!1},this.copyText.timeout),this.$emit("copied",e))},toggleExpandCode:function(){this.expandCode=!this.expandCode}}};function Tt(s,e,r,o,x,n){var v=st("json-box");return A(),V("div",{class:z(n.jvClass)},[r.copyable?(A(),V("div",{key:0,class:z("jv-tooltip ".concat(n.copyText.align||"right"))},[D("span",{ref:"clip",class:z(["jv-button",{copied:x.copied}])},[rt(s.$slots,"copy",{copied:x.copied},function(){return[T(k(x.copied?n.copyText.copiedText:n.copyText.copyText),1)]})],2)],2)):be("v-if",!0),D("div",{class:z(["jv-code",{open:x.expandCode,boxed:r.boxed}])},[u(v,{ref:"jsonBox",value:r.value,sort:r.sort,"preview-mode":r.previewMode},null,8,["value","sort","preview-mode"])],2),x.expandableCode&&r.boxed?(A(),V("div",{key:1,class:"jv-more",onClick:e[0]||(e[0]=function(){return n.toggleExpandCode&&n.toggleExpandCode.apply(n,arguments)})},[D("span",{class:z(["jv-toggle",{open:!!x.expandCode}])},null,2)])):be("v-if",!0)],2)}Se.render=Tt;Se.__file="src/Components/json-viewer.vue";const Ae=Oe({__name:"index",props:{jsonData:{type:Object,default:()=>({})}},setup(s){const e=Ve(),{getDarkMode:r}=Ne(e);return(o,x)=>(A(),ge(t(Se),{boxed:"",sort:"",value:s.jsonData,copyable:{copyText:"复制",copiedText:"已复制"},class:"w-full",expanded:!0,theme:t(r)},null,8,["value","theme"]))}});const St={class:"flex-1"},Ct={class:"flex items-center gap-1"},wt={class:"flex items-center gap-4"},Et={key:0,class:"flex"},Pt={key:1,class:"flex gap-4"},$t={class:"flex-1"},Rt={class:"flex justify-between items-center mb-2"},Dt={class:"flex-1"},Mt={class:"flex justify-between items-center mb-2"},At=["innerHTML"],Bt={key:1},Ot={class:"flex items-center gap-4"},Vt={key:0,class:"flex"},Nt={key:1,class:"flex gap-4"},zt={class:"flex-1"},Lt={class:"flex justify-between items-center mb-2"},Ht={class:"flex-1"},It={class:"flex justify-between items-center mb-2"},Ft=["innerHTML"],Ut={key:1},Be=100,W=50,en=Oe({__name:"detail",setup(s){const{t:e}=it(),{getDarkMode:r}=Ne(Ve()),o=U(()=>r.value===ut.DARK),x=lt(),n=O({}),{resume:v,pause:a}=ct(ie),h=U(()=>decodeURIComponent(dt.currentRoute.value.query.path)),g=Y("stats"),_=Y("stats"),P=Y([]),E=Y([]);let M=null,j=null;const R=y=>{y==="realtime"&&!M?M=De(h.value,"audio",p=>{P.value.push({size:p.wrap?.[0]?.size||0,timestamp:p.timestamp}),P.value.length>Be&&P.value.shift()}):y==="stats"&&M&&(M(),M=null)},w=y=>{y==="realtime"&&!j?j=De(h.value,"video",p=>{E.value.push({size:p.wrap?.[0]?.size||0,keyFrame:p.keyFrame,timestamp:p.timestamp}),E.value.length>Be&&E.value.shift()}):y==="stats"&&j&&(j(),j=null)};pe(g,y=>{R(y)}),pe(_,y=>{w(y)}),ft(()=>{M?.(),j?.()}),pe(h,y=>{y?(ie(),v()):a()},{immediate:!0});const B=O([]),ae=O([]),Q=O([]),J=O([]),oe=O([]),se=O([]),H=O([]),re=O([]),q=U(()=>B.value?.length?B.value.reduce((y,p)=>{const S=p.audioReader?.bps||0,Te=p.videoReader?.bps||0;return y+S+Te},0):0),je=U(()=>{const y=n.value.audioTrack?.bps||0,p=n.value.videoTrack?.bps||0;return y+p});function ie(){h.value&&(pt(h.value).then(y=>{n.value=y||{},Z(ae.value,me(new Date).format("HH:mm:ss"),W),Z(Q.value,n.value.audioTrack?.bps>>10||0,W),Z(J.value,n.value.audioTrack?.fps||0,W),Z(oe.value,n.value.videoTrack?.bps>>10||0,W),Z(se.value,n.value.videoTrack?.fps||0,W),Z(H.value,n.value.videoTrack?.gop||0,W),de()}),vt(h.value).then(y=>{B.value=y||[],Z(re.value,q.value>>10||0,W),de()}))}const I=(y,p="YYYY-MM-DD HH:mm:ss")=>me(y).format(p),F={xAxis:{type:"category",data:ae},yAxis:{type:"value",min:"dataMin",max:"dataMax"}},ue=O({}),le=O({}),ce=O({}),G=O({}),X=O({}),ne=O({});function de(){ue.value={...F,legend:{data:[`${e("routes.streamPush.音频码率")}: ${L(n.value.audioTrack?.bps||0)}`]},series:[{type:"line",smooth:!0,data:Q.value,name:`${e("routes.streamPush.音频码率")}: ${L(n.value.audioTrack?.bps||0)}`}]},le.value={...F,legend:{data:[`${e("routes.streamPush.音频帧率")}: ${n.value.audioTrack?.fps||0}`]},series:[{type:"line",smooth:!0,data:J.value,name:`${e("routes.streamPush.音频帧率")}: ${n.value.audioTrack?.fps||0}`}]},ce.value={...F,legend:{data:[`${e("routes.streamPush.视频码率")}: ${L(n.value.videoTrack?.bps||0)}`]},series:[{type:"line",smooth:!0,data:oe.value,name:`${e("routes.streamPush.视频码率")}: ${L(n.value.videoTrack?.bps||0)}`}]},G.value={...F,legend:{data:[`${e("routes.streamPush.视频帧率")}: ${n.value.videoTrack?.fps||0}`]},series:[{type:"line",smooth:!0,data:se.value,name:`${e("routes.streamPush.视频帧率")}: ${n.value.videoTrack?.fps||0}`}]},X.value={...F,legend:{data:[`${e("routes.streamPush.视频GOP")}: ${n.value.videoTrack?.gop||0}`]},series:[{type:"line",smooth:!0,data:H.value,name:`${e("routes.streamPush.视频GOP")}: ${n.value.videoTrack?.gop||0}`}]},ne.value={...F,legend:{data:[`${e("routes.streamPush.下行码率")}: ${L(q.value)}`]},series:[{type:"line",smooth:!0,data:re.value,name:`${e("routes.streamPush.下行码率")}: ${L(q.value)}`}]}}const c=Y(!1),l=Y([]),i=Y([]);pe(c,y=>{y&&(l.value=[...P.value],i.value=[...E.value])});const m=U(()=>(c.value?l.value:P.value).map(p=>`${me(p.timestamp).format("HH:mm:ss.SSS")} ${L(p.size).padStart(10)}`).join(`
- `)),d=U(()=>(c.value?i.value:E.value).map(p=>`${me(p.timestamp).format("HH:mm:ss.SSS")} ${L(p.size).padStart(10)} ${p.keyFrame?"是":"否"}`).join(`
- `)),b=U(()=>{const y=c.value?l.value:P.value;return ke(y,"audio")}),N=U(()=>{const y=c.value?i.value:E.value;return ke(y,"video")});function ee(){const y=o.value?"#141414":"#f0f2f5",p=o.value?"#666":"#999";return`<svg width="100%" height="200" style="background: ${y}">
- <text x="50%" y="50%" text-anchor="middle" fill="${p}">暂无数据</text>
- </svg>`}function ke(y,p){if(!y?.length)return ee();const S=200,Te=Math.max(...y.map(fe=>fe.size),1),Ke="100%",Ce=500,we=4,Ee=we+1,Ze=o.value?"#141414":"#f0f2f5",We=o.value?"#bb86fc":"#1890ff",Qe=o.value?"#ff7875":"#ff4d4f",Xe=Math.floor(Ce/Ee),et=Math.max(0,y.length-Xe),tt=y.slice(et).map((fe,nt)=>{const at=nt*Ee,Pe=fe.size/Te*S,ot=p==="video"&&fe.keyFrame?Qe:We;return`<rect
- x="${at}"
- y="${S-Pe}"
- width="${we}"
- height="${Pe}"
- fill="${ot}"
- />`}).join("");return`<svg width="${Ke}" height="${S}" viewBox="0 0 ${Ce} ${S}" preserveAspectRatio="none" style="background: ${Ze}">${tt}</svg>`}return(y,p)=>(A(),V("div",St,[u(t(ve),{bordered:!1,title:t(e)("routes.streamPush.基础信息")},{default:f(()=>[u(t(ye),{column:3},{default:f(()=>[u(t($),{label:t(e)("routes.streamPush.流标识")},{default:f(()=>[T(k(n.value.path),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.流类型")},{default:f(()=>[T(k(n.value.type),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.所属插件")},{default:f(()=>[T(k(n.value.pluginName),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.流状态")},{default:f(()=>[u(t(yt),{state:n.value.state},null,8,["state"])]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.创建时间")},{default:f(()=>[p[6]||(p[6]=T(" [")),u(t(Me),{value:I(n.value.startTime),class:"text-primary"},null,8,["value"]),T("] "+k(I(n.value.startTime)),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.当无人订阅时自动关闭")},{default:f(()=>[D("span",Ct,[T(k(n.value?.stopOnIdle)+" ",1),u(t(ht),{icon:"ant-design:question-circle-filled",class:"cursor-pointer"})])]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.总上行码率")},{default:f(()=>[T(k(t(L)(je.value)+"/s"),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.总下行码率")},{default:f(()=>[T(k(t(L)(q.value)+"/s"),1)]),_:1},8,["label"]),u(t($),{label:""})]),_:1})]),_:1},8,["title"]),u(t(ve),{bordered:!1,title:t(e)("routes.streamPush.音频轨道"),class:"mt-10px"},{extra:f(()=>[D("div",wt,[u(t(te).Group,{value:g.value,"onUpdate:value":p[0]||(p[0]=S=>g.value=S),"button-style":"solid"},{default:f(()=>[u(t(te).Button,{value:"stats"},{default:f(()=>[T(k(t(e)("routes.streamPush.数据统计")),1)]),_:1}),u(t(te).Button,{value:"realtime"},{default:f(()=>[T(k(t(e)("routes.streamPush.实时数据")),1)]),_:1})]),_:1},8,["value"]),n.value.audioTrack?(A(),ge(t($e),{key:0,type:"link",onClick:p[1]||(p[1]=S=>t(x)({name:"MonitorTrackSnapAudio",query:{streamPath:decodeURIComponent(n.value.path)}}))},{default:f(()=>[T(k(t(e)("routes.streamPush.查看快照")),1)]),_:1})):be("",!0)])]),default:f(()=>[n.value.audioTrack?(A(),V("div",Et,[u(t(ye),{class:"flex-1",column:1},{default:f(()=>[u(t($),{label:t(e)("routes.streamPush.编码格式")},{default:f(()=>[T(k(n.value.audioTrack.codec),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.采样率")},{default:f(()=>[T(k(n.value.audioTrack.sampleRate),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.声道数")},{default:f(()=>[T(k(n.value.audioTrack.channels),1)]),_:1},8,["label"])]),_:1}),g.value==="stats"?(A(),V(he,{key:0},[u(K,{option:ue.value,class:"flex-1 h-200px"},null,8,["option"]),u(K,{option:le.value,class:"flex-1 h-200px"},null,8,["option"]),u(K,{option:ne.value,class:"flex-1 h-200px"},null,8,["option"])],64)):(A(),V("div",Pt,[D("div",$t,[D("div",Rt,[D("span",{class:z(["text-sm",o.value?"text-gray-400":"text-gray-600"])},"实时数据",2),u(t(Re),{checked:c.value,"onUpdate:checked":p[2]||(p[2]=S=>c.value=S),"checked-children":"暂停","un-checked-children":"实时",class:"ml-2"},null,8,["checked"])]),D("pre",{class:z(["text-sm h-200px overflow-auto m-0 p-2 rounded",o.value?"bg-[#141414] text-gray-300":"bg-[#f0f2f5] text-gray-700"])},k(m.value),3)]),D("div",Dt,[D("div",Mt,[D("span",{class:z(["text-sm",o.value?"text-gray-400":"text-gray-600"])},"波形图",2)]),D("div",{class:"h-200px overflow-hidden",innerHTML:b.value},null,8,At)])]))])):(A(),V("div",Bt,k(t(e)("routes.streamPush.暂无信息")),1))]),_:1},8,["title"]),u(t(ve),{bordered:!1,title:t(e)("routes.streamPush.视频轨道"),class:"mt-10px"},{extra:f(()=>[D("div",Ot,[u(t(te).Group,{value:_.value,"onUpdate:value":p[3]||(p[3]=S=>_.value=S),"button-style":"solid"},{default:f(()=>[u(t(te).Button,{value:"stats"},{default:f(()=>[T(k(t(e)("routes.streamPush.数据统计")),1)]),_:1}),u(t(te).Button,{value:"realtime"},{default:f(()=>[T(k(t(e)("routes.streamPush.实时数据")),1)]),_:1})]),_:1},8,["value"]),n.value.videoTrack?(A(),ge(t($e),{key:0,type:"link",onClick:p[4]||(p[4]=S=>t(x)({name:"MonitorTrackSnapVideo",query:{streamPath:decodeURIComponent(n.value.path)}}))},{default:f(()=>[T(k(t(e)("routes.streamPush.查看快照")),1)]),_:1})):be("",!0)])]),default:f(()=>[n.value.videoTrack?(A(),V("div",Vt,[u(t(ye),{class:"flex-1",column:1},{default:f(()=>[u(t($),{label:t(e)("routes.streamPush.编码格式")},{default:f(()=>[T(k(n.value.videoTrack.codec),1)]),_:1},8,["label"]),u(t($),{label:t(e)("routes.streamPush.分辨率")},{default:f(()=>[T(k(n.value.videoTrack.width)+"x"+k(n.value.videoTrack.height),1)]),_:1},8,["label"])]),_:1}),_.value==="stats"?(A(),V(he,{key:0},[u(K,{option:ce.value,class:"flex-1 h-200px"},null,8,["option"]),u(K,{option:G.value,class:"flex-1 h-200px"},null,8,["option"]),u(K,{option:X.value,class:"flex-1 h-200px"},null,8,["option"]),u(K,{option:ne.value,class:"flex-1 h-200px"},null,8,["option"])],64)):(A(),V("div",Nt,[D("div",zt,[D("div",Lt,[D("span",{class:z(["text-sm",o.value?"text-gray-400":"text-gray-600"])},"实时数据",2),u(t(Re),{checked:c.value,"onUpdate:checked":p[5]||(p[5]=S=>c.value=S),"checked-children":"暂停","un-checked-children":"实时",class:"ml-2"},null,8,["checked"])]),D("pre",{class:z(["text-sm h-200px overflow-auto m-0 p-2 rounded",o.value?"bg-[#141414] text-gray-300":"bg-[#f0f2f5] text-gray-700"])},k(d.value),3)]),D("div",Ht,[D("div",It,[D("span",{class:z(["text-sm",o.value?"text-gray-400":"text-gray-600"])},"波形图",2)]),D("div",{class:"h-200px overflow-hidden",innerHTML:N.value},null,8,Ft)])]))])):(A(),V("div",Ut,k(t(e)("routes.streamPush.暂无信息")),1))]),_:1},8,["title"]),u(t(ve),{bordered:!1,class:"mt-10px"},{default:f(()=>[u(t(ye),{title:t(e)("routes.streamPush.订阅者信息")},{default:f(()=>[B.value.length?(A(!0),V(he,{key:0},mt(B.value,S=>(A(),V(he,{key:S.id},[u(t($),{label:t(e)("routes.record.ID")},{default:f(()=>[T(k(S?.id),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.所属插件")},{default:f(()=>[T(k(S?.pluginName),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.类型")},{default:f(()=>[T(k(S?.type),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.开始时间")},{default:f(()=>[p[7]||(p[7]=T(" [")),u(t(Me),{value:I(S.startTime),class:"text-primary"},null,8,["value"]),T("] "+k(I(S.startTime)),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.pullProxy.描述"),span:3},{default:f(()=>[T(k(S?.meta||"--"),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.同步模式")},{default:f(()=>[T(k(S?.syncMode),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.订阅模式")},{default:f(()=>[T(k(S?.subMode),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.缓存时间")},{default:f(()=>[T(k(S?.bufferTime),1)]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.音频读取"),span:3},{default:f(()=>[u(Ae,{jsonData:S?.audioReader||{}},null,8,["jsonData"])]),_:2},1032,["label"]),u(t($),{label:t(e)("routes.streamPush.视频读取"),span:3},{default:f(()=>[u(Ae,{jsonData:S?.videoReader||{}},null,8,["jsonData"])]),_:2},1032,["label"])],64))),128)):(A(),ge(t($),{key:1},{default:f(()=>[T(k(t(e)("routes.streamPush.暂无信息")),1)]),_:1}))]),_:1},8,["title"])]),_:1})]))}});export{en as default};
- //# sourceMappingURL=detail-095871ab.js.map
|