/*! Built with http://stenciljs.com */
var __generator=this&&this.__generator||function(e,t){var n,r,i,o,l={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;l;)try{if(n=1,r&&(i=r[2&o[0]?"return":o[0]?"throw":"next"])&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[0,i.value]),o[0]){case 0:case 1:i=o;break;case 4:return l.label++,{value:o[1],done:!1};case 5:l.label++,r=o[1],o=[0];continue;case 7:o=l.ops.pop(),l.trys.pop();continue;default:if(!(i=(i=l.trys).length>0&&i[i.length-1])&&(6===o[0]||2===o[0])){l=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){l.label=o[1];break}if(6===o[0]&&l.label<i[1]){l.label=i[1],i=o;break}if(i&&l.label<i[2]){l.label=i[2],l.ops.push(o);break}i[2]&&l.ops.pop(),l.trys.pop();continue}o=t.call(e,l)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};webcomponents.loadBundle("cbflu88o",["exports","./chunk-509002b8.js"],function(e,t){var n=window.webcomponents.h,r=function(){function e(){this.type="template"}return e.prototype.componentDidLoad=function(){},e.prototype.componentDidUpdate=function(){},e.prototype.loadSvg=function(){return e=this,t=void 0,r=function(){var e;return __generator(this,function(t){switch(t.label){case 0:return this.loading=!0,[4,fetch(""+this.src).then(function(e){return e.text()}).catch(function(e){return console.error("Error:",e)})];case 1:return e=t.sent(),this.loading=!1,[2,e]}})},new((n=void 0)||(n=Promise))(function(i,o){function l(e){try{s(r.next(e))}catch(e){o(e)}}function a(e){try{s(r.throw(e))}catch(e){o(e)}}function s(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(l,a)}s((r=r.apply(e,t||[])).next())});var e,t,n,r},e.prototype.parseSvg=function(e){var n=this,r=t.StringUtil;this._svg=e,e=e.replace("]>",""),e=r.replaceAll(e,"{{ ","{{"),e=r.replaceAll(e,"{{  ","{{"),e=r.replaceAll(e," }}","}}"),e=r.replaceAll(e,"  }}","}}"),this.data&&Object.keys(this.data).forEach(function(t){e=r.replaceAll(e,"{{"+t+"}}",n.data[t])}),this.svgResult=e,setTimeout(function(t){n.el.querySelector(".embedded").innerHTML=e,setTimeout(function(e){n.el.querySelector("svg")&&(n._svgElement=n.el.querySelector("svg"),n.renderSvg())},40),n.getElements()},20)},e.prototype.getElements=function(){var e=this;this.elements=[];var n=["Shape","Oval","Rectangle","Line","Group"],r=this.el.querySelectorAll("*");return Array.prototype.forEach.call(r,function(r){if(t.DomUtil.getAttributes(r).id){var i=t.DomUtil.getAttributes(r).id,o=!1;n.forEach(function(e){i.match(e)&&(o=!0)}),o||(i.match("btn-")&&(r.style.cursor="pointer",r.style.opacity="0"),e.elements.push({id:i,el:r}))}}),this.setClickHandlers(),this.elements},e.prototype.svgElementClickHandler=function(e){var t;e.stopPropagation(),this.elements.forEach(function(n){n.el===e.target&&(t=n)}),t&&this.svgElementClick.emit(t)},e.prototype.setClickHandlers=function(){var e=this;this.elements.forEach(function(t){document.getElementById(t.id).addEventListener("click",function(t){e.svgElementClickHandler(t)}),t.id.match("btn-")})},e.prototype.renderSvg=function(){var e,t,n,r=this._svgElement,i=!(-1===this.el.className.indexOf("img-responsive"));if(r.getAttribute("viewBox")&&(e=r.getAttribute("viewBox")),e&&(t=e.split(" ")[2],n=e.split(" ")[3],!1===i)){this.el.style.width=t+"px",this.el.style.maxWidth=t+"px",this.el.style.height=n+"px",this.el.style.maxHeight=n+"px",r.style.width=t+"px",r.style.maxWidth=t+"px",r.style.height=n+"px",r.style.maxHeight=n+"px";var o=void 0;(o=document.createAttribute("width")).value=t,r.setAttributeNode(o),(o=document.createAttribute("height")).value=n,r.setAttributeNode(o)}},e.prototype.render=function(){var e=this;return this.dataJson&&(this.data=JSON.parse(this.dataJson)),this.src&&this.loadSvg().then(function(t){e.parseSvg(t)}),n("div",null,n("div",{class:"svg-container embedded"}))},Object.defineProperty(e,"is",{get:function(){return"ema-svg"},enumerable:!0,configurable:!0}),Object.defineProperty(e,"properties",{get:function(){return{data:{state:!0},dataJson:{type:"Any",attr:"data-json"},el:{elementRef:!0},getElements:{method:!0},src:{type:String,attr:"src"},svgResult:{state:!0},type:{type:String,attr:"type"}}},enumerable:!0,configurable:!0}),Object.defineProperty(e,"events",{get:function(){return[{name:"svgElementClick",method:"svgElementClick",bubbles:!0,cancelable:!0,composed:!0}]},enumerable:!0,configurable:!0}),e}();e.EmaSvg=r,Object.defineProperty(e,"__esModule",{value:!0})});