@tscircuit/runframe 0.0.656 → 0.0.658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/preview.js
CHANGED
package/dist/runner.js
CHANGED
|
@@ -13075,7 +13075,7 @@ ${l.join(`
|
|
|
13075
13075
|
`)),i.indexOf(`\\
|
|
13076
13076
|
`)!==-1&&(i=i.replace(/\\\n/g,""));const t=i.split(`
|
|
13077
13077
|
`);let n="",r="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let u=0,A=t.length;u<A;u++)if(n=t[u],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(r=n.charAt(0),r!=="#"))if(r==="v"){const f=n.split(/\s+/);switch(f[0]){case"v":e.vertices.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3])),f.length>=7?e.colors.push(parseFloat(f[4]),parseFloat(f[5]),parseFloat(f[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(f[1]),parseFloat(f[2]),parseFloat(f[3]));break;case"vt":e.uvs.push(parseFloat(f[1]),parseFloat(f[2]));break}}else if(r==="f"){const p=n.substr(1).trim().split(/\s+/),v=[];for(let B=0,b=p.length;B<b;B++){const w=p[B];if(w.length>0){const R=w.split("/");v.push(R)}}const x=v[0];for(let B=1,b=v.length-1;B<b;B++){const w=v[B],R=v[B+1];e.addFace(x[0],w[0],R[0],x[1],w[1],R[1],x[2],w[2],R[2])}}else if(r==="l"){const f=n.substring(1).trim().split(" ");let p=[];const v=[];if(n.indexOf("/")===-1)p=f;else for(let x=0,B=f.length;x<B;x++){const b=f[x].split("/");b[0]!==""&&p.push(b[0]),b[1]!==""&&v.push(b[1])}e.addLineGeometry(p,v)}else if(r==="p"){const p=n.substr(1).trim().split(" ");e.addPointGeometry(p)}else if((o=Z7t.exec(n))!==null){const f=(" "+o[0].substr(1).trim()).substr(1);e.startObject(f)}else if(X7t.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(W7t.test(n))e.materialLibraries.push(n.substring(7).trim());else if($7t.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(r==="s"){if(o=n.split(" "),o.length>1){const p=o[1].trim().toLowerCase();e.object.smooth=p!=="0"&&p!=="off"}else e.object.smooth=!0;const f=e.object.currentMaterial();f&&(f.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new g2;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let u=0,A=e.objects.length;u<A;u++){const f=e.objects[u],p=f.geometry,v=f.materials,x=p.type==="Line",B=p.type==="Points";let b=!1;if(p.vertices.length===0)continue;const w=new mp;w.setAttribute("position",new CA(p.vertices,3)),p.normals.length>0&&w.setAttribute("normal",new CA(p.normals,3)),p.colors.length>0&&(b=!0,w.setAttribute("color",new CA(p.colors,3))),p.hasUVIndices===!0&&w.setAttribute("uv",new CA(p.uvs,2));const R=[];for(let V=0,Y=v.length;V<Y;V++){const J=v[V],Z=J.name+"_"+J.smooth+"_"+b;let $=e.materials[Z];if(this.materials!==null){if($=this.materials.create(J.name),x&&$&&!($ instanceof XE)){const X=new XE;S_.prototype.copy.call(X,$),X.color.copy($.color),$=X}else if(B&&$&&!($ instanceof E2)){const X=new E2({size:10,sizeAttenuation:!1});S_.prototype.copy.call(X,$),X.color.copy($.color),X.map=$.map,$=X}}$===void 0&&(x?$=new XE:B?$=new E2({size:1,sizeAttenuation:!1}):$=new PG,$.name=J.name,$.flatShading=!J.smooth,$.vertexColors=b,e.materials[Z]=$),R.push($)}let k;if(R.length>1){for(let V=0,Y=v.length;V<Y;V++){const J=v[V];w.addGroup(J.groupStart,J.groupCount,V)}x?k=new hb(w,R):B?k=new X5(w,R):k=new yC(w,R)}else x?k=new hb(w,R[0]):B?k=new X5(w,R[0]):k=new yC(w,R[0]);k.name=f.name,l.add(k)}else if(e.vertices.length>0){const u=new E2({size:1,sizeAttenuation:!1}),A=new mp;A.setAttribute("position",new CA(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(A.setAttribute("color",new CA(e.colors,3)),u.vertexColors=!0);const f=new X5(A,u);l.add(f)}return l}};typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE&&(window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map);function nOt(i){const[e,t]=Ct.useState(null);return Ct.useEffect(()=>{if(!i)return;const n=window.TSCIRCUIT_OBJ_LOADER_CACHE;let r=!1;async function a(){var s;try{const c=await(await fetch(i)).text(),u=(s=c.match(/newmtl[\s\S]*?endmtl/g))==null?void 0:s.join(`
|
|
13078
|
-
`).replace(/d 0\./g,"d 1."),A=c.replace(/newmtl[\s\S]*?endmtl/g,""),f=new J7t;f.setMaterialOptions({invertTrProperty:!0});const p=f.parse(u.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),v=new tOt;return v.setMaterials(p),v.parse(A)}catch(l){return l}}function o(){if(n.has(i)){const l=n.get(i);return l.result?Promise.resolve(l.result.clone()):l.promise.then(c=>c.clone())}const s=a().then(l=>(l instanceof Error||n.set(i,{...n.get(i),result:l}),l));return n.set(i,{promise:s,result:null}),s}return o().then(s=>{r||t(s)}).catch(s=>{console.error(s)}),()=>{r=!0}},[i]),e}function iOt({url:i,position:e,rotation:t,onHover:n,onUnhover:r,isHovered:a}){const o=nOt(i);return o?o instanceof Error?ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsxs("mesh",{position:e,children:[ht.jsx("boxGeometry",{args:[.5,.5,.5]}),ht.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),ht.jsx("meshBasicMaterial",{color:"red"})]})}):ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsx("primitive",{rotation:t,position:e,object:o})}):ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsxs("mesh",{position:e,children:[ht.jsx("boxGeometry",{args:[.5,.5,.5]}),ht.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var rOt=ZI(N6e()),G6e=({jscadPlan:i,positionOffset:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const{threeGeom:o,material:s}=Ct.useMemo(()=>{const l=xCe.executeJscadOperations(rOt.default,i),c=CAt(l),u=new O3({vertexColors:!0,side:Ex});return{threeGeom:c,material:u}},[i]);return Ct.useMemo(()=>{if(a){const l=new Dc(s.color.getHex());s.emissive.copy(l),s.emissive.setRGB(0,0,1),s.emissiveIntensity=.2}else s.emissiveIntensity=0},[a,s]),o?ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,position:e,children:ht.jsx("mesh",{geometry:o,material:s,position:e,rotation:t})}):null},{createJSCADRoot:aOt}=wot(xCe.jscadPlanner),oOt=({positionOffset:i,footprint:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const o=Ct.useMemo(()=>{if(!e)return null;const s=[];return aOt(s).render(ht.jsx(KCt,{footprint:e})),s},[e]);return o?ht.jsx(ht.Fragment,{children:o.map((s,l)=>ht.jsx(G6e,{positionOffset:i,rotationOffset:t,jscadPlan:s,onHover:n,onUnhover:r,isHovered:a},l))}):null},sOt=(...i)=>i,F6e=({cad_component:i,circuitJson:e})=>{const[t,n]=Ct.useState(!1),[r,a]=Ct.useState(null),o=Ct.useCallback(f=>{f!=null&&f.mousePosition?(n(!0),a(f.mousePosition)):(n(!1),a(null))},[]),s=Ct.useCallback(()=>{n(!1),a(null)},[]),l=Ct.useMemo(()=>{var f;return(f=Gy(e).source_component.getUsing({source_component_id:i.source_component_id}))==null?void 0:f.name},[e,i.source_component_id]),c=i.model_obj_url??i.model_stl_url,u=i.rotation?sOt(i.rotation.x*Math.PI/180,i.rotation.y*Math.PI/180,i.rotation.z*Math.PI/180):void 0;let A=null;return c?A=ht.jsx(iOt,{url:c,position:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotation:u,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.model_jscad?A=ht.jsx(G6e,{jscadPlan:i.model_jscad,rotationOffset:u,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.footprinter_string&&(A=ht.jsx(oOt,{positionOffset:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotationOffset:u,footprint:i.footprinter_string,onHover:o,onUnhover:s,isHovered:t})),ht.jsxs(ht.Fragment,{children:[A,t&&r?ht.jsx(xRe,{position:r,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:l??"<unknown>"}):null]})},lOt={version:"0.0.292"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new hB(0,0,0));function cOt(i,e){const t=new H_().setFromEuler(new hB(i.x,i.y,i.z)),n=new ei(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var uOt=({})=>{const i=Ct.useRef();return Ct.useRef({lastRotation:new hB}),gT((e,t)=>{if(!i.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,r=cOt(n,2);e.camera.position.copy(r),e.camera.lookAt(0,0,0)}),ht.jsxs("mesh",{ref:i,rotation:[Math.PI/2,0,0],children:[ht.jsx("boxGeometry",{args:[1,1,1]}),ht.jsx("meshStandardMaterial",{color:"white"}),ht.jsx(Z2,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),ht.jsx(Z2,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),ht.jsx(Z2,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),ht.jsx(Z2,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),ht.jsx(Z2,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),ht.jsx(Z2,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),ht.jsx("lineSegments",{args:[new lK(new zw(1,1,1))],material:new XE({color:0,linewidth:2})})]})},AOt=()=>(gT(({camera:i})=>{window.TSCI_MAIN_CAMERA_ROTATION=i.rotation}),ht.jsx(ht.Fragment,{})),k6e=Ct.forwardRef(({children:i,initialCameraPosition:e=[5,5,5],autoRotateDisabled:t,clickToInteractEnabled:n=!1,boardDimensions:r},a)=>{const[o,s]=Ct.useState(!n),l=Ct.useMemo(()=>{if(!r)return 10;const c=r.width??0,u=r.height??0,f=Math.max(c,u)*1.5;return f>10?f:10},[r]);return ht.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[ht.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:ht.jsxs(IRe,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[ht.jsx("ambientLight",{intensity:Math.PI/2}),ht.jsx(uOt,{})]})}),ht.jsxs(IRe,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:e},children:[ht.jsx(AOt,{}),o&&ht.jsx(iEt,{autoRotate:!t,autoRotateSpeed:1}),ht.jsx("ambientLight",{intensity:Math.PI/2}),ht.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),ht.jsx(aEt,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:l,args:[l,l]}),ht.jsx("object3D",{ref:a,children:i})]}),ht.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",lOt.version]}),n&&!o&&ht.jsx("button",{type:"button",onClick:()=>s(!0),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&s(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:ht.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),L6e=i=>Ct.useMemo(()=>{if(!i)return[];const e=new kGt;return e.add(i),e.render(),e.getCircuitJson()},[i]);function dOt(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=t,n.readAsDataURL(i)})}var fOt=i=>{const[e,t]=Ct.useState([]),[n,r]=Ct.useState(!0);return Ct.useEffect(()=>{if(!i)return;(async()=>{r(!0);const s=(Array.isArray(i)?i:[i]).map(async l=>{const c=XGt.serialize({binary:!0},[l]),u=new Blob(c);return{stlUrl:await dOt(u),color:l.color}});try{const l=await Promise.all(s);t(l)}catch(l){console.error("Error generating STLs:",l),t([])}finally{r(!1)}})()},[i]),{stls:e,loading:n}},hOt=ZI(KD()),pOt=ZI($T()),nv=.01,l_={copper:[.9,.6,.2],fr4Green:[5/255,163/255,46/255],fr4GreenSolderWithMask:[0/255,152/255,19/255],fr1Copper:[.8,.4,.2],fr1CopperSolderWithMask:[.9,.6,.2]},$Q=.001,ZS=32,gOt=.035,P7=50,Yle={fr1:l_.fr1Copper,fr4:l_.fr4Green},O6e={fr1:l_.fr1CopperSolderWithMask,fr4:l_.fr4GreenSolderWithMask},mOt=ZI(R7()),yOt=ZI(KD()),vOt=ZI(U7()),z6e=i=>{let e=0;for(let n=0;n<i.length;n++){const r=(n+1)%i.length;e+=i[n][0]*i[r][1],e-=i[r][0]*i[n][1]}return e/2<=0},H6e=(i,e=1.2)=>{const{outline:t}=i;let n=t.map(o=>[o.x,o.y]);z6e(n)&&(n=n.reverse());const r=(0,yOt.polygon)({points:n});let a=(0,mOt.extrudeLinear)({height:e},r);return a=(0,vOt.translate)([0,0,-e/2],a),a},COt=i=>{const e=Gy(i).pcb_board.list()[0];if(!e)return console.warn("No pcb_board found for simplified geometry"),[];let t;const n=1.2;e.outline&&e.outline.length>0?t=H6e({outline:e.outline},n):t=(0,hOt.cuboid)({size:[e.width,e.height,n],center:[e.center.x,e.center.y,0]});const r=Yle[e.material]??l_.fr4Green;return[(0,pOt.colorize)(r,t)]},AM=ZI(U7()),Dx=ZI(KD()),jD=ZI($T()),dM=ZI(Fle()),_C=ZI(KD()),G7=ZI($T()),KB=ZI(Fle()),k1=.05,Y6e=(i,e)=>{if(i.shape||(i.shape="circle"),i.shape==="circle")return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)((0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:e.pcbThickness}),(0,_C.cylinder)({center:[i.x,i.y,e.pcbThickness/2+k1/2+nv],radius:i.outer_diameter/2,height:k1}),(0,_C.cylinder)({center:[i.x,i.y,-e.pcbThickness/2-k1/2-nv],radius:i.outer_diameter/2,height:k1})),(0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2-nv,height:1.5})));if(i.shape==="circular_hole_with_rect_pad"){const t=i.rect_pad_width||i.hole_diameter,n=i.rect_pad_height||i.hole_diameter;return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)((0,_C.cuboid)({center:[i.x,i.y,1.2/2],size:[t,n,k1]}),(0,_C.cuboid)({center:[i.x,i.y,-1.2/2],size:[t,n,k1]}),(0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:1.2})),(0,_C.cylinder)({center:[i.x,i.y,0],radius:Math.max(i.hole_diameter/2-nv,.01),height:1.5})))}if(i.shape==="pill"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=t?i.outer_height||r+.2:i.outer_width||n+.2,o=t?i.outer_width||n+.2:i.outer_height||r+.2,s=r/2,l=o/2,c=Math.abs(n-r),u=Math.abs(a-o),A=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r,c,e.pcbThickness]:[c,r,e.pcbThickness]}),f=(0,_C.cylinder)({center:t?[i.x,i.y-c/2,0]:[i.x-c/2,i.y,0],radius:s,height:e.pcbThickness}),p=(0,_C.cylinder)({center:t?[i.x,i.y+c/2,0]:[i.x+c/2,i.y,0],radius:s,height:e.pcbThickness}),v=(0,KB.union)(A,f,p),x=e.pcbThickness/2+k1/2+nv,B=(0,_C.cuboid)({center:[i.x,i.y,x],size:t?[o,u,k1]:[u,o,k1]}),b=(0,_C.cylinder)({center:t?[i.x,i.y-u/2,x]:[i.x-u/2,i.y,x],radius:l,height:k1}),w=(0,_C.cylinder)({center:t?[i.x,i.y+u/2,x]:[i.x+u/2,i.y,x],radius:l,height:k1}),R=(0,KB.union)(B,b,w),k=-e.pcbThickness/2-k1/2-nv,V=(0,_C.cuboid)({center:[i.x,i.y,k],size:t?[o,u,k1]:[u,o,k1]}),Y=(0,_C.cylinder)({center:t?[i.x,i.y-u/2,k]:[i.x-u/2,i.y,k],radius:l,height:k1}),J=(0,_C.cylinder)({center:t?[i.x,i.y+u/2,k]:[i.x+u/2,i.y,k],radius:l,height:k1}),Z=(0,KB.union)(V,Y,J),$=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r-2*nv,c,e.pcbThickness+2*nv]:[c,r-2*nv,e.pcbThickness+2*nv]}),X=(0,_C.cylinder)({center:t?[i.x,i.y-c/2,0]:[i.x-c/2,i.y,0],radius:s-nv,height:e.pcbThickness+2*nv}),de=(0,_C.cylinder)({center:t?[i.x,i.y+c/2,0]:[i.x+c/2,i.y,0],radius:s-nv,height:e.pcbThickness+2*nv}),ue=(0,KB.union)($,X,de);return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)(v,R,Z),ue))}if(i.shape==="pill_hole_with_rect_pad"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=r/2,o=Math.abs(n-r),s=i.rect_pad_width||n+.2,l=i.rect_pad_height||r+.2,c=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r,o,1.2]:[o,r,1.2]}),u=(0,_C.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a,height:1.2}),A=(0,_C.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a,height:1.2}),f=(0,_C.cuboid)({center:[i.x,i.y,1.2/2],size:[s,l,k1]}),p=(0,_C.cuboid)({center:[i.x,i.y,-1.2/2],size:[s,l,k1]}),v=(0,KB.union)((0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r-k1,o,1.5]:[o,r-k1,1.5]}),(0,_C.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a-k1,height:1.5}),(0,_C.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a-k1,height:1.5}));return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)(c,u,A,f,p),v))}else throw new Error(`Unsupported plated hole shape: ${i.shape}`)},F7=ZI(R7()),V6e=ZI(Lle()),IOt=ZI(Rle());function K6e(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function g9(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function j6e(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,a=e(t,n);return j6e(a,...r)}}}function J6e(...i){return j6e(...i)}var{cos:EOt,sin:_Ot}=Math;function q6e(i,e,t){const n=EOt(i),r=_Ot(i);return{a:n,c:-r,e:0,b:r,d:n,f:0}}function xOt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function k7(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,k7.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}xOt(k7,Error);function Vle(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}k7.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,o=this.location.source+":"+a.line+":"+a.column;if(t){var s=this.location.end,l=Vle("",a.line.toString().length," "),c=t[r.line-1],u=r.line===s.line?s.column:c.length+1,A=u-r.column||1;e+=`
|
|
13078
|
+
`).replace(/d 0\./g,"d 1."),A=c.replace(/newmtl[\s\S]*?endmtl/g,""),f=new J7t;f.setMaterialOptions({invertTrProperty:!0});const p=f.parse(u.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),v=new tOt;return v.setMaterials(p),v.parse(A)}catch(l){return l}}function o(){if(n.has(i)){const l=n.get(i);return l.result?Promise.resolve(l.result.clone()):l.promise.then(c=>c.clone())}const s=a().then(l=>(l instanceof Error||n.set(i,{...n.get(i),result:l}),l));return n.set(i,{promise:s,result:null}),s}return o().then(s=>{r||t(s)}).catch(s=>{console.error(s)}),()=>{r=!0}},[i]),e}function iOt({url:i,position:e,rotation:t,onHover:n,onUnhover:r,isHovered:a}){const o=nOt(i);return o?o instanceof Error?ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsxs("mesh",{position:e,children:[ht.jsx("boxGeometry",{args:[.5,.5,.5]}),ht.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),ht.jsx("meshBasicMaterial",{color:"red"})]})}):ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsx("primitive",{rotation:t,position:e,object:o})}):ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,children:ht.jsxs("mesh",{position:e,children:[ht.jsx("boxGeometry",{args:[.5,.5,.5]}),ht.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var rOt=ZI(N6e()),G6e=({jscadPlan:i,positionOffset:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const{threeGeom:o,material:s}=Ct.useMemo(()=>{const l=xCe.executeJscadOperations(rOt.default,i),c=CAt(l),u=new O3({vertexColors:!0,side:Ex});return{threeGeom:c,material:u}},[i]);return Ct.useMemo(()=>{if(a){const l=new Dc(s.color.getHex());s.emissive.copy(l),s.emissive.setRGB(0,0,1),s.emissiveIntensity=.2}else s.emissiveIntensity=0},[a,s]),o?ht.jsx(o4,{isHovered:a,onHover:n,onUnhover:r,position:e,children:ht.jsx("mesh",{geometry:o,material:s,position:e,rotation:t})}):null},{createJSCADRoot:aOt}=wot(xCe.jscadPlanner),oOt=({positionOffset:i,footprint:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const o=Ct.useMemo(()=>{if(!e)return null;const s=[];return aOt(s).render(ht.jsx(KCt,{footprint:e})),s},[e]);return o?ht.jsx(ht.Fragment,{children:o.map((s,l)=>ht.jsx(G6e,{positionOffset:i,rotationOffset:t,jscadPlan:s,onHover:n,onUnhover:r,isHovered:a},l))}):null},sOt=(...i)=>i,F6e=({cad_component:i,circuitJson:e})=>{const[t,n]=Ct.useState(!1),[r,a]=Ct.useState(null),o=Ct.useCallback(f=>{f!=null&&f.mousePosition?(n(!0),a(f.mousePosition)):(n(!1),a(null))},[]),s=Ct.useCallback(()=>{n(!1),a(null)},[]),l=Ct.useMemo(()=>{var f;return(f=Gy(e).source_component.getUsing({source_component_id:i.source_component_id}))==null?void 0:f.name},[e,i.source_component_id]),c=i.model_obj_url??i.model_stl_url,u=i.rotation?sOt(i.rotation.x*Math.PI/180,i.rotation.y*Math.PI/180,i.rotation.z*Math.PI/180):void 0;let A=null;return c?A=ht.jsx(iOt,{url:c,position:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotation:u,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.model_jscad?A=ht.jsx(G6e,{jscadPlan:i.model_jscad,rotationOffset:u,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.footprinter_string&&(A=ht.jsx(oOt,{positionOffset:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotationOffset:u,footprint:i.footprinter_string,onHover:o,onUnhover:s,isHovered:t})),ht.jsxs(ht.Fragment,{children:[A,t&&r?ht.jsx(xRe,{position:r,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:l??"<unknown>"}):null]})},lOt={version:"0.0.293"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new hB(0,0,0));function cOt(i,e){const t=new H_().setFromEuler(new hB(i.x,i.y,i.z)),n=new ei(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var uOt=({})=>{const i=Ct.useRef();return Ct.useRef({lastRotation:new hB}),gT((e,t)=>{if(!i.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,r=cOt(n,2);e.camera.position.copy(r),e.camera.lookAt(0,0,0)}),ht.jsxs("mesh",{ref:i,rotation:[Math.PI/2,0,0],children:[ht.jsx("boxGeometry",{args:[1,1,1]}),ht.jsx("meshStandardMaterial",{color:"white"}),ht.jsx(Z2,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),ht.jsx(Z2,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),ht.jsx(Z2,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),ht.jsx(Z2,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),ht.jsx(Z2,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),ht.jsx(Z2,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),ht.jsx("lineSegments",{args:[new lK(new zw(1,1,1))],material:new XE({color:0,linewidth:2})})]})},AOt=()=>(gT(({camera:i})=>{window.TSCI_MAIN_CAMERA_ROTATION=i.rotation}),ht.jsx(ht.Fragment,{})),k6e=Ct.forwardRef(({children:i,initialCameraPosition:e=[5,5,5],autoRotateDisabled:t,clickToInteractEnabled:n=!1,boardDimensions:r},a)=>{const[o,s]=Ct.useState(!n),l=Ct.useMemo(()=>{if(!r)return 10;const c=r.width??0,u=r.height??0,f=Math.max(c,u)*1.5;return f>10?f:10},[r]);return ht.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[ht.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:ht.jsxs(IRe,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[ht.jsx("ambientLight",{intensity:Math.PI/2}),ht.jsx(uOt,{})]})}),ht.jsxs(IRe,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:e},children:[ht.jsx(AOt,{}),o&&ht.jsx(iEt,{autoRotate:!t,autoRotateSpeed:1}),ht.jsx("ambientLight",{intensity:Math.PI/2}),ht.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),ht.jsx(aEt,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:l,args:[l,l]}),ht.jsx("object3D",{ref:a,children:i})]}),ht.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",lOt.version]}),n&&!o&&ht.jsx("button",{type:"button",onClick:()=>s(!0),onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&s(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:ht.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),L6e=i=>Ct.useMemo(()=>{if(!i)return[];const e=new kGt;return e.add(i),e.render(),e.getCircuitJson()},[i]);function dOt(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=t,n.readAsDataURL(i)})}var fOt=i=>{const[e,t]=Ct.useState([]),[n,r]=Ct.useState(!0);return Ct.useEffect(()=>{if(!i)return;(async()=>{r(!0);const s=(Array.isArray(i)?i:[i]).map(async l=>{const c=XGt.serialize({binary:!0},[l]),u=new Blob(c);return{stlUrl:await dOt(u),color:l.color}});try{const l=await Promise.all(s);t(l)}catch(l){console.error("Error generating STLs:",l),t([])}finally{r(!1)}})()},[i]),{stls:e,loading:n}},hOt=ZI(KD()),pOt=ZI($T()),nv=.01,l_={copper:[.9,.6,.2],fr4Green:[5/255,163/255,46/255],fr4GreenSolderWithMask:[0/255,152/255,19/255],fr1Copper:[.8,.4,.2],fr1CopperSolderWithMask:[.9,.6,.2]},$Q=.001,ZS=32,gOt=.035,P7=50,Yle={fr1:l_.fr1Copper,fr4:l_.fr4Green},O6e={fr1:l_.fr1CopperSolderWithMask,fr4:l_.fr4GreenSolderWithMask},mOt=ZI(R7()),yOt=ZI(KD()),vOt=ZI(U7()),z6e=i=>{let e=0;for(let n=0;n<i.length;n++){const r=(n+1)%i.length;e+=i[n][0]*i[r][1],e-=i[r][0]*i[n][1]}return e/2<=0},H6e=(i,e=1.2)=>{const{outline:t}=i;let n=t.map(o=>[o.x,o.y]);z6e(n)&&(n=n.reverse());const r=(0,yOt.polygon)({points:n});let a=(0,mOt.extrudeLinear)({height:e},r);return a=(0,vOt.translate)([0,0,-e/2],a),a},COt=i=>{const e=Gy(i).pcb_board.list()[0];if(!e)return console.warn("No pcb_board found for simplified geometry"),[];let t;const n=1.2;e.outline&&e.outline.length>0?t=H6e({outline:e.outline},n):t=(0,hOt.cuboid)({size:[e.width,e.height,n],center:[e.center.x,e.center.y,0]});const r=Yle[e.material]??l_.fr4Green;return[(0,pOt.colorize)(r,t)]},AM=ZI(U7()),Dx=ZI(KD()),jD=ZI($T()),dM=ZI(Fle()),_C=ZI(KD()),G7=ZI($T()),KB=ZI(Fle()),k1=.05,Y6e=(i,e)=>{if(i.shape||(i.shape="circle"),i.shape==="circle")return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)((0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:e.pcbThickness}),(0,_C.cylinder)({center:[i.x,i.y,e.pcbThickness/2+k1/2+nv],radius:i.outer_diameter/2,height:k1}),(0,_C.cylinder)({center:[i.x,i.y,-e.pcbThickness/2-k1/2-nv],radius:i.outer_diameter/2,height:k1})),(0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2-nv,height:1.5})));if(i.shape==="circular_hole_with_rect_pad"){const t=i.rect_pad_width||i.hole_diameter,n=i.rect_pad_height||i.hole_diameter;return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)((0,_C.cuboid)({center:[i.x,i.y,1.2/2],size:[t,n,k1]}),(0,_C.cuboid)({center:[i.x,i.y,-1.2/2],size:[t,n,k1]}),(0,_C.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:1.2})),(0,_C.cylinder)({center:[i.x,i.y,0],radius:Math.max(i.hole_diameter/2-nv,.01),height:1.5})))}if(i.shape==="pill"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=t?i.outer_height||r+.2:i.outer_width||n+.2,o=t?i.outer_width||n+.2:i.outer_height||r+.2,s=r/2,l=o/2,c=Math.abs(n-r),u=Math.abs(a-o),A=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r,c,e.pcbThickness]:[c,r,e.pcbThickness]}),f=(0,_C.cylinder)({center:t?[i.x,i.y-c/2,0]:[i.x-c/2,i.y,0],radius:s,height:e.pcbThickness}),p=(0,_C.cylinder)({center:t?[i.x,i.y+c/2,0]:[i.x+c/2,i.y,0],radius:s,height:e.pcbThickness}),v=(0,KB.union)(A,f,p),x=e.pcbThickness/2+k1/2+nv,B=(0,_C.cuboid)({center:[i.x,i.y,x],size:t?[o,u,k1]:[u,o,k1]}),b=(0,_C.cylinder)({center:t?[i.x,i.y-u/2,x]:[i.x-u/2,i.y,x],radius:l,height:k1}),w=(0,_C.cylinder)({center:t?[i.x,i.y+u/2,x]:[i.x+u/2,i.y,x],radius:l,height:k1}),R=(0,KB.union)(B,b,w),k=-e.pcbThickness/2-k1/2-nv,V=(0,_C.cuboid)({center:[i.x,i.y,k],size:t?[o,u,k1]:[u,o,k1]}),Y=(0,_C.cylinder)({center:t?[i.x,i.y-u/2,k]:[i.x-u/2,i.y,k],radius:l,height:k1}),J=(0,_C.cylinder)({center:t?[i.x,i.y+u/2,k]:[i.x+u/2,i.y,k],radius:l,height:k1}),Z=(0,KB.union)(V,Y,J),$=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r-2*nv,c,e.pcbThickness+2*nv]:[c,r-2*nv,e.pcbThickness+2*nv]}),X=(0,_C.cylinder)({center:t?[i.x,i.y-c/2,0]:[i.x-c/2,i.y,0],radius:s-nv,height:e.pcbThickness+2*nv}),de=(0,_C.cylinder)({center:t?[i.x,i.y+c/2,0]:[i.x+c/2,i.y,0],radius:s-nv,height:e.pcbThickness+2*nv}),ue=(0,KB.union)($,X,de);return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)(v,R,Z),ue))}if(i.shape==="pill_hole_with_rect_pad"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=r/2,o=Math.abs(n-r),s=i.rect_pad_width||n+.2,l=i.rect_pad_height||r+.2,c=(0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r,o,1.2]:[o,r,1.2]}),u=(0,_C.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a,height:1.2}),A=(0,_C.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a,height:1.2}),f=(0,_C.cuboid)({center:[i.x,i.y,1.2/2],size:[s,l,k1]}),p=(0,_C.cuboid)({center:[i.x,i.y,-1.2/2],size:[s,l,k1]}),v=(0,KB.union)((0,_C.cuboid)({center:[i.x,i.y,0],size:t?[r-k1,o,1.5]:[o,r-k1,1.5]}),(0,_C.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a-k1,height:1.5}),(0,_C.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a-k1,height:1.5}));return(0,G7.colorize)(l_.copper,(0,KB.subtract)((0,KB.union)(c,u,A,f,p),v))}else throw new Error(`Unsupported plated hole shape: ${i.shape}`)},F7=ZI(R7()),V6e=ZI(Lle()),IOt=ZI(Rle());function K6e(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function g9(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function j6e(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,a=e(t,n);return j6e(a,...r)}}}function J6e(...i){return j6e(...i)}var{cos:EOt,sin:_Ot}=Math;function q6e(i,e,t){const n=EOt(i),r=_Ot(i);return{a:n,c:-r,e:0,b:r,d:n,f:0}}function xOt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function k7(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,k7.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}xOt(k7,Error);function Vle(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}k7.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,o=this.location.source+":"+a.line+":"+a.column;if(t){var s=this.location.end,l=Vle("",a.line.toString().length," "),c=t[r.line-1],u=r.line===s.line?s.column:c.length+1,A=u-r.column||1;e+=`
|
|
13079
13079
|
--> `+o+`
|
|
13080
13080
|
`+l+` |
|
|
13081
13081
|
`+a.line+" | "+c+`
|
|
@@ -13717,7 +13717,7 @@ $1`).replace(/>(\s*)(?=<!--\s*\/)/g,"> ")}return Lue}vZt();function pze(i,e,t,n=
|
|
|
13717
13717
|
&:hover {
|
|
13718
13718
|
background-color: rgba(255, 255, 255, 0.1);
|
|
13719
13719
|
}
|
|
13720
|
-
`,onClick:n=>{n.stopPropagation(),t()},children:[ht.jsx("input",{type:"checkbox",checked:e}),ht.jsx("span",{style:{color:"#eee"},children:i})]}),K$t=({children:i,elements:e})=>{const[t,n]=UE(Z=>[Z.is_mouse_over_container,Z.setIsMouseOverContainer]),[r,a]=Ct.useState(!1),[o,s]=Ct.useState(!1),[l,c]=Ct.useState(!1),[u,A]=UE(Z=>[Z.selected_layer,Z.selectLayer]),[f,p,v,x,B,b]=UE(Z=>[Z.in_move_footprint_mode,Z.in_draw_trace_mode,Z.is_showing_rats_nest,Z.is_showing_multiple_traces_length,Z.is_showing_autorouting,Z.is_showing_drc_errors]),w=UE(Z=>Z.setEditMode),R=UE(Z=>Z.setIsShowingRatsNest),k=UE(Z=>Z.setIsShowingMultipleTracesLength),V=UE(Z=>Z.setIsShowingAutorouting),Y=UE(Z=>Z.setIsShowingDrcErrors);Q9("1",()=>A("top")),Q9("2",()=>A("bottom")),Q9("3",()=>A("inner1")),Q9("4",()=>A("inner2")),Q9("5",()=>A("inner3")),Q9("6",()=>A("inner4")),Q9("7",()=>A("inner5")),Q9("8",()=>A("inner6"));const J=(e==null?void 0:e.filter(Z=>Z.type.includes("error")).length)??0;return ht.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:Z=>{n(!1),s(!1)},children:[i,ht.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",Y$t.version]}),ht.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Nx.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[ht.jsxs(yR,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[ht.jsxs("div",{children:["layer:"," ",ht.jsx("span",{style:{marginLeft:2,fontWeight:500,color:mR[u]},children:u})]}),o&&ht.jsx("div",{style:{marginTop:4,minWidth:120},children:IAe.map(Z=>Z.replace(/-/g,"")).map(Z=>ht.jsx(V$t,{name:Z,selected:Z===u,onClick:()=>{A(Z.replace(/-/,""))}},Z))})]}),ht.jsxs(yR,{style:J>0?{color:"red"}:{},onClick:()=>c(!l),onMouseLeave:()=>c(!1),children:[ht.jsxs("div",{children:[J," errors"]}),l&&ht.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(Z=>Z.type.includes("error")).map((Z,$)=>ht.jsxs(Ct.Fragment,{children:[ht.jsx("div",{children:Z.error_type}),ht.jsx("div",{children:Z.message})]},$))})]}),ht.jsx(yR,{style:{},onClick:()=>{w(p?"off":"draw_trace")},children:ht.jsxs("div",{children:[p?"✖ ":"","Edit Traces"]})}),ht.jsx(yR,{style:{},onClick:()=>{w(f?"off":"move_footprint")},children:ht.jsxs("div",{children:[f?"✖ ":"","Move Components"]})}),ht.jsx(yR,{style:{},onClick:()=>{R(!v)},children:ht.jsxs("div",{children:[v?"✖ ":"","Rats Nest"]})}),ht.jsx(yR,{onClick:()=>{a(!r)},children:ht.jsxs("div",{children:[ht.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",ht.jsx("span",{style:{fontSize:"8px",transform:r?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),r&&ht.jsxs("div",{style:{marginTop:4,minWidth:120},children:[ht.jsx(SAe,{label:"Show All Trace Lengths",checked:x,onClick:()=>{k(!x)}}),ht.jsx(SAe,{label:"Show Autorouting Animation",checked:B,onClick:()=>{V(!B)}}),ht.jsx(SAe,{label:"Show DRC Errors",checked:b,onClick:()=>{Y(!b)}})]})]})})]})]})},j$t=i=>{const{transform:e,elements:t}=i,[n,r]=Ct.useMemo(()=>{const c=i.elements.flatMap(A=>r$t(A,i.elements)),u=qQ(i.elements);return[c,u]},[i.elements]),[a,o]=Ct.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=Ct.useMemo(()=>n$t({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=Ct.useCallback(c=>{var f,p;const u=[];for(const v of c)if(v._element){const x=r.getNetConnectedToId("pcb_port_id"in v._element?(f=v._element)==null?void 0:f.pcb_port_id:"pcb_trace_id"in v._element?(p=v._element)==null?void 0:p.pcb_trace_id:"");u.push(...r.getIdsConnectedToNet(x))}const A=new Set(c.map(v=>v._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:A,primitiveIdsInMousedOverNet:u})},[r]);return ht.jsx(z$t,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:ht.jsx(B$t,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:ht.jsx(w$t,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:ht.jsx(_$t,{transform:e,focusOnHover:i.focusOnHover,children:ht.jsx(K$t,{elements:t,children:ht.jsx(R$t,{transform:e,elements:t,children:ht.jsx(H$t,{transform:e,soup:t,children:ht.jsx(I$t,{transform:e,debugGraphics:i.debugGraphics,children:ht.jsx(E$t,{transform:e,elements:t,children:ht.jsx(C$t,{transform:e,primitives:s,width:i.width,height:i.height,grid:i.grid})})})})})})})})})})},J$t=Fd(Dh(400,300),JE(40,-40)),q$t=({circuitJson:i,debugGraphics:e,height:t=600,initialState:n,allowEditing:r=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[c,u]=Ct.useState(!l),[A,f]=BAe(),[p,v]=Ct.useState(J$t),{ref:x,setTransform:B,cancelDrag:b}=t$t({transform:p,onSetTransform:v,enabled:c});let[w,R]=Ct.useState([]);w=a??w;const k=Ct.useRef(!1),V=Ct.useRef(null),Y=`${(i==null?void 0:i.length)||0}_${(i==null?void 0:i.editCount)||0}`,J=()=>{const ue=(f==null?void 0:f.width)>0?f:{width:500,height:500},{center:ge,width:be,height:Qe}=$.some(Ie=>Ie.type.startsWith("pcb_"))?VXt($.filter(Ie=>Ie.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},ve=Math.min((ue.width??0)/be,(ue.height??0)/Qe,100)*.75,Be=Fd(Dh((ue.width??0)/2,(ue.height??0)/2),JE(ve,-ve,0,0),Dh(-ge.x,-ge.y));B(Be)};Ct.useEffect(()=>{f!=null&&f.width&&i&&i.length!==0&&(k.current||(J(),k.current=!0))},[i,f]);const Z=Ct.useMemo(()=>(i==null?void 0:i.filter(ue=>ue.type.startsWith("pcb_")||ue.type.startsWith("source_")))??[],[Y]),$=Ct.useMemo(()=>rqt({circuitJson:Z,editEvents:w}),[Z,w]),X=ue=>{R([...w,ue]),o==null||o([...w,ue])},de=ue=>{const ge=w.map(be=>be.edit_event_id===ue.edit_event_id?{...be,...ue}:be);R(ge),o==null||o(ge)};return ht.jsxs("div",{ref:x,style:{position:"relative"},children:[ht.jsx("div",{ref:A,children:ht.jsxs(jXt,{initialState:n,children:[ht.jsx(j$t,{transform:p,height:t,width:f.width,allowEditing:r,focusOnHover:s,cancelPanDrag:b,onCreateEditEvent:X,onModifyEditEvent:de,grid:{spacing:1,view_window:{left:0,right:f.width||500,top:t,bottom:0}},elements:$,debugGraphics:e},f.width),ht.jsx(qXt,{})]})}),l&&!c&&ht.jsx("div",{onClick:()=>{u(!0),J()},onTouchStart:ue=>{const ge=ue.touches[0];V.current={x:ge.clientX,y:ge.clientY}},onTouchEnd:ue=>{const ge=ue.changedTouches[0],be=V.current;if(!be)return;const Qe=Math.abs(ge.clientX-be.x),ve=Math.abs(ge.clientY-be.y);Qe<10&&ve<10&&(ue.preventDefault(),u(!0),J()),V.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Nx.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:ht.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const Z$t=({containerClassName:i,...e})=>{const t=Ct.useRef(null),[n,r]=Ct.useState(620);return Ct.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),ht.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:ht.jsx(q$t,{...e,height:n})})},W$t='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',X$t=()=>{Ct.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=W$t,document.head.appendChild(e)},[])},$$t=i=>{Ct.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},MYe=i=>`hsl(${Bb.indexOf(i)*137.5%360}, 70%, 50%)`,een=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return ht.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ht.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:Bb.map(t=>{const n=i[t]||0,r=n/e*100;return ht.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:MYe(t)},children:ht.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),ht.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},ten=({renderLog:i})=>{const[e,t]=Ct.useState("chronological");if(!i)return ht.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>Bb.indexOf(a[0])-Bb.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const r=n.reduce((a,[o,s])=>a+s,0);return ht.jsxs("div",{className:"rf-bg-white",children:[ht.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ht.jsx("div",{children:"Render Logs"}),ht.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ht.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ht.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ht.jsx("option",{value:"chronological",children:"Phase Order"}),ht.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ht.jsx(een,{phaseTimings:i.phaseTimings}),ht.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ht.jsx("thead",{children:ht.jsxs("tr",{children:[ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ht.jsx("tbody",{children:n.map(([a,o])=>ht.jsxs("tr",{children:[ht.jsx("td",{className:"rf-p-2",children:Bb.indexOf(a)}),ht.jsx("td",{className:"rf-p-2",children:a}),ht.jsx("td",{className:"rf-p-2",children:ht.jsx("div",{className:"rf-w-8",children:ht.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:MYe(a),width:`${o/r*100}%`}})})}),ht.jsx("td",{className:"rf-p-2",children:ht.jsxs("div",{className:"rf-flex w-full",children:[ht.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),ht.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/r*100).toFixed(1),"%"]})]})})]},a))})]})]})},nen=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{Ct.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{AU.captureException(n)}catch{}}},[i,e]),Ct.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{AU.captureException(r,{error_type:n.type})}catch{}}},[t])},ien="0.0.655",QAe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},wAe=new Map,oz=i=>{const e=wAe.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},ren=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=wAe.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return wAe.set(t.name,r),{type:"tracked",store:i,...r}},aen=(i,e={})=>(t,n,r)=>{const{enabled:a,anonymousActionType:o,store:s,...l}=e;let c;try{c=(a??(QAe?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(QAe?"production":void 0)!=="production"&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=ren(s,c,l);let f=!0;r.setState=(x,B,b)=>{const w=t(x,B);if(!f)return w;const R=b===void 0?{type:o||"anonymous"}:typeof b=="string"?{type:b}:b;return s===void 0?(u==null||u.send(R,n()),w):(u==null||u.send({...R,type:`${s}/${R.type}`},{...oz(l.name),[s]:r.getState()}),w)};const p=(...x)=>{const B=f;f=!1,t(...x),f=B},v=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(v):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([x,B])=>[x,x===A.store?v:B.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let x=!1;const B=r.dispatch;r.dispatch=(...b)=>{(QAe?"production":void 0)!=="production"&&b[0].type==="__setState"&&!x&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),x=!0),B(...b)}}return u.subscribe(x=>{var B;switch(x.type){case"ACTION":if(typeof x.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return MAe(x.payload,b=>{if(b.type==="__setState"){if(s===void 0){p(b.state);return}Object.keys(b.state).length!==1&&console.error(`
|
|
13720
|
+
`,onClick:n=>{n.stopPropagation(),t()},children:[ht.jsx("input",{type:"checkbox",checked:e}),ht.jsx("span",{style:{color:"#eee"},children:i})]}),K$t=({children:i,elements:e})=>{const[t,n]=UE(Z=>[Z.is_mouse_over_container,Z.setIsMouseOverContainer]),[r,a]=Ct.useState(!1),[o,s]=Ct.useState(!1),[l,c]=Ct.useState(!1),[u,A]=UE(Z=>[Z.selected_layer,Z.selectLayer]),[f,p,v,x,B,b]=UE(Z=>[Z.in_move_footprint_mode,Z.in_draw_trace_mode,Z.is_showing_rats_nest,Z.is_showing_multiple_traces_length,Z.is_showing_autorouting,Z.is_showing_drc_errors]),w=UE(Z=>Z.setEditMode),R=UE(Z=>Z.setIsShowingRatsNest),k=UE(Z=>Z.setIsShowingMultipleTracesLength),V=UE(Z=>Z.setIsShowingAutorouting),Y=UE(Z=>Z.setIsShowingDrcErrors);Q9("1",()=>A("top")),Q9("2",()=>A("bottom")),Q9("3",()=>A("inner1")),Q9("4",()=>A("inner2")),Q9("5",()=>A("inner3")),Q9("6",()=>A("inner4")),Q9("7",()=>A("inner5")),Q9("8",()=>A("inner6"));const J=(e==null?void 0:e.filter(Z=>Z.type.includes("error")).length)??0;return ht.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:Z=>{n(!1),s(!1)},children:[i,ht.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",Y$t.version]}),ht.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Nx.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[ht.jsxs(yR,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[ht.jsxs("div",{children:["layer:"," ",ht.jsx("span",{style:{marginLeft:2,fontWeight:500,color:mR[u]},children:u})]}),o&&ht.jsx("div",{style:{marginTop:4,minWidth:120},children:IAe.map(Z=>Z.replace(/-/g,"")).map(Z=>ht.jsx(V$t,{name:Z,selected:Z===u,onClick:()=>{A(Z.replace(/-/,""))}},Z))})]}),ht.jsxs(yR,{style:J>0?{color:"red"}:{},onClick:()=>c(!l),onMouseLeave:()=>c(!1),children:[ht.jsxs("div",{children:[J," errors"]}),l&&ht.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(Z=>Z.type.includes("error")).map((Z,$)=>ht.jsxs(Ct.Fragment,{children:[ht.jsx("div",{children:Z.error_type}),ht.jsx("div",{children:Z.message})]},$))})]}),ht.jsx(yR,{style:{},onClick:()=>{w(p?"off":"draw_trace")},children:ht.jsxs("div",{children:[p?"✖ ":"","Edit Traces"]})}),ht.jsx(yR,{style:{},onClick:()=>{w(f?"off":"move_footprint")},children:ht.jsxs("div",{children:[f?"✖ ":"","Move Components"]})}),ht.jsx(yR,{style:{},onClick:()=>{R(!v)},children:ht.jsxs("div",{children:[v?"✖ ":"","Rats Nest"]})}),ht.jsx(yR,{onClick:()=>{a(!r)},children:ht.jsxs("div",{children:[ht.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",ht.jsx("span",{style:{fontSize:"8px",transform:r?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),r&&ht.jsxs("div",{style:{marginTop:4,minWidth:120},children:[ht.jsx(SAe,{label:"Show All Trace Lengths",checked:x,onClick:()=>{k(!x)}}),ht.jsx(SAe,{label:"Show Autorouting Animation",checked:B,onClick:()=>{V(!B)}}),ht.jsx(SAe,{label:"Show DRC Errors",checked:b,onClick:()=>{Y(!b)}})]})]})})]})]})},j$t=i=>{const{transform:e,elements:t}=i,[n,r]=Ct.useMemo(()=>{const c=i.elements.flatMap(A=>r$t(A,i.elements)),u=qQ(i.elements);return[c,u]},[i.elements]),[a,o]=Ct.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=Ct.useMemo(()=>n$t({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=Ct.useCallback(c=>{var f,p;const u=[];for(const v of c)if(v._element){const x=r.getNetConnectedToId("pcb_port_id"in v._element?(f=v._element)==null?void 0:f.pcb_port_id:"pcb_trace_id"in v._element?(p=v._element)==null?void 0:p.pcb_trace_id:"");u.push(...r.getIdsConnectedToNet(x))}const A=new Set(c.map(v=>v._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:A,primitiveIdsInMousedOverNet:u})},[r]);return ht.jsx(z$t,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:ht.jsx(B$t,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:ht.jsx(w$t,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:ht.jsx(_$t,{transform:e,focusOnHover:i.focusOnHover,children:ht.jsx(K$t,{elements:t,children:ht.jsx(R$t,{transform:e,elements:t,children:ht.jsx(H$t,{transform:e,soup:t,children:ht.jsx(I$t,{transform:e,debugGraphics:i.debugGraphics,children:ht.jsx(E$t,{transform:e,elements:t,children:ht.jsx(C$t,{transform:e,primitives:s,width:i.width,height:i.height,grid:i.grid})})})})})})})})})})},J$t=Fd(Dh(400,300),JE(40,-40)),q$t=({circuitJson:i,debugGraphics:e,height:t=600,initialState:n,allowEditing:r=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[c,u]=Ct.useState(!l),[A,f]=BAe(),[p,v]=Ct.useState(J$t),{ref:x,setTransform:B,cancelDrag:b}=t$t({transform:p,onSetTransform:v,enabled:c});let[w,R]=Ct.useState([]);w=a??w;const k=Ct.useRef(!1),V=Ct.useRef(null),Y=`${(i==null?void 0:i.length)||0}_${(i==null?void 0:i.editCount)||0}`,J=()=>{const ue=(f==null?void 0:f.width)>0?f:{width:500,height:500},{center:ge,width:be,height:Qe}=$.some(Ie=>Ie.type.startsWith("pcb_"))?VXt($.filter(Ie=>Ie.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},ve=Math.min((ue.width??0)/be,(ue.height??0)/Qe,100)*.75,Be=Fd(Dh((ue.width??0)/2,(ue.height??0)/2),JE(ve,-ve,0,0),Dh(-ge.x,-ge.y));B(Be)};Ct.useEffect(()=>{f!=null&&f.width&&i&&i.length!==0&&(k.current||(J(),k.current=!0))},[i,f]);const Z=Ct.useMemo(()=>(i==null?void 0:i.filter(ue=>ue.type.startsWith("pcb_")||ue.type.startsWith("source_")))??[],[Y]),$=Ct.useMemo(()=>rqt({circuitJson:Z,editEvents:w}),[Z,w]),X=ue=>{R([...w,ue]),o==null||o([...w,ue])},de=ue=>{const ge=w.map(be=>be.edit_event_id===ue.edit_event_id?{...be,...ue}:be);R(ge),o==null||o(ge)};return ht.jsxs("div",{ref:x,style:{position:"relative"},children:[ht.jsx("div",{ref:A,children:ht.jsxs(jXt,{initialState:n,children:[ht.jsx(j$t,{transform:p,height:t,width:f.width,allowEditing:r,focusOnHover:s,cancelPanDrag:b,onCreateEditEvent:X,onModifyEditEvent:de,grid:{spacing:1,view_window:{left:0,right:f.width||500,top:t,bottom:0}},elements:$,debugGraphics:e},f.width),ht.jsx(qXt,{})]})}),l&&!c&&ht.jsx("div",{onClick:()=>{u(!0),J()},onTouchStart:ue=>{const ge=ue.touches[0];V.current={x:ge.clientX,y:ge.clientY}},onTouchEnd:ue=>{const ge=ue.changedTouches[0],be=V.current;if(!be)return;const Qe=Math.abs(ge.clientX-be.x),ve=Math.abs(ge.clientY-be.y);Qe<10&&ve<10&&(ue.preventDefault(),u(!0),J()),V.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Nx.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:ht.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const Z$t=({containerClassName:i,...e})=>{const t=Ct.useRef(null),[n,r]=Ct.useState(620);return Ct.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),ht.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:ht.jsx(q$t,{...e,height:n})})},W$t='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',X$t=()=>{Ct.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=W$t,document.head.appendChild(e)},[])},$$t=i=>{Ct.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},MYe=i=>`hsl(${Bb.indexOf(i)*137.5%360}, 70%, 50%)`,een=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return ht.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[ht.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:Bb.map(t=>{const n=i[t]||0,r=n/e*100;return ht.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:MYe(t)},children:ht.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),ht.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},ten=({renderLog:i})=>{const[e,t]=Ct.useState("chronological");if(!i)return ht.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>Bb.indexOf(a[0])-Bb.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const r=n.reduce((a,[o,s])=>a+s,0);return ht.jsxs("div",{className:"rf-bg-white",children:[ht.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[ht.jsx("div",{children:"Render Logs"}),ht.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[ht.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),ht.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[ht.jsx("option",{value:"chronological",children:"Phase Order"}),ht.jsx("option",{value:"longest",children:"Duration"})]})]})]}),ht.jsx(een,{phaseTimings:i.phaseTimings}),ht.jsxs("table",{className:"rf-w-full rf-text-xs",children:[ht.jsx("thead",{children:ht.jsxs("tr",{children:[ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),ht.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),ht.jsx("tbody",{children:n.map(([a,o])=>ht.jsxs("tr",{children:[ht.jsx("td",{className:"rf-p-2",children:Bb.indexOf(a)}),ht.jsx("td",{className:"rf-p-2",children:a}),ht.jsx("td",{className:"rf-p-2",children:ht.jsx("div",{className:"rf-w-8",children:ht.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:MYe(a),width:`${o/r*100}%`}})})}),ht.jsx("td",{className:"rf-p-2",children:ht.jsxs("div",{className:"rf-flex w-full",children:[ht.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),ht.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/r*100).toFixed(1),"%"]})]})})]},a))})]})]})},nen=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{Ct.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{AU.captureException(n)}catch{}}},[i,e]),Ct.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{AU.captureException(r,{error_type:n.type})}catch{}}},[t])},ien="0.0.657",QAe={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},wAe=new Map,oz=i=>{const e=wAe.get(i);return e?Object.fromEntries(Object.entries(e.stores).map(([t,n])=>[t,n.getState()])):{}},ren=(i,e,t)=>{if(i===void 0)return{type:"untracked",connection:e.connect(t)};const n=wAe.get(t.name);if(n)return{type:"tracked",store:i,...n};const r={connection:e.connect(t),stores:{}};return wAe.set(t.name,r),{type:"tracked",store:i,...r}},aen=(i,e={})=>(t,n,r)=>{const{enabled:a,anonymousActionType:o,store:s,...l}=e;let c;try{c=(a??(QAe?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!c)return(QAe?"production":void 0)!=="production"&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),i(t,n,r);const{connection:u,...A}=ren(s,c,l);let f=!0;r.setState=(x,B,b)=>{const w=t(x,B);if(!f)return w;const R=b===void 0?{type:o||"anonymous"}:typeof b=="string"?{type:b}:b;return s===void 0?(u==null||u.send(R,n()),w):(u==null||u.send({...R,type:`${s}/${R.type}`},{...oz(l.name),[s]:r.getState()}),w)};const p=(...x)=>{const B=f;f=!1,t(...x),f=B},v=i(r.setState,n,r);if(A.type==="untracked"?u==null||u.init(v):(A.stores[A.store]=r,u==null||u.init(Object.fromEntries(Object.entries(A.stores).map(([x,B])=>[x,x===A.store?v:B.getState()])))),r.dispatchFromDevtools&&typeof r.dispatch=="function"){let x=!1;const B=r.dispatch;r.dispatch=(...b)=>{(QAe?"production":void 0)!=="production"&&b[0].type==="__setState"&&!x&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),x=!0),B(...b)}}return u.subscribe(x=>{var B;switch(x.type){case"ACTION":if(typeof x.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return MAe(x.payload,b=>{if(b.type==="__setState"){if(s===void 0){p(b.state);return}Object.keys(b.state).length!==1&&console.error(`
|
|
13721
13721
|
[zustand devtools middleware] Unsupported __setState action format.
|
|
13722
13722
|
When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(),
|
|
13723
13723
|
and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
|
package/dist/standalone.min.js
CHANGED
|
@@ -13079,7 +13079,7 @@ ${l.join(`
|
|
|
13079
13079
|
`)),i.indexOf(`\\
|
|
13080
13080
|
`)!==-1&&(i=i.replace(/\\\n/g,""));const t=i.split(`
|
|
13081
13081
|
`);let n="",r="",a=0,o=[];const s=typeof"".trimLeft=="function";for(let d=0,f=t.length;d<f;d++)if(n=t[d],n=s?n.trimLeft():n.trim(),a=n.length,a!==0&&(r=n.charAt(0),r!=="#"))if(r==="v"){const p=n.split(/\s+/);switch(p[0]){case"v":e.vertices.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3])),p.length>=7?e.colors.push(parseFloat(p[4]),parseFloat(p[5]),parseFloat(p[6])):e.colors.push(void 0,void 0,void 0);break;case"vn":e.normals.push(parseFloat(p[1]),parseFloat(p[2]),parseFloat(p[3]));break;case"vt":e.uvs.push(parseFloat(p[1]),parseFloat(p[2]));break}}else if(r==="f"){const m=n.substr(1).trim().split(/\s+/),y=[];for(let E=0,b=m.length;E<b;E++){const Q=m[E];if(Q.length>0){const M=Q.split("/");y.push(M)}}const x=y[0];for(let E=1,b=y.length-1;E<b;E++){const Q=y[E],M=y[E+1];e.addFace(x[0],Q[0],M[0],x[1],Q[1],M[1],x[2],Q[2],M[2])}}else if(r==="l"){const p=n.substring(1).trim().split(" ");let m=[];const y=[];if(n.indexOf("/")===-1)m=p;else for(let x=0,E=p.length;x<E;x++){const b=p[x].split("/");b[0]!==""&&m.push(b[0]),b[1]!==""&&y.push(b[1])}e.addLineGeometry(m,y)}else if(r==="p"){const m=n.substr(1).trim().split(" ");e.addPointGeometry(m)}else if((o=cWt.exec(n))!==null){const p=(" "+o[0].substr(1).trim()).substr(1);e.startObject(p)}else if(AWt.test(n))e.object.startMaterial(n.substring(7).trim(),e.materialLibraries);else if(uWt.test(n))e.materialLibraries.push(n.substring(7).trim());else if(dWt.test(n))console.warn('THREE.OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(r==="s"){if(o=n.split(" "),o.length>1){const m=o[1].trim().toLowerCase();e.object.smooth=m!=="0"&&m!=="off"}else e.object.smooth=!0;const p=e.object.currentMaterial();p&&(p.smooth=e.object.smooth)}else{if(n==="\0")continue;console.warn('THREE.OBJLoader: Unexpected line: "'+n+'"')}e.finalize();const l=new i2;if(l.materialLibraries=[].concat(e.materialLibraries),!(e.objects.length===1&&e.objects[0].geometry.vertices.length===0)===!0)for(let d=0,f=e.objects.length;d<f;d++){const p=e.objects[d],m=p.geometry,y=p.materials,x=m.type==="Line",E=m.type==="Points";let b=!1;if(m.vertices.length===0)continue;const Q=new Og;Q.setAttribute("position",new $d(m.vertices,3)),m.normals.length>0&&Q.setAttribute("normal",new $d(m.normals,3)),m.colors.length>0&&(b=!0,Q.setAttribute("color",new $d(m.colors,3))),m.hasUVIndices===!0&&Q.setAttribute("uv",new $d(m.uvs,2));const M=[];for(let V=0,Y=y.length;V<Y;V++){const q=y[V],K=q.name+"_"+q.smooth+"_"+b;let $=e.materials[K];if(this.materials!==null){if($=this.materials.create(q.name),x&&$&&!($ instanceof XE)){const j=new XE;_b.prototype.copy.call(j,$),j.color.copy($.color),$=j}else if(E&&$&&!($ instanceof c2)){const j=new c2({size:10,sizeAttenuation:!1});_b.prototype.copy.call(j,$),j.color.copy($.color),j.map=$.map,$=j}}$===void 0&&(x?$=new XE:E?$=new c2({size:1,sizeAttenuation:!1}):$=new sO,$.name=q.name,$.flatShading=!q.smooth,$.vertexColors=b,e.materials[K]=$),M.push($)}let L;if(M.length>1){for(let V=0,Y=y.length;V<Y;V++){const q=y[V];Q.addGroup(q.groupStart,q.groupCount,V)}x?L=new cS(Q,M):E?L=new UT(Q,M):L=new DI(Q,M)}else x?L=new cS(Q,M[0]):E?L=new UT(Q,M[0]):L=new DI(Q,M[0]);L.name=p.name,l.add(L)}else if(e.vertices.length>0){const d=new c2({size:1,sizeAttenuation:!1}),f=new Og;f.setAttribute("position",new $d(e.vertices,3)),e.colors.length>0&&e.colors[0]!==void 0&&(f.setAttribute("color",new $d(e.colors,3)),d.vertexColors=!0);const p=new UT(f,d);l.add(p)}return l}};typeof window<"u"&&!window.TSCIRCUIT_OBJ_LOADER_CACHE&&(window.TSCIRCUIT_OBJ_LOADER_CACHE=new Map);function pWt(i){const[e,t]=rt.useState(null);return rt.useEffect(()=>{if(!i)return;const n=window.TSCIRCUIT_OBJ_LOADER_CACHE;let r=!1;async function a(){var s;try{const u=await(await fetch(i)).text(),d=(s=u.match(/newmtl[\s\S]*?endmtl/g))==null?void 0:s.join(`
|
|
13082
|
-
`).replace(/d 0\./g,"d 1."),f=u.replace(/newmtl[\s\S]*?endmtl/g,""),p=new sWt;p.setMaterialOptions({invertTrProperty:!0});const m=p.parse(d.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),y=new hWt;return y.setMaterials(m),y.parse(f)}catch(l){return l}}function o(){if(n.has(i)){const l=n.get(i);return l.result?Promise.resolve(l.result.clone()):l.promise.then(u=>u.clone())}const s=a().then(l=>(l instanceof Error||n.set(i,{...n.get(i),result:l}),l));return n.set(i,{promise:s,result:null}),s}return o().then(s=>{r||t(s)}).catch(s=>{console.error(s)}),()=>{r=!0}},[i]),e}function gWt({url:i,position:e,rotation:t,onHover:n,onUnhover:r,isHovered:a}){const o=pWt(i);return o?o instanceof Error?Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsxs("mesh",{position:e,children:[Ke.jsx("boxGeometry",{args:[.5,.5,.5]}),Ke.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),Ke.jsx("meshBasicMaterial",{color:"red"})]})}):Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsx("primitive",{rotation:t,position:e,object:o})}):Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsxs("mesh",{position:e,children:[Ke.jsx("boxGeometry",{args:[.5,.5,.5]}),Ke.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var mWt=s_(_He()),BHe=({jscadPlan:i,positionOffset:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const{threeGeom:o,material:s}=rt.useMemo(()=>{const l=f2e.executeJscadOperations(mWt.default,i),u=f6t(l),d=new oD({vertexColors:!0,side:Ax});return{threeGeom:u,material:d}},[i]);return rt.useMemo(()=>{if(a){const l=new Vu(s.color.getHex());s.emissive.copy(l),s.emissive.setRGB(0,0,1),s.emissiveIntensity=.2}else s.emissiveIntensity=0},[a,s]),o?Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,position:e,children:Ke.jsx("mesh",{geometry:o,material:s,position:e,rotation:t})}):null},{createJSCADRoot:yWt}=_Nt(f2e.jscadPlanner),vWt=({positionOffset:i,footprint:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const o=rt.useMemo(()=>{if(!e)return null;const s=[];return yWt(s).render(Ke.jsx(GYt,{footprint:e})),s},[e]);return o?Ke.jsx(Ke.Fragment,{children:o.map((s,l)=>Ke.jsx(BHe,{positionOffset:i,rotationOffset:t,jscadPlan:s,onHover:n,onUnhover:r,isHovered:a},l))}):null},CWt=(...i)=>i,SHe=({cad_component:i,circuitJson:e})=>{const[t,n]=rt.useState(!1),[r,a]=rt.useState(null),o=rt.useCallback(p=>{p!=null&&p.mousePosition?(n(!0),a(p.mousePosition)):(n(!1),a(null))},[]),s=rt.useCallback(()=>{n(!1),a(null)},[]),l=rt.useMemo(()=>{var p;return(p=Qv(e).source_component.getUsing({source_component_id:i.source_component_id}))==null?void 0:p.name},[e,i.source_component_id]),u=i.model_obj_url??i.model_stl_url,d=i.rotation?CWt(i.rotation.x*Math.PI/180,i.rotation.y*Math.PI/180,i.rotation.z*Math.PI/180):void 0;let f=null;return u?f=Ke.jsx(gWt,{url:u,position:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotation:d,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.model_jscad?f=Ke.jsx(BHe,{jscadPlan:i.model_jscad,rotationOffset:d,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.footprinter_string&&(f=Ke.jsx(vWt,{positionOffset:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotationOffset:d,footprint:i.footprinter_string,onHover:o,onUnhover:s,isHovered:t})),Ke.jsxs(Ke.Fragment,{children:[f,t&&r?Ke.jsx(dOe,{position:r,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:l??"<unknown>"}):null]})},IWt={version:"0.0.292"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new sB(0,0,0));function _Wt(i,e){const t=new Nb().setFromEuler(new sB(i.x,i.y,i.z)),n=new _i(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var EWt=({})=>{const i=rt.useRef();return rt.useRef({lastRotation:new sB}),$8((e,t)=>{if(!i.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,r=_Wt(n,2);e.camera.position.copy(r),e.camera.lookAt(0,0,0)}),Ke.jsxs("mesh",{ref:i,rotation:[Math.PI/2,0,0],children:[Ke.jsx("boxGeometry",{args:[1,1,1]}),Ke.jsx("meshStandardMaterial",{color:"white"}),Ke.jsx(P2,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),Ke.jsx(P2,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),Ke.jsx(P2,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),Ke.jsx(P2,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),Ke.jsx(P2,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),Ke.jsx(P2,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),Ke.jsx("lineSegments",{args:[new Gte(new bM(1,1,1))],material:new XE({color:0,linewidth:2})})]})},bWt=()=>($8(({camera:i})=>{window.TSCI_MAIN_CAMERA_ROTATION=i.rotation}),Ke.jsx(Ke.Fragment,{})),wHe=rt.forwardRef(({children:i,initialCameraPosition:e=[5,5,5],autoRotateDisabled:t,clickToInteractEnabled:n=!1,boardDimensions:r},a)=>{const[o,s]=rt.useState(!n),l=rt.useMemo(()=>{if(!r)return 10;const u=r.width??0,d=r.height??0,p=Math.max(u,d)*1.5;return p>10?p:10},[r]);return Ke.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Ke.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:Ke.jsxs(cOe,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[Ke.jsx("ambientLight",{intensity:Math.PI/2}),Ke.jsx(EWt,{})]})}),Ke.jsxs(cOe,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:e},children:[Ke.jsx(bWt,{}),o&&Ke.jsx(ZKt,{autoRotate:!t,autoRotateSpeed:1}),Ke.jsx("ambientLight",{intensity:Math.PI/2}),Ke.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),Ke.jsx(WKt,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:l,args:[l,l]}),Ke.jsx("object3D",{ref:a,children:i})]}),Ke.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",IWt.version]}),n&&!o&&Ke.jsx("button",{type:"button",onClick:()=>s(!0),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&s(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:Ke.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),QHe=i=>rt.useMemo(()=>{if(!i)return[];const e=new Qxt;return e.add(i),e.render(),e.getCircuitJson()},[i]);function xWt(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=t,n.readAsDataURL(i)})}var BWt=i=>{const[e,t]=rt.useState([]),[n,r]=rt.useState(!0);return rt.useEffect(()=>{if(!i)return;(async()=>{r(!0);const s=(Array.isArray(i)?i:[i]).map(async l=>{const u=Ajt.serialize({binary:!0},[l]),d=new Blob(u);return{stlUrl:await xWt(d),color:l.color}});try{const l=await Promise.all(s);t(l)}catch(l){console.error("Error generating STLs:",l),t([])}finally{r(!1)}})()},[i]),{stls:e,loading:n}},SWt=s_(zD()),wWt=s_(lU()),cC=.01,ib={copper:[.9,.6,.2],fr4Green:[5/255,163/255,46/255],fr4GreenSolderWithMask:[0/255,152/255,19/255],fr1Copper:[.8,.4,.2],fr1CopperSolderWithMask:[.9,.6,.2]},o9=.001,Jw=32,QWt=.035,aH=50,ffe={fr1:ib.fr1Copper,fr4:ib.fr4Green},MHe={fr1:ib.fr1CopperSolderWithMask,fr4:ib.fr4GreenSolderWithMask},MWt=s_(tH()),RWt=s_(zD()),DWt=s_(rH()),RHe=i=>{let e=0;for(let n=0;n<i.length;n++){const r=(n+1)%i.length;e+=i[n][0]*i[r][1],e-=i[r][0]*i[n][1]}return e/2<=0},DHe=(i,e=1.2)=>{const{outline:t}=i;let n=t.map(o=>[o.x,o.y]);RHe(n)&&(n=n.reverse());const r=(0,RWt.polygon)({points:n});let a=(0,MWt.extrudeLinear)({height:e},r);return a=(0,DWt.translate)([0,0,-e/2],a),a},NWt=i=>{const e=Qv(i).pcb_board.list()[0];if(!e)return console.warn("No pcb_board found for simplified geometry"),[];let t;const n=1.2;e.outline&&e.outline.length>0?t=DHe({outline:e.outline},n):t=(0,SWt.cuboid)({size:[e.width,e.height,n],center:[e.center.x,e.center.y,0]});const r=ffe[e.material]??ib.fr4Green;return[(0,wWt.colorize)(r,t)]},F2=s_(rH()),yx=s_(zD()),HD=s_(lU()),O2=s_(sfe()),PI=s_(zD()),oH=s_(lU()),TB=s_(sfe()),H_=.05,NHe=(i,e)=>{if(i.shape||(i.shape="circle"),i.shape==="circle")return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)((0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:e.pcbThickness}),(0,PI.cylinder)({center:[i.x,i.y,e.pcbThickness/2+H_/2+cC],radius:i.outer_diameter/2,height:H_}),(0,PI.cylinder)({center:[i.x,i.y,-e.pcbThickness/2-H_/2-cC],radius:i.outer_diameter/2,height:H_})),(0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2-cC,height:1.5})));if(i.shape==="circular_hole_with_rect_pad"){const t=i.rect_pad_width||i.hole_diameter,n=i.rect_pad_height||i.hole_diameter;return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)((0,PI.cuboid)({center:[i.x,i.y,1.2/2],size:[t,n,H_]}),(0,PI.cuboid)({center:[i.x,i.y,-1.2/2],size:[t,n,H_]}),(0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:1.2})),(0,PI.cylinder)({center:[i.x,i.y,0],radius:Math.max(i.hole_diameter/2-cC,.01),height:1.5})))}if(i.shape==="pill"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=t?i.outer_height||r+.2:i.outer_width||n+.2,o=t?i.outer_width||n+.2:i.outer_height||r+.2,s=r/2,l=o/2,u=Math.abs(n-r),d=Math.abs(a-o),f=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r,u,e.pcbThickness]:[u,r,e.pcbThickness]}),p=(0,PI.cylinder)({center:t?[i.x,i.y-u/2,0]:[i.x-u/2,i.y,0],radius:s,height:e.pcbThickness}),m=(0,PI.cylinder)({center:t?[i.x,i.y+u/2,0]:[i.x+u/2,i.y,0],radius:s,height:e.pcbThickness}),y=(0,TB.union)(f,p,m),x=e.pcbThickness/2+H_/2+cC,E=(0,PI.cuboid)({center:[i.x,i.y,x],size:t?[o,d,H_]:[d,o,H_]}),b=(0,PI.cylinder)({center:t?[i.x,i.y-d/2,x]:[i.x-d/2,i.y,x],radius:l,height:H_}),Q=(0,PI.cylinder)({center:t?[i.x,i.y+d/2,x]:[i.x+d/2,i.y,x],radius:l,height:H_}),M=(0,TB.union)(E,b,Q),L=-e.pcbThickness/2-H_/2-cC,V=(0,PI.cuboid)({center:[i.x,i.y,L],size:t?[o,d,H_]:[d,o,H_]}),Y=(0,PI.cylinder)({center:t?[i.x,i.y-d/2,L]:[i.x-d/2,i.y,L],radius:l,height:H_}),q=(0,PI.cylinder)({center:t?[i.x,i.y+d/2,L]:[i.x+d/2,i.y,L],radius:l,height:H_}),K=(0,TB.union)(V,Y,q),$=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r-2*cC,u,e.pcbThickness+2*cC]:[u,r-2*cC,e.pcbThickness+2*cC]}),j=(0,PI.cylinder)({center:t?[i.x,i.y-u/2,0]:[i.x-u/2,i.y,0],radius:s-cC,height:e.pcbThickness+2*cC}),ue=(0,PI.cylinder)({center:t?[i.x,i.y+u/2,0]:[i.x+u/2,i.y,0],radius:s-cC,height:e.pcbThickness+2*cC}),ce=(0,TB.union)($,j,ue);return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)(y,M,K),ce))}if(i.shape==="pill_hole_with_rect_pad"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=r/2,o=Math.abs(n-r),s=i.rect_pad_width||n+.2,l=i.rect_pad_height||r+.2,u=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r,o,1.2]:[o,r,1.2]}),d=(0,PI.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a,height:1.2}),f=(0,PI.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a,height:1.2}),p=(0,PI.cuboid)({center:[i.x,i.y,1.2/2],size:[s,l,H_]}),m=(0,PI.cuboid)({center:[i.x,i.y,-1.2/2],size:[s,l,H_]}),y=(0,TB.union)((0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r-H_,o,1.5]:[o,r-H_,1.5]}),(0,PI.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a-H_,height:1.5}),(0,PI.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a-H_,height:1.5}));return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)(u,d,f,p,m),y))}else throw new Error(`Unsupported plated hole shape: ${i.shape}`)},sH=s_(tH()),THe=s_(cfe()),TWt=s_(tfe());function UHe(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function GM(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function PHe(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,a=e(t,n);return PHe(a,...r)}}}function LHe(...i){return PHe(...i)}var{cos:UWt,sin:PWt}=Math;function kHe(i,e,t){const n=UWt(i),r=PWt(i);return{a:n,c:-r,e:0,b:r,d:n,f:0}}function LWt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function lH(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,lH.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}LWt(lH,Error);function hfe(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}lH.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,o=this.location.source+":"+a.line+":"+a.column;if(t){var s=this.location.end,l=hfe("",a.line.toString().length," "),u=t[r.line-1],d=r.line===s.line?s.column:u.length+1,f=d-r.column||1;e+=`
|
|
13082
|
+
`).replace(/d 0\./g,"d 1."),f=u.replace(/newmtl[\s\S]*?endmtl/g,""),p=new sWt;p.setMaterialOptions({invertTrProperty:!0});const m=p.parse(d.replace(/Kd\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)/g,"Kd $2 $2 $2"),"test.mtl"),y=new hWt;return y.setMaterials(m),y.parse(f)}catch(l){return l}}function o(){if(n.has(i)){const l=n.get(i);return l.result?Promise.resolve(l.result.clone()):l.promise.then(u=>u.clone())}const s=a().then(l=>(l instanceof Error||n.set(i,{...n.get(i),result:l}),l));return n.set(i,{promise:s,result:null}),s}return o().then(s=>{r||t(s)}).catch(s=>{console.error(s)}),()=>{r=!0}},[i]),e}function gWt({url:i,position:e,rotation:t,onHover:n,onUnhover:r,isHovered:a}){const o=pWt(i);return o?o instanceof Error?Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsxs("mesh",{position:e,children:[Ke.jsx("boxGeometry",{args:[.5,.5,.5]}),Ke.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.5}),Ke.jsx("meshBasicMaterial",{color:"red"})]})}):Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsx("primitive",{rotation:t,position:e,object:o})}):Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,children:Ke.jsxs("mesh",{position:e,children:[Ke.jsx("boxGeometry",{args:[.5,.5,.5]}),Ke.jsx("meshStandardMaterial",{transparent:!0,color:"red",opacity:.25})]})})}var mWt=s_(_He()),BHe=({jscadPlan:i,positionOffset:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const{threeGeom:o,material:s}=rt.useMemo(()=>{const l=f2e.executeJscadOperations(mWt.default,i),u=f6t(l),d=new oD({vertexColors:!0,side:Ax});return{threeGeom:u,material:d}},[i]);return rt.useMemo(()=>{if(a){const l=new Vu(s.color.getHex());s.emissive.copy(l),s.emissive.setRGB(0,0,1),s.emissiveIntensity=.2}else s.emissiveIntensity=0},[a,s]),o?Ke.jsx(pU,{isHovered:a,onHover:n,onUnhover:r,position:e,children:Ke.jsx("mesh",{geometry:o,material:s,position:e,rotation:t})}):null},{createJSCADRoot:yWt}=_Nt(f2e.jscadPlanner),vWt=({positionOffset:i,footprint:e,rotationOffset:t,onHover:n,onUnhover:r,isHovered:a})=>{const o=rt.useMemo(()=>{if(!e)return null;const s=[];return yWt(s).render(Ke.jsx(GYt,{footprint:e})),s},[e]);return o?Ke.jsx(Ke.Fragment,{children:o.map((s,l)=>Ke.jsx(BHe,{positionOffset:i,rotationOffset:t,jscadPlan:s,onHover:n,onUnhover:r,isHovered:a},l))}):null},CWt=(...i)=>i,SHe=({cad_component:i,circuitJson:e})=>{const[t,n]=rt.useState(!1),[r,a]=rt.useState(null),o=rt.useCallback(p=>{p!=null&&p.mousePosition?(n(!0),a(p.mousePosition)):(n(!1),a(null))},[]),s=rt.useCallback(()=>{n(!1),a(null)},[]),l=rt.useMemo(()=>{var p;return(p=Qv(e).source_component.getUsing({source_component_id:i.source_component_id}))==null?void 0:p.name},[e,i.source_component_id]),u=i.model_obj_url??i.model_stl_url,d=i.rotation?CWt(i.rotation.x*Math.PI/180,i.rotation.y*Math.PI/180,i.rotation.z*Math.PI/180):void 0;let f=null;return u?f=Ke.jsx(gWt,{url:u,position:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotation:d,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.model_jscad?f=Ke.jsx(BHe,{jscadPlan:i.model_jscad,rotationOffset:d,onHover:o,onUnhover:s,isHovered:t},i.cad_component_id):i.footprinter_string&&(f=Ke.jsx(vWt,{positionOffset:i.position?[i.position.x,i.position.y,i.position.z]:void 0,rotationOffset:d,footprint:i.footprinter_string,onHover:o,onUnhover:s,isHovered:t})),Ke.jsxs(Ke.Fragment,{children:[f,t&&r?Ke.jsx(dOe,{position:r,style:{fontFamily:"sans-serif",transform:"translate3d(50%, 50%, 0)",backgroundColor:"white",padding:"5px",borderRadius:"3px",pointerEvents:"none",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"},children:l??"<unknown>"}):null]})},IWt={version:"0.0.293"};typeof window<"u"&&(window.TSCI_MAIN_CAMERA_ROTATION=new sB(0,0,0));function _Wt(i,e){const t=new Nb().setFromEuler(new sB(i.x,i.y,i.z)),n=new _i(0,0,1);return n.applyQuaternion(t),n.multiplyScalar(e)}var EWt=({})=>{const i=rt.useRef();return rt.useRef({lastRotation:new sB}),$8((e,t)=>{if(!i.current)return;const n=window.TSCI_MAIN_CAMERA_ROTATION,r=_Wt(n,2);e.camera.position.copy(r),e.camera.lookAt(0,0,0)}),Ke.jsxs("mesh",{ref:i,rotation:[Math.PI/2,0,0],children:[Ke.jsx("boxGeometry",{args:[1,1,1]}),Ke.jsx("meshStandardMaterial",{color:"white"}),Ke.jsx(P2,{position:[0,0,.51],fontSize:.25,color:"black",children:"Front"}),Ke.jsx(P2,{position:[0,0,-.51],fontSize:.25,color:"black",rotation:[0,Math.PI,0],children:"Back"}),Ke.jsx(P2,{position:[.51,0,0],fontSize:.25,color:"black",rotation:[0,Math.PI/2,0],children:"Right"}),Ke.jsx(P2,{position:[-.51,0,0],fontSize:.25,color:"black",rotation:[0,-Math.PI/2,0],children:"Left"}),Ke.jsx(P2,{position:[0,.51,0],fontSize:.25,color:"black",rotation:[-Math.PI/2,0,0],children:"Top"}),Ke.jsx(P2,{position:[0,-.51,0],fontSize:.25,color:"black",rotation:[Math.PI/2,0,0],children:"Bottom"}),Ke.jsx("lineSegments",{args:[new Gte(new bM(1,1,1))],material:new XE({color:0,linewidth:2})})]})},bWt=()=>($8(({camera:i})=>{window.TSCI_MAIN_CAMERA_ROTATION=i.rotation}),Ke.jsx(Ke.Fragment,{})),wHe=rt.forwardRef(({children:i,initialCameraPosition:e=[5,5,5],autoRotateDisabled:t,clickToInteractEnabled:n=!1,boardDimensions:r},a)=>{const[o,s]=rt.useState(!n),l=rt.useMemo(()=>{if(!r)return 10;const u=r.width??0,d=r.height??0,p=Math.max(u,d)*1.5;return p>10?p:10},[r]);return Ke.jsxs("div",{style:{position:"relative",width:"100%",height:"100%"},children:[Ke.jsx("div",{style:{position:"absolute",top:0,left:0,width:120,height:120},children:Ke.jsxs(cOe,{camera:{up:[0,0,1],position:[1,1,1]},style:{zIndex:10},children:[Ke.jsx("ambientLight",{intensity:Math.PI/2}),Ke.jsx(EWt,{})]})}),Ke.jsxs(cOe,{scene:{up:[0,0,1]},camera:{up:[0,0,1],position:e},children:[Ke.jsx(bWt,{}),o&&Ke.jsx(ZKt,{autoRotate:!t,autoRotateSpeed:1}),Ke.jsx("ambientLight",{intensity:Math.PI/2}),Ke.jsx("pointLight",{position:[-10,-10,10],decay:0,intensity:Math.PI/4}),Ke.jsx(WKt,{rotation:[Math.PI/2,0,0],infiniteGrid:!0,cellSize:1,sectionSize:l,args:[l,l]}),Ke.jsx("object3D",{ref:a,children:i})]}),Ke.jsxs("div",{style:{position:"absolute",right:24,bottom:24,fontFamily:"sans-serif",color:"white",WebkitTextStroke:"0.5px rgba(0, 0, 0, 0.5)",fontSize:11},children:["@",IWt.version]}),n&&!o&&Ke.jsx("button",{type:"button",onClick:()=>s(!0),onKeyDown:u=>{(u.key==="Enter"||u.key===" ")&&s(!0)},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:10,display:"flex",alignItems:"center",justifyContent:"center"},children:Ke.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",fontFamily:"sans-serif",pointerEvents:"none"},children:"Click to Interact"})})]})}),QHe=i=>rt.useMemo(()=>{if(!i)return[];const e=new Qxt;return e.add(i),e.render(),e.getCircuitJson()},[i]);function xWt(i){return new Promise((e,t)=>{const n=new FileReader;n.onload=()=>{e(n.result)},n.onerror=t,n.readAsDataURL(i)})}var BWt=i=>{const[e,t]=rt.useState([]),[n,r]=rt.useState(!0);return rt.useEffect(()=>{if(!i)return;(async()=>{r(!0);const s=(Array.isArray(i)?i:[i]).map(async l=>{const u=Ajt.serialize({binary:!0},[l]),d=new Blob(u);return{stlUrl:await xWt(d),color:l.color}});try{const l=await Promise.all(s);t(l)}catch(l){console.error("Error generating STLs:",l),t([])}finally{r(!1)}})()},[i]),{stls:e,loading:n}},SWt=s_(zD()),wWt=s_(lU()),cC=.01,ib={copper:[.9,.6,.2],fr4Green:[5/255,163/255,46/255],fr4GreenSolderWithMask:[0/255,152/255,19/255],fr1Copper:[.8,.4,.2],fr1CopperSolderWithMask:[.9,.6,.2]},o9=.001,Jw=32,QWt=.035,aH=50,ffe={fr1:ib.fr1Copper,fr4:ib.fr4Green},MHe={fr1:ib.fr1CopperSolderWithMask,fr4:ib.fr4GreenSolderWithMask},MWt=s_(tH()),RWt=s_(zD()),DWt=s_(rH()),RHe=i=>{let e=0;for(let n=0;n<i.length;n++){const r=(n+1)%i.length;e+=i[n][0]*i[r][1],e-=i[r][0]*i[n][1]}return e/2<=0},DHe=(i,e=1.2)=>{const{outline:t}=i;let n=t.map(o=>[o.x,o.y]);RHe(n)&&(n=n.reverse());const r=(0,RWt.polygon)({points:n});let a=(0,MWt.extrudeLinear)({height:e},r);return a=(0,DWt.translate)([0,0,-e/2],a),a},NWt=i=>{const e=Qv(i).pcb_board.list()[0];if(!e)return console.warn("No pcb_board found for simplified geometry"),[];let t;const n=1.2;e.outline&&e.outline.length>0?t=DHe({outline:e.outline},n):t=(0,SWt.cuboid)({size:[e.width,e.height,n],center:[e.center.x,e.center.y,0]});const r=ffe[e.material]??ib.fr4Green;return[(0,wWt.colorize)(r,t)]},F2=s_(rH()),yx=s_(zD()),HD=s_(lU()),O2=s_(sfe()),PI=s_(zD()),oH=s_(lU()),TB=s_(sfe()),H_=.05,NHe=(i,e)=>{if(i.shape||(i.shape="circle"),i.shape==="circle")return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)((0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:e.pcbThickness}),(0,PI.cylinder)({center:[i.x,i.y,e.pcbThickness/2+H_/2+cC],radius:i.outer_diameter/2,height:H_}),(0,PI.cylinder)({center:[i.x,i.y,-e.pcbThickness/2-H_/2-cC],radius:i.outer_diameter/2,height:H_})),(0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2-cC,height:1.5})));if(i.shape==="circular_hole_with_rect_pad"){const t=i.rect_pad_width||i.hole_diameter,n=i.rect_pad_height||i.hole_diameter;return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)((0,PI.cuboid)({center:[i.x,i.y,1.2/2],size:[t,n,H_]}),(0,PI.cuboid)({center:[i.x,i.y,-1.2/2],size:[t,n,H_]}),(0,PI.cylinder)({center:[i.x,i.y,0],radius:i.hole_diameter/2,height:1.2})),(0,PI.cylinder)({center:[i.x,i.y,0],radius:Math.max(i.hole_diameter/2-cC,.01),height:1.5})))}if(i.shape==="pill"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=t?i.outer_height||r+.2:i.outer_width||n+.2,o=t?i.outer_width||n+.2:i.outer_height||r+.2,s=r/2,l=o/2,u=Math.abs(n-r),d=Math.abs(a-o),f=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r,u,e.pcbThickness]:[u,r,e.pcbThickness]}),p=(0,PI.cylinder)({center:t?[i.x,i.y-u/2,0]:[i.x-u/2,i.y,0],radius:s,height:e.pcbThickness}),m=(0,PI.cylinder)({center:t?[i.x,i.y+u/2,0]:[i.x+u/2,i.y,0],radius:s,height:e.pcbThickness}),y=(0,TB.union)(f,p,m),x=e.pcbThickness/2+H_/2+cC,E=(0,PI.cuboid)({center:[i.x,i.y,x],size:t?[o,d,H_]:[d,o,H_]}),b=(0,PI.cylinder)({center:t?[i.x,i.y-d/2,x]:[i.x-d/2,i.y,x],radius:l,height:H_}),Q=(0,PI.cylinder)({center:t?[i.x,i.y+d/2,x]:[i.x+d/2,i.y,x],radius:l,height:H_}),M=(0,TB.union)(E,b,Q),L=-e.pcbThickness/2-H_/2-cC,V=(0,PI.cuboid)({center:[i.x,i.y,L],size:t?[o,d,H_]:[d,o,H_]}),Y=(0,PI.cylinder)({center:t?[i.x,i.y-d/2,L]:[i.x-d/2,i.y,L],radius:l,height:H_}),q=(0,PI.cylinder)({center:t?[i.x,i.y+d/2,L]:[i.x+d/2,i.y,L],radius:l,height:H_}),K=(0,TB.union)(V,Y,q),$=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r-2*cC,u,e.pcbThickness+2*cC]:[u,r-2*cC,e.pcbThickness+2*cC]}),j=(0,PI.cylinder)({center:t?[i.x,i.y-u/2,0]:[i.x-u/2,i.y,0],radius:s-cC,height:e.pcbThickness+2*cC}),ue=(0,PI.cylinder)({center:t?[i.x,i.y+u/2,0]:[i.x+u/2,i.y,0],radius:s-cC,height:e.pcbThickness+2*cC}),ce=(0,TB.union)($,j,ue);return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)(y,M,K),ce))}if(i.shape==="pill_hole_with_rect_pad"){const t=i.hole_height>i.hole_width,n=t?i.hole_height:i.hole_width,r=t?i.hole_width:i.hole_height,a=r/2,o=Math.abs(n-r),s=i.rect_pad_width||n+.2,l=i.rect_pad_height||r+.2,u=(0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r,o,1.2]:[o,r,1.2]}),d=(0,PI.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a,height:1.2}),f=(0,PI.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a,height:1.2}),p=(0,PI.cuboid)({center:[i.x,i.y,1.2/2],size:[s,l,H_]}),m=(0,PI.cuboid)({center:[i.x,i.y,-1.2/2],size:[s,l,H_]}),y=(0,TB.union)((0,PI.cuboid)({center:[i.x,i.y,0],size:t?[r-H_,o,1.5]:[o,r-H_,1.5]}),(0,PI.cylinder)({center:t?[i.x,i.y-o/2,0]:[i.x-o/2,i.y,0],radius:a-H_,height:1.5}),(0,PI.cylinder)({center:t?[i.x,i.y+o/2,0]:[i.x+o/2,i.y,0],radius:a-H_,height:1.5}));return(0,oH.colorize)(ib.copper,(0,TB.subtract)((0,TB.union)(u,d,f,p,m),y))}else throw new Error(`Unsupported plated hole shape: ${i.shape}`)},sH=s_(tH()),THe=s_(cfe()),TWt=s_(tfe());function UHe(i,e){return Array.isArray(e)?[i.a*e[0]+i.c*e[1]+i.e,i.b*e[0]+i.d*e[1]+i.f]:{x:i.a*e.x+i.c*e.y+i.e,y:i.b*e.x+i.d*e.y+i.f}}function GM(i,e=0){return{a:1,c:0,e:i,b:0,d:1,f:e}}function PHe(...i){i=Array.isArray(i[0])?i[0]:i;const e=(t,n)=>({a:t.a*n.a+t.c*n.b,c:t.a*n.c+t.c*n.d,e:t.a*n.e+t.c*n.f+t.e,b:t.b*n.a+t.d*n.b,d:t.b*n.c+t.d*n.d,f:t.b*n.e+t.d*n.f+t.f});switch(i.length){case 0:throw new Error("no matrices provided");case 1:return i[0];case 2:return e(i[0],i[1]);default:{const[t,n,...r]=i,a=e(t,n);return PHe(a,...r)}}}function LHe(...i){return PHe(...i)}var{cos:UWt,sin:PWt}=Math;function kHe(i,e,t){const n=UWt(i),r=PWt(i);return{a:n,c:-r,e:0,b:r,d:n,f:0}}function LWt(i,e){function t(){this.constructor=i}t.prototype=e.prototype,i.prototype=new t}function lH(i,e,t,n){var r=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(r,lH.prototype),r.expected=e,r.found=t,r.location=n,r.name="SyntaxError",r}LWt(lH,Error);function hfe(i,e,t){return t=t||" ",i.length>e?i:(e-=i.length,t+=t.repeat(e),i+t.slice(0,e))}lH.prototype.format=function(i){var e="Error: "+this.message;if(this.location){var t=null,n;for(n=0;n<i.length;n++)if(i[n].source===this.location.source){t=i[n].text.split(/\r\n|\n|\r/g);break}var r=this.location.start,a=this.location.source&&typeof this.location.source.offset=="function"?this.location.source.offset(r):r,o=this.location.source+":"+a.line+":"+a.column;if(t){var s=this.location.end,l=hfe("",a.line.toString().length," "),u=t[r.line-1],d=r.line===s.line?s.column:u.length+1,f=d-r.column||1;e+=`
|
|
13083
13083
|
--> `+o+`
|
|
13084
13084
|
`+l+` |
|
|
13085
13085
|
`+a.line+" | "+u+`
|
|
@@ -13746,7 +13746,7 @@ $1`).replace(/>(\s*)(?=<!--\s*\/)/g,"> ")}return vpe}Qsn();function sJe(i,e,t,n=
|
|
|
13746
13746
|
&:hover {
|
|
13747
13747
|
background-color: rgba(255, 255, 255, 0.1);
|
|
13748
13748
|
}
|
|
13749
|
-
`,onClick:n=>{n.stopPropagation(),t()},children:[Ke.jsx("input",{type:"checkbox",checked:e}),Ke.jsx("span",{style:{color:"#eee"},children:i})]}),nAn=({children:i,elements:e})=>{const[t,n]=ME(K=>[K.is_mouse_over_container,K.setIsMouseOverContainer]),[r,a]=rt.useState(!1),[o,s]=rt.useState(!1),[l,u]=rt.useState(!1),[d,f]=ME(K=>[K.selected_layer,K.selectLayer]),[p,m,y,x,E,b]=ME(K=>[K.in_move_footprint_mode,K.in_draw_trace_mode,K.is_showing_rats_nest,K.is_showing_multiple_traces_length,K.is_showing_autorouting,K.is_showing_drc_errors]),Q=ME(K=>K.setEditMode),M=ME(K=>K.setIsShowingRatsNest),L=ME(K=>K.setIsShowingMultipleTracesLength),V=ME(K=>K.setIsShowingAutorouting),Y=ME(K=>K.setIsShowingDrcErrors);XM("1",()=>f("top")),XM("2",()=>f("bottom")),XM("3",()=>f("inner1")),XM("4",()=>f("inner2")),XM("5",()=>f("inner3")),XM("6",()=>f("inner4")),XM("7",()=>f("inner5")),XM("8",()=>f("inner6"));const q=(e==null?void 0:e.filter(K=>K.type.includes("error")).length)??0;return Ke.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:K=>{n(!1),s(!1)},children:[i,Ke.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",eAn.version]}),Ke.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Ix.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[Ke.jsxs(hN,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[Ke.jsxs("div",{children:["layer:"," ",Ke.jsx("span",{style:{marginLeft:2,fontWeight:500,color:fN[d]},children:d})]}),o&&Ke.jsx("div",{style:{marginTop:4,minWidth:120},children:ege.map(K=>K.replace(/-/g,"")).map(K=>Ke.jsx(tAn,{name:K,selected:K===d,onClick:()=>{f(K.replace(/-/,""))}},K))})]}),Ke.jsxs(hN,{style:q>0?{color:"red"}:{},onClick:()=>u(!l),onMouseLeave:()=>u(!1),children:[Ke.jsxs("div",{children:[q," errors"]}),l&&Ke.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(K=>K.type.includes("error")).map((K,$)=>Ke.jsxs(rt.Fragment,{children:[Ke.jsx("div",{children:K.error_type}),Ke.jsx("div",{children:K.message})]},$))})]}),Ke.jsx(hN,{style:{},onClick:()=>{Q(m?"off":"draw_trace")},children:Ke.jsxs("div",{children:[m?"✖ ":"","Edit Traces"]})}),Ke.jsx(hN,{style:{},onClick:()=>{Q(p?"off":"move_footprint")},children:Ke.jsxs("div",{children:[p?"✖ ":"","Move Components"]})}),Ke.jsx(hN,{style:{},onClick:()=>{M(!y)},children:Ke.jsxs("div",{children:[y?"✖ ":"","Rats Nest"]})}),Ke.jsx(hN,{onClick:()=>{a(!r)},children:Ke.jsxs("div",{children:[Ke.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",Ke.jsx("span",{style:{fontSize:"8px",transform:r?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),r&&Ke.jsxs("div",{style:{marginTop:4,minWidth:120},children:[Ke.jsx(oge,{label:"Show All Trace Lengths",checked:x,onClick:()=>{L(!x)}}),Ke.jsx(oge,{label:"Show Autorouting Animation",checked:E,onClick:()=>{V(!E)}}),Ke.jsx(oge,{label:"Show DRC Errors",checked:b,onClick:()=>{Y(!b)}})]})]})})]})]})},iAn=i=>{const{transform:e,elements:t}=i,[n,r]=rt.useMemo(()=>{const u=i.elements.flatMap(f=>hun(f,i.elements)),d=RS(i.elements);return[u,d]},[i.elements]),[a,o]=rt.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=rt.useMemo(()=>dun({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=rt.useCallback(u=>{var p,m;const d=[];for(const y of u)if(y._element){const x=r.getNetConnectedToId("pcb_port_id"in y._element?(p=y._element)==null?void 0:p.pcb_port_id:"pcb_trace_id"in y._element?(m=y._element)==null?void 0:m.pcb_trace_id:"");d.push(...r.getIdsConnectedToNet(x))}const f=new Set(u.map(y=>y._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:f,primitiveIdsInMousedOverNet:d})},[r]);return Ke.jsx(Wun,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:Ke.jsx(Uun,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:Ke.jsx(Gun,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:Ke.jsx(Nun,{transform:e,focusOnHover:i.focusOnHover,children:Ke.jsx(nAn,{elements:t,children:Ke.jsx(zun,{transform:e,elements:t,children:Ke.jsx($un,{transform:e,soup:t,children:Ke.jsx(Run,{transform:e,debugGraphics:i.debugGraphics,children:Ke.jsx(Dun,{transform:e,elements:t,children:Ke.jsx(Mun,{transform:e,primitives:s,width:i.width,height:i.height,grid:i.grid})})})})})})})})})})},rAn=Ad(mh(400,300),CE(40,-40)),aAn=({circuitJson:i,debugGraphics:e,height:t=600,initialState:n,allowEditing:r=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[u,d]=rt.useState(!l),[f,p]=rge(),[m,y]=rt.useState(rAn),{ref:x,setTransform:E,cancelDrag:b}=Aun({transform:m,onSetTransform:y,enabled:u});let[Q,M]=rt.useState([]);Q=a??Q;const L=rt.useRef(!1),V=rt.useRef(null),Y=`${(i==null?void 0:i.length)||0}_${(i==null?void 0:i.editCount)||0}`,q=()=>{const ce=(p==null?void 0:p.width)>0?p:{width:500,height:500},{center:le,width:Ee,height:ye}=$.some(Ie=>Ie.type.startsWith("pcb_"))?tun($.filter(Ie=>Ie.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},fe=Math.min((ce.width??0)/Ee,(ce.height??0)/ye,100)*.75,xe=Ad(mh((ce.width??0)/2,(ce.height??0)/2),CE(fe,-fe,0,0),mh(-le.x,-le.y));E(xe)};rt.useEffect(()=>{p!=null&&p.width&&i&&i.length!==0&&(L.current||(q(),L.current=!0))},[i,p]);const K=rt.useMemo(()=>(i==null?void 0:i.filter(ce=>ce.type.startsWith("pcb_")||ce.type.startsWith("source_")))??[],[Y]),$=rt.useMemo(()=>hon({circuitJson:K,editEvents:Q}),[K,Q]),j=ce=>{M([...Q,ce]),o==null||o([...Q,ce])},ue=ce=>{const le=Q.map(Ee=>Ee.edit_event_id===ce.edit_event_id?{...Ee,...ce}:Ee);M(le),o==null||o(le)};return Ke.jsxs("div",{ref:x,style:{position:"relative"},children:[Ke.jsx("div",{ref:f,children:Ke.jsxs(iun,{initialState:n,children:[Ke.jsx(iAn,{transform:m,height:t,width:p.width,allowEditing:r,focusOnHover:s,cancelPanDrag:b,onCreateEditEvent:j,onModifyEditEvent:ue,grid:{spacing:1,view_window:{left:0,right:p.width||500,top:t,bottom:0}},elements:$,debugGraphics:e},p.width),Ke.jsx(aun,{})]})}),l&&!u&&Ke.jsx("div",{onClick:()=>{d(!0),q()},onTouchStart:ce=>{const le=ce.touches[0];V.current={x:le.clientX,y:le.clientY}},onTouchEnd:ce=>{const le=ce.changedTouches[0],Ee=V.current;if(!Ee)return;const ye=Math.abs(le.clientX-Ee.x),fe=Math.abs(le.clientY-Ee.y);ye<10&&fe<10&&(ce.preventDefault(),d(!0),q()),V.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Ix.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:Ke.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const oAn=({containerClassName:i,...e})=>{const t=rt.useRef(null),[n,r]=rt.useState(620);return rt.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),Ke.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:Ke.jsx(aAn,{...e,height:n})})},sAn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',lAn=()=>{rt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=sAn,document.head.appendChild(e)},[])},cAn=i=>{rt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},_Ze=i=>`hsl(${eB.indexOf(i)*137.5%360}, 70%, 50%)`,uAn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return Ke.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ke.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:eB.map(t=>{const n=i[t]||0,r=n/e*100;return Ke.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:_Ze(t)},children:Ke.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),Ke.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},AAn=({renderLog:i})=>{const[e,t]=rt.useState("chronological");if(!i)return Ke.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>eB.indexOf(a[0])-eB.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const r=n.reduce((a,[o,s])=>a+s,0);return Ke.jsxs("div",{className:"rf-bg-white",children:[Ke.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ke.jsx("div",{children:"Render Logs"}),Ke.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ke.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ke.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ke.jsx("option",{value:"chronological",children:"Phase Order"}),Ke.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ke.jsx(uAn,{phaseTimings:i.phaseTimings}),Ke.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ke.jsx("thead",{children:Ke.jsxs("tr",{children:[Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ke.jsx("tbody",{children:n.map(([a,o])=>Ke.jsxs("tr",{children:[Ke.jsx("td",{className:"rf-p-2",children:eB.indexOf(a)}),Ke.jsx("td",{className:"rf-p-2",children:a}),Ke.jsx("td",{className:"rf-p-2",children:Ke.jsx("div",{className:"rf-w-8",children:Ke.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:_Ze(a),width:`${o/r*100}%`}})})}),Ke.jsx("td",{className:"rf-p-2",children:Ke.jsxs("div",{className:"rf-flex w-full",children:[Ke.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),Ke.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/r*100).toFixed(1),"%"]})]})})]},a))})]})]})},EZe=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{rt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{eF.captureException(n)}catch{}}},[i,e]),rt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{eF.captureException(r,{error_type:n.type})}catch{}}},[t])},dAn="0.0.655",sge=FBe()(OBe(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),fAn=["assembly","bom","circuit_json","errors","render_log"],hAn=({code:i,onRunClicked:e=void 0,errorMessage:t,errorStack:n,circuitJson:r,autoroutingGraphics:a,showRightHeaderContent:o=!0,showCodeTab:s=!1,codeTabContent:l,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:p,showImportAndFormatButtons:m=!0,className:y,headerClassName:x,leftHeaderContent:E,readOnly:b,isStreaming:Q,autoroutingLog:M,onReportAutoroutingLog:L,isRunningCode:V,hasCodeChangedSinceLastRun:Y,onEditEvent:q,editEvents:K,defaultActiveTab:$,autoRotate3dViewerDisabled:j,showSchematicDebugGrid:ue=!1,showToggleFullScreen:ce=!0,defaultToFullScreen:le=!1,activeEffectName:Ee})=>{var zt;lAn();const ye=sge(Rt=>Rt.lastRunEvalVersion),fe=rt.useMemo(()=>r?r.filter(Rt=>Rt&&"error_type"in Rt||Rt.type.includes("error")):null,[r]),xe=rt.useMemo(()=>r?r.filter(Rt=>Rt&&"warning_type"in Rt||Rt.type.includes("warning")):null,[r]);EZe({errorMessage:t,errorStack:n,circuitJsonErrors:fe});const[Ie,Te]=rt.useState($??"pcb"),[De,Le]=rt.useState(null),[Re,je]=rt.useState(le);cAn(Re);const et=rt.useCallback(Rt=>{Te(Rt),f==null||f(Rt)},[f]),lt=()=>{je(!Re)};rt.useEffect(()=>{t&&(Ie!=="errors"&&Le(Ie),et("errors"))},[t]),rt.useEffect(()=>{(Ie==="code"||Ie==="errors")&&r&&!t&&et(De??$??"pcb")},[r]);const mt=rt.useCallback(Rt=>{window.TSCIRCUIT_3D_OBJECT_REF=Rt===null?void 0:Rt},[]);return Ke.jsx("div",{className:jm("flex flex-col relative rf-overflow-x-hidden rf-h-full",y),children:Ke.jsx("div",{className:jm("rf-md:sticky rf-md:top-2 rf-h-full",Re&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:Ke.jsxs(hee,{value:Ie,onValueChange:et,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[Ke.jsxs("div",{className:jm("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",x),children:[E,E&&Ke.jsx("div",{className:"rf-flex-grow"}),!E&&V&&Ke.jsx(z2,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!E&&Ke.jsx("div",{className:"rf-flex-grow"}),p&&p.progress!==1&&!t&&Ke.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[Ee?Ke.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:Ee}):p.lastRenderEvent&&Ke.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:((zt=p.lastRenderEvent)==null?void 0:zt.phase)??""}),Ke.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:Ke.jsx(z2,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),Ke.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((p.progress??0)*100).toFixed(1),"%"]})]}),o&&Ke.jsxs(tF,{children:[s&&Ke.jsx(Sw,{value:"code",children:"Code"}),Ke.jsxs(Sw,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&Ke.jsx("span",{className:jm("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),Ke.jsxs(Sw,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&Ke.jsx("span",{className:jm("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),Ke.jsxs(Sw,{value:"cad",children:[r&&Ke.jsx("span",{className:jm("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(Ie)&&Ke.jsx(Sw,{value:Ie,children:PQe(Ie)}),Ke.jsxs(che,{children:[Ke.jsx(uhe,{asChild:!0,children:Ke.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[Ke.jsx(R$t,{className:"rf-w-4 rf-h-4"}),(fe&&fe.length>0||t)&&Ke.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),Ke.jsxs(MH,{className:"rf-*:text-xs",children:[fAn.map(Rt=>Ke.jsxs(GB,{onSelect:()=>et(Rt),children:[Ie!==Rt&&Ke.jsx(XHe,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Ie===Rt&&Ke.jsx(gfe,{className:"rf-w-3 rf-h-3"}),Ke.jsx("div",{className:"rf-pr-2",children:PQe(Rt)}),Rt==="errors"&&(fe&&fe.length>0||t)&&Ke.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:t?1:fe==null?void 0:fe.length})]},Rt)),Ke.jsx(GB,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ke.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",dAn.split(".").map((Rt,it)=>it===2?parseInt(Rt)+1:Rt).join(".")]})}),ye&&Ke.jsx(GB,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ke.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",ye]})})]})]})]}),ce&&Ke.jsx(tE,{onClick:lt,variant:"ghost",children:Re?Ke.jsx(U$t,{size:16}):Ke.jsx(N$t,{size:16})})]}),s&&Ke.jsx(rS,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:Ke.jsx("div",{className:"rf-h-full",children:l})}),Ke.jsx(rS,{value:"pcb",children:Ke.jsx("div",{className:jm("rf-overflow-hidden",Re?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(oAn,{focusOnHover:!1,circuitJson:r,debugGraphics:a,containerClassName:jm("rf-h-full rf-w-full",Re?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Rt=>{q&&Rt.forEach(it=>q(it))}}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"assembly",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallback:Ke.jsx("div",{children:"Error loading Assembly"}),children:r?Ke.jsx(san,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"schematic",children:Ke.jsx("div",{className:jm("rf-overflow-auto rf-bg-white",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(ran,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Rt=>{q==null||q(Rt)},debugGrid:ue}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"cad",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{FallbackComponent:v$t,children:r?Ke.jsx(m$t,{ref:mt,circuitJson:r,autoRotateDisabled:j}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"bom",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(dan,{circuitJson:r}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"circuit_json",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallback:Ke.jsx("div",{children:"Error loading JSON viewer"}),children:r?Ke.jsx(uan,{elements:r}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"errors",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:t||fe&&fe.length>0||r?Ke.jsx(Qin,{code:i,circuitJsonErrors:fe,circuitJsonWarnings:xe,errorMessage:t,errorStack:n,circuitJson:r,evalVersion:ye,autoroutingLog:M,onReportAutoroutingLog:L}):Ke.jsx(j2,{onRunClicked:e})})}),d&&Ke.jsx(rS,{value:"render_log",children:Ke.jsx(AAn,{renderLog:p})})]})})})};var QY="Dialog",[bZe,xZe]=QQ(QY),[pAn,JS]=bZe(QY),BZe=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:a,modal:o=!0}=i,s=rt.useRef(null),l=rt.useRef(null),[u,d]=f5({prop:n,defaultProp:r??!1,onChange:a,caller:QY});return Ke.jsx(pAn,{scope:e,triggerRef:s,contentRef:l,contentId:MQ(),titleId:MQ(),descriptionId:MQ(),open:u,onOpenChange:d,onOpenToggle:rt.useCallback(()=>d(f=>!f),[d]),modal:o,children:t})};BZe.displayName=QY;var SZe="DialogTrigger",wZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(SZe,t),a=W_(e,r.triggerRef);return Ke.jsx(e1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":uge(r.open),...n,ref:a,onClick:Pm(i.onClick,r.onOpenToggle)})});wZe.displayName=SZe;var lge="DialogPortal",[gAn,QZe]=bZe(lge,{forceMount:void 0}),MZe=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,a=JS(lge,e);return Ke.jsx(gAn,{scope:e,forceMount:t,children:rt.Children.map(n,o=>Ke.jsx(Cw,{present:t||a.open,children:Ke.jsx(jfe,{asChild:!0,container:r,children:o})}))})};MZe.displayName=lge;var MY="DialogOverlay",RZe=rt.forwardRef((i,e)=>{const t=QZe(MY,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,a=JS(MY,i.__scopeDialog);return a.modal?Ke.jsx(Cw,{present:n||a.open,children:Ke.jsx(yAn,{...r,ref:e})}):null});RZe.displayName=MY;var mAn=d5("DialogOverlay.RemoveScroll"),yAn=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(MY,t);return Ke.jsx($fe,{as:mAn,allowPinchZoom:!0,shards:[r.contentRef],children:Ke.jsx(e1.div,{"data-state":uge(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),nR="DialogContent",DZe=rt.forwardRef((i,e)=>{const t=QZe(nR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,a=JS(nR,i.__scopeDialog);return Ke.jsx(Cw,{present:n||a.open,children:a.modal?Ke.jsx(vAn,{...r,ref:e}):Ke.jsx(CAn,{...r,ref:e})})});DZe.displayName=nR;var vAn=rt.forwardRef((i,e)=>{const t=JS(nR,i.__scopeDialog),n=rt.useRef(null),r=W_(e,t.contentRef,n);return rt.useEffect(()=>{const a=n.current;if(a)return tVe(a)},[]),Ke.jsx(NZe,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pm(i.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pm(i.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:Pm(i.onFocusOutside,a=>a.preventDefault())})}),CAn=rt.forwardRef((i,e)=>{const t=JS(nR,i.__scopeDialog),n=rt.useRef(!1),r=rt.useRef(!1);return Ke.jsx(NZe,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=i.onCloseAutoFocus)==null||o.call(i,a),a.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=i.onInteractOutside)==null||l.call(i,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=a.target;((u=t.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),NZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...o}=i,s=JS(nR,t),l=rt.useRef(null),u=W_(e,l);return gYe(),Ke.jsxs(Ke.Fragment,{children:[Ke.jsx(Dfe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:Ke.jsx(wfe,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":uge(s.open),...o,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),Ke.jsxs(Ke.Fragment,{children:[Ke.jsx(_An,{titleId:s.titleId}),Ke.jsx(bAn,{contentRef:l,descriptionId:s.descriptionId})]})]})}),cge="DialogTitle",TZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(cge,t);return Ke.jsx(e1.h2,{id:r.titleId,...n,ref:e})});TZe.displayName=cge;var UZe="DialogDescription",PZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(UZe,t);return Ke.jsx(e1.p,{id:r.descriptionId,...n,ref:e})});PZe.displayName=UZe;var LZe="DialogClose",kZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(LZe,t);return Ke.jsx(e1.button,{type:"button",...n,ref:e,onClick:Pm(i.onClick,()=>r.onOpenChange(!1))})});kZe.displayName=LZe;function uge(i){return i?"open":"closed"}var GZe="DialogTitleWarning",[IAn,FZe]=jxt(GZe,{contentName:nR,titleName:cge,docsSlug:"dialog"}),_An=({titleId:i})=>{const e=FZe(GZe),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
13749
|
+
`,onClick:n=>{n.stopPropagation(),t()},children:[Ke.jsx("input",{type:"checkbox",checked:e}),Ke.jsx("span",{style:{color:"#eee"},children:i})]}),nAn=({children:i,elements:e})=>{const[t,n]=ME(K=>[K.is_mouse_over_container,K.setIsMouseOverContainer]),[r,a]=rt.useState(!1),[o,s]=rt.useState(!1),[l,u]=rt.useState(!1),[d,f]=ME(K=>[K.selected_layer,K.selectLayer]),[p,m,y,x,E,b]=ME(K=>[K.in_move_footprint_mode,K.in_draw_trace_mode,K.is_showing_rats_nest,K.is_showing_multiple_traces_length,K.is_showing_autorouting,K.is_showing_drc_errors]),Q=ME(K=>K.setEditMode),M=ME(K=>K.setIsShowingRatsNest),L=ME(K=>K.setIsShowingMultipleTracesLength),V=ME(K=>K.setIsShowingAutorouting),Y=ME(K=>K.setIsShowingDrcErrors);XM("1",()=>f("top")),XM("2",()=>f("bottom")),XM("3",()=>f("inner1")),XM("4",()=>f("inner2")),XM("5",()=>f("inner3")),XM("6",()=>f("inner4")),XM("7",()=>f("inner5")),XM("8",()=>f("inner6"));const q=(e==null?void 0:e.filter(K=>K.type.includes("error")).length)??0;return Ke.jsxs("div",{style:{position:"relative"},onMouseEnter:()=>{n(!0)},onMouseLeave:K=>{n(!1),s(!1)},children:[i,Ke.jsxs("div",{style:{position:"absolute",bottom:4,right:8,pointerEvents:"none",color:"white",fontSize:11,opacity:t?.5:0,transition:"opacity 1s",transitionDelay:"2s",fontFamily:"sans-serif"},children:["@tscircuit/pcb-viewer@",eAn.version]}),Ke.jsxs("div",{style:{position:"absolute",opacity:t?1:0,top:16,left:16,transition:t?"opacity 100ms linear":"opacity 1s linear",zIndex:Ix.toolbarOverlay,color:"red",display:"flex",fontSize:12,height:100,fontFamily:"sans-serif"},children:[Ke.jsxs(hN,{onClick:()=>{s(!o)},onMouseLeave:()=>{o&&s(!1)},children:[Ke.jsxs("div",{children:["layer:"," ",Ke.jsx("span",{style:{marginLeft:2,fontWeight:500,color:fN[d]},children:d})]}),o&&Ke.jsx("div",{style:{marginTop:4,minWidth:120},children:ege.map(K=>K.replace(/-/g,"")).map(K=>Ke.jsx(tAn,{name:K,selected:K===d,onClick:()=>{f(K.replace(/-/,""))}},K))})]}),Ke.jsxs(hN,{style:q>0?{color:"red"}:{},onClick:()=>u(!l),onMouseLeave:()=>u(!1),children:[Ke.jsxs("div",{children:[q," errors"]}),l&&Ke.jsx("div",{style:{display:"grid",gridTemplateColumns:"100px 300px"},children:e==null?void 0:e.filter(K=>K.type.includes("error")).map((K,$)=>Ke.jsxs(rt.Fragment,{children:[Ke.jsx("div",{children:K.error_type}),Ke.jsx("div",{children:K.message})]},$))})]}),Ke.jsx(hN,{style:{},onClick:()=>{Q(m?"off":"draw_trace")},children:Ke.jsxs("div",{children:[m?"✖ ":"","Edit Traces"]})}),Ke.jsx(hN,{style:{},onClick:()=>{Q(p?"off":"move_footprint")},children:Ke.jsxs("div",{children:[p?"✖ ":"","Move Components"]})}),Ke.jsx(hN,{style:{},onClick:()=>{M(!y)},children:Ke.jsxs("div",{children:[y?"✖ ":"","Rats Nest"]})}),Ke.jsx(hN,{onClick:()=>{a(!r)},children:Ke.jsxs("div",{children:[Ke.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:["View"," ",Ke.jsx("span",{style:{fontSize:"8px",transform:r?"rotate(180deg)":"rotate(0)",transition:"transform 0.1s ease",display:"inline-block"},children:"▼"})]}),r&&Ke.jsxs("div",{style:{marginTop:4,minWidth:120},children:[Ke.jsx(oge,{label:"Show All Trace Lengths",checked:x,onClick:()=>{L(!x)}}),Ke.jsx(oge,{label:"Show Autorouting Animation",checked:E,onClick:()=>{V(!E)}}),Ke.jsx(oge,{label:"Show DRC Errors",checked:b,onClick:()=>{Y(!b)}})]})]})})]})]})},iAn=i=>{const{transform:e,elements:t}=i,[n,r]=rt.useMemo(()=>{const u=i.elements.flatMap(f=>hun(f,i.elements)),d=RS(i.elements);return[u,d]},[i.elements]),[a,o]=rt.useState({drawingObjectIdsWithMouseOver:new Set,primitiveIdsInMousedOverNet:[]}),s=rt.useMemo(()=>dun({primitivesWithoutInteractionMetadata:n,drawingObjectIdsWithMouseOver:a.drawingObjectIdsWithMouseOver,primitiveIdsInMousedOverNet:a.primitiveIdsInMousedOverNet}),[n,a]),l=rt.useCallback(u=>{var p,m;const d=[];for(const y of u)if(y._element){const x=r.getNetConnectedToId("pcb_port_id"in y._element?(p=y._element)==null?void 0:p.pcb_port_id:"pcb_trace_id"in y._element?(m=y._element)==null?void 0:m.pcb_trace_id:"");d.push(...r.getIdsConnectedToNet(x))}const f=new Set(u.map(y=>y._pcb_drawing_object_id));o({drawingObjectIdsWithMouseOver:f,primitiveIdsInMousedOverNet:d})},[r]);return Ke.jsx(Wun,{elements:t,transform:e,primitives:n,onMouseHoverOverPrimitives:l,children:Ke.jsx(Uun,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:Ke.jsx(Gun,{disabled:!i.allowEditing,transform:e,soup:t,cancelPanDrag:i.cancelPanDrag,onCreateEditEvent:i.onCreateEditEvent,onModifyEditEvent:i.onModifyEditEvent,children:Ke.jsx(Nun,{transform:e,focusOnHover:i.focusOnHover,children:Ke.jsx(nAn,{elements:t,children:Ke.jsx(zun,{transform:e,elements:t,children:Ke.jsx($un,{transform:e,soup:t,children:Ke.jsx(Run,{transform:e,debugGraphics:i.debugGraphics,children:Ke.jsx(Dun,{transform:e,elements:t,children:Ke.jsx(Mun,{transform:e,primitives:s,width:i.width,height:i.height,grid:i.grid})})})})})})})})})})},rAn=Ad(mh(400,300),CE(40,-40)),aAn=({circuitJson:i,debugGraphics:e,height:t=600,initialState:n,allowEditing:r=!0,editEvents:a,onEditEventsChanged:o,focusOnHover:s=!1,clickToInteractEnabled:l=!1})=>{const[u,d]=rt.useState(!l),[f,p]=rge(),[m,y]=rt.useState(rAn),{ref:x,setTransform:E,cancelDrag:b}=Aun({transform:m,onSetTransform:y,enabled:u});let[Q,M]=rt.useState([]);Q=a??Q;const L=rt.useRef(!1),V=rt.useRef(null),Y=`${(i==null?void 0:i.length)||0}_${(i==null?void 0:i.editCount)||0}`,q=()=>{const ce=(p==null?void 0:p.width)>0?p:{width:500,height:500},{center:le,width:Ee,height:ye}=$.some(Ie=>Ie.type.startsWith("pcb_"))?tun($.filter(Ie=>Ie.type.startsWith("pcb_"))):{center:{x:0,y:0},width:.001,height:.001},fe=Math.min((ce.width??0)/Ee,(ce.height??0)/ye,100)*.75,xe=Ad(mh((ce.width??0)/2,(ce.height??0)/2),CE(fe,-fe,0,0),mh(-le.x,-le.y));E(xe)};rt.useEffect(()=>{p!=null&&p.width&&i&&i.length!==0&&(L.current||(q(),L.current=!0))},[i,p]);const K=rt.useMemo(()=>(i==null?void 0:i.filter(ce=>ce.type.startsWith("pcb_")||ce.type.startsWith("source_")))??[],[Y]),$=rt.useMemo(()=>hon({circuitJson:K,editEvents:Q}),[K,Q]),j=ce=>{M([...Q,ce]),o==null||o([...Q,ce])},ue=ce=>{const le=Q.map(Ee=>Ee.edit_event_id===ce.edit_event_id?{...Ee,...ce}:Ee);M(le),o==null||o(le)};return Ke.jsxs("div",{ref:x,style:{position:"relative"},children:[Ke.jsx("div",{ref:f,children:Ke.jsxs(iun,{initialState:n,children:[Ke.jsx(iAn,{transform:m,height:t,width:p.width,allowEditing:r,focusOnHover:s,cancelPanDrag:b,onCreateEditEvent:j,onModifyEditEvent:ue,grid:{spacing:1,view_window:{left:0,right:p.width||500,top:t,bottom:0}},elements:$,debugGraphics:e},p.width),Ke.jsx(aun,{})]})}),l&&!u&&Ke.jsx("div",{onClick:()=>{d(!0),q()},onTouchStart:ce=>{const le=ce.touches[0];V.current={x:le.clientX,y:le.clientY}},onTouchEnd:ce=>{const le=ce.changedTouches[0],Ee=V.current;if(!Ee)return;const ye=Math.abs(le.clientX-Ee.x),fe=Math.abs(le.clientY-Ee.y);ye<10&&fe<10&&(ce.preventDefault(),d(!0),q()),V.current=null},style:{position:"absolute",inset:0,cursor:"pointer",zIndex:Ix.clickToInteractOverlay,display:"flex",alignItems:"center",justifyContent:"center",touchAction:"pan-x pan-y pinch-zoom"},children:Ke.jsx("div",{style:{backgroundColor:"rgba(0, 0, 0, 0.8)",color:"white",padding:"12px 24px",borderRadius:"8px",fontSize:"16px",pointerEvents:"none"},children:typeof window<"u"&&("ontouchstart"in window||navigator.maxTouchPoints>0)?"Touch to Interact":"Click to Interact"})})]})};const oAn=({containerClassName:i,...e})=>{const t=rt.useRef(null),[n,r]=rt.useState(620);return rt.useLayoutEffect(()=>{const a=()=>{if(t.current){const s=t.current.clientHeight,l=window.innerHeight;r(Math.min(Math.max(s,620),l))}};a();const o=new ResizeObserver(a);return t.current&&o.observe(t.current),window.addEventListener("resize",a),()=>{o.disconnect(),window.removeEventListener("resize",a)}},[]),Ke.jsx("div",{ref:t,className:i||"rf-w-full rf-h-full",children:Ke.jsx(aAn,{...e,height:n})})},sAn='*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }/*! tailwindcss v3.4.17 | MIT License | https://tailwindcss.com*/*,:after,:before{border:0 solid #e5e7eb;box-sizing:border-box}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-tap-highlight-color:transparent}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-size:1em;font-variation-settings:normal}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-feature-settings:inherit;font-size:100%;font-variation-settings:inherit;font-weight:inherit;letter-spacing:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}[hidden]:where(:not([hidden=until-found])){display:none}:root{--radius:0.5rem}.rf-pointer-events-none{pointer-events:none}.rf-invisible{visibility:hidden}.rf-fixed{position:fixed}.rf-absolute{position:absolute}.rf-relative{position:relative}.rf-inset-0{inset:0}.-rf-left-2{left:-.5rem}.-rf-right-10{right:-2.5rem}.-rf-right-2{right:-.5rem}.-rf-right-4{right:-1rem}.-rf-right-6{right:-1.5rem}.-rf-right-7{right:-1.75rem}.-rf-right-8{right:-2rem}.-rf-right-9{right:-2.25rem}.rf-bottom-full{bottom:100%}.rf-left-0{left:0}.rf-left-1{left:.25rem}.rf-left-1\\/2{left:50%}.rf-left-2{left:.5rem}.rf-left-\\[50\\%\\]{left:50%}.rf-right-0{right:0}.rf-right-4{right:1rem}.rf-right-\\[4px\\]{right:4px}.rf-top-0{top:0}.rf-top-1{top:.25rem}.rf-top-2{top:.5rem}.rf-top-2\\.5{top:.625rem}.rf-top-\\[50\\%\\]{top:50%}.rf-top-\\[6px\\]{top:6px}.\\!rf-z-\\[101\\]{z-index:101!important}.rf-z-50{z-index:50}.rf-z-\\[100\\]{z-index:100}.-rf-mx-1,.rf--mx-1{margin-left:-.25rem;margin-right:-.25rem}.rf-mx-1{margin-left:.25rem;margin-right:.25rem}.rf-mx-2{margin-left:.5rem;margin-right:.5rem}.rf-mx-auto{margin-left:auto;margin-right:auto}.rf-my-1{margin-bottom:.25rem;margin-top:.25rem}.rf-my-12{margin-bottom:3rem;margin-top:3rem}.rf-my-4{margin-bottom:1rem;margin-top:1rem}.rf-my-auto{margin-bottom:auto;margin-top:auto}.rf-mb-1{margin-bottom:.25rem}.rf-mb-12{margin-bottom:3rem}.rf-mb-2{margin-bottom:.5rem}.rf-mb-3{margin-bottom:.75rem}.rf-mb-4{margin-bottom:1rem}.rf-mb-6{margin-bottom:1.5rem}.rf-mb-8{margin-bottom:2rem}.rf-ml-1{margin-left:.25rem}.rf-ml-2{margin-left:.5rem}.rf-ml-auto{margin-left:auto}.rf-mr-1{margin-right:.25rem}.rf-mr-2{margin-right:.5rem}.rf-mt-0{margin-top:0}.rf-mt-0\\.5{margin-top:.125rem}.rf-mt-1{margin-top:.25rem}.rf-mt-2{margin-top:.5rem}.rf-mt-3{margin-top:.75rem}.rf-mt-4{margin-top:1rem}.rf-mt-5{margin-top:1.25rem}.rf-mt-auto{margin-top:auto}.rf-block{display:block}.rf-inline{display:inline}.rf-flex{display:flex}.rf-inline-flex{display:inline-flex}.rf-grid{display:grid}.rf-hidden{display:none}.rf-aspect-square{aspect-ratio:1/1}.rf-aspect-video{aspect-ratio:16/9}.rf-size-14{height:3.5rem;width:3.5rem}.rf-size-4{height:1rem;width:1rem}.\\!rf-h-2{height:.5rem!important}.\\!rf-h-2\\.5{height:.625rem!important}.\\!rf-h-3{height:.75rem!important}.\\!rf-h-full{height:100%!important}.rf-h-1{height:.25rem}.rf-h-10{height:2.5rem}.rf-h-12{height:3rem}.rf-h-2{height:.5rem}.rf-h-2\\.5{height:.625rem}.rf-h-3{height:.75rem}.rf-h-3\\.5{height:.875rem}.rf-h-4{height:1rem}.rf-h-5{height:1.25rem}.rf-h-6{height:1.5rem}.rf-h-60{height:15rem}.rf-h-64{height:16rem}.rf-h-8{height:2rem}.rf-h-9{height:2.25rem}.rf-h-\\[400px\\]{height:400px}.rf-h-\\[calc\\(100vh-52px\\)\\]{height:calc(100vh - 52px)}.rf-h-\\[var\\(--radix-select-trigger-height\\)\\]{height:var(--radix-select-trigger-height)}.rf-h-fit{height:-moz-fit-content;height:fit-content}.rf-h-full{height:100%}.rf-h-px{height:1px}.rf-h-screen{height:100vh}.\\!rf-max-h-\\[40vh\\]{max-height:40vh!important}.rf-max-h-32{max-height:8rem}.rf-max-h-96{max-height:24rem}.rf-max-h-\\[500px\\]{max-height:500px}.rf-max-h-\\[90vh\\]{max-height:90vh}.rf-max-h-full{max-height:100%}.rf-min-h-0{min-height:0}.rf-min-h-\\[200px\\]{min-height:200px}.rf-min-h-\\[620px\\]{min-height:620px}.rf-min-h-\\[calc\\(100vh-240px\\)\\]{min-height:calc(100vh - 240px)}.\\!rf-w-2{width:.5rem!important}.\\!rf-w-2\\.5{width:.625rem!important}.rf-w-1{width:.25rem}.rf-w-1\\/2{width:50%}.rf-w-11{width:2.75rem}.rf-w-11\\/12{width:91.666667%}.rf-w-12{width:3rem}.rf-w-16{width:4rem}.rf-w-2{width:.5rem}.rf-w-2\\.5{width:.625rem}.rf-w-3{width:.75rem}.rf-w-3\\.5{width:.875rem}.rf-w-32{width:8rem}.rf-w-4{width:1rem}.rf-w-48{width:12rem}.rf-w-5{width:1.25rem}.rf-w-6{width:1.5rem}.rf-w-64{width:16rem}.rf-w-72{width:18rem}.rf-w-8{width:2rem}.rf-w-9{width:2.25rem}.rf-w-96{width:24rem}.rf-w-\\[95\\%\\]{width:95%}.rf-w-fit{width:-moz-fit-content;width:fit-content}.rf-w-full{width:100%}.rf-min-w-0{min-width:0}.rf-min-w-10{min-width:2.5rem}.rf-min-w-16{min-width:4rem}.rf-min-w-\\[148px\\]{min-width:148px}.rf-min-w-\\[8rem\\]{min-width:8rem}.rf-min-w-\\[var\\(--radix-select-trigger-width\\)\\]{min-width:var(--radix-select-trigger-width)}.\\!rf-max-w-\\[660px\\]{max-width:660px!important}.rf-max-w-2xl{max-width:42rem}.rf-max-w-3xl{max-width:48rem}.rf-max-w-4xl{max-width:56rem}.rf-max-w-5xl{max-width:64rem}.rf-max-w-full{max-width:100%}.rf-max-w-lg{max-width:32rem}.rf-max-w-md{max-width:28rem}.rf-max-w-none{max-width:none}.rf-max-w-xl{max-width:36rem}.rf-flex-1{flex:1 1 0%}.rf-flex-shrink-0,.rf-shrink-0{flex-shrink:0}.rf-flex-grow{flex-grow:1}.rf-table-auto{table-layout:auto}.-rf-translate-x-1{--tw-translate-x:-0.25rem}.-rf-translate-x-1,.-rf-translate-x-1\\/2{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rf-translate-x-1\\/2{--tw-translate-x:-50%}.-rf-translate-y-1{--tw-translate-y:-0.25rem}.-rf-translate-y-1,.rf--translate-x-1{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf--translate-x-1{--tw-translate-x:-0.25rem}.rf-translate-x-\\[-50\\%\\]{--tw-translate-x:-50%}.rf-translate-x-\\[-50\\%\\],.rf-translate-y-\\[-50\\%\\]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rf-translate-y-\\[-50\\%\\]{--tw-translate-y:-50%}.rf-transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes rf-pulse{50%{opacity:.5}}.rf-animate-pulse{animation:rf-pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes rf-spin{to{transform:rotate(1turn)}}.rf-animate-spin{animation:rf-spin 1s linear infinite}.rf-cursor-default{cursor:default}.rf-cursor-not-allowed{cursor:not-allowed}.rf-cursor-pointer{cursor:pointer}.rf-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.rf-grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.rf-flex-row{flex-direction:row}.rf-flex-col{flex-direction:column}.rf-flex-col-reverse{flex-direction:column-reverse}.rf-flex-wrap{flex-wrap:wrap}.rf-place-items-center{place-items:center}.rf-items-start{align-items:flex-start}.rf-items-end{align-items:flex-end}.rf-items-center{align-items:center}.rf-justify-end{justify-content:flex-end}.rf-justify-center{justify-content:center}.rf-justify-between{justify-content:space-between}.rf-gap-0{gap:0}.rf-gap-1{gap:.25rem}.rf-gap-2{gap:.5rem}.rf-gap-3{gap:.75rem}.rf-gap-4{gap:1rem}.rf-gap-5{gap:1.25rem}.rf-gap-6{gap:1.5rem}.rf-gap-8{gap:2rem}.rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.rf-space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.5rem*var(--tw-space-y-reverse));margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(.75rem*var(--tw-space-y-reverse));margin-top:calc(.75rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1rem*var(--tw-space-y-reverse));margin-top:calc(1rem*(1 - var(--tw-space-y-reverse)))}.rf-space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-bottom:calc(1.5rem*var(--tw-space-y-reverse));margin-top:calc(1.5rem*(1 - var(--tw-space-y-reverse)))}.rf-divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-bottom-width:calc(1px*var(--tw-divide-y-reverse));border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)))}.rf-overflow-auto{overflow:auto}.rf-overflow-hidden{overflow:hidden}.rf-overflow-visible{overflow:visible}.rf-overflow-x-auto{overflow-x:auto}.\\!rf-overflow-y-auto{overflow-y:auto!important}.rf-overflow-y-auto{overflow-y:auto}.rf-overflow-x-hidden{overflow-x:hidden}.rf-overflow-x-clip{overflow-x:clip}.rf-truncate{overflow:hidden;text-overflow:ellipsis}.rf-truncate,.rf-whitespace-nowrap{white-space:nowrap}.rf-whitespace-pre-wrap{white-space:pre-wrap}.rf-break-words{overflow-wrap:break-word}.rf-rounded{border-radius:.25rem}.rf-rounded-2xl{border-radius:1rem}.rf-rounded-full{border-radius:9999px}.rf-rounded-lg{border-radius:var(--radius)}.rf-rounded-md{border-radius:calc(var(--radius) - 2px)}.rf-rounded-sm{border-radius:calc(var(--radius) - 4px)}.rf-rounded-xl{border-radius:.75rem}.rf-border{border-width:1px}.rf-border-b{border-bottom-width:1px}.rf-border-t{border-top-width:1px}.rf-border-blue-200{--tw-border-opacity:1;border-color:rgb(191 219 254/var(--tw-border-opacity,1))}.rf-border-blue-500{--tw-border-opacity:1;border-color:rgb(59 130 246/var(--tw-border-opacity,1))}.rf-border-blue-600{--tw-border-opacity:1;border-color:rgb(37 99 235/var(--tw-border-opacity,1))}.rf-border-gray-200{--tw-border-opacity:1;border-color:rgb(229 231 235/var(--tw-border-opacity,1))}.rf-border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.rf-border-green-200{--tw-border-opacity:1;border-color:rgb(187 247 208/var(--tw-border-opacity,1))}.rf-border-input{border-color:hsl(var(--input))}.rf-border-neutral-200{--tw-border-opacity:1;border-color:rgb(229 229 229/var(--tw-border-opacity,1))}.rf-border-orange-200{--tw-border-opacity:1;border-color:rgb(254 215 170/var(--tw-border-opacity,1))}.rf-border-primary{border-color:hsl(var(--primary))}.rf-border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.rf-border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity,1))}.rf-border-zinc-200{--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity,1))}.rf-border-zinc-900{--tw-border-opacity:1;border-color:rgb(24 24 27/var(--tw-border-opacity,1))}.rf-bg-background{background-color:hsl(var(--background))}.rf-bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.rf-bg-black\\/80{background-color:rgba(0,0,0,.8)}.rf-bg-blue-100{--tw-bg-opacity:1;background-color:rgb(219 234 254/var(--tw-bg-opacity,1))}.rf-bg-blue-50{--tw-bg-opacity:1;background-color:rgb(239 246 255/var(--tw-bg-opacity,1))}.rf-bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.rf-bg-blue-600{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity,1))}.rf-bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.rf-bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity,1))}.rf-bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity,1))}.rf-bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.rf-bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.rf-bg-gray-500{--tw-bg-opacity:1;background-color:rgb(107 114 128/var(--tw-bg-opacity,1))}.rf-bg-gray-700{--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity,1))}.rf-bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.rf-bg-gray-900{--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity,1))}.rf-bg-green-100{--tw-bg-opacity:1;background-color:rgb(220 252 231/var(--tw-bg-opacity,1))}.rf-bg-green-50{--tw-bg-opacity:1;background-color:rgb(240 253 244/var(--tw-bg-opacity,1))}.rf-bg-muted{background-color:hsl(var(--muted))}.rf-bg-neutral-100{--tw-bg-opacity:1;background-color:rgb(245 245 245/var(--tw-bg-opacity,1))}.rf-bg-neutral-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-neutral-800{--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity,1))}.rf-bg-neutral-900{--tw-bg-opacity:1;background-color:rgb(23 23 23/var(--tw-bg-opacity,1))}.rf-bg-orange-400{--tw-bg-opacity:1;background-color:rgb(251 146 60/var(--tw-bg-opacity,1))}.rf-bg-orange-50{--tw-bg-opacity:1;background-color:rgb(255 247 237/var(--tw-bg-opacity,1))}.rf-bg-popover{background-color:hsl(var(--popover))}.rf-bg-red-100{--tw-bg-opacity:1;background-color:rgb(254 226 226/var(--tw-bg-opacity,1))}.rf-bg-red-50{--tw-bg-opacity:1;background-color:rgb(254 242 242/var(--tw-bg-opacity,1))}.rf-bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity,1))}.rf-bg-red-900{--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.rf-bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.rf-bg-yellow-100{--tw-bg-opacity:1;background-color:rgb(254 249 195/var(--tw-bg-opacity,1))}.rf-bg-zinc-100{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.rf-bg-zinc-200{--tw-bg-opacity:1;background-color:rgb(228 228 231/var(--tw-bg-opacity,1))}.rf-bg-zinc-50{--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.rf-bg-zinc-800{--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.rf-bg-zinc-900{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.rf-bg-opacity-50{--tw-bg-opacity:0.5}.rf-fill-current{fill:currentColor}.rf-object-contain{-o-object-fit:contain;object-fit:contain}.rf-object-cover{-o-object-fit:cover;object-fit:cover}.\\!rf-p-0{padding:0!important}.rf-p-0{padding:0}.rf-p-1{padding:.25rem}.rf-p-2{padding:.5rem}.rf-p-3{padding:.75rem}.rf-p-4{padding:1rem}.rf-p-5{padding:1.25rem}.rf-p-6{padding:1.5rem}.rf-p-8{padding:2rem}.rf-px-1{padding-left:.25rem;padding-right:.25rem}.rf-px-2{padding-left:.5rem;padding-right:.5rem}.rf-px-3{padding-left:.75rem;padding-right:.75rem}.rf-px-4{padding-left:1rem;padding-right:1rem}.rf-px-6{padding-left:1.5rem;padding-right:1.5rem}.rf-px-8{padding-left:2rem;padding-right:2rem}.rf-py-0{padding-bottom:0;padding-top:0}.rf-py-0\\.5{padding-bottom:.125rem;padding-top:.125rem}.rf-py-1{padding-bottom:.25rem;padding-top:.25rem}.rf-py-1\\.5{padding-bottom:.375rem;padding-top:.375rem}.rf-py-10{padding-bottom:2.5rem;padding-top:2.5rem}.rf-py-12{padding-bottom:3rem;padding-top:3rem}.rf-py-2{padding-bottom:.5rem;padding-top:.5rem}.rf-py-3{padding-bottom:.75rem;padding-top:.75rem}.rf-py-4{padding-bottom:1rem;padding-top:1rem}.rf-py-8{padding-bottom:2rem;padding-top:2rem}.rf-pb-0{padding-bottom:0}.rf-pb-2{padding-bottom:.5rem}.rf-pb-3{padding-bottom:.75rem}.rf-pb-4{padding-bottom:1rem}.rf-pl-2{padding-left:.5rem}.rf-pl-4{padding-left:1rem}.rf-pl-8{padding-left:2rem}.rf-pr-2{padding-right:.5rem}.rf-pt-2{padding-top:.5rem}.rf-pt-4{padding-top:1rem}.rf-text-left{text-align:left}.rf-text-center{text-align:center}.rf-text-right{text-align:right}.rf-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.rf-text-2xl{font-size:1.5rem;line-height:2rem}.rf-text-3xl{font-size:1.875rem;line-height:2.25rem}.rf-text-\\[8px\\]{font-size:8px}.rf-text-base{font-size:1rem;line-height:1.5rem}.rf-text-lg{font-size:1.125rem;line-height:1.75rem}.rf-text-sm{font-size:.875rem;line-height:1.25rem}.rf-text-xl{font-size:1.25rem;line-height:1.75rem}.rf-text-xs{font-size:.75rem;line-height:1rem}.rf-font-bold{font-weight:700}.rf-font-medium{font-weight:500}.rf-font-semibold{font-weight:600}.rf-uppercase{text-transform:uppercase}.rf-capitalize{text-transform:capitalize}.rf-tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.rf-leading-5{line-height:1.25rem}.rf-leading-none{line-height:1}.rf-leading-relaxed{line-height:1.625}.rf-leading-tight{line-height:1.25}.rf-tracking-wide{letter-spacing:.025em}.rf-tracking-widest{letter-spacing:.1em}.rf-text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.rf-text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.rf-text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity,1))}.rf-text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity,1))}.rf-text-blue-800{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity,1))}.rf-text-blue-900{--tw-text-opacity:1;color:rgb(30 58 138/var(--tw-text-opacity,1))}.rf-text-current{color:currentColor}.rf-text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.rf-text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.rf-text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.rf-text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity,1))}.rf-text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.rf-text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.rf-text-green-500{--tw-text-opacity:1;color:rgb(34 197 94/var(--tw-text-opacity,1))}.rf-text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity,1))}.rf-text-green-700{--tw-text-opacity:1;color:rgb(21 128 61/var(--tw-text-opacity,1))}.rf-text-green-800{--tw-text-opacity:1;color:rgb(22 101 52/var(--tw-text-opacity,1))}.rf-text-green-900{--tw-text-opacity:1;color:rgb(20 83 45/var(--tw-text-opacity,1))}.rf-text-muted-foreground{color:hsl(var(--muted-foreground))}.rf-text-neutral-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-neutral-500{--tw-text-opacity:1;color:rgb(115 115 115/var(--tw-text-opacity,1))}.rf-text-neutral-900{--tw-text-opacity:1;color:rgb(23 23 23/var(--tw-text-opacity,1))}.rf-text-neutral-950{--tw-text-opacity:1;color:rgb(10 10 10/var(--tw-text-opacity,1))}.rf-text-orange-500{--tw-text-opacity:1;color:rgb(249 115 22/var(--tw-text-opacity,1))}.rf-text-orange-600{--tw-text-opacity:1;color:rgb(234 88 12/var(--tw-text-opacity,1))}.rf-text-orange-800{--tw-text-opacity:1;color:rgb(154 52 18/var(--tw-text-opacity,1))}.rf-text-popover-foreground{color:hsl(var(--popover-foreground))}.rf-text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.rf-text-red-300{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.rf-text-red-400{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.rf-text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity,1))}.rf-text-red-600{--tw-text-opacity:1;color:rgb(220 38 38/var(--tw-text-opacity,1))}.rf-text-red-700{--tw-text-opacity:1;color:rgb(185 28 28/var(--tw-text-opacity,1))}.rf-text-red-800{--tw-text-opacity:1;color:rgb(153 27 27/var(--tw-text-opacity,1))}.rf-text-red-900{--tw-text-opacity:1;color:rgb(127 29 29/var(--tw-text-opacity,1))}.rf-text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.rf-text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.rf-text-yellow-500{--tw-text-opacity:1;color:rgb(234 179 8/var(--tw-text-opacity,1))}.rf-text-yellow-900{--tw-text-opacity:1;color:rgb(113 63 18/var(--tw-text-opacity,1))}.rf-text-zinc-200{--tw-text-opacity:1;color:rgb(228 228 231/var(--tw-text-opacity,1))}.rf-text-zinc-300{--tw-text-opacity:1;color:rgb(212 212 216/var(--tw-text-opacity,1))}.rf-text-zinc-400{--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.rf-text-zinc-50{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.rf-text-zinc-500{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.rf-text-zinc-900{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.rf-text-zinc-950{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.rf-underline{text-decoration-line:underline}.rf-line-through{text-decoration-line:line-through}.rf-underline-offset-4{text-underline-offset:4px}.rf-opacity-0{opacity:0}.rf-opacity-25{opacity:.25}.rf-opacity-30{opacity:.3}.rf-opacity-50{opacity:.5}.rf-opacity-60{opacity:.6}.rf-opacity-75{opacity:.75}.rf-shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.rf-shadow,.rf-shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.rf-shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.rf-shadow-md,.rf-shadow-sm{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.rf-shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color)}.rf-outline-none{outline:2px solid transparent;outline-offset:2px}.rf-ring-2{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.rf-ring-blue-500{--tw-ring-opacity:1;--tw-ring-color:rgb(59 130 246/var(--tw-ring-opacity,1))}.rf-ring-primary{--tw-ring-color:hsl(var(--primary))}.rf-ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.rf-ring-offset-white{--tw-ring-offset-color:#fff}.rf-transition{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-transition-opacity{transition-duration:.15s;transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1)}.rf-duration-200{transition-duration:.2s}.rf-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.rf-slide-in-from-left-1{--tw-enter-translate-x:-0.25rem}.rf-slide-out-to-left-1{--tw-exit-translate-x:-0.25rem}.rf-duration-200{animation-duration:.2s}.rf-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.file\\:rf-border-0::file-selector-button{border-width:0}.file\\:rf-bg-transparent::file-selector-button{background-color:transparent}.file\\:rf-text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\\:rf-font-medium::file-selector-button{font-weight:500}.placeholder\\:rf-text-zinc-500::-moz-placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.placeholder\\:rf-text-zinc-500::placeholder{--tw-text-opacity:1;color:rgb(113 113 122/var(--tw-text-opacity,1))}.hover\\:rf-border-blue-300:hover{--tw-border-opacity:1;border-color:rgb(147 197 253/var(--tw-border-opacity,1))}.hover\\:\\!rf-bg-transparent:hover{background-color:transparent!important}.hover\\:rf-bg-blue-700:hover{--tw-bg-opacity:1;background-color:rgb(29 78 216/var(--tw-bg-opacity,1))}.hover\\:rf-bg-red-500\\/90:hover{background-color:rgba(239,68,68,.9)}.hover\\:rf-bg-zinc-100:hover{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.hover\\:rf-bg-zinc-100\\/80:hover{background-color:hsla(240,5%,96%,.8)}.hover\\:rf-bg-zinc-900\\/90:hover{background-color:rgba(24,24,27,.9)}.hover\\:rf-text-red-400:hover{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.hover\\:rf-text-zinc-900:hover{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.hover\\:rf-underline:hover{text-decoration-line:underline}.focus\\:rf-bg-gray-100:focus{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.focus\\:rf-bg-zinc-100:focus{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.focus\\:rf-text-gray-900:focus{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity,1))}.focus\\:rf-text-zinc-900:focus{--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.focus\\:rf-outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:rf-ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\\:rf-ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\\:rf-ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\\:rf-outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\\:rf-ring-1:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\\:rf-ring-zinc-950:focus-visible{--tw-ring-opacity:1;--tw-ring-color:rgb(9 9 11/var(--tw-ring-opacity,1))}.focus-visible\\:rf-ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.disabled\\:rf-pointer-events-none:disabled{pointer-events:none}.disabled\\:rf-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:rf-opacity-50:disabled{opacity:.5}.rf-group\\/bar:hover .group-hover\\/bar\\:rf-opacity-100{opacity:1}.data-\\[disabled\\]\\:rf-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\\[side\\=bottom\\]\\:rf-translate-y-1[data-side=bottom],.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=left\\]\\:-rf-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\\[side\\=right\\]\\:rf-translate-x-1[data-side=right],.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\\[side\\=top\\]\\:-rf-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\\[state\\=active\\]\\:rf-bg-white[data-state=active]{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.data-\\[state\\=checked\\]\\:rf-bg-zinc-900[data-state=checked]{--tw-bg-opacity:1;background-color:rgb(24 24 27/var(--tw-bg-opacity,1))}.data-\\[state\\=open\\]\\:rf-bg-zinc-100[data-state=open]{--tw-bg-opacity:1;background-color:rgb(244 244 245/var(--tw-bg-opacity,1))}.data-\\[state\\=active\\]\\:rf-text-zinc-950[data-state=active]{--tw-text-opacity:1;color:rgb(9 9 11/var(--tw-text-opacity,1))}.data-\\[state\\=checked\\]\\:rf-text-zinc-50[data-state=checked]{--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.data-\\[disabled\\]\\:rf-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=active\\]\\:rf-shadow[data-state=active]{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.data-\\[state\\=open\\]\\:rf-animate-in[data-state=open]{animation-duration:.15s;animation-name:enter;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-animate-out[data-state=closed]{animation-duration:.15s;animation-name:exit;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\\[state\\=closed\\]\\:rf-fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\\[state\\=open\\]\\:rf-fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:rf-zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\\[state\\=open\\]\\:rf-zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:rf-slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\\[side\\=left\\]\\:rf-slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\\[side\\=right\\]\\:rf-slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\\[side\\=top\\]\\:rf-slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}.data-\\[state\\=closed\\]\\:rf-slide-out-to-left-1\\/2[data-state=closed]{--tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:rf-slide-out-to-top-\\[48\\%\\][data-state=closed]{--tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:rf-slide-in-from-left-1\\/2[data-state=open]{--tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:rf-slide-in-from-top-\\[48\\%\\][data-state=open]{--tw-enter-translate-y:-48%}.dark\\:rf-border-zinc-50:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(250 250 250/var(--tw-border-opacity,1))}.dark\\:rf-border-zinc-800:is(.rf-dark *){--tw-border-opacity:1;border-color:rgb(39 39 42/var(--tw-border-opacity,1))}.dark\\:rf-bg-red-900:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(127 29 29/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-50:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-800:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:rf-bg-zinc-950:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:rf-text-zinc-400:is(.rf-dark *){--tw-text-opacity:1;color:rgb(161 161 170/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-50:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:rf-text-zinc-900:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-placeholder-zinc-400:is(.rf-dark *)::placeholder{--tw-placeholder-opacity:1;color:rgb(161 161 170/var(--tw-placeholder-opacity,1))}.dark\\:rf-ring-offset-zinc-950:is(.rf-dark *){--tw-ring-offset-color:#09090b}.dark\\:hover\\:rf-bg-red-900\\/90:hover:is(.rf-dark *){background-color:rgba(127,29,29,.9)}.dark\\:hover\\:rf-bg-zinc-50\\/90:hover:is(.rf-dark *){background-color:hsla(0,0%,98%,.9)}.dark\\:hover\\:rf-bg-zinc-800:hover:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:hover\\:rf-bg-zinc-800\\/80:hover:is(.rf-dark *){background-color:rgba(39,39,42,.8)}.dark\\:hover\\:rf-text-zinc-50:hover:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus\\:rf-bg-zinc-800:focus:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:focus\\:rf-text-zinc-50:focus:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:focus-visible\\:rf-ring-zinc-300:focus-visible:is(.rf-dark *){--tw-ring-opacity:1;--tw-ring-color:rgb(212 212 216/var(--tw-ring-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-bg-zinc-950[data-state=active]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(9 9 11/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-bg-zinc-50[data-state=checked]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=open\\]\\:rf-bg-zinc-800[data-state=open]:is(.rf-dark *){--tw-bg-opacity:1;background-color:rgb(39 39 42/var(--tw-bg-opacity,1))}.dark\\:data-\\[state\\=active\\]\\:rf-text-zinc-50[data-state=active]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(250 250 250/var(--tw-text-opacity,1))}.dark\\:data-\\[state\\=checked\\]\\:rf-text-zinc-900[data-state=checked]:is(.rf-dark *){--tw-text-opacity:1;color:rgb(24 24 27/var(--tw-text-opacity,1))}@media (min-width:640px){.sm\\:rf-mt-0{margin-top:0}.sm\\:rf-flex-row{flex-direction:row}.sm\\:rf-justify-end{justify-content:flex-end}.sm\\:rf-space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-left:calc(.5rem*(1 - var(--tw-space-x-reverse)));margin-right:calc(.5rem*var(--tw-space-x-reverse))}.sm\\:rf-rounded-lg{border-radius:var(--radius)}.sm\\:rf-text-left{text-align:left}}@media (min-width:768px){.md\\:rf-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.\\[\\&\\>span\\]\\:rf-line-clamp-1>span{display:-webkit-box;overflow:hidden;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\\[\\&\\>svg\\]\\:rf-size-4>svg{height:1rem;width:1rem}.\\[\\&\\>svg\\]\\:rf-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:rf-text-red-300>svg{--tw-text-opacity:1;color:rgb(252 165 165/var(--tw-text-opacity,1))}.\\[\\&\\>svg\\]\\:hover\\:rf-text-red-400:hover>svg{--tw-text-opacity:1;color:rgb(248 113 113/var(--tw-text-opacity,1))}.\\[\\&_svg\\]\\:rf-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:rf-size-4 svg{height:1rem;width:1rem}.\\[\\&_svg\\]\\:rf-shrink-0 svg{flex-shrink:0}',lAn=()=>{rt.useEffect(()=>{if(document.querySelector('style[data-styles="tscircuit-runframe"]'))return;const e=document.createElement("style");e.setAttribute("data-styles","tscircuit-runframe"),e.textContent=sAn,document.head.appendChild(e)},[])},cAn=i=>{rt.useEffect(()=>(i?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[i])},_Ze=i=>`hsl(${eB.indexOf(i)*137.5%360}, 70%, 50%)`,uAn=({phaseTimings:i})=>{if(!i)return null;const e=Object.values(i).reduce((t,n)=>t+n,0);return Ke.jsxs("div",{className:"rf-space-y-2 rf-w-full rf-px-4",children:[Ke.jsx("div",{className:"rf-relative rf-h-8 rf-flex rf-rounded-sm",children:eB.map(t=>{const n=i[t]||0,r=n/e*100;return Ke.jsx("div",{className:"rf-group/bar rf-relative rf-overflow-visible",style:{width:`${r}%`,backgroundColor:_Ze(t)},children:Ke.jsxs("div",{className:"rf-opacity-0 group-hover/bar:rf-opacity-100 rf-transition-opacity rf-absolute rf-bottom-full rf-left-1/2 rf-transform -rf-translate-x-1/2 rf-mb-2 rf-px-2 rf-py-1 rf-text-xs rf-whitespace-nowrap rf-rounded rf-bg-gray-900 rf-text-white rf-pointer-events-none",children:[t,": ",n.toFixed(1),"ms"]})},t)})}),Ke.jsxs("div",{className:"rf-text-xs rf-text-gray-500",children:["Total: ",e.toFixed(2),"ms"]})]})},AAn=({renderLog:i})=>{const[e,t]=rt.useState("chronological");if(!i)return Ke.jsx("div",{className:"rf-p-4 rf-bg-gray-100 rf-rounded-md",children:"No render log, make sure this tab is open when you render (TODO add a rerender button here)"});const n=Object.entries((i==null?void 0:i.phaseTimings)??{});e==="chronological"?n.sort((a,o)=>eB.indexOf(a[0])-eB.indexOf(o[0])):n.sort((a,o)=>o[1]-a[1]);const r=n.reduce((a,[o,s])=>a+s,0);return Ke.jsxs("div",{className:"rf-bg-white",children:[Ke.jsxs("div",{className:"rf-flex rf-justify-between rf-items-center",children:[Ke.jsx("div",{children:"Render Logs"}),Ke.jsxs("div",{className:"rf-mb-4 rf-pr-2 rf-flex rf-text-xs rf-items-center",children:[Ke.jsx("div",{className:"rf-mr-2",children:"Sort by:"}),Ke.jsxs("select",{value:e,onChange:a=>t(a.target.value),className:"rf-px-2 rf-py-1 rf-border rf-rounded rf-text-xs",children:[Ke.jsx("option",{value:"chronological",children:"Phase Order"}),Ke.jsx("option",{value:"longest",children:"Duration"})]})]})]}),Ke.jsx(uAn,{phaseTimings:i.phaseTimings}),Ke.jsxs("table",{className:"rf-w-full rf-text-xs",children:[Ke.jsx("thead",{children:Ke.jsxs("tr",{children:[Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase Order"}),Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Phase"}),Ke.jsx("th",{className:"rf-text-left rf-p-2",children:"Duration (ms)"})]})}),Ke.jsx("tbody",{children:n.map(([a,o])=>Ke.jsxs("tr",{children:[Ke.jsx("td",{className:"rf-p-2",children:eB.indexOf(a)}),Ke.jsx("td",{className:"rf-p-2",children:a}),Ke.jsx("td",{className:"rf-p-2",children:Ke.jsx("div",{className:"rf-w-8",children:Ke.jsx("div",{className:"rf-h-2 rf-rounded-sm",style:{backgroundColor:_Ze(a),width:`${o/r*100}%`}})})}),Ke.jsx("td",{className:"rf-p-2",children:Ke.jsxs("div",{className:"rf-flex w-full",children:[Ke.jsxs("span",{className:"rf-flex-grow",children:[o,"ms"]}),Ke.jsxs("span",{className:"rf-text-gray-500 rf-pr-2",children:[(o/r*100).toFixed(1),"%"]})]})})]},a))})]})]})},EZe=({errorMessage:i,errorStack:e,circuitJsonErrors:t})=>{rt.useEffect(()=>{if(i){const n=new Error(i);e&&(n.stack=e);try{eF.captureException(n)}catch{}}},[i,e]),rt.useEffect(()=>{if(t&&t.length>0)for(const n of t){const r=new Error(n.message||"Circuit JSON Error");n.stack&&(r.stack=n.stack);try{eF.captureException(r,{error_type:n.type})}catch{}}},[t])},dAn="0.0.657",sge=FBe()(OBe(i=>({lastRunEvalVersion:void 0,setLastRunEvalVersion:e=>{i({lastRunEvalVersion:e})}}),{name:"runframe-runner-store"})),fAn=["assembly","bom","circuit_json","errors","render_log"],hAn=({code:i,onRunClicked:e=void 0,errorMessage:t,errorStack:n,circuitJson:r,autoroutingGraphics:a,showRightHeaderContent:o=!0,showCodeTab:s=!1,codeTabContent:l,showJsonTab:u=!0,showRenderLogTab:d=!0,onActiveTabChange:f,renderLog:p,showImportAndFormatButtons:m=!0,className:y,headerClassName:x,leftHeaderContent:E,readOnly:b,isStreaming:Q,autoroutingLog:M,onReportAutoroutingLog:L,isRunningCode:V,hasCodeChangedSinceLastRun:Y,onEditEvent:q,editEvents:K,defaultActiveTab:$,autoRotate3dViewerDisabled:j,showSchematicDebugGrid:ue=!1,showToggleFullScreen:ce=!0,defaultToFullScreen:le=!1,activeEffectName:Ee})=>{var zt;lAn();const ye=sge(Rt=>Rt.lastRunEvalVersion),fe=rt.useMemo(()=>r?r.filter(Rt=>Rt&&"error_type"in Rt||Rt.type.includes("error")):null,[r]),xe=rt.useMemo(()=>r?r.filter(Rt=>Rt&&"warning_type"in Rt||Rt.type.includes("warning")):null,[r]);EZe({errorMessage:t,errorStack:n,circuitJsonErrors:fe});const[Ie,Te]=rt.useState($??"pcb"),[De,Le]=rt.useState(null),[Re,je]=rt.useState(le);cAn(Re);const et=rt.useCallback(Rt=>{Te(Rt),f==null||f(Rt)},[f]),lt=()=>{je(!Re)};rt.useEffect(()=>{t&&(Ie!=="errors"&&Le(Ie),et("errors"))},[t]),rt.useEffect(()=>{(Ie==="code"||Ie==="errors")&&r&&!t&&et(De??$??"pcb")},[r]);const mt=rt.useCallback(Rt=>{window.TSCIRCUIT_3D_OBJECT_REF=Rt===null?void 0:Rt},[]);return Ke.jsx("div",{className:jm("flex flex-col relative rf-overflow-x-hidden rf-h-full",y),children:Ke.jsx("div",{className:jm("rf-md:sticky rf-md:top-2 rf-h-full",Re&&"rf-fixed rf-top-0 rf-left-0 rf-w-full rf-h-full rf-bg-white rf-overflow-hidden"),children:Ke.jsxs(hee,{value:Ie,onValueChange:et,className:"rf-flex-grow rf-flex rf-flex-col rf-h-full",children:[Ke.jsxs("div",{className:jm("rf-flex rf-items-center rf-gap-2 rf-p-2 rf-pb-0",x),children:[E,E&&Ke.jsx("div",{className:"rf-flex-grow"}),!E&&V&&Ke.jsx(z2,{className:"rf-w-4 rf-h-4 rf-animate-spin"}),!E&&Ke.jsx("div",{className:"rf-flex-grow"}),p&&p.progress!==1&&!t&&Ke.jsxs("div",{className:"rf-flex rf-items-center rf-gap-2",children:[Ee?Ke.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:Ee}):p.lastRenderEvent&&Ke.jsx("div",{className:"rf-text-xs rf-text-gray-500",children:((zt=p.lastRenderEvent)==null?void 0:zt.phase)??""}),Ke.jsx("div",{className:"rf-w-4 rf-h-4 rf-bg-blue-500 rf-opacity-50 rf-rounded-full rf-text-white",children:Ke.jsx(z2,{className:"rf-w-4 rf-h-4 rf-animate-spin"})}),Ke.jsxs("div",{className:"rf-text-xs rf-font-bold rf-text-gray-700 rf-tabular-nums",children:[((p.progress??0)*100).toFixed(1),"%"]})]}),o&&Ke.jsxs(tF,{children:[s&&Ke.jsx(Sw,{value:"code",children:"Code"}),Ke.jsxs(Sw,{value:"pcb",className:"rf-whitespace-nowrap",children:[r&&Ke.jsx("span",{className:jm("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"PCB"]}),Ke.jsxs(Sw,{value:"schematic",className:"rf-whitespace-nowrap",children:[r&&Ke.jsx("span",{className:jm("rf-inline-flex rf-items-center rf-justify-center rf-w-2 rf-h-2 rf-mr-1 rf-text-xs rf-font-bold rf-text-white rf-rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"Schematic"]}),Ke.jsxs(Sw,{value:"cad",children:[r&&Ke.jsx("span",{className:jm("inline-flex items-center justify-center w-2 h-2 mr-1 text-xs font-bold text-white rounded-full",Y?"rf-bg-gray-500":"rf-bg-blue-500")}),"3D"]}),!["pcb","cad","schematic"].includes(Ie)&&Ke.jsx(Sw,{value:Ie,children:PQe(Ie)}),Ke.jsxs(che,{children:[Ke.jsx(uhe,{asChild:!0,children:Ke.jsxs("div",{className:"rf-whitespace-nowrap rf-p-2 rf-mr-1 rf-cursor-pointer rf-relative",children:[Ke.jsx(R$t,{className:"rf-w-4 rf-h-4"}),(fe&&fe.length>0||t)&&Ke.jsx("span",{className:"rf-inline-flex rf-absolute rf-top-[6px] rf-right-[4px] rf-items-center rf-justify-center rf-w-1 rf-h-1 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full"})]})}),Ke.jsxs(MH,{className:"rf-*:text-xs",children:[fAn.map(Rt=>Ke.jsxs(GB,{onSelect:()=>et(Rt),children:[Ie!==Rt&&Ke.jsx(XHe,{className:"rf-w-3 rf-h-3 rf-opacity-30"}),Ie===Rt&&Ke.jsx(gfe,{className:"rf-w-3 rf-h-3"}),Ke.jsx("div",{className:"rf-pr-2",children:PQe(Rt)}),Rt==="errors"&&(fe&&fe.length>0||t)&&Ke.jsx("span",{className:"rf-inline-flex rf-items-center rf-justify-center rf-w-3 rf-h-3 rf-ml-2 rf-text-[8px] rf-font-bold rf-text-white rf-bg-red-500 rf-rounded-full",children:t?1:fe==null?void 0:fe.length})]},Rt)),Ke.jsx(GB,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ke.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/runframe@",dAn.split(".").map((Rt,it)=>it===2?parseInt(Rt)+1:Rt).join(".")]})}),ye&&Ke.jsx(GB,{disabled:!0,className:"rf-opacity-60 rf-cursor-default rf-select-none",children:Ke.jsxs("div",{className:"rf-pr-2 rf-text-xs rf-text-gray-500",children:["@tscircuit/eval@",ye]})})]})]})]}),ce&&Ke.jsx(tE,{onClick:lt,variant:"ghost",children:Re?Ke.jsx(U$t,{size:16}):Ke.jsx(N$t,{size:16})})]}),s&&Ke.jsx(rS,{value:"code",className:"rf-flex-grow rf-overflow-hidden",children:Ke.jsx("div",{className:"rf-h-full",children:l})}),Ke.jsx(rS,{value:"pcb",children:Ke.jsx("div",{className:jm("rf-overflow-hidden",Re?"rf-h-[calc(100vh-52px)]":"rf-h-full"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading PCB viewer"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(oAn,{focusOnHover:!1,circuitJson:r,debugGraphics:a,containerClassName:jm("rf-h-full rf-w-full",Re?"rf-min-h-[calc(100vh-240px)]":"rf-min-h-[620px]"),onEditEventsChanged:Rt=>{q&&Rt.forEach(it=>q(it))}}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"assembly",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallback:Ke.jsx("div",{children:"Error loading Assembly"}),children:r?Ke.jsx(san,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,debugGrid:!0}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"schematic",children:Ke.jsx("div",{className:jm("rf-overflow-auto rf-bg-white",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Schematic"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(ran,{circuitJson:r,containerStyle:{height:"100%"},editingEnabled:!0,onEditEvent:Rt=>{q==null||q(Rt)},debugGrid:ue}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"cad",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{FallbackComponent:v$t,children:r?Ke.jsx(m$t,{ref:mt,circuitJson:r,autoRotateDisabled:j}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"bom",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallbackRender:({error:Rt})=>Ke.jsx("div",{className:"rf-mt-4 rf-bg-red-50 rf-rounded-md rf-border rf-border-red-200",children:Ke.jsxs("div",{className:"rf-p-4",children:[Ke.jsx("h3",{className:"rf-text-lg rf-font-semibold rf-text-red-800 rf-mb-3",children:"Error loading Bill of Materials"}),Ke.jsx("p",{className:"rf-text-xs rf-font-mono rf-whitespace-pre-wrap rf-text-red-600 rf-mt-2",children:(Rt==null?void 0:Rt.message)||"An unknown error occurred"})]})}),children:r?Ke.jsx(dan,{circuitJson:r}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"circuit_json",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:Ke.jsx(YD,{fallback:Ke.jsx("div",{children:"Error loading JSON viewer"}),children:r?Ke.jsx(uan,{elements:r}):Ke.jsx(j2,{onRunClicked:e})})})}),Ke.jsx(rS,{value:"errors",children:Ke.jsx("div",{className:jm("rf-overflow-auto",Re?"rf-h-screen":"rf-h-full rf-min-h-[620px]"),children:t||fe&&fe.length>0||r?Ke.jsx(Qin,{code:i,circuitJsonErrors:fe,circuitJsonWarnings:xe,errorMessage:t,errorStack:n,circuitJson:r,evalVersion:ye,autoroutingLog:M,onReportAutoroutingLog:L}):Ke.jsx(j2,{onRunClicked:e})})}),d&&Ke.jsx(rS,{value:"render_log",children:Ke.jsx(AAn,{renderLog:p})})]})})})};var QY="Dialog",[bZe,xZe]=QQ(QY),[pAn,JS]=bZe(QY),BZe=i=>{const{__scopeDialog:e,children:t,open:n,defaultOpen:r,onOpenChange:a,modal:o=!0}=i,s=rt.useRef(null),l=rt.useRef(null),[u,d]=f5({prop:n,defaultProp:r??!1,onChange:a,caller:QY});return Ke.jsx(pAn,{scope:e,triggerRef:s,contentRef:l,contentId:MQ(),titleId:MQ(),descriptionId:MQ(),open:u,onOpenChange:d,onOpenToggle:rt.useCallback(()=>d(f=>!f),[d]),modal:o,children:t})};BZe.displayName=QY;var SZe="DialogTrigger",wZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(SZe,t),a=W_(e,r.triggerRef);return Ke.jsx(e1.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":uge(r.open),...n,ref:a,onClick:Pm(i.onClick,r.onOpenToggle)})});wZe.displayName=SZe;var lge="DialogPortal",[gAn,QZe]=bZe(lge,{forceMount:void 0}),MZe=i=>{const{__scopeDialog:e,forceMount:t,children:n,container:r}=i,a=JS(lge,e);return Ke.jsx(gAn,{scope:e,forceMount:t,children:rt.Children.map(n,o=>Ke.jsx(Cw,{present:t||a.open,children:Ke.jsx(jfe,{asChild:!0,container:r,children:o})}))})};MZe.displayName=lge;var MY="DialogOverlay",RZe=rt.forwardRef((i,e)=>{const t=QZe(MY,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,a=JS(MY,i.__scopeDialog);return a.modal?Ke.jsx(Cw,{present:n||a.open,children:Ke.jsx(yAn,{...r,ref:e})}):null});RZe.displayName=MY;var mAn=d5("DialogOverlay.RemoveScroll"),yAn=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(MY,t);return Ke.jsx($fe,{as:mAn,allowPinchZoom:!0,shards:[r.contentRef],children:Ke.jsx(e1.div,{"data-state":uge(r.open),...n,ref:e,style:{pointerEvents:"auto",...n.style}})})}),nR="DialogContent",DZe=rt.forwardRef((i,e)=>{const t=QZe(nR,i.__scopeDialog),{forceMount:n=t.forceMount,...r}=i,a=JS(nR,i.__scopeDialog);return Ke.jsx(Cw,{present:n||a.open,children:a.modal?Ke.jsx(vAn,{...r,ref:e}):Ke.jsx(CAn,{...r,ref:e})})});DZe.displayName=nR;var vAn=rt.forwardRef((i,e)=>{const t=JS(nR,i.__scopeDialog),n=rt.useRef(null),r=W_(e,t.contentRef,n);return rt.useEffect(()=>{const a=n.current;if(a)return tVe(a)},[]),Ke.jsx(NZe,{...i,ref:r,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Pm(i.onCloseAutoFocus,a=>{var o;a.preventDefault(),(o=t.triggerRef.current)==null||o.focus()}),onPointerDownOutside:Pm(i.onPointerDownOutside,a=>{const o=a.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&a.preventDefault()}),onFocusOutside:Pm(i.onFocusOutside,a=>a.preventDefault())})}),CAn=rt.forwardRef((i,e)=>{const t=JS(nR,i.__scopeDialog),n=rt.useRef(!1),r=rt.useRef(!1);return Ke.jsx(NZe,{...i,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{var o,s;(o=i.onCloseAutoFocus)==null||o.call(i,a),a.defaultPrevented||(n.current||(s=t.triggerRef.current)==null||s.focus(),a.preventDefault()),n.current=!1,r.current=!1},onInteractOutside:a=>{var l,u;(l=i.onInteractOutside)==null||l.call(i,a),a.defaultPrevented||(n.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const o=a.target;((u=t.triggerRef.current)==null?void 0:u.contains(o))&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),NZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,trapFocus:n,onOpenAutoFocus:r,onCloseAutoFocus:a,...o}=i,s=JS(nR,t),l=rt.useRef(null),u=W_(e,l);return gYe(),Ke.jsxs(Ke.Fragment,{children:[Ke.jsx(Dfe,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:r,onUnmountAutoFocus:a,children:Ke.jsx(wfe,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":uge(s.open),...o,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),Ke.jsxs(Ke.Fragment,{children:[Ke.jsx(_An,{titleId:s.titleId}),Ke.jsx(bAn,{contentRef:l,descriptionId:s.descriptionId})]})]})}),cge="DialogTitle",TZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(cge,t);return Ke.jsx(e1.h2,{id:r.titleId,...n,ref:e})});TZe.displayName=cge;var UZe="DialogDescription",PZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(UZe,t);return Ke.jsx(e1.p,{id:r.descriptionId,...n,ref:e})});PZe.displayName=UZe;var LZe="DialogClose",kZe=rt.forwardRef((i,e)=>{const{__scopeDialog:t,...n}=i,r=JS(LZe,t);return Ke.jsx(e1.button,{type:"button",...n,ref:e,onClick:Pm(i.onClick,()=>r.onOpenChange(!1))})});kZe.displayName=LZe;function uge(i){return i?"open":"closed"}var GZe="DialogTitleWarning",[IAn,FZe]=jxt(GZe,{contentName:nR,titleName:cge,docsSlug:"dialog"}),_An=({titleId:i})=>{const e=FZe(GZe),t=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
13750
13750
|
|
|
13751
13751
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
13752
13752
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tscircuit/runframe",
|
|
3
3
|
"main": "dist/preview.js",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.658",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": "./dist/preview.js",
|
|
8
8
|
"./preview": "./dist/preview.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@babel/standalone": "^7.26.10",
|
|
34
34
|
"@biomejs/biome": "^1.9.4",
|
|
35
35
|
"@tscircuit/checks": "^0.0.54",
|
|
36
|
-
"@tscircuit/eval": "^0.0.
|
|
36
|
+
"@tscircuit/eval": "^0.0.244",
|
|
37
37
|
"@tscircuit/fake-snippets": "^0.0.87",
|
|
38
38
|
"@tscircuit/math-utils": "^0.0.18",
|
|
39
39
|
"@types/bun": "latest",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"tsup": "^8.3.5",
|
|
69
69
|
"vite": "^6.0.3",
|
|
70
70
|
"yargs": "^17.7.2",
|
|
71
|
-
"@tscircuit/3d-viewer": "^0.0.
|
|
71
|
+
"@tscircuit/3d-viewer": "^0.0.294",
|
|
72
72
|
"@tscircuit/assembly-viewer": "^0.0.1",
|
|
73
73
|
"@tscircuit/create-snippet-url": "^0.0.8",
|
|
74
74
|
"@tscircuit/file-server": "^0.0.24",
|