Fixes #236: Saved filter doesn't reload show cables (#475)

* fix restore saved filter options

* fix restore saved filter group options

* fix htmx export to xml
This commit is contained in:
Mario authored and GitHub committed 2024-03-30 17:29:26 +01:00
1 parent 32003e59f9
commit c00b8c2cfe
5 files changed
+79 -20

No files matched your search

+25 -1
View File
@@ -3,6 +3,7 @@ import sys
from circuits.models import Circuit
from dcim.models import Device, DeviceRole, PowerFeed, PowerPanel
from extras.models import SavedFilter
from django.conf import settings
from django.contrib.auth.mixins import PermissionRequiredMixin
from django.contrib.contenttypes.models import ContentType
@@ -108,7 +109,30 @@ class ExportTopoToXML(PermissionRequiredMixin, ViewSet):
if request.GET:
save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks,show_neighbors = get_query_settings(request)
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks,show_neighbors = get_query_settings(request)
# Read options from saved filters as NetBox does not handle custom plugin filters
if "filter_id" in request.GET and request.GET["filter_id"] != '':
try:
saved_filter = SavedFilter.objects.get(pk=filter_id)
saved_filter_params = getattr(saved_filter, 'parameters')
if save_coords == False and 'save_coords' in saved_filter_params: save_coords = saved_filter_params['save_coords']
if show_power == False and 'show_power' in saved_filter_params: show_power = saved_filter_params['show_power']
if show_circuit == False and 'show_circuit' in saved_filter_params: show_circuit = saved_filter_params['show_circuit']
if show_logical_connections == False and 'show_logical_connections' in saved_filter_params: show_logical_connections = saved_filter_params['show_logical_connections']
if show_single_cable_logical_conns == False and 'show_single_cable_logical_conns' in saved_filter_params: show_single_cable_logical_conns = saved_filter_params['show_single_cable_logical_conns']
if show_cables == False and 'show_cables' in saved_filter_params: show_cables = saved_filter_params['show_cables']
if show_wireless == False and 'show_wireless' in saved_filter_params: show_wireless = saved_filter_params['show_wireless']
if group_sites == False and 'group_sites' in saved_filter_params: group_sites = saved_filter_params['group_sites']
if group_locations == False and 'group_locations' in saved_filter_params: group_locations = saved_filter_params['group_locations']
if group_racks == False and 'group_racks' in saved_filter_params: group_racks = saved_filter_params['group_racks']
if show_neighbors == False and 'show_neighbors' in saved_filter_params: show_neighbors = saved_filter_params['show_neighbors']
except SavedFilter.DoesNotExist: # filter_id not found
pass
except Exception as inst:
print(type(inst))
if 'group' not in request.query_params:
group_id = "default"
else:
@@ -1,8 +1,8 @@
(()=>{var En=Object.create;var Tt=Object.defineProperty,xn=Object.defineProperties,Cn=Object.getOwnPropertyDescriptor,Tn=Object.getOwnPropertyDescriptors,kn=Object.getOwnPropertyNames,Wi=Object.getOwnPropertySymbols,On=Object.getPrototypeOf,Vi=Object.prototype.hasOwnProperty,Sn=Object.prototype.propertyIsEnumerable;var Zt=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,he=(n,e)=>{for(var t in e||(e={}))Vi.call(e,t)&&Zt(n,t,e[t]);if(Wi)for(var t of Wi(e))Sn.call(e,t)&&Zt(n,t,e[t]);return n},Fe=(n,e)=>xn(n,Tn(e)),In=n=>Tt(n,"__esModule",{value:!0});var Pn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var Mn=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of kn(e))!Vi.call(n,i)&&i!=="default"&&Tt(n,i,{get:()=>e[i],enumerable:!(t=Cn(e,i))||t.enumerable});return n},qi=n=>Mn(In(Tt(n!=null?En(On(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var X=(n,e,t)=>(Zt(n,typeof e!="symbol"?e+"":e,t),t);var Ui=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var Jt=Pn((ja,Qt)=>{typeof Qt!="undefined"&&(Qt.exports=te);function te(n){if(n)return Dn(n)}function Dn(n){for(var e in te.prototype)n[e]=te.prototype[e];return n}te.prototype.on=te.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};te.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};te.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};te.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};te.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var Ss=qi(Jt());function le(){return le=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},le.apply(this,arguments)}function oe(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var ei;typeof Object.assign!="function"?ei=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}:ei=Object.assign;var Ne=ei,Yi=["","webkit","Moz","MS","ms","o"],Fn=typeof document=="undefined"?{style:{}}:document.createElement("div"),Nn="function",Ke=Math.round,Be=Math.abs,ti=Date.now;function Ot(n,e){for(var t,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<Yi.length;){if(t=Yi[o],i=t?t+s:e,i in n)return i;o++}}var ge;typeof window=="undefined"?ge={}:ge=window;var Xi=Ot(Fn.style,"touchAction"),Gi=Xi!==void 0;function Bn(){if(!Gi)return!1;var n={},e=ge.CSS&&ge.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?ge.CSS.supports("touch-action",t):!0}),n}var Ki="compute",$i="auto",ii="manipulation",Ae="none",ot="pan-x",nt="pan-y",St=Bn(),An=/mobile|tablet|ip(ad|hone|od)|android/i,Zi="ontouchstart"in ge,zn=Ot(ge,"PointerEvent")!==void 0,Rn=Zi&&An.test(navigator.userAgent),rt="touch",Ln="pen",si="mouse",Hn="kinect",jn=25,$=1,ze=2,W=4,J=8,It=1,at=2,dt=4,ht=8,$e=16,ue=at|dt,Re=ht|$e,Qi=ue|Re,Ji=["x","y"],Pt=["clientX","clientY"];function me(n,e,t){var i;if(!!n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Mt(n,e){return typeof n===Nn?n.apply(e&&e[0]||void 0,e):n}function Le(n,e){return n.indexOf(e)>-1}function Wn(n){if(Le(n,Ae))return Ae;var e=Le(n,ot),t=Le(n,nt);return e&&t?Ae:e||t?e?ot:nt:Le(n,ii)?ii:$i}var es=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Ki&&(i=this.compute()),Gi&&this.manager.element.style&&St[i]&&(this.manager.element.style[Xi]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.coLine truncated
(()=>{var bn=Object.create;var Tt=Object.defineProperty,vn=Object.defineProperties,wn=Object.getOwnPropertyDescriptor,_n=Object.getOwnPropertyDescriptors,En=Object.getOwnPropertyNames,ji=Object.getOwnPropertySymbols,xn=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Cn=Object.prototype.propertyIsEnumerable;var Zt=(n,e,t)=>e in n?Tt(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,le=(n,e)=>{for(var t in e||(e={}))Wi.call(e,t)&&Zt(n,t,e[t]);if(ji)for(var t of ji(e))Cn.call(e,t)&&Zt(n,t,e[t]);return n},Be=(n,e)=>vn(n,_n(e)),Tn=n=>Tt(n,"__esModule",{value:!0});var kn=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports);var On=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of En(e))!Wi.call(n,i)&&i!=="default"&&Tt(n,i,{get:()=>e[i],enumerable:!(t=wn(e,i))||t.enumerable});return n},Vi=n=>On(Tn(Tt(n!=null?bn(xn(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n);var X=(n,e,t)=>(Zt(n,typeof e!="symbol"?e+"":e,t),t);var qi=(n,e,t)=>new Promise((i,s)=>{var o=d=>{try{a(t.next(d))}catch(h){s(h)}},r=d=>{try{a(t.throw(d))}catch(h){s(h)}},a=d=>d.done?i(d.value):Promise.resolve(d.value).then(o,r);a((t=t.apply(n,e)).next())});var Jt=kn((za,Qt)=>{typeof Qt!="undefined"&&(Qt.exports=te);function te(n){if(n)return Sn(n)}function Sn(n){for(var e in te.prototype)n[e]=te.prototype[e];return n}te.prototype.on=te.prototype.addEventListener=function(n,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+n]=this._callbacks["$"+n]||[]).push(e),this};te.prototype.once=function(n,e){function t(){this.off(n,t),e.apply(this,arguments)}return t.fn=e,this.on(n,t),this};te.prototype.off=te.prototype.removeListener=te.prototype.removeAllListeners=te.prototype.removeEventListener=function(n,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+n];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+n],this;for(var i,s=0;s<t.length;s++)if(i=t[s],i===e||i.fn===e){t.splice(s,1);break}return t.length===0&&delete this._callbacks["$"+n],this};te.prototype.emit=function(n){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),t=this._callbacks["$"+n],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(t){t=t.slice(0);for(var i=0,s=t.length;i<s;++i)t[i].apply(this,e)}return this};te.prototype.listeners=function(n){return this._callbacks=this._callbacks||{},this._callbacks["$"+n]||[]};te.prototype.hasListeners=function(n){return!!this.listeners(n).length}});var Os=Vi(Jt());function ce(){return ce=Object.assign||function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},ce.apply(this,arguments)}function ne(n,e){n.prototype=Object.create(e.prototype),n.prototype.constructor=n,n.__proto__=e}function kt(n){if(n===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return n}var ei;typeof Object.assign!="function"?ei=function(e){if(e==null)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),i=1;i<arguments.length;i++){var s=arguments[i];if(s!=null)for(var o in s)s.hasOwnProperty(o)&&(t[o]=s[o])}return t}:ei=Object.assign;var Ae=ei,Ui=["","webkit","Moz","MS","ms","o"],In=typeof document=="undefined"?{style:{}}:document.createElement("div"),Pn="function",$e=Math.round,ze=Math.abs,ti=Date.now;function Ot(n,e){for(var t,i,s=e[0].toUpperCase()+e.slice(1),o=0;o<Ui.length;){if(t=Ui[o],i=t?t+s:e,i in n)return i;o++}}var me;typeof window=="undefined"?me={}:me=window;var Yi=Ot(In.style,"touchAction"),Xi=Yi!==void 0;function Mn(){if(!Xi)return!1;var n={},e=me.CSS&&me.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(t){return n[t]=e?me.CSS.supports("touch-action",t):!0}),n}var Gi="compute",Ki="auto",ii="manipulation",Re="none",nt="pan-x",rt="pan-y",St=Mn(),Dn=/mobile|tablet|ip(ad|hone|od)|android/i,$i="ontouchstart"in me,Fn=Ot(me,"PointerEvent")!==void 0,Nn=$i&&Dn.test(navigator.userAgent),at="touch",Bn="pen",si="mouse",An="kinect",zn=25,$=1,Le=2,j=4,J=8,It=1,dt=2,ht=4,lt=8,Ze=16,ue=dt|ht,He=lt|Ze,Zi=ue|He,Qi=["x","y"],Pt=["clientX","clientY"];function ye(n,e,t){var i;if(!!n)if(n.forEach)n.forEach(e,t);else if(n.length!==void 0)for(i=0;i<n.length;)e.call(t,n[i],i,n),i++;else for(i in n)n.hasOwnProperty(i)&&e.call(t,n[i],i,n)}function Mt(n,e){return typeof n===Pn?n.apply(e&&e[0]||void 0,e):n}function je(n,e){return n.indexOf(e)>-1}function Rn(n){if(je(n,Re))return Re;var e=je(n,nt),t=je(n,rt);return e&&t?Re:e||t?e?nt:rt:je(n,ii)?ii:Ki}var Ji=function(){function n(t,i){this.manager=t,this.set(i)}var e=n.prototype;return e.set=function(i){i===Gi&&(i=this.compute()),Xi&&this.manager.element.style&&St[i]&&(this.manager.element.style[Yi]=i),this.actions=i.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.coLine truncated
`+t+` AT
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var Cs=xs(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),mr=xs(function(n,e){return Cs(n,e,!0)},"merge","Use `assign`.");function yr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Ne(s,t)}function Ts(n,e){return function(){return n.apply(e,arguments)}}var ks=function(){var n=function(t,i){return i===void 0&&(i={}),new Es(t,le({recognizers:vs.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=Qi,n.DIRECTION_DOWN=$e,n.DIRECTION_LEFT=at,n.DIRECTION_RIGHT=dt,n.DIRECTION_UP=ht,n.DIRECTION_HORIZONTAL=ue,n.DIRECTION_VERTICAL=Re,n.DIRECTION_NONE=It,n.DIRECTION_DOWN=$e,n.INPUT_START=$,n.INPUT_MOVE=ze,n.INPUT_END=W,n.INPUT_CANCEL=J,n.STATE_POSSIBLE=Ft,n.STATE_BEGAN=ne,n.STATE_CHANGED=Je,n.STATE_ENDED=ke,n.STATE_RECOGNIZED=ye,n.STATE_CANCELLED=pt,n.STATE_FAILED=fe,n.Manager=Es,n.Input=Ze,n.TouchAction=es,n.TouchInput=ai,n.MouseInput=di,n.PointerEventInput=ds,n.TouchMouseInput=cs,n.SingleTouchInput=pr,n.Recognizer=gt,n.AttrRecognizer=et,n.Tap=hi,n.Pan=li,n.Swipe=ps,n.Pinch=gs,n.Rotate=ms,n.Press=ys,n.on=ct,n.off=ut,n.each=me,n.merge=mr,n.extend=Cs,n.bindFn=Ts,n.assign=Ne,n.inherit=yr,n.bindFn=Ts,n.prefixed=Ot,n.toArray=ft,n.inArray=He,n.uniqueArray=ri,n.splitStr=lt,n.boolOrFn=Mt,n.hasParent=oi,n.addEventListeners=ct,n.removeEventListeners=ut,n.defaults=Ne({},bs,{preset:vs}),n}(),Wa=ks.defaults,Os=ks;var ci=Symbol("DELETE");function Is(n,...e){return Ps({},n,...e)}function Ps(...n){let e=Bt(...n);return Ds(e),e}function Bt(...n){if(n.length<2)return n[0];if(n.length>2)return Bt(Ps(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===ci?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=Bt(e[i],t[i]):e[i]=Ms(t[i]));return e}function Ms(n){return Array.isArray(n)?n.map(e=>Ms(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Bt({},n):n}function Ds(n){for(let e of Object.keys(n))n[e]===ci?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ds(n[e])}function mt(...n){return br(n.length?n:[Date.now()])}function br(n){let[e,t,i]=vr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function vr(...n){let e=wr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function wr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function _r(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var ui=typeof window!="undefined"?window.Hammer||Os:function(){return _r()};function pe(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=ui(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{Er(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Ss.default)(pe.prototype);pe.current=null;pe.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};pe.prototype.activate=function(){pe.current&&pe.current.deactivate(),pe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};pe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};pe.prototy Line truncated
`;return function(){var s=new Error("get-stack-trace"),o=s&&s.stack?s.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=window.console&&(window.console.warn||window.console.log);return r&&r.call(window.console,i,o),n.apply(this,arguments)}}var xs=Es(function(n,e,t){for(var i=Object.keys(e),s=0;s<i.length;)(!t||t&&n[i[s]]===void 0)&&(n[i[s]]=e[i[s]]),s++;return n},"extend","Use `assign`."),ur=Es(function(n,e){return xs(n,e,!0)},"merge","Use `assign`.");function fr(n,e,t){var i=e.prototype,s;s=n.prototype=Object.create(i),s.constructor=n,s._super=i,t&&Ae(s,t)}function Cs(n,e){return function(){return n.apply(e,arguments)}}var Ts=function(){var n=function(t,i){return i===void 0&&(i={}),new _s(t,ce({recognizers:bs.concat()},i))};return n.VERSION="2.0.17-rc",n.DIRECTION_ALL=Zi,n.DIRECTION_DOWN=Ze,n.DIRECTION_LEFT=dt,n.DIRECTION_RIGHT=ht,n.DIRECTION_UP=lt,n.DIRECTION_HORIZONTAL=ue,n.DIRECTION_VERTICAL=He,n.DIRECTION_NONE=It,n.DIRECTION_DOWN=Ze,n.INPUT_START=$,n.INPUT_MOVE=Le,n.INPUT_END=j,n.INPUT_CANCEL=J,n.STATE_POSSIBLE=Ft,n.STATE_BEGAN=re,n.STATE_CHANGED=et,n.STATE_ENDED=Se,n.STATE_RECOGNIZED=be,n.STATE_CANCELLED=gt,n.STATE_FAILED=fe,n.Manager=_s,n.Input=Qe,n.TouchAction=Ji,n.TouchInput=ai,n.MouseInput=di,n.PointerEventInput=as,n.TouchMouseInput=ls,n.SingleTouchInput=lr,n.Recognizer=mt,n.AttrRecognizer=tt,n.Tap=hi,n.Pan=li,n.Swipe=fs,n.Pinch=ps,n.Rotate=gs,n.Press=ms,n.on=ut,n.off=ft,n.each=ye,n.merge=ur,n.extend=xs,n.bindFn=Cs,n.assign=Ae,n.inherit=fr,n.bindFn=Cs,n.prefixed=Ot,n.toArray=pt,n.inArray=We,n.uniqueArray=ri,n.splitStr=ct,n.boolOrFn=Mt,n.hasParent=oi,n.addEventListeners=ut,n.removeEventListeners=ft,n.defaults=Ae({},ys,{preset:bs}),n}(),Ra=Ts.defaults,ks=Ts;var ci=Symbol("DELETE");function Ss(n,...e){return Is({},n,...e)}function Is(...n){let e=Bt(...n);return Ms(e),e}function Bt(...n){if(n.length<2)return n[0];if(n.length>2)return Bt(Is(n[0],n[1]),...n.slice(2));let e=n[0],t=n[1];if(e instanceof Date&&t instanceof Date)return e.setTime(t.getTime()),e;for(let i of Reflect.ownKeys(t))Object.prototype.propertyIsEnumerable.call(t,i)&&(t[i]===ci?delete e[i]:e[i]!==null&&t[i]!==null&&typeof e[i]=="object"&&typeof t[i]=="object"&&!Array.isArray(e[i])&&!Array.isArray(t[i])?e[i]=Bt(e[i],t[i]):e[i]=Ps(t[i]));return e}function Ps(n){return Array.isArray(n)?n.map(e=>Ps(e)):typeof n=="object"&&n!==null?n instanceof Date?new Date(n.getTime()):Bt({},n):n}function Ms(n){for(let e of Object.keys(n))n[e]===ci?delete n[e]:typeof n[e]=="object"&&n[e]!==null&&Ms(n[e])}function yt(...n){return pr(n.length?n:[Date.now()])}function pr(n){let[e,t,i]=gr(n),s=1,o=()=>{let r=2091639*e+s*23283064365386963e-26;return e=t,t=i,i=r-(s=r|0)};return o.uint32=()=>o()*4294967296,o.fract53=()=>o()+(o()*2097152|0)*11102230246251565e-32,o.algorithm="Alea",o.seed=n,o.version="0.9",o}function gr(...n){let e=mr(),t=e(" "),i=e(" "),s=e(" ");for(let o=0;o<n.length;o++)t-=e(n[o]),t<0&&(t+=1),i-=e(n[o]),i<0&&(i+=1),s-=e(n[o]),s<0&&(s+=1);return[t,i,s]}function mr(){let n=4022871197;return function(e){let t=e.toString();for(let i=0;i<t.length;i++){n+=t.charCodeAt(i);let s=.02519603282416938*n;n=s>>>0,s-=n,s*=n,n=s>>>0,s-=n,n+=s*4294967296}return(n>>>0)*23283064365386963e-26}}function yr(){let n=()=>{};return{on:n,off:n,destroy:n,emit:n,get(){return{set:n}}}}var ui=typeof window!="undefined"?window.Hammer||ks:function(){return yr()};function pe(n){this._cleanupQueue=[],this.active=!1,this._dom={container:n,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push(()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)});let e=ui(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push(()=>{e.destroy()}),["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach(i=>{e.on(i,s=>{s.srcEvent.stopPropagation()})}),document&&document.body&&(this._onClick=i=>{br(i.target,n)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push(()=>{document.body.removeEventListener("click",this._onClick)})),this._escListener=i=>{("key"in i?i.key==="Escape":i.keyCode===27)&&this.deactivate()}}(0,Os.default)(pe.prototype);pe.current=null;pe.prototype.destroy=function(){this.deactivate();for(let n of this._cleanupQueue.splice(0).reverse())n()};pe.prototype.activate=function(){pe.current&&pe.current.deactivate(),pe.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)};pe.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")};pe.prototy Line truncated
`:o.distance<=a&&s.distance>o.distance?d=" in "+L.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+L.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+L.printLocation(s.path,e):d=". Did you mean one of these: "+L.print(Object.keys(t))+L.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,mi),vt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=L.findInOptions(e,t[l],At(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=L.levenshteinDistance(e,l),o>c&&(r=l,a=Or(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
`:o.distance<=a&&s.distance>o.distance?d=" in "+L.printLocation(s.path,e,"")+"Perhaps it was misplaced? Matching option found at: "+L.printLocation(o.path,o.closestMatch,""):s.distance<=r?d='. Did you mean "'+s.closestMatch+'"?'+L.printLocation(s.path,e):d=". Did you mean one of these: "+L.print(Object.keys(t))+L.printLocation(i,e),console.error('%cUnknown option detected: "'+e+'"'+d,mi),wt=!0}static findInOptions(e,t,i,s=!1){let o=1e9,r="",a=[],d=e.toLowerCase(),h;for(let l in t){let c;if(t[l].__type__!==void 0&&s===!0){let u=L.findInOptions(e,t[l],At(i,l));o>u.distance&&(r=u.closestMatch,a=u.path,o=u.distance,h=u.indexMatch)}else l.toLowerCase().indexOf(d)!==-1&&(h=l),c=L.levenshteinDistance(e,l),o>c&&(r=l,a=xr(i),o=c)}return{closestMatch:r,path:a,distance:o,indexMatch:h}}static printLocation(e,t,i=`Problem value found at:
`){let s=`
`+i+`options = {
@@ -11,16 +11,16 @@
`;for(let o=0;o<e.length+1;o++){for(let r=0;r<e.length-o;r++)s+=" ";s+=`}
`}return s+`
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},js=pe;var Ws=Dr,Ve=ui,Vs=Fr,yi=mi,qs=Nr;var Ht,Br=new Uint8Array(16);function bi(){if(!Ht&&(Ht=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Br)}var Us=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Ar(n){return typeof n=="string"&&Us.test(n)}var Ys=Ar;var U=[];for(jt=0;jt<256;++jt)U.push((jt+256).toString(16).substr(1));var jt;function zr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(U[n[e+0]]+U[n[e+1]]+U[n[e+2]]+U[n[e+3]]+"-"+U[n[e+4]]+U[n[e+5]]+"-"+U[n[e+6]]+U[n[e+7]]+"-"+U[n[e+8]]+U[n[e+9]]+"-"+U[n[e+10]]+U[n[e+11]]+U[n[e+12]]+U[n[e+13]]+U[n[e+14]]+U[n[e+15]]).toLowerCase();if(!Ys(t))throw TypeError("Stringified UUID is invalid");return t}var Xs=zr;function Rr(n,e,t){n=n||{};var i=n.random||(n.rng||bi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return Xs(i)}var Ee=Rr;function Gs(n){return typeof n=="string"||typeof n=="number"}var Wt=class{constructor(e){X(this,"delay");X(this,"max");X(this,"_queue",[]);X(this,"_timeout",null);X(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Wt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},wt=class{constructor(){X(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});X(this,"subscribe",wt.prototype.on);X(this,"unsubscribe",wt.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},Oe=class{constructor(e){X(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new Oe([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new Oe({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new Oe({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of Line truncated
`||P==="\r";)q();do{var n=!1;if(P==="#"){for(var e=tt-1;Se.charAt(e)===" "||Se.charAt(e)===" ";)e--;if(Se.charAt(e)===`
`||Se.charAt(e)===""){for(;P!=""&&P!=`
`;)q();n=!0}}if(P==="/"&&it()==="/"){for(;P!=""&&P!=`
`;)q();n=!0}if(P==="/"&&it()==="*"){for(;P!="";)if(P==="*"&&it()==="/"){q(),q();break}else q();n=!0}for(;P===" "||P===" "||P===`
`||P==="\r";)q()}while(n);if(P===""){ee=Z.DELIMITER;return}var t=P+it();if(to[t]){ee=Z.DELIMITER,k=t,q(),q();return}if(to[P]){ee=Z.DELIMITER,k=P,q();return}if(io(P)||P==="-"){for(k+=P,q();io(P);)k+=P,q();k==="false"?k=!1:k==="true"?k=!0:isNaN(Number(k))||(k=Number(k)),ee=Z.IDENTIFIER;return}if(P==='"'){for(q();P!=""&&(P!='"'||P==='"'&&it()==='"');)P==='"'?(k+=P,q()):P==="\\"&&it()==="n"?(k+=`
`,q()):k+=P,q();if(P!='"')throw Q('End of string " expected');q(),ee=Z.IDENTIFIER;return}for(ee=Z.UNKNOWN;P!="";)k+=P,q();throw new SyntaxError('Syntax error in part "'+ho(k,30)+'"')}function Qr(){var n={};if(Kr(),B(),k==="strict"&&(n.strict=!0,B()),(k==="graph"||k==="digraph")&&(n.type=k,B()),ee===Z.IDENTIFIER&&(n.id=k,B()),k!="{")throw Q("Angle bracket { expected");if(B(),no(n),k!="}")throw Q("Angle bracket } expected");if(B(),k!=="")throw Q("End of file expected");return B(),delete n.node,delete n.edge,delete n.graph,n}function no(n){for(;k!==""&&k!="}";)Jr(n),k===";"&&B()}function Jr(n){var e=ro(n);if(e){ao(n,e);return}var t=ea(n);if(!t){if(ee!=Z.IDENTIFIER)throw Q("Identifier expected");var i=k;if(B(),k==="="){if(B(),ee!=Z.IDENTIFIER)throw Q("Identifier expected");n[i]=k,B()}else ta(n,i)}}function ro(n){var e=null;if(k==="subgraph"&&(e={},e.type="subgraph",B(),ee===Z.IDENTIFIER&&(e.id=k,B())),k==="{"){if(B(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,no(e),k!="}")throw Q("Angle bracket } expected");B(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function ea(n){return k==="node"?(B(),n.node=_t(),"node"):k==="edge"?(B(),n.edge=_t(),"edge"):k==="graph"?(B(),n.graph=_t(),"graph"):null}function ta(n,e){var t={id:e},i=_t();i&&(t.attr=i),so(n,t),ao(n,e)}function ao(n,e){for(;k==="->"||k==="--";){var t,i=k;B();var s=ro(n);if(s)t=s;else{if(ee!=Z.IDENTIFIER)throw Q("Identifier or subgraph expected");t=k,so(n,{id:t}),B()}var o=_t(),r=oo(n,e,t,i,o);Zr(n,r),e=t}}function _t(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;k==="[";){for(B(),e={};k!==""&&k!="]";){if(ee!=Z.IDENTIFIER)throw Q("Attribute name expected");var r=k;if(B(),k!="=")throw Q("Equal sign = expected");if(B(),ee!=Z.IDENTIFIER)throw Q("Attribute value expected");var a=k;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),B(),k==","&&B()}if(k!="]")throw Q("Bracket ] expected");B()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw Q("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw Q('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,s[f]={attr:s[f].attr,name:s[f].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.a Line truncated
`}static print(e){return JSON.stringify(e).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(e,t){if(e.length===0)return t.length;if(t.length===0)return e.length;let i=[],s;for(s=0;s<=t.length;s++)i[s]=[s];let o;for(o=0;o<=e.length;o++)i[0][o]=o;for(s=1;s<=t.length;s++)for(o=1;o<=e.length;o++)t.charAt(s-1)==e.charAt(o-1)?i[s][o]=i[s-1][o-1]:i[s][o]=Math.min(i[s-1][o-1]+1,Math.min(i[s][o-1]+1,i[s-1][o]+1));return i[t.length][e.length]}},Hs=pe;var js=Sr,Ue=ui,Ws=Ir,yi=mi,Vs=Pr;var Ht,Mr=new Uint8Array(16);function bi(){if(!Ht&&(Ht=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),!Ht))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Mr)}var qs=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function Dr(n){return typeof n=="string"&&qs.test(n)}var Us=Dr;var U=[];for(jt=0;jt<256;++jt)U.push((jt+256).toString(16).substr(1));var jt;function Fr(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,t=(U[n[e+0]]+U[n[e+1]]+U[n[e+2]]+U[n[e+3]]+"-"+U[n[e+4]]+U[n[e+5]]+"-"+U[n[e+6]]+U[n[e+7]]+"-"+U[n[e+8]]+U[n[e+9]]+"-"+U[n[e+10]]+U[n[e+11]]+U[n[e+12]]+U[n[e+13]]+U[n[e+14]]+U[n[e+15]]).toLowerCase();if(!Us(t))throw TypeError("Stringified UUID is invalid");return t}var Ys=Fr;function Nr(n,e,t){n=n||{};var i=n.random||(n.rng||bi)();if(i[6]=i[6]&15|64,i[8]=i[8]&63|128,e){t=t||0;for(var s=0;s<16;++s)e[t+s]=i[s];return e}return Ys(i)}var xe=Nr;function Xs(n){return typeof n=="string"||typeof n=="number"}var Wt=class{constructor(e){X(this,"delay");X(this,"max");X(this,"_queue",[]);X(this,"_timeout",null);X(this,"_extended",null);this.delay=null,this.max=1/0,this.setOptions(e)}setOptions(e){e&&typeof e.delay!="undefined"&&(this.delay=e.delay),e&&typeof e.max!="undefined"&&(this.max=e.max),this._flushIfNeeded()}static extend(e,t){let i=new Wt(t);if(e.flush!==void 0)throw new Error("Target object already has a property flush");e.flush=()=>{i.flush()};let s=[{name:"flush",original:void 0}];if(t&&t.replace)for(let o=0;o<t.replace.length;o++){let r=t.replace[o];s.push({name:r,original:e[r]}),i.replace(e,r)}return i._extended={object:e,methods:s},i}destroy(){if(this.flush(),this._extended){let e=this._extended.object,t=this._extended.methods;for(let i=0;i<t.length;i++){let s=t[i];s.original?e[s.name]=s.original:delete e[s.name]}this._extended=null}}replace(e,t){let i=this,s=e[t];if(!s)throw new Error("Method "+t+" undefined");e[t]=function(...o){i.queue({args:o,fn:s,context:this})}}queue(e){typeof e=="function"?this._queue.push({fn:e}):this._queue.push(e),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),this._timeout!=null&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&typeof this.delay=="number"&&(this._timeout=setTimeout(()=>{this.flush()},this.delay))}flush(){this._queue.splice(0).forEach(e=>{e.fn.apply(e.context||e.fn,e.args||[])})}},_t=class{constructor(){X(this,"_subscribers",{"*":[],add:[],remove:[],update:[]});X(this,"subscribe",_t.prototype.on);X(this,"unsubscribe",_t.prototype.off)}_trigger(e,t,i){if(e==="*")throw new Error("Cannot trigger event *");[...this._subscribers[e],...this._subscribers["*"]].forEach(s=>{s(e,t,i!=null?i:null)})}on(e,t){typeof t=="function"&&this._subscribers[e].push(t)}off(e,t){this._subscribers[e]=this._subscribers[e].filter(i=>i!==t)}},Ie=class{constructor(e){X(this,"_pairs");this._pairs=e}*[Symbol.iterator](){for(let[e,t]of this._pairs)yield[e,t]}*entries(){for(let[e,t]of this._pairs)yield[e,t]}*keys(){for(let[e]of this._pairs)yield e}*values(){for(let[,e]of this._pairs)yield e}toIdArray(){return[...this._pairs].map(e=>e[0])}toItemArray(){return[...this._pairs].map(e=>e[1])}toEntryArray(){return[...this._pairs]}toObjectMap(){let e=Object.create(null);for(let[t,i]of this._pairs)e[t]=i;return e}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new Ie([...this._pairs])}distinct(e){let t=new Set;for(let[i,s]of this._pairs)t.add(e(s,i));return t}filter(e){let t=this._pairs;return new Ie({*[Symbol.iterator](){for(let[i,s]of t)e(s,i)&&(yield[i,s])}})}forEach(e){for(let[t,i]of this._pairs)e(i,t)}map(e){let t=this._pairs;return new Ie({*[Symbol.iterator](){for(let[i,s]of t)yield[i,e(s,i)]}})}max(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d>o&&(o=d,s=a)}return s}min(e){let t=this._pairs[Symbol.iterator](),i=t.next();if(i.done)return null;let s=i.value[1],o=e(i.value[1],i.value[0]);for(;!(i=t.next()).done;){let[r,a]=i.value,d=e(a,r);d<o&&(o=d,s=a)}return s}reduce(e,t){for(let[i,s]of Line truncated
`||P==="\r";)V();do{var n=!1;if(P==="#"){for(var e=it-1;Pe.charAt(e)===" "||Pe.charAt(e)===" ";)e--;if(Pe.charAt(e)===`
`||Pe.charAt(e)===""){for(;P!=""&&P!=`
`;)V();n=!0}}if(P==="/"&&st()==="/"){for(;P!=""&&P!=`
`;)V();n=!0}if(P==="/"&&st()==="*"){for(;P!="";)if(P==="*"&&st()==="/"){V(),V();break}else V();n=!0}for(;P===" "||P===" "||P===`
`||P==="\r";)V()}while(n);if(P===""){ee=Z.DELIMITER;return}var t=P+st();if(eo[t]){ee=Z.DELIMITER,S=t,V(),V();return}if(eo[P]){ee=Z.DELIMITER,S=P,V();return}if(to(P)||P==="-"){for(S+=P,V();to(P);)S+=P,V();S==="false"?S=!1:S==="true"?S=!0:isNaN(Number(S))||(S=Number(S)),ee=Z.IDENTIFIER;return}if(P==='"'){for(V();P!=""&&(P!='"'||P==='"'&&st()==='"');)P==='"'?(S+=P,V()):P==="\\"&&st()==="n"?(S+=`
`,V()):S+=P,V();if(P!='"')throw Q('End of string " expected');V(),ee=Z.IDENTIFIER;return}for(ee=Z.UNKNOWN;P!="";)S+=P,V();throw new SyntaxError('Syntax error in part "'+ao(S,30)+'"')}function Gr(){var n={};if(Ur(),B(),S==="strict"&&(n.strict=!0,B()),(S==="graph"||S==="digraph")&&(n.type=S,B()),ee===Z.IDENTIFIER&&(n.id=S,B()),S!="{")throw Q("Angle bracket { expected");if(B(),oo(n),S!="}")throw Q("Angle bracket } expected");if(B(),S!=="")throw Q("End of file expected");return B(),delete n.node,delete n.edge,delete n.graph,n}function oo(n){for(;S!==""&&S!="}";)Kr(n),S===";"&&B()}function Kr(n){var e=no(n);if(e){ro(n,e);return}var t=$r(n);if(!t){if(ee!=Z.IDENTIFIER)throw Q("Identifier expected");var i=S;if(B(),S==="="){if(B(),ee!=Z.IDENTIFIER)throw Q("Identifier expected");n[i]=S,B()}else Zr(n,i)}}function no(n){var e=null;if(S==="subgraph"&&(e={},e.type="subgraph",B(),ee===Z.IDENTIFIER&&(e.id=S,B())),S==="{"){if(B(),e||(e={}),e.parent=n,e.node=n.node,e.edge=n.edge,e.graph=n.graph,oo(e),S!="}")throw Q("Angle bracket } expected");B(),delete e.node,delete e.edge,delete e.graph,delete e.parent,n.subgraphs||(n.subgraphs=[]),n.subgraphs.push(e)}return e}function $r(n){return S==="node"?(B(),n.node=Et(),"node"):S==="edge"?(B(),n.edge=Et(),"edge"):S==="graph"?(B(),n.graph=Et(),"graph"):null}function Zr(n,e){var t={id:e},i=Et();i&&(t.attr=i),io(n,t),ro(n,e)}function ro(n,e){for(;S==="->"||S==="--";){var t,i=S;B();var s=no(n);if(s)t=s;else{if(ee!=Z.IDENTIFIER)throw Q("Identifier or subgraph expected");t=S,io(n,{id:t}),B()}var o=Et(),r=so(n,e,t,i,o);Xr(n,r),e=t}}function Et(){for(var n,e=null,t={dashed:!0,solid:!1,dotted:[1,5]},i={dot:"circle",box:"box",crow:"crow",curve:"curve",icurve:"inv_curve",normal:"triangle",inv:"inv_triangle",diamond:"diamond",tee:"bar",vee:"vee"},s=new Array,o=new Array;S==="[";){for(B(),e={};S!==""&&S!="]";){if(ee!=Z.IDENTIFIER)throw Q("Attribute name expected");var r=S;if(B(),S!="=")throw Q("Equal sign = expected");if(B(),ee!=Z.IDENTIFIER)throw Q("Attribute value expected");var a=S;r==="style"&&(a=t[a]);var d;r==="arrowhead"&&(d=i[a],r="arrows",a={to:{enabled:!0,type:d}}),r==="arrowtail"&&(d=i[a],r="arrows",a={from:{enabled:!0,type:d}}),s.push({attr:e,name:r,value:a}),o.push(r),B(),S==","&&B()}if(S!="]")throw Q("Bracket ] expected");B()}if(o.includes("dir")){var h={};for(h.arrows={},n=0;n<s.length;n++)if(s[n].name==="arrows")if(s[n].value.to!=null)h.arrows.to=n;else if(s[n].value.from!=null)h.arrows.from=n;else throw Q("Invalid value of arrows");else s[n].name==="dir"&&(h.dir=n);var l=s[h.dir].value;if(!o.includes("arrows"))if(l==="both")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1,s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="forward")s.push({attr:s[h.dir].attr,name:"arrows",value:{to:{enabled:!0}}}),h.arrows.to=s.length-1;else if(l==="back")s.push({attr:s[h.dir].attr,name:"arrows",value:{from:{enabled:!0}}}),h.arrows.from=s.length-1;else if(l==="none")s.push({attr:s[h.dir].attr,name:"arrows",value:""}),h.arrows.to=s.length-1;else throw Q('Invalid dir type "'+l+'"');var c,u;if(l==="both")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}},s.splice(h.arrows.from,1)):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="arrow",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="arrow",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}});else if(l==="back")h.arrows.to&&h.arrows.from?(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u="",c="arrow",h.arrows.from=h.arrows.to,s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.from&&(u="",c=s[h.arrows.from].value.from.type,s[h.arrows.to]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}),s[h.arrows.from]={attr:s[h.arrows.from].attr,name:s[h.arrows.from].name,value:{from:{enabled:!0,type:s[h.arrows.from].value.from.type}}};else if(l==="none"){var f;h.arrows.to?f=h.arrows.to:f=h.arrows.from,s[f]={attr:s[f].attr,name:s[f].name,value:""}}else if(l==="forward")h.arrows.to&&h.arrows.from?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.arrows.to?(u=s[h.arrows.to].value.to.type,c="",s[h.arrows.to]={attr:s[h.arrows.to].attr,name:s[h.arrows.to].name,value:{to:{enabled:!0,type:u},from:{enabled:!0,type:c}}}):h.a Line truncated
`),e=e.replace(/\r/g,`
`);let i=String(e).split(`
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new ki(e),i=s=>/&/.test(s)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new ki(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Ut=["bold","ital","boldital","mono"],qe=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),qt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(I(Ut,t=>{this.fontOptions[t]={}}),qe.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}I(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=_e(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=_e(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=_e(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=_e(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=_e(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=_e(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),D(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ci("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};qe.parseFontString(o,s)&&(s=o),I(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ut.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0; Line truncated
`),s=i.length;if(t.multi)for(let o=0;o<s;o++){let r=this.splitBlocks(i[o],t.multi);if(r!==void 0){if(r.length===0){this.lines.newLine("");continue}if(t.maxWdt>0)for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.splitStringIntoLines(h,d,!0)}else for(let a=0;a<r.length;a++){let d=r[a].mod,h=r[a].text;this.lines.append(h,d)}this.lines.newLine()}}else if(t.maxWdt>0)for(let o=0;o<s;o++)this.splitStringIntoLines(i[o]);else for(let o=0;o<s;o++)this.lines.newLine(i[o]);return this.lines.finalize()}decodeMarkupSystem(e){let t="none";return e==="markdown"||e==="md"?t="markdown":(e===!0||e==="html")&&(t="html"),t}splitHtmlBlocks(e){let t=new ki(e),i=s=>/&/.test(s)?(t.replace(t.text,"&lt;","<")||t.replace(t.text,"&amp;","&")||t.add("&"),!0):!1;for(;t.position<t.text.length;){let s=t.text.charAt(t.position);t.parseWS(s)||/</.test(s)&&(t.parseStartTag("bold","<b>")||t.parseStartTag("ital","<i>")||t.parseStartTag("mono","<code>")||t.parseEndTag("bold","</b>")||t.parseEndTag("ital","</i>")||t.parseEndTag("mono","</code>"))||i(s)||t.add(s),t.position++}return t.emitBlock(),t.blocks}splitMarkdownBlocks(e){let t=new ki(e),i=!0,s=o=>/\\/.test(o)?(t.position<this.text.length+1&&(t.position++,o=this.text.charAt(t.position),/ \t/.test(o)?t.spacing=!0:(t.add(o),i=!1)),!0):!1;for(;t.position<t.text.length;){let o=t.text.charAt(t.position);t.parseWS(o)||s(o)||(i||t.spacing)&&(t.parseStartTag("bold","*")||t.parseStartTag("ital","_")||t.parseStartTag("mono","`"))||t.parseEndTag("bold","*","afterBold")||t.parseEndTag("ital","_","afterItal")||t.parseEndTag("mono","`","afterMono")||(t.add(o),i=!1),t.position++}return t.emitBlock(),t.blocks}splitBlocks(e,t){let i=this.decodeMarkupSystem(t);if(i==="none")return[{text:e,mod:"normal"}];if(i==="markdown")return this.splitMarkdownBlocks(e);if(i==="html")return this.splitHtmlBlocks(e)}overMaxWidth(e){let t=this.ctx.measureText(e).width;return this.lines.curWidth()+t>this.parent.fontOptions.maxWdt}getLongestFit(e){let t="",i=0;for(;i<e.length;){let o=t+(t===""?"":" ")+e[i];if(this.overMaxWidth(o))break;t=o,i++}return i}getLongestFitWord(e){let t=0;for(;t<e.length&&!this.overMaxWidth(e.slice(0,t));)t++;return t}splitStringIntoLines(e,t="normal",i=!1){this.parent.getFormattingValues(this.ctx,this.selected,this.hover,t),e=e.replace(/^( +)/g,"$1\r"),e=e.replace(/([^\r][^ ]*)( +)/g,"$1\r$2\r");let s=e.split("\r");for(;s.length>0;){let o=this.getLongestFit(s);if(o===0){let r=s[0],a=this.getLongestFitWord(r);this.lines.newLine(r.slice(0,a),t),s[0]=r.slice(a)}else{let r=o;s[o-1]===" "?o--:s[r]===" "&&r++;let a=s.slice(0,o).join("");o==s.length&&i?this.lines.append(a,t):this.lines.newLine(a,t),s=s.slice(r)}}}},Ut=["bold","ital","boldital","mono"],Ye=class{constructor(e,t,i=!1){this.body=e,this.pointToSelf=!1,this.baseSize=void 0,this.fontOptions={},this.setOptions(t),this.size={top:0,left:0,width:0,height:0,yLine:0},this.isEdgeLabel=i}setOptions(e){if(this.elementOptions=e,this.initFontOptions(e.font),qt(e.label)?this.labelDirty=!0:e.label=void 0,e.font!==void 0&&e.font!==null){if(typeof e.font=="string")this.baseSize=this.fontOptions.size;else if(typeof e.font=="object"){let t=e.font.size;t!==void 0&&(this.baseSize=t)}}}initFontOptions(e){if(I(Ut,t=>{this.fontOptions[t]={}}),Ye.parseFontString(this.fontOptions,e)){this.fontOptions.vadjust=0;return}I(e,(t,i)=>{t!=null&&typeof t!="object"&&(this.fontOptions[i]=t)})}static parseFontString(e,t){if(!t||typeof t!="string")return!1;let i=t.split(" ");return e.size=+i[0].replace("px",""),e.face=i[1],e.color=i[2],!0}constrain(e){let t={constrainWidth:!1,maxWdt:-1,minWdt:-1,constrainHeight:!1,minHgt:-1,valign:"middle"},i=Ee(e,"widthConstraint");if(typeof i=="number")t.maxWdt=Number(i),t.minWdt=Number(i);else if(typeof i=="object"){let o=Ee(e,["widthConstraint","maximum"]);typeof o=="number"&&(t.maxWdt=Number(o));let r=Ee(e,["widthConstraint","minimum"]);typeof r=="number"&&(t.minWdt=Number(r))}let s=Ee(e,"heightConstraint");if(typeof s=="number")t.minHgt=Number(s);else if(typeof s=="object"){let o=Ee(e,["heightConstraint","minimum"]);typeof o=="number"&&(t.minHgt=Number(o));let r=Ee(e,["heightConstraint","valign"]);typeof r=="string"&&(r==="top"||r==="bottom")&&(t.valign=r)}return t}update(e,t){this.setOptions(e,!0),this.propagateFonts(t),D(this.fontOptions,this.constrain(t)),this.fontOptions.chooser=Ci("label",t)}adjustSizes(e){let t=e?e.right+e.left:0;this.fontOptions.constrainWidth&&(this.fontOptions.maxWdt-=t,this.fontOptions.minWdt-=t);let i=e?e.top+e.bottom:0;this.fontOptions.constrainHeight&&(this.fontOptions.minHgt-=i)}addFontOptionsToPile(e,t){for(let i=0;i<t.length;++i)this.addFontToPile(e,t[i])}addFontToPile(e,t){if(t===void 0||t.font===void 0||t.font===null)return;let i=t.font;e.push(i)}getBasicOptions(e){let t={};for(let i=0;i<e.length;++i){let s=e[i],o={};Ye.parseFontString(o,s)&&(s=o),I(s,(r,a)=>{r!==void 0&&(Object.prototype.hasOwnProperty.call(t,a)||(Ut.indexOf(a)!==-1?t[a]={}:t[a]=r))})}return t}getFontOption(e,t,i){let s;for(let o=0; Line truncated
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
+5 -5
View File
@@ -42,11 +42,6 @@ const csrftoken = getCookie('csrftoken')
// Render vis graph
let graph = null // vis graph instance
let searchParams = new URLSearchParams(window.location.search)
let group_sites = searchParams.get('group_sites')
let group_locations = searchParams.get('group_locations')
let group_racks = searchParams.get('group_racks')
const container = document.querySelector('#visgraph')
const coordSaveCheckbox = document.querySelector('#id_save_coords')
;(function handleLoadData() {
@@ -74,6 +69,11 @@ const coordSaveCheckbox = document.querySelector('#id_save_coords')
title: htmlTitle(node.title)
}))
)
const group_sites = topologyData.options.group_sites
const group_locations = topologyData.options.group_locations
const group_racks = topologyData.options.group_racks
graph = new Network(container, { nodes, edges }, options)
graph.fit()
+5 -1
View File
@@ -107,6 +107,10 @@ def get_model_role(model: Type[Model]) -> Role:
)
def get_query_settings(request):
filter_id = ''
if "filter_id" in request.GET:
filter_id = request.GET["filter_id"]
save_coords = False
if "save_coords" in request.GET:
if request.GET["save_coords"] == "on":
@@ -174,7 +178,7 @@ def get_query_settings(request):
if request.GET["show_neighbors"] == "on" :
show_neighbors = True
return save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors
return filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors
class LinePattern():
wireless = [2, 10, 2, 10]
+33 -2
View File
@@ -27,7 +27,7 @@ from django.db.models.functions import Lower
from django.http import HttpRequest, HttpResponseRedirect, QueryDict
from django.shortcuts import render, get_object_or_404
from django.views.generic import View
from extras.models import Tag
from extras.models import Tag, SavedFilter
from wireless.models import WirelessLink
from netbox.views.generic import (
ObjectView,
@@ -351,6 +351,7 @@ def get_topology_data(
nodes_devices = {}
edges = []
nodes = []
options = {}
edge_ids = 0
nodes_circuits: Dict[int, Circuit] = {}
nodes_powerpanel: Dict[int, PowerPanel] = {}
@@ -664,6 +665,13 @@ def get_topology_data(
)
)
if group_locations:
options['group_locations'] = 'on'
if group_racks:
options['group_racks'] = 'on'
if group_sites:
options['group_sites'] = 'on'
for qs_device in queryset:
if qs_device.pk not in nodes_devices and show_unconnected:
nodes_devices[qs_device.pk] = qs_device
@@ -676,6 +684,7 @@ def get_topology_data(
results["nodes"] = nodes
results["edges"] = edges
results["group"] = group_id
results["options"] = options
return results
@@ -701,8 +710,30 @@ class TopologyHomeView(PermissionRequiredMixin, View):
if request.GET:
save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors = get_query_settings(request)
filter_id, save_coords, show_unconnected, show_power, show_circuit, show_logical_connections, show_single_cable_logical_conns, show_cables, show_wireless, group_sites, group_locations, group_racks, show_neighbors = get_query_settings(request)
# Read options from saved filters as NetBox does not handle custom plugin filters
if "filter_id" in request.GET and request.GET["filter_id"] != '':
try:
saved_filter = SavedFilter.objects.get(pk=filter_id)
saved_filter_params = getattr(saved_filter, 'parameters')
if save_coords == False and 'save_coords' in saved_filter_params: save_coords = saved_filter_params['save_coords']
if show_power == False and 'show_power' in saved_filter_params: show_power = saved_filter_params['show_power']
if show_circuit == False and 'show_circuit' in saved_filter_params: show_circuit = saved_filter_params['show_circuit']
if show_logical_connections == False and 'show_logical_connections' in saved_filter_params: show_logical_connections = saved_filter_params['show_logical_connections']
if show_single_cable_logical_conns == False and 'show_single_cable_logical_conns' in saved_filter_params: show_single_cable_logical_conns = saved_filter_params['show_single_cable_logical_conns']
if show_cables == False and 'show_cables' in saved_filter_params: show_cables = saved_filter_params['show_cables']
if show_wireless == False and 'show_wireless' in saved_filter_params: show_wireless = saved_filter_params['show_wireless']
if group_sites == False and 'group_sites' in saved_filter_params: group_sites = saved_filter_params['group_sites']
if group_locations == False and 'group_locations' in saved_filter_params: group_locations = saved_filter_params['group_locations']
if group_racks == False and 'group_racks' in saved_filter_params: group_racks = saved_filter_params['group_racks']
if show_neighbors == False and 'show_neighbors' in saved_filter_params: show_neighbors = saved_filter_params['show_neighbors']
except SavedFilter.DoesNotExist: # filter_id not found
pass
except Exception as inst:
print(type(inst))
if "group" not in request.GET:
group_id = "default"
else: