{"version":3,"file":"CopilotKitInspector.cjs","names":["React"],"sources":["../../src/components/CopilotKitInspector.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createComponent } from \"@lit-labs/react\";\nimport type { CopilotKitCore } from \"@copilotkitnext/core\";\n\ntype CopilotKitInspectorBaseProps = {\n core?: CopilotKitCore | null;\n [key: string]: unknown;\n};\n\ntype InspectorComponent = React.ComponentType;\n\nexport interface CopilotKitInspectorProps extends CopilotKitInspectorBaseProps {}\n\nexport const CopilotKitInspector: React.FC = ({\n core,\n ...rest\n}) => {\n const [InspectorComponent, setInspectorComponent] =\n React.useState(null);\n\n React.useEffect(() => {\n let mounted = true;\n\n // Load the web component only on the client to keep SSR output stable.\n import(\"@copilotkitnext/web-inspector\").then((mod) => {\n mod.defineWebInspector?.();\n\n const Component = createComponent({\n tagName: mod.WEB_INSPECTOR_TAG,\n elementClass: mod.WebInspectorElement,\n react: React,\n }) as InspectorComponent;\n\n if (mounted) {\n setInspectorComponent(() => Component);\n }\n });\n\n return () => {\n mounted = false;\n };\n }, []);\n\n // During SSR (and until the client finishes loading), render nothing to keep markup consistent.\n if (!InspectorComponent) return null;\n\n return ;\n};\n\nCopilotKitInspector.displayName = \"CopilotKitInspector\";\n"],"mappings":";;;;;;;AAaA,MAAa,uBAA2D,EACtE,MACA,GAAG,WACC;CACJ,MAAM,CAAC,oBAAoB,yBACzBA,MAAM,SAAoC,KAAK;AAEjD,OAAM,gBAAgB;EACpB,IAAI,UAAU;AAGd,SAAO,iCAAiC,MAAM,QAAQ;AACpD,OAAI,sBAAsB;GAE1B,MAAM,iDAA4B;IAChC,SAAS,IAAI;IACb,cAAc,IAAI;IACXA;IACR,CAAC;AAEF,OAAI,QACF,6BAA4B,UAAU;IAExC;AAEF,eAAa;AACX,aAAU;;IAEX,EAAE,CAAC;AAGN,KAAI,CAAC,mBAAoB,QAAO;AAEhC,QAAO,2CAAC;EAAmB,GAAI;EAAM,MAAM,QAAQ;GAAQ;;AAG7D,oBAAoB,cAAc"}