var __awaiter=this&&this.__awaiter||function(t,e,n,i){function r(t){return t instanceof n?t:new n((function(e){e(t)}))}return new(n||(n=Promise))((function(n,a){function o(t){try{c(i.next(t))}catch(e){a(e)}}function s(t){try{c(i["throw"](t))}catch(e){a(e)}}function c(t){t.done?n(t.value):r(t.value).then(o,s)}c((i=i.apply(t,e||[])).next())}))};var __generator=this&&this.__generator||function(t,e){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},i,r,a,o;return o={next:s(0),throw:s(1),return:s(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function s(t){return function(e){return c([t,e])}}function c(o){if(i)throw new TypeError("Generator is already executing.");while(n)try{if(i=1,r&&(a=o[0]&2?r["return"]:o[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,o[1])).done)return a;if(r=0,a)o=[o[0]&2,a.value];switch(o[0]){case 0:case 1:a=o;break;case 4:n.label++;return{value:o[1],done:false};case 5:n.label++;r=o[1];o=[0];continue;case 7:o=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!a||o[1]>a[0]&&o[1]<a[3])){n.label=o[1];break}if(o[0]===6&&n.label<a[1]){n.label=a[1];a=o;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(o);break}if(a[2])n.ops.pop();n.trys.pop();continue}o=e.call(t,n)}catch(s){o=[6,s];r=0}finally{i=a=0}if(o[0]&5)throw o[1];return{value:o[0]?o[1]:void 0,done:true}}};import{r as registerInstance,i as getAssetPath,h,e as Host}from"./index-15028158.js";import{f as factory}from"./index-8252ab58.js";var defaultIconCss="@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.sc-stencila-icon-default-h{--height:1.25em;--width:1.25em;color:currentColor;display:inline-block;line-height:1;vertical-align:middle}.sc-stencila-icon-default-h svg.sc-stencila-icon-default{fill:currentColor;display:block;height:auto;height:var(--height);max-height:100%;position:relative;width:100%;width:var(--width)}[icon^=loader].sc-stencila-icon-default-h svg.sc-stencila-icon-default{-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}";var iconMaterialCss="@-webkit-keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.sc-stencila-icon-material-h{--height:1.25em;--width:1.25em;color:currentColor;display:inline-block;line-height:1;vertical-align:middle}.sc-stencila-icon-material-h svg.sc-stencila-icon-material{fill:currentColor;stroke-linecap:butt;display:block;height:auto;height:var(--height);max-height:100%;position:relative;width:100%;width:var(--width)}[icon^=loader].sc-stencila-icon-material-h svg.sc-stencila-icon-material{-webkit-animation:spin 3s linear infinite;animation:spin 3s linear infinite}";var isFetchingIcons=false;var getGlobalIconStyle=function(){return document.getElementsByTagName("html")[0].getAttribute("data-icon-style")==="fill"?"fill":"line"};var Icon=function(){function t(t){var e=this;registerInstance(this,t);this.iconStyle=getGlobalIconStyle();this.fetchIcons=function(){return __awaiter(e,void 0,void 0,(function(){var t,e;return __generator(this,(function(n){switch(n.label){case 0:return[4,factory().url(getAssetPath("./assets/remixicon.symbol.svg")).options({credentials:"omit",mode:"cors"}).get().text()];case 1:t=n.sent();e=document.createElement("div");e.innerHTML=t;document.body.append(e);return[2]}}))}))}}t.prototype.componentWillLoad=function(){if(!isFetchingIcons){isFetchingIcons=true;this.fetchIcons().catch((function(t){console.log("Failed to load icons",t)}))}};t.prototype.render=function(){return h(Host,{icon:this.icon,"aria-hidden":"true"},h("svg",null,h("use",{href:"#ri-"+this.icon+(this.iconStyle!==undefined?"-"+this.iconStyle:"")})))};Object.defineProperty(t,"assetsDirs",{get:function(){return["assets"]},enumerable:false,configurable:true});return t}();Icon.style={default:defaultIconCss,material:iconMaterialCss};export{Icon as stencila_icon};
//# sourceMappingURL=stencila-icon.entry.js.map