imrishabh18/nema-23-stepper-controller
A four-layer NEMA23 stepper motor controller PCB featuring an RP2040 MCU, DRV8452 dual-phase driver, USB‑C PD power input/protection, current and temperature sensing, status LED/buzzer, and optional magnetic encoder.
- Version
- 1.3.2
- License
- unset
- Stars
- 1
scripts/vendor/schematic-style-analyzer.mjs
var E1=Object.create;var{getPrototypeOf:T1,defineProperty:Ts,getOwnPropertyNames:N1}=Object;var lm=Object.prototype.hasOwnProperty;function W1(t){return this[t]}var R1,O1,te=(t,e,r)=>{var i=t!=null&&typeof t==="object";if(i){var n=e?R1??=new WeakMap:O1??=new WeakMap,a=n.get(t);if(a)return a}r=t!=null?E1(T1(t)):{};let o=e||!t||!t.__esModule||!lm.call(t,"default")?Ts(r,"default",{value:t,enumerable:!0}):r;if(t&&typeof t==="object"||typeof t==="function"){for(let c of N1(t))if(!lm.call(o,c))Ts(o,c,{get:W1.bind(t,c),enumerable:!0})}if(i)n.set(t,o);return o};var mn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var j1=(t)=>t;function $1(t,e){this[t]=j1.bind(null,e)}var X1=(t,e)=>{for(var r in e)Ts(t,r,{get:e[r],enumerable:!0,configurable:!0,set:$1.bind(e,r)})};var ee=mn(function(Ws,Rs){(function(t,e){typeof Ws==="object"&&typeof Rs<"u"?Rs.exports=e():typeof define==="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.svgson=e())})(Ws,function(){/*!
* Determine if an object is a Buffer
*
* @author Feross Aboukhadijeh <https://feross.org>
* @license MIT
*/var t=function(J){return J!=null&&(e(J)||r(J)||!!J._isBuffer)};function e(J){return!!J.constructor&&typeof J.constructor.isBuffer==="function"&&J.constructor.isBuffer(J)}function r(J){return typeof J.readFloatLE==="function"&&typeof J.slice==="function"&&e(J.slice(0,0))}var i=Object.prototype.toString,n=function(W){if(typeof W>"u")return"undefined";if(W===null)return"null";if(W===!0||W===!1||W instanceof Boolean)return"boolean";if(typeof W==="string"||W instanceof String)return"string";if(typeof W==="number"||W instanceof Number)return"number";if(typeof W==="function"||W instanceof Function)return"function";if(typeof Array.isArray<"u"&&Array.isArray(W))return"array";if(W instanceof RegExp)return"regexp";if(W instanceof Date)return"date";var j=i.call(W);if(j==="[object RegExp]")return"regexp";if(j==="[object Date]")return"date";if(j==="[object Arguments]")return"arguments";if(j==="[object Error]")return"error";if(t(W))return"buffer";if(j==="[object Set]")return"set";if(j==="[object WeakSet]")return"weakset";if(j==="[object Map]")return"map";if(j==="[object WeakMap]")return"weakmap";if(j==="[object Symbol]")return"symbol";if(j==="[object Int8Array]")return"int8array";if(j==="[object Uint8Array]")return"uint8array";if(j==="[object Uint8ClampedArray]")return"uint8clampedarray";if(j==="[object Int16Array]")return"int16array";if(j==="[object Uint16Array]")return"uint16array";if(j==="[object Int32Array]")return"int32array";if(j==="[object Uint32Array]")return"uint32array";if(j==="[object Float32Array]")return"float32array";if(j==="[object Float64Array]")return"float64array";return"object"};function a(J,W){return W={exports:{}},J(W,W.exports),W.exports}var o=a(function(J){(function(){function W(j,G){if(typeof G!=="function")return j;var D={};for(var et in j)if(Object.prototype.hasOwnProperty.call(j,et))D[G(et,j[et])||et]=j[et];return D}if(J.exports)J.exports=W;else window.rename=W})()}),c=function J(W,j){var G=n(W);if(G!=="object"&&G!=="array")throw Error("expected an object");var D=[];if(G==="object")W=o(W,j),D={};for(var et in W)if(W.hasOwnProperty(et)){var mt=W[et];if(n(mt)==="object"||n(mt)==="array")D[et]=J(mt,j);else D[et]=mt}return D},l=a(function(J){var W=Object.prototype.hasOwnProperty,j="~";function G(){}if(Object.create){if(G.prototype=Object.create(null),!new G().__proto__)j=!1}function D(mt,dt,R){this.fn=mt,this.context=dt,this.once=R||!1}function et(){this._events=new G,this._eventsCount=0}et.prototype.eventNames=function(){var dt=[],R,pt;if(this._eventsCount===0)return dt;for(pt in R=this._events)if(W.call(R,pt))dt.push(j?pt.slice(1):pt);if(Object.getOwnPropertySymbols)return dt.concat(Object.getOwnPropertySymbols(R));return dt},et.prototype.listeners=function(dt,R){var pt=j?j+dt:dt,xt=this._events[pt];if(R)return!!xt;if(!xt)return[];if(xt.fn)return[xt.fn];for(var yt=0,Wt=xt.length,_t=Array(Wt);yt<Wt;yt++)_t[yt]=xt[yt].fn;return _t},et.prototype.emit=function(dt,R,pt,xt,yt,Wt){var _t=j?j+dt:dt;if(!this._events[_t])return!1;var ht=this._events[_t],Tt=arguments.length,Dt,bt;if(ht.fn){if(ht.once)this.removeListener(dt,ht.fn,void 0,!0);switch(Tt){case 1:return ht.fn.call(ht.context),!0;case 2:return ht.fn.call(ht.context,R),!0;case 3:return ht.fn.call(ht.context,R,pt),!0;case 4:return ht.fn.call(ht.context,R,pt,xt),!0;case 5:return ht.fn.call(ht.context,R,pt,xt,yt),!0;case 6:return ht.fn.call(ht.context,R,pt,xt,yt,Wt),!0}for(bt=1,Dt=Array(Tt-1);bt<Tt;bt++)Dt[bt-1]=arguments[bt];ht.fn.apply(ht.context,Dt)}else{var be=ht.length,ce;for(bt=0;bt<be;bt++){if(ht[bt].once)this.removeListener(dt,ht[bt].fn,void 0,!0);switch(Tt){case 1:ht[bt].fn.call(ht[bt].context);break;case 2:ht[bt].fn.call(ht[bt].context,R);break;case 3:ht[bt].fn.call(ht[bt].context,R,pt);break;case 4:ht[bt].fn.call(ht[bt].context,R,pt,xt);break;default:if(!Dt)for(ce=1,Dt=Array(Tt-1);ce<Tt;ce++)Dt[ce-1]=arguments[ce];ht[bt].fn.apply(ht[bt].context,Dt)}}}return!0},et.prototype.on=function(dt,R,pt){var xt=new D(R,pt||this),yt=j?j+dt:dt;if(!this._events[yt])this._events[yt]=xt,this._eventsCount++;else if(!this._events[yt].fn)this._events[yt].push(xt);else this._events[yt]=[this._events[yt],xt];return this},et.prototype.once=function(dt,R,pt){var xt=new D(R,pt||this,!0),yt=j?j+dt:dt;if(!this._events[yt])this._events[yt]=xt,this._eventsCount++;else if(!this._events[yt].fn)this._events[yt].push(xt);else this._events[yt]=[this._events[yt],xt];return this},et.prototype.removeListener=function(dt,R,pt,xt){var yt=j?j+dt:dt;if(!this._events[yt])return this;if(!R){if(--this._eventsCount===0)this._events=new G;else delete this._events[yt];return this}var Wt=this._events[yt];if(Wt.fn){if(Wt.fn===R&&(!xt||Wt.once)&&(!pt||Wt.context===pt))if(--this._eventsCount===0)this._events=new G;else delete this._events[yt]}else{for(var _t=0,ht=[],Tt=Wt.length;_t<Tt;_t++)if(Wt[_t].fn!==R||xt&&!Wt[_t].once||pt&&Wt[_t].context!==pt)ht.push(Wt[_t]);if(ht.length)this._events[yt]=ht.length===1?ht[0]:ht;else if(--this._eventsCount===0)this._events=new G;else delete this._events[yt]}return this},et.prototype.removeAllListeners=function(dt){var R;if(dt){if(R=j?j+dt:dt,this._events[R])if(--this._eventsCount===0)this._events=new G;else delete this._events[R]}else this._events=new G,this._eventsCount=0;return this},et.prototype.off=et.prototype.removeListener,et.prototype.addListener=et.prototype.on,et.prototype.setMaxListeners=function(){return this},et.prefixed=j,et.EventEmitter=et,J.exports=et});function s(J,W,j){if(W in J)Object.defineProperty(J,W,{value:j,enumerable:!0,configurable:!0,writable:!0});else J[W]=j;return J}var p=function(){},d={data:"state-data",cdata:"state-cdata",tagBegin:"state-tag-begin",tagName:"state-tag-name",tagEnd:"state-tag-end",attributeNameStart:"state-attribute-name-start",attributeName:"state-attribute-name",attributeNameEnd:"state-attribute-name-end",attributeValueBegin:"state-attribute-value-begin",attributeValue:"state-attribute-value"},m={lt:"action-lt",gt:"action-gt",space:"action-space",equal:"action-equal",quote:"action-quote",slash:"action-slash",char:"action-char",error:"action-error"},u={text:"text",openTag:"open-tag",closeTag:"close-tag",attributeName:"attribute-name",attributeValue:"attribute-value"},y={" ":m.space,"\t":m.space,"\n":m.space,"\r":m.space,"<":m.lt,">":m.gt,'"':m.quote,"'":m.quote,"=":m.equal,"/":m.slash},f=function(W){return y[W]||m.char},_=function(W){var j,G,D,et,mt,dt,R,pt,xt,yt;W=Object.assign({debug:!1},W);var Wt=new l,_t=d.data,ht="",Tt="",Dt="",bt="",be="",ce="",Rt=function(Ze,ve){if(Tt[0]==="?"||Tt[0]==="!")return;var dn={type:Ze,value:ve};if(W.debug)console.log("emit:",dn);Wt.emit("data",dn)};Wt.stateMachine=(yt={},s(yt,d.data,(j={},s(j,m.lt,function(){if(ht.trim())Rt(u.text,ht);Tt="",be=!1,_t=d.tagBegin}),s(j,m.char,function(Pt){ht+=Pt}),j)),s(yt,d.cdata,s({},m.char,function(Pt){if(ht+=Pt,ht.substr(-3)==="]]>")Rt(u.text,ht.slice(0,-3)),ht="",_t=d.data})),s(yt,d.tagBegin,(G={},s(G,m.space,p),s(G,m.char,function(Pt){Tt=Pt,_t=d.tagName}),s(G,m.slash,function(){Tt="",be=!0}),G)),s(yt,d.tagName,(D={},s(D,m.space,function(){if(be)_t=d.tagEnd;else _t=d.attributeNameStart,Rt(u.openTag,Tt)}),s(D,m.gt,function(){if(be)Rt(u.closeTag,Tt);else Rt(u.openTag,Tt);ht="",_t=d.data}),s(D,m.slash,function(){_t=d.tagEnd,Rt(u.openTag,Tt)}),s(D,m.char,function(Pt){if(Tt+=Pt,Tt==="![CDATA[")_t=d.cdata,ht="",Tt=""}),D)),s(yt,d.tagEnd,(et={},s(et,m.gt,function(){Rt(u.closeTag,Tt),ht="",_t=d.data}),s(et,m.char,p),et)),s(yt,d.attributeNameStart,(mt={},s(mt,m.char,function(Pt){Dt=Pt,_t=d.attributeName}),s(mt,m.gt,function(){ht="",_t=d.data}),s(mt,m.space,p),s(mt,m.slash,function(){be=!0,_t=d.tagEnd}),mt)),s(yt,d.attributeName,(dt={},s(dt,m.space,function(){_t=d.attributeNameEnd}),s(dt,m.equal,function(){Rt(u.attributeName,Dt),_t=d.attributeValueBegin}),s(dt,m.gt,function(){bt="",Rt(u.attributeName,Dt),Rt(u.attributeValue,bt),ht="",_t=d.data}),s(dt,m.slash,function(){be=!0,bt="",Rt(u.attributeName,Dt),Rt(u.attributeValue,bt),_t=d.tagEnd}),s(dt,m.char,function(Pt){Dt+=Pt}),dt)),s(yt,d.attributeNameEnd,(R={},s(R,m.space,p),s(R,m.equal,function(){Rt(u.attributeName,Dt),_t=d.attributeValueBegin}),s(R,m.gt,function(){bt="",Rt(u.attributeName,Dt),Rt(u.attributeValue,bt),ht="",_t=d.data}),s(R,m.char,function(Pt){bt="",Rt(u.attributeName,Dt),Rt(u.attributeValue,bt),Dt=Pt,_t=d.attributeName}),R)),s(yt,d.attributeValueBegin,(pt={},s(pt,m.space,p),s(pt,m.quote,function(Pt){ce=Pt,bt="",_t=d.attributeValue}),s(pt,m.gt,function(){bt="",Rt(u.attributeValue,bt),ht="",_t=d.data}),s(pt,m.char,function(Pt){ce="",bt=Pt,_t=d.attributeValue}),pt)),s(yt,d.attributeValue,(xt={},s(xt,m.space,function(Pt){if(ce)bt+=Pt;else Rt(u.attributeValue,bt),_t=d.attributeNameStart}),s(xt,m.quote,function(Pt){if(ce===Pt)Rt(u.attributeValue,bt),_t=d.attributeNameStart;else bt+=Pt}),s(xt,m.gt,function(Pt){if(ce)bt+=Pt;else Rt(u.attributeValue,bt),ht="",_t=d.data}),s(xt,m.slash,function(Pt){if(ce)bt+=Pt;else Rt(u.attributeValue,bt),be=!0,_t=d.tagEnd}),s(xt,m.char,function(Pt){bt+=Pt}),xt)),yt);var L1=function(Ze){if(W.debug)console.log(_t,Ze);var ve=Wt.stateMachine[_t],dn=ve[f(Ze)]||ve[m.error]||ve[m.char];dn(Ze)};return Wt.write=function(Pt){var Ze=Pt.length;for(var ve=0;ve<Ze;ve++)L1(Pt[ve])},Wt},x={State:d,Action:m,Type:u,create:_},Y=x.Type,b={element:"element",text:"text"},M=function(W){return Object.assign({name:"",type:b.element,value:"",parent:null,attributes:{},children:[]},W)},O=function(W){W=Object.assign({stream:!1,parentNodes:!0,doneEvent:"done",tagPrefix:"tag:",emitTopLevelOnly:!1,debug:!1},W);var j=void 0,G=void 0,D=void 0,et=void 0,mt=new l,dt=function(pt){switch(pt.type){case Y.openTag:if(D===null)D=G,D.name=pt.value;else{var xt=M({name:pt.value,parent:D});D.children.push(xt),D=xt}break;case Y.closeTag:var yt=D.parent;if(!W.parentNodes)D.parent=null;if(D.name!==pt.value)break;if(W.stream&&yt===G)G.children=[],D.parent=null;if(!W.emitTopLevelOnly||yt===G)mt.emit(W.tagPrefix+D.name,D),mt.emit("tag",D.name,D);if(D===G)j.removeAllListeners("data"),mt.emit(W.doneEvent,D),G=null;D=yt;break;case Y.text:if(D)D.children.push(M({type:b.text,value:pt.value,parent:W.parentNodes?D:null}));break;case Y.attributeName:et=pt.value,D.attributes[et]="";break;case Y.attributeValue:D.attributes[et]=pt.value;break}};return mt.reset=function(){j=x.create({debug:W.debug}),j.on("data",dt),G=M(),D=null,et="",mt.parse=j.write},mt.reset(),mt},X=function(W,j){j=Object.assign({},j,{stream:!1,tagPrefix:":"});var G=O(j),D=void 0;return G.on("done",function(et){D=et}),G.parse(W),D},E={parseSync:X,create:O,NodeType:b},I=E.parseSync,U=function(W){var j=I("<root>".concat(W,"</root>"),{parentNodes:!1}),G=j.children&&j.children.length>0&&j.children.every(function(D){return D.name==="svg"});if(G)return j.children.length===1?j.children[0]:j.children;else throw Error("nothing to parse")},q=function(W){return c(W,function(j){if(!H(j))return st(j);return j})},st=function(W){return W.replace(/[-|:]([a-z])/gi,function(j,G){return G.toUpperCase()})},H=function(W){return/^(data|aria)(-\w+)/.test(W)},k=function(W){if(W){var j=String(W);return/[&<>]/.test(j)?"<![CDATA[".concat(j.replace(/]]>/,"]]]]><![CDATA[>"),"]]>"):j}return""},at=function(W){return String(W).replace(/&/g,"&").replace(/'/g,"'").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")},ot=function(W){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=j.transformNode,D=G===void 0?function(R){return R}:G,et=j.camelcase,mt=et===void 0?!1:et,dt=function(pt){var xt=D(pt);if(mt)xt=q(xt);return xt};return dt(U(W))};function Z(){for(var J=arguments.length,W=Array(J),j=0;j<J;j++)W[j]=arguments[j];return new Promise(function(G,D){try{var et=ot.apply(void 0,W);G(et)}catch(mt){D(mt)}})}var N=function J(W){var j=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},G=j.transformAttr,D=G===void 0?function(_t,ht,Tt){return"".concat(_t,'="').concat(Tt(ht),'"')}:G,et=j.transformNode,mt=et===void 0?function(_t){return _t}:et,dt=j.selfClose,R=dt===void 0?!0:dt;if(Array.isArray(W))return W.map(function(_t){return J(_t,{transformAttr:D,selfClose:R,transformNode:mt})}).join("");var pt=mt(W);if(pt.type==="text")return k(pt.value);var xt="";for(var yt in pt.attributes){var Wt=D(yt,pt.attributes[yt],at,pt.name);xt+=Wt?" ".concat(Wt):""}return pt.children&&pt.children.length>0||!R?"<".concat(pt.name).concat(xt,">").concat(J(pt.children,{transformAttr:D,transformNode:mt,selfClose:R}),"</").concat(pt.name,">"):"<".concat(pt.name).concat(xt,"/>")},tt=Object.assign({},{parse:Z,parseSync:ot,stringify:N});return tt})});var M0=mn(function(eV,I0){var Hr=1000,Qr=Hr*60,Zr=Qr*60,hr=Zr*24,q9=hr*7,t4=hr*365.25;I0.exports=function(t,e){e=e||{};var r=typeof t;if(r==="string"&&t.length>0)return e4(t);else if(r==="number"&&isFinite(t))return e.long?i4(t):r4(t);throw Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function e4(t){if(t=String(t),t.length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var r=parseFloat(e[1]),i=(e[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return r*t4;case"weeks":case"week":case"w":return r*q9;case"days":case"day":case"d":return r*hr;case"hours":case"hour":case"hrs":case"hr":case"h":return r*Zr;case"minutes":case"minute":case"mins":case"min":case"m":return r*Qr;case"seconds":case"second":case"secs":case"sec":case"s":return r*Hr;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}function r4(t){var e=Math.abs(t);if(e>=hr)return Math.round(t/hr)+"d";if(e>=Zr)return Math.round(t/Zr)+"h";if(e>=Qr)return Math.round(t/Qr)+"m";if(e>=Hr)return Math.round(t/Hr)+"s";return t+"ms"}function i4(t){var e=Math.abs(t);if(e>=hr)return Un(t,e,hr,"day");if(e>=Zr)return Un(t,e,Zr,"hour");if(e>=Qr)return Un(t,e,Qr,"minute");if(e>=Hr)return Un(t,e,Hr,"second");return t+" ms"}function Un(t,e,r,i){var n=e>=r*1.5;return Math.round(t/r)+" "+i+(n?"s":"")}});var C0=mn(function(rV,k0){function n4(t){r.debug=r,r.default=r,r.coerce=l,r.disable=o,r.enable=n,r.enabled=c,r.humanize=M0(),r.destroy=s,Object.keys(t).forEach((p)=>{r[p]=t[p]}),r.names=[],r.skips=[],r.formatters={};function e(p){let d=0;for(let m=0;m<p.length;m++)d=(d<<5)-d+p.charCodeAt(m),d|=0;return r.colors[Math.abs(d)%r.colors.length]}r.selectColor=e;function r(p){let d,m=null,u,y;function f(..._){if(!f.enabled)return;let x=f,Y=Number(new Date),b=Y-(d||Y);if(x.diff=b,x.prev=d,x.curr=Y,d=Y,_[0]=r.coerce(_[0]),typeof _[0]!=="string")_.unshift("%O");let M=0;_[0]=_[0].replace(/%([a-zA-Z%])/g,(X,E)=>{if(X==="%%")return"%";M++;let I=r.formatters[E];if(typeof I==="function"){let U=_[M];X=I.call(x,U),_.splice(M,1),M--}return X}),r.formatArgs.call(x,_),(x.log||r.log).apply(x,_)}if(f.namespace=p,f.useColors=r.useColors(),f.color=r.selectColor(p),f.extend=i,f.destroy=r.destroy,Object.defineProperty(f,"enabled",{enumerable:!0,configurable:!1,get:()=>{if(m!==null)return m;if(u!==r.namespaces)u=r.namespaces,y=r.enabled(p);return y},set:(_)=>{m=_}}),typeof r.init==="function")r.init(f);return f}function i(p,d){let m=r(this.namespace+(typeof d>"u"?":":d)+p);return m.log=this.log,m}function n(p){r.save(p),r.namespaces=p,r.names=[],r.skips=[];let d=(typeof p==="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let m of d)if(m[0]==="-")r.skips.push(m.slice(1));else r.names.push(m)}function a(p,d){let m=0,u=0,y=-1,f=0;while(m<p.length)if(u<d.length&&(d[u]===p[m]||d[u]==="*"))if(d[u]==="*")y=u,f=m,u++;else m++,u++;else if(y!==-1)u=y+1,f++,m=f;else return!1;while(u<d.length&&d[u]==="*")u++;return u===d.length}function o(){let p=[...r.names,...r.skips.map((d)=>"-"+d)].join(",");return r.enable(""),p}function c(p){for(let d of r.skips)if(a(p,d))return!1;for(let d of r.names)if(a(p,d))return!0;return!1}function l(p){if(p instanceof Error)return p.stack||p.message;return p}function s(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return r.enable(r.load()),r}k0.exports=n4});var Y0=mn(function(Vc,Gn){Vc.formatArgs=a4;Vc.save=s4;Vc.load=c4;Vc.useColors=o4;Vc.storage=l4();Vc.destroy=(()=>{let t=!1;return()=>{if(!t)t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}})();Vc.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function o4(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a4(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+Gn.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let r=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(n)=>{if(n==="%%")return;if(r++,n==="%c")i=r}),t.splice(i,0,e)}Vc.log=console.debug||console.log||(()=>{});function s4(t){try{if(t)Vc.storage.setItem("debug",t);else Vc.storage.removeItem("debug")}catch(e){}}function c4(){let t;try{t=Vc.storage.getItem("debug")||Vc.storage.getItem("DEBUG")}catch(e){}if(!t&&typeof process<"u"&&"env"in process)t=process.env.DEBUG;return t}function l4(){try{return localStorage}catch(t){}}Gn.exports=C0()(Vc);var{formatters:p4}=Gn.exports;p4.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var pm={"0":"M0.301025 0.257813 L0.206593 0.283385 L0.122042 0.361307 L0.075923 0.474441 L0.064942 0.642221 L0.091296 0.78289 L0.159376 0.899463 L0.257104 0.961214 L0.344948 0.961214 L0.442678 0.899463 L0.510757 0.78289 L0.537111 0.642221 L0.526131 0.474441 L0.480012 0.361307 L0.39546 0.283385 L0.301025 0.257813","1":"M0.220426 0.40845 L0.381626 0.270996 L0.381626 0.948966","2":"M0.110409 0.39212 L0.125621 0.342293 L0.170571 0.295823 L0.244237 0.26431 L0.291518 0.257813 L0.373319 0.263799 L0.434683 0.290705 L0.468239 0.331966 L0.480292 0.379913 L0.479492 0.411806 L0.465088 0.465192 L0.402571 0.568988 L0.245134 0.766438 L0.07959 0.948045 L0.522462 0.948045","3":"M0.081606 0.345073 L0.119154 0.315633 L0.178996 0.284091 L0.255265 0.257813 L0.349133 0.263062 L0.43127 0.289348 L0.48994 0.336662 L0.525141 0.394491 L0.513407 0.457577 L0.466472 0.504892 L0.384334 0.541692 L0.290464 0.56272 L0.20833 0.573235 L0.290464 0.583749 L0.384334 0.610035 L0.466472 0.652092 L0.519274 0.709922 L0.531007 0.773007 L0.50754 0.841351 L0.454738 0.899179 L0.3726 0.946494 L0.310412 0.961214 L0.209503 0.959111 L0.127367 0.946494 L0.071046 0.929671","4":"M0.418494 0.270996 L0.048828 0.724199 L0.553224 0.724199 M0.414181 0.578167 L0.414181 0.94897","5":"M0.074951 0.270996 L0.074951 0.614701 L0.267655 0.5695 L0.405247 0.586502 L0.460002 0.617189 L0.498028 0.660731 L0.527101 0.779401 L0.513352 0.841049 L0.477274 0.889568 L0.406378 0.93463 L0.324445 0.958337 L0.247399 0.962139 L0.182516 0.949767 L0.130068 0.925508 L0.074951 0.875607 M0.074951 0.270996 L0.527101 0.270996","6":"M0.428549 0.257813 L0.341433 0.285053 L0.26073 0.312099 L0.192188 0.360182 L0.138902 0.410969 L0.098219 0.500422 L0.070249 0.584267 L0.067264 0.670716 L0.065164 0.756863 L0.087163 0.820973 L0.108168 0.861042 L0.157916 0.913131 L0.210981 0.948192 L0.29279 0.961214 L0.384548 0.956206 L0.456409 0.924151 L0.507262 0.881077 L0.5349 0.821975 L0.537111 0.771889 L0.521634 0.718798 L0.498418 0.67372 L0.463042 0.636657 L0.414398 0.613617 L0.34696 0.598591 L0.28284 0.595587 L0.215403 0.605604 L0.145756 0.641665 L0.109274 0.678729 L0.064942 0.724006","7":"M0.071534 0.270996 L0.530519 0.270996 L0.495935 0.291702 L0.477752 0.305407 L0.435186 0.346112 L0.412067 0.374136 L0.388565 0.40796 L0.365315 0.448098 L0.342943 0.495062 L0.322081 0.549366 L0.303364 0.611524 L0.287416 0.68205 L0.270077 0.80465 L0.26253 0.94897","8":"M0.286761 0.257813 L0.210684 0.27162 L0.1414 0.305622 L0.092494 0.382125 L0.111513 0.450128 L0.16857 0.502193 L0.228345 0.539382 L0.377781 0.594635 L0.470161 0.645637 L0.52586 0.706203 L0.538087 0.792269 L0.506841 0.87621 L0.438915 0.927212 L0.339743 0.961214 L0.263666 0.959089 L0.174004 0.929337 L0.102003 0.881523 L0.063965 0.811395 L0.066682 0.741266 L0.102003 0.671139 L0.180797 0.608448 L0.259591 0.580822 L0.358762 0.548945 L0.456576 0.49688 L0.486463 0.446941 L0.487822 0.362999 L0.453859 0.302434 L0.384574 0.265245 L0.286761 0.257813","9":"M0.511026 0.437812 L0.491026 0.347812 L0.451026 0.297812 L0.391026 0.267812 L0.311026 0.257813 L0.231026 0.267812 L0.161026 0.297812 L0.111026 0.347812 L0.091026 0.417812 L0.111026 0.487812 L0.161026 0.537812 L0.231026 0.567812 L0.311026 0.577812 L0.391026 0.557812 L0.451026 0.517812 L0.491026 0.477812 L0.511026 0.437812 M0.510026 0.438812 L0.434026 0.636812 L0.381026 0.777812 L0.337026 0.879812 L0.301026 0.957812","!":"M0.301026 0.270996 L0.301026 0.749566 M0.251466 0.94897 L0.350587 0.94897",'"':"M0.16504 0.270996 L0.16504 0.523022 M0.437013 0.270996 L0.437013 0.523022","#":"M0.20958 0.282227 L0.146515 0.949754 M0.461844 0.282227 L0.398779 0.949754 M0.032999 0.526969 L0.600587 0.452796 M0.001465 0.82366 L0.569055 0.749486",$:"M0.307121 0.240234 L0.307121 1.083502 M0.490031 0.415915 L0.404676 0.328075 L0.23396 0.310507 L0.136407 0.398347 L0.099828 0.521324 L0.124213 0.591596 L0.197379 0.644299 L0.429061 0.697003 L0.502224 0.749708 L0.526613 0.837547 L0.477836 0.960526 L0.355897 1.013228 L0.197379 0.99566 L0.112021 0.942957 L0.07544 0.837547","'":"M0.301026 0.270996 L0.301026 0.523022","(":"M0.413087 0.241211 L0.372337 0.28347 L0.331589 0.334184 L0.290838 0.393349 L0.25009 0.460965 L0.219528 0.528584 L0.199153 0.5962 L0.188966 0.655364 L0.199153 0.714529 L0.219528 0.782146 L0.25009 0.849764 L0.290838 0.91738 L0.331589 0.976544 L0.372337 1.027258 L0.413087 1.069491",")":"M0.188966 0.241211 L0.229716 0.28347 L0.270466 0.334184 L0.311213 0.393349 L0.351964 0.460965 L0.382526 0.528584 L0.4029 0.5962 L0.413087 0.655364 L0.4029 0.714529 L0.382526 0.782146 L0.351964 0.849764 L0.311213 0.91738 L0.270466 0.976544 L0.229716 1.027258 L0.188966 1.069491","*":"M0.301026 0.458702 L0.301026 0.681942 M0.301026 0.458702 L0.520997 0.536834 M0.301026 0.458702 L0.439954 0.257813 M0.301026 0.458702 L0.162098 0.257813 M0.301026 0.458702 L0.081055 0.536834","+":"M0.042969 0.66845 L0.559083 0.66845 M0.301023 0.428223 L0.301023 0.908661",",":"M0.38672 0.852051 L0.215333 1.030661 L0.301025 1.119971","-":"M0.173829 0.686035 L0.428224 0.686035",".":"M0.362549 0.851074 L0.239503 0.851074","/":"M0.062501 1.035249 L0.539551 0.270996","<":"M0.559083 0.441895 L0.042969 0.66939 L0.042969 0.66939 L0.559083 0.896902","=":"M0.042969 0.545898 L0.559083 0.545898 M0.042969 0.80837 L0.559083 0.80837",">":"M0.042969 0.441895 L0.559083 0.66939 L0.559083 0.66939 L0.042969 0.896902",A:"M0.018067 0.94897 L0.290179 0.270996 L0.583986 0.94897 M0.155303 0.684521 L0.433548 0.684521",B:"M0.063965 0.94897 L0.063965 0.278953 L0.209356 0.270996 L0.342486 0.294394 L0.432179 0.37292 L0.418224 0.48773 L0.312686 0.549166 L0.084728 0.575531 L0.306377 0.589434 L0.468877 0.647456 L0.538087 0.736658 L0.5324 0.85202 L0.501247 0.902983 L0.42355 0.944398 L0.063965 0.94897",C:"M0.529054 0.419847 L0.498425 0.345196 L0.442238 0.292341 L0.33583 0.257813 L0.257199 0.268357 L0.187906 0.303748 L0.120243 0.385432 L0.072998 0.599844 L0.110073 0.815385 L0.165381 0.902183 L0.222883 0.942801 L0.334904 0.961214 L0.43253 0.937679 L0.504816 0.868999 L0.529054 0.772065",D:"M0.064454 0.94897 L0.071838 0.285078 L0.171217 0.270996 L0.247348 0.272633 L0.37101 0.306078 L0.462461 0.378304 L0.514748 0.475555 L0.535591 0.576392 L0.537599 0.652313 L0.528065 0.717381 L0.508562 0.772419 L0.445948 0.855695 L0.362356 0.90871 L0.225203 0.945862 L0.064454 0.94897",E:"M0.080078 0.270996 L0.080078 0.94897 M0.080078 0.270996 L0.521974 0.270996 M0.080078 0.609981 L0.389405 0.609981 M0.080078 0.94897 L0.521974 0.94897",F:"M0.086426 0.270996 L0.086426 0.94897 M0.091304 0.275607 L0.515626 0.275607 M0.091304 0.607677 L0.447344 0.607677",G:"M0.498034 0.284943 L0.374621 0.257813 L0.244219 0.268648 L0.160577 0.311997 L0.094556 0.398116 L0.056397 0.58404 L0.076752 0.785532 L0.120865 0.858197 L0.188947 0.916734 L0.271008 0.953591 L0.357069 0.961214 L0.43715 0.932047 L0.501262 0.858539 L0.545656 0.648611 L0.329595 0.648131",H:"M0.066895 0.270996 L0.066895 0.94897 M0.066895 0.595658 L0.530009 0.595658 M0.535157 0.270996 L0.535157 0.94897",I:"M0.301026 0.270996 L0.301026 0.94897",J:"M0.506839 0.270996 L0.507814 0.782193 L0.498468 0.846168 L0.480733 0.880789 L0.455864 0.90832 L0.426095 0.929408 L0.360746 0.954812 L0.302508 0.962139 L0.223573 0.953638 L0.16538 0.930312 L0.137072 0.907715 L0.116428 0.880312 L0.102822 0.848819 L0.095633 0.813947 L0.094239 0.776413",K:"M0.035401 0.270996 L0.035401 0.94897 M0.502258 0.316194 L0.035401 0.687823 M0.212484 0.582361 L0.566652 0.933903",L:"M0.07544 0.270996 L0.07544 0.94897 L0.526613 0.94897",M:"M0.042481 0.94897 L0.042481 0.270996 L0.301027 0.712492 L0.559571 0.270996 L0.559571 0.94897",N:"M0.067871 0.94897 L0.067871 0.270996 L0.534181 0.94897 L0.525031 0.270996",O:"M0.287293 0.961214 L0.19843 0.933567 L0.1172 0.849451 L0.057129 0.563945 L0.114348 0.350255 L0.18455 0.289392 L0.306101 0.257813 L0.42054 0.29572 L0.487543 0.365003 L0.544923 0.625294 L0.516366 0.789624 L0.465476 0.884596 L0.375084 0.949287 L0.287293 0.961214",P:"M0.070557 0.94897 L0.070557 0.28379 L0.20704 0.270996 L0.329134 0.278993 L0.408525 0.300514 L0.444022 0.317908 L0.500637 0.368929 L0.525796 0.423728 L0.531496 0.50384 L0.508934 0.554205 L0.473724 0.582043 L0.417577 0.604365 L0.336375 0.620372 L0.226014 0.629268 L0.082368 0.630258",Q:"M0.282435 1.050813 L0.195447 1.019646 L0.115933 0.924817 L0.057129 0.602943 L0.113139 0.362034 L0.18186 0.293418 L0.300844 0.257813 L0.412868 0.300553 L0.478457 0.37866 L0.534625 0.672103 L0.506671 0.857367 L0.456855 0.964437 L0.368371 1.037368 L0.282435 1.050813 M0.341225 0.815559 L0.544923 1.070653",R:"M0.034912 0.944112 L0.034912 0.288556 L0.227127 0.270996 L0.362038 0.276867 L0.443423 0.294907 L0.477644 0.309614 L0.505809 0.328757 L0.526616 0.352817 L0.544963 0.418061 L0.543241 0.475921 L0.524463 0.517817 L0.49076 0.546518 L0.444265 0.564799 L0.355195 0.578739 L0.047653 0.589627 M0.303054 0.617306 L0.56714 0.94897",S:"M0.483037 0.364333 L0.407613 0.267477 L0.22883 0.257813 L0.128623 0.327565 L0.087712 0.455539 L0.104656 0.518727 L0.168054 0.573307 L0.41928 0.617318 L0.503796 0.669342 L0.535157 0.759324 L0.493846 0.900055 L0.367668 0.961214 L0.205436 0.956661 L0.116711 0.907038 L0.066895 0.790334",T:"M0.022949 0.270996 L0.579103 0.270996 M0.309284 0.270996 L0.309284 0.94897",U:"M0.072022 0.270996 L0.07308 0.648875 L0.080372 0.75167 L0.099024 0.827813 L0.134786 0.885729 L0.181571 0.924023 L0.251464 0.95168 L0.339655 0.962139 L0.401553 0.951668 L0.45232 0.924086 L0.482701 0.891771 L0.495745 0.870529 L0.515699 0.81637 L0.525014 0.744626 L0.530031 0.272017",V:"M0.027832 0.270996 L0.320083 0.94897 L0.57422 0.270996",W:"M0 0.270996 L0.079799 0.940377 L0.285198 0.472884 L0.505255 0.94897 L0.602052 0.270996",X:"M0.009034 0.270996 L0.586805 0.94897 M0.593019 0.270996 L0.015246 0.94897",Y:"M0.018067 0.270996 L0.293132 0.574135 M0.583986 0.271959 L0.294954 0.57606 L0.305277 0.94897",Z:"M0.053711 0.270996 L0.548341 0.270996 L0.053711 0.94897 L0.548341 0.94897","[":"M0.404542 0.240234 L0.197511 0.240234 L0.197511 1.069424 L0.404542 1.069424","\\":"M0.062501 0.270996 L0.539551 1.035249","]":"M0.19751 0.240234 L0.404542 0.240234 L0.404542 1.069424 L0.19751 1.069424","^":"M0.035156 0.523931 L0.301024 0.270996 L0.566896 0.523931",_:"M0 1.160601 L0.602052 1.160601",a:"M0.527101 0.439941 L0.527101 0.973965 M0.527101 0.553824 L0.451366 0.477535 L0.376759 0.439941 L0.263722 0.439941 L0.187989 0.477535 L0.112255 0.553824 L0.074951 0.66881 L0.074951 0.745099 L0.112255 0.85898 L0.187989 0.93527 L0.263722 0.973965 L0.376759 0.973965 L0.451366 0.93527 L0.527101 0.85898",b:"M0.07666 0.240234 L0.07666 0.959985 M0.07666 0.582737 L0.151822 0.514237 L0.225865 0.480483 L0.338045 0.480483 L0.413211 0.514237 L0.488374 0.582737 L0.525392 0.685983 L0.525392 0.754485 L0.488374 0.856739 L0.413211 0.92524 L0.338045 0.959985 L0.225865 0.959985 L0.151822 0.92524 L0.07666 0.856739",c:"M0.512452 0.553823 L0.441624 0.477535 L0.371854 0.439941 L0.26614 0.439941 L0.195312 0.477535 L0.124486 0.553823 L0.0896 0.668808 L0.0896 0.745099 L0.124486 0.858979 L0.195312 0.93527 L0.26614 0.973965 L0.371854 0.973965 L0.441624 0.93527 L0.512452 0.858979",d:"M0.525392 0.240234 L0.525392 0.959985 M0.525392 0.582737 L0.450232 0.514237 L0.376189 0.480483 L0.264006 0.480483 L0.188844 0.514237 L0.11368 0.582737 L0.076661 0.685983 L0.076661 0.754485 L0.11368 0.856739 L0.188844 0.92524 L0.264006 0.959985 L0.376189 0.959985 L0.450232 0.92524 L0.525392 0.856739",e:"M0.059571 0.668808 L0.542482 0.668808 M0.542482 0.592521 L0.502641 0.516231 L0.461594 0.477535 L0.381914 0.439941 L0.261186 0.439941 L0.180299 0.477535 L0.099412 0.553823 L0.059571 0.668808 L0.059571 0.745099 L0.099412 0.858979 L0.180299 0.93527 L0.261186 0.973965 L0.381914 0.973965 L0.461594 0.93527 L0.542482 0.858979",f:"M0.512941 0.240234 L0.406984 0.240234 L0.301026 0.274346 L0.248047 0.374731 L0.248047 0.946817 M0.089112 0.476088 L0.459965 0.476088",g:"M0.525392 0.439941 L0.525392 0.989395 L0.488373 1.091918 L0.45023 1.126757 L0.376189 1.160601 L0.264004 1.160601 L0.188844 1.126757 L0.113681 1.058075 L0.076661 0.954555 M0.525392 0.542467 L0.45023 0.473786 L0.376189 0.439941 L0.264004 0.439941 L0.188844 0.473786 L0.113681 0.542467 L0.076661 0.645988 L0.076661 0.714669 L0.113681 0.817193 L0.188844 0.885875 L0.264004 0.920713 L0.376189 0.920713 L0.45023 0.885875 L0.525392 0.817193",h:"M0.092041 0.240234 L0.092041 0.946817 M0.092041 0.61058 L0.205937 0.509225 L0.282214 0.476086 L0.396109 0.476086 L0.47187 0.509225 L0.510011 0.61058 L0.510011 0.946817",i:"M0.261026 0.240234 L0.341026 0.240234 M0.300978 0.476089 L0.300978 0.946817",j:"M0.3853 0.240234 L0.447023 0.240234 M0.416159 0.465708 L0.416159 1.011689 L0.383887 1.108586 L0.252832 1.140264 L0.15503 1.108586",k:"M0.065186 0.240234 L0.065186 0.946817 M0.493824 0.476086 L0.065186 0.812323 M0.236758 0.677829 L0.536867 0.946817",l:"M0.301026 0.234863 L0.301026 0.946441",m:"M0.050538 0.439941 L0.050538 0.960796 M0.050538 0.588758 L0.114405 0.476607 L0.157178 0.439941 L0.236864 0.439941 L0.279637 0.476607 L0.32241 0.588758 L0.32241 0.960796 M0.32241 0.588758 L0.386281 0.476607 L0.428467 0.439941 L0.50874 0.439941 L0.551515 0.476607 L0.551515 0.960796",n:"M0.092041 0.439941 L0.092041 0.960796 M0.092041 0.588758 L0.205936 0.476607 L0.282216 0.439941 L0.396113 0.439941 L0.471871 0.476607 L0.510011 0.588758 L0.510011 0.960796",o:"M0.247175 0.439941 L0.175178 0.477535 L0.103186 0.553823 L0.066895 0.668808 L0.066895 0.745099 L0.103186 0.858979 L0.175178 0.93527 L0.247175 0.973965 L0.354874 0.973965 L0.426872 0.93527 L0.498866 0.858979 L0.535157 0.745099 L0.535157 0.668808 L0.498866 0.553823 L0.426872 0.477535 L0.354874 0.439941 L0.247175 0.439941",p:"M0.076904 0.439941 L0.076904 1.154244 M0.076904 0.541563 L0.151986 0.473487 L0.225944 0.439941 L0.338005 0.439941 L0.413087 0.473487 L0.488166 0.541563 L0.525148 0.644169 L0.525148 0.712246 L0.488166 0.813866 L0.413087 0.881942 L0.338005 0.916471 L0.225944 0.916471 L0.151986 0.881942 L0.076904 0.813866",q:"M0.525148 0.441895 L0.525148 1.156195 M0.525148 0.5435 L0.450067 0.47544 L0.376106 0.441895 L0.264042 0.441895 L0.188966 0.47544 L0.113885 0.5435 L0.076905 0.646108 L0.076905 0.714187 L0.113885 0.815809 L0.188966 0.883886 L0.264042 0.918418 L0.376106 0.918418 L0.450067 0.883886 L0.525148 0.815809",r:"M0.107422 0.439941 L0.107422 0.960796 M0.107422 0.663164 L0.155824 0.551014 L0.252626 0.476607 L0.349428 0.439941 L0.49463 0.439941",s:"M0.475556 0.477535 L0.400757 0.439941 L0.276092 0.439941 L0.176361 0.477535 L0.101563 0.553823 L0.101563 0.630112 L0.176361 0.668808 L0.301024 0.668808 L0.425688 0.745099 L0.50049 0.821387 L0.50049 0.897677 L0.425688 0.93527 L0.325956 0.973965 L0.201295 0.973965 L0.126496 0.93527 L0.101563 0.858979",t:"M0.246032 0.297852 L0.246032 0.826549 L0.301023 0.919323 L0.411011 0.950848 L0.520997 0.950848 M0.081055 0.515799 L0.466004 0.515799",u:"M0.092041 0.454102 L0.092041 0.826134 L0.13018 0.937211 L0.205936 0.974954 L0.319832 0.974954 L0.396113 0.937211 L0.510011 0.826134 M0.510011 0.454102 L0.510011 0.974954",v:"M0.048828 0.453125 L0.301026 0.961719 M0.553224 0.453125 L0.301026 0.961719",w:"M0 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.150512 0.961719 M0.301024 0.453125 L0.451539 0.961719 M0.602052 0.453125 L0.451539 0.961719",x:"M0.03711 0.453125 L0.564943 0.961719 M0.564943 0.453125 L0.03711 0.961719",y:"M0.084618 0.453125 L0.320232 0.921476 M0.55713 0.453125 L0.320232 0.921476 L0.242119 1.055289 L0.163369 1.122196 L0.084618 1.155166 L0.044922 1.155166",z:"M0.505373 0.452148 L0.09668 0.961651 M0.09668 0.452148 L0.505373 0.452148 M0.09668 0.961651 L0.505373 0.961651"},gi={};for(let t in pm){gi[t]=[];let e=pm[t].split("M").slice(1).map((r)=>r.split("L").map((i)=>i.trim().split(" ").map(parseFloat)));for(let r of e)for(let i=0;i<r.length-1;i++)gi[t].push({x1:r[i][0],y1:1-r[i][1],x2:r[i+1][0],y2:1-r[i+1][1]})}var VI=(()=>{let t=new Uint8Array(4),e=new Uint32Array(t.buffer);return!((e[0]=1)&t[0])})(),zI={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};var V1=[];for(let t=0;t<256;t++){let e=t;for(let r=0;r<8;r++)if(e&1)e=3988292384^e>>>1;else e=e>>>1;V1[t]=e}var Q1=new Uint16Array([255]),Z1=new Uint8Array(Q1.buffer),JI=Z1[0]===255;var K1=new Uint16Array([255]),J1=new Uint8Array(K1.buffer),eM=J1[0]===255,rM=new Uint8Array(0);var nM=Uint8Array.of(137,80,78,71,13,10,26,10);var sM=new TextDecoder("latin1");var{cos:hk,sin:dk,PI:mk}=Math;var{tan:bk}=Math;var h2=te(ee(),1);var yn=(t,e)=>({...t,rects:[...t.rects??[],...e.rects??[]],points:[...t.points??[],...e.points??[]],lines:[...t.lines??[],...e.lines??[]],infiniteLines:[...t.infiniteLines??[],...e.infiniteLines??[]],polygons:[...t.polygons??[],...e.polygons??[]],circles:[...t.circles??[],...e.circles??[]],arrows:[...t.arrows??[],...e.arrows??[]],texts:[...t.texts??[],...e.texts??[]]});function vi(t,e){if(t.points)for(let r of t.points)r.step=e;if(t.lines)for(let r of t.lines)r.step=e;if(t.infiniteLines)for(let r of t.infiniteLines)r.step=e;if(t.polygons)for(let r of t.polygons)r.step=e;if(t.rects)for(let r of t.rects)r.step=e;if(t.circles)for(let r of t.circles)r.step=e;if(t.texts)for(let r of t.texts)r.step=e;return t}var ct=class{MAX_ITERATIONS=1e5;solved=!1;failed=!1;iterations=0;progress=0;error=null;activeSubSolver;failedSubSolvers;timeToSolve;stats={};_setupDone=!1;getSolverName(){return this.constructor.name}setup(){if(this._setupDone)return;this._setup(),this._setupDone=!0}_setup(){}step(){if(!this._setupDone)this.setup();if(this.solved)return;if(this.failed)return;this.iterations++;try{this._step()}catch(t){throw this.error=`${this.getSolverName()} error: ${t}`,this.failed=!0,t}if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.tryFinalAcceptance();if(!this.solved&&this.iterations>=this.MAX_ITERATIONS)this.error=`${this.getSolverName()} ran out of iterations`,this.failed=!0;if("computeProgress"in this)this.progress=this.computeProgress()}_step(){}getConstructorParams(){throw Error("getConstructorParams not implemented")}getOutput(){return null}solve(){let t=Date.now();while(!this.solved&&!this.failed)this.step();let e=Date.now();this.timeToSolve=e-t}visualize(){return{lines:[],points:[],rects:[],circles:[]}}tryFinalAcceptance(){}preview(){return{lines:[],points:[],rects:[],circles:[]}}};function Ct(t,e,r,i={}){return{solverName:t,solverClass:e,getConstructorParams:r,onSolved:i.onSolved}}var xm=class extends ct{startTimeOfStage={};endTimeOfStage={};timeSpentOnStage={};firstIterationOfStage={};currentPipelineStageIndex=0;inputProblem;pipelineOutputs={};constructor(t){super();this.inputProblem=t,this.MAX_ITERATIONS=1e6}_step(){let t=this.pipelineDef[this.currentPipelineStageIndex];if(!t){this.solved=!0;return}if(this.activeSubSolver){if(this.activeSubSolver.step(),this.activeSubSolver.solved){this.endTimeOfStage[t.solverName]=performance.now(),this.timeSpentOnStage[t.solverName]=this.endTimeOfStage[t.solverName]-this.startTimeOfStage[t.solverName];let r=this.activeSubSolver.getOutput();if(r!==null)this.pipelineOutputs[t.solverName]=r;t.onSolved?.(this),this.activeSubSolver=null,this.currentPipelineStageIndex++}else if(this.activeSubSolver.failed)this.error=this.activeSubSolver?.error,this.failed=!0,this.activeSubSolver=null;return}let e=t.getConstructorParams(this);this.activeSubSolver=new t.solverClass(...e),this[t.solverName]=this.activeSubSolver,this.timeSpentOnStage[t.solverName]=0,this.startTimeOfStage[t.solverName]=performance.now(),this.firstIterationOfStage[t.solverName]=this.iterations}solveUntilStage(t){while(this.getCurrentStageName().toLowerCase()!==t.toLowerCase())if(this.step(),this.failed||this.solved)break}getCurrentStageName(){return this.pipelineDef[this.currentPipelineStageIndex]?.solverName??"none"}getStageProgress(){let t=this.pipelineDef.length;if(t===0)return 1;let e=this.activeSubSolver?.progress??0;return(this.currentPipelineStageIndex+e)/t}getStageStats(){let t={};for(let e of this.pipelineDef){let r=this.timeSpentOnStage[e.solverName]||0,i=this.firstIterationOfStage[e.solverName]||0,n=this.iterations,a=e.solverName===this.getCurrentStageName()?n-i:0,o=this.currentPipelineStageIndex>this.pipelineDef.findIndex((c)=>c.solverName===e.solverName);t[e.solverName]={timeSpent:r,iterations:a,completed:o}}return t}initialVisualize(){return null}finalVisualize(){return null}visualize(){if(!this.solved&&this.activeSubSolver)return this.activeSubSolver.visualize();let t=0,e=this.initialVisualize();if(e)vi(e,0),t=1;let r=null;if(this.solved)r=this.finalVisualize();let i=[e].filter(Boolean).concat(this.pipelineDef.map((n,a)=>{let c=this[n.solverName]?.visualize();if(!c)return null;return vi(c,a+t),c}).filter(Boolean));if(i.length===0)return{points:[],rects:[],lines:[],circles:[],texts:[]};if(this.solved&&r)vi(r,i.length+t+1),i.push(r);if(i.length===1)return i[0];return{points:i.flatMap((n)=>n.points||[]),rects:i.flatMap((n)=>n.rects||[]),lines:i.flatMap((n)=>n.lines||[]),circles:i.flatMap((n)=>n.circles||[]),texts:i.flatMap((n)=>n.texts||[])}}preview(){if(this.activeSubSolver)return this.activeSubSolver.preview();return super.preview()}computeProgress(){return this.getStageProgress()}getStageOutput(t){return this.pipelineOutputs[t]}getAllOutputs(){return{...this.pipelineOutputs}}hasStageOutput(t){return t in this.pipelineOutputs}getSolver(t){return this[t]}};function fn(t){let e=new Map,r=(n)=>{let a=e.get(n);if(a===void 0||a===n)return n;let o=r(a);return e.set(n,o),o},i=(n)=>{let a=n[0];if(!a)return;let o=r(a);for(let c of n.slice(1))e.set(r(c),o)};for(let n of t){if(n.type==="source_port"||n.type==="source_net"){let a=n.type==="source_port"?n.source_port_id:n.source_net_id;if(n.subcircuit_connectivity_map_key)i([a,`connectivity:${n.subcircuit_connectivity_map_key}`])}if(n.type==="source_trace")i([...n.connected_source_port_ids,...n.connected_source_net_ids,...n.subcircuit_connectivity_map_key?[`connectivity:${n.subcircuit_connectivity_map_key}`]:[]]);if(n.type==="source_component_internal_connection")i(n.source_port_ids);if(n.type==="source_component")for(let a of n.internally_connected_source_port_ids??[])i(a)}return r}class Bt{connected;components=new Map;portsByComponent=new Map;portsByNet=new Map;powerNets=new Set;groundNets=new Set;placements=new Map;schematicComponents=new Map;schematicPorts=new Map;constructor(t){this.connected=fn(t.circuitJson);for(let e of t.componentPlacements)if(e.sourceComponentId)_n(this.placements,e.sourceComponentId,e);for(let e of t.circuitJson){if(e.type==="source_component")this.components.set(e.source_component_id,e);if(e.type==="source_port"&&e.source_component_id)_n(this.portsByComponent,e.source_component_id,e),_n(this.portsByNet,this.connected(e.source_port_id),e);if(e.type==="source_net"){let r=this.connected(e.source_net_id);if(e.is_power||e.is_positive_voltage_source)this.powerNets.add(r);if(e.is_ground)this.groundNets.add(r)}if(e.type==="schematic_component")this.schematicComponents.set(e.schematic_component_id,e);if(e.type==="schematic_port"&&e.source_port_id)_n(this.schematicPorts,e.source_port_id,e)}}placement(t){let e=this.placements.get(t);return e?.length===1?e[0]:void 0}port(t){let e=this.placement(t.source_component_id),r=this.schematicPorts.get(t.source_port_id)?.filter((i)=>i.schematic_component_id===e?.schematicComponentId);return r?.length===1?r[0]:void 0}namedPort(t,e){let r=this.portsByComponent.get(t)?.filter((i)=>i.name===e||i.port_hints?.includes(e));return r?.length===1?r[0]:void 0}twoTerminalNets(t){let e=this.portsByComponent.get(t);if(e?.length!==2)return;let r=this.connected(e[0].source_port_id),i=this.connected(e[1].source_port_id);if(r!==i)return[r,i]}isRail(t){return this.powerNets.has(t)||this.groundNets.has(t)}isDirectOpAmpFeedback(t){let e=this.twoTerminalNets(t);if(!e||e.some((r)=>this.isRail(r)))return!1;return e.some((r)=>(this.portsByNet.get(r)??[]).some((i)=>{let n=i.source_component_id;if(this.components.get(n)?.ftype!=="simple_op_amp")return!1;if(this.namedPort(n,"output")?.source_port_id!==i.source_port_id)return!1;return["inverting_input","non_inverting_input"].some((o)=>{let c=this.namedPort(n,o);if(!c)return!1;let l=this.connected(c.source_port_id);return l!==r&&e.includes(l)})}))}sameLocalScope(t,e){if(t.schematicSheetId!==e.schematicSheetId||t.subcircuitId!==e.subcircuitId)return!1;let r=this.schematicComponents.get(t.schematicComponentId??""),i=this.schematicComponents.get(e.schematicComponentId??"");if(!r||!i||r.schematic_group_id!==i.schematic_group_id)return!1;let n=this.components.get(t.sourceComponentId??""),a=this.components.get(e.sourceComponentId??"");return n?.source_group_id===a?.source_group_id&&n?.subcircuit_id===a?.subcircuit_id}}function _n(t,e,r){let i=t.get(e);if(i)i.push(r);else t.set(e,[r])}var yr=(t)=>{if(Number.isInteger(t))return String(t);return t.toFixed(3).replace(/\.0+$/,"").replace(/(\.\d*?)0+$/,"$1")},Os=(t)=>{let e=yr(t);return t>0?`+${e}`:e},js=(t)=>t.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<").replaceAll(">",">"),S=(t,e,r,i)=>{if(r===void 0)return;let n=typeof r==="number"?i?.formatDelta?Os(r):yr(r):js(r);t.push(`${e}="${n}"`)};var fr=(t,e)=>Math.hypot(t.x-e.x,t.y-e.y),Te=0.001;class _r extends ct{index;nodes=new Map;starts=[];currentIndex=0;issues;maxSpan;maxLength;constructor({ctx:t,issues:e,maxSpan:r=8,maxLength:i=16}){super();if(this.index=new Bt(t),this.issues=e,!Number.isFinite(r)||r<0||!Number.isFinite(i)||i<0)throw Error("Rail visibility thresholds must be finite and nonnegative");this.maxSpan=r,this.maxLength=i;let n=this.index,a=(s,p,d)=>{let m=JSON.stringify([d,p,Math.round(s.x/Te),Math.round(s.y/Te)]);if(!this.nodes.has(m))this.nodes.set(m,{point:s,net:p,sheet:d,links:[]});return m},o=(s,p,d)=>{let m=this.nodes.get(s),u=this.nodes.get(p),y=fr(m.point,u.point);m.links.push({to:p,length:y,...d}),u.links.push({to:s,length:y,...d})},c=new Map;for(let[s,p]of n.portsByComponent)for(let d of p){let m=n.port(d);if(!m)continue;let u=a(m.center,n.connected(d.source_port_id),m.schematic_sheet_id);if(c.set(d.source_port_id,u),p.length>2)this.starts.push({portId:d.source_port_id,componentId:s,nodeId:u})}for(let s of t.circuitJson){if(s.type!=="schematic_net_label"||!s.source_net_id||!s.anchor_position)continue;let p=n.connected(s.source_net_id);if(!n.isRail(p)||n.powerNets.has(p)&&n.groundNets.has(p))continue;let d=a(s.anchor_position,p,s.schematic_sheet_id);this.nodes.get(d).terminal=n.groundNets.has(p)?"ground":"power"}let l=[];for(let s of t.circuitJson){if(s.type!=="schematic_trace")continue;let p=f2(s,t.circuitJson,n);if(!p)continue;for(let d of s.edges)l.push({from:a(d.from,p,s.schematic_sheet_id),to:a(d.to,p,s.schematic_sheet_id),traceId:s.schematic_trace_id})}for(let s of l){let p=this.nodes.get(s.from),d=this.nodes.get(s.to);if(fr(p.point,d.point)<Te)continue;let u=[...this.nodes].filter(([,y])=>y.net===p.net&&y.sheet===p.sheet&&_2(y.point,p.point,d.point)).sort(([,y],[,f])=>fr(p.point,y.point)-fr(p.point,f.point));for(let y=1;y<u.length;y++)o(u[y-1][0],u[y][0],{traceId:s.traceId})}for(let[s,p]of n.components){if(!["simple_resistor","simple_capacitor","simple_inductor"].includes(p.ftype))continue;let d=n.portsByComponent.get(s);if(d?.length!==2||!n.twoTerminalNets(s))continue;let m=c.get(d[0].source_port_id),u=c.get(d[1].source_port_id);if(m&&u)o(m,u,{componentId:s})}this.solved=this.starts.length===0}_step(){let t=this.starts[this.currentIndex++];if(this.solved=this.currentIndex>=this.starts.length,!t)return;let e=this.index.portsByComponent.get(t.componentId)?.find((c)=>c.source_port_id===t.portId),r=e?this.index.port(e):void 0,i=r?.display_pin_label||e?.name||(r?.pin_number!==void 0?`pin${r.pin_number}`:"connected pin"),n=this.index.placement(t.componentId);if(!n)return;let a=[{id:t.nodeId,length:0,hops:0,path:[t.nodeId],links:[]}],o=new Map([[`${t.nodeId}:0`,0]]);while(a.length){a.sort((p,d)=>p.length-d.length);let c=a.shift(),l=`${c.id}:${c.hops}`;if(c.length!==o.get(l))continue;let s=this.nodes.get(c.id);if(s.terminal){let p=c.path.map((_)=>this.nodes.get(_).point),d=p.map((_)=>_.x),m=p.map((_)=>_.y),u={left:Math.min(...d),right:Math.max(...d),bottom:Math.min(...m),top:Math.max(...m)},y=Math.max(u.right-u.left,u.top-u.bottom);if(y<=this.maxSpan&&c.length<=this.maxLength)return;let f=[...new Set(c.links.flatMap((_)=>_.componentId?[_.componentId]:[]))];this.issues.push({lineItemType:"RailPathTooSpreadOut",hostSchematicBox:n,sourcePortId:t.portId,sourcePortName:i,railType:s.terminal,supportSchematicBoxes:f.flatMap((_)=>{let x=this.index.placement(_);return x?[x]:[]}),schematicTraceIds:[...new Set(c.links.flatMap((_)=>_.traceId?[_.traceId]:[]))],pathPoints:p,pathBounds:u,pathLength:c.length,pathSpan:y,maxRecommendedSpan:this.maxSpan,maxRecommendedPathLength:this.maxLength,message:`Visible path from ${n.sourceComponentName||"component"}.${i} to ${s.terminal} spans ${y.toFixed(2)} schematic units; move the connected support elements closer together near the pin and recompute their schematic traces.`});return}for(let p of s.links){if(c.path.includes(p.to))continue;if(p.componentId){let y=this.index.placement(p.componentId);if(c.hops>=3||!y||!this.index.sameLocalScope(n,y))continue}let d=c.length+p.length,m=c.hops+(p.componentId?1:0),u=`${p.to}:${m}`;if(d>=(o.get(u)??1/0))continue;o.set(u,d),a.push({id:p.to,length:d,hops:m,path:[...c.path,p.to],links:[...c.links,p]})}}}static issueToString(t){let e=[];return S(e,"hostName",t.hostSchematicBox.sourceComponentName),S(e,"pinName",t.sourcePortName),S(e,"railType",t.railType),S(e,"pathSpan",t.pathSpan),S(e,"pathLength",t.pathLength),S(e,"message",t.message),`<RailPathTooSpreadOut ${e.join(" ")} />`}}function f2(t,e,r){if(t.subcircuit_connectivity_map_key)return r.connected(`connectivity:${t.subcircuit_connectivity_map_key}`);let i=e.find((a)=>a.type==="source_trace"&&a.source_trace_id===t.source_trace_id);if(i?.type!=="source_trace")return;let n=[...i.connected_source_port_ids,...i.connected_source_net_ids];return n[0]?r.connected(n[0]):void 0}function _2(t,e,r){let i=r.x-e.x,n=r.y-e.y,a=fr(e,r);if(a<Te)return fr(e,t)<Te;let o=((t.x-e.x)*i+(t.y-e.y)*n)/a;return Math.abs((t.x-e.x)*n-(t.y-e.y)*i)/a<Te&&o>=-Te&&o<=a+Te}class gr extends ct{params;index;capacitorIds;unpopulated=new Set;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx);for(let e of t.ctx.circuitJson)if(e.type==="pcb_component"&&e.do_not_place)this.unpopulated.add(e.source_component_id);this.capacitorIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_capacitor").map((e)=>e.source_component_id),this.solved=this.capacitorIds.length===0}_step(){let t=this.capacitorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.capacitorIds.length,!t||this.unpopulated.has(t))return;let e=this.index,r=e.components.get(t),i=e.placement(t),n=e.portsByComponent.get(t)??[],a=e.twoTerminalNets(t);if(r?.ftype!=="simple_capacitor"||!Number.isFinite(r.capacitance)||r.capacitance<=0||!i||!a||a.some((I)=>e.isRail(I))||n.some((I)=>I.do_not_connect||$s(I)))return;let o=a.map((I)=>{let U=e.portsByNet.get(I)??[];if(U.length!==2)return;return U.find((q)=>q.source_component_id!==t)}),[c,l]=o;if(!c||!l||c.source_component_id!==l.source_component_id||c.do_not_connect||l.do_not_connect||$s(c)||$s(l))return;let s=c.source_component_id,p=e.placement(s);if(e.components.get(s)?.ftype!=="simple_chip"||this.unpopulated.has(s)||!p||!e.sameLocalScope(p,i))return;let d=[c,l],m=d.map((I)=>e.port(I)),u=n.map((I)=>e.port(I));if([...m,...u].some((I)=>!I||I.schematic_sheet_id!==p.schematicSheetId||!Number.isFinite(I.center.x)||!Number.isFinite(I.center.y))||[p,i].some((I)=>![I.schX,I.schY,I.width,I.height].every(Number.isFinite)||I.width<=0||I.height<=0))return;let y=m[0],f=m[1],_=y.facing_direction;if(!_||_!==f.facing_direction)return;let x=_==="left"||_==="right",Y=_==="left"||_==="down"?-1:1,b=Math.hypot(y.center.x-f.center.x,y.center.y-f.center.y);if(b<0.01)return;let M=-Y*(x?i.schX-p.schX:i.schY-p.schY),O=x?(p.width+i.width)/2:(p.height+i.height)/2;if(M<=O+0.2)return;let X=Math.max(...m.map((I,U)=>Math.hypot(I.center.x-u[U].center.x,I.center.y-u[U].center.y))),E=Math.max(4,3*Math.max(i.width,i.height),2*b);if(X<=E)return;this.params.issues.push({lineItemType:"CapacitorSeparatedFromChipPins",hostSchematicBox:p,capacitorSchematicBox:i,chipSourcePortIds:[d[0].source_port_id,d[1].source_port_id],maxPinDistance:X,maxRecommendedPinDistance:E,message:`Place ${i.sourceComponentName||"component"} beside its two connected pins on the ${_} side of ${p.sourceComponentName||"component"} so their connections can be read together. Preserve pin connections, leave room for labels, and reroute affected traces; exact alignment is not required.`})}static issueToString(t){let e=[];return S(e,"hostComponentName",t.hostSchematicBox.sourceComponentName),S(e,"capacitorName",t.capacitorSchematicBox.sourceComponentName),S(e,"maxPinDistance",t.maxPinDistance),S(e,"maxRecommendedPinDistance",t.maxRecommendedPinDistance),S(e,"message",t.message),`<CapacitorSeparatedFromChipPins ${e.join(" ")} />`}}function $s(t){return Boolean(t.requires_power||t.provides_power||t.requires_ground||t.provides_ground||t.requires_voltage!==void 0||t.provides_voltage!==void 0)}class xr extends ct{params;index;inductorIds;unpopulated=new Set;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx);for(let e of t.ctx.circuitJson)if(e.type==="pcb_component"&&e.do_not_place)this.unpopulated.add(e.source_component_id);for(let e of t.ctx.circuitJson)if(e.type==="pcb_component"&&!e.do_not_place)this.unpopulated.delete(e.source_component_id);this.inductorIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_inductor"&&!this.unpopulated.has(e.source_component_id)).map((e)=>e.source_component_id),this.solved=this.inductorIds.length===0}_step(){let t=this.inductorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.inductorIds.length,!t)return;let e=this.index,r=this.localPart(t),i=e.twoTerminalNets(t);if(!r||!i||i.some((d)=>e.isRail(d)))return;let n=i.map((d)=>{let m=e.portsByNet.get(d)??[];if(m.some((b)=>b.source_component_id!==t&&!this.unpopulated.has(b.source_component_id)&&e.components.get(b.source_component_id)?.ftype==="simple_inductor"))return;let u=m.filter((b)=>{let M=e.components.get(b.source_component_id),O=e.twoTerminalNets(b.source_component_id);return M?.ftype==="simple_capacitor"&&!this.unpopulated.has(b.source_component_id)&&O?.some((X)=>X!==d&&e.groundNets.has(X))});if(u.length!==1)return;let y=u[0],f=e.components.get(y.source_component_id);if(f.ftype!=="simple_capacitor"||!Number.isFinite(f.capacitance)||f.capacitance<=0)return;let _=this.localPart(y.source_component_id);if(!_||!e.sameLocalScope(r.placement,_.placement))return;let x=e.port(y),Y=e.port(r.ports.find((b)=>e.connected(b.source_port_id)===d));return{placement:_.placement,ground:e.twoTerminalNets(y.source_component_id).find((b)=>b!==d),distance:Math.hypot(x.center.x-Y.center.x,x.center.y-Y.center.y)}}),[a,o]=n;if(!a||!o||a.ground!==o.ground)return;let c=[r.placement,a.placement,o.placement],l=Math.max(4,...c.map((d)=>3*Math.max(d.width,d.height))),s=Math.max(a.distance,o.distance);if(s<=l)return;let p=(d)=>d.sourceComponentName||"component";this.params.issues.push({lineItemType:"PiFilterComponentsNotGrouped",inductorSchematicBox:r.placement,firstCapacitorSchematicBox:a.placement,secondCapacitorSchematicBox:o.placement,maxSignalPinDistance:s,maxRecommendedSignalPinDistance:l,message:`Group ${p(a.placement)} and ${p(o.placement)} beside the connected ends of ${p(r.placement)} so the series path and both grounded branches of the pi filter can be read together. Preserve pin connections, allow room for labels, and reroute affected traces.`})}localPart(t){let e=this.index.placement(t),r=this.index.portsByComponent.get(t);if(!e||r?.length!==2||r.some((i)=>{let n=this.index.port(i);return i.do_not_connect||!n||n.schematic_sheet_id!==e.schematicSheetId||!Number.isFinite(n.center.x)||!Number.isFinite(n.center.y)}))return;return{placement:e,ports:r}}static issueToString(t){let e=[];return S(e,"inductorName",t.inductorSchematicBox.sourceComponentName),S(e,"firstCapacitorName",t.firstCapacitorSchematicBox.sourceComponentName),S(e,"secondCapacitorName",t.secondCapacitorSchematicBox.sourceComponentName),S(e,"maxSignalPinDistance",t.maxSignalPinDistance),S(e,"maxRecommendedSignalPinDistance",t.maxRecommendedSignalPinDistance),S(e,"message",t.message),`<PiFilterComponentsNotGrouped ${e.join(" ")} />`}}class br extends ct{params;index;mosfetIds;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.mosfetIds=[...this.index.components.keys()].filter((e)=>this.mosfetPorts(e)),this.solved=this.mosfetIds.length===0}_step(){let t=this.mosfetIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.mosfetIds.length,!t)return;let e=this.index,r=e.placement(t),i=this.mosfetPorts(t);if(!r)return;let n=e.connected(i.gate.source_port_id),a=e.connected(i.sources[0].source_port_id),o=e.connected(i.drains[0].source_port_id);if(new Set([n,a,o]).size!==3||e.isRail(n))return;if([i.gate,...i.sources,...i.drains].some((f)=>{let _=e.port(f);return!_||_.schematic_sheet_id!==r.schematicSheetId}))return;let c=(e.portsByNet.get(n)??[]).filter((f)=>f.source_component_id!==t);if(c.length!==2)return;let l=c.map((f)=>{let _=f.source_component_id,x=e.components.get(_),Y=e.placement(_),b=e.twoTerminalNets(_);if(x?.ftype!=="simple_resistor"||!Number.isFinite(x.resistance)||x.resistance<=0||!Y||!b||!e.sameLocalScope(r,Y)||e.portsByComponent.get(_).some((M)=>{let O=e.port(M);return M.do_not_connect||!O||O.schematic_sheet_id!==r.schematicSheetId}))return;return{placement:Y,otherNet:b.find((M)=>M!==n)}});if(l.some((f)=>!f))return;let s=l.filter((f)=>f.otherNet===a),p=l.filter((f)=>f.otherNet!==a);if(s.length!==1||p.length!==1)return;let d=s[0].placement,m=p[0].placement;if(p[0].otherNet===o||e.isRail(p[0].otherNet))return;let u=Math.max(6,3*Math.max(r.width,r.height)),y=Math.max(bm(r,m),bm(r,d));if(y<=u)return;this.params.issues.push({lineItemType:"MosfetGateNetworkNotGrouped",mosfetSchematicBox:r,seriesGateResistorSchematicBox:m,gateSourceResistorSchematicBox:d,maxBodyGap:y,maxRecommendedBodyGap:u,message:`Group ${m.sourceComponentName||"component"} and ${d.sourceComponentName||"component"} beside ${r.sourceComponentName||"component"}'s gate/source pins so the gate-drive branch can be read together. Preserve all pin connections, leave room for labels, and reroute affected traces.`})}mosfetPorts(t){let e=this.index.components.get(t)?.ftype;if(e!=="simple_mosfet"&&e!=="simple_chip")return;let r=this.index.portsByComponent.get(t)??[],i=r.filter((o)=>Xs(o,/^(G|GATE)$/)),n=r.filter((o)=>Xs(o,/^(S|SOURCE)[0-9]*$/)),a=r.filter((o)=>Xs(o,/^(D|DRAIN)[0-9]*$/));if(i.length!==1||!n.length||!a.length||i.length+n.length+a.length!==r.length||new Set([...i,...n,...a]).size!==r.length||r.some((o)=>o.do_not_connect))return;for(let o of[n,a])if(new Set(o.map((c)=>this.index.connected(c.source_port_id))).size!==1)return;return{gate:i[0],sources:n,drains:a}}static issueToString(t){let e=[];return S(e,"mosfetName",t.mosfetSchematicBox.sourceComponentName),S(e,"seriesGateResistorName",t.seriesGateResistorSchematicBox.sourceComponentName),S(e,"gateSourceResistorName",t.gateSourceResistorSchematicBox.sourceComponentName),S(e,"maxBodyGap",t.maxBodyGap),S(e,"maxRecommendedBodyGap",t.maxRecommendedBodyGap),S(e,"message",t.message),`<MosfetGateNetworkNotGrouped ${e.join(" ")} />`}}function Xs(t,e){return[t.name,...t.port_hints??[]].some((r)=>e.test(r.toUpperCase().replace(/[\s_]/g,"")))}function bm(t,e){return Math.hypot(Math.max(0,Math.abs(t.schX-e.schX)-(t.width+e.width)/2),Math.max(0,Math.abs(t.schY-e.schY)-(t.height+e.height)/2))}class vr extends ct{params;index;relayIds;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.relayIds=[...this.index.components.keys()].filter((e)=>this.coilPorts(e)),this.solved=this.relayIds.length===0}_step(){let t=this.relayIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.relayIds.length,!t)return;let e=this.index,r=e.placement(t),i=this.coilPorts(t);if(!r||i.some((I)=>I.do_not_connect))return;let n=i.map((I)=>e.connected(I.source_port_id));if(n[0]===n[1])return;if(this.relayIds.some((I)=>I!==t&&this.coilPorts(I).every((U)=>n.includes(e.connected(U.source_port_id)))))return;let a=new Set((e.portsByNet.get(n[0])??[]).filter((I)=>e.components.get(I.source_component_id)?.ftype==="simple_diode").map((I)=>I.source_component_id).filter((I)=>e.twoTerminalNets(I)?.includes(n[1])));if(a.size!==1)return;let o=[...a][0],c=e.placement(o),l=this.uniquePort(o,/^(?:ANODE|A)$/),s=this.uniquePort(o,/^(?:CATHODE|K)$/);if(!c||!e.sameLocalScope(r,c)||!l||!s||l===s||l.do_not_connect||s.do_not_connect)return;let p=e.connected(l.source_port_id),d=e.connected(s.source_port_id);if(e.isRail(p)||e.groundNets.has(d)||!this.hasGroundedDriver(p,d))return;let m=i.map((I)=>e.port(I)),u=[l,s].map((I)=>e.port(I));if([...m,...u].some((I)=>!I||I.schematic_sheet_id!==r.schematicSheetId))return;let[y,f]=m,_=Math.min(y.center.x,f.center.x),x=Math.max(y.center.x,f.center.x),Y=Math.min(y.center.y,f.center.y),b=Math.max(y.center.y,f.center.y),M=Math.max(_-(c.schX+c.width/2),c.schX-c.width/2-x,0),O=Math.max(Y-(c.schY+c.height/2),c.schY-c.height/2-b,0),X=Math.hypot(M,O),E=Math.hypot(x-_,b-Y);if(X<=Math.max(1.5,2*E)||X>Math.max(8,4*Math.max(r.width,r.height)))return;if(!this.params.ctx.circuitJson.some((I)=>I.type==="schematic_net_label"&&I.schematic_sheet_id===r.schematicSheetId&&I.anchor_position&&u.some((U)=>Math.hypot(U.center.x-I.anchor_position.x,U.center.y-I.anchor_position.y)<0.01&&!this.hasWireAtPin(U))))return;this.params.issues.push({lineItemType:"FlybackDiodeSeparatedFromRelayCoil",relaySchematicBox:r,diodeSchematicBox:c,coilSourcePortIds:[i[0].source_port_id,i[1].source_port_id],distanceFromCoilPins:X,message:`Place ${c.sourceComponentName||"component"} beside ${r.sourceComponentName||"component"}'s coil pins so the flyback protection loop can be read together. Preserve diode polarity and all pin connections; leave room for labels and reroute affected traces.`})}hasWireAtPin(t){return this.params.ctx.circuitJson.some((e)=>e.type==="schematic_trace"&&e.schematic_sheet_id===t.schematic_sheet_id&&e.edges.some(({from:r,to:i})=>{let n=i.x-r.x,a=i.y-r.y,o=n*n+a*a,c=o?Math.max(0,Math.min(1,((t.center.x-r.x)*n+(t.center.y-r.y)*a)/o)):0;return Math.hypot(t.center.x-r.x-c*n,t.center.y-r.y-c*a)<0.01}))}uniquePort(t,e){let r=this.index.portsByComponent.get(t)?.filter((i)=>Si(i,e));return r?.length===1?r[0]:void 0}coilPorts(t){if(this.index.components.get(t)?.ftype!=="simple_chip")return;let e=this.index.portsByComponent.get(t)??[];if(!this.uniquePort(t,/^(?:COM|COMMON)$/)||!e.some((i)=>Si(i,/^(?:NO|NC|NORMALLYOPEN|NORMALLYCLOSED)$/)))return;if(e.filter((i)=>Si(i,/^(?:COIL[A-B12]|A[12])$/)).length!==2)return;for(let[i,n]of[["COILA","COILB"],["COIL1","COIL2"],["A1","A2"]]){let a=this.uniquePort(t,new RegExp(`^${i}$`)),o=this.uniquePort(t,new RegExp(`^${n}$`));if(a&&o&&a!==o&&!Si(a,new RegExp(`^${n}$`))&&!Si(o,new RegExp(`^${i}$`)))return[a,o]}}hasGroundedDriver(t,e){return(this.index.portsByNet.get(t)??[]).some((r)=>{let i=r.source_component_id,n=this.index.components.get(i);if(n?.ftype!=="simple_chip"&&!(n?.ftype==="simple_transistor"&&n.transistor_type==="npn"))return!1;if(this.index.portsByComponent.get(i)?.length!==3)return!1;let a=this.uniquePort(i,/^(?:C|COLLECTOR)$/),o=this.uniquePort(i,/^(?:E|EMITTER)$/),c=this.uniquePort(i,/^(?:B|BASE)$/);if(!a||!o||!c||new Set([a,o,c]).size!==3||[a,o,c].some((p)=>p.do_not_connect)||a.source_port_id!==r.source_port_id)return!1;let l=this.index.connected(o.source_port_id),s=this.index.connected(c.source_port_id);return this.index.groundNets.has(l)&&!this.index.powerNets.has(l)&&new Set([t,e,l,s]).size===4})}static issueToString(t){let e=[];return S(e,"relayName",t.relaySchematicBox.sourceComponentName),S(e,"diodeName",t.diodeSchematicBox.sourceComponentName),S(e,"distanceFromCoilPins",t.distanceFromCoilPins),S(e,"message",t.message),`<FlybackDiodeSeparatedFromRelayCoil ${e.join(" ")} />`}}function Si(t,e){return[t.name,...t.port_hints??[]].some((r)=>e.test(r.toUpperCase().replace(/[\s_]/g,"")))}var Ne=0.01;class Sr extends ct{params;index;hostIds;traces;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.hostIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_chip").map((e)=>e.source_component_id),this.traces=t.ctx.circuitJson.filter((e)=>e.type==="schematic_trace"),this.solved=this.hostIds.length===0}_step(){let t=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!t)return;let e=this.index,r=e.placement(t),i=e.portsByComponent.get(t)??[],n=i.filter((k)=>Vs(k)==="positive"),a=i.filter((k)=>Vs(k)==="negative"),o=i.filter((k)=>wi(k,/^(?:OUT|VOUT|OUTPUT)$/));if(!r||n.length!==1||a.length!==1||o.length!==1||!i.some((k)=>wi(k,/^(?:VS|VCC|VDD)$/))||!i.some((k)=>wi(k,/^(?:GND|GROUND|VSS)$/)))return;let c=[n[0],a[0]],l=c.map((k)=>e.connected(k.source_port_id));if(c.some((k)=>k.do_not_connect)||l[0]===l[1]||l.includes(e.connected(o[0].source_port_id)))return;let s=c.map((k)=>e.port(k)),[p,d]=s;if(!p||!d||!p.facing_direction||p.facing_direction!==d.facing_direction||s.some((k)=>k.schematic_sheet_id!==r.schematicSheetId))return;let m=new Set((e.portsByNet.get(l[0])??[]).filter((k)=>e.components.get(k.source_component_id)?.ftype==="simple_resistor").map((k)=>k.source_component_id).filter((k)=>e.twoTerminalNets(k)?.includes(l[1])));if(m.size!==1)return;let u=[...m][0],y=e.components.get(u);if(y?.ftype!=="simple_resistor"||!Number.isFinite(y.resistance)||y.resistance<=0||y.resistance>1)return;if(l.some((k)=>(e.portsByNet.get(k)??[]).some((at)=>at.source_component_id!==t&&Vs(at)!==void 0&&e.components.get(at.source_component_id)?.ftype==="simple_chip")))return;let f=e.placement(u);if(!f||!e.sameLocalScope(r,f))return;let _=e.portsByComponent.get(u);if(_.some((k)=>k.do_not_connect))return;let x=l.map((k)=>e.port(_.find((at)=>e.connected(at.source_port_id)===k)));if(x.some((k)=>!k||k.schematic_sheet_id!==r.schematicSheetId))return;let Y=p.facing_direction==="left"||p.facing_direction==="right",b=(k)=>Y?k.y:k.x,M=b(p.center),O=b(d.center),X=Math.abs(M-O);if(X<Ne)return;let E=Y?f.schY:f.schX,I=(Y?f.height:f.width)/2,U=Math.max(Math.min(M,O)-(E+I),E-I-Math.max(M,O));if(U<=Math.max(1.5,2*X)||Math.hypot(f.schX-r.schX,f.schY-r.schY)>Math.max(8,4*Math.max(r.width,r.height)))return;let q=s.map((k,at)=>this.hasVisibleConnection(x[at],k,l[at]));if(q[0]===q[1])return;let st=q[0]?1:0,H=l[st];if(!this.params.ctx.circuitJson.some((k)=>{if(k.type!=="schematic_net_label"||k.schematic_sheet_id!==r.schematicSheetId)return!1;if(k.source_net_id&&(e.connected(k.source_net_id)===H||e.connected(`connectivity:${k.source_net_id}`)===H))return!0;let at=x[st].center;if(k.anchor_position&&Math.hypot(k.anchor_position.x-at.x,k.anchor_position.y-at.y)<Ne)return!0;return k.source_trace_id!==void 0&&this.sourceTraceTouchesNet(k.source_trace_id,H)}))return;this.params.issues.push({lineItemType:"CurrentSenseShuntSeparatedFromInputs",amplifierSchematicBox:r,shuntSchematicBox:f,positiveInputSourcePortId:c[0].source_port_id,negativeInputSourcePortId:c[1].source_port_id,inputBandGap:U,message:`Place ${f.sourceComponentName||"component"} near ${r.sourceComponentName||"component"}.${c[0].name}/${c[1].name}, so both sense connections can be read together. Move or rotate the shunt as needed; preserve all pin connections and leave room for labels.`})}hasVisibleConnection(t,e,r){let i=this.traces.filter((o)=>{if(o.schematic_sheet_id!==t.schematic_sheet_id)return!1;if(o.subcircuit_connectivity_map_key)return this.index.connected(`connectivity:${o.subcircuit_connectivity_map_key}`)===r;if(this.sourceTraceTouchesNet(o.source_trace_id,r))return!0;let c=[o.edges[0]?.from,o.edges.at(-1)?.to],l=new Set(this.params.ctx.circuitJson.flatMap((s)=>s.type==="schematic_port"&&s.source_port_id&&s.schematic_sheet_id===o.schematic_sheet_id&&c.some((p)=>p&&Math.hypot(p.x-s.center.x,p.y-s.center.y)<Ne)?[this.index.connected(s.source_port_id)]:[]));return l.size===1&&l.has(r)}).flatMap((o)=>o.edges),n=i.filter((o)=>gn(t.center,o.from,o.to)),a=new Set;for(let o=0;o<n.length;o++){let c=n[o];if(gn(e.center,c.from,c.to))return!0;for(let[l,s]of i.entries()){if(a.has(l)||![c.from,c.to].some((p)=>gn(p,s.from,s.to))&&![s.from,s.to].some((p)=>gn(p,c.from,c.to)))continue;a.add(l),n.push(s)}}return!1}sourceTraceTouchesNet(t,e){if(!t)return!1;let r=this.params.ctx.circuitJson.find((i)=>i.type==="source_trace"&&i.source_trace_id===t);return r?.type==="source_trace"&&r.connected_source_port_ids.some((i)=>this.index.connected(i)===e)}static issueToString(t){let e=[];return S(e,"amplifierName",t.amplifierSchematicBox.sourceComponentName),S(e,"shuntName",t.shuntSchematicBox.sourceComponentName),S(e,"inputBandGap",t.inputBandGap),S(e,"message",t.message),`<CurrentSenseShuntSeparatedFromInputs ${e.join(" ")} />`}}function wi(t,e){return[t.name,...t.port_hints??[]].some((r)=>e.test(r.toUpperCase().replace(/[\s_]/g,"")))}function Vs(t){let e=wi(t,/^(?:IN\+|VIN\+|INPOS|VINPOS)$/),r=wi(t,/^(?:IN-|VIN-|INNEG|VINNEG)$/);return e===r?void 0:e?"positive":"negative"}function gn(t,e,r){let i=r.x-e.x,n=r.y-e.y,a=Math.hypot(i,n);if(a<Ne)return Math.hypot(t.x-e.x,t.y-e.y)<Ne;let o=((t.x-e.x)*i+(t.y-e.y)*n)/a;return o>=-Ne&&o<=a+Ne&&Math.abs((t.x-e.x)*n-(t.y-e.y)*i)/a<Ne}class wr extends ct{params;index;positiveNets=new Set;resistorIds;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.resistorIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_resistor").map((e)=>e.source_component_id);for(let e of t.ctx.circuitJson)if(e.type==="source_net"&&e.is_positive_voltage_source)this.positiveNets.add(this.index.connected(e.source_net_id));this.solved=this.resistorIds.length===0}_step(){let t=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!t||!this.isResistor(t))return;let e=this.index,r=e.twoTerminalNets(t);if(!r)return;let i=r.filter((_)=>e.isRail(_));if(i.length!==1)return;let n=i[0];if(!this.positiveNets.has(n)||e.groundNets.has(n))return;let a=r.find((_)=>_!==n),o=e.portsByNet.get(a)??[],c=new Set(o.filter((_)=>e.components.get(_.source_component_id)?.ftype==="simple_resistor").map((_)=>_.source_component_id));if(c.size!==2)return;let l=[...c].find((_)=>_!==t);if(!this.isResistor(l))return;let s=e.twoTerminalNets(l),p=s?.find((_)=>_!==a);if(!s?.includes(a)||!p||!e.groundNets.has(p)||e.powerNets.has(p)||!o.some((_)=>!c.has(_.source_component_id)))return;let d=e.placement(t),m=e.placement(l);if(!d||!m||!e.sameLocalScope(d,m))return;let u=this.getDownwardResistorPorts(t,n,a),y=this.getDownwardResistorPorts(l,a,p);if(!u||!y)return;let f=m.schY-m.height/2-(d.schY+d.height/2);if(f<=1.5)return;this.params.issues.push({lineItemType:"VoltageDividerSupplyResistorBelowGroundResistor",supplyResistorSchematicBox:d,groundResistorSchematicBox:m,supplyTapSourcePortId:u.bottom.source_port_id,groundTapSourcePortId:y.top.source_port_id,reversedBodyGap:f,message:`Place ${d.sourceComponentName||"component"} above ${m.sourceComponentName||"component"}, close enough to read their shared divider tap. Preserve all connections and leave room for labels; exact alignment is not required.`})}isResistor(t){let e=this.index.components.get(t);return e?.ftype==="simple_resistor"&&Number.isFinite(e.resistance)&&e.resistance>0}getDownwardResistorPorts(t,e,r){let i=this.index,n=i.placement(t),a=i.portsByComponent.get(t);if(a.some((p)=>p.do_not_connect))return;let o=a.find((p)=>i.connected(p.source_port_id)===e),c=a.find((p)=>i.connected(p.source_port_id)===r);if(!o||!c)return;let l=i.port(o),s=i.port(c);if(!l||!s||l.schematic_sheet_id!==n.schematicSheetId||s.schematic_sheet_id!==n.schematicSheetId||l.facing_direction!=="up"||s.facing_direction!=="down"||l.center.y<=s.center.y)return;return{top:o,bottom:c}}static issueToString(t){let e=[];return S(e,"supplyResistorName",t.supplyResistorSchematicBox.sourceComponentName),S(e,"groundResistorName",t.groundResistorSchematicBox.sourceComponentName),S(e,"reversedBodyGap",t.reversedBodyGap),S(e,"message",t.message),`<VoltageDividerSupplyResistorBelowGroundResistor ${e.join(" ")} />`}}class Ar extends ct{params;index;hostIds;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.hostIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_chip").map((e)=>e.source_component_id),this.solved=this.hostIds.length===0}_step(){let t=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!t)return;let e=this.index,r=e.placement(t),i=e.portsByComponent.get(t)??[];if(!r||i.some((E)=>!xn(E)))return;let n=i.filter((E)=>xn(E)==="input"),a=i.filter((E)=>xn(E)==="output"),o=i.filter((E)=>xn(E)==="ground");if(n.length!==1||a.length!==1||!o.length)return;let c=n[0],l=a[0];if([c,l,...o].some((E)=>E.do_not_connect))return;let s=e.connected(c.source_port_id),p=e.connected(l.source_port_id),d=new Set(o.map((E)=>e.connected(E.source_port_id)));if(d.size!==1)return;let m=[...d][0];if(new Set([s,p,m]).size!==3||!(e.groundNets.has(m)||o.some((E)=>E.requires_ground||E.provides_ground))||!(e.powerNets.has(s)||c.requires_power)||!(e.powerNets.has(p)||l.provides_power))return;let u=e.port(c),y=e.port(l);if(!u||!y||u.schematic_sheet_id!==r.schematicSheetId||y.schematic_sheet_id!==r.schematicSheetId)return;let f=u.facing_direction==="left"&&y.facing_direction==="right"||u.facing_direction==="right"&&y.facing_direction==="left",_=u.facing_direction==="up"&&y.facing_direction==="down"||u.facing_direction==="down"&&y.facing_direction==="up";if(!f&&!_)return;let x=y.facing_direction==="right"||y.facing_direction==="up"?1:-1;if(x*(f?y.center.x-u.center.x:y.center.y-u.center.y)<=0.01)return;let b=this.localCapacitor(r,s,m),M=this.localCapacitor(r,p,m);if(!b||!M)return;let O=(E,I)=>{let U=I*x*(f?E.schX-r.schX:E.schY-r.schY),q=f?(r.width+E.width)/2:(r.height+E.height)/2;return U>q+0.2};if(!O(b,1)||!O(M,-1))return;let X=r.sourceComponentName||"component";this.params.issues.push({lineItemType:"RegulatorCapacitorsOnWrongSides",regulatorSchematicBox:r,inputCapacitorSchematicBox:b,outputCapacitorSchematicBox:M,inputSourcePortId:c.source_port_id,outputSourcePortId:l.source_port_id,message:`Place ${b.sourceComponentName} near ${X}.${c.name} on the ${u.facing_direction} side and ${M.sourceComponentName} near ${X}.${l.name} on the ${y.facing_direction} side. Preserve all connections and leave room for labels; exact alignment is not required.`})}localCapacitor(t,e,r){let i=this.index,n=[],a=Math.max(6,4*Math.max(t.width,t.height)),o=new Set((i.portsByNet.get(e)??[]).map((c)=>c.source_component_id));for(let c of o){if(i.components.get(c)?.ftype!=="simple_capacitor")continue;let l=i.twoTerminalNets(c),s=i.placement(c);if(!l?.includes(r)||!s||!i.sameLocalScope(t,s))continue;if(Math.hypot(s.schX-t.schX,s.schY-t.schY)>a)continue;if(i.portsByComponent.get(c).some((d)=>d.do_not_connect||!i.port(d)||i.port(d).schematic_sheet_id!==t.schematicSheetId))continue;n.push(s)}return n.length===1?n[0]:void 0}static issueToString(t){let e=[];return S(e,"regulatorName",t.regulatorSchematicBox.sourceComponentName),S(e,"inputCapacitorName",t.inputCapacitorSchematicBox.sourceComponentName),S(e,"outputCapacitorName",t.outputCapacitorSchematicBox.sourceComponentName),S(e,"message",t.message),`<RegulatorCapacitorsOnWrongSides ${e.join(" ")} />`}}function xn(t){let e=new Set;for(let r of[t.name,...t.port_hints??[]]){let i=r.toUpperCase().replace(/[ _-]/g,"");if(/^(?:VIN|IN|INPUT)$/.test(i))e.add("input");else if(/^(?:VOUT|OUT|OUTPUT)$/.test(i))e.add("output");else if(/^(?:GND\d*|VSS)$/.test(i))e.add("ground");else if(/^(?:EN|ENABLE|CE|SHDN|NC\d*|EP|PAD|ADJ|FB|BYP|BYPASS|NR|PG|PGOOD)$/.test(i))e.add("control")}return e.size===1?[...e][0]:void 0}function Ut(t,e,r,i){return{left:t-r/2,right:t+r/2,top:e+i/2,bottom:e-i/2}}function Ke(t,e){let r=Math.min(t.right,e.right)-Math.max(t.left,e.left),i=Math.min(t.top,e.top)-Math.max(t.bottom,e.bottom);return r>0&&i>0?{ow:r,oh:i}:null}var Bi=0.01,vm={right:{x:1,y:0},left:{x:-1,y:0},up:{x:0,y:1},down:{x:0,y:-1}},Xt=(t,e)=>t.x*e.x+t.y*e.y,Ai=(t,e)=>Math.abs(t.x-e.x)+Math.abs(t.y-e.y),We=(t,e)=>Ai(t,e)<=Bi,Br=(t)=>Math.round(t*100)/100;class Fr extends ct{params;constructor(t){super();this.params=t}_step(){let{ctx:t,issues:e}=this.params,r=new Bt(t);for(let n of r.portsByComponent.values())for(let a of n){let o=r.connected(a.source_port_id);if(a.requires_ground||a.provides_ground)r.groundNets.add(o);if(a.requires_power||a.provides_power)r.powerNets.add(o)}let i=t.circuitJson.filter((n)=>n.type==="schematic_trace");for(let[n,a]of r.components){if(a.ftype!=="simple_pin_header"&&a.ftype!=="simple_connector")continue;let o=r.placement(n),c=r.portsByComponent.get(n)??[];if(!o||c.length<2)continue;let l=c.map((N)=>r.port(N)),s=l[0]?.facing_direction;if(!s||l.some((N)=>!N||N.facing_direction!==s))continue;let p=vm[s],d={x:-p.y,y:p.x},m=i.filter((N)=>N.schematic_sheet_id===o.schematicSheetId),u=t.circuitJson.filter((N)=>N.type==="schematic_net_label"&&N.schematic_sheet_id===o.schematicSheetId),y=[],f=!1;for(let N of c){let tt=r.port(N),J=r.connected(N.source_port_id),W=(r.portsByNet.get(J)??[]).filter((et)=>et.source_port_id!==N.source_port_id),j=m.filter((et)=>et.edges.some((mt)=>We(mt.from,tt.center)||We(mt.to,tt.center)));if(r.isRail(J)){if(j.some((et)=>!u.some((mt)=>mt.anchor_position&&Sm(et,tt.center,mt.anchor_position))))f=!0;continue}if(W.length===0){if(j.length>0)f=!0;continue}let G=W.length===1?r.port(W[0]):void 0,D=W.length===1?r.placement(W[0].source_component_id):void 0;if(!G?.facing_direction||!D||!r.sameLocalScope(o,D)||Xt(vm[G.facing_direction],p)!==-1){f=!0;break}y.push({pin:tt,peer:G,component:D})}if(f||y.length<2)continue;if(y.some((N)=>Xt(N.peer.center,p)>=Xt(N.pin.center,p)-2))continue;let _=y.map((N)=>m.filter((tt)=>Sm(tt,N.pin.center,N.peer.center)&&g2(tt)>=3)).filter((N)=>N.length>0);if(_.length<2)continue;let x=_.flat(),Y=[...y].sort((N,tt)=>Xt(N.pin.center,d)-Xt(tt.pin.center,d));if(Y.some((N,tt)=>tt>0&&Xt(N.peer.center,d)<=Xt(Y[tt-1].peer.center,d)+Bi))continue;let b={x:o.schX,y:o.schY},M=Math.max(...y.map((N)=>Xt(N.pin.center,p)-Xt(b,p))),O=Math.min(...y.map((N)=>Xt(N.peer.center,p)))-2-M,X=y.map((N)=>Xt(N.peer.center,d)-Xt(N.pin.center,d)+Xt(b,d)).sort((N,tt)=>N-tt),E=X[Math.floor(X.length/2)],I={x:Br(p.x*O+d.x*E),y:Br(p.y*O+d.y*E)},U={x:I.x-b.x,y:I.y-b.y},q=(N)=>({x:N.center.x+U.x,y:N.center.y+U.y});if(y.some((N)=>Ai(q(N.pin),N.peer.center)>Ai(N.pin.center,N.peer.center)+Bi))continue;let st=y.reduce((N,tt)=>N+Ai(tt.pin.center,tt.peer.center),0),H=y.reduce((N,tt)=>N+Ai(q(tt.pin),tt.peer.center),0);if(st-H<4||H>st*0.75)continue;let k=t.componentPlacements.filter((N)=>N.schematicSheetId===o.schematicSheetId&&N.schematicComponentId!==o.schematicComponentId),at=Ut(I.x,I.y,o.width+0.4,o.height+0.4);if(k.some((N)=>Ke(at,Ut(N.schX,N.schY,N.width,N.height))))continue;if(y.some((N)=>{let tt=q(N.pin),J=N.peer.center,W=(Xt(tt,p)+Xt(J,p))/2,j=[tt,{x:p.x*W+d.x*Xt(tt,d),y:p.y*W+d.y*Xt(tt,d)},{x:p.x*W+d.x*Xt(J,d),y:p.y*W+d.y*Xt(J,d)},J];return k.some((G)=>G.schematicComponentId!==N.component.schematicComponentId&&j.slice(1).some((D,et)=>x2(j[et],D,G)))}))continue;let ot=[...new Map(y.map((N)=>[N.component.schematicComponentId,N.component])).values()],Z=o.sourceComponentName||"component";e.push({lineItemType:"ConnectorPositionCausesTraceDetours",connectorSchematicBox:o,connectedComponents:ot,schematicTraceIds:[...new Set(x.map((N)=>N.schematic_trace_id))],evaluatedSignalCount:y.length,newSchX:I.x,newSchY:I.y,deltaSchX:Br(U.x),deltaSchY:Br(U.y),currentTotalSignalDistance:Br(st),suggestedTotalSignalDistance:Br(H),message:`Move ${Z} to schX=${I.x}, schY=${I.y} so its signal pins face ${ot.map((N)=>N.sourceComponentName||"component").join(", ")}. Preserve rotation and pin assignments; reroute the connections and attached rail labels.`})}this.solved=!0}static issueToString(t){let e=[];S(e,"connectorComponentName",t.connectorSchematicBox.sourceComponentName),S(e,"connectedComponents",t.connectedComponents.map((r)=>r.sourceComponentName||"component").join(","));for(let r of["evaluatedSignalCount","newSchX","newSchY","deltaSchX","deltaSchY","currentTotalSignalDistance","suggestedTotalSignalDistance"])S(e,r,t[r]);return S(e,"message",t.message),`<ConnectorPositionCausesTraceDetours ${e.join(" ")} />`}}function Sm(t,e,r){let i=t.edges[0]?.from,n=t.edges.at(-1)?.to;return!!i&&!!n&&(We(i,e)&&We(n,r)||We(i,r)&&We(n,e))}function g2(t){let e,r=0;for(let i=0;i<t.edges.length;i++){let n=t.edges[i];if(i>0&&!We(t.edges[i-1].to,n.from))return 0;if(We(n.from,n.to))continue;let a=Math.abs(n.from.y-n.to.y)<Bi?"x":Math.abs(n.from.x-n.to.x)<Bi?"y":void 0;if(!a)return 0;if(e&&e!==a)r++;e=a}return r}function x2(t,e,r){let i=Ut(r.schX,r.schY,r.width+0.2,r.height+0.2);return Math.max(t.x,e.x)>i.left&&Math.min(t.x,e.x)<i.right&&Math.max(t.y,e.y)>i.bottom&&Math.min(t.y,e.y)<i.top}class Pr extends ct{index;positiveNets=new Set;transistorIds;issues;currentIndex=0;constructor({ctx:t,issues:e}){super();this.issues=e,this.index=new Bt(t);for(let r of t.circuitJson)if(r.type==="source_net"&&r.is_positive_voltage_source)this.positiveNets.add(this.index.connected(r.source_net_id));this.transistorIds=[...this.index.components.values()].filter((r)=>r.ftype==="simple_transistor"&&r.transistor_type==="npn").map((r)=>r.source_component_id),this.solved=this.transistorIds.length===0}_step(){let t=this.transistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.transistorIds.length,!t)return;let e=this.index,r=e.placement(t);if(!r||e.portsByComponent.get(t)?.length!==3)return;let i=e.namedPort(t,"base"),n=e.namedPort(t,"collector"),a=e.namedPort(t,"emitter");if(!i||!n||!a)return;let o=e.connected(i.source_port_id),c=e.connected(n.source_port_id),l=e.connected(a.source_port_id);if(new Set([o,c,l]).size!==3||!e.groundNets.has(l)||e.powerNets.has(l)||e.isRail(o)||e.isRail(c))return;let s=(e.portsByNet.get(o)??[]).filter((tt)=>tt.source_component_id!==t);if(s.length!==1)return;let p=s[0].source_component_id,d=e.components.get(p),m=e.placement(p),y=e.twoTerminalNets(p)?.find((tt)=>tt!==o);if(d?.ftype!=="simple_resistor"||d.resistance<=0||!m||!e.sameLocalScope(r,m)||!y||e.isRail(y)||y===c)return;let f=(e.portsByNet.get(c)??[]).filter((tt)=>tt.source_component_id!==t),_=f.filter((tt)=>e.components.get(tt.source_component_id)?.ftype==="simple_chip");if(_.length!==1)return;let x=_[0].source_component_id,Y=e.placement(x),M=e.twoTerminalNets(x)?.find((tt)=>tt!==c);if(!Y||!e.sameLocalScope(r,Y)||!M||!this.positiveNets.has(M)||e.groundNets.has(M))return;let O=f.filter((tt)=>tt.source_component_id!==x);if(O.length!==1)return;let X=O[0].source_component_id,E=e.placement(X),I=e.namedPort(X,"anode"),U=e.namedPort(X,"cathode");if(e.components.get(X)?.ftype!=="simple_diode"||!e.twoTerminalNets(X)||!I||!U||e.connected(I.source_port_id)!==c||e.connected(U.source_port_id)!==M||!E||!e.sameLocalScope(r,E))return;let q=e.port(n),st=e.port(a),H=e.port(i);if(!q||!st||!H)return;let k=q.facing_direction,at=st.facing_direction;if(!k||!at)return;let ot=[];if(r.schY>=Y.schY)ot.push("transistor_not_below_load");if(k!=="up")ot.push("collector_not_up");if(at!=="down")ot.push("emitter_not_down");if(ot.length===0)return;let Z=r.sourceComponentName||"component",N=Y.sourceComponentName||"component";this.issues.push({lineItemType:"LowSideTransistorNotAlignedWithLoad",transistorSchematicBox:r,loadSchematicBox:Y,baseResistorSchematicBox:m,clampDiodeSchematicBox:E,collectorSourcePortId:n.source_port_id,emitterSourcePortId:a.source_port_id,collectorFacingDirection:k,emitterFacingDirection:at,placementProblems:ot,message:`Arrange ${Z} below ${N}, with its collector facing up toward the load and emitter facing down toward ground; place ${m.sourceComponentName||"component"} beside the base. Preserve all pin connections and reroute affected traces.`})}static issueToString(t){let e=[];return S(e,"transistorName",t.transistorSchematicBox.sourceComponentName),S(e,"loadName",t.loadSchematicBox.sourceComponentName),S(e,"baseResistorName",t.baseResistorSchematicBox.sourceComponentName),S(e,"clampDiodeName",t.clampDiodeSchematicBox.sourceComponentName),S(e,"placementProblems",t.placementProblems.join(",")),S(e,"collectorFacingDirection",t.collectorFacingDirection),S(e,"emitterFacingDirection",t.emitterFacingDirection),S(e,"message",t.message),`<LowSideTransistorNotAlignedWithLoad ${e.join(" ")} />`}}class Ir extends ct{params;index;hostIds;reportedPairs=new Set;currentIndex=0;constructor(t){super();this.params=t;this.index=new Bt(t.ctx),this.hostIds=[...this.index.components.values()].filter((e)=>e.ftype==="simple_chip").map((e)=>e.source_component_id),this.solved=this.hostIds.length===0}_step(){let t=this.hostIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.hostIds.length,!t)return;let e=this.index.portsByComponent.get(t)??[],r=e.filter((O)=>wm(O)==="positive"),i=e.filter((O)=>wm(O)==="negative");if(r.length!==1||i.length!==1)return;let n=r[0],a=i[0],o=this.seriesResistor(n),c=this.seriesResistor(a);if(!o||!c||o.axis!==c.axis||!this.index.sameLocalScope(o.placement,c.placement)||new Set([o.hostNet,c.hostNet,o.interfaceNet,c.interfaceNet]).size!==4||!this.shareInterface(o,c,t))return;let l=[o.id,c.id].sort().join("\x00");if(this.reportedPairs.has(l))return;let s=o.placement,p=c.placement,d=o.axis==="horizontal",m=Math.abs(d?s.schX-p.schX:s.schY-p.schY),u=Math.abs(d?s.schY-p.schY:s.schX-p.schX),y=d?s.width:s.height,f=d?p.width:p.height,_=d?s.height:s.width,x=d?p.height:p.width;if(m-(y+f)/2<Math.max(y,f)||u>=(_+x)/2-0.01)return;this.reportedPairs.add(l);let b=s.sourceComponentName||"component",M=p.sourceComponentName||"component";this.params.issues.push({lineItemType:"UsbSeriesResistorsNotAligned",positiveResistorSchematicBox:s,negativeResistorSchematicBox:p,hostSourceComponentId:t,positiveSourcePortId:n.source_port_id,negativeSourcePortId:a.source_port_id,signalAxis:o.axis,message:`Place ${b} (D+) and ${M} (D−) near each other and draw clear traces to their corresponding USB ports. Exact alignment is not required; preserve pin assignments and leave space for labels.`})}seriesResistor(t){let e=this.index,r=e.connected(t.source_port_id);if(e.isRail(r))return;let i=new Set((e.portsByNet.get(r)??[]).filter((u)=>e.components.get(u.source_component_id)?.ftype==="simple_resistor").map((u)=>u.source_component_id));if(i.size!==1)return;let n=[...i][0],o=e.twoTerminalNets(n)?.find((u)=>u!==r),c=e.placement(n);if(!o||e.isRail(o)||!c)return;if((e.portsByNet.get(o)??[]).some((u)=>u.source_component_id!==n&&e.components.get(u.source_component_id)?.ftype==="simple_resistor"))return;let l=e.portsByComponent.get(n).map((u)=>e.port(u)),[s,p]=l;if(!s||!p)return;let d=new Set([s.facing_direction,p.facing_direction]),m;if(d.has("left")&&d.has("right")&&Math.abs(s.center.y-p.center.y)<0.01)m="horizontal";else if(d.has("up")&&d.has("down")&&Math.abs(s.center.x-p.center.x)<0.01)m="vertical";else return;return{id:n,placement:c,hostNet:r,interfaceNet:o,axis:m}}shareInterface(t,e,r){let i=(a)=>new Set((this.index.portsByNet.get(a)??[]).map((o)=>o.source_component_id).filter((o)=>o!==r&&o!==t.id&&o!==e.id&&(this.index.portsByComponent.get(o)?.length??0)>2)),n=i(t.interfaceNet);return[...i(e.interfaceNet)].some((a)=>n.has(a))}static issueToString(t){let e=[];return S(e,"positiveResistorName",t.positiveResistorSchematicBox.sourceComponentName),S(e,"negativeResistorName",t.negativeResistorSchematicBox.sourceComponentName),S(e,"signalAxis",t.signalAxis),S(e,"message",t.message),`<UsbSeriesResistorsNotAligned ${e.join(" ")} />`}}function wm(t){let e=new Set;for(let r of[t.name,...t.port_hints??[]]){let i=r.toUpperCase();if(/^(?:USB_?)?D(?:P|\+|_POS)$/.test(i))e.add("positive");if(/^(?:USB_?)?D(?:M|N|-|_NEG)$/.test(i))e.add("negative")}return e.size===1?[...e][0]:void 0}function Am(t){return t.filter((e)=>e!==void 0).reduce((e,r)=>yn(e,r),{})}function Bm(t,e,r){return{rects:[{center:{x:t.schX,y:t.schY},width:t.width,height:t.height,stroke:e,fill:e.replace("0.95","0.15"),label:r}]}}function Fm(t){return{rects:t.filter((r)=>r.type==="schematic_box").map((r)=>{let i=r;return{center:{x:i.x,y:i.y},width:i.width,height:i.height,stroke:"hsl(0,0%,60%)"}})}}class re extends ct{static EPSILON=0.01;static ORIENTATION_MESSAGE='Use schOrientation="vertical" on this capacitor to fix the symbol orientation';ctx;out;schematicComponentById;sourceComponentById;capacitorPlacements;feedbackCapacitorIds;currentPlacementIndex=0;horizontalSymbolNames=new Set(["capacitor_left","capacitor_right"]);constructor({ctx:t,issues:e}){super();this.ctx=t,this.out=e,this.schematicComponentById=this.buildSchematicComponentById(t.circuitJson),this.sourceComponentById=this.buildSourceComponentById(t.circuitJson),this.capacitorPlacements=this.getCapacitorPlacements();let r=new Bt(t);this.feedbackCapacitorIds=new Set(this.capacitorPlacements.flatMap((i)=>i.sourceComponentId&&r.isDirectOpAmpFeedback(i.sourceComponentId)?[i.sourceComponentId]:[])),this.solved=this.capacitorPlacements.length===0}getCapacitorPlacements(){return this.ctx.componentPlacements.filter((t)=>t.sourceComponentId!==void 0&&this.sourceComponentById.get(t.sourceComponentId)?.ftype==="simple_capacitor").map((t)=>({schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}))}_step(){let t=this.capacitorPlacements[this.currentPlacementIndex];if(!t){this.solved=!0;return}this.currentPlacementIndex+=1,this.solved=this.currentPlacementIndex>=this.capacitorPlacements.length;let e=this.getIssueForPlacement(t);if(e)this.out.push(e)}visualize(){let t=this.getFocusedPlacement();return Am([Fm(this.ctx.circuitJson),t?Bm(t,"hsl(210, 100%, 50%, 0.95)","capacitorOrientation"):void 0])}getFocusedPlacement(){if(this.capacitorPlacements.length===0)return;let t=this.iterations===0?this.currentPlacementIndex:Math.max(0,this.currentPlacementIndex-1);return this.capacitorPlacements[t]}buildSchematicComponentById(t){return new Map(t.filter((e)=>e.type==="schematic_component").map((e)=>[e.schematic_component_id,e]))}buildSourceComponentById(t){return new Map(t.flatMap((e)=>{if(e.type!=="source_component"||!("source_component_id"in e)||typeof e.source_component_id!=="string")return[];return[{type:"source_component",source_component_id:e.source_component_id,ftype:"ftype"in e&&typeof e.ftype==="string"?e.ftype:void 0}]}).map((e)=>[e.source_component_id,e]))}createIssuePlacement(t){return{positionAnchor:"center",schX:t.schX,schY:t.schY,width:t.width,height:t.height,sourceComponentId:t.sourceComponentId,sourceComponentName:t.sourceComponentName,schematicComponentId:t.schematicComponentId,schematicSheetId:t.schematicSheetId,schematicSheetName:t.schematicSheetName}}getIssueForPlacement(t){if(!t.schematicComponentId||!t.sourceComponentId)return;let e=this.schematicComponentById.get(t.schematicComponentId);if(!e)return;if(!this.horizontalSymbolNames.has(e.symbol_name??""))return;if(this.feedbackCapacitorIds.has(t.sourceComponentId))return;if(this.isInlineWithHorizontalTraces(t.schematicComponentId))return;return{lineItemType:"CapacitorSymbolHorizontal",schematicBox:this.createIssuePlacement(t),message:re.ORIENTATION_MESSAGE}}isInlineWithHorizontalTraces(t){let e=this.ctx.circuitJson.filter((i)=>i.type==="schematic_port"&&i.schematic_component_id===t);if(e.length!==2)return!1;let r=e.map((i)=>this.getOutwardHorizontalTrace(i));return r.every((i)=>i!==void 0)&&r.some((i)=>i!==void 0&&i.edges.every((n)=>Math.abs(n.from.y-n.to.y)<=re.EPSILON))}getOutwardHorizontalTrace(t){if(t.facing_direction!=="left"&&t.facing_direction!=="right")return;return this.ctx.circuitJson.find((e)=>e.type==="schematic_trace"&&e.schematic_sheet_id===t.schematic_sheet_id&&e.edges.some((r)=>{let i=this.pointsEqual(r.from,t.center)?r.to:this.pointsEqual(r.to,t.center)?r.from:void 0;return i!==void 0&&Math.abs(i.y-t.center.y)<=re.EPSILON&&(t.facing_direction==="left"?i.x<t.center.x-re.EPSILON:i.x>t.center.x+re.EPSILON)}))}pointsEqual(t,e){return Math.abs(t.x-e.x)<=re.EPSILON&&Math.abs(t.y-e.y)<=re.EPSILON}static issueToString(t){let e=[];return S(e,"componentName",t.schematicBox.sourceComponentName),S(e,"schX",t.schematicBox.schX),S(e,"schY",t.schematicBox.schY),S(e,"width",t.schematicBox.width),S(e,"height",t.schematicBox.height),S(e,"message",t.message),`<CapacitorSymbolHorizontal ${e.join(" ")} />`}}class Je extends ct{params;static MIN_BODY_GAP=4;banks=[];netNames=new Map;bankIndex=0;constructor(t){super();this.params=t;let e=new Bt(t.ctx),r=new Set(e.powerNets),i=new Set(e.groundNets);for(let n of t.ctx.circuitJson)if(n.type==="source_net"){let a=e.connected(n.source_net_id);if(!this.netNames.has(a))this.netNames.set(a,n.name)}for(let n of e.portsByComponent.values())for(let a of n){if(a.do_not_connect)continue;let o=e.connected(a.source_port_id);if(a.provides_power||a.requires_power)r.add(o);if(a.provides_ground||a.requires_ground)i.add(o);if((r.has(o)||i.has(o))&&!this.netNames.has(o))this.netNames.set(o,a.name)}for(let n of e.components.values()){if(n.ftype!=="simple_capacitor")continue;let a=n.source_component_id,o=e.placement(a),c=e.twoTerminalNets(a),l=e.portsByComponent.get(a);if(!o||!c||!l||l.some((m)=>{let u=e.port(m);return m.do_not_connect||!u||u.schematic_sheet_id!==o.schematicSheetId}))continue;let s=c.find((m)=>r.has(m)&&!i.has(m)),p=c.find((m)=>i.has(m)&&!r.has(m));if(!s||!p)continue;let d=this.banks.find((m)=>m.power===s&&m.ground===p&&e.sameLocalScope(m.capacitors[0],o));if(d)d.capacitors.push(o);else this.banks.push({power:s,ground:p,capacitors:[o]})}this.solved=this.banks.length===0}_step(){let t=this.banks[this.bankIndex++];if(this.solved=this.bankIndex>=this.banks.length,t.capacitors.length<2)return;let e=Math.max(Je.MIN_BODY_GAP,...t.capacitors.map((a)=>3*Math.max(a.width,a.height))),r=0;for(let a=0;a<t.capacitors.length;a++)for(let o of t.capacitors.slice(a+1)){let c=t.capacitors[a],l=Math.hypot(Math.max(0,Math.abs(c.schX-o.schX)-(c.width+o.width)/2),Math.max(0,Math.abs(c.schY-o.schY)-(c.height+o.height)/2));r=Math.max(r,l)}if(r<=e+0.000001)return;let i=this.netNames.get(t.power)??"power",n=this.netNames.get(t.ground)??"ground";this.params.issues.push({lineItemType:"DecouplingCapacitorsNotCloseTogether",railName:i,groundName:n,capacitorSchematicBoxes:t.capacitors,maxBodyGap:r,maxRecommendedBodyGap:e,message:`Group the decoupling capacitors between ${i} and ${n} closer together in this schematic block. Preserve their net connections.`})}static issueToString(t){let e=[];return S(e,"rail",t.railName),S(e,"ground",t.groundName),S(e,"capacitorNames",t.capacitorSchematicBoxes.map((r)=>r.sourceComponentName||"component").join(", ")),S(e,"maxBodyGap",t.maxBodyGap),S(e,"maxRecommendedBodyGap",t.maxRecommendedBodyGap),S(e,"message",t.message),`<DecouplingCapacitorsNotCloseTogether ${e.join(" ")} />`}}function Mr(t){let e=t.anchor_side;if(e==="top"||e==="bottom"){let l=t.anchor_position?.y??t.center.y,s=(t.text?.length??8)*0.13/2+0.1,p=t.center.x-0.1,d=t.center.x+0.1;if(e==="top")return{left:p,right:d,top:l,bottom:l-s*2};return{left:p,right:d,top:l+s*2,bottom:l}}let i=t.anchor_position?.x??t.center.x,a=Math.abs(t.center.x-i)+0.1,o=t.center.y+0.1,c=t.center.y-0.1;if(t.center.x>=i)return{left:i,right:t.center.x+a,top:o,bottom:c};return{left:t.center.x-a,right:i,top:o,bottom:c}}class Re extends ct{params;placements;netLabelsByComponentId;rawCollisions=[];firstIndex=0;secondIndex=1;constructor(t){super();this.params=t;this.placements=t.ctx.componentPlacements,this.netLabelsByComponentId=this.buildNetLabelsByComponentId(t.ctx.circuitJson),this.solved=this.placements.length<2}_step(){if(this.firstIndex>=this.placements.length-1){this.buildAndPushIssues(),this.solved=!0;return}let t=this.placements[this.firstIndex],e=this.placements[this.secondIndex];if(this.detectPair(t,e),this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1}detectPair(t,e){if(t.schematicSheetId!==e.schematicSheetId)return;this.rawCollisions.push(...this.detectLabelLabel(t,e)),this.rawCollisions.push(...this.detectBoxLabel(t,e)),this.rawCollisions.push(...this.detectBoxLabel(e,t))}detectLabelLabel(t,e){let r=t,i=e;if(t.schX>e.schX)r=e,i=t;let n=r.schematicComponentId,a=i.schematicComponentId;if(!n||!a)return[];let o=this.netLabelsByComponentId.get(n)??[],c=this.netLabelsByComponentId.get(a)??[];if(o.length===0||c.length===0)return[];let l=[];for(let s of o)for(let p of c){let d=Mr(s),m=Mr(p);if(Ke(d,m))l.push({type:"label-label",bounds:{left:Math.max(d.left,m.left),right:Math.min(d.right,m.right),top:Math.min(d.top,m.top),bottom:Math.max(d.bottom,m.bottom)},leftComp:r,rightComp:i,leftId:n,rightId:a,xSeparation:d.right-m.left+0.1})}return l}detectBoxLabel(t,e){let r=t.schematicComponentId,i=e.schematicComponentId;if(!r||!i)return[];let n=this.netLabelsByComponentId.get(i)??[];if(n.length===0)return[];let a=Ut(t.schX,t.schY,t.width,t.height),o=t.schX<=e.schX,c=[];for(let l of n){let s=Mr(l);if(!Ke(a,s))continue;let p;if(o)p=a.right-s.left+0.1;else p=s.right-a.left+0.1;c.push({type:"box-label",bounds:{left:Math.max(a.left,s.left),right:Math.min(a.right,s.right),top:Math.min(a.top,s.top),bottom:Math.max(a.bottom,s.bottom)},boxComp:t,labelComp:e,boxId:r,labelId:i,xSeparation:p})}return c}buildAndPushIssues(){if(this.rawCollisions.length===0)return;let t=new Map;for(let e of this.rawCollisions){let i=(e.type==="label-label"?e.leftComp:e.boxComp).schematicSheetId??"",n=t.get(i);if(n)n.push(e);else t.set(i,[e])}for(let e of t.values())this.buildAndPushIssueForSheet(e)}buildAndPushIssueForSheet(t){let e=this.computeGlobalFixes(t);if(e.size===0)return;let r=new Set,i=[];for(let o of t){let c,l;if(o.type==="label-label")c=o.leftComp.sourceComponentName??"",l=o.rightComp.sourceComponentName??"";else c=o.boxComp.sourceComponentName??"",l=o.labelComp.sourceComponentName??"";let s=`${c}/${l}`;if(!r.has(s))r.add(s),i.push({comp1Name:c,comp2Name:l})}let n=t[0],a=n.type==="label-label"?n.leftComp:n.boxComp;this.params.issues.push({lineItemType:"NetLabelCollision",schematicSheetId:a.schematicSheetId,schematicSheetName:a.schematicSheetName,pairs:i,collisionBounds:t.map((o)=>o.bounds),moves:Array.from(e.values())})}computeGlobalFixes(t){let e=new Map;for(let s of this.placements)if(s.schematicComponentId)e.set(s.schematicComponentId,s);let r=new Map,i=(s,p,d)=>{let m=e.get(s),u=e.get(p);if(!m||!u)return;let y=u.schX-m.schX+d,f=`${s}|${p}`;r.set(f,Math.max(r.get(f)??0,y))};for(let s of t)if(s.type==="label-label")i(s.leftId,s.rightId,s.xSeparation);else if(s.boxComp.schX<=s.labelComp.schX)i(s.boxId,s.labelId,s.xSeparation);else i(s.labelId,s.boxId,s.xSeparation);let n=[...r.entries()].map(([s,p])=>{let d=s.indexOf("|");return{leftId:s.slice(0,d),rightId:s.slice(d+1),minSep:p}}),a=new Set,o=new Map;for(let{leftId:s,rightId:p}of n){if(a.add(s),a.add(p),!o.has(s))o.set(s,new Set);if(!o.has(p))o.set(p,new Set);o.get(s).add(p),o.get(p).add(s)}let c=new Set,l=new Map;for(let s of a){if(c.has(s))continue;let p=[],d=[s];c.add(s);while(d.length){let _=d.shift();p.push(_);for(let x of o.get(_)??[])if(!c.has(x))c.add(x),d.push(x)}p.sort((_,x)=>(e.get(_)?.schX??0)-(e.get(x)?.schX??0));let m=new Set(p),u=n.filter((_)=>m.has(_.leftId)&&m.has(_.rightId)),y=new Map;for(let _ of p){let x=e.get(_)?.schX??0;for(let{leftId:Y,rightId:b,minSep:M}of u)if(b===_&&y.has(Y))x=Math.max(x,y.get(Y)+M);y.set(_,x)}let f=[...y.entries()].reduce((_,[x,Y])=>_+(Y-(e.get(x)?.schX??0)),0);if(f>0.000000001){let _=f/p.length,x=new Map;for(let b of p){let M=(e.get(b)?.schX??0)-_;for(let{leftId:O,rightId:X,minSep:E}of u)if(X===b&&x.has(O))M=Math.max(M,x.get(O)+E);x.set(b,M)}let Y=(b)=>[...b.entries()].reduce((M,[O,X])=>Math.max(M,Math.abs(X-(e.get(O)?.schX??0))),0);if(Y(x)<Y(y))for(let[b,M]of x)y.set(b,M)}for(let[_,x]of y){let Y=e.get(_);if(!Y||Math.abs(x-Y.schX)<0.000000001)continue;l.set(_,{componentName:Y.sourceComponentName||"component",newSchX:Math.round(x*100)/100,newSchY:Math.round(Y.schY*100)/100})}}return l}buildNetLabelsByComponentId(t){let r=[];for(let n of t){if(n.type!=="schematic_port")continue;let a=n;if(!a.schematic_component_id)continue;r.push({componentId:a.schematic_component_id,cx:a.center.x,cy:a.center.y,schematicSheetId:a.schematic_sheet_id})}let i=new Map;for(let n of t){if(n.type!=="schematic_net_label")continue;let a=n;if(!a.anchor_position)continue;let{x:o,y:c}=a.anchor_position,l=r.filter((m)=>m.schematicSheetId===a.schematic_sheet_id&&Math.hypot(m.cx-o,m.cy-c)<0.0001);if(l.length===0)continue;if(new Set(l.map((m)=>m.componentId)).size!==1)continue;let p=l[0].componentId,d=i.get(p)??[];d.push(a),i.set(p,d)}return i}static netLabelCollisionToString(t){let e=t.pairs.map((i,n)=>`pair${n+1}="${i.comp1Name}/${i.comp2Name}"`).join(" "),r=t.moves.map((i)=>` <Move componentName="${i.componentName}" newSchX="${i.newSchX}" newSchY="${i.newSchY}" />`);return[`<ComponentNetLabelCollision ${e}>`,' <SuggestedFix note="Apply all moves simultaneously. Set schAutoLayoutEnabled on your circuit.">',...r," </SuggestedFix>","</ComponentNetLabelCollision>"].join(`
`)}}class Oe extends ct{static ALIGNMENT_EPSILON=0.01;ctx;out;constructor({ctx:t,issues:e}){super();this.ctx=t,this.out=e}_step(){let t=new Map(this.ctx.circuitJson.filter((i)=>i.type==="schematic_port").map((i)=>[i.schematic_port_id,i])),e=new Map(this.ctx.componentPlacements.flatMap((i)=>i.schematicComponentId?[[i.schematicComponentId,i]]:[])),r=new Map;for(let i of this.ctx.circuitJson.filter((n)=>n.type==="schematic_trace")){let n=this.getTracePinPair(i,t);if(!n)continue;let a=n.firstPort.schematic_component_id,o=n.secondPort.schematic_component_id;if(!a||!o||a===o)continue;let c=a<o?n:{firstPort:n.secondPort,secondPort:n.firstPort},l=[a,o].sort().join("\x00"),s=r.get(l)??[];if(!s.some((d)=>d.firstPort.schematic_port_id===c.firstPort.schematic_port_id&&d.secondPort.schematic_port_id===c.secondPort.schematic_port_id))s.push(c);r.set(l,s)}for(let i of r.values()){let n=this.findVerticalShiftIssue(i,e);if(n)this.out.push(n)}this.solved=!0}getTracePinPair(t,e){let r=t.edges?.[0],i=t.edges?.at(-1);if(!r||!i)return;let n=r.from_schematic_port_id??r.to_schematic_port_id,a=i.to_schematic_port_id??i.from_schematic_port_id,o=[...e.values()],c=n?e.get(n):this.findPortAtPoint(o,r.from,t.schematic_sheet_id),l=a?e.get(a):this.findPortAtPoint(o,i.to,t.schematic_sheet_id);if(!c||!l)return;if(c.schematic_port_id===l.schematic_port_id)return;if(c.schematic_sheet_id!==l.schematic_sheet_id)return;return{firstPort:c,secondPort:l}}findPortAtPoint(t,e,r){let{ALIGNMENT_EPSILON:i}=Oe;return t.find((n)=>n.schematic_sheet_id===r&&Math.abs(n.center.x-e.x)<=i&&Math.abs(n.center.y-e.y)<=i)}findVerticalShiftIssue(t,e){let r=t[0];if(!r)return;let i=e.get(r.firstPort.schematic_component_id),n=e.get(r.secondPort.schematic_component_id);if(!i||!n)return;let[a,o]=i.schX<=n.schX?[i,n]:[n,i],c=t.flatMap((f)=>{let[_,x]=f.firstPort.center.x<=f.secondPort.center.x?[f.firstPort,f.secondPort]:[f.secondPort,f.firstPort];return _.facing_direction==="right"&&x.facing_direction==="left"?[{leftPort:_,rightPort:x}]:[]});if(c.length<2)return;let{ALIGNMENT_EPSILON:l}=Oe,s=c.filter(({leftPort:f,rightPort:_})=>Math.abs(f.center.y-_.center.y)<=l).length,p=[];for(let f of c){let _=f.leftPort.center.y-f.rightPort.center.y;if(Math.abs(_)<=l)continue;let x=p.find((Y)=>Math.abs(Y.deltaSchY-_)<=l);if(x)x.pairs.push(f);else p.push({deltaSchY:_,pairs:[f]})}let d=p.sort((f,_)=>_.pairs.length-f.pairs.length||Math.abs(f.deltaSchY)-Math.abs(_.deltaSchY))[0];if(!d||d.pairs.length<2||d.pairs.length<=s)return;let m=o.sourceComponentName||"component",u=d.deltaSchY,y=o.schY+u;return{lineItemType:"ComponentPinsWouldAlignWithVerticalShift",firstComponent:a,secondComponent:o,targetComponent:o,deltaSchY:u,newSchY:y,currentlyAlignedPinCount:s,alignedPinCount:d.pairs.length,alignedPinPairs:d.pairs.map(({leftPort:f,rightPort:_})=>({firstPin:this.getPinLabel(f),secondPin:this.getPinLabel(_)})),message:`shift ${m} vertically by ${Os(u)} to align ${d.pairs.length} connected pin pairs`}}getPinLabel(t){return t.display_pin_label??t.pin_number?.toString()}static issueToString(t){let e=[];return S(e,"firstComponentName",t.firstComponent.sourceComponentName),S(e,"secondComponentName",t.secondComponent.sourceComponentName),S(e,"targetComponentName",t.targetComponent.sourceComponentName),S(e,"deltaSchY",t.deltaSchY),S(e,"newSchY",t.newSchY),S(e,"currentlyAlignedPinCount",t.currentlyAlignedPinCount),S(e,"alignedPinCount",t.alignedPinCount),S(e,"message",t.message),`<ComponentPinsWouldAlignWithVerticalShift ${e.join(" ")} />`}}class je extends ct{static ALIGNMENT_TOLERANCE=0.1;issues;networks;currentNetworkIndex=0;constructor({ctx:t,issues:e}){super();this.issues=e,this.networks=this.findCrystalLoadNetworks(t),this.solved=this.networks.length===0}_step(){let t=this.networks[this.currentNetworkIndex];if(!t){this.solved=!0;return}this.currentNetworkIndex+=1,this.solved=this.currentNetworkIndex>=this.networks.length;let e=bn(t.newSchX-t.crystal.schX),r=bn(t.newSchY-t.crystal.schY);if(Math.abs(e)<=je.ALIGNMENT_TOLERANCE&&Math.abs(r)<=je.ALIGNMENT_TOLERANCE)return;let i=t.crystal.sourceComponentName??"the crystal",n=t.firstLoadCapacitor.sourceComponentName??"the first load capacitor",a=t.secondLoadCapacitor.sourceComponentName??"the second load capacitor";this.issues.push({lineItemType:"CrystalNotCenteredOverLoadCapacitors",crystalSchematicBox:t.crystal,firstLoadCapacitorSchematicBox:t.firstLoadCapacitor,secondLoadCapacitorSchematicBox:t.secondLoadCapacitor,deltaSchX:e,deltaSchY:r,newSchX:t.newSchX,newSchY:t.newSchY,message:`move ${i} to schX=${t.newSchX}, schY=${t.newSchY} so it is centered between ${n} and ${a} and aligned with their load-side pins`})}findCrystalLoadNetworks(t){let e=new Map,r=new Map,i=new Map,n=new Map(t.componentPlacements.flatMap((c)=>c.sourceComponentId?[[c.sourceComponentId,c]]:[]));for(let c of t.circuitJson){if(c.type==="source_component")e.set(c.source_component_id,{sourceComponentId:c.source_component_id,ftype:"ftype"in c&&typeof c.ftype==="string"?c.ftype:void 0});if(c.type==="source_port"&&typeof c.source_component_id==="string"&&typeof c.subcircuit_connectivity_map_key==="string"){let l={sourcePortId:c.source_port_id,sourceComponentId:c.source_component_id,connectivityKey:c.subcircuit_connectivity_map_key},s=r.get(c.source_component_id)??[];s.push(l),r.set(c.source_component_id,s)}if(c.type==="schematic_port"&&c.source_port_id)i.set(c.source_port_id,c)}let a=new Map;for(let c of e.values()){if(c.ftype!=="simple_capacitor")continue;let l=r.get(c.sourceComponentId)??[];if(l.length!==2)continue;let s=l[0],p=l[1],d=n.get(c.sourceComponentId);if(!d)continue;for(let[m,u]of[[s,p],[p,s]]){let y=i.get(m.sourcePortId);if(!y)continue;let f=a.get(m.connectivityKey)??[];f.push({capacitor:d,loadPort:y,returnConnectivityKey:u.connectivityKey}),a.set(m.connectivityKey,f)}}let o=[];for(let c of e.values()){if(c.ftype!=="simple_crystal"&&c.ftype!=="simple_chip")continue;let l=r.get(c.sourceComponentId)??[];if(l.length!==2||l[0].connectivityKey===l[1].connectivityKey)continue;let s=l[0].connectivityKey,p=l[1].connectivityKey;if(![...r.entries()].some(([b,M])=>b!==c.sourceComponentId&&M.length>2&&M.some((O)=>O.connectivityKey===s)&&M.some((O)=>O.connectivityKey===p)))continue;let m=n.get(c.sourceComponentId);if(!m)continue;let u=a.get(l[0].connectivityKey)??[],y=a.get(l[1].connectivityKey)??[],f=u.flatMap((b)=>y.flatMap((M)=>{if(b.capacitor.sourceComponentId===M.capacitor.sourceComponentId||b.returnConnectivityKey!==M.returnConnectivityKey||b.returnConnectivityKey===s||b.returnConnectivityKey===p||b.capacitor.schematicSheetId!==m.schematicSheetId||M.capacitor.schematicSheetId!==m.schematicSheetId)return[];return[{firstConnection:b,secondConnection:M}]}));if(f.length===0)continue;let _=f.toSorted((b,M)=>Pm(b,m)-Pm(M,m))[0],x=[_.firstConnection.loadPort,_.secondConnection.loadPort],Y=[_.firstConnection.capacitor,_.secondConnection.capacitor].toSorted((b,M)=>b.schX-M.schX);o.push({crystal:m,firstLoadCapacitor:Y[0],secondLoadCapacitor:Y[1],newSchX:bn((x[0].center.x+x[1].center.x)/2),newSchY:bn((x[0].center.y+x[1].center.y)/2)})}return o}static issueToString(t){let e=[];return S(e,"crystalName",t.crystalSchematicBox.sourceComponentName),S(e,"firstLoadCapacitorName",t.firstLoadCapacitorSchematicBox.sourceComponentName),S(e,"secondLoadCapacitorName",t.secondLoadCapacitorSchematicBox.sourceComponentName),S(e,"newSchX",t.newSchX),S(e,"newSchY",t.newSchY),S(e,"deltaSchX",t.deltaSchX,{formatDelta:!0}),S(e,"deltaSchY",t.deltaSchY,{formatDelta:!0}),S(e,"message",t.message),`<CrystalNotCenteredOverLoadCapacitors ${e.join(" ")} />`}}var Pm=(t,e)=>Im(t.firstConnection.capacitor,e)+Im(t.secondConnection.capacitor,e),Im=(t,e)=>Math.hypot(t.schX-e.schX,t.schY-e.schY),bn=(t)=>Math.round(t*100)/100;function zs(t){let e=new Map,r=0;function i(n){for(let[,o]of e)if(o.has(n))return o;let a=new Set;return e.set(`connectivity_net${r++}`,a),a}for(let n of t){let a=null;for(let o of n){if(!a)a=i(o);else if(!a.has(o)){let c=i(o);if(c!==a){for(let l of c)a.add(l);e.delete(Array.from(e.entries()).find(([,l])=>l===c)[0])}}a.add(o)}}return Object.fromEntries(Array.from(e.entries()).map(([n,a])=>[n,Array.from(a)]))}var v2=class{netMap;idToNetMap;constructor(t){this.netMap=t,this.idToNetMap={};for(let[e,r]of Object.entries(t))for(let i of r)this.idToNetMap[i]=e}addConnections(t){for(let e of t){let r=new Set;for(let n of e){let a=this.idToNetMap[n];if(a)r.add(a)}let i;if(r.size===0)i=`connectivity_net${Object.keys(this.netMap).length}`,this.netMap[i]=[];else if(r.size===1)i=r.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;else{i=r.values().next().value??`connectivity_net${Object.keys(this.netMap).length}`;for(let n of r)if(n!==i){this.netMap[i].push(...this.netMap[n]),this.netMap[n]=this.netMap[i];for(let a of this.netMap[i])this.idToNetMap[a]=i}}for(let n of e){if(!this.netMap[i].includes(n))this.netMap[i].push(n);this.idToNetMap[n]=i}}}getIdsConnectedToNet(t){return this.netMap[t]||[]}getNetConnectedToId(t){return this.idToNetMap[t]}areIdsConnected(t,e){if(t===e)return!0;let r=this.getNetConnectedToId(t);if(!r)return!1;let i=this.getNetConnectedToId(e);if(!i)return!1;return r===i||i===t||i===t}areAllIdsConnected(t){let e=this.getNetConnectedToId(t[0]);for(let r of t){let i=this.getNetConnectedToId(r);if(i===void 0)return!1;if(i!==e)return!1}return!0}},vn=(t)=>{let e=[];for(let i of t)if(i.type==="source_trace")e.push([...i.connected_source_port_ids??[],...i.connected_source_net_ids??[]]);else if(i.type==="source_component"){if(i.internally_connected_source_port_ids)for(let n of i.internally_connected_source_port_ids)e.push(n)}else if(i.type==="source_component_internal_connection")e.push(i.source_port_ids);let r=zs(e);return new v2(r)};class he extends ct{static DIODE_FTYPES=new Set(["simple_led","simple_diode"]);ctx;out;schematicTraces;currentIndex=0;sourceConnectivity;sourceComponentFtypeById;sourceComponentIdBySourcePortId;schematicPorts;schematicBoxBySourceComponentId;constructor({ctx:t,issues:e}){super();this.ctx=t,this.out=e;let{circuitJson:r}=t;this.sourceConnectivity=vn(r),this.sourceComponentFtypeById=this.buildSourceComponentFtypeById(r),this.sourceComponentIdBySourcePortId=this.buildSourceComponentIdBySourcePortId(r),this.schematicPorts=r.filter((i)=>i.type==="schematic_port"),this.schematicBoxBySourceComponentId=this.buildSchematicBoxBySourceComponentId(),this.schematicTraces=r.filter((i)=>i.type==="schematic_trace"),this.solved=this.schematicTraces.length===0}_step(){let t=this.schematicTraces[this.currentIndex];if(!t){this.solved=!0;return}if(this.currentIndex++,this.solved=this.currentIndex>=this.schematicTraces.length,!t.edges||t.edges.length===0)return;let e=t.edges[0],r=t.edges[t.edges.length-1];if(!e||!r)return;let i=e.from,n=r.to,a=t.schematic_sheet_id,o=this.findSourceComponentIdNearPoint(i,a),c=this.findSourceComponentIdNearPoint(n,a);if(!o||!c)return;let l=this.sourceComponentFtypeById.get(o),s=this.sourceComponentFtypeById.get(c),{DIODE_FTYPES:p}=he;if(!(p.has(l)&&s==="simple_resistor"||l==="simple_resistor"&&p.has(s)))return;let m=p.has(l)?o:c,u=l==="simple_resistor"?o:c,y=this.schematicBoxBySourceComponentId.get(m),f=this.schematicBoxBySourceComponentId.get(u);if(!y||!f)return;let _=this.findNearestPort(p.has(l)?i:n,a),x=this.findNearestPort(l==="simple_resistor"?i:n,a);if(!_?.center||!x?.center)return;if(!this.sourceConnectivity.areIdsConnected(_.source_port_id,x.source_port_id))return;let Y=y.sourceComponentName||"component",b=f.sourceComponentName||"component",M=_?.display_pin_label??_?.pin_number?.toString(),O=x?.display_pin_label??x?.pin_number?.toString(),X=_?.facing_direction,E=x?.facing_direction,I=M?`${Y}.${M}`:Y,U=O?`${b}.${O}`:b,q=(st)=>({lineItemType:"DiodeResistorNotAligned",diodeSchematicBox:y,resistorSchematicBox:f,diodePin:M,resistorPin:O,diodePinFacingDirection:X,resistorPinFacingDirection:E,message:st});if(!he.isCoLinear(_.center,x.center)){this.out.push(q(`trace has corners — align ${Y} and ${b} on same axis and rotate so ${I} faces ${U}`));return}if(X&&E&&!he.pinsFacingEachOther(_.center,X,x.center,E))this.out.push(q(`${I} and ${U} face away from each other — rotate ${Y} so ${I} faces ${U}`))}static isCoLinear(t,e,r=0.01){return Math.abs(t.x-e.x)<r||Math.abs(t.y-e.y)<r}static pinsFacingEachOther(t,e,r,i){let n=r.x-t.x,a=r.y-t.y,o=e==="right"&&n>0||e==="left"&&n<0||e==="up"&&a>0||e==="down"&&a<0,c=i==="right"&&n<0||i==="left"&&n>0||i==="up"&&a<0||i==="down"&&a>0;return o&&c}static dist(t,e){return Math.sqrt((t.x-e.x)**2+(t.y-e.y)**2)}findNearestPort(t,e){let r,i=1/0;for(let n of this.schematicPorts){if(n.schematic_sheet_id!==e)continue;if(!n.center)continue;let a=he.dist(t,n.center);if(a<i)i=a,r=n}return r}findSourceComponentIdNearPoint(t,e){let r=this.findNearestPort(t,e);if(!r||!r.source_port_id)return;return this.sourceComponentIdBySourcePortId.get(r.source_port_id)}buildSourceComponentFtypeById(t){let e=new Map;for(let r of t)if(r.type==="source_component"&&"source_component_id"in r&&"ftype"in r&&typeof r.ftype==="string")e.set(r.source_component_id,r.ftype);return e}buildSourceComponentIdBySourcePortId(t){let e=new Map;for(let r of t)if(r.type==="source_port"&&"source_port_id"in r&&"source_component_id"in r&&typeof r.source_port_id==="string"&&typeof r.source_component_id==="string")e.set(r.source_port_id,r.source_component_id);return e}buildSchematicBoxBySourceComponentId(){let t=new Map;for(let e of this.ctx.componentPlacements)if(e.sourceComponentId)t.set(e.sourceComponentId,e);return t}static issueToString(t){let e=[];return S(e,"diodeComponentName",t.diodeSchematicBox.sourceComponentName),S(e,"diodePin",t.diodePin),S(e,"resistorComponentName",t.resistorSchematicBox.sourceComponentName),S(e,"resistorPin",t.resistorPin),S(e,"message",t.message),`<DiodeResistorNotAligned ${e.join(" ")} />`}}class qe extends ct{static MIN_BODY_GAP=4;index;amplifierIds;issues;currentIndex=0;constructor({ctx:t,issues:e}){super();this.issues=e,this.index=new Bt(t),this.amplifierIds=[...this.index.components.values()].filter((r)=>r.ftype==="simple_op_amp").map((r)=>r.source_component_id),this.solved=this.amplifierIds.length===0}_step(){let t=this.amplifierIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.amplifierIds.length,!t)return;let e=this.index,r=e.placement(t),i=e.namedPort(t,"output"),n=e.namedPort(t,"inverting_input");if(!r||!i||!n||!e.port(i)||!e.port(n))return;let a=e.connected(i.source_port_id),o=e.connected(n.source_port_id);if(a===o||e.isRail(a)||e.isRail(o))return;if((e.portsByNet.get(o)??[]).some((d)=>d.source_component_id!==t&&e.components.get(d.source_component_id)?.ftype==="simple_op_amp"))return;let c=[],l=new Set;for(let d of e.portsByNet.get(a)??[]){let m=d.source_component_id;if(l.has(m))continue;l.add(m);let u=e.components.get(m);if(u?.ftype!=="simple_resistor"&&u?.ftype!=="simple_capacitor")continue;if(u.ftype==="simple_resistor"&&!(u.resistance>0))continue;let y=e.twoTerminalNets(m);if(!y?.includes(o)||!y.includes(a))continue;let f=e.placement(m);if(!f||!e.sameLocalScope(r,f))return;c.push(f)}let s=c.flatMap((d)=>{let m=S2(r,d),u=Math.max(qe.MIN_BODY_GAP,3*Math.max(d.width,d.height));return m>u?[{schematicBox:d,bodyGap:m,maxRecommendedBodyGap:u}]:[]});if(s.length===0)return;let p=s.map(({schematicBox:d})=>d.sourceComponentName||"component").join(", ");this.issues.push({lineItemType:"FeedbackNetworkNotCompact",amplifierSchematicBox:r,feedbackComponents:c,distantComponents:s,outputSourcePortId:i.source_port_id,invertingInputSourcePortId:n.source_port_id,message:`consider grouping ${p} closer to ${r.sourceComponentName||"component"}, with a compact feedback return path above or below the amplifier`})}static issueToString(t){let e=[];return S(e,"amplifierName",t.amplifierSchematicBox.sourceComponentName),S(e,"feedbackComponentNames",t.feedbackComponents.map((r)=>r.sourceComponentName||"component").join(", ")),S(e,"distantComponentNames",t.distantComponents.map(({schematicBox:r})=>r.sourceComponentName||"component").join(", ")),S(e,"message",t.message),`<FeedbackNetworkNotCompact ${e.join(" ")} />`}}function S2(t,e){return Math.hypot(Math.max(0,Math.abs(t.schX-e.schX)-(t.width+e.width)/2),Math.max(0,Math.abs(t.schY-e.schY)-(t.height+e.height)/2))}function Ds(t){let e=[],r=(i)=>{let n=t.portsByComponent.get(i);if(n?.length!==2)return!1;let a=t.port(n[0]),o=t.port(n[1]);return!!a&&!!o&&Math.abs(a.center.y-o.center.y)<0.01&&Math.abs(a.center.x-o.center.x)>0.01};for(let i of t.components.values()){if(i.ftype!=="simple_resistor"||i.resistance<=0)continue;let n=i.source_component_id,a=t.twoTerminalNets(n);if(!a||a.filter((b)=>t.isRail(b)).length!==1)continue;let o=a.find((b)=>t.isRail(b));if(t.powerNets.has(o)&&t.groundNets.has(o))continue;let c=a.find((b)=>b!==o),l=t.portsByNet.get(c)??[],s=l.filter((b)=>{let M=t.components.get(b.source_component_id)?.ftype;return M==="simple_switch"||M==="simple_push_button"});if(s.length!==1||l.filter((b)=>t.components.get(b.source_component_id)?.ftype==="simple_resistor").length!==1)continue;let p=s[0],d=p.source_component_id,m=t.components.get(d)?.ftype,y=t.twoTerminalNets(d)?.find((b)=>b!==c);if(!y)continue;let f=t.powerNets.has(o)?"up":"down";if(f==="up"?!t.groundNets.has(y)||t.powerNets.has(y):!t.powerNets.has(y)||t.groundNets.has(y))continue;if([n,d].some((b)=>t.portsByComponent.get(b)?.some((M)=>M.do_not_connect)))continue;let _=t.placement(n),x=t.placement(d),Y=t.port(p);if(!_||!x||!Y||!t.sameLocalScope(_,x))continue;e.push({resistor:_,switchBox:x,signalPort:p,signalSchY:Y.center.y,pullDirection:f,horizontalPushbutton:m==="simple_push_button"&&r(n)&&r(d)})}return e}function Sn(t){return new Set(Ds(t).flatMap((e)=>e.horizontalPushbutton?[e.resistor.sourceComponentId,e.switchBox.sourceComponentId]:[]))}class $e extends ct{static MIN_WRONG_SIDE_GAP=1.5;index;resistorIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:e}){super();this.issues=e,this.index=new Bt(t),this.horizontalPushbuttonComponentIds=Sn(this.index),this.resistorIds=[...this.index.components.values()].filter((r)=>r.ftype==="simple_resistor"&&r.resistance>0).map((r)=>r.source_component_id),this.solved=this.resistorIds.length===0}_step(){let t=this.resistorIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.resistorIds.length,!t)return;if(this.horizontalPushbuttonComponentIds.has(t))return;let e=this.index,r=e.placement(t),i=e.twoTerminalNets(t);if(!r||!i)return;let n=i.filter((_)=>e.isRail(_));if(n.length!==1)return;let a=n[0];if(e.powerNets.has(a)&&e.groundNets.has(a))return;let o=e.groundNets.has(a)?"down":"up",c=i.find((_)=>_!==a),l=e.portsByNet.get(c)??[],s=l.filter((_)=>_.needs_external_pullup||_.needs_external_pulldown);if(s.length!==1)return;let p=s[0];if(p.needs_external_pullup&&p.needs_external_pulldown)return;if(o==="up"?!p.needs_external_pullup:!p.needs_external_pulldown)return;let d=e.placement(p.source_component_id),m=e.port(p);if(!d||!m||!e.sameLocalScope(d,r))return;if(l.some((_)=>{let x=_.source_component_id;if(x===t||x===p.source_component_id)return!1;if(e.components.get(x)?.ftype!=="simple_capacitor")return!0;let M=e.twoTerminalNets(x)?.find((X)=>X!==c);if(!M||!e.groundNets.has(M)||e.powerNets.has(M))return!0;let O=e.placement(x);return!O||!e.sameLocalScope(d,O)}))return;let u=m.center.y,y=o==="up"?u-(r.schY+r.height/2):r.schY-r.height/2-u;if(y<=$e.MIN_WRONG_SIDE_GAP)return;let f=o==="up"?"above":"below";this.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:r,hostSchematicBox:d,signalSourcePortId:p.source_port_id,signalPinName:p.name,signalSchY:u,pullDirection:o,preferredSide:f,wrongSideGap:y,maxRecommendedWrongSideGap:$e.MIN_WRONG_SIDE_GAP,message:`consider placing ${r.sourceComponentName||"component"} ${f} ${d.sourceComponentName||"component"}.${p.name} so the pull-${o} branch reads toward ${o==="up"?"power":"ground"}`})}static issueToString(t){let e=[];return S(e,"resistorName",t.resistorSchematicBox.sourceComponentName),S(e,"hostName",t.hostSchematicBox.sourceComponentName),S(e,"signalPin",t.signalPinName),S(e,"pullDirection",t.pullDirection),S(e,"preferredSide",t.preferredSide),S(e,"signalSchY",t.signalSchY),S(e,"wrongSideGap",t.wrongSideGap),S(e,"message",t.message),`<PullResistorOnWrongSide ${e.join(" ")} />`}}class le extends ct{static EPSILON=0.01;index;powerNets;groundNets;positiveVoltageNets=new Set;componentIds;horizontalPushbuttonComponentIds;issues;currentIndex=0;constructor({ctx:t,issues:e}){super();this.issues=e,this.index=new Bt(t),this.horizontalPushbuttonComponentIds=Sn(this.index),this.powerNets=new Set(this.index.powerNets),this.groundNets=new Set(this.index.groundNets);for(let r of t.circuitJson){if(r.type==="source_net"&&r.is_positive_voltage_source)this.positiveVoltageNets.add(this.index.connected(r.source_net_id));if(r.type!=="source_port")continue;let i=this.index.connected(r.source_port_id);if(r.provides_power||r.requires_power)this.powerNets.add(i);if(r.provides_ground||r.requires_ground)this.groundNets.add(i)}this.componentIds=[...this.index.components.keys()].filter((r)=>this.index.portsByComponent.get(r)?.length===2),this.solved=this.componentIds.length===0}_step(){let t=this.componentIds[this.currentIndex++];if(this.solved=this.currentIndex>=this.componentIds.length,!t)return;let e=this.index,r=e.placement(t),i=e.components.get(t),n=e.twoTerminalNets(t);if(!r||!n)return;if(i?.ftype==="simple_inductor"&&!n.some((X)=>this.groundNets.has(X)))return;if(i?.ftype==="simple_diode"&&n.every((X)=>this.powerNets.has(X)))return;if(n.some((X)=>this.powerNets.has(X)&&this.groundNets.has(X)))return;let a=n.map((X)=>this.powerNets.has(X)?"power":this.groundNets.has(X)?"ground":void 0);if(a.every((X)=>X===void 0))return;let o=a.includes("power")?"power":"ground",c=n.flatMap((X,E)=>a[E]===o?[{net:X,index:E}]:[]),l=(c.find(({net:X})=>e.portsByNet.get(X)?.some((E)=>o==="power"?E.provides_power:E.provides_ground))??c.find(({net:X})=>(o==="power"?e.powerNets:e.groundNets).has(X))??c[0]).index,s=n[l],p=e.portsByComponent.get(t),d=p.find((X)=>e.connected(X.source_port_id)===s),m=p.find((X)=>X!==d),u=e.port(d),y=e.port(m);if(!u||!y)return;let f=e.connected(m.source_port_id),_=this.groundNets.has(f),x=i?.ftype==="simple_resistor"&&!this.powerNets.has(f)&&!_;if(this.positiveVoltageNets.has(s)&&(_||x)&&Math.abs(u.center.x-y.center.x)<=le.EPSILON&&u.center.y<y.center.y-le.EPSILON&&u.facing_direction==="down"&&y.facing_direction==="up"){this.issues.push({lineItemType:"TwoPinComponentHasInvertedRails",schematicBox:r,railSourcePortId:d.source_port_id,railPinName:d.name,railType:"power",deltaSchRotation:180,suggestedRailFacingDirection:"up",message:`rotate ${r.sourceComponentName||"component"} by 180° so its positive-supply pin faces up and its ${_?"ground":"signal"} pin faces down; preserve pin connections and reroute attached traces`});return}if(!(Math.abs(u.center.y-y.center.y)<=le.EPSILON&&Math.abs(u.center.x-y.center.x)>le.EPSILON&&(u.facing_direction==="left"&&y.facing_direction==="right"||u.facing_direction==="right"&&y.facing_direction==="left")))return;if(this.horizontalPushbuttonComponentIds.has(t))return;let M=o==="power"?"up":"down",O=u.facing_direction==="left"===(o==="power")?-90:90;this.issues.push({lineItemType:"TwoPinComponentShouldBeVertical",schematicBox:r,railSourcePortId:d.source_port_id,railPinName:d.name,railType:o,deltaSchRotation:O,suggestedRailFacingDirection:M,message:`rotate ${r.sourceComponentName||"component"} by ${O}° so its ${o}-connected pin faces ${M} and the component is vertical`})}static issueToString(t){let e=[];return S(e,"componentName",t.schematicBox.sourceComponentName),S(e,"railPin",t.railPinName),S(e,"railType",t.railType),S(e,"deltaSchRotation",t.deltaSchRotation),S(e,"suggestedRailFacingDirection",t.suggestedRailFacingDirection),S(e,"message",t.message),`<${t.lineItemType} ${e.join(" ")} />`}}var Fi=0.02;function Pi(t,e,r){let i={left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY+t.height/2,bottom:t.schY-t.height/2},n=[];for(let a of e){if(!a.side_of_component)continue;if(!a.display_pin_label)continue;let o=r(a),c=0.075;switch(a.side_of_component){case"left":{let l=i.left+0.1;n.push({side:a.side_of_component,xMin:l,xMax:l+o,yMin:a.center.y-c,yMax:a.center.y+c});break}case"right":{let l=i.right-0.1;n.push({side:a.side_of_component,xMin:l-o,xMax:l,yMin:a.center.y-c,yMax:a.center.y+c});break}case"top":{let l=i.top-0.1;n.push({side:a.side_of_component,xMin:a.center.x-c,xMax:a.center.x+c,yMin:l-o,yMax:l});break}case"bottom":{let l=i.bottom+0.1;n.push({side:a.side_of_component,xMin:a.center.x-c,xMax:a.center.x+c,yMin:l,yMax:l+o});break}}}return n}function An(t,e,r=0.02){return wn(t.xMin,t.xMax,e.xMin,e.xMax,r)&&wn(t.yMin,t.yMax,e.yMin,e.yMax,r)}function wn(t,e,r,i,n=0.02){return Math.min(e,i)-Math.max(t,r)+n>0.000000001}function kr(t){return new Set(t.flatMap((e)=>e.type==="schematic_component"&&e.is_box_with_pins!==!1&&!e.symbol_name&&!e.schematic_symbol_id?[e.schematic_component_id]:[]))}class Cr extends ct{params;MESSAGE="Inner labels are colliding. Increase the schWidth or schHeight.";PIN_NAME_CHARACTER_WIDTH=0.095;FALLBACK_CHARACTER_WIDTH=0.13;entries;placementById;sourcePortById;currentIndex=0;constructor(t){super();this.params=t;let{circuitJson:e,componentPlacements:r}=t.ctx;this.placementById=this.getPlacementBySchematicComponentId(r),this.sourcePortById=this.getSourcePortById(e);let i=kr(e);this.entries=Array.from(this.getPortsBySchematicComponentId(e)).filter(([n])=>i.has(n)),this.solved=this.entries.length===0}_step(){let t=this.entries[this.currentIndex++];if(!t){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[e,r]=t,i=this.placementById.get(e);if(!i)return;let n=Pi(i,r,(o)=>this.estimateLabelLength(o.display_pin_label,this.sourcePortById.get(o.source_port_id)));if(n.length===0)return;let a=this.getCollisionSummary(n);if(a.overlappingSides.length===0)return;this.params.issues.push({lineItemType:"SchematicBoxInnerLabelCollision",schematicBox:i,overlappingSides:a.overlappingSides,message:this.MESSAGE})}static issueToString(t){let e=[];return S(e,"message",t.message),S(e,"componentName",t.schematicBox.sourceComponentName),S(e,"currentSchWidth",t.schematicBox.width),S(e,"currentSchHeight",t.schematicBox.height),S(e,"overlappingSides",t.overlappingSides.join(",")),`<SchematicBoxInnerLabelCollision ${e.join(" ")} />`}isSchematicPort(t){return t.type==="schematic_port"}isSourcePort(t){return t.type==="source_port"}isSchematicSide(t){return t==="left"||t==="right"||t==="top"||t==="bottom"}isPinNameLabel(t,e){if(!e)return!1;return t===e.name||t===String(e.pin_number)||(e.port_hints??[]).includes(t)}estimateLabelLength(t,e){return Array.from(t).length*(this.isPinNameLabel(t,e)?this.PIN_NAME_CHARACTER_WIDTH:this.FALLBACK_CHARACTER_WIDTH)}getSourcePortById(t){return new Map(t.filter((e)=>this.isSourcePort(e)).map((e)=>[e.source_port_id,e]))}getPlacementBySchematicComponentId(t){return new Map(t.filter((e)=>e.schematicComponentId).map((e)=>[e.schematicComponentId,e]))}getPortsBySchematicComponentId(t){let e=new Map;for(let r of t.filter((i)=>this.isSchematicPort(i))){if(!r.schematic_component_id)continue;if(!this.isSchematicSide(r.side_of_component))continue;let i=e.get(r.schematic_component_id);if(i)i.push(r);else e.set(r.schematic_component_id,[r])}return e}getCollisionSummary(t){let e=new Set;for(let r=0;r<t.length;r++)for(let i=r+1;i<t.length;i++){let n=t[r],a=t[i];if(n.side===a.side)continue;if(!An(n,a))continue;e.add(n.side),e.add(a.side)}return{overlappingSides:this.sortSides(Array.from(e))}}sortSides(t){let e={left:0,right:1,top:2,bottom:3};return t.sort((r,i)=>e[r]-e[i])}}class tr extends ct{params;placements;firstIndex=0;secondIndex=1;constructor(t){super();this.params=t;this.placements=t.ctx.componentPlacements,this.solved=this.placements.length<2}_step(){if(this.firstIndex>=this.placements.length-1){this.solved=!0;return}let t=this.getComponentOverlap(this.placements[this.firstIndex],this.placements[this.secondIndex]);if(t)this.params.issues.push(t);if(this.secondIndex++,this.secondIndex>=this.placements.length)this.firstIndex++,this.secondIndex=this.firstIndex+1;this.solved=this.firstIndex>=this.placements.length-1}getCenteredRectBounds(t){return{left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY-t.height/2,bottom:t.schY+t.height/2}}getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:e,overlapWidth:r,overlapHeight:i}){let n=t.width*t.height,a=e.width*e.height,o=n<=a?t:e,c=o===t?e:t,l=o.schX<=c.schX?-r:r,s=o.schY<=c.schY?-i:i;return[{targetComponentName:o.sourceComponentName,deltaSchX:l,deltaSchY:0,newSchX:o.schX+l,newSchY:o.schY},{targetComponentName:o.sourceComponentName,deltaSchX:0,deltaSchY:s,newSchX:o.schX,newSchY:o.schY+s}]}static issueToString(t){let e=[];return S(e,"component1Name",t.firstComponent.sourceComponentName),S(e,"component2Name",t.secondComponent.sourceComponentName),S(e,"component1SchX",t.firstComponent.schX),S(e,"component1SchY",t.firstComponent.schY),S(e,"component2SchX",t.secondComponent.schX),S(e,"component2SchY",t.secondComponent.schY),S(e,"overlapWidth",t.overlapWidth),S(e,"overlapHeight",t.overlapHeight),[`<ComponentOverlap ${e.join(" ")}>`,...t.correctionSuggestions.map(tr.correctionSuggestionToString),"</ComponentOverlap>"].join(`
`)}static correctionSuggestionToString(t){let e=[];if(S(e,"target",t.targetComponentName),t.deltaSchX!==0)S(e,"newSchX",t.newSchX),S(e,"deltaSchX",t.deltaSchX,{formatDelta:!0});if(t.deltaSchY!==0)S(e,"newSchY",t.newSchY),S(e,"deltaSchY",t.deltaSchY,{formatDelta:!0});return`<OverlapCorrectionSuggestion ${e.join(" ")} />`}getComponentOverlap(t,e){if(t.schematicSheetId!==e.schematicSheetId)return null;let r=this.getCenteredRectBounds(t),i=this.getCenteredRectBounds(e),n=Math.min(r.right,i.right)-Math.max(r.left,i.left),a=Math.min(r.bottom,i.bottom)-Math.max(r.top,i.top);if(n<=0||a<=0)return null;return{lineItemType:"ComponentOverlap",firstComponent:t,secondComponent:e,overlapWidth:n,overlapHeight:a,correctionSuggestions:this.getOverlapCorrectionSuggestions({firstComponent:t,secondComponent:e,overlapWidth:n,overlapHeight:a})}}}function Bn(t,e){let r;for(let i of t){if(i.type!=="schematic_path"&&i.type!=="schematic_circle"&&i.type!=="schematic_rect"||i.schematic_component_id!==e)continue;let n=(i.stroke_width??0.02)/2,a;if(i.type==="schematic_path"){if(!i.points.length)continue;a={xMin:Math.min(...i.points.map((o)=>o.x)),xMax:Math.max(...i.points.map((o)=>o.x)),yMin:Math.min(...i.points.map((o)=>o.y)),yMax:Math.max(...i.points.map((o)=>o.y))}}else{let o=i.type==="schematic_rect"?(i.rotation??0)*Math.PI/180:0,c=i.type==="schematic_circle"?2*i.radius:i.width,l=i.type==="schematic_circle"?2*i.radius:i.height,s=(Math.abs(c*Math.cos(o))+Math.abs(l*Math.sin(o)))/2,p=(Math.abs(c*Math.sin(o))+Math.abs(l*Math.cos(o)))/2;a={xMin:i.center.x-s,xMax:i.center.x+s,yMin:i.center.y-p,yMax:i.center.y+p}}a.xMin-=n,a.xMax+=n,a.yMin-=n,a.yMax+=n,r=r?{xMin:Math.min(r.xMin,a.xMin),xMax:Math.max(r.xMax,a.xMax),yMin:Math.min(r.yMin,a.yMin),yMax:Math.max(r.yMax,a.yMax)}:a}return r}var Cm=0.2,Yr=(t)=>Array.from(t.display_pin_label??"").length*0.095;function Fn(t,e,r,i,n=0,a){if(!Number.isFinite(r)||r<=0)return;if(e.some((f)=>!f.side_of_component))return;if(!km(t,e,Fi,a))return;let o=0,c=0;for(let f of e)if(f.side_of_component==="left"||f.side_of_component==="right")c=Math.max(c,2*(Math.abs(f.center.y-t.schY)+r));else o=Math.max(o,2*(Math.abs(f.center.x-t.schX)+r));let l=i.width===void 0?t.width:Math.max(i.width,o,Mm(t,e,"width",a)),s=i.height===void 0?t.height:Math.max(i.height,c,Mm(t,e,"height",a)),p=(f)=>f>0.000000001&&f>=n-0.000000001,d=p(t.width-l)?l:void 0,m=p(t.height-s)?s:void 0;if(d===void 0&&m===void 0)return;let u=[{width:d,height:m}];if(d!==void 0&&m!==void 0)u.push({width:d},{height:m});let y=(f)=>(f.width??t.width)*(f.height??t.height);return u.sort((f,_)=>y(f)-y(_)),u.find((f)=>km({...t,width:f.width??t.width,height:f.height??t.height},e,Cm,a))}function Mm(t,e,r,i){let n=t[r],a=r==="width"?t.schX:t.schY,o=r==="width"?"xMin":"yMin",c=r==="width"?"xMax":"yMax",l=r==="width"?"yMin":"xMin",s=r==="width"?"yMax":"xMax",p=(y)=>{if(r==="width")return y.side==="left"?-0.5:y.side==="right"?0.5:0;return y.side==="bottom"?-0.5:y.side==="top"?0.5:0},d=0,m=(y,f,_=0)=>{if(f>0)d=Math.max(d,n+(_-y)/f)},u=Pi(t,e,Yr);if(i)u.push(i);for(let y=0;y<u.length;y++){let f=u[y];m(f[o]-(a-n/2),p(f)+0.5),m(a+n/2-f[c],0.5-p(f));for(let _=y+1;_<u.length;_++){let x=u[_],Y=f.side&&x.side&&f.side!==x.side?Cm:Fi;if(!wn(f[l],f[s],x[l],x[s],Y))continue;let[b,M]=f[c]<=x[o]?[f,x]:[x,f];m(M[o]-b[c],p(M)-p(b),Y)}}return d}function km(t,e,r=Fi,i){if(!Number.isFinite(t.width)||!Number.isFinite(t.height))return!1;let n=Pi(t,e,Yr);if(i)n.push(i);for(let a=0;a<n.length;a++){let o=n[a];if(o.xMin<t.schX-t.width/2-0.000000001||o.xMax>t.schX+t.width/2+0.000000001||o.yMin<t.schY-t.height/2-0.000000001||o.yMax>t.schY+t.height/2+0.000000001)return!1;for(let c=a+1;c<n.length;c++){let l=n[c],s=o.side&&l.side&&o.side!==l.side?r:Fi;if(An(o,l,s))return!1}}return!0}class er extends ct{params;SCHEMATIC_BOX_TOO_WIDE_MESSAGE="Shrink schematic box width";PIN_HEADER_MAX_ALLOWED_GAP=0.1;GENERIC_MAX_ALLOWED_GAP=1;PIN_LABEL_EDGE_PADDING=0.1;GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourceComponentById;currentIndex=0;constructor(t){super();this.params=t;let{circuitJson:e,componentPlacements:r}=t.ctx;this.placementById=this.getPlacementBySchematicComponentId(r),this.schematicComponentById=new Map(e.filter((n)=>n.type==="schematic_component").map((n)=>[n.schematic_component_id,n])),this.sourceComponentById=this.getSourceComponentById(e);let i=kr(e);this.entries=Array.from(this.getPortsBySchematicComponentId(e)).filter(([n])=>i.has(n)),this.solved=this.entries.length===0}_step(){let t=this.entries[this.currentIndex++];if(!t){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[e,r]=t,i=this.placementById.get(e);if(!i)return;let n=this.getCenteredRectBounds(i),a=this.getLabelColumn("left",r),o=this.getLabelColumn("right",r),c=this.getSourceComponentFtype(i,this.sourceComponentById),l;if(a&&o)l=this.getInnerLabelEdge(n,o)-this.getInnerLabelEdge(n,a);else if(a&&a.labelCount>=4)l=n.right-this.getInnerLabelEdge(n,a);else if(o&&o.labelCount>=4)l=this.getInnerLabelEdge(n,o)-n.left;if(l===void 0)return;let s=c==="simple_pin_header"?this.PIN_HEADER_MAX_ALLOWED_GAP:this.GENERIC_MAX_ALLOWED_GAP;if(!this.exceedsMaxAllowedGap(l,s))return;let p=this.getSuggestedWidth({measuredInnerLabelHorizontalEmptySpace:l,maxAllowedInnerLabelHorizontalEmptySpace:s,currentWidth:i.width}),d=this.schematicComponentById.get(e)?.pin_spacing;if(d===void 0)return;let m=Fn(i,r,d,{width:p},0,Bn(this.params.ctx.circuitJson,e));if(m?.width===void 0)return;let u=m.width;if(c==="simple_pin_header")this.params.issues.push({lineItemType:"PinHeaderSchematicBoxTooWide",schematicBox:i,measuredInnerLabelHorizontalEmptySpace:l,maxAllowedInnerLabelHorizontalEmptySpace:s,suggestedSchWidth:u,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE});else this.params.issues.push({lineItemType:"GenericSchematicBoxTooWide",schematicBox:i,measuredInnerLabelHorizontalEmptySpace:l,maxAllowedInnerLabelHorizontalEmptySpace:s,suggestedSchWidth:u,message:this.SCHEMATIC_BOX_TOO_WIDE_MESSAGE})}static issueToString(t){let e=[];return S(e,"message",t.message),S(e,"componentName",t.schematicBox.sourceComponentName),S(e,"currentSchWidth",t.schematicBox.width),S(e,"measuredInnerLabelHorizontalEmptySpace",t.measuredInnerLabelHorizontalEmptySpace),S(e,"maxAllowedInnerLabelHorizontalEmptySpace",t.maxAllowedInnerLabelHorizontalEmptySpace),S(e,"suggestedSchWidth",t.suggestedSchWidth),`<${t.lineItemType} ${e.join(" ")} />`}isSchematicPort(t){return t.type==="schematic_port"}getSourceComponentWithFtype(t){if(t.type!=="source_component"||!("source_component_id"in t)||typeof t.source_component_id!=="string")return null;return{type:"source_component",source_component_id:t.source_component_id,ftype:"ftype"in t&&typeof t.ftype==="string"?t.ftype:void 0}}exceedsMaxAllowedGap(t,e){return t-e>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(t){return{left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY+t.height/2,bottom:t.schY-t.height/2}}getSourceComponentById(t){return new Map(t.flatMap((e)=>{let r=this.getSourceComponentWithFtype(e);return r?[r]:[]}).map((e)=>[e.source_component_id,e]))}getPlacementBySchematicComponentId(t){return new Map(t.filter((e)=>e.schematicComponentId).map((e)=>[e.schematicComponentId,e]))}getPortsBySchematicComponentId(t){let e=new Map;for(let r of t.filter((i)=>this.isSchematicPort(i))){if(!r.schematic_component_id)continue;let i=e.get(r.schematic_component_id);if(i)i.push(r);else e.set(r.schematic_component_id,[r])}return e}getSourceComponentFtype(t,e){return t.sourceComponentId?e.get(t.sourceComponentId)?.ftype:void 0}getLabelColumn(t,e){let r=e.filter((i)=>i.side_of_component===t).flatMap((i)=>i.display_pin_label?[Yr(i)]:[]);if(r.length===0)return null;return{side:t,labelCount:r.length,maxLabelWidth:Math.max(...r)}}getInnerLabelEdge(t,e){return e.side==="left"?t.left+this.PIN_LABEL_EDGE_PADDING+e.maxLabelWidth:t.right-this.PIN_LABEL_EDGE_PADDING-e.maxLabelWidth}getSuggestedWidth(t){return t.currentWidth-t.measuredInnerLabelHorizontalEmptySpace+t.maxAllowedInnerLabelHorizontalEmptySpace}}class Lr extends ct{params;MESSAGE="Move schematic pins closer to the box edge or change the schematic box";GAP_COMPARISON_EPSILON=0.000000001;entries;placementById;schematicComponentById;sourcePortById;currentIndex=0;constructor(t){super();this.params=t;let{circuitJson:e,componentPlacements:r}=t.ctx;this.placementById=this.getPlacementBySchematicComponentId(r),this.schematicComponentById=this.getSchematicComponentById(e),this.sourcePortById=this.getSourcePortById(e);let i=kr(e);this.entries=Array.from(this.getPortsBySchematicComponentId(e)).filter(([n])=>i.has(n)),this.solved=this.entries.length===0}_step(){let t=this.entries[this.currentIndex++];if(!t){this.solved=!0;return}this.solved=this.currentIndex>=this.entries.length;let[e,r]=t,i=this.placementById.get(e);if(!i)return;let n=this.getPinSpacing(i,this.schematicComponentById);if(n===null)return;let a=this.getMaxLabelLengthBySide(r),o=new Map;for(let f of r){if(!this.isSchematicSide(f.side_of_component))continue;let _=o.get(f.side_of_component)??[];_.push(f),o.set(f.side_of_component,_)}let c=[];for(let[f,_]of o){if(_.length===1)continue;for(let x of this.getBoxEdgeSidesForPinSide(f)){let Y=this.getOuterPinBySide(x,_);if(!Y)continue;let b=this.getPinPaddingToEdge(i,Y,x),M=Math.max(n,this.getMaxAllowedPinPadding(n,x,a));if(!this.exceedsMaxAllowedGap(b,M+n))continue;c.push({schematicBox:i,pinSide:f,edgeSide:x,pinName:this.getPinName(Y,this.sourcePortById),measuredPadding:b,maxAllowedPadding:M})}}if(!c.length)return;let l=c.map((f)=>this.createIssue(f)),s=l.flatMap((f)=>f.suggestedSchWidth===void 0?[]:[f.suggestedSchWidth]),p=l.flatMap((f)=>f.suggestedSchHeight===void 0?[]:[f.suggestedSchHeight]),d=Fn(i,r,n,{width:s.length?Math.max(...s):void 0,height:p.length?Math.max(...p):void 0},2*n,Bn(this.params.ctx.circuitJson,e));if(!d)return;let m=l.filter((f)=>d.width!==void 0&&f.suggestedSchWidth!==void 0||d.height!==void 0&&f.suggestedSchHeight!==void 0),u=m.reduce((f,_)=>_.excessPadding>f.excessPadding?_:f),y=[d.width===void 0?"":"width",d.height===void 0?"":"height"].filter(Boolean).join(" and ");this.params.issues.push({...u,paddingDetails:m.map(({pinSide:f,edgeSide:_,pinName:x,measuredPadding:Y,maxAllowedPadding:b,excessPadding:M})=>({pinSide:f,edgeSide:_,pinName:x,measuredPadding:Y,maxAllowedPadding:b,excessPadding:M})),suggestedSchWidth:d.width,suggestedSchHeight:d.height,message:`${this.MESSAGE} ${y}`})}static issueToString(t){let e=[];if(S(e,"message",t.message),S(e,"componentName",t.schematicBox.sourceComponentName),t.paddingDetails)S(e,"pinSides",[...new Set(t.paddingDetails.map((r)=>r.pinSide))].join(",")),S(e,"edgeSides",[...new Set(t.paddingDetails.map((r)=>r.edgeSide))].join(","));else S(e,"pinSide",t.pinSide),S(e,"edgeSide",t.edgeSide),S(e,"pinName",t.pinName),S(e,"measuredPadding",t.measuredPadding),S(e,"maxAllowedPadding",t.maxAllowedPadding),S(e,"excessPadding",t.excessPadding);return S(e,"suggestedSchWidth",t.suggestedSchWidth),S(e,"suggestedSchHeight",t.suggestedSchHeight),`<SchematicPinPaddingToEdgeTooLarge ${e.join(" ")} />`}isSchematicPort(t){return t.type==="schematic_port"}isSourcePort(t){return t.type==="source_port"}isSchematicComponent(t){return t.type==="schematic_component"}isHorizontalSide(t){return t==="left"||t==="right"}isVerticalSide(t){return t==="top"||t==="bottom"}isSchematicSide(t){return this.isHorizontalSide(t)||this.isVerticalSide(t)}exceedsMaxAllowedGap(t,e){return t-e>this.GAP_COMPARISON_EPSILON}getCenteredRectBounds(t){return{left:t.schX-t.width/2,right:t.schX+t.width/2,top:t.schY+t.height/2,bottom:t.schY-t.height/2}}getSourcePortById(t){return new Map(t.filter((e)=>this.isSourcePort(e)).map((e)=>[e.source_port_id,e]))}getSchematicComponentById(t){return new Map(t.filter((e)=>this.isSchematicComponent(e)).map((e)=>[e.schematic_component_id,e]))}getPlacementBySchematicComponentId(t){return new Map(t.filter((e)=>e.schematicComponentId).map((e)=>[e.schematicComponentId,e]))}getPortsBySchematicComponentId(t){let e=new Map;for(let r of t.filter((i)=>this.isSchematicPort(i))){if(!r.schematic_component_id)continue;let i=e.get(r.schematic_component_id);if(i)i.push(r);else e.set(r.schematic_component_id,[r])}return e}getPinSpacing(t,e){if(!t.schematicComponentId)return null;let r=e.get(t.schematicComponentId);return typeof r?.pin_spacing==="number"?r.pin_spacing:null}getPinName(t,e){let r=e.get(t.source_port_id);if(r?.name)return r.name;if(t.display_pin_label)return t.display_pin_label;if(r?.pin_number!==void 0)return String(r.pin_number);return}getMaxLabelLengthBySide(t){let e={left:0,right:0,top:0,bottom:0};for(let r of t){if(!this.isSchematicSide(r.side_of_component))continue;if(!r.display_pin_label)continue;e[r.side_of_component]=Math.max(e[r.side_of_component],Yr(r))}return e}getOuterPinBySide(t,e){if(e.length===0)return null;switch(t){case"top":return e.reduce((r,i)=>i.center.y>r.center.y?i:r);case"bottom":return e.reduce((r,i)=>i.center.y<r.center.y?i:r);case"left":return e.reduce((r,i)=>i.center.x<r.center.x?i:r);case"right":return e.reduce((r,i)=>i.center.x>r.center.x?i:r)}}getPinPaddingToEdge(t,e,r){let i=this.getCenteredRectBounds(t);switch(r){case"top":return Math.max(0,i.top-e.center.y);case"bottom":return Math.max(0,e.center.y-i.bottom);case"left":return Math.max(0,e.center.x-i.left);case"right":return Math.max(0,i.right-e.center.x)}}getBoxEdgeSidesForPinSide(t){return this.isHorizontalSide(t)?["top","bottom"]:["left","right"]}getMaxAllowedPinPadding(t,e,r){let i=this.isHorizontalSide(e)?["left","right"]:["top","bottom"];return(r[i[0]]+r[i[1]]+t)/2}createIssue(t){let e=Math.max(0,t.measuredPadding-t.maxAllowedPadding),r=e*2;return{lineItemType:"SchematicPinPaddingToEdgeTooLarge",pinSide:t.pinSide,edgeSide:t.edgeSide,pinName:t.pinName,schematicBox:t.schematicBox,measuredPadding:t.measuredPadding,maxAllowedPadding:t.maxAllowedPadding,excessPadding:e,suggestedSchWidth:this.isHorizontalSide(t.pinSide)?void 0:Math.max(0,t.schematicBox.width-r),suggestedSchHeight:this.isHorizontalSide(t.pinSide)?Math.max(0,t.schematicBox.height-r):void 0,message:this.isHorizontalSide(t.pinSide)?`${this.MESSAGE} height`:`${this.MESSAGE} width`}}}var Vr={};X1(Vr,{all_layers:()=>Pu,any_circuit_element:()=>d0,any_soup_element:()=>Xr,any_source_component:()=>gu,asset:()=>ic,base_circuit_json_error:()=>Mt,battery_capacity:()=>Gm,brep_shape:()=>kc,cadModelDefaultDirectionMap:()=>k9,cad_component:()=>Gf,cad_model_axis_directions:()=>Uf,cad_model_formats:()=>M9,capacitance:()=>ec,circuit_json_footprint_load_error:()=>bf,current:()=>jr,distance:()=>C,duration_ms:()=>$r,experiment_type:()=>t0,external_footprint_load_error:()=>xf,frequency:()=>or,getZodPrefixedIdWithDefault:()=>T,inductance:()=>Dm,kicadAt:()=>Rn,kicadEffects:()=>Hm,kicadFont:()=>nc,kicadFootprintAttributes:()=>Zm,kicadFootprintMetadata:()=>qm,kicadFootprintModel:()=>Jm,kicadFootprintPad:()=>Km,kicadFootprintProperties:()=>Qm,kicadProperty:()=>Vi,kicadSymbolEffects:()=>ru,kicadSymbolMetadata:()=>nu,kicadSymbolPinNames:()=>eu,kicadSymbolPinNumbers:()=>tu,kicadSymbolProperties:()=>iu,kicadSymbolProperty:()=>ze,layer_ref:()=>St,layer_string:()=>qs,length:()=>K,manufacturing_drc_properties:()=>dy,ms:()=>Vt,ninePointAnchor:()=>Me,parseAndConvertSiUnit:()=>qt,pcbRenderLayer:()=>e9,pcb_autorouting_error:()=>Sf,pcb_board:()=>Oy,pcb_breakout_point:()=>Ff,pcb_component:()=>my,pcb_component_invalid_layer_error:()=>Nf,pcb_component_not_on_board_edge_error:()=>Tf,pcb_component_outside_board_error:()=>Ef,pcb_connector_not_in_accessible_orientation_warning:()=>Af,pcb_copper_pour:()=>Lf,pcb_copper_pour_brep:()=>Cf,pcb_copper_pour_polygon:()=>Yf,pcb_copper_pour_rect:()=>kf,pcb_copper_text:()=>Gy,pcb_courtyard_circle:()=>zf,pcb_courtyard_outline:()=>Xf,pcb_courtyard_overlap_error:()=>hf,pcb_courtyard_pill:()=>Df,pcb_courtyard_polygon:()=>Vf,pcb_courtyard_rect:()=>$f,pcb_cutout:()=>_f,pcb_cutout_circle:()=>uf,pcb_cutout_path:()=>ff,pcb_cutout_polygon:()=>yf,pcb_cutout_rect:()=>mf,pcb_fabrication_note_dimension:()=>nf,pcb_fabrication_note_path:()=>ef,pcb_fabrication_note_rect:()=>rf,pcb_fabrication_note_text:()=>tf,pcb_footprint_overlap_error:()=>pf,pcb_ground_plane:()=>Pf,pcb_ground_plane_region:()=>If,pcb_group:()=>vf,pcb_hole:()=>by,pcb_hole_circle_or_square_shape:()=>c9,pcb_hole_circle_shape:()=>a9,pcb_hole_oval_shape:()=>l9,pcb_hole_pill_shape:()=>p9,pcb_hole_rect_shape:()=>s9,pcb_hole_rotated_pill_shape:()=>h9,pcb_keepout:()=>df,pcb_manual_edit_conflict_warning:()=>wf,pcb_missing_footprint_error:()=>gf,pcb_net:()=>Wy,pcb_note_dimension:()=>lf,pcb_note_line:()=>cf,pcb_note_path:()=>sf,pcb_note_rect:()=>af,pcb_note_text:()=>of,pcb_pad_pad_clearance_error:()=>Of,pcb_pad_trace_clearance_error:()=>jf,pcb_panel:()=>jy,pcb_panelization_placement_error:()=>Xy,pcb_placement_error:()=>$y,pcb_plated_hole:()=>vy,pcb_port:()=>Sy,pcb_port_not_connected_error:()=>Ny,pcb_port_not_matched_error:()=>Ty,pcb_route_hint:()=>py,pcb_route_hints:()=>o9,pcb_silkscreen_circle:()=>Qy,pcb_silkscreen_graphic:()=>Jy,pcb_silkscreen_graphic_brep:()=>Ky,pcb_silkscreen_line:()=>zy,pcb_silkscreen_oval:()=>Zy,pcb_silkscreen_path:()=>Dy,pcb_silkscreen_pill:()=>qy,pcb_silkscreen_rect:()=>Hy,pcb_silkscreen_text:()=>Uy,pcb_smtpad:()=>Ay,pcb_smtpad_pill:()=>wy,pcb_solder_paste:()=>By,pcb_text:()=>Fy,pcb_thermal_spoke:()=>Mf,pcb_trace:()=>Cy,pcb_trace_error:()=>Ly,pcb_trace_hint:()=>Vy,pcb_trace_missing_error:()=>Ey,pcb_trace_route_point:()=>ky,pcb_trace_route_point_through_pad:()=>My,pcb_trace_route_point_via:()=>Iy,pcb_trace_route_point_wire:()=>Py,pcb_trace_warning:()=>Yy,pcb_via:()=>Ry,pcb_via_clearance_error:()=>Wf,pcb_via_trace_clearance_error:()=>Rf,point:()=>it,point3:()=>Pe,point_with_bulge:()=>ly,port_arrangement:()=>ju,position:()=>J2,position3:()=>q2,resistance:()=>Wn,ring:()=>tc,rotation:()=>jt,route_hint_point:()=>hy,schematic_arc:()=>Uu,schematic_box:()=>Tu,schematic_circle:()=>Du,schematic_component:()=>$u,schematic_component_port_arrangement_by_sides:()=>Ou,schematic_component_port_arrangement_by_size:()=>Ru,schematic_debug_line:()=>ty,schematic_debug_object:()=>ry,schematic_debug_object_base:()=>jn,schematic_debug_point:()=>ey,schematic_debug_rect:()=>qu,schematic_error:()=>Ku,schematic_group:()=>oy,schematic_layout_error:()=>Ju,schematic_line:()=>Vu,schematic_manual_edit_conflict_warning:()=>ny,schematic_net_label:()=>Zu,schematic_path:()=>Nu,schematic_pin_styles:()=>Wu,schematic_port:()=>Qu,schematic_rect:()=>zu,schematic_sheet:()=>cy,schematic_symbol:()=>Xu,schematic_table:()=>ay,schematic_table_cell:()=>sy,schematic_text:()=>Hu,schematic_trace:()=>Gu,schematic_voltage_probe:()=>iy,simulation_ac_current_source:()=>Jf,simulation_ac_voltage_source:()=>Qf,simulation_current_probe:()=>s0,simulation_current_source:()=>qf,simulation_dc_current_source:()=>Kf,simulation_dc_voltage_source:()=>Hf,simulation_experiment:()=>r0,simulation_op_amp:()=>l0,simulation_oscilloscope_trace:()=>h0,simulation_spice_subcircuit:()=>p0,simulation_switch:()=>o0,simulation_transient_current_graph:()=>n0,simulation_transient_voltage_graph:()=>i0,simulation_unknown_experiment_error:()=>c0,simulation_voltage_probe:()=>a0,simulation_voltage_source:()=>Zf,size:()=>rc,source_ambiguous_port_reference:()=>Bu,source_board:()=>Au,source_component_base:()=>Yt,source_component_internal_connection:()=>bu,source_component_misconfigured_error:()=>Mc,source_component_pins_underspecified_warning:()=>Yu,source_failed_to_create_component_error:()=>mu,source_group:()=>Su,source_i2c_misconfigured_error:()=>Ic,source_interconnect:()=>fu,source_invalid_component_property_error:()=>Ac,source_manually_placed_via:()=>Iu,source_missing_manufacturer_part_number_warning:()=>Pc,source_missing_property_error:()=>du,source_net:()=>wu,source_no_ground_pin_defined_warning:()=>Cu,source_no_power_pin_defined_warning:()=>ku,source_pcb_ground_plane:()=>Fu,source_pin_attributes:()=>lu,source_pin_missing_trace_warning:()=>Fc,source_pin_must_be_connected_error:()=>Lu,source_port:()=>xu,source_project_metadata:()=>wc,source_property_ignored_warning:()=>uu,source_simple_ammeter:()=>cu,source_simple_battery:()=>hc,source_simple_capacitor:()=>ac,source_simple_chip:()=>lc,source_simple_connector:()=>hu,source_simple_crystal:()=>pu,source_simple_current_source:()=>su,source_simple_diode:()=>On,source_simple_fiducial:()=>ou,source_simple_ground:()=>au,source_simple_inductor:()=>dc,source_simple_led:()=>cc,source_simple_mosfet:()=>bc,source_simple_op_amp:()=>vc,source_simple_pin_header:()=>yc,source_simple_pinout:()=>fc,source_simple_potentiometer:()=>uc,source_simple_power_source:()=>pc,source_simple_push_button:()=>mc,source_simple_resistor:()=>sc,source_simple_resonator:()=>_c,source_simple_switch:()=>Sc,source_simple_test_point:()=>xc,source_simple_transistor:()=>gc,source_simple_voltage_probe:()=>yu,source_simple_voltage_source:()=>_u,source_trace:()=>vu,source_trace_not_connected_error:()=>Bc,source_unnamed_trace_warning:()=>Mu,spice_simulation_options:()=>e0,supplier_footprint_mismatch_warning:()=>Bf,supplier_name:()=>oc,time:()=>K2,timestamp:()=>Um,unknown_error_finding_part:()=>Eu,visible_layer:()=>zt,voltage:()=>Ie,wave_shape:()=>Yc});var Lm=new Map([["T",1000000000000],["G",1e9],["M",1e6],["K",1000],["k",1000],["",1],["m",0.001],["µ",0.000001],["u",0.000001],["n",0.000000001],["p",0.000000000001],["f",0.000000000000001]]),w2=[...Lm.keys()];function Em(t){return Lm.get(t)}var Tm={Hz:{baseUnit:"Hz",variants:{MHz:1e6,kHz:1000,Hz:1}},g:{baseUnit:"g",variants:{kg:1000,g:1}},Ω:{baseUnit:"Ω",variants:{mΩ:0.001,mohm:0.001,mOhm:0.001,milliohm:0.001,Ω:1,ohm:1,Ohm:1,kΩ:1000,KΩ:1000,kohm:1000,kOhm:1000,KOhm:1000,Kohm:1000,MΩ:1e6,Mohm:1e6,MOhm:1e6,megohm:1e6,Megohm:1e6,GΩ:1e9,Gohm:1e9,GOhm:1e9,TΩ:1000000000000,Tohm:1000000000000,TOhm:1000000000000}},V:{baseUnit:"V",variants:{mV:0.001,V:1,kV:1000,KV:1000,MV:1e6,GV:1e9,TV:1000000000000}},A:{baseUnit:"A",variants:{µA:0.000001,mA:0.001,ma:0.001,A:1,kA:1000,MA:1e6}},F:{baseUnit:"F",variants:{pF:0.000000000001,nF:0.000000001,µF:0.000001,uF:0.000001,mF:0.001,F:1,kF:1000,KF:1000,MF:1e6}},H:{baseUnit:"H",variants:{pH:0.000000000001,nH:0.000000001,µH:0.000001,uH:0.000001,mH:0.001,H:1,kH:1000,KH:1000,MH:1e6}},ml:{baseUnit:"ml",variants:{ml:1,mL:1,l:1000,L:1000}},deg:{baseUnit:"deg",variants:{rad:180/Math.PI}},ms:{baseUnit:"ms",variants:{fs:0.000000000001,ps:0.000000001,ns:0.000001,us:0.001,µs:0.001,ms:1,s:1000}},mm:{baseUnit:"mm",variants:{nm:0.000001,µm:0.001,um:0.001,mm:1,cm:10,dm:100,m:1000,km:1e6,in:25.4,ft:304.8,IN:25.4,FT:304.8,yd:914.4,mi:1609344,mil:0.0254}}},Us=new Set;for(let[t,e]of Object.entries(Tm)){Us.add(t);for(let r of Object.keys(e.variants))Us.add(r)}function A2(t){for(let e of Object.values(Tm)){if(t in e.variants)return{baseUnit:e.baseUnit,conversionFactor:e.variants[t]};for(let[r,i]of Object.entries(e.variants)){if(!t.endsWith(r))continue;let n=t.slice(0,-r.length),a=Em(n);if(a==null)continue;return{baseUnit:e.baseUnit,conversionFactor:a*i}}}return{baseUnit:t,conversionFactor:1}}function qt(t,e){if(t===void 0||t===null)return{parsedUnit:null,unitOfValue:null,value:null};if(typeof t==="string"&&t.match(/^-?[\d.]+$/))return{value:Number.parseFloat(t),parsedUnit:null,unitOfValue:null};if(typeof t==="number")return{value:t,parsedUnit:null,unitOfValue:null};if(typeof t==="object"&&"x"in t&&"y"in t){let s=qt(t.x,e),p=qt(t.x,e),d=qt(t.y,e);if(p.value===null||d.value===null)return{parsedUnit:null,unitOfValue:null,value:null};return{parsedUnit:s.parsedUnit,unitOfValue:s.unitOfValue,value:{x:p.value,y:d.value}}}let i=t.toString().split("").reverse().join("").match(/[^\d\s]+/)?.[0];if(!i)throw Error(`Could not determine unit: "${t}"`);let n=i.split("").reverse().join(""),a=t.slice(0,-n.length),o=Em(n);if(e&&o!=null)return{parsedUnit:null,unitOfValue:e,value:Number.parseFloat(a)*o};if(o!=null&&!Us.has(n))return{parsedUnit:null,unitOfValue:null,value:Number.parseFloat(a)*o};let{baseUnit:c,conversionFactor:l}=A2(n);return{parsedUnit:n,unitOfValue:c,value:l*Number.parseFloat(a)}}var B2=w2.filter((t)=>t!=="").sort((t,e)=>e.length-t.length).map((t)=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),uT=new RegExp(`^([+-]?(?:\\d+(?:\\.\\d*)?|\\.\\d+)(?:[eE][+-]?\\d+)?)(?:(${B2}))?$`);var Ym=[{value:1000000000000,symbol:"T"},{value:1e9,symbol:"G"},{value:1e6,symbol:"M"},{value:1000,symbol:"k"},{value:1,symbol:""},{value:0.001,symbol:"m"},{value:0.000001,symbol:"µ"},{value:0.000000001,symbol:"n"},{value:0.000000000001,symbol:"p"}],yT=Ym[Ym.length-1];var At;(function(t){t.assertEqual=(n)=>{};function e(n){}t.assertIs=e;function r(n){throw Error()}t.assertNever=r,t.arrayToEnum=(n)=>{let a={};for(let o of n)a[o]=o;return a},t.getValidEnumValues=(n)=>{let a=t.objectKeys(n).filter((c)=>typeof n[n[c]]!=="number"),o={};for(let c of a)o[c]=n[c];return t.objectValues(o)},t.objectValues=(n)=>t.objectKeys(n).map(function(a){return n[a]}),t.objectKeys=typeof Object.keys==="function"?(n)=>Object.keys(n):(n)=>{let a=[];for(let o in n)if(Object.prototype.hasOwnProperty.call(n,o))a.push(o);return a},t.find=(n,a)=>{for(let o of n)if(a(o))return o;return},t.isInteger=typeof Number.isInteger==="function"?(n)=>Number.isInteger(n):(n)=>typeof n==="number"&&Number.isFinite(n)&&Math.floor(n)===n;function i(n,a=" | "){return n.map((o)=>typeof o==="string"?`'${o}'`:o).join(a)}t.joinValues=i,t.jsonStringifyReplacer=(n,a)=>{if(typeof a==="bigint")return a.toString();return a}})(At||(At={}));var Nm;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Nm||(Nm={}));var nt=At.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Se=(t)=>{switch(typeof t){case"undefined":return nt.undefined;case"string":return nt.string;case"number":return Number.isNaN(t)?nt.nan:nt.number;case"boolean":return nt.boolean;case"function":return nt.function;case"bigint":return nt.bigint;case"symbol":return nt.symbol;case"object":if(Array.isArray(t))return nt.array;if(t===null)return nt.null;if(t.then&&typeof t.then==="function"&&t.catch&&typeof t.catch==="function")return nt.promise;if(typeof Map<"u"&&t instanceof Map)return nt.map;if(typeof Set<"u"&&t instanceof Set)return nt.set;if(typeof Date<"u"&&t instanceof Date)return nt.date;return nt.object;default:return nt.unknown}};var V=At.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ie extends Error{get errors(){return this.issues}constructor(t){super();this.issues=[],this.addIssue=(r)=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let e=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,e);else this.__proto__=e;this.name="ZodError",this.issues=t}format(t){let e=t||function(n){return n.message},r={_errors:[]},i=(n)=>{for(let a of n.issues)if(a.code==="invalid_union")a.unionErrors.map(i);else if(a.code==="invalid_return_type")i(a.returnTypeError);else if(a.code==="invalid_arguments")i(a.argumentsError);else if(a.path.length===0)r._errors.push(e(a));else{let o=r,c=0;while(c<a.path.length){let l=a.path[c];if(c!==a.path.length-1)o[l]=o[l]||{_errors:[]};else o[l]=o[l]||{_errors:[]},o[l]._errors.push(e(a));o=o[l],c++}}};return i(this),r}static assert(t){if(!(t instanceof ie))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,At.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=(e)=>e.message){let e={},r=[];for(let i of this.issues)if(i.path.length>0){let n=i.path[0];e[n]=e[n]||[],e[n].push(t(i))}else r.push(t(i));return{formErrors:r,fieldErrors:e}}get formErrors(){return this.flatten()}}ie.create=(t)=>new ie(t);var F2=(t,e)=>{let r;switch(t.code){case V.invalid_type:if(t.received===nt.undefined)r="Required";else r=`Expected ${t.expected}, received ${t.received}`;break;case V.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,At.jsonStringifyReplacer)}`;break;case V.unrecognized_keys:r=`Unrecognized key(s) in object: ${At.joinValues(t.keys,", ")}`;break;case V.invalid_union:r="Invalid input";break;case V.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${At.joinValues(t.options)}`;break;case V.invalid_enum_value:r=`Invalid enum value. Expected ${At.joinValues(t.options)}, received '${t.received}'`;break;case V.invalid_arguments:r="Invalid function arguments";break;case V.invalid_return_type:r="Invalid function return type";break;case V.invalid_date:r="Invalid date";break;case V.invalid_string:if(typeof t.validation==="object")if("includes"in t.validation){if(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position==="number")r=`${r} at one or more positions greater than or equal to ${t.validation.position}`}else if("startsWith"in t.validation)r=`Invalid input: must start with "${t.validation.startsWith}"`;else if("endsWith"in t.validation)r=`Invalid input: must end with "${t.validation.endsWith}"`;else At.assertNever(t.validation);else if(t.validation!=="regex")r=`Invalid ${t.validation}`;else r="Invalid";break;case V.too_small:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="bigint")r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`;else r="Invalid input";break;case V.too_big:if(t.type==="array")r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`;else if(t.type==="string")r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`;else if(t.type==="number")r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="bigint")r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`;else if(t.type==="date")r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`;else r="Invalid input";break;case V.custom:r="Invalid input";break;case V.invalid_intersection_types:r="Intersection results could not be merged";break;case V.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case V.not_finite:r="Number must be finite";break;default:r=e.defaultError,At.assertNever(t)}return{message:r}},Xe=F2;var P2=Xe;function Ii(){return P2}var Pn=(t)=>{let{data:e,path:r,errorMaps:i,issueData:n}=t,a=[...r,...n.path||[]],o={...n,path:a};if(n.message!==void 0)return{...n,path:a,message:n.message};let c="",l=i.filter((s)=>!!s).slice().reverse();for(let s of l)c=s(o,{data:e,defaultError:c}).message;return{...n,path:a,message:c}};function rt(t,e){let r=Ii(),i=Pn({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Xe?void 0:Xe].filter((n)=>!!n)});t.common.issues.push(i)}class Qt{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(t,e){let r=[];for(let i of e){if(i.status==="aborted")return ut;if(i.status==="dirty")t.dirty();r.push(i.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,e){let r=[];for(let i of e){let n=await i.key,a=await i.value;r.push({key:n,value:a})}return Qt.mergeObjectSync(t,r)}static mergeObjectSync(t,e){let r={};for(let i of e){let{key:n,value:a}=i;if(n.status==="aborted")return ut;if(a.status==="aborted")return ut;if(n.status==="dirty")t.dirty();if(a.status==="dirty")t.dirty();if(n.value!=="__proto__"&&(typeof a.value<"u"||i.alwaysSet))r[n.value]=a.value}return{status:t.value,value:r}}}var ut=Object.freeze({status:"aborted"}),Er=(t)=>({status:"dirty",value:t}),Kt=(t)=>({status:"valid",value:t}),Gs=(t)=>t.status==="aborted",Hs=(t)=>t.status==="dirty",rr=(t)=>t.status==="valid",Mi=(t)=>typeof Promise<"u"&&t instanceof Promise;var lt;(function(t){t.errToObj=(e)=>typeof e==="string"?{message:e}:e||{},t.toString=(e)=>typeof e==="string"?e:e?.message})(lt||(lt={}));class pe{constructor(t,e,r,i){this._cachedPath=[],this.parent=t,this.data=e,this._path=r,this._key=i}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var Wm=(t,e)=>{if(rr(e))return{success:!0,data:e.value};else{if(!t.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new ie(t.common.issues);return this._error=r,this._error}}}};function vt(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:i,description:n}=t;if(e&&(r||i))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(e)return{errorMap:e,description:n};return{errorMap:(o,c)=>{let{message:l}=t;if(o.code==="invalid_enum_value")return{message:l??c.defaultError};if(typeof c.data>"u")return{message:l??i??c.defaultError};if(o.code!=="invalid_type")return{message:c.defaultError};return{message:l??r??c.defaultError}},description:n}}class wt{get description(){return this._def.description}_getType(t){return Se(t.data)}_getOrReturnCtx(t,e){return e||{common:t.parent.common,data:t.data,parsedType:Se(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Qt,ctx:{common:t.parent.common,data:t.data,parsedType:Se(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let e=this._parse(t);if(Mi(e))throw Error("Synchronous parse encountered promise.");return e}_parseAsync(t){let e=this._parse(t);return Promise.resolve(e)}parse(t,e){let r=this.safeParse(t,e);if(r.success)return r.data;throw r.error}safeParse(t,e){let r={common:{issues:[],async:e?.async??!1,contextualErrorMap:e?.errorMap},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Se(t)},i=this._parseSync({data:t,path:r.path,parent:r});return Wm(r,i)}"~validate"(t){let e={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Se(t)};if(!this["~standard"].async)try{let r=this._parseSync({data:t,path:[],parent:e});return rr(r)?{value:r.value}:{issues:e.common.issues}}catch(r){if(r?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;e.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:e}).then((r)=>rr(r)?{value:r.value}:{issues:e.common.issues})}async parseAsync(t,e){let r=await this.safeParseAsync(t,e);if(r.success)return r.data;throw r.error}async safeParseAsync(t,e){let r={common:{issues:[],contextualErrorMap:e?.errorMap,async:!0},path:e?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:Se(t)},i=this._parse({data:t,path:r.path,parent:r}),n=await(Mi(i)?i:Promise.resolve(i));return Wm(r,n)}refine(t,e){let r=(i)=>{if(typeof e==="string"||typeof e>"u")return{message:e};else if(typeof e==="function")return e(i);else return e};return this._refinement((i,n)=>{let a=t(i),o=()=>n.addIssue({code:V.custom,...r(i)});if(typeof Promise<"u"&&a instanceof Promise)return a.then((c)=>{if(!c)return o(),!1;else return!0});if(!a)return o(),!1;else return!0})}refinement(t,e){return this._refinement((r,i)=>{if(!t(r))return i.addIssue(typeof e==="function"?e(r,i):e),!1;else return!0})}_refinement(t){return new ue({schema:this,typeName:ft.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(e)=>this["~validate"](e)}}optional(){return me.create(this,this._def)}nullable(){return Ve.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return de.create(this)}promise(){return Or.create(this,this._def)}or(t){return Ei.create([this,t],this._def)}and(t){return Ti.create(this,t,this._def)}transform(t){return new ue({...vt(this._def),schema:this,typeName:ft.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let e=typeof t==="function"?t:()=>t;return new Oi({...vt(this._def),innerType:this,defaultValue:e,typeName:ft.ZodDefault})}brand(){return new Js({typeName:ft.ZodBranded,type:this,...vt(this._def)})}catch(t){let e=typeof t==="function"?t:()=>t;return new ji({...vt(this._def),innerType:this,catchValue:e,typeName:ft.ZodCatch})}describe(t){return new this.constructor({...this._def,description:t})}pipe(t){return Tn.create(this,t)}readonly(){return $i.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var I2=/^c[^\s-]{8,}$/i,M2=/^[0-9a-z]+$/,k2=/^[0-9A-HJKMNP-TV-Z]{26}$/i,C2=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Y2=/^[a-z0-9_-]{21}$/i,L2=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,E2=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,T2=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,N2="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",Qs,W2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,R2=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,O2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,j2=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$2=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,X2=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Rm="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",V2=new RegExp(`^${Rm}$`);function Om(t){let e="[0-5]\\d";if(t.precision)e=`${e}\\.\\d{${t.precision}}`;else if(t.precision==null)e=`${e}(\\.\\d+)?`;let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function z2(t){return new RegExp(`^${Om(t)}$`)}function D2(t){let e=`${Rm}T${Om(t)}`,r=[];if(r.push(t.local?"Z?":"Z"),t.offset)r.push("([+-]\\d{2}:?\\d{2})");return e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function U2(t,e){if((e==="v4"||!e)&&W2.test(t))return!0;if((e==="v6"||!e)&&O2.test(t))return!0;return!1}function G2(t,e){if(!L2.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let i=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),n=JSON.parse(atob(i));if(typeof n!=="object"||n===null)return!1;if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(e&&n.alg!==e)return!1;return!0}catch{return!1}}function H2(t,e){if((e==="v4"||!e)&&R2.test(t))return!0;if((e==="v6"||!e)&&j2.test(t))return!0;return!1}class Ae extends wt{_parse(t){if(this._def.coerce)t.data=String(t.data);if(this._getType(t)!==nt.string){let n=this._getOrReturnCtx(t);return rt(n,{code:V.invalid_type,expected:nt.string,received:n.parsedType}),ut}let r=new Qt,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(t.data.length<n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:V.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="max"){if(t.data.length>n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:V.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),r.dirty()}else if(n.kind==="length"){let a=t.data.length>n.value,o=t.data.length<n.value;if(a||o){if(i=this._getOrReturnCtx(t,i),a)rt(i,{code:V.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});else if(o)rt(i,{code:V.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message});r.dirty()}}else if(n.kind==="email"){if(!T2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"email",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="emoji"){if(!Qs)Qs=new RegExp(N2,"u");if(!Qs.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"emoji",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="uuid"){if(!C2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"uuid",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="nanoid"){if(!Y2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"nanoid",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid"){if(!I2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cuid",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cuid2"){if(!M2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cuid2",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ulid"){if(!k2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"ulid",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="url")try{new URL(t.data)}catch{i=this._getOrReturnCtx(t,i),rt(i,{validation:"url",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="regex"){if(n.regex.lastIndex=0,!n.regex.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"regex",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="trim")t.data=t.data.trim();else if(n.kind==="includes"){if(!t.data.includes(n.value,n.position))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),r.dirty()}else if(n.kind==="toLowerCase")t.data=t.data.toLowerCase();else if(n.kind==="toUpperCase")t.data=t.data.toUpperCase();else if(n.kind==="startsWith"){if(!t.data.startsWith(n.value))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:{startsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="endsWith"){if(!t.data.endsWith(n.value))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:{endsWith:n.value},message:n.message}),r.dirty()}else if(n.kind==="datetime"){if(!D2(n).test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:"datetime",message:n.message}),r.dirty()}else if(n.kind==="date"){if(!V2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:"date",message:n.message}),r.dirty()}else if(n.kind==="time"){if(!z2(n).test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{code:V.invalid_string,validation:"time",message:n.message}),r.dirty()}else if(n.kind==="duration"){if(!E2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"duration",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="ip"){if(!U2(t.data,n.version))i=this._getOrReturnCtx(t,i),rt(i,{validation:"ip",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="jwt"){if(!G2(t.data,n.alg))i=this._getOrReturnCtx(t,i),rt(i,{validation:"jwt",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="cidr"){if(!H2(t.data,n.version))i=this._getOrReturnCtx(t,i),rt(i,{validation:"cidr",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64"){if(!$2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"base64",code:V.invalid_string,message:n.message}),r.dirty()}else if(n.kind==="base64url"){if(!X2.test(t.data))i=this._getOrReturnCtx(t,i),rt(i,{validation:"base64url",code:V.invalid_string,message:n.message}),r.dirty()}else At.assertNever(n);return{status:r.value,value:t.data}}_regex(t,e,r){return this.refinement((i)=>t.test(i),{validation:e,code:V.invalid_string,...lt.errToObj(r)})}_addCheck(t){return new Ae({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...lt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...lt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...lt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...lt.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...lt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...lt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...lt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...lt.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...lt.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...lt.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...lt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...lt.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...lt.errToObj(t)})}datetime(t){if(typeof t==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t});return this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...lt.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){if(typeof t==="string")return this._addCheck({kind:"time",precision:null,message:t});return this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...lt.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...lt.errToObj(t)})}regex(t,e){return this._addCheck({kind:"regex",regex:t,...lt.errToObj(e)})}includes(t,e){return this._addCheck({kind:"includes",value:t,position:e?.position,...lt.errToObj(e?.message)})}startsWith(t,e){return this._addCheck({kind:"startsWith",value:t,...lt.errToObj(e)})}endsWith(t,e){return this._addCheck({kind:"endsWith",value:t,...lt.errToObj(e)})}min(t,e){return this._addCheck({kind:"min",value:t,...lt.errToObj(e)})}max(t,e){return this._addCheck({kind:"max",value:t,...lt.errToObj(e)})}length(t,e){return this._addCheck({kind:"length",value:t,...lt.errToObj(e)})}nonempty(t){return this.min(1,lt.errToObj(t))}trim(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ae({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((t)=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find((t)=>t.kind==="date")}get isTime(){return!!this._def.checks.find((t)=>t.kind==="time")}get isDuration(){return!!this._def.checks.find((t)=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find((t)=>t.kind==="email")}get isURL(){return!!this._def.checks.find((t)=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find((t)=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find((t)=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((t)=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((t)=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((t)=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find((t)=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find((t)=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find((t)=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find((t)=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find((t)=>t.kind==="base64url")}get minLength(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxLength(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}Ae.create=(t)=>new Ae({checks:[],typeName:ft.ZodString,coerce:t?.coerce??!1,...vt(t)});function Q2(t,e){let r=(t.toString().split(".")[1]||"").length,i=(e.toString().split(".")[1]||"").length,n=r>i?r:i,a=Number.parseInt(t.toFixed(n).replace(".","")),o=Number.parseInt(e.toFixed(n).replace(".",""));return a%o/10**n}class Nr extends wt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce)t.data=Number(t.data);if(this._getType(t)!==nt.number){let n=this._getOrReturnCtx(t);return rt(n,{code:V.invalid_type,expected:nt.number,received:n.parsedType}),ut}let r=void 0,i=new Qt;for(let n of this._def.checks)if(n.kind==="int"){if(!At.isInteger(t.data))r=this._getOrReturnCtx(t,r),rt(r,{code:V.invalid_type,expected:"integer",received:"float",message:n.message}),i.dirty()}else if(n.kind==="min"){if(n.inclusive?t.data<n.value:t.data<=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:V.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?t.data>n.value:t.data>=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:V.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(Q2(t.data,n.value)!==0)r=this._getOrReturnCtx(t,r),rt(r,{code:V.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else if(n.kind==="finite"){if(!Number.isFinite(t.data))r=this._getOrReturnCtx(t,r),rt(r,{code:V.not_finite,message:n.message}),i.dirty()}else At.assertNever(n);return{status:i.value,value:t.data}}gte(t,e){return this.setLimit("min",t,!0,lt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,lt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,lt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,lt.toString(e))}setLimit(t,e,r,i){return new Nr({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:lt.toString(i)}]})}_addCheck(t){return new Nr({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:lt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:lt.toString(e)})}finite(t){return this._addCheck({kind:"finite",message:lt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:lt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:lt.toString(t)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}get isInt(){return!!this._def.checks.find((t)=>t.kind==="int"||t.kind==="multipleOf"&&At.isInteger(t.value))}get isFinite(){let t=null,e=null;for(let r of this._def.checks)if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;else if(r.kind==="min"){if(e===null||r.value>e)e=r.value}else if(r.kind==="max"){if(t===null||r.value<t)t=r.value}return Number.isFinite(e)&&Number.isFinite(t)}}Nr.create=(t)=>new Nr({checks:[],typeName:ft.ZodNumber,coerce:t?.coerce||!1,...vt(t)});class Wr extends wt{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==nt.bigint)return this._getInvalidInput(t);let r=void 0,i=new Qt;for(let n of this._def.checks)if(n.kind==="min"){if(n.inclusive?t.data<n.value:t.data<=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:V.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="max"){if(n.inclusive?t.data>n.value:t.data>=n.value)r=this._getOrReturnCtx(t,r),rt(r,{code:V.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),i.dirty()}else if(n.kind==="multipleOf"){if(t.data%n.value!==BigInt(0))r=this._getOrReturnCtx(t,r),rt(r,{code:V.not_multiple_of,multipleOf:n.value,message:n.message}),i.dirty()}else At.assertNever(n);return{status:i.value,value:t.data}}_getInvalidInput(t){let e=this._getOrReturnCtx(t);return rt(e,{code:V.invalid_type,expected:nt.bigint,received:e.parsedType}),ut}gte(t,e){return this.setLimit("min",t,!0,lt.toString(e))}gt(t,e){return this.setLimit("min",t,!1,lt.toString(e))}lte(t,e){return this.setLimit("max",t,!0,lt.toString(e))}lt(t,e){return this.setLimit("max",t,!1,lt.toString(e))}setLimit(t,e,r,i){return new Wr({...this._def,checks:[...this._def.checks,{kind:t,value:e,inclusive:r,message:lt.toString(i)}]})}_addCheck(t){return new Wr({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:lt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:lt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:lt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:lt.toString(t)})}multipleOf(t,e){return this._addCheck({kind:"multipleOf",value:t,message:lt.toString(e)})}get minValue(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t}get maxValue(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t}}Wr.create=(t)=>new Wr({checks:[],typeName:ft.ZodBigInt,coerce:t?.coerce??!1,...vt(t)});class In extends wt{_parse(t){if(this._def.coerce)t.data=Boolean(t.data);if(this._getType(t)!==nt.boolean){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.boolean,received:r.parsedType}),ut}return Kt(t.data)}}In.create=(t)=>new In({typeName:ft.ZodBoolean,coerce:t?.coerce||!1,...vt(t)});class Ci extends wt{_parse(t){if(this._def.coerce)t.data=new Date(t.data);if(this._getType(t)!==nt.date){let n=this._getOrReturnCtx(t);return rt(n,{code:V.invalid_type,expected:nt.date,received:n.parsedType}),ut}if(Number.isNaN(t.data.getTime())){let n=this._getOrReturnCtx(t);return rt(n,{code:V.invalid_date}),ut}let r=new Qt,i=void 0;for(let n of this._def.checks)if(n.kind==="min"){if(t.data.getTime()<n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:V.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),r.dirty()}else if(n.kind==="max"){if(t.data.getTime()>n.value)i=this._getOrReturnCtx(t,i),rt(i,{code:V.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),r.dirty()}else At.assertNever(n);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Ci({...this._def,checks:[...this._def.checks,t]})}min(t,e){return this._addCheck({kind:"min",value:t.getTime(),message:lt.toString(e)})}max(t,e){return this._addCheck({kind:"max",value:t.getTime(),message:lt.toString(e)})}get minDate(){let t=null;for(let e of this._def.checks)if(e.kind==="min"){if(t===null||e.value>t)t=e.value}return t!=null?new Date(t):null}get maxDate(){let t=null;for(let e of this._def.checks)if(e.kind==="max"){if(t===null||e.value<t)t=e.value}return t!=null?new Date(t):null}}Ci.create=(t)=>new Ci({checks:[],coerce:t?.coerce||!1,typeName:ft.ZodDate,...vt(t)});class Mn extends wt{_parse(t){if(this._getType(t)!==nt.symbol){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.symbol,received:r.parsedType}),ut}return Kt(t.data)}}Mn.create=(t)=>new Mn({typeName:ft.ZodSymbol,...vt(t)});class Yi extends wt{_parse(t){if(this._getType(t)!==nt.undefined){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.undefined,received:r.parsedType}),ut}return Kt(t.data)}}Yi.create=(t)=>new Yi({typeName:ft.ZodUndefined,...vt(t)});class Li extends wt{_parse(t){if(this._getType(t)!==nt.null){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.null,received:r.parsedType}),ut}return Kt(t.data)}}Li.create=(t)=>new Li({typeName:ft.ZodNull,...vt(t)});class kn extends wt{constructor(){super(...arguments);this._any=!0}_parse(t){return Kt(t.data)}}kn.create=(t)=>new kn({typeName:ft.ZodAny,...vt(t)});class ir extends wt{constructor(){super(...arguments);this._unknown=!0}_parse(t){return Kt(t.data)}}ir.create=(t)=>new ir({typeName:ft.ZodUnknown,...vt(t)});class Be extends wt{_parse(t){let e=this._getOrReturnCtx(t);return rt(e,{code:V.invalid_type,expected:nt.never,received:e.parsedType}),ut}}Be.create=(t)=>new Be({typeName:ft.ZodNever,...vt(t)});class Cn extends wt{_parse(t){if(this._getType(t)!==nt.undefined){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.void,received:r.parsedType}),ut}return Kt(t.data)}}Cn.create=(t)=>new Cn({typeName:ft.ZodVoid,...vt(t)});class de extends wt{_parse(t){let{ctx:e,status:r}=this._processInputParams(t),i=this._def;if(e.parsedType!==nt.array)return rt(e,{code:V.invalid_type,expected:nt.array,received:e.parsedType}),ut;if(i.exactLength!==null){let a=e.data.length>i.exactLength.value,o=e.data.length<i.exactLength.value;if(a||o)rt(e,{code:a?V.too_big:V.too_small,minimum:o?i.exactLength.value:void 0,maximum:a?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty()}if(i.minLength!==null){if(e.data.length<i.minLength.value)rt(e,{code:V.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()}if(i.maxLength!==null){if(e.data.length>i.maxLength.value)rt(e,{code:V.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()}if(e.common.async)return Promise.all([...e.data].map((a,o)=>i.type._parseAsync(new pe(e,a,e.path,o)))).then((a)=>Qt.mergeArray(r,a));let n=[...e.data].map((a,o)=>i.type._parseSync(new pe(e,a,e.path,o)));return Qt.mergeArray(r,n)}get element(){return this._def.type}min(t,e){return new de({...this._def,minLength:{value:t,message:lt.toString(e)}})}max(t,e){return new de({...this._def,maxLength:{value:t,message:lt.toString(e)}})}length(t,e){return new de({...this._def,exactLength:{value:t,message:lt.toString(e)}})}nonempty(t){return this.min(1,t)}}de.create=(t,e)=>new de({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ft.ZodArray,...vt(e)});function Tr(t){if(t instanceof Ot){let e={};for(let r in t.shape){let i=t.shape[r];e[r]=me.create(Tr(i))}return new Ot({...t._def,shape:()=>e})}else if(t instanceof de)return new de({...t._def,type:Tr(t.element)});else if(t instanceof me)return me.create(Tr(t.unwrap()));else if(t instanceof Ve)return Ve.create(Tr(t.unwrap()));else if(t instanceof Fe)return Fe.create(t.items.map((e)=>Tr(e)));else return t}class Ot extends wt{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),e=At.objectKeys(t);return this._cached={shape:t,keys:e},this._cached}_parse(t){if(this._getType(t)!==nt.object){let l=this._getOrReturnCtx(t);return rt(l,{code:V.invalid_type,expected:nt.object,received:l.parsedType}),ut}let{status:r,ctx:i}=this._processInputParams(t),{shape:n,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Be&&this._def.unknownKeys==="strip")){for(let l in i.data)if(!a.includes(l))o.push(l)}let c=[];for(let l of a){let s=n[l],p=i.data[l];c.push({key:{status:"valid",value:l},value:s._parse(new pe(i,p,i.path,l)),alwaysSet:l in i.data})}if(this._def.catchall instanceof Be){let l=this._def.unknownKeys;if(l==="passthrough")for(let s of o)c.push({key:{status:"valid",value:s},value:{status:"valid",value:i.data[s]}});else if(l==="strict"){if(o.length>0)rt(i,{code:V.unrecognized_keys,keys:o}),r.dirty()}else if(l==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let s of o){let p=i.data[s];c.push({key:{status:"valid",value:s},value:l._parse(new pe(i,p,i.path,s)),alwaysSet:s in i.data})}}if(i.common.async)return Promise.resolve().then(async()=>{let l=[];for(let s of c){let p=await s.key,d=await s.value;l.push({key:p,value:d,alwaysSet:s.alwaysSet})}return l}).then((l)=>Qt.mergeObjectSync(r,l));else return Qt.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(t){return lt.errToObj,new Ot({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(e,r)=>{let i=this._def.errorMap?.(e,r).message??r.defaultError;if(e.code==="unrecognized_keys")return{message:lt.errToObj(t).message??i};return{message:i}}}:{}})}strip(){return new Ot({...this._def,unknownKeys:"strip"})}passthrough(){return new Ot({...this._def,unknownKeys:"passthrough"})}extend(t){return new Ot({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Ot({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:ft.ZodObject})}setKey(t,e){return this.augment({[t]:e})}catchall(t){return new Ot({...this._def,catchall:t})}pick(t){let e={};for(let r of At.objectKeys(t))if(t[r]&&this.shape[r])e[r]=this.shape[r];return new Ot({...this._def,shape:()=>e})}omit(t){let e={};for(let r of At.objectKeys(this.shape))if(!t[r])e[r]=this.shape[r];return new Ot({...this._def,shape:()=>e})}deepPartial(){return Tr(this)}partial(t){let e={};for(let r of At.objectKeys(this.shape)){let i=this.shape[r];if(t&&!t[r])e[r]=i;else e[r]=i.optional()}return new Ot({...this._def,shape:()=>e})}required(t){let e={};for(let r of At.objectKeys(this.shape))if(t&&!t[r])e[r]=this.shape[r];else{let n=this.shape[r];while(n instanceof me)n=n._def.innerType;e[r]=n}return new Ot({...this._def,shape:()=>e})}keyof(){return jm(At.objectKeys(this.shape))}}Ot.create=(t,e)=>new Ot({shape:()=>t,unknownKeys:"strip",catchall:Be.create(),typeName:ft.ZodObject,...vt(e)});Ot.strictCreate=(t,e)=>new Ot({shape:()=>t,unknownKeys:"strict",catchall:Be.create(),typeName:ft.ZodObject,...vt(e)});Ot.lazycreate=(t,e)=>new Ot({shape:t,unknownKeys:"strip",catchall:Be.create(),typeName:ft.ZodObject,...vt(e)});class Ei extends wt{_parse(t){let{ctx:e}=this._processInputParams(t),r=this._def.options;function i(n){for(let o of n)if(o.result.status==="valid")return o.result;for(let o of n)if(o.result.status==="dirty")return e.common.issues.push(...o.ctx.common.issues),o.result;let a=n.map((o)=>new ie(o.ctx.common.issues));return rt(e,{code:V.invalid_union,unionErrors:a}),ut}if(e.common.async)return Promise.all(r.map(async(n)=>{let a={...e,common:{...e.common,issues:[]},parent:null};return{result:await n._parseAsync({data:e.data,path:e.path,parent:a}),ctx:a}})).then(i);else{let n=void 0,a=[];for(let c of r){let l={...e,common:{...e.common,issues:[]},parent:null},s=c._parseSync({data:e.data,path:e.path,parent:l});if(s.status==="valid")return s;else if(s.status==="dirty"&&!n)n={result:s,ctx:l};if(l.common.issues.length)a.push(l.common.issues)}if(n)return e.common.issues.push(...n.ctx.common.issues),n.result;let o=a.map((c)=>new ie(c));return rt(e,{code:V.invalid_union,unionErrors:o}),ut}}get options(){return this._def.options}}Ei.create=(t,e)=>new Ei({options:t,typeName:ft.ZodUnion,...vt(e)});var we=(t)=>{if(t instanceof Ni)return we(t.schema);else if(t instanceof ue)return we(t.innerType());else if(t instanceof Wi)return[t.value];else if(t instanceof nr)return t.options;else if(t instanceof Ri)return At.objectValues(t.enum);else if(t instanceof Oi)return we(t._def.innerType);else if(t instanceof Yi)return[void 0];else if(t instanceof Li)return[null];else if(t instanceof me)return[void 0,...we(t.unwrap())];else if(t instanceof Ve)return[null,...we(t.unwrap())];else if(t instanceof Js)return we(t.unwrap());else if(t instanceof $i)return we(t.unwrap());else if(t instanceof ji)return we(t._def.innerType);else return[]};class Ks extends wt{_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.object)return rt(e,{code:V.invalid_type,expected:nt.object,received:e.parsedType}),ut;let r=this.discriminator,i=e.data[r],n=this.optionsMap.get(i);if(!n)return rt(e,{code:V.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ut;if(e.common.async)return n._parseAsync({data:e.data,path:e.path,parent:e});else return n._parseSync({data:e.data,path:e.path,parent:e})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,e,r){let i=new Map;for(let n of e){let a=we(n.shape[t]);if(!a.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let o of a){if(i.has(o))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(o)}`);i.set(o,n)}}return new Ks({typeName:ft.ZodDiscriminatedUnion,discriminator:t,options:e,optionsMap:i,...vt(r)})}}function Zs(t,e){let r=Se(t),i=Se(e);if(t===e)return{valid:!0,data:t};else if(r===nt.object&&i===nt.object){let n=At.objectKeys(e),a=At.objectKeys(t).filter((c)=>n.indexOf(c)!==-1),o={...t,...e};for(let c of a){let l=Zs(t[c],e[c]);if(!l.valid)return{valid:!1};o[c]=l.data}return{valid:!0,data:o}}else if(r===nt.array&&i===nt.array){if(t.length!==e.length)return{valid:!1};let n=[];for(let a=0;a<t.length;a++){let o=t[a],c=e[a],l=Zs(o,c);if(!l.valid)return{valid:!1};n.push(l.data)}return{valid:!0,data:n}}else if(r===nt.date&&i===nt.date&&+t===+e)return{valid:!0,data:t};else return{valid:!1}}class Ti extends wt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=(n,a)=>{if(Gs(n)||Gs(a))return ut;let o=Zs(n.value,a.value);if(!o.valid)return rt(r,{code:V.invalid_intersection_types}),ut;if(Hs(n)||Hs(a))e.dirty();return{status:e.value,value:o.data}};if(r.common.async)return Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([n,a])=>i(n,a));else return i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ti.create=(t,e,r)=>new Ti({left:t,right:e,typeName:ft.ZodIntersection,...vt(r)});class Fe extends wt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.array)return rt(r,{code:V.invalid_type,expected:nt.array,received:r.parsedType}),ut;if(r.data.length<this._def.items.length)return rt(r,{code:V.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ut;if(!this._def.rest&&r.data.length>this._def.items.length)rt(r,{code:V.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),e.dirty();let n=[...r.data].map((a,o)=>{let c=this._def.items[o]||this._def.rest;if(!c)return null;return c._parse(new pe(r,a,r.path,o))}).filter((a)=>!!a);if(r.common.async)return Promise.all(n).then((a)=>Qt.mergeArray(e,a));else return Qt.mergeArray(e,n)}get items(){return this._def.items}rest(t){return new Fe({...this._def,rest:t})}}Fe.create=(t,e)=>{if(!Array.isArray(t))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Fe({items:t,typeName:ft.ZodTuple,rest:null,...vt(e)})};class Yn extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.object)return rt(r,{code:V.invalid_type,expected:nt.object,received:r.parsedType}),ut;let i=[],n=this._def.keyType,a=this._def.valueType;for(let o in r.data)i.push({key:n._parse(new pe(r,o,r.path,o)),value:a._parse(new pe(r,r.data[o],r.path,o)),alwaysSet:o in r.data});if(r.common.async)return Qt.mergeObjectAsync(e,i);else return Qt.mergeObjectSync(e,i)}get element(){return this._def.valueType}static create(t,e,r){if(e instanceof wt)return new Yn({keyType:t,valueType:e,typeName:ft.ZodRecord,...vt(r)});return new Yn({keyType:Ae.create(),valueType:t,typeName:ft.ZodRecord,...vt(e)})}}class Ln extends wt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.map)return rt(r,{code:V.invalid_type,expected:nt.map,received:r.parsedType}),ut;let i=this._def.keyType,n=this._def.valueType,a=[...r.data.entries()].map(([o,c],l)=>({key:i._parse(new pe(r,o,r.path,[l,"key"])),value:n._parse(new pe(r,c,r.path,[l,"value"]))}));if(r.common.async){let o=new Map;return Promise.resolve().then(async()=>{for(let c of a){let l=await c.key,s=await c.value;if(l.status==="aborted"||s.status==="aborted")return ut;if(l.status==="dirty"||s.status==="dirty")e.dirty();o.set(l.value,s.value)}return{status:e.value,value:o}})}else{let o=new Map;for(let c of a){let{key:l,value:s}=c;if(l.status==="aborted"||s.status==="aborted")return ut;if(l.status==="dirty"||s.status==="dirty")e.dirty();o.set(l.value,s.value)}return{status:e.value,value:o}}}}Ln.create=(t,e,r)=>new Ln({valueType:e,keyType:t,typeName:ft.ZodMap,...vt(r)});class Rr extends wt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.parsedType!==nt.set)return rt(r,{code:V.invalid_type,expected:nt.set,received:r.parsedType}),ut;let i=this._def;if(i.minSize!==null){if(r.data.size<i.minSize.value)rt(r,{code:V.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),e.dirty()}if(i.maxSize!==null){if(r.data.size>i.maxSize.value)rt(r,{code:V.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),e.dirty()}let n=this._def.valueType;function a(c){let l=new Set;for(let s of c){if(s.status==="aborted")return ut;if(s.status==="dirty")e.dirty();l.add(s.value)}return{status:e.value,value:l}}let o=[...r.data.values()].map((c,l)=>n._parse(new pe(r,c,r.path,l)));if(r.common.async)return Promise.all(o).then((c)=>a(c));else return a(o)}min(t,e){return new Rr({...this._def,minSize:{value:t,message:lt.toString(e)}})}max(t,e){return new Rr({...this._def,maxSize:{value:t,message:lt.toString(e)}})}size(t,e){return this.min(t,e).max(t,e)}nonempty(t){return this.min(1,t)}}Rr.create=(t,e)=>new Rr({valueType:t,minSize:null,maxSize:null,typeName:ft.ZodSet,...vt(e)});class ki extends wt{constructor(){super(...arguments);this.validate=this.implement}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.function)return rt(e,{code:V.invalid_type,expected:nt.function,received:e.parsedType}),ut;function r(o,c){return Pn({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ii(),Xe].filter((l)=>!!l),issueData:{code:V.invalid_arguments,argumentsError:c}})}function i(o,c){return Pn({data:o,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,Ii(),Xe].filter((l)=>!!l),issueData:{code:V.invalid_return_type,returnTypeError:c}})}let n={errorMap:e.common.contextualErrorMap},a=e.data;if(this._def.returns instanceof Or){let o=this;return Kt(async function(...c){let l=new ie([]),s=await o._def.args.parseAsync(c,n).catch((m)=>{throw l.addIssue(r(c,m)),l}),p=await Reflect.apply(a,this,s);return await o._def.returns._def.type.parseAsync(p,n).catch((m)=>{throw l.addIssue(i(p,m)),l})})}else{let o=this;return Kt(function(...c){let l=o._def.args.safeParse(c,n);if(!l.success)throw new ie([r(c,l.error)]);let s=Reflect.apply(a,this,l.data),p=o._def.returns.safeParse(s,n);if(!p.success)throw new ie([i(s,p.error)]);return p.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new ki({...this._def,args:Fe.create(t).rest(ir.create())})}returns(t){return new ki({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,e,r){return new ki({args:t?t:Fe.create([]).rest(ir.create()),returns:e||ir.create(),typeName:ft.ZodFunction,...vt(r)})}}class Ni extends wt{get schema(){return this._def.getter()}_parse(t){let{ctx:e}=this._processInputParams(t);return this._def.getter()._parse({data:e.data,path:e.path,parent:e})}}Ni.create=(t,e)=>new Ni({getter:t,typeName:ft.ZodLazy,...vt(e)});class Wi extends wt{_parse(t){if(t.data!==this._def.value){let e=this._getOrReturnCtx(t);return rt(e,{received:e.data,code:V.invalid_literal,expected:this._def.value}),ut}return{status:"valid",value:t.data}}get value(){return this._def.value}}Wi.create=(t,e)=>new Wi({value:t,typeName:ft.ZodLiteral,...vt(e)});function jm(t,e){return new nr({values:t,typeName:ft.ZodEnum,...vt(e)})}class nr extends wt{_parse(t){if(typeof t.data!=="string"){let e=this._getOrReturnCtx(t),r=this._def.values;return rt(e,{expected:At.joinValues(r),received:e.parsedType,code:V.invalid_type}),ut}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(t.data)){let e=this._getOrReturnCtx(t),r=this._def.values;return rt(e,{received:e.data,code:V.invalid_enum_value,options:r}),ut}return Kt(t.data)}get options(){return this._def.values}get enum(){let t={};for(let e of this._def.values)t[e]=e;return t}get Values(){let t={};for(let e of this._def.values)t[e]=e;return t}get Enum(){let t={};for(let e of this._def.values)t[e]=e;return t}extract(t,e=this._def){return nr.create(t,{...this._def,...e})}exclude(t,e=this._def){return nr.create(this.options.filter((r)=>!t.includes(r)),{...this._def,...e})}}nr.create=jm;class Ri extends wt{_parse(t){let e=At.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==nt.string&&r.parsedType!==nt.number){let i=At.objectValues(e);return rt(r,{expected:At.joinValues(i),received:r.parsedType,code:V.invalid_type}),ut}if(!this._cache)this._cache=new Set(At.getValidEnumValues(this._def.values));if(!this._cache.has(t.data)){let i=At.objectValues(e);return rt(r,{received:r.data,code:V.invalid_enum_value,options:i}),ut}return Kt(t.data)}get enum(){return this._def.values}}Ri.create=(t,e)=>new Ri({values:t,typeName:ft.ZodNativeEnum,...vt(e)});class Or extends wt{unwrap(){return this._def.type}_parse(t){let{ctx:e}=this._processInputParams(t);if(e.parsedType!==nt.promise&&e.common.async===!1)return rt(e,{code:V.invalid_type,expected:nt.promise,received:e.parsedType}),ut;let r=e.parsedType===nt.promise?e.data:Promise.resolve(e.data);return Kt(r.then((i)=>this._def.type.parseAsync(i,{path:e.path,errorMap:e.common.contextualErrorMap})))}}Or.create=(t,e)=>new Or({type:t,typeName:ft.ZodPromise,...vt(e)});class ue extends wt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ft.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:e,ctx:r}=this._processInputParams(t),i=this._def.effect||null,n={addIssue:(a)=>{if(rt(r,a),a.fatal)e.abort();else e.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),i.type==="preprocess"){let a=i.transform(r.data,n);if(r.common.async)return Promise.resolve(a).then(async(o)=>{if(e.value==="aborted")return ut;let c=await this._def.schema._parseAsync({data:o,path:r.path,parent:r});if(c.status==="aborted")return ut;if(c.status==="dirty")return Er(c.value);if(e.value==="dirty")return Er(c.value);return c});else{if(e.value==="aborted")return ut;let o=this._def.schema._parseSync({data:a,path:r.path,parent:r});if(o.status==="aborted")return ut;if(o.status==="dirty")return Er(o.value);if(e.value==="dirty")return Er(o.value);return o}}if(i.type==="refinement"){let a=(o)=>{let c=i.refinement(o,n);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(r.common.async===!1){let o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(o.status==="aborted")return ut;if(o.status==="dirty")e.dirty();return a(o.value),{status:e.value,value:o.value}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((o)=>{if(o.status==="aborted")return ut;if(o.status==="dirty")e.dirty();return a(o.value).then(()=>({status:e.value,value:o.value}))})}if(i.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!rr(a))return ut;let o=i.transform(a.value,n);if(o instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:e.value,value:o}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((a)=>{if(!rr(a))return ut;return Promise.resolve(i.transform(a.value,n)).then((o)=>({status:e.value,value:o}))});At.assertNever(i)}}ue.create=(t,e,r)=>new ue({schema:t,typeName:ft.ZodEffects,effect:e,...vt(r)});ue.createWithPreprocess=(t,e,r)=>new ue({schema:e,effect:{type:"preprocess",transform:t},typeName:ft.ZodEffects,...vt(r)});class me extends wt{_parse(t){if(this._getType(t)===nt.undefined)return Kt(void 0);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}me.create=(t,e)=>new me({innerType:t,typeName:ft.ZodOptional,...vt(e)});class Ve extends wt{_parse(t){if(this._getType(t)===nt.null)return Kt(null);return this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Ve.create=(t,e)=>new Ve({innerType:t,typeName:ft.ZodNullable,...vt(e)});class Oi extends wt{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;if(e.parsedType===nt.undefined)r=this._def.defaultValue();return this._def.innerType._parse({data:r,path:e.path,parent:e})}removeDefault(){return this._def.innerType}}Oi.create=(t,e)=>new Oi({innerType:t,typeName:ft.ZodDefault,defaultValue:typeof e.default==="function"?e.default:()=>e.default,...vt(e)});class ji extends wt{_parse(t){let{ctx:e}=this._processInputParams(t),r={...e,common:{...e.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});if(Mi(i))return i.then((n)=>({status:"valid",value:n.status==="valid"?n.value:this._def.catchValue({get error(){return new ie(r.common.issues)},input:r.data})}));else return{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new ie(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ji.create=(t,e)=>new ji({innerType:t,typeName:ft.ZodCatch,catchValue:typeof e.catch==="function"?e.catch:()=>e.catch,...vt(e)});class En extends wt{_parse(t){if(this._getType(t)!==nt.nan){let r=this._getOrReturnCtx(t);return rt(r,{code:V.invalid_type,expected:nt.nan,received:r.parsedType}),ut}return{status:"valid",value:t.data}}}En.create=(t)=>new En({typeName:ft.ZodNaN,...vt(t)});var ET=Symbol("zod_brand");class Js extends wt{_parse(t){let{ctx:e}=this._processInputParams(t),r=e.data;return this._def.type._parse({data:r,path:e.path,parent:e})}unwrap(){return this._def.type}}class Tn extends wt{_parse(t){let{status:e,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let n=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});if(n.status==="aborted")return ut;if(n.status==="dirty")return e.dirty(),Er(n.value);else return this._def.out._parseAsync({data:n.value,path:r.path,parent:r})})();else{let i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});if(i.status==="aborted")return ut;if(i.status==="dirty")return e.dirty(),{status:"dirty",value:i.value};else return this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(t,e){return new Tn({in:t,out:e,typeName:ft.ZodPipeline})}}class $i extends wt{_parse(t){let e=this._def.innerType._parse(t),r=(i)=>{if(rr(i))i.value=Object.freeze(i.value);return i};return Mi(e)?e.then((i)=>r(i)):r(e)}unwrap(){return this._def.innerType}}$i.create=(t,e)=>new $i({innerType:t,typeName:ft.ZodReadonly,...vt(e)});var TT={object:Ot.lazycreate},ft;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ft||(ft={}));var h=Ae.create,w=Nr.create,NT=En.create,WT=Wr.create,L=In.create,RT=Ci.create,OT=Mn.create,jT=Yi.create,$T=Li.create,$m=kn.create,Xm=ir.create,XT=Be.create,VT=Cn.create,Q=de.create,{create:A,strictCreate:zT}=Ot,Et=Ei.create,Xi=Ks.create,DT=Ti.create,Z2=Fe.create,Nn=Yn.create,UT=Ln.create,GT=Rr.create,HT=ki.create,QT=Ni.create,g=Wi.create,gt=nr.create,ZT=Ri.create,KT=Or.create,JT=ue.create,qT=me.create,tN=Ve.create,eN=ue.createWithPreprocess,rN=Tn.create;var Wn=h().or(w()).transform((t)=>qt(t,"Ω").value),ec=h().or(w()).transform((t)=>qt(t,"F").value).transform((t)=>Number.parseFloat(t.toPrecision(12))),Dm=h().or(w()).transform((t)=>qt(t,"H").value),Ie=h().or(w()).transform((t)=>qt(t,"V").value),K=h().or(w()).transform((t)=>qt(t).value),or=h().or(w()).transform((t)=>qt(t,"Hz").value),C=K,jr=h().or(w()).transform((t)=>qt(t,"A").value),$r=h().or(w()).transform((t)=>qt(t).value),K2=$r,Vt=$r,Um=h().datetime(),jt=h().or(w()).transform((t)=>{if(typeof t==="number")return t;if(t.endsWith("deg"))return Number.parseFloat(t.split("deg")[0]);if(t.endsWith("rad"))return Number.parseFloat(t.split("rad")[0])*180/Math.PI;return Number.parseFloat(t)}),Gm=w().or(h().endsWith("mAh")).transform((t)=>{if(typeof t==="string"){let e=t.replace("mAh",""),r=Number.parseFloat(e);if(Number.isNaN(r))throw Error("Invalid capacity");return r}return t}).describe("Battery capacity in mAh"),v=(t)=>{};v("extra props b");v("missing props b");v(!0);v("mismatched prop types: a");var ar=(t)=>{};ar(!0);ar('T1 has extra: "c", T2 has extra: "d"');ar('T1 has extra: "c"');ar('T2 has extra: "c"');ar('T1 has extra: "d", T2 has extra: "c"');ar(!0);var it=A({x:C,y:C}),J2=it;v(!0);v(!0);var Pe=A({x:C,y:C,z:C}),q2=Pe;v(!0);var rc=A({width:w(),height:w()});v(!0);var t9=(t)=>Array.from({length:t},()=>"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"[Math.floor(Math.random()*62)]).join(""),T=(t)=>h().optional().default(()=>`${t}_${t9(10)}`),Me=gt(["top_left","top_center","top_right","center_left","center","center_right","bottom_left","bottom_center","bottom_right"]);v(!0);var e9=gt(["top_silkscreen","bottom_silkscreen","top_copper","bottom_copper","top_soldermask","bottom_soldermask","top_fabrication_note","bottom_fabrication_note","top_user_note","bottom_user_note","top_courtyard","bottom_courtyard","inner1_copper","inner2_copper","inner3_copper","inner4_copper","inner5_copper","inner6_copper","edge_cuts","drill"]);v(!0);var ic=A({project_relative_path:h(),url:h(),mimetype:h()});v(!0);var Rn=it.extend({rotation:jt.optional()});v(!0);var nc=A({size:it.optional(),thickness:C.optional()});v(!0);var Hm=A({font:nc.optional()});v(!0);var Vi=A({value:h(),at:Rn.optional(),layer:h().optional(),uuid:h().optional(),hide:L().optional(),effects:Hm.optional()});v(!0);var Qm=A({Reference:Vi.optional(),Value:Vi.optional(),Datasheet:Vi.optional(),Description:Vi.optional()});v(!0);var Zm=A({through_hole:L().optional(),smd:L().optional(),exclude_from_pos_files:L().optional(),exclude_from_bom:L().optional()});v(!0);var Km=A({name:h(),type:h(),shape:h().optional(),at:Rn.optional(),size:it.optional(),drill:C.optional(),layers:Q(h()).optional(),removeUnusedLayers:L().optional(),uuid:h().optional()});v(!0);var Jm=A({path:h(),offset:Pe.optional(),scale:Pe.optional(),rotate:Pe.optional()});v(!0);var qm=A({footprintName:h().optional(),version:Et([w(),h()]).optional(),generator:h().optional(),generatorVersion:Et([w(),h()]).optional(),layer:h().optional(),properties:Qm.optional(),attributes:Zm.optional(),pads:Q(Km).optional(),embeddedFonts:L().optional(),model:Jm.optional()});v(!0);var tu=A({hide:L().optional()});v(!0);var eu=A({offset:C.optional(),hide:L().optional()});v(!0);var ru=A({font:nc.optional(),justify:Et([h(),Q(h())]).optional(),hide:L().optional()});v(!0);var ze=A({value:h(),id:Et([w(),h()]).optional(),at:Rn.optional(),effects:ru.optional()});v(!0);var iu=A({Reference:ze.optional(),Value:ze.optional(),Footprint:ze.optional(),Datasheet:ze.optional(),Description:ze.optional(),ki_keywords:ze.optional(),ki_fp_filters:ze.optional()});v(!0);var nu=A({symbolName:h().optional(),extends:h().optional(),pinNumbers:tu.optional(),pinNames:eu.optional(),excludeFromSim:L().optional(),inBom:L().optional(),onBoard:L().optional(),properties:iu.optional(),embeddedFonts:L().optional()});v(!0);var Mt=A({error_type:h(),message:h(),is_fatal:L().optional()});v(!0);var oc=gt(["jlcpcb","macrofab","pcbway","digikey","mouser","lcsc"]);v(!0);var Yt=A({type:g("source_component"),ftype:h().optional(),source_component_id:h(),name:h(),manufacturer_part_number:h().optional(),supplier_part_numbers:Nn(oc,Q(h())).optional(),display_value:h().optional(),display_name:h().optional(),are_pins_interchangeable:L().optional(),internally_connected_source_port_ids:Q(Q(h())).optional(),source_group_id:h().optional(),subcircuit_id:h().optional()});v(!0);var ac=Yt.extend({ftype:g("simple_capacitor"),capacitance:ec,max_voltage_rating:Ie.optional(),display_capacitance:h().optional(),max_decoupling_trace_length:C.optional()});v(!0);var sc=Yt.extend({ftype:g("simple_resistor"),resistance:Wn,display_resistance:h().optional()});v(!0);var On=Yt.extend({ftype:g("simple_diode")});v(!0);var ou=Yt.extend({ftype:g("simple_fiducial")});v(!0);var cc=On.extend({ftype:g("simple_led"),color:h().optional(),wavelength:h().optional()});v(!0);var au=Yt.extend({ftype:g("simple_ground")});v(!0);var lc=Yt.extend({ftype:g("simple_chip")});v(!0);var pc=Yt.extend({ftype:g("simple_power_source"),voltage:Ie});v(!0);var su=Yt.extend({ftype:g("simple_current_source"),current:jr,frequency:or.optional(),peak_to_peak_current:jr.optional(),wave_shape:gt(["sine","square","triangle","sawtooth","dc"]).optional().default("dc"),phase:w().optional(),duty_cycle:w().min(0).max(1).optional()});v(!0);var cu=Yt.extend({ftype:g("simple_ammeter")});v(!0);var lu=A({must_be_connected:L().optional(),provides_power:L().optional(),requires_power:L().optional(),provides_ground:L().optional(),requires_ground:L().optional(),provides_voltage:Et([h(),w()]).optional(),requires_voltage:Et([h(),w()]).optional(),do_not_connect:L().optional(),include_in_board_pinout:L().optional(),can_use_internal_pullup:L().optional(),is_using_internal_pullup:L().optional(),needs_external_pullup:L().optional(),can_use_internal_pulldown:L().optional(),is_using_internal_pulldown:L().optional(),needs_external_pulldown:L().optional(),can_use_open_drain:L().optional(),is_using_open_drain:L().optional(),can_use_push_pull:L().optional(),is_using_push_pull:L().optional(),should_have_decoupling_capacitor:L().optional(),recommended_decoupling_capacitor_capacitance:Et([h(),w()]).optional(),is_configured_for_i2c_sda:L().optional(),is_configured_for_i2c_scl:L().optional(),is_configured_for_spi_mosi:L().optional(),is_configured_for_spi_miso:L().optional(),is_configured_for_spi_sck:L().optional(),is_configured_for_spi_cs:L().optional(),is_configured_for_uart_tx:L().optional(),is_configured_for_uart_rx:L().optional(),supports_i2c_sda:L().optional(),supports_i2c_scl:L().optional(),supports_spi_mosi:L().optional(),supports_spi_miso:L().optional(),supports_spi_sck:L().optional(),supports_spi_cs:L().optional(),supports_uart_tx:L().optional(),supports_uart_rx:L().optional()});v(!0);var r9=Yt.extend({ftype:g("simple_fuse"),current_rating_amps:w().describe("Nominal current in amps the fuse is rated for"),voltage_rating_volts:w().describe("Voltage rating in volts, e.g. ±5V would be 5")});v(!0);var hc=Yt.extend({ftype:g("simple_battery"),capacity:Gm});v(!0);var dc=Yt.extend({ftype:g("simple_inductor"),inductance:Dm,display_inductance:h().optional(),max_current_rating:w().optional()});v(!0);var mc=Yt.extend({ftype:g("simple_push_button")});v(!0);var uc=Yt.extend({ftype:g("simple_potentiometer"),max_resistance:Wn,display_max_resistance:h().optional()});v(!0);var pu=Yt.extend({ftype:g("simple_crystal"),frequency:w().describe("Frequency in Hz"),load_capacitance:w().optional().describe("Load capacitance in pF"),pin_variant:gt(["two_pin","four_pin"]).optional()});v(!0);var yc=Yt.extend({ftype:g("simple_pin_header"),pin_count:w(),gender:gt(["male","female"]).optional().default("male")});v(!0);var hu=Yt.extend({ftype:g("simple_connector"),standard:gt(["usb_c","m2"]).optional()});v(!0);var fc=Yt.extend({ftype:g("simple_pinout")});v(!0);var _c=Yt.extend({ftype:g("simple_resonator"),load_capacitance:ec,equivalent_series_resistance:Wn.optional(),frequency:or});v(!0);var gc=Yt.extend({ftype:g("simple_transistor"),transistor_type:gt(["npn","pnp"])});v(!0);var xc=Yt.extend({ftype:g("simple_test_point"),footprint_variant:gt(["pad","through_hole"]).optional(),pad_shape:gt(["rect","circle"]).optional(),pad_diameter:Et([w(),h()]).optional(),hole_diameter:Et([w(),h()]).optional(),width:Et([w(),h()]).optional(),height:Et([w(),h()]).optional()});v(!0);var bc=Yt.extend({ftype:g("simple_mosfet"),channel_type:gt(["n","p"]),mosfet_mode:gt(["enhancement","depletion"])});v(!0);var vc=Yt.extend({ftype:g("simple_op_amp")});v(!0);var Sc=Yt.extend({ftype:g("simple_switch")});v(!0);var wc=A({type:g("source_project_metadata"),name:h().optional(),software_used_string:h().optional(),project_url:h().optional(),created_at:Um.optional()});v(!0);var du=Mt.extend({type:g("source_missing_property_error"),source_missing_property_error_id:T("source_missing_property_error"),source_component_id:h(),property_name:h(),subcircuit_id:h().optional(),error_type:g("source_missing_property_error").default("source_missing_property_error")}).describe("The source code is missing a property");v(!0);var mu=Mt.extend({type:g("source_failed_to_create_component_error"),source_failed_to_create_component_error_id:T("source_failed_to_create_component_error"),error_type:g("source_failed_to_create_component_error").default("source_failed_to_create_component_error"),component_name:h().optional(),subcircuit_id:h().optional(),parent_source_component_id:h().optional(),pcb_center:A({x:w().optional(),y:w().optional()}).optional(),schematic_center:A({x:w().optional(),y:w().optional()}).optional()}).describe("Error emitted when a component fails to be constructed");v(!0);var Ac=Mt.extend({type:g("source_invalid_component_property_error"),source_invalid_component_property_error_id:T("source_invalid_component_property_error"),source_component_id:h(),property_name:h(),property_value:Xm().optional(),expected_format:h().optional(),subcircuit_id:h().optional(),error_type:g("source_invalid_component_property_error").default("source_invalid_component_property_error")}).describe("The source component property is invalid");v(!0);var Bc=Mt.extend({type:g("source_trace_not_connected_error"),source_trace_not_connected_error_id:T("source_trace_not_connected_error"),error_type:g("source_trace_not_connected_error").default("source_trace_not_connected_error"),subcircuit_id:h().optional(),source_group_id:h().optional(),source_trace_id:h().optional(),connected_source_port_ids:Q(h()).optional(),selectors_not_found:Q(h()).optional()}).describe("Occurs when a source trace selector does not match any ports");v(!0);var uu=A({type:g("source_property_ignored_warning"),source_property_ignored_warning_id:T("source_property_ignored_warning"),source_component_id:h(),property_name:h(),subcircuit_id:h().optional(),error_type:g("source_property_ignored_warning").default("source_property_ignored_warning"),message:h()}).describe("The source property was ignored");v(!0);var Fc=A({type:g("source_pin_missing_trace_warning"),source_pin_missing_trace_warning_id:T("source_pin_missing_trace_warning"),warning_type:g("source_pin_missing_trace_warning").default("source_pin_missing_trace_warning"),message:h(),source_component_id:h(),source_port_id:h(),subcircuit_id:h().optional()}).describe("Warning emitted when a source component pin is missing a trace connection");v(!0);var Pc=A({type:g("source_missing_manufacturer_part_number_warning"),source_missing_manufacturer_part_number_warning_id:T("source_missing_manufacturer_part_number_warning"),warning_type:g("source_missing_manufacturer_part_number_warning").default("source_missing_manufacturer_part_number_warning"),message:h(),source_component_id:h(),standard:h(),subcircuit_id:h().optional()}).describe("Warning emitted when a standard connector is missing manufacturer part number");v(!0);var yu=Yt.extend({ftype:g("simple_voltage_probe")});v(!0);var fu=Yt.extend({ftype:g("interconnect")});v(!0);var Ic=Mt.extend({type:g("source_i2c_misconfigured_error"),source_i2c_misconfigured_error_id:T("source_i2c_misconfigured_error"),error_type:g("source_i2c_misconfigured_error").default("source_i2c_misconfigured_error"),source_port_ids:Q(h())}).describe("Error emitted when incompatible I2C pins (e.g. SDA and SCL) are connected to the same net");v(!0);var Mc=Mt.extend({type:g("source_component_misconfigured_error"),source_component_misconfigured_error_id:T("source_component_misconfigured_error"),error_type:g("source_component_misconfigured_error").default("source_component_misconfigured_error"),source_component_ids:Q(h()),source_port_ids:Q(h()).optional()}).describe("Error emitted when one or more source components have an invalid or conflicting configuration");v(!0);var _u=Yt.extend({ftype:g("simple_voltage_source"),voltage:Ie,frequency:or.optional(),peak_to_peak_voltage:Ie.optional(),wave_shape:gt(["sinewave","square","triangle","sawtooth"]).optional(),phase:jt.optional(),duty_cycle:w().optional().describe("Duty cycle as a fraction (0 to 1)"),pulse_delay:Vt.optional(),rise_time:Vt.optional(),fall_time:Vt.optional(),pulse_width:Vt.optional(),period:Vt.optional()});v(!0);var gu=Et([sc,ac,On,ou,cc,au,lc,pc,su,cu,hc,dc,mc,uc,pu,yc,hu,fc,_c,Sc,gc,xc,bc,vc,r9,yu,fu,_u,wc,du,Ac,mu,Bc,uu,Fc,Pc,Ic,Mc]);v(!0);var xu=A({type:g("source_port"),pin_number:w().optional(),port_hints:Q(h()).optional(),name:h(),source_port_id:h(),source_component_id:h().optional(),source_group_id:h().optional(),most_frequently_referenced_by_name:h().optional(),subcircuit_id:h().optional(),subcircuit_connectivity_map_key:h().optional()}).merge(lu);v(!0);var bu=A({type:g("source_component_internal_connection"),source_component_internal_connection_id:h(),source_component_id:h(),source_port_ids:Q(h()),subcircuit_id:h().optional()});v(!0);var vu=A({type:g("source_trace"),source_trace_id:h(),connected_source_port_ids:Q(h()),connected_source_net_ids:Q(h()),subcircuit_id:h().optional(),subcircuit_connectivity_map_key:h().optional(),max_length:w().optional(),name:h().optional(),min_trace_thickness:w().optional(),display_name:h().optional()});v(!0);var Su=A({type:g("source_group"),source_group_id:h(),subcircuit_id:h().optional(),parent_subcircuit_id:h().optional(),parent_source_group_id:h().optional(),is_subcircuit:L().optional(),show_as_schematic_box:L().optional(),name:h().optional(),was_automatically_named:L().optional()});v(!0);var wu=A({type:g("source_net"),source_net_id:h(),name:h(),member_source_group_ids:Q(h()),is_power:L().optional(),is_ground:L().optional(),is_digital_signal:L().optional(),is_analog_signal:L().optional(),is_positive_voltage_source:L().optional(),trace_width:w().optional(),subcircuit_id:h().optional(),subcircuit_connectivity_map_key:h().optional()});v(!0);var Au=A({type:g("source_board"),source_board_id:h(),source_group_id:h(),title:h().optional()}).describe("Defines a board in the source domain");v(!0);var Bu=Mt.extend({type:g("source_ambiguous_port_reference"),source_ambiguous_port_reference_id:T("source_ambiguous_port_reference"),error_type:g("source_ambiguous_port_reference").default("source_ambiguous_port_reference"),source_port_id:h().optional(),source_component_id:h().optional()}).describe("Error emitted when a port hint matches multiple non-overlapping pads, making the port reference ambiguous");v(!0);var Fu=A({type:g("source_pcb_ground_plane"),source_pcb_ground_plane_id:h(),source_group_id:h(),source_net_id:h(),subcircuit_id:h().optional()}).describe("Defines a ground plane in the source domain");v(!0);var Pu=["top","bottom","inner1","inner2","inner3","inner4","inner5","inner6"],qs=gt(Pu),St=qs.or(A({name:qs})).transform((t)=>{if(typeof t==="string")return t;return t.name});v(!0);var zt=gt(["top","bottom"]),Iu=A({type:g("source_manually_placed_via"),source_manually_placed_via_id:h(),source_group_id:h(),source_net_id:h(),subcircuit_id:h().optional(),source_trace_id:h().optional()}).describe("Defines a via that is manually placed in the source domain");v(!0);var Mu=A({type:g("source_unnamed_trace_warning"),source_unnamed_trace_warning_id:T("source_unnamed_trace_warning"),warning_type:g("source_unnamed_trace_warning").default("source_unnamed_trace_warning"),message:h(),source_trace_id:h(),subcircuit_id:h().optional()}).describe("Warning emitted when a source trace is missing a name");v(!0);var ku=A({type:g("source_no_power_pin_defined_warning"),source_no_power_pin_defined_warning_id:T("source_no_power_pin_defined_warning"),warning_type:g("source_no_power_pin_defined_warning").default("source_no_power_pin_defined_warning"),message:h(),source_component_id:h(),source_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Warning emitted when a chip has no source ports with requires_power=true");v(!0);var Cu=A({type:g("source_no_ground_pin_defined_warning"),source_no_ground_pin_defined_warning_id:T("source_no_ground_pin_defined_warning"),warning_type:g("source_no_ground_pin_defined_warning").default("source_no_ground_pin_defined_warning"),message:h(),source_component_id:h(),source_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Warning emitted when a chip has no source ports marked as ground pins");v(!0);var Yu=A({type:g("source_component_pins_underspecified_warning"),source_component_pins_underspecified_warning_id:T("source_component_pins_underspecified_warning"),warning_type:g("source_component_pins_underspecified_warning").default("source_component_pins_underspecified_warning"),message:h(),source_component_id:h(),source_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Warning emitted when all ports on a source component are underspecified");v(!0);var Lu=Mt.extend({type:g("source_pin_must_be_connected_error"),source_pin_must_be_connected_error_id:T("source_pin_must_be_connected_error"),error_type:g("source_pin_must_be_connected_error").default("source_pin_must_be_connected_error"),source_component_id:h(),source_port_id:h(),subcircuit_id:h().optional()}).describe("Error emitted when a pin with mustBeConnected attribute is not connected to any trace");v(!0);var Eu=Mt.extend({type:g("unknown_error_finding_part"),unknown_error_finding_part_id:T("unknown_error_finding_part"),error_type:g("unknown_error_finding_part").default("unknown_error_finding_part"),source_component_id:h().optional(),subcircuit_id:h().optional()}).describe("Error emitted when an unexpected error occurs while finding a part");v(!0);var Tu=A({type:g("schematic_box"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),width:C,height:C,is_dashed:L().default(!1),x:C,y:C,subcircuit_id:h().optional()}).describe("Draws a box on the schematic");v(!0);var Nu=A({type:g("schematic_path"),schematic_path_id:T("schematic_path"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),fill_color:h().optional(),is_filled:L().optional(),is_dashed:L().default(!1),stroke_width:C.nullable().optional(),stroke_color:h().optional(),dash_length:C.optional(),dash_gap:C.optional(),points:Q(it),subcircuit_id:h().optional()});v(!0);var Wu=Nn(A({left_margin:K.optional(),right_margin:K.optional(),top_margin:K.optional(),bottom_margin:K.optional()})),Ru=A({left_size:w(),right_size:w(),top_size:w().optional(),bottom_size:w().optional()});v(!0);var Ou=A({left_side:A({pins:Q(w()),direction:gt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),right_side:A({pins:Q(w()),direction:gt(["top-to-bottom","bottom-to-top"]).optional()}).optional(),top_side:A({pins:Q(w()),direction:gt(["left-to-right","right-to-left"]).optional()}).optional(),bottom_side:A({pins:Q(w()),direction:gt(["left-to-right","right-to-left"]).optional()}).optional()});v(!0);var ju=Et([Ru,Ou]),$u=A({type:g("schematic_component"),size:rc,center:it,source_component_id:h().optional(),schematic_component_id:h(),schematic_sheet_id:h().optional(),schematic_symbol_id:h().optional(),pin_spacing:K.optional(),pin_styles:Wu.optional(),box_width:K.optional(),symbol_name:h().optional(),port_arrangement:ju.optional(),port_labels:Nn(h()).optional(),symbol_display_value:h().optional(),subcircuit_id:h().optional(),schematic_group_id:h().optional(),is_schematic_group:L().optional(),source_group_id:h().optional(),is_box_with_pins:L().optional().default(!0)});v(!0);var i9=A({kicad_symbol:nu.optional()}).catchall(Xm()),Xu=A({type:g("schematic_symbol"),schematic_symbol_id:h(),name:h().optional(),metadata:i9.optional()}).describe("Defines a named schematic symbol that can be referenced by components.");v(!0);var Vu=A({type:g("schematic_line"),schematic_line_id:T("schematic_line"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),x1:C,y1:C,x2:C,y2:C,stroke_width:C.nullable().optional(),color:h().default("#000000"),is_dashed:L().default(!1),dash_length:C.optional(),dash_gap:C.optional(),subcircuit_id:h().optional()}).describe("Draws a styled line on the schematic");v(!0);var zu=A({type:g("schematic_rect"),schematic_rect_id:T("schematic_rect"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),center:it,width:C,height:C,rotation:jt.default(0),stroke_width:C.nullable().optional(),color:h().default("#000000"),is_filled:L().default(!1),fill_color:h().optional(),is_dashed:L().default(!1),subcircuit_id:h().optional()}).describe("Draws a styled rectangle on the schematic");v(!0);var Du=A({type:g("schematic_circle"),schematic_circle_id:T("schematic_circle"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),center:it,radius:C,stroke_width:C.nullable().optional(),color:h().default("#000000"),is_filled:L().default(!1),fill_color:h().optional(),is_dashed:L().default(!1),subcircuit_id:h().optional()}).describe("Draws a styled circle on the schematic");v(!0);var Uu=A({type:g("schematic_arc"),schematic_arc_id:T("schematic_arc"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),center:it,radius:C,start_angle_degrees:jt,end_angle_degrees:jt,direction:gt(["clockwise","counterclockwise"]).default("counterclockwise"),stroke_width:C.nullable().optional(),color:h().default("#000000"),is_dashed:L().default(!1),subcircuit_id:h().optional()}).describe("Draws a styled arc on the schematic");v(!0);var Gu=A({type:g("schematic_trace"),schematic_trace_id:h(),schematic_sheet_id:h().optional(),source_trace_id:h().optional(),junctions:Q(A({x:w(),y:w()})),edges:Q(A({from:A({x:w(),y:w()}),to:A({x:w(),y:w()}),is_crossing:L().optional(),from_schematic_port_id:h().optional(),to_schematic_port_id:h().optional()})),subcircuit_id:h().optional(),subcircuit_connectivity_map_key:h().optional()});v(!0);var n9=gt(["center","left","right","top","bottom"]);v(!0);var Hu=A({type:g("schematic_text"),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),schematic_symbol_id:h().optional(),schematic_text_id:h(),text:h(),font_size:w().default(0.18),position:A({x:C,y:C}),rotation:w().default(0),anchor:Et([n9.describe("legacy"),Me]).default("center"),color:h().default("#000000"),subcircuit_id:h().optional()});v(!0);var Qu=A({type:g("schematic_port"),schematic_port_id:h(),source_port_id:h(),schematic_sheet_id:h().optional(),schematic_component_id:h().optional(),center:it,facing_direction:gt(["up","down","left","right"]).optional(),distance_from_component_edge:w().optional(),side_of_component:gt(["top","bottom","left","right"]).optional(),true_ccw_index:w().optional(),pin_number:w().optional(),display_pin_label:h().optional(),subcircuit_id:h().optional(),is_connected:L().optional(),has_input_arrow:L().optional(),has_output_arrow:L().optional(),is_drawn_with_inversion_circle:L().optional()}).describe("Defines a port on a schematic component");v(!0);var Zu=A({type:g("schematic_net_label"),schematic_net_label_id:T("schematic_net_label"),schematic_sheet_id:h().optional(),schematic_trace_id:h().optional(),source_trace_id:h().optional(),source_net_id:h(),center:it,anchor_position:it.optional(),anchor_side:gt(["top","bottom","left","right"]),text:h(),symbol_name:h().optional(),is_movable:L().optional(),subcircuit_id:h().optional()});v(!0);var Ku=Mt.extend({type:g("schematic_error"),schematic_error_id:h(),error_type:g("schematic_port_not_found").default("schematic_port_not_found"),subcircuit_id:h().optional()}).describe("Defines a schematic error on the schematic");v(!0);var Ju=Mt.extend({type:g("schematic_layout_error"),schematic_layout_error_id:T("schematic_layout_error"),error_type:g("schematic_layout_error").default("schematic_layout_error"),source_group_id:h(),schematic_group_id:h(),subcircuit_id:h().optional()}).describe("Error emitted when schematic layout fails for a group");v(!0);var jn=A({type:g("schematic_debug_object"),label:h().optional(),subcircuit_id:h().optional()}),qu=jn.extend({shape:g("rect"),center:it,size:rc}),ty=jn.extend({shape:g("line"),start:it,end:it}),ey=jn.extend({shape:g("point"),center:it}),ry=Xi("shape",[qu,ty,ey]);v(!0);var iy=A({type:g("schematic_voltage_probe"),schematic_voltage_probe_id:h(),schematic_sheet_id:h().optional(),source_component_id:h().optional(),name:h().optional(),position:it,schematic_trace_id:h(),voltage:Ie.optional(),subcircuit_id:h().optional(),color:h().optional(),label_alignment:Me.optional()}).describe("Defines a voltage probe measurement point on a schematic trace");v(!0);var ny=A({type:g("schematic_manual_edit_conflict_warning"),schematic_manual_edit_conflict_warning_id:T("schematic_manual_edit_conflict_warning"),warning_type:g("schematic_manual_edit_conflict_warning").default("schematic_manual_edit_conflict_warning"),message:h(),schematic_component_id:h(),schematic_group_id:h().optional(),subcircuit_id:h().optional(),source_component_id:h()}).describe("Warning emitted when a component has both manual placement and explicit schX/schY coordinates");v(!0);var oy=A({type:g("schematic_group"),schematic_group_id:T("schematic_group"),schematic_sheet_id:h().optional(),source_group_id:h(),is_subcircuit:L().optional(),subcircuit_id:h().optional(),width:K,height:K,center:it,schematic_component_ids:Q(h()),show_as_schematic_box:L().optional(),name:h().optional(),description:h().optional()}).describe("Defines a group of components on the schematic");v(!0);var ay=A({type:g("schematic_table"),schematic_table_id:T("schematic_table"),schematic_sheet_id:h().optional(),anchor_position:it,column_widths:Q(C),row_heights:Q(C),cell_padding:C.optional(),border_width:C.optional(),subcircuit_id:h().optional(),schematic_component_id:h().optional(),anchor:Me.optional()}).describe("Defines a table on the schematic");v(!0);var sy=A({type:g("schematic_table_cell"),schematic_table_cell_id:T("schematic_table_cell"),schematic_sheet_id:h().optional(),schematic_table_id:h(),start_row_index:w(),end_row_index:w(),start_column_index:w(),end_column_index:w(),text:h().optional(),center:it,width:C,height:C,horizontal_align:gt(["left","center","right"]).optional(),vertical_align:gt(["top","middle","bottom"]).optional(),font_size:C.optional(),subcircuit_id:h().optional()}).describe("Defines a cell within a schematic_table");v(!0);var cy=A({type:g("schematic_sheet"),schematic_sheet_id:T("schematic_sheet"),name:h().optional(),sheet_index:w().optional(),subcircuit_id:h().optional(),outline_color:h().optional()}).describe("Defines a schematic sheet or page that components can be placed on");v(!0);var ly=A({x:C,y:C,bulge:w().optional()});v(!0);var tc=A({vertices:Q(ly)});v(!0);var kc=A({outer_ring:tc,inner_rings:Q(tc).default([])});v(!0);var py=A({x:C,y:C,via:L().optional(),via_to_layer:St.optional()}),o9=Q(py);v(!0);v(!0);var hy=A({x:C,y:C,via:L().optional(),to_layer:St.optional(),trace_width:C.optional()});v(!0);var dy=A({min_trace_width:K.optional(),min_board_edge_clearance:K.optional(),min_via_hole_edge_to_via_hole_edge_clearance:K.optional(),min_plated_hole_drill_edge_to_drill_edge_clearance:K.optional(),min_trace_to_pad_edge_clearance:K.optional(),min_pad_edge_to_pad_edge_clearance:K.optional(),min_same_net_trace_edge_to_trace_edge_clearance:K.optional(),min_different_net_trace_edge_to_trace_edge_clearance:K.optional(),min_via_edge_to_pad_edge_clearance:K.optional(),min_via_hole_diameter:K.optional(),min_via_pad_diameter:K.optional()}),my=A({type:g("pcb_component"),pcb_component_id:T("pcb_component"),source_component_id:h(),center:it,layer:St,rotation:jt,display_offset_x:h().optional().describe("How to display the x offset for this part, usually corresponding with how the user specified it"),display_offset_y:h().optional().describe("How to display the y offset for this part, usually corresponding with how the user specified it"),width:K,height:K,do_not_place:L().optional(),is_allowed_to_be_off_board:L().optional(),subcircuit_id:h().optional(),pcb_group_id:h().optional(),position_mode:gt(["packed","relative_to_group_anchor","relative_to_another_component","none"]).optional(),anchor_position:it.optional(),anchor_alignment:Me.optional(),positioned_relative_to_pcb_group_id:h().optional(),positioned_relative_to_pcb_board_id:h().optional(),cable_insertion_center:it.optional(),insertion_direction:gt(["from_above","from_left","from_right","from_front","from_back"]).optional(),metadata:A({kicad_footprint:qm.optional()}).optional(),obstructs_within_bounds:L().default(!0).describe("Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath")}).describe("Defines a component on the PCB");v(!0);var uy=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:g("circle"),hole_diameter:w(),x:C,y:C,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),a9=uy.describe("Defines a circular hole on the PCB");v(!0);var yy=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:g("rect"),hole_width:w(),hole_height:w(),x:C,y:C,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),s9=yy.describe("Defines a rectangular (square-capable) hole on the PCB. Use equal width/height for square.");v(!0);var fy=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:gt(["circle","square"]),hole_diameter:w(),x:C,y:C,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),c9=fy.describe("Defines a circular or square hole on the PCB");v(!0);var _y=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:g("oval"),hole_width:w(),hole_height:w(),x:C,y:C,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),l9=_y.describe("Defines an oval hole on the PCB");v(!0);var gy=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:g("pill"),hole_width:w(),hole_height:w(),x:C,y:C,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),p9=gy.describe("Defines a pill-shaped hole on the PCB");v(!0);var xy=A({type:g("pcb_hole"),pcb_hole_id:T("pcb_hole"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_component_id:h().optional(),hole_shape:g("rotated_pill"),hole_width:w(),hole_height:w(),x:C,y:C,ccw_rotation:jt,is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),h9=xy.describe("Defines a rotated pill-shaped hole on the PCB");v(!0);var by=fy.or(_y).or(gy).or(xy).or(uy).or(yy),d9=A({type:g("pcb_plated_hole"),shape:g("circle"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),outer_diameter:w(),hole_diameter:w(),is_covered_with_solder_mask:L().optional(),x:C,y:C,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional()}),m9=A({type:g("pcb_plated_hole"),shape:gt(["oval","pill"]),pcb_group_id:h().optional(),subcircuit_id:h().optional(),outer_width:w(),outer_height:w(),hole_width:w(),hole_height:w(),is_covered_with_solder_mask:L().optional(),x:C,y:C,ccw_rotation:jt,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional()}),u9=A({type:g("pcb_plated_hole"),shape:g("circular_hole_with_rect_pad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),hole_shape:g("circle"),pad_shape:g("rect"),hole_diameter:w(),rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),hole_offset_x:C.default(0),hole_offset_y:C.default(0),is_covered_with_solder_mask:L().optional(),x:C,y:C,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional(),rect_ccw_rotation:jt.optional()}),y9=A({type:g("pcb_plated_hole"),shape:g("pill_hole_with_rect_pad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),hole_shape:g("pill"),pad_shape:g("rect"),hole_width:w(),hole_height:w(),rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),hole_offset_x:C.default(0),hole_offset_y:C.default(0),is_covered_with_solder_mask:L().optional(),x:C,y:C,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional()}),f9=A({type:g("pcb_plated_hole"),shape:g("rotated_pill_hole_with_rect_pad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),hole_shape:g("rotated_pill"),pad_shape:g("rect"),hole_width:w(),hole_height:w(),hole_ccw_rotation:jt,rect_pad_width:w(),rect_pad_height:w(),rect_border_radius:w().optional(),rect_ccw_rotation:jt,hole_offset_x:C.default(0),hole_offset_y:C.default(0),is_covered_with_solder_mask:L().optional(),x:C,y:C,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional()}),_9=A({type:g("pcb_plated_hole"),shape:g("hole_with_polygon_pad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),hole_shape:gt(["circle","oval","pill","rotated_pill"]),hole_diameter:w().optional(),hole_width:w().optional(),hole_height:w().optional(),pad_outline:Q(A({x:C,y:C})).min(3),hole_offset_x:C.default(0),hole_offset_y:C.default(0),is_covered_with_solder_mask:L().optional(),x:C,y:C,layers:Q(St),port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),pcb_plated_hole_id:T("pcb_plated_hole"),soldermask_margin:w().optional(),ccw_rotation:jt.optional()}),vy=Et([d9,m9,u9,y9,f9,_9]);v(!0);v(!0);v(!0);v(!0);v(!0);v(!0);var Sy=A({type:g("pcb_port"),pcb_port_id:T("pcb_port"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),source_port_id:h(),pcb_component_id:h().optional(),x:C,y:C,layers:Q(St),is_board_pinout:L().optional()}).describe("Defines a port on the PCB");v(!0);var g9=A({type:g("pcb_smtpad"),shape:g("circle"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,radius:w(),layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),x9=A({type:g("pcb_smtpad"),shape:g("rect"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),rect_border_radius:w().optional(),corner_radius:w().optional(),layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional(),soldermask_margin_left:w().optional(),soldermask_margin_top:w().optional(),soldermask_margin_right:w().optional(),soldermask_margin_bottom:w().optional()}),b9=A({type:g("pcb_smtpad"),shape:g("rotated_rect"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),rect_border_radius:w().optional(),corner_radius:w().optional(),ccw_rotation:jt,layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional(),soldermask_margin_left:w().optional(),soldermask_margin_top:w().optional(),soldermask_margin_right:w().optional(),soldermask_margin_bottom:w().optional()}),wy=A({type:g("pcb_smtpad"),shape:g("pill"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),radius:w(),layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),v9=A({type:g("pcb_smtpad"),shape:g("rotated_pill"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),radius:w(),ccw_rotation:jt,layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),S9=A({type:g("pcb_smtpad"),shape:g("polygon"),pcb_smtpad_id:T("pcb_smtpad"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),points:Q(it),layer:St,port_hints:Q(h()).optional(),pcb_component_id:h().optional(),pcb_port_id:h().optional(),is_covered_with_solder_mask:L().optional(),soldermask_margin:w().optional()}),Ay=Xi("shape",[g9,x9,b9,v9,wy,S9]).describe("Defines an SMT pad on the PCB");v(!0);v(!0);v(!0);v(!0);v(!0);v(!0);var w9=A({type:g("pcb_solder_paste"),shape:g("circle"),pcb_solder_paste_id:T("pcb_solder_paste"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,radius:w(),layer:St,pcb_component_id:h().optional(),pcb_smtpad_id:h().optional()}),A9=A({type:g("pcb_solder_paste"),shape:g("rect"),pcb_solder_paste_id:T("pcb_solder_paste"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),layer:St,pcb_component_id:h().optional(),pcb_smtpad_id:h().optional()}),B9=A({type:g("pcb_solder_paste"),shape:g("pill"),pcb_solder_paste_id:T("pcb_solder_paste"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),radius:w(),layer:St,pcb_component_id:h().optional(),pcb_smtpad_id:h().optional()}),F9=A({type:g("pcb_solder_paste"),shape:g("rotated_rect"),pcb_solder_paste_id:T("pcb_solder_paste"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),ccw_rotation:C,layer:St,pcb_component_id:h().optional(),pcb_smtpad_id:h().optional()}),P9=A({type:g("pcb_solder_paste"),shape:g("oval"),pcb_solder_paste_id:T("pcb_solder_paste"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),x:C,y:C,width:w(),height:w(),layer:St,pcb_component_id:h().optional(),pcb_smtpad_id:h().optional()}),By=Et([w9,A9,B9,F9,P9]).describe("Defines solderpaste on the PCB");v(!0);v(!0);v(!0);v(!0);v(!0);var Fy=A({type:g("pcb_text"),pcb_text_id:T("pcb_text"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),text:h(),center:it,layer:St,width:K,height:K,lines:w(),align:gt(["bottom-left"])}).describe("Defines text on the PCB");v(!0);var Py=A({route_type:g("wire"),x:C,y:C,width:C,copper_pour_id:h().optional(),is_inside_copper_pour:L().optional(),start_pcb_port_id:h().optional(),end_pcb_port_id:h().optional(),layer:St}),Iy=A({route_type:g("via"),x:C,y:C,copper_pour_id:h().optional(),is_inside_copper_pour:L().optional(),hole_diameter:C.optional(),outer_diameter:C.optional(),from_layer:St,to_layer:St}),My=A({route_type:g("through_pad"),start:it,end:it,width:C,start_layer:St,end_layer:St,pcb_smtpad_id:h().optional(),pcb_plated_hole_id:h().optional()}),ky=Et([Py,Iy,My]),Cy=A({type:g("pcb_trace"),source_trace_id:h().optional(),pcb_component_id:h().optional(),pcb_trace_id:T("pcb_trace"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),route_thickness_mode:gt(["constant","interpolated"]).default("constant").optional(),route_order_index:w().optional(),should_round_corners:L().optional(),trace_length:w().optional(),highlight_color:h().optional(),route:Q(ky)}).describe("Defines a trace on the PCB");v(!0);v(!0);var Yy=A({type:g("pcb_trace_warning"),pcb_trace_warning_id:T("pcb_trace_warning"),warning_type:g("pcb_trace_warning").default("pcb_trace_warning"),message:h(),center:it.optional(),pcb_trace_id:h(),source_trace_id:h(),pcb_component_ids:Q(h()),pcb_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Defines a trace warning on the PCB");v(!0);var Ly=Mt.extend({type:g("pcb_trace_error"),pcb_trace_error_id:T("pcb_trace_error"),error_type:g("pcb_trace_error").default("pcb_trace_error"),center:it.optional(),pcb_trace_id:h(),source_trace_id:h(),pcb_component_ids:Q(h()),pcb_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Defines a trace error on the PCB");v(!0);var Ey=Mt.extend({type:g("pcb_trace_missing_error"),pcb_trace_missing_error_id:T("pcb_trace_missing_error"),error_type:g("pcb_trace_missing_error").default("pcb_trace_missing_error"),center:it.optional(),source_trace_id:h(),pcb_component_ids:Q(h()),pcb_port_ids:Q(h()),subcircuit_id:h().optional()}).describe("Defines an error when a source trace has no corresponding PCB trace");v(!0);var Ty=Mt.extend({type:g("pcb_port_not_matched_error"),pcb_error_id:T("pcb_error"),error_type:g("pcb_port_not_matched_error").default("pcb_port_not_matched_error"),pcb_component_ids:Q(h()),subcircuit_id:h().optional()}).describe("Defines a trace error on the PCB where a port is not matched");v(!0);var Ny=Mt.extend({type:g("pcb_port_not_connected_error"),pcb_port_not_connected_error_id:T("pcb_port_not_connected_error"),error_type:g("pcb_port_not_connected_error").default("pcb_port_not_connected_error"),pcb_port_ids:Q(h()),pcb_component_ids:Q(h()),subcircuit_id:h().optional()}).describe("Defines an error when a pcb port is not connected to any trace");v(!0);var Wy=A({type:g("pcb_net"),pcb_net_id:T("pcb_net"),source_net_id:h().optional(),highlight_color:h().optional()}).describe("Defines a net on the PCB");v(!0);var Ry=A({type:g("pcb_via"),pcb_via_id:T("pcb_via"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),subcircuit_connectivity_map_key:h().optional(),x:C,y:C,outer_diameter:C.default("0.6mm"),hole_diameter:C.default("0.25mm"),from_layer:St.optional(),to_layer:St.optional(),layers:Q(St),pcb_trace_id:h().optional(),net_is_assignable:L().optional(),net_assigned:L().optional(),is_tented:L().optional()}).describe("Defines a via on the PCB");v(!0);var Oy=A({type:g("pcb_board"),pcb_board_id:T("pcb_board"),pcb_panel_id:h().optional(),carrier_pcb_board_id:h().optional(),is_subcircuit:L().optional(),subcircuit_id:h().optional(),is_mounted_to_carrier_board:L().optional(),width:K.optional(),height:K.optional(),center:it,display_offset_x:h().optional().describe("How to display the x offset for this board, usually corresponding with how the user specified it"),display_offset_y:h().optional().describe("How to display the y offset for this board, usually corresponding with how the user specified it"),thickness:K.optional().default(1.4),num_layers:w().optional().default(4),outline:Q(it).optional(),shape:gt(["rect","polygon"]).optional(),material:gt(["fr4","fr1"]).default("fr4"),solder_mask_color:h().optional(),silkscreen_color:h().optional(),anchor_position:it.optional(),anchor_alignment:Me.optional(),position_mode:gt(["relative_to_panel_anchor","none"]).optional()}).merge(dy).describe("Defines the board outline of the PCB");v(!0);var jy=A({type:g("pcb_panel"),pcb_panel_id:T("pcb_panel"),width:K,height:K,center:it,thickness:K.optional().default(1.4),covered_with_solder_mask:L().optional().default(!0)}).describe("Defines a PCB panel that can contain multiple boards");v(!0);var $y=Mt.extend({type:g("pcb_placement_error"),pcb_placement_error_id:T("pcb_placement_error"),error_type:g("pcb_placement_error").default("pcb_placement_error"),subcircuit_id:h().optional()}).describe("Defines a placement error on the PCB");v(!0);var Xy=Mt.extend({type:g("pcb_panelization_placement_error"),pcb_panelization_placement_error_id:T("pcb_panelization_placement_error"),error_type:g("pcb_panelization_placement_error").default("pcb_panelization_placement_error"),pcb_panel_id:h().optional(),pcb_board_id:h().optional(),subcircuit_id:h().optional()}).describe("Defines a panelization placement error on the PCB");v(!0);var Vy=A({type:g("pcb_trace_hint"),pcb_trace_hint_id:T("pcb_trace_hint"),pcb_port_id:h(),pcb_component_id:h(),route:Q(hy),subcircuit_id:h().optional()}).describe("A hint that can be used during generation of a PCB trace");v(!0);var zy=A({type:g("pcb_silkscreen_line"),pcb_silkscreen_line_id:T("pcb_silkscreen_line"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),stroke_width:C.default("0.1mm"),x1:C,y1:C,x2:C,y2:C,layer:zt}).describe("Defines a silkscreen line on the PCB");v(!0);var Dy=A({type:g("pcb_silkscreen_path"),pcb_silkscreen_path_id:T("pcb_silkscreen_path"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:zt,route:Q(it),stroke_width:K}).describe("Defines a silkscreen path on the PCB");v(!0);var Uy=A({type:g("pcb_silkscreen_text"),pcb_silkscreen_text_id:T("pcb_silkscreen_text"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:C.default("0.2mm"),pcb_component_id:h(),text:h(),is_knockout:L().default(!1).optional(),knockout_padding:A({left:K,top:K,bottom:K,right:K}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:w().optional(),layer:St,is_mirrored:L().default(!1).optional(),anchor_position:it.default({x:0,y:0}),anchor_alignment:Me.default("center")}).describe("Defines silkscreen text on the PCB");v(!0);var Gy=A({type:g("pcb_copper_text"),pcb_copper_text_id:T("pcb_copper_text"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:C.default("0.2mm"),pcb_component_id:h(),text:h(),is_knockout:L().default(!1).optional(),knockout_padding:A({left:K,top:K,bottom:K,right:K}).default({left:"0.2mm",top:"0.2mm",bottom:"0.2mm",right:"0.2mm"}).optional(),ccw_rotation:w().optional(),layer:St,is_mirrored:L().default(!1).optional(),anchor_position:it.default({x:0,y:0}),anchor_alignment:Me.default("center")}).describe("Defines copper text on the PCB");v(!0);var Hy=A({type:g("pcb_silkscreen_rect"),pcb_silkscreen_rect_id:T("pcb_silkscreen_rect"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:K,height:K,layer:St,stroke_width:K.default("1mm"),corner_radius:K.optional(),is_filled:L().default(!0).optional(),has_stroke:L().optional(),is_stroke_dashed:L().optional(),ccw_rotation:w().optional()}).describe("Defines a silkscreen rect on the PCB");v(!0);var Qy=A({type:g("pcb_silkscreen_circle"),pcb_silkscreen_circle_id:T("pcb_silkscreen_circle"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,radius:K,layer:zt,stroke_width:K.default("1mm"),is_filled:L().optional()}).describe("Defines a silkscreen circle on the PCB");v(!0);var Zy=A({type:g("pcb_silkscreen_oval"),pcb_silkscreen_oval_id:T("pcb_silkscreen_oval"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,radius_x:C,radius_y:C,layer:zt,ccw_rotation:jt.optional()}).describe("Defines a silkscreen oval on the PCB");v(!0);var I9=A({type:g("pcb_silkscreen_graphic"),pcb_silkscreen_graphic_id:T("pcb_silkscreen_graphic"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:zt,image_asset:ic.optional()}),Ky=I9.extend({shape:g("brep"),brep_shape:kc}).describe("Defines a BRep silkscreen graphic on the PCB");v(!0);var Jy=Xi("shape",[Ky]).describe("Defines a silkscreen graphic on the PCB");v(!0);var qy=A({type:g("pcb_silkscreen_pill"),pcb_silkscreen_pill_id:T("pcb_silkscreen_pill"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:K,height:K,layer:St,ccw_rotation:w().optional()}).describe("Defines a silkscreen pill on the PCB");v(!0);var tf=A({type:g("pcb_fabrication_note_text"),pcb_fabrication_note_text_id:T("pcb_fabrication_note_text"),subcircuit_id:h().optional(),pcb_group_id:h().optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:C.default("1mm"),pcb_component_id:h(),text:h(),ccw_rotation:w().optional(),layer:zt,anchor_position:it.default({x:0,y:0}),anchor_alignment:gt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),color:h().optional()}).describe("Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators");v(!0);var ef=A({type:g("pcb_fabrication_note_path"),pcb_fabrication_note_path_id:T("pcb_fabrication_note_path"),pcb_component_id:h(),subcircuit_id:h().optional(),layer:St,route:Q(it),stroke_width:K,color:h().optional()}).describe("Defines a fabrication path on the PCB for fabricators or assemblers");v(!0);var rf=A({type:g("pcb_fabrication_note_rect"),pcb_fabrication_note_rect_id:T("pcb_fabrication_note_rect"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:K,height:K,layer:zt,stroke_width:K.default("0.1mm"),corner_radius:K.optional(),is_filled:L().optional(),has_stroke:L().optional(),is_stroke_dashed:L().optional(),color:h().optional()}).describe("Defines a fabrication note rectangle on the PCB");v(!0);var nf=A({type:g("pcb_fabrication_note_dimension"),pcb_fabrication_note_dimension_id:T("pcb_fabrication_note_dimension"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:zt,from:it,to:it,text:h().optional(),text_ccw_rotation:w().optional(),offset:K.optional(),offset_distance:K.optional(),offset_direction:A({x:w(),y:w()}).optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:K.default("1mm"),color:h().optional(),arrow_size:K.default("1mm")}).describe("Defines a measurement annotation within PCB fabrication notes");v(!0);var of=A({type:g("pcb_note_text"),pcb_note_text_id:T("pcb_note_text"),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),name:h().optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:C.default("1mm"),text:h().optional(),anchor_position:it.default({x:0,y:0}),anchor_alignment:gt(["center","top_left","top_right","bottom_left","bottom_right"]).default("center"),layer:zt.default("top"),is_mirrored_from_top_view:L().optional(),color:h().optional()}).describe("Defines a documentation note in text on the PCB");v(!0);var af=A({type:g("pcb_note_rect"),pcb_note_rect_id:T("pcb_note_rect"),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),name:h().optional(),text:h().optional(),center:it,width:K,height:K,layer:zt.default("top"),stroke_width:K.default("0.1mm"),corner_radius:K.optional(),is_filled:L().optional(),has_stroke:L().optional(),is_stroke_dashed:L().optional(),color:h().optional()}).describe("Defines a rectangular documentation note on the PCB");v(!0);var sf=A({type:g("pcb_note_path"),pcb_note_path_id:T("pcb_note_path"),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),name:h().optional(),text:h().optional(),route:Q(it),layer:zt.default("top"),stroke_width:K.default("0.1mm"),color:h().optional()}).describe("Defines a polyline documentation note on the PCB");v(!0);var cf=A({type:g("pcb_note_line"),pcb_note_line_id:T("pcb_note_line"),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),name:h().optional(),text:h().optional(),x1:C,y1:C,x2:C,y2:C,layer:zt.default("top"),stroke_width:C.default("0.1mm"),color:h().optional(),is_dashed:L().optional()}).describe("Defines a straight documentation note line on the PCB");v(!0);var lf=A({type:g("pcb_note_dimension"),pcb_note_dimension_id:T("pcb_note_dimension"),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),name:h().optional(),from:it,to:it,text:h().optional(),text_ccw_rotation:w().optional(),offset_distance:K.optional(),offset_direction:A({x:w(),y:w()}).optional(),font:g("tscircuit2024").default("tscircuit2024"),font_size:K.default("1mm"),layer:zt.default("top"),color:h().optional(),arrow_size:K.default("1mm")}).describe("Defines a measurement annotation within PCB documentation notes");v(!0);var pf=Mt.extend({type:g("pcb_footprint_overlap_error"),pcb_error_id:T("pcb_error"),error_type:g("pcb_footprint_overlap_error").default("pcb_footprint_overlap_error"),pcb_smtpad_ids:Q(h()).optional(),pcb_plated_hole_ids:Q(h()).optional(),pcb_hole_ids:Q(h()).optional(),pcb_keepout_ids:Q(h()).optional()}).describe("Error emitted when a pcb footprint overlaps with another element");v(!0);var hf=Mt.extend({type:g("pcb_courtyard_overlap_error"),pcb_error_id:T("pcb_error"),error_type:g("pcb_courtyard_overlap_error").default("pcb_courtyard_overlap_error"),pcb_component_ids:Z2([h(),h()])}).describe("Error emitted when the courtyard (CrtYd) of one PCB component overlaps with the courtyard of another");v(!0);var df=A({type:g("pcb_keepout"),shape:g("rect"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:C,height:C,pcb_keepout_id:h(),layers:Q(h()),description:h().optional()}).or(A({type:g("pcb_keepout"),shape:g("circle"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,radius:C,pcb_keepout_id:h(),layers:Q(h()),description:h().optional()}));v(!0);var $n=A({type:g("pcb_cutout"),pcb_cutout_id:T("pcb_cutout"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),pcb_board_id:h().optional(),pcb_panel_id:h().optional()}),mf=$n.extend({shape:g("rect"),center:it,width:K,height:K,rotation:jt.optional(),corner_radius:K.optional()});v(!0);var uf=$n.extend({shape:g("circle"),center:it,radius:K});v(!0);var yf=$n.extend({shape:g("polygon"),points:Q(it)});v(!0);var ff=$n.extend({shape:g("path"),route:Q(it),slot_width:K,slot_length:K.optional(),space_between_slots:K.optional(),slot_corner_radius:K.optional()});v(!0);var _f=Xi("shape",[mf,uf,yf,ff]).describe("Defines a cutout on the PCB, removing board material.");v(!0);var gf=Mt.extend({type:g("pcb_missing_footprint_error"),pcb_missing_footprint_error_id:T("pcb_missing_footprint_error"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),error_type:g("pcb_missing_footprint_error").default("pcb_missing_footprint_error"),source_component_id:h()}).describe("Defines a missing footprint error on the PCB");v(!0);var xf=Mt.extend({type:g("external_footprint_load_error"),external_footprint_load_error_id:T("external_footprint_load_error"),pcb_component_id:h(),source_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),footprinter_string:h().optional(),error_type:g("external_footprint_load_error").default("external_footprint_load_error")}).describe("Defines an error when an external footprint fails to load");v(!0);var bf=Mt.extend({type:g("circuit_json_footprint_load_error"),circuit_json_footprint_load_error_id:T("circuit_json_footprint_load_error"),pcb_component_id:h(),source_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),error_type:g("circuit_json_footprint_load_error").default("circuit_json_footprint_load_error"),circuit_json:Q($m()).optional()}).describe("Defines an error when a circuit JSON footprint fails to load");v(!0);var vf=A({type:g("pcb_group"),pcb_group_id:T("pcb_group"),source_group_id:h(),is_subcircuit:L().optional(),subcircuit_id:h().optional(),width:K.optional(),height:K.optional(),center:it,display_offset_x:h().optional().describe("How to display the x offset for this group, usually corresponding with how the user specified it"),display_offset_y:h().optional().describe("How to display the y offset for this group, usually corresponding with how the user specified it"),outline:Q(it).optional(),anchor_position:it.optional(),anchor_alignment:Me.default("center"),position_mode:gt(["packed","relative_to_group_anchor","none"]).optional(),positioned_relative_to_pcb_group_id:h().optional(),positioned_relative_to_pcb_board_id:h().optional(),pcb_component_ids:Q(h()),child_layout_mode:gt(["packed","none"]).optional(),name:h().optional(),description:h().optional(),layout_mode:h().optional(),autorouter_configuration:A({trace_clearance:K}).optional(),autorouter_used_string:h().optional()}).describe("Defines a group of components on the PCB");v(!0);var Sf=Mt.extend({type:g("pcb_autorouting_error"),pcb_error_id:T("pcb_autorouting_error"),error_type:g("pcb_autorouting_error").default("pcb_autorouting_error"),subcircuit_id:h().optional()}).describe("The autorouting has failed to route a portion of the board");v(!0);var wf=A({type:g("pcb_manual_edit_conflict_warning"),pcb_manual_edit_conflict_warning_id:T("pcb_manual_edit_conflict_warning"),warning_type:g("pcb_manual_edit_conflict_warning").default("pcb_manual_edit_conflict_warning"),message:h(),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),source_component_id:h()}).describe("Warning emitted when a component has both manual placement and explicit pcbX/pcbY coordinates");v(!0);var Vm=gt(["x-","x+","y+","y-"]),Af=A({type:g("pcb_connector_not_in_accessible_orientation_warning"),pcb_connector_not_in_accessible_orientation_warning_id:T("pcb_connector_not_in_accessible_orientation_warning"),warning_type:g("pcb_connector_not_in_accessible_orientation_warning").default("pcb_connector_not_in_accessible_orientation_warning"),message:h(),pcb_component_id:h(),source_component_id:h().optional(),pcb_board_id:h().optional(),facing_direction:Vm,recommended_facing_direction:Vm,subcircuit_id:h().optional()}).describe("Warning emitted when a connector PCB component is facing inward toward the board and should be reoriented to an outward-facing direction");v(!0);var Bf=A({type:g("supplier_footprint_mismatch_warning"),supplier_footprint_mismatch_warning_id:T("supplier_footprint_mismatch_warning"),warning_type:g("supplier_footprint_mismatch_warning").default("supplier_footprint_mismatch_warning"),message:h(),source_component_id:h(),pcb_component_id:h().optional(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),supplier_name:oc.optional(),supplier_part_number:h().optional(),supplier_footprint_url:h().optional(),footprint_copper_intersection_over_union:w()}).describe("Warning emitted when a supplier part footprint does not match the expected footprint");v(!0);var Ff=A({type:g("pcb_breakout_point"),pcb_breakout_point_id:T("pcb_breakout_point"),pcb_group_id:h(),subcircuit_id:h().optional(),source_trace_id:h().optional(),source_port_id:h().optional(),source_net_id:h().optional(),x:C,y:C}).describe("Defines a routing target within a pcb_group for a source_trace or source_net");v(!0);var Pf=A({type:g("pcb_ground_plane"),pcb_ground_plane_id:T("pcb_ground_plane"),source_pcb_ground_plane_id:h(),source_net_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional()}).describe("Defines a ground plane on the PCB");v(!0);var If=A({type:g("pcb_ground_plane_region"),pcb_ground_plane_region_id:T("pcb_ground_plane_region"),pcb_ground_plane_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:St,points:Q(it)}).describe("Defines a polygon region of a ground plane");v(!0);var Mf=A({type:g("pcb_thermal_spoke"),pcb_thermal_spoke_id:T("pcb_thermal_spoke"),pcb_ground_plane_id:h(),shape:h(),spoke_count:w(),spoke_thickness:C,spoke_inner_diameter:C,spoke_outer_diameter:C,pcb_plated_hole_id:h().optional(),subcircuit_id:h().optional()}).describe("Pattern for connecting a ground plane to a plated hole");v(!0);var Cc=A({type:g("pcb_copper_pour"),pcb_copper_pour_id:T("pcb_copper_pour"),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:St,source_net_id:h().optional(),covered_with_solder_mask:L().optional().default(!0)}),kf=Cc.extend({shape:g("rect"),center:it,width:K,height:K,rotation:jt.optional()});v(!0);var Cf=Cc.extend({shape:g("brep"),brep_shape:kc});v(!0);var Yf=Cc.extend({shape:g("polygon"),points:Q(it)});v(!0);var Lf=Xi("shape",[kf,Cf,Yf]).describe("Defines a copper pour on the PCB.");v(!0);var Ef=Mt.extend({type:g("pcb_component_outside_board_error"),pcb_component_outside_board_error_id:T("pcb_component_outside_board_error"),error_type:g("pcb_component_outside_board_error").default("pcb_component_outside_board_error"),pcb_component_id:h(),pcb_board_id:h(),component_center:it,component_bounds:A({min_x:w(),max_x:w(),min_y:w(),max_y:w()}),subcircuit_id:h().optional(),source_component_id:h().optional()}).describe("Error emitted when a PCB component is placed outside the board boundaries");v(!0);var Tf=Mt.extend({type:g("pcb_component_not_on_board_edge_error"),pcb_component_not_on_board_edge_error_id:T("pcb_component_not_on_board_edge_error"),error_type:g("pcb_component_not_on_board_edge_error").default("pcb_component_not_on_board_edge_error"),pcb_component_id:h(),pcb_board_id:h(),component_center:it,pad_to_nearest_board_edge_distance:w(),source_component_id:h().optional(),subcircuit_id:h().optional()}).describe("Error emitted when a component that must be placed on the board edge is centered away from the edge");v(!0);var Nf=Mt.extend({type:g("pcb_component_invalid_layer_error"),pcb_component_invalid_layer_error_id:T("pcb_component_invalid_layer_error"),error_type:g("pcb_component_invalid_layer_error").default("pcb_component_invalid_layer_error"),pcb_component_id:h().optional(),source_component_id:h(),layer:St,subcircuit_id:h().optional()}).describe("Error emitted when a component is placed on an invalid layer (components can only be on 'top' or 'bottom' layers)");v(!0);var Wf=Mt.extend({type:g("pcb_via_clearance_error"),pcb_error_id:T("pcb_error"),error_type:g("pcb_via_clearance_error").default("pcb_via_clearance_error"),pcb_via_ids:Q(h()).min(2),minimum_clearance:C.optional(),actual_clearance:C.optional(),pcb_center:A({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:h().optional()}).describe("Error emitted when vias are closer than the allowed clearance");v(!0);var Rf=Mt.extend({type:g("pcb_via_trace_clearance_error"),pcb_via_trace_clearance_error_id:T("pcb_via_trace_clearance_error"),error_type:g("pcb_via_trace_clearance_error").default("pcb_via_trace_clearance_error"),pcb_via_id:h(),pcb_trace_id:h(),minimum_clearance:C.optional(),actual_clearance:C.optional(),center:A({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:h().optional()}).describe("Error emitted when a via and trace are closer than the allowed clearance");v(!0);var Of=Mt.extend({type:g("pcb_pad_pad_clearance_error"),pcb_pad_pad_clearance_error_id:T("pcb_pad_pad_clearance_error"),error_type:g("pcb_pad_pad_clearance_error").default("pcb_pad_pad_clearance_error"),pcb_pad_ids:Q(h()).min(2),minimum_clearance:C.optional(),actual_clearance:C.optional(),center:A({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:h().optional()}).describe("Error emitted when pads are closer than the allowed clearance");v(!0);var jf=Mt.extend({type:g("pcb_pad_trace_clearance_error"),pcb_pad_trace_clearance_error_id:T("pcb_pad_trace_clearance_error"),error_type:g("pcb_pad_trace_clearance_error").default("pcb_pad_trace_clearance_error"),pcb_pad_id:h(),pcb_trace_id:h(),minimum_clearance:C.optional(),actual_clearance:C.optional(),center:A({x:w().optional(),y:w().optional()}).optional(),subcircuit_id:h().optional()}).describe("Error emitted when a pad and trace are closer than allowed clearance");v(!0);var $f=A({type:g("pcb_courtyard_rect"),pcb_courtyard_rect_id:T("pcb_courtyard_rect"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:K,height:K,layer:zt,ccw_rotation:jt.optional(),color:h().optional()}).describe("Defines a courtyard rectangle on the PCB");v(!0);var Xf=A({type:g("pcb_courtyard_outline"),pcb_courtyard_outline_id:T("pcb_courtyard_outline"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:zt,outline:Q(it).min(2)}).describe("Defines a courtyard outline on the PCB");v(!0);var Vf=A({type:g("pcb_courtyard_polygon"),pcb_courtyard_polygon_id:T("pcb_courtyard_polygon"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),layer:zt,points:Q(it).min(3),color:h().optional()}).describe("Defines a courtyard polygon on the PCB");v(!0);var zf=A({type:g("pcb_courtyard_circle"),pcb_courtyard_circle_id:T("pcb_courtyard_circle"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,radius:K,layer:zt,color:h().optional()}).describe("Defines a courtyard circle on the PCB");v(!0);var Df=A({type:g("pcb_courtyard_pill"),pcb_courtyard_pill_id:T("pcb_courtyard_pill"),pcb_component_id:h(),pcb_group_id:h().optional(),subcircuit_id:h().optional(),center:it,width:K,height:K,radius:K,layer:zt,color:h().optional()}).describe("Defines a courtyard pill on the PCB");v(!0);var M9=["obj","stl","3mf","gltf","glb","step","wrl"],Uf=["x+","x-","y+","y-","z+","z-"],k9={obj:"z+",stl:"z+","3mf":"z+",gltf:"y+",glb:"y+",step:"z+",wrl:"y+"},Gf=A({type:g("cad_component"),cad_component_id:h(),pcb_component_id:h(),source_component_id:h(),position:Pe,rotation:Pe.optional(),size:Pe.optional(),layer:St.optional(),subcircuit_id:h().optional(),footprinter_string:h().optional(),model_obj_url:h().optional(),model_stl_url:h().optional(),model_3mf_url:h().optional(),model_gltf_url:h().optional(),model_glb_url:h().optional(),model_step_url:h().optional(),model_wrl_url:h().optional(),model_asset:ic.optional(),model_unit_to_mm_scale_factor:w().optional(),model_board_normal_direction:gt(Uf).optional().describe(`The direction in the model's coordinate space that is considered "up" or "coming out of the board surface"`),model_origin_position:Pe.optional(),model_origin_alignment:gt(["unknown","center","center_of_component_on_board_surface","bottom_center_of_component"]).optional(),model_object_fit:gt(["contain_within_bounds","fill_bounds"]).optional().default("contain_within_bounds"),model_jscad:$m().optional(),show_as_translucent_model:L().optional(),show_as_bounding_box:L().optional(),anchor_alignment:gt(["center","center_of_component_on_board_surface"]).optional().default("center")}).describe("Defines a component on the PCB");v(!0);var Yc=gt(["sinewave","square","triangle","sawtooth"]),C9=Et([h(),w()]).transform((t)=>{if(typeof t==="string"){if(t.endsWith("%"))return parseFloat(t.slice(0,-1))/100;return parseFloat(t)}return t}).pipe(w().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Hf=A({type:g("simulation_voltage_source"),simulation_voltage_source_id:T("simulation_voltage_source"),is_dc_source:g(!0).optional().default(!0),positive_source_port_id:h().optional(),negative_source_port_id:h().optional(),positive_source_net_id:h().optional(),negative_source_net_id:h().optional(),voltage:Ie}).describe("Defines a DC voltage source for simulation"),Qf=A({type:g("simulation_voltage_source"),simulation_voltage_source_id:T("simulation_voltage_source"),is_dc_source:g(!1),terminal1_source_port_id:h().optional(),terminal2_source_port_id:h().optional(),terminal1_source_net_id:h().optional(),terminal2_source_net_id:h().optional(),voltage:Ie.optional(),frequency:or.optional(),peak_to_peak_voltage:Ie.optional(),wave_shape:Yc.optional(),phase:jt.optional(),duty_cycle:C9.optional(),pulse_delay:Vt.optional(),rise_time:Vt.optional(),fall_time:Vt.optional(),pulse_width:Vt.optional(),period:Vt.optional()}).describe("Defines an AC voltage source for simulation"),Zf=Et([Hf,Qf]).describe("Defines a voltage source for simulation");v(!0);v(!0);v(!0);var Y9=Et([h(),w()]).transform((t)=>{if(typeof t==="string"){if(t.endsWith("%"))return parseFloat(t.slice(0,-1))/100;return parseFloat(t)}return t}).pipe(w().min(0,"Duty cycle must be non-negative").max(1,"Duty cycle cannot be greater than 100%")),Kf=A({type:g("simulation_current_source"),simulation_current_source_id:T("simulation_current_source"),is_dc_source:g(!0).optional().default(!0),positive_source_port_id:h().optional(),negative_source_port_id:h().optional(),positive_source_net_id:h().optional(),negative_source_net_id:h().optional(),current:jr}).describe("Defines a DC current source for simulation"),Jf=A({type:g("simulation_current_source"),simulation_current_source_id:T("simulation_current_source"),is_dc_source:g(!1),terminal1_source_port_id:h().optional(),terminal2_source_port_id:h().optional(),terminal1_source_net_id:h().optional(),terminal2_source_net_id:h().optional(),current:jr.optional(),frequency:or.optional(),peak_to_peak_current:jr.optional(),wave_shape:Yc.optional(),phase:jt.optional(),duty_cycle:Y9.optional()}).describe("Defines an AC current source for simulation"),qf=Et([Kf,Jf]).describe("Defines a current source for simulation");v(!0);v(!0);v(!0);var t0=Et([g("spice_dc_sweep"),g("spice_dc_operating_point"),g("spice_transient_analysis"),g("spice_ac_analysis")]),e0=A({method:gt(["trap","gear"]).optional(),reltol:Et([w(),h()]).optional(),abstol:Et([w(),h()]).optional(),vntol:Et([w(),h()]).optional()}).describe("SPICE solver options for a simulation experiment"),r0=A({type:g("simulation_experiment"),simulation_experiment_id:T("simulation_experiment"),name:h(),experiment_type:t0,time_per_step:$r.optional(),start_time_ms:Vt.optional(),end_time_ms:Vt.optional(),spice_options:e0.optional()}).describe("Defines a simulation experiment configuration");v(!0);var i0=A({type:g("simulation_transient_voltage_graph"),simulation_transient_voltage_graph_id:T("simulation_transient_voltage_graph"),simulation_experiment_id:h(),timestamps_ms:Q(w()).optional(),voltage_levels:Q(w()),source_component_id:h().optional(),subcircuit_connectivity_map_key:h().optional(),time_per_step:$r,start_time_ms:Vt,end_time_ms:Vt,name:h().optional(),color:h().optional()}).describe("Stores voltage measurements over time for a simulation");v(!0);var n0=A({type:g("simulation_transient_current_graph"),simulation_transient_current_graph_id:T("simulation_transient_current_graph"),simulation_experiment_id:h(),timestamps_ms:Q(w()).optional(),current_levels:Q(w()),source_component_id:h().optional(),subcircuit_connectivity_map_key:h().optional(),time_per_step:$r,start_time_ms:Vt,end_time_ms:Vt,name:h().optional(),color:h().optional()}).describe("Stores current measurements over time for a simulation");v(!0);var o0=A({type:g("simulation_switch"),simulation_switch_id:T("simulation_switch"),source_component_id:h().optional(),closes_at:Vt.optional(),opens_at:Vt.optional(),starts_closed:L().optional(),switching_frequency:or.optional()}).describe("Defines a switch for simulation timing control");v(!0);var a0=A({type:g("simulation_voltage_probe"),simulation_voltage_probe_id:T("simulation_voltage_probe"),source_component_id:h().optional(),name:h().optional(),signal_input_source_port_id:h().optional(),signal_input_source_net_id:h().optional(),reference_input_source_port_id:h().optional(),reference_input_source_net_id:h().optional(),subcircuit_id:h().optional(),color:h().optional()}).describe("Defines a voltage probe for simulation. If a reference input is not provided, it measures against ground. If a reference input is provided, it measures the differential voltage between two points.").superRefine((t,e)=>{if(t.reference_input_source_port_id||t.reference_input_source_net_id){let i=!!t.signal_input_source_port_id||!!t.reference_input_source_port_id,n=!!t.signal_input_source_net_id||!!t.reference_input_source_net_id;if(i&&n)e.addIssue({code:V.custom,message:"Cannot mix port and net connections in a differential probe."});else if(i){if(!t.signal_input_source_port_id||!t.reference_input_source_port_id)e.addIssue({code:V.custom,message:"Differential port probe requires both signal_input_source_port_id and reference_input_source_port_id."})}else if(n){if(!t.signal_input_source_net_id||!t.reference_input_source_net_id)e.addIssue({code:V.custom,message:"Differential net probe requires both signal_input_source_net_id and reference_input_source_net_id."})}}else if(!!t.signal_input_source_port_id===!!t.signal_input_source_net_id)e.addIssue({code:V.custom,message:"A voltage probe must have exactly one of signal_input_source_port_id or signal_input_source_net_id."})});v(!0);var s0=A({type:g("simulation_current_probe"),simulation_current_probe_id:T("simulation_current_probe"),source_component_id:h().optional(),name:h().optional(),positive_source_port_id:h().optional(),negative_source_port_id:h().optional(),positive_source_net_id:h().optional(),negative_source_net_id:h().optional(),subcircuit_id:h().optional(),color:h().optional()}).describe("Defines a current probe for simulation. It measures current flowing from the positive endpoint to the negative endpoint.").superRefine((t,e)=>{let r=!!t.positive_source_port_id,i=!!t.negative_source_port_id,n=!!t.positive_source_net_id,a=!!t.negative_source_net_id,o=r||i,c=n||a;if(o&&c){e.addIssue({code:V.custom,message:"Cannot mix port and net connections in a current probe."});return}if(o){if(!r||!i)e.addIssue({code:V.custom,message:"Current probe using source ports requires both positive_source_port_id and negative_source_port_id."});return}if(c){if(!n||!a)e.addIssue({code:V.custom,message:"Current probe using source nets requires both positive_source_net_id and negative_source_net_id."});return}e.addIssue({code:V.custom,message:"A current probe must have either positive/negative source port ids or positive/negative source net ids."})});v(!0);var c0=Mt.extend({type:g("simulation_unknown_experiment_error"),simulation_unknown_experiment_error_id:T("simulation_unknown_experiment_error"),error_type:g("simulation_unknown_experiment_error").default("simulation_unknown_experiment_error"),simulation_experiment_id:h().optional(),subcircuit_id:h().optional()}).describe("An unknown error occurred during the simulation experiment.");v(!0);var l0=A({type:g("simulation_op_amp"),simulation_op_amp_id:T("simulation_op_amp"),source_component_id:h().optional(),inverting_input_source_port_id:h(),non_inverting_input_source_port_id:h(),output_source_port_id:h(),positive_supply_source_port_id:h(),negative_supply_source_port_id:h()}).describe("Defines a simple ideal operational amplifier for simulation");v(!0);var p0=A({type:g("simulation_spice_subcircuit"),simulation_spice_subcircuit_id:T("simulation_spice_subcircuit"),source_component_id:h(),spice_pin_to_source_port_map:Nn(h(),h()),subcircuit_source:h()}).describe("Defines a custom SPICE subcircuit model for simulation");v(!0);var zm=(t)=>t!==void 0,h0=A({type:g("simulation_oscilloscope_trace"),simulation_oscilloscope_trace_id:T("simulation_oscilloscope_trace"),simulation_transient_voltage_graph_id:h().optional(),simulation_transient_current_graph_id:h().optional(),simulation_voltage_probe_id:h().optional(),simulation_current_probe_id:h().optional(),display_name:h().optional(),color:h().optional(),display_center_value:w().optional(),display_center_offset_divs:w().optional(),volts_per_div:w().positive().optional(),amps_per_div:w().positive().optional()}).describe("Defines how a simulation measurement is rendered as an oscilloscope-style trace.").superRefine((t,e)=>{let r=[t.simulation_transient_voltage_graph_id,t.simulation_voltage_probe_id].filter(zm).length,i=[t.simulation_transient_current_graph_id,t.simulation_current_probe_id].filter(zm).length;if(r+i!==1)e.addIssue({code:V.custom,message:"An oscilloscope trace must reference exactly one voltage graph, current graph, voltage probe, or current probe."});if(r>0&&t.amps_per_div!==void 0)e.addIssue({code:V.custom,message:"Voltage oscilloscope traces must use volts_per_div, not amps_per_div."});if(i>0&&t.volts_per_div!==void 0)e.addIssue({code:V.custom,message:"Current oscilloscope traces must use amps_per_div, not volts_per_div."})});v(!0);var d0=Et([vu,xu,bu,gu,wu,Su,lc,ac,On,cc,sc,pc,hc,dc,yc,fc,_c,Sc,gc,xc,bc,vc,uc,mc,Fu,Iu,Au,wc,Ac,Bc,Fc,Mu,Pc,ku,Cu,Yu,Lu,Eu,Ic,Mc,Bu,my,by,gf,xf,bf,wf,Af,Bf,vy,df,Sy,Wy,Fy,Cy,Yy,Ry,Ay,By,Oy,jy,vf,Vy,zy,Dy,Uy,qy,Gy,Hy,Qy,Zy,Jy,Ly,Ey,$y,Xy,Ty,Ny,Wf,Rf,Of,jf,ef,tf,rf,nf,of,af,sf,cf,lf,Sf,pf,hf,Ff,_f,Pf,If,Mf,Lf,Ef,Tf,Nf,$f,Xf,Vf,zf,Df,Tu,Hu,Vu,zu,Du,Uu,$u,Xu,Qu,Gu,Nu,Ku,Ju,Zu,ry,iy,ny,oy,cy,ay,sy,Gf,Zf,qf,r0,i0,n0,o0,a0,s0,h0,c0,l0,p0]),Xr=d0;v(!0);ar(!0);function P(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function m0(t){let{a:e,b:r,c:i,d:n,e:a,f:o}=t,c=e*n-r*i;return{a:n/c,b:r/-c,c:i/-c,d:e/c,e:(n*a-i*o)/-c,f:(r*a-e*o)/c}}function sr(t){return typeof t>"u"}function Lt(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function De(...t){t=Array.isArray(t[0])?t[0]:t;let e=(r,i)=>({a:r.a*i.a+r.c*i.b,c:r.a*i.c+r.c*i.d,e:r.a*i.e+r.c*i.f+r.e,b:r.b*i.a+r.d*i.b,d:r.b*i.c+r.d*i.d,f:r.b*i.e+r.d*i.f+r.f});switch(t.length){case 0:throw Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{let[r,i,...n]=t,a=e(r,i);return De(a,...n)}}}function Ft(...t){return De(...t)}var{cos:L9,sin:E9,PI:WO}=Math;function ye(t,e,r){let i=L9(t),n=E9(t),a={a:i,c:-n,e:0,b:n,d:i,f:0};if(sr(e)||sr(r))return a;return De([Lt(e,r),a,Lt(-e,-r)])}function Jt(t,e=void 0,r=void 0,i=void 0){if(sr(e))e=t;let n={a:t,c:0,e:0,b:0,d:e,f:0};if(sr(r)||sr(i))return n;return De([Lt(r,i),n,Lt(-r,-i)])}var{tan:zO}=Math;function u0(t){return cr(t)}function cr(t){return`matrix(${t.a},${t.b},${t.c},${t.d},${t.e},${t.f})`}function y0(t,e=10000000000){return{a:Math.round(t.a*e)/e,b:Math.round(t.b*e)/e,c:Math.round(t.c*e)/e,d:Math.round(t.d*e)/e,e:Math.round(t.e*e)/e,f:Math.round(t.f*e)/e}}function f0(t,e){let r=t[0].x!=null?t[0].x:t[0][0],i=t[0].y!=null?t[0].y:t[0][1],n=e[0].x!=null?e[0].x:e[0][0],a=e[0].y!=null?e[0].y:e[0][1],o=t[1].x!=null?t[1].x:t[1][0],c=t[1].y!=null?t[1].y:t[1][1],l=e[1].x!=null?e[1].x:e[1][0],s=e[1].y!=null?e[1].y:e[1][1],p=t[2].x!=null?t[2].x:t[2][0],d=t[2].y!=null?t[2].y:t[2][1],m=e[2].x!=null?e[2].x:e[2][0],u=e[2].y!=null?e[2].y:e[2][1],y={a:r-p,b:i-d,c:o-p,d:c-d,e:p,f:d},f={a:n-m,b:a-u,c:l-m,d:s-u,e:m,f:u},_=m0(y),x=De([f,_]);return y0(x)}function T9(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Xn(t,e,r,i){var n=Error.call(this,t);if(Object.setPrototypeOf)Object.setPrototypeOf(n,Xn.prototype);return n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}T9(Xn,Error);function Lc(t,e,r){if(r=r||" ",t.length>e)return t;return e-=t.length,r+=r.repeat(e),t+r.slice(0,e)}Xn.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r=null,i;for(i=0;i<t.length;i++)if(t[i].source===this.location.source){r=t[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,a=this.location.source&&typeof this.location.source.offset==="function"?this.location.source.offset(n):n,o=this.location.source+":"+a.line+":"+a.column;if(r){var c=this.location.end,l=Lc("",a.line.toString().length," "),s=r[n.line-1],p=n.line===c.line?c.column:s.length+1,d=p-n.column||1;e+=`
--> `+o+`
`+l+` |
`+a.line+" | "+s+`
`+l+" | "+Lc("",n.column-1," ")+Lc("",d,"^")}else e+=`
at `+o}return e};Xn.buildMessage=function(t,e){var r={literal:function(s){return'"'+n(s.text)+'"'},class:function(s){var p=s.parts.map(function(d){return Array.isArray(d)?a(d[0])+"-"+a(d[1]):a(d)});return"["+(s.inverted?"^":"")+p.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(s){return s.description}};function i(s){return s.charCodeAt(0).toString(16).toUpperCase()}function n(s){return s.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+i(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+i(p)})}function a(s){return s.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+i(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+i(p)})}function o(s){return r[s.type](s)}function c(s){var p=s.map(o),d,m;if(p.sort(),p.length>0){for(d=1,m=1;d<p.length;d++)if(p[d-1]!==p[d])p[m]=p[d],m++;p.length=m}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function l(s){return s?'"'+n(s)+'"':"end of input"}return"Expected "+c(t)+" but "+l(e)+" found."};function _0(t,e,r){if(!e||!r)return;let i=t.get(e);if(!i)i=new Set,t.set(e,i);i.add(r);let n=t.get(r);if(!n)n=new Set,t.set(r,n);n.add(e)}function W9(t,e){if(!e.subcircuit_id&&!e.source_group_id)return[...t];let r=e;if(e.subcircuit_id){let c=new Set([e.subcircuit_id]),l=new Map,s=new Map;for(let d of t)if(d.type==="source_group"){let{source_group_id:m,subcircuit_id:u}=d;if(u)s.set(m,u);let y=d.parent_source_group_id;if(y){if(!l.has(y))l.set(y,[]);l.get(y).push(m)}}let p;for(let[d,m]of s)if(m===e.subcircuit_id){p=d;break}if(p){let d=(m)=>{let u=l.get(m)||[];for(let y of u){let f=s.get(y);if(f)c.add(f);d(y)}};d(p),r={...e,subcircuit_ids:Array.from(c)}}}let i=new Map;for(let c of t){let l=`${c.type}_id`,s=c[l];if(typeof s==="string")i.set(s,c)}let n=new Map;for(let c of t){let l=Object.entries(c);for(let[s,p]of l){if(s==="parent_source_group_id")continue;if(s.endsWith("_id")&&typeof p==="string"){let d=i.get(p);_0(n,c,d)}else if(s.endsWith("_ids")&&Array.isArray(p)){for(let d of p)if(typeof d==="string"){let m=i.get(d);_0(n,c,m)}}}}let a=[],o=new Set;for(let c of t){let l=!1;if(r.subcircuit_id&&"subcircuit_id"in c&&c.subcircuit_id===r.subcircuit_id)l=!0;else if(r.subcircuit_ids&&"subcircuit_id"in c&&c.subcircuit_id&&r.subcircuit_ids.includes(c.subcircuit_id))l=!0;else if(r.source_group_id&&"source_group_id"in c&&c.source_group_id===r.source_group_id)l=!0;else if(r.source_group_id&&"member_source_group_ids"in c&&Array.isArray(c.member_source_group_ids)&&c.member_source_group_ids.includes(r.source_group_id))l=!0;if(l)a.push(c),o.add(c)}while(a.length>0){let c=a.shift(),l=n.get(c);if(!l)continue;for(let s of l)if(!o.has(s))o.add(s),a.push(s)}return t.filter((c)=>o.has(c))}var zi=(t,e={})=>{let r=t,i=r._internal_store;if(!i){i={counts:{},editCount:0},r._internal_store=i;for(let a of r){let o=a.type,c=a[`${o}_id`];if(!c)continue;let l=Number.parseInt(c.split("_").pop());if(!Number.isNaN(l))i.counts[o]=Math.max(i.counts[o]??0,l)}}let n=new Proxy({},{get:(a,o)=>{if(o==="toArray")return()=>(r.editCount=i.editCount,r);if(o==="editCount")return i.editCount;if(o==="subtree")return(l)=>zi(W9(r,l),e);if(o==="insert")return(l)=>{let s=l.type;if(!s)throw Error("insert requires an element with a type");i.counts[s]??=-1,i.counts[s]++;let p=i.counts[s],d={...l,type:s,[`${s}_id`]:`${s}_${p}`};if(e.validateInserts)(Vr[s]??Xr).parse(d);return r.push(d),i.editCount++,d};if(o==="insertAll")return(l)=>l.map((s)=>n.insert(s));let c=o;return{get:(l)=>r.find((s)=>s.type===c&&s[`${c}_id`]===l),getUsing:(l)=>{let s=Object.keys(l);if(s.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let p=s[0],d=p.replace("_id",""),m=r.find((u)=>u.type===d&&u[p]===l[p]);if(!m)return null;return r.find((u)=>u.type===c&&u[`${c}_id`]===m[`${c}_id`])},getWhere:(l)=>{let s=Object.keys(l);return r.find((p)=>p.type===c&&s.every((d)=>p[d]===l[d]))},list:(l)=>{let s=!l?[]:Object.keys(l);return r.filter((p)=>p.type===c&&s.every((d)=>p[d]===l[d]))},insert:(l)=>{i.counts[c]??=-1,i.counts[c]++;let s=i.counts[c],p={type:c,[`${c}_id`]:`${c}_${s}`,...l};if(e.validateInserts)(Vr[c]??Xr).parse(p);return r.push(p),i.editCount++,p},delete:(l)=>{let s=r.find((p)=>p[`${c}_id`]===l);if(!s)return;r.splice(r.indexOf(s),1),i.editCount++},update:(l,s)=>{let p=r.find((d)=>d.type===c&&d[`${c}_id`]===l);if(!p)return null;return Object.assign(p,s),i.editCount++,p},select:(l)=>{if(c==="source_component")return r.find((s)=>s.type==="source_component"&&s.name===l.replace(/\./g,""));else if(c==="pcb_port"||c==="source_port"||c==="schematic_port"){let[s,p]=l.replace(/\./g,"").split(/[\s\>]+/),d=r.find((u)=>u.type==="source_component"&&u.name===s);if(!d)return null;let m=r.find((u)=>u.type==="source_port"&&u.source_component_id===d.source_component_id&&(u.name===p||(u.port_hints??[]).includes(p)));if(!m)return null;if(c==="source_port")return m;if(c==="pcb_port")return r.find((u)=>u.type==="pcb_port"&&u.source_port_id===m.source_port_id);else if(c==="schematic_port")return r.find((u)=>u.type==="schematic_port"&&u.source_port_id===m.source_port_id)}}}}});return n};zi.unparsed=zi;var Gt=zi,Tc=zi;function Ec(t){let e=t.type;return`${e}:${t[`${e}_id`]}`}var g0=(t,e={})=>{let r=t._internal_store_indexed;if(!r){r={counts:{},editCount:0,indexes:{}};for(let o of t){let c=o.type,l=o[`${c}_id`];if(!l)continue;let s=Number.parseInt(l.split("_").pop()||"");if(!Number.isNaN(s))r.counts[c]=Math.max(r.counts[c]??0,s)}let n=e.indexConfig||{},a=r.indexes;if(n.byId)a.byId=new Map;if(n.byType)a.byType=new Map;if(n.byRelation)a.byRelation=new Map;if(n.bySubcircuit)a.bySubcircuit=new Map;if(n.byCustomField&&n.byCustomField.length>0){a.byCustomField=new Map;for(let o of n.byCustomField)a.byCustomField.set(o,new Map)}for(let o of t){if(n.byId){let c=Ec(o);a.byId.set(c,o)}if(n.byType){let c=a.byType.get(o.type)||[];c.push(o),a.byType.set(o.type,c)}if(n.byRelation){let c=Object.entries(o);for(let[l,s]of c)if(l.endsWith("_id")&&l!==`${o.type}_id`&&typeof s==="string"){let p=a.byRelation.get(l)||new Map,d=p.get(s)||[];d.push(o),p.set(s,d),a.byRelation.set(l,p)}}if(n.bySubcircuit&&"subcircuit_id"in o){let c=o.subcircuit_id;if(c&&typeof c==="string"){let l=a.bySubcircuit.get(c)||[];l.push(o),a.bySubcircuit.set(c,l)}}if(n.byCustomField&&a.byCustomField){for(let c of n.byCustomField)if(c in o){let l=o[c];if(l!==void 0&&(typeof l==="string"||typeof l==="number")){let s=String(l),p=a.byCustomField.get(c),d=p.get(s)||[];d.push(o),p.set(s,d)}}}}t._internal_store_indexed=r}return new Proxy({},{get:(n,a)=>{if(a==="toArray")return()=>(t.editCount=r.editCount,t);if(a==="editCount")return r.editCount;let o=a;return{get:(c)=>{let l=e.indexConfig||{};if(l.byId&&r.indexes.byId)return r.indexes.byId.get(`${o}:${c}`)||null;if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(o)||[]).find((p)=>p[`${o}_id`]===c)||null;return t.find((s)=>s.type===o&&s[`${o}_id`]===c)||null},getUsing:(c)=>{let l=e.indexConfig||{},s=Object.keys(c);if(s.length!==1)throw Error("getUsing requires exactly one key, e.g. { pcb_component_id }");let p=s[0],d=p.replace("_id","");if(l.byRelation&&r.indexes.byRelation){let u=r.indexes.byRelation.get(p);if(u){let f=(u.get(c[p])||[]).find((x)=>x.type===d);if(!f)return null;let _=f[`${o}_id`];if(l.byId&&r.indexes.byId)return r.indexes.byId.get(`${o}:${_}`)||null;if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(o)||[]).find((Y)=>Y[`${o}_id`]===_)||null;return t.find((x)=>x.type===o&&x[`${o}_id`]===_)||null}}let m=t.find((u)=>u.type===d&&u[p]===c[p]);if(!m)return null;return t.find((u)=>u.type===o&&u[`${o}_id`]===m[`${o}_id`])||null},getWhere:(c)=>{let l=e.indexConfig||{},s=Object.keys(c);if(s.length===1&&l.byCustomField&&r.indexes.byCustomField){let p=s[0],d=r.indexes.byCustomField.get(p);if(d){let m=String(c[p]);return(d.get(m)||[]).find((y)=>y.type===o)||null}}if("subcircuit_id"in c&&l.bySubcircuit&&r.indexes.bySubcircuit){let p=c.subcircuit_id;return(r.indexes.bySubcircuit.get(p)||[]).find((m)=>m.type===o&&s.every((u)=>m[u]===c[u]))||null}if(l.byType&&r.indexes.byType)return(r.indexes.byType.get(o)||[]).find((d)=>s.every((m)=>d[m]===c[m]))||null;return t.find((p)=>p.type===o&&s.every((d)=>p[d]===c[d]))||null},list:(c)=>{let l=e.indexConfig||{},s=!c?[]:Object.keys(c);if(s.length===0&&l.byType&&r.indexes.byType)return r.indexes.byType.get(o)||[];if(s.length===1&&s[0]==="subcircuit_id"&&l.bySubcircuit&&r.indexes.bySubcircuit){let d=c.subcircuit_id;return(r.indexes.bySubcircuit.get(d)||[]).filter((u)=>u.type===o)}let p;if(l.byType&&r.indexes.byType)p=r.indexes.byType.get(o)||[];else p=t.filter((d)=>d.type===o);if(s.length>0)return p.filter((d)=>s.every((m)=>d[m]===c[m]));return p},insert:(c)=>{r.counts[o]??=-1,r.counts[o]++;let l=r.counts[o],s={type:o,[`${o}_id`]:`${o}_${l}`,...c};if(e.validateInserts)(Vr[o]??Xr).parse(s);t.push(s),r.editCount++;let p=e.indexConfig||{};if(p.byId&&r.indexes.byId){let d=Ec(s);r.indexes.byId.set(d,s)}if(p.byType&&r.indexes.byType){let d=r.indexes.byType.get(o)||[];d.push(s),r.indexes.byType.set(o,d)}if(p.byRelation&&r.indexes.byRelation){let d=Object.entries(s);for(let[m,u]of d)if(m.endsWith("_id")&&m!==`${s.type}_id`&&typeof u==="string"){let y=r.indexes.byRelation.get(m)||new Map,f=y.get(u)||[];f.push(s),y.set(u,f),r.indexes.byRelation.set(m,y)}}if(p.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in s){let d=s.subcircuit_id;if(d&&typeof d==="string"){let m=r.indexes.bySubcircuit.get(d)||[];m.push(s),r.indexes.bySubcircuit.set(d,m)}}if(p.byCustomField&&r.indexes.byCustomField){for(let d of p.byCustomField)if(d in s){let m=s[d];if(m!==void 0&&(typeof m==="string"||typeof m==="number")){let u=String(m),y=r.indexes.byCustomField.get(d),f=y.get(u)||[];f.push(s),y.set(u,f)}}}return s},delete:(c)=>{let l=e.indexConfig||{},s;if(l.byId&&r.indexes.byId)s=r.indexes.byId.get(`${o}:${c}`);else if(l.byType&&r.indexes.byType)s=(r.indexes.byType.get(o)||[]).find((m)=>m[`${o}_id`]===c);else s=t.find((d)=>d[`${o}_id`]===c);if(!s)return;let p=t.indexOf(s);if(p>=0)t.splice(p,1),r.editCount++;if(l.byId&&r.indexes.byId){let d=Ec(s);r.indexes.byId.delete(d)}if(l.byType&&r.indexes.byType){let m=(r.indexes.byType.get(o)||[]).filter((u)=>u[`${o}_id`]!==c);r.indexes.byType.set(o,m)}if(l.byRelation&&r.indexes.byRelation)for(let[d,m]of r.indexes.byRelation.entries())for(let[u,y]of m.entries()){let f=y.filter((_)=>_!==s);if(f.length===0)m.delete(u);else m.set(u,f)}if(l.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in s){let d=s.subcircuit_id;if(d){let u=(r.indexes.bySubcircuit.get(d)||[]).filter((y)=>y!==s);if(u.length===0)r.indexes.bySubcircuit.delete(d);else r.indexes.bySubcircuit.set(d,u)}}if(l.byCustomField&&r.indexes.byCustomField)for(let d of r.indexes.byCustomField.values())for(let[m,u]of d.entries()){let y=u.filter((f)=>f!==s);if(y.length===0)d.delete(m);else d.set(m,y)}},update:(c,l)=>{let s=e.indexConfig||{},p;if(s.byId&&r.indexes.byId)p=r.indexes.byId.get(`${o}:${c}`);else if(s.byType&&r.indexes.byType)p=(r.indexes.byType.get(o)||[]).find((m)=>m[`${o}_id`]===c);else p=t.find((d)=>d.type===o&&d[`${o}_id`]===c);if(!p)return null;if(s.byRelation&&r.indexes.byRelation){let d=Object.entries(p);for(let[m,u]of d)if(m.endsWith("_id")&&m!==`${p.type}_id`&&typeof u==="string"){if(m in l&&l[m]!==u){let y=r.indexes.byRelation.get(m);if(y){let _=(y.get(u)||[]).filter((x)=>x!==p);if(_.length===0)y.delete(u);else y.set(u,_)}}}}if(s.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in p&&"subcircuit_id"in l){let d=p.subcircuit_id,m=l.subcircuit_id;if(d!==m){let y=(r.indexes.bySubcircuit.get(d)||[]).filter((f)=>f!==p);if(y.length===0)r.indexes.bySubcircuit.delete(d);else r.indexes.bySubcircuit.set(d,y)}}if(s.byCustomField&&r.indexes.byCustomField){for(let d of s.byCustomField)if(d in p&&d in l&&p[d]!==l[d]){let m=r.indexes.byCustomField.get(d);if(m){let u=String(p[d]),f=(m.get(u)||[]).filter((_)=>_!==p);if(f.length===0)m.delete(u);else m.set(u,f)}}}if(Object.assign(p,l),r.editCount++,s.byRelation&&r.indexes.byRelation){let d=Object.entries(p);for(let[m,u]of d)if(m.endsWith("_id")&&m!==`${p.type}_id`&&typeof u==="string"){if(m in l){let y=r.indexes.byRelation.get(m)||new Map,f=y.get(u)||[];if(!f.includes(p))f.push(p),y.set(u,f),r.indexes.byRelation.set(m,y)}}}if(s.bySubcircuit&&r.indexes.bySubcircuit&&"subcircuit_id"in p&&"subcircuit_id"in l){let d=p.subcircuit_id;if(d&&typeof d==="string"){let m=r.indexes.bySubcircuit.get(d)||[];if(!m.includes(p))m.push(p),r.indexes.bySubcircuit.set(d,m)}}if(s.byCustomField&&r.indexes.byCustomField){for(let d of s.byCustomField)if(d in p&&d in l){let m=p[d];if(m!==void 0&&(typeof m==="string"||typeof m==="number")){let u=String(m),y=r.indexes.byCustomField.get(d),f=y.get(u)||[];if(!f.includes(p))f.push(p),y.set(u,f)}}}return p},select:(c)=>{if(o==="source_component")return t.find((l)=>l.type==="source_component"&&l.name===c.replace(/\./g,""))||null;else if(o==="pcb_port"||o==="source_port"||o==="schematic_port"){let[l,s]=c.replace(/\./g,"").split(/[\s\>]+/),p=t.find((m)=>m.type==="source_component"&&m.name===l);if(!p)return null;let d=t.find((m)=>m.type==="source_port"&&m.source_component_id===p.source_component_id&&(m.name===s||(m.port_hints??[]).includes(s)));if(!d)return null;if(o==="source_port")return d;if(o==="pcb_port")return t.find((m)=>m.type==="pcb_port"&&m.source_port_id===d.source_port_id)||null;else if(o==="schematic_port")return t.find((m)=>m.type==="schematic_port"&&m.source_port_id===d.source_port_id)||null}return null}}}})};g0.unparsed=g0;var zr=(t)=>{let e=new Map;for(let r of t)if(r.type==="schematic_sheet"&&r.name)e.set(r.schematic_sheet_id,r.name);return e};var R9=(t)=>t.type==="schematic_box",x0=(t)=>t.type==="schematic_component",Nc=(t)=>t.schematic_sheet_id,O9=(t,e)=>{if(!e)return;return Tc(t).source_component.get(e)?.name},j9=(t,e)=>{if(!t.schematic_component_id)return{};let r=Tc(e),i=r.schematic_component.get(t.schematic_component_id);if(!i?.source_component_id)return{};let n=r.source_component.get(i.source_component_id);return{sourceComponentId:i.source_component_id,sourceComponentName:n?.name}},$9=(t,e,r,i)=>{let n=Nc(t);if(n===void 0&&i)n=Nc(i);let a;if(n)a=r.get(n);let o={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:t.center.x,schY:t.center.y,width:i?.width??t.size.width,height:i?.height??t.size.height,sourceComponentId:t.source_component_id,sourceComponentName:O9(e,t.source_component_id),schematicComponentId:t.schematic_component_id,schematicSymbolId:i?.schematic_symbol_id??t.schematic_symbol_id,subcircuitId:t.subcircuit_id??i?.subcircuit_id};if(n)o.schematicSheetId=n;if(a)o.schematicSheetName=a;return o},X9=(t,e,r)=>{let i=Nc(t),n;if(i)n=r.get(i);let a={lineItemType:"SchematicBoxPlacement",positionAnchor:"center",schX:t.x+t.width/2,schY:t.y+t.height/2,width:t.width,height:t.height,...j9(t,e),schematicComponentId:t.schematic_component_id,schematicSymbolId:t.schematic_symbol_id,subcircuitId:t.subcircuit_id};if(i)a.schematicSheetId=i;if(n)a.schematicSheetName=n;return a},b0=(t)=>{let e=t.filter(R9).filter((a)=>a.schematic_component_id||a.schematic_symbol_id),r=zr(t),i=new Set(t.filter(x0).map((a)=>a.schematic_component_id)),n=[...t.filter(x0).map((a)=>$9(a,t,r,e.find((o)=>o.schematic_component_id===a.schematic_component_id))),...e.filter((a)=>!a.schematic_component_id||!i.has(a.schematic_component_id)).map((a)=>X9(a,t,r))];return{circuitJson:t,componentPlacements:n}};class Vn extends ct{params;constructor(t){super();this.params=t}_step(){let t=new Bt(this.params.ctx);for(let e of Ds(t)){let{resistor:r,switchBox:i,signalPort:n,signalSchY:a,pullDirection:o}=e;if(e.horizontalPushbutton)continue;let c=t.connected(n.source_port_id);if(t.portsByNet.get(c)?.length!==2)continue;if(n.needs_external_pullup||n.needs_external_pulldown)continue;let l=o==="up"?a-(r.schY+r.height/2):r.schY-r.height/2-a;if(l<=1.5)continue;let s=o==="up"?"above":"below";this.params.issues.push({lineItemType:"PullResistorOnWrongSide",resistorSchematicBox:r,hostSchematicBox:i,signalSourcePortId:n.source_port_id,signalPinName:n.name,signalSchY:a,pullDirection:o,preferredSide:s,wrongSideGap:l,maxRecommendedWrongSideGap:1.5,message:`place ${r.sourceComponentName} ${s} ${i.sourceComponentName} so the pull-${o} branch reads toward ${o==="up"?"power":"ground"}`})}this.solved=!0}}function zn(t,e){let r=t.find((l)=>l.type==="source_trace"&&l.source_trace_id===e.source_trace_id);if(r?.type==="source_trace"&&r.name)return r.name;let i=e.edges[0],n=e.edges.at(-1),a=(l,s)=>{let p=t.filter((x)=>x.type==="schematic_port"&&x.schematic_sheet_id===e.schematic_sheet_id&&(s?x.schematic_port_id===s:Math.hypot(x.center.x-l.x,x.center.y-l.y)<=0.01));if(p.length!==1||p[0]?.type!=="schematic_port")return;let d=p[0],m=t.find((x)=>x.type==="source_port"&&x.source_port_id===d.source_port_id),u=t.find((x)=>x.type==="schematic_component"&&x.schematic_component_id===d.schematic_component_id),y=m?.type==="source_port"?m.source_component_id:u?.type==="schematic_component"?u.source_component_id:void 0,f=t.find((x)=>x.type==="source_component"&&x.source_component_id===y);if(f?.type!=="source_component"||!f.name)return;let _=m?.type==="source_port"&&m.name?m.name:d.pin_number!==void 0?`pin${d.pin_number}`:d.display_pin_label;return _?`${f.name}.${_}`:f.name},o=i&&a(i.from,i.from_schematic_port_id),c=n&&a(n.to,n.to_schematic_port_id);if(o&&c)return`${o} to ${c}`;return r?.type==="source_trace"&&r.display_name||o||c||"trace"}var v0=(t,e,r)=>{let i=[{x:t.x,y:t.y}],n=(t.x+e.x)/2,a=(t.y+e.y)/2,o={x:e.x,y:e.y};switch(e.facingDirection){case"x+":o.x+=r;break;case"x-":o.x-=r;break;case"y+":o.y+=r;break;case"y-":o.y-=r;break}let c=t.facingDirection??"none",l=e.facingDirection??"none",s=(m)=>{let u=i[i.length-1];if(u.x!==m.x||u.y!==m.y)i.push(m)},p=Math.abs(t.y-e.y)<=Math.max(0.000001,r*0.1),d=Math.abs(t.x-e.x)<=Math.max(0.000001,r*0.1);if(c==="none"&&l==="none")globalThis.__DEBUG_CALCULATE_ELBOW_CASE=1,s({x:n,y:t.y}),s({x:n,y:e.y});else if(c==="x+"&&l==="y+")if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2,t.x>e.x&&t.y<e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.1,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:e.y+r}),s({x:e.x,y:e.y+r});else if(!d&&!p&&t.x<e.x&&t.y>e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.2,s({x:e.x,y:t.y});else if(d)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.3,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:e.y+r}),s({x:e.x,y:e.y+r});else if(t.x<e.x)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.4,s({x:n,y:t.y}),s({x:n,y:o.y}),s({x:e.x,y:o.y});else if(t.y<=e.y+r)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.5,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:t.y+r}),s({x:e.x,y:t.y+r}),s({x:e.x,y:e.y});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=2.6,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:(t.y+e.y)/2}),s({x:e.x,y:(t.y+e.y)/2});else if(c==="x+"&&l==="x+"&&!p){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3;let m=Math.max(t.x+r,o.x);s({x:m,y:t.y}),s({x:m,y:e.y})}else if(c==="x+"&&l==="x+"&&p)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=3.1,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:t.y+r}),s({x:e.x+r,y:t.y+r}),s({x:e.x+r,y:e.y});else if(c==="x+"&&l==="y-")if(d&&t.y<=e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.11,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:a}),s({x:e.x,y:a});else if(d&&t.y>e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.12,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:e.y-r}),s({x:e.x,y:e.y-r});else if(t.x<e.x&&t.y<e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.2,s({x:e.x,y:t.y});else if(t.x>e.x&&t.y<e.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.3;let m=t.x+r;s({x:m,y:t.y}),s({x:m,y:a}),s({x:e.x,y:a})}else if(t.x>e.x&&t.y>e.y){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.4;let m=t.x+r;s({x:m,y:t.y}),s({x:m,y:o.y}),s({x:e.x,y:o.y})}else if(t.y===e.y)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.5,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:t.y-r}),s({x:e.x,y:t.y-r});else globalThis.__DEBUG_CALCULATE_ELBOW_CASE=4.6,s({x:n,y:t.y}),s({x:n,y:o.y}),s({x:e.x,y:o.y});else if(c==="x+"&&l==="x-"&&t.x+r>=e.x-r&&!p){globalThis.__DEBUG_CALCULATE_ELBOW_CASE=5;let m=t.x+r;s({x:m,y:t.y}),s({x:m,y:a}),s({x:o.x,y:a}),s({x:o.x,y:o.y})}else if(c==="x+"&&l==="x-"&&p&&e.x>t.x);else if(c==="x+"&&l==="x-"&&p)globalThis.__DEBUG_CALCULATE_ELBOW_CASE=7,s({x:t.x+r,y:t.y}),s({x:t.x+r,y:t.y+r}),s({x:e.x-r,y:t.y+r}),s({x:e.x-r,y:t.y});else{if(globalThis.__DEBUG_CALCULATE_ELBOW_CASE=8,c==="x+")s({x:t.x+r,y:t.y});s({x:n,y:i[i.length-1].y}),s({x:n,y:o.y}),s({x:o.x,y:o.y})}return s({x:e.x,y:e.y}),i};var Wc=(t,e,r={})=>{let i=t,n=e,a=!1;if(i.x>n.x||i.x===n.x&&i.y>n.y)a=!0,[i,n]=[n,i];let o=i.facingDirection==="x-",c=i.facingDirection==="y-",l=(Y)=>{let b=o?i.x-(Y.x-i.x):Y.x,M=c?i.y-(Y.y-i.y):Y.y,O=Y.facingDirection;if(o){if(O==="x+")O="x-";else if(O==="x-")O="x+"}if(c){if(O==="y+")O="y-";else if(O==="y-")O="y+"}return{x:b,y:M,facingDirection:O}},s=(Y,b)=>{let M=Y.x-b.x,O=Y.y-b.y,X=b.x+O,E=b.y-M,I=Y.facingDirection;switch(I){case"x+":I="y-";break;case"y-":I="x-";break;case"x-":I="y+";break;case"y+":I="x+";break}return{x:X,y:E,facingDirection:I}},p=(Y,b)=>{let M=Y.x-b.x,O=Y.y-b.y;return{x:b.x-O,y:b.y+M}},d=o||c?l(i):i,m=o||c?l(n):n,u=d,y=m,f=!1;if(d.facingDirection==="y+")f=!0,u={...d,facingDirection:"x+"},y=s(m,d);let _=r?.overshoot??0.1*Math.max(Math.abs(u.x-y.x),Math.abs(u.y-y.y)),x=v0(u,y,_);if(f)x=x.map((Y)=>p(Y,u));if(o||c)x=x.map(({x:Y,y:b})=>({x:o?i.x-(Y-i.x):Y,y:c?i.y-(b-i.y):b}));return a?x.reverse():x};var Ue=(t)=>[{x:t.left,y:t.bottom},{x:t.right,y:t.bottom},{x:t.right,y:t.top},{x:t.left,y:t.top}],V9=(t)=>{if(/\s/.test(t))return 0.28;if(/[ilI.,:;!'|]/.test(t))return 0.25;if(/[MW@%]/.test(t))return 0.9;if(/[mw]/.test(t))return 0.8;if(/[A-Z]/.test(t))return 0.67;return 0.56},Rc=(t)=>Array.from(t).reduce((e,r)=>e+V9(r),0);function Di(t){let e=t.font_size;if(!Number.isFinite(e)||e<=0||!Number.isFinite(t.rotation)||!Number.isFinite(t.position.x)||!Number.isFinite(t.position.y))return[];let r=t.anchor,i=r.includes("left")?0:r.includes("right")?1:0.5,n=r.includes("top")?0:r.includes("bottom")?e:e/2,a=-t.rotation*Math.PI/180,o=Math.cos(a),c=Math.sin(a);return t.text.split(`
`).flatMap((l,s)=>{let p=l.trim();if(!p)return[];let d=l.length-l.trimStart().length,m=(Rc(l.slice(0,d))-Rc(l)*i)*e;return[Ue({left:m,right:m+Rc(p)*e,top:n-s*e-e*0.05,bottom:n-(s+1)*e+e*0.05}).map(({x:y,y:f})=>({x:t.position.x+y*o-f*c,y:t.position.y+y*c+f*o}))]})}function Ui(t,e){for(let r of[t,e])for(let i=0;i<r.length;i++){let n=r[i],a=r[(i+1)%r.length],o=Math.hypot(a.x-n.x,a.y-n.y);if(o<0.000000001)continue;let c=-(a.y-n.y)/o,l=(a.x-n.x)/o,s=(m)=>m.map(({x:u,y})=>u*c+y*l),p=s(t),d=s(e);if(Math.min(Math.max(...p),Math.max(...d))-Math.max(Math.min(...p),Math.min(...d))<=0.000001)return!1}return!0}function Gi(t,e){let r=Math.hypot(e.x-t.x,e.y-t.y);if(r<0.000000001)return;let i=-(e.y-t.y)/r*0.01,n=(e.x-t.x)/r*0.01;return[{x:t.x+i,y:t.y+n},{x:e.x+i,y:e.y+n},{x:e.x-i,y:e.y-n},{x:t.x-i,y:t.y-n}]}function Dr(t,e,r){if(Math.hypot(e.x-t.x,e.y-t.y)<0.000000001)return!1;let i=0,n=1;for(let a=0;a<r.length;a++){let o=r[a],c=r[(a+1)%r.length],l=Math.hypot(c.x-o.x,c.y-o.y);if(l<0.000000001)continue;let s=-(c.y-o.y)/l,p=(c.x-o.x)/l,d=(t.x-o.x)*s+(t.y-o.y)*p-0.000001,m=(e.x-o.x)*s+(e.y-o.y)*p-0.000001;if(d<=0&&m<=0)return!1;if(d<=0)i=Math.max(i,-d/(m-d));if(m<=0)n=Math.min(n,-d/(m-d));if(n<=i)return!1}return n>i}var Oc=(t)=>{let e=t.flat();return{left:Math.min(...e.map((r)=>r.x)),right:Math.max(...e.map((r)=>r.x)),top:Math.max(...e.map((r)=>r.y)),bottom:Math.min(...e.map((r)=>r.y))}};class ne extends ct{static EPSILON=0.01;ctx;out;constructor({ctx:t,issues:e}){super();this.ctx=t,this.out=e}_step(){let t=this.ctx.circuitJson.filter((n)=>n.type==="schematic_port"),e=new Map(t.map((n)=>[n.schematic_port_id,n])),r=new Map(this.ctx.componentPlacements.flatMap((n)=>n.schematicComponentId?[[n.schematicComponentId,n]]:[])),i=new Set;for(let n of this.ctx.circuitJson.filter((a)=>a.type==="schematic_trace")){let a=this.getTracePoints(n),o=this.countTurns(a);if(o!==3)continue;let c=[this.getCandidate({trace:n,points:a,atStart:!0,currentTurnCount:o,ports:t,portsById:e,placementsByComponentId:r}),this.getCandidate({trace:n,points:a,atStart:!1,currentTurnCount:o,ports:t,portsById:e,placementsByComponentId:r})].filter((s)=>Boolean(s));for(let s of[...c]){if(!s.target.sourceComponentName?.startsWith("U"))continue;for(let p of[a[0],a.at(-1)]){let d=this.findPortAtPoint(t,p,n.schematic_sheet_id),m=d?.schematic_component_id?r.get(d.schematic_component_id):void 0;if(!m||!/^[CR]/.test(m.sourceComponentName??""))continue;c.push({target:m,deltaSchX:-s.deltaSchX,deltaSchY:-s.deltaSchY,currentTurnCount:o,suggestedTurnCount:s.suggestedTurnCount})}}let l=(s)=>/^[CR]/.test(s.target.sourceComponentName??"")?0:s.target.sourceComponentName?.startsWith("U")?2:1;c.sort((s,p)=>l(s)-l(p));for(let s of c){if(this.wouldOverlapAnotherComponent(s))continue;if(!this.validateMove(n,s,t))continue;let p=[s.target.schematicComponentId,s.deltaSchX.toFixed(3),s.deltaSchY.toFixed(3)].join("\x00");if(i.has(p))break;i.add(p),this.out.push(this.makeIssue(n,s));break}}this.solved=!0}getCandidate({trace:t,points:e,atStart:r,currentTurnCount:i,ports:n,portsById:a,placementsByComponentId:o}){if(e.length<4)return;let c=r?0:e.length-1,l=r?1:e.length-2,s=r?2:e.length-3,p=r?3:e.length-4,d=e[c],m=e[l],u=e[s],y=e[p],f=r?t.edges[0]:t.edges.at(-1);if(!f)return;let _=r?f.from_schematic_port_id:f.to_schematic_port_id,x=_?a.get(_):this.findPortAtPoint(n,d,t.schematic_sheet_id);if(!x?.schematic_component_id||!x.facing_direction)return;let Y=this.getAxis(d,m),b=this.getAxis(m,u),M=this.getAxis(u,y),O=x.facing_direction==="left"||x.facing_direction==="right"?"horizontal":"vertical";if(!Y||!b||!M)return;if(Y!==O||b===O||M!==O)return;if(!this.isPointInFacingDirection(d,m,x.facing_direction)||!this.isPointInFacingDirection(u,y,x.facing_direction))return;let X=o.get(x.schematic_component_id);if(!X)return;let E=u.x-m.x,I=u.y-m.y;if(Math.abs(E)<=ne.EPSILON&&Math.abs(I)<=ne.EPSILON)return;let U={x:d.x+E,y:d.y+I},q=r?[U,...e.slice(2)]:[...e.slice(0,-2),U],st=this.countTurns(q);if(st===void 0||st!==1||st>=i)return;return{target:X,deltaSchX:E,deltaSchY:I,currentTurnCount:i,suggestedTurnCount:st}}validateMove(t,e,r){let i=e.target.schematicComponentId,n=e.target.schematicSheetId,a=r.filter((b)=>b.schematic_sheet_id===n),o=a.filter((b)=>b.schematic_component_id===i),c=this.ctx.circuitJson.filter((b)=>b.type==="schematic_trace"&&b.schematic_sheet_id===n),l=(b,M)=>b.edges.some((O)=>O.from_schematic_port_id===M.schematic_port_id||O.to_schematic_port_id===M.schematic_port_id||this.pointsEqual(O.from,M.center)||this.pointsEqual(O.to,M.center)),s=c.filter((b)=>o.some((M)=>l(b,M)));if(!s.includes(t))return!1;if(this.ctx.circuitJson.some((b)=>b.type==="schematic_net_label"&&b.schematic_sheet_id===n&&o.some((M)=>this.pointsEqual(b.anchor_position??b.center,M.center))))return!1;let p=(b)=>({x:b.x+e.deltaSchX,y:b.y+e.deltaSchY}),d={left:"x-",right:"x+",up:"y+",down:"y-"},m=(b,M)=>({...M&&b.schematic_component_id===i?p(b.center):b.center,facingDirection:d[b.facing_direction]}),u=(b)=>b.slice(1).reduce((M,O,X)=>M+Math.abs(O.x-b[X].x)+Math.abs(O.y-b[X].y),0),y=(b)=>b.slice(1).map((M,O)=>({from:b[O],to:M})),f=Ut(e.target.schX+e.deltaSchX,e.target.schY+e.deltaSchY,e.target.width,e.target.height),_=c.filter((b)=>!s.includes(b));if(_.some((b)=>b.edges.some((M)=>Dr(M.from,M.to,Ue(f)))))return!1;let x=this.ctx.circuitJson.flatMap((b)=>{if(b.type==="schematic_net_label"&&b.schematic_sheet_id===n)return[Ue(Mr(b))];if(b.type!=="schematic_text"||b.schematic_sheet_id!==n)return[];return Di(b.schematic_component_id===i?{...b,position:p(b.position)}:b)});if(x.some((b)=>Ui(b,Ue(f))))return!1;let Y=[];for(let b of s){let M=this.getTracePoints(b);if(M.length<2||b.junctions?.length)return!1;let O=(H,k)=>{let at=a.filter((ot)=>k?ot.schematic_port_id===k:this.pointsEqual(ot.center,H));return at.length===1&&this.pointsEqual(at[0].center,H)?at[0]:void 0},X=O(M[0],b.edges[0].from_schematic_port_id),E=O(M.at(-1),b.edges.at(-1).to_schematic_port_id);if(!X?.facing_direction||!E?.facing_direction)return!1;if(o.some((H)=>l(b,H)&&H!==X&&H!==E))return!1;let I=(H)=>!this.pointsEqual(H,X.center)&&!this.pointsEqual(H,E.center)&&y(M).some(({from:k,to:at})=>Math.abs(Math.hypot(H.x-k.x,H.y-k.y)+Math.hypot(H.x-at.x,H.y-at.y)-Math.hypot(at.x-k.x,at.y-k.y))<0.000001);if(c.some((H)=>H!==b&&H.edges.some((k)=>I(k.from)||I(k.to))))return!1;if(this.ctx.circuitJson.some((H)=>H.type==="schematic_net_label"&&H.schematic_sheet_id===n&&I(H.anchor_position??H.center)))return!1;let U=Wc(m(X,!0),m(E,!0)).filter((H,k,at)=>k===0||!this.pointsEqual(H,at[k-1])),q=this.countTurns(U),st=this.countTurns(M);if(U.length<2||q===void 0||st===void 0||q>st||u(U)>u(M)+0.000001)return!1;if(!this.isPointInFacingDirection(U[0],U[1],X.facing_direction)||!this.isPointInFacingDirection(U.at(-1),U.at(-2),E.facing_direction))return!1;if(b===t){let H=this.countTurns(Wc(m(X,!1),m(E,!1)));if(q>=st||H===void 0||q>=H)return!1;e.suggestedTurnCount=q}for(let H of y(U)){if(x.some((ot)=>Dr(H.from,H.to,ot)))return!1;if(this.ctx.componentPlacements.some((ot)=>{if(ot.schematicSheetId!==n)return!1;let Z=ot.schematicComponentId===i?f:Ut(ot.schX,ot.schY,ot.width,ot.height);return Dr(H.from,H.to,Ue(Z))}))return!1;let k=Gi(H.from,H.to);if(!k)continue;if([..._.flatMap((ot)=>ot.edges),...Y.flatMap((ot)=>y(ot.points))].some((ot)=>{if([X,E].some((N)=>N.schematic_component_id!==i&&[H.from,H.to].some((tt)=>this.pointsEqual(tt,N.center))&&[ot.from,ot.to].some((tt)=>this.pointsEqual(tt,N.center)))&&this.getAxis(H.from,H.to)!==this.getAxis(ot.from,ot.to))return!1;let Z=Gi(ot.from,ot.to);return Z&&Ui(k,Z)}))return!1}Y.push({schematicTraceId:b.schematic_trace_id,points:U})}return e.suggestedTraces=Y,!0}getTracePoints(t){let e=t.edges[0];if(!e)return[];let r=[e.from];for(let i of t.edges){let n=r.at(-1);if(!this.pointsEqual(n,i.from))return[];r.push(i.to)}return r}countTurns(t){let e=[];for(let[r,i]of t.slice(1).entries()){let n=t[r];if(this.pointsEqual(n,i))continue;let a=this.getAxis(n,i);if(!a)return;e.push(a)}return e.slice(1).filter((r,i)=>r!==e[i]).length}pointsEqual(t,e){let{EPSILON:r}=ne;return Math.abs(t.x-e.x)<=r&&Math.abs(t.y-e.y)<=r}getAxis(t,e){let r=Math.abs(e.x-t.x),i=Math.abs(e.y-t.y),{EPSILON:n}=ne;if(r<=n&&i>n)return"vertical";if(i<=n&&r>n)return"horizontal";return}isPointInFacingDirection(t,e,r){let{EPSILON:i}=ne;switch(r){case"left":return e.x<t.x-i;case"right":return e.x>t.x+i;case"up":return e.y>t.y+i;case"down":return e.y<t.y-i}}findPortAtPoint(t,e,r){let{EPSILON:i}=ne;return t.find((n)=>n.schematic_sheet_id===r&&Math.abs(n.center.x-e.x)<=i&&Math.abs(n.center.y-e.y)<=i)}wouldOverlapAnotherComponent(t){let e=Ut(t.target.schX+t.deltaSchX,t.target.schY+t.deltaSchY,t.target.width,t.target.height);return this.ctx.componentPlacements.some((r)=>{if(r===t.target)return!1;if(r.schematicSheetId!==t.target.schematicSheetId)return!1;return Boolean(Ke(e,Ut(r.schX,r.schY,r.width,r.height)))})}makeIssue(t,e){let r=e.target.sourceComponentName||"component",i=this.getMoveDirection(e.deltaSchX,e.deltaSchY),n=Math.abs(e.deltaSchX||e.deltaSchY),a=e.target.schX+e.deltaSchX,o=e.target.schY+e.deltaSchY;return{lineItemType:"TraceCanBeSimplifiedByMovingComponent",schematicTraceId:t.schematic_trace_id,traceName:zn(this.ctx.circuitJson,t),targetComponent:e.target,deltaSchX:e.deltaSchX,deltaSchY:e.deltaSchY,newSchX:a,newSchY:o,currentTurnCount:e.currentTurnCount,suggestedTurnCount:e.suggestedTurnCount,suggestedTraces:e.suggestedTraces,message:`move ${r} ${i} by ${yr(n)} (to schX=${yr(a)}, schY=${yr(o)}) to reduce this trace from ${e.currentTurnCount} turns to ${e.suggestedTurnCount}`}}getMoveDirection(t,e){if(Math.abs(t)>ne.EPSILON)return t>0?"right":"left";return e>0?"up":"down"}static issueToString(t){let e=[];return S(e,"traceName",t.traceName),S(e,"targetComponentName",t.targetComponent.sourceComponentName),S(e,"deltaSchX",t.deltaSchX,{formatDelta:!0}),S(e,"deltaSchY",t.deltaSchY,{formatDelta:!0}),S(e,"newSchX",t.newSchX),S(e,"newSchY",t.newSchY),S(e,"currentTurnCount",t.currentTurnCount),S(e,"suggestedTurnCount",t.suggestedTurnCount),S(e,"message",t.message),`<TraceCanBeSimplifiedByMovingComponent ${e.join(" ")} />`}}function S0(t){let e=new Set,r=new Map;for(let a of t){if(a.type!=="source_net"&&a.type!=="source_port")continue;let o=a.type==="source_net"?a.source_net_id:a.source_port_id;if(a.type==="source_net"?a.is_power||a.is_ground||a.is_positive_voltage_source:a.provides_power||a.requires_power||a.provides_ground||a.requires_ground)e.add(o);let l=a.subcircuit_connectivity_map_key;if(l!==void 0){let s=r.get(l)??[];s.push(o),r.set(l,s)}}let i=vn(t),n=zs([...Object.values(i.netMap),...r.values()]);for(let a of Object.values(n))if(a.some((o)=>e.has(o)))for(let o of a)e.add(o);return e}class oe extends ct{static EPSILON=0.01;ctx;out;powerOrGroundConnectionIds;constructor({ctx:t,issues:e}){super();this.ctx=t,this.out=e,this.powerOrGroundConnectionIds=S0(t.circuitJson)}_step(){let t=this.ctx.circuitJson.filter((a)=>a.type==="schematic_port"),e=new Map(t.map((a)=>[a.schematic_port_id,a])),r=new Map;for(let a of t){if(!a.schematic_component_id)continue;let o=r.get(a.schematic_component_id)??[];o.push(a),r.set(a.schematic_component_id,o)}let i=new Map(this.ctx.componentPlacements.flatMap((a)=>a.schematicComponentId?[[a.schematicComponentId,a]]:[])),n=new Map;for(let a of this.ctx.circuitJson.filter((o)=>o.type==="schematic_trace")){let o=this.getTracePoints(a),c=this.countTurns(o);if(c===void 0||c<2)continue;let l=this.getTraceEndpoints(a,o,t,e);if(!l)continue;for(let[s,p]of[l,[l[1],l[0]]]){let d=this.getFlipCandidate({trace:a,targetEndpoint:s,connectedEndpoint:p,currentTurnCount:c,portsByComponentId:r,placementsByComponentId:i});if(!d)continue;let m=d.targetPort.schematic_component_id,u=n.get(m);if(!u||this.isBetterCandidate(d,u))n.set(m,d)}}for(let a of n.values())this.out.push(this.makeIssue(a));this.solved=!0}getFlipCandidate({trace:t,targetEndpoint:e,connectedEndpoint:r,currentTurnCount:i,portsByComponentId:n,placementsByComponentId:a}){let o=e.port,c=r.port,l=o.schematic_component_id,s=c.schematic_component_id;if(!l||!s||l===s||o.schematic_sheet_id!==c.schematic_sheet_id)return;let p=n.get(l);if(p?.length!==2)return;if(p.some((b)=>b.source_port_id&&this.powerOrGroundConnectionIds.has(b.source_port_id)))return;if((n.get(s)??[]).length<=2)return;let m=p.find((b)=>b.schematic_port_id!==o.schematic_port_id);if(!m||!this.areOppositePorts(o,m))return;let u=o.facing_direction,y=m.facing_direction;if(!u||!y)return;if(!this.traceLeavesPortInFacingDirection(e))return;let f=c.center;if(this.isPointInFacingDirection(o.center,f,u)||!this.isPointInFacingDirection(m.center,f,y)||!c.facing_direction||!this.isPointInFacingDirection(f,m.center,c.facing_direction))return;let _=this.getMinimumTurnCount(m.center,f,y);if(_>=i)return;let x=a.get(l),Y=a.get(s);if(!x||!Y)return;return{trace:t,targetPort:o,targetPlacement:x,connectedPlacement:Y,suggestedFacingDirection:y,currentTurnCount:i,suggestedTurnCount:_,traceLength:this.getTraceLength(e.pointsFromEndpoint)}}getTraceEndpoints(t,e,r,i){let n=t.edges[0],a=t.edges.at(-1);if(!n||!a||e.length<2)return;let o=n.from_schematic_port_id?i.get(n.from_schematic_port_id):this.findPortAtPoint(r,e[0],t.schematic_sheet_id),c=a.to_schematic_port_id?i.get(a.to_schematic_port_id):this.findPortAtPoint(r,e.at(-1),t.schematic_sheet_id);if(!o||!c)return;return[{port:o,pointsFromEndpoint:e},{port:c,pointsFromEndpoint:[...e].reverse()}]}getTracePoints(t){let e=t.edges[0];if(!e)return[];let r=[e.from];for(let i of t.edges){if(!this.pointsEqual(r.at(-1),i.from))return[];r.push(i.to)}return r}countTurns(t){let e=[];for(let[r,i]of t.slice(1).entries()){let n=t[r];if(this.pointsEqual(n,i))continue;let a=this.getAxis(n,i);if(!a)return;if(e.at(-1)!==a)e.push(a)}return Math.max(0,e.length-1)}traceLeavesPortInFacingDirection(t){let e=t.pointsFromEndpoint.find((r)=>!this.pointsEqual(r,t.port.center));return Boolean(e&&t.port.facing_direction&&this.isPointInFacingDirection(t.port.center,e,t.port.facing_direction))}areOppositePorts(t,e){let r=(t.facing_direction==="left"&&e.facing_direction==="right"||t.facing_direction==="right"&&e.facing_direction==="left")&&Math.abs(t.center.y-e.center.y)<=oe.EPSILON,i=(t.facing_direction==="up"&&e.facing_direction==="down"||t.facing_direction==="down"&&e.facing_direction==="up")&&Math.abs(t.center.x-e.center.x)<=oe.EPSILON;return r||i}getMinimumTurnCount(t,e,r){return(r==="left"||r==="right"?Math.abs(t.y-e.y)<=oe.EPSILON:Math.abs(t.x-e.x)<=oe.EPSILON)?0:1}isPointInFacingDirection(t,e,r){let{EPSILON:i}=oe;switch(r){case"left":return e.x<t.x-i;case"right":return e.x>t.x+i;case"up":return e.y>t.y+i;case"down":return e.y<t.y-i}}getAxis(t,e){let r=Math.abs(t.x-e.x),i=Math.abs(t.y-e.y),{EPSILON:n}=oe;if(r<=n&&i>n)return"vertical";if(i<=n&&r>n)return"horizontal";return}pointsEqual(t,e){let{EPSILON:r}=oe;return Math.abs(t.x-e.x)<=r&&Math.abs(t.y-e.y)<=r}findPortAtPoint(t,e,r){return t.find((i)=>i.schematic_sheet_id===r&&this.pointsEqual(i.center,e))}getTraceLength(t){return t.slice(1).reduce((e,r,i)=>{let n=t[i];return e+Math.abs(r.x-n.x)+Math.abs(r.y-n.y)},0)}isBetterCandidate(t,e){let r=t.currentTurnCount-t.suggestedTurnCount,i=e.currentTurnCount-e.suggestedTurnCount;return r>i||r===i&&t.traceLength>e.traceLength}makeIssue(t){let e=t.targetPlacement.sourceComponentName||"component",r=t.connectedPlacement.sourceComponentName||"component",i=t.targetPort.pin_number?`pin${t.targetPort.pin_number}`:t.targetPort.display_pin_label;return{lineItemType:"TwoPinComponentCouldBeFlipped",schematicTraceId:t.trace.schematic_trace_id,traceName:zn(this.ctx.circuitJson,t.trace),targetComponent:t.targetPlacement,connectedComponent:t.connectedPlacement,targetPin:i,currentFacingDirection:t.targetPort.facing_direction,suggestedFacingDirection:t.suggestedFacingDirection,deltaSchRotation:180,currentTurnCount:t.currentTurnCount,suggestedTurnCount:t.suggestedTurnCount,message:`rotate ${e} by 180° so ${i??"its connected pin"} faces ${r} and reduce this trace from ${t.currentTurnCount} turns to ${t.suggestedTurnCount}`}}static issueToString(t){let e=[];return S(e,"traceName",t.traceName),S(e,"targetComponentName",t.targetComponent.sourceComponentName),S(e,"connectedComponentName",t.connectedComponent.sourceComponentName),S(e,"targetPin",t.targetPin),S(e,"currentFacingDirection",t.currentFacingDirection),S(e,"suggestedFacingDirection",t.suggestedFacingDirection),S(e,"deltaSchRotation",t.deltaSchRotation),S(e,"currentTurnCount",t.currentTurnCount),S(e,"suggestedTurnCount",t.suggestedTurnCount),S(e,"message",t.message),`<TwoPinComponentCouldBeFlipped ${e.join(" ")} />`}}class Ur extends ct{params;VERBOSE_NET_LABEL_MESSAGE="Create trace with schDisplayLabel";netLabels;tokenToInvolvedPin;schematicSheetNameById;currentIndex=0;seen=new Set;constructor(t){super();this.params=t;let{circuitJson:e}=t.ctx;this.netLabels=e.filter((r)=>this.isSchematicNetLabel(r)),this.tokenToInvolvedPin=this.buildTokenToInvolvedPinMap(e),this.schematicSheetNameById=zr(e),this.solved=this.netLabels.length===0}_step(){let t=this.netLabels[this.currentIndex++];if(!t){this.solved=!0;return}this.solved=this.currentIndex>=this.netLabels.length;let e=`${t.schematic_sheet_id??""}:${t.text}`;if(!t.text.includes("/")||this.seen.has(e))return;this.seen.add(e);let r;if(t.schematic_sheet_id)r=this.schematicSheetNameById.get(t.schematic_sheet_id);let i={lineItemType:"VerboseSchematicNetLabel",schematicNetLabelId:t.schematic_net_label_id,sourceNetId:t.source_net_id,schematicSheetId:t.schematic_sheet_id,schematicSheetName:r,text:t.text,involvedPins:this.getInvolvedPins(t.text,this.tokenToInvolvedPin),schX:t.center.x,schY:t.center.y,message:this.VERBOSE_NET_LABEL_MESSAGE};this.params.issues.push(i)}static issueToString(t){let e=[];return S(e,"message",t.message),S(e,"text",t.text),S(e,"involvedPins",t.involvedPins.join(",")),S(e,"schSheetName",t.schematicSheetName),S(e,"schX",t.schX),S(e,"schY",t.schY),`<VerboseSchematicNetLabel ${e.join(" ")} />`}isSchematicNetLabel(t){return t.type==="schematic_net_label"}isSourcePort(t){return t.type==="source_port"}getSourceComponentWithName(t){if(t.type!=="source_component"||!("source_component_id"in t)||!("name"in t)||typeof t.source_component_id!=="string"||typeof t.name!=="string")return null;return{source_component_id:t.source_component_id,name:t.name}}getSourcePortNameCandidates(t){return[t.most_frequently_referenced_by_name,t.name,...t.port_hints??[],t.pin_number===void 0?void 0:String(t.pin_number)].filter((e)=>Boolean(e))}getBestSourcePortName(t){return t.most_frequently_referenced_by_name??t.name??(t.pin_number===void 0?"":`pin${t.pin_number}`)}buildTokenToInvolvedPinMap(t){let e=new Map(t.flatMap((i)=>{let n=this.getSourceComponentWithName(i);return n?[n]:[]}).map((i)=>[i.source_component_id,i])),r=new Map;for(let i of t.filter((n)=>this.isSourcePort(n))){if(!i.source_component_id)continue;let n=e.get(i.source_component_id);if(!n?.name)continue;let a=`${n.name}.${this.getBestSourcePortName(i)}`;for(let o of this.getSourcePortNameCandidates(i))r.set(`${n.name}_${o}`,a)}return r}getInvolvedPins(t,e){let r=new Set;for(let i of t.split("/")){let n=e.get(i);if(n)r.add(n)}return Array.from(r)}}class Gr extends ct{params;texts;obstacles;sheetNames;index=0;constructor(t){super();this.params=t;let{ctx:e}=t;this.sheetNames=zr(e.circuitJson);let r=new Set(e.circuitJson.flatMap((n)=>n.type==="schematic_component"&&n.is_box_with_pins===!1&&!n.symbol_name?[n.schematic_component_id]:[])),i=new Set;this.texts=e.circuitJson.flatMap((n)=>{if(n.type!=="schematic_text")return[];if(n.schematic_component_id||n.schematic_symbol_id)return[];let a=Di(n);if(!a.length)return[];let o=n.schematic_sheet_id,c=JSON.stringify([o,n.text,n.position.x,n.position.y,n.font_size,n.anchor,n.rotation,n.color]);if(i.has(c))return[];return i.add(c),[{text:n,isTraceLabel:Boolean("source_trace_id"in n&&n.source_trace_id),polygons:a,sheetId:o,object:{type:"text",id:n.schematic_text_id,text:n.text}}]}),this.obstacles=[...e.componentPlacements.flatMap((n)=>n.schematicComponentId&&!r.has(n.schematicComponentId)?[{object:{type:"component",id:n.schematicComponentId,componentName:n.sourceComponentName,schematicComponentId:n.schematicComponentId},polygons:[Ue(Ut(n.schX,n.schY,n.width,n.height))],sheetId:n.schematicSheetId}]:[]),...e.circuitJson.flatMap((n)=>n.type==="schematic_trace"?[{object:{type:"trace",id:n.schematic_trace_id},sheetId:n.schematic_sheet_id,segments:n.edges,polygons:n.edges.flatMap((a)=>{let o=Gi(a.from,a.to);return o?[o]:[]})}]:[])],this.solved=this.texts.length===0}_step(){let t=this.texts[this.index],r=[...this.obstacles,...this.texts.slice(this.index+1)].filter((i)=>this.collides(t,i));if(r.length){let i=t.isTraceLabel?void 0:this.findClearPosition(t);for(let n of r){let a=n.object.componentName??n.object.text;this.params.issues.push({lineItemType:"SchematicTextCollision",schematicSheetId:t.sheetId,schematicSheetName:t.sheetId?this.sheetNames.get(t.sheetId):void 0,schematicTextId:t.text.schematic_text_id,text:t.text.text,collidingObject:n.object,textBounds:Oc(t.polygons),collidingObjectBounds:Oc(n.polygons),suggestedMove:i,message:`Text "${t.text.text}" overlaps ${n.object.type}${a?` ${a}`:""}; ${t.isTraceLabel?"adjust the owning trace's label placement or remove stale duplicates to leave the visible text area clear.":"reposition the text to leave its visible area clear."}`})}}this.index++,this.solved=this.index>=this.texts.length}collides(t,e){if(t.sheetId!==e.sheetId)return!1;return t.polygons.some((r)=>e.segments?e.segments.some((i)=>Dr(i.from,i.to,r)):e.polygons.some((i)=>Ui(r,i)))}findClearPosition(t){let e=[...this.obstacles,...this.texts.filter((i)=>i!==t)],r=Math.max(0.1,t.text.font_size/2);for(let i=r;i<=Math.max(4,t.text.font_size*8);i+=r)for(let[n,a]of[[0,i],[0,-i],[-i,0],[i,0]]){let o=Math.round((t.text.position.x+n)*1000)/1000,c=Math.round((t.text.position.y+a)*1000)/1000,l={...t,polygons:Di({...t.text,position:{x:o,y:c}})};if(e.every((s)=>!this.collides(l,s)))return{newSchX:o,newSchY:c}}return}static issueToString(t){let e=[];return S(e,"text",t.text),S(e,"collidingObjectType",t.collidingObject.type),S(e,"collidingText",t.collidingObject.text),S(e,"newSchX",t.suggestedMove?.newSchX),S(e,"newSchY",t.suggestedMove?.newSchY),S(e,"message",t.message),`<SchematicTextCollision ${e.join(" ")} />`}}class lr extends ct{params;static MIN_DISTANCE=6;networks;index=0;constructor(t){super();this.params=t;this.networks=this.findNetworks(t.ctx),this.solved=this.networks.length===0}_step(){let t=this.networks[this.index],e=t.members.slice(0,2),r=Math.max(lr.MIN_DISTANCE,...e.map((n)=>3*Math.max(n.width,n.height))),i=e.map((n)=>Math.hypot(Math.max(0,Math.abs(n.schX-t.pinPosition.x)-n.width/2),Math.max(0,Math.abs(n.schY-t.pinPosition.y)-n.height/2)));if(i.some((n)=>n>r)){let n=t.host.sourceComponentName||"component",a=w0(t.pin),o=e.map((c)=>c.sourceComponentName||"component").join(", ");this.params.issues.push({lineItemType:"ResetNetworkNotGrouped",hostSchematicBox:t.host,resetSourcePortId:t.pin.source_port_id,resetPinName:a,supportNetworkComponents:t.members,maxDistanceFromResetPin:Math.round(Math.max(...i)*100)/100,maxRecommendedDistance:r,message:`Group ${o} near ${n}.${a} so the reset pull-up and capacitor can be read together. Preserve all net connections; associated test points may remain in a debug area.`})}this.index++,this.solved=this.index>=this.networks.length}findNetworks(t){let e=fn(t.circuitJson),r=t.circuitJson.filter((y)=>y.type==="source_component"),i=new Map(r.map((y)=>[y.source_component_id,y])),n=t.circuitJson.filter((y)=>y.type==="source_port"),a=new Map,o=new Map,c=new Set,l=new Set;for(let y of n){if(!y.source_component_id)continue;let f=a.get(y.source_component_id)??[];f.push(y),a.set(y.source_component_id,f);let _=e(y.source_port_id),x=o.get(_)??[];if(x.push(y),o.set(_,x),y.provides_power||y.requires_power)c.add(_);if(y.provides_ground||y.requires_ground)l.add(_)}for(let y of t.circuitJson){if(y.type!=="source_net")continue;if(y.is_power||y.is_positive_voltage_source)c.add(e(y.source_net_id));if(y.is_ground)l.add(e(y.source_net_id))}let s=new Map(t.componentPlacements.flatMap((y)=>y.sourceComponentId?[[y.sourceComponentId,y]]:[])),p=t.circuitJson.filter((y)=>y.type==="schematic_port"),d=new Map(t.circuitJson.filter((y)=>y.type==="schematic_component").map((y)=>[y.schematic_component_id,y])),m=[],u=new Set;for(let y of n){if(!y.source_component_id||!w0(y)||y.do_not_connect)continue;if(i.get(y.source_component_id)?.ftype!=="simple_chip")continue;let f=e(y.source_port_id);if(u.has(f)||c.has(f)||l.has(f))continue;u.add(f);let _=o.get(f)??[];if(new Set(_.filter((q)=>q.source_component_id&&i.get(q.source_component_id)?.ftype==="simple_chip").map((q)=>q.source_component_id)).size!==1)continue;let Y=s.get(y.source_component_id),b=p.find((q)=>q.source_port_id===y.source_port_id&&q.schematic_component_id===Y?.schematicComponentId);if(!Y||!b||b.schematic_sheet_id!==Y.schematicSheetId)continue;let M=[],O=[],X=[],E=!1;for(let q of new Set(_.map((st)=>st.source_component_id))){if(!q||q===y.source_component_id)continue;let st=i.get(q)?.ftype,H=a.get(q)??[],k=s.get(q);if(st==="simple_connector"||st==="simple_pin_header")continue;if(!k){E=!0;break}if(st==="simple_test_point"&&H.length===1){X.push(k);continue}if(H.length!==2){E=!0;break}let at=H.find((Z)=>e(Z.source_port_id)!==f);if(!at){E=!0;break}let ot=e(at.source_port_id);if(st==="simple_resistor"&&c.has(ot)&&!l.has(ot))M.push(k);else if(st==="simple_capacitor"&&l.has(ot)&&!c.has(ot))O.push(k);else{E=!0;break}}if(E||M.length!==1||O.length!==1)continue;let I=[...M,...O,...X],U=Y.schematicComponentId?d.get(Y.schematicComponentId)?.schematic_group_id:void 0;if(I.some((q)=>{let st=q.schematicComponentId?d.get(q.schematicComponentId)?.schematic_group_id:void 0;return q.schematicSheetId!==Y.schematicSheetId||q.subcircuitId!==Y.subcircuitId||st!==U}))continue;m.push({host:Y,pin:y,pinPosition:b.center,members:I})}return m}static issueToString(t){let e=[];return S(e,"hostComponentName",t.hostSchematicBox.sourceComponentName),S(e,"resetPin",t.resetPinName),S(e,"supportNetworkComponents",t.supportNetworkComponents.map((r)=>r.sourceComponentName||"component").join(",")),S(e,"maxDistanceFromResetPin",t.maxDistanceFromResetPin),S(e,"maxRecommendedDistance",t.maxRecommendedDistance),S(e,"message",t.message),`<ResetNetworkNotGrouped ${e.join(" ")} />`}}var w0=(t)=>[t.name,...t.port_hints??[]].find((e)=>/^N?(RESET|RST)(N|B)?$/.test(e.toUpperCase().replace(/[_\-!~#/]/g,"")));var z9={RailPathTooSpreadOut:[_r],CapacitorSeparatedFromChipPins:[gr],PiFilterComponentsNotGrouped:[xr],MosfetGateNetworkNotGrouped:[br],FlybackDiodeSeparatedFromRelayCoil:[vr],ComponentOverlap:[tr],SchematicBoxHasALotOfSurroundingWhitespace:[],CapacitorSymbolHorizontal:[re,le],VerboseSchematicNetLabel:[Ur],PinHeaderSchematicBoxTooWide:[er],GenericSchematicBoxTooWide:[er],SchematicBoxInnerLabelCollision:[Cr],SchematicPinPaddingToEdgeTooLarge:[Lr],DiodeResistorNotAligned:[he],ComponentPinsWouldAlignWithVerticalShift:[Oe],TraceCanBeSimplifiedByMovingComponent:[ne],CrystalNotCenteredOverLoadCapacitors:[je],ComponentNetLabelCollision:[Re],ComponentBoxNetLabelCollision:[Re],NetLabelCollision:[Re],FeedbackNetworkNotCompact:[qe],PullResistorOnWrongSide:[$e,Vn],SchematicTextCollision:[Gr],ResetNetworkNotGrouped:[lr],TwoPinComponentCouldBeFlipped:[oe],TwoPinComponentShouldBeVertical:[le],TwoPinComponentHasInvertedRails:[le],DecouplingCapacitorsNotCloseTogether:[Je],ConnectorPositionCausesTraceDetours:[Fr],LowSideTransistorNotAlignedWithLoad:[Pr],UsbSeriesResistorsNotAligned:[Ir],CurrentSenseShuntSeparatedFromInputs:[Sr],VoltageDividerSupplyResistorBelowGroundResistor:[wr],RegulatorCapacitorsOnWrongSides:[Ar]};class jc extends xm{ctx;issues=[];pipelineDef=[Ct("SchematicTextClearanceSolver",Gr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("ResetNetworkGroupingSolver",lr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("SchematicBoxOverlapSolver",tr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("CapacitorOrientationSolver",re,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("VerboseNetLabelSolver",Ur,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("SchematicBoxTooWideSolver",er,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("SchematicPinPaddingToEdgeSolver",Lr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("SchematicBoxInnerLabelCollisionSolver",Cr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("DiodeResistorAlignmentSolver",he,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("ComponentPinAlignmentSolver",Oe,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("TraceSimplificationSolver",ne,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("CrystalLoadCapacitorPlacementSolver",je,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("TwoPinComponentOrientationSolver",oe,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("FeedbackNetworkPlacementSolver",qe,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("TwoPinComponentRailOrientationSolver",le,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("PullResistorPlacementSolver",$e,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("SwitchPullResistorPlacementSolver",Vn,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("ComponentNetLabelCollisionSolver",Re,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("DecouplingCapacitorGroupingSolver",Je,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("ConnectorPlacementSolver",Fr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("LowSideTransistorPlacementSolver",Pr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("UsbSeriesResistorPlacementSolver",Ir,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("RegulatorInputOutputCapacitorPlacementSolver",Ar,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("VoltageDividerPlacementSolver",wr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("CurrentSenseShuntPlacementSolver",Sr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("RelayFlybackDiodePlacementSolver",vr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("PiFilterPlacementSolver",xr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("MosfetGateNetworkPlacementSolver",br,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("ChipPinPairCapacitorPlacementSolver",gr,(t)=>[{ctx:t.ctx,issues:t.issues}]),Ct("RailPathVisibilitySolver",_r,(t)=>[{ctx:t.ctx,issues:t.issues,maxSpan:t.railPathVisibility?.maxSpan,maxLength:t.railPathVisibility?.maxPathLength}])];selectedIssueTypes;railPathVisibility;constructor(t,e={}){super(t);if(this.railPathVisibility=e.railPathVisibility,e.issueTypes!==void 0){this.selectedIssueTypes=new Set(e.issueTypes);let r=new Set(e.issueTypes.flatMap((i)=>z9[i]));this.pipelineDef=this.pipelineDef.filter((i)=>r.has(i.solverClass))}}_setup(){this.ctx=b0(this.inputProblem)}getOutput(){let t=new Set(this.issues.flatMap((e)=>e.lineItemType==="TwoPinComponentShouldBeVertical"&&e.schematicBox.schematicComponentId?[e.schematicBox.schematicComponentId]:[]));return{issues:this.issues.filter((e)=>e.lineItemType!=="CapacitorSymbolHorizontal"||!t.has(e.schematicBox.schematicComponentId??"")).filter((e)=>this.selectedIssueTypes===void 0||this.selectedIssueTypes.has(e.lineItemType)),componentPlacements:this.ctx.componentPlacements}}}var Dn=({issues:t,componentPlacements:e,circuitJson:r})=>{let i=new Set,n=new Map(e.flatMap((l)=>l.schematicComponentId?[[l.schematicComponentId,l]]:[])),a=new Map;for(let l of e){if(!l.sourceComponentName)continue;let s=a.get(l.sourceComponentName);if(s)s.push(l);else a.set(l.sourceComponentName,[l])}let o=(l)=>{if(!l)return;let s=l.schematicComponentId?n.get(l.schematicComponentId):e.find((p)=>p.sourceComponentId===l.sourceComponentId&&p.schX===l.schX&&p.schY===l.schY);if(s)i.add(s)},c=(l,s)=>{if(!l)return;for(let p of a.get(l)??[])if(s===void 0||p.schematicSheetId===s)i.add(p)};for(let l of t)switch(l.lineItemType){case"CapacitorSeparatedFromChipPins":o(l.hostSchematicBox),o(l.capacitorSchematicBox);break;case"PiFilterComponentsNotGrouped":o(l.inductorSchematicBox),o(l.firstCapacitorSchematicBox),o(l.secondCapacitorSchematicBox);break;case"MosfetGateNetworkNotGrouped":o(l.mosfetSchematicBox),o(l.seriesGateResistorSchematicBox),o(l.gateSourceResistorSchematicBox);break;case"FlybackDiodeSeparatedFromRelayCoil":o(l.relaySchematicBox),o(l.diodeSchematicBox);break;case"CurrentSenseShuntSeparatedFromInputs":o(l.amplifierSchematicBox),o(l.shuntSchematicBox);break;case"VoltageDividerSupplyResistorBelowGroundResistor":o(l.supplyResistorSchematicBox),o(l.groundResistorSchematicBox);break;case"RegulatorCapacitorsOnWrongSides":o(l.regulatorSchematicBox),o(l.inputCapacitorSchematicBox),o(l.outputCapacitorSchematicBox);break;case"UsbSeriesResistorsNotAligned":o(l.positiveResistorSchematicBox),o(l.negativeResistorSchematicBox);break;case"LowSideTransistorNotAlignedWithLoad":o(l.transistorSchematicBox),o(l.loadSchematicBox),o(l.baseResistorSchematicBox),o(l.clampDiodeSchematicBox);break;case"DecouplingCapacitorsNotCloseTogether":for(let s of l.capacitorSchematicBoxes)o(s);break;case"ConnectorPositionCausesTraceDetours":o(l.connectorSchematicBox);for(let s of l.connectedComponents)o(s);break;case"ResetNetworkNotGrouped":o(l.hostSchematicBox);for(let s of l.supportNetworkComponents)o(s);break;case"SchematicTextCollision":if(l.collidingObject.schematicComponentId)o(n.get(l.collidingObject.schematicComponentId));if(l.collidingObject.type==="trace")for(let s of A0({schematicTraceId:l.collidingObject.id,circuitJson:r,placementByComponentId:n}))o(s);break;case"ComponentOverlap":o(l.firstComponent),o(l.secondComponent);break;case"SchematicBoxHasALotOfSurroundingWhitespace":case"CapacitorSymbolHorizontal":case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":case"SchematicBoxInnerLabelCollision":case"SchematicPinPaddingToEdgeTooLarge":o(l.schematicBox);break;case"VerboseSchematicNetLabel":for(let s of l.involvedPins)c(D9(s),l.schematicSheetId);break;case"DiodeResistorNotAligned":o(l.diodeSchematicBox),o(l.resistorSchematicBox);break;case"ComponentPinsWouldAlignWithVerticalShift":o(l.firstComponent),o(l.secondComponent),o(l.targetComponent);break;case"TraceCanBeSimplifiedByMovingComponent":o(l.targetComponent);for(let s of A0({schematicTraceId:l.schematicTraceId,circuitJson:r,placementByComponentId:n}))i.add(s);break;case"CrystalNotCenteredOverLoadCapacitors":o(l.crystalSchematicBox),o(l.firstLoadCapacitorSchematicBox),o(l.secondLoadCapacitorSchematicBox);break;case"TwoPinComponentCouldBeFlipped":o(l.targetComponent),o(l.connectedComponent);break;case"FeedbackNetworkNotCompact":o(l.amplifierSchematicBox);for(let s of l.feedbackComponents)o(s);break;case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":o(l.schematicBox);break;case"RailPathTooSpreadOut":o(l.hostSchematicBox);for(let s of l.supportSchematicBoxes)o(s);break;case"PullResistorOnWrongSide":o(l.resistorSchematicBox),o(l.hostSchematicBox);break;case"ComponentNetLabelCollision":o(l.firstComponent),o(l.secondComponent);break;case"ComponentBoxNetLabelCollision":o(l.boxComponent),o(l.labelComponent);break;case"NetLabelCollision":for(let s of l.pairs)c(s.comp1Name,l.schematicSheetId),c(s.comp2Name,l.schematicSheetId);for(let s of l.moves)c(s.componentName,l.schematicSheetId);break}return e.filter((l)=>i.has(l))},pr=(t)=>{if("schematicSheetId"in t||"schematicSheetName"in t){let e="schematicSheetId"in t&&typeof t.schematicSheetId==="string"?t.schematicSheetId:void 0,r="schematicSheetName"in t&&typeof t.schematicSheetName==="string"?t.schematicSheetName:void 0;if(e||r)return{schematicSheetId:e,schematicSheetName:r}}for(let e of Object.values(t).flat())if(U9(e))return{schematicSheetId:e.schematicSheetId,schematicSheetName:e.schematicSheetName};return{}},D9=(t)=>{let e=t.lastIndexOf(".");return e===-1?t:t.slice(0,e)},U9=(t)=>Boolean(t&&typeof t==="object"&&"positionAnchor"in t&&t.positionAnchor==="center"&&"schX"in t&&"schY"in t&&"width"in t&&"height"in t),A0=({schematicTraceId:t,circuitJson:e,placementByComponentId:r})=>{let i=e.find((s)=>s.type==="schematic_trace"&&s.schematic_trace_id===t),n=i?.edges[0],a=i?.edges.at(-1);if(!i||!n||!a)return[];let o=e.filter((s)=>s.type==="schematic_port"),c=new Map(o.map((s)=>[s.schematic_port_id,s]));return[n.from_schematic_port_id?c.get(n.from_schematic_port_id):B0(o,n.from,i.schematic_sheet_id),a.to_schematic_port_id?c.get(a.to_schematic_port_id):B0(o,a.to,i.schematic_sheet_id)].flatMap((s)=>{let p=s?.schematic_component_id?r.get(s.schematic_component_id):void 0;return p?[p]:[]})},B0=(t,e,r)=>t.find((i)=>i.schematic_sheet_id===r&&Math.abs(i.center.x-e.x)<=0.01&&Math.abs(i.center.y-e.y)<=0.01);class $c{lineItems;groupBySchematicSheet;constructor(t,e=!1){this.lineItems=t;this.groupBySchematicSheet=e}getLineItems(){return this.lineItems}getIssues(t={}){return this.lineItems.flatMap((e)=>e.lineItemType==="SchematicPlacementIssues"?e.issues:[]).filter((e)=>(t.issueTypes===void 0||t.issueTypes.includes(e.lineItemType))&&(t.schematicSheetId===void 0||(pr(e).schematicSheetId??"")===t.schematicSheetId))}getIssueCounts(t={}){let e={FlybackDiodeSeparatedFromRelayCoil:0,ComponentOverlap:0,SchematicBoxHasALotOfSurroundingWhitespace:0,CapacitorSymbolHorizontal:0,VerboseSchematicNetLabel:0,PinHeaderSchematicBoxTooWide:0,GenericSchematicBoxTooWide:0,SchematicBoxInnerLabelCollision:0,SchematicPinPaddingToEdgeTooLarge:0,DiodeResistorNotAligned:0,ComponentPinsWouldAlignWithVerticalShift:0,TraceCanBeSimplifiedByMovingComponent:0,CrystalNotCenteredOverLoadCapacitors:0,ComponentNetLabelCollision:0,ComponentBoxNetLabelCollision:0,NetLabelCollision:0,FeedbackNetworkNotCompact:0,PullResistorOnWrongSide:0,SchematicTextCollision:0,ResetNetworkNotGrouped:0,TwoPinComponentCouldBeFlipped:0,TwoPinComponentShouldBeVertical:0,TwoPinComponentHasInvertedRails:0,DecouplingCapacitorsNotCloseTogether:0,ConnectorPositionCausesTraceDetours:0,LowSideTransistorNotAlignedWithLoad:0,UsbSeriesResistorsNotAligned:0,RegulatorCapacitorsOnWrongSides:0,VoltageDividerSupplyResistorBelowGroundResistor:0,CurrentSenseShuntSeparatedFromInputs:0,PiFilterComponentsNotGrouped:0,MosfetGateNetworkNotGrouped:0,CapacitorSeparatedFromChipPins:0,RailPathTooSpreadOut:0};for(let r of this.getIssues(t))e[r.lineItemType]++;return e}getString(){return this.toString()}schematicBoxPlacementsToString(t){let e=[];return S(e,"componentName",t.sourceComponentName),S(e,"positionAnchor",t.positionAnchor),S(e,"schX",t.schX),S(e,"schY",t.schY),S(e,"width",t.width),S(e,"height",t.height),`<SchematicBoxPlacement ${e.join(" ")} />`}schematicIssuesToString(t){switch(t.lineItemType){case"CapacitorSeparatedFromChipPins":return gr.issueToString(t);case"PiFilterComponentsNotGrouped":return xr.issueToString(t);case"MosfetGateNetworkNotGrouped":return br.issueToString(t);case"CurrentSenseShuntSeparatedFromInputs":return Sr.issueToString(t);case"ComponentOverlap":return tr.issueToString(t);case"CapacitorSymbolHorizontal":return re.issueToString(t);case"DecouplingCapacitorsNotCloseTogether":return Je.issueToString(t);case"VerboseSchematicNetLabel":return Ur.issueToString(t);case"PinHeaderSchematicBoxTooWide":case"GenericSchematicBoxTooWide":return er.issueToString(t);case"SchematicBoxInnerLabelCollision":return Cr.issueToString(t);case"SchematicPinPaddingToEdgeTooLarge":return Lr.issueToString(t);case"DiodeResistorNotAligned":return he.issueToString(t);case"ComponentPinsWouldAlignWithVerticalShift":return Oe.issueToString(t);case"TraceCanBeSimplifiedByMovingComponent":return ne.issueToString(t);case"CrystalNotCenteredOverLoadCapacitors":return je.issueToString(t);case"TwoPinComponentCouldBeFlipped":return oe.issueToString(t);case"FeedbackNetworkNotCompact":return qe.issueToString(t);case"TwoPinComponentShouldBeVertical":case"TwoPinComponentHasInvertedRails":return le.issueToString(t);case"RailPathTooSpreadOut":return _r.issueToString(t);case"PullResistorOnWrongSide":return $e.issueToString(t);case"NetLabelCollision":return Re.netLabelCollisionToString(t);case"SchematicTextCollision":return Gr.issueToString(t);case"ResetNetworkNotGrouped":return lr.issueToString(t);case"ConnectorPositionCausesTraceDetours":return Fr.issueToString(t);case"LowSideTransistorNotAlignedWithLoad":return Pr.issueToString(t);case"FlybackDiodeSeparatedFromRelayCoil":return vr.issueToString(t);case"VoltageDividerSupplyResistorBelowGroundResistor":return wr.issueToString(t);case"RegulatorCapacitorsOnWrongSides":return Ar.issueToString(t);case"UsbSeriesResistorsNotAligned":return Ir.issueToString(t);default:return""}}toString(){let t=this.lineItems.filter((n)=>n.lineItemType==="SchematicBoxPlacement"),e=this.lineItems.flatMap((n)=>n.lineItemType==="SchematicPlacementIssues"?n.issues:[]);if(e.length===0)return"";if(!this.groupBySchematicSheet)return this.issueContextToLines(t,e).join(`
`);let r=new Map,i=(n)=>{let a=n.schematicSheetId??n.schematicSheetName??"__default__",o=r.get(a);if(o)return o;let c={...n,placements:[],issues:[]};return r.set(a,c),c};for(let n of e)i(pr(n)).issues.push(n);for(let n of t)i({schematicSheetId:n.schematicSheetId,schematicSheetName:n.schematicSheetName}).placements.push(n);return[...r.values()].flatMap((n)=>{let a=[];return S(a,"name",n.schematicSheetName),S(a,"id",n.schematicSheetId),[`<SchematicSheet${a.length>0?` ${a.join(" ")}`:""}>`,...this.issueContextToLines(n.placements,n.issues),"</SchematicSheet>"]}).join(`
`)}issueContextToLines(t,e){return[...t.length>0?["<SchematicBoxPositions>",...t.map(this.schematicBoxPlacementsToString),"</SchematicBoxPositions>"]:[],"<SchematicPlacementIssues>",...e.map(this.schematicIssuesToString),"</SchematicPlacementIssues>"]}}var Xc=(t,e={})=>{let r=new jc(t,e);r.solve();let{issues:i,componentPlacements:n}=r.getOutput(),o=[...Dn({issues:i,componentPlacements:n,circuitJson:t}),...i.length>0?[{lineItemType:"SchematicPlacementIssues",issues:i}]:[]],c=new Set(t.flatMap((l)=>("schematic_sheet_id"in l)&&typeof l.schematic_sheet_id==="string"?[l.schematic_sheet_id]:[]));return new $c(o,c.size>1)};function G9(t){let e=t.match(/<svg([^>]*)>/);if(!e)throw Error("Invalid SVG string: No <svg> tag found");let r={},i={},n=e[1]??"",a=/([A-Za-z_:][A-Za-z0-9_.:-]*)=(?:"([^"]*)"|'([^']*)')/g,o;while((o=a.exec(n))!==null){let _=o[1],x=o[2]??o[3];if(!_||x===void 0)continue;if(_==="xmlns"||_.startsWith("xmlns:"))i[_]=x;r[_]=x}let c=0,l=0,s,p,d,m,u;if(r.viewBox){s=r.viewBox;let _=s.trim().split(/[\s,]+/).map((x)=>Number.parseFloat(x));if(Number.isFinite(_[0]))p=_[0];if(Number.isFinite(_[1]))d=_[1];if(Number.isFinite(_[2]))m=_[2];if(Number.isFinite(_[3]))u=_[3];if(!r.width&&Number.isFinite(m))c=m;if(!r.height&&Number.isFinite(u))l=u}if(r.width){let _=Number.parseFloat(r.width);if(Number.isFinite(_))c=_}if(r.height){let _=Number.parseFloat(r.height);if(Number.isFinite(_))l=_}if(!Number.isFinite(c))c=0;if(!Number.isFinite(l))l=0;let f=t.match(/<svg[^>]*>([\s\S]*)<\/svg>/)?.[1]?.trim()??"";return{width:c,height:l,viewBox:s,viewBoxMinX:p,viewBoxMinY:d,viewBoxWidth:m,viewBoxHeight:u,content:f,attributes:r,xmlnsAttributes:i}}function H9(t,e,r){let i=[];if(i.push(`translate(${e}, ${r})`),t.viewBoxMinX!==void 0&&t.viewBoxMinY!==void 0&&t.viewBoxWidth&&t.viewBoxHeight){let{viewBoxMinX:a,viewBoxMinY:o}=t,c=t.width||t.viewBoxWidth,l=t.height||t.viewBoxHeight,s=c/t.viewBoxWidth,p=l/t.viewBoxHeight;i.push(`scale(${s}, ${p})`),i.push(`translate(${-a}, ${-o})`)}return i.join(" ")}function Q9(t,e){let r=new Map,i=/\bid="([^"]+)"/g,n;while((n=i.exec(t))!==null){let o=n[1];if(!o)continue;let c=`${o}${e}`;r.set(o,c)}if(r.size===0)return t;let a=t.replace(i,(o,c)=>`id="${r.get(c)||c}"`);return a=a.replace(/url\(#([^)]+)\)/g,(o,c)=>r.has(c)?`url(#${r.get(c)})`:o),a=a.replace(/(xlink:href|href)="#([^"]+)"/g,(o,c,l)=>r.has(l)?`${c}="#${r.get(l)}"`:o),a=a.replace(/style="([^"]*)"/g,(o,c)=>`style="${c.replace(/url\(#([^)]+)\)/g,(s,p)=>r.has(p)?`url(#${r.get(p)})`:s)}"`),a}function Z9(t,e){if(t.length===0)return t;let r=0;for(let n of t){let a=Math.max(n.width,n.height);if(a>r)r=a}if(r===0)return t;let i=e??r;return t.map((n)=>{let a=Math.max(n.width,n.height);if(a===0)return n;let o=i/a;return{...n,width:n.width*o,height:n.height*o}})}function K9(t){let e={};e.xmlns="http://www.w3.org/2000/svg";for(let r of t)for(let[i,n]of Object.entries(r.xmlnsAttributes))if(!e[i])e[i]=n;return e}function J9(t){return Object.entries(t).map(([e,r])=>`${e}="${r}"`).join(" ")}function F0(t,e={}){let r=e.gap??0;if(!Number.isFinite(r))r=0;let i=e.normalizeSize??!0;if(t.length===0)return'<svg width="0" height="0" viewBox="0 0 0 0" xmlns="http://www.w3.org/2000/svg"></svg>';let n=t.map((u,y)=>{try{return G9(u)}catch(f){throw Error(`Failed to parse SVG at index ${y}: ${f.message}`)}}),a=i?Z9(n,e.targetSize):n,o=Math.max(...a.map((u)=>u.width)),c=a.reduce((u,y)=>u+y.height,0)+r*(a.length-1),l=0,s=[];for(let u=0;u<a.length;u++){let y=a[u];if(!y)continue;let f=(o-y.width)/2,_=u===0?y.content:Q9(y.content,`__stack${u}`),x=H9(y,f,l);s.push(` <g transform="${x}">
${_}
</g>`),l+=y.height+r}let p=K9(a),d={width:o.toString(),height:c.toString(),viewBox:`0 0 ${o} ${c}`,...p,...e.rootAttributes||{}};return`<svg ${J9(d)}>
${s.join(`
`)}
</svg>`}var P0="T1RUTwAJAIAAAwAQQ0ZGIFhQSpcAAAcwAABJ3U9TLzJqmmVhAAABAAAAAGBjbWFwFN0WswAABEwAAALEaGVhZC1P1HwAAACcAAAANmhoZWEDrgI1AAAA1AAAACRobXR44xAAAAAAURAAAAFQbWF4cABUUAAAAAD4AAAABm5hbWUZQ94BAAABYAAAAutwb3N0AAMAAAAABxAAAAAgAAEAAAABAADb+Z65Xw889QADA+gAAAAA5e9IsgAAAADl70iy/9P/PwKHAvkAAAADAAIAAAAAAAAAAQAAA6z/LAAAArQAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAFQAAFAAAFQAAAADArQB9AAFAAACigK7AAAAjAKKArsAAAHfADEBAgAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAABYWFhYAEAAIQB6A6z/LAAAAvkAwQAAAAEAAAAAAiwC1wAAAAAAAAAAACIBngABAAAAAAAAAAEAWQABAAAAAAABABEAAAABAAAAAAACAAcAMwABAAAAAAADABsA/AABAAAAAAAEABkASAABAAAAAAAFAAsA2wABAAAAAAAGABgAkwABAAAAAAAHAAEAWQABAAAAAAAIAAEAWQABAAAAAAAJAAEAWQABAAAAAAAKAAEAWQABAAAAAAALAAEAWQABAAAAAAAMAAEAWQABAAAAAAANAAEAWQABAAAAAAAOAAEAWQABAAAAAAAQABEAAAABAAAAAAARAAcAMwADAAEECQAAAAIAgwADAAEECQABACIAEQADAAEECQACAA4AOgADAAEECQADADYBFwADAAEECQAEADIAYQADAAEECQAFABYA5gADAAEECQAGADAAqwADAAEECQAHAAIAgwADAAEECQAIAAIAgwADAAEECQAJAAIAgwADAAEECQAKAAIAgwADAAEECQALAAIAgwADAAEECQAMAAIAgwADAAEECQANAAIAgwADAAEECQAOAAIAgwADAAEECQAQACIAEQADAAEECQARAA4AOlRzY2lyY3VpdEFscGhhYmV0AFQAcwBjAGkAcgBjAHUAaQB0AEEAbABwAGgAYQBiAGUAdFJlZ3VsYXIAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0IFJlZ3VsYXIAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAclRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgBUAHMAYwBpAHIAYwB1AGkAdABBAGwAcABoAGEAYgBlAHQAUgBlAGcAdQBsAGEAclZlcnNpb24gMC4xAFYAZQByAHMAaQBvAG4AIAAwAC4AMSA6VHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhcgAgADoAVABzAGMAaQByAGMAdQBpAHQAQQBsAHAAaABhAGIAZQB0ACAAUgBlAGcAdQBsAGEAcgAAAAABAAMAAQAAAAwABAK4AAAAqgCAAAYAKgAAACEAIgAjACQAJwAoACkAKgArACwALQAuAC8AMAAxADIAMwA0ADUANgA3ADgAOQA8AD0APgBBAEIAQwBEAEUARgBHAEgASQBKAEsATABNAE4ATwBQAFEAUgBTAFQAVQBWAFcAWABZAFoAWwBcAF0AXgBfAGEAYgBjAGQAZQBmAGcAaABpAGoAawBsAG0AbgBvAHAAcQByAHMAdAB1AHYAdwB4AHkAev//AAAAAAAhACIAIwAkACcAKAApACoAKwAsAC0ALgAvADAAMQAyADMANAA1ADYANwA4ADkAPAA9AD4AQQBCAEMARABFAEYARwBIAEkASgBLAEwATQBOAE8AUABRAFIAUwBUAFUAVgBXAFgAWQBaAFsAXABdAF4AXwBhAGIAYwBkAGUAZgBnAGgAaQBqAGsAbABtAG4AbwBwAHEAcgBzAHQAdQB2AHcAeAB5AHr//wAA/+D/4P/g/+D/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/e/97/3v/c/9z/3P/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9r/2v/a/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2f/Z/9n/2QABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEABAEAAQEBGVRzY2lyY3VpdEFscGhhYmV0UmVndWxhcgABAQEo+BsA+BwC+B0D+B4Ei/tV+kD5SAUdAAABOQ8dAAAB4BGLHQAASd0SAFcBAQwlNj0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkFZlcnNpb24gMC4xVHNjaXJjdWl0QWxwaGFiZXQgUmVndWxhclRzY2lyY3VpdEFscGhhYmV0UmVndWxhciEiIyQnKCkqKywtLi8wMTIzNDU2Nzg5PD0+QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6AAAAAYsBjAGNAY4BjwGQAZEBkgGTAZQBlQGWAZcBmAGZAZoBmwGcAZ0BngGfAaABoQGiAaMBpAGlAaYBpwGoAakBqgGrAawBrQGuAa8BsAGxAbIBswG0AbUBtgG3AbgBuQG6AbsBvAG9Ab4BvwHAAcEBwgHDAcQBxQHGAccByAHJAcoBywHMAc0BzgHPAdAB0QHSAdMB1AHVAdYB1wHYAdkB2gHbAdwB3QBUAgABAAQAeADuAgwFUgWPBmUHOwffCGMIzwkMCUgJhQq1CzwMhg5ADwwQUBHfEt8U3hYZFqIXFxeiGEIZtBsIHCccsh0sHpIfGh9XIC8gtiEFIjwjJSRTJWUmviftKXQp2CqzK0gsfS0ILW8uPy6iLuAvQy+2L/IxEDItM0A0XjWWNlQ39zjFOTk59zp9Oro76Dy1Pd8+/EAaQJVCDELOQ49EGEVZReRGgUdR+UgO+Uj37vlBFYv8VgWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+FYFjpsFlZkFmpQFnI8FnIcFmoIFlX0FL/z3Fe+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBSeLBXqOBX2UBYGZBYebBY+bBZWZBZmUBQ75SPdm+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQX3p3sVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj3XvcoFYAiBYZ7BYB/BXyDBXmJBXqQBX6VBYOaBYmbBZPgBSR/BXqMBXuSBX+YBYaaBYycBZOaBZiVBZyRBfcPmgWe91QFKH8FeYwFfJIFf5gFhZoFjZwFkpkFmZYFm5EF9wyZBZ33RgWQmgWWmAWakwWdjQWchgWYgQWUfAWMewV7+zIF9zifBZr3JgWQmgWWmAWbkwWcjQWchgWZgQWTfAWNewV++xMF8JcFnIoFm4QFl34FkHwFinoFg30FfoAFeoUF+w19BXj7VQXslwWdigWahAWXfwWRewWKegWDfQV+gAV6hgX7CnwFfvscBYZ7BX9/BXyDBXqJBXqQBX2VBYOaBYmbBZf3CQX7MM0V9zifBZ/3VAX7OHcFDvlI9/T5XhWL/awFiHoFgX4FfIEFeogFeo4FfJUFgpgFh5wFi/msBY+bBZSZBZqUBZyOBZyIBZqCBZV9BfcB+2YVNd0FgpkFiJsFjpsFlZkFmpQFnI4FnIcFmoIF4DkFlX0FjnoFh3sFgX4FfYIFeYgFeo4FQ9sV+z+bBXuQBX2VBYOaBYmbBZCbBZeYBZqTBZ2MBfc+ewWchgWZgAWTfQWMegWGfAWAfgV8gwX7LqUVKjgFe4MFeogFeo8FfZUFgpkFiJwFkJsFlZgF7d4FmpMFnI0FnIcFmYEFlH0FjnsFh3sFLD4VZvsHBYN8BX2BBXqGBXqMBXuTBYCYBYabBY2bBa/3CAWTmQWZlgWckAWciQWbgwWWfwWQewVkIRWkSQWNegWHewWAfgV8gwV6iQV6jwV9lQWCmQVyzQWJmwWPmwWWmQWakwWcjQWchwWZgQWdTxXUWgWXfwWRewWKewWEfAV+fwV7hgV5iwV7kgVCvQV/lwWFmgWLnAWTmgWYlgWbkQWdigXTWhX3fFkFm4QFl38FkXwFi3oFhHwFfoAFe4UFeYwF+3y8BXuSBX+XBYWaBYycBZKaBZeWBZyRBfedUhXVWgWWfwWSewWKewWEfAV+fwV6hgV6iwV7kgVCvAV/mAWFmgWLnAWTmgWXlgWckQWcigX2PBWjOAWMewWGewV/fgV8hAV5igV6kAV+lgWDmQVz3gWKmwWQmwWXmAWakgWdjAWbhgWZgAWp+xAVW/sHBYF9BX2BBXqIBXmOBX2UBYGYBYebBY6cBbz3BwWUmQWalQWcjgWciAWaggWVfQWPewU/+y8V+w5aBXqHBXmOBX2UBYGZBYebBY6bBZWZBZmUBfcOvQWcjgWciAWaggWVfgWPewWIewWBfQX7M00V+zObBXuQBX2WBYOZBYqcBZCaBZaYBZuTBZyMBfczewWchgWYgAWTfAWNewWFewWAfwV7gwX7VqAVNb0Ff5YFg5oFi5sFkZsFl5cFm5IFnIsFnIYF4FkFmIAFknwFjHoFhXwFf38Fe4QFeYoF+wzZFWbuBYmbBY+bBZaYBZqUBZyNBZyHBZmBBZR9BbAnBY17BYd7BYB+BXyDBXmIBXqQBX2VBQ75SPfu+UEVi/uBBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3gQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj4Ko0VsmUFlX0FjnsFh3sFgX0FfYIFeYgFeo8FfZQFYrMFio0FiYwFY7sFiowFiowFYsMFiowFiowFY8oFio4FiY0FbcoFio4FiY4Fd8oFi44Fio0FgcMFi5IFi5IFlcMFjI0Fi44Fn8oFjY4FjI4FqcoFjY0FjI4Fs8oFjIwFjIwFtMMFjIwFjIwFs7sFjYwFjI0FtLMFmZQFnI8FnYgFmYIFlX0Fj3sFiHsFgX0FZGUFZV4FZFUFZE8Fb1AFeFEFg10Fk10FnlEFp1AFsk8FslUFDvlI95tWFYqJBWJjBX2CBXqHBXmOBX2UBYGZBYebBY6bBZWZBbKxBbG4BbLBBbLHBafGBZ7FBZO5BYO5BXjFBW/GBWTHBWTBBWW4BWSxBYGZBYibBY+bBZWZBZqUBZyOBZyHBZmCBbRjBYyJBY2KBbRbBYuKBY2KBbNTBYyKBYyKBbRMBYuIBY2JBapMBYuIBY2IBZ9MBYuIBYyJBZVTBYuEBYuEBYFTBYqJBYuIBXdMBYmIBYuIBWxMBYmJBYuIBWJMBYqKBYqKBWNTBYmKBYuKBWJbBQ75SPeU+FUV+zRWBXqIBXqPBX2VBYKZBYicBY+bBZaYBZqTBfc5wgUh9yQFhJoFi5sFkZsFmJYFm5IFnIsFm4UFmIAF8fsfBfH3HwWYlgWbkQWciwWchAWXgAWRewWLewWEfAUh+yQF9zlUBZqDBZZ+BY97BYh6BYJ9BX2BBXqHBXqOBfs0wAWL+yoFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFDvlI95T39hWL90sFjpwFlZgFmpUFnI4FnIgFmoEFlX4FjnoFi/tLBfdpiwWciAWaggWVfQWOewWIegWBfgV8ggV6hwX7aYsFi/tLBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv3SwX7aYsFeo8FfJQFgZgFiJwFjpsFlZkFmpQFnI4FDvlI96puFcJVBZV9BY56BYd7BYF+BXyCBXqIBXqOBX2VBTXfBYeRBYaRBYuMBYqMBYqSBYmSBYyMBYqMBY2SBYyTBYyLBYuMBZCRBY+RBfc/9zwFmpUFnI4FnIgFmoMFlX0Fj3sFiHsFgX0FDvlI90L35RX3kosFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogF+5KLBXqOBXyUBYGZBYibBY6bBZWZBZqUBQ75SPf/7RX7D4sFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9w+LBZyIBZmCBZV9BY97BYd7BYF9BX2CBQ75SKOAFfhx+WMFl5cFm5EFnYwFm4UFmIAFknwFjHoFhXwF/HH9YwV/fwV7hQV5igV7kQV+lgWEmgWKnAUO+Uj4CfkPFUOeBUN4BUZQBWMvBYH7JQWj+wwFxi0F2F0FyYsF2LkFxukFo/cMBYH3JQVj5wVq9x4VjYoFkYgFkYgFjIoFjYoF4EEFi4sFjIoFj4UFkIUFi4oFjIoFuSEFjIQFjYUFlvsyBYqGBYuGBXH7GQWIhQWJhAVH+wIFiYoFiokFhocFh4YFiYoFiooFKVEFh4kFiIkFhooFh4oFh4sFh4oFM4sFh4wFh4sFh4wFhowFiI0Fh40FKcUFiowFiYwFh5AFho8Fio0FiowFRvcCBYmSBYiRBXH3GQWLkAWKkAWW9zIFjZEFjJIFufUFjIwFi4wFkJEFj5EFjIwFjIsF39UFjYwFjIwFkY4FkY4FjYwFjYsF6aMFjowFjowFkYoFkYwFjooFjooF6XMFDvlI9/v5ZRWQjgWNjAWNjAWSiwWSjQWMigWNiwWSigWSiQWMigWNiwWRhwWQhwWMigWNigWOhQWPhQWMigWLiQWMhQWNhAWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/i2BTRFBXuDBXqJBXqPBX2WBYOZBYmbBY+bBZaYBfc19xUFDvlI90rmFffoiwWdiAWZggWVfQWOewWIewWBfQV9ggV5iAX8TosFg4wFg4wFiowFiosFhY8FhI8Fi4sFiowFhpEFh5EFi4wFiowFipIFiZIFi4wFi4wFjJIFjJIFjIwFi4wFj5EFj5EF9zn3PgX3L/dKBcTlBZezBYueBYOqBXeiBV6dBUaQBWaGBVBzBWttBX9mBYN9BX6ABXqGBXmNBXyTBYCYBYaaBYycBZu6BYuMBYyNBY+QBY6RBYyMBYyNBbi2BYuLBYuLBZOQBZKQBYuLBYuLBdWoBZCNBZGMBbqSBZCKBZCMBd2FBZKJBZKKBclxBYyKBY2LBZCHBZGHBYyKBY2JBaxlBYyKBYuKBY+FBY6EBYuKBYyKBZdeBYuFBYyGBYptBYqGBYuGBX1ZBYiFBYmGBUwpBYmJBYqJBfsy+04FiooFiooFDvlI9wqUFYeMBVObBXySBX+YBYabBY2bBZOaBZmVBZuQBZ2KBcB8BdeABeiJBb2WBdGxBbW2BZy5BYOvBWWzBUStBTSiBT2UBYiMBYiLBYWOBYaMBYmNBYiNBYePBYeOBYmOBYmNBYmQBYmQBYuOBYqOBYuQBYuRBYyNBYuOBY2QBY2QBY2NBY2OBY+PBY+PBY6MBY2NBZCNBZGNBY6LBY6MBduVBeKdBdGpBauoBZGqBXWtBV2uBUagBTyPBUp2BVZxBWhxBXyEBXmKBXuQBX2WBYOZBYqcBZCaBZeYBbCnBY+MBY6OBceoBY6MBY6NBdikBZOMBZSMBemGBZCKBZGKBd1yBZKIBZOHBcVeBZCGBZCGBa9UBY2EBY6FBYuKBYyKBYqEBYuDBYBQBYmHBYqHBYmIBYmHBYiIBYiHBVxfBYWGBYSHBUduBdFqBZGGBZKHBcBUBYyIBY6JBY2GBY6HBYuIBY2HBZZQBYuJBYyIBYqFBYuGBYqIBYuJBXNKBYuLBYuLBYeEBYaEBYuLBYuLBVZUBYWHBYaHBTlfBYWJBYWIBU19BYWLBYWKBSeNBYiMBYiLBTmWBQ75SPgF98IVi+oFj5sFlJgFmpUFnI4FnIgFmoEFlX4FjnsFiywF6YsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogFLYsFi/s9BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3PQX71IsFhIwFhYwFiYwFiYsFhY8FhY0Fio0FiYwFh5AFh5AFi40FiY0FipEFiZEFi40Fi40FjJEFjJEFjI0Fi40Fj5EFjpAF+Ab4PgWYlgWcjwWcigWbgwWWfgWQfAWKegWCfQX7yfv5BQ75SKn5QRWOmwWVmQWalAWcjwX4WIsFnIcFmoIFlX0FjnsFiHsFgX0FfIIFeogF/CuLBYv7dwX3HakFk4sFk4wF9x57BZOIBZOJBcJuBZGGBZGHBbFiBYyJBYyKBY6FBY+FBYuKBYyJBaj7BAWLigWLigWLhAWMhAWKigWLiQV9UQWLiwWLigWHhAWIhAWLiwWKigVnXgWFhQWFhgVFYQWFiQWFiAU5dQWGigWGigU+hwWFjAWGiwVKlwWGjQWGjAVWogWGjgWFjwVUugWAmAWHmwWOmwWUmQWZlQWcjwWciQWaggW9YQW0eQXCgQXNjgXSngXFrgWlqwWUswVz5wVxpwVjoAX7DZkF+01iBYaLBYaKBYeMBYiKBYaNBYaMBYiNBYeMBYePBYeNBYmOBYiNBYmQBYiPBYuOBYmPBYuPBYqQBQ75SPch96QVi4sFi4sFbW4FioMFnlkFm24FtWEFtHIFzoEF2o8FxaMFsqoFnrMFjaoFf7MFeKwFcqQFZ5sFUJcFU44FU4MFU28F+yxcFYqPBYyRBYy5BYuLBYuLBY7cBY2RBYyRBafaBYyNBYuNBbTfBZCSBZCRBcC7BY6NBY2NBdC4BZGOBZCOBdykBYyLBYuLBeKlBZ2NBZuGBZmBBZN8BY17BYZ7BYB+BXyDBTRyBUFzBU9kBV5jBWdABXJEBYp7BZGOBZCPBdGtBZKNBZKOBc6UBZCLBY+LBcuJBY+KBY+LBc58BZCKBZCJBbt2BZKGBZKHBa5oBY6GBY+GBaNhBYyHBY2HBZpZBYyEBYyFBYlbBYuLBYuLBYmDBYmDBYuLBYuLBW9UBYuKBYqKBYaGBYeFBYqKBYqLBVhiBYaIBYaIBUNtBYOJBYOJBS+GBYeMBYaLBTmXBYqLBYqLBYSOBYOOBYuLBYqLBVasBYiPBYaNBVq8BYeQBYeQBXaxBYqOBYqOBXXHBYqSBYmTBQ75SPfP90gVg/saBYd7BYF+BXyCBXmJBXqPBX2VBYKZBYmbBZL3HAWMjQWLjQWc9wcFi4wFjI0Fms0FjI0Fi4wFnsYFjIwFi40FoL4FjIwFi40ForcFjIwFi40Fo7EFjIwFjI0FoqoFjI0FjIwFoqYFjYwF+96LBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfhfiwWQigWQigWOigWPigWPiAWQiQWOiQWNiQWOhwWPhwWMiAWNiAWMhgWNhgWLiAWMiAWJhgWLhgWKiAWKiAWIhwWJhgWIiQWJiAWHiAWHiAVqeQV9gQVkaAV3dAV2bgV1aAV2YgV4WwV5UwV8TAUO+Uj3pvf2FUR0BUpaBXBZBYleBaZdBcVnBdlzBciJBeCmBb6wBaLEBYLEBWK1BTi2BVKfBdH3sxU4kQVLgAVXcwVrXQWVaQW4ZQW/bAXDeAWwlgXetQWdpgWMwwV1rwVr9wEVi4sFk4gFk4kFi4sFjIsF0GgFjokFj4kFjocFj4gFjYgFjYgFrVIFjIkFjYgFjIYFjYYFiogFjIgFiTwFi4gFi4kFiYUFioYFiYkFiogFbVwFiYkFiYgFh4gFh4cFiIoFiYkFUm4F0mYFkIcFkYcFw1IFjYcFj4gFjIcFjYgFjIYFjIcFmDoFi4kFi4kFioUFi4UFiokFiokFbDwFiYcFiogFh4cFiYgFiIgFiIkFR1sFhYgFhYcFJ2sFg4oFg4oFP40FhY0FhIsFMqcFho4FhY0FQ7gFio0FiYwFho8Fh5AFio0FiYwFZc0Fio4Fio4FipAFiZAFjI4Fio4Fjs0Fi4wFi4sFjZMFjZIFi4wFi4sFr80Fi4wFjIwFkJAFkJEFi4wFjIsF2sYFkY4Fko8FmI8FaZ8FiI4Fh40FUrwFiY0FiI4FiY8FiI8Fio4FiY4FeMsFi40Fi4wFipIFi5IFi4wFi4wFjpIFjZIFjIsFjI0Fu9IFjo4FjY4Fj44Fj44Fjo0Fjo0F0KsFkYwFkY0F15gFkIsFkYwF7YQFDvlI+Fr4mBWVnQV8xwVwqwVfoAVIkwVHgwVTdAVnagV+XwWYYAWvaQXDdAXMhAXMmgW8qgVf/BoVi4oFZ0IFgX4FfIIFeYgFeo8FfZUFgpkFiJsFj5sFr9QFtuoFwPcXBYuLBYuMBZKcBT55BYOKBYKLBTuUBYWNBYWMBUWoBYSPBYSQBVm6BYqNBYmMBYiQBYeQBYuOBYqNBXfNBYqOBYqOBYyQBYqQBYyOBYyPBZ/NBYyNBYuNBY+QBY6QBY2NBYyNBb26BZKPBZKQBdGnBZGMBZGNBduVBZGKBZGMBduBBZKJBZKJBcdvBYyKBYyLBZGGBZGHBYuKBYyKBbNcBYyKBYyKBY6FBY6FBYuJBYyKBZ83BYuFBYyEBYqJBYuJBYmFBYmGBYqHBUH7SAVW+xgFi4oFiooFXysFDvlI9y/3yxX4OvtDBZqBBZR9BY57BYd7BYF9BXyCBXqJBXqOBfyY92oFhI8FhY8FiowFiowFh5EFh5EFi4wFiosFipMFiZIFi4wFi4wFjZIFjJIFjIwFi4wFj5EFj5EFjIwFjIsFkY8Fko8F+Jj3agWcjwWciAWaggWVfgWPewWIegWCfQV8ggUO+Ui2+GkV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAWc+4gV+JiLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfyYiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj44/fpFYyKBY+FBY+FBYuKBYyKBYyEBY2EBYuKBYuKBYmEBYqDBYqLBYuKBYeFBYeFBYqKBYqKBYWHBYSHBfyY+2oFeogFeo0FfJQFgZkFh5sFjpsFlJkFmpUF+Dv3QwX8O/dDBXyUBYKZBYicBY+bBZWYBZqUBZyOBZyHBfiY+2oFkocFkYcFDvlI+Ev3kxWGigX7q4sFi4sFLPtyBYF9BX2CBXqIBXmOBX2UBYGYBYecBY6bBfek+REFkJIFkJIFi4sFi4sFko8FkpAFi4sFjIsFk40Fk40FjIsFi4sFk4kFlIoFi4sFi4sFkoYFkocFjIsFi4sFkIQFj4QF97r9EQWPewWIegWBfgV9gQV6iAV5jgV9lAWBmAX7IvfIFfsB94AFJvuABQ75SPe++GUV2bYFlMsFTL8F+weeBSmGBYv7VgX32vxEFYSJBYmLBYmLBfv7hwWKiwWLiwWDjAWCjQWLiwWLiwWEjwWEkAWKiwWLiwWGkgWHkQWLjAWKiwWKkwWJkgWLjAWLiwWL+QoFjJIFjZIFi4wFi4wFkJEFjpEFjIwFjIwFkY8FkY8FjYsFjIwFkowFk40F9yWTBZCKBZCLBfcZdQWOigWPigWQiQWQiQWNiQWOiQXlQQWNiAWPiQWNhwWOhwWMhwWNiAWLhgWMhwWLhwWLhwV9+wAFiokFi4gFiIYFiYYFiYkFiogFh4cFh4cFiIoFiYkFSGYF9wJmBY6JBY+KBY+IBY+JBY2IBY6IBdE3BY6GBY6FBYyJBYuKBYyEBYyEBYX7AAWLiQWLiQWJhQWJhQWKiQWKiQVsWwWIiQWKiAWHiAWHhwWIigWIiQU+ZAWJigWJigVu3BXEqAWeqAWP3QVYyQX7JLsF+1CWBYv7nAUO+Uj4ZPclFaDbBZOZBZiXBZuQBZ2KBZuEBZd/BZF7BYp7BXIwBYqIBYqHBYiHBYmHBYiIBYmIBUNLBYiJBYmJBYaJBYaIBYiLBYiJBSl1BYuLBYuLBYOLBYKLBYuLBYuLBfsEnAWJiwWKjAWEjQWEjgWKjAWKiwVRsQWFkQWFkQVU3QWLiwWLiwWIkwWIkgWLiwWLiwVm918Fi5MFi5MFuvdeBYyMBYuNBY+RBY2RBY2MBYyNBc7XBYyMBYuLBZGQBZKQBYuLBYuLBdGsBZKNBZKOBdqVBYyLBYyLBZOKBZKLBYyKBY2LBfVqBYyLBYyLBZKHBZGHBYyLBYyKBcNZBYyLBYuKBZCFBY+FBYyKBYuLBapEBY57BYh7BYF9BXyCBXqIBXqOBXyVBYGYBXDJBWKwBTSlBU6EBVVxBVRNBWD7TAWt+04FuUgFtG8F6H0F2JwFDvlI93uVFYaKBfs1iAWLiwWKiwWDjAWDjQWKiwWLiwWEjwWEjwWLjAWKiwWHkgWGkQWLjAWLiwWJkwWJkgWMjAWKiwWT+QQFjJAFi5EFjY0Fi48Fj48FjY8FjY4FjY0FkI4Fj44Fjo0FjowFkIwFkY0F7pgFj4sFjowF14kFkYoFkIsF9xBrBYuLBYuLBZOHBZKIBYyLBYuKBeZIBYyKBYuLBZCFBZGFBYuLBYuKBb8wBY2FBY6GBaAsBYuHBYyHBY1EBYqHBYuIBYJOBYmHBYqHBXhXBYeFBYmGBUw8BYWGBYWGBTdZBYWJBYWIBfsdaAV53hX3EasF0rUFwM4Fm7UFlMAFicsFeOAFXtoFPsQF+wGnBUiMBVGDBYX8tAUO+Uj3EeUV+CGLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfxOiwV6jgV8lAWCmQWHmwWL99MFi/fSBY+bBZSZBZqUBZyPBfhOiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX8IYsFi/t+BfeciwWdiAWZggWVfQWOewWIegWBfgV9ggV5hwX7nIsFDvlI9xf32hWL+6oFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBYyKBfgviwWciAWZggWVfQWPewWHewWBfQV9ggV6iAX8FYsFi/t4BffQiwWdiAWZggWVfQWOewWIewWBfQV9ggV5hwUO+Uj4fve0Ffs1iwV6jwV9lAWBmQWImwWOmwWVmQWZlAWdjgX3bIsFj4oFkIsFj4kFj4oFj4kFj4kFjogFj4kFjYgFjocFjYgFjYcFjIcFjYcFi4cFjIcFiocFi4cFXvtaBYqJBYuIBYiGBYiGBYmJBYqJBUtGBYmKBYqJBYWIBYaHBYmKBYmKBTpwBYqLBYuKBYOKBYOKBYqLBYqLBTWSBYSNBYSNBTmuBYWOBYaOBUfCBYaQBYaQBV/QBYuMBYqMBYmRBYiSBYuMBYuMBXf3UgWLkQWLkgWx90IFjIwFi40FjpEFjpEFjIwFjI0FzdsFjIwFi4wFkZAFkY8FjIwFjIsF37QFi4sFi4sFk40Fk44Fi4sFi4sF9xeVBZKKBZGLBfcQcQWbhQWXfwWRfAWLegWEfAV+gAV7hQV5iwX7CKMF+weCBUhrBVZJBWj7MwWe+0IFrlUFxFwF0W4Fz4UFx6AFvL8FDvlI+H74OhWL95sFj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBYv3tgX8DosFi/u2BYd7BYJ9BXyCBXqIBXqOBXyUBYGZBYibBYv34AWL98UFjpsFlZkFmpQFnI8FnIcFmoIFlH0Fj3sFi/ubBQ75SPfu+UEVi/0RBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5EQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Ui/9z4Vio4Fia8FjpsFlJkFmZUFnY4FnIkFmoIFlX4Fj3sFjGsFkXIFlXYFmXkFnX0FunoFzoQFu5EFwp8FoJkFnJ0Fl6EFk70FivhxBY6bBZWZBZqUBZyPBZyHBZqCBZR+BY96BYz8dAWKiAWLiAWCTgWJhQWJhAV5awWHhgWIhwVycQWHiAWIiAVtdwWGiQWGiAVKcwWGigWFigVRhAWGiwWGiwU8kwWFjAWFjAVRoQWFjwWFjQVvoQWHjwWHjgV2pQWJkAWIjwV+qAWKkAWJjwWEqwUO+Uj3Uff3FfsBOQWL+3UFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY+bBZWZBZmUBZyPBZ2HBZmCBZV9BY57BYv7xAX4Hve7BZuSBZyNBZyGBZiABZR8BYx7BYZ7BX9/Bfui+14F9+b70AWVfQWPewWHewWCfQV8ggV6iAV6jgV8lAUO+Uj3DOUV+CuLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfxYiwV6jgV9lAWBmQWHmwWL+REFj5sFlZkFmZQFnI8FnYcFmYIFlX0FjnsFDvlI+KH5WxWOjwWNjQWNjQWRjQWPjgWOjAWOjAWRjAWRjAWOigWOiwWQiQWRigWNigWOigWQhwWPiAWNiQWNiQWOhgWOhgWMiQWMiAWLhgWNhQWL/REFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h1BftD+6wFiYkFiokFhocFh4cFiYkFiYoFhYkFhYgFiYsFiIoFhYwFhYoFiIwFiYsFhY4FhY0FiYwFiY0Fh48Fho8Fio0FiY0F+0P3rAWL/HUFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/kRBY2RBYuQBYyOBYyNBY6QBY6QBY2NBY2NBY+OBZCPBY6MBY2MBZGMBZCNBY6LBY6MBZGKBZGKBY6KBY6KBY+IBZGJBY2JBY2JBY6HBY+HBfdw+/UF93D39QUO+Uj4e/dPFYT4hgWOmwWVmQWZlAWcjwWdiAWZggWVfQWPewWU/REFioYFi4cFiocFiocFiYgFiYcFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4oFhosFh4oFhosFh4sFh40Fh4wFh40Fh4wFiI4Fh44FiI4FiI4F/BT4oQWL/IkFh3sFgn0FfIIFeogFeo4FfJQFgZkFiJsFi/kRBYyPBYuPBYyPBYyPBY6PBYyOBY6OBY6PBY6NBY6OBZCNBY+NBY+MBY6NBZCLBZCMBY+KBY+LBY+JBZCKBY+JBY6KBY+IBY+IBY2IBY6IBQ75SPgblBWFiAWJiwWJiwUzgAWKiwWKigWEjAWDjAWKiwWKiwUypQWJjAWIjAWGjgWGjgWJjQWJjAU62gWJjgWIjgWJjwWIjwWLjwWJjgVP96AFi40Fi4wFi5IFi5IFjIwFi40FxPddBY2PBYyPBY6OBY2PBY6NBY6PBdHEBYyMBYyMBZKOBZGOBY2LBYyMBfcOqQWPiwWPjAWQigWPjAWPiQWPiwX3B2cFjIoFjYsFkYcFkYgFjIoFjYkFzkoFjYgFjYkFjocFjYYFjIgFjIgFxfuJBYuDBYuDBW/7LgWIhAWJhQVYMgWKiQWLigWGhgWGhgWKigWKigUwTgWJigWKigUg0BXOkwXUvAW11gWl9x8FVvd1BVm8BTCoBShzBVdgBVj7RgXD+4sFy00FDvlI93j3xxWJigX7AooFi/uVBYd7BYF9BX2CBXqIBXmOBX2UBYGZBYibBYv5BQWMkQWMkgWMjAWLjQWPkQWOkAWNjAWMjQWQjwWRjwWNiwWMjAWSjQWRjAX3HZcFjosFj4sF9w6EBY+KBZCLBdp2BY+KBY+KBa96BZCIBZCIBcRbBYuKBYuLBZCFBZCEBYuLBYyLBaRXBY2EBY2EBZA/BYuJBYuJBYqFBYqFBYqJBYuJBXRcBYqJBYqJBYeHBYeFBYmKBYqKBWhxBYWIBYWIBVN2BYeKBYeJBTp8BYiLBYmLBfsCggWF4BX1kwXWmQW5nAWgmwWZpwWGxAV6sAVesQVxlwVEnQX7BpIFL4MFi/uJBQ75SPiTtRXQOQWTfAWNewWFewWAfwV7gwV6igV6kAV+lQVRzwVUYAWIigWJiQWGiQWGiAWHiwWIigU1fgWJjAWJigWEjAWFiwWJjAWIiwU0qQWJjAWIjAWGjgWGjgWJjgWJjAU75AWKjgWJjQWJkAWIkAWLjgWKjQVQ98MFi4sFi4sFi5MFi5MFi4sFi4wFw/d2BY2OBYyPBY2PBY6PBY2OBY2OBdDLBY2MBYyNBZGOBZGOBY2MBY2MBfcLrAWRjAWRjAWNigWOjAWRiQWRigX3BGMFjYoFjooFj4cFkYgFjIkFjYoFzUEFjIkFjYkFjYYFjoYFjIgFjIkFw/uoBYuEBYuEBW/7QgWJhQWJhQX7K0AVMfUFg5oFipsFkJsFlpcFm5MFnIwFnIYFmIEF0zcFmqkFpfc1BVb3lgVZxAU0qgUucQVXWgVY+2IFwvuvBctDBcx2BcmUBQ75SPfz+EoV3JcFrpgFoJsFlqIFjLMFfbkFgZYFd5gFcZUFQZsF+xSQBfsofgWL+10F90g8FftIhQWL+7cFh3oFgn4FfIEFeogFeo4FfJUFgZgFiJwFi/j8BYyRBYyRBYyNBYuNBY+QBY6RBY2MBYyNBZGOBZCPBY2MBY2MBZGMBZKNBfdUmwWOiwWOjAX3G4UFj4oFj4sF3HoFj4kFj4sFrX0Fj4kFj4kFp3kFj4cFkIgFoHQFi4oFjIsFjoQFj4UFi4oFjIoFnU0FjIUFjIUFiVQFi4sFiYMFiYMFi4sFeWQFiooFi4oFhoUFhoUFiosFi4oFaXAFhIgFhYcFXXoFhooFhokFNX8F94H7rQWTfQWNegWGewV/fwV8gwV5igV6kAV+lgX7nPfLBYOaBQ75SOXBFYaOBYqNBYiNBYmQBYeQBVr3AQWHnAWOmwWVmQWZlAWcjgWdiAWZggWVfgW3KgXNaQX3IIcF7bgFq/AFdsUFS68F+4ezBYiNBYiLBYaNBYaNBYmOBYiMBUu+BYiPBYiOBYmOBYiOBYqQBYmOBXrHBYuPBYqOBYuQBYuPBYyPBYyPBbT3DAWOkAWNkAWNjQWMjQWQjwWPjwXvzAWRjgWQjgWOiwWNjAWRiwWRjAX3R4IFjYoFjIwFkogFkooFjIoFjYoFkIcFkYcFjIoFjIoF1zAFknwFjXoFhXwFgH4Fe4QFeYoFe5AFfpYFTNYF+yOTBUBaBWssBZVoBbZoBfeDYwWTiQWTiAXfWgWQhwWQhwWNiQWMigWOhQWOhgWrNgWLhgWNhwWLhwWLiAWKhgWKhgVi+xgFi4oFiooFh4UFiIQFiosFiooFhYYFhYcFiosFiooF+xJRBYmLBYqKBYSKBYSJBYmLBYmLBfs2jwWJjAWJiwWFjQWEjAWJjAWJjAUzuQUO+Uj3yflsFfeiiwWchwWaggWVfQWOewWIewWBfQV8ggV6iAX7dYsFi/znBYh7BYF9BX2CBXmIBXqOBXyUBYKZBYebBYv45wX7hYsFeo4FfJQFgZkFiJsFjpsFlZkFmpQFnI8FDvlI+HT3hxWQ+E4Fj5sFlZkFmZQFnY4FnIcFmYIFlX0FjnsFhvxQBYqIBYyJBYFHBYqHBYqGBXdYBYmIBYmHBX53BYiHBYiIBW1sBYWHBYaHBVhxBYSJBYSJBU2BBYWLBYSLBTOUBYaNBYWMBUWlBYWPBYWOBVyvBYeQBYWQBWjCBYiRBYiRBXnSBYqPBYqOBYTsBYuNBYuMBYr39wWOmwWVmQWalAWcjwWchwWaggWVfgWOegWM+/UFki8Fm00Fp2EFr28FxXYF14IFu5MFsJ4FoqIFk5cFnLYFDvlI99H3NRX3a/ivBZSZBZqVBZyPBZyIBZqCBZV+BY97BYh6BfuS/REFi4sFi4oFhoUFh4QFi4sFiooFhIcFhYYFiosFi4sFg4kFg4oFiosFi4sFg4wFgowFi4wFiosFhI8FhI8Fi4sFi4wFhpEFhpEFi4wFi4sF+7j5EgWHmwWOmwWVmQWZlAWcjwWciAWaggWVfQUO+Uj4dvdYFdf4gwWQmwWXlwWbkgWcjAWchgWYgAWTfAWMegUq/REFiYcFioYFiYgFiocFiIgFiIcFiIkFiIgFh4kFh4kFh4oFh4kFh4sFhooFh4sFh4sFho0Fh4sFh40Fh40FiI4Fh40FiI4FiI4FiY8FiI4F+0b3/wX7Ofv2BYiHBYiGBYmJBYmJBYaIBYeHBYiKBYiKBYaKBYWJBYiLBYiLBYWMBYaLBYiNBYiLBYaOBYaOBYmNBYiNBYiPBYiPBYqOBYmOBYqQBYmQBTv5CQWNnAWTmQWYlgWckAWcigWbhAWWfgWRewXH/G8F9x/3vgWPkAWPkQWMjAWMjAWRjwWRjwWNiwWMjAWSjAWSjQWNiwWMiwWSiQWTigWMiwWMigWRhwWSiAWMigWMigWPhQWPhQUO+Uj3/Pf/FfeZ+7QFlH0FjXsFhnsFgH4FfIMFeYkFeo8FfpYF+5D3qQX7kPupBX6ABXqHBXmNBXyTBYCYBYabBY2bBZSZBfeZ97QF+5/3uwWCmQWJnAWQmwWWlwWalAWdjAWchwWYgQX3lvuxBfeW97EFmZUFm48FnYoFmoIFln8FkHsFiXoFgn0FDvlI9+j4EhWV++EFiHsFgn0FfYEFeogFeY0FfJQFgZkFh5sFgffjBfud96cFgpkFiJsFj5sFlpkFmpMFnI4FnIcFmYEF94n7kQX3k/eQBZqVBZyPBZyIBZqCBZV+BY96BYh7BYJ9BQ75SPci5RX4KosFnYgFmYIFlX0FjnsFiHsFgX0FfYIFeYgF/IKLBYWMBYaLBYiMBYeMBYeOBYaNBYmNBYiNBYiPBYePBYqOBYmOBYqQBYmPBYuPBYuOBYyQBYuQBYyOBYyOBY6PBY2QBfhP+M4F/CqLBXmOBX2UBYGZBYibBY6bBZWZBZmUBZ2PBfiCiwWRigWQigWOigWPigWPiQWQiAWNiQWOiQWOhwWPhwWMiAWNiAWMhwWNhgWLiAWLhwWKhgWLhgWKiAWKiAWIhwWJhgUO+Uj3h3QV9zaLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqHBftjiwV5jwV9lAWBmQWImwWL+Z8FjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BYd7BYF9BX2CBXqIBfs2iwUO+Ujw+VgV+HH9YwWRfAWKegWEfAV+gAV7hQV5jAV7kQV/lwX8cfljBYWaBYycBZKaBZiWBZuRBZ2KBZuFBQ75SPhWShWHewWBfQV9ggV6hwX7Y4sFeY8FfZQFgZkFiJsFjpsFlZkFmZQFnY4F9zaLBYv5SwX7NosFeY4FfZQFgZkFiJsFjpsFlZkFmZQFnY4F92OLBZyIBZmCBZV9BY97BQ75SPeo+WQVko8FjIsFjIwFkowFk40FjIoFjIwFk4kFkooFjIoFjIsFkocFkYcF9577ggWVfgWPewWIegWBfQV9ggV6hwV6jgV8lAX7f/dmBft/+2YFfIIFeogFeo8FfZQFgZkFiJwFj5sFlZgF9573ggUO+UiL+wEV+O6LBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBfzuiwV6jgV8lAWBmQWImwWOmwWVmQWalAUO+Uj4POoVxcIFi/eQBVLBBVCnBS+LBVBvBUxQBWsvBYtQBaswBcpPBcdvBeaLBfcIZhWHiAWFhwVAZwWKigWJigWEigWFiQWJjAWJigX7BYsFiYwFiYoFhI0FhYwFiYwFiYwFQK8FhY8FhY8FP9MFiowFiowFiJEFh5EFiowFiowFZvYFipIFipIFi9IFjJIFjJEFsPcABYyNBYyMBY+RBY6RBYyMBYyMBdfTBZGPBZGPBdeuBYyMBY2MBZKMBZKNBYyKBY2MBfcFiwWMigWNjAWSiQWSigWMigWNigXWaAWQhwWQiAWLjwWPnAWUmAWalQWcjgWciAWagQWVfgWOegWL/IoFiHsFgX4FfIEFeogFeo4FfJUFgpgFh5sFDvlI9xOvFYaOBYuKBYd6BYF+BX2CBXqHBXmPBX2UBYGYBYicBYv5OAWOmwWVmQWZlAWdjgWciAWZggWVfQWPewWL+3YFkI4FkY8F1asFjIsFjIsFko0Fk40FjIoFjIwF9wSLBYyLBYuLBZOJBZOJBYyLBYuLBddrBZCHBZKIBdZKBYyKBY2KBY6FBY+GBYyJBYyKBbApBYyEBYyEBYtLBYqEBYqDBWYrBYqKBYqJBYeGBYiFBYmKBYqJBUBLBYWIBYWHBUBqBYqLBYqLBYSJBYOJBYqLBYqLBfsEiwWKjAWKigWDjQWEjQWKiwWKiwVBrAWA9w0VwlwFxnEF54sFx6UFycAFqdoFi70FbdsFTcAFT6QFL4sFUHIFVFwFDvlI+DLqFczNBZqVBZyPBZyIBZqDBZV9BY97BYl7BYF9BUVDBYWHBYWHBUZmBYiLBYmJBYWKBYWJBYiMBYmKBSGLBYmMBYiKBYWNBYWMBYmNBYmLBUSwBYWPBYWPBUXTBYqMBYqMBYeRBYeRBYuMBYqMBWn2BYqRBYqSBYvSBYyRBYySBa33AAWMjAWLjAWPkQWPkQWMjAWMjAXR0wWRjwWRjwXSrwWNiwWNjQWRjAWSjQWNigWNjAX1iwWNigWNjAWSiQWRigWNiQWNiwXRZwWRhwWRhwXRQwWVfQWNewWHewWBfQV8gwV6iAV6jwV8lQVKzQVWpgU3iwVVcAVRUAVtLgWLUAWoLwXGUAXCbwXdiwUO+Uj4PfUVwroFi/dxBVS6BVCkBS+LBU9yBU1WBW07BYtZBak8BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKiwWEiQWDiQWKjAWKigX7BIsFiosFiosFhI0Fg40FiosFiosFQKwFhY8Fho4FP8sFio0FiYwFiJEFh5AFio0FiowFZusFipMFipIFi8sFjJIFjJIFsO0FjIwFjI0Fj5AFjpEFjYwFjIwF18wFkY4FkI8F16sFi4sFjIsFk40Fk40Fi4sFjIsF9wSLBYyKBYyMBZOJBZKJBYyLBYyLBdVrBZGHBZCIBYv3dgWPmwWVmQWZlAWcjgWdiAWZggWVfQWOewWL/TgFiHoFgX4FfYIFeYcFeo8FfZQFgZgFh5wFDvlI9x74IBV8YQX4GIsFg5QFZs0FbaYFS6cFJosFSm8F93r7/BXXzgWZlAWdjgWchwWZggWVfQWNegWIewWAfgU6QwWGiAWFhwU8ZgWJiwWKigWEigWEiQWJiwWKiwX7DYsFiosFiosFg40FhIwFiowFiosFOrAFhY8FhY4FO9MFiYwFiowFh5EFh5AFi40Fio0FY/YFipIFipIFi9IFjJIFjJIFs/cABYyNBYuNBY+QBY+QBYyNBY2MBdvTBZKOBZCPBdyvBYyLBYyMBZOMBZKNBYyLBYyLBfcNiwWMiwWMiwWTiQWSigWMigWMiwXbZwWQhwWRiAW1ZwWPhQWQhQWyRAWQewWJegWDfQV/ggWUhQWVfgWOegWIewWBfQV9ggV5iAX8SYsFi3UFrDAFz08FzG4F8IsFDvlI97n4VhWL/CQFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/gkBfsGiwV6jgV8lQWCmAWHmwWPnAWUmAWalQWcjgX3BosFi8AFi40Fi40FjZEFjJEFjY0Fi4wFwOoFkZEFkJEFi4sFi4wFk44Fko8F9asFkowFkowF9YsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFKIsFOXIFZEUFi2EF9zuLBZyIBZqBBZV+BY56BYh7BYF+BXyBBXqIBQ75SPg99yMVwroFi/dxBVS7BVCkBS+LBU9yBU1WBW06BYtaBak7BclWBcdxBeeLBfcGYhWGiAWFhwVBagWKiwWKigWEigWDiQWKiwWKiwX7BIsFiosFiosFg40FhIwFiowFiosFQKwFhY8FhY4FQMwFiowFiYwFiJEFh5AFio0FiowFZuwFipIFipIFi8wFjJIFjJIFsOwFjI0FjI0Fj5AFjpAFjY0FjIwF1swFko4FkI8F16sFi4sFjIwFk4wFk40Fi4sFjIsF9wSLBYyLBYyLBZOJBZKKBYyKBYyLBdVrBZGHBZCIBYuLBY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYv8mAWKhAWKhAVmKgWKigWKiQWHhgWIhQWJigWKiQVlawWFhwWFhwVBbAWKigWKiwWEiQWDigWKiwWKiwX7BIsFiosFi4sFg4wFg40FiosFi4sFP6sFho8FhI8FQMsFio0FiYwFiJAFh5AFio0Fio0FZuwFiZwFj5sFlZgFm5QFnI0FnIcFmYEFlH0FrDQFyVYFx3EF54sFxqUFpKAFqdoFDvlI+L34CRWNhAWL+9AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/fIBW7TBVqfBSyLBU1yBS49BYv7vQWIewWBfQV8ggV6iAV6jgV8lAWBmQWImwWL+SwFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/uSBbKsBZGOBZGPBdeqBYyLBYuMBZOMBZONBYyLBYuLBfcGiwWMiwWLiwWTiQWTigWMigWLiwXXbAWLiwWLiwWShgWShwWLigWMiwWPhAWQhQWLigWLiwWxLAUO+Uj3mfmIFduLBZyIBZqCBZV9BY57BYh7BYF9BXyCBXqIBTuLBXqOBXyUBYGZBYibBY6bBZWZBZqUBfH7mRWL/E4FiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/hOBY6cBZWYBZqVBZyOBZyIBZqBBZV+BQ75SPgV+YgVyYsFnIgFmoIFlX0FjnsFiHsFgX0FfIIFeogFTYsFeo4FfJQFgpkFh5sFj5sFlJkFmpQF+wn+MhWGigWIjQWHiwUpqQV8kwWAmAWGmwWNmwWUmQWZlgWbjwWdiQXhcQXpoQWhyQWL+I4Fj5sFlJkFmpQFnI8FnIcFmoIFlX0FjnsFi/yVBYqEBYqFBWswBYiGBYmHBYmIBYmIBYeIBYeIBYiJBYiJBYaKBYaJBfsXbQWIiwWHigUO+Uj3f/eMFfsRLwWLIQWIewWBfQV8ggV6iAV6jgV8lAWCmQWHmwWL+SwFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/xXBff495sFm5IFnIwFnIYFmIEFk3wFjHoFhnwFgH4F+2v7MgX3mPtwBZV+BZB7BYh7BYJ9BX2BBXqHBXqNBXyTBQ75SPfu+WMVi/0xBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv5MQWOmwWVmQWalAWcjwWchwWaggWVfQUO+Uj43/iYFZCGBYuKBYyJBYyFBY2EBYuKBYyJBYv8WwWHewWBfQV9ggV6iAV5jgV9lAWBmQWImwWL+EgFfJYFXIsFdHgFVDEFi/vmBYh7BYF9BX2CBXmIBXqOBX2UBYGZBYebBYv36gVo4wV1nAVdiwVzeAVVMQWL++YFh3sFgX0FfYIFeogFeY4FfZQFgZkFiJsFi/h9BY6cBZWYBZmVBZ2OBZyIBZmBBZV+BY2ABa2mBZGOBZGPBY2LBYyMBZKLBZKNBduLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyJBY2KBY+GBY+GBYuJBY2JBZN1BZynBZCQBZCRBbWtBZGPBZGPBY2LBYyMBZKLBZKNBdyLBZKJBZKLBYyKBY2LBZGHBZGIBbZoBYyKBYyKBQ75SPi++B0VjIUFi/vyBYh7BYF9BXyCBXqIBXqOBXyUBYGZBYibBYv36wVt3QVaoQUtiwVPcAUsMwWL++AFiHsFgX0FfIIFeogFeo4FfJQFgZkFiJsFi/h9BY6cBZWYBZqVBZyOBZyIBZqBBZV+BY56BYtlBbCtBZKPBZCPBdiuBYyLBYyMBZKMBZONBYyLBYyLBfcGiwWMiwWNiwWSiQWSigWMigWNiwXWaAWMiwWLiwWShgWRhgWMiwWLiwWPhAWPhAWLiwWLiwWyIQUO+Uj37Ph4FTWLBVRwBU9PBWwvBYtQBaowBcdPBcNvBeCLBcKnBcfHBarmBYvGBWznBU/HBWH3AxWNjAWRiQWSigWNiQWNiwXTaAWRhgWRhwXTQwWLigWMiwWPhAWPhQWLigWMigWv+wAFjIUFjIQFi0QFioQFioUFZyAFiooFi4oFh4QFh4UFiosFi4oFQ0MFhYcFhYcFQ2YFiYsFiYkFhYoFhIkFiYwFiYoF+wCLBYmMBYmKBYSNBYWMBYmNBYmLBUOwBYWPBYWPBUPTBYuMBYqLBYeRBYeSBYuMBYqMBWf2BYqRBYqSBYvSBYySBYyRBa/3AAWMjAWLjAWPkQWPkgWMiwWLjAXT0wWSjwWQkAXTrgWNiwWNjQWSjAWRjQWNigWNjAX3AIsFDvlI9xTXFYWPBYv7dQWHewWCfQV8ggV6iAV6jgV8lAWBmQWImwWL+TMFjpwFlZgFmpUFnI4FnIgFmoEFlH4Fj3oFi4sFkY8FkI4F1asFjIsFjIwFk4wFko0FjIsFjIsF9wSLBYyLBYuLBZOJBZOKBYyKBYuLBdZsBZGHBZGHBdZLBY2KBYyJBY+GBY+GBYuJBY2JBa8rBY2EBYyDBYtLBYqEBYmEBWYsBYqJBYuJBYeGBYeFBYqKBYmKBUBLBYWHBYaIBUBqBYqLBYqKBYOKBYSJBYqLBYqLBfsEiwWKiwWKiwWDjQWEjAWKjAWKiwVBrAWA9w0VwlwFxnEF54sFx6UFyb8FqdoFi7wFbdsFTb8FT6QFL4sFUHIFVFwFDvlI+D33JRXCugWL924FVLoFUKQFL4sFT3IFTVcFbTsFi1oFqTwFyVcFx3EF54sF9wZiFYaIBYWHBUFqBYqLBYqLBYSJBYOJBYqMBYqKBfsEiwWKjAWKigWEjQWDjQWKiwWKiwVArAWGjgWFjwVAywWJjAWKjQWHkAWHkAWLjQWKjQVm6gWJkgWKkwWLywWMkgWNkgWw6wWMjQWLjQWPkAWPkQWMjAWNjAXWywWRjwWRjwXWqgWLiwWMjAWTjAWTjQWLiwWMiwX3BIsFjIsFjIsFkokFk4oFjIoFjIsF1WwFkIcFkYgFi4sFj5sFlJkFmpQFnI4FnIgFmoIFlX0FjnsFi/00BYh7BYF9BXyCBXqIBXqOBXyUBYKZBYebBQ75SPfp+MsVk40F9yaLBZyIBZmBBZV+BY96BYd7BYF+BX2BBXqIBfsdiwU4bgU5TwViNAWL+6MFiHsFgX0FfYIFeYgFeo4FfZQFgZkFh5sFi/h9BY+cBZWYBZmVBZyOBZ2IBZmBBZV+BY56BYtWBdTABZGNBZGPBeutBQ75SO6nFYSQBYuLBYuMBYeSBYeSBXLSBYmcBY+bBZaYBZuTBZyNBZyGBZmBBZN9BZ9TBbt0BfWLBeSsBbuhBYuoBVHCBfsBygX7BIsFiYsFiosFhI0FhIwFiowFiYwFQK8FhY8Fho8FiowFiYwFiJEFh5EFi4wFio0FipEFipIFi9IFjJMFjZMFi4sFi4wFkJEFj5IF1tMFjIsFjIwFkY8Fko8FjIsFi4wF764Fk4wFk40F9xGLBYyKBY2MBZKJBZKKBYyKBY2KBdZoBZmBBZN8BY17BYd7BYB+BXyDBXmJBXqPBUqqBSGLBTluBVRWBYtuBbN4BfcGiwWOigWPiwWQiQWQigWOigWPiQX3EEQFj4cFkIgF1kQFj4QFkIQFi4sFi4sFjYMFjIMFi0MFioUFioQFiooFi4kFh4UFiIYFiYoFiokFhYgFhoYFQGgFiYsFiYkFJ2cFg4oFg4kF+xGLBYmMBYmKBYWNBYSMBYmMBYqMBUCvBQ75SPdd+DEV+wyLBXqOBXyUBYGZBYibBY6bBZWZBZqUBZyOBfcMiwWL9zcFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/s3BfdDiwWciAWaggWVfQWOewWIewWBfQV8ggV6iAX7Q4sFi/uCBbNMBeF0BfOLBZyHBZqCBZV9BY57BYh7BYF9BXyCBXqIBfsCiwWFjAWFjAX7AqgFg48FhI4Fi4sFiowFhpEFhZAFVOIFio4FiY4FipAFiZAFjI4Fio4FDvlI+GX3SRWL9+AFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/x9BYh6BYF+BXyBBXqIBXqOBXyVBYGYBYicBYuyBWZpBYWHBYWHBT9oBYmKBYqKBYSKBYSJBYmMBYqKBfsGiwWJjAWKigWEjQWEjAWJjAWKjAU/rgWEkAWEkAWLiwWLiwWHkgWHkgVk9AWKkgWKkQWL9/IFjpsFlZkFmpQFnI4FnIgFmoIFlX0FjnsFi/vrBak6Bb10BeeLBcinBQ75SPfB9xcV92j4JgWWmAWakwWcjQWchwWZgQWUfQWNegWHewX7kfxyBYiHBYiGBYiJBYqJBYaIBYaIBYiKBYiKBYaKBYWKBYiLBYiLBYWMBYaMBYiMBYiMBYaOBYaOBYqNBYiNBYiQBYiPBfuQ+HIFhpsFjZwFlJkFmZUFnI8FnIkFmoMFln4FDvlI+Fj3TRX29+kFk5oFmZUFm5AFnYoFmoMFl34FkHsFiXsF+yr8cgWIhwWKhwWIiAWKhwWHiQWIhwWHiQWIiQWGiQWHiQWHiwWHigWHiwWGiwWHjAWHiwWHjQWGjQWIjQWHjQWIjwWIjQWJjwWIjgWKjwWIjwUg9+kFIPvpBYiHBYqHBYiIBYmHBYiJBYiHBYeJBYiJBYaJBYeJBYeLBYeKBYeLBYaLBYeMBYeLBYeNBYaNBYiNBYeNBYiPBYiNBYmPBYiOBYqPBYiPBfsq+HIFiZsFkJsFl5gFmpMFnYwFm4YFmYEFk3wF9wD76QX29+kFjY8FjI8Fjo4FjY8Fj44Fjo4Fjo0Fj40Fj40Fj40Fj4sFj4wFkIsFkIsFj4oFj4sFj4kFkIkFjokFjokFjogFj4gFjYcFjogFjIcFjYcFDvlI+AL3pxX3evtlBZV+BY97BYh7BYF9BX2BBXqIBXmOBX2UBft992YF+337ZgV9ggV5iAV6jgV9lQWBmQWImwWPmwWVmAX3evdlBft692UFgZgFh5sFjpwFlZgFmZUFnI4FnYgFmYMF9337ZwX3ffdnBZmTBZ2OBZyIBZmBBZV+BY56BYd7BYF+BQ75SOj7TxWDigWLiwWLiwVjiwV6jgV8lAWBmQWImwWOmwWVmQWalAWcjgWqiwXLpQXOwQXJ7gX7dfg4BYebBY2bBZSaBZiVBZyPBZ2JBZqDBZZ+BfdX/AEF91n4AQWWmAWakwWdjQWbhwWZgQWUfAWNewWGewX7gfxMBYuKBYqJBT37EQWGhQWGhgU9TAWEiAWGhwU8bAWLiwWLiwUO+Uj3UtkV98+LBZ2IBZmCBZV9BY57BYh7BYF9BX2CBXmIBfwsiwWEjAWFiwWJjQWIiwWGjgWGjgWJjQWJjAWHkAWHkAWKjQWKjQWKkQWJkAWLjgWLjQWMkQWLkQWNjQWLjQWPkAWOkQX38vguBfvPiwV5jgV9lAWBmQWImwWOmwWVmQWZlAWdjgX4LIsFkooFkYsFjYoFjooFkIgFkYgFjIkFjYoFj4YFj4YFjIkFjIkFjIUFjYYFi4gFi4kFioUFi4UFiYkFi4kFh4YFiIYFDgAAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAAK0AAACtAAAArQAAA==";var o1=te(ee(),1);var uD=te(ee(),1);var a1=te(Y0(),1);var vU=te(ee(),1);var kU=te(ee(),1);var RU=te(ee(),1);var GU=te(ee(),1);function ae(t,e){return Array.isArray(e)?[t.a*e[0]+t.c*e[1]+t.e,t.b*e[0]+t.d*e[1]+t.f]:{x:t.a*e.x+t.c*e.y+t.e,y:t.b*e.x+t.d*e.y+t.f}}function L0(t){return typeof t>"u"}function E0(t,e=0){return{a:1,c:0,e:t,b:0,d:1,f:e}}function Ea(...t){t=Array.isArray(t[0])?t[0]:t;let e=(r,i)=>({a:r.a*i.a+r.c*i.b,c:r.a*i.c+r.c*i.d,e:r.a*i.e+r.c*i.f+r.e,b:r.b*i.a+r.d*i.b,d:r.b*i.c+r.d*i.d,f:r.b*i.e+r.d*i.f+r.f});switch(t.length){case 0:throw Error("no matrices provided");case 1:return t[0];case 2:return e(t[0],t[1]);default:{let[r,i,...n]=t,a=e(r,i);return Ea(a,...n)}}}var{cos:g4,sin:x4,PI:oV}=Math;function b4(t,e,r){let i=g4(t),n=x4(t),a={a:i,c:-n,e:0,b:n,d:i,f:0};return L0(e)||L0(r)?a:Ea([E0(e,r),a,E0(-e,-r)])}var{tan:aV}=Math;function v4(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}function Ta(t,e,r,i){var n=Error.call(this,t);return Object.setPrototypeOf&&Object.setPrototypeOf(n,Ta.prototype),n.expected=e,n.found=r,n.location=i,n.name="SyntaxError",n}v4(Ta,Error);function zc(t,e,r){return r=r||" ",t.length>e?t:(e-=t.length,r+=r.repeat(e),t+r.slice(0,e))}Ta.prototype.format=function(t){var e="Error: "+this.message;if(this.location){var r=null,i;for(i=0;i<t.length;i++)if(t[i].source===this.location.source){r=t[i].text.split(/\r\n|\n|\r/g);break}var n=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(n):n,o=this.location.source+":"+a.line+":"+a.column;if(r){var c=this.location.end,l=zc("",a.line.toString().length," "),s=r[n.line-1],p=n.line===c.line?c.column:s.length+1,d=p-n.column||1;e+=`
--> `+o+`
`+l+` |
`+a.line+" | "+s+`
`+l+" | "+zc("",n.column-1," ")+zc("",d,"^")}else e+=`
at `+o}return e};Ta.buildMessage=function(t,e){var r={literal:function(s){return'"'+n(s.text)+'"'},class:function(s){var p=s.parts.map(function(d){return Array.isArray(d)?a(d[0])+"-"+a(d[1]):a(d)});return"["+(s.inverted?"^":"")+p.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(s){return s.description}};function i(s){return s.charCodeAt(0).toString(16).toUpperCase()}function n(s){return s.replace(/\\/g,"\\\\").replace(/"/g,"\\\"").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+i(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+i(p)})}function a(s){return s.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(p){return"\\x0"+i(p)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(p){return"\\x"+i(p)})}function o(s){return r[s.type](s)}function c(s){var p=s.map(o),d,m;if(p.sort(),p.length>0){for(d=1,m=1;d<p.length;d++)p[d-1]!==p[d]&&(p[m]=p[d],m++);p.length=m}switch(p.length){case 1:return p[0];case 2:return p[0]+" or "+p[1];default:return p.slice(0,-1).join(", ")+", or "+p[p.length-1]}}function l(s){return s?'"'+n(s)+'"':"end of input"}return"Expected "+c(t)+" but "+l(e)+" found."};function ke(t){if(t.length===0)return{minX:0,maxX:0,minY:0,maxY:0};let e=1/0,r=-1/0,i=1/0,n=-1/0,a=(o)=>{e=Math.min(e,o.x),r=Math.max(r,o.x),i=Math.min(i,o.y),n=Math.max(n,o.y)};return t.forEach((o)=>{switch(o.type){case"path":o.points.forEach(a);break;case"text":a({x:o.x,y:o.y});break;case"circle":{let{x:c,y:l,radius:s}=o;a({x:c-s,y:l-s}),a({x:c+s,y:l+s});break}case"box":{let{x:c,y:l,width:s,height:p}=o,d=s/2,m=p/2;a({x:c-d,y:l-m}),a({x:c+d,y:l+m});break}}}),{minX:e,maxX:r,minY:i,maxY:n}}var S4=(t,e="right")=>{switch(e){case"down":switch(t){case"middle_top":return"middle_right";case"middle_bottom":return"middle_left";case"middle_left":return"middle_bottom";case"middle_right":return"middle_top"}break;case"up":switch(t){case"middle_top":return"middle_left";case"middle_bottom":return"middle_right";case"middle_left":return"middle_top";case"middle_right":return"middle_bottom"}break;case"left":switch(t){case"middle_top":return"middle_bottom";case"middle_bottom":return"middle_top";case"middle_left":return"middle_right";case"middle_right":return"middle_left"}break;case"right":return t}return t},ei=(t,e)=>{let{primitives:r,center:i,ports:n,size:a}=t,o=Ea({a:1,b:0,c:0,d:-1,e:0,f:2*i.y}),c=r.map((s)=>{switch(s={...s},s.type){case"path":return{...s,points:s.points.map((u)=>ae(o,u))};case"text":let p=ae(o,{x:s.x,y:s.y}),d={top_left:"bottom_left",top_right:"bottom_right",bottom_left:"top_left",bottom_right:"top_right",center:"center",middle_top:"middle_bottom",middle_bottom:"middle_top",middle_left:"middle_left",middle_right:"middle_right"};return{...s,x:p.x,y:p.y,anchor:d[s.anchor]};case"circle":case"box":let m=ae(o,{x:s.x,y:s.y});return{...s,x:m.x,y:m.y}}}),l=n.map((s)=>({...s,...ae(o,s)}));return{primitives:c,center:i,ports:l,size:a,...e}},ri=(t,e)=>{let{primitives:r,center:i,ports:n,size:a}=t,o=Ea({a:-1,b:0,c:0,d:1,e:0,f:2*i.x}),c=r.map((s)=>{switch(s={...s},s.type){case"path":return{...s,points:s.points.map((u)=>ae(o,u))};case"text":let p=ae(o,{x:s.x,y:s.y}),d={top_left:"top_right",top_right:"top_left",bottom_left:"bottom_right",bottom_right:"bottom_left",center:"center",middle_top:"middle_top",middle_bottom:"middle_bottom",middle_left:"middle_right",middle_right:"middle_left"};return{...s,x:p.x,y:p.y,anchor:d[s.anchor]};case"circle":case"box":let m=ae(o,{x:s.x,y:s.y});return{...s,x:m.x,y:m.y}}}),l=n.map((s)=>({...s,...ae(o,s)}));return{primitives:c,center:i,ports:l,size:a,...e}},tn=(t,e)=>{let{newOrientation:r,overrides:i}=e,n={up:Math.PI/2,right:0,down:-Math.PI/2,left:-Math.PI},a=b4(r?n[r]:Math.PI/2,t.center.x,t.center.y),{primitives:o,center:c,size:l,ports:s}=t,p=o.map((u)=>{switch(u={...u},u.type){case"path":return{...u,points:u.points.map((x)=>ae(a,x))};case"text":let y=ae(a,{x:u.x,y:u.y});return u.anchor=S4(u.anchor,r??"right"),{...u,x:y.x,y:y.y};case"circle":let f=ae(a,{x:u.x,y:u.y});return{...u,x:f.x,y:f.y};case"box":let _=ae(a,{x:u.x,y:u.y});return{...u,x:_.x,y:_.y,width:u.height,height:u.width}}}),d=s.map((u)=>({...u,...ae(a,u)})),m=ke(p);return{primitives:p,center:c,ports:d,size:{width:m.maxX-m.minX,height:m.maxY-m.minY},...i}},z=(t,e="down",r={})=>tn(t,{newOrientation:e,overrides:r}),w4=class{symbol;constructor(t){this.symbol=JSON.parse(JSON.stringify(t)),this.symbol.size=this.computeSize()}changeTextAnchor(t,e,r){return this.symbol={...this.symbol,primitives:this.symbol.primitives.map((i)=>i.type==="text"&&i.text===t?{...i,anchor:e,...r?{x:i.x+r.x,y:i.y+r.y}:{}}:i)},this}labelPort(t,e){return this.symbol={...this.symbol,ports:this.symbol.ports.map((r)=>r.labels.includes(t)?{...r,labels:e}:r)},this}rotateRightFacingSymbol(t){return this.symbol=tn(this.symbol,{newOrientation:t}),this}computeSize(){let t=ke(this.symbol.primitives);return{width:t.maxX-t.minX,height:t.maxY-t.minY}}build(){return{...this.symbol,size:this.computeSize()}}},F=(t)=>{let e=t.primitives??[...Object.values(t.paths??{}),...Object.values(t.texts??{}),...Object.values(t.circles??{}),...Object.values(t.rects??{})],r=t.ports??Object.entries(t.refblocks).flatMap(([n,a])=>[{...a,labels:[n]}]),i=t.center??{x:t.bounds.centerX,y:t.bounds.centerY};return r.length===2&&(i={x:(r[0].x+r[1].x)/2,y:(r[0].y+r[1].y)/2}),new w4({...t,primitives:e,ports:r,center:i})},ii={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path17:{type:"path",points:[{x:0,y:-0.13},{x:0.07,y:-0.11}],color:"primary",fill:!1},path18:{type:"path",points:[{x:0.07,y:-0.11},{x:0.14,y:-0.13}],color:"primary",fill:!1},path19:{type:"path",points:[{x:-0.15,y:-0.13},{x:-0.07,y:-0.11}],color:"primary",fill:!1},path20:{type:"path",points:[{x:-0.07,y:-0.11},{x:0,y:-0.13}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:A4,texts:sV,bounds:Hn,refblocks:T0,circles:B4}=ii,F4=F({primitives:[...Object.values(A4),...Object.values(B4),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...T0.left1,labels:["1"]},{...T0.right1,labels:["2"]}],size:{width:Hn.width,height:Hn.height},center:{x:Hn.centerX,y:Hn.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:P4,texts:cV,bounds:Qn,refblocks:N0,circles:I4}=ii,M4=F({primitives:[...Object.values(P4),...Object.values(I4),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...N0.left1,labels:["1"]},{...N0.right1,labels:["2"]}],size:{width:Qn.width,height:Qn.height},center:{x:Qn.centerX,y:Qn.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:k4,texts:lV,bounds:Zn,refblocks:W0,circles:C4}=ii,Y4=F({primitives:[...Object.values(k4),...Object.values(C4),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...W0.left1,labels:["1"]},{...W0.right1,labels:["2"]}],size:{width:Zn.width,height:Zn.height},center:{x:Zn.centerX,y:Zn.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:L4,texts:pV,bounds:Kn,refblocks:R0,circles:E4}=ii,T4=F({primitives:[...Object.values(L4),...Object.values(E4),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...R0.left1,labels:["1"]},{...R0.right1,labels:["2"]}],size:{width:Kn.width,height:Kn.height},center:{x:Kn.centerX,y:Kn.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:N4,texts:hV,bounds:Jn,refblocks:O0,circles:W4}=ii,R4=F({primitives:[...Object.values(N4),...Object.values(W4),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...O0.left1,labels:["1"]},{...O0.right1,labels:["2"]}],size:{width:Jn.width,height:Jn.height},center:{x:Jn.centerX,y:Jn.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:O4,texts:dV,bounds:qn,refblocks:j0,circles:j4}=ii,$4=F({primitives:[...Object.values(O4),...Object.values(j4),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...j0.left1,labels:["1"]},{...j0.right1,labels:["2"]}],size:{width:qn.width,height:qn.height},center:{x:qn.centerX,y:qn.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ni={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.2}],color:"primary",fill:!1},"path43-8-3":{type:"path",points:[{x:0.21,y:-0.11},{x:0.15,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:X4,texts:mV,bounds:to,refblocks:$0,circles:V4}=ni,z4=F({primitives:[...Object.values(X4),...Object.values(V4),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...$0.left1,labels:["1"]},{...$0.right1,labels:["2"]}],size:{width:to.width,height:to.height},center:{x:to.centerX,y:to.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),D4=F(ni).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:U4,texts:uV,bounds:eo,refblocks:X0,circles:G4}=ni,H4=F({primitives:[...Object.values(U4),...Object.values(G4),{type:"text",text:"{REF}",x:-0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.3294553499999995}],ports:[{...X0.left1,labels:["1"]},{...X0.right1,labels:["2"]}],size:{width:eo.width,height:eo.height},center:{x:eo.centerX,y:eo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Q4=F(ni).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:Z4,texts:yV,bounds:ro,refblocks:V0,circles:K4}=ni,J4=F({primitives:[...Object.values(Z4),...Object.values(K4),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...V0.left1,labels:["1"]},{...V0.right1,labels:["2"]}],size:{width:ro.width,height:ro.height},center:{x:ro.centerX,y:ro.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:q4,texts:fV,bounds:io,refblocks:z0,circles:t5}=ni,e5=F({primitives:[...Object.values(q4),...Object.values(t5),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...z0.left1,labels:["1"]},{...z0.right1,labels:["2"]}],size:{width:io.width,height:io.height},center:{x:io.centerX,y:io.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Na={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.14,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.18,y:0.18},{x:0.11,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.18,y:-0.09},{x:0.11,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:r5,texts:_V,bounds:no,refblocks:D0,circles:i5}=Na,n5=F({primitives:[...Object.values(r5),...Object.values(i5),{type:"text",text:"{REF}",x:-0.16,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0.16,y:0.2294553499999995}],ports:[{...D0.left1,labels:["1"]},{...D0.right1,labels:["2"]}],size:{width:no.width,height:no.height},center:{x:no.centerX,y:no.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:o5,texts:gV,bounds:oo,refblocks:U0,circles:a5}=Na,lx=F({primitives:[...Object.values(o5),...Object.values(a5),{type:"text",text:"{REF}",x:-0.0001118,y:-0.18},{type:"text",text:"{VAL}",x:0.0001118,y:0.2738453}],ports:[{...U0.left1,labels:["1"]},{...U0.right1,labels:["2"]}],size:{width:oo.width,height:oo.height},center:{x:oo.centerX,y:oo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["2"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:s5,texts:xV,bounds:ao,refblocks:G0,circles:c5}=Na,l5=F({primitives:[...Object.values(s5),...Object.values(c5),{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384529999999985,anchor:"middle_left"},{type:"text",text:"{VAL}",x:-0.00011179999999999524,y:-0.27384530000000007,anchor:"middle_left"}],ports:[{...G0.left1,labels:["1"]},{...G0.right1,labels:["2"]}],size:{width:ao.width,height:ao.height},center:{x:ao.centerX,y:ao.centerY}}).changeTextAnchor("{VAL}","middle_top").labelPort("right1",["2"]).labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:bV,texts:vV,bounds:SV,refblocks:wV,circles:AV}=Na,vl=z(lx,"down"),Sl=vl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),wl=vl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Sl.anchor="middle_left";wl.anchor="middle_left";Sl.x=0.25;Sl.y+=0.21;wl.y-=0.21;wl.x=0.25;var p5=vl,en={paths:{path43:{type:"path",points:[{x:-0.06,y:0.19},{x:-0.06,y:-0.12}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.02,y:0.13},{x:0.02,y:-0.06}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.06,y:0.03},{x:-0.5,y:0.03}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5,y:0.03},{x:0.03,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.28}},refblocks:{left1:{x:-0.5,y:0.03},right1:{x:0.5,y:0.03}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.27,width:1,height:0.29,centerX:0,centerY:0.06},circles:{}},{paths:h5,bounds:H0,refblocks:Q0,circles:d5}=en,m5=F({primitives:[...Object.values(h5),...Object.values(d5),{type:"text",text:"{REF}",x:-0.2,y:0.31},{type:"text",text:"{VAL}",x:0.2,y:0.31}],ports:[{...Q0.left1,labels:["1"]},{...Q0.right1,labels:["2"]}],center:{x:H0.centerX,y:H0.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").build(),u5={...m5,size:{width:1,height:0.9}};function It(t){let e=t.size;if(!e){let r=ke(t.primitives);e={width:r.maxX-r.minX,height:r.maxY-r.minY}}return{...t,size:e}}var{paths:y5,texts:Z0,bounds:so,refblocks:K0,circles:f5}=en,px=It({primitives:[...Object.values(y5),...Object.values(f5),{...Z0.top1,anchor:"middle_bottom"},{...Z0.bottom1,anchor:"middle_top"}],ports:[{...K0.left1,labels:["1"]},{...K0.right1,labels:["2"]}],size:{width:so.width,height:so.height},center:{x:so.centerX,y:so.centerY}}),{paths:_5,bounds:J0,refblocks:q0,circles:g5}=en,x5=F({primitives:[...Object.values(_5),...Object.values(g5),{type:"text",text:"{REF}",x:0,y:-0.22},{type:"text",text:"{VAL}",x:0,y:0.28}],ports:[{...q0.left1,labels:["1"]},{...q0.right1,labels:["2"]}],center:{x:J0.centerX,y:J0.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").build(),b5={...x5,size:{width:1,height:0.65}},{paths:v5,bounds:t_,refblocks:e_,circles:S5}=en,w5=F({primitives:[...Object.values(v5),...Object.values(S5),{type:"text",text:"{REF}",x:0,y:0.28},{type:"text",text:"{VAL}",x:0,y:-0.22}],ports:[{...e_.left1,labels:["1"]},{...e_.right1,labels:["2"]}],center:{x:t_.centerX,y:t_.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_bottom").build(),A5={...w5,size:{width:1,height:0.65}},{paths:B5,bounds:r_,refblocks:i_,circles:F5}=en,P5=F({primitives:[...Object.values(B5),...Object.values(F5),{type:"text",text:"{REF}",x:0.2,y:-0.25},{type:"text",text:"{VAL}",x:-0.2,y:-0.25}],ports:[{...i_.left1,labels:["1"]},{...i_.right1,labels:["2"]}],center:{x:r_.centerX,y:r_.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").build(),I5={...P5,size:{width:1,height:0.9}},M5=tn(px,{newOrientation:"up"}),Wa={paths:{path1:{type:"path",points:[{x:-0.3,y:0},{x:-0.19998,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path2:{type:"path",points:[{x:0.19998,y:0},{x:0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path3:{type:"path",points:[{x:-0.19998,y:0.07998},{x:0.19998,y:0.07998},{x:0.19998,y:-0.07998},{x:-0.19998,y:-0.07998},{x:-0.19998,y:0.07998}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.3,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.45,anchor:"middle_bottom"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.45,maxY:0.3,width:0.6,height:0.75,centerX:0,centerY:0},circles:{}},{paths:k5,texts:BV,bounds:n_,refblocks:o_,circles:C5}=Wa,Y5=F({primitives:[...Object.values(k5),...Object.values(C5),{type:"text",text:"{REF}",x:-0.16,y:0.16},{type:"text",text:"{VAL}",x:0.16,y:0.16}],ports:[{...o_.left1,labels:["1"]},{...o_.right1,labels:["2"]}],center:{x:n_.centerX,y:n_.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),L5={...Y5,size:{width:0.9,height:0.6}},{paths:E5,texts:FV,bounds:a_,refblocks:s_,circles:T5}=Wa,N5=F({primitives:[...Object.values(E5),...Object.values(T5),{type:"text",text:"{REF}",x:0,y:-0.16},{type:"text",text:"{VAL}",x:0,y:0.16}],ports:[{...s_.left1,labels:["1"]},{...s_.right1,labels:["2"]}],center:{x:a_.centerX,y:a_.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),W5={...N5,size:{width:0.6,height:0.65}},{paths:R5,texts:PV,bounds:c_,refblocks:l_,circles:O5}=Wa,j5=F({primitives:[...Object.values(R5),...Object.values(O5),{type:"text",text:"{REF}",x:0,y:0.16},{type:"text",text:"{VAL}",x:0,y:-0.16}],ports:[{...l_.left1,labels:["1"]},{...l_.right1,labels:["2"]}],center:{x:c_.centerX,y:c_.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),$5={...j5,size:{width:0.6,height:0.65}},Ra={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.175,y:0.075},{x:0.175,y:0.075},{x:0.175,y:-0.075},{x:-0.175,y:-0.075},{x:-0.175,y:0.075}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.175,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},X5={boxresistor:{horizontalOffset:0.16,horizontalHeight:0.65,verticalX:0.16,verticalRefY:0.16,verticalValY:-0.16,verticalWidth:0.9},capacitor:{horizontalOffset:0.24,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.095,verticalValY:-0.095,verticalWidth:0.9},resistor:{horizontalOffset:0.22,horizontalHeight:0.65,verticalX:0.2,verticalRefY:0.14,verticalValY:-0.14,verticalWidth:0.9}},Nt=(t,{kind:e,orientation:r,pin1Labels:i=["1"],pin2Labels:n=["2"]})=>{let a=X5[e],o=F({...t,texts:{}}).rotateRightFacingSymbol(r).labelPort("left1",i).labelPort("right1",n).build(),c=r==="right"||r==="left",l=c?[{type:"text",text:"{REF}",x:0,y:a.horizontalOffset,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-a.horizontalOffset,anchor:"middle_top"}]:[{type:"text",text:"{REF}",x:a.verticalX,y:a.verticalRefY,anchor:"middle_left"},{type:"text",text:"{VAL}",x:a.verticalX,y:a.verticalValY,anchor:"middle_left"}],[s,p]=o.ports,d=Math.hypot(p.x-s.x,p.y-s.y);return{...o,primitives:[...o.primitives,...l],size:c?{width:d,height:a.horizontalHeight}:{width:a.verticalWidth,height:d}}},V5=Nt(Ra,{kind:"boxresistor",orientation:"down"}),z5=Nt(Ra,{kind:"boxresistor",orientation:"left"}),D5=Nt(Ra,{kind:"boxresistor",orientation:"right"}),U5=Nt(Ra,{kind:"boxresistor",orientation:"up"}),Oa={paths:{path2:{type:"path",points:[{x:0.15,y:-0.01},{x:0.55,y:-0.01}],color:"primary",fill:!0},"path2-5":{type:"path",points:[{x:-0.15,y:0.06},{x:0.14,y:0.06}],color:"primary",fill:!0},"path2-5-1":{type:"path",points:[{x:0.14,y:0.06},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-5-1-6":{type:"path",points:[{x:-0.16,y:0.06},{x:-0.16,y:-0.08}],color:"primary",fill:!0},"path2-5-4":{type:"path",points:[{x:-0.15,y:-0.08},{x:0.14,y:-0.08}],color:"primary",fill:!0},"path2-9":{type:"path",points:[{x:-0.55,y:-0.01},{x:-0.17,y:-0.01}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.17},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.17}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.17,maxY:0.17,width:1.16,height:0.35,centerX:0,centerY:0},circles:{}},{paths:G5,texts:IV,bounds:co,refblocks:p_,circles:H5}=Oa,Q5=F({primitives:[...Object.values(G5),...Object.values(H5),{type:"text",text:"{REF}",x:-0.2,y:0.1404553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.1494553499999995}],ports:[{...p_.left1,labels:["1"]},{...p_.right1,labels:["2"]}],size:{width:co.width,height:co.height},center:{x:co.centerX,y:co.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Z5,texts:MV,bounds:lo,refblocks:h_,circles:K5}=Oa,J5=F({primitives:[...Object.values(Z5),...Object.values(K5),{type:"text",text:"{REF}",x:0,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:0.1704553499999995}],ports:[{...h_.left1,labels:["1"]},{...h_.right1,labels:["2"]}],size:{width:lo.width,height:lo.height},center:{x:lo.centerX,y:lo.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:q5,texts:kV,bounds:po,refblocks:d_,circles:tv}=Oa,ev=F({primitives:[...Object.values(q5),...Object.values(tv),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...d_.left1,labels:["1"]},{...d_.right1,labels:["2"]}],size:{width:po.width,height:po.height},center:{x:po.centerX,y:po.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:rv,texts:CV,bounds:ho,refblocks:m_,circles:iv}=Oa,nv=F({primitives:[...Object.values(rv),...Object.values(iv),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...m_.left1,labels:["1"]},{...m_.right1,labels:["2"]}],size:{width:ho.width,height:ho.height},center:{x:ho.centerX,y:ho.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:ov,texts:YV,bounds:u_,refblocks:y_,circles:av}=Wa,sv=F({primitives:[...Object.values(ov),...Object.values(av),{type:"text",text:"{REF}",x:0.16,y:-0.16},{type:"text",text:"{VAL}",x:-0.16,y:-0.16}],ports:[{...y_.left1,labels:["1"]},{...y_.right1,labels:["2"]}],center:{x:u_.centerX,y:u_.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),cv={...sv,size:{width:0.9,height:0.6}},ja={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.14,y:0}],color:"primary",fill:!1,strokeWidth:0.012},body:{type:"path",points:[{x:-0.14,y:0.065},{x:0.14,y:0.065},{x:0.14,y:-0.065},{x:-0.14,y:-0.065},{x:-0.14,y:0.065}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.14,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},lv=Nt(ja,{kind:"boxresistor",orientation:"down"}),pv=Nt(ja,{kind:"boxresistor",orientation:"left"}),hv=Nt(ja,{kind:"boxresistor",orientation:"right"}),dv=Nt(ja,{kind:"boxresistor",orientation:"up"}),Al={paths:{"horizontal-bar":{type:"path",points:[{x:-0.4,y:0},{x:0.4,y:0}],color:"primary",fill:!1},"middle-dash-1":{type:"path",points:[{x:0,y:0.2},{x:0,y:0.07}],color:"primary",fill:!1},"middle-dash-2":{type:"path",points:[{x:0,y:0.01},{x:0,y:-0.12}],color:"primary",fill:!1},"middle-dash-3":{type:"path",points:[{x:0,y:-0.18},{x:0,y:-0.31}],color:"primary",fill:!1},"left-vertical":{type:"path",points:[{x:-0.25,y:0},{x:-0.25,y:-0.2}],color:"primary",fill:!1},"right-vertical":{type:"path",points:[{x:0.25,y:0},{x:0.25,y:-0.2}],color:"primary",fill:!1},"left-ground":{type:"path",points:[{x:-0.3,y:-0.2},{x:-0.25,y:-0.3},{x:-0.2,y:-0.2},{x:-0.3,y:-0.2}],color:"primary",fill:!1},"right-ground":{type:"path",points:[{x:0.2,y:-0.2},{x:0.25,y:-0.3},{x:0.3,y:-0.2},{x:0.2,y:-0.2}],color:"primary",fill:!1}},refblocks:{left1:{x:-0.4,y:0},right1:{x:0.4,y:0}},texts:{ref:{type:"text",text:"{REF}",x:0,y:0.35}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.35,width:0.8,height:0.75,centerX:0,centerY:-0.02},circles:{}},{paths:mv,texts:LV,bounds:f_,refblocks:__,circles:uv}=Al,yv=F({primitives:[...Object.values(mv),...Object.values(uv),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...__.left1,labels:["1"]},{...__.right1,labels:["2"]}],center:{x:f_.centerX,y:f_.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),{paths:fv,texts:EV,bounds:g_,refblocks:x_,circles:_v}=Al,hx=F({primitives:[...Object.values(fv),...Object.values(_v),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...x_.left1,labels:["1"]},{...x_.right1,labels:["2"]}],center:{x:g_.centerX,y:g_.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),gv=ri(hx),{paths:xv,texts:TV,bounds:b_,refblocks:v_,circles:bv}=Al,vv=F({primitives:[...Object.values(xv),...Object.values(bv),{type:"text",text:"{REF}",x:0,y:0.2594553499999995}],ports:[{...v_.left1,labels:["1"]},{...v_.right1,labels:["2"]}],center:{x:b_.centerX,y:b_.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").build(),$a={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.06,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path29:{type:"path",points:[{x:0.06,y:0.16002},{x:0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.06,y:0.16002},{x:-0.06,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.24,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.24,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.24,maxY:0.24,width:0.6,height:0.48,centerX:0,centerY:0},circles:{}},{paths:Sv,texts:NV,bounds:mo,refblocks:S_,circles:wv}=$a,Av=F({primitives:[...Object.values(Sv),...Object.values(wv),{type:"text",text:"{REF}",x:-0.2,y:0.115},{type:"text",text:"{VAL}",x:0.2,y:0.115}],ports:[{...S_.left1,labels:["1"]},{...S_.right1,labels:["2"]}],size:{width:mo.width,height:mo.height},center:{x:mo.centerX,y:mo.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),Bv={...Av,size:{width:0.9,height:0.6}},Fv=F($a).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),Pv={...Fv,size:{width:0.6,height:0.65}},Xa={paths:{path27:{type:"path",points:[{x:0.3,y:0},{x:0.000657,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path28:{type:"path",points:[{x:-0.038683,y:0},{x:-0.3,y:0}],color:"primary",fill:!1,strokeWidth:0.012},path30:{type:"path",points:[{x:-0.074255,y:0.16002},{x:-0.074255,y:0.16002},{x:-0.069544,y:0.149352},{x:-0.065126,y:0.138684},{x:-0.061005,y:0.128016},{x:-0.057182,y:0.117348},{x:-0.053663,y:0.10668},{x:-0.05045,y:0.096012},{x:-0.047547,y:0.085344},{x:-0.044957,y:0.074676},{x:-0.042684,y:0.064008},{x:-0.040732,y:0.05334},{x:-0.039103,y:0.042672},{x:-0.037801,y:0.032004},{x:-0.03683,y:0.021336},{x:-0.036193,y:0.010668},{x:-0.035893,y:0},{x:-0.036193,y:-0.010668},{x:-0.03683,y:-0.021336},{x:-0.037801,y:-0.032004},{x:-0.039103,y:-0.042672},{x:-0.040732,y:-0.05334},{x:-0.042684,y:-0.064008},{x:-0.044957,y:-0.074676},{x:-0.047547,y:-0.085344},{x:-0.05045,y:-0.096012},{x:-0.053663,y:-0.10668},{x:-0.057182,y:-0.117348},{x:-0.061005,y:-0.128016},{x:-0.065126,y:-0.138684},{x:-0.069544,y:-0.149352},{x:-0.074255,y:-0.16002},{x:-0.074255,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-7":{type:"path",points:[{x:-0.000385,y:0.16002},{x:-0.000385,y:-0.16002}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2":{type:"path",points:[{x:0.156026,y:0.2},{x:0.085846,y:0.2}],color:"primary",fill:!1,strokeWidth:0.012},"path30-9-2-9":{type:"path",points:[{x:0.120936,y:0.16491},{x:0.120936,y:0.23509}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42,anchor:"middle_top"}},refblocks:{left1:{x:-0.3,y:0},right1:{x:0.3,y:0}},bounds:{minX:-0.3,maxX:0.3,minY:-0.55,maxY:0.55,width:0.6,height:1.1,centerX:0,centerY:0},circles:{"viewbox-padding-min":{type:"circle",x:-0.3,y:-0.55,radius:0,fill:!1,color:"transparent"},"viewbox-padding-max":{type:"circle",x:0.3,y:0.55,radius:0,fill:!1,color:"transparent"}}},Iv=F(Xa).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:-0.12,y:-0.3}).build(),Mv=F(Xa).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),kv=F(Xa).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.78}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.78}).build(),Cv=F(Xa).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_left",{x:-0.12,y:0.3}).changeTextAnchor("{VAL}","middle_left",{x:0.72,y:-0.3}).build(),Yv=F($a).rotateRightFacingSymbol("right").changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").build(),Lv={...Yv,size:{width:0.6,height:0.65}},Va={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.06,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.06,y:0.16},{x:-0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.06,y:0.16},{x:0.06,y:-0.16}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.06,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},Ev=Nt(Va,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),Tv=Nt(Va,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),Nv=Nt(Va,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),Wv=Nt(Va,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),{paths:Rv,texts:WV,bounds:uo,refblocks:w_,circles:Ov}=$a,jv=F({primitives:[...Object.values(Rv),...Object.values(Ov),{type:"text",text:"{REF}",x:0.2,y:-0.095},{type:"text",text:"{VAL}",x:-0.2,y:-0.095}],ports:[{...w_.left1,labels:["1"]},{...w_.right1,labels:["2"]}],size:{width:uo.width,height:uo.height},center:{x:uo.centerX,y:uo.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),$v={...jv,size:{width:0.9,height:0.6}},za={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.05,y:0}],color:"primary",fill:!1,strokeWidth:0.012},"left-plate":{type:"path",points:[{x:-0.05,y:0.14},{x:-0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-plate":{type:"path",points:[{x:0.05,y:0.14},{x:0.05,y:-0.14}],color:"primary",fill:!1,strokeWidth:0.012},"right-lead":{type:"path",points:[{x:0.05,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.012}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},Xv=Nt(za,{kind:"capacitor",orientation:"down",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),Vv=Nt(za,{kind:"capacitor",orientation:"left",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),zv=Nt(za,{kind:"capacitor",orientation:"right",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),Dv=Nt(za,{kind:"capacitor",orientation:"up",pin1Labels:["1","pos"],pin2Labels:["2","neg"]}),oi={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.29,y:0.29},{x:0.29,y:-0.23}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.37}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:Uv,texts:RV,bounds:yo,refblocks:A_,circles:Gv}=oi,Hv=F({primitives:[...Object.values(Uv),...Object.values(Gv),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...A_.left1,labels:["1"]},{...A_.right1,labels:["2"]}],size:{width:yo.width,height:yo.height},center:{x:yo.centerX,y:yo.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Qv=F(oi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:Zv,texts:OV,bounds:fo,refblocks:B_,circles:Kv}=oi,Jv=F({primitives:[...Object.values(Zv),...Object.values(Kv),{type:"text",text:"{REF}",x:-0,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:0,y:0.3894553499999995}],ports:[{...B_.left1,labels:["1"]},{...B_.right1,labels:["2"]}],size:{width:fo.width,height:fo.height},center:{x:fo.centerX,y:fo.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),qv=F(oi).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1","neg"]).labelPort("right1",["2","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:tS,texts:jV,bounds:_o,refblocks:F_,circles:eS}=oi,rS=F({primitives:[...Object.values(tS),...Object.values(eS),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...F_.left1,labels:["1"]},{...F_.right1,labels:["2"]}],size:{width:_o.width,height:_o.height},center:{x:_o.centerX,y:_o.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:iS,texts:$V,bounds:go,refblocks:P_,circles:nS}=oi,oS=F({primitives:[...Object.values(iS),...Object.values(nS),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...P_.left1,labels:["1"]},{...P_.right1,labels:["2"]}],size:{width:go.width,height:go.height},center:{x:go.centerX,y:go.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Da={paths:{path27:{type:"path",points:[{x:0.54,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:0.25},{x:0.13,y:-0.27}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:0.25},{x:0.07,y:-0.28}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:0.25},{x:-0.14,y:-0.27}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:0.26},{x:-0.08,y:-0.27}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.21,y:0.32},{x:0.2,y:0.32}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.71},{x:0,y:0.33},{x:0,y:0.32}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:-0.21,y:0.32},{x:-0.21,y:0.25}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.2,y:0.32},{x:0.2,y:0.25}],color:"primary",fill:!1},"path43-9":{type:"path",points:[{x:0.19,y:-0.35},{x:-0.22,y:-0.35}],color:"primary",fill:!1},"path44-0-5":{type:"path",points:[{x:-0.02,y:-0.71},{x:-0.02,y:-0.36},{x:-0.02,y:-0.35}],color:"primary",fill:!1},"path43-8-1":{type:"path",points:[{x:0.19,y:-0.35},{x:0.19,y:-0.28}],color:"primary",fill:!1},"path43-8-8-9":{type:"path",points:[{x:-0.22,y:-0.35},{x:-0.22,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.54,y:-0.01}],color:"primary",fill:!1}},texts:{left1:{type:"text",text:"{REF}",x:0.53,y:0.28},right1:{type:"text",text:"{VAL}",x:0.54,y:-0.28}},refblocks:{top1:{x:0,y:0.71},bottom1:{x:-0.02,y:-0.71},left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.74,maxY:0.74,width:1.14,height:1.48,centerX:0,centerY:0},circles:{}},{paths:aS,texts:XV,bounds:xo,refblocks:bo,circles:sS}=Da,cS=F({primitives:[...Object.values(aS),...Object.values(sS),{type:"text",text:"{REF}",x:-0.4,y:0.4094554499999995},{type:"text",text:"{VAL}",x:0.4,y:0.4094553499999995}],ports:[{...bo.left1,labels:["1"]},{...bo.right1,labels:["3"]},{...bo.bottom1,labels:["2"]},{...bo.top1,labels:["4"]}],size:{width:xo.width,height:xo.height},center:{x:xo.centerX,y:xo.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),lS=F(Da).labelPort("top1",["2","gnd1"]).labelPort("bottom1",["4","gnd2"]).labelPort("left1",["3"]).labelPort("right1",["1"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),pS=F(Da).labelPort("top1",["4","gnd1"]).labelPort("bottom1",["2","gnd2"]).labelPort("left1",["1"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),{paths:hS,texts:VV,bounds:vo,refblocks:So,circles:dS}=Da,mS=F({primitives:[...Object.values(hS),...Object.values(dS),{type:"text",text:"{VAL}",x:-0.4,y:-0.4094554499999995},{type:"text",text:"{REF}",x:0.4,y:-0.4094553499999995}],ports:[{...So.left1,labels:["1"]},{...So.right1,labels:["3"]},{...So.bottom1,labels:["2"]},{...So.top1,labels:["4"]}],size:{width:vo.width,height:vo.height},center:{x:vo.centerX,y:vo.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","bottom_left").changeTextAnchor("{VAL}","top_left").build(),Ua={paths:{path27:{type:"path",points:[{x:0.55,y:-0.01},{x:0.13,y:-0.01}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.14,y:-0.01},{x:-0.55,y:-0.01}],color:"primary",fill:!1},path29:{type:"path",points:[{x:0.13,y:-0.28},{x:0.13,y:0.25}],color:"primary",fill:!1},"path29-2":{type:"path",points:[{x:0.07,y:-0.28},{x:0.07,y:0.25}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.14,y:-0.28},{x:-0.14,y:0.25}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.08,y:-0.28},{x:-0.08,y:0.25}],color:"primary",fill:!1},"path29-2-7":{type:"path",points:[{x:0.07,y:-0.28},{x:-0.08,y:-0.28}],color:"primary",fill:!1},"path29-2-7-6":{type:"path",points:[{x:0.07,y:0.26},{x:-0.08,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{VAL}",x:-0.01,y:-0.42},bottom1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.55,y:-0.01},right1:{x:0.55,y:-0.01}},bounds:{minX:-0.58,maxX:0.58,minY:-0.52,maxY:0.43,width:1.16,height:1,centerX:0,centerY:-0.04},circles:{}},{paths:uS,texts:zV,bounds:wo,refblocks:I_,circles:yS}=Ua,fS=F({primitives:[...Object.values(uS),...Object.values(yS),{type:"text",text:"{REF}",x:-0.3,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.3,y:0.3094553499999995}],ports:[{...I_.left1,labels:["1"]},{...I_.right1,labels:["2"]}],size:{width:wo.width,height:wo.height},center:{x:wo.centerX,y:wo.centerY}}).changeTextAnchor("{VAL}","top_left").rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),_S=F(Ua).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("right1",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").build(),gS=F(Ua).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:xS,texts:DV,bounds:Ao,refblocks:M_,circles:bS}=Ua,vS=F({primitives:[...Object.values(xS),...Object.values(bS),{type:"text",text:"{REF}",x:0.3,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.3094553499999995}],ports:[{...M_.left1,labels:["1"]},{...M_.right1,labels:["2"]}],size:{width:Ao.width,height:Ao.height},center:{x:Ao.centerX,y:Ao.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","bottom_left").build(),Qi=0.6,Dc=0.3,SS=[{type:"path",points:[{x:-Qi,y:0},{x:-Dc,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:Dc,y:0},{x:Qi,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:Dc,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],wS=F({primitives:[...SS,{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{x:-Qi,y:0,labels:["1"]},{x:Qi,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Qi*2,height:0.9}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),Zi=0.6,Uc=0.3,AS=[{type:"path",points:[{x:-Zi,y:0},{x:-Uc,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:Uc,y:0},{x:Zi,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:Uc,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],BS=F({primitives:[...AS,{type:"text",text:"{REF}",x:0,y:-0.4},{type:"text",text:"{VAL}",x:0,y:0.4}],ports:[{x:-Zi,y:0,labels:["1"]},{x:Zi,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Zi*2,height:0.9}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ki=0.6,Gc=0.3,FS=[{type:"path",points:[{x:-Ki,y:0},{x:-Gc,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:Gc,y:0},{x:Ki,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:Gc,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],PS=F({primitives:[...FS,{type:"text",text:"{REF}",x:0,y:0.4},{type:"text",text:"{VAL}",x:0,y:-0.4}],ports:[{x:-Ki,y:0,labels:["1"]},{x:Ki,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Ki*2,height:0.9}}).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Ji=0.6,Hc=0.3,IS=[{type:"path",points:[{x:-Ji,y:0},{x:-Hc,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:Hc,y:0},{x:Ji,y:0}],color:"primary",fill:!1},{type:"circle",x:0,y:0,radius:Hc,color:"primary",fill:!1},{type:"path",points:[{x:-0.1,y:0},{x:0.15,y:0}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:0.08}],color:"primary",fill:!1},{type:"path",points:[{x:0.15,y:0},{x:0.05,y:-0.08}],color:"primary",fill:!1}],MS=F({primitives:[...IS,{type:"text",text:"{REF}",x:0.2,y:-0.35},{type:"text",text:"{VAL}",x:-0.2,y:-0.35}],ports:[{x:-Ji,y:0,labels:["1"]},{x:Ji,y:0,labels:["2"]}],center:{x:0,y:0},size:{width:Ji*2,height:0.9}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ai={paths:{path11:{type:"path",points:[{x:1.99,y:-1.64},{x:2.1,y:-1.64}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:2.1,y:-1.48},{x:2.1,y:-1.8}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:2.22,y:-1.5},{x:2.11,y:-1.58}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:2.23,y:-1.78},{x:2.11,y:-1.7}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:2.23,y:-1.49},{x:2.23,y:-1.14}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:2.23,y:-1.97},{x:2.23,y:-1.79}],color:"primary",fill:!1},"arrow-2":{type:"path",points:[{x:2.17,y:-1.7},{x:2.13,y:-1.76},{x:2.19,y:-1.76},{x:2.17,y:-1.7}],color:"primary",fill:!0},path1:{type:"path",points:[{x:1.6,y:-1.5},{x:1.86,y:-1.5}],color:"primary",fill:!1},path2:{type:"path",points:[{x:1.87,y:-1.34},{x:1.87,y:-1.66}],color:"primary",fill:!1},path3:{type:"path",points:[{x:1.99,y:-1.36},{x:1.87,y:-1.44}],color:"primary",fill:!1},path4:{type:"path",points:[{x:1.99,y:-1.64},{x:1.88,y:-1.56}],color:"primary",fill:!1},"arrow-1":{type:"path",points:[{x:1.94,y:-1.56},{x:1.89,y:-1.62},{x:1.96,y:-1.62},{x:1.94,y:-1.56}],color:"primary",fill:!0},path9:{type:"path",points:[{x:1.99,y:-1.35},{x:2.23,y:-1.36}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:1.88,y:-1.94},right1:{type:"text",text:"{REF}",x:1.88,y:-1.14}},refblocks:{right1:{x:2.23,y:-1.97},right2:{x:1.6,y:-1.5},right3:{x:2.23,y:-1.14}},bounds:{minX:1.58,maxX:2.35,minY:-1.98,maxY:-1.12,width:0.77,height:0.86,centerX:1.96,centerY:-1.55},circles:{"path1-0":{type:"circle",x:2.05,y:-1.54,radius:0.3,color:"primary",fill:!1}}},kS=F(ai).rotateRightFacingSymbol("down").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.15}).build(),CS=F(ai).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),YS=F(ai).rotateRightFacingSymbol("left").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.8}).changeTextAnchor("{REF}","middle_left",{x:0,y:0.8}).build(),LS=F(ai).rotateRightFacingSymbol("right").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_right").changeTextAnchor("{REF}","middle_right").build(),ES=F(ai).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),TS=F(ai).rotateRightFacingSymbol("up").labelPort("right2",["1"]).labelPort("right1",["2"]).labelPort("right3",["3"]).changeTextAnchor("{VAL}","middle_left",{x:0,y:-0.15}).changeTextAnchor("{REF}","middle_left",{x:0.8,y:0.15}).build(),NS={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:0.09},{x:0.12,y:0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.45},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.35},left1:{type:"text",text:"A",x:0,y:-0.1}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:-0.09,maxY:0.09,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:k_,bounds:Bo,refblocks:C_,circles:WS}=NS,rn=It({primitives:[k_.path11,k_.path12,{type:"path",points:[{x:-0.12,y:0.14},{x:0.12,y:0.14}],color:"primary",fill:!1},...Object.values(WS),{type:"text",text:"{REF}",x:0,y:0.3594553499999995,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.35,anchor:"middle_top"},{type:"path",points:[{x:-0.095,y:-0.16},{x:0,y:0.09}],color:"primary",fill:!1},{type:"path",points:[{x:0,y:0.09},{x:0.095,y:-0.16}],color:"primary",fill:!1},{type:"path",points:[{x:-0.048,y:-0.045},{x:0.048,y:-0.045}],color:"primary",fill:!1}],ports:[{...C_.left1,labels:["1"]},{...C_.right1,labels:["2"]}],size:{width:Bo.width,height:Bo.height},center:{x:Bo.centerX,y:Bo.centerY}}),_l=structuredClone(rn);_l.primitives=_l.primitives.map((t)=>t.type!=="text"?t:t.text==="{REF}"?{...t,x:-0.16,y:0.3594553499999995,anchor:"middle_bottom"}:t.text==="{VAL}"?{...t,x:0.16,y:0.35,anchor:"middle_bottom"}:t);var Y_=tn(_l,{newOrientation:"down"}),RS=ri(rn),OS=rn,gl=structuredClone(rn);gl.primitives=gl.primitives.map((t)=>t.type!=="text"?t:t.text==="{REF}"?{...t,x:0.16,y:-0.3594553499999995,anchor:"middle_top"}:t.text==="{VAL}"?{...t,x:-0.16,y:-0.35,anchor:"middle_top"}:t);var jS=tn(gl,{newOrientation:"up"}),si={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.12,y:-0.14},{x:0.12,y:-0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:$S,texts:UV,bounds:Fo,refblocks:L_,circles:XS}=si,VS=F({primitives:[...Object.values($S),...Object.values(XS),{type:"text",text:"{REF}",x:-0.15,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3894553499999995}],ports:[{...L_.left1,labels:["1"]},{...L_.right1,labels:["2"]}],size:{width:Fo.width,height:Fo.height},center:{x:Fo.centerX,y:Fo.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:zS,texts:GV,bounds:Po,refblocks:E_,circles:DS}=si,US=F({primitives:[...Object.values(zS),...Object.values(DS),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...E_.left1,labels:["1"]},{...E_.right1,labels:["2"]}],size:{width:Po.width,height:Po.height},center:{x:Po.centerX,y:Po.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:GS,texts:HV,bounds:Io,refblocks:T_,circles:HS}=si,QS=F({primitives:[...Object.values(GS),...Object.values(HS),{type:"text",text:"{REF}",x:-0,y:-0.3294553499999995},{type:"text",text:"{VAL}",x:0,y:0.4294553499999995}],ports:[{...T_.left1,labels:["1"]},{...T_.right1,labels:["2"]}],size:{width:Io.width,height:Io.height},center:{x:Io.centerX,y:Io.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:ZS,texts:QV,bounds:Mo,refblocks:N_,circles:KS}=si,JS=F({primitives:[...Object.values(ZS),...Object.values(KS),{type:"text",text:"{REF}",x:-0,y:0.3894553499999995},{type:"text",text:"{VAL}",x:0,y:-0.3294553499999995}],ports:[{...N_.left1,labels:["1"]},{...N_.right1,labels:["2"]}],size:{width:Mo.width,height:Mo.height},center:{x:Mo.centerX,y:Mo.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:qS,texts:ZV,bounds:ko,refblocks:W_,circles:t3}=si,e3=F({primitives:[...Object.values(qS),...Object.values(t3),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...W_.left1,labels:["1"]},{...W_.right1,labels:["2"]}],size:{width:ko.width,height:ko.height},center:{x:ko.centerX,y:ko.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:r3,texts:KV,bounds:Co,refblocks:R_,circles:i3}=si,n3=F({primitives:[...Object.values(r3),...Object.values(i3),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...R_.left1,labels:["1"]},{...R_.right1,labels:["2"]}],size:{width:Co.width,height:Co.height},center:{x:Co.centerX,y:Co.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ci={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.03,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},o3=F(ci).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:-0.03,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.8,y:-0.2}).build(),a3=F(ci).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),s3=F(ci).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.8}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.9}).build(),c3=F(ci).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.1}).changeTextAnchor("{VAL}","middle_top").build(),l3=F(ci).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),p3=F(ci).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left",{x:0.7,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:-0.13,y:-0.2}).build(),Ga={paths:{triangle:{type:"path",points:[{x:-0.06,y:-0.09},{x:-0.06,y:0.09},{x:0.06,y:0},{x:-0.06,y:-0.09}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.11,y:0},{x:-0.06,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:-0.11,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:h3,bounds:O_,refblocks:d3}=Ga,m3=F({primitives:[...Object.values(h3),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...d3.left1,labels:["1"]}],center:{x:O_.centerX,y:O_.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:u3,bounds:j_,refblocks:y3}=Ga,f3=F({primitives:[...Object.values(u3),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...y3.left1,labels:["1"]}],center:{x:j_.centerX,y:j_.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:_3,bounds:$_,refblocks:g3}=Ga,x3=F({primitives:[...Object.values(_3),{type:"text",text:"{REF}",x:-0.13,y:-0}],ports:[{...g3.left1,labels:["1"]}],center:{x:$_.centerX,y:$_.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:b3,bounds:X_,refblocks:v3}=Ga,S3=F({primitives:[...Object.values(b3),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...v3.left1,labels:["1"]}],center:{x:X_.centerX,y:X_.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),w3={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},Ha=F(w3).labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),A3=z(Ha,"down"),B3=z(Ha,"left"),F3=z(Ha,"up"),P3={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-2":{type:"path",points:[{x:-0.07,y:0.22},{x:0.11,y:0.16}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-5":{type:"path",points:[{x:-0.07,y:-0.19},{x:0.1,y:-0.24}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.2},{x:0,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.56},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},Qa=F(P3).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Bl=z(Qa,"down"),Fl=Bl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Pl=Bl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Fl.anchor="middle_bottom";Pl.anchor="middle_top";Fl.x=0;Fl.y+=0.537;Pl.y-=0.5375;Pl.x=0;var I3=Bl,Il=z(Qa,"left"),Ml=Il.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),kl=Il.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Ml.anchor="middle_bottom";kl.anchor="middle_top";Ml.x=0;Ml.y+=1;kl.y-=1;kl.x=0;var M3=Il,Cl=z(Qa,"up"),Yl=Cl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ll=Cl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Yl.anchor="middle_bottom";Ll.anchor="middle_top";Yl.x=0;Yl.y+=0.537;Ll.y-=0.5375;Ll.x=0;var k3=Cl,C3={paths:{path1:{type:"path",points:[{x:-0.37,y:0.22},{x:-0.13,y:0.22}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.23},{x:0.11,y:0.33}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:0.13},{x:0.37,y:0.13}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.36},{x:0.37,y:0.36}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.37,y:-0.18},{x:-0.13,y:-0.18}],color:"primary",fill:!1},"path4-6":{type:"path",points:[{x:-0.07,y:-0.18},{x:0.11,y:-0.07}],color:"primary",fill:!1},path5:{type:"path",points:[{x:0.1,y:-0.27},{x:0.37,y:-0.27}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.12,y:-0.04},{x:0.37,y:-0.04}],color:"primary",fill:!1},"path1-4-join":{type:"path",points:[{x:0,y:-0.12},{x:0,y:0.27}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.61},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.52}},refblocks:{left1:{x:-0.37,y:0.22},left2:{x:-0.37,y:-0.18},right1:{x:0.37,y:0.36},right2:{x:0.37,y:0.13},right3:{x:0.37,y:-0.04},right5:{x:0.37,y:-0.27}},bounds:{minX:-0.4,maxX:0.4,minY:-0.47,maxY:0.56,width:1,height:1.04,centerX:0,centerY:0.05},circles:{"circle-2":{type:"circle",x:0.08,y:0.13,radius:0.02,color:"primary",fill:!1},"circle-5":{type:"circle",x:0.08,y:-0.27,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:0.08,y:0.37,radius:0.02,color:"primary",fill:!1},"circle-6":{type:"circle",x:0.08,y:-0.04,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.22,radius:0.02,color:"primary",fill:!1},"circle-4":{type:"circle",x:-0.1,y:-0.18,radius:0.02,color:"primary",fill:!1}}},Za=F(C3).labelPort("left1",["1"]).labelPort("right1",["3"]).labelPort("right2",["2"]).labelPort("right3",["6"]).labelPort("left2",["4"]).labelPort("right5",["5"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),El=z(Za,"down"),Tl=El.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Nl=El.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Tl.anchor="middle_bottom";Nl.anchor="middle_top";Tl.x=0;Tl.y+=0.565;Nl.y-=0.555;Nl.x=0;var Y3=El,Wl=z(Za,"left"),Rl=Wl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ol=Wl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Rl.anchor="middle_bottom";Ol.anchor="middle_top";Rl.x=0;Rl.y+=1.09;Ol.y-=1.09;Ol.x=0;var L3=Wl,jl=z(Za,"up"),$l=jl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Xl=jl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");$l.anchor="middle_bottom";Xl.anchor="middle_top";$l.x=0;$l.y+=0.565;Xl.y-=0.555;Xl.x=0;var E3=jl,T3={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.11,y:0.11}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.17},{x:0.11,y:-0.12}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.31}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},Ka=F(T3).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Vl=z(Ka,"down"),zl=Vl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Dl=Vl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");zl.anchor="middle_bottom";Dl.anchor="middle_top";zl.x=0.4;zl.y+=0.265;Dl.y-=0.265;Dl.x=0.4;var N3=Vl,Ul=z(Ka,"left"),Gl=Ul.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Hl=Ul.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Gl.anchor="middle_bottom";Hl.anchor="middle_top";Gl.x=0;Gl.y+=0.67;Hl.y-=0.67;Hl.x=0;var W3=Ul,Ql=z(Ka,"up"),Zl=Ql.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Kl=Ql.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Zl.anchor="middle_bottom";Kl.anchor="middle_top";Zl.x=0.46;Zl.y+=0.265;Kl.y-=0.265;Kl.x=0.46;var R3=Ql,O3={paths:{path11:{type:"path",points:[{x:-0.38,y:0.06},{x:-0.14,y:0.06}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:0.07},{x:0.1,y:0.2}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.13,y:0.06},{x:0.38,y:0.06}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.38,y:-0.17},{x:-0.14,y:-0.17}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:-0.09,y:-0.16},{x:0.1,y:-0.03}],color:"primary",fill:!1},"path12-0":{type:"path",points:[{x:0.13,y:-0.17},{x:0.38,y:-0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.42}},refblocks:{left1:{x:-0.38,y:-0.17},left3:{x:-0.38,y:0.06},right1:{x:0.38,y:-0.17},right3:{x:0.38,y:0.06}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.81,height:0.79,centerX:0,centerY:0},circles:{"circle-4":{type:"circle",x:0.1,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.1,y:-0.17,radius:0.02,color:"primary",fill:!1},"circle-3":{type:"circle",x:-0.11,y:0.06,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.11,y:-0.17,radius:0.02,color:"primary",fill:!1}}},Ja=F(O3).labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("right3",["4"]).labelPort("left3",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Jl=z(Ja,"down"),ql=Jl.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),tp=Jl.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");ql.anchor="middle_bottom";tp.anchor="middle_top";ql.x=0.4;ql.y+=0.295;tp.y-=0.295;tp.x=0.42;var j3=Jl,ep=z(Ja,"left"),rp=ep.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ip=ep.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");rp.anchor="middle_bottom";ip.anchor="middle_top";rp.x=0;rp.y+=0.795;ip.y-=0.795;ip.x=0;var $3=ep,np=z(Ja,"up"),op=np.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ap=np.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");op.anchor="middle_bottom";ap.anchor="middle_top";op.x=0.46;op.y+=0.315;ap.y-=0.315;ap.x=0.46;var X3=np,dx={paths:{path5:{type:"path",points:[{x:-0.44,y:0},{x:-0.16,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.17,y:0},{x:0.44,y:0.01}],color:"primary",fill:!1},path9:{type:"path",points:[{x:-0.25,y:-0.16},{x:0.02,y:0.3},{x:0.25,y:0.17},{x:-0.02,y:-0.29},{x:-0.25,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.44,y:0},right1:{x:0.44,y:0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:V3,texts:JV,bounds:Yo,refblocks:V_,circles:z3}=dx,mx=F({primitives:[...Object.values(V3),...Object.values(z3),{type:"text",text:"{REF}",x:0.18,y:-0.3204553499999995},{type:"text",text:"{VAL}",x:-0.25,y:-0.3294553499999995}],ports:[{...V_.left1,labels:["1"]},{...V_.right1,labels:["2"]}],size:{width:Yo.width,height:Yo.height},center:{x:Yo.centerX,y:Yo.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),sp=ei(mx),cp=sp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),lp=sp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");cp.anchor="middle_left";lp.anchor="middle_left";cp.y+=0.4;cp.x=0.32;lp.y-=0.45;lp.x=0.32;var D3=sp,ux=F(dx).labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),U3=ri(ux),li={paths:{path11:{type:"path",points:[{x:-0.56,y:0.04},{x:-0.22,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0.05},{x:0.48,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.14,y:-0.15},{x:0.14,y:0.25}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.22,y:0.25},{x:-0.21,y:-0.15},{x:0.14,y:0.05},{x:-0.22,y:0.25}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.09,y:0.38},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.38},right1:{type:"text",text:"",x:0.59,y:-0.33}},refblocks:{left1:{x:-0.56,y:0.04},right1:{x:0.48,y:0.05}},bounds:{minX:-0.59,maxX:0.59,minY:-0.38,maxY:0.38,width:1.18,height:0.76,centerX:0,centerY:0},circles:{}},{paths:G3,texts:qV,bounds:Lo,refblocks:z_,circles:H3}=li,Q3=F({primitives:[...Object.values(G3),...Object.values(H3),{type:"text",text:"{REF}",x:-0.15,y:0.3294553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.3294553499999995}],ports:[{...z_.left1,labels:["1"]},{...z_.right1,labels:["2"]}],size:{width:Lo.width,height:Lo.height},center:{x:Lo.centerX,y:Lo.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:Z3,texts:tz,bounds:Eo,refblocks:D_,circles:K3}=li,J3=F({primitives:[...Object.values(Z3),...Object.values(K3),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...D_.left1,labels:["1"]},{...D_.right1,labels:["2"]}],size:{width:Eo.width,height:Eo.height},center:{x:Eo.centerX,y:Eo.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:q3,texts:ez,bounds:To,refblocks:U_,circles:tw}=li,ew=F({primitives:[...Object.values(q3),...Object.values(tw),{type:"text",text:"{REF}",x:-0,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:0,y:0.4094553499999995}],ports:[{...U_.left1,labels:["1"]},{...U_.right1,labels:["2"]}],size:{width:To.width,height:To.height},center:{x:To.centerX,y:To.centerY}}).changeTextAnchor("{VAL}","middle_bottom").rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:rw,texts:rz,bounds:No,refblocks:G_,circles:iw}=li,nw=F({primitives:[...Object.values(rw),...Object.values(iw),{type:"text",text:"{REF}",x:-0,y:0.4094553499999995},{type:"text",text:"{VAL}",x:0,y:-0.4094553499999995}],ports:[{...G_.left1,labels:["1"]},{...G_.right1,labels:["2"]}],size:{width:No.width,height:No.height},center:{x:No.centerX,y:No.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:ow,texts:iz,bounds:Wo,refblocks:H_,circles:aw}=li,sw=F({primitives:[...Object.values(ow),...Object.values(aw),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...H_.left1,labels:["1"]},{...H_.right1,labels:["2"]}],size:{width:Wo.width,height:Wo.height},center:{x:Wo.centerX,y:Wo.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:cw,texts:nz,bounds:Ro,refblocks:Q_,circles:lw}=li,pw=F({primitives:[...Object.values(cw),...Object.values(lw),{type:"text",text:"{REF}",x:0.15,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2894553499999995}],ports:[{...Q_.left1,labels:["1"]},{...Q_.right1,labels:["2"]}],size:{width:Ro.width,height:Ro.height},center:{x:Ro.centerX,y:Ro.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),hw={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Hz",x:0,y:-0.04}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:dw,texts:mw,bounds:Oo,refblocks:Z_,circles:uw}=hw,pp=It({primitives:[...Object.values(dw),...Object.values(uw),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...mw.left1,x:0,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...Z_.left1,labels:["1"]},{...Z_.right1,labels:["2"]}],size:{width:Oo.width,height:Oo.height},center:{x:Oo.centerX,y:Oo.centerY}}),{5:yw,...fw}=pp.primitives;function _w(t){return typeof t=="object"}var K_=z({...pp,primitives:Object.values(fw).filter(_w)}),gw={...K_,primitives:[...K_.primitives,yw]},xw={paths:{path10:{type:"path",points:[{x:-0.53,y:0.04},{x:0.53,y:0.04}],color:"primary",fill:!1},path14:{type:"path",points:[{x:0,y:0.17},{x:0.27,y:0.17},{x:0.27,y:-0.1},{x:-0.26,y:-0.1},{x:-0.26,y:0.17},{x:0,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.24},bottom1:{type:"text",text:"{VAL}",x:-0.17,y:-0.24}},refblocks:{left1:{x:-0.53,y:0.04},right1:{x:0.53,y:0.04}},bounds:{minX:-0.56,maxX:0.56,minY:-0.24,maxY:0.24,width:1.13,height:0.47,centerX:0,centerY:0},circles:{}},{paths:bw,texts:vw,bounds:jo,refblocks:J_}=xw,yx=It({primitives:[...Object.values(bw),{...vw.top1,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.2,anchor:"middle_top"}],ports:[{...J_.left1,labels:["1"]},{...J_.right1,labels:["2"]}],size:{width:jo.width,height:jo.height},center:{x:jo.centerX,y:jo.centerY}}),Sw=z(yx),pi={paths:{path1:{type:"path",points:[{x:-0.29,y:0.01},{x:0.04,y:0}],color:"primary",fill:!0},path2:{type:"path",points:[{x:0.04,y:-0.22},{x:0.04,y:0.22}],color:"primary",fill:!0},path3:{type:"path",points:[{x:0.12,y:-0.17},{x:0.12,y:0.17}],color:"primary",fill:!0},path4:{type:"path",points:[{x:0.19,y:-0.06},{x:0.19,y:0.06}],color:"primary",fill:!0}},texts:{right1:{type:"text",text:"{REF}",x:0.31,y:-0.02}},refblocks:{left1:{x:-0.29,y:0.01}},bounds:{minX:-0.31,maxX:0.31,minY:-0.22,maxY:0.22,width:0.62,height:0.45,centerX:0,centerY:0},circles:{}},ww=F(pi).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),Aw=F(pi).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),Bw=F(pi).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),Fw=F(pi).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),Pw=F(pi).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),Iw=F(pi).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),hp={paths:{path11:{type:"path",points:[{x:-0.52,y:0.03},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.04},{x:0.52,y:0.04}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.31,y:0.2},{x:-0.31,y:-0.11},{x:-0.01,y:0.04},{x:-0.3,y:0.2}],color:"primary",fill:!0},"path11-0-9-5":{type:"path",points:[{x:0.33,y:0.2},{x:0.33,y:-0.1},{x:0.04,y:0.04},{x:0.33,y:0.2}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.04,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.32}},refblocks:{left1:{x:-0.52,y:0.03},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.32,maxY:0.32,width:1.09,height:0.63,centerX:0,centerY:0},circles:{}},{paths:oz,texts:az,bounds:sz,refblocks:cz,circles:lz}=hp,Mw=F(hp).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),kw=F(hp).rotateRightFacingSymbol("down").changeTextAnchor("{VAL}","middle_right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),Cw={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.3,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1},box:{type:"path",points:[{x:-0.3,y:-0.4},{x:0.3,y:-0.4},{x:0.3,y:0.4},{x:-0.3,y:0.4},{x:-0.3,y:-0.4},{x:-0.3,y:0.4}],color:"primary",fill:!1},"path48-1":{type:"path",points:[{x:-0.3,y:0.13},{x:-0.54,y:0.13}],color:"primary",fill:!1},"path48-2":{type:"path",points:[{x:-0.3,y:-0.13},{x:-0.54,y:-0.13}],color:"primary",fill:!1},"path48-3":{type:"path",points:[{x:0.3,y:-0.13},{x:0.54,y:-0.13}],color:"primary",fill:!1},"path48-4":{type:"path",points:[{x:0.3,y:0.13},{x:0.54,y:0.13}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43},right1:{type:"text",text:"{REF}",x:0,y:0.43}},refblocks:{left1:{x:-0.54,y:0.13},left2:{x:-0.54,y:-0.13},right1:{x:0.54,y:-0.13},right2:{x:0.54,y:0.13}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},qa=F(Cw).labelPort("left1",["1","DIN"]).labelPort("left2",["2","POWER"]).labelPort("right1",["3","GND"]).labelPort("right2",["4","DOUT"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Yw=z(qa,"down"),Lw=ri(qa),dp=z(qa,"up"),mp=dp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),up=dp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");mp.anchor="middle_left";up.anchor="middle_left";mp.y+=0.21;mp.x=0.44;up.y-=0.21;up.x=0.44;var Ew=dp,Tw={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:-0.01,y:0}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.01,y:-0.12},{x:0.01,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.28,y:-0.25},{x:0.28,y:-0.56}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.56},{x:0.28,y:0.27}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.17,y:-0.22},{x:0.28,y:-0.23},{x:0.23,y:-0.14}],color:"primary",fill:!0},path17:{type:"path",points:[{x:0.08,y:-0.09},{x:0.23,y:-0.2}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.28,y:0.26}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.02,y:-0.42}},refblocks:{top1:{x:0.28,y:0.56},bottom1:{x:0.28,y:-0.56},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.17,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0.01,radius:0.29,color:"primary",fill:!1}}},fx=F(Tw).changeTextAnchor("{VAL}","middle_right").labelPort("left1",["3"]).labelPort("top1",["2"]).labelPort("bottom1",["1"]).changeTextAnchor("{REF}","middle_right").build(),yp=z(fx),fp=yp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),_x=yp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");fp.anchor="middle_left";_x.anchor="middle_right";fp.x=0.45;fp.y+=0.065;_x.y+=0.065;var Nw=yp,Ww={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.02,y:-0.02},{x:0.02,y:-0.1}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.19},{x:-0.17,y:-0.19}],color:"primary",fill:!1},"path12-1-5-6-8":{type:"path",points:[{x:0.02,y:0.17},{x:0.02,y:0.11}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.15,y:-0.03},{x:0.2,y:-0.19}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.19},{x:0.47,y:-0.19}],color:"primary",fill:!1},"path12-1-8-6-9-4":{type:"path",points:[{x:0.02,y:0.12},{x:0.02,y:0.02}],color:"primary",fill:!1},"path12-1-8-6-9-4-3":{type:"path",points:[{x:0.08,y:0.11},{x:0.08,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-3-1":{type:"path",points:[{x:-0.04,y:0.11},{x:-0.04,y:0.05}],color:"primary",fill:!1},"path12-1-8-6-9-4-4":{type:"path",points:[{x:0.08,y:0.11},{x:-0.04,y:0.11}],color:"primary",fill:!1},"path14-5":{type:"path",points:[{x:-0.01,y:0.28},{x:0.01,y:0.25},{x:0.04,y:0.23},{x:0.06,y:0.2}],color:"primary",fill:!0},"path14-5-3":{type:"path",points:[{x:-0.01,y:0.2},{x:0.01,y:0.23},{x:0.04,y:0.25},{x:0.06,y:0.28}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.38}},refblocks:{left1:{x:-0.47,y:-0.19},right1:{x:0.47,y:-0.19}},bounds:{minX:-0.5,maxX:0.5,minY:-0.38,maxY:0.38,width:1,height:0.76,centerX:0,centerY:0},circles:{path9:{type:"circle",x:0.02,y:0.24,radius:0.06,color:"primary",fill:!1}}},gx=F(Ww).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),xx=z(gx),bx=xx.primitives.filter((t)=>t.type==="text"),_p=bx.find((t)=>t.text==="{VAL}");_p.x=-0.35;_p.y=0;_p.anchor="middle_right";var gp=bx.find((t)=>t.text==="{REF}");gp.y=0;gp.x=0.35;gp.anchor="middle_left";var Rw=xx,ts={paths:{path8698:{type:"path",points:[{x:-0.19796749999999919,y:-0.023826854587889912},{x:-0.2004570399999992,y:-0.018993393814014044},{x:-0.2029465799999992,y:-0.014174384106555204},{x:-0.20543611999999922,y:-0.009384187436300498},{x:-0.20792565999999923,y:-0.004636988132081332},{x:-0.21041519999999925,y:0.00005329457033053167},{x:-0.21290473999999926,y:0.004673092344940184},{x:-0.21539427999999927,y:0.009209271428771242},{x:-0.21788381999999928,y:0.013649213595881985},{x:-0.2203733599999993,y:0.01798089395292432},{x:-0.2228628999999993,y:0.022192955076609913},{x:-0.22535243999999932,y:0.02627477703600152},{x:-0.22784197999999933,y:0.030216542867918667},{x:-0.23033151999999935,y:0.03400929910178016},{x:-0.23282105999999936,y:0.03764501096072756},{x:-0.23531059999999937,y:0.04111661189869628},{x:-0.23780013999999938,y:0.04441804716802203},{x:-0.2402896799999994,y:0.04754431114897349},{x:-0.2427792199999994,y:0.05049147821106258},{x:-0.24526875999999942,y:0.053256726915861724},{x:-0.24775829999999943,y:0.05583835741211009},{x:-0.25024783999999944,y:0.05823580191586174},{x:-0.25273737999999946,y:0.060449628211062575},{x:-0.25522691999999947,y:0.0624815361489735},{x:-0.2577164599999995,y:0.06433434716802203},{x:-0.2602059999999995,y:0.06601198689869628},{x:-0.2626955399999995,y:0.06751946096072757},{x:-0.2651850799999995,y:0.06886282410178016},{x:-0.26767461999999953,y:0.07004914286791866},{x:-0.27016415999999954,y:0.0710864520360015},{x:-0.27265369999999955,y:0.07198370507660991},{x:-0.27514323999999957,y:0.07275071895292433},{x:-0.2776327799999996,y:0.07339811359588198},{x:-0.2801223199999996,y:0.07393724642877124},{x:-0.2826118599999996,y:0.07438014234494018},{x:-0.2851013999999996,y:0.07473941957033053},{x:-0.28759093999999963,y:0.07502821186791866},{x:-0.29008047999999964,y:0.07526008756369952},{x:-0.29257001999999965,y:0.07544896589344477},{x:-0.29505955999999967,y:0.07560903118598594},{x:-0.2975490999999997,y:0.07575464541211008},{x:-0.30003863749999965,y:0.07560903118598594},{x:-0.3025281749999997,y:0.07544896589344477},{x:-0.30501771249999965,y:0.07526008756369951},{x:-0.3075072499999996,y:0.07502821186791866},{x:-0.30999678749999965,y:0.07473941957033052},{x:-0.3124863249999996,y:0.07438014234494018},{x:-0.3149758624999996,y:0.07393724642877124},{x:-0.31746539999999956,y:0.07339811359588198},{x:-0.3199549374999996,y:0.07275071895292431},{x:-0.32244447499999956,y:0.07198370507660991},{x:-0.32493401249999954,y:0.0710864520360015},{x:-0.32742354999999956,y:0.07004914286791866},{x:-0.32991308749999954,y:0.06886282410178016},{x:-0.3324026249999995,y:0.06751946096072756},{x:-0.33489216249999954,y:0.06601198689869628},{x:-0.3373816999999995,y:0.06433434716802203},{x:-0.3398712374999995,y:0.06248153614897349},{x:-0.3423607749999995,y:0.06044962821106258},{x:-0.3448503124999994,y:0.05823580191586174},{x:-0.34733984999999945,y:0.05583835741211009},{x:-0.3498293874999995,y:0.053256726915861724},{x:-0.35231892499999945,y:0.050491478211062576},{x:-0.3548084624999994,y:0.0475443111489735},{x:-0.3572979999999994,y:0.04441804716802203},{x:-0.35978753749999937,y:0.04111661189869628},{x:-0.3622770749999994,y:0.03764501096072756},{x:-0.36476661249999937,y:0.03400929910178016},{x:-0.36725614999999934,y:0.030216542867918673},{x:-0.36974568749999936,y:0.02627477703600152},{x:-0.37223522499999934,y:0.022192955076609917},{x:-0.3747247624999993,y:0.017980893952924324},{x:-0.37721429999999934,y:0.013649213595881985},{x:-0.3797038374999993,y:0.00920927142877125},{x:-0.3821933749999993,y:0.004673092344940191},{x:-0.3846829124999993,y:0.00005329457033053514},{x:-0.3871724499999993,y:-0.004636988132081328},{x:-0.38966198749999925,y:-0.009384187436300498},{x:-0.3921515249999992,y:-0.014174384106555197},{x:-0.39464106249999925,y:-0.01899339381401404},{x:-0.3971305999999992,y:-0.023826854587889912}],color:"primary",fill:!1},path8700:{type:"path",points:[{x:0.0011955000000007932,y:-0.02382615458789039},{x:-0.00129403749999919,y:-0.01899269131401453},{x:-0.0037835749999991734,y:-0.014173679106555696},{x:-0.006273112499999156,y:-0.009383479936300985},{x:-0.00876264999999914,y:-0.004636278132081827},{x:-0.011252187499999122,y:0.00005400707033003174},{x:-0.013741724999999105,y:0.004673807344939681},{x:-0.016231262499999087,y:0.009209988928770731},{x:-0.018720799999999073,y:0.013649933595881476},{x:-0.021210337499999055,y:0.017981616452923805},{x:-0.023699874999999038,y:0.022193680076609393},{x:-0.026189412499999024,y:0.026275504536001},{x:-0.028678949999999002,y:0.030217272867918137},{x:-0.03116848749999899,y:0.034010031601779636},{x:-0.03365802499999897,y:0.03764574596072702},{x:-0.03614756249999895,y:0.04111734939869574},{x:-0.03863709999999894,y:0.04441878716802149},{x:-0.04112663749999892,y:0.04754505364897295},{x:-0.043616174999998904,y:0.05049222321106203},{x:-0.04610571249999888,y:0.05325747441586117},{x:-0.04859524999999887,y:0.055839107412109526},{x:-0.051084787499998854,y:0.05823655441586117},{x:-0.05357432499999884,y:0.06045038321106201},{x:-0.05606386249999881,y:0.06248229364897292},{x:-0.0585533999999988,y:0.06433510716802145},{x:-0.061042937499998784,y:0.0660127493986957},{x:-0.06353247499999877,y:0.06752022596072697},{x:-0.06602201249999876,y:0.06886359160177957},{x:-0.06851154999999873,y:0.07004991286791806},{x:-0.07100108749999871,y:0.07108722453600091},{x:-0.0734906249999987,y:0.0719844800766093},{x:-0.07598016249999869,y:0.07275149645292371},{x:-0.07846969999999867,y:0.07339889359588138},{x:-0.08095923749999864,y:0.07393802892877062},{x:-0.08344877499999863,y:0.07438092734493956},{x:-0.08593831249999861,y:0.07474020707032991},{x:-0.0884278499999986,y:0.07502900186791804},{x:-0.09091738749999859,y:0.07526088006369888},{x:-0.09340692499999856,y:0.07544976089344414},{x:-0.09589646249999854,y:0.0756098286859853},{x:-0.09838599999999853,y:0.07575544541210943},{x:-0.10087553999999854,y:0.0756098286859853},{x:-0.10336507999999855,y:0.07544976089344414},{x:-0.10585461999999857,y:0.07526088006369887},{x:-0.10834415999999858,y:0.07502900186791804},{x:-0.11083369999999859,y:0.0747402070703299},{x:-0.1133232399999986,y:0.07438092734493956},{x:-0.11581277999999862,y:0.07393802892877062},{x:-0.11830231999999863,y:0.07339889359588138},{x:-0.12079185999999864,y:0.07275149645292371},{x:-0.12328139999999865,y:0.0719844800766093},{x:-0.12577093999999867,y:0.07108722453600091},{x:-0.12826047999999868,y:0.07004991286791806},{x:-0.1307500199999987,y:0.06886359160177957},{x:-0.1332395599999987,y:0.06752022596072697},{x:-0.13572909999999871,y:0.0660127493986957},{x:-0.13821863999999873,y:0.06433510716802145},{x:-0.14070817999999874,y:0.06248229364897291},{x:-0.14319771999999875,y:0.06045038321106202},{x:-0.14568725999999876,y:0.05823655441586117},{x:-0.14817679999999878,y:0.055839107412109526},{x:-0.1506663399999988,y:0.05325747441586117},{x:-0.1531558799999988,y:0.05049222321106202},{x:-0.1556454199999988,y:0.047545053648972956},{x:-0.15813495999999883,y:0.04441878716802149},{x:-0.16062449999999884,y:0.04111734939869574},{x:-0.16311403999999885,y:0.03764574596072702},{x:-0.16560357999999886,y:0.034010031601779636},{x:-0.16809311999999887,y:0.03021727286791814},{x:-0.1705826599999989,y:0.026275504536001},{x:-0.1730721999999989,y:0.022193680076609396},{x:-0.1755617399999989,y:0.017981616452923805},{x:-0.17805127999999892,y:0.013649933595881474},{x:-0.18054081999999894,y:0.00920998892877074},{x:-0.18303035999999895,y:0.0046738073449396865},{x:-0.18551989999999896,y:0.00005400707033003521},{x:-0.18800943999999897,y:-0.004636278132081827},{x:-0.19049897999999899,y:-0.009383479936300985},{x:-0.192988519999999,y:-0.01417367910655569},{x:-0.19547805999999898,y:-0.018992691314014522},{x:-0.19796759999999902,y:-0.02382615458789039}],color:"primary",fill:!1},path8702:{type:"path",points:[{x:0.2003586000000006,y:-0.02382615458789039},{x:0.19786906000000057,y:-0.01899269131401453},{x:0.19537952000000058,y:-0.014173679106555696},{x:0.19288998000000057,y:-0.009383479936300985},{x:0.1904004400000006,y:-0.004636278132081827},{x:0.18791090000000055,y:0.00005400707033003174},{x:0.1854213600000005,y:0.004673807344939681},{x:0.18293182000000052,y:0.009209988928770731},{x:0.1804422800000005,y:0.013649933595881476},{x:0.17795274000000053,y:0.017981616452923805},{x:0.17546320000000049,y:0.022193680076609393},{x:0.17297366000000047,y:0.026275504536001},{x:0.17048412000000046,y:0.030217272867918137},{x:0.16799458000000045,y:0.034010031601779636},{x:0.16550504000000044,y:0.03764574596072702},{x:0.16301550000000042,y:0.04111734939869574},{x:0.1605259600000004,y:0.04441878716802149},{x:0.1580364200000004,y:0.04754505364897295},{x:0.1555468800000004,y:0.05049222321106203},{x:0.15305734000000037,y:0.05325747441586117},{x:0.15056780000000036,y:0.055839107412109526},{x:0.14807826000000035,y:0.05823655441586117},{x:0.14558872000000034,y:0.06045038321106201},{x:0.14309918000000033,y:0.06248229364897292},{x:0.1406096400000003,y:0.06433510716802145},{x:0.1381201000000003,y:0.0660127493986957},{x:0.1356305600000003,y:0.06752022596072697},{x:0.13314102000000028,y:0.06886359160177957},{x:0.13065148000000026,y:0.07004991286791806},{x:0.12816194000000025,y:0.07108722453600091},{x:0.12567240000000024,y:0.0719844800766093},{x:0.12318286000000023,y:0.07275149645292371},{x:0.12069332000000021,y:0.07339889359588138},{x:0.1182037800000002,y:0.07393802892877062},{x:0.11571424000000019,y:0.07438092734493956},{x:0.11322470000000018,y:0.07474020707032991},{x:0.11073516000000017,y:0.07502900186791804},{x:0.10824562000000015,y:0.07526088006369888},{x:0.10575608000000014,y:0.07544976089344414},{x:0.10326654000000013,y:0.0756098286859853},{x:0.10077700000000012,y:0.07575544541210943},{x:0.09828746250000013,y:0.0756098286859853},{x:0.09579792500000014,y:0.07544976089344414},{x:0.09330838750000017,y:0.07526088006369887},{x:0.09081885000000019,y:0.07502900186791804},{x:0.0883293125000002,y:0.0747402070703299},{x:0.08583977500000022,y:0.07438092734493956},{x:0.08335023750000023,y:0.07393802892877062},{x:0.08086070000000026,y:0.07339889359588138},{x:0.07837116250000027,y:0.07275149645292371},{x:0.07588162500000029,y:0.0719844800766093},{x:0.0733920875000003,y:0.07108722453600091},{x:0.07090255000000031,y:0.07004991286791806},{x:0.06841301250000034,y:0.06886359160177957},{x:0.06592347500000036,y:0.06752022596072697},{x:0.06343393750000037,y:0.0660127493986957},{x:0.060944400000000384,y:0.06433510716802145},{x:0.0584548625000004,y:0.06248229364897291},{x:0.05596532500000043,y:0.06045038321106202},{x:0.05347578750000044,y:0.05823655441586117},{x:0.050986250000000455,y:0.055839107412109526},{x:0.04849671250000047,y:0.05325747441586117},{x:0.04600717500000048,y:0.05049222321106202},{x:0.04351763750000051,y:0.047545053648972956},{x:0.041028100000000525,y:0.04441878716802149},{x:0.03853856250000054,y:0.04111734939869574},{x:0.036049025000000554,y:0.03764574596072702},{x:0.03355948750000057,y:0.034010031601779636},{x:0.031069950000000596,y:0.03021727286791814},{x:0.02858041250000061,y:0.026275504536001},{x:0.026090875000000624,y:0.022193680076609396},{x:0.023601337500000638,y:0.017981616452923805},{x:0.021111800000000652,y:0.013649933595881474},{x:0.01862226250000068,y:0.00920998892877074},{x:0.016132725000000694,y:0.0046738073449396865},{x:0.013643187500000709,y:0.00005400707033003521},{x:0.011153650000000723,y:-0.004636278132081827},{x:0.008664112500000737,y:-0.009383479936300985},{x:0.006174575000000764,y:-0.01417367910655569},{x:0.0036850375000007786,y:-0.018992691314014522},{x:0.0011955000000007932,y:-0.02382615458789039}],color:"primary",fill:!1},path8704:{type:"path",points:[{x:0.3995216000000006,y:-0.02382615458789039},{x:0.39703206250000056,y:-0.01899269131401453},{x:0.3945425250000006,y:-0.014173679106555696},{x:0.3920529875000006,y:-0.009383479936300985},{x:0.38956345000000064,y:-0.004636278132081827},{x:0.38707391250000067,y:0.00005400707033003174},{x:0.3845843750000007,y:0.004673807344939681},{x:0.38209483750000073,y:0.009209988928770731},{x:0.37960530000000076,y:0.013649933595881476},{x:0.3771157625000008,y:0.017981616452923805},{x:0.37462622500000076,y:0.022193680076609393},{x:0.37213668750000073,y:0.026275504536001},{x:0.36964715000000076,y:0.030217272867918137},{x:0.3671576125000008,y:0.034010031601779636},{x:0.3646680750000008,y:0.03764574596072702},{x:0.36217853750000084,y:0.04111734939869574},{x:0.3596890000000008,y:0.04441878716802149},{x:0.3571994625000009,y:0.04754505364897295},{x:0.35470992500000087,y:0.05049222321106203},{x:0.35222038750000095,y:0.05325747441586117},{x:0.3497308500000009,y:0.055839107412109526},{x:0.3472413125000009,y:0.05823655441586117},{x:0.344751775000001,y:0.06045038321106201},{x:0.34226223750000095,y:0.06248229364897292},{x:0.33977270000000104,y:0.06433510716802145},{x:0.337283162500001,y:0.0660127493986957},{x:0.334793625000001,y:0.06752022596072697},{x:0.33230408750000107,y:0.06886359160177957},{x:0.3298145500000011,y:0.07004991286791806},{x:0.32732501250000107,y:0.07108722453600091},{x:0.3248354750000011,y:0.0719844800766093},{x:0.3223459375000011,y:0.07275149645292371},{x:0.3198564000000011,y:0.07339889359588138},{x:0.3173668625000012,y:0.07393802892877062},{x:0.31487732500000115,y:0.07438092734493956},{x:0.3123877875000012,y:0.07474020707032991},{x:0.3098982500000012,y:0.07502900186791804},{x:0.30740871250000124,y:0.07526088006369888},{x:0.30491917500000126,y:0.07544976089344414},{x:0.30242963750000124,y:0.0756098286859853},{x:0.29994010000000126,y:0.07575544541210943},{x:0.29745056000000125,y:0.0756098286859853},{x:0.29496102000000124,y:0.07544976089344414},{x:0.2924714800000012,y:0.07526088006369887},{x:0.2899819400000012,y:0.07502900186791804},{x:0.2874924000000012,y:0.0747402070703299},{x:0.2850028600000012,y:0.07438092734493956},{x:0.2825133200000012,y:0.07393802892877062},{x:0.28002378000000117,y:0.07339889359588138},{x:0.27753424000000115,y:0.07275149645292371},{x:0.27504470000000114,y:0.0719844800766093},{x:0.27255516000000113,y:0.07108722453600091},{x:0.2700656200000011,y:0.07004991286791806},{x:0.2675760800000011,y:0.06886359160177957},{x:0.2650865400000011,y:0.06752022596072697},{x:0.2625970000000011,y:0.0660127493986957},{x:0.26010746000000107,y:0.06433510716802145},{x:0.25761792000000105,y:0.06248229364897291},{x:0.25512838000000104,y:0.06045038321106202},{x:0.25263884000000103,y:0.05823655441586117},{x:0.250149300000001,y:0.055839107412109526},{x:0.247659760000001,y:0.05325747441586117},{x:0.245170220000001,y:0.05049222321106202},{x:0.24268068000000098,y:0.047545053648972956},{x:0.24019114000000097,y:0.04441878716802149},{x:0.23770160000000096,y:0.04111734939869574},{x:0.23521206000000094,y:0.03764574596072702},{x:0.23272252000000093,y:0.034010031601779636},{x:0.23023298000000092,y:0.03021727286791814},{x:0.2277434400000009,y:0.026275504536001},{x:0.2252539000000009,y:0.022193680076609396},{x:0.22276436000000088,y:0.017981616452923805},{x:0.22027482000000087,y:0.013649933595881474},{x:0.21778528000000086,y:0.00920998892877074},{x:0.21529574000000085,y:0.0046738073449396865},{x:0.21280620000000083,y:0.00005400707033003521},{x:0.21031666000000082,y:-0.004636278132081827},{x:0.2078271200000008,y:-0.009383479936300985},{x:0.2053375800000008,y:-0.01417367910655569},{x:0.20284804000000078,y:-0.018992691314014522},{x:0.20035850000000077,y:-0.02382615458789039}],color:"primary",fill:!1},path8706:{type:"path",points:[{x:-0.40026109999999937,y:-0.022544054587890106},{x:-0.5272914999999991,y:-0.022544054587890106}],color:"primary",fill:!1},"path8706-5":{type:"path",points:[{x:0.5282280000000006,y:-0.027111054587890093},{x:0.4011975999999997,y:-0.027111054587890093}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0020145999999989783,y:0.22997364541210996},bottom1:{type:"text",text:"{VAL}",x:-0.002185205294839676,y:-0.22997364541210996}},refblocks:{left1:{x:-0.5279125,y:-0.021272154587890446},right1:{x:0.5279125,y:-0.026521254587889898}},bounds:{minX:-0.556070941,maxX:0.556070941,minY:-0.22997364541210996,maxY:0.22997364541210996,width:1.112141882,height:0.4599472908242199,centerX:0,centerY:0},circles:{}},Ow=F(ts).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right",{x:-0.5,y:0}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:0}).build(),jw=F(ts).rotateRightFacingSymbol("left").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.5}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.5}).build(),$w=F(ts).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Xw=F(ts).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_left").build(),vx={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.06},{x:-0.15,y:-0.06}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:-0.05},{x:-0.13,y:-0.18}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.08},{x:0.13,y:-0.05}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.18},{x:-0.13,y:0.08}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.08},{x:0.13,y:-0.18}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:-0.05},{x:0.54,y:-0.06}],color:"primary",fill:!1},"path25-0-9-8":{type:"path",points:[{x:-0.03,y:0.39},{x:-0.05,y:0.47},{x:-0.08,y:0.39}],color:"primary",fill:!0},"path78-6-5-5":{type:"path",points:[{x:-0.05,y:0.27},{x:-0.05,y:0.29},{x:-0.05,y:0.41},{x:-0.05,y:0.42}],color:"primary",fill:!1},"path25-0-9-8-2":{type:"path",points:[{x:0.07,y:0.39},{x:0.04,y:0.47},{x:0.02,y:0.39}],color:"primary",fill:!0},"path78-6-5-5-7":{type:"path",points:[{x:0.04,y:0.27},{x:0.04,y:0.29},{x:0.04,y:0.41},{x:0.04,y:0.42}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:0.03,y:0.06},{x:0.03,y:-0.16}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.38,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.38,y:-0.47}},refblocks:{left1:{x:-0.54,y:-0.06},right1:{x:0.54,y:-0.06}},bounds:{minX:-0.57,maxX:0.57,minY:-0.47,maxY:0.47,width:1.14,height:0.93,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.05,radius:0.29,color:"primary",fill:!1}}};vx.bounds.width+=0.2;var es=F(vx).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),xp=z(es,"down"),bp=xp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),vp=xp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");bp.anchor="middle_left";vp.anchor="middle_left";bp.y+=0.9;bp.x=0.3;vp.y-=0.1;vp.x=0.3;var Vw=xp,Sp=z(es,"left"),wp=Sp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ap=Sp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");wp.anchor="middle_left";Ap.anchor="middle_left";wp.y+=0.71;wp.x=0.44;Ap.y-=0.71;Ap.x=0.44;var zw=Sp,Bp=z(es,"up"),Fp=Bp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Pp=Bp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Fp.anchor="middle_left";Pp.anchor="middle_left";Fp.y+=0.1;Fp.x=0.3;Pp.y-=0.71;Pp.x=0.3;var Dw=Bp,Uw={paths:{path45:{type:"path",points:[{x:0.14,y:0},{x:-0.13,y:-0.14}],color:"primary",fill:!1},"path1-8":{type:"path",points:[{x:0.13,y:0},{x:0.54,y:0}],color:"primary",fill:!1},path46:{type:"path",points:[{x:-0.13,y:0.13},{x:0.14,y:0}],color:"primary",fill:!1},path47:{type:"path",points:[{x:-0.13,y:-0.14},{x:-0.13,y:0.13}],color:"primary",fill:!1},path48:{type:"path",points:[{x:0.14,y:0.13},{x:0.14,y:-0.14}],color:"primary",fill:!1},path49:{type:"path",points:[{x:-0.13,y:0},{x:-0.54,y:0}],color:"primary",fill:!1},path25:{type:"path",points:[{x:0.16,y:0.29},{x:0.25,y:0.3},{x:0.22,y:0.21}],color:"primary",fill:!0},path78:{type:"path",points:[{x:0.08,y:0.17},{x:0.09,y:0.17},{x:0.21,y:0.27},{x:0.21,y:0.27}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:-0.02,y:0.31},{x:0.08,y:0.32},{x:0.04,y:0.23}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:-0.1,y:0.19},{x:-0.09,y:0.2},{x:0.04,y:0.29},{x:0.04,y:0.29}],color:"primary",fill:!1}},texts:{bottom1:{type:"text",text:"{VAL}",x:0,y:-0.21},right1:{type:"text",text:"{REF}",x:0,y:0.41}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.32,maxY:0.32,width:1.13,height:0.65,centerX:0,centerY:0},circles:{}},{paths:Gw,texts:q_,bounds:$o,refblocks:tg,circles:Hw}=Uw,Ip=It({primitives:[...Object.values(Gw),...Object.values(Hw),{...q_.bottom1,anchor:"middle_top"},{...q_.right1,anchor:"middle_bottom"}],ports:[{...tg.left1,labels:["1"]},{...tg.right1,labels:["2"]}],size:{width:$o.width,height:$o.height},center:{x:$o.centerX,y:$o.centerY}}),Mp=z(Ip,"up"),kp=Mp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Cp=Mp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");kp.anchor="middle_left";Cp.anchor="middle_left";kp.y+=0.21;kp.x=0.21;Cp.y-=0.21;Cp.x=0.21;var Sx=Mp,Yp=ei(Sx),Lp=Yp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ep=Yp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Lp.anchor="middle_left";Ep.anchor="middle_left";Lp.y+=0.4;Lp.x=0.2;Ep.y-=0.41;Ep.x=0.2;var Qw=Yp,Zw=ri(Ip),Kw={paths:{path11:{type:"path",points:[{x:-0.52,y:-0.01},{x:-0.18,y:-0.01}],color:"primary",fill:!1},"path11-2":{type:"path",points:[{x:-0.17,y:-0.11},{x:-0.17,y:0.08}],color:"primary",fill:!1},"path11-5":{type:"path",points:[{x:-0.17,y:-0.12},{x:0.16,y:-0.12}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:-0.17,y:0.08},{x:0.16,y:0.08}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.17,y:-0.01},{x:0.52,y:-0.01}],color:"primary",fill:!1},"path11-2-1":{type:"path",points:[{x:0.16,y:-0.12},{x:0.16,y:0.08}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:-0.4,y:-0.21},{x:-0.33,y:-0.18},{x:-0.34,y:-0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:-0.45,y:-0.34},{x:-0.44,y:-0.32},{x:-0.35,y:-0.22},{x:-0.35,y:-0.22}],color:"primary",fill:!1},"path25-0-9-0":{type:"path",points:[{x:-0.3,y:-0.34},{x:-0.22,y:-0.31},{x:-0.24,y:-0.4}],color:"primary",fill:!0},"path78-6-5-9":{type:"path",points:[{x:-0.35,y:-0.46},{x:-0.34,y:-0.45},{x:-0.25,y:-0.35},{x:-0.25,y:-0.35}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.17,y:-0.41},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.46}},refblocks:{left1:{x:-0.52,y:-0.01},right1:{x:0.52,y:-0.01}},bounds:{minX:-0.55,maxX:0.55,minY:-0.51,maxY:0.46,width:1.1,height:0.62,centerX:0,centerY:-0.02},circles:{path1:{type:"circle",x:0,y:-0.02,radius:0.28,color:"primary",fill:!1}}},{paths:Jw,texts:eg,bounds:Xo,refblocks:rg,circles:qw}=Kw,wx=It({primitives:[...Object.values(Jw),...Object.values(qw),{...eg.top1,anchor:"middle_left",x:0},{...eg.bottom1,anchor:"middle_left",x:0}],ports:[{...rg.left1,labels:["1"]},{...rg.right1,labels:["2"]}],size:{width:Xo.width,height:Xo.height},center:{x:Xo.centerX,y:Xo.centerY}}),Ax=z(wx),Bx=Ax.primitives.filter((t)=>t.type==="text"),Tp=Bx.find((t)=>t.text==="{VAL}");Tp.x=-0.35;Tp.y=0;Tp.anchor="middle_right";var Np=Bx.find((t)=>t.text==="{REF}");Np.y=0;Np.x=0.35;Np.anchor="middle_left";var t8=Ax,e8={paths:{path208:{type:"path",points:[{x:0.38,y:0.13},{x:0.52,y:-0.13}],color:"primary",fill:!1},path209:{type:"path",points:[{x:0.25,y:-0.13},{x:0.38,y:0.13}],color:"primary",fill:!1},path210:{type:"path",points:[{x:0.52,y:-0.13},{x:0.25,y:-0.13}],color:"primary",fill:!1},path211:{type:"path",points:[{x:0.25,y:0.13},{x:0.52,y:0.13}],color:"primary",fill:!1},path212:{type:"path",points:[{x:0.12,y:-0.4},{x:0.38,y:-0.4}],color:"primary",fill:!1},path213:{type:"path",points:[{x:0.38,y:0.4},{x:0.12,y:0.4}],color:"primary",fill:!1},path214:{type:"path",points:[{x:0.12,y:0.54},{x:0.12,y:0.18}],color:"primary",fill:!1},path215:{type:"path",points:[{x:0.12,y:-0.54},{x:0.12,y:0}],color:"primary",fill:!1},path216:{type:"path",points:[{x:0.38,y:-0.4},{x:0.38,y:0.4}],color:"primary",fill:!1},path217:{type:"path",points:[{x:-0.14,y:0.26},{x:-0.14,y:-0.27}],color:"primary",fill:!1},path218:{type:"path",points:[{x:-0.22,y:-0.27},{x:-0.22,y:0.26}],color:"primary",fill:!1},path219:{type:"path",points:[{x:-0.54,y:-0.27},{x:-0.22,y:-0.27}],color:"primary",fill:!1},path220:{type:"path",points:[{x:-0.14,y:-0.19},{x:0.12,y:-0.19}],color:"primary",fill:!1},path221:{type:"path",points:[{x:-0.14,y:0.18},{x:0.12,y:0.18}],color:"primary",fill:!1},path222:{type:"path",points:[{x:-0.07,y:0},{x:0.12,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{VAL}",x:0.57,y:0.02},right2:{type:"text",text:"{REF}",x:0.57,y:0.21}},refblocks:{top1:{x:0.12,y:0.54},bottom1:{x:0.12,y:-0.54},left1:{x:-0.54,y:-0.27}},bounds:{minX:-0.57,maxX:0.57,minY:-0.57,maxY:0.57,width:1.14,height:1.14,centerX:0,centerY:0},circles:{}};function nn(t,e){return{width:Math.max(...e.map((r)=>Math.abs(r.x-t.x)))*2,height:Math.max(...e.map((r)=>Math.abs(r.y-t.y)))*2}}var{paths:r8,texts:ig,bounds:ng,refblocks:Kr}=e8,og={x:ng.centerX+0.2,y:ng.centerY},Fx=It({primitives:[...Object.values(r8),{...ig.right1,anchor:"middle_left"},{...ig.right2,anchor:"middle_left"}],ports:[{...Kr.top1,labels:["1"]},{...Kr.bottom1,labels:["2"]},{...Kr.left1,labels:["3"]}],size:nn(og,[Kr.top1,Kr.bottom1,Kr.left1]),center:og}),Wp=z(Fx),Px=Wp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Rp=Wp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Px.anchor="middle_top";Rp.anchor="middle_top";Px.x=Rp.x;Rp.y+=0.15;var i8=Wp,n8={paths:{"path12-1-8-6-9":{type:"path",points:[{x:0.01,y:0.07},{x:0.01,y:-0.01}],color:"primary",fill:!1},"path12-1-5-6":{type:"path",points:[{x:-0.47,y:-0.09},{x:-0.17,y:-0.09}],color:"primary",fill:!1},"path12-1-8-0":{type:"path",points:[{x:-0.16,y:-0.01},{x:0.17,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.2,y:-0.09},{x:0.47,y:-0.09}],color:"primary",fill:!1},path2:{type:"path",points:[{x:-0.1,y:0.06},{x:-0.1,y:0.06},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.07},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.08},{x:-0.1,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.09},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.1},{x:-0.09,y:0.11},{x:-0.09,y:0.11},{x:-0.08,y:0.11},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.08,y:0.12},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.07,y:0.13},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.06,y:0.14},{x:-0.05,y:0.14},{x:-0.05,y:0.15},{x:-0.05,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.04,y:0.15},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.03,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.02,y:0.16},{x:-0.01,y:0.16},{x:-0.01,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.01,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.02,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.03,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.04,y:0.16},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.05,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.15},{x:0.06,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.07,y:0.14},{x:0.08,y:0.14},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.08,y:0.13},{x:0.09,y:0.13},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.09,y:0.12},{x:0.1,y:0.11},{x:0.1,y:0.11},{x:0.1,y:0.1},{x:0.1,y:0.1},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.09},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.08},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.07},{x:0.11,y:0.06},{x:0.11,y:0.06},{x:0.1,y:0.06},{x:0.1,y:0.06},{x:0.09,y:0.06},{x:0.09,y:0.06},{x:0.08,y:0.06},{x:0.07,y:0.06},{x:0.07,y:0.06},{x:0.06,y:0.06},{x:0.05,y:0.06},{x:0.05,y:0.06},{x:0.04,y:0.06},{x:0.03,y:0.06},{x:0.03,y:0.06},{x:0.02,y:0.06},{x:0.01,y:0.06},{x:0.01,y:0.06},{x:0,y:0.06},{x:-0.01,y:0.06},{x:-0.01,y:0.06},{x:-0.02,y:0.06},{x:-0.03,y:0.06},{x:-0.03,y:0.06},{x:-0.04,y:0.06},{x:-0.05,y:0.06},{x:-0.05,y:0.06},{x:-0.06,y:0.06},{x:-0.07,y:0.06},{x:-0.07,y:0.06},{x:-0.08,y:0.06},{x:-0.09,y:0.06},{x:-0.09,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.27}},refblocks:{left1:{x:-0.47,y:-0.09},right1:{x:0.47,y:-0.09}},bounds:{minX:-0.5,maxX:0.5,minY:-0.27,maxY:0.27,width:1,height:0.53,centerX:0,centerY:0},circles:{}},{paths:o8,texts:ag,bounds:Vo,refblocks:sg,circles:a8}=n8,Ix=It({primitives:[...Object.values(o8),...Object.values(a8),{...ag.top1,anchor:"middle_bottom",x:0},{...ag.bottom1,anchor:"middle_top",x:0}],ports:[{...sg.left1,labels:["1"]},{...sg.right1,labels:["2"]}],size:{width:Vo.width,height:Vo.height},center:{x:Vo.centerX+0.006,y:Vo.centerY+0.06}}),Op=z(Ix),qi=Op.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),La=Op.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");qi.anchor="middle_left";La.anchor="middle_right";qi.x=qi.x-0.03;qi.y=qi.y;La.x=La.x;La.y=0;var s8=Op,kt=({horizontalSymbol:t,verticalSymbol:e,gateSide:r,drainSide:i})=>{let n=r==="left"||r==="right",a=i==="left"||i==="right";if(n===a)throw Error(`Invalid MOSFET orientation: gate ${r}, drain ${i}. Gate and drain must be perpendicular.`);let o=n?t:e;return(r==="right"||a&&i==="left")&&(o=ri(o)),(r==="bottom"||!a&&i==="bottom")&&(o=ei(o)),o},c8={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:l8,texts:cg,bounds:lg,refblocks:dr,circles:p8}=c8,Mx={x:lg.centerX,y:lg.centerY},h8={x:Mx.x,y:dr.left1.y},fe=It({primitives:[...Object.values(l8),...Object.values(p8),{...cg.top1,anchor:"middle_right",x:0},{...cg.bottom1,anchor:"middle_right",x:0}],ports:[{...dr.top1,labels:["1","drain"]},{...dr.bottom1,labels:["2","source"]},{...dr.left1,labels:["3","gate"]}],size:nn(Mx,[dr.top1,dr.bottom1,dr.left1]),center:h8}),kx=z(fe),Cx=kx.primitives.filter((t)=>t.type==="text"),jp=Cx.find((t)=>t.text==="{VAL}");jp.x=-0.35;jp.y=0;jp.anchor="middle_right";var $p=Cx.find((t)=>t.text==="{REF}");$p.y=0;$p.x=0.35;$p.anchor="middle_left";var Ce=kx,d8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"bottom",drainSide:"left"}),m8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"bottom",drainSide:"right"}),u8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"left",drainSide:"bottom"}),y8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"left",drainSide:"top"}),f8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"right",drainSide:"bottom"}),_8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"right",drainSide:"top"}),g8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"top",drainSide:"left"}),x8=kt({horizontalSymbol:fe,verticalSymbol:Ce,gateSide:"top",drainSide:"right"}),b8={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.27,y:-0.04},{x:0.27,y:0.03},{x:0.2,y:0},{x:0.27,y:-0.04}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:v8,texts:pg,bounds:hg,refblocks:Jr,circles:S8}=b8,dg={x:hg.centerX,y:hg.centerY},_e=It({primitives:[...Object.values(v8),...Object.values(S8),{...pg.top1,anchor:"middle_right",x:0},{...pg.bottom1,anchor:"middle_right",x:0}],ports:[{...Jr.top1,labels:["1","drain"]},{...Jr.bottom1,labels:["2","source"]},{...Jr.left1,labels:["3","gate"]}],size:nn(dg,[Jr.top1,Jr.bottom1,Jr.left1]),center:dg}),Yx=z(_e),Lx=Yx.primitives.filter((t)=>t.type==="text"),Xp=Lx.find((t)=>t.text==="{VAL}");Xp.x=-0.35;Xp.y=0;Xp.anchor="middle_right";var Vp=Lx.find((t)=>t.text==="{REF}");Vp.y=0;Vp.x=0.35;Vp.anchor="middle_left";var Ye=Yx,w8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"bottom",drainSide:"left"}),A8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"bottom",drainSide:"right"}),B8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"left",drainSide:"bottom"}),F8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"left",drainSide:"top"}),P8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"right",drainSide:"bottom"}),I8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"right",drainSide:"top"}),M8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"top",drainSide:"left"}),k8=kt({horizontalSymbol:_e,verticalSymbol:Ye,gateSide:"top",drainSide:"right"}),C8={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.07},{x:0.01,y:0},{x:-0.08,y:0.06}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:Y8,texts:mg,bounds:zo,refblocks:Qc,circles:L8}=C8,Ex=It({primitives:[...Object.values(Y8),...Object.values(L8),{...mg.top1,anchor:"middle_right",x:0},{...mg.bottom1,anchor:"middle_right",x:0}],ports:[{...Qc.top1,labels:["1","drain"]},{...Qc.bottom1,labels:["2","source"]},{...Qc.left1,labels:["3","gate"]}],size:{width:zo.width,height:zo.height},center:{x:zo.centerX,y:zo.centerY}}),Tx=z(Ex),Nx=Tx.primitives.filter((t)=>t.type==="text"),zp=Nx.find((t)=>t.text==="{VAL}");zp.x=-0.35;zp.y=0;zp.anchor="middle_right";var Dp=Nx.find((t)=>t.text==="{REF}");Dp.y=0;Dp.x=0.35;Dp.anchor="middle_left";var E8=Tx,T8={paths:{diag1:{type:"path",points:[{x:-0.1,y:-0.1},{x:0.1,y:0.1}],color:"primary",fill:!1},diag2:{type:"path",points:[{x:-0.1,y:0.1},{x:0.1,y:-0.1}],color:"primary",fill:!1},stem:{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1}},texts:{},refblocks:{left1:{x:-0.2,y:0}},bounds:{minX:-0.19,maxX:0.2,minY:-0.12,maxY:0.12,width:0.39,height:0.24,centerX:0,centerY:0},circles:{}},{paths:N8,bounds:ug,refblocks:W8}=T8,rs=F({primitives:[...Object.values(N8)],ports:[{...W8.left1,labels:["1"]}],center:{x:ug.centerX,y:ug.centerY}}).rotateRightFacingSymbol("right").labelPort("left1",["1"]).build(),R8=z(rs,"down"),O8=z(rs,"left"),j8=z(rs,"up"),hi={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.19,y:-0.1},{x:0.12,y:-0.2},{x:0.22,y:-0.2},{x:0.19,y:-0.1}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.36},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:$8,texts:pz,bounds:Do,refblocks:Zc,circles:X8}=hi,V8=F({primitives:[...Object.values($8),...Object.values(X8),{type:"text",text:"{REF}",x:-0.3,y:0.5094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.5094553499999995}],ports:[{...Zc.top1,labels:["1","collector"]},{...Zc.bottom1,labels:["3","emitter"]},{...Zc.left1,labels:["2","base"]}],size:{width:Do.width,height:Do.height},center:{x:Do.centerX,y:Do.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:z8,texts:hz,bounds:Uo,refblocks:Kc,circles:D8}=hi,U8=F({primitives:[...Object.values(z8),...Object.values(D8),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...Kc.top1,labels:["1","collector"]},{...Kc.bottom1,labels:["3","emitter"]},{...Kc.left1,labels:["2","base"]}],size:{width:Uo.width,height:Uo.height},center:{x:Uo.centerX,y:Uo.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:G8,texts:dz,bounds:Go,refblocks:Jc,circles:H8}=hi,Q8=F({primitives:[...Object.values(G8),...Object.values(H8),{type:"text",text:"{REF}",x:-0.5,y:0.3094553499999995},{type:"text",text:"{VAL}",x:0.55,y:0.3094553499999995}],ports:[{...Jc.top1,labels:["1","collector"]},{...Jc.bottom1,labels:["3","emitter"]},{...Jc.left1,labels:["2","base"]}],size:{width:Go.width,height:Go.height},center:{x:Go.centerX,y:Go.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:Z8,texts:mz,bounds:Ho,refblocks:qc,circles:K8}=hi,J8=F({primitives:[...Object.values(Z8),...Object.values(K8),{type:"text",text:"{REF}",x:0.55,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.4094553499999995}],ports:[{...qc.top1,labels:["1","collector"]},{...qc.bottom1,labels:["3","emitter"]},{...qc.left1,labels:["2","base"]}],size:{width:Ho.width,height:Ho.height},center:{x:Ho.centerX,y:Ho.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:q8,texts:uz,bounds:Qo,refblocks:tl,circles:tA}=hi,eA=F({primitives:[...Object.values(q8),...Object.values(tA),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...tl.top1,labels:["1","collector"]},{...tl.bottom1,labels:["3","emitter"]},{...tl.left1,labels:["2","base"]}],size:{width:Qo.width,height:Qo.height},center:{x:Qo.centerX,y:Qo.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:rA,texts:yz,bounds:Zo,refblocks:el,circles:iA}=hi,nA=F({primitives:[...Object.values(rA),...Object.values(iA),{type:"text",text:"{REF}",x:-0.3,y:-0.4094553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.4094553499999995}],ports:[{...el.top1,labels:["1","collector"]},{...el.bottom1,labels:["3","emitter"]},{...el.left1,labels:["2","base"]}],size:{width:Zo.width,height:Zo.height},center:{x:Zo.centerX,y:Zo.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),oA={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.3}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},is=F(oA).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["3","out"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),aA=z(is,"down"),sA=ei(z(is,"left")),cA=z(is,"up"),lA={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.32,y:-0.21}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.32,y:0.31},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.32,y:-0.21},{x:-0.32,y:0.31}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.18},{x:-0.57,y:0.18}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.32,y:-0.09},{x:-0.57,y:-0.09}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.43,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path44-1":{type:"path",points:[{x:-0.1,y:0.44},{x:-0.1,y:0.18}],color:"primary",fill:!1},"path44-2":{type:"path",points:[{x:-0.09,y:-0.34},{x:-0.09,y:-0.09}],color:"primary",fill:!1},"rect1577-3":{type:"path",points:[{x:-0.19,y:0.18},{x:-0.27,y:0.18}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.19,y:-0.09},{x:-0.27,y:-0.09}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.23,y:0.14},{x:-0.23,y:0.22}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.25,y:0.32},bottom1:{type:"text",text:"{VAL}",x:0.25,y:-0.24}},refblocks:{left1:{x:-0.57,y:0.18},left2:{x:-0.57,y:-0.09},right1:{x:0.43,y:0.04},top2:{x:-0.1,y:0.44},bottom1:{x:-0.09,y:-0.34}},bounds:{minX:-0.57,maxX:0.43,minY:-0.38,maxY:0.27,width:1.09,height:0.3,centerX:-0.07,centerY:0.05},circles:{}},ns=F(lA).labelPort("left1",["1","inp1"]).labelPort("left2",["2","inp2"]).labelPort("right1",["4","out"]).labelPort("top2",["5","V+"]).labelPort("bottom1",["3","V-"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),pA=z(ns,"down"),hA=ei(z(ns,"left")),dA=z(ns,"up"),mA={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.09,y:0.19},{x:0.09,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.17},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}};var{paths:uA,texts:yg,bounds:fg,refblocks:qr,circles:yA}=mA,_g={x:fg.centerX,y:fg.centerY},ge=It({primitives:[...Object.values(uA),...Object.values(yA),{...yg.top1,anchor:"middle_right",x:0},{...yg.bottom1,anchor:"middle_right",x:0}],ports:[{...qr.top1,labels:["1","drain"]},{...qr.bottom1,labels:["2","source"]},{...qr.left1,labels:["3","gate"]}],size:nn(_g,[qr.top1,qr.bottom1,qr.left1]),center:_g}),Wx=z(ge),Rx=Wx.primitives.filter((t)=>t.type==="text"),Up=Rx.find((t)=>t.text==="{VAL}");Up.x=-0.35;Up.y=0;Up.anchor="middle_right";var Gp=Rx.find((t)=>t.text==="{REF}");Gp.y=0;Gp.x=0.35;Gp.anchor="middle_left";var Le=Wx,fA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"bottom",drainSide:"left"}),_A=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"bottom",drainSide:"right"}),gA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"left",drainSide:"bottom"}),xA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"left",drainSide:"top"}),bA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"right",drainSide:"bottom"}),vA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"right",drainSide:"top"}),SA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"top",drainSide:"left"}),wA=kt({horizontalSymbol:ge,verticalSymbol:Le,gateSide:"top",drainSide:"right"}),AA={paths:{path11:{type:"path",points:[{x:-0.42,y:-0.1},{x:0.05,y:-0.11}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.3,y:0.55},{x:0.3,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.31,y:-0.55},{x:0.31,y:-0.01}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.09,y:0.11},{x:0.31,y:0.11}],color:"primary",fill:!1},"path2-8-3-7":{type:"path",points:[{x:0.09,y:0.15},{x:0.09,y:0.07}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.09,y:-0.1},{x:0.31,y:-0.1}],color:"primary",fill:!1},"path2-8-3":{type:"path",points:[{x:0.09,y:-0.08},{x:0.09,y:-0.15}],color:"primary",fill:!1},"path2-8-3-2":{type:"path",points:[{x:0.09,y:0.03},{x:0.09,y:-0.04}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.2,y:0.03},{x:0.2,y:-0.04},{x:0.27,y:-0.01},{x:0.2,y:0.03}],color:"primary",fill:!0},"path2-0":{type:"path",points:[{x:0.09,y:0},{x:0.31,y:-0.01}],color:"primary",fill:!1},"path12-1-0":{type:"path",points:[{x:0.05,y:0.11},{x:0.05,y:-0.11}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.13,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.06,y:-0.42}},refblocks:{top1:{x:0.3,y:0.55},bottom1:{x:0.31,y:-0.55},left1:{x:-0.42,y:-0.1}},bounds:{minX:-0.45,maxX:0.45,minY:-0.58,maxY:0.58,width:0.89,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.16,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:BA,texts:gg,bounds:xg,refblocks:ti,circles:FA}=AA,bg={x:xg.centerX,y:xg.centerY},xe=It({primitives:[...Object.values(BA),...Object.values(FA),{...gg.top1,anchor:"middle_right",x:0},{...gg.bottom1,anchor:"middle_right",x:0}],ports:[{...ti.top1,labels:["1","drain"]},{...ti.bottom1,labels:["2","source"]},{...ti.left1,labels:["3","gate"]}],size:nn(bg,[ti.top1,ti.bottom1,ti.left1]),center:bg}),Ox=z(xe),jx=Ox.primitives.filter((t)=>t.type==="text"),Hp=jx.find((t)=>t.text==="{VAL}");Hp.x=-0.35;Hp.y=0;Hp.anchor="middle_right";var Qp=jx.find((t)=>t.text==="{REF}");Qp.y=0;Qp.x=0.35;Qp.anchor="middle_left";var Ee=Ox,PA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"bottom",drainSide:"left"}),IA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"bottom",drainSide:"right"}),MA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"left",drainSide:"bottom"}),kA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"left",drainSide:"top"}),CA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"right",drainSide:"bottom"}),YA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"right",drainSide:"top"}),LA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"top",drainSide:"left"}),EA=kt({horizontalSymbol:xe,verticalSymbol:Ee,gateSide:"top",drainSide:"right"}),TA={paths:{path11:{type:"path",points:[{x:-0.54,y:-0.01},{x:-0.15,y:-0.02}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.13,y:0},{x:-0.13,y:-0.13}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.13,y:0.13},{x:0.13,y:0}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.13,y:-0.13},{x:-0.13,y:0.13}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.13,y:0.13},{x:0.13,y:-0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.14,y:0},{x:0.54,y:-0.01}],color:"primary",fill:!1},"path25-0":{type:"path",points:[{x:0.2,y:0.38},{x:0.16,y:0.28},{x:0.26,y:0.3}],color:"primary",fill:!0},"path78-6":{type:"path",points:[{x:0.33,y:0.43},{x:0.32,y:0.42},{x:0.21,y:0.31},{x:0.21,y:0.31}],color:"primary",fill:!1},"path25-0-9":{type:"path",points:[{x:0.35,y:0.35},{x:0.31,y:0.26},{x:0.41,y:0.27}],color:"primary",fill:!0},"path78-6-5":{type:"path",points:[{x:0.48,y:0.4},{x:0.47,y:0.39},{x:0.35,y:0.29},{x:0.35,y:0.29}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.1,y:0.35},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.43}},refblocks:{left1:{x:-0.54,y:-0.01},right1:{x:0.54,y:-0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.43,maxY:0.43,width:1.14,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:-0.01,radius:0.29,color:"primary",fill:!1}}},$x=F(TA).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Xx=z($x),NA=Xx.primitives.filter((t)=>t.type==="text"),Vx=NA.find((t)=>t.text==="{REF}");Vx.y=0;Vx.anchor="middle_left";var WA=Xx,RA={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},path40:{type:"path",points:[{x:0.07,y:0.19},{x:0.07,y:-0.18}],color:"primary",fill:!1},"path12-1":{type:"path",points:[{x:0.28,y:0.55},{x:0.28,y:0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.1}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.11},{x:0.29,y:0.11}],color:"primary",fill:!1},"path2-5":{type:"path",points:[{x:0.07,y:-0.1},{x:0.29,y:-0.1}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.01,y:-0.07},{x:0.01,y:0.06},{x:-0.08,y:0},{x:0.01,y:-0.07}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.15,y:0.36},bottom1:{type:"text",text:"{VAL}",x:0.04,y:-0.42}},refblocks:{top1:{x:0.28,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:OA,texts:vg,bounds:Ko,refblocks:rl,circles:jA}=RA,zx=It({primitives:[...Object.values(OA),...Object.values(jA),{...vg.top1,anchor:"middle_right",x:0},{...vg.bottom1,anchor:"middle_right"}],ports:[{...rl.top1,labels:["1","drain"]},{...rl.bottom1,labels:["2","source"]},{...rl.left1,labels:["3","gate"]}],size:{width:Ko.width,height:Ko.height},center:{x:Ko.centerX,y:Ko.centerY}}),Dx=z(zx),Ux=Dx.primitives.filter((t)=>t.type==="text"),Zp=Ux.find((t)=>t.text==="{VAL}");Zp.x=-0.35;Zp.y=0;Zp.anchor="middle_right";var Kp=Ux.find((t)=>t.text==="{REF}");Kp.y=0;Kp.x=0.35;Kp.anchor="middle_left";var $A=Dx,mr={paths:{path11:{type:"path",points:[{x:-0.4,y:0},{x:0.06,y:-0.01}],color:"primary",fill:!1},"path40-0":{type:"path",points:[{x:0.07,y:0.27},{x:0.07,y:-0.28}],color:"primary",fill:!1},"path40-0-5":{type:"path",points:[{x:0.28,y:0.24},{x:0.08,y:0.11}],color:"primary",fill:!1},"path40-0-5-0":{type:"path",points:[{x:0.29,y:-0.24},{x:0.09,y:-0.11}],color:"primary",fill:!1},"path12-1-5":{type:"path",points:[{x:0.29,y:0.25},{x:0.29,y:0.55}],color:"primary",fill:!1},"path12-1-5-3":{type:"path",points:[{x:0.29,y:-0.55},{x:0.29,y:-0.25}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0.15,y:-0.23},{x:0.22,y:-0.12},{x:0.12,y:-0.12},{x:0.15,y:-0.23}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.08,y:0.37},bottom1:{type:"text",text:"{VAL}",x:-0.07,y:-0.41}},refblocks:{top1:{x:0.29,y:0.55},bottom1:{x:0.29,y:-0.55},left1:{x:-0.4,y:0}},bounds:{minX:-0.43,maxX:0.43,minY:-0.58,maxY:0.58,width:0.85,height:1.16,centerX:0,centerY:0},circles:{"path1-0":{type:"circle",x:0.14,y:0,radius:0.29,color:"primary",fill:!1}}},{paths:XA,texts:fz,bounds:Jo,refblocks:il,circles:VA}=mr,zA=F({primitives:[...Object.values(XA),...Object.values(VA),{type:"text",text:"{REF}",x:-0.1,y:0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:-0.3094553499999995}],ports:[{...il.top1,labels:["1","collector"]},{...il.bottom1,labels:["3","emitter"]},{...il.left1,labels:["2","base"]}],size:{width:Jo.width,height:Jo.height},center:{x:Jo.centerX,y:Jo.centerY}}).rotateRightFacingSymbol("right").changeTextAnchor("{REF}","middle_right").changeTextAnchor("{VAL}","middle_right").build(),{paths:_z,texts:gz,bounds:xz,refblocks:bz,circles:vz}=mr,DA=F(mr).rotateRightFacingSymbol("up").changeTextAnchor("{VAL}","middle_left").labelPort("left1",["2","base"]).labelPort("top1",["1","collector"]).labelPort("bottom1",["3","emitter"]).changeTextAnchor("{REF}","middle_right").build(),{paths:UA,texts:Sz,bounds:qo,refblocks:nl,circles:GA}=mr,HA=F({primitives:[...Object.values(UA),...Object.values(GA),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...nl.top1,labels:["1","collector"]},{...nl.bottom1,labels:["3","emitter"]},{...nl.left1,labels:["2","base"]}],size:{width:qo.width,height:qo.height},center:{x:qo.centerX,y:qo.centerY}}).rotateRightFacingSymbol("down").changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_bottom").build(),{paths:QA,texts:wz,bounds:ta,refblocks:ol,circles:ZA}=mr,KA=F({primitives:[...Object.values(QA),...Object.values(ZA),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...ol.top1,labels:["1","collector"]},{...ol.bottom1,labels:["3","emitter"]},{...ol.left1,labels:["2","base"]}],size:{width:ta.width,height:ta.height},center:{x:ta.centerX,y:ta.centerY}}).rotateRightFacingSymbol("up").changeTextAnchor("{REF}","middle_top").changeTextAnchor("{VAL}","middle_top").build(),{paths:JA,texts:Az,bounds:ea,refblocks:al,circles:qA}=mr,t6=F({primitives:[...Object.values(JA),...Object.values(qA),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...al.top1,labels:["1","collector"]},{...al.bottom1,labels:["3","emitter"]},{...al.left1,labels:["2","base"]}],size:{width:ea.width,height:ea.height},center:{x:ea.centerX,y:ea.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:e6,texts:Bz,bounds:ra,refblocks:sl,circles:r6}=mr,i6=F({primitives:[...Object.values(e6),...Object.values(r6),{type:"text",text:"{REF}",x:-0.1,y:-0.3094553499999995},{type:"text",text:"{VAL}",x:-0.1,y:0.3094553499999995}],ports:[{...sl.top1,labels:["1","collector"]},{...sl.bottom1,labels:["3","emitter"]},{...sl.left1,labels:["2","base"]}],size:{width:ra.width,height:ra.height},center:{x:ra.centerX,y:ra.centerY}}).rotateRightFacingSymbol("left").changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),n6={paths:{path40:{type:"path",points:[{x:-0.19,y:0.33},{x:-0.26,y:0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:0.26},{x:-0.19,y:0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:0.14},{x:-0.38,y:0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:0.39},{x:-0.13,y:0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:0.52},{x:-0.19,y:0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:-0.32},{x:-0.38,y:-0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:-0.13},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.26,y:-0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:-0.26},{x:-0.26,y:-0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:-0.19},{x:-0.51,y:-0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:-0.5},{x:-0.19,y:-0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:0.19},{x:0.13,y:0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:0.38},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:0.26},{x:0.26,y:0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:0.26},{x:0.26,y:0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:0.32},{x:0.01,y:0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:-0.19},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:-0.26},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:-0.38},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:-0.13},{x:0.39,y:-0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:-0.32},{x:0,y:-0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:-0.01},{x:0.32,y:-0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:-0.5}},refblocks:{top1:{x:0,y:0.52},bottom1:{x:0,y:-0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.55,maxY:0.55,width:1.09,height:1.09,centerX:0,centerY:0},circles:{}},{paths:o6,texts:Sg,bounds:ia,refblocks:wg}=n6,Gx=It({primitives:[...Object.values(o6),{...Sg.bottom1,y:0.35,anchor:"middle_top"},{...Sg.top1,anchor:"middle_left"}],ports:[{...wg.left1,labels:["1"]},{...wg.right1,labels:["2"]}],size:{width:ia.width+0.05,height:ia.height},center:{x:ia.centerX,y:ia.centerY}}),a6=z(Gx),s6=a6,c6={paths:{path18:{type:"path",points:[{x:-0.53,y:0},{x:-0.27,y:0}],color:"primary",fill:!1},path19:{type:"path",points:[{x:0.26,y:0},{x:0.53,y:0}],color:"primary",fill:!1},path20:{type:"path",points:[{x:0,y:0.13},{x:0.26,y:0.13},{x:0.26,y:-0.13},{x:-0.27,y:-0.13},{x:-0.27,y:0.13},{x:0,y:0.13}],color:"primary",fill:!1},path24:{type:"path",points:[{x:0.29,y:-0.29},{x:0.26,y:-0.16},{x:0.16,y:-0.26},{x:0.29,y:-0.29}],color:"primary",fill:!0},path26:{type:"path",points:[{x:-0.3,y:0.29},{x:0.2,y:-0.2}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.06,y:0.2},bottom1:{type:"text",text:"{VAL}",x:-0.1,y:-0.28}},refblocks:{left1:{x:-0.53,y:0},right1:{x:0.53,y:0}},bounds:{minX:-0.56,maxX:0.56,minY:-0.29,maxY:0.29,width:1.13,height:0.58,centerX:0,centerY:0},circles:{}},{paths:l6,texts:Ag,bounds:na,refblocks:Bg}=c6,os=It({primitives:[...Object.values(l6),{...Ag.bottom1,x:0,y:-0.35,anchor:"middle_top"},{...Ag.top1,x:0,y:0.35,anchor:"middle_bottom"}],ports:[{...Bg.left1,labels:["1"]},{...Bg.right1,labels:["2"]}],size:{width:na.width+0.05,height:na.height},center:{x:na.centerX,y:na.centerY}}),Jp=z(os,"down"),qp=Jp.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),th=Jp.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");qp.anchor="middle_left";th.anchor="middle_left";qp.y+=0.31;qp.x=0.34;th.y-=0.31;th.x=0.34;var p6=Jp,eh=z(os,"left"),rh=eh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ih=eh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");rh.anchor="middle_bottom";ih.anchor="middle_top";rh.y+=0.73;rh.x=0;ih.y-=0.7;ih.x=0;var h6=eh,nh=z(os,"up"),oh=nh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ah=nh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");oh.anchor="middle_left";ah.anchor="middle_left";oh.y+=0.21;oh.x=0.34;ah.y-=0.21;ah.x=0.34;var d6=nh,as={paths:{path1:{type:"path",points:[{x:-0.42,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},"path1-2-1":{type:"path",points:[{x:-0.3,y:0},{x:-0.25,y:0.1},{x:-0.15,y:-0.1},{x:-0.05,y:0.1},{x:0.05,y:-0.1},{x:0.15,y:0.1},{x:0.25,y:-0.1},{x:0.3,y:0}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.3,y:0},{x:0.42,y:0}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0,y:-0.17},{x:0,y:-0.4}],color:"primary",fill:!1},path15:{type:"path",points:[{x:0,y:-0.12},{x:0.05,y:-0.2},{x:-0.05,y:-0.2},{x:0,y:-0.12}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:0.3,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.3,y:-0.25}},refblocks:{left:{x:-0.42,y:0},right:{x:0.42,y:0},bottom:{x:0,y:-0.4}},bounds:{minX:-0.42,maxX:0.42,minY:-0.2,maxY:0.2,width:0.84,height:0.4,centerX:0,centerY:0},circles:{}},{paths:m6,texts:Fz,bounds:oa,refblocks:cl,circles:u6}=as,y6=F({primitives:[...Object.values(m6),...Object.values(u6),{type:"text",text:"{REF}",x:-0.15,y:0.2394553499999995},{type:"text",text:"{VAL}",x:0.15,y:0.2394553499999995}],ports:[{...cl.left,labels:["1"]},{...cl.right,labels:["3"]},{...cl.bottom,labels:["2"]}],size:{width:oa.width,height:oa.height},center:{x:oa.centerX,y:oa.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:f6,texts:Pz,bounds:aa,refblocks:ll,circles:_6}=as,g6=F({primitives:[...Object.values(f6),...Object.values(_6),{type:"text",text:"{REF}",x:-0.3,y:-0.3894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:0.3194553499999995}],ports:[{...ll.left,labels:["1"]},{...ll.right,labels:["3"]},{...ll.bottom,labels:["2"]}],size:{width:aa.width,height:aa.height},center:{x:aa.centerX,y:aa.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),x6=F(as).labelPort("left",["1"]).labelPort("right",["3"]).labelPort("bottom",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:b6,texts:Iz,bounds:sa,refblocks:pl,circles:v6}=as,S6=F({primitives:[...Object.values(b6),...Object.values(v6),{type:"text",text:"{REF}",x:0.3,y:-0.2894553499999995},{type:"text",text:"{VAL}",x:-0.3,y:-0.2894553499999995}],ports:[{...pl.left,labels:["1"]},{...pl.right,labels:["3"]},{...pl.bottom,labels:["2"]}],size:{width:sa.width,height:sa.height},center:{x:sa.centerX,y:sa.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).labelPort("bottom",["3"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),w6={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.16,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4},left1:{type:"text",text:"COS φ",x:-0.15,y:0.01}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.79,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:A6,texts:Mz,bounds:ca,refblocks:Fg,circles:B6}=w6,Hx=It({primitives:[...Object.values(A6),...Object.values(B6),{type:"text",text:"{REF}",x:0,y:0.43330070000000065,anchor:"middle_bottom"},{type:"text",text:"{VAL}",x:0,y:-0.43330070000000065,anchor:"middle_top"},{type:"text",text:"COS φ",x:0,y:0.014279000000000375,anchor:"center"}],ports:[{...Fg.left1,labels:["1"]},{...Fg.right1,labels:["2"]}],size:{width:ca.width,height:ca.height},center:{x:ca.centerX,y:ca.centerY}}),Qx=z(Hx),sh=Qx.primitives.filter((t)=>t.type==="text"),xl=sh.find((t)=>t.text==="{REF}"),ch=sh.find((t)=>t.text==="{VAL}"),bl=sh.find((t)=>t.text==="COS φ");xl.x=0.35;xl.y=0.4279000000000375,xl.anchor="middle_left";ch.anchor="middle_left";ch.x=0.35;ch.y=-0.4279000000000375,bl.x=0;bl.y=0.014279000000000375,bl.anchor="center";var F6=Qx,P6={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:0.01,y:0.03},{x:0.01,y:-0.09}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:-0.09},{x:0.18,y:-0.09}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.22},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:I6,texts:Pg,bounds:Ig,refblocks:Mg,circles:M6}=P6,Zx=It({primitives:[...Object.values(I6),...Object.values(M6),{...Pg.top1,anchor:"middle_left"},{...Pg.bottom1,anchor:"middle_left"}],ports:[{...Mg.left1,labels:["1"]},{...Mg.right1,labels:["2"]}],center:{x:Ig.centerX,y:Ig.centerY}}),k6=z(Zx,"up"),Kx={paths:{"path12-1-8-6-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:-0.05,y:0.04}],color:"primary",fill:!1},"path12-1-8-7-9-9":{type:"path",points:[{x:-0.05,y:0.09},{x:0.07,y:0.09}],color:"primary",fill:!1},"path12-1-8-6-9-10":{type:"path",points:[{x:0.07,y:0.09},{x:0.07,y:0.04}],color:"primary",fill:!1},"path12-1-5-6-4":{type:"path",points:[{x:-0.47,y:-0.05},{x:-0.17,y:-0.05}],color:"primary",fill:!1},"path12-1-8-0-0":{type:"path",points:[{x:-0.16,y:0.04},{x:0.18,y:0.04}],color:"primary",fill:!1},"path12-1-0-1":{type:"path",points:[{x:0.2,y:-0.05},{x:0.47,y:-0.05}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.29},bottom1:{type:"text",text:"{VAL}",x:-0.16,y:-0.22}},refblocks:{left1:{x:-0.47,y:-0.05},right1:{x:0.47,y:-0.05}},bounds:{minX:-0.5,maxX:0.5,minY:-0.22,maxY:0.22,width:1,height:0.45,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:-0.14,y:-0.05,radius:0.02,color:"primary",fill:!1},circle:{type:"circle",x:0.17,y:-0.05,radius:0.02,color:"primary",fill:!1}}},{paths:C6,texts:kg,bounds:Y6,refblocks:hl,circles:L6}=Kx,on=It({primitives:[...Object.values(C6),...Object.values(L6),{...kg.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...kg.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...hl.left1,labels:["1"]},{...hl.right1,labels:["2"]}],center:{x:Y6.centerX,y:hl.left1.y}}),lh=z(on,"down"),ph=lh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),hh=lh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");ph.anchor="middle_bottom";hh.anchor="middle_top";ph.y=0.4;ph.x=0.35;hh.y=-0.4;hh.x=0.35;var E6=lh,{paths:T6,texts:Cg,bounds:N6,refblocks:dl,circles:W6}=Kx,R6=It({primitives:[...Object.values(T6),...Object.values(W6),{...Cg.top1,x:0,y:0.3594553499999995,anchor:"middle_bottom"},{...Cg.bottom1,x:0,y:-0.3594553499999995,anchor:"middle_top"}],ports:[{...dl.left1,labels:["1"]},{...dl.right1,labels:["2"]}],center:{x:N6.centerX,y:dl.left1.y}}),dh=z(on,"left"),mh=dh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),uh=dh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");mh.anchor="middle_bottom";uh.anchor="middle_top";mh.y=0.4;mh.x=0;uh.y=-0.4;uh.x=0;var O6=dh,yh=z(on,"up"),fh=yh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),_h=yh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");fh.anchor="middle_left";_h.anchor="middle_left";fh.y+=0.4;fh.x=0.34;_h.y-=0.41;_h.x=0.34;var j6=yh,gh=z(on,"up"),xh=gh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),bh=gh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");xh.anchor="middle_left";bh.anchor="middle_left";xh.y+=0.4;xh.x=0.34;bh.y-=0.41;bh.x=0.34;var $6=gh,ss={paths:{path12_rotated:{type:"path",points:[{x:-0.09,y:0.12},{x:-0.09,y:-0.12}],color:"primary",fill:!1},path2_rotated:{type:"path",points:[{x:-0.09,y:0},{x:0.09,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.03}},refblocks:{left1:{x:0.09,y:0}},bounds:{minX:-0.57,maxX:0.57,minY:-0.37,maxY:0.37,width:1.14,height:0.74,centerX:0,centerY:0},circles:{}},{paths:X6,texts:kz,bounds:Yg,refblocks:V6,circles:z6}=ss,D6=F({primitives:[...Object.values(X6),...Object.values(z6),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...V6.left1,labels:["1"]}],center:{x:Yg.centerX,y:Yg.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),{paths:U6,texts:Cz,bounds:Lg,refblocks:G6,circles:H6}=ss,Q6=F({primitives:[...Object.values(U6),...Object.values(H6),{type:"text",text:"{REF}",x:-0.13,y:0}],ports:[{...G6.left1,labels:["1"]}],center:{x:Lg.centerX,y:Lg.centerY}}).changeTextAnchor("{VAL}","middle_top").rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),{paths:Z6,texts:Yz,bounds:Eg,refblocks:K6,circles:J6}=ss,q6=F({primitives:[...Object.values(Z6),...Object.values(J6),{type:"text",text:"{REF}",x:-0.14,y:-0}],ports:[{...K6.left1,labels:["1"]}],center:{x:Eg.centerX,y:Eg.centerY}}).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),{paths:tB,texts:Lz,bounds:Tg,refblocks:eB}=ss,rB=F({primitives:[...Object.values(tB),{type:"text",text:"{REF}",x:-0.14,y:0}],ports:[{...eB.left1,labels:["1"]}],center:{x:Tg.centerX,y:Tg.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),iB={paths:{path40:{type:"path",points:[{x:-0.19,y:-0.33},{x:-0.26,y:-0.14}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.38,y:-0.26},{x:-0.19,y:-0.33}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.26,y:-0.14},{x:-0.38,y:-0.26}],color:"primary",fill:!1},path43:{type:"path",points:[{x:-0.26,y:-0.39},{x:-0.13,y:-0.26}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.32,y:-0.2},{x:-0.52,y:0}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0,y:-0.52},{x:-0.19,y:-0.33}],color:"primary",fill:!1},"path40-4":{type:"path",points:[{x:-0.19,y:0.32},{x:-0.38,y:0.26}],color:"primary",fill:!1},"path41-1":{type:"path",points:[{x:-0.26,y:0.13},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path42-7":{type:"path",points:[{x:-0.38,y:0.26},{x:-0.26,y:0.13}],color:"primary",fill:!1},"path43-1":{type:"path",points:[{x:-0.13,y:0.26},{x:-0.26,y:0.39}],color:"primary",fill:!1},"path44-8":{type:"path",points:[{x:-0.32,y:0.19},{x:-0.51,y:0.01}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:-0.01,y:0.5},{x:-0.19,y:0.32}],color:"primary",fill:!1},"path40-4-0":{type:"path",points:[{x:0.32,y:-0.19},{x:0.13,y:-0.26}],color:"primary",fill:!1},"path41-1-2":{type:"path",points:[{x:0.26,y:-0.38},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path42-7-1":{type:"path",points:[{x:0.13,y:-0.26},{x:0.26,y:-0.38}],color:"primary",fill:!1},"path43-1-8":{type:"path",points:[{x:0.39,y:-0.26},{x:0.26,y:-0.13}],color:"primary",fill:!1},"path44-8-7":{type:"path",points:[{x:0.2,y:-0.32},{x:0.01,y:-0.51}],color:"primary",fill:!1},"path44-0-7-1":{type:"path",points:[{x:0.52,y:0},{x:0.32,y:-0.19}],color:"primary",fill:!1},"path40-4-8":{type:"path",points:[{x:0.32,y:0.19},{x:0.26,y:0.38}],color:"primary",fill:!1},"path41-1-4":{type:"path",points:[{x:0.13,y:0.26},{x:0.32,y:0.19}],color:"primary",fill:!1},"path42-7-0":{type:"path",points:[{x:0.26,y:0.38},{x:0.13,y:0.26}],color:"primary",fill:!1},"path43-1-0":{type:"path",points:[{x:0.26,y:0.13},{x:0.39,y:0.26}],color:"primary",fill:!1},"path44-8-9":{type:"path",points:[{x:0.19,y:0.32},{x:0,y:0.52}],color:"primary",fill:!1},"path44-0-7-3":{type:"path",points:[{x:0.5,y:0.01},{x:0.32,y:0.19}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.29,y:-0.46},bottom1:{type:"text",text:"{VAL}",x:-0.29,y:0.5}},refblocks:{top1:{x:0,y:-0.52},bottom1:{x:0,y:0.52},left1:{x:-0.52,y:0},right1:{x:0.52,y:0}},bounds:{minX:-0.55,maxX:0.55,minY:-0.56,maxY:0.55,width:1.09,height:1.1,centerX:0,centerY:0},circles:{}},{paths:nB,texts:Ng,bounds:la,refblocks:pa,circles:oB}=iB,Jx=It({primitives:[...Object.values(nB),...Object.values(oB),{...Ng.top1,anchor:"middle_right"},{...Ng.bottom1,anchor:"middle_right"}],ports:[{...pa.top1,labels:["1"]},{...pa.bottom1,labels:["2"]},{...pa.left1,labels:["3"]},{...pa.right1,labels:["4"]}],size:{width:la.width,height:la.height},center:{x:la.centerX,y:la.centerY}}),vh=z(Jx),aB=vh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),sB=vh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");aB.anchor="middle_left";sB.anchor="middle_right";var cB=vh,cs={paths:{path27:{type:"path",points:[{x:0.47,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path27-0":{type:"path",points:[{x:-0.21,y:0.04},{x:-0.47,y:0.04}],color:"primary",fill:!1},"path27-8-2-4":{type:"path",points:[{x:0.21,y:0.04},{x:0.19,y:-0.05}],color:"primary",fill:!1},"path27-8-2-4-29":{type:"path",points:[{x:-0.19,y:0.14},{x:-0.21,y:0.04}],color:"primary",fill:!1},"path27-8-2-4-5":{type:"path",points:[{x:0.19,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1":{type:"path",points:[{x:0.08,y:-0.05},{x:0.13,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9":{type:"path",points:[{x:0.08,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2":{type:"path",points:[{x:-0.03,y:-0.05},{x:0.03,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1":{type:"path",points:[{x:-0.03,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.08,y:0.14}],color:"primary",fill:!1},"path27-8-2-4-5-1-9-2-1-2-2":{type:"path",points:[{x:-0.13,y:-0.05},{x:-0.19,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.05,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.04,y:-0.42}},refblocks:{left1:{x:-0.47,y:0.04},right1:{x:0.47,y:0.04}},bounds:{minX:-0.49,maxX:0.49,minY:-0.42,maxY:0.42,width:0.99,height:0.84,centerX:0,centerY:0},circles:{}},{paths:lB,texts:Ez,bounds:ha,refblocks:Wg,circles:pB}=cs,hB=F({primitives:[...Object.values(lB),...Object.values(pB),{type:"text",text:"{REF}",x:-0.2,y:0.2194553499999995},{type:"text",text:"{VAL}",x:0.2,y:0.2194553499999995}],ports:[{...Wg.left1,labels:["1"]},{...Wg.right1,labels:["2"]}],size:{width:ha.width,height:ha.height},center:{x:ha.centerX,y:ha.centerY}}).rotateRightFacingSymbol("down").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:dB,texts:Tz,bounds:da,refblocks:Rg,circles:mB}=cs,uB=F({primitives:[...Object.values(dB),...Object.values(mB),{type:"text",text:"{REF}",x:0,y:-0.1704553499999995},{type:"text",text:"{VAL}",x:0,y:0.2294553499999995}],ports:[{...Rg.left1,labels:["1"]},{...Rg.right1,labels:["2"]}],size:{width:da.width,height:da.height},center:{x:da.centerX,y:da.centerY}}).rotateRightFacingSymbol("left").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),{paths:yB,texts:Nz,bounds:ma,refblocks:Og,circles:fB}=cs,_B=F({primitives:[...Object.values(yB),...Object.values(fB),{type:"text",text:"{REF}",x:0,y:0.2294553499999995},{type:"text",text:"{VAL}",x:0,y:-0.1704553499999995}],ports:[{...Og.left1,labels:["1"]},{...Og.right1,labels:["2"]}],size:{width:ma.width,height:ma.height},center:{x:ma.centerX,y:ma.centerY}}).rotateRightFacingSymbol("right").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),ls={paths:{"left-lead":{type:"path",points:[{x:-0.25,y:0},{x:-0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.16,y:0},{x:-0.12,y:0.095},{x:-0.07,y:-0.095},{x:-0.02,y:0.095},{x:0.02,y:-0.095},{x:0.07,y:0.095},{x:0.12,y:-0.095},{x:0.16,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.16,y:0},{x:0.25,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.25,y:0},right1:{x:0.25,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.25,maxY:0.25,width:0.5,height:0.5,centerX:0,centerY:0},circles:{}},gB=Nt(ls,{kind:"resistor",orientation:"down"}),xB=Nt(ls,{kind:"resistor",orientation:"left"}),bB=Nt(ls,{kind:"resistor",orientation:"right"}),vB=Nt(ls,{kind:"resistor",orientation:"up"}),{paths:SB,texts:Wz,bounds:ua,refblocks:jg,circles:wB}=cs,AB=F({primitives:[...Object.values(SB),...Object.values(wB),{type:"text",text:"{REF}",x:0.2,y:-0.1404553499999995},{type:"text",text:"{VAL}",x:-0.2,y:-0.1494553499999995}],ports:[{...jg.left1,labels:["1"]},{...jg.right1,labels:["2"]}],size:{width:ua.width,height:ua.height},center:{x:ua.centerX,y:ua.centerY}}).rotateRightFacingSymbol("up").labelPort("left",["1"]).labelPort("right",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ps={paths:{"left-lead":{type:"path",points:[{x:-0.175,y:0},{x:-0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},zigzag:{type:"path",points:[{x:-0.115,y:0},{x:-0.07,y:0.095},{x:-0.025,y:-0.095},{x:0.025,y:0.095},{x:0.07,y:-0.095},{x:0.115,y:0}],color:"primary",fill:!1,strokeWidth:0.02},"right-lead":{type:"path",points:[{x:0.115,y:0},{x:0.175,y:0}],color:"primary",fill:!1,strokeWidth:0.02}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25,anchor:"middle_bottom"},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25,anchor:"middle_top"}},refblocks:{left1:{x:-0.175,y:0},right1:{x:0.175,y:0}},bounds:{minX:-0.175,maxX:0.175,minY:-0.25,maxY:0.25,width:0.35,height:0.5,centerX:0,centerY:0},circles:{}},BB=Nt(ps,{kind:"resistor",orientation:"down"}),FB=Nt(ps,{kind:"resistor",orientation:"left"}),PB=Nt(ps,{kind:"resistor",orientation:"right"}),IB=Nt(ps,{kind:"resistor",orientation:"up"}),qx={paths:{path27:{type:"path",points:[{x:0.76,y:-0.28},{x:0.31,y:-0.28}],color:"primary",fill:!1},path28:{type:"path",points:[{x:-0.3,y:-0.02},{x:-0.77,y:-0.02}],color:"primary",fill:!1},path30:{type:"path",points:[{x:-0.3,y:0.35},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path27-3":{type:"path",points:[{x:0.77,y:0.35},{x:0.32,y:0.35}],color:"primary",fill:!1},"path29-5":{type:"path",points:[{x:-0.07,y:-0.28},{x:-0.3,y:-0.28}],color:"primary",fill:!1},"path29-5-7":{type:"path",points:[{x:0.33,y:-0.28},{x:0.11,y:-0.28}],color:"primary",fill:!1},"path29-5-7-6":{type:"path",points:[{x:-0.06,y:-0.17},{x:-0.06,y:-0.39}],color:"primary",fill:!1},"path29-5-7-6-6":{type:"path",points:[{x:0.09,y:-0.17},{x:0.09,y:-0.39}],color:"primary",fill:!1},"path29-5-9":{type:"path",points:[{x:-0.07,y:0.35},{x:-0.3,y:0.35}],color:"primary",fill:!1},"path29-5-7-2":{type:"path",points:[{x:0.33,y:0.35},{x:0.11,y:0.35}],color:"primary",fill:!1},"path29-5-7-6-0":{type:"path",points:[{x:-0.06,y:0.46},{x:-0.06,y:0.24}],color:"primary",fill:!1},"path29-5-7-6-6-2":{type:"path",points:[{x:0.09,y:0.46},{x:0.09,y:0.24}],color:"primary",fill:!1},"path29-5-92":{type:"path",points:[{x:0.33,y:0.13},{x:0.33,y:0.35}],color:"primary",fill:!1},"path29-5-7-28":{type:"path",points:[{x:0.33,y:-0.28},{x:0.33,y:-0.05}],color:"primary",fill:!1},"path29-5-7-6-9":{type:"path",points:[{x:0.44,y:0.11},{x:0.22,y:0.11}],color:"primary",fill:!1},"path29-5-7-6-6-7":{type:"path",points:[{x:0.44,y:-0.04},{x:0.22,y:-0.04}],color:"primary",fill:!1},"path29-5-7-6-9-2":{type:"path",points:[{x:0.44,y:0.07},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4":{type:"path",points:[{x:0.44,y:0},{x:0.44,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-4-6":{type:"path",points:[{x:0.22,y:0},{x:0.22,y:0.07}],color:"primary",fill:!1},"path29-5-7-6-9-2-9":{type:"path",points:[{x:0.44,y:0},{x:0.22,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.02,y:0.53},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.54}},refblocks:{left1:{x:-0.77,y:-0.02},right1:{x:0.76,y:-0.28},right2:{x:0.77,y:0.35}},bounds:{minX:-0.79,maxX:0.79,minY:-0.54,maxY:0.54,width:1.59,height:1.07,centerX:0,centerY:0},circles:{}},{paths:MB,texts:$g,bounds:ya,refblocks:ml,circles:kB}=qx,hs=It({primitives:[...Object.values(MB),...Object.values(kB),{...$g.top1,anchor:"middle_bottom"},{...$g.bottom1,anchor:"middle_top"}],ports:[{...ml.left1,labels:["1"]},{...ml.right1,labels:["2"]},{...ml.right2,labels:["3"]}],size:{width:ya.width,height:ya.height},center:{x:ya.centerX,y:ya.centerY}}),Sh=z(hs,"down"),wh=Sh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ah=Sh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");wh.anchor="middle_bottom";Ah.anchor="middle_top";wh.y+=0.3;wh.x+=0.101;Ah.y-=0.49999;Ah.x+=1.19999;var CB=Sh,{paths:YB,texts:Rz,bounds:fa,refblocks:ul,circles:LB}=qx,tb=It({primitives:[...Object.values(YB),...Object.values(LB),{type:"text",text:"{REF}",x:0.01596175000000022,y:-0.5308501500000009,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0.013116750000000454,y:0.5408501499999989,anchor:"middle_bottom"}],ports:[{...ul.left1,labels:["1"]},{...ul.right1,labels:["2"]},{...ul.right2,labels:["3"]}],size:{width:fa.width,height:fa.height},center:{x:fa.centerX,y:fa.centerY}}),Bh=z(hs,"left"),Fh=Bh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ph=Bh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Fh.anchor="middle_bottom";Ph.anchor="middle_top";Fh.y+=0.99;Fh.x-=0;Ph.y-=1.10999;Ph.x=0;var EB=Bh,Ih=z(hs,"up"),Mh=Ih.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),kh=Ih.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Mh.anchor="middle_bottom";kh.anchor="middle_top";Mh.y+=0.499;Mh.x=0.62;kh.y-=0.29999;kh.x+=0.1;var TB=Ih,NB=z(tb),WB={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-7":{type:"path",points:[{x:0.21,y:0.18},{x:0.14,y:0.18}],color:"primary",fill:!1},"path43-7-9":{type:"path",points:[{x:0.21,y:0.13},{x:0.21,y:0.18}],color:"primary",fill:!1},"path43-7-2":{type:"path",points:[{x:0.08,y:-0.09},{x:0.14,y:-0.09}],color:"primary",fill:!1},"path43-7-9-3":{type:"path",points:[{x:0.08,y:-0.04},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},ds=F(WB).labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_top").changeTextAnchor("{REF}","middle_bottom").build(),Ch=z(ds,"down"),Yh=Ch.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Lh=Ch.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Yh.anchor="middle_left";Lh.anchor="middle_left";Yh.y+=0.3;Yh.x=0.3;Lh.y-=0.3;Lh.x=0.3;var RB=Ch,Eh=z(ds,"left"),Th=Eh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Nh=Eh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Th.anchor="middle_bottom";Nh.anchor="middle_top";Th.y+=0.5;Th.x=0;Nh.y-=0.55;Nh.x=0;var OB=Eh,Wh=z(ds,"up"),Rh=Wh.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Oh=Wh.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Rh.anchor="middle_left";Oh.anchor="middle_left";Rh.y+=0.3;Rh.x=0.3;Oh.y-=0.3;Oh.x=0.3;var jB=Wh,eb={paths:{path11:{type:"path",points:[{x:-0.52,y:0.04},{x:-0.18,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.19,y:0.05},{x:0.52,y:0.05}],color:"primary",fill:!1},"path12-6":{type:"path",points:[{x:0.18,y:-0.15},{x:0.18,y:0.25}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.19,y:0},{x:0.35,y:-0.14}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.35,y:-0.14},{x:0.34,y:-0.35}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.17,y:0.27},{x:-0.17,y:-0.15},{x:0.18,y:0.05},{x:-0.17,y:0.27}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.22,y:0.38},bottom1:{type:"text",text:"{VAL}",x:0.11,y:-0.38}},refblocks:{bottom1:{x:0.34,y:-0.35},left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.05}},bounds:{minX:-0.55,maxX:0.55,minY:-0.38,maxY:0.38,width:1.09,height:0.77,centerX:0,centerY:0},circles:{}},{paths:Oz,texts:jz,bounds:$z,refblocks:Xz,circles:Vz}=eb,rb=F(eb).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),ib=z(rb),$B=ib.primitives.filter((t)=>t.type==="text"),nb=$B.find((t)=>t.text==="{REF}");nb.y=0;nb.anchor="middle_left";var XB=ib,ob={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.07,y:-0.025},{x:-0.07,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.4458008,y:-0.025023700000000426},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},VB=F(ob).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),jh=F(ob).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),ab=z(jh,"left"),$h=ab.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");$h.anchor="middle_bottom";$h.y+=0.4;$h.x=0;var zB=ab,sb=z(jh,"up"),Xh=sb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Xh.anchor="middle_left";Xh.y+=0;Xh.x=0.2;var DB=sb,cb={paths:{path44:{type:"path",points:[{x:-0.195,y:-0.025},{x:-0.45,y:-0.025}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:-0.025},{x:0.195,y:-0.025}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.07,y:0.1},{x:0.07,y:-0.15}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.07,y:-0.15}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.07,y:0.1},{x:-0.082252,y:0.099398},{x:-0.094386,y:0.097598},{x:-0.106286,y:0.094618},{x:-0.117835,y:0.090485},{x:-0.128925,y:0.08524},{x:-0.139446,y:0.078934},{x:-0.149299,y:0.071626},{x:-0.158388,y:0.063388},{x:-0.166626,y:0.054299},{x:-0.173934,y:0.044446},{x:-0.18024,y:0.033925},{x:-0.185485,y:0.022835},{x:-0.189618,y:0.011286},{x:-0.192598,y:-0.000614},{x:-0.194398,y:-0.012748},{x:-0.195,y:-0.025},{x:-0.194398,y:-0.037252},{x:-0.192598,y:-0.049386},{x:-0.189618,y:-0.061286},{x:-0.185485,y:-0.072835},{x:-0.18024,y:-0.083925},{x:-0.173934,y:-0.094446},{x:-0.166626,y:-0.104299},{x:-0.158388,y:-0.113388},{x:-0.149299,y:-0.121626},{x:-0.139446,y:-0.128934},{x:-0.128925,y:-0.13524},{x:-0.117835,y:-0.140485},{x:-0.106286,y:-0.144618},{x:-0.094386,y:-0.147598},{x:-0.082252,y:-0.149398},{x:-0.07,y:-0.15}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.07,y:0.1},{x:0.082252,y:0.099398},{x:0.094386,y:0.097598},{x:0.106286,y:0.094618},{x:0.117835,y:0.090485},{x:0.128925,y:0.08524},{x:0.139446,y:0.078934},{x:0.149299,y:0.071626},{x:0.158388,y:0.063388},{x:0.166626,y:0.054299},{x:0.173934,y:0.044446},{x:0.18024,y:0.033925},{x:0.185485,y:0.022835},{x:0.189618,y:0.011286},{x:0.192598,y:-0.000614},{x:0.194398,y:-0.012748},{x:0.195,y:-0.025},{x:0.194398,y:-0.037252},{x:0.192598,y:-0.049386},{x:0.189618,y:-0.061286},{x:0.185485,y:-0.072835},{x:0.18024,y:-0.083925},{x:0.173934,y:-0.094446},{x:0.166626,y:-0.104299},{x:0.158388,y:-0.113388},{x:0.149299,y:-0.121626},{x:0.139446,y:-0.128934},{x:0.128925,y:-0.13524},{x:0.117835,y:-0.140485},{x:0.106286,y:-0.144618},{x:0.094386,y:-0.147598},{x:0.082252,y:-0.149398},{x:0.07,y:-0.15}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.15414649999999952}},refblocks:{left1:{x:-0.44,y:-0.02},right1:{x:0.4458008,y:-0.02514810000000045}},bounds:{minX:-0.45,maxX:0.45,minY:-0.15,maxY:0.1,width:0.9,height:0.25,centerX:0,centerY:-0.025},circles:{}},UB=F(cb).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").build(),Vh=F(cb).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),lb=z(Vh,"left"),zh=lb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");zh.anchor="middle_bottom";zh.y+=0.4;zh.x=0;var GB=lb,pb=z(Vh,"up"),Dh=pb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Dh.anchor="middle_left";Dh.y+=0.05;Dh.x=0.2;var HB=pb,hb={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},QB=F(hb).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),Uh=F(hb).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),db=z(Uh,"left"),Gh=db.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Gh.anchor="middle_left";Gh.y+=0.5;Gh.x=0.2;var ZB=db,mb=z(Uh,"up"),Hh=mb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Hh.anchor="middle_left";Hh.y+=0.3;Hh.x=0.2;var KB=mb,ub={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},path1:{type:"path",points:[{x:-0.045,y:0.1},{x:-0.125,y:0.1}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},JB=F(ub).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),Qh=F(ub).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),yb=z(Qh,"left"),Zh=yb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Zh.anchor="middle_left";Zh.y+=0.5;Zh.x=0.2;var qB=yb,fb=z(Qh,"up"),Kh=fb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Kh.anchor="middle_left";Kh.y+=0.4;Kh.x=0.2;var t7=fb,_b={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1},"path44-0-7":{type:"path",points:[{x:0.125,y:0.1},{x:0.045,y:0.1}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.28}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},e7=F(_b).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),Jh=F(_b).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),gb=z(Jh,"left"),qh=gb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");qh.anchor="middle_left";qh.y+=0.6;qh.x=0.3;var r7=gb,xb=z(Jh,"up"),td=xb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");td.anchor="middle_left";td.y+=0.4;td.x=0.2;var i7=xb,bb={paths:{path44:{type:"path",points:[{x:-0.25,y:0.1},{x:-0.45,y:0.1}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.45,y:0.1},{x:0.25,y:0.1}],color:"primary",fill:!1},"path44-5":{type:"path",points:[{x:0,y:-0.025},{x:0,y:-0.275}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.125,y:0.225},{x:0.125,y:-0.025}],color:"primary",fill:!0},"path2-88":{type:"path",points:[{x:0.045,y:0.225},{x:0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5":{type:"path",points:[{x:-0.045,y:0.225},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-88-5-1":{type:"path",points:[{x:0.045,y:0.225},{x:-0.045,y:0.225}],color:"primary",fill:!0},"path2-88-5-1-6":{type:"path",points:[{x:0.045,y:-0.025},{x:-0.045,y:-0.025}],color:"primary",fill:!0},"path2-8":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.125,y:-0.025}],color:"primary",fill:!0},"path8704-1":{type:"path",points:[{x:-0.125,y:0.225},{x:-0.137252,y:0.224398},{x:-0.149386,y:0.222598},{x:-0.161286,y:0.219618},{x:-0.172835,y:0.215485},{x:-0.183925,y:0.21024},{x:-0.194446,y:0.203934},{x:-0.204299,y:0.196626},{x:-0.213388,y:0.188388},{x:-0.221626,y:0.179299},{x:-0.228934,y:0.169446},{x:-0.23524,y:0.158925},{x:-0.240485,y:0.147835},{x:-0.244618,y:0.136286},{x:-0.247598,y:0.124386},{x:-0.249398,y:0.112252},{x:-0.25,y:0.1},{x:-0.249398,y:0.087748},{x:-0.247598,y:0.075614},{x:-0.244618,y:0.063714},{x:-0.240485,y:0.052165},{x:-0.23524,y:0.041075},{x:-0.228934,y:0.030554},{x:-0.221626,y:0.020701},{x:-0.213388,y:0.011612},{x:-0.204299,y:0.003374},{x:-0.194446,y:-0.003934},{x:-0.183925,y:-0.01024},{x:-0.172835,y:-0.015485},{x:-0.161286,y:-0.019618},{x:-0.149386,y:-0.022598},{x:-0.137252,y:-0.024398},{x:-0.125,y:-0.025}],color:"primary",fill:!1},"path8704-1-7":{type:"path",points:[{x:0.125,y:0.225},{x:0.137252,y:0.224398},{x:0.149386,y:0.222598},{x:0.161286,y:0.219618},{x:0.172835,y:0.215485},{x:0.183925,y:0.21024},{x:0.194446,y:0.203934},{x:0.204299,y:0.196626},{x:0.213388,y:0.188388},{x:0.221626,y:0.179299},{x:0.228934,y:0.169446},{x:0.23524,y:0.158925},{x:0.240485,y:0.147835},{x:0.244618,y:0.136286},{x:0.247598,y:0.124386},{x:0.249398,y:0.112252},{x:0.25,y:0.1},{x:0.249398,y:0.087748},{x:0.247598,y:0.075614},{x:0.244618,y:0.063714},{x:0.240485,y:0.052165},{x:0.23524,y:0.041075},{x:0.228934,y:0.030554},{x:0.221626,y:0.020701},{x:0.213388,y:0.011612},{x:0.204299,y:0.003374},{x:0.194446,y:-0.003934},{x:0.183925,y:-0.01024},{x:0.172835,y:-0.015485},{x:0.161286,y:-0.019618},{x:0.149386,y:-0.022598},{x:0.137252,y:-0.024398},{x:0.125,y:-0.025}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.020635199999998965,y:0.28075747049999955}},refblocks:{left1:{x:-0.45,y:0.1},right1:{x:0.45,y:0.1},bottom1:{x:0,y:-0.275}},bounds:{minX:-0.45,maxX:0.45,minY:-0.28,maxY:0.28,width:0.9,height:0.56,centerX:0,centerY:0},circles:{}},n7=F(bb).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_left").build(),ed=F(bb).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("bottom1",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),vb=z(ed,"left"),rd=vb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");rd.anchor="middle_left";rd.y+=0.5;rd.x=0.3;var o7=vb,Sb=z(ed,"up"),id=Sb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");id.anchor="middle_left";id.y+=0.3;id.x=0.2;var a7=Sb,s7={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:-0.03}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.37},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.37}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right2:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},ms=F(s7).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right2",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),nd=z(ms,"down"),od=nd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ad=nd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");od.anchor="middle_bottom";ad.anchor="middle_top";od.x=0.44;od.y+=0.28;ad.y-=0.28;ad.x=0.44;var c7=nd,sd=z(ms,"left"),cd=sd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),ld=sd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");cd.anchor="middle_bottom";ld.anchor="middle_top";cd.x=0;cd.y+=0.625;ld.y-=0.695;ld.x=0;var l7=sd,pd=z(ms,"up"),hd=pd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),dd=pd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");hd.anchor="middle_bottom";dd.anchor="middle_top";hd.x=0.4;hd.y+=0.28;dd.y-=0.28;dd.x=0.4;var p7=pd,h7={paths:{path1:{type:"path",points:[{x:-0.37,y:0.03},{x:-0.13,y:0.03}],color:"primary",fill:!1},"path-1-3":{type:"path",points:[{x:-0.07,y:0.03},{x:0.11,y:0.14}],color:"primary",fill:!1},path2:{type:"path",points:[{x:0.1,y:-0.06},{x:0.37,y:-0.06}],color:"primary",fill:!1},path3:{type:"path",points:[{x:0.12,y:0.17},{x:0.37,y:0.17}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.4},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.4}},refblocks:{left1:{x:-0.37,y:0.03},right1:{x:0.37,y:-0.06},right3:{x:0.37,y:0.17}},bounds:{minX:-0.4,maxX:0.4,minY:-0.4,maxY:0.4,width:0.79,height:0.79,centerX:0,centerY:0},circles:{"circle-3":{type:"circle",x:0.08,y:-0.07,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0.03,radius:0.02,color:"primary",fill:!1},"circle-2":{type:"circle",x:0.08,y:0.17,radius:0.02,color:"primary",fill:!1}}},us=F(h7).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right3",["2"]).labelPort("right1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),md=z(us,"down"),ud=md.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),yd=md.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");ud.anchor="middle_bottom";yd.anchor="middle_top";ud.x=0.44;ud.y+=0.28;yd.y-=0.28;yd.x=0.44;var d7=md,fd=z(us,"left"),_d=fd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),gd=fd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");_d.anchor="middle_bottom";gd.anchor="middle_top";_d.x=0;_d.y+=0.625;gd.y-=0.695;gd.x=0;var m7=fd,xd=z(us,"up"),bd=xd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),vd=xd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");bd.anchor="middle_bottom";vd.anchor="middle_top";bd.x=0.4;bd.y+=0.28;vd.y-=0.28;vd.x=0.4;var u7=xd,di={paths:{"lead-positive":{type:"path",points:[{x:-0.4,y:0.19999999999999996},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},"lead-negative":{type:"path",points:[{x:-0.4,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018}],color:"primary",fill:!1},"voice-coil":{type:"path",points:[{x:-0.20000000000000007,y:0.19999999999999996},{x:0,y:0.19999999999999996},{x:0,y:-0.20000000000000018},{x:-0.20000000000000007,y:-0.20000000000000018},{x:-0.20000000000000007,y:0.19999999999999996}],color:"primary",fill:!1},cone:{type:"path",points:[{x:0,y:0.19999999999999996},{x:0.3999999999999999,y:0.3999999999999999},{x:0.3999999999999999,y:-0.40000000000000013},{x:0,y:-0.20000000000000018},{x:0,y:0.19999999999999996}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.6},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.6000000000000001}},refblocks:{left1:{x:-0.4,y:-0.20000000000000018},left2:{x:-0.4,y:0.19999999999999996}},bounds:{minX:-0.4,maxX:0.3999999999999999,minY:-0.6000000000000001,maxY:0.6,width:0.7999999999999999,height:1.2000000000000002,centerX:-0.00000000000000005551115123125783,centerY:-0.00000000000000005551115123125783},circles:{}},wb=F(di).rotateRightFacingSymbol("down").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),_a=ke(wb.primitives),y7={...wb,center:{x:(_a.minX+_a.maxX)/2,y:(_a.minY+_a.maxY)/2}},Ab=F(di).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),ga=ke(Ab.primitives),f7={...Ab,center:{x:(ga.minX+ga.maxX)/2,y:(ga.minY+ga.maxY)/2}},Bb=F(di).rotateRightFacingSymbol("left").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),xa=ke(Bb.primitives),_7={...Bb,center:{x:(xa.minX+xa.maxX)/2,y:(xa.minY+xa.maxY)/2}},Fb=F(di).rotateRightFacingSymbol("right").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),ba=ke(Fb.primitives),g7={...Fb,center:{x:(ba.minX+ba.maxX)/2,y:(ba.minY+ba.maxY)/2}},Pb=F(di).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),va=ke(Pb.primitives),x7={...Pb,center:{x:(va.minX+va.maxX)/2,y:(va.minY+va.maxY)/2}},Ib=F(di).rotateRightFacingSymbol("up").labelPort("left1",["2","neg"]).labelPort("left2",["1","pos"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Sa=ke(Ib.primitives),b7={...Ib,center:{x:(Sa.minX+Sa.maxX)/2,y:(Sa.minY+Sa.maxY)/2}},ys={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0},{x:0.11,y:0.05}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.31},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.28}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete ys.refblocks.left1;delete ys.refblocks.right1;ys.bounds.width+=0.2;var fs=F(ys).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Sd=z(fs,"down"),wd=Sd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ad=Sd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");wd.anchor="middle_bottom";Ad.anchor="middle_top";wd.x=0.3;wd.y+=0.265;Ad.y-=0.265;Ad.x=0.3;var v7=Sd,Bd=z(fs,"left"),Fd=Bd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Pd=Bd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Fd.anchor="middle_bottom";Pd.anchor="middle_top";Fd.x=0;Fd.y+=0.57;Pd.y-=0.57;Pd.x=0;var S7=Bd,Id=z(fs,"up"),Md=Id.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),kd=Id.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Md.anchor="middle_bottom";kd.anchor="middle_top";Md.x=0.3;Md.y+=0.265;kd.y-=0.265;kd.x=0.3;var w7=Id,_s={paths:{path11:{type:"path",points:[{x:-0.38,y:0},{x:-0.12,y:-0.01}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.07,y:0.01},{x:0.1,y:0.14}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.12,y:-0.01},{x:0.38,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.25}},refblocks:{left1:{x:-0.12,y:-0.01},left2:{x:-0.38,y:0},right1:{x:0.12,y:-0.01},right2:{x:0.38,y:0}},bounds:{minX:-0.4,maxX:0.4,minY:-0.25,maxY:0.25,width:0.81,height:0.5,centerX:0,centerY:0},circles:{"circle-2":{type:"circle",x:0.1,y:0,radius:0.02,color:"primary",fill:!1},"circle-1":{type:"circle",x:-0.1,y:0,radius:0.02,color:"primary",fill:!1}}};delete _s.refblocks.left1;delete _s.refblocks.right1;_s.bounds.width+=0.2;var gs=F(_s).changeTextAnchor("{VAL}","middle_top").labelPort("left2",["1"]).labelPort("right2",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),Cd=z(gs,"down"),Yd=Cd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Ld=Cd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Yd.anchor="middle_bottom";Ld.anchor="middle_top";Yd.x=0.3;Yd.y+=0.265;Ld.y-=0.265;Ld.x=0.3;var A7=Cd,Ed=z(gs,"left"),Td=Ed.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Nd=Ed.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Td.anchor="middle_bottom";Nd.anchor="middle_top";Td.x=0;Td.y+=0.57;Nd.y-=0.57;Nd.x=0;var B7=Ed,Wd=z(gs,"up"),Rd=Wd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Od=Wd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Rd.anchor="middle_bottom";Od.anchor="middle_top";Rd.x=0.3;Rd.y+=0.265;Od.y-=0.265;Od.x=0.3;var F7=Wd,xs={paths:{path44:{type:"path",points:[{x:-0.16845120000000047,y:0.02621170000000017},{x:-0.4458008,y:0.02709619999999968}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.4458008,y:0.026971799999999657},{x:0.1677968999999997,y:0.027926399999999685}],color:"primary",fill:!1},"path8704-1":{type:"path",points:[{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.0040837000000002455,y:-0.13467459999999964},{x:-0.017668143940740948,y:-0.1311205263185182},{x:-0.03043520885925943,y:-0.12727072121481456},{x:-0.04240966440000013,y:-0.1231399985999998},{x:-0.05361628020740751,y:-0.11874317238518502},{x:-0.064079825925926,y:-0.11409505648148131},{x:-0.07382507120000005,y:-0.10921046479999987},{x:-0.0828767856740741,y:-0.10410421125185171},{x:-0.0912597389925926,y:-0.09879110974814802},{x:-0.09899870079999995,y:-0.0932859741999998},{x:-0.10611844074074069,y:-0.08760361851851838},{x:-0.11264372845925916,y:-0.0817588566148146},{x:-0.11859933359999993,y:-0.07576650239999982},{x:-0.12401002580740728,y:-0.06964136978518495},{x:-0.12890057472592584,y:-0.06339827268148127},{x:-0.13329574999999985,y:-0.05705202499999972},{x:-0.13722032127407394,y:-0.05061744065185156},{x:-0.14069905819259243,y:-0.04410933354814783},{x:-0.14375673039999987,y:-0.03754251759999966},{x:-0.14641810754074058,y:-0.030931806718518143},{x:-0.1487079592592591,y:-0.0242920148148144},{x:-0.15065105519999983,y:-0.017637955799999563},{x:-0.15227216500740723,y:-0.01098444358518472},{x:-0.15359605832592574,y:-0.004346292081480994},{x:-0.1546475047999998,y:0.00226168480000051},{x:-0.15545127407407386,y:0.008824673148148676},{x:-0.1560321357925924,y:0.015327859051852397},{x:-0.1564148595999998,y:0.02175642860000056},{x:-0.1566242151407405,y:0.028095567881482052},{x:-0.15668497205925902,y:0.03433046298518576},{x:-0.15662189999999976,y:0.04044630000000058},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15662189999999976,y:0.0404463000000006},{x:-0.15622857394444417,y:0.04717166472222282},{x:-0.1553217675555553,y:0.05388046444444503},{x:-0.15392183849999977,y:0.060558907500000585},{x:-0.1520491444444442,y:0.0671932022222228},{x:-0.1497240430555553,y:0.07376955694444502},{x:-0.14696689199999974,y:0.08027418000000058},{x:-0.14379804894444415,y:0.0866932797222228},{x:-0.1402378715555553,y:0.09301306444444506},{x:-0.13630671749999965,y:0.09921974250000057},{x:-0.13202494444444415,y:0.10529952222222282},{x:-0.12741291005555522,y:0.11123861194444501},{x:-0.1224909719999997,y:0.1170232200000006},{x:-0.11727948794444407,y:0.12263955472222278},{x:-0.11179881555555524,y:0.12807382444444504},{x:-0.10606931249999965,y:0.13331223750000057},{x:-0.1001113364444441,y:0.13834100222222284},{x:-0.09394524505555521,y:0.14314632694444504},{x:-0.08759139599999967,y:0.14771442000000062},{x:-0.08107014694444413,y:0.15203148972222283},{x:-0.07440185555555523,y:0.15608374444444503},{x:-0.0676068794999997,y:0.15985739250000058},{x:-0.06070557644444415,y:0.16333864222222283},{x:-0.05371830405555529,y:0.16651370194444504},{x:-0.04666541999999976,y:0.1693687800000006},{x:-0.03956728194444424,y:0.1718900847222228},{x:-0.03244424755555539,y:0.17406382444444501},{x:-0.025316674499999876,y:0.17587620750000055},{x:-0.01820492044444437,y:0.17731344222222278},{x:-0.01112934305555553,y:0.178361736944445},{x:-0.004110300000000034,y:0.17900730000000054},{x:-0.004110300000000011,y:0.17900730000000054}],color:"primary",fill:!1},"path8704-1-9":{type:"path",points:[{x:0.004158700000000071,y:-0.1355885000000001},{x:0.004158700000000071,y:-0.1355885000000001},{x:0.017743143940740766,y:-0.1320344263185187},{x:0.03051020885925925,y:-0.12818462121481505},{x:0.042484664399999955,y:-0.12405389860000024},{x:0.053691280207407335,y:-0.11965707238518546},{x:0.0641548259259258,y:-0.11500895648148178},{x:0.07390007119999986,y:-0.1101243648000003},{x:0.0829517856740739,y:-0.10501811125185218},{x:0.0913347389925924,y:-0.09970500974814848},{x:0.09907370079999973,y:-0.09419987420000027},{x:0.10619344074074046,y:-0.08851751851851883},{x:0.11271872845925893,y:-0.08267275661481507},{x:0.11867433359999968,y:-0.07668040240000029},{x:0.12408502580740703,y:-0.0705552697851854},{x:0.12897557472592555,y:-0.06431217268148172},{x:0.13337074999999957,y:-0.05796592500000018},{x:0.13729532127407365,y:-0.05153134065185202},{x:0.14077405819259214,y:-0.045023233548148286},{x:0.14383173039999952,y:-0.038456417600000126},{x:0.14649310754074024,y:-0.03184570671851861},{x:0.14878295925925875,y:-0.02520591481481487},{x:0.1507260551999995,y:-0.01855185580000003},{x:0.15234716500740686,y:-0.011898343585185192},{x:0.15367105832592537,y:-0.005260192081481464},{x:0.15472250479999944,y:0.001347784800000043},{x:0.1555262740740735,y:0.007910773148148207},{x:0.156107135792592,y:0.01441395905185193},{x:0.1564898595999994,y:0.020842528600000094},{x:0.15669921514074014,y:0.02718166788148159},{x:0.15675997205925862,y:0.03341656298518529},{x:0.15669689999999936,y:0.03953240000000011},{x:0.15669689999999936,y:0.039532400000000134},{x:0.15669689999999936,y:0.039532400000000134},{x:0.1563035739444438,y:0.04625776472222235},{x:0.15539676755555493,y:0.05296656444444457},{x:0.15399683849999934,y:0.05964500750000013},{x:0.1521241444444438,y:0.06627930222222234},{x:0.14979904305555491,y:0.07285565694444456},{x:0.14704189199999937,y:0.07936028000000013},{x:0.1438730489444438,y:0.08577937972222234},{x:0.1403128715555549,y:0.09209916444444458},{x:0.13638171749999925,y:0.0983058425000001},{x:0.13209994444444376,y:0.10438562222222235},{x:0.12748791005555482,y:0.11032471194444453},{x:0.12256597199999929,y:0.11610932000000013},{x:0.1173544879444437,y:0.1217256547222223},{x:0.11187381555555485,y:0.12715992444444457},{x:0.10614431249999925,y:0.1323983375000001},{x:0.10018633644444369,y:0.13742710222222235},{x:0.09402024505555481,y:0.14223242694444457},{x:0.08766639599999927,y:0.14680052000000016},{x:0.08114514694444372,y:0.15111758972222236},{x:0.07447685555555483,y:0.15516984444444457},{x:0.06768187949999929,y:0.15894349250000012},{x:0.06078057644444377,y:0.16242474222222236},{x:0.053793304055554894,y:0.16559980194444457},{x:0.046740419999999366,y:0.16845488000000014},{x:0.039642281944443844,y:0.17097618472222234},{x:0.03251924755555499,y:0.17314992444444455},{x:0.02539167449999948,y:0.17496230750000008},{x:0.018279920444443973,y:0.17639954222222232},{x:0.011204343055555134,y:0.17744783694444452},{x:0.004185299999999637,y:0.17809340000000007},{x:0.004185299999999614,y:0.17809340000000007}],color:"primary",fill:!1},path4:{type:"path",points:[{x:-0.08039130000000005,y:0.0179576999999993},{x:-0.08039130000000005,y:0.09650599999999931}],color:"primary",fill:!0},"path4-5":{type:"path",points:[{x:0.01494479999999987,y:-0.055216500000000224},{x:0.01494479999999987,y:0.09691909999999937}],color:"primary",fill:!0},"path4-5-8":{type:"path",points:[{x:0.06871169999999927,y:-0.056870000000000864},{x:0.06871169999999927,y:0.018784499999999538}],color:"primary",fill:!0},"path4-1":{type:"path",points:[{x:-0.08179359999999969,y:0.09650570000000003},{x:0.015771699999999722,y:0.09650570000000003}],color:"primary",fill:!0},"path4-1-6":{type:"path",points:[{x:0.0117995999999998,y:-0.05594970000000088},{x:0.06843709999999925,y:-0.05594970000000088}],color:"primary",fill:!0},"rect1577-4":{type:"path",points:[{x:-0.17162450000000073,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11125030000000025},{x:-0.2688274000000015,y:0.11469129999999961},{x:-0.17162450000000073,y:0.11469129999999961}],color:"primary",fill:!0},"rect1577-4-7":{type:"path",points:[{x:-0.2184661999999995,y:0.16159429999999997},{x:-0.2184661999999995,y:0.06439139999999943},{x:-0.22190719999999908,y:0.06439139999999943},{x:-0.22190719999999908,y:0.16159429999999997}],color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.0024445000000006267,y:0.23933980000000044},bottom1:{type:"text",text:"{VAL}",x:0.00341719999999901,y:-0.23933980000000066}},refblocks:{left1:{x:-0.4458008,y:0.02709619999999968},right1:{x:0.4458008,y:0.026971799999999657}},bounds:{minX:-0.473959241,maxX:0.473959241,minY:-0.23933980000000066,maxY:0.23933980000000044,width:0.947918482,height:0.4786796000000011,centerX:0,centerY:-0.00000000000000011102230246251565},circles:{}},P7=F(xs).rotateRightFacingSymbol("down").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_left",{x:0.02,y:0.2}).changeTextAnchor("{VAL}","middle_left",{x:0.5,y:-0.2}).build(),I7=F(xs).rotateRightFacingSymbol("left").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom",{x:0,y:0.45}).changeTextAnchor("{VAL}","middle_top",{x:0,y:-0.55}).build(),M7=F(xs).rotateRightFacingSymbol("right").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),k7=F(xs).rotateRightFacingSymbol("up").labelPort("left1",["1","pos"]).labelPort("right1",["2","neg"]).changeTextAnchor("{VAL}","middle_left",{x:0.02,y:-0.2}).changeTextAnchor("{REF}","middle_left",{x:0.5,y:0.2}).build(),Mb={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-5":{type:"path",points:[{x:0.19,y:-0.09},{x:0.15,y:-0.09}],color:"primary",fill:!1},"path43-5-2":{type:"path",points:[{x:0.19,y:-0.14},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:zz,texts:Dz,bounds:Uz,refblocks:Gz,circles:Hz}=Mb,kb=F(Mb).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),C7=z(kb),Y7={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"RPM",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:L7,texts:E7,bounds:wa,refblocks:Xg,circles:T7}=Y7,jd=It({primitives:[...Object.values(L7),...Object.values(T7),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...E7.left1,y:0.01,anchor:"center",fontSize:0.2}],ports:[{...Xg.left1,labels:["1"]},{...Xg.right1,labels:["2"]}],size:{width:wa.width,height:wa.height},center:{x:wa.centerX,y:wa.centerY}}),{5:N7,...W7}=jd.primitives;function R7(t){return typeof t=="object"}var Vg=z({...jd,primitives:Object.values(W7).filter(R7)}),O7={...Vg,primitives:[...Vg.primitives,N7]},bs=It({primitives:[{type:"path",points:[{x:-0.2,y:0},{x:0,y:0}],color:"primary",fill:!1},{type:"path",points:Array.from({length:32},(t,e)=>{let r=Math.PI/2-e*Math.PI/31,i=0.1;return{x:0.1-i*Math.cos(r),y:i*Math.sin(r)}}),color:"primary",fill:!1},{type:"text",text:"{REF}",x:0.125,y:0,anchor:"middle_left"}],ports:[{x:-0.2,y:0,labels:["1"]}],center:{x:0,y:0}}),Cb=z(bs,"down"),zg=Cb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");zg&&(zg.anchor="middle_top");var j7=Cb,$7=z(bs,"left"),Yb=z(bs,"up"),Dg=Yb.primitives.find((t)=>t.type==="text"&&t.text==="{REF}");Dg&&(Dg.anchor="middle_bottom");var X7=Yb,V7={paths:{path40:{type:"path",points:[{x:0.44,y:0.04},{x:0.19,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:0.19,y:0.18},{x:0.44,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:0.19,y:-0.09},{x:0.19,y:0.18}],color:"primary",fill:!1},path44:{type:"path",points:[{x:0.19,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path45:{type:"path",points:[{x:-0.43,y:0.22},{x:-0.11,y:0.04}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{right1:{x:-0.43,y:0.22}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},$d=F(V7).labelPort("right1",["1"]).changeTextAnchor("{REF}","middle_bottom").changeTextAnchor("{VAL}","middle_top").build(),Xd=z($d,"up"),Vd=Xd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),zd=Xd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Vd.anchor="middle_bottom";zd.anchor="middle_top";Vd.x=0.4;Vd.y+=0.2;zd.y-=0.3;zd.x=0.4;var Lb=Xd,Dd=ei(Lb),Ud=Dd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Gd=Dd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Ud.anchor="middle_bottom";Gd.anchor="middle_top";Ud.x=0.35;Ud.y+=0.4;Gd.y-=0.4;Gd.x=0.35;var z7=Dd,Hd=z($d,"left"),Qd=Hd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),Zd=Hd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");Qd.anchor="middle_bottom";Zd.anchor="middle_top";Qd.x=0;Qd.y+=0.5;Zd.y-=0.6;Zd.x=0;var D7=Hd,Eb={paths:{path11:{type:"path",points:[{x:-0.54,y:0.04},{x:-0.11,y:0.04}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.1,y:0.04},{x:0.54,y:0.04}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.09,y:-0.15},{x:-0.09,y:0.26}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.09,y:-0.15},{x:0.09,y:0.26}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.08,y:0.06},{x:-0.08,y:-0.15},{x:0.09,y:-0.05},{x:-0.08,y:0.06}],color:"primary",fill:!0},"path11-0-9-0":{type:"path",points:[{x:0.08,y:0.26},{x:0.08,y:0.05},{x:-0.09,y:0.15},{x:0.07,y:0.26}],color:"primary",fill:!0},"path12-2":{type:"path",points:[{x:0.09,y:-0.06},{x:0.27,y:-0.17}],color:"primary",fill:!1},"path12-2-9":{type:"path",points:[{x:0.27,y:-0.18},{x:0.27,y:-0.31}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:0.01,y:0.42},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{bottom1:{x:0.27,y:-0.31},left1:{x:-0.54,y:0.04},right1:{x:0.54,y:0.04}},bounds:{minX:-0.57,maxX:0.57,minY:-0.42,maxY:0.42,width:1.14,height:0.83,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.05,radius:0.29,color:"primary",fill:!1}}},{paths:Qz,texts:Zz,bounds:Kz,refblocks:Jz,circles:qz}=Eb,Tb=F(Eb).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).labelPort("bottom1",["3"]).changeTextAnchor("{REF}","middle_bottom").build(),Nb=z(Tb),Wb=Nb.primitives.filter((t)=>t.type==="text"),U7=Wb.find((t)=>t.text==="{REF}"),G7=Wb.find((t)=>t.text==="{VAL}");U7.y=0;G7.y=0;var H7=Nb,Q7={paths:{path40:{type:"path",points:[{x:0.14,y:0.04},{x:-0.12,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.12,y:0.18},{x:0.14,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.12,y:-0.09},{x:-0.12,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14,y:0.18},{x:0.14,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.15,y:0.04}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14,y:0.18},{x:0.08,y:0.18}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14,y:-0.09},{x:0.08,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:Z7,texts:Ug,bounds:Aa,refblocks:Gg,circles:K7}=Q7,Rb=It({primitives:[...Object.values(Z7),...Object.values(K7),{...Ug.top1,anchor:"middle_bottom"},{...Ug.bottom1,anchor:"middle_top"}],ports:[{...Gg.left1,labels:["1"]},{...Gg.right1,labels:["2"]}],size:{width:Aa.width,height:Aa.height},center:{x:Aa.centerX,y:Aa.centerY}}),Kd=z(Rb),J7=Kd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),q7=Kd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");J7.anchor="middle_left";q7.anchor="middle_right";var tF=Kd,eF={paths:{path11:{type:"path",points:[{x:-0.34,y:0.22},{x:-0.02,y:0.01}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.23,y:0.13},{x:0.23,y:0.4}],color:"primary",fill:!1},"path12-2":{type:"path",points:[{x:0.23,y:-0.08},{x:0.23,y:-0.35}],color:"primary",fill:!1},"path11-0":{type:"path",points:[{x:-0.01,y:-0.18},{x:-0.01,y:0.23}],color:"primary",fill:!1},"path11-0-3":{type:"path",points:[{x:0.23,y:0.12},{x:-0.01,y:0.12}],color:"primary",fill:!1},"path11-0-9":{type:"path",points:[{x:-0.11,y:0.13},{x:-0.17,y:0.04},{x:-0.06,y:0.03},{x:-0.11,y:0.13}],color:"primary",fill:!0},"path11-0-3-8":{type:"path",points:[{x:0.23,y:-0.08},{x:-0.01,y:-0.08}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.2,y:0.39},bottom1:{type:"text",text:"{VAL}",x:-0.03,y:-0.42}},refblocks:{top1:{x:0.23,y:0.4},bottom1:{x:0.23,y:-0.35},left1:{x:-0.34,y:0.22}},bounds:{minX:-0.37,maxX:0.37,minY:-0.42,maxY:0.42,width:0.74,height:0.85,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0.08,y:0.01,radius:0.29,color:"primary",fill:!1}}},{paths:rF,texts:Hg,bounds:Ba,refblocks:yl,circles:iF}=eF,Ob=It({primitives:[...Object.values(rF),...Object.values(iF),{...Hg.top1,anchor:"middle_left"},{...Hg.bottom1,anchor:"middle_right"}],ports:[{...yl.top1,labels:["1"]},{...yl.bottom1,labels:["2"]},{...yl.left1,labels:["3"]}],size:{width:Ba.width,height:Ba.height},center:{x:Ba.centerX,y:Ba.centerY}}),jb=z(Ob),$b=jb.primitives.filter((t)=>t.type==="text"),nF=$b.find((t)=>t.text==="{REF}");nF.y=0.1;var Xb=$b.find((t)=>t.text==="{VAL}");Xb.y=0.1;Xb.x=-0.4;var oF=jb,aF={paths:{capsule_outer:{type:"path",points:[{x:-0.44,y:0.34},{x:-0.45,y:0.39},{x:-0.46,y:0.42},{x:-0.49,y:0.44},{x:-0.52,y:0.46},{x:-0.56,y:0.46},{x:-0.6,y:0.46},{x:-0.63,y:0.44},{x:-0.65,y:0.42},{x:-0.67,y:0.39},{x:-0.68,y:0.34},{x:-0.68,y:-0.34},{x:-0.67,y:-0.39},{x:-0.65,y:-0.42},{x:-0.63,y:-0.44},{x:-0.6,y:-0.45},{x:-0.56,y:-0.46},{x:-0.52,y:-0.45},{x:-0.49,y:-0.44},{x:-0.46,y:-0.42},{x:-0.45,y:-0.39},{x:-0.44,y:-0.34},{x:-0.44,y:0.34}],color:"primary",fill:!1},capsule_inner:{type:"path",points:[{x:-0.51,y:0.28},{x:-0.52,y:0.32},{x:-0.53,y:0.34},{x:-0.56,y:0.35},{x:-0.57,y:0.35},{x:-0.58,y:0.34},{x:-0.6,y:0.32},{x:-0.61,y:0.28},{x:-0.61,y:-0.28},{x:-0.6,y:-0.32},{x:-0.58,y:-0.34},{x:-0.57,y:-0.35},{x:-0.56,y:-0.35},{x:-0.53,y:-0.34},{x:-0.52,y:-0.32},{x:-0.51,y:-0.28},{x:-0.51,y:0.28}],color:"primary",fill:!0},usb_vertical:{type:"path",points:[{x:0.1,y:-0.4},{x:0.1,y:0.4}],color:"primary",fill:!1},usb_left_branch:{type:"path",points:[{x:0.1,y:-0.1},{x:-0.03,y:0.05},{x:-0.03,y:0.15}],color:"primary",fill:!1},usb_right_branch:{type:"path",points:[{x:0.1,y:0},{x:0.25,y:0.15},{x:0.25,y:0.25}],color:"primary",fill:!1},usb_arrow:{type:"path",points:[{x:0.05,y:0.4},{x:0.1,y:0.5},{x:0.15,y:0.4},{x:0.05,y:0.4}],color:"primary",fill:!0},usb_square:{type:"path",points:[{x:0.2,y:0.25},{x:0.3,y:0.25},{x:0.3,y:0.35},{x:0.2,y:0.35},{x:0.2,y:0.25}],color:"primary",fill:!0}},circles:{usb_base:{type:"circle",x:0.1,y:-0.4,radius:0.07,color:"primary",fill:!0},usb_tip_circle:{type:"circle",x:-0.03,y:0.15,radius:0.04,color:"primary",fill:!0}},texts:{top1:{type:"text",text:"{REF}",x:-0.25,y:0.7}},refblocks:{},bounds:{minX:-0.75,maxX:0.35,minY:-0.6,maxY:0.75,width:1.1,height:1.35,centerX:-0.2,centerY:0.08}},sF=F(aF).changeTextAnchor("{REF}","middle_bottom").build(),cF={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:-0.19,y:0.07}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:lF,texts:fl,bounds:Fa,refblocks:Qg,circles:pF}=cF,Vb=It({primitives:[...Object.values(lF),...Object.values(pF),{...fl.top1,x:0,y:-0.3594553499999995,anchor:"middle_top"},{...fl.bottom1,x:0,y:0.35,anchor:"middle_bottom"},{...fl.left1,x:-0.02,y:0.01,fontSize:0.2,anchor:"center"}],ports:[{...Qg.left1,labels:["1"]},{...Qg.right1,labels:["2"]}],size:{width:Fa.width,height:Fa.height},center:{x:Fa.centerX,y:Fa.centerY}}),hF=z(Vb),dF={paths:{path40:{type:"path",points:[{x:0.08,y:0.04},{x:-0.18,y:-0.09}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.18,y:0.18},{x:0.08,y:0.04}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.18,y:-0.09},{x:-0.18,y:0.18}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.09,y:0.17},{x:0.1,y:-0.09}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.2,y:0.04},{x:-0.52,y:0.04}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.52,y:0.04},{x:0.21,y:0.04}],color:"primary",fill:!1},"path43-6":{type:"path",points:[{x:0.19,y:0.17},{x:0.19,y:-0.09}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.01,y:0.27},bottom1:{type:"text",text:"{VAL}",x:0,y:-0.27}},refblocks:{left1:{x:-0.52,y:0.04},right1:{x:0.52,y:0.04}},bounds:{minX:-0.55,maxX:0.55,minY:-0.27,maxY:0.27,width:1.09,height:0.55,centerX:0,centerY:0},circles:{}},{paths:mF,texts:Zg,bounds:Pa,refblocks:Kg,circles:uF}=dF,zb=It({primitives:[...Object.values(mF),...Object.values(uF),{...Zg.top1,anchor:"middle_bottom"},{...Zg.bottom1,anchor:"middle_top"}],ports:[{...Kg.left1,labels:["1"]},{...Kg.right1,labels:["2"]}],size:{width:Pa.width,height:Pa.height},center:{x:Pa.centerX,y:Pa.centerY}}),Jd=z(zb),yF=Jd.primitives.find((t)=>t.type==="text"&&t.text==="{REF}"),fF=Jd.primitives.find((t)=>t.type==="text"&&t.text==="{VAL}");yF.anchor="middle_left";fF.anchor="middle_right";var _F=Jd,gF={paths:{path5:{type:"path",points:[{x:-0.54,y:0},{x:-0.26,y:0}],color:"primary",fill:!1},path6:{type:"path",points:[{x:0.27,y:0},{x:0.54,y:0.01}],color:"primary",fill:!1},path7:{type:"path",points:[{x:0.27,y:-0.23},{x:-0.26,y:0.24}],color:"primary",fill:!1},path8:{type:"path",points:[{x:0.38,y:-0.23},{x:0.27,y:-0.23}],color:"primary",fill:!1},path9:{type:"path",points:[{x:0,y:0.14},{x:0.27,y:0.14},{x:0.27,y:-0.13},{x:-0.26,y:-0.13},{x:-0.26,y:0.14},{x:0,y:0.14}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.06,y:0.25},bottom1:{type:"text",text:"{VAL}",x:0.01,y:-0.25}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0.01}},bounds:{minX:-0.57,maxX:0.57,minY:-0.25,maxY:0.25,width:1.13,height:0.5,centerX:0,centerY:0},circles:{}},{paths:xF,texts:Jg,bounds:Ia,refblocks:qg}=gF,Db=It({primitives:[...Object.values(xF),{...Jg.top1,anchor:"middle_left"},{...Jg.bottom1,anchor:"middle_right"}],ports:[{...qg.left1,labels:["1","-"]},{...qg.right1,labels:["2","+"]}],size:{width:Ia.width,height:Ia.height},center:{x:Ia.centerX,y:Ia.centerY}}),bF=z(Db),vF={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Var",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:SF,texts:wF,bounds:Ma,refblocks:tx,circles:AF}=vF,qd=It({primitives:[...Object.values(SF),...Object.values(AF),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...wF.left1,anchor:"center",y:0.02,fontSize:0.2}],ports:[{...tx.left1,labels:["1"]},{...tx.right1,labels:["2"]}],size:{width:Ma.width,height:Ma.height},center:{x:Ma.centerX,y:Ma.centerY}}),{5:BF,...FF}=qd.primitives;function PF(t){return typeof t=="object"}var ex=z({...qd,primitives:Object.values(FF).filter(PF)}),IF={...ex,primitives:[...ex.primitives,BF]},vs={paths:{"path28-2":{type:"path",points:[{x:0.19,y:0},{x:0,y:0.09}],color:"primary",fill:!1},"path28-2-6":{type:"path",points:[{x:0.19,y:0},{x:0,y:-0.09}],color:"primary",fill:!1},"path29-3":{type:"path",points:[{x:0.19,y:0},{x:-0.23,y:0}],color:"primary",fill:!1}},texts:{right1:{type:"text",text:"{REF}",x:0.25,y:0}},refblocks:{left1:{x:-0.23,y:0}},bounds:{minX:-0.25,maxX:0.25,minY:-0.09,maxY:0.09,width:0.5,height:0.19,centerX:0,centerY:0},circles:{}};function Ss(t,e){let{width:r,height:i}=t.size,n=1,a=1;e.width!==void 0&&e.height!==void 0?(n=e.width/r,a=e.height/i):e.width!==void 0?n=a=e.width/r:e.height!==void 0&&(n=a=e.height/i);let o=t.primitives.map((c)=>{switch(c.type){case"path":return{...c,points:c.points.map((l)=>({x:l.x*n,y:l.y*a}))};case"text":return{...c,x:c.x*n,y:c.y*a,fontSize:c.fontSize?c.fontSize*n:void 0};case"circle":return{...c,x:c.x*n,y:c.y*a,radius:c.radius*n};case"box":return{...c,x:c.x*n,y:c.y*a,width:c.width*n,height:c.height*a};default:return c}});return{...t,primitives:o,center:{x:t.center.x*n,y:t.center.y*a},ports:t.ports.map((c)=>({...c,x:c.x*n,y:c.y*a})),size:{width:r*n,height:i*a}}}var MF=F(vs).rotateRightFacingSymbol("down").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_top").build(),kF=Ss(MF,{width:0.24,height:0.23}),CF=F(vs).rotateRightFacingSymbol("left").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_right").build(),YF=Ss(CF,{width:0.23,height:0.24}),LF=F(vs).rotateRightFacingSymbol("right").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_left").build(),EF=Ss(LF,{width:0.23,height:0.24}),TF=F(vs).rotateRightFacingSymbol("up").labelPort("left1",["1"]).changeTextAnchor("{REF}","middle_bottom").build(),NF=Ss(TF,{width:0.24,height:0.23}),tm={paths:{path11:{type:"path",points:[{x:-0.54,y:0.03},{x:-0.3,y:0.03}],color:"primary",fill:!1},"path11-5-5":{type:"path",points:[{x:0.1,y:0.13},{x:0,y:-0.06},{x:-0.11,y:0.13}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0.03},{x:0.54,y:0.03}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.02,y:0.4},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:-0.4}},refblocks:{left1:{x:-0.54,y:0.03},right1:{x:0.54,y:0.03}},bounds:{minX:-0.57,maxX:0.57,minY:-0.4,maxY:0.4,width:1.14,height:0.8,centerX:0,centerY:0},circles:{path1:{type:"circle",x:0,y:0.04,radius:0.29,color:"primary",fill:!1}}},{paths:tD,texts:eD,bounds:rD,circles:iD,refblocks:nD}=tm,WF=F(tm).changeTextAnchor("{VAL}","middle_top").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_bottom").build(),{paths:RF,texts:oD,bounds:rx,circles:OF,refblocks:ix}=tm,jF=F({primitives:[...Object.values(RF),...Object.values(OF),{type:"text",text:"{REF}",x:-0.2,y:0.35},{type:"text",text:"{VAL}",x:0.2,y:0.35}],ports:[{...ix.left1,labels:["left1"]},{...ix.right1,labels:["right1"]}],center:{x:rx.centerX,y:rx.centerY}}).rotateRightFacingSymbol("down").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),$F=jF,XF={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"Wh",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:VF,texts:zF,bounds:ka,refblocks:nx,circles:DF}=XF,em=It({primitives:[...Object.values(VF),...Object.values(DF),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...zF.left1,anchor:"center",y:0.01,fontSize:0.2}],ports:[{...nx.left1,labels:["1"]},{...nx.right1,labels:["2"]}],size:{width:ka.width,height:ka.height},center:{x:ka.centerX,y:ka.centerY}}),{5:UF,...GF}=em.primitives;function HF(t){return typeof t=="object"}var ox=z({...em,primitives:Object.values(GF).filter(HF)}),QF={...ox,primitives:[...ox.primitives,UF]},ZF={paths:{path11:{type:"path",points:[{x:-0.54,y:0},{x:-0.3,y:0}],color:"primary",fill:!1},path12:{type:"path",points:[{x:0.29,y:0},{x:0.54,y:0}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.18,y:-0.36},bottom1:{type:"text",text:"{VAL}",x:-0.01,y:0.43},left1:{type:"text",text:"W",x:0,y:-0.02}},refblocks:{left1:{x:-0.54,y:0},right1:{x:0.54,y:0}},bounds:{minX:-0.53,maxX:0.53,minY:0,maxY:0,width:1.06,height:1,centerX:0,centerY:0},circles:{path1:{type:"circle",x:-0.01,y:-0.01,radius:0.29,color:"primary",fill:!1}}},{paths:KF,texts:JF,bounds:Ca,refblocks:ax,circles:qF}=ZF,rm=It({primitives:[...Object.values(KF),...Object.values(qF),{type:"text",text:"{REF}",x:0,y:-0.3594553499999995,anchor:"middle_top"},{type:"text",text:"{VAL}",x:0,y:0.35,anchor:"middle_bottom"},{...JF.left1,anchor:"center",y:0.01,fontSize:0.3}],ports:[{...ax.left1,labels:["1"]},{...ax.right1,labels:["2"]}],size:{width:Ca.width,height:Ca.height},center:{x:Ca.centerX,y:Ca.centerY}}),{5:tP,...eP}=rm.primitives;function rP(t){return typeof t=="object"}var sx=z({...rm,primitives:Object.values(eP).filter(rP)}),iP={...sx,primitives:[...sx.primitives,tP]},Ub={paths:{path40:{type:"path",points:[{x:0.14458890000000002,y:0.04403629999999992},{x:-0.1199943999999995,y:-0.08825540000000043}],color:"primary",fill:!1},path41:{type:"path",points:[{x:-0.1199943999999995,y:0.17632800000000026},{x:0.14458890000000002,y:0.04403629999999992}],color:"primary",fill:!1},path42:{type:"path",points:[{x:-0.1199943999999995,y:-0.0882553999999991},{x:-0.1199943999999995,y:0.17632800000000026}],color:"primary",fill:!1},path43:{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.14458890000000002,y:-0.0882553999999991}],color:"primary",fill:!1},path44:{type:"path",points:[{x:-0.12219909999999956,y:0.04403629999999992},{x:-0.5168693999999996,y:0.04403629999999992}],color:"primary",fill:!1},"path44-0":{type:"path",points:[{x:0.5233797000000002,y:0.043951100000000354},{x:0.1496715999999998,y:0.043951100000000354}],color:"primary",fill:!1},"path43-8":{type:"path",points:[{x:0.14458890000000002,y:0.17632800000000026},{x:0.21069330000000042,y:0.17632800000000026}],color:"primary",fill:!1},"path43-8-8":{type:"path",points:[{x:0.14458890000000002,y:-0.0882553999999991},{x:0.07848449999999962,y:-0.0882553999999991}],color:"primary",fill:!1}},texts:{top1:{type:"text",text:"{REF}",x:-0.0050250999999996715,y:0.27384530000000007},bottom1:{type:"text",text:"{VAL}",x:-0.00011179999999977319,y:-0.27384529999999985}},refblocks:{left1:{x:-0.5191471000000001,y:0.044920700000000924},right1:{x:0.5191470999999999,y:0.04389609999999999}},bounds:{minX:-0.5473055410000001,maxX:0.5473055409999998,minY:-0.27384529999999985,maxY:0.27384530000000007,width:1.094611082,height:0.5476905999999999,centerX:-0.00000000000000011102230246251565,centerY:0.00000000000000011102230246251565},circles:{}},nP=F(Ub).rotateRightFacingSymbol("right").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),{paths:oP,bounds:Ya,refblocks:cx,circles:aP}=Ub,sP=F({primitives:[...Object.values(oP),...Object.values(aP),{type:"text",text:"{REF}",x:0.15,y:-0.2294553499999995},{type:"text",text:"{VAL}",x:-0.15,y:-0.2294553499999995}],ports:[{...cx.left1,labels:["1"]},{...cx.right1,labels:["2"]}],size:{width:Ya.width,height:Ya.height},center:{x:Ya.centerX,y:Ya.centerY}}).rotateRightFacingSymbol("up").labelPort("left1",["1"]).labelPort("right1",["2"]).changeTextAnchor("{REF}","middle_left").changeTextAnchor("{VAL}","middle_left").build(),ur={ac_voltmeter_down:F4,ac_voltmeter_horz:M4,ac_voltmeter_left:Y4,ac_voltmeter_right:T4,ac_voltmeter_up:R4,ac_voltmeter_vert:$4,avalanche_diode_down:z4,avalanche_diode_horz:D4,avalanche_diode_left:H4,avalanche_diode_right:Q4,avalanche_diode_up:J4,avalanche_diode_vert:e5,backward_diode_down:n5,backward_diode_left:lx,backward_diode_right:l5,backward_diode_up:p5,battery_down:u5,battery_horz:px,battery_left:b5,battery_right:A5,battery_up:I5,battery_vert:M5,boxresistor_down:L5,boxresistor_left:W5,boxresistor_right:$5,boxresistor_sm_down:V5,boxresistor_sm_left:z5,boxresistor_sm_right:D5,boxresistor_sm_up:U5,boxresistor_small_down:Q5,boxresistor_small_left:J5,boxresistor_small_right:ev,boxresistor_small_up:nv,boxresistor_up:cv,boxresistor_xs_down:lv,boxresistor_xs_left:pv,boxresistor_xs_right:hv,boxresistor_xs_up:dv,bridged_ground_down:yv,bridged_ground_left:gv,bridged_ground_right:hx,bridged_ground_up:vv,capacitor_down:Bv,capacitor_left:Pv,capacitor_polarized_down:Iv,capacitor_polarized_left:Mv,capacitor_polarized_right:kv,capacitor_polarized_up:Cv,capacitor_right:Lv,capacitor_sm_down:Ev,capacitor_sm_left:Tv,capacitor_sm_right:Nv,capacitor_sm_up:Wv,capacitor_up:$v,capacitor_xs_down:Xv,capacitor_xs_left:Vv,capacitor_xs_right:zv,capacitor_xs_up:Dv,constant_current_diode_down:Hv,constant_current_diode_horz:Qv,constant_current_diode_left:Jv,constant_current_diode_right:qv,constant_current_diode_up:rS,constant_current_diode_vert:oS,crystal_4pin_down:cS,crystal_4pin_left:lS,crystal_4pin_right:pS,crystal_4pin_up:mS,crystal_down:fS,crystal_left:_S,crystal_right:gS,crystal_up:vS,current_source_down:wS,current_source_left:BS,current_source_right:PS,current_source_up:MS,darlington_pair_transistor_down:kS,darlington_pair_transistor_horz:CS,darlington_pair_transistor_left:YS,darlington_pair_transistor_right:LS,darlington_pair_transistor_up:ES,darlington_pair_transistor_vert:TS,dc_ammeter_down:Y_,dc_ammeter_horz:rn,dc_ammeter_left:RS,dc_ammeter_right:OS,dc_ammeter_up:jS,dc_ammeter_vert:Y_,dc_voltmeter_down:VS,dc_voltmeter_horz:US,dc_voltmeter_left:QS,dc_voltmeter_right:JS,dc_voltmeter_up:e3,dc_voltmeter_vert:n3,diac_down:o3,diac_horz:a3,diac_left:s3,diac_right:c3,diac_up:l3,diac_vert:p3,digital_ground_down:m3,digital_ground_left:f3,digital_ground_right:x3,digital_ground_up:S3,diode_down:A3,diode_left:B3,diode_right:Ha,diode_up:F3,dpdt_normally_closed_switch_down:I3,dpdt_normally_closed_switch_left:M3,dpdt_normally_closed_switch_right:Qa,dpdt_normally_closed_switch_up:k3,dpdt_switch_down:Y3,dpdt_switch_left:L3,dpdt_switch_right:Za,dpdt_switch_up:E3,dpst_normally_closed_switch_down:N3,dpst_normally_closed_switch_left:W3,dpst_normally_closed_switch_right:Ka,dpst_normally_closed_switch_up:R3,dpst_switch_down:j3,dpst_switch_left:$3,dpst_switch_right:Ja,dpst_switch_up:X3,ferrite_bead_down:D3,ferrite_bead_left:U3,ferrite_bead_right:ux,ferrite_bead_up:mx,filled_diode_down:Q3,filled_diode_horz:J3,filled_diode_left:ew,filled_diode_right:nw,filled_diode_up:sw,filled_diode_vert:pw,frequency_meter_horz:pp,frequency_meter_vert:gw,fuse_horz:yx,fuse_vert:Sw,ground_down:ww,ground_horz:Aw,ground_left:Bw,ground_right:Fw,ground_up:Pw,ground_vert:Iw,gunn_diode_horz:Mw,gunn_diode_vert:kw,icled_down:Yw,icled_left:Lw,icled_right:qa,icled_up:Ew,igbt_transistor_horz:fx,igbt_transistor_vert:Nw,illuminated_push_button_normally_open_horz:gx,illuminated_push_button_normally_open_vert:Rw,inductor_down:Ow,inductor_left:jw,inductor_right:$w,inductor_up:Xw,laser_diode_down:Vw,laser_diode_left:zw,laser_diode_right:es,laser_diode_up:Dw,led_down:Qw,led_left:Zw,led_right:Ip,led_up:Sx,light_dependent_resistor_horz:wx,light_dependent_resistor_vert:t8,mosfet_depletion_normally_on_horz:Fx,mosfet_depletion_normally_on_vert:i8,mushroom_head_normally_open_momentary_horz:Ix,mushroom_head_normally_open_momentary_vert:s8,n_channel_d_mosfet_transistor_gate_bottom_drain_left:d8,n_channel_d_mosfet_transistor_gate_bottom_drain_right:m8,n_channel_d_mosfet_transistor_gate_left_drain_bottom:u8,n_channel_d_mosfet_transistor_gate_left_drain_top:y8,n_channel_d_mosfet_transistor_gate_right_drain_bottom:f8,n_channel_d_mosfet_transistor_gate_right_drain_top:_8,n_channel_d_mosfet_transistor_gate_top_drain_left:g8,n_channel_d_mosfet_transistor_gate_top_drain_right:x8,n_channel_d_mosfet_transistor_horz:fe,n_channel_d_mosfet_transistor_vert:Ce,n_channel_e_mosfet_transistor_gate_bottom_drain_left:w8,n_channel_e_mosfet_transistor_gate_bottom_drain_right:A8,n_channel_e_mosfet_transistor_gate_left_drain_bottom:B8,n_channel_e_mosfet_transistor_gate_left_drain_top:F8,n_channel_e_mosfet_transistor_gate_right_drain_bottom:P8,n_channel_e_mosfet_transistor_gate_right_drain_top:I8,n_channel_e_mosfet_transistor_gate_top_drain_left:M8,n_channel_e_mosfet_transistor_gate_top_drain_right:k8,n_channel_e_mosfet_transistor_horz:_e,n_channel_e_mosfet_transistor_vert:Ye,njfet_transistor_horz:Ex,njfet_transistor_vert:E8,not_connected_down:R8,not_connected_left:O8,not_connected_right:rs,not_connected_up:j8,npn_bipolar_transistor_down:V8,npn_bipolar_transistor_horz:U8,npn_bipolar_transistor_left:Q8,npn_bipolar_transistor_right:J8,npn_bipolar_transistor_up:eA,npn_bipolar_transistor_vert:nA,opamp_no_power_down:aA,opamp_no_power_left:sA,opamp_no_power_right:is,opamp_no_power_up:cA,opamp_with_power_down:pA,opamp_with_power_left:hA,opamp_with_power_right:ns,opamp_with_power_up:dA,p_channel_d_mosfet_transistor_gate_bottom_drain_left:fA,p_channel_d_mosfet_transistor_gate_bottom_drain_right:_A,p_channel_d_mosfet_transistor_gate_left_drain_bottom:gA,p_channel_d_mosfet_transistor_gate_left_drain_top:xA,p_channel_d_mosfet_transistor_gate_right_drain_bottom:bA,p_channel_d_mosfet_transistor_gate_right_drain_top:vA,p_channel_d_mosfet_transistor_gate_top_drain_left:SA,p_channel_d_mosfet_transistor_gate_top_drain_right:wA,p_channel_d_mosfet_transistor_horz:ge,p_channel_d_mosfet_transistor_vert:Le,p_channel_e_mosfet_transistor_gate_bottom_drain_left:PA,p_channel_e_mosfet_transistor_gate_bottom_drain_right:IA,p_channel_e_mosfet_transistor_gate_left_drain_bottom:MA,p_channel_e_mosfet_transistor_gate_left_drain_top:kA,p_channel_e_mosfet_transistor_gate_right_drain_bottom:CA,p_channel_e_mosfet_transistor_gate_right_drain_top:YA,p_channel_e_mosfet_transistor_gate_top_drain_left:LA,p_channel_e_mosfet_transistor_gate_top_drain_right:EA,p_channel_e_mosfet_transistor_horz:xe,p_channel_e_mosfet_transistor_vert:Ee,photodiode_horz:$x,photodiode_vert:WA,pjfet_transistor_horz:zx,pjfet_transistor_vert:$A,pnp_bipolar_transistor_down:zA,pnp_bipolar_transistor_horz:DA,pnp_bipolar_transistor_left:HA,pnp_bipolar_transistor_right:KA,pnp_bipolar_transistor_up:t6,pnp_bipolar_transistor_vert:i6,potentiometer_horz:Gx,potentiometer_vert:s6,potentiometer2_down:p6,potentiometer2_left:h6,potentiometer2_right:os,potentiometer2_up:d6,potentiometer3_down:y6,potentiometer3_left:g6,potentiometer3_right:x6,potentiometer3_up:S6,power_factor_meter_horz:Hx,power_factor_meter_vert:F6,push_button_normally_closed_momentary_horz:Zx,push_button_normally_closed_momentary_vert:k6,push_button_normally_open_momentary_down:E6,push_button_normally_open_momentary_horz:R6,push_button_normally_open_momentary_left:O6,push_button_normally_open_momentary_right:on,push_button_normally_open_momentary_up:j6,push_button_normally_open_momentary_vert:$6,rail_down:D6,rail_left:Q6,rail_right:q6,rail_up:rB,rectifier_diode_horz:Jx,rectifier_diode_vert:cB,resistor_down:hB,resistor_left:uB,resistor_right:_B,resistor_sm_down:gB,resistor_sm_left:xB,resistor_sm_right:bB,resistor_sm_up:vB,resistor_up:AB,resistor_xs_down:BB,resistor_xs_left:FB,resistor_xs_right:PB,resistor_xs_up:IB,resonator_down:CB,resonator_horz:tb,resonator_left:EB,resonator_right:hs,resonator_up:TB,resonator_vert:NB,schottky_diode_down:RB,schottky_diode_left:OB,schottky_diode_right:ds,schottky_diode_up:jB,silicon_controlled_rectifier_horz:rb,silicon_controlled_rectifier_vert:XB,solderjumper2_bridged12_down:VB,solderjumper2_bridged12_left:zB,solderjumper2_bridged12_right:jh,solderjumper2_bridged12_up:DB,solderjumper2_down:UB,solderjumper2_left:GB,solderjumper2_right:Vh,solderjumper2_up:HB,solderjumper3_bridged12_down:QB,solderjumper3_bridged12_left:ZB,solderjumper3_bridged12_right:Uh,solderjumper3_bridged12_up:KB,solderjumper3_bridged123_down:JB,solderjumper3_bridged123_left:qB,solderjumper3_bridged123_right:Qh,solderjumper3_bridged123_up:t7,solderjumper3_bridged23_down:e7,solderjumper3_bridged23_left:r7,solderjumper3_bridged23_right:Jh,solderjumper3_bridged23_up:i7,solderjumper3_down:n7,solderjumper3_left:o7,solderjumper3_right:ed,solderjumper3_up:a7,spdt_normally_closed_switch_down:c7,spdt_normally_closed_switch_left:l7,spdt_normally_closed_switch_right:ms,spdt_normally_closed_switch_up:p7,spdt_switch_down:d7,spdt_switch_left:m7,spdt_switch_right:us,spdt_switch_up:u7,speaker_down:y7,speaker_horz:f7,speaker_left:_7,speaker_right:g7,speaker_up:x7,speaker_vert:b7,spst_normally_closed_switch_down:v7,spst_normally_closed_switch_left:S7,spst_normally_closed_switch_right:fs,spst_normally_closed_switch_up:w7,spst_switch_down:A7,spst_switch_left:B7,spst_switch_right:gs,spst_switch_up:F7,square_wave_down:P7,square_wave_left:I7,square_wave_right:M7,square_wave_up:k7,step_recovery_diode_horz:kb,step_recovery_diode_vert:C7,tachometer_horz:jd,tachometer_vert:O7,testpoint_down:j7,testpoint_left:$7,testpoint_right:bs,testpoint_up:X7,tilted_ground_down:z7,tilted_ground_left:D7,tilted_ground_right:$d,tilted_ground_up:Lb,triac_horz:Tb,triac_vert:H7,tunnel_diode_horz:Rb,tunnel_diode_vert:tF,unijunction_transistor_horz:Ob,unijunction_transistor_vert:oF,usbc:sF,var_meter_horz:Vb,var_meter_vert:hF,varactor_diode_horz:zb,varactor_diode_vert:_F,varistor_horz:Db,varistor_vert:bF,varmeter_horz:qd,varmeter_vert:IF,vcc_down:kF,vcc_left:YF,vcc_right:EF,vcc_up:NF,volt_meter_horz:WF,volt_meter_vert:$F,watt_hour_meter_horz:em,watt_hour_meter_vert:QF,wattmeter_horz:rm,wattmeter_vert:iP,zener_diode_horz:nP,zener_diode_vert:sP};var aD=Object.fromEntries(Object.keys(ur).map((t)=>[t,t]));var MG=te(ee(),1);var LG=te(ee(),1);var wI=te(ee(),1);var AI=te(ee(),1);var JG=te(ee(),1);var cP="TscircuitAlphabet",Gb="data-tscircuit-alphabet-font";function lP(t){let e=(i)=>({...i,children:(i.children??[]).filter((n)=>!(Gb in(n.attributes??{}))).map(e)}),r=e(t);return r.children.push({name:"style",type:"element",value:"",attributes:{[Gb]:"",type:"text/css"},children:[{name:"",type:"text",value:`@font-face { font-family: '${cP}'; src: url('data:font/ttf;base64,${P0}') format('truetype'); font-weight: normal; font-style: normal; }`,attributes:{},children:[]}]}),o1.stringify(r)}var s1=a1.default("circuit-to-svg"),SD=s1.extend("pcb"),wD=s1.extend("sch");var Zt={"3d_viewer":{background_bottom:"rgb(102, 102, 128)",background_top:"rgb(204, 204, 230)",board:"rgb(51, 43, 23)",copper:"rgb(179, 156, 0)",silkscreen_bottom:"rgb(230, 230, 230)",silkscreen_top:"rgb(230, 230, 230)",soldermask:"rgb(20, 51, 36)",solderpaste:"rgb(128, 128, 128)"},board:{anchor:"rgb(255, 38, 226)",aux_items:"rgb(255, 255, 255)",b_adhes:"rgb(0, 0, 132)",b_crtyd:"rgb(255, 38, 226)",b_fab:"rgb(88, 93, 132)",b_mask:"rgba(2, 255, 238, 0.400)",b_paste:"rgb(0, 194, 194)",b_silks:"rgb(232, 178, 167)",background:"rgb(0, 16, 35)",cmts_user:"rgb(89, 148, 220)",copper:{b:"rgb(77, 127, 196)",f:"rgb(200, 52, 52)",in1:"rgb(127, 200, 127)",in10:"rgb(237, 124, 51)",in11:"rgb(91, 195, 235)",in12:"rgb(247, 111, 142)",in13:"rgb(167, 165, 198)",in14:"rgb(40, 204, 217)",in15:"rgb(232, 178, 167)",in16:"rgb(242, 237, 161)",in17:"rgb(237, 124, 51)",in18:"rgb(91, 195, 235)",in19:"rgb(247, 111, 142)",in2:"rgb(206, 125, 44)",in20:"rgb(167, 165, 198)",in21:"rgb(40, 204, 217)",in22:"rgb(232, 178, 167)",in23:"rgb(242, 237, 161)",in24:"rgb(237, 124, 51)",in25:"rgb(91, 195, 235)",in26:"rgb(247, 111, 142)",in27:"rgb(167, 165, 198)",in28:"rgb(40, 204, 217)",in29:"rgb(232, 178, 167)",in3:"rgb(79, 203, 203)",in30:"rgb(242, 237, 161)",in4:"rgb(219, 98, 139)",in5:"rgb(167, 165, 198)",in6:"rgb(40, 204, 217)",in7:"rgb(232, 178, 167)",in8:"rgb(242, 237, 161)",in9:"rgb(141, 203, 129)"},cursor:"rgb(255, 255, 255)",drc:"rgb(194, 194, 194)",drc_error:"rgba(215, 91, 107, 0.800)",drc_exclusion:"rgb(255, 255, 255)",drc_warning:"rgba(255, 208, 66, 0.902)",dwgs_user:"rgb(194, 194, 194)",eco1_user:"rgb(180, 219, 210)",eco2_user:"rgb(216, 200, 82)",edge_cuts:"rgb(208, 210, 205)",f_adhes:"rgb(132, 0, 132)",f_crtyd:"rgb(255, 0, 245)",f_fab:"rgb(175, 175, 175)",f_mask:"rgba(216, 100, 255, 0.400)",f_paste:"rgba(180, 160, 154, 0.902)",f_silks:"rgb(242, 237, 161)",footprint_text_back:"rgb(0, 0, 132)",footprint_text_front:"rgb(194, 194, 194)",footprint_text_invisible:"rgb(132, 132, 132)",grid:"rgb(132, 132, 132)",grid_axes:"rgb(194, 194, 194)",margin:"rgb(255, 38, 226)",microvia:"rgb(0, 132, 132)",no_connect:"rgb(0, 0, 132)",pad_back:"rgb(77, 127, 196)",pad_front:"rgb(200, 52, 52)",pad_plated_hole:"rgb(194, 194, 0)",pad_through_hole:"rgb(227, 183, 46)",plated_hole:"rgb(26, 196, 210)",ratsnest:"rgba(245, 255, 213, 0.702)",select_overlay:"rgb(4, 255, 67)",through_via:"rgb(236, 236, 236)",user_1:"rgb(194, 194, 194)",user_2:"rgb(89, 148, 220)",user_3:"rgb(180, 219, 210)",user_4:"rgb(216, 200, 82)",user_5:"rgb(194, 194, 194)",user_6:"rgb(89, 148, 220)",user_7:"rgb(180, 219, 210)",user_8:"rgb(216, 200, 82)",user_9:"rgb(232, 178, 167)",via_blind_buried:"rgb(187, 151, 38)",via_hole:"rgb(227, 183, 46)",via_micro:"rgb(0, 132, 132)",via_through:"rgb(236, 236, 236)",worksheet:"rgb(200, 114, 171)"},gerbview:{axes:"rgb(0, 0, 132)",background:"rgb(0, 0, 0)",dcodes:"rgb(255, 255, 255)",grid:"rgb(132, 132, 132)",layers:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)","rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)"],negative_objects:"rgb(132, 132, 132)",worksheet:"rgb(0, 0, 132)"},meta:{filename:"kicad_2020",name:"KiCad 2020",version:2},simulation_palette:["#1f77b4","#d62728","#2ca02c","#ff7f0e","#9467bd","#17becf","#8c564b","#e377c2","#7f7f7f","#bcbd22"],palette:["rgb(132, 0, 0)","rgb(194, 194, 0)","rgb(194, 0, 194)","rgb(194, 0, 0)","rgb(0, 132, 132)","rgb(0, 132, 0)","rgb(0, 0, 132)","rgb(132, 132, 132)","rgb(132, 0, 132)","rgb(194, 194, 194)","rgb(132, 0, 132)","rgb(132, 0, 0)","rgb(132, 132, 0)","rgb(194, 194, 194)","rgb(0, 0, 132)","rgb(0, 132, 0)"],schematic:{aux_items:"rgb(46, 46, 46)",background:"rgb(245, 241, 237)",brightened:"rgb(255, 0, 255)",bus:"rgb(0, 0, 132)",bus_junction:"rgb(0, 0, 132)",component_body:"rgb(255, 255, 194)",component_outline:"rgb(132, 0, 0)",cursor:"rgb(15, 15, 15)",erc_error:"rgba(230, 9, 13, 0.800)",erc_warning:"rgba(209, 146, 0, 0.800)",fields:"rgb(132, 0, 132)",grid:"rgb(181, 181, 181)",grid_axes:"rgb(0, 0, 132)",hidden:"rgb(194, 194, 194)",junction:"rgb(0, 150, 0)",label_global:"rgb(132, 0, 0)",label_background:"rgba(255, 255, 255, 0.6)",label_hier:"rgb(114, 86, 0)",label_local:"rgb(15, 15, 15)",net_name:"rgb(132, 132, 132)",no_connect:"rgb(132, 0, 0)",note:"rgb(0, 0, 194)",override_item_colors:!1,pin:"rgb(132, 0, 0)",pin_name:"rgb(0, 100, 100)",pin_number:"rgb(169, 0, 0)",reference:"rgb(0, 100, 100)",shadow:"rgba(102, 179, 255, 0.800)",sheet:"rgb(132, 0, 0)",sheet_background:"rgba(253, 255, 231, 0.000)",sheet_fields:"rgb(132, 0, 132)",sheet_filename:"rgb(114, 86, 0)",sheet_label:"rgb(0, 100, 100)",sheet_name:"rgb(0, 100, 100)",table:"rgb(102, 102, 102)",value:"rgb(0, 100, 100)",wire:"rgb(0, 150, 0)",wire_crossing:"rgb(30, 180, 30)",worksheet:"rgb(132, 0, 0)"}};var kD=Zt.board.user_2;var YD=Zt.board.user_2,LD=Zt.board.user_2;var TD=Zt.board.user_2;var WD=Zt.board.user_2;var Hb=0.94,ws=0.045,pP=Object.fromEntries(Object.entries(gi).map(([t,e])=>{let r=e.flatMap((n)=>[n.x1,n.x2]),i=e.flatMap((n)=>[n.y1,n.y2]);return[t,e.length?{minX:Math.min(...r)-ws,maxX:Math.max(...r)+ws,minY:-(Math.max(...i)+ws)*Hb,maxY:-(Math.min(...i)-ws)*Hb}:null]})),zD=Math.round(Math.max(...Object.values(pP).map((t)=>t?t.maxX-t.minX:0))*1000)/1000;var Ls={copper:{top:"rgb(200, 52, 52)",inner1:"rgb(255, 140, 0)",inner2:"rgb(255, 215, 0)",inner3:"rgb(50, 205, 50)",inner4:"rgb(64, 224, 208)",inner5:"rgb(138, 43, 226)",inner6:"rgb(255, 105, 180)",inner7:"rgb(0, 191, 255)",inner8:"rgb(160, 82, 45)",bottom:"rgb(77, 127, 196)"},soldermaskWithCopperUnderneath:{top:"rgb(18, 82, 50)",bottom:"rgb(18, 82, 50)"},soldermask:{top:"rgb(12, 55, 33)",bottom:"rgb(12, 55, 33)"},soldermaskOverCopper:{top:"rgb(52, 135, 73)",bottom:"rgb(52, 135, 73)"},substrate:"rgb(201, 162, 110)",drill:"#FF26E2",silkscreen:{top:"#f2eda1",bottom:"#5da9e9"},boardOutline:"rgba(255, 255, 255, 0.5)",courtyard:{top:"#FF00FF",bottom:"rgb(38, 233, 255)"},keepout:"#FF6B6B",debugComponent:{fill:null,stroke:null}},GD=Ls.drill,HD=Ls.silkscreen.top,QD=Ls.silkscreen.bottom,ZD={...Ls.copper};var hP=4;var c1=5;var dP=2,yU=c1+2,fU=dP+2,_U=c1+hP+6;function mP(t){return t.find((r)=>r.type==="project_software_metadata"||r.type==="source_project_metadata")?.software_used_string}var uP={name:"circuit-to-svg",type:"module",version:"0.0.426",repository:{type:"git",url:"https://github.com/tscircuit/circuit-to-svg.git"},description:"Convert Circuit JSON to SVG",main:"dist/index.js",files:["dist"],scripts:{start:"cosmos",prepublish:"npm run build",prepare:"node scripts/prepare-git.cjs",build:"tsup-node ./lib/index.ts --format esm --dts --sourcemap --external tscircuit",format:"biome format . --write","format:check":"biome format .",cosmos:"cosmos","cosmos-export":"cosmos-export"},license:"ISC",devDependencies:{"@biomejs/biome":"^1.9.4","@resvg/resvg-js":"^2.6.2","@tscircuit/alphabet":"^0.0.27","@tscircuit/checks-latest":"npm:@tscircuit/checks@0.0.179","@types/bun":"^1.2.8","@types/debug":"^4.1.12","@vitejs/plugin-react":"5.0.0",biome:"^0.3.3","bun-match-svg":"^0.0.12","circuit-json":"^0.0.491",esbuild:"^0.20.2","format-si-unit":"^0.0.12","performance-now":"^2.1.0",react:"19.1.0","react-cosmos":"7.0.0","react-cosmos-plugin-vite":"7.0.0","react-dom":"19.1.0",tscircuit:"^0.0.2018",tsup:"^8.0.2",typescript:"^5.4.5","vite-tsconfig-paths":"^5.0.1"},peerDependencies:{"@tscircuit/alphabet":"*"},dependencies:{"@types/node":"^22.5.5","bun-types":"^1.1.40","calculate-elbow":"0.0.12",debug:"^4.4.3","svg-path-commander":"^2.1.11",svgson:"^5.3.1","transformation-matrix":"^2.16.1"}},yP=uP.version;function fP(t,e="error_text_overlay"){let r=t.filter((a)=>a.type.endsWith("_error"));if(r.length===0)return null;let i=r.map((a)=>a.message).filter((a)=>!!a);if(i.length===0)return null;return{name:"text",type:"element",value:"",attributes:{x:"10",y:"20",fill:"red","font-family":"monospace","font-size":"12px","data-type":e,"data-layer":"global"},children:i.map((a,o)=>({name:"tspan",type:"element",value:"",attributes:{x:"10",dy:o===0?"0":"1.2em"},children:[{type:"text",value:a,name:"",attributes:{},children:[]}]}))}}var _P={pin_number:0.15,negated_pin_number:0.12,reference_designator:0.18,manufacturer_number:0.18,net_label:0.18,error:0.05},He=(t,e)=>e??_P[t],se=(t,e,r)=>Math.abs(t.a)*He(e,r);function gP(t){let{minX:e,minY:r,maxX:i,maxY:n}=t.bounds,a=t.cellSize??1,o=t.labelCells??!1,c=[],l=(s,p)=>{let[d,m]=P(t.transform,[s,p]);return{x:d,y:m}};for(let s=Math.floor(e);s<=Math.ceil(i);s+=a){let p=l(s,r),d=l(s,n);c.push({name:"line",type:"element",attributes:{x1:p.x.toString(),y1:p.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Zt.schematic.grid,"stroke-width":(0.01*Math.abs(t.transform.a)).toString(),"stroke-opacity":"0.5"}})}for(let s=Math.floor(r);s<=Math.ceil(n);s+=a){let p=l(e,s),d=l(i,s);c.push({name:"line",type:"element",attributes:{x1:p.x.toString(),y1:p.y.toString(),x2:d.x.toString(),y2:d.y.toString(),stroke:Zt.schematic.grid,"stroke-width":(0.01*Math.abs(t.transform.a)).toString(),"stroke-opacity":"0.5"}})}if(o){let s=(p,d)=>{if(a<=0.1)return`${p.toFixed(1)},${d.toFixed(1)}`;return`${p},${d}`};for(let p=Math.floor(e);p<=Math.ceil(i);p+=a)for(let d=Math.floor(r);d<=Math.ceil(n);d+=a){let m=l(p,d);c.push({name:"text",type:"element",attributes:{x:(m.x-2.5).toString(),y:(m.y-5).toString(),fill:Zt.schematic.grid,"font-size":(a/5*Math.abs(t.transform.a)).toString(),"fill-opacity":"0.5","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif"},children:[{type:"text",value:s(p,d),name:"",attributes:{},children:[]}]})}}return{name:"g",value:"",type:"element",attributes:{class:"grid sch-grid"},children:c}}function xP(t){let{points:e,transform:r}=t,i=[];for(let n of e){let[a,o]=P(r,[n.x-0.1,n.y-0.1]),[c,l]=P(r,[n.x+0.1,n.y+0.1]),[s,p]=P(r,[n.x-0.1,n.y+0.1]),[d,m]=P(r,[n.x+0.1,n.y-0.1]);i.push({name:"path",type:"element",attributes:{d:`M${a},${o} L${c},${l} M${s},${p} L${d},${m}`,stroke:Zt.schematic.grid,"stroke-width":(0.02*Math.abs(r.a)).toString(),"stroke-opacity":"0.7"}});let[u,y]=P(r,[n.x+0.15,n.y-0.15]);i.push({name:"text",type:"element",attributes:{x:u.toString(),y:y.toString(),fill:Zt.schematic.grid,"font-size":(0.1*Math.abs(r.a)).toString(),"fill-opacity":"0.7","text-anchor":"start","font-family":"sans-serif","dominant-baseline":"middle"},children:[{type:"text",value:n.label||`(${n.x},${n.y})`,name:"",attributes:{},children:[]}]})}return{name:"g",value:"",type:"element",attributes:{class:"labeled-points sch-labeled-points"},children:i}}function bP(t){return t.reduce((e,r)=>{if(!e)return r;if(r.sheet_index===void 0)return e;if(e.sheet_index===void 0)return r;return r.sheet_index<e.sheet_index?r:e},void 0)}var Qb={"0":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"1":{width:13,height:27,ascent:22,descent:5,left:-3,right:9},"2":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"3":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"4":{width:13,height:27,ascent:22,descent:5,left:0,right:12},"5":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"6":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"7":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"8":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"9":{width:13,height:27,ascent:22,descent:5,left:-1,right:12}," ":{width:7,height:27,ascent:22,descent:5,left:0,right:0},"!":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},'"':{width:9,height:27,ascent:22,descent:5,left:-1,right:7},"#":{width:13,height:27,ascent:22,descent:5,left:0,right:13},$:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"%":{width:21,height:27,ascent:22,descent:5,left:-1,right:20},"&":{width:16,height:27,ascent:22,descent:5,left:-1,right:15},"'":{width:5,height:27,ascent:22,descent:5,left:-1,right:3},"(":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},")":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"*":{width:9,height:27,ascent:22,descent:5,left:-1,right:8},"+":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},",":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"-":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},".":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"/":{width:7,height:27,ascent:22,descent:5,left:0,right:7},":":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},";":{width:7,height:27,ascent:22,descent:5,left:-2,right:5},"<":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"=":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},">":{width:14,height:27,ascent:22,descent:5,left:-1,right:13},"?":{width:13,height:27,ascent:22,descent:5,left:-1,right:12},"@":{width:24,height:27,ascent:22,descent:5,left:-1,right:23},A:{width:16,height:27,ascent:22,descent:5,left:0,right:16},B:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},C:{width:17,height:27,ascent:22,descent:5,left:-1,right:16},D:{width:17,height:27,ascent:22,descent:5,left:-2,right:16},E:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},F:{width:15,height:27,ascent:22,descent:5,left:-2,right:14},G:{width:19,height:27,ascent:22,descent:5,left:-1,right:17},H:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},I:{width:7,height:27,ascent:22,descent:5,left:-2,right:5},J:{width:12,height:27,ascent:22,descent:5,left:-1,right:10},K:{width:16,height:27,ascent:22,descent:5,left:-2,right:16},L:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},M:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},N:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},O:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},P:{width:16,height:27,ascent:22,descent:5,left:-2,right:15},Q:{width:19,height:27,ascent:22,descent:5,left:-1,right:18},R:{width:17,height:27,ascent:22,descent:5,left:-2,right:17},S:{width:16,height:27,ascent:22,descent:5,left:-1,right:15},T:{width:15,height:27,ascent:22,descent:5,left:-1,right:14},U:{width:17,height:27,ascent:22,descent:5,left:-2,right:15},V:{width:16,height:27,ascent:22,descent:5,left:0,right:16},W:{width:23,height:27,ascent:22,descent:5,left:0,right:22},X:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Y:{width:16,height:27,ascent:22,descent:5,left:0,right:16},Z:{width:15,height:27,ascent:22,descent:5,left:0,right:14},"[":{width:7,height:27,ascent:22,descent:5,left:-2,right:6},"\\":{width:7,height:27,ascent:22,descent:5,left:0,right:7},"]":{width:7,height:27,ascent:22,descent:5,left:0,right:5},"^":{width:11,height:27,ascent:22,descent:5,left:-1,right:11},_:{width:13,height:27,ascent:22,descent:5,left:0,right:14},"`":{width:8,height:27,ascent:22,descent:5,left:-1,right:5},a:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},b:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},c:{width:12,height:27,ascent:22,descent:5,left:-1,right:12},d:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},e:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},f:{width:7,height:27,ascent:22,descent:5,left:0,right:8},g:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},h:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},i:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},j:{width:5,height:27,ascent:22,descent:5,left:1,right:4},k:{width:12,height:27,ascent:22,descent:5,left:-2,right:12},l:{width:5,height:27,ascent:22,descent:5,left:-2,right:4},m:{width:20,height:27,ascent:22,descent:5,left:-2,right:18},n:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},o:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},p:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},q:{width:13,height:27,ascent:22,descent:5,left:-1,right:12},r:{width:8,height:27,ascent:22,descent:5,left:-2,right:8},s:{width:12,height:27,ascent:22,descent:5,left:-1,right:11},t:{width:7,height:27,ascent:22,descent:5,left:0,right:6},u:{width:13,height:27,ascent:22,descent:5,left:-2,right:12},v:{width:12,height:27,ascent:22,descent:5,left:0,right:12},w:{width:17,height:27,ascent:22,descent:5,left:0,right:17},x:{width:12,height:27,ascent:22,descent:5,left:0,right:12},y:{width:12,height:27,ascent:22,descent:5,left:0,right:12},z:{width:12,height:27,ascent:22,descent:5,left:0,right:11},"{":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"|":{width:6,height:27,ascent:22,descent:5,left:-2,right:4},"}":{width:8,height:27,ascent:22,descent:5,left:-1,right:7},"~":{width:14,height:27,ascent:22,descent:5,left:-1,right:13}},pn=(t)=>{if(!t)return 0;let e=0;for(let r of t){let i=Qb[r];if(i)e+=i.width;else e+=Qb["?"].width}return e/27},l1=0.65,p1=0.08;function Cs(t){return pn(t.text||"")+(t.display_superscript?p1+pn(t.display_superscript)*l1:0)}function om(t,e,r,i="central"){let n=[{type:"text",value:t,name:"",attributes:{},children:[]}];if(e)n.push({type:"element",name:"tspan",value:"",attributes:{class:"sch-net-label-superscript","font-size":`${r*l1}px`,dx:`${r*p1}`,dy:`${-r*(i==="ideographic"?0.5:0.25)}`},children:[{type:"text",value:e,name:"",attributes:{},children:[]}]});return n}var _i=(t)=>{switch(t){case"top":return{x:0,y:-1};case"bottom":return{x:0,y:1};case"left":return{x:1,y:0};case"right":return{x:-1,y:0}}throw Error(`Invalid side: ${t}`)},Ge=0.3,yi=0.3,fi=0.06,h1=0.2,d1=(t)=>({"data-circuit-json-type":"schematic_net_label","data-schematic-net-label-id":t.schematic_net_label_id}),vP={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},Zb={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"};function SP(t){return{left:180,top:90,bottom:-90,right:0}[t]??0}function wP(t,e,r){let i=r+Ge*2+fi*t.text.length+yi,n=_i(t.anchor_side);return t.anchor_position??{x:t.center.x-n.x*i*e/2,y:t.center.y-n.y*i*e/2}}var AP=(t,e)=>{let r=t<0?t+2*Math.PI:t,i=e<0?e+2*Math.PI:e,n=Math.abs(r-i);if(n>Math.PI)n=2*Math.PI-n;return n},m1=({schPorts:t,symbol:e,schComponent:r})=>{let i=t.map((c)=>{let l=c.center.x-r.center.x,s=c.center.y-r.center.y;return{port:c,angle:Math.atan2(s,l)}}),n=e.ports.map((c)=>{let l=c.x-e.center.x,s=c.y-e.center.y;return{port:c,angle:Math.atan2(s,l)}});i.sort((c,l)=>c.angle-l.angle),n.sort((c,l)=>c.angle-l.angle);let a=[],o=new Set;for(let c of i){let l=null;for(let s of n){if(o.has(s.port))continue;let p=AP(c.angle,s.angle);if(l===null||p<l.angleDiff)l={symbolPort:s.port,angleDiff:p}}if(l&&l.angleDiff<Math.PI/4)a.push({schPort:c.port,symbolPort:l.symbolPort}),o.add(l.symbolPort)}return a};function u1(t,e,r,i){let n=Math.sqrt((r.x-t.x)**2+(r.y-t.y)**2),o=Math.sqrt((i.x-e.x)**2+(i.y-e.y)**2)/n,c=e.x-o*t.x,l=e.y-o*t.y,s=Lt(c,l),p=Jt(o,o);return Ft(s,p)}function BP(t){let e=[],r=new Map,i=new Map,n=null;for(let a of t)if(a.type==="schematic_component")e.push(a);else if(a.type==="schematic_port"&&a.schematic_component_id){let o=r.get(a.schematic_component_id)??[];o.push(a),r.set(a.schematic_component_id,o)}else if(a.type==="source_component")i.set(a.source_component_id,a);for(let a of e){let o=FP({component:a,schematicPorts:r.get(a.schematic_component_id)??[],sourceComponent:a.source_component_id?i.get(a.source_component_id):void 0});if(!o)continue;n=n?y1(n,o):o}return n}function FP({component:t,schematicPorts:e,sourceComponent:r}){if(!t.symbol_name)return null;let i=ur[t.symbol_name];if(!i)return null;let n=m1({schPorts:e,symbol:i,schComponent:t});if(!n[0])return null;let a=u1(n[1]?.symbolPort??i.center,n[1]?.schPort.center??t.center,n[0].symbolPort,n[0].schPort.center),o=null;for(let c of i.primitives){if(c.type!=="text")continue;let l=PP({primitive:c,component:t,sourceComponent:r});if(!l)continue;let s=P(a,c),p=He("reference_designator"),d=IP({x:s.x,y:s.y,width:pn(l)*p,height:p,anchor:c.anchor});o=o?y1(o,d):d}return o}function PP({primitive:t,component:e,sourceComponent:r}){if(t.text==="{REF}")return r?.display_name??r?.name??"";if(t.text==="{VAL}")return e.symbol_display_value??"";return""}function IP({x:t,y:e,width:r,height:i,anchor:n}){let a=t,o=t,c=e-i/2,l=e+i/2;if(n.includes("left"))o=t+r;else if(n.includes("right"))a=t-r;else a=t-r/2,o=t+r/2;if(n.includes("top"))c=e-i,l=e;else if(n.includes("bottom"))c=e,l=e+i;return{minX:a,minY:c,maxX:o,maxY:l}}function y1(t,e){return{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}}var f1=(t,e)=>{if(t.column_widths&&t.column_widths.length>0&&t.row_heights&&t.row_heights.length>0){let p=(d)=>{if(typeof d==="number")return d;if(d.endsWith("mm"))return parseFloat(d);if(d.endsWith("in"))return parseFloat(d)*25.4;return parseFloat(d)};return{column_widths:t.column_widths.map(p),row_heights:t.row_heights.map(p)}}let r=e.filter((p)=>p.type==="schematic_table_cell"&&p.schematic_table_id===t.schematic_table_id);if(r.length===0)return{column_widths:[],row_heights:[]};let i=r.reduce((p,d)=>Math.max(p,d.end_column_index),-1)+1,n=r.reduce((p,d)=>Math.max(p,d.end_row_index),-1)+1,{cell_padding:a=0.2}=t,o=Array(i).fill(0),c=Array(n).fill(0),l={},s={};for(let p of r){let d=He("reference_designator",p.font_size),u=pn(p.text??"")*d+2*a,y=d*1.2+2*a,f=`${p.start_row_index}-${p.start_column_index}`;l[f]=u,s[f]=y}for(let p=0;p<n;p++)for(let d=0;d<i;d++){let m=`${p}-${d}`;if(l[m]&&l[m]>o[d])o[d]=l[m];if(s[m]&&s[m]>c[p])c[p]=s[m]}for(let p of r){if(p.start_column_index===p.end_column_index&&p.start_row_index===p.end_row_index)continue;let d=`${p.start_row_index}-${p.start_column_index}`,m=l[d],u=s[d];if(m===void 0||u===void 0)continue;let y=0;for(let _=p.start_column_index;_<=p.end_column_index;_++)y+=o[_];if(m>y){let x=(m-y)/(p.end_column_index-p.start_column_index+1);for(let Y=p.start_column_index;Y<=p.end_column_index;Y++)o[Y]+=x}let f=0;for(let _=p.start_row_index;_<=p.end_row_index;_++)f+=c[_];if(u>f){let x=(u-f)/(p.end_row_index-p.start_row_index+1);for(let Y=p.start_row_index;Y<=p.end_row_index;Y++)c[Y]+=x}}return{column_widths:o,row_heights:c}},MP=10.16,kP=1.1,Qe=MP/kP,CP=297/Qe,YP=210/Qe,uG=20/Qe,As=5/Qe;function am(t={}){let e=t.center??{x:0,y:0},r=t.sheet_width===void 0?CP:t.sheet_width/Qe,i=t.sheet_height===void 0?YP:t.sheet_height/Qe,n=e.x-r/2,a=e.x+r/2,o=e.y-i/2,c=e.y+i/2;return{center:e,width:r,height:i,minX:n,maxX:a,minY:o,maxY:c,innerMinX:n+As,innerMaxX:a-As,innerMinY:o+As,innerMaxY:c-As}}function LP(t,e=0.5){let{POSITIVE_INFINITY:r,POSITIVE_INFINITY:i,NEGATIVE_INFINITY:n,NEGATIVE_INFINITY:a}=Number,o=0.2;for(let s of t)if(s.type==="schematic_sheet"){let p=am(s);l(p.center,{width:p.width,height:p.height},0)}else if(s.type==="schematic_component")l(s.center,s.size,0);else if(s.type==="schematic_port")l(s.center,{width:o,height:o},0);else if(s.type==="schematic_debug_object"){if(s.shape==="rect")l(s.center,s.size,0);else if(s.shape==="line")l(s.start,{width:0.1,height:0.1},0),l(s.end,{width:0.1,height:0.1},0)}else if(s.type==="schematic_net_label"){let p=He("net_label"),d=Cs(s),u=(d+Ge*2+fi*(s.text?.length||0)+yi)*p,y=h1,f=SP(s.anchor_side)/180*Math.PI,_=wP(s,p,d),x=_i(s.anchor_side),Y={x:_.x+x.x*u/2,y:_.y+x.y*u/2};l(Y,{width:u,height:y},f)}else if(s.type==="schematic_trace")for(let p of s.edges)l(p.from,{width:0.1,height:0.1},0),l(p.to,{width:0.1,height:0.1},0);else if(s.type==="schematic_text"){let d=He("reference_designator",s.font_size)??0.18,m=s.text??"",u=s.display_superscript;if(u){let y=m.split(`
`),f=Math.max(...y.map((X,E)=>Cs({text:X,display_superscript:E===y.length-1?u:void 0})))*d,_=s.anchor,x=_==="left"||_.endsWith("_left")?f/2:_==="right"||_.endsWith("_right")?-f/2:0,Y=_==="top"||_.startsWith("top_")?0:_==="bottom"||_.startsWith("bottom_")?-d:-d/2,b=(y.length+0.3)*d,M=-(Y-0.3*d+b/2),O=-(s.rotation??0)*Math.PI/180;l({x:s.position.x+x*Math.cos(O)-M*Math.sin(O),y:s.position.y+x*Math.sin(O)+M*Math.cos(O)},{width:f,height:b},O)}else{let y=m.length*d,f=d;l(s.position,{width:y,height:f},s.rotation??0)}}else if(s.type==="schematic_voltage_probe"){if(l(s.position,{width:0.2,height:0.4},0),s.name){let p=He("net_label"),d=pn(s.name)*p,m=p,u=0.3,y=s.label_alignment??"top_right",f=s.position.x,_=s.position.y;if(y.includes("top"))_+=0.3+m/2;else if(y.includes("bottom"))_-=0.3+m/2;if(y.includes("right"))f+=0.3+d/2;else if(y.includes("left"))f-=0.3+d/2;l({x:f,y:_},{width:d,height:m},0)}}else if(s.type==="schematic_box")l({x:s.x+s.width/2,y:s.y+s.height/2},{width:s.width,height:s.height},0);else if(s.type==="schematic_table"){let{column_widths:p,row_heights:d}=f1(s,t),m=p.reduce((b,M)=>b+M,0),u=d.reduce((b,M)=>b+M,0),y=s.anchor??"center",f=s.anchor_position.x,_=s.anchor_position.y;if(y.includes("center"))f-=m/2;else if(y.includes("right"))f-=m;if(y.includes("center"))_+=u/2;else if(y.includes("bottom"))_+=u;let x=f+m/2,Y=_-u/2;l({x,y:Y},{width:m,height:u},0)}else if(s.type==="schematic_line")l({x:s.x1,y:s.y1},{width:0.02,height:0.02},0),l({x:s.x2,y:s.y2},{width:0.02,height:0.02},0);else if(s.type==="schematic_circle")l(s.center,{width:s.radius*2,height:s.radius*2},0);else if(s.type==="schematic_rect")l(s.center,{width:s.width,height:s.height},s.rotation);else if(s.type==="schematic_arc")l(s.center,{width:s.radius*2,height:s.radius*2},0);else if(s.type==="schematic_path"){if(s.points&&s.points.length>0)for(let p of s.points)l(p,{width:0.02,height:0.02},0)}if(!Number.isFinite(r))r=-1,i=-1,n=1,a=1;r-=e,i-=e,n+=e,a+=e;let c=BP(t);if(c){if(c.minX<r)r=c.minX-e;if(c.minY<i)i=c.minY-e;if(c.maxX>n)n=c.maxX+e;if(c.maxY>a)a=c.maxY+e}return{minX:r,minY:i,maxX:n,maxY:a};function l(s,p,d){let m=[{x:-p.width/2,y:-p.height/2},{x:p.width/2,y:-p.height/2},{x:p.width/2,y:p.height/2},{x:-p.width/2,y:p.height/2}];for(let u of m){let y=u.x*Math.cos(d)-u.y*Math.sin(d)+s.x,f=u.x*Math.sin(d)+u.y*Math.cos(d)+s.y;r=Math.min(r,y),i=Math.min(i,f),n=Math.max(n,y),a=Math.max(a,f)}}}function Bs(t){if(!Number.isFinite(t))return"0";return Number.parseFloat(t.toFixed(6)).toString()}var hn="image/svg+xml";function EP({schematicGraphic:t,viewport:e}){let r=TP(t);return{name:"g",type:"element",value:"",attributes:{class:"schematic-graphic","pointer-events":"none","data-circuit-json-type":"schematic_graphic","data-schematic-graphic-id":t.schematic_graphic_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:[{name:"image",type:"element",value:"",attributes:{href:r,x:Bs(e.x),y:Bs(e.y),width:Bs(e.width),height:Bs(e.height),preserveAspectRatio:"xMidYMid meet",overflow:"hidden","pointer-events":"none"},children:[]}]}}function TP(t){let e=`Unable to render schematic graphic "${t.schematic_graphic_id}"`,{asset:r,svg_content:i}=t;if(!r){if(i!==void 0)return Kb(i);throw Error(`${e}: asset or svg_content is required`)}if(_1(r.mimetype)!==hn)throw Error(`${e}: asset.mimetype must be "${hn}" (received ${JSON.stringify(r.mimetype)})`);let n=r.url.trim();if(n.toLowerCase().startsWith("data:"))return NP(n,e),n;if(i!==void 0)return Kb(i);throw Error(`${e}: asset.url must be an inline SVG data URL because circuit-to-svg cannot synchronously load ${JSON.stringify(r.url)}`)}function NP(t,e){let r=t.match(/^data:([^,]*),(.*)$/is);if(!r)throw Error(`${e}: asset.url is not a valid SVG data URL`);let i=r[1].split(";").map((l)=>l.trim());if(_1(i.shift()??"")!==hn)throw Error(`${e}: asset.url must use the "${hn}" media type`);let a=r[2],o=i.findIndex((l)=>l.toLowerCase()==="base64"),c=o!==-1;if(c&&o!==i.length-1)throw Error(`${e}: asset.url must place "base64" as its final metadata token`);if(c){let l=a.replace(/\s+/g,"");if(!/^(?:[a-z\d+/]{4})*(?:[a-z\d+/]{2}==|[a-z\d+/]{3}=)?$/i.test(l))throw Error(`${e}: asset.url is not a valid SVG data URL`);return}if(a.includes("#"))throw Error(`${e}: asset.url must percent-encode "#" in a non-base64 SVG data URL`);try{decodeURIComponent(a)}catch(l){throw Error(`${e}: asset.url is not a valid SVG data URL`,{cause:l})}}function Kb(t){let e=new TextEncoder().encode(t),r="",i=32768;for(let n=0;n<e.length;n+=i)r+=String.fromCharCode(...e.subarray(n,n+i));return`data:${hn};base64,${btoa(r)}`}function _1(t){return(t.split(";",1)[0]??"").trim().toLowerCase()}var $t=(t)=>Math.abs(t.a)*0.02,nm=({text:t,realCenter:e,realToScreenTransform:r})=>{let i=P(r,e);return{type:"element",name:"text",value:"",attributes:{x:i.x.toString(),y:i.y.toString(),fill:"red","text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${se(r,"error")}px`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]}},WP=({schNetLabel:t,realToScreenTransform:e,colorMap:r})=>{if(!t.text)return[];let i=t.text.startsWith("N_"),n=i?t.text.slice(2):t.text,a=d1(t),o=[],c=ur[t.symbol_name];if(!c){let Z=nm({text:`Symbol not found: ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e});return Z.attributes={...Z.attributes,...a},o.push(Z),o}let l=c.primitives.filter((Z)=>Z.type==="path"),s=c.primitives.filter((Z)=>Z.type==="text"),p=c.primitives.filter((Z)=>Z.type==="circle"),d=c.primitives.filter((Z)=>Z.type==="box"),m={minX:Math.min(...l.flatMap((Z)=>Z.points.map((N)=>N.x))),maxX:Math.max(...l.flatMap((Z)=>Z.points.map((N)=>N.x))),minY:Math.min(...l.flatMap((Z)=>Z.points.map((N)=>N.y))),maxY:Math.max(...l.flatMap((Z)=>Z.points.map((N)=>N.y)))},u=He("net_label"),f=Cs({...t,text:n})+Ge*2+fi*n.length+yi,_=_i(t.anchor_side),x=t.anchor_position??{x:t.center.x-_.x*f*u/2,y:t.center.y-_.y*f*u/2},b=ye(0/180*Math.PI),M={minX:Math.min(...c.primitives.flatMap((Z)=>Z.type==="path"?Z.points.map((N)=>N.x):[])),maxX:Math.max(...c.primitives.flatMap((Z)=>Z.type==="path"?Z.points.map((N)=>N.x):[])),minY:Math.min(...c.primitives.flatMap((Z)=>Z.type==="path"?Z.points.map((N)=>N.y):[])),maxY:Math.max(...c.primitives.flatMap((Z)=>Z.type==="path"?Z.points.map((N)=>N.y):[]))},O=c.ports?.[0]?{x:c.ports[0].x,y:c.ports[0].y}:{x:M.minX,y:(M.minY+M.maxY)/2},X=P(b,O),E=Ft(Lt(x.x-X.x,x.y-X.y),b,Jt(1)),[I,U]=P(Ft(e,E),[m.minX,m.minY]),[q,st]=P(Ft(e,E),[m.maxX,m.maxY]),H=Math.abs(st-U),k=Math.min(U,st),at=Math.abs(q-I),ot=Math.min(I,q);o.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay sch-net-label-overlay",...a,x:ot.toString(),y:k.toString(),width:at.toString(),height:H.toString(),fill:"transparent"},children:[]});for(let Z of l){let N=Z.points.map((tt,J)=>{let[W,j]=P(Ft(e,E),[tt.x,tt.y]);return`${J===0?"M":"L"} ${W} ${j}`}).join(" ");o.push({name:"path",type:"element",attributes:{class:"sch-net-label-symbol-path",...a,d:N+(Z.closed?" Z":""),stroke:r.schematic.component_outline,fill:"none","stroke-width":`${$t(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let Z of s){let N=P(Ft(e,E),Z),tt=Z.text;if(tt==="{REF}")tt=n||"";else if(tt==="{VAL}")tt="";let W=Math.abs(e.a)*0.1,j={x:N.x,y:N.y};o.push({name:"text",type:"element",attributes:{class:"sch-net-label-symbol-text",...a,x:j.x.toString(),y:j.y.toString(),fill:r.schematic.label_local,"font-family":"sans-serif","text-anchor":vP[Z.anchor],"dominant-baseline":Zb[Z.anchor],"font-size":`${se(e,"reference_designator")}px`,...i&&tt===n?{style:"text-decoration: overline;"}:{}},children:om(tt,Z.text==="{REF}"?t.display_superscript:void 0,se(e,"reference_designator"),Zb[Z.anchor]),value:""})}for(let Z of d){let N=P(Ft(e,E),Z),tt=Ft(e,E).a;o.push({name:"rect",type:"element",attributes:{class:"sch-net-label-symbol-box",...a,x:N.x.toString(),y:N.y.toString(),width:(Z.width*tt).toString(),height:(Z.height*tt).toString(),fill:"red"},value:"",children:[]})}for(let Z of p){let N=P(Ft(e,E),Z),tt=Ft(e,E).a;o.push({name:"circle",type:"element",attributes:{class:"sch-net-label-symbol-circle",...a,cx:N.x.toString(),cy:N.y.toString(),r:(Z.radius*tt).toString(),fill:"none",stroke:r.schematic.component_outline,"stroke-width":`${$t(e)}px`},value:"",children:[]})}return o},RP=({schNetLabel:t,realToScreenTransform:e,colorMap:r})=>{if(!t.text)return[];let i=t.text;if(t.symbol_name)return WP({schNetLabel:t,realToScreenTransform:e,colorMap:r});let n=d1(t),a=[],o=se(e,"net_label"),c=He("net_label"),l=h1/c/2,s=Cs({...t,text:i}),p=P(e,t.center),d=_i(t.anchor_side),m={...d};m.y*=-1;let u=s+Ge*2+fi*i.length+yi,y=t.anchor_position?P(e,t.anchor_position):{x:p.x-m.x*u*o/2,y:p.y-m.y*u*o/2},f=t.anchor_position??{x:t.center.x-d.x*u*c/2,y:t.center.y-d.y*u*c/2},_={left:0,top:-90,bottom:90,right:180}[t.anchor_side],x=[{x:0,y:0},{x:Ge,y:l},{x:Ge*2+yi+fi*i.length+s,y:l},{x:Ge*2+yi+fi*i.length+s,y:-l},{x:Ge,y:-l}].map((X)=>P(Ft(e,Lt(f.x,f.y),Jt(c),ye(_/180*Math.PI)),X)),Y=`
M ${x[0].x},${x[0].y}
L ${x[1].x},${x[1].y}
L ${x[2].x},${x[2].y}
L ${x[3].x},${x[3].y}
L ${x[4].x},${x[4].y}
Z
`;a.push({name:"path",type:"element",attributes:{class:"net-label sch-net-label",...n,d:Y,fill:r.schematic.label_background,stroke:r.schematic.label_global,"stroke-width":`${$t(e)}px`},value:"",children:[]});let b={x:y.x+m.x*o*0.5,y:y.y+m.y*o*0.5},M={left:"start",top:"start",bottom:"start",right:"end"}[t.anchor_side],O={left:"",right:"",top:`rotate(90 ${b.x} ${b.y})`,bottom:`rotate(-90 ${b.x} ${b.y})`}[t.anchor_side];return a.push({name:"text",type:"element",attributes:{class:"net-label-text sch-net-label-text",...n,x:b.x.toString(),y:b.y.toString(),fill:r.schematic.label_global,"text-anchor":M,"dominant-baseline":"central","font-family":"sans-serif","font-variant-numeric":"tabular-nums","font-size":`${o}px`,transform:O},children:om(i,t.display_superscript,o),value:""}),a},OP=0.02,jP=({schPort:t,transform:e})=>{let r=P(e,t.center),i=Math.abs(e.a)*OP*2;return[{name:"g",type:"element",value:"",attributes:{class:"schematic-port-hover sch-port-hover","data-schematic-port-id":t.source_port_id,...t.schematic_sheet_id?{"data-schematic-sheet-id":t.schematic_sheet_id}:{}},children:[{name:"circle",type:"element",value:"",attributes:{cx:r.x.toString(),cy:r.y.toString(),r:i.toString(),fill:"red",opacity:"0"},children:[]}]}]},$P=({component:t,transform:e,circuitJson:r})=>{let i=Gt(r).schematic_port.list({schematic_component_id:t.schematic_component_id}),n=[];for(let a of i)n.push(...jP({schPort:a,transform:e}));return n},XP=({schPort:t,transform:e,colorMap:r})=>{let{x:n,y:a}=t.center,o=[-1,1].map((c)=>{let l=P(e,{x:n-0.05,y:a-c*0.05}),s=P(e,{x:n+0.05,y:a+c*0.05});return`M ${l.x} ${l.y} L ${s.x} ${s.y}`}).join(" ");return{name:"path",type:"element",value:"",attributes:{class:"sch-port-no-connect","data-schematic-port-id":t.schematic_port_id,"data-source-port-id":t.source_port_id,d:o,fill:"none",stroke:r.schematic.no_connect,"stroke-width":`${$t(e)}px`,"stroke-linecap":"round"},children:[]}},Jb=0.02,VP=({schPort:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],a=Math.abs(e.a)*Jb,o=Math.abs(e.a)*Jb,c=P(e,t.center),l=r.find((p)=>p.type==="source_port"&&p.source_port_id===t.source_port_id);if(!l?.do_not_connect)n.push({name:"circle",type:"element",value:"",attributes:{class:"component-pin sch-component-pin sch-port-indicator",cx:c.x.toString(),cy:c.y.toString(),r:a.toString(),fill:"none",stroke:i.schematic.component_outline,"stroke-width":o.toString(),"data-schematic-port-id":t.schematic_port_id},children:[]});let s=t.display_pin_label??l?.name;if(s){let p={...t.center},d=t.distance_from_component_edge??0,m=0.05,u="middle",y="";switch(t.facing_direction){case"left":p.x+=d/2,p.y+=0.05,u="start";break;case"right":p.x-=d/2,p.y+=0.05,u="end";break;case"up":p.y-=d/2,p.x-=0.05,u="middle";break;case"down":p.y+=d/2,p.x-=0.05,u="middle";break}let f=P(e,p),_=se(e,"pin_number");if(t.facing_direction==="up"||t.facing_direction==="down")y=`rotate(-90 ${f.x} ${f.y})`;n.push({name:"text",type:"element",value:"",attributes:{class:"port-indicator-label sch-port-label",x:f.x.toString(),y:f.y.toString(),fill:i.schematic.component_outline,"font-family":"sans-serif","font-size":`${_*0.7}px`,"text-anchor":u,"dominant-baseline":"middle",...y&&{transform:y}},children:[{type:"text",value:s,name:"",attributes:{},children:[]}]})}return n},g1=(t)=>({type:"element",name:"tspan",value:"",attributes:t.is_overlined?{"text-decoration":"overline"}:{},children:[{type:"text",name:"",value:t.text,attributes:{},children:[]}]}),zP=(t)=>t.filter((e)=>e.text).map(g1),DP=(t)=>{let e=[[]];for(let r of t)r.text.split(`
`).forEach((i,n)=>{if(n>0)e.push([]);if(i)e.at(-1).push(g1({...r,text:i}))});return e},sm=({elm:t,transform:e,colorMap:r})=>{let i=P(e,t.position),n={center:"middle",center_right:"end",bottom_left:"start",bottom_center:"middle",bottom_right:"end",left:"start",right:"end",top:"middle",bottom:"middle",top_left:"start",top_center:"middle",top_right:"end",center_left:"start"},a={center:"middle",center_right:"middle",bottom_left:"ideographic",bottom_center:"ideographic",bottom_right:"ideographic",left:"middle",right:"middle",top:"hanging",bottom:"ideographic",top_left:"hanging",top_center:"hanging",top_right:"hanging",center_left:"middle"},o=t.text.split(`
`),c=DP(t.text_parts??[]),l=o.length===1?t.text_parts?.length?c[0]:[{type:"text",value:t.text,name:t.schematic_text_id,attributes:{},children:[]}]:o.map((s,p)=>({type:"element",name:"tspan",value:"",attributes:{x:i.x.toString(),...p>0?{dy:"1em"}:{}},children:t.text_parts?.length?c[p]??[]:[{type:"text",value:s,name:p===0?t.schematic_text_id:"",attributes:{},children:[]}]}));if(t.display_superscript)(o.length===1?l:l[l.length-1].children).push(...om("",t.display_superscript,se(e,"reference_designator",t.font_size),a[t.anchor]).slice(1));return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:i.x.toString(),y:i.y.toString(),fill:t.color??r.schematic.sheet_label,"text-anchor":n[t.anchor],"dominant-baseline":a[t.anchor],"font-family":"sans-serif","font-size":`${se(e,"reference_designator",t.font_size)}px`,transform:`rotate(${t.rotation}, ${i.x}, ${i.y})`},children:l}};function x1({schArc:t,transform:e,colorMap:r}){let i=P(e,t.center),n=Math.abs(e.a)*t.radius,a=t.stroke_width??0.02,o=Math.abs(e.a)*a,c=t.start_angle_degrees*Math.PI/180,l=t.end_angle_degrees*Math.PI/180,s=i.x+n*Math.cos(c),p=i.y+n*Math.sin(c),d=i.x+n*Math.cos(l),m=i.y+n*Math.sin(l),u=t.end_angle_degrees-t.start_angle_degrees;if(t.direction==="clockwise")u=-u;if(u<0)u+=360;let y=u>180?1:0,f=t.direction==="clockwise"?1:0;return[{name:"path",type:"element",attributes:{class:"sch-arc",d:`M ${s} ${p} A ${n} ${n} 0 ${y} ${f} ${d} ${m}`,fill:"none",stroke:t.color,"stroke-width":o.toString(),...t.is_dashed&&{"stroke-dasharray":(o*3).toString()},"data-schematic-arc-id":t.schematic_arc_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}var UP=({schematicBox:t,transform:e,colorMap:r})=>{let i=P(e,{x:t.x,y:t.y}),n=P(e,{x:t.x+t.width,y:t.y+t.height}),a=Math.min(i.y,n.y),o=Math.max(i.y,n.y),c=Math.min(i.x,n.x),l=Math.max(i.x,n.x),s=$t(e),p={class:"schematic-box sch-box",x:c.toString(),y:a.toString(),width:(l-c).toString(),height:(o-a).toString(),"stroke-width":`${s}px`,stroke:r.schematic.component_outline||"black",fill:"transparent"};if(t.is_dashed){let d=8*s,m=4*s;p["stroke-dasharray"]=`${d} ${m}`}return[{name:"rect",type:"element",value:"",attributes:p,children:[]}]};function b1({schCircle:t,transform:e,colorMap:r}){let i=P(e,t.center),n=Math.abs(e.a)*t.radius,a=t.stroke_width??0.02,o=Math.abs(e.a)*a;return[{name:"circle",type:"element",attributes:{class:"sch-circle",cx:i.x.toString(),cy:i.y.toString(),r:n.toString(),fill:t.is_filled?t.fill_color??t.color:"none",stroke:t.color,"stroke-width":o.toString(),...t.is_dashed&&{"stroke-dasharray":(o*3).toString()},"data-schematic-circle-id":t.schematic_circle_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}var v1=(t,e)=>{for(let r of t){if(r.type!=="source_trace")continue;let i=r;if(Array.isArray(i.connected_source_port_ids)&&i.connected_source_port_ids.includes(e))return!0}return!1},GP={top_left:"start",top_right:"end",middle_left:"start",middle_right:"end",bottom_left:"start",bottom_right:"end",center:"middle",middle_top:"middle",middle_bottom:"middle"},HP={top_left:"hanging",top_right:"hanging",bottom_left:"ideographic",bottom_right:"ideographic",center:"middle",middle_left:"middle",middle_right:"middle",middle_top:"hanging",middle_bottom:"ideographic"},QP=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],a=ur[t.symbol_name];if(!a)return[nm({text:`Symbol not found: ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e})];let o=Gt(r).schematic_port.list({schematic_component_id:t.schematic_component_id}),c=Gt(r).source_component.get(t.source_component_id),l=m1({schPorts:o,symbol:a,schComponent:t});if(!l[0])return[nm({text:`Could not match ports for symbol ${t.symbol_name}`,realCenter:t.center,realToScreenTransform:e})];let s=u1(l[1]?.symbolPort??a.center,l[1]?.schPort.center??t.center,l[0].symbolPort,l[0].schPort.center),p=a.primitives.filter((I)=>I.type==="path"),d=a.primitives.filter((I)=>I.type==="text"),m=a.primitives.filter((I)=>I.type==="circle"),u=a.primitives.filter((I)=>I.type==="box"),y=new Set;for(let I of l)if(v1(r,I.schPort.source_port_id)||Gt(r).source_port.get(I.schPort.source_port_id)?.do_not_connect)y.add(I.symbolPort);let f={minX:Math.min(...p.flatMap((I)=>I.points.map((U)=>U.x))),maxX:Math.max(...p.flatMap((I)=>I.points.map((U)=>U.x))),minY:Math.min(...p.flatMap((I)=>I.points.map((U)=>U.y))),maxY:Math.max(...p.flatMap((I)=>I.points.map((U)=>U.y)))},[_,x]=P(Ft(e,s),[f.minX,f.minY]),[Y,b]=P(Ft(e,s),[f.maxX,f.maxY]),M=Math.abs(b-x),O=Math.min(x,b),X=Math.abs(Y-_),E=Math.min(_,Y);n.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:E.toString(),y:O.toString(),width:X.toString(),height:M.toString(),fill:"transparent"},children:[]});for(let I of p){let{points:U,color:q,closed:st,fill:H}=I;n.push({type:"element",name:"path",attributes:{class:"sch-component-symbol-path",d:U.map((k,at)=>{let[ot,Z]=P(Ft(e,s),[k.x,k.y]);return`${at===0?"M":"L"} ${ot} ${Z}`}).join(" ")+(st?" Z":""),stroke:i.schematic.component_outline,fill:"none","stroke-width":`${$t(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}for(let I of d){let U=P(Ft(e,s),I),q="",st=I.text==="{REF}";if(st)q=c?.display_name??c?.name??"";else if(I.text==="{VAL}")q=t.symbol_display_value??"";let H=HP[I.anchor];n.push({name:"text",type:"element",attributes:{class:st?"sch-component-name sch-component-text":"sch-component-text",x:U.x.toString(),y:U.y.toString(),...st?{stroke:i.schematic.background,"stroke-width":`${$t(e)}px`,"paint-order":"stroke"}:{},fill:i.schematic.label_local,"font-family":"sans-serif","text-anchor":GP[I.anchor],"dominant-baseline":H,"font-size":`${se(e,"reference_designator")}px`},value:"",children:[{type:"text",value:q,name:"",attributes:{},children:[]}]})}for(let I of u){let U=P(Ft(e,s),I),q=Ft(e,s).a;n.push({name:"rect",type:"element",attributes:{class:"sch-component-symbol-box",x:U.x.toString(),y:U.y.toString(),width:(I.width*q).toString(),height:(I.height*q).toString(),fill:"red"},value:"",children:[]})}for(let I of a.ports){if(y.has(I))continue;let U=P(Ft(e,s),I);n.push({type:"element",name:"circle",attributes:{class:"component-pin sch-component-pin",cx:U.x.toString(),cy:U.y.toString(),r:`${Math.abs(e.a)*0.02}px`,"stroke-width":`${$t(e)}px`,fill:"none",stroke:i.schematic.component_outline},value:"",children:[]})}for(let I of m){let U=P(Ft(e,s),I),q=Math.abs(I.radius*e.a);n.push({type:"element",name:"circle",attributes:{class:"sch-component-symbol-circle",cx:U.x.toString(),cy:U.y.toString(),r:`${q}px`,"stroke-width":`${$t(e)}px`,fill:"none",stroke:i.schematic.component_outline},value:"",children:[]})}return n},an=0.02,qb=(t,e,r,i,n)=>{let a=Math.PI/6,o={x:t.x-r*Math.cos(e-a),y:t.y-r*Math.sin(e-a)},c={x:t.x-r*Math.cos(e+a),y:t.y-r*Math.sin(e+a)};return{name:"polygon",type:"element",attributes:{points:`${t.x},${t.y} ${o.x},${o.y} ${c.x},${c.y}`,fill:"white",stroke:i,"stroke-width":`${n}px`},value:"",children:[]}},ZP=({schPort:t,schComponent:e,transform:r,circuitJson:i})=>{let n=[],a=Gt(i).source_port.get(t.source_port_id),o={x:t.center.x,y:t.center.y},c=t.distance_from_component_edge??0.4;switch(t.side_of_component){case"left":o.x+=c;break;case"right":o.x-=c;break;case"top":o.y-=c;break;case"bottom":o.y+=c;break}let l=P(r,t.center),s=P(r,o),p=a!=null&&a.source_component_id==null&&typeof t.is_connected==="boolean"?t.is_connected:v1(i,t.source_port_id),d=t.is_drawn_with_inversion_circle??!1,m=0.06,u={...t.center};if(!p&&!a?.do_not_connect)switch(t.side_of_component){case"left":u.x+=an;break;case"right":u.x-=an;break;case"top":u.y-=an;break;case"bottom":u.y+=an;break}let y=P(r,u);if(d){let b=Math.abs(r.a)*m,M={...s};switch(t.side_of_component){case"left":M.x-=b,s.x-=b*2;break;case"right":M.x+=b,s.x+=b*2;break;case"top":M.y-=b,s.y-=b*2;break;case"bottom":M.y+=b,s.y+=b*2;break}n.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-inversion-bubble",cx:M.x.toString(),cy:M.y.toString(),r:b.toString(),fill:"white",stroke:Zt.schematic.component_outline,"stroke-width":`${$t(r)}px`},value:"",children:[]})}n.push({name:"line",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-line",x1:s.x.toString(),y1:s.y.toString(),x2:y.x.toString(),y2:y.y.toString(),"stroke-width":`${$t(r)}px`},value:"",children:[]});let f=Math.abs(r.a)*an,_=[];if(!p&&!a?.do_not_connect)_.push({name:"circle",type:"element",attributes:{class:"component-pin sch-component-pin sch-port-terminal",cx:l.x.toString(),cy:l.y.toString(),r:f.toString(),"stroke-width":`${$t(r)}px`},value:"",children:[]});_.push({name:"rect",type:"element",attributes:{x:(l.x-f).toString(),y:(l.y-f).toString(),width:(f*2).toString(),height:(f*2).toString(),opacity:"0"},value:"",children:[]}),n.push({name:"g",type:"element",value:"",attributes:{class:"sch-port","data-schematic-port-id":t.source_port_id},children:_});let{has_input_arrow:x,has_output_arrow:Y}=t;if((x||Y)&&t.side_of_component){let b=Math.abs(r.a)*0.1,M=Zt.schematic.component_outline,O=b*Math.cos(Math.PI/6),X=$t(r)/3,E=0,I=0;if(t.side_of_component==="left")E=0,I=Math.PI;else if(t.side_of_component==="right")E=Math.PI,I=0;else if(t.side_of_component==="top")E=Math.PI/2,I=-Math.PI/2;else if(t.side_of_component==="bottom")E=-Math.PI/2,I=Math.PI/2;let U=x&&Y,q={...s},st={...s};if(U){let H=O;if(t.side_of_component==="left")st.x-=H;else if(t.side_of_component==="right")st.x+=H;else if(t.side_of_component==="top")st.y-=H;else if(t.side_of_component==="bottom")st.y+=H}if(x)n.push(qb(q,E,b,M,X));if(Y){let H={x:st.x+b*Math.cos(I),y:st.y+b*Math.sin(I)};n.push(qb(H,I,b,M,X))}}return n},KP=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,circuitJson:a}=t,o={x:r.center.x,y:r.center.y};if(!r.side_of_component)return[];let c=_i(r.side_of_component),l=r.distance_from_component_edge??0.4;if(o.x+=c.x*l/2,o.y+=c.y*l/2,r.side_of_component==="top"||r.side_of_component==="bottom")o.x-=0.02;else o.y+=0.02;let s=P(n,o);return e.push({name:"text",type:"element",attributes:{class:"pin-number sch-pin-number",x:s.x.toString(),y:s.y.toString(),style:"font-family: sans-serif;",fill:Zt.schematic.pin_number,"text-anchor":"middle","dominant-baseline":"auto","font-size":`${se(n,"pin_number")}px`,transform:r.side_of_component==="top"||r.side_of_component==="bottom"?`rotate(-90 ${s.x} ${s.y})`:""},children:[{type:"text",value:r.pin_number?.toString()||"",name:"",attributes:{},children:[]}],value:""}),e},t1=0.1,S1=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,labelColor:a=Zt.schematic.pin_number,labelClassName:o="pin-number sch-pin-label"}=t,c={x:r.center.x,y:r.center.y};if(!r.side_of_component)return[];let l=_i(r.side_of_component),s=r.distance_from_component_edge??0.4;c.x+=l.x*(s+t1),c.y+=l.y*(s+t1);let p=P(n,c),d=r.display_pin_label??i.port_labels?.[`${r.pin_number}`];if(!d)return[];let m=d.startsWith("N_"),u=m?d.slice(2):d,y=r.display_pin_label_text_parts,f=r.is_drawn_with_inversion_circle??!1,_=se(n,m||f?"negated_pin_number":"pin_number",r.display_pin_label_font_size);return e.push({name:"text",type:"element",attributes:{class:o,x:p.x.toString(),y:p.y.toString(),style:`font-family: sans-serif;${m&&!y?.length?" text-decoration: overline;":""}`,fill:a,"text-anchor":r.side_of_component==="left"||r.side_of_component==="bottom"?"start":"end","dominant-baseline":"middle","font-size":`${_}px`,transform:r.side_of_component==="top"||r.side_of_component==="bottom"?`rotate(-90 ${p.x} ${p.y})`:""},children:y?.length?zP(y):[{type:"text",value:u||"",name:"",attributes:{},children:[]}],value:""}),e},JP=(t)=>{let e=[],{schPort:r,schComponent:i,transform:n,circuitJson:a}=t;return e.push(...ZP(t)),e.push(...KP(t)),e.push(...S1(t)),e},qP=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],a=P(e,{x:t.center.x-t.size.width/2,y:t.center.y+t.size.height/2}),o=P(e,{x:t.center.x+t.size.width/2,y:t.center.y-t.size.height/2}),c=o.x-a.x,l=o.y-a.y;n.push({name:"rect",type:"element",value:"",attributes:{class:"component chip sch-component-body",x:a.x.toString(),y:a.y.toString(),width:c.toString(),height:l.toString(),"stroke-width":`${$t(e)}px`,fill:i.schematic.component_body,stroke:i.schematic.component_outline},children:[]}),n.push({name:"rect",type:"element",value:"",attributes:{class:"component-overlay sch-component-overlay",x:a.x.toString(),y:a.y.toString(),width:c.toString(),height:l.toString(),fill:"transparent"},children:[]});let s=Gt(r).schematic_text.list();for(let d of s)if(d.schematic_component_id===t.schematic_component_id)n.push(sm({elm:d,transform:e,colorMap:i}));let p=Gt(r).schematic_port.list({schematic_component_id:t.schematic_component_id});for(let d of p)n.push(...JP({schPort:d,schComponent:t,transform:e,circuitJson:r}));return n};function w1({isDashed:t,dashLength:e,dashGap:r,strokeWidth:i,transform:n}){if(!t)return;let a=Math.abs(n.a),o=i*a*3,c=e!==void 0?e*a:o,l=r!==void 0?r*a:o;return`${c} ${l}`}function A1({schLine:t,transform:e,colorMap:r}){let i=P(e,{x:t.x1,y:t.y1}),n=P(e,{x:t.x2,y:t.y2}),a=t.stroke_width??0.02,o=Math.abs(e.a)*a,c=w1({isDashed:t.is_dashed,dashLength:t.dash_length,dashGap:t.dash_gap,strokeWidth:a,transform:e});return[{name:"line",type:"element",attributes:{class:"sch-line",x1:i.x.toString(),y1:i.y.toString(),x2:n.x.toString(),y2:n.y.toString(),stroke:t.color,"stroke-width":o.toString(),...c&&{"stroke-dasharray":c},"data-schematic-line-id":t.schematic_line_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}function B1({schRect:t,transform:e,colorMap:r}){let i=P(e,t.center),n=Math.abs(e.a)*t.width,a=Math.abs(e.d)*t.height,o=t.stroke_width??0.02,c=Math.abs(e.a)*o,l=i.x-n/2,s=i.y-a/2;return[{name:"rect",type:"element",attributes:{class:"sch-rect",x:l.toString(),y:s.toString(),width:n.toString(),height:a.toString(),fill:t.is_filled?t.fill_color??t.color:"none",stroke:t.color,"stroke-width":c.toString(),...t.is_dashed&&{"stroke-dasharray":(c*3).toString()},...t.rotation!==0&&{transform:`rotate(${t.rotation} ${i.x} ${i.y})`},"data-schematic-rect-id":t.schematic_rect_id,...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}function F1({schPath:t,transform:e,colorMap:r}){let i=t.stroke_color??r.schematic.component_outline,n=t.fill_color??"none",a=t.stroke_width??0.02,o=Math.abs(e.a)*a,c=w1({isDashed:t.is_dashed,dashLength:t.dash_length,dashGap:t.dash_gap,strokeWidth:a,transform:e});if(!t.points||t.points.length<2)return[];return[{name:"path",type:"element",attributes:{class:"sch-path",d:t.points.map((p)=>P(e,{x:p.x,y:p.y})).map((p,d)=>`${d===0?"M":"L"} ${p.x} ${p.y}`).join(" "),stroke:i,"stroke-width":o.toString(),fill:t.is_filled?n:"none","stroke-linecap":"round","stroke-linejoin":"round",...c&&{"stroke-dasharray":c},...t.schematic_component_id&&{"data-schematic-component-id":t.schematic_component_id}},children:[],value:""}]}var tI=({component:t,transform:e,circuitJson:r,colorMap:i})=>{let n=[],a=t.schematic_component_id;for(let o of r){if(!("schematic_component_id"in o)||o.schematic_component_id!==a)continue;if(o.type==="schematic_text"&&t.is_box_with_pins===!1)n.push(sm({elm:o,transform:e,colorMap:i}));else if(o.type==="schematic_line")n.push(...A1({schLine:o,transform:e,colorMap:i}));else if(o.type==="schematic_circle")n.push(...b1({schCircle:o,transform:e,colorMap:i}));else if(o.type==="schematic_rect")n.push(...B1({schRect:o,transform:e,colorMap:i}));else if(o.type==="schematic_arc")n.push(...x1({schArc:o,transform:e,colorMap:i}));else if(o.type==="schematic_path")n.push(...F1({schPath:o,transform:e,colorMap:i}))}if(t.is_box_with_pins===!1){let o=r.filter((l)=>l.type==="schematic_line"&&l.schematic_component_id===a),c=r.filter((l)=>l.type==="schematic_port"&&l.schematic_component_id===a);for(let l of c){let s=o.find((f)=>f.x1===l.center.x&&f.y1===l.center.y||f.x2===l.center.x&&f.y2===l.center.y);if(!s)continue;let p=s.x1===l.center.x&&s.y1===l.center.y?{x:s.x2,y:s.y2}:{x:s.x1,y:s.y1},d=p.x-l.center.x,m=p.y-l.center.y,u=Math.abs(d)>Math.abs(m)?d>0?"left":"right":m>0?"bottom":"top",y=Math.max(Math.abs(d),Math.abs(m));n.push(...S1({schPort:{...l,side_of_component:u,distance_from_component_edge:y},schComponent:t,transform:e,circuitJson:r,labelClassName:"port-label sch-pin-label",labelColor:i.schematic.pin_name}))}}return n};function eI(t){let{component:e}=t,r=[];if(e.is_box_with_pins!==!1)if(e.symbol_name)r=QP(t);else r=qP(t);let i=tI(t),n=[...r,...i];return[{type:"element",name:"g",attributes:{class:"sch-component","data-circuit-json-type":"schematic_component","data-schematic-component-id":e.schematic_component_id,...e.schematic_sheet_id?{"data-schematic-sheet-id":e.schematic_sheet_id}:{}},children:n,value:""}]}function rI({debugObject:t,transform:e}){if(t.shape==="rect"){let[r,i]=P(e,[t.center.x-t.size.width/2,t.center.y-t.size.height/2]),[n,a]=P(e,[t.center.x+t.size.width/2,t.center.y+t.size.height/2]);[i,a]=[Math.min(i,a),Math.max(i,a)];let o=Math.abs(n-r),c=Math.abs(a-i),[l,s]=P(e,[t.center.x,t.center.y]);return[{name:"rect",type:"element",value:"",attributes:{x:r.toString(),y:i.toString(),width:o.toString(),height:c.toString(),fill:"none",stroke:"red","stroke-width":(0.02*Math.abs(e.a)).toString(),"stroke-dasharray":"5,5"},children:t.label?[{name:"text",type:"element",value:"",attributes:{x:l.toString(),y:(s-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(e.a)).toString(),fill:"red"},children:[{type:"text",value:t.label,name:"",attributes:{},children:[]}]}]:[]}]}if(t.shape==="line"){let[r,i]=P(e,[t.start.x,t.start.y]),[n,a]=P(e,[t.end.x,t.end.y]),o=(r+n)/2,c=(i+a)/2;return[{name:"line",type:"element",value:"",attributes:{x1:r.toString(),y1:i.toString(),x2:n.toString(),y2:a.toString(),stroke:"red","stroke-width":(0.02*Math.abs(e.a)).toString(),"stroke-dasharray":"5,5"},children:t.label?[{name:"text",type:"element",value:"",attributes:{x:o.toString(),y:(c-10).toString(),"text-anchor":"middle","font-size":(0.2*Math.abs(e.a)).toString(),fill:"red"},children:[{type:"text",value:t.label,name:"",attributes:{},children:[]}]}]:[]}]}return[]}var P1=0.2/Qe,iI=3/Qe,Fs=["1","2","3","4","5","6"],sn=["A","B","C","D"];function nI({schematicSheet:t,transform:e,colorMap:r}){let i=am(t),n=r.schematic.sheet,a=r.schematic.net_name,o=[e1({id:`${t.schematic_sheet_id}_outer`,center:i.center,width:i.width,height:i.height,transform:e,color:n}),e1({id:`${t.schematic_sheet_id}_inner`,center:i.center,width:i.innerMaxX-i.innerMinX,height:i.innerMaxY-i.innerMinY,transform:e,color:n})];for(let c=1;c<Fs.length;c++){let l=i.innerMinX+(i.innerMaxX-i.innerMinX)*c/Fs.length;o.push(Ps({id:`${t.schematic_sheet_id}_top_column_${c}`,x1:l,y1:i.maxY,x2:l,y2:i.innerMaxY,transform:e,color:n}),Ps({id:`${t.schematic_sheet_id}_bottom_column_${c}`,x1:l,y1:i.minY,x2:l,y2:i.innerMinY,transform:e,color:n}))}for(let c=1;c<sn.length;c++){let l=i.innerMinY+(i.innerMaxY-i.innerMinY)*c/sn.length;o.push(Ps({id:`${t.schematic_sheet_id}_left_row_${c}`,x1:i.minX,y1:l,x2:i.innerMinX,y2:l,transform:e,color:n}),Ps({id:`${t.schematic_sheet_id}_right_row_${c}`,x1:i.maxX,y1:l,x2:i.innerMaxX,y2:l,transform:e,color:n}))}return Fs.forEach((c,l)=>{let s=i.innerMinX+(i.innerMaxX-i.innerMinX)*(l+0.5)/Fs.length;o.push(Is({text:c,x:s,y:(i.maxY+i.innerMaxY)/2,transform:e,color:a}),Is({text:c,x:s,y:(i.minY+i.innerMinY)/2,transform:e,color:a}))}),sn.forEach((c,l)=>{let s=i.innerMinY+(i.innerMaxY-i.innerMinY)*(sn.length-l-0.5)/sn.length;o.push(Is({text:c,x:(i.minX+i.innerMinX)/2,y:s,transform:e,color:a}),Is({text:c,x:(i.maxX+i.innerMaxX)/2,y:s,transform:e,color:a}))}),[{name:"g",type:"element",value:"",attributes:{class:"schematic-sheet","data-circuit-json-type":"schematic_sheet","data-schematic-sheet-id":t.schematic_sheet_id},children:o}]}function e1({id:t,center:e,width:r,height:i,transform:n,color:a}){let o=P(n,e),c=Math.abs(n.a)*r,l=Math.abs(n.d)*i;return{name:"rect",type:"element",value:"",attributes:{class:"sch-rect",x:(o.x-c/2).toString(),y:(o.y-l/2).toString(),width:c.toString(),height:l.toString(),fill:"none",stroke:a,"stroke-width":(Math.abs(n.a)*P1).toString(),"data-schematic-rect-id":t},children:[]}}function Ps({id:t,x1:e,y1:r,x2:i,y2:n,transform:a,color:o}){let c=P(a,{x:e,y:r}),l=P(a,{x:i,y:n});return{name:"line",type:"element",value:"",attributes:{class:"sch-line",x1:c.x.toString(),y1:c.y.toString(),x2:l.x.toString(),y2:l.y.toString(),stroke:o,"stroke-width":(Math.abs(a.a)*P1).toString(),"data-schematic-line-id":t},children:[]}}function Is({text:t,x:e,y:r,transform:i,color:n}){let a=P(i,{x:e,y:r});return{type:"element",name:"text",value:"",attributes:{class:"sch-text",x:a.x.toString(),y:a.y.toString(),fill:n,"text-anchor":"middle","dominant-baseline":"middle","font-family":"sans-serif","font-size":`${se(i,"reference_designator",iI)}px`,transform:`rotate(0, ${a.x}, ${a.y})`},children:[{type:"text",value:t,name:"",attributes:{},children:[]}]}}var oI=({schematicTable:t,transform:e,colorMap:r,circuitJson:i})=>{let{anchor_position:n,border_width:a=0.05,anchor:o="center"}=t,{column_widths:c,row_heights:l}=f1(t,i),s=c.reduce((E,I)=>E+I,0),p=l.reduce((E,I)=>E+I,0),{x:d,y:m}=n;if(o.includes("center"))d-=s/2;else if(o.includes("right"))d-=s;if(o.includes("center"))m+=p/2;else if(o.includes("bottom"))m+=p;let u=[],y=a*Math.abs(e.a),f=$t(e),[_,x]=P(e,[d,m]),[Y,b]=P(e,[d+s,m-p]);u.push({name:"rect",type:"element",attributes:{class:"sch-table-border",x:_.toString(),y:x.toString(),width:(Y-_).toString(),height:(b-x).toString(),fill:"none",stroke:r.schematic.table,"stroke-width":y.toString()},children:[],value:""});let M=i.filter((E)=>E.type==="schematic_table_cell"&&E.schematic_table_id===t.schematic_table_id),O=d;for(let E=0;E<c.length-1;E++){O+=c[E];let I=m;for(let U=0;U<l.length;U++){let q=I-l[U];if(!M.some((H)=>H.start_column_index<=E&&H.end_column_index>E&&H.start_row_index<=U&&H.end_row_index>=U)){let H=P(e,{x:O,y:I}),k=P(e,{x:O,y:q});u.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:H.x.toString(),y1:H.y.toString(),x2:k.x.toString(),y2:k.y.toString(),stroke:r.schematic.table,"stroke-width":f.toString()},children:[],value:""})}I=q}}let X=m;for(let E=0;E<l.length-1;E++){X-=l[E];let I=d;for(let U=0;U<c.length;U++){let q=I+c[U];if(!M.some((H)=>H.start_row_index<=E&&H.end_row_index>E&&H.start_column_index<=U&&H.end_column_index>=U)){let H=P(e,{x:I,y:X}),k=P(e,{x:q,y:X});u.push({name:"line",type:"element",attributes:{class:"sch-table-grid-line",x1:H.x.toString(),y1:H.y.toString(),x2:k.x.toString(),y2:k.y.toString(),stroke:r.schematic.table,"stroke-width":f.toString()},children:[],value:""})}I=q}}for(let E of M)if(E.text){let I=c.slice(E.start_column_index,E.end_column_index+1).reduce((W,j)=>W+j,0),U=l.slice(E.start_row_index,E.end_row_index+1).reduce((W,j)=>W+j,0),q=d+c.slice(0,E.start_column_index).reduce((W,j)=>W+j,0),st=m-l.slice(0,E.start_row_index).reduce((W,j)=>W+j,0),{cell_padding:H=0.2}=t,k=E.horizontal_align??"center",at=E.vertical_align??"middle",ot={x:q+I/2,y:st-U/2};if(k==="left")ot.x=q+H;else if(k==="right")ot.x=q+I-H;if(at==="top")ot.y=st-H;else if(at==="bottom")ot.y=st-U+H;let Z=P(e,ot),N=se(e,"reference_designator",E.font_size),tt={left:"start",center:"middle",right:"end"},J={top:"hanging",middle:"middle",bottom:"ideographic"};u.push({name:"text",type:"element",attributes:{class:"sch-table-text",x:Z.x.toString(),y:Z.y.toString(),"font-size":`${N}px`,"text-anchor":tt[k],"dominant-baseline":J[at],fill:r.schematic.table,"font-family":"sans-serif"},children:[{type:"text",value:E.text,name:"",attributes:{},children:[]}],value:""})}return[{name:"g",type:"element",attributes:{class:"sch-table","data-schematic-table-id":t.schematic_table_id},children:u,value:""}]};function aI({trace:t,transform:e,colorMap:r}){let i=t.edges;if(i.length===0)return[];let n=[],a=[],o="";for(let c=0;c<i.length;c++){let l=i[c];if(l.is_crossing)continue;let[s,p]=P(e,[l.from.x,l.from.y]),[d,m]=P(e,[l.to.x,l.to.y]);if(c===0||i[c-1]?.is_crossing)o+=`M ${s} ${p} L ${d} ${m}`;else o+=` L ${d} ${m}`}if(o)n.push({name:"path",type:"element",attributes:{d:o,class:"trace-invisible-hover-outline sch-trace-hitbox",stroke:r.schematic.wire,fill:"none","stroke-width":`${$t(e)*8}px`,"stroke-linecap":"round",opacity:"0","stroke-linejoin":"round"},value:"",children:[]}),n.push({name:"path",type:"element",attributes:{class:"sch-trace-path",d:o,stroke:r.schematic.wire,fill:"none","stroke-width":`${$t(e)}px`,"stroke-linecap":"round","stroke-linejoin":"round"},value:"",children:[]});for(let c of i){if(!c.is_crossing)continue;let[l,s]=P(e,[c.from.x,c.from.y]),[p,d]=P(e,[c.to.x,c.to.y]),m=(l+p)/2,u=(s+d)/2,y=p-l,f=d-s,_=Math.sqrt(y*y+f*f),x=_*0.7,Y=-f/_*x,b=y/_*x,M=m+Y,O=u-Math.abs(b);a.push({name:"path",type:"element",attributes:{class:"trace-crossing-outline sch-trace-crossing-outline",d:`M ${l} ${s} Q ${M} ${O} ${p} ${d}`,stroke:r.schematic.background,fill:"none","stroke-width":`${$t(e)*1.5}px`,"stroke-linecap":"butt"},value:"",children:[]}),a.push({name:"path",type:"element",attributes:{class:"sch-trace-crossing-path",d:`M ${l} ${s} Q ${M} ${O} ${p} ${d}`,stroke:r.schematic.wire,fill:"none","stroke-width":`${$t(e)}px`,"stroke-linecap":"round"},value:"",children:[]})}if(t.junctions)for(let c of t.junctions){let[l,s]=P(e,[c.x,c.y]);a.push({name:"circle",type:"element",attributes:{cx:l.toString(),cy:s.toString(),r:(Math.abs(e.a)*0.03).toString(),class:"trace-junction sch-trace-junction",fill:r.schematic.junction},value:"",children:[]})}return[{name:"g",type:"element",value:"",attributes:{class:"trace sch-trace","data-layer":"base","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":t.schematic_trace_id,...t.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":t.subcircuit_connectivity_map_key}},children:n},{name:"g",type:"element",value:"",attributes:{class:"trace-overlays sch-trace-overlays","data-layer":"overlay","data-circuit-json-type":"schematic_trace","data-schematic-trace-id":t.schematic_trace_id,...t.subcircuit_connectivity_map_key&&{"data-subcircuit-connectivity-map-key":t.subcircuit_connectivity_map_key}},children:a}]}function sI({probe:t,transform:e,colorMap:r,fallbackColor:i}){let[n,a]=P(e,[t.position.x,t.position.y]),o=t.color??i??r.schematic.reference,c=Math.abs(e.a)*0.6,l=Math.abs(e.a)*0.28,s=t.label_alignment??"top_right",p,d,m,u;switch(s){case"top_left":p=-135*Math.PI/180,d="end",m=-8,u=-8;break;case"top_center":p=-90*Math.PI/180,d="middle",m=0,u=-8;break;case"top_right":p=-45*Math.PI/180,d="start",m=8,u=-8;break;case"center_left":p=180*Math.PI/180,d="end",m=-8,u=0;break;case"center":p=-90*Math.PI/180,d="middle",m=0,u=-8;break;case"center_right":p=0*Math.PI/180,d="start",m=8,u=0;break;case"bottom_left":p=135*Math.PI/180,d="end",m=-8,u=8;break;case"bottom_center":p=90*Math.PI/180,d="middle",m=0,u=8;break;case"bottom_right":p=45*Math.PI/180,d="start",m=8,u=8;break;default:p=-50*Math.PI/180,d="start",m=8,u=0}let y=n+c*Math.cos(p),f=a+c*Math.sin(p),_=n,x=a,Y=[`M ${y},${f}`,`L ${_},${x}`,`M ${_},${x}`,`L ${_-l*Math.cos((p*180/Math.PI+150)*Math.PI/180)},${x-l*Math.sin((p*180/Math.PI+150)*Math.PI/180)}`,`L ${_-l*Math.cos((p*180/Math.PI+210)*Math.PI/180)},${x-l*Math.sin((p*180/Math.PI+210)*Math.PI/180)}`,"Z"].join(" "),b=(y+m).toString(),M=(f+u).toString(),O=[];if(t.name&&t.voltage!==void 0)O.push({type:"element",name:"tspan",value:"",attributes:{x:b},children:[{type:"text",value:t.name,name:"",attributes:{},children:[]}]}),O.push({type:"element",name:"tspan",value:"",attributes:{x:b,dy:"1.2em"},children:[{type:"text",value:`${t.voltage}V`,name:"",attributes:{},children:[]}]});else{let X=[];if(t.name)X.push(t.name);if(t.voltage!==void 0)X.push(`${t.voltage}V`);O.push({type:"text",value:X.join(" "),name:"",attributes:{},children:[]})}return[{name:"path",type:"element",attributes:{class:"sch-voltage-probe",d:Y,stroke:o,fill:o,"stroke-width":`${$t(e)}px`},value:"",children:[]},{type:"element",name:"text",value:"",attributes:{class:"sch-voltage-probe-label",x:b,y:M,fill:o,"text-anchor":d,"dominant-baseline":"middle","font-family":"sans-serif","font-size":`${se(e,"reference_designator")}px`,"font-weight":"bold","data-schematic-voltage-probe-id":t.schematic_voltage_probe_id},children:O}]}var ln=6,Ms=12,Ht=12,mi=6,r1=14,ks=11,i1=280,cI=140,I1=(t)=>t.type==="schematic_component_overlap_warning"||t.type==="schematic_component_styling_warning"||t.type==="schematic_element_outside_sheet_warning"||t.type==="schematic_manual_edit_conflict_warning";function lI({circuitJson:t,transform:e,svgWidth:r,svgHeight:i,colorMap:n}){let a=n.schematic.erc_warning,o=[];return t.filter(I1).flatMap((c)=>{let l=pI(c,t,e);if(!l)return[];let s=Math.max(1,r-Ht*2),p=_I(c.message,Math.max(12,Math.floor((Math.min(i1,s)-mi*2)/(ks*0.56)))),d=Math.max(...p.map((b)=>b.length)),m=Math.min(i1,s,Math.max(Math.min(cI,s),d*ks*0.56+mi*2)),u=mi*2+p.length*r1,y=uI({targetBounds:l,calloutWidth:m,calloutHeight:u,svgWidth:r,svgHeight:i,occupiedCalloutBounds:o});o.push(y);let f=fI(c),_=Ys(l,ln),x=yI(y,_);return[{name:"g",type:"element",value:"",attributes:{class:"schematic-warning","data-type":c.type,"data-warning-id":f,role:"note","aria-label":c.message},children:[{name:"rect",type:"element",value:"",attributes:{x:_.minX.toString(),y:_.minY.toString(),width:(_.maxX-_.minX).toString(),height:(_.maxY-_.minY).toString(),rx:"6",fill:"none",stroke:a,"stroke-width":"1","stroke-dasharray":"4,3","data-warning-reference":"target"},children:[]},{name:"line",type:"element",value:"",attributes:{x1:x.from.x.toString(),y1:x.from.y.toString(),x2:x.to.x.toString(),y2:x.to.y.toString(),stroke:a,"stroke-width":"1","data-warning-reference":"leader"},children:[]},{name:"rect",type:"element",value:"",attributes:{x:y.minX.toString(),y:y.minY.toString(),width:m.toString(),height:u.toString(),fill:"rgba(255, 250, 235, 0.97)",stroke:a,"stroke-width":"1","data-warning-reference":"callout"},children:[]},{name:"text",type:"element",value:"",attributes:{x:(y.minX+mi).toString(),y:(y.minY+mi+ks).toString(),fill:"#5c4300","font-family":"sans-serif","font-size":ks.toString()},children:p.map((b,M)=>({name:"tspan",type:"element",value:"",attributes:{x:(y.minX+mi).toString(),dy:M===0?"0":r1.toString()},children:[bI(b)]}))}]}]})}function pI(t,e,r){let n=hI(t).map((a)=>dI(e,a)).filter((a)=>Boolean(a)).map((a)=>mI(a,r)).filter((a)=>Boolean(a));if(n.length===0)return null;return n.reduce(gI)}function hI(t){switch(t.type){case"schematic_component_overlap_warning":return t.schematic_component_ids;case"schematic_component_styling_warning":return[t.schematic_component_id,...t.schematic_port_ids??[]];case"schematic_manual_edit_conflict_warning":return[t.schematic_component_id];case"schematic_element_outside_sheet_warning":return[t.schematic_element_id]}}function dI(t,e){return t.find((r)=>{if(!r.type.startsWith("schematic_"))return!1;let i=`${r.type}_id`;return r[i]===e})}function mI(t,e){if(t.type==="schematic_component"){let r=P(e,{x:t.center.x-t.size.width/2,y:t.center.y+t.size.height/2}),i=P(e,{x:t.center.x+t.size.width/2,y:t.center.y-t.size.height/2});return im([r,i])}if(t.type==="schematic_port"){let r=P(e,t.center);return Ys(im([r]),4)}if(t.type==="schematic_net_label"){let r=P(e,t.anchor_position??t.center),i=Math.max(28,t.text.length*8);return{minX:r.x-i/2,minY:r.y-10,maxX:r.x+i/2,maxY:r.y+10}}if(t.type==="schematic_trace"){let r=t.edges.flatMap((i)=>[P(e,i.from),P(e,i.to)]);if(r.length===0)return null;return Ys(im(r),4)}return null}function uI({targetBounds:t,calloutWidth:e,calloutHeight:r,svgWidth:i,svgHeight:n,occupiedCalloutBounds:a}){let o=(t.minX+t.maxX)/2,c=(t.minY+t.maxY)/2,l=t.minY-ln-Ms-r,s=t.maxY+ln+Ms,p=t.minX-ln-Ms-e,d=t.maxX+ln+Ms,m=[];if(l>=Ht)m.push(cn({x:ui(o-e/2,Ht,i-Ht-e),y:l,width:e,height:r,side:"top"}));if(s+r<=n-Ht)m.push(cn({x:ui(o-e/2,Ht,i-Ht-e),y:s,width:e,height:r,side:"bottom"}));if(d+e<=i-Ht)m.push(cn({x:d,y:ui(c-r/2,Ht,n-Ht-r),width:e,height:r,side:"right"}));if(p>=Ht)m.push(cn({x:p,y:ui(c-r/2,Ht,n-Ht-r),width:e,height:r,side:"left"}));let u=m.find((y)=>a.every((f)=>!xI(Ys(y,4),f)));if(u)return u;if(m[0])return m[0];return cn({x:ui(o-e/2,Ht,i-Ht-e),y:ui(l,Ht,n-Ht-r),width:e,height:r,side:"top"})}function yI(t,e){let r=(e.minX+e.maxX)/2,i=(e.minY+e.maxY)/2,n=(t.minX+t.maxX)/2,a=(t.minY+t.maxY)/2;switch(t.side){case"top":return{from:{x:n,y:t.maxY},to:{x:r,y:e.minY}};case"bottom":return{from:{x:n,y:t.minY},to:{x:r,y:e.maxY}};case"left":return{from:{x:t.maxX,y:a},to:{x:e.minX,y:i}};case"right":return{from:{x:t.minX,y:a},to:{x:e.maxX,y:i}}}}function fI(t){switch(t.type){case"schematic_component_overlap_warning":return t.schematic_component_overlap_warning_id;case"schematic_component_styling_warning":return t.schematic_component_styling_warning_id;case"schematic_element_outside_sheet_warning":return t.schematic_element_outside_sheet_warning_id;case"schematic_manual_edit_conflict_warning":return t.schematic_manual_edit_conflict_warning_id}}function _I(t,e){let r=t.trim().split(/\s+/),i=[],n="";for(let a of r){let o=n?`${n} ${a}`:a;if(o.length<=e||n.length===0){n=o;continue}i.push(n),n=a}if(n)i.push(n);return i.length>0?i:["Warning"]}function im(t){return{minX:Math.min(...t.map((e)=>e.x)),minY:Math.min(...t.map((e)=>e.y)),maxX:Math.max(...t.map((e)=>e.x)),maxY:Math.max(...t.map((e)=>e.y))}}function gI(t,e){return{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}}function Ys(t,e){return{minX:t.minX-e,minY:t.minY-e,maxX:t.maxX+e,maxY:t.maxY+e}}function xI(t,e){return!(t.maxX<=e.minX||t.minX>=e.maxX||t.maxY<=e.minY||t.minY>=e.maxY)}function cn({x:t,y:e,width:r,height:i,side:n}){return{minX:t,minY:e,maxX:t+r,maxY:e+i,side:n}}function ui(t,e,r){if(r<e)return(e+r)/2;return Math.min(Math.max(t,e),r)}function bI(t){return{name:"",type:"text",value:t,attributes:{},children:[]}}function M1(t,e){let r=t.filter((R)=>R.type==="schematic_sheet"),i=bP(r),n=i;if(e?.schematicSheetId!==void 0)n=r.find((R)=>R.schematic_sheet_id===e.schematicSheetId)??i;else if(e?.schematicSheetIndex!==void 0)n=r.find((R)=>R.sheet_index===e.schematicSheetIndex)??i;let a=n?t.filter((R)=>!R.type.startsWith("schematic_")||I1(R)||("schematic_sheet_id"in R)&&R.schematic_sheet_id===n.schematic_sheet_id):t,o=LP(a),c=o.maxX-o.minX,l=o.maxY-o.minY,s=e?.width??1200,p=e?.height??600,d=e?.colorOverrides,m={...Zt,schematic:{...Zt.schematic,...d?.schematic??{}}},u=c/l,y=s/p,f;if(u>y){let R=s/u;f={x:0,y:(p-R)/2}}else{let R=p*u;f={x:(s-R)/2,y:0}}let _=f0([{x:o.minX,y:o.maxY},{x:o.maxX,y:o.maxY},{x:o.maxX,y:o.minY}],[{x:f.x,y:f.y},{x:s-f.x,y:f.y},{x:s-f.x,y:p-f.y}]),x=[];if(x.push({name:"rect",type:"element",attributes:{class:"boundary",x:"0",y:"0",width:s.toString(),height:p.toString()},children:[],value:""}),e?.grid){let R=typeof e.grid==="object"?e.grid:{};x.push(gP({bounds:o,transform:_,...R}))}let Y=[],b=[],M=[],O=[],X=[],E=[],I=[],U=[],q=[],st=[],H=[],k=[],at=[],ot=[],Z=[],N=[],tt=[],J=vI({transform:_,svgWidth:s,svgHeight:p,schematicSheet:n}),W=Array.isArray(m.simulation_palette)?m.simulation_palette:Array.isArray(m.palette)?m.palette:[],j=0;for(let R of a)if(R.type==="schematic_sheet")N.push(...nI({schematicSheet:R,transform:_,colorMap:m}));else if(R.type==="schematic_graphic")tt.push(EP({schematicGraphic:R,viewport:SI({availableViewport:J,schematicGraphic:R,transform:_})}));else if(R.type==="schematic_debug_object")Y.push(...rI({debugObject:R,transform:_}));else if(R.type==="schematic_component")b.push(...eI({component:R,transform:_,circuitJson:a,colorMap:m})),q.push(...$P({component:R,transform:_,circuitJson:a}));else if(R.type==="schematic_box")I.push(...UP({schematicBox:R,transform:_,colorMap:m}));else if(R.type==="schematic_trace")M.push(...aI({trace:R,transform:_,colorMap:m}));else if(R.type==="schematic_net_label")O.push(...RP({schNetLabel:R,realToScreenTransform:_,colorMap:m}));else if(R.type==="schematic_text"&&!R.schematic_component_id)X.push(sm({elm:R,transform:_,colorMap:m}));else if(R.type==="schematic_voltage_probe"){let pt=W.length>0?W[j%W.length]:void 0;j+=1,E.push(...sI({probe:R,transform:_,colorMap:m,fallbackColor:pt}))}else if(R.type==="schematic_table")U.push(...oI({schematicTable:R,transform:_,colorMap:m,circuitJson:a}));else if(R.type==="schematic_line"){if(R.schematic_component_id)continue;H.push(...A1({schLine:R,transform:_,colorMap:m}))}else if(R.type==="schematic_circle"){if(R.schematic_component_id)continue;k.push(...b1({schCircle:R,transform:_,colorMap:m}))}else if(R.type==="schematic_rect"){if(R.schematic_component_id)continue;at.push(...B1({schRect:R,transform:_,colorMap:m}))}else if(R.type==="schematic_arc"){if(R.schematic_component_id)continue;ot.push(...x1({schArc:R,transform:_,colorMap:m}))}else if(R.type==="schematic_path"){if(R.schematic_component_id)continue;Z.push(...F1({schPath:R,transform:_,colorMap:m}))}else if(R.type==="schematic_port"){let pt=a.find((xt)=>xt.type==="source_port"&&xt.source_port_id===R.source_port_id);if(pt?.type==="source_port"&&pt.do_not_connect===!0)st.push(XP({schPort:R,transform:_,colorMap:m}));if(e?.drawPorts)st.push(...VP({schPort:R,transform:_,circuitJson:a,colorMap:m}))}let G=M.filter((R)=>R.attributes?.["data-layer"]!=="overlay"),D=M.filter((R)=>R.attributes?.["data-layer"]==="overlay");if(x.push(...tt,...Y,...N,...G,...D,...H,...k,...at,...ot,...Z,...b,...q,...st,...O,...X,...I,...E,...U),e?.labeledPoints)x.push(xP({points:e.labeledPoints,transform:_}));if(e?.shouldDrawWarnings)x.push(...lI({circuitJson:a,transform:_,svgWidth:s,svgHeight:p,colorMap:m}));let et=mP(t),mt=yP;if(e?.showErrorsInTextOverlay){let R=fP(t);if(R)x.push(R)}let dt={name:"svg",type:"element",attributes:{xmlns:"http://www.w3.org/2000/svg",class:["tscircuit-schematic",e?.className].filter(Boolean).join(" "),width:s.toString(),height:p.toString(),style:`background-color: ${m.schematic.background}`,"data-real-to-screen-transform":u0(_),...et&&{"data-software-used-string":et},...e?.includeVersion&&{"data-circuit-to-svg-version":mt}},children:[{name:"style",type:"element",children:[{type:"text",value:`
.boundary { fill: ${m.schematic.background}; }
.schematic-boundary { fill: none; stroke: #fff; }
.component { fill: none; stroke: ${m.schematic.component_outline}; }
.chip { fill: ${m.schematic.component_body}; stroke: ${m.schematic.component_outline}; }
.component-pin { fill: none; stroke: ${m.schematic.component_outline}; }
.text { font-family: sans-serif; fill: ${m.schematic.wire}; }
.pin-number { fill: ${m.schematic.pin_number}; }
.port-label { fill: ${m.schematic.reference}; }
.component-name { fill: ${m.schematic.reference}; }
${e?.css??""}
`,name:"",attributes:{},children:[]}],value:"",attributes:{}},...x],value:""};return lP(dt)}function vI({transform:t,svgWidth:e,svgHeight:r,schematicSheet:i}){if(!i)return{x:0,y:0,width:e,height:r};let n=am(i),a=P(t,{x:n.innerMinX,y:n.innerMaxY}),o=P(t,{x:n.innerMaxX,y:n.innerMinY});return{x:Math.min(a.x,o.x),y:Math.min(a.y,o.y),width:Math.abs(o.x-a.x),height:Math.abs(o.y-a.y)}}function SI({availableViewport:t,schematicGraphic:e,transform:r}){if(e.width===void 0&&e.height===void 0)return t;let i=e.width===void 0?t.width:n1(e.width*Math.hypot(r.a,r.b),t.width),n=e.height===void 0?t.height:n1(e.height*Math.hypot(r.c,r.d),t.height);return{x:t.x+(t.width-i)/2,y:t.y+(t.height-n)/2,width:i,height:n}}function n1(t,e){if(!Number.isFinite(t))return e;return Math.max(0,Math.min(t,e))}var cm=11;function k1(t,e=1){let r=12*e,i=26*e,n=t.left+r,a=t.right-r,o=t.top+r,c=t.bottom-r,l=[],s=Math.ceil(Math.max(t.right-t.left,t.bottom-t.top)/i);return(p)=>{let d={x:Math.max(n,Math.min(a,p.x)),y:Math.max(o,Math.min(c,p.y))};for(let m=0;m<=s;m++)for(let u=-m;u<=m;u++)for(let y=-m;y<=m;y++){if(Math.max(Math.abs(u),Math.abs(y))!==m)continue;let f={x:d.x+u*i,y:d.y+y*i};if(f.x<n||f.x>a||f.y<o||f.y>c)continue;if(l.some((_)=>Math.hypot(_.x-f.x,_.y-f.y)<i-0.000001*e))continue;return l.push(f),f}throw Error("Not enough room for issue markers; increase the schematic width or height")}}function BI(t){return[...new Set(t.flatMap((r)=>r.type.startsWith("schematic_")&&!r.type.endsWith("_warning")&&!r.type.endsWith("_error")&&r.type!=="schematic_symbol"&&!(r.type==="schematic_group"&&r.is_subcircuit&&!r.show_as_schematic_box)?[("schematic_sheet_id"in r?r.schematic_sheet_id:void 0)??""]:[]))].map((r)=>{let i=t.find((n)=>n.type==="schematic_sheet"&&n.schematic_sheet_id===r);return{id:r,name:i?.type==="schematic_sheet"?i.name||r:r||"Unassigned sheet"}})}var FI=(t)=>t.replaceAll("&","&").replaceAll("<","<").replaceAll('"',""").replaceAll(">",">"),Es=(t)=>Ut(t.schX,t.schY,t.width,t.height);function C1(t){let{circuitJson:e,analysis:r}=t,i=t.schematicSheetId??BI(e)[0]?.id??"",n=e.filter((k)=>!k.type.startsWith("schematic_")||k.type==="schematic_symbol"||(("schematic_sheet_id"in k?k.schematic_sheet_id:void 0)??"")===i),a=M1(n,{width:t.width??1400,height:t.height??900}),o=a.match(/data-real-to-screen-transform="matrix\(([^)]+)\)"/);if(!o)throw Error("Schematic renderer did not provide its coordinate transform");let c=o[1].split(/[\s,]+/).map(Number);if(c.length!==6||c.some((k)=>!Number.isFinite(k)))throw Error("Invalid schematic transform");let[l,s,p,d,m,u]=c,y=(k,at)=>({x:l*k+p*at+m,y:s*k+d*at+u}),f=[],_=[],x=(k)=>{f.push(k);for(let at of[k.left,k.right])for(let ot of[k.bottom,k.top])_.push(y(at,ot))},Y=r.getLineItems().filter((k)=>k.lineItemType==="SchematicBoxPlacement"),b=new Set,M=r.getIssues().flatMap((k,at)=>{if((pr(k).schematicSheetId??"")!==i||t.issueTypes!==void 0&&!t.issueTypes.includes(k.lineItemType)||t.issueIndex!==void 0&&at!==t.issueIndex)return[];let ot=Dn({issues:[k],componentPlacements:Y,circuitJson:e}),Z=[],N,tt=new Map,J=(G,D=!1)=>{x(G),N??={x:G.left,y:G.top};let et=[D?"context":"issue",G.left,G.bottom,G.right,G.top].join(":");if(!D)tt.set(et,{x:G.left,y:G.top});if(b.has(et))return;b.add(et);let mt=`<rect x="${G.left}" y="${G.bottom}" width="${G.right-G.left}" height="${G.top-G.bottom}" fill="${D?"none":"#ef444433"}" stroke="${D?"#2563eb":"#dc2626"}" stroke-width="${D?0.35:0.5}" ${D?'stroke-dasharray="5 3"':""} vector-effect="non-scaling-stroke" />`;Z.push(mt)};for(let G of ot)J(Es(G),!0);switch(N=void 0,k.lineItemType){case"RailPathTooSpreadOut":{x(k.pathBounds),N=k.pathPoints[0],Z.push(`<polyline points="${k.pathPoints.map((G)=>`${G.x},${G.y}`).join(" ")}" fill="none" stroke="#dc2626" stroke-width="3" stroke-opacity="0.75" vector-effect="non-scaling-stroke" />`);break}case"ComponentOverlap":{let G=Es(k.firstComponent),D=Es(k.secondComponent);J({left:Math.max(G.left,D.left),right:Math.min(G.right,D.right),top:Math.min(G.top,D.top),bottom:Math.max(G.bottom,D.bottom)});break}case"NetLabelCollision":for(let G of k.collisionBounds??[])J(G);break;case"SchematicTextCollision":J(k.textBounds),J(k.collidingObjectBounds);break;case"ComponentNetLabelCollision":J(k.overlappingLabel1Bounds),J(k.overlappingLabel2Bounds);break;case"ComponentBoxNetLabelCollision":J(k.boxBounds),J(k.labelBounds);break;case"VerboseSchematicNetLabel":{N={x:k.schX,y:k.schY},x(Ut(N.x,N.y,18/Math.abs(l),18/Math.abs(d))),Z.push(`<circle cx="${N.x}" cy="${N.y}" r="${9/Math.abs(l)}" fill="#ef444433" stroke="#dc2626" stroke-width="0.5" vector-effect="non-scaling-stroke" />`);break}case"TraceCanBeSimplifiedByMovingComponent":{if(k.suggestedTraces){let D=Ut(k.newSchX,k.newSchY,k.targetComponent.width,k.targetComponent.height);x(D),Z.push(`<rect x="${D.left}" y="${D.bottom}" width="${D.right-D.left}" height="${D.top-D.bottom}" fill="#16a34a22" stroke="#16a34a" stroke-width="1.5" vector-effect="non-scaling-stroke" />`);for(let et of k.suggestedTraces)for(let[mt,dt]of et.points.slice(1).entries()){let R=et.points[mt];x({left:Math.min(R.x,dt.x),right:Math.max(R.x,dt.x),bottom:Math.min(R.y,dt.y),top:Math.max(R.y,dt.y)}),Z.push(`<line x1="${R.x}" y1="${R.y}" x2="${dt.x}" y2="${dt.y}" stroke="#16a34a" stroke-width="1.5" vector-effect="non-scaling-stroke" />`)}}let G=n.find((D)=>D.type==="schematic_trace"&&D.schematic_trace_id===k.schematicTraceId);if(G?.type==="schematic_trace")for(let D of G.edges)x({left:Math.min(D.from.x,D.to.x),right:Math.max(D.from.x,D.to.x),bottom:Math.min(D.from.y,D.to.y),top:Math.max(D.from.y,D.to.y)}),N??=D.from,Z.push(`<line x1="${D.from.x}" y1="${D.from.y}" x2="${D.to.x}" y2="${D.to.y}" stroke="#dc2626" stroke-width="0.5" vector-effect="non-scaling-stroke" />`);break}default:for(let G of ot)J(Es(G))}N??=ot[0]?{x:ot[0].schX,y:ot[0].schY}:void 0;let W=(tt.size?[...tt.values()]:N?[N]:[]).map((G)=>y(G.x,G.y)),j=FI(`#${at+1} ${k.lineItemType}
${r.schematicIssuesToString(k)}`);return[{index:at,points:W,title:j,geometry:`<title>${j}</title><g transform="matrix(${c.join(" ")})">${Z.join("")}</g>`,issueType:k.lineItemType}]}),O=a,X=1,E={left:0,top:0,right:t.width??1400,bottom:t.height??900};if(!t.showFullSchematic&&_.length>0){let k=Math.min(..._.map((et)=>et.x)),at=Math.max(..._.map((et)=>et.x)),ot=Math.min(..._.map((et)=>et.y)),Z=Math.max(..._.map((et)=>et.y)),N=Math.max((at-k)/2,12),tt=Math.max((Z-ot)/2,12),J=at-k+N*2,W=Z-ot+tt*2;E={left:k-N,top:ot-tt,right:at+N,bottom:Z+tt};let j=`${E.left} ${E.top} ${J} ${W}`;O=a.replace(/^<svg\b[^>]*>/,(et)=>et.replace(/\sviewBox="[^"]*"/,"").replace(/>$/,` viewBox="${j}">`)),X=Math.max(J/(t.width??1400),W/(t.height??900));let G=(t.width??1400)*X,D=(t.height??900)*X;E={left:(k+at-G)/2,right:(k+at+G)/2,top:(ot+Z-D)/2,bottom:(ot+Z+D)/2}}let I=f.length?{left:Math.min(...f.map((k)=>k.left)),right:Math.max(...f.map((k)=>k.right)),top:Math.max(...f.map((k)=>k.top)),bottom:Math.min(...f.map((k)=>k.bottom))}:void 0;if(t.showOverlay===!1)return{svg:O,bounds:I};let U=k1(E,X),q=[],st=[],H=M.map(({index:k,points:at,title:ot,geometry:Z,issueType:N})=>{for(let tt of at){let J={x:tt.x,y:tt.y-(cm+1)*X},W=U(J);if(W.x!==J.x||W.y!==J.y)q.push(`<line x1="${tt.x}" y1="${tt.y}" x2="${W.x}" y2="${W.y}" stroke="#b91c1c" stroke-width="0.5" />`);st.push(`<g data-issue-number="${k+1}" data-issue-type="${N}" transform="translate(${W.x} ${W.y}) scale(${X})"><title>${ot}</title><circle r="${cm}" fill="#b91c1c" /><text y="4" text-anchor="middle" fill="white" font-family="sans-serif" font-size="11">${k+1}</text></g>`)}return`<g data-issue-index="${k}" data-issue-type="${N}">${Z}</g>`});return{bounds:I,svg:O.replace(/<\/svg>\s*$/,`<g class="placement-issue-overlays">${H.join(`
`)}${q.join(`
`)}${st.join(`
`)}</g></svg>`)}}function Y1(t,e,r=[]){let i=Math.max(20,Math.floor((e-(r.length?70:36))/10)),n=[],a=[],o=[...r],c=0,l;for(let u of t?t.split(`
`):[]){if(u.startsWith("<SchematicSheet "))l=u.match(/\bid="([^"]*)"/)?.[1];let y=o.findIndex((f)=>f.text&&t.startsWith(f.text,c)&&(l===void 0||l===f.sheetId));if(y!==-1){let[f]=o.splice(y,1);a.push({number:f.number,lineIndex:n.length})}n.push(...II(u,Math.min(96,i))),c+=u.length+1}let s=22,p=18,d=a.length?52:p,m=p*2+n.length*s;return[`<svg xmlns="http://www.w3.org/2000/svg" width="${e}" height="${m}" viewBox="0 0 ${e} ${m}">`,'<rect width="100%" height="100%" fill="#fff" />',`<text x="${d}" y="${p+s}" fill="#d00" font-family="Menlo, Consolas, monospace" font-size="16">`,...n.map((u,y)=>`<tspan x="${d}" dy="${y===0?0:s}">${PI(u)}</tspan>`),"</text>",...a.map(({number:u,lineIndex:y})=>{let f=p+(y+1)*s-5;return`<g data-listing-issue-number="${u}"><circle cx="${p+6}" cy="${f}" r="11" fill="#b91c1c" /><text x="${p+6}" y="${f}" dy="0.35em" text-anchor="middle" font-family="sans-serif" font-size="11" fill="white">${u}</text></g>`}),"</svg>"].join(`
`)}function PI(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}function II(t,e){if(t.length<=e)return[t];let r=[],i=t;while(i.length>e){let n=i.lastIndexOf(" ",e),a=n>0?n:e;r.push(i.slice(0,a)),i=` ${i.slice(a).trimStart()}`}return r.push(i),r}function MI(t,e={}){let r=e.width??1400,i=e.height??900;if(!Number.isFinite(r)||r<320||!Number.isFinite(i)||i<=0)throw Error("Artifact width must be at least 320 and height must be positive (finite pixels)");let n=e.analysis??Xc(t),a=n.getIssues();return n.getIssues(e).map((o)=>{let c=a.indexOf(o),{schematicSheetId:l}=pr(o),{svg:s,bounds:p}=C1({circuitJson:t,analysis:n,issueIndex:c,schematicSheetId:l??"",width:r,height:i}),d=n.schematicIssuesToString(o)||`<${o.lineItemType} details="${js(JSON.stringify(o))}" />`,m=F0([`<svg xmlns="http://www.w3.org/2000/svg" width="${r}" height="${i}">${s}</svg>`,Y1(d,r)],{normalizeSize:!1,gap:0}).replace(/[ \t]+$/gm,"");return{issueIndex:c,issue:o,schematicSheetId:l,bounds:p,descriptionXml:d,fileName:`issue-${String(c+1).padStart(4,"0")}-${o.lineItemType}.svg`,contentType:"image/svg+xml",content:m}})}export{$c as SchematicPlacementAnalysis,Xc as analyzeSchematicPlacement,MI as createSchematicPlacementIssueArtifacts};