UNPKG

nodality

Version:

A lightweight library for declarative UI elements.

2 lines 257 kB
/*! For license information please see elementMapper.cjs.js.LICENSE.txt */ (()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||s(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=s(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function s(t,e){if(t){if("string"==typeof t)return a(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function l(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,c(n.key),n)}}function c(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}t.r(e),t.d(e,{ElementMapper:()=>_n});var u=function(){return t=function t(){var e,r,n,i=this;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e=this,n=function(t){if(console.log("LOBJO IS"),console.log(t),t.transform||t.op&&t.op.transform){var e=t.transform;t.transform||(e=t.op.transform),e.duration||(e.duration="3s-ease-in-out"),i.setDefault=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0px";return 0===t.length?e+" ":t};var r=function(){var r="",n="",o="",s="",a="",l="",c="",u="",d="";if(0!==e.values.length){e.values.forEach((function(t){t.startsWith("tx:")&&(r=t.replace("tx:","")),t.startsWith("ty:")&&(n=t.replace("ty:","")),t.startsWith("tz:")?o=t.replace("tz:",""):t.startsWith("scale(")?s=t:t.startsWith("skew(")?a=t:t.startsWith("rotate(")?l=function(t){var e=t.match(/rotate\(([^)]+)\)/);if(!e)return t;var r=e[1].split(",").map((function(t){return t.trim()}));return 1===r.length?"rotate(".concat(r[0],")"):2===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],")"):3===r.length?"rotateX(".concat(r[0],") rotateY(").concat(r[1],") rotate(").concat(r[2],")"):t}(t):t.startsWith("perspective(")?c=t:t.startsWith("matrix(")?u=t:t.startsWith("opacity:")&&(d=t.replace("opacity:",""))})),r=i.setDefault(r),n=i.setDefault(n),o=i.setDefault(o);var h="";if("0px"!=n&&"0px"!=r&&"0px"!=o?h+="translate3d(".concat(r,", ").concat(n,", ").concat(o,")"):"0px"==n&&"0px"==r||(h+="translate(".concat(r,", ").concat(n,")")),s&&(h+=" ".concat(s)),l&&(h+=" ".concat(l)),a&&(h+=" ".concat(a)),c&&(h+=" ".concat(c)),u&&(h+=" ".concat(u)),h){if(t.op.transform.duration){var f=t.op.transform.duration.replace(/^(\d+)(s)-/,(function(t,e,r){return e/2+r+" "})),p="transform ".concat(f,", opacity ").concat(f);i.res.style.transition=p}else i.res.style.transition="transform 3s ease-in-out, opacity 3s ease-in-out";t.op.transform.static&&(i.res.style.transition=""),(i.blastTarget||i.res).style.transform=h,i.res.style.opacity=d}else alert("OPE")}};e.on?i.res.addEventListener(e.on,(function(){e.delay?setTimeout((function(){r()}),e.delay):r()})):window.addEventListener("load",(function(){e.delay?setTimeout((function(){r()}),e.delay):r()}));var n=function(){var t="";e.values.forEach((function(e){e.startsWith("tx:")?t+="translateX(0) ":e.startsWith("ty:")?t+="translateY(0) ":e.startsWith("tz:")?t+="translateZ(0) ":e.startsWith("scale(")?t+="scale(1) ":e.startsWith("skew(")?t+="skew(0, 0) ":e.startsWith("rotate(")?t+="rotate(0) ":e.startsWith("perspective(")?t+="perspective(0) ":e.startsWith("matrix(")&&(t+="matrix(1, 0, 0, 1, 0, 0) "),i.res.style.opacity="1"})),t&&(i.res.style.transform=t.trim())};if(e.on)i.res.addEventListener("mouseout",(function(){e.keep||n()}));else{var o=1e3*parseFloat(e.duration),s=e.closeAfter?e.closeAfter:0;setTimeout((function(){e.keep||n()}),o/2+s)}e.hardCSS&&(i.res.style.transform=e.hardCSS)}else alert("THIS FIRE WITH GRADIENT (invalid block"),console.log("INVALID BLOCKA"),console.log(t)},(r=c(r="reactOnTransform"))in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,this.state={isExpanded:!1,isMovedUp:!1,isMovedDown:!1}},e=[{key:"keySet",value:function(t){return this.temporaryVal=1,this.res.style[t.key]=t.value,this}},{key:"onScroll",value:function(t){var e=this;"opacity"===t.value?this.res.style.opacity=t.valMin:"scale"===t.value&&(this.res.style.transform="scale(".concat(t.valMax,")")),window.addEventListener("scroll",(function(){var r=e.smartRange(window.scrollY,{min:t.from,max:t.to},{min:t.valMin,max:t.valMax});"opacity"===t.value?e.res.style.opacity=r:"scale"===t.value&&(e.res.style.transform="scale(".concat(r,")"))}))}},{key:"setAny",value:function(t){this[Object.keys(t)[0]]=[Object.values(t)[0]]}},{key:"setID",value:function(t){this.id=t}},{key:"setPrevText",value:function(t){this.prevText=t}},{key:"getCSS",value:function(){return this.css}},{key:"getPX",value:function(t){return{xs:"0px",sm:"576px",md:"768px",lg:"992px",xl:"1200px",xxl:"1400px",mxxl:"1800px"}[t]||"Invalid breakpoint"}},{key:"respad",value:function(t){var e=this,r=function(){e.pad(t[0].values);for(var r=0;r<t.length;r++){var n=t[r].breakpoint;window.matchMedia("(min-width: ".concat(e.getPX(n))).matches&&e.pad(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resmar",value:function(t){var e=this,r=function(){e.mar(t[0].values);for(var r=0;r<t.length;r++){var n=t[r].breakpoint;window.matchMedia("(max-width: ".concat(e.getPX(n))).matches&&e.mar(t[r].values)}};window.addEventListener("resize",r),r()}},{key:"resprop",value:function(t){var e=this;console.log("RES STYLE"),console.log(t),this.prevStyles={};for(var r=0;r<this.res.style.length;r++){var n=this.res.style[r];this.prevStyles[n]=this.res.style[n],console.log("kio")}var i=function(){for(var r in e.prevStyles)e.res.style[r]=e.prevStyles[r];console.log("mkio");for(var n=0;n<t.length;n++){var i=t[n].breakpoint,o="(max-width: ".concat(i,")");if(console.log("testing media query:",o,window.matchMedia(o).matches),window.matchMedia(o).matches)for(var s in t[n])"breakpoint"!==s&&(console.log("ukio"),e.res.style[s]=t[n][s])}};window.addEventListener("resize",i),i()}},{key:"isNumber",value:function(t){return"number"==typeof t&&!isNaN(t)}},{key:"pad",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),n=0;n<r.length;n++)for(var i=r[n],o=t[e][i],s=0;s<i.length;s++)switch(i[s]){case"a":this.res.style.padding=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.paddingTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.paddingLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.paddingRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.paddingBottom=this.isNumber(o)?"".concat(o,"px"):o}return this}},{key:"as",value:function(t){return this.res.style.alignSelf=t,this}},{key:"mar",value:function(t){for(var e=0;e<t.length;e++)for(var r=Object.keys(t[e]),n=0;n<r.length;n++)for(var i=r[n],o=t[e][i],s=0;s<i.length;s++){switch(i[s]){case"a":this.res.style.margin=this.isNumber(o)?"".concat(o,"px"):o;break;case"t":this.res.style.marginTop=this.isNumber(o)?"".concat(o,"px"):o;break;case"l":this.res.style.marginLeft=this.isNumber(o)?"".concat(o,"px"):o;break;case"r":this.res.style.marginRight=this.isNumber(o)?"".concat(o,"px"):o;break;case"b":this.res.style.marginBottom=this.isNumber(o)?"".concat(o,"px"):o}"auto"===i[s]&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto")}return this}},{key:"smartRange",value:function(t,e,r){t<e.min&&(t=e.min),t>e.max&&(t=e.max);var n=(t-e.min)/(e.max-e.min);e.min>e.max&&(n=(t-e.max)/(e.min-e.max));var i=(r.min-r.max)*n-r.min;if(i=Math.abs(i),r.min<r.max){var o=(r.max+Math.abs(r.min))*n;i=r.min+o}return i}},{key:"gpos",value:function(t){return this.res.style.gridColumn=t.col,this.res.style.gridRow=t.row,this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"setIndex",value:function(t){this.index=t}},{key:"borderObj",value:function(t){var e,r=null!==(e=t.type)&&void 0!==e?e:"solid";return this.res.style.border="".concat(t.width," ").concat(r," ").concat(t.color),this.res.style.borderRadius=t.radius,this}},{key:"setPref",value:function(t){this.preffersId=t}},{key:"setClass",value:function(t){this.class=t}},{key:"setTags",value:function(t){this.openTag=t.open,this.closeTag=t.close,console.log("TAGS SET"),console.log(t)}},{key:"chainReact",value:function(t,e,r){var i=this;console.log("0P"),this.ap=!1,this.cta=0,this.once=!1;var s,a=o(t);try{for(a.s();!(s=a.n()).done;){var l=s.value;l.range||(l.range=["0px","999999px"])}}catch(t){a.e(t)}finally{a.f()}t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var c=function(s){var a=window.visualViewport.width,l=[],c=[];i.resCopy=i.res,i.storedQueries=t.map((function(t){return t.target})).filter((function(t){return null!=t}));var u,d=o(t);try{for(d.s();!(u=d.n()).done;){var h=u.value;i.counterIndex++;var f=n(h.range,2),p=f[0],y=f[1],m=parseInt(p),v=parseInt(y),g=!0;if(h.target){g=!1;for(var b=0;b<h.target.length;b++)h.target[b]===e&&(g=!0)}a>=m&&a<=v&&g&&(l.push(h.log),c.push(h),h.op&&h.op.margin&&(i.useMargin=h.op.margin))}}catch(t){d.e(t)}finally{d.f()}if(r&&!r.includes("background")&&(i.res.style.background="",i.res.style.backgroundColor=""),i.res.style.textShadow="",r&&!r.includes("border")&&(i.res.style.border=""),r&&!r.includes("margin")&&(i.res.style.margin=""),i.res.style["-webkit-text-fill-color"]="",i.res.style["-webkit-text-stroke-color"]="",i.res.style["-webkit-text-stroke-width"]="",i.res.style.filter="",i.options.background&&(console.log(i.options.background),i.res.style.background=i.options.background),l.includes("gradient"),(l.includes("gradient")||l.includes("shadow"))&&(i.res.style.position="relative"),l.includes("blast")){var w,k=c.filter((function(t){return"blast"===t.log}))[0].op.color,x=null!==(w=c.filter((function(t){return"blast"===t.log}))[0].op.width)&&void 0!==w?w:"1px";"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?(i.res.style.border="".concat("number"==typeof x?x+"px":x," solid orange"),i.res.style.display="inline-block","FlexRowLayoutElement"===i.getType()&&(i.res.style.display="flex"),i.res.style.boxSizing="border-box",i.res.style.transformOrigin="center",i.blastTarget=i.res):(i.text&&(i.res.textContent=i.text),i.res.style["-webkit-text-fill-color"]="transparent",i.res.style["-webkit-text-stroke-color"]=k,i.res.style["-webkit-text-stroke-width"]="".concat(x))}if(l.includes("filter")){var S=c.filter((function(t){return"filter"===t.log}))[0].op.filter;i.res.style.filter=S}if(l.includes("background")&&(i.res.style.backgroundColor="green"),l.includes("gradient")&&("LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["-webkit-text-fill-color"]="transparent"),i.res.style.background=i.globalGradient,"LayoutWrapperElement"!==i.getType()&&"FlexRowLayoutElement"!==i.getType()&&(i.res.style["background-clip"]="text")),l.includes("shadow")){var O,j="",C=0;for(b=0;b<i.options.shadow.op.steps;b++){var E;j+="drop-shadow(".concat(C+=3,"px ").concat(C,"px ").concat(C,"px ").concat(null!==(E=i.options.shadow.color)&&void 0!==E?E:"gray",") ")}"FlexRowLayoutElement"===i.getType()||"LayoutWrapperElement"===i.getType()?i.res.style.boxShadow="".concat(C,"px ").concat(C,"px ").concat(C,"px ").concat(null!==(O=i.options.shadow.color)&&void 0!==O?O:"gray"):i.res.style.filter=j}if(l.includes("margin"))for(b=0;b<t.length;b++)if(t[b].op){var P=t[b].op.offsets;P&&void 0!==i.index&&(i.res.style.margin=P[Number(i.index)]+"px")}if(l.includes("spana")||l.includes("span")){if(i.res=i.resCopy,i.options.span){var T;for(T=Array.isArray(i.options.span)?i.options.span.filter((function(t){return"span"===t.op.name}))[0]:i.options.span,i.res.textContent="",b=0;b<T.op.parts.length;b++){var A=T.op.parts[b].style,R=new i.constructor(T.op.parts[b].text).setup({type:"span"}).set(A).render();i.res.appendChild(R)}}}else{var L=new i.constructor(i.prevText).set({}).render();i.prevText&&i.prevText.length>0&&s&&i.res.appendChild(L)}if(l.includes("animation")){if(i.options.animation&&!i.hasAnimated&&!i.options.animation.op.fireAt){console.warn(i.openTag),i.hasAnimated=!0;var z=i.options.animation.op;window.addEventListener("sidebar:open",(function(){i.res.animate(z.keyframesOpen,z.openOptions)})),window.addEventListener("sidebar:closed",(function(){i.res.animate(z.keyframesClose,z.closeOptions)})),i.res.animate(z.keyframesClose,{duration:0,fill:"forwards"}),i.openTag&&i.closeTag&&(window.addEventListener(i.openTag,(function(){i.res.animate(z.keyframesOpen,z.openOptions)})),window.addEventListener(i.closeTag,(function(){i.res.animate(z.keyframesClose,z.closeOptions)})))}if(i.options.animation&&i.options.animation.op.fireAt&&i.options.animation.op.fireAt.endsWith("px")){var M=i.options.animation.op;i.res.animate(M.keyframesClose,{duration:0,fill:"forwards"});var I=function(){window.scrollY>parseFloat(M.fireAt)&&(i.res.animate(M.keyframesOpen,M.openOptions),window.removeEventListener("scroll",I))};window.addEventListener("scroll",I)}if(i.options.animation&&i.options.animation.op.fireAt&&"inview"===i.options.animation.op.fireAt){var _=i.options.animation.op;i.res.animate(_.keyframesClose,{duration:0,fill:"forwards"}),new IntersectionObserver((function(t,e){t.forEach((function(t){t.isIntersecting&&(i.res.animate(_.keyframesOpen,_.openOptions),e.disconnect())}))})).observe(i.res)}}};this.options.animation||window.addEventListener("resize",(function(){return c()})),c()}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"arrayMargin",value:function(t,e){return t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),t.includes("all")&&(this.res.style.margin=e),e||(this.res.style.marginBottom=t),this}}],e&&l(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e}();function d(t){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},d(t)}function h(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||f(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(t,e){if(t){if("string"==typeof t)return p(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function p(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function y(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function m(t){var e=function(t){if("object"!=d(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==d(e)?e:e+""}function v(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(v=function(){return!!t})()}function g(t,e,r,n){var i=b(w(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function b(){return b="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=w(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},b.apply(null,arguments)}function w(t){return w=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},w(t)}function k(t,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},k(t,e)}var x=function(t){function e(t,r){var n;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(n=function(t,e,r){return e=w(e),function(t,e){if(e&&("object"==d(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,v()?Reflect.construct(e,r||[],w(t).constructor):e.apply(t,r))}(this,e)).text=t,n.res=null,n.setup(r),n.code=[],n.elCSS=[],n.html=[],n.react=[],n.code.push('new Text("'.concat(n.text,'")')),console.log("AAAAA"),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&k(t,e)}(e,t),r=e,n=[{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"setArea",value:function(t){return this.res.style.gridArea=t,this}},{key:"toCodea",value:function(){return this.excludeFromCodeTrue&&(this.code=[""]),this.code}},{key:"toCode",value:function(){if(this.excludeFromCodeTrue)return[""];var t=Object.fromEntries(Object.entries(this.options).filter((function(t){var e=h(t,2);return e[0],null!==e[1]}))),e=JSON.stringify(t,null,4).replace(/"([^"]+)":/g,"$1:");return['new Text("'.concat(this.text,'").set(').concat(e,")")]}},{key:"toCSS",value:function(){return this.css}},{key:"toHTMLA",value:function(){return this.html}},{key:"toElCSS",value:function(){return this.elCSS=this.elCSS.map((function(t){return" "+t})),this.preffersId?this.elCSS.unshift(this.res.id+" { \n"):this.elCSS.unshift("."+this.class+" { \n"),this.elCSS.push(" } \n \n"),this.elCSS}},{key:"getType",value:function(){return"S1"===this.options.fluidc?"HTMLHeaderElement":"HTMLParagraphElement"}},{key:"gradientOptions",value:function(t){var e=this;if(0===t.length)return this;var r=t.filter((function(t){return"gradient"===t.op.name}))[0];if(void 0===r)return this;var n=r.op;if(r.point){var i=function(){window.matchMedia("(min-width: ".concat(r.range[0],") and (max-width: ").concat(r.range[1],")")).matches&&(e.prevBackground=e.res.style.color.toString(),e.res.style.background=n.gradient,e.res.style.WebkitBackgroundClip="text")};i(),window.addEventListener("resize",i)}}},{key:"strokeOptions",value:function(t){var e=this;if(0===t.length)return this;var r=t.filter((function(t){return"blast"===t.op.name}))[0];if(void 0===r)return this;console.log("DEL");var n=r.op;if(r.point){var i=function(){window.matchMedia("(min-width: ".concat(r.range[0],") and (max-width: ").concat(r.range[1],")")).matches&&(n.color?e.res.style["-webkit-text-stroke"]="".concat(n.width?n.width:"1px"," ").concat(n.color):e.res.style["-webkit-text-stroke"]="1px orange",e.res.style["-webkit-text-fill-color"]="transparent")};i(),window.addEventListener("resize",i)}else n.color&&(this.res.style["-webkit-text-stroke"]="".concat(n.width?n.width:"1px"," ").concat(n.color)),this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"stroke",value:function(){return this.res.style["-webkit-text-stroke"]="3px orange",this}},{key:"fill",value:function(){return this.res.style["-webkit-text-fill-color"]="transparent",this}},{key:"rowCol",value:function(t,e){return this.res.style.gridRow=t,this.res.style.gridColumn=e,this}},{key:"setGridRow",value:function(t){return this.res.style.gridRow=t,this}},{key:"setGridCol",value:function(t){return this.res.style.gridColumn=t,this}},{key:"toHTML",value:function(){return this.res}},{key:"onTap",value:function(t){return this.res.addEventListener("click",t),this}},{key:"setClass",value:function(t){return this.res.setAttribute("class",t),this}},{key:"setRandom",value:function(){for(var t="LAYOUT-",e=90;e>0;--e)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return t+=(new Date).getTime(),this.res.setAttribute("class",t),this}},{key:"styled",value:function(t){return this.set(t),this}},{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"set",value:function(t){return this.resCopy=this.res,this.options=t,g(e,"setPrevText",this,3)([this.text]),t.top&&(this.res.style.top=t.top),t.left&&(this.res.style.left=t.left),t.flex&&(this.res.style.display="flex"),(t.left||t.top)&&(this.res.style.position="absolute"),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.cursor&&(this.res.style.cursor="hand"),t.gpos&&this.gpos(t.gpos),t.vtn&&(this.res.style.viewTransitionName=t.vtn),t.index&&g(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.preffersId&&(this.preffersId=t.preffersId),g(e,"setPref",this,3)([t.preffersId]),t.removeDecoration&&(this.res.style.textDecoration="none"),t.block&&(this.res.style.display="block"),t.area&&this.setArea(t.area),t.icon&&this.addIcon(t.icon),t.color&&this.color(t.color),t.color&&this.elCSS.push("color: ".concat(t.color,"; \n")),t.class&&this.setClass(t.class),t.size&&this.fluidCopy(t.size),t.fluidc&&this.fluidCopy(t.fluidc),t.initLetter&&this.initLetter(t.initLetter),t.onTap&&this.onTap(t.onTap),"S6"===t.fluidc?t.fluidc&&this.elCSS.push("font-size: calc(1.1rem + 2.075vw); \n"):t.fluidc&&this.elCSS.push("font-size: calc(1.625rem + 5.075vw); \n"),this.options.id&&this.res.setAttribute("id",this.options.id),g(e,"setID",this,3)([this.options.id]),this.options.class&&this.res.setAttribute("class",this.options.class),g(e,"setClass",this,3)([this.options.class]),t.clampc&&this.clampCopy(t.clampc),t.arrpad&&this.arrayPadding(t.arrpad.sides,t.arrpad.value),t.pad&&this.pad(t.pad),t.respad&&this.respad(t.respad),t.resmar&&this.resmar(t.resmar),t.mar&&this.mar(t.mar),t.exact&&(this.res.style.fontSize=t.exact),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.absolute&&(this.res.style.position="absolute"),t.arrayMargin&&this.arrayMargin(t.arrayMargin.sides,t.arrayMargin.value),t.em&&this.em(t.em),t.fluid&&this.fluid(t.fluid),t.font&&this.font(t.font),t.fluidc&&this.elCSS.push("font-family: ".concat(t.font,"; \n")),t.align&&(this.res.style.textAlign=t.align),t.weight&&(this.res.style.fontWeight=t.weight),t.padding&&this.padding(t.padding),t.breakWord&&(this.res.style.wordWrap="break-word"),t.center&&(this.res.style.marginRight="auto"),t.center&&(this.res.style.marginLeft="auto"),t.width&&(this.res.style.width=t.width),t.height&&(this.res.style.height=t.height),t.background&&(this.res.style.backgroundColor=t.background),t.radius&&(this.res.style.borderRadius=t.radius),t.resprop&&this.resprop(t.resprop),t.italic&&this.italic(),t.responsive&&this.responsive(),t.border&&(this.res.style.border="".concat(t.border)),t.onScroll&&this.onScroll(t.onScroll),t.keySet&&this.keySet(t.keySet),t.maxHeight&&(this.res.style.maxHeight=t.maxHeight),t.transform&&(console.warn("ARE DIFFERENT OBJS HERE?"),console.warn(t.transform)),t.transform&&this.reactOnTransform(t.transform),console.log("OGA"),console.log(t),this.callReact(t),this}},{key:"callReact",value:function(t){var r=[];if(t.stroke||t.gradient||t.span||t.backgroundOp||t.layout||t.shadow||t.animation||t.filtera||t.transform){t.gradient&&(this.globalGradient=t.gradient.op.gradient,"radial"===t.gradient.op.direction&&(this.globalGradient="radial-gradient(circle at center, orange, green)")),t.stroke&&g(e,"setAny",this,3)([{globalBlast:"".concat(t.stroke.op.width," ").concat(t.stroke.op.color)}]),t.span&&(t.span.prevText=this.text);var n=[t.stroke,t.gradient,t.animation,t.span,t.backgroundOp,t.layout,t.marginOp,t.shadow,t.animation,t.filtera,t.transform];n=n.filter((function(t){return null!=t}));for(var i=0;i<n.length;i++)r.push({range:n[i].range,log:n[i].op.name,target:n[i].target,op:n[i].op});var o=[];t.borderObj&&o.push("border"),t.background&&o.push("background"),t.mar&&o.push("margin"),t.animation&&o.push("animation"),t.span&&o.push("span"),console.log("ARA IS "),console.log(r),this.chainReact(r,this.options.id,o)}}},{key:"excludeFromCode",value:function(){return this.excludeFromCodeTrue=!0,this}},{key:"addIcon",value:function(t){var e=document.createElement("img");return e.style.width="20px",e.style.marginLeft="10px",e.style.height="auto",e.setAttribute("src",t.url),this.res.appendChild(e),this}},{key:"checkForAnimation",value:function(t){t.sort((function(t,e){return parseInt(t.range[0])-parseInt(e.range[0])}));var e,r=window.innerWidth,n=function(t){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=f(t))){e&&(t=e);var r=0,n=function(){};return{s:n,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=!0,s=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return o=t.done,t},e:function(t){s=!0,i=t},f:function(){try{o||null==e.return||e.return()}finally{if(s)throw i}}}}(t);try{for(n.s();!(e=n.n()).done;){var i=e.value,o=h(i.range,2),s=o[0],a=o[1],l=parseInt(s),c=parseInt(a);r>=l&&r<=c&&"animation"===i.log&&this.res.animate([{opacity:0,transform:"translateY(100px)"},{opacity:1,transform:"translateY(0)"}],{duration:1e3,easing:"ease"})}}catch(t){n.e(t)}finally{n.f()}}},{key:"resetSmall",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"resetGradient",value:function(){return this.res.style.WebkitBackgroundClip="text",this.res.style.background="transparent",this}},{key:"resetStroke",value:function(){this.res.style["-webkit-text-stroke"]="",this.res.style["-webkit-text-fill-color"]=""}},{key:"innerStroke",value:function(t){t.color?this.res.style["-webkit-text-stroke"]="".concat(t.width?t.width:"1px"," ").concat(t.color):this.res.style["-webkit-text-stroke"]="1px orange",this.res.style["-webkit-text-fill-color"]="transparent"}},{key:"innerGradient",value:function(t){this.res.style.background="linear-gradient(45deg, #ff0000, #00ff00)",this.res.style["-webkit-background-clip"]="text"}},{key:"arrayMargin",value:function(t,e){return e||(this.res.style.marginLeft="".concat(t[0],"px"),this.res.style.marginTop="".concat(t[1],"px"),this.res.style.marginRight="".concat(t[2],"px"),this.res.style.marginBottom="".concat(t[3],"px")),t.includes("left")&&(this.res.style.marginLeft=e),t.includes("right")&&(this.res.style.marginRight=e),t.includes("top")&&(this.res.style.marginTop=e),t.includes("bottom")&&(this.res.style.marginBottom=e),e||(this.res.style.marginBottom=t),this}},{key:"clampExperiment",value:function(){return this.res.style.fontSize="clamp(1rem, calc(1rem * 10rem), 3rem)",this}},{key:"between",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"betweenCopy",value:function(t){return"S1"===t&&(this.res.style.fontSize="clamp(2rem, 8vw, 2.5rem)"),"S2"===t&&(this.res.style.fontSize="clamp(4rem, 8vw, 5rem)"),"S3"===t&&(this.res.style.fontSize="clamp(2rem, 5vw, 2.5rem)"),"S4"===t&&(this.res.style.fontSize="clamp(1.5rem, 2vw, 1.6rem)"),"S5"===t&&(this.res.style.fontSize="clamp(1.2rem, 2vw, 1.3rem)"),"S6"===t&&(this.res.style.fontSize="clamp(1rem, 2vw, 1.3rem)"),this}},{key:"stringGen",value:function(t){for(var e="",r=0;r<t;r++)e+="abcdefghijklmnopqrstuvwxyz".charAt(Math.floor(26*Math.random()));return e}},{key:"initLetter",value:function(t){var e=document.createElement("style");document.body.appendChild(e),Math.random();var r=this.stringGen(1e3);return this.res.setAttribute("id",r),document.styleSheets[0].insertRule("#".concat(r,"::first-letter { color: green; font-size: 3em; padding: 0.1em }"),0),this}},{key:"constant",value:function(t){return"S1"===t&&this.jumbotron(),"S2"===t&&this.large(),"S3"===t&&this.medium(),this}},{key:"minusMargin",value:function(){return this.res.style.marginRight="-3.1em",this}},{key:"fluid",value:function(t){if("S1"===t){this.res=document.createElement("h1");var e=document.createTextNode(this.text);this.res.appendChild(e),this.res.style.fontSize="calc(1.625rem + 4.3vw)"}if("S2"===t){this.res=document.createElement("h2");var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.525rem + 3.525vw)"}if("S3"===t){this.res=document.createElement("h3");var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.375rem + 2.75vw)"}if("S4"===t){this.res=document.createElement("h4");var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.275rem + 1.975vw)"}return"S5"===t&&(this.res.style.fontSize="calc(1.1rem + 1.2vw)"),this}},{key:"getClampValue",value:function(t){return"S7"===t?"clamp(1.45rem, 2vw + 1.5rem, 1.69rem)":"S6"===t?"clamp(2.25rem, 2vw+1.5rem, 3.25rem)":"S5"===t?"clamp(2.75rem, 2vw + 1.5rem, 3.25rem)":"S4"===t?"clamp(3.5rem, 2vw + 1.5rem, 3.25rem)":"S3"===t?"clamp(4.25rem, 2vw + 1.5rem, 3.25rem)":"S2"===t?"clamp(5rem, 2vw + 1.5rem, 3.25rem)":"S1"===t?"clamp(6rem, 2vw + 1.5rem, 3.25rem)":void 0}},{key:"clampCopy",value:function(t){return this.res.style.fontSize=this.getClampValue(t),this}},{key:"fluidCopy",value:function(t){if(t instanceof Object){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var e=document.createTextNode(this.text);return this.res.appendChild(e),this.res.style.fontSize=t.exact,this}if("S1"===t){this.prevStylex=this.res.style,this.res=document.createElement("h1"),this.res.style.cssText=this.prevStylex.cssText;var r=document.createTextNode(this.text);this.res.appendChild(r),this.res.style.fontSize="calc(1.625rem + 5.075vw)"}if("S2"===t){this.prevStylex=this.res.style,this.res=document.createElement("h2"),this.res.style.cssText=this.prevStylex.cssText;var n=document.createTextNode(this.text);this.res.appendChild(n),this.res.style.fontSize="calc(1.500rem + 4.3vw)"}if("S3"===t){this.prevStylex=this.res.style,this.res=document.createElement("h3"),this.res.style.cssText=this.prevStylex.cssText;var i=document.createTextNode(this.text);this.res.appendChild(i),this.res.style.fontSize="calc(1.375rem + 3.525vw)"}if("S4"===t){this.prevStylex=this.res.style,this.res=document.createElement("h4"),this.res.style.cssText=this.prevStylex.cssText;var o=document.createTextNode(this.text);this.res.appendChild(o),this.res.style.fontSize="calc(1.250rem + 2.75vw)"}if("S5"===t){this.prevStylex=this.res.style,this.res=document.createElement("h5"),this.res.style.cssText=this.prevStylex.cssText;var s=document.createTextNode(this.text);this.res.appendChild(s),this.res.style.fontSize="calc(1.125rem + 1.975vw)"}return"S6"===t&&(this.options&&!1===this.options.preffersId?this.html.push('<p class="'.concat(this.options.class,'">').concat(this.text,"</p> \n \n")):this.options&&this.options.id&&this.html.push('<p id="'.concat(this.options.id.substr(1),'">').concat(this.text,"</p> \n \n")),this.res.style.fontSize="calc(1rem + 0.5vw)"),this}},{key:"toReactComponent",value:function(){return this.react.push("function Godzilla() { \n"),this.react.push('return <h1 class="'.concat(this.options.class,'">').concat(this.text,"</h1> \n")),this.react.push("} \n \n"),this.react}},{key:"myself",value:function(t){var e=this,r=function(){window.matchMedia("(max-device-width: 415px)").matches?e.res.style.fontSize=t.desktop:e.res.style.fontSize=t.phone};return r(),window.addEventListener("resize",r),this}},{key:"jumbotron",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="8rem":t.res.style.fontSize="6rem"};return e(),window.addEventListener("resize",e),this}},{key:"large",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="7rem":t.res.style.fontSize="5rem"};return e(),window.addEventListener("resize",e),this}},{key:"frame",value:function(t){return this.res.style.width=t.width,this.res.style.height=t.height,this}},{key:"vw",value:function(t,e,r){}},{key:"responsive",value:function(t){var e=this;this.set=!1,this.setB=!1;var r=function(){window.innerWidth<t.minw?(e.setB=!1,e.set||(e.res.style.color="#3498db",e.res.style.fontSize="".concat(t.baseVW/100*window.innerWidth,"px"),e.set=!0)):window.innerWidth>t.maxw?(e.set=!1,e.setB||(e.res.style.color="orange",e.res.style.fontSize="".concat(t.baseVW/100*t.maxw,"px"),e.setB=!0)):(e.set=!1,e.setB=!1,e.res.style.color="black",e.res.style.fontSize="".concat(t.baseVW,"vw"))};return r(),window.addEventListener("resize",r),this}},{key:"xlarge",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="6.5rem":t.res.style.fontSize="8.5rem"};return e(),window.addEventListener("resize",e),this}},{key:"medium",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2.25rem":t.res.style.fontSize="1.5em"};return e(),window.addEventListener("resize",e),this}},{key:"auto",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="2rem":t.res.style.fontSize="1rem"};return e(),window.addEventListener("resize",e),this}},{key:"small",value:function(){var t=this,e=function(){window.matchMedia("(max-device-width: 415px)").matches?t.res.style.fontSize="1.5em":t.res.style.fontSize="1em"};return e(),window.addEventListener("resize",e),this}},{key:"sizes",value:function(t){var e=this;this.res.style.fontSize="".concat(t[0].size,"rem");var r=function(){for(var r=0;r<t.length;r++)t[r].width&&window.matchMedia("(min-width: ".concat(t[r].width,"px)")).matches&&(e.res.style.fontSize="".concat(t[r].size));window.matchMedia("(max-device-width: 415px)").matches&&(e.res.style.fontSize="".concat(t[t.length-1].mobile))};return r(),window.addEventListener("resize",r),this}},{key:"setup",value:function(t){var e;t?((e=document.createElement(t.type)).setAttribute("id",t.id),t.type):e=document.createElement("p");var r=document.createTextNode(this.text);return e.appendChild(r),this.res=e,this.res.style.padding=0,this.res.style.margin=0,this}},{key:"hide",value:function(){return this.res.style.visibility="hidden",this}},{key:"font",value:function(t){return this.res.style.fontFamily=t,this}},{key:"center",value:function(){return this.res.style.textAlign="center",this}},{key:"size",value:function(t){return this.res.style.fontSize=t,this}},{key:"em",value:function(t){return this.res.style.fontSize="".concat(t,"em"),this}},{key:"color",value:function(t){return this.res.style.color=t,this}},{key:"align",value:function(t){return this.res.style.textAlign="".concat(t),this}},{key:"weight",value:function(t){return this.res.style.fontWeight=t,this}},{key:"bold",value:function(){return this.res.style.fontWeight="bold",this}},{key:"italic",value:function(){return this.res.style.fontStyle="italic",this}},{key:"width",value:function(t,e){return this.res.style.width=t,e&&(this.res.style.marginLeft="auto",this.res.style.marginRight="auto"),this}},{key:"offset",value:function(t){return this.res.style.gridRow=2,this.res.style.gridColumn=2,this.res.style.marginLeft="-60px",this}},{key:"border",value:function(t,e){return this.res.style.border="".concat(e,"px solid ").concat(t),this}},{key:"padding",value:function(t,e,r,n){return(t||e||r||n)&&(this.res.style.paddingLeft=t,this.res.style.paddingTop=e,this.res.style.paddingRight=r,this.res.style.paddingBottom=n),e||r||n||(this.res.style.padding=t),this}},{key:"arrayPadding",value:function(t,e){return t.includes("left")&&(this.res.style.paddingLeft=e),t.includes("right")&&(this.res.style.paddingRight=e),t.includes("top")&&(this.res.style.paddingTop=e),t.includes("bottom")&&(this.res.style.paddingBottom=e),e||(this.res.style.paddingBottom=t),this}},{key:"margin",value:function(t,e){return"top"==t?this.res.style.marginTop=e:"bottom"==t?this.res.style.marginBottom=e:"left"==t?this.res.style.marginLeft=e:"right"==t&&(this.res.style.marginRight=e),this}},{key:"headline",value:function(){return this.em(4),this.font("Arial"),this.bold(),this}},{key:"caption",value:function(){return this.bold(),this.res.style.fontFamily="Arial",this.color("gray"),this.padding("top",20),this.res.style.fontSize="1em",window.matchMedia("(max-device-width: 415px)").matches?this.res.style.fontSize="2em":this.res.style.fontSize="1em",this}},{key:"updating",value:function(t,e){var r=this.res,n=this.text;return Object.defineProperty(t,e,{set:function(t){var e=document.createTextNode(n.replace("$",t));r.replaceChild(e,r.childNodes[0])}}),this}},{key:"style",value:function(t){return this.res.style.color=t.styles.color,this.res.style.fontWeight=t.styles.fontWeight,this.res.style.paddingLeft=t.styles.padding[0],this.res.style.paddingTop=t.styles.padding[1],this.res.style.paddingRight=t.styles.padding[2],this.res.style.paddingBottom=t.styles.padding[3],this.res.style.marginLeft=t.styles.margin[0],this.res.style.paddingTop=t.styles.margin[1],this.res.style.paddingRight=t.styles.margin[2],this.res.style.paddingBottom=t.styles.margin[3],this.res.style.opacity=t.styles.opacity,this}},{key:"applyStyle",value:function(t,e){return window.matchMedia("(max-width: ".concat(t,"px)")).matches&&Object.assign(this.res.style,e.styles),this}},{key:"nextApply",value:function(t){for(var e=this,r=[],n=(this.res.style,function(n){r[0].matches?Object.assign(e.res.style,t[0].styles):r[1].matches?Object.assign(e.res.style,t[1].styles):Object.assign(e.res.style,t[t.length-1].styles)}),i=0;i<t.length;i++){var o=t[i],s=window.matchMedia("(min-width: ".concat(o.min,"px) and (max-width: ").concat(o.max,"px)"));r.push(s),r[i].addListener(n)}return n(),this}},{key:"apply",value:function(t){var e=this,r=this.res.styles,n=function(){for(var n=0;n<t.length;n++){var i=t[n];i.min&&i.max?window.matchMedia("(min-width: ".concat(i.min,"px) and (max-width: ").concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):(alert("YES min max, but does not match"),Object.assign(e.res.style,r)):window.matchMedia("(max-width: ".concat(i.max,"px)")).matches?Object.assign(e.res.style,i.styles):(alert("NO min max, and does not match"),Object.assign(e.res.style,r))}};return n(),window.addEventListener("resize",n),this}},{key:"render",value:function(t){if(!t)return this.options&&!this.options.span&&(this.res.textContent=this.text),this.res;this.options&&this.options.id&&this.res.setAttribute("id",this.options.id),this.options&&!this.options.span&&(this.res.textContent=this.text),document.querySelector(t).appendChild(this.res)}}],n&&y(r.prototype,n),Object.defineProperty(r,"prototype",{writable:!1}),r;var r,n}(u);function S(t){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},S(t)}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function j(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,C(n.key),n)}}function C(t){var e=function(t){if("object"!=S(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var r=e.call(t,"string");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==S(e)?e:e+""}function E(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(t){}return(E=function(){return!!t})()}function P(t,e,r,n){var i=T(A(1&n?t.prototype:t),e,r);return 2&n&&"function"==typeof i?function(t){return i.apply(r,t)}:i}function T(){return T="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,r){var n=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=A(t)););return t}(t,e);if(n){var i=Object.getOwnPropertyDescriptor(n,e);return i.get?i.get.call(arguments.length<3?t:r):i.value}},T.apply(null,arguments)}function A(t){return A=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},A(t)}function R(t,e){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},R(t,e)}var L=function(t){function e(t,r,n,i){var o;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(o=function(t,e,r){return e=A(e),function(t,e){if(e&&("object"==S(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,E()?Reflect.construct(e,r||[],A(t).constructor):e.apply(t,r))}(this,e)).url=t,o.res=null,o.code=[],o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&R(t,e)}(e,t),r=e,n=[{key:"removeQuotesFromFirstWord",value:function(t){return t.replace(/"([^"]+)":/g,"$1:")}},{key:"setType",value:function(t){t.url;var e=t.type,r=t.mode;if(this.code=[],"exact"===e){var n='new Image("'.concat(this.url,'", "exact")');this.code.push(n)}else if("uncover"===e){var i='new Image("'.concat(this.url,'", "uncover")');this.code.push(i)}else this.code.push("new Image('".concat(this.url,"')"));return this.image(this.url,r,e),this}},{key:"flexOne",value:function(){return this.res.style.flex="1",this}},{key:"hand",value:function(){return this.res.style.cursor="hand",this}},{key:"setGridWithoutCode",value:function(){return this.res.style.border="1px solid white",this}},{key:"maxWidth",value:function(t){return this.res.style.maxWidth=t,this}},{key:"getHeight",value:function(){return this.res.height}},{key:"getWidth",value:function(){return this.res.width}},{key:"getType",value:function(){return"HTMLImageElement"}},{key:"toCode",value:function(){var t=this.options;this.res.style.border&&(t.border=this.res.style.border);var e=Object.fromEntries(Object.entries(t).filter((function(t){var e=function(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(t){c=!0,i=t}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return O(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}(t,2);return e[0],null!==e[1]})));return["new Image().set(".concat(JSON.stringify(e,null,2).replace(/"(\w+)"\s*:/g,"$1:"),")")]}},{key:"formatObj",value:function(t){return JSON.stringify(t,null,2).replace(/"(\w+)"\s*:/g,"$1:")}},{key:"set",value:function(t){var r="";this.options=t;var n=t.isFull;if(n?this.image(t.url,"exact",n,"a"):this.setup(),t.url&&this.res.setAttribute("src",t.url),"exact"===n?'new Image("'.concat(this.url,'", "exact")'):"uncover"===n&&'new Image("'.concat(this.url,'", "uncover")'),t.vtn&&(this.res.style.viewTransitionName=t.vtn),this.vtn=t.vtn,t.minHeight&&(this.res.style.minHeight=t.minHeight),t.index&&P(e,"setIndex",this,3)([t.index]),t.index&&(this.index=t.index),t.index&&(r+='\n index: "'.concat(t.index,'",')),t.centerSelf&&(this.res.style.marginRight="auto",this.res.style.marginLeft="auto"),t.fitContent&&(this.res.style.width="100%",this.res.style.height="100%",this.res.style.marginRight="auto",this.res.style.marginTop="auto",this.res.style.objectFit="cover"),t.objectFit&&(this.res.style.objectFit=t.objectFit),t.objectFit&&(r+='\n objectFit: "'.concat(t.objectFit,'",')),t.as&&this.as(t.as),t.onScroll&&this.onScroll(t.onScroll),t.class&&this.res.setAttribute("class",t.class),t.gpos&&(this.gposObject=t.gpos),t.gpos&&(this.res.style.gridColumn=t.gpos.col,this.res.style.gridRow=t.gpos.row,r+="\n gpos: ".concat(this.removeQuotesFromFirstWord(JSON.stringify(t.gpos)),", ")),t.filtera){var i;i=Array.isArray(t.filtera)?c.filtera.filter((function(t){return"filter"===t.op.name}))[0]:t.filtera;var o=this.removeQuotesFromFirstWord(JSON.stringify(i));r+="\n filtera: ".concat(o,", \n")}if(t.keySet&&this.keySet(t.keySet),t.stype&&this.setType(t.stype),t.isBackground&&(this.isBackground=t.isBackground),t.zIndex&&(this.res.style.zIndex=t.zIndex),t.zIndex&&(r+='\n zIndex: "'.concat(t.zIndex,'", \n')),t.id&&this.res.setAttribute("id",t.id),t.id&&(r+=' id: "'.concat(t.id,'", \n')),this.id=t.id,t.area&&this.setArea(t.area),t.area&&(r+='area: "'.concat(t.area,'", \n')),t.opacity&&(this.res.style.opacity=t.opacity),t.width&&(this.res.style.width=t.width),t.width&&(r+='width: "'.concat(t.width,'", ')),t.maxWidth&&(this.res.style.maxWidth=t.maxWidth),t.maxWidth&&(r+='maxWidth: "'.concat(t.maxWidth,'", ')),t.height&&(this.res.style.height=t.height),t.height&&(r+='height: "'.concat(t.height,'", ')),t.multimargin&&this.makeM