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AAS,UAAU,IAAI,UACvB,SAAS,YAAc,wBAAwB,IAGnD,SAAS,iBAAiB,aAAa,KACnC,SAAS,UAAU,OAAO,UAC1B,SAAS,YAAc,eAAe,IAG1C,SAAS,iBAAiB,QAAS,IAC/B,EAAM,iBAEN,SAAW,EAAM,aAAa,MAAM,GACpC,UAAU","file":"/gh/blst-security/cym8s-widget@1.8/src/widget.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /gh/blst-security/cym8s-widget@1.8/src/widget.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","const dropArea = document.querySelector(\".blst-drag-area\"),\n    dragText = dropArea.querySelector(\".blst-title\"),\n    button = dropArea.querySelector(\".blst-button\"),\n    input = dropArea.querySelector(\".blst-input\");\n\nconst example = document.querySelector(\"#example_href\");\nconst nathan = document.querySelector(\"#nathan_href\");\nif (example) {\n    example.href = `https://www.blstsecurity.com/ScanSwagger/6209ab14-089e-4108-8bb2-5b22deab9751?tab=Summary&promo=${document.getElementById(\"cyRefcode\").attributes['data-ref'].value || 'blst'}&domain=${document.location.origin}`\n}\nif (nathan) {\n    nathan.href = `https://www.blstsecurity.com?promo=${document.getElementById(\"cyRefcode\").attributes['data-ref'].value || 'blst'}&domain=${document.location.origin}`\n}\n\nlet blstFile; //this is a global variable and we'll use it inside multiple functions\n\ninput.addEventListener(\"change\", (event) => {\n    //getting user select file and [0] this means if user select multiple files then we'll select only the first one\n    blstFile = event.target.files[0];\n    dropArea.classList.add(\"active\");\n    showFile();\n});\n//If user Drag File Over DropArea\ndropArea.addEventListener(\"dragover\", (event) => {\n    event.preventDefault();\n    dropArea.classList.add(\"active\");\n    dragText.textContent = \"Release to Upload File\";\n});\n//If user leave dragged File from DropArea\ndropArea.addEventListener(\"dragleave\", () => {\n    dropArea.classList.remove(\"active\");\n    dragText.textContent = \"+ Drag & Drop\";\n});\n//If user drop File on DropArea\ndropArea.addEventListener(\"drop\", (event) => {\n    event.preventDefault();\n    //getting user select file and [0] this means if user select multiple files then we'll select only the first one\n    blstFile = event.dataTransfer.files[0];\n    showFile();\n});\n\nfunction showFile() {\n    if (blstFile.size > 4194304) { // 4mb\n        alert(\"File size too big\");\n        dropArea.classList.remove(\"active\");\n        dragText.textContent = \"+ Drag & Drop\";\n    } else {\n        let reader = new FileReader();\n        reader.onload = (event) => {\n            let oas = event.target.result;\n            fetch(\"https://idk.blstsecurity.com/create_scan\", {\n                method: \"POST\",\n                body: JSON.stringify({ oas }),\n            }).then((response) => response.json()).then((data) => {\n                const a = document.createElement(\"a\");\n                a.href = `https://www.blstsecurity.com/ScanSwagger/${data.scan_id}?tab=Summary&promo=${document.getElementById(\"cyRefcode\").attributes['data-ref'].value || 'blst'}&domain=${document.location.origin}`;\n                a.target = \"_blank\";\n                a.rel = \"noopener noreferrer\";\n                document.body.appendChild(a);\n                a.click();\n                a.remove();\n                dropArea.classList.remove(\"active\");\n                dragText.textContent = \"+ Drag & Drop\";\n                blstFile = undefined;\n            });\n            let successHtml = `\n              <div style=\"display:Flex;justify-content:center;\">\n<div class=\"\" style=\"width:20px;margin-right:6px;\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\">\n  <path stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M5.636 18.364a9 9 0 010-12.728m12.728 0a9 9 0 010 12.728m-9.9-2.829a5 5 0 010-7.07m7.072 0a5 5 0 010 7.07M13 12a1 1 0 11-2 0 1 1 0 012 0z\" stroke=\"green\" class=\"animated rotation\" />\n</svg></div>\n            <span>${blstFile.name}</span></div>`;\n            dropArea.innerHTML = successHtml;\n        };\n        reader.readAsText(blstFile);\n    }\n}\n"]}