{"version":3,"file":"1777.0e281cf29b101b30e623.js","mappings":"oMAKO,SAASA,GAAY,QAC1BC,EAAO,QACPC,EAAO,YACPC,GACE,CAAC,GACH,GAAsB,oBAAXC,QAA8C,oBAAbC,SAC1C,OAGF,GAAIA,SAASC,eAAe,qBAE1B,OAGEH,IACF,QAAuBA,GAIzB,MAAMI,EAAQF,SAASG,cAAc,SACrCD,EAAME,GAAK,kBACXF,EAAMG,UAAY,0GAIG,oQAYf,YAEN,MAAMC,EAAcN,SAASG,cAAc,SAC3CG,EAAYF,GAAK,yBACjBE,EAAYD,UAAY,kDAEPE,gKAQjB,MAAMC,EAAUR,SAASG,cAAc,OACvCK,EAAQC,aAAa,KAAM,qBAC3B,MAAMC,EAASF,EAAQG,aAAa,CAClCC,KAAM,SAEFC,EAAQb,SAASG,cAAc,OACrCU,EAAMJ,aAAa,KAAM,mBAGzBC,EAAOI,YAAYZ,GACnBQ,EAAOI,YAAYD,GACnBb,SAASe,KAAKD,YAAYN,GAC1BR,SAASgB,KAAKF,YAAYR,GAKU,CAElC,MAAM,WACJW,GACE,EAAQ,OAEZA,EAAWJ,EAAOjB,EAASC,GAAW,KACxC,CAOF,C,eCnFsB,oBAAXE,SAA0B,EAAAmB,EAAA,MACnCC,YAAW,IAAMxB,EAAY,CAAC,IAAI,GAG7B,MAAMY,EAAa,WAY1B,MAXO,UAAe,QACpBX,EAAO,QACPC,EAAO,YACPC,GACE,CAAC,GACHqB,YAAW,IAAMxB,EAAY,CAC3BC,UACAC,UACAC,iBACE,EACN,C","sources":["webpack:///../node_modules/@locator/runtime/dist/initRuntime.js","webpack:///../node_modules/@locator/runtime/dist/index.js"],"sourcesContent":["import { allTargets } from \"@locator/shared\";\nimport { fontFamily } from \"./consts\";\nimport generatedStyles from \"./_generated_styles\";\nimport { MAX_ZINDEX } from \"./index\";\nimport { setInternalProjectPath } from \"./functions/buildLink\";\nexport function initRuntime({\n adapter,\n targets,\n projectPath\n} = {}) {\n if (typeof window === \"undefined\" || typeof document === \"undefined\") {\n return;\n }\n\n if (document.getElementById(\"locatorjs-wrapper\")) {\n // already initialized\n return;\n }\n\n if (projectPath) {\n setInternalProjectPath(projectPath);\n } // add style tag to head\n\n\n const style = document.createElement(\"style\");\n style.id = \"locatorjs-style\";\n style.innerHTML = `\n #locatorjs-layer {\n all: initial;\n pointer-events: none;\n font-family: ${fontFamily};\n }\n #locatorjs-layer * {\n box-sizing: border-box;\n }\n #locatorjs-labels-wrapper {\n display: flex;\n gap: 8px;\n }\n .locatorjs-tree-node:hover {\n background-color: #eee;\n }\n ${generatedStyles}\n `;\n const globalStyle = document.createElement(\"style\");\n globalStyle.id = \"locatorjs-global-style\";\n globalStyle.innerHTML = `\n #locatorjs-wrapper {\n z-index: ${MAX_ZINDEX};\n pointer-events: none;\n position: fixed;\n }\n .locatorjs-active-pointer * {\n cursor: pointer !important;\n }\n `;\n const wrapper = document.createElement(\"div\");\n wrapper.setAttribute(\"id\", \"locatorjs-wrapper\");\n const shadow = wrapper.attachShadow({\n mode: \"open\"\n });\n const layer = document.createElement(\"div\");\n layer.setAttribute(\"id\", \"locatorjs-layer\"); // wrapper.appendChild(style);\n // wrapper.appendChild(layer);\n\n shadow.appendChild(style);\n shadow.appendChild(layer);\n document.body.appendChild(wrapper);\n document.head.appendChild(globalStyle); // This weird import is needed because:\n // SSR React (Next.js) breaks when importing any SolidJS compiled file, so the import has to be conditional\n // Browser Extension breaks when importing with \"import()\"\n // Vite breaks when importing with \"require()\"\n\n if (typeof require !== \"undefined\") {\n // eslint-disable-next-line @typescript-eslint/no-var-requires\n const {\n initRender\n } = require(\"./components/Runtime\");\n\n initRender(layer, adapter, targets || allTargets);\n } else {\n import(\"./components/Runtime\").then(({\n initRender\n }) => {\n initRender(layer, adapter, targets || allTargets);\n });\n }\n}","import { initRuntime } from \"./initRuntime\";\nimport { isExtension } from \"./functions/isExtension\";\nexport * from \"./adapters/jsx/runtimeStore\"; // Init in case it is used from extension\n\nif (typeof window !== \"undefined\" && isExtension()) {\n setTimeout(() => initRuntime({}), 0);\n}\n\nexport const MAX_ZINDEX = 2147483647;\nexport function setup({\n adapter,\n targets,\n projectPath\n} = {}) {\n setTimeout(() => initRuntime({\n adapter,\n targets,\n projectPath\n }), 0);\n}\nexport default setup;"],"names":["initRuntime","adapter","targets","projectPath","window","document","getElementById","style","createElement","id","innerHTML","globalStyle","MAX_ZINDEX","wrapper","setAttribute","shadow","attachShadow","mode","layer","appendChild","body","head","initRender","isExtension","setTimeout"],"sourceRoot":""}