UNPKG

scandit-web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

4 lines (2 loc) 1.06 kB
async function g(a){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(a)).then(encodeURIComponent).then(e=>`data:image/svg+xml;charset=utf-8,${e}`)}var c="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8",o=(a,e,r)=>{a.hasAttribute(e)&&a.setAttribute(e,r);};function d(a,e){let r=!1;for(let i of e.querySelectorAll(a))i.remove(),r=!0;return r}function m(a,e=c){let r=!1;function i(t){if(t.nodeType!==Node.ELEMENT_NODE)return;t.localName==="img"&&(o(t,"src",e),o(t,"srcset",e),r=!0),(t.localName==="picture"||t.localName==="source")&&(o(t,"srcset",e),r=!0),t.localName==="image"&&(o(t,"href",e),o(t,"xlink:href",e),r=!0);let n=window.getComputedStyle(t);t instanceof HTMLElement&&n.backgroundImage.includes("url(")&&(t.style.setProperty("background-image",`url(${e})`,"important"),r=!0),t instanceof HTMLElement&&n.background.includes("url(")&&(t.style.setProperty("background",`url(${e})`,"important"),r=!0);for(let s of [...t.children])i(s);}return i(a),r} export { g as a, c as b, d as c, m as d };