zigbee2mqtt-frontend 0.6.168 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/assets/Availability-93ee70be.js +1 -0
  3. package/dist/assets/Availability-93ee70be.js.br +0 -0
  4. package/dist/assets/CodeEditor-5fe67a8c.js +25 -0
  5. package/dist/assets/CodeEditor-5fe67a8c.js.br +0 -0
  6. package/dist/assets/ConnectedDevicePage-096eea88.js +1 -0
  7. package/dist/assets/ConnectedDevicePage-096eea88.js.br +0 -0
  8. package/dist/assets/ConnectedMap-e8b5a587.js +1 -0
  9. package/dist/assets/ConnectedMap-e8b5a587.js.br +0 -0
  10. package/dist/assets/Dashboard-7d8f88d2.js +1 -0
  11. package/dist/assets/Dashboard-7d8f88d2.js.br +0 -0
  12. package/dist/assets/{DashboardDevice-0edaffd7.js → DashboardDevice-5be02f1f.js} +1 -1
  13. package/dist/assets/DashboardDevice-5be02f1f.js.br +0 -0
  14. package/dist/assets/{DashboardFeatureWrapper-36ae220c.js → DashboardFeatureWrapper-acfa9fe0.js} +1 -1
  15. package/dist/assets/DashboardFeatureWrapper-acfa9fe0.js.br +0 -0
  16. package/dist/assets/{DeviceImage-502b1925.js → DeviceImage-809eaa0f.js} +1 -1
  17. package/dist/assets/DeviceImage-809eaa0f.js.br +0 -0
  18. package/dist/assets/{GroupPage-f3cff083.js → GroupPage-a8c92d51.js} +1 -1
  19. package/dist/assets/GroupPage-a8c92d51.js.br +0 -0
  20. package/dist/assets/{ReactTableCom-dd32722c.js → ReactTableCom-12514b2c.js} +1 -1
  21. package/dist/assets/ReactTableCom-12514b2c.js.br +0 -0
  22. package/dist/assets/{RecallRemove-fffb108f.js → RecallRemove-b7d941d5.js} +1 -1
  23. package/dist/assets/RecallRemove-b7d941d5.js.br +0 -0
  24. package/dist/assets/_baseSet-c50e5ad2.js +1 -0
  25. package/dist/assets/_getAllKeysIn-89e94ca5.js +1 -0
  26. package/dist/assets/{bootstrap-5.esm-63ff73ff.js → bootstrap-5.esm-18dec490.js} +1 -1
  27. package/dist/assets/bootstrap-5.esm-18dec490.js.br +0 -0
  28. package/dist/assets/{index-207ba255.js → index-0a751ce3.js} +1 -1
  29. package/dist/assets/index-0fd17754.js +1 -0
  30. package/dist/assets/index-0fd17754.js.br +0 -0
  31. package/dist/assets/{index-90cbbe98.js → index-3cebf61c.js} +50 -50
  32. package/dist/assets/index-3cebf61c.js.br +0 -0
  33. package/dist/assets/{index-b9bb8b94.js → index-5440f8d6.js} +2 -2
  34. package/dist/assets/index-5440f8d6.js.br +0 -0
  35. package/dist/assets/index-81bb02f4.js +1 -0
  36. package/dist/assets/index-81bb02f4.js.br +0 -0
  37. package/dist/assets/{index-f68d9f97.js → index-ba5a8831.js} +1 -1
  38. package/dist/assets/index-ba5a8831.js.br +0 -0
  39. package/dist/assets/{index-87e10905.js → index-bae7f1a5.js} +1 -1
  40. package/dist/assets/index-bae7f1a5.js.br +0 -0
  41. package/dist/assets/{index-89a73a98.js → index-cd7fc4ca.js} +1 -1
  42. package/dist/assets/index-cd7fc4ca.js.br +0 -0
  43. package/dist/assets/index-d0572bd9.js +1 -0
  44. package/dist/assets/index-d0572bd9.js.br +0 -0
  45. package/dist/assets/{index-911a3282.js → index-f8f62295.js} +1 -1
  46. package/dist/assets/index-f8f62295.js.br +0 -0
  47. package/dist/assets/{intersection-af08d8a1.js → intersection-54a44e92.js} +1 -1
  48. package/dist/assets/intersection-54a44e92.js.br +0 -0
  49. package/dist/assets/{isEqual-8f5aec6e.js → isEqual-f604cf0d.js} +1 -1
  50. package/dist/assets/persist-4ad01878.js +1 -0
  51. package/dist/assets/persist-4ad01878.js.br +0 -0
  52. package/dist/assets/{rjsf-translation-fields-0b911a96.js → rjsf-translation-fields-d0808f88.js} +1 -1
  53. package/dist/assets/{spinner-12fdfcec.js → spinner-c2832892.js} +1 -1
  54. package/dist/assets/{vendor-links-f9ac94a7.js → vendor-links-0fae9a23.js} +1 -1
  55. package/dist/assets/vendor-links-0fae9a23.js.br +0 -0
  56. package/dist/index.html +1 -1
  57. package/dist/index.html.br +0 -0
  58. package/package.json +2 -4
  59. package/dist/assets/Availability-6f2af4ef.js +0 -1
  60. package/dist/assets/Availability-6f2af4ef.js.br +0 -0
  61. package/dist/assets/CodeEditor-ed73cf09.js +0 -25
  62. package/dist/assets/CodeEditor-ed73cf09.js.br +0 -0
  63. package/dist/assets/ConnectedDevicePage-37d549e5.js +0 -1
  64. package/dist/assets/ConnectedDevicePage-37d549e5.js.br +0 -0
  65. package/dist/assets/ConnectedMap-d7fdf65b.js +0 -1
  66. package/dist/assets/ConnectedMap-d7fdf65b.js.br +0 -0
  67. package/dist/assets/Dashboard-20f17f7e.js +0 -1
  68. package/dist/assets/Dashboard-20f17f7e.js.br +0 -0
  69. package/dist/assets/DashboardDevice-0edaffd7.js.br +0 -0
  70. package/dist/assets/DashboardFeatureWrapper-36ae220c.js.br +0 -0
  71. package/dist/assets/DeviceImage-502b1925.js.br +0 -0
  72. package/dist/assets/GroupPage-f3cff083.js.br +0 -0
  73. package/dist/assets/ReactTableCom-dd32722c.js.br +0 -0
  74. package/dist/assets/RecallRemove-fffb108f.js.br +0 -0
  75. package/dist/assets/_baseSet-2920b059.js +0 -1
  76. package/dist/assets/_getAllKeysIn-f4f1cff0.js +0 -1
  77. package/dist/assets/bootstrap-5.esm-63ff73ff.js.br +0 -0
  78. package/dist/assets/index-3dcf74a2.js +0 -1
  79. package/dist/assets/index-3dcf74a2.js.br +0 -0
  80. package/dist/assets/index-43566384.js +0 -1
  81. package/dist/assets/index-43566384.js.br +0 -0
  82. package/dist/assets/index-87e10905.js.br +0 -0
  83. package/dist/assets/index-89a73a98.js.br +0 -0
  84. package/dist/assets/index-90cbbe98.js.br +0 -0
  85. package/dist/assets/index-911a3282.js.br +0 -0
  86. package/dist/assets/index-a9bce466.js +0 -1
  87. package/dist/assets/index-a9bce466.js.br +0 -0
  88. package/dist/assets/index-b9bb8b94.js.br +0 -0
  89. package/dist/assets/index-f68d9f97.js.br +0 -0
  90. package/dist/assets/intersection-af08d8a1.js.br +0 -0
  91. package/dist/assets/persist-35479e12.js +0 -1
  92. package/dist/assets/persist-35479e12.js.br +0 -0
  93. package/dist/assets/vendor-links-f9ac94a7.js.br +0 -0
@@ -1 +0,0 @@
1
- import{R as gt,o as on,p as Ft,q as an,r as et,j as S,b as wt,v as Bn,B as Re,w as Hn,c as Yn,a as Vn}from"./index-90cbbe98.js";import{D as jn}from"./DeviceImage-502b1925.js";import{i as Un}from"./isEqual-8f5aec6e.js";import{S as Gn}from"./spinner-12fdfcec.js";import{i as De}from"./intersection-af08d8a1.js";import"./index-207ba255.js";const Ie={disabled:!1},un=gt.createContext(null);var ln=function(e){return e.scrollTop},Mt="unmounted",pt="exited",dt="entering",yt="entered",he="exiting",ct=function(t){on(e,t);function e(r,i){var s;s=t.call(this,r,i)||this;var o=i,a=o&&!o.isMounting?r.enter:r.appear,l;return s.appearStatus=null,r.in?a?(l=pt,s.appearStatus=dt):l=yt:r.unmountOnExit||r.mountOnEnter?l=Mt:l=pt,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(i,s){var o=i.in;return o&&s.status===Mt?{status:pt}:null};var n=e.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(i){var s=null;if(i!==this.props){var o=this.state.status;this.props.in?o!==dt&&o!==yt&&(s=dt):(o===dt||o===yt)&&(s=he)}this.updateStatus(!1,s)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var i=this.props.timeout,s,o,a;return s=o=a=i,i!=null&&typeof i!="number"&&(s=i.exit,o=i.enter,a=i.appear!==void 0?i.appear:o),{exit:s,enter:o,appear:a}},n.updateStatus=function(i,s){if(i===void 0&&(i=!1),s!==null)if(this.cancelNextCallback(),s===dt){if(this.props.unmountOnExit||this.props.mountOnEnter){var o=this.props.nodeRef?this.props.nodeRef.current:Ft.findDOMNode(this);o&&ln(o)}this.performEnter(i)}else this.performExit();else this.props.unmountOnExit&&this.state.status===pt&&this.setState({status:Mt})},n.performEnter=function(i){var s=this,o=this.props.enter,a=this.context?this.context.isMounting:i,l=this.props.nodeRef?[a]:[Ft.findDOMNode(this),a],u=l[0],c=l[1],h=this.getTimeouts(),f=a?h.appear:h.enter;if(!i&&!o||Ie.disabled){this.safeSetState({status:yt},function(){s.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:dt},function(){s.props.onEntering(u,c),s.onTransitionEnd(f,function(){s.safeSetState({status:yt},function(){s.props.onEntered(u,c)})})})},n.performExit=function(){var i=this,s=this.props.exit,o=this.getTimeouts(),a=this.props.nodeRef?void 0:Ft.findDOMNode(this);if(!s||Ie.disabled){this.safeSetState({status:pt},function(){i.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:he},function(){i.props.onExiting(a),i.onTransitionEnd(o.exit,function(){i.safeSetState({status:pt},function(){i.props.onExited(a)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(i,s){s=this.setNextCallback(s),this.setState(i,s)},n.setNextCallback=function(i){var s=this,o=!0;return this.nextCallback=function(a){o&&(o=!1,s.nextCallback=null,i(a))},this.nextCallback.cancel=function(){o=!1},this.nextCallback},n.onTransitionEnd=function(i,s){this.setNextCallback(s);var o=this.props.nodeRef?this.props.nodeRef.current:Ft.findDOMNode(this),a=i==null&&!this.props.addEndListener;if(!o||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[o,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}i!=null&&setTimeout(this.nextCallback,i)},n.render=function(){var i=this.state.status;if(i===Mt)return null;var s=this.props,o=s.children;s.in,s.mountOnEnter,s.unmountOnExit,s.appear,s.enter,s.exit,s.timeout,s.addEndListener,s.onEnter,s.onEntering,s.onEntered,s.onExit,s.onExiting,s.onExited,s.nodeRef;var a=an(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return gt.createElement(un.Provider,{value:null},typeof o=="function"?o(i,a):gt.cloneElement(gt.Children.only(o),a))},e}(gt.Component);ct.contextType=un;ct.propTypes={};function _t(){}ct.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:_t,onEntering:_t,onEntered:_t,onExit:_t,onExiting:_t,onExited:_t};ct.UNMOUNTED=Mt;ct.EXITED=pt;ct.ENTERING=dt;ct.ENTERED=yt;ct.EXITING=he;const Wn=ct;function Kn(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Qn(t,e){t.classList?t.classList.add(e):Kn(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function ze(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Jn(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=ze(t.className,e):t.setAttribute("class",ze(t.className&&t.className.baseVal||"",e))}const Zn="_container_1a2bs_1",tr="_img_1a2bs_7",er="_node_1a2bs_12",nr="_link_1a2bs_17",rr="_linkLabel_1a2bs_22",ir="_links_1a2bs_34",sr="_nodes_1a2bs_38",or="_EndDevice_1a2bs_42",ar="_Coordinator_1a2bs_49",ur="_Router_1a2bs_57",lr="_BrokenLink_1a2bs_74",cr="_Coordinator2Router_1a2bs_78",fr="_Router2Coordinator_1a2bs_79",hr="_Router2Router_1a2bs_83",pr="_Coordinator2EndDevice_1a2bs_87",dr="_EndDevice2Coordinator_1a2bs_88",gr="_Router2EndDevice_1a2bs_92",vr="_EndDevice2Router_1a2bs_93",xr="_foreignObject_1a2bs_99",mr="_offline_1a2bs_105",_r="_controls_1a2bs_110",L={container:Zn,img:tr,node:er,link:nr,linkLabel:rr,links:ir,nodes:sr,EndDevice:or,Coordinator:ar,Router:ur,BrokenLink:lr,Coordinator2Router:cr,Router2Coordinator:fr,Router2Router:hr,Coordinator2EndDevice:pr,EndDevice2Coordinator:dr,Router2EndDevice:gr,EndDevice2Router:vr,foreignObject:xr,offline:mr,controls:_r};var pe="http://www.w3.org/1999/xhtml";const Le={svg:"http://www.w3.org/2000/svg",xhtml:pe,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function re(t){var e=t+="",n=e.indexOf(":");return n>=0&&(e=t.slice(0,n))!=="xmlns"&&(t=t.slice(n+1)),Le.hasOwnProperty(e)?{space:Le[e],local:t}:t}function yr(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===pe&&e.documentElement.namespaceURI===pe?e.createElement(t):e.createElementNS(n,t)}}function wr(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function cn(t){var e=re(t);return(e.local?wr:yr)(e)}function br(){}function we(t){return t==null?br:function(){return this.querySelector(t)}}function Nr(t){typeof t!="function"&&(t=we(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=new Array(o),l,u,c=0;c<o;++c)(l=s[c])&&(u=t.call(l,l.__data__,c,s))&&("__data__"in l&&(u.__data__=l.__data__),a[c]=u);return new W(r,this._parents)}function Er(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function kr(){return[]}function fn(t){return t==null?kr:function(){return this.querySelectorAll(t)}}function Cr(t){return function(){return Er(t.apply(this,arguments))}}function Ar(t){typeof t=="function"?t=Cr(t):t=fn(t);for(var e=this._groups,n=e.length,r=[],i=[],s=0;s<n;++s)for(var o=e[s],a=o.length,l,u=0;u<a;++u)(l=o[u])&&(r.push(t.call(l,l.__data__,u,o)),i.push(l));return new W(r,i)}function hn(t){return function(){return this.matches(t)}}function pn(t){return function(e){return e.matches(t)}}var $r=Array.prototype.find;function Mr(t){return function(){return $r.call(this.children,t)}}function Sr(){return this.firstElementChild}function Tr(t){return this.select(t==null?Sr:Mr(typeof t=="function"?t:pn(t)))}var Rr=Array.prototype.filter;function Dr(){return Array.from(this.children)}function Ir(t){return function(){return Rr.call(this.children,t)}}function zr(t){return this.selectAll(t==null?Dr:Ir(typeof t=="function"?t:pn(t)))}function Lr(t){typeof t!="function"&&(t=hn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],l,u=0;u<o;++u)(l=s[u])&&t.call(l,l.__data__,u,s)&&a.push(l);return new W(r,this._parents)}function dn(t){return new Array(t.length)}function Or(){return new W(this._enter||this._groups.map(dn),this._parents)}function Kt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}Kt.prototype={constructor:Kt,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,e){return this._parent.insertBefore(t,e)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Pr(t){return function(){return t}}function Xr(t,e,n,r,i,s){for(var o=0,a,l=e.length,u=s.length;o<u;++o)(a=e[o])?(a.__data__=s[o],r[o]=a):n[o]=new Kt(t,s[o]);for(;o<l;++o)(a=e[o])&&(i[o]=a)}function Fr(t,e,n,r,i,s,o){var a,l,u=new Map,c=e.length,h=s.length,f=new Array(c),x;for(a=0;a<c;++a)(l=e[a])&&(f[a]=x=o.call(l,l.__data__,a,e)+"",u.has(x)?i[a]=l:u.set(x,l));for(a=0;a<h;++a)x=o.call(t,s[a],a,s)+"",(l=u.get(x))?(r[a]=l,l.__data__=s[a],u.delete(x)):n[a]=new Kt(t,s[a]);for(a=0;a<c;++a)(l=e[a])&&u.get(f[a])===l&&(i[a]=l)}function qr(t){return t.__data__}function Br(t,e){if(!arguments.length)return Array.from(this,qr);var n=e?Fr:Xr,r=this._parents,i=this._groups;typeof t!="function"&&(t=Pr(t));for(var s=i.length,o=new Array(s),a=new Array(s),l=new Array(s),u=0;u<s;++u){var c=r[u],h=i[u],f=h.length,x=Hr(t.call(c,c&&c.__data__,u,r)),b=x.length,m=a[u]=new Array(b),g=o[u]=new Array(b),v=l[u]=new Array(f);n(c,h,m,g,v,x,e);for(var E=0,_=0,d,w;E<b;++E)if(d=m[E]){for(E>=_&&(_=E+1);!(w=g[_])&&++_<b;);d._next=w||null}}return o=new W(o,r),o._enter=a,o._exit=l,o}function Hr(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Yr(){return new W(this._exit||this._groups.map(dn),this._parents)}function Vr(t,e,n){var r=this.enter(),i=this,s=this.exit();return typeof t=="function"?(r=t(r),r&&(r=r.selection())):r=r.append(t+""),e!=null&&(i=e(i),i&&(i=i.selection())),n==null?s.remove():n(s),r&&i?r.merge(i).order():i}function jr(t){for(var e=t.selection?t.selection():t,n=this._groups,r=e._groups,i=n.length,s=r.length,o=Math.min(i,s),a=new Array(i),l=0;l<o;++l)for(var u=n[l],c=r[l],h=u.length,f=a[l]=new Array(h),x,b=0;b<h;++b)(x=u[b]||c[b])&&(f[b]=x);for(;l<i;++l)a[l]=n[l];return new W(a,this._parents)}function Ur(){for(var t=this._groups,e=-1,n=t.length;++e<n;)for(var r=t[e],i=r.length-1,s=r[i],o;--i>=0;)(o=r[i])&&(s&&o.compareDocumentPosition(s)^4&&s.parentNode.insertBefore(o,s),s=o);return this}function Gr(t){t||(t=Wr);function e(h,f){return h&&f?t(h.__data__,f.__data__):!h-!f}for(var n=this._groups,r=n.length,i=new Array(r),s=0;s<r;++s){for(var o=n[s],a=o.length,l=i[s]=new Array(a),u,c=0;c<a;++c)(u=o[c])&&(l[c]=u);l.sort(e)}return new W(i,this._parents).order()}function Wr(t,e){return t<e?-1:t>e?1:t>=e?0:NaN}function Kr(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Qr(){return Array.from(this)}function Jr(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length;i<s;++i){var o=r[i];if(o)return o}return null}function Zr(){let t=0;for(const e of this)++t;return t}function ti(){return!this.node()}function ei(t){for(var e=this._groups,n=0,r=e.length;n<r;++n)for(var i=e[n],s=0,o=i.length,a;s<o;++s)(a=i[s])&&t.call(a,a.__data__,s,i);return this}function ni(t){return function(){this.removeAttribute(t)}}function ri(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ii(t,e){return function(){this.setAttribute(t,e)}}function si(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function oi(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttribute(t):this.setAttribute(t,n)}}function ai(t,e){return function(){var n=e.apply(this,arguments);n==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function ui(t,e){var n=re(t);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((e==null?n.local?ri:ni:typeof e=="function"?n.local?ai:oi:n.local?si:ii)(n,e))}function gn(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function li(t){return function(){this.style.removeProperty(t)}}function ci(t,e,n){return function(){this.style.setProperty(t,e,n)}}function fi(t,e,n){return function(){var r=e.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function hi(t,e,n){return arguments.length>1?this.each((e==null?li:typeof e=="function"?fi:ci)(t,e,n??"")):Et(this.node(),t)}function Et(t,e){return t.style.getPropertyValue(e)||gn(t).getComputedStyle(t,null).getPropertyValue(e)}function pi(t){return function(){delete this[t]}}function di(t,e){return function(){this[t]=e}}function gi(t,e){return function(){var n=e.apply(this,arguments);n==null?delete this[t]:this[t]=n}}function vi(t,e){return arguments.length>1?this.each((e==null?pi:typeof e=="function"?gi:di)(t,e)):this.node()[t]}function vn(t){return t.trim().split(/^|\s+/)}function be(t){return t.classList||new xn(t)}function xn(t){this._node=t,this._names=vn(t.getAttribute("class")||"")}xn.prototype={add:function(t){var e=this._names.indexOf(t);e<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var e=this._names.indexOf(t);e>=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function mn(t,e){for(var n=be(t),r=-1,i=e.length;++r<i;)n.add(e[r])}function _n(t,e){for(var n=be(t),r=-1,i=e.length;++r<i;)n.remove(e[r])}function xi(t){return function(){mn(this,t)}}function mi(t){return function(){_n(this,t)}}function _i(t,e){return function(){(e.apply(this,arguments)?mn:_n)(this,t)}}function yi(t,e){var n=vn(t+"");if(arguments.length<2){for(var r=be(this.node()),i=-1,s=n.length;++i<s;)if(!r.contains(n[i]))return!1;return!0}return this.each((typeof e=="function"?_i:e?xi:mi)(n,e))}function wi(){this.textContent=""}function bi(t){return function(){this.textContent=t}}function Ni(t){return function(){var e=t.apply(this,arguments);this.textContent=e??""}}function Ei(t){return arguments.length?this.each(t==null?wi:(typeof t=="function"?Ni:bi)(t)):this.node().textContent}function ki(){this.innerHTML=""}function Ci(t){return function(){this.innerHTML=t}}function Ai(t){return function(){var e=t.apply(this,arguments);this.innerHTML=e??""}}function $i(t){return arguments.length?this.each(t==null?ki:(typeof t=="function"?Ai:Ci)(t)):this.node().innerHTML}function Mi(){this.nextSibling&&this.parentNode.appendChild(this)}function Si(){return this.each(Mi)}function Ti(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ri(){return this.each(Ti)}function Di(t){var e=typeof t=="function"?t:cn(t);return this.select(function(){return this.appendChild(e.apply(this,arguments))})}function Ii(){return null}function zi(t,e){var n=typeof t=="function"?t:cn(t),r=e==null?Ii:typeof e=="function"?e:we(e);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function Li(){var t=this.parentNode;t&&t.removeChild(this)}function Oi(){return this.each(Li)}function Pi(){var t=this.cloneNode(!1),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Xi(){var t=this.cloneNode(!0),e=this.parentNode;return e?e.insertBefore(t,this.nextSibling):t}function Fi(t){return this.select(t?Xi:Pi)}function qi(t){return arguments.length?this.property("__data__",t):this.node().__data__}function Bi(t){return function(e){t.call(this,e,this.__data__)}}function Hi(t){return t.trim().split(/^|\s+/).map(function(e){var n="",r=e.indexOf(".");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{type:e,name:n}})}function Yi(t){return function(){var e=this.__on;if(e){for(var n=0,r=-1,i=e.length,s;n<i;++n)s=e[n],(!t.type||s.type===t.type)&&s.name===t.name?this.removeEventListener(s.type,s.listener,s.options):e[++r]=s;++r?e.length=r:delete this.__on}}}function Vi(t,e,n){return function(){var r=this.__on,i,s=Bi(e);if(r){for(var o=0,a=r.length;o<a;++o)if((i=r[o]).type===t.type&&i.name===t.name){this.removeEventListener(i.type,i.listener,i.options),this.addEventListener(i.type,i.listener=s,i.options=n),i.value=e;return}}this.addEventListener(t.type,s,n),i={type:t.type,name:t.name,value:e,listener:s,options:n},r?r.push(i):this.__on=[i]}}function ji(t,e,n){var r=Hi(t+""),i,s=r.length,o;if(arguments.length<2){var a=this.node().__on;if(a){for(var l=0,u=a.length,c;l<u;++l)for(i=0,c=a[l];i<s;++i)if((o=r[i]).type===c.type&&o.name===c.name)return c.value}return}for(a=e?Vi:Yi,i=0;i<s;++i)this.each(a(r[i],e,n));return this}function yn(t,e,n){var r=gn(t),i=r.CustomEvent;typeof i=="function"?i=new i(e,n):(i=r.document.createEvent("Event"),n?(i.initEvent(e,n.bubbles,n.cancelable),i.detail=n.detail):i.initEvent(e,!1,!1)),t.dispatchEvent(i)}function Ui(t,e){return function(){return yn(this,t,e)}}function Gi(t,e){return function(){return yn(this,t,e.apply(this,arguments))}}function Wi(t,e){return this.each((typeof e=="function"?Gi:Ui)(t,e))}function*Ki(){for(var t=this._groups,e=0,n=t.length;e<n;++e)for(var r=t[e],i=0,s=r.length,o;i<s;++i)(o=r[i])&&(yield o)}var wn=[null];function W(t,e){this._groups=t,this._parents=e}function Ot(){return new W([[document.documentElement]],wn)}function Qi(){return this}W.prototype=Ot.prototype={constructor:W,select:Nr,selectAll:Ar,selectChild:Tr,selectChildren:zr,filter:Lr,data:Br,enter:Or,exit:Yr,join:Vr,merge:jr,selection:Qi,order:Ur,sort:Gr,call:Kr,nodes:Qr,node:Jr,size:Zr,empty:ti,each:ei,attr:ui,style:hi,property:vi,classed:yi,text:Ei,html:$i,raise:Si,lower:Ri,append:Di,insert:zi,remove:Oi,clone:Fi,datum:qi,on:ji,dispatch:Wi,[Symbol.iterator]:Ki};function V(t){return typeof t=="string"?new W([[document.querySelector(t)]],[document.documentElement]):new W([[t]],wn)}function Ji(t){let e;for(;e=t.sourceEvent;)t=e;return t}function at(t,e){if(t=Ji(t),e===void 0&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,r=r.matrixTransform(e.getScreenCTM().inverse()),[r.x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}const Zi=t=>{const{link:{linkType:e},id:n,...r}=t;return S.jsx("path",{id:n,className:wt(L.link,L[e]),strokeWidth:1,fill:"transparent",...r})},ts=t=>{const{link:e}=t;return S.jsx("text",{className:L.linkLabel,children:e.linkqualities.join("/")})},es=t=>{const{links:e}=t,n=et.useRef();return et.useLayoutEffect(()=>{V(n.current).selectAll(`.${L.link}`).data(e),V(n.current).selectAll(`.${L.linkLabel}`).data(e)},[e.length]),S.jsx("g",{ref:n,className:L.links,children:e.map(r=>{const i=`${r.source.ieeeAddr}-${r.target.ieeeAddr}-${r.linkType}`;return S.jsxs(et.Fragment,{children:[S.jsx(Zi,{id:`edgepath${i}`,link:r}),S.jsx(ts,{xlinkHref:`#edgepath${i}`,link:r})]},`fragment${i}`)})})},ns=es;var rs={value:()=>{}};function Pt(){for(var t=0,e=arguments.length,n={},r;t<e;++t){if(!(r=arguments[t]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new jt(n)}function jt(t){this._=t}function is(t,e){return t.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!e.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}jt.prototype=Pt.prototype={constructor:jt,on:function(t,e){var n=this._,r=is(t+"",n),i,s=-1,o=r.length;if(arguments.length<2){for(;++s<o;)if((i=(t=r[s]).type)&&(i=ss(n[i],t.name)))return i;return}if(e!=null&&typeof e!="function")throw new Error("invalid callback: "+e);for(;++s<o;)if(i=(t=r[s]).type)n[i]=Oe(n[i],t.name,e);else if(e==null)for(i in n)n[i]=Oe(n[i],t.name,null);return this},copy:function(){var t={},e=this._;for(var n in e)t[n]=e[n].slice();return new jt(t)},call:function(t,e){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(s=this._[t],r=0,i=s.length;r<i;++r)s[r].value.apply(e,n)},apply:function(t,e,n){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var r=this._[t],i=0,s=r.length;i<s;++i)r[i].value.apply(e,n)}};function ss(t,e){for(var n=0,r=t.length,i;n<r;++n)if((i=t[n]).name===e)return i.value}function Oe(t,e,n){for(var r=0,i=t.length;r<i;++r)if(t[r].name===e){t[r]=rs,t=t.slice(0,r).concat(t.slice(r+1));break}return n!=null&&t.push({name:e,value:n}),t}const os={passive:!1},Rt={capture:!0,passive:!1};function ae(t){t.stopImmediatePropagation()}function bt(t){t.preventDefault(),t.stopImmediatePropagation()}function bn(t){var e=t.document.documentElement,n=V(t).on("dragstart.drag",bt,Rt);"onselectstart"in e?n.on("selectstart.drag",bt,Rt):(e.__noselect=e.style.MozUserSelect,e.style.MozUserSelect="none")}function Nn(t,e){var n=t.document.documentElement,r=V(t).on("dragstart.drag",null);e&&(r.on("click.drag",bt,Rt),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const qt=t=>()=>t;function de(t,{sourceEvent:e,subject:n,target:r,identifier:i,active:s,x:o,y:a,dx:l,dy:u,dispatch:c}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:i,enumerable:!0,configurable:!0},active:{value:s,enumerable:!0,configurable:!0},x:{value:o,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}de.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function as(t){return!t.ctrlKey&&!t.button}function us(){return this.parentNode}function ls(t,e){return e??{x:t.x,y:t.y}}function cs(){return navigator.maxTouchPoints||"ontouchstart"in this}function fs(){var t=as,e=us,n=ls,r=cs,i={},s=Pt("start","drag","end"),o=0,a,l,u,c,h=0;function f(d){d.on("mousedown.drag",x).filter(r).on("touchstart.drag",g).on("touchmove.drag",v,os).on("touchend.drag touchcancel.drag",E).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(d,w){if(!(c||!t.call(this,d,w))){var M=_(this,e.call(this,d,w),d,w,"mouse");M&&(V(d.view).on("mousemove.drag",b,Rt).on("mouseup.drag",m,Rt),bn(d.view),ae(d),u=!1,a=d.clientX,l=d.clientY,M("start",d))}}function b(d){if(bt(d),!u){var w=d.clientX-a,M=d.clientY-l;u=w*w+M*M>h}i.mouse("drag",d)}function m(d){V(d.view).on("mousemove.drag mouseup.drag",null),Nn(d.view,u),bt(d),i.mouse("end",d)}function g(d,w){if(t.call(this,d,w)){var M=d.changedTouches,N=e.call(this,d,w),k=M.length,I,C;for(I=0;I<k;++I)(C=_(this,N,d,w,M[I].identifier,M[I]))&&(ae(d),C("start",d,M[I]))}}function v(d){var w=d.changedTouches,M=w.length,N,k;for(N=0;N<M;++N)(k=i[w[N].identifier])&&(bt(d),k("drag",d,w[N]))}function E(d){var w=d.changedTouches,M=w.length,N,k;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<M;++N)(k=i[w[N].identifier])&&(ae(d),k("end",d,w[N]))}function _(d,w,M,N,k,I){var C=s.copy(),O=at(I||M,w),U,Y,p;if((p=n.call(d,new de("beforestart",{sourceEvent:M,target:f,identifier:k,active:o,x:O[0],y:O[1],dx:0,dy:0,dispatch:C}),N))!=null)return U=p.x-O[0]||0,Y=p.y-O[1]||0,function A(y,$,T){var R=O,D;switch(y){case"start":i[k]=A,D=o++;break;case"end":delete i[k],--o;case"drag":O=at(T||$,w),D=o;break}C.call(y,d,new de(y,{sourceEvent:$,subject:p,target:f,identifier:k,active:D,x:O[0]+U,y:O[1]+Y,dx:O[0]-R[0],dy:O[1]-R[1],dispatch:C}),N)}}return f.filter=function(d){return arguments.length?(t=typeof d=="function"?d:qt(!!d),f):t},f.container=function(d){return arguments.length?(e=typeof d=="function"?d:qt(d),f):e},f.subject=function(d){return arguments.length?(n=typeof d=="function"?d:qt(d),f):n},f.touchable=function(d){return arguments.length?(r=typeof d=="function"?d:qt(!!d),f):r},f.on=function(){var d=s.on.apply(s,arguments);return d===s?f:d},f.clickDistance=function(d){return arguments.length?(h=(d=+d)*d,f):Math.sqrt(h)},f}var hs=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Qn(e,r)})},ue=function(e,n){return e&&n&&n.split(" ").forEach(function(r){return Jn(e,r)})},Ne=function(t){on(e,t);function e(){for(var r,i=arguments.length,s=new Array(i),o=0;o<i;o++)s[o]=arguments[o];return r=t.call.apply(t,[this].concat(s))||this,r.appliedClasses={appear:{},enter:{},exit:{}},r.onEnter=function(a,l){var u=r.resolveArguments(a,l),c=u[0],h=u[1];r.removeClasses(c,"exit"),r.addClass(c,h?"appear":"enter","base"),r.props.onEnter&&r.props.onEnter(a,l)},r.onEntering=function(a,l){var u=r.resolveArguments(a,l),c=u[0],h=u[1],f=h?"appear":"enter";r.addClass(c,f,"active"),r.props.onEntering&&r.props.onEntering(a,l)},r.onEntered=function(a,l){var u=r.resolveArguments(a,l),c=u[0],h=u[1],f=h?"appear":"enter";r.removeClasses(c,f),r.addClass(c,f,"done"),r.props.onEntered&&r.props.onEntered(a,l)},r.onExit=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"appear"),r.removeClasses(u,"enter"),r.addClass(u,"exit","base"),r.props.onExit&&r.props.onExit(a)},r.onExiting=function(a){var l=r.resolveArguments(a),u=l[0];r.addClass(u,"exit","active"),r.props.onExiting&&r.props.onExiting(a)},r.onExited=function(a){var l=r.resolveArguments(a),u=l[0];r.removeClasses(u,"exit"),r.addClass(u,"exit","done"),r.props.onExited&&r.props.onExited(a)},r.resolveArguments=function(a,l){return r.props.nodeRef?[r.props.nodeRef.current,a]:[a,l]},r.getClassNames=function(a){var l=r.props.classNames,u=typeof l=="string",c=u&&l?l+"-":"",h=u?""+c+a:l[a],f=u?h+"-active":l[a+"Active"],x=u?h+"-done":l[a+"Done"];return{baseClassName:h,activeClassName:f,doneClassName:x}},r}var n=e.prototype;return n.addClass=function(i,s,o){var a=this.getClassNames(s)[o+"ClassName"],l=this.getClassNames("enter"),u=l.doneClassName;s==="appear"&&o==="done"&&u&&(a+=" "+u),o==="active"&&i&&ln(i),a&&(this.appliedClasses[s][o]=a,hs(i,a))},n.removeClasses=function(i,s){var o=this.appliedClasses[s],a=o.base,l=o.active,u=o.done;this.appliedClasses[s]={},a&&ue(i,a),l&&ue(i,l),u&&ue(i,u)},n.render=function(){var i=this.props;i.classNames;var s=an(i,["classNames"]);return gt.createElement(Wn,Bn({},s,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(gt.Component);Ne.defaultProps={classNames:""};Ne.propTypes={};const ps=Ne,En=(t,e,n)=>{const s=Math.PI/t,o=60,a=t*2;let l="";for(let u=0;u<a;u++){const h=u%2==0?n:e,f=15+Math.cos(u*s+o)*h,x=15+Math.sin(u*s+o)*h;l+=`${f}, ${x} `}return l};class ds extends et.Component{constructor(){super(...arguments),this.state={hasBeenUpdated:!1},this.ref=et.createRef(),this.onMouseOut=()=>{const{node:e,onMouseOut:n}=this.props;this.ref&&this.ref.current&&n&&n(e,this.ref.current)},this.onMouseOver=()=>{const{node:e,onMouseOver:n}=this.props;this.ref&&this.ref.current&&n&&n(e,this.ref.current)},this.onDblClick=()=>{const{node:e,onDblClick:n}=this.props;this.ref&&this.ref.current&&n&&n(e,this.ref.current)}}componentDidUpdate(e){const{deviceState:n}=e,{deviceState:r}=this.props,i=Un(n,r),{hasBeenUpdated:s}=this.state;i?s&&this.setState({hasBeenUpdated:!1}):this.setState({hasBeenUpdated:!0})}componentDidMount(){const{current:e}=this.ref,{node:n}=this.props;V(e).data([n])}render(){const{hasBeenUpdated:e}=this.state,{node:n,deviceState:r,device:i,availability:s}=this.props,{onMouseOver:o,onMouseOut:a,onDblClick:l}=this,u=n.type,c=wt(L.node,L[u],{[L.offline]:s==="offline"});return S.jsxs("g",{className:c,ref:this.ref,onMouseOver:o,onMouseOut:a,onDoubleClick:l,children:[n.type==="Coordinator"?S.jsxs(S.Fragment,{children:[S.jsx("circle",{cx:15,cy:16,r:24,fill:"#fff",stroke:"blue",strokeWidth:1}),S.jsx("polygon",{stroke:"blue",strokeWidth:1,points:En(5,5,14)})]}):S.jsxs(S.Fragment,{children:[S.jsx(ps,{in:e,timeout:200,classNames:"stroke-blink",children:S.jsx("circle",{"data-foo":r==null?void 0:r.last_seen,cx:16,cy:17,r:24,fill:"#fff",stroke:"blue",strokeWidth:1})}),S.jsx(jn,{type:"svg",width:32,disabled:!1,height:32,device:i,className:`${L.img}`})]}),S.jsx("text",{x:45,y:25,children:n.friendlyName})]})}}class gs extends et.Component{constructor(){super(...arguments),this.state={toggle:!1}}updateDrag(){const{simulation:e,root:n}=this.props,r=fs().on("start",(i,s)=>{i.active||e.alphaTarget(.3).restart(),s.fx=s.x,s.fy=s.y}).on("drag",({x:i,y:s},o)=>{o.fx=i,o.fy=s}).on("end",(i,s)=>{i.active||e.alphaTarget(0)});V(n).selectAll(`.${L.node}`).call(r)}componentDidMount(){this.updateDrag()}componentDidUpdate(){this.updateDrag()}render(){const{nodes:e,onMouseOut:n,onMouseOver:r,deviceStates:i,devices:s,availability:o}=this.props;return S.jsx("g",{className:L.nodes,children:e.map(a=>S.jsx(ds,{onMouseOut:n,onMouseOver:r,node:a,deviceState:i[a.friendlyName],device:s[a.ieeeAddr],availability:o[a.friendlyName]},a.ieeeAddr))})}}function vs(t,e){var n,r=1;t==null&&(t=0),e==null&&(e=0);function i(){var s,o=n.length,a,l=0,u=0;for(s=0;s<o;++s)a=n[s],l+=a.x,u+=a.y;for(l=(l/o-t)*r,u=(u/o-e)*r,s=0;s<o;++s)a=n[s],a.x-=l,a.y-=u}return i.initialize=function(s){n=s},i.x=function(s){return arguments.length?(t=+s,i):t},i.y=function(s){return arguments.length?(e=+s,i):e},i.strength=function(s){return arguments.length?(r=+s,i):r},i}function xs(t){const e=+this._x.call(null,t),n=+this._y.call(null,t);return kn(this.cover(e,n),e,n,t)}function kn(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,s=t._root,o={data:r},a=t._x0,l=t._y0,u=t._x1,c=t._y1,h,f,x,b,m,g,v,E;if(!s)return t._root=o,t;for(;s.length;)if((m=e>=(h=(a+u)/2))?a=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f,i=s,!(s=s[v=g<<1|m]))return i[v]=o,t;if(x=+t._x.call(null,s.data),b=+t._y.call(null,s.data),e===x&&n===b)return o.next=s,i?i[v]=o:t._root=o,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(m=e>=(h=(a+u)/2))?a=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f;while((v=g<<1|m)===(E=(b>=f)<<1|x>=h));return i[E]=s,i[v]=o,t}function ms(t){var e,n,r=t.length,i,s,o=new Array(r),a=new Array(r),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(o[n]=i,a[n]=s,i<l&&(l=i),i>c&&(c=i),s<u&&(u=s),s>h&&(h=s));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<r;++n)kn(this,o[n],a[n],t[n]);return this}function _s(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,s=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,s=(r=Math.floor(e))+1;else{for(var o=i-n||1,a=this._root,l,u;n>t||t>=i||r>e||e>=s;)switch(u=(e<r)<<1|t<n,l=new Array(4),l[u]=a,a=l,o*=2,u){case 0:i=n+o,s=r+o;break;case 1:n=i-o,s=r+o;break;case 2:i=n+o,r=s-o;break;case 3:n=i-o,r=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=r,this._x1=i,this._y1=s,this}function ys(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function ws(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function F(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function bs(t,e,n){var r,i=this._x0,s=this._y0,o,a,l,u,c=this._x1,h=this._y1,f=[],x=this._root,b,m;for(x&&f.push(new F(x,i,s,c,h)),n==null?n=1/0:(i=t-n,s=e-n,c=t+n,h=e+n,n*=n);b=f.pop();)if(!(!(x=b.node)||(o=b.x0)>c||(a=b.y0)>h||(l=b.x1)<i||(u=b.y1)<s))if(x.length){var g=(o+l)/2,v=(a+u)/2;f.push(new F(x[3],g,v,l,u),new F(x[2],o,v,g,u),new F(x[1],g,a,l,v),new F(x[0],o,a,g,v)),(m=(e>=v)<<1|t>=g)&&(b=f[f.length-1],f[f.length-1]=f[f.length-1-m],f[f.length-1-m]=b)}else{var E=t-+this._x.call(null,x.data),_=e-+this._y.call(null,x.data),d=E*E+_*_;if(d<n){var w=Math.sqrt(n=d);i=t-w,s=e-w,c=t+w,h=e+w,r=x.data}}return r}function Ns(t){if(isNaN(c=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var e,n=this._root,r,i,s,o=this._x0,a=this._y0,l=this._x1,u=this._y1,c,h,f,x,b,m,g,v;if(!n)return this;if(n.length)for(;;){if((b=c>=(f=(o+l)/2))?o=f:l=f,(m=h>=(x=(a+u)/2))?a=x:u=x,e=n,!(n=n[g=m<<1|b]))return this;if(!n.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,v=g)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,i?(s?i.next=s:delete i.next,this):e?(s?e[g]=s:delete e[g],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=s,this)}function Es(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function ks(){return this._root}function Cs(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function As(t){var e=[],n,r=this._root,i,s,o,a,l;for(r&&e.push(new F(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,s=n.x0,o=n.y0,a=n.x1,l=n.y1)&&r.length){var u=(s+a)/2,c=(o+l)/2;(i=r[3])&&e.push(new F(i,u,c,a,l)),(i=r[2])&&e.push(new F(i,s,c,u,l)),(i=r[1])&&e.push(new F(i,u,o,a,c)),(i=r[0])&&e.push(new F(i,s,o,u,c))}return this}function $s(t){var e=[],n=[],r;for(this._root&&e.push(new F(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var s,o=r.x0,a=r.y0,l=r.x1,u=r.y1,c=(o+l)/2,h=(a+u)/2;(s=i[0])&&e.push(new F(s,o,a,c,h)),(s=i[1])&&e.push(new F(s,c,a,l,h)),(s=i[2])&&e.push(new F(s,o,h,c,u)),(s=i[3])&&e.push(new F(s,c,h,l,u))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function Ms(t){return t[0]}function Ss(t){return arguments.length?(this._x=t,this):this._x}function Ts(t){return t[1]}function Rs(t){return arguments.length?(this._y=t,this):this._y}function Cn(t,e,n){var r=new Ee(e??Ms,n??Ts,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function Ee(t,e,n,r,i,s){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=s,this._root=void 0}function Pe(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var B=Cn.prototype=Ee.prototype;B.copy=function(){var t=new Ee(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=Pe(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=Pe(r));return t};B.add=xs;B.addAll=ms;B.cover=_s;B.data=ys;B.extent=ws;B.find=bs;B.remove=Ns;B.removeAll=Es;B.root=ks;B.size=Cs;B.visit=As;B.visitAfter=$s;B.x=Ss;B.y=Rs;function G(t){return function(){return t}}function Qt(t){return(t()-.5)*1e-6}function Ds(t){return t.x+t.vx}function Is(t){return t.y+t.vy}function zs(t){var e,n,r,i=1,s=1;typeof t!="function"&&(t=G(t==null?1:+t));function o(){for(var u,c=e.length,h,f,x,b,m,g,v=0;v<s;++v)for(h=Cn(e,Ds,Is).visitAfter(a),u=0;u<c;++u)f=e[u],m=n[f.index],g=m*m,x=f.x+f.vx,b=f.y+f.vy,h.visit(E);function E(_,d,w,M,N){var k=_.data,I=_.r,C=m+I;if(k){if(k.index>f.index){var O=x-k.x-k.vx,U=b-k.y-k.vy,Y=O*O+U*U;Y<C*C&&(O===0&&(O=Qt(r),Y+=O*O),U===0&&(U=Qt(r),Y+=U*U),Y=(C-(Y=Math.sqrt(Y)))/Y*i,f.vx+=(O*=Y)*(C=(I*=I)/(g+I)),f.vy+=(U*=Y)*C,k.vx-=O*(C=1-C),k.vy-=U*C)}return}return d>x+C||M<x-C||w>b+C||N<b-C}}function a(u){if(u.data)return u.r=n[u.data.index];for(var c=u.r=0;c<4;++c)u[c]&&u[c].r>u.r&&(u.r=u[c].r)}function l(){if(e){var u,c=e.length,h;for(n=new Array(c),u=0;u<c;++u)h=e[u],n[h.index]=+t(h,u,e)}}return o.initialize=function(u,c){e=u,r=c,l()},o.iterations=function(u){return arguments.length?(s=+u,o):s},o.strength=function(u){return arguments.length?(i=+u,o):i},o.radius=function(u){return arguments.length?(t=typeof u=="function"?u:G(+u),l(),o):t},o}function Ls(t){return t.index}function Xe(t,e){var n=t.get(e);if(!n)throw new Error("node not found: "+e);return n}function Os(t){var e=Ls,n=h,r,i=G(30),s,o,a,l,u,c=1;t==null&&(t=[]);function h(g){return 1/Math.min(a[g.source.index],a[g.target.index])}function f(g){for(var v=0,E=t.length;v<c;++v)for(var _=0,d,w,M,N,k,I,C;_<E;++_)d=t[_],w=d.source,M=d.target,N=M.x+M.vx-w.x-w.vx||Qt(u),k=M.y+M.vy-w.y-w.vy||Qt(u),I=Math.sqrt(N*N+k*k),I=(I-s[_])/I*g*r[_],N*=I,k*=I,M.vx-=N*(C=l[_]),M.vy-=k*C,w.vx+=N*(C=1-C),w.vy+=k*C}function x(){if(o){var g,v=o.length,E=t.length,_=new Map(o.map((w,M)=>[e(w,M,o),w])),d;for(g=0,a=new Array(v);g<E;++g)d=t[g],d.index=g,typeof d.source!="object"&&(d.source=Xe(_,d.source)),typeof d.target!="object"&&(d.target=Xe(_,d.target)),a[d.source.index]=(a[d.source.index]||0)+1,a[d.target.index]=(a[d.target.index]||0)+1;for(g=0,l=new Array(E);g<E;++g)d=t[g],l[g]=a[d.source.index]/(a[d.source.index]+a[d.target.index]);r=new Array(E),b(),s=new Array(E),m()}}function b(){if(o)for(var g=0,v=t.length;g<v;++g)r[g]=+n(t[g],g,t)}function m(){if(o)for(var g=0,v=t.length;g<v;++g)s[g]=+i(t[g],g,t)}return f.initialize=function(g,v){o=g,u=v,x()},f.links=function(g){return arguments.length?(t=g,x(),f):t},f.id=function(g){return arguments.length?(e=g,f):e},f.iterations=function(g){return arguments.length?(c=+g,f):c},f.strength=function(g){return arguments.length?(n=typeof g=="function"?g:G(+g),b(),f):n},f.distance=function(g){return arguments.length?(i=typeof g=="function"?g:G(+g),m(),f):i},f}var kt=0,St=0,Ct=0,An=1e3,Jt,Tt,Zt=0,mt=0,ie=0,Dt=typeof performance=="object"&&performance.now?performance:Date,$n=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function ke(){return mt||($n(Ps),mt=Dt.now()+ie)}function Ps(){mt=0}function te(){this._call=this._time=this._next=null}te.prototype=Ce.prototype={constructor:te,restart:function(t,e,n){if(typeof t!="function")throw new TypeError("callback is not a function");n=(n==null?ke():+n)+(e==null?0:+e),!this._next&&Tt!==this&&(Tt?Tt._next=this:Jt=this,Tt=this),this._call=t,this._time=n,ge()},stop:function(){this._call&&(this._call=null,this._time=1/0,ge())}};function Ce(t,e,n){var r=new te;return r.restart(t,e,n),r}function Xs(){ke(),++kt;for(var t=Jt,e;t;)(e=mt-t._time)>=0&&t._call.call(void 0,e),t=t._next;--kt}function Fe(){mt=(Zt=Dt.now())+ie,kt=St=0;try{Xs()}finally{kt=0,qs(),mt=0}}function Fs(){var t=Dt.now(),e=t-Zt;e>An&&(ie-=e,Zt=t)}function qs(){for(var t,e=Jt,n,r=1/0;e;)e._call?(r>e._time&&(r=e._time),t=e,e=e._next):(n=e._next,e._next=null,e=t?t._next=n:Jt=n);Tt=t,ge(r)}function ge(t){if(!kt){St&&(St=clearTimeout(St));var e=t-mt;e>24?(t<1/0&&(St=setTimeout(Fe,t-Dt.now()-ie)),Ct&&(Ct=clearInterval(Ct))):(Ct||(Zt=Dt.now(),Ct=setInterval(Fs,An)),kt=1,$n(Fe))}}function qe(t,e,n){var r=new te;return e=e==null?0:+e,r.restart(i=>{r.stop(),t(i+e)},e,n),r}const Bs=1664525,Hs=1013904223,Be=4294967296;function Ys(){let t=1;return()=>(t=(Bs*t+Hs)%Be)/Be}var Vs=10,js=Math.PI*(3-Math.sqrt(5));function Us(t){var e,n=1,r=.001,i=1-Math.pow(r,1/300),s=0,o=.6,a=new Map,l=Ce(h),u=Pt("tick","end"),c=Ys();t==null&&(t=[]);function h(){f(),u.call("tick",e),n<r&&(l.stop(),u.call("end",e))}function f(m){var g,v=t.length,E;m===void 0&&(m=1);for(var _=0;_<m;++_)for(n+=(s-n)*i,a.forEach(function(d){d(n)}),g=0;g<v;++g)E=t[g],E.fx==null?E.x+=E.vx*=o:(E.x=E.fx,E.vx=0),E.fy==null?E.y+=E.vy*=o:(E.y=E.fy,E.vy=0);return e}function x(){for(var m=0,g=t.length,v;m<g;++m){if(v=t[m],v.index=m,v.fx!=null&&(v.x=v.fx),v.fy!=null&&(v.y=v.fy),isNaN(v.x)||isNaN(v.y)){var E=Vs*Math.sqrt(.5+m),_=m*js;v.x=E*Math.cos(_),v.y=E*Math.sin(_)}(isNaN(v.vx)||isNaN(v.vy))&&(v.vx=v.vy=0)}}function b(m){return m.initialize&&m.initialize(t,c),m}return x(),e={tick:f,restart:function(){return l.restart(h),e},stop:function(){return l.stop(),e},nodes:function(m){return arguments.length?(t=m,x(),a.forEach(b),e):t},alpha:function(m){return arguments.length?(n=+m,e):n},alphaMin:function(m){return arguments.length?(r=+m,e):r},alphaDecay:function(m){return arguments.length?(i=+m,e):+i},alphaTarget:function(m){return arguments.length?(s=+m,e):s},velocityDecay:function(m){return arguments.length?(o=1-m,e):1-o},randomSource:function(m){return arguments.length?(c=m,a.forEach(b),e):c},force:function(m,g){return arguments.length>1?(g==null?a.delete(m):a.set(m,b(g)),e):a.get(m)},find:function(m,g,v){var E=0,_=t.length,d,w,M,N,k;for(v==null?v=1/0:v*=v,E=0;E<_;++E)N=t[E],d=m-N.x,w=g-N.y,M=d*d+w*w,M<v&&(k=N,v=M);return k},on:function(m,g){return arguments.length>1?(u.on(m,g),e):u.on(m)}}}function Gs(t){var e=G(.1),n,r,i;typeof t!="function"&&(t=G(t==null?0:+t));function s(a){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vx+=(i[l]-c.x)*r[l]*a}function o(){if(n){var a,l=n.length;for(r=new Array(l),i=new Array(l),a=0;a<l;++a)r[a]=isNaN(i[a]=+t(n[a],a,n))?0:+e(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(e=typeof a=="function"?a:G(+a),o(),s):e},s.x=function(a){return arguments.length?(t=typeof a=="function"?a:G(+a),o(),s):t},s}function Ws(t){var e=G(.1),n,r,i;typeof t!="function"&&(t=G(t==null?0:+t));function s(a){for(var l=0,u=n.length,c;l<u;++l)c=n[l],c.vy+=(i[l]-c.y)*r[l]*a}function o(){if(n){var a,l=n.length;for(r=new Array(l),i=new Array(l),a=0;a<l;++a)r[a]=isNaN(i[a]=+t(n[a],a,n))?0:+e(n[a],a,n)}}return s.initialize=function(a){n=a,o()},s.strength=function(a){return arguments.length?(e=typeof a=="function"?a:G(+a),o(),s):e},s.y=function(a){return arguments.length?(t=typeof a=="function"?a:G(+a),o(),s):t},s}function He(t){return function(){return t}}function Ks(t){var e=+this._x.call(null,t),n=+this._y.call(null,t);return Mn(this.cover(e,n),e,n,t)}function Mn(t,e,n,r){if(isNaN(e)||isNaN(n))return t;var i,s=t._root,o={data:r},a=t._x0,l=t._y0,u=t._x1,c=t._y1,h,f,x,b,m,g,v,E;if(!s)return t._root=o,t;for(;s.length;)if((m=e>=(h=(a+u)/2))?a=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f,i=s,!(s=s[v=g<<1|m]))return i[v]=o,t;if(x=+t._x.call(null,s.data),b=+t._y.call(null,s.data),e===x&&n===b)return o.next=s,i?i[v]=o:t._root=o,t;do i=i?i[v]=new Array(4):t._root=new Array(4),(m=e>=(h=(a+u)/2))?a=h:u=h,(g=n>=(f=(l+c)/2))?l=f:c=f;while((v=g<<1|m)===(E=(b>=f)<<1|x>=h));return i[E]=s,i[v]=o,t}function Qs(t){var e,n,r=t.length,i,s,o=new Array(r),a=new Array(r),l=1/0,u=1/0,c=-1/0,h=-1/0;for(n=0;n<r;++n)isNaN(i=+this._x.call(null,e=t[n]))||isNaN(s=+this._y.call(null,e))||(o[n]=i,a[n]=s,i<l&&(l=i),i>c&&(c=i),s<u&&(u=s),s>h&&(h=s));if(l>c||u>h)return this;for(this.cover(l,u).cover(c,h),n=0;n<r;++n)Mn(this,o[n],a[n],t[n]);return this}function Js(t,e){if(isNaN(t=+t)||isNaN(e=+e))return this;var n=this._x0,r=this._y0,i=this._x1,s=this._y1;if(isNaN(n))i=(n=Math.floor(t))+1,s=(r=Math.floor(e))+1;else{for(var o=i-n,a=this._root,l,u;n>t||t>=i||r>e||e>=s;)switch(u=(e<r)<<1|t<n,l=new Array(4),l[u]=a,a=l,o*=2,u){case 0:i=n+o,s=r+o;break;case 1:n=i-o,s=r+o;break;case 2:i=n+o,r=s-o;break;case 3:n=i-o,r=s-o;break}this._root&&this._root.length&&(this._root=a)}return this._x0=n,this._y0=r,this._x1=i,this._y1=s,this}function Zs(){var t=[];return this.visit(function(e){if(!e.length)do t.push(e.data);while(e=e.next)}),t}function to(t){return arguments.length?this.cover(+t[0][0],+t[0][1]).cover(+t[1][0],+t[1][1]):isNaN(this._x0)?void 0:[[this._x0,this._y0],[this._x1,this._y1]]}function q(t,e,n,r,i){this.node=t,this.x0=e,this.y0=n,this.x1=r,this.y1=i}function eo(t,e,n){var r,i=this._x0,s=this._y0,o,a,l,u,c=this._x1,h=this._y1,f=[],x=this._root,b,m;for(x&&f.push(new q(x,i,s,c,h)),n==null?n=1/0:(i=t-n,s=e-n,c=t+n,h=e+n,n*=n);b=f.pop();)if(!(!(x=b.node)||(o=b.x0)>c||(a=b.y0)>h||(l=b.x1)<i||(u=b.y1)<s))if(x.length){var g=(o+l)/2,v=(a+u)/2;f.push(new q(x[3],g,v,l,u),new q(x[2],o,v,g,u),new q(x[1],g,a,l,v),new q(x[0],o,a,g,v)),(m=(e>=v)<<1|t>=g)&&(b=f[f.length-1],f[f.length-1]=f[f.length-1-m],f[f.length-1-m]=b)}else{var E=t-+this._x.call(null,x.data),_=e-+this._y.call(null,x.data),d=E*E+_*_;if(d<n){var w=Math.sqrt(n=d);i=t-w,s=e-w,c=t+w,h=e+w,r=x.data}}return r}function no(t){if(isNaN(c=+this._x.call(null,t))||isNaN(h=+this._y.call(null,t)))return this;var e,n=this._root,r,i,s,o=this._x0,a=this._y0,l=this._x1,u=this._y1,c,h,f,x,b,m,g,v;if(!n)return this;if(n.length)for(;;){if((b=c>=(f=(o+l)/2))?o=f:l=f,(m=h>=(x=(a+u)/2))?a=x:u=x,e=n,!(n=n[g=m<<1|b]))return this;if(!n.length)break;(e[g+1&3]||e[g+2&3]||e[g+3&3])&&(r=e,v=g)}for(;n.data!==t;)if(i=n,!(n=n.next))return this;return(s=n.next)&&delete n.next,i?(s?i.next=s:delete i.next,this):e?(s?e[g]=s:delete e[g],(n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length&&(r?r[v]=n:this._root=n),this):(this._root=s,this)}function ro(t){for(var e=0,n=t.length;e<n;++e)this.remove(t[e]);return this}function io(){return this._root}function so(){var t=0;return this.visit(function(e){if(!e.length)do++t;while(e=e.next)}),t}function oo(t){var e=[],n,r=this._root,i,s,o,a,l;for(r&&e.push(new q(r,this._x0,this._y0,this._x1,this._y1));n=e.pop();)if(!t(r=n.node,s=n.x0,o=n.y0,a=n.x1,l=n.y1)&&r.length){var u=(s+a)/2,c=(o+l)/2;(i=r[3])&&e.push(new q(i,u,c,a,l)),(i=r[2])&&e.push(new q(i,s,c,u,l)),(i=r[1])&&e.push(new q(i,u,o,a,c)),(i=r[0])&&e.push(new q(i,s,o,u,c))}return this}function ao(t){var e=[],n=[],r;for(this._root&&e.push(new q(this._root,this._x0,this._y0,this._x1,this._y1));r=e.pop();){var i=r.node;if(i.length){var s,o=r.x0,a=r.y0,l=r.x1,u=r.y1,c=(o+l)/2,h=(a+u)/2;(s=i[0])&&e.push(new q(s,o,a,c,h)),(s=i[1])&&e.push(new q(s,c,a,l,h)),(s=i[2])&&e.push(new q(s,o,h,c,u)),(s=i[3])&&e.push(new q(s,c,h,l,u))}n.push(r)}for(;r=n.pop();)t(r.node,r.x0,r.y0,r.x1,r.y1);return this}function uo(t){return t[0]}function lo(t){return arguments.length?(this._x=t,this):this._x}function co(t){return t[1]}function fo(t){return arguments.length?(this._y=t,this):this._y}function Sn(t,e,n){var r=new Ae(e??uo,n??co,NaN,NaN,NaN,NaN);return t==null?r:r.addAll(t)}function Ae(t,e,n,r,i,s){this._x=t,this._y=e,this._x0=n,this._y0=r,this._x1=i,this._y1=s,this._root=void 0}function Ye(t){for(var e={data:t.data},n=e;t=t.next;)n=n.next={data:t.data};return e}var H=Sn.prototype=Ae.prototype;H.copy=function(){var t=new Ae(this._x,this._y,this._x0,this._y0,this._x1,this._y1),e=this._root,n,r;if(!e)return t;if(!e.length)return t._root=Ye(e),t;for(n=[{source:e,target:t._root=new Array(4)}];e=n.pop();)for(var i=0;i<4;++i)(r=e.source[i])&&(r.length?n.push({source:r,target:e.target[i]=new Array(4)}):e.target[i]=Ye(r));return t};H.add=Ks;H.addAll=Qs;H.cover=Js;H.data=Zs;H.extent=to;H.find=eo;H.remove=no;H.removeAll=ro;H.root=io;H.size=so;H.visit=oo;H.visitAfter=ao;H.x=lo;H.y=fo;function ho(){var t,e,n,r=0,i,s,o,a=He(-30),l,u=1,c=1/0,h=.81;function f(){return(Math.random()-.5)*1e-6}function x(_){return _.x}function b(_){return _.y}s=function(){return function(_){return _%13===0}};function m(_){var d,w=t.length;for((!i||o(r,t))&&(i=Sn(t,x,b).visitAfter(v),t.update.push(r)),n=_,d=0;d<w;++d)e=t[d],i.visit(E);++r}function g(){if(t){r=0,t.update=[],o=s(),i=null;var _,d=t.length,w;for(l=new Array(d),_=0;_<d;++_)w=t[_],l[w.index]=+a(w,_,t)}}function v(_){var d=0,w,M,N=0,k,I,C;if(_.length){for(k=I=C=0;C<4;++C)(w=_[C])&&(M=Math.abs(w.value))&&(d+=w.value,N+=M,k+=M*w.x,I+=M*w.y);_.x=k/N,_.y=I/N}else{w=_,w.x=w.data.x,w.y=w.data.y;do d+=l[w.data.index];while(w=w.next)}_.value=d}function E(_,d,w,M){if(!_.value)return!0;var N=_.x-e.x,k=_.y-e.y,I=M-d,C=N*N+k*k;if(I*I/h<C)return C<c&&(N===0&&(N=f(),C+=N*N),k===0&&(k=f(),C+=k*k),C<u&&(C=Math.sqrt(u*C)),e.vx+=N*_.value*n/C,e.vy+=k*_.value*n/C),!0;if(_.length||C>=c)return;(_.data!==e||_.next)&&(N===0&&(N=f(),C+=N*N),k===0&&(k=f(),C+=k*k),C<u&&(C=Math.sqrt(u*C)));do _.data!==e&&(N=_.data.x-e.x,k=_.data.y-e.y,C=N*N+k*k,N===0&&(N=f(),C+=N*N),k===0&&(k=f(),C+=k*k),C<u&&(C=Math.sqrt(u*C)),I=l[_.data.index]*n/C,e.vx+=N*I,e.vy+=k*I);while(_=_.next)}return m.initialize=function(_){t=_,g()},m.strength=function(_){return arguments.length?(a=typeof _=="function"?_:He(+_),g(),m):a},m.distanceMin=function(_){return arguments.length?(u=_*_,m):Math.sqrt(u)},m.distanceMax=function(_){return arguments.length?(c=_*_,m):Math.sqrt(c)},m.theta=function(_){return arguments.length?(h=_*_,m):Math.sqrt(h)},m.update=function(_){return arguments.length?(s=_,o=s(),m):s},m}function $e(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Tn(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Xt(){}var It=.7,ee=1/It,Nt="\\s*([+-]?\\d+)\\s*",zt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",nt="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",po=/^#([0-9a-f]{3,8})$/,go=new RegExp(`^rgb\\(${Nt},${Nt},${Nt}\\)$`),vo=new RegExp(`^rgb\\(${nt},${nt},${nt}\\)$`),xo=new RegExp(`^rgba\\(${Nt},${Nt},${Nt},${zt}\\)$`),mo=new RegExp(`^rgba\\(${nt},${nt},${nt},${zt}\\)$`),_o=new RegExp(`^hsl\\(${zt},${nt},${nt}\\)$`),yo=new RegExp(`^hsla\\(${zt},${nt},${nt},${zt}\\)$`),Ve={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};$e(Xt,Lt,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:je,formatHex:je,formatHex8:wo,formatHsl:bo,formatRgb:Ue,toString:Ue});function je(){return this.rgb().formatHex()}function wo(){return this.rgb().formatHex8()}function bo(){return Rn(this).formatHsl()}function Ue(){return this.rgb().formatRgb()}function Lt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=po.exec(t))?(n=e[1].length,e=parseInt(e[1],16),n===6?Ge(e):n===3?new j(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):n===8?Bt(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):n===4?Bt(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=go.exec(t))?new j(e[1],e[2],e[3],1):(e=vo.exec(t))?new j(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=xo.exec(t))?Bt(e[1],e[2],e[3],e[4]):(e=mo.exec(t))?Bt(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=_o.exec(t))?Qe(e[1],e[2]/100,e[3]/100,1):(e=yo.exec(t))?Qe(e[1],e[2]/100,e[3]/100,e[4]):Ve.hasOwnProperty(t)?Ge(Ve[t]):t==="transparent"?new j(NaN,NaN,NaN,0):null}function Ge(t){return new j(t>>16&255,t>>8&255,t&255,1)}function Bt(t,e,n,r){return r<=0&&(t=e=n=NaN),new j(t,e,n,r)}function No(t){return t instanceof Xt||(t=Lt(t)),t?(t=t.rgb(),new j(t.r,t.g,t.b,t.opacity)):new j}function ve(t,e,n,r){return arguments.length===1?No(t):new j(t,e,n,r??1)}function j(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}$e(j,ve,Tn(Xt,{brighter(t){return t=t==null?ee:Math.pow(ee,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?It:Math.pow(It,t),new j(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new j(xt(this.r),xt(this.g),xt(this.b),ne(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:We,formatHex:We,formatHex8:Eo,formatRgb:Ke,toString:Ke}));function We(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}`}function Eo(){return`#${vt(this.r)}${vt(this.g)}${vt(this.b)}${vt((isNaN(this.opacity)?1:this.opacity)*255)}`}function Ke(){const t=ne(this.opacity);return`${t===1?"rgb(":"rgba("}${xt(this.r)}, ${xt(this.g)}, ${xt(this.b)}${t===1?")":`, ${t})`}`}function ne(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function xt(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function vt(t){return t=xt(t),(t<16?"0":"")+t.toString(16)}function Qe(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new J(t,e,n,r)}function Rn(t){if(t instanceof J)return new J(t.h,t.s,t.l,t.opacity);if(t instanceof Xt||(t=Lt(t)),!t)return new J;if(t instanceof J)return t;t=t.rgb();var e=t.r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),s=Math.max(e,n,r),o=NaN,a=s-i,l=(s+i)/2;return a?(e===s?o=(n-r)/a+(n<r)*6:n===s?o=(r-e)/a+2:o=(e-n)/a+4,a/=l<.5?s+i:2-s-i,o*=60):a=l>0&&l<1?0:o,new J(o,a,l,t.opacity)}function ko(t,e,n,r){return arguments.length===1?Rn(t):new J(t,e,n,r??1)}function J(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}$e(J,ko,Tn(Xt,{brighter(t){return t=t==null?ee:Math.pow(ee,t),new J(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?It:Math.pow(It,t),new J(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new j(le(t>=240?t-240:t+120,i,r),le(t,i,r),le(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new J(Je(this.h),Ht(this.s),Ht(this.l),ne(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=ne(this.opacity);return`${t===1?"hsl(":"hsla("}${Je(this.h)}, ${Ht(this.s)*100}%, ${Ht(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Je(t){return t=(t||0)%360,t<0?t+360:t}function Ht(t){return Math.max(0,Math.min(1,t||0))}function le(t,e,n){return(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)*255}const Dn=t=>()=>t;function Co(t,e){return function(n){return t+n*e}}function Ao(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}function $o(t){return(t=+t)==1?In:function(e,n){return n-e?Ao(e,n,t):Dn(isNaN(e)?n:e)}}function In(t,e){var n=e-t;return n?Co(t,n):Dn(isNaN(t)?e:t)}const Ze=function t(e){var n=$o(e);function r(i,s){var o=n((i=ve(i)).r,(s=ve(s)).r),a=n(i.g,s.g),l=n(i.b,s.b),u=In(i.opacity,s.opacity);return function(c){return i.r=o(c),i.g=a(c),i.b=l(c),i.opacity=u(c),i+""}}return r.gamma=t,r}(1);function ft(t,e){return t=+t,e=+e,function(n){return t*(1-n)+e*n}}var xe=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ce=new RegExp(xe.source,"g");function Mo(t){return function(){return t}}function So(t){return function(e){return t(e)+""}}function To(t,e){var n=xe.lastIndex=ce.lastIndex=0,r,i,s,o=-1,a=[],l=[];for(t=t+"",e=e+"";(r=xe.exec(t))&&(i=ce.exec(e));)(s=i.index)>n&&(s=e.slice(n,s),a[o]?a[o]+=s:a[++o]=s),(r=r[0])===(i=i[0])?a[o]?a[o]+=i:a[++o]=i:(a[++o]=null,l.push({i:o,x:ft(r,i)})),n=ce.lastIndex;return n<e.length&&(s=e.slice(n),a[o]?a[o]+=s:a[++o]=s),a.length<2?l[0]?So(l[0].x):Mo(e):(e=l.length,function(u){for(var c=0,h;c<e;++c)a[(h=l[c]).i]=h.x(u);return a.join("")})}var tn=180/Math.PI,me={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function zn(t,e,n,r,i,s){var o,a,l;return(o=Math.sqrt(t*t+e*e))&&(t/=o,e/=o),(l=t*n+e*r)&&(n-=t*l,r-=e*l),(a=Math.sqrt(n*n+r*r))&&(n/=a,r/=a,l/=a),t*r<e*n&&(t=-t,e=-e,l=-l,o=-o),{translateX:i,translateY:s,rotate:Math.atan2(e,t)*tn,skewX:Math.atan(l)*tn,scaleX:o,scaleY:a}}var Yt;function Ro(t){const e=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return e.isIdentity?me:zn(e.a,e.b,e.c,e.d,e.e,e.f)}function Do(t){return t==null||(Yt||(Yt=document.createElementNS("http://www.w3.org/2000/svg","g")),Yt.setAttribute("transform",t),!(t=Yt.transform.baseVal.consolidate()))?me:(t=t.matrix,zn(t.a,t.b,t.c,t.d,t.e,t.f))}function Ln(t,e,n,r){function i(u){return u.length?u.pop()+" ":""}function s(u,c,h,f,x,b){if(u!==h||c!==f){var m=x.push("translate(",null,e,null,n);b.push({i:m-4,x:ft(u,h)},{i:m-2,x:ft(c,f)})}else(h||f)&&x.push("translate("+h+e+f+n)}function o(u,c,h,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:h.push(i(h)+"rotate(",null,r)-2,x:ft(u,c)})):c&&h.push(i(h)+"rotate("+c+r)}function a(u,c,h,f){u!==c?f.push({i:h.push(i(h)+"skewX(",null,r)-2,x:ft(u,c)}):c&&h.push(i(h)+"skewX("+c+r)}function l(u,c,h,f,x,b){if(u!==h||c!==f){var m=x.push(i(x)+"scale(",null,",",null,")");b.push({i:m-4,x:ft(u,h)},{i:m-2,x:ft(c,f)})}else(h!==1||f!==1)&&x.push(i(x)+"scale("+h+","+f+")")}return function(u,c){var h=[],f=[];return u=t(u),c=t(c),s(u.translateX,u.translateY,c.translateX,c.translateY,h,f),o(u.rotate,c.rotate,h,f),a(u.skewX,c.skewX,h,f),l(u.scaleX,u.scaleY,c.scaleX,c.scaleY,h,f),u=c=null,function(x){for(var b=-1,m=f.length,g;++b<m;)h[(g=f[b]).i]=g.x(x);return h.join("")}}}var Io=Ln(Ro,"px, ","px)","deg)"),zo=Ln(Do,", ",")",")"),Lo=1e-12;function en(t){return((t=Math.exp(t))+1/t)/2}function Oo(t){return((t=Math.exp(t))-1/t)/2}function Po(t){return((t=Math.exp(2*t))-1)/(t+1)}const Xo=function t(e,n,r){function i(s,o){var a=s[0],l=s[1],u=s[2],c=o[0],h=o[1],f=o[2],x=c-a,b=h-l,m=x*x+b*b,g,v;if(m<Lo)v=Math.log(f/u)/e,g=function(N){return[a+N*x,l+N*b,u*Math.exp(e*N*v)]};else{var E=Math.sqrt(m),_=(f*f-u*u+r*m)/(2*u*n*E),d=(f*f-u*u-r*m)/(2*f*n*E),w=Math.log(Math.sqrt(_*_+1)-_),M=Math.log(Math.sqrt(d*d+1)-d);v=(M-w)/e,g=function(N){var k=N*v,I=en(w),C=u/(n*E)*(I*Po(e*k+w)-Oo(w));return[a+C*x,l+C*b,u*I/en(e*k+w)]}}return g.duration=v*1e3*e/Math.SQRT2,g}return i.rho=function(s){var o=Math.max(.001,+s),a=o*o,l=a*a;return t(o,a,l)},i}(Math.SQRT2,2,4);var Fo=Pt("start","end","cancel","interrupt"),qo=[],On=0,nn=1,_e=2,Ut=3,rn=4,ye=5,Gt=6;function se(t,e,n,r,i,s){var o=t.__transition;if(!o)t.__transition={};else if(n in o)return;Bo(t,n,{name:e,index:r,group:i,on:Fo,tween:qo,time:s.time,delay:s.delay,duration:s.duration,ease:s.ease,timer:null,state:On})}function Me(t,e){var n=Z(t,e);if(n.state>On)throw new Error("too late; already scheduled");return n}function rt(t,e){var n=Z(t,e);if(n.state>Ut)throw new Error("too late; already running");return n}function Z(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Bo(t,e,n){var r=t.__transition,i;r[e]=n,n.timer=Ce(s,0,n.time);function s(u){n.state=nn,n.timer.restart(o,n.delay,n.time),n.delay<=u&&o(u-n.delay)}function o(u){var c,h,f,x;if(n.state!==nn)return l();for(c in r)if(x=r[c],x.name===n.name){if(x.state===Ut)return qe(o);x.state===rn?(x.state=Gt,x.timer.stop(),x.on.call("interrupt",t,t.__data__,x.index,x.group),delete r[c]):+c<e&&(x.state=Gt,x.timer.stop(),x.on.call("cancel",t,t.__data__,x.index,x.group),delete r[c])}if(qe(function(){n.state===Ut&&(n.state=rn,n.timer.restart(a,n.delay,n.time),a(u))}),n.state=_e,n.on.call("start",t,t.__data__,n.index,n.group),n.state===_e){for(n.state=Ut,i=new Array(f=n.tween.length),c=0,h=-1;c<f;++c)(x=n.tween[c].value.call(t,t.__data__,n.index,n.group))&&(i[++h]=x);i.length=h+1}}function a(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(l),n.state=ye,1),h=-1,f=i.length;++h<f;)i[h].call(t,c);n.state===ye&&(n.on.call("end",t,t.__data__,n.index,n.group),l())}function l(){n.state=Gt,n.timer.stop(),delete r[e];for(var u in r)return;delete t.__transition}}function Wt(t,e){var n=t.__transition,r,i,s=!0,o;if(n){e=e==null?null:e+"";for(o in n){if((r=n[o]).name!==e){s=!1;continue}i=r.state>_e&&r.state<ye,r.state=Gt,r.timer.stop(),r.on.call(i?"interrupt":"cancel",t,t.__data__,r.index,r.group),delete n[o]}s&&delete t.__transition}}function Ho(t){return this.each(function(){Wt(this,t)})}function Yo(t,e){var n,r;return function(){var i=rt(this,t),s=i.tween;if(s!==n){r=n=s;for(var o=0,a=r.length;o<a;++o)if(r[o].name===e){r=r.slice(),r.splice(o,1);break}}i.tween=r}}function Vo(t,e,n){var r,i;if(typeof n!="function")throw new Error;return function(){var s=rt(this,t),o=s.tween;if(o!==r){i=(r=o).slice();for(var a={name:e,value:n},l=0,u=i.length;l<u;++l)if(i[l].name===e){i[l]=a;break}l===u&&i.push(a)}s.tween=i}}function jo(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r=Z(this.node(),n).tween,i=0,s=r.length,o;i<s;++i)if((o=r[i]).name===t)return o.value;return null}return this.each((e==null?Yo:Vo)(n,t,e))}function Se(t,e,n){var r=t._id;return t.each(function(){var i=rt(this,r);(i.value||(i.value={}))[e]=n.apply(this,arguments)}),function(i){return Z(i,r).value[e]}}function Pn(t,e){var n;return(typeof e=="number"?ft:e instanceof Lt?Ze:(n=Lt(e))?(e=n,Ze):To)(t,e)}function Uo(t){return function(){this.removeAttribute(t)}}function Go(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Wo(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttribute(t);return o===i?null:o===r?s:s=e(r=o,n)}}function Ko(t,e,n){var r,i=n+"",s;return function(){var o=this.getAttributeNS(t.space,t.local);return o===i?null:o===r?s:s=e(r=o,n)}}function Qo(t,e,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttribute(t):(o=this.getAttribute(t),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a)))}}function Jo(t,e,n){var r,i,s;return function(){var o,a=n(this),l;return a==null?void this.removeAttributeNS(t.space,t.local):(o=this.getAttributeNS(t.space,t.local),l=a+"",o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a)))}}function Zo(t,e){var n=re(t),r=n==="transform"?zo:Pn;return this.attrTween(t,typeof e=="function"?(n.local?Jo:Qo)(n,r,Se(this,"attr."+t,e)):e==null?(n.local?Go:Uo)(n):(n.local?Ko:Wo)(n,r,e))}function ta(t,e){return function(n){this.setAttribute(t,e.call(this,n))}}function ea(t,e){return function(n){this.setAttributeNS(t.space,t.local,e.call(this,n))}}function na(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&ea(t,s)),n}return i._value=e,i}function ra(t,e){var n,r;function i(){var s=e.apply(this,arguments);return s!==r&&(n=(r=s)&&ta(t,s)),n}return i._value=e,i}function ia(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;var r=re(t);return this.tween(n,(r.local?na:ra)(r,e))}function sa(t,e){return function(){Me(this,t).delay=+e.apply(this,arguments)}}function oa(t,e){return e=+e,function(){Me(this,t).delay=e}}function aa(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?sa:oa)(e,t)):Z(this.node(),e).delay}function ua(t,e){return function(){rt(this,t).duration=+e.apply(this,arguments)}}function la(t,e){return e=+e,function(){rt(this,t).duration=e}}function ca(t){var e=this._id;return arguments.length?this.each((typeof t=="function"?ua:la)(e,t)):Z(this.node(),e).duration}function fa(t,e){if(typeof e!="function")throw new Error;return function(){rt(this,t).ease=e}}function ha(t){var e=this._id;return arguments.length?this.each(fa(e,t)):Z(this.node(),e).ease}function pa(t,e){return function(){var n=e.apply(this,arguments);if(typeof n!="function")throw new Error;rt(this,t).ease=n}}function da(t){if(typeof t!="function")throw new Error;return this.each(pa(this._id,t))}function ga(t){typeof t!="function"&&(t=hn(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i<n;++i)for(var s=e[i],o=s.length,a=r[i]=[],l,u=0;u<o;++u)(l=s[u])&&t.call(l,l.__data__,u,s)&&a.push(l);return new lt(r,this._parents,this._name,this._id)}function va(t){if(t._id!==this._id)throw new Error;for(var e=this._groups,n=t._groups,r=e.length,i=n.length,s=Math.min(r,i),o=new Array(r),a=0;a<s;++a)for(var l=e[a],u=n[a],c=l.length,h=o[a]=new Array(c),f,x=0;x<c;++x)(f=l[x]||u[x])&&(h[x]=f);for(;a<r;++a)o[a]=e[a];return new lt(o,this._parents,this._name,this._id)}function xa(t){return(t+"").trim().split(/^|\s+/).every(function(e){var n=e.indexOf(".");return n>=0&&(e=e.slice(0,n)),!e||e==="start"})}function ma(t,e,n){var r,i,s=xa(e)?Me:rt;return function(){var o=s(this,t),a=o.on;a!==r&&(i=(r=a).copy()).on(e,n),o.on=i}}function _a(t,e){var n=this._id;return arguments.length<2?Z(this.node(),n).on.on(t):this.each(ma(n,t,e))}function ya(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}function wa(){return this.on("end.remove",ya(this._id))}function ba(t){var e=this._name,n=this._id;typeof t!="function"&&(t=we(t));for(var r=this._groups,i=r.length,s=new Array(i),o=0;o<i;++o)for(var a=r[o],l=a.length,u=s[o]=new Array(l),c,h,f=0;f<l;++f)(c=a[f])&&(h=t.call(c,c.__data__,f,a))&&("__data__"in c&&(h.__data__=c.__data__),u[f]=h,se(u[f],e,n,f,u,Z(c,n)));return new lt(s,this._parents,e,n)}function Na(t){var e=this._name,n=this._id;typeof t!="function"&&(t=fn(t));for(var r=this._groups,i=r.length,s=[],o=[],a=0;a<i;++a)for(var l=r[a],u=l.length,c,h=0;h<u;++h)if(c=l[h]){for(var f=t.call(c,c.__data__,h,l),x,b=Z(c,n),m=0,g=f.length;m<g;++m)(x=f[m])&&se(x,e,n,m,f,b);s.push(f),o.push(c)}return new lt(s,o,e,n)}var Ea=Ot.prototype.constructor;function ka(){return new Ea(this._groups,this._parents)}function Ca(t,e){var n,r,i;return function(){var s=Et(this,t),o=(this.style.removeProperty(t),Et(this,t));return s===o?null:s===n&&o===r?i:i=e(n=s,r=o)}}function Xn(t){return function(){this.style.removeProperty(t)}}function Aa(t,e,n){var r,i=n+"",s;return function(){var o=Et(this,t);return o===i?null:o===r?s:s=e(r=o,n)}}function $a(t,e,n){var r,i,s;return function(){var o=Et(this,t),a=n(this),l=a+"";return a==null&&(l=a=(this.style.removeProperty(t),Et(this,t))),o===l?null:o===r&&l===i?s:(i=l,s=e(r=o,a))}}function Ma(t,e){var n,r,i,s="style."+e,o="end."+s,a;return function(){var l=rt(this,t),u=l.on,c=l.value[s]==null?a||(a=Xn(e)):void 0;(u!==n||i!==c)&&(r=(n=u).copy()).on(o,i=c),l.on=r}}function Sa(t,e,n){var r=(t+="")=="transform"?Io:Pn;return e==null?this.styleTween(t,Ca(t,r)).on("end.style."+t,Xn(t)):typeof e=="function"?this.styleTween(t,$a(t,r,Se(this,"style."+t,e))).each(Ma(this._id,t)):this.styleTween(t,Aa(t,r,e),n).on("end.style."+t,null)}function Ta(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}function Ra(t,e,n){var r,i;function s(){var o=e.apply(this,arguments);return o!==i&&(r=(i=o)&&Ta(t,o,n)),r}return s._value=e,s}function Da(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(e==null)return this.tween(r,null);if(typeof e!="function")throw new Error;return this.tween(r,Ra(t,e,n??""))}function Ia(t){return function(){this.textContent=t}}function za(t){return function(){var e=t(this);this.textContent=e??""}}function La(t){return this.tween("text",typeof t=="function"?za(Se(this,"text",t)):Ia(t==null?"":t+""))}function Oa(t){return function(e){this.textContent=t.call(this,e)}}function Pa(t){var e,n;function r(){var i=t.apply(this,arguments);return i!==n&&(e=(n=i)&&Oa(i)),e}return r._value=t,r}function Xa(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(t==null)return this.tween(e,null);if(typeof t!="function")throw new Error;return this.tween(e,Pa(t))}function Fa(){for(var t=this._name,e=this._id,n=Fn(),r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,u=0;u<a;++u)if(l=o[u]){var c=Z(l,e);se(l,t,n,u,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new lt(r,this._parents,t,n)}function qa(){var t,e,n=this,r=n._id,i=n.size();return new Promise(function(s,o){var a={value:o},l={value:function(){--i===0&&s()}};n.each(function(){var u=rt(this,r),c=u.on;c!==t&&(e=(t=c).copy(),e._.cancel.push(a),e._.interrupt.push(a),e._.end.push(l)),u.on=e}),i===0&&s()})}var Ba=0;function lt(t,e,n,r){this._groups=t,this._parents=e,this._name=n,this._id=r}function Fn(){return++Ba}var ot=Ot.prototype;lt.prototype={constructor:lt,select:ba,selectAll:Na,selectChild:ot.selectChild,selectChildren:ot.selectChildren,filter:ga,merge:va,selection:ka,transition:Fa,call:ot.call,nodes:ot.nodes,node:ot.node,size:ot.size,empty:ot.empty,each:ot.each,on:_a,attr:Zo,attrTween:ia,style:Sa,styleTween:Da,text:La,textTween:Xa,remove:wa,tween:jo,delay:aa,duration:ca,ease:ha,easeVarying:da,end:qa,[Symbol.iterator]:ot[Symbol.iterator]};function Ha(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var Ya={time:null,delay:0,duration:250,ease:Ha};function Va(t,e){for(var n;!(n=t.__transition)||!(n=n[e]);)if(!(t=t.parentNode))throw new Error(`transition ${e} not found`);return n}function ja(t){var e,n;t instanceof lt?(e=t._id,t=t._name):(e=Fn(),(n=Ya).time=ke(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,s=0;s<i;++s)for(var o=r[s],a=o.length,l,u=0;u<a;++u)(l=o[u])&&se(l,t,e,u,o,n||Va(l,e));return new lt(r,this._parents,t,e)}Ot.prototype.interrupt=Ho;Ot.prototype.transition=ja;const Vt=t=>()=>t;function Ua(t,{sourceEvent:e,target:n,transform:r,dispatch:i}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:e,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:i}})}function ut(t,e,n){this.k=t,this.x=e,this.y=n}ut.prototype={constructor:ut,scale:function(t){return t===1?this:new ut(this.k*t,this.x,this.y)},translate:function(t,e){return t===0&e===0?this:new ut(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Te=new ut(1,0,0);ut.prototype;function fe(t){t.stopImmediatePropagation()}function At(t){t.preventDefault(),t.stopImmediatePropagation()}function Ga(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function Wa(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function sn(){return this.__zoom||Te}function Ka(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function Qa(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ja(t,e,n){var r=t.invertX(e[0][0])-n[0][0],i=t.invertX(e[1][0])-n[1][0],s=t.invertY(e[0][1])-n[0][1],o=t.invertY(e[1][1])-n[1][1];return t.translate(i>r?(r+i)/2:Math.min(0,r)||Math.max(0,i),o>s?(s+o)/2:Math.min(0,s)||Math.max(0,o))}function Za(){var t=Ga,e=Wa,n=Ja,r=Ka,i=Qa,s=[0,1/0],o=[[-1/0,-1/0],[1/0,1/0]],a=250,l=Xo,u=Pt("start","zoom","end"),c,h,f,x=500,b=150,m=0,g=10;function v(p){p.property("__zoom",sn).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",C).filter(i).on("touchstart.zoom",O).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}v.transform=function(p,A,y,$){var T=p.selection?p.selection():p;T.property("__zoom",sn),p!==T?w(p,A,y,$):T.interrupt().each(function(){M(this,arguments).event($).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},v.scaleBy=function(p,A,y,$){v.scaleTo(p,function(){var T=this.__zoom.k,R=typeof A=="function"?A.apply(this,arguments):A;return T*R},y,$)},v.scaleTo=function(p,A,y,$){v.transform(p,function(){var T=e.apply(this,arguments),R=this.__zoom,D=y==null?d(T):typeof y=="function"?y.apply(this,arguments):y,z=R.invert(D),P=typeof A=="function"?A.apply(this,arguments):A;return n(_(E(R,P),D,z),T,o)},y,$)},v.translateBy=function(p,A,y,$){v.transform(p,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof y=="function"?y.apply(this,arguments):y),e.apply(this,arguments),o)},null,$)},v.translateTo=function(p,A,y,$,T){v.transform(p,function(){var R=e.apply(this,arguments),D=this.__zoom,z=$==null?d(R):typeof $=="function"?$.apply(this,arguments):$;return n(Te.translate(z[0],z[1]).scale(D.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof y=="function"?-y.apply(this,arguments):-y),R,o)},$,T)};function E(p,A){return A=Math.max(s[0],Math.min(s[1],A)),A===p.k?p:new ut(A,p.x,p.y)}function _(p,A,y){var $=A[0]-y[0]*p.k,T=A[1]-y[1]*p.k;return $===p.x&&T===p.y?p:new ut(p.k,$,T)}function d(p){return[(+p[0][0]+ +p[1][0])/2,(+p[0][1]+ +p[1][1])/2]}function w(p,A,y,$){p.on("start.zoom",function(){M(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){M(this,arguments).event($).end()}).tween("zoom",function(){var T=this,R=arguments,D=M(T,R).event($),z=e.apply(T,R),P=y==null?d(z):typeof y=="function"?y.apply(T,R):y,tt=Math.max(z[1][0]-z[0][0],z[1][1]-z[0][1]),X=T.__zoom,K=typeof A=="function"?A.apply(T,R):A,it=l(X.invert(P).concat(tt/X.k),K.invert(P).concat(tt/K.k));return function(Q){if(Q===1)Q=K;else{var st=it(Q),oe=tt/st[2];Q=new ut(oe,P[0]-st[0]*oe,P[1]-st[1]*oe)}D.zoom(null,Q)}})}function M(p,A,y){return!y&&p.__zooming||new N(p,A)}function N(p,A){this.that=p,this.args=A,this.active=0,this.sourceEvent=null,this.extent=e.apply(p,A),this.taps=0}N.prototype={event:function(p){return p&&(this.sourceEvent=p),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(p,A){return this.mouse&&p!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&p!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&p!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(p){var A=V(this.that).datum();u.call(p,this.that,new Ua(p,{sourceEvent:this.sourceEvent,target:v,type:p,transform:this.that.__zoom,dispatch:u}),A)}};function k(p,...A){if(!t.apply(this,arguments))return;var y=M(this,A).event(p),$=this.__zoom,T=Math.max(s[0],Math.min(s[1],$.k*Math.pow(2,r.apply(this,arguments)))),R=at(p);if(y.wheel)(y.mouse[0][0]!==R[0]||y.mouse[0][1]!==R[1])&&(y.mouse[1]=$.invert(y.mouse[0]=R)),clearTimeout(y.wheel);else{if($.k===T)return;y.mouse=[R,$.invert(R)],Wt(this),y.start()}At(p),y.wheel=setTimeout(D,b),y.zoom("mouse",n(_(E($,T),y.mouse[0],y.mouse[1]),y.extent,o));function D(){y.wheel=null,y.end()}}function I(p,...A){if(f||!t.apply(this,arguments))return;var y=p.currentTarget,$=M(this,A,!0).event(p),T=V(p.view).on("mousemove.zoom",P,!0).on("mouseup.zoom",tt,!0),R=at(p,y),D=p.clientX,z=p.clientY;bn(p.view),fe(p),$.mouse=[R,this.__zoom.invert(R)],Wt(this),$.start();function P(X){if(At(X),!$.moved){var K=X.clientX-D,it=X.clientY-z;$.moved=K*K+it*it>m}$.event(X).zoom("mouse",n(_($.that.__zoom,$.mouse[0]=at(X,y),$.mouse[1]),$.extent,o))}function tt(X){T.on("mousemove.zoom mouseup.zoom",null),Nn(X.view,$.moved),At(X),$.event(X).end()}}function C(p,...A){if(t.apply(this,arguments)){var y=this.__zoom,$=at(p.changedTouches?p.changedTouches[0]:p,this),T=y.invert($),R=y.k*(p.shiftKey?.5:2),D=n(_(E(y,R),$,T),e.apply(this,A),o);At(p),a>0?V(this).transition().duration(a).call(w,D,$,p):V(this).call(v.transform,D,$,p)}}function O(p,...A){if(t.apply(this,arguments)){var y=p.touches,$=y.length,T=M(this,A,p.changedTouches.length===$).event(p),R,D,z,P;for(fe(p),D=0;D<$;++D)z=y[D],P=at(z,this),P=[P,this.__zoom.invert(P),z.identifier],T.touch0?!T.touch1&&T.touch0[2]!==P[2]&&(T.touch1=P,T.taps=0):(T.touch0=P,R=!0,T.taps=1+!!c);c&&(c=clearTimeout(c)),R&&(T.taps<2&&(h=P[0],c=setTimeout(function(){c=null},x)),Wt(this),T.start())}}function U(p,...A){if(this.__zooming){var y=M(this,A).event(p),$=p.changedTouches,T=$.length,R,D,z,P;for(At(p),R=0;R<T;++R)D=$[R],z=at(D,this),y.touch0&&y.touch0[2]===D.identifier?y.touch0[0]=z:y.touch1&&y.touch1[2]===D.identifier&&(y.touch1[0]=z);if(D=y.that.__zoom,y.touch1){var tt=y.touch0[0],X=y.touch0[1],K=y.touch1[0],it=y.touch1[1],Q=(Q=K[0]-tt[0])*Q+(Q=K[1]-tt[1])*Q,st=(st=it[0]-X[0])*st+(st=it[1]-X[1])*st;D=E(D,Math.sqrt(Q/st)),z=[(tt[0]+K[0])/2,(tt[1]+K[1])/2],P=[(X[0]+it[0])/2,(X[1]+it[1])/2]}else if(y.touch0)z=y.touch0[0],P=y.touch0[1];else return;y.zoom("touch",n(_(D,z,P),y.extent,o))}}function Y(p,...A){if(this.__zooming){var y=M(this,A).event(p),$=p.changedTouches,T=$.length,R,D;for(fe(p),f&&clearTimeout(f),f=setTimeout(function(){f=null},x),R=0;R<T;++R)D=$[R],y.touch0&&y.touch0[2]===D.identifier?delete y.touch0:y.touch1&&y.touch1[2]===D.identifier&&delete y.touch1;if(y.touch1&&!y.touch0&&(y.touch0=y.touch1,delete y.touch1),y.touch0)y.touch0[1]=this.__zoom.invert(y.touch0[0]);else if(y.end(),y.taps===2&&(D=at(D,this),Math.hypot(h[0]-D[0],h[1]-D[1])<g)){var z=V(this).on("dblclick.zoom");z&&z.apply(this,arguments)}}}return v.wheelDelta=function(p){return arguments.length?(r=typeof p=="function"?p:Vt(+p),v):r},v.filter=function(p){return arguments.length?(t=typeof p=="function"?p:Vt(!!p),v):t},v.touchable=function(p){return arguments.length?(i=typeof p=="function"?p:Vt(!!p),v):i},v.extent=function(p){return arguments.length?(e=typeof p=="function"?p:Vt([[+p[0][0],+p[0][1]],[+p[1][0],+p[1][1]]]),v):e},v.scaleExtent=function(p){return arguments.length?(s[0]=+p[0],s[1]=+p[1],v):[s[0],s[1]]},v.translateExtent=function(p){return arguments.length?(o[0][0]=+p[0][0],o[1][0]=+p[1][0],o[0][1]=+p[0][1],o[1][1]=+p[1][1],v):[[o[0][0],o[0][1]],[o[1][0],o[1][1]]]},v.constrain=function(p){return arguments.length?(n=p,v):n},v.duration=function(p){return arguments.length?(a=+p,v):a},v.interpolate=function(p){return arguments.length?(l=p,v):l},v.on=function(){var p=u.on.apply(u,arguments);return p===u?v:p},v.clickDistance=function(p){return arguments.length?(m=(p=+p)*p,v):Math.sqrt(m)},v.tapDistance=function(p){return arguments.length?(g=+p,v):g},v}var ht=(t=>(t[t.NeigbhorIsParent=0]="NeigbhorIsParent",t[t.NeigbhorIsAChild=1]="NeigbhorIsAChild",t[t.NeigbhorIsASibling=2]="NeigbhorIsASibling",t[t.NoneOfTheAbove=3]="NoneOfTheAbove",t[t.NeigbhorIsAFormerChild=4]="NeigbhorIsAFormerChild",t))(ht||{});const tu=[{title:"IsParent",relationship:ht.NeigbhorIsParent},{title:"IsAChild",relationship:ht.NeigbhorIsAChild},{title:"IsASibling",relationship:ht.NeigbhorIsASibling},{title:"NoneOfTheAbove",relationship:ht.NoneOfTheAbove}],qn=[ht.NeigbhorIsAChild,ht.NeigbhorIsParent],eu=t=>t.linkType==="Router2Router"?1:qn.includes(t.relationship)?.5:0,nu=[...qn,ht.NeigbhorIsASibling],$t=100,ru={BrokenLink:5*$t,Router2Router:2.5*$t,Coordinator2Router:2.5*$t,Coordinator2EndDevice:$t,EndDevice2Router:$t},iu=t=>ru[t.linkType]??250,su=(t,e)=>{const n=t.source,r=t.target,[i,s]=e.apply([n.x,n.y]),[o,a]=e.apply([r.x,r.y]);return`M ${i} ${s} L ${o} ${a}`},ou=({transform:t,node:e,link:n,linkLabel:r,links:i})=>{i.forEach(s=>{const[o,a]=t.apply([s.source.x,s.source.y]),[l,u]=t.apply([s.target.x,s.target.y]);s.x=(l+o)/2,s.y=(u+a)/2}),n.attr("d",s=>su(s,t)),r.attr("x",({source:s,target:o})=>t.applyX((s.x+o.x)/2)).attr("y",({source:s,target:o})=>t.applyY((s.y+o.y)/2)),e.attr("transform",s=>{const[l,u]=t.apply([s.x,s.y]);return`translate(${l-16}, ${u-16})`})},au=({networkGraph:t,links:e,selectedNode:n,node:r,link:i,linkLabel:s})=>{const o=new Set;t.nodes.forEach(u=>o.add(u.ieeeAddr+","+u.ieeeAddr)),e.forEach(u=>o.add(u.source.ieeeAddr+","+u.target.ieeeAddr));const a=(u,c)=>o.has(u.ieeeAddr+","+c.ieeeAddr),l=u=>(u==null?void 0:u.source)===n||(u==null?void 0:u.target)===n?1:.15;n?(r.style("opacity",u=>a(n,u)||a(u,n)?1:.15),i.style("stroke-opacity",l),s.style("opacity",l)):(r.style("opacity",1),i.style("stroke-opacity",1),s.style("opacity",1))};class uu extends et.Component{constructor(){super(...arguments),this.ref=et.createRef(),this.svgRef=et.createRef(),this.simulation=Us(),this.state={width:0,height:0,visibleLinks:nu,legendIsVisible:!0},this.transform=Te,this.updateNodes=()=>{var x;const{networkGraph:e}=this.props,{visibleLinks:n,selectedNode:r,width:i,height:s}=this.state,o=V(this.svgRef.current),a=o.selectAll(`.${L.node}`),l=o.selectAll(`.${L.link}`),u=o.selectAll(`.${L.linkLabel}`),c=e.links.filter(b=>De(n,b.relationships).length);this.simulation.nodes(e.nodes.concat(c)),(x=this.simulation.force("link"))==null||x.links(c),this.simulation.on("tick",()=>ou({transform:this.transform,node:a,link:l,linkLabel:u,links:c}));const h=o.selectAll(".everything");Za().extent([[0,0],[i,s]]).scaleExtent([1/10,8]).on("zoom",({transform:b})=>{h.attr("transform",b)})(o),au({networkGraph:e,links:c,selectedNode:r,node:a,link:l,linkLabel:u}),a.on("click",(b,m)=>{this.setState({selectedNode:r?null:m})}),this.simulation.alphaTarget(.03).restart()},this.initPage=()=>{const{width:e,height:n}=this.ref.current.getBoundingClientRect();this.setState({width:e,height:n}),this.updateForces(e,n)},this.onRequestClick=()=>{const{networkMapRequest:e}=this.props;e()},this.onLinkTypeFilterChange=e=>{const{visibleLinks:n}=this.state,{checked:r,value:i}=e.target,s=parseInt(i,10);let o=[...n];r?o.push(s):o=o.filter(a=>a!==s),this.setState({visibleLinks:o})}}updateForces(e,n){this.simulation=this.simulation.force("link",Os().id(r=>r.ieeeAddr).distance(iu).strength(eu)).force("charge",ho().strength(-700)).force("collisionForce",zs()).force("center",vs(e/2,n/2)).force("x",Gs().strength(.1)).force("y",Ws().strength(.2))}componentDidMount(){setTimeout(this.initPage,200)}componentDidUpdate(){this.updateNodes()}renderMap(){const{width:e,height:n,visibleLinks:r}=this.state,{networkGraph:i,deviceStates:s,devices:o,availability:a}=this.props,l=i.links.filter(u=>De(r,u.relationships).length>0);return S.jsx("svg",{ref:this.svgRef,viewBox:`0 0 ${e} ${n}`,children:S.jsxs("g",{className:"everything",children:[S.jsx(ns,{links:l}),S.jsx(gs,{root:this.svgRef.current,nodes:i.nodes,simulation:this.simulation,deviceStates:s,devices:o,availability:a})]})})}renderMessage(){const{networkGraphIsLoading:e,t:n}=this.props;return S.jsx("div",{className:"h-100 d-flex justify-content-center align-items-center",children:e?S.jsx("div",{className:"card",children:S.jsxs("div",{className:"card-body",children:[S.jsx("div",{className:"card-title",children:S.jsx(Gn,{})}),S.jsx("div",{children:n("loading")})]})}):S.jsx(Re,{onClick:this.onRequestClick,className:"btn btn-primary d-block",children:n("load")})})}renderMapControls(){const{visibleLinks:e}=this.state;return S.jsxs("div",{className:L.controls,children:[tu.map(n=>S.jsxs("div",{className:"form-check form-check-inline",children:[S.jsx("input",{onChange:this.onLinkTypeFilterChange,className:"form-check-input",type:"checkbox",id:n.title,value:n.relationship,checked:e.includes(n.relationship)}),S.jsx("label",{className:"form-check-label",htmlFor:n.title,children:n.title})]},n.title)),S.jsx("div",{className:"btn-group btn-group-sm",role:"group",children:S.jsx(Re,{title:"Refresh data",className:"btn btn-primary",onClick:this.onRequestClick,children:S.jsx("i",{className:"fa fa-sync"})})})]})}renderHelp(){const{t:e}=this.props,{legendIsVisible:n}=this.state;return S.jsxs("div",{className:wt("fixed-bottom",{"d-none":!n}),onClick:()=>this.setState({legendIsVisible:!1}),children:[S.jsxs("div",{className:wt(L.node,L.Coordinator),children:[S.jsx("svg",{width:"28",height:"28",viewBox:"0 0 28 28",children:S.jsx("polygon",{points:En(5,5,14)})})," ",e("help_is_coordinator")]}),S.jsx("div",{className:wt(L.node,L.EndDevice),children:e("help_end_device_description")}),S.jsx("div",{className:wt(L.node,L.Router),children:e("help_router_description")}),S.jsx("div",{children:e("help_coordinator_link_description")}),S.jsx("div",{children:e("help_router_links_description")}),S.jsx("div",{children:e("help_lqi_description")}),S.jsx("div",{children:e("hide")})]})}render(){const{networkGraph:e}=this.props;return S.jsx("div",{className:L.container,ref:this.ref,children:e.nodes.length?S.jsxs(et.Fragment,{children:[this.renderMapControls()," ",this.renderMap(),this.renderHelp()]}):this.renderMessage()})}}const gu=Hn("map")(Yn(["networkGraph","networkGraphIsLoading","deviceStates","devices","availability"],Vn)(uu));export{gu as ConnectedMap};
@@ -1 +0,0 @@
1
- import{av as b,aJ as F,x as v,au as S,ax as C,c as D,a as x,r as A,i as E,H as w,j as m}from"./index-90cbbe98.js";import{D as B}from"./DashboardDevice-0edaffd7.js";import{i as j,b as k,g as I,c as f,D as T}from"./DashboardFeatureWrapper-36ae220c.js";import{_ as N}from"./_baseSet-2920b059.js";import{c as G}from"./_getAllKeysIn-f4f1cff0.js";import{a as P,g as L,G as K,p as M}from"./persist-35479e12.js";import{D as y}from"./DEVICES_GLOBAL_NAME-6620c611.js";import"./index-911a3282.js";import"./powerSourceTypeToTranslationKey-452dac81.js";import"./DeviceImage-502b1925.js";import"./index-207ba255.js";import"./isEqual-8f5aec6e.js";var O=b,R=N,V=F;function W(t,a,n){for(var e=-1,s=a.length,l={};++e<s;){var r=a[e],i=O(t,r);n(i,r)&&R(l,V(r,t),i)}return l}var $=W,q=S,H=C,J=$,z=G;function Q(t,a){if(t==null)return{};var n=q(z(t),function(e){return[e]});return a=H(a),J(t,n,function(e,s){return a(e,s[0])})}var U=Q;const X=v(U),Y=["linkquality","battery","battery_low","battery_state","color_temp_startup","voltage","strength","color_options","warning","position","operation_mode","operation_mode2","programming_mode","options","programming","schedule_monday","schedule_tuesday","schedule_wednesday","schedule_thursday","schedule_friday","schedule_saturday","schedule_sunday","holiday_mode_date"],Z=["state","brightness","color_temp","mode","sound","occupancy","tamper","alarm"],ee=["light"],re=["",null,void 0],g=(t,a={})=>{const{access:n,property:e,name:s,type:l}=t;let{features:r}=t;if(j(t)||k(t)){r=r.map(d=>g(d,e?a[e]:a)).filter(d=>d);const c=I(r,"property");r=Object.values(c).map(d=>d[0])}const i={...t,features:r};return Z.includes(s)||ee.includes(l)?i:n&&!(n&f.ACCESS_STATE&&!re.includes(a[e]))?!1:s=="voltage"&&a.battery==null?i:Y.includes(s)?!1:n===f.ACCESS_STATE||n===f.ACCESS_STATE+f.ACCESS_READ||Array.isArray(r)&&r.length>0?i:!1},te=["friendly_name","description","ieee_address","manufacturer","type","power_source","model_id","definition.model","definition.vendor"];function ae(t,a,n){return Object.values(t).filter(e=>e.supported).map(e=>({device:e,deviceState:a[e.friendly_name]??{}})).map(({device:e,deviceState:s})=>{var i;const r=(((i=e.definition)==null?void 0:i.exposes)??[]).map(c=>n(c,s)).filter(c=>c);return{device:e,deviceState:s,filteredFeatures:r}}).filter(({filteredFeatures:e})=>e.length>0).sort((e,s)=>e.device.friendly_name.localeCompare(s.device.friendly_name))}function se(t){const{setDeviceState:a,getDeviceState:n,deviceStates:e,bridgeInfo:s,devices:l}=t,[r,i]=A.useState(()=>P(L(y))??{}),c=o=>{const p={...r,globalFilter:o};i(p),M(y,p)},d=X(l,(o,p)=>E(o,s.config)?!1:r.globalFilter?te.map(u=>w(o,u)).filter(Boolean).map(String).map(u=>u.toLowerCase()).some(u=>u.includes(r.globalFilter.toLowerCase())):!0);return m.jsxs("div",{className:"row",children:[m.jsx("div",{className:"col-12",children:m.jsx("div",{className:"flex-fill card flex-shrink-1",children:m.jsx("div",{className:"card-footer",children:m.jsx(K,{globalFilter:r.globalFilter,setGlobalFilter:c})})})}),ae(d,e,g).map(({device:o,deviceState:p,filteredFeatures:u})=>m.jsx(B,{feature:{features:u},device:o,deviceState:p,onChange:(h,_)=>a(o.friendly_name,_),onRead:(h,_)=>n(o.friendly_name,_),featureWrapperClass:T,lastSeenType:s.config.advanced.last_seen},o.ieee_address))]})}const ge=D(["devices","deviceStates","bridgeInfo"],x)(se);export{ge as ConnectedDashboardPage};
@@ -1 +0,0 @@
1
- import{_ as x}from"./_getAllKeysIn-f4f1cff0.js";import{aJ as g,az as u,ah as l,aN as m}from"./index-90cbbe98.js";var I=x,h=g,p=u,e=l,K=m;function O(r,n,o,d){if(!e(r))return r;n=h(n,r);for(var i=-1,f=n.length,v=f-1,a=r;a!=null&&++i<f;){var s=K(n[i]),t=o;if(s==="__proto__"||s==="constructor"||s==="prototype")return r;if(i!=v){var _=a[s];t=d?d(_,s,a):void 0,t===void 0&&(t=e(_)?_:p(n[i+1])?[]:{})}I(a,s,t),a=a[s]}return r}var c=O;export{c as _};
@@ -1 +0,0 @@
1
- import{ab as t,ay as n,ah as o,ai as y,aO as i,as as v,aP as l,aq as u,ae as p,aQ as _,aR as g}from"./index-90cbbe98.js";var P=t,b=n,f=Object.prototype,O=f.hasOwnProperty;function I(r,a,s){var e=r[a];(!(O.call(r,a)&&b(e,s))||s===void 0&&!(a in r))&&P(r,a,s)}var W=I;function A(r){var a=[];if(r!=null)for(var s in Object(r))a.push(s);return a}var K=A,h=o,m=y,c=K,S=Object.prototype,$=S.hasOwnProperty;function w(r){if(!h(r))return c(r);var a=m(r),s=[];for(var e in r)e=="constructor"&&(a||!$.call(r,e))||s.push(e);return s}var V=w,L=i,k=V,q=v;function G(r){return q(r)?L(r,!0):k(r)}var d=G,x=l,Q=x(Object.getPrototypeOf,Object),R=Q,z=u,B=R,C=p,D=_,E=Object.getOwnPropertySymbols,F=E?function(r){for(var a=[];r;)z(a,C(r)),r=B(r);return a}:D,H=F,J=g,M=H,N=d;function T(r){return J(r,N,M)}var X=T;export{W as _,H as a,R as b,X as c,d as k};
@@ -1 +0,0 @@
1
- import{x as N,y as S,u as T,j as t,w as _,r as v,B as u,n as C,c as z,a as D,z as I,F as O,A as F,C as q,D as A,E as B,b as E}from"./index-90cbbe98.js";import{_ as K,w as P,T as V,c as j}from"./bootstrap-5.esm-63ff73ff.js";import{T as R,D as L}from"./rjsf-translation-fields-0b911a96.js";import{p as M}from"./powerSourceTypeToTranslationKey-452dac81.js";import{S as $}from"./spinner-12fdfcec.js";import{g as G,a as U}from"./index-207ba255.js";import"./_getAllKeysIn-f4f1cff0.js";import"./isEqual-8f5aec6e.js";import"./intersection-af08d8a1.js";const Z={"ui:order":["base_topic","server","user","password","client_id","version","ca","key","cert","reject_unauthorized","*"]},H={"ui:order":["port","adapter","disable_led","*"]},J={"ui:order":["port","host","*"]},Y={mqtt:Z,serial:H,frontend:J};var W=K,x=S;function Q(a,e,s,n){return a==null?[]:(x(e)||(e=e==null?[]:[e]),s=n?void 0:s,x(s)||(s=s==null?[]:[s]),W(a,e,s))}var X=Q;const ee=N(X);function te(a){const{devices:e}=a,{t:s}=T(["stats","zigbee"]),n=Object.values(e).filter(i=>i.type!=="Coordinator"),r=n.length,o={byType:{},byPowerSource:{},byVendor:{},byModel:{}};n.forEach(i=>{o.byModel[i.model_id]=(o.byModel[i.model_id]||0)+1,o.byVendor[i.manufacturer]=(o.byVendor[i.manufacturer]||0)+1,o.byType[s(i.type)]=(o.byType[s(i.type)]||0)+1;const l=s("zigbee:"+M(i.power_source));o.byPowerSource[l]=(o.byPowerSource[l]||0)+1});const m=Object.entries(o).map(([i,l])=>t.jsx("li",{className:"list-group-item d-flex justify-content-between align-items-start",children:t.jsxs("div",{className:"ms-2 me-auto",children:[t.jsx("div",{className:"fw-bold",children:s(i)}),ee(Object.entries(l),[([c,d])=>d],["desc"]).map(([c,d])=>t.jsxs("div",{children:[c,": ",d]},c))]})},i));return t.jsxs("ol",{className:"list-group list-group-numbered",children:[t.jsx("li",{className:"list-group-item d-flex justify-content-between align-items-start",children:t.jsx("div",{className:"ms-2 me-auto",children:t.jsxs("div",{className:"fw-bold",children:[s("total")," ",r]})})}),m]})}const se={access:"public",cache:""},ne=["*.css"],re="zigbee2mqtt-frontend",oe="0.6.168",ie="GPL-3.0",ae={build:"vite build",preview:"vite preview",start:"vite dev",postversion:"git push && git push --tags",version:"conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md",pretty:'prettier --write "./**/*.{js,jsx,tsx}"',postinstall:"husky install",prepublishOnly:"pinst --disable",postpublish:"pinst --enable","test:unit":"vitest","test:coverage":"vitest run --coverage","test:eslint":'eslint "./src/**/*.{js,jsx,tsx}"',"test:pretty":'prettier --check "./**/*.{js,jsx,tsx}"',"i18n:download":"node download_translations.js","i18n:trim":"node trim-locales.js"},ce=["dist/*"],le={node:">=18"},de={"@codemirror/lang-javascript":"^6.2.2","@commitlint/cli":"~17.8.0","@commitlint/config-conventional":"~17.8.0","@ebay/nice-modal-react":"~1.2.13","@fortawesome/fontawesome-free":"~6.4.2","@rjsf/bootstrap-5":"https://github.com/nurikk/fileshare/blob/main/rjsf-bootstrap-5-4.2.0.tgz?raw=true","@rjsf/core":"~4.2.3","@testing-library/jest-dom":"^6.3.0","@testing-library/react":"^14.1.2","@testing-library/user-event":"^14.5.2","@types/color-convert":"~2.0.1","@types/d3-drag":"~3.0.4","@types/d3-force":"~3.0.6","@types/d3-selection":"~3.0.7","@types/d3-zoom":"~3.0.5","@types/events":"~3.0.1","@types/file-saver":"~2.0.5","@types/json-schema":"~7.0.13","@types/lodash":"~4.14.199","@types/react":"~18.2.24","@types/react-dom":"~18.2.8","@types/react-router-dom":"~5.3.3","@types/react-table":"~7.7.16","@types/react-transition-group":"~4.4.7","@types/reconnectingwebsocket":"~1.0.8","@types/ws":"~8.5.6","@typescript-eslint/eslint-plugin":"~6.7.4","@typescript-eslint/parser":"~6.7.4","@uiw/codemirror-theme-github":"^4.21.24","@uiw/react-codemirror":"^4.21.24","@vitejs/plugin-react":"~4.1.0","@vitest/coverage-v8":"^1.2.2",bootstrap:"~5.3.2",classnames:"~2.3.2","color-convert":"~2.0.1","conventional-changelog-cli":"~4.1.0","d3-drag":"~3.0.0","d3-force":"~3.0.0","d3-force-reuse":"~1.0.1","d3-selection":"~3.0.0","d3-zoom":"~3.0.0","deep-diff":"~1.0.2","deep-object-diff":"~1.1.9",eslint:"~8.57.0","eslint-config-prettier":"~9.0.0","eslint-config-react":"~1.1.7","eslint-plugin-prettier":"~5.0.0","eslint-plugin-react":"~7.33.2","eslint-plugin-react-refresh":"*",events:"~3.3.0","file-saver":"~2.0.5",husky:"~8.0.3",i18next:"~23.5.1","i18next-browser-languagedetector":"~7.1.0",jsdom:"^24.0.0",jszip:"~3.10.1",lodash:"~4.17.21",notyf:"~3.10.0",pinst:"~3.0.0",prettier:"~3.0.3",react:"~18.2.0","react-app-polyfill":"~3.0.0","react-bootstrap":"~2.10.0","react-css-theme-switcher":"~0.3.0","react-dom":"~18.2.0","react-i18next":"~13.5.0","react-image":"~4.1.0","react-notifications-component":"^4.0.1","react-router-dom":"~5.3.4","react-table":"~7.8.0","react-transition-group":"~4.4.5","reconnecting-websocket":"~4.4.0",sass:"~1.71.0",store2:"^2.14.2","timeago.js":"~4.0.2",typescript:"~5.2.2",unistore:"~3.5.2",vite:"~4.5.0","vite-plugin-compression":"~0.5.1","vite-plugin-html":"~3.2.0","vite-plugin-sass-dts":"~1.3.11",vitest:"^1.3.1",ws:"~8.14.2","zigbee-herdsman":"~0.35.3","zigbee-herdsman-converters":"~15.132.0"},me="index.js",pe={hooks:{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},ue={type:"git",url:"git+https://github.com/nurikk/zigbee2mqtt-frontend.git"},ge={url:"https://github.com/nurikk/zigbee2mqtt-frontend/issues"},he={private:!1,publishConfig:se,sideEffects:ne,name:re,version:oe,license:ie,scripts:ae,eslintIgnore:ce,engines:le,devDependencies:de,main:me,husky:pe,repository:ue,bugs:ge};function fe(a){return new Promise((e,s)=>{const n=new FileReader;n.onloadend=()=>e(n.result),n.onerror=r=>s(r),n.readAsDataURL(a)})}async function be(a){const e=await fetch(a);if(e.ok){const s=await e.blob();return fe(s)}else return Promise.reject(e.status)}async function ve(a,e){for(const s of a)try{if(await e(s))return!0}catch{}return!1}function ye(a){const[e,s]=v.useState("none"),{setDeviceOptions:n,t:r,devices:o}=a,[m,i]=v.useState({});async function l(c){if(i(p=>({...p,[c.ieee_address]:"init"})),!await ve([G,U],async p=>{const g=p(c),h=await be(g);return await n(c.ieee_address,{icon:h}),i(f=>({...f,[c.ieee_address]:"done"})),!0}))throw new Error("Failed to localise image")}switch(v.useEffect(()=>{if(e=="start"){for(const c of Object.values(o).filter(d=>d.type!=="Coordinator"))l(c).catch(d=>{console.log("Error localising image",d),i(p=>({...p,[c.ieee_address]:"error"}))}).then();s("inprogress")}},[e]),e){case"none":return t.jsx(u,{className:"btn btn-primary d-block mt-2",onClick:()=>s("start"),children:r("localise_images")});case"inprogress":return t.jsx("div",{children:Object.values(o).map(c=>t.jsxs("div",{children:[c.friendly_name," ",m[c.ieee_address]]},c.ieee_address))});case"done":return t.jsx("div",{children:"done"})}return t.jsx("div",{children:"Unknown"})}const je=_(["settings"])(ye),xe=P(V),b="main",w=["groups","devices","device_options","ban","whitelist","map_options"],ke=["object","array"],k=(a,e={},s={})=>{e.required&&(e.required=e.required.filter(n=>a.includes(n)));for(const n of a)e.properties&&delete e.properties[n],delete s[n];return{schema:e,config:s}},_e=[t.jsx("div",{className:"row pb-2",children:t.jsx("div",{className:"col",children:t.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.buymeacoffee.com/nurikk",children:t.jsx("img",{crossOrigin:"anonymous",src:"https://img.buymeacoffee.com/button-api/?text=Thanks for frontend&emoji=🍺&slug=nurikk&button_colour=FFDD00&font_colour=000000&font_family=Arial&outline_colour=000000&coffee_colour=ffffff"})})})},"nurikk"),t.jsx("div",{className:"row pb-2",children:t.jsx("div",{className:"col",children:t.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://www.buymeacoffee.com/koenkk",children:t.jsx("img",{crossOrigin:"anonymous",src:"https://img.buymeacoffee.com/button-api/?text=Thanks for zigbee2mqtt&emoji=☕&slug=koenkk&button_colour=FFDD00&font_colour=000000&font_family=Arial&outline_colour=000000&coffee_colour=ffffff"})})})},"koenkk")].sort(()=>Math.random()-.5),we=(a,e)=>ke.includes(e.type)&&!w.includes(a)||(e&&e.oneOf?e.oneOf.length>0:!1);class Ne extends v.Component{constructor(){super(...arguments),this.state={keyName:b},this.downloadBackup=()=>{const{backup:e,bridgeInfo:s}=this.props,n=I(new Date).replace(/[\s_:]/g,"-"),r=`z2m-backup.${s.version}.${n}.zip`;O.saveAs(`data:application/zip;base64,${e}`,r)},this.addInstallCode=()=>{const{t:e,addInstallCode:s}=this.props,n=prompt(e("enter_install_code"));n&&s(n)},this.onSettingsSave=e=>{const{formData:s}=e,{updateBridgeConfig:n}=this.props,{keyName:r}=this.state,o=F(this.getSettingsInfo().currentConfig,s);n(r===b?o:{[r]:o})}}renderCategoriesTabs(){const{t:e}=this.props;return t.jsx("ul",{className:"nav nav-tabs",children:q.map(s=>t.jsx("li",{className:"nav-item",children:t.jsx(A,{className:"nav-link",activeClassName:"active",to:s.url,children:e(s.translationKey)})},s.url))})}render(){return t.jsxs("div",{className:"tab",children:[this.renderCategoriesTabs(),t.jsx("div",{className:"tab-content h-100 p-0 p-sm-3",children:t.jsx("div",{className:"tab-pane fade show active",children:this.renderSwitcher()})})]})}renderSwitcher(){const{match:e}=this.props,{tab:s}=e.params;switch(s){case"tools":return this.renderTools();case"bridge":return this.renderBridgeInfo();case"about":return this.renderAbout();case"settings":return this.renderSettings();case"donate":return this.renderDonate();case"translate":return this.renderTranslate();default:return t.jsx(B,{to:"/settings/settings"})}}renderTranslate(){const{t:e}=this.props;return t.jsx("div",{className:"p-3",children:t.jsxs("p",{children:[e("settings:translation_prompt")," ",t.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:"https://poeditor.com/join/project?hash=Az88waAhPd",children:"POEditor"})]})})}renderAbout(){var l,c,d,p,g,h,f;const{bridgeInfo:e,devices:s,t:n}=this.props,o=((l=e.version)==null?void 0:l.match(/^\d+\.\d+\.\d+$/))===null?e.version:t.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee2mqtt/releases/tag/${e.version}`,children:e.version}),m=e.commit?t.jsxs(t.Fragment,{children:["commit:"," ",t.jsx("a",{target:"_blank",rel:"noopener noreferrer",href:`https://github.com/Koenkk/zigbee2mqtt/commit/${e.commit}`,children:e.commit})]}):null,i=[{translationKey:"zigbee2mqtt_version",content:t.jsxs(t.Fragment,{children:[o," ",m]})},{translationKey:"coordinator_type",content:t.jsx(t.Fragment,{children:((c=e.coordinator)==null?void 0:c.type)??n("common:unknown")})},{translationKey:"coordinator_revision",content:t.jsx(t.Fragment,{children:((p=(d=e.coordinator)==null?void 0:d.meta)==null?void 0:p.revision)??n("common:unknown")})},{translationKey:"coordinator_ieee_address",content:t.jsx(t.Fragment,{children:((g=e.coordinator)==null?void 0:g.ieee_address)??n("common:unknown")})},{translationKey:"frontend_version",content:he.version},{translationKey:"zigbee_herdsman_converters_version",content:((h=e.zigbee_herdsman_converters)==null?void 0:h.version)??n("common:unknown")},{translationKey:"zigbee_herdsman_version",content:((f=e.zigbee_herdsman)==null?void 0:f.version)??n("common:unknown")},{translationKey:"stats",content:t.jsx(te,{devices:s})}];return t.jsx("div",{className:"p-3",children:i.map(y=>t.jsxs("dl",{className:"row",children:[t.jsx("dt",{className:"col-sm-3",children:n(y.translationKey)}),t.jsx("dd",{className:"col-sm-9",children:y.content})]},y.translationKey))})}renderBridgeInfo(){const{bridgeInfo:e}=this.props;return t.jsx("div",{className:"p-3",children:t.jsx("pre",{children:JSON.stringify(e,null,4)})})}renderBackupControls(){const{backup:e,preparingBackup:s,requestBackup:n,t:r}=this.props;return s?t.jsx(u,{className:"btn btn-primary d-block mt-2 disabled",children:t.jsx($,{})}):e?t.jsx(u,{className:"btn btn-primary d-block mt-2",onClick:this.downloadBackup,children:r("download_z2m_backup")}):t.jsx(u,{className:"btn btn-primary d-block mt-2",onClick:n,children:r("request_z2m_backup")})}renderTools(){const{exportState:e,restartBridge:s,setDeviceOptions:n,devices:r,t:o}=this.props;return t.jsxs("div",{className:"p-3",children:[t.jsx(u,{className:"btn btn-primary d-block mt-2",onClick:e,children:o("download_state")}),t.jsx(u,{className:"btn btn-danger d-block mt-2",onClick:s,prompt:!0,children:o("restart_zigbee2mqtt")}),this.renderBackupControls(),t.jsx(u,{className:"btn btn-primary d-block mt-2",onClick:this.addInstallCode,children:o("add_install_code")}),t.jsx(je,{setDeviceOptions:n,devices:r})]})}getSettingsTabs(){const{bridgeInfo:{config_schema:e={properties:{}}},t:s}=this.props,n=Object.entries(e.properties).filter(([r,o])=>we(r,o)).map(([r,o])=>({name:r,title:s(r,{defaultValue:o.title})}));return n.unshift({name:b,title:s("main",{defaultValue:"Main"})}),n}getSettingsInfo(){const{keyName:e}=this.state,{bridgeInfo:{config_schema:s,config:n}}=this.props;let r=k(w,j(s),j(n)),o=r.schema,m;if(e===b){const i=this.getSettingsTabs().map(l=>l.name);r=k(i,r.schema,r.config),o=r.schema,m=r.config}else m=r.config[e],r.schema.properties&&(o=r.schema.properties[e]);return{currentSchema:o,currentConfig:m}}renderSettingsTabs(){const{t:e}=this.props,s=this.getSettingsTabs(),{keyName:n}=this.state;return t.jsx("div",{className:"nav nav-pills",children:s.map(r=>t.jsx("li",{className:"nav-item",children:t.jsx("a",{className:E("nav-link",{"bg-primary active":n===r.name}),"aria-current":"page",href:"#",onClick:o=>{this.setState({keyName:r.name}),o.preventDefault()},children:e(r.name,{defaultValue:r.title})})},r.name))})}renderSettings(){const{keyName:e}=this.state,{currentSchema:s,currentConfig:n}=this.getSettingsInfo();return t.jsxs("div",{className:"tab",children:[this.renderSettingsTabs(),t.jsx("div",{className:"tab-content",children:t.jsx("div",{className:"tab-pane active",children:t.jsx(xe,{idPrefix:e,schema:s,formData:n,onSubmit:this.onSettingsSave,uiSchema:Y[e],fields:{TitleField:R,DescriptionField:L}})})})]})}renderDonate(){const{t:e}=this.props,s=e("donation_text",{returnObjects:!0,defaultValue:[]});return t.jsxs("div",{className:"container-fluid",children:[s.map(n=>t.jsx("p",{children:n},n)),_e]})}}const Se=C(Ne),Te=["bridgeInfo","missingTranslations","devices","backup","preparingBackup"],Ee=_(["settings","common"])(z(Te,D)(Se));export{Ee as ConnectedSettingsPage};
Binary file
@@ -1 +0,0 @@
1
- import{x as v,S as u,H as x,j as e,b,z as _,c as N,a as y,w as L,r as w,T as g}from"./index-90cbbe98.js";import{w as C,T as S}from"./bootstrap-5.esm-63ff73ff.js";import{_ as E}from"./_baseSet-2920b059.js";var F=u,j=/[\\^$.*+?()[\]{}|]/g,R=RegExp(j.source);function T(s){return s=F(s),s&&R.test(s)?s.replace(j,"\\$&"):s}var $=T;const D=v($);var K=E;function P(s,o,a){return s==null?s:K(s,o,a)}var z=P;const H=v(z),I={"hide-description":"_hide-description_19xm6_1"},k=C(S);function A(s){const{schema:o={},schemaKey:a="",config:c={},configKey:t="",onChange:r}=s,n=x(c,t,{}),d=x(o,a,{}),l=i=>{const h={};H(h,t,i.formData),r(h)};return e.jsx(k,{schema:d,className:I["hide-description"],formData:n,onChange:l,children:e.jsx("div",{})})}const m="all",p=({text:s})=>e.jsx(e.Fragment,{children:s}),O=({text:s="",highlight:o=""})=>{if(!o.trim())return e.jsx(p,{text:s});const a=new RegExp(`(${D(o)})`,"gi"),c=s.split(a);return e.jsx(e.Fragment,{children:c.filter(t=>t).map((t,r)=>a.test(t)?e.jsx("mark",{children:t},r):e.jsx(p,{text:t},r))})};function f(s){const{logLevel:o,log:a,search:c}=s,t=o===m&&e.jsxs(e.Fragment,{children:[e.jsx("span",{style:{width:"60px"},className:b("badge",{"bg-danger":a.level==="error","bg-warning":a.level==="warning","bg-info":a.level==="info","bg-secondary":!["error","warning","info"].includes(a.level)},"text-capitalize"),children:a.level})," "]});return e.jsxs("div",{children:[t,e.jsx("small",{className:"pe-1",children:_(a.timestamp)}),e.jsx("code",{children:e.jsx(O,{text:a.message,highlight:c})})]})}const B=[m,"debug","info","warning","error"],M=[100,200,500,1e3];class W extends w.Component{constructor(){super(...arguments),this.state={search:"",logLevel:m}}renderSearch(){const{clearLogs:o,bridgeInfo:{config_schema:a,config:c},updateBridgeConfig:t,t:r}=this.props,{search:n}=this.state,{logsLimit:d}=g.getState();return e.jsx("div",{className:"card",children:e.jsx("div",{className:"card-body",children:e.jsxs("div",{className:"row row-cols-lg-auto g-3 align-items-center",children:[e.jsxs("div",{className:"col-12 col-sm-4 col-xxl-4",children:[e.jsx("label",{htmlFor:"log-level",className:"form-label",children:r("show_only")}),e.jsx("select",{id:"log-level",className:"form-select",onChange:l=>this.setState({logLevel:l.target.value}),children:B.map(l=>e.jsx("option",{value:l,children:l},l))})]}),e.jsxs("div",{className:"col-12 col-sm-4 col-xxl-4",children:[e.jsx("label",{htmlFor:"search-filter",className:"form-label",children:r("filter_by_text")}),e.jsx("input",{id:"search-filter",className:"form-control col-10",placeholder:r("common:enter_search_criteria"),value:n,onChange:l=>this.setState({search:l.target.value}),type:"text"})]}),e.jsx("div",{className:"col-12 col-sm-4 col-xxl-4",children:e.jsx(A,{schema:a,schemaKey:"properties.advanced.properties.log_level",config:c,configKey:"advanced.log_level",onChange:t})}),e.jsxs("div",{className:"col-12 col-sm-4 col-xxl-4",children:[e.jsx("label",{htmlFor:"logs-limit",className:"form-label",children:r("logs_limit")}),e.jsx("select",{id:"logs-limit",className:"form-select",onChange:l=>{const i=parseInt(l.target.value);g.setState({logsLimit:i,logs:[...g.getState().logs.slice(-i)]})},children:M.map(l=>e.jsx("option",{value:l,selected:l==d,children:l},l))})]}),e.jsxs("div",{className:"col-12",children:[e.jsx("label",{htmlFor:"reset",children:" "}),e.jsx("input",{id:"reset",type:"button",onClick:o,className:"btn btn-primary form-control",value:r("common:clear")})]})]})})})}render(){let{logs:o}=this.props;const{t:a}=this.props,{search:c,logLevel:t}=this.state;return o=o.filter(r=>(t===m||r.level===t)&&(!c||r.message.toLowerCase().includes(c.toLowerCase()))).sort(),e.jsxs(e.Fragment,{children:[this.renderSearch(),e.jsx("div",{className:"card",children:e.jsxs("div",{className:"card-body",children:[o.length==0?e.jsx("h1",{children:a("empty_logs_message")}):null,e.jsx("div",{className:"overflow-auto",children:o.map((r,n)=>e.jsx(f,{log:r,search:c,logLevel:t},n))})]})})]})}}const q=["logs","bridgeInfo"],G=N(q,y)(L(["logs","common"])(W)),V=Object.freeze(Object.defineProperty({__proto__:null,ConnectedLogsPage:G,LogRow:f},Symbol.toStringTag,{value:"Module"}));export{m as A,f as L,V as i};
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{u as f,l as g,j as a,r as j,L as D,g as x,d as _,c as w,a as C,w as S,R as h,i as H}from"./index-90cbbe98.js";import{V as k,M as E}from"./vendor-links-f9ac94a7.js";import{L,D as T,P as q}from"./index-911a3282.js";import{i as F,A as M,D as N}from"./Availability-6f2af4ef.js";import{T as P}from"./ReactTableCom-dd32722c.js";import{D as A}from"./DeviceImage-502b1925.js";import{D as I}from"./DEVICES_GLOBAL_NAME-6620c611.js";import"./powerSourceTypeToTranslationKey-452dac81.js";import"./persist-35479e12.js";import"./index-207ba255.js";const R={"action-column":"_action-column_1729o_1","device-pic":"_device-pic_1729o_8","device-image":"_device-image_1729o_14"};function V(l){const{data:t,lastSeenType:n,availabilityFeatureEnabled:r,homeassistantEnabled:c,setDeviceDescription:y}=l,{renameDevice:d,removeDevice:m,configureDevice:v}=l,{t:s}=f(["zigbee","common","avaliability"]),u=n!=="disable"?[{id:"last_seen",Header:s("last_seen"),accessor:({state:e})=>{var i;return(i=g(e,n))==null?void 0:i.getTime()},Cell:({row:{original:{state:e}}})=>a.jsx(L,{state:e,lastSeenType:n})}]:[],b=r?[{id:"availability",Header:s("avaliability:avaliability"),accessor:({availabilityState:e})=>F(e)?e:e.state,Cell:({row:{original:{availabilityState:e,availabilityEnabledForDevice:i,disabled:o}}})=>a.jsx(M,{disabled:o,availability:e,availabilityEnabledForDevice:i})}]:[],p=j.useMemo(()=>[{id:"pic",Header:s("pic"),Cell:({row:{original:{device:e,state:i,disabled:o}}})=>a.jsx(A,{className:R["device-image"],device:e,deviceStatus:i,disabled:o}),accessor:e=>e,disableSortBy:!0},{id:"friendly_name",Header:s("friendly_name"),accessor:({device:e})=>[e.friendly_name,e.description].join(" "),Cell:({row:{original:{device:e}}})=>a.jsxs(a.Fragment,{children:[a.jsx(D,{to:x(e.ieee_address),children:e.friendly_name}),a.jsx("small",{className:"d-block",children:e.description})]})},{id:"ieee_address",Header:s("ieee_address"),accessor:({device:e})=>[e.ieee_address,_(e.network_address,4)].join(" "),Cell:({row:{original:{device:e}}})=>a.jsxs(a.Fragment,{children:[a.jsx("div",{children:e.ieee_address}),a.jsxs("div",{children:["(",_(e.network_address,4),")"]})]})},{id:"manufacturer",Header:s("manufacturer"),accessor:({device:e})=>{var i;return[(i=e.definition)==null?void 0:i.vendor,e.manufacturer].join(" ")},Cell:({row:{original:{device:e}}})=>a.jsx(k,{device:e})},{id:"model",Header:s("model"),accessor:({device:e})=>{var i;return[(i=e.definition)==null?void 0:i.model,e.model_id].join(" ")},Cell:({row:{original:{device:e}}})=>a.jsx(E,{device:e})},{id:"lqi",Header:s("lqi"),accessor:({state:e})=>e.linkquality,Cell:({row:{original:{state:e}}})=>a.jsx(T,{value:e.linkquality,name:"linkquality"})},...u,...b,{id:"power",Header:s("power"),accessor:({state:e,device:i})=>{var o;return[e.battery,(o=i.definition)==null?void 0:o.power].join(" ")},Cell:({row:{original:{state:e,device:i}}})=>a.jsx(q,{device:i,deviceState:e})},{id:"controls",Header:"",Cell:({row:{original:{device:e,state:i}}})=>a.jsx(N,{device:e,state:i,homeassistantEnabled:c,renameDevice:d,removeDevice:m,configureDevice:v,setDeviceDescription:y}),disableSortBy:!0}],[u,b,s,c,d,m,v]);return a.jsx("div",{className:"card",children:a.jsx("div",{className:"table-responsive",children:a.jsx(P,{id:I,columns:p,data:t})})})}function B(l){const{devices:t,deviceStates:n,bridgeInfo:{config:r},availability:c}=l,{renameDevice:y,removeDevice:d,configureDevice:m,setDeviceDescription:v}=l,s=!!r.availability,u=!!(r!=null&&r.homeassistant),b=()=>Object.values(t).filter(e=>e.type!=="Coordinator").map(e=>{var o;const i=n[e.friendly_name]??{};return{id:e.friendly_name,disabled:H(e,r),device:e,state:i,availabilityState:c[e.friendly_name]??"offline",availabilityEnabledForDevice:((o=r.devices[e.ieee_address])==null?void 0:o.availability)!==!1}}),p=h.useMemo(()=>b(),[t,n]);return a.jsx(V,{data:p,lastSeenType:r.advanced.last_seen,availabilityFeatureEnabled:s,homeassistantEnabled:u,renameDevice:y,removeDevice:d,configureDevice:m,setDeviceDescription:v})}const z=["devices","deviceStates","bridgeInfo","availability"],$=w(z,C)(S(["zigbee","common"])(B));export{$ as ConnectedZigbeePage};
Binary file
Binary file
Binary file
@@ -1 +0,0 @@
1
- import{r as Rr,K as br,R as Sr,u as Cr,j as we,s as zt}from"./index-90cbbe98.js";var Tt={exports:{}},He={exports:{}};(function(te,oe){(function(H,R){R(oe,Rr)})(br,function(H,R){function ce(e,t,n,r,i,o,u){try{var a=e[o](u),l=a.value}catch(c){return void n(c)}a.done?t(l):Promise.resolve(l).then(r,i)}function de(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function u(l){ce(o,r,i,u,a,"next",l)}function a(l){ce(o,r,i,u,a,"throw",l)}u(void 0)})}}function f(){return(f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function Q(e,t){if(e==null)return{};var n,r,i={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(i[n]=e[n]);return i}function Ot(e){var t=function(n,r){if(typeof n!="object"||n===null)return n;var i=n[Symbol.toPrimitive];if(i!==void 0){var o=i.call(n,r||"default");if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(n)}(e,"string");return typeof t=="symbol"?t:String(t)}R=R&&Object.prototype.hasOwnProperty.call(R,"default")?R.default:R;var s={init:"init"},We=function(e){var t=e.value;return t===void 0?"":t},Re=function(){return R.createElement(R.Fragment,null," ")},ue={Cell:We,width:150,minWidth:0,maxWidth:Number.MAX_SAFE_INTEGER};function ze(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.reduce(function(r,i){var o=i.style,u=i.className;return r=f({},r,{},Q(i,["style","className"])),o&&(r.style=r.style?f({},r.style||{},{},o||{}):o),u&&(r.className=r.className?r.className+" "+u:u),r.className===""&&delete r.className,r},{})}var _=function(e,t){return t===void 0&&(t={}),function(n){return n===void 0&&(n={}),[].concat(e,[n]).reduce(function(r,i){return function o(u,a,l){return typeof a=="function"?o({},a(u,l)):Array.isArray(a)?ze.apply(void 0,[u].concat(a)):ze(u,a)}(r,i,f({},t,{userProps:n}))},{})}},$=function(e,t,n,r){return n===void 0&&(n={}),e.reduce(function(i,o){return o(i,n)},t)},ie=function(e,t,n){return n===void 0&&(n={}),e.forEach(function(r){r(t,n)})};function ne(e,t,n,r){e.findIndex(function(i){return i.pluginName===n}),t.forEach(function(i){e.findIndex(function(o){return o.pluginName===i})})}function Z(e,t){return typeof e=="function"?e(t):e}function j(e){var t=R.useRef();return t.current=e,R.useCallback(function(){return t.current},[])}var Te=typeof document<"u"?R.useLayoutEffect:R.useEffect;function U(e,t){var n=R.useRef(!1);Te(function(){n.current&&e(),n.current=!0},t)}function be(e,t,n){return n===void 0&&(n={}),function(r,i){i===void 0&&(i={});var o=typeof r=="string"?t[r]:r;if(o===void 0)throw console.info(t),new Error("Renderer Error ☝️");return Oe(o,f({},e,{column:t},n,{},i))}}function Oe(e,t){return function(r){return typeof r=="function"&&(i=Object.getPrototypeOf(r)).prototype&&i.prototype.isReactComponent;var i}(n=e)||typeof n=="function"||function(r){return typeof r=="object"&&typeof r.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(r.$$typeof.description)}(n)?R.createElement(e,t):e;var n}function Me(e,t,n){return n===void 0&&(n=0),e.map(function(r){return Le(r=f({},r,{parent:t,depth:n})),r.columns&&(r.columns=Me(r.columns,r,n+1)),r})}function je(e){return Ve(e,"columns")}function Le(e){var t=e.id,n=e.accessor,r=e.Header;if(typeof n=="string"){t=t||n;var i=n.split(".");n=function(o){return function(u,a,l){if(!a)return u;var c,m=typeof a=="function"?a:JSON.stringify(a),p=_e.get(m)||function(){var g=function(d){return function v(y,w){if(w===void 0&&(w=[]),Array.isArray(y))for(var C=0;C<y.length;C+=1)v(y[C],w);else w.push(y);return w}(d).map(function(v){return String(v).replace(".","_")}).join(".").replace(jt,".").replace(Lt,"").split(".")}(a);return _e.set(m,g),g}();try{c=p.reduce(function(g,d){return g[d]},u)}catch{}return c!==void 0?c:l}(o,i)}}if(!t&&typeof r=="string"&&r&&(t=r),!t&&e.columns)throw console.error(e),new Error('A column ID (or unique "Header" value) is required!');if(!t)throw console.error(e),new Error("A column ID (or string accessor) is required!");return Object.assign(e,{id:t,accessor:n}),e}function Ne(e,t){if(!t)throw new Error;return Object.assign(e,f({Header:Re,Footer:Re},ue,{},t,{},e)),Object.assign(e,{originalWidth:e.width}),e}function Mt(e,t,n){n===void 0&&(n=function(){return{}});for(var r=[],i=e,o=0,u=function(){return o++},a=function(){var l={headers:[]},c=[],m=i.some(function(p){return p.parent});i.forEach(function(p){var g,d=[].concat(c).reverse()[0];m&&(p.parent?g=f({},p.parent,{originalId:p.parent.id,id:p.parent.id+"_"+u(),headers:[p]},n(p)):g=Ne(f({originalId:p.id+"_placeholder",id:p.id+"_placeholder_"+u(),placeholderOf:p,headers:[p]},n(p)),t),d&&d.originalId===g.originalId?d.headers.push(p):c.push(g)),l.headers.push(p)}),r.push(l),i=c};i.length;)a();return r.reverse()}var _e=new Map;function Y(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=0;r<t.length;r+=1)if(t[r]!==void 0)return t[r]}function De(e){if(typeof e=="function")return e}function Ve(e,t){var n=[];return function r(i){i.forEach(function(o){o[t]?r(o[t]):n.push(o)})}(e),n}function Xe(e,t){var n=t.manualExpandedKey,r=t.expanded,i=t.expandSubRows,o=i===void 0||i,u=[];return e.forEach(function(a){return function l(c,m){m===void 0&&(m=!0),c.isExpanded=c.original&&c.original[n]||r[c.id],c.canExpand=c.subRows&&!!c.subRows.length,m&&u.push(c),c.subRows&&c.subRows.length&&c.isExpanded&&c.subRows.forEach(function(p){return l(p,o)})}(a)}),u}function se(e,t,n){return De(e)||t[e]||n[e]||n.text}function Se(e,t,n){return e?e(t,n):t===void 0}function fe(){throw new Error("React-Table: You have not called prepareRow(row) one or more rows you are attempting to render.")}var Ce=null,jt=/\[/g,Lt=/\]/g,Nt=function(e){return f({role:"table"},e)},_t=function(e){return f({role:"rowgroup"},e)},Dt=function(e,t){var n=t.column;return f({key:"header_"+n.id,colSpan:n.totalVisibleHeaderCount,role:"columnheader"},e)},Vt=function(e,t){var n=t.column;return f({key:"footer_"+n.id,colSpan:n.totalVisibleHeaderCount},e)},Xt=function(e,t){return f({key:"headerGroup_"+t.index,role:"row"},e)},qt=function(e,t){return f({key:"footerGroup_"+t.index},e)},Kt=function(e,t){return f({key:"row_"+t.row.id,role:"row"},e)},$t=function(e,t){var n=t.cell;return f({key:"cell_"+n.row.id+"_"+n.column.id,role:"cell"},e)};function Ut(){return{useOptions:[],stateReducers:[],useControlledState:[],columns:[],columnsDeps:[],allColumns:[],allColumnsDeps:[],accessValue:[],materializedColumns:[],materializedColumnsDeps:[],useInstanceAfterData:[],visibleColumns:[],visibleColumnsDeps:[],headerGroups:[],headerGroupsDeps:[],useInstanceBeforeDimensions:[],useInstance:[],prepareRow:[],getTableProps:[Nt],getTableBodyProps:[_t],getHeaderGroupProps:[Xt],getFooterGroupProps:[qt],getHeaderProps:[Dt],getFooterProps:[Vt],getRowProps:[Kt],getCellProps:[$t],useFinalInstance:[]}}s.resetHiddenColumns="resetHiddenColumns",s.toggleHideColumn="toggleHideColumn",s.setHiddenColumns="setHiddenColumns",s.toggleHideAllColumns="toggleHideAllColumns";var qe=function(e){e.getToggleHiddenProps=[Jt],e.getToggleHideAllColumnsProps=[Yt],e.stateReducers.push(Qt),e.useInstanceBeforeDimensions.push(Zt),e.headerGroupsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.hiddenColumns])}),e.useInstance.push(en)};qe.pluginName="useColumnVisibility";var Jt=function(e,t){var n=t.column;return[e,{onChange:function(r){n.toggleHidden(!r.target.checked)},style:{cursor:"pointer"},checked:n.isVisible,title:"Toggle Column Visible"}]},Yt=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleHideAllColumns(!r.target.checked)},style:{cursor:"pointer"},checked:!n.allColumnsHidden&&!n.state.hiddenColumns.length,title:"Toggle All Columns Hidden",indeterminate:!n.allColumnsHidden&&n.state.hiddenColumns.length}]};function Qt(e,t,n,r){if(t.type===s.init)return f({hiddenColumns:[]},e);if(t.type===s.resetHiddenColumns)return f({},e,{hiddenColumns:r.initialState.hiddenColumns||[]});if(t.type===s.toggleHideColumn){var i=(t.value!==void 0?t.value:!e.hiddenColumns.includes(t.columnId))?[].concat(e.hiddenColumns,[t.columnId]):e.hiddenColumns.filter(function(o){return o!==t.columnId});return f({},e,{hiddenColumns:i})}return t.type===s.setHiddenColumns?f({},e,{hiddenColumns:Z(t.value,e.hiddenColumns)}):t.type===s.toggleHideAllColumns?f({},e,{hiddenColumns:(t.value!==void 0?t.value:!e.hiddenColumns.length)?r.allColumns.map(function(o){return o.id}):[]}):void 0}function Zt(e){var t=e.headers,n=e.state.hiddenColumns;R.useRef(!1).current;var r=0;t.forEach(function(i){return r+=function o(u,a){u.isVisible=a&&!n.includes(u.id);var l=0;return u.headers&&u.headers.length?u.headers.forEach(function(c){return l+=o(c,u.isVisible)}):l=u.isVisible?1:0,u.totalVisibleHeaderCount=l,l}(i,!0)})}function en(e){var t=e.columns,n=e.flatHeaders,r=e.dispatch,i=e.allColumns,o=e.getHooks,u=e.state.hiddenColumns,a=e.autoResetHiddenColumns,l=a===void 0||a,c=j(e),m=i.length===u.length,p=R.useCallback(function(w,C){return r({type:s.toggleHideColumn,columnId:w,value:C})},[r]),g=R.useCallback(function(w){return r({type:s.setHiddenColumns,value:w})},[r]),d=R.useCallback(function(w){return r({type:s.toggleHideAllColumns,value:w})},[r]),v=_(o().getToggleHideAllColumnsProps,{instance:c()});n.forEach(function(w){w.toggleHidden=function(C){r({type:s.toggleHideColumn,columnId:w.id,value:C})},w.getToggleHiddenProps=_(o().getToggleHiddenProps,{instance:c(),column:w})});var y=j(l);U(function(){y()&&r({type:s.resetHiddenColumns})},[r,t]),Object.assign(e,{allColumnsHidden:m,toggleHideColumn:p,setHiddenColumns:g,toggleHideAllColumns:d,getToggleHideAllColumnsProps:v})}var tn={},nn={},rn=function(e,t,n){return e},on=function(e,t){return e.subRows||[]},un=function(e,t,n){return""+(n?[n.id,t].join("."):t)},sn=function(e){return e};function Ke(e){var t=e.initialState,n=t===void 0?tn:t,r=e.defaultColumn,i=r===void 0?nn:r,o=e.getSubRows,u=o===void 0?on:o,a=e.getRowId,l=a===void 0?un:a,c=e.stateReducer,m=c===void 0?rn:c,p=e.useControlledState,g=p===void 0?sn:p;return f({},Q(e,["initialState","defaultColumn","getSubRows","getRowId","stateReducer","useControlledState"]),{initialState:n,defaultColumn:i,getSubRows:u,getRowId:l,stateReducer:m,useControlledState:g})}function $e(e,t){t===void 0&&(t=0);var n=0,r=0,i=0,o=0;return e.forEach(function(u){var a=u.headers;if(u.totalLeft=t,a&&a.length){var l=$e(a,t),c=l[0],m=l[1],p=l[2],g=l[3];u.totalMinWidth=c,u.totalWidth=m,u.totalMaxWidth=p,u.totalFlexWidth=g}else u.totalMinWidth=u.minWidth,u.totalWidth=Math.min(Math.max(u.minWidth,u.width),u.maxWidth),u.totalMaxWidth=u.maxWidth,u.totalFlexWidth=u.canResize?u.totalWidth:0;u.isVisible&&(t+=u.totalWidth,n+=u.totalMinWidth,r+=u.totalWidth,i+=u.totalMaxWidth,o+=u.totalFlexWidth)}),[n,r,i,o]}function an(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.column,u=e.getRowId,a=e.getSubRows,l=e.accessValueHooks,c=e.getInstance;t.forEach(function(m,p){return function g(d,v,y,w,C){y===void 0&&(y=0);var A=d,S=u(d,v,w),h=i[S];if(h)h.subRows&&h.originalSubRows.forEach(function(b,I){return g(b,I,y+1,h)});else if((h={id:S,original:A,index:v,depth:y,cells:[{}]}).cells.map=fe,h.cells.filter=fe,h.cells.forEach=fe,h.cells[0].getCellProps=fe,h.values={},C.push(h),r.push(h),i[S]=h,h.originalSubRows=a(d,v),h.originalSubRows){var G=[];h.originalSubRows.forEach(function(b,I){return g(b,I,y+1,h,G)}),h.subRows=G}o.accessor&&(h.values[o.id]=o.accessor(d,v,h,C,t)),h.values[o.id]=$(l,h.values[o.id],{row:h,column:o,instance:c()})}(m,p,0,void 0,n)})}s.resetExpanded="resetExpanded",s.toggleRowExpanded="toggleRowExpanded",s.toggleAllRowsExpanded="toggleAllRowsExpanded";var Ue=function(e){e.getToggleAllRowsExpandedProps=[ln],e.getToggleRowExpandedProps=[cn],e.stateReducers.push(dn),e.useInstance.push(fn),e.prepareRow.push(pn)};Ue.pluginName="useExpanded";var ln=function(e,t){var n=t.instance;return[e,{onClick:function(r){n.toggleAllRowsExpanded()},style:{cursor:"pointer"},title:"Toggle All Rows Expanded"}]},cn=function(e,t){var n=t.row;return[e,{onClick:function(){n.toggleRowExpanded()},style:{cursor:"pointer"},title:"Toggle Row Expanded"}]};function dn(e,t,n,r){if(t.type===s.init)return f({expanded:{}},e);if(t.type===s.resetExpanded)return f({},e,{expanded:r.initialState.expanded||{}});if(t.type===s.toggleAllRowsExpanded){var i=t.value,o=r.rowsById,u=Object.keys(o).length===Object.keys(e.expanded).length;if(i!==void 0?i:!u){var a={};return Object.keys(o).forEach(function(v){a[v]=!0}),f({},e,{expanded:a})}return f({},e,{expanded:{}})}if(t.type===s.toggleRowExpanded){var l,c=t.id,m=t.value,p=e.expanded[c],g=m!==void 0?m:!p;if(!p&&g)return f({},e,{expanded:f({},e.expanded,(l={},l[c]=!0,l))});if(p&&!g){var d=e.expanded;return d[c],f({},e,{expanded:Q(d,[c].map(Ot))})}return e}}function fn(e){var t=e.data,n=e.rows,r=e.rowsById,i=e.manualExpandedKey,o=i===void 0?"expanded":i,u=e.paginateExpandedRows,a=u===void 0||u,l=e.expandSubRows,c=l===void 0||l,m=e.autoResetExpanded,p=m===void 0||m,g=e.getHooks,d=e.plugins,v=e.state.expanded,y=e.dispatch;ne(d,["useSortBy","useGroupBy","usePivotColumns","useGlobalFilter"],"useExpanded");var w=j(p),C=!!(Object.keys(r).length&&Object.keys(v).length);C&&Object.keys(r).some(function(k){return!v[k]})&&(C=!1),U(function(){w()&&y({type:s.resetExpanded})},[y,t]);var A=R.useCallback(function(k,P){y({type:s.toggleRowExpanded,id:k,value:P})},[y]),S=R.useCallback(function(k){return y({type:s.toggleAllRowsExpanded,value:k})},[y]),h=R.useMemo(function(){return a?Xe(n,{manualExpandedKey:o,expanded:v,expandSubRows:c}):n},[a,n,o,v,c]),G=R.useMemo(function(){return function(k){var P=0;return Object.keys(k).forEach(function(E){var O=E.split(".");P=Math.max(P,O.length)}),P}(v)},[v]),b=j(e),I=_(g().getToggleAllRowsExpandedProps,{instance:b()});Object.assign(e,{preExpandedRows:n,expandedRows:h,rows:h,expandedDepth:G,isAllRowsExpanded:C,toggleRowExpanded:A,toggleAllRowsExpanded:S,getToggleAllRowsExpandedProps:I})}function pn(e,t){var n=t.instance.getHooks,r=t.instance;e.toggleRowExpanded=function(i){return r.toggleRowExpanded(e.id,i)},e.getToggleRowExpandedProps=_(n().getToggleRowExpandedProps,{instance:r,row:e})}var Je=function(e,t,n){return e=e.filter(function(r){return t.some(function(i){var o=r.values[i];return String(o).toLowerCase().includes(String(n).toLowerCase())})})};Je.autoRemove=function(e){return!e};var Ye=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o===void 0||String(o).toLowerCase()===String(n).toLowerCase()})})};Ye.autoRemove=function(e){return!e};var Qe=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o===void 0||String(o)===String(n)})})};Qe.autoRemove=function(e){return!e};var Ze=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i].includes(n)})})};Ze.autoRemove=function(e){return!e||!e.length};var et=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o&&o.length&&n.every(function(u){return o.includes(u)})})})};et.autoRemove=function(e){return!e||!e.length};var tt=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return o&&o.length&&n.some(function(u){return o.includes(u)})})})};tt.autoRemove=function(e){return!e||!e.length};var nt=function(e,t,n){return e.filter(function(r){return t.some(function(i){var o=r.values[i];return n.includes(o)})})};nt.autoRemove=function(e){return!e||!e.length};var rt=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i]===n})})};rt.autoRemove=function(e){return e===void 0};var ot=function(e,t,n){return e.filter(function(r){return t.some(function(i){return r.values[i]==n})})};ot.autoRemove=function(e){return e==null};var it=function(e,t,n){var r=n||[],i=r[0],o=r[1];if((i=typeof i=="number"?i:-1/0)>(o=typeof o=="number"?o:1/0)){var u=i;i=o,o=u}return e.filter(function(a){return t.some(function(l){var c=a.values[l];return c>=i&&c<=o})})};it.autoRemove=function(e){return!e||typeof e[0]!="number"&&typeof e[1]!="number"};var ae=Object.freeze({__proto__:null,text:Je,exactText:Ye,exactTextCase:Qe,includes:Ze,includesAll:et,includesSome:tt,includesValue:nt,exact:rt,equals:ot,between:it});s.resetFilters="resetFilters",s.setFilter="setFilter",s.setAllFilters="setAllFilters";var ut=function(e){e.stateReducers.push(gn),e.useInstance.push(vn)};function gn(e,t,n,r){if(t.type===s.init)return f({filters:[]},e);if(t.type===s.resetFilters)return f({},e,{filters:r.initialState.filters||[]});if(t.type===s.setFilter){var i=t.columnId,o=t.filterValue,u=r.allColumns,a=r.filterTypes,l=u.find(function(y){return y.id===i});if(!l)throw new Error("React-Table: Could not find a column with id: "+i);var c=se(l.filter,a||{},ae),m=e.filters.find(function(y){return y.id===i}),p=Z(o,m&&m.value);return Se(c.autoRemove,p,l)?f({},e,{filters:e.filters.filter(function(y){return y.id!==i})}):f({},e,m?{filters:e.filters.map(function(y){return y.id===i?{id:i,value:p}:y})}:{filters:[].concat(e.filters,[{id:i,value:p}])})}if(t.type===s.setAllFilters){var g=t.filters,d=r.allColumns,v=r.filterTypes;return f({},e,{filters:Z(g,e.filters).filter(function(y){var w=d.find(function(C){return C.id===y.id});return!Se(se(w.filter,v||{},ae).autoRemove,y.value,w)})})}}function vn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.manualFilters,l=e.defaultCanFilter,c=l!==void 0&&l,m=e.disableFilters,p=e.state.filters,g=e.dispatch,d=e.autoResetFilters,v=d===void 0||d,y=R.useCallback(function(b,I){g({type:s.setFilter,columnId:b,filterValue:I})},[g]),w=R.useCallback(function(b){g({type:s.setAllFilters,filters:b})},[g]);o.forEach(function(b){var I=b.id,k=b.accessor,P=b.defaultCanFilter,E=b.disableFilters;b.canFilter=k?Y(E!==!0&&void 0,m!==!0&&void 0,!0):Y(P,c,!1),b.setFilter=function(F){return y(b.id,F)};var O=p.find(function(F){return F.id===I});b.filterValue=O&&O.value});var C=R.useMemo(function(){if(a||!p.length)return[n,r,i];var b=[],I={};return[function k(P,E){E===void 0&&(E=0);var O=P;return(O=p.reduce(function(F,T){var z=T.id,M=T.value,x=o.find(function(N){return N.id===z});if(!x)return F;E===0&&(x.preFilteredRows=F);var W=se(x.filter,u||{},ae);return W?(x.filteredRows=W(F,[z],M),x.filteredRows):(console.warn("Could not find a valid 'column.filter' for column with the ID: "+x.id+"."),F)},P)).forEach(function(F){b.push(F),I[F.id]=F,F.subRows&&(F.subRows=F.subRows&&F.subRows.length>0?k(F.subRows,E+1):F.subRows)}),O}(n),b,I]},[a,p,n,r,i,o,u]),A=C[0],S=C[1],h=C[2];R.useMemo(function(){o.filter(function(b){return!p.find(function(I){return I.id===b.id})}).forEach(function(b){b.preFilteredRows=A,b.filteredRows=A})},[A,p,o]);var G=j(v);U(function(){G()&&g({type:s.resetFilters})},[g,a?null:t]),Object.assign(e,{preFilteredRows:n,preFilteredFlatRows:r,preFilteredRowsById:i,filteredRows:A,filteredFlatRows:S,filteredRowsById:h,rows:A,flatRows:S,rowsById:h,setFilter:y,setAllFilters:w})}ut.pluginName="useFilters",s.resetGlobalFilter="resetGlobalFilter",s.setGlobalFilter="setGlobalFilter";var st=function(e){e.stateReducers.push(mn),e.useInstance.push(hn)};function mn(e,t,n,r){if(t.type===s.resetGlobalFilter)return f({},e,{globalFilter:r.initialState.globalFilter||void 0});if(t.type===s.setGlobalFilter){var i=t.filterValue,o=r.userFilterTypes,u=se(r.globalFilter,o||{},ae),a=Z(i,e.globalFilter);return Se(u.autoRemove,a)?(e.globalFilter,Q(e,["globalFilter"])):f({},e,{globalFilter:a})}}function hn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.filterTypes,a=e.globalFilter,l=e.manualGlobalFilter,c=e.state.globalFilter,m=e.dispatch,p=e.autoResetGlobalFilter,g=p===void 0||p,d=e.disableGlobalFilter,v=R.useCallback(function(h){m({type:s.setGlobalFilter,filterValue:h})},[m]),y=R.useMemo(function(){if(l||c===void 0)return[n,r,i];var h=[],G={},b=se(a,u||{},ae);if(!b)return console.warn("Could not find a valid 'globalFilter' option."),n;o.forEach(function(k){var P=k.disableGlobalFilter;k.canFilter=Y(P!==!0&&void 0,d!==!0&&void 0,!0)});var I=o.filter(function(k){return k.canFilter===!0});return[function k(P){return(P=b(P,I.map(function(E){return E.id}),c)).forEach(function(E){h.push(E),G[E.id]=E,E.subRows=E.subRows&&E.subRows.length?k(E.subRows):E.subRows}),P}(n),h,G]},[l,c,a,u,o,n,r,i,d]),w=y[0],C=y[1],A=y[2],S=j(g);U(function(){S()&&m({type:s.resetGlobalFilter})},[m,l?null:t]),Object.assign(e,{preGlobalFilteredRows:n,preGlobalFilteredFlatRows:r,preGlobalFilteredRowsById:i,globalFilteredRows:w,globalFilteredFlatRows:C,globalFilteredRowsById:A,rows:w,flatRows:C,rowsById:A,setGlobalFilter:v,disableGlobalFilter:d})}function at(e,t){return t.reduce(function(n,r){return n+(typeof r=="number"?r:0)},0)}st.pluginName="useGlobalFilter";var lt=Object.freeze({__proto__:null,sum:at,min:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.min(t,n))}),t},max:function(e){var t=e[0]||0;return e.forEach(function(n){typeof n=="number"&&(t=Math.max(t,n))}),t},minMax:function(e){var t=e[0]||0,n=e[0]||0;return e.forEach(function(r){typeof r=="number"&&(t=Math.min(t,r),n=Math.max(n,r))}),t+".."+n},average:function(e){return at(0,e)/e.length},median:function(e){if(!e.length)return null;var t=Math.floor(e.length/2),n=[].concat(e).sort(function(r,i){return r-i});return e.length%2!=0?n[t]:(n[t-1]+n[t])/2},unique:function(e){return Array.from(new Set(e).values())},uniqueCount:function(e){return new Set(e).size},count:function(e){return e.length}}),yn=[],wn={};s.resetGroupBy="resetGroupBy",s.setGroupBy="setGroupBy",s.toggleGroupBy="toggleGroupBy";var ct=function(e){e.getGroupByToggleProps=[Rn],e.stateReducers.push(bn),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.groupBy])}),e.visibleColumns.push(Sn),e.useInstance.push(xn),e.prepareRow.push(Pn)};ct.pluginName="useGroupBy";var Rn=function(e,t){var n=t.header;return[e,{onClick:n.canGroupBy?function(r){r.persist(),n.toggleGroupBy()}:void 0,style:{cursor:n.canGroupBy?"pointer":void 0},title:"Toggle GroupBy"}]};function bn(e,t,n,r){if(t.type===s.init)return f({groupBy:[]},e);if(t.type===s.resetGroupBy)return f({},e,{groupBy:r.initialState.groupBy||[]});if(t.type===s.setGroupBy)return f({},e,{groupBy:t.value});if(t.type===s.toggleGroupBy){var i=t.columnId,o=t.value,u=o!==void 0?o:!e.groupBy.includes(i);return f({},e,u?{groupBy:[].concat(e.groupBy,[i])}:{groupBy:e.groupBy.filter(function(a){return a!==i})})}}function Sn(e,t){var n=t.instance.state.groupBy,r=n.map(function(o){return e.find(function(u){return u.id===o})}).filter(Boolean),i=e.filter(function(o){return!n.includes(o.id)});return(e=[].concat(r,i)).forEach(function(o){o.isGrouped=n.includes(o.id),o.groupedIndex=n.indexOf(o.id)}),e}var Cn={};function xn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.rowsById,o=e.allColumns,u=e.flatHeaders,a=e.groupByFn,l=a===void 0?dt:a,c=e.manualGroupBy,m=e.aggregations,p=m===void 0?Cn:m,g=e.plugins,d=e.state.groupBy,v=e.dispatch,y=e.autoResetGroupBy,w=y===void 0||y,C=e.disableGroupBy,A=e.defaultCanGroupBy,S=e.getHooks;ne(g,["useColumnOrder","useFilters"],"useGroupBy");var h=j(e);o.forEach(function(x){var W=x.accessor,N=x.defaultGroupBy,q=x.disableGroupBy;x.canGroupBy=W?Y(x.canGroupBy,q!==!0&&void 0,C!==!0&&void 0,!0):Y(x.canGroupBy,N,A,!1),x.canGroupBy&&(x.toggleGroupBy=function(){return e.toggleGroupBy(x.id)}),x.Aggregated=x.Aggregated||x.Cell});var G=R.useCallback(function(x,W){v({type:s.toggleGroupBy,columnId:x,value:W})},[v]),b=R.useCallback(function(x){v({type:s.setGroupBy,value:x})},[v]);u.forEach(function(x){x.getGroupByToggleProps=_(S().getGroupByToggleProps,{instance:h(),header:x})});var I=R.useMemo(function(){if(c||!d.length)return[n,r,i,yn,wn,r,i];var x=d.filter(function(X){return o.find(function(re){return re.id===X})}),W=[],N={},q=[],B={},L=[],D={},K=function X(re,ee,Ft){if(ee===void 0&&(ee=0),ee===x.length)return re.map(function(ge){return f({},ge,{depth:ee})});var Ge=x[ee],pr=l(re,Ge);return Object.entries(pr).map(function(ge,gr){var Gt=ge[0],ve=ge[1],me=Ge+":"+Gt,At=X(ve,ee+1,me=Ft?Ft+">"+me:me),kt=ee?Ve(ve,"leafRows"):ve,vr=function(J,Ae,hr){var he={};return o.forEach(function(V){if(x.includes(V.id))he[V.id]=Ae[0]?Ae[0].values[V.id]:null;else{var Ht=typeof V.aggregate=="function"?V.aggregate:p[V.aggregate]||lt[V.aggregate];if(Ht){var yr=Ae.map(function(ye){return ye.values[V.id]}),wr=J.map(function(ye){var ke=ye.values[V.id];if(!hr&&V.aggregateValue){var Wt=typeof V.aggregateValue=="function"?V.aggregateValue:p[V.aggregateValue]||lt[V.aggregateValue];if(!Wt)throw console.info({column:V}),new Error("React Table: Invalid column.aggregateValue option for column listed above");ke=Wt(ke,ye,V)}return ke});he[V.id]=Ht(wr,yr)}else{if(V.aggregate)throw console.info({column:V}),new Error("React Table: Invalid column.aggregate option for column listed above");he[V.id]=null}}}),he}(kt,ve,ee),mr={id:me,isGrouped:!0,groupByID:Ge,groupByVal:Gt,values:vr,subRows:At,leafRows:kt,depth:ee,index:gr};return At.forEach(function(J){W.push(J),N[J.id]=J,J.isGrouped?(q.push(J),B[J.id]=J):(L.push(J),D[J.id]=J)}),mr})}(n);return K.forEach(function(X){W.push(X),N[X.id]=X,X.isGrouped?(q.push(X),B[X.id]=X):(L.push(X),D[X.id]=X)}),[K,W,N,q,B,L,D]},[c,d,n,r,i,o,p,l]),k=I[0],P=I[1],E=I[2],O=I[3],F=I[4],T=I[5],z=I[6],M=j(w);U(function(){M()&&v({type:s.resetGroupBy})},[v,c?null:t]),Object.assign(e,{preGroupedRows:n,preGroupedFlatRow:r,preGroupedRowsById:i,groupedRows:k,groupedFlatRows:P,groupedRowsById:E,onlyGroupedFlatRows:O,onlyGroupedRowsById:F,nonGroupedFlatRows:T,nonGroupedRowsById:z,rows:k,flatRows:P,rowsById:E,toggleGroupBy:G,setGroupBy:b})}function Pn(e){e.allCells.forEach(function(t){var n;t.isGrouped=t.column.isGrouped&&t.column.id===e.groupByID,t.isPlaceholder=!t.isGrouped&&t.column.isGrouped,t.isAggregated=!t.isGrouped&&!t.isPlaceholder&&((n=e.subRows)==null?void 0:n.length)})}function dt(e,t){return e.reduce(function(n,r,i){var o=""+r.values[t];return n[o]=Array.isArray(n[o])?n[o]:[],n[o].push(r),n},{})}var ft=/([0-9]+)/gm;function xe(e,t){return e===t?0:e>t?1:-1}function le(e,t,n){return[e.values[n],t.values[n]]}function pt(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}var Bn=Object.freeze({__proto__:null,alphanumeric:function(e,t,n){var r=le(e,t,n),i=r[0],o=r[1];for(i=pt(i),o=pt(o),i=i.split(ft).filter(Boolean),o=o.split(ft).filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=parseInt(u,10),c=parseInt(a,10),m=[l,c].sort();if(isNaN(m[0])){if(u>a)return 1;if(a>u)return-1}else{if(isNaN(m[1]))return isNaN(l)?-1:1;if(l>c)return 1;if(c>l)return-1}}return i.length-o.length},datetime:function(e,t,n){var r=le(e,t,n),i=r[0],o=r[1];return xe(i=i.getTime(),o=o.getTime())},basic:function(e,t,n){var r=le(e,t,n);return xe(r[0],r[1])},string:function(e,t,n){var r=le(e,t,n),i=r[0],o=r[1];for(i=i.split("").filter(Boolean),o=o.split("").filter(Boolean);i.length&&o.length;){var u=i.shift(),a=o.shift(),l=u.toLowerCase(),c=a.toLowerCase();if(l>c)return 1;if(c>l)return-1;if(u>a)return 1;if(a>u)return-1}return i.length-o.length},number:function(e,t,n){var r=le(e,t,n),i=r[0],o=r[1],u=/[^0-9.]/gi;return xe(i=Number(String(i).replace(u,"")),o=Number(String(o).replace(u,"")))}});s.resetSortBy="resetSortBy",s.setSortBy="setSortBy",s.toggleSortBy="toggleSortBy",s.clearSortBy="clearSortBy",ue.sortType="alphanumeric",ue.sortDescFirst=!1;var gt=function(e){e.getSortByToggleProps=[En],e.stateReducers.push(In),e.useInstance.push(Fn)};gt.pluginName="useSortBy";var En=function(e,t){var n=t.instance,r=t.column,i=n.isMultiSortEvent,o=i===void 0?function(u){return u.shiftKey}:i;return[e,{onClick:r.canSort?function(u){u.persist(),r.toggleSortBy(void 0,!n.disableMultiSort&&o(u))}:void 0,style:{cursor:r.canSort?"pointer":void 0},title:r.canSort?"Toggle SortBy":void 0}]};function In(e,t,n,r){if(t.type===s.init)return f({sortBy:[]},e);if(t.type===s.resetSortBy)return f({},e,{sortBy:r.initialState.sortBy||[]});if(t.type===s.clearSortBy)return f({},e,{sortBy:e.sortBy.filter(function(h){return h.id!==t.columnId})});if(t.type===s.setSortBy)return f({},e,{sortBy:t.sortBy});if(t.type===s.toggleSortBy){var i,o=t.columnId,u=t.desc,a=t.multi,l=r.allColumns,c=r.disableMultiSort,m=r.disableSortRemove,p=r.disableMultiRemove,g=r.maxMultiSortColCount,d=g===void 0?Number.MAX_SAFE_INTEGER:g,v=e.sortBy,y=l.find(function(h){return h.id===o}).sortDescFirst,w=v.find(function(h){return h.id===o}),C=v.findIndex(function(h){return h.id===o}),A=u!=null,S=[];return(i=!c&&a?w?"toggle":"add":C!==v.length-1||v.length!==1?"replace":w?"toggle":"replace")!="toggle"||m||A||a&&p||!(w&&w.desc&&!y||!w.desc&&y)||(i="remove"),i==="replace"?S=[{id:o,desc:A?u:y}]:i==="add"?(S=[].concat(v,[{id:o,desc:A?u:y}])).splice(0,S.length-d):i==="toggle"?S=v.map(function(h){return h.id===o?f({},h,{desc:A?u:!w.desc}):h}):i==="remove"&&(S=v.filter(function(h){return h.id!==o})),f({},e,{sortBy:S})}}function Fn(e){var t=e.data,n=e.rows,r=e.flatRows,i=e.allColumns,o=e.orderByFn,u=o===void 0?vt:o,a=e.sortTypes,l=e.manualSortBy,c=e.defaultCanSort,m=e.disableSortBy,p=e.flatHeaders,g=e.state.sortBy,d=e.dispatch,v=e.plugins,y=e.getHooks,w=e.autoResetSortBy,C=w===void 0||w;ne(v,["useFilters","useGlobalFilter","useGroupBy","usePivotColumns"],"useSortBy");var A=R.useCallback(function(P){d({type:s.setSortBy,sortBy:P})},[d]),S=R.useCallback(function(P,E,O){d({type:s.toggleSortBy,columnId:P,desc:E,multi:O})},[d]),h=j(e);p.forEach(function(P){var E=P.accessor,O=P.canSort,F=P.disableSortBy,T=P.id,z=E?Y(F!==!0&&void 0,m!==!0&&void 0,!0):Y(c,O,!1);P.canSort=z,P.canSort&&(P.toggleSortBy=function(x,W){return S(P.id,x,W)},P.clearSortBy=function(){d({type:s.clearSortBy,columnId:P.id})}),P.getSortByToggleProps=_(y().getSortByToggleProps,{instance:h(),column:P});var M=g.find(function(x){return x.id===T});P.isSorted=!!M,P.sortedIndex=g.findIndex(function(x){return x.id===T}),P.isSortedDesc=P.isSorted?M.desc:void 0});var G=R.useMemo(function(){if(l||!g.length)return[n,r];var P=[],E=g.filter(function(O){return i.find(function(F){return F.id===O.id})});return[function O(F){var T=u(F,E.map(function(z){var M=i.find(function(N){return N.id===z.id});if(!M)throw new Error("React-Table: Could not find a column with id: "+z.id+" while sorting");var x=M.sortType,W=De(x)||(a||{})[x]||Bn[x];if(!W)throw new Error("React-Table: Could not find a valid sortType of '"+x+"' for column '"+z.id+"'.");return function(N,q){return W(N,q,z.id,z.desc)}}),E.map(function(z){var M=i.find(function(x){return x.id===z.id});return M&&M.sortInverted?z.desc:!z.desc}));return T.forEach(function(z){P.push(z),z.subRows&&z.subRows.length!==0&&(z.subRows=O(z.subRows))}),T}(n),P]},[l,g,n,r,i,u,a]),b=G[0],I=G[1],k=j(C);U(function(){k()&&d({type:s.resetSortBy})},[l?null:t]),Object.assign(e,{preSortedRows:n,preSortedFlatRows:r,sortedRows:b,sortedFlatRows:I,rows:b,flatRows:I,setSortBy:A,toggleSortBy:S})}function vt(e,t,n){return[].concat(e).sort(function(r,i){for(var o=0;o<t.length;o+=1){var u=t[o],a=n[o]===!1||n[o]==="desc",l=u(r,i);if(l!==0)return a?-l:l}return n[0]?r.index-i.index:i.index-r.index})}s.resetPage="resetPage",s.gotoPage="gotoPage",s.setPageSize="setPageSize";var mt=function(e){e.stateReducers.push(Gn),e.useInstance.push(An)};function Gn(e,t,n,r){if(t.type===s.init)return f({pageSize:10,pageIndex:0},e);if(t.type===s.resetPage)return f({},e,{pageIndex:r.initialState.pageIndex||0});if(t.type===s.gotoPage){var i=r.pageCount,o=r.page,u=Z(t.pageIndex,e.pageIndex),a=!1;return u>e.pageIndex?a=i===-1?o.length>=e.pageSize:u<i:u<e.pageIndex&&(a=u>-1),a?f({},e,{pageIndex:u}):e}if(t.type===s.setPageSize){var l=t.pageSize,c=e.pageSize*e.pageIndex;return f({},e,{pageIndex:Math.floor(c/l),pageSize:l})}}function An(e){var t=e.rows,n=e.autoResetPage,r=n===void 0||n,i=e.manualExpandedKey,o=i===void 0?"expanded":i,u=e.plugins,a=e.pageCount,l=e.paginateExpandedRows,c=l===void 0||l,m=e.expandSubRows,p=m===void 0||m,g=e.state,d=g.pageSize,v=g.pageIndex,y=g.expanded,w=g.globalFilter,C=g.filters,A=g.groupBy,S=g.sortBy,h=e.dispatch,G=e.data,b=e.manualPagination;ne(u,["useGlobalFilter","useFilters","useGroupBy","useSortBy","useExpanded"],"usePagination");var I=j(r);U(function(){I()&&h({type:s.resetPage})},[h,b?null:G,w,C,A,S]);var k=b?a:Math.ceil(t.length/d),P=R.useMemo(function(){return k>0?[].concat(new Array(k)).fill(null).map(function(W,N){return N}):[]},[k]),E=R.useMemo(function(){var W;if(b)W=t;else{var N=d*v,q=N+d;W=t.slice(N,q)}return c?W:Xe(W,{manualExpandedKey:o,expanded:y,expandSubRows:p})},[p,y,o,b,v,d,c,t]),O=v>0,F=k===-1?E.length>=d:v<k-1,T=R.useCallback(function(W){h({type:s.gotoPage,pageIndex:W})},[h]),z=R.useCallback(function(){return T(function(W){return W-1})},[T]),M=R.useCallback(function(){return T(function(W){return W+1})},[T]),x=R.useCallback(function(W){h({type:s.setPageSize,pageSize:W})},[h]);Object.assign(e,{pageOptions:P,pageCount:k,page:E,canPreviousPage:O,canNextPage:F,gotoPage:T,previousPage:z,nextPage:M,setPageSize:x})}mt.pluginName="usePagination",s.resetPivot="resetPivot",s.togglePivot="togglePivot";var ht=function(e){e.getPivotToggleProps=[kn],e.stateReducers.push(Hn),e.useInstanceAfterData.push(Wn),e.allColumns.push(zn),e.accessValue.push(Tn),e.materializedColumns.push(On),e.materializedColumnsDeps.push(Mn),e.visibleColumns.push(jn),e.visibleColumnsDeps.push(Ln),e.useInstance.push(Nn),e.prepareRow.push(_n)};ht.pluginName="usePivotColumns";var yt=[],kn=function(e,t){var n=t.header;return[e,{onClick:n.canPivot?function(r){r.persist(),n.togglePivot()}:void 0,style:{cursor:n.canPivot?"pointer":void 0},title:"Toggle Pivot"}]};function Hn(e,t,n,r){if(t.type===s.init)return f({pivotColumns:yt},e);if(t.type===s.resetPivot)return f({},e,{pivotColumns:r.initialState.pivotColumns||yt});if(t.type===s.togglePivot){var i=t.columnId,o=t.value,u=o!==void 0?o:!e.pivotColumns.includes(i);return f({},e,u?{pivotColumns:[].concat(e.pivotColumns,[i])}:{pivotColumns:e.pivotColumns.filter(function(a){return a!==i})})}}function Wn(e){e.allColumns.forEach(function(t){t.isPivotSource=e.state.pivotColumns.includes(t.id)})}function zn(e,t){var n=t.instance;return e.forEach(function(r){r.isPivotSource=n.state.pivotColumns.includes(r.id),r.uniqueValues=new Set}),e}function Tn(e,t){var n=t.column;return n.uniqueValues&&e!==void 0&&n.uniqueValues.add(e),e}function On(e,t){var n=t.instance,r=n.allColumns,i=n.state;if(!i.pivotColumns.length||!i.groupBy||!i.groupBy.length)return e;var o=i.pivotColumns.map(function(l){return r.find(function(c){return c.id===l})}).filter(Boolean),u=r.filter(function(l){return!l.isPivotSource&&!i.groupBy.includes(l.id)&&!i.pivotColumns.includes(l.id)}),a=je(function l(c,m,p){c===void 0&&(c=0),p===void 0&&(p=[]);var g=o[c];return g?Array.from(g.uniqueValues).sort().map(function(d){var v=f({},g,{Header:g.PivotHeader||typeof g.header=="string"?g.Header+": "+d:d,isPivotGroup:!0,parent:m,depth:c,id:m?m.id+"."+g.id+"."+d:g.id+"."+d,pivotValue:d});return v.columns=l(c+1,v,[].concat(p,[function(y){return y.values[g.id]===d}])),v}):u.map(function(d){return f({},d,{canPivot:!1,isPivoted:!0,parent:m,depth:c,id:""+(m?m.id+"."+d.id:d.id),accessor:function(v,y,w){if(p.every(function(C){return C(w)}))return w.values[d.id]}})})}());return[].concat(e,a)}function Mn(e,t){var n=t.instance.state,r=n.pivotColumns,i=n.groupBy;return[].concat(e,[r,i])}function jn(e,t){var n=t.instance.state;return e=e.filter(function(r){return!r.isPivotSource}),n.pivotColumns.length&&n.groupBy&&n.groupBy.length&&(e=e.filter(function(r){return r.isGrouped||r.isPivoted})),e}function Ln(e,t){var n=t.instance;return[].concat(e,[n.state.pivotColumns,n.state.groupBy])}function Nn(e){var t=e.columns,n=e.allColumns,r=e.flatHeaders,i=e.getHooks,o=e.plugins,u=e.dispatch,a=e.autoResetPivot,l=a===void 0||a,c=e.manaulPivot,m=e.disablePivot,p=e.defaultCanPivot;ne(o,["useGroupBy"],"usePivotColumns");var g=j(e);n.forEach(function(v){var y=v.accessor,w=v.defaultPivot,C=v.disablePivot;v.canPivot=y?Y(v.canPivot,C!==!0&&void 0,m!==!0&&void 0,!0):Y(v.canPivot,w,p,!1),v.canPivot&&(v.togglePivot=function(){return e.togglePivot(v.id)}),v.Aggregated=v.Aggregated||v.Cell}),r.forEach(function(v){v.getPivotToggleProps=_(i().getPivotToggleProps,{instance:g(),header:v})});var d=j(l);U(function(){d()&&u({type:s.resetPivot})},[u,c?null:t]),Object.assign(e,{togglePivot:function(v,y){u({type:s.togglePivot,columnId:v,value:y})}})}function _n(e){e.allCells.forEach(function(t){t.isPivoted=t.column.isPivoted})}s.resetSelectedRows="resetSelectedRows",s.toggleAllRowsSelected="toggleAllRowsSelected",s.toggleRowSelected="toggleRowSelected",s.toggleAllPageRowsSelected="toggleAllPageRowsSelected";var wt=function(e){e.getToggleRowSelectedProps=[Dn],e.getToggleAllRowsSelectedProps=[Vn],e.getToggleAllPageRowsSelectedProps=[Xn],e.stateReducers.push(qn),e.useInstance.push(Kn),e.prepareRow.push($n)};wt.pluginName="useRowSelect";var Dn=function(e,t){var n=t.instance,r=t.row,i=n.manualRowSelectedKey,o=i===void 0?"isSelected":i;return[e,{onChange:function(u){r.toggleRowSelected(u.target.checked)},style:{cursor:"pointer"},checked:!(!r.original||!r.original[o])||r.isSelected,title:"Toggle Row Selected",indeterminate:r.isSomeSelected}]},Vn=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllRowsSelected,title:"Toggle All Rows Selected",indeterminate:!!(!n.isAllRowsSelected&&Object.keys(n.state.selectedRowIds).length)}]},Xn=function(e,t){var n=t.instance;return[e,{onChange:function(r){n.toggleAllPageRowsSelected(r.target.checked)},style:{cursor:"pointer"},checked:n.isAllPageRowsSelected,title:"Toggle All Current Page Rows Selected",indeterminate:!!(!n.isAllPageRowsSelected&&n.page.some(function(r){var i=r.id;return n.state.selectedRowIds[i]}))}]};function qn(e,t,n,r){if(t.type===s.init)return f({selectedRowIds:{}},e);if(t.type===s.resetSelectedRows)return f({},e,{selectedRowIds:r.initialState.selectedRowIds||{}});if(t.type===s.toggleAllRowsSelected){var i=t.value,o=r.isAllRowsSelected,u=r.rowsById,a=r.nonGroupedRowsById,l=a===void 0?u:a,c=i!==void 0?i:!o,m=Object.assign({},e.selectedRowIds);return c?Object.keys(l).forEach(function(T){m[T]=!0}):Object.keys(l).forEach(function(T){delete m[T]}),f({},e,{selectedRowIds:m})}if(t.type===s.toggleRowSelected){var p=t.id,g=t.value,d=r.rowsById,v=r.selectSubRows,y=v===void 0||v,w=r.getSubRows,C=e.selectedRowIds[p],A=g!==void 0?g:!C;if(C===A)return e;var S=f({},e.selectedRowIds);return function T(z){var M=d[z];if(M&&(M.isGrouped||(A?S[z]=!0:delete S[z]),y&&w(M)))return w(M).forEach(function(x){return T(x.id)})}(p),f({},e,{selectedRowIds:S})}if(t.type===s.toggleAllPageRowsSelected){var h=t.value,G=r.page,b=r.rowsById,I=r.selectSubRows,k=I===void 0||I,P=r.isAllPageRowsSelected,E=r.getSubRows,O=h!==void 0?h:!P,F=f({},e.selectedRowIds);return G.forEach(function(T){return function z(M){var x=b[M];if(x.isGrouped||(O?F[M]=!0:delete F[M]),k&&E(x))return E(x).forEach(function(W){return z(W.id)})}(T.id)}),f({},e,{selectedRowIds:F})}return e}function Kn(e){var t=e.data,n=e.rows,r=e.getHooks,i=e.plugins,o=e.rowsById,u=e.nonGroupedRowsById,a=u===void 0?o:u,l=e.autoResetSelectedRows,c=l===void 0||l,m=e.state.selectedRowIds,p=e.selectSubRows,g=p===void 0||p,d=e.dispatch,v=e.page,y=e.getSubRows;ne(i,["useFilters","useGroupBy","useSortBy","useExpanded","usePagination"],"useRowSelect");var w=R.useMemo(function(){var E=[];return n.forEach(function(O){var F=g?function T(z,M,x){if(M[z.id])return!0;var W=x(z);if(W&&W.length){var N=!0,q=!1;return W.forEach(function(B){q&&!N||(T(B,M,x)?q=!0:N=!1)}),!!N||!!q&&null}return!1}(O,m,y):!!m[O.id];O.isSelected=!!F,O.isSomeSelected=F===null,F&&E.push(O)}),E},[n,g,m,y]),C=!!(Object.keys(a).length&&Object.keys(m).length),A=C;C&&Object.keys(a).some(function(E){return!m[E]})&&(C=!1),C||v&&v.length&&v.some(function(E){var O=E.id;return!m[O]})&&(A=!1);var S=j(c);U(function(){S()&&d({type:s.resetSelectedRows})},[d,t]);var h=R.useCallback(function(E){return d({type:s.toggleAllRowsSelected,value:E})},[d]),G=R.useCallback(function(E){return d({type:s.toggleAllPageRowsSelected,value:E})},[d]),b=R.useCallback(function(E,O){return d({type:s.toggleRowSelected,id:E,value:O})},[d]),I=j(e),k=_(r().getToggleAllRowsSelectedProps,{instance:I()}),P=_(r().getToggleAllPageRowsSelectedProps,{instance:I()});Object.assign(e,{selectedFlatRows:w,isAllRowsSelected:C,isAllPageRowsSelected:A,toggleRowSelected:b,toggleAllRowsSelected:h,getToggleAllRowsSelectedProps:k,getToggleAllPageRowsSelectedProps:P,toggleAllPageRowsSelected:G})}function $n(e,t){var n=t.instance;e.toggleRowSelected=function(r){return n.toggleRowSelected(e.id,r)},e.getToggleRowSelectedProps=_(n.getHooks().getToggleRowSelectedProps,{instance:n,row:e})}var Rt=function(e){return{}},bt=function(e){return{}};s.setRowState="setRowState",s.setCellState="setCellState",s.resetRowState="resetRowState";var St=function(e){e.stateReducers.push(Un),e.useInstance.push(Jn),e.prepareRow.push(Yn)};function Un(e,t,n,r){var i=r.initialRowStateAccessor,o=i===void 0?Rt:i,u=r.initialCellStateAccessor,a=u===void 0?bt:u,l=r.rowsById;if(t.type===s.init)return f({rowState:{}},e);if(t.type===s.resetRowState)return f({},e,{rowState:r.initialState.rowState||{}});if(t.type===s.setRowState){var c,m=t.rowId,p=t.value,g=e.rowState[m]!==void 0?e.rowState[m]:o(l[m]);return f({},e,{rowState:f({},e.rowState,(c={},c[m]=Z(p,g),c))})}if(t.type===s.setCellState){var d,v,y,w,C,A=t.rowId,S=t.columnId,h=t.value,G=e.rowState[A]!==void 0?e.rowState[A]:o(l[A]),b=(G==null||(d=G.cellState)==null?void 0:d[S])!==void 0?G.cellState[S]:a((v=l[A])==null||(y=v.cells)==null?void 0:y.find(function(I){return I.column.id===S}));return f({},e,{rowState:f({},e.rowState,(C={},C[A]=f({},G,{cellState:f({},G.cellState||{},(w={},w[S]=Z(h,b),w))}),C))})}}function Jn(e){var t=e.autoResetRowState,n=t===void 0||t,r=e.data,i=e.dispatch,o=R.useCallback(function(l,c){return i({type:s.setRowState,rowId:l,value:c})},[i]),u=R.useCallback(function(l,c,m){return i({type:s.setCellState,rowId:l,columnId:c,value:m})},[i]),a=j(n);U(function(){a()&&i({type:s.resetRowState})},[r]),Object.assign(e,{setRowState:o,setCellState:u})}function Yn(e,t){var n=t.instance,r=n.initialRowStateAccessor,i=r===void 0?Rt:r,o=n.initialCellStateAccessor,u=o===void 0?bt:o,a=n.state.rowState;e&&(e.state=a[e.id]!==void 0?a[e.id]:i(e),e.setState=function(l){return n.setRowState(e.id,l)},e.cells.forEach(function(l){e.state.cellState||(e.state.cellState={}),l.state=e.state.cellState[l.column.id]!==void 0?e.state.cellState[l.column.id]:u(l),l.setState=function(c){return n.setCellState(e.id,l.column.id,c)}}))}St.pluginName="useRowState",s.resetColumnOrder="resetColumnOrder",s.setColumnOrder="setColumnOrder";var Ct=function(e){e.stateReducers.push(Qn),e.visibleColumnsDeps.push(function(t,n){var r=n.instance;return[].concat(t,[r.state.columnOrder])}),e.visibleColumns.push(Zn),e.useInstance.push(er)};function Qn(e,t,n,r){return t.type===s.init?f({columnOrder:[]},e):t.type===s.resetColumnOrder?f({},e,{columnOrder:r.initialState.columnOrder||[]}):t.type===s.setColumnOrder?f({},e,{columnOrder:Z(t.columnOrder,e.columnOrder)}):void 0}function Zn(e,t){var n=t.instance.state.columnOrder;if(!n||!n.length)return e;for(var r=[].concat(n),i=[].concat(e),o=[],u=function(){var a=r.shift(),l=i.findIndex(function(c){return c.id===a});l>-1&&o.push(i.splice(l,1)[0])};i.length&&r.length;)u();return[].concat(o,i)}function er(e){var t=e.dispatch;e.setColumnOrder=R.useCallback(function(n){return t({type:s.setColumnOrder,columnOrder:n})},[t])}Ct.pluginName="useColumnOrder",ue.canResize=!0,s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize";var xt=function(e){e.getResizerProps=[tr],e.getHeaderProps.push({style:{position:"relative"}}),e.stateReducers.push(nr),e.useInstance.push(or),e.useInstanceBeforeDimensions.push(rr)},tr=function(e,t){var n=t.instance,r=t.header,i=n.dispatch,o=function(u,a){var l=!1;if(u.type==="touchstart"){if(u.touches&&u.touches.length>1)return;l=!0}var c,m,p=function(S){var h=[];return function G(b){b.columns&&b.columns.length&&b.columns.map(G),h.push(b)}(S),h}(a).map(function(S){return[S.id,S.totalWidth]}),g=l?Math.round(u.touches[0].clientX):u.clientX,d=function(){window.cancelAnimationFrame(c),c=null,i({type:s.columnDoneResizing})},v=function(){window.cancelAnimationFrame(c),c=null,i({type:s.columnResizing,clientX:m})},y=function(S){m=S,c||(c=window.requestAnimationFrame(v))},w={mouse:{moveEvent:"mousemove",moveHandler:function(S){return y(S.clientX)},upEvent:"mouseup",upHandler:function(S){document.removeEventListener("mousemove",w.mouse.moveHandler),document.removeEventListener("mouseup",w.mouse.upHandler),d()}},touch:{moveEvent:"touchmove",moveHandler:function(S){return S.cancelable&&(S.preventDefault(),S.stopPropagation()),y(S.touches[0].clientX),!1},upEvent:"touchend",upHandler:function(S){document.removeEventListener(w.touch.moveEvent,w.touch.moveHandler),document.removeEventListener(w.touch.upEvent,w.touch.moveHandler),d()}}},C=l?w.touch:w.mouse,A=!!function(){if(typeof Ce=="boolean")return Ce;var S=!1;try{var h={get passive(){return S=!0,!1}};window.addEventListener("test",null,h),window.removeEventListener("test",null,h)}catch{S=!1}return Ce=S}()&&{passive:!1};document.addEventListener(C.moveEvent,C.moveHandler,A),document.addEventListener(C.upEvent,C.upHandler,A),i({type:s.columnStartResizing,columnId:a.id,columnWidth:a.totalWidth,headerIdWidths:p,clientX:g})};return[e,{onMouseDown:function(u){return u.persist()||o(u,r)},onTouchStart:function(u){return u.persist()||o(u,r)},style:{cursor:"col-resize"},draggable:!1,role:"separator"}]};function nr(e,t){if(t.type===s.init)return f({columnResizing:{columnWidths:{}}},e);if(t.type===s.resetResize)return f({},e,{columnResizing:{columnWidths:{}}});if(t.type===s.columnStartResizing){var n=t.clientX,r=t.columnId,i=t.columnWidth,o=t.headerIdWidths;return f({},e,{columnResizing:f({},e.columnResizing,{startX:n,headerIdWidths:o,columnWidth:i,isResizingColumn:r})})}if(t.type===s.columnResizing){var u=t.clientX,a=e.columnResizing,l=a.startX,c=a.columnWidth,m=a.headerIdWidths,p=(u-l)/c,g={};return(m===void 0?[]:m).forEach(function(d){var v=d[0],y=d[1];g[v]=Math.max(y+y*p,0)}),f({},e,{columnResizing:f({},e.columnResizing,{columnWidths:f({},e.columnResizing.columnWidths,{},g)})})}return t.type===s.columnDoneResizing?f({},e,{columnResizing:f({},e.columnResizing,{startX:null,isResizingColumn:null})}):void 0}xt.pluginName="useResizeColumns";var rr=function(e){var t=e.flatHeaders,n=e.disableResizing,r=e.getHooks,i=e.state.columnResizing,o=j(e);t.forEach(function(u){var a=Y(u.disableResizing!==!0&&void 0,n!==!0&&void 0,!0);u.canResize=a,u.width=i.columnWidths[u.id]||u.originalWidth||u.width,u.isResizing=i.isResizingColumn===u.id,a&&(u.getResizerProps=_(r().getResizerProps,{instance:o(),header:u}))})};function or(e){var t=e.plugins,n=e.dispatch,r=e.autoResetResize,i=r===void 0||r,o=e.columns;ne(t,["useAbsoluteLayout"],"useResizeColumns");var u=j(i);U(function(){u()&&n({type:s.resetResize})},[o]);var a=R.useCallback(function(){return n({type:s.resetResize})},[n]);Object.assign(e,{resetResizing:a})}var Pe={position:"absolute",top:0},Pt=function(e){e.getTableBodyProps.push(pe),e.getRowProps.push(pe),e.getHeaderGroupProps.push(pe),e.getFooterGroupProps.push(pe),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:f({},Pe,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:f({},Pe,{left:r.column.totalLeft+"px",width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:f({},Pe,{left:r.totalLeft+"px",width:r.totalWidth+"px"})}]})};Pt.pluginName="useAbsoluteLayout";var pe=function(e,t){return[e,{style:{position:"relative",width:t.instance.totalColumnsWidth+"px"}}]},Be={display:"inline-block",boxSizing:"border-box"},Ee=function(e,t){return[e,{style:{display:"flex",width:t.instance.totalColumnsWidth+"px"}}]},Bt=function(e){e.getRowProps.push(Ee),e.getHeaderGroupProps.push(Ee),e.getFooterGroupProps.push(Ee),e.getHeaderProps.push(function(t,n){var r=n.column;return[t,{style:f({},Be,{width:r.totalWidth+"px"})}]}),e.getCellProps.push(function(t,n){var r=n.cell;return[t,{style:f({},Be,{width:r.column.totalWidth+"px"})}]}),e.getFooterProps.push(function(t,n){var r=n.column;return[t,{style:f({},Be,{width:r.totalWidth+"px"})}]})};function Et(e){e.getTableProps.push(ir),e.getRowProps.push(Ie),e.getHeaderGroupProps.push(Ie),e.getFooterGroupProps.push(Ie),e.getHeaderProps.push(ur),e.getCellProps.push(sr),e.getFooterProps.push(ar)}Bt.pluginName="useBlockLayout",Et.pluginName="useFlexLayout";var ir=function(e,t){return[e,{style:{minWidth:t.instance.totalColumnsMinWidth+"px"}}]},Ie=function(e,t){return[e,{style:{display:"flex",flex:"1 0 auto",minWidth:t.instance.totalColumnsMinWidth+"px"}}]},ur=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]},sr=function(e,t){var n=t.cell;return[e,{style:{boxSizing:"border-box",flex:n.column.totalFlexWidth+" 0 auto",minWidth:n.column.totalMinWidth+"px",width:n.column.totalWidth+"px"}}]},ar=function(e,t){var n=t.column;return[e,{style:{boxSizing:"border-box",flex:n.totalFlexWidth?n.totalFlexWidth+" 0 auto":void 0,minWidth:n.totalMinWidth+"px",width:n.totalWidth+"px"}}]};function It(e){e.stateReducers.push(fr),e.getTableProps.push(lr),e.getHeaderProps.push(cr),e.getRowProps.push(dr)}s.columnStartResizing="columnStartResizing",s.columnResizing="columnResizing",s.columnDoneResizing="columnDoneResizing",s.resetResize="resetResize",It.pluginName="useGridLayout";var lr=function(e,t){var n=t.instance;return[e,{style:{display:"grid",gridTemplateColumns:n.visibleColumns.map(function(r){var i;return n.state.gridLayout.columnWidths[r.id]?n.state.gridLayout.columnWidths[r.id]+"px":(i=n.state.columnResizing)!=null&&i.isResizingColumn?n.state.gridLayout.startWidths[r.id]+"px":typeof r.width=="number"?r.width+"px":r.width}).join(" ")}}]},cr=function(e,t){var n=t.column;return[e,{id:"header-cell-"+n.id,style:{position:"sticky",gridColumn:"span "+n.totalVisibleHeaderCount}}]},dr=function(e,t){var n=t.row;return n.isExpanded?[e,{style:{gridColumn:"1 / "+(n.cells.length+1)}}]:[e,{}]};function fr(e,t,n,r){if(t.type===s.init)return f({gridLayout:{columnWidths:{}}},e);if(t.type===s.resetResize)return f({},e,{gridLayout:{columnWidths:{}}});if(t.type===s.columnStartResizing){var i=t.columnId,o=t.headerIdWidths,u=Fe(i);if(u!==void 0){var a=r.visibleColumns.reduce(function(h,G){var b;return f({},h,((b={})[G.id]=Fe(G.id),b))},{}),l=r.visibleColumns.reduce(function(h,G){var b;return f({},h,((b={})[G.id]=G.minWidth,b))},{}),c=r.visibleColumns.reduce(function(h,G){var b;return f({},h,((b={})[G.id]=G.maxWidth,b))},{}),m=o.map(function(h){var G=h[0];return[G,Fe(G)]});return f({},e,{gridLayout:f({},e.gridLayout,{startWidths:a,minWidths:l,maxWidths:c,headerIdGridWidths:m,columnWidth:u})})}return e}if(t.type===s.columnResizing){var p=t.clientX,g=e.columnResizing.startX,d=e.gridLayout,v=d.columnWidth,y=d.minWidths,w=d.maxWidths,C=d.headerIdGridWidths,A=(p-g)/v,S={};return(C===void 0?[]:C).forEach(function(h){var G=h[0],b=h[1];S[G]=Math.min(Math.max(y[G],b+b*A),w[G])}),f({},e,{gridLayout:f({},e.gridLayout,{columnWidths:f({},e.gridLayout.columnWidths,{},S)})})}return t.type===s.columnDoneResizing?f({},e,{gridLayout:f({},e.gridLayout,{startWidths:{},minWidths:{},maxWidths:{}})}):void 0}function Fe(e){var t,n=(t=document.getElementById("header-cell-"+e))==null?void 0:t.offsetWidth;if(n!==void 0)return n}H._UNSTABLE_usePivotColumns=ht,H.actions=s,H.defaultColumn=ue,H.defaultGroupByFn=dt,H.defaultOrderByFn=vt,H.defaultRenderer=We,H.emptyRenderer=Re,H.ensurePluginOrder=ne,H.flexRender=Oe,H.functionalUpdate=Z,H.loopHooks=ie,H.makePropGetter=_,H.makeRenderer=be,H.reduceHooks=$,H.safeUseLayoutEffect=Te,H.useAbsoluteLayout=Pt,H.useAsyncDebounce=function(e,t){t===void 0&&(t=0);var n=R.useRef({}),r=j(e),i=j(t);return R.useCallback(function(){var o=de(regeneratorRuntime.mark(function u(){var a,l,c,m=arguments;return regeneratorRuntime.wrap(function(p){for(;;)switch(p.prev=p.next){case 0:for(a=m.length,l=new Array(a),c=0;c<a;c++)l[c]=m[c];return n.current.promise||(n.current.promise=new Promise(function(g,d){n.current.resolve=g,n.current.reject=d})),n.current.timeout&&clearTimeout(n.current.timeout),n.current.timeout=setTimeout(de(regeneratorRuntime.mark(function g(){return regeneratorRuntime.wrap(function(d){for(;;)switch(d.prev=d.next){case 0:return delete n.current.timeout,d.prev=1,d.t0=n.current,d.next=5,r().apply(void 0,l);case 5:d.t1=d.sent,d.t0.resolve.call(d.t0,d.t1),d.next=12;break;case 9:d.prev=9,d.t2=d.catch(1),n.current.reject(d.t2);case 12:return d.prev=12,delete n.current.promise,d.finish(12);case 15:case"end":return d.stop()}},g,null,[[1,9,12,15]])})),i()),p.abrupt("return",n.current.promise);case 5:case"end":return p.stop()}},u)}));return function(){return o.apply(this,arguments)}}(),[r,i])},H.useBlockLayout=Bt,H.useColumnOrder=Ct,H.useExpanded=Ue,H.useFilters=ut,H.useFlexLayout=Et,H.useGetLatest=j,H.useGlobalFilter=st,H.useGridLayout=It,H.useGroupBy=ct,H.useMountedLayoutEffect=U,H.usePagination=mt,H.useResizeColumns=xt,H.useRowSelect=wt,H.useRowState=St,H.useSortBy=gt,H.useTable=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];e=Ke(e),n=[qe].concat(n);var i=R.useRef({}),o=j(i.current);Object.assign(o(),f({},e,{plugins:n,hooks:Ut()})),n.filter(Boolean).forEach(function(B){B(o().hooks)});var u=j(o().hooks);o().getHooks=u,delete o().hooks,Object.assign(o(),$(u().useOptions,Ke(e)));var a=o(),l=a.data,c=a.columns,m=a.initialState,p=a.defaultColumn,g=a.getSubRows,d=a.getRowId,v=a.stateReducer,y=a.useControlledState,w=j(v),C=R.useCallback(function(B,L){if(!L.type)throw console.info({action:L}),new Error("Unknown Action 👆");return[].concat(u().stateReducers,Array.isArray(w())?w():[w()]).reduce(function(D,K){return K(D,L,B,o())||D},B)},[u,w,o]),A=R.useReducer(C,void 0,function(){return C(m,{type:s.init})}),S=A[0],h=A[1],G=$([].concat(u().useControlledState,[y]),S,{instance:o()});Object.assign(o(),{state:G,dispatch:h});var b=R.useMemo(function(){return Me($(u().columns,c,{instance:o()}))},[u,o,c].concat($(u().columnsDeps,[],{instance:o()})));o().columns=b;var I=R.useMemo(function(){return $(u().allColumns,je(b),{instance:o()}).map(Le)},[b,u,o].concat($(u().allColumnsDeps,[],{instance:o()})));o().allColumns=I;var k=R.useMemo(function(){for(var B=[],L=[],D={},K=[].concat(I);K.length;){var X=K.shift();an({data:l,rows:B,flatRows:L,rowsById:D,column:X,getRowId:d,getSubRows:g,accessValueHooks:u().accessValue,getInstance:o})}return[B,L,D]},[I,l,d,g,u,o]),P=k[0],E=k[1],O=k[2];Object.assign(o(),{rows:P,initialRows:[].concat(P),flatRows:E,rowsById:O}),ie(u().useInstanceAfterData,o());var F=R.useMemo(function(){return $(u().visibleColumns,I,{instance:o()}).map(function(B){return Ne(B,p)})},[u,I,o,p].concat($(u().visibleColumnsDeps,[],{instance:o()})));I=R.useMemo(function(){var B=[].concat(F);return I.forEach(function(L){B.find(function(D){return D.id===L.id})||B.push(L)}),B},[I,F]),o().allColumns=I;var T=R.useMemo(function(){return $(u().headerGroups,Mt(F,p),o())},[u,F,p,o].concat($(u().headerGroupsDeps,[],{instance:o()})));o().headerGroups=T;var z=R.useMemo(function(){return T.length?T[0].headers:[]},[T]);o().headers=z,o().flatHeaders=T.reduce(function(B,L){return[].concat(B,L.headers)},[]),ie(u().useInstanceBeforeDimensions,o());var M=F.filter(function(B){return B.isVisible}).map(function(B){return B.id}).sort().join("_");F=R.useMemo(function(){return F.filter(function(B){return B.isVisible})},[F,M]),o().visibleColumns=F;var x=$e(z),W=x[0],N=x[1],q=x[2];return o().totalColumnsMinWidth=W,o().totalColumnsWidth=N,o().totalColumnsMaxWidth=q,ie(u().useInstance,o()),[].concat(o().flatHeaders,o().allColumns).forEach(function(B){B.render=be(o(),B),B.getHeaderProps=_(u().getHeaderProps,{instance:o(),column:B}),B.getFooterProps=_(u().getFooterProps,{instance:o(),column:B})}),o().headerGroups=R.useMemo(function(){return T.filter(function(B,L){return B.headers=B.headers.filter(function(D){return D.headers?function K(X){return X.filter(function(re){return re.headers?K(re.headers):re.isVisible}).length}(D.headers):D.isVisible}),!!B.headers.length&&(B.getHeaderGroupProps=_(u().getHeaderGroupProps,{instance:o(),headerGroup:B,index:L}),B.getFooterGroupProps=_(u().getFooterGroupProps,{instance:o(),headerGroup:B,index:L}),!0)})},[T,o,u]),o().footerGroups=[].concat(o().headerGroups).reverse(),o().prepareRow=R.useCallback(function(B){B.getRowProps=_(u().getRowProps,{instance:o(),row:B}),B.allCells=I.map(function(L){var D=B.values[L.id],K={column:L,row:B,value:D};return K.getCellProps=_(u().getCellProps,{instance:o(),cell:K}),K.render=be(o(),L,{row:B,cell:K,value:D}),K}),B.cells=F.map(function(L){return B.allCells.find(function(D){return D.column.id===L.id})}),ie(u().prepareRow,B,{instance:o()})},[u,o,I,F]),o().getTableProps=_(u().getTableProps,{instance:o()}),o().getTableBodyProps=_(u().getTableBodyProps,{instance:o()}),ie(u().useFinalInstance,o()),o()},Object.defineProperty(H,"__esModule",{value:!0})})})(He,He.exports);var xr=He.exports;Tt.exports=xr;var Pr=Tt.exports;function Fr({globalFilter:te,setGlobalFilter:oe}){const[H,R]=Sr.useState(te),ce=Pr.useAsyncDebounce(Q=>{oe(Q)},200),{t:de}=Cr(["common"]),f=()=>{R(""),oe("")};return we.jsxs("div",{className:"input-group",children:[we.jsx("input",{type:"text",className:"form-control",value:H||"",onChange:Q=>{R(Q.target.value),ce(Q.target.value)},placeholder:de("common:enter_search_criteria")}),we.jsx("button",{className:"btn btn-outline-secondary",type:"button",onClick:f,children:we.jsx("i",{className:"fa fa-times"})})]})}const Br="z2m-",Er=te=>`${Br}${te}`,Gr=(te,oe)=>{zt.set(Er(te),oe)},Ar=te=>zt.get(te);export{Fr as G,Ar as a,Er as g,Gr as p,Pr as r};
Binary file