import{a as Z}from"./aria-hidden-qtP6lSap.js";(function(){try{var S=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},R=new S.Error().stack;R&&(S._sentryDebugIds=S._sentryDebugIds||{},S._sentryDebugIds[R]="f8473e42-ecd4-4d26-87a3-ae4ffd502e53",S._sentryDebugIdIdentifier="sentry-dbid-f8473e42-ecd4-4d26-87a3-ae4ffd502e53")}catch{}})();var V={exports:{}};(function(S){(function(R){var l=z(),B=K(),F=Q(),j=Y(),M={imagePlaceholder:void 0,cacheBust:!1},T={toSvg:N,toPng:_,toJpeg:X,toBlob:G,toPixelData:H,impl:{fontFaces:F,images:j,util:l,inliner:B,options:{}}};S.exports=T;function N(n,t){return t=t||{},$(t),Promise.resolve(n).then(function(o){return O(o,t.filter,!0)}).then(W).then(q).then(r).then(function(o){return J(o,t.width||l.width(n),t.height||l.height(n))});function r(o){return t.bgcolor&&(o.style.backgroundColor=t.bgcolor),t.width&&(o.style.width=t.width+"px"),t.height&&(o.style.height=t.height+"px"),t.style&&Object.keys(t.style).forEach(function(s){o.style[s]=t.style[s]}),o}}function H(n,t){return D(n,t||{}).then(function(r){return r.getContext("2d").getImageData(0,0,l.width(n),l.height(n)).data})}function _(n,t){return D(n,t||{}).then(function(r){return r.toDataURL()})}function X(n,t){return t=t||{},D(n,t).then(function(r){return r.toDataURL("image/jpeg",t.quality||1)})}function G(n,t){return D(n,t||{}).then(l.canvasToBlob)}function $(n){typeof n.imagePlaceholder>"u"?T.impl.options.imagePlaceholder=M.imagePlaceholder:T.impl.options.imagePlaceholder=n.imagePlaceholder,typeof n.cacheBust>"u"?T.impl.options.cacheBust=M.cacheBust:T.impl.options.cacheBust=n.cacheBust}function D(n,t){return N(n,t).then(l.makeImage).then(l.delay(100)).then(function(o){var s=r(n);return s.getContext("2d").drawImage(o,0,0),s});function r(o){var s=document.createElement("canvas");if(s.width=t.width||l.width(o),s.height=t.height||l.height(o),t.bgcolor){var c=s.getContext("2d");c.fillStyle=t.bgcolor,c.fillRect(0,0,s.width,s.height)}return s}}function O(n,t,r){if(!r&&t&&!t(n))return Promise.resolve();return Promise.resolve(n).then(o).then(function(i){return s(n,i,t)}).then(function(i){return c(n,i)});function o(i){return i instanceof HTMLCanvasElement?l.makeImage(i.toDataURL()):i.cloneNode(!1)}function s(i,a,p){var P=i.childNodes;if(P.length===0)return Promise.resolve(a);return d(a,l.asArray(P),p).then(function(){return a});function d(I,v,m){var y=Promise.resolve();return v.forEach(function(C){y=y.then(function(){return O(C,m)}).then(function(w){w&&I.appendChild(w)})}),y}}function c(i,a){if(!(a instanceof Element))return a;return Promise.resolve().then(p).then(P).then(d).then(I).then(function(){return a});function p(){v(window.getComputedStyle(i),a.style);function v(m,y){m.cssText?y.cssText=m.cssText:C(m,y);function C(w,E){l.asArray(w).forEach(function(e){E.setProperty(e,w.getPropertyValue(e),w.getPropertyPriority(e))})}}}function P(){[":before",":after"].forEach(function(m){v(m)});function v(m){var y=window.getComputedStyle(i,m),C=y.getPropertyValue("content");if(C===""||C==="none")return;var w=l.uid();a.className=a.className+" "+w;var E=document.createElement("style");E.appendChild(e(w,m,y)),a.appendChild(E);function e(u,h,f){var g="."+u+":"+h,b=f.cssText?L(f):k(f);return document.createTextNode(g+"{"+b+"}");function L(x){var A=x.getPropertyValue("content");return x.cssText+" content: "+A+";"}function k(x){return l.asArray(x).map(A).join("; ")+";";function A(U){return U+": "+x.getPropertyValue(U)+(x.getPropertyPriority(U)?" !important":"")}}}}}function d(){i instanceof HTMLTextAreaElement&&(a.innerHTML=i.value),i instanceof HTMLInputElement&&a.setAttribute("value",i.value)}function I(){a instanceof SVGElement&&(a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a instanceof SVGRectElement&&["width","height"].forEach(function(v){var m=a.getAttribute(v);m&&a.style.setProperty(v,m)}))}}}function W(n){return F.resolveAll().then(function(t){var r=document.createElement("style");return n.appendChild(r),r.appendChild(document.createTextNode(t)),n})}function q(n){return j.inlineAll(n).then(function(){return n})}function J(n,t,r){return Promise.resolve(n).then(function(o){return o.setAttribute("xmlns","http://www.w3.org/1999/xhtml"),new XMLSerializer().serializeToString(o)}).then(l.escapeXhtml).then(function(o){return'<foreignObject x="0" y="0" width="100%" height="100%">'+o+"</foreignObject>"}).then(function(o){return'<svg xmlns="http://www.w3.org/2000/svg" width="'+t+'" height="'+r+'">'+o+"</svg>"}).then(function(o){return"data:image/svg+xml;charset=utf-8,"+o})}function z(){return{escape:I,parseExtension:t,mimeType:r,dataAsUrl:d,isDataUrl:o,canvasToBlob:c,resolveUrl:i,getAndEncode:P,uid:a(),delay:v,asArray:m,escapeXhtml:y,makeImage:p,width:C,height:w};function n(){var e="application/font-woff",u="image/jpeg";return{woff:e,woff2:e,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:u,jpeg:u,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml"}}function t(e){var u=/\.([^\.\/]*?)$/g.exec(e);return u?u[1]:""}function r(e){var u=t(e).toLowerCase();return n()[u]||""}function o(e){return e.search(/^(data:)/)!==-1}function s(e){return new Promise(function(u){for(var h=window.atob(e.toDataURL().split(",")[1]),f=h.length,g=new Uint8Array(f),b=0;b<f;b++)g[b]=h.charCodeAt(b);u(new Blob([g],{type:"image/png"}))})}function c(e){return e.toBlob?new Promise(function(u){e.toBlob(u)}):s(e)}function i(e,u){var h=document.implementation.createHTMLDocument(),f=h.createElement("base");h.head.appendChild(f);var g=h.createElement("a");return h.body.appendChild(g),f.href=u,g.href=e,g.href}function a(){var e=0;return function(){return"u"+u()+e++;function u(){return("0000"+(Math.random()*Math.pow(36,4)<<0).toString(36)).slice(-4)}}}function p(e){return new Promise(function(u,h){var f=new Image;f.onload=function(){u(f)},f.onerror=h,f.src=e})}function P(e){var u=3e4;return T.impl.options.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime()),new Promise(function(h){var f=new XMLHttpRequest;f.onreadystatechange=L,f.ontimeout=k,f.responseType="blob",f.timeout=u,f.open("GET",e,!0),f.send();var g;if(T.impl.options.imagePlaceholder){var b=T.impl.options.imagePlaceholder.split(/,/);b&&b[1]&&(g=b[1])}function L(){if(f.readyState===4){if(f.status!==200){g?h(g):x("cannot fetch resource: "+e+", status: "+f.status);return}var A=new FileReader;A.onloadend=function(){var U=A.result.split(/,/)[1];h(U)},A.readAsDataURL(f.response)}}function k(){g?h(g):x("timeout of "+u+"ms occured while fetching resource: "+e)}function x(A){console.error(A),h("")}})}function d(e,u){return"data:"+u+";base64,"+e}function I(e){return e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1")}function v(e){return function(u){return new Promise(function(h){setTimeout(function(){h(u)},e)})}}function m(e){for(var u=[],h=e.length,f=0;f<h;f++)u.push(e[f]);return u}function y(e){return e.replace(/#/g,"%23").replace(/\n/g,"%0A")}function C(e){var u=E(e,"border-left-width"),h=E(e,"border-right-width");return e.scrollWidth+u+h}function w(e){var u=E(e,"border-top-width"),h=E(e,"border-bottom-width");return e.scrollHeight+u+h}function E(e,u){var h=window.getComputedStyle(e).getPropertyValue(u);return parseFloat(h.replace("px",""))}}function K(){var n=/url\(['"]?([^'"]+?)['"]?\)/g;return{inlineAll:s,shouldProcess:t,impl:{readUrls:r,inline:o}};function t(c){return c.search(n)!==-1}function r(c){for(var i=[],a;(a=n.exec(c))!==null;)i.push(a[1]);return i.filter(function(p){return!l.isDataUrl(p)})}function o(c,i,a,p){return Promise.resolve(i).then(function(d){return a?l.resolveUrl(d,a):d}).then(p||l.getAndEncode).then(function(d){return l.dataAsUrl(d,l.mimeType(i))}).then(function(d){return c.replace(P(i),"$1"+d+"$3")});function P(d){return new RegExp(`(url\\(['"]?)(`+l.escape(d)+`)(['"]?\\))`,"g")}}function s(c,i,a){if(p())return Promise.resolve(c);return Promise.resolve(c).then(r).then(function(P){var d=Promise.resolve(c);return P.forEach(function(I){d=d.then(function(v){return o(v,I,i,a)})}),d});function p(){return!t(c)}}}function Q(){return{resolveAll:n,impl:{readAll:t}};function n(){return t().then(function(r){return Promise.all(r.map(function(o){return o.resolve()}))}).then(function(r){return r.join(`
`)})}function t(){return Promise.resolve(l.asArray(document.styleSheets)).then(o).then(r).then(function(c){return c.map(s)});function r(c){return c.filter(function(i){return i.type===CSSRule.FONT_FACE_RULE}).filter(function(i){return B.shouldProcess(i.style.getPropertyValue("src"))})}function o(c){var i=[];return c.forEach(function(a){try{l.asArray(a.cssRules||[]).forEach(i.push.bind(i))}catch(p){console.log("Error while reading CSS rules from "+a.href,p.toString())}}),i}function s(c){return{resolve:function(){var a=(c.parentStyleSheet||{}).href;return B.inlineAll(c.cssText,a)},src:function(){return c.style.getPropertyValue("src")}}}}}function Y(){return{inlineAll:t,impl:{newImage:n}};function n(r){return{inline:o};function o(s){return l.isDataUrl(r.src)?Promise.resolve():Promise.resolve(r.src).then(s||l.getAndEncode).then(function(c){return l.dataAsUrl(c,l.mimeType(r.src))}).then(function(c){return new Promise(function(i,a){r.onload=i,r.onerror=a,r.src=c})})}}function t(r){if(!(r instanceof Element))return Promise.resolve(r);return o(r).then(function(){return r instanceof HTMLImageElement?n(r).inline():Promise.all(l.asArray(r.childNodes).map(function(s){return t(s)}))});function o(s){var c=s.style.getPropertyValue("background");return c?B.inlineAll(c).then(function(i){s.style.setProperty("background",i,s.style.getPropertyPriority("background"))}).then(function(){return s}):Promise.resolve(s)}}}})()})(V);var ee=V.exports;const ne=Z(ee);export{ne as d};
//# sourceMappingURL=dom-to-image-2gbDylnP.js.map
