/**
 * Minified by jsDelivr using Terser v5.39.0.
 * Original file: /npm/fairybread@2.0.1/dist/fairybread.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
function Fairybread(e){function t(){var e="fairybread_",t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";return Array.apply(null,Array(20)).map((function(i,s){e+=t.charAt(Math.floor(62*Math.random()))})),e}void 0===e&&(e={global:!1,render:"head"}),this.options=e,this.sheetType=!0===e.global?"global":"local",this.ensureList={},this.id=t(),this.scopeClass=!0!==e.global?"."+this.id:"",this.createSheet=function(e){var t=document.createElement("style");return t.type="text/css",t.id=e,t},this.bindSheet=function(e,t){document[t].appendChild(e)},this.cssToJs=function(e){var t=e.split(";"),i={};return t.map((function(e,t){var s=e.split(":");2===s.length&&(i[s[0].trim().toString()]=s[1].trim())})),i},this.sheet=this.createSheet(this.id),this.specialSheet=!1,this.specialId=t()+"_special",this.rendered=!1,this.rules={},this.index=0,this.specialIndex=0,this.replaceHost=function(e,t){return e.split(":host").join(this.scopeClass)}}Fairybread.prototype.extend=function(e){return this.rules[e]},Fairybread.prototype.add=function(e,t){void 0===this.rules[e.toString()]?this.rules[e.toString()]={js:this.cssToJs(t),css:t}:console.error(e+" is ready in this style sheet")},Fairybread.prototype.render=function(e){var t,i=this.rules,s=this.sheet,r=this.bindSheet,n=this.scopeClass,a=Object.keys(i);function h(){var e="";return a.map((function(t){e+=n+" "+t+"{"+i[t].css+"}"})),e=e.replace(/(\r\n|\n|\r)/gm,"").trim()}switch(void 0!==e&&(this.options.render=e),this.options.render){case"raw":var o=h();this.sheet.innerHTML=o,t={js:i,css:o};break;case"here":s.innerHTML=h(),t={tag:this.sheet,id:this.id};break;case"body":r(s,"body"),s.innerHTML=h(),t=this.id;break;default:r(s,"head"),s.innerHTML=h(),t=this.id}return this.rendered=!0,t},Fairybread.prototype.addSpecial=function(e){var t=this.specialId;if(!1===this.specialSheet){var i=document.createElement("style");i.type="text/css",i.id=t,document.body.appendChild(i),this.specialSheet=document.getElementById(t),this.specialSheet.innerHTML=e}else this.specialSheet.innerHTML+="\n"+e},Fairybread.prototype.css=function(e){for(var t=this,i=[],s=1;s<arguments.length;s++)i[s-1]=arguments[s];var r=e.map((function(e,s){return t.replaceHost(e,t.scopedClass)+(i[s]||"")})).join("");this.sheet.innerHTML=r,this.rendered=!0;var n=this.sheet;if("raw"===this.options.render)n={css:r,id:this.id};else n=this.sheet;return n},Fairybread.prototype.ensure=function(e,t){var i=this.id,s=this.ensureList;if(!0!==s[e]){var r=!1;if([].slice.call(document.querySelectorAll("style[id*=fairybread_]")).map((function(t,i){t.id.indexOf(e)>-1&&(r=!0)})),!1===r){var n=i+"_"+e,a=this.createSheet(n);a.innerHTML='@import url("'+t+'")',this.bindSheet(a,"head"),s[e]=!0}}},"undefined"!=typeof module&&void 0!==module.exports?module.exports=Fairybread:window.Fairybread=Fairybread;
//# sourceMappingURL=/sm/173dd4426d86bfe6c563cd6a7c3e03a28a660fc2aa3151e67921743ca1bd9898.map