libpetri 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-4L6JVKH4.js → chunk-B2CV5M3L.js} +64 -2
- package/dist/chunk-B2CV5M3L.js.map +1 -0
- package/dist/chunk-RNWTYK5B.js +419 -0
- package/dist/chunk-RNWTYK5B.js.map +1 -0
- package/dist/debug/index.js +1 -1
- package/dist/doclet/index.js +2 -2
- package/dist/doclet/resources/petrinet-diagrams.css +256 -0
- package/dist/doclet/resources/petrinet-diagrams.js +30 -6
- package/dist/dot-exporter-WJMCJEFK.js +8 -0
- package/dist/export/index.d.ts +2 -2
- package/dist/export/index.js +1 -1
- package/dist/render-QK57X4TP.js +73 -0
- package/dist/render-QK57X4TP.js.map +1 -0
- package/dist/viewer/index.d.ts +32 -1
- package/dist/viewer/index.js +510 -75
- package/dist/viewer/index.js.map +1 -1
- package/dist/viewer/layout/index.d.ts +200 -0
- package/dist/viewer/layout/index.js +15 -0
- package/dist/viewer/layout/index.js.map +1 -0
- package/dist/viewer/viewer-static.iife.js +2 -2
- package/dist/viewer/viewer.css +256 -0
- package/dist/viewer/viewer.iife.js +30 -6
- package/package.json +12 -1
- package/dist/chunk-4L6JVKH4.js.map +0 -1
- package/dist/dot-exporter-PMHOQHZ3.js +0 -8
- package/dist/render-P6GROU7J.js +0 -16
- package/dist/render-P6GROU7J.js.map +0 -1
- /package/dist/{dot-exporter-PMHOQHZ3.js.map → dot-exporter-WJMCJEFK.js.map} +0 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! libpetri viewer (IIFE) — generated, do not edit; source: typescript/src/viewer/ */
|
|
2
|
-
"use strict";(()=>{var Er=Object.create;var Te=Object.defineProperty;var Tr=Object.getOwnPropertyDescriptor;var Ar=Object.getOwnPropertyNames;var Lr=Object.getPrototypeOf,Mr=Object.prototype.hasOwnProperty;var Or=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ot=(t,e)=>{for(var r in e)Te(t,r,{get:e[r],enumerable:!0})},zr=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of Ar(e))!Mr.call(t,u)&&u!==r&&Te(t,u,{get:()=>e[u],enumerable:!(i=Tr(e,u))||i.enumerable});return t};var Br=(t,e,r)=>(r=t!=null?Er(Lr(t)):{},zr(e||!t||!t.__esModule?Te(r,"default",{value:t,enumerable:!0}):r,t));var at=N((hn,ce)=>{ce.exports=it;ce.exports.addWheelListener=it;ce.exports.removeWheelListener=Fr;function it(t,e,r){t.addEventListener("wheel",e,r)}function Fr(t,e,r){t.removeEventListener("wheel",e,r)}});var dt=N((gn,ft)=>{var Vr=4,kr=.001,Dr=1e-7,Pr=10,Q=11,ue=1/(Q-1),Ir=typeof Float32Array=="function";function lt(t,e){return 1-3*e+3*t}function st(t,e){return 3*e-6*t}function ct(t){return 3*t}function fe(t,e,r){return((lt(e,r)*t+st(e,r))*t+ct(e))*t}function ut(t,e,r){return 3*lt(e,r)*t*t+2*st(e,r)*t+ct(e)}function Nr(t,e,r,i,u){var c,o,v=0;do o=e+(r-e)/2,c=fe(o,i,u)-t,c>0?r=o:e=o;while(Math.abs(c)>Dr&&++v<Pr);return o}function _r(t,e,r,i){for(var u=0;u<Vr;++u){var c=ut(e,r,i);if(c===0)return e;var o=fe(e,r,i)-t;e-=o/c}return e}function qr(t){return t}ft.exports=function(e,r,i,u){if(!(0<=e&&e<=1&&0<=i&&i<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===r&&i===u)return qr;for(var c=Ir?new Float32Array(Q):new Array(Q),o=0;o<Q;++o)c[o]=fe(o*ue,e,i);function v(p){for(var f=0,d=1,y=Q-1;d!==y&&c[d]<=p;++d)f+=ue;--d;var x=(p-c[d])/(c[d+1]-c[d]),h=f+x*ue,L=ut(h,e,i);return L>=kr?_r(p,h,e,i):L===0?h:Nr(p,f,f+ue,e,i)}return function(f){return f===0?0:f===1?1:fe(v(f),r,u)}}});var ht=N((yn,de)=>{var X=dt(),mt={ease:X(.25,.1,.25,1),easeIn:X(.42,0,1,1),easeOut:X(0,0,.58,1),easeInOut:X(.42,0,.58,1),linear:X(0,0,1,1)};de.exports=Zr;de.exports.makeAggregateRaf=vt;de.exports.sharedScheduler=vt();function Zr(t,e,r){var i=Object.create(null),u=Object.create(null);r=r||{};var c=typeof r.easing=="function"?r.easing:mt[r.easing];c||(r.easing&&console.warn("Unknown easing function in amator: "+r.easing),c=mt.ease);var o=typeof r.step=="function"?r.step:pt,v=typeof r.done=="function"?r.done:pt,p=Rr(r.scheduler),f=Object.keys(e);f.forEach(function(S){i[S]=t[S],u[S]=e[S]-t[S]});var d=typeof r.duration=="number"?r.duration:400,y=Math.max(1,d*.06),x,h=0;return x=p.next(B),{cancel:L};function L(){p.cancel(x),x=0}function B(){var S=c(h/y);h+=1,F(S),h<=y?(x=p.next(B),o(t)):(x=0,setTimeout(function(){v(t)},0))}function F(S){f.forEach(function(P){t[P]=u[P]*S+i[P]})}}function pt(){}function Rr(t){if(!t){var e=typeof window<"u"&&window.requestAnimationFrame;return e?Gr():Hr()}if(typeof t.next!="function")throw new Error("Scheduler is supposed to have next(cb) function");if(typeof t.cancel!="function")throw new Error("Scheduler is supposed to have cancel(handle) function");return t}function Gr(){return{next:window.requestAnimationFrame.bind(window),cancel:window.cancelAnimationFrame.bind(window)}}function Hr(){return{next:function(t){return setTimeout(t,1e3/60)},cancel:function(t){return clearTimeout(t)}}}function vt(){var t=new Set,e=new Set,r=0;return{next:u,cancel:u,clearAll:i};function i(){t.clear(),e.clear(),cancelAnimationFrame(r),r=0}function u(p){e.add(p),c()}function c(){r||(r=requestAnimationFrame(o))}function o(){r=0;var p=e;e=t,t=p,t.forEach(function(f){f()}),t.clear()}function v(p){e.delete(p)}}});var yt=N((xn,gt)=>{"use strict";function Wr(t){Yr(t);let e=jr(t);return t.on=e.on,t.off=e.off,t.fire=e.fire,t}function jr(t){let e=Object.create(null);return{on:function(r,i,u){if(typeof i!="function")throw new Error("callback is expected to be a function");let c=e[r];return c||(c=e[r]=[]),c.push({callback:i,ctx:u}),t},off:function(r,i){if(typeof r>"u")return e=Object.create(null),t;if(e[r])if(typeof i!="function")delete e[r];else{let u=e[r];for(let c=0;c<u.length;++c)u[c].callback===i&&u.splice(c,1)}return t},fire:function(r){let i=e[r];if(!i)return t;let u;arguments.length>1&&(u=Array.prototype.slice.call(arguments,1));for(let c=0;c<i.length;++c){let o=i[c];o.callback.apply(o.ctx,u)}return t}}}function Yr(t){if(!t)throw new Error("Eventify cannot use falsy object as events subject");let e=["on","fire","off"];for(let r=0;r<e.length;++r)if(t.hasOwnProperty(e[r]))throw new Error("Subject cannot be eventified, since it already has property '"+e[r]+"'")}gt.exports=Wr});var bt=N((bn,xt)=>{xt.exports=$r;function $r(t,e,r){typeof r!="object"&&(r={});var i=typeof r.minVelocity=="number"?r.minVelocity:5,u=typeof r.amplitude=="number"?r.amplitude:.25,c=typeof r.cancelAnimationFrame=="function"?r.cancelAnimationFrame:Ur(),o=typeof r.requestAnimationFrame=="function"?r.requestAnimationFrame:Kr(),v,p,f=342,d,y,x,h,L,B,F,S;return{start:A,stop:g,cancel:P};function P(){c(d),c(S)}function A(){v=t(),h=F=y=L=0,p=new Date,c(d),c(S),d=o(m)}function m(){var C=Date.now(),O=C-p;p=C;var V=t(),k=V.x-v.x,q=V.y-v.y;v=V;var z=1e3/(1+O);y=.8*k*z+.2*y,L=.8*q*z+.2*L,d=o(m)}function g(){c(d),c(S);var C=t();x=C.x,B=C.y,p=Date.now(),(y<-i||y>i)&&(h=u*y,x+=h),(L<-i||L>i)&&(F=u*L,B+=F),S=o(w)}function w(){var C=Date.now()-p,O=!1,V=0,k=0;h&&(V=-h*Math.exp(-C/f),V>.5||V<-.5?O=!0:V=h=0),F&&(k=-F*Math.exp(-C/f),k>.5||k<-.5?O=!0:k=F=0),O&&(e(x+V,B+k),S=o(w))}}function Ur(){return typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout}function Kr(){return typeof requestAnimationFrame=="function"?requestAnimationFrame:function(t){return setTimeout(t,16)}}});var Et=N((wn,Ct)=>{Ct.exports=Jr;function Jr(t){if(t)return{capture:St,release:St};var e,r,i,u=!1;return{capture:c,release:o};function c(v){u=!0,r=window.document.onselectstart,i=window.document.ondragstart,window.document.onselectstart=wt,e=v,e.ondragstart=wt}function o(){u&&(u=!1,window.document.onselectstart=r,e&&(e.ondragstart=i))}}function wt(t){return t.stopPropagation(),!1}function St(){}});var At=N((Sn,Tt)=>{Tt.exports=Qr;function Qr(){this.x=0,this.y=0,this.scale=1}});var Mt=N((Cn,Ae)=>{Ae.exports=Xr;Ae.exports.canAttach=Lt;function Xr(t,e){if(!Lt(t))throw new Error("svg element is required for svg.panzoom to work");var r=t.ownerSVGElement;if(!r)throw new Error("Do not apply panzoom to the root <svg> element. Use its child instead (e.g. <g></g>). As of March 2016 only FireFox supported transform on the root element");e.disableKeyboardInteraction||r.setAttribute("tabindex",0);var i={getBBox:c,getScreenCTM:o,getOwner:u,applyTransform:p,initTransform:v};return i;function u(){return r}function c(){var f=t.getBBox();return{left:f.x,top:f.y,width:f.width,height:f.height}}function o(){var f=r.getCTM();return f||r.getScreenCTM()}function v(f){var d=t.getCTM();d===null&&(d=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix()),f.x=d.e,f.y=d.f,f.scale=d.a,r.removeAttributeNS(null,"viewBox")}function p(f){t.setAttribute("transform","matrix("+f.scale+" 0 0 "+f.scale+" "+f.x+" "+f.y+")")}}function Lt(t){return t&&t.ownerSVGElement&&t.getCTM}});var zt=N((En,Le)=>{Le.exports=en;Le.exports.canAttach=Ot;function en(t,e){var r=Ot(t);if(!r)throw new Error("panzoom requires DOM element to be attached to the DOM tree");var i=t.parentElement;t.scrollTop=0,e.disableKeyboardInteraction||i.setAttribute("tabindex",0);var u={getBBox:o,getOwner:c,applyTransform:v};return u;function c(){return i}function o(){return{left:0,top:0,width:t.clientWidth,height:t.clientHeight}}function v(p){t.style.transformOrigin="0 0 0",t.style.transform="matrix("+p.scale+", 0, 0, "+p.scale+", "+p.x+", "+p.y+")"}}function Ot(t){return t&&t.parentElement&&t.style}});var Zt=N((Tn,qt)=>{"use strict";var Bt=at(),Me=ht(),tn=yt(),rn=bt(),Nt=Et(),nn=Nt(),on=Nt(!0),an=At(),Ft=Mt(),Vt=zt(),ln=1,sn=1.75,kt=300,Dt=200;qt.exports=_t;function _t(t,e){e=e||{};var r=e.controller;if(r||(Ft.canAttach(t)?r=Ft(t,e):Vt.canAttach(t)&&(r=Vt(t,e))),!r)throw new Error("Cannot create panzoom for the current type of dom element");var i=r.getOwner(),u={x:0,y:0},c=!1,o=new an;r.initTransform&&r.initTransform(o);var v=typeof e.filterKey=="function"?e.filterKey:$,p=typeof e.pinchSpeed=="number"?e.pinchSpeed:1,f=e.bounds,d=typeof e.maxZoom=="number"?e.maxZoom:Number.POSITIVE_INFINITY,y=typeof e.minZoom=="number"?e.minZoom:0,x=typeof e.boundsPadding=="number"?e.boundsPadding:.05,h=typeof e.zoomDoubleClickSpeed=="number"?e.zoomDoubleClickSpeed:sn,L=e.beforeWheel||$,B=e.beforeMouseDown||$,F=typeof e.zoomSpeed=="number"?e.zoomSpeed:ln,S=Pt(e.transformOrigin),P=e.enableTextSelection?on:nn;cn(f),e.autocenter&&er();var A,m=0,g=0,w=0,C=null,O=new Date,V,k=!1,q=!1,z,D,ge,ye,xe,I;"smoothScroll"in e&&!e.smoothScroll?I=un():I=rn(ur,vr,e.smoothScroll);var be,U,te,re=!1;Ne();var ne={dispose:hr,moveBy:H,moveTo:we,smoothMoveTo:pr,centerOn:mr,zoomTo:le,zoomAbs:oe,smoothZoom:ae,smoothZoomAbs:Cr,showRectangle:Xt,pause:Kt,resume:Jt,isPaused:Qt,getTransform:tr,getMinZoom:rr,setMinZoom:nr,getMaxZoom:or,setMaxZoom:ir,getTransformOrigin:ar,setTransformOrigin:lr,getZoomSpeed:sr,setZoomSpeed:cr};tn(ne);var Fe=typeof e.initialX=="number"?e.initialX:o.x,Ve=typeof e.initialY=="number"?e.initialY:o.y,ke=typeof e.initialZoom=="number"?e.initialZoom:o.scale;return(Fe!=o.x||Ve!=o.y||ke!=o.scale)&&oe(Fe,Ve,ke),ne;function Kt(){_e(),re=!0}function Jt(){re&&(Ne(),re=!1)}function Qt(){return re}function Xt(n){var a=i.getBoundingClientRect(),l=Z(a.width,a.height),s=n.right-n.left,b=n.bottom-n.top;if(!Number.isFinite(s)||!Number.isFinite(b))throw new Error("Invalid rectangle");var E=l.x/s,T=l.y/b,M=Math.min(E,T);o.x=-(n.left+s/2)*M+l.x/2,o.y=-(n.top+b/2)*M+l.y/2,o.scale=M}function Z(n,a){if(r.getScreenCTM){var l=r.getScreenCTM(),s=l.a,b=l.d,E=l.e,T=l.f;u.x=n*s-E,u.y=a*b-T}else u.x=n,u.y=a;return u}function er(){var n,a,l=0,s=0,b=Pe();if(b)l=b.left,s=b.top,n=b.right-b.left,a=b.bottom-b.top;else{var E=i.getBoundingClientRect();n=E.width,a=E.height}var T=r.getBBox();if(!(T.width===0||T.height===0)){var M=a/T.height,j=n/T.width,R=Math.min(j,M);o.x=-(T.left+T.width/2)*R+n/2+l,o.y=-(T.top+T.height/2)*R+a/2+s,o.scale=R}}function tr(){return o}function rr(){return y}function nr(n){y=n}function or(){return d}function ir(n){d=n}function ar(){return S}function lr(n){S=Pt(n)}function sr(){return F}function cr(n){if(!Number.isFinite(n))throw new Error("Zoom speed should be a number");F=n}function ur(){return{x:o.x,y:o.y}}function we(n,a){o.x=n,o.y=a,Se(),W("pan"),Ce()}function De(n,a){we(o.x+n,o.y+a)}function Se(){var n=Pe();if(n){var a=!1,l=fr(),s=n.left-l.right;return s>0&&(o.x+=s,a=!0),s=n.right-l.left,s<0&&(o.x+=s,a=!0),s=n.top-l.bottom,s>0&&(o.y+=s,a=!0),s=n.bottom-l.top,s<0&&(o.y+=s,a=!0),a}}function Pe(){if(f){if(typeof f=="boolean"){var n=i.getBoundingClientRect(),a=n.width,l=n.height;return{left:a*x,top:l*x,right:a*(1-x),bottom:l*(1-x)}}return f}}function fr(){var n=r.getBBox(),a=dr(n.left,n.top);return{left:a.x,top:a.y,right:n.width*o.scale+a.x,bottom:n.height*o.scale+a.y}}function dr(n,a){return{x:n*o.scale+o.x,y:a*o.scale+o.y}}function Ce(){c=!0,A=window.requestAnimationFrame(gr)}function Ie(n,a,l){if(Oe(n)||Oe(a)||Oe(l))throw new Error("zoom requires valid numbers");var s=o.scale*l;if(s<y){if(o.scale===y)return;l=y/o.scale}if(s>d){if(o.scale===d)return;l=d/o.scale}var b=Z(n,a);if(o.x=b.x-l*(b.x-o.x),o.y=b.y-l*(b.y-o.y),f&&x===1&&y===1)o.scale*=l,Se();else{var E=Se();E||(o.scale*=l)}W("zoom"),Ce()}function oe(n,a,l){var s=l/o.scale;Ie(n,a,s)}function mr(n){var a=n.ownerSVGElement;if(!a)throw new Error("ui element is required to be within the scene");var l=n.getBoundingClientRect(),s=l.left+l.width/2,b=l.top+l.height/2,E=a.getBoundingClientRect(),T=E.width/2-s,M=E.height/2-b;H(T,M,!0)}function pr(n,a){H(n-o.x,a-o.y,!0)}function H(n,a,l){if(!l)return De(n,a);be&&be.cancel();var s={x:0,y:0},b={x:n,y:a},E=0,T=0;be=Me(s,b,{step:function(M){De(M.x-E,M.y-T),E=M.x,T=M.y}})}function vr(n,a){se(),we(n,a)}function hr(){_e()}function Ne(){i.addEventListener("mousedown",Ye,{passive:!1}),i.addEventListener("dblclick",je,{passive:!1}),i.addEventListener("touchstart",Ze,{passive:!1}),i.addEventListener("keydown",qe,{passive:!1}),Bt.addWheelListener(i,Qe,{passive:!1}),Ce()}function _e(){Bt.removeWheelListener(i,Qe),i.removeEventListener("mousedown",Ye),i.removeEventListener("keydown",qe),i.removeEventListener("dblclick",je),i.removeEventListener("touchstart",Ze),A&&(window.cancelAnimationFrame(A),A=0),I.cancel(),Ke(),Je(),P.release(),Ee()}function gr(){c&&yr()}function yr(){c=!1,r.applyTransform(o),W("transform"),A=0}function qe(n){var a=0,l=0,s=0;if(n.keyCode===38?l=1:n.keyCode===40?l=-1:n.keyCode===37?a=1:n.keyCode===39?a=-1:n.keyCode===189||n.keyCode===109?s=1:(n.keyCode===187||n.keyCode===107)&&(s=-1),!v(n,a,l,s)){if(a||l){n.preventDefault(),n.stopPropagation();var b=i.getBoundingClientRect(),E=Math.min(b.width,b.height),T=.05,M=E*T*a,j=E*T*l;H(M,j)}if(s){var R=Xe(s*100),E=S?J():xr();le(E.x,E.y,R)}}}function xr(){var n=i.getBoundingClientRect();return{x:n.width/2,y:n.height/2}}function Ze(n){if(br(n),K(),n.touches.length===1)return Sr(n,n.touches[0]);n.touches.length===2&&(xe=We(n.touches[0],n.touches[1]),te=!0,Re())}function br(n){e.onTouch&&!e.onTouch(n)||(n.stopPropagation(),n.preventDefault())}function wr(n){K(),!(e.onDoubleClick&&!e.onDoubleClick(n))&&(n.preventDefault(),n.stopPropagation())}function Sr(n){g=new Date;var a=n.touches[0],l=_(a);V=l;var s=Z(l.x,l.y);z=s.x,D=s.y,ge=z,ye=D,I.cancel(),Re()}function Re(){k||(k=!0,document.addEventListener("touchmove",Ge),document.addEventListener("touchend",ie),document.addEventListener("touchcancel",ie))}function Ge(n){if(n.touches.length===1){n.stopPropagation();var a=n.touches[0],l=_(a),s=Z(l.x,l.y),b=s.x-z,E=s.y-D;b!==0&&E!==0&&et(),z=s.x,D=s.y,H(b,E)}else if(n.touches.length===2){te=!0;var T=n.touches[0],M=n.touches[1],j=We(T,M),R=1+(j/xe-1)*p,rt=_(T),nt=_(M);if(z=(rt.x+nt.x)/2,D=(rt.y+nt.y)/2,S){var l=J();z=l.x,D=l.y}le(z,D,R),xe=j,n.stopPropagation(),n.preventDefault()}}function K(){w&&(clearTimeout(w),w=0)}function He(n){if(e.onClick){K();var a=z-ge,l=D-ye,s=Math.sqrt(a*a+l*l);s>5||(w=setTimeout(function(){w=0,e.onClick(n)},kt))}}function ie(n){if(K(),n.touches.length>0){var a=_(n.touches[0]),l=Z(a.x,a.y);z=l.x,D=l.y}else{var s=new Date;if(s-m<kt)if(S){var a=J();ae(a.x,a.y,h)}else ae(V.x,V.y,h);else s-g<Dt&&He(n);m=s,Ee(),Je()}}function We(n,a){var l=n.clientX-a.clientX,s=n.clientY-a.clientY;return Math.sqrt(l*l+s*s)}function je(n){wr(n);var a=_(n);S&&(a=J()),ae(a.x,a.y,h)}function Ye(n){if(K(),!B(n)){if(C=n,O=new Date,k)return n.stopPropagation(),!1;var a=n.button===1&&window.event!==null||n.button===0;if(a){I.cancel();var l=_(n),s=Z(l.x,l.y);return ge=z=s.x,ye=D=s.y,document.addEventListener("mousemove",$e),document.addEventListener("mouseup",Ue),P.capture(n.target||n.srcElement),!1}}}function $e(n){if(!k){et();var a=_(n),l=Z(a.x,a.y),s=l.x-z,b=l.y-D;z=l.x,D=l.y,H(s,b)}}function Ue(){var n=new Date;n-O<Dt&&He(C),P.release(),Ee(),Ke()}function Ke(){document.removeEventListener("mousemove",$e),document.removeEventListener("mouseup",Ue),q=!1}function Je(){document.removeEventListener("touchmove",Ge),document.removeEventListener("touchend",ie),document.removeEventListener("touchcancel",ie),q=!1,te=!1,k=!1}function Qe(n){if(!L(n)){I.cancel();var a=n.deltaY;n.deltaMode>0&&(a*=100);var l=Xe(a);if(l!==1){var s=S?J():_(n);le(s.x,s.y,l),n.preventDefault()}}}function _(n){var a,l,s=i.getBoundingClientRect();return a=n.clientX-s.left,l=n.clientY-s.top,{x:a,y:l}}function ae(n,a,l){var s=o.scale,b={scale:s},E={scale:l*s};I.cancel(),se(),U=Me(b,E,{step:function(T){oe(n,a,T.scale)},done:tt})}function Cr(n,a,l){var s=o.scale,b={scale:s},E={scale:l};I.cancel(),se(),U=Me(b,E,{step:function(T){oe(n,a,T.scale)},done:tt})}function J(){var n=i.getBoundingClientRect();return{x:n.width*S.x,y:n.height*S.y}}function le(n,a,l){return I.cancel(),se(),Ie(n,a,l)}function se(){U&&(U.cancel(),U=null)}function Xe(n){var a=Math.sign(n),l=Math.min(.25,Math.abs(F*n/128));return 1-a*l}function et(){q||(W("panstart"),q=!0,I.start())}function Ee(){q&&(te||I.stop(),W("panend"))}function tt(){W("zoomend")}function W(n){ne.fire(n,ne)}}function Pt(t){if(t){if(typeof t=="object")return(!Y(t.x)||!Y(t.y))&&It(t),t;It()}}function It(t){throw console.error(t),new Error(["Cannot parse transform origin.","Some good examples:",' "center center" can be achieved with {x: 0.5, y: 0.5}',' "top center" can be achieved with {x: 0.5, y: 0}',' "bottom right" can be achieved with {x: 1, y: 1}'].join(`
|
|
3
|
-
`))}function $(){}function cn(t){var e=typeof t;if(!(e==="undefined"||e==="boolean")){var r=Y(t.left)&&Y(t.top)&&Y(t.bottom)&&Y(t.right);if(!r)throw new Error("Bounds object is not valid. It can be: undefined, boolean (true|false) or an object {left, top, right, bottom}")}}function Y(t){return Number.isFinite(t)}function Oe(t){return Number.isNaN?Number.isNaN(t):t!==t}function un(){return{start:$,stop:$,cancel:$}}function fn(){if(typeof document>"u")return;var t=document.getElementsByTagName("script");if(!t)return;for(var e,r=0;r<t.length;++r){var i=t[r];if(i.src&&i.src.match(/\bpanzoom(\.min)?\.js/)){e=i;break}}if(!e)return;var u=e.getAttribute("query");if(!u)return;var c=e.getAttribute("name")||"pz",o=Date.now();v();function v(){var d=document.querySelector(u);if(!d){var y=Date.now(),x=y-o;if(x<2e3){setTimeout(v,100);return}console.error("Cannot find the panzoom element",c);return}var h=p(e);console.log(h),window[c]=_t(d,h)}function p(d){for(var y=d.attributes,x={},h=0;h<y.length;++h){var L=y[h],B=f(L);B&&(x[B.name]=B.value)}return x}function f(d){if(d.name){var y=d.name[0]==="p"&&d.name[1]==="z"&&d.name[2]==="-";if(y){var x=d.name.substr(3),h=JSON.parse(d.value);return{name:x,value:h}}}}}fn()});var Yt={};ot(Yt,{getViz:()=>pn,renderDotToSvg:()=>mn});async function mn(t){throw new Error("libpetri viewer: static bundle has no DOT renderer. Either ship the pre-rendered SVG in the host (mount(null, container, opts)) or load the full viewer.iife.js bundle.")}function pn(){throw new Error("libpetri viewer: static bundle has no Viz instance.")}var $t=Or(()=>{});var Be={};ot(Be,{DEFAULT_PANZOOM_OPTS:()=>me,VIEWER_CSS_VARIABLES:()=>ze,colorForPrefix:()=>he,discoverClusters:()=>ve,mount:()=>Ut});var Rt=Br(Zt(),1),me={smoothScroll:!1,zoomDoubleClickSpeed:1,maxZoom:1e3,minZoom:.02};function Gt(t,e,r){if(r)try{r.dispose()}catch{}let i={...me,...e};return(0,Rt.default)(t,i)}function ve(t){let e=new Map,r=t.querySelectorAll("g.cluster");if(!r.length)return e;let i=Array.from(t.querySelectorAll("g.node"));for(let u of Array.from(r)){let c=G(u,"title");if(!c)continue;let o=c.textContent??"";if(!o.startsWith("cluster_"))continue;let v=o.slice(8);if(e.has(v))continue;let p=0;for(let f of i){if(f.getAttribute("data-instance"))continue;let d=G(f,"title");if(!d)continue;let y=(d.textContent??"").trim();pe(y,v)&&(f.setAttribute("data-instance",v),p++)}e.set(v,{prefix:v,group:u,nodeCount:p,color:he(v)})}return e}function pe(t,e){return t===e||t.startsWith(`${e}/`)||t.startsWith(`p_${e}_`)||t.startsWith(`t_${e}_`)||t.startsWith(`j_${e}_`)}function he(t){let e=2166136261;for(let i=0;i<t.length;i++)e^=t.charCodeAt(i),e=e*16777619>>>0;let r=Math.floor((e/4294967296*360+e%360*.61803)%360);return r<0&&(r+=360),`hsl(${r}, 60%, 45%)`}function Ht(t){for(let e of t.values()){let r=G(e.group,"polygon")??G(e.group,"path");r&&(r.setAttribute("stroke",e.color),r.setAttribute("stroke-width","2.2"))}}function ee(t,e){let r=t.group,i=r.classList.contains("cluster-collapsed"),u=r.ownerSVGElement;if(u)if(e&&!i){r.classList.add("cluster-collapsed");let c=[];if(u.querySelectorAll(`g.node[data-instance="${dn(t.prefix)}"]`).forEach(o=>{o.classList.add("petri-collapsed-inside"),c.push(o)}),u.querySelectorAll("g.edge").forEach(o=>{let v=G(o,"title");if(!v)return;let p=(v.textContent??"").trim(),f=p.indexOf("->");if(f<0)return;let d=p.slice(0,f),y=p.slice(f+2);pe(d,t.prefix)&&pe(y,t.prefix)&&(o.classList.add("petri-collapsed-inside"),c.push(o))}),r._petriHiddenSiblings=c,!r._petriCollapsedBadge){let o=G(r,"text");if(o){let v=document.createElementNS("http://www.w3.org/2000/svg","text");v.setAttribute("x",o.getAttribute("x")??"0");let p=parseFloat(o.getAttribute("y")??"0");v.setAttribute("y",String(p+16)),v.setAttribute("text-anchor",o.getAttribute("text-anchor")??"middle"),v.setAttribute("font-size","11"),v.setAttribute("fill","#9ca3af"),v.setAttribute("class","cluster-collapsed-badge"),v.textContent=`(${t.nodeCount} internal node${t.nodeCount===1?"":"s"})`,r.appendChild(v),r._petriCollapsedBadge=v}}}else!e&&i&&(r.classList.remove("cluster-collapsed"),r._petriHiddenSiblings&&(r._petriHiddenSiblings.forEach(c=>c.classList.remove("petri-collapsed-inside")),r._petriHiddenSiblings=void 0),r._petriCollapsedBadge&&r._petriCollapsedBadge.parentNode===r&&(r.removeChild(r._petriCollapsedBadge),r._petriCollapsedBadge=null))}function Wt(t,e){if(e==null){t.removeAttribute("data-active-filter"),t.classList.remove("has-active-filter"),t.querySelectorAll("g.node, g.edge").forEach(r=>r.classList.remove("petri-dimmed"));return}t.setAttribute("data-active-filter",e),t.classList.add("has-active-filter"),t.querySelectorAll("g.node").forEach(r=>{let i=r.getAttribute("data-instance");!!i&&(i===e||i.indexOf(e+"_")===0||i.indexOf(e+"/")===0)?r.classList.remove("petri-dimmed"):r.classList.add("petri-dimmed")}),t.querySelectorAll("g.edge").forEach(r=>{let i=G(r,"title");if(!i)return;let u=i.textContent??"",c=u.indexOf("->");if(c<0){r.classList.remove("petri-dimmed");return}let o=u.slice(0,c),v=u.slice(c+2),p=f=>f.indexOf(e+"/")>=0||f.indexOf(e+"_")>=0||f===e;p(o)||p(v)?r.classList.remove("petri-dimmed"):r.classList.add("petri-dimmed")})}function jt(t,e,r,i){if(r.size===0||!t)return!1;for(let u of r)if(e.has(u)&&pe(i,u))return!0;return!1}function dn(t){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function G(t,e){let r=e.toLowerCase();for(let i of Array.from(t.children))if(i.tagName.toLowerCase()===r)return i;return null}var ze=["--lpv-bg","--lpv-header-bg","--lpv-border","--lpv-text","--lpv-muted","--lpv-cluster-bg","--lpv-cluster-bg-collapsed","--lpv-cluster-stroke-width","--lpv-cluster-stroke-dash","--lpv-cluster-fill-tint","--lpv-dim-opacity","--lpv-active-filter-outline","--lpv-legend-bg","--lpv-chip-bg","--lpv-chip-active-bg"];async function Ut(t,e,r={}){let i=r.previousHandle??null,u=i?new Set(i.collapsedPrefixes):new Set,c=i?.activeFilter??null;i&&i.dispose();let o,v=e.querySelector(":scope > svg");if(t==null){if(!(v instanceof SVGSVGElement))throw new Error("mount: no DOT source and no pre-rendered SVG");o=v}else{let{renderDotToSvg:m}=await Promise.resolve().then(()=>($t(),Yt));o=await m(t),e.innerHTML="",e.appendChild(o)}e.classList.add("libpetri-viewer");let p=Gt(o,r.panzoom),f=ve(o);Ht(f);let d=new Set,y=null,x=!1,h=null;function L(){if(!r.chrome||h&&h.parentNode===e)return;h=document.createElement("div"),h.className="libpetri-viewer-chrome",h.style.position="absolute",h.style.inset="0",h.style.pointerEvents="none";let m=document.createElement("div");m.className="diagram-legend",m.style.pointerEvents="auto",m.innerHTML='<div class="legend-title">Clusters</div>',h.appendChild(m);let g=document.createElement("div");g.className="diagram-filter-strip",g.style.pointerEvents="auto",g.innerHTML='<span class="filter-strip-label">Show only:</span>',h.appendChild(g);let w=document.createElement("div");w.className="diagram-controls",w.style.pointerEvents="auto";let C=document.createElement("button");C.type="button",C.className="diagram-btn btn-reset",C.title="Reset view",C.textContent="Reset",C.addEventListener("click",()=>A.fit());let O=document.createElement("button");O.type="button",O.className="diagram-btn btn-fullscreen",O.title="Toggle fullscreen",O.textContent="Fullscreen",O.addEventListener("click",()=>B(e,O)),w.appendChild(C),w.appendChild(O),h.appendChild(w),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e.appendChild(h),F(m),S(g)}function B(m,g){let w=m.classList.toggle("diagram-fullscreen");g.textContent=w?"Exit fullscreen":"Fullscreen",requestAnimationFrame(()=>A.fit())}function F(m){m.innerHTML='<div class="legend-title">Clusters</div>';for(let g of f.values()){let w=document.createElement("div");w.className="legend-row",w.innerHTML='<span class="legend-ribbon" style="background:'+g.color+'"></span><span class="legend-label"></span><span class="legend-count"></span>',w.querySelector(".legend-label").textContent=g.prefix,w.querySelector(".legend-count").textContent=String(g.nodeCount),w.addEventListener("click",()=>{d.has(g.prefix)?A.expand(g.prefix):A.collapse(g.prefix)}),m.appendChild(w)}}function S(m){m.innerHTML='<span class="filter-strip-label">Show only:</span>';let g=document.createElement("button");g.type="button",g.className="filter-chip filter-chip-all filter-chip-active",g.textContent="all",g.addEventListener("click",()=>{A.filter(null)}),m.appendChild(g);for(let w of f.values()){let C=document.createElement("button");C.type="button",C.className="filter-chip",C.style.borderColor=w.color,C.dataset.prefix=w.prefix,C.innerHTML='<span class="chip-dot" style="background:'+w.color+'"></span>',C.append(document.createTextNode(w.prefix)),C.addEventListener("click",()=>{y===w.prefix?A.filter(null):A.filter(w.prefix)}),m.appendChild(C)}}function P(){if(!h)return;let m=h.querySelector(".diagram-filter-strip");m&&(m.querySelectorAll(".filter-chip").forEach(g=>{g.classList.remove("filter-chip-active")}),y===null?m.querySelector(".filter-chip-all")?.classList.add("filter-chip-active"):m.querySelector(`.filter-chip[data-prefix="${y}"]`)?.classList.add("filter-chip-active"))}let A={svg:o,panzoom:p,clusters:f,get collapsedPrefixes(){return d},get activeFilter(){return y},collapse(m){if(x)return;let g=f.get(m);g&&(d.has(m)||(ee(g,!0),d.add(m),r.onClusterCollapse?.(m,!0)))},expand(m){if(x)return;let g=f.get(m);g&&d.has(m)&&(ee(g,!1),d.delete(m),r.onClusterCollapse?.(m,!1))},collapseAll(){if(!x)for(let m of f.values())d.has(m.prefix)||(ee(m,!0),d.add(m.prefix),r.onClusterCollapse?.(m.prefix,!0))},expandAll(){if(!x)for(let m of Array.from(d)){let g=f.get(m);g&&(ee(g,!1),d.delete(m),r.onClusterCollapse?.(m,!1))}},filter(m){x||(y=m,Wt(o,m),r.onClusterFilter?.(m),P())},resetZoom(){if(!x)try{p.moveTo(0,0),p.zoomAbs(0,0,1)}catch{}},fit(){if(!x)try{p.zoomAbs(0,0,1),p.moveTo(0,0)}catch{}},isInsideCollapsedCluster(m){return jt(o,f,d,m)},dispose(){if(!x){x=!0;try{p.dispose()}catch{}h&&h.parentNode===e&&e.removeChild(h),h=null}}};for(let m of u)A.collapse(m);return c!==null&&A.filter(c),L(),requestAnimationFrame(()=>A.fit()),A}globalThis.LibpetriViewer=Be;})();
|
|
2
|
+
"use strict";(()=>{var zn=Object.create;var Le=Object.defineProperty;var _n=Object.getOwnPropertyDescriptor;var In=Object.getOwnPropertyNames;var Bn=Object.getPrototypeOf,qn=Object.prototype.hasOwnProperty;var Dn=(t,e)=>()=>(t&&(e=t(t=0)),e);var q=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),st=(t,e)=>{for(var n in e)Le(t,n,{get:e[n],enumerable:!0})},Pn=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of In(e))!qn.call(t,a)&&a!==n&&Le(t,a,{get:()=>e[a],enumerable:!(o=_n(e,a))||o.enumerable});return t};var Rn=(t,e,n)=>(n=t!=null?zn(Bn(t)):{},Pn(e||!t||!t.__esModule?Le(n,"default",{value:t,enumerable:!0}):n,t));var ct=q((_r,ce)=>{ce.exports=lt;ce.exports.addWheelListener=lt;ce.exports.removeWheelListener=Zn;function lt(t,e,n){t.addEventListener("wheel",e,n)}function Zn(t,e,n){t.removeEventListener("wheel",e,n)}});var ht=q((Ir,mt)=>{var Hn=4,Wn=.001,jn=1e-7,$n=10,Q=11,ue=1/(Q-1),Yn=typeof Float32Array=="function";function ut(t,e){return 1-3*e+3*t}function dt(t,e){return 3*e-6*t}function ft(t){return 3*t}function de(t,e,n){return((ut(e,n)*t+dt(e,n))*t+ft(e))*t}function pt(t,e,n){return 3*ut(e,n)*t*t+2*dt(e,n)*t+ft(e)}function Kn(t,e,n,o,a){var s,r,d=0;do r=e+(n-e)/2,s=de(r,o,a)-t,s>0?n=r:e=r;while(Math.abs(s)>jn&&++d<$n);return r}function Un(t,e,n,o){for(var a=0;a<Hn;++a){var s=pt(e,n,o);if(s===0)return e;var r=de(e,n,o)-t;e-=r/s}return e}function Jn(t){return t}mt.exports=function(e,n,o,a){if(!(0<=e&&e<=1&&0<=o&&o<=1))throw new Error("bezier x values must be in [0, 1] range");if(e===n&&o===a)return Jn;for(var s=Yn?new Float32Array(Q):new Array(Q),r=0;r<Q;++r)s[r]=de(r*ue,e,o);function d(p){for(var l=0,f=1,h=Q-1;f!==h&&s[f]<=p;++f)l+=ue;--f;var y=(p-s[f])/(s[f+1]-s[f]),g=l+y*ue,b=pt(g,e,o);return b>=Wn?Un(p,g,e,o):b===0?g:Kn(p,l,l+ue,e,o)}return function(l){return l===0?0:l===1?1:de(d(l),n,a)}}});var bt=q((Br,fe)=>{var X=ht(),gt={ease:X(.25,.1,.25,1),easeIn:X(.42,0,1,1),easeOut:X(0,0,.58,1),easeInOut:X(.42,0,.58,1),linear:X(0,0,1,1)};fe.exports=Qn;fe.exports.makeAggregateRaf=yt;fe.exports.sharedScheduler=yt();function Qn(t,e,n){var o=Object.create(null),a=Object.create(null);n=n||{};var s=typeof n.easing=="function"?n.easing:gt[n.easing];s||(n.easing&&console.warn("Unknown easing function in amator: "+n.easing),s=gt.ease);var r=typeof n.step=="function"?n.step:vt,d=typeof n.done=="function"?n.done:vt,p=Xn(n.scheduler),l=Object.keys(e);l.forEach(function(C){o[C]=t[C],a[C]=e[C]-t[C]});var f=typeof n.duration=="number"?n.duration:400,h=Math.max(1,f*.06),y,g=0;return y=p.next(S),{cancel:b};function b(){p.cancel(y),y=0}function S(){var C=s(g/h);g+=1,T(C),g<=h?(y=p.next(S),r(t)):(y=0,setTimeout(function(){d(t)},0))}function T(C){l.forEach(function(N){t[N]=a[N]*C+o[N]})}}function vt(){}function Xn(t){if(!t){var e=typeof window<"u"&&window.requestAnimationFrame;return e?er():tr()}if(typeof t.next!="function")throw new Error("Scheduler is supposed to have next(cb) function");if(typeof t.cancel!="function")throw new Error("Scheduler is supposed to have cancel(handle) function");return t}function er(){return{next:window.requestAnimationFrame.bind(window),cancel:window.cancelAnimationFrame.bind(window)}}function tr(){return{next:function(t){return setTimeout(t,1e3/60)},cancel:function(t){return clearTimeout(t)}}}function yt(){var t=new Set,e=new Set,n=0;return{next:a,cancel:a,clearAll:o};function o(){t.clear(),e.clear(),cancelAnimationFrame(n),n=0}function a(p){e.add(p),s()}function s(){n||(n=requestAnimationFrame(r))}function r(){n=0;var p=e;e=t,t=p,t.forEach(function(l){l()}),t.clear()}function d(p){e.delete(p)}}});var xt=q((qr,St)=>{"use strict";function nr(t){or(t);let e=rr(t);return t.on=e.on,t.off=e.off,t.fire=e.fire,t}function rr(t){let e=Object.create(null);return{on:function(n,o,a){if(typeof o!="function")throw new Error("callback is expected to be a function");let s=e[n];return s||(s=e[n]=[]),s.push({callback:o,ctx:a}),t},off:function(n,o){if(typeof n>"u")return e=Object.create(null),t;if(e[n])if(typeof o!="function")delete e[n];else{let a=e[n];for(let s=0;s<a.length;++s)a[s].callback===o&&a.splice(s,1)}return t},fire:function(n){let o=e[n];if(!o)return t;let a;arguments.length>1&&(a=Array.prototype.slice.call(arguments,1));for(let s=0;s<o.length;++s){let r=o[s];r.callback.apply(r.ctx,a)}return t}}}function or(t){if(!t)throw new Error("Eventify cannot use falsy object as events subject");let e=["on","fire","off"];for(let n=0;n<e.length;++n)if(t.hasOwnProperty(e[n]))throw new Error("Subject cannot be eventified, since it already has property '"+e[n]+"'")}St.exports=nr});var Ct=q((Dr,wt)=>{wt.exports=ir;function ir(t,e,n){typeof n!="object"&&(n={});var o=typeof n.minVelocity=="number"?n.minVelocity:5,a=typeof n.amplitude=="number"?n.amplitude:.25,s=typeof n.cancelAnimationFrame=="function"?n.cancelAnimationFrame:ar(),r=typeof n.requestAnimationFrame=="function"?n.requestAnimationFrame:sr(),d,p,l=342,f,h,y,g,b,S,T,C;return{start:z,stop:v,cancel:N};function N(){s(f),s(C)}function z(){d=t(),g=T=h=b=0,p=new Date,s(f),s(C),f=r(A)}function A(){var E=Date.now(),M=E-p;p=E;var F=t(),G=F.x-d.x,B=F.y-d.y;d=F;var k=1e3/(1+M);h=.8*G*k+.2*h,b=.8*B*k+.2*b,f=r(A)}function v(){s(f),s(C);var E=t();y=E.x,S=E.y,p=Date.now(),(h<-o||h>o)&&(g=a*h,y+=g),(b<-o||b>o)&&(T=a*b,S+=T),C=r(x)}function x(){var E=Date.now()-p,M=!1,F=0,G=0;g&&(F=-g*Math.exp(-E/l),F>.5||F<-.5?M=!0:F=g=0),T&&(G=-T*Math.exp(-E/l),G>.5||G<-.5?M=!0:G=T=0),M&&(e(y+F,S+G),C=r(x))}}function ar(){return typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout}function sr(){return typeof requestAnimationFrame=="function"?requestAnimationFrame:function(t){return setTimeout(t,16)}}});var Lt=q((Pr,Vt)=>{Vt.exports=lr;function lr(t){if(t)return{capture:Et,release:Et};var e,n,o,a=!1;return{capture:s,release:r};function s(d){a=!0,n=window.document.onselectstart,o=window.document.ondragstart,window.document.onselectstart=At,e=d,e.ondragstart=At}function r(){a&&(a=!1,window.document.onselectstart=n,e&&(e.ondragstart=o))}}function At(t){return t.stopPropagation(),!1}function Et(){}});var Gt=q((Rr,Tt)=>{Tt.exports=cr;function cr(){this.x=0,this.y=0,this.scale=1}});var Mt=q((Zr,Te)=>{Te.exports=ur;Te.exports.canAttach=kt;function ur(t,e){if(!kt(t))throw new Error("svg element is required for svg.panzoom to work");var n=t.ownerSVGElement;if(!n)throw new Error("Do not apply panzoom to the root <svg> element. Use its child instead (e.g. <g></g>). As of March 2016 only FireFox supported transform on the root element");e.disableKeyboardInteraction||n.setAttribute("tabindex",0);var o={getBBox:s,getScreenCTM:r,getOwner:a,applyTransform:p,initTransform:d};return o;function a(){return n}function s(){var l=t.getBBox();return{left:l.x,top:l.y,width:l.width,height:l.height}}function r(){var l=n.getCTM();return l||n.getScreenCTM()}function d(l){var f=t.getCTM();f===null&&(f=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGMatrix()),l.x=f.e,l.y=f.f,l.scale=f.a,n.removeAttributeNS(null,"viewBox")}function p(l){t.setAttribute("transform","matrix("+l.scale+" 0 0 "+l.scale+" "+l.x+" "+l.y+")")}}function kt(t){return t&&t.ownerSVGElement&&t.getCTM}});var Ot=q((Hr,Ge)=>{Ge.exports=dr;Ge.exports.canAttach=Ft;function dr(t,e){var n=Ft(t);if(!n)throw new Error("panzoom requires DOM element to be attached to the DOM tree");var o=t.parentElement;t.scrollTop=0,e.disableKeyboardInteraction||o.setAttribute("tabindex",0);var a={getBBox:r,getOwner:s,applyTransform:d};return a;function s(){return o}function r(){return{left:0,top:0,width:t.clientWidth,height:t.clientHeight}}function d(p){t.style.transformOrigin="0 0 0",t.style.transform="matrix("+p.scale+", 0, 0, "+p.scale+", "+p.x+", "+p.y+")"}}function Ft(t){return t&&t.parentElement&&t.style}});var Ht=q((Wr,Zt)=>{"use strict";var Nt=ct(),ke=bt(),fr=xt(),pr=Ct(),Pt=Lt(),mr=Pt(),hr=Pt(!0),gr=Gt(),zt=Mt(),_t=Ot(),vr=1,yr=1.75,It=300,Bt=200;Zt.exports=Rt;function Rt(t,e){e=e||{};var n=e.controller;if(n||(zt.canAttach(t)?n=zt(t,e):_t.canAttach(t)&&(n=_t(t,e))),!n)throw new Error("Cannot create panzoom for the current type of dom element");var o=n.getOwner(),a={x:0,y:0},s=!1,r=new gr;n.initTransform&&n.initTransform(r);var d=typeof e.filterKey=="function"?e.filterKey:Y,p=typeof e.pinchSpeed=="number"?e.pinchSpeed:1,l=e.bounds,f=typeof e.maxZoom=="number"?e.maxZoom:Number.POSITIVE_INFINITY,h=typeof e.minZoom=="number"?e.minZoom:0,y=typeof e.boundsPadding=="number"?e.boundsPadding:.05,g=typeof e.zoomDoubleClickSpeed=="number"?e.zoomDoubleClickSpeed:yr,b=e.beforeWheel||Y,S=e.beforeMouseDown||Y,T=typeof e.zoomSpeed=="number"?e.zoomSpeed:vr,C=qt(e.transformOrigin),N=e.enableTextSelection?hr:mr;br(l),e.autocenter&&dn();var z,A=0,v=0,x=0,E=null,M=new Date,F,G=!1,B=!1,k,_,be,Se,xe,I;"smoothScroll"in e&&!e.smoothScroll?I=Sr():I=pr(xn,Vn,e.smoothScroll);var we,K,te,ne=!1;Pe();var re={dispose:Ln,moveBy:H,moveTo:Ce,smoothMoveTo:En,centerOn:An,zoomTo:se,zoomAbs:oe,smoothZoom:ae,smoothZoomAbs:Nn,showRectangle:un,pause:sn,resume:ln,isPaused:cn,getTransform:fn,getMinZoom:pn,setMinZoom:mn,getMaxZoom:hn,setMaxZoom:gn,getTransformOrigin:vn,setTransformOrigin:yn,getZoomSpeed:bn,setZoomSpeed:Sn};fr(re);var ze=typeof e.initialX=="number"?e.initialX:r.x,_e=typeof e.initialY=="number"?e.initialY:r.y,Ie=typeof e.initialZoom=="number"?e.initialZoom:r.scale;return(ze!=r.x||_e!=r.y||Ie!=r.scale)&&oe(ze,_e,Ie),re;function sn(){Re(),ne=!0}function ln(){ne&&(Pe(),ne=!1)}function cn(){return ne}function un(i){var c=o.getBoundingClientRect(),u=P(c.width,c.height),m=i.right-i.left,w=i.bottom-i.top;if(!Number.isFinite(m)||!Number.isFinite(w))throw new Error("Invalid rectangle");var V=u.x/m,L=u.y/w,O=Math.min(V,L);r.x=-(i.left+m/2)*O+u.x/2,r.y=-(i.top+w/2)*O+u.y/2,r.scale=O}function P(i,c){if(n.getScreenCTM){var u=n.getScreenCTM(),m=u.a,w=u.d,V=u.e,L=u.f;a.x=i*m-V,a.y=c*w-L}else a.x=i,a.y=c;return a}function dn(){var i,c,u=0,m=0,w=qe();if(w)u=w.left,m=w.top,i=w.right-w.left,c=w.bottom-w.top;else{var V=o.getBoundingClientRect();i=V.width,c=V.height}var L=n.getBBox();if(!(L.width===0||L.height===0)){var O=c/L.height,j=i/L.width,R=Math.min(j,O);r.x=-(L.left+L.width/2)*R+i/2+u,r.y=-(L.top+L.height/2)*R+c/2+m,r.scale=R}}function fn(){return r}function pn(){return h}function mn(i){h=i}function hn(){return f}function gn(i){f=i}function vn(){return C}function yn(i){C=qt(i)}function bn(){return T}function Sn(i){if(!Number.isFinite(i))throw new Error("Zoom speed should be a number");T=i}function xn(){return{x:r.x,y:r.y}}function Ce(i,c){r.x=i,r.y=c,Ae(),W("pan"),Ee()}function Be(i,c){Ce(r.x+i,r.y+c)}function Ae(){var i=qe();if(i){var c=!1,u=wn(),m=i.left-u.right;return m>0&&(r.x+=m,c=!0),m=i.right-u.left,m<0&&(r.x+=m,c=!0),m=i.top-u.bottom,m>0&&(r.y+=m,c=!0),m=i.bottom-u.top,m<0&&(r.y+=m,c=!0),c}}function qe(){if(l){if(typeof l=="boolean"){var i=o.getBoundingClientRect(),c=i.width,u=i.height;return{left:c*y,top:u*y,right:c*(1-y),bottom:u*(1-y)}}return l}}function wn(){var i=n.getBBox(),c=Cn(i.left,i.top);return{left:c.x,top:c.y,right:i.width*r.scale+c.x,bottom:i.height*r.scale+c.y}}function Cn(i,c){return{x:i*r.scale+r.x,y:c*r.scale+r.y}}function Ee(){s=!0,z=window.requestAnimationFrame(Tn)}function De(i,c,u){if(Me(i)||Me(c)||Me(u))throw new Error("zoom requires valid numbers");var m=r.scale*u;if(m<h){if(r.scale===h)return;u=h/r.scale}if(m>f){if(r.scale===f)return;u=f/r.scale}var w=P(i,c);if(r.x=w.x-u*(w.x-r.x),r.y=w.y-u*(w.y-r.y),l&&y===1&&h===1)r.scale*=u,Ae();else{var V=Ae();V||(r.scale*=u)}W("zoom"),Ee()}function oe(i,c,u){var m=u/r.scale;De(i,c,m)}function An(i){var c=i.ownerSVGElement;if(!c)throw new Error("ui element is required to be within the scene");var u=i.getBoundingClientRect(),m=u.left+u.width/2,w=u.top+u.height/2,V=c.getBoundingClientRect(),L=V.width/2-m,O=V.height/2-w;H(L,O,!0)}function En(i,c){H(i-r.x,c-r.y,!0)}function H(i,c,u){if(!u)return Be(i,c);we&&we.cancel();var m={x:0,y:0},w={x:i,y:c},V=0,L=0;we=ke(m,w,{step:function(O){Be(O.x-V,O.y-L),V=O.x,L=O.y}})}function Vn(i,c){le(),Ce(i,c)}function Ln(){Re()}function Pe(){o.addEventListener("mousedown",Ue,{passive:!1}),o.addEventListener("dblclick",Ke,{passive:!1}),o.addEventListener("touchstart",He,{passive:!1}),o.addEventListener("keydown",Ze,{passive:!1}),Nt.addWheelListener(o,tt,{passive:!1}),Ee()}function Re(){Nt.removeWheelListener(o,tt),o.removeEventListener("mousedown",Ue),o.removeEventListener("keydown",Ze),o.removeEventListener("dblclick",Ke),o.removeEventListener("touchstart",He),z&&(window.cancelAnimationFrame(z),z=0),I.cancel(),Xe(),et(),N.release(),Ve()}function Tn(){s&&Gn()}function Gn(){s=!1,n.applyTransform(r),W("transform"),z=0}function Ze(i){var c=0,u=0,m=0;if(i.keyCode===38?u=1:i.keyCode===40?u=-1:i.keyCode===37?c=1:i.keyCode===39?c=-1:i.keyCode===189||i.keyCode===109?m=1:(i.keyCode===187||i.keyCode===107)&&(m=-1),!d(i,c,u,m)){if(c||u){i.preventDefault(),i.stopPropagation();var w=o.getBoundingClientRect(),V=Math.min(w.width,w.height),L=.05,O=V*L*c,j=V*L*u;H(O,j)}if(m){var R=nt(m*100),V=C?J():kn();se(V.x,V.y,R)}}}function kn(){var i=o.getBoundingClientRect();return{x:i.width/2,y:i.height/2}}function He(i){if(Mn(i),U(),i.touches.length===1)return On(i,i.touches[0]);i.touches.length===2&&(xe=Ye(i.touches[0],i.touches[1]),te=!0,We())}function Mn(i){e.onTouch&&!e.onTouch(i)||(i.stopPropagation(),i.preventDefault())}function Fn(i){U(),!(e.onDoubleClick&&!e.onDoubleClick(i))&&(i.preventDefault(),i.stopPropagation())}function On(i){v=new Date;var c=i.touches[0],u=D(c);F=u;var m=P(u.x,u.y);k=m.x,_=m.y,be=k,Se=_,I.cancel(),We()}function We(){G||(G=!0,document.addEventListener("touchmove",je),document.addEventListener("touchend",ie),document.addEventListener("touchcancel",ie))}function je(i){if(i.touches.length===1){i.stopPropagation();var c=i.touches[0],u=D(c),m=P(u.x,u.y),w=m.x-k,V=m.y-_;w!==0&&V!==0&&rt(),k=m.x,_=m.y,H(w,V)}else if(i.touches.length===2){te=!0;var L=i.touches[0],O=i.touches[1],j=Ye(L,O),R=1+(j/xe-1)*p,it=D(L),at=D(O);if(k=(it.x+at.x)/2,_=(it.y+at.y)/2,C){var u=J();k=u.x,_=u.y}se(k,_,R),xe=j,i.stopPropagation(),i.preventDefault()}}function U(){x&&(clearTimeout(x),x=0)}function $e(i){if(e.onClick){U();var c=k-be,u=_-Se,m=Math.sqrt(c*c+u*u);m>5||(x=setTimeout(function(){x=0,e.onClick(i)},It))}}function ie(i){if(U(),i.touches.length>0){var c=D(i.touches[0]),u=P(c.x,c.y);k=u.x,_=u.y}else{var m=new Date;if(m-A<It)if(C){var c=J();ae(c.x,c.y,g)}else ae(F.x,F.y,g);else m-v<Bt&&$e(i);A=m,Ve(),et()}}function Ye(i,c){var u=i.clientX-c.clientX,m=i.clientY-c.clientY;return Math.sqrt(u*u+m*m)}function Ke(i){Fn(i);var c=D(i);C&&(c=J()),ae(c.x,c.y,g)}function Ue(i){if(U(),!S(i)){if(E=i,M=new Date,G)return i.stopPropagation(),!1;var c=i.button===1&&window.event!==null||i.button===0;if(c){I.cancel();var u=D(i),m=P(u.x,u.y);return be=k=m.x,Se=_=m.y,document.addEventListener("mousemove",Je),document.addEventListener("mouseup",Qe),N.capture(i.target||i.srcElement),!1}}}function Je(i){if(!G){rt();var c=D(i),u=P(c.x,c.y),m=u.x-k,w=u.y-_;k=u.x,_=u.y,H(m,w)}}function Qe(){var i=new Date;i-M<Bt&&$e(E),N.release(),Ve(),Xe()}function Xe(){document.removeEventListener("mousemove",Je),document.removeEventListener("mouseup",Qe),B=!1}function et(){document.removeEventListener("touchmove",je),document.removeEventListener("touchend",ie),document.removeEventListener("touchcancel",ie),B=!1,te=!1,G=!1}function tt(i){if(!b(i)){I.cancel();var c=i.deltaY;i.deltaMode>0&&(c*=100);var u=nt(c);if(u!==1){var m=C?J():D(i);se(m.x,m.y,u),i.preventDefault()}}}function D(i){var c,u,m=o.getBoundingClientRect();return c=i.clientX-m.left,u=i.clientY-m.top,{x:c,y:u}}function ae(i,c,u){var m=r.scale,w={scale:m},V={scale:u*m};I.cancel(),le(),K=ke(w,V,{step:function(L){oe(i,c,L.scale)},done:ot})}function Nn(i,c,u){var m=r.scale,w={scale:m},V={scale:u};I.cancel(),le(),K=ke(w,V,{step:function(L){oe(i,c,L.scale)},done:ot})}function J(){var i=o.getBoundingClientRect();return{x:i.width*C.x,y:i.height*C.y}}function se(i,c,u){return I.cancel(),le(),De(i,c,u)}function le(){K&&(K.cancel(),K=null)}function nt(i){var c=Math.sign(i),u=Math.min(.25,Math.abs(T*i/128));return 1-c*u}function rt(){B||(W("panstart"),B=!0,I.start())}function Ve(){B&&(te||I.stop(),W("panend"))}function ot(){W("zoomend")}function W(i){re.fire(i,re)}}function qt(t){if(t){if(typeof t=="object")return(!$(t.x)||!$(t.y))&&Dt(t),t;Dt()}}function Dt(t){throw console.error(t),new Error(["Cannot parse transform origin.","Some good examples:",' "center center" can be achieved with {x: 0.5, y: 0.5}',' "top center" can be achieved with {x: 0.5, y: 0}',' "bottom right" can be achieved with {x: 1, y: 1}'].join(`
|
|
3
|
+
`))}function Y(){}function br(t){var e=typeof t;if(!(e==="undefined"||e==="boolean")){var n=$(t.left)&&$(t.top)&&$(t.bottom)&&$(t.right);if(!n)throw new Error("Bounds object is not valid. It can be: undefined, boolean (true|false) or an object {left, top, right, bottom}")}}function $(t){return Number.isFinite(t)}function Me(t){return Number.isNaN?Number.isNaN(t):t!==t}function Sr(){return{start:Y,stop:Y,cancel:Y}}function xr(){if(typeof document>"u")return;var t=document.getElementsByTagName("script");if(!t)return;for(var e,n=0;n<t.length;++n){var o=t[n];if(o.src&&o.src.match(/\bpanzoom(\.min)?\.js/)){e=o;break}}if(!e)return;var a=e.getAttribute("query");if(!a)return;var s=e.getAttribute("name")||"pz",r=Date.now();d();function d(){var f=document.querySelector(a);if(!f){var h=Date.now(),y=h-r;if(y<2e3){setTimeout(d,100);return}console.error("Cannot find the panzoom element",s);return}var g=p(e);console.log(g),window[s]=Rt(f,g)}function p(f){for(var h=f.attributes,y={},g=0;g<h.length;++g){var b=h[g],S=l(b);S&&(y[S.name]=S.value)}return y}function l(f){if(f.name){var h=f.name[0]==="p"&&f.name[1]==="z"&&f.name[2]==="-";if(h){var y=f.name.substr(3),g=JSON.parse(f.value);return{name:y,value:g}}}}}xr()});var rn={};st(rn,{getViz:()=>Nr,renderDotToSvg:()=>Or});async function Or(t){throw new Error("libpetri viewer: static bundle has no DOT renderer. Either ship the pre-rendered SVG in the host (mount(null, container, opts)) or load the full viewer.iife.js bundle.")}function Nr(){throw new Error("libpetri viewer: static bundle has no Viz instance.")}var on=Dn(()=>{});var Ne={};st(Ne,{DEFAULT_PANZOOM_OPTS:()=>pe,VIEWER_CSS_VARIABLES:()=>Oe,colorForPrefix:()=>ge,discoverClusters:()=>he,mount:()=>an});var Wt=Rn(Ht(),1),pe={smoothScroll:!1,zoomDoubleClickSpeed:1,maxZoom:1e3,minZoom:.02};function jt(t,e,n){if(n)try{n.dispose()}catch{}let o={...pe,...e};return(0,Wt.default)(t,o)}function he(t){let e=new Map,n=t.querySelectorAll("g.cluster");if(!n.length)return e;let o=Array.from(t.querySelectorAll("g.node"));for(let a of Array.from(n)){let s=Z(a,"title");if(!s)continue;let r=s.textContent??"";if(!r.startsWith("cluster_"))continue;let d=r.slice(8);if(e.has(d))continue;let p=0;for(let l of o){if(l.getAttribute("data-instance"))continue;let f=Z(l,"title");if(!f)continue;let h=(f.textContent??"").trim();me(h,d)&&(l.setAttribute("data-instance",d),p++)}e.set(d,{prefix:d,group:a,nodeCount:p,color:ge(d)})}return e}function me(t,e){return t===e||t.startsWith(`${e}/`)||t.startsWith(`p_${e}_`)||t.startsWith(`t_${e}_`)||t.startsWith(`j_${e}_`)}function ge(t){let e=2166136261;for(let o=0;o<t.length;o++)e^=t.charCodeAt(o),e=e*16777619>>>0;let n=Math.floor((e/4294967296*360+e%360*.61803)%360);return n<0&&(n+=360),`hsl(${n}, 60%, 45%)`}function $t(t){for(let e of t.values()){let n=Z(e.group,"polygon")??Z(e.group,"path");n&&(n.setAttribute("stroke",e.color),n.setAttribute("stroke-width","2.2"))}}function ee(t,e){let n=t.group,o=n.classList.contains("cluster-collapsed"),a=n.ownerSVGElement;if(a)if(e&&!o){n.classList.add("cluster-collapsed");let s=[];if(a.querySelectorAll(`g.node[data-instance="${wr(t.prefix)}"]`).forEach(r=>{r.classList.add("petri-collapsed-inside"),s.push(r)}),a.querySelectorAll("g.edge").forEach(r=>{let d=Z(r,"title");if(!d)return;let p=(d.textContent??"").trim(),l=p.indexOf("->");if(l<0)return;let f=p.slice(0,l),h=p.slice(l+2);me(f,t.prefix)&&me(h,t.prefix)&&(r.classList.add("petri-collapsed-inside"),s.push(r))}),n._petriHiddenSiblings=s,!n._petriCollapsedBadge){let r=Z(n,"text");if(r){let d=document.createElementNS("http://www.w3.org/2000/svg","text");d.setAttribute("x",r.getAttribute("x")??"0");let p=parseFloat(r.getAttribute("y")??"0");d.setAttribute("y",String(p+16)),d.setAttribute("text-anchor",r.getAttribute("text-anchor")??"middle"),d.setAttribute("font-size","11"),d.setAttribute("fill","#9ca3af"),d.setAttribute("class","cluster-collapsed-badge"),d.textContent=`(${t.nodeCount} internal node${t.nodeCount===1?"":"s"})`,n.appendChild(d),n._petriCollapsedBadge=d}}}else!e&&o&&(n.classList.remove("cluster-collapsed"),n._petriHiddenSiblings&&(n._petriHiddenSiblings.forEach(s=>s.classList.remove("petri-collapsed-inside")),n._petriHiddenSiblings=void 0),n._petriCollapsedBadge&&n._petriCollapsedBadge.parentNode===n&&(n.removeChild(n._petriCollapsedBadge),n._petriCollapsedBadge=null))}function Yt(t,e){if(e==null){t.removeAttribute("data-active-filter"),t.classList.remove("has-active-filter"),t.querySelectorAll("g.node, g.edge").forEach(n=>n.classList.remove("petri-dimmed"));return}t.setAttribute("data-active-filter",e),t.classList.add("has-active-filter"),t.querySelectorAll("g.node").forEach(n=>{let o=n.getAttribute("data-instance");!!o&&(o===e||o.indexOf(e+"_")===0||o.indexOf(e+"/")===0)?n.classList.remove("petri-dimmed"):n.classList.add("petri-dimmed")}),t.querySelectorAll("g.edge").forEach(n=>{let o=Z(n,"title");if(!o)return;let a=o.textContent??"",s=a.indexOf("->");if(s<0){n.classList.remove("petri-dimmed");return}let r=a.slice(0,s),d=a.slice(s+2),p=l=>l.indexOf(e+"/")>=0||l.indexOf(e+"_")>=0||l===e;p(r)||p(d)?n.classList.remove("petri-dimmed"):n.classList.add("petri-dimmed")})}function Kt(t,e,n,o){if(n.size===0||!t)return!1;for(let a of n)if(e.has(a)&&me(o,a))return!0;return!1}function wr(t){return typeof CSS<"u"&&typeof CSS.escape=="function"?CSS.escape(t):t.replace(/[^a-zA-Z0-9_-]/g,e=>`\\${e}`)}function Z(t,e){let n=e.toLowerCase();for(let o of Array.from(t.children))if(o.tagName.toLowerCase()===n)return o;return null}function Fe(t){for(let e of Array.from(t.children))if(e.tagName==="title")return e.textContent??"";return""}function Cr(t){let e=t.parentElement?.closest("g.cluster");return e?Fe(e).replace(/^cluster_/,""):""}function ve(t){let e=Array.from(t.querySelectorAll("g.node"));for(let o of e){let a=Fe(o);if(!a)continue;o.setAttribute("data-id",a);let s=/__rep__([A-Za-z0-9_]+)$/.exec(a);if(s)o.setAttribute("data-instance",s[1]);else if(!o.hasAttribute("data-instance")){let r=Cr(o);r&&o.setAttribute("data-instance",r)}}let n=new Map;for(let o of e){let a=o.getAttribute("data-id");a&&n.set(a,o)}for(let o of Array.from(t.querySelectorAll("g.edge"))){let a=Fe(o),s=a.indexOf("->");if(s<=0)continue;let r=a.slice(0,s).trim(),d=a.slice(s+2).trim();o.setAttribute("data-src",r),o.setAttribute("data-dst",d);let p=n.get(r)?.getAttribute("data-instance")??"",l=n.get(d)?.getAttribute("data-instance")??"";o.setAttribute("data-src-cluster",p),o.setAttribute("data-dst-cluster",l),o.classList.remove("intra-cluster","cross-cluster"),p!==""&&p===l?(o.classList.add("intra-cluster"),o.setAttribute("data-cluster",p)):(o.classList.add("cross-cluster"),o.removeAttribute("data-cluster"))}}var Ar="libpetri-sidebar",Er="libpetri-sidebar-chip",Vr="is-off";function Ut(t,e,n){let o=new Set;for(let A of e.keys())o.add(A);let a=!0,s=!0,r=()=>{n.onVisibilityChange({visibleClusters:new Set(o),includeSharedPlaces:a})},d=document.createElement("aside");d.className=Ar;let p=document.createElement("h4");p.className="libpetri-sidebar-title",p.textContent=`Subnets (${e.size})`,d.appendChild(p);let l=document.createElement("div");l.className="libpetri-sidebar-actions";let f=document.createElement("button");f.type="button",f.textContent="show all";let h=document.createElement("button");h.type="button",h.textContent="hide all",l.appendChild(f),l.appendChild(h),d.appendChild(l);let y=document.createElement("label");y.className="libpetri-sidebar-checkbox";let g=document.createElement("input");g.type="checkbox",g.checked=a,y.appendChild(g),y.appendChild(document.createTextNode(" Shared places")),g.addEventListener("change",()=>{a=g.checked,r()}),d.appendChild(y);let b=document.createElement("label");b.className="libpetri-sidebar-checkbox";let S=document.createElement("input");S.type="checkbox",S.checked=s,b.appendChild(S),b.appendChild(document.createTextNode(" Click node \u2192 highlight")),S.addEventListener("change",()=>{s=S.checked,n.onHighlightModeChange(s)}),d.appendChild(b);let T=document.createElement("div");T.className="libpetri-sidebar-hint",T.innerHTML="Click chip: toggle.<br>Shift-click: isolate.<br>Cmd/Ctrl-click: multi-select.<br>Click empty: clear highlight.",d.appendChild(T);let C=document.createElement("ul");C.className="libpetri-sidebar-chips";let N=new Map;for(let A of e.values()){let v=document.createElement("li");v.className=Er,v.style.borderLeftColor=A.color,v.dataset.prefix=A.prefix;let x=document.createElement("span");x.className="libpetri-sidebar-chip-dot",x.style.background=A.color;let E=document.createElement("span");E.className="libpetri-sidebar-chip-name",E.textContent=A.prefix;let M=document.createElement("span");M.className="libpetri-sidebar-chip-count",M.textContent=String(A.nodeCount),v.appendChild(x),v.appendChild(E),v.appendChild(M),v.addEventListener("click",F=>{let G=A.prefix;if(F.shiftKey){let B=[...e.keys()].every(k=>k===G?o.has(k):!o.has(k));if(o.clear(),B)for(let k of e.keys())o.add(k);else o.add(G)}else F.ctrlKey||F.metaKey?[...e.keys()].some(k=>!o.has(k))?o.has(G)?o.delete(G):o.add(G):(o.clear(),o.add(G)):o.has(G)?o.delete(G):o.add(G);z(),r()}),C.appendChild(v),N.set(A.prefix,v)}d.appendChild(C);function z(){for(let[A,v]of N)v.classList.toggle(Vr,!o.has(A))}return f.addEventListener("click",()=>{o.clear();for(let A of e.keys())o.add(A);a=!0,g.checked=!0,z(),r()}),h.addEventListener("click",()=>{o.clear(),a=!1,g.checked=!1,z(),r()}),t.appendChild(d),r(),{root:d,dispose(){d.parentNode===t&&t.removeChild(d)}}}var Lr=["is-highlight","is-neighbor","is-faded"];function Tr(t){for(let e of Lr)for(let n of Array.from(t.querySelectorAll("."+e)))n.classList.remove(e)}function Gr(t,e){let n=t.querySelector(`g.node[data-id="${ye(e)}"]`);if(!n)return new Set([e]);let o=new Set([e]),a=n.getAttribute("data-replica-of")??(e.startsWith("p_")?e.slice(2):null);if(a){let s=t.querySelector(`g.node[data-id="${ye("p_"+a)}"]`);if(s){let r=s.getAttribute("data-id");r&&o.add(r)}for(let r of Array.from(t.querySelectorAll(`g.node[data-replica-of="${ye(a)}"]`))){let d=r.getAttribute("data-id");d&&o.add(d)}}return o}function Jt(t,e){if(Tr(t),e===null)return;let n=Gr(t,e);for(let l of n){let f=t.querySelector(`g.node[data-id="${ye(l)}"]`);f&&!f.classList.contains("is-hidden")&&f.classList.add("is-highlight")}let o=new Set,a=new Set,s=[],r=Array.from(n),d=new Set(n),p=Array.from(t.querySelectorAll("g.edge"));for(;r.length>0;){let l=r.shift();for(let f of p){if(f.classList.contains("is-hidden"))continue;let h=f.getAttribute("data-src"),y=f.getAttribute("data-dst");if(h!==l&&y!==l)continue;let g=h===l?y:h;g&&(s.push(f),!d.has(g)&&(d.add(g),g.startsWith("j_")?(a.add(g),r.push(g)):o.add(g)))}}for(let l of s)l.classList.add("is-highlight");for(let l of p)l.classList.contains("is-hidden")||l.classList.contains("is-highlight")||l.classList.add("is-faded");for(let l of Array.from(t.querySelectorAll("g.node"))){if(l.classList.contains("is-hidden"))continue;let f=l.getAttribute("data-id")??"";if(!n.has(f))if(o.has(f))l.classList.add("is-neighbor");else{if(a.has(f))continue;l.classList.add("is-faded")}}for(let l of Array.from(t.querySelectorAll("g.cluster:not(.cluster-orchestrator)")))l.classList.contains("is-hidden")||l.classList.add("is-faded")}function ye(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}var Qt=/^(p_[A-Za-z0-9_]+)__rep__/;function Xt(t){return t.replace(/^p_/,"")}function tn(t){let e=new Set,n=Array.from(t.querySelectorAll("g.node"));for(let o of n){let a=o.querySelector("title")?.textContent??"",s=Qt.exec(a);s&&e.add(s[1])}for(let o of n){let a=o.querySelector("title")?.textContent??"",s=Qt.exec(a),r=null;s?r=Xt(s[1]):e.has(a)&&(r=Xt(a)),r!==null&&(o.classList.add("petri-replica"),o.setAttribute("data-replica-of",r),Mr(o))}}var kr="http://www.w3.org/2000/svg",en="libpetri-replica-glyph";function Mr(t){if(t.querySelector(`text.${en}`))return;let e=t.querySelector("ellipse, circle");if(!e)return;let n=0,o=0,a=0,s=0;e.tagName==="ellipse"?(n=parseFloat(e.getAttribute("cx")??"0"),o=parseFloat(e.getAttribute("cy")??"0"),a=parseFloat(e.getAttribute("rx")??"0"),s=parseFloat(e.getAttribute("ry")??"0")):(n=parseFloat(e.getAttribute("cx")??"0"),o=parseFloat(e.getAttribute("cy")??"0"),a=parseFloat(e.getAttribute("r")??"0"),s=a);let r=document.createElementNS(kr,"text");r.setAttribute("class",en),r.setAttribute("x",(n+a+2).toFixed(2)),r.setAttribute("y",(o-s+2).toFixed(2)),r.setAttribute("text-anchor","start"),r.setAttribute("font-size","9"),r.textContent="\u21C4",t.appendChild(r)}function Fr(t,e){if(e.size===0)return new Set;let n=Array.from(t.querySelectorAll("g.node:not([data-instance])")),o=new Set;for(let h of n){let y=h.getAttribute("data-id");y&&o.add(y)}let a=new Map,s=new Map,r=(h,y,g)=>{let b=h.get(y);b||(b=new Set,h.set(y,b)),b.add(g)};for(let h of Array.from(t.querySelectorAll("g.edge"))){let y=h.getAttribute("data-src")??"",g=h.getAttribute("data-dst")??"";o.has(y)&&o.has(g)&&(r(a,y,g),r(s,g,y))}let d=new Set,p=new Set;for(let h of Array.from(t.querySelectorAll("g.edge.cross-cluster"))){let y=h.getAttribute("data-src")??"",g=h.getAttribute("data-dst")??"",b=h.getAttribute("data-src-cluster")??"",S=h.getAttribute("data-dst-cluster")??"";o.has(y)&&e.has(S)&&d.add(y),o.has(g)&&e.has(b)&&p.add(g)}let l=new Set,f=(h,y)=>{let g=[];for(let b of h)l.add(b),g.push(b);for(;g.length;){let b=g.shift(),S=y.get(b);if(S)for(let T of S)l.has(T)||(l.add(T),g.push(T))}};return f(d,s),f(p,a),l}function nn(t,e){ve(t);let{visibleClusters:n,includeSharedPlaces:o}=e;for(let r of Array.from(t.querySelectorAll("g.cluster:not(.cluster-orchestrator)"))){let p=(r.querySelector(":scope > title")?.textContent??"").replace(/^cluster_/,"");r.classList.toggle("is-hidden",!n.has(p))}for(let r of Array.from(t.querySelectorAll("g.node[data-instance]"))){let d=r.getAttribute("data-instance")??"";r.classList.toggle("is-hidden",!n.has(d))}let a=Fr(t,n);for(let r of Array.from(t.querySelectorAll("g.node:not([data-instance])"))){let d=r.getAttribute("data-id")??"";r.classList.toggle("is-hidden",!a.has(d))}if(!o)for(let r of Array.from(t.querySelectorAll("g.node.petri-replica")))r.classList.add("is-hidden");let s=new Map;for(let r of Array.from(t.querySelectorAll("g.node"))){let d=r.getAttribute("data-id");d&&s.set(d,r)}for(let r of Array.from(t.querySelectorAll("g.edge"))){let d=r.getAttribute("data-src")??"",p=r.getAttribute("data-dst")??"",l=s.get(d)?.classList.contains("is-hidden")??!1,f=s.get(p)?.classList.contains("is-hidden")??!1;r.classList.toggle("is-hidden",l||f)}}var Oe=["--lpv-bg","--lpv-header-bg","--lpv-border","--lpv-text","--lpv-muted","--lpv-cluster-bg","--lpv-cluster-bg-collapsed","--lpv-cluster-stroke-width","--lpv-cluster-stroke-dash","--lpv-cluster-fill-tint","--lpv-dim-opacity","--lpv-active-filter-outline","--lpv-legend-bg","--lpv-chip-bg","--lpv-chip-active-bg","--lpv-sidebar-bg","--lpv-sidebar-border","--lpv-sidebar-text","--lpv-sidebar-muted","--lpv-sidebar-chip-bg","--lpv-sidebar-chip-hover-bg","--lpv-sidebar-chip-off-opacity","--lpv-shared-glyph-color","--lpv-replica-fill","--lpv-replica-stroke","--lpv-highlight-stroke","--lpv-highlight-glow","--lpv-neighbor-stroke","--lpv-faded-node-opacity","--lpv-faded-edge-opacity","--lpv-faded-cluster-opacity"];async function an(t,e,n={}){let o=n.previousHandle??null,a=o?new Set(o.collapsedPrefixes):new Set,s=o?.activeFilter??null;o&&o.dispose();let r,d=e.querySelector(":scope > svg");if(t==null){if(!(d instanceof SVGSVGElement))throw new Error("mount: no DOT source and no pre-rendered SVG");r=d}else{let v=await Promise.resolve().then(()=>(on(),rn));r=(n.layout??"elk")==="elk"?await v.renderDotToSvgWithElkLayout(t):await v.renderDotToSvg(t),e.innerHTML="",e.appendChild(r)}e.classList.add("libpetri-viewer");let p=jt(r,n.panzoom),l=he(r);$t(l);let f=n.layout??"elk";f==="elk"&&(tn(r),ve(r));let h=new Set,y=null,g=null,b=!1,S=null,T=null,C=!0;function N(){if(!n.chrome||S&&S.parentNode===e)return;S=document.createElement("div"),S.className="libpetri-viewer-chrome",S.style.position="absolute",S.style.inset="0",S.style.pointerEvents="none";let v=document.createElement("div");v.className="diagram-controls",v.style.pointerEvents="auto";let x=document.createElement("button");x.type="button",x.className="diagram-btn btn-reset",x.title="Reset view",x.textContent="Reset",x.addEventListener("click",()=>A.fit());let E=document.createElement("button");E.type="button",E.className="diagram-btn btn-fullscreen",E.title="Toggle fullscreen",E.textContent="Fullscreen",E.addEventListener("click",()=>z(e,E)),v.appendChild(x),v.appendChild(E),S.appendChild(v),getComputedStyle(e).position==="static"&&(e.style.position="relative"),e.appendChild(S),f==="elk"&&l.size>0&&(T=Ut(e,l,{onVisibilityChange:M=>A.setVisibility(M),onHighlightModeChange:M=>{C=M,M||A.highlight(null)}}))}function z(v,x){let E=v.classList.toggle("diagram-fullscreen");x.textContent=E?"Exit fullscreen":"Fullscreen",requestAnimationFrame(()=>A.fit())}let A={svg:r,panzoom:p,clusters:l,get collapsedPrefixes(){return h},get activeFilter(){return y},collapse(v){if(b)return;let x=l.get(v);x&&(h.has(v)||(ee(x,!0),h.add(v),n.onClusterCollapse?.(v,!0)))},expand(v){if(b)return;let x=l.get(v);x&&h.has(v)&&(ee(x,!1),h.delete(v),n.onClusterCollapse?.(v,!1))},collapseAll(){if(!b)for(let v of l.values())h.has(v.prefix)||(ee(v,!0),h.add(v.prefix),n.onClusterCollapse?.(v.prefix,!0))},expandAll(){if(!b)for(let v of Array.from(h)){let x=l.get(v);x&&(ee(x,!1),h.delete(v),n.onClusterCollapse?.(v,!1))}},filter(v){b||(y=v,Yt(r,v),n.onClusterFilter?.(v))},resetZoom(){if(!b)try{p.moveTo(0,0),p.zoomAbs(0,0,1)}catch{}},fit(){if(!b)try{p.zoomAbs(0,0,1),p.moveTo(0,0)}catch{}},isInsideCollapsedCluster(v){return Kt(r,l,h,v)},get highlightedNodeId(){return g},highlight(v){b||f==="elk"&&(g=v,Jt(r,v))},setVisibility(v){b||f==="elk"&&nn(r,v)},dispose(){if(!b){b=!0;try{p.dispose()}catch{}T?.dispose(),T=null,S&&S.parentNode===e&&e.removeChild(S),S=null}}};for(let v of a)A.collapse(v);return s!==null&&A.filter(s),f==="elk"&&r.addEventListener("click",v=>{if(!C)return;let x=v.target;if(!(x instanceof Element))return;let E=x.closest("g.node");if(!E){A.highlight(null);return}let M=E.getAttribute("data-id");M&&A.highlight(M===g?null:M)}),N(),requestAnimationFrame(()=>A.fit()),A}globalThis.LibpetriViewer=Ne;})();
|
package/dist/viewer/viewer.css
CHANGED
|
@@ -501,3 +501,259 @@ svg.has-active-filter {
|
|
|
501
501
|
outline: 1px solid var(--lpv-active-filter-outline);
|
|
502
502
|
outline-offset: -1px;
|
|
503
503
|
}
|
|
504
|
+
|
|
505
|
+
/* ============================================================
|
|
506
|
+
* C0 layout — left sidebar chrome
|
|
507
|
+
*
|
|
508
|
+
* The chip sidebar replaces the legacy `.diagram-legend` (top-right)
|
|
509
|
+
* and `.diagram-filter-strip` (bottom). Built by
|
|
510
|
+
* `viewer/chrome/sidebar.ts` when `mount({ chrome: true, layout: 'elk' })`.
|
|
511
|
+
* Lives inside the viewer container so it travels into fullscreen.
|
|
512
|
+
* ============================================================ */
|
|
513
|
+
:root,
|
|
514
|
+
.petrinet-diagram,
|
|
515
|
+
.libpetri-viewer {
|
|
516
|
+
--lpv-sidebar-bg: #fafafa;
|
|
517
|
+
--lpv-sidebar-border: #e2e2e2;
|
|
518
|
+
--lpv-sidebar-text: #333333;
|
|
519
|
+
--lpv-sidebar-muted: #6b7280;
|
|
520
|
+
--lpv-sidebar-chip-bg: #ffffff;
|
|
521
|
+
--lpv-sidebar-chip-hover-bg: #f4f4ff;
|
|
522
|
+
--lpv-sidebar-chip-off-opacity: 0.45;
|
|
523
|
+
--lpv-shared-glyph-color: #6b46c1;
|
|
524
|
+
--lpv-replica-fill: #f3f4f6;
|
|
525
|
+
--lpv-replica-stroke: #6b46c1;
|
|
526
|
+
--lpv-highlight-stroke: #d97706;
|
|
527
|
+
--lpv-highlight-glow: rgba(217, 119, 6, 0.55);
|
|
528
|
+
--lpv-neighbor-stroke: #2563eb;
|
|
529
|
+
--lpv-faded-node-opacity: 0.14;
|
|
530
|
+
--lpv-faded-edge-opacity: 0.08;
|
|
531
|
+
--lpv-faded-cluster-opacity: 0.25;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
.libpetri-viewer .libpetri-sidebar {
|
|
535
|
+
position: absolute;
|
|
536
|
+
top: 8px;
|
|
537
|
+
left: 8px;
|
|
538
|
+
width: 220px;
|
|
539
|
+
max-height: calc(100% - 16px);
|
|
540
|
+
overflow-y: auto;
|
|
541
|
+
background: var(--lpv-sidebar-bg);
|
|
542
|
+
border: 1px solid var(--lpv-sidebar-border);
|
|
543
|
+
border-radius: 6px;
|
|
544
|
+
padding: 10px;
|
|
545
|
+
font-size: 12px;
|
|
546
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
547
|
+
color: var(--lpv-sidebar-text);
|
|
548
|
+
z-index: 9;
|
|
549
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
.libpetri-sidebar .libpetri-sidebar-title {
|
|
553
|
+
margin: 0 0 8px 0;
|
|
554
|
+
font-weight: 700;
|
|
555
|
+
font-size: 13px;
|
|
556
|
+
color: var(--lpv-sidebar-text);
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
.libpetri-sidebar .libpetri-sidebar-actions {
|
|
560
|
+
display: flex;
|
|
561
|
+
gap: 4px;
|
|
562
|
+
margin-bottom: 8px;
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
.libpetri-sidebar .libpetri-sidebar-actions button {
|
|
566
|
+
flex: 1 1 auto;
|
|
567
|
+
padding: 3px 8px;
|
|
568
|
+
font-size: 11px;
|
|
569
|
+
font-family: inherit;
|
|
570
|
+
border: 1px solid #ccc;
|
|
571
|
+
background: #fff;
|
|
572
|
+
border-radius: 4px;
|
|
573
|
+
cursor: pointer;
|
|
574
|
+
color: var(--lpv-sidebar-text);
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
.libpetri-sidebar .libpetri-sidebar-actions button:hover {
|
|
578
|
+
background: #f0f0f0;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
.libpetri-sidebar .libpetri-sidebar-checkbox {
|
|
582
|
+
display: flex;
|
|
583
|
+
align-items: center;
|
|
584
|
+
gap: 6px;
|
|
585
|
+
margin: 6px 0;
|
|
586
|
+
font-size: 11.5px;
|
|
587
|
+
color: var(--lpv-sidebar-text);
|
|
588
|
+
cursor: pointer;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
.libpetri-sidebar .libpetri-sidebar-hint {
|
|
592
|
+
font-size: 10.5px;
|
|
593
|
+
color: var(--lpv-sidebar-muted);
|
|
594
|
+
line-height: 1.4;
|
|
595
|
+
margin: 6px 0 10px 0;
|
|
596
|
+
border-top: 1px solid var(--lpv-sidebar-border);
|
|
597
|
+
padding-top: 8px;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
.libpetri-sidebar .libpetri-sidebar-chips {
|
|
601
|
+
display: flex;
|
|
602
|
+
flex-direction: column;
|
|
603
|
+
gap: 4px;
|
|
604
|
+
margin: 0;
|
|
605
|
+
padding: 0;
|
|
606
|
+
list-style: none;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
.libpetri-sidebar .libpetri-sidebar-chip {
|
|
610
|
+
display: flex;
|
|
611
|
+
align-items: center;
|
|
612
|
+
gap: 6px;
|
|
613
|
+
padding: 4px 8px;
|
|
614
|
+
border-radius: 4px;
|
|
615
|
+
cursor: pointer;
|
|
616
|
+
user-select: none;
|
|
617
|
+
border-left: 4px solid var(--lpv-shared-glyph-color);
|
|
618
|
+
background: var(--lpv-sidebar-chip-bg);
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
.libpetri-sidebar .libpetri-sidebar-chip:hover {
|
|
622
|
+
background: var(--lpv-sidebar-chip-hover-bg);
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
.libpetri-sidebar .libpetri-sidebar-chip.is-off {
|
|
626
|
+
opacity: var(--lpv-sidebar-chip-off-opacity);
|
|
627
|
+
border-left-color: #ccc;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
.libpetri-sidebar .libpetri-sidebar-chip-dot {
|
|
631
|
+
flex: 0 0 10px;
|
|
632
|
+
width: 10px;
|
|
633
|
+
height: 10px;
|
|
634
|
+
border-radius: 50%;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.libpetri-sidebar .libpetri-sidebar-chip-name {
|
|
638
|
+
flex: 1 1 auto;
|
|
639
|
+
font-family: ui-monospace, "SF Mono", Menlo, monospace;
|
|
640
|
+
font-weight: 500;
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
.libpetri-sidebar .libpetri-sidebar-chip-count {
|
|
644
|
+
color: var(--lpv-sidebar-muted);
|
|
645
|
+
font-size: 10.5px;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
/* ============================================================
|
|
649
|
+
* Replica visuals
|
|
650
|
+
*
|
|
651
|
+
* Replicas of shared places get a dashed light-gray ring and a small
|
|
652
|
+
* ⇄ glyph in the upper-right corner. The glyph is injected by
|
|
653
|
+
* `replica-tagging.ts` as a sibling `<text>` inside `<g class="node">`.
|
|
654
|
+
* ============================================================ */
|
|
655
|
+
g.node.petri-replica > ellipse,
|
|
656
|
+
g.node.petri-replica > circle {
|
|
657
|
+
fill: var(--lpv-replica-fill) !important;
|
|
658
|
+
stroke: var(--lpv-replica-stroke) !important;
|
|
659
|
+
stroke-width: 1.2 !important;
|
|
660
|
+
stroke-dasharray: 3 2 !important;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
g.node.petri-replica > text.libpetri-replica-glyph {
|
|
664
|
+
fill: var(--lpv-shared-glyph-color);
|
|
665
|
+
font-weight: 700;
|
|
666
|
+
pointer-events: none;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/* ============================================================
|
|
670
|
+
* Highlight + visibility states
|
|
671
|
+
*
|
|
672
|
+
* `applyHighlight` (highlight.ts) sets `.is-highlight` on focus +
|
|
673
|
+
* every copy, `.is-neighbor` on real-place neighbors, `.is-faded`
|
|
674
|
+
* on the rest. `applyVisibility` (visibility.ts) sets `.is-hidden`
|
|
675
|
+
* on clusters / nodes / edges that the current selection excludes.
|
|
676
|
+
* Constants match v3 colors exactly.
|
|
677
|
+
* ============================================================ */
|
|
678
|
+
.libpetri-viewer svg g.node,
|
|
679
|
+
.libpetri-viewer svg g.edge {
|
|
680
|
+
transition: opacity 0.15s ease-out;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
.libpetri-viewer svg g.cluster.is-hidden,
|
|
684
|
+
.libpetri-viewer svg g.edge.is-hidden,
|
|
685
|
+
.libpetri-viewer svg g.node.is-hidden {
|
|
686
|
+
display: none !important;
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
.libpetri-viewer svg g.node.is-faded {
|
|
690
|
+
opacity: var(--lpv-faded-node-opacity) !important;
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
.libpetri-viewer svg g.edge.is-faded {
|
|
694
|
+
opacity: var(--lpv-faded-edge-opacity) !important;
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/* When a cluster is faded, fade only its own border + label, NOT its
|
|
698
|
+
* descendant nodes/edges — intra-cluster highlighted edges must still pop. */
|
|
699
|
+
.libpetri-viewer svg g.cluster.is-faded > polygon,
|
|
700
|
+
.libpetri-viewer svg g.cluster.is-faded > path,
|
|
701
|
+
.libpetri-viewer svg g.cluster.is-faded > text {
|
|
702
|
+
opacity: var(--lpv-faded-cluster-opacity);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.libpetri-viewer svg g.node.is-highlight > ellipse,
|
|
706
|
+
.libpetri-viewer svg g.node.is-highlight > circle,
|
|
707
|
+
.libpetri-viewer svg g.node.is-highlight > polygon,
|
|
708
|
+
.libpetri-viewer svg g.node.is-highlight > rect {
|
|
709
|
+
stroke: var(--lpv-highlight-stroke) !important;
|
|
710
|
+
stroke-width: 3 !important;
|
|
711
|
+
filter: drop-shadow(0 0 6px var(--lpv-highlight-glow));
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
.libpetri-viewer svg g.node.is-neighbor > ellipse,
|
|
715
|
+
.libpetri-viewer svg g.node.is-neighbor > circle,
|
|
716
|
+
.libpetri-viewer svg g.node.is-neighbor > polygon,
|
|
717
|
+
.libpetri-viewer svg g.node.is-neighbor > rect {
|
|
718
|
+
stroke: var(--lpv-neighbor-stroke) !important;
|
|
719
|
+
stroke-width: 2.5 !important;
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
.libpetri-viewer svg g.edge.is-highlight {
|
|
723
|
+
opacity: 1 !important;
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
.libpetri-viewer svg g.edge.is-highlight path {
|
|
727
|
+
stroke-width: 2.4 !important;
|
|
728
|
+
opacity: 1 !important;
|
|
729
|
+
filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.35));
|
|
730
|
+
}
|
|
731
|
+
|
|
732
|
+
/* ============================================================
|
|
733
|
+
* Dark theme overrides for the sidebar
|
|
734
|
+
*
|
|
735
|
+
* Triggered by `data-lpv-theme="dark"` on any ancestor (typically
|
|
736
|
+
* the viewer container itself). Debug-ui sets this so the sidebar
|
|
737
|
+
* matches the surrounding dark chrome.
|
|
738
|
+
* ============================================================ */
|
|
739
|
+
[data-lpv-theme="dark"] {
|
|
740
|
+
--lpv-sidebar-bg: #1f2937;
|
|
741
|
+
--lpv-sidebar-border: #374151;
|
|
742
|
+
--lpv-sidebar-text: #f3f4f6;
|
|
743
|
+
--lpv-sidebar-muted: #9ca3af;
|
|
744
|
+
--lpv-sidebar-chip-bg: #111827;
|
|
745
|
+
--lpv-sidebar-chip-hover-bg: #312e81;
|
|
746
|
+
--lpv-replica-fill: #312e81;
|
|
747
|
+
--lpv-replica-stroke: #a78bfa;
|
|
748
|
+
--lpv-shared-glyph-color: #a78bfa;
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
[data-lpv-theme="dark"] .libpetri-sidebar .libpetri-sidebar-actions button {
|
|
752
|
+
background: #111827;
|
|
753
|
+
color: var(--lpv-sidebar-text);
|
|
754
|
+
border-color: #374151;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
[data-lpv-theme="dark"] .libpetri-sidebar .libpetri-sidebar-actions button:hover {
|
|
758
|
+
background: #374151;
|
|
759
|
+
}
|