{"version":3,"sources":["jsdelivr-header.js","/npm/improv-wifi-serial-sdk@2.5.0/dist/serial-launch-button.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,OCNS,sBAAyB,qBAC3B,MAAM,2BAA2B,YACpC,iBAAA,GACI,GAAI,KAAK,WACL,OAGJ,GADA,KAAK,WAAa,KAAK,aAAa,CAAE,KAAM,UACvC,mBAAmB,cAAgB,mBAAmB,UAKvD,OAJA,KAAK,gBAAgB,iBAAiB,QACtC,KAAK,WAAW,UAAa,mBAAmB,UAE1C,0HADA,wFAIV,KAAK,gBAAgB,aAAa,GAClC,MAAM,EAAO,SAAS,cAAc,QACpC,EAAK,KAAO,WACZ,MAAM,EAAS,SAAS,cAAc,UAOtC,GANA,EAAO,UAAY,0BACnB,EAAK,OAAO,GACZ,EAAK,iBAAiB,SAAS,MAAO,IAClC,EAAG,iBACH,kBAAkB,KAAK,IAEvB,uBAAwB,SAAS,WACjC,gBAAiB,cAAc,UAAW,CAC1C,MAAM,EAAQ,IAAI,cAClB,EAAM,YAAY,mBAAmB,OACrC,KAAK,WAAW,mBAAqB,CAAC,EAC1C,KACK,CACD,MAAM,EAAa,SAAS,cAAc,SAC1C,EAAW,UAAY,mBAAmB,MAC1C,KAAK,WAAW,OAAO,EAC3B,CACA,KAAK,WAAW,OAAO,EAC3B,EAEJ,mBAAmB,YAAc,WAAY,UAC7C,mBAAmB,UAAY,OAAO,gBACtC,mBAAmB,MAAQ,q5BAsC3B,eAAe,OAAO,mCAAoC","file":"/npm/improv-wifi-serial-sdk@2.5.0/dist/serial-launch-button.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/improv-wifi-serial-sdk@2.5.0/dist/serial-launch-button.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","import { startProvisioning } from \"./provision\";\nexport class SerialLaunchButton extends HTMLElement {\n    connectedCallback() {\n        if (this.renderRoot) {\n            return;\n        }\n        this.renderRoot = this.attachShadow({ mode: \"open\" });\n        if (!SerialLaunchButton.isSupported || !SerialLaunchButton.isAllowed) {\n            this.toggleAttribute(\"not-supported\", true);\n            this.renderRoot.innerHTML = !SerialLaunchButton.isAllowed\n                ? \"<slot name='not-allowed'>You can only use Improv on HTTPS sites or localhost.</slot>\"\n                : \"<slot name='unsupported'>Your browser does not support serial provisioning. Use Google Chrome or Microsoft Edge.</slot>\";\n            return;\n        }\n        this.toggleAttribute(\"supported\", true);\n        const slot = document.createElement(\"slot\");\n        slot.name = \"activate\";\n        const button = document.createElement(\"button\");\n        button.innerText = \"Connect device to Wi-Fi\";\n        slot.append(button);\n        slot.addEventListener(\"click\", async (ev) => {\n            ev.preventDefault();\n            startProvisioning(this);\n        });\n        if (\"adoptedStyleSheets\" in Document.prototype &&\n            \"replaceSync\" in CSSStyleSheet.prototype) {\n            const sheet = new CSSStyleSheet();\n            sheet.replaceSync(SerialLaunchButton.style);\n            this.renderRoot.adoptedStyleSheets = [sheet];\n        }\n        else {\n            const styleSheet = document.createElement(\"style\");\n            styleSheet.innerText = SerialLaunchButton.style;\n            this.renderRoot.append(styleSheet);\n        }\n        this.renderRoot.append(slot);\n    }\n}\nSerialLaunchButton.isSupported = \"serial\" in navigator;\nSerialLaunchButton.isAllowed = window.isSecureContext;\nSerialLaunchButton.style = `\n  button {\n    position: relative;\n    cursor: pointer;\n    font-size: 14px;\n    padding: 8px 28px;\n    color: var(--improv-on-primary-color, #fff);\n    background-color: var(--improv-primary-color, #03a9f4);\n    border: none;\n    border-radius: 4px;\n    box-shadow: 0 2px 2px 0 rgba(0,0,0,.14), 0 3px 1px -2px rgba(0,0,0,.12), 0 1px 5px 0 rgba(0,0,0,.2);\n  }\n  button::before {\n    content: \" \";\n    position: absolute;\n    top: 0;\n    bottom: 0;\n    left: 0;\n    right: 0;\n    opacity: 0.2;\n    border-radius: 4px;\n  }\n  button:hover {\n    box-shadow: 0 4px 8px 0 rgba(0,0,0,.14), 0 1px 7px 0 rgba(0,0,0,.12), 0 3px 1px -1px rgba(0,0,0,.2);\n  }\n  button:hover::before {\n    background-color: rgba(255,255,255,.8);\n  }\n  button:focus {\n    outline: none;\n  }\n  button:focus::before {\n    background-color: white;\n  }\n  button:active::before {\n    background-color: grey;\n  }\n`;\ncustomElements.define(\"improv-wifi-serial-launch-button\", SerialLaunchButton);\n"]}