UNPKG

@lanyue/react-object-viewer

Version:

A flexible and lightweight object viewer component for React.

33 lines (29 loc) 28.6 kB
(function(O,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],x):(O=typeof globalThis<"u"?globalThis:O||self,x(O.ReactDataViewer={},O.React))})(this,function(O,x){"use strict";var X={exports:{}},L={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var se;function $e(){if(se)return L;se=1;var r=x,s=Symbol.for("react.element"),i=Symbol.for("react.fragment"),p=Object.prototype.hasOwnProperty,f=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function v(g,d,j){var y,_={},N=null,Y=null;j!==void 0&&(N=""+j),d.key!==void 0&&(N=""+d.key),d.ref!==void 0&&(Y=d.ref);for(y in d)p.call(d,y)&&!l.hasOwnProperty(y)&&(_[y]=d[y]);if(g&&g.defaultProps)for(y in d=g.defaultProps,d)_[y]===void 0&&(_[y]=d[y]);return{$$typeof:s,type:g,key:N,ref:Y,props:_,_owner:f.current}}return L.Fragment=i,L.jsx=v,L.jsxs=v,L}var V={};/** * @license React * react-jsx-runtime.development.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var oe;function qe(){return oe||(oe=1,process.env.NODE_ENV!=="production"&&function(){var r=x,s=Symbol.for("react.element"),i=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),v=Symbol.for("react.provider"),g=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),y=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),Y=Symbol.for("react.offscreen"),Te=Symbol.iterator,sr="@@iterator";function or(e){if(e===null||typeof e!="object")return null;var t=Te&&e[Te]||e[sr];return typeof t=="function"?t:null}var I=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function E(e){{for(var t=arguments.length,a=new Array(t>1?t-1:0),o=1;o<t;o++)a[o-1]=arguments[o];lr("error",e,a)}}function lr(e,t,a){{var o=I.ReactDebugCurrentFrame,h=o.getStackAddendum();h!==""&&(t+="%s",a=a.concat([h]));var m=a.map(function(u){return String(u)});m.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,m)}}var cr=!1,ur=!1,fr=!1,dr=!1,hr=!1,Oe;Oe=Symbol.for("react.module.reference");function vr(e){return!!(typeof e=="string"||typeof e=="function"||e===p||e===l||hr||e===f||e===j||e===y||dr||e===Y||cr||ur||fr||typeof e=="object"&&e!==null&&(e.$$typeof===N||e.$$typeof===_||e.$$typeof===v||e.$$typeof===g||e.$$typeof===d||e.$$typeof===Oe||e.getModuleId!==void 0))}function mr(e,t,a){var o=e.displayName;if(o)return o;var h=t.displayName||t.name||"";return h!==""?a+"("+h+")":a}function Ce(e){return e.displayName||"Context"}function C(e){if(e==null)return null;if(typeof e.tag=="number"&&E("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case i:return"Portal";case l:return"Profiler";case f:return"StrictMode";case j:return"Suspense";case y:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case g:var t=e;return Ce(t)+".Consumer";case v:var a=e;return Ce(a._context)+".Provider";case d:return mr(e,e.render,"ForwardRef");case _:var o=e.displayName||null;return o!==null?o:C(e.type)||"Memo";case N:{var h=e,m=h._payload,u=h._init;try{return C(u(m))}catch{return null}}}return null}var k=Object.assign,F=0,Ne,ke,Pe,Ae,Ie,Me,De;function Le(){}Le.__reactDisabledLog=!0;function yr(){{if(F===0){Ne=console.log,ke=console.info,Pe=console.warn,Ae=console.error,Ie=console.group,Me=console.groupCollapsed,De=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}F++}}function gr(){{if(F--,F===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:k({},e,{value:Ne}),info:k({},e,{value:ke}),warn:k({},e,{value:Pe}),error:k({},e,{value:Ae}),group:k({},e,{value:Ie}),groupCollapsed:k({},e,{value:Me}),groupEnd:k({},e,{value:De})})}F<0&&E("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Q=I.ReactCurrentDispatcher,$;function U(e,t,a){{if($===void 0)try{throw Error()}catch(h){var o=h.stack.trim().match(/\n( *(at )?)/);$=o&&o[1]||""}return` `+$+e}}var q=!1,J;{var pr=typeof WeakMap=="function"?WeakMap:Map;J=new pr}function Ve(e,t){if(!e||q)return"";{var a=J.get(e);if(a!==void 0)return a}var o;q=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var m;m=Q.current,Q.current=null,yr();try{if(t){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(S){o=S}Reflect.construct(e,[],u)}else{try{u.call()}catch(S){o=S}e.call(u.prototype)}}else{try{throw Error()}catch(S){o=S}e()}}catch(S){if(S&&o&&typeof S.stack=="string"){for(var c=S.stack.split(` `),R=o.stack.split(` `),b=c.length-1,w=R.length-1;b>=1&&w>=0&&c[b]!==R[w];)w--;for(;b>=1&&w>=0;b--,w--)if(c[b]!==R[w]){if(b!==1||w!==1)do if(b--,w--,w<0||c[b]!==R[w]){var T=` `+c[b].replace(" at new "," at ");return e.displayName&&T.includes("<anonymous>")&&(T=T.replace("<anonymous>",e.displayName)),typeof e=="function"&&J.set(e,T),T}while(b>=1&&w>=0);break}}}finally{q=!1,Q.current=m,gr(),Error.prepareStackTrace=h}var D=e?e.displayName||e.name:"",P=D?U(D):"";return typeof e=="function"&&J.set(e,P),P}function xr(e,t,a){return Ve(e,!1)}function br(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function G(e,t,a){if(e==null)return"";if(typeof e=="function")return Ve(e,br(e));if(typeof e=="string")return U(e);switch(e){case j:return U("Suspense");case y:return U("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case d:return xr(e.render);case _:return G(e.type,t,a);case N:{var o=e,h=o._payload,m=o._init;try{return G(m(h),t,a)}catch{}}}return""}var z=Object.prototype.hasOwnProperty,Fe={},ze=I.ReactDebugCurrentFrame;function K(e){if(e){var t=e._owner,a=G(e.type,e._source,t?t.type:null);ze.setExtraStackFrame(a)}else ze.setExtraStackFrame(null)}function jr(e,t,a,o,h){{var m=Function.call.bind(z);for(var u in e)if(m(e,u)){var c=void 0;try{if(typeof e[u]!="function"){var R=Error((o||"React class")+": "+a+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw R.name="Invariant Violation",R}c=e[u](t,u,o,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(b){c=b}c&&!(c instanceof Error)&&(K(h),E("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",a,u,typeof c),K(null)),c instanceof Error&&!(c.message in Fe)&&(Fe[c.message]=!0,K(h),E("Failed %s type: %s",a,c.message),K(null))}}}var wr=Array.isArray;function ee(e){return wr(e)}function Er(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,a=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Rr(e){try{return Be(e),!1}catch{return!0}}function Be(e){return""+e}function We(e){if(Rr(e))return E("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Er(e)),Be(e)}var B=I.ReactCurrentOwner,_r={key:!0,ref:!0,__self:!0,__source:!0},He,Ye,re;re={};function Sr(e){if(z.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Tr(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Or(e,t){if(typeof e.ref=="string"&&B.current&&t&&B.current.stateNode!==t){var a=C(B.current.type);re[a]||(E('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',C(B.current.type),e.ref),re[a]=!0)}}function Cr(e,t){{var a=function(){He||(He=!0,E("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Nr(e,t){{var a=function(){Ye||(Ye=!0,E("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var kr=function(e,t,a,o,h,m,u){var c={$$typeof:s,type:e,key:t,ref:a,props:u,_owner:m};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function Pr(e,t,a,o,h){{var m,u={},c=null,R=null;a!==void 0&&(We(a),c=""+a),Tr(t)&&(We(t.key),c=""+t.key),Sr(t)&&(R=t.ref,Or(t,h));for(m in t)z.call(t,m)&&!_r.hasOwnProperty(m)&&(u[m]=t[m]);if(e&&e.defaultProps){var b=e.defaultProps;for(m in b)u[m]===void 0&&(u[m]=b[m])}if(c||R){var w=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&Cr(u,w),R&&Nr(u,w)}return kr(e,c,R,h,o,B.current,u)}}var te=I.ReactCurrentOwner,Ue=I.ReactDebugCurrentFrame;function M(e){if(e){var t=e._owner,a=G(e.type,e._source,t?t.type:null);Ue.setExtraStackFrame(a)}else Ue.setExtraStackFrame(null)}var ne;ne=!1;function ae(e){return typeof e=="object"&&e!==null&&e.$$typeof===s}function Je(){{if(te.current){var e=C(te.current.type);if(e)return` Check the render method of \``+e+"`."}return""}}function Ar(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return` Check your code at `+t+":"+a+"."}return""}}var Ge={};function Ir(e){{var t=Je();if(!t){var a=typeof e=="string"?e:e.displayName||e.name;a&&(t=` Check the top-level render call using <`+a+">.")}return t}}function Ke(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Ir(t);if(Ge[a])return;Ge[a]=!0;var o="";e&&e._owner&&e._owner!==te.current&&(o=" It was passed a child from "+C(e._owner.type)+"."),M(e),E('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,o),M(null)}}function Xe(e,t){{if(typeof e!="object")return;if(ee(e))for(var a=0;a<e.length;a++){var o=e[a];ae(o)&&Ke(o,t)}else if(ae(e))e._store&&(e._store.validated=!0);else if(e){var h=or(e);if(typeof h=="function"&&h!==e.entries)for(var m=h.call(e),u;!(u=m.next()).done;)ae(u.value)&&Ke(u.value,t)}}}function Mr(e){{var t=e.type;if(t==null||typeof t=="string")return;var a;if(typeof t=="function")a=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===d||t.$$typeof===_))a=t.propTypes;else return;if(a){var o=C(t);jr(a,e.props,"prop",o,e)}else if(t.PropTypes!==void 0&&!ne){ne=!0;var h=C(t);E("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",h||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&E("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Dr(e){{for(var t=Object.keys(e.props),a=0;a<t.length;a++){var o=t[a];if(o!=="children"&&o!=="key"){M(e),E("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),M(null);break}}e.ref!==null&&(M(e),E("Invalid attribute `ref` supplied to `React.Fragment`."),M(null))}}var Ze={};function Qe(e,t,a,o,h,m){{var u=vr(e);if(!u){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R=Ar(h);R?c+=R:c+=Je();var b;e===null?b="null":ee(e)?b="array":e!==void 0&&e.$$typeof===s?(b="<"+(C(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):b=typeof e,E("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",b,c)}var w=Pr(e,t,a,h,m);if(w==null)return w;if(u){var T=t.children;if(T!==void 0)if(o)if(ee(T)){for(var D=0;D<T.length;D++)Xe(T[D],e);Object.freeze&&Object.freeze(T)}else E("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Xe(T,e)}if(z.call(t,"key")){var P=C(e),S=Object.keys(t).filter(function(Wr){return Wr!=="key"}),ie=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Ze[P+ie]){var Br=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";E(`A props object containing a "key" prop is being spread into JSX: let props = %s; <%s {...props} /> React keys must be passed directly to JSX without using spread: let props = %s; <%s key={someKey} {...props} />`,ie,P,Br,P),Ze[P+ie]=!0}}return e===p?Dr(w):Mr(w),w}}function Lr(e,t,a){return Qe(e,t,a,!0)}function Vr(e,t,a){return Qe(e,t,a,!1)}var Fr=Vr,zr=Lr;V.Fragment=p,V.jsx=Fr,V.jsxs=zr}()),V}process.env.NODE_ENV==="production"?X.exports=$e():X.exports=qe();var n=X.exports;function er(r){const s=Object.getOwnPropertyDescriptors(r),i=[];for(const f in s)i.push({key:f,descriptor:s[f]});r instanceof Set&&i.push({key:"[[Values]]",descriptor:{enumerable:!0,value:[...r.entries()].reduce((f,l)=>(f[l[0]-1]=l[1],f),{})}}),r instanceof Map&&i.push({key:"[[Entries]]",descriptor:{enumerable:!0,value:[...r.entries()].reduce((f,l,v)=>(f[v]={key:l[0],value:l[1]},f),{})}});const p=Object.getPrototypeOf(r);if(p!==null){const f=Object.getOwnPropertyDescriptors(p);for(const l in f)!f[l].enumerable&&!f[l].get||l!=="__proto__"&&i.push({key:l,descriptor:f[l]});i.push({key:"[[Prototype]]",descriptor:{enumerable:!1,value:p}})}return i}function Z(r){const s=typeof r;if(s==="object"){if(r===null)return"null";if(Array.isArray(r))return"array"}return s}function le(r){try{return Object.getPrototypeOf(r).constructor.name}catch{return"<Blocked>"}}function A(r){if(Array.isArray(r))return r.filter(i=>!!i).join(" ");const s=[];for(const i in r)i&&r[i]&&s.push(i);return s.join(" ")}function ce(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"5",height:"7",viewBox:"0 0 5 7",className:"icon-arrow",children:n.jsx("path",{d:"M4.64 2.732l-3-2.5A1 1 0 0 0 0 1v5a1 1 0 0 0 1.64.768l3-2.5a1 1 0 0 0 0-1.536z",fillRule:"evenodd",opacity:".675"})})}function ue(){return n.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",className:"icon-ellipsis",fill:"currentColor",children:n.jsx("path",{d:"M8 256a56 56 0 1 1 112 0A56 56 0 1 1 8 256zm160 0a56 56 0 1 1 112 0 56 56 0 1 1 -112 0zm216-56a56 56 0 1 1 0 112 56 56 0 1 1 0-112z"})})}function fe(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M16 12a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4",className:"icon-object"}),n.jsx("path",{d:"M13.1 7.31l-1.15-.5V5.3A2.21 2.21 0 0 0 9.6 3.15a.75.75 0 0 0 0 1.5c.26 0 .86.08.86.65v2a.75.75 0 0 0 .44.7.75.75 0 0 0-.45.69v2c0 .3-.17.66-.85.66a.75.75 0 1 0 0 1.5 2.18 2.18 0 0 0 2.35-2.15V9.19l1.15-.5a.75.75 0 0 0 0-1.37zM5.55 7.3v-2c0-.57.6-.65.86-.65a.75.75 0 0 0 0-1.5A2.21 2.21 0 0 0 4.05 5.3v1.51l-1.15.5a.75.75 0 0 0 0 1.38l1.15.5v1.51a2.18 2.18 0 0 0 2.35 2.15.75.75 0 0 0 0-1.5c-.68 0-.84-.36-.85-.65v-2A.75.75 0 0 0 5.1 8a.75.75 0 0 0 .45-.7z",className:"icon-inner"})]})}function de(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M12 16H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4z",className:"icon-array"}),n.jsx("path",{d:"M6.7 12.65h-2a.75.75 0 0 1-.75-.75v-7a.75.75 0 0 1 .75-.75h2a.75.75 0 0 1 0 1.5H5.45v5.5H6.7a.75.75 0 1 1 0 1.5zM11.7 12.65h-2a.75.75 0 0 1 0-1.5h1.25v-5.5H9.7a.75.75 0 0 1 0-1.5h2a.75.75 0 0 1 .75.75v7a.75.75 0 0 1-.75.75z",className:"icon-inner"})]})}function he(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M16 12a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4",className:"icon-string"}),n.jsx("path",{d:"M6.4 5.65h.2a.75.75 0 0 0 0-1.5h-.2A2.55 2.55 0 0 0 3.85 6.7v4.2a.75.75 0 0 0 .75.75.74.74 0 0 0 .25-.05v.05H6.1a1.2 1.2 0 0 0 1.25-1.25A1.2 1.2 0 0 0 6.1 9.15h-.75V6.7A1 1 0 0 1 6.4 5.65zM11.1 9.15h-.75V6.3a.61.61 0 0 1 .65-.65h.6a.75.75 0 0 0 0-1.5H11A2.13 2.13 0 0 0 8.85 6.3v4.6a.75.75 0 0 0 .75.75.74.74 0 0 0 .25-.05v.05h1.25a1.2 1.2 0 0 0 1.25-1.25 1.2 1.2 0 0 0-1.25-1.25z",className:"icon-inner"})]})}function ve(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M12 16H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4z",className:"icon-number"}),n.jsx("path",{d:"M12 6h-1l.26-1a.75.75 0 1 0-1.45-.38L9.41 6H7.87l.26-1a.75.75 0 1 0-1.45-.37L6.32 6H5a.75.75 0 0 0 0 1.5h.9l-.42 1.75H4a.75.75 0 0 0 0 1.5h1.1l-.22.86a.75.75 0 0 0 .54.91h.19a.75.75 0 0 0 .72-.52l.32-1.24h1.52l-.2.76a.75.75 0 0 0 .54.92h.19a.75.75 0 0 0 .72-.56l.3-1.14H11a.75.75 0 0 0 0-1.5h-.89l.46-1.75H12A.75.75 0 0 0 12 6zM8.56 9.25H7l.48-1.75H9z",className:"icon-inner"})]})}function me(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16.05 16.05",children:[n.jsx("path",{d:"M12 16.05L4 16a4 4 0 0 1-4-4l.05-8a4 4 0 0 1 4-4l8 .05a4 4 0 0 1 4 4l-.05 8a4 4 0 0 1-4 4z",className:"icon-boolean"}),n.jsx("path",{d:"M7.53 4.28h-4a.75.75 0 0 0 0 1.5h1.24v5.25a.75.75 0 0 0 .75.75.75.75 0 0 0 .72-.78V5.75h1.29a.75.75 0 0 0 0-1.5zM12.51 7.32h-2.25V5.8h2.25a.75.75 0 0 0 0-1.5h-3a.75.75 0 0 0-.73.7v6a.75.75 0 0 0 .75.75.75.75 0 0 0 .75-.75V8.8h2.25a.75.75 0 0 0 0-1.5z",className:"icon-inner"})]})}function ye(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M16 12.3a3.76 3.76 0 0 1-3.7 3.7H3.7A3.69 3.69 0 0 1 0 12.3V3.7A3.69 3.69 0 0 1 3.7 0h8.6A3.69 3.69 0 0 1 16 3.7z",className:"icon-null"}),n.jsx("path",{d:"M10.68 4.73l.48-.86a.75.75 0 1 0-1.31-.73L9.37 4A4.2 4.2 0 0 0 8 3.75a4.23 4.23 0 0 0-2.68 7.52l-.48.86a.75.75 0 1 0 1.31.73l.48-.86a4.2 4.2 0 0 0 1.37.25 4.23 4.23 0 0 0 2.68-7.52zM5.25 8a2.73 2.73 0 0 1 3.38-2.67L6.06 9.95A2.74 2.74 0 0 1 5.25 8zM8 10.75a2.73 2.73 0 0 1-.63-.08l2.57-4.62A2.75 2.75 0 0 1 8 10.75z",className:"icon-inner"})]})}function ge(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M12.3 16H3.7A3.69 3.69 0 0 1 0 12.3V3.7A3.69 3.69 0 0 1 3.7 0h8.6A3.69 3.69 0 0 1 16 3.7v8.6a3.63 3.63 0 0 1-3.7 3.7z",className:"icon-undefined"}),n.jsx("path",{d:"M7.9 10.35a.75.75 0 0 1-.75-.75V8.3a.75.75 0 0 1 .57-.73c.07 0 1.83-.49 1.83-2 0-.5-.27-1.25-1.75-1.25a1.39 1.39 0 0 0-1.31.75.76.76 0 0 1-1 .38.74.74 0 0 1-.4-1 2.88 2.88 0 0 1 2.71-1.6c1.9 0 3.12 1 3.25 2.69a3.62 3.62 0 0 1-2.4 3.29v.77a.75.75 0 0 1-.75.75z",className:"icon-inner"}),n.jsx("circle",{cx:"7.9",cy:"12",r:".9",className:"icon-inner"})]})}function pe(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M12 16H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4z",className:"icon-symbol"}),n.jsx("path",{d:"M8.3 4l1.1 2.2c.1.1.2.2.3.2l2.5.4a.35.35 0 0 1 .2.6l-1.8 1.7a.37.37 0 0 0-.1.3l.4 2.5c.1.3-.3.5-.5.4l-2.2-1.2a.19.19 0 0 0-.3 0l-2.2 1.2c-.3.1-.6-.1-.5-.4l.4-2.5a.37.37 0 0 0-.1-.3L3.7 7.4a.35.35 0 0 1 .2-.6l2.5-.4c.1 0 .2-.1.3-.2L7.8 4c0-.3.4-.3.5 0z",className:"icon-inner"})]})}function xe(){return n.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 16 16",children:[n.jsx("path",{d:"M12 16H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h8a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4z",className:"icon-function"}),n.jsx("path",{d:"M7.4 3.62a2.61 2.61 0 0 0-1.78.8 3.52 3.52 0 0 0-.88 2.3H4.5a.78.78 0 1 0 0 1.56h.24v.59a.78.78 0 0 0 0 .25 7.32 7.32 0 0 1-.31 2.62.78.78 0 0 0 .19 1.54 1.22 1.22 0 0 0 .89-.39 5 5 0 0 0 .79-3V9.57 8.28h.2a.78.78 0 0 0 0-1.56h-.2c.12-1.4.93-1.53 1.12-1.54a.78.78 0 0 0 0-1.56zM12.88 9.17L11.78 8l1-1.28a.78.78 0 1 0-1.21-1l-.86 1.08-.94-1a.78.78 0 1 0-1.15 1.02L9.72 8l-1 1.28a.78.78 0 1 0 1.21 1l.88-1.09.94 1a.78.78 0 0 0 1.15-1.05z",className:"icon-inner"})]})}const rr=Object.freeze(Object.defineProperty({__proto__:null,IconArray:de,IconArrow:ce,IconBoolean:me,IconEllipsis:ue,IconFunction:xe,IconNull:ye,IconNumber:ve,IconObject:fe,IconString:he,IconSymbol:pe,IconUndefined:ge},Symbol.toStringTag,{value:"Module"}));function be({children:r,showLine:s,...i}){return n.jsx("div",{...i,className:A([i.className,"tree",s&&"show-line"]),children:r})}function je(r){const s=x.useMemo(()=>r.children,[r.children]),[i,p]=x.useState(!!r.expand),f=l=>{var v;if(l){const g=getSelection();if(g&&g.anchorOffset!==g.focusOffset)return}s&&(p(!i),(v=r.onExpand)==null||v.call(r,!i))};return x.useEffect(()=>{p(!!r.expand)},[r.expand]),n.jsxs("div",{className:A(["tree-item",r.className]),...r.attrs,children:[n.jsxs("div",{className:"tree-item-label",onMouseUp:()=>{r.canClickLabelExtend&&f(!0)},children:[s&&n.jsx("button",{className:A(["tree-item-fold-btn",i&&"is-expand"]),onMouseUp:l=>{l.stopPropagation()},onClick:()=>{f()},children:n.jsx(ce,{})}),!s&&!r.hideSpece&&n.jsx("span",{className:"tree-item-space"}),r.icon&&n.jsx("i",{className:"tree-item-icon",children:r.icon}),r.label]}),s&&i&&n.jsx("div",{className:"tree-item-content",children:r.children})]})}const Hr="";var we=(r=>(r[r.DEFAULT=0]="DEFAULT",r[r.DESC=1]="DESC",r[r.ASC=2]="ASC",r))(we||{});const Ee=x.createContext({showLine:!0,showLevel:0,showItems:20,showInlineMax:5,showIcon:!1,hideNonEnumerability:!1,sort:0}),W=()=>x.useContext(Ee);function H({type:r,descriptor:s}){const i=s.value;return r==="object"?i instanceof Date?i.toISOString():i instanceof RegExp?i.toString():i instanceof Set?`Set(${i.size})`:i instanceof ArrayBuffer?`ArrayBuffer(${i.byteLength})`:le(i):r==="array"?`Array(${i.length})`:r==="string"?JSON.stringify(i):r==="number"?String(i):r==="bigint"?`${String(i)}n`:r==="boolean"?String(i):r==="null"?"null":r==="undefined"?s.get?"(...)":s.set?"ƒ setter(v)":"undefined":r==="symbol"?i.toString():r==="function"?`${i}`:String(i)}function Re({type:r}){return r==="object"?n.jsx(fe,{}):r==="array"?n.jsx(de,{}):r==="string"?n.jsx(he,{}):r==="number"||r==="bigint"?n.jsx(ve,{}):r==="boolean"?n.jsx(me,{}):r==="null"?n.jsx(ye,{}):r==="undefined"?n.jsx(ge,{}):r==="symbol"?n.jsx(pe,{}):r==="function"?n.jsx(xe,{}):null}function tr(r){const s=W(),i=r.descriptor.value,p=s.showInlineMax,f=Math.min(p,i.length);return n.jsxs("div",{className:"object-inline",children:[n.jsx("span",{className:"type-system",children:"("}),i.length,n.jsx("span",{className:"type-system",children:")"}),n.jsx("span",{className:"type-system is-italic",children:"["}),n.jsx("div",{className:"object-inline-items",children:i.slice(0,p).map((l,v)=>{const g=Z(l);return n.jsxs(x.Fragment,{children:[n.jsx("span",{className:"type-"+g+" is-italic",children:H({type:g,descriptor:{value:l,enumerable:!0}})}),v<f-1?n.jsx("span",{className:"type-system is-italic",children:", "}):i.length>f&&n.jsx("span",{className:"type-system is-italic",children:", …"})]},v)})}),n.jsx("span",{className:"type-system is-italic",children:"]"})]})}function nr(r){const s=W(),i=r.descriptor.value,p=s.showInlineMax,f=Object.keys(i),l=Math.min(f.length,p),v=[];for(let g=0;g<l;g++){const d=f[g];let j;try{j=Z(i[d])}catch{continue}const y=Object.getOwnPropertyDescriptor(i,d);y&&v.push(n.jsxs(x.Fragment,{children:[n.jsx("span",{className:A(["type-property is-italic"]),children:d}),n.jsx("span",{className:"type-system is-italic",children:": "}),n.jsx("span",{className:"type-"+j+" is-italic",children:H({type:j,descriptor:{value:i[d],enumerable:y.enumerable}})}),g<l-1?n.jsx("span",{className:"type-system is-italic",children:", "}):f.length>l&&n.jsx("span",{className:"type-system is-italic",children:", …"})]},g))}return n.jsxs("div",{className:"object-inline",children:[i.constructor===Object?null:n.jsxs("span",{className:"is-italic",children:[le(i)," "]}),n.jsx("span",{className:"type-system is-italic",children:"{"}),n.jsx("div",{className:"object-inline-items",children:v}),n.jsx("span",{className:"type-system is-italic",children:"}"})]})}function _e(r){const s=r.descriptor.value;return r.type==="array"?n.jsx(tr,{type:r.type,descriptor:r.descriptor}):r.type==="object"&&!(s instanceof Date)&&!(s instanceof RegExp)&&!(s instanceof Set)&&!(s instanceof ArrayBuffer)?n.jsx(nr,{type:r.type,descriptor:r.descriptor}):n.jsx("span",{className:"type-value type-"+r.type,onClick:r.loadGetter,children:H({type:r.type,descriptor:r.descriptor})})}function ar(r){const s=W(),[i,p]=x.useState(s.showItems);let l=x.useMemo(()=>er(r.object),[r.object]).filter(d=>s.hideNonEnumerability?d.descriptor.enumerable:!0);s.sort&&(l=l.sort((d,j)=>s.sort===1?d.key<j.key?1:-1:d.key>j.key?1:-1));const v=l.filter((d,j)=>j<i),g=v.length<l.length;return n.jsxs(n.Fragment,{children:[v.map((d,j)=>n.jsx(Se,{level:r.level+1,field:d.key,descriptor:d.descriptor,top:r.top},j)),g&&n.jsx("div",{children:n.jsx("button",{className:"more-btn",title:"Load more",onClick:()=>p(i+s.showItems),children:n.jsx(ue,{})})},"more")]})}function Se(r){const s=W(),[i,p]=x.useState(r.descriptor),[f,l]=x.useState(r.level<s.showLevel),v=x.useMemo(()=>Z(i.value),[i]),g=x.useMemo(()=>{if(!s.showIcon)return null;let y;return s.renderTypeIcon?y=s.renderTypeIcon(v,i,r.level,Re):y=n.jsx(Re,{type:v,descriptor:i}),y===null?null:n.jsx("i",{className:"type-icon",children:y})},[r.level,v,i,s.showIcon,s.renderTypeIcon]),d=v==="array"||v==="object"||v==="function",j=()=>{if(!i.get)return;console.log(r.top);let y;try{y=i.get.call(r.top)}catch(N){y=`[${N.message}]`}const _={...i};_.get=void 0,_.value=y,p(_)};return x.useEffect(()=>{p(r.descriptor)},[r.descriptor]),x.useEffect(()=>{l(r.level<s.showLevel)},[r.level,s.showLevel]),n.jsx(je,{className:i.enumerable?"":"is-no-enumerable",label:n.jsxs(n.Fragment,{children:[r.field?n.jsxs(n.Fragment,{children:[n.jsx("span",{className:A(["type-property"]),children:r.field}),n.jsx("span",{className:"type-system",children:": "})]}):null,s.renderValue?s.renderValue(v,i,{level:r.level,expand:f,canExpand:d,loadGetter:j,setExpand:l,getValueString:H,DefaultRenderValue:_e}):n.jsx(_e,{type:v,descriptor:i,loadGetter:j})]}),icon:g,expand:f,onExpand:l,hideSpece:r.level===0,canClickLabelExtend:s.canClickLabelExtend,children:d&&n.jsx(ar,{level:r.level,object:i.value,top:r.field==="[[Prototype]]"?r.top:i.value})})}function ir(r){var s;return n.jsxs(be,{...r.attrs,className:A(["object-viewer",(s=r.attrs)==null?void 0:s.className]),showLine:r.showLine,children:[r.header,n.jsx(Ee.Provider,{value:{showLine:!!r.showLine,showLevel:r.showLevel===void 0?1:r.showLevel,showItems:r.showItems||20,showInlineMax:r.showInlineMax||50,showIcon:!!r.showIcon,hideNonEnumerability:!!r.hideNonEnumerability,sort:r.sort===void 0?0:r.sort,canClickLabelExtend:!!r.canClickLabelExtend,renderValue:r.renderValue,renderTypeIcon:r.renderTypeIcon},children:n.jsx(Se,{level:0,descriptor:{enumerable:!0,value:r.value},top:r.value})}),r.footer]})}const Yr="";O.ObjectViewer=ir,O.Sort=we,O.Tree=be,O.TreeItem=je,O.icons=rr,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});