(function(){
'use strict';var cu=function(a,b){var c;if(c=null!=b)c=$APP.y(a),c=b.g?b.g(c):b.call(null,c),c=$APP.Ka(c);if(c)throw Error("Validator rejected reference state");a.dd=b},du=function(a){return function(b){return function(){function c(g,h){return $APP.p(a.g?a.g(h):a.call(null,h))?b.h?b.h(g,h):b.call(null,g,h):g}function d(g){return b.g?b.g(g):b.call(null,g)}function e(){return b.m?b.m():b.call(null)}var f=null;f=function(g,h){switch(arguments.length){case 0:return e.call(this);case 1:return d.call(this,
g);case 2:return c.call(this,g,h)}throw Error("Invalid arity: "+arguments.length);};f.m=e;f.g=d;f.h=c;return f}()}},fu=function(a,b){var c=eu;$APP.cc(c,a,b);return c},gu=function(a){var b=eu;$APP.fc(b,a);return b},hu=function(a,b,c){var d=$APP.Kd;for(b=$APP.C(b);;)if(null!=b){a=$APP.N.i(a,$APP.D(b),d);if(d===a)return c;b=$APP.E(b)}else return a},iu=function(a,b,c,d,e){this.meta=a;this.f=b;this.zd=c;this.bd=d;this.next=e;this.o=26083532;this.B=1},ju=function(a,b){return new iu(null,a,null,b,null)},
ku=function(a,b){return new $APP.ue(null,function(){var c=$APP.C(b);if(c){var d=$APP.D(c);d=a.g?a.g(d):a.call(null,d);c=$APP.p(d)?$APP.P($APP.D(c),ku(a,$APP.Pc(c))):null}else c=null;return c},null,null)},mu=function(a,b){var c=$APP.Me.i(lu,a,b);return $APP.P(c,$APP.wf(function(d){return c===d},b))},nu=function(a){return function d(c){return new $APP.ue(null,function(){return $APP.P(c,$APP.p($APP.zd.g?$APP.zd.g(c):$APP.zd.call(null,c))?$APP.uf(d,$APP.K([$APP.C.g?$APP.C.g(c):$APP.C.call(null,c)])):
null)},null,null)}(a)},ou=function(a){return $APP.vf(function(b){return!$APP.zd(b)},$APP.Pc(nu(a)))},pu=function(a,b){var c=$APP.Jm(a);return $APP.$m(a,$APP.p(c)?new $APP.S(null,1,5,$APP.V,[c],null):$APP.Rf,b)},qu=function(a,b){var c=new $APP.ya,d=$APP.Fa,e=$APP.Ga;$APP.Fa=!0;$APP.Ga=function(f){return c.append(f)};try{$APP.hn.call(null,pu(a,b))}finally{$APP.Ga=e,$APP.Fa=d}return $APP.w.g(c)},ru=function(a,b){this.f=a;this.cc=b;this.zc=null;this.o=2153807872;this.B=0},su=function(a){return a.g?a.g(0):
a.call(null,0)},tu=function(a){var b=su(a);a=$APP.Qr.g($APP.vd(a));return a.g?a.g(b):a.call(null,b)},uu=function(a){if($APP.p(tu(a))){var b=su(a);a=$APP.cs.g($APP.vd(a));return a.g?a.g(b):a.call(null,b)}throw"called children on a leaf node";},vu=function(a,b,c){a=$APP.hq.g($APP.vd(a));return a.h?a.h(b,c):a.call(null,b,c)},wu=function(a){if($APP.p(tu(a))){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=uu(a),e=$APP.C(d),f=$APP.D(e);e=$APP.E(e);return $APP.p(d)?$APP.ud(new $APP.S(null,2,5,$APP.V,[f,new $APP.m(null,
4,[$APP.tr,$APP.Rf,$APP.Dq,$APP.p(c)?$APP.ne.h($APP.Dq.g(c),b):new $APP.S(null,1,5,$APP.V,[b],null),$APP.Iq,c,$APP.Ar,e],null)],null),$APP.vd(a)):null}return null},xu=function(a){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=$APP.Oe(c);c=$APP.N.h(d,$APP.tr);var e=$APP.N.h(d,$APP.Iq),f=$APP.N.h(d,$APP.Dq),g=$APP.N.h(d,$APP.Ar);d=$APP.N.h(d,$APP.Pr);return $APP.p(f)?(f=null==f?null:$APP.Bb(f),$APP.ud($APP.p(d)?new $APP.S(null,2,5,$APP.V,[vu(a,f,$APP.tf.h(c,$APP.P(b,g))),$APP.p(e)?$APP.X.i(e,$APP.Pr,!0):
e],null):new $APP.S(null,2,5,$APP.V,[f,e],null),$APP.vd(a))):null},yu=function(a){var b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=$APP.M(a,2,null),e=$APP.M(a,3,null),f=$APP.M(a,4,null);a=$APP.M(a,5,null);return DOMMatrixReadOnly.fromMatrix({a:b,b:c,c:d,d:e,e:f,f:a})},zu=function(a){a=null==a?null:wu(a);if(null==a)a=null;else{var b=$APP.M(a,0,null),c=$APP.M(a,1,null);c=$APP.Oe(c);var d=$APP.N.h(c,$APP.tr),e=$APP.N.h(c,$APP.Ar);a=$APP.p($APP.p(c)?e:c)?$APP.ud(new $APP.S(null,2,5,$APP.V,[$APP.od(e),$APP.X.l(c,
$APP.tr,$APP.Me.u($APP.ne,d,b,$APP.Dh(e)),$APP.K([$APP.Ar,null]))],null),$APP.vd(a)):a}return null==a?null:su(a)},Bu=function(a){var b=Au;$APP.Z.h(b,function(c){var d=new $APP.ke(null,a,null,1,null);d=vu(c,su(c),$APP.P(d,uu(c)));$APP.M(c,0,null);var e=$APP.M(c,1,null);c=$APP.ud(new $APP.S(null,2,5,$APP.V,[d,$APP.X.i(e,$APP.Pr,!0)],null),$APP.vd(c));return wu(c)});return zu($APP.y(b))},Cu=function(){var a=Au;$APP.Z.h(a,function(b){return $APP.p(zu(xu(b)))?xu(b):b});return zu($APP.y(a))},Du=function(){var a=
Au;$APP.Z.h(a,function(b){return $APP.p(zu(wu(b)))?wu(b):b});return zu($APP.y(a))},Fu=function(a){a=$APP.Me.h(Eu,$APP.uf($APP.Wn.h($APP.Xn,2),$APP.K([a])))+1;return $APP.p(isFinite(a))?a:1},Gu=function(a){function b(c,d,e){return $APP.p(e)?$APP.ne.h(c,d):c}return b(b(b(b($APP.zh([$APP.Xh.g(a.key.toLowerCase())]),$APP.hs,a.ctrlKey),$APP.Cq,a.altKey),$APP.Wp,a.shiftKey),$APP.Yp,a.metaKey)},Hu=function(a,b){if($APP.p(function(){var c=b.repeat;return $APP.p(c)?c:$APP.G.h("INPUT",b.target.tagName)||$APP.G.h("TEXTAREA",
b.target.tagName)}()))return null;$APP.gi($APP.K([Gu(b)]));a=$APP.N.i(a,Gu(b),function(){return $APP.Oc});return a.m?a.m():a.call(null)},Iu=function(a){switch(a){case "resistor":return"R";case "inductor":return"L";case "capacitor":return"C";case "diode":return"D";case "vsource":return"V";case "isource":return"I";case "npn":return"Q";case "pnp":return"Q";case "pmos":return"M";case "nmos":return"M";case "wire":return"W";case "port":return"P";default:return"X"}},Ku=function(a){var b=$APP.nf.h(function(c){return[$APP.w.g(Ju),
":",$APP.w.g(Iu(a)),$APP.w.g(c)].join("")},$APP.E($APP.Kh(0,Number.MAX_VALUE)));return $APP.D($APP.wf($APP.y(eu),b))},Mu=function(a){var b=$APP.Sa($APP.fp,$APP.Ch($APP.qh($APP.y(eu))),$APP.qh(a)),c=$APP.Sa(function(e,f){return $APP.jp.u(e,f,$APP.Hj,$APP.um)},a,$APP.qh(a)),d=$APP.jm(1);$APP.Ol(function(){var e=function(){function g(h){var l=h[1];if(1===l){l=gu(Lu);var n=$APP.Z.i(eu,$APP.ui,c);h[7]=l;return $APP.hm(h,2,n)}return 2===l?(l=h[2],n=$APP.Z.i(eu,function(){return function(q,r){return $APP.Me.i($APP.Hj,
q,r)}}(),b),h[8]=l,$APP.hm(h,3,n)):3===l?(l=h[2],n=fu(Lu,function(){return function(q,r,t,u){return Bu(u)}}()),h[9]=l,$APP.im(h,n)):null}return function(){function h(q){for(;;){a:try{for(;;){var r=g(q);if(!$APP.re(r,$APP.gm)){var t=r;break a}}}catch(u){t=u;q[2]=t;if($APP.C(q[4]))q[1]=$APP.D(q[4]);else throw t;t=$APP.gm}if(!$APP.re(t,$APP.gm))return t}}function l(){var q=[null,null,null,null,null,null,null,null,null,null];q[0]=n;q[1]=1;return q}var n=null;n=function(q){switch(arguments.length){case 0:return l.call(this);
case 1:return h.call(this,q)}throw Error("Invalid arity: "+arguments.length);};n.m=l;n.g=h;return n}()}(),f=function(){var g=e();g[6]=d;return g}();return $APP.fm(f)});return d},Nu=function(){var a=Cu();return $APP.p(a)?Mu(a):null},Ou=function(){var a=Du();return $APP.p(a)?Mu(a):null},Su=function(a,b){return new $APP.S(null,2,5,$APP.V,[Pu,new $APP.m(null,3,[Qu,a+25,Ru,b+25,$APP.Ar,5],null)],null)},Xu=function(a,b,c){var d=$APP.M(a,0,null);a=$APP.M(a,1,null);return new $APP.S(null,5,5,$APP.V,[Tu,2+
(d>a?d:a),b,c,new $APP.S(null,2,5,$APP.V,[Uu,new $APP.m(null,4,[$APP.yr,50,$APP.xr,50,Vu,50*d,Wu,50*a],null)],null)],null)},Yu=function(a,b,c,d,e){return new $APP.S(null,6,5,$APP.V,[$APP.Me,Tu,a,d,e,function(){return function h(g){return new $APP.ue(null,function(){for(;;){var l=$APP.C(g);if(l){if($APP.Ed(l)){var n=$APP.oc(l),q=$APP.F(n),r=$APP.xe(q);a:for(var t=0;;)if(t<q){var u=$APP.qd(n,t),x=$APP.M(u,0,null),v=$APP.M(u,1,null);$APP.M(u,2,null);u=$APP.ud(new $APP.S(null,5,5,$APP.V,[c,50*x,50*v,
d,e],null),new $APP.m(null,1,[$APP.oj,new $APP.S(null,2,5,$APP.V,[x,v],null)],null));r.add(u);t+=1}else{n=!0;break a}return n?$APP.Ae($APP.Ce(r),h($APP.pc(l))):$APP.Ae($APP.Ce(r),null)}r=$APP.D(l);n=$APP.M(r,0,null);q=$APP.M(r,1,null);$APP.M(r,2,null);return $APP.P($APP.ud(new $APP.S(null,5,5,$APP.V,[c,50*n,50*q,d,e],null),new $APP.m(null,1,[$APP.oj,new $APP.S(null,2,5,$APP.V,[n,q],null)],null)),h($APP.Pc(l)))}return null}},null,null)}(b)}()],null)},av=function(a){return new $APP.S(null,2,5,$APP.V,
[$APP.$p,function(){return function d(c){return new $APP.ue(null,function(){for(;;){var e=$APP.C(c);if(e){var f=e;if($APP.Ed(f)){var g=$APP.oc(f),h=$APP.F(g),l=$APP.xe(h);return function(){for(var q=0;;)if(q<h){var r=$APP.qd(g,q);$APP.Be(l,$APP.ud(new $APP.S(null,2,5,$APP.V,[Zu,new $APP.m(null,1,[$u,$APP.nf.h(function(){return function(t){return 50*t}}(q,r,g,h,l,f,e),ou(r))],null)],null),new $APP.m(null,1,[$APP.oj,r],null)));q+=1}else return!0}()?$APP.Ae($APP.Ce(l),d($APP.pc(f))):$APP.Ae($APP.Ce(l),
null)}var n=$APP.D(f);return $APP.P($APP.ud(new $APP.S(null,2,5,$APP.V,[Zu,new $APP.m(null,1,[$u,$APP.nf.h(function(){return function(q){return 50*q}}(n,f,e),ou(n))],null)],null),new $APP.m(null,1,[$APP.oj,n],null)),d($APP.Pc(f)))}return null}},null,null)}(a)}()],null)},cv=function(a,b,c,d){return new $APP.S(null,2,5,$APP.V,[bv,new $APP.m(null,2,[$APP.ir,["rotate(",$APP.w.g(d)," ",$APP.w.g(50*a)," ",$APP.w.g(50*b),")"].join(""),$u,$APP.nf.h(function(e){return 50*e},new $APP.S(null,6,5,$APP.V,[a,b,
a+c,b+c,a+c,b-c],null))],null)],null)},gv=function(a,b){return new $APP.S(null,3,5,$APP.V,[dv,new $APP.m(null,3,[ev,"left",fv,"bottom",$APP.ir,yu($APP.ir.g(a)).translate(b/-2*50,b/-2*50).inverse().translate(2.5,-32.5).toString()],null),$APP.lj.g(a)],null)},hv=function(a,b){return new $APP.S(null,7,5,$APP.V,[Tu,3,a,b,new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,4,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,1.5],null),new $APP.S(null,2,5,$APP.V,[1.1,1.5],null)],null),new $APP.S(null,
2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.1,1.1],null),new $APP.S(null,2,5,$APP.V,[1.1,1.9],null)],null),new $APP.S(null,6,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null),new $APP.S(null,2,5,$APP.V,[1.2,1.1],null),new $APP.S(null,2,5,$APP.V,[1.2,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.5],null),new $APP.S(null,2,5,$APP.V,[1.2,1.5],
null)],null)],null)],null),new $APP.S(null,3,5,$APP.V,[gv,b,3],null),$APP.G.h($APP.os.g(b),"nmos")?new $APP.S(null,5,5,$APP.V,[cv,1.3,1.5,.12,0],null):new $APP.S(null,5,5,$APP.V,[cv,1.4,1.5,.12,180],null)],null)},iv=function(a,b){return new $APP.S(null,7,5,$APP.V,[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,3,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,1.5],null),new $APP.S(null,2,5,$APP.V,[1.15,1.5],null)],null),new $APP.S(null,
2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.15,1.15],null),new $APP.S(null,2,5,$APP.V,[1.15,1.85],null)],null),new $APP.S(null,6,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null),new $APP.S(null,2,5,$APP.V,[1.15,1.4],null),new $APP.S(null,2,5,$APP.V,[1.15,1.6],null),new $APP.S(null,2,5,$APP.V,[1.5,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),$APP.G.h($APP.os.g(b),"npn")?new $APP.S(null,5,5,$APP.V,[cv,1.4,1.81,.12,-140],null):
new $APP.S(null,5,5,$APP.V,[cv,1.25,1.68,.12,40],null)],null)},kv=function(a,b){var c=$APP.os.g(b);c=hu($APP.y(jv),new $APP.S(null,2,5,$APP.V,[["models:",$APP.w.g(c)].join(""),$APP.Yr],null),new $APP.S(null,2,5,$APP.V,[1,1],null));return Xu(c,a,b)},lv=function(a,b){var c=$APP.os.g(b),d=hu($APP.y(jv),new $APP.S(null,2,5,$APP.V,[["models:",$APP.w.g(c)].join(""),$APP.Yr],null),new $APP.S(null,2,5,$APP.V,[1,1],null)),e=$APP.M(d,0,null);d=$APP.M(d,1,null);c=hu($APP.y(jv),new $APP.S(null,2,5,$APP.V,[["models:",
$APP.w.g(c)].join(""),$APP.lq],null),$APP.Rf);return Yu(2+(e>d?e:d),c,Su,a,b)},ov=function(a,b){return["?",$APP.w.g((new URLSearchParams({schem:[$APP.w.g(a),"$",$APP.w.g(b)].join(""),db:mv,sync:nv})).toString())].join("")},uv=function(a,b){var c=$APP.os.g(b),d=$APP.xf(b,new $APP.S(null,2,5,$APP.V,[pv,qv],null)),e=hu($APP.y(jv),new $APP.S(null,2,5,$APP.V,[["models:",$APP.w.g(c)].join(""),$APP.Yr],null),new $APP.S(null,2,5,$APP.V,[1,1],null)),f=$APP.M(e,0,null),g=$APP.M(e,1,null);e=$APP.xf($APP.y(jv),
new $APP.S(null,2,5,$APP.V,[["models:",$APP.w.g(c)].join(""),$APP.ss],null));return new $APP.S(null,5,5,$APP.V,[Tu,2+(f>g?f:g),a,b,$APP.p(e)?new $APP.S(null,2,5,$APP.V,[rv,new $APP.m(null,3,[$APP.mq,e,sv,function(h){return h.preventDefault()},$APP.ns,function(){return window.location.assign(ov(c,d))}],null)],null):new $APP.S(null,6,5,$APP.V,[$APP.$p,new $APP.S(null,2,5,$APP.V,[av,function(){return function n(l){return new $APP.ue(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=
$APP.oc(q),t=$APP.F(r),u=$APP.xe(t);a:for(var x=0;;)if(x<t){var v=$APP.qd(r,x);u.add(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[v,.5],null),new $APP.S(null,2,5,$APP.V,[v,1],null)],null));x+=1}else{r=!0;break a}return r?$APP.Ae($APP.Ce(u),n($APP.pc(q))):$APP.Ae($APP.Ce(u),null)}u=$APP.D(q);return $APP.P(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[u,.5],null),new $APP.S(null,2,5,$APP.V,[u,1],null)],null),n($APP.Pc(q)))}return null}},null,null)}($APP.Kh(1.5,1.5+f))}()],null),
new $APP.S(null,2,5,$APP.V,[av,function(){return function n(l){return new $APP.ue(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.oc(q),t=$APP.F(r),u=$APP.xe(t);a:for(var x=0;;)if(x<t){var v=$APP.qd(r,x);u.add(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,v],null),new $APP.S(null,2,5,$APP.V,[1,v],null)],null));x+=1}else{r=!0;break a}return r?$APP.Ae($APP.Ce(u),n($APP.pc(q))):$APP.Ae($APP.Ce(u),null)}u=$APP.D(q);return $APP.P(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,
2,5,$APP.V,[.5,u],null),new $APP.S(null,2,5,$APP.V,[1,u],null)],null),n($APP.Pc(q)))}return null}},null,null)}($APP.Kh(1.5,1.5+g))}()],null),new $APP.S(null,2,5,$APP.V,[av,function(){return function n(l){return new $APP.ue(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.oc(q),t=$APP.F(r),u=$APP.xe(t);a:for(var x=0;;)if(x<t){var v=$APP.qd(r,x);u.add(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[v,g+1.5],null),new $APP.S(null,2,5,$APP.V,[v,g+1],null)],null));x+=1}else{r=
!0;break a}return r?$APP.Ae($APP.Ce(u),n($APP.pc(q))):$APP.Ae($APP.Ce(u),null)}u=$APP.D(q);return $APP.P(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[u,g+1.5],null),new $APP.S(null,2,5,$APP.V,[u,g+1],null)],null),n($APP.Pc(q)))}return null}},null,null)}($APP.Kh(1.5,1.5+f))}()],null),new $APP.S(null,2,5,$APP.V,[av,function(){return function n(l){return new $APP.ue(null,function(){for(;;){var q=$APP.C(l);if(q){if($APP.Ed(q)){var r=$APP.oc(q),t=$APP.F(r),u=$APP.xe(t);a:for(var x=0;;)if(x<
t){var v=$APP.qd(r,x);u.add(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[f+1.5,v],null),new $APP.S(null,2,5,$APP.V,[f+1,v],null)],null));x+=1}else{r=!0;break a}return r?$APP.Ae($APP.Ce(u),n($APP.pc(q))):$APP.Ae($APP.Ce(u),null)}u=$APP.D(q);return $APP.P(new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[f+1.5,u],null),new $APP.S(null,2,5,$APP.V,[f+1,u],null)],null),n($APP.Pc(q)))}return null}},null,null)}($APP.Kh(1.5,1.5+g))}()],null),new $APP.S(null,2,5,$APP.V,[tv,new $APP.m(null,
4,[$APP.yr,50,$APP.xr,50,Vu,50*f,Wu,50*g],null)],null)],null)],null)},vv=function(a,b,c,d){var e=$APP.M(b,0,null),f=$APP.M(b,1,null),g=$APP.M(b,2,null),h=$APP.M(b,3,null),l=$APP.M(b,4,null),n=$APP.M(b,5,null),q=Fu(a)/2-.5;return $APP.nf.h(function(r){var t=$APP.M(r,0,null),u=$APP.M(r,1,null);$APP.M(r,2,null);r=t-q;u-=q;return new $APP.S(null,2,5,$APP.V,[Math.round(c+(e*r+g*u+l)+q),Math.round(d+(f*r+h*u+n)+q)],null)},a)},wv=function(a,b){return $APP.E(ku(function(c){return $APP.Pe(c,a+b)},ju(function(c){return c+
(0<b?1:-1)},a)))},xv=function(a){var b=$APP.Oe(a);$APP.N.h(b,$APP.sm);var c=$APP.N.h(b,$APP.yr),d=$APP.N.h(b,$APP.xr);a=$APP.N.h(b,$APP.Op);b=$APP.N.h(b,$APP.Pp);return new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[c,d],null),new $APP.S(null,2,5,$APP.V,[c+a,d+b],null)],null),$APP.G.h(a,0)?$APP.nf.h(function(e){return new $APP.S(null,2,5,$APP.V,[c,e],null)},wv(d,b)):$APP.G.h(b,0)?$APP.nf.h(function(e){return new $APP.S(null,2,5,$APP.V,[e,d],null)},wv(c,a)):$APP.Rf],
null)},Bv=function(a){var b=$APP.Oe(a),c=$APP.N.h(b,$APP.sm),d=$APP.N.h(b,$APP.yr),e=$APP.N.h(b,$APP.xr),f=$APP.N.h(b,$APP.os),g=$APP.N.h(b,$APP.ir),h=$APP.N.h(yv,f),l=zv.g(h),n=Av.g(h),q=$APP.M(n,0,null),r=$APP.M(n,1,null);return new $APP.S(null,2,5,$APP.V,[vv(l,g,d,e),vv(function(){return function x(u){return new $APP.ue(null,function(){for(var v=u;;){var B=$APP.C(v);if(B){var I=B,J=$APP.D(I);if(B=$APP.C(function(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb){return function sb(sc){return new $APP.ue(null,
function(Ad,zc){return function(){for(;;){var yb=$APP.C(sc);if(yb){if($APP.Ed(yb)){var dc=$APP.oc(yb),Qc=$APP.F(dc),tb=$APP.xe(Qc);a:for(var Eb=0;;)if(Eb<Qc){var ec=$APP.qd(dc,Eb);tb.add(new $APP.S(null,3,5,$APP.V,[zc+1,ec+1,"%"],null));Eb+=1}else{dc=!0;break a}return dc?$APP.Ae($APP.Ce(tb),sb($APP.pc(yb))):$APP.Ae($APP.Ce(tb),null)}tb=$APP.D(yb);return $APP.P(new $APP.S(null,3,5,$APP.V,[zc+1,tb+1,"%"],null),sb($APP.Pc(yb)))}return null}}}(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb),null,null)}}(v,
J,I,B,h,l,n,q,r,a,b,c,d,e,f,g)($APP.Kh(0,r))))return $APP.tf.h(B,x($APP.Pc(v)));v=$APP.Pc(v)}else return null}},null,null)}($APP.Kh(0,q))}(),g,d,e)],null)},Cv=function(a){var b=$APP.Oe(a),c=$APP.N.h(b,$APP.sm),d=$APP.N.h(b,$APP.yr),e=$APP.N.h(b,$APP.xr),f=$APP.N.h(b,$APP.os),g=$APP.N.h(b,$APP.ir),h=$APP.N.h($APP.y(jv),["models:",$APP.w.g(f)].join("")),l=$APP.lq.g(h),n=$APP.Yr.g(h),q=$APP.M(n,0,null),r=$APP.M(n,1,null);return new $APP.S(null,2,5,$APP.V,[vv(l,g,d,e),vv(function(){return function x(u){return new $APP.ue(null,
function(){for(var v=u;;){var B=$APP.C(v);if(B){var I=B,J=$APP.D(I);if(B=$APP.C(function(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb){return function sb(sc){return new $APP.ue(null,function(Ad,zc){return function(){for(;;){var yb=$APP.C(sc);if(yb){if($APP.Ed(yb)){var dc=$APP.oc(yb),Qc=$APP.F(dc),tb=$APP.xe(Qc);a:for(var Eb=0;;)if(Eb<Qc){var ec=$APP.qd(dc,Eb);tb.add(new $APP.S(null,3,5,$APP.V,[zc+1,ec+1,"%"],null));Eb+=1}else{dc=!0;break a}return dc?$APP.Ae($APP.Ce(tb),sb($APP.pc(yb))):$APP.Ae($APP.Ce(tb),
null)}tb=$APP.D(yb);return $APP.P(new $APP.S(null,3,5,$APP.V,[zc+1,tb+1,"%"],null),sb($APP.Pc(yb)))}return null}}}(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb),null,null)}}(v,J,I,B,h,l,n,q,r,a,b,c,d,e,f,g)($APP.Kh(0,r))))return $APP.tf.h(B,x($APP.Pc(v)));v=$APP.Pc(v)}else return null}},null,null)}($APP.Kh(0,q))}(),g,d,e)],null)},Dv=function(a){var b=$APP.os.g(a);return $APP.G.h(b,"wire")?xv(a):$APP.Ld(yv,b)?Bv(a):Cv(a)},Ev=function(){var a=$APP.y(eu);a=$APP.sh(a);for(var b=$APP.C(a),c=$APP.D(b),d=$APP.E(b),
e=$APP.Te,f=$APP.Te,g=a;;){var h=e,l=f,n=g,q=$APP.C(n),r=$APP.D(q),t=$APP.E(q),u=r,x=t,v=Dv(u),B=$APP.M(v,0,null),I=$APP.M(v,1,null),J=$APP.Sa(function(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib){return function(Lb,ab){return $APP.jp.u(Lb,ab,$APP.Ys,$APP.sm.g(ib))}}(e,f,g,v,B,I,h,l,n,q,r,t,u,x,$APP.Te,$APP.Te,a,a,b,c,d,c,d),h,B);e=$APP.Sa(function(O,Q,T,U,W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb){return function(ab,Mb){return $APP.jp.u(ab,Mb,$APP.Ys,$APP.sm.g(Lb))}}(e,f,g,v,B,I,J,h,l,n,q,r,t,u,x,$APP.Te,$APP.Te,a,a,b,c,
d,c,d),l,I);if(x)f=e,e=J,g=x;else return new $APP.S(null,2,5,$APP.V,[J,e],null)}},Fv=function(a){var b=$APP.M(a,0,null);a=$APP.M(a,1,null);return $APP.Sa(function(c,d){var e=$APP.M(d,0,null);d=$APP.M(d,1,null);return $APP.Ld(b,e)?$APP.Sa(function(f,g){return $APP.jp.u(f,g,$APP.Zs,e)},c,$APP.vf(function(f){return $APP.G.h("wire",$APP.xf($APP.y(eu),new $APP.S(null,2,5,$APP.V,[f,$APP.os],null)))},d)):c},$APP.Te,a)},Jv=function(a,b){var c=$APP.N.h($APP.y(eu),a),d=$APP.Oe(c);c=$APP.N.h(d,$APP.yr);var e=
$APP.N.h(d,$APP.xr),f=$APP.N.h(d,$APP.Op);d=$APP.N.h(d,$APP.Pp);c=(0,$APP.Zs)(b,new $APP.S(null,2,5,$APP.V,[c,e],null),new $APP.S(null,2,5,$APP.V,[c+f,e+d],null));b=$APP.D($APP.y(Gv));a:for(f=$APP.C(c),e=$APP.D(f),f=$APP.E(f),$APP.M(e,0,null),$APP.M(e,1,null),e=$APP.C(f),f=$APP.D(e),$APP.E(e),$APP.M(f,0,null),$APP.M(f,1,null),f=a,d=c,e=$APP.Te;;){c=f;d=$APP.C(d);f=$APP.D(d);var g=$APP.E(d);d=f;f=$APP.M(d,0,null);d=$APP.M(d,1,null);var h=g;g=$APP.C(h);var l=$APP.D(g);$APP.E(g);g=$APP.M(l,0,null);l=
$APP.M(l,1,null);var n=e;if(h)e=$APP.Eh($APP.mk.g(a)),c=$APP.wd(Hv.h($APP.N.h(b,new $APP.S(null,2,5,$APP.V,[f,d],null)),$APP.N.h(b,new $APP.S(null,2,5,$APP.V,[g,l],null))))?$APP.X.i(n,c,new $APP.m(null,6,[$APP.os,"wire",$APP.ir,$APP.at,$APP.yr,f,$APP.xr,d,$APP.Op,g-f,$APP.Pp,l-d],null)):n,f=e,d=h,e=c;else{a=n;break a}}return $APP.Z.i(eu,$APP.Wn.h(Iv,$APP.rk),a)},Kv=function(a){var b=document.getElementById("mosaic_canvas").getScreenCTM().inverse();a=DOMPointReadOnly.fromPoint($APP.Qk(new $APP.m(null,
2,[$APP.yr,a.clientX,$APP.xr,a.clientY],null))).matrixTransform(b);return new $APP.S(null,2,5,$APP.V,[a.x/50,a.y/50],null)},Nv=function(a,b,c){return $APP.Z.u(Lv,$APP.jp,Mv,function(d){var e=$APP.M(d,0,null),f=$APP.M(d,1,null),g=$APP.M(d,2,null);d=$APP.M(d,3,null);var h=a*g*.1,l=a*d*.1;return new $APP.S(null,4,5,$APP.V,[e-(b-e)/g*h,f-(c-f)/d*l,g+h,d+l],null)})},Ov=function(a){var b=Kv(a),c=$APP.M(b,0,null);b=$APP.M(b,1,null);return Nv(0<a.deltaY?1:-1,50*c,50*b)},Pv=function(a){var b=Mv.g($APP.y(Lv)),
c=$APP.M(b,0,null),d=$APP.M(b,1,null),e=$APP.M(b,2,null);b=$APP.M(b,3,null);return Nv(a,c+e/2,d+b/2)},Qv=function(a){var b=Ku($APP.os.g(a)),c=$APP.od($APP.fj(b,":",0));return $APP.Z.u(eu,$APP.X,b,$APP.p($APP.lj.g(a))?a:$APP.X.i(a,$APP.lj,c))},Vv=function(a){a=Rv.i($APP.Vo,a,yu);return $APP.p($APP.y(Sv))?$APP.Z.u(Sv,$APP.jp,$APP.ir,a):$APP.Z.l(eu,Tv,$APP.y(Uv),$APP.jp,$APP.K([$APP.ir,a]))},Xv=function(){var a=Wv.g($APP.y(Lv));$APP.Z.u(Lv,$APP.X,Wv,$APP.yh);return $APP.Z.i(eu,function(b,c){return $APP.Me.i($APP.Hj,
b,c)},a)},Zv=function(a){return $APP.Z.u(Lv,$APP.jp,Mv,function(b){var c=$APP.M(b,0,null),d=$APP.M(b,1,null),e=$APP.M(b,2,null);b=$APP.M(b,3,null);var f=document.getElementById("mosaic_canvas").getScreenCTM().inverse();f.e=0;f.f=0;var g=$APP.y(Yv);var h=$APP.M(g,0,null);var l=$APP.M(g,1,null);g=a.clientX;var n=a.clientY;f=DOMPointReadOnly.fromPoint($APP.Qk(new $APP.m(null,2,[$APP.yr,g-h,$APP.xr,n-l],null))).matrixTransform(f);$APP.hf(Yv,new $APP.S(null,2,5,$APP.V,[g,n],null));h=new $APP.S(null,2,
5,$APP.V,[f.x,f.y],null);f=$APP.M(h,0,null);h=$APP.M(h,1,null);return new $APP.S(null,4,5,$APP.V,[c-f,d-h,e,b],null)})},bw=function(a){var b=Kv(a);a=$APP.M(b,0,null);b=$APP.M(b,1,null);var c=$v.g($APP.y(Lv)),d=$APP.M(c,0,null);c=$APP.M(c,1,null);return $APP.Z.l(aw,$APP.X,$APP.yr,a-d,$APP.K([$APP.xr,b-c]))},cw=function(a){var b=Kv(a),c=$APP.M(b,0,null),d=$APP.M(b,1,null);return $APP.Z.h(Sv,function(e){var f=c-$APP.yr.g(e)-.5,g=d-$APP.xr.g(e)-.5;return $APP.p(a.ctrlKey)?$APP.X.l(e,$APP.Op,f,$APP.K([$APP.Pp,
g])):Math.abs(f)>Math.abs(g)?$APP.X.l(e,$APP.Op,f,$APP.K([$APP.Pp,0])):$APP.X.l(e,$APP.Op,0,$APP.K([$APP.Pp,g]))})},ew=function(a){var b=dw.g($APP.y(Lv));switch(b instanceof $APP.R?b.qa:null){case "nyancad.mosaic.editor/view":return Zv(a);case "nyancad.mosaic.editor/wire":return cw(a);case "nyancad.mosaic.editor/device":return bw(a);case "nyancad.mosaic.editor/box":return bw(a);default:return null}},iw=function(a,b){if($APP.G.h(b.buttons,1)&&$APP.G.h($APP.y(fw),gw)&&!$APP.Ld($APP.y(hw),a)){var c=
$APP.jm(1);$APP.Ol(function(){var d=function(){return function(){function f(l){for(;;){a:try{for(;;){var n=void 0,q=l,r=q[1];if(1===r){var t=$APP.Z.i(hw,$APP.ne,a),u=$APP.Z.i(eu,$APP.Hj,a);q[7]=t;n=q;var x=$APP.hm(n,2,u)}else if(2===r){var v=q[2],B=$APP.Z.i(hw,$APP.fp,a);q[8]=v;n=q;x=$APP.im(n,B)}else x=null;if(!$APP.re(x,$APP.gm)){var I=x;break a}}}catch(J){I=J;l[2]=I;if($APP.C(l[4]))l[1]=$APP.D(l[4]);else throw I;I=$APP.gm}if(!$APP.re(I,$APP.gm))return I}}function g(){var l=[null,null,null,null,
null,null,null,null,null];l[0]=h;l[1]=1;return l}var h=null;h=function(l){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,l)}throw Error("Invalid arity: "+arguments.length);};h.m=g;h.g=f;return h}()}(),e=function(){var f=d();f[6]=c;return f}();return $APP.fm(e)});return c}return null},lw=function(a){$APP.Z.u(Lv,$APP.X,jw,Kv(a));var b=$APP.y(fw);switch(b instanceof $APP.R?b.qa:null){case "nyancad.mosaic.editor/wire":a:switch(b=dw.g($APP.y(Lv)),b instanceof $APP.R?b.qa:
null){case "nyancad.mosaic.editor/view":a=Zv(a);break a;case "nyancad.mosaic.editor/wire":a=cw(a);break a;default:a=null}return a;case "nyancad.mosaic.editor/pan":return 0<a.buttons?Zv(a):null;case "nyancad.mosaic.editor/device":if($APP.G.h(dw.g($APP.y(Lv)),kw))a=Zv(a);else{b=Kv(a);a=$APP.M(b,0,null);b=$APP.M(b,1,null);var c=$APP.xf(yv,new $APP.S(null,2,5,$APP.V,[$APP.os.g($APP.y(Sv)),Av],null)),d=$APP.M(c,0,null);c=$APP.M(c,1,null);a=$APP.Z.l(Sv,$APP.X,$APP.yr,Math.round(a-d-.5),$APP.K([$APP.xr,
Math.round(b-c-.5)]))}return a;default:return ew(a)}},ow=function(a){var b=$APP.M(a,0,null);a=$APP.M(a,1,null);return $APP.Z.l(Lv,$APP.X,mw,new $APP.m(null,5,[$APP.os,"wire",$APP.yr,Math.floor(b),$APP.xr,Math.floor(a),$APP.Op,0,$APP.Pp,0],null),$APP.K([dw,nw]))},pw=function(a,b){var c=$APP.M(a,0,null);a=$APP.M(a,1,null);if($APP.p(b))return ow(new $APP.S(null,2,5,$APP.V,[c,a],null));var d=Tv.i($APP.y(Sv),new $APP.xh(null,new $APP.m(null,2,[$APP.Op,null,$APP.Pp,null],null),null),Math.round);c=$APP.Oe(d);
b=$APP.N.h(c,$APP.Op);c=$APP.N.h(c,$APP.Pp);var e=Math.round($APP.yr.g(d)+b),f=Math.round($APP.xr.g(d)+c),g=$APP.y(Gv);a=$APP.M(g,0,null);g=$APP.M(g,1,null);a=$APP.Ld(a,new $APP.S(null,2,5,$APP.V,[e,f],null))||$APP.Ld(g,new $APP.S(null,2,5,$APP.V,[e,f],null));if(.5>Math.abs(b)&&.5>Math.abs(c))return $APP.Z.l(Lv,$APP.X,mw,null,$APP.K([dw,null]));if(a){var h=$APP.jm(1);$APP.Ol(function(){var l=function(){return function(){function q(u){for(;;){a:try{for(;;){var x=u,v=x[1];if(1===v){var B=Qv(d);var I=
$APP.hm(x,2,B)}else if(2===v){var J=x[2],O=$APP.Z.l(Lv,$APP.X,mw,null,$APP.K([dw,null]));x[7]=J;I=$APP.im(x,O)}else I=null;if(!$APP.re(I,$APP.gm)){var Q=I;break a}}}catch(T){Q=T;u[2]=Q;if($APP.C(u[4]))u[1]=$APP.D(u[4]);else throw Q;Q=$APP.gm}if(!$APP.re(Q,$APP.gm))return Q}}function r(){var u=[null,null,null,null,null,null,null,null];u[0]=t;u[1]=1;return u}var t=null;t=function(u){switch(arguments.length){case 0:return r.call(this);case 1:return q.call(this,u)}throw Error("Invalid arity: "+arguments.length);
};t.m=r;t.g=q;return t}()}(),n=function(){var q=l();q[6]=h;return q}();return $APP.fm(n)})}else h=$APP.jm(1),$APP.Ol(function(){var l=function(){return function(){function q(u){for(;;){a:try{for(;;){var x=u,v=x[1];if(1===v){var B=Qv(d);var I=$APP.hm(x,2,B)}else if(2===v){var J=x[2],O=ow(new $APP.S(null,2,5,$APP.V,[e,f],null));x[7]=J;I=$APP.im(x,O)}else I=null;if(!$APP.re(I,$APP.gm)){var Q=I;break a}}}catch(T){Q=T;u[2]=Q;if($APP.C(u[4]))u[1]=$APP.D(u[4]);else throw Q;Q=$APP.gm}if(!$APP.re(Q,$APP.gm))return Q}}
function r(){var u=[null,null,null,null,null,null,null,null];u[0]=t;u[1]=1;return u}var t=null;t=function(u){switch(arguments.length){case 0:return r.call(this);case 1:return q.call(this,u)}throw Error("Invalid arity: "+arguments.length);};t.m=r;t.g=q;return t}()}(),n=function(){var q=l();q[6]=h;return q}();return $APP.fm(n)});return h},qw=function(){function a(h,l){return $APP.G.h($APP.os.g(l),"wire")?$APP.ne.l(h,new $APP.S(null,2,5,$APP.V,[$APP.yr.g(l),$APP.xr.g(l)],null),$APP.K([new $APP.S(null,
2,5,$APP.V,[$APP.yr.g(l)+$APP.Op.g(l),$APP.xr.g(l)+$APP.Pp.g(l)],null)])):h}function b(h){h=$APP.N.h(c,h);var l=$APP.G.h($APP.os.g(h),"wire");return l?h:l}var c=$APP.y(eu),d=$APP.Ze(c,$APP.y(Uv));if($APP.p(d)){var e=a($APP.yh,d);for(d=$APP.zh([$APP.sm.g(d)]);;)if($APP.C(e)){var f=$APP.y(Gv),g=$APP.M(f,0,null);$APP.M(f,1,null);f=$APP.Bs.h($APP.Ch($APP.vf(b,$APP.uf(g,$APP.K([e])))),d);g=$APP.Sa(a,$APP.yh,$APP.nf.h(c,f));e=$APP.Bs.h(g,e);d=$APP.ui.h(d,f)}else return $APP.hf(Uv,d)}else return null},tw=
function(){var a=$APP.y(Lv),b=mw.g(a);a=$APP.p(b)?$APP.G.h(rw.g(a),nw):b;return $APP.p(a)?$APP.Z.l(Lv,$APP.X,dw,null,$APP.K([mw,null])):$APP.Z.l(Lv,$APP.X,dw,null,$APP.K([rw,sw,mw,null]))},vw=function(a){$APP.gi($APP.K([a]));return uw.postMessage(a)},xw=function(a,b){function c(g){return $APP.X.i(g,dw,function(){var h=rw.g(g);h=h instanceof $APP.R?h.qa:null;switch(h){case "nyancad.mosaic.editor/cursor":return ww;case "nyancad.mosaic.editor/wire":return nw;case "nyancad.mosaic.editor/pan":return kw;
case "nyancad.mosaic.editor/probe":return null;default:throw Error(["No matching clause: ",$APP.w.g(h)].join(""));}}())}function d(g){var h=$APP.Ld(g,a);return $APP.p(h?h:b.shiftKey)?(0,$APP.Ys)(g,a):$APP.zh([a])}$APP.Z.u(Lv,$APP.X,$v,Kv(b));$APP.hf(Yv,new $APP.S(null,2,5,$APP.V,[b.clientX,b.clientY],null));var e=$APP.y(Lv);if($APP.Pe(rw.g(e),ww)&&$APP.G.h(b.button,0))if(b.stopPropagation(),$APP.G.h(b.detail,1)){var f=rw.g(e);switch(f instanceof $APP.R?f.qa:null){case "nyancad.mosaic.editor/wire":return pw(Kv(b),
null==dw.g(e));case "nyancad.mosaic.editor/eraser":return iw(a,b);case "nyancad.mosaic.editor/probe":return vw(a);default:return $APP.Z.h(Lv,function(g){return c($APP.jp.i(g,Wv,d))})}}else switch(e=rw.g(e),e=e instanceof $APP.R?e.qa:null,e){case "nyancad.mosaic.editor/cursor":return qw();case "nyancad.mosaic.editor/wire":return tw();default:throw Error(["No matching clause: ",$APP.w.g(e)].join(""));}else return null},zw=function(a){$APP.hf(Yv,new $APP.S(null,2,5,$APP.V,[a.clientX,a.clientY],null));
return $APP.G.h(a.button,1)?$APP.Z.u(Lv,$APP.X,dw,kw):$APP.G.h(a.button,0)&&$APP.G.h(null,dw.g($APP.y(Lv)))&&$APP.G.h(sw,$APP.y(fw))?$APP.Z.l(Lv,$APP.X,Wv,$APP.yh,$APP.K([dw,yw,$v,Kv(a)])):$APP.G.h(a.button,0)&&$APP.G.h(nw,$APP.y(fw))?pw(Kv(a),null==dw.g($APP.y(Lv))):null},Aw=function(a){var b=dw.g($APP.y(Lv));b=$APP.p(b)?b:$APP.Pe(rw.g($APP.y(Lv)),sw);return $APP.p(b)?(tw(),a.preventDefault()):null},Jw=function(a,b,c,d){b=$APP.N.h($APP.N.i(yv,$APP.os.g(b),new $APP.m(null,3,[Av,new $APP.Kc(function(){return kv},
Bw,$APP.Yg([$APP.Dp,$APP.lj,$APP.Uq,$APP.Vp,$APP.js,$APP.Fp,$APP.Jp,$APP.dr,$APP.pm,$APP.or],[Cw,Dw,"nyancad/mosaic/editor.cljs",20,1,333,333,$APP.gj(new $APP.S(null,2,5,$APP.V,[$APP.qq,$APP.pq],null)),null,$APP.p(kv)?kv.Mc:null])),zv,new $APP.Kc(function(){return lv},Ew,$APP.Yg([$APP.Dp,$APP.lj,$APP.Uq,$APP.Vp,$APP.js,$APP.Fp,$APP.Jp,$APP.dr,$APP.pm,$APP.or],[Cw,Fw,"nyancad/mosaic/editor.cljs",19,1,338,338,$APP.gj(new $APP.S(null,2,5,$APP.V,[$APP.qq,$APP.pq],null)),null,$APP.p(lv)?lv.Mc:null])),
Gw,new $APP.Kc(function(){return uv},Hw,$APP.Yg([$APP.Dp,$APP.lj,$APP.Uq,$APP.Vp,$APP.js,$APP.Fp,$APP.Jp,$APP.dr,$APP.pm,$APP.or],[Cw,Iw,"nyancad/mosaic/editor.cljs",18,1,348,348,$APP.gj(new $APP.S(null,2,5,$APP.V,[$APP.qq,$APP.pq],null)),null,$APP.p(uv)?uv.Mc:null]))],null)),a);return $APP.sd(b)?$APP.ud(new $APP.S(null,3,5,$APP.V,[b,c,d],null),new $APP.m(null,1,[$APP.oj,c],null)):$APP.G.h(a,Av)?$APP.ud(new $APP.S(null,4,5,$APP.V,[Xu,b,c,d],null),new $APP.m(null,1,[$APP.oj,c],null)):$APP.G.h(a,zv)?
$APP.ud(new $APP.S(null,6,5,$APP.V,[Yu,Fu(b),b,Su,c,d],null),new $APP.m(null,1,[$APP.oj,c],null)):$APP.ud(new $APP.S(null,1,5,$APP.V,[function(e){return $APP.gi($APP.K(["invalid model for",e]))}],null),new $APP.m(null,1,[$APP.oj,c],null))},Lw=function(a,b,c,d){function e(f,g){return $APP.jp.i(f,Wv,function(h){return $APP.ui.i($APP.yh,du(function(l){return $APP.Ld(g,l)}),h)})}$APP.Z.h(Lv,function(f){f=$APP.X.l(f,dw,null,$APP.K([Kw,new $APP.m(null,4,[$APP.yr,0,$APP.xr,0,$APP.Op,0,$APP.Pp,0],null)]));
f=$APP.p(a)?$APP.X.i(f,Wv,$APP.yh):f;return e(f,$APP.y(eu))});return $APP.Z.u(eu,Tv,b,function(f){f=$APP.Oe(f);var g=$APP.N.h(f,$APP.yr),h=$APP.N.h(f,$APP.xr);return $APP.X.l(f,$APP.yr,Math.round(g+c),$APP.K([$APP.xr,Math.round(h+d)]))})},Nw=function(){var a=$v.g($APP.y(Lv)),b=$APP.M(a,0,null),c=$APP.M(a,1,null),d=Kw.g($APP.y(Lv)),e=$APP.Oe(d),f=$APP.N.h(e,$APP.yr),g=$APP.N.h(e,$APP.xr),h=Math.floor(Math.min(b,b+f)),l=Math.floor(Math.min(c,c+g)),n=Math.floor(Math.max(b,b+f)),q=Math.floor(Math.max(c,
c+g)),r=$APP.y(Gv),t=$APP.M(r,0,null),u=$APP.M(r,1,null),x=$APP.Me.h(Mw,function(){return function J(I){return new $APP.ue(null,function(){for(var O=I;;){var Q=$APP.C(O);if(Q){var T=Q,U=$APP.D(T);if(Q=$APP.C(function(W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb,dd,sc,sb,Ad,zc,yb){return function tb(Qc){return new $APP.ue(null,function(Eb,ec,Od,jh,If,Pd,li,Jf,$e,kh,lh,mh,Db,xt,yt,zt,Ml){return function(){for(;;){var Qg=$APP.C(Qc);if(Qg){if($APP.Ed(Qg)){var kf=$APP.oc(Qg),Je=$APP.F(kf),lf=$APP.xe(Je);a:for(var Si=
0;;)if(Si<Je){var Wf=$APP.qd(kf,Si);Wf=$APP.N.h(Ml,new $APP.S(null,2,5,$APP.V,[ec,Wf],null));lf.add(Wf);Si+=1}else{kf=!0;break a}return kf?$APP.Ae($APP.Ce(lf),tb($APP.pc(Qg))):$APP.Ae($APP.Ce(lf),null)}lf=$APP.D(Qg);return $APP.P($APP.N.h(Ml,new $APP.S(null,2,5,$APP.V,[ec,lf],null)),tb($APP.Pc(Qg)))}return null}}}(W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb,dd,sc,sb,Ad,zc,yb),null,null)}}(O,U,T,Q,a,b,c,d,e,f,g,h,l,n,q,r,t,u)($APP.Kh(l,q+1))))return $APP.tf.h(Q,J($APP.Pc(O)));O=$APP.Pc(O)}else return null}},
null,null)}($APP.Kh(h,n+1))}()),v=$APP.Me.i(Mw,x,function(){return function J(I){return new $APP.ue(null,function(){for(var O=I;;){var Q=$APP.C(O);if(Q){var T=Q,U=$APP.D(T);if(Q=$APP.C(function(W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb,dd,sc,sb,Ad,zc,yb,dc){return function Eb(tb){return new $APP.ue(null,function(ec,Od,jh,If,Pd,li,Jf,$e,kh,lh,mh,Db,xt,yt,zt,Ml,Qg,kf){return function(){for(;;){var Je=$APP.C(tb);if(Je){if($APP.Ed(Je)){var lf=$APP.oc(Je),Si=$APP.F(lf),Wf=$APP.xe(Si);a:for(var Jo=0;;)if(Jo<Si){var Ko=
$APP.qd(lf,Jo);Ko=$APP.N.h(kf,new $APP.S(null,2,5,$APP.V,[Od,Ko],null));Wf.add(Ko);Jo+=1}else{lf=!0;break a}return lf?$APP.Ae($APP.Ce(Wf),Eb($APP.pc(Je))):$APP.Ae($APP.Ce(Wf),null)}Wf=$APP.D(Je);return $APP.P($APP.N.h(kf,new $APP.S(null,2,5,$APP.V,[Od,Wf],null)),Eb($APP.Pc(Je)))}return null}}}(W,na,Y,oa,qa,Oa,Ta,$a,ib,Lb,ab,Mb,dd,sc,sb,Ad,zc,yb,dc),null,null)}}(O,U,T,Q,a,b,c,d,e,f,g,h,l,n,q,r,t,u,x)($APP.Kh(l,q+1))))return $APP.tf.h(Q,J($APP.Pc(O)));O=$APP.Pc(O)}else return null}},null,null)}($APP.Kh(h,
n+1))}());$APP.gi($APP.K([h,l,n,q,v]));return $APP.Z.l(Lv,$APP.X,dw,null,$APP.K([Kw,new $APP.m(null,4,[$APP.yr,0,$APP.xr,0,$APP.Op,0,$APP.Pp,0],null),Wv,$APP.Ch(v)]))},Ow=function(a){a.stopPropagation();var b=$APP.G.h(a.target,a.currentTarget),c=Wv.g($APP.y(Lv)),d=$APP.y(aw),e=$APP.Oe(d);d=$APP.N.h(e,$APP.yr);e=$APP.N.h(e,$APP.xr);return $APP.G.h(rw.g($APP.y(Lv)),ww)&&$APP.G.h(a.button,0)?Qv($APP.y(Sv)):$APP.G.h(dw.g($APP.y(Lv)),yw)?Nw():$APP.G.h(dw.g($APP.y(Lv)),nw)?null:Lw(b,c,d,e)},Qw=function(a){for(var b=
[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;b=2<b.length?new $APP.A(b.slice(2),0,null):null;return Pw(arguments[0],arguments[1],b)},Pw=function(a,b,c){var d=$APP.M(b,0,null);b=$APP.M(b,1,null);c=$APP.Me.h($APP.ti,c);var e=$APP.xf(yv,new $APP.S(null,2,5,$APP.V,[a,Av],null)),f=$APP.M(e,0,null);e=$APP.M(e,1,null);return $APP.Z.l(Lv,$APP.X,mw,$APP.ui.h(new $APP.m(null,4,[$APP.ir,$APP.at,$APP.os,a,$APP.yr,Math.round(d-f/2-1),$APP.xr,Math.round(b-e/2-1)],null),c),$APP.K([rw,
ww]))},Rw=function(){var a=['\x3c?xml-stylesheet type\x3d"text/css" href\x3d"https://nyancad.github.io/Mosaic/app/css/style.css" ?\x3e',$APP.w.g(document.getElementById("mosaic_canvas").outerHTML)].join("");return btoa($APP.cj(encodeURIComponent(a),/%([0-9A-F]{2})/,function(b){return String.fromCharCode(["0x",$APP.w.g($APP.id(b,1))].join(""))}))},Xw=function(){return $APP.Z.u(Sw,$APP.X,["snapshots:",$APP.w.g(Ju),"#",$APP.w.g((new Date).toISOString())].join(""),new $APP.m(null,2,[Tw,$APP.y(eu),Uw,
new $APP.m(null,1,["preview.svg",new $APP.m(null,2,[Vw,"image/svg+xml",Ww,Rw()],null)],null)],null))},cx=function(a){var b=$APP.ll(eu,new $APP.S(null,2,5,$APP.V,[a,pv],null)),c=$APP.ll(eu,new $APP.S(null,2,5,$APP.V,[a,$APP.os],null)),d=$APP.ll(eu,new $APP.S(null,2,5,$APP.V,[a,$APP.lj],null));return function(e){return new $APP.S(null,3,5,$APP.V,[$APP.$p,new $APP.S(null,4,5,$APP.V,[$APP.ds,$APP.y(c),": ",function(){var f=$APP.y(d);return $APP.p(f)?f:e}()],null),new $APP.S(null,9,5,$APP.V,[$APP.Mp,$APP.Ld(yv,
$APP.y(c))?null:new $APP.S(null,4,5,$APP.V,[$APP.$p,new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,1,[$APP.mq,ov($APP.y(c),qv.g($APP.y(b)))],null),"Edit"],null),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,"cell",$APP.Bq,"cell name"],null),"cell"],null),new $APP.S(null,4,5,$APP.V,[Yw,new $APP.m(null,4,[$APP.el,"cell",$APP.nq,"text",$APP.gq,$APP.y(c),$APP.Ep,function(f){return $APP.hf(c,f.target.value)}],null),new $APP.S(null,1,5,$APP.V,[Zw],null),function(){return function h(g){return new $APP.ue(null,
function(){for(;;){var l=$APP.C(g);if(l){if($APP.Ed(l)){var n=$APP.oc(l),q=$APP.F(n),r=$APP.xe(q);a:for(var t=0;;)if(t<q){var u=$APP.qd(n,t),x=$APP.M(u,0,null);u=$APP.M(u,1,null);x=new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.oj,x],null),$APP.lj.g(u)],null);r.add(x);t+=1}else{n=!0;break a}return n?$APP.Ae($APP.Ce(r),h($APP.pc(l))):$APP.Ae($APP.Ce(r),null)}n=$APP.D(l);r=$APP.M(n,0,null);n=$APP.M(n,1,null);return $APP.P(new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.oj,r],null),$APP.lj.g(n)],
null),h($APP.Pc(l)))}return null}},null,null)}($APP.y(jv))}()],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,"name",$APP.Bq,"Instance name"],null),"name"],null),new $APP.S(null,2,5,$APP.V,[$APP.jr,new $APP.m(null,4,[$APP.el,"name",$APP.nq,"text",$APP.gq,$APP.y(d),$APP.Ep,$APP.ka(function(f){return $APP.hf(d,f.target.value)})],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,"model",$APP.Bq,"Device model"],null),"model"],null),new $APP.S(null,
4,5,$APP.V,[Yw,new $APP.m(null,4,[$APP.el,"model",$APP.nq,"text",$APP.gq,qv.g($APP.y(b)),$APP.Ep,function(f){return $APP.Z.u(b,$APP.X,qv,f.target.value)}],null),new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.Gr,null],null),"Ideal"],null),function(){return function h(g){return new $APP.ue(null,function(){for(;;){var l=$APP.C(g);if(l){if($APP.Ed(l)){var n=$APP.oc(l),q=$APP.F(n),r=$APP.xe(q);a:for(var t=0;;)if(t<q){var u=$APP.qd(n,t);r.add(new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.oj,
u],null),u],null));t+=1}else{n=!0;break a}return n?$APP.Ae($APP.Ce(r),h($APP.pc(l))):$APP.Ae($APP.Ce(r),null)}r=$APP.D(l);return $APP.P(new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.oj,r],null),r],null),h($APP.Pc(l)))}return null}},null,null)}($APP.qh($APP.xf($APP.y(jv),new $APP.S(null,2,5,$APP.V,[["models:",$APP.w.g($APP.y(c))].join(""),$APP.ms],null))))}()],null),$APP.Mh(function(){return function h(g){return new $APP.ue(null,function(){for(;;){var l=$APP.C(g);if(l){var n=l;if($APP.Ed(n)){var q=
$APP.oc(n),r=$APP.F(q),t=$APP.xe(r);return function(){for(var B=0;;)if(B<r){var I=$APP.qd(q,B),J=$APP.M(I,0,null),O=$APP.M(I,1,null);$APP.Be(t,new $APP.S(null,4,5,$APP.V,[$APP.$p,new $APP.m(null,1,[$APP.oj,J],null),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,J,$APP.Bq,$w.g(O)],null),J],null),new $APP.S(null,2,5,$APP.V,[$APP.jr,new $APP.m(null,4,[$APP.el,J,$APP.nq,"text",$APP.gq,$APP.N.h($APP.y(b),J),$APP.Ep,$APP.ka(function(Q,T,U,W,na,Y,oa,qa,Oa,Ta){return function($a){return $APP.Z.u(Ta,
$APP.X,U,$a.target.value)}}(B,I,J,O,q,r,t,n,l,b,c,d))],null)],null)],null));B+=1}else return!0}()?$APP.Ae($APP.Ce(t),h($APP.pc(n))):$APP.Ae($APP.Ce(t),null)}var u=$APP.D(n),x=$APP.M(u,0,null),v=$APP.M(u,1,null);return $APP.P(new $APP.S(null,4,5,$APP.V,[$APP.$p,new $APP.m(null,1,[$APP.oj,x],null),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,x,$APP.Bq,$w.g(v)],null),x],null),new $APP.S(null,2,5,$APP.V,[$APP.jr,new $APP.m(null,4,[$APP.el,x,$APP.nq,"text",$APP.gq,$APP.N.h($APP.y(b),
x),$APP.Ep,$APP.ka(function(B,I,J,O,Q,T){return function(U){return $APP.Z.u(T,$APP.X,I,U.target.value)}}(u,x,v,n,l,b,c,d))],null)],null)],null),h($APP.Pc(n)))}return null}},null,null)}(ax.g($APP.N.h(yv,$APP.y(c))))}()),new $APP.S(null,3,5,$APP.V,[$APP.lr,new $APP.m(null,2,[$APP.iq,"spice",$APP.Bq,"Extra spice data"],null),"spice"],null),new $APP.S(null,2,5,$APP.V,[$APP.jr,new $APP.m(null,4,[$APP.el,"spice",$APP.nq,"text",$APP.gq,bx.g($APP.y(b)),$APP.Ep,$APP.ka(function(f){return $APP.Z.u(b,$APP.X,
bx,f.target.value)})],null)],null)],null)],null)}},ex=function(){var a=$APP.y(Uv),b=$APP.y(eu);a=$APP.nf.h(Rv.h(function(c){return $APP.Hj.l(c,$APP.um,$APP.K([$APP.sm]))},b),a);return $APP.Z.u(dx,$APP.X,"local:clipboard",new $APP.m(null,1,[Ww,a],null))},fx=function(){ex();return Xv()},gx=function(){var a=$APP.xf($APP.y(dx),new $APP.S(null,2,5,$APP.V,["local:clipboard",Ww],null)),b=$APP.nf.g(function(c){return new $APP.S(null,2,5,$APP.V,[$APP.Eh($APP.mk.g(Ku($APP.os.g(c)))),$APP.jp.i(c,$APP.lj,$APP.mk)],
null)});a=$APP.ui.i($APP.Te,b,a);$APP.Z.i(eu,$APP.ui,a);return $APP.Z.l(Lv,$APP.X,dw,ww,$APP.K([Wv,$APP.Ch($APP.qh(a))]))},ix=function(){var a=new URL(window.simulatorurl,window.location);a.searchParams.append("schem",Ju);var b=a.searchParams,c=b.append;var d=(d=$APP.C(nv))?nv:d;c.call(b,"db",$APP.p(d)?d:hx);return a},qx=function(){return new $APP.S(null,4,5,$APP.V,[$APP.$p,new $APP.S(null,16,5,$APP.V,[jx,new $APP.S(null,3,5,$APP.V,[$APP.bu,fw,new $APP.S(null,5,5,$APP.V,[new $APP.S(null,4,5,$APP.V,
[new $APP.S(null,1,5,$APP.V,[$APP.Gt],null),new $APP.S(null,1,5,$APP.V,[$APP.Gt],null),sw,"Cursor [esc]"],null),new $APP.S(null,4,5,$APP.V,[new $APP.S(null,1,5,$APP.V,[$APP.Jt],null),new $APP.S(null,1,5,$APP.V,[$APP.Jt],null),nw,"Wire [w]"],null),new $APP.S(null,4,5,$APP.V,[new $APP.S(null,1,5,$APP.V,[$APP.Ht],null),new $APP.S(null,1,5,$APP.V,[$APP.Ht],null),gw,"Eraser [e]"],null),new $APP.S(null,4,5,$APP.V,[new $APP.S(null,1,5,$APP.V,[$APP.It],null),new $APP.S(null,1,5,$APP.V,[$APP.It],null),kx,
"Pan [space]"],null),new $APP.S(null,4,5,$APP.V,[new $APP.S(null,1,5,$APP.V,[$APP.Ut],null),new $APP.S(null,1,5,$APP.V,[$APP.Ut],null),lx,"Probe nodes in a connected simulator"],null)],null)],null),new $APP.S(null,1,5,$APP.V,[mx],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Rotate selected clockwise [s]",$APP.Qp,function(){return Vv(function(a){return a.rotate(90)})}],null),new $APP.S(null,1,5,$APP.V,[$APP.Ct],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,
2,[$APP.Bq,"Rotate selected counter-clockwise [shift+s]",$APP.Qp,function(){return Vv(function(a){return a.rotate(-90)})}],null),new $APP.S(null,1,5,$APP.V,[$APP.Dt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Mirror selected horizontal [shift+f]",$APP.Qp,function(){return Vv(function(a){return a.flipY()})}],null),new $APP.S(null,1,5,$APP.V,[$APP.Ft],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Mirror selected vertical [f]",$APP.Qp,
function(){return Vv(function(a){return a.flipX()})}],null),new $APP.S(null,1,5,$APP.V,[$APP.Et],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Delete selected [del]",$APP.Qp,function(){return Xv()}],null),new $APP.S(null,1,5,$APP.V,[$APP.Lt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Copy selected [ctrl+c]",$APP.Qp,function(){return ex()}],null),new $APP.S(null,1,5,$APP.V,[$APP.Nt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,
2,[$APP.Bq,"Cut selected [ctrl+x]",$APP.Qp,function(){return fx()}],null),new $APP.S(null,1,5,$APP.V,[$APP.Ot],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Paste [ctrl+v]",$APP.Qp,function(){return gx()}],null),new $APP.S(null,1,5,$APP.V,[$APP.Pt],null)],null),new $APP.S(null,1,5,$APP.V,[mx],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"zoom in [scroll wheel/pinch]",$APP.Qp,function(){return Pv(-1)}],null),new $APP.S(null,1,5,$APP.V,[$APP.vt],
null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"zoom out [scroll wheel/pinch]",$APP.Qp,function(){return Pv(1)}],null),new $APP.S(null,1,5,$APP.V,[$APP.wt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"undo [ctrl+z]",$APP.Qp,Nu],null),new $APP.S(null,1,5,$APP.V,[$APP.Bt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"redo [ctrl+shift+z]",$APP.Qp,Ou],null),new $APP.S(null,1,5,$APP.V,[$APP.At],null)],null)],null),
$APP.p($APP.y(nx))?new $APP.S(null,3,5,$APP.V,[$APP.as,new $APP.m(null,1,[$APP.Bq,"saving changes"],null),new $APP.S(null,1,5,$APP.V,[$APP.$t],null)],null):new $APP.S(null,3,5,$APP.V,[$APP.sq,new $APP.m(null,1,[$APP.Bq,"changes saved"],null),new $APP.S(null,1,5,$APP.V,[$APP.au],null)],null),new $APP.S(null,6,5,$APP.V,[ox,new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,3,[$APP.mq,ix(),$APP.Tp,"simulator",$APP.Bq,"Open simulator"],null),new $APP.S(null,1,5,$APP.V,[$APP.St],null)],null),new $APP.S(null,
3,5,$APP.V,[$APP.wr,new $APP.m(null,3,[$APP.mq,window.notebookurl,$APP.Tp,"jupyter",$APP.Bq,"Open JupyterLab"],null),new $APP.S(null,1,5,$APP.V,[$APP.Rt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,3,[$APP.mq,"..",$APP.Tp,"libman",$APP.Bq,"Open library manager"],null),new $APP.S(null,1,5,$APP.V,[$APP.Tt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.wr,new $APP.m(null,2,[$APP.Bq,"Save Snapshot",$APP.Qp,Xw],null),new $APP.S(null,1,5,$APP.V,[$APP.Mt],null)],null),new $APP.S(null,
4,5,$APP.V,[Yw,new $APP.m(null,1,[$APP.Ep,function(a){return $APP.Z.u(Lv,$APP.X,px,a.target.value)}],null),new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.Gr,"tetris"],null),"Tetris"],null),new $APP.S(null,3,5,$APP.V,[Zw,new $APP.m(null,1,[$APP.Gr,"eyesore"],null),"Classic"],null)],null)],null)],null)},rx=function(a){return $APP.G.h(a,$APP.os.g($APP.y(Sv)))?"active":null},ux=function(a){return new $APP.S(null,2,5,$APP.V,[$APP.rq,new $APP.m(null,1,[sx,new $APP.m(null,1,[tx,function(){switch(a){case "resistor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"40"\n   height\x3d"40"\n   viewBox\x3d"0 0 40 40"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.078125"\n     d\x3d"M 9.8046875,27.745269 C 9.6757813,27.665644 9.5060914,27.52819 9.4275984,27.439816 9.3491055,27.351441 8.657132,25.720431 7.8898797,23.815348 L 6.4948748,20.351562 3.2474374,20.331174 0,20.310786 v -1.291648 -1.291649 l 3.8476563,0.02297 c 4.2008273,0.02508 4.124189,0.01681 4.4927023,0.485294 0.083066,0.105602 0.530325,1.134624 0.9939078,2.286717 0.463582,1.152092 0.8821216,2.171499 0.9300866,2.265348 0.07522,0.147166 0.311909,-0.459912 1.720999,-4.414063 2.17264,-6.096808 2.039651,-5.759082 2.365731,-6.007795 0.394424,-0.300842 1.053204,-0.341453 1.422983,-0.08772 0.14644,0.100482 0.329544,0.270586 0.406898,0.378008 0.07735,0.107422 0.951591,2.408115 1.942751,5.112651 0.991158,2.704536 1.814905,4.930136 1.830548,4.945778 0.01564,0.01564 0.09878,-0.175676 0.184751,-0.425151 1.768011,-5.13049 3.319902,-9.515212 3.423924,-9.673968 0.273606,-0.417575 1.102947,-0.64298 1.539854,-0.418514 0.476521,0.244818 0.586034,0.464627 2.764406,5.548616 1.194064,2.786761 2.189705,5.066838 2.212536,5.066838 0.02283,0 0.338643,-0.955898 0.701803,-2.124218 0.363159,-1.16832 0.731506,-2.229896 0.818548,-2.359058 0.08704,-0.129161 0.281186,-0.307052 0.431431,-0.395312 0.264028,-0.155103 0.401958,-0.161243 4.120828,-0.183449 L 40,17.727489 v 1.292506 1.292505 h -3.19977 -3.199771 l -0.388987,1.230469 c -0.213942,0.676758 -0.694671,2.214843 -1.068285,3.417968 -0.433867,1.397154 -0.749885,2.282233 -0.874666,2.449697 -0.487603,0.654392 -1.568162,0.630667 -2.018859,-0.04433 -0.12436,-0.186251 -3.150054,-7.151412 -4.386126,-10.096882 -0.08515,-0.202911 -0.128732,-0.241578 -0.176102,-0.15625 -0.03462,0.06236 -0.843722,2.361993 -1.798,5.110288 -0.954279,2.748295 -1.792639,5.075017 -1.863025,5.170493 -0.202047,0.274079 -0.662052,0.49667 -1.026409,0.49667 -0.362897,0 -0.824359,-0.222439 -1.023937,-0.493569 -0.06902,-0.09377 -0.947914,-2.411704 -1.953086,-5.150962 -1.005174,-2.739258 -1.845222,-4.980469 -1.866775,-4.980469 -0.02155,0 -0.825081,2.206055 -1.785618,4.902344 -0.960537,2.696289 -1.827478,5.028685 -1.926536,5.183102 -0.327132,0.509955 -1.136778,0.704641 -1.6393605,0.394198 z"\n     id\x3d"path861" /\x3e\n\x3c/svg\x3e\n';
case "capacitor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"37"\n   height\x3d"37"\n   viewBox\x3d"0 0 37 37"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.0722656"\n     d\x3d"M 11.779297,26.34082 V 19.728516 H 5.8896484 0 V 18.5 17.271484 H 5.8896484 11.779297 V 10.65918 4.046875 h 1.192383 1.192383 V 18.5 32.953125 H 12.97168 11.779297 Z M 22.835937,18.5 V 4.046875 h 1.192383 1.192383 v 6.612305 6.612304 H 31.110352 37 V 18.5 19.728516 h -5.889648 -5.889649 v 6.612304 6.612305 H 24.02832 22.835937 Z"\n     id\x3d"path843" /\x3e\n\x3c/svg\x3e\n';
case "inductor":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"37"\n   height\x3d"37"\n   viewBox\x3d"0 0 37 37"\n   version\x3d"1.1"\n   id\x3d"svg4"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs8" /\x3e\n  \x3cpath\n     style\x3d"stroke-width:0.0722656"\n     d\x3d"m 34.776705,21.318359 c -2.025823,0 -2.245454,-0.01188 -2.472772,-0.133795 -0.356422,-0.191151 -0.494489,-0.411851 -0.652026,-1.042264 -0.07629,-0.305299 -0.185936,-0.645245 -0.24365,-0.755433 -0.38011,-0.725712 -1.22965,-1.260792 -2.077834,-1.308719 -1.14891,-0.06492 -2.115624,0.598025 -2.530248,1.735168 -0.250797,0.687836 -0.750866,1.009931 -1.403533,0.904017 -0.389144,-0.06315 -0.68111,-0.317715 -0.87794,-0.765479 -0.325164,-0.739704 -0.415697,-0.883119 -0.763746,-1.209866 -0.441205,-0.414201 -0.901281,-0.616174 -1.501396,-0.659112 -1.146558,-0.08204 -2.087722,0.527491 -2.545372,1.648461 -0.209557,0.51329 -0.323047,0.66716 -0.630063,0.854237 -0.486776,0.296612 -1.346232,0.09747 -1.567827,-0.363277 -0.04459,-0.09272 -0.178397,-0.384881 -0.297342,-0.649243 -0.262587,-0.583617 -0.685975,-1.023369 -1.23156,-1.279158 -0.347019,-0.162695 -0.505571,-0.191302 -1.058544,-0.190992 -0.77681,4.34e-4 -1.148218,0.141908 -1.677808,0.639084 -0.348049,0.326747 -0.438582,0.470162 -0.763746,1.209866 -0.19683,0.447764 -0.488796,0.70233 -0.87794,0.765479 -0.619261,0.100493 -1.169122,-0.22861 -1.370777,-0.820436 C 9.9753163,19.141869 9.572666,18.671434 8.8679374,18.302522 8.5396491,18.130669 8.4074464,18.105134 7.8397378,18.103926 c -0.5920506,-0.0013 -0.6955906,0.02031 -1.1351504,0.236511 -0.4770863,0.234657 -0.8920181,0.624826 -1.1128445,1.04643 -0.057714,0.110188 -0.1673566,0.450134 -0.2436496,0.755433 -0.1575372,0.630413 -0.2956042,0.851113 -0.6520258,1.042264 -0.2273181,0.121912 -0.4469493,0.133795 -2.472772,0.133795 H 0 v -1.192382 -1.192383 h 1.5845462 1.5845461 l 0.1861616,-0.406631 c 0.5541643,-1.210454 1.5056426,-2.08213 2.8156819,-2.579525 0.5549514,-0.210704 0.6412504,-0.222567 1.6337517,-0.224589 1.0052004,-0.002 1.0721863,0.0072 1.6457159,0.22682 0.6169126,0.236251 1.4397136,0.736733 1.7429416,1.060173 l 0.172837,0.184358 0.341687,-0.304619 c 0.843727,-0.752198 1.813117,-1.140941 2.972427,-1.191997 1.290332,-0.05683 2.43421,0.315294 3.385598,1.101387 0.218322,0.18039 0.413669,0.327982 0.434106,0.327982 0.02044,0 0.215784,-0.147592 0.434106,-0.327982 0.953837,-0.788116 2.098458,-1.159675 3.385598,-1.099009 1.168497,0.05507 2.132657,0.440948 2.972427,1.189619 l 0.341687,0.304619 0.172837,-0.184358 c 0.303228,-0.32344 1.126029,-0.823922 1.742942,-1.060173 0.573529,-0.219636 0.640515,-0.228869 1.645715,-0.22682 0.992502,0.002 1.078801,0.01389 1.633752,0.224589 1.310039,0.497395 2.261517,1.369071 2.815682,2.579525 l 0.186161,0.406631 H 35.415454 37 v 1.192383 1.192382 z"\n     id\x3d"path843" /\x3e\n\x3c/svg\x3e\n';
case "diode":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"39.5"\n   height\x3d"25"\n   viewBox\x3d"0 0 39.5 25"\n   version\x3d"1.1"\n   id\x3d"svg16"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs20" /\x3e\n  \x3cg\n     transform\x3d"translate(1.25)"\n     id\x3d"g14"\x3e\n    \x3cg\n       transform\x3d"translate(31) rotate(90)"\n       id\x3d"g6"\x3e\n      \x3cpath\n         d\x3d"M12.5,0,25,21H0Z"\n         fill\x3d"none"\n         id\x3d"path2" /\x3e\n      \x3cpath\n         d\x3d"M 12.5 5.865288734436035 L 5.276956558227539 18 L 19.72304153442383 18 L 12.5 5.865288734436035 M 12.5 0 L 25 21 L 0 21 L 12.5 0 Z"\n         id\x3d"path4" /\x3e\n    \x3c/g\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 21 22.25 h 2.5 V 21 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(29 2)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 8 9.25 h 2.5 V 8 0 -1.25 Z"\n       id\x3d"line10"\n       transform\x3d"translate(37 12.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 9 10.25 h 2.5 V 9 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(9 13) rotate(90)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "vsource":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"34"\n   height\x3d"34"\n   viewBox\x3d"0 0 34 34"\n   version\x3d"1.1"\n   id\x3d"svg8"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs12" /\x3e\n  \x3cg\n     transform\x3d"translate(1.5 1.5)"\n     id\x3d"g6"\x3e\n    \x3cpath\n       d\x3d"m 15.5,-1.5 c -9.3710644,0 -17,7.6289356 -17,17 0,9.371064 7.6289356,17 17,17 9.371064,0 17,-7.628936 17,-17 0,-9.3710644 -7.628936,-17 -17,-17 z m 0,3 c 7.749746,0 14,6.2502543 14,14 0,7.749746 -6.250254,14 -14,14 -7.7497457,0 -14,-6.250254 -14,-14 0,-7.7497457 6.2502543,-14 14,-14 z"\n       id\x3d"circle2" /\x3e\n    \x3cpath\n       d\x3d"M4.609-7.67a3.875,3.875,0,0,0-1.775.49A7.482,7.482,0,0,0,1.074-5.9V-9.278a5.186,5.186,0,0,1,3.867-1.594,8.876,8.876,0,0,1,2.077.234,14.34,14.34,0,0,1,2.107.7,9.186,9.186,0,0,0,3.429.8A4.013,4.013,0,0,0,14.307-9.6a6.466,6.466,0,0,0,1.767-1.3v3.377A5.124,5.124,0,0,1,12.207-5.93a9.255,9.255,0,0,1-1.9-.19,14.389,14.389,0,0,1-2.266-.731A9.22,9.22,0,0,0,4.609-7.67Z"\n       transform\x3d"translate(6.926 23.901)"\n       id\x3d"path4" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "isource":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"34"\n   height\x3d"34"\n   viewBox\x3d"0 0 34 34"\n   version\x3d"1.1"\n   id\x3d"svg10"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs14" /\x3e\n  \x3cg\n     transform\x3d"translate(1.5 1.5)"\n     id\x3d"g8"\x3e\n    \x3cg\n       id\x3d"circle2"\x3e\n      \x3cpath\n         style\x3d"fill:none;stroke-width:3;"\n         d\x3d"M 31,15.5 A 15.5,15.5 0 0 1 15.5,31 15.5,15.5 0 0 1 0,15.5 15.5,15.5 0 0 1 15.5,0 15.5,15.5 0 0 1 31,15.5 Z"\n         id\x3d"path922" /\x3e\n      \x3cpath\n         d\x3d"m 15.5,-1.5 c -9.3710644,0 -17,7.6289356 -17,17 0,9.371064 7.6289356,17 17,17 9.371064,0 17,-7.628936 17,-17 0,-9.3710644 -7.628936,-17 -17,-17 z m 0,3 c 7.749746,0 14,6.2502543 14,14 0,7.749746 -6.250254,14 -14,14 -7.7497457,0 -14,-6.250254 -14,-14 0,-7.7497457 6.2502543,-14 14,-14 z"\n         id\x3d"path924" /\x3e\n    \x3c/g\x3e\n    \x3cpath\n       d\x3d"M 16.993489,22.25 H 16.842076 L 16.074478,21.482402 15.30688,20.714804 17.90344,18.107402 20.5,15.5 17.897669,12.886803 15.295337,10.273606 16.153714,9.4512289 17.012091,8.6288517 20.446183,12.062943 23.880275,15.497035 20.512589,18.873517 17.144903,22.25 Z"\n       id\x3d"path1846" /\x3e\n    \x3cpath\n       d\x3d"m 0,-1.25 v 2.5 h 12 v -2.5 z"\n       id\x3d"line6"\n       transform\x3d"translate(8.5 15.5)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "pmos":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.5"\n   height\x3d"29.5"\n   viewBox\x3d"0 0 22.5 29.5"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-58.75 -773.75)"\n     id\x3d"g16"\x3e\n    \x3cg\n       id\x3d"line2"\n       transform\x3d"translate(60 780)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 17"\n         id\x3d"path884" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n         id\x3d"path886" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line4"\n       transform\x3d"translate(66 780)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 17"\n         id\x3d"path878" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n         id\x3d"path880" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line6"\n       transform\x3d"translate(80 780) rotate(90)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 12"\n         id\x3d"path872" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n         id\x3d"path874" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line8"\n       transform\x3d"translate(80 797) rotate(90)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 12"\n         id\x3d"path866" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n         id\x3d"path868" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line10"\n       transform\x3d"translate(80 797)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 5"\n         id\x3d"path860" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n         id\x3d"path862" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"line12"\n       transform\x3d"translate(80 775)"\x3e\n      \x3cpath\n         d\x3d"M 0,0 V 5"\n         id\x3d"path854" /\x3e\n      \x3cpath\n         d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n         id\x3d"path856" /\x3e\n    \x3c/g\x3e\n    \x3cg\n       id\x3d"path14"\n       transform\x3d"translate(67 786) rotate(-90)"\x3e\n      \x3cpath\n         d\x3d"m 6,0 6,9 H 0 Z"\n         id\x3d"path848" /\x3e\n      \x3cpath\n         d\x3d"m 6,-0.90234375 -0.4160156,0.625 L -0.93359375,9.5 H 12.933594 Z M 6,0.90234375 11.066406,8.5 H 0.93359375 Z"\n         id\x3d"path850" /\x3e\n    \x3c/g\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "nmos":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.5"\n   height\x3d"29.5"\n   viewBox\x3d"0 0 22.5 29.5"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-58.75 -773.75)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line2"\n       transform\x3d"translate(60 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line4"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line6"\n       transform\x3d"translate(80 780) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(80 797) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line10"\n       transform\x3d"translate(80 797)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(80 775)" /\x3e\n    \x3cpath\n       d\x3d"M6,0l6,9H0Z"\n       transform\x3d"translate(79 774) rotate(90)"\n       id\x3d"path14" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "npn":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.745"\n   height\x3d"28.6"\n   viewBox\x3d"0 0 22.745 28.6"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-57.25 -774.45)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"path898"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"path895"\n       transform\x3d"translate(77.892 781.5) rotate(60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"path892"\n       transform\x3d"translate(67.5 790) rotate(-60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path889"\n       transform\x3d"translate(78.37 796.8)" /\x3e\n    \x3cpath\n       d\x3d"M5,0l5,7.5H0Z"\n       transform\x3d"translate(74.995 777.5) rotate(60)"\n       id\x3d"path886" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path883"\n       transform\x3d"translate(63.5 788.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"path880"\n       transform\x3d"translate(78.37 775.7)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
case "pnp":return'\x3c?xml version\x3d"1.0" encoding\x3d"UTF-8" standalone\x3d"no"?\x3e\n\n\x3c!--\nSPDX-FileCopyrightText: 2022 Pepijn de Vos\n\nSPDX-License-Identifier: CC-BY-NC-SA-4.0\n--\x3e\n\n\x3csvg\n   width\x3d"22.37"\n   height\x3d"28.6"\n   viewBox\x3d"0 0 22.37 28.6"\n   version\x3d"1.1"\n   id\x3d"svg18"\n   xmlns\x3d"http://www.w3.org/2000/svg"\n   xmlns:svg\x3d"http://www.w3.org/2000/svg"\x3e\n  \x3cdefs\n     id\x3d"defs22" /\x3e\n  \x3cg\n     transform\x3d"translate(-57.25 -774.45)"\n     id\x3d"g16"\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 17 18.25 h 2.5 V 17 0 -1.25 Z"\n       id\x3d"line2"\n       transform\x3d"translate(66 780)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line4"\n       transform\x3d"translate(77.892 781.5) rotate(60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 12 13.25 h 2.5 V 12 0 -1.25 Z"\n       id\x3d"line6"\n       transform\x3d"translate(67.5 790) rotate(-60)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line8"\n       transform\x3d"translate(78.37 796.8)" /\x3e\n    \x3cpath\n       d\x3d"M5,0l5,7.5H0Z"\n       transform\x3d"translate(72.499 790.41) rotate(-120)"\n       id\x3d"path10" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line12"\n       transform\x3d"translate(63.5 788.5) rotate(90)" /\x3e\n    \x3cpath\n       d\x3d"M -1.25,-1.25 V 0 5 6.25 h 2.5 V 5 0 -1.25 Z"\n       id\x3d"line14"\n       transform\x3d"translate(78.37 775.7)" /\x3e\n  \x3c/g\x3e\n\x3c/svg\x3e\n';
default:return""}}()],null)],null)],null)},wx=function(a){return Pw("port",a,$APP.K([vx,"ground",$APP.ir,$APP.Vo($APP.$s.rotate(-90)),$APP.lj,"GND"]))},xx=function(a){return Pw("port",a,$APP.K([vx,"supply",$APP.ir,$APP.Vo($APP.$s.rotate(90)),$APP.lj,"VDD"]))},Ax=function(){return new $APP.S(null,9,5,$APP.V,[$APP.$p,new $APP.S(null,4,5,$APP.V,[yx,new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add port [p]",$APP.cl,rx("port"),zx,function(a){return Qw("port",Kv(a))}],null),new $APP.S(null,
1,5,$APP.V,[$APP.Kt],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add ground [g]",$APP.cl,rx("port"),zx,function(a){return wx(Kv(a))}],null),"GND"],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add power supply [shift+p]",$APP.cl,rx("port"),zx,function(a){return xx(Kv(a))}],null),"VDD"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add resistor [r]",$APP.cl,rx("resistor"),zx,function(a){return Qw("resistor",Kv(a))}],
null),new $APP.S(null,2,5,$APP.V,[ux,"resistor"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add inductor [l]",$APP.cl,rx("inductor"),zx,function(a){return Qw("inductor",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"inductor"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add capacitor [c]",$APP.cl,rx("capacitor"),zx,function(a){return Qw("capacitor",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"capacitor"],null)],null),new $APP.S(null,
3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add diode [d]",$APP.cl,rx("diode"),zx,function(a){return Qw("diode",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"diode"],null)],null),new $APP.S(null,3,5,$APP.V,[yx,new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add voltage source [v]",$APP.cl,rx("vsource"),zx,function(a){return Qw("vsource",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"vsource"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add current source [i]",
$APP.cl,rx("isource"),zx,function(a){return Qw("isource",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"isource"],null)],null)],null),new $APP.S(null,5,5,$APP.V,[yx,new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add N-channel mosfet [m]",$APP.cl,rx("nmos"),zx,function(a){return Qw("nmos",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"nmos"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add P-channel mosfet [shift+m]",$APP.cl,rx("pmos"),zx,function(a){return Qw("pmos",
Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"pmos"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add NPN BJT [b]",$APP.cl,rx("npn"),zx,function(a){return Qw("npn",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"npn"],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,new $APP.m(null,3,[$APP.Bq,"Add PNP BJT [shift+b]",$APP.cl,rx("pnp"),zx,function(a){return Qw("pnp",Kv(a))}],null),new $APP.S(null,2,5,$APP.V,[ux,"pnp"],null)],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.cr,
new $APP.m(null,3,[$APP.Bq,"Add subcircuit [x]",$APP.cl,rx("ckt"),zx,function(a){return Qw("ckt",Kv(a))}],null),new $APP.S(null,1,5,$APP.V,[$APP.Qt],null)],null)],null)},Bx=function(a){return new $APP.S(null,5,5,$APP.V,[$APP.$p,function(){return function d(c){return new $APP.ue(null,function(){for(var e=c;;)if(e=$APP.C(e)){if($APP.Ed(e)){var f=$APP.oc(e),g=$APP.F(f),h=$APP.xe(g);a:for(var l=0;;)if(l<g){var n=$APP.qd(f,l),q=$APP.M(n,0,null);n=$APP.M(n,1,null);$APP.G.h("wire",$APP.os.g(n))&&(q=Jw(Av,
n,q,n),h.add(q));l+=1}else{f=!0;break a}return f?$APP.Ae($APP.Ce(h),d($APP.pc(e))):$APP.Ae($APP.Ce(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);if($APP.G.h("wire",$APP.os.g(f)))return $APP.P(Jw(Av,f,h,f),d($APP.Pc(e)));e=$APP.Pc(e)}else return null},null,null)}(a)}(),function(){return function d(c){return new $APP.ue(null,function(){for(var e=c;;)if(e=$APP.C(e)){if($APP.Ed(e)){var f=$APP.oc(e),g=$APP.F(f),h=$APP.xe(g);a:for(var l=0;;)if(l<g){var n=$APP.qd(f,l),q=$APP.M(n,0,null);n=$APP.M(n,
1,null);$APP.Pe("wire",$APP.os.g(n))&&(q=Jw(Av,n,q,n),h.add(q));l+=1}else{f=!0;break a}return f?$APP.Ae($APP.Ce(h),d($APP.pc(e))):$APP.Ae($APP.Ce(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);if($APP.Pe("wire",$APP.os.g(f)))return $APP.P(Jw(Av,f,h,f),d($APP.Pc(e)));e=$APP.Pc(e)}else return null},null,null)}(a)}(),function(){return function d(c){return new $APP.ue(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.oc(e),g=$APP.F(f),h=$APP.xe(g);a:for(var l=0;;)if(l<
g){var n=$APP.qd(f,l),q=$APP.M(n,0,null);n=$APP.M(n,1,null);q=Jw(Gw,n,q,n);h.add(q);l+=1}else{f=!0;break a}return f?$APP.Ae($APP.Ce(h),d($APP.pc(e))):$APP.Ae($APP.Ce(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);return $APP.P(Jw(Gw,f,h,f),d($APP.Pc(e)))}return null}},null,null)}(a)}(),function(){return function d(c){return new $APP.ue(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.oc(e),g=$APP.F(f),h=$APP.xe(g);a:for(var l=0;;)if(l<g){var n=$APP.qd(f,l),q=$APP.M(n,
0,null);n=$APP.M(n,1,null);q=Jw(zv,n,q,n);h.add(q);l+=1}else{f=!0;break a}return f?$APP.Ae($APP.Ce(h),d($APP.pc(e))):$APP.Ae($APP.Ce(h),null)}f=$APP.D(e);h=$APP.M(f,0,null);f=$APP.M(f,1,null);return $APP.P(Jw(zv,f,h,f),d($APP.Pc(e)))}return null}},null,null)}(a)}()],null)},Dx=function(){return new $APP.S(null,2,5,$APP.V,[$APP.$p,function(){return function c(b){return new $APP.ue(null,function(){for(var d=b;;)if(d=$APP.C(d)){if($APP.Ed(d)){var e=$APP.oc(d),f=$APP.F(e),g=$APP.xe(f);a:for(var h=0;;)if(h<
f){var l=$APP.qd(e,h),n=$APP.M(l,0,null),q=$APP.M(n,0,null);n=$APP.M(n,1,null);l=$APP.M(l,1,null);l=$APP.F(l);$APP.Pe(l,2)&&g.add(new $APP.S(null,2,5,$APP.V,[Cx,new $APP.m(null,5,[$APP.oj,new $APP.S(null,2,5,$APP.V,[q,n],null),$APP.cl,2<l?"wire":"nc",Qu,50*(q+.5),Ru,50*(n+.5),$APP.Ar,5],null)],null));h+=1}else{e=!0;break a}return e?$APP.Ae($APP.Ce(g),c($APP.pc(d))):$APP.Ae($APP.Ce(g),null)}f=$APP.D(d);e=$APP.M(f,0,null);g=$APP.M(e,0,null);e=$APP.M(e,1,null);f=$APP.M(f,1,null);f=$APP.F(f);if($APP.Pe(f,
2))return $APP.P(new $APP.S(null,2,5,$APP.V,[Cx,new $APP.m(null,5,[$APP.oj,new $APP.S(null,2,5,$APP.V,[g,e],null),$APP.cl,2<f?"wire":"nc",Qu,50*(g+.5),Ru,50*(e+.5),$APP.Ar,5],null)],null),c($APP.Pc(d)));d=$APP.Pc(d)}else return null},null,null)}($APP.D($APP.y(Gv)))}()],null)},Kx=function(){var a=$APP.y(Lv),b=$APP.Oe(a),c=$APP.N.h(b,Wv);a=$APP.N.h(b,dw);var d=$APP.N.h(b,mw),e=$APP.N.h(b,Kw);e=$APP.Oe(e);var f=$APP.N.h(e,$APP.yr),g=$APP.N.h(e,$APP.xr);b=$APP.N.h(b,$v);var h=$APP.M(b,0,null),l=$APP.M(b,
1,null);b=50*Math.round(f);e=50*Math.round(g);return $APP.p(d)?new $APP.S(null,4,5,$APP.V,[Ex,Jw(Av,d,Fx,d),Jw(Gw,d,Gx,d),Jw(zv,d,Hx,d)],null):$APP.G.h(a,yw)?new $APP.S(null,2,5,$APP.V,[Ix,new $APP.m(null,4,[$APP.yr,50*function(){var n=h+f;return h<n?h:n}(),$APP.xr,50*function(){var n=l+g;return l<n?l:n}(),Vu,Math.abs(50*f),Wu,Math.abs(50*g)],null)],null):$APP.p($APP.p(c)?a:c)?new $APP.S(null,3,5,$APP.V,[Jx,new $APP.m(null,1,[$APP.oq,new $APP.m(null,1,[$APP.ir,["translate(",$APP.w.g(b),"px, ",$APP.w.g(e),
"px)"].join("")],null)],null),new $APP.S(null,2,5,$APP.V,[Bx,function(){var n=$APP.y(eu);return $APP.nf.h(function(q){return new $APP.S(null,2,5,$APP.V,[q,$APP.N.h(n,q)],null)},c)}()],null)],null):null},gy=function(){return new $APP.S(null,4,5,$APP.V,[Lx,new $APP.m(null,1,[$APP.cl,$APP.y(Mx)],null),new $APP.S(null,2,5,$APP.V,[Nx,new $APP.S(null,1,5,$APP.V,[qx],null)],null),new $APP.S(null,4,5,$APP.V,[Ox,new $APP.S(null,2,5,$APP.V,[Px,new $APP.S(null,1,5,$APP.V,[Ax],null)],null),function(){var a=$APP.C($APP.y(Uv));
return a?new $APP.S(null,2,5,$APP.V,[Qx,$APP.Mh(function(){return function d(c){return new $APP.ue(null,function(){for(;;){var e=$APP.C(c);if(e){if($APP.Ed(e)){var f=$APP.oc(e),g=$APP.F(f),h=$APP.xe(g);a:for(var l=0;;)if(l<g){var n=$APP.qd(f,l);n=$APP.ud(new $APP.S(null,2,5,$APP.V,[cx,n],null),new $APP.m(null,1,[$APP.oj,n],null));h.add(n);l+=1}else{f=!0;break a}return f?$APP.Ae($APP.Ce(h),d($APP.pc(e))):$APP.Ae($APP.Ce(h),null)}h=$APP.D(e);return $APP.P($APP.ud(new $APP.S(null,2,5,$APP.V,[cx,h],null),
new $APP.m(null,1,[$APP.oj,h],null)),d($APP.Pc(e)))}return null}},null,null)}(a)}())],null):null}(),new $APP.S(null,7,5,$APP.V,[Rx,$APP.Yg([Vu,Sx,$APP.zq,Tx,Ux,sv,$APP.cl,Vx,zx,Wu],["100%",Ov,Aw,"http://www.w3.org/2000/svg",$APP.y(Wx),zw,new $APP.S(null,2,5,$APP.V,[$APP.y(Mx),$APP.y(fw)],null),lw,Ow,"100%"]),new $APP.S(null,2,5,$APP.V,[Xx,new $APP.S(null,4,5,$APP.V,[Yx,new $APP.m(null,4,[$APP.el,"gridfill",Zx,"userSpaceOnUse",Vu,50,Wu,50],null),new $APP.S(null,2,5,$APP.V,[$x,new $APP.m(null,4,[ay,
0,by,0,cy,50,dy,0],null)],null),new $APP.S(null,2,5,$APP.V,[$x,new $APP.m(null,4,[ay,0,by,0,cy,0,dy,50],null)],null)],null)],null),new $APP.S(null,2,5,$APP.V,[ey,new $APP.m(null,6,[fy,"url(#gridfill)",zx,Ow,$APP.yr,-25E3,$APP.xr,-25E3,Vu,5E4,Wu,5E4],null)],null),new $APP.S(null,2,5,$APP.V,[Bx,$APP.y(eu)],null),new $APP.S(null,1,5,$APP.V,[Dx],null),new $APP.S(null,1,5,$APP.V,[Kx],null)],null)],null)],null)},jy=function(){document.onkeyup=$APP.Wn.h(Hu,hy);document.onkeydown=$APP.Wn.h(Hu,iy);return $APP.ql(new $APP.S(null,
1,5,$APP.V,[gy],null),document.getElementById("mosaic_editor"))},ly=function(){if($APP.C(nv)){var a=ky.sync(nv,{live:!0,retry:!0});a.on("paused",function(){return $APP.hf(nx,!1)});a.on("active",function(){return $APP.hf(nx,!0)})}return jy()},my={},ny,lu=function lu(a){switch(arguments.length){case 2:return lu.h(arguments[0],arguments[1]);case 3:return lu.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(3),
0,null);return lu.l(arguments[0],arguments[1],arguments[2],c)}};lu.h=function(a,b){return b};lu.i=function(a,b,c){return(a.g?a.g(b):a.call(null,b))>(a.g?a.g(c):a.call(null,c))?b:c};lu.l=function(a,b,c,d){return $APP.Sa(function(e,f){return lu.i(a,e,f)},lu.i(a,b,c),d)};lu.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};lu.C=3;
var Eu=function Eu(a){switch(arguments.length){case 1:return Eu.g(arguments[0]);case 2:return Eu.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(2),0,null);return Eu.l(arguments[0],arguments[1],c)}};Eu.g=function(a){return a};Eu.h=function(a,b){return a>b?a:b};Eu.l=function(a,b,c){return $APP.Sa(Eu,a>b?a:b,c)};Eu.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};Eu.C=2;
var Iv=function Iv(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=1<c.length?new $APP.A(c.slice(1),0,null):null;return Iv.l(arguments[0],c)};Iv.l=function(a,b){if($APP.p($APP.Ze($APP.ce,b))){var c=function(d,e){var f=$APP.wb(e),g=$APP.xb(e);if($APP.Ld(d,f)){e=$APP.X.i;var h=$APP.N.h(d,f);g=a.h?a.h(h,g):a.call(null,h,g);d=e.call($APP.X,d,f,g)}else d=$APP.X.i(d,f,g);return d};return $APP.$d(function(d,e){return $APP.Sa(c,$APP.p(d)?d:$APP.Te,$APP.C(e))},b)}return null};
Iv.C=1;Iv.D=function(a){var b=$APP.D(a);a=$APP.E(a);return this.l(b,a)};$APP.k=iu.prototype;$APP.k.toString=function(){return $APP.xc(this)};$APP.k.I=function(){return this.meta};$APP.k.da=function(){return this.ga(null)};$APP.k.Z=function(){return $APP.Oc};$APP.k.ea=function(a,b){a=this.ca(null);var c=this.f.g?this.f.g(a):this.f.call(null,a);for(a=b.h?b.h(a,c):b.call(null,a,c);;){if($APP.Yc(a))return $APP.y(a);c=this.f.g?this.f.g(c):this.f.call(null,c);a=b.h?b.h(a,c):b.call(null,a,c)}};
$APP.k.fa=function(a,b,c){a=this.ca(null);for(c=b.h?b.h(c,a):b.call(null,c,a);;){if($APP.Yc(c))return $APP.y(c);a=this.f.g?this.f.g(a):this.f.call(null,a);c=b.h?b.h(c,a):b.call(null,c,a)}};$APP.k.ca=function(){my===this.bd&&(this.bd=this.f.g?this.f.g(this.zd):this.f.call(null,this.zd));return this.bd};$APP.k.ga=function(){null==this.next&&(this.next=new iu(null,this.f,this.ca(null),my,null));return this.next};$APP.k.U=function(){return this};
$APP.k.J=function(a,b){return b===this.meta?this:new iu(b,this.f,this.zd,this.bd,this.next)};$APP.k.$=function(a,b){return $APP.P(b,this)};$APP.k.T=$APP.z;$APP.k.K=function(a,b,c){return $APP.Qh(b,$APP.Wh,"("," ",")",c,this)};
var Hv=function Hv(a){switch(arguments.length){case 1:return Hv.g(arguments[0]);case 2:return Hv.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(2),0,null);return Hv.l(arguments[0],arguments[1],c)}};Hv.g=function(a){return a};Hv.h=function(a,b){for(;;)if($APP.F(b)<$APP.F(a)){var c=a;a=b;b=c}else return $APP.Sa(function(d,e){return function(f,g){return $APP.Ld(e,g)?f:$APP.fp.h(f,g)}}(a,b),a,a)};
Hv.l=function(a,b,c){a=mu(function(d){return-$APP.F(d)},$APP.ne.l(c,b,$APP.K([a])));return $APP.Sa(Hv,$APP.D(a),$APP.Pc(a))};Hv.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};Hv.C=2;
var Tv=function Tv(a){switch(arguments.length){case 3:return Tv.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(3),0,null);return Tv.l(arguments[0],arguments[1],arguments[2],c)}};Tv.i=function(a,b,c){return $APP.ui.i(a,$APP.nf.g(function(d){var e=$APP.V;var f=$APP.N.h(a,d);f=c.g?c.g(f):c.call(null,f);return new $APP.S(null,2,5,e,[d,f],null)}),b)};
Tv.l=function(a,b,c,d){return $APP.ui.i(a,$APP.nf.g(function(e){return new $APP.S(null,2,5,$APP.V,[e,$APP.Me.i(c,$APP.N.h(a,e),d)],null)}),b)};Tv.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};Tv.C=3;
var Rv=function Rv(a){switch(arguments.length){case 0:return Rv.m();case 1:return Rv.g(arguments[0]);case 2:return Rv.h(arguments[0],arguments[1]);case 3:return Rv.i(arguments[0],arguments[1],arguments[2]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(3),0,null);return Rv.l(arguments[0],arguments[1],arguments[2],c)}};Rv.m=function(){return $APP.ce};Rv.g=function(a){return a};
Rv.h=function(a,b){return function(){function c(l,n,q){l=b.i?b.i(l,n,q):b.call(null,l,n,q);return a.g?a.g(l):a.call(null,l)}function d(l,n){l=b.h?b.h(l,n):b.call(null,l,n);return a.g?a.g(l):a.call(null,l)}function e(l){l=b.g?b.g(l):b.call(null,l);return a.g?a.g(l):a.call(null,l)}function f(){var l=b.m?b.m():b.call(null);return a.g?a.g(l):a.call(null,l)}var g=null,h=function(){function l(q,r,t,u){var x=null;if(3<arguments.length){x=0;for(var v=Array(arguments.length-3);x<v.length;)v[x]=arguments[x+
3],++x;x=new $APP.A(v,0,null)}return n.call(this,q,r,t,x)}function n(q,r,t,u){q=$APP.Me.F(b,q,r,t,u);return a.g?a.g(q):a.call(null,q)}l.C=3;l.D=function(q){var r=$APP.D(q);q=$APP.E(q);var t=$APP.D(q);q=$APP.E(q);var u=$APP.D(q);q=$APP.Pc(q);return n(r,t,u,q)};l.l=n;return l}();g=function(l,n,q,r){switch(arguments.length){case 0:return f.call(this);case 1:return e.call(this,l);case 2:return d.call(this,l,n);case 3:return c.call(this,l,n,q);default:var t=null;if(3<arguments.length){t=0;for(var u=Array(arguments.length-
3);t<u.length;)u[t]=arguments[t+3],++t;t=new $APP.A(u,0,null)}return h.l(l,n,q,t)}throw Error("Invalid arity: "+arguments.length);};g.C=3;g.D=h.D;g.m=f;g.g=e;g.h=d;g.i=c;g.l=h.l;return g}()};
Rv.i=function(a,b,c){return function(){function d(n,q,r){n=c.i?c.i(n,q,r):c.call(null,n,q,r);n=b.g?b.g(n):b.call(null,n);return a.g?a.g(n):a.call(null,n)}function e(n,q){n=c.h?c.h(n,q):c.call(null,n,q);n=b.g?b.g(n):b.call(null,n);return a.g?a.g(n):a.call(null,n)}function f(n){n=c.g?c.g(n):c.call(null,n);n=b.g?b.g(n):b.call(null,n);return a.g?a.g(n):a.call(null,n)}function g(){var n=c.m?c.m():c.call(null);n=b.g?b.g(n):b.call(null,n);return a.g?a.g(n):a.call(null,n)}var h=null,l=function(){function n(r,
t,u,x){var v=null;if(3<arguments.length){v=0;for(var B=Array(arguments.length-3);v<B.length;)B[v]=arguments[v+3],++v;v=new $APP.A(B,0,null)}return q.call(this,r,t,u,v)}function q(r,t,u,x){r=$APP.Me.F(c,r,t,u,x);r=b.g?b.g(r):b.call(null,r);return a.g?a.g(r):a.call(null,r)}n.C=3;n.D=function(r){var t=$APP.D(r);r=$APP.E(r);var u=$APP.D(r);r=$APP.E(r);var x=$APP.D(r);r=$APP.Pc(r);return q(t,u,x,r)};n.l=q;return n}();h=function(n,q,r,t){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,
n);case 2:return e.call(this,n,q);case 3:return d.call(this,n,q,r);default:var u=null;if(3<arguments.length){u=0;for(var x=Array(arguments.length-3);u<x.length;)x[u]=arguments[u+3],++u;u=new $APP.A(x,0,null)}return l.l(n,q,r,u)}throw Error("Invalid arity: "+arguments.length);};h.C=3;h.D=l.D;h.m=g;h.g=f;h.h=e;h.i=d;h.l=l.l;return h}()};
Rv.l=function(a,b,c,d){var e=$APP.oe($APP.P(a,$APP.P(b,$APP.P(c,d))));return function(){function f(h){var l=null;if(0<arguments.length){l=0;for(var n=Array(arguments.length-0);l<n.length;)n[l]=arguments[l+0],++l;l=new $APP.A(n,0,null)}return g.call(this,l)}function g(h){h=$APP.Me.h($APP.D(e),h);for(var l=$APP.E(e);;)if(l){var n=$APP.D(l);h=n.g?n.g(h):n.call(null,h);l=$APP.E(l)}else return h}f.C=0;f.D=function(h){h=$APP.C(h);return g(h)};f.l=g;return f}()};
Rv.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};Rv.C=3;var Mw=function Mw(a){switch(arguments.length){case 0:return Mw.m();case 1:return Mw.g(arguments[0]);case 2:return Mw.h(arguments[0],arguments[1]);default:for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=new $APP.A(c.slice(2),0,null);return Mw.l(arguments[0],arguments[1],c)}};Mw.m=function(){return $APP.yh};Mw.g=function(a){return a};
Mw.h=function(a,b){return $APP.F(a)<$APP.F(b)?$APP.Sa($APP.ne,b,a):$APP.Sa($APP.ne,a,b)};Mw.l=function(a,b,c){a=mu($APP.F,$APP.ne.l(c,b,$APP.K([a])));return $APP.Sa($APP.ui,$APP.D(a),$APP.Pc(a))};Mw.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);c=$APP.E(c);return this.l(b,a,c)};Mw.C=2;ru.prototype.sa=function(){var a=this,b=a.zc;return null==b?$APP.Oj(function(){return $APP.Me.h(a.f,a.cc)},a.f,a.cc,this,null):$APP.y(b)};
ru.prototype.N=function(a,b){return b instanceof ru&&$APP.G.h(this.f,b.f)&&$APP.G.h(this.cc,b.cc)};ru.prototype.O=function(){return $APP.Gc(new $APP.S(null,2,5,$APP.V,[this.f,this.cc],null))};ru.prototype.K=function(a,b,c){return $APP.Kj(b,c,"Track",new $APP.m(null,2,[$APP.en,this.sa(null),$APP.vr,this.f],null))};
var oy=function oy(a,b,c){var e=new $APP.mi(function(){return $APP.Vm.h(b,a)});if("undefined"===typeof $APP.Qe||"undefined"===typeof $APP.pn||"undefined"===typeof $APP.qn||"undefined"===typeof ny)ny=function(f,g,h,l,n){this.form=f;this.Pa=g;this.Oa=h;this.$b=l;this.Te=n;this.o=393216;this.B=0},ny.prototype.J=function(f,g){return new ny(this.form,this.Pa,this.Oa,this.$b,g)},ny.prototype.I=function(){return this.Te},ny.prototype.Ua=function(){return this},ny.prototype.Va=function(){return this},ny.prototype.Cb=
$APP.z,ny.prototype.rb=function(f,g){return null==g?null:$APP.ym($APP.y(this.$b),g)},ny.prototype.sb=function(f,g,h,l,n){f=$APP.y(this.$b);return $APP.Pm($APP.ln(f,n,$APP.xn,null))&&null!=n?$APP.ne.h($APP.nn(this.form,this.Pa,$APP.ne.h(g,$APP.Xp),h,l,n),new $APP.m(null,5,[$APP.an,$APP.ne.h(g,$APP.qo),$APP.dn,$APP.Aq,$APP.en,n,$APP.gn,h,$APP.bn,l],null)):null},ny.prototype.tb=function(f,g){return oy.i?oy.i(this.form,this.Pa,g):oy.call(null,this.form,this.Pa,g)},ny.Na=!0,ny.Ha="cljs.spec.alpha/t_cljs$spec$alpha14227",
ny.Qa=function(f){return $APP.Zb(f,"cljs.spec.alpha/t_cljs$spec$alpha14227")};return new ny(a,b,c,e,$APP.Te)},py=new $APP.R(null,"nf","nf",76757951),Tx=new $APP.R(null,"xmlns","xmlns",-1862095571),ww=new $APP.R("nyancad.mosaic.editor","device","nyancad.mosaic.editor/device",1397330629),fv=new $APP.R(null,"dominant-baseline","dominant-baseline",609259826),Av=new $APP.R("nyancad.mosaic.editor","bg","nyancad.mosaic.editor/bg",1513825358),ev=new $APP.R(null,"text-anchor","text-anchor",585613696),qy=new $APP.R(null,
"delete","delete",-1768633620),ry=new $APP.R(null,"span.tray","span.tray",393150468),Gw=new $APP.R("nyancad.mosaic.editor","sym","nyancad.mosaic.editor/sym",1888367968),Ww=new $APP.R(null,"data","data",-232669377),Cx=new $APP.R(null,"circle","circle",1903212362),sy=new $APP.R("nyancad.mosaic.editor","split","nyancad.mosaic.editor/split",-2060037753),Vw=new $APP.R(null,"content_type","content_type",52159344),kw=new $APP.R("nyancad.mosaic.editor","view","nyancad.mosaic.editor/view",-479208243),Jx=new $APP.R(null,
"g.staging","g.staging",1672233513),ty=new $APP.R(null,"escape","escape",-991601952),qv=new $APP.R(null,"model","model",331153215),Fw=new $APP.Jc(null,"circuit-conn","circuit-conn",381274267,null),ax=new $APP.R("nyancad.mosaic.editor","props","nyancad.mosaic.editor/props",1113223408),$x=new $APP.R(null,"line.grid","line.grid",1678589712),cy=new $APP.R(null,"x2","x2",-1362513475),ay=new $APP.R(null,"x1","x1",-1863922247),Hx=new $APP.R("nyancad.mosaic.editor","stagingconn","nyancad.mosaic.editor/stagingconn",
-932497011),uy=new $APP.R(null,"selected","selected",574897764),Vu=new $APP.R(null,"width","width",-384071477),Bw=new $APP.Jc("nyancad.mosaic.editor","circuit-shape","nyancad.mosaic.editor/circuit-shape",-666412374,null),Zw=new $APP.R(null,"option","option",65132272),rw=new $APP.R("nyancad.mosaic.editor","tool","nyancad.mosaic.editor/tool",195718619),dy=new $APP.R(null,"y2","y2",-718691301),by=new $APP.R(null,"y1","y1",589123466),Qx=new $APP.R(null,"div.sidebar","div.sidebar",1454675964),sw=new $APP.R("nyancad.mosaic.editor",
"cursor","nyancad.mosaic.editor/cursor",61601755),Kw=new $APP.R("nyancad.mosaic.editor","delta","nyancad.mosaic.editor/delta",-1578540228),vy=new $APP.R(null,"line.wire","line.wire",58251721),wy=new $APP.R("nyancad.mosaic.editor","ui","nyancad.mosaic.editor/ui",-586117532),Ux=new $APP.R(null,"view-box","view-box",-1792199155),Lu=new $APP.R("nyancad.mosaic.editor","undo","nyancad.mosaic.editor/undo",1787806883),xy=new $APP.R("nyancad.mosaic.editor","prev-tool","nyancad.mosaic.editor/prev-tool",1457058552),
Yw=new $APP.R(null,"select","select",1147833503),nw=new $APP.R("nyancad.mosaic.editor","wire","nyancad.mosaic.editor/wire",-496129451),Uw=new $APP.R(null,"_attachments","_attachments",-1723171260),Lx=new $APP.R(null,"div#mosaic_app","div#mosaic_app",-171697550),Xx=new $APP.R(null,"defs","defs",1398449717),yw=new $APP.R("nyancad.mosaic.editor","box","nyancad.mosaic.editor/box",72685753),Ex=new $APP.R(null,"g.toolstaging","g.toolstaging",1423440533),dv=new $APP.R(null,"text.identifier","text.identifier",
968733366),zv=new $APP.R("nyancad.mosaic.editor","conn","nyancad.mosaic.editor/conn",1132704290),jw=new $APP.R("nyancad.mosaic.editor","mouse","nyancad.mosaic.editor/mouse",1202743035),fy=new $APP.R(null,"fill","fill",883462889),Uu=new $APP.R(null,"rect.tetris","rect.tetris",319962617),Iw=new $APP.Jc(null,"circuit-sym","circuit-sym",1687815857,null),Pu=new $APP.R(null,"circle.port","circle.port",2124426562),Ix=new $APP.R(null,"rect.select","rect.select",-274352052),$w=new $APP.R(null,"tooltip","tooltip",
-1809677058),Tw=new $APP.R(null,"schematic","schematic",884071610),Wv=new $APP.R("nyancad.mosaic.editor","selected","nyancad.mosaic.editor/selected",1532065651),yy=new $APP.R(null,"circle.outline","circle.outline",1162019949),mw=new $APP.R("nyancad.mosaic.editor","staging","nyancad.mosaic.editor/staging",160758696),px=new $APP.R("nyancad.mosaic.editor","theme","nyancad.mosaic.editor/theme",-1698705327),tv=new $APP.R(null,"rect.outline","rect.outline",35870808),zy=new $APP.R(null,"inductance","inductance",
-14909622),Ay=new $APP.R(null,"i","i",-1386841315),By=new $APP.R(null,"g","g",1738089905),Cy=new $APP.R(null,"e","e",1381269198),Dy=new $APP.R(null,"c","c",-1763192079),Ey=new $APP.R(null,"d","d",1972142424),Fy=new $APP.R(null,"b","b",1482224470),Gy=new $APP.R(null,"z","z",-789527183),Hy=new $APP.R(null,"w","w",354169001),Iy=new $APP.R(null,"v","v",21465059),Jy=new $APP.R(null,"s","s",1705939918),Ky=new $APP.R(null,"m","m",1632677161),mx=new $APP.R(null,"span.sep","span.sep",-303070340),Hw=new $APP.Jc("nyancad.mosaic.editor",
"circuit-sym","nyancad.mosaic.editor/circuit-sym",-1670824032,null),Wu=new $APP.R(null,"height","height",1025178622),Nx=new $APP.R(null,"div.menu.chrome","div.menu.chrome",2039856843),jx=new $APP.R(null,"div.primary","div.primary",1467266760),sx=new $APP.R(null,"dangerouslySetInnerHTML","dangerouslySetInnerHTML",-554971138),Ly=new $APP.R(null,"transform-origin","transform-origin",-586167370),zx=new $APP.R(null,"on-mouse-up","on-mouse-up",-1340533320),Cw=new $APP.Jc(null,"nyancad.mosaic.editor","nyancad.mosaic.editor",
1155727264,null),$v=new $APP.R("nyancad.mosaic.editor","mouse-start","nyancad.mosaic.editor/mouse-start",-1507097836),rv=new $APP.R(null,"image","image",-58725096),$u=new $APP.R(null,"points","points",-1486596883),ey=new $APP.R(null,"rect","rect",-108902628),My=new $APP.R(null,"capacitance","capacitance",-273749869),gw=new $APP.R("nyancad.mosaic.editor","eraser","nyancad.mosaic.editor/eraser",-1170358934),Zu=new $APP.R(null,"polyline","polyline",-1731551044),Px=new $APP.R(null,"div.devicetray.chrome",
"div.devicetray.chrome",903230993),pv=new $APP.R(null,"props","props",453281727),Ny=new $APP.R(null,"g.wire","g.wire",1233150072),kx=new $APP.R("nyancad.mosaic.editor","pan","nyancad.mosaic.editor/pan",1148994537),sv=new $APP.R(null,"on-mouse-down","on-mouse-down",1147755470),tx=new $APP.R(null,"__html","__html",674048345),vx=new $APP.R(null,"variant","variant",-424354234),Oy=new $APP.R(null,"ac","ac",-1891632475),Py=new $APP.R(null,"line.wirebb","line.wirebb",-1079360418),Qy=new $APP.R(null,"g.device",
"g.device",-538642655),Yx=new $APP.R(null,"pattern","pattern",242135423),Dw=new $APP.Jc(null,"circuit-shape","circuit-shape",22565817,null),Fx=new $APP.R("nyancad.mosaic.editor","stagingbg","nyancad.mosaic.editor/stagingbg",1418997463),Ew=new $APP.Jc("nyancad.mosaic.editor","circuit-conn","nyancad.mosaic.editor/circuit-conn",2141897096,null),lx=new $APP.R("nyancad.mosaic.editor","probe","nyancad.mosaic.editor/probe",33168059),bv=new $APP.R(null,"polygon.arrow","polygon.arrow",-453339260),Ru=new $APP.R(null,
"cy","cy",755331060),Qu=new $APP.R(null,"cx","cx",1272694324),bx=new $APP.R(null,"spice","spice",1062386404),dw=new $APP.R("nyancad.mosaic.editor","dragging","nyancad.mosaic.editor/dragging",-1899225452),Ry=new $APP.R(null,"dc","dc",1726058308),Sy=new $APP.R(null,"resistance","resistance",-1289779601),Ty=new $APP.R(null,"backspace","backspace",-696007848),Gx=new $APP.R("nyancad.mosaic.editor","stagingsym","nyancad.mosaic.editor/stagingsym",1725041827),Rx=new $APP.R(null,"svg#mosaic_canvas","svg#mosaic_canvas",
-1312346936),ox=new $APP.R(null,"div.secondary","div.secondary",-2037301824),Mv=new $APP.R("nyancad.mosaic.editor","zoom","nyancad.mosaic.editor/zoom",-1377973775),Uy=new $APP.R(null,"unit","unit",375175175),Ox=new $APP.R(null,"div.content","div.content",-298042649),Sx=new $APP.R(null,"on-wheel","on-wheel",-1971630708),Vx=new $APP.R(null,"on-mouse-move","on-mouse-move",-1386320874),Zx=new $APP.R(null,"pattern-units","pattern-units",-1273751842);var Vy=new URLSearchParams(window.location.search),Ju,Wy=Vy.get("schem");Ju=$APP.p(Wy)?Wy:"myschem";var mv,Xy=Vy.get("db");mv=$APP.p(Xy)?Xy:"schematics";var hx=$APP.p(window.dburl)?(new URL(mv,window.dburl)).href:mv,nv,Yy=Vy.get("sync");nv=$APP.p(Yy)?Yy:null;var ky=new $APP.Es(hx),eu=$APP.xm(ky,Ju,$APP.kl($APP.Te));cu(eu.cache,function(a){var b=$APP.mn($APP.Ip,a);return b?b:console.log($APP.ei($APP.K([a])),qu($APP.Ip,a))});var jv=$APP.xm(ky,"models",$APP.kl($APP.Te)),Sw=$APP.xm(ky,"snapshots",$APP.kl($APP.Te));
$APP.vm(ky,$APP.K([eu,jv,Sw]));var Zy=new $APP.Es("local"),dx=$APP.xm(Zy,"local",$APP.gf($APP.Te));$APP.vm(Zy,$APP.K([dx]));var Lv=$APP.kl(new $APP.m(null,6,[Mv,new $APP.S(null,4,5,$APP.V,[0,0,500,500],null),px,"tetris",rw,sw,Wv,$APP.yh,jw,new $APP.S(null,2,5,$APP.V,[0,0],null),$v,new $APP.S(null,2,5,$APP.V,[0,0],null)],null));
$APP.kn(Mv,$APP.gj($APP.xq,$APP.wq,$APP.Pn,4),$APP.Yn($APP.Gq,$APP.Ja,new $APP.m(null,5,[$APP.In,null,$APP.Kn,function(a){return $APP.xd(a)&&$APP.G.h(4,$APP.De(4,a))},$APP.Pn,4,$APP.Sn,!0,$APP.Mn,$APP.gj($APP.xq,$APP.wq,$APP.Pn,4)],null),null));$APP.kn(px,new $APP.xh(null,new $APP.m(null,2,["eyesore","null","tetris","null"],null),null),new $APP.xh(null,new $APP.m(null,2,["eyesore",null,"tetris",null],null),null));
$APP.kn(rw,new $APP.xh(null,new $APP.m(null,6,[ww,"null",kx,"null",gw,"null",nw,"null",lx,"null",sw,"null"],null),null),new $APP.xh(null,new $APP.m(null,6,[ww,null,kx,null,gw,null,nw,null,lx,null,sw,null],null),null));
$APP.kn(Wv,$APP.gj($APP.Kq,$APP.yq,$APP.gj($APP.xq,$APP.aq)),$APP.Ps(new $APP.S(null,2,5,$APP.V,[$APP.yq,$APP.gj($APP.xq,$APP.aq)],null),new $APP.S(null,2,5,$APP.V,[$APP.yd,$APP.Yn($APP.Gp,$APP.La,new $APP.m(null,4,[$APP.In,null,$APP.Kn,function(a){return $APP.xd(a)},$APP.Sn,!0,$APP.Mn,$APP.gj($APP.xq,$APP.aq)],null),null)],null),null));
$APP.kn(dw,$APP.gj($APP.vs,new $APP.xh(null,new $APP.m(null,4,[ww,"null",kw,"null",nw,"null",yw,"null"],null),null)),oy(new $APP.xh(null,new $APP.m(null,4,[ww,"null",kw,"null",nw,"null",yw,"null"],null),null),new $APP.xh(null,new $APP.m(null,4,[ww,null,kw,null,nw,null,yw,null],null),null),null));$APP.kn(mw,$APP.gj($APP.vs,$APP.Pq),oy($APP.Pq,$APP.Pq,null));
$APP.kn(wy,$APP.gj($APP.pr,$APP.Ir,new $APP.S(null,4,5,$APP.V,[Mv,px,rw,Wv],null),$APP.rs,new $APP.S(null,2,5,$APP.V,[dw,mw],null)),$APP.Os($APP.Yg([$APP.Jq,$APP.bq,$APP.gr,$APP.sr,$APP.nr,$APP.gs,$APP.Mr,$APP.Ir,$APP.ks,$APP.rr,$APP.er,$APP.rs],[null,null,null,new $APP.S(null,5,5,$APP.V,[function(a){return $APP.Bd(a)},function(a){return $APP.Ld(a,Mv)},function(a){return $APP.Ld(a,px)},function(a){return $APP.Ld(a,rw)},function(a){return $APP.Ld(a,Wv)}],null),function(a){return $APP.Bd(a)&&$APP.Ld(a,
Mv)&&$APP.Ld(a,px)&&$APP.Ld(a,rw)&&$APP.Ld(a,Wv)},new $APP.S(null,2,5,$APP.V,[dw,mw],null),new $APP.S(null,4,5,$APP.V,[Mv,px,rw,Wv],null),new $APP.S(null,4,5,$APP.V,[Mv,px,rw,Wv],null),new $APP.S(null,4,5,$APP.V,[Mv,px,rw,Wv],null),new $APP.S(null,2,5,$APP.V,[dw,mw],null),new $APP.S(null,5,5,$APP.V,[$APP.gj($APP.Np,new $APP.S(null,1,5,$APP.V,[$APP.Sm],null),$APP.gj($APP.Eq,$APP.Sm)),$APP.gj($APP.Np,new $APP.S(null,1,5,$APP.V,[$APP.Sm],null),$APP.gj($APP.Er,$APP.Sm,Mv)),$APP.gj($APP.Np,new $APP.S(null,
1,5,$APP.V,[$APP.Sm],null),$APP.gj($APP.Er,$APP.Sm,px)),$APP.gj($APP.Np,new $APP.S(null,1,5,$APP.V,[$APP.Sm],null),$APP.gj($APP.Er,$APP.Sm,rw)),$APP.gj($APP.Np,new $APP.S(null,1,5,$APP.V,[$APP.Sm],null),$APP.gj($APP.Er,$APP.Sm,Wv))],null),new $APP.S(null,2,5,$APP.V,[dw,mw],null)])));cu(Lv,function(a){var b=$APP.mn(wy,a);return b?b:console.log($APP.ei($APP.K([a])),qu(wy,a))});
var Wx=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[Mv],null)),Mx=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[px],null)),fw=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[rw],null)),Uv=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[Wv],null)),aw=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[Kw],null)),Sv=$APP.ll(Lv,new $APP.S(null,1,5,$APP.V,[mw],null)),Au=$APP.gf($APP.ud(new $APP.S(null,2,5,$APP.V,[new $APP.ke(null,null,null,1,null),null],null),new $APP.m(null,3,[$APP.Qr,$APP.Gd,$APP.cs,$APP.ce,$APP.hq,function(a,b){return $APP.ud(b,
$APP.vd(a))}],null)));fu(Lu,function(a,b,c,d){return Bu(d)});var nx=$APP.kl(!1),Tu=function Tu(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=3<c.length?new $APP.A(c.slice(3),0,null):null;return Tu.l(arguments[0],arguments[1],arguments[2],c)};
Tu.l=function(a,b,c,d){return $APP.ui.h(new $APP.S(null,2,5,$APP.V,[Qy,new $APP.m(null,4,[sv,function(e){return xw.h?xw.h(b,e):xw.call(null,b,e)},Vx,function(e){return iw.h?iw.h(b,e):iw.call(null,b,e)},$APP.oq,new $APP.m(null,2,[$APP.ir,yu($APP.ir.h(c,$APP.at)).translate(50*$APP.yr.g(c),50*$APP.xr.g(c)).toString(),Ly,[$APP.w.g(50*($APP.yr.g(c)+a/2)),"px ",$APP.w.g(50*($APP.xr.g(c)+a/2)),"px"].join("")],null),$APP.cl,new $APP.S(null,3,5,$APP.V,[$APP.os.g(c),vx.g(c),$APP.Ld($APP.y(Uv),b)?uy:null],null)],
null)],null),d)};Tu.C=3;Tu.D=function(a){var b=$APP.D(a),c=$APP.E(a);a=$APP.D(c);var d=$APP.E(c);c=$APP.D(d);d=$APP.E(d);return this.l(b,a,c,d)};
var yv=$APP.Yg("pmos capacitor wire pnp inductor diode isource port vsource resistor npn nmos".split(" "),[new $APP.m(null,4,[Av,$APP.qt,zv,$APP.rt,Gw,hv,ax,new $APP.m(null,4,[Ky,new $APP.m(null,1,[$w,"multiplier"],null),py,new $APP.m(null,1,[$w,"number of fingers"],null),Hy,new $APP.m(null,2,[$w,"width",Uy,"meter"],null),$APP.tr,new $APP.m(null,2,[$w,"lenght",Uy,"meter"],null)],null)],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,6,5,$APP.V,[Tu,3,a,b,new $APP.S(null,
3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,4,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.4],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.1,1.4],null),new $APP.S(null,2,5,$APP.V,[1.9,1.4],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.1,1.6],null),new $APP.S(null,2,5,$APP.V,[1.9,1.6],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,
[1.5,1.6],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null)],null)},ax,new $APP.m(null,1,[My,new $APP.m(null,2,[$w,"Capacitance",Uy,"Farad"],null)],null)],null),new $APP.m(null,4,[Av,$APP.Rf,zv,$APP.Rf,Gw,function(a,b){(function(){var g=$APP.lj.g(b);return $APP.p(g)?g:a})();var c=$APP.yr.g(b),d=$APP.xr.g(b),e=$APP.Op.g(b),f=$APP.Pp.g(b);return new $APP.S(null,4,5,$APP.V,[Ny,new $APP.m(null,3,[sv,function(g){return xw.h?xw.h(a,g):xw.call(null,a,g)},Vx,function(g){return iw.h?iw.h(a,
g):iw.call(null,a,g)},$APP.cl,$APP.Ld($APP.y(Uv),a)?uy:null],null),new $APP.S(null,2,5,$APP.V,[Py,new $APP.m(null,4,[ay,50*(c+.5),by,50*(d+.5),cy,50*(c+e+.5),dy,50*(d+f+.5)],null)],null),new $APP.S(null,2,5,$APP.V,[vy,new $APP.m(null,4,[ay,50*(c+.5),by,50*(d+.5),cy,50*(c+e+.5),dy,50*(d+f+.5)],null)],null)],null)},ax,$APP.Te],null),new $APP.m(null,4,[Av,$APP.qt,zv,$APP.st,Gw,iv,ax,new $APP.m(null,4,[Ky,new $APP.m(null,1,[$w,"multiplier"],null),py,new $APP.m(null,1,[$w,"number of fingers"],null),Hy,
new $APP.m(null,2,[$w,"width",Uy,"meter"],null),$APP.tr,new $APP.m(null,2,[$w,"lenght",Uy,"meter"],null)],null)],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,7,5,$APP.V,[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,
1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.S(null,2,5,$APP.V,[$APP.an,new $APP.m(null,1,[Ey,"M75,55\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 a5,5 90 0,0 0,10\n                 "],null)],null)],null)},ax,new $APP.m(null,1,[zy,new $APP.m(null,2,[$w,"Inductance",Uy,"Henry"],null)],null)],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,7,5,$APP.V,
[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,3,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.4],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.3,1.6],null),new $APP.S(null,2,5,$APP.V,[1.7,1.6],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.6],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.S(null,
5,5,$APP.V,[cv,1.5,1.6,.2,270],null)],null)},ax,$APP.Te],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,8,5,$APP.V,[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,3,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.25],null),new $APP.S(null,2,5,$APP.V,[1.5,1.65],null)],
null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.S(null,2,5,$APP.V,[yy,new $APP.m(null,3,[Qu,75,Ru,75,$APP.Ar,20],null)],null),new $APP.S(null,5,5,$APP.V,[cv,1.5,1.8,.15,-90],null)],null)},ax,new $APP.m(null,2,[Ry,new $APP.m(null,2,[$w,"DC current",Uy,"Ampere"],null),Oy,new $APP.m(null,2,[$w,"AC current",Uy,"Ampere"],null)],null)],null),new $APP.m(null,4,[Av,$APP.Rf,zv,new $APP.S(null,1,5,$APP.V,[new $APP.S(null,
3,5,$APP.V,[0,0,"P"],null)],null),Gw,function(a,b){return new $APP.S(null,6,5,$APP.V,[Tu,1,a,b,function(){switch(vx.g(b)){case "ground":return new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,.5],null),new $APP.S(null,2,5,$APP.V,[.3,.5],null)],null),new $APP.S(null,4,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[0,.5],null),new $APP.S(null,2,5,$APP.V,[.3,.2],null),new $APP.S(null,2,5,$APP.V,[.3,.8],null),new $APP.S(null,2,5,$APP.V,[0,.5],
null)],null)],null)],null);case "supply":return new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,.5],null),new $APP.S(null,2,5,$APP.V,[0,.5],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[0,.2],null),new $APP.S(null,2,5,$APP.V,[0,.8],null)],null)],null)],null);default:return new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,1,5,$APP.V,[new $APP.S(null,6,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[.5,.5],null),new $APP.S(null,
2,5,$APP.V,[.3,.3],null),new $APP.S(null,2,5,$APP.V,[0,.3],null),new $APP.S(null,2,5,$APP.V,[0,.7],null),new $APP.S(null,2,5,$APP.V,[.3,.7],null),new $APP.S(null,2,5,$APP.V,[.5,.5],null)],null)],null)],null)}}(),new $APP.S(null,3,5,$APP.V,[$APP.Xq,new $APP.m(null,3,[ev,function(){switch(Math.round($APP.D($APP.ir.g(b)))){case 1:return"end";case -1:return"start";default:return"middle"}}(),fv,"middle",$APP.ir,yu($APP.ir.g(b)).translate(50/3,-25).inverse().toString()],null),$APP.lj.g(b)],null)],null)},
ax,$APP.Te],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,9,5,$APP.V,[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null),new $APP.S(null,2,5,$APP.V,
[yy,new $APP.m(null,3,[Qu,75,Ru,75,$APP.Ar,20],null)],null),new $APP.S(null,3,5,$APP.V,[$APP.Xq,new $APP.m(null,3,[$APP.yr,75,$APP.xr,70,ev,"middle"],null),"+"],null),new $APP.S(null,3,5,$APP.V,[$APP.Xq,new $APP.m(null,3,[$APP.yr,75,$APP.xr,90,ev,"middle"],null),"−"],null)],null)},ax,new $APP.m(null,2,[Ry,new $APP.m(null,2,[$w,"DC voltage",Uy,"Volt"],null),Oy,new $APP.m(null,2,[$w,"AC voltage",Uy,"Volt"],null)],null)],null),new $APP.m(null,4,[Av,$APP.tt,zv,$APP.ut,Gw,function(a,b){return new $APP.S(null,
7,5,$APP.V,[Tu,3,a,b,new $APP.S(null,3,5,$APP.V,[gv,b,3],null),new $APP.S(null,2,5,$APP.V,[tv,new $APP.m(null,4,[$APP.yr,67.5,$APP.xr,1.1*50,Vu,15,Wu,40],null)],null),new $APP.S(null,2,5,$APP.V,[av,new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,.5],null),new $APP.S(null,2,5,$APP.V,[1.5,1.1],null)],null),new $APP.S(null,2,5,$APP.V,[new $APP.S(null,2,5,$APP.V,[1.5,1.9],null),new $APP.S(null,2,5,$APP.V,[1.5,2.5],null)],null)],null)],null)],null)},ax,new $APP.m(null,
1,[Sy,new $APP.m(null,2,[$w,"Resistance",Uy,"Ohm"],null)],null)],null),new $APP.m(null,4,[Av,$APP.qt,zv,$APP.st,Gw,iv,ax,new $APP.m(null,4,[Ky,new $APP.m(null,1,[$w,"multiplier"],null),py,new $APP.m(null,1,[$w,"number of fingers"],null),Hy,new $APP.m(null,2,[$w,"width",Uy,"meter"],null),$APP.tr,new $APP.m(null,2,[$w,"lenght",Uy,"meter"],null)],null)],null),new $APP.m(null,4,[Av,$APP.qt,zv,$APP.rt,Gw,hv,ax,new $APP.m(null,4,[Ky,new $APP.m(null,1,[$w,"multiplier"],null),py,new $APP.m(null,1,[$w,"number of fingers"],
null),Hy,new $APP.m(null,2,[$w,"width",Uy,"meter"],null),$APP.tr,new $APP.m(null,2,[$w,"lenght",Uy,"meter"],null)],null)],null)]),Gv=function(a){for(var b=[],c=arguments.length,d=0;;)if(d<c)b.push(arguments[d]),d+=1;else break;b=1<b.length?new $APP.A(b.slice(1),0,null):null;return new ru(arguments[0],b)}(function(){return Ev()});
fu(sy,function $y(){gu(sy);gu(Lu);var b=$APP.jm(1);$APP.Ol(function(){var c=function(){function e(f){var g=f[1];if(7===g){g=f[7];var h=f[8],l=f[9],n=f[10],q=f[2];f[7]=g;f[8]=h+1;f[11]=q;f[9]=l;f[10]=n;f[2]=null;f[1]=2;return $APP.gm}return 1===g?(g=$APP.y(Gv),g=Fv(g),g=$APP.C(g),f[7]=g,f[8]=0,f[9]=0,f[10]=null,f[2]=null,f[1]=2,$APP.gm):4===g?(h=f[8],n=f[10],h=$APP.qd(n,h),g=$APP.M(h,0,null),h=$APP.M(h,1,null),g=Jv(g,h),$APP.hm(f,7,g)):13===g?(f[2]=f[2],f[1]=10,$APP.gm):6===g?(f[2]=f[2],f[1]=3,$APP.gm):
3===g?(g=f[2],h=fu(Lu,function(){return function(r,t,u,x){return Bu(x)}}()),l=fu(sy,$y),f[12]=g,f[13]=h,$APP.im(f,l)):12===g?(h=f[14],h=$APP.D(h),g=$APP.M(h,0,null),h=$APP.M(h,1,null),g=Jv(g,h),$APP.hm(f,14,g)):2===g?(h=f[8],l=f[9],f[1]=$APP.p(h<l)?4:5,$APP.gm):11===g?(h=f[14],g=$APP.oc(h),h=$APP.pc(h),l=$APP.F(g),f[7]=h,f[8]=0,f[9]=l,f[10]=g,f[2]=null,f[1]=2,$APP.gm):9===g?(f[2]=null,f[1]=10,$APP.gm):5===g?(g=f[7],h=f[14],g=$APP.C(g),f[14]=g,f[1]=g?8:9,$APP.gm):14===g?(h=f[14],l=f[2],g=$APP.E(h),
f[7]=g,f[8]=0,f[9]=0,f[15]=l,f[10]=null,f[2]=null,f[1]=2,$APP.gm):10===g?(f[2]=f[2],f[1]=6,$APP.gm):8===g?(h=f[14],f[1]=$APP.Ed(h)?11:12,$APP.gm):null}return function(){function f(l){for(;;){a:try{for(;;){var n=e(l);if(!$APP.re(n,$APP.gm)){var q=n;break a}}}catch(r){q=r;l[2]=q;if($APP.C(l[4]))l[1]=$APP.D(l[4]);else throw q;q=$APP.gm}if(!$APP.re(q,$APP.gm))return q}}function g(){var l=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null];l[0]=h;l[1]=1;return l}var h=null;
h=function(l){switch(arguments.length){case 0:return g.call(this);case 1:return f.call(this,l)}throw Error("Invalid arity: "+arguments.length);};h.m=g;h.g=f;return h}()}(),d=function(){var e=c();e[6]=b;return e}();return $APP.fm(d)});return b});
var Yv=$APP.gf(new $APP.S(null,2,5,$APP.V,[0,0],null)),hw=$APP.gf($APP.yh),uw=new BroadcastChannel("probe"),yx=function yx(a){for(var c=[],d=arguments.length,e=0;;)if(e<d)c.push(arguments[e]),e+=1;else break;c=0<c.length?new $APP.A(c.slice(0),0,null):null;return yx.l(c)};
yx.l=function(){var a=$APP.kl(0),b=$APP.kl(null);return function(){function c(e){var f=null;if(0<arguments.length){f=0;for(var g=Array(arguments.length-0);f<g.length;)g[f]=arguments[f+0],++f;f=new $APP.A(g,0,null)}return d.call(this,f)}function d(e){var f=$APP.df(function(g,h){return new $APP.S(null,3,5,$APP.V,[$APP.rq,new $APP.m(null,2,[$APP.oj,g,zx,function(){return $APP.hf(a,g)}],null),h],null)},e);return new $APP.S(null,4,5,$APP.V,[$APP.Kr,new $APP.m(null,2,[sv,function(g){var h=g.currentTarget;
return $APP.hf(b,setTimeout(function(){return h.open=!0},300))},zx,function(g){clearTimeout($APP.y(b));return g.currentTarget.open=!1}],null),new $APP.S(null,3,5,$APP.V,[$APP.Rq,new $APP.m(null,1,[$APP.Qp,function(g){return g.preventDefault()}],null),$APP.id(e,$APP.y(a))],null),new $APP.S(null,3,5,$APP.V,[ry,$APP.Xn.h($APP.y(a),f),$APP.mf($APP.y(a)+1,f)],null)],null)}c.C=0;c.D=function(e){e=$APP.C(e);return d(e)};c.l=d;return c}()};yx.C=0;yx.D=function(a){return this.l($APP.C(a))};
var hy=$APP.Yg([new $APP.xh(null,new $APP.m(null,1,[Dy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[$APP.tr,null],null),null),new $APP.xh(null,new $APP.m(null,2,[Gy,null,$APP.hs,null],null),null),new $APP.xh(null,new $APP.m(null,2,[$APP.Wp,null,$APP.Cr,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Ey,null],null),null),new $APP.xh(null,new $APP.m(null,2,[$APP.Wp,null,Fy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[qy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Jy,
null],null),null),new $APP.xh(null,new $APP.m(null,1,[$APP.Ar,null],null),null),new $APP.xh(null,new $APP.m(null,1,[By,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Fy,null],null),null),new $APP.xh(null,new $APP.m(null,2,[$APP.Wp,null,Ky,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Cy,null],null),null),new $APP.xh(null,new $APP.m(null,2,[Dy,null,$APP.hs,null],null),null),new $APP.xh(null,new $APP.m(null,1,[ty,null],null),null),new $APP.xh(null,new $APP.m(null,2,[$APP.hs,null,$APP.yr,
null],null),null),new $APP.xh(null,new $APP.m(null,2,[$APP.Wp,null,Jy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[$APP.yr,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Ky,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Iy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Ay,null],null),null),new $APP.xh(null,new $APP.m(null,2,[Iy,null,$APP.hs,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Ty,null],null),null),new $APP.xh(null,new $APP.m(null,3,[$APP.Wp,null,Gy,null,
$APP.hs,null],null),null),new $APP.xh(null,new $APP.m(null,1,[Hy,null],null),null),new $APP.xh(null,new $APP.m(null,1,[$APP.vr,null],null),null),new $APP.xh(null,new $APP.m(null,1,[$APP.Cr,null],null),null),$APP.zh([$APP.Xh.g(" ")]),new $APP.xh(null,new $APP.m(null,2,[$APP.Wp,null,$APP.vr,null],null),null)],[function(){return Qw("capacitor",jw.g($APP.y(Lv)))},function(){return Qw("inductor",jw.g($APP.y(Lv)))},Nu,function(){return xx(jw.g($APP.y(Lv)))},function(){return Qw("diode",jw.g($APP.y(Lv)))},
function(){return Qw("pnp",jw.g($APP.y(Lv)))},Xv,function(){return Vv(function(a){return a.rotate(90)})},function(){return Qw("resistor",jw.g($APP.y(Lv)))},function(){return wx(jw.g($APP.y(Lv)))},function(){return Qw("npn",jw.g($APP.y(Lv)))},function(){return Qw("pmos",jw.g($APP.y(Lv)))},function(){return $APP.Z.l(Lv,$APP.X,rw,gw,$APP.K([mw,null]))},ex,tw,fx,function(){return Vv(function(a){return a.rotate(-90)})},function(){return Qw("ckt",jw.g($APP.y(Lv)))},function(){return Qw("nmos",jw.g($APP.y(Lv)))},
function(){return Qw("vsource",jw.g($APP.y(Lv)))},function(){return Qw("isource",jw.g($APP.y(Lv)))},gx,Xv,Ou,function(){return $APP.Z.u(Lv,$APP.X,rw,nw)},function(){return Vv(function(a){return a.flipX()})},function(){return Qw("port",jw.g($APP.y(Lv)))},function(){return $APP.Z.h(Lv,function(a){return $APP.X.i(a,rw,xy.g(a))})},function(){return Vv(function(a){return a.flipY()})}]),iy=$APP.rg([$APP.zh([$APP.Xh.g(" ")]),function(){return $APP.Z.h(Lv,function(a){return $APP.X.l(a,rw,kx,$APP.K([xy,rw.g(a)]))})}]);
$APP.ja("nyancad.mosaic.editor.render",jy);$APP.ja("nyancad.mosaic.editor.init",ly);$APP.ja("nyancad.mosaic.editor.clear",function(){return $APP.Z.i(eu,function(a,b){return $APP.Me.i($APP.Hj,a,b)},$APP.Ch($APP.qh($APP.y(eu))))});try{ly()}catch(a){throw console.error("An error occurred when calling (nyancad.mosaic.editor/init)"),a;};
}).call(this);